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.
1176 lines
2.1 MiB
1176 lines
2.1 MiB
(self.webpackChunk=self.webpackChunk||[]).push([[337],{8336:function(){"use strict"},12469:function(){"use strict"},99587:function(Bn,zn){"use strict";zn.Z={lists:"lists___xhHyq",item:"item___pWJAA",children:"children___sDG61",diamond:"diamond___FwgzD",button:"button___WPN6r",mathWrap:"mathWrap___FmnMJ",mathFillWrap:"mathFillWrap___PmY3H"}},8423:function(Bn,zn){"use strict";zn.Z={wrap:"wrap___ilWvf",deleteIcon:"deleteIcon___JBDG8",keywordTag:"keywordTag___iieCb",questionTitleEditorWrap:"questionTitleEditorWrap___MHB5s",choiceListWrap:"choiceListWrap___jB8b1",choiceWrap:"choiceWrap___QFkTc",choiceIndex:"choiceIndex___Mr2YO",judgementIndex:"judgementIndex___fUVWK",setAnswerBtn:"setAnswerBtn___Whox5",activeAnswer:"activeAnswer___fGU6Y",activeJudgementAnswer:"activeJudgementAnswer___wJv8P",actionWrapper:"actionWrapper___ERQ7k",addIcon:"addIcon___L9TE0",inputBorder:"inputBorder___Q5tRE",placeholder:"placeholder___p9sFY",blankInputNumberWrapper:"blankInputNumberWrapper___uEHb0",addBtn:"addBtn___WR5ZI",blankIndex:"blankIndex___x9Pny",baseInputWrapper:"baseInputWrapper___eVsG7",collapseWrapper:"collapseWrapper___ZTysU",panelHeader:"panelHeader___QSN9g",open:"open___B6FU9",close:"close___QX19r",hide:"hide___mn25n"}},12327:function(Bn,zn,kt){"use strict";var pt=kt(59301),Ut=Object.defineProperty,ue=Object.getOwnPropertySymbols,Le=Object.prototype.hasOwnProperty,he=Object.prototype.propertyIsEnumerable,Dt=(ne,jt,Te)=>jt in ne?Ut(ne,jt,{enumerable:!0,configurable:!0,writable:!0,value:Te}):ne[jt]=Te,qt=(ne,jt)=>{for(var Te in jt||(jt={}))Le.call(jt,Te)&&Dt(ne,Te,jt[Te]);if(ue)for(var Te of ue(jt))he.call(jt,Te)&&Dt(ne,Te,jt[Te]);return ne};const me=ne=>React.createElement("svg",qt({width:14,height:14,xmlns:"http://www.w3.org/2000/svg"},ne),React.createElement("title",null,"\u7F16\u7EC4 18"),React.createElement("g",{fill:"none",fillRule:"evenodd"},React.createElement("circle",{fill:"#FCB041",cx:7,cy:7,r:7}),React.createElement("path",{d:"M7.531 9.638a.616.616 0 1 1-1.231 0v-.02a.616.616 0 1 1 1.231 0v.02Zm0-2.25a.616.616 0 1 1-1.231 0V4.117a.616.616 0 1 1 1.231 0v3.273Z",fill:"#FFF",fillRule:"nonzero"})));zn.Z="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTQiIGhlaWdodD0iMTQiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48Y2lyY2xlIGZpbGw9IiNGQ0IwNDEiIGN4PSI3IiBjeT0iNyIgcj0iNyIvPjxwYXRoIGQ9Ik03LjUzMSA5LjYzOGEuNjE2LjYxNiAwIDEgMS0xLjIzMSAwdi0uMDJhLjYxNi42MTYgMCAxIDEgMS4yMzEgMHYuMDJabTAtMi4yNWEuNjE2LjYxNiAwIDEgMS0xLjIzMSAwVjQuMTE3YS42MTYuNjE2IDAgMSAxIDEuMjMxIDB2My4yNzNaIiBmaWxsPSIjRkZGIiBmaWxsLXJ1bGU9Im5vbnplcm8iLz48L2c+PC9zdmc+"},63720:function(){"use strict";function Bn(Bt,nt,et,ht){et===void 0&&(et=0),ht===void 0&&(ht=1/0),this._name=Bt,this._defaultValue=nt,this._minimum=et,this._maximum=ht}Object.defineProperty(Bn.prototype,"name",{get:function(){return this._name},set:function(Bt){if(typeof Bt!="string"||Bt==="")throw new Error("Shape name must be a valid string.");this._name=Bt}}),Object.defineProperty(Bn.prototype,"defaultValue",{get:function(){return this._defaultValue},set:function(Bt){if(typeof Bt!="number"||isNaN(Bt))throw new Error("The default value must be a real number, not: "+Bt);this._defaultValue=Bt}}),Object.defineProperty(Bn.prototype,"minimum",{get:function(){return this._minimum},set:function(Bt){if(typeof Bt!="number"||isNaN(Bt))throw new Error("Minimum must be a real number, not: "+Bt);this._minimum=Bt}}),Object.defineProperty(Bn.prototype,"maximum",{get:function(){return this._maximum},set:function(Bt){if(typeof Bt!="number"||isNaN(Bt))throw new Error("Maximum must be a real number, not: "+Bt);this._maximum=Bt}}),go.Shape._FigureParameters={},go.Shape.getFigureParameter=function(Bt,nt){var et=go.Shape._FigureParameters[Bt];return et?et[nt]:null},go.Shape.setFigureParameter=function(Bt,nt,et){if(!(et instanceof Bn))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[Bt];ht||(ht=[],go.Shape._FigureParameters[Bt]=ht),ht[nt]=et};var zn=[];function kt(Bt,nt){var et=zn.pop();return et===void 0?new go.Point(Bt,nt):(et.x=Bt,et.y=nt,et)}function pt(){var Bt=zn.pop();return Bt===void 0?new go.Point:Bt}function Ut(Bt){zn.push(Bt)}function ue(Bt,nt,et,ht,st,gt,vt,St,Et){Et||(Et=new go.Point);var Tt=Bt-et,Ot=st-vt,$t=NaN,Xt=NaN;if(Tt===0)if(Ot===0)Bt===et&&($t=Bt,Xt=nt);else{var Ht=(gt-St)/Ot,ve=gt-Ht*st;$t=Bt,Xt=Ht*$t+ve}else if(Ot===0){var ie=(nt-ht)/Tt,Ne=nt-ie*Bt;$t=st,Xt=ie*$t+Ne}else{var ie=(nt-ht)/Tt,Ht=(gt-St)/Ot,Ne=nt-ie*Bt,ve=gt-Ht*st;$t=(ve-Ne)/(ie-Ht),Xt=ie*$t+Ne}return Et.x=$t,Et.y=Xt,Et}function Le(Bt,nt,et,ht,st,gt,vt,St,Et,Tt,Ot,$t,Xt,Ht){var ve=1-Et,ie=Et,Ne=Bt*ve+et*ie,xe=nt*ve+ht*ie,Pe=et*ve+st*ie,Qe=ht*ve+gt*ie,_e=st*ve+vt*ie,an=gt*ve+St*ie,Ke=Ne*ve+Pe*ie,re=xe*ve+Qe*ie,Jt=Pe*ve+_e*ie,Ye=Qe*ve+an*ie,Gn=Ke*ve+Jt*ie,dn=re*ve+Ye*ie;Tt.x=Ne,Tt.y=xe,Ot.x=Ke,Ot.y=re,$t.x=Gn,$t.y=dn,Xt.x=Jt,Xt.y=Ye,Ht.x=_e,Ht.y=an}var he=new go.Spot(.156,.156),Dt=new go.Spot(.844,.844),qt=4*((Math.sqrt(2)-1)/3);go.Shape.setFigureParameter("RoundedRectangle",0,new Bn("CornerRounding",5)),go.Shape.defineFigureGenerator("RoundedRectangle",function(Bt,nt,et){var ht=Bt?Bt.parameter1:NaN;(isNaN(ht)||ht<0)&&(ht=5),ht=Math.min(ht,nt/3),ht=Math.min(ht,et/3);var st=ht*qt,gt=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-st,0,nt,st)).add(new go.PathSegment(go.PathSegment.Line,nt,et-ht)).add(new go.PathSegment(go.PathSegment.Bezier,nt-ht,et,nt,et-st,nt-st,et)).add(new go.PathSegment(go.PathSegment.Line,ht,et)).add(new go.PathSegment(go.PathSegment.Bezier,0,et-ht,st,et,0,et-st)).add(new go.PathSegment(go.PathSegment.Line,0,ht)).add(new go.PathSegment(go.PathSegment.Bezier,ht,0,0,st,st,0).close()));return st>1&&(gt.spot1=new go.Spot(0,0,st,st),gt.spot2=new go.Spot(1,1,-st,-st)),gt}),go.Shape.defineFigureGenerator("Border","RoundedRectangle"),go.Shape.defineFigureGenerator("TriangleRight",function(Bt,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(Bt,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(Bt,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(Bt,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(Bt,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(Bt,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(Bt,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(Bt,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(Bt,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(Bt,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(Bt,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(Bt,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(Bt,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(Bt,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(Bt,nt,et){var ht=nt/2,st=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 st.spot1=he,st.spot2=Dt,st.defaultStretch=go.GraphObject.Uniform,st}),go.Shape.defineFigureGenerator("Line1",function(Bt,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(Bt,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(Bt,nt,et){return new go.Geometry().add(new go.PathFigure(0,0,!1).add(new go.PathSegment(go.PathSegment.Bezier,nt,et,qt*nt,0,nt,(1-qt)*et)))}),go.Shape.defineFigureGenerator("Curve2",function(Bt,nt,et){return new go.Geometry().add(new go.PathFigure(0,0,!1).add(new go.PathSegment(go.PathSegment.Bezier,nt,et,0,qt*et,(1-qt)*nt,et)))}),go.Shape.defineFigureGenerator("Curve3",function(Bt,nt,et){return new go.Geometry().add(new go.PathFigure(nt,0,!1).add(new go.PathSegment(go.PathSegment.Bezier,0,et,nt,qt*et,qt*nt,et)))}),go.Shape.defineFigureGenerator("Curve4",function(Bt,nt,et){return new go.Geometry().add(new go.PathFigure(nt,0,!1).add(new go.PathSegment(go.PathSegment.Bezier,0,et,(1-qt)*nt,0,0,(1-qt)*et)))}),go.Shape.defineFigureGenerator("TriangleDownLeft",function(Bt,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(Bt,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(Bt,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(Bt,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 Bn("Indent",.1,-.99,.99)),go.Shape.defineFigureGenerator("Parallelogram1",function(Bt,nt,et){var ht=Bt?Bt.parameter1:NaN;isNaN(ht)?ht=.1:ht<-1?ht=-1:ht>1&&(ht=1);var st=Math.abs(ht)*nt;if(ht===0){var gt=new go.Geometry(go.Geometry.Rectangle);return gt.startX=0,gt.startY=0,gt.endX=nt,gt.endY=et,gt}else{var gt=new go.Geometry;return ht>0?gt.add(new go.PathFigure(st,0).add(new go.PathSegment(go.PathSegment.Line,nt,0)).add(new go.PathSegment(go.PathSegment.Line,nt-st,et)).add(new go.PathSegment(go.PathSegment.Line,0,et).close())):gt.add(new go.PathFigure(0,0).add(new go.PathSegment(go.PathSegment.Line,nt-st,0)).add(new go.PathSegment(go.PathSegment.Line,nt,et)).add(new go.PathSegment(go.PathSegment.Line,st,et).close())),st<nt/2&>.setSpots(st/nt,0,(nt-st)/nt,1),gt}}),go.Shape.defineFigureGenerator("Parallelogram","Parallelogram1"),go.Shape.setFigureParameter("Parallelogram2",0,new Bn("Indent",10,-1/0,1/0)),go.Shape.defineFigureGenerator("Parallelogram2",function(Bt,nt,et){var ht=Bt?Bt.parameter1:NaN;isNaN(ht)?ht=10:ht<-nt?ht=-nt:ht>nt&&(ht=nt);var st=Math.abs(ht);if(ht===0){var gt=new go.Geometry(go.Geometry.Rectangle);return gt.startX=0,gt.startY=0,gt.endX=nt,gt.endY=et,gt}else{var gt=new go.Geometry;return ht>0?gt.add(new go.PathFigure(st,0).add(new go.PathSegment(go.PathSegment.Line,nt,0)).add(new go.PathSegment(go.PathSegment.Line,nt-st,et)).add(new go.PathSegment(go.PathSegment.Line,0,et).close())):gt.add(new go.PathFigure(0,0).add(new go.PathSegment(go.PathSegment.Line,nt-st,0)).add(new go.PathSegment(go.PathSegment.Line,nt,et)).add(new go.PathSegment(go.PathSegment.Line,st,et).close())),st<nt/2&>.setSpots(st/nt,0,(nt-st)/nt,1),gt}}),go.Shape.setFigureParameter("Trapezoid1",0,new Bn("Indent",.2,-.99,.99)),go.Shape.defineFigureGenerator("Trapezoid1",function(Bt,nt,et){var ht=Bt?Bt.parameter1:NaN;isNaN(ht)?ht=.2:ht<.5?ht=-.5:ht>.5&&(ht=.5);var st=Math.abs(ht)*nt;if(ht===0){var gt=new go.Geometry(go.Geometry.Rectangle);return gt.startX=0,gt.startY=0,gt.endX=nt,gt.endY=et,gt}else{var gt=new go.Geometry;return ht>0?gt.add(new go.PathFigure(st,0).add(new go.PathSegment(go.PathSegment.Line,nt-st,0)).add(new go.PathSegment(go.PathSegment.Line,nt,et)).add(new go.PathSegment(go.PathSegment.Line,0,et).close())):gt.add(new go.PathFigure(0,0).add(new go.PathSegment(go.PathSegment.Line,nt,0)).add(new go.PathSegment(go.PathSegment.Line,nt-st,et)).add(new go.PathSegment(go.PathSegment.Line,st,et).close())),st<nt/2&>.setSpots(st/nt,0,(nt-st)/nt,1),gt}}),go.Shape.defineFigureGenerator("Trapezoid","Trapezoid1"),go.Shape.setFigureParameter("Trapezoid2",0,new Bn("Indent",20,-1/0,1/0)),go.Shape.defineFigureGenerator("Trapezoid2",function(Bt,nt,et){var ht=Bt?Bt.parameter1:NaN;isNaN(ht)?ht=20:ht<-nt?ht=-nt/2:ht>nt&&(ht=nt/2);var st=Math.abs(ht);if(ht===0){var gt=new go.Geometry(go.Geometry.Rectangle);return gt.startX=0,gt.startY=0,gt.endX=nt,gt.endY=et,gt}else{var gt=new go.Geometry;return ht>0?gt.add(new go.PathFigure(st,0).add(new go.PathSegment(go.PathSegment.Line,nt-st,0)).add(new go.PathSegment(go.PathSegment.Line,nt,et)).add(new go.PathSegment(go.PathSegment.Line,0,et).close())):gt.add(new go.PathFigure(0,0).add(new go.PathSegment(go.PathSegment.Line,nt,0)).add(new go.PathSegment(go.PathSegment.Line,nt-st,et)).add(new go.PathSegment(go.PathSegment.Line,st,et).close())),st<nt/2&>.setSpots(st/nt,0,(nt-st)/nt,1),gt}}),go.Shape.setFigureParameter("ManualOperation",0,new Bn("Indent",10,-1/0,1/0)),go.Shape.defineFigureGenerator("ManualOperation",function(Bt,nt,et){var ht=Bt?Bt.parameter1:NaN;isNaN(ht)?ht=10:ht<-nt?ht=-nt/2:ht>nt&&(ht=nt/2);var st=Math.abs(ht);if(ht===0){var gt=new go.Geometry(go.Geometry.Rectangle);return gt.startX=0,gt.startY=0,gt.endX=nt,gt.endY=et,gt}else{var gt=new go.Geometry;return ht>0?gt.add(new go.PathFigure(0,0).add(new go.PathSegment(go.PathSegment.Line,nt,0)).add(new go.PathSegment(go.PathSegment.Line,nt-st,et)).add(new go.PathSegment(go.PathSegment.Line,st,et).close())):gt.add(new go.PathFigure(st,0).add(new go.PathSegment(go.PathSegment.Line,nt-st,0)).add(new go.PathSegment(go.PathSegment.Line,nt,et)).add(new go.PathSegment(go.PathSegment.Line,0,et).close())),st<nt/2&>.setSpots(st/nt,0,(nt-st)/nt,1),gt}});var me=[];function ne(){var Bt=me.pop();return Bt===void 0?[]:Bt}function jt(Bt){Bt.length=0,me.push(Bt)}function Te(Bt){for(var nt=ne(),et=.5,ht=.5,st=Math.PI*1.5,gt=0,vt=0;vt<Bt;vt++)gt=2*Math.PI/Bt*vt+st,nt[vt]=new go.Point(ht+et*Math.cos(gt),ht+et*Math.sin(gt));return nt.push(nt[0]),nt}function se(Bt){var nt=Ce(Bt),et=ne();et[0]=nt[0];for(var ht=1,st=1;ht<nt.length;ht+=2,st+=3)et[st]=nt[ht],et[st+1]=nt[ht],et[st+2]=nt[ht+1];return jt(nt),et}function Ce(Bt){for(var nt=Te(Bt),et=ne(),ht=Math.floor(nt.length/2),st=nt.length-1,gt=Bt%2===0?2:1,vt=0;vt<st;vt++){var St=nt[vt],Et=nt[vt+1],Tt=nt[(ht+vt-1)%st],Ot=nt[(ht+vt+gt)%st];et[vt*2]=St,et[vt*2+1]=ue(St.x,St.y,Tt.x,Tt.y,Et.x,Et.y,Ot.x,Ot.y,new go.Point)}return et[et.length]=et[0],jt(nt),et}go.Shape.defineFigureGenerator("Pentagon",function(Bt,nt,et){var ht=Te(5),st=new go.Geometry,gt=new go.PathFigure(ht[0].x*nt,ht[0].y*et,!0);st.add(gt);for(var vt=1;vt<5;vt++)gt.add(new go.PathSegment(go.PathSegment.Line,ht[vt].x*nt,ht[vt].y*et));return gt.add(new go.PathSegment(go.PathSegment.Line,ht[0].x*nt,ht[0].y*et).close()),jt(ht),st.spot1=new go.Spot(.2,.22),st.spot2=new go.Spot(.8,.9),st}),go.Shape.defineFigureGenerator("Hexagon",function(Bt,nt,et){var ht=Te(6),st=new go.Geometry,gt=new go.PathFigure(ht[0].x*nt,ht[0].y*et,!0);st.add(gt);for(var vt=1;vt<6;vt++)gt.add(new go.PathSegment(go.PathSegment.Line,ht[vt].x*nt,ht[vt].y*et));return gt.add(new go.PathSegment(go.PathSegment.Line,ht[0].x*nt,ht[0].y*et).close()),jt(ht),st.spot1=new go.Spot(.07,.25),st.spot2=new go.Spot(.93,.75),st}),go.Shape.defineFigureGenerator("Heptagon",function(Bt,nt,et){var ht=Te(7),st=new go.Geometry,gt=new go.PathFigure(ht[0].x*nt,ht[0].y*et,!0);st.add(gt);for(var vt=1;vt<7;vt++)gt.add(new go.PathSegment(go.PathSegment.Line,ht[vt].x*nt,ht[vt].y*et));return gt.add(new go.PathSegment(go.PathSegment.Line,ht[0].x*nt,ht[0].y*et).close()),jt(ht),st.spot1=new go.Spot(.2,.15),st.spot2=new go.Spot(.8,.85),st}),go.Shape.defineFigureGenerator("Octagon",function(Bt,nt,et){var ht=Te(8),st=new go.Geometry,gt=new go.PathFigure(ht[0].x*nt,ht[0].y*et,!0);st.add(gt);for(var vt=1;vt<8;vt++)gt.add(new go.PathSegment(go.PathSegment.Line,ht[vt].x*nt,ht[vt].y*et));return gt.add(new go.PathSegment(go.PathSegment.Line,ht[0].x*nt,ht[0].y*et).close()),jt(ht),st.spot1=new go.Spot(.15,.15),st.spot2=new go.Spot(.85,.85),st}),go.Shape.defineFigureGenerator("Nonagon",function(Bt,nt,et){var ht=Te(9),st=new go.Geometry,gt=new go.PathFigure(ht[0].x*nt,ht[0].y*et,!0);st.add(gt);for(var vt=1;vt<9;vt++)gt.add(new go.PathSegment(go.PathSegment.Line,ht[vt].x*nt,ht[vt].y*et));return gt.add(new go.PathSegment(go.PathSegment.Line,ht[0].x*nt,ht[0].y*et).close()),jt(ht),st.spot1=new go.Spot(.17,.13),st.spot2=new go.Spot(.82,.82),st}),go.Shape.defineFigureGenerator("Decagon",function(Bt,nt,et){var ht=Te(10),st=new go.Geometry,gt=new go.PathFigure(ht[0].x*nt,ht[0].y*et,!0);st.add(gt);for(var vt=1;vt<10;vt++)gt.add(new go.PathSegment(go.PathSegment.Line,ht[vt].x*nt,ht[vt].y*et));return gt.add(new go.PathSegment(go.PathSegment.Line,ht[0].x*nt,ht[0].y*et).close()),jt(ht),st.spot1=new go.Spot(.16,.16),st.spot2=new go.Spot(.84,.84),st}),go.Shape.defineFigureGenerator("Dodecagon",function(Bt,nt,et){var ht=Te(12),st=new go.Geometry,gt=new go.PathFigure(ht[0].x*nt,ht[0].y*et,!0);st.add(gt);for(var vt=1;vt<12;vt++)gt.add(new go.PathSegment(go.PathSegment.Line,ht[vt].x*nt,ht[vt].y*et));return gt.add(new go.PathSegment(go.PathSegment.Line,ht[0].x*nt,ht[0].y*et).close()),jt(ht),st.spot1=new go.Spot(.16,.16),st.spot2=new go.Spot(.84,.84),st}),go.Shape.defineFigureGenerator("FivePointedStar",function(Bt,nt,et){var ht=Ce(5),st=new go.Geometry,gt=new go.PathFigure(ht[0].x*nt,ht[0].y*et,!0);st.add(gt);for(var vt=1;vt<10;vt++)gt.add(new go.PathSegment(go.PathSegment.Line,ht[vt].x*nt,ht[vt].y*et));return gt.add(new go.PathSegment(go.PathSegment.Line,ht[0].x*nt,ht[0].y*et).close()),jt(ht),st.spot1=new go.Spot(.266,.333),st.spot2=new go.Spot(.733,.733),st}),go.Shape.defineFigureGenerator("SixPointedStar",function(Bt,nt,et){var ht=Ce(6),st=new go.Geometry,gt=new go.PathFigure(ht[0].x*nt,ht[0].y*et,!0);st.add(gt);for(var vt=1;vt<12;vt++)gt.add(new go.PathSegment(go.PathSegment.Line,ht[vt].x*nt,ht[vt].y*et));return gt.add(new go.PathSegment(go.PathSegment.Line,ht[0].x*nt,ht[0].y*et).close()),jt(ht),st.spot1=new go.Spot(.17,.25),st.spot2=new go.Spot(.83,.75),st}),go.Shape.defineFigureGenerator("SevenPointedStar",function(Bt,nt,et){var ht=Ce(7),st=new go.Geometry,gt=new go.PathFigure(ht[0].x*nt,ht[0].y*et,!0);st.add(gt);for(var vt=1;vt<14;vt++)gt.add(new go.PathSegment(go.PathSegment.Line,ht[vt].x*nt,ht[vt].y*et));return gt.add(new go.PathSegment(go.PathSegment.Line,ht[0].x*nt,ht[0].y*et).close()),jt(ht),st.spot1=new go.Spot(.222,.277),st.spot2=new go.Spot(.777,.666),st}),go.Shape.defineFigureGenerator("EightPointedStar",function(Bt,nt,et){var ht=Ce(8),st=new go.Geometry,gt=new go.PathFigure(ht[0].x*nt,ht[0].y*et,!0);st.add(gt);for(var vt=1;vt<16;vt++)gt.add(new go.PathSegment(go.PathSegment.Line,ht[vt].x*nt,ht[vt].y*et));return gt.add(new go.PathSegment(go.PathSegment.Line,ht[0].x*nt,ht[0].y*et).close()),jt(ht),st.spot1=new go.Spot(.25,.25),st.spot2=new go.Spot(.75,.75),st}),go.Shape.defineFigureGenerator("NinePointedStar",function(Bt,nt,et){var ht=Ce(9),st=new go.Geometry,gt=new go.PathFigure(ht[0].x*nt,ht[0].y*et,!0);st.add(gt);for(var vt=1;vt<18;vt++)gt.add(new go.PathSegment(go.PathSegment.Line,ht[vt].x*nt,ht[vt].y*et));return gt.add(new go.PathSegment(go.PathSegment.Line,ht[0].x*nt,ht[0].y*et).close()),jt(ht),st.spot1=new go.Spot(.222,.277),st.spot2=new go.Spot(.777,.666),st}),go.Shape.defineFigureGenerator("TenPointedStar",function(Bt,nt,et){var ht=Ce(10),st=new go.Geometry,gt=new go.PathFigure(ht[0].x*nt,ht[0].y*et,!0);st.add(gt);for(var vt=1;vt<20;vt++)gt.add(new go.PathSegment(go.PathSegment.Line,ht[vt].x*nt,ht[vt].y*et));return gt.add(new go.PathSegment(go.PathSegment.Line,ht[0].x*nt,ht[0].y*et).close()),jt(ht),st.spot1=new go.Spot(.281,.261),st.spot2=new go.Spot(.723,.748),st}),go.Shape.defineFigureGenerator("FivePointedBurst",function(Bt,nt,et){var ht=se(5),st=new go.Geometry,gt=new go.PathFigure(ht[0].x*nt,ht[0].y*et,!0);st.add(gt);for(var vt=1;vt<ht.length;vt+=3)gt.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 gt.segments.last().close(),jt(ht),st.spot1=new go.Spot(.222,.277),st.spot2=new go.Spot(.777,.777),st}),go.Shape.defineFigureGenerator("SixPointedBurst",function(Bt,nt,et){var ht=se(6),st=new go.Geometry,gt=new go.PathFigure(ht[0].x*nt,ht[0].y*et,!0);st.add(gt);for(var vt=1;vt<ht.length;vt+=3)gt.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 gt.segments.last().close(),jt(ht),st.spot1=new go.Spot(.17,.222),st.spot2=new go.Spot(.833,.777),st}),go.Shape.defineFigureGenerator("SevenPointedBurst",function(Bt,nt,et){var ht=se(7),st=new go.Geometry,gt=new go.PathFigure(ht[0].x*nt,ht[0].y*et,!0);st.add(gt);for(var vt=1;vt<ht.length;vt+=3)gt.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 gt.segments.last().close(),jt(ht),st.spot1=new go.Spot(.222,.222),st.spot2=new go.Spot(.777,.777),st}),go.Shape.defineFigureGenerator("EightPointedBurst",function(Bt,nt,et){var ht=se(8),st=new go.Geometry,gt=new go.PathFigure(ht[0].x*nt,ht[0].y*et,!0);st.add(gt);for(var vt=1;vt<ht.length;vt+=3)gt.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 gt.segments.last().close(),jt(ht),st.spot1=new go.Spot(.222,.222),st.spot2=new go.Spot(.777,.777),st}),go.Shape.defineFigureGenerator("NinePointedBurst",function(Bt,nt,et){var ht=se(9),st=new go.Geometry,gt=new go.PathFigure(ht[0].x*nt,ht[0].y*et,!0);st.add(gt);for(var vt=1;vt<ht.length;vt+=3)gt.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 gt.segments.last().close(),jt(ht),st.spot1=new go.Spot(.222,.222),st.spot2=new go.Spot(.777,.777),st}),go.Shape.defineFigureGenerator("TenPointedBurst",function(Bt,nt,et){var ht=se(10),st=new go.Geometry,gt=new go.PathFigure(ht[0].x*nt,ht[0].y*et,!0);st.add(gt);for(var vt=1;vt<ht.length;vt+=3)gt.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 gt.segments.last().close(),jt(ht),st.spot1=new go.Spot(.222,.222),st.spot2=new go.Spot(.777,.777),st}),go.Shape.setFigureParameter("FramedRectangle",0,new Bn("ThicknessX",8)),go.Shape.setFigureParameter("FramedRectangle",1,new Bn("ThicknessY",8)),go.Shape.defineFigureGenerator("FramedRectangle",function(Bt,nt,et){var ht=Bt?Bt.parameter1:NaN,st=Bt?Bt.parameter2:NaN;isNaN(ht)&&(ht=8),isNaN(st)&&(st=8);var gt=new go.Geometry,vt=new go.PathFigure(0,0,!0);return gt.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&&st<et/2&&(vt.add(new go.PathSegment(go.PathSegment.Move,ht,st)),vt.add(new go.PathSegment(go.PathSegment.Line,ht,et-st)),vt.add(new go.PathSegment(go.PathSegment.Line,nt-ht,et-st)),vt.add(new go.PathSegment(go.PathSegment.Line,nt-ht,st).close())),gt.setSpots(0,0,1,1,ht,st,-ht,-st),gt}),go.Shape.setFigureParameter("Ring",0,new Bn("Thickness",8)),go.Shape.defineFigureGenerator("Ring",function(Bt,nt,et){var ht=Bt?Bt.parameter1:NaN;(isNaN(ht)||ht<0)&&(ht=8);var st=nt/2,gt=new go.Geometry,vt=new go.PathFigure(nt,nt/2,!0);gt.add(vt),vt.add(new go.PathSegment(go.PathSegment.Arc,0,360,st,st,st,st).close());var St=Math.max(st-ht,0);return St>0&&(vt.add(new go.PathSegment(go.PathSegment.Move,nt/2+St,nt/2)),vt.add(new go.PathSegment(go.PathSegment.Arc,0,-360,st,st,St,St).close())),gt.spot1=he,gt.spot2=Dt,gt.defaultStretch=go.GraphObject.Uniform,gt}),go.Shape.defineFigureGenerator("Cloud",function(Bt,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(Bt,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 Bn("Start",0,-360,360)),go.Shape.setFigureParameter("Pie",1,new Bn("Sweep",315,-360,360)),go.Shape.defineFigureGenerator("Pie",function(Bt,nt,et){var ht=Bt?Bt.parameter1:NaN,st=Bt?Bt.parameter2:NaN;isNaN(ht)&&(ht=0),isNaN(st)&&(st=315);var gt=ht%360;gt<0&&(gt+=360);var vt=st%360,St=Math.min(nt,et)/2;return new go.Geometry().add(new go.PathFigure(St,St).add(new go.PathSegment(go.PathSegment.Arc,gt,vt,St,St,St,St).close()))}),go.Shape.defineFigureGenerator("PiePiece",function(Bt,nt,et){var ht=qt/Math.SQRT2*.5,st=Math.SQRT2/2,gt=1-Math.SQRT2/2;return new go.Geometry().add(new go.PathFigure(nt,et,!0).add(new go.PathSegment(go.PathSegment.Bezier,st*nt,gt*et,nt,(1-ht)*et,(st+ht)*nt,(gt+ht)*et)).add(new go.PathSegment(go.PathSegment.Line,0,et).close()))}),go.Shape.setFigureParameter("ThickCross",0,new Bn("Thickness",30)),go.Shape.defineFigureGenerator("ThickCross",function(Bt,nt,et){var ht=Bt?Bt.parameter1:NaN;(isNaN(ht)||ht<0)&&(ht=30);var st=Math.min(ht,nt)/2,gt=nt/2,vt=et/2;return new go.Geometry().add(new go.PathFigure(gt-st,0,!0).add(new go.PathSegment(go.PathSegment.Line,gt+st,0)).add(new go.PathSegment(go.PathSegment.Line,gt+st,vt-st)).add(new go.PathSegment(go.PathSegment.Line,nt,vt-st)).add(new go.PathSegment(go.PathSegment.Line,nt,vt+st)).add(new go.PathSegment(go.PathSegment.Line,gt+st,vt+st)).add(new go.PathSegment(go.PathSegment.Line,gt+st,et)).add(new go.PathSegment(go.PathSegment.Line,gt-st,et)).add(new go.PathSegment(go.PathSegment.Line,gt-st,vt+st)).add(new go.PathSegment(go.PathSegment.Line,0,vt+st)).add(new go.PathSegment(go.PathSegment.Line,0,vt-st)).add(new go.PathSegment(go.PathSegment.Line,gt-st,vt-st).close()))}),go.Shape.setFigureParameter("ThinCross",0,new Bn("Thickness",10)),go.Shape.defineFigureGenerator("ThinCross",function(Bt,nt,et){var ht=Bt?Bt.parameter1:NaN;(isNaN(ht)||ht<0)&&(ht=10);var st=Math.min(ht,nt)/2,gt=nt/2,vt=et/2;return new go.Geometry().add(new go.PathFigure(gt-st,0,!0).add(new go.PathSegment(go.PathSegment.Line,gt+st,0)).add(new go.PathSegment(go.PathSegment.Line,gt+st,vt-st)).add(new go.PathSegment(go.PathSegment.Line,nt,vt-st)).add(new go.PathSegment(go.PathSegment.Line,nt,vt+st)).add(new go.PathSegment(go.PathSegment.Line,gt+st,vt+st)).add(new go.PathSegment(go.PathSegment.Line,gt+st,et)).add(new go.PathSegment(go.PathSegment.Line,gt-st,et)).add(new go.PathSegment(go.PathSegment.Line,gt-st,vt+st)).add(new go.PathSegment(go.PathSegment.Line,0,vt+st)).add(new go.PathSegment(go.PathSegment.Line,0,vt-st)).add(new go.PathSegment(go.PathSegment.Line,gt-st,vt-st).close()))}),go.Shape.setFigureParameter("ThickX",0,new Bn("Thickness",30)),go.Shape.defineFigureGenerator("ThickX",function(Bt,nt,et){var ht=Bt?Bt.parameter1:NaN;if((isNaN(ht)||ht<0)&&(ht=30),nt===0||et===0){var st=new go.Geometry(go.Geometry.Rectangle);return st.startX=0,st.startY=0,st.endX=nt,st.endY=et,st}else{var gt=nt/2,vt=et/2,St=Math.atan2(et,nt),Et=ht-Math.min(Math.cos(St)*ht/2,gt),Tt=ht-Math.min(Math.sin(St)*ht/2,vt),st=new go.Geometry,Ot=new go.PathFigure(Et,0,!0);return st.add(Ot),Ot.add(new go.PathSegment(go.PathSegment.Line,gt,.2*et)),Ot.add(new go.PathSegment(go.PathSegment.Line,nt-Et,0)),Ot.add(new go.PathSegment(go.PathSegment.Line,nt,Tt)),Ot.add(new go.PathSegment(go.PathSegment.Line,.8*nt,vt)),Ot.add(new go.PathSegment(go.PathSegment.Line,nt,et-Tt)),Ot.add(new go.PathSegment(go.PathSegment.Line,nt-Et,et)),Ot.add(new go.PathSegment(go.PathSegment.Line,gt,.8*et)),Ot.add(new go.PathSegment(go.PathSegment.Line,Et,et)),Ot.add(new go.PathSegment(go.PathSegment.Line,0,et-Tt)),Ot.add(new go.PathSegment(go.PathSegment.Line,.2*nt,vt)),Ot.add(new go.PathSegment(go.PathSegment.Line,0,Tt).close()),st}}),go.Shape.setFigureParameter("ThinX",0,new Bn("Thickness",10)),go.Shape.defineFigureGenerator("ThinX",function(Bt,nt,et){var ht=Bt?Bt.parameter1:NaN;(isNaN(ht)||ht<0)&&(ht=10);var st=new go.Geometry,gt=new go.PathFigure(.1*nt,0,!0);return st.add(gt),gt.add(new go.PathSegment(go.PathSegment.Line,.5*nt,.4*et)),gt.add(new go.PathSegment(go.PathSegment.Line,.9*nt,0)),gt.add(new go.PathSegment(go.PathSegment.Line,nt,.1*et)),gt.add(new go.PathSegment(go.PathSegment.Line,.6*nt,.5*et)),gt.add(new go.PathSegment(go.PathSegment.Line,nt,.9*et)),gt.add(new go.PathSegment(go.PathSegment.Line,.9*nt,et)),gt.add(new go.PathSegment(go.PathSegment.Line,.5*nt,.6*et)),gt.add(new go.PathSegment(go.PathSegment.Line,.1*nt,et)),gt.add(new go.PathSegment(go.PathSegment.Line,0,.9*et)),gt.add(new go.PathSegment(go.PathSegment.Line,.4*nt,.5*et)),gt.add(new go.PathSegment(go.PathSegment.Line,0,.1*et).close()),st}),go.Shape.setFigureParameter("SquareIBeam",0,new Bn("BeamWidth",.2,.1,.9)),go.Shape.defineFigureGenerator("SquareIBeam",function(Bt,nt,et){var ht=Bt?Bt.parameter1:NaN;isNaN(ht)&&(ht=.2);var st=new go.Geometry,gt=new go.PathFigure(0,0,!0);return st.add(gt),gt.add(new go.PathSegment(go.PathSegment.Line,nt,0)),gt.add(new go.PathSegment(go.PathSegment.Line,nt,ht*et)),gt.add(new go.PathSegment(go.PathSegment.Line,(.5+ht/2)*nt,ht*et)),gt.add(new go.PathSegment(go.PathSegment.Line,(.5+ht/2)*nt,(1-ht)*et)),gt.add(new go.PathSegment(go.PathSegment.Line,nt,(1-ht)*et)),gt.add(new go.PathSegment(go.PathSegment.Line,nt,et)),gt.add(new go.PathSegment(go.PathSegment.Line,0,et)),gt.add(new go.PathSegment(go.PathSegment.Line,0,(1-ht)*et)),gt.add(new go.PathSegment(go.PathSegment.Line,(.5-ht/2)*nt,(1-ht)*et)),gt.add(new go.PathSegment(go.PathSegment.Line,(.5-ht/2)*nt,ht*et)),gt.add(new go.PathSegment(go.PathSegment.Line,0,ht*et).close()),st}),go.Shape.setFigureParameter("RoundedIBeam",0,new Bn("Curviness",.5,.05,.65)),go.Shape.defineFigureGenerator("RoundedIBeam",function(Bt,nt,et){var ht=Bt?Bt.parameter1:NaN;isNaN(ht)&&(ht=.5);var st=new go.Geometry,gt=new go.PathFigure(0,0,!0);return st.add(gt),gt.add(new go.PathSegment(go.PathSegment.Line,nt,0)),gt.add(new go.PathSegment(go.PathSegment.Bezier,nt,et,Math.abs(1-ht)*nt,.25*et,Math.abs(1-ht)*nt,.75*et)),gt.add(new go.PathSegment(go.PathSegment.Line,0,et)),gt.add(new go.PathSegment(go.PathSegment.Bezier,0,0,ht*nt,.75*et,ht*nt,.25*et).close()),st}),go.Shape.defineFigureGenerator("HalfEllipse",function(Bt,nt,et){return new go.Geometry().add(new go.PathFigure(0,0,!0).add(new go.PathSegment(go.PathSegment.Bezier,nt,.5*et,qt*nt,0,nt,(.5-qt/2)*et)).add(new go.PathSegment(go.PathSegment.Bezier,0,et,nt,(.5+qt/2)*et,qt*nt,et).close())).setSpots(0,.156,.844,.844)}),go.Shape.defineFigureGenerator("Crescent",function(Bt,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(Bt,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(Bt,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(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(.4*nt,.6*et,!0);ht.add(st),st.add(new go.PathSegment(go.PathSegment.Bezier,.15*nt,et,.5*nt,.75*et,.45*nt,.95*et)),st.add(new go.PathSegment(go.PathSegment.Line,.85*nt,et)),st.add(new go.PathSegment(go.PathSegment.Bezier,.6*nt,.6*et,.55*nt,.95*et,.5*nt,.75*et));var gt=.2,vt=.3,St=0,Et=gt*qt;return st.add(new go.PathSegment(go.PathSegment.Bezier,(.5+vt)*nt,(.5+gt+St)*et,(.5-gt+vt)*nt,(.5+Et+St)*et,(.5-Et+vt)*nt,(.5+gt+St)*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,(1-.5+gt+vt)*nt,(.5+St)*et,(.5+Et+vt)*nt,(.5+gt+St)*et,(.5+gt+vt)*nt,(.5+Et+St)*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,(.5+vt)*nt,(.5-gt+St)*et,(1-.5+gt+vt)*nt,(.5-Et+St)*et,(.5+Et+vt)*nt,(.5-gt+St)*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,.65*nt,.36771243*et,(.5-Et+vt)*nt,(.5-gt+St)*et,(.5-gt+vt+.05)*nt,(.5-Et+St-.02)*et)),gt=.2,vt=0,St=-.3,Et=gt*qt,st.add(new go.PathSegment(go.PathSegment.Bezier,(1-.5+gt+vt)*nt,(.5+St)*et,(.5+Et+vt)*nt,(.5+gt+St)*et,(.5+gt+vt)*nt,(.5+Et+St)*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,(.5+vt)*nt,(.5-gt+St)*et,(1-.5+gt+vt)*nt,(.5-Et+St)*et,(.5+Et+vt)*nt,(.5-gt+St)*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,(.5-gt+vt)*nt,(.5+St)*et,(.5-Et+vt)*nt,(.5-gt+St)*et,(.5-gt+vt)*nt,(.5-Et+St)*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,(.5-Et+vt)*nt,(.5+gt+St)*et,(.5-gt+vt)*nt,(.5+Et+St)*et,(.5-Et+vt)*nt,(.5+gt+St)*et)),gt=.2,vt=-.3,St=0,Et=gt*qt,st.add(new go.PathSegment(go.PathSegment.Bezier,(.5+vt)*nt,(.5-gt+St)*et,(1-.5+gt+vt-.05)*nt,(.5-Et+St-.02)*et,(.5+Et+vt)*nt,(.5-gt+St)*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,(.5-gt+vt)*nt,(.5+St)*et,(.5-Et+vt)*nt,(.5-gt+St)*et,(.5-gt+vt)*nt,(.5-Et+St)*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,(.5+vt)*nt,(.5+gt+St)*et,(.5-gt+vt)*nt,(.5+Et+St)*et,(.5-Et+vt)*nt,(.5+gt+St)*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,.4*nt,.6*et,(.5+Et+vt)*nt,(.5+gt+St)*et,(.5+gt+vt)*nt,(.5+Et+St)*et).close()),ht.setSpots(.06,.33,.93,.68),ht}),go.Shape.defineFigureGenerator("YinYang",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(nt*.5,0,!0);ht.add(st),st.add(new go.PathSegment(go.PathSegment.Arc,270,180,nt*.5,nt*.5,nt*.5,nt*.5)),st.add(new go.PathSegment(go.PathSegment.Arc,90,-180,nt*.5,nt*.75,nt*.25,nt*.25)),st.add(new go.PathSegment(go.PathSegment.Arc,90,180,nt*.5,nt*.25,nt*.25,nt*.25));var gt=.1,vt=.5,St=.25;return st.add(new go.PathSegment(go.PathSegment.Move,(vt+gt)*nt,St*et)),st.add(new go.PathSegment(go.PathSegment.Arc,0,-360,nt*vt,et*St,gt*nt,gt*nt).close()),st=new go.PathFigure(nt*.5,0,!1),ht.add(st),st.add(new go.PathSegment(go.PathSegment.Arc,270,-180,nt*.5,nt*.5,nt*.5,nt*.5)),St=.75,st=new go.PathFigure((vt+gt)*nt,St*et,!0),ht.add(st),st.add(new go.PathSegment(go.PathSegment.Arc,0,360,nt*vt,et*St,gt*nt,gt*nt).close()),ht.defaultStretch=go.GraphObject.Uniform,ht}),go.Shape.defineFigureGenerator("Peace",function(Bt,nt,et){var ht=.8535533905932737,st=.5*nt,gt=.5*et;return new go.Geometry().add(new go.PathFigure(st,0,!1).add(new go.PathSegment(go.PathSegment.Arc,270,360,st,gt,st,gt)).add(new go.PathSegment(go.PathSegment.Line,st,et)).add(new go.PathSegment(go.PathSegment.Move,st,gt)).add(new go.PathSegment(go.PathSegment.Line,(1-ht)*nt,ht*et)).add(new go.PathSegment(go.PathSegment.Move,st,gt)).add(new go.PathSegment(go.PathSegment.Line,ht*nt,ht*et)))}),go.Shape.defineFigureGenerator("NotAllowed",function(Bt,nt,et){var ht=new go.Geometry,st=qt*.5,gt=.5,vt=.5,St=.5,Et=new go.PathFigure(vt*nt,(St-gt)*et);ht.add(Et),Et.add(new go.PathSegment(go.PathSegment.Bezier,(vt-gt)*nt,St*et,(vt-st)*nt,(St-gt)*et,(vt-gt)*nt,(St-st)*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,(St+gt)*et,(vt-gt)*nt,(St+st)*et,(vt-st)*nt,(St+gt)*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,(vt+gt)*nt,St*et,(vt+st)*nt,(St+gt)*et,(vt+gt)*nt,(St+st)*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,(St-gt)*et,(vt+gt)*nt,(St-st)*et,(vt+st)*nt,(St-gt)*et)),gt=.4,st=qt*.4;var Tt=pt(),Ot=pt(),$t=pt(),Xt=pt();Le(vt,St-gt,vt+st,St-gt,vt+gt,St-st,vt+gt,St,.42,Tt,Ot,$t,Xt,Xt);var Ht=pt(),ve=pt(),ie=pt();Le(vt,St-gt,vt+st,St-gt,vt+gt,St-st,vt+gt,St,.58,Xt,Xt,ie,Ht,ve);var Ne=pt(),xe=pt(),Pe=pt();Le(vt,St+gt,vt-st,St+gt,vt-gt,St+st,vt-gt,St,.42,Ne,xe,Pe,Xt,Xt);var Qe=pt(),_e=pt(),an=pt();return Le(vt,St+gt,vt-st,St+gt,vt-gt,St+st,vt-gt,St,.58,Xt,Xt,an,Qe,_e),Et.add(new go.PathSegment(go.PathSegment.Move,an.x*nt,an.y*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,(vt-gt)*nt,St*et,Qe.x*nt,Qe.y*et,_e.x*nt,_e.y*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,(St-gt)*et,(vt-gt)*nt,(St-st)*et,(vt-st)*nt,(St-gt)*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,$t.x*nt,$t.y*et,Tt.x*nt,Tt.y*et,Ot.x*nt,Ot.y*et)),Et.add(new go.PathSegment(go.PathSegment.Line,an.x*nt,an.y*et).close()),Et.add(new go.PathSegment(go.PathSegment.Move,Pe.x*nt,Pe.y*et)),Et.add(new go.PathSegment(go.PathSegment.Line,ie.x*nt,ie.y*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,(vt+gt)*nt,St*et,Ht.x*nt,Ht.y*et,ve.x*nt,ve.y*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,(St+gt)*et,(vt+gt)*nt,(St+st)*et,(vt+st)*nt,(St+gt)*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,Pe.x*nt,Pe.y*et,Ne.x*nt,Ne.y*et,xe.x*nt,xe.y*et).close()),Ut(Tt),Ut(Ot),Ut($t),Ut(Xt),Ut(Ht),Ut(ve),Ut(ie),Ut(Ne),Ut(xe),Ut(Pe),Ut(Qe),Ut(_e),Ut(an),ht.defaultStretch=go.GraphObject.Uniform,ht}),go.Shape.defineFigureGenerator("Fragile",function(Bt,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 Bn("Thickness",30)),go.Shape.defineFigureGenerator("HourGlass",function(Bt,nt,et){var ht=Bt?Bt.parameter1:NaN;(isNaN(ht)||ht<0)&&(ht=30),ht>nt&&(ht=nt);var st=(nt-ht)/2,gt=st+ht;return new go.Geometry().add(new go.PathFigure(gt,.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,st,.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(Bt,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(Bt,nt,et){var ht=new go.Geometry,st=qt*.4,gt=.4,vt=.5,St=.5,Et=pt(),Tt=pt(),Ot=pt(),$t=pt(),Xt=new go.PathFigure((vt-gt)*nt,St*et,!1);ht.add(Xt),Xt.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,(St-gt)*et,(vt-gt)*nt,(St-st)*et,(vt-st)*nt,(St-gt)*et)),Le(vt,St-gt,vt+st,St-gt,vt+gt,St-st,vt+gt,St,.44,Ot,$t,Tt,Et,Et),Xt.add(new go.PathSegment(go.PathSegment.Bezier,Tt.x*nt,Tt.y*et,Ot.x*nt,Ot.y*et,$t.x*nt,$t.y*et));var Ht=kt(Tt.x,Tt.y);Le(vt,St-gt,vt+st,St-gt,vt+gt,St-st,vt+gt,St,.56,Et,Et,Tt,Ot,$t);var ve=kt(Tt.x,Tt.y);Xt.add(new go.PathSegment(go.PathSegment.Line,(Ht.x*.1+.95*.9)*nt,Ht.y*.1*et)),Xt.add(new go.PathSegment(go.PathSegment.Line,.85*nt,Ht.y*.1*et)),Xt.add(new go.PathSegment(go.PathSegment.Line,.85*nt,0)),Xt.add(new go.PathSegment(go.PathSegment.Line,nt,0)),Xt.add(new go.PathSegment(go.PathSegment.Line,nt,.15*et)),Xt.add(new go.PathSegment(go.PathSegment.Line,(ve.x*.1+.9)*nt,.15*et)),Xt.add(new go.PathSegment(go.PathSegment.Line,(ve.x*.1+.9)*nt,(ve.y*.1+.05*.9)*et)),Xt.add(new go.PathSegment(go.PathSegment.Line,ve.x*nt,ve.y*et)),Xt.add(new go.PathSegment(go.PathSegment.Bezier,(vt+gt)*nt,St*et,Ot.x*nt,Ot.y*et,$t.x*nt,$t.y*et)),Xt.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,(St+gt)*et,(vt+gt)*nt,(St+st)*et,(vt+st)*nt,(St+gt)*et)),Xt.add(new go.PathSegment(go.PathSegment.Bezier,(vt-gt)*nt,St*et,(vt-st)*nt,(St+gt)*et,(vt-gt)*nt,(St+st)*et)),gt=.35,st=qt*.35;var ie=new go.PathFigure(vt*nt,(St-gt)*et,!1);ht.add(ie),ie.add(new go.PathSegment(go.PathSegment.Bezier,(vt-gt)*nt,St*et,(vt-st)*nt,(St-gt)*et,(vt-gt)*nt,(St-st)*et)),ie.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,(St+gt)*et,(vt-gt)*nt,(St+st)*et,(vt-st)*nt,(St+gt)*et)),ie.add(new go.PathSegment(go.PathSegment.Bezier,(vt+gt)*nt,St*et,(vt+st)*nt,(St+gt)*et,(vt+gt)*nt,(St+st)*et)),ie.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,(St-gt)*et,(vt+gt)*nt,(St-st)*et,(vt+st)*nt,(St-gt)*et));var Ne=new go.PathFigure((vt-gt)*nt,St*et,!1);return ht.add(Ne),Ut(Et),Ut(Tt),Ut(Ot),Ut($t),Ut(Ht),Ut(ve),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(Bt,nt,et){var ht=new go.Geometry,st=.375,gt=0,vt=-.125,St=st*qt,Et=new go.PathFigure((.525+gt)*nt,(.5+st+vt)*et,!1);ht.add(Et),Et.add(new go.PathSegment(go.PathSegment.Bezier,(1-.5+st+gt)*nt,(.5+vt)*et,(.5+St+gt)*nt,(.5+st+vt)*et,(.5+st+gt)*nt,(.5+St+vt)*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,(.5+gt)*nt,(.5-st+vt)*et,(1-.5+st+gt)*nt,(.5-St+vt)*et,(.5+St+gt)*nt,(.5-st+vt)*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,(.5-st+gt)*nt,(.5+vt)*et,(.5-St+gt)*nt,(.5-st+vt)*et,(.5-st+gt)*nt,(.5-St+vt)*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,(.475+gt)*nt,(.5+st+vt)*et,(.5-st+gt)*nt,(.5+St+vt)*et,(.5-St+gt)*nt,(.5+st+vt)*et)),Et.add(new go.PathSegment(go.PathSegment.Line,.475*nt,.85*et)),Et.add(new go.PathSegment(go.PathSegment.Line,.425*nt,.85*et)),Et.add(new go.PathSegment(go.PathSegment.Line,.425*nt,.9*et)),Et.add(new go.PathSegment(go.PathSegment.Line,.475*nt,.9*et)),Et.add(new go.PathSegment(go.PathSegment.Line,.475*nt,et)),Et.add(new go.PathSegment(go.PathSegment.Line,.525*nt,et)),Et.add(new go.PathSegment(go.PathSegment.Line,.525*nt,.9*et)),Et.add(new go.PathSegment(go.PathSegment.Line,.575*nt,.9*et)),Et.add(new go.PathSegment(go.PathSegment.Line,.575*nt,.85*et)),Et.add(new go.PathSegment(go.PathSegment.Line,.525*nt,.85*et).close()),st=.325,gt=0,vt=-.125,St=st*qt;var Et=new go.PathFigure((1-.5+st+gt)*nt,(.5+vt)*et,!1);ht.add(Et),Et.add(new go.PathSegment(go.PathSegment.Bezier,(.5+gt)*nt,(.5+st+vt)*et,(.5+st+gt)*nt,(.5+St+vt)*et,(.5+St+gt)*nt,(.5+st+vt)*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,(.5-st+gt)*nt,(.5+vt)*et,(.5-St+gt)*nt,(.5+st+vt)*et,(.5-st+gt)*nt,(.5+St+vt)*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,(.5+gt)*nt,(.5-st+vt)*et,(.5-st+gt)*nt,(.5-St+vt)*et,(.5-St+gt)*nt,(.5-st+vt)*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,(1-.5+st+gt)*nt,(.5+vt)*et,(.5+St+gt)*nt,(.5-st+vt)*et,(1-.5+st+gt)*nt,(.5-St+vt)*et));var Et=new go.PathFigure((.525+gt)*nt,(.5+st+vt)*et,!1);return ht.add(Et),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(Bt,nt,et){var ht=Bt?Bt.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(Bt,nt,et){var ht=Bt?Bt.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(Bt,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(Bt,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(Bt,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(Bt,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(Bt,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(Bt,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(Bt,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(Bt,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(Bt,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(Bt,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(Bt,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 Bn("ArrowheadWidth",.3,.01,.99)),go.Shape.setFigureParameter("Arrow",1,new Bn("TailHeight",.3,.01,.99)),go.Shape.defineFigureGenerator("Arrow",function(Bt,nt,et){var ht=Bt?Bt.parameter1:NaN;isNaN(ht)&&(ht=.3);var st=Bt?Bt.parameter2:NaN;isNaN(st)&&(st=.3);var gt=(1-ht)*nt,vt=(.5-st/2)*et,St=(.5+st/2)*et,Et=new go.Geometry,Tt=new go.PathFigure(0,vt,!0);Et.add(Tt),Tt.add(new go.PathSegment(go.PathSegment.Line,gt,vt)),Tt.add(new go.PathSegment(go.PathSegment.Line,gt,0)),Tt.add(new go.PathSegment(go.PathSegment.Line,nt,.5*et)),Tt.add(new go.PathSegment(go.PathSegment.Line,gt,et)),Tt.add(new go.PathSegment(go.PathSegment.Line,gt,St)),Tt.add(new go.PathSegment(go.PathSegment.Line,0,St).close()),Et.spot1=new go.Spot(0,vt/et);var Ot=ue(0,St/et,1,St/et,gt/nt,1,1,.5,pt());return Et.spot2=new go.Spot(Ot.x,Ot.y),Ut(Ot),Et}),go.Shape.setFigureParameter("Arrow2",0,new Bn("ArrowheadWidth",30)),go.Shape.setFigureParameter("Arrow2",0,new Bn("TailHeight",30)),go.Shape.defineFigureGenerator("Arrow2",function(Bt,nt,et){var ht=Bt?Bt.parameter1:NaN;isNaN(ht)&&(ht=30),ht>nt&&(ht=nt);var st=Bt?Bt.parameter2:NaN;isNaN(st)&&(st=30),st=Math.min(st,et/2);var gt=nt-ht,vt=(et-st)/2,St=vt+st,Et=new go.Geometry,Tt=new go.PathFigure(0,vt,!0);Et.add(Tt),Tt.add(new go.PathSegment(go.PathSegment.Line,gt,vt)),Tt.add(new go.PathSegment(go.PathSegment.Line,gt,0)),Tt.add(new go.PathSegment(go.PathSegment.Line,nt,.5*et)),Tt.add(new go.PathSegment(go.PathSegment.Line,gt,et)),Tt.add(new go.PathSegment(go.PathSegment.Line,gt,St)),Tt.add(new go.PathSegment(go.PathSegment.Line,0,St).close()),Et.spot1=new go.Spot(0,vt/et);var Ot=ue(0,St/et,1,St/et,gt/nt,1,1,.5,pt());return Et.spot2=new go.Spot(Ot.x,Ot.y),Ut(Ot),Et}),go.Shape.defineFigureGenerator("Chevron",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,0,!0);return ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,.5*nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,nt,.5*et)),st.add(new go.PathSegment(go.PathSegment.Line,.5*nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,0,et)),st.add(new go.PathSegment(go.PathSegment.Line,.5*nt,.5*et).close()),ht}),go.Shape.defineFigureGenerator("DoubleArrow",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,0,!0);return ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,.3*nt,.214*et)),st.add(new go.PathSegment(go.PathSegment.Line,.3*nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,1*nt,.5*et)),st.add(new go.PathSegment(go.PathSegment.Line,.3*nt,1*et)),st.add(new go.PathSegment(go.PathSegment.Line,.3*nt,.786*et)),st.add(new go.PathSegment(go.PathSegment.Line,0,1*et).close()),ht}),go.Shape.setFigureParameter("DoubleEndArrow",0,new Bn("ConnecterHeight",.3,.01,.99)),go.Shape.defineFigureGenerator("DoubleEndArrow",function(Bt,nt,et){var ht=Bt?Bt.parameter1:NaN;isNaN(ht)&&(ht=.3);var st=(.5-ht/2)*et,gt=(.5+ht/2)*et,vt=new go.Geometry,St=new go.PathFigure(nt,.5*et,!0);vt.add(St),St.add(new go.PathSegment(go.PathSegment.Line,.7*nt,et)),St.add(new go.PathSegment(go.PathSegment.Line,.7*nt,gt)),St.add(new go.PathSegment(go.PathSegment.Line,.3*nt,gt)),St.add(new go.PathSegment(go.PathSegment.Line,.3*nt,et)),St.add(new go.PathSegment(go.PathSegment.Line,0,.5*et)),St.add(new go.PathSegment(go.PathSegment.Line,.3*nt,0)),St.add(new go.PathSegment(go.PathSegment.Line,.3*nt,st)),St.add(new go.PathSegment(go.PathSegment.Line,.7*nt,st)),St.add(new go.PathSegment(go.PathSegment.Line,.7*nt,0).close());var Et=ue(0,.5,.3,0,0,st/et,.1,st/et,pt());return vt.spot1=new go.Spot(Et.x,Et.y),Et=ue(.7,1,1,.5,0,gt/et,1,gt/et,Et),vt.spot2=new go.Spot(Et.x,Et.y),Ut(Et),vt}),go.Shape.setFigureParameter("DoubleEndArrow2",0,new Bn("ConnecterHeight",40)),go.Shape.setFigureParameter("DoubleEndArrow2",1,new Bn("ArrowHeight",100)),go.Shape.defineFigureGenerator("DoubleEndArrow2",function(Bt,nt,et){var ht=Bt?Bt.parameter1:NaN;isNaN(ht)&&(ht=40);var st=Bt?Bt.parameter2:NaN;isNaN(st)&&(st=100);var gt=(et-ht)/2,vt=gt+ht,St=(et-st)/2,Et=St+st;(ht>et||st>et)&&(st>ht?(ht=ht*et/st,gt=(et-ht)/2,vt=gt+ht,St=0,Et=et):(gt=0,vt=et,St=0,Et=et));var Tt=new go.Geometry,Ot=new go.PathFigure(nt,.5*et,!0);Tt.add(Ot),Ot.add(new go.PathSegment(go.PathSegment.Line,.7*nt,Et)),Ot.add(new go.PathSegment(go.PathSegment.Line,.7*nt,vt)),Ot.add(new go.PathSegment(go.PathSegment.Line,.3*nt,vt)),Ot.add(new go.PathSegment(go.PathSegment.Line,.3*nt,Et)),Ot.add(new go.PathSegment(go.PathSegment.Line,0,.5*et)),Ot.add(new go.PathSegment(go.PathSegment.Line,.3*nt,St)),Ot.add(new go.PathSegment(go.PathSegment.Line,.3*nt,gt)),Ot.add(new go.PathSegment(go.PathSegment.Line,.7*nt,gt)),Ot.add(new go.PathSegment(go.PathSegment.Line,.7*nt,St).close());var $t=ue(0,.5,.3,St/et,0,gt/et,1,gt/et,pt());return Tt.spot1=new go.Spot($t.x,$t.y),$t=ue(.7,Et/et,1,.5,0,vt/et,1,vt/et,$t),Tt.spot2=new go.Spot($t.x,$t.y),Ut($t),Tt}),go.Shape.setFigureParameter("IBeamArrow",0,new Bn("ConnectorHeight",.7,.51,.97)),go.Shape.defineFigureGenerator("IBeamArrow",function(Bt,nt,et){var ht=Bt?Bt.parameter1:NaN;isNaN(ht)&&(ht=.3);var st=(.5-ht/2)*et,gt=(.5+ht/2)*et,vt=new go.Geometry,St=new go.PathFigure(nt,.5*et,!0);vt.add(St),St.add(new go.PathSegment(go.PathSegment.Line,.7*nt,et)),St.add(new go.PathSegment(go.PathSegment.Line,.7*nt,gt)),St.add(new go.PathSegment(go.PathSegment.Line,.2*nt,gt)),St.add(new go.PathSegment(go.PathSegment.Line,.2*nt,et)),St.add(new go.PathSegment(go.PathSegment.Line,0,et)),St.add(new go.PathSegment(go.PathSegment.Line,0,0)),St.add(new go.PathSegment(go.PathSegment.Line,.2*nt,0)),St.add(new go.PathSegment(go.PathSegment.Line,.2*nt,st)),St.add(new go.PathSegment(go.PathSegment.Line,.7*nt,st)),St.add(new go.PathSegment(go.PathSegment.Line,.7*nt,0).close()),vt.spot1=new go.Spot(0,st/et);var Et=ue(.7,1,1,.5,0,gt/et,1,gt/et,pt());return vt.spot2=new go.Spot(Et.x,Et.y),Ut(Et),vt}),go.Shape.setFigureParameter("IBeamArrow2",0,new Bn("ConnectorHeight",40)),go.Shape.setFigureParameter("IBeamArrow2",1,new Bn("BeamArrowHeight",100)),go.Shape.defineFigureGenerator("IBeamArrow2",function(Bt,nt,et){var ht=Bt?Bt.parameter1:NaN;isNaN(ht)&&(ht=40);var st=Bt?Bt.parameter2:NaN;isNaN(st)&&(st=100);var gt=(et-ht)/2,vt=gt+ht,St=(et-st)/2,Et=St+st;(ht>et||st>et)&&(st>ht?(ht=ht*et/st,gt=(et-ht)/2,vt=gt+ht,St=0,Et=et):(gt=0,vt=et,St=0,Et=et));var Tt=new go.Geometry,Ot=new go.PathFigure(nt,.5*et,!0);Tt.add(Ot),Ot.add(new go.PathSegment(go.PathSegment.Line,.7*nt,Et)),Ot.add(new go.PathSegment(go.PathSegment.Line,.7*nt,vt)),Ot.add(new go.PathSegment(go.PathSegment.Line,.2*nt,vt)),Ot.add(new go.PathSegment(go.PathSegment.Line,.2*nt,Et)),Ot.add(new go.PathSegment(go.PathSegment.Line,0,Et)),Ot.add(new go.PathSegment(go.PathSegment.Line,0,St)),Ot.add(new go.PathSegment(go.PathSegment.Line,.2*nt,St)),Ot.add(new go.PathSegment(go.PathSegment.Line,.2*nt,gt)),Ot.add(new go.PathSegment(go.PathSegment.Line,.7*nt,gt)),Ot.add(new go.PathSegment(go.PathSegment.Line,.7*nt,St).close()),Tt.spot1=new go.Spot(0,gt/et);var $t=ue(.7,Et/et,1,.5,0,vt/et,1,vt/et,pt());return Tt.spot2=new go.Spot($t.x,$t.y),Ut($t),Tt}),go.Shape.setFigureParameter("Pointer",0,new Bn("BackPoint",.1,0,.2)),go.Shape.defineFigureGenerator("Pointer",function(Bt,nt,et){var ht=Bt?Bt.parameter1:NaN;isNaN(ht)&&(ht=.1);var st=new go.Geometry,gt=new go.PathFigure(nt,.5*et,!0);st.add(gt),gt.add(new go.PathSegment(go.PathSegment.Line,0,et)),gt.add(new go.PathSegment(go.PathSegment.Line,ht*nt,.5*et)),gt.add(new go.PathSegment(go.PathSegment.Line,0,0).close()),st.spot1=new go.Spot(ht,.35);var vt=ue(.2,.65,1,.65,0,1,1,.5,pt());return st.spot2=new go.Spot(vt.x,vt.y),Ut(vt),st}),go.Shape.setFigureParameter("RoundedPointer",0,new Bn("RoundedEdge",.3,0,.5)),go.Shape.defineFigureGenerator("RoundedPointer",function(Bt,nt,et){var ht=Bt?Bt.parameter1:NaN;isNaN(ht)&&(ht=.3);var st=new go.Geometry,gt=new go.PathFigure(nt,.5*et,!0);st.add(gt),gt.add(new go.PathSegment(go.PathSegment.Line,0,et)),gt.add(new go.PathSegment(go.PathSegment.Bezier,0,0,ht*nt,.75*et,ht*nt,.25*et).close()),st.spot1=new go.Spot(ht,.35);var vt=ue(0,.65,1,.65,0,1,1,.5,pt());return st.spot2=new go.Spot(vt.x,vt.y),Ut(vt),st}),go.Shape.setFigureParameter("SplitEndArrow",0,new Bn("TailHeight",.4,.01,.99)),go.Shape.defineFigureGenerator("SplitEndArrow",function(Bt,nt,et){var ht=Bt?Bt.parameter1:NaN;isNaN(ht)&&(ht=.4);var st=(.5-ht/2)*et,gt=(.5+ht/2)*et,vt=new go.Geometry,St=new go.PathFigure(nt,.5*et,!0);vt.add(St),St.add(new go.PathSegment(go.PathSegment.Line,.7*nt,et)),St.add(new go.PathSegment(go.PathSegment.Line,.7*nt,gt)),St.add(new go.PathSegment(go.PathSegment.Line,0,gt)),St.add(new go.PathSegment(go.PathSegment.Line,.2*nt,.5*et)),St.add(new go.PathSegment(go.PathSegment.Line,0,st)),St.add(new go.PathSegment(go.PathSegment.Line,.7*nt,st)),St.add(new go.PathSegment(go.PathSegment.Line,.7*nt,0).close()),vt.spot1=new go.Spot(.2,.3);var Et=ue(.7,1,1,.5,0,gt/et,1,gt/et,pt());return vt.spot2=new go.Spot(Et.x,Et.y),Ut(Et),vt}),go.Shape.setFigureParameter("SplitEndArrow2",0,new Bn("TailThickness",50)),go.Shape.defineFigureGenerator("SplitEndArrow2",function(Bt,nt,et){var ht=Bt?Bt.parameter1:NaN;isNaN(ht)&&(ht=50);var st=(et-ht)/2,gt=st+ht;ht>et&&(st=0,gt=et);var vt=new go.Geometry,St=new go.PathFigure(nt,.5*et,!0);vt.add(St),St.add(new go.PathSegment(go.PathSegment.Line,.7*nt,et)),St.add(new go.PathSegment(go.PathSegment.Line,.7*nt,gt)),St.add(new go.PathSegment(go.PathSegment.Line,0,gt)),St.add(new go.PathSegment(go.PathSegment.Line,.2*nt,.5*et)),St.add(new go.PathSegment(go.PathSegment.Line,0,st)),St.add(new go.PathSegment(go.PathSegment.Line,.7*nt,st)),St.add(new go.PathSegment(go.PathSegment.Line,.7*nt,0).close()),vt.spot1=new go.Spot(.2,st/et);var Et=ue(.7,1,1,.5,0,gt/et,1,gt/et,pt());return vt.spot2=new go.Spot(Et.x,Et.y),Ut(Et),vt}),go.Shape.setFigureParameter("SquareArrow",0,new Bn("ArrowPoint",.7,.2,.9)),go.Shape.defineFigureGenerator("SquareArrow",function(Bt,nt,et){var ht=Bt?Bt.parameter1:NaN;isNaN(ht)&&(ht=.7);var st=new go.Geometry,gt=new go.PathFigure(nt,.5*et,!0);return st.add(gt),gt.add(new go.PathSegment(go.PathSegment.Line,ht*nt,et)),gt.add(new go.PathSegment(go.PathSegment.Line,0,et)),gt.add(new go.PathSegment(go.PathSegment.Line,0,0)),gt.add(new go.PathSegment(go.PathSegment.Line,ht*nt,0).close()),st.spot1=go.Spot.TopLeft,st.spot2=new go.Spot(ht,1),st}),go.Shape.defineFigureGenerator("Cone1",function(Bt,nt,et){var ht=new go.Geometry,st=qt*.5,gt=qt*.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+gt)*et,(.5+st)*nt,et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,0,.9*et,(.5-st)*nt,et,0,(.9+gt)*et).close()),ht.spot1=new go.Spot(.25,.5),ht.spot2=new go.Spot(.75,.97),ht}),go.Shape.defineFigureGenerator("Cone2",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,.9*et,!0);ht.add(st),st.add(new go.PathSegment(go.PathSegment.Bezier,nt,.9*et,(1-.85/.9)*nt,et,.85/.9*nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,.5*nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,0,.9*et).close());var gt=new go.PathFigure(0,.9*et,!1);return ht.add(gt),gt.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(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(.5*nt,et,!0);ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,nt,.85*et)),st.add(new go.PathSegment(go.PathSegment.Line,nt,.15*et)),st.add(new go.PathSegment(go.PathSegment.Line,.5*nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,0,.15*et)),st.add(new go.PathSegment(go.PathSegment.Line,0,.85*et).close());var gt=new go.PathFigure(.5*nt,et,!1);return ht.add(gt),gt.add(new go.PathSegment(go.PathSegment.Line,.5*nt,.3*et)),gt.add(new go.PathSegment(go.PathSegment.Line,0,.15*et)),gt.add(new go.PathSegment(go.PathSegment.Move,.5*nt,.3*et)),gt.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(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,.3*et,!0);ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,0,et)),st.add(new go.PathSegment(go.PathSegment.Line,.7*nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,nt,.7*et)),st.add(new go.PathSegment(go.PathSegment.Line,nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,.3*nt,0).close());var gt=new go.PathFigure(0,.3*et,!1);return ht.add(gt),gt.add(new go.PathSegment(go.PathSegment.Line,.7*nt,.3*et)),gt.add(new go.PathSegment(go.PathSegment.Line,nt,0)),gt.add(new go.PathSegment(go.PathSegment.Move,.7*nt,.3*et)),gt.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(Bt,nt,et){var ht=Bt?Bt.parameter1:NaN;isNaN(ht)&&(ht=5),ht=Math.min(ht,et/3);var st=new go.Geometry,gt=qt*.5,vt=new go.PathFigure(0,ht,!0);st.add(vt),vt.add(new go.PathSegment(go.PathSegment.Bezier,.5*nt,0,0,qt*ht,(.5-gt)*nt,0)),vt.add(new go.PathSegment(go.PathSegment.Bezier,1*nt,ht,(.5+gt)*nt,0,1*nt,qt*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-qt*ht,(.5+gt)*nt,1*et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,0,et-ht,(.5-gt)*nt,1*et,0,et-qt*ht)),vt.add(new go.PathSegment(go.PathSegment.Line,0,ht));var St=new go.PathFigure(nt,ht,!1);return st.add(St),St.add(new go.PathSegment(go.PathSegment.Bezier,.5*nt,2*ht,1*nt,2*ht-qt*ht,(.5+gt)*nt,2*ht)),St.add(new go.PathSegment(go.PathSegment.Bezier,0,ht,(.5-gt)*nt,2*ht,0,2*ht-qt*ht)),st.spot1=new go.Spot(0,0,0,2*ht),st.spot2=new go.Spot(1,1),st}),go.Shape.defineFigureGenerator("Cylinder2",function(Bt,nt,et){var ht=Bt?Bt.parameter1:NaN;isNaN(ht)&&(ht=5),ht=Math.min(ht,et/3);var st=new go.Geometry,gt=qt*.5,vt=new go.PathFigure(0,et-ht,!0);st.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,0,ht)),vt.add(new go.PathSegment(go.PathSegment.Bezier,.5*nt,0,0,qt*ht,(.5-gt)*nt,0)),vt.add(new go.PathSegment(go.PathSegment.Bezier,nt,ht,(.5+gt)*nt,0,nt,qt*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-qt*ht,(.5+gt)*nt,et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,0,et-ht,(.5-gt)*nt,et,0,et-qt*ht));var St=new go.PathFigure(0,et-ht,!1);return st.add(St),St.add(new go.PathSegment(go.PathSegment.Bezier,.5*nt,et-2*ht,0,et-ht-qt*ht,(.5-gt)*nt,et-2*ht)),St.add(new go.PathSegment(go.PathSegment.Bezier,nt,et-ht,(.5+gt)*nt,et-2*ht,nt,et-ht-qt*ht)),st.spot1=new go.Spot(0,0),st.spot2=new go.Spot(1,1,0,-2*ht),st}),go.Shape.defineFigureGenerator("Cylinder3",function(Bt,nt,et){var ht=Bt?Bt.parameter1:NaN;isNaN(ht)&&(ht=5),ht=Math.min(ht,nt/3);var st=new go.Geometry,gt=qt*.5,vt=new go.PathFigure(ht,0,!0);st.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-qt*ht,0,nt,(.5-gt)*et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,nt-ht,et,nt,(.5+gt)*et,nt-qt*ht,et)),vt.add(new go.PathSegment(go.PathSegment.Line,ht,et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,0,.5*et,qt*ht,et,0,(.5+gt)*et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,ht,0,0,(.5-gt)*et,qt*ht,0));var St=new go.PathFigure(ht,0,!1);return st.add(St),St.add(new go.PathSegment(go.PathSegment.Bezier,2*ht,.5*et,ht+qt*ht,0,2*ht,(.5-gt)*et)),St.add(new go.PathSegment(go.PathSegment.Bezier,ht,et,2*ht,(.5+gt)*et,ht+qt*ht,et)),st.spot1=new go.Spot(0,0,2*ht,0),st.spot2=new go.Spot(1,1),st}),go.Shape.defineFigureGenerator("Cylinder4",function(Bt,nt,et){var ht=Bt?Bt.parameter1:NaN;isNaN(ht)&&(ht=5),ht=Math.min(ht,nt/3);var st=new go.Geometry,gt=qt*.5,vt=new go.PathFigure(nt-ht,0,!0);st.add(vt),vt.add(new go.PathSegment(go.PathSegment.Bezier,nt,.5*et,nt-qt*ht,0,nt,(.5-gt)*et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,nt-ht,et,nt,(.5+gt)*et,nt-qt*ht,et)),vt.add(new go.PathSegment(go.PathSegment.Line,ht,et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,0,.5*et,qt*ht,et,0,(.5+gt)*et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,ht,0,0,(.5-gt)*et,qt*ht,0)),vt.add(new go.PathSegment(go.PathSegment.Line,nt-ht,0));var St=new go.PathFigure(nt-ht,0,!1);return st.add(St),St.add(new go.PathSegment(go.PathSegment.Bezier,nt-2*ht,.5*et,nt-ht-qt*ht,0,nt-2*ht,(.5-gt)*et)),St.add(new go.PathSegment(go.PathSegment.Bezier,nt-ht,et,nt-2*ht,(.5+gt)*et,nt-ht-qt*ht,et)),st.spot1=new go.Spot(0,0),st.spot2=new go.Spot(1,1,-2*ht,0),st}),go.Shape.defineFigureGenerator("Prism1",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(.25*nt,.25*et,!0);ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,.75*nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,nt,.5*et)),st.add(new go.PathSegment(go.PathSegment.Line,.5*nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,0,et).close());var gt=new go.PathFigure(.25*nt,.25*et,!1);return ht.add(gt),gt.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(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,.25*et,!0);ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,.75*nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,nt,.25*et)),st.add(new go.PathSegment(go.PathSegment.Line,.75*nt,.75*et)),st.add(new go.PathSegment(go.PathSegment.Line,0,et).close());var gt=new go.PathFigure(0,et,!1);return ht.add(gt),gt.add(new go.PathSegment(go.PathSegment.Line,.25*nt,.5*et)),gt.add(new go.PathSegment(go.PathSegment.Line,nt,.25*et)),gt.add(new go.PathSegment(go.PathSegment.Move,0,.25*et)),gt.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(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(.5*nt,0,!0);ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,nt,.75*et)),st.add(new go.PathSegment(go.PathSegment.Line,.5*nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,0,.75*et).close());var gt=new go.PathFigure(.5*nt,0,!1);return ht.add(gt),gt.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(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(.5*nt,0,!0);ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,nt,.85*et)),st.add(new go.PathSegment(go.PathSegment.Line,.5*nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,0,.85*et).close());var gt=new go.PathFigure(.5*nt,0,!1);return ht.add(gt),gt.add(new go.PathSegment(go.PathSegment.Line,.5*nt,.7*et)),gt.add(new go.PathSegment(go.PathSegment.Line,0,.85*et)),gt.add(new go.PathSegment(go.PathSegment.Move,.5*nt,.7*et)),gt.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(Bt,nt,et){var ht=new go.Geometry,st=.2,gt=.1,vt=qt*st,St=qt*gt,Et=.5,Tt=.1,Ot=new go.PathFigure(Et*nt,(Tt+gt)*et,!0);ht.add(Ot),Ot.add(new go.PathSegment(go.PathSegment.Bezier,(Et-st)*nt,Tt*et,(Et-vt)*nt,(Tt+gt)*et,(Et-st)*nt,(Tt+St)*et)),Ot.add(new go.PathSegment(go.PathSegment.Bezier,Et*nt,(Tt-gt)*et,(Et-st)*nt,(Tt-St)*et,(Et-vt)*nt,(Tt-gt)*et)),Ot.add(new go.PathSegment(go.PathSegment.Bezier,(Et+st)*nt,Tt*et,(Et+vt)*nt,(Tt-gt)*et,(Et+st)*nt,(Tt-St)*et)),Ot.add(new go.PathSegment(go.PathSegment.Bezier,Et*nt,(Tt+gt)*et,(Et+st)*nt,(Tt+St)*et,(Et+vt)*nt,(Tt+gt)*et));var $t=.05,Xt=qt*$t;Et=.05,Tt=.25;var Ht=new go.PathFigure(.5*nt,.2*et,!0);return ht.add(Ht),Ht.add(new go.PathSegment(go.PathSegment.Line,.95*nt,.2*et)),Et=.95,Tt=.25,Ht.add(new go.PathSegment(go.PathSegment.Bezier,(Et+$t)*nt,Tt*et,(Et+Xt)*nt,(Tt-$t)*et,(Et+$t)*nt,(Tt-Xt)*et)),Ht.add(new go.PathSegment(go.PathSegment.Line,nt,.6*et)),Ht.add(new go.PathSegment(go.PathSegment.Line,.85*nt,.6*et)),Ht.add(new go.PathSegment(go.PathSegment.Line,.85*nt,.35*et)),$t=.025,Xt=qt*$t,Et=.825,Tt=.35,Ht.add(new go.PathSegment(go.PathSegment.Bezier,Et*nt,(Tt-$t)*et,(Et+$t)*nt,(Tt-Xt)*et,(Et+Xt)*nt,(Tt-$t)*et)),Ht.add(new go.PathSegment(go.PathSegment.Bezier,(Et-$t)*nt,Tt*et,(Et-Xt)*nt,(Tt-$t)*et,(Et-$t)*nt,(Tt-Xt)*et)),Ht.add(new go.PathSegment(go.PathSegment.Line,.8*nt,et)),Ht.add(new go.PathSegment(go.PathSegment.Line,.55*nt,et)),Ht.add(new go.PathSegment(go.PathSegment.Line,.55*nt,.7*et)),$t=.05,Xt=qt*$t,Et=.5,Tt=.7,Ht.add(new go.PathSegment(go.PathSegment.Bezier,Et*nt,(Tt-$t)*et,(Et+$t)*nt,(Tt-Xt)*et,(Et+Xt)*nt,(Tt-$t)*et)),Ht.add(new go.PathSegment(go.PathSegment.Bezier,(Et-$t)*nt,Tt*et,(Et-Xt)*nt,(Tt-$t)*et,(Et-$t)*nt,(Tt-Xt)*et)),Ht.add(new go.PathSegment(go.PathSegment.Line,.45*nt,et)),Ht.add(new go.PathSegment(go.PathSegment.Line,.2*nt,et)),Ht.add(new go.PathSegment(go.PathSegment.Line,.2*nt,.35*et)),$t=.025,Xt=qt*$t,Et=.175,Tt=.35,Ht.add(new go.PathSegment(go.PathSegment.Bezier,Et*nt,(Tt-$t)*et,(Et+$t)*nt,(Tt-Xt)*et,(Et+Xt)*nt,(Tt-$t)*et)),Ht.add(new go.PathSegment(go.PathSegment.Bezier,(Et-$t)*nt,Tt*et,(Et-Xt)*nt,(Tt-$t)*et,(Et-$t)*nt,(Tt-Xt)*et)),Ht.add(new go.PathSegment(go.PathSegment.Line,.15*nt,.6*et)),Ht.add(new go.PathSegment(go.PathSegment.Line,0,.6*et)),Ht.add(new go.PathSegment(go.PathSegment.Line,0,.25*et)),$t=.05,Xt=qt*$t,Et=.05,Tt=.25,Ht.add(new go.PathSegment(go.PathSegment.Bezier,Et*nt,(Tt-$t)*et,(Et-$t)*nt,(Tt-Xt)*et,(Et-Xt)*nt,(Tt-$t)*et)),Ht.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 Bn("CornerCutoutSize",.2,.1,.9)),go.Shape.defineFigureGenerator("Card",function(Bt,nt,et){var ht=Bt?Bt.parameter1:NaN;isNaN(ht)&&(ht=.2);var st=new go.Geometry,gt=new go.PathFigure(nt,0,!0);return st.add(gt),gt.add(new go.PathSegment(go.PathSegment.Line,nt,et)),gt.add(new go.PathSegment(go.PathSegment.Line,0,et)),gt.add(new go.PathSegment(go.PathSegment.Line,0,ht*et)),gt.add(new go.PathSegment(go.PathSegment.Line,ht*nt,0).close()),st.spot1=new go.Spot(0,ht),st.spot2=go.Spot.BottomRight,st}),go.Shape.defineFigureGenerator("Collate",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(.5*nt,.5*et,!0);ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,0,0)),st.add(new go.PathSegment(go.PathSegment.Line,nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,.5*nt,.5*et));var gt=new go.PathFigure(.5*nt,.5*et,!0);return ht.add(gt),gt.add(new go.PathSegment(go.PathSegment.Line,nt,et)),gt.add(new go.PathSegment(go.PathSegment.Line,0,et)),gt.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(Bt,nt,et){var ht=new go.Geometry,st=Bt?Bt.parameter1:NaN;isNaN(st)&&(st=.1);var gt=new go.PathFigure(0,0,!0);ht.add(gt),gt.add(new go.PathSegment(go.PathSegment.Line,nt,0)),gt.add(new go.PathSegment(go.PathSegment.Line,nt,et)),gt.add(new go.PathSegment(go.PathSegment.Line,0,et).close());var vt=new go.PathFigure(0,st*et,!1);return ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,nt,st*et)),vt.add(new go.PathSegment(go.PathSegment.Move,0,(1-st)*et)),vt.add(new go.PathSegment(go.PathSegment.Line,nt,(1-st)*et)),ht}),go.Shape.defineFigureGenerator("Database",function(Bt,nt,et){var ht=new go.Geometry,st=qt*.5,gt=qt*.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+gt)*et,(.5+st)*nt,et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,0,.9*et,(.5-st)*nt,et,0,(.9+gt)*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-gt)*et,(.5-st)*nt,0)),vt.add(new go.PathSegment(go.PathSegment.Bezier,nt,.1*et,(.5+st)*nt,0,nt,(.1-gt)*et));var St=new go.PathFigure(nt,.1*et,!1);return ht.add(St),St.add(new go.PathSegment(go.PathSegment.Bezier,.5*nt,.2*et,nt,(.1+gt)*et,(.5+st)*nt,.2*et)),St.add(new go.PathSegment(go.PathSegment.Bezier,0,.1*et,(.5-st)*nt,.2*et,0,(.1+gt)*et)),St.add(new go.PathSegment(go.PathSegment.Move,nt,.2*et)),St.add(new go.PathSegment(go.PathSegment.Bezier,.5*nt,.3*et,nt,(.2+gt)*et,(.5+st)*nt,.3*et)),St.add(new go.PathSegment(go.PathSegment.Bezier,0,.2*et,(.5-st)*nt,.3*et,0,(.2+gt)*et)),St.add(new go.PathSegment(go.PathSegment.Move,nt,.3*et)),St.add(new go.PathSegment(go.PathSegment.Bezier,.5*nt,.4*et,nt,(.3+gt)*et,(.5+st)*nt,.4*et)),St.add(new go.PathSegment(go.PathSegment.Bezier,0,.3*et,(.5-st)*nt,.4*et,0,(.3+gt)*et)),ht.spot1=new go.Spot(0,.4),ht.spot2=new go.Spot(1,.9),ht}),go.Shape.defineFigureGenerator("DataStorage",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,0,!0);return ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,.75*nt,0)),st.add(new go.PathSegment(go.PathSegment.Bezier,.75*nt,et,nt,0,nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,0,et)),st.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(Bt,nt,et){var ht=new go.Geometry,st=qt*.5,gt=qt*.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+gt)*et,(.5+st)*nt,et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,0,.9*et,(.5-st)*nt,et,0,(.9+gt)*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-gt)*et,(.5-st)*nt,0)),vt.add(new go.PathSegment(go.PathSegment.Bezier,nt,.1*et,(.5+st)*nt,0,nt,(.1-gt)*et));var St=new go.PathFigure(nt,.1*et,!1);return ht.add(St),St.add(new go.PathSegment(go.PathSegment.Bezier,.5*nt,.2*et,nt,(.1+gt)*et,(.5+st)*nt,.2*et)),St.add(new go.PathSegment(go.PathSegment.Bezier,0,.1*et,(.5-st)*nt,.2*et,0,(.1+gt)*et)),St.add(new go.PathSegment(go.PathSegment.Move,nt,.2*et)),St.add(new go.PathSegment(go.PathSegment.Bezier,.5*nt,.3*et,nt,(.2+gt)*et,(.5+st)*nt,.3*et)),St.add(new go.PathSegment(go.PathSegment.Bezier,0,.2*et,(.5-st)*nt,.3*et,0,(.2+gt)*et)),ht.spot1=new go.Spot(0,.3),ht.spot2=new go.Spot(1,.9),ht}),go.Shape.defineFigureGenerator("Display",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(.25*nt,0,!0);return ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,.75*nt,0)),st.add(new go.PathSegment(go.PathSegment.Bezier,.75*nt,et,nt,0,nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,.25*nt,et)),st.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(Bt,nt,et){var ht=new go.Geometry,st=Bt?Bt.parameter1:NaN;isNaN(st)?st=.2:st<.15&&(st=.15);var gt=qt*.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-gt)*et,(.2-gt)*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+gt)*nt,0,nt,(.2-gt)*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+gt)*et,(.8+gt)*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-gt)*nt,et,0,(.8+gt)*et)),vt.add(new go.PathSegment(go.PathSegment.Line,0,.2*et));var St=new go.PathFigure(0,st*et,!1);return ht.add(St),St.add(new go.PathSegment(go.PathSegment.Line,nt,st*et)),ht}),go.Shape.defineFigureGenerator("DividedProcess",function(Bt,nt,et){var ht=new go.Geometry,st=Bt?Bt.parameter1:NaN;(isNaN(st)||st<.1)&&(st=.1);var gt=new go.PathFigure(0,0,!0);ht.add(gt),gt.add(new go.PathSegment(go.PathSegment.Line,nt,0)),gt.add(new go.PathSegment(go.PathSegment.Line,nt,et)),gt.add(new go.PathSegment(go.PathSegment.Line,0,et).close());var vt=new go.PathFigure(0,st*et,!1);return ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,nt,st*et)),ht}),go.Shape.defineFigureGenerator("Document",function(Bt,nt,et){var ht=new go.Geometry;et=et/.8;var st=new go.PathFigure(0,.7*et,!0);return ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,0,0)),st.add(new go.PathSegment(go.PathSegment.Line,nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,nt,.7*et)),st.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(Bt,nt,et){var ht=new go.Geometry,st=Bt?Bt.parameter1:NaN;(isNaN(st)||st<.2)&&(st=.2);var gt=new go.PathFigure(0,0,!0);ht.add(gt),gt.add(new go.PathSegment(go.PathSegment.Line,nt,0)),gt.add(new go.PathSegment(go.PathSegment.Line,nt,et)),gt.add(new go.PathSegment(go.PathSegment.Line,0,et).close());var vt=new go.PathFigure(st*nt,0,!1);return ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,0,st*et)),vt.add(new go.PathSegment(go.PathSegment.Move,nt,st*et)),vt.add(new go.PathSegment(go.PathSegment.Line,(1-st)*nt,0)),vt.add(new go.PathSegment(go.PathSegment.Move,0,(1-st)*et)),vt.add(new go.PathSegment(go.PathSegment.Line,st*nt,et)),vt.add(new go.PathSegment(go.PathSegment.Move,(1-st)*nt,et)),vt.add(new go.PathSegment(go.PathSegment.Line,nt,(1-st)*et)),ht}),go.Shape.defineFigureGenerator("ExternalProcess",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(.5*nt,0,!0);ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,nt,.5*et)),st.add(new go.PathSegment(go.PathSegment.Line,.5*nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,0,.5*et).close());var gt=new go.PathFigure(.1*nt,.4*et,!1);return ht.add(gt),gt.add(new go.PathSegment(go.PathSegment.Line,.1*nt,.6*et)),gt.add(new go.PathSegment(go.PathSegment.Move,.9*nt,.6*et)),gt.add(new go.PathSegment(go.PathSegment.Line,.9*nt,.4*et)),gt.add(new go.PathSegment(go.PathSegment.Move,.6*nt,.1*et)),gt.add(new go.PathSegment(go.PathSegment.Line,.4*nt,.1*et)),gt.add(new go.PathSegment(go.PathSegment.Move,.4*nt,.9*et)),gt.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(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,0,!0);ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,.75*nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,nt,.25*et)),st.add(new go.PathSegment(go.PathSegment.Line,nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,0,et).close());var gt=new go.PathFigure(.75*nt,0,!1);return ht.add(gt),gt.add(new go.PathSegment(go.PathSegment.Line,.75*nt,.25*et)),gt.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(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(nt,.5*et,!0);ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,0,et)),st.add(new go.PathSegment(go.PathSegment.Line,0,0)),st.add(new go.PathSegment(go.PathSegment.Line,nt,.5*et));var gt=new go.PathFigure(nt,.5*et,!1);ht.add(gt),gt.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(Bt,nt,et){var ht=new go.Geometry,st=Bt?Bt.parameter1:NaN,gt=Bt?Bt.parameter2:NaN;isNaN(st)&&(st=.1),isNaN(gt)&&(gt=.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 St=new go.PathFigure(st*nt,0,!1);return ht.add(St),St.add(new go.PathSegment(go.PathSegment.Line,st*nt,et)),St.add(new go.PathSegment(go.PathSegment.Move,0,gt*et)),St.add(new go.PathSegment(go.PathSegment.Line,nt,gt*et)),ht}),go.Shape.defineFigureGenerator("Junction",function(Bt,nt,et){var ht=new go.Geometry,st=1/Math.SQRT2,gt=(1-1/Math.SQRT2)/2,vt=qt*.5,St=.5,Et=new go.PathFigure(nt,St*et,!0);ht.add(Et),Et.add(new go.PathSegment(go.PathSegment.Bezier,St*nt,et,nt,(St+vt)*et,(St+vt)*nt,et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,0,St*et,(St-vt)*nt,et,0,(St+vt)*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,St*nt,0,0,(St-vt)*et,(St-vt)*nt,0)),Et.add(new go.PathSegment(go.PathSegment.Bezier,nt,St*et,(St+vt)*nt,0,nt,(St-vt)*et));var Tt=new go.PathFigure((gt+st)*nt,(gt+st)*et,!1);return ht.add(Tt),Tt.add(new go.PathSegment(go.PathSegment.Line,gt*nt,gt*et)),Tt.add(new go.PathSegment(go.PathSegment.Move,gt*nt,(gt+st)*et)),Tt.add(new go.PathSegment(go.PathSegment.Line,(gt+st)*nt,gt*et)),ht}),go.Shape.defineFigureGenerator("LinedDocument",function(Bt,nt,et){var ht=new go.Geometry;et=et/.8;var st=new go.PathFigure(0,.7*et,!0);ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,0,0)),st.add(new go.PathSegment(go.PathSegment.Line,nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,nt,.7*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,0,.7*et,.5*nt,.4*et,.5*nt,et).close());var gt=new go.PathFigure(.1*nt,0,!1);return ht.add(gt),gt.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(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,et,!0);return ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,0,.25*et)),st.add(new go.PathSegment(go.PathSegment.Line,.25*nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,.75*nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,nt,.25*et)),st.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(Bt,nt,et){var ht=new go.Geometry,st=qt*.5,gt=.5,vt=new go.PathFigure(.5*nt,et,!0);return ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Bezier,0,gt*et,(gt-st)*nt,et,0,(gt+st)*et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,gt*nt,0,0,(gt-st)*et,(gt-st)*nt,0)),vt.add(new go.PathSegment(go.PathSegment.Bezier,nt,gt*et,(gt+st)*nt,0,nt,(gt-st)*et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,(gt+.1)*nt,.9*et,nt,(gt+st)*et,(gt+st)*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(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(nt,0,!0);return ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,0,et)),st.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(Bt,nt,et){var ht=new go.Geometry,st=Bt?Bt.parameter1:NaN;isNaN(st)&&(st=.7);var gt=new go.PathFigure(0,0,!0);return ht.add(gt),gt.add(new go.PathSegment(go.PathSegment.Line,nt,0)),gt.add(new go.PathSegment(go.PathSegment.Line,st*nt,.5*et)),gt.add(new go.PathSegment(go.PathSegment.Line,nt,et)),gt.add(new go.PathSegment(go.PathSegment.Line,0,et).close()),ht.spot1=go.Spot.TopLeft,ht}),go.Shape.defineFigureGenerator("MicroformProcessing",function(Bt,nt,et){var ht=new go.Geometry,st=Bt?Bt.parameter1:NaN;isNaN(st)&&(st=.25);var gt=new go.PathFigure(0,0,!0);return ht.add(gt),gt.add(new go.PathSegment(go.PathSegment.Line,.5*nt,st*et)),gt.add(new go.PathSegment(go.PathSegment.Line,nt,0)),gt.add(new go.PathSegment(go.PathSegment.Line,nt,et)),gt.add(new go.PathSegment(go.PathSegment.Line,.5*nt,(1-st)*et)),gt.add(new go.PathSegment(go.PathSegment.Line,0,et).close()),ht}),go.Shape.defineFigureGenerator("MicroformRecording",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,0,!0);return ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,.75*nt,.25*et)),st.add(new go.PathSegment(go.PathSegment.Line,nt,.15*et)),st.add(new go.PathSegment(go.PathSegment.Line,nt,.85*et)),st.add(new go.PathSegment(go.PathSegment.Line,.75*nt,.75*et)),st.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(Bt,nt,et){var ht=new go.Geometry;et=et/.8;var st=new go.PathFigure(nt,0,!0);ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,nt,.5*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,.9*nt,.44*et,.96*nt,.47*et,.93*nt,.45*et)),st.add(new go.PathSegment(go.PathSegment.Line,.9*nt,.6*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,.8*nt,.54*et,.86*nt,.57*et,.83*nt,.55*et)),st.add(new go.PathSegment(go.PathSegment.Line,.8*nt,.7*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,0,.7*et,.4*nt,.4*et,.4*nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,0,.2*et)),st.add(new go.PathSegment(go.PathSegment.Line,.1*nt,.2*et)),st.add(new go.PathSegment(go.PathSegment.Line,.1*nt,.1*et)),st.add(new go.PathSegment(go.PathSegment.Line,.2*nt,.1*et)),st.add(new go.PathSegment(go.PathSegment.Line,.2*nt,0).close());var gt=new go.PathFigure(.1*nt,.2*et,!1);return ht.add(gt),gt.add(new go.PathSegment(go.PathSegment.Line,.8*nt,.2*et)),gt.add(new go.PathSegment(go.PathSegment.Line,.8*nt,.54*et)),gt.add(new go.PathSegment(go.PathSegment.Move,.2*nt,.1*et)),gt.add(new go.PathSegment(go.PathSegment.Line,.9*nt,.1*et)),gt.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(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(.1*nt,.1*et,!0);ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,.2*nt,.1*et)),st.add(new go.PathSegment(go.PathSegment.Line,.2*nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,nt,.8*et)),st.add(new go.PathSegment(go.PathSegment.Line,.9*nt,.8*et)),st.add(new go.PathSegment(go.PathSegment.Line,.9*nt,.9*et)),st.add(new go.PathSegment(go.PathSegment.Line,.8*nt,.9*et)),st.add(new go.PathSegment(go.PathSegment.Line,.8*nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,0,et)),st.add(new go.PathSegment(go.PathSegment.Line,0,.2*et)),st.add(new go.PathSegment(go.PathSegment.Line,.1*nt,.2*et).close());var gt=new go.PathFigure(.2*nt,.1*et,!1);return ht.add(gt),gt.add(new go.PathSegment(go.PathSegment.Line,.9*nt,.1*et)),gt.add(new go.PathSegment(go.PathSegment.Line,.9*nt,.8*et)),gt.add(new go.PathSegment(go.PathSegment.Move,.1*nt,.2*et)),gt.add(new go.PathSegment(go.PathSegment.Line,.8*nt,.2*et)),gt.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(Bt,nt,et){var ht=new go.Geometry,st=Bt?Bt.parameter1:NaN;isNaN(st)&&(st=.1);var gt=1-st,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 St=new go.PathFigure(.5*st*nt,st*et,!1);return ht.add(St),St.add(new go.PathSegment(go.PathSegment.Line,(1-.5*st)*nt,st*et)),ht}),go.Shape.defineFigureGenerator("OffPageConnector",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,0,!0);return ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,.75*nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,nt,.5*et)),st.add(new go.PathSegment(go.PathSegment.Line,.75*nt,et)),st.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(Bt,nt,et){var ht=new go.Geometry,st=qt*.5,gt=.5,vt=new go.PathFigure(nt,gt*et,!0);ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Bezier,gt*nt,et,nt,(gt+st)*et,(gt+st)*nt,et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,0,gt*et,(gt-st)*nt,et,0,(gt+st)*et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,gt*nt,0,0,(gt-st)*et,(gt-st)*nt,0)),vt.add(new go.PathSegment(go.PathSegment.Bezier,nt,gt*et,(gt+st)*nt,0,nt,(gt-st)*et));var St=new go.PathFigure(nt,.5*et,!1);return ht.add(St),St.add(new go.PathSegment(go.PathSegment.Line,0,.5*et)),St.add(new go.PathSegment(go.PathSegment.Move,.5*nt,et)),St.add(new go.PathSegment(go.PathSegment.Line,.5*nt,0)),ht}),go.Shape.defineFigureGenerator("PaperTape",function(Bt,nt,et){var ht=new go.Geometry;et=et/.8;var st=new go.PathFigure(0,.7*et,!0);return ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,0,.3*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,nt,.3*et,.5*nt,.6*et,.5*nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,nt,.7*et)),st.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(Bt,nt,et){var ht=new go.Geometry,st=Bt?Bt.parameter1:NaN,gt=Bt?Bt.parameter2:NaN;isNaN(st)&&(st=.1),isNaN(gt)&&(gt=.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-gt)*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(Bt,nt,et){var ht=new go.Geometry,st=Bt?Bt.parameter1:NaN,gt=Bt?Bt.parameter2:NaN;isNaN(st)&&(st=.1),isNaN(gt)&&(gt=.3);var vt=new go.PathFigure(0,0,!0);return ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,(1-gt)*nt,0)),vt.add(new go.PathSegment(go.PathSegment.Line,nt,.5*et)),vt.add(new go.PathSegment(go.PathSegment.Line,(1-gt)*nt,et)),vt.add(new go.PathSegment(go.PathSegment.Line,0,et).close()),ht}),go.Shape.defineFigureGenerator("Procedure",function(Bt,nt,et){var ht=new go.Geometry,st=Bt?Bt.parameter1:NaN;isNaN(st)&&(st=.1);var gt=new go.PathFigure(0,0,!0);ht.add(gt),gt.add(new go.PathSegment(go.PathSegment.Line,nt,0)),gt.add(new go.PathSegment(go.PathSegment.Line,nt,et)),gt.add(new go.PathSegment(go.PathSegment.Line,0,et).close());var vt=new go.PathFigure((1-st)*nt,0,!1);return ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,(1-st)*nt,et)),vt.add(new go.PathSegment(go.PathSegment.Move,st*nt,0)),vt.add(new go.PathSegment(go.PathSegment.Line,st*nt,et)),ht}),go.Shape.defineFigureGenerator("Process",function(Bt,nt,et){var ht=new go.Geometry,st=Bt?Bt.parameter1:NaN;isNaN(st)&&(st=.1);var gt=new go.PathFigure(0,0,!0);ht.add(gt),gt.add(new go.PathSegment(go.PathSegment.Line,nt,0)),gt.add(new go.PathSegment(go.PathSegment.Line,nt,et)),gt.add(new go.PathSegment(go.PathSegment.Line,0,et).close());var vt=new go.PathFigure(st*nt,0,!1);return ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,st*nt,et)),ht.spot2=go.Spot.BottomRight,ht}),go.Shape.defineFigureGenerator("Sort",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(.5*nt,0,!0);ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,nt,.5*et)),st.add(new go.PathSegment(go.PathSegment.Line,.5*nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,0,.5*et).close());var gt=new go.PathFigure(0,.5*et,!1);return ht.add(gt),gt.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(Bt,nt,et){var ht=new go.Geometry,st=Bt?Bt.parameter1:NaN;isNaN(st)&&(st=.25);var gt=new go.PathFigure(st*nt,0,!0);ht.add(gt),gt.add(new go.PathSegment(go.PathSegment.Arc,270,180,.75*nt,.5*et,.25*nt,.5*et)),gt.add(new go.PathSegment(go.PathSegment.Arc,90,180,.25*nt,.5*et,.25*nt,.5*et));var vt=new go.PathFigure(st*nt,0,!1);return ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,st*nt,et)),vt.add(new go.PathSegment(go.PathSegment.Move,(1-st)*nt,0)),vt.add(new go.PathSegment(go.PathSegment.Line,(1-st)*nt,et)),ht.spot1=new go.Spot(st,0),ht.spot2=new go.Spot(1-st,1),ht}),go.Shape.defineFigureGenerator("Terminator",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(.25*nt,0,!0);return ht.add(st),st.add(new go.PathSegment(go.PathSegment.Arc,270,180,.75*nt,.5*et,.25*nt,.5*et)),st.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(Bt,nt,et){var ht=new go.Geometry,st=Bt?Bt.parameter1:NaN;isNaN(st)&&(st=.1);var gt=new go.PathFigure(0,0,!0);return ht.add(gt),gt.add(new go.PathSegment(go.PathSegment.Line,nt,0)),gt.add(new go.PathSegment(go.PathSegment.Line,nt,et)),gt.add(new go.PathSegment(go.PathSegment.Line,.75*nt,(1-st)*et)),gt.add(new go.PathSegment(go.PathSegment.Line,0,(1-st)*et).close()),ht.spot1=go.Spot.TopLeft,ht}),go.Shape.defineFigureGenerator("AndGate",function(Bt,nt,et){var ht=new go.Geometry,st=qt*.5,gt=new go.PathFigure(0,0,!0);return ht.add(gt),gt.add(new go.PathSegment(go.PathSegment.Line,.5*nt,0)),gt.add(new go.PathSegment(go.PathSegment.Bezier,nt,.5*et,(.5+st)*nt,0,nt,(.5-st)*et)),gt.add(new go.PathSegment(go.PathSegment.Bezier,.5*nt,et,nt,(.5+st)*et,(.5+st)*nt,et)),gt.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(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,0,!0);return ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,nt,.5*et)),st.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(Bt,nt,et){var ht=new go.Geometry,st=qt*.5,gt=.5,vt=new go.PathFigure(nt,gt*et,!0);ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Bezier,gt*nt,et,nt,(gt+st)*et,(gt+st)*nt,et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,0,gt*et,(gt-st)*nt,et,0,(gt+st)*et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,gt*nt,0,0,(gt-st)*et,(gt-st)*nt,0)),vt.add(new go.PathSegment(go.PathSegment.Bezier,nt,gt*et,(gt+st)*nt,0,nt,(gt-st)*et));var St=new go.PathFigure(nt,gt*et,!1);ht.add(St),St.add(new go.PathSegment(go.PathSegment.Line,nt,gt*et));var Et=new go.PathFigure(.8*nt,.75*et,!1);return ht.add(Et),Et.add(new go.PathSegment(go.PathSegment.Line,.8*nt,.25*et)),Et.add(new go.PathSegment(go.PathSegment.Line,.6*nt,.25*et)),Et.add(new go.PathSegment(go.PathSegment.Line,.6*nt,.75*et)),Et.add(new go.PathSegment(go.PathSegment.Line,.4*nt,.75*et)),Et.add(new go.PathSegment(go.PathSegment.Line,.4*nt,.25*et)),Et.add(new go.PathSegment(go.PathSegment.Line,.2*nt,.25*et)),Et.add(new go.PathSegment(go.PathSegment.Line,.2*nt,.75*et)),ht}),go.Shape.defineFigureGenerator("Ground",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(.5*nt,0,!1);return ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,.5*nt,.4*et)),st.add(new go.PathSegment(go.PathSegment.Move,.2*nt,.6*et)),st.add(new go.PathSegment(go.PathSegment.Line,.8*nt,.6*et)),st.add(new go.PathSegment(go.PathSegment.Move,.3*nt,.8*et)),st.add(new go.PathSegment(go.PathSegment.Line,.7*nt,.8*et)),st.add(new go.PathSegment(go.PathSegment.Move,.4*nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,.6*nt,et)),ht}),go.Shape.defineFigureGenerator("Inverter",function(Bt,nt,et){var ht=new go.Geometry,st=qt*.1,gt=.1,vt=.9,St=.5,Et=new go.PathFigure(.8*nt,.5*et,!0);ht.add(Et),Et.add(new go.PathSegment(go.PathSegment.Line,0,et)),Et.add(new go.PathSegment(go.PathSegment.Line,0,0)),Et.add(new go.PathSegment(go.PathSegment.Line,.8*nt,.5*et));var Tt=new go.PathFigure((vt+gt)*nt,St*et,!0);return ht.add(Tt),Tt.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,(St+gt)*et,(vt+gt)*nt,(St+st)*et,(vt+st)*nt,(St+gt)*et)),Tt.add(new go.PathSegment(go.PathSegment.Bezier,(vt-gt)*nt,St*et,(vt-st)*nt,(St+gt)*et,(vt-gt)*nt,(St+st)*et)),Tt.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,(St-gt)*et,(vt-gt)*nt,(St-st)*et,(vt-st)*nt,(St-gt)*et)),Tt.add(new go.PathSegment(go.PathSegment.Bezier,(vt+gt)*nt,St*et,(vt+st)*nt,(St-gt)*et,(vt+gt)*nt,(St-st)*et)),ht.spot1=new go.Spot(0,.25),ht.spot2=new go.Spot(.4,.75),ht}),go.Shape.defineFigureGenerator("NandGate",function(Bt,nt,et){var ht=new go.Geometry,st=qt*.5,gt=qt*.4,vt=qt*.1,St=.1,Et=.9,Tt=.5,Ot=new go.PathFigure(.8*nt,.5*et,!0);ht.add(Ot),Ot.add(new go.PathSegment(go.PathSegment.Bezier,.4*nt,et,.8*nt,(.5+gt)*et,(.4+st)*nt,et)),Ot.add(new go.PathSegment(go.PathSegment.Line,0,et)),Ot.add(new go.PathSegment(go.PathSegment.Line,0,0)),Ot.add(new go.PathSegment(go.PathSegment.Line,.4*nt,0)),Ot.add(new go.PathSegment(go.PathSegment.Bezier,.8*nt,.5*et,(.4+st)*nt,0,.8*nt,(.5-gt)*et));var $t=new go.PathFigure((Et+St)*nt,Tt*et,!0);return ht.add($t),$t.add(new go.PathSegment(go.PathSegment.Bezier,Et*nt,(Tt+St)*et,(Et+St)*nt,(Tt+vt)*et,(Et+vt)*nt,(Tt+St)*et)),$t.add(new go.PathSegment(go.PathSegment.Bezier,(Et-St)*nt,Tt*et,(Et-vt)*nt,(Tt+St)*et,(Et-St)*nt,(Tt+vt)*et)),$t.add(new go.PathSegment(go.PathSegment.Bezier,Et*nt,(Tt-St)*et,(Et-St)*nt,(Tt-vt)*et,(Et-vt)*nt,(Tt-St)*et)),$t.add(new go.PathSegment(go.PathSegment.Bezier,(Et+St)*nt,Tt*et,(Et+vt)*nt,(Tt-St)*et,(Et+St)*nt,(Tt-vt)*et)),ht.spot1=new go.Spot(0,.05),ht.spot2=new go.Spot(.55,.95),ht}),go.Shape.defineFigureGenerator("NorGate",function(Bt,nt,et){var ht=new go.Geometry,st=.5,gt=qt*st,vt=0,St=.5,Et=new go.PathFigure(.8*nt,.5*et,!0);ht.add(Et),Et.add(new go.PathSegment(go.PathSegment.Bezier,0,et,.7*nt,(St+gt)*et,(vt+gt)*nt,(St+st)*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,0,0,.25*nt,.75*et,.25*nt,.25*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,.8*nt,.5*et,(vt+gt)*nt,(St-st)*et,.7*nt,(St-gt)*et)),st=.1,gt=qt*.1,vt=.9,St=.5;var Tt=new go.PathFigure((vt-st)*nt,St*et,!0);return ht.add(Tt),Tt.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,(St-st)*et,(vt-st)*nt,(St-gt)*et,(vt-gt)*nt,(St-st)*et)),Tt.add(new go.PathSegment(go.PathSegment.Bezier,(vt+st)*nt,St*et,(vt+gt)*nt,(St-st)*et,(vt+st)*nt,(St-gt)*et)),Tt.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,(St+st)*et,(vt+st)*nt,(St+gt)*et,(vt+gt)*nt,(St+st)*et)),Tt.add(new go.PathSegment(go.PathSegment.Bezier,(vt-st)*nt,St*et,(vt-gt)*nt,(St+st)*et,(vt-st)*nt,(St+gt)*et)),ht.spot1=new go.Spot(.2,.25),ht.spot2=new go.Spot(.6,.75),ht}),go.Shape.defineFigureGenerator("OrGate",function(Bt,nt,et){var ht=new go.Geometry,st=.5,gt=qt*st,vt=0,St=.5,Et=new go.PathFigure(0,0,!0);return ht.add(Et),Et.add(new go.PathSegment(go.PathSegment.Bezier,nt,.5*et,(vt+gt+gt)*nt,(St-st)*et,.8*nt,(St-gt)*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,0,et,.8*nt,(St+gt)*et,(vt+gt+gt)*nt,(St+st)*et)),Et.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(Bt,nt,et){var ht=new go.Geometry,st=.5,gt=qt*st,vt=.2,St=.5,Et=new go.PathFigure(.1*nt,0,!1);ht.add(Et),Et.add(new go.PathSegment(go.PathSegment.Bezier,.1*nt,et,.35*nt,.25*et,.35*nt,.75*et));var Tt=new go.PathFigure(.8*nt,.5*et,!0);ht.add(Tt),Tt.add(new go.PathSegment(go.PathSegment.Bezier,.2*nt,et,.7*nt,(St+gt)*et,(vt+gt)*nt,(St+st)*et)),Tt.add(new go.PathSegment(go.PathSegment.Bezier,.2*nt,0,.45*nt,.75*et,.45*nt,.25*et)),Tt.add(new go.PathSegment(go.PathSegment.Bezier,.8*nt,.5*et,(vt+gt)*nt,(St-st)*et,.7*nt,(St-gt)*et)),st=.1,gt=qt*.1,vt=.9,St=.5;var Ot=new go.PathFigure((vt-st)*nt,St*et,!0);return ht.add(Ot),Ot.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,(St-st)*et,(vt-st)*nt,(St-gt)*et,(vt-gt)*nt,(St-st)*et)),Ot.add(new go.PathSegment(go.PathSegment.Bezier,(vt+st)*nt,St*et,(vt+gt)*nt,(St-st)*et,(vt+st)*nt,(St-gt)*et)),Ot.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,(St+st)*et,(vt+st)*nt,(St+gt)*et,(vt+gt)*nt,(St+st)*et)),Ot.add(new go.PathSegment(go.PathSegment.Bezier,(vt-st)*nt,St*et,(vt-gt)*nt,(St+st)*et,(vt-st)*nt,(St+gt)*et)),ht.spot1=new go.Spot(.4,.25),ht.spot2=new go.Spot(.65,.75),ht}),go.Shape.defineFigureGenerator("XorGate",function(Bt,nt,et){var ht=new go.Geometry,st=.5,gt=qt*st,vt=.2,St=.5,Et=new go.PathFigure(.1*nt,0,!1);ht.add(Et),Et.add(new go.PathSegment(go.PathSegment.Bezier,.1*nt,et,.35*nt,.25*et,.35*nt,.75*et));var Tt=new go.PathFigure(.2*nt,0,!0);return ht.add(Tt),Tt.add(new go.PathSegment(go.PathSegment.Bezier,nt,.5*et,(vt+gt)*nt,(St-st)*et,.9*nt,(St-gt)*et)),Tt.add(new go.PathSegment(go.PathSegment.Bezier,.2*nt,et,.9*nt,(St+gt)*et,(vt+gt)*nt,(St+st)*et)),Tt.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(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,0,!1);return ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,0,et)),st.add(new go.PathSegment(go.PathSegment.Move,nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,nt,et)),ht}),go.Shape.defineFigureGenerator("Resistor",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,.5*et,!1);return ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,.1*nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,.2*nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,.3*nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,.4*nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,.5*nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,.6*nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,.7*nt,.5*et)),ht}),go.Shape.defineFigureGenerator("Inductor",function(Bt,nt,et){var ht=new go.Geometry,st=qt*.1,gt=.1,vt=.1,St=.5,Et=new go.PathFigure((vt-st*.5)*nt,et,!1);return ht.add(Et),Et.add(new go.PathSegment(go.PathSegment.Bezier,(vt+gt)*nt,0,(vt-st)*nt,et,(vt-gt)*nt,0)),vt=.3,Et.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,et,(vt+gt)*nt,0,(vt+st)*nt,et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,(vt+gt)*nt,0,(vt-st)*nt,et,(vt-gt)*nt,0)),vt=.5,Et.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,et,(vt+gt)*nt,0,(vt+st)*nt,et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,(vt+gt)*nt,0,(vt-st)*nt,et,(vt-gt)*nt,0)),vt=.7,Et.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,et,(vt+gt)*nt,0,(vt+st)*nt,et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,(vt+gt)*nt,0,(vt-st)*nt,et,(vt-gt)*nt,0)),vt=.9,Et.add(new go.PathSegment(go.PathSegment.Bezier,(vt+st*.5)*nt,et,(vt+gt)*nt,0,(vt+st)*nt,et)),ht}),go.Shape.defineFigureGenerator("ACvoltageSource",function(Bt,nt,et){var ht=new go.Geometry,st=qt*.5,gt=.5,vt=.5,St=.5,Et=new go.PathFigure((vt-gt)*nt,St*et,!1);return ht.add(Et),Et.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,(St-gt)*et,(vt-gt)*nt,(St-st)*et,(vt-st)*nt,(St-gt)*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,(vt+gt)*nt,St*et,(vt+st)*nt,(St-gt)*et,(vt+gt)*nt,(St-st)*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,(St+gt)*et,(vt+gt)*nt,(St+st)*et,(vt+st)*nt,(St+gt)*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,(vt-gt)*nt,St*et,(vt-st)*nt,(St+gt)*et,(vt-gt)*nt,(St+st)*et)),Et.add(new go.PathSegment(go.PathSegment.Move,(vt-gt+.1)*nt,St*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,(vt+gt-.1)*nt,St*et,vt*nt,(St-gt)*et,vt*nt,(St+gt)*et)),ht}),go.Shape.defineFigureGenerator("DCvoltageSource",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,.75*et,!1);return ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,0,.25*et)),st.add(new go.PathSegment(go.PathSegment.Move,nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,nt,et)),ht}),go.Shape.defineFigureGenerator("Diode",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(nt,0,!1);return ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,nt,.5*et)),st.add(new go.PathSegment(go.PathSegment.Line,0,et)),st.add(new go.PathSegment(go.PathSegment.Line,0,0)),st.add(new go.PathSegment(go.PathSegment.Line,nt,.5*et)),st.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(Bt,nt,et){var ht=new go.Geometry,st=nt,gt=et;nt=nt*.38,et=et*.6;var vt=qt*.8,St=.8,Et=0,Tt=.5,Ot=(st-nt)/2,$t=(gt-et)/2,Xt=new go.PathFigure(Et*nt+Ot,(Tt+St)*et+$t,!0);ht.add(Xt),Xt.add(new go.PathSegment(go.PathSegment.Bezier,(Et-St)*nt+Ot,Tt*et+$t,(Et-vt)*nt+Ot,(Tt+St)*et+$t,(Et-St)*nt+Ot,(Tt+vt)*et+$t)),Xt.add(new go.PathSegment(go.PathSegment.Bezier,Et*nt+Ot,(Tt-St)*et+$t,(Et-St)*nt+Ot,(Tt-vt)*et+$t,(Et-vt)*nt+Ot,(Tt-St)*et+$t)),Xt.add(new go.PathSegment(go.PathSegment.Bezier,(Et-St+vt*.5)*nt+Ot,Tt*et+$t,Et*nt+Ot,(Tt-St)*et+$t,(Et-St+vt*.5)*nt+Ot,(Tt-vt)*et+$t)),Xt.add(new go.PathSegment(go.PathSegment.Bezier,Et*nt+Ot,(Tt+St)*et+$t,(Et-St+vt*.5)*nt+Ot,(Tt+vt)*et+$t,Et*nt+Ot,(Tt+St)*et+$t).close()),vt=qt*.4,St=.4,Et=.2,Tt=.5;var Ht=new go.PathFigure(Et*nt+Ot,(Tt+St)*et+$t,!0);ht.add(Ht),Ht.add(new go.PathSegment(go.PathSegment.Bezier,(Et-St)*nt+Ot,Tt*et+$t,(Et-vt)*nt+Ot,(Tt+St)*et+$t,(Et-St)*nt+Ot,(Tt+vt)*et+$t)),Ht.add(new go.PathSegment(go.PathSegment.Bezier,Et*nt+Ot,(Tt-St)*et+$t,(Et-St)*nt+Ot,(Tt-vt)*et+$t,(Et-vt)*nt+Ot,(Tt-St)*et+$t)),Ht.add(new go.PathSegment(go.PathSegment.Bezier,(Et-St+vt*.5)*nt+Ot,Tt*et+$t,Et*nt+Ot,(Tt-St)*et+$t,(Et-St+vt*.5)*nt+Ot,(Tt-vt)*et+$t)),Ht.add(new go.PathSegment(go.PathSegment.Bezier,Et*nt+Ot,(Tt+St)*et+$t,(Et-St+vt*.5)*nt+Ot,(Tt+vt)*et+$t,Et*nt+Ot,(Tt+St)*et+$t).close()),vt=qt*.2,St=.2,Et=.5,Tt=.5;var ve=new go.PathFigure((Et-St)*nt+Ot,Tt*et+$t,!0);ht.add(ve),ve.add(new go.PathSegment(go.PathSegment.Bezier,Et*nt+Ot,(Tt-St)*et+$t,(Et-St)*nt+Ot,(Tt-vt)*et+$t,(Et-vt)*nt+Ot,(Tt-St)*et+$t)),ve.add(new go.PathSegment(go.PathSegment.Bezier,(Et+St)*nt+Ot,Tt*et+$t,(Et+vt)*nt+Ot,(Tt-St)*et+$t,(Et+St)*nt+Ot,(Tt-vt)*et+$t)),ve.add(new go.PathSegment(go.PathSegment.Bezier,Et*nt+Ot,(Tt+St)*et+$t,(Et+St)*nt+Ot,(Tt+vt)*et+$t,(Et+vt)*nt+Ot,(Tt+St)*et+$t)),ve.add(new go.PathSegment(go.PathSegment.Bezier,(Et-St)*nt+Ot,Tt*et+$t,(Et-vt)*nt+Ot,(Tt+St)*et+$t,(Et-St)*nt+Ot,(Tt+vt)*et+$t)),vt=qt*.4,St=.4,Et=.8,Tt=.5;var ie=new go.PathFigure(Et*nt+Ot,(Tt-St)*et+$t,!0);ht.add(ie),ie.add(new go.PathSegment(go.PathSegment.Bezier,(Et+St)*nt+Ot,Tt*et+$t,(Et+vt)*nt+Ot,(Tt-St)*et+$t,(Et+St)*nt+Ot,(Tt-vt)*et+$t)),ie.add(new go.PathSegment(go.PathSegment.Bezier,Et*nt+Ot,(Tt+St)*et+$t,(Et+St)*nt+Ot,(Tt+vt)*et+$t,(Et+vt)*nt+Ot,(Tt+St)*et+$t)),ie.add(new go.PathSegment(go.PathSegment.Bezier,(Et+St-vt*.5)*nt+Ot,Tt*et+$t,Et*nt+Ot,(Tt+St)*et+$t,(Et+St-vt*.5)*nt+Ot,(Tt+vt)*et+$t)),ie.add(new go.PathSegment(go.PathSegment.Bezier,Et*nt+Ot,(Tt-St)*et+$t,(Et+St-vt*.5)*nt+Ot,(Tt-vt)*et+$t,Et*nt+Ot,(Tt-St)*et+$t).close()),vt=qt*.8,St=.8,Et=1,Tt=.5;var Ne=new go.PathFigure(Et*nt+Ot,(Tt-St)*et+$t,!0);return ht.add(Ne),Ne.add(new go.PathSegment(go.PathSegment.Bezier,(Et+St)*nt+Ot,Tt*et+$t,(Et+vt)*nt+Ot,(Tt-St)*et+$t,(Et+St)*nt+Ot,(Tt-vt)*et+$t)),Ne.add(new go.PathSegment(go.PathSegment.Bezier,Et*nt+Ot,(Tt+St)*et+$t,(Et+St)*nt+Ot,(Tt+vt)*et+$t,(Et+vt)*nt+Ot,(Tt+St)*et+$t)),Ne.add(new go.PathSegment(go.PathSegment.Bezier,(Et+St-vt*.5)*nt+Ot,Tt*et+$t,Et*nt+Ot,(Tt+St)*et+$t,(Et+St-vt*.5)*nt+Ot,(Tt+vt)*et+$t)),Ne.add(new go.PathSegment(go.PathSegment.Bezier,Et*nt+Ot,(Tt-St)*et+$t,(Et+St-vt*.5)*nt+Ot,(Tt-vt)*et+$t,Et*nt+Ot,(Tt-St)*et+$t).close()),ht}),go.Shape.defineFigureGenerator("Email",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,0,!0);ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,0,et)),st.add(new go.PathSegment(go.PathSegment.Line,0,0).close());var gt=new go.PathFigure(0,0,!1);return ht.add(gt),gt.add(new go.PathSegment(go.PathSegment.Line,.5*nt,.6*et)),gt.add(new go.PathSegment(go.PathSegment.Line,nt,0)),gt.add(new go.PathSegment(go.PathSegment.Move,0,et)),gt.add(new go.PathSegment(go.PathSegment.Line,.45*nt,.54*et)),gt.add(new go.PathSegment(go.PathSegment.Move,nt,et)),gt.add(new go.PathSegment(go.PathSegment.Line,.55*nt,.54*et)),ht}),go.Shape.defineFigureGenerator("Ethernet",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(.35*nt,0,!0);ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,.65*nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,.65*nt,.4*et)),st.add(new go.PathSegment(go.PathSegment.Line,.35*nt,.4*et)),st.add(new go.PathSegment(go.PathSegment.Line,.35*nt,0).close());var gt=new go.PathFigure(.1*nt,et,!0,!0);ht.add(gt),gt.add(new go.PathSegment(go.PathSegment.Line,.4*nt,et)),gt.add(new go.PathSegment(go.PathSegment.Line,.4*nt,.6*et)),gt.add(new go.PathSegment(go.PathSegment.Line,.1*nt,.6*et)),gt.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 St=new go.PathFigure(0,.5*et,!1);return ht.add(St),St.add(new go.PathSegment(go.PathSegment.Line,nt,.5*et)),St.add(new go.PathSegment(go.PathSegment.Move,.5*nt,.5*et)),St.add(new go.PathSegment(go.PathSegment.Line,.5*nt,.4*et)),St.add(new go.PathSegment(go.PathSegment.Move,.75*nt,.5*et)),St.add(new go.PathSegment(go.PathSegment.Line,.75*nt,.6*et)),St.add(new go.PathSegment(go.PathSegment.Move,.25*nt,.5*et)),St.add(new go.PathSegment(go.PathSegment.Line,.25*nt,.6*et)),ht}),go.Shape.defineFigureGenerator("Power",function(Bt,nt,et){var ht=new go.Geometry,st=qt*.4,gt=.4,vt=.5,St=.5,Et=pt(),Tt=pt(),Ot=pt(),$t=pt();Le(vt,St-gt,vt+st,St-gt,vt+gt,St-st,vt+gt,St,.5,Et,Et,Tt,Ot,$t);var Xt=kt(Tt.x,Tt.y),Ht=new go.PathFigure(Tt.x*nt,Tt.y*et,!0);ht.add(Ht),Ht.add(new go.PathSegment(go.PathSegment.Bezier,(vt+gt)*nt,St*et,Ot.x*nt,Ot.y*et,$t.x*nt,$t.y*et)),Ht.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,(St+gt)*et,(vt+gt)*nt,(St+st)*et,(vt+st)*nt,(St+gt)*et)),Ht.add(new go.PathSegment(go.PathSegment.Bezier,(vt-gt)*nt,St*et,(vt-st)*nt,(St+gt)*et,(vt-gt)*nt,(St+st)*et)),Le(vt-gt,St,vt-gt,St-st,vt-st,St-gt,vt,St-gt,.5,Ot,$t,Tt,Et,Et),Ht.add(new go.PathSegment(go.PathSegment.Bezier,Tt.x*nt,Tt.y*et,Ot.x*nt,Ot.y*et,$t.x*nt,$t.y*et)),st=qt*.3,gt=.3,Le(vt-gt,St,vt-gt,St-st,vt-st,St-gt,vt,St-gt,.5,Ot,$t,Tt,Et,Et),Ht.add(new go.PathSegment(go.PathSegment.Line,Tt.x*nt,Tt.y*et)),Ht.add(new go.PathSegment(go.PathSegment.Bezier,(vt-gt)*nt,St*et,$t.x*nt,$t.y*et,Ot.x*nt,Ot.y*et)),Ht.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,(St+gt)*et,(vt-gt)*nt,(St+st)*et,(vt-st)*nt,(St+gt)*et)),Ht.add(new go.PathSegment(go.PathSegment.Bezier,(vt+gt)*nt,St*et,(vt+st)*nt,(St+gt)*et,(vt+gt)*nt,(St+st)*et)),Le(vt,St-gt,vt+st,St-gt,vt+gt,St-st,vt+gt,St,.5,Et,Et,Tt,Ot,$t),Ht.add(new go.PathSegment(go.PathSegment.Bezier,Tt.x*nt,Tt.y*et,$t.x*nt,$t.y*et,Ot.x*nt,Ot.y*et).close());var Ht=new go.PathFigure(.45*nt,0,!0);return ht.add(Ht),Ht.add(new go.PathSegment(go.PathSegment.Line,.45*nt,.5*et)),Ht.add(new go.PathSegment(go.PathSegment.Line,.55*nt,.5*et)),Ht.add(new go.PathSegment(go.PathSegment.Line,.55*nt,0).close()),Ut(Et),Ut(Tt),Ut(Ot),Ut($t),Ut(Xt),ht.spot1=new go.Spot(.25,.45),ht.spot2=new go.Spot(.75,.8),ht}),go.Shape.defineFigureGenerator("Fallout",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,et/2,!0);ht.add(st),st.add(new go.PathSegment(go.PathSegment.Arc,180,360,nt/2,et/2,nt/2,et/2));function gt(vt,St,Et){vt.add(new go.PathSegment(go.PathSegment.Move,(.3+St)*nt,(.8+Et)*et)),vt.add(new go.PathSegment(go.PathSegment.Line,(.5+St)*nt,(.5+Et)*et)),vt.add(new go.PathSegment(go.PathSegment.Line,(.1+St)*nt,(.5+Et)*et)),vt.add(new go.PathSegment(go.PathSegment.Line,(.3+St)*nt,(.8+Et)*et).close())}return gt(st,0,0),gt(st,.4,0),gt(st,.2,-.3),ht}),go.Shape.defineFigureGenerator("IrritationHazard",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(.2*nt,0,!0);return ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,.5*nt,.3*et)),st.add(new go.PathSegment(go.PathSegment.Line,.8*nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,nt,.2*et)),st.add(new go.PathSegment(go.PathSegment.Line,.7*nt,.5*et)),st.add(new go.PathSegment(go.PathSegment.Line,nt,.8*et)),st.add(new go.PathSegment(go.PathSegment.Line,.8*nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,.5*nt,.7*et)),st.add(new go.PathSegment(go.PathSegment.Line,.2*nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,0,.8*et)),st.add(new go.PathSegment(go.PathSegment.Line,.3*nt,.5*et)),st.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(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(.37*nt,0,!0);return ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,.5*nt,.11*et)),st.add(new go.PathSegment(go.PathSegment.Line,.77*nt,.04*et)),st.add(new go.PathSegment(go.PathSegment.Line,.33*nt,.49*et)),st.add(new go.PathSegment(go.PathSegment.Line,nt,.37*et)),st.add(new go.PathSegment(go.PathSegment.Line,.63*nt,.86*et)),st.add(new go.PathSegment(go.PathSegment.Line,.77*nt,.91*et)),st.add(new go.PathSegment(go.PathSegment.Line,.34*nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,.34*nt,.78*et)),st.add(new go.PathSegment(go.PathSegment.Line,.44*nt,.8*et)),st.add(new go.PathSegment(go.PathSegment.Line,.65*nt,.56*et)),st.add(new go.PathSegment(go.PathSegment.Line,0,.68*et).close()),ht}),go.Shape.defineFigureGenerator("FireHazard",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(.1*nt,et,!0);return ht.add(st),st.add(new go.PathSegment(go.PathSegment.Bezier,.29*nt,0,-.25*nt,.63*et,.45*nt,.44*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,.51*nt,.42*et,.48*nt,.17*et,.54*nt,.35*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,.59*nt,.18*et,.59*nt,.29*et,.58*nt,.28*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,.75*nt,.6*et,.8*nt,.34*et,.88*nt,.43*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,.88*nt,.31*et,.87*nt,.48*et,.88*nt,.43*et)),st.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(Bt,nt,et){var ht=new go.Geometry,st=.5,gt=0,vt=0,St=st*qt,Et=.4*Math.SQRT2/2+.5,Tt=.5-.5*Math.SQRT2/2,Ot=1,$t=.5,Xt=.5,Ht=0,ve=new go.PathFigure(Et*nt,(1-Tt)*et,!1);return ht.add(ve),ve.add(new go.PathSegment(go.PathSegment.Bezier,Ot*nt,$t*et,Ot*nt,.7*et,Ot*nt,$t*et)),ve.add(new go.PathSegment(go.PathSegment.Bezier,(Xt+gt)*nt,(Ht+gt)*et,(.5+st+gt)*nt,(.5-St+gt)*et,(.5+St+gt)*nt,(.5-st+gt)*et)),ve.add(new go.PathSegment(go.PathSegment.Bezier,(.5-st+gt)*nt,(.5+vt)*et,(.5-St+gt)*nt,(.5-st+vt)*et,(.5-st+gt)*nt,(.5-St+vt)*et)),ve.add(new go.PathSegment(go.PathSegment.Bezier,(.35+gt)*nt,.9*et,(.5-st+gt)*nt,(.5+St+vt)*et,(.5-St+gt)*nt,.9*et)),ve.add(new go.PathSegment(go.PathSegment.Move,(.25+gt)*nt,.8*et)),ve.add(new go.PathSegment(go.PathSegment.Line,(.35+gt)*nt,.9*et)),ve.add(new go.PathSegment(go.PathSegment.Line,(.2+gt)*nt,.95*et)),ht}),go.Shape.defineFigureGenerator("BpmnActivityParallel",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,0,!1);return ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,0,et)),st.add(new go.PathSegment(go.PathSegment.Move,.5*nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,.5*nt,et)),st.add(new go.PathSegment(go.PathSegment.Move,nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,nt,et)),ht}),go.Shape.defineFigureGenerator("BpmnActivitySequential",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,0,!1);return ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,nt,0)),st.add(new go.PathSegment(go.PathSegment.Move,0,.5*et)),st.add(new go.PathSegment(go.PathSegment.Line,nt,.5*et)),st.add(new go.PathSegment(go.PathSegment.Move,0,et)),st.add(new go.PathSegment(go.PathSegment.Line,nt,et)),ht}),go.Shape.defineFigureGenerator("BpmnActivityAdHoc",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,0,!1);ht.add(st);var gt=new go.PathFigure(nt,et,!1);ht.add(gt);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(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,.5*et,!0);return ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,.5*nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,.5*nt,.5*et)),st.add(new go.PathSegment(go.PathSegment.Line,nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,.5*nt,.5*et)),st.add(new go.PathSegment(go.PathSegment.Line,.5*nt,et).close()),ht}),go.Shape.defineFigureGenerator("BpmnTaskMessage",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,.2*et,!0);ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,nt,.2*et)),st.add(new go.PathSegment(go.PathSegment.Line,nt,.8*et)),st.add(new go.PathSegment(go.PathSegment.Line,0,.8*et)),st.add(new go.PathSegment(go.PathSegment.Line,0,.8*et).close());var st=new go.PathFigure(0,.2*et,!1);return ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,.5*nt,.5*et)),st.add(new go.PathSegment(go.PathSegment.Line,nt,.2*et)),ht}),go.Shape.defineFigureGenerator("BpmnTaskScript",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(.7*nt,et,!0);ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,.3*nt,et)),st.add(new go.PathSegment(go.PathSegment.Bezier,.3*nt,0,.6*nt,.5*et,0,.5*et)),st.add(new go.PathSegment(go.PathSegment.Line,.7*nt,0)),st.add(new go.PathSegment(go.PathSegment.Bezier,.7*nt,et,.4*nt,.5*et,nt,.5*et).close());var gt=new go.PathFigure(.45*nt,.73*et,!1);return ht.add(gt),gt.add(new go.PathSegment(go.PathSegment.Line,.7*nt,.73*et)),gt.add(new go.PathSegment(go.PathSegment.Move,.38*nt,.5*et)),gt.add(new go.PathSegment(go.PathSegment.Line,.63*nt,.5*et)),gt.add(new go.PathSegment(go.PathSegment.Move,.31*nt,.27*et)),gt.add(new go.PathSegment(go.PathSegment.Line,.56*nt,.27*et)),ht}),go.Shape.defineFigureGenerator("BpmnTaskUser",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,0,!1);ht.add(st);var gt=new go.PathFigure(.335*nt,(1-.555)*et,!0);ht.add(gt),gt.add(new go.PathSegment(go.PathSegment.Line,.335*nt,(1-.405)*et)),gt.add(new go.PathSegment(go.PathSegment.Line,(1-.335)*nt,(1-.405)*et)),gt.add(new go.PathSegment(go.PathSegment.Line,(1-.335)*nt,(1-.555)*et)),gt.add(new go.PathSegment(go.PathSegment.Bezier,nt,.68*et,(1-.12)*nt,.46*et,(1-.02)*nt,.54*et)),gt.add(new go.PathSegment(go.PathSegment.Line,nt,et)),gt.add(new go.PathSegment(go.PathSegment.Line,0,et)),gt.add(new go.PathSegment(go.PathSegment.Line,0,.68*et)),gt.add(new go.PathSegment(go.PathSegment.Bezier,.335*nt,(1-.555)*et,.02*nt,.54*et,.12*nt,.46*et)),gt.add(new go.PathSegment(go.PathSegment.Line,.365*nt,(1-.595)*et));var vt=.5-.285,St=.5,Et=vt,Tt=Math.PI/4,Ot=4*(1-Math.cos(Tt))/(3*Math.sin(Tt)),$t=Ot*.5,Xt=vt,Ht=vt,ve=Ot*Xt,ie=Ot*Ht;gt.add(new go.PathSegment(go.PathSegment.Bezier,(St-Xt)*nt,Et*et,(St-(ve+Xt)/2)*nt,(Et+(Ht+ie)/2)*et,(St-Xt)*nt,(Et+ie)*et)),gt.add(new go.PathSegment(go.PathSegment.Bezier,St*nt,(Et-Ht)*et,(St-Xt)*nt,(Et-ie)*et,(St-ve)*nt,(Et-Ht)*et)),gt.add(new go.PathSegment(go.PathSegment.Bezier,(St+Xt)*nt,Et*et,(St+ve)*nt,(Et-Ht)*et,(St+Xt)*nt,(Et-ie)*et)),gt.add(new go.PathSegment(go.PathSegment.Bezier,(1-.365)*nt,(1-.595)*et,(St+Xt)*nt,(Et+ie)*et,(St+(ve+Xt)/2)*nt,(Et+(Ht+ie)/2)*et)),gt.add(new go.PathSegment(go.PathSegment.Line,(1-.365)*nt,(1-.595)*et)),gt.add(new go.PathSegment(go.PathSegment.Line,(1-.335)*nt,(1-.555)*et)),gt.add(new go.PathSegment(go.PathSegment.Line,(1-.335)*nt,(1-.405)*et)),gt.add(new go.PathSegment(go.PathSegment.Line,.335*nt,(1-.405)*et));var Ne=new go.PathFigure(.2*nt,et,!1);ht.add(Ne),Ne.add(new go.PathSegment(go.PathSegment.Line,.2*nt,.8*et));var xe=new go.PathFigure(.8*nt,et,!1);return ht.add(xe),xe.add(new go.PathSegment(go.PathSegment.Line,.8*nt,.8*et)),ht}),go.Shape.defineFigureGenerator("BpmnEventConditional",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(.1*nt,0,!0);ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,.9*nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,.9*nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,.1*nt,et).close());var gt=new go.PathFigure(.2*nt,.2*et,!1);return ht.add(gt),gt.add(new go.PathSegment(go.PathSegment.Line,.8*nt,.2*et)),gt.add(new go.PathSegment(go.PathSegment.Move,.2*nt,.4*et)),gt.add(new go.PathSegment(go.PathSegment.Line,.8*nt,.4*et)),gt.add(new go.PathSegment(go.PathSegment.Move,.2*nt,.6*et)),gt.add(new go.PathSegment(go.PathSegment.Line,.8*nt,.6*et)),gt.add(new go.PathSegment(go.PathSegment.Move,.2*nt,.8*et)),gt.add(new go.PathSegment(go.PathSegment.Line,.8*nt,.8*et)),ht}),go.Shape.defineFigureGenerator("BpmnEventError",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,et,!0);return ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,.33*nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,.66*nt,.5*et)),st.add(new go.PathSegment(go.PathSegment.Line,nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,.66*nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,.33*nt,.5*et).close()),ht}),go.Shape.defineFigureGenerator("BpmnEventEscalation",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,0,!1);ht.add(st);var gt=new go.PathFigure(nt,et,!1);ht.add(gt);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(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(.05*nt,et,!0);ht.add(st),st.add(new go.PathSegment(go.PathSegment.Bezier,.1*nt,.8*et,0,et,0,et)),st.add(new go.PathSegment(go.PathSegment.Line,.45*nt,.1*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,.55*nt,.1*et,.5*nt,0,.5*nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,.95*nt,.9*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,.9*nt,et,nt,et,nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,.05*nt,et));var gt=.05;return st.add(new go.PathSegment(go.PathSegment.Move,(.5-gt)*nt,.875*et)),st.add(new go.PathSegment(go.PathSegment.Arc,180,-360,.5*nt,.875*et,gt*nt,gt*et)),st.add(new go.PathSegment(go.PathSegment.Move,.5*nt,.75*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,.5*nt,.325*et,.575*nt,.725*et,.625*nt,.375*et)),st.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(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(.45*nt,.95*et,!1);ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,.2*nt,.95*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,.185*nt,.85*et,.17*nt,.95*et,.15*nt,.9*et)),st.add(new go.PathSegment(go.PathSegment.Line,.235*nt,.75*et)),st.add(new go.PathSegment(go.PathSegment.Line,.3*nt,.625*et)),st.add(new go.PathSegment(go.PathSegment.Line,.35*nt,.65*et)),st.add(new go.PathSegment(go.PathSegment.Line,.275*nt,.45*et)),st.add(new go.PathSegment(go.PathSegment.Line,.05*nt,.45*et)),st.add(new go.PathSegment(go.PathSegment.Line,.1*nt,.5*et)),st.add(new go.PathSegment(go.PathSegment.Line,.05*nt,.575*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,.1875*nt,.95*et,0,.675*et,0,.7*et)),st.add(new go.PathSegment(go.PathSegment.Move,.45*nt,.95*et)),st.add(new go.PathSegment(go.PathSegment.Line,.45*nt,.775*et)),st.add(new go.PathSegment(go.PathSegment.Line,.22*nt,.775*et));var gt=new go.PathFigure(.475*nt,.2*et,!1);ht.add(gt),gt.add(new go.PathSegment(go.PathSegment.Line,.4*nt,.4*et)),gt.add(new go.PathSegment(go.PathSegment.Line,.225*nt,.3*et)),gt.add(new go.PathSegment(go.PathSegment.Line,.275*nt,.175*et)),gt.add(new go.PathSegment(go.PathSegment.Line,.325*nt,.05*et)),gt.add(new go.PathSegment(go.PathSegment.Bezier,.4*nt,.05*et,.35*nt,0,.375*nt,0)),gt.add(new go.PathSegment(go.PathSegment.Line,.575*nt,.375*et)),gt.add(new go.PathSegment(go.PathSegment.Line,.525*nt,.4*et)),gt.add(new go.PathSegment(go.PathSegment.Line,.75*nt,.475*et)),gt.add(new go.PathSegment(go.PathSegment.Line,.85*nt,.315*et)),gt.add(new go.PathSegment(go.PathSegment.Line,.8*nt,.32*et)),gt.add(new go.PathSegment(go.PathSegment.Line,.65*nt,.05*et)),gt.add(new go.PathSegment(go.PathSegment.Bezier,.575*nt,0,.65*nt,.05*et,.625*nt,0)),gt.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(Bt,nt,et){var ht=new go.Geometry,st=.5,gt=qt*.5,vt=new go.PathFigure(nt,st*et,!0);ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Bezier,st*nt,et,nt,(st+gt)*et,(st+gt)*nt,et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,0,st*et,(st-gt)*nt,et,0,(st+gt)*et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,st*nt,0,0,(st-gt)*et,(st-gt)*nt,0)),vt.add(new go.PathSegment(go.PathSegment.Bezier,nt,st*et,(st+gt)*nt,0,nt,(st-gt)*et));var St=new go.PathFigure(st*nt,0,!1);return ht.add(St),St.add(new go.PathSegment(go.PathSegment.Line,st*nt,.15*et)),St.add(new go.PathSegment(go.PathSegment.Move,st*nt,et)),St.add(new go.PathSegment(go.PathSegment.Line,st*nt,.85*et)),St.add(new go.PathSegment(go.PathSegment.Move,0,st*et)),St.add(new go.PathSegment(go.PathSegment.Line,.15*nt,st*et)),St.add(new go.PathSegment(go.PathSegment.Move,nt,st*et)),St.add(new go.PathSegment(go.PathSegment.Line,.85*nt,st*et)),St.add(new go.PathSegment(go.PathSegment.Move,st*nt,st*et)),St.add(new go.PathSegment(go.PathSegment.Line,.58*nt,.1*et)),St.add(new go.PathSegment(go.PathSegment.Move,st*nt,st*et)),St.add(new go.PathSegment(go.PathSegment.Line,.78*nt,.54*et)),ht}),go.Shape.defineFigureGenerator("Package",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,.15*et,!0);ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,nt,.15*et)),st.add(new go.PathSegment(go.PathSegment.Line,nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,0,et).close());var gt=new go.PathFigure(0,.15*et,!0);return ht.add(gt),gt.add(new go.PathSegment(go.PathSegment.Line,0,0)),gt.add(new go.PathSegment(go.PathSegment.Line,.6*nt,0)),gt.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(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,0,!0);ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,0,et)),st.add(new go.PathSegment(go.PathSegment.Line,0,0).close());var gt=new go.PathFigure(0,.2*et,!1);ht.add(gt),gt.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(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(nt,et,!0);ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,.15*nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,.15*nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,nt,et).close());var gt=new go.PathFigure(0,.2*et,!0);ht.add(gt),gt.add(new go.PathSegment(go.PathSegment.Line,.45*nt,.2*et)),gt.add(new go.PathSegment(go.PathSegment.Line,.45*nt,.4*et)),gt.add(new go.PathSegment(go.PathSegment.Line,0,.4*et)),gt.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(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(.15*nt,.6*et,!0);ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,.15*nt,.6*et)),st.add(new go.PathSegment(go.PathSegment.Line,0,.6*et)),st.add(new go.PathSegment(go.PathSegment.Line,.15*nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,.85*nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,nt,.6*et)),st.add(new go.PathSegment(go.PathSegment.Line,.85*nt,.6*et)),st.add(new go.PathSegment(go.PathSegment.Line,.5*nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,.15*nt,.6*et));var gt=new go.PathFigure(.15*nt,.6*et,!1);return ht.add(gt),gt.add(new go.PathSegment(go.PathSegment.Line,.85*nt,.6*et)),ht}),go.Shape.defineFigureGenerator("Customer/Supplier",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(nt,et,!0);return ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,.66*nt,.33*et)),st.add(new go.PathSegment(go.PathSegment.Line,.66*nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,.33*nt,.33*et)),st.add(new go.PathSegment(go.PathSegment.Line,.33*nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,0,.33*et)),st.add(new go.PathSegment(go.PathSegment.Line,0,et)),st.add(new go.PathSegment(go.PathSegment.Line,nt,et).close()),ht}),go.Shape.defineFigureGenerator("Workcell",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,et,!0);return ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,0,0)),st.add(new go.PathSegment(go.PathSegment.Line,nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,.65*nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,.65*nt,.4*et)),st.add(new go.PathSegment(go.PathSegment.Line,.35*nt,.4*et)),st.add(new go.PathSegment(go.PathSegment.Line,.35*nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,0,et).close()),ht}),go.Shape.defineFigureGenerator("Supermarket",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,0,!1);return ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,nt,.33*et)),st.add(new go.PathSegment(go.PathSegment.Line,0,.33*et)),st.add(new go.PathSegment(go.PathSegment.Move,nt,.33*et)),st.add(new go.PathSegment(go.PathSegment.Line,nt,.66*et)),st.add(new go.PathSegment(go.PathSegment.Line,0,.66*et)),st.add(new go.PathSegment(go.PathSegment.Move,nt,.66*et)),st.add(new go.PathSegment(go.PathSegment.Line,nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,0,et)),ht}),go.Shape.defineFigureGenerator("TruckShipment",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,0,!0);ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,.6*nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,.6*nt,.8*et)),st.add(new go.PathSegment(go.PathSegment.Line,0,.8*et)),st.add(new go.PathSegment(go.PathSegment.Line,0,0).close());var gt=new go.PathFigure(nt,.8*et,!0);ht.add(gt),gt.add(new go.PathSegment(go.PathSegment.Line,nt,.4*et)),gt.add(new go.PathSegment(go.PathSegment.Line,.6*nt,.4*et)),gt.add(new go.PathSegment(go.PathSegment.Line,.6*nt,.8*et)),gt.add(new go.PathSegment(go.PathSegment.Line,nt,.8*et).close());var vt=.1,St=qt*.1,Et=.2,Tt=.9,Ot=new go.PathFigure((Et-vt)*nt,Tt*et,!0);ht.add(Ot),Ot.add(new go.PathSegment(go.PathSegment.Bezier,Et*nt,(Tt-vt)*et,(Et-vt)*nt,(Tt-St)*et,(Et-St)*nt,(Tt-vt)*et)),Ot.add(new go.PathSegment(go.PathSegment.Bezier,(Et+vt)*nt,Tt*et,(Et+St)*nt,(Tt-vt)*et,(Et+vt)*nt,(Tt-St)*et)),Ot.add(new go.PathSegment(go.PathSegment.Bezier,Et*nt,(Tt+vt)*et,(Et+vt)*nt,(Tt+St)*et,(Et+St)*nt,(Tt+vt)*et)),Ot.add(new go.PathSegment(go.PathSegment.Bezier,(Et-vt)*nt,Tt*et,(Et-St)*nt,(Tt+vt)*et,(Et-vt)*nt,(Tt+St)*et).close()),vt=.1,St=qt*.1,Et=.8,Tt=.9;var $t=new go.PathFigure((Et-vt)*nt,Tt*et,!0);return ht.add($t),$t.add(new go.PathSegment(go.PathSegment.Bezier,Et*nt,(Tt-vt)*et,(Et-vt)*nt,(Tt-St)*et,(Et-St)*nt,(Tt-vt)*et)),$t.add(new go.PathSegment(go.PathSegment.Bezier,(Et+vt)*nt,Tt*et,(Et+St)*nt,(Tt-vt)*et,(Et+vt)*nt,(Tt-St)*et)),$t.add(new go.PathSegment(go.PathSegment.Bezier,Et*nt,(Tt+vt)*et,(Et+vt)*nt,(Tt+St)*et,(Et+St)*nt,(Tt+vt)*et)),$t.add(new go.PathSegment(go.PathSegment.Bezier,(Et-vt)*nt,Tt*et,(Et-St)*nt,(Tt+vt)*et,(Et-vt)*nt,(Tt+St)*et).close()),ht}),go.Shape.defineFigureGenerator("KanbanPost",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(.2*nt,0,!1);return ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,.2*nt,.5*et)),st.add(new go.PathSegment(go.PathSegment.Line,.8*nt,.5*et)),st.add(new go.PathSegment(go.PathSegment.Line,.8*nt,0)),st.add(new go.PathSegment(go.PathSegment.Move,.5*nt,.5*et)),st.add(new go.PathSegment(go.PathSegment.Line,.5*nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,.2*nt,et)),st.add(new go.PathSegment(go.PathSegment.Move,.5*nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,.8*nt,et)),ht}),go.Shape.defineFigureGenerator("Forklift",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,0,!0);ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,0,.5*et)),st.add(new go.PathSegment(go.PathSegment.Line,.5*nt,.5*et)),st.add(new go.PathSegment(go.PathSegment.Line,.4*nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,0,0));var gt=new go.PathFigure(0,.5*et,!0);ht.add(gt),gt.add(new go.PathSegment(go.PathSegment.Line,0,.8*et)),gt.add(new go.PathSegment(go.PathSegment.Line,.5*nt,.8*et)),gt.add(new go.PathSegment(go.PathSegment.Line,.5*nt,.5*et)),gt.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 St=new go.PathFigure(.5*nt,.7*et,!1);ht.add(St),St.add(new go.PathSegment(go.PathSegment.Line,nt,.7*et));var Et=.1,Tt=qt*.1,Ot=.1,$t=.9,Xt=new go.PathFigure((Ot-Et)*nt,$t*et,!0);ht.add(Xt),Xt.add(new go.PathSegment(go.PathSegment.Bezier,Ot*nt,($t-Et)*et,(Ot-Et)*nt,($t-Tt)*et,(Ot-Tt)*nt,($t-Et)*et)),Xt.add(new go.PathSegment(go.PathSegment.Bezier,(Ot+Et)*nt,$t*et,(Ot+Tt)*nt,($t-Et)*et,(Ot+Et)*nt,($t-Tt)*et)),Xt.add(new go.PathSegment(go.PathSegment.Bezier,Ot*nt,($t+Et)*et,(Ot+Et)*nt,($t+Tt)*et,(Ot+Tt)*nt,($t+Et)*et)),Xt.add(new go.PathSegment(go.PathSegment.Bezier,(Ot-Et)*nt,$t*et,(Ot-Tt)*nt,($t+Et)*et,(Ot-Et)*nt,($t+Tt)*et)),Et=.1,Tt=qt*.1,Ot=.4,$t=.9;var Ht=new go.PathFigure((Ot-Et)*nt,$t*et,!0);return ht.add(Ht),Ht.add(new go.PathSegment(go.PathSegment.Bezier,Ot*nt,($t-Et)*et,(Ot-Et)*nt,($t-Tt)*et,(Ot-Tt)*nt,($t-Et)*et)),Ht.add(new go.PathSegment(go.PathSegment.Bezier,(Ot+Et)*nt,$t*et,(Ot+Tt)*nt,($t-Et)*et,(Ot+Et)*nt,($t-Tt)*et)),Ht.add(new go.PathSegment(go.PathSegment.Bezier,Ot*nt,($t+Et)*et,(Ot+Et)*nt,($t+Tt)*et,(Ot+Tt)*nt,($t+Et)*et)),Ht.add(new go.PathSegment(go.PathSegment.Bezier,(Ot-Et)*nt,$t*et,(Ot-Tt)*nt,($t+Et)*et,(Ot-Et)*nt,($t+Tt)*et)),ht}),go.Shape.defineFigureGenerator("RailShipment",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(.1*nt,.4*et,!0);ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,.45*nt,.4*et)),st.add(new go.PathSegment(go.PathSegment.Line,.45*nt,.9*et)),st.add(new go.PathSegment(go.PathSegment.Line,.1*nt,.9*et)),st.add(new go.PathSegment(go.PathSegment.Line,.1*nt,.4*et).close());var gt=new go.PathFigure(.45*nt,.7*et,!1);ht.add(gt),gt.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 Ot=.05,$t=qt*.05,Xt=.175,Ht=.95,St=new go.PathFigure((Xt-Ot)*nt,Ht*et,!0);ht.add(St),St.add(new go.PathSegment(go.PathSegment.Bezier,Xt*nt,(Ht-Ot)*et,(Xt-Ot)*nt,(Ht-$t)*et,(Xt-$t)*nt,(Ht-Ot)*et)),St.add(new go.PathSegment(go.PathSegment.Bezier,(Xt+Ot)*nt,Ht*et,(Xt+$t)*nt,(Ht-Ot)*et,(Xt+Ot)*nt,(Ht-$t)*et)),St.add(new go.PathSegment(go.PathSegment.Bezier,Xt*nt,(Ht+Ot)*et,(Xt+Ot)*nt,(Ht+$t)*et,(Xt+$t)*nt,(Ht+Ot)*et)),St.add(new go.PathSegment(go.PathSegment.Bezier,(Xt-Ot)*nt,Ht*et,(Xt-$t)*nt,(Ht+Ot)*et,(Xt-Ot)*nt,(Ht+$t)*et));var Ot=.05,$t=qt*.05,Xt=.375,Ht=.95,Et=new go.PathFigure((Xt-Ot)*nt,Ht*et,!0);ht.add(Et),Et.add(new go.PathSegment(go.PathSegment.Bezier,Xt*nt,(Ht-Ot)*et,(Xt-Ot)*nt,(Ht-$t)*et,(Xt-$t)*nt,(Ht-Ot)*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,(Xt+Ot)*nt,Ht*et,(Xt+$t)*nt,(Ht-Ot)*et,(Xt+Ot)*nt,(Ht-$t)*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,Xt*nt,(Ht+Ot)*et,(Xt+Ot)*nt,(Ht+$t)*et,(Xt+$t)*nt,(Ht+Ot)*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,(Xt-Ot)*nt,Ht*et,(Xt-$t)*nt,(Ht+Ot)*et,(Xt-Ot)*nt,(Ht+$t)*et));var Ot=.05,$t=qt*.05,Xt=.625,Ht=.95,Tt=new go.PathFigure((Xt-Ot)*nt,Ht*et,!0);ht.add(Tt),Tt.add(new go.PathSegment(go.PathSegment.Bezier,Xt*nt,(Ht-Ot)*et,(Xt-Ot)*nt,(Ht-$t)*et,(Xt-$t)*nt,(Ht-Ot)*et)),Tt.add(new go.PathSegment(go.PathSegment.Bezier,(Xt+Ot)*nt,Ht*et,(Xt+$t)*nt,(Ht-Ot)*et,(Xt+Ot)*nt,(Ht-$t)*et)),Tt.add(new go.PathSegment(go.PathSegment.Bezier,Xt*nt,(Ht+Ot)*et,(Xt+Ot)*nt,(Ht+$t)*et,(Xt+$t)*nt,(Ht+Ot)*et)),Tt.add(new go.PathSegment(go.PathSegment.Bezier,(Xt-Ot)*nt,Ht*et,(Xt-$t)*nt,(Ht+Ot)*et,(Xt-Ot)*nt,(Ht+$t)*et));var Ot=.05,$t=qt*.05,Xt=.825,Ht=.95,ve=new go.PathFigure((Xt-Ot)*nt,Ht*et,!0);ht.add(ve),ve.add(new go.PathSegment(go.PathSegment.Bezier,Xt*nt,(Ht-Ot)*et,(Xt-Ot)*nt,(Ht-$t)*et,(Xt-$t)*nt,(Ht-Ot)*et)),ve.add(new go.PathSegment(go.PathSegment.Bezier,(Xt+Ot)*nt,Ht*et,(Xt+$t)*nt,(Ht-Ot)*et,(Xt+Ot)*nt,(Ht-$t)*et)),ve.add(new go.PathSegment(go.PathSegment.Bezier,Xt*nt,(Ht+Ot)*et,(Xt+Ot)*nt,(Ht+$t)*et,(Xt+$t)*nt,(Ht+Ot)*et)),ve.add(new go.PathSegment(go.PathSegment.Bezier,(Xt-Ot)*nt,Ht*et,(Xt-$t)*nt,(Ht+Ot)*et,(Xt-Ot)*nt,(Ht+$t)*et).close());var ie=new go.PathFigure(0,et,!1);return ht.add(ie),ie.add(new go.PathSegment(go.PathSegment.Line,nt,et).close()),ht}),go.Shape.defineFigureGenerator("Warehouse",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,0,!0);ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,0,et)),st.add(new go.PathSegment(go.PathSegment.Line,0,0).close());var gt=new go.PathFigure(0,.2*et,!1);ht.add(gt),gt.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 St=.05,Et=qt*.05,Tt=.35,Ot=.775,$t=new go.PathFigure((Tt-St)*nt,Ot*et,!0);return ht.add($t),$t.add(new go.PathSegment(go.PathSegment.Bezier,Tt*nt,(Ot-St)*et,(Tt-St)*nt,(Ot-Et)*et,(Tt-Et)*nt,(Ot-St)*et)),$t.add(new go.PathSegment(go.PathSegment.Bezier,(Tt+St)*nt,Ot*et,(Tt+Et)*nt,(Ot-St)*et,(Tt+St)*nt,(Ot-Et)*et)),$t.add(new go.PathSegment(go.PathSegment.Bezier,Tt*nt,(Ot+St)*et,(Tt+St)*nt,(Ot+Et)*et,(Tt+Et)*nt,(Ot+St)*et)),$t.add(new go.PathSegment(go.PathSegment.Bezier,(Tt-St)*nt,Ot*et,(Tt-Et)*nt,(Ot+St)*et,(Tt-St)*nt,(Ot+Et)*et).close()),ht}),go.Shape.defineFigureGenerator("ControlCenter",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,et,!0);return ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,0,.8*et)),st.add(new go.PathSegment(go.PathSegment.Line,.1*nt,.8*et)),st.add(new go.PathSegment(go.PathSegment.Line,.1*nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,.9*nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,.9*nt,.8*et)),st.add(new go.PathSegment(go.PathSegment.Line,nt,.8*et)),st.add(new go.PathSegment(go.PathSegment.Line,nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,0,et)),st.add(new go.PathSegment(go.PathSegment.Move,.1*nt,.8*et)),st.add(new go.PathSegment(go.PathSegment.Line,.9*nt,.8*et).close()),ht}),go.Shape.defineFigureGenerator("Bluetooth",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,.75*et,!1);return ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,0,.75*et)),st.add(new go.PathSegment(go.PathSegment.Line,nt,.25*et)),st.add(new go.PathSegment(go.PathSegment.Line,.5*nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,.5*nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,nt,.75*et)),st.add(new go.PathSegment(go.PathSegment.Line,0,.25*et)),ht}),go.Shape.defineFigureGenerator("Bookmark",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,0,!0);return ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,0,et)),st.add(new go.PathSegment(go.PathSegment.Line,.5*nt,.6*et)),st.add(new go.PathSegment(go.PathSegment.Line,nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,0,0)),st.add(new go.PathSegment(go.PathSegment.Move,.2*nt,.2*et)),st.add(new go.PathSegment(go.PathSegment.Line,.8*nt,.2*et)),st.add(new go.PathSegment(go.PathSegment.Move,.2*nt,.4*et)),st.add(new go.PathSegment(go.PathSegment.Line,.8*nt,.4*et)),ht}),go.Shape.defineFigureGenerator("Bookmark",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,0,!0);return ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,0,et)),st.add(new go.PathSegment(go.PathSegment.Line,.5*nt,.6*et)),st.add(new go.PathSegment(go.PathSegment.Line,nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,0,0)),st.add(new go.PathSegment(go.PathSegment.Move,.2*nt,.2*et)),st.add(new go.PathSegment(go.PathSegment.Line,.8*nt,.2*et)),st.add(new go.PathSegment(go.PathSegment.Move,.2*nt,.4*et)),st.add(new go.PathSegment(go.PathSegment.Line,.8*nt,.4*et)),ht}),go.Shape.defineFigureGenerator("Globe",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(.5*nt,0,!1);return ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,.5*nt,et)),st.add(new go.PathSegment(go.PathSegment.Move,0,.5*et)),st.add(new go.PathSegment(go.PathSegment.Line,nt,.5*et)),st.add(new go.PathSegment(go.PathSegment.Move,.5*nt,0)),st.add(new go.PathSegment(go.PathSegment.Bezier,nt,.5*et,.75*nt,0,nt,.25*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,.5*nt,et,nt,.75*et,.75*nt,et)),st.add(new go.PathSegment(go.PathSegment.Bezier,0,.5*et,.25*nt,et,0,.75*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,.5*nt,0,0,.25*et,.25*nt,0)),st.add(new go.PathSegment(go.PathSegment.Bezier,.5*nt,et,.15*nt,.25*et,.15*nt,.75*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,.5*nt,0,.85*nt,.75*et,.85*nt,.25*et)),st.add(new go.PathSegment(go.PathSegment.Move,.1675*nt,.15*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,.8325*nt,.15*et,.35*nt,.3*et,.65*nt,.3*et)),st.add(new go.PathSegment(go.PathSegment.Move,.1675*nt,.85*et)),st.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(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,.25*et,!1);return ht.add(st),st.add(new go.PathSegment(go.PathSegment.Bezier,.3*nt,.25*et,.1*nt,0,.2*nt,0)),st.add(new go.PathSegment(go.PathSegment.Bezier,.7*nt,.25*et,.425*nt,.5*et,.575*nt,.5*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,nt,.25*et,.8*nt,0,.9*nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,nt,.75*et)),st.add(new go.PathSegment(go.PathSegment.Move,0,.25*et)),st.add(new go.PathSegment(go.PathSegment.Line,0,.75*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,.3*nt,.75*et,.1*nt,.5*et,.2*nt,.5*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,.7*nt,.75*et,.425*nt,et,.575*nt,et)),st.add(new go.PathSegment(go.PathSegment.Bezier,nt,.75*et,.8*nt,.5*et,.9*nt,.5*et)),ht}),go.Shape.defineFigureGenerator("Operator",function(Bt,nt,et){var ht=new go.Geometry,st=.3,gt=qt*.3,vt=.5,St=.7,Et=new go.PathFigure((vt-st)*nt,St*et,!0);ht.add(Et),Et.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,(St-st)*et,(vt-st)*nt,(St-gt)*et,(vt-gt)*nt,(St-st)*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,(vt+st)*nt,St*et,(vt+gt)*nt,(St-st)*et,(vt+st)*nt,(St-gt)*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,(St+st)*et,(vt+st)*nt,(St+gt)*et,(vt+gt)*nt,(St+st)*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,(vt-st)*nt,St*et,(vt-gt)*nt,(St+st)*et,(vt-st)*nt,(St+gt)*et));var Tt=new go.PathFigure(0,.7*et,!1);return ht.add(Tt),Tt.add(new go.PathSegment(go.PathSegment.Bezier,nt,.7*et,0,0,nt,0)),ht}),go.Shape.defineFigureGenerator("TripleFanBlades",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(.5*nt,0,!0);return ht.add(st),st.add(new go.PathSegment(go.PathSegment.Bezier,.5*nt,.65*et,.65*nt,.3*et,.65*nt,.5*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,.5*nt,0,.35*nt,.5*et,.35*nt,.3*et)),st.add(new go.PathSegment(go.PathSegment.Move,.5*nt,.65*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,0,et,.3*nt,.6*et,.1*nt,.8*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,.5*nt,.65*et,.2*nt,et,.35*nt,.95*et)),st.add(new go.PathSegment(go.PathSegment.Move,.5*nt,.65*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,nt,et,.7*nt,.6*et,.9*nt,.8*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,.5*nt,.65*et,.8*nt,et,.65*nt,.95*et)),ht}),go.Shape.defineFigureGenerator("CentrifugalPump",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(nt,0,!0);return ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,.4*nt,0)),st.add(new go.PathSegment(go.PathSegment.Bezier,0,.5*et,0,.075*et,0,.5*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,.4*nt,et,0,et,.4*nt,et)),st.add(new go.PathSegment(go.PathSegment.Bezier,.8*nt,.4*et,.8*nt,et,.85*nt,.6*et)),st.add(new go.PathSegment(go.PathSegment.Line,nt,.4*et)),st.add(new go.PathSegment(go.PathSegment.Line,nt,0)),ht}),go.Shape.defineFigureGenerator("Battery",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,et,!0);ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,0,.1*et)),st.add(new go.PathSegment(go.PathSegment.Line,nt,.1*et)),st.add(new go.PathSegment(go.PathSegment.Line,nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,0,et)),st.add(new go.PathSegment(go.PathSegment.Move,.4*nt,.1*et)),st.add(new go.PathSegment(go.PathSegment.Line,.4*nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,.6*nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,.6*nt,.1*et));var gt=new go.PathFigure(0,.6*et,!1);return ht.add(gt),gt.add(new go.PathSegment(go.PathSegment.Move,0,.4*et)),gt.add(new go.PathSegment(go.PathSegment.Line,nt,.4*et)),ht}),go.Shape.defineFigureGenerator("Delete",function(Bt,nt,et){var ht=new go.Geometry,st=.5,gt=qt*.5,vt=.5,St=.5,Et=new go.PathFigure((vt-st)*nt,St*et,!0);ht.add(Et),Et.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,(St-st)*et,(vt-st)*nt,(St-gt)*et,(vt-gt)*nt,(St-st)*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,(vt+st)*nt,St*et,(vt+gt)*nt,(St-st)*et,(vt+st)*nt,(St-gt)*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,(St+st)*et,(vt+st)*nt,(St+gt)*et,(vt+gt)*nt,(St+st)*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,(vt-st)*nt,St*et,(vt-gt)*nt,(St+st)*et,(vt-st)*nt,(St+gt)*et));var Tt=new go.PathFigure(.15*nt,.5*et,!1);return ht.add(Tt),Tt.add(new go.PathSegment(go.PathSegment.Line,.85*nt,.5*et)),ht}),go.Shape.defineFigureGenerator("Flag",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,.1*et,!0);return ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,0,et)),st.add(new go.PathSegment(go.PathSegment.Move,0,.1*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,.5*nt,.1*et,.15*nt,0,.35*nt,0)),st.add(new go.PathSegment(go.PathSegment.Bezier,nt,.1*et,.65*nt,.2*et,.85*nt,.2*et)),st.add(new go.PathSegment(go.PathSegment.Line,nt,.5*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,.5*nt,.5*et,.85*nt,.6*et,.65*nt,.6*et)),st.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(Bt,nt,et){var ht=new go.Geometry,st=.5,gt=qt*.5,vt=.5,St=.5,Et=new go.PathFigure((vt-st)*nt,St*et,!1);ht.add(Et),Et.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,(St-st)*et,(vt-st)*nt,(St-gt)*et,(vt-gt)*nt,(St-st)*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,(vt+st)*nt,St*et,(vt+gt)*nt,(St-st)*et,(vt+st)*nt,(St-gt)*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,(St+st)*et,(vt+st)*nt,(St+gt)*et,(vt+gt)*nt,(St+st)*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,(vt-st)*nt,St*et,(vt-gt)*nt,(St+st)*et,(vt-st)*nt,(St+gt)*et).close()),st=.05,gt=qt*.05,vt=.5,St=.8;var Tt=new go.PathFigure((vt-st)*nt,St*et,!1);return ht.add(Tt),Tt.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,(St-st)*et,(vt-st)*nt,(St-gt)*et,(vt-gt)*nt,(St-st)*et)),Tt.add(new go.PathSegment(go.PathSegment.Bezier,(vt+st)*nt,St*et,(vt+gt)*nt,(St-st)*et,(vt+st)*nt,(St-gt)*et)),Tt.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,(St+st)*et,(vt+st)*nt,(St+gt)*et,(vt+gt)*nt,(St+st)*et)),Tt.add(new go.PathSegment(go.PathSegment.Bezier,(vt-st)*nt,St*et,(vt-gt)*nt,(St+st)*et,(vt-st)*nt,(St+gt)*et).close()),Tt.add(new go.PathSegment(go.PathSegment.Move,.5*nt,.7*et)),Tt.add(new go.PathSegment(go.PathSegment.Line,.5*nt,.5*et)),Tt.add(new go.PathSegment(go.PathSegment.Bezier,.5*nt,.2*et,.75*nt,.475*et,.75*nt,.225*et)),Tt.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(Bt,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(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,.5*et,!0);ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,0,et)),st.add(new go.PathSegment(go.PathSegment.Line,nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,nt,.5*et)),st.add(new go.PathSegment(go.PathSegment.Line,0,.5*et));var gt=new go.PathFigure(.2*nt,.5*et,!1);return ht.add(gt),gt.add(new go.PathSegment(go.PathSegment.Move,.2*nt,.5*et)),gt.add(new go.PathSegment(go.PathSegment.Line,.2*nt,.3*et)),gt.add(new go.PathSegment(go.PathSegment.Bezier,.8*nt,.3*et,.25*nt,0,.75*nt,0)),gt.add(new go.PathSegment(go.PathSegment.Line,.8*nt,.5*et)),gt.add(new go.PathSegment(go.PathSegment.Line,.8*nt,.3*et)),ht}),go.Shape.defineFigureGenerator("Unlocked",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,.5*et,!0);ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,0,et)),st.add(new go.PathSegment(go.PathSegment.Line,nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,nt,.5*et)),st.add(new go.PathSegment(go.PathSegment.Line,0,.5*et));var gt=new go.PathFigure(.2*nt,.5*et,!1);return ht.add(gt),gt.add(new go.PathSegment(go.PathSegment.Move,.2*nt,.5*et)),gt.add(new go.PathSegment(go.PathSegment.Line,.2*nt,.3*et)),gt.add(new go.PathSegment(go.PathSegment.Bezier,.8*nt,.3*et,.25*nt,0,.75*nt,0)),gt.add(new go.PathSegment(go.PathSegment.Line,.8*nt,.35*et)),ht}),go.Shape.defineFigureGenerator("Gear",function(Bt,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(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,.5*et,!0);return ht.add(st),st.add(new go.PathSegment(go.PathSegment.Bezier,.1*nt,.3*et,0,.375*et,.05*nt,.325*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,.45*nt,.075*et,.3*nt,.225*et,.4*nt,.175*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,.525*nt,.075*et,.46*nt,.05*et,.525*nt,.05*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,.3*nt,.4*et,.525*nt,.275*et,.475*nt,.325*et)),st.add(new go.PathSegment(go.PathSegment.Line,.9*nt,.4*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,.9*nt,.55*et,nt,.4*et,nt,.55*et)),st.add(new go.PathSegment(go.PathSegment.Line,.425*nt,.55*et)),st.add(new go.PathSegment(go.PathSegment.Line,.6*nt,.55*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,.6*nt,.7*et,.675*nt,.55*et,.675*nt,.7*et)),st.add(new go.PathSegment(go.PathSegment.Line,.4*nt,.7*et)),st.add(new go.PathSegment(go.PathSegment.Line,.575*nt,.7*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,.575*nt,.85*et,.65*nt,.7*et,.65*nt,.85*et)),st.add(new go.PathSegment(go.PathSegment.Line,.4*nt,.85*et)),st.add(new go.PathSegment(go.PathSegment.Line,.525*nt,.85*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,.535*nt,et,.61*nt,.85*et,.61*nt,et)),st.add(new go.PathSegment(go.PathSegment.Bezier,0,.9*et,.435*nt,et,0,et).close()),ht}),go.Shape.defineFigureGenerator("Map",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,.2*et,!0);return ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,.25*nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,.5*nt,.2*et)),st.add(new go.PathSegment(go.PathSegment.Line,.75*nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,nt,.2*et)),st.add(new go.PathSegment(go.PathSegment.Line,nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,.75*nt,.8*et)),st.add(new go.PathSegment(go.PathSegment.Line,.5*nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,.25*nt,.8*et)),st.add(new go.PathSegment(go.PathSegment.Line,0,et).close()),st.add(new go.PathSegment(go.PathSegment.Move,.25*nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,.25*nt,.8*et)),st.add(new go.PathSegment(go.PathSegment.Move,.5*nt,.2*et)),st.add(new go.PathSegment(go.PathSegment.Line,.5*nt,et)),st.add(new go.PathSegment(go.PathSegment.Move,.75*nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,.75*nt,.8*et)),ht}),go.Shape.defineFigureGenerator("Eject",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,et,!0);ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,nt,et*.7)),st.add(new go.PathSegment(go.PathSegment.Line,0,et*.7).close());var gt=new go.PathFigure(0,et*.6,!0);return ht.add(gt),gt.add(new go.PathSegment(go.PathSegment.Line,nt,.6*et)),gt.add(new go.PathSegment(go.PathSegment.Line,.5*nt,0).close()),ht}),go.Shape.defineFigureGenerator("Pencil",function(Bt,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(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(nt*1,et*1,!1);ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,0,et*1)),st.add(new go.PathSegment(go.PathSegment.Line,0,et*.85)),st.add(new go.PathSegment(go.PathSegment.Line,.046*nt,et*.85)),st.add(new go.PathSegment(go.PathSegment.Line,.046*nt,et*.45)),st.add(new go.PathSegment(go.PathSegment.Line,0,et*.45)),st.add(new go.PathSegment(go.PathSegment.Line,0,et*.3)),st.add(new go.PathSegment(go.PathSegment.Line,.046*nt,et*.3)),st.add(new go.PathSegment(go.PathSegment.Line,.5*nt,et*0)),st.add(new go.PathSegment(go.PathSegment.Line,(1-.046)*nt,et*.3)),st.add(new go.PathSegment(go.PathSegment.Line,nt,et*.3)),st.add(new go.PathSegment(go.PathSegment.Line,nt,et*.45)),st.add(new go.PathSegment(go.PathSegment.Line,(1-.046)*nt,et*.45)),st.add(new go.PathSegment(go.PathSegment.Line,(1-.046)*nt,et*.85)),st.add(new go.PathSegment(go.PathSegment.Line,nt,et*.85).close());var gt=new go.PathFigure(.126*nt,.85*et,!1);ht.add(gt),gt.add(new go.PathSegment(go.PathSegment.Line,.126*nt,.45*et)),gt.add(new go.PathSegment(go.PathSegment.Line,.322*nt,.45*et)),gt.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 St=new go.PathFigure(.678*nt,.85*et,!1);ht.add(St),St.add(new go.PathSegment(go.PathSegment.Line,.678*nt,.45*et)),St.add(new go.PathSegment(go.PathSegment.Line,.874*nt,.45*et)),St.add(new go.PathSegment(go.PathSegment.Line,.874*nt,.85*et).close());var Et=new go.PathFigure(.5*nt,.1*et,!1);return ht.add(Et),Et.add(new go.PathSegment(go.PathSegment.Line,(.046+.15)*nt,.3*et)),Et.add(new go.PathSegment(go.PathSegment.Line,(1-(.046+.15))*nt,.3*et).close()),ht}),go.Shape.defineFigureGenerator("Staircase",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,et*1,!0);return ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,nt*.2,et*1)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.2,et*.8)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.4,et*.8)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.4,et*.6)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.6,et*.6)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.6,et*.4)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.8,et*.4)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.8,et*.2)),st.add(new go.PathSegment(go.PathSegment.Line,nt*1,et*.2)),st.add(new go.PathSegment(go.PathSegment.Line,nt*1,et*.15)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.75,et*.15)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.75,et*.35)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.55,et*.35)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.55,et*.55)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.35,et*.55)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.35,et*.75)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.15,et*.75)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.15,et*.95)),st.add(new go.PathSegment(go.PathSegment.Line,0,et*.95).close()),ht}),go.Shape.defineFigureGenerator("5Bars",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,et*1,!0);ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,nt*.184,et*1)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.184,et*(1-.184)).close());var gt=new go.PathFigure(nt*.204,et,!0);ht.add(gt),gt.add(new go.PathSegment(go.PathSegment.Line,nt*.204,et*(1-.184))),gt.add(new go.PathSegment(go.PathSegment.Line,nt*.388,et*(1-.184*2))),gt.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 St=new go.PathFigure(nt*.612,et,!0);ht.add(St),St.add(new go.PathSegment(go.PathSegment.Line,nt*.612,et*(1-.184*3))),St.add(new go.PathSegment(go.PathSegment.Line,nt*.796,et*(1-.184*4))),St.add(new go.PathSegment(go.PathSegment.Line,nt*.796,et*1).close());var Et=new go.PathFigure(nt*.816,et,!0);return ht.add(Et),Et.add(new go.PathSegment(go.PathSegment.Line,nt*.816,et*(1-.184*4))),Et.add(new go.PathSegment(go.PathSegment.Line,nt*1,et*(1-.184*5))),Et.add(new go.PathSegment(go.PathSegment.Line,nt*1,et*1).close()),ht}),go.Shape.defineFigureGenerator("PC",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,0,!0);ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,0,et*1)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.3,et*1)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.3,0).close());var gt=new go.PathFigure(nt*.055,.07*et,!0);ht.add(gt),gt.add(new go.PathSegment(go.PathSegment.Line,nt*.245,et*.07)),gt.add(new go.PathSegment(go.PathSegment.Line,nt*.245,et*.1)),gt.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 St=new go.PathFigure(nt*.055,.18*et,!0);ht.add(St),St.add(new go.PathSegment(go.PathSegment.Line,nt*.245,et*.18)),St.add(new go.PathSegment(go.PathSegment.Line,nt*.245,et*.21)),St.add(new go.PathSegment(go.PathSegment.Line,nt*.055,et*.21).close());var Et=new go.PathFigure(nt*1,0,!0);return ht.add(Et),Et.add(new go.PathSegment(go.PathSegment.Line,nt*.4,0)),Et.add(new go.PathSegment(go.PathSegment.Line,nt*.4,et*.65)),Et.add(new go.PathSegment(go.PathSegment.Line,nt*1,et*.65).close()),ht}),go.Shape.defineFigureGenerator("Plane",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(.55*nt,et,!0);return ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,.5*nt,.6*et)),st.add(new go.PathSegment(go.PathSegment.Line,.4*nt,.7*et)),st.add(new go.PathSegment(go.PathSegment.Line,.1*nt,.475*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,.35*nt,.525*et,0,.4*et,.225*nt,.45*et)),st.add(new go.PathSegment(go.PathSegment.Line,.4*nt,.475*et)),st.add(new go.PathSegment(go.PathSegment.Line,.15*nt,.35*et)),st.add(new go.PathSegment(go.PathSegment.Line,.2*nt,.325*et)),st.add(new go.PathSegment(go.PathSegment.Line,.6*nt,.325*et)),st.add(new go.PathSegment(go.PathSegment.Line,.85*nt,.1*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,.9*nt,.2*et,.975*nt,0,nt,.08*et)),st.add(new go.PathSegment(go.PathSegment.Line,.7*nt,.45*et)),st.add(new go.PathSegment(go.PathSegment.Line,.6*nt,.95*et)),st.add(new go.PathSegment(go.PathSegment.Line,.55*nt,et).close()),ht}),go.Shape.defineFigureGenerator("Key",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(nt*1,et*.5,!0);return ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,nt*.9,.4*et)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.5,.4*et)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.5,.35*et)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.45,.35*et)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.3,.2*et)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.15,.2*et)),st.add(new go.PathSegment(go.PathSegment.Line,0,.35*et)),st.add(new go.PathSegment(go.PathSegment.Line,0,.65*et)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.15,.8*et)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.3,.8*et)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.45,.65*et)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.5,.65*et)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.5,.6*et)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.6,.6*et)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.65,.55*et)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.7,.6*et)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.75,.55*et)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.8,.6*et)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.85,.575*et)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.9,.6*et).close()),st.add(new go.PathSegment(go.PathSegment.Move,.17*nt,.425*et)),st.add(new go.PathSegment(go.PathSegment.Arc,270,360,.17*nt,.5*et,.075*nt,.075*et).close()),ht}),go.Shape.defineFigureGenerator("FilmTape",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,0,!1);ht.add(st),st.add(new go.PathSegment(go.PathSegment.Arc,270,180,nt*0,nt*.3,nt*.055)),st.add(new go.PathSegment(go.PathSegment.Line,0,et*1)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.08,et*1)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.08,et*.95)),st.add(new go.PathSegment(go.PathSegment.Line,nt*(.08+.056*1),et*.95)),st.add(new go.PathSegment(go.PathSegment.Line,nt*(.08+.056*1),et*1)),st.add(new go.PathSegment(go.PathSegment.Line,nt*(.08+.056*2),et*1)),st.add(new go.PathSegment(go.PathSegment.Line,nt*(.08+.056*2),et*.95)),st.add(new go.PathSegment(go.PathSegment.Line,nt*(.08+.056*3),et*.95)),st.add(new go.PathSegment(go.PathSegment.Line,nt*(.08+.056*3),et*1)),st.add(new go.PathSegment(go.PathSegment.Line,nt*(.08+.056*4),et*1)),st.add(new go.PathSegment(go.PathSegment.Line,nt*(.08+.056*4),et*.95)),st.add(new go.PathSegment(go.PathSegment.Line,nt*(.08+.056*5),et*.95)),st.add(new go.PathSegment(go.PathSegment.Line,nt*(.08+.056*5),et*1)),st.add(new go.PathSegment(go.PathSegment.Line,nt*(.08+.056*6),et*1)),st.add(new go.PathSegment(go.PathSegment.Line,nt*(.08+.056*6),et*.95)),st.add(new go.PathSegment(go.PathSegment.Line,nt*(.08+.056*7),et*.95)),st.add(new go.PathSegment(go.PathSegment.Line,nt*(.08+.056*7),et*1)),st.add(new go.PathSegment(go.PathSegment.Line,nt*(.08+.056*8),et*1)),st.add(new go.PathSegment(go.PathSegment.Line,nt*(.08+.056*8),et*.95)),st.add(new go.PathSegment(go.PathSegment.Line,nt*(.08+.056*9),et*.95)),st.add(new go.PathSegment(go.PathSegment.Line,nt*(.08+.056*9),et*1)),st.add(new go.PathSegment(go.PathSegment.Line,nt*(.08+.056*10),et*1)),st.add(new go.PathSegment(go.PathSegment.Line,nt*(.08+.056*10),et*.95)),st.add(new go.PathSegment(go.PathSegment.Line,nt*(.08+.056*11),et*.95)),st.add(new go.PathSegment(go.PathSegment.Line,nt*(.08+.056*11),et*1)),st.add(new go.PathSegment(go.PathSegment.Line,nt*(.08+.056*12),et*1)),st.add(new go.PathSegment(go.PathSegment.Line,nt*(.08+.056*12),et*.95)),st.add(new go.PathSegment(go.PathSegment.Line,nt*(.08+.056*13),et*.95)),st.add(new go.PathSegment(go.PathSegment.Line,nt*(.08+.056*13),et*1)),st.add(new go.PathSegment(go.PathSegment.Line,nt*(.08+.056*14),et*1)),st.add(new go.PathSegment(go.PathSegment.Line,nt*(.08+.056*14),et*.95)),st.add(new go.PathSegment(go.PathSegment.Line,nt*(.08+.056*15),et*.95)),st.add(new go.PathSegment(go.PathSegment.Line,nt*(.08+.056*15),et*1)),st.add(new go.PathSegment(go.PathSegment.Line,nt*1,et*1)),st.add(new go.PathSegment(go.PathSegment.Line,nt*1,et*1));var gt=new go.PathFigure(0,0,!1);ht.add(gt),gt.add(new go.PathSegment(go.PathSegment.Line,nt*1,et*0)),gt.add(new go.PathSegment(go.PathSegment.Arc,270,-180,nt*1,nt*.3,nt*.055)),gt.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 St=new go.PathFigure(nt*(.11+.24133333*1+.028*1),et*.1,!1);ht.add(St),St.add(new go.PathSegment(go.PathSegment.Line,nt*(.11+.24133333*2+.028*1),et*.1)),St.add(new go.PathSegment(go.PathSegment.Line,nt*(.11+.24133333*2+.028*1),et*.8)),St.add(new go.PathSegment(go.PathSegment.Line,nt*(.11+.24133333*1+.028*1),et*.8).close());var Et=new go.PathFigure(nt*(.11+.24133333*2+.028*2),et*.1,!1);return ht.add(Et),Et.add(new go.PathSegment(go.PathSegment.Line,nt*(.11+.24133333*3+.028*2),et*.1)),Et.add(new go.PathSegment(go.PathSegment.Line,nt*(.11+.24133333*3+.028*2),et*.8)),Et.add(new go.PathSegment(go.PathSegment.Line,nt*(.11+.24133333*2+.028*2),et*.8).close()),ht}),go.Shape.defineFigureGenerator("FloppyDisk",function(Bt,nt,et){var ht=new go.Geometry,st=8,gt=st*qt,vt=new go.PathFigure(st,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-st)),vt.add(new go.PathSegment(go.PathSegment.Bezier,nt-st,et,nt,et-gt,nt-gt,et)),vt.add(new go.PathSegment(go.PathSegment.Line,st,et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,0,et-st,gt,et,0,et-gt)),vt.add(new go.PathSegment(go.PathSegment.Line,0,st)),vt.add(new go.PathSegment(go.PathSegment.Bezier,st,0,0,gt,gt,0).close());var St=new go.PathFigure(nt*.83,0,!1);ht.add(St),St.add(new go.PathSegment(go.PathSegment.Line,nt*.83,et*.3)),St.add(new go.PathSegment(go.PathSegment.Line,nt*.17,et*.3)),St.add(new go.PathSegment(go.PathSegment.Line,nt*.17,et*0).close());var Et=new go.PathFigure(nt*.83,et*1,!1);ht.add(Et),Et.add(new go.PathSegment(go.PathSegment.Line,nt*.83,et*.5)),Et.add(new go.PathSegment(go.PathSegment.Line,nt*.17,et*.5)),Et.add(new go.PathSegment(go.PathSegment.Line,nt*.17,et*1).close());var Tt=new go.PathFigure(nt*.78,et*.05,!1);return ht.add(Tt),Tt.add(new go.PathSegment(go.PathSegment.Line,nt*.66,et*.05)),Tt.add(new go.PathSegment(go.PathSegment.Line,nt*.66,et*.25)),Tt.add(new go.PathSegment(go.PathSegment.Line,nt*.78,et*.25).close()),ht}),go.Shape.defineFigureGenerator("SpeechBubble",function(Bt,nt,et){var ht=Bt?Bt.parameter1:NaN;(isNaN(ht)||ht<0)&&(ht=15),ht=Math.min(ht,nt/3),ht=Math.min(ht,et/3);var st=ht*qt,gt=et*.8,vt=new go.Geometry,St=new go.PathFigure(ht,0,!0);return vt.add(St),St.add(new go.PathSegment(go.PathSegment.Line,nt-ht,0)),St.add(new go.PathSegment(go.PathSegment.Bezier,nt,ht,nt-st,0,nt,st)),St.add(new go.PathSegment(go.PathSegment.Line,nt,gt-ht)),St.add(new go.PathSegment(go.PathSegment.Bezier,nt-ht,gt,nt,gt-st,nt-st,gt)),St.add(new go.PathSegment(go.PathSegment.Line,nt*.7,gt)),St.add(new go.PathSegment(go.PathSegment.Line,nt*.7,et)),St.add(new go.PathSegment(go.PathSegment.Line,nt*.55,gt)),St.add(new go.PathSegment(go.PathSegment.Line,ht,gt)),St.add(new go.PathSegment(go.PathSegment.Bezier,0,gt-ht,st,gt,0,gt-st)),St.add(new go.PathSegment(go.PathSegment.Line,0,ht)),St.add(new go.PathSegment(go.PathSegment.Bezier,ht,0,0,st,st,0).close()),st>1?(vt.spot1=new go.Spot(0,0,st,st),vt.spot2=new go.Spot(1,.8,-st,-st)):(vt.spot1=go.Spot.TopLeft,vt.spot2=new go.Spot(1,.8)),vt}),go.Shape.defineFigureGenerator("Repeat",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(nt*0,et*.45,!0);ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,nt*.25,et*0)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.5,et*.45)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.3,et*.45)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.3,et*.9)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.6,et*.9)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.65,et*1)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.2,et*1)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.2,et*.45).close());var gt=new go.PathFigure(nt*1,et*.55,!0);return ht.add(gt),gt.add(new go.PathSegment(go.PathSegment.Line,nt*.75,et*1)),gt.add(new go.PathSegment(go.PathSegment.Line,nt*.5,et*.55)),gt.add(new go.PathSegment(go.PathSegment.Line,nt*.7,et*.55)),gt.add(new go.PathSegment(go.PathSegment.Line,nt*.7,et*.1)),gt.add(new go.PathSegment(go.PathSegment.Line,nt*.4,et*.1)),gt.add(new go.PathSegment(go.PathSegment.Line,nt*.35,et*0)),gt.add(new go.PathSegment(go.PathSegment.Line,nt*.8,et*0)),gt.add(new go.PathSegment(go.PathSegment.Line,nt*.8,et*.55).close()),ht}),go.Shape.defineFigureGenerator("Windows",function(Bt,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(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(nt*0,et*.1,!1);ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,nt*1,et*.1)),st.add(new go.PathSegment(go.PathSegment.Line,nt*1,et*.9)),st.add(new go.PathSegment(go.PathSegment.Line,nt*0,et*.9).close());var gt=new go.PathFigure(nt*.1,et*.2,!0);ht.add(gt),gt.add(new go.PathSegment(go.PathSegment.Line,nt*.1,et*.25)),gt.add(new go.PathSegment(go.PathSegment.Line,nt*.22,et*.285)),gt.add(new go.PathSegment(go.PathSegment.Line,nt*.1,et*.32)),gt.add(new go.PathSegment(go.PathSegment.Line,nt*.1,et*.37)),gt.add(new go.PathSegment(go.PathSegment.Line,nt*.275,et*.32)),gt.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(Bt,nt,et){var ht=new go.Geometry,st=15,gt=st*qt,vt=new go.PathFigure(nt*.62,et*.475,!0);return ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,nt,et-st)),vt.add(new go.PathSegment(go.PathSegment.Bezier,nt-st,et,nt,et-gt,nt-gt,et)),vt.add(new go.PathSegment(go.PathSegment.Line,st,et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,0,et-st,gt,et,0,et-gt)),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()),gt>1?(ht.spot1=new go.Spot(0,0,gt,gt),ht.spot2=new go.Spot(1,1,-gt,-gt)):(ht.spot1=go.Spot.TopLeft,ht.spot2=go.Spot.BottomRight),ht}),go.Shape.defineFigureGenerator("Download",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(nt*0,et*1,!0);ht.add(st);var gt=.1/.3;st.add(new go.PathSegment(go.PathSegment.Line,nt*1,et*1)),st.add(new go.PathSegment(go.PathSegment.Line,nt*1,et*(1-gt))),st.add(new go.PathSegment(go.PathSegment.Line,nt*.8,et*0)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.66,et*0)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.66,et*.055)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.755,et*.055)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.93,et*(1-gt))),st.add(new go.PathSegment(go.PathSegment.Line,nt*.64,et*(1-gt))),st.add(new go.PathSegment(go.PathSegment.Line,nt*.61,et*.75)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.5,et*.75)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.39,et*.75)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.36,et*(1-gt))),st.add(new go.PathSegment(go.PathSegment.Line,nt*.07,et*(1-gt))),st.add(new go.PathSegment(go.PathSegment.Line,nt*(1-.755),et*.055)),st.add(new go.PathSegment(go.PathSegment.Line,nt*(1-.66),et*.055)),st.add(new go.PathSegment(go.PathSegment.Line,nt*(1-.66),et*0)),st.add(new go.PathSegment(go.PathSegment.Line,nt*(1-.8),et*0)),st.add(new go.PathSegment(go.PathSegment.Line,nt*0,et*(1-gt)).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(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(nt*0,et*1,!0);ht.add(st);var gt=.1/.3;return st.add(new go.PathSegment(go.PathSegment.Line,nt*1,et*1)),st.add(new go.PathSegment(go.PathSegment.Line,nt*1,et*(1-gt))),st.add(new go.PathSegment(go.PathSegment.Line,nt*.8,et*0)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.66,et*0)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.66,et*.055)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.755,et*.055)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.93,et*(1-gt))),st.add(new go.PathSegment(go.PathSegment.Line,nt*.64,et*(1-gt))),st.add(new go.PathSegment(go.PathSegment.Line,nt*.61,et*.75)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.5,et*.75)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.39,et*.75)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.36,et*(1-gt))),st.add(new go.PathSegment(go.PathSegment.Line,nt*.07,et*(1-gt))),st.add(new go.PathSegment(go.PathSegment.Line,nt*(1-.755),et*.055)),st.add(new go.PathSegment(go.PathSegment.Line,nt*(1-.66),et*.055)),st.add(new go.PathSegment(go.PathSegment.Line,nt*(1-.66),et*0)),st.add(new go.PathSegment(go.PathSegment.Line,nt*(1-.8),et*0)),st.add(new go.PathSegment(go.PathSegment.Line,nt*0,et*(1-gt)).close()),ht}),go.Shape.defineFigureGenerator("Upload",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(nt*0,et*1,!0);ht.add(st);var gt=.1/.3;st.add(new go.PathSegment(go.PathSegment.Line,nt*1,et*1)),st.add(new go.PathSegment(go.PathSegment.Line,nt*1,et*(1-gt))),st.add(new go.PathSegment(go.PathSegment.Line,nt*.8,et*0)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.66,et*0)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.66,et*.055)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.755,et*.055)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.93,et*(1-gt))),st.add(new go.PathSegment(go.PathSegment.Line,nt*.64,et*(1-gt))),st.add(new go.PathSegment(go.PathSegment.Line,nt*.61,et*.75)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.5,et*.75)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.39,et*.75)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.36,et*(1-gt))),st.add(new go.PathSegment(go.PathSegment.Line,nt*.07,et*(1-gt))),st.add(new go.PathSegment(go.PathSegment.Line,nt*(1-.755),et*.055)),st.add(new go.PathSegment(go.PathSegment.Line,nt*(1-.66),et*.055)),st.add(new go.PathSegment(go.PathSegment.Line,nt*(1-.66),et*0)),st.add(new go.PathSegment(go.PathSegment.Line,nt*(1-.8),et*0)),st.add(new go.PathSegment(go.PathSegment.Line,nt*0,et*(1-gt)).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(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(nt*.15,et*0,!1);return ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,nt*.85,et*0)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.7,et*1)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.3,et*1).close()),ht}),go.Shape.defineFigureGenerator("Drink",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(nt*.15,et*0,!1);ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,nt*.85,et*0)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.7,et*1)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.3,et*1).close());var gt=new go.PathFigure(nt*.235,et*.28,!0);return ht.add(gt),gt.add(new go.PathSegment(go.PathSegment.Line,nt*.765,et*.28)),gt.add(new go.PathSegment(go.PathSegment.Line,nt*.655,et*.97)),gt.add(new go.PathSegment(go.PathSegment.Line,nt*.345,et*.97).close()),ht}),go.Shape.defineFigureGenerator("4Arrows",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(nt*.5,et*0,!0);return ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,nt*.65,et*.25)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.55,et*.25)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.55,et*.45)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.75,et*.45)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.75,et*.35)),st.add(new go.PathSegment(go.PathSegment.Line,nt*1,et*.5)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.75,et*.65)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.75,et*.55)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.55,et*.55)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.55,et*.75)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.65,et*.75)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.5,et*1)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.35,et*.75)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.45,et*.75)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.45,et*.55)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.25,et*.55)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.25,et*.65)),st.add(new go.PathSegment(go.PathSegment.Line,nt*0,et*.5)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.25,et*.35)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.25,et*.45)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.45,et*.45)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.45,et*.25)),st.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")},43001: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 Bn={},zn="5.0",kt={},pt=null,Ut=!1,ue=!1,Le=null,he=!1,Dt=null,qt=null,me=0;me<arguments.length;me++){var ne=arguments[me];if(ne!==null)switch(typeof ne){case"number":zn=ne.toFixed(1);break;case"string":ne.match(new RegExp("^[0-9]\\.[0-9]+$"))?zn=ne:Le=ne;break;case"object":typeof ne.is3D!="undefined"?pt=ne:kt=ne;break;case"boolean":Ut=ne,ue=!0;break}}pt===null&&(pt={is3D:!1,AV:!1,SV:!1,CV:!1,EV2:!1,CP:!1,PC:!1,DA:!1,FI:!1,PV:!1,macro:!1},kt.material_id!==void 0&&!ue&&(Ut=!0)),Le!==null&&kt.id===void 0&&(kt.id=Le);var jt="",Te="",se=!1,Ce=null,Bt=null,nt=null,et=!1,ht=null,st=null,gt=null,vt=null,St=null;kt.height!==void 0&&(kt.height=Math.round(kt.height)),kt.width!==void 0&&(kt.width=Math.round(kt.width));var Et=function(Oe){return parseFloat(Oe)>4?parseFloat(Oe):5};Bn.setHTML5Codebase=function(Oe,sn){qt=Oe,Ye(Oe,sn)},Bn.setJavaCodebase=Bn.setJavaCodebaseVersion=Bn.isCompiledInstalled=Bn.setPreCompiledScriptPath=Bn.setPreCompiledResourcePath=function(){},Bn.setHTML5CodebaseVersion=function(Oe,sn){var ln=parseFloat(Oe);if(ln!==NaN&&ln<5){console.log("The GeoGebra HTML5 codebase version "+ln+" is deprecated. Using version latest instead.");return}Dt=Oe,Jt(Oe,sn)},Bn.getHTML5CodebaseVersion=function(){return Bt},Bn.getParameters=function(){return kt},Bn.setFontsCSSURL=function(Oe){vt=Oe},Bn.setGiacJSURL=function(Oe){},Bn.setJNLPFile=function(Oe){jt=Oe},Bn.setJNLPBaseDir=function(Oe){},Bn.inject=function(){function Oe(){return window.frameElement&&window.frameElement.getAttribute("data-singleton")}for(var sn="auto",ln=kt.id,Vn,Ae=!1,yn=0;yn<arguments.length;yn++){var te=arguments[yn];typeof te=="string"?(te=te.toLowerCase(),te.match(/^(prefer)?(java|html5|compiled|auto|screenshot)$/)?sn=te:ln=arguments[yn]):typeof te=="boolean"?Ae=te:te instanceof HTMLElement&&(Vn=te)}En();function En(){if(!he){setTimeout(En,200);return}sn=Ke(sn);var ri=Vn||document.getElementById(ln);if(!ri){console.log("possibly bug on ajax loading? ");return}if(Bn.removeExistingApplet(ri,!1),kt.width===void 0&&ri.clientWidth&&(kt.width=ri.clientWidth),kt.height===void 0&&ri.clientHeight&&(kt.height=ri.clientHeight),!(kt.width&&kt.height)&&sn==="html5"&&(delete kt.width,delete kt.height),Ce=sn,sn==="screenshot")xe(ri,kt);else{var Rt=!1;kt.hasOwnProperty("playButton")&&kt.playButton||kt.hasOwnProperty("clickToLoad")&&kt.clickToLoad?Rt=!0:kt.hasOwnProperty("playButtonAutoDecide")&&kt.playButtonAutoDecide&&(Rt=(!Tt()||Oe())&&Ot()),Rt?(Ce="screenshot",Qe(ri,kt,Ae,sn)):Ne(ri,kt,Ae)}}};function Tt(){try{return window.self!==window.top}catch(Oe){return!0}}function Ot(){return kt.hasOwnProperty("screenshotGenerator")&&kt.screenshotGenerator?!1:Math.max(screen.width,screen.height)<800}Bn.getViews=function(){return pt},Bn.isJavaInstalled=function(){return!1};var $t=function(Oe){var sn=function(yn){var te=JSON.parse(yn),En=function(Lt){return Lt.type=="G"||Lt.type=="E"},ri=te.elements?te.elements.filter(En)[0]:te;if(!ri||!ri.url){ln();return}kt.fileName=ri.url,Xt(ri.settings||{}),pt.is3D=!0;var Rt="https://www.geogebra.org/images/";Bn.setPreviewImage(ht||ri.previewUrl,Rt+"GeoGebra_loading.png",Rt+"applet_play.png"),Oe()},ln=function(){kt.onError&&kt.onError(),Gn("Error: Fetching material (id "+kt.material_id+") failed.",kt)},Vn=location.host.match(/(www|stage|beta|groot|alpha).geogebra.(org|net)/)?location.host:"www.geogebra.org",Ae="/materials/"+kt.material_id+"?scope=basic";Ht("https://"+Vn+"/api/proxy.php?path="+encodeURIComponent(Ae),sn,ln)};function Xt(Oe){var sn=["width","height","showToolBar","showMenuBar","showAlgebraInput","allowStyleBar","showResetIcon","enableLabelDrags","enableShiftDragZoom","enableRightClick","appName"];["enableLabelDrags","enableShiftDragZoom","enableRightClick"].forEach(function(ln){Oe[ln]=!!Oe[ln]}),sn.forEach(function(ln){kt[ln]===void 0&&Oe[ln]!==void 0&&(kt[ln]=Oe[ln])}),kt.showToolBarHelp===void 0&&(kt.showToolBarHelp=kt.showToolBar)}function Ht(Oe,sn,ln){var Vn=new XMLHttpRequest;Vn.open("GET",Oe),Vn.onload=function(){sn(Vn.responseText)},Vn.onerror=ln,Vn.send()}Bn.isHTML5Installed=function(){return!0},Bn.getLoadedAppletType=function(){return Ce},Bn.setPreviewImage=function(Oe,sn,ln){ht=Oe,st=sn,gt=ln},Bn.removeExistingApplet=function(Oe,sn){var ln;typeof Oe=="string"&&(Oe=document.getElementById(Oe)),Ce=null;var Vn=null;for(ln=0;ln<Oe.childNodes.length;ln++){var Ae=Oe.childNodes[ln],yn=Ae.className;yn==="applet_screenshot"?sn?(Ae.style.display="block",Ce="screenshot"):Ae.style.display="none":yn!=="applet_scaler prerender"&&(Oe.removeChild(Ae),Vn=yn&&yn.indexOf("appletParameters")!=-1?Ae.id:null,ln--)}var te=kt.id!==void 0?kt.id:Vn,En=window[te];En&&typeof En.getBase64=="function"&&(En.remove(),window[te]=null)},Bn.refreshHitPoints=function(){if(Et(ggbHTML5LoadedCodebaseVersion)>=5)return!0;var Oe=Bn.getAppletObject();return Oe&&typeof Oe.recalculateEnvironments=="function"?(Oe.recalculateEnvironments(),!0):!1},Bn.startAnimation=function(){var Oe=Bn.getAppletObject();return Oe&&typeof Oe.startAnimation=="function"?(Oe.startAnimation(),!0):!1},Bn.stopAnimation=function(){var Oe=Bn.getAppletObject();return Oe&&typeof Oe.stopAnimation=="function"?(Oe.stopAnimation(),!0):!1},Bn.getAppletObject=function(){var Oe=kt.id!==void 0?kt.id:"ggbApplet";return window[Oe]},Bn.resize=function(){};var ve=function(Oe,sn,ln){var Vn=document.createElement("param");Vn.setAttribute("name",sn),Vn.setAttribute("value",ln),Oe.appendChild(Vn)},ie=function(Oe){return Oe&&Oe!=="false"},Ne=function(Oe,sn,ln){Et(Bt)<=4.2&&(ln=!0);var Vn=!isRenderGGBElementEnabled&&!scriptLoadStarted;(!isRenderGGBElementEnabled&&!scriptLoadStarted||ggbHTML5LoadedCodebaseVersion!==Bt||ggbHTML5LoadedCodebaseIsWebSimple&&!et)&&(Vn=!0,isRenderGGBElementEnabled=!1,scriptLoadStarted=!1);var Ae=document.createElement("div");Ae.classList.add("appletParameters","notranslate");var yn=sn.width,te=sn.height;if(sn.disableAutoScale=sn.disableAutoScale===void 0?GGBAppletUtils.isFlexibleWorksheetEditor():sn.disableAutoScale,sn.width!==void 0)if(Et(Bt)<=4.4)ie(sn.showToolBar)&&(sn.height-=7),ie(sn.showAlgebraInput)&&(sn.height-=37),sn.width<605&&ie(sn.showToolBar)&&(sn.width=605,yn=605);else{var En=100;(ie(sn.showToolBar)||ie(sn.showMenuBar))&&(sn.hasOwnProperty("customToolBar")&&(sn.customToolbar=sn.customToolBar),En=ie(sn.showMenuBar)?245:155),yn<En&&(sn.width=En,yn=En)}Ae.style.border="none",Ae.style.display="inline-block";for(var ri in sn)sn.hasOwnProperty(ri)&&ri!=="appletOnLoad"&&Ae.setAttribute("data-param-"+ri,sn[ri]);vt&&Ae.setAttribute("data-param-fontscssurl",vt),Bn.resize=function(){GGBAppletUtils.responsiveResize(Oe,sn)},window.addEventListener("resize",function(Fe){Bn.resize()});var Rt=typeof sn.appletOnLoad=="function"?sn.appletOnLoad:function(){};if(!ln&&sn.width!==void 0){sn.hasOwnProperty("showSplash")||Ae.setAttribute("data-param-showSplash","false");var Lt=Oe.querySelector(".applet_scaler.prerender"),Pt=Lt!==null;if(Pt)var Nt=Lt.querySelector(".ggb_preview");else{var Nt=an(yn,te,sn.borderColor,!1);Lt=document.createElement("div"),Lt.className="applet_scaler",Lt.style.position="relative",Lt.style.display="block",Lt.style.width=yn+"px",Lt.style.height=te+"px"}window.GGBT_spinner&&window.GGBT_spinner.attachSpinner(Lt,"66%"),Et(Bt)>=5?(sn.appletOnLoad=function(Fe){var He=Oe.querySelector(".ggb_preview");He&&He.parentNode.removeChild(He),window.GGBT_spinner&&window.GGBT_spinner.removeSpinner(Lt),window.GGBT_wsf_view&&$(window).trigger("resize"),Rt(Fe)},Pt||Lt.appendChild(Nt)):Ae.appendChild(Nt),Lt.appendChild(Ae),Pt||Oe.appendChild(Lt),setTimeout(function(){Bn.resize()},1)}else{var Zt=document.createElement("div");Zt.className="applet_scaler",Zt.style.position="relative",Zt.style.display="block",Zt.appendChild(Ae),Oe.appendChild(Zt),sn.appletOnLoad=function(Fe){Bn.resize(),Rt(Fe)}}function Mt(Fe,He){He&&typeof He.appletOnLoad=="function"&&typeof renderGGBElement=="function"?renderGGBElement(Fe,He.appletOnLoad):renderGGBElement(Fe),Gn("GeoGebra HTML5 applet injected and rendered with previously loaded codebase.",He)}function Yt(Fe,He){typeof renderGGBElement=="undefined"?(html5AppletsToProcess===null&&(html5AppletsToProcess=[]),html5AppletsToProcess.push({article:Fe,params:He}),window.renderGGBElementReady=function(){isRenderGGBElementEnabled=!0,html5AppletsToProcess!==null&&html5AppletsToProcess.length&&(html5AppletsToProcess.forEach(function(qe){Mt(qe.article,qe.params)}),html5AppletsToProcess=null)},Et(Bt)<5&&(Fe.className+=" geogebraweb")):Mt(Fe,He)}if(Vn){scriptLoadStarted=!0;for(var Ge=0;Ge<Ae.childNodes.length;Ge++){var De=Ae.childNodes[Ge].tagName;De==="TABLE"&&(Ae.removeChild(Ae.childNodes[Ge]),Ge--)}if(ggbHTML5LoadedScript!==null){var Ue=document.querySelector('script[src="'+ggbHTML5LoadedScript+'"]');Ue!=null&&Ue.parentNode.removeChild(Ue)}var we=document.createElement("script"),Ee=function(){Yt(Ae,sn)};we.src=Te+nt,ggbHTML5LoadedCodebaseIsWebSimple=et,ggbHTML5LoadedCodebaseVersion=Bt,ggbHTML5LoadedScript=we.src,Gn("GeoGebra HTML5 codebase loaded: '"+Te+"'.",sn),!qt&&(!Dt||Dt=="5.0")?(et?webSimple.succeeded=webSimple.succeeded||webSimple():web3d.succeeded=web3d.succeeded||web3d(),Ee()):Te.requirejs?__webpack_require__.e(7963).then(function(){var Fe=[__webpack_require__(87963)];Ee.apply(null,Fe)}.bind(this)).catch(__webpack_require__.oe):(we.onload=Ee,Oe.appendChild(we))}else Yt(Ae,sn);sn.height=te,sn.width=yn},xe=function(Oe,sn,ln){var Vn=an(sn.width,sn.height,sn.borderColor,ln),Ae=document.createElement("div");Ae.style.position="relative",Ae.style.display="block",Ae.style.width=sn.width+"px",Ae.style.height=sn.height+"px",Ae.className="applet_screenshot applet_scaler"+(ln?" applet_screenshot_play":""),Ae.appendChild(Vn);var yn=GGBAppletUtils.getScale(sn,Oe,ln);ln?(Oe.appendChild(_e()),window.GGBT_wsf_view||(Oe.style.position="relative")):window.GGBT_spinner&&window.GGBT_spinner.attachSpinner(Ae,"66%"),Oe.appendChild(Ae),yn!==1&&!isNaN(yn)&&(GGBAppletUtils.scaleElement(Ae,yn),Ae.style.width=sn.width+"px",Ae.style.height=sn.height+"px",Ae.parentNode.style.width=sn.width*yn+"px",Ae.parentNode.style.height=sn.height*yn+"px"),Bn.resize=function(){Pe(Oe,Vn,Ae,ln)},window.addEventListener("resize",function(te){Bn.resize()}),Bn.resize()};function Pe(Oe,sn,ln,Vn){if(Oe.contains(sn)){if(typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()){if(Oe.id!=="fullscreencontent")return;window.GGBT_wsf_view.setCloseBtnPosition(Oe)}var Ae=GGBAppletUtils.getScale(kt,Oe,Vn);ln.parentNode!==null&&(!isNaN(Ae)&&Ae!==1?(GGBAppletUtils.scaleElement(ln,Ae),ln.parentNode.style.width=kt.width*Ae+"px",ln.parentNode.style.height=kt.height*Ae+"px"):(GGBAppletUtils.scaleElement(ln,1),ln.parentNode.style.width=kt.width+"px",ln.parentNode.style.height=kt.height+"px")),typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()&&GGBAppletUtils.positionCenter(Oe),typeof window.GGBT_ws_header_footer=="object"&&window.GGBT_ws_header_footer.setWsScrollerHeight()}}Bn.onExitFullscreen=function(Oe,sn){sn.appendChild(Oe)};var Qe=function(Oe,sn,ln,Vn){xe(Oe,sn,!0);for(var Ae=function(){var En=[];for(te=0;te<Oe.childNodes.length;te++)En.push(Oe.childNodes[te]);if(window.GGBT_wsf_view){var ri=window.GGBT_wsf_view.renderFullScreen(Oe,sn.id),Rt=document.getElementById("fullscreencontainer"),Lt=jQuery(Oe).find(".fullscreencontent");Lt.length>0?(ri.remove(),Lt.attr("id","fullscreencontent").show(),jQuery(Rt).append(Lt),window.dispatchEvent(new Event("resize"))):Ne(ri,sn,!1),window.GGBT_wsf_view.launchFullScreen(Rt)}else Ce=Vn,Ne(Oe,sn,!1);if(!window.GGBT_wsf_view)for(te=0;te<En.length;te++)Oe.removeChild(En[te])},yn=Oe.getElementsByClassName("ggb_preview_play"),te=0;te<yn.length;te++)yn[te].addEventListener("click",Ae,!1),yn[te].addEventListener("ontouchstart",Ae,!1);typeof window.ggbAppletPlayerOnload=="function"&&window.ggbAppletPlayerOnload(Oe),Ot()&&window.GGBT_wsf_view&&$(".wsf-element-fullscreen-button").remove()},_e=function(){var Oe=document.createElement("div");if(Oe.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");}',ln=document.createElement("style");ln.styleSheet?ln.styleSheet.cssText=sn:ln.appendChild(document.createTextNode(sn)),document.getElementsByTagName("head")[0].appendChild(ln)}return Oe},an=function(Oe,sn,ln,Vn){var Ae=document.createElement("div");Ae.className="ggb_preview",Ae.style.position="absolute",Ae.style.zIndex="90",Ae.style.width=Oe-2+"px",Ae.style.height=sn-2+"px",Ae.style.top="0px",Ae.style.left="0px",Ae.style.overflow="hidden",Ae.style.backgroundColor="white";var yn="lightgrey";ln!==void 0&&(ln==="none"?yn="transparent":yn=ln),Ae.style.border="1px solid "+yn;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,st!==null){var En,ri,Rt;if(!Vn){En=document.createElement("img"),En.style.position="absolute",En.style.zIndex="1001",En.style.opacity=1,te.style.opacity=.3,ri=360,ri>Oe/4*3&&(ri=Oe/4*3),Rt=ri/5.8,En.setAttribute("src",st),En.setAttribute("width",ri),En.setAttribute("height",Rt);var Lt=(Oe-ri)/2,Pt=(sn-Rt)/2;En.style.left=Lt+"px",En.style.top=Pt+"px",Ae.appendChild(En)}}return Ae.appendChild(te),Ae},Ke=function(Oe){return Oe=Oe.toLowerCase(),Oe==="html5"||Oe==="screenshot"?Oe:"html5"},re=["web","webSimple","web3d","tablet","tablet3d","phone"],Jt=function(Oe,sn){if(Bt=Oe,sn){Ye(Bt,!0);return}var ln=!Ut;if(ln){var Vn=Et(Bt);!isNaN(Vn)&&Vn<4.4&&(ln=!1)}var Ae,yn;window.location.protocol.substr(0,4)==="http"?Ae=window.location.protocol:Ae="http:";var te=Bt.indexOf("//");te>0?yn=Bt:te===0?yn=Ae+Bt:yn="https://www.geogebra.org/apps/5.2.814.0/";for(var En in re)if(Bt.slice(re[En].length*-1)===re[En]||Bt.slice((re[En].length+1)*-1)===re[En]+"/"){Ye(yn,!1);return}!GGBAppletUtils.isFlexibleWorksheetEditor()&&ln&&!pt.is3D&&!pt.AV&&!pt.SV&&!pt.CV&&!pt.EV2&&!pt.CP&&!pt.PC&&!pt.DA&&!pt.FI&&!pt.PV&&!ie(kt.showToolBar)&&!ie(kt.showMenuBar)&&!ie(kt.showAlgebraInput)&&!ie(kt.enableRightClick)&&(!kt.appName||kt.appName=="classic")?yn+="webSimple/":yn+="web3d/",Ye(yn,!1)},Ye=function(Oe,sn){if(Oe.requirejs){Te=Oe;return}Oe.slice(-1)!=="/"&&(Oe+="/"),Te=Oe,sn===null&&(sn=Oe.indexOf("http")===-1),se=sn,nt="web.nocache.js",et=!1;var ln=Te.split("/");ln.length>1&&(!sn&&ln[ln.length-2]==="webSimple"?(nt="webSimple.nocache.js",et=!0):re.indexOf(ln[ln.length-2])>=0&&(nt=ln[ln.length-2]+".nocache.js")),ln=Oe.split("/"),Bt=ln[ln.length-3],Bt.substr(0,4)==="test"?Bt=Bt.substr(4,1)+"."+Bt.substr(5,1):(Bt.substr(0,3)==="war"||Bt.substr(0,4)==="beta")&&(Bt="5.0");var Vn=parseFloat(Bt);Vn!==NaN&&Vn<5&&Oe.indexOf("geogebra.org")>=0&&(console.log("The GeoGebra HTML5 codebase version "+Vn+" is deprecated. Using version latest instead."),Jt("5.0",sn))},Gn=function(Oe,sn){window.console&&window.console.log&&(!sn||typeof sn.showLogging=="undefined"||sn.showLogging&&sn.showLogging!=="false")&&console.log(Oe)};kt.material_id!==void 0?$t(dn):dn();function dn(){var Oe=zn;Dt!==null?Oe=Dt:parseFloat(Oe)<5&&(Oe="5.0"),Jt(Oe,!1),qt!==null&&Ye(qt,se),he=!0}return Bn},GGBAppletUtils=function(){"use strict";function Bn(){return window.GGBT_wsf_edit!==void 0}function zn(he,Dt){Dt!=1?(he.style.transformOrigin="0% 0% 0px",he.style.webkitTransformOrigin="0% 0% 0px",he.style.transform="scale("+Dt+","+Dt+")",he.style.webkitTransform="scale("+Dt+","+Dt+")",he.style.maxWidth="initial",he.querySelector(".ggb_preview")!==null&&(he.querySelector(".ggb_preview").style.maxWidth="initial"),he.querySelectorAll(".ggb_preview img")[0]!==void 0&&(he.querySelectorAll(".ggb_preview img")[0].style.maxWidth="initial"),he.querySelectorAll(".ggb_preview img")[1]!==void 0&&(he.querySelectorAll(".ggb_preview img")[1].style.maxWidth="initial")):(he.style.transform="none",he.style.webkitTransform="none")}function kt(he,Dt,qt,me,ne,jt){var Te=null;if(jt!=null&&jt!="")for(var se=he.parentNode;se!=null;)if((" "+se.className+" ").indexOf(" "+jt+" ")>-1){Te=se;break}else se=se.parentNode;var Ce=0,Bt=0,nt=0,et=0,ht=0,st=0,gt=0;if(Te)Ce=Te.offsetWidth,Bt=Math.max(me?Te.offsetWidth:0,Te.offsetHeight);else{if(window.innerWidth&&document.documentElement.clientWidth?(Ce=Math.min(window.innerWidth,document.documentElement.clientWidth),Bt=Math.min(window.innerHeight,document.documentElement.clientHeight),nt=Ce):(Ce=window.innerWidth,Bt=window.innerHeight,nt=window.innerWidth),he){var vt=he.getBoundingClientRect();vt.left>0&&vt.left<=Ce&&(ne===void 0||!ne)&&(document.dir==="rtl"?(ht=Ce-vt.width-vt.left,st=nt<=480?10:30):(st=vt.left,ht=nt<=480?10:30),et=st+ht)}if(he&&typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()){var St=he.getBoundingClientRect();window.GGBT_wsf_view.getCloseBtnPosition()==="closePositionRight"?(et=40,gt=0):window.GGBT_wsf_view.getCloseBtnPosition()==="closePositionTop"&&(et=0,gt=40)}}return he&&((qt===void 0||!qt)&&Dt>0&&Dt+et<Ce?Ce=Dt:Ce-=et,typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()&&(qt===void 0||!qt)&&(Bt-=gt)),{width:Ce,height:Bt}}function pt(he,Dt,qt,me,ne){if(he.isScreenshoGenerator)return 1;var jt=me!==void 0&&me,Te=he.noScaleMargin!=null&&he.noScaleMargin,se=function(St){return St&&St!=="false"},Ce=se(he.autoHeight),Bt=kt(Dt,he.width,qt,Ce,jt&&window.GGBT_wsf_view||Te,ne),nt=parseInt(Bt.width),et=he.width,ht=he.height;if(et===void 0){var st=Dt.querySelector(".appletParameters");st&&(et=st.offsetWidth,ht=st.offsetHeight)}var gt=nt/et,vt=jt?1:Bt.height/ht;return qt!==void 0&&!qt&&(gt=Math.min(1,gt),vt=Math.min(1,vt)),Math.min(gt,vt)}function Ut(he,Dt,qt){var me=1,ne,jt=!1;if(he.hasOwnProperty("allowUpscale")&&(jt=he.allowUpscale),he.hasOwnProperty("scale")&&(me=parseFloat(he.scale),(isNaN(me)||me===null||me===0)&&(me=1),me>1&&(jt=!0)),Dt&&typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()&&(jt=!0),!(he.hasOwnProperty("disableAutoScale")&&he.disableAutoScale))ne=pt(he,Dt,jt,qt,he.scaleContainerClass);else return me;return jt&&(!he.hasOwnProperty("scale")||me===1)?ne:Math.min(me,ne)}function ue(he){var Dt=Math.min(window.innerWidth,document.documentElement.clientWidth),qt=Math.min(window.innerHeight,document.documentElement.clientHeight),me=he.getBoundingClientRect(),ne=(Dt-me.width)/2,jt=(qt-me.height)/2;jt<0&&(jt=0),he.style.position="relative",window.GGBT_wsf_view.getCloseBtnPosition()==="closePositionRight"?(ne<40?he.style.left="40px":he.style.left=ne+"px",he.style.top=jt+"px"):window.GGBT_wsf_view.getCloseBtnPosition()==="closePositionTop"&&(jt<40?he.style.top="40px":he.style.top=jt+"px",he.style.left=ne+"px")}function Le(he,Dt){var qt=he.querySelector(".appletParameters");if(qt){if(typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()){if(Dt.id!==qt.getAttribute("data-param-id"))return;window.GGBT_wsf_view.setCloseBtnPosition(he)}if(qt.parentElement&&/fullscreen/.test(qt.parentElement.className))return;var me=Ut(Dt,he);Bn()&&qt.setAttribute("data-param-scale",me);for(var ne=null,jt=0;jt<he.childNodes.length;jt++)if(he.childNodes[jt].className!==void 0&&he.childNodes[jt].className.match(/^applet_scaler/)){ne=he.childNodes[jt];break}if(ne!==null&&ne.querySelector(".noscale")!==null)return;var Te=Dt.id!==void 0?Dt.id:"ggbApplet",se=window[Te];(se==null||!se.recalculateEnvironments)&&ne!==null&&!ne.className.match(/fullscreen/)&&(ne.parentNode.style.transform="",!isNaN(me)&&me!==1?(ne.parentNode.style.width=Dt.width*me+"px",ne.parentNode.style.height=Dt.height*me+"px",zn(ne,me)):(zn(ne,1),ne.parentNode.style.width=Dt.width+"px",ne.parentNode.style.height=Dt.height+"px")),typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()&&ue(he),window.GGBT_wsf_view&&!window.GGBT_wsf_view.isFullscreen()&&window.GGBT_wsf_general.adjustContentToResize($(qt).parents(".content-added-content"))}}return{responsiveResize:Le,isFlexibleWorksheetEditor:Bn,positionCenter:ue,getScale:Ut,scaleElement:zn}}();__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 Bn=n.location.search;return Bn.indexOf(J)!=-1||Bn.indexOf(K)!=-1}function q(Bn,zn){}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(Bn){var zn=s[L].bindings;s[L].bindings=function(){for(var kt=zn?zn():{},pt=Bn[webModule.__softPermutationId],Ut=O;Ut<pt.length;Ut++){var ue=pt[Ut];kt[ue[O]]=ue[P]}return kt}};var t;function u(){return v(),t}function v(){if(!t){var Bn=o.createElement(Q);if(Bn.id=L,Bn.style.cssText=R+S,Bn.tabIndex=-1,o.body.appendChild(Bn),t=Bn.contentWindow.document,navigator.userAgent.indexOf(T)==-1){t.open();var zn=document.compatMode==U?V:W;t.write(zn+X),t.close()}}}function w(Bn){function zn(pt){function Ut(){return typeof o.readyState==Y?typeof o.body!=Y&&o.body!=null:/loaded|complete/.test(o.readyState)}var ue=Ut();if(ue){pt();return}function Le(){if(!ue){if(!Ut())return;ue=!0,pt(),o.removeEventListener&&o.removeEventListener(Z,Le,!1),he&&clearInterval(he)}}o.addEventListener&&o.addEventListener(Z,Le,!1);var he=setInterval(function(){Le()},$)}function kt(pt){var Ut=u(),ue=Ut.body,Le=Ut.createElement(_);Le.language=ab,Le.crossOrigin=W,Le.src=pt,webModule.__errFn&&(Le.onerror=function(){webModule.__errFn(L,new Error(bb+pt))}),ue.appendChild(Le)}zn(function(){kt(Bn)})}webModule.__startLoadingFragment=function(Bn){return C(Bn)},webModule.__installRunAsyncCode=function(Bn){var zn=u(),kt=zn.body,pt=zn.createElement(_);pt.language=ab,pt.text=Bn,kt.appendChild(pt),kt.removeChild(pt)};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(Bn){alert(nb+k+ob)}}else if(j==pb&&(k=i.getAttribute(kb),k))try{e=eval(k)}catch(Bn){alert(nb+k+qb)}}}__gwt_getMetaProperty=function(Bn){var zn=c[Bn];return zn==null?null:zn},r=d,webModule.__errFn=e}function B(){function Bn(he){var Dt=he.lastIndexOf(rb);Dt==-1&&(Dt=he.length);var qt=he.indexOf(sb);qt==-1&&(qt=he.length);var me=he.lastIndexOf(tb,Math.min(qt,Dt));return me>=O?he.substring(O,me+P):W}function zn(he){if(!he.match(/^\w+:\/\//)){var Dt=o.createElement(ub);Dt.src=he+vb,he=Bn(Dt.src)}return he}function kt(){var he=__gwt_getMetaProperty(wb);return he!=null?he:W}function pt(){for(var he=o.getElementsByTagName(_),Dt=O;Dt<he.length;++Dt)if(he[Dt].src.indexOf(xb)!=-1)return Bn(he[Dt].src);return W}function Ut(){var he=o.getElementsByTagName(yb);return he.length>O?he[he.length-P].href:W}function ue(){var he=o.location;return he.href==he.protocol+zb+he.host+he.pathname+he.search+he.hash}var Le=kt();return Le==W&&(Le=pt()),Le==W&&(Le=Ut()),Le==W&&ue()&&(Le=Bn(o.location.href)),Le=zn(Le),Le}function C(Bn){return Bn.match(/^\//)||Bn.match(/^[a-zA-Z]+:\/\//)?Bn:webModule.__moduleBase+Bn}function D(){var Bn=[],zn=O,kt=[],pt=[];function Ut(he){var Dt=pt[he](),qt=kt[he];if(Dt in qt)return Dt;var me=[];for(var ne in qt)me[qt[ne]]=ne;throw r&&r(he,me,Dt),null}if(__gwt_isKnownPropertyValue=function(he,Dt){return Dt in kt[he]},webModule.__getPropMap=function(){var he={};for(var Dt in kt)kt.hasOwnProperty(Dt)&&(he[Dt]=Ut(Dt));return he},webModule.__computePropValue=Ut,n.__gwt_activeModules[L].bindings=webModule.__getPropMap,p())return C(Bb);var ue;try{ue=Cb;var Le=ue.indexOf(Db);Le!=-1&&(zn=parseInt(ue.substring(Le+P),$),ue=ue.substring(O,Le))}catch(he){}return webModule.__softPermutationId=zn,C(ue+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})()},46699:function(Bn,zn,kt){"use strict";kt.d(zn,{Ax:function(){return Le},Ds:function(){return he},KI:function(){return qt},SI:function(){return ue},f1:function(){return Ut}});var pt=kt(346);function Ut(me){let ne=!0;if(me.length>0){for(let jt=0;jt<me.length;jt++)if(me[jt].compile_success==0||!me[jt].compile_success){ne=!1;break}}else ne=!1;return ne}function ue(me,ne=""){let jt=[];for(let Te=0;Te<me.length;Te++){let se=me[Te],Ce=ne?`${ne}/${se.name}`:`${se.name}`;jt.push({title:se.name,type:se.type,isLeaf:se.type!=="tree",key:Ce})}return jt}function Le(me,ne,jt){for(let Te=0;Te<me.length;Te++){let se=me[Te];if(se.key===ne){se.children=jt;break}se.children&&Le(se.children,ne,jt)}return me}function he(me,ne,jt){let Te;return function(){let se=this,Ce=arguments,Bt=function(){Te=null,jt||me.apply(se,Ce)},nt=jt&&!Te;clearTimeout(Te),Te=setTimeout(Bt,ne),nt&&me.apply(se,Ce)}}const Dt=!0,qt=pt.Z.API_SERVER},84842:function(Bn,zn,kt){"use strict";kt.d(zn,{Z:function(){return Bt}});var pt=kt(99571),Ut=kt(59301),ue=Object.defineProperty,Le=Object.defineProperties,he=Object.getOwnPropertyDescriptors,Dt=Object.getOwnPropertySymbols,qt=Object.prototype.hasOwnProperty,me=Object.prototype.propertyIsEnumerable,ne=(nt,et,ht)=>et in nt?ue(nt,et,{enumerable:!0,configurable:!0,writable:!0,value:ht}):nt[et]=ht,jt=(nt,et)=>{for(var ht in et||(et={}))qt.call(et,ht)&&ne(nt,ht,et[ht]);if(Dt)for(var ht of Dt(et))me.call(et,ht)&&ne(nt,ht,et[ht]);return nt},Te=(nt,et)=>Le(nt,he(et)),se=(nt,et)=>{var ht={};for(var st in nt)qt.call(nt,st)&&et.indexOf(st)<0&&(ht[st]=nt[st]);if(nt!=null&&Dt)for(var st of Dt(nt))et.indexOf(st)<0&&me.call(nt,st)&&(ht[st]=nt[st]);return ht},Ce=(nt,et,ht)=>new Promise((st,gt)=>{var vt=Tt=>{try{Et(ht.next(Tt))}catch(Ot){gt(Ot)}},St=Tt=>{try{Et(ht.throw(Tt))}catch(Ot){gt(Ot)}},Et=Tt=>Tt.done?st(Tt.value):Promise.resolve(Tt.value).then(vt,St);Et((ht=ht.apply(nt,et)).next())});const Bt=nt=>{var et=nt,{children:ht}=et,st=se(et,["children"]);const[gt,vt]=(0,Ut.useState)(!1);return Ut.createElement(pt.ZP,Te(jt({},st),{loading:gt,onClick:St=>Ce(void 0,null,function*(){try{vt(!0),yield st.onClick(St),vt(!1)}catch(Et){console.error(Et),vt(!1)}})}),ht)}},54650:function(Bn,zn,kt){"use strict";kt.d(zn,{Z:function(){return Ce}});var pt=kt(59301),Ut=kt(6767),ue=kt(37568),Le={codeBox:"codeBox___WpkVl"},he=kt(92310),Dt=kt.n(he),qt=Object.defineProperty,me=(Bt,nt,et)=>nt in Bt?qt(Bt,nt,{enumerable:!0,configurable:!0,writable:!0,value:et}):Bt[nt]=et,ne=(Bt,nt,et)=>me(Bt,typeof nt!="symbol"?nt+"":nt,et),jt=(Bt,nt,et)=>new Promise((ht,st)=>{var gt=Et=>{try{St(et.next(Et))}catch(Tt){st(Tt)}},vt=Et=>{try{St(et.throw(Et))}catch(Tt){st(Tt)}},St=Et=>Et.done?ht(Et.value):Promise.resolve(Et.value).then(gt,vt);St((et=et.apply(Bt,nt)).next())});class Te extends pt.Component{constructor(nt){super(nt),ne(this,"canvas"),ne(this,"randomNum",(et,ht)=>Math.floor(Math.random()*(ht-et)+et)),ne(this,"drawPic",()=>{this.randomCode()}),ne(this,"reloadPic",()=>{this.drawPic()}),ne(this,"changeCode",et=>{console.log(et.target.value,222),this.setState({value:et.target.value,showError:!1})}),ne(this,"onVerify",()=>{let et;return this.state.value.toLowerCase()!==""&&this.state.value.toLowerCase()!==this.state.code.toLowerCase()?(et=!0,Ut.ZP.error("\u8BF7\u8F93\u5165\u6B63\u786E\u7684\u9A8C\u8BC1\u7801"),this.reloadPic()):this.state.value.toLowerCase()===""?(et=!0,Ut.ZP.error("\u8BF7\u8F93\u5165\u9A8C\u8BC1\u7801")):this.state.value.toLowerCase()===this.state.code.toLowerCase()&&(et=!1),this.setState({showError:et}),et}),this.canvas=pt.createRef(),this.state={value:"",code:"",codeLength:4,fontSizeMin:20,fontSizeMax:22,backgroundColorMin:240,backgroundColorMax:250,colorMin:10,colorMax:20,lineColorMin:40,lineColorMax:180,contentWidth:96,contentHeight:38,showError:!1}}componentDidMount(){this.drawPic()}randomColor(nt,et){const ht=this.randomNum(nt,et),st=this.randomNum(nt,et),gt=this.randomNum(nt,et);return`rgb(${ht}, ${st}, ${gt})`}drawText(nt,et,ht){nt.fillStyle=this.randomColor(this.state.colorMin,this.state.colorMax);const st=this.randomNum(this.state.fontSizeMin,this.state.fontSizeMax);nt.font=st+"px SimHei";const gt=10,vt=(this.state.contentWidth-40)/(this.state.code.length-1);let St=gt;ht>0&&(St=gt+ht*vt);let Et=this.randomNum(this.state.fontSizeMax,this.state.contentHeight-5);st>40&&(Et=40);const Tt=this.randomNum(-10,10);nt.translate(St,Et),nt.rotate(Tt*Math.PI/180),nt.fillText(et,0,0),nt.rotate(-Tt*Math.PI/180),nt.translate(-St,-Et)}drawLine(nt){for(let et=0;et<1;et++)nt.strokeStyle=this.randomColor(this.state.lineColorMin,this.state.lineColorMax),nt.beginPath(),nt.moveTo(this.randomNum(0,this.state.contentWidth),this.randomNum(0,this.state.contentHeight)),nt.lineTo(this.randomNum(0,this.state.contentWidth),this.randomNum(0,this.state.contentHeight)),nt.stroke()}drawDot(nt){for(let et=0;et<100;et++)nt.fillStyle=this.randomColor(0,255),nt.beginPath(),nt.arc(this.randomNum(0,this.state.contentWidth),this.randomNum(0,this.state.contentHeight),1,0,2*Math.PI),nt.fill()}randomCode(){let nt="";const et="QWERTYUPLKJHGFDSAZXCVBNMqwertyupkjhgfdsazxcvbnm1234567890";for(let ht=0;ht<this.state.codeLength;ht++){const st=Math.floor(Math.random()*57);nt+=et[st]}this.setState({code:nt},()=>{const st=this.canvas.current.getContext("2d");st.textBaseline="bottom",st.fillStyle=this.randomColor(this.state.backgroundColorMin,this.state.backgroundColorMax),st.fillRect(0,0,this.state.contentWidth,this.state.contentHeight);for(let gt=0;gt<this.state.code.length;gt++)this.drawText(st,this.state.code[gt],gt);this.drawLine(st),this.drawDot(st)})}render(){const{className:nt,width:et=300}=this.props;return pt.createElement("div",{className:Dt()(Le.codeBox,nt),style:{width:et}},pt.createElement("aside",null,pt.createElement(ue.default,{value:this.state.value,onChange:this.changeCode,placeholder:"\u8BF7\u8F93\u5165\u56FE\u7247\u4E2D\u7684\u9A8C\u8BC1\u7801"})),pt.createElement("div",null,pt.createElement("canvas",{onClick:this.reloadPic,ref:this.canvas,width:"100",height:"30"}),pt.createElement("div",{className:"current",onClick:this.reloadPic},"\u770B\u4E0D\u6E05\uFF1F\u6362\u4E00\u5F20")))}}const se=(Bt,nt)=>{let et;Modal.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:React.createElement("div",null,React.createElement("p",null,nt),React.createElement(Te,{ref:ht=>et=ht})),onOk:()=>jt(void 0,null,function*(){if(et.onVerify())return Promise.reject();Bt()})})};var Ce=Te},30371:function(Bn,zn,kt){"use strict";kt.d(zn,{Z:function(){return ne}});var pt=kt(59301),Ut=kt(37568),ue=kt(96599),Le=kt(6767),he={flex:"flex___eLcnP",flex1:"flex1___yUTT7",color666:"color666___TiUhG",error:"error___gTTtv",deleteIcon:"deleteIcon___mnZW1",addIcon:"addIcon___JC5NS"},Dt=kt(62772);const{TextArea:qt}=Ut.default;class me extends pt.Component{constructor(Te){super(Te),this.state={inputVisible:!1,EditInputIndex:-1}}render(){let{index:Te,onAnswerChange:se,addChildAnswer:Ce,exerciseIsPublish:Bt,answers:nt,activeOptionErrorIndex:et,flex:ht="0 0 1000px"}=this.props;console.log("----",nt);let{inputVisible:st,EditInputIndex:gt}=this.state;return pt.createElement("div",{className:he.flex},pt.createElement("div",{className:`${he.color666} mb5 mt6`,style:{flex:"0 0 90px"}},"\u7B54\u6848(\u586B\u7A7A",Te+1,"):"),pt.createElement("div",{style:{border:"1px solid #f6f6f6",flex:1,padding:10}},nt==null?void 0:nt.map((vt,St)=>pt.createElement(pt.Fragment,null,gt!==St?(vt==null?void 0:vt.length)>0?pt.createElement(ue.default,{className:"edit-tag",key:vt,closable:!((nt==null?void 0:nt.length)===1&&St===0),onClose:Et=>{Et.preventDefault(),(nt==null?void 0:nt.length)===1&&St===0?this.props.deleteChildAnswermain(Te,St):this.props.deleteChildAnswer(Te,St)}},pt.createElement("span",{onDoubleClick:Et=>{this.setState({EditInputIndex:St}),Et.preventDefault()}},vt)):pt.createElement(Ut.default,{defaultValue:vt,style:{width:78,marginRight:8,height:24,verticalAlign:"top"},onBlur:Et=>{if(Et.target.value.replaceAll(" ","").length<=0){Le.ZP.info("\u5185\u5BB9\u4E0D\u80FD\u4E3A\u7EAF\u7A7A\u683C");return}se(Te,St,Et.target.value),this.setState({EditInputIndex:-1,inputVisible:!1})}}):pt.createElement(Ut.default,{defaultValue:vt,style:{width:78,marginRight:8,height:24,verticalAlign:"top"},onBlur:Et=>{if(Et.target.value.replaceAll(" ","").length<=0){Le.ZP.info("\u5185\u5BB9\u4E0D\u80FD\u4E3A\u7EAF\u7A7A\u683C");return}se(Te,St,Et.target.value),this.setState({EditInputIndex:-1,inputVisible:!1})}}))),!st&&pt.createElement(ue.default,{className:"site-tag-plus",onClick:()=>{Ce(Te),this.setState({inputVisible:!0})}},pt.createElement(Dt.Z,null)," \u65B0\u589E\u7B54\u6848")))}}var ne=me},61011:function(Bn,zn,kt){"use strict";kt.d(zn,{Z:function(){return Bt}});var pt=kt(59301),Ut=kt(39793),ue=Object.defineProperty,Le=Object.defineProperties,he=Object.getOwnPropertyDescriptors,Dt=Object.getOwnPropertySymbols,qt=Object.prototype.hasOwnProperty,me=Object.prototype.propertyIsEnumerable,ne=(nt,et,ht)=>et in nt?ue(nt,et,{enumerable:!0,configurable:!0,writable:!0,value:ht}):nt[et]=ht,jt=(nt,et)=>{for(var ht in et||(et={}))qt.call(et,ht)&&ne(nt,ht,et[ht]);if(Dt)for(var ht of Dt(et))me.call(et,ht)&&ne(nt,ht,et[ht]);return nt},Te=(nt,et)=>Le(nt,he(et)),se=(nt,et,ht)=>ne(nt,typeof et!="symbol"?et+"":et,ht);const Ce="\u2581";class Bt extends pt.Component{constructor(){super(...arguments),se(this,"getChCountBeforeCursor",(et,ht)=>{const st=ht.line;let gt=0;for(let St=0;St<st;St++)gt+=et.getLine(St).split(Ce).length-1;const vt=et.getLine(st).substring(0,ht.ch);return gt+=vt.split(Ce).length-1,gt}),se(this,"onCMBeforeChange",(et,ht)=>{const st=et.getRange(ht.from,ht.to);let gt=0;if(ht.text.forEach(vt=>{gt+=vt.split(Ce).length-1}),st&&st.indexOf(Ce)!=-1){const vt=st.split(Ce).length-1,St=this.getChCountBeforeCursor(et,ht.from);console.log(`\u5220\u9664${vt}\u4E2A\uFF0C \u4E4B\u524D\u6709${St}\u4E2A\uFF0C\u65B0\u589E${gt}\u4E2A`),this.props.deleteEmptyDisabled?ht.cancel():this.props.onPlaceholderChange&&this.props.onPlaceholderChange(St,vt,gt)}else if(gt){const vt=this.getChCountBeforeCursor(et,ht.from);console.log(`\u65B0\u589E${gt}\u4E2A\uFF0C\u4E4B\u524D\u6709${vt}\u4E2A`),this.props.onPlaceholderChange&&this.props.onPlaceholderChange(vt,0,gt)}})}render(){return pt.createElement(Ut.Z,Te(jt({},this.props),{onCMBeforeChange:this.onCMBeforeChange}))}}},94361:function(Bn,zn,kt){"use strict";kt.d(zn,{Z:function(){return Dt}});var pt=kt(37639),Ut={text:"text___FxbAX",wrap:"wrap___UlBQ1",contact:"contact____pUDq",img:"img___BapAv"},ue=kt(32637),Le=kt(59301),Dt=({type:qt,style:me})=>{const ne=Le.createElement("div",{className:Ut.wrap,onClick:jt=>{jt.preventDefault(),jt.stopPropagation()}},Le.createElement("p",null,qt==="shixun"||qt==="paths"?"\u5F53\u524D\u5B9E\u8DF5\u9879\u76EE\u662F\u9AD8\u6D88\u8017\u7C7B\u578B\u7684\u5B9E\u9A8C\u3002":"\u5F53\u524D\u8BD5\u5377\u5305\u542B\u9AD8\u6D88\u8017\u7C7B\u578B\u7684\u5B9E\u9A8C\u3002",Le.createElement("br",null),"\u6839\u636E\u5E73\u53F0\u4F7F\u7528\u89C4\u5219\uFF0C\u9700\u8981\u6388\u6743\u624D\u80FD\u4F7F\u7528\u3002",qt==="paths"?"\u53D1\u9001\u5230\u8BFE\u5802":"\u53D1\u5E03","\u4F7F\u7528\u4E4B\u524D\uFF0C\u8BF7\u5148\u8054\u7CFB\u5E73\u53F0\u7BA1\u7406\u5458\u83B7\u53D6\u6388\u6743\u7801\u3002"),Le.createElement("div",{className:Ut.contact},Le.createElement("div",{className:Ut.img},Le.createElement("img",{src:ue,width:"124px",height:"124px"})),Le.createElement("div",{className:"tc font14 mt10",style:{color:"#777A93"}},"\u626B\u4E00\u626B\uFF0C\u83B7\u53D6\u6388\u6743\u7801")));return Le.createElement(pt.Z,{content:ne},Le.createElement("span",{className:Ut.text,style:me},"\u9AD8\u6D88\u8017"))}},9507:function(Bn,zn,kt){"use strict";kt.d(zn,{Z:function(){return Te}});var pt=kt(59301),Ut={imageDimensions:"imageDimensions___a7crR",img:"img___Kroat",fullWidth:"fullWidth___c492T"},ue=kt(92310),Le=kt.n(ue),he=kt(29787),Dt=kt(2859),qt=kt(38986),me=kt(51257),ne=(se,Ce,Bt)=>new Promise((nt,et)=>{var ht=vt=>{try{gt(Bt.next(vt))}catch(St){et(St)}},st=vt=>{try{gt(Bt.throw(vt))}catch(St){et(St)}},gt=vt=>vt.done?nt(vt.value):Promise.resolve(vt.value).then(ht,st);gt((Bt=Bt.apply(se,Ce)).next())}),Te=({data:se,className:Ce,fullWidth:Bt,style:nt={},onClose:et,onOk:ht,showFullTools:st,noAssociationId:gt})=>{const vt=(0,pt.useRef)(null),St=(0,pt.useRef)(null),Et=(0,pt.useRef)(null),Tt=(0,pt.useRef)(null),[Ot,$t]=(0,pt.useState)(!1),[Xt,Ht]=(0,pt.useState)("\u6B63\u5728\u52A0\u8F7D\u4E2D");(0,pt.useEffect)(()=>(Et.current||(Et.current=document.createElement("style"),document.head.appendChild(Et.current)),se!=null&&se.visible?(document.body.setAttribute("data-custom","y-hidden"),Et.current.innerHTML=" html { overflow-y: hidden; }",se!=null&&se.src&&ve()):(document.body.removeAttribute("data-custom"),Et.current&&(document.head.removeChild(Et.current),Et.current=null)),()=>{document.body.removeAttribute("data-custom"),Et.current&&(document.head.removeChild(Et.current),Et.current=null)}),[se==null?void 0:se.visible]);const ve=()=>ne(void 0,null,function*(){$t(!0),Ht("\u6B63\u5728\u52A0\u8F7D\u4E2D");const Pe=yield(0,me.ZJ)(se==null?void 0:se.src);vt.current.src="",vt.current.src=Pe,vt.current.onload=function(){xe()},$t(!1),Ht("")}),ie=Pe=>ne(void 0,null,function*(){$t(!0),Ht("\u6B63\u5728\u4FDD\u5B58\u4E2D");const Qe=yield(0,qt.ZP)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:se.title,file:Pe.dataUrl}});Qe!=null&&Qe.id&&!gt?(yield(0,qt.ZP)(`/api/attachments/${se.id}/add_subitem.json`,{method:"post",body:{subitem_id:Qe==null?void 0:Qe.id,settings:JSON.stringify(Pe.state)}})).status===0&&ht():Qe!=null&&Qe.id&&ht(Qe),$t(!1),Ht("")}),Ne=()=>{const Pe=document.querySelector('a[href="https://markerjs.com/"]');Pe&&Pe.parentNode&&(Pe.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(_e=>{const an=document.querySelector(_e.name);an&&an.setAttribute("title",_e.title)})},xe=()=>{St.current=new Dt.hP(vt.current),St.current.targetRoot=Tt.current,St.current.addEventListener("render",ie),St.current.addEventListener("beforeclose",et),st&&(St.current.availableMarkerTypes=St.current.ALL_MARKER_TYPES,St.current.uiStyleSettings.redoButtonVisible=!0,St.current.uiStyleSettings.notesButtonVisible=!0,St.current.uiStyleSettings.zoomButtonVisible=!0,St.current.uiStyleSettings.zoomOutButtonVisible=!0,St.current.uiStyleSettings.clearButtonVisible=!0),window.markerArea=St.current.uiStyleSettings,St.current.show(),se!=null&&se.snapshotData&&St.current.restoreState(se.snapshotData),setTimeout(()=>{window.scrollTo(0,0),Ne()},300)};return pt.createElement(pt.Fragment,null,(se==null?void 0:se.visible)&&pt.createElement(he.Z,{spinning:Ot,tip:Xt,style:{position:"absolute",width:"100vw"}},pt.createElement("div",{ref:Tt,className:Le()(Ut.imageDimensions,Ce,Bt?Ut.fullWidth:""),style:nt},pt.createElement("img",{className:Ut.img,ref:vt}))))}},19105:function(Bn,zn,kt){"use strict";var pt=kt(59301),Ut=kt(99587),ue=kt(48136),Le=kt(76562),he=kt(62957),Dt=kt(59301);const qt=(0,pt.forwardRef)(({callback:me,width:ne,onChange:jt,disabled:Te,readOnly:se,type:Ce="",value:Bt="",style:nt={}},et)=>{const ht=(0,pt.useRef)(),st=(0,pt.useRef)(),[gt,vt]=(0,pt.useState)(0),[St,Et]=(0,pt.useState)(0),[Tt,Ot]=(0,pt.useState)(!1),$t=()=>{var ie=document.createElement("div");ie.innerHTML=ht.current.getValue();var Ne=ie.innerText;return me&&me(Ne),Ne};(0,pt.useImperativeHandle)(et,()=>({getData:$t}));const Xt=ie=>{ie.preventDefault();const Ne=ie.clientX-gt,xe=ie.clientY-St;document.body.onmousemove=Pe=>{let Qe=Pe.clientX-Ne,_e=Pe.clientY-xe;const an=document.getElementsByClassName("markdown-popup-form")[0],Ke=window.innerWidth-an.offsetWidth,re=window.innerHeight-an.offsetHeight;Qe=Math.max(0,Math.min(Qe,Ke)),_e=Math.max(0,Math.min(_e,re)),Ht(Pe.clientX,Pe.clientY,Ne,xe)&&(vt(Qe),Et(_e))},document.body.onmouseup=function(){document.body.onmousemove=null}},Ht=(ie,Ne,xe,Pe)=>{const Qe=document.body.clientHeight,_e=document.body.clientWidth;return ie<20&&xe>ie||ie>_e-20&&xe<ie||Ne<20&&Pe>Ne||Ne>Qe-20&&Pe<Ne?(document.body.onmousemove=null,document.body.onmouseup=null,!1):!0};(0,pt.useEffect)(()=>{Tt&&setTimeout(()=>{const ie=document.getElementsByClassName("markdown-popup-form")[0],Ne=window.innerWidth/2-ie.offsetWidth/2,xe=window.innerHeight/2-ie.offsetHeight/2;vt(Ne),Et(xe)},0)},[Tt]);const ve=()=>{Te||se||Ot(!0)};return Dt.createElement("div",{style:nt},Dt.createElement("div",{style:{width:ne||"100%",position:"relative"},className:`${Ut.Z.mathFillWrap} ${Te||se?"cursorDefault":""}`,onClick:()=>ve()},Dt.createElement("math-field",{disabled:Te,locale:"zh_cn",class:`${Ut.Z.mathField} ${Ce}`,readOnly:se,placeholder:"\u8BF7\u8F93\u5165\u516C\u5F0F",ref:ht,style:{width:"100%",fontSize:Bt?18:14},value:Bt||""})),Dt.createElement(he.default,{maskClosable:!1,centered:!0,width:860,style:{position:"absolute",left:gt,top:St},title:Dt.createElement("div",{style:{cursor:"move"},onMouseDown:Xt},"\u8F93\u5165\u516C\u5F0F"),open:Tt,onOk:()=>{const ie=st.current.getData();ht.current.setValue(ie),jt(ie),Ot(!1)},onCancel:()=>{Ot(!1)},destroyOnClose:!0,className:"markdown-popup-form"},Dt.createElement(Le.Z,{value:Bt,ref:st,onChange:jt,showSaveButton:!1})))});zn.Z=qt},76562:function(Bn,zn,kt){"use strict";var pt=kt(59301),Ut=kt(77019),ue=kt(5269),Le=kt(20554),he=kt(99571),Dt=kt(76902),qt=kt(99587),me=kt(48136),ne=kt(59301);const jt=(0,pt.forwardRef)(({callback:Te,showSaveButton:se,value:Ce=""},Bt)=>{const nt=(0,pt.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}`}]}]}],st=St=>{nt.current.setValue(nt.current.getValue()+" "+St.value+" ")},gt=[{key:"1",label:"\u5FEB\u6377\u6A21\u677F",children:ne.createElement(Ut.Z,{className:qt.Z.lists,gutter:[10,10]},et.map((St,Et)=>ne.createElement(ue.Z,{flex:"110px",className:qt.Z.item},ne.createElement("div",null,ne.createElement(Dt.Z,{value:`$$${St.value}$$`}),St.name),ne.createElement("div",{className:qt.Z.children},St.children.map((Tt,Ot)=>ne.createElement("div",{key:Ot},ne.createElement("h1",null,Tt.name),ne.createElement(Ut.Z,{gutter:[10,10]},Tt.data.map(($t,Xt)=>ne.createElement(ue.Z,{key:Xt,onClick:()=>st($t),className:qt.Z.diamond},ne.createElement(Dt.Z,{value:"`$$"+$t.value+"$$`"}))))))))))},{key:"2",label:"\u516C\u5F0F\u6A21\u677F",children:ne.createElement(Ut.Z,{className:qt.Z.lists,gutter:[10,10]},ht.map((St,Et)=>ne.createElement(ue.Z,{flex:"110px",className:qt.Z.item},ne.createElement("div",null,ne.createElement(Dt.Z,{value:"`$$"+St.value+"$$`"}),St.name),ne.createElement("div",{className:qt.Z.children},St.children.map((Tt,Ot)=>ne.createElement("div",{key:Ot},Tt.name&&ne.createElement("h1",null,Tt.name),ne.createElement(Ut.Z,{gutter:[10,10]},Tt.data.map(($t,Xt)=>ne.createElement(ue.Z,{key:Xt,onClick:()=>st($t),className:qt.Z.diamond},ne.createElement(Dt.Z,{value:"`$$"+$t.value+"$$`"}))))))))))}],vt=()=>{var St=document.createElement("div");St.innerHTML=nt.current.getValue();var Et=St.innerText;return Te&&Te(Et),Et};return(0,pt.useImperativeHandle)(Bt,()=>({getData:vt})),ne.createElement("div",{className:qt.Z.mathWrap},ne.createElement(Le.default,{defaultActiveKey:"1",items:gt}),ne.createElement("math-field",{locale:"zh_cn",className:qt.Z.mathField,placeholder:"\u8BF7\u6253\u5F00\u952E\u76D8\uFF0C\u8F93\u5165\u516C\u5F0F",ref:nt,style:{width:800,marginTop:30,fontSize:18}},Ce||""),se&&ne.createElement("div",{className:qt.Z.button},ne.createElement(he.ZP,{size:"large",onClick:vt,style:{zIndex:8,marginTop:10},type:"primary"},"\u4FDD\u5B58\u5230\u7F16\u8F91\u5668")))});zn.Z=jt},28426:function(Bn,zn,kt){"use strict";var pt=kt(59301),Ut=kt(93314),ue=kt(99571),Le=Object.defineProperty,he=Object.defineProperties,Dt=Object.getOwnPropertyDescriptors,qt=Object.getOwnPropertySymbols,me=Object.prototype.hasOwnProperty,ne=Object.prototype.propertyIsEnumerable,jt=(Bt,nt,et)=>nt in Bt?Le(Bt,nt,{enumerable:!0,configurable:!0,writable:!0,value:et}):Bt[nt]=et,Te=(Bt,nt)=>{for(var et in nt||(nt={}))me.call(nt,et)&&jt(Bt,et,nt[et]);if(qt)for(var et of qt(nt))ne.call(nt,et)&&jt(Bt,et,nt[et]);return Bt},se=(Bt,nt)=>he(Bt,Dt(nt));const Ce=({img:Bt,buttonProps:nt={},styles:et={},customText:ht,ButtonText:st,ButtonClick:gt,Buttonclass:vt,ButtonTwo:St,imgStyles:Et,loading:Tt=!1,className:Ot=""})=>pt.createElement("section",{className:`tc animated fadeIn ${Ot}`,style:Te({color:"#999",margin:"100px auto",visibility:Tt?"hidden":"visible"},et)},pt.createElement("img",{src:Bt||Ut,style:se(Te({},Et),{pointerEvents:"none",userSelect:"none"})}),pt.createElement("p",{className:"mt20 font14"},ht||"\u6682\u65F6\u8FD8\u6CA1\u6709\u76F8\u5173\u6570\u636E\u54E6!"),st&&pt.createElement(ue.ZP,Te({className:vt,onClick:gt},nt),st),St&&St);zn.Z=Ce},45677:function(Bn,zn,kt){"use strict";kt.d(zn,{Z:function(){return vt}});var pt=kt(59301),Ut={wrp:"wrp___dq7YK",bgBlack:"bgBlack___ARIUV",monaco:"monaco___VnZC3",darkBlue:"darkBlue___UprA9",close:"close___LKoWu",embed:"embed___hvpEJ"},ue=kt(99571),Le=kt(70557),he=kt(75975),Dt=kt(25399),qt=kt(51257),me=kt(81722),ne=kt(28426),jt=kt(346),Te=kt(44203),se=kt(59301),Ce=Object.defineProperty,Bt=Object.getOwnPropertySymbols,nt=Object.prototype.hasOwnProperty,et=Object.prototype.propertyIsEnumerable,ht=(St,Et,Tt)=>Et in St?Ce(St,Et,{enumerable:!0,configurable:!0,writable:!0,value:Tt}):St[Et]=Tt,st=(St,Et)=>{for(var Tt in Et||(Et={}))nt.call(Et,Tt)&&ht(St,Tt,Et[Tt]);if(Bt)for(var Tt of Bt(Et))et.call(Et,Tt)&&ht(St,Tt,Et[Tt]);return St},gt=(St,Et,Tt)=>new Promise((Ot,$t)=>{var Xt=ie=>{try{ve(Tt.next(ie))}catch(Ne){$t(Ne)}},Ht=ie=>{try{ve(Tt.throw(ie))}catch(Ne){$t(Ne)}},ve=ie=>ie.done?Ot(ie.value):Promise.resolve(ie.value).then(Xt,Ht);ve((Tt=Tt.apply(St,Et)).next())}),vt=({editOffice:St="view",data:Et,issaver:Tt,onSaver:Ot,theme:$t,type:Xt,filename:Ht,monacoEditor:ve,className:ie,style:Ne,close:xe,onClose:Pe,hasMask:Qe,disabledDownload:_e,onImgDimensions:an,showNodata:Ke,recordInfo:re})=>{const[Jt,Ye]=(0,pt.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),[Gn,dn]=(0,pt.useState)(""),[Oe,sn]=(0,pt.useState)(),ln=window.ENV==="build"?"/react/build":"",Vn=location.host.startsWith("localhost")?jt.Z.PROXY_SERVER:jt.Z.API_SERVER,yn=10*(1024*1024),te=(0,pt.useRef)();Et!=null&&Et.startsWith("/api")&&Xt!=="txt"&&(Et=jt.Z.API_SERVER+Et);const En=Nt=>Nt.substring(Nt.lastIndexOf("/")+1).split(".").pop();Ht&&ve&&(ve.filename=Ht),(0,pt.useEffect)(()=>{var Nt,Zt;const Mt=(Zt=(Nt=document.cookie)==null?void 0:Nt.replace(/\s/g,""))==null?void 0:Zt.split(";");Mt==null||Mt.map(Yt=>{let Ge=Yt.split("=");Ge[0]==="_educoder_session"&&dn(Ge[1])})},[]),(0,pt.useEffect)(()=>{Xt==="office"&&(Et.indexOf("bigfilescdn.")>-1||Et.indexOf("bigfiles1")>-1?sn({url:Et,fileType:En(Et),model:Et.indexOf("model=edit")?"edit":"view"}):Rt())},[Xt,Et]);function ri(Nt){return gt(this,null,function*(){Nt.data.type==="pdfdata"&&(Ot(Nt.data.data),window.removeEventListener("message",ri,!1)),console.log("mess---:",Nt.data)})}const Rt=()=>gt(void 0,null,function*(){console.log("data:",Et);let Nt=Et;Et.startsWith("http")||(Nt=location.origin+Nt);let Zt=new URL(Nt).pathname.split("/").pop();const Mt=yield(0,me.gJ)({attachment_id:Zt});Mt.url=Vn+Mt.url,sn(Mt)}),Lt=()=>{if(Et.startsWith("http")||Et.startsWith("blob:")){Pt();return}(0,qt.Sv)(Ht||"educoder",Et,Ht)},Pt=()=>{re&&(0,Te.fc)({id:re==null?void 0:re.id,watch_type:1,course_id:re==null?void 0:re.course_id}),(0,qt.Nd)(Ht||"educoder",decodeURIComponent(Et))};return se.createElement("div",{style:st({},Ne||{}),className:`${Qe&&Ut.bgBlack} ${Xt?Ut.wrp:"hide"}`},xe&&se.createElement("div",{className:Ut.close,ref:te},!!an&&se.createElement(Dt.Z,{title:"\u70B9\u51FB\u5BF9\u56FE\u7247\u8FDB\u884C\u6279\u6CE8",getPopupContainer:()=>te.current},se.createElement("span",{onClick:()=>{Pe(),an()}},se.createElement("i",{className:"icon-yulanpizhu"}))),!_e&&se.createElement(Dt.Z,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:()=>te.current},se.createElement("span",{onClick:Pt},se.createElement("i",{className:"icon-quxiaozhiding"}))),Tt&&se.createElement(Dt.Z,{title:"\u4FDD\u5B58pdf\u5E76\u9000\u51FA",getPopupContainer:()=>te.current},se.createElement("span",{className:"",onClick:()=>{const Nt=document.getElementById("pdfiframe");window.addEventListener("message",ri,!1),setTimeout(()=>{Nt.contentWindow.postMessage("getData","*")},300)}},se.createElement("i",{className:"icon-baocun"}))),se.createElement(Dt.Z,{title:"\u5173\u95ED",getPopupContainer:()=>te.current},se.createElement("span",{className:"",onClick:()=>{Pe()}},se.createElement("i",{className:"icon-guanbi1"})))),se.createElement("div",{className:`${Ut[ie]} ${ie} ${Ut.monaco} ${Xt==="txt"?"show":"hide"}`},Xt==="txt"&&se.createElement(se.Fragment,null,se.createElement(he.ZP,st({},ve)))),Xt==="audio"&&se.createElement("audio",{src:`${(Et==null?void 0:Et.indexOf("http://"))>-1||(Et==null?void 0:Et.indexOf("https://"))>-1?"":"data:audio/mp3;base64,"}${Et}`,autoPlay:!0}),Xt==="video"&&se.createElement(se.Fragment,null,(Et==null?void 0:Et.indexOf("http"))>-1?se.createElement("video",{controls:!0,src:`${Et}`,autoPlay:!0}):se.createElement("video",{controls:!0,src:`data:video/mp4;base64,${Et}`,autoPlay:!0})),Xt==="office"&&Oe&&se.createElement("iframe",{src:`${ln}/office.html?key=${Oe.key}&url=${btoa(Oe.url)}&callbackUrl=${Vn+(Oe.callbackUrl||"")}&fileType=${Oe.fileType}&title=${Oe.title||""}&model=${St}&officeServer=${jt.Z.ONLYOFFICE}&disabledDownload=${!!_e}`}),Xt==="html"&&se.createElement("iframe",{src:Et+"&disposition=inline"}),Xt==="pdf"&&se.createElement("iframe",{id:"pdfiframe",src:`${ln}/js/pdfview/index.html?filename=${Ht||"educoder.pdf"}&url=${encodeURIComponent(Et)}&disabledDownload=${!!_e}&model=${St}`}),Xt==="image"&&se.createElement("img",{src:`${(Et==null?void 0:Et.indexOf("http://"))>-1||(Et==null?void 0:Et.indexOf("https://"))>-1?"":"data:image/png;base64,"}${Et}`}),(Xt==="other"||Xt==="download")&&se.createElement(se.Fragment,null,Ke?se.createElement(ne.Z,{customText:"\u5F53\u524D\u6587\u4EF6\u4E0D\u652F\u6301\u9884\u89C8\uFF0C\u53EF\u70B9\u51FB\u4E0B\u8F7D\u67E5\u770B",ButtonTwo:se.createElement(ue.ZP,{icon:se.createElement("i",{className:"iconfont icon-xiazai4 font14"}),type:"primary",size:"middle",onClick:Lt,disabled:_e},"\u4E0B\u8F7D")}):se.createElement(ue.ZP,{type:"primary",size:"middle",onClick:Lt,disabled:_e},se.createElement(Le.Z,null),"\u70B9\u51FB\u4E0B\u8F7D")))}},68571:function(Bn,zn,kt){"use strict";kt.d(zn,{t:function(){return Pt}});var pt=kt(59301),Ut=kt(37568),ue=kt(28284),Le=kt(62957),he=kt(77019),Dt=kt(5269),qt=kt(71051),me=kt(82326),ne=kt(47889),jt=kt(31457),Te=kt(25690),se=kt(8423),Ce=kt(6767),Bt=kt(99571),nt=kt(29787),et=kt(24334),ht={flex_box_center:"flex_box_center___kOQ8P",flex_space_between:"flex_space_between___fY6jt",flex_box_vertical_center:"flex_box_vertical_center___bDSSI",flex_box_center_end:"flex_box_center_end___mQ6mU",flex_box_column:"flex_box_column___F15G0",result:"result___UYRo8",left:"left___TRaH5",right:"right___twp9s",box:"box___vwndt",li:"li___hRe2d"},st=kt(38986),gt=kt(81072),vt=kt(39793),St=kt(56102),Et=kt(37345),Tt=kt(59301),Ot=Object.defineProperty,$t=Object.defineProperties,Xt=Object.getOwnPropertyDescriptors,Ht=Object.getOwnPropertySymbols,ve=Object.prototype.hasOwnProperty,ie=Object.prototype.propertyIsEnumerable,Ne=(Nt,Zt,Mt)=>Zt in Nt?Ot(Nt,Zt,{enumerable:!0,configurable:!0,writable:!0,value:Mt}):Nt[Zt]=Mt,xe=(Nt,Zt)=>{for(var Mt in Zt||(Zt={}))ve.call(Zt,Mt)&&Ne(Nt,Mt,Zt[Mt]);if(Ht)for(var Mt of Ht(Zt))ie.call(Zt,Mt)&&Ne(Nt,Mt,Zt[Mt]);return Nt},Pe=(Nt,Zt)=>$t(Nt,Xt(Zt)),Qe=(Nt,Zt,Mt)=>new Promise((Yt,Ge)=>{var De=Ee=>{try{we(Mt.next(Ee))}catch(Fe){Ge(Fe)}},Ue=Ee=>{try{we(Mt.throw(Ee))}catch(Fe){Ge(Fe)}},we=Ee=>Ee.done?Yt(Ee.value):Promise.resolve(Ee.value).then(De,Ue);we((Mt=Mt.apply(Nt,Zt)).next())}),an=({buttonProps:Nt,buttonText:Zt,form:Mt,hackIdentifier:Yt="",answerKey:Ge,data:De})=>{const[Ue,we]=(0,pt.useState)(!1),[Ee,Fe]=(0,pt.useState)(!1),[He,qe]=(0,pt.useState)(!1),[cn,gn]=(0,pt.useState)({}),[ni,ze]=(0,pt.useState)(""),[Ve,nn]=(0,pt.useState)(""),qn=(0,pt.useRef)(Yt),vn=(0,pt.useRef)(""),tn=(0,pt.useRef)(!1);(0,pt.useEffect)(()=>{He&&vi()},[He]),(0,pt.useEffect)(()=>()=>{sessionStorage.removeItem("projectFill")},[]);const Rn=()=>new Date().getTime(),gi=De==null?void 0:De.code,ti=()=>{var xn,Tn;let ai=gi?De==null?void 0:De.code:(xn=Mt.getFieldValue("hack_codes"))==null?void 0:xn.code,pi=gi?De==null?void 0:De.answer_content:Mt.getFieldValue(Ge),ui=gi?De==null?void 0:De.input:(Tn=Mt.getFieldValue("hack_sets"))==null?void 0:Tn.input;pi==null||pi.forEach(zi=>{const wt=zi.value||zi.answer_text||"";ai=ai.replace(/(@▁@|@▁▁@)/,wt)}),nn(ui),ze(ai),gn({}),qe(!0)},vi=()=>Qe(void 0,null,function*(){var xn,Tn,ai,pi;const ui=Rn(),zi=gi?De==null?void 0:De.time_limit:(xn=Mt.getFieldsValue())==null?void 0:xn.hack.time_limit,wt=gi?(Tn=De==null?void 0:De.answer_content)==null?void 0:Tn.length:(pi=(ai=Mt.getFieldsValue())==null?void 0:ai.standard_answers)==null?void 0:pi.length;we(!0),yield(0,gt.bM)(vn.current,{test_hack_code:ni,test_input:Ve});function Xe(){return Qe(this,null,function*(){const{status:Hn,data:Ai}=yield(0,gt.rX)(vn.current,"submit"),dr=Rn()-ui>(zi+3)*1e3*wt;if(tn.current){if(dr){Ce.ZP.error("\u8C03\u8BD5\u4EE3\u7801\u8D85\u65F6"),we(!1);return}if(Hn===0){we(!1),gn(Pe(xe({},Ai),{showText:!0}));return}setTimeout(Xe,1e3)}})}Xe()}),Gi=()=>Qe(void 0,null,function*(){var xn,Tn,ai,pi,ui,zi,wt;if(!De){try{yield Mt.validateFields()}catch(Vi){(ai=(Tn=(xn=Vi==null?void 0:Vi.errorFields)==null?void 0:xn[0])==null?void 0:Tn.name)!=null&&ai.includes("standard_answers")?Ce.ZP.error("\u586B\u7A7A\u9879\u7B54\u6848\u4E0D\u80FD\u4E3A\u7A7A"):Ce.ZP.error(Vi.errorFields[0].errors[0]),Mt.scrollToField(Vi.errorFields[0].name,{behavior:"smooth",block:"center"});return}Fe(!0);let Hn="";const Ai=Mt.getFieldsValue();qn.current?Hn=yield(0,st.ZP)(`/api/problems/${qn.current}.json`,{method:"put",body:Pe(xe({},Ai),{hack:Pe(xe({},Ai==null?void 0:Ai.hack),{sub_discipline_id:(wt=(zi=Ai==null?void 0:Ai.hack)==null?void 0:zi.sub_discipline_id)==null?void 0:wt[1],difficult:Ai.difficulty,item_banks_group_id:Ai.item_banks_group_id}),hack_codes:Pe(xe({},Ai.hack_codes),{code:et.Base64.encode(Ai.hack_codes.code)}),update_hack_sets:[xe({},Ai.hack_sets)],is_blank:!0,item_type:"BPROGRAM"})}):(Hn=yield(0,st.ZP)("/api/problems.json",{method:"post",body:Pe(xe({},Ai),{hack:Pe(xe({},Ai==null?void 0:Ai.hack),{sub_discipline_id:(ui=(pi=Ai==null?void 0:Ai.hack)==null?void 0:pi.sub_discipline_id)==null?void 0:ui[1],difficult:Ai.difficulty,item_banks_group_id:Ai.item_banks_group_id}),hack_codes:Pe(xe({},Ai.hack_codes),{code:et.Base64.encode(Ai.hack_codes.code)}),hack_sets:[xe({},Ai.hack_sets)],is_blank:!0,item_type:"BPROGRAM"})}),qn.current=Hn==null?void 0:Hn.identifier,sessionStorage.projectFill=Hn==null?void 0:Hn.identifier)}const Xe=yield(0,st.ZP)(`/api/problems/${qn.current}/start.json`,{method:"get"});if((Xe==null?void 0:Xe.status)===0){vn.current=Xe==null?void 0:Xe.identifier,tn.current=!0,Fe(!1),ti();return}Fe(!1)}),Fn=xn=>{const{status:Tn,error_msg:ai,execute_time:pi,output:ui,input:zi,expected_output:wt}=xn;let Xe=null;switch(Tn){case Et.h.OK:Xe=Tt.createElement(Tt.Fragment,null,Tt.createElement("p",null,"\u6267\u884C\u7528\u65F6\uFF1A",pi/1e3,"\u79D2"),Tt.createElement("p",null,"\u6267\u884C\u7ED3\u679C\uFF1A\u8C03\u8BD5\u901A\u8FC7"));break;case Et.h.NOMATCH:Xe=Tt.createElement(Tt.Fragment,null,Tt.createElement("div",null,"\u8F93\u5165\uFF1A"),Tt.createElement("pre",{style:{fontFamily:"initial"}},zi),Tt.createElement("div",null,"\u8F93\u51FA\uFF1A"),Tt.createElement("pre",{style:{fontFamily:"initial"}},ui&&et.Base64.decode(ui)),Tt.createElement("div",null,"\u9884\u671F\u8F93\u51FA\uFF1A"),Tt.createElement("pre",{style:{fontFamily:"initial"}},wt&&et.Base64.decode(wt)));break;case Et.h.EXECUTEFAILURE:Xe=Tt.createElement(Tt.Fragment,null,Tt.createElement("p",null,"\u6700\u540E\u6267\u884C\u7684\u8F93\u5165\uFF1A",Tt.createElement("pre",null,zi)),Tt.createElement("p",null,"\u6267\u884C\u51FA\u9519\u4FE1\u606F\uFF1A"),Tt.createElement("pre",{className:"error"},et.Base64.decode(ai)));break;case Et.h.COMPILEFAILURE:Xe=Tt.createElement(Tt.Fragment,null,Tt.createElement("p",null,"\u6700\u540E\u6267\u884C\u7684\u8F93\u5165\uFF1A",Tt.createElement("pre",null,zi)),Tt.createElement("p",null,"\u6267\u884C\u51FA\u9519\u4FE1\u606F\uFF1A"),Tt.createElement("pre",{className:"error"},et.Base64.decode(ai)));break;case Et.h.PODFAILURE:Xe=Tt.createElement("p",null,"\u521B\u5EFApod\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");break;case Et.h.TIMEOUT:Xe=Tt.createElement("p",null,"\u8BC4\u6D4B\u8D85\u65F6\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");break}return Tt.createElement(Tt.Fragment,null," ",Xe," ")};return Tt.createElement("div",null,Tt.createElement(Bt.ZP,Pe(xe({loading:Ee},Nt),{onClick:Gi}),Zt),Tt.createElement(Le.default,{open:He,title:"\u8C03\u8BD5\u4EE3\u7801",destroyOnClose:!0,width:1200,okText:"\u8FD0\u884C\u6D4B\u8BD5",confirmLoading:Ue,cancelButtonProps:{style:{display:"none"}},onOk:()=>vi(),onCancel:()=>{tn.current=!1,qe(!1)}},Tt.createElement("div",{className:ht.result},Tt.createElement("div",{className:ht.left},Tt.createElement("div",{className:"mb20"},Tt.createElement("span",{className:"c-black"},"\u6267\u884C\u4EE3\u7801"),!De&&Tt.createElement(St.CopyToClipboard,{text:ni,onCopy:()=>Ce.ZP.success("\u590D\u5236\u6210\u529F")},Tt.createElement("span",{style:{float:"right"},className:"current c-light-primary"},Tt.createElement("i",{className:"iconfont icon-fuzhi8 mr5"}),"\u590D\u5236"))),Tt.createElement(vt.Z,{height:510,className:"mb0",hidetoolBar:!0,defaultValue:ni,onChange:xn=>ze(xn)})),Tt.createElement("div",{className:ht.right},Tt.createElement("div",{className:"c-black mb20"},"\u81EA\u5B9A\u4E49\u6D4B\u8BD5\u7528\u4F8B"),Tt.createElement("div",{className:ht.box},Tt.createElement("div",{className:ht.li},Tt.createElement(Ut.default.TextArea,{placeholder:"\u8BF7\u8F93\u5165",value:Ve,onChange:xn=>nn(xn.target.value),bordered:!1,style:{height:180}}))),Tt.createElement("div",{className:"c-black mb20 mt30"},"\u4EE3\u7801\u6267\u884C\u7ED3\u679C"),Tt.createElement("div",{className:ht.box},Tt.createElement(nt.Z,{spinning:Ue,tip:"\u4EE3\u7801\u6267\u884C\u4E2D"},Tt.createElement("div",{className:ht.li,style:{height:196,overflow:"auto",padding:10}},Fn(cn))))))))},Ke=kt(87169),re=kt(59301),Jt=Object.defineProperty,Ye=Object.defineProperties,Gn=Object.getOwnPropertyDescriptors,dn=Object.getOwnPropertySymbols,Oe=Object.prototype.hasOwnProperty,sn=Object.prototype.propertyIsEnumerable,ln=(Nt,Zt,Mt)=>Zt in Nt?Jt(Nt,Zt,{enumerable:!0,configurable:!0,writable:!0,value:Mt}):Nt[Zt]=Mt,Vn=(Nt,Zt)=>{for(var Mt in Zt||(Zt={}))Oe.call(Zt,Mt)&&ln(Nt,Mt,Zt[Mt]);if(dn)for(var Mt of dn(Zt))sn.call(Zt,Mt)&&ln(Nt,Mt,Zt[Mt]);return Nt},Ae=(Nt,Zt)=>Ye(Nt,Gn(Zt)),yn=(Nt,Zt)=>{var Mt={};for(var Yt in Nt)Oe.call(Nt,Yt)&&Zt.indexOf(Yt)<0&&(Mt[Yt]=Nt[Yt]);if(Nt!=null&&dn)for(var Yt of dn(Nt))Zt.indexOf(Yt)<0&&sn.call(Nt,Yt)&&(Mt[Yt]=Nt[Yt]);return Mt};const{TextArea:te}=Ut.default,En=[{title:"C",key:"C"},{title:"C++",key:"C++"},{title:"Python",key:"Python"},{title:"Java",key:"Java"}],ri=({value:Nt,onChange:Zt})=>re.createElement(Switch,{checked:Nt,onChange:Mt=>{Zt(Mt)}}),Rt="@\u2581@",Lt="@\u2581\u2581@",Pt=({questionTitlePlaceholder:Nt,form:Zt,scoreByBlank:Mt=!1,hackidentifier:Yt,answerKey:Ge})=>{const[De,Ue]=(0,pt.useState)(!1),[we,Ee]=(0,pt.useState)(!1),He=(0,Te.useParams)().type==="edit",qe=(vn,tn)=>{const Rn=tn.line;let gi=0;for(let vi=0;vi<Rn;vi++)gi+=vn.getLine(vi).split(Rt).length-1;for(let vi=0;vi<Rn;vi++)gi+=vn.getLine(vi).split(Lt).length-1;const ti=vn.getLine(Rn).substring(0,tn.ch);return gi+=ti.split(Rt).length-1,gi+=ti.split(Lt).length-1,gi},cn=(vn,tn,Rn,gi)=>{const ti=vn.getRange(tn.from,tn.to);let vi=0;if(tn.text.forEach(Gi=>{vi+=Gi.split(Rt).length-1}),tn.text.forEach(Gi=>{vi+=Gi.split(Lt).length-1}),tn.origin!=="setValue"){if(ti&&(ti.indexOf(Rt)!==-1||ti.indexOf(Lt)!==-1)){const Gi=ti.split(Rt).length-1+ti.split(Lt).length-1,Fn=qe(vn,tn.from);if(console.log(`\u5220\u9664${Gi}\u4E2A\uFF0C \u524D\u9762\u6709${Fn}\u4E2A\uFF0C\u65B0\u589E${vi}\u4E2A`),Gi>1){const xn=Array.from({length:Gi},(Tn,ai)=>Fn+ai);gi(xn)}else gi(Fn)}else if(vi>0){const Gi=qe(vn,tn.from);console.log(`\u65B0\u589E${vi}\u4E2A\uFF0C\u4E4B\u524D\u6709${Gi}\u4E2A`),Rn(vi,Gi)}}},gn=()=>{const vn=Zt.getFieldValue(Ge);Zt.setFieldsValue({[Ge]:vn==null?void 0:vn.map((tn,Rn)=>Ae(Vn({},tn),{position:Rn+1}))})},ni=(0,pt.useRef)(),ze=(vn,tn)=>{for(let Rn=0;Rn<vn;Rn++)ni.current({position:null,answer_text:""},tn+Rn);gn()},Ve=(0,pt.useRef)(),nn=vn=>{Ve.current(vn),gn()},qn=ue.default.useWatch(Ge,Zt);return re.createElement("div",{className:se.Z.wrap},re.createElement(ue.default.Item,{label:"\u8BD5\u9898\u63CF\u8FF0",name:["hack","description"],style:{display:"table"},className:"w100",labelCol:{span:24},rules:[{required:!0}]},re.createElement(jt.h,{scrollId:"name",watch:!0,height:140})),re.createElement("div",{className:se.Z.questionTitleEditorWrap},re.createElement(ue.default.Item,{label:"\u7A0B\u5E8F\u4EE3\u7801",name:["hack_codes","code"],labelCol:{span:24},rules:[{required:!0}]},re.createElement(jt.h,{scrollId:"name",watch:!0,height:400,showNullProgramButton:!0,onChange:(vn,tn)=>{const Rn=Zt.getFieldValue(Ge);console.log("--preAnswerData",Rn,tn),Zt.setFieldsValue({[Ge]:Rn==null?void 0:Rn.map((gi,ti)=>{var vi;return Ae(Vn({},gi),{position:ti+1,multi_line:(vi=tn==null?void 0:tn[ti])==null?void 0:vi.multiLine})})})},placeholder:Nt,onCMBeforeChange:(vn,tn)=>{cn(vn,tn,ze,nn)}}))),re.createElement(ue.default.List,{name:Ge,rules:[{validator(vn,tn){if(!(tn!=null&&tn.length))return Promise.reject(new Error("\u7B54\u6848\u4E0D\u80FD\u4E3A\u7A7A"));for(const Rn of tn){const{answer_text:gi}=Rn||{};if((gi==null?void 0:gi.length)===0)return Promise.reject(new Error("\u586B\u7A7A\u9879\u7B54\u6848\u4E0D\u80FD\u4E3A\u7A7A"))}return Promise.resolve()}}]},(vn,{add:tn,remove:Rn},{errors:gi})=>(ni.current=tn,Ve.current=Rn,re.createElement(re.Fragment,null,re.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"}},re.createElement(ue.default.Item,{label:"\u586B\u7A7A\u9879\u7B54\u6848",required:!0,labelCol:{span:24}}),re.createElement("div",{onClick:()=>{Le.default.warning({title:"\u7ED9\u5206\u8BF4\u660E",icon:null,width:700,centered:!0,content:re.createElement("div",null,re.createElement("div",null,"1.\u5B66\u751F\u586B\u5199\u7B54\u6848\u4E4B\u540E\uFF0C\u5FC5\u987B\u63D0\u4EA4\u4EE3\u7801",re.createElement("span",{style:{color:"#e30000"}},"\u8FDB\u884C\u8BC4\u6D4B"),"\u624D\u80FD\u5F97\u5206\u3002"),re.createElement("div",{style:{marginTop:10}},"2.\u8BD5\u9898\u7B97\u5206\u65F6\uFF0C\u7CFB\u7EDF\u4F1A\u5C06\u7A0B\u5E8F\u91CC\u9762\u7684\u6240\u6709\u7A7A\u66FF\u6362\u6210\u5B66\u751F\u7684\u7B54\u6848\u8FDB\u884C\u8BC4\u6D4B\u3002\u8F93\u51FA\u7684\u7ED3\u679C\u4E0E\u6D4B\u8BD5\u96C6\u6BD4\u5BF9\uFF0C\u5B8C\u5168\u6B63\u786E\u5219\u5F97\u6EE1\u5206\uFF1B\u82E5\u4E0D\u5B8C\u5168\u6B63\u786E\uFF0C\u5219\u4F9D\u6B21\u5C06\u6BCF\u4E2A\u7A7A\u6362\u6210\u5B66\u751F\u63D0\u4EA4\u7684\u7B54\u6848\uFF0C\u540C\u65F6\u5C06\u5176\u4ED6\u7A7A\u66FF\u6362\u6210\u6807\u51C6\u7B54\u6848\uFF0C\u8FD0\u884C\u7A0B\u5E8F\u3002\u5982\u679C\u8FD9\u4E2A\u7A7A\u7684\u5B66\u751F\u7B54\u6848\u4E0E\u6807\u51C6\u7B54\u6848\u7ED3\u5408\u80FD\u5F97\u5230\u6B63\u786E\u8F93\u51FA\uFF0C\u5219\u8FD9\u4E2A\u7A7A\u5F97\u5230\u8BE5\u7A7A\u7684\u6EE1\u5206\uFF0C\u5426\u5219\u8BE5\u7A7A\u5F970\u5206\u3002"))})},style:{minHeight:32,color:"#3061D0",cursor:"pointer"}},re.createElement(Ke.Z,{style:{marginRight:3,color:"#3061D0"}}),re.createElement("span",null," \u7ED9\u5206\u8BF4\u660E"))),vn.map((ti,vi)=>{var Gi=ti,{key:Fn,name:xn}=Gi,Tn=yn(Gi,["key","name"]),ai,pi;return re.createElement(he.Z,{className:"mb20",key:Fn,align:"middle",wrap:!1},re.createElement(Dt.Z,{flex:"0 0 auto",className:`${se.Z.blankIndex}`},"\u586B\u7A7A\u9879",vi+1),re.createElement(Dt.Z,{flex:1},re.createElement(he.Z,{align:"top",justify:"space-between",wrap:!1},re.createElement(Dt.Z,null,re.createElement(ue.default.Item,Ae(Vn({},Tn),{name:[xn,"answer_text"],noStyle:!0}),(ai=qn==null?void 0:qn[xn])!=null&&ai.multi_line||(pi=qn==null?void 0:qn[xn])!=null&&pi.multiLine?re.createElement(te,{spellCheck:!1,style:{marginLeft:10,width:550}}):re.createElement(Ut.default,{style:{marginLeft:10,width:550},className:se.Z.blankInput,size:"large",maxLength:1e3,onBlur:ui=>{}}))),Mt&&re.createElement(Dt.Z,{flex:"224px"},re.createElement(ue.default.Item,Ae(Vn({},Tn),{name:[xn,"score"],label:"\u5206\u503C",rules:[{required:!0}]}),re.createElement(qt.Z,{size:"large",className:se.Z.blankInput,min:.1,max:100,precision:1,style:{width:"100%"},placeholder:"\u8BF7\u8F93\u5165\u5206\u503C"}))))))})))),re.createElement("div",{onClick:()=>Ue(!0)},re.createElement(ue.default.Item,{name:["hack","analysis"],label:"\u9898\u76EE\u89E3\u6790",labelCol:{span:24}},re.createElement(jt.x,{placeholder:"\u8BF7\u7F16\u8F91\u9898\u76EE\u89E3\u6790\uFF08\u975E\u5FC5\u586B\uFF09",isEdit:De}))),re.createElement(ue.default.Item,{label:"\u7F16\u7A0B\u8BED\u8A00",style:{marginTop:30},name:["hack_codes","language"],labelCol:{span:24},rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u7F16\u7A0B\u8BED\u8A00"}]},re.createElement(me.default,{size:"large"},En.map(vn=>re.createElement(me.default.Option,{key:vn.title,value:vn.key}," ",vn.title)))),re.createElement(ue.default.Item,{label:"\u6700\u5927\u8BC4\u6D4B\u65F6\u957F\uFF08\u79D2\uFF09",style:{marginTop:30},labelCol:{span:24},required:!0},re.createElement(ue.default.Item,{name:["hack","time_limit"],rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5355\u4E2A\u6D4B\u8BD5\u96C6\u8BC4\u6D4B\u65F6\u957F\u9650\u5236"},{type:"number",min:3,message:"\u6700\u5C0F\u9650\u5236\u65F6\u95F4\u662F3\u79D2"}],noStyle:!0},re.createElement(qt.Z,{precision:0,max:10,min:3,size:"large",style:{width:"97%"}})),re.createElement("span",{className:"ml10 font14"},"\u79D2")),re.createElement(ue.default.Item,{label:"\u8BC4\u6D4B\u65F6\u7A7A\u683C\u5904\u7406",style:{marginTop:30},name:["hack","submit_rule"],labelCol:{span:24},rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u8BC4\u6D4B\u65F6\u7A7A\u683C\u5904\u7406"}]},re.createElement(ne.ZP.Group,{style:{marginTop:-10}},re.createElement(ne.ZP,{value:0},"\u4E0D\u5FFD\u7565\u7A7A\u683C"),re.createElement(ne.ZP,{value:1},"\u5FFD\u7565\u9996\u5C3E\u7A7A\u683C"),re.createElement(ne.ZP,{value:2},"\u5FFD\u7565\u6240\u6709\u7A7A\u683C"))),re.createElement(ue.default.Item,{label:"\u6D4B\u8BD5\u7528\u4F8B",required:!0,style:{marginTop:30}}),re.createElement("div",{style:{background:"#F6F7F9",padding:15}},re.createElement(ue.default.Item,{label:"\u8F93\u5165",labelCol:{span:24},name:["hack_sets","input"]},re.createElement(te,{rows:4})),re.createElement(ue.default.Item,{label:"\u8F93\u51FA",labelCol:{span:24},name:["hack_sets","output"],rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u8F93\u51FA\u5185\u5BB9"}]},re.createElement(te,{rows:4}))),re.createElement(an,{form:Zt,answerKey:Ge,hackIdentifier:Yt,buttonText:"\u8FD0\u884C\u8C03\u8BD5",buttonProps:{ghost:!0,icon:re.createElement("i",{className:"iconfont icon-ceshi"}),style:{background:"rgba(55,173,131,0.05)",borderRadius:19,border:"1px solid #37AD83",width:116,height:38,display:"inline-flex",fontSize:14,alignItems:"center",justifyContent:"center",marginTop:20,cursor:"pointer",color:"#37AD83"}}}))}},81727:function(Bn,zn,kt){"use strict";kt.d(zn,{u:function(){return Tt}});var pt=kt(59301),Ut=kt(77019),ue=kt(5269),Le=kt(25399),he=kt(28284),Dt=kt(8423),qt=kt(32134),me=kt(12893),ne=kt(31457),jt=kt(59301),Te=Object.defineProperty,se=Object.defineProperties,Ce=Object.getOwnPropertyDescriptors,Bt=Object.getOwnPropertySymbols,nt=Object.prototype.hasOwnProperty,et=Object.prototype.propertyIsEnumerable,ht=(Ot,$t,Xt)=>$t in Ot?Te(Ot,$t,{enumerable:!0,configurable:!0,writable:!0,value:Xt}):Ot[$t]=Xt,st=(Ot,$t)=>{for(var Xt in $t||($t={}))nt.call($t,Xt)&&ht(Ot,Xt,$t[Xt]);if(Bt)for(var Xt of Bt($t))et.call($t,Xt)&&ht(Ot,Xt,$t[Xt]);return Ot},gt=(Ot,$t)=>se(Ot,Ce($t)),vt=(Ot,$t)=>{var Xt={};for(var Ht in Ot)nt.call(Ot,Ht)&&$t.indexOf(Ht)<0&&(Xt[Ht]=Ot[Ht]);if(Ot!=null&&Bt)for(var Ht of Bt(Ot))$t.indexOf(Ht)<0&&et.call(Ot,Ht)&&(Xt[Ht]=Ot[Ht]);return Xt};const St=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],Et=({value:Ot,onChange:$t,choiceTextKey:Xt,answerKey:Ht,index:ve,isEdit:ie,setInputActive:Ne,form:xe,choiceOptionsPath:Pe,allowChangeMode:Qe,showAddIcon:_e,addItem:an,deleteItem:Ke})=>{console.log(Ot,"value");const re=(Ot==null?void 0:Ot[Ht])===1,Jt=()=>{const Gn=xe.getFieldValue(Pe);xe.setFieldValue(Pe,Gn.map(dn=>gt(st({},dn),{[Ht]:0})))},Ye=()=>{re?$t(gt(st({},Ot),{[Ht]:0})):(Qe||Jt(),$t(gt(st({},Ot),{[Ht]:1})))};return jt.createElement(Ut.Z,{className:Dt.Z.choiceWrap,align:"middle",wrap:!1},jt.createElement(ue.Z,{onClick:Ye,className:`${Dt.Z.choiceIndex} ${re?Dt.Z.activeAnswer:""}`},St[ve]),jt.createElement(ue.Z,{flex:1,className:`${Dt.Z.editorWrap} ml15`,onClick:Ne},jt.createElement(ne.x,{height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9009\u9879",isEdit:ie,value:Ot==null?void 0:Ot[Xt],onChange:Gn=>{$t(gt(st({},Ot),{[Xt]:Gn}))}})),jt.createElement(ue.Z,{flex:"0 0 auto",className:"ml15"},jt.createElement("div",{onClick:Ye,className:`${Dt.Z.setAnswerBtn} ${re?Dt.Z.activeAnswer:""}`},re?"\u6B63\u786E\u7B54\u6848":"\u8BBE\u4E3A\u7B54\u6848")),jt.createElement(ue.Z,{className:Dt.Z.actionWrapper},jt.createElement(Le.Z,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},jt.createElement(qt.Z,{className:Dt.Z.addIcon,onClick:an,style:{visibility:_e?"visible":"hidden"}})),jt.createElement(Le.Z,{title:"\u5220\u9664"},jt.createElement(me.Z,{className:Dt.Z.deleteIcon,onClick:Ke,style:{visibility:ve>1?"visible":"hidden"}}))))},Tt=({questionTitlePlaceholder:Ot,titleKey:$t,choiceKey:Xt,analysisKey:Ht,choiceTextKey:ve,answerKey:ie,choiceOptionsPath:Ne,allowChangeMode:xe=!0,form:Pe,showAnalysis:Qe=!0})=>{const[_e,an]=(0,pt.useState)(),[Ke,re]=(0,pt.useState)(!1);return jt.createElement("div",{className:Dt.Z.wrap},jt.createElement("div",{className:Dt.Z.questionTitleEditorWrap},jt.createElement(he.default.Item,{label:"\u9898\u5E72",name:$t,labelCol:{span:24},rules:[{required:!0}]},jt.createElement(ne.h,{scrollId:Array.isArray($t)?$t.join("_"):`${$t}`,watch:!0,height:140,placeholder:Ot}))),jt.createElement(he.default.Item,{label:"\u7B54\u6848\u9009\u9879",required:!0,labelCol:{span:24}}),jt.createElement(he.default.List,{name:Xt,rules:[{validator(Jt,Ye){const Gn=Ye.some(Oe=>Oe[ie]===1),dn=Ye.findIndex(Oe=>{var sn;return((sn=Oe[ve])==null?void 0:sn.length)<=0});return dn!==-1?Promise.reject(new Error(`\u8BF7\u5148\u8F93\u5165${St[dn]}\u9009\u9879\u7684\u5185\u5BB9`)):Gn?Promise.resolve():Promise.reject(new Error("\u8BF7\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))}}]},(Jt,{add:Ye,remove:Gn})=>jt.createElement("div",{id:Array.isArray(Ne)?Ne.join("_"):`${Ne}`},Jt.map((dn,Oe)=>{var sn=dn,{key:ln,name:Vn}=sn,Ae=vt(sn,["key","name"]);const yn=_e===ln,te=()=>{an(ln)},En=Oe<7&&Oe===Jt.length-1,ri=()=>Ye({[ve]:"",[ie]:0}),Rt=()=>Gn(Vn);return jt.createElement(he.default.Item,gt(st({},Ae),{key:ln,name:Vn,className:Dt.Z.choiceListWrap,rules:[{validator(Lt,Pt){return Pt!=null&&Pt.choice_text?Promise.resolve():Promise.reject(new Error(`\u8BF7\u5148\u8F93\u5165${St[Oe]}\u9009\u9879\u7684\u5185\u5BB9`))}}]}),jt.createElement(Et,{choiceTextKey:ve,answerKey:ie,index:Oe,isEdit:yn,setInputActive:te,form:Pe,choiceOptionsPath:Ne,allowChangeMode:xe,showAddIcon:En,addItem:ri,deleteItem:Rt}))}),Jt.length<8&&jt.createElement("div",{className:`${Dt.Z.addBtn} mb30`,onClick:()=>Ye({[ve]:"",[ie]:0})},"\u6DFB\u52A0\u9009\u9879"))),Qe&&jt.createElement("div",{onClick:()=>re(!0)},jt.createElement(he.default.Item,{name:Ht,label:"\u9898\u76EE\u89E3\u6790",labelCol:{span:24}},jt.createElement(ne.x,{placeholder:"\u8BF7\u7F16\u8F91\u9898\u76EE\u89E3\u6790\uFF08\u975E\u5FC5\u586B\uFF09",isEdit:Ke}))))}},92046:function(Bn,zn,kt){"use strict";kt.d(zn,{u:function(){return xe}});var pt=kt(59301),Ut=kt(62957),ue=kt(77019),Le=kt(5269),he=kt(37568),Dt=kt(25399),qt=kt(71411),me=kt(28284),ne=kt(47889),jt=kt(71051),Te=kt(31457),se=kt(12893),Ce=kt(61485),Bt=kt(8423),nt=kt(19105),et=kt(59301),ht=Object.defineProperty,st=Object.defineProperties,gt=Object.getOwnPropertyDescriptors,vt=Object.getOwnPropertySymbols,St=Object.prototype.hasOwnProperty,Et=Object.prototype.propertyIsEnumerable,Tt=(Pe,Qe,_e)=>Qe in Pe?ht(Pe,Qe,{enumerable:!0,configurable:!0,writable:!0,value:_e}):Pe[Qe]=_e,Ot=(Pe,Qe)=>{for(var _e in Qe||(Qe={}))St.call(Qe,_e)&&Tt(Pe,_e,Qe[_e]);if(vt)for(var _e of vt(Qe))Et.call(Qe,_e)&&Tt(Pe,_e,Qe[_e]);return Pe},$t=(Pe,Qe)=>st(Pe,gt(Qe)),Xt=(Pe,Qe)=>{var _e={};for(var an in Pe)St.call(Pe,an)&&Qe.indexOf(an)<0&&(_e[an]=Pe[an]);if(Pe!=null&&vt)for(var an of vt(Pe))Qe.indexOf(an)<0&&Et.call(Pe,an)&&(_e[an]=Pe[an]);return _e};const Ht=({value:Pe,onChange:Qe})=>{const _e=Ke=>{Ut.default.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u53C2\u8003\u7B54\u6848\u5417\uFF1F",className:Bt.Z.modal,onOk:()=>{const re=[...Pe];re.splice(Ke,1),Qe(re)}})},an=()=>{const Ke=[...Pe];Ke.push(""),Qe(Ke)};return et.createElement(ue.Z,{className:"ml20"},et.createElement(Le.Z,{flex:1},Pe==null?void 0:Pe.map((Ke,re)=>et.createElement(ue.Z,{key:`${Ke}_${re}`,className:"mb20"},et.createElement(he.default.TextArea,{style:{flex:1,minHeight:44},defaultValue:Ke,autoSize:{maxRows:3},maxLength:1e3,onBlur:Jt=>{const Ye=[...Pe],Gn=Jt.target.value.trim();Ye[re]=Gn,Qe(Ye)}}),et.createElement(Dt.Z,{title:"\u5220\u9664"},et.createElement(se.Z,{className:Bt.Z.deleteIcon,style:{marginLeft:15,visibility:re>0?"visible":"hidden"},onClick:()=>_e(re)}))))),et.createElement(Le.Z,null,et.createElement("div",{className:`${Bt.Z.addBtn}`,onClick:()=>{an()}},"\u65B0\u589E\u7B54\u6848")))},ve=({value:Pe,onChange:Qe})=>{const _e=Ke=>{Ut.default.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u53C2\u8003\u7B54\u6848\u5417\uFF1F",className:Bt.Z.modal,onOk:()=>{const re=[...Pe];re.splice(Ke,1),Qe(re)}})},an=()=>{const Ke=[...Pe];Ke.push(""),Qe(Ke)};return et.createElement(ue.Z,{className:"ml20"},et.createElement(Le.Z,{flex:1},Pe==null?void 0:Pe.map((Ke,re)=>et.createElement(ue.Z,{key:`${Ke}_${re}`,align:"middle",className:"mb20"},et.createElement(nt.Z,{value:Ke,style:{flex:1},onChange:Jt=>{const Ye=[...Pe];Ye[re]=Jt,Qe(Ye)}}),et.createElement(Dt.Z,{title:"\u5220\u9664"},et.createElement(se.Z,{className:Bt.Z.deleteIcon,style:{marginLeft:15,visibility:re>0?"visible":"hidden"},onClick:()=>_e(re)}))))),et.createElement(Le.Z,null,et.createElement("div",{className:`${Bt.Z.addBtn}`,onClick:()=>{an()}},"\u65B0\u589E\u7B54\u6848")))},ie=({value:Pe=!0,onChange:Qe})=>et.createElement(qt.Z,{checked:!Pe,onChange:_e=>{Qe(!_e)}}),Ne="\u2581",xe=({questionTitlePlaceholder:Pe,form:Qe,scoreByBlank:_e=!1,answerKey:an})=>{const[Ke,re]=(0,pt.useState)(!1),Jt=(Ae,yn)=>{const te=yn.line;let En=0;for(let Rt=0;Rt<te;Rt++)En+=Ae.getLine(Rt).split(Ne).length-1;const ri=Ae.getLine(te).substring(0,yn.ch);return En+=ri.split(Ne).length-1,En},Ye=(Ae,yn,te,En)=>{const ri=Ae.getRange(yn.from,yn.to);let Rt=0;if(yn.text.forEach(Lt=>{Rt+=Lt.split(Ne).length-1}),yn.origin!=="setValue"){if(ri&&ri.indexOf(Ne)!==-1){const Lt=ri.split(Ne).length-1,Pt=Jt(Ae,yn.from);if(console.log(`\u5220\u9664${Lt}\u4E2A\uFF0C \u524D\u9762\u6709${Pt}\u4E2A\uFF0C\u65B0\u589E${Rt}\u4E2A`),Lt>1){const Nt=Array.from({length:Lt},(Zt,Mt)=>Pt+Mt);En(Nt)}else En(Pt)}else if(Rt>0){const Lt=Jt(Ae,yn.from);console.log(`\u65B0\u589E${Rt}\u4E2A\uFF0C\u4E4B\u524D\u6709${Lt}\u4E2A`),te(Rt,Lt)}}},Gn=()=>{const Ae=Qe.getFieldValue(an);Qe.setFieldsValue({[an]:Ae.map((yn,te)=>$t(Ot({},yn),{position:te+1}))})},dn=(0,pt.useRef)(),Oe=(Ae,yn)=>{for(let te=0;te<Ae;te++)dn.current({position:null,answer_text:[""],model:1},yn+te);Gn()},sn=(0,pt.useRef)(),ln=Ae=>{sn.current(Ae),Gn()},Vn=me.default.useWatch(an,Qe);return et.createElement("div",{className:Bt.Z.wrap},et.createElement("div",{className:Bt.Z.questionTitleEditorWrap},et.createElement(me.default.Item,{label:"\u9898\u5E72",name:"name",labelCol:{span:24},rules:[{required:!0}]},et.createElement(Te.h,{scrollId:"name",watch:!0,height:140,placeholder:Pe,showNullButton:!0,onCMBeforeChange:(Ae,yn)=>{Ye(Ae,yn,Oe,ln)}}))),et.createElement(me.default.List,{name:an,rules:[{validator(Ae,yn){if(!(yn!=null&&yn.length))return Promise.reject(new Error("\u8BF7\u5148\u5728\u9898\u5E72\u4E2D\u63D2\u5165\u586B\u7A7A\u9879"));for(const te of yn){const{answer_text:En}=te||{};if(En!=null&&En.some(ri=>(ri==null?void 0:ri.length)===0))return Promise.reject(new Error("\u586B\u7A7A\u9879\u7B54\u6848\u4E0D\u80FD\u4E3A\u7A7A"))}return Promise.resolve()}}]},(Ae,{add:yn,remove:te},{errors:En})=>(dn.current=yn,sn.current=te,et.createElement(et.Fragment,null,et.createElement(me.default.Item,{label:et.createElement("span",null,"\u586B\u7A7A\u9879\u7B54\u6848",!(Ae!=null&&Ae.length)&&et.createElement("span",{style:{color:"#E99237"}},"\uFF08\u8BF7\u5148\u5728\u9898\u5E72\u4E2D\u63D2\u5165\u586B\u7A7A\u9879\uFF09")),required:!0,labelCol:{span:24}}),Ae.map((ri,Rt)=>{var Lt=ri,{key:Pt,name:Nt}=Lt,Zt=Xt(Lt,["key","name"]),Mt,Yt;return et.createElement("div",{style:{marginBottom:10},key:Pt},et.createElement(ue.Z,{className:"mb20",align:"middle",wrap:!1},et.createElement(Le.Z,{style:{marginRight:10},flex:"0 0 auto",className:`${Bt.Z.blankIndex}`},"\u586B\u7A7A\u9879",Rt+1),et.createElement(me.default.Item,$t(Ot({},Zt),{name:[Nt,"model"],noStyle:!0}),et.createElement(ne.ZP.Group,{onChange:()=>{const Ge=Qe.getFieldValue(an);Qe.setFieldsValue({[an]:Ge.map((De,Ue)=>$t(Ot({},De),{answer_text:Nt===Ue?[""]:De.answer_text}))})}},et.createElement(ne.ZP,{value:1},"\u6587\u672C\u6A21\u5F0F ",et.createElement(Dt.Z,{title:"\u5B66\u751F\u7B54\u9898\u65F6\uFF0C\u9700\u8981\u5728\u6587\u672C\u6846\u4E2D\u586B\u5199\u6587\u672C\u7B54\u6848"},et.createElement(Ce.Z,null))),et.createElement(ne.ZP,{value:2},"\u6570\u5B66\u516C\u5F0F\u6A21\u5F0F ",et.createElement(Dt.Z,{title:"\u5B66\u751F\u7B54\u9898\u65F6\uFF0C\u9700\u8981\u7F16\u5199\u6570\u5B66\u516C\u5F0F\u4F5C\u4E3A\u7B54\u6848"},et.createElement(Ce.Z,null)))))),et.createElement(ue.Z,{style:{marginLeft:20},align:"middle",wrap:!1},et.createElement(Le.Z,{flex:1},et.createElement(ue.Z,{align:"top",justify:"space-between",wrap:!1},et.createElement(Le.Z,{flex:1},et.createElement(me.default.Item,$t(Ot({},Zt),{name:[Nt,"answer_text"],noStyle:!0}),((Yt=(Mt=Qe.getFieldValue(an))==null?void 0:Mt[Nt])==null?void 0:Yt.model)===1?et.createElement(Ht,null):et.createElement(ve,null))),_e&&et.createElement(Le.Z,{flex:"224px",style:{margin:"-7px 0 0 20px"}},et.createElement(me.default.Item,$t(Ot({},Zt),{name:[Nt,"score"],label:"\u5206\u503C",rules:[{required:!0}],className:Bt.Z.blankInputNumberWrapper}),et.createElement(jt.Z,{min:.1,max:100,precision:1,style:{width:"100%"},placeholder:"\u8BF7\u8F93\u5165\u5206\u503C"})))),et.createElement(me.default.Item,$t(Ot({},Zt),{name:[Nt,"position"],noStyle:!0}),et.createElement(he.default,{type:"hidden"})))))})))),et.createElement(ue.Z,{align:"middle"},et.createElement(me.default.Item,{name:"downcase",valuePropName:"checked"},et.createElement(qt.Z,null)),et.createElement(Le.Z,{className:"ml10"},"\u5224\u5206\u65F6\u5FFD\u7565\u7B54\u6848\u4E2D\u7684\u5B57\u6BCD\u5927\u5C0F\u5199")),et.createElement(ue.Z,{align:"middle"},et.createElement(me.default.Item,{name:"no_space",valuePropName:"checked"},et.createElement(qt.Z,null)),et.createElement(Le.Z,{className:"ml10"},"\u5224\u5206\u65F6\u5FFD\u7565\u7B54\u6848\u4E2D\u7684\u7A7A\u683C")),(Vn==null?void 0:Vn.length)>1&&et.createElement(ue.Z,{align:"middle",className:(Vn==null?void 0:Vn.length)>1?"mb30":`${Bt.Z.hide}`},et.createElement(me.default.Item,{name:"is_ordered"},et.createElement(ie,null)),et.createElement(Le.Z,{className:"ml10"},"\u5141\u8BB8\u5B66\u751F\u6BCF\u4E2A\u586B\u7A7A\u7684\u7B54\u6848\u4E0E\u6807\u51C6\u7B54\u6848\u7684\u987A\u5E8F\u4E0D\u4E00\u81F4")),et.createElement("div",{onClick:()=>re(!0)},et.createElement(me.default.Item,{name:"analysis",label:"\u9898\u76EE\u89E3\u6790",labelCol:{span:24}},et.createElement(Te.x,{placeholder:"\u8BF7\u7F16\u8F91\u9898\u76EE\u89E3\u6790\uFF08\u975E\u5FC5\u586B\uFF09",isEdit:Ke}))))}},14289:function(Bn,zn,kt){"use strict";kt.d(zn,{Z:function(){return vt}});var pt=kt(59301),Ut=kt(77019),ue=kt(5269),Le=kt(28284),he=kt(8423),Dt=kt(31457),qt=kt(59301),me=Object.defineProperty,ne=Object.defineProperties,jt=Object.getOwnPropertyDescriptors,Te=Object.getOwnPropertySymbols,se=Object.prototype.hasOwnProperty,Ce=Object.prototype.propertyIsEnumerable,Bt=(St,Et,Tt)=>Et in St?me(St,Et,{enumerable:!0,configurable:!0,writable:!0,value:Tt}):St[Et]=Tt,nt=(St,Et)=>{for(var Tt in Et||(Et={}))se.call(Et,Tt)&&Bt(St,Tt,Et[Tt]);if(Te)for(var Tt of Te(Et))Ce.call(Et,Tt)&&Bt(St,Tt,Et[Tt]);return St},et=(St,Et)=>ne(St,jt(Et)),ht=(St,Et)=>{var Tt={};for(var Ot in St)se.call(St,Ot)&&Et.indexOf(Ot)<0&&(Tt[Ot]=St[Ot]);if(St!=null&&Te)for(var Ot of Te(St))Et.indexOf(Ot)<0&&Ce.call(St,Ot)&&(Tt[Ot]=St[Ot]);return Tt};const st={\u6B63\u786E:"T",\u9519\u8BEF:"F"},gt=({value:St,onChange:Et,form:Tt})=>{const Ot=(St==null?void 0:St.is_answer)===1,$t=St==null?void 0:St.choice_text,Xt=()=>{const Ht=Tt.getFieldsValue().choices.map(ve=>({choice_text:ve.choice_text,is_answer:0}));Tt.setFieldsValue({choices:Ht}),Et(et(nt({},St),{is_answer:1}))};return qt.createElement(Ut.Z,{className:he.Z.choiceWrap,align:"middle",wrap:!1,style:{marginBottom:"20px"}},qt.createElement(ue.Z,{onClick:Xt,className:`${he.Z.choiceIndex} ${he.Z.judgementIndex} ${Ot?he.Z.activeAnswer:""}`},st[$t]),qt.createElement(ue.Z,{flex:1,className:`${he.Z.editorWrap} ml15`},qt.createElement("div",{className:`${he.Z.inputBorder} ${he.Z.placeholder} ${Ot?he.Z.activeJudgementAnswer:""}`},$t)),qt.createElement(ue.Z,{flex:"0 0 auto",className:"ml15"},qt.createElement("div",{onClick:Xt,className:`${he.Z.setAnswerBtn} ${Ot?he.Z.activeAnswer:""}`},Ot?"\u6B63\u786E\u7B54\u6848":"\u8BBE\u4E3A\u7B54\u6848")))},vt=({questionTitlePlaceholder:St,choiceKey:Et,form:Tt})=>{const[Ot,$t]=(0,pt.useState)(!1);return qt.createElement("div",{className:he.Z.wrap},qt.createElement("div",{className:he.Z.questionTitleEditorWrap},qt.createElement(Le.default.Item,{label:"\u9898\u5E72",name:"name",labelCol:{span:24},rules:[{required:!0}]},qt.createElement(Dt.h,{scrollId:"name",watch:!0,height:140,placeholder:St}))),qt.createElement(Le.default.Item,{label:"\u7B54\u6848\u9009\u9879",required:!0,labelCol:{span:24}},qt.createElement(Le.default.List,{name:"choices",rules:[{validator(Xt,Ht){return Ht.some(ie=>(ie==null?void 0:ie.is_answer)===1)?Promise.resolve():Promise.reject(new Error("\u8BF7\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))}}]},Xt=>qt.createElement("div",{id:"choices"},Xt.map(Ht=>{var ve=Ht,{key:ie,name:Ne}=ve,xe=ht(ve,["key","name"]);return qt.createElement(Le.default.Item,et(nt({},xe),{key:ie,name:Ne,noStyle:!0}),qt.createElement(gt,{form:Tt}))})))),qt.createElement("div",{onClick:()=>$t(!0)},qt.createElement(Le.default.Item,{name:"analysis",label:"\u9898\u76EE\u89E3\u6790",labelCol:{span:24}},qt.createElement(Dt.x,{placeholder:"\u8BF7\u7F16\u8F91\u9898\u76EE\u89E3\u6790\uFF08\u975E\u5FC5\u586B\uFF09",isEdit:Ot}))))}},31457:function(Bn,zn,kt){"use strict";kt.d(zn,{h:function(){return nt},x:function(){return et}});var pt=kt(39793),Ut=kt(8423),ue=kt(76902),Le=kt(59301),he=Object.defineProperty,Dt=Object.defineProperties,qt=Object.getOwnPropertyDescriptors,me=Object.getOwnPropertySymbols,ne=Object.prototype.hasOwnProperty,jt=Object.prototype.propertyIsEnumerable,Te=(ht,st,gt)=>st in ht?he(ht,st,{enumerable:!0,configurable:!0,writable:!0,value:gt}):ht[st]=gt,se=(ht,st)=>{for(var gt in st||(st={}))ne.call(st,gt)&&Te(ht,gt,st[gt]);if(me)for(var gt of me(st))jt.call(st,gt)&&Te(ht,gt,st[gt]);return ht},Ce=(ht,st)=>Dt(ht,qt(st)),Bt=(ht,st)=>{var gt={};for(var vt in ht)ne.call(ht,vt)&&st.indexOf(vt)<0&&(gt[vt]=ht[vt]);if(ht!=null&&me)for(var vt of me(ht))st.indexOf(vt)<0&&jt.call(ht,vt)&&(gt[vt]=ht[vt]);return gt};const nt=ht=>{var st=ht,{value:gt,onChange:vt,scrollId:St}=st,Et=Bt(st,["value","onChange","scrollId"]);return Le.createElement("div",{id:St||""},Le.createElement(pt.Z,Ce(se({},Et),{defaultValue:gt,onChange:(Tt,Ot)=>{Ot!=null&&Ot.length?vt(Tt,Ot):vt(Tt)}})))},et=({value:ht,onChange:st,placeholder:gt,height:vt=140,isEdit:St,miniToolbar:Et,watch:Tt=!0})=>St?Le.createElement(pt.Z,{watch:Tt,isFocus:!0,height:vt||void 0,placeholder:gt,defaultValue:ht,onChange:st,miniToolbar:Et}):Le.createElement("div",{style:{cursor:"pointer"}},ht?Le.createElement(ue.Z,{className:Ut.Z.inputBorder,value:ht}):Le.createElement("div",{className:`${Ut.Z.inputBorder} ${Ut.Z.placeholder} inputBorderError`},gt))},44272:function(Bn,zn,kt){"use strict";kt.d(zn,{W:function(){return ve}});var pt=kt(59301),Ut=kt(6767),ue=kt(96599),Le=kt(28284),he=kt(71411),Dt=kt(77019),qt=kt(5269),me=kt(25399),ne=kt(37568),jt=kt(71051),Te=kt(8423),se=kt(31457),Ce=kt(39793),Bt=kt(61485),nt=Object.defineProperty,et=Object.defineProperties,ht=Object.getOwnPropertyDescriptors,st=Object.getOwnPropertySymbols,gt=Object.prototype.hasOwnProperty,vt=Object.prototype.propertyIsEnumerable,St=(ie,Ne,xe)=>Ne in ie?nt(ie,Ne,{enumerable:!0,configurable:!0,writable:!0,value:xe}):ie[Ne]=xe,Et=(ie,Ne)=>{for(var xe in Ne||(Ne={}))gt.call(Ne,xe)&&St(ie,xe,Ne[xe]);if(st)for(var xe of st(Ne))vt.call(Ne,xe)&&St(ie,xe,Ne[xe]);return ie},Tt=(ie,Ne)=>et(ie,ht(Ne)),Ot=(ie,Ne)=>{var xe={};for(var Pe in ie)gt.call(ie,Pe)&&Ne.indexOf(Pe)<0&&(xe[Pe]=ie[Pe]);if(ie!=null&&st)for(var Pe of st(ie))Ne.indexOf(Pe)<0&&vt.call(ie,Pe)&&(xe[Pe]=ie[Pe]);return xe};const $t=ie=>{var Ne=ie,{value:xe,onChange:Pe}=Ne,Qe=Ot(Ne,["value","onChange"]);const _e=an=>{Pe([an])};return pt.createElement(Ce.Z,Tt(Et({},Qe),{defaultValue:xe==null?void 0:xe[0],onChange:_e}))},Xt=ie=>{if(!ie)return!1;if(/^s*$/.test(ie)||ie.trim()===""){Ut.ZP.warning("\u5173\u952E\u8BCD\u4E0D\u80FD\u5168\u4E3A\u7A7A\u683C");return}let Ne=new RegExp("[ `~!@#$^&*()={}':;,\\[\\].<>/?~\uFF01@#\uFFE5\u2026\u2026&*\uFF08\uFF09\u2014\u3010\u3011\u2018\uFF1B\uFF1A\u201D\u201C\u3002\uFF0C\u3001\uFF1F\u300C\u300D\u300E\u300F_\\+\\-\xB7%\u300A\u300B]|[\\\\/]");return ie==="|"?(Ut.ZP.warning("\u5173\u952E\u8BCD\u4E0D\u80FD\u53EA\u8F93\u5165\u4E00\u4E2A\u201C|\u201D\u5B57\u7B26\uFF01"),!1):!0},Ht=({value:ie=[],onClose:Ne})=>pt.createElement(ue.default,{closable:!0,onClose:Ne,className:Te.Z.keywordTag},pt.createElement("pre",{style:{margin:"0px",whiteSpace:"pre-wrap"}},ie.join(" \u6216 "))),ve=({questionTitlePlaceholder:ie,form:Ne,showKeywords:xe,isMustKeyWords:Pe=xe})=>{const[Qe,_e]=(0,pt.useState)(!1),[an,Ke]=(0,pt.useState)(""),re=Le.default.useWatch("use_keywords",Ne),Jt=Le.default.useWatch("question_score",Ne);return pt.createElement("div",{className:Te.Z.wrap},pt.createElement("div",{className:Te.Z.questionTitleEditorWrap},pt.createElement(Le.default.Item,{label:"\u9898\u5E72",name:"name",labelCol:{span:24},rules:[{required:!0}]},pt.createElement(se.h,{scrollId:"name",watch:!0,height:140,placeholder:ie}))),pt.createElement(Le.default.Item,{label:"\u53C2\u8003\u7B54\u6848",name:"answer_texts",labelCol:{span:24}},pt.createElement($t,{watch:!0,height:140,placeholder:"\u8BF7\u7F16\u8F91\u53C2\u8003\u7B54\u6848\uFF08\u975E\u5FC5\u586B\uFF09"})),xe&&!Pe&&pt.createElement(Le.default.Item,{hidden:!0,name:"use_keywords",valuePropName:"checked"},pt.createElement(he.Z,{defaultChecked:!0})),xe&&Pe&&pt.createElement(Dt.Z,{align:"middle",className:"mb30"},pt.createElement(Le.default.Item,{name:"use_keywords",valuePropName:"checked"},pt.createElement(he.Z,null)),pt.createElement(qt.Z,{className:"ml10"},"\u5F00\u542F\u5173\u952E\u8BCD\u81EA\u52A8\u5224\u5206"),pt.createElement(qt.Z,null,pt.createElement(me.Z,{placement:"right",title:"\u9009\u4E2D\u540E\uFF0C\u9700\u8981\u8BBE\u7F6E\u6BCF\u4E2A\u5173\u952E\u8BCD\u7684\u5206\u503C\uFF0C\u7CFB\u7EDF\u4F1A\u6839\u636E\u8BBE\u7F6E\u7684\u5173\u952E\u8BCD\u8FDB\u884C\u81EA\u52A8\u5224\u5206\uFF1B \u6240\u6709\u5173\u952E\u8BCD\u5206\u503C\u4E4B\u548C\u5FC5\u987B\u5C0F\u4E8E\u7B49\u4E8E\u5C0F\u9898\u5206\u503C\u3002"},pt.createElement(Bt.Z,{style:{color:"#3061D0",marginLeft:6,cursor:"pointer"}})))),(re||!Pe)&&pt.createElement(Le.default.List,{name:"keywords",rules:[{validator(Ye,Gn){return Pe?Gn!=null&&Gn.length?(Gn==null?void 0:Gn.reduce((Oe,sn)=>Oe+sn.score,0))>parseFloat(Jt)?Promise.reject(new Error("\u6240\u6709\u5173\u952E\u8BCD\u7684\u5206\u503C\u4E4B\u548C\u5FC5\u987B\u5C0F\u4E8E\u7B49\u4E8E\u8BE5\u5C0F\u9898\u7684\u5206\u503C")):Promise.resolve():Promise.reject(new Error("\u8BF7\u8BBE\u7F6E\u5224\u5206\u5173\u952E\u8BCD")):Promise.resolve()}}]},(Ye,{add:Gn,remove:dn})=>pt.createElement(pt.Fragment,null,pt.createElement("div",{className:`${Te.Z.title} mb10`},Pe?"\u5173\u952E\u8BCD":pt.createElement("span",{style:{color:"#9096A3"}},"\u5224\u5206\u5173\u952E\u8BCD")),pt.createElement(Dt.Z,{align:"middle",className:"font14 mb30"},pt.createElement(qt.Z,{flex:1},pt.createElement(ne.default,{value:an,onChange:Oe=>{Ke(Oe.target.value)},maxLength:50,allowClear:!0,onPressEnter:Oe=>{var sn,ln,Vn,Ae;const yn=`${(sn=Oe.target)==null?void 0:sn.value}`,te=(Vn=(ln=yn==null?void 0:yn.split("|"))==null?void 0:ln.filter(Rt=>!!Rt))==null?void 0:Vn.map(Rt=>Rt==null?void 0:Rt.trim()),En=Ne.getFieldValue("keywords"),ri=((Ae=En==null?void 0:En.map(Rt=>Rt==null?void 0:Rt.keyword))==null?void 0:Ae.flat())||[];for(const Rt of te)if(ri.includes(Rt)){Ut.ZP.error("\u4E3A\u907F\u514D\u5224\u5206\u9519\u8BEF\uFF0C\u8BF7\u52FF\u8BBE\u7F6E\u76F8\u540C\u7684\u5173\u952E\u8BCD");return}Xt(yn)&&(Gn({keyword:te,score:1}),Ke(""))},className:Te.Z.inputBorder,placeholder:"\u652F\u6301\u8BBE\u7F6E\u591A\u4E2A\u5173\u952E\u8BCD\uFF1B\u5E76\u5217\u5173\u952E\u8BCD\uFF08\u6216\u7684\u5173\u7CFB\uFF09\u8BF7\u7528\u201C|\u201D\u5206\u9694\u5F00"})),pt.createElement(qt.Z,{flex:"148px",style:{textAlign:"right",color:"#e99237"}},"\u201C\u56DE\u8F66\u952E\u201D\u4FDD\u5B58\u5173\u952E\u8BCD")),Ye.map(Oe=>{var sn=Oe,{key:ln,name:Vn}=sn,Ae=Ot(sn,["key","name"]);return pt.createElement(Dt.Z,{key:ln,className:"mb20",style:{marginRight:148}},pt.createElement(qt.Z,{flex:1},pt.createElement(Dt.Z,{align:"middle",justify:"space-between"},pt.createElement(Le.default.Item,Tt(Et({},Ae),{name:[Vn,"keyword"]}),pt.createElement(Ht,{onClose:()=>dn(Vn)})),Pe&&pt.createElement(Le.default.Item,Tt(Et({},Ae),{name:[Vn,"score"],label:"\u5206\u503C",rules:[{required:!0}],className:Te.Z.blankInputNumberWrapper}),pt.createElement(jt.Z,{className:Te.Z.blankInput,min:.1,max:100,precision:1,style:{width:"100%"},placeholder:"\u8BF7\u8F93\u5165\u5173\u952E\u8BCD\u5206\u6570"})))))}))),pt.createElement("div",{onClick:()=>_e(!0)},pt.createElement(Le.default.Item,{name:"analysis",label:"\u9898\u76EE\u89E3\u6790",labelCol:{span:24}},pt.createElement(se.x,{placeholder:"\u8BF7\u7F16\u8F91\u9898\u76EE\u89E3\u6790\uFF08\u975E\u5FC5\u586B\uFF09",isEdit:Qe}))))}},77762:function(Bn,zn,kt){"use strict";kt.d(zn,{tc:function(){return Gi.t},uh:function(){return pt.u},rL:function(){return vi},u8:function(){return ue.u},ZZ:function(){return Ut.Z},Wk:function(){return Le.W}});var pt=kt(81727),Ut=kt(14289),ue=kt(92046),Le=kt(44272),he=kt(59301),Dt=kt(8848),qt=kt(28284),me=kt(77019),ne=kt(5269),jt=kt(71051),Te=kt(25399),se=kt(75727),Ce=kt(8423),Bt=kt(12893),nt=kt(31457),et=kt(62957),ht=kt(37568),st=kt(71411),gt=kt(59301),vt=Object.defineProperty,St=Object.defineProperties,Et=Object.getOwnPropertyDescriptors,Tt=Object.getOwnPropertySymbols,Ot=Object.prototype.hasOwnProperty,$t=Object.prototype.propertyIsEnumerable,Xt=(Fn,xn,Tn)=>xn in Fn?vt(Fn,xn,{enumerable:!0,configurable:!0,writable:!0,value:Tn}):Fn[xn]=Tn,Ht=(Fn,xn)=>{for(var Tn in xn||(xn={}))Ot.call(xn,Tn)&&Xt(Fn,Tn,xn[Tn]);if(Tt)for(var Tn of Tt(xn))$t.call(xn,Tn)&&Xt(Fn,Tn,xn[Tn]);return Fn},ve=(Fn,xn)=>St(Fn,Et(xn)),ie=(Fn,xn)=>{var Tn={};for(var ai in Fn)Ot.call(Fn,ai)&&xn.indexOf(ai)<0&&(Tn[ai]=Fn[ai]);if(Fn!=null&&Tt)for(var ai of Tt(Fn))xn.indexOf(ai)<0&&$t.call(Fn,ai)&&(Tn[ai]=Fn[ai]);return Tn};const Ne=({value:Fn,onChange:xn})=>{const Tn=pi=>{et.default.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u53C2\u8003\u7B54\u6848\u5417\uFF1F",className:Ce.Z.modal,onOk:()=>{const ui=[...Fn];ui.splice(pi,1),xn(ui)}})},ai=()=>{const pi=[...Fn];pi.push(""),xn(pi)};return gt.createElement(me.Z,{className:"ml20"},gt.createElement(ne.Z,{flex:1},Fn==null?void 0:Fn.map((pi,ui)=>gt.createElement(me.Z,{key:`${pi}_${ui}`,align:"middle",className:"mb20"},gt.createElement(ht.default.TextArea,{style:{flex:1,minHeight:44},defaultValue:pi,autoSize:{maxRows:3},maxLength:1e3,onBlur:zi=>{const wt=[...Fn],Xe=zi.target.value.trim();wt[ui]=Xe,xn(wt)}}),gt.createElement(Te.Z,{title:"\u5220\u9664"},gt.createElement(Bt.Z,{className:Ce.Z.deleteIcon,style:{marginLeft:15,visibility:ui>0?"visible":"hidden"},onClick:()=>Tn(ui)}))))),gt.createElement(ne.Z,null,gt.createElement("div",{className:`${Ce.Z.addBtn}`,onClick:()=>{ai()}},"\u65B0\u589E\u7B54\u6848")))},xe=({value:Fn=!0,onChange:xn})=>gt.createElement(st.Z,{checked:!Fn,onChange:Tn=>{xn(!Tn)}}),Pe="\u2581",Qe=({questionTitlePlaceholder:Fn,form:xn,name:Tn,scoreByBlank:ai=!1,answerKey:pi,titleKey:ui="name",analysisKey:zi="analysis",isOrdered:wt="is_ordered"})=>{var Xe,Hn;const[Ai,Vi]=(0,he.useState)(!1),dr=(Ln,Kn)=>{const Je=Kn.line;let An=0;for(let Ei=0;Ei<Je;Ei++)An+=Ln.getLine(Ei).split(Pe).length-1;const yi=Ln.getLine(Je).substring(0,Kn.ch);return An+=yi.split(Pe).length-1,An},kr=(Ln,Kn,Je,An)=>{const yi=Ln.getRange(Kn.from,Kn.to);let Ei=0;if(Kn.text.forEach(Xi=>{Ei+=Xi.split(Pe).length-1}),Kn.origin!=="setValue"){if(yi&&yi.indexOf(Pe)!==-1){const Xi=yi.split(Pe).length-1,Gt=dr(Ln,Kn.from);if(console.log(`\u5220\u9664${Xi}\u4E2A\uFF0C \u524D\u9762\u6709${Gt}\u4E2A\uFF0C\u65B0\u589E${Ei}\u4E2A`),Xi>1){const de=Array.from({length:Xi},(un,Mn)=>Gt+Mn);An(de)}else An(Gt)}else if(Ei>0){const Xi=dr(Ln,Kn.from);console.log(`\u65B0\u589E${Ei}\u4E2A\uFF0C\u4E4B\u524D\u6709${Xi}\u4E2A`),Je(Ei,Xi)}}},ci=()=>{const Ln=xn.getFieldValue(["sub_item_banks",...pi]);xn.setFieldValue(["sub_item_banks",...pi],Ln==null?void 0:Ln.map((Kn,Je)=>ve(Ht({},Kn),{position:Je+1})))},In=(0,he.useRef)(),pe=(Ln,Kn)=>{for(let Je=0;Je<Ln;Je++)In.current({position:null,answer_text:[""]},Kn+Je);ci()},Se=(0,he.useRef)(),ye=Ln=>{Se.current(Ln),ci()},jn=(Hn=(Xe=xn.getFieldValue("sub_item_banks"))==null?void 0:Xe[pi==null?void 0:pi[0]])==null?void 0:Hn[pi==null?void 0:pi[1]];return(0,he.useEffect)(()=>{console.log("========",xn.getFieldsValue())},[xn]),gt.createElement("div",{className:Ce.Z.wrap},gt.createElement("div",{className:Ce.Z.questionTitleEditorWrap},gt.createElement(qt.default.Item,{label:"\u9898\u5E72",name:ui,labelCol:{span:24},rules:[{required:!0}]},gt.createElement(nt.h,{scrollId:"name",watch:!0,height:140,placeholder:Fn,showNullButton:!0,onCMBeforeChange:(Ln,Kn)=>{kr(Ln,Kn,pe,ye)}}))),gt.createElement(qt.default.List,{name:pi,rules:[{validator(Ln,Kn){if((Kn==null?void 0:Kn.length)===0)return Promise.reject(new Error("\u8BF7\u5148\u5728\u9898\u5E72\u4E2D\u63D2\u5165\u586B\u7A7A\u9879"));for(const Je of Kn){const{answer_text:An}=Je||{};if(An!=null&&An.some(yi=>(yi==null?void 0:yi.length)===0))return Promise.reject(new Error("\u586B\u7A7A\u9879\u7B54\u6848\u4E0D\u80FD\u4E3A\u7A7A"))}return Promise.resolve()}}]},(Ln,{add:Kn,remove:Je},{errors:An})=>(In.current=Kn,Se.current=Je,gt.createElement(gt.Fragment,null,gt.createElement(qt.default.Item,{label:gt.createElement("span",null,"\u586B\u7A7A\u9879\u7B54\u6848",!(Ln!=null&&Ln.length)&>.createElement("span",{style:{color:"#E99237"}},"\uFF08\u8BF7\u5148\u5728\u9898\u5E72\u4E2D\u63D2\u5165\u586B\u7A7A\u9879\uFF09")),required:!0,labelCol:{span:24}}),Ln.map((yi,Ei)=>{var Xi=yi,{key:Gt,name:de}=Xi,un=ie(Xi,["key","name"]);return gt.createElement(me.Z,{align:"top",key:Gt},gt.createElement(ne.Z,{className:`${Ce.Z.blankIndex} pt5`},"\u586B\u7A7A\u9879",Ei+1),gt.createElement(ne.Z,{flex:1},gt.createElement(me.Z,{align:"top",justify:"space-between"},gt.createElement(ne.Z,{flex:1},gt.createElement(qt.default.Item,ve(Ht({},un),{name:[de,"answer_text"],noStyle:!0}),gt.createElement(Ne,null))),ai&>.createElement(ne.Z,{flex:"224px"},gt.createElement(qt.default.Item,ve(Ht({},un),{name:[de,"score"],label:"\u5206\u503C",rules:[{required:!0}],className:Ce.Z.blankInputNumberWrapper}),gt.createElement(jt.Z,{className:Ce.Z.blankInput,min:.1,max:100,precision:1,style:{width:"100%"},placeholder:"\u6309\u7A7A\u7ED9\u5206\u8BF7\u8F93\u5165\u5206\u503C"})))),gt.createElement(qt.default.Item,ve(Ht({},un),{name:[de,"position"],noStyle:!0}),gt.createElement(ht.default,{type:"hidden"}))))})))),gt.createElement(me.Z,{align:"middle"},gt.createElement(qt.default.Item,{name:[Tn,"downcase"],valuePropName:"checked"},gt.createElement(st.Z,null)),gt.createElement(ne.Z,{className:"ml10"},"\u5224\u5206\u65F6\u5FFD\u7565\u7B54\u6848\u4E2D\u7684\u5B57\u6BCD\u5927\u5C0F\u5199")),gt.createElement(me.Z,{align:"middle"},gt.createElement(qt.default.Item,{name:[Tn,"no_space"],valuePropName:"checked"},gt.createElement(st.Z,null)),gt.createElement(ne.Z,{className:"ml10"},"\u5224\u5206\u65F6\u5FFD\u7565\u7B54\u6848\u4E2D\u7684\u7A7A\u683C")),(jn==null?void 0:jn.length)>1&>.createElement(me.Z,{align:"middle",className:(jn==null?void 0:jn.length)>1?"mb30":`${Ce.Z.hide}`},gt.createElement(qt.default.Item,{name:wt},gt.createElement(xe,null)),gt.createElement(ne.Z,{className:"ml10"},"\u5141\u8BB8\u5B66\u751F\u6BCF\u4E2A\u586B\u7A7A\u7684\u7B54\u6848\u4E0E\u6807\u51C6\u7B54\u6848\u7684\u987A\u5E8F\u4E0D\u4E00\u81F4")),gt.createElement("div",{className:"mt30",onClick:()=>Vi(!0)},gt.createElement(qt.default.Item,{name:zi,label:"\u9898\u76EE\u89E3\u6790",labelCol:{span:24}},gt.createElement(nt.x,{placeholder:"\u8BF7\u7F16\u8F91\u9898\u76EE\u89E3\u6790\uFF08\u975E\u5FC5\u586B\uFF09",isEdit:Ai}))))};var _e=kt(59301),an=Object.defineProperty,Ke=Object.defineProperties,re=Object.getOwnPropertyDescriptors,Jt=Object.getOwnPropertySymbols,Ye=Object.prototype.hasOwnProperty,Gn=Object.prototype.propertyIsEnumerable,dn=(Fn,xn,Tn)=>xn in Fn?an(Fn,xn,{enumerable:!0,configurable:!0,writable:!0,value:Tn}):Fn[xn]=Tn,Oe=(Fn,xn)=>{for(var Tn in xn||(xn={}))Ye.call(xn,Tn)&&dn(Fn,Tn,xn[Tn]);if(Jt)for(var Tn of Jt(xn))Gn.call(xn,Tn)&&dn(Fn,Tn,xn[Tn]);return Fn},sn=(Fn,xn)=>Ke(Fn,re(xn)),ln=(Fn,xn)=>{var Tn={};for(var ai in Fn)Ye.call(Fn,ai)&&xn.indexOf(ai)<0&&(Tn[ai]=Fn[ai]);if(Fn!=null&&Jt)for(var ai of Jt(Fn))xn.indexOf(ai)<0&&Gn.call(Fn,ai)&&(Tn[ai]=Fn[ai]);return Tn};const Vn={\u6B63\u786E:"T",\u9519\u8BEF:"F"},Ae=({value:Fn,onChange:xn,form:Tn,choiceKey:ai})=>{const pi=(Fn==null?void 0:Fn.is_answer)===1,ui=Fn==null?void 0:Fn.choice_text,zi=()=>{var wt;const Xe=(wt=Tn==null?void 0:Tn.getFieldValue(["sub_item_banks",...ai]))==null?void 0:wt.map(Hn=>({choice_text:Hn.choice_text,is_answer:0}));Tn==null||Tn.setFieldValue(["sub_item_banks",...ai],Xe),xn(sn(Oe({},Fn),{is_answer:1}))};return _e.createElement(me.Z,{className:Ce.Z.choiceWrap,align:"middle",wrap:!1},_e.createElement(ne.Z,{onClick:zi,className:`${Ce.Z.choiceIndex} ${Ce.Z.judgementIndex} ${pi?Ce.Z.activeAnswer:""}`},Vn[ui]),_e.createElement(ne.Z,{flex:1,className:`${Ce.Z.editorWrap} ml15`},_e.createElement("div",{className:`${Ce.Z.inputBorder} ${Ce.Z.placeholder} ${pi?Ce.Z.activeJudgementAnswer:""}`},ui)),_e.createElement(ne.Z,{flex:"0 0 auto",className:"ml15"},_e.createElement("div",{onClick:zi,className:`${Ce.Z.setAnswerBtn} ${pi?Ce.Z.activeAnswer:""}`},pi?"\u6B63\u786E\u7B54\u6848":"\u8BBE\u4E3A\u7B54\u6848")))},yn=({questionTitlePlaceholder:Fn,choiceKey:xn="choices",form:Tn,titleKey:ai="name",analysisKey:pi="analysis"})=>{const[ui,zi]=(0,he.useState)(!1);return _e.createElement("div",{className:Ce.Z.wrap},_e.createElement("div",{className:Ce.Z.questionTitleEditorWrap},_e.createElement(qt.default.Item,{label:"\u9898\u5E72",name:ai,labelCol:{span:24},rules:[{required:!0}]},_e.createElement(nt.h,{scrollId:"name",watch:!0,height:140,placeholder:Fn}))),_e.createElement(qt.default.Item,{label:"\u7B54\u6848\u9009\u9879",required:!0,labelCol:{span:24}},_e.createElement(qt.default.List,{name:xn,rules:[{validator(wt,Xe){return Xe.some(Ai=>(Ai==null?void 0:Ai.is_answer)===1)?Promise.resolve():Promise.reject(new Error("\u8BF7\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))}}]},wt=>_e.createElement("div",{id:"choices",style:{display:"flex",flexDirection:"column",gap:"20px"}},wt.map(Xe=>{var Hn=Xe,{key:Ai,name:Vi}=Hn,dr=ln(Hn,["key","name"]);return _e.createElement(qt.default.Item,sn(Oe({},dr),{key:Ai,name:Vi,noStyle:!0}),_e.createElement(Ae,{form:Tn,choiceKey:xn}))})))),_e.createElement("div",{className:"mt30",onClick:()=>zi(!0)},_e.createElement(qt.default.Item,{name:pi,label:"\u9898\u76EE\u89E3\u6790",labelCol:{span:24}},_e.createElement(nt.x,{placeholder:"\u8BF7\u7F16\u8F91\u9898\u76EE\u89E3\u6790\uFF08\u975E\u5FC5\u586B\uFF09",isEdit:ui}))))};var te=kt(6767),En=kt(96599),ri=kt(39793),Rt=kt(61485),Lt=Object.defineProperty,Pt=Object.defineProperties,Nt=Object.getOwnPropertyDescriptors,Zt=Object.getOwnPropertySymbols,Mt=Object.prototype.hasOwnProperty,Yt=Object.prototype.propertyIsEnumerable,Ge=(Fn,xn,Tn)=>xn in Fn?Lt(Fn,xn,{enumerable:!0,configurable:!0,writable:!0,value:Tn}):Fn[xn]=Tn,De=(Fn,xn)=>{for(var Tn in xn||(xn={}))Mt.call(xn,Tn)&&Ge(Fn,Tn,xn[Tn]);if(Zt)for(var Tn of Zt(xn))Yt.call(xn,Tn)&&Ge(Fn,Tn,xn[Tn]);return Fn},Ue=(Fn,xn)=>Pt(Fn,Nt(xn)),we=(Fn,xn)=>{var Tn={};for(var ai in Fn)Mt.call(Fn,ai)&&xn.indexOf(ai)<0&&(Tn[ai]=Fn[ai]);if(Fn!=null&&Zt)for(var ai of Zt(Fn))xn.indexOf(ai)<0&&Yt.call(Fn,ai)&&(Tn[ai]=Fn[ai]);return Tn};const Ee=Fn=>{var xn=Fn,{value:Tn,onChange:ai}=xn,pi=we(xn,["value","onChange"]);const ui=zi=>{ai([zi])};return he.createElement(ri.Z,Ue(De({},pi),{defaultValue:Tn==null?void 0:Tn[0],onChange:ui}))},Fe=Fn=>{if(!Fn)return!1;let xn=new RegExp("[ `~!@#$^&*()={}':;,\\[\\].<>/?~\uFF01@#\uFFE5\u2026\u2026&*\uFF08\uFF09\u2014\u3010\u3011\u2018\uFF1B\uFF1A\u201D\u201C\u3002\uFF0C\u3001\uFF1F\u300C\u300D\u300E\u300F_\\+\\-\xB7%\u300A\u300B]|[\\\\/]");return Fn==="|"?(te.ZP.warning("\u5173\u952E\u8BCD\u4E0D\u80FD\u53EA\u8F93\u5165\u4E00\u4E2A\u201C|\u201D\u5B57\u7B26\uFF01"),!1):!0},He=({value:Fn=[],onClose:xn})=>he.createElement(En.default,{closable:!0,onClose:xn,className:Ce.Z.keywordTag},he.createElement("pre",{style:{margin:"0px",whiteSpace:"pre-wrap"}},Fn.join(" \u6216 "))),qe=({questionTitlePlaceholder:Fn,form:xn,showKeywords:Tn,isMustKeyWords:ai=Tn,titleKey:pi="name",analysisKey:ui="analysis",answerTexts:zi="answer_texts",keywords:wt="keywords",useKeywords:Xe="use_keywords",indexs:Hn})=>{const[Ai,Vi]=(0,he.useState)(!1),[dr,kr]=(0,he.useState)(""),[ci,In]=(0,he.useState)(!1),pe=qt.default.useWatch("question_score",xn);return he.createElement("div",{className:Ce.Z.wrap},he.createElement("div",{className:Ce.Z.questionTitleEditorWrap},he.createElement(qt.default.Item,{label:"\u9898\u5E72",name:pi,labelCol:{span:24},rules:[{required:!0}]},he.createElement(nt.h,{scrollId:"name",watch:!0,height:140,placeholder:Fn}))),he.createElement(qt.default.Item,{label:"\u53C2\u8003\u7B54\u6848",name:zi,labelCol:{span:24}},he.createElement(Ee,{watch:!0,height:140,placeholder:"\u8BF7\u7F16\u8F91\u53C2\u8003\u7B54\u6848\uFF08\u975E\u5FC5\u586B\uFF09"})),Tn&&!ai&&he.createElement(qt.default.Item,{hidden:!0,name:Xe,valuePropName:"checked"},he.createElement(st.Z,{defaultChecked:!0})),Tn&&ai&&he.createElement(me.Z,{align:"middle",className:"mb30"},he.createElement(qt.default.Item,{name:Xe,valuePropName:"checked"},he.createElement(st.Z,{onChange:()=>{var Se,ye,jn,Ln,Kn,Je;console.log(xn.getFieldsValue()),In((jn=(ye=(Se=xn.getFieldsValue())==null?void 0:Se.sub_item_banks)==null?void 0:ye[Hn])==null?void 0:jn.use_keywords),console.log((Je=(Kn=(Ln=xn.getFieldsValue())==null?void 0:Ln.sub_item_banks)==null?void 0:Kn[Hn])==null?void 0:Je.use_keywords),console.log(ci)}})),he.createElement(ne.Z,{className:"ml10"},"\u5F00\u542F\u5173\u952E\u8BCD\u81EA\u52A8\u5224\u5206"),he.createElement(ne.Z,null,he.createElement(Te.Z,{placement:"right",title:"\u9009\u4E2D\u540E\uFF0C\u9700\u8981\u8BBE\u7F6E\u6BCF\u4E2A\u5173\u952E\u8BCD\u7684\u5206\u503C\uFF0C\u7CFB\u7EDF\u4F1A\u6839\u636E\u8BBE\u7F6E\u7684\u5173\u952E\u8BCD\u8FDB\u884C\u81EA\u52A8\u5224\u5206\uFF1B \u6240\u6709\u5173\u952E\u8BCD\u5206\u503C\u4E4B\u548C\u5FC5\u987B\u5C0F\u4E8E\u7B49\u4E8E\u5C0F\u9898\u5206\u503C\u3002"},he.createElement(Rt.Z,{style:{color:"#3061D0",marginLeft:6,cursor:"pointer"}})))),(ci||!ai)&&he.createElement(qt.default.List,{name:wt,rules:[{validator(Se,ye){return ai?ye!=null&&ye.length?(ye==null?void 0:ye.reduce((Ln,Kn)=>Ln+Kn.score,0))>parseFloat(pe)?Promise.reject(new Error("\u6240\u6709\u5173\u952E\u8BCD\u7684\u5206\u503C\u4E4B\u548C\u5FC5\u987B\u5C0F\u4E8E\u7B49\u4E8E\u8BE5\u5C0F\u9898\u7684\u5206\u503C")):Promise.resolve():Promise.reject(new Error("\u8BF7\u8BBE\u7F6E\u5224\u5206\u5173\u952E\u8BCD")):Promise.resolve()}}]},(Se,{add:ye,remove:jn})=>he.createElement(he.Fragment,null,he.createElement("div",{className:`${Ce.Z.title} mb10`},ai?"\u5173\u952E\u8BCD":he.createElement("span",{style:{color:"#9096A3"}},"\u5224\u5206\u5173\u952E\u8BCD")),he.createElement(me.Z,{align:"middle",className:"font14 mb30"},he.createElement(ne.Z,{flex:1},he.createElement(ht.default,{value:dr,onChange:Ln=>{kr(Ln.target.value)},maxLength:50,allowClear:!0,onPressEnter:Ln=>{var Kn,Je,An,yi;const Ei=`${(Kn=Ln.target)==null?void 0:Kn.value}`,Xi=(An=(Je=Ei==null?void 0:Ei.split("|"))==null?void 0:Je.filter(un=>!!un))==null?void 0:An.map(un=>un==null?void 0:un.trim()),Gt=xn.getFieldValue(["sub_item_banks",...wt]),de=((yi=Gt==null?void 0:Gt.map(un=>un==null?void 0:un.keyword))==null?void 0:yi.flat())||[];for(const un of Xi)if(de.includes(un)){te.ZP.error("\u4E3A\u907F\u514D\u5224\u5206\u9519\u8BEF\uFF0C\u8BF7\u52FF\u8BBE\u7F6E\u76F8\u540C\u7684\u5173\u952E\u8BCD");return}Fe(Ei)&&(ye({keyword:Xi,score:1}),kr(""))},className:Ce.Z.inputBorder,placeholder:"\u652F\u6301\u8BBE\u7F6E\u591A\u4E2A\u5173\u952E\u8BCD\uFF1B\u5E76\u5217\u5173\u952E\u8BCD\uFF08\u6216\u7684\u5173\u7CFB\uFF09\u8BF7\u7528\u201C|\u201D\u5206\u9694\u5F00"})),he.createElement(ne.Z,{flex:"148px",style:{textAlign:"right",color:"#e99237"}},"\u201C\u56DE\u8F66\u952E\u201D\u4FDD\u5B58\u5173\u952E\u8BCD")),Se.map(Ln=>{var Kn=Ln,{key:Je,name:An}=Kn,yi=we(Kn,["key","name"]);return he.createElement(me.Z,{key:Je,className:"mb20",style:{marginRight:148}},he.createElement(ne.Z,{flex:1},he.createElement(me.Z,{align:"middle",justify:"space-between"},he.createElement(qt.default.Item,Ue(De({},yi),{name:[An,"keyword"]}),he.createElement(He,{onClose:()=>jn(An)})),ai&&he.createElement(qt.default.Item,Ue(De({},yi),{name:[An,"score"],label:"\u5206\u503C",rules:[{required:!0}],className:Ce.Z.blankInputNumberWrapper}),he.createElement(jt.Z,{className:Ce.Z.blankInput,min:.1,max:100,precision:1,style:{width:"100%"},placeholder:"\u8BF7\u8F93\u5165\u5173\u952E\u8BCD\u5206\u6570"})))))}))),he.createElement("div",{onClick:()=>Vi(!0)},he.createElement(qt.default.Item,{name:ui,label:"\u9898\u76EE\u89E3\u6790",labelCol:{span:24}},he.createElement(nt.x,{placeholder:"\u8BF7\u7F16\u8F91\u9898\u76EE\u89E3\u6790\uFF08\u975E\u5FC5\u586B\uFF09",isEdit:Ai}))))};var cn=kt(59301),gn=Object.defineProperty,ni=Object.defineProperties,ze=Object.getOwnPropertyDescriptors,Ve=Object.getOwnPropertySymbols,nn=Object.prototype.hasOwnProperty,qn=Object.prototype.propertyIsEnumerable,vn=(Fn,xn,Tn)=>xn in Fn?gn(Fn,xn,{enumerable:!0,configurable:!0,writable:!0,value:Tn}):Fn[xn]=Tn,tn=(Fn,xn)=>{for(var Tn in xn||(xn={}))nn.call(xn,Tn)&&vn(Fn,Tn,xn[Tn]);if(Ve)for(var Tn of Ve(xn))qn.call(xn,Tn)&&vn(Fn,Tn,xn[Tn]);return Fn},Rn=(Fn,xn)=>ni(Fn,ze(xn)),gi=(Fn,xn)=>{var Tn={};for(var ai in Fn)nn.call(Fn,ai)&&xn.indexOf(ai)<0&&(Tn[ai]=Fn[ai]);if(Fn!=null&&Ve)for(var ai of Ve(Fn))xn.indexOf(ai)<0&&qn.call(Fn,ai)&&(Tn[ai]=Fn[ai]);return Tn};const{Panel:ti}=Dt.default,vi=({questionTitlePlaceholder:Fn,choiceKey:xn,form:Tn,withScore:ai})=>{const[pi,ui]=(0,he.useState)([]),zi=wt=>{ui(wt)};return cn.createElement("div",{className:Ce.Z.wrap},cn.createElement("div",{className:Ce.Z.questionTitleEditorWrap},cn.createElement(qt.default.Item,{label:"\u9898\u5E72",name:"name",labelCol:{span:24},rules:[{required:!0}]},cn.createElement(nt.h,{scrollId:"name",watch:!0,height:140,placeholder:Fn}))),cn.createElement(qt.default.Item,{label:"\u5C0F\u9898",required:!0,labelCol:{span:24}}),cn.createElement(qt.default.List,{name:"sub_item_banks",rules:[{validator(wt,Xe){return Xe?Promise.resolve():Promise.reject(new Error("\u8BF7\u6DFB\u52A0\u5C0F\u9898"))}}]},(wt,{add:Xe,remove:Hn,move:Ai})=>{const Vi=Tn.getFieldValue("sub_item_banks");return cn.createElement(cn.Fragment,null,cn.createElement(Dt.default,{className:wt.length>0?Ce.Z.collapseWrapper:"",bordered:!1,activeKey:pi,onChange:zi,expandIcon:({isActive:dr})=>cn.createElement("i",{className:`iconfont icon-weizhankai ${dr?Ce.Z.open:Ce.Z.close}`,style:{fontSize:14,transition:"all .2s"}})},wt.map((dr,kr)=>{var ci=dr,{key:In,name:pe}=ci,Se=gi(ci,["key","name"]),ye,jn,Ln,Kn,Je,An,yi,Ei,Xi,Gt;return cn.createElement(ti,{className:Ce.Z.panel,forceRender:!0,header:cn.createElement("div",{className:Ce.Z.panelHeader},"\u7B2C",kr+1,"\u5C0F\u9898",cn.createElement("span",null,"\uFF08",((ye=Vi==null?void 0:Vi[pe])==null?void 0:ye.item_type)=="SINGLE"?"\u5355\u9009\u9898":((jn=Vi==null?void 0:Vi[pe])==null?void 0:jn.item_type)=="MULTIPLE"?"\u591A\u9009\u9898":((Ln=Vi==null?void 0:Vi[pe])==null?void 0:Ln.item_type)=="COMPLETION"?"\u586B\u7A7A\u9898":((Kn=Vi==null?void 0:Vi[pe])==null?void 0:Kn.item_type)=="JUDGMENT"?"\u5224\u65AD\u9898":"\u7B80\u7B54\u9898","\uFF09")),key:pe,extra:cn.createElement(me.Z,{align:"middle",onClick:de=>de.stopPropagation()},ai&&cn.createElement(ne.Z,null,cn.createElement(qt.default.Item,Rn(tn({},Se),{rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5C0F\u9898\u5206\u503C"}],label:"\u5206\u503C",name:[pe,"question_score"],className:Ce.Z.blankInputNumberWrapper}),cn.createElement(jt.Z,{className:Ce.Z.blankInput,placeholder:"\u8BF7\u8F93\u5165\u5F53\u524D\u5C0F\u9898\u5206\u6570",min:.1,precision:1,max:100,style:{width:150}}))),cn.createElement(ne.Z,null,cn.createElement(me.Z,{align:"middle",className:"pl40",justify:"end"},kr!==0&&cn.createElement("div",{onClick:()=>{var de;Ai(kr,kr-1);const un=(de=Tn.getFieldValue("sub_item_banks"))==null?void 0:de.map((Mn,Ie)=>(wt.map(($e,bn)=>{Ie===bn&&(Mn.q_position=Number($e.name)+1)}),Mn));Tn.setFieldValue("sub_item_banks",un)}},cn.createElement(Te.Z,{title:"\u4E0A\u79FB"},cn.createElement("i",{className:"iconfont icon-shangyi3 c-grey-999 primary-hover"}))),kr<wt.length-1&&cn.createElement("div",{onClick:()=>{var de;Ai(kr,kr+1);const un=(de=Tn.getFieldValue("sub_item_banks"))==null?void 0:de.map((Mn,Ie)=>(wt.map(($e,bn)=>{Ie===bn&&(Mn.q_position=Number($e.name)+1)}),Mn));Tn.setFieldValue("sub_item_banks",un)},className:kr===0?"":"ml15"},cn.createElement(Te.Z,{title:"\u4E0B\u79FB"},cn.createElement("i",{className:"iconfont icon-xiayi3 c-grey-999 primary-hover"}))))),cn.createElement(ne.Z,null,cn.createElement(Te.Z,{title:"\u5220\u9664"},cn.createElement(Bt.Z,{className:`${Ce.Z.deleteIcon} ml15`,onClick:()=>Hn(pe)}))))},cn.createElement(qt.default.Item,Rn(tn({},Se),{name:pe}),(((Je=Vi==null?void 0:Vi[pe])==null?void 0:Je.item_type)=="SINGLE"||((An=Vi==null?void 0:Vi[pe])==null?void 0:An.item_type)=="MULTIPLE")&&cn.createElement(pt.u,{questionTitlePlaceholder:"\u8BF7\u7F16\u8F91\u9009\u62E9\u9898\u9898\u5E72\u5185\u5BB9",allowChangeMode:((yi=Vi==null?void 0:Vi[pe])==null?void 0:yi.item_type)=="MULTIPLE",form:Tn,choiceKey:[pe,"choices"],titleKey:[pe,"name"],analysisKey:[pe,"analysis"],choiceOptionsPath:["sub_item_banks",pe,"choices"],choiceTextKey:"choice_text",answerKey:"is_answer"}),((Ei=Vi==null?void 0:Vi[pe])==null?void 0:Ei.item_type)=="COMPLETION"&&cn.createElement(Qe,{form:Tn,questionTitlePlaceholder:"\u8BF7\u7F16\u8F91\u9898\u5E72\u5E76\u8BBE\u7F6E\u586B\u7A7A\u9879",scoreByBlank:!1,name:pe,titleKey:[pe,"name"],analysisKey:[pe,"analysis"],isOrdered:[pe,"is_ordered"],answerKey:[pe,"standard_answers"]}),((Xi=Vi==null?void 0:Vi[pe])==null?void 0:Xi.item_type)=="JUDGMENT"&&cn.createElement(yn,{form:Tn,questionTitlePlaceholder:"\u8BF7\u7F16\u8F91\u5224\u65AD\u9898\u9898\u5E72\u5185\u5BB9",titleKey:[pe,"name"],analysisKey:[pe,"analysis"],choiceKey:[pe,"choices"]}),((Gt=Vi==null?void 0:Vi[pe])==null?void 0:Gt.item_type)=="SUBJECTIVE"&&cn.createElement(qe,{showKeywords:!0,isMustKeyWords:!1,form:Tn,titleKey:[pe,"name"],analysisKey:[pe,"analysis"],answerTexts:[pe,"answer_texts"],useKeywords:[pe,"use_keywords"],keywords:[pe,"keywords"],indexs:pe,questionTitlePlaceholder:"\u8BF7\u7F16\u8F91\u7B80\u7B54\u9898\u9898\u5E72\u5185\u5BB9"})))})),wt.length<20&&cn.createElement(se.Z,{menu:{items:[{label:cn.createElement("div",{onClick:()=>{Xe({name:"",choices:Array.from({length:4},()=>({choice_text:"",is_answer:0})),analysis:"",item_type:"SINGLE"}),ui([wt==null?void 0:wt.length,...pi])}},"\u5355\u9009\u9898"),key:"1",show:!0},{label:cn.createElement("div",{onClick:()=>{Xe({name:"",choices:Array.from({length:4},()=>({choice_text:"",is_answer:0})),analysis:"",item_type:"MULTIPLE"}),ui([wt==null?void 0:wt.length,...pi])}},"\u591A\u9009\u9898"),key:"2",show:!0},{label:cn.createElement("div",{onClick:()=>{Xe({name:"",choices:[{choice_text:"\u6B63\u786E",is_answer:0},{choice_text:"\u9519\u8BEF",is_answer:0}],analysis:"",item_type:"JUDGMENT"}),ui([wt==null?void 0:wt.length,...pi])}},"\u5224\u65AD\u9898"),key:"3",show:!0},{label:cn.createElement("div",{onClick:()=>{Xe({name:"",analysis:"",is_ordered:!0,standard_answers:[],item_type:"COMPLETION",downcase:!0,no_space:!0}),ui([wt==null?void 0:wt.length,...pi])}},"\u586B\u7A7A\u9898"),key:"4",show:!0},{label:cn.createElement("div",{onClick:()=>{Xe({name:"",answer_texts:[],keywords:[],use_keywords:!0,analysis:"",item_type:"SUBJECTIVE"}),ui([wt==null?void 0:wt.length,...pi])}},"\u7B80\u7B54\u9898"),key:"5",show:!0}].filter(dr=>dr.show).map(dr=>({label:dr.label,key:dr.key}))}},cn.createElement("div",{className:`${Ce.Z.addBtn}`},"\u6DFB\u52A0\u5C0F\u9898")))}))};var Gi=kt(68571)},76902:function(Bn,zn,kt){"use strict";kt.d(zn,{z:function(){return $t},Z:function(){return Xt}});var pt=kt(59301),Ut=kt(8944),ue=kt(81428),Le=kt(64018),he=kt(79710),Dt=kt(346),qt=kt(51257),me=kt(15342),ne=kt(1012),jt=kt(45677),Te=kt(59301),Ce=({html:Ht})=>{const ve=(0,pt.useRef)(null),ie=(0,pt.useRef)(null),Ne=`.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,pt.useEffect)(()=>{const xe=ve.current.attachShadow({mode:"open"});ie.current=document.createElement("div"),ie.current.className="markdown-body",ie.current.innerHTML=Ht,xe.appendChild(ie.current);const Pe=document.createElement("style");return Pe.textContent=Ne,xe.appendChild(Pe),()=>{xe.innerHTML=""}},[]),(0,pt.useEffect)(()=>{ie.current&&(ie.current.innerHTML=Ht)},[Ht]),Te.createElement("div",{ref:ve})};function Bt(Ht){const ve=["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"],ie=new RegExp(`\\b(${ve.join("|")})\\s*=\\s*(?:"[^"]*"|'[^']*'|[^\\s>]*)`,"gi");return Ht.replace(ie,"").trim()}var nt=Object.defineProperty,et=Object.getOwnPropertySymbols,ht=Object.prototype.hasOwnProperty,st=Object.prototype.propertyIsEnumerable,gt=(Ht,ve,ie)=>ve in Ht?nt(Ht,ve,{enumerable:!0,configurable:!0,writable:!0,value:ie}):Ht[ve]=ie,vt=(Ht,ve)=>{for(var ie in ve||(ve={}))ht.call(ve,ie)&>(Ht,ie,ve[ie]);if(et)for(var ie of et(ve))st.call(ve,ie)&>(Ht,ie,ve[ie]);return Ht};const St="@\u2581\u2581@",Et="@\u2581@",Tt=/<pre[^>]*>/g;function Ot(Ht){let ve=document.createElement("div");return ve.innerHTML=Ht,ve.childNodes.length===0?"":ve.childNodes[0].nodeValue}const $t=(Ht,ve)=>{Ht=Ht||"";const ie=/(?:https?:\/\/[^\/]+)?\/api\/attachments\/([A-Za-z0-9+/=]+)(\?.*?)?\)|(?:https?:\/\/[^\/]+)?\/api\/attachments\/([A-Za-z0-9+/=]+)(\?.*?)?|(?:https?:\/\/[^\/]+)?\/attachments\/download\/([A-Za-z0-9+/=]+)(\?.*?)?\//g,Ne=/\"(?:https?:\/\/[^\/]+)?\/api\/attachments\/([A-Za-z0-9+/=]+)(\?.*?)?|\"(?:https?:\/\/[^\/]+)?\/attachments\/download\/([A-Za-z0-9+/=]+)(\?.*?)?\//g,xe=/\(\s+(?:https?:\/\/[^\/]+)?\/files\/uploads\/([A-Za-z0-9+/=]+)(\?.*?)?|\"(?:https?:\/\/[^\/]+)?\/files\/uploads\/([A-Za-z0-9+/=]+)(\?.*?)?\//g,Pe=/(?:https?:\/\/[^\/]+)?\/attachments\/download\/([A-Za-z0-9+/=]+)(\?.*?)?\//g;return ve?Ht.replaceAll("https://www.educoder.net","").replaceAll("https://www-cdn.educoder.net","").replaceAll("//api/attachments","/api/attachments").replace(ie,(Qe,_e,an,Ke,re,Jt,Ye)=>{const Gn=_e||Ke||Jt,dn=an||re||Ye||"?";return Dt.Z.API_SERVER+"/api/attachments/"+Gn+dn+"&t="+(0,qt.Jn)(Gn,Date.now())+(Qe.indexOf(")")>-1?")":"&")}).replaceAll('src="(','src="').replaceAll("src='(",'src="'):(Ht=Ht.replace(Pe,(Qe,_e,an,Ke,re,Jt,Ye)=>{const Gn=_e||Ke||Jt,dn=an||re||Ye||"?";return Dt.Z.API_SERVER+"/attachments/download/"+Gn+dn+"&t="+(0,qt.Jn)(Gn,Date.now())+(Qe.indexOf(")")>-1?")":"&")}).replace(ie,(Qe,_e,an,Ke,re,Jt,Ye)=>{const Gn=_e||Ke||Jt,dn=an||re||Ye||"?";return Dt.Z.API_SERVER+"/api/attachments/"+Gn+dn+"&t="+(0,qt.Jn)(Gn,Date.now())+(Qe.indexOf(")")>-1?")":"&")}).replace(Ne,(Qe,_e,an,Ke,re)=>{const Jt=_e||Ke,Ye=an||re||"";return'"'+Dt.Z.API_SERVER+"/api/attachments/"+Jt+Ye+Jt+Ye+"&t="+(0,qt.Jn)(Jt,Date.now())}).replace(xe,(Qe,_e,an,Ke,re)=>{const Jt=_e||Ke,Ye=an||re||"";return"("+Dt.Z.API_SERVER+"/files/uploads/"+Jt+Ye+Jt+Ye+"&t="+(0,qt.Jn)(Jt,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,`
|
|
`),Ht)};var Xt=({value:Ht="",className:ve,showTextOnly:ie,showLines:Ne,style:xe={},stylesPrev:Pe={},highlightKeywords:Qe,showProgramFill:_e,isProgramFill:an,disabledFill:Ke=!1,programFillValue:re,onFillChange:Jt=dn=>{},onFillBlur:Ye=()=>{},onFillFocus:Gn=()=>{}})=>{let dn=Bt(String(Ht||""));const[Oe,sn]=(0,pt.useState)(""),[ln,Vn]=(0,pt.useState)("office"),[Ae,yn]=(0,pt.useState)([]),te=(0,pt.useRef)("a"+(0,ne.Z)()),En={},ri=Ee=>/<style[\s\S]*?>/i.test(Ee||""),Rt=(Ee,Fe,He)=>{const qe=document.createElement(Ee===Et?"input":"textarea");qe.style.width="100%",qe.style.height=Ee===Et?"40px":"151px",qe.rows=5,qe.spellcheck=!1,qe.name="edu-program-fill",qe.placeholder="\u8BF7\u8F93\u5165",qe.dataset.id=Fe;const cn=Object.keys(En).length;return En[cn]=qe,`<span class="edu-program-fill-wrap ${Ee===Et?"":"show"}" style="width:${Ee===Et?"400px":"100%"}" title=${He||""}><span>${qe.outerHTML}<span class="edu-program-fill-score" style="margin:0 6px"></span></span></span>`};function Lt(Ee){return Ee=Ee.replace(/!\[.*?\]\(.*?\)/g,""),Ee=Ee.replace(/\[.*?\]\(.*?\)/g,""),Ee=Ee.replace(new RegExp("<iframe.*?<\\/iframe>","gs"),""),Ee=Ee.replace(/<embed.*?>/g,""),Ee=Ee.replace(/<img.*?>/g,""),Ee=Ee.replace(new RegExp("<video.*?>.*?<\\/video>","gs"),""),Ee=Ee.replace(new RegExp("<audio.*?>.*?<\\/audio>","gs"),""),Ee=Ee.replace(new RegExp("<style.*?>.*?<\\/style>","gs"),""),Ee=Ee.replace(new RegExp("<script.*?>.*?<\\/script>","gs"),""),Ee}const Pt=Ee=>!ie&&ri(dn)?Ee:Ee.replace(/<style.*?>([\s\S]+?)<\/style>/gim,function(Fe,He){let qe=He.replace(/(\n|\r)/g,"").split("}"),cn=[];return qe.map(gn=>{gn!=""&&cn.push(`.${te.current} ${gn}`)}),`<style>${cn.join("}")}</style>`}),Nt=(0,pt.useMemo)(()=>{try{const qe=/\(\s+\/api\/attachments\/|\(\/api\/attachments\//g,cn=/\"\/api\/attachments\/|\"\/attachments\/download\//g,gn=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g,ni=/\(\/attachments\/download\//g;dn=dn.replace(ni,"("+Dt.Z.API_SERVER+"/attachments/download/").replace(qe,"("+Dt.Z.API_SERVER+"/api/attachments/").replace(cn,'"'+Dt.Z.API_SERVER+"/api/attachments/").replace(gn,'"'+Dt.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(qe){}if(_e){let qe=-1;return dn=dn.replaceAll("<","<").replaceAll(">",">").replace(/(@▁▁@|@▁@)/g,function(cn,gn,ni){var ze;return++qe,Rt(cn,qe,(ze=re==null?void 0:re[qe])==null?void 0:ze.value.replaceAll("<","<").replaceAll(">",">"))}),`<pre style="background:#fff;padding:4px">${Pt(dn||"")}</pre>`}let Ee=Pt(dn);Ee=(0,ue.ZP)(Ee);const Fe=(0,ue.ez)();dn.match(/\[TOC\]/)&&(Ee=Ee.replace("<p>[TOC]</p>",(0,ue.Qv)()),(0,ue.Iy)()),Ee=Ee.replace(/(__special_katext_id_\d+__)/g,(qe,cn)=>{const{type:gn,expression:ni}=Fe[cn];return(0,me.renderToString)(Ot(ni)||"",{displayMode:gn==="block",throwOnError:!1,output:"html"})}),Ee=Ee.replace(/▁/g,"\u2581\u2581\u2581\u2581\u2581"),(0,ue.AL)();const He=document.createElement("div");if(He.innerHTML=Ee,ie)return He.innerText;if(Qe){const qe=Qe.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return Ge(He,qe),He.innerHTML}return setTimeout(()=>we(),500),He.innerHTML},[dn,Qe]);(0,pt.useEffect)(()=>{De.current&&De.current.querySelectorAll(["input","textarea"]).forEach(Fe=>{Fe.oninput=Zt,Fe.onblur=Mt,Fe.onfocus=Yt})},[Ae]),(0,pt.useEffect)(()=>{var Ee,Fe,He,qe,cn;if(re!=null&&re.length)try{const gn=De.current.querySelectorAll(".edu-program-fill-score"),ni=De.current.querySelectorAll('[name="edu-program-fill"]');for(const[ze,Ve]of ni.entries())Ve.value=((Ee=re==null?void 0:re[ze])==null?void 0:Ee.value)||"",((Fe=re==null?void 0:re[ze])==null?void 0:Fe.type)==="warning"?Ve.className="program-fill-warning":((He=re==null?void 0:re[ze])==null?void 0:He.type)==="success"?Ve.className="program-fill-success":Ve.className="";for(const[ze,Ve]of gn.entries())Ve.innerHTML=(qe=re==null?void 0:re[ze])!=null&&qe.score?`${(cn=re==null?void 0:re[ze])==null?void 0:cn.score}\u5206`:"";yn(re)}catch(gn){console.log(gn,"error")}},[re]);const Zt=Ee=>{Ae[Ee.target.dataset.id]=Ae[Ee.target.dataset.id]||{},Ae[Ee.target.dataset.id].value=Ee.target.value,yn([...Ae]),Jt(Ae,Ee.target.dataset.id)},Mt=Ee=>{Ae[Ee.target.dataset.id]=Ae[Ee.target.dataset.id]||{},Ae[Ee.target.dataset.id].value=Ee.target.value,yn([...Ae]),Ye(Ae,Ee.target.dataset.id)},Yt=Ee=>{Ae[Ee.target.dataset.id]=Ae[Ee.target.dataset.id]||{},Ae[Ee.target.dataset.id].value=Ee.target.value,yn([...Ae]),Gn(Ae,Ee.target.dataset.id)};function Ge(Ee,Fe){return Ee.childNodes.forEach(He=>{var qe;if(He.childNodes.length>0)Ge(He,Fe);else if(He.nodeName!=="IMG")if(He.innerHTML)He.innerHTML=(qe=He.innerHTML)==null?void 0:qe.replace(new RegExp(Fe,"gi"),'<span style="color:#0152d9;background-color:#1890ff33">$&</span>');else{const cn=document.createElement("span");cn.innerHTML=He.textContent.replace(new RegExp(Fe,"gi"),'<span style="color:#0152d9;background-color:#1890ff33">$&</span>'),He.replaceWith(cn)}})}const De=(0,pt.useRef)();ue.jb.WebkitLineClamp=Ne,Ne&&(xe=vt(vt({},xe),ue.jb));function Ue(Ee){let Fe=Ee.target;if(Fe.tagName.toUpperCase()==="A"){let He=Fe.getAttribute("href");if(He.indexOf("office")>-1)Ee.preventDefault(),sn(He),Vn("office");else if(He.indexOf("application/pdf")>-1)Ee.preventDefault(),sn(He),Vn("pdf");else if(He.indexOf("text/html")>-1)Ee.preventDefault(),sn(He),Vn("html");else if(He.startsWith("#")){Ee.preventDefault();let qe=document.getElementById(He.replace("#",""));qe&&qe.scrollIntoView(!0)}}}const we=()=>{var Ee;const Fe=(Ee=De.current)==null?void 0:Ee.querySelectorAll("video");Fe==null||Fe.forEach(He=>{if(He.oncontextmenu=()=>!1,He.src.indexOf(".m3u8")>-1&&!He.canPlayType("application/vnd.apple.mpegurl")){if(he.ZP.isSupported()){var qe=new he.ZP;qe.loadSource(He.src),qe.attachMedia(He)}}})};return(0,pt.useEffect)(()=>{if(De.current&&Nt&&Nt.match(Tt)&&window.PR.prettyPrint(),De.current)return De.current.addEventListener("click",Ue),()=>{var Ee;(Ee=De.current)==null||Ee.removeEventListener("click",Ue),(0,ue.AL)(),(0,ue.Iy)()}},[Nt,De.current,Ue]),(0,pt.useEffect)(()=>{var Ee;const Fe=He=>{He.preventDefault(),He.clipboardData.setData("text",window.getSelection().toString())};return(Ee=De.current)==null||Ee.addEventListener("copy",Fe),()=>{var He;(He=De.current)==null||He.removeEventListener("copy",Fe)}},[De.current]),pt.createElement(pt.Fragment,null,ie&&pt.createElement("div",{ref:De},Nt),!ie&&!ri(Nt)&&pt.createElement("div",{ref:De,style:vt({},xe),className:`${ve||""} ${Ke?"disabled-fill":""} markdown-body ${te.current}`,dangerouslySetInnerHTML:{__html:Nt}}),!ie&&ri(Nt)&&pt.createElement(Ce,{html:Nt}),pt.createElement(jt.Z,{close:!0,data:Oe,type:Oe!=null&&Oe.length?ln:"",style:vt({},Pe),onClose:()=>sn("")}))}},60572:function(Bn,zn,kt){"use strict";kt.d(zn,{C:function(){return Qe}});var pt=kt(59301),Ut={recalculation:"recalculation____i9AE",tips:"tips___GoMu8",filter:"filter___Vx7VO",input:"input___OEMMv",operating:"operating___TS9iA",operatingItem:"operatingItem___AT84q"},ue=kt(92310),Le=kt.n(ue),he=kt(62673),Dt=kt(77019),qt=kt(6767),me=kt(25399),ne=kt(99571),jt=kt(62957),Te=kt(54172),se=kt(71051),Ce=kt(28284),Bt=kt(29787),nt=kt(51257),et=kt(38986),ht=kt(48790),st=kt(54650),gt=kt(45775),vt=Object.defineProperty,St=Object.defineProperties,Et=Object.getOwnPropertyDescriptors,Tt=Object.getOwnPropertySymbols,Ot=Object.prototype.hasOwnProperty,$t=Object.prototype.propertyIsEnumerable,Xt=(_e,an,Ke)=>an in _e?vt(_e,an,{enumerable:!0,configurable:!0,writable:!0,value:Ke}):_e[an]=Ke,Ht=(_e,an)=>{for(var Ke in an||(an={}))Ot.call(an,Ke)&&Xt(_e,Ke,an[Ke]);if(Tt)for(var Ke of Tt(an))$t.call(an,Ke)&&Xt(_e,Ke,an[Ke]);return _e},ve=(_e,an)=>St(_e,Et(an)),ie=(_e,an,Ke)=>new Promise((re,Jt)=>{var Ye=Oe=>{try{dn(Ke.next(Oe))}catch(sn){Jt(sn)}},Gn=Oe=>{try{dn(Ke.throw(Oe))}catch(sn){Jt(sn)}},dn=Oe=>Oe.done?re(Oe.value):Promise.resolve(Oe.value).then(Ye,Gn);dn((Ke=Ke.apply(_e,an)).next())});const Ne=he.default.Group,xe=({className:_e,title:an,items:Ke=[],value:re,onChange:Jt})=>{const Ye=(Ke==null?void 0:Ke.length)===(re==null?void 0:re.length),Gn=(re==null?void 0:re.length)>0&&(re==null?void 0:re.length)<(Ke==null?void 0:Ke.length),dn=Oe=>{const sn=Ke.map(ln=>ln.id);Jt(Oe.target.checked?sn:[])};return pt.createElement(Dt.Z,{align:"middle",className:_e},!!an&&pt.createElement("div",{className:"mr20",style:{color:"#5F6368"}},an),pt.createElement(he.default,{indeterminate:Gn,onChange:dn,checked:Ye},"\u5168\u90E8"),pt.createElement(Ne,{value:re,onChange:Jt},Ke.map(Oe=>pt.createElement(he.default,{className:"ml30 c-black",key:Oe.id,value:Oe.id},Oe.name,pt.createElement("span",null,`(${Oe.count})`)))))};var Qe=({className:_e,style:an,dataSource:Ke})=>{var re,Jt,Ye,Gn,dn,Oe,sn;const[ln,Vn]=(0,pt.useState)({}),[Ae,yn]=(0,pt.useState)(!0),[te,En]=(0,pt.useState)(!1),[ri,Rt]=(0,pt.useState)(!1),[Lt,Pt]=(0,pt.useState)(null),[Nt,Zt]=(0,pt.useState)(0),[Mt,Yt]=(0,pt.useState)({}),[Ge,De]=(0,pt.useState)(!0),[Ue,we]=(0,pt.useState)(0),[Ee,Fe]=(0,pt.useState)(0),[He,qe]=(0,pt.useState)(!1),cn=(0,pt.useRef)(null),[gn,ni]=(0,pt.useState)(!1),[ze,Ve]=(0,pt.useState)(!0),[nn,qn]=(0,pt.useState)([]),vn={page:1,per_page:5,keyword:"",review:[],question_status:[],success_status:[],sort_by:null,direction:null},[tn,Rn]=(0,pt.useState)(Ht({},vn));(0,pt.useEffect)(()=>{Ke!=null&&Ke.question_id&&Vn(Ke)},[Ke==null?void 0:Ke.question_id]),(0,pt.useEffect)(()=>{var Xe;if(((Xe=ln==null?void 0:ln.exercise_question_resubmit)==null?void 0:Xe.status)==="running"){const Hn=setInterval(()=>{vi()},3e3);return()=>clearInterval(Hn)}},[(re=ln==null?void 0:ln.exercise_question_resubmit)==null?void 0:re.status]),(0,pt.useEffect)(()=>{var Xe;ri&&(ri===1&&(tn.question_status=Gi.map(Hn=>Hn.value),tn.review=Fn.map(Hn=>Hn.value)),ri===2&&(tn.exercise_question_resubmit_id=(Xe=ln==null?void 0:ln.exercise_question_resubmit)==null?void 0:Xe.id,Lt===1&&(tn.success_status=[1]),Lt===2&&(tn.success_status=[0])),Rn(Ht({},tn)),gi(tn),Fe(ln!=null&&ln.is_mirror?3:10),we(ln!=null&&ln.is_mirror?1:5))},[ri]),(0,pt.useEffect)(()=>{gn&&ti()},[gn]);const gi=Xe=>ie(void 0,null,function*(){yn(!0);const Hn=yield(0,et.ZP)(`/api/exercise_questions/${ln==null?void 0:ln.question_id}/resubmit_student_list.json`,{method:"get",params:Xe});(Hn==null?void 0:Hn.status)==0&&(Yt(Hn||[]),Zt(Hn==null?void 0:Hn.count)),yn(!1)}),ti=()=>ie(void 0,null,function*(){Ve(!0);const Xe=yield(0,et.ZP)(`/api/exercise_questions/${ln==null?void 0:ln.question_id}/resubmit_history.json`,{method:"get"});(Xe==null?void 0:Xe.status)==0&&qn((Xe==null?void 0:Xe.data)||[]),Ve(!1)}),vi=()=>ie(void 0,null,function*(){const Xe=yield(0,et.ZP)(`/api/exercise_questions/${ln==null?void 0:ln.question_id}/resubmit_status.json`,{method:"get"});(Xe==null?void 0:Xe.status)==0&&Vn(ve(Ht({},ln),{show_resubmit_history:!0,exercise_question_resubmit:(Xe==null?void 0:Xe.data)||{}}))}),Gi=[{label:"\u672A\u8BC4\u6D4B",value:2,color:"#9096A3"},{label:"\u672A\u901A\u5173",value:0,color:"#E30000"},{label:"\u5DF2\u901A\u5173",value:1,color:"#00B187"}],Fn=[{label:"\u672A\u8BC4\u9605",value:0,color:"#9096A3"},{label:"\u8BC4\u9605\u4E2D",value:2,color:"#FF9D18"},{label:"\u5DF2\u8BC4\u9605",value:1,color:"#3061D0"}],xn=[{label:"\u6210\u529F",value:1,color:"#00B187"},{label:"\u5931\u8D25",value:0,color:"#E30000"}],Tn=[{title:"\u5E8F\u53F7",dataIndex:"key",render:(Xe,Hn,Ai)=>pt.createElement("span",{className:"c-black"},Ai+1+(tn.page-1)*tn.per_page)},{title:"\u59D3\u540D",dataIndex:"user_name",render:Xe=>pt.createElement("span",{className:"c-black"},Xe)},{title:"\u5B66\u53F7",dataIndex:"student_id",sorter:!0,render:Xe=>pt.createElement("span",{className:"c-grey-666"},Xe||"--")},{title:"\u5206\u73ED",dataIndex:"group_name",render:Xe=>pt.createElement("span",{className:"c-black"},Xe)},{title:"\u9898\u76EE\u72B6\u6001",dataIndex:"question_status",render:Xe=>{const{label:Hn,color:Ai}=Gi.find(Vi=>Vi.value===Xe)||{};return pt.createElement("span",{style:{color:Ai}},Hn)}},{title:"\u9898\u76EE\u5F97\u5206",dataIndex:"question_score",sorter:!0,render:Xe=>pt.createElement("span",{className:"c-black"},Xe)},{title:"\u6700\u7EC8\u6210\u7EE9",dataIndex:"score",sorter:!0,render:Xe=>pt.createElement("span",{className:"c-black"},Xe)},{title:"\u8BC4\u9605\u72B6\u6001",dataIndex:"review",render:Xe=>{const{label:Hn,color:Ai}=Fn.find(Vi=>Vi.value===Xe)||{};return pt.createElement("span",{style:{color:Ai}},Hn)}},ri===2&&{title:"\u91CD\u65B0\u8BC4\u6D4B\u7ED3\u679C",dataIndex:"success_status",render:Xe=>{const{label:Hn,color:Ai}=xn.find(Vi=>Vi.value===Xe)||{};return pt.createElement("span",{style:{color:Ai}},Hn)}}].filter(Boolean),ai=(Xe,Hn,Ai)=>{tn.page=Xe==null?void 0:Xe.current,tn.per_page=Xe==null?void 0:Xe.pageSize,Ai!=null&&Ai.order?(tn.sort_by=Ai==null?void 0:Ai.field,tn.direction=(Ai==null?void 0:Ai.order)==="ascend"?"asc":"desc"):(tn.sort_by=null,tn.direction=null),Rn(Ht({},tn)),gi(tn)},pi=()=>{if(!Ue){qt.ZP.warning("\u8BF7\u8F93\u5165\u91CD\u65B0\u8BC4\u6D4B\u4EFB\u52A1\u5E76\u53D1\u4EBA\u6570");return}qe(!0)},ui=()=>ie(void 0,null,function*(){var Xe,Hn;if((Xe=cn.current)!=null&&Xe.onVerify())return;En(!0);const Ai=yield(0,et.ZP)(`/api/exercise_questions/${ln==null?void 0:ln.question_id}/resubmit.json`,{method:"post",body:{keyword:tn.keyword,question_status:tn.question_status,review:tn.review_status,success_status:tn.success_status,use_max_score:Ge,permits:Ue,exercise_question_resubmit_id:ri===1?null:(Hn=ln==null?void 0:ln.exercise_question_resubmit)==null?void 0:Hn.id}});(Ai==null?void 0:Ai.status)==0&&(yield vi(),qt.ZP.success("\u64CD\u4F5C\u6210\u529F"),qe(!1),Rt(!1)),En(!1)}),zi=(Xe,Hn)=>{tn.page=1,tn[Hn]=Xe,Rn(Ht({},tn)),gi(tn)},wt=["","\u5F53\u524D\u9898\u76EE\u7684\u5B9E\u9A8C\u8D44\u6E90\u4E3A\u4E13\u6709\u4E91\uFF0C\u4E0D\u652F\u6301\u91CD\u65B0\u8BC4\u6D4B~","\u8BE5\u529F\u80FD\u4EC5\u8BFE\u5802\u7BA1\u7406\u5458\u548C\u8003\u8BD5\u7684\u521B\u5EFA\u8005\u53EF\u4EE5\u64CD\u4F5C~"];return pt.createElement(pt.Fragment,null,pt.createElement("div",{className:Le()(Ut.recalculation,_e),style:an},pt.createElement(me.Z,{title:wt[(ln==null?void 0:ln.disable_resubmit_reason)||0]},pt.createElement(ne.ZP,{disabled:(ln==null?void 0:ln.disable_resubmit)||((Jt=ln==null?void 0:ln.exercise_question_resubmit)==null?void 0:Jt.status)==="running",onClick:()=>Rt(1),icon:pt.createElement("i",{className:"iconfont icon-zhongxinpingce font14"}),type:"primary",ghost:!0},"\u91CD\u65B0\u8BC4\u6D4B\u7B97\u5206")),(ln==null?void 0:ln.show_resubmit_history)&&pt.createElement(pt.Fragment,null,((Ye=ln==null?void 0:ln.exercise_question_resubmit)==null?void 0:Ye.status)==="running"?pt.createElement("div",{className:"c-grey-666"},"\u91CD\u65B0\u8BC4\u6D4B\u4E2D\uFF0C\u5F53\u524D\u8FDB\u5EA6",pt.createElement("span",{className:"c-light-primary ml3"},(Gn=ln==null?void 0:ln.exercise_question_resubmit)==null?void 0:Gn.rate)):pt.createElement("div",{className:"c-grey-666"},"\u91CD\u65B0\u8BC4\u6D4B\u6210\u529F",pt.createElement("span",{onClick:()=>{Rt(2),Pt(1)},className:"current",style:{color:"#3061D0",textDecoration:"underline",margin:"0 3px"}},(dn=ln==null?void 0:ln.exercise_question_resubmit)==null?void 0:dn.success_student_count),"\u4EBA\uFF0C\u5931\u8D25",pt.createElement("span",{onClick:()=>{Rt(2),Pt(2)},className:"current",style:{color:"#E30000",textDecoration:"underline",margin:"0 3px"}},(Oe=ln==null?void 0:ln.exercise_question_resubmit)==null?void 0:Oe.fail_count),"\u4EBA"),pt.createElement(me.Z,{title:"\u64CD\u4F5C\u8BB0\u5F55"},pt.createElement("i",{onClick:()=>ni(!0),className:"iconfont icon-chakanshenqingjilu c-light-primary current font14"})))),pt.createElement(jt.default,{centered:!0,open:!!ri,title:`\u91CD\u65B0\u8BC4\u6D4B${ri===1?"\u7B97\u5206":"\u7ED3\u679C"}`,width:870,okText:"\u91CD\u65B0\u8BC4\u6D4B\u7B97\u5206",onCancel:()=>Rt(!1),onOk:pi,afterClose:()=>{De(!0),Pt(null),Rn(Ht({},vn))}},pt.createElement("div",{className:Ut.filter},ri===1&&pt.createElement(pt.Fragment,null,pt.createElement("div",{className:Ut.tips},pt.createElement("div",{className:"mb5",style:{color:"#FF9D18"}},pt.createElement("i",{className:"iconfont icon-tishi9 mr10 font14"}),"\u6E29\u99A8\u63D0\u793A"),pt.createElement("div",null,"1.\u91CD\u65B0\u8BC4\u6D4B\u7B97\u5206\u6D41\u7A0B\uFF1A \u7CFB\u7EDF\u81EA\u52A8\u83B7\u53D6\u5B66\u751F\u5728\u8003\u8BD5\u9875\u9762\u4FDD\u5B58\u7684\u6700\u65B0\u4EE3\u7801\uFF0C\u5E76\u8FDB\u884C\u91CD\u65B0\u8BC4\u6D4B\uFF0C\u4ECE\u800C\u7CBE\u51C6\u8BA1\u7B97\u51FA\u5B66\u751F\u7684\u6700\u7EC8\u5F97\u5206\uFF1B"),pt.createElement("div",{style:{margin:"2px 0"}},"2.\u91CD\u65B0\u8BC4\u6D4B\u6761\u4EF6\uFF1A \u8003\u8BD5\u7ED3\u675F\u540E\uFF0C\u4EC5\u5BF9\u5DF2\u63D0\u4EA4\u8BD5\u5377\u4E14\u5DF2\u4F5C\u7B54\u8BE5\u9898\u76EE\u7684\u5B66\u751F\u8FDB\u884C\u91CD\u65B0\u8BC4\u6D4B\u4E0E\u7B97\u5206\uFF1B"),pt.createElement("div",null,"3.\u91CD\u65B0\u8BC4\u6D4B\u65F6\uFF0C\u8BF7\u786E\u4FDD\u5B9E\u9A8C\u73AF\u5883\u80FD\u6B63\u5E38\u542F\u52A8\u5E76\u53EF\u8FD0\u884C\u8BC4\u6D4B\u3002")),pt.createElement(xe,{className:"mt10",title:"\u9898\u76EE\u72B6\u6001",items:(Mt==null?void 0:Mt.question_status)||[],value:tn.question_status,onChange:Xe=>zi(Xe,"question_status")}),pt.createElement(xe,{className:"mt10",title:"\u8BC4\u9605\u72B6\u6001",items:(Mt==null?void 0:Mt.review_status)||[],value:tn.review,onChange:Xe=>zi(Xe,"review")})),ri===2&&pt.createElement(pt.Fragment,null,pt.createElement(xe,{className:"mt10",title:"\u91CD\u65B0\u8BC4\u6D4B\u7ED3\u679C",items:(Mt==null?void 0:Mt.success_status)||[],value:tn.success_status,onChange:Xe=>zi(Xe,"success_status")})),pt.createElement(gt.t7,{className:Ut.input,style:{bottom:ri===1?10:-5},value:tn.keyword,onChange:Xe=>zi(Xe,"keyword"),placeholder:"\u8BF7\u8F93\u5165\u59D3\u540D\u6216\u8005\u5B66\u53F7\u641C\u7D22"})),pt.createElement(Te.default,{className:"mt20",columns:Tn,scroll:((sn=Mt==null?void 0:Mt.data)==null?void 0:sn.length)>7?{y:300}:{},dataSource:(Mt==null?void 0:Mt.data)||[],loading:Ae,onChange:ai,pagination:{total:Nt,pageSize:tn.per_page,current:tn.page,hideOnSinglePage:!Nt,showSizeChanger:!0,pageSizeOptions:["5","10","20","50","100"],showQuickJumper:!0,size:"default",showTotal:nt.rU}}),pt.createElement(Dt.Z,{justify:"space-between",align:"middle",className:"mt10"},pt.createElement(he.default,{className:"c-black",checked:Ge,onChange:Xe=>De(Xe.target.checked)},"\u91CD\u65B0\u8BC4\u6D4B\u540E\u7684\u5206\u6570\u5927\u4E8E\u539F\u6765\u7684\u5206\u6570\u624D\u66F4\u65B0\u6210\u7EE9"),(0,ht.Ny)()&&pt.createElement("div",{className:"c-black"},"\u91CD\u65B0\u8BC4\u6D4B\u4EFB\u52A1\u5E76\u53D1\u4EBA\u6570",pt.createElement(se.Z,{className:"ml10 mr10",value:Ue,max:Ee,min:1,precision:0,onChange:Xe=>we(Xe)}),"\u4EBA",pt.createElement(me.Z,{overlayStyle:{maxWidth:450},title:"\u91CD\u65B0\u8BC4\u6D4B\u4EFB\u52A1\u7684\u6700\u5927\u5E76\u53D1\u4EBA\u6570\u4E3A20\u4EBA\uFF08\u81EA\u5B9A\u4E49\u955C\u50CF\u7684\u6700\u5927\u5E76\u53D1\u4EBA\u6570\u4E3A3\u4EBA\uFF09\u3002"},pt.createElement("i",{style:{color:"#9096A3"},className:"iconfont icon-tishi5 font13 ml10"}))))),pt.createElement(jt.default,{centered:!0,title:"\u91CD\u65B0\u8BC4\u6D4B\u7B97\u5206",open:He,width:494,zIndex:1001,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",confirmLoading:te,destroyOnClose:!0,onOk:ui,onCancel:()=>qe(!1)},pt.createElement(Ce.default.Item,{className:"mb0",colon:!1,label:"\u9A8C\u8BC1\u7801",name:"code",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u9A8C\u8BC1\u7801"}]},pt.createElement(st.Z,{ref:Xe=>cn.current=Xe}))),pt.createElement(jt.default,{centered:!0,title:"\u64CD\u4F5C\u8BB0\u5F55",open:gn,width:710,onCancel:()=>ni(!1),footer:null},pt.createElement(Bt.Z,{spinning:ze},pt.createElement("div",{className:Ut.operating},nn.map((Xe,Hn)=>pt.createElement("div",{key:Hn,className:Ut.operatingItem},pt.createElement("div",{style:{flex:"0 0 180px"},className:"c-grey-666"},Xe==null?void 0:Xe.created_at),pt.createElement("div",{className:"c-black"},Xe==null?void 0:Xe.user_name,"\u64CD\u4F5C\u4E86\u91CD\u65B0\u8BC4\u6D4B\u7B97\u5206"),(Xe==null?void 0:Xe.status)==="running"?pt.createElement("div",{className:"c-black"},"\u91CD\u65B0\u8BC4\u6D4B\u4E2D\uFF0C\u5F53\u524D\u8FDB\u5EA6",pt.createElement("span",{className:"c-light-primary ml3"},Xe==null?void 0:Xe.rate)):pt.createElement("div",{className:"c-black"},"\u91CD\u65B0\u8BC4\u6D4B\u6210\u529F",pt.createElement("span",{style:{color:"#3061D0",margin:"0 3px"}},Xe==null?void 0:Xe.success_student_count),"\u4EBA\uFF0C\u5931\u8D25",pt.createElement("span",{style:{color:"#E30000",margin:"0 3px"}},Xe==null?void 0:Xe.fail_count),"\u4EBA")))),pt.createElement("div",{style:{height:20}}))))}},3039:function(Bn,zn,kt){"use strict";kt.d(zn,{Z:function(){return me}});var pt=kt(59301),Ut={flex_box_center:"flex_box_center___rQJfc",flex_space_between:"flex_space_between___MDW24",flex_box_vertical_center:"flex_box_vertical_center___RZbAv",flex_box_center_end:"flex_box_center_end___ILhJA",flex_box_column:"flex_box_column___Fmij7",orangeColor:"orangeColor___U5vU6",redColor:"redColor___qYa6X",statustitle:"statustitle___pTBLm",statusbody:"statusbody___qUPQx",flex:"flex___VtL45"},ue=kt(62957),Le="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAPCAYAAADUFP50AAAAAXNSR0IArs4c6QAAAUFJREFUOE+V0ktKw1AUxvH/rVqIxT4wkgwEUSmK4APRBfiYCKU7cOZEBOkadAMZiwhuwJETBQciFRTtwJkPBLW2BRGrRanU9kpN2sSYiGaWc/PjuznnCN2Qh8AkPo+AzXxKLLiPhW7ICtDqB4GzQkqM/huGFZgZcDCBBDaaicsTMKbZH2xfwdY5/ICAEGSasC0AwRYblj+gKkENwfy4WS9V4LHsgsk49EZteJKHdBa6w7AybdZzr3D64ILxGKjtNrx9gfsSRBSYtf6xZh1/u+qQClrIhtdFuHmGvhisJcz65RPsZl2Jc/3QE7FhpgDHuT80x2+O9cR1K/GiCDt3rkQ/+Ns43gDFD0YVmHIuQGOOmiGTARhxwkGd1cZ7Vwd0OppWr3911StpcV++Iwn67q/kyBMuHchErcqwFxT1XZXsfQJqo2zI6kdI4QAAAABJRU5ErkJggg==",he="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAAAXNSR0IArs4c6QAAAW1JREFUOE+dkj1IQmEUht9z/blp4VQEjS39eW+oSCFCpFCI4BiKFGWWQUSrCjVVg+lQNJZQDZGNTm1B4NTibS3n2lo0wuqEN8i/a0HfeN7v+d73nO+QJEcKAJzQPAwCnSpKNtoqkyRHqgDrtUFAb6Rnedx43KgT6O5P0GQijFiNLe/Sy3/B8g+YTIRRrb5jP32JYNADr8eOldU0RJEqVlm8r1kyuA/AIEB10OWy4vBgA4ryCIdjCJlMDmfn1zAY6EmyGY/UrAwrgGATWKsn4mGEQl4Uiw+YX9hT73aZiEcl8eMbZAGA0AT6/ZPY3Ykiny/A55tA7uoGqdQFBD2VbDbDugoSTTEj3gTGYgG8Vt7UeG63hNkZJ7a2s+gw1XqPnf5REKhkt4kxNakO08ycbOtRC/7FcakCwNTJ0WwmDI+1LUCZZDkSYGa5Eewf0G0KAnprNYtFQHdPbZhNS1cmLafF5bUTJsyBSVMHPm+/ADTrfrtCH68WAAAAAElFTkSuQmCC",Dt=(ne,jt,Te)=>new Promise((se,Ce)=>{var Bt=ht=>{try{et(Te.next(ht))}catch(st){Ce(st)}},nt=ht=>{try{et(Te.throw(ht))}catch(st){Ce(st)}},et=ht=>ht.done?se(ht.value):Promise.resolve(ht.value).then(Bt,nt);et((Te=Te.apply(ne,jt)).next())}),me=({type:ne,resdata:jt,onok:Te,oktext:se,okloading:Ce})=>{const[Bt,nt]=(0,pt.useState)(!1),{can_copy_list:et,can_copy_num:ht,challenge_type:st,course_data_list:gt,no_copy_list:vt,no_copy_num:St,no_use_list:Et,no_use_num:Tt,repeat_shixun_num:Ot,student_count:$t,total_num:Xt,use_num:Ht}=jt;let ve=ht>0||ne==="exercise";(0,pt.useEffect)(()=>{(jt==null?void 0:jt.student_count)>0&&nt(!0)},[jt]),console.log("---11",Ce),(0,pt.useEffect)(()=>{Ce||nt(!1)},[Ce]);const ie=()=>{if(ne==="exercise"&&st===1)return pt.createElement(pt.Fragment,null,"\u8BFE\u5802\u5185\u6709",pt.createElement("span",{className:Ut.orangeColor},$t),"\u540D\u5B66\u751F\u5DF2\u5728\u5176\u4ED6\u8003\u8BD5\u4E2D\u6311\u6218\u8FC7\u5176\u4E2D\u7684",pt.createElement("span",{className:Ut.orangeColor},Ht),"\u4E2A\u5B9E\u8DF5\u9879\u76EE\uFF0C",pt.createElement("span",{className:Ut.redColor},"\u91CD\u590D\u53D1\u9001\u4F1A\u5BFC\u81F4\u8FD9\u90E8\u5206\u5B66\u751F\u65E0\u6CD5\u4F5C\u7B54\u5DF2\u6311\u6218\u8FC7\u7684\u5B9E\u8BAD\u9898\u3002"));if(ne==="exercise"&&st===2)return pt.createElement(pt.Fragment,null,"\u8BFE\u5802\u5185\u6709",pt.createElement("span",{className:Ut.orangeColor},$t),"\u540D\u5B66\u751F\u5DF2\u5728\u8BFE\u5802\u5B9E\u9A8C\u4E2D\u6311\u6218\u8FC7\u5176\u4E2D\u7684",pt.createElement("span",{className:Ut.orangeColor},Ht),"\u4E2A\u5B9E\u8DF5\u9879\u76EE\uFF0C\u4E14\u4F5C\u4E1A\u5DF2\u5F00\u542F\u201C\u4F5C\u4E1A\u622A\u6B62\u540E\u4E0D\u5141\u8BB8\u5B66\u751F\u7F16\u8F91\u4EE3\u7801\u201D\u8BBE\u7F6E\u9879\uFF0C",pt.createElement("span",{className:Ut.redColor},"\u91CD\u590D\u53D1\u5E03\u4F1A\u5BFC\u81F4\u8FD9\u90E8\u5206\u5B66\u751F\u65E0\u6CD5\u518D\u63D0\u4EA4\u4F5C\u4E1A\u3002"));if(ne==="shixun"&&st===1)return pt.createElement(pt.Fragment,null,"\u8BFE\u5802\u5185\u6709",pt.createElement("span",{className:Ut.orangeColor},$t),"\u540D\u5B66\u751F\u5DF2\u5728\u8003\u8BD5\u4E2D\u6311\u6218\u8FC7\u8BE5\u5B9E\u8DF5\u9879\u76EE\uFF0C",pt.createElement("span",{className:Ut.redColor},"\u91CD\u590D\u53D1\u9001\u4F1A\u5BFC\u81F4\u8FD9\u90E8\u5206\u5B66\u751F\u65E0\u6CD5\u518D\u63D0\u4EA4\u4F5C\u4E1A\u3002"));if(ne==="shixun"&&st===2)return pt.createElement(pt.Fragment,null,"\u8BFE\u5802\u5185\u6709",pt.createElement("span",{className:Ut.orangeColor},$t),"\u540D\u5B66\u751F\u5DF2\u5728\u8BFE\u5802\u5B9E\u9A8C\u4E2D\u6311\u6218\u8FC7\u8BE5\u5B9E\u8DF5\u9879\u76EE\uFF0C\u4E14\u4F5C\u4E1A\u5DF2\u5F00\u542F\u201C\u4F5C\u4E1A\u622A\u6B62\u540E\u4E0D\u5141\u8BB8\u5B66\u751F\u7F16\u8F91\u4EE3\u7801\u201D\u8BBE\u7F6E\u9879\uFF0C",pt.createElement("span",{className:Ut.redColor},"\u91CD\u590D\u53D1\u9001\u4F1A\u5BFC\u81F4\u8FD9\u90E8\u5206\u5B66\u751F\u65E0\u6CD5\u518D\u63D0\u4EA4\u4F5C\u4E1A\u3002"));if(ne==="subject"&&st===1)return pt.createElement(pt.Fragment,null,"\u8BFE\u5802\u5185\u6709",pt.createElement("span",{className:Ut.orangeColor},$t),"\u540D\u5B66\u751F\u5DF2\u5728\u8003\u8BD5\u4E2D\u6311\u6218\u8FC7\u5176\u4E2D\u7684",pt.createElement("span",{className:Ut.orangeColor},Ht),"\u4E2A\u5B9E\u8DF5\u9879\u76EE\uFF0C",pt.createElement("span",{className:Ut.redColor},"\u91CD\u590D\u53D1\u9001\u4F1A\u5BFC\u81F4\u8FD9\u90E8\u5206\u5B66\u751F\u65E0\u6CD5\u518D\u63D0\u4EA4\u4F5C\u4E1A\u3002"));if(ne==="subject"&&st===2)return pt.createElement(pt.Fragment,null,"\u8BFE\u5802\u5185\u6709 ",pt.createElement("span",{className:Ut.orangeColor},$t)," \u540D\u5B66\u751F\u5DF2\u5728\u8BFE\u5802\u5B9E\u9A8C\u6311\u6218\u8FC7\u5176\u4E2D\u7684 ",pt.createElement("span",{className:Ut.orangeColor},Ht)," \u4E2A\u5B9E\u8DF5\u9879\u76EE\uFF0C\u4E14\u4F5C\u4E1A\u5DF2\u5F00\u542F\u201C\u4F5C\u4E1A\u622A\u6B62\u540E\u4E0D\u5141\u8BB8\u5B66\u751F\u7F16\u8F91\u4EE3\u7801\u201D\u8BBE\u7F6E\u9879\uFF0C",pt.createElement("span",{className:Ut.redColor},"\u91CD\u590D\u53D1\u9001\u4F1A\u5BFC\u81F4\u8FD9\u90E8\u5206\u5B66\u751F\u65E0\u6CD5\u518D\u63D0\u4EA4\u4F5C\u4E1A\u3002"));if(ne==="exercisepush")return pt.createElement(pt.Fragment,null,"\u8BFE\u5802\u5185\u6709",pt.createElement("span",{className:Ut.orangeColor},$t),"\u540D\u5B66\u751F\u5DF2\u5728\u5176\u4ED6\u8003\u8BD5\u4E2D\u6311\u6218\u8FC7\u8BD5\u5377\u4E2D\u7684",pt.createElement("span",{className:Ut.orangeColor},Ht),"\u4E2A\u5B9E\u8DF5\u9879\u76EE \uFF0C",pt.createElement("span",{className:Ut.redColor},"\u91CD\u590D\u53D1\u5E03\u4F1A\u5BFC\u81F4\u8FD9\u90E8\u5206\u5B66\u751F\u65E0\u6CD5\u5728\u5F53\u524D\u8003\u8BD5\u4E2D\u8FDB\u884C\u4F5C\u7B54\u3002"));if(ne==="shixunpush"&&st===1)return pt.createElement(pt.Fragment,null,"\u8BFE\u5802\u5185\u6709",pt.createElement("span",{className:Ut.orangeColor},$t),"\u540D\u5B66\u751F\u5DF2\u5728\u8003\u8BD5\u4E2D\u6311\u6218\u8FC7\u5176\u4E2D\u7684",pt.createElement("span",{className:Ut.orangeColor},Ht),"\u4E2A\u5B9E\u8DF5\u9879\u76EE\uFF0C",pt.createElement("span",{className:Ut.redColor},"\u91CD\u590D\u53D1\u5E03\u4F1A\u5BFC\u81F4\u8FD9\u90E8\u5206\u5B66\u751F\u65E0\u6CD5\u518D\u63D0\u4EA4\u4F5C\u4E1A\u3002"));if(ne==="shixunpush"&&st===2)return pt.createElement(pt.Fragment,null,"\u8BFE\u5802\u5185\u6709",pt.createElement("span",{className:Ut.orangeColor},$t),"\u540D\u5B66\u751F\u5DF2\u5728\u8BFE\u5802\u5B9E\u9A8C\u4E2D\u6311\u6218\u8FC7",pt.createElement("span",{className:Ut.orangeColor},Ht),"\u4E2A\u5B9E\u8DF5\u9879\u76EE\uFF0C\u4E14\u4F5C\u4E1A\u5DF2\u5F00\u542F\u201C\u4F5C\u4E1A\u622A\u6B62\u540E\u4E0D\u5141\u8BB8\u5B66\u751F\u7F16\u8F91\u4EE3\u7801\u201D\u8BBE\u7F6E\u9879\uFF0C",pt.createElement("span",{className:Ut.redColor},"\u91CD\u590D\u53D1\u5E03\u4F1A\u5BFC\u81F4\u8FD9\u90E8\u5206\u5B66\u751F\u65E0\u6CD5\u518D\u63D0\u4EA4\u4F5C\u4E1A\u3002"))},Ne=()=>{if(ne==="exercise"||ne==="subject"||ne==="exercisepush"||ne==="shixunpush")return pt.createElement("div",{style:{marginTop:20}},St>0&&pt.createElement("div",null,pt.createElement("span",{className:Ut.flex},pt.createElement("img",{src:he,style:{width:14}}),pt.createElement("span",{className:Ut.statustitle},"\u4E0D\u652F\u6301\u590D\u5236\u7684\u5B9E\u8DF5\u9879\u76EE")),pt.createElement("div",{className:Ut.statusbody},ne==="exercise"&&pt.createElement("div",{style:{marginBottom:15}},"\u6CA1\u6709\u590D\u5236\u6743\u9650\u7684\u5B9E\u8DF5\u9879\u76EE\uFF0C",pt.createElement("span",{className:Ut.redColor},"\u4EE5\u4E0B\u8BD5\u9898\u5C06\u4E0D\u4F1A\u88AB\u53D1\u9001\u81F3\u8BFE\u5802\u4E2D\u3002"),"\u60A8\u4E5F\u53EF\u4EE5\u8054\u7CFB\u9879\u76EE\u521B\u5EFA\u8005\u5F00\u542F\u590D\u5236\u6743\u9650\u6216\u8005\u8054\u7CFB\u5E73\u53F0\u6559\u7814\u52A9\u7406\u8FDB\u884C\u534F\u52A9\u3002"),(ne==="subject"||ne==="exercisepush")&&pt.createElement("div",{style:{marginBottom:15}},"\u6CA1\u6709\u590D\u5236\u6743\u9650\u7684\u5B9E\u8DF5\u9879\u76EE\uFF0C",ve&&pt.createElement("span",{className:Ut.redColor},"\u4E00\u952E\u590D\u5236\u4E0D\u4F1A\u590D\u5236\u6B64\u90E8\u5206\u9879\u76EE\u3002"),"\u60A8\u53EF\u4EE5\u8054\u7CFB\u9879\u76EE\u521B\u5EFA\u8005\u5F00\u542F\u590D\u5236\u6743\u9650\u6216\u8005\u8054\u7CFB\u5E73\u53F0\u6559\u7814\u52A9\u7406\u8FDB\u884C\u534F\u52A9\u3002"),ne==="shixunpush"&&pt.createElement("div",{style:{marginBottom:15}},"\u6CA1\u6709\u590D\u5236\u6743\u9650\u7684\u5B9E\u8DF5\u9879\u76EE\uFF0C",ve&&pt.createElement("span",{className:Ut.redColor},"\u4E00\u952E\u590D\u5236\u4E0D\u4F1A\u590D\u5236\u6B64\u90E8\u5206\u9879\u76EE\u3002"),"\u5EFA\u8BAE\u60A8\u91CD\u65B0\u9009\u62E9\u5B9E\u8DF5\u9879\u76EE\u518D\u53D1\u5E03\u4F5C\u4E1A\uFF0C\u4E5F\u53EF\u8054\u7CFB\u9879\u76EE\u521B\u5EFA\u8005\u5F00\u542F\u590D\u5236\u6743\u9650\u6216\u8054\u7CFB\u5E73\u53F0\u6559\u7814\u52A9\u7406\u8FDB\u884C\u534F\u52A9\u3002"),pt.createElement("div",null,vt==null?void 0:vt.map((xe,Pe)=>pt.createElement("a",{href:`/shixuns/${xe.identifier}/challenges`,target:"_blank"},"\u300A",xe==null?void 0:xe.name,"\u300B",Pe+1!==St&&"\u3001"))))),ht>0&&pt.createElement("div",{style:{marginTop:20}},pt.createElement("span",{className:Ut.flex},pt.createElement("img",{src:Le,style:{width:14}}),pt.createElement("span",{className:Ut.statustitle},"\u652F\u6301\u590D\u5236\u7684\u5B9E\u8DF5\u9879\u76EE")),pt.createElement("div",{className:Ut.statusbody},ne==="exercise"&&pt.createElement("div",{style:{marginBottom:15}},"\u5EFA\u8BAE\u60A8\u4E00\u952E\u590D\u5236\u5E76\u66FF\u6362\u8BD5\u9898\uFF08\u5C06\u590D\u5236\u5E76\u521B\u5EFA\u4E00\u4E2A\u65B0\u7684\u9879\u76EE\u66FF\u6362\u8BD5\u5377\u4E2D\u7684\u539F\u8BD5\u9898\uFF0C\u4E0D\u4F1A\u590D\u5236\u5B66\u751F\u7684\u6311\u6218\u8BB0\u5F55\uFF0C\u65B0\u7684\u9879\u76EE\u652F\u6301\u8FDB\u884C\u7F16\u8F91\u5E76\u4E0E\u539F\u9879\u76EE\u4FE1\u606F\u4E92\u4E0D\u5F71\u54CD\uFF09\u3002"),(ne==="subject"||ne==="exercisepush")&&pt.createElement("div",{style:{marginBottom:15}},"\u5EFA\u8BAE\u60A8\u4E00\u952E\u590D\u5236\u5E76\u53D1\u9001\uFF08\u5C06\u590D\u5236\u5E76\u521B\u5EFA\u4E00\u4E2A\u65B0\u7684\u9879\u76EE\uFF0C\u4E0D\u4F1A\u590D\u5236\u5B66\u751F\u7684\u6311\u6218\u8BB0\u5F55\uFF0C\u65B0\u7684\u9879\u76EE\u652F\u6301\u8FDB\u884C\u7F16\u8F91\u5E76\u4E0E\u539F\u9879\u76EE\u4FE1\u606F\u4E92\u4E0D\u5F71\u54CD\uFF09\u3002"),ne==="shixunpush"&&pt.createElement("div",{style:{marginBottom:15}},"\u5EFA\u8BAE\u60A8\u4E00\u952E\u590D\u5236\u5E76\u66FF\u6362\u8BD5\u9898\uFF08\u5C06\u590D\u5236\u5E76\u521B\u5EFA\u4E00\u4E2A\u65B0\u7684\u9879\u76EE\u66FF\u6362\u5F53\u524D\u4F5C\u4E1A\u4E2D\u7684\u5B9E\u8DF5\u9879\u76EE\uFF0C\u4E0D\u4F1A\u590D\u5236\u5B66\u751F\u7684\u6311\u6218\u8BB0\u5F55\uFF0C\u65B0\u7684\u9879\u76EE\u652F\u6301\u8FDB\u884C\u7F16\u8F91\u5E76\u4E0E\u539F\u9879\u76EE\u4FE1\u606F\u4E92\u4E0D\u5F71\u54CD\uFF09\u3002"),pt.createElement("div",null,et==null?void 0:et.map((xe,Pe)=>pt.createElement("a",{href:`/shixuns/${xe.identifier}/challenges`,target:"_blank"},"\u300A",xe==null?void 0:xe.name,"\u300B",Pe+1!==ht&&"\u3001"))))));if(ne==="shixun")return pt.createElement("div",{style:{marginTop:20}},ht>0?"\u8BE5\u9879\u76EE\u652F\u6301\u590D\u5236\uFF0C\u5EFA\u8BAE\u60A8\u4E00\u952E\u590D\u5236\u5E76\u53D1\u9001\uFF08\u5C06\u590D\u5236\u5E76\u521B\u5EFA\u4E00\u4E2A\u65B0\u7684\u9879\u76EE\uFF0C\u4E0D\u4F1A\u590D\u5236\u5B66\u751F\u7684\u6311\u6218\u8BB0\u5F55\uFF0C\u65B0\u7684\u9879\u76EE\u652F\u6301\u8FDB\u884C\u7F16\u8F91\u5E76\u4E0E\u539F\u9879\u76EE\u4FE1\u606F\u4E92\u4E0D\u5F71\u54CD\uFF09\u3002":"\u8BE5\u9879\u76EE\u4E0D\u652F\u6301\u590D\u5236\uFF0C\u60A8\u53EF\u4EE5\u8054\u7CFB\u9879\u76EE\u521B\u5EFA\u8005\u5F00\u542F\u590D\u5236\u6743\u9650\u6216\u8005\u8054\u7CFB\u5E73\u53F0\u6559\u7814\u52A9\u7406\u8FDB\u884C\u534F\u52A9\u3002")};return pt.createElement(ue.default,{open:Bt,onCancel:()=>{nt(!1)},cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",width:700,centered:!0,cancelButtonProps:{style:{display:!ve&&"none"}},zIndex:1003,confirmLoading:Ce,okText:ve?se:"\u6211\u77E5\u9053\u4E86",onOk:()=>Dt(void 0,null,function*(){ve?yield Te([...et,...Et]):nt(!1)})},pt.createElement("div",{style:{maxHeight:600,overflow:"auto"}},ie(),Ne()))}},90283:function(Bn,zn,kt){"use strict";kt.d(zn,{Z:function(){return Dt}});var pt=kt(59301),Ut={btn:"btn___kReTL",redBtn:"redBtn___UFEL0"},ue=kt(92310),Le=kt.n(ue),Dt=({className:qt,style:me,state:ne,onClick:jt})=>{var Te,se;return pt.createElement("div",{onClick:jt,className:Le()(ne?(Te=Ut)==null?void 0:Te.redBtn:(se=Ut)==null?void 0:se.btn,qt),style:me},ne?pt.createElement(pt.Fragment,null,pt.createElement("i",{className:"iconfont icon-biaoji1"}),pt.createElement("span",null,"\u53D6\u6D88\u6807\u8BB0\u9519\u9898")):pt.createElement(pt.Fragment,null,pt.createElement("i",{className:"iconfont icon-biaojigaiti"}),pt.createElement("span",null,"\u6807\u8BB0\u9519\u9898")))}},69720:function(Bn,zn,kt){"use strict";kt.d(zn,{h:function(){return St}});var pt=kt(59301),Ut=kt(82326),ue=kt(28284),Le=kt(99571),he=kt(89780),Dt=kt.n(he),qt=kt(8336),me=kt(12469),ne=Object.defineProperty,jt=Object.defineProperties,Te=Object.getOwnPropertyDescriptors,se=Object.getOwnPropertySymbols,Ce=Object.prototype.hasOwnProperty,Bt=Object.prototype.propertyIsEnumerable,nt=(Et,Tt,Ot)=>Tt in Et?ne(Et,Tt,{enumerable:!0,configurable:!0,writable:!0,value:Ot}):Et[Tt]=Ot,et=(Et,Tt)=>{for(var Ot in Tt||(Tt={}))Ce.call(Tt,Ot)&&nt(Et,Ot,Tt[Ot]);if(se)for(var Ot of se(Tt))Bt.call(Tt,Ot)&&nt(Et,Ot,Tt[Ot]);return Et},ht=(Et,Tt)=>jt(Et,Te(Tt));const st=Ut.default.Option,gt={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"]};zn.Z=({callback:Et,onCancel:Tt})=>{const[Ot,$t]=(0,pt.useState)("python");function Xt(ve){$t(vt[ve][1])}function Ht(ve){Et(ve)}return pt.createElement(ue.default,ht(et({},gt),{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:Ht,style:{width:500}}),pt.createElement(ue.default.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},pt.createElement(Ut.default,{getPopupContainer:ve=>ve.parentNode,onChange:Xt},Object.keys(vt).map(ve=>pt.createElement(st,{key:ve,value:ve},vt[ve][0])))),pt.createElement(ue.default.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},pt.createElement(St,{mode:Ot})),pt.createElement("div",{className:"flex-container flex-end"},pt.createElement(Le.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),pt.createElement(Le.ZP,{type:"ghost",onClick:Tt},"\u53D6\u6D88")))};function St({value:Et,onChange:Tt,mode:Ot,options:$t={}}){const Xt=(0,pt.useRef)(),[Ht,ve]=(0,pt.useState)();return(0,pt.useEffect)(()=>{if(Ht){let ie=function(Ne){const xe=Ne.getValue();Tt&&Tt(xe)};return Ht.on("change",ie),()=>{Ht.off("change",ie)}}},[Ht,Tt]),(0,pt.useEffect)(()=>{Ht&&Ht.setOption("mode",Ot)},[Ht,Ot]),(0,pt.useEffect)(()=>{Ht&&(Et!==Ht.getValue()||Et==="")&&setTimeout(()=>{Ht.setValue(Et||"")},300)},[Ht,Et]),(0,pt.useEffect)(()=>{if(Xt.current&&!Ht){const ie=Dt().fromTextArea(Xt.current,et({mode:Ot,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},$t));ve(ie)}},[Xt.current,Ht]),pt.createElement("div",{className:"my-codemirror-container"},pt.createElement("textarea",{ref:Xt}))}},39793:function(Bn,zn,kt){"use strict";kt.d(zn,{Z:function(){return In}});var pt=kt(59301),Ut=kt(89780),ue=kt.n(Ut),Le=kt(76374),he=kt(8336),Dt=kt(6313),qt=kt(25717),me=kt(99498),ne=kt(25419),jt=kt(67549),Te=kt(76902),se=({value:pe="",className:Se,showTextOnly:ye,showLines:jn,style:Ln={}})=>{const Kn=(0,pt.useMemo)(()=>"",[pe]);return pt.createElement(pt.Fragment,null,pt.createElement("div",{dangerouslySetInnerHTML:{__html:Kn}}))},Ce=kt(59301),Bt=Object.defineProperty,nt=Object.defineProperties,et=Object.getOwnPropertyDescriptors,ht=Object.getOwnPropertySymbols,st=Object.prototype.hasOwnProperty,gt=Object.prototype.propertyIsEnumerable,vt=(pe,Se,ye)=>Se in pe?Bt(pe,Se,{enumerable:!0,configurable:!0,writable:!0,value:ye}):pe[Se]=ye,St=(pe,Se)=>{for(var ye in Se||(Se={}))st.call(Se,ye)&&vt(pe,ye,Se[ye]);if(ht)for(var ye of ht(Se))gt.call(Se,ye)&&vt(pe,ye,Se[ye]);return pe},Et=(pe,Se)=>nt(pe,et(Se));let Tt=[{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\u56FE\u50CF",icon:"iconfont icon-shuxuetuxiang2",actionName:"maths-latex"},{title:"\u591A\u884C\u516C\u5F0F",icon:"iconfont icon-jisuan1",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 Ot({onActionCallback:pe,title:Se,icon:ye,actionName:jn,className:Ln="",children:Kn}){function Je(){pe(jn)}return Ce.createElement("a",{title:Se,className:Ln,onClick:Je},Ce.createElement("i",{className:`${ye}`}),Kn)}var $t=({watch:pe,showNullButton:Se,showNullProgramButton:ye,onActionCallback:jn,fullScreen:Ln,insertTemp:Kn,hidetoolBar:Je,extraUse:An})=>{const yi=[...Tt,{title:`${pe?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"}`,icon:`${pe?"md-iconfont icon-eye-slash":"md-iconfont icon-eye"}`,actionName:"trigger-watch"}];return Ce.createElement("ul",{className:"markdown-toolbar-container"},!Je&&yi.map((Ei,Xi)=>Ce.createElement("li",{key:Xi},Ei.actionName?Ce.createElement(Ot,Et(St({},Ei),{onActionCallback:jn})):Ce.createElement("span",{className:"v-line"}))),Se?Ce.createElement("li",null,Ce.createElement(Ot,{icon:"md-iconfont icon-edit insert-blank",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:jn},Ce.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,ye?Ce.createElement(Ce.Fragment,null,Ce.createElement("li",null,Ce.createElement(Ot,{icon:"md-iconfont icon-edit insert-blank",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-signal",onActionCallback:jn},Ce.createElement("span",{className:"fill-tip"},"+\u5355\u884C\u586B\u7A7A\u9879"))),Ce.createElement("li",null,Ce.createElement(Ot,{icon:"md-iconfont icon-uniE900 insert-blank",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-multiple",onActionCallback:jn},Ce.createElement("span",{className:"fill-tip"},"+\u591A\u884C\u586B\u7A7A\u9879")))):null,Kn&&Ce.createElement("li",null,Ce.createElement(Ot,{icon:"md-iconfont icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:`inster-template-${Kn}`,onActionCallback:jn},Ce.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),An&&Ce.createElement("li",null,An),Ce.createElement("li",{className:"btn-full-screen"},Ce.createElement(Ot,{icon:`${Ln?"md-iconfont icon-shrink":"md-iconfont icon-enlarge"}`,title:Ln?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:jn})))},Xt=kt(91558),Ht=kt(28284),ve=kt(37568),ie=kt(99571),Ne=Object.defineProperty,xe=Object.defineProperties,Pe=Object.getOwnPropertyDescriptors,Qe=Object.getOwnPropertySymbols,_e=Object.prototype.hasOwnProperty,an=Object.prototype.propertyIsEnumerable,Ke=(pe,Se,ye)=>Se in pe?Ne(pe,Se,{enumerable:!0,configurable:!0,writable:!0,value:ye}):pe[Se]=ye,re=(pe,Se)=>{for(var ye in Se||(Se={}))_e.call(Se,ye)&&Ke(pe,ye,Se[ye]);if(Qe)for(var ye of Qe(Se))an.call(Se,ye)&&Ke(pe,ye,Se[ye]);return pe},Jt=(pe,Se)=>xe(pe,Pe(Se));const Ye={labelCol:{span:4},wrapperCol:{span:20}};var Gn=({callback:pe,onCancel:Se})=>{function ye(jn){pe(jn)}return pt.createElement(Ht.default,Jt(re({},Ye),{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:ye,style:{width:500}}),pt.createElement(Ht.default.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},pt.createElement(ve.default,null)),pt.createElement(Ht.default.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},pt.createElement(ve.default,null)),pt.createElement("div",{className:"flex-container flex-end"},pt.createElement(ie.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),pt.createElement(ie.ZP,{type:"ghost",onClick:Se},"\u53D6\u6D88")))},dn=kt(69720),Oe=kt(17077),sn=kt(62957),ln=kt(77019),Vn=kt(9507),Ae=kt(59301),yn=({callback:pe,onCancel:Se})=>{const ye=document.createElement("canvas"),jn=ye.getContext("2d");ye.width=1e3,ye.height=800,jn.fillStyle="#ffffff",jn.fillRect(0,0,ye.width,ye.height);const Ln=ye.toDataURL("image/png");return Ae.createElement(sn.default,{open:!0,width:"100vw",style:{height:"100vh",top:0},footer:null,title:null,closable:!1},Ae.createElement(ln.Z,{style:{height:"100vh"}},Ae.createElement(Vn.Z,{fullWidth:!0,noAssociationId:!0,showFullTools:!0,data:{src:Ln,visible:!0,title:String(Date.now())},onOk:Kn=>{pe({src:Kn.url})},onClose:Se})))},te=kt(12378);function En(){go.CommandHandler.call(this),this._arrowKeyBehavior="move",this._pasteOffset=new go.Point(10,10),this._lastPasteOffset=new go.Point(0,0)}go.Diagram.inherit(En,go.CommandHandler),En.prototype.canAlignSelection=function(){var pe=this.diagram;return!(pe===null||pe.isReadOnly||pe.isModelReadOnly||pe.selection.count<2)},En.prototype.alignLeft=function(){var pe=this.diagram;pe.startTransaction("aligning left");var Se=1/0;pe.selection.each(function(ye){ye instanceof go.Link||(Se=Math.min(ye.position.x,Se))}),pe.selection.each(function(ye){ye instanceof go.Link||ye.move(new go.Point(Se,ye.position.y))}),pe.commitTransaction("aligning left")},En.prototype.alignRight=function(){var pe=this.diagram;pe.startTransaction("aligning right");var Se=-1/0;pe.selection.each(function(ye){if(!(ye instanceof go.Link)){var jn=ye.actualBounds.x+ye.actualBounds.width;Se=Math.max(jn,Se)}}),pe.selection.each(function(ye){ye instanceof go.Link||ye.move(new go.Point(Se-ye.actualBounds.width,ye.position.y))}),pe.commitTransaction("aligning right")},En.prototype.alignTop=function(){var pe=this.diagram;pe.startTransaction("alignTop");var Se=1/0;pe.selection.each(function(ye){ye instanceof go.Link||(Se=Math.min(ye.position.y,Se))}),pe.selection.each(function(ye){ye instanceof go.Link||ye.move(new go.Point(ye.position.x,Se))}),pe.commitTransaction("alignTop")},En.prototype.alignBottom=function(){var pe=this.diagram;pe.startTransaction("aligning bottom");var Se=-1/0;pe.selection.each(function(ye){if(!(ye instanceof go.Link)){var jn=ye.actualBounds.y+ye.actualBounds.height;Se=Math.max(jn,Se)}}),pe.selection.each(function(ye){ye instanceof go.Link||ye.move(new go.Point(ye.actualBounds.x,Se-ye.actualBounds.height))}),pe.commitTransaction("aligning bottom")},En.prototype.alignCenterX=function(){var pe=this.diagram,Se=pe.selection.first();if(Se){pe.startTransaction("aligning Center X");var ye=Se.actualBounds.x+Se.actualBounds.width/2;pe.selection.each(function(jn){jn instanceof go.Link||jn.move(new go.Point(ye-jn.actualBounds.width/2,jn.actualBounds.y))}),pe.commitTransaction("aligning Center X")}},En.prototype.alignCenterY=function(){var pe=this.diagram,Se=pe.selection.first();if(Se){pe.startTransaction("aligning Center Y");var ye=Se.actualBounds.y+Se.actualBounds.height/2;pe.selection.each(function(jn){jn instanceof go.Link||jn.move(new go.Point(jn.actualBounds.x,ye-jn.actualBounds.height/2))}),pe.commitTransaction("aligning Center Y")}},En.prototype.alignColumn=function(pe){var Se=this.diagram;Se.startTransaction("align Column"),pe===void 0&&(pe=0),pe=parseFloat(pe);var ye=new Array;Se.selection.each(function(An){An instanceof go.Link||ye.push(An)});for(var jn=0;jn<ye.length-1;jn++){var Ln=ye[jn],Kn=Ln.actualBounds.y+Ln.actualBounds.height+pe,Je=ye[jn+1];Je.move(new go.Point(Ln.actualBounds.x,Kn))}Se.commitTransaction("align Column")},En.prototype.alignRow=function(pe){pe===void 0&&(pe=0),pe=parseFloat(pe);var Se=this.diagram;Se.startTransaction("align Row");var ye=new Array;Se.selection.each(function(An){An instanceof go.Link||ye.push(An)});for(var jn=0;jn<ye.length-1;jn++){var Ln=ye[jn],Kn=Ln.actualBounds.x+Ln.actualBounds.width+pe,Je=ye[jn+1];Je.move(new go.Point(Kn,Ln.actualBounds.y))}Se.commitTransaction("align Row")},En.prototype.canRotate=function(pe){var Se=this.diagram;return!(Se===null||Se.isReadOnly||Se.isModelReadOnly||Se.selection.count<1)},En.prototype.rotate=function(pe){pe===void 0&&(pe=90);var Se=this.diagram;Se.startTransaction("rotate "+pe.toString());var Se=this.diagram;Se.selection.each(function(ye){ye instanceof go.Link||ye instanceof go.Group||(ye.angle+=pe)}),Se.commitTransaction("rotate "+pe.toString())},En.prototype.pullToFront=function(){var pe=this.diagram;pe.startTransaction("pullToFront");var Se=new go.Map;pe.selection.each(function(ye){Se.set(ye.layer,0)}),Se.iteratorKeys.each(function(ye){var jn=0;ye.parts.each(function(Ln){if(!Ln.isSelected){var Kn=Ln.zOrder;isNaN(Kn)?Ln.zOrder=0:jn=Math.max(jn,Kn)}}),Se.set(ye,jn)}),pe.selection.each(function(ye){En._assignZOrder(ye,Se.get(ye.layer)+1)}),pe.commitTransaction("pullToFront")},En.prototype.pushToBack=function(){var pe=this.diagram;pe.startTransaction("pushToBack");var Se=new go.Map;pe.selection.each(function(ye){Se.set(ye.layer,0)}),Se.iteratorKeys.each(function(ye){var jn=0;ye.parts.each(function(Ln){if(!Ln.isSelected){var Kn=Ln.zOrder;isNaN(Kn)?Ln.zOrder=0:jn=Math.min(jn,Kn)}}),Se.set(ye,jn)}),pe.selection.each(function(ye){En._assignZOrder(ye,Se.get(ye.layer)-1-En._findGroupDepth(ye))}),pe.commitTransaction("pushToBack")},En._assignZOrder=function(pe,Se,ye){ye===void 0&&(ye=pe),pe.layer===ye.layer&&(pe.zOrder=Se),pe instanceof go.Group&&pe.memberParts.each(function(jn){En._assignZOrder(jn,Se+1,ye)})},En._findGroupDepth=function(pe){if(pe instanceof go.Group){var Se=0;return pe.memberParts.each(function(ye){Se=Math.max(Se,En._findGroupDepth(ye))}),Se+1}else return 0},En.prototype.doKeyDown=function(){var pe=this.diagram;if(pe!==null){var Se=pe.lastInput;if(Se.key==="Up"||Se.key==="Down"||Se.key==="Left"||Se.key==="Right"){var ye=this.arrowKeyBehavior;if(ye==="none")return;if(ye==="select"){this._arrowKeySelect();return}else if(ye==="move"){this._arrowKeyMove();return}else if(ye==="tree"){this._arrowKeyTree();return}}go.CommandHandler.prototype.doKeyDown.call(this)}},En.prototype._getAllParts=function(){var pe=new Array;return this.diagram.nodes.each(function(Se){pe.push(Se)}),this.diagram.parts.each(function(Se){pe.push(Se)}),pe},En.prototype._arrowKeyMove=function(){var pe=this.diagram,Se=pe.lastInput,ye=0,jn=0;if(Se.control||Se.meta)ye=1,jn=1;else if(pe.grid!==null){var Ln=pe.grid.gridCellSize;jn=Ln.width,ye=Ln.height}pe.startTransaction("arrowKeyMove"),pe.selection.each(function(Kn){Se.key==="Up"?Kn.move(new go.Point(Kn.actualBounds.x,Kn.actualBounds.y-ye)):Se.key==="Down"?Kn.move(new go.Point(Kn.actualBounds.x,Kn.actualBounds.y+ye)):Se.key==="Left"?Kn.move(new go.Point(Kn.actualBounds.x-jn,Kn.actualBounds.y)):Se.key==="Right"&&Kn.move(new go.Point(Kn.actualBounds.x+jn,Kn.actualBounds.y))}),pe.commitTransaction("arrowKeyMove")},En.prototype._arrowKeySelect=function(){var pe=this.diagram,Se=pe.lastInput,ye=null;Se.key==="Up"?ye=this._findNearestPartTowards(270):Se.key==="Down"?ye=this._findNearestPartTowards(90):Se.key==="Left"?ye=this._findNearestPartTowards(180):Se.key==="Right"&&(ye=this._findNearestPartTowards(0)),ye!==null&&(Se.shift?ye.isSelected=!0:Se.control||Se.meta?ye.isSelected=!ye.isSelected:pe.select(ye))},En.prototype._findNearestPartTowards=function(pe){var Se=this.diagram.selection.first();if(Se===null)return null;for(var ye=Se.actualBounds.center,jn=this._getAllParts(),Ln=1/0,Kn=Se,Je=0;Je<jn.length;Je++){var An=jn[Je];if(An!==Se&&An.canSelect()){var yi=An.actualBounds.center,Ei=ye.directionPoint(yi),Xi=this._angleCloseness(Ei,pe);if(Xi<=45){var Gt=ye.distanceSquaredPoint(yi);Gt*=1+Math.sin(Xi*Math.PI/180),Gt<Ln&&(Ln=Gt,Kn=An)}}}return Kn},En.prototype._angleCloseness=function(pe,Se){return Math.min(Math.abs(Se-pe),Math.min(Math.abs(Se+360-pe),Math.abs(Se-360-pe)))},En.prototype._arrowKeyTree=function(){var pe=this.diagram,Se=pe.selection.first();if(Se instanceof go.Node){var ye=pe.lastInput;if(ye.key==="Right"){if(!Se.isTreeLeaf)if(!Se.isTreeExpanded)pe.commandHandler.canExpandTree(Se)&&pe.commandHandler.expandTree(Se);else{var jn=this._sortTreeChildrenByY(Se).first();jn!==null&&pe.select(jn)}}else if(ye.key==="Left")if(!Se.isTreeLeaf&&Se.isTreeExpanded)pe.commandHandler.canCollapseTree(Se)&&pe.commandHandler.collapseTree(Se);else{var Ln=Se.findTreeParentNode();Ln!==null&&pe.select(Ln)}else if(ye.key==="Up"){var Ln=Se.findTreeParentNode();if(Ln!==null){var Kn=this._sortTreeChildrenByY(Ln),Je=Kn.indexOf(Se);if(Je>0){for(var An=Kn.elt(Je-1);An!==null&&An.isTreeExpanded&&!An.isTreeLeaf;){var yi=this._sortTreeChildrenByY(An);An=yi.last()}An!==null&&pe.select(An)}else pe.select(Ln)}}else if(ye.key==="Down")if(Se.isTreeExpanded&&!Se.isTreeLeaf){var jn=this._sortTreeChildrenByY(Se).first();jn!==null&&pe.select(jn)}else for(;Se!==null;){var Ln=Se.findTreeParentNode();if(Ln===null)break;var Kn=this._sortTreeChildrenByY(Ln),Je=Kn.indexOf(Se);if(Je<Kn.length-1){pe.select(Kn.elt(Je+1));break}else Se=Ln}var Ei=pe.selection.first();Ei!==null&&pe.scrollToRect(Ei.actualBounds)}},En.prototype._sortTreeChildrenByY=function(pe){var Se=new go.List().addAll(pe.findTreeChildrenNodes());return Se.sort(function(ye,jn){var Ln=ye.location,Kn=jn.location;return Ln.y<Kn.y?-1:Ln.y>Kn.y?1:Ln.x<Kn.x?-1:Ln.x>Kn.x?1:0}),Se},En.prototype.copyToClipboard=function(pe){go.CommandHandler.prototype.copyToClipboard.call(this,pe),this._lastPasteOffset.set(this.pasteOffset)},En.prototype.pasteFromClipboard=function(){var pe=go.CommandHandler.prototype.pasteFromClipboard.call(this);return this.diagram.moveParts(pe,this._lastPasteOffset),this._lastPasteOffset.add(this.pasteOffset),pe},Object.defineProperty(En.prototype,"arrowKeyBehavior",{get:function(){return this._arrowKeyBehavior},set:function(pe){if(pe!=="move"&&pe!=="select"&&pe!=="scroll"&&pe!=="tree"&&pe!=="none")throw new Error('DrawCommandHandler.arrowKeyBehavior must be either "move", "select", "scroll", "tree", or "none", not: '+pe);this._arrowKeyBehavior=pe}}),Object.defineProperty(En.prototype,"pasteOffset",{get:function(){return this._pasteOffset},set:function(pe){if(!(pe instanceof go.Point))throw new Error("DrawCommandHandler.pasteOffset must be a Point, not: "+pe);this._pasteOffset.set(pe)}});var ri=En,Rt=kt(63720),Lt=kt(5269),Pt=kt(38986),Nt={myPaletteDiv:"myPaletteDiv___Xjz2I",flowChartWrp:"flowChartWrp____f45r",maxH60:"maxH60___Pd4Re"},Zt=kt(48790),Mt=kt(59301),Yt=(pe,Se,ye)=>new Promise((jn,Ln)=>{var Kn=yi=>{try{An(ye.next(yi))}catch(Ei){Ln(Ei)}},Je=yi=>{try{An(ye.throw(yi))}catch(Ei){Ln(Ei)}},An=yi=>yi.done?jn(yi.value):Promise.resolve(yi.value).then(Kn,Je);An((ye=ye.apply(pe,Se)).next())});function Ge({onCancel:pe,callback:Se}){let ye=(0,pt.useRef)(),jn=(0,pt.useRef)(),Ln=(0,pt.useRef)(),Kn=(0,pt.useRef)(!1);const Je=(0,pt.useRef)(!1),[An,yi]=(0,pt.useState)(0);function Ei(){const Gt=te.bx.make,de={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"};ye.current=new te.S0(jn.current,{padding:20,grid:Gt(te.s_,"Grid",Gt(te.bn,"LineH",{stroke:"lightgray",strokeWidth:.5}),Gt(te.bn,"LineV",{stroke:"lightgray",strokeWidth:.5})),"draggingTool.isGridSnapEnabled":!0,handlesDragDropForTopLevelParts:!0,mouseDrop:On=>{var bi=On.diagram.commandHandler.addTopLevelParts(On.diagram.selection,!0);bi||On.diagram.currentTool.doCancel()},commandHandler:Gt(ri),"clickCreatingTool.archetypeNodeData":{text:"\u672A\u547D\u540D",fill:null,stroke:null,borderColor:"rgba(0,0,0,0)"},PartCreated:On=>{var bi=On.subject;bi.location=bi.location.copy().snapToGridPoint(On.diagram.grid.gridOrigin,On.diagram.grid.gridCellSize),setTimeout(()=>{On.diagram.commandHandler.editTextBlock()},20)},"commandHandler.archetypeGroupData":{isGroup:!0,text:"NEW GROUP"},SelectionGrouped:On=>{var bi=On.subject;setTimeout(()=>{On.diagram.commandHandler.editTextBlock()})},LinkRelinked:On=>{var bi=On.parameter.part;bi.invalidateConnectedLinks();var Mi=On.subject;On.diagram.toolManager.linkingTool.isForwards?Mi.toNode.invalidateConnectedLinks():Mi.fromNode.invalidateConnectedLinks()},"undoManager.isEnabled":!0}),ye.current.nodeTemplate=Gt(te.NB,"Auto",{locationSpot:te.z6.Center,locationObjectName:"SHAPE",desiredSize:new te.$u(120,60),minSize:new te.$u(40,40),resizable:!0,resizeCellSize:new te.$u(10,10),rotatable:!0},new te.KX("location","loc",te.E9.parse).makeTwoWay(te.E9.stringify),new te.KX("desiredSize","size",te.$u.parse).makeTwoWay(te.$u.stringify),Gt(te.bn,{name:"SHAPE",fill:de.white,cursor:"pointer",portId:"",fromLinkable:!0,toLinkable:!0,fromLinkableDuplicates:!0,toLinkableDuplicates:!0,fromSpot:te.z6.AllSides,toSpot:te.z6.AllSides},new te.KX("figure"),new te.KX("fill"),new te.KX("stroke","borderColor"),new te.KX("strokeWidth","thickness"),new te.KX("strokeDashArray","dash")),Gt(te.bn,{width:100,height:20,strokeWidth:0,fill:"transparent"}),Gt(te.al,{margin:1,textAlign:"center",overflow:te.al.OverflowEllipsis,editable:!0},new te.KX("text").makeTwoWay(),new te.KX("stroke","color"))),ye.current.nodeTemplate.toolTip=Gt("ToolTip",Gt(te.s_,"Vertical",{maxSize:new te.$u(200,NaN)},Gt(te.al,{font:"bold 10pt sans-serif",textAlign:"center"},new te.KX("text")),Gt(te.al,{font:"10pt sans-serif",textAlign:"center"},new te.KX("text","details"))));function un(On,bi){var Mi=(_i,tr)=>{_i.handled=!0,_i.diagram.model.commit(pr=>{var br=tr.part.adornedPart,Or=new te.E9().setRectSpot(br.actualBounds,On);Or.subtract(br.location),Or.scale(2,2),Or.x+=Math.sign(Or.x)*130,Or.y+=Math.sign(Or.y)*130,Or.add(br.location),Or.snapToGridPoint(_i.diagram.grid.gridOrigin,_i.diagram.grid.gridCellSize);var Ir=pr.copyNodeData(br.data);pr.setGroupKeyForNodeData(Ir,pr.getGroupKeyForNodeData(br.data)),pr.addNodeData(Ir);var fn={from:br.key,to:pr.getKeyForNodeData(Ir)};pr.addLinkData(fn);var ho=_i.diagram.findNodeForData(Ir);ho.location=Or,_i.diagram.select(ho),setTimeout(()=>{_i.diagram.commandHandler.editTextBlock()},20)})};return Gt(te.bn,{figure:bi,alignment:On,alignmentFocus:On.opposite(),width:On.equals(te.z6.Top)||On.equals(te.z6.Bottom)?25:18,height:On.equals(te.z6.Top)||On.equals(te.z6.Bottom)?18:25,fill:"orange",stroke:de.white,strokeWidth:4,mouseEnter:(_i,tr)=>tr.fill="dodgerblue",mouseLeave:(_i,tr)=>tr.fill="orange",isActionable:!0,click:Mi,contextClick:Mi})}function Mn(On){return Gt(te.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:(bi,Mi)=>Mi.fill="dodgerblue",mouseLeave:(bi,Mi)=>Mi.fill="orange",click:(bi,Mi)=>{bi.diagram.commandHandler.showContextMenu(Mi.part.adornedPart)}},On||{})}ye.current.nodeTemplate.selectionAdornmentTemplate=Gt(te.uz,"Spot",Gt(te.Vm,{padding:10}),un(te.z6.Top,"TriangleUp"),un(te.z6.Left,"TriangleLeft"),un(te.z6.Right,"TriangleRight"),un(te.z6.Bottom,"TriangleDown"),Mn({alignment:new te.z6(.75,0)}));function Ie(On,bi){return(Mi,_i)=>{Mi.handled=!0,Mi.diagram.model.commit(tr=>{tr.set(_i.part.adornedPart.data,On,bi)})}}function $e(On,bi){return bi||(bi="color"),Gt(te.bn,{width:16,height:16,stroke:"lightgray",fill:On,margin:1,background:"transparent",mouseEnter:(Mi,_i)=>_i.stroke="dodgerblue",mouseLeave:(Mi,_i)=>_i.stroke="lightgray",click:Ie(bi,On),contextClick:Ie(bi,On)})}function bn(){return[Gt("ContextMenuButton",Gt(te.s_,"Horizontal",$e(de.white,"fill"),$e(de.beige,"fill"),$e(de.extralightblue,"fill"),$e(de.extralightred,"fill"))),Gt("ContextMenuButton",Gt(te.s_,"Horizontal",$e(de.lightgray,"fill"),$e(de.lightgreen,"fill"),$e(de.lightblue,"fill"),$e(de.lightred,"fill")))]}function _n(){return[Gt("ContextMenuButton",Gt(te.s_,"Horizontal",$e(de.black),$e(de.green),$e(de.blue),$e(de.red))),Gt("ContextMenuButton",Gt(te.s_,"Horizontal",$e(de.white),$e(de.magenta),$e(de.purple),$e(de.orange)))]}function hi(On,bi){return bi||(bi="thickness"),Gt(te.bn,"LineH",{width:16,height:16,strokeWidth:On,margin:1,background:"transparent",mouseEnter:(Mi,_i)=>_i.background="dodgerblue",mouseLeave:(Mi,_i)=>_i.background="transparent",click:Ie(bi,On),contextClick:Ie(bi,On)})}function Yn(On,bi){return bi||(bi="dash"),Gt(te.bn,"LineH",{width:24,height:16,strokeWidth:2,strokeDashArray:On,margin:1,background:"transparent",mouseEnter:(Mi,_i)=>_i.background="dodgerblue",mouseLeave:(Mi,_i)=>_i.background="transparent",click:Ie(bi,On),contextClick:Ie(bi,On)})}function si(){return[Gt("ContextMenuButton",Gt(te.s_,"Horizontal",hi(1),hi(2),hi(3),hi(4))),Gt("ContextMenuButton",Gt(te.s_,"Horizontal",Yn(null),Yn([2,4]),Yn([4,4])))]}function ei(On,bi){return bi||(bi="figure"),Gt(te.bn,{width:32,height:32,scale:.5,fill:"lightgray",figure:On,margin:1,background:"transparent",mouseEnter:(Mi,_i)=>_i.fill="dodgerblue",mouseLeave:(Mi,_i)=>_i.fill="lightgray",click:Ie(bi,On),contextClick:Ie(bi,On)})}ye.current.nodeTemplate.contextMenu=Gt("ContextMenu",Gt("ContextMenuButton",Gt(te.s_,"Horizontal",ei("Rectangle"),ei("RoundedRectangle"),ei("Ellipse"),ei("Diamond"))),Gt("ContextMenuButton",Gt(te.s_,"Horizontal",ei("Parallelogram2"),ei("ManualOperation"),ei("Procedure"),ei("Cylinder1"))),Gt("ContextMenuButton",Gt(te.s_,"Horizontal",ei("Terminator"),ei("CreateRequest"),ei("Document"),ei("TriangleDown"))),bn(),_n(),si()),ye.current.groupTemplate=Gt(te.ZA,"Spot",{layerName:"Background",ungroupable:!0,locationSpot:te.z6.Center,selectionObjectName:"BODY",computesBoundsAfterDrag:!0,handlesDragDropForMembers:!0,mouseDrop:(On,bi)=>{var Mi=bi.addMembers(bi.diagram.selection,!0);Mi||bi.diagram.currentTool.doCancel()},avoidable:!1},new te.KX("location","loc",te.E9.parse).makeTwoWay(te.E9.stringify),Gt(te.s_,"Auto",{name:"BODY"},Gt(te.bn,{parameter1:10,fill:de.white,strokeWidth:2,cursor:"pointer",fromLinkable:!0,toLinkable:!0,fromLinkableDuplicates:!0,toLinkableDuplicates:!0,fromSpot:te.z6.AllSides,toSpot:te.z6.AllSides},new te.KX("fill"),new te.KX("stroke","color"),new te.KX("strokeWidth","thickness"),new te.KX("strokeDashArray","dash")),Gt(te.Vm,{background:"transparent",margin:20})),Gt(te.al,{alignment:te.z6.Top,alignmentFocus:te.z6.Bottom,font:"bold 12pt sans-serif",editable:!0},new te.KX("text"),new te.KX("stroke","color"))),ye.current.groupTemplate.selectionAdornmentTemplate=Gt(te.uz,"Spot",Gt(te.s_,"Auto",Gt(te.bn,{fill:null,stroke:"dodgerblue",strokeWidth:3}),Gt(te.Vm,{margin:1.5})),Mn({alignment:te.z6.TopRight,alignmentFocus:te.z6.BottomRight})),ye.current.groupTemplate.contextMenu=Gt("ContextMenu",bn(),_n(),si()),ye.current.linkTemplate=Gt(te.rU,{layerName:"Foreground",routing:te.rU.AvoidsNodes,corner:10,fromShortLength:10,toShortLength:15,relinkableFrom:!0,relinkableTo:!0,reshapable:!0,resegmentable:!0},new te.KX("fromSpot","fromSpot",te.z6.parse),new te.KX("toSpot","toSpot",te.z6.parse),new te.KX("fromShortLength","dir",On=>On>=1?10:0),new te.KX("toShortLength","dir",On=>On>=1?10:0),new te.KX("points").makeTwoWay(),Gt(te.bn,{strokeWidth:2},new te.KX("stroke","color"),new te.KX("strokeWidth","thickness"),new te.KX("strokeDashArray","dash")),Gt(te.bn,{segmentIndex:0,segmentOffset:new te.E9(15,0),segmentOrientation:te.rU.OrientAlong,alignmentFocus:te.z6.Right,figure:"circle",width:10,strokeWidth:0},new te.KX("fill","color"),new te.KX("visible","dir",On=>On===1)),Gt(te.bn,{segmentIndex:-1,segmentOffset:new te.E9(-10,6),segmentOrientation:te.rU.OrientPlus90,alignmentFocus:te.z6.Right,figure:"triangle",width:12,height:12,strokeWidth:0},new te.KX("fill","color"),new te.KX("visible","dir",On=>On>=1),new te.KX("width","thickness",On=>7+3*On),new te.KX("height","thickness",On=>7+3*On),new te.KX("segmentOffset","thickness",On=>new te.E9(-15,4+1.5*On))),Gt(te.bn,{segmentIndex:0,segmentOffset:new te.E9(15,-6),segmentOrientation:te.rU.OrientMinus90,alignmentFocus:te.z6.Right,figure:"triangle",width:12,height:12,strokeWidth:0},new te.KX("fill","color"),new te.KX("visible","dir",On=>On===2),new te.KX("width","thickness",On=>7+3*On),new te.KX("height","thickness",On=>7+3*On),new te.KX("segmentOffset","thickness",On=>new te.E9(-15,4+1.5*On))),Gt(te.al,{alignmentFocus:new te.z6(0,1,-4,0),editable:!0},new te.KX("text").makeTwoWay(),new te.KX("stroke","color"))),ye.current.linkTemplate.selectionAdornmentTemplate=Gt(te.uz,Gt(te.bn,{isPanelMain:!0,stroke:"transparent",strokeWidth:6,pathPattern:Ii(2)},new te.KX("pathPattern","thickness",Ii)),Mn({alignmentFocus:new te.z6(0,0,-6,-4)}));function Ii(On){return Gt(te.bn,{stroke:"dodgerblue",strokeWidth:2,strokeCap:"square",geometryString:"M0 0 M4 2 H3 M4 "+(On+4).toString()+" H3"})}function Ti(On){var bi="M0 0 M8 16 M0 8 L16 8 M12 11 L16 8 L12 5";return On===0?bi="M0 0 M16 16 M0 8 L16 8":On===2&&(bi="M0 0 M16 16 M0 8 L16 8 M12 11 L16 8 L12 5 M4 11 L0 8 L4 5"),Gt(te.bn,{geometryString:bi,margin:2,background:"transparent",mouseEnter:(Mi,_i)=>_i.background="dodgerblue",mouseLeave:(Mi,_i)=>_i.background="transparent",click:Ie("dir",On),contextClick:Ie("dir",On)})}function Di(On){var bi=(Mi,_i)=>{Mi.handled=!0,Mi.diagram.model.commit(tr=>{var pr=_i.part.adornedPart;tr.set(pr.data,On?"toSpot":"fromSpot",te.z6.stringify(te.z6.AllSides)),(On?pr.toNode:pr.fromNode).invalidateConnectedLinks()})};return Gt(te.bn,{width:12,height:12,fill:"transparent",mouseEnter:(Mi,_i)=>_i.background="dodgerblue",mouseLeave:(Mi,_i)=>_i.background="transparent",click:bi,contextClick:bi})}function We(On,bi){var Mi=0,_i=te.z6.RightSide;On.equals(te.z6.Top)?(Mi=270,_i=te.z6.TopSide):On.equals(te.z6.Left)?(Mi=180,_i=te.z6.LeftSide):On.equals(te.z6.Bottom)&&(Mi=90,_i=te.z6.BottomSide),bi||(Mi-=180);var tr=(pr,br)=>{pr.handled=!0,pr.diagram.model.commit(Or=>{var Ir=br.part.adornedPart;Or.set(Ir.data,bi?"toSpot":"fromSpot",te.z6.stringify(_i)),(bi?Ir.toNode:Ir.fromNode).invalidateConnectedLinks()})};return Gt(te.bn,{alignment:On,alignmentFocus:On.opposite(),geometryString:"M0 0 M12 12 M12 6 L1 6 L4 4 M1 6 L4 8",angle:Mi,background:"transparent",mouseEnter:(pr,br)=>br.background="dodgerblue",mouseLeave:(pr,br)=>br.background="transparent",click:tr,contextClick:tr})}ye.current.linkTemplate.contextMenu=Gt("ContextMenu",_n(),si(),Gt("ContextMenuButton",Gt(te.s_,"Horizontal",Ti(0),Ti(1),Ti(2))),Gt("ContextMenuButton",Gt(te.s_,"Horizontal",Gt(te.s_,"Spot",Di(!1),We(te.z6.Top,!1),We(te.z6.Left,!1),We(te.z6.Right,!1),We(te.z6.Bottom,!1)),Gt(te.s_,"Spot",{margin:new te.Zt(0,0,0,2)},Di(!0),We(te.z6.Top,!0),We(te.z6.Left,!0),We(te.z6.Right,!0),We(te.z6.Bottom,!0)))));const gr=`{ "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 yr=["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 $r(On){return console.log("shapeName:",On),yr.indexOf(On)>=0}var rn=new te.YI(Ln.current,{maxSelectionCount:1,linkTemplate:Gt(te.rU,{locationSpot:te.z6.Center,selectionAdornmentTemplate:Gt(te.uz,"Link",{locationSpot:te.z6.Center},Gt(te.bn,{isPanelMain:!0,fill:null,stroke:"deepskyblue",strokeWidth:0}),Gt(te.bn,{toArrow:"Standard",stroke:null}))},{routing:te.rU.AvoidsNodes,curve:te.rU.JumpOver,corner:5,toShortLength:4},new te.KX("points"),Gt(te.bn,{isPanelMain:!0,strokeWidth:2}),Gt(te.bn,{toArrow:"Standard",stroke:null})),model:new te.FJ([{text:"\u672A\u547D\u540D",size:"100 100",fill:null,stroke:"#000"},...te.bn.getFigureGenerators().toArray().map(On=>({text:"\u672A\u547D\u540D",size:"100 100",figure:On.key,fill:"white",stroke:"#666",borderColor:"#000"}))])});return ye.current.addDiagramListener("TextEdited",function(On){var bi;const Mi=On.subject.part;var _i=(bi=document.activeElement)==null?void 0:bi.value;typeof _i=="string"&&_i.trim()===""&&ye.current.model.commit(function(tr){tr.set(Mi.data,"text","\u672A\u547D\u540D"),ye.current.commandHandler.stopCommand()},"increment")}),rn.nodeTemplate=Gt(te.NB,"Auto",{locationSpot:te.z6.Center},new te.KX("location","location",te.E9.parse).makeTwoWay(te.E9.stringify),Gt(te.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 te.KX("stroke").makeTwoWay(),new te.KX("fill").makeTwoWay(),new te.KX("figure")),Gt(te.al,{margin:new te.Zt(5,5,3,5),font:"10pt sans-serif",minSize:new te.$u(16,16),maxSize:new te.$u(10,NaN),textAlign:"center",editable:!0},new te.KX("key").makeTwoWay())),setTimeout(()=>{ye.current.grid=Gt(te.s_,"Grid",Gt(te.bn,"LineH",{stroke:"lightgray",strokeWidth:.5}),Gt(te.bn,"LineV",{stroke:"lightgray",strokeWidth:.5})),ye.current.grid.visible=!0,ye.current.grid.gridCellStroke="darkgray",ye.current.grid.gridCellStrokeWidth=1},300),window.myDiagrams=ye.current,ye.current}const Xi=()=>Yt(this,null,function*(){var Gt,de=ye.current.makeImage();const un=yield(0,Pt.ZP)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:Date.now(),file:de.src,file_data:JSON.stringify({login:(Gt=(0,Zt.eY)())==null?void 0:Gt.login,data:JSON.parse(ye.current.model.toJson())})}});Se({src:un.url})});return(0,pt.useEffect)(()=>(setTimeout(()=>{Ei()},500),yi(An+1),()=>{ye.current=null}),[]),Mt.createElement("div",{ref:Je,className:"body-overflow-initial"},Mt.createElement(sn.default,{width:1200,icon:null,footer:null,closable:!0,visible:!!An,destroyOnClose:!0,maskClosable:!1,rootClassName:"zIndex-9999",title:Mt.createElement(ln.Z,null,Mt.createElement(Lt.Z,{flex:1},"\u63D2\u5165\u6D41\u7A0B\u56FE"),Mt.createElement(Lt.Z,{onClick:()=>{var Gt,de,un=ye.current.selection.first();if(Kn.current=!Kn.current,document.activeElement&&un){let Mn=(de=(Gt=document.activeElement)==null?void 0:Gt.value)==null?void 0:de.trim();typeof Mn=="string"&&ye.current.model.commit(function(Ie){Ie.set(un.data,"text",Mn||"\u672A\u547D\u540D"),ye.current.commandHandler.stopCommand()},"increment")}yi(An+1)}},Mt.createElement("span",{className:"current c-blue mr30",style:{fontWeight:400}},"\u5C55\u5F00/\u6536\u8D77"))),onCancel:pe},Mt.createElement("div",{style:{width:"100%",height:"80vh",overflow:"hidden",position:"relative",display:Kn.current?"none":"block"},className:Nt.flowChartWrp},Mt.createElement("div",{style:{display:"flex",height:"100%"}},Mt.createElement("div",{style:{width:"300px",height:"100%"}},Mt.createElement("div",{style:{background:"#fff",position:"relative",zIndex:12,fontSize:16,color:"#3061d0"}},"\u56FE\u5F62\u5E93"),Mt.createElement("div",{style:{height:"calc(100% - 50px)"},className:Nt.myPaletteDiv,ref:Ln})),Mt.createElement("div",{style:{flex:1,position:"relative"}},Mt.createElement("div",{ref:jn,style:{height:"80vh"}}))),Mt.createElement("div",{className:"tr"},Mt.createElement(ie.ZP,{size:"large",onClick:Xi,style:{position:"absolute",right:0,bottom:0,zIndex:8},type:"primary"},"\u4FDD\u5B58\u5230\u7F16\u8F91\u5668")))))}var De=Ge,Ue=kt(47889),we=kt(71051);const Ee=Ue.ZP.Group,Fe={margin:"0 8px"};var He=({callback:pe,onCancel:Se})=>{function ye(jn){pe(jn)}return pt.createElement(Ht.default,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:ye},pt.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},pt.createElement("span",{style:Fe},"\u5355\u5143\u683C\u6570\uFF1A"),pt.createElement("span",{style:Fe},"\u884C\u6570"),pt.createElement(Ht.default.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},pt.createElement(we.Z,null)),pt.createElement("span",{style:Fe},"\u5217\u6570"),pt.createElement(Ht.default.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},pt.createElement(we.Z,null))),pt.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},pt.createElement("span",{style:Fe},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),pt.createElement(Ht.default.Item,{name:"align"},pt.createElement(Ee,null,pt.createElement(Ue.ZP,{value:"default"},pt.createElement("i",{className:"fa fa-align-justify"})),pt.createElement(Ue.ZP,{value:"left"},pt.createElement("i",{className:"fa fa-align-left"})),pt.createElement(Ue.ZP,{value:"center"},pt.createElement("i",{className:"fa fa-align-center"})),pt.createElement(Ue.ZP,{value:"right"},pt.createElement("i",{className:"fa fa-align-right"}))))),pt.createElement("div",{className:"flex-container flex-end"},pt.createElement(ie.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),pt.createElement(ie.ZP,{type:"ghost",onClick:Se},"\u53D6\u6D88")))},qe=kt(71411),cn=kt(43001),gn=kt.n(cn),ze=(0,pt.forwardRef)(({use3d:pe,width:Se,height:ye,callback:jn,showSaveButton:Ln},Kn)=>{const Je=(0,pt.useRef)(),An=(0,pt.useRef)(),[yi,Ei]=(0,pt.useState)(!1),Xi=(0,pt.useRef)({id:Je,appName:"graphing",width:Se||1e3,height:ye||600,showToolBar:!0,showMenuBar:!0,allowStyleBar:!0,showAlgebraInput:!0,enableLabelDrags:!1,enableShiftDragZoom:!0,showToolBarHelp:!1,errorDialogsActive:!0,showTutorialLink:!0,showLogging:!0,useBrowserForJS:!1});(0,pt.useEffect)(()=>{An.current=new(gn())(Xi.current,!0),window.onload=function(){An.current.inject("applet_container")}},[]);const Gt=()=>{var de=window.ggbApplet.getPNGBase64(1,!0,72);return jn&&jn(de),de};return(0,pt.useEffect)(()=>{Xi.current.appName=yi?"3D":"graphing",An.current.inject("applet_container")},[yi]),(0,pt.useEffect)(()=>{Ei(pe)},[pe]),(0,pt.useImperativeHandle)(Kn,()=>({getImgData:Gt})),pt.createElement(pt.Fragment,null,pt.createElement("div",{style:{width:"100%",height:"100%"},id:"applet_container",ref:Je}),pt.createElement(ln.Z,{align:"middle"},pt.createElement(Lt.Z,{flex:1},pt.createElement(qe.Z,{size:"default",checkedChildren:"\u5173\u95ED3D\u56FE\u50CF",unCheckedChildren:"\u5F00\u542F3D\u56FE\u50CF",checked:yi,onChange:de=>Ei(de)})),pt.createElement(Lt.Z,null,pt.createElement(ie.ZP,{size:"large",onClick:Gt,style:{zIndex:8,marginTop:10},type:"primary"},"\u4FDD\u5B58\u5230\u7F16\u8F91\u5668"))))}),Ve=kt(76562),nn=kt(6767);const qn="link",vn="upload-image",tn="add-flowchart",Rn="draw-image",gi="add-flowchart",ti="code-block",vi="add-table",Gi="------------",Fn={default:Gi,left:`:${Gi}`,center:`:${Gi}:`,right:`${Gi}:`};var xn=kt(37808);function Tn(){}let ai=0;const pi=1e4,ui="\u2581",zi="@\u2581\u2581@",wt="@\u2581@",Xe=`
|
|
**\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`,Hn=["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 Ai(pe){return/^\d+$/.test(pe)?`${pe}px`:pe}const dr=navigator.platform.toUpperCase().indexOf("MAC")>=0?"Cmd":"Ctrl",kr={[dr+"-B"]:"bold",[dr+"-I"]:"italic"},ci={[qn]:"\u6DFB\u52A0\u94FE\u63A5",[ti]:"\u6DFB\u52A0\u4EE3\u7801\u5757",[vn]:"\u6DFB\u52A0\u56FE\u7247",[Rn]:"\u6DFB\u52A0\u753B\u56FE",[tn]:"\u63D2\u5165\u6D41\u7A0B\u56FE",[vi]:"\u6DFB\u52A0\u8868\u683C","maths-latex":"\u6570\u5B66\u56FE\u50CF","inline-latex":"LATEX\u516C\u5F0F"};var In=({defaultValue:pe="",onChange:Se,width:ye="100%",height:jn=400,miniToolbar:Ln=!1,isFocus:Kn=!1,watch:Je,insertTemp:An,mode:yi="markdown",id:Ei="markdown-editor-id",showResizeBar:Xi=!1,noStorage:Gt=!1,showNullButton:de=!1,showNullProgramButton:un=!1,hidetoolBar:Mn=!1,fullScreen:Ie=!1,onBlur:$e,onCMBeforeChange:bn,onFullScreen:_n,className:hi="",disablePaste:Yn=!1,disabled:si=!1,disabledFill:ei=!1,placeholder:Ii="",values:Ti="",extraUse:Di})=>{const[We,gr]=(0,pt.useState)(null),[yr,$r]=(0,pt.useState)(pe),[rn,On]=(0,pt.useState)(Je),[bi,Mi]=(0,pt.useState)(Ie),[_i,tr]=(0,pt.useState)(""),[pr,br]=(0,pt.useState)(0),[Or,Ir]=(0,pt.useState)(jn),[fn,ho]=(0,pt.useState)(!1),[pn,Hi]=(0,pt.useState)(0),[Kr,ji]=(0,pt.useState)(0),xo=(0,pt.useRef)(),Yr=(0,pt.useRef)(),Cr=(0,pt.useRef)(),Po=(0,pt.useRef)();(0,pt.useEffect)(()=>{const mi=window.scrollY||window.pageYOffset;$r(Ti),We==null||We.setValue(Ti),window.scrollTo(0,mi)},[Ti]),(0,pt.useEffect)(()=>{_n==null||_n(bi)},[bi]),(0,pt.useEffect)(()=>{if(xo.current){let mi=function(on,ki){var Ui;if(Yn){ki.preventDefault();return}const Tr=ki.clipboardData;if(Tr){const hr=Tr.types.toString(),ao=Tr.items;if(hr==="Files"||Tr.types.indexOf("Files")>-1){if(ki.preventDefault(),yi=="stex")return;try{let eo=ao[1];((Ui=ao[0])==null?void 0:Ui.kind)==="file"&&(eo=ao[0]);const qr=eo.getAsFile(),co=qr.name.split(".").pop();(0,Oe.I)(qr,uo=>{var bo,Be,so;uo.id?((bo=qr==null?void 0:qr.type)==null?void 0:bo.indexOf("image"))>-1?ii.replaceSelection(`<img width="100%" src="/api/attachments/${uo.id}?type=${uo.content_type})" alt="" />`):((Be=qr==null?void 0:qr.type)==null?void 0:Be.indexOf("video"))>-1?ii.replaceSelection(`<video width="100%" controls src="/api/attachments/${uo.id}"></video>`):((so=qr==null?void 0:qr.type)==null?void 0:so.indexOf("pdf"))>-1?ii.replaceSelection(`<a href="/api/attachments/${uo.id}?type=${qr.type}&disposition=inline" target="_blank">${qr.name}</a>`):Hn.includes(co)?ii.replaceSelection(`<a href="/api/attachments/${uo.id}?type=office&disposition=inline" target="_blank">${qr.name}</a>`):ii.replaceSelection(`[${qr.name}](/api/attachments/${uo.id}?type=${uo.content_type})`):(uo==null?void 0:uo.status)===401&&(document.location.href="/user/login")})}catch(eo){nn.ZP.warning("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0};const ii=ue().fromTextArea(xo.current,{mode:yi,lineNumbers:!Ln,lineWrapping:!0,value:pe,autoCloseTags:!0,autoCloseBrackets:!0});return ii.on("keyup",function(on,ki){ki.keyCode===8&&(on.getValue()==""?ii.setOption("placeholder",Ii):ii.setOption("placeholder",null))}),ii.on("keydown",function(on,ki){if(ki.keyCode===8){var Ui=Pn(on);Ui&&ki.preventDefault()}}),Kn&&ii.focus(),ii.on("paste",mi),si&&ii.on("beforeChange",function(on,ki){(ki.origin==="paste"||ki.origin==="+input")&&ki.cancel()}),gr(ii),()=>{ii.off("paste",mi)}}},[]);const je=(0,pt.useCallback)(()=>{if(Yr.current)try{}catch(mi){console.log(mi,"---- to set md editor body height")}},[Or,Yr,bi]);(0,pt.useEffect)(()=>{function mi(){let ii=new Le.Z(on=>{for(let ki of on)(ki.target.offsetHeight>0||ki.target.offsetWidth>0)&&(je(),We.setSize("100%","100%"),We.refresh())});return ii.observe(xo.current.parentElement),ii}if(We){const ii=mi();return()=>{var on,ki;(on=xo.current)!=null&&on.parentElement&&ii.unobserve((ki=xo.current)==null?void 0:ki.parentElement)}}},[We,je]),(0,pt.useEffect)(()=>{if(We){let mi=[];for(const[ii,on]of Object.entries(kr)){let ki={[ii]:()=>{be(on)}};mi.push(ki),We.addKeyMap(ki)}return()=>{for(let ii of mi)We.removeKeyMap(ii)}}},[We]),(0,pt.useEffect)(()=>{Ie!==bi&&Mi(Ie)},[Ie]),(0,xn.Z)(()=>{if(!Gt&&pr>0){let mi=new Date().getTime(),ii=window.sessionStorage.getItem(Ei);mi>=pr+pi&&(!ii||ii!==yr)&&(window.sessionStorage.setItem(Ei,yr),ho(!0))}},pi),(0,pt.useEffect)(()=>{On(Je)},[We,Je]),(0,pt.useEffect)(()=>{We&&Kn&&We.focus()},[We,Kn]),(0,pt.useEffect)(()=>{if(rn&&We){let mi=function(on){let ki=on.target;if(Po.current){let Ui=ki.scrollTop/ki.scrollHeight;Po.current.scrollTop=Po.current.scrollHeight*Ui}};const ii=We.getScrollerElement();return ii.addEventListener("scroll",mi),()=>{ii.removeEventListener("scroll",mi)}}},[We,rn]),(0,pt.useEffect)(()=>{if(We&&bn){let mi=function(ii,on){bn(ii,on)};return We.on("beforeChange",mi),()=>{We.off("beforeChange",mi)}}},[We,bn]),(0,pt.useEffect)(()=>{if(We&&$e){let mi=function(){$e(We.getValue())};return We.on("blur",mi),()=>{We.off("blur",mi)}}},[We,$e]);function Pn(mi,ii){var on=mi.getDoc(),ki=on.getCursor(),Ui=on.getLine(ki.line),Tr=Ui.charAt(ki.ch-1),hr=Ui.lastIndexOf("@\u2581@",ki.ch),ao=Ui.lastIndexOf("@\u2581\u2581@",ki.ch),eo=hr>ao?hr:ao,qr=hr>ao?3:4;if(zi.indexOf(Tr)===-1)return null;if(console.log("change1:",ii,mi,Ui,ki,eo,hr,ao,Tr),eo>=0&&ki.ch-eo<5){var co=eo+qr;return on.replaceRange("",{line:ki.line,ch:eo},{line:ki.line,ch:co}),{line:ki.line,ch:co}}return null}(0,pt.useEffect)(()=>{if(We){let mi=function(ii,on){const ki=ii.getValue();$r(ki),br(new Date().getTime()),ii.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),Se&&(un?Se(ki,Un(ki)):Se(ki))};return We.on("change",mi),()=>{We.off("change",mi)}}},[We,Se]),(0,pt.useEffect)(()=>{if(We)if(pe==null)We.setValue(""),$r("");else{const mi=window.scrollY||window.pageYOffset;pe!==We.getValue()&&(We.setValue(pe),$r(pe),We.setCursor(si?1:We.lineCount(),0),window.scrollTo(0,mi))}},[We,pe]);const be=(0,pt.useCallback)(mi=>{const ii=We.getCursor(),on=We.getSelection();let ki=on.split(`
|
|
`);switch(mi){case"bold":return We.replaceSelection("**"+on+"**"),on===""&&We.setCursor(ii.line,ii.ch+2),We.focus();case"italic":return We.replaceSelection("*"+on+"*"),on===""&&We.setCursor(ii.line,ii.ch+1),We.focus();case"code":return We.replaceSelection("`"+on+"`"),on===""&&We.setCursor(ii.line,ii.ch+1),We.focus();case"inline-latex":return tr("inline-latex"),We.focus();case"latex":return We.replaceSelection("```latex\n"+on+"\n```"),We.setCursor(ii.line+1,on.length+1),We.focus();case"line-break":return We.replaceSelection(`<br/>
|
|
`),We.focus();case"list-ul":return on===""?We.replaceSelection("- "+on):We.replaceSelection(ki.map(Ui=>Ui===""?"":`- ${Ui}`).join(`
|
|
`)),We.focus();case"list-ol":return on===""?We.replaceSelection("1. "+on):We.replaceSelection(ki.map((Ui,Tr)=>Ui===""?"":`${Tr+1}. ${Ui}`).join(`
|
|
`)),We.focus();case"add-null-ch":return on===""&&We.setCursor(ii.line,ii.ch),We.replaceSelection(ui),We.focus();case"add-signal":return on===""&&We.setCursor(ii.line,ii.ch),We.replaceSelection(wt),We.focus();case"add-multiple":return on===""&&We.setCursor(ii.line,ii.ch),We.replaceSelection(zi),We.focus();case"inster-template-1":return on===""&&We.setCursor(ii.line,ii.ch),We.replaceSelection(Xe),We.focus();case"eraser":return We.setValue(""),We.focus();case"trigger-watch":return On(!rn),We.focus();case"trigger-full-screen":return Mi(!bi),We.focus();case qn:tr(qn);return;case ti:tr(ti);return;case vn:tr(vn);return;case Rn:tr(Rn);return;case"maths-latex":tr("maths-latex");return;case tn:tr(tn);return;case vi:tr(vi);return;default:throw new Error}},[We,rn,bi]),At=(0,pt.useCallback)((mi,ii)=>{var on,ki,Ui,Tr,hr,ao;switch(tr(""),_i){case qn:const{title:bo,link:Be}=mi;return We.replaceSelection(`[${bo}](${Be})`),We.focus();case ti:const{language:so,content:Jr}=mi;return We.replaceSelection(["```"+so,Jr,"```"].join(`
|
|
`)),We.focus();case"maths-latex":for(var eo=atob(mi),qr=new Uint8Array(eo.length),co=0;co<eo.length;co++)qr[co]=eo.charCodeAt(co);var uo=new Blob([qr],{type:"image/png"});(0,Oe.I)(uo,aa=>{aa.id?We.replaceSelection(``):(aa==null?void 0:aa.status)===401&&(document.location.href="/user/login")});break;case"inline-latex":We.replaceSelection("`$$"+mi+"$$`");break;case vn:case Rn:case gi:const{src:fr,alt:Hr}=mi,Er=ii,Fo=(Ui=(ki=(on=Er==null?void 0:Er.name)==null?void 0:on.split("."))==null?void 0:ki.pop)==null?void 0:Ui.call(ki);return((Tr=Er==null?void 0:Er.type)==null?void 0:Tr.indexOf("image"))>-1||!(Er!=null&&Er.type)?Er!=null&&Er.align||Er!=null&&Er.width?We.replaceSelection(`<p style="text-align:${Er.align||"initial"}"><img width="${Er.width?Er.width+"%":"initial"}" src="${fr}" alt="${Hr||""}" /></p>`):We.replaceSelection(`<img width="100%" src="${fr}" alt="${Hr||""}" />`):((hr=Er==null?void 0:Er.type)==null?void 0:hr.indexOf("video"))>-1?We.replaceSelection(`<video width="100%" controls src="${fr}"></video>`):((ao=Er==null?void 0:Er.type)==null?void 0:ao.indexOf("pdf"))>-1?We.replaceSelection(`<a href="${fr}?type=${Er.type}&disposition=inline" target="_blank">${Er.name}</a>`):Hn.includes(Fo)?We.replaceSelection(`<a href="${fr}?type=office&disposition=inline" target="_blank">${Er.name}</a>`):We.replaceSelection(`[${Er.name}](${fr})`),We.focus();case vi:const{row:Lo,col:Rr,align:jr}=mi;let Za=`
|
|
`;for(let aa=0;aa<Lo;aa++){let As=[],Na=[];for(let nr=0;nr<Rr;nr++)aa===1&&Na.push(Fn[jr]),As.push(" ");aa===1&&(Za+=`| ${Na.join(" | ")} |
|
|
`),Za+=`| ${As.join(Rr===1?"":" | ")} |
|
|
`}return We.replaceSelection(Za+`
|
|
`),We.focus();default:throw new Error}},[We,_i]),Zn=(0,pt.useMemo)(()=>{switch(_i){case qn:return pt.createElement(Gn,{callback:At,onCancel:Jn});case ti:return pt.createElement(dn.Z,{callback:At,onCancel:Jn});case vn:return pt.createElement(Oe.Z,{callback:At,onCancel:Jn});case tn:return pt.createElement(De,{callback:At,onCancel:Jn});case vi:return pt.createElement(He,{callback:At,onCancel:Jn});case"maths-latex":return pt.createElement(ze,{showSaveButton:!0,callback:At});case"inline-latex":return pt.createElement(Ve.Z,{showSaveButton:!0,callback:At});default:return null}},[_i]);function Jn(){tr("")}(0,pt.useEffect)(()=>{if(Cr.current){let mi=function(hr){Ui=!0,Tr=hr.pageY},ii=function(){Ui=!1},on=function(hr){if(Ui){let ao=hr.pageY-Tr;ao<0&&(ao=0),ao>300&&(ao=300);let eo=jn+ao+"px";Ir(eo)}},ki=Cr.current,Ui=!1,Tr=0;return ki.addEventListener("mousedown",mi),document.addEventListener("mousemove",on),document.addEventListener("mouseup",ii),()=>{ki.removeEventListener("mousedown",mi),document.removeEventListener("mousemove",on),document.removeEventListener("mouseup",ii)}}},[We,Cr]),(0,pt.useEffect)(()=>{Ir(jn)},[jn]);const Ci=Ai(ye),Si=Ai(Or),li={width:Ci,height:Si},mn=(0,pt.useMemo)(()=>{if(pr){let mi=new Date(pr),ii=mi.getHours(),on=mi.getMinutes(),ki=mi.getSeconds();return ii=ii<10?"0"+ii:ii,on=on<10?"0"+on:on,ki=ki<10?"0"+ki:ki,`${ii}:${on}:${ki}`}return 0},[pr]),Un=mi=>{const ii=[];if(un){let on=-1;mi=mi.replace(/(@▁▁@|@▁@)/g,function(ki,Ui,Tr){ii.push({multiLine:ki!==wt})})}return ii};function Qn(){window.sessionStorage.removeItem(Ei),ho(!1),br(0)}function Dn(){ho(!1),br(0),We.setValue(window.sessionStorage.getItem(Ei))}(0,pt.useEffect)(()=>{ci[_i]&&_i!==Rn&&_i!==tn&&setTimeout(()=>{const mi=document.getElementsByClassName("markdown-popup-form")[0],ii=window.innerWidth/2-mi.offsetWidth/2,on=window.innerHeight/2-mi.offsetHeight/2;Hi(ii),ji(on)},0)},[_i]);const Xn=mi=>{mi.preventDefault();const ii=mi.clientX-pn,on=mi.clientY-Kr;document.body.onmousemove=ki=>{let Ui=ki.clientX-ii,Tr=ki.clientY-on;const hr=document.getElementsByClassName("markdown-popup-form")[0],ao=window.innerWidth-hr.offsetWidth,eo=window.innerHeight-hr.offsetHeight;Ui=Math.max(0,Math.min(Ui,ao)),Tr=Math.max(0,Math.min(Tr,eo)),Oi(ki.clientX,ki.clientY,ii,on)&&(Hi(Ui),ji(Tr))},document.body.onmouseup=function(){document.body.onmousemove=null}},Oi=(mi,ii,on,ki)=>{const Ui=document.body.clientHeight,Tr=document.body.clientWidth;return mi<20&&on>mi||mi>Tr-20&&on<mi||ii<20&&ki>ii||ii>Ui-20&&ki<ii?(document.body.onmousemove=null,document.body.onmouseup=null,!1):!0};return pt.createElement(pt.Fragment,null,pt.createElement("div",{className:"markdown-editor-wrapper",ref:Yr},pt.createElement("div",{className:`markdown-editor-container ${hi} ${rn?"on-preview":""} ${Ln?"mini":""} ${bi?"full-screen":""}`,style:li},pt.createElement($t,{insertTemp:An,watch:rn,fullScreen:bi,showNullButton:de,showNullProgramButton:un,onActionCallback:be,hidetoolBar:Mn,extraUse:Di}),pt.createElement("div",{className:"markdown-editor-body"},pt.createElement("div",{className:"codemirror-container"},pt.createElement("textarea",{ref:xo,placeholder:Ii})),rn?pt.createElement("div",{ref:Po,className:"preview-container"},yi==="stex"&&pt.createElement(se,{value:yr}),yi!=="stex"&&pt.createElement(Te.Z,{disabledFill:ei,showProgramFill:un,value:yr})):null))),Xi?pt.createElement("a",{ref:Cr,className:"editor-resize"}):null,_i===Rn&&pt.createElement(yn,{callback:At,onCancel:Jn}),_i===tn&&pt.createElement(De,{callback:At,onCancel:Jn}),pt.createElement(Xt.Z,null,ci[_i]&&_i!==Rn&&_i!==tn?pt.createElement(sn.default,{maskClosable:!1,centered:!0,style:{position:"absolute",left:pn,top:Kr},title:pt.createElement("div",{style:{cursor:"move"},onMouseDown:Xn},ci[_i]),open:!0,onCancel:Jn,footer:null,destroyOnClose:!0,width:_i===tn?"1200px":null,height:_i===tn?"80vh":null,className:"markdown-popup-form"},Zn):null))}},17077:function(Bn,zn,kt){"use strict";kt.d(zn,{Z:function(){return Tt},I:function(){return $t}});var pt=kt(28284),Ut=kt(6767),ue=kt(37568),Le=kt(77736),he=kt(71051),Dt=kt(47889),qt=kt(99571),me=kt(46699),ne=kt(59301),jt=kt(59301),Te=Object.defineProperty,se=Object.defineProperties,Ce=Object.getOwnPropertyDescriptors,Bt=Object.getOwnPropertySymbols,nt=Object.prototype.hasOwnProperty,et=Object.prototype.propertyIsEnumerable,ht=(Xt,Ht,ve)=>Ht in Xt?Te(Xt,Ht,{enumerable:!0,configurable:!0,writable:!0,value:ve}):Xt[Ht]=ve,st=(Xt,Ht)=>{for(var ve in Ht||(Ht={}))nt.call(Ht,ve)&&ht(Xt,ve,Ht[ve]);if(Bt)for(var ve of Bt(Ht))et.call(Ht,ve)&&ht(Xt,ve,Ht[ve]);return Xt},gt=(Xt,Ht)=>se(Xt,Ce(Ht));const{useForm:vt}=pt.default,St={width:280,marginRight:10},Et={labelCol:{span:5},wrapperCol:{span:19}};var Tt=({callback:Xt,onCancel:Ht})=>{const[ve]=vt();let ie=(0,ne.useRef)();function Ne(Qe){ie.current.width=ve.getFieldValue("width"),ie.current.align=ve.getFieldValue("align"),Xt(Qe,ie.current)}function xe(Qe,_e){if(Qe.status===-1){Ut.ZP.error(Qe.message);return}ve.setFieldsValue({src:`/api/attachments/${Qe.id}`,type:_e.type})}function Pe(Qe){let _e=Qe.target.files[0];ie.current=_e,$t(_e,xe)}return jt.createElement(pt.default,gt(st({form:ve},Et),{className:"upload-image-panel",onFinish:Ne,style:{width:470,overflow:"hidden"}}),jt.createElement(pt.default.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},jt.createElement("div",{className:"flex-container"},jt.createElement(pt.default.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u5730\u5740"}]},jt.createElement(ue.default,{style:St})),jt.createElement(Ot,{onFileChange:Pe}))),jt.createElement(pt.default.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},jt.createElement(ue.default,{style:{width:264}})),jt.createElement(pt.default.Item,{label:"\u56FE\u7247\u5BBD\u5EA6",name:"width"},jt.createElement(Le.Z,null,jt.createElement(pt.default.Item,{name:"width",style:{margin:0}},jt.createElement(he.Z,{style:{width:264}})),jt.createElement("span",{className:"ml8"},"%"))),jt.createElement(pt.default.Item,{label:"\u5BF9\u9F50\u65B9\u5F0F",name:"align"},jt.createElement(Dt.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"}]})),jt.createElement("aside",null,jt.createElement(pt.default.Item,{style:{textAlign:"right",position:"relative",right:-98}},jt.createElement(qt.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),jt.createElement(qt.ZP,{type:"default",onClick:Ht},"\u53D6\u6D88"))))};function Ot({onFileChange:Xt}){return jt.createElement("label",{className:"upload-button",style:{cursor:"pointer"}},"\u672C\u5730\u4E0A\u4F20",jt.createElement("input",{type:"file",onChange:Xt}))}function $t(Xt,Ht){if(!Xt)throw new String("\u6CA1\u6709\u6587\u4EF6");let ve=new FormData;ve.append("editormd-image-file",Xt),ve.append("file_param_name","editormd-image-file"),ve.append("byxhr","true");var ie=new window.XMLHttpRequest;ie.withCredentials=!0,ie.addEventListener("load",function(Ne){Ht(JSON.parse(Ne.target.responseText),Xt)},!1),ie.addEventListener("error",function(Ne){console.error(Ne)},!1),ie.open("POST",`${me.KI}/api/attachments.json`),ie.send(ve)}},91558:function(Bn,zn,kt){"use strict";kt.d(zn,{Z:function(){return ue}});var pt=kt(59301),Ut=kt(4676);class ue extends pt.Component{constructor(he){super(he);const Dt=window.document;this.node=Dt.createElement("div"),Dt.body.appendChild(this.node)}render(){const{children:he}=this.props;return(0,Ut.createPortal)(he,this.node)}componentWillUnmount(){window.document.body.removeChild(this.node)}}},75975:function(Bn,zn,kt){"use strict";kt.d(zn,{SV:function(){return Ge},ZP:function(){return Yt}});var pt=kt(59301),Ut=kt(76374);const ue={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"]},Le={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"]},he={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(`
|
|
`)}]},Dt={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(`
|
|
`)}]},qt={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 me=kt(53184),ne=kt.n(me),jt=Object.defineProperty,Te=Object.defineProperties,se=Object.getOwnPropertyDescriptors,Ce=Object.getOwnPropertySymbols,Bt=Object.prototype.hasOwnProperty,nt=Object.prototype.propertyIsEnumerable,et=(De,Ue,we)=>Ue in De?jt(De,Ue,{enumerable:!0,configurable:!0,writable:!0,value:we}):De[Ue]=we,ht=(De,Ue)=>{for(var we in Ue||(Ue={}))Bt.call(Ue,we)&&et(De,we,Ue[we]);if(Ce)for(var we of Ce(Ue))nt.call(Ue,we)&&et(De,we,Ue[we]);return De},st=(De,Ue)=>Te(De,se(Ue)),gt=(De,Ue,we)=>new Promise((Ee,Fe)=>{var He=gn=>{try{cn(we.next(gn))}catch(ni){Fe(ni)}},qe=gn=>{try{cn(we.throw(gn))}catch(ni){Fe(ni)}},cn=gn=>gn.done?Ee(gn.value):Promise.resolve(gn.value).then(He,qe);cn((we=we.apply(De,Ue)).next())});const vt={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"]}},St=(De,Ue)=>Ue.map(we=>({label:we,kind:De.languages.CompletionItemKind.Keyword,insertText:we})),Et=De=>Object.keys(vt.tables).map(Ue=>({label:Ue,kind:De.languages.CompletionItemKind.Variable,insertText:Ue})),Tt=(De,Ue)=>{const we=vt.tables[De];return we?we.map(Ee=>({label:Ee,kind:Ue.languages.CompletionItemKind.Field,insertText:Ee})):[]};function Ot(De,Ue,we,Ee,Fe){let He=Ue.getWordUntilPosition(we),qe={startLineNumber:we.lineNumber,endLineNumber:we.lineNumber,startColumn:He.startColumn,endColumn:He.endColumn},cn=Ee.map(gn=>({label:gn,kind:De.languages.CompletionItemKind.Keyword,insertText:gn,insertTextRules:De.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:qe}));return Fe.map(gn=>{cn.push(st(ht({},gn),{range:qe}))}),cn}var $t=De=>{vt.languages.map(Fe=>(De.languages.registerDocumentFormattingEditProvider(Fe,{provideDocumentFormattingEdits(He,qe,cn){return gt(this,null,function*(){const gn=ne()(He.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:He.getFullModelRange(),text:gn}]})}}),Fe));const Ue=he.quickKey.map(Fe=>({label:Fe.label,kind:De.languages.CompletionItemKind.Method,insertText:Fe.content,insertTextRules:De.languages.CompletionItemInsertTextRule.InsertAsSnippet})),we=Dt.quickKey.map(Fe=>({label:Fe.label,kind:De.languages.CompletionItemKind.Method,insertText:Fe.content,insertTextRules:De.languages.CompletionItemInsertTextRule.InsertAsSnippet})),Ee=Le.quickKey.map(Fe=>({label:Fe.label,kind:De.languages.CompletionItemKind.Method,insertText:Fe.content,insertTextRules:De.languages.CompletionItemInsertTextRule.InsertAsSnippet}));De.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(Fe,He){var qe=Fe.getWordUntilPosition(He),cn={startLineNumber:He.lineNumber,endLineNumber:He.lineNumber,startColumn:qe.startColumn,endColumn:qe.endColumn},gn=Fe.getLineContent(He.lineNumber).substring(qe.startColumn-2,qe.endColumn);return{suggestions:[...he.keywords.map(ni=>({label:ni,kind:De.languages.CompletionItemKind.Function,documentation:ni,insertText:ni,insertTextRules:De.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:cn})),...he.quickKey.map(ni=>({label:ni.label,kind:De.languages.CompletionItemKind.Function,documentation:ni.content,insertText:gn.startsWith("#")?ni.content.replace(/#/,""):ni.content,insertTextRules:De.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:cn}))]}}}),De.languages.registerCompletionItemProvider("c",{provideCompletionItems:function(Fe,He){var qe=Fe.getWordUntilPosition(He),cn={startLineNumber:He.lineNumber,endLineNumber:He.lineNumber,startColumn:qe.startColumn,endColumn:qe.endColumn};return{suggestions:[...ue.keywords.map(gn=>({label:gn,kind:De.languages.CompletionItemKind.Function,documentation:gn,insertText:gn,insertTextRules:De.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:cn}))]}}}),De.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(Fe,He){var qe=Fe.getWordUntilPosition(He),cn={startLineNumber:He.lineNumber,endLineNumber:He.lineNumber,startColumn:qe.startColumn,endColumn:qe.endColumn},gn=Fe.getLineContent(He.lineNumber).substring(qe.startColumn-2,qe.endColumn);return{suggestions:[...Le.keywords.map(ni=>({label:ni,kind:De.languages.CompletionItemKind.Function,documentation:ni,insertText:ni,insertTextRules:De.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:cn})),...Le.quickKey.map(ni=>({label:ni.label,kind:De.languages.CompletionItemKind.Function,documentation:ni.content,insertText:gn.startsWith("#")?ni.content.replace(/#/,""):ni.content,insertTextRules:De.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:cn}))]}}}),De.languages.registerCompletionItemProvider("scala",{provideCompletionItems:function(Fe,He){var qe=Fe.getWordUntilPosition(He),cn={startLineNumber:He.lineNumber,endLineNumber:He.lineNumber,startColumn:qe.startColumn,endColumn:qe.endColumn},gn=Fe.getLineContent(He.lineNumber).substring(qe.startColumn-2,qe.endColumn);return{suggestions:[...qt.keywords.map(ni=>({label:ni,kind:De.languages.CompletionItemKind.Function,documentation:ni,insertText:ni,insertTextRules:De.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:cn})),...qt.quickKey.map(ni=>({label:ni.label,kind:De.languages.CompletionItemKind.Function,documentation:ni.content,insertText:gn.startsWith("#")?ni.content.replace(/#/,""):ni.content,insertTextRules:De.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:cn}))]}}}),De.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(Fe,He){var qe=Fe.getWordUntilPosition(He),cn={startLineNumber:He.lineNumber,endLineNumber:He.lineNumber,startColumn:qe.startColumn,endColumn:qe.endColumn},gn=Fe.getLineContent(He.lineNumber).substring(qe.startColumn-2,qe.endColumn);return{suggestions:[...Dt.keywords.map(ni=>({label:ni,kind:De.languages.CompletionItemKind.Function,documentation:ni,insertText:ni,insertTextRules:De.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:cn})),...Dt.quickKey.map(ni=>({label:ni.label,kind:De.languages.CompletionItemKind.Function,documentation:ni.content,insertText:gn.startsWith("#")?ni.content.replace(/#/,""):ni.content,insertTextRules:De.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:cn}))]}}})};const Xt="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002";var Ht=Object.defineProperty,ve=(De,Ue,we)=>Ue in De?Ht(De,Ue,{enumerable:!0,configurable:!0,writable:!0,value:we}):De[Ue]=we,ie=(De,Ue,we)=>ve(De,typeof Ue!="symbol"?Ue+"":Ue,we);const Ne=class px{constructor(Ue,we,Ee){this.placeholder=Ue,this.editor=we,this.monaco=Ee,we.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)}};ie(Ne,"ID","editor.widget.placeholderHint");var Pe=Ne,Qe=kt(96236),_e=kt(6767),an=kt(25399),Ke=kt(89392),re=kt(49535),Jt=kt(56102),Ye=Object.defineProperty,Gn=Object.defineProperties,dn=Object.getOwnPropertyDescriptors,Oe=Object.getOwnPropertySymbols,sn=Object.prototype.hasOwnProperty,ln=Object.prototype.propertyIsEnumerable,Vn=(De,Ue,we)=>Ue in De?Ye(De,Ue,{enumerable:!0,configurable:!0,writable:!0,value:we}):De[Ue]=we,Ae=(De,Ue)=>{for(var we in Ue||(Ue={}))sn.call(Ue,we)&&Vn(De,we,Ue[we]);if(Oe)for(var we of Oe(Ue))ln.call(Ue,we)&&Vn(De,we,Ue[we]);return De},yn=(De,Ue)=>Gn(De,dn(Ue)),te=(De,Ue)=>{var we={};for(var Ee in De)sn.call(De,Ee)&&Ue.indexOf(Ee)<0&&(we[Ee]=De[Ee]);if(De!=null&&Oe)for(var Ee of Oe(De))Ue.indexOf(Ee)<0&&ln.call(De,Ee)&&(we[Ee]=De[Ee]);return we},En=(De,Ue,we)=>new Promise((Ee,Fe)=>{var He=gn=>{try{cn(we.next(gn))}catch(ni){Fe(ni)}},qe=gn=>{try{cn(we.throw(gn))}catch(ni){Fe(ni)}},cn=gn=>gn.done?Ee(gn.value):Promise.resolve(gn.value).then(He,qe);cn((we=we.apply(De,Ue)).next())});function ri(De){return/^\d+$/.test(De)?`${De}px`:De}function Rt(){}let Lt=!1;const Pt={"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 Nt(De=[]){let Ue=De;if(Array.isArray(De)){for(let we=0;we<De.length;we++){let Ee=Pt[De[we]];if(Ee)return Ee}return Ue[0]}return Pt[Ue]||Ue}let Zt=null;const Mt=()=>En(void 0,null,function*(){try{yield navigator.clipboard.writeText(" "),console.log("\u5185\u5BB9\u5DF2\u81EA\u52A8\u590D\u5236\u5230\u526A\u8D34\u677F:")}catch(De){console.error("\u81EA\u52A8\u590D\u5236\u5931\u8D25:",De)}});var Yt=De=>{var Ue=De,{width:we="100%",height:Ee="100%",value:Fe,language:He="javascript",style:qe={},options:cn={},overrideServices:gn={},theme:ni="vs-dark",onEditBlur:ze,isCopy:Ve=!1,onSave:nn,autoHeight:qn=!1,forbidCopy:vn=!1,onChange:tn=Rt,editorDidMount:Rn=Rt,onFocus:gi=Rt,onBreakPoint:ti=Rt,breakPointValue:vi=[],filename:Gi="educoder.txt",errorLine:Fn,errorContent:xn="",highlightLine:Tn,openBreakPoint:ai=!1,placeholder:pi="",showMiniMap:ui=!0}=Ue,zi=te(Ue,["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 wt=(0,pt.useRef)(),Xe=(0,pt.useRef)({}),Hn=(0,pt.useRef)(),Ai=(0,pt.useRef)(),Vi=(0,pt.useRef)([]),dr=(0,pt.useRef)(!1),kr=(0,pt.useRef)(),ci=(0,pt.useRef)(),In=(0,pt.useRef)(!1),[pe,Se]=(0,pt.useState)(!1);function ye(){let bn;return wt.current&&(bn=new Ut.Z(_n=>{for(let hi of _n)(hi.target.offsetHeight>0||hi.target.offsetWidth>0)&&Xe.current.instance.layout()}),bn.observe(wt.current)),bn}function jn(){_e.ZP.warning({content:decodeURIComponent(Xt),key:"monaco-editor-tip"})}const Ln=()=>{let bn=Xe.current.instance;if(Fe!=null&&bn&&pe){const _n=bn.getModel();_n&&Fe!==_n.getValue()&&(Lt=!0,_n.setValue(Fe),bn.layout(),Lt=!1)}};(0,pt.useEffect)(()=>{const bn=re.Z.subscribe("formatDocument",_n=>{var hi;let Yn=Xe.current.instance;(hi=Yn==null?void 0:Yn.getAction)==null||hi.call(Yn,"editor.action.formatDocument").run()});return window.updateMonacoValue=_n=>{tn(_n)},bn},[]),(0,pt.useEffect)(()=>{var bn;let _n=Xe.current.instance;Ai.current&&clearTimeout(Ai.current),Ai.current=setTimeout(()=>{Ln()},500),Fe&&(Fe!=null&&Fe.length)&&((bn=_n==null?void 0:_n.updateOptions)==null||bn.call(_n,{lineNumbersMinChars:Math.max(Math.floor(Math.log10(Fe.split(/\r\n|\r|\n/g).length))+3,5)}))},[Fe,pe,Xe.current]),(0,pt.useEffect)(()=>{if(Fn&&Xe.current&&Xe.current.instance){let _n=Xe.current.instance;_n.changeViewZones(function(hi){var Yn=document.createElement("div");Yn.style.padding="10px 20px",Yn.style.width="calc(100% - 20px)",Yn.className="my-error-line-wrp",Yn.innerHTML=xn,hi.addZone({afterLineNumber:Fn||11,heightInLines:3,domNode:Yn})});var bn={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}};_n.addOverlayWidget(bn),_n.revealPositionInCenter({lineNumber:20,column:1})}},[Fn,Xe.current,pe]);const Kn=(bn="",_n)=>{if(!bn||bn.trim()==="")return!0;const Yn=Xe.current.instance.getModel().getLineTokens(_n);let si=!1;for(let ei=0;ei<2;ei++)Yn.getStandardTokenType(ei)===1&&(si=!0);return si};(0,pt.useEffect)(()=>{var bn;const _n=(bn=Xe.current)==null?void 0:bn.instance;if(_n&&pe&&vn){const hi=_n.onDidBlurEditorWidget(()=>{In.current=!1}),Yn=_n.onDidFocusEditorText(()=>{In.current=!0});return()=>{hi.dispose(),Yn.dispose()}}},[Xe.current,pe,vn]),(0,pt.useEffect)(()=>{var bn;if((bn=Xe.current)!=null&&bn.instance&&pe&&ai){let _n=Xe.current.instance,hi=_n.getModel();if(!hi)return;(()=>{var On;let bi=[],Mi=[];const _i=hi.getAllDecorations();for(let pr of _i)pr.options.className==="highlighted-line"&&(bi.push((On=pr==null?void 0:pr.range)==null?void 0:On.startLineNumber),Mi.push(pr==null?void 0:pr.id));if(Tn===bi[0])return;hi.deltaDecorations(Mi,[]);const tr=hi.getLineCount();Tn&&Tn<=tr&&(_n.deltaDecorations([],[{range:new Zt.Range(Tn,1,Tn,hi.getLineMaxColumn(Tn)),options:{isWholeLine:!0,className:"highlighted-line"}}]),_n.revealLineInCenter(Tn))})();const si=(On=!1)=>{var bi;let Mi=[],_i=[];const tr=hi.getAllDecorations();for(let pr of tr)pr.options.linesDecorationsClassName==="breakpoints-select"&&(Mi.push((bi=pr==null?void 0:pr.range)==null?void 0:bi.startLineNumber),_i.push(pr==null?void 0:pr.id));if(On)return{lines:Mi,ids:_i};ti(Mi)},ei=On=>En(void 0,null,function*(){let bi={range:new Zt.Range(On,1,On,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints-select"}};yield hi.deltaDecorations([],[bi]),si()}),Ii=On=>En(void 0,null,function*(){let bi=[];const Mi=_n.getLineDecorations(On);for(let _i of Mi)_i.options.linesDecorationsClassName==="breakpoints-select"&&bi.push(_i.id);yield hi.deltaDecorations(bi,[]),si()}),Ti=On=>{let bi=_n.getLineDecorations(On);for(let Mi of bi)if(Mi.options.linesDecorationsClassName==="breakpoints-select")return!0;return!1};if(!(0,Ke.isEqual)(vi,si(!0).lines)){hi.deltaDecorations(si(!0).ids,[]);const On=vi.map(bi=>({range:new Zt.Range(bi,1,bi,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints-select"}}));hi.deltaDecorations([],On)}const Di=_n.onDidChangeModelContent(On=>{let bi=_n.getPosition();if(bi){let Mi=bi.lineNumber;clearTimeout(ci.current),ci.current=setTimeout(()=>{Kn(hi.getLineContent(Mi),Mi)?Ii(Mi):Ti(Mi)?(Ii(Mi),ei(Mi)):si()},100)}}),We=_n.onMouseDown(On=>{var bi,Mi,_i;if(On.target.detail&&((_i=(Mi=(bi=On.target)==null?void 0:bi.element)==null?void 0:Mi.className)!=null&&_i.includes("line-numbers"))){let tr=On.target.position.lineNumber;if(Kn(hi.getLineContent(tr),tr))return;Ti(tr)?Ii(tr):ei(tr)}}),gr=On=>{let bi={range:new Zt.Range(On,1,On,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints-fake"}};Vi.current=_n.deltaDecorations(Vi.current,[bi])},yr=()=>{Vi.current=_n.deltaDecorations(Vi.current,[])},$r=_n.onMouseMove(On=>{var bi,Mi,_i;if(yr(),On.target.detail&&((_i=(Mi=(bi=On.target)==null?void 0:bi.element)==null?void 0:Mi.className)!=null&&_i.includes("line-numbers"))){let tr=On.target.position.lineNumber;if(Kn(hi.getLineContent(tr),tr))return;gr(tr)}}),rn=_n.onMouseLeave(()=>{yr()});return()=>{Di.dispose(),We.dispose(),$r.dispose(),rn.dispose()}}},[Xe.current,pe,vi,Tn,ai,He]),(0,pt.useEffect)(()=>{var bn;(bn=Xe.current)!=null&&bn.instance&&ai&&Xe.current.instance.setPosition({lineNumber:0,column:0})},[Tn]);function Je(){let bn=Xe.current.instance;if(bn){const _n=bn.getSelection(),hi=Xe.current.pastePos||{},Yn=new Zt.Range(hi.startLineNumber||_n.endLineNumber,hi.startColumn||_n.endColumn,hi.endLineNumber||_n.endLineNumber,hi.endColumn||_n.endColumn);setTimeout(()=>{bn.executeEdits("",[{range:Yn,text:""}])},300)}}function An(bn){(window.navigator.platform.match("Mac")?bn.metaKey:bn.ctrlKey)&&bn.keyCode==83&&(bn.preventDefault(),nn())}const yi=()=>{if(qn&&Xe.current.instance){const bn=Xe.current.instance.getContentHeight();Ie(bn<Ee?Ee:bn)}else Ie(Ee)};function Ei(bn){var _n=document.createEvent("MouseEvents");_n.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),bn.dispatchEvent(_n)}const Xi=bn=>{if(!In.current)return;const{keyCode:_n,ctrlKey:hi,metaKey:Yn,target:si,type:ei}=bn;return(ei==="paste"||(_n===67||_n===86)&&(Yn||hi))&&si.nodeName==="TEXTAREA"&&(jn(),bn.preventDefault()),!1};function Gt(bn,_n){var hi=window.URL||window.webkitURL||window,Yn=new Blob([_n]),si=document.createElementNS("http://www.w3.org/1999/xhtml","a");si.href=hi.createObjectURL(Yn),si.download=bn,Ei(si)}(0,pt.useEffect)(()=>{yi()},[yi]),(0,pt.useEffect)(()=>{wt.current&&!pe&&Promise.all([kt.e(8909),kt.e(6656)]).then(kt.bind(kt,71448)).then(bn=>{try{Zt=bn,Xe.current.instance=Zt.editor.create(wt.current,{value:Fe,language:Nt(He),theme:ni,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0,autoIndent:!0,contextmenu:!0,formatOnType:!0,minimap:{enabled:ui||!1}},gn);const _n=Xe.current.instance;let si=[...Qe.BH._menuItems].find(Di=>Di[0]._debugName=="EditorContext")[1],ei=["editor.action.clipboardCopyWithSyntaxHighlightingAction","editor.action.quickCommand","editor.action.clipboardCopyAction","editor.action.clipboardPasteAction","editor.action.clipboardCutAction"],Ii=(Di,We)=>{var gr,yr;let $r=Di._first;do We.includes((yr=(gr=$r.element)==null?void 0:gr.command)==null?void 0:yr.id)&&Di._remove($r);while($r=$r.next)};if(Rn(_n,Zt),setTimeout(()=>{yi(),Xe.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:()=>{Gt(Gi||"educoder.txt",_n.getValue())}})},500),Xe.current.subscription=_n.onDidChangeModelContent(Di=>{dr.current?clearTimeout(kr.current):(yi(),tn(_n.getValue(),Di)),kr.current=setTimeout(()=>{dr.current=!1},500)}),window.Monaco||$t(Zt,Nt(He)),vn&&(Ii(si,ei),wt.current.classList.add("noCopyPaste"),window.removeEventListener("keydown",Xi),window.removeEventListener("paste",Xi),window.addEventListener("keydown",Xi),window.addEventListener("paste",Xi)),window.Monaco=Zt,ze&&_n.onDidBlurEditorWidget(()=>{ze(_n.getValue())}),gi&&_n.onDidFocusEditorText(()=>{vn&&Mt(),gi(_n.getValue())}),vn){Mt();try{_n.onDidPaste(Di=>{const We=_n.getSelection(),gr=Xe.current.pastePos||{},yr=new Zt.Range(gr.startLineNumber||We.endLineNumber,gr.startColumn||We.endColumn,gr.endLineNumber||We.endLineNumber,gr.endColumn||We.endColumn);_n.executeEdits("",[{range:Di.range,text:""}])})}catch(Di){}}let Ti=ye();return pi&&typeof pi=="string"&&new Pe(pi,_n,Zt),Se(!0),()=>{const Di=Xe.current.instance;Di.dispose();const We=Di.getModel();We&&We.dispose(),Xe.current.subscription&&Xe.current.subscription.dispose(),Ti.unobserve(wt.current)}}catch(_n){}})},[]),(0,pt.useEffect)(()=>{if(Xe.current.instance&&pe)return document.addEventListener("keydown",An,!1),()=>{document.removeEventListener("keydown",An)}},[nn,pe]),(0,pt.useEffect)(()=>{let bn=Xe.current.instance;if(bn&&pe){let _n=Nt(He);Zt.editor.setModelLanguage(bn.getModel(),_n)}},[He,pe]),(0,pt.useEffect)(()=>{Xe.current.instance&&pe&&Zt.editor.setTheme(ni)},[ni,pe]),(0,pt.useEffect)(()=>{let bn=Xe.current.instance;Hn.current=cn,bn&&pe&&(bn.updateOptions(Ae({},cn)),setTimeout(()=>{bn.getModel().updateOptions(Ae({},cn))},200))},[JSON.stringify(cn),pe]),(0,pt.useEffect)(()=>{let bn=Xe.current.instance;bn&&pe&&bn.layout()},[we,Ee,pe]);const[de,un]=(0,pt.useState)(ri(we)),[Mn,Ie]=(0,pt.useState)(ri(Ee)),$e=yn(Ae({},qe),{width:de,height:Mn,position:"relative"});return pt.createElement("div",{className:"my-monaco-editor",ref:wt,style:$e},Ve&&pt.createElement(Jt.CopyToClipboard,{text:Fe,onCopy:()=>_e.ZP.success("\u590D\u5236\u6210\u529F")},pt.createElement(an.Z,{title:"\u590D\u5236\u4EE3\u7801"},pt.createElement("div",{style:{position:"absolute",top:0,right:10,cursor:"pointer",zIndex:10,color:"#165DFF"}},pt.createElement("i",{className:"iconfont icon-fuzhi8",style:{fontSize:14}})," \u590D\u5236\u4EE3\u7801"))))};function Ge({width:De="100%",height:Ue="100%",original:we,modified:Ee,language:Fe,options:He={}}){const qe=(0,pt.useRef)(),[cn,gn]=(0,pt.useState)(null);function ni(qn){let vn;return qe.current&&(vn=new Ut.Z(tn=>{for(let Rn of tn)(Rn.target.offsetHeight>0||Rn.target.offsetWidth>0)&&qn.layout()}),vn.observe(qe.current)),vn}(0,pt.useEffect)(()=>(qe.current&&Promise.all([kt.e(8909),kt.e(9404)]).then(kt.bind(kt,2550)).then(qn=>{Zt=qn;const vn=Zt.editor.createDiffEditor(qe.current,yn(Ae({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},He),{wordWrap:!0}));gn(vn);let tn=ni(vn);return()=>{vn.dispose();const Rn=vn.getModel();Rn&&Rn.dispose(),tn.unobserve(qe.current)}}),()=>{window.removeEventListener("keydown",checkPaste),window.removeEventListener("paste",checkPaste)}),[]),(0,pt.useEffect)(()=>{cn&&cn.setModel({original:Zt.editor.createModel(we,Fe),modified:Zt.editor.createModel(Ee,Fe)})},[we,Ee,Fe,cn]);const ze=ri(De),Ve=ri(Ue),nn={width:ze,height:Ve};return pt.createElement("div",{className:"my-diff-editor",ref:qe,style:nn})}},45775:function(Bn,zn,kt){"use strict";kt.d(zn,{jL:function(){return he},w9:function(){return sn},QD:function(){return vn},cQ:function(){return Jt},op:function(){return gn},O5:function(){return kr},_b:function(){return Gi},t7:function(){return st},Gi:function(){return En},YG:function(){return yn},qp:function(){return Te},vr:function(){return gi},qE:function(){return Ve},Je:function(){return St},wb:function(){return Qe},cq:function(){return Zt},tp:function(){return Bt}});var pt=kt(59301),Ut={flex_box_center:"flex_box_center___NeSU8",flex_space_between:"flex_space_between___ImTGl",flex_box_vertical_center:"flex_box_vertical_center___BtRd9",flex_box_center_end:"flex_box_center_end___qcLe3",flex_box_column:"flex_box_column___Ze_3q",banner:"banner___PoUBO",content:"content___XoDjy",btns:"btns___Pb35j"},ue="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAE4AAAA0CAYAAAAkEw66AAAAAXNSR0IArs4c6QAAGNVJREFUeF7VmwmwHVWdxr9zuvvu9+3ZXsxCiNkIQZOwEzMgyADjggsWgzPqOAJaMiCjYiGKqDBQAo4iWGAxA+ooMm7gBhSyhBBRIIBSAQlrHuTt7913t97PmfpOd4cXlLAFGO6rW9237719+/z6+6/nPIHX+XHttddaex38nlW2lLO1svq1wJ4aeFMM9CqFnNKoaYVapDAOicfjGEMKqKk2nrx59Lbt5xx6aPR6DEG8Hj/K3xwY0YtjSx2vYnlspLEsX0BRKUBrINtyX+PZp0r3fR+IIgzFSo9EsahFUfSHWIj7Pa919zvf2vlo+rFXdWivObjHJvR8S6vTJORHckV0+4GBAF4InwQlBCAIkEMXgCLA9Mn9WCef4ft8HWkgVIDn6ckwUA/HQfCzoFX71TsP6n/41aL3moHTWotnJnGysPEFx8ZcAtMqGTjh2NmVTL+iDB6BZurjsRSe2SogjhNwMZIngbZbqgXom8N26/KjV3femB7ebRxfE3DbRnW/k8c3LQvv5yCjOFVVqhgCyNnJmAhoxyOFasz1OeCM2lLTJryI4BQQUn1RAhI24Lc1dBjc2K6Nnv2edfP+sLvIvergxqb0vpHA1fk8lre9xBZpZsYKU9sMYiDvAHKaqU4HuANcZrIpcILiezRdo7z0aUw3BoJYI4gELAeI/bjZmBq9+PGNd5x/+unHua8U4KsKbriujxUSV9gW+rwg9WPTfpHgpEgUQgAFJwU6LSDwjSxA8F2jslSBBJaZKwVGJRv1pSAJLyQ8qlwLOA4Q1us31Z58+OTj3rX/E68E3qsGbmhK/6Nt40oIFMJwZ5URFh/cZoGgHQKODeSsaUEiA5iSy6IqYRnfmPq66YojPILbYbqpGXuhRhRrFPMSUaP+6OTAtuPff8ze97xceK8KuJGG/oBl4XsaKMTTsiwDKVXZjm1qsgRBU84TXi5VXqo24/syP5ce2xEg0gBDeAZWFijo79JnpLQxXSo7iICiIyD8qUfdxuQRRx24x5MvB95uBzfW1G+XFn4GoMMojQNOYWUK45b+jG9mW+PvFNAKEkqVYgI583VZcOB7WRrCqGwiaQovU1lAlaXKM/BMQNIGbN0FLGh0lySCVv0OP3aPOnKf2a2XCm+3ghuc1AvzOdwmLSwIwkQlBoxMtgZYCkvwQLafBYo0l2v6gBcCxRxQyifwM9PckRCniXIGbjo8wiI4bgnRRFul0XAZMABbaggVoytvo12vff7Qt/Rc8LqBm5jQndrBr3MFHOwyemaJbGaaAKzMp00zV2O+6VVnSTCPcYCNdrItEGAOcKxpVUQKLjPZ6VHVgEuf3Kf/rLk0Y4ViTpiAEUYKJaEgVDg2OTq1+j3r5w68FHi7TXFDU/El1Yr8VLudDM4IjUpLVWW2Mg0GgubybATNfN/0C5+eqjQ9oO0ngAmR0ZF5X2bKjLRZBUFgNE03AKhcPqk62wJsm+qjvyM4Aa0idFN1zcmvHraq90uvObihqej4YsH6nzCEyHwRB0WFZeZJ05xupsZSp6sty+2mXX2a/5rP0fT8MAHRZpmWph48J38zi6xUF1Vqft9KAg2BES6PmyChGGFTBVJ1kb/dq7XeeuTBs0deLLxXrLhHn2nP6+4s3Gk7Yl6Q5mpZMMjAGWjT0o+dgkR6BVnUzJSW2PpzhpHVqIygdPiEET3rzwiHP2QCSlrjUm1epE0el+R1/E6SmjDa2nGEat5Bu9089bC9O7/1moDT0GJkMv5eR6f1oVY7MRfjp2SiNgOO5pkFBpnkadmD/qflRrAtiUrBhJFdPnauJhI6SU6noXSyb2BmUZUqzYKEqSSSZ6SUSU34WagYVUsg9N27R7DtkONWrmRcf8HHK1Lc4EjrqHJn6ZdxBIsXkXU2MqVZqU/ja5ZU/MyWR5/Bps1/wfD2p+G7TUy1QziWRHfZgVXsREd3H1YtnoW+vl709nSjv7f0V4MwPnRaRUGlxSm8rG7N0pAMlim/CE4Jk+tRbTxmAoYK4Qit/Mhb9/a9eze9ILW/YQwv5jvmM/fcs720YMnMDeWStabtJrmVUVaqtsy3sRqgAm+96yH85qbb4DZqWNjfi57uHlRKJViWjSCM0Wr5aDRaqDebqDeaqLkRLFugp7OIQudMrFn+JvT3z8Ee8+dgVldxp+tkpUB42ZZgqLrEnyUq89MkODkunjVVoREFMao5G367een6lZ2fejEQXrbiBgbbn+qZUbyETcWs2KZ/Ynsoi6aMgEPjLVz6Xz/B1OjT2P8tyzB7Zm/i6IMQYRghDGk2ielkLaKIPiiM4PshGk0XzWYDU40a6m6Ickmi3N2Lt+y1B5a+eQ+sXLIQM7rLxi1QiR47I2l3xPizFFyitsQnmqhq8juNks1go2BrDRG4WwMv3veItT1TLwTvZYH7w0NP9y7sn3NPqSgXMiCYRuNz1MbE9eEnRnDhpVdh1fxu7L1iCYIwghcECKMYUfaMY4Rh8jogxJgQNQjP+CECpUK4H8bwPR8tgmzW0Ao8lEsW+vrn4sA1S7Fs2VKsXDIP1UrO3BymMD7PEwvj6wJjnjTTJFAEsUJOJj4y8iMUWIfE8bp1Kzs2virgtg23PtHTV7os9JI0wASFNPWg4vI54LGBMZz/je/i71YvQv/sWXA9D2EYIooiAzCOYoRxDM/z4Xo+PC+Az2MR31NpkU4fpKGUQKRkoiSCjCSiSCAKVPLddgON9hQsK0TXjA7su3YVDjt0Hdbu82ZzbQYgVZb6OJOW0GQjZW54XtACInTkHXjt5kXr9+r4zG4Hd/bZZ8uTTz1rY7liHxiHiR9h+sFAQHNxJMulCGed/x2jtHlv6ofruogILaZpEl6MIAiML2u1XQRhaIDxeKZGqoEAObgoTkBGkUp7bvRRfC0QRpZRkYqk6SjHcYDQryNXVNj/oLX4yIc/iMULZyVVSFr0GxVmlQWDg0xSFG5j372rV1fXr1wpdhldX7Kpbn2mtbqrs7jRkqLIC6VDzgIBwZUKwGXfuwFjA49g331WoO26CSwDh/BieK6HyakaPM9LTZbv0WQJL0r2o9ioMkhN2gDka0JkDhYpExW1FtCQEMKGlg6gbWhTxjPFaKBvZgUfP/njOHz9WrRS5QXG9AkvzeXoHxXrVw0n9puxEm8+dGVlaFeqe8ngBifiT1Y65aUha7+0+M7Sj0IeeOixYXznO1fiHQfvY1REs4wiBoIAcRQZkBOTk/B9P1GSCRBBoraQn/dTmDxOiATGLV+nioxjA49wINjAY4YtIaQFwX1hQYtkn/AtW+Okfzsdf/+OA9H2Uj+XdoiZltBebaGh2a9DrONYvfdtK8q/2L3gaurXxaI4WqUJJH2ETTPltVsaX73wvzG7IjGrrwce4RhoieKCMMDY+LiBZ2AwGJjAQKg0Sx6jCrWBmQAlTJo3vx+ZvIvOXLBEEAJCMPFNQrkBBwnNfcuGMFAFlIqRyxdw+he/gv1WL0PDTftzSicd41jBYaURa/SUHLTrjc+vX9mxy47JS1LcpoGB4qKOuZvzebFMpyUPT0BoTD023P0wfvWL67DfPsvhut4O80z8Woip+hQma41UWVQRDMwEXIQ43Se4OApSYEAYeAijwADSmp1RghPGt3Kb5MMJxEx9VJ2QNu8mYNlQUYj+hUtx9nnnolIpw83KrrSSMOCURmfOQejWr37bis6P7DbFba/ptZal77SlyPFy6WC5ZedBKYWLLrkKs6oOCvl8AoR+zWwjeL6L4dFRuJ5CEGpTsEeBQBD4iFWMWEWIwjpU6Ca+kNswNll+zCgECSkcKM02CQtS/nK0oxPDFDzRIYFSfYRIcFRfzgDktRz7z5/E8Scci7ar0g4xc0aePen0VaSAiLxHutVTe6/cRfn1khQ3OBEdU6xYv4oZbzjJopJISrX96aFtuOaH12D5ogXw/QABVZQFhCDC5NQ4xienEIQCbijh+RKTvXPhVYrIPTGAXLOOOJ4AwhAxzTKomTTEdHy1l/guc5voWTmXSPWFSVAwf7FRH83YuD5jxgQooS3HqE9Bomf2fJx9wcXo7KjAp3swLSZApjPeJUvDioLBkttYvHZtf/v5VPeSwD09Fp9Z7pDnEhzvD1MEqo2d2ut+swEPbr4fM3p7jIqYbhjlBKHxdcMjQ0ZtXmjDbSsMLFqJx048AWDWv/kvWPjNy2DXB5hXAHEIpZqwZNVct1INSFkyoJRyE1g6hjaFnp2IDyrxezqFaMClHQdjsjljsrzuk8/4Cg46ZF9zPQYc05k0qpYswFH+uCW9VYcsm7F994CbiL5fKlkf4lyC1nSswnRlWcBfftVP0RgZRqGQR2jKKd/4JZrpxOQExicmEIQWvDCHhu9gyz99FN76VQCt0AZmnnUxSg/cAUuGEKoJaBdSZjVpBCk7EnDahxRlKHCfjbccNPMis29mWSGMH6TqNKQxWStJVayccQvrjv4ATj7lRLTcpL1k2kym0GUJJlASvuvo6JADV3RtfsngbtXa3gsoBA3k3Rakb8GtiuiaUtk+xveUqRjoU9gmKuYFLr/yGkwMjSBH5xrQ4dNPBaYiGBwehOu24QUCXuhgSnTjsTPOQDxvRjqjrNB31tdRfvwB5O0cEI9BaA9SVhCpGqA56+NAa/oIC5AER2XlmfdDhT60FLBoxlYAof0UnjLukAo1arPyxhev2vcAnHbWOSaJNmWe6elRCAm4TukrS0XvOGivrt+9aHDba8GaQt56r4A8XADztYIVKgimXH6M7iDUebackzJLIm8LlIsSP/jRz/HU1ieQcywDLnHwAWq1BsbGR5M6lYrzJEZmLsHw5z8LlOm0AWwfQ885X0Ol/oypHRFPwpZF2FYXwngEgoBEHpEaNwpTyJsqROsCgupMtFeshLt8Oap/ug8d998CKQgvgICfRFppm/QEBAdg1oIlOOMrF6BcLsAPlCnHIjPvClQcgW4nhFThPxy8ovPXLwjugaGh8uxyzwXlvPOxsoPC9PUaZpYoLZobHtAMtAEhoVDKSXSUHdy+YSN+d9MGFKm4NK0gwKHhUTSaNZPL+ZEFzwXGVrwNk6edlkDjHMLmrei78DzkLR8W18qoEUiRgxR5xKoJ2+ox4EJVh5B9UDqPel8vWgccAW/Naug5Myk84OkJzDn3FOTbIwacFASXJMSC/XOZhxISHTP6ceZ5F6GzuxNekEb5IKlIOvISvU7AhPiog5ZVbtgluE0DurigHPx4RnfunXQXbNJm8wEZQAYCphDs99c9YMqDKbALtjJNyNGRQVx++dWwtDA5GHMyz/ewfXAYntdE4AfwjFkINHsXY+JzXwPmdptGXunKH6D79uuRzxVhqwBKDSFnzTTRNIrHIQXz+RAxTVF1obFqPcY/ehLQVU2CLG+AApwNGzHjR99GTk0Bqg0pvCQ9sRxIY6o5aGmjWOnCmed/A70zZ8INmCpxbGwoAF0Fgd5cEBVkfNj+Szvu2CW4rUPumTN6C+faCijwxqTTeNmXssV+bM1w9oiqm2wToELgt1AtSHQULVxzzU/w5/u2mKUMcRCg3W7hmeFhBF4rKaPY6WDGJDrQnrcUrdX7wRkcQuXe22HHU7CFgDT+zE/AKR9au7CsPkSqAWWiaieG3nkCvPe9G+DSGQrqwUdRuHUjylvvQS4ahaObELoBAVqFSCsJzto4Jkg4OQdn/sd/ord/Plw/MtAIj5Y1oywxq+DXrThae8CKzq3PC+6ux4dndRZ67uut2nM68sn6jWxtx/QvZebKiWKCq7WAmtm2IZSPGR0FjI9uxxVXfB+tqTokYgNu++AQVOSZ1EErunSWRBXTyYASkLIAbdGnMBhI6Lhu5COlA61Ck39JUTHRVAtO73ej0TMbEyeeBj1vjlGauP8RVL7/A+SDQdiowVF1SN02UVaa2fAkl2NU5TNnC5z+5QswY/5iuG4EN1KmhtWxwNwuBws7w+G85S1ftaBr8nnB3f1Y8/hqtfzDzhzQU0qm0v4WOLam6ecIjl2GWhuYaFF5IcamJtFZtNDX4WDzvZvxv9dej9BzoaIIo+Oj0FEAzSxfhyYSa50W5iAU20RNafIuwmol/k0yGPAGJJ0OZSJqHkqWEcU22vPegua/nAR0dxvVWZv+iI6fXomcrsNRDWhNU9UmAWZoVVYOgsFBOCjlLXzqjC+ia+6eaHsRmp5GMScxu8NCf4eF7qKIRBQ8mnfkz4PQ/83SuX/d2BSbHmne3Fktv72vDHQUEsWxGnjuIwPH3hf93FQbGKnTXDUeGhiCFDFmVHPoKlu49dYN+O1vb4alYozXpqBjggvNBHDyYIHDhJVQ+IiSYolFuXHqBQhGT+VCWiUTGaOYQIuIhYWQ34tLcBeugH/ch4DuXmBkEJXvXoB8ewwWXGiT77GWSBoA9G9cKBcLB92dFZx02umI8r0m9Vszv4QVsx10FYUZu7GuNHeuN1XkB9FN7Xbwmb0XVh/KuIhNWwOvs2Tn+6rCZAecITezU9PWc5i0Ml0JZKbfwsTHDU0Bky6wYcs20w7qrThGeaW8xJ0bN+HW2+5Eo9k0lQT9jWkEMVHl2dnhoNp4VLBc4uI4JrKRAcgEO7HDXFLQE64oGNz0k0pUkvUhCxZDrz4A4tEHkXvwLtgihNSJa0gEQNfAXp0NZTnGVSxeuADHHHcCpJXD+9f0YcUc2zRgn6sXnr9O3yeBlqeGJyfDE1cvKlxvkuvfP6512QF6y8kCFwYHllHZsgSezAwh7ZhyPIRHH/fMJDDWAn72x8dQb7XRVbZNoKgWLBRyAvfe/wBuuf0u1CYnIWVaQ9K5pRMrdNw8v5khM2rjZ2iYVGJWfxJunJbwBGjm0kx6ohj/zQpryyS82lKQpopgI0AnLodmaop9C4rVAwTWH3wgluy9Fh/cbxbWLSqa6idbJfpcS3PNupNkQnuioVrDk976I1eV7xW3b2lvL5eKczoLQKWQrIqk6rIeWwYuWw1kymwFTLaAgQlgsK5xxa1bUGu66ChYqOSpXMss4Ms5EtsGnsatGzahMTaWhutsLWsaug2s7F5nix7S/CKZ/08L+7RlZMqpDJ4hk62JShWbLj805Ve2II9zlCbJQqW7C/sftA4HrZiPUw/vRweD7S7A0a/XXW1SsLYSeGpIbxiZeOpIccufG8dVOys/5r2o5JNVQaw9WUrxhDRbk46k62/5moobbySKu397gK/9ZgsKFlDNSZQJzhHI2xKOJVDISTRbbfzpwS0YePxxxL73rJzNwNJZ62yG2dzydNlOUqVnK4PTdpKRWLqfLe/JPpO9nuZnTFRNyFj5Apbtswr5rpn4wpELcPiyqhHKrhTHsTJ4TLnCWNdgA3Dr/lHiuo2j1XJf7x2VvNiHTbZyBs9OA8U02zcTMjKJrsNTwEgT+NE9ow9864Ytt/dVZVDNW6LsSBT5XUsgZ7P7L5BzbDPX+qeHH8HAlr+YZQeJjSWpwk4P2pdhk05mcHfHa3YyzXKa9GD6mez9hOiOhHjHwjzzOzZ65s3B/D2XolSt7nnh+5a9a0mfZcZLkTz3MrJronVxoQ+ziPEWsL3GXDZ60NjIr/6sjynk8EsHEPRxDBK8E1ztw+k+njhHFTqJCTMl4Qm21eDd/KR7+NePLt35fPnO/8fj592ljz5sPn49rwBUC4mF0bqmp2HZMguKhOC4kpPpF8fNgLEjkPzyz/qzjo3zcwKSyqOfy2avePKuNHgwUjEB3j4FbB1R973/3zfsh9ten/+nerk35RM36MPfswdu2qMDoqOY9BO59jhb6zJdbVneyhSMixPpnphR7BSBr3tAf9i2cH45j9k0Dy58Zreitwr0dSRK5J0YbwJDLfo39eWTDrTOebkDeL2+13e5nnPZfrh/UTdmVvOJb6fq6OsIzziK9H8lCI6RldtMcX46ZbDT9V//oJ6fAz4iBI7VMfYp5SBmEFw1uTNcezFcB56YQPv329qHfPXo8n2vF4BX8rsXbdS/WD0L72ZThfA4NrqiLIdlMGSfjtBYn1Nx9HH1wDQ7Nj9v6/zGB3S5HWCvUlFfvWiGWMYFQpQzzXSoAfxlWD1w0X1y33tPEkyy33CPk6/TBx8yF7f05pDjuIrOzuaaVUoExxKT43a5akFCtVys3+Wcwweu1dbHV+LxN3VhPsEx8jANGfOAh4eiL5x0iHPeG47YtAv+9I3xp9f0yIvLDAw6ySIY/ExSnpkqVcels/x/syLgtXHpx9bhlF2CO/tanVuzHHfPqmJVOf0nNdr5SFP7D02Eb/3iEfkdtdsbFeCXbtYfXlDGueU85iKZsjXZklnpyZdpGmgWFcS4pGsQnzvuOBG/4CzXFX/Qp+zZi28pPzkZHeNIS337X2+Qp+IckWajb1RsyXWffqOeN8tRH+rKyWOhsSBnYyYziiCAa0k8EQKb2kF01acPc3akXS8IbsW1Onf6AnVib16ewqWz21vq9qu2yNPeqL7thW7xZ65391jcV1jE/1qKFcaeCfDwOYeK9D83nv32/wHzrWgvjJ8Q7AAAAABJRU5ErkJggg==",he=({dataSource:ci=[],img:In,imgWidth:pe=346,title:Se,sunTitle:ye,bannerExtraContent:jn})=>pt.createElement("div",{className:Ut.banner},pt.createElement("div",{className:Ut.content},pt.createElement("aside",null,pt.createElement("p",null,pt.createElement("b",null,Se),pt.createElement("span",null,ye)),ci.length>0&&pt.createElement("div",{className:Ut.btns},ci.map((Ln,Kn)=>pt.createElement("div",{key:Kn,onClick:Ln.click},Ln.name,Ln.sign?pt.createElement("img",{src:ue,width:39}):null))),jn),In&&pt.createElement("img",{style:{marginTop:33,marginRight:38},src:In,width:pe}))),Dt={flex_box_center:"flex_box_center___hG6RI",flex_space_between:"flex_space_between___ss3Fh",flex_box_vertical_center:"flex_box_vertical_center___K80p9",flex_box_center_end:"flex_box_center_end___qmXX3",flex_box_column:"flex_box_column___GFV8F",row:"row___aXJjm",title:"title___HUKL0",tagsWrap:"tagsWrap___XB2W3",action:"action___VdHb1",bar:"bar___t1kKC",tag:"tag___V7Eft",name:"name___Hk1Ip",num:"num___xQpcH",active:"active___XryTX",tagsBorderWrap:"tagsBorderWrap___OMxjs"},qt=kt(92310),me=kt.n(qt),ne=kt(89392),Te=({dataSource:ci=[],value:In,onChange:pe,onTitleChange:Se,className:ye,title:jn,titleWidth:Ln=41,style:Kn={},fontColor:Je="#6A7283",showCount:An})=>{const[yi,Ei]=(0,pt.useState)(0),[Xi,Gt]=(0,pt.useState)(!1),de=(0,pt.useRef)(null),un=(0,pt.useRef)(null);return(0,pt.useEffect)(()=>{var Mn;ci.length!==0&&(((Mn=de==null?void 0:de.current)==null?void 0:Mn.clientHeight)>97?Ei(1):Ei(0)),ci.length===0&&Ei(0),Gt(!1)},[ci]),pt.createElement("div",{className:me()(Dt.row,ye),style:Kn},pt.createElement("div",{onClick:(0,ne.throttle)(()=>Se==null?void 0:Se(),2e3),style:{width:Ln,marginTop:Xi?12:4},className:`${Dt.title} ${Se?"current":""}`},jn),pt.createElement("div",{className:Xi?`${Dt.tagsWrap} ${Dt.tagsBorderWrap}`:Dt.tagsWrap},pt.createElement("div",{className:Dt.bar,ref:un,style:yi>0?{height:yi===1?97:"auto",overflow:yi===1?"hidden":"auto",paddingRight:55}:{paddingRight:0}},pt.createElement("div",{className:Dt.tag,ref:de},ci==null?void 0:ci.map(Mn=>pt.createElement("span",{onClick:()=>pe(Mn.id),key:Mn.id,style:{color:Je},className:In===Mn.id?Dt.active:""},pt.createElement("span",{title:Mn.name,className:Dt.name},Mn.name),!!An&&pt.createElement("span",{className:Dt.num},Mn.count))))),!!yi&&pt.createElement(pt.Fragment,null,yi===1?pt.createElement("div",{onClick:()=>{var Mn;Ei(2),((Mn=de==null?void 0:de.current)==null?void 0:Mn.clientHeight)>245?Gt(!0):Gt(!1)},className:Dt.action},"\u5C55\u5F00",pt.createElement("i",{style:{transform:"translateY(1px) scale(0.6)"},className:"iconfont icon-zhankai4"})):pt.createElement("div",{onClick:()=>{un.current.scrollTop=0,Ei(1),Gt(!1)},className:Dt.action},"\u6536\u8D77",pt.createElement("i",{style:{transform:"translateY(0px) scale(0.6)"},className:"iconfont icon-shouqi3"})))))},se={flex_box_center:"flex_box_center___aK2n3",flex_space_between:"flex_space_between___HX0Oh",flex_box_vertical_center:"flex_box_vertical_center___LJOJr",flex_box_center_end:"flex_box_center_end___SCakF",flex_box_column:"flex_box_column___AYv4m",tabs:"tabs___GTqPV",active:"active___F26E8"},Bt=({dataSource:ci=[],value:In,onChange:pe,className:Se,style:ye={}})=>pt.createElement("div",{style:ye,className:me()(se.tabs,Se)},ci.map(jn=>pt.createElement("span",{onClick:()=>pe(jn.id),className:In===jn.id?se.active:"",key:jn.id},jn.name))),nt={flex_box_center:"flex_box_center___yX6Oa",flex_space_between:"flex_space_between___t7oqF",flex_box_vertical_center:"flex_box_vertical_center___dEIHy",flex_box_center_end:"flex_box_center_end___taQDF",flex_box_column:"flex_box_column___xY_Lr",input:"input___PW2zI",dropdown:"dropdown___vSy8B",menu:"menu___NiyBu",text:"text___Grueu",b1:"b1___ZKryM",b2:"b2___aKyGa"},et=kt(37568),st=({dataSource:ci=[],value:In="",onChange:pe,onInputChange:Se=()=>{},className:ye,style:jn={},placeholder:Ln,allowClear:Kn=!1})=>{var Je;const[An,yi]=(0,pt.useState)(""),[Ei,Xi]=(0,pt.useState)("");(0,pt.useEffect)(()=>{var un;let Mn=In;(un=JSON.stringify(In))!=null&&un.includes("{")&&(yi(In.id),Mn=In.value||"");try{Xi(decodeURIComponent(Mn||""))}catch(Ie){Xi(decodeURIComponent(Mn||""))}},[In]);const Gt=()=>{pe(encodeURIComponent(Ei),An||null)},de=un=>{un!==An&&(yi(un),pe(encodeURIComponent(Ei),un))};return pt.createElement("div",{className:me()(nt.input,ye),style:jn},!!ci.length&&pt.createElement("div",{className:nt.dropdown},pt.createElement("div",{className:nt.text},(Je=ci.find(un=>un.id===An))==null?void 0:Je.name,pt.createElement("i",{className:"iconfont icon-zhankai4"}),pt.createElement("b",{className:nt.b1}),pt.createElement("b",{className:nt.b2})),pt.createElement("div",{className:nt.menu},ci.map((un,Mn)=>pt.createElement("div",{key:Mn,onClick:()=>de(un.id)},un.name)))),pt.createElement(et.default,{onPressEnter:Gt,value:Ei,onChange:un=>{Xi(un.target.value),Se(encodeURIComponent(un.target.value),An||null)},bordered:!1,placeholder:Ln}),pt.createElement("i",{onClick:Gt,className:"iconfont icon-sousuo9 font14 pl10 current"}))},gt={flex_box_center:"flex_box_center___tol8o",flex_space_between:"flex_space_between___Z235C",flex_box_vertical_center:"flex_box_vertical_center___Wq1sZ",flex_box_center_end:"flex_box_center_end___LLxom",flex_box_column:"flex_box_column___DbMSN",quickPager:"quickPager___GM30J",disabled:"disabled___Ozc8I"},St=({value:ci,onChange:In,className:pe,total:Se,pageSize:ye,style:jn={}})=>{const Ln=ci<2,Kn=ci>=Math.ceil(Se/ye);return Se<=ye?pt.createElement(pt.Fragment,null):pt.createElement("div",{className:me()(gt.quickPager,pe),style:jn},pt.createElement("div",{onClick:()=>{Ln||In(ci-1,"prev")},className:Ln?gt.disabled:""},"\u4E0A\u4E00\u9875"),pt.createElement("div",{onClick:()=>{Kn||In(ci+1,"next")},className:Kn?gt.disabled:""},"\u4E0B\u4E00\u9875"))},Et={flex_box_center:"flex_box_center___FO7TP",flex_space_between:"flex_space_between___LotYx",flex_box_vertical_center:"flex_box_vertical_center___bWdaw",flex_box_center_end:"flex_box_center_end___mVJ1o",flex_box_column:"flex_box_column___M83Mm",list:"list___oOsiS",wrap:"wrap___G6T7F",lockWrap:"lockWrap___Rl79E",li:"li___oZZ7l",cover:"cover___b2bYW",img:"img___IQX7w",sign:"sign___HkT6C",name:"name___SsJx8",e:"e___TMqq0",tags:"tags___bcjyo",rate:"rate___YACg7"},Tt=kt(29787),Ot=kt(25399),$t=kt(58018),Xt=kt(346),Ht=kt(51257),ve=kt(96908),ie=kt(57177),Ne=kt(81378),xe=kt(28426),Qe=({className:ci,dataSource:In=[],col:pe=4,right:Se,bottom:ye=23,precision:jn=0,wrapWidth:Ln=1200,trackEventItems:Kn,loading:Je})=>{const An=Math.floor((Ln-(pe-1)*Se)/pe);return pt.createElement(Tt.Z,{spinning:Je},pt.createElement("div",{className:me()(Et.list,ci)},!!In.length&&In.map((yi,Ei)=>{const{name:Xi,id:Gt,identifier:de,power:un,cover_image_id:Mn,pic:Ie}=yi;return pt.createElement("div",{className:Et.wrap,key:Gt,style:{width:An,marginRight:(1+Ei)%pe===0?0:Se+jn,marginBottom:ye}},pt.createElement("a",{target:"_blank",href:`/shixuns/${de}/challenges`,className:Et.li,onClick:$e=>{$e.preventDefault(),Kn&&(0,Ht.L9)([Kn]),un&&(0,Ht.xg)(`/shixuns/${de}/challenges`)}},pt.createElement("div",{className:Et.img},pt.createElement("img",{className:Et.cover,src:`${Ie}`}),yi.is_jupyter&&pt.createElement("img",{className:Et.sign,src:ve}),yi.is_jupyter_lab&&pt.createElement("img",{className:Et.sign,src:ie}),yi.is_unity_3d&&pt.createElement("img",{className:Et.sign,src:Ne})),pt.createElement("div",{className:Et.name},pt.createElement(Ot.Z,{title:Xi||"\u5B9E\u8DF5\u9879\u76EE\u540D\u79F0-\u672A\u586B\u5199"},pt.createElement("span",{className:Et.e},Xi||"\u5B9E\u8DF5\u9879\u76EE\u540D\u79F0-\u672A\u586B\u5199"))),pt.createElement("div",{className:Et.tags},pt.createElement(Ot.Z,{placement:"bottom",title:"\u5173\u5361\u6570"},pt.createElement("span",null,pt.createElement("i",{className:"iconfont icon-shixunguanqia font14 mr2"}),pt.createElement("span",null,yi.challenges_count))),!!yi.myshixuns_count&&pt.createElement(Ot.Z,{placement:"bottom",title:"\u5B66\u4E60\u4EBA\u6570"},pt.createElement("span",null,pt.createElement("i",{className:"iconfont icon-chengyuan font14 mr2"}),pt.createElement("span",null,yi.myshixuns_count))),pt.createElement(Ot.Z,{placement:"bottom",title:"\u96BE\u5EA6\u7B49\u7EA7"},pt.createElement("span",null,pt.createElement("span",null,yi.level))),pt.createElement("div",{className:Et.rate},pt.createElement($t.Z,{allowHalf:!0,disabled:!0,defaultValue:yi.score_info}),pt.createElement("span",null,"\xA0",yi.score_info?`${yi.score_info}\u5206`:"5\u5206")))),!un&&pt.createElement("div",{className:Et.lockWrap},pt.createElement("img",{src:`${Xt.Z.IMG_SERVER}/images/educoder/icon/lockclose.svg`}),pt.createElement("span",{className:"mt15 font16 c-white"},"\u5B9A\u5411\u5F00\u653E\u5185\u5BB9\uFF0C\u9700\u8981\u6388\u6743")))}),!In.length&&pt.createElement(xe.Z,null)))},_e={flex_box_center:"flex_box_center___AQ53o",flex_space_between:"flex_space_between___i2aIa",flex_box_vertical_center:"flex_box_vertical_center___sPEKB",flex_box_center_end:"flex_box_center_end___GhSSH",flex_box_column:"flex_box_column___R9_Hb",list:"list___jb2Ay",wrap:"wrap___VsQDr",lockWrap:"lockWrap___g1k1T",li:"li___IxCLC",cover:"cover___Mu8wr",img:"img___IpFLA",movebq:"movebq___mF7wt",bq:"bq___Bil0T",sign:"sign___DXJ4d",name:"name___l7FoJ",e:"e___pXQUG",unit:"unit___wCIFR",tags:"tags___w_Mil",tag1:"tag1___dxm7r",tag2:"tag2___llZkf"},an=kt(48790),Ke=kt(59301),Jt=({className:ci,dataSource:In=[],col:pe=4,right:Se,bottom:ye=23,precision:jn=0,wrapWidth:Ln=1200,trackEventItems:Kn,loading:Je,onRemove:An=()=>{},isCurrent:yi=!0,showAlias:Ei=!1})=>{const Xi=Math.floor((Ln-(pe-1)*Se)/pe),Gt=[{name:"\u63A8\u8350\u81EA\u5B66",ptimg:"/images/tjzx.png",swimg:"/images/sw_tjzx.png"},{name:"101\u8BA1\u5212",ptimg:"/images/jh.png",swimg:"/images/sw_jh.png"},{name:"\u56FD\u5BB6\u4E00\u6D41",ptimg:"/images/gjyl.png",swimg:"/images/sw_gjyl.png"},{name:"\u7701\u7EA7\u4E00\u6D41",ptimg:"/images/sjyl.png",swimg:"/images/sw_sjyl.png"},{name:"\u7CBE\u54C1\u8BFE\u7A0B",ptimg:"/images/jpkc.png",swimg:"/images/sw_jpkc.png"},{name:"\u519B\u961F\u4E00\u6D41",ptimg:"/images/jdyl.png",swimg:"/images/sw_jdyl.png"},{name:"\u65B0\u578B\u6559\u6750",ptimg:"/images/xxjc.png",swimg:"/images/sw_xxjc.png"}];return Ke.createElement(Tt.Z,{spinning:Je},Ke.createElement("div",{className:me()(_e.list,ci)},!!(In!=null&&In.length)&&(In==null?void 0:In.map((de,un)=>{var Mn;const{name:Ie,id:$e,identifier:bn,featured:_n,school_name:hi,image_url:Yn,excellent:si,is_plan:ei}=de;return Ke.createElement("div",{key:$e,className:_e.wrap,style:{width:Xi,marginRight:(1+un)%pe===0?0:Se+jn,marginBottom:ye}},Ke.createElement("a",{className:_e.li,onClick:Ii=>{Ii.preventDefault(),Ii.stopPropagation(),Kn&&(0,Ht.L9)([Kn]),(0,Ht.xg)(`/paths/${bn}`)}},Ke.createElement("div",{className:_e.img},Ke.createElement("img",{className:_e.cover,src:`${Yn}`}),yi&&(0,an.bg)()&&(de==null?void 0:de.studying)&&Ke.createElement("div",{className:`${_e.movebq} user-path-items`,onClick:Ii=>{Ii.stopPropagation(),An(de)}},Ke.createElement("i",{className:"iconfont icon-yichu1 mr5 c-red"}),Ke.createElement("span",{className:"c-red"},"\u79FB\u9664")),(Mn=de==null?void 0:de.subject_tags)==null?void 0:Mn.map((Ii,Ti)=>{var Di,We;if(Ti===0){const yr=(Di=Gt.find($r=>$r.name==Ii))==null?void 0:Di.swimg;return Ke.createElement("img",{className:_e.sign,src:yr,style:{left:"-4px"}})}const gr=(We=Gt.find(yr=>yr.name==Ii))==null?void 0:We.ptimg;return Ke.createElement("img",{className:_e.sign,src:gr,style:{left:`${48+52*(Ti-1)+2*Ti}px`}})}),Ke.createElement("div",{style:{position:"absolute",top:"150px",left:"4px"}},(de==null?void 0:de.excellent)&&Ke.createElement("div",{className:_e.bq},"\u5F00\u653E\u8BFE\u7A0B"))),Ke.createElement("div",{className:_e.name},Ke.createElement(Ot.Z,{title:Ei&&(de!=null&&de.excellent_alias_name)?Ke.createElement("span",null,`\u8BFE\u7A0B\u539F\u540D\uFF1A${Ie}`,Ke.createElement("br",null),Ke.createElement("span",null,`\u8BFE\u7A0B\u522B\u540D\uFF1A${de==null?void 0:de.excellent_alias_name}`)):Ie},Ke.createElement("span",{className:_e.e},Ei&&(de==null?void 0:de.excellent_alias_name)||Ie))),Ke.createElement(Ot.Z,{title:`\u53D1\u5E03\u5355\u4F4D\uFF1A${hi}`},Ke.createElement("div",{className:_e.unit},Ke.createElement("i",{className:"iconfont icon-danwei1 font14 mr3"}),hi)),Ke.createElement("div",{className:_e.tags},Ke.createElement("div",null,Ke.createElement(Ot.Z,{placement:"bottom",title:"\u7AE0\u8282\u6570"},Ke.createElement("span",null,Ke.createElement("i",{className:"iconfont icon-zhangjie1 font14 mr3"}),Ke.createElement("span",null,de.stages_count))),Ke.createElement(Ot.Z,{placement:"bottom",title:"\u5B66\u4E60\u4EBA\u6570"},Ke.createElement("span",null,Ke.createElement("i",{className:"iconfont icon-chengyuan font14 mr3"}),Ke.createElement("span",null,de.members_count)))))))})),!In.length&&Ke.createElement(xe.Z,null)))},Ye={flex_box_center:"flex_box_center___eMcr7",flex_space_between:"flex_space_between___HcNca",flex_box_vertical_center:"flex_box_vertical_center___ZnvVN",flex_box_center_end:"flex_box_center_end___fdgDf",flex_box_column:"flex_box_column___SEKvd",list:"list___L1hmU",wrap:"wrap___pKgcW",lockWrap:"lockWrap___SMhkK",top:"top___udHSB",sign:"sign___uwRpq",name:"name___Fpf90",img:"img___AMLhL",text:"text___KiTb7",btns:"btns___i6IuZ",bottom:"bottom____k2sh"},Gn="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHgAAAB4CAYAAAA5ZDbSAAAAAXNSR0IArs4c6QAAIABJREFUeF7tXWmQXFd1/s59r3t6nX00o93GluV9AQNxiAkIB0OMISFsFQqSAhOohFR+JKmEQPILClJZfpEfIUAChFQSHIJxnGDiDYwsb8KRLUuWZcmSxqN9pJF6nV7eSZ373u1509Mzvd2eGVt6VV2z9Ht3+9459+yX8Bq4mDmWK2GLqla3MvFWZt4KpjVMSBNzGoQ0M6WJkJbpMiNDxBkwMkyUIUYGxCeJaB8x7fMcZ18yiv1EVHy1Lw+9GicwO8tXlSrlbSB6O4HfANAmZlY250JEHsBHGLQTzA9H3chDfX2012Yfy9HWqwJgZh7NF6vvY/a2gWkbgyeWY3Hq+yDQcRA/RKQeSsSce4jo9EqMo50+Vy3AzNxXKFTv9MAfB/AuZo60M7Fe30tEZQA/UqBvx+POvUQ02+s+O2l/1QGcy5Xe6Cn1SXj8YYAHO5nU8j9DM1D0b8rzvpFMRp9a/v4X73HVAJwplN9GHj7P4NtW0wK1OxYCPcAKX0rHI4+0+2wv7l9xgHPFyrs9j78A5l/sxQRXrE2ix5SiLyZj7v+s2BgArBjA+XzpzR7oq8x880ouQK/7JqKnFfiziUT0iV731aj9ZQeYmYez+fJXiOguZl72/ldkkYmYmb+eSkT+lIjOLOcYlm2BBcx8sfoJz+O/BHhkOSe5evqiaaXoTxIx55tExMsxrmUBOJ/njVVUvgvmW5djUqu+D6JHHbgfTSRostdj7TnAuWLlDq/K37pwqXYxCGlaOfRbyZh7Xy9B7hnAzOzmCpUvA/jDC2WvbReogE3/TTLufo6IKu0+38r9PQE4n+f1VVS+B+ZbWhnEBX8P0Q4H7gcTCZqyvRbWARZHQLlavp8ZG20P9rXcHhEmI07kdtsODasA5/OlX6gy/dfF/bbTV5GmHeL3JBLRxzttof45awCLRYo9vpuZE7YGdyG2Q0R5UvQBWxYwKwBn8pWPEPg7IlhdiKDYnrMIXAz6WDrh/mu3bXcNcEC5P7wIbrdQzH9eQCZF7+2WkrsCWPZcD/TgRbZsF1zTmrBrBX5HN3tyxwD7YTOVRy8KVL0Bd65Vmo667q2dStcdASx6rofyjouqUK/B9dsXFUohcksnenLbAMtemy1UfnrRiLE84NZ6IdqRirtvbdfi1TbA2Xz5r5j5j5Z5ehe705RMf51KRP64ncVoC2BxHLDH9/batlz2gJPnFc7PArNVgvjViABH6Zhm/ZErQoxkH7AmxYhHlsX71s7aWr9XbNek6M52HBQtA6xdflx5pldCVaEMHDuvcK5A8AjI5oB8EShXgEoZKFeBSgVQCohEgKjr/4z3AUP9gCIg7jLWpBn9fa9lsMXa5d7UqquxJYCFYrOFyk964c8V4F44oVCsEs5lgfNZIJcHPMFIk27wU0sbof/V0UcyBgz2AyMDQDQCbBzwXrtAEz2airu/3ErQQEsA5wqVT3qe93WbPKfqAS+eUsiWCWdmgJPTQLVaB2gjw6oB3U9B0azbsGz5XV6KsWFg01pAzGqXjniIua89ilZK3ZWMu99ohklTgP0YqsqLNlnz+SJh7ymF8xkf2JKEkFu+BOx1Y8CGNcBAH2P9gGe5h5VujqZTCfeKZjFeTQHO5EpfA/ApW9N5ZYYweU5h6jhwPlfHcpux5Ha/BxCLAldfBqSijMtHX2sg4x/SyejvLIXNkgAHoa07bEnNe48rnCkQDr8CFBokehh2q1ntIizYsOVG3y/g6AH7dl3gykuAvj4gAkahSihUCCVP9nryJfNgj1dguIrQ5wKJCCMZZaSjjOGEh6jV9LbuSUb2YAW+ZamQ3CUBzubLT9mKW95zTOFkhnDoqC8NL8clL0oqSYgnCSoCVIM92580axAjji+BuyqQ4RgQOq8wUKrK/0jv83Ilo8BQzMO6VBUDseWYQfM+JO46lYi8cbE7FwVYZxxUvf9u3kXzOyZnCIfPKuw/FAhSgcxTz3GbyFQLpOh6Ics877qE9AAQiZEGSyJUI6JGOT5VxlxocEWvdgTcAGQBUtQwWRTDTQTkYhXIlQnZElD2fMBjDmMizdjYX0VkhSlbOepXF/M6LQpwJl/ebiOd5FyR8PxxhQNHgGKP8+9EL04PKU2tAr5LjIQLJB0DJmswDbACpuP41KuBFYDlEwBsKFdz72ClZqvA2SJpI4yALc+PJ6rYPCDSevOXvSd3EG1PJyK/1KjthgBLIhg8frjbwYgq9MRhB5PHgXOZha01k5nq9d4FalEgowk4/UMKTp/fR59iJBX0nqkBo8ASpsGVPdYHVD7yuwY8uLcGcrAyNZCljbopZErAqQKhWPGB3pD2cEl/RUyK3S5d+88renujhLeGI8nmyv9rI8vv+aMKh6cJk8eC8Tbjye1Oi4BEkpDo91lxVDFSjghS/lVjuQZgMXc6DDdgxRrYEAWbl0GDHwC6FMBmuLkycKJAKFUJMQe4YriCwdjy6t6S1ZhKRn6l0TY37386Pxd4st21rr9fWNnTkw72HeyNnit7Z/+YAsn+CUbaBWJ68wzADbFZQ8GaJSuex6INy9ZCVmDvNkBLW2Y/DrPpxdbmTBGYLhCYCBvSVWzury4rNSvgTfX5yQsoOJMr/T2AJXWrVsDfeUThldOEoydbubu9e9wIYWBUFtJnxwPOHPuct28KyHWs1yHWVCsgCgULwAZkDXBA3ealaAdgmYWoXlNZ0vtzfx9wzUhZ97NM19fSyeinw33NA1jKJmTzlePdZtaL40Cod8+BQGq2OLtIFBgcVVrlSTiMtDPXeHgy+ndDgYFkrPfZEBUb9cgA7H8X7M/B3m0o17QXNLvkjGRsx/OkJW+R2q8erWjW3fuLZlIJdyJcTmIewPl85QNV9r7X7UD2nVTYd4wweXTplpoZNuqf7osB6WEFD4xBw5IbdFG/b8rfMlENoKZQn01rISvYg42qNPcSzLFneRH0FWL/razR6QLh7KxvNLl2tLwsUrZD6oOJhHu3Gd88gLP5skRH3tnK4Je6Z/tBBwenGkvOnbYtHqL+Nb5DeFgMFK2wPSNBB9gYdu2zaNZg14QsvZfPl6r1ixH+NFCfms3nfBk4lSdEXcK1Y2X0tTLuZo0u8T0R3ZtKRN67AGApVZQrVI52W81GDANPHnGw64XA5RcaTODsWbSswGJCthguhsYJHjNGWwXXEJ0BSChYfjdsGKzB05Qb/M/swWGVSb8MwbMycNNGeG9uhse5EnC6qLShRUAWga5Xl1T/ScbddabEU42CbbkEX55W2DtFONAg87WZltToBZAFHV4rbBkYiDASLSzOPLYUAtgA6APFvkFD2HQAvBikjSQt1C036BdAKDt4EbSEbQwjIQNIM8BEXz5fJu3Zunqkt7basCuxthbZfOm7zPjNZgNt9v3OSYWXpgjHpxf655sB3Kjt0XEhLyDpMvrrBZVGqmadXlDbPo3QFLJUacOJYuhce+NXDu4z0nRY0hbDiTgu6oWxZmsi30sXIniJk0NUKDGK9Ooiwr+kEtGPhsQGCZEpH7NRQc7sv9PnlgzA0HNrZslKpgnxftKq0FCHZkAjYEl/AkxNWBKngo4aYWxdR7h8Qr5f3AJVKDF2H/FNnZHASSHgmz26FbCkv6kcoQrCVaMVpHsUiCAV+VLJyNoawEHtxz2tDLLZPT894OClI37oTTeXcoHRCaUdBbLvLrH2S3YzT481+CrA84CKJ2oc49feRHA1T176+vlBT8eGxSJ+PJgxc7ZjmRQ9+WiOEHMJ142WemYIibqRqyVYXs8qkyv9HoCvNptgK98/+rKD3S8CxVIrdy9+z8ioguoDBiOMePO1X9hQ6JkwFcuNQkns+UaJSpnx4V8iOC28QY+/6KFSBeIxaJVHuxoDo0k7sz1bIpwrETalq5hI9oxVfzadjP6dD3C+/B9gfn87g1zs3u2HHDz9/CIGjmY8OWhUjBlD4wpR8lWijq6wcyD4XW/ZQTBfqeJHbM5WGB9/W2sA/2yvp6k+0Qckoj6rNlaxdsYoe/8reV/6u3GsBKcdFtBqR0T/kU5EPqABzuZLLzPjklafXeq+n73s4JkXgFIXFDw2IdIMMBbh1vTdRgOqM0roNQwiN8TLpcEtC6dhfPK25gCLivbALtZUm4wDcQFYjCQdbh/ioDg1q3TwwIaUfSomwqFUInqpVOiK5QqVnK16yz854OCFg/LSLBSi6nFopBaJnXlkgtBHjCEb9WVDDgPDmiVao6zBBUR4+sztPsAvHmU89KwvOMn+KuDJfhuLsLZ7y/8kPFc+ArDEZndCwWYdROAShnLjmjKUZSqWetfJuJuk7Cxfx5XyszaoV9rQQtYkMD3TWYsjYwQ3ThgV6u1k7w11G1aRTJy1sEfJnBAOU5DPLOOzd/gA//wA49+3+/ZoAU8C9hIxRqoPSCeAlAG3zwc+2uEebIaYKQPTswqbByoYj9t3L5IbuZ5s2Z/NoB9/WWH/FOHY6QZ6cIM45nAQnbQxsVHpSIzRaGcvSPgpAViANTZvEazEEWDYswB8+QTjnTdKGA7hbJbx7YeBM1mgT8CNCqjsAxuHTpOR/Ve+kxfA2LE7JT6zF8vLcs2wfeOH2KUpVyh/3vP4i90vp9/CnuMKe15pbMlqxqJF700PkdYPJSKjkyvs9dEB8SEjhuy9IgUbAeuWrcC1m+aziVKF8cOngJdPCKA8n3KjQFxYdjRwMYZiuToZqzxzukjIVwnXj5T1S2PzUoq+QNl86dvM+JithjNFwtOTCk8+17zFeqF6fK2CijLWRHyvTzeX5gwBBUs7QrkSzSl6rLDW224A1gws3snOA4xnXvapt541a0NHKOynm3FKQN+JosLGlIeJpKR22LuI8B3K5sr3M/id9pr19+Fn9/sJZK3mFkn/Gy5ROjpj1IJwpfdcAVhin4U1e6ISARMDwLbrhAqbv0FHzzCeeInR5wCpuL/v9sneKy9gyG/czdrJMEVlSrmErcN2UzwI9GPK5MuP2U7mfmZS4YVX/Bjo8LWUGizS85p1hGSdE7+txTP6bqAOCRVrlajqS83XbwbecJnOs2252fwsQ6hZ2pFMRtl/ayG3gamy5cYWufFkUYLwCTeNWbZsEe2gbK70LAPXdTvI8PPTeYKA/OTu4L9GQFzCXzgwAKSGFIYc7spnKtgZdUgAFvelsOZrNwE3X946sOH5VD3Gjn2sbdkxAdmCgBVuX9yJ58oKVw1XkLSY50zAc7IHWzNyhAf96AEH+yehpelWrjVjhGiSMBZlcR51fIUBFoFKqFcMGrddD1w63hnAMpgn93uQUCRRmbQU3aWKFJ5gvgKcLilc2l/FSMye0UOMHZTJlU/bzBw0Az+dIzx3TGHHLn8PbHZt2KSgHMZ4N+qRsVYFrFnSUWXfFYPGO28ELptYCHClyrjnCeCJF32Hxi1XAnfcLFLy/Hu37w0ADqxYhoprHqpmE1zie9HLjxUUxpNVLWzZu2iasvnyLDN3s6yLjuexgw4OHAUOmbjoJUa++RKlY5bFc9TxFQZY2HPZ/+RngXe/Hrh87UKAv79DTJDzA99Fwn7PG+ff+8huD/kS0C/6cNwXtsRUaSNiUnawyRxhKAZcNmBPHyaiUk8Bzs4SnplSePw5P5uwfgsOC12XvE7BdRgjXfDnmr3ZWKvEHBkAfMfrgS3rFgL8Z//M+gUQsIxrUSTmP//Q/Hsf2OXp+/qTvtokurCoSyaeuuOXMnjwlRwhFSVcMWRPktYA94pFmwnvO6EgyWdPPOdLtDUvf92KXHKZ7z3qxLEvL4oSyVli8uTEQckOrPgClrxYuSLjzpsJV6xfCPBf/AvrPVrAMi+gWKw+5/thatf9z3g4XwAGk0DaOBsCn7D2NNZnQrSJ+NG8H30pgpa9S7Po3ghZ4UE+dUjh+DnCzr3zSy6E77lsi9KpJ+0ArM2QoRIe2lsURGr4rkDfW5QtAu97E+HKBgDf97RIyHMAS5ti4br9pvkA3/e0h5k8MBAALGZM0Yd1THUQ01XLoOhAljteJN3ONRbjtbSQ1Qs1qf4NFIqS/fjISWDfoSDZuq6myqVbFGLi/zXSQJ3tPaxpSfvakCFxVAFXEEuV1nsFYDFJGndghZErAO+/hXDVhsZC1oPPAruP+C/LdZuBt1+3UMj6wROM0xnGQMKn4Hk26SDHycRxmQS2dijxaIEQUaQzIWxdWk2ylSbabFCirkim4akZ4NmXfBDCe/DlW5SOvdJOBpNxv0ijJiPfUKuxVA0lgY0jvgAkL4BsCcb+fOm4sNcOSCsYw6GTrL1P2gccfKTfmTxr27b8XwcAhCxcbdhTMCUsOgJcPWSRRRM9JqbKHzH49mYA2fheFuSpIw7OFYCn9wRhPQHKW7YqXdhsIsicr0VfBB2HKdgYMgyI8vKsHwLeek17Viobc2Jm7J1iZIq+AaRmp24zlMcXsoArLAJMoPutOxtaWbTnjymcLRB27YcOr5Vr6xWkY5Q3JedaMKCaMknyjfEQyXeyzwqFFivAnW/ojkJbGfdi92SLjJ0HWbsXta06FAjQChXLnCbzhOE+xusG7TkctLPBtruw1YU6lSHsP62QLQC7DwJrxhWqirFloI5FByjXtuTQPlsTpMrAb79t+anXzFWo+Me7WEd6yN4sTgmTEtMKwBL8d7ygsDZZxXqLhg7tLrTt8G8VYHPfoWmF4znC0TMKmSrwun5PmwH9sjfBj9CebGpVihnSWKlyReBTv9KhA7ndAS9y/z1PeugPoj5MOE+rEZe5ih/ZIUaOIYuJ49rhbztkp5P1kr10+wEXB2cIG/s9DPbNVa+rUYnZi4N4ZpGShTVLPctMAfjM7Z0BfOgE4+cHgfN5YP0ocOtVrbkS6+f5b9s9DKUCCTtg1SbdpdmazJT8tJZrR+xmIOqQHdtBd80ms9j3UtTkP3dHMBpnbOpnQ8C1MoXmOSMxi+QqUq2w+Ewe+My72gf4wV2Me570JV/tpPB8gH7/DmDNYHsS93d/4gNcs3QFOnIrtmrRgUWWuGmNPQm6FnQnC7ccxo5WgL/72QgqHuPGCV4ArBG05Kdmz2UgN+sDfDYL/O672wN4aprxt/fMpaEIECacdt0w8Ad3tgfwPz3kYbQfWk/WwQFBWG0zgEWNFwl6oA/YMmgT4CBsVhY+ky/fDebfaAWEXt7zyAEHR2YUbpjwEHfnDCI1cg4iNLQLMGDPYj48m2kfYKHeR3b7QpGoNgZg8TzJnv4XH5bvWgf5Hx/0MNLvmzLDADdzRuSrUqlH6XoeaxIWPUnhwHebqSvdvABTM8CDByLYMMDYPNA4jNQYLjQQs5J240dBtsuif/A4Y9+UgMFatRGAhTMUSqT39N/eBmwYaR3gbz7oYTQNDKR8Z4REf7TibZJojlmPcMOo9bzhudQVm8ln3QAsz37vWVez5zdvDAEc+tUALM53EbBmAoA//c72WPR9TzFePsma2kR/FR1cABbqPZ8nfPhWYP1wewCPpIHBNgAWs6qwZynWstWigUPWcV7ymd6HLaWPdgvwzikHe04oXD/uYbjBIXnzKLgInAsAvqtNNen+ZxiTp1mrNkJtYkcWwU24grT5628mrG0DYM2iDcChPXgpFi2hOjNlhcstq0cL0kcDQctKAni3AIv/9vu7I7rK683rF7LpBQAXgDMZ4BPvaI+CJc/o2FnW3iHRW8UTJHu7ULAIbe+5mTAx1DoFf+thD8MCcEjIMtV7Gq2JCXqX6gLXj5XbCgRstsYNE8BtlXBo1nkr3+84pPDSGQc3rfMwUkfFJq9XVCRh0YaCP/QWQryFUFjTv0RonJzxU1I0BSs/+kMoeCbruwvHW1SVJL/p7sdYAyxStE5Oa6ImCfWeLYlwVcF4wm7aSsMSDraKsLQCYLN7ciXgnr0RXQfrzZt4XtEWDXCdFC37sGQoXLe5dYr72R4PJ87DZ9GBkGUo+FweeMd1tGRgfHgOzx1mPH+E9f4rAGtX4hIAy94r3iOXCNePlawmni1ahMVn03bKKDUDsJXv/++4g+eOKlw55mHT4NwT2oMU6MEiaIkeLFQsku8Nl0jUhqScNAf68X0eTmXmwm8MixbOIJXof/kawmj/0u3kZhn7p4Bdh31hTbPn4IURgBfLPJR0lUyZsGWwiuG4RdXIP1upcRklWcKVtkuHgfc8xg/3RFGsspaoE0G2gzZ0BA59baoUVSnvmxoF5GyBtIVL9nJxRsglViqxb+uEMskUjPvClXwkPEe8P1pNEs9UYB0TKpb2MtKelA4O0l5M6SVxKMjeLWqWBOJJW8LujbNBUk8bxWsVKuJYIKTlqAGL0Rtm7ZYshGarlGErFNrKPScyhAdecrXA9cYNfhlgk60gYMii66C6or93SuSGRD4KSKUKaVYuFK9LFjoCJOv9Viq362zBIM9Xx2OJqTJg/aYt+SltSx+Vqm9OlMu0pdNLg7YkXlpKOwi7X6x+R1lYc9Yv43PDSFn7j+1eTUoZSme2ipHaGviuowq7TzgYTTJuWucLI8Yebfbi2QBUne8rlBscpCXgGoAFZDE8SByVpj5x64XSQOV7aVf2YT8x3P+ISVTUJ+nLpLqatvTBXAElS1smrSVc+9Ksg6mwU2afNY9YZs26H6X+Ph13PxNe+wWbjK1ywrYAFl/rAy9FcSoHbB5kbBllDZpJKtPpoKGUUJGEBSShNh35EQiopui3T30+0Pr0tKDAmc4hDgQ4kw1hgJW/dX9BrrGpVGteGOEAus0glMcUSgvXddHFSSukzZGXWXTqh9e5pXLCWtiyVBDcFsiywD960UVmlnDNuIe16YCKg2o5RjfWe7MAEQBsYrfmFSM1Vd5DZYRN8W8twAVCnGlT/5T4MX34g++gNtXwxN+rSz0EFfG0V6pW8HRu9lKUVFyCUuXuqhH75Rq0nNFqQXDNpi2V9LcFsLQjqtOPX3Qhhca3jjHWpX1nhA7eC1ixYd36b3koFCigIx39lai5B8Phrvr2IGHcsHbNBYLgwHDYkC6FGDows1Yhvu5QD2nTgCv7vtTFsl2Lo7bG7ZT01yBbOpTDJsiZWeDhgxEtSIlDQth1GBQTqFeLugx1HsSm+1uVsOPQWQ4B7r7TKngpwjU9arFhcxWF5yrBm1LFQQeGLcvzx/KEfIV0wtq1wz0sDE70WDoReUujtV5U0bN5rI5NkCUT75EDEQjYw3HGNeNz0nWAT8jP2KDnYMZm4o1ipswLop9eysgUqsUVbsdUs9NV36OMa0Z7w5bN7Do6VkfvxRYPxrIJsuzJ2w9HcCLrn4N07bicUGazh87bkvpXx3JySAhhPCkCVaV3bNk3bHR2MJZM0fbRdp0vW+Mnxeu055QDqTa1cRDYNMAd17TsdmyyX5+UksEl2eMJW4aqGLPpwG/EjLo92k7vxZYPp+x2Ieufl1NOdr7i4lxRLEuMSwcYo6mFZxzZ7te0J3vtzKwvTMk5iAMxxpXDlR4YMRrOoLvDKX3J0v7xsrYXW3Rl8T7tOen4xUIjrIWwsYSd/N1G4xXVSYA9UyRUPKkeC1w+WMVo74qL1g3D0vGy0upqciUu9XJIwN6+0w4OTit9rI2rWLsb1yQZ6b7OSxKbPkVHlvMLZ2ZJq23i55LDpzcNVrE26fV0r62ft7UDogMq7tkR77apWdqrMuPwjMLhGQdydqI2TijW8dZyVKzYjyWoT2zBi1URFtYrOrcOrq+I98ePwxbmLwYNOdlsfdrDaHx5D7/S62X7iHdf4OKNVa4804t6Hr0A2bQpOvPRjIOTOYWzRd/VOFel3a9ma8yYNcNJrQSir0zJ/RHJXY5D25BFOhYz5cpcNO2Qe1MiQQ1OxVg4ouaO09AzuWLlDvb4XlsHRi/3AklJ4POzCjkpyD0rjgmlvUQV5uBsYXHC+6BHHKF01npsqo+RtFCcrdv5yoHQpOjOZMy9r9W22gJYGs3my3/FzH/UagcX77O3AkT016lE5I/babFtgJnZzRYqP7VdHa+dQV+Q9xLtSMXdtxJRW+kPbQMc7MfrPZR3MGPjBbnYyzxpIkwqRG5JJGiq3a47Alg68YPlK4++2oSudhdo5e+n6ajr3ionqHQylo4B9im59Ase6EFmbhCi3slwLj4TXgEiyivwOxKJ6OOdrkxXAEun4nVij+VQS+sRRp1O6rXwnOy1pOi9yZj7P93Mp2uApfNMvvIRAn/nIsjdQDH3rIDLoI+lE+6/dtuiFYBDlHz3RXbdHSTClknRB7qlXDMKawCbPbnK9F8XBa9OQRYrFb+nmz23vmerABvpulwt339RhWoPZFGFIk7k9k6l5cV6sw6w0ZOrqHzvojGkRZCJdjhwP9iJntush54ALJ2KwJUrVL4M4A9frbbrZovX7fdiWwbwN8m4+7l2LVSt9t0zgM0AxEHhVflbF/flBbvjtHLot9pxHLQK6jxdupOH2n1GuxpR+S6Yb2332dfk/USPOnA/2qrLr5s16DkFm8EJm84Xq5/wPP7LC5eaaVop+pNEzPlmwJ67wa6lZ5cN4BDQw9l8+StEdNeFsjcLmMz89VQi8qdEdKYlZCzdtOwAm3EHIblfZeabLc1lVTYjccsK/NlEIvrESgxwxQAOCWHv9jz+Aph/cSUWoGd9Ej2mFH3RlkWq03GuOMBm4JLwRh4+z+DbOp3ManhOsvxY4UvpeOSR1TGe1TCK0BiC/OS7APoQwKHqHKtsoPOGQzMA/7sCvp5MRp9aTSNdNRRcvyhSTqJQqN7pgT8O4F3MvArC3uZGKdVsAPxIgb4djzv3EtHsagLWjGXVAhxeLCnxlC9W38fsbQPTNgZPrMRiSgU5ED9EpB5KxJx7iKjFkxlXYrR+n68KgOuXJ6ituQ1E2wj8eoA2McuxWPYuqbcM8BEG7QTzw1E38pBtR4C90S7e0qsS4AbsPJYrYYuqVrcy8VZm3gqmcSakiTkFQpqZ0kRIy7PMyBBxBowME2WJkQHxCSLaR0z7PMfZl4xiPxFdXaKvAAAADElEQVQVlwOEXvbx/3Bccpan8cseAAAAAElFTkSuQmCC",dn=kt(59301),sn=({className:ci,dataSource:In=[],col:pe=4,right:Se,bottom:ye=23,precision:jn=0,wrapWidth:Ln=1200,trackEventItems:Kn,loading:Je,handleVery:An=()=>!0})=>{const yi=Math.floor((Ln-(pe-1)*Se)/pe);return dn.createElement(Tt.Z,{spinning:Je},dn.createElement("div",{className:me()(Ye.list,ci)},!!In.length&&In.map((Ei,Xi)=>{const{subject_identifier:Gt,id:de,identifier:un,power:Mn}=Ei,Ie=Ei.is_public!=0&&Ei.is_public;return dn.createElement("div",{className:Ye.wrap,key:de,style:{width:yi,marginRight:(1+Xi)%pe===0?0:Se+jn,marginBottom:ye}},dn.createElement("a",{className:Ye.li,onClick:$e=>{$e.preventDefault(),An(Ei==null?void 0:Ei.first_category_url)&&(Kn&&(0,Ht.L9)([Kn]),(0,Ht.xg)(Ei.first_category_url))}},dn.createElement("div",{className:Ye.top},dn.createElement(Ot.Z,{title:Ei.name},dn.createElement("div",{className:Ye.name},Ei.name)),dn.createElement("img",{className:Ye.img,src:Xt.Z.IMG_SERVER+"/images/"+Ei.avatar_url}),dn.createElement("div",{className:Ye.text,title:Ei.creator},Ei.creator),Gt&&dn.createElement("div",{className:Ye.btns},dn.createElement("div",null,"\u5F00\u653E\u8BFE\u7A0B"),dn.createElement("aside",null,"\u5F00\u653E\u8BFE\u5802")),Ie&&dn.createElement("div",{className:Ye.sign},"\u516C\u5F00")),dn.createElement("div",{className:Ye.bottom},Ei.visits>0&&dn.createElement(Ot.Z,{title:"\u8BBF\u95EE\u91CF",placement:"bottom"},dn.createElement("span",null,dn.createElement("i",{className:"iconfont icon-liulanyan"}),dn.createElement("span",null,Ei.visits))),Ei.course_members_count>0&&dn.createElement(Ot.Z,{title:"\u6210\u5458",placement:"bottom"},dn.createElement("span",null,dn.createElement("i",{className:"iconfont icon-chengyuan"}),Ei.course_members_count)),Ei.tasks_count>0&&dn.createElement(Ot.Z,{title:"\u4F5C\u4E1A",placement:"bottom"},dn.createElement("span",null,dn.createElement("i",{className:"iconfont icon-zuoye"}),Ei.tasks_count)),Ei.is_end?dn.createElement("div",{style:{color:"#6B758B"}},"\u5DF2\u7ED3\u675F"):dn.createElement("div",{style:{color:"#00B187"}},"\u8FDB\u884C\u4E2D"))),!Ei.is_accessible&&dn.createElement("div",{className:Ye.lockWrap},dn.createElement("img",{src:`${Xt.Z.IMG_SERVER}/images/educoder/icon/lockclose.svg`}),dn.createElement("span",{className:"mt15 font16 c-white"},"\u975E\u8BFE\u5802\u6210\u5458\u4E0D\u53EF\u8FDB\u5165")))}),!In.length&&dn.createElement(xe.Z,null)))},ln={flex_box_center:"flex_box_center___d27mZ",flex_space_between:"flex_space_between___qfRU9",flex_box_vertical_center:"flex_box_vertical_center___fCRld",flex_box_center_end:"flex_box_center_end___ORMV8",flex_box_column:"flex_box_column___PNKtZ",tabs:"tabs___alpa7",tabsWrap:"tabsWrap___aCQjw",tab:"tab___MKLr4",active:"active___nl_4v"},Vn=kt(25690),yn=({dataSource:ci=[],value:In,onChange:pe,className:Se,style:ye={},tabBarExtraContent:jn})=>pt.createElement("div",{className:me()(ln.tabs,Se),style:ye},pt.createElement("div",{className:ln.tabsWrap},ci.map((Ln,Kn)=>!(Ln!=null&&Ln.hide)&&pt.createElement("aside",{className:ln.tab,onClick:()=>{pe(Ln.id),Ln.link&&Vn.history.push(Ln.link)},key:Kn},pt.createElement("div",{className:In===Ln.id?ln.active:""},Ln.name),(Ln==null?void 0:Ln.resetCount)==null&&(Ln==null?void 0:Ln.total)!==void 0&&pt.createElement("span",null,"\uFF08",Ln==null?void 0:Ln.total,"\uFF09"),(Ln==null?void 0:Ln.resetCount)!==void 0&&(Ln==null?void 0:Ln.total)!==void 0&&pt.createElement(Ot.Z,{title:(Ln==null?void 0:Ln.tip)!=null?Ln==null?void 0:Ln.tip:""},pt.createElement("span",{style:{color:"#9096A3"}},"\uFF08",pt.createElement("span",{style:{color:"#000"}},Ln==null?void 0:Ln.resetCount),"/",pt.createElement("span",null,Ln==null?void 0:Ln.total),"\uFF09"))))),pt.createElement("div",{className:ln.tabBar},jn)),En=({className:ci,style:In={},children:pe})=>pt.createElement("div",{className:me()(ci),style:In},pe),ri={flex_box_center:"flex_box_center___e6HxQ",flex_space_between:"flex_space_between___RnXYe",flex_box_vertical_center:"flex_box_vertical_center___lVxPk",flex_box_center_end:"flex_box_center_end___bu8yv",flex_box_column:"flex_box_column___JczGj",orderWrap:"orderWrap___ZfyGX",orderIconWrap:"orderIconWrap___XTB_O",orderAsc:"orderAsc___KWHmA",orderDesc:"orderDesc___rHdbB",active:"active___a7eSP",cursorPointer:"cursorPointer___gs9kL",orderTextWrap:"orderTextWrap___teAKn"},Rt=kt(75727),Lt=kt(93041);const Pt=[{id:"updated_at",name:"\u6700\u65B0\u52A8\u6001"},{id:"created_at",name:"\u6700\u65B0\u521B\u5EFA"},{id:"name",name:"\u540D\u79F0\u6392\u5E8F"}];var Zt=({sortValue:ci,dropValue:In,className:pe,onSort:Se,onDrop:ye,dataSource:jn=Pt})=>{var Ln;return pt.createElement("div",{className:me()(ri.orderWrap,pe)},pt.createElement(Rt.Z,{dropdownRender:()=>pt.createElement(Lt.default,null,jn.map((Kn,Je)=>pt.createElement(Lt.default.Item,{key:Je,onClick:()=>ye(Kn.id)},Kn.name)))},pt.createElement("span",{className:ri.orderTextWrap},(Ln=jn.find(Kn=>In===Kn.id))==null?void 0:Ln.name)),pt.createElement("span",{className:ri.orderIconWrap},pt.createElement("span",{className:ri.orderAsc},pt.createElement("i",{className:ci==="asc"?`iconfont icon-sanjiaoxing-up font12 ${ri.cursorPointer} ${ri.active}`:`iconfont icon-sanjiaoxing-up font12 ${ri.cursorPointer}`,onClick:()=>Se(ci==="asc"?"desc":"asc")})),pt.createElement("span",{className:ri.orderDesc},pt.createElement("i",{className:ci==="desc"?`iconfont icon-sanjiaoxing-down font12 ${ri.cursorPointer} ${ri.active}`:`iconfont icon-sanjiaoxing-down font12 ${ri.cursorPointer}`,onClick:()=>Se(ci==="asc"?"desc":"asc")}))))},Mt={flex_box_center:"flex_box_center___LCi0B",flex_space_between:"flex_space_between___hzONe",flex_box_vertical_center:"flex_box_vertical_center___ZyQRE",flex_box_center_end:"flex_box_center_end___XKM74",flex_box_column:"flex_box_column___p8LCU",btn:"btn___In02G","mediacy-round":"mediacy-round___uveEv","mediacy-default":"mediacy-default___dDxsd",default:"default___K791v"},Yt=kt(99571),Ge=Object.defineProperty,De=Object.getOwnPropertySymbols,Ue=Object.prototype.hasOwnProperty,we=Object.prototype.propertyIsEnumerable,Ee=(ci,In,pe)=>In in ci?Ge(ci,In,{enumerable:!0,configurable:!0,writable:!0,value:pe}):ci[In]=pe,Fe=(ci,In)=>{for(var pe in In||(In={}))Ue.call(In,pe)&&Ee(ci,pe,In[pe]);if(De)for(var pe of De(In))we.call(In,pe)&&Ee(ci,pe,In[pe]);return ci},He=(ci,In)=>{var pe={};for(var Se in ci)Ue.call(ci,Se)&&In.indexOf(Se)<0&&(pe[Se]=ci[Se]);if(ci!=null&&De)for(var Se of De(ci))In.indexOf(Se)<0&&we.call(ci,Se)&&(pe[Se]=ci[Se]);return pe},qe=(ci,In,pe)=>new Promise((Se,ye)=>{var jn=Je=>{try{Kn(pe.next(Je))}catch(An){ye(An)}},Ln=Je=>{try{Kn(pe.throw(Je))}catch(An){ye(An)}},Kn=Je=>Je.done?Se(Je.value):Promise.resolve(Je.value).then(jn,Ln);Kn((pe=pe.apply(ci,In)).next())}),gn=ci=>{var In=ci,{className:pe,style:Se,children:ye,loading:jn=!1,openLoading:Ln,onClick:Kn=()=>{},size:Je="middle",shape:An="round"}=In,yi=He(In,["className","style","children","loading","openLoading","onClick","size","shape"]);const[Ei,Xi]=(0,pt.useState)(!1);return pt.createElement(Yt.ZP,Fe({onClick:(0,ne.throttle)(Gt=>qe(void 0,null,function*(){Ln&&Xi(!0);try{yield Kn(Gt)}catch(de){console.log("error",de)}Ln&&Xi(!1)}),2e3,{leading:!0,trailing:!1}),className:me()(Mt.btn,Mt[`${Je}-${An}`],pe),style:Se,size:Je,shape:An,loading:Ei||jn},yi),ye)},ni={flex_box_center:"flex_box_center___TB7bQ",flex_space_between:"flex_space_between___oBlTb",flex_box_vertical_center:"flex_box_vertical_center___b5XbB",flex_box_center_end:"flex_box_center_end___CNhe7",flex_box_column:"flex_box_column___yHXKW",head:"head___ghH72",node:"node___mjPEy"},Ve=({className:ci,style:In,children:pe=null,onClick:Se,title:ye})=>pt.createElement("div",{className:me()(ni.head,ci),style:In},pt.createElement("span",{className:"primary-hover",onClick:Se},pt.createElement("i",{className:"iconfont icon-fanhui2 font12"}),"\u8FD4\u56DE"),pt.createElement("b",{title:ye},ye),pt.createElement("div",{className:ni.node},pe)),nn={flex_box_center:"flex_box_center___AlHuF",flex_space_between:"flex_space_between___vN2LW",flex_box_vertical_center:"flex_box_vertical_center___Ac7D2",flex_box_center_end:"flex_box_center_end___y38I7",flex_box_column:"flex_box_column___iQE6P",btns:"btns___sNgTb",confirm:"confirm___Ozirl",cancel:"cancel___aiq1I"},vn=({confirmShow:ci=!0,confirmTitle:In,confirmClick:pe,cancelShow:Se=!0,cancelTitle:ye,cancelClick:jn,className:Ln,style:Kn,confirmLoading:Je=!1})=>pt.createElement("div",{className:me()(nn.btns,Ln),style:Kn},ci&&pt.createElement(Yt.ZP,{loading:Je,onClick:pe,type:"primary",className:nn.confirm},In),Se&&pt.createElement(Yt.ZP,{onClick:jn,className:nn.cancel},ye)),tn={flex_box_center:"flex_box_center___jkpdr",flex_space_between:"flex_space_between___OtsL8",flex_box_vertical_center:"flex_box_vertical_center___rbcb_",flex_box_center_end:"flex_box_center_end___zBR21",flex_box_column:"flex_box_column___nS_eP",fixedBottom:"fixedBottom___oJl7m",wrap:"wrap___A3Oq1",center:"center____VL1y"},gi=({className:ci,style:In={},LeftContent:pe,children:Se,RightContent:ye})=>pt.createElement("div",{className:me()(tn.fixedBottom,ci),style:In},pt.createElement("div",{className:tn.wrap},pt.createElement("div",{className:tn.left},pe),pt.createElement("div",{className:tn.center},Se),pt.createElement("div",{className:tn.right},ye))),ti={flex_box_center:"flex_box_center___tY8Yn",flex_space_between:"flex_space_between___vHdYA",flex_box_vertical_center:"flex_box_vertical_center___pa61F",flex_box_center_end:"flex_box_center_end___HyDXt",flex_box_column:"flex_box_column___UjZek",crumbs:"crumbs___V41Oe",hover:"hover___bEIVd"},Gi=({className:ci,style:In={},dataSource:pe=[]})=>pt.createElement("div",{className:me()(ti.crumbs,ci),style:In},pe.map((Se,ye)=>ye<pe.length-1?pt.createElement(pt.Fragment,{key:ye},Se.path||Se.onClick?pt.createElement("span",{className:ti.hover,onClick:Se!=null&&Se.onClick?Se.onClick:()=>Vn.history.push(Se.path)},Se.name):pt.createElement("span",null,Se.name),pt.createElement("span",null,"\xA0",">","\xA0")):pt.createElement("span",{key:ye,style:{color:"#5F6368"}},Se.name))),Fn=kt(11938),xn=Object.defineProperty,Tn=Object.defineProperties,ai=Object.getOwnPropertyDescriptors,pi=Object.getOwnPropertySymbols,ui=Object.prototype.hasOwnProperty,zi=Object.prototype.propertyIsEnumerable,wt=(ci,In,pe)=>In in ci?xn(ci,In,{enumerable:!0,configurable:!0,writable:!0,value:pe}):ci[In]=pe,Xe=(ci,In)=>{for(var pe in In||(In={}))ui.call(In,pe)&&wt(ci,pe,In[pe]);if(pi)for(var pe of pi(In))zi.call(In,pe)&&wt(ci,pe,In[pe]);return ci},Hn=(ci,In)=>Tn(ci,ai(In)),Ai=(ci,In)=>{var pe={};for(var Se in ci)ui.call(ci,Se)&&In.indexOf(Se)<0&&(pe[Se]=ci[Se]);if(ci!=null&&pi)for(var Se of pi(ci))In.indexOf(Se)<0&&zi.call(ci,Se)&&(pe[Se]=ci[Se]);return pe};const{Countdown:Vi}=Fn.default;var kr=ci=>{var In=ci,{onChange:pe}=In,Se=Ai(In,["onChange"]);const[ye,jn]=(0,pt.useState)(null);(0,pt.useEffect)(()=>{typeof ye=="number"&&ye>=0&&pe(ye)},[ye]);const Ln=Kn=>{const Je=Math.floor(Kn/1e3);jn(Je)};return pt.createElement(Vi,Hn(Xe({},Se),{onChange:Ln}))}},37808:function(Bn,zn,kt){"use strict";kt.d(zn,{Z:function(){return Ut}});var pt=kt(59301);function Ut(ue,Le){const he=(0,pt.useRef)();(0,pt.useEffect)(()=>{he.current=ue}),(0,pt.useEffect)(()=>{function Dt(){he.current()}if(Le!==null){let qt=setInterval(Dt,Le);return()=>clearInterval(qt)}},[Le])}},37345:function(Bn,zn,kt){"use strict";kt.d(zn,{h:function(){return pt}});var pt=(Ut=>(Ut[Ut.NOMATCH=-1]="NOMATCH",Ut[Ut.OK=0]="OK",Ut[Ut.TIMEOUT=2]="TIMEOUT",Ut[Ut.PODFAILURE=3]="PODFAILURE",Ut[Ut.COMPILEFAILURE=4]="COMPILEFAILURE",Ut[Ut.EXECUTEFAILURE=5]="EXECUTEFAILURE",Ut[Ut.HIDE_COMPILE_STATUS=11]="HIDE_COMPILE_STATUS",Ut))(pt||{})},81072:function(Bn,zn,kt){"use strict";kt.d(zn,{H7:function(){return nt},MK:function(){return Bt},MU:function(){return jt},X6:function(){return se},bM:function(){return ne},fi:function(){return et},fu:function(){return me},n4:function(){return ht},rX:function(){return Ce},vl:function(){return st},zO:function(){return Te}});var pt=kt(38986),Ut=Object.defineProperty,ue=Object.getOwnPropertySymbols,Le=Object.prototype.hasOwnProperty,he=Object.prototype.propertyIsEnumerable,Dt=(gt,vt,St)=>vt in gt?Ut(gt,vt,{enumerable:!0,configurable:!0,writable:!0,value:St}):gt[vt]=St,qt=(gt,vt)=>{for(var St in vt||(vt={}))Le.call(vt,St)&&Dt(gt,St,vt[St]);if(ue)for(var St of ue(vt))he.call(vt,St)&&Dt(gt,St,vt[St]);return gt};function me(gt,vt){return(0,pt.U2)(`myproblems/${gt}.json`,qt({hidePopLogin:!0},vt||{}))}function ne(gt,vt){return(0,pt.v_)(`myproblems/${gt}/code_submit.json`,vt)}function jt(gt,vt){return(0,pt.v_)(`myproblems/${gt}/code_debug.json`,vt)}function Te(gt,vt){return vt.language&&(vt.language=encodeURIComponent(vt.language)),(0,pt.U2)(`myproblems/${gt}/submit_records.json`,vt)}function se(gt){return(0,pt.U2)("myproblems/record_detail.json",{id:gt})}function Ce(gt,vt){return(0,pt.U2)(`myproblems/${gt}/result.json`,{mode:vt})}function Bt(gt,vt){return(0,pt.v_)(`myproblems/${gt}/add_notes.json`,vt)}function nt(gt,vt){return(0,pt.v_)(`myproblems/${gt}/restore_initial_code.json`,vt)}function et(gt){return(0,pt.v_)(`myproblems/${gt}/sync_code.json`)}function ht(gt,vt){return(0,pt.v_)(`myproblems/${gt}/update_code.json`,vt)}function st(gt,vt){return(0,pt.v_)(`discusses/${gt}/plus.json`,vt)}},43554:function(Bn,zn,kt){"use strict";kt.d(zn,{Z:function(){return Aa}});var pt=kt(59301),Ut={flex_box_center:"flex_box_center___bZaL5",flex_space_between:"flex_space_between___oaJSq",flex_box_vertical_center:"flex_box_vertical_center____hsuP",flex_box_center_end:"flex_box_center_end___ZYbPQ",flex_box_column:"flex_box_column___nE_62",wrap:"wrap___ulhwR",left:"left___kyWln",title:"title___jsO1D",total:"total___GEhiU",list:"list___u9dBZ",name:"name___Wxggs",b:"b___Y15YO",r:"r___mKQoe",l:"l___uelFD",tag:"tag___Mpkbg",right:"right___mQ3dU",examName:"examName___Na1r8",t:"t___IgCWK",num:"num___CXI8j",topWarp:"topWarp___Kicpu",head:"head___jx3W8",so:"so___qYW7F",btn:"btn___EMJDz",content:"content___sHGsV",titleWrap:"titleWrap___I__GR",single:"single___K5iv9",analysis:"analysis___NoAuR",text:"text___xESW2",modalColumn:"modalColumn___I_tK_",modalRow:"modalRow___lyw_U",sup:"sup___HSz3Z",popover:"popover___kE8aI",btn_warp:"btn_warp___fOE2S"},ue=kt(28284),Le=kt(25399),he=kt(99571),Dt=kt(62957),qt=kt(71051),me=kt(6767),ne=kt(37568),jt=kt(37285),Te=kt(62673),se=kt(37639),Ce=kt(77019),Bt=kt(5269),nt=kt(13747),et=Object.defineProperty,ht=Object.getOwnPropertySymbols,st=Object.prototype.hasOwnProperty,gt=Object.prototype.propertyIsEnumerable,vt=(ae,Re,_t)=>Re in ae?et(ae,Re,{enumerable:!0,configurable:!0,writable:!0,value:_t}):ae[Re]=_t,St=(ae,Re)=>{for(var _t in Re||(Re={}))st.call(Re,_t)&&vt(ae,_t,Re[_t]);if(ht)for(var _t of ht(Re))gt.call(Re,_t)&&vt(ae,_t,Re[_t]);return ae};const Et=ae=>React.createElement("svg",St({width:34,height:34,xmlns:"http://www.w3.org/2000/svg"},ae),React.createElement("title",null,"\u7F16\u7EC4 6"),React.createElement("g",{fill:"none",fillRule:"evenodd"},React.createElement("rect",{fill:"#E4E6FD",width:34,height:34,rx:10}),React.createElement("g",{fillRule:"nonzero"},React.createElement("path",{d:"M13.808 11.448a.558.558 0 0 1 0 .788l-1.564 1.565a.558.558 0 1 1-.789-.79l1.564-1.563a.558.558 0 0 1 .79 0Zm9.882 2.462a.558.558 0 0 1-.789 0l-1.564-1.563a.558.558 0 1 1 .789-.789l1.564 1.564a.556.556 0 0 1 0 .788Z",fill:"#6678EB"}),React.createElement("path",{d:"M21.753 21.707a5.937 5.937 0 1 0-8.58.015l-.937.936a.558.558 0 1 0 .789.788l.995-.994a5.91 5.91 0 0 0 3.436 1.095c1.287 0 2.48-.41 3.452-1.106l.992.992a.558.558 0 1 0 .789-.789l-.936-.937Z",fill:"#6678EB"}),React.createElement("path",{d:"m20.858 18.95-3.024-1.745v-2.054a.558.558 0 1 0-1.117 0v2.351c0 .064.011.126.031.184a.551.551 0 0 0 .258.33l3.293 1.9a.557.557 0 0 0 .559-.966Z",fill:"#FFF"}))));var Tt="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzQiIGhlaWdodD0iMzQiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48cmVjdCBmaWxsPSIjRTRFNkZEIiB3aWR0aD0iMzQiIGhlaWdodD0iMzQiIHJ4PSIxMCIvPjxnIGZpbGwtcnVsZT0ibm9uemVybyI+PHBhdGggZD0iTTEzLjgwOCAxMS40NDhhLjU1OC41NTggMCAwIDEgMCAuNzg4bC0xLjU2NCAxLjU2NWEuNTU4LjU1OCAwIDEgMS0uNzg5LS43OWwxLjU2NC0xLjU2M2EuNTU4LjU1OCAwIDAgMSAuNzkgMFptOS44ODIgMi40NjJhLjU1OC41NTggMCAwIDEtLjc4OSAwbC0xLjU2NC0xLjU2M2EuNTU4LjU1OCAwIDEgMSAuNzg5LS43ODlsMS41NjQgMS41NjRhLjU1Ni41NTYgMCAwIDEgMCAuNzg4WiIgZmlsbD0iIzY2NzhFQiIvPjxwYXRoIGQ9Ik0yMS43NTMgMjEuNzA3YTUuOTM3IDUuOTM3IDAgMSAwLTguNTguMDE1bC0uOTM3LjkzNmEuNTU4LjU1OCAwIDEgMCAuNzg5Ljc4OGwuOTk1LS45OTRhNS45MSA1LjkxIDAgMCAwIDMuNDM2IDEuMDk1YzEuMjg3IDAgMi40OC0uNDEgMy40NTItMS4xMDZsLjk5Mi45OTJhLjU1OC41NTggMCAxIDAgLjc4OS0uNzg5bC0uOTM2LS45MzdaIiBmaWxsPSIjNjY3OEVCIi8+PHBhdGggZD0ibTIwLjg1OCAxOC45NS0zLjAyNC0xLjc0NXYtMi4wNTRhLjU1OC41NTggMCAxIDAtMS4xMTcgMHYyLjM1MWMwIC4wNjQuMDExLjEyNi4wMzEuMTg0YS41NTEuNTUxIDAgMCAwIC4yNTguMzNsMy4yOTMgMS45YS41NTcuNTU3IDAgMCAwIC41NTktLjk2NloiIGZpbGw9IiNGRkYiLz48L2c+PC9nPjwvc3ZnPg==",Ot=kt(76902),$t=kt(25690),Xt=kt(51257),Ht=kt(38986),ve=Object.defineProperty,ie=Object.getOwnPropertySymbols,Ne=Object.prototype.hasOwnProperty,xe=Object.prototype.propertyIsEnumerable,Pe=(ae,Re,_t)=>Re in ae?ve(ae,Re,{enumerable:!0,configurable:!0,writable:!0,value:_t}):ae[Re]=_t,Qe=(ae,Re)=>{for(var _t in Re||(Re={}))Ne.call(Re,_t)&&Pe(ae,_t,Re[_t]);if(ie)for(var _t of ie(Re))xe.call(Re,_t)&&Pe(ae,_t,Re[_t]);return ae};const _e=ae=>React.createElement("svg",Qe({width:34,height:34,xmlns:"http://www.w3.org/2000/svg"},ae),React.createElement("title",null,"\u7F16\u7EC4 12"),React.createElement("g",{fill:"none",fillRule:"evenodd"},React.createElement("rect",{width:34,height:34,rx:10,fill:"#EAF3F4"}),React.createElement("path",{d:"M25.905 15.37a.775.775 0 0 0-.626-.529l-4.814-.7-2.152-4.362a.776.776 0 0 0-1.392 0l-2.153 4.363-4.814.699a.775.775 0 0 0-.43 1.323l3.484 3.396-.823 4.794a.777.777 0 0 0 1.126.818l4.306-2.264 4.305 2.264a.778.778 0 0 0 .817-.059.777.777 0 0 0 .31-.759l-.823-4.794 3.483-3.396a.777.777 0 0 0 .196-.795Z",fill:"#21C0A6",fillRule:"nonzero"})));var an="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzQiIGhlaWdodD0iMzQiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48cmVjdCB3aWR0aD0iMzQiIGhlaWdodD0iMzQiIHJ4PSIxMCIgZmlsbD0iI0VBRjNGNCIvPjxwYXRoIGQ9Ik0yNS45MDUgMTUuMzdhLjc3NS43NzUgMCAwIDAtLjYyNi0uNTI5bC00LjgxNC0uNy0yLjE1Mi00LjM2MmEuNzc2Ljc3NiAwIDAgMC0xLjM5MiAwbC0yLjE1MyA0LjM2My00LjgxNC42OTlhLjc3NS43NzUgMCAwIDAtLjQzIDEuMzIzbDMuNDg0IDMuMzk2LS44MjMgNC43OTRhLjc3Ny43NzcgMCAwIDAgMS4xMjYuODE4bDQuMzA2LTIuMjY0IDQuMzA1IDIuMjY0YS43NzguNzc4IDAgMCAwIC44MTctLjA1OS43NzcuNzc3IDAgMCAwIC4zMS0uNzU5bC0uODIzLTQuNzk0IDMuNDgzLTMuMzk2YS43NzcuNzc3IDAgMCAwIC4xOTYtLjc5NVoiIGZpbGw9IiMyMUMwQTYiIGZpbGwtcnVsZT0ibm9uemVybyIvPjwvZz48L3N2Zz4=",Ke=Object.defineProperty,re=Object.getOwnPropertySymbols,Jt=Object.prototype.hasOwnProperty,Ye=Object.prototype.propertyIsEnumerable,Gn=(ae,Re,_t)=>Re in ae?Ke(ae,Re,{enumerable:!0,configurable:!0,writable:!0,value:_t}):ae[Re]=_t,dn=(ae,Re)=>{for(var _t in Re||(Re={}))Jt.call(Re,_t)&&Gn(ae,_t,Re[_t]);if(re)for(var _t of re(Re))Ye.call(Re,_t)&&Gn(ae,_t,Re[_t]);return ae};const Oe=ae=>React.createElement("svg",dn({width:34,height:34,xmlns:"http://www.w3.org/2000/svg"},ae),React.createElement("title",null,"\u9898\u76EE"),React.createElement("g",{fill:"none",fillRule:"evenodd"},React.createElement("rect",{fill:"#E7F3FF",width:34,height:34,rx:10}),React.createElement("g",{fill:"#4C6FFF",fillRule:"nonzero"},React.createElement("path",{d:"m23.719 13.325-4.098-3.94c-.097-.13-.225-.162-.355-.162-.129 0-.258.064-.387.161l-7.55 7.753c-.065.065-.098.162-.13.227l-1.032 5.427c-.033.194.032.323.16.484.13.13.227.162.389.162h.096l4.776-1.099c.097-.032.194-.064.258-.161l7.841-8.108c.194-.162.194-.517.033-.744h-.001Zm-8.1 8.044a.534.534 0 0 1-.386.162.56.56 0 0 1-.388-.162l-3-2.81c-.226-.194-.226-.517-.033-.743.194-.227.517-.227.743-.033l3 2.811c.259.226.291.55.065.776ZM17 22.92h6.844v1.055H17z"}))));var sn="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzQiIGhlaWdodD0iMzQiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48cmVjdCBmaWxsPSIjRTdGM0ZGIiB3aWR0aD0iMzQiIGhlaWdodD0iMzQiIHJ4PSIxMCIvPjxnIGZpbGw9IiM0QzZGRkYiIGZpbGwtcnVsZT0ibm9uemVybyI+PHBhdGggZD0ibTIzLjcxOSAxMy4zMjUtNC4wOTgtMy45NGMtLjA5Ny0uMTMtLjIyNS0uMTYyLS4zNTUtLjE2Mi0uMTI5IDAtLjI1OC4wNjQtLjM4Ny4xNjFsLTcuNTUgNy43NTNjLS4wNjUuMDY1LS4wOTguMTYyLS4xMy4yMjdsLTEuMDMyIDUuNDI3Yy0uMDMzLjE5NC4wMzIuMzIzLjE2LjQ4NC4xMy4xMy4yMjcuMTYyLjM4OS4xNjJoLjA5Nmw0Ljc3Ni0xLjA5OWMuMDk3LS4wMzIuMTk0LS4wNjQuMjU4LS4xNjFsNy44NDEtOC4xMDhjLjE5NC0uMTYyLjE5NC0uNTE3LjAzMy0uNzQ0aC0uMDAxWm0tOC4xIDguMDQ0YS41MzQuNTM0IDAgMCAxLS4zODYuMTYyLjU2LjU2IDAgMCAxLS4zODgtLjE2MmwtMy0yLjgxYy0uMjI2LS4xOTQtLjIyNi0uNTE3LS4wMzMtLjc0My4xOTQtLjIyNy41MTctLjIyNy43NDMtLjAzM2wzIDIuODExYy4yNTkuMjI2LjI5MS41NS4wNjUuNzc2Wk0xNyAyMi45Mmg2Ljg0NHYxLjA1NUgxN3oiLz48L2c+PC9nPjwvc3ZnPg==",ln=kt(12327),Vn=kt(39793),Ae=kt(61011),yn=kt(30371),te={wrap:"wrap___OIoOI",modal:"modal___Z3hfU",titleWrap:"titleWrap___aK3oG",required:"required___NHoO7",title:"title___uxb1R",colorGray:"colorGray___O8YPg",choiceWrap:"choiceWrap___t51sb",answer:"answer___vsBnh",activeAnswer:"activeAnswer___AJN4p",deleteIcon:"deleteIcon___WvOJZ",addIcon:"addIcon___UyeIs",editorWrap:"editorWrap___uqcFU",htmlWrap:"htmlWrap___GcBNL",radio:"radio___e8qQ5",color333:"color333___PLzVK",color999:"color999___v3EY0",fold:"fold___OfvPe",head:"head___EejYX",collapseWrapper:"collapseWrapper___sQyVD",panelHeader:"panelHeader___Ivicf",open:"open___aEOQE",close:"close___z4P5H",inputBorder:"inputBorder___ix67O",keywordTag:"keywordTag___iGx08",scoreByBlankRadio:"scoreByBlankRadio___Kwu7q"},En=kt(59301),ri=Object.defineProperty,Rt=Object.defineProperties,Lt=Object.getOwnPropertyDescriptors,Pt=Object.getOwnPropertySymbols,Nt=Object.prototype.hasOwnProperty,Zt=Object.prototype.propertyIsEnumerable,Mt=(ae,Re,_t)=>Re in ae?ri(ae,Re,{enumerable:!0,configurable:!0,writable:!0,value:_t}):ae[Re]=_t,Yt=(ae,Re)=>{for(var _t in Re||(Re={}))Nt.call(Re,_t)&&Mt(ae,_t,Re[_t]);if(Pt)for(var _t of Pt(Re))Zt.call(Re,_t)&&Mt(ae,_t,Re[_t]);return ae},Ge=(ae,Re)=>Rt(ae,Lt(Re)),De=(ae,Re)=>{var _t={};for(var fe in ae)Nt.call(ae,fe)&&Re.indexOf(fe)<0&&(_t[fe]=ae[fe]);if(ae!=null&&Pt)for(var fe of Pt(ae))Re.indexOf(fe)<0&&Zt.call(ae,fe)&&(_t[fe]=ae[fe]);return _t};const Ue=null,we=(ae,Re)=>{var _t=ae,{globalSetting:fe,loading:zr,dispatch:mr,isEdit:Fr,editData:sr}=_t,Pr=De(_t,["globalSetting","loading","dispatch","isEdit","editData"]);const[po,Xr]=(0,pt.useState)(""),[Dr,Ki]=(0,pt.useState)(""),[no,Wi]=(0,pt.useState)([]),[ir,Ji]=(0,pt.useState)(""),[Mr,Lr]=(0,pt.useState)(),[Br,io]=(0,pt.useState)(!1),[Zi,Sr]=(0,pt.useState)({}),[Li,Qi]=(0,pt.useState)([]);(0,pt.useEffect)(()=>{!sr||!Fr||(Xr(sr==null?void 0:sr.name),Ki(sr==null?void 0:sr.analysis),Lr(sr==null?void 0:sr.is_ordered),Sr(sr),io(!0))},[sr]),(0,pt.useEffect)(()=>{if(!Br)return;const Oo=sr==null?void 0:sr.standard_answer.map(ea=>ea==null?void 0:ea.answer_text);Wi(Oo);const Ar=sr==null?void 0:sr.standard_answer.map(ea=>ea==null?void 0:ea.score);Qi(Ar),io(!1)},[Br]),(0,pt.useImperativeHandle)(Re,()=>({onSave:wr,Clear:ro}));const wr=()=>{let Oo=[],Ar=!1;return po?(no.forEach((ea,Yo)=>{Oo.push({position:Yo+1,answer_text:[],score:Li[Yo]}),ea==null||ea.forEach((la,ll)=>{Oo[Yo].answer_text.push(la),(!la||!(0,Xt.eR)(la,1e4))&&(Ji(`${Yo}-${ll}`),me.ZP.info(la?"\u7B54\u6848\u4E0D\u80FD\u8D85\u8FC710000\u5B57\u7B26":"\u7B54\u6848\uFF1A\u4E0D\u80FD\u4E3A\u7A7A"),Ar=!0)})}),Ar?!1:(Oo==null?void 0:Oo.length)>20?(me.ZP.warning("\u586B\u7A7A\u9898\u6807\u51C6\u7B54\u6848\u4E0D\u80FD\u4E3A\u7A7A/\u4E0D\u80FD\u8D85\u8FC720\u4E2A\uFF01"),!1):{name:po,analysis:Dr,standard_answers:Oo,is_ordered:Mr,downcase:Zi==null?void 0:Zi.downcase,no_space:Zi==null?void 0:Zi.no_space,use_blank_score:Zi==null?void 0:Zi.use_blank_score}):(me.ZP.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),!1)},ro=()=>{Xr(""),Ki(""),Wi([]),Lr(!1)},So=(Oo,Ar,ea)=>{const Yo=no.slice();if(Ar&&Yo.splice(Oo,Ar),ea)for(let la=0;la<ea;la++)Yo.splice(Oo+la,0,[""]);Wi(Yo)},No=(Oo,Ar,ea)=>{Ji("");let Yo=no.slice();Yo[Oo][Ar]=ea,Wi(Yo)},$i=Oo=>{let Ar=no.slice();Ar[Oo]=[...Ar[Oo],""],Wi(Ar)},_a=(Oo,Ar)=>{let ea=no.slice();if(!ea[Oo][Ar]){ea[Oo]=ea[Oo].filter((Yo,la)=>la!==Ar),Wi(ea);return}Dt.default.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u53C2\u8003\u7B54\u6848\u5417\uFF1F",className:te.modal,onOk:()=>{ea[Oo]=ea[Oo].filter((Yo,la)=>la!==Ar),Wi(ea)}})},or=Oo=>{Dt.default.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u53C2\u8003\u7B54\u6848\u5417\uFF1F",className:te.modal,onOk:()=>{let Ar=no.slice();Ar=no.filter((ea,Yo)=>Oo!==Yo),Wi(Ar)}})};return En.createElement("section",{className:te.wrap},En.createElement("p",{className:te.titleWrap},En.createElement("span",{className:te.required},"*"),En.createElement("span",{className:te.title},"\u9898\u5E72\uFF1A")),En.createElement("div",null,En.createElement(Ae.Z,{id:"completion-question-tittle",placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE",height:155,defaultValue:po,onChange:Oo=>Xr(Oo),showNullButton:!0,onPlaceholderChange:So})),En.createElement("div",{className:"mt20"},no.map((Oo,Ar)=>En.createElement("div",{style:{display:"flex"}},En.createElement("div",{style:{flex:1}},En.createElement(yn.Z,{key:Ar,answers:Oo,index:Ar,flex:1,is_md:!0,activeOptionErrorIndex:ir,onAnswerChange:No,addChildAnswer:$i,deleteChildAnswer:_a,deleteChildAnswermain:or})),Zi.use_blank_score&&En.createElement("div",{style:{display:"flex",alignItems:"center",width:"165px"}},En.createElement("span",{style:{color:"red",margin:"auto 5px auto 10px"}},"*"),"\u5206\u503C\uFF1A",En.createElement(qt.Z,{style:{width:"100px"},size:"large",defaultValue:Li[Ar],onBlur:ea=>{Li[Ar]=ea.target.value,Qi([...Li])}}))))),En.createElement("div",null,En.createElement(Te.default,{className:`${te.color333} font14 mt20`,checked:Zi.use_blank_score,onChange:Oo=>Sr(Ge(Yt({},Zi),{use_blank_score:Oo.target.checked}))},"\u5224\u5206\u65F6\u6309\u7A7A\u7ED9\u5206"),En.createElement("span",{style:{color:"#999999",fontSize:"12px"}},"\uFF08\u9009\u4E2D\uFF0C\u5219\u9700\u8981\u8BBE\u7F6E\u6BCF\u7A7A\u5206\u503C\uFF0C\u5B66\u751F\u7B54\u6848\u5224\u5206\u65F6\u6309\u7A7A\u7ED9\u5206\uFF09")),En.createElement("div",null,En.createElement(Te.default,{className:`${te.color333} font14 mt20`,checked:Zi.downcase,onChange:Oo=>Sr(Ge(Yt({},Zi),{downcase:Oo.target.checked}))},"\u5224\u5206\u65F6\u5FFD\u7565\u7B54\u6848\u4E2D\u7684\u5B57\u6BCD\u5927\u5C0F\u5199")),En.createElement("div",null,En.createElement(Te.default,{className:`${te.color333} font14 mt20`,checked:Zi.no_space,onChange:Oo=>Sr(Ge(Yt({},Zi),{no_space:Oo.target.checked}))},"\u5224\u5206\u65F6\u5FFD\u7565\u7B54\u6848\u4E2D\u7684\u7A7A\u683C")),En.createElement("div",{className:"mt20"},(no==null?void 0:no.length)>1&&En.createElement("span",null,En.createElement(Te.default,{checked:Mr,onChange:Oo=>Lr(Oo.target.checked),className:`${te.color333} font14`},"\u591A\u4E2A\u586B\u7A7A\u7684\u7B54\u6848\u6709\u987A\u5E8F\u8981\u6C42"),En.createElement("span",{className:`${te.color999} font12`},"\uFF08\u9009\u4E2D\uFF0C\u6BCF\u4E2A\u586B\u7A7A\u7684\u7B54\u6848\u987A\u5E8F\u5FC5\u987B\u4E0E\u53C2\u8003\u7B54\u6848\u4E00\u81F4\uFF09"))),En.createElement("p",{className:te.titleWrap},En.createElement("span",{className:te.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),En.createElement(Vn.Z,{id:"single-question-answer",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:Dr,onChange:Oo=>Ki(Oo)}))};var Ee=(0,$t.connect)(({loading:ae,globalSetting:Re})=>({globalSetting:Re,loading:ae.effects}),null,null,{forwardRef:!0})((0,pt.forwardRef)(we)),Fe=kt(47889),He=Object.getOwnPropertySymbols,qe=Object.prototype.hasOwnProperty,cn=Object.prototype.propertyIsEnumerable,gn=(ae,Re)=>{var _t={};for(var fe in ae)qe.call(ae,fe)&&Re.indexOf(fe)<0&&(_t[fe]=ae[fe]);if(ae!=null&&He)for(var fe of He(ae))Re.indexOf(fe)<0&&cn.call(ae,fe)&&(_t[fe]=ae[fe]);return _t};const ni=null,ze=(ae,Re)=>{var _t=ae,{globalSetting:fe,loading:zr,editData:mr,dispatch:Fr,onRef:sr=()=>{},isEdit:Pr}=_t,po=gn(_t,["globalSetting","loading","editData","dispatch","onRef","isEdit"]);const[Xr,Dr]=(0,pt.useState)(),[Ki,no]=(0,pt.useState)(""),[Wi,ir]=(0,pt.useState)("");(0,pt.useEffect)(()=>{if(!mr||!Pr)return;no(mr==null?void 0:mr.name),ir(mr==null?void 0:mr.analysis);const Lr=mr==null?void 0:mr.choices.find(Br=>Br.is_answer);Dr(Lr.choice_text==="\u6B63\u786E"?"0":"1")},[mr]),(0,pt.useImperativeHandle)(Re,()=>({onSave:Ji,Clear:Mr}));const Ji=()=>Ki?Xr?{name:Ki,choices:[{choice_text:"\u6B63\u786E",is_answer:Xr==="0"?1:0},{choice_text:"\u9519\u8BEF",is_answer:Xr==="1"?1:0}],analysis:Wi}:(me.ZP.info("\u8BF7\u5148\u70B9\u51FB\u9009\u62E9\u672C\u9009\u62E9\u9898\u7684\u6B63\u786E\u9009\u9879"),!1):(me.ZP.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),!1),Mr=()=>{no(""),ir(""),Dr("")};return pt.createElement("section",{className:te.wrap},pt.createElement("p",{className:te.titleWrap},pt.createElement("span",{className:te.required},"*"),pt.createElement("span",{className:te.title},"\u9898\u5E72\uFF1A")),pt.createElement(Vn.Z,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:Ki,onChange:Lr=>no(Lr)}),pt.createElement("p",{className:te.titleWrap},pt.createElement("span",{className:te.required},"*"),pt.createElement("span",{className:te.title},"\u7B54\u6848\u9009\u9879\uFF1A",pt.createElement("span",{className:te.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),pt.createElement(Fe.ZP.Group,{buttonStyle:"solid",value:Xr,onChange:Lr=>Dr(Lr.target.value)},pt.createElement(Fe.ZP.Button,{value:"0",className:`${te.radio} mr40`},"\u6B63\u786E"),pt.createElement(Fe.ZP.Button,{value:"1",className:te.radio},"\u9519\u8BEF")),pt.createElement("p",{className:te.titleWrap},pt.createElement("span",{className:te.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),pt.createElement(Vn.Z,{id:"single-question-answer",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:Wi,onChange:Lr=>ir(Lr)}))};var Ve=(0,$t.connect)(({loading:ae,globalSetting:Re})=>({globalSetting:Re,loading:ae.effects}),null,null,{forwardRef:!0})((0,pt.forwardRef)(ze)),nn=Object.getOwnPropertySymbols,qn=Object.prototype.hasOwnProperty,vn=Object.prototype.propertyIsEnumerable,tn=(ae,Re)=>{var _t={};for(var fe in ae)qn.call(ae,fe)&&Re.indexOf(fe)<0&&(_t[fe]=ae[fe]);if(ae!=null&&nn)for(var fe of nn(ae))Re.indexOf(fe)<0&&vn.call(ae,fe)&&(_t[fe]=ae[fe]);return _t};const Rn=null,gi=(ae,Re)=>{var _t=ae,{globalSetting:fe,loading:zr,editData:mr,dispatch:Fr,onRef:sr=()=>{},isEdit:Pr}=_t,po=tn(_t,["globalSetting","loading","editData","dispatch","onRef","isEdit"]);const[Xr,Dr]=(0,pt.useState)([]);(0,pt.useEffect)(()=>{var ir;if(!mr||!Pr)return;const Ji=(ir=mr==null?void 0:mr.shixun)==null?void 0:ir.challenges.map(Mr=>({id:Mr==null?void 0:Mr.id,score:Mr.score}));Dr(Ji)},[mr]),(0,pt.useImperativeHandle)(Re,()=>({onSave:Ki,Clear:no}));const Ki=()=>({challenges:[...Xr]}),no=()=>{Dr([])};console.log("editData--",mr);const Wi=ir=>{var Ji,Mr;return pt.createElement("div",null,(Mr=(Ji=ir==null?void 0:ir.shixun)==null?void 0:Ji.challenges)==null?void 0:Mr.map((Lr,Br)=>{var io;return pt.createElement("div",{className:"c-grey-666 font14 ml25",style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"15px"}},pt.createElement("div",null,pt.createElement("span",{className:"mr5"},"\u7B2C",Br+1,"\u5173"),pt.createElement(Le.Z,{key:Br,title:Lr==null?void 0:Lr.challenge_name},pt.createElement("span",null,(0,Xt.Pq)(Lr==null?void 0:Lr.challenge_name,44)))),pt.createElement("p",{style:{marginBottom:0}},pt.createElement("span",{className:te.required},"*"),pt.createElement("span",{className:te.title},"\u5206\u503C\uFF1A"),pt.createElement(qt.Z,{precision:1,min:1,max:100,className:te.baseFormItem,style:{width:176},value:(io=Xr.find(Zi=>Zi.id===Lr.id))==null?void 0:io.score,onChange:Zi=>{Xr.find(Sr=>Sr.id===Lr.id).score=Zi,Dr([...Xr])}})))}),pt.createElement("div",{style:{clear:"both"}}))};return pt.createElement("section",{className:te.wrap},pt.createElement(Ot.Z,{style:{paddingRight:10},className:te.titleHtml,value:`${mr==null?void 0:mr.position}\u3001${mr==null?void 0:mr.name}`}),pt.createElement("p",{style:{marginBottom:"10px",marginTop:"25px"}},pt.createElement("span",{className:te.required},"*"),pt.createElement("span",{className:te.title},"\u5173\u5361")),Wi(mr))};var ti=(0,$t.connect)(({loading:ae,globalSetting:Re})=>({globalSetting:Re,loading:ae.effects}),null,null,{forwardRef:!0})((0,pt.forwardRef)(gi)),vi=Object.getOwnPropertySymbols,Gi=Object.prototype.hasOwnProperty,Fn=Object.prototype.propertyIsEnumerable,xn=(ae,Re)=>{var _t={};for(var fe in ae)Gi.call(ae,fe)&&Re.indexOf(fe)<0&&(_t[fe]=ae[fe]);if(ae!=null&&vi)for(var fe of vi(ae))Re.indexOf(fe)<0&&Fn.call(ae,fe)&&(_t[fe]=ae[fe]);return _t};const Tn=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],ai=(ae,Re)=>{var _t=ae,{editData:fe,globalSetting:zr,loading:mr,dispatch:Fr,onRef:sr=()=>{},isEdit:Pr}=_t,po=xn(_t,["editData","globalSetting","loading","dispatch","onRef","isEdit"]);const[Xr,Dr]=(0,pt.useState)([]),[Ki,no]=(0,pt.useState)(),[Wi,ir]=(0,pt.useState)([]),[Ji,Mr]=(0,pt.useState)(""),[Lr,Br]=(0,pt.useState)("");(0,pt.useEffect)(()=>{Dr(["","","",""])},[]),(0,pt.useEffect)(()=>{if(!fe||!Pr)return;Mr(fe==null?void 0:fe.name),Br(fe==null?void 0:fe.analysis),Dr(fe==null?void 0:fe.choices.map(Li=>Li.choice_text));const Sr=[];fe==null||fe.choices.map((Li,Qi)=>{Li.is_answer&&Sr.push(Qi)}),ir(Sr)},[fe]),(0,pt.useImperativeHandle)(Re,()=>({onSave:io,Clear:Zi}));const io=()=>{if(!Ji)return me.ZP.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),!1;const Sr=Xr.findIndex(Qi=>!Qi);if(Sr>-1)return me.ZP.info(`\u8BF7\u5148\u8F93\u5165 ${Tn[Sr]} \u9009\u9879\u7684\u5185\u5BB9`),!1;if(!Wi.length)return me.ZP.info("\u8BF7\u8BBE\u7F6E\u672C\u9898\u7684\u6B63\u786E\u7B54\u6848\uFF0C\u70B9\u51FB\u9009\u9879A/B...\u5373\u53EF\u5B8C\u6210\u8BBE\u7F6E"),!1;if(Wi.length<2)return me.ZP.info("\u591A\u9009\u9898\u6700\u5C0F\u6B63\u786E\u9009\u9879\u4E3A2\u4E2A"),!1;const Li=Xr.map((Qi,wr)=>({choice_text:Qi,is_answer:Wi.includes(wr)?1:0}));return{name:Ji,choices:Li,analysis:Lr}},Zi=()=>{Dr(["","","",""]),Mr(""),Br(""),ir("")};return pt.createElement("section",{className:te.wrap},pt.createElement("p",{className:te.titleWrap},pt.createElement("span",{className:te.required},"*"),pt.createElement("span",{className:te.title},"\u9898\u5E72\uFF1A")),pt.createElement(Vn.Z,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:Ji,onChange:Sr=>Mr(Sr)}),pt.createElement("p",{className:te.titleWrap},pt.createElement("span",{className:te.required},"*"),pt.createElement("span",{className:te.title},"\u7B54\u6848\u9009\u9879\uFF1A",pt.createElement("span",{className:te.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),Xr.map((Sr,Li)=>pt.createElement("div",{className:te.choiceWrap,key:Li},pt.createElement(Le.Z,{title:"\u70B9\u51FB\u8BBE\u7F6E\u4E3A\u6807\u51C6\u7B54\u6848",placement:"left"},pt.createElement("div",{className:`${te.answer} ${Wi.includes(Li)?te.activeAnswer:""}`,onClick:()=>{Wi.includes(Li)?ir(Wi.filter(Qi=>Qi!==Li)):ir([...Wi,Li])}},Tn[Li])),pt.createElement("div",{className:te.editorWrap},Ki===Li?pt.createElement(Vn.Z,{id:`single-question-option-${Li}`,watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9009\u9879",defaultValue:Sr,onChange:Qi=>{Xr[Li]=Qi,Dr(Xr)}}):pt.createElement("div",{className:te.htmlWrap,onClick:()=>no(Li)},pt.createElement(Ot.Z,{value:Sr}))),Li>1&&pt.createElement(Le.Z,{title:"\u5220\u9664"},pt.createElement("i",{className:`${te.deleteIcon} iconfont icon-htmal5icon19`,onClick:()=>{Dr(Xr.filter((Qi,wr)=>wr!==Li)),Wi.includes(Li)?ir(Wi.filter(Qi=>Qi!==Li)):ir([...Wi,Li])}})),Li<7&&Li===Xr.length-1&&pt.createElement(Le.Z,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},pt.createElement("i",{className:`${te.addIcon} iconfont icon-roundaddfill ml6`,onClick:()=>Dr([...Xr,""])})))),pt.createElement("p",{className:te.titleWrap},pt.createElement("span",{className:te.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),pt.createElement(Vn.Z,{id:"single-question-answer",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:Lr,onChange:Sr=>Br(Sr)}))};var pi=(0,$t.connect)(({loading:ae,globalSetting:Re})=>({globalSetting:Re,loading:ae.effects}),null,null,{forwardRef:!0})((0,pt.forwardRef)(ai)),ui=Object.getOwnPropertySymbols,zi=Object.prototype.hasOwnProperty,wt=Object.prototype.propertyIsEnumerable,Xe=(ae,Re)=>{var _t={};for(var fe in ae)zi.call(ae,fe)&&Re.indexOf(fe)<0&&(_t[fe]=ae[fe]);if(ae!=null&&ui)for(var fe of ui(ae))Re.indexOf(fe)<0&&wt.call(ae,fe)&&(_t[fe]=ae[fe]);return _t};const Hn=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],Ai=(ae,Re)=>{var _t=ae,{editData:fe,globalSetting:zr,loading:mr,dispatch:Fr,onRef:sr=()=>{},isEdit:Pr}=_t,po=Xe(_t,["editData","globalSetting","loading","dispatch","onRef","isEdit"]);const[Xr,Dr]=(0,pt.useState)([]),[Ki,no]=(0,pt.useState)(),[Wi,ir]=(0,pt.useState)(),[Ji,Mr]=(0,pt.useState)(""),[Lr,Br]=(0,pt.useState)("");(0,pt.useEffect)(()=>{Dr(["","","",""])},[]),(0,pt.useEffect)(()=>{if(!fe||!Pr)return;const Sr=[],Li=[];fe==null||fe.choices.forEach((Qi,wr)=>{Sr.push(Qi.choice_text),Qi.is_answer&&Li.push(wr)}),Mr(fe==null?void 0:fe.name),Br(fe==null?void 0:fe.analysis),Dr(Sr),ir(Li)},[fe]),(0,pt.useImperativeHandle)(Re,()=>({onSave:io,Clear:Zi}));const io=()=>{if(!Ji)return me.ZP.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),!1;const Sr=Xr.findIndex(Qi=>!Qi);if(Sr>-1)return me.ZP.info(`\u8BF7\u5148\u8F93\u5165 ${Hn[Sr]} \u9009\u9879\u7684\u5185\u5BB9`),!1;if(!Array.isArray(Wi))return me.ZP.info("\u8BF7\u8BBE\u7F6E\u672C\u9898\u7684\u6B63\u786E\u7B54\u6848\uFF0C\u70B9\u51FB\u9009\u9879A/B...\u5373\u53EF\u5B8C\u6210\u8BBE\u7F6E"),!1;const Li=Xr.map((Qi,wr)=>({choice_text:Qi,is_answer:Wi.includes(wr)?1:0}));return{name:Ji,choices:Li,analysis:Lr}},Zi=()=>{Dr(["","","",""]),Mr(""),Br(""),ir("")};return pt.createElement("section",{className:te.wrap},pt.createElement("p",{className:te.titleWrap},pt.createElement("span",{className:te.required},"*"),pt.createElement("span",{className:te.title},"\u9898\u5E72\uFF1A")),pt.createElement(Vn.Z,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:Ji,onChange:Sr=>Mr(Sr)}),pt.createElement("p",{className:te.titleWrap},pt.createElement("span",{className:te.required},"*"),pt.createElement("span",{className:te.title},"\u7B54\u6848\u9009\u9879\uFF1A",pt.createElement("span",{className:te.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),Xr.map((Sr,Li)=>pt.createElement("div",{className:te.choiceWrap,key:Li},pt.createElement(Le.Z,{title:"\u70B9\u51FB\u8BBE\u7F6E\u4E3A\u6807\u51C6\u7B54\u6848",placement:"left"},pt.createElement("div",{className:`${te.answer} ${Wi!=null&&Wi.includes(Li)?te.activeAnswer:""}`,onClick:()=>ir([Li])},Hn[Li])),pt.createElement("div",{className:te.editorWrap},Ki===Li?pt.createElement(Vn.Z,{id:`single-question-option-${Li}`,watch:!0,height:155,isFocus:!0,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9009\u9879",defaultValue:Sr,onChange:Qi=>{Xr[Li]=Qi,Dr(Xr)}}):pt.createElement("div",{className:te.htmlWrap,onClick:()=>no(Li)},pt.createElement(Ot.Z,{value:Sr}))),Li>1&&pt.createElement(Le.Z,{title:"\u5220\u9664"},pt.createElement("i",{className:`${te.deleteIcon} iconfont icon-htmal5icon19`,onClick:()=>{Dr(Xr.filter((Qi,wr)=>wr!==Li)),Li===Wi&&ir(null)}})),Li<7&&Li===Xr.length-1&&pt.createElement(Le.Z,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},pt.createElement("i",{className:`${te.addIcon} iconfont icon-roundaddfill ml6`,onClick:()=>Dr([...Xr,""])})))),pt.createElement("p",{className:te.titleWrap},pt.createElement("span",{className:te.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),pt.createElement(Vn.Z,{id:"single-question-answer",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:Lr,onChange:Sr=>Br(Sr)}))};var Vi=(0,$t.connect)(({loading:ae,globalSetting:Re})=>({globalSetting:Re,loading:ae.effects}),null,null,{forwardRef:!0})((0,pt.forwardRef)(Ai)),dr=kt(96599),kr=kt(71411),ci=kt(61485),In=kt(59301),pe=Object.defineProperty,Se=Object.defineProperties,ye=Object.getOwnPropertyDescriptors,jn=Object.getOwnPropertySymbols,Ln=Object.prototype.hasOwnProperty,Kn=Object.prototype.propertyIsEnumerable,Je=(ae,Re,_t)=>Re in ae?pe(ae,Re,{enumerable:!0,configurable:!0,writable:!0,value:_t}):ae[Re]=_t,An=(ae,Re)=>{for(var _t in Re||(Re={}))Ln.call(Re,_t)&&Je(ae,_t,Re[_t]);if(jn)for(var _t of jn(Re))Kn.call(Re,_t)&&Je(ae,_t,Re[_t]);return ae},yi=(ae,Re)=>Se(ae,ye(Re)),Ei=(ae,Re)=>{var _t={};for(var fe in ae)Ln.call(ae,fe)&&Re.indexOf(fe)<0&&(_t[fe]=ae[fe]);if(ae!=null&&jn)for(var fe of jn(ae))Re.indexOf(fe)<0&&Kn.call(ae,fe)&&(_t[fe]=ae[fe]);return _t},Xi=(ae,Re,_t)=>new Promise((fe,zr)=>{var mr=Pr=>{try{sr(_t.next(Pr))}catch(po){zr(po)}},Fr=Pr=>{try{sr(_t.throw(Pr))}catch(po){zr(po)}},sr=Pr=>Pr.done?fe(Pr.value):Promise.resolve(Pr.value).then(mr,Fr);sr((_t=_t.apply(ae,Re)).next())});const Gt=ae=>{if(!ae)return!1;if(/^s*$/.test(ae)||ae.trim()===""){me.ZP.warning("\u5173\u952E\u8BCD\u4E0D\u80FD\u5168\u4E3A\u7A7A\u683C");return}let Re=new RegExp("[ `~!@#$^&*()={}':;,\\[\\].<>/?~\uFF01@#\uFFE5\u2026\u2026&*\uFF08\uFF09\u2014\u3010\u3011\u2018\uFF1B\uFF1A\u201D\u201C\u3002\uFF0C\u3001\uFF1F\u300C\u300D\u300E\u300F_\\+\\-\xB7%\u300A\u300B]|[\\\\/]");return ae==="|"?(me.ZP.warning("\u5173\u952E\u8BCD\u4E0D\u80FD\u53EA\u8F93\u5165\u4E00\u4E2A\u201C|\u201D\u5B57\u7B26\uFF01"),!1):!0},de=({value:ae=[],onClose:Re})=>In.createElement(dr.default,{closable:!0,onClose:Re,className:te.keywordTag},In.createElement("pre",{style:{margin:"0px",whiteSpace:"pre-wrap"}},ae.join(" \u6216 "))),un=(ae,Re)=>{var _t=ae,{editData:fe,globalSetting:zr,loading:mr,dispatch:Fr,onRef:sr=()=>{},isEdit:Pr}=_t,po=Ei(_t,["editData","globalSetting","loading","dispatch","onRef","isEdit"]);const[Xr,Dr]=(0,pt.useState)(""),[Ki,no]=(0,pt.useState)(""),[Wi,ir]=(0,pt.useState)(""),[Ji,Mr]=(0,pt.useState)(""),[Lr]=ue.default.useForm(),Br=ue.default.useWatch("use_keywords",Lr);(0,pt.useEffect)(()=>{var Li;!fe||!Pr||(Dr(fe==null?void 0:fe.name),no(fe==null?void 0:fe.analysis),ir((Li=fe==null?void 0:fe.answer_texts)==null?void 0:Li[0]),Lr.setFieldsValue(An({},fe)))},[fe]),(0,pt.useImperativeHandle)(Re,()=>({onSave:io,Clear:Zi}));const io=()=>Xi(void 0,null,function*(){if(!Xr)return me.ZP.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),!1;try{yield Lr.validateFields()}catch(Qi){me.ZP.error(Qi.errorFields[0].errors[0]);return}const Li=Lr.getFieldsValue();return console.log(Li,"values"),An({name:Xr,answer_texts:[Wi],analysis:Ki},Li)}),Zi=()=>{Dr(""),no(""),ir(""),Lr.resetFields()},Sr=fe==null?void 0:fe.score;return In.createElement("section",{className:te.wrap},In.createElement("p",{className:te.titleWrap},In.createElement("span",{className:te.required},"*"),In.createElement("span",{className:te.title},"\u9898\u5E72\uFF1A")),In.createElement(Vn.Z,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:Xr,onChange:Li=>Dr(Li)}),In.createElement("p",{className:te.titleWrap},In.createElement("span",{className:te.title},"\u53C2\u8003\u7B54\u6848\uFF1A")),In.createElement(Vn.Z,{id:"single-question-reference-answer",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u53C2\u8003\u7B54\u6848",defaultValue:Wi,onChange:Li=>ir(Li)}),In.createElement("p",{className:te.titleWrap},In.createElement("span",{className:te.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),In.createElement(Vn.Z,{id:"single-question-answer",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:Ki,onChange:Li=>no(Li)}),In.createElement(ue.default,{form:Lr,size:"large",onFinishFailed:Li=>Xi(void 0,null,function*(){var Qi,wr;me.ZP.error(Li.errorFields[0].errors[0]),Lr.scrollToField((wr=(Qi=Li==null?void 0:Li.errorFields)==null?void 0:Qi[0])==null?void 0:wr.name,{behavior:"smooth",block:"center"})})},In.createElement(Ce.Z,{align:"middle",className:"mb30 mt20"},In.createElement(ue.default.Item,{noStyle:!0,name:"use_keywords",valuePropName:"checked"},In.createElement(kr.Z,null)),In.createElement(Bt.Z,{className:"ml10"},"\u5F00\u542F\u5173\u952E\u8BCD\u81EA\u52A8\u5224\u5206"),In.createElement(Bt.Z,null,In.createElement(Le.Z,{placement:"right",title:"\u9009\u4E2D\u540E\uFF0C\u9700\u8981\u8BBE\u7F6E\u6BCF\u4E2A\u5173\u952E\u8BCD\u7684\u5206\u503C\uFF0C\u7CFB\u7EDF\u4F1A\u6839\u636E\u8BBE\u7F6E\u7684\u5173\u952E\u8BCD\u8FDB\u884C\u81EA\u52A8\u5224\u5206\uFF1B \u6240\u6709\u5173\u952E\u8BCD\u5206\u503C\u4E4B\u548C\u5FC5\u987B\u5C0F\u4E8E\u7B49\u4E8E\u5C0F\u9898\u5206\u503C\u3002"},In.createElement(ci.Z,{style:{color:"#3061D0",marginLeft:6,cursor:"pointer"}})))),Br&&In.createElement(ue.default.List,{name:"keywords",rules:[{validator(Li,Qi){return Qi!=null&&Qi.length?(Qi==null?void 0:Qi.reduce((ro,So)=>ro+So.score,0))>parseFloat(Sr)?Promise.reject(new Error("\u6240\u6709\u5173\u952E\u8BCD\u7684\u5206\u503C\u4E4B\u548C\u5FC5\u987B\u5C0F\u4E8E\u7B49\u4E8E\u8BE5\u5C0F\u9898\u7684\u5206\u503C")):Promise.resolve():Promise.reject(new Error("\u8BF7\u8BBE\u7F6E\u5224\u5206\u5173\u952E\u8BCD"))}}]},(Li,{add:Qi,remove:wr})=>In.createElement(In.Fragment,null,In.createElement("div",{className:"mb10"},"\u5173\u952E\u8BCD"),In.createElement(Ce.Z,{align:"middle",className:"font14 mb30"},In.createElement(Bt.Z,{flex:1},In.createElement(ne.default,{value:Ji,onChange:ro=>{Mr(ro.target.value)},maxLength:50,allowClear:!0,onPressEnter:ro=>{var So,No,$i,_a;const or=`${(So=ro.target)==null?void 0:So.value}`,Oo=($i=(No=or==null?void 0:or.split("|"))==null?void 0:No.filter(Yo=>!!Yo))==null?void 0:$i.map(Yo=>Yo==null?void 0:Yo.trim()),Ar=Lr.getFieldValue("keywords"),ea=((_a=Ar==null?void 0:Ar.map(Yo=>Yo==null?void 0:Yo.keyword))==null?void 0:_a.flat())||[];for(const Yo of Oo)if(ea.includes(Yo)){me.ZP.error("\u4E3A\u907F\u514D\u5224\u5206\u9519\u8BEF\uFF0C\u8BF7\u52FF\u8BBE\u7F6E\u76F8\u540C\u7684\u5173\u952E\u8BCD");return}Gt(or)&&(Qi({keyword:Oo,score:1}),Mr(""))},className:te.inputBorder,placeholder:"\u652F\u6301\u8BBE\u7F6E\u591A\u4E2A\u5173\u952E\u8BCD\uFF1B\u5E76\u5217\u5173\u952E\u8BCD\uFF08\u6216\u7684\u5173\u7CFB\uFF09\u8BF7\u7528\u201C|\u201D\u5206\u9694\u5F00"})),In.createElement(Bt.Z,{flex:"148px",style:{textAlign:"right",color:"#e99237"}},"\u201C\u56DE\u8F66\u952E\u201D\u4FDD\u5B58\u5173\u952E\u8BCD")),Li.map(ro=>{var So=ro,{key:No,name:$i}=So,_a=Ei(So,["key","name"]);return In.createElement(Ce.Z,{key:No,style:{marginRight:148}},In.createElement(Bt.Z,{flex:1},In.createElement(Ce.Z,{align:"middle",justify:"space-between"},In.createElement(ue.default.Item,yi(An({},_a),{name:[$i,"keyword"]}),In.createElement(de,{onClose:()=>wr($i)})),In.createElement(ue.default.Item,yi(An({},_a),{name:[$i,"score"],label:"\u5206\u503C",rules:[{required:!0}]}),In.createElement(qt.Z,{min:.1,max:100,precision:1,style:{width:"100%"},placeholder:"\u8BF7\u8F93\u5165\u5173\u952E\u8BCD\u5206\u6570"})))))})))))};var Mn=(0,$t.connect)(({loading:ae,globalSetting:Re})=>({globalSetting:Re,loading:ae.effects}),null,null,{forwardRef:!0})((0,pt.forwardRef)(un)),Ie=kt(8848),$e={wrap:"wrap___Cc0gS",deleteIcon:"deleteIcon___ebwMv",keywordTag:"keywordTag___lUfL5",questionTitleEditorWrap:"questionTitleEditorWrap___u9UgK",choiceWrap:"choiceWrap___VHsr3",choiceIndex:"choiceIndex___rsj9r",judgementIndex:"judgementIndex___fMm6E",setAnswerBtn:"setAnswerBtn___krVC9",activeAnswer:"activeAnswer___WiYo2",activeJudgementAnswer:"activeJudgementAnswer___M6iww",actionWrapper:"actionWrapper___oKI8_",addIcon:"addIcon___eMbGP",inputBorder:"inputBorder___ob_6x",placeholder:"placeholder___Vkwr4",blankWrapper:"blankWrapper____MZQ5",blankInput:"blankInput___ephwY",blankInputNumberWrapper:"blankInputNumberWrapper___C1UJS",addBtn:"addBtn___qRBpJ",blankIndex:"blankIndex___QsKgf",baseInputWrapper:"baseInputWrapper___juqCB",collapseWrapper:"collapseWrapper___kAXJ0",panelHeader:"panelHeader___hLTSe",open:"open___wWDjf",close:"close___XPTJ0",hide:"hide___VytUy"},bn=kt(32134),_n=kt(12893),hi=Object.defineProperty,Yn=Object.defineProperties,si=Object.getOwnPropertyDescriptors,ei=Object.getOwnPropertySymbols,Ii=Object.prototype.hasOwnProperty,Ti=Object.prototype.propertyIsEnumerable,Di=(ae,Re,_t)=>Re in ae?hi(ae,Re,{enumerable:!0,configurable:!0,writable:!0,value:_t}):ae[Re]=_t,We=(ae,Re)=>{for(var _t in Re||(Re={}))Ii.call(Re,_t)&&Di(ae,_t,Re[_t]);if(ei)for(var _t of ei(Re))Ti.call(Re,_t)&&Di(ae,_t,Re[_t]);return ae},gr=(ae,Re)=>Yn(ae,si(Re)),yr=(ae,Re)=>{var _t={};for(var fe in ae)Ii.call(ae,fe)&&Re.indexOf(fe)<0&&(_t[fe]=ae[fe]);if(ae!=null&&ei)for(var fe of ei(ae))Re.indexOf(fe)<0&&Ti.call(ae,fe)&&(_t[fe]=ae[fe]);return _t};const $r=ae=>{var Re=ae,{value:_t,onChange:fe,scrollId:zr}=Re,mr=yr(Re,["value","onChange","scrollId"]);return pt.createElement("div",{id:zr||""},pt.createElement(Vn.Z,gr(We({},mr),{defaultValue:_t,onChange:(Fr,sr)=>{sr!=null&&sr.length?fe(Fr,sr):fe(Fr)}})))},rn=({value:ae,onChange:Re,placeholder:_t,height:fe=140,isEdit:zr})=>zr?pt.createElement(Vn.Z,{watch:!0,isFocus:!0,height:fe,placeholder:_t,defaultValue:ae,onChange:Re}):pt.createElement("div",{style:{cursor:"pointer"}},ae?pt.createElement(Ot.Z,{className:$e.inputBorder,value:ae}):pt.createElement("div",{className:`${$e.inputBorder} ${$e.placeholder}`},_t));var On=kt(59301),bi=Object.defineProperty,Mi=Object.defineProperties,_i=Object.getOwnPropertyDescriptors,tr=Object.getOwnPropertySymbols,pr=Object.prototype.hasOwnProperty,br=Object.prototype.propertyIsEnumerable,Or=(ae,Re,_t)=>Re in ae?bi(ae,Re,{enumerable:!0,configurable:!0,writable:!0,value:_t}):ae[Re]=_t,Ir=(ae,Re)=>{for(var _t in Re||(Re={}))pr.call(Re,_t)&&Or(ae,_t,Re[_t]);if(tr)for(var _t of tr(Re))br.call(Re,_t)&&Or(ae,_t,Re[_t]);return ae},fn=(ae,Re)=>Mi(ae,_i(Re)),ho=(ae,Re)=>{var _t={};for(var fe in ae)pr.call(ae,fe)&&Re.indexOf(fe)<0&&(_t[fe]=ae[fe]);if(ae!=null&&tr)for(var fe of tr(ae))Re.indexOf(fe)<0&&br.call(ae,fe)&&(_t[fe]=ae[fe]);return _t};const pn=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],Hi=({value:ae,onChange:Re,choiceTextKey:_t,answerKey:fe,index:zr,isEdit:mr,setInputActive:Fr,form:sr,choiceOptionsPath:Pr,allowChangeMode:po,showAddIcon:Xr,addItem:Dr,deleteItem:Ki})=>{const no=(ae==null?void 0:ae[fe])===!0,Wi=()=>{const Ji=sr.getFieldValue(Pr);sr.setFieldValue(Pr,Ji.map(Mr=>fn(Ir({},Mr),{[fe]:!1})))},ir=()=>{no?Re(fn(Ir({},ae),{[fe]:!1})):(po||Wi(),Re(fn(Ir({},ae),{[fe]:!0})))};return On.createElement(Ce.Z,{className:$e.choiceWrap,align:"middle",wrap:!1},On.createElement(Bt.Z,{onClick:ir,className:`${$e.choiceIndex} ${no?$e.activeAnswer:""}`},pn[zr]),On.createElement(Bt.Z,{flex:1,className:`${$e.editorWrap} ml15`,onClick:Fr},On.createElement(rn,{height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9009\u9879",isEdit:mr,value:ae==null?void 0:ae[_t],onChange:Ji=>{Re(fn(Ir({},ae),{[_t]:Ji}))}})),On.createElement(Bt.Z,{flex:"0 0 auto",className:"ml15"},On.createElement("div",{onClick:ir,className:`${$e.setAnswerBtn} ${no?$e.activeAnswer:""}`},no?"\u6B63\u786E\u7B54\u6848":"\u8BBE\u4E3A\u7B54\u6848")),On.createElement(Bt.Z,{className:$e.actionWrapper},On.createElement(Le.Z,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},On.createElement(bn.Z,{className:$e.addIcon,onClick:Dr,style:{visibility:Xr?"visible":"hidden"}})),On.createElement(Le.Z,{title:"\u5220\u9664"},On.createElement(_n.Z,{className:$e.deleteIcon,onClick:Ki,style:{visibility:zr>1?"visible":"hidden"}}))))},Kr=({questionTitlePlaceholder:ae,titleKey:Re,choiceKey:_t,analysisKey:fe,choiceTextKey:zr,answerKey:mr,choiceOptionsPath:Fr,allowChangeMode:sr=!0,form:Pr,showAnalysis:po=!0})=>{const[Xr,Dr]=(0,pt.useState)(),[Ki,no]=(0,pt.useState)(!1);return On.createElement("div",{className:$e.wrap},On.createElement("div",{className:$e.questionTitleEditorWrap},On.createElement(ue.default.Item,{label:"\u9898\u5E72",name:Re,labelCol:{span:24},rules:[{required:!0}]},On.createElement($r,{scrollId:Array.isArray(Re)?Re.join("_"):`${Re}`,watch:!0,height:140,placeholder:ae}))),On.createElement(ue.default.Item,{label:"\u7B54\u6848\u9009\u9879",required:!0,labelCol:{span:24}}),On.createElement(ue.default.List,{name:_t,rules:[{validator(Wi,ir){const Ji=ir.some(Lr=>Lr[mr]),Mr=ir.findIndex(Lr=>{var Br;return((Br=Lr[zr])==null?void 0:Br.length)<=0});return Mr!==-1?Promise.reject(new Error(`\u8BF7\u5148\u8F93\u5165${pn[Mr]}\u9009\u9879\u7684\u5185\u5BB9`)):Ji?Promise.resolve():Promise.reject(new Error("\u8BF7\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))}}]},(Wi,{add:ir,remove:Ji})=>On.createElement("div",{id:Array.isArray(Fr)?Fr.join("_"):`${Fr}`},Wi.map((Mr,Lr)=>{var Br=Mr,{key:io,name:Zi}=Br,Sr=ho(Br,["key","name"]);const Li=Xr===io,Qi=()=>{Dr(io)},wr=Lr<7&&Lr===Wi.length-1,ro=()=>ir({[zr]:"",[mr]:0}),So=()=>Ji(Zi);return On.createElement(ue.default.Item,fn(Ir({},Sr),{key:io,name:Zi,noStyle:!0}),On.createElement(Hi,{choiceTextKey:zr,answerKey:mr,index:Lr,isEdit:Li,setInputActive:Qi,form:Pr,choiceOptionsPath:Fr,allowChangeMode:sr,showAddIcon:wr,addItem:ro,deleteItem:So}))}),Wi.length<8&&On.createElement("div",{className:`${$e.addBtn} mb30`,onClick:()=>ir({[zr]:"",[mr]:0})},"\u6DFB\u52A0\u9009\u9879"))),po&&On.createElement("div",{onClick:()=>no(!0)},On.createElement(ue.default.Item,{name:fe,label:"\u9898\u76EE\u89E3\u6790",labelCol:{span:24}},On.createElement(rn,{placeholder:"\u8BF7\u7F16\u8F91\u9898\u76EE\u89E3\u6790\uFF08\u975E\u5FC5\u586B\uFF09",isEdit:Ki}))))};var ji=kt(59301),xo=Object.defineProperty,Yr=Object.defineProperties,Cr=Object.getOwnPropertyDescriptors,Po=Object.getOwnPropertySymbols,je=Object.prototype.hasOwnProperty,Pn=Object.prototype.propertyIsEnumerable,be=(ae,Re,_t)=>Re in ae?xo(ae,Re,{enumerable:!0,configurable:!0,writable:!0,value:_t}):ae[Re]=_t,At=(ae,Re)=>{for(var _t in Re||(Re={}))je.call(Re,_t)&&be(ae,_t,Re[_t]);if(Po)for(var _t of Po(Re))Pn.call(Re,_t)&&be(ae,_t,Re[_t]);return ae},Zn=(ae,Re)=>Yr(ae,Cr(Re)),Jn=(ae,Re)=>{var _t={};for(var fe in ae)je.call(ae,fe)&&Re.indexOf(fe)<0&&(_t[fe]=ae[fe]);if(ae!=null&&Po)for(var fe of Po(ae))Re.indexOf(fe)<0&&Pn.call(ae,fe)&&(_t[fe]=ae[fe]);return _t};const Ci=({value:ae,onChange:Re})=>{const _t=zr=>{Dt.default.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u53C2\u8003\u7B54\u6848\u5417\uFF1F",className:$e.modal,onOk:()=>{const mr=[...ae];mr.splice(zr,1),Re(mr)}})},fe=()=>{const zr=[...ae];zr.push(""),Re(zr)};return ji.createElement(Ce.Z,{align:"middle",className:"ml20",gutter:[40,20]},ae==null?void 0:ae.map((zr,mr)=>ji.createElement(Bt.Z,{key:`${zr}_${mr}`,className:$e.blankWrapper},ji.createElement(ne.default,{className:$e.blankInput,defaultValue:zr,maxLength:1e3,onBlur:Fr=>{const sr=[...ae],Pr=Fr.target.value.trim();sr[mr]=Pr,Re(sr)}}),ji.createElement(Le.Z,{title:"\u5220\u9664"},ji.createElement(_n.Z,{className:$e.deleteIcon,style:{marginLeft:15,visibility:mr>0?"visible":"hidden"},onClick:()=>_t(mr)})))),ji.createElement(Bt.Z,null,ji.createElement("div",{className:`${$e.addBtn}`,onClick:()=>{fe()}},"\u65B0\u589E\u7B54\u6848")))},Si=({value:ae=!0,onChange:Re})=>ji.createElement(kr.Z,{checked:!ae,onChange:_t=>{Re(!_t)}}),li="\u2581",mn=({questionTitlePlaceholder:ae,form:Re,name:_t,scoreByBlank:fe="use_blank_score",answerKey:zr,titleKey:mr="name",analysisKey:Fr="analysis",isOrdered:sr="is_ordered"})=>{var Pr,po;const[Xr,Dr]=(0,pt.useState)(!1),Ki=(io,Zi)=>{const Sr=Zi.line;let Li=0;for(let wr=0;wr<Sr;wr++)Li+=io.getLine(wr).split(li).length-1;const Qi=io.getLine(Sr).substring(0,Zi.ch);return Li+=Qi.split(li).length-1,Li},no=(io,Zi,Sr,Li)=>{const Qi=io.getRange(Zi.from,Zi.to);let wr=0;if(Zi.text.forEach(ro=>{wr+=ro.split(li).length-1}),Zi.origin!=="setValue"){if(Qi&&Qi.indexOf(li)!==-1){const ro=Qi.split(li).length-1,So=Ki(io,Zi.from);if(console.log(`\u5220\u9664${ro}\u4E2A\uFF0C \u524D\u9762\u6709${So}\u4E2A\uFF0C\u65B0\u589E${wr}\u4E2A`),ro>1){const No=Array.from({length:ro},($i,_a)=>So+_a);Li(No)}else Li(So)}else if(wr>0){const ro=Ki(io,Zi.from);console.log(`\u65B0\u589E${wr}\u4E2A\uFF0C\u4E4B\u524D\u6709${ro}\u4E2A`),Sr(wr,ro)}}},Wi=()=>{const io=Re.getFieldValue(["sub_item_banks",...zr]);Re.setFieldValue(["sub_item_banks",...zr],io==null?void 0:io.map((Zi,Sr)=>Zn(At({},Zi),{position:Sr+1})))},ir=(0,pt.useRef)(),Ji=(io,Zi)=>{for(let Sr=0;Sr<io;Sr++)ir.current({position:null,answer_text:[""]},Zi+Sr);Wi()},Mr=(0,pt.useRef)(),Lr=io=>{Mr.current(io),Wi()},Br=(po=(Pr=Re.getFieldValue("sub_item_banks"))==null?void 0:Pr[zr==null?void 0:zr[0]])==null?void 0:po[zr==null?void 0:zr[1]];return ji.createElement("div",{className:$e.wrap},ji.createElement("div",{className:$e.questionTitleEditorWrap},ji.createElement(ue.default.Item,{label:"\u9898\u5E72",name:mr,labelCol:{span:24},rules:[{required:!0}]},ji.createElement($r,{scrollId:"name",watch:!0,height:140,placeholder:ae,showNullButton:!0,onCMBeforeChange:(io,Zi)=>{no(io,Zi,Ji,Lr)}}))),ji.createElement(ue.default.List,{name:zr,rules:[{validator(io,Zi){if((Zi==null?void 0:Zi.length)===0)return Promise.reject(new Error("\u7B54\u6848\u4E0D\u80FD\u4E3A\u7A7A"));for(const Sr of Zi){const{answer_text:Li}=Sr||{};if(Li!=null&&Li.some(Qi=>(Qi==null?void 0:Qi.length)===0))return Promise.reject(new Error("\u586B\u7A7A\u9879\u7B54\u6848\u4E0D\u80FD\u4E3A\u7A7A"))}return Promise.resolve()}}]},(io,{add:Zi,remove:Sr},{errors:Li})=>(ir.current=Zi,Mr.current=Sr,ji.createElement(ji.Fragment,null,ji.createElement(ue.default.Item,{label:"\u7B54\u6848\u9009\u9879",required:!0,labelCol:{span:24}}),io.map((Qi,wr)=>{var ro=Qi,{key:So,name:No}=ro,$i=Jn(ro,["key","name"]);return ji.createElement(Ce.Z,{className:"mb20",key:So,align:"middle",wrap:!1},ji.createElement(Bt.Z,{flex:"0 0 auto",className:`${$e.blankIndex}`},"\u586B\u7A7A\u9879",wr+1),ji.createElement(Bt.Z,{flex:1},ji.createElement(Ce.Z,{align:"top",justify:"space-between",wrap:!1},ji.createElement(Bt.Z,null,ji.createElement(ue.default.Item,Zn(At({},$i),{name:[No,"answer_text"],noStyle:!0}),ji.createElement(Ci,null))),(Re==null?void 0:Re.getFieldValue(["sub_item_banks",...fe]))&&ji.createElement(Bt.Z,{flex:"224px"},ji.createElement(ue.default.Item,Zn(At({},$i),{name:[No,"score"],label:"\u5206\u503C",rules:[{required:!0}],className:$e.blankInputNumberWrapper}),ji.createElement(qt.Z,{className:$e.blankInput,min:.1,max:100,style:{width:"100%"},placeholder:"\u6309\u7A7A\u7ED9\u5206\u8BF7\u8F93\u5165\u5206\u503C"})))),ji.createElement(ue.default.Item,Zn(At({},$i),{name:[No,"position"],noStyle:!0}),ji.createElement(ne.default,{type:"hidden"}))))})))),ji.createElement(Ce.Z,{align:"middle"},ji.createElement(ue.default.Item,{name:[_t,"downcase"],valuePropName:"checked"},ji.createElement(kr.Z,null)),ji.createElement(Bt.Z,{className:"ml10"},"\u5224\u5206\u65F6\u5FFD\u7565\u7B54\u6848\u4E2D\u7684\u5B57\u6BCD\u5927\u5C0F\u5199")),ji.createElement(Ce.Z,{align:"middle"},ji.createElement(ue.default.Item,{name:[_t,"no_space"],valuePropName:"checked"},ji.createElement(kr.Z,null)),ji.createElement(Bt.Z,{className:"ml10"},"\u5224\u5206\u65F6\u5FFD\u7565\u7B54\u6848\u4E2D\u7684\u7A7A\u683C")),(Br==null?void 0:Br.length)>1&&ji.createElement(Ce.Z,{align:"middle",className:(Br==null?void 0:Br.length)>1?"mb30":`${$e.hide}`},ji.createElement(ue.default.Item,{name:sr},ji.createElement(Si,null)),ji.createElement(Bt.Z,{className:"ml10"},"\u5141\u8BB8\u5B66\u751F\u6BCF\u4E2A\u586B\u7A7A\u7684\u7B54\u6848\u4E0E\u6807\u51C6\u7B54\u6848\u7684\u987A\u5E8F\u4E0D\u4E00\u81F4")),ji.createElement("div",{onClick:()=>Dr(!0)},ji.createElement(ue.default.Item,{name:Fr,label:"\u9898\u76EE\u89E3\u6790",labelCol:{span:24}},ji.createElement(rn,{placeholder:"\u8BF7\u7F16\u8F91\u9898\u76EE\u89E3\u6790\uFF08\u975E\u5FC5\u586B\uFF09",isEdit:Xr}))))};var Un=Object.defineProperty,Qn=Object.defineProperties,Dn=Object.getOwnPropertyDescriptors,Xn=Object.getOwnPropertySymbols,Oi=Object.prototype.hasOwnProperty,mi=Object.prototype.propertyIsEnumerable,ii=(ae,Re,_t)=>Re in ae?Un(ae,Re,{enumerable:!0,configurable:!0,writable:!0,value:_t}):ae[Re]=_t,on=(ae,Re)=>{for(var _t in Re||(Re={}))Oi.call(Re,_t)&&ii(ae,_t,Re[_t]);if(Xn)for(var _t of Xn(Re))mi.call(Re,_t)&&ii(ae,_t,Re[_t]);return ae},ki=(ae,Re)=>Qn(ae,Dn(Re)),Ui=(ae,Re)=>{var _t={};for(var fe in ae)Oi.call(ae,fe)&&Re.indexOf(fe)<0&&(_t[fe]=ae[fe]);if(ae!=null&&Xn)for(var fe of Xn(ae))Re.indexOf(fe)<0&&mi.call(ae,fe)&&(_t[fe]=ae[fe]);return _t};const Tr={\u6B63\u786E:"T",\u9519\u8BEF:"F"},hr=({value:ae,onChange:Re,form:_t,choiceKey:fe})=>{const zr=(ae==null?void 0:ae.is_answer)===!0,mr=ae==null?void 0:ae.choice_text,Fr=()=>{var sr;const Pr=(sr=_t==null?void 0:_t.getFieldValue(["sub_item_banks",...fe]))==null?void 0:sr.map(po=>({choice_text:po==null?void 0:po.choice_text,is_answer:!1}));_t==null||_t.setFieldValue(["sub_item_banks",...fe],Pr),Re(ki(on({},ae),{is_answer:!0}))};return pt.createElement(Ce.Z,{className:$e.choiceWrap,align:"middle",wrap:!1},pt.createElement(Bt.Z,{onClick:Fr,className:`${$e.choiceIndex} ${$e.judgementIndex} ${zr?$e.activeAnswer:""}`},Tr[mr]),pt.createElement(Bt.Z,{flex:1,className:`${$e.editorWrap} ml15`},pt.createElement("div",{className:`${$e.inputBorder} ${$e.placeholder} ${zr?$e.activeJudgementAnswer:""}`},mr)),pt.createElement(Bt.Z,{flex:"0 0 auto",className:"ml15"},pt.createElement("div",{onClick:Fr,className:`${$e.setAnswerBtn} ${zr?$e.activeAnswer:""}`},zr?"\u6B63\u786E\u7B54\u6848":"\u8BBE\u4E3A\u7B54\u6848")))},ao=({questionTitlePlaceholder:ae,choiceKey:Re="choices",form:_t,titleKey:fe="name",analysisKey:zr="analysis"})=>{const[mr,Fr]=(0,pt.useState)(!1);return pt.createElement("div",{className:$e.wrap},pt.createElement("div",{className:$e.questionTitleEditorWrap},pt.createElement(ue.default.Item,{label:"\u9898\u5E72",name:fe,labelCol:{span:24},rules:[{required:!0}]},pt.createElement($r,{scrollId:"name",watch:!0,height:140,placeholder:ae}))),pt.createElement(ue.default.Item,{label:"\u7B54\u6848\u9009\u9879",required:!0,labelCol:{span:24}},pt.createElement(ue.default.List,{name:Re,rules:[{validator(sr,Pr){return Pr.some(Xr=>(Xr==null?void 0:Xr.is_answer)===!0)?Promise.resolve():Promise.reject(new Error("\u8BF7\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))}}]},sr=>pt.createElement("div",{id:"choices"},sr.map(Pr=>{var po=Pr,{key:Xr,name:Dr}=po,Ki=Ui(po,["key","name"]);return pt.createElement(ue.default.Item,ki(on({},Ki),{key:Xr,name:Dr,noStyle:!0}),pt.createElement(hr,{form:_t,choiceKey:Re}))})))),pt.createElement("div",{onClick:()=>Fr(!0)},pt.createElement(ue.default.Item,{name:zr,label:"\u9898\u76EE\u89E3\u6790",labelCol:{span:24}},pt.createElement(rn,{placeholder:"\u8BF7\u7F16\u8F91\u9898\u76EE\u89E3\u6790\uFF08\u975E\u5FC5\u586B\uFF09",isEdit:mr}))))};var eo=Object.defineProperty,qr=Object.defineProperties,co=Object.getOwnPropertyDescriptors,uo=Object.getOwnPropertySymbols,bo=Object.prototype.hasOwnProperty,Be=Object.prototype.propertyIsEnumerable,so=(ae,Re,_t)=>Re in ae?eo(ae,Re,{enumerable:!0,configurable:!0,writable:!0,value:_t}):ae[Re]=_t,Jr=(ae,Re)=>{for(var _t in Re||(Re={}))bo.call(Re,_t)&&so(ae,_t,Re[_t]);if(uo)for(var _t of uo(Re))Be.call(Re,_t)&&so(ae,_t,Re[_t]);return ae},fr=(ae,Re)=>qr(ae,co(Re)),Hr=(ae,Re)=>{var _t={};for(var fe in ae)bo.call(ae,fe)&&Re.indexOf(fe)<0&&(_t[fe]=ae[fe]);if(ae!=null&&uo)for(var fe of uo(ae))Re.indexOf(fe)<0&&Be.call(ae,fe)&&(_t[fe]=ae[fe]);return _t};const Er=ae=>{var Re=ae,{value:_t,onChange:fe}=Re,zr=Hr(Re,["value","onChange"]);const mr=Fr=>{fe([Fr])};return pt.createElement(Vn.Z,fr(Jr({},zr),{defaultValue:_t==null?void 0:_t[0],onChange:mr}))},Fo=ae=>{if(!ae)return!1;let Re=new RegExp("[ `~!@#$^&*()={}':;,\\[\\].<>/?~\uFF01@#\uFFE5\u2026\u2026&*\uFF08\uFF09\u2014\u3010\u3011\u2018\uFF1B\uFF1A\u201D\u201C\u3002\uFF0C\u3001\uFF1F\u300C\u300D\u300E\u300F_\\+\\-\xB7%\u300A\u300B]|[\\\\/]");return ae==="|"?(me.ZP.warning("\u5173\u952E\u8BCD\u4E0D\u80FD\u53EA\u8F93\u5165\u4E00\u4E2A\u201C|\u201D\u5B57\u7B26\uFF01"),!1):!0},Lo=({value:ae=[],onClose:Re})=>pt.createElement(dr.default,{closable:!0,onClose:Re,className:$e.keywordTag},ae==null?void 0:ae.join(" \u6216 ")),Rr=({questionTitlePlaceholder:ae,form:Re,showKeywords:_t,isMustKeyWords:fe=_t,titleKey:zr="name",analysisKey:mr="analysis",answerTexts:Fr="answer_texts",keywords:sr="keywords",useKeywords:Pr="use_keywords",indexs:po})=>{const[Xr,Dr]=(0,pt.useState)(!1),[Ki,no]=(0,pt.useState)(""),Wi=ue.default.useWatch("sub_item_banks",Re),{use_keywords:ir,score:Ji}=(Wi==null?void 0:Wi[po])||{};return console.log(ir,Ji,"itemValues"),pt.createElement("div",{className:$e.wrap},pt.createElement("div",{className:$e.questionTitleEditorWrap},pt.createElement(ue.default.Item,{label:"\u9898\u5E72",name:zr,labelCol:{span:24},rules:[{required:!0}]},pt.createElement($r,{scrollId:"name",watch:!0,height:140,placeholder:ae}))),pt.createElement(ue.default.Item,{label:"\u53C2\u8003\u7B54\u6848",name:Fr,labelCol:{span:24}},pt.createElement(Er,{watch:!0,height:140,placeholder:"\u8BF7\u7F16\u8F91\u53C2\u8003\u7B54\u6848\uFF08\u975E\u5FC5\u586B\uFF09"})),_t&&!fe&&pt.createElement(ue.default.Item,{hidden:!0,name:Pr,valuePropName:"checked"},pt.createElement(kr.Z,{defaultChecked:!0})),_t&&fe&&pt.createElement(Ce.Z,{align:"middle",className:"mb30"},pt.createElement(ue.default.Item,{name:Pr,valuePropName:"checked"},pt.createElement(kr.Z,null)),pt.createElement(Bt.Z,{className:"ml10"},"\u5F00\u542F\u5173\u952E\u8BCD\u81EA\u52A8\u5224\u5206"),pt.createElement(Bt.Z,null,pt.createElement(Le.Z,{placement:"right",title:"\u9009\u4E2D\u540E\uFF0C\u9700\u8981\u8BBE\u7F6E\u6BCF\u4E2A\u5173\u952E\u8BCD\u7684\u5206\u503C\uFF0C\u7CFB\u7EDF\u4F1A\u6839\u636E\u8BBE\u7F6E\u7684\u5173\u952E\u8BCD\u8FDB\u884C\u81EA\u52A8\u5224\u5206\uFF1B \u6240\u6709\u5173\u952E\u8BCD\u5206\u503C\u4E4B\u548C\u5FC5\u987B\u5C0F\u4E8E\u7B49\u4E8E\u5C0F\u9898\u5206\u503C\u3002"},pt.createElement(ci.Z,{style:{color:"#3061D0",marginLeft:6,cursor:"pointer"}})))),(ir||!fe)&&pt.createElement(ue.default.List,{name:sr,rules:[{validator(Mr,Lr){return fe?Lr!=null&&Lr.length?(Lr==null?void 0:Lr.reduce((io,Zi)=>io+Zi.score,0))>parseFloat(Ji)?Promise.reject(new Error("\u6240\u6709\u5173\u952E\u8BCD\u7684\u5206\u503C\u4E4B\u548C\u5FC5\u987B\u5C0F\u4E8E\u7B49\u4E8E\u8BE5\u5C0F\u9898\u7684\u5206\u503C")):Promise.resolve():Promise.reject(new Error("\u8BF7\u8BBE\u7F6E\u5224\u5206\u5173\u952E\u8BCD")):Promise.resolve()}}]},(Mr,{add:Lr,remove:Br})=>pt.createElement(pt.Fragment,null,pt.createElement("div",{className:`${$e.title} mb10`},fe?"\u5173\u952E\u8BCD":pt.createElement("span",{style:{color:"#9096A3"}},"\u5224\u5206\u5173\u952E\u8BCD")),pt.createElement(Ce.Z,{align:"middle",className:"font14 mb30"},pt.createElement(Bt.Z,{flex:1},pt.createElement(ne.default,{value:Ki,onChange:io=>{no(io.target.value)},maxLength:50,allowClear:!0,onPressEnter:io=>{var Zi,Sr,Li,Qi;const wr=`${(Zi=io.target)==null?void 0:Zi.value}`,ro=(Li=(Sr=wr==null?void 0:wr.split("|"))==null?void 0:Sr.filter($i=>!!$i))==null?void 0:Li.map($i=>$i==null?void 0:$i.trim()),So=Re.getFieldValue(["sub_item_banks",...sr]),No=((Qi=So==null?void 0:So.map($i=>$i==null?void 0:$i.keyword))==null?void 0:Qi.flat())||[];for(const $i of ro)if(No.includes($i)){me.ZP.error("\u4E3A\u907F\u514D\u5224\u5206\u9519\u8BEF\uFF0C\u8BF7\u52FF\u8BBE\u7F6E\u76F8\u540C\u7684\u5173\u952E\u8BCD");return}Fo(wr)&&(Lr({keyword:ro,score:1}),no(""))},className:$e.inputBorder,placeholder:"\u652F\u6301\u8BBE\u7F6E\u591A\u4E2A\u5173\u952E\u8BCD\uFF1B\u5E76\u5217\u5173\u952E\u8BCD\uFF08\u6216\u7684\u5173\u7CFB\uFF09\u8BF7\u7528\u201C|\u201D\u5206\u9694\u5F00"})),pt.createElement(Bt.Z,{flex:"148px",style:{textAlign:"right",color:"#e99237"}},"\u201C\u56DE\u8F66\u952E\u201D\u4FDD\u5B58\u5173\u952E\u8BCD")),Mr.map(io=>{var Zi=io,{key:Sr,name:Li}=Zi,Qi=Hr(Zi,["key","name"]);return pt.createElement(Ce.Z,{key:Sr,className:"mb20",style:{marginRight:148}},pt.createElement(Bt.Z,{flex:1},pt.createElement(Ce.Z,{align:"middle",justify:"space-between"},pt.createElement(ue.default.Item,fr(Jr({},Qi),{name:[Li,"keyword"]}),pt.createElement(Lo,{onClose:()=>Br(Li)})),fe&&pt.createElement(ue.default.Item,fr(Jr({},Qi),{name:[Li,"score"],label:"\u5206\u503C",rules:[{required:!0}],className:$e.blankInputNumberWrapper}),pt.createElement(qt.Z,{className:$e.blankInput,min:.1,max:100,precision:1,style:{width:"100%"},placeholder:"\u8BF7\u8F93\u5165\u5173\u952E\u8BCD\u5206\u6570"})))))}))),pt.createElement("div",{onClick:()=>Dr(!0)},pt.createElement(ue.default.Item,{name:mr,label:"\u9898\u76EE\u89E3\u6790",labelCol:{span:24}},pt.createElement(rn,{placeholder:"\u8BF7\u7F16\u8F91\u9898\u76EE\u89E3\u6790\uFF08\u975E\u5FC5\u586B\uFF09",isEdit:Xr}))))};var jr=kt(59301),Za=Object.defineProperty,aa=Object.defineProperties,As=Object.getOwnPropertyDescriptors,Na=Object.getOwnPropertySymbols,nr=Object.prototype.hasOwnProperty,qo=Object.prototype.propertyIsEnumerable,ta=(ae,Re,_t)=>Re in ae?Za(ae,Re,{enumerable:!0,configurable:!0,writable:!0,value:_t}):ae[Re]=_t,ga=(ae,Re)=>{for(var _t in Re||(Re={}))nr.call(Re,_t)&&ta(ae,_t,Re[_t]);if(Na)for(var _t of Na(Re))qo.call(Re,_t)&&ta(ae,_t,Re[_t]);return ae},oa=(ae,Re)=>aa(ae,As(Re)),pa=(ae,Re)=>{var _t={};for(var fe in ae)nr.call(ae,fe)&&Re.indexOf(fe)<0&&(_t[fe]=ae[fe]);if(ae!=null&&Na)for(var fe of Na(ae))Re.indexOf(fe)<0&&qo.call(ae,fe)&&(_t[fe]=ae[fe]);return _t},fi=(ae,Re,_t)=>new Promise((fe,zr)=>{var mr=Pr=>{try{sr(_t.next(Pr))}catch(po){zr(po)}},Fr=Pr=>{try{sr(_t.throw(Pr))}catch(po){zr(po)}},sr=Pr=>Pr.done?fe(Pr.value):Promise.resolve(Pr.value).then(mr,Fr);sr((_t=_t.apply(ae,Re)).next())});const{Panel:ar}=Ie.default,_r=null,to=(ae,Re)=>{var _t=ae,{globalSetting:fe,loading:zr,dispatch:mr,editData:Fr,onRef:sr=()=>{},isEdit:Pr}=_t,po=pa(_t,["globalSetting","loading","dispatch","editData","onRef","isEdit"]);const[Xr,Dr]=(0,pt.useState)(""),[Ki,no]=(0,pt.useState)([]),[Wi]=ue.default.useForm();(0,pt.useEffect)(()=>{!Fr||!Pr||(Dr(Fr==null?void 0:Fr.name),no(Fr==null?void 0:Fr.sub_item_banks),Wi.setFieldsValue(ga({},Fr)))},[Fr]),(0,pt.useEffect)(()=>{no(Wi.getFieldValue("sub_item_banks"))},[ue.default.useWatch("sub_item_banks",Wi)]),(0,pt.useImperativeHandle)(Re,()=>({onSave:ir,Clear:Ji}));const ir=()=>fi(void 0,null,function*(){if(!Xr)return me.ZP.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),!1;try{yield Wi.validateFields()}catch(Sr){return console.log(Sr,"errInfo"),me.ZP.error(Sr.errorFields[0].errors[0]),!1}const Zi=Ki.map(Sr=>ga({id:Sr.id>1?Sr.id:null},Sr));return{name:Xr,sub_item_banks:Zi}}),Ji=()=>{Dr(""),no([])},Mr={single:"\u5355\u9009\u9898",multiple:"\u591A\u9009\u9898",judgement:"\u5224\u65AD\u9898",completion:"\u586B\u7A7A\u9898",subjective:"\u7B80\u7B54\u9898",practical:"\u5B9E\u8BAD\u9898",program:"\u7F16\u7A0B\u9898",bprogram:"\u7A0B\u5E8F\u586B\u7A7A\u9898",combination:"\u7EC4\u5408\u9898"},Lr=({value:Zi})=>jr.createElement("div",{style:{textAlign:"center",color:"#DF3065",margin:"0 5px"}},Zi),[Br,io]=(0,pt.useState)();return jr.createElement("section",{className:te.wrap},jr.createElement("p",{className:te.titleWrap},jr.createElement("span",{className:te.required},"*"),jr.createElement("span",{className:te.title},"\u9898\u5E72\uFF1A")),jr.createElement(Vn.Z,{id:"combination-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:Xr,onChange:Zi=>Dr(Zi)}),jr.createElement(ue.default,{form:Wi,autoComplete:"off"},jr.createElement(ue.default.List,{name:"sub_item_banks",rules:[{validator(Zi,Sr){return Sr?Promise.resolve():Promise.reject(new Error("\u8BF7\u6DFB\u52A0\u5C0F\u9898"))}}]},(Zi,{add:Sr,remove:Li})=>{const Qi=Wi.getFieldValue("sub_item_banks");return jr.createElement(jr.Fragment,null,jr.createElement(Ie.default,{className:Zi.length>0?te.collapseWrapper:"",bordered:!1,expandIcon:({isActive:wr})=>jr.createElement("i",{className:`iconfont icon-weizhankai ${wr?te.open:te.close}`,style:{fontSize:14,transition:"all .2s"}})},Zi.map((wr,ro)=>{var So=wr,{key:No,name:$i}=So,_a=pa(So,["key","name"]),or,Oo,Ar,ea,Yo,la,ll,Xl,Js,Dl,jo,vs;return jr.createElement(ar,{className:te.panel,forceRender:!0,header:jr.createElement("div",{className:te.panelHeader},"\u7B2C",ro+1,"\u5C0F\u9898",jr.createElement("span",null,"\uFF08",Mr[(or=Qi==null?void 0:Qi[$i])==null?void 0:or.item_type],"\uFF09")),extra:jr.createElement(Ce.Z,{align:"middle",onClick:Ol=>Ol.stopPropagation(),style:{display:"flex",alignItems:"center"}},((Oo=Qi==null?void 0:Qi[$i])==null?void 0:Oo.item_type)=="completion"&&jr.createElement(ue.default.Item,oa(ga({},_a),{name:[$i,"score"],className:te.blankInputNumberWrapper,style:{marginBottom:0}}),((Ar=Qi==null?void 0:Qi[$i])==null?void 0:Ar.item_type)=="completion"&&jr.createElement("div",{style:{display:"flex",alignItems:"center",color:"#191919"}},"\u5171",jr.createElement(Lr,{value:(ea=Qi==null?void 0:Qi[$i])==null?void 0:ea.score}),"\u5206")),((Yo=Qi==null?void 0:Qi[$i])==null?void 0:Yo.item_type)=="completion"&&jr.createElement(jr.Fragment,null,jr.createElement(Fe.ZP.Group,{defaultValue:(la=Qi==null?void 0:Qi[$i])==null?void 0:la.use_blank_score,className:te.scoreByBlankRadio,style:{marginRight:10},optionType:"button",options:[{label:"\u6309\u7A7A\u7ED9\u5206",value:!0},{label:"\u6309\u9898\u7ED9\u5206",value:!1}],onChange:Ol=>{var Qs;console.log(Wi.getFieldsValue()),Wi==null||Wi.setFieldValue(["sub_item_banks",$i,"use_blank_score"],(Qs=Ol==null?void 0:Ol.target)==null?void 0:Qs.value),io(new Date)}}),jr.createElement(Le.Z,{overlayInnerStyle:{width:460},title:jr.createElement("div",null,"\u6309\u7A7A\u7ED9\u5206\uFF1A\u9700\u8981\u5206\u522B\u8BBE\u7F6E\u6BCF\u4E2A\u586B\u7A7A\u9879\u7684\u5206\u503C\uFF0C\u586B\u7A7A\u9879\u7B54\u5BF9\u4E4B\u540E\u5219\u83B7\u5F97\u5BF9\u5E94\u7684\u5206\u503C\u3002",jr.createElement("br",null),"\u6309\u9898\u7ED9\u5206\uFF1A\u7B54\u5BF9\u5168\u90E8\u586B\u7A7A\u9879\u4E4B\u540E\u624D\u80FD\u83B7\u5F97\u8BE5\u5C0F\u9898\u7684\u5206\u503C\u3002")},jr.createElement("i",{className:"icon-tishixiaowenhao font18 c-3061d0"})))),key:No},jr.createElement(ue.default.Item,oa(ga({},_a),{name:$i}),(((ll=Qi==null?void 0:Qi[$i])==null?void 0:ll.item_type)=="single"||((Xl=Qi==null?void 0:Qi[$i])==null?void 0:Xl.item_type)=="multiple")&&jr.createElement(Kr,{questionTitlePlaceholder:"\u8BF7\u7F16\u8F91\u9009\u62E9\u9898\u9898\u5E72\u5185\u5BB9",allowChangeMode:((Js=Qi==null?void 0:Qi[$i])==null?void 0:Js.item_type)!="single",form:Wi,choiceKey:[$i,"choices"],titleKey:[$i,"name"],analysisKey:[$i,"analysis"],choiceOptionsPath:["sub_item_banks",$i,"choices"],choiceTextKey:"choice_text",answerKey:"is_answer"}),((Dl=Qi==null?void 0:Qi[$i])==null?void 0:Dl.item_type)=="completion"&&jr.createElement(mn,{form:Wi,name:$i,questionTitlePlaceholder:"\u8BF7\u7F16\u8F91\u9898\u5E72\u5E76\u8BBE\u7F6E\u586B\u7A7A\u9879",scoreByBlank:[$i,"use_blank_score"],titleKey:[$i,"name"],analysisKey:[$i,"analysis"],isOrdered:[$i,"is_ordered"],answerKey:[$i,"standard_answer"],key:Br}),((jo=Qi==null?void 0:Qi[$i])==null?void 0:jo.item_type)=="judgement"&&jr.createElement(ao,{form:Wi,questionTitlePlaceholder:"\u8BF7\u7F16\u8F91\u5224\u65AD\u9898\u9898\u5E72\u5185\u5BB9",titleKey:[$i,"name"],analysisKey:[$i,"analysis"],choiceKey:[$i,"choices"]}),((vs=Qi==null?void 0:Qi[$i])==null?void 0:vs.item_type)=="subjective"&&jr.createElement(Rr,{showKeywords:!0,form:Wi,titleKey:[$i,"name"],analysisKey:[$i,"analysis"],answerTexts:[$i,"answer_texts"],useKeywords:[$i,"use_keywords"],keywords:[$i,"keywords"],indexs:$i,questionTitlePlaceholder:"\u8BF7\u7F16\u8F91\u7B80\u7B54\u9898\u9898\u5E72\u5185\u5BB9"})))})))})))};var fo=(0,$t.connect)(({loading:ae,globalSetting:Re})=>({globalSetting:Re,loading:ae.effects}),null,null,{forwardRef:!0})((0,pt.forwardRef)(to)),zo=kt(84842),lr=kt(17149),Xa=kt(82326),fa=kt(54172),Uo={flex_box_center:"flex_box_center___xDdtW",flex_space_between:"flex_space_between___J4mFI",flex_box_vertical_center:"flex_box_vertical_center___hDYn6",flex_box_center_end:"flex_box_center_end___H7l1j",flex_box_column:"flex_box_column___TPd2T",questionInfo:"questionInfo___ABq66",label:"label___VQOr7",content:"content____HZ6z",leftPart:"leftPart___YB0y5",rightPart:"rightPart___UVMmS",dragItem:"dragItem___Hbx8k",blackText:"blackText___U4u33",greyText:"greyText___rWIL_",iconWrapper:"iconWrapper___I0kek",contentArea:"contentArea___hGC13",dragging:"dragging___z7VVY",hidden:"hidden___nWAxb",dragIcon:"dragIcon___j91TC",deleteIcon:"deleteIcon___cmCqc",disabled:"disabled___ZlKMj",challengeNameWrapper:"challengeNameWrapper___SpiRb",challengeName:"challengeName___lmQe2",shixunPreviewFooter:"shixunPreviewFooter___u0CzD",shixunInfoWrapper:"shixunInfoWrapper___HzLHD",shixunInfo:"shixunInfo___qaQlF",btnToDetail:"btnToDetail___scXqr",fixedBottom:"fixedBottom___wTBAR",cancelBtn:"cancelBtn___Km4Gi",confirmBtn:"confirmBtn___WrECz",previewBtn:"previewBtn____oGPS",setScoreModalTable:"setScoreModalTable___CjDlp",title:"title___cQWdZ",tipcontent:"tipcontent___A8tZ5",name:"name___CvfT9",tip:"tip___EvoCF",info:"info___y_ayi",img:"img___X9CNn"},lo=kt(45775),Pa=kt(58433),is=kt(82264),Qo=kt(45937),ps=kt(28426),ms=kt(94361),Fa=({open:ae,onCancel:Re,onOk:_t})=>{const fe=(0,Pa.g)(),[zr,mr,Fr,sr]=(0,Qo.U)(is.Gm,{page:1,limit:10,keyword:"",diff:"",shixun_publish_status:"",discipline_id:"",sub_discipline_id:"",type:0,include_shixuns:!0,item_type:"SHIXUN"}),[Pr,po]=(0,pt.useState)(!1);(0,pt.useEffect)(()=>{ae&&Fr({page:1,limit:10,type:0},!0).then(Wi=>{(Wi==null?void 0:Wi.shixuns_count)===0&&po(!0)})},[ae]);const[Xr,Dr]=(0,pt.useState)([]),[Ki,no]=(0,pt.useState)([]);return pt.createElement(Dt.default,{title:"\u9009\u62E9\u5B9E\u8BAD\u9898",open:ae,width:948,centered:!0,closable:!0,onCancel:Re,onOk:()=>_t(Ki),destroyOnClose:!0},pt.createElement(Ce.Z,{justify:"space-between",className:"mb20",style:{maxHeight:650}},pt.createElement(Bt.Z,null,pt.createElement(lr.Z,{style:{width:160},size:"large",placeholder:"\u8BF7\u9009\u62E9\u65B9\u5411&\u8BFE\u7A0B",options:fe,onChange:Wi=>{Fr({page:1,discipline_id:Wi==null?void 0:Wi[0],sub_discipline_id:Wi==null?void 0:Wi[1]})}}),pt.createElement(Xa.default,{className:"ml20",style:{width:118},size:"large",placeholder:"\u96BE\u5EA6",allowClear:!0,options:[{label:"\u521D\u7EA7",value:1},{label:"\u4E2D\u7EA7",value:2},{label:"\u4E2D\u9AD8\u7EA7",value:3},{label:"\u9AD8\u7EA7",value:4}],onChange:Wi=>Fr({page:1,diff:Wi})}),pt.createElement(Xa.default,{className:"ml20",placeholder:"\u5168\u90E8\u72B6\u6001",style:{width:118},size:"large",allowClear:!0,options:[{label:"\u672A\u53D1\u5E03",value:"unpublish"},{label:"\u9759\u9ED8\u53D1\u5E03",value:"silent_publish"},{label:"\u516C\u5F00\u53D1\u5E03",value:"public_publish"}],onChange:Wi=>Fr({page:1,shixun_publish_status:Wi})})),pt.createElement(lo.t7,{placeholder:"\u8BF7\u8F93\u5165\u5173\u952E\u8BCD\u641C\u7D22",style:{width:290},onChange:Wi=>{Fr({keyword:Wi,page:1})}})),Pr?pt.createElement("div",null,pt.createElement(ps.Z,{customText:"\u6682\u65E0\u6570\u636E",ButtonText:"\u524D\u5F80\u5B9E\u8DF5\u9879\u76EE\u5E93\uFF0C\u6DFB\u52A0\u66F4\u591A\u8BD5\u9898>",ButtonClick:()=>(0,Xt.xg)("/shixuns")})):pt.createElement(fa.default,{loading:mr,rowKey:"id",columns:[{title:"\u8BD5\u9898\u540D\u79F0",dataIndex:"name",width:"30%",ellipsis:{showTitle:!0},render:(Wi,ir)=>pt.createElement("div",{style:{display:"flex",alignItems:"center"}},pt.createElement("div",{className:ir!=null&&ir.high_resources_consume?Uo.title:"",title:Wi||"--"},pt.createElement(Ot.Z,{key:1,showLines:1,showTextOnly:!0,value:Wi||"--"})),(ir==null?void 0:ir.high_resources_consume)&&pt.createElement(ms.Z,{type:"shixun",style:{marginLeft:10}}))},{title:"\u96BE\u5EA6",dataIndex:"level"},{title:"\u5173\u5361\u6570\u91CF",dataIndex:"challenges_count",key:"challenges_count",render:(Wi,ir,Ji)=>pt.createElement("span",null,Wi||"- -")},{title:"\u4F7F\u7528\u6B21\u6570",dataIndex:"study_count"},{title:pt.createElement("span",null,"\u53D1\u5E03\u72B6\u6001 ",pt.createElement(Le.Z,{title:"\u672A\u53D1\u5E03\u7684\u5B9E\u8DF5\u9879\u76EE\u4E0D\u80FD\u88AB\u9009\u7528"},pt.createElement(ci.Z,null))),dataIndex:"shixun_tag_num_name",key:"shixun_tag_num_name",width:100,render:(Wi,ir,Ji)=>pt.createElement("span",null,Wi||"- -")},{title:"\u64CD\u4F5C",render(Wi,ir){const{title:Ji,challenge_names:Mr,author_name:Lr,identifier:Br,author_school_name:io,study_count:Zi}=ir||{};return pt.createElement("div",null,pt.createElement("span",{style:{color:"#165DFF",cursor:"pointer"},onClick:()=>{Dt.default.confirm({title:"\u9898\u76EE\u8BE6\u60C5",closable:!0,width:1e3,centered:!0,icon:null,footer:null,content:pt.createElement("div",null,pt.createElement(Ot.Z,{value:Ji,style:{marginBottom:18}}),pt.createElement("div",{className:Uo.challengeNameWrapper},Mr.map((Sr,Li)=>pt.createElement("div",{className:Uo.challengeName,key:Li},"\u7B2C",(0,Xt.EM)(Li+1),"\u9898\xA0",Sr))),pt.createElement(Ce.Z,{className:Uo.shixunPreviewFooter,justify:"space-between",style:{alignItems:"center"}},pt.createElement(Bt.Z,{className:Uo.shixunInfoWrapper},pt.createElement("span",null,"\u521B\u5EFA\u8005"),pt.createElement("span",{className:Uo.shixunInfo},Lr.split("\u3001")[0]),pt.createElement("span",null,"\u6240\u5C5E\u5355\u4F4D"),pt.createElement("span",{className:Uo.shixunInfo},io),pt.createElement("span",null,"\u5B66\u4E60\u4EBA\u6570"),pt.createElement("span",{className:Uo.shixunInfo},Zi)),pt.createElement(he.ZP,{type:"primary",className:Uo.btnToDetail,onClick:()=>(0,Xt.xg)(`/shixuns/${Br}/challenges?exercise=true`)},pt.createElement("i",{className:"iconfont icon-shixunkecheng"}),"\u5B9E\u8BAD\u8BE6\u60C5")))})}},"\u67E5\u770B"),(ir==null?void 0:ir.shixun_tag_num)===1&&pt.createElement("a",{target:"_blank",href:`/shixuns/${ir==null?void 0:ir.identifier}/challenges`,style:{marginLeft:10}},"\u53BB\u53D1\u5E03"))}}],dataSource:sr==null?void 0:sr.items,rowSelection:{type:"radio",selectedRowKeys:Xr,preserveSelectedRowKeys:!0,getCheckboxProps:Wi=>({disabled:Wi.shixun_tag_num===1}),onChange(Wi,ir){var Ji,Mr,Lr;console.log(Wi),Dr(Wi);const Br=[];for(const Zi of Ki)Wi.includes(Zi.id)&&Br.push(Zi);const io=Br.map(Zi=>Zi.id);for(const Zi of ir)Zi&&Wi.includes(Zi.id)&&!io.includes(Zi.id)&&Br.push({id:Zi.id,difficulty:Zi.level,identifier:Zi.identifier,name:Zi.name,real_name:(Ji=Zi==null?void 0:Zi.author_name)==null?void 0:Ji.split("\u3001")[0],school_name:Zi.author_school_name,challenge_names:Zi.challenge_names,challenges:(Mr=Zi.challenge_names)==null?void 0:Mr.map((Sr,Li)=>({subject:Sr,id:Li,score:5})),score:((Lr=Zi.challenge_names)==null?void 0:Lr.length)*5,study_count:Zi.study_count,challenges_count:Zi.challenges_count});no(Br)}},pagination:{current:zr.page,pageSize:zr.limit,total:sr==null?void 0:sr.items_count,showTotal:Wi=>pt.createElement("span",null,"\u5171\xA0",pt.createElement("span",{style:{color:"#165DFF"}},Wi),"\xA0\u6761\u6570\u636E"),showQuickJumper:!0,onChange(Wi,ir){Fr({page:Wi,limit:ir})},size:"default"},scroll:{y:400}}))},Ru=kt(3039),Lu=kt(75736),Zs=(ae,Re,_t)=>new Promise((fe,zr)=>{var mr=Pr=>{try{sr(_t.next(Pr))}catch(po){zr(po)}},Fr=Pr=>{try{sr(_t.throw(Pr))}catch(po){zr(po)}},sr=Pr=>Pr.done?fe(Pr.value):Promise.resolve(Pr.value).then(mr,Fr);sr((_t=_t.apply(ae,Re)).next())}),Gs=({visible:ae,getdata:Re,onCancel:_t,onRandomExchange:fe,selectFromProblemSet:zr,questionParams:mr})=>{const[Fr,sr]=(0,pt.useState)(!1),[Pr,po]=(0,pt.useState)(!1),[Xr,Dr]=(0,pt.useState)({}),Ki=(0,$t.useParams)(),[no,Wi]=(0,pt.useState)(),ir=(Ji,Mr)=>Zs(void 0,null,function*(){po(!0);const Lr=yield(0,Ht.ZP)(`/api/exercises/${Ki.categoryId}/toggle_random_question.json`,{method:"post",body:{question_id:mr.id,item_bank_id:Ji,shixuns_info:[{id:Ji,is_copy:Mr!=1,is_use:Mr!=1}]}});po(!1),Lr!=null&&Lr.status||(me.ZP.info("\u6362\u9898\u6210\u529F"),_t(),Re())});return pt.createElement(Dt.default,{title:"\u8BF7\u9009\u62E9\u66FF\u6362\u65B9\u5F0F",open:ae,onCancel:_t,centered:!0,maskClosable:!0,footer:null},pt.createElement(Ce.Z,{justify:"center",className:"pb20"},pt.createElement(zo.Z,{onClick:fe},"\u968F\u673A\u66F4\u6362"),(mr==null?void 0:mr.type)!=="PRACTICAL"&&pt.createElement(he.ZP,{style:{marginLeft:24},onClick:zr},"\u4ECE\u9898\u5E93\u4E2D\u9009\u62E9"),(mr==null?void 0:mr.type)==="PRACTICAL"&&pt.createElement(he.ZP,{style:{marginLeft:24},onClick:()=>{sr(!0)}},"\u4ECE\u9898\u5E93\u4E2D\u9009\u62E9")),pt.createElement(Fa,{open:Fr,onCancel:()=>sr(!1),onOk:Ji=>Zs(void 0,null,function*(){if(console.log("----selectedRows",Ji,Ki),(Ji==null?void 0:Ji.length)<=0){me.ZP.info("\u8BF7\u9009\u62E9\u5B9E\u8BAD");return}let Mr=Ji==null?void 0:Ji.map(Br=>Br==null?void 0:Br.id),Lr=yield(0,Lu.Tr)({id:[...Mr],course_id:Ki.coursesId,type:"shixun"});(Lr==null?void 0:Lr.student_count)===0?ir(Mr==null?void 0:Mr[0],1):(Wi(Mr),Dr(Lr)),sr(!1)})}),pt.createElement(Ru.Z,{resdata:Xr,type:"shixun",okloading:Pr,oktext:(Xr==null?void 0:Xr.can_copy_num)===0?"\u786E\u5B9A":"\u4E00\u952E\u590D\u5236\u5E76\u66FF\u6362",onok:Ji=>Zs(void 0,null,function*(){ir(no==null?void 0:no[0],2)})}))},Ul=kt(77762),hu=kt(24334),Fu=kt(90283),wa=kt(60572),sl=kt(32162),ju=kt(48790),Yl=Object.defineProperty,du=Object.defineProperties,Ja=Object.getOwnPropertyDescriptors,Qa=Object.getOwnPropertySymbols,Ba=Object.prototype.hasOwnProperty,Ga=Object.prototype.propertyIsEnumerable,Tl=(ae,Re,_t)=>Re in ae?Yl(ae,Re,{enumerable:!0,configurable:!0,writable:!0,value:_t}):ae[Re]=_t,ma=(ae,Re)=>{for(var _t in Re||(Re={}))Ba.call(Re,_t)&&Tl(ae,_t,Re[_t]);if(Qa)for(var _t of Qa(Re))Ga.call(Re,_t)&&Tl(ae,_t,Re[_t]);return ae},Ro=(ae,Re)=>du(ae,Ja(Re)),wo=(ae,Re,_t)=>new Promise((fe,zr)=>{var mr=Pr=>{try{sr(_t.next(Pr))}catch(po){zr(po)}},Fr=Pr=>{try{sr(_t.throw(Pr))}catch(po){zr(po)}},sr=Pr=>Pr.done?fe(Pr.value):Promise.resolve(Pr.value).then(mr,Fr);sr((_t=_t.apply(ae,Re)).next())}),Aa=({data:ae,submit:Re,goBack:_t,loading:fe,onTypeScore:zr,editPreview:mr=!1,onSkipExamination:Fr,selectValue:sr,onExchange:Pr,getdata:po,handleMarkWrongQuestion:Xr})=>{var Dr,Ki,no,Wi,ir,Ji,Mr,Lr,Br,io,Zi;const Sr=(0,pt.useRef)(),[Li,Qi]=(0,pt.useState)(null),[wr,ro]=(0,pt.useState)(!1),[So,No]=(0,pt.useState)(!1),$i=(0,pt.useRef)(),[_a]=ue.default.useForm(),or=(0,$t.useParams)(),[Oo,Ar]=(0,pt.useState)(!1),[ea,Yo]=(0,pt.useState)(!1),[la,ll]=(0,pt.useState)([]);(0,pt.useEffect)(()=>{ro(!0)},[]),(0,pt.useEffect)(()=>{mr||(0,Xt.Dk)("\u8BD5\u5377\u9884\u89C8")},[mr]),(0,pt.useEffect)(()=>{var Cn;((Cn=ae==null?void 0:ae.questionList)==null?void 0:Cn.length)>0&&(ae==null||ae.questionList.forEach(Ni=>{var Gr;Ni.type==="PRACTICAL"&&((Gr=Ni==null?void 0:Ni.questions)==null||Gr.forEach((ur,Pi)=>{var Io;la[Pi]=!((Io=ur==null?void 0:ur.shixun)!=null&&Io.ignore_prompt),ll([...la])}))}))},[ae]);const Xl=["\u5BB9\u6613","\u7B80\u5355","\u9002\u4E2D","\u56F0\u96BE"],Js={SINGLE:"\u5355\u9009\u9898",MULTIPLE:"\u591A\u9009\u9898",JUDGMENT:"\u5224\u65AD\u9898",COMPLETION:"\u586B\u7A7A\u9898",SUBJECTIVE:"\u7B80\u7B54\u9898",PRACTICAL:"\u5B9E\u8BAD\u9898",PROGRAM:"\u7F16\u7A0B\u9898",BPROGRAM:"\u7A0B\u5E8F\u586B\u7A7A\u9898",COMBINATION:"\u7EC4\u5408\u9898"},Dl={single:"\u5355\u9009\u9898",multiple:"\u591A\u9009\u9898",judgement:"\u5224\u65AD\u9898",completion:"\u586B\u7A7A\u9898",subjective:"\u7B80\u7B54\u9898",practical:"\u5B9E\u8BAD\u9898",program:"\u7F16\u7A0B\u9898",bprogram:"\u7A0B\u5E8F\u586B\u7A7A\u9898",combination:"\u7EC4\u5408\u9898"},jo=Cn=>{var Ni;const Gr=[];return pt.createElement(pt.Fragment,null,pt.createElement("aside",{className:Ut.single},(Ni=Cn==null?void 0:Cn.choices)==null?void 0:Ni.map((ur,Pi)=>(ur.is_answer&&Gr.push(sl.k4[Pi]),pt.createElement("ul",{key:Pi},pt.createElement("li",null,sl.k4[Pi],"\u3001"),pt.createElement("li",null,pt.createElement(Ot.Z,{value:ur.choice_text})))))),pt.createElement("div",{className:Ut.analysis},pt.createElement("div",null,"\u6B63\u786E\u7B54\u6848\uFF1A",Gr.join(""),pt.createElement("span",{className:"ml30"},"\u96BE\u5EA6\uFF1A",Xl[Cn.difficulty])),pt.createElement("aside",null,pt.createElement("span",{className:Ut.text},"\u89E3\u6790:"),pt.createElement(Ot.Z,{value:Cn.analysis?Cn.analysis:"\u6682\u65E0\u89E3\u6790"})),pt.createElement("ul",null,pt.createElement("li",null,pt.createElement("span",{style:{color:"#007AFF",marginRight:10}},"\u65B9\u5411&\u8BFE\u7A0B:"),`${(Cn==null?void 0:Cn.discipline_name)||"--"}/${Cn==null?void 0:Cn.sub_discipline_name}`),pt.createElement(Le.Z,{title:Cn==null?void 0:Cn.tag_discipline_name},pt.createElement("li",{style:{maxWidth:"400px",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}},pt.createElement("span",{style:{color:"#5AB891",marginRight:10}},"\u77E5\u8BC6\u70B9:"),Cn==null?void 0:Cn.tag_discipline_name)))))},vs=(Cn,Ni)=>{var Gr;const ur=(Gr=Cn==null?void 0:Cn.standard_answer)==null?void 0:Gr.map((Pi,Io)=>{var Co;return pt.createElement("div",{key:Io},`\u7B54\u6848\uFF08\u586B\u7A7A${Pi==null?void 0:Pi.position}\uFF09\uFF1A${(Co=Pi==null?void 0:Pi.answer_text)==null?void 0:Co.join("\u3001")}`)});return pt.createElement(pt.Fragment,null,pt.createElement("div",{className:Ut.analysis},pt.createElement("div",{style:{display:"flex"}},pt.createElement("div",null,"\u6B63\u786E\u7B54\u6848\uFF1A"),pt.createElement("div",null,ur)),pt.createElement("aside",null,pt.createElement("span",{className:Ut.text},"\u89E3\u6790:"),pt.createElement(Ot.Z,{value:Cn.analysis?Cn.analysis:"\u6682\u65E0\u89E3\u6790"})),pt.createElement("ul",null,pt.createElement("li",null,pt.createElement("span",{style:{color:"#007AFF",marginRight:10}},"\u65B9\u5411&\u8BFE\u7A0B:"),Ni?`${(Ni==null?void 0:Ni.discipline_name)||"--"}/${Ni==null?void 0:Ni.sub_discipline_name}`:`${(Cn==null?void 0:Cn.discipline_name)||"--"}/${Cn==null?void 0:Cn.sub_discipline_name}`),pt.createElement(Le.Z,{title:Ni?Ni==null?void 0:Ni.tag_discipline_name:Cn==null?void 0:Cn.tag_discipline_name},pt.createElement("li",{style:{maxWidth:"400px",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}},pt.createElement("span",{style:{color:"#5AB891",marginRight:10}},"\u77E5\u8BC6\u70B9:"),Ni?Ni==null?void 0:Ni.tag_discipline_name:Cn==null?void 0:Cn.tag_discipline_name)))))},Ol=Cn=>{var Ni;const Gr=(Ni=Cn==null?void 0:Cn.standard_answer)==null?void 0:Ni.map((ur,Pi)=>pt.createElement("div",{key:Pi},`\u7B54\u6848\uFF08\u586B\u7A7A${(ur==null?void 0:ur.position)||(ur==null?void 0:ur.exercise_choice_id)}\uFF09\uFF1A${ur==null?void 0:ur.answer_text}`));return pt.createElement(pt.Fragment,null,pt.createElement("div",{className:Ut.analysis},pt.createElement("div",{style:{display:"flex"}},pt.createElement("div",null,"\u6B63\u786E\u7B54\u6848\uFF1A"),pt.createElement("div",null,Gr)),pt.createElement("aside",null,pt.createElement("span",{className:Ut.text},"\u89E3\u6790:"),pt.createElement(Ot.Z,{value:Cn.analysis?Cn.analysis:"\u6682\u65E0\u89E3\u6790"})),pt.createElement("ul",null,pt.createElement("li",null,pt.createElement("span",{style:{color:"#007AFF",marginRight:10}},"\u65B9\u5411&\u8BFE\u7A0B:"),`${(Cn==null?void 0:Cn.discipline_name)||"--"}/${Cn==null?void 0:Cn.sub_discipline_name}`),pt.createElement(Le.Z,{title:Cn==null?void 0:Cn.tag_discipline_name},pt.createElement("li",{style:{maxWidth:"400px",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}},pt.createElement("span",{style:{color:"#5AB891",marginRight:10}},"\u77E5\u8BC6\u70B9:"),Cn==null?void 0:Cn.tag_discipline_name)))))},Qs=(Cn,Ni)=>{var Gr;return pt.createElement("div",{className:Ut.analysis},pt.createElement("div",null,"\u6B63\u786E\u7B54\u6848\uFF1A",(Gr=Cn==null?void 0:Cn.answer_texts)==null?void 0:Gr[0]),pt.createElement("aside",null,pt.createElement("span",{className:Ut.text},"\u89E3\u6790:"),pt.createElement(Ot.Z,{value:Cn.analysis?Cn.analysis:"\u6682\u65E0\u89E3\u6790"})),pt.createElement("ul",null,pt.createElement("li",null,pt.createElement("span",{style:{color:"#007AFF",marginRight:10}},"\u65B9\u5411&\u8BFE\u7A0B:"),Ni?`${(Ni==null?void 0:Ni.discipline_name)||"--"}/${Ni==null?void 0:Ni.sub_discipline_name}`:`${(Cn==null?void 0:Cn.discipline_name)||"--"}/${Cn==null?void 0:Cn.sub_discipline_name}`),pt.createElement(Le.Z,{title:Ni?Ni==null?void 0:Ni.tag_discipline_name:Cn==null?void 0:Cn.tag_discipline_name},pt.createElement("li",{style:{maxWidth:"400px",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}},pt.createElement("span",{style:{color:"#5AB891",marginRight:10}},"\u77E5\u8BC6\u70B9:"),Ni?Ni==null?void 0:Ni.tag_discipline_name:Cn==null?void 0:Cn.tag_discipline_name))))},Ph=Cn=>{var Ni,Gr;return pt.createElement("div",{className:Ut.analysis},pt.createElement("aside",null,pt.createElement("span",{className:Ut.text},"\u9884\u671F\u8F93\u51FA:"),pt.createElement(Ot.Z,{value:(Ni=Cn==null?void 0:Cn.program_attr)==null?void 0:Ni.description})),pt.createElement("div",{style:{marginTop:20}},"\u6B63\u786E\u7B54\u6848\uFF1A",((Gr=Cn==null?void 0:Cn.program_attr)==null?void 0:Gr.answer_text)||"--"),pt.createElement("aside",null,pt.createElement("span",{className:Ut.text},"\u89E3\u6790:"),pt.createElement(Ot.Z,{value:Cn.analysis?Cn.analysis:"\u6682\u65E0\u89E3\u6790"})),pt.createElement("ul",null,pt.createElement("li",null,pt.createElement("span",{style:{color:"#007AFF",marginRight:10}},"\u65B9\u5411&\u8BFE\u7A0B:"),`${(Cn==null?void 0:Cn.discipline_name)||"--"}/${Cn==null?void 0:Cn.sub_discipline_name}`),pt.createElement(Le.Z,{title:Cn==null?void 0:Cn.tag_discipline_name},pt.createElement("li",{style:{maxWidth:"400px",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}},pt.createElement("span",{style:{color:"#5AB891",marginRight:10}},"\u77E5\u8BC6\u70B9:"),Cn==null?void 0:Cn.tag_discipline_name))))},Jl=(Cn,Ni)=>{var Gr;return pt.createElement("div",null,(Gr=Cn==null?void 0:Cn.sub_item_banks)==null?void 0:Gr.map((ur,Pi)=>{var Io,Co;const ia=[];return pt.createElement(pt.Fragment,null,pt.createElement("div",{style:{marginLeft:25,fontSize:"16px",color:"#333",paddingTop:"15px"}},Ni+1+"."+(Pi+1),"\uFF08",Js[ur.item_type]||Dl[ur.item_type],"\uFF09",ur.name),(ur.item_type=="SINGLE"||ur.item_type=="MULTIPLE"||ur.item_type=="JUDGMENT"||ur.item_type=="single"||ur.item_type=="multiple"||ur.item_type=="judgement")&&pt.createElement(pt.Fragment,null,pt.createElement("aside",{className:Ut.single},(Io=ur==null?void 0:ur.choices)==null?void 0:Io.map((Bo,us)=>(Bo.is_answer&&ia.push(sl.k4[us]),pt.createElement("ul",{key:us},pt.createElement("li",null,sl.k4[us],"\u3001"),pt.createElement("li",null,pt.createElement(Ot.Z,{value:Bo.choice_text})))))),pt.createElement("div",{className:Ut.analysis},pt.createElement("div",null,"\u6B63\u786E\u7B54\u6848\uFF1A",ia.join(""),pt.createElement("span",{className:"ml30"},"\u96BE\u5EA6\uFF1A",Xl[ur.difficulty])),pt.createElement("aside",null,pt.createElement("span",{className:Ut.text},"\u89E3\u6790:"),pt.createElement(Ot.Z,{value:ur.analysis?ur.analysis:"\u6682\u65E0\u89E3\u6790"})),pt.createElement("ul",null,pt.createElement("li",null,pt.createElement("span",{style:{color:"#007AFF",marginRight:10}},"\u65B9\u5411&\u8BFE\u7A0B:"),`${(Cn==null?void 0:Cn.discipline_name)||"--"}/${Cn==null?void 0:Cn.sub_discipline_name}`),pt.createElement(Le.Z,{title:Cn==null?void 0:Cn.tag_discipline_name},pt.createElement("li",{style:{maxWidth:"400px",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}},pt.createElement("span",{style:{color:"#5AB891",marginRight:10}},"\u77E5\u8BC6\u70B9:"),Cn==null?void 0:Cn.tag_discipline_name))))),(ur.item_type=="COMPLETION"||ur.item_type=="completion")&&vs(ur,Cn),(ur.item_type=="SUBJECTIVE"||ur.item_type=="subjective")&&Qs(ur,Cn),((Co=ae==null?void 0:ae.exam)==null?void 0:Co.exercise_status)===3&&pt.createElement("div",{className:"flex gap-20px mt20"},pt.createElement(Fu.Z,{state:ur==null?void 0:ur.is_wrong,onClick:()=>{Xr==null||Xr({value:Ro(ma({},ur),{question_id:ur==null?void 0:ur.id,question_score:ur==null?void 0:ur.score})})}}),ur.item_type=="single"&&pt.createElement(he.ZP,{style:{color:"#3061D0"},onClick:()=>{rf({value:ur})}},"\u589E\u8BBE\u6B63\u786E\u7B54\u6848")))}))},Mo=Cn=>{var Ni,Gr,ur;return pt.createElement("div",{style:{marginTop:"12px"}},(Gr=(Ni=Cn==null?void 0:Cn.shixun)==null?void 0:Ni.challenges)==null?void 0:Gr.map((Pi,Io)=>pt.createElement("div",{className:"c-grey-666 font14 mb10 ml25",style:{display:"flex",alignItems:"center",justifyContent:"space-between"}},pt.createElement("div",null,pt.createElement("span",{className:"mr5"},"\u7B2C",Io+1,"\u5173"),pt.createElement(Le.Z,{key:Io,title:Pi==null?void 0:Pi.challenge_name},pt.createElement("span",null,(0,Xt.Pq)(Pi==null?void 0:Pi.challenge_name,44)))),mr&&pt.createElement("div",null,"\u5206\u503C\uFF1A",Pi.score,"\u5206"))),pt.createElement($t.Link,{style:{float:"right"},target:"_blank",to:`/shixuns/${(ur=Cn==null?void 0:Cn.shixun)==null?void 0:ur.identifier}/challenges`},"\u5B9E\u8BAD\u8BE6\u60C5"),pt.createElement("div",{style:{clear:"both"}}))},Wo=Cn=>{let Ni=Cn.questions_score/Cn.questions_count;Dt.default.confirm({icon:null,centered:!0,title:"\u5206\u6570\u8BBE\u7F6E",content:pt.createElement("div",{className:Ut.modalColumn},pt.createElement("div",{className:Ut.modalRow,style:{justifyContent:"flex-start"}},pt.createElement("sup",{className:Ut.sup},"*"),pt.createElement("span",null,Cn==null?void 0:Cn.name,"\uFF1A"),pt.createElement(qt.Z,{min:0,precision:1,defaultValue:Ni,onChange:Gr=>{Ni=Gr}}),pt.createElement("span",{className:"ml5"},"\u5206/\u9898"))),okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",onOk:()=>wo(void 0,null,function*(){var Gr;if(!Ni)return me.ZP.warning("\u5206\u6570\u4E0D\u80FD\u4E3A\u7A7A\u6216\u4E3A0"),Promise.reject();const ur={type:Cn==null?void 0:Cn.type,score:Ni,scoreTotal:Number((Gr=Ni*Cn.questions_count)==null?void 0:Gr.toFixed(1))};zr(ur)})})},Ca=()=>{let Cn="";Dt.default.confirm({icon:null,centered:!0,title:"\u4FDD\u5B58\u8BD5\u5377",content:pt.createElement("div",{className:Ut.modalColumn},pt.createElement("div",{style:{color:"#676A6C",display:"flex",alignItems:"center"},className:"font14 mt20"},pt.createElement("img",{style:{marginRight:5},src:ln.Z}),"\u4FDD\u5B58\u540E\u5355\u72EC\u751F\u6210\u4E00\u4EFD\u4EBA\u5DE5\u7EC4\u5377\u7C7B\u578B\u7684\u56FA\u5B9A\u8BD5\u5377\u3002"),pt.createElement("div",{className:Ut.modalRow,style:{marginTop:20}},pt.createElement("sup",{className:Ut.sup},"*"),pt.createElement("span",{style:{flexShrink:0}},"\u8BD5\u5377\u540D\u79F0\uFF1A"),pt.createElement(ne.default,{placeholder:"\u8BF7\u8F93\u5165\u8BD5\u5377\u540D\u79F0",min:0,maxLength:60,defaultValue:Cn,onChange:Ni=>{Cn=Ni.target.value}}))),okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",onOk:()=>wo(void 0,null,function*(){var Ni;if(!Cn)return me.ZP.warning("\u8BD5\u5377\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A"),Promise.reject();const Gr=[],ur=[],Pi=[],Io=[];(Ni=ae==null?void 0:ae.questionList)==null||Ni.forEach(ia=>{var Bo;(Bo=ia.questions)==null||Bo.forEach(us=>{let Zo=ia.questions_score/ia.questions_count;Zo=Zo&&Zo.toFixed(1),ia.type==="COMBINATION"&&Pi.push({id:us.id,sub_item_bank_ids:us.sub_item_banks.map(Sl=>Sl.id)}),ia.type==="PRACTICAL"?Io.push(us.id):(Gr.push(us.id),ur.push(Zo))})}),console.log("-----",Pi),yield Re({item_bank_ids:Gr,item_bank_scores:ur,name:Cn,combination_item_banks:Pi,shixun_ids:Io})})})},rs=(Cn,Ni,Gr,ur)=>{var Pi;const Io=`${location.pathname}${location.search}`,Co=(Pi=ur.questions)==null?void 0:Pi.map(ia=>ia==null?void 0:ia.id);if(Io.includes("exercise"))$i.current={id:Cn,ids:Co,type:Ni,index:Gr},No(!0);else{let ia=Dt.default.confirm({icon:null,centered:!0,title:"\u6E29\u99A8\u63D0\u793A",content:"\u786E\u8BA4\u8981\u66F4\u6362\u8BE5\u8BD5\u9898\u5417\uFF1F",cancelButtonProps:{disabled:!1},maskClosable:!0,keyboard:!1,okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",onOk:()=>wo(void 0,null,function*(){ia.update({cancelButtonProps:{disabled:!0}}),yield Pr({single_question_id:Cn,seleted_item_bank_ids:Co},{type:Ni,index:Gr}),ia.update({cancelButtonProps:{disabled:!1}}),me.ZP.success("\u5DF2\u91CD\u65B0\u968F\u673A\u751F\u6210\u8BD5\u9898")})})}},$a=Cn=>{var Ni;const Gr=(Ni=Cn.questions)==null?void 0:Ni.map(Io=>Io==null?void 0:Io.id),ur=Cn.name;let Pi=Dt.default.confirm({icon:null,centered:!0,title:"\u6E29\u99A8\u63D0\u793A",content:`\u786E\u8BA4\u66F4\u6362${ur}\u4E2D\u7684\u6240\u6709\u8BD5\u9898\u5417\uFF1F`,cancelButtonProps:{disabled:!1},maskClosable:!1,keyboard:!1,okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",onOk:()=>wo(void 0,null,function*(){Pi.update({cancelButtonProps:{disabled:!0}}),yield Pr({seleted_item_bank_ids:Gr},{type:Cn.type}),Pi.update({cancelButtonProps:{disabled:!1}}),me.ZP.success(`\u5DF2\u91CD\u65B0\u968F\u673A\u751F\u6210${ur}\u8BD5\u9898`)})})},cu=()=>{let Cn=Dt.default.confirm({icon:null,centered:!0,title:"\u6E29\u99A8\u63D0\u793A",content:"\u786E\u8BA4\u66F4\u6362\u9884\u89C8\u4E2D\u7684\u6240\u6709\u8BD5\u9898\u5417\uFF1F",cancelButtonProps:{disabled:!1},maskClosable:!1,keyboard:!1,okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",onOk:()=>wo(void 0,null,function*(){Cn.update({cancelButtonProps:{disabled:!0}}),yield Pr(),Cn.update({cancelButtonProps:{disabled:!1}}),me.ZP.success("\u5DF2\u91CD\u65B0\u968F\u673A\u751F\u6210\u6574\u5F20\u8BD5\u9898")})})},ul=Cn=>{console.log(Cn,"key"),Fr(Cn-1)},fu=(Cn,Ni)=>{var Gr,ur;if(Ni==="SINGLE")return pt.createElement(pt.Fragment,null,pt.createElement(Vi,{ref:Sr,editData:Cn,isEdit:!0}),pt.createElement(jt.Z,null));if(Ni==="MULTIPLE")return pt.createElement(pt.Fragment,null,pt.createElement(pi,{ref:Sr,editData:Cn,isEdit:!0}),pt.createElement(jt.Z,null));if(Ni==="JUDGMENT")return pt.createElement(pt.Fragment,null,pt.createElement(Ve,{ref:Sr,editData:Cn,isEdit:!0}),pt.createElement(jt.Z,null));if(Ni==="COMPLETION")return pt.createElement(pt.Fragment,null,pt.createElement(Ee,{ref:Sr,editData:Cn,isEdit:!0}),pt.createElement(jt.Z,null));if(Ni==="SUBJECTIVE")return pt.createElement(pt.Fragment,null,pt.createElement(Mn,{ref:Sr,editData:Cn,isEdit:!0}),pt.createElement(jt.Z,null));if(Ni==="COMBINATION")return pt.createElement(pt.Fragment,null,pt.createElement(fo,{ref:Sr,editData:Cn,isEdit:!0}),pt.createElement(jt.Z,null));if(Ni==="BPROGRAM")return pt.createElement(pt.Fragment,null,pt.createElement(ue.default,{form:_a,style:{marginTop:20},onFinishFailed:Pi=>{var Io,Co;Pi.errorFields[0].name.includes("standard_answers")?me.ZP.error("\u586B\u7A7A\u9879\u7B54\u6848\u4E0D\u80FD\u4E3A\u7A7A"):me.ZP.error(Pi.errorFields[0].errors[0]),_a.scrollToField((Co=(Io=Pi==null?void 0:Pi.errorFields)==null?void 0:Io[0])==null?void 0:Co.name,{behavior:"smooth",block:"center"})},onFinish:Pi=>wo(void 0,null,function*(){var Io;let Co=Ro(ma({question_score:Cn.score},Pi),{question_type:8,hack:Ro(ma({},Pi.hack),{difficult:Cn.program_attr.difficult}),hack_codes:Ro(ma({},Pi.hack_codes),{code:hu.Base64.encode((Io=Pi.hack_codes)==null?void 0:Io.code)})});Oo&&(Co.is_cover=1);const ia=yield(0,Ht.ZP)(`/api/exercise_questions/${Cn.id}.json`,{method:"put",body:Co});(ia==null?void 0:ia.status)===0&&(me.ZP.success("\u7F16\u8F91\u6210\u529F"),ul(sr+1)),Qi(null)})},pt.createElement(Ul.tc,{form:_a,questionTitlePlaceholder:"\u8BF7\u7F16\u8F91\u9898\u5E72\u5E76\u8BBE\u7F6E\u586B\u7A7A\u9879",scoreByBlank:!1,hackidentifier:(Gr=Cn==null?void 0:Cn.program_attr)==null?void 0:Gr.identifier,answerKey:"standard_answers"}),pt.createElement(jt.Z,null)));if(Ni==="PROGRAM"&&$t.history.push(`/problems/${(ur=Cn==null?void 0:Cn.program_attr)==null?void 0:ur.identifier}/edit?type=exercises&express_id=${or.categoryId}&question_id=${Cn==null?void 0:Cn.id}&score=${Cn==null?void 0:Cn.score}&callback_url=${location.pathname}&select=${sr}&exercise=true`),Ni==="PRACTICAL")return pt.createElement(pt.Fragment,null,pt.createElement(ti,{ref:Sr,editData:Cn,isEdit:!0}),pt.createElement(jt.Z,null))},hl=(Cn,Ni)=>wo(void 0,null,function*(){var Gr,ur,Pi,Io,Co,ia;const Bo=yield(Gr=Sr.current)==null?void 0:Gr.onSave();if(!Bo)return;const us=Wr=>{const dl=Wr.map(Ha=>Ha.choice_text.trim().replace(/^\s+|\s+$/g,""));return new Set(dl).size!==dl.length},Zo={question_score:Ni.score,analysis:Bo.analysis};if(Cn==="SINGLE"||Cn==="MULTIPLE"||Cn==="JUDGMENT"){if(Cn!=="JUDGMENT"&&us(Bo==null?void 0:Bo.choices)){me.ZP.error("\u9009\u62E9\u9898\u9009\u9879\u5185\u5BB9\u4E0D\u80FD\u91CD\u590D\uFF0C\u8BF7\u4FEE\u6539\u540E\u518D\u4FDD\u5B58");return}const Wr=[],dl=[];Zo.question_type=Cn==="JUDGMENT"?2:1,Zo.question_title=Bo==null?void 0:Bo.name,(ur=Bo==null?void 0:Bo.choices)==null||ur.forEach((ys,Ha)=>{Wr.push(ys.choice_text),ys!=null&&ys.is_answer&&dl.push(Ha+1)}),Zo.question_choices=Wr,Zo.standard_answers=dl}if(Cn==="COMPLETION"){let Wr=(Pi=Bo==null?void 0:Bo.standard_answers)==null?void 0:Pi.map((Ha,Ql)=>(Ha==null?void 0:Ha.score)<=0?Ql+1:null).filter(Ha=>Ha!==null);if((Wr==null?void 0:Wr.length)>0)return me.ZP.warning(`\u7B2C${Wr.join("\u3001")}\u9879\u7684\u5206\u503C\u4E0D\u80FD\u4E3A\u7A7A`),!1;let dl=(Io=Bo==null?void 0:Bo.standard_answers)==null?void 0:Io.reduce((Ha,Ql)=>Ha+(Number(Ql==null?void 0:Ql.score)||0),0);if(parseFloat(dl.toFixed(2))!=(Zo==null?void 0:Zo.question_score))return me.ZP.warning("\u5404\u586B\u7A7A\u9879\u5206\u503C\u4E4B\u548C\u5FC5\u987B\u7B49\u4E8E\u8BE5\u5C0F\u9898\u5206\u503C\uFF01"),!1;Zo.is_ordered=Bo.is_ordered,Zo.question_title=Bo==null?void 0:Bo.name,Zo.use_blank_score=Bo==null?void 0:Bo.use_blank_score,Zo.question_type=3;const ys=[];(Co=Bo==null?void 0:Bo.standard_answers)==null||Co.forEach((Ha,Ql)=>{ys.push({choice_id:Ha.position,answer_text:Ha.answer_text,score:Ha.score})}),Zo.standard_answers=ys,Zo.downcase=Bo==null?void 0:Bo.downcase,Zo.no_space=Bo==null?void 0:Bo.no_space}if(Cn==="SUBJECTIVE"&&(console.log("editorData"),console.log(Bo),Zo.question_title=Bo==null?void 0:Bo.name,Zo.question_type=4,Zo.answer_texts=Bo==null?void 0:Bo.answer_texts,Zo.use_keywords=Bo==null?void 0:Bo.use_keywords,Zo.keywords=Bo==null?void 0:Bo.keywords),Cn==="COMBINATION"){Zo.question_title=Bo==null?void 0:Bo.name,Zo.question_type=7;try{Zo.sub_questions=(ia=Bo==null?void 0:Bo.sub_item_banks)==null?void 0:ia.map((Wr,dl)=>{var ys,Ha,Ql;if((Wr==null?void 0:Wr.item_type)=="single"||(Wr==null?void 0:Wr.item_type)=="multiple"){if(us(Wr==null?void 0:Wr.choices))throw new Error(`\u7B2C${dl+1}\u5C0F\u9898\u9009\u9879\u5185\u5BB9\u91CD\u590D\uFF0C\u8BF7\u4FEE\u6539\u540E\u518D\u4FDD\u5B58`);const Da=[],Wa=[];return(ys=Wr==null?void 0:Wr.choices)==null||ys.forEach(($s,Ss)=>{Da.push($s.choice_text),$s!=null&&$s.is_answer&&Wa.push(Ss+1)}),{id:Wr.id,question_id:Wr.id,question_title:Wr.name,difficulty:Wr.difficulty,question_type:(Wr==null?void 0:Wr.item_type)=="single"?0:(Wr==null?void 0:Wr.item_type)=="multiple"?1:2,question_choices:Da,standard_answers:Wa,analysis:Wr.analysis,question_score:Wr==null?void 0:Wr.score}}else if((Wr==null?void 0:Wr.item_type)=="completion"){let Da=(Ha=Wr==null?void 0:Wr.standard_answer)==null?void 0:Ha.reduce(($s,Ss)=>$s+(Number(Ss==null?void 0:Ss.score)||0),0);if(parseFloat(Da.toFixed(2))!=(Wr==null?void 0:Wr.score))throw new Error("\u5404\u586B\u7A7A\u9879\u5206\u503C\u4E4B\u548C\u5FC5\u987B\u7B49\u4E8E\u8BE5\u5C0F\u9898\u5206\u503C\uFF01");const Wa=[];return(Ql=Wr==null?void 0:Wr.standard_answer)==null||Ql.forEach(($s,Ss)=>{Wa.push({choice_id:$s.position,answer_text:$s.answer_text,score:$s.score})}),{id:Wr.id,question_id:Wr.id,is_ordered:Wr.is_ordered,question_title:Wr.name,difficulty:Wr.difficulty,question_type:3,standard_answers:Wa,use_blank_score:Wr.use_blank_score,analysis:Wr.analysis,downcase:Wr==null?void 0:Wr.downcase,no_space:Wr==null?void 0:Wr.no_space,question_score:Wr==null?void 0:Wr.score}}else if((Wr==null?void 0:Wr.item_type)=="subjective")return{id:Wr.id,question_id:Wr.id,question_title:Wr.name,question_type:4,difficulty:Wr.difficulty,answer_texts:Wr==null?void 0:Wr.answer_texts,analysis:Wr.analysis,question_score:Wr==null?void 0:Wr.score,use_keywords:Wr.use_keywords,keywords:Wr==null?void 0:Wr.keywords}})}catch(Wr){me.ZP.warning(Wr.message);return}delete Zo.analysis}let Sl=!1;(Ni==null?void 0:Ni.is_my)===1&&(Sl=yield new Promise((dl,ys)=>{Dt.default.confirm({title:"\u63D0\u793A",content:"\u6B64\u9898\u76EE\u5DF2\u5B58\u5728\u4E8E\u8BD5\u9898\u5E93\uFF0C\u662F\u5426\u5C06\u4FEE\u6539\u540E\u7684\u9898\u76EE\u8986\u76D6\u8BD5\u9898\u5E93\u7684\u539F\u9898\uFF1F",okText:"\u8986\u76D6\u539F\u9898",cancelText:"\u4E0D\u8986\u76D6",keyboard:!1,onOk:()=>{dl(!0)},onCancel:()=>{dl(!1)}})})),Sl&&(Zo.is_cover=1);const Jo=Cn!=="PRACTICAL"?yield(0,Ht.ZP)(`/api/exercise_questions/${Ni.id}.json`,{method:"put",body:Zo}):yield(0,Ht.ZP)(`/api/exercise_questions/${Ni.id}/update_shixun_score.json`,{method:"post",body:ma({},Bo)});(Jo==null?void 0:Jo.status)===0&&(me.ZP.success("\u7F16\u8F91\u6210\u529F"),ul(sr+1),Qi(null))}),Il=()=>wo(void 0,null,function*(){(0,$t.getDvaApp)()._store.dispatch({type:"globalSetting/setGlobalLoading",payload:{show:!0,text:"\u6B63\u5728\u66F4\u65B0\u8BD5\u5377\uFF0C\u8BF7\u7A0D\u540E..."}}),(yield(0,Ht.ZP)(`/api/exercises/${or.categoryId}/sync_random_question.json`,{method:"post"})).status===0&&(yield Fr(sr),me.ZP.success("\u66F4\u65B0\u6210\u529F")),(0,$t.getDvaApp)()._store.dispatch({type:"globalSetting/setGlobalLoading",payload:{show:!1}})}),rf=({value:Cn}={})=>{var Ni;const Gr=[];let ur=[];const Pi=(Ni=Cn==null?void 0:Cn.choices)==null?void 0:Ni.map((Co,ia)=>{var Bo;const us=ia+1;return Co!=null&&Co.is_answer&&(Gr.push(us),ur.push(us)),{value:us,label:pt.createElement(Ot.Z,{className:"c-black font14",value:`${(Bo=sl.k4)==null?void 0:Bo[ia]}. ${Co==null?void 0:Co.choice_text}`}),disabled:Co==null?void 0:Co.origin_standard_answer}}),Io=Dt.default.confirm({centered:!0,icon:null,title:"\u589E\u8BBE\u6B63\u786E\u7B54\u6848",width:800,content:pt.createElement(pt.Fragment,null,"\u5F53\u524D\u8BD5\u9898\u7684\u6B63\u786E\u7B54\u6848\u4E3A ",Gr==null?void 0:Gr.map(Co=>{var ia;return(ia=sl.k4)==null?void 0:ia[Co-1]}),"\uFF0C\u8BF7\u9009\u62E9\u9700\u8981\u589E\u8BBE\u4E3A\u6B63\u786E\u7B54\u6848\u7684\u9009\u9879\u3002",pt.createElement("br",null),"\u52FE\u9009\u63D0\u4EA4\u4E4B\u540E\uFF0C\u9009\u4E2D\u589E\u8BBE\u4E3A\u6B63\u786E\u7B54\u6848\u4EFB\u4E00\u9009\u9879\u7684\u5B66\u751F\u4E5F\u4F1A\u83B7\u5F97\u8BE5\u5C0F\u9898\u7684\u5206\u503C\uFF0C\u4F46\u4E0D\u4F1A\u4FEE\u6539\u5F53\u524D\u8BD5\u9898\u7684\u9898\u578B\u3002\u53D6\u6D88\u52FE\u9009\u63D0\u4EA4\u4E4B\u540E\uFF0C\u4E5F\u4F1A\u91CD\u65B0\u8BA1\u7B97\u5BF9\u5E94\u5B66\u751F\u7684\u5F97\u5206\u3002",pt.createElement("br",null),pt.createElement(Te.default.Group,{className:"flex-col mt20",options:Pi,defaultValue:ur,onChange:Co=>{ur=Co}})),onOk:()=>wo(void 0,null,function*(){const Co=yield(0,Ht.ZP)(`/api/exercises/${or.categoryId}/questions/${Cn==null?void 0:Cn.id}/add_standard_answers.json`,{method:"put",body:{standard_answer:ur}});(Co==null?void 0:Co.status)===0&&(me.ZP.success("\u4FEE\u6539\u6210\u529F"),ul(sr+1))})})},of=(Dr=ae==null?void 0:ae.questionList)==null?void 0:Dr.reduce((Cn,Ni)=>Cn+Number(Ni.questions_score),0),af=mr&&((Ki=ae==null?void 0:ae.exam)==null?void 0:Ki.exercise_status)!==1,sf=(Cn,Ni)=>wo(void 0,null,function*(){Yo(!0);const Gr=yield(0,Ht.ZP)(`/api/courses/${or==null?void 0:or.coursesId}/sync_shixuns.json`,{method:"post",body:{exercise_ids:[or==null?void 0:or.categoryId],exercise_question_id:Cn.id}});(Gr==null?void 0:Gr.status)===0&&(me.ZP.info("\u5B9E\u8BAD\u540C\u6B65\u4E2D\uFF0C\u8BF7\u7A0D\u540E"),la[Ni]=!1,ll([...la])),Yo(!1)}),Ta=(Cn,Ni)=>wo(void 0,null,function*(){let Gr=yield(0,Ht.ZP)(`/api/courses/${or==null?void 0:or.coursesId}/ignore_prompt.json`,{method:"post",body:{container_type:"Exercise",container_id:or==null?void 0:or.categoryId,exercise_question_id:Cn==null?void 0:Cn.id}});(Gr==null?void 0:Gr.status)===0&&(la[Ni]=!1,ll([...la]))});return pt.createElement("section",{className:Ut.wrap},pt.createElement("div",{id:"id_left_preview",className:Ut.left,onMouseEnter:Cn=>{const Ni=document.getElementById("id_left_preview");Ni.style.overflowY="auto"},onMouseLeave:Cn=>{const Ni=document.getElementById("id_left_preview");Ni.style.overflowY="hidden"}},pt.createElement("div",{className:Ut.title},pt.createElement("div",{className:"body-overflow-initial"},pt.createElement("b",null),pt.createElement("span",null,"\u7B54\u9898\u5361"))),pt.createElement("div",{className:Ut.total},pt.createElement("div",null,pt.createElement("img",{src:an}),pt.createElement("span",null,"\u9898\u6570(\u9053)"),pt.createElement("aside",null,ae==null?void 0:ae.all_questions_count)),pt.createElement("div",{className:"mr30 ml30"},pt.createElement("img",{src:sn}),pt.createElement("span",null,"\u603B\u5206(\u5206)"),pt.createElement("aside",null,of&&of.toFixed(1))),pt.createElement("div",null,pt.createElement("img",{src:Tt}),pt.createElement("span",null,"\u65F6\u957F(\u5206)"),pt.createElement("aside",null,((no=ae==null?void 0:ae.exam)==null?void 0:no.time)===-1||((Wi=ae==null?void 0:ae.exam)==null?void 0:Wi.time)===null?"\u4E0D\u9650":(ir=ae==null?void 0:ae.exam)==null?void 0:ir.time))),(Ji=ae==null?void 0:ae.questionList)==null?void 0:Ji.map((Cn,Ni)=>{var Gr;return pt.createElement("div",{className:Ut.list,key:Ni},pt.createElement("div",{className:Ut.name},pt.createElement("b",null),pt.createElement("span",null,Cn.name)),pt.createElement("aside",null,pt.createElement("div",null,"\u5171",pt.createElement("span",{className:Ut.b},Cn.questions_count),"\u9898 ",pt.createElement("span",{className:Ut.l},"|"),"\u5171",pt.createElement("span",{className:Ut.r},Cn.questions_score),"\u5206"),pt.createElement("div",{className:Ut.answerSheet},(Gr=Cn==null?void 0:Cn.questions)==null?void 0:Gr.map((ur,Pi)=>pt.createElement("div",{onClick:()=>{const Io=`Anchor_${ur==null?void 0:ur.id}`;let Co=document.getElementById(Io);Co&&setTimeout(()=>Co.scrollIntoView({block:"center",behavior:"smooth"}))},key:ur==null?void 0:ur.id,className:Ut.tag},Pi+1)))))})),pt.createElement("div",{className:Ut.right},pt.createElement("div",{className:Ut.examName,id:"examName"},pt.createElement("div",{className:Ut.name},pt.createElement(Le.Z,{title:(Mr=ae==null?void 0:ae.exam)==null?void 0:Mr.name,getPopupContainer:Cn=>Cn.parentNode},pt.createElement("span",{className:Ut.t},(Lr=ae==null?void 0:ae.exam)==null?void 0:Lr.name))),mr&&((Br=ae==null?void 0:ae.exam)==null?void 0:Br.exercise_status)===1&&pt.createElement(lo.op,{openLoading:!0,shape:"default",onClick:()=>{Dt.default.confirm({title:"\u63D0\u793A",content:"\u786E\u8BA4\u6839\u636E\u6700\u65B0\u7684\u968F\u673A\u7EC4\u5377\u62BD\u9898\u89C4\u5219\u91CD\u65B0\u751F\u6210\u8BD5\u5377\u5417\uFF1F",onOk:()=>{Il()}})},type:"primary"},"\u66F4\u65B0\u8BD5\u5377"),!mr&&pt.createElement(he.ZP,{onClick:cu,type:"primary"},"\u968F\u673A\u66F4\u6362")),pt.createElement("div",{className:Ut.topWarp},(io=ae==null?void 0:ae.questionList)==null?void 0:io.map((Cn,Ni)=>{var Gr,ur;return pt.createElement(pt.Fragment,{key:Ni},pt.createElement("div",{className:Ut.head,style:Ni===0?{border:0,marginTop:-16}:{}},pt.createElement("div",{className:Ut.name},pt.createElement("b",null),pt.createElement("span",null,Cn.name)),pt.createElement("div",{className:Ut.so},"\u5171",pt.createElement("span",{className:Ut.b},Cn.questions_count," "),"\u9898 ",Cn.type==="COMBINATION"&&`\uFF08\u5305\u542B${(Gr=Cn==null?void 0:Cn.questions)==null?void 0:Gr.map(Pi=>{var Io;return(Io=Pi==null?void 0:Pi.sub_item_banks)==null?void 0:Io.length}).reduce((Pi,Io)=>Pi+Io)}\u5C0F\u9898\uFF09`,pt.createElement("span",{className:Ut.l},"|"),"\u5171",pt.createElement("span",{className:Ut.r},Cn.questions_score),"\u5206"),!mr&&pt.createElement("div",{className:Ut.btn},pt.createElement(he.ZP,{onClick:()=>{Wo(Cn)},type:"primary",ghost:!0,className:"mr20"},"\u8BBE\u7F6E\u5F97\u5206"),pt.createElement(he.ZP,{onClick:()=>$a(Cn),type:"primary",ghost:!0},"\u968F\u673A\u66F4\u6362"))),(ur=Cn==null?void 0:Cn.questions)==null?void 0:ur.map((Pi,Io)=>{var Co,ia,Bo,us,Zo;return Li===(Pi==null?void 0:Pi.id)?pt.createElement("div",{id:`Anchor_${Pi==null?void 0:Pi.id}`,className:Ut.content,style:{padding:0,marginTop:24},key:Pi==null?void 0:Pi.id},pt.createElement("div",{style:{float:"right",marginTop:`${(Cn==null?void 0:Cn.type)==="PRACTICAL"?"-2px":"-6px"}`}},pt.createElement(he.ZP,{onClick:()=>Qi(null),className:"mr20",type:"primary",ghost:!0},"\u53D6\u6D88"),pt.createElement(he.ZP,{onClick:()=>{hl(Cn==null?void 0:Cn.type,Pi)},type:"primary"},"\u4FDD\u5B58")),fu(Pi,Cn.type)):pt.createElement("div",{id:`Anchor_${Pi==null?void 0:Pi.id}`,className:Ut.content,key:Pi==null?void 0:Pi.id},pt.createElement("div",{className:Ut.titleWrap},(Pi==null?void 0:Pi.item_type)==="bprogram"?pt.createElement(Ot.Z,{style:{paddingRight:10},value:Io+1+"\u3001"+((Co=Pi==null?void 0:Pi.program_attr)==null?void 0:Co.description)}):pt.createElement(Ot.Z,{style:{paddingRight:10},className:Ut.titleHtml,value:Io+1+`\u3001${(Pi==null?void 0:Pi.item_type)==="combination"?"\uFF08\u9898\u5E72\uFF09":""}`+(Pi==null?void 0:Pi.name)}),(0,ju.G5)()&&((ia=Pi==null?void 0:Pi.shixun)==null?void 0:ia.shixun_change)&&pt.createElement(se.Z,{trigger:"click",open:la[Io],onOpenChange:Sl=>{la[Io]=!0,ll([...la])},placement:"bottomLeft",autoAdjustOverflow:!1,title:null,content:pt.createElement("div",{style:{width:"310px",color:"#000"}},pt.createElement("div",null,"\u5B9E\u8BAD\u7BA1\u7406\u5458\u5BF9\u8BD5\u5377\u4E2D\u4F7F\u7528\u7684\u5B9E\u8DF5\u9879\u76EE\u8FDB\u884C\u4E86\u4FEE\u6539\uFF0C\u8BF7\u68C0\u67E5\u540E\uFF0C\u786E\u8BA4\u662F\u5426\u9700\u8981\u540C\u6B65\u5230\u8BD5\u5377\u4E2D"),pt.createElement("div",{className:Ut.btn_warp},pt.createElement(he.ZP,{size:"small",onClick:()=>Ta(Pi,Io)},"\u5FFD\u7565"),pt.createElement(he.ZP,{loading:ea,className:"ml20",size:"small",type:"primary",onClick:()=>sf(Pi,Io)},"\u786E\u8BA4\u540C\u6B65"),pt.createElement(he.ZP,{className:"ml20",size:"small",type:"primary",onClick:()=>(0,Xt.xg)(`/shixuns/${Pi==null?void 0:Pi.forked_shixun_identifier}/challenges?exercise=true`)},"\u524D\u5F80\u67E5\u770B")))},pt.createElement("i",{className:"iconfont icon-tongzhi1 pl10 current",style:{fontSize:"16px",color:"#F7B500"},onClick:Sl=>Sl.stopPropagation()})),mr&&pt.createElement(he.ZP,{onClick:()=>{var Sl,Jo,Wr;if(Li){me.ZP.warning("\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u8BD5\u9898");return}_a.setFieldsValue({standard_answers:Pi==null?void 0:Pi.standard_answer,hack:ma(ma({},Pi),Pi==null?void 0:Pi.program_attr),hack_codes:Ro(ma({},Pi==null?void 0:Pi.program_attr),{code:hu.Base64.decode(((Sl=Pi==null?void 0:Pi.program_attr)==null?void 0:Sl.code)||"")}),hack_sets:ma({},(Jo=Pi==null?void 0:Pi.hack_sets)==null?void 0:Jo[0])}),(Pi==null?void 0:Pi.item_type)=="program"?$t.history.push(`/problems/newedit/${(Wr=Pi==null?void 0:Pi.program_attr)==null?void 0:Wr.identifier}?type=exercises&express_id=${or.categoryId}&question_id=${Pi==null?void 0:Pi.id}&score=${Pi==null?void 0:Pi.score}&exercise=true&callback_url=/classrooms/${or.coursesId}/exercise/${or.categoryId}/detail?random=true`):Qi(Pi==null?void 0:Pi.id)},type:"primary",style:{marginLeft:"auto"},ghost:!0},"\u7F16\u8F91"),!af&&pt.createElement(he.ZP,{disabled:af,className:"ml20",onClick:()=>rs(Pi==null?void 0:Pi.id,Cn.type,Io,Cn),type:"primary",ghost:!0},"\u6362\u4E00\u9898")),(Pi==null?void 0:Pi.item_type)==="bprogram"&&pt.createElement(Ot.Z,{style:{paddingRight:10,paddingLeft:25},showProgramFill:!0,disabledFill:!0,className:Ut.titleHtml,value:hu.Base64.decode(((Bo=Pi==null?void 0:Pi.program_attr)==null?void 0:Bo.code)||"")}),(Cn.type==="SINGLE"||Cn.type==="JUDGMENT"||Cn.type==="MULTIPLE")&&jo(Pi),Cn.type==="COMPLETION"&&vs(Pi),Cn.type==="SUBJECTIVE"&&Qs(Pi),Cn.type==="PROGRAM"&&Ph(Pi),Cn.type==="BPROGRAM"&&Ol(Pi),Cn.type==="COMBINATION"&&Jl(Pi,Io),Cn.type==="PRACTICAL"&&Mo(Pi),pt.createElement(Ce.Z,{className:"mt20",wrap:!1,align:"middle",gutter:20},((us=ae==null?void 0:ae.exam)==null?void 0:us.exercise_status)===3&&!["PROGRAM","BPROGRAM","PRACTICAL","COMBINATION"].includes(Cn.type)&&pt.createElement(Bt.Z,null,pt.createElement(Fu.Z,{state:Pi==null?void 0:Pi.is_wrong,onClick:()=>{Xr==null||Xr({value:Ro(ma({},Pi),{question_id:Pi==null?void 0:Pi.id,question_score:Pi==null?void 0:Pi.score})})}})),["PROGRAM","BPROGRAM","PRACTICAL"].includes(Cn.type)&&(Pi==null?void 0:Pi.show_resubmit)&&pt.createElement(Bt.Z,null,pt.createElement(wa.C,{dataSource:Ro(ma({},Pi),{question_id:Pi==null?void 0:Pi.id})})),((Zo=ae==null?void 0:ae.exam)==null?void 0:Zo.exercise_status)===3&&["SINGLE"].includes(Cn.type)&&pt.createElement(Bt.Z,null,pt.createElement(he.ZP,{style:{color:"#3061D0"},onClick:()=>{rf({value:Pi})}},"\u589E\u8BBE\u6B63\u786E\u7B54\u6848"))))}))}))),mr?pt.createElement(lo.vr,null,pt.createElement(nt.Z,{showTotal:Xt.rU,total:(Zi=ae==null?void 0:ae.exam)==null?void 0:Zi.total_num,pageSize:1,current:sr+1,showSizeChanger:!1,onChange:ul,showQuickJumper:!1,hideOnSinglePage:!1})):pt.createElement(lo.vr,{LeftContent:pt.createElement(lo.op,{onClick:_t,shape:"default",style:{height:38,background:"#fff",boxShadow:"none"}},"\u8FD4\u56DE"),RightContent:pt.createElement(Ce.Z,{align:"middle"},pt.createElement(se.Z,{color:"#55575D",overlayClassName:Ut.popover,open:wr,getPopupContainer:Cn=>Cn==null?void 0:Cn.parentNode,content:"\u5982\u60A8\u5BF9\u6B64\u4EFD\u8BD5\u9898\u6EE1\u610F\uFF0C\u53EF\u5C06\u6B64\u4EFD\u8BD5\u9898\u4FDD\u5B58\u4E3A\u56FA\u5B9A\u8BD5\u5377"},pt.createElement(lo.op,{onMouseEnter:()=>ro(!0),onMouseLeave:()=>ro(!1),onClick:()=>Ca(),shape:"default",style:{height:38,background:"#fff",boxShadow:"none"}},"\u4FDD\u5B58")),pt.createElement(lo.op,{shape:"default",type:"primary",onClick:()=>Re(),style:{height:38,marginLeft:20}},"\u63D0\u4EA4"))}),pt.createElement(Gs,{visible:So,questionParams:$i.current,getdata:po,onRandomExchange:()=>wo(void 0,null,function*(){const Cn=$i.current;yield Pr({single_question_id:Cn.id,seleted_item_bank_ids:Cn.ids},{type:Cn.type,index:Cn.index}),No(!1)}),selectFromProblemSet:()=>{const Cn=$i.current,Ni=`${location.pathname}${location.search}`;Ni.includes("exercise")&&$t.history.push(`/paperlibrary/exchangequestion?type=exercise&qid=${Cn.id}&qtype=${Cn.type}&exerciseid=${or.categoryId}&from=${Ni}`)},onCancel:()=>{No(!1)}}))}},23129:function(Bn,zn,kt){"use strict";kt.r(zn),kt.d(zn,{default:function(){return st}});var pt=kt(59301),Ut=kt(25690),ue={flex_box_center:"flex_box_center___kQBcj",flex_space_between:"flex_space_between___Znlbo",flex_box_vertical_center:"flex_box_vertical_center___CPD50",flex_box_center_end:"flex_box_center_end___jzPvK",flex_box_column:"flex_box_column___cvIBS",wrap:"wrap___lab8O",crumbs:"crumbs___qvTza"},Le=kt(43554),he=kt(6767),Dt=kt(458),qt=kt(38986),me=kt(51257),ne=kt(59301),jt=Object.defineProperty,Te=Object.getOwnPropertySymbols,se=Object.prototype.hasOwnProperty,Ce=Object.prototype.propertyIsEnumerable,Bt=(gt,vt,St)=>vt in gt?jt(gt,vt,{enumerable:!0,configurable:!0,writable:!0,value:St}):gt[vt]=St,nt=(gt,vt)=>{for(var St in vt||(vt={}))se.call(vt,St)&&Bt(gt,St,vt[St]);if(Te)for(var St of Te(vt))Ce.call(vt,St)&&Bt(gt,St,vt[St]);return gt},et=(gt,vt,St)=>new Promise((Et,Tt)=>{var Ot=Ht=>{try{Xt(St.next(Ht))}catch(ve){Tt(ve)}},$t=Ht=>{try{Xt(St.throw(Ht))}catch(ve){Tt(ve)}},Xt=Ht=>Ht.done?Et(Ht.value):Promise.resolve(Ht.value).then(Ot,$t);Xt((St=St.apply(gt,vt)).next())});const ht=({paperlibrary:gt,user:vt,globalSetting:St,dispatch:Et,location:Tt})=>{var Ot,$t,Xt,Ht;const[ve]=(0,Ut.useSearchParams)(),ie=ve.get("select")||0,[Ne,xe]=(0,pt.useState)(!1),[Pe,Qe]=(0,pt.useState)(!0),[_e,an]=(0,pt.useState)(Number(ie)),[Ke,re]=(0,pt.useState)({}),Jt=(0,Ut.useParams)(),{userInfo:Ye}=vt,{actionTabs:Gn}=gt;(0,pt.useEffect)(()=>(Et({type:"globalSetting/footerToggle",payload:!1}),()=>{Et({type:"globalSetting/footerToggle",payload:!0})}),[]),(0,pt.useEffect)(()=>(Et({type:"globalSetting/onlyShowBackTopToggle",payload:!1}),Et({type:"globalSetting/onlyShowBackTopIconToggle",payload:!1}),Et({type:"exercise/getWorkSetting",payload:nt({},Jt)}),()=>{Et({type:"globalSetting/onlyShowBackTopToggle",payload:!0}),Et({type:"globalSetting/onlyShowBackTopIconToggle",payload:!0})}),[]),(0,pt.useEffect)(()=>{dn(_e)},[]),(0,pt.useEffect)(()=>{var yn;(yn=Gn==null?void 0:Gn.params)!=null&&yn.isUpdateData&&dn(_e)},[(Ot=Gn==null?void 0:Gn.params)==null?void 0:Ot.isUpdateData]);const dn=(yn=0)=>et(void 0,null,function*(){console.log(Jt),Qe(!0);const te=yield(0,qt.ZP)(`/api/exercises/${Jt.categoryId}/preview_random_exercise.json`,{method:"get",params:{num:yn}});Et({type:"paperlibrary/setActionTabs",payload:{params:{isUpdateData:!1}}}),Qe(!1),re((0,me.PF)(te))}),Oe=()=>{Ut.history.push(`/classrooms/${Jt.coursesId}/exercise`)},sn=()=>{alert("\u4FDD\u5B58")},ln=(yn,te)=>et(void 0,null,function*(){const En=yield(0,qt.ZP)(`/api/exercises/${Jt.categoryId}/toggle_random_question.json`,{method:"post",body:{question_id:yn==null?void 0:yn.single_question_id}});En!=null&&En.question&&(he.ZP.info("\u6362\u9898\u6210\u529F"),dn(_e))}),Vn=yn=>et(void 0,null,function*(){document.body.scrollIntoView(),an(yn),yield dn(yn)}),Ae=yn=>{Et({type:"exercise/setActionTabs",payload:{key:"\u6807\u8BB0\u9519\u9898",params:yn}})};return console.log((0,Ut.useLocation)(),"location333"),ne.createElement("section",{className:ue.wrap},ne.createElement(Dt.Z,{loading:Pe,active:!0,paragraph:{rows:5}},((Xt=($t=(0,Ut.useLocation)())==null?void 0:$t.pathname)==null?void 0:Xt.includes("preview"))&&ne.createElement("div",{className:ue.crumbs},ne.createElement("b",null),ne.createElement("span",{className:"current",onClick:()=>Ut.history.push(`/classrooms/${Jt.coursesId}/exercise`)},`${(Ht=Ye==null?void 0:Ye.course)==null?void 0:Ht.course_name}>`),ne.createElement("span",{className:"current",onClick:()=>Ut.history.push(`/classrooms/${Jt.coursesId}/exercise`)},"\u8BD5\u5377\u5217\u8868>"),ne.createElement("span",{style:{color:"#bebebe"}},"\u9884\u89C8")),ne.createElement(Le.Z,{loading:Ne,submit:sn,goBack:Oe,data:Ke,getdata:()=>{dn(_e)},selectValue:_e,editPreview:!0,onExchange:ln,onSkipExamination:Vn,handleMarkWrongQuestion:Ae})))};var st=(0,Ut.connect)(({paperlibrary:gt,user:vt,globalSetting:St})=>({paperlibrary:gt,user:vt,globalSetting:St}))(ht)},58433:function(Bn,zn,kt){"use strict";kt.d(zn,{g:function(){return he}});var pt=kt(59301),Ut=kt(93629),ue=kt(55305),Le=(Dt,qt,me)=>new Promise((ne,jt)=>{var Te=Bt=>{try{Ce(me.next(Bt))}catch(nt){jt(nt)}},se=Bt=>{try{Ce(me.throw(Bt))}catch(nt){jt(nt)}},Ce=Bt=>Bt.done?ne(Bt.value):Promise.resolve(Bt.value).then(Te,se);Ce((me=me.apply(Dt,qt)).next())});const he=()=>{const[Dt,qt]=(0,pt.useState)([]);return(0,pt.useEffect)(()=>{Le(void 0,null,function*(){const ne=yield(0,Ut.d1)({source:"question"});ne!=null&&ne.disciplines&&qt((0,ue.L)(ne==null?void 0:ne.disciplines))})},[]),Dt}},45937:function(Bn,zn,kt){"use strict";kt.d(zn,{U:function(){return ne}});var pt=kt(59301),Ut=Object.defineProperty,ue=Object.getOwnPropertySymbols,Le=Object.prototype.hasOwnProperty,he=Object.prototype.propertyIsEnumerable,Dt=(jt,Te,se)=>Te in jt?Ut(jt,Te,{enumerable:!0,configurable:!0,writable:!0,value:se}):jt[Te]=se,qt=(jt,Te)=>{for(var se in Te||(Te={}))Le.call(Te,se)&&Dt(jt,se,Te[se]);if(ue)for(var se of ue(Te))he.call(Te,se)&&Dt(jt,se,Te[se]);return jt},me=(jt,Te,se)=>new Promise((Ce,Bt)=>{var nt=st=>{try{ht(se.next(st))}catch(gt){Bt(gt)}},et=st=>{try{ht(se.throw(st))}catch(gt){Bt(gt)}},ht=st=>st.done?Ce(st.value):Promise.resolve(st.value).then(nt,et);ht((se=se.apply(jt,Te)).next())});function ne(jt,Te){const[se,Ce]=(0,pt.useState)(Te),[Bt,nt]=(0,pt.useState)(!1),[et,ht]=(0,pt.useState)();return[se,Bt,(gt,vt=!1)=>me(this,null,function*(){const St=vt?Te:qt(qt({},se),gt);nt(!0),Ce(St);const Et=yield jt(St);return nt(!1),ht(Et),Et}),et,ht]}},81428:function(Bn,zn,kt){"use strict";kt.d(zn,{AL:function(){return St},Iy:function(){return Te},Qv:function(){return Bt},ez:function(){return vt},jb:function(){return se}});var pt=kt(32834),Ut=kt.n(pt),ue=kt(11690),Le=kt.n(ue);let he=1;function Dt(Xt,Ht){const ve=Xt.match(/^(\s+)(?:```)/);if(ve===null)return Ht;const ie=ve[1];return Ht.split(`
|
|
`).map(Ne=>{const xe=Ne.match(/^\s+/);if(xe===null)return Ne;const[Pe]=xe;return Pe.length>=ie.length?Ne.slice(ie.length):Ne}).join(`
|
|
`)}let qt=[],me=["<ul>"];const ne=new(Ut()).Renderer,jt=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function Te(){qt.length=0,me=["<ul>"]}const se={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function Ce(Xt,Ht,ve,ie){if(Ht>=Xt.length||Xt[Ht].level<=ve)return Ht;var Ne=Xt[Ht];ie.push("<li><a href='#"+he+Ne.anchor+"'>"+Ne.text+"</a>"),Ht++;var xe=[];return Ht=Ce(Xt,Ht,Ne.level,xe),xe.length>0&&(ie.push("<ul>"),xe.forEach(function(Pe){ie.push(Pe)}),ie.push("</ul>")),ie.push("</li>"),Ht=Ce(Xt,Ht,ve,ie),Ht}function Bt(){return Ce(qt,0,0,me),me.push("</ul>"),me.join("")}const nt={heading(Xt){const Ht=jt.exec(Xt);if(he+=1,Ht)return{type:"heading",raw:Ht[0],depth:Ht[1].length,text:Ht[2]}},fences(Xt){const Ht=this.rules.block.fences.exec(Xt);if(Ht){const ve=Ht[0];let ie=Dt(ve,Ht[3]||"");const Ne=Ht[2]?Ht[2].trim():Ht[2];if(["latex","katex","math"].indexOf(Ne)>=0){const xe=st(),Pe=ie;ie=xe,gt[xe]={type:"block",expression:Pe}}return{type:"code",raw:ve,lang:Ne,text:ie}}}},et=/(?:\${2})([^\n`]+?)(?:\${2})/gi;let ht=0;const st=()=>`__special_katext_id_${ht++}__`;let gt={};function vt(){return gt}function St(){ht=0,gt={}}function Et(Xt){return Xt=Xt.replace(et,(Ht,ve)=>{const ie=st();return gt[ie]={type:"inline",expression:ve},ie}),Xt}const Tt=ne.listitem;ne.listitem=function(Xt){return Tt(Et(Xt))};const Ot=ne.paragraph;ne.paragraph=function(Xt){return Ot(Et(Xt))};const $t=ne.tablecell;ne.tablecell=function(Xt,Ht){return $t(Et(Xt),Ht)},ne.code=function(Xt,Ht,ve){const ie=(Ht||"").match(/\S*/)[0];return ie?["latex","katex","math"].indexOf(ie)>=0?`<p class='editormd-tex'>${Xt}</p>`:`<pre class="prettyprint linenums"><code class="language-${Ht}">${ve?Xt:(0,ue.escape)(Xt,!0)}</code></pre>
|
|
`:'<pre class="prettyprint linenums"><code>'+(ve?Xt:(0,ue.escape)(Xt,!0))+"</code></pre>"},ne.heading=function(Xt,Ht,ve){let ie=this.options.headerPrefix+ve.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return qt.push({anchor:ie,level:Ht,text:Xt}),"<h"+Ht+' id="'+he+ie+'">'+Xt+"</h"+Ht+">"},Ut().setOptions({silent:!0,gfm:!0,pedantic:!1}),Ut().use({tokenizer:nt,renderer:ne}),zn.ZP=Ut()},99498:function(Bn,zn,kt){(function(pt){pt(kt(89780))})(function(pt){pt.defineOption("placeholder","",function(me,ne,jt){var Te=jt&&jt!=pt.Init;if(ne&&!Te)me.on("blur",he),me.on("change",Dt),me.on("swapDoc",Dt),pt.on(me.getInputField(),"compositionupdate",me.state.placeholderCompose=function(){Le(me)}),Dt(me);else if(!ne&&Te){me.off("blur",he),me.off("change",Dt),me.off("swapDoc",Dt),pt.off(me.getInputField(),"compositionupdate",me.state.placeholderCompose),Ut(me);var se=me.getWrapperElement();se.className=se.className.replace(" CodeMirror-empty","")}ne&&!me.hasFocus()&&he(me)});function Ut(me){me.state.placeholder&&(me.state.placeholder.parentNode.removeChild(me.state.placeholder),me.state.placeholder=null)}function ue(me){Ut(me);var ne=me.state.placeholder=document.createElement("pre");ne.style.cssText="height: 0; overflow: visible",ne.style.direction=me.getOption("direction"),ne.className="CodeMirror-placeholder CodeMirror-line-like";var jt=me.getOption("placeholder");typeof jt=="string"&&(jt=document.createTextNode(jt)),ne.appendChild(jt),me.display.lineSpace.insertBefore(ne,me.display.lineSpace.firstChild)}function Le(me){setTimeout(function(){var ne=!1,jt=me.getInputField();jt.nodeName=="TEXTAREA"?ne=!jt.value:me.lineCount()==1&&(ne=!/[^\u200b]/.test(jt.querySelector(".CodeMirror-line").textContent)),ne?ue(me):Ut(me)},20)}function he(me){qt(me)&&ue(me)}function Dt(me){var ne=me.getWrapperElement(),jt=qt(me);ne.className=ne.className.replace(" CodeMirror-empty","")+(jt?" CodeMirror-empty":""),jt?ue(me):Ut(me)}function qt(me){return me.lineCount()===1&&me.getLine(0)===""}})},25717:function(Bn,zn,kt){(function(pt){pt(kt(89780))})(function(pt){var Ut={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},ue=pt.Pos;pt.defineOption("autoCloseBrackets",!1,function(nt,et,ht){ht&&ht!=pt.Init&&(nt.removeKeyMap(he),nt.state.closeBrackets=null),et&&(Dt(Le(et,"pairs")),nt.state.closeBrackets=et,nt.addKeyMap(he))});function Le(nt,et){return et=="pairs"&&typeof nt=="string"?nt:typeof nt=="object"&&nt[et]!=null?nt[et]:Ut[et]}var he={Backspace:ne,Enter:jt};function Dt(nt){for(var et=0;et<nt.length;et++){var ht=nt.charAt(et),st="'"+ht+"'";he[st]||(he[st]=qt(ht))}}Dt(Ut.pairs+"`");function qt(nt){return function(et){return se(et,nt)}}function me(nt){var et=nt.state.closeBrackets;if(!et||et.override)return et;var ht=nt.getModeAt(nt.getCursor());return ht.closeBrackets||et}function ne(nt){var et=me(nt);if(!et||nt.getOption("disableInput"))return pt.Pass;for(var ht=Le(et,"pairs"),st=nt.listSelections(),gt=0;gt<st.length;gt++){if(!st[gt].empty())return pt.Pass;var vt=Ce(nt,st[gt].head);if(!vt||ht.indexOf(vt)%2!=0)return pt.Pass}for(var gt=st.length-1;gt>=0;gt--){var St=st[gt].head;nt.replaceRange("",ue(St.line,St.ch-1),ue(St.line,St.ch+1),"+delete")}}function jt(nt){var et=me(nt),ht=et&&Le(et,"explode");if(!ht||nt.getOption("disableInput"))return pt.Pass;for(var st=nt.listSelections(),gt=0;gt<st.length;gt++){if(!st[gt].empty())return pt.Pass;var vt=Ce(nt,st[gt].head);if(!vt||ht.indexOf(vt)%2!=0)return pt.Pass}nt.operation(function(){var St=nt.lineSeparator()||`
|
|
`;nt.replaceSelection(St+St,null),nt.execCommand("goCharLeft"),st=nt.listSelections();for(var Et=0;Et<st.length;Et++){var Tt=st[Et].head.line;nt.indentLine(Tt,null,!0),nt.indentLine(Tt+1,null,!0)}})}function Te(nt){var et=pt.cmpPos(nt.anchor,nt.head)>0;return{anchor:new ue(nt.anchor.line,nt.anchor.ch+(et?-1:1)),head:new ue(nt.head.line,nt.head.ch+(et?1:-1))}}function se(nt,et){var ht=me(nt);if(!ht||nt.getOption("disableInput"))return pt.Pass;var st=Le(ht,"pairs"),gt=st.indexOf(et);if(gt==-1)return pt.Pass;for(var vt=Le(ht,"closeBefore"),St=Le(ht,"triples"),Et=st.charAt(gt+1)==et,Tt=nt.listSelections(),Ot=gt%2==0,$t,Xt=0;Xt<Tt.length;Xt++){var Ht=Tt[Xt],ve=Ht.head,ie,Ne=nt.getRange(ve,ue(ve.line,ve.ch+1));if(Ot&&!Ht.empty())ie="surround";else if((Et||!Ot)&&Ne==et)Et&&Bt(nt,ve)?ie="both":St.indexOf(et)>=0&&nt.getRange(ve,ue(ve.line,ve.ch+3))==et+et+et?ie="skipThree":ie="skip";else if(Et&&ve.ch>1&&St.indexOf(et)>=0&&nt.getRange(ue(ve.line,ve.ch-2),ve)==et+et){if(ve.ch>2&&/\bstring/.test(nt.getTokenTypeAt(ue(ve.line,ve.ch-2))))return pt.Pass;ie="addFour"}else if(Et){var xe=ve.ch==0?" ":nt.getRange(ue(ve.line,ve.ch-1),ve);if(!pt.isWordChar(Ne)&&xe!=et&&!pt.isWordChar(xe))ie="both";else return pt.Pass}else if(Ot&&(Ne.length===0||/\s/.test(Ne)||vt.indexOf(Ne)>-1))ie="both";else return pt.Pass;if(!$t)$t=ie;else if($t!=ie)return pt.Pass}var Pe=gt%2?st.charAt(gt-1):et,Qe=gt%2?et:st.charAt(gt+1);nt.operation(function(){if($t=="skip")nt.execCommand("goCharRight");else if($t=="skipThree")for(var _e=0;_e<3;_e++)nt.execCommand("goCharRight");else if($t=="surround"){for(var an=nt.getSelections(),_e=0;_e<an.length;_e++)an[_e]=Pe+an[_e]+Qe;nt.replaceSelections(an,"around"),an=nt.listSelections().slice();for(var _e=0;_e<an.length;_e++)an[_e]=Te(an[_e]);nt.setSelections(an)}else $t=="both"?(nt.replaceSelection(Pe+Qe,null),nt.triggerElectric(Pe+Qe),nt.execCommand("goCharLeft")):$t=="addFour"&&(nt.replaceSelection(Pe+Pe+Pe+Pe,"before"),nt.execCommand("goCharRight"))})}function Ce(nt,et){var ht=nt.getRange(ue(et.line,et.ch-1),ue(et.line,et.ch+1));return ht.length==2?ht:null}function Bt(nt,et){var ht=nt.getTokenAt(ue(et.line,et.ch+1));return/\bstring/.test(ht.type)&&ht.start==et.ch&&(et.ch==0||!/\bstring/.test(nt.getTokenTypeAt(et)))}})},6313:function(Bn,zn,kt){(function(pt){pt(kt(89780),kt(32855))})(function(pt){pt.defineOption("autoCloseTags",!1,function(ne,jt,Te){if(Te!=pt.Init&&Te&&ne.removeKeyMap("autoCloseTags"),!!jt){var se={name:"autoCloseTags"};(typeof jt!="object"||jt.whenClosing!==!1)&&(se["'/'"]=function(Ce){return Dt(Ce)}),(typeof jt!="object"||jt.whenOpening!==!1)&&(se["'>'"]=function(Ce){return Le(Ce)}),ne.addKeyMap(se)}});var Ut=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],ue=["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 Le(ne){if(ne.getOption("disableInput"))return pt.Pass;for(var jt=ne.listSelections(),Te=[],se=ne.getOption("autoCloseTags"),Ce=0;Ce<jt.length;Ce++){if(!jt[Ce].empty())return pt.Pass;var Bt=jt[Ce].head,nt=ne.getTokenAt(Bt),et=pt.innerMode(ne.getMode(),nt.state),ht=et.state,st=et.mode.xmlCurrentTag&&et.mode.xmlCurrentTag(ht),gt=st&&st.name;if(!gt)return pt.Pass;var vt=et.mode.configuration=="html",St=typeof se=="object"&&se.dontCloseTags||vt&&Ut,Et=typeof se=="object"&&se.indentTags||vt&&ue;nt.end>Bt.ch&&(gt=gt.slice(0,gt.length-nt.end+Bt.ch));var Tt=gt.toLowerCase();if(!gt||nt.type=="string"&&(nt.end!=Bt.ch||!/[\"\']/.test(nt.string.charAt(nt.string.length-1))||nt.string.length==1)||nt.type=="tag"&&st.close||nt.string.indexOf("/")==Bt.ch-nt.start-1||St&&qt(St,Tt)>-1||me(ne,et.mode.xmlCurrentContext&&et.mode.xmlCurrentContext(ht)||[],gt,Bt,!0))return pt.Pass;var Ot=typeof se=="object"&&se.emptyTags;if(Ot&&qt(Ot,gt)>-1){Te[Ce]={text:"/>",newPos:pt.Pos(Bt.line,Bt.ch+2)};continue}var $t=Et&&qt(Et,Tt)>-1;Te[Ce]={indent:$t,text:">"+($t?`
|
|
|
|
`:"")+"</"+gt+">",newPos:$t?pt.Pos(Bt.line+1,0):pt.Pos(Bt.line,Bt.ch+1)}}for(var Xt=typeof se=="object"&&se.dontIndentOnAutoClose,Ce=jt.length-1;Ce>=0;Ce--){var Ht=Te[Ce];ne.replaceRange(Ht.text,jt[Ce].head,jt[Ce].anchor,"+insert");var ve=ne.listSelections().slice(0);ve[Ce]={head:Ht.newPos,anchor:Ht.newPos},ne.setSelections(ve),!Xt&&Ht.indent&&(ne.indentLine(Ht.newPos.line,null,!0),ne.indentLine(Ht.newPos.line+1,null,!0))}}function he(ne,jt){for(var Te=ne.listSelections(),se=[],Ce=jt?"/":"</",Bt=ne.getOption("autoCloseTags"),nt=typeof Bt=="object"&&Bt.dontIndentOnSlash,et=0;et<Te.length;et++){if(!Te[et].empty())return pt.Pass;var ht=Te[et].head,st=ne.getTokenAt(ht),gt=pt.innerMode(ne.getMode(),st.state),vt=gt.state;if(jt&&(st.type=="string"||st.string.charAt(0)!="<"||st.start!=ht.ch-1))return pt.Pass;var St,Et=gt.mode.name!="xml"&&ne.getMode().name=="htmlmixed";if(Et&>.mode.name=="javascript")St=Ce+"script";else if(Et&>.mode.name=="css")St=Ce+"style";else{var Tt=gt.mode.xmlCurrentContext&>.mode.xmlCurrentContext(vt);if(!Tt||Tt.length&&me(ne,Tt,Tt[Tt.length-1],ht))return pt.Pass;St=Ce+Tt[Tt.length-1]}ne.getLine(ht.line).charAt(st.end)!=">"&&(St+=">"),se[et]=St}if(ne.replaceSelections(se),Te=ne.listSelections(),!nt)for(var et=0;et<Te.length;et++)(et==Te.length-1||Te[et].head.line<Te[et+1].head.line)&&ne.indentLine(Te[et].head.line)}function Dt(ne){return ne.getOption("disableInput")?pt.Pass:he(ne,!0)}pt.commands.closeTag=function(ne){return he(ne)};function qt(ne,jt){if(ne.indexOf)return ne.indexOf(jt);for(var Te=0,se=ne.length;Te<se;++Te)if(ne[Te]==jt)return Te;return-1}function me(ne,jt,Te,se,Ce){if(!pt.scanForClosingTag)return!1;var Bt=Math.min(ne.lastLine()+1,se.line+500),nt=pt.scanForClosingTag(ne,se,null,Bt);if(!nt||nt.tag!=Te)return!1;for(var et=Ce?1:0,ht=jt.length-1;ht>=0&&jt[ht]==Te;ht--)++et;se=nt.to;for(var ht=1;ht<et;ht++){var st=pt.scanForClosingTag(ne,se,null,Bt);if(!st||st.tag!=Te)return!1;se=st.to}return!0}})},32855:function(Bn,zn,kt){(function(pt){pt(kt(89780))})(function(pt){"use strict";var Ut=pt.Pos;function ue(ht,st){return ht.line-st.line||ht.ch-st.ch}var Le="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",he=Le+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",Dt=new RegExp("<(/?)(["+Le+"]["+he+"]*)","g");function qt(ht,st,gt,vt){this.line=st,this.ch=gt,this.cm=ht,this.text=ht.getLine(st),this.min=vt?Math.max(vt.from,ht.firstLine()):ht.firstLine(),this.max=vt?Math.min(vt.to-1,ht.lastLine()):ht.lastLine()}function me(ht,st){var gt=ht.cm.getTokenTypeAt(Ut(ht.line,st));return gt&&/\btag\b/.test(gt)}function ne(ht){if(!(ht.line>=ht.max))return ht.ch=0,ht.text=ht.cm.getLine(++ht.line),!0}function jt(ht){if(!(ht.line<=ht.min))return ht.text=ht.cm.getLine(--ht.line),ht.ch=ht.text.length,!0}function Te(ht){for(;;){var st=ht.text.indexOf(">",ht.ch);if(st==-1){if(ne(ht))continue;return}if(!me(ht,st+1)){ht.ch=st+1;continue}var gt=ht.text.lastIndexOf("/",st),vt=gt>-1&&!/\S/.test(ht.text.slice(gt+1,st));return ht.ch=st+1,vt?"selfClose":"regular"}}function se(ht){for(;;){var st=ht.ch?ht.text.lastIndexOf("<",ht.ch-1):-1;if(st==-1){if(jt(ht))continue;return}if(!me(ht,st+1)){ht.ch=st;continue}Dt.lastIndex=st,ht.ch=st;var gt=Dt.exec(ht.text);if(gt&>.index==st)return gt}}function Ce(ht){for(;;){Dt.lastIndex=ht.ch;var st=Dt.exec(ht.text);if(!st){if(ne(ht))continue;return}if(!me(ht,st.index+1)){ht.ch=st.index+1;continue}return ht.ch=st.index+st[0].length,st}}function Bt(ht){for(;;){var st=ht.ch?ht.text.lastIndexOf(">",ht.ch-1):-1;if(st==-1){if(jt(ht))continue;return}if(!me(ht,st+1)){ht.ch=st;continue}var gt=ht.text.lastIndexOf("/",st),vt=gt>-1&&!/\S/.test(ht.text.slice(gt+1,st));return ht.ch=st+1,vt?"selfClose":"regular"}}function nt(ht,st){for(var gt=[];;){var vt=Ce(ht),St,Et=ht.line,Tt=ht.ch-(vt?vt[0].length:0);if(!vt||!(St=Te(ht)))return;if(St!="selfClose")if(vt[1]){for(var Ot=gt.length-1;Ot>=0;--Ot)if(gt[Ot]==vt[2]){gt.length=Ot;break}if(Ot<0&&(!st||st==vt[2]))return{tag:vt[2],from:Ut(Et,Tt),to:Ut(ht.line,ht.ch)}}else gt.push(vt[2])}}function et(ht,st){for(var gt=[];;){var vt=Bt(ht);if(!vt)return;if(vt=="selfClose"){se(ht);continue}var St=ht.line,Et=ht.ch,Tt=se(ht);if(!Tt)return;if(Tt[1])gt.push(Tt[2]);else{for(var Ot=gt.length-1;Ot>=0;--Ot)if(gt[Ot]==Tt[2]){gt.length=Ot;break}if(Ot<0&&(!st||st==Tt[2]))return{tag:Tt[2],from:Ut(ht.line,ht.ch),to:Ut(St,Et)}}}}pt.registerHelper("fold","xml",function(ht,st){for(var gt=new qt(ht,st.line,0);;){var vt=Ce(gt);if(!vt||gt.line!=st.line)return;var St=Te(gt);if(!St)return;if(!vt[1]&&St!="selfClose"){var Et=Ut(gt.line,gt.ch),Tt=nt(gt,vt[2]);return Tt&&ue(Tt.from,Et)>0?{from:Et,to:Tt.from}:null}}}),pt.findMatchingTag=function(ht,st,gt){var vt=new qt(ht,st.line,st.ch,gt);if(!(vt.text.indexOf(">")==-1&&vt.text.indexOf("<")==-1)){var St=Te(vt),Et=St&&Ut(vt.line,vt.ch),Tt=St&&se(vt);if(!(!St||!Tt||ue(vt,st)>0)){var Ot={from:Ut(vt.line,vt.ch),to:Et,tag:Tt[2]};return St=="selfClose"?{open:Ot,close:null,at:"open"}:Tt[1]?{open:et(vt,Tt[2]),close:Ot,at:"close"}:(vt=new qt(ht,Et.line,Et.ch,gt),{open:Ot,close:nt(vt,Tt[2]),at:"open"})}}},pt.findEnclosingTag=function(ht,st,gt,vt){for(var St=new qt(ht,st.line,st.ch,gt);;){var Et=et(St,vt);if(!Et)break;var Tt=new qt(ht,st.line,st.ch,gt),Ot=nt(Tt,Et.tag);if(Ot)return{open:Et,close:Ot}}},pt.scanForClosingTag=function(ht,st,gt,vt){var St=new qt(ht,st.line,st.ch,vt?{from:0,to:vt}:null);return nt(St,gt)}})},89780:function(Bn){(function(zn,kt){Bn.exports=kt()})(this,function(){"use strict";var zn=navigator.userAgent,kt=navigator.platform,pt=/gecko\/\d/i.test(zn),Ut=/MSIE \d/.test(zn),ue=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(zn),Le=/Edge\/(\d+)/.exec(zn),he=Ut||ue||Le,Dt=he&&(Ut?document.documentMode||6:+(Le||ue)[1]),qt=!Le&&/WebKit\//.test(zn),me=qt&&/Qt\/\d+\.\d+/.test(zn),ne=!Le&&/Chrome\//.test(zn),jt=/Opera\//.test(zn),Te=/Apple Computer/.test(navigator.vendor),se=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(zn),Ce=/PhantomJS/.test(zn),Bt=!Le&&/AppleWebKit/.test(zn)&&/Mobile\/\w+/.test(zn),nt=/Android/.test(zn),et=Bt||nt||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(zn),ht=Bt||/Mac/.test(kt),st=/\bCrOS\b/.test(zn),gt=/win/i.test(kt),vt=jt&&zn.match(/Version\/(\d*\.\d*)/);vt&&(vt=Number(vt[1])),vt&&vt>=15&&(jt=!1,qt=!0);var St=ht&&(me||jt&&(vt==null||vt<12.11)),Et=pt||he&&Dt>=9;function Tt(it){return new RegExp("(^|\\s)"+it+"(?:$|\\s)\\s*")}var Ot=function(it,at){var ct=it.className,dt=Tt(at).exec(ct);if(dt){var mt=ct.slice(dt.index+dt[0].length);it.className=ct.slice(0,dt.index)+(mt?dt[1]+mt:"")}};function $t(it){for(var at=it.childNodes.length;at>0;--at)it.removeChild(it.firstChild);return it}function Xt(it,at){return $t(it).appendChild(at)}function Ht(it,at,ct,dt){var mt=document.createElement(it);if(ct&&(mt.className=ct),dt&&(mt.style.cssText=dt),typeof at=="string")mt.appendChild(document.createTextNode(at));else if(at)for(var Ft=0;Ft<at.length;++Ft)mt.appendChild(at[Ft]);return mt}function ve(it,at,ct,dt){var mt=Ht(it,at,ct,dt);return mt.setAttribute("role","presentation"),mt}var ie;document.createRange?ie=function(it,at,ct,dt){var mt=document.createRange();return mt.setEnd(dt||it,ct),mt.setStart(it,at),mt}:ie=function(it,at,ct){var dt=document.body.createTextRange();try{dt.moveToElementText(it.parentNode)}catch(mt){return dt}return dt.collapse(!0),dt.moveEnd("character",ct),dt.moveStart("character",at),dt};function Ne(it,at){if(at.nodeType==3&&(at=at.parentNode),it.contains)return it.contains(at);do if(at.nodeType==11&&(at=at.host),at==it)return!0;while(at=at.parentNode)}function xe(){var it;try{it=document.activeElement}catch(at){it=document.body||null}for(;it&&it.shadowRoot&&it.shadowRoot.activeElement;)it=it.shadowRoot.activeElement;return it}function Pe(it,at){var ct=it.className;Tt(at).test(ct)||(it.className+=(ct?" ":"")+at)}function Qe(it,at){for(var ct=it.split(" "),dt=0;dt<ct.length;dt++)ct[dt]&&!Tt(ct[dt]).test(at)&&(at+=" "+ct[dt]);return at}var _e=function(it){it.select()};Bt?_e=function(it){it.selectionStart=0,it.selectionEnd=it.value.length}:he&&(_e=function(it){try{it.select()}catch(at){}});function an(it){var at=Array.prototype.slice.call(arguments,1);return function(){return it.apply(null,at)}}function Ke(it,at,ct){at||(at={});for(var dt in it)it.hasOwnProperty(dt)&&(ct!==!1||!at.hasOwnProperty(dt))&&(at[dt]=it[dt]);return at}function re(it,at,ct,dt,mt){at==null&&(at=it.search(/[^\s\u00a0]/),at==-1&&(at=it.length));for(var Ft=dt||0,It=mt||0;;){var Kt=it.indexOf(" ",Ft);if(Kt<0||Kt>=at)return It+(at-Ft);It+=Kt-Ft,It+=ct-It%ct,Ft=Kt+1}}var Jt=function(){this.id=null,this.f=null,this.time=0,this.handler=an(this.onTimeout,this)};Jt.prototype.onTimeout=function(it){it.id=0,it.time<=+new Date?it.f():setTimeout(it.handler,it.time-+new Date)},Jt.prototype.set=function(it,at){this.f=at;var ct=+new Date+it;(!this.id||ct<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,it),this.time=ct)};function Ye(it,at){for(var ct=0;ct<it.length;++ct)if(it[ct]==at)return ct;return-1}var Gn=50,dn={toString:function(){return"CodeMirror.Pass"}},Oe={scroll:!1},sn={origin:"*mouse"},ln={origin:"+move"};function Vn(it,at,ct){for(var dt=0,mt=0;;){var Ft=it.indexOf(" ",dt);Ft==-1&&(Ft=it.length);var It=Ft-dt;if(Ft==it.length||mt+It>=at)return dt+Math.min(It,at-mt);if(mt+=Ft-dt,mt+=ct-mt%ct,dt=Ft+1,mt>=at)return dt}}var Ae=[""];function yn(it){for(;Ae.length<=it;)Ae.push(te(Ae)+" ");return Ae[it]}function te(it){return it[it.length-1]}function En(it,at){for(var ct=[],dt=0;dt<it.length;dt++)ct[dt]=at(it[dt],dt);return ct}function ri(it,at,ct){for(var dt=0,mt=ct(at);dt<it.length&&ct(it[dt])<=mt;)dt++;it.splice(dt,0,at)}function Rt(){}function Lt(it,at){var ct;return Object.create?ct=Object.create(it):(Rt.prototype=it,ct=new Rt),at&&Ke(at,ct),ct}var Pt=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function Nt(it){return/\w/.test(it)||it>"\x80"&&(it.toUpperCase()!=it.toLowerCase()||Pt.test(it))}function Zt(it,at){return at?at.source.indexOf("\\w")>-1&&Nt(it)?!0:at.test(it):Nt(it)}function Mt(it){for(var at in it)if(it.hasOwnProperty(at)&&it[at])return!1;return!0}var Yt=/[\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 Ge(it){return it.charCodeAt(0)>=768&&Yt.test(it)}function De(it,at,ct){for(;(ct<0?at>0:at<it.length)&&Ge(it.charAt(at));)at+=ct;return at}function Ue(it,at,ct){for(var dt=at>ct?-1:1;;){if(at==ct)return at;var mt=(at+ct)/2,Ft=dt<0?Math.ceil(mt):Math.floor(mt);if(Ft==at)return it(Ft)?at:ct;it(Ft)?ct=Ft:at=Ft+dt}}function we(it,at,ct,dt){if(!it)return dt(at,ct,"ltr",0);for(var mt=!1,Ft=0;Ft<it.length;++Ft){var It=it[Ft];(It.from<ct&&It.to>at||at==ct&&It.to==at)&&(dt(Math.max(It.from,at),Math.min(It.to,ct),It.level==1?"rtl":"ltr",Ft),mt=!0)}mt||dt(at,ct,"ltr")}var Ee=null;function Fe(it,at,ct){var dt;Ee=null;for(var mt=0;mt<it.length;++mt){var Ft=it[mt];if(Ft.from<at&&Ft.to>at)return mt;Ft.to==at&&(Ft.from!=Ft.to&&ct=="before"?dt=mt:Ee=mt),Ft.from==at&&(Ft.from!=Ft.to&&ct!="before"?dt=mt:Ee=mt)}return dt!=null?dt:Ee}var He=function(){var it="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",at="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function ct(le){return le<=247?it.charAt(le):1424<=le&&le<=1524?"R":1536<=le&&le<=1785?at.charAt(le-1536):1774<=le&&le<=2220?"r":8192<=le&&le<=8203?"w":le==8204?"b":"L"}var dt=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,mt=/[stwN]/,Ft=/[LRr]/,It=/[Lb1n]/,Kt=/[1n]/;function Wt(le,Ze,ge){this.level=le,this.from=Ze,this.to=ge}return function(le,Ze){var ge=Ze=="ltr"?"L":"R";if(le.length==0||Ze=="ltr"&&!dt.test(le))return!1;for(var Sn=le.length,hn=[],xi=0;xi<Sn;++xi)hn.push(ct(le.charCodeAt(xi)));for(var Fi=0,Ri=ge;Fi<Sn;++Fi){var rr=hn[Fi];rr=="m"?hn[Fi]=Ri:Ri=rr}for(var Zr=0,xr=ge;Zr<Sn;++Zr){var Ur=hn[Zr];Ur=="1"&&xr=="r"?hn[Zr]="n":Ft.test(Ur)&&(xr=Ur,Ur=="r"&&(hn[Zr]="R"))}for(var Eo=1,vr=hn[0];Eo<Sn-1;++Eo){var Ho=hn[Eo];Ho=="+"&&vr=="1"&&hn[Eo+1]=="1"?hn[Eo]="1":Ho==","&&vr==hn[Eo+1]&&(vr=="1"||vr=="n")&&(hn[Eo]=vr),vr=Ho}for(var Ma=0;Ma<Sn;++Ma){var ds=hn[Ma];if(ds==",")hn[Ma]="N";else if(ds=="%"){var ja=void 0;for(ja=Ma+1;ja<Sn&&hn[ja]=="%";++ja);for(var fl=Ma&&hn[Ma-1]=="!"||ja<Sn&&hn[ja]=="1"?"1":"N",Ws=Ma;Ws<ja;++Ws)hn[Ws]=fl;Ma=ja-1}}for(var as=0,Cl=ge;as<Sn;++as){var Ds=hn[as];Cl=="L"&&Ds=="1"?hn[as]="L":Ft.test(Ds)&&(Cl=Ds)}for(var ss=0;ss<Sn;++ss)if(mt.test(hn[ss])){var na=void 0;for(na=ss+1;na<Sn&&mt.test(hn[na]);++na);for(var Va=(ss?hn[ss-1]:ge)=="L",Ps=(na<Sn?hn[na]:ge)=="L",Os=Va==Ps?Va?"L":"R":ge,pu=ss;pu<na;++pu)hn[pu]=Os;ss=na-1}for(var za=[],eu,Ya=0;Ya<Sn;)if(It.test(hn[Ya])){var Dc=Ya;for(++Ya;Ya<Sn&&It.test(hn[Ya]);++Ya);za.push(new Wt(0,Dc,Ya))}else{var jl=Ya,El=za.length,gl=Ze=="rtl"?1:0;for(++Ya;Ya<Sn&&hn[Ya]!="L";++Ya);for(var ya=jl;ya<Ya;)if(Kt.test(hn[ya])){jl<ya&&(za.splice(El,0,new Wt(1,jl,ya)),El+=gl);var ws=ya;for(++ya;ya<Ya&&Kt.test(hn[ya]);++ya);za.splice(El,0,new Wt(2,ws,ya)),El+=gl,jl=ya}else++ya;jl<Ya&&za.splice(El,0,new Wt(1,jl,Ya))}return Ze=="ltr"&&(za[0].level==1&&(eu=le.match(/^\s+/))&&(za[0].from=eu[0].length,za.unshift(new Wt(0,0,eu[0].length))),te(za).level==1&&(eu=le.match(/\s+$/))&&(te(za).to-=eu[0].length,za.push(new Wt(0,Sn-eu[0].length,Sn)))),Ze=="rtl"?za.reverse():za}}();function qe(it,at){var ct=it.order;return ct==null&&(ct=it.order=He(it.text,at)),ct}var cn=[],gn=function(it,at,ct){if(it.addEventListener)it.addEventListener(at,ct,!1);else if(it.attachEvent)it.attachEvent("on"+at,ct);else{var dt=it._handlers||(it._handlers={});dt[at]=(dt[at]||cn).concat(ct)}};function ni(it,at){return it._handlers&&it._handlers[at]||cn}function ze(it,at,ct){if(it.removeEventListener)it.removeEventListener(at,ct,!1);else if(it.detachEvent)it.detachEvent("on"+at,ct);else{var dt=it._handlers,mt=dt&&dt[at];if(mt){var Ft=Ye(mt,ct);Ft>-1&&(dt[at]=mt.slice(0,Ft).concat(mt.slice(Ft+1)))}}}function Ve(it,at){var ct=ni(it,at);if(ct.length)for(var dt=Array.prototype.slice.call(arguments,2),mt=0;mt<ct.length;++mt)ct[mt].apply(null,dt)}function nn(it,at,ct){return typeof at=="string"&&(at={type:at,preventDefault:function(){this.defaultPrevented=!0}}),Ve(it,ct||at.type,it,at),ti(at)||at.codemirrorIgnore}function qn(it){var at=it._handlers&&it._handlers.cursorActivity;if(at)for(var ct=it.curOp.cursorActivityHandlers||(it.curOp.cursorActivityHandlers=[]),dt=0;dt<at.length;++dt)Ye(ct,at[dt])==-1&&ct.push(at[dt])}function vn(it,at){return ni(it,at).length>0}function tn(it){it.prototype.on=function(at,ct){gn(this,at,ct)},it.prototype.off=function(at,ct){ze(this,at,ct)}}function Rn(it){it.preventDefault?it.preventDefault():it.returnValue=!1}function gi(it){it.stopPropagation?it.stopPropagation():it.cancelBubble=!0}function ti(it){return it.defaultPrevented!=null?it.defaultPrevented:it.returnValue==!1}function vi(it){Rn(it),gi(it)}function Gi(it){return it.target||it.srcElement}function Fn(it){var at=it.which;return at==null&&(it.button&1?at=1:it.button&2?at=3:it.button&4&&(at=2)),ht&&it.ctrlKey&&at==1&&(at=3),at}var xn=function(){if(he&&Dt<9)return!1;var it=Ht("div");return"draggable"in it||"dragDrop"in it}(),Tn;function ai(it){if(Tn==null){var at=Ht("span","\u200B");Xt(it,Ht("span",[at,document.createTextNode("x")])),it.firstChild.offsetHeight!=0&&(Tn=at.offsetWidth<=1&&at.offsetHeight>2&&!(he&&Dt<8))}var ct=Tn?Ht("span","\u200B"):Ht("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return ct.setAttribute("cm-text",""),ct}var pi;function ui(it){if(pi!=null)return pi;var at=Xt(it,document.createTextNode("A\u062EA")),ct=ie(at,0,1).getBoundingClientRect(),dt=ie(at,1,2).getBoundingClientRect();return $t(it),!ct||ct.left==ct.right?!1:pi=dt.right-ct.right<3}var zi=`
|
|
|
|
b`.split(/\n/).length!=3?function(it){for(var at=0,ct=[],dt=it.length;at<=dt;){var mt=it.indexOf(`
|
|
`,at);mt==-1&&(mt=it.length);var Ft=it.slice(at,it.charAt(mt-1)=="\r"?mt-1:mt),It=Ft.indexOf("\r");It!=-1?(ct.push(Ft.slice(0,It)),at+=It+1):(ct.push(Ft),at=mt+1)}return ct}:function(it){return it.split(/\r\n?|\n/)},wt=window.getSelection?function(it){try{return it.selectionStart!=it.selectionEnd}catch(at){return!1}}:function(it){var at;try{at=it.ownerDocument.selection.createRange()}catch(ct){}return!at||at.parentElement()!=it?!1:at.compareEndPoints("StartToEnd",at)!=0},Xe=function(){var it=Ht("div");return"oncopy"in it?!0:(it.setAttribute("oncopy","return;"),typeof it.oncopy=="function")}(),Hn=null;function Ai(it){if(Hn!=null)return Hn;var at=Xt(it,Ht("span","x")),ct=at.getBoundingClientRect(),dt=ie(at,0,1).getBoundingClientRect();return Hn=Math.abs(ct.left-dt.left)>1}var Vi={},dr={};function kr(it,at){arguments.length>2&&(at.dependencies=Array.prototype.slice.call(arguments,2)),Vi[it]=at}function ci(it,at){dr[it]=at}function In(it){if(typeof it=="string"&&dr.hasOwnProperty(it))it=dr[it];else if(it&&typeof it.name=="string"&&dr.hasOwnProperty(it.name)){var at=dr[it.name];typeof at=="string"&&(at={name:at}),it=Lt(at,it),it.name=at.name}else{if(typeof it=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(it))return In("application/xml");if(typeof it=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(it))return In("application/json")}return typeof it=="string"?{name:it}:it||{name:"null"}}function pe(it,at){at=In(at);var ct=Vi[at.name];if(!ct)return pe(it,"text/plain");var dt=ct(it,at);if(Se.hasOwnProperty(at.name)){var mt=Se[at.name];for(var Ft in mt)mt.hasOwnProperty(Ft)&&(dt.hasOwnProperty(Ft)&&(dt["_"+Ft]=dt[Ft]),dt[Ft]=mt[Ft])}if(dt.name=at.name,at.helperType&&(dt.helperType=at.helperType),at.modeProps)for(var It in at.modeProps)dt[It]=at.modeProps[It];return dt}var Se={};function ye(it,at){var ct=Se.hasOwnProperty(it)?Se[it]:Se[it]={};Ke(at,ct)}function jn(it,at){if(at===!0)return at;if(it.copyState)return it.copyState(at);var ct={};for(var dt in at){var mt=at[dt];mt instanceof Array&&(mt=mt.concat([])),ct[dt]=mt}return ct}function Ln(it,at){for(var ct;it.innerMode&&(ct=it.innerMode(at),!(!ct||ct.mode==it));)at=ct.state,it=ct.mode;return ct||{mode:it,state:at}}function Kn(it,at,ct){return it.startState?it.startState(at,ct):!0}var Je=function(it,at,ct){this.pos=this.start=0,this.string=it,this.tabSize=at||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=ct};Je.prototype.eol=function(){return this.pos>=this.string.length},Je.prototype.sol=function(){return this.pos==this.lineStart},Je.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Je.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Je.prototype.eat=function(it){var at=this.string.charAt(this.pos),ct;if(typeof it=="string"?ct=at==it:ct=at&&(it.test?it.test(at):it(at)),ct)return++this.pos,at},Je.prototype.eatWhile=function(it){for(var at=this.pos;this.eat(it););return this.pos>at},Je.prototype.eatSpace=function(){for(var it=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>it},Je.prototype.skipToEnd=function(){this.pos=this.string.length},Je.prototype.skipTo=function(it){var at=this.string.indexOf(it,this.pos);if(at>-1)return this.pos=at,!0},Je.prototype.backUp=function(it){this.pos-=it},Je.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=re(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?re(this.string,this.lineStart,this.tabSize):0)},Je.prototype.indentation=function(){return re(this.string,null,this.tabSize)-(this.lineStart?re(this.string,this.lineStart,this.tabSize):0)},Je.prototype.match=function(it,at,ct){if(typeof it=="string"){var dt=function(It){return ct?It.toLowerCase():It},mt=this.string.substr(this.pos,it.length);if(dt(mt)==dt(it))return at!==!1&&(this.pos+=it.length),!0}else{var Ft=this.string.slice(this.pos).match(it);return Ft&&Ft.index>0?null:(Ft&&at!==!1&&(this.pos+=Ft[0].length),Ft)}},Je.prototype.current=function(){return this.string.slice(this.start,this.pos)},Je.prototype.hideFirstChars=function(it,at){this.lineStart+=it;try{return at()}finally{this.lineStart-=it}},Je.prototype.lookAhead=function(it){var at=this.lineOracle;return at&&at.lookAhead(it)},Je.prototype.baseToken=function(){var it=this.lineOracle;return it&&it.baseToken(this.pos)};function An(it,at){if(at-=it.first,at<0||at>=it.size)throw new Error("There is no line "+(at+it.first)+" in the document.");for(var ct=it;!ct.lines;)for(var dt=0;;++dt){var mt=ct.children[dt],Ft=mt.chunkSize();if(at<Ft){ct=mt;break}at-=Ft}return ct.lines[at]}function yi(it,at,ct){var dt=[],mt=at.line;return it.iter(at.line,ct.line+1,function(Ft){var It=Ft.text;mt==ct.line&&(It=It.slice(0,ct.ch)),mt==at.line&&(It=It.slice(at.ch)),dt.push(It),++mt}),dt}function Ei(it,at,ct){var dt=[];return it.iter(at,ct,function(mt){dt.push(mt.text)}),dt}function Xi(it,at){var ct=at-it.height;if(ct)for(var dt=it;dt;dt=dt.parent)dt.height+=ct}function Gt(it){if(it.parent==null)return null;for(var at=it.parent,ct=Ye(at.lines,it),dt=at.parent;dt;at=dt,dt=dt.parent)for(var mt=0;dt.children[mt]!=at;++mt)ct+=dt.children[mt].chunkSize();return ct+at.first}function de(it,at){var ct=it.first;t:do{for(var dt=0;dt<it.children.length;++dt){var mt=it.children[dt],Ft=mt.height;if(at<Ft){it=mt;continue t}at-=Ft,ct+=mt.chunkSize()}return ct}while(!it.lines);for(var It=0;It<it.lines.length;++It){var Kt=it.lines[It],Wt=Kt.height;if(at<Wt)break;at-=Wt}return ct+It}function un(it,at){return at>=it.first&&at<it.first+it.size}function Mn(it,at){return String(it.lineNumberFormatter(at+it.firstLineNumber))}function Ie(it,at,ct){if(ct===void 0&&(ct=null),!(this instanceof Ie))return new Ie(it,at,ct);this.line=it,this.ch=at,this.sticky=ct}function $e(it,at){return it.line-at.line||it.ch-at.ch}function bn(it,at){return it.sticky==at.sticky&&$e(it,at)==0}function _n(it){return Ie(it.line,it.ch)}function hi(it,at){return $e(it,at)<0?at:it}function Yn(it,at){return $e(it,at)<0?it:at}function si(it,at){return Math.max(it.first,Math.min(at,it.first+it.size-1))}function ei(it,at){if(at.line<it.first)return Ie(it.first,0);var ct=it.first+it.size-1;return at.line>ct?Ie(ct,An(it,ct).text.length):Ii(at,An(it,at.line).text.length)}function Ii(it,at){var ct=it.ch;return ct==null||ct>at?Ie(it.line,at):ct<0?Ie(it.line,0):it}function Ti(it,at){for(var ct=[],dt=0;dt<at.length;dt++)ct[dt]=ei(it,at[dt]);return ct}var Di=function(it,at){this.state=it,this.lookAhead=at},We=function(it,at,ct,dt){this.state=at,this.doc=it,this.line=ct,this.maxLookAhead=dt||0,this.baseTokens=null,this.baseTokenPos=1};We.prototype.lookAhead=function(it){var at=this.doc.getLine(this.line+it);return at!=null&&it>this.maxLookAhead&&(this.maxLookAhead=it),at},We.prototype.baseToken=function(it){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=it;)this.baseTokenPos+=2;var at=this.baseTokens[this.baseTokenPos+1];return{type:at&&at.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-it}},We.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},We.fromSaved=function(it,at,ct){return at instanceof Di?new We(it,jn(it.mode,at.state),ct,at.lookAhead):new We(it,jn(it.mode,at),ct)},We.prototype.save=function(it){var at=it!==!1?jn(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new Di(at,this.maxLookAhead):at};function gr(it,at,ct,dt){var mt=[it.state.modeGen],Ft={};pr(it,at.text,it.doc.mode,ct,function(le,Ze){return mt.push(le,Ze)},Ft,dt);for(var It=ct.state,Kt=function(le){ct.baseTokens=mt;var Ze=it.state.overlays[le],ge=1,Sn=0;ct.state=!0,pr(it,at.text,Ze.mode,ct,function(hn,xi){for(var Fi=ge;Sn<hn;){var Ri=mt[ge];Ri>hn&&mt.splice(ge,1,hn,mt[ge+1],Ri),ge+=2,Sn=Math.min(hn,Ri)}if(xi)if(Ze.opaque)mt.splice(Fi,ge-Fi,hn,"overlay "+xi),ge=Fi+2;else for(;Fi<ge;Fi+=2){var rr=mt[Fi+1];mt[Fi+1]=(rr?rr+" ":"")+"overlay "+xi}},Ft),ct.state=It,ct.baseTokens=null,ct.baseTokenPos=1},Wt=0;Wt<it.state.overlays.length;++Wt)Kt(Wt);return{styles:mt,classes:Ft.bgClass||Ft.textClass?Ft:null}}function yr(it,at,ct){if(!at.styles||at.styles[0]!=it.state.modeGen){var dt=$r(it,Gt(at)),mt=at.text.length>it.options.maxHighlightLength&&jn(it.doc.mode,dt.state),Ft=gr(it,at,dt);mt&&(dt.state=mt),at.stateAfter=dt.save(!mt),at.styles=Ft.styles,Ft.classes?at.styleClasses=Ft.classes:at.styleClasses&&(at.styleClasses=null),ct===it.doc.highlightFrontier&&(it.doc.modeFrontier=Math.max(it.doc.modeFrontier,++it.doc.highlightFrontier))}return at.styles}function $r(it,at,ct){var dt=it.doc,mt=it.display;if(!dt.mode.startState)return new We(dt,!0,at);var Ft=br(it,at,ct),It=Ft>dt.first&&An(dt,Ft-1).stateAfter,Kt=It?We.fromSaved(dt,It,Ft):new We(dt,Kn(dt.mode),Ft);return dt.iter(Ft,at,function(Wt){rn(it,Wt.text,Kt);var le=Kt.line;Wt.stateAfter=le==at-1||le%5==0||le>=mt.viewFrom&&le<mt.viewTo?Kt.save():null,Kt.nextLine()}),ct&&(dt.modeFrontier=Kt.line),Kt}function rn(it,at,ct,dt){var mt=it.doc.mode,Ft=new Je(at,it.options.tabSize,ct);for(Ft.start=Ft.pos=dt||0,at==""&&On(mt,ct.state);!Ft.eol();)bi(mt,Ft,ct.state),Ft.start=Ft.pos}function On(it,at){if(it.blankLine)return it.blankLine(at);if(it.innerMode){var ct=Ln(it,at);if(ct.mode.blankLine)return ct.mode.blankLine(ct.state)}}function bi(it,at,ct,dt){for(var mt=0;mt<10;mt++){dt&&(dt[0]=Ln(it,ct).mode);var Ft=it.token(at,ct);if(at.pos>at.start)return Ft}throw new Error("Mode "+it.name+" failed to advance stream.")}var Mi=function(it,at,ct){this.start=it.start,this.end=it.pos,this.string=it.current(),this.type=at||null,this.state=ct};function _i(it,at,ct,dt){var mt=it.doc,Ft=mt.mode,It;at=ei(mt,at);var Kt=An(mt,at.line),Wt=$r(it,at.line,ct),le=new Je(Kt.text,it.options.tabSize,Wt),Ze;for(dt&&(Ze=[]);(dt||le.pos<at.ch)&&!le.eol();)le.start=le.pos,It=bi(Ft,le,Wt.state),dt&&Ze.push(new Mi(le,It,jn(mt.mode,Wt.state)));return dt?Ze:new Mi(le,It,Wt.state)}function tr(it,at){if(it)for(;;){var ct=it.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!ct)break;it=it.slice(0,ct.index)+it.slice(ct.index+ct[0].length);var dt=ct[1]?"bgClass":"textClass";at[dt]==null?at[dt]=ct[2]:new RegExp("(?:^|\\s)"+ct[2]+"(?:$|\\s)").test(at[dt])||(at[dt]+=" "+ct[2])}return it}function pr(it,at,ct,dt,mt,Ft,It){var Kt=ct.flattenSpans;Kt==null&&(Kt=it.options.flattenSpans);var Wt=0,le=null,Ze=new Je(at,it.options.tabSize,dt),ge,Sn=it.options.addModeClass&&[null];for(at==""&&tr(On(ct,dt.state),Ft);!Ze.eol();){if(Ze.pos>it.options.maxHighlightLength?(Kt=!1,It&&rn(it,at,dt,Ze.pos),Ze.pos=at.length,ge=null):ge=tr(bi(ct,Ze,dt.state,Sn),Ft),Sn){var hn=Sn[0].name;hn&&(ge="m-"+(ge?hn+" "+ge:hn))}if(!Kt||le!=ge){for(;Wt<Ze.start;)Wt=Math.min(Ze.start,Wt+5e3),mt(Wt,le);le=ge}Ze.start=Ze.pos}for(;Wt<Ze.pos;){var xi=Math.min(Ze.pos,Wt+5e3);mt(xi,le),Wt=xi}}function br(it,at,ct){for(var dt,mt,Ft=it.doc,It=ct?-1:at-(it.doc.mode.innerMode?1e3:100),Kt=at;Kt>It;--Kt){if(Kt<=Ft.first)return Ft.first;var Wt=An(Ft,Kt-1),le=Wt.stateAfter;if(le&&(!ct||Kt+(le instanceof Di?le.lookAhead:0)<=Ft.modeFrontier))return Kt;var Ze=re(Wt.text,null,it.options.tabSize);(mt==null||dt>Ze)&&(mt=Kt-1,dt=Ze)}return mt}function Or(it,at){if(it.modeFrontier=Math.min(it.modeFrontier,at),!(it.highlightFrontier<at-10)){for(var ct=it.first,dt=at-1;dt>ct;dt--){var mt=An(it,dt).stateAfter;if(mt&&(!(mt instanceof Di)||dt+mt.lookAhead<at)){ct=dt+1;break}}it.highlightFrontier=Math.min(it.highlightFrontier,ct)}}var Ir=!1,fn=!1;function ho(){Ir=!0}function pn(){fn=!0}function Hi(it,at,ct){this.marker=it,this.from=at,this.to=ct}function Kr(it,at){if(it)for(var ct=0;ct<it.length;++ct){var dt=it[ct];if(dt.marker==at)return dt}}function ji(it,at){for(var ct,dt=0;dt<it.length;++dt)it[dt]!=at&&(ct||(ct=[])).push(it[dt]);return ct}function xo(it,at){it.markedSpans=it.markedSpans?it.markedSpans.concat([at]):[at],at.marker.attachLine(it)}function Yr(it,at,ct){var dt;if(it)for(var mt=0;mt<it.length;++mt){var Ft=it[mt],It=Ft.marker,Kt=Ft.from==null||(It.inclusiveLeft?Ft.from<=at:Ft.from<at);if(Kt||Ft.from==at&&It.type=="bookmark"&&(!ct||!Ft.marker.insertLeft)){var Wt=Ft.to==null||(It.inclusiveRight?Ft.to>=at:Ft.to>at);(dt||(dt=[])).push(new Hi(It,Ft.from,Wt?null:Ft.to))}}return dt}function Cr(it,at,ct){var dt;if(it)for(var mt=0;mt<it.length;++mt){var Ft=it[mt],It=Ft.marker,Kt=Ft.to==null||(It.inclusiveRight?Ft.to>=at:Ft.to>at);if(Kt||Ft.from==at&&It.type=="bookmark"&&(!ct||Ft.marker.insertLeft)){var Wt=Ft.from==null||(It.inclusiveLeft?Ft.from<=at:Ft.from<at);(dt||(dt=[])).push(new Hi(It,Wt?null:Ft.from-at,Ft.to==null?null:Ft.to-at))}}return dt}function Po(it,at){if(at.full)return null;var ct=un(it,at.from.line)&&An(it,at.from.line).markedSpans,dt=un(it,at.to.line)&&An(it,at.to.line).markedSpans;if(!ct&&!dt)return null;var mt=at.from.ch,Ft=at.to.ch,It=$e(at.from,at.to)==0,Kt=Yr(ct,mt,It),Wt=Cr(dt,Ft,It),le=at.text.length==1,Ze=te(at.text).length+(le?mt:0);if(Kt)for(var ge=0;ge<Kt.length;++ge){var Sn=Kt[ge];if(Sn.to==null){var hn=Kr(Wt,Sn.marker);hn?le&&(Sn.to=hn.to==null?null:hn.to+Ze):Sn.to=mt}}if(Wt)for(var xi=0;xi<Wt.length;++xi){var Fi=Wt[xi];if(Fi.to!=null&&(Fi.to+=Ze),Fi.from==null){var Ri=Kr(Kt,Fi.marker);Ri||(Fi.from=Ze,le&&(Kt||(Kt=[])).push(Fi))}else Fi.from+=Ze,le&&(Kt||(Kt=[])).push(Fi)}Kt&&(Kt=je(Kt)),Wt&&Wt!=Kt&&(Wt=je(Wt));var rr=[Kt];if(!le){var Zr=at.text.length-2,xr;if(Zr>0&&Kt)for(var Ur=0;Ur<Kt.length;++Ur)Kt[Ur].to==null&&(xr||(xr=[])).push(new Hi(Kt[Ur].marker,null,null));for(var Eo=0;Eo<Zr;++Eo)rr.push(xr);rr.push(Wt)}return rr}function je(it){for(var at=0;at<it.length;++at){var ct=it[at];ct.from!=null&&ct.from==ct.to&&ct.marker.clearWhenEmpty!==!1&&it.splice(at--,1)}return it.length?it:null}function Pn(it,at,ct){var dt=null;if(it.iter(at.line,ct.line+1,function(hn){if(hn.markedSpans)for(var xi=0;xi<hn.markedSpans.length;++xi){var Fi=hn.markedSpans[xi].marker;Fi.readOnly&&(!dt||Ye(dt,Fi)==-1)&&(dt||(dt=[])).push(Fi)}}),!dt)return null;for(var mt=[{from:at,to:ct}],Ft=0;Ft<dt.length;++Ft)for(var It=dt[Ft],Kt=It.find(0),Wt=0;Wt<mt.length;++Wt){var le=mt[Wt];if(!($e(le.to,Kt.from)<0||$e(le.from,Kt.to)>0)){var Ze=[Wt,1],ge=$e(le.from,Kt.from),Sn=$e(le.to,Kt.to);(ge<0||!It.inclusiveLeft&&!ge)&&Ze.push({from:le.from,to:Kt.from}),(Sn>0||!It.inclusiveRight&&!Sn)&&Ze.push({from:Kt.to,to:le.to}),mt.splice.apply(mt,Ze),Wt+=Ze.length-3}}return mt}function be(it){var at=it.markedSpans;if(at){for(var ct=0;ct<at.length;++ct)at[ct].marker.detachLine(it);it.markedSpans=null}}function At(it,at){if(at){for(var ct=0;ct<at.length;++ct)at[ct].marker.attachLine(it);it.markedSpans=at}}function Zn(it){return it.inclusiveLeft?-1:0}function Jn(it){return it.inclusiveRight?1:0}function Ci(it,at){var ct=it.lines.length-at.lines.length;if(ct!=0)return ct;var dt=it.find(),mt=at.find(),Ft=$e(dt.from,mt.from)||Zn(it)-Zn(at);if(Ft)return-Ft;var It=$e(dt.to,mt.to)||Jn(it)-Jn(at);return It||at.id-it.id}function Si(it,at){var ct=fn&&it.markedSpans,dt;if(ct)for(var mt=void 0,Ft=0;Ft<ct.length;++Ft)mt=ct[Ft],mt.marker.collapsed&&(at?mt.from:mt.to)==null&&(!dt||Ci(dt,mt.marker)<0)&&(dt=mt.marker);return dt}function li(it){return Si(it,!0)}function mn(it){return Si(it,!1)}function Un(it,at){var ct=fn&&it.markedSpans,dt;if(ct)for(var mt=0;mt<ct.length;++mt){var Ft=ct[mt];Ft.marker.collapsed&&(Ft.from==null||Ft.from<at)&&(Ft.to==null||Ft.to>at)&&(!dt||Ci(dt,Ft.marker)<0)&&(dt=Ft.marker)}return dt}function Qn(it,at,ct,dt,mt){var Ft=An(it,at),It=fn&&Ft.markedSpans;if(It)for(var Kt=0;Kt<It.length;++Kt){var Wt=It[Kt];if(Wt.marker.collapsed){var le=Wt.marker.find(0),Ze=$e(le.from,ct)||Zn(Wt.marker)-Zn(mt),ge=$e(le.to,dt)||Jn(Wt.marker)-Jn(mt);if(!(Ze>=0&&ge<=0||Ze<=0&&ge>=0)&&(Ze<=0&&(Wt.marker.inclusiveRight&&mt.inclusiveLeft?$e(le.to,ct)>=0:$e(le.to,ct)>0)||Ze>=0&&(Wt.marker.inclusiveRight&&mt.inclusiveLeft?$e(le.from,dt)<=0:$e(le.from,dt)<0)))return!0}}}function Dn(it){for(var at;at=li(it);)it=at.find(-1,!0).line;return it}function Xn(it){for(var at;at=mn(it);)it=at.find(1,!0).line;return it}function Oi(it){for(var at,ct;at=mn(it);)it=at.find(1,!0).line,(ct||(ct=[])).push(it);return ct}function mi(it,at){var ct=An(it,at),dt=Dn(ct);return ct==dt?at:Gt(dt)}function ii(it,at){if(at>it.lastLine())return at;var ct=An(it,at),dt;if(!on(it,ct))return at;for(;dt=mn(ct);)ct=dt.find(1,!0).line;return Gt(ct)+1}function on(it,at){var ct=fn&&at.markedSpans;if(ct){for(var dt=void 0,mt=0;mt<ct.length;++mt)if(dt=ct[mt],!!dt.marker.collapsed){if(dt.from==null)return!0;if(!dt.marker.widgetNode&&dt.from==0&&dt.marker.inclusiveLeft&&ki(it,at,dt))return!0}}}function ki(it,at,ct){if(ct.to==null){var dt=ct.marker.find(1,!0);return ki(it,dt.line,Kr(dt.line.markedSpans,ct.marker))}if(ct.marker.inclusiveRight&&ct.to==at.text.length)return!0;for(var mt=void 0,Ft=0;Ft<at.markedSpans.length;++Ft)if(mt=at.markedSpans[Ft],mt.marker.collapsed&&!mt.marker.widgetNode&&mt.from==ct.to&&(mt.to==null||mt.to!=ct.from)&&(mt.marker.inclusiveLeft||ct.marker.inclusiveRight)&&ki(it,at,mt))return!0}function Ui(it){it=Dn(it);for(var at=0,ct=it.parent,dt=0;dt<ct.lines.length;++dt){var mt=ct.lines[dt];if(mt==it)break;at+=mt.height}for(var Ft=ct.parent;Ft;ct=Ft,Ft=ct.parent)for(var It=0;It<Ft.children.length;++It){var Kt=Ft.children[It];if(Kt==ct)break;at+=Kt.height}return at}function Tr(it){if(it.height==0)return 0;for(var at=it.text.length,ct,dt=it;ct=li(dt);){var mt=ct.find(0,!0);dt=mt.from.line,at+=mt.from.ch-mt.to.ch}for(dt=it;ct=mn(dt);){var Ft=ct.find(0,!0);at-=dt.text.length-Ft.from.ch,dt=Ft.to.line,at+=dt.text.length-Ft.to.ch}return at}function hr(it){var at=it.display,ct=it.doc;at.maxLine=An(ct,ct.first),at.maxLineLength=Tr(at.maxLine),at.maxLineChanged=!0,ct.iter(function(dt){var mt=Tr(dt);mt>at.maxLineLength&&(at.maxLineLength=mt,at.maxLine=dt)})}var ao=function(it,at,ct){this.text=it,At(this,at),this.height=ct?ct(this):1};ao.prototype.lineNo=function(){return Gt(this)},tn(ao);function eo(it,at,ct,dt){it.text=at,it.stateAfter&&(it.stateAfter=null),it.styles&&(it.styles=null),it.order!=null&&(it.order=null),be(it),At(it,ct);var mt=dt?dt(it):1;mt!=it.height&&Xi(it,mt)}function qr(it){it.parent=null,be(it)}var co={},uo={};function bo(it,at){if(!it||/^\s*$/.test(it))return null;var ct=at.addModeClass?uo:co;return ct[it]||(ct[it]=it.replace(/\S+/g,"cm-$&"))}function Be(it,at){var ct=ve("span",null,null,qt?"padding-right: .1px":null),dt={pre:ve("pre",[ct],"CodeMirror-line"),content:ct,col:0,pos:0,cm:it,trailingSpace:!1,splitSpaces:it.getOption("lineWrapping")};at.measure={};for(var mt=0;mt<=(at.rest?at.rest.length:0);mt++){var Ft=mt?at.rest[mt-1]:at.line,It=void 0;dt.pos=0,dt.addToken=Jr,ui(it.display.measure)&&(It=qe(Ft,it.doc.direction))&&(dt.addToken=Hr(dt.addToken,It)),dt.map=[];var Kt=at!=it.display.externalMeasured&&Gt(Ft);Fo(Ft,dt,yr(it,Ft,Kt)),Ft.styleClasses&&(Ft.styleClasses.bgClass&&(dt.bgClass=Qe(Ft.styleClasses.bgClass,dt.bgClass||"")),Ft.styleClasses.textClass&&(dt.textClass=Qe(Ft.styleClasses.textClass,dt.textClass||""))),dt.map.length==0&&dt.map.push(0,0,dt.content.appendChild(ai(it.display.measure))),mt==0?(at.measure.map=dt.map,at.measure.cache={}):((at.measure.maps||(at.measure.maps=[])).push(dt.map),(at.measure.caches||(at.measure.caches=[])).push({}))}if(qt){var Wt=dt.content.lastChild;(/\bcm-tab\b/.test(Wt.className)||Wt.querySelector&&Wt.querySelector(".cm-tab"))&&(dt.content.className="cm-tab-wrap-hack")}return Ve(it,"renderLine",it,at.line,dt.pre),dt.pre.className&&(dt.textClass=Qe(dt.pre.className,dt.textClass||"")),dt}function so(it){var at=Ht("span","\u2022","cm-invalidchar");return at.title="\\u"+it.charCodeAt(0).toString(16),at.setAttribute("aria-label",at.title),at}function Jr(it,at,ct,dt,mt,Ft,It){if(at){var Kt=it.splitSpaces?fr(at,it.trailingSpace):at,Wt=it.cm.state.specialChars,le=!1,Ze;if(!Wt.test(at))it.col+=at.length,Ze=document.createTextNode(Kt),it.map.push(it.pos,it.pos+at.length,Ze),he&&Dt<9&&(le=!0),it.pos+=at.length;else{Ze=document.createDocumentFragment();for(var ge=0;;){Wt.lastIndex=ge;var Sn=Wt.exec(at),hn=Sn?Sn.index-ge:at.length-ge;if(hn){var xi=document.createTextNode(Kt.slice(ge,ge+hn));he&&Dt<9?Ze.appendChild(Ht("span",[xi])):Ze.appendChild(xi),it.map.push(it.pos,it.pos+hn,xi),it.col+=hn,it.pos+=hn}if(!Sn)break;ge+=hn+1;var Fi=void 0;if(Sn[0]==" "){var Ri=it.cm.options.tabSize,rr=Ri-it.col%Ri;Fi=Ze.appendChild(Ht("span",yn(rr),"cm-tab")),Fi.setAttribute("role","presentation"),Fi.setAttribute("cm-text"," "),it.col+=rr}else Sn[0]=="\r"||Sn[0]==`
|
|
`?(Fi=Ze.appendChild(Ht("span",Sn[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),Fi.setAttribute("cm-text",Sn[0]),it.col+=1):(Fi=it.cm.options.specialCharPlaceholder(Sn[0]),Fi.setAttribute("cm-text",Sn[0]),he&&Dt<9?Ze.appendChild(Ht("span",[Fi])):Ze.appendChild(Fi),it.col+=1);it.map.push(it.pos,it.pos+1,Fi),it.pos++}}if(it.trailingSpace=Kt.charCodeAt(at.length-1)==32,ct||dt||mt||le||Ft||It){var Zr=ct||"";dt&&(Zr+=dt),mt&&(Zr+=mt);var xr=Ht("span",[Ze],Zr,Ft);if(It)for(var Ur in It)It.hasOwnProperty(Ur)&&Ur!="style"&&Ur!="class"&&xr.setAttribute(Ur,It[Ur]);return it.content.appendChild(xr)}it.content.appendChild(Ze)}}function fr(it,at){if(it.length>1&&!/ /.test(it))return it;for(var ct=at,dt="",mt=0;mt<it.length;mt++){var Ft=it.charAt(mt);Ft==" "&&ct&&(mt==it.length-1||it.charCodeAt(mt+1)==32)&&(Ft="\xA0"),dt+=Ft,ct=Ft==" "}return dt}function Hr(it,at){return function(ct,dt,mt,Ft,It,Kt,Wt){mt=mt?mt+" cm-force-border":"cm-force-border";for(var le=ct.pos,Ze=le+dt.length;;){for(var ge=void 0,Sn=0;Sn<at.length&&(ge=at[Sn],!(ge.to>le&&ge.from<=le));Sn++);if(ge.to>=Ze)return it(ct,dt,mt,Ft,It,Kt,Wt);it(ct,dt.slice(0,ge.to-le),mt,Ft,null,Kt,Wt),Ft=null,dt=dt.slice(ge.to-le),le=ge.to}}}function Er(it,at,ct,dt){var mt=!dt&&ct.widgetNode;mt&&it.map.push(it.pos,it.pos+at,mt),!dt&&it.cm.display.input.needsContentAttribute&&(mt||(mt=it.content.appendChild(document.createElement("span"))),mt.setAttribute("cm-marker",ct.id)),mt&&(it.cm.display.input.setUneditable(mt),it.content.appendChild(mt)),it.pos+=at,it.trailingSpace=!1}function Fo(it,at,ct){var dt=it.markedSpans,mt=it.text,Ft=0;if(!dt){for(var It=1;It<ct.length;It+=2)at.addToken(at,mt.slice(Ft,Ft=ct[It]),bo(ct[It+1],at.cm.options));return}for(var Kt=mt.length,Wt=0,le=1,Ze="",ge,Sn,hn=0,xi,Fi,Ri,rr,Zr;;){if(hn==Wt){xi=Fi=Ri=Sn="",Zr=null,rr=null,hn=1/0;for(var xr=[],Ur=void 0,Eo=0;Eo<dt.length;++Eo){var vr=dt[Eo],Ho=vr.marker;if(Ho.type=="bookmark"&&vr.from==Wt&&Ho.widgetNode)xr.push(Ho);else if(vr.from<=Wt&&(vr.to==null||vr.to>Wt||Ho.collapsed&&vr.to==Wt&&vr.from==Wt)){if(vr.to!=null&&vr.to!=Wt&&hn>vr.to&&(hn=vr.to,Fi=""),Ho.className&&(xi+=" "+Ho.className),Ho.css&&(Sn=(Sn?Sn+";":"")+Ho.css),Ho.startStyle&&vr.from==Wt&&(Ri+=" "+Ho.startStyle),Ho.endStyle&&vr.to==hn&&(Ur||(Ur=[])).push(Ho.endStyle,vr.to),Ho.title&&((Zr||(Zr={})).title=Ho.title),Ho.attributes)for(var Ma in Ho.attributes)(Zr||(Zr={}))[Ma]=Ho.attributes[Ma];Ho.collapsed&&(!rr||Ci(rr.marker,Ho)<0)&&(rr=vr)}else vr.from>Wt&&hn>vr.from&&(hn=vr.from)}if(Ur)for(var ds=0;ds<Ur.length;ds+=2)Ur[ds+1]==hn&&(Fi+=" "+Ur[ds]);if(!rr||rr.from==Wt)for(var ja=0;ja<xr.length;++ja)Er(at,0,xr[ja]);if(rr&&(rr.from||0)==Wt){if(Er(at,(rr.to==null?Kt+1:rr.to)-Wt,rr.marker,rr.from==null),rr.to==null)return;rr.to==Wt&&(rr=!1)}}if(Wt>=Kt)break;for(var fl=Math.min(Kt,hn);;){if(Ze){var Ws=Wt+Ze.length;if(!rr){var as=Ws>fl?Ze.slice(0,fl-Wt):Ze;at.addToken(at,as,ge?ge+xi:xi,Ri,Wt+as.length==hn?Fi:"",Sn,Zr)}if(Ws>=fl){Ze=Ze.slice(fl-Wt),Wt=fl;break}Wt=Ws,Ri=""}Ze=mt.slice(Ft,Ft=ct[le++]),ge=bo(ct[le++],at.cm.options)}}}function Lo(it,at,ct){this.line=at,this.rest=Oi(at),this.size=this.rest?Gt(te(this.rest))-ct+1:1,this.node=this.text=null,this.hidden=on(it,at)}function Rr(it,at,ct){for(var dt=[],mt,Ft=at;Ft<ct;Ft=mt){var It=new Lo(it.doc,An(it.doc,Ft),Ft);mt=Ft+It.size,dt.push(It)}return dt}var jr=null;function Za(it){jr?jr.ops.push(it):it.ownsGroup=jr={ops:[it],delayedCallbacks:[]}}function aa(it){var at=it.delayedCallbacks,ct=0;do{for(;ct<at.length;ct++)at[ct].call(null);for(var dt=0;dt<it.ops.length;dt++){var mt=it.ops[dt];if(mt.cursorActivityHandlers)for(;mt.cursorActivityCalled<mt.cursorActivityHandlers.length;)mt.cursorActivityHandlers[mt.cursorActivityCalled++].call(null,mt.cm)}}while(ct<at.length)}function As(it,at){var ct=it.ownsGroup;if(ct)try{aa(ct)}finally{jr=null,at(ct)}}var Na=null;function nr(it,at){var ct=ni(it,at);if(ct.length){var dt=Array.prototype.slice.call(arguments,2),mt;jr?mt=jr.delayedCallbacks:Na?mt=Na:(mt=Na=[],setTimeout(qo,0));for(var Ft=function(Kt){mt.push(function(){return ct[Kt].apply(null,dt)})},It=0;It<ct.length;++It)Ft(It)}}function qo(){var it=Na;Na=null;for(var at=0;at<it.length;++at)it[at]()}function ta(it,at,ct,dt){for(var mt=0;mt<at.changes.length;mt++){var Ft=at.changes[mt];Ft=="text"?fi(it,at):Ft=="gutter"?_r(it,at,ct,dt):Ft=="class"?ar(it,at):Ft=="widget"&&to(it,at,dt)}at.changes=null}function ga(it){return it.node==it.text&&(it.node=Ht("div",null,null,"position: relative"),it.text.parentNode&&it.text.parentNode.replaceChild(it.node,it.text),it.node.appendChild(it.text),he&&Dt<8&&(it.node.style.zIndex=2)),it.node}function oa(it,at){var ct=at.bgClass?at.bgClass+" "+(at.line.bgClass||""):at.line.bgClass;if(ct&&(ct+=" CodeMirror-linebackground"),at.background)ct?at.background.className=ct:(at.background.parentNode.removeChild(at.background),at.background=null);else if(ct){var dt=ga(at);at.background=dt.insertBefore(Ht("div",null,ct),dt.firstChild),it.display.input.setUneditable(at.background)}}function pa(it,at){var ct=it.display.externalMeasured;return ct&&ct.line==at.line?(it.display.externalMeasured=null,at.measure=ct.measure,ct.built):Be(it,at)}function fi(it,at){var ct=at.text.className,dt=pa(it,at);at.text==at.node&&(at.node=dt.pre),at.text.parentNode.replaceChild(dt.pre,at.text),at.text=dt.pre,dt.bgClass!=at.bgClass||dt.textClass!=at.textClass?(at.bgClass=dt.bgClass,at.textClass=dt.textClass,ar(it,at)):ct&&(at.text.className=ct)}function ar(it,at){oa(it,at),at.line.wrapClass?ga(at).className=at.line.wrapClass:at.node!=at.text&&(at.node.className="");var ct=at.textClass?at.textClass+" "+(at.line.textClass||""):at.line.textClass;at.text.className=ct||""}function _r(it,at,ct,dt){if(at.gutter&&(at.node.removeChild(at.gutter),at.gutter=null),at.gutterBackground&&(at.node.removeChild(at.gutterBackground),at.gutterBackground=null),at.line.gutterClass){var mt=ga(at);at.gutterBackground=Ht("div",null,"CodeMirror-gutter-background "+at.line.gutterClass,"left: "+(it.options.fixedGutter?dt.fixedPos:-dt.gutterTotalWidth)+"px; width: "+dt.gutterTotalWidth+"px"),it.display.input.setUneditable(at.gutterBackground),mt.insertBefore(at.gutterBackground,at.text)}var Ft=at.line.gutterMarkers;if(it.options.lineNumbers||Ft){var It=ga(at),Kt=at.gutter=Ht("div",null,"CodeMirror-gutter-wrapper","left: "+(it.options.fixedGutter?dt.fixedPos:-dt.gutterTotalWidth)+"px");if(it.display.input.setUneditable(Kt),It.insertBefore(Kt,at.text),at.line.gutterClass&&(Kt.className+=" "+at.line.gutterClass),it.options.lineNumbers&&(!Ft||!Ft["CodeMirror-linenumbers"])&&(at.lineNumber=Kt.appendChild(Ht("div",Mn(it.options,ct),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+dt.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+it.display.lineNumInnerWidth+"px"))),Ft)for(var Wt=0;Wt<it.display.gutterSpecs.length;++Wt){var le=it.display.gutterSpecs[Wt].className,Ze=Ft.hasOwnProperty(le)&&Ft[le];Ze&&Kt.appendChild(Ht("div",[Ze],"CodeMirror-gutter-elt","left: "+dt.gutterLeft[le]+"px; width: "+dt.gutterWidth[le]+"px"))}}}function to(it,at,ct){at.alignable&&(at.alignable=null);for(var dt=Tt("CodeMirror-linewidget"),mt=at.node.firstChild,Ft=void 0;mt;mt=Ft)Ft=mt.nextSibling,dt.test(mt.className)&&at.node.removeChild(mt);zo(it,at,ct)}function fo(it,at,ct,dt){var mt=pa(it,at);return at.text=at.node=mt.pre,mt.bgClass&&(at.bgClass=mt.bgClass),mt.textClass&&(at.textClass=mt.textClass),ar(it,at),_r(it,at,ct,dt),zo(it,at,dt),at.node}function zo(it,at,ct){if(lr(it,at.line,at,ct,!0),at.rest)for(var dt=0;dt<at.rest.length;dt++)lr(it,at.rest[dt],at,ct,!1)}function lr(it,at,ct,dt,mt){if(at.widgets)for(var Ft=ga(ct),It=0,Kt=at.widgets;It<Kt.length;++It){var Wt=Kt[It],le=Ht("div",[Wt.node],"CodeMirror-linewidget"+(Wt.className?" "+Wt.className:""));Wt.handleMouseEvents||le.setAttribute("cm-ignore-events","true"),Xa(Wt,le,ct,dt),it.display.input.setUneditable(le),mt&&Wt.above?Ft.insertBefore(le,ct.gutter||ct.text):Ft.appendChild(le),nr(Wt,"redraw")}}function Xa(it,at,ct,dt){if(it.noHScroll){(ct.alignable||(ct.alignable=[])).push(at);var mt=dt.wrapperWidth;at.style.left=dt.fixedPos+"px",it.coverGutter||(mt-=dt.gutterTotalWidth,at.style.paddingLeft=dt.gutterTotalWidth+"px"),at.style.width=mt+"px"}it.coverGutter&&(at.style.zIndex=5,at.style.position="relative",it.noHScroll||(at.style.marginLeft=-dt.gutterTotalWidth+"px"))}function fa(it){if(it.height!=null)return it.height;var at=it.doc.cm;if(!at)return 0;if(!Ne(document.body,it.node)){var ct="position: relative;";it.coverGutter&&(ct+="margin-left: -"+at.display.gutters.offsetWidth+"px;"),it.noHScroll&&(ct+="width: "+at.display.wrapper.clientWidth+"px;"),Xt(at.display.measure,Ht("div",[it.node],null,ct))}return it.height=it.node.parentNode.offsetHeight}function Uo(it,at){for(var ct=Gi(at);ct!=it.wrapper;ct=ct.parentNode)if(!ct||ct.nodeType==1&&ct.getAttribute("cm-ignore-events")=="true"||ct.parentNode==it.sizer&&ct!=it.mover)return!0}function lo(it){return it.lineSpace.offsetTop}function Pa(it){return it.mover.offsetHeight-it.lineSpace.offsetHeight}function is(it){if(it.cachedPaddingH)return it.cachedPaddingH;var at=Xt(it.measure,Ht("pre","x","CodeMirror-line-like")),ct=window.getComputedStyle?window.getComputedStyle(at):at.currentStyle,dt={left:parseInt(ct.paddingLeft),right:parseInt(ct.paddingRight)};return!isNaN(dt.left)&&!isNaN(dt.right)&&(it.cachedPaddingH=dt),dt}function Qo(it){return Gn-it.display.nativeBarWidth}function ps(it){return it.display.scroller.clientWidth-Qo(it)-it.display.barWidth}function ms(it){return it.display.scroller.clientHeight-Qo(it)-it.display.barHeight}function zs(it,at,ct){var dt=it.options.lineWrapping,mt=dt&&ps(it);if(!at.measure.heights||dt&&at.measure.width!=mt){var Ft=at.measure.heights=[];if(dt){at.measure.width=mt;for(var It=at.text.firstChild.getClientRects(),Kt=0;Kt<It.length-1;Kt++){var Wt=It[Kt],le=It[Kt+1];Math.abs(Wt.bottom-le.bottom)>2&&Ft.push((Wt.bottom+le.top)/2-ct.top)}}Ft.push(ct.bottom-ct.top)}}function Fa(it,at,ct){if(it.line==at)return{map:it.measure.map,cache:it.measure.cache};for(var dt=0;dt<it.rest.length;dt++)if(it.rest[dt]==at)return{map:it.measure.maps[dt],cache:it.measure.caches[dt]};for(var mt=0;mt<it.rest.length;mt++)if(Gt(it.rest[mt])>ct)return{map:it.measure.maps[mt],cache:it.measure.caches[mt],before:!0}}function Ru(it,at){at=Dn(at);var ct=Gt(at),dt=it.display.externalMeasured=new Lo(it.doc,at,ct);dt.lineN=ct;var mt=dt.built=Be(it,dt);return dt.text=mt.pre,Xt(it.display.lineMeasure,mt.pre),dt}function Lu(it,at,ct,dt){return Gs(it,Al(it,at),ct,dt)}function Zs(it,at){if(at>=it.display.viewFrom&&at<it.display.viewTo)return it.display.view[Wi(it,at)];var ct=it.display.externalMeasured;if(ct&&at>=ct.lineN&&at<ct.lineN+ct.size)return ct}function Al(it,at){var ct=Gt(at),dt=Zs(it,ct);dt&&!dt.text?dt=null:dt&&dt.changes&&(ta(it,dt,ct,po(it)),it.curOp.forceUpdate=!0),dt||(dt=Ru(it,at));var mt=Fa(dt,at,ct);return{line:at,view:dt,rect:null,map:mt.map,cache:mt.cache,before:mt.before,hasHeights:!1}}function Gs(it,at,ct,dt,mt){at.before&&(ct=-1);var Ft=ct+(dt||""),It;return at.cache.hasOwnProperty(Ft)?It=at.cache[Ft]:(at.rect||(at.rect=at.view.text.getBoundingClientRect()),at.hasHeights||(zs(it,at.view,at.rect),at.hasHeights=!0),It=wa(it,at,ct,dt),It.bogus||(at.cache[Ft]=It)),{left:It.left,right:It.right,top:mt?It.rtop:It.top,bottom:mt?It.rbottom:It.bottom}}var Ul={left:0,right:0,top:0,bottom:0};function hu(it,at,ct){for(var dt,mt,Ft,It,Kt,Wt,le=0;le<it.length;le+=3)if(Kt=it[le],Wt=it[le+1],at<Kt?(mt=0,Ft=1,It="left"):at<Wt?(mt=at-Kt,Ft=mt+1):(le==it.length-3||at==Wt&&it[le+3]>at)&&(Ft=Wt-Kt,mt=Ft-1,at>=Wt&&(It="right")),mt!=null){if(dt=it[le+2],Kt==Wt&&ct==(dt.insertLeft?"left":"right")&&(It=ct),ct=="left"&&mt==0)for(;le&&it[le-2]==it[le-3]&&it[le-1].insertLeft;)dt=it[(le-=3)+2],It="left";if(ct=="right"&&mt==Wt-Kt)for(;le<it.length-3&&it[le+3]==it[le+4]&&!it[le+5].insertLeft;)dt=it[(le+=3)+2],It="right";break}return{node:dt,start:mt,end:Ft,collapse:It,coverStart:Kt,coverEnd:Wt}}function Fu(it,at){var ct=Ul;if(at=="left")for(var dt=0;dt<it.length&&(ct=it[dt]).left==ct.right;dt++);else for(var mt=it.length-1;mt>=0&&(ct=it[mt]).left==ct.right;mt--);return ct}function wa(it,at,ct,dt){var mt=hu(at.map,ct,dt),Ft=mt.node,It=mt.start,Kt=mt.end,Wt=mt.collapse,le;if(Ft.nodeType==3){for(var Ze=0;Ze<4;Ze++){for(;It&&Ge(at.line.text.charAt(mt.coverStart+It));)--It;for(;mt.coverStart+Kt<mt.coverEnd&&Ge(at.line.text.charAt(mt.coverStart+Kt));)++Kt;if(he&&Dt<9&&It==0&&Kt==mt.coverEnd-mt.coverStart?le=Ft.parentNode.getBoundingClientRect():le=Fu(ie(Ft,It,Kt).getClientRects(),dt),le.left||le.right||It==0)break;Kt=It,It=It-1,Wt="right"}he&&Dt<11&&(le=sl(it.display.measure,le))}else{It>0&&(Wt=dt="right");var ge;it.options.lineWrapping&&(ge=Ft.getClientRects()).length>1?le=ge[dt=="right"?ge.length-1:0]:le=Ft.getBoundingClientRect()}if(he&&Dt<9&&!It&&(!le||!le.left&&!le.right)){var Sn=Ft.parentNode.getClientRects()[0];Sn?le={left:Sn.left,right:Sn.left+Pr(it.display),top:Sn.top,bottom:Sn.bottom}:le=Ul}for(var hn=le.top-at.rect.top,xi=le.bottom-at.rect.top,Fi=(hn+xi)/2,Ri=at.view.measure.heights,rr=0;rr<Ri.length-1&&!(Fi<Ri[rr]);rr++);var Zr=rr?Ri[rr-1]:0,xr=Ri[rr],Ur={left:(Wt=="right"?le.right:le.left)-at.rect.left,right:(Wt=="left"?le.left:le.right)-at.rect.left,top:Zr,bottom:xr};return!le.left&&!le.right&&(Ur.bogus=!0),it.options.singleCursorHeightPerLine||(Ur.rtop=hn,Ur.rbottom=xi),Ur}function sl(it,at){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!Ai(it))return at;var ct=screen.logicalXDPI/screen.deviceXDPI,dt=screen.logicalYDPI/screen.deviceYDPI;return{left:at.left*ct,right:at.right*ct,top:at.top*dt,bottom:at.bottom*dt}}function ju(it){if(it.measure&&(it.measure.cache={},it.measure.heights=null,it.rest))for(var at=0;at<it.rest.length;at++)it.measure.caches[at]={}}function Yl(it){it.display.externalMeasure=null,$t(it.display.lineMeasure);for(var at=0;at<it.display.view.length;at++)ju(it.display.view[at])}function du(it){Yl(it),it.display.cachedCharWidth=it.display.cachedTextHeight=it.display.cachedPaddingH=null,it.options.lineWrapping||(it.display.maxLineChanged=!0),it.display.lineNumChars=null}function Ja(){return ne&&nt?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function Qa(){return ne&&nt?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function Ba(it){var at=0;if(it.widgets)for(var ct=0;ct<it.widgets.length;++ct)it.widgets[ct].above&&(at+=fa(it.widgets[ct]));return at}function Ga(it,at,ct,dt,mt){if(!mt){var Ft=Ba(at);ct.top+=Ft,ct.bottom+=Ft}if(dt=="line")return ct;dt||(dt="local");var It=Ui(at);if(dt=="local"?It+=lo(it.display):It-=it.display.viewOffset,dt=="page"||dt=="window"){var Kt=it.display.lineSpace.getBoundingClientRect();It+=Kt.top+(dt=="window"?0:Qa());var Wt=Kt.left+(dt=="window"?0:Ja());ct.left+=Wt,ct.right+=Wt}return ct.top+=It,ct.bottom+=It,ct}function Tl(it,at,ct){if(ct=="div")return at;var dt=at.left,mt=at.top;if(ct=="page")dt-=Ja(),mt-=Qa();else if(ct=="local"||!ct){var Ft=it.display.sizer.getBoundingClientRect();dt+=Ft.left,mt+=Ft.top}var It=it.display.lineSpace.getBoundingClientRect();return{left:dt-It.left,top:mt-It.top}}function ma(it,at,ct,dt,mt){return dt||(dt=An(it.doc,at.line)),Ga(it,dt,Lu(it,dt,at.ch,mt),ct)}function Ro(it,at,ct,dt,mt,Ft){dt=dt||An(it.doc,at.line),mt||(mt=Al(it,dt));function It(xi,Fi){var Ri=Gs(it,mt,xi,Fi?"right":"left",Ft);return Fi?Ri.left=Ri.right:Ri.right=Ri.left,Ga(it,dt,Ri,ct)}var Kt=qe(dt,it.doc.direction),Wt=at.ch,le=at.sticky;if(Wt>=dt.text.length?(Wt=dt.text.length,le="before"):Wt<=0&&(Wt=0,le="after"),!Kt)return It(le=="before"?Wt-1:Wt,le=="before");function Ze(xi,Fi,Ri){var rr=Kt[Fi],Zr=rr.level==1;return It(Ri?xi-1:xi,Zr!=Ri)}var ge=Fe(Kt,Wt,le),Sn=Ee,hn=Ze(Wt,ge,le=="before");return Sn!=null&&(hn.other=Ze(Wt,Sn,le!="before")),hn}function wo(it,at){var ct=0;at=ei(it.doc,at),it.options.lineWrapping||(ct=Pr(it.display)*at.ch);var dt=An(it.doc,at.line),mt=Ui(dt)+lo(it.display);return{left:ct,right:ct,top:mt,bottom:mt+dt.height}}function Do(it,at,ct,dt,mt){var Ft=Ie(it,at,ct);return Ft.xRel=mt,dt&&(Ft.outside=dt),Ft}function Aa(it,at,ct){var dt=it.doc;if(ct+=it.display.viewOffset,ct<0)return Do(dt.first,0,null,-1,-1);var mt=de(dt,ct),Ft=dt.first+dt.size-1;if(mt>Ft)return Do(dt.first+dt.size-1,An(dt,Ft).text.length,null,1,1);at<0&&(at=0);for(var It=An(dt,mt);;){var Kt=fe(it,It,mt,at,ct),Wt=Un(It,Kt.ch+(Kt.xRel>0||Kt.outside>0?1:0));if(!Wt)return Kt;var le=Wt.find(1);if(le.line==mt)return le;It=An(dt,mt=le.line)}}function ae(it,at,ct,dt){dt-=Ba(at);var mt=at.text.length,Ft=Ue(function(It){return Gs(it,ct,It-1).bottom<=dt},mt,0);return mt=Ue(function(It){return Gs(it,ct,It).top>dt},Ft,mt),{begin:Ft,end:mt}}function Re(it,at,ct,dt){ct||(ct=Al(it,at));var mt=Ga(it,at,Gs(it,ct,dt),"line").top;return ae(it,at,ct,mt)}function _t(it,at,ct,dt){return it.bottom<=ct?!1:it.top>ct?!0:(dt?it.left:it.right)>at}function fe(it,at,ct,dt,mt){mt-=Ui(at);var Ft=Al(it,at),It=Ba(at),Kt=0,Wt=at.text.length,le=!0,Ze=qe(at,it.doc.direction);if(Ze){var ge=(it.options.lineWrapping?mr:zr)(it,at,ct,Ft,Ze,dt,mt);le=ge.level!=1,Kt=le?ge.from:ge.to-1,Wt=le?ge.to:ge.from-1}var Sn=null,hn=null,xi=Ue(function(Eo){var vr=Gs(it,Ft,Eo);return vr.top+=It,vr.bottom+=It,_t(vr,dt,mt,!1)?(vr.top<=mt&&vr.left<=dt&&(Sn=Eo,hn=vr),!0):!1},Kt,Wt),Fi,Ri,rr=!1;if(hn){var Zr=dt-hn.left<hn.right-dt,xr=Zr==le;xi=Sn+(xr?0:1),Ri=xr?"after":"before",Fi=Zr?hn.left:hn.right}else{!le&&(xi==Wt||xi==Kt)&&xi++,Ri=xi==0?"after":xi==at.text.length?"before":Gs(it,Ft,xi-(le?1:0)).bottom+It<=mt==le?"after":"before";var Ur=Ro(it,Ie(ct,xi,Ri),"line",at,Ft);Fi=Ur.left,rr=mt<Ur.top?-1:mt>=Ur.bottom?1:0}return xi=De(at.text,xi,1),Do(ct,xi,Ri,rr,dt-Fi)}function zr(it,at,ct,dt,mt,Ft,It){var Kt=Ue(function(ge){var Sn=mt[ge],hn=Sn.level!=1;return _t(Ro(it,Ie(ct,hn?Sn.to:Sn.from,hn?"before":"after"),"line",at,dt),Ft,It,!0)},0,mt.length-1),Wt=mt[Kt];if(Kt>0){var le=Wt.level!=1,Ze=Ro(it,Ie(ct,le?Wt.from:Wt.to,le?"after":"before"),"line",at,dt);_t(Ze,Ft,It,!0)&&Ze.top>It&&(Wt=mt[Kt-1])}return Wt}function mr(it,at,ct,dt,mt,Ft,It){var Kt=ae(it,at,dt,It),Wt=Kt.begin,le=Kt.end;/\s/.test(at.text.charAt(le-1))&&le--;for(var Ze=null,ge=null,Sn=0;Sn<mt.length;Sn++){var hn=mt[Sn];if(!(hn.from>=le||hn.to<=Wt)){var xi=hn.level!=1,Fi=Gs(it,dt,xi?Math.min(le,hn.to)-1:Math.max(Wt,hn.from)).right,Ri=Fi<Ft?Ft-Fi+1e9:Fi-Ft;(!Ze||ge>Ri)&&(Ze=hn,ge=Ri)}}return Ze||(Ze=mt[mt.length-1]),Ze.from<Wt&&(Ze={from:Wt,to:Ze.to,level:Ze.level}),Ze.to>le&&(Ze={from:Ze.from,to:le,level:Ze.level}),Ze}var Fr;function sr(it){if(it.cachedTextHeight!=null)return it.cachedTextHeight;if(Fr==null){Fr=Ht("pre",null,"CodeMirror-line-like");for(var at=0;at<49;++at)Fr.appendChild(document.createTextNode("x")),Fr.appendChild(Ht("br"));Fr.appendChild(document.createTextNode("x"))}Xt(it.measure,Fr);var ct=Fr.offsetHeight/50;return ct>3&&(it.cachedTextHeight=ct),$t(it.measure),ct||1}function Pr(it){if(it.cachedCharWidth!=null)return it.cachedCharWidth;var at=Ht("span","xxxxxxxxxx"),ct=Ht("pre",[at],"CodeMirror-line-like");Xt(it.measure,ct);var dt=at.getBoundingClientRect(),mt=(dt.right-dt.left)/10;return mt>2&&(it.cachedCharWidth=mt),mt||10}function po(it){for(var at=it.display,ct={},dt={},mt=at.gutters.clientLeft,Ft=at.gutters.firstChild,It=0;Ft;Ft=Ft.nextSibling,++It){var Kt=it.display.gutterSpecs[It].className;ct[Kt]=Ft.offsetLeft+Ft.clientLeft+mt,dt[Kt]=Ft.clientWidth}return{fixedPos:Xr(at),gutterTotalWidth:at.gutters.offsetWidth,gutterLeft:ct,gutterWidth:dt,wrapperWidth:at.wrapper.clientWidth}}function Xr(it){return it.scroller.getBoundingClientRect().left-it.sizer.getBoundingClientRect().left}function Dr(it){var at=sr(it.display),ct=it.options.lineWrapping,dt=ct&&Math.max(5,it.display.scroller.clientWidth/Pr(it.display)-3);return function(mt){if(on(it.doc,mt))return 0;var Ft=0;if(mt.widgets)for(var It=0;It<mt.widgets.length;It++)mt.widgets[It].height&&(Ft+=mt.widgets[It].height);return ct?Ft+(Math.ceil(mt.text.length/dt)||1)*at:Ft+at}}function Ki(it){var at=it.doc,ct=Dr(it);at.iter(function(dt){var mt=ct(dt);mt!=dt.height&&Xi(dt,mt)})}function no(it,at,ct,dt){var mt=it.display;if(!ct&&Gi(at).getAttribute("cm-not-content")=="true")return null;var Ft,It,Kt=mt.lineSpace.getBoundingClientRect();try{Ft=at.clientX-Kt.left,It=at.clientY-Kt.top}catch(ge){return null}var Wt=Aa(it,Ft,It),le;if(dt&&Wt.xRel>0&&(le=An(it.doc,Wt.line).text).length==Wt.ch){var Ze=re(le,le.length,it.options.tabSize)-le.length;Wt=Ie(Wt.line,Math.max(0,Math.round((Ft-is(it.display).left)/Pr(it.display))-Ze))}return Wt}function Wi(it,at){if(at>=it.display.viewTo||(at-=it.display.viewFrom,at<0))return null;for(var ct=it.display.view,dt=0;dt<ct.length;dt++)if(at-=ct[dt].size,at<0)return dt}function ir(it,at,ct,dt){at==null&&(at=it.doc.first),ct==null&&(ct=it.doc.first+it.doc.size),dt||(dt=0);var mt=it.display;if(dt&&ct<mt.viewTo&&(mt.updateLineNumbers==null||mt.updateLineNumbers>at)&&(mt.updateLineNumbers=at),it.curOp.viewChanged=!0,at>=mt.viewTo)fn&&mi(it.doc,at)<mt.viewTo&&Mr(it);else if(ct<=mt.viewFrom)fn&&ii(it.doc,ct+dt)>mt.viewFrom?Mr(it):(mt.viewFrom+=dt,mt.viewTo+=dt);else if(at<=mt.viewFrom&&ct>=mt.viewTo)Mr(it);else if(at<=mt.viewFrom){var Ft=Lr(it,ct,ct+dt,1);Ft?(mt.view=mt.view.slice(Ft.index),mt.viewFrom=Ft.lineN,mt.viewTo+=dt):Mr(it)}else if(ct>=mt.viewTo){var It=Lr(it,at,at,-1);It?(mt.view=mt.view.slice(0,It.index),mt.viewTo=It.lineN):Mr(it)}else{var Kt=Lr(it,at,at,-1),Wt=Lr(it,ct,ct+dt,1);Kt&&Wt?(mt.view=mt.view.slice(0,Kt.index).concat(Rr(it,Kt.lineN,Wt.lineN)).concat(mt.view.slice(Wt.index)),mt.viewTo+=dt):Mr(it)}var le=mt.externalMeasured;le&&(ct<le.lineN?le.lineN+=dt:at<le.lineN+le.size&&(mt.externalMeasured=null))}function Ji(it,at,ct){it.curOp.viewChanged=!0;var dt=it.display,mt=it.display.externalMeasured;if(mt&&at>=mt.lineN&&at<mt.lineN+mt.size&&(dt.externalMeasured=null),!(at<dt.viewFrom||at>=dt.viewTo)){var Ft=dt.view[Wi(it,at)];if(Ft.node!=null){var It=Ft.changes||(Ft.changes=[]);Ye(It,ct)==-1&&It.push(ct)}}}function Mr(it){it.display.viewFrom=it.display.viewTo=it.doc.first,it.display.view=[],it.display.viewOffset=0}function Lr(it,at,ct,dt){var mt=Wi(it,at),Ft,It=it.display.view;if(!fn||ct==it.doc.first+it.doc.size)return{index:mt,lineN:ct};for(var Kt=it.display.viewFrom,Wt=0;Wt<mt;Wt++)Kt+=It[Wt].size;if(Kt!=at){if(dt>0){if(mt==It.length-1)return null;Ft=Kt+It[mt].size-at,mt++}else Ft=Kt-at;at+=Ft,ct+=Ft}for(;mi(it.doc,ct)!=ct;){if(mt==(dt<0?0:It.length-1))return null;ct+=dt*It[mt-(dt<0?1:0)].size,mt+=dt}return{index:mt,lineN:ct}}function Br(it,at,ct){var dt=it.display,mt=dt.view;mt.length==0||at>=dt.viewTo||ct<=dt.viewFrom?(dt.view=Rr(it,at,ct),dt.viewFrom=at):(dt.viewFrom>at?dt.view=Rr(it,at,dt.viewFrom).concat(dt.view):dt.viewFrom<at&&(dt.view=dt.view.slice(Wi(it,at))),dt.viewFrom=at,dt.viewTo<ct?dt.view=dt.view.concat(Rr(it,dt.viewTo,ct)):dt.viewTo>ct&&(dt.view=dt.view.slice(0,Wi(it,ct)))),dt.viewTo=ct}function io(it){for(var at=it.display.view,ct=0,dt=0;dt<at.length;dt++){var mt=at[dt];!mt.hidden&&(!mt.node||mt.changes)&&++ct}return ct}function Zi(it){it.display.input.showSelection(it.display.input.prepareSelection())}function Sr(it,at){at===void 0&&(at=!0);for(var ct=it.doc,dt={},mt=dt.cursors=document.createDocumentFragment(),Ft=dt.selection=document.createDocumentFragment(),It=0;It<ct.sel.ranges.length;It++)if(!(!at&&It==ct.sel.primIndex)){var Kt=ct.sel.ranges[It];if(!(Kt.from().line>=it.display.viewTo||Kt.to().line<it.display.viewFrom)){var Wt=Kt.empty();(Wt||it.options.showCursorWhenSelecting)&&Li(it,Kt.head,mt),Wt||wr(it,Kt,Ft)}}return dt}function Li(it,at,ct){var dt=Ro(it,at,"div",null,null,!it.options.singleCursorHeightPerLine),mt=ct.appendChild(Ht("div","\xA0","CodeMirror-cursor"));if(mt.style.left=dt.left+"px",mt.style.top=dt.top+"px",mt.style.height=Math.max(0,dt.bottom-dt.top)*it.options.cursorHeight+"px",dt.other){var Ft=ct.appendChild(Ht("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));Ft.style.display="",Ft.style.left=dt.other.left+"px",Ft.style.top=dt.other.top+"px",Ft.style.height=(dt.other.bottom-dt.other.top)*.85+"px"}}function Qi(it,at){return it.top-at.top||it.left-at.left}function wr(it,at,ct){var dt=it.display,mt=it.doc,Ft=document.createDocumentFragment(),It=is(it.display),Kt=It.left,Wt=Math.max(dt.sizerWidth,ps(it)-dt.sizer.offsetLeft)-It.right,le=mt.direction=="ltr";function Ze(xr,Ur,Eo,vr){Ur<0&&(Ur=0),Ur=Math.round(Ur),vr=Math.round(vr),Ft.appendChild(Ht("div",null,"CodeMirror-selected","position: absolute; left: "+xr+`px;
|
|
top: `+Ur+"px; width: "+(Eo==null?Wt-xr:Eo)+`px;
|
|
height: `+(vr-Ur)+"px"))}function ge(xr,Ur,Eo){var vr=An(mt,xr),Ho=vr.text.length,Ma,ds;function ja(as,Cl){return ma(it,Ie(xr,as),"div",vr,Cl)}function fl(as,Cl,Ds){var ss=Re(it,vr,null,as),na=Cl=="ltr"==(Ds=="after")?"left":"right",Va=Ds=="after"?ss.begin:ss.end-(/\s/.test(vr.text.charAt(ss.end-1))?2:1);return ja(Va,na)[na]}var Ws=qe(vr,mt.direction);return we(Ws,Ur||0,Eo==null?Ho:Eo,function(as,Cl,Ds,ss){var na=Ds=="ltr",Va=ja(as,na?"left":"right"),Ps=ja(Cl-1,na?"right":"left"),Os=Ur==null&&as==0,pu=Eo==null&&Cl==Ho,za=ss==0,eu=!Ws||ss==Ws.length-1;if(Ps.top-Va.top<=3){var Ya=(le?Os:pu)&&za,Dc=(le?pu:Os)&&eu,jl=Ya?Kt:(na?Va:Ps).left,El=Dc?Wt:(na?Ps:Va).right;Ze(jl,Va.top,El-jl,Va.bottom)}else{var gl,ya,ws,Wu;na?(gl=le&&Os&&za?Kt:Va.left,ya=le?Wt:fl(as,Ds,"before"),ws=le?Kt:fl(Cl,Ds,"after"),Wu=le&&pu&&eu?Wt:Ps.right):(gl=le?fl(as,Ds,"before"):Kt,ya=!le&&Os&&za?Wt:Va.right,ws=!le&&pu&&eu?Kt:Ps.left,Wu=le?fl(Cl,Ds,"after"):Wt),Ze(gl,Va.top,ya-gl,Va.bottom),Va.bottom<Ps.top&&Ze(Kt,Va.bottom,null,Ps.top),Ze(ws,Ps.top,Wu-ws,Ps.bottom)}(!Ma||Qi(Va,Ma)<0)&&(Ma=Va),Qi(Ps,Ma)<0&&(Ma=Ps),(!ds||Qi(Va,ds)<0)&&(ds=Va),Qi(Ps,ds)<0&&(ds=Ps)}),{start:Ma,end:ds}}var Sn=at.from(),hn=at.to();if(Sn.line==hn.line)ge(Sn.line,Sn.ch,hn.ch);else{var xi=An(mt,Sn.line),Fi=An(mt,hn.line),Ri=Dn(xi)==Dn(Fi),rr=ge(Sn.line,Sn.ch,Ri?xi.text.length+1:null).end,Zr=ge(hn.line,Ri?0:null,hn.ch).start;Ri&&(rr.top<Zr.top-2?(Ze(rr.right,rr.top,null,rr.bottom),Ze(Kt,Zr.top,Zr.left,Zr.bottom)):Ze(rr.right,rr.top,Zr.left-rr.right,rr.bottom)),rr.bottom<Zr.top&&Ze(Kt,rr.bottom,null,Zr.top)}ct.appendChild(Ft)}function ro(it){if(it.state.focused){var at=it.display;clearInterval(at.blinker);var ct=!0;at.cursorDiv.style.visibility="",it.options.cursorBlinkRate>0?at.blinker=setInterval(function(){it.hasFocus()||_a(it),at.cursorDiv.style.visibility=(ct=!ct)?"":"hidden"},it.options.cursorBlinkRate):it.options.cursorBlinkRate<0&&(at.cursorDiv.style.visibility="hidden")}}function So(it){it.state.focused||(it.display.input.focus(),$i(it))}function No(it){it.state.delayingBlurEvent=!0,setTimeout(function(){it.state.delayingBlurEvent&&(it.state.delayingBlurEvent=!1,_a(it))},100)}function $i(it,at){it.state.delayingBlurEvent&&(it.state.delayingBlurEvent=!1),it.options.readOnly!="nocursor"&&(it.state.focused||(Ve(it,"focus",it,at),it.state.focused=!0,Pe(it.display.wrapper,"CodeMirror-focused"),!it.curOp&&it.display.selForContextMenu!=it.doc.sel&&(it.display.input.reset(),qt&&setTimeout(function(){return it.display.input.reset(!0)},20)),it.display.input.receivedFocus()),ro(it))}function _a(it,at){it.state.delayingBlurEvent||(it.state.focused&&(Ve(it,"blur",it,at),it.state.focused=!1,Ot(it.display.wrapper,"CodeMirror-focused")),clearInterval(it.display.blinker),setTimeout(function(){it.state.focused||(it.display.shift=!1)},150))}function or(it){for(var at=it.display,ct=at.lineDiv.offsetTop,dt=0;dt<at.view.length;dt++){var mt=at.view[dt],Ft=it.options.lineWrapping,It=void 0,Kt=0;if(!mt.hidden){if(he&&Dt<8){var Wt=mt.node.offsetTop+mt.node.offsetHeight;It=Wt-ct,ct=Wt}else{var le=mt.node.getBoundingClientRect();It=le.bottom-le.top,!Ft&&mt.text.firstChild&&(Kt=mt.text.firstChild.getBoundingClientRect().right-le.left-1)}var Ze=mt.line.height-It;if((Ze>.005||Ze<-.005)&&(Xi(mt.line,It),Oo(mt.line),mt.rest))for(var ge=0;ge<mt.rest.length;ge++)Oo(mt.rest[ge]);if(Kt>it.display.sizerWidth){var Sn=Math.ceil(Kt/Pr(it.display));Sn>it.display.maxLineLength&&(it.display.maxLineLength=Sn,it.display.maxLine=mt.line,it.display.maxLineChanged=!0)}}}}function Oo(it){if(it.widgets)for(var at=0;at<it.widgets.length;++at){var ct=it.widgets[at],dt=ct.node.parentNode;dt&&(ct.height=dt.offsetHeight)}}function Ar(it,at,ct){var dt=ct&&ct.top!=null?Math.max(0,ct.top):it.scroller.scrollTop;dt=Math.floor(dt-lo(it));var mt=ct&&ct.bottom!=null?ct.bottom:dt+it.wrapper.clientHeight,Ft=de(at,dt),It=de(at,mt);if(ct&&ct.ensure){var Kt=ct.ensure.from.line,Wt=ct.ensure.to.line;Kt<Ft?(Ft=Kt,It=de(at,Ui(An(at,Kt))+it.wrapper.clientHeight)):Math.min(Wt,at.lastLine())>=It&&(Ft=de(at,Ui(An(at,Wt))-it.wrapper.clientHeight),It=Wt)}return{from:Ft,to:Math.max(It,Ft+1)}}function ea(it,at){if(!nn(it,"scrollCursorIntoView")){var ct=it.display,dt=ct.sizer.getBoundingClientRect(),mt=null;if(at.top+dt.top<0?mt=!0:at.bottom+dt.top>(window.innerHeight||document.documentElement.clientHeight)&&(mt=!1),mt!=null&&!Ce){var Ft=Ht("div","\u200B",null,`position: absolute;
|
|
top: `+(at.top-ct.viewOffset-lo(it.display))+`px;
|
|
height: `+(at.bottom-at.top+Qo(it)+ct.barHeight)+`px;
|
|
left: `+at.left+"px; width: "+Math.max(2,at.right-at.left)+"px;");it.display.lineSpace.appendChild(Ft),Ft.scrollIntoView(mt),it.display.lineSpace.removeChild(Ft)}}}function Yo(it,at,ct,dt){dt==null&&(dt=0);var mt;!it.options.lineWrapping&&at==ct&&(at=at.ch?Ie(at.line,at.sticky=="before"?at.ch-1:at.ch,"after"):at,ct=at.sticky=="before"?Ie(at.line,at.ch+1,"before"):at);for(var Ft=0;Ft<5;Ft++){var It=!1,Kt=Ro(it,at),Wt=!ct||ct==at?Kt:Ro(it,ct);mt={left:Math.min(Kt.left,Wt.left),top:Math.min(Kt.top,Wt.top)-dt,right:Math.max(Kt.left,Wt.left),bottom:Math.max(Kt.bottom,Wt.bottom)+dt};var le=ll(it,mt),Ze=it.doc.scrollTop,ge=it.doc.scrollLeft;if(le.scrollTop!=null&&(Qs(it,le.scrollTop),Math.abs(it.doc.scrollTop-Ze)>1&&(It=!0)),le.scrollLeft!=null&&(Jl(it,le.scrollLeft),Math.abs(it.doc.scrollLeft-ge)>1&&(It=!0)),!It)break}return mt}function la(it,at){var ct=ll(it,at);ct.scrollTop!=null&&Qs(it,ct.scrollTop),ct.scrollLeft!=null&&Jl(it,ct.scrollLeft)}function ll(it,at){var ct=it.display,dt=sr(it.display);at.top<0&&(at.top=0);var mt=it.curOp&&it.curOp.scrollTop!=null?it.curOp.scrollTop:ct.scroller.scrollTop,Ft=ms(it),It={};at.bottom-at.top>Ft&&(at.bottom=at.top+Ft);var Kt=it.doc.height+Pa(ct),Wt=at.top<dt,le=at.bottom>Kt-dt;if(at.top<mt)It.scrollTop=Wt?0:at.top;else if(at.bottom>mt+Ft){var Ze=Math.min(at.top,(le?Kt:at.bottom)-Ft);Ze!=mt&&(It.scrollTop=Ze)}var ge=it.options.fixedGutter?0:ct.gutters.offsetWidth,Sn=it.curOp&&it.curOp.scrollLeft!=null?it.curOp.scrollLeft:ct.scroller.scrollLeft-ge,hn=ps(it)-ct.gutters.offsetWidth,xi=at.right-at.left>hn;return xi&&(at.right=at.left+hn),at.left<10?It.scrollLeft=0:at.left<Sn?It.scrollLeft=Math.max(0,at.left+ge-(xi?0:10)):at.right>hn+Sn-3&&(It.scrollLeft=at.right+(xi?0:10)-hn),It}function Xl(it,at){at!=null&&(vs(it),it.curOp.scrollTop=(it.curOp.scrollTop==null?it.doc.scrollTop:it.curOp.scrollTop)+at)}function Js(it){vs(it);var at=it.getCursor();it.curOp.scrollToPos={from:at,to:at,margin:it.options.cursorScrollMargin}}function Dl(it,at,ct){(at!=null||ct!=null)&&vs(it),at!=null&&(it.curOp.scrollLeft=at),ct!=null&&(it.curOp.scrollTop=ct)}function jo(it,at){vs(it),it.curOp.scrollToPos=at}function vs(it){var at=it.curOp.scrollToPos;if(at){it.curOp.scrollToPos=null;var ct=wo(it,at.from),dt=wo(it,at.to);Ol(it,ct,dt,at.margin)}}function Ol(it,at,ct,dt){var mt=ll(it,{left:Math.min(at.left,ct.left),top:Math.min(at.top,ct.top)-dt,right:Math.max(at.right,ct.right),bottom:Math.max(at.bottom,ct.bottom)+dt});Dl(it,mt.scrollLeft,mt.scrollTop)}function Qs(it,at){Math.abs(it.doc.scrollTop-at)<2||(pt||Wr(it,{top:at}),Ph(it,at,!0),pt&&Wr(it),Io(it,100))}function Ph(it,at,ct){at=Math.max(0,Math.min(it.display.scroller.scrollHeight-it.display.scroller.clientHeight,at)),!(it.display.scroller.scrollTop==at&&!ct)&&(it.doc.scrollTop=at,it.display.scrollbars.setScrollTop(at),it.display.scroller.scrollTop!=at&&(it.display.scroller.scrollTop=at))}function Jl(it,at,ct,dt){at=Math.max(0,Math.min(at,it.display.scroller.scrollWidth-it.display.scroller.clientWidth)),!((ct?at==it.doc.scrollLeft:Math.abs(it.doc.scrollLeft-at)<2)&&!dt)&&(it.doc.scrollLeft=at,Ql(it),it.display.scroller.scrollLeft!=at&&(it.display.scroller.scrollLeft=at),it.display.scrollbars.setScrollLeft(at))}function Mo(it){var at=it.display,ct=at.gutters.offsetWidth,dt=Math.round(it.doc.height+Pa(it.display));return{clientHeight:at.scroller.clientHeight,viewHeight:at.wrapper.clientHeight,scrollWidth:at.scroller.scrollWidth,clientWidth:at.scroller.clientWidth,viewWidth:at.wrapper.clientWidth,barLeft:it.options.fixedGutter?ct:0,docHeight:dt,scrollHeight:dt+Qo(it)+at.barHeight,nativeBarWidth:at.nativeBarWidth,gutterWidth:ct}}var Wo=function(it,at,ct){this.cm=ct;var dt=this.vert=Ht("div",[Ht("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),mt=this.horiz=Ht("div",[Ht("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");dt.tabIndex=mt.tabIndex=-1,it(dt),it(mt),gn(dt,"scroll",function(){dt.clientHeight&&at(dt.scrollTop,"vertical")}),gn(mt,"scroll",function(){mt.clientWidth&&at(mt.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,he&&Dt<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Wo.prototype.update=function(it){var at=it.scrollWidth>it.clientWidth+1,ct=it.scrollHeight>it.clientHeight+1,dt=it.nativeBarWidth;if(ct){this.vert.style.display="block",this.vert.style.bottom=at?dt+"px":"0";var mt=it.viewHeight-(at?dt:0);this.vert.firstChild.style.height=Math.max(0,it.scrollHeight-it.clientHeight+mt)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(at){this.horiz.style.display="block",this.horiz.style.right=ct?dt+"px":"0",this.horiz.style.left=it.barLeft+"px";var Ft=it.viewWidth-it.barLeft-(ct?dt:0);this.horiz.firstChild.style.width=Math.max(0,it.scrollWidth-it.clientWidth+Ft)+"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:ct?dt:0,bottom:at?dt:0}},Wo.prototype.setScrollLeft=function(it){this.horiz.scrollLeft!=it&&(this.horiz.scrollLeft=it),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Wo.prototype.setScrollTop=function(it){this.vert.scrollTop!=it&&(this.vert.scrollTop=it),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Wo.prototype.zeroWidthHack=function(){var it=ht&&!se?"12px":"18px";this.horiz.style.height=this.vert.style.width=it,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new Jt,this.disableVert=new Jt},Wo.prototype.enableZeroWidthBar=function(it,at,ct){it.style.pointerEvents="auto";function dt(){var mt=it.getBoundingClientRect(),Ft=ct=="vert"?document.elementFromPoint(mt.right-1,(mt.top+mt.bottom)/2):document.elementFromPoint((mt.right+mt.left)/2,mt.bottom-1);Ft!=it?it.style.pointerEvents="none":at.set(1e3,dt)}at.set(1e3,dt)},Wo.prototype.clear=function(){var it=this.horiz.parentNode;it.removeChild(this.horiz),it.removeChild(this.vert)};var Ca=function(){};Ca.prototype.update=function(){return{bottom:0,right:0}},Ca.prototype.setScrollLeft=function(){},Ca.prototype.setScrollTop=function(){},Ca.prototype.clear=function(){};function rs(it,at){at||(at=Mo(it));var ct=it.display.barWidth,dt=it.display.barHeight;$a(it,at);for(var mt=0;mt<4&&ct!=it.display.barWidth||dt!=it.display.barHeight;mt++)ct!=it.display.barWidth&&it.options.lineWrapping&&or(it),$a(it,Mo(it)),ct=it.display.barWidth,dt=it.display.barHeight}function $a(it,at){var ct=it.display,dt=ct.scrollbars.update(at);ct.sizer.style.paddingRight=(ct.barWidth=dt.right)+"px",ct.sizer.style.paddingBottom=(ct.barHeight=dt.bottom)+"px",ct.heightForcer.style.borderBottom=dt.bottom+"px solid transparent",dt.right&&dt.bottom?(ct.scrollbarFiller.style.display="block",ct.scrollbarFiller.style.height=dt.bottom+"px",ct.scrollbarFiller.style.width=dt.right+"px"):ct.scrollbarFiller.style.display="",dt.bottom&&it.options.coverGutterNextToScrollbar&&it.options.fixedGutter?(ct.gutterFiller.style.display="block",ct.gutterFiller.style.height=dt.bottom+"px",ct.gutterFiller.style.width=at.gutterWidth+"px"):ct.gutterFiller.style.display=""}var cu={native:Wo,null:Ca};function ul(it){it.display.scrollbars&&(it.display.scrollbars.clear(),it.display.scrollbars.addClass&&Ot(it.display.wrapper,it.display.scrollbars.addClass)),it.display.scrollbars=new cu[it.options.scrollbarStyle](function(at){it.display.wrapper.insertBefore(at,it.display.scrollbarFiller),gn(at,"mousedown",function(){it.state.focused&&setTimeout(function(){return it.display.input.focus()},0)}),at.setAttribute("cm-not-content","true")},function(at,ct){ct=="horizontal"?Jl(it,at):Qs(it,at)},it),it.display.scrollbars.addClass&&Pe(it.display.wrapper,it.display.scrollbars.addClass)}var fu=0;function hl(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:++fu},Za(it.curOp)}function Il(it){var at=it.curOp;at&&As(at,function(ct){for(var dt=0;dt<ct.ops.length;dt++)ct.ops[dt].cm.curOp=null;rf(ct)})}function rf(it){for(var at=it.ops,ct=0;ct<at.length;ct++)of(at[ct]);for(var dt=0;dt<at.length;dt++)af(at[dt]);for(var mt=0;mt<at.length;mt++)sf(at[mt]);for(var Ft=0;Ft<at.length;Ft++)Ta(at[Ft]);for(var It=0;It<at.length;It++)Cn(at[It])}function of(it){var at=it.cm,ct=at.display;Bo(at),it.updateMaxLine&&hr(at),it.mustUpdate=it.viewChanged||it.forceUpdate||it.scrollTop!=null||it.scrollToPos&&(it.scrollToPos.from.line<ct.viewFrom||it.scrollToPos.to.line>=ct.viewTo)||ct.maxLineChanged&&at.options.lineWrapping,it.update=it.mustUpdate&&new ia(at,it.mustUpdate&&{top:it.scrollTop,ensure:it.scrollToPos},it.forceUpdate)}function af(it){it.updatedDisplay=it.mustUpdate&&Sl(it.cm,it.update)}function sf(it){var at=it.cm,ct=at.display;it.updatedDisplay&&or(at),it.barMeasure=Mo(at),ct.maxLineChanged&&!at.options.lineWrapping&&(it.adjustWidthTo=Lu(at,ct.maxLine,ct.maxLine.text.length).left+3,at.display.sizerWidth=it.adjustWidthTo,it.barMeasure.scrollWidth=Math.max(ct.scroller.clientWidth,ct.sizer.offsetLeft+it.adjustWidthTo+Qo(at)+at.display.barWidth),it.maxScrollLeft=Math.max(0,ct.sizer.offsetLeft+it.adjustWidthTo-ps(at))),(it.updatedDisplay||it.selectionChanged)&&(it.preparedSelection=ct.input.prepareSelection())}function Ta(it){var at=it.cm;it.adjustWidthTo!=null&&(at.display.sizer.style.minWidth=it.adjustWidthTo+"px",it.maxScrollLeft<at.doc.scrollLeft&&Jl(at,Math.min(at.display.scroller.scrollLeft,it.maxScrollLeft),!0),at.display.maxLineChanged=!1);var ct=it.focus&&it.focus==xe();it.preparedSelection&&at.display.input.showSelection(it.preparedSelection,ct),(it.updatedDisplay||it.startHeight!=at.doc.height)&&rs(at,it.barMeasure),it.updatedDisplay&&Ha(at,it.barMeasure),it.selectionChanged&&ro(at),at.state.focused&&it.updateInput&&at.display.input.reset(it.typing),ct&&So(it.cm)}function Cn(it){var at=it.cm,ct=at.display,dt=at.doc;if(it.updatedDisplay&&Jo(at,it.update),ct.wheelStartX!=null&&(it.scrollTop!=null||it.scrollLeft!=null||it.scrollToPos)&&(ct.wheelStartX=ct.wheelStartY=null),it.scrollTop!=null&&Ph(at,it.scrollTop,it.forceScroll),it.scrollLeft!=null&&Jl(at,it.scrollLeft,!0,!0),it.scrollToPos){var mt=Yo(at,ei(dt,it.scrollToPos.from),ei(dt,it.scrollToPos.to),it.scrollToPos.margin);ea(at,mt)}var Ft=it.maybeHiddenMarkers,It=it.maybeUnhiddenMarkers;if(Ft)for(var Kt=0;Kt<Ft.length;++Kt)Ft[Kt].lines.length||Ve(Ft[Kt],"hide");if(It)for(var Wt=0;Wt<It.length;++Wt)It[Wt].lines.length&&Ve(It[Wt],"unhide");ct.wrapper.offsetHeight&&(dt.scrollTop=at.display.scroller.scrollTop),it.changeObjs&&Ve(at,"changes",at,it.changeObjs),it.update&&it.update.finish()}function Ni(it,at){if(it.curOp)return at();hl(it);try{return at()}finally{Il(it)}}function Gr(it,at){return function(){if(it.curOp)return at.apply(it,arguments);hl(it);try{return at.apply(it,arguments)}finally{Il(it)}}}function ur(it){return function(){if(this.curOp)return it.apply(this,arguments);hl(this);try{return it.apply(this,arguments)}finally{Il(this)}}}function Pi(it){return function(){var at=this.cm;if(!at||at.curOp)return it.apply(this,arguments);hl(at);try{return it.apply(this,arguments)}finally{Il(at)}}}function Io(it,at){it.doc.highlightFrontier<it.display.viewTo&&it.state.highlight.set(at,an(Co,it))}function Co(it){var at=it.doc;if(!(at.highlightFrontier>=it.display.viewTo)){var ct=+new Date+it.options.workTime,dt=$r(it,at.highlightFrontier),mt=[];at.iter(dt.line,Math.min(at.first+at.size,it.display.viewTo+500),function(Ft){if(dt.line>=it.display.viewFrom){var It=Ft.styles,Kt=Ft.text.length>it.options.maxHighlightLength?jn(at.mode,dt.state):null,Wt=gr(it,Ft,dt,!0);Kt&&(dt.state=Kt),Ft.styles=Wt.styles;var le=Ft.styleClasses,Ze=Wt.classes;Ze?Ft.styleClasses=Ze:le&&(Ft.styleClasses=null);for(var ge=!It||It.length!=Ft.styles.length||le!=Ze&&(!le||!Ze||le.bgClass!=Ze.bgClass||le.textClass!=Ze.textClass),Sn=0;!ge&&Sn<It.length;++Sn)ge=It[Sn]!=Ft.styles[Sn];ge&&mt.push(dt.line),Ft.stateAfter=dt.save(),dt.nextLine()}else Ft.text.length<=it.options.maxHighlightLength&&rn(it,Ft.text,dt),Ft.stateAfter=dt.line%5==0?dt.save():null,dt.nextLine();if(+new Date>ct)return Io(it,it.options.workDelay),!0}),at.highlightFrontier=dt.line,at.modeFrontier=Math.max(at.modeFrontier,dt.line),mt.length&&Ni(it,function(){for(var Ft=0;Ft<mt.length;Ft++)Ji(it,mt[Ft],"text")})}}var ia=function(it,at,ct){var dt=it.display;this.viewport=at,this.visible=Ar(dt,it.doc,at),this.editorIsHidden=!dt.wrapper.offsetWidth,this.wrapperHeight=dt.wrapper.clientHeight,this.wrapperWidth=dt.wrapper.clientWidth,this.oldDisplayWidth=ps(it),this.force=ct,this.dims=po(it),this.events=[]};ia.prototype.signal=function(it,at){vn(it,at)&&this.events.push(arguments)},ia.prototype.finish=function(){for(var it=0;it<this.events.length;it++)Ve.apply(null,this.events[it])};function Bo(it){var at=it.display;!at.scrollbarsClipped&&at.scroller.offsetWidth&&(at.nativeBarWidth=at.scroller.offsetWidth-at.scroller.clientWidth,at.heightForcer.style.height=Qo(it)+"px",at.sizer.style.marginBottom=-at.nativeBarWidth+"px",at.sizer.style.borderRightWidth=Qo(it)+"px",at.scrollbarsClipped=!0)}function us(it){if(it.hasFocus())return null;var at=xe();if(!at||!Ne(it.display.lineDiv,at))return null;var ct={activeElt:at};if(window.getSelection){var dt=window.getSelection();dt.anchorNode&&dt.extend&&Ne(it.display.lineDiv,dt.anchorNode)&&(ct.anchorNode=dt.anchorNode,ct.anchorOffset=dt.anchorOffset,ct.focusNode=dt.focusNode,ct.focusOffset=dt.focusOffset)}return ct}function Zo(it){if(!(!it||!it.activeElt||it.activeElt==xe())&&(it.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(it.activeElt.nodeName)&&it.anchorNode&&Ne(document.body,it.anchorNode)&&Ne(document.body,it.focusNode))){var at=window.getSelection(),ct=document.createRange();ct.setEnd(it.anchorNode,it.anchorOffset),ct.collapse(!1),at.removeAllRanges(),at.addRange(ct),at.extend(it.focusNode,it.focusOffset)}}function Sl(it,at){var ct=it.display,dt=it.doc;if(at.editorIsHidden)return Mr(it),!1;if(!at.force&&at.visible.from>=ct.viewFrom&&at.visible.to<=ct.viewTo&&(ct.updateLineNumbers==null||ct.updateLineNumbers>=ct.viewTo)&&ct.renderedView==ct.view&&io(it)==0)return!1;Da(it)&&(Mr(it),at.dims=po(it));var mt=dt.first+dt.size,Ft=Math.max(at.visible.from-it.options.viewportMargin,dt.first),It=Math.min(mt,at.visible.to+it.options.viewportMargin);ct.viewFrom<Ft&&Ft-ct.viewFrom<20&&(Ft=Math.max(dt.first,ct.viewFrom)),ct.viewTo>It&&ct.viewTo-It<20&&(It=Math.min(mt,ct.viewTo)),fn&&(Ft=mi(it.doc,Ft),It=ii(it.doc,It));var Kt=Ft!=ct.viewFrom||It!=ct.viewTo||ct.lastWrapHeight!=at.wrapperHeight||ct.lastWrapWidth!=at.wrapperWidth;Br(it,Ft,It),ct.viewOffset=Ui(An(it.doc,ct.viewFrom)),it.display.mover.style.top=ct.viewOffset+"px";var Wt=io(it);if(!Kt&&Wt==0&&!at.force&&ct.renderedView==ct.view&&(ct.updateLineNumbers==null||ct.updateLineNumbers>=ct.viewTo))return!1;var le=us(it);return Wt>4&&(ct.lineDiv.style.display="none"),dl(it,ct.updateLineNumbers,at.dims),Wt>4&&(ct.lineDiv.style.display=""),ct.renderedView=ct.view,Zo(le),$t(ct.cursorDiv),$t(ct.selectionDiv),ct.gutters.style.height=ct.sizer.style.minHeight=0,Kt&&(ct.lastWrapHeight=at.wrapperHeight,ct.lastWrapWidth=at.wrapperWidth,Io(it,400)),ct.updateLineNumbers=null,!0}function Jo(it,at){for(var ct=at.viewport,dt=!0;;dt=!1){if(!dt||!it.options.lineWrapping||at.oldDisplayWidth==ps(it)){if(ct&&ct.top!=null&&(ct={top:Math.min(it.doc.height+Pa(it.display)-ms(it),ct.top)}),at.visible=Ar(it.display,it.doc,ct),at.visible.from>=it.display.viewFrom&&at.visible.to<=it.display.viewTo)break}else dt&&(at.visible=Ar(it.display,it.doc,ct));if(!Sl(it,at))break;or(it);var mt=Mo(it);Zi(it),rs(it,mt),Ha(it,mt),at.force=!1}at.signal(it,"update",it),(it.display.viewFrom!=it.display.reportedViewFrom||it.display.viewTo!=it.display.reportedViewTo)&&(at.signal(it,"viewportChange",it,it.display.viewFrom,it.display.viewTo),it.display.reportedViewFrom=it.display.viewFrom,it.display.reportedViewTo=it.display.viewTo)}function Wr(it,at){var ct=new ia(it,at);if(Sl(it,ct)){or(it),Jo(it,ct);var dt=Mo(it);Zi(it),rs(it,dt),Ha(it,dt),ct.finish()}}function dl(it,at,ct){var dt=it.display,mt=it.options.lineNumbers,Ft=dt.lineDiv,It=Ft.firstChild;function Kt(xi){var Fi=xi.nextSibling;return qt&&ht&&it.display.currentWheelTarget==xi?xi.style.display="none":xi.parentNode.removeChild(xi),Fi}for(var Wt=dt.view,le=dt.viewFrom,Ze=0;Ze<Wt.length;Ze++){var ge=Wt[Ze];if(!ge.hidden)if(!ge.node||ge.node.parentNode!=Ft){var Sn=fo(it,ge,le,ct);Ft.insertBefore(Sn,It)}else{for(;It!=ge.node;)It=Kt(It);var hn=mt&&at!=null&&at<=le&&ge.lineNumber;ge.changes&&(Ye(ge.changes,"gutter")>-1&&(hn=!1),ta(it,ge,le,ct)),hn&&($t(ge.lineNumber),ge.lineNumber.appendChild(document.createTextNode(Mn(it.options,le)))),It=ge.node.nextSibling}le+=ge.size}for(;It;)It=Kt(It)}function ys(it){var at=it.gutters.offsetWidth;it.sizer.style.marginLeft=at+"px"}function Ha(it,at){it.display.sizer.style.minHeight=at.docHeight+"px",it.display.heightForcer.style.top=at.docHeight+"px",it.display.gutters.style.height=at.docHeight+it.display.barHeight+Qo(it)+"px"}function Ql(it){var at=it.display,ct=at.view;if(!(!at.alignWidgets&&(!at.gutters.firstChild||!it.options.fixedGutter))){for(var dt=Xr(at)-at.scroller.scrollLeft+it.doc.scrollLeft,mt=at.gutters.offsetWidth,Ft=dt+"px",It=0;It<ct.length;It++)if(!ct[It].hidden){it.options.fixedGutter&&(ct[It].gutter&&(ct[It].gutter.style.left=Ft),ct[It].gutterBackground&&(ct[It].gutterBackground.style.left=Ft));var Kt=ct[It].alignable;if(Kt)for(var Wt=0;Wt<Kt.length;Wt++)Kt[Wt].style.left=Ft}it.options.fixedGutter&&(at.gutters.style.left=dt+mt+"px")}}function Da(it){if(!it.options.lineNumbers)return!1;var at=it.doc,ct=Mn(it.options,at.first+at.size-1),dt=it.display;if(ct.length!=dt.lineNumChars){var mt=dt.measure.appendChild(Ht("div",[Ht("div",ct)],"CodeMirror-linenumber CodeMirror-gutter-elt")),Ft=mt.firstChild.offsetWidth,It=mt.offsetWidth-Ft;return dt.lineGutter.style.width="",dt.lineNumInnerWidth=Math.max(Ft,dt.lineGutter.offsetWidth-It)+1,dt.lineNumWidth=dt.lineNumInnerWidth+It,dt.lineNumChars=dt.lineNumInnerWidth?ct.length:-1,dt.lineGutter.style.width=dt.lineNumWidth+"px",ys(it.display),!0}return!1}function Wa(it,at){for(var ct=[],dt=!1,mt=0;mt<it.length;mt++){var Ft=it[mt],It=null;if(typeof Ft!="string"&&(It=Ft.style,Ft=Ft.className),Ft=="CodeMirror-linenumbers")if(at)dt=!0;else continue;ct.push({className:Ft,style:It})}return at&&!dt&&ct.push({className:"CodeMirror-linenumbers",style:null}),ct}function $s(it){var at=it.gutters,ct=it.gutterSpecs;$t(at),it.lineGutter=null;for(var dt=0;dt<ct.length;++dt){var mt=ct[dt],Ft=mt.className,It=mt.style,Kt=at.appendChild(Ht("div",null,"CodeMirror-gutter "+Ft));It&&(Kt.style.cssText=It),Ft=="CodeMirror-linenumbers"&&(it.lineGutter=Kt,Kt.style.width=(it.lineNumWidth||1)+"px")}at.style.display=ct.length?"":"none",ys(it)}function Ss(it){$s(it.display),ir(it),Ql(it)}function wh(it,at,ct,dt){var mt=this;this.input=ct,mt.scrollbarFiller=Ht("div",null,"CodeMirror-scrollbar-filler"),mt.scrollbarFiller.setAttribute("cm-not-content","true"),mt.gutterFiller=Ht("div",null,"CodeMirror-gutter-filler"),mt.gutterFiller.setAttribute("cm-not-content","true"),mt.lineDiv=ve("div",null,"CodeMirror-code"),mt.selectionDiv=Ht("div",null,null,"position: relative; z-index: 1"),mt.cursorDiv=Ht("div",null,"CodeMirror-cursors"),mt.measure=Ht("div",null,"CodeMirror-measure"),mt.lineMeasure=Ht("div",null,"CodeMirror-measure"),mt.lineSpace=ve("div",[mt.measure,mt.lineMeasure,mt.selectionDiv,mt.cursorDiv,mt.lineDiv],null,"position: relative; outline: none");var Ft=ve("div",[mt.lineSpace],"CodeMirror-lines");mt.mover=Ht("div",[Ft],null,"position: relative"),mt.sizer=Ht("div",[mt.mover],"CodeMirror-sizer"),mt.sizerWidth=null,mt.heightForcer=Ht("div",null,null,"position: absolute; height: "+Gn+"px; width: 1px;"),mt.gutters=Ht("div",null,"CodeMirror-gutters"),mt.lineGutter=null,mt.scroller=Ht("div",[mt.sizer,mt.heightForcer,mt.gutters],"CodeMirror-scroll"),mt.scroller.setAttribute("tabIndex","-1"),mt.wrapper=Ht("div",[mt.scrollbarFiller,mt.gutterFiller,mt.scroller],"CodeMirror"),he&&Dt<8&&(mt.gutters.style.zIndex=-1,mt.scroller.style.paddingRight=0),!qt&&!(pt&&et)&&(mt.scroller.draggable=!0),it&&(it.appendChild?it.appendChild(mt.wrapper):it(mt.wrapper)),mt.viewFrom=mt.viewTo=at.first,mt.reportedViewFrom=mt.reportedViewTo=at.first,mt.view=[],mt.renderedView=null,mt.externalMeasured=null,mt.viewOffset=0,mt.lastWrapHeight=mt.lastWrapWidth=0,mt.updateLineNumbers=null,mt.nativeBarWidth=mt.barHeight=mt.barWidth=0,mt.scrollbarsClipped=!1,mt.lineNumWidth=mt.lineNumInnerWidth=mt.lineNumChars=null,mt.alignWidgets=!1,mt.cachedCharWidth=mt.cachedTextHeight=mt.cachedPaddingH=null,mt.maxLine=null,mt.maxLineLength=0,mt.maxLineChanged=!1,mt.wheelDX=mt.wheelDY=mt.wheelStartX=mt.wheelStartY=null,mt.shift=!1,mt.selForContextMenu=null,mt.activeTouch=null,mt.gutterSpecs=Wa(dt.gutters,dt.lineNumbers),$s(mt),ct.init(mt)}var xl=0,qa=null;he?qa=-.53:pt?qa=15:ne?qa=-.7:Te&&(qa=-1/3);function Mu(it){var at=it.wheelDeltaX,ct=it.wheelDeltaY;return at==null&&it.detail&&it.axis==it.HORIZONTAL_AXIS&&(at=it.detail),ct==null&&it.detail&&it.axis==it.VERTICAL_AXIS?ct=it.detail:ct==null&&(ct=it.wheelDelta),{x:at,y:ct}}function _l(it){var at=Mu(it);return at.x*=qa,at.y*=qa,at}function xs(it,at){var ct=Mu(at),dt=ct.x,mt=ct.y,Ft=it.display,It=Ft.scroller,Kt=It.scrollWidth>It.clientWidth,Wt=It.scrollHeight>It.clientHeight;if(dt&&Kt||mt&&Wt){if(mt&&ht&&qt){t:for(var le=at.target,Ze=Ft.view;le!=It;le=le.parentNode)for(var ge=0;ge<Ze.length;ge++)if(Ze[ge].node==le){it.display.currentWheelTarget=le;break t}}if(dt&&!pt&&!jt&&qa!=null){mt&&Wt&&Qs(it,Math.max(0,It.scrollTop+mt*qa)),Jl(it,Math.max(0,It.scrollLeft+dt*qa)),(!mt||mt&&Wt)&&Rn(at),Ft.wheelStartX=null;return}if(mt&&qa!=null){var Sn=mt*qa,hn=it.doc.scrollTop,xi=hn+Ft.wrapper.clientHeight;Sn<0?hn=Math.max(0,hn+Sn-50):xi=Math.min(it.doc.height,xi+Sn+50),Wr(it,{top:hn,bottom:xi})}xl<20&&(Ft.wheelStartX==null?(Ft.wheelStartX=It.scrollLeft,Ft.wheelStartY=It.scrollTop,Ft.wheelDX=dt,Ft.wheelDY=mt,setTimeout(function(){if(Ft.wheelStartX!=null){var Fi=It.scrollLeft-Ft.wheelStartX,Ri=It.scrollTop-Ft.wheelStartY,rr=Ri&&Ft.wheelDY&&Ri/Ft.wheelDY||Fi&&Ft.wheelDX&&Fi/Ft.wheelDX;Ft.wheelStartX=Ft.wheelStartY=null,rr&&(qa=(qa*xl+rr)/(xl+1),++xl)}},200)):(Ft.wheelDX+=dt,Ft.wheelDY+=mt))}}var $l=function(it,at){this.ranges=it,this.primIndex=at};$l.prototype.primary=function(){return this.ranges[this.primIndex]},$l.prototype.equals=function(it){if(it==this)return!0;if(it.primIndex!=this.primIndex||it.ranges.length!=this.ranges.length)return!1;for(var at=0;at<this.ranges.length;at++){var ct=this.ranges[at],dt=it.ranges[at];if(!bn(ct.anchor,dt.anchor)||!bn(ct.head,dt.head))return!1}return!0},$l.prototype.deepCopy=function(){for(var it=[],at=0;at<this.ranges.length;at++)it[at]=new ua(_n(this.ranges[at].anchor),_n(this.ranges[at].head));return new $l(it,this.primIndex)},$l.prototype.somethingSelected=function(){for(var it=0;it<this.ranges.length;it++)if(!this.ranges[it].empty())return!0;return!1},$l.prototype.contains=function(it,at){at||(at=it);for(var ct=0;ct<this.ranges.length;ct++){var dt=this.ranges[ct];if($e(at,dt.from())>=0&&$e(it,dt.to())<=0)return ct}return-1};var ua=function(it,at){this.anchor=it,this.head=at};ua.prototype.from=function(){return Yn(this.anchor,this.head)},ua.prototype.to=function(){return hi(this.anchor,this.head)},ua.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function gu(it,at,ct){var dt=it&&it.options.selectionsMayTouch,mt=at[ct];at.sort(function(Sn,hn){return $e(Sn.from(),hn.from())}),ct=Ye(at,mt);for(var Ft=1;Ft<at.length;Ft++){var It=at[Ft],Kt=at[Ft-1],Wt=$e(Kt.to(),It.from());if(dt&&!It.empty()?Wt>0:Wt>=0){var le=Yn(Kt.from(),It.from()),Ze=hi(Kt.to(),It.to()),ge=Kt.empty()?It.from()==It.head:Kt.from()==Kt.head;Ft<=ct&&--ct,at.splice(--Ft,2,new ua(ge?Ze:le,ge?le:Ze))}}return new $l(at,ct)}function rh(it,at){return new $l([new ua(it,at||it)],0)}function Ch(it){return it.text?Ie(it.from.line+it.text.length-1,te(it.text).length+(it.text.length==1?it.from.ch:0)):it.to}function $h(it,at){if($e(it,at.from)<0)return it;if($e(it,at.to)<=0)return Ch(at);var ct=it.line+at.text.length-(at.to.line-at.from.line)-1,dt=it.ch;return it.line==at.to.line&&(dt+=Ch(at).ch-at.to.ch),Ie(ct,dt)}function fc(it,at){for(var ct=[],dt=0;dt<it.sel.ranges.length;dt++){var mt=it.sel.ranges[dt];ct.push(new ua($h(mt.anchor,at),$h(mt.head,at)))}return gu(it.cm,ct,it.sel.primIndex)}function Td(it,at,ct){return it.line==at.line?Ie(ct.line,it.ch-at.ch+ct.ch):Ie(ct.line+(it.line-at.line),it.ch)}function gc(it,at,ct){for(var dt=[],mt=Ie(it.first,0),Ft=mt,It=0;It<at.length;It++){var Kt=at[It],Wt=Td(Kt.from,mt,Ft),le=Td(Ch(Kt),mt,Ft);if(mt=Kt.to,Ft=le,ct=="around"){var Ze=it.sel.ranges[It],ge=$e(Ze.head,Ze.anchor)<0;dt[It]=new ua(ge?le:Wt,ge?Wt:le)}else dt[It]=new ua(Wt,Wt)}return new $l(dt,it.sel.primIndex)}function Go(it){it.doc.mode=pe(it.options,it.doc.modeOption),pc(it)}function pc(it){it.doc.iter(function(at){at.stateAfter&&(at.stateAfter=null),at.styles&&(at.styles=null)}),it.doc.modeFrontier=it.doc.highlightFrontier=it.doc.first,Io(it,100),it.state.modeGen++,it.curOp&&ir(it)}function gg(it,at){return at.from.ch==0&&at.to.ch==0&&te(at.text)==""&&(!it.cm||it.cm.options.wholeLineUpdateBefore)}function lf(it,at,ct,dt){function mt(Zr){return ct?ct[Zr]:null}function Ft(Zr,xr,Ur){eo(Zr,xr,Ur,dt),nr(Zr,"change",Zr,at)}function It(Zr,xr){for(var Ur=[],Eo=Zr;Eo<xr;++Eo)Ur.push(new ao(le[Eo],mt(Eo),dt));return Ur}var Kt=at.from,Wt=at.to,le=at.text,Ze=An(it,Kt.line),ge=An(it,Wt.line),Sn=te(le),hn=mt(le.length-1),xi=Wt.line-Kt.line;if(at.full)it.insert(0,It(0,le.length)),it.remove(le.length,it.size-le.length);else if(gg(it,at)){var Fi=It(0,le.length-1);Ft(ge,ge.text,hn),xi&&it.remove(Kt.line,xi),Fi.length&&it.insert(Kt.line,Fi)}else if(Ze==ge)if(le.length==1)Ft(Ze,Ze.text.slice(0,Kt.ch)+Sn+Ze.text.slice(Wt.ch),hn);else{var Ri=It(1,le.length-1);Ri.push(new ao(Sn+Ze.text.slice(Wt.ch),hn,dt)),Ft(Ze,Ze.text.slice(0,Kt.ch)+le[0],mt(0)),it.insert(Kt.line+1,Ri)}else if(le.length==1)Ft(Ze,Ze.text.slice(0,Kt.ch)+le[0]+ge.text.slice(Wt.ch),mt(0)),it.remove(Kt.line+1,xi);else{Ft(Ze,Ze.text.slice(0,Kt.ch)+le[0],mt(0)),Ft(ge,Sn+ge.text.slice(Wt.ch),hn);var rr=It(1,le.length-1);xi>1&&it.remove(Kt.line+1,xi-1),it.insert(Kt.line+1,rr)}nr(it,"change",it,at)}function ku(it,at,ct){function dt(mt,Ft,It){if(mt.linked)for(var Kt=0;Kt<mt.linked.length;++Kt){var Wt=mt.linked[Kt];if(Wt.doc!=Ft){var le=It&&Wt.sharedHist;ct&&!le||(at(Wt.doc,le),dt(Wt.doc,mt,le))}}}dt(it,null,!0)}function uf(it,at){if(at.cm)throw new Error("This document is already in use.");it.doc=at,at.cm=it,Ki(it),Go(it),mc(it),it.options.lineWrapping||hr(it),it.options.mode=at.modeOption,ir(it)}function mc(it){(it.doc.direction=="rtl"?Pe:Ot)(it.display.lineDiv,"CodeMirror-rtl")}function q0(it){Ni(it,function(){mc(it),ir(it)})}function Dd(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 hf(it,at){var ct={from:_n(at.from),to:Ch(at),text:yi(it,at.from,at.to)};return Eh(it,ct,at.from.line,at.to.line+1),ku(it,function(dt){return Eh(dt,ct,at.from.line,at.to.line+1)},!0),ct}function Od(it){for(;it.length;){var at=te(it);if(at.ranges)it.pop();else break}}function vc(it,at){if(at)return Od(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 yc(it,at,ct,dt){var mt=it.history;mt.undone.length=0;var Ft=+new Date,It,Kt;if((mt.lastOp==dt||mt.lastOrigin==at.origin&&at.origin&&(at.origin.charAt(0)=="+"&&mt.lastModTime>Ft-(it.cm?it.cm.options.historyEventDelay:500)||at.origin.charAt(0)=="*"))&&(It=vc(mt,mt.lastOp==dt)))Kt=te(It.changes),$e(at.from,at.to)==0&&$e(at.from,Kt.to)==0?Kt.to=Ch(at):It.changes.push(hf(it,at));else{var Wt=te(mt.done);for((!Wt||!Wt.ranges)&&Id(it.sel,mt.done),It={changes:[hf(it,at)],generation:mt.generation},mt.done.push(It);mt.done.length>mt.undoDepth;)mt.done.shift(),mt.done[0].ranges||mt.done.shift()}mt.done.push(ct),mt.generation=++mt.maxGeneration,mt.lastModTime=mt.lastSelTime=Ft,mt.lastOp=mt.lastSelOp=dt,mt.lastOrigin=mt.lastSelOrigin=at.origin,Kt||Ve(it,"historyAdded")}function pg(it,at,ct,dt){var mt=at.charAt(0);return mt=="*"||mt=="+"&&ct.ranges.length==dt.ranges.length&&ct.somethingSelected()==dt.somethingSelected()&&new Date-it.history.lastSelTime<=(it.cm?it.cm.options.historyEventDelay:500)}function Sc(it,at,ct,dt){var mt=it.history,Ft=dt&&dt.origin;ct==mt.lastSelOp||Ft&&mt.lastSelOrigin==Ft&&(mt.lastModTime==mt.lastSelTime&&mt.lastOrigin==Ft||pg(it,Ft,te(mt.done),at))?mt.done[mt.done.length-1]=at:Id(at,mt.done),mt.lastSelTime=+new Date,mt.lastSelOrigin=Ft,mt.lastSelOp=ct,dt&&dt.clearRedo!==!1&&Od(mt.undone)}function Id(it,at){var ct=te(at);ct&&ct.ranges&&ct.equals(it)||at.push(it)}function Eh(it,at,ct,dt){var mt=at["spans_"+it.id],Ft=0;it.iter(Math.max(it.first,ct),Math.min(it.first+it.size,dt),function(It){It.markedSpans&&((mt||(mt=at["spans_"+it.id]={}))[Ft]=It.markedSpans),++Ft})}function qs(it){if(!it)return null;for(var at,ct=0;ct<it.length;++ct)it[ct].marker.explicitlyCleared?at||(at=it.slice(0,ct)):at&&at.push(it[ct]);return at?at.length?at:null:it}function zu(it,at){var ct=at["spans_"+it.id];if(!ct)return null;for(var dt=[],mt=0;mt<at.text.length;++mt)dt.push(qs(ct[mt]));return dt}function df(it,at){var ct=zu(it,at),dt=Po(it,at);if(!ct)return dt;if(!dt)return ct;for(var mt=0;mt<ct.length;++mt){var Ft=ct[mt],It=dt[mt];if(Ft&&It)t:for(var Kt=0;Kt<It.length;++Kt){for(var Wt=It[Kt],le=0;le<Ft.length;++le)if(Ft[le].marker==Wt.marker)continue t;Ft.push(Wt)}else It&&(ct[mt]=It)}return ct}function oh(it,at,ct){for(var dt=[],mt=0;mt<it.length;++mt){var Ft=it[mt];if(Ft.ranges){dt.push(ct?$l.prototype.deepCopy.call(Ft):Ft);continue}var It=Ft.changes,Kt=[];dt.push({changes:Kt});for(var Wt=0;Wt<It.length;++Wt){var le=It[Wt],Ze=void 0;if(Kt.push({from:le.from,to:le.to,text:le.text}),at)for(var ge in le)(Ze=ge.match(/^spans_(\d+)$/))&&Ye(at,Number(Ze[1]))>-1&&(te(Kt)[ge]=le[ge],delete le[ge])}}return dt}function cf(it,at,ct,dt){if(dt){var mt=it.anchor;if(ct){var Ft=$e(at,mt)<0;Ft!=$e(ct,mt)<0?(mt=at,at=ct):Ft!=$e(at,ct)<0&&(at=ct)}return new ua(mt,at)}else return new ua(ct||at,at)}function ff(it,at,ct,dt,mt){mt==null&&(mt=it.cm&&(it.cm.display.shift||it.extend)),Hs(it,new $l([cf(it.sel.primary(),at,ct,mt)],0),dt)}function Hp(it,at,ct){for(var dt=[],mt=it.cm&&(it.cm.display.shift||it.extend),Ft=0;Ft<it.sel.ranges.length;Ft++)dt[Ft]=cf(it.sel.ranges[Ft],at[Ft],null,mt);var It=gu(it.cm,dt,it.sel.primIndex);Hs(it,It,ct)}function Lh(it,at,ct,dt){var mt=it.sel.ranges.slice(0);mt[at]=ct,Hs(it,gu(it.cm,mt,it.sel.primIndex),dt)}function qh(it,at,ct,dt){Hs(it,rh(at,ct),dt)}function Wp(it,at,ct){var dt={ranges:at.ranges,update:function(mt){this.ranges=[];for(var Ft=0;Ft<mt.length;Ft++)this.ranges[Ft]=new ua(ei(it,mt[Ft].anchor),ei(it,mt[Ft].head))},origin:ct&&ct.origin};return Ve(it,"beforeSelectionChange",it,dt),it.cm&&Ve(it.cm,"beforeSelectionChange",it.cm,dt),dt.ranges!=at.ranges?gu(it.cm,dt.ranges,dt.ranges.length-1):at}function gf(it,at,ct){var dt=it.history.done,mt=te(dt);mt&&mt.ranges?(dt[dt.length-1]=at,td(it,at,ct)):Hs(it,at,ct)}function Hs(it,at,ct){td(it,at,ct),Sc(it,it.sel,it.cm?it.cm.curOp.id:NaN,ct)}function td(it,at,ct){(vn(it,"beforeSelectionChange")||it.cm&&vn(it.cm,"beforeSelectionChange"))&&(at=Wp(it,at,ct));var dt=ct&&ct.bias||($e(at.primary().head,it.sel.primary().head)<0?-1:1);mg(it,Pc(it,at,dt,!0)),!(ct&&ct.scroll===!1)&&it.cm&&Js(it.cm)}function mg(it,at){at.equals(it.sel)||(it.sel=at,it.cm&&(it.cm.curOp.updateInput=1,it.cm.curOp.selectionChanged=!0,qn(it.cm)),nr(it,"cursorActivity",it))}function xc(it){mg(it,Pc(it,it.sel,null,!1))}function Pc(it,at,ct,dt){for(var mt,Ft=0;Ft<at.ranges.length;Ft++){var It=at.ranges[Ft],Kt=at.ranges.length==it.sel.ranges.length&&it.sel.ranges[Ft],Wt=wc(it,It.anchor,Kt&&Kt.anchor,ct,dt),le=wc(it,It.head,Kt&&Kt.head,ct,dt);(mt||Wt!=It.anchor||le!=It.head)&&(mt||(mt=at.ranges.slice(0,Ft)),mt[Ft]=new ua(Wt,le))}return mt?gu(it.cm,mt,at.primIndex):at}function ah(it,at,ct,dt,mt){var Ft=An(it,at.line);if(Ft.markedSpans)for(var It=0;It<Ft.markedSpans.length;++It){var Kt=Ft.markedSpans[It],Wt=Kt.marker,le="selectLeft"in Wt?!Wt.selectLeft:Wt.inclusiveLeft,Ze="selectRight"in Wt?!Wt.selectRight:Wt.inclusiveRight;if((Kt.from==null||(le?Kt.from<=at.ch:Kt.from<at.ch))&&(Kt.to==null||(Ze?Kt.to>=at.ch:Kt.to>at.ch))){if(mt&&(Ve(Wt,"beforeCursorEnter"),Wt.explicitlyCleared))if(Ft.markedSpans){--It;continue}else break;if(!Wt.atomic)continue;if(ct){var ge=Wt.find(dt<0?1:-1),Sn=void 0;if((dt<0?Ze:le)&&(ge=vg(it,ge,-dt,ge&&ge.line==at.line?Ft:null)),ge&&ge.line==at.line&&(Sn=$e(ge,ct))&&(dt<0?Sn<0:Sn>0))return ah(it,ge,at,dt,mt)}var hn=Wt.find(dt<0?-1:1);return(dt<0?le:Ze)&&(hn=vg(it,hn,dt,hn.line==at.line?Ft:null)),hn?ah(it,hn,at,dt,mt):null}}return at}function wc(it,at,ct,dt,mt){var Ft=dt||1,It=ah(it,at,ct,Ft,mt)||!mt&&ah(it,at,ct,Ft,!0)||ah(it,at,ct,-Ft,mt)||!mt&&ah(it,at,ct,-Ft,!0);return It||(it.cantEdit=!0,Ie(it.first,0))}function vg(it,at,ct,dt){return ct<0&&at.ch==0?at.line>it.first?ei(it,Ie(at.line-1)):null:ct>0&&at.ch==(dt||An(it,at.line)).text.length?at.line<it.first+it.size-1?Ie(at.line+1,0):null:new Ie(at.line,at.ch+ct)}function ts(it){it.setSelection(Ie(it.firstLine(),0),Ie(it.lastLine()),Oe)}function Cc(it,at,ct){var dt={canceled:!1,from:at.from,to:at.to,text:at.text,origin:at.origin,cancel:function(){return dt.canceled=!0}};return ct&&(dt.update=function(mt,Ft,It,Kt){mt&&(dt.from=ei(it,mt)),Ft&&(dt.to=ei(it,Ft)),It&&(dt.text=It),Kt!==void 0&&(dt.origin=Kt)}),Ve(it,"beforeChange",it,dt),it.cm&&Ve(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 Fh(it,at,ct){if(it.cm){if(!it.cm.curOp)return Gr(it.cm,Fh)(it,at,ct);if(it.cm.state.suppressEdits)return}if(!((vn(it,"beforeChange")||it.cm&&vn(it.cm,"beforeChange"))&&(at=Cc(it,at,!0),!at))){var dt=Ir&&!ct&&Pn(it,at.from,at.to);if(dt)for(var mt=dt.length-1;mt>=0;--mt)ed(it,{from:dt[mt].from,to:dt[mt].to,text:mt?[""]:at.text,origin:at.origin});else ed(it,at)}}function ed(it,at){if(!(at.text.length==1&&at.text[0]==""&&$e(at.from,at.to)==0)){var ct=fc(it,at);yc(it,at,ct,it.cm?it.cm.curOp.id:NaN),_d(it,at,ct,Po(it,at));var dt=[];ku(it,function(mt,Ft){!Ft&&Ye(dt,mt.history)==-1&&(Sg(mt.history,at),dt.push(mt.history)),_d(mt,at,null,Po(mt,at))})}}function Ec(it,at,ct){var dt=it.cm&&it.cm.state.suppressEdits;if(!(dt&&!ct)){for(var mt=it.history,Ft,It=it.sel,Kt=at=="undo"?mt.done:mt.undone,Wt=at=="undo"?mt.undone:mt.done,le=0;le<Kt.length&&(Ft=Kt[le],!(ct?Ft.ranges&&!Ft.equals(it.sel):!Ft.ranges));le++);if(le!=Kt.length){for(mt.lastOrigin=mt.lastSelOrigin=null;;)if(Ft=Kt.pop(),Ft.ranges){if(Id(Ft,Wt),ct&&!Ft.equals(it.sel)){Hs(it,Ft,{clearRedo:!1});return}It=Ft}else if(dt){Kt.push(Ft);return}else break;var Ze=[];Id(It,Wt),Wt.push({changes:Ze,generation:mt.generation}),mt.generation=Ft.generation||++mt.maxGeneration;for(var ge=vn(it,"beforeChange")||it.cm&&vn(it.cm,"beforeChange"),Sn=function(Fi){var Ri=Ft.changes[Fi];if(Ri.origin=at,ge&&!Cc(it,Ri,!1))return Kt.length=0,{};Ze.push(hf(it,Ri));var rr=Fi?fc(it,Ri):te(Kt);_d(it,Ri,rr,df(it,Ri)),!Fi&&it.cm&&it.cm.scrollIntoView({from:Ri.from,to:Ch(Ri)});var Zr=[];ku(it,function(xr,Ur){!Ur&&Ye(Zr,xr.history)==-1&&(Sg(xr.history,Ri),Zr.push(xr.history)),_d(xr,Ri,null,df(xr,Ri))})},hn=Ft.changes.length-1;hn>=0;--hn){var xi=Sn(hn);if(xi)return xi.v}}}}function yg(it,at){if(at!=0&&(it.first+=at,it.sel=new $l(En(it.sel.ranges,function(mt){return new ua(Ie(mt.anchor.line+at,mt.anchor.ch),Ie(mt.head.line+at,mt.head.ch))}),it.sel.primIndex),it.cm)){ir(it.cm,it.first,it.first-at,at);for(var ct=it.cm.display,dt=ct.viewFrom;dt<ct.viewTo;dt++)Ji(it.cm,dt,"gutter")}}function _d(it,at,ct,dt){if(it.cm&&!it.cm.curOp)return Gr(it.cm,_d)(it,at,ct,dt);if(at.to.line<it.first){yg(it,at.text.length-1-(at.to.line-at.from.line));return}if(!(at.from.line>it.lastLine())){if(at.from.line<it.first){var mt=at.text.length-1-(it.first-at.from.line);yg(it,mt),at={from:Ie(it.first,0),to:Ie(at.to.line+mt,at.to.ch),text:[te(at.text)],origin:at.origin}}var Ft=it.lastLine();at.to.line>Ft&&(at={from:at.from,to:Ie(Ft,An(it,Ft).text.length),text:[at.text[0]],origin:at.origin}),at.removed=yi(it,at.from,at.to),ct||(ct=fc(it,at)),it.cm?Vp(it.cm,at,dt):lf(it,at,dt),td(it,ct,Oe),it.cantEdit&&wc(it,Ie(it.firstLine(),0))&&(it.cantEdit=!1)}}function Vp(it,at,ct){var dt=it.doc,mt=it.display,Ft=at.from,It=at.to,Kt=!1,Wt=Ft.line;it.options.lineWrapping||(Wt=Gt(Dn(An(dt,Ft.line))),dt.iter(Wt,It.line+1,function(hn){if(hn==mt.maxLine)return Kt=!0,!0})),dt.sel.contains(at.from,at.to)>-1&&qn(it),lf(dt,at,ct,Dr(it)),it.options.lineWrapping||(dt.iter(Wt,Ft.line+at.text.length,function(hn){var xi=Tr(hn);xi>mt.maxLineLength&&(mt.maxLine=hn,mt.maxLineLength=xi,mt.maxLineChanged=!0,Kt=!1)}),Kt&&(it.curOp.updateMaxLine=!0)),Or(dt,Ft.line),Io(it,400);var le=at.text.length-(It.line-Ft.line)-1;at.full?ir(it):Ft.line==It.line&&at.text.length==1&&!gg(it.doc,at)?Ji(it,Ft.line,"text"):ir(it,Ft.line,It.line+1,le);var Ze=vn(it,"changes"),ge=vn(it,"change");if(ge||Ze){var Sn={from:Ft,to:It,text:at.text,removed:at.removed,origin:at.origin};ge&&nr(it,"change",it,Sn),Ze&&(it.curOp.changeObjs||(it.curOp.changeObjs=[])).push(Sn)}it.display.selForContextMenu=null}function nd(it,at,ct,dt,mt){var Ft;dt||(dt=ct),$e(dt,ct)<0&&(Ft=[dt,ct],ct=Ft[0],dt=Ft[1]),typeof at=="string"&&(at=it.splitLines(at)),Fh(it,{from:ct,to:dt,text:at,origin:mt})}function ql(it,at,ct,dt){ct<it.line?it.line+=dt:at<it.line&&(it.line=at,it.ch=0)}function Kp(it,at,ct,dt){for(var mt=0;mt<it.length;++mt){var Ft=it[mt],It=!0;if(Ft.ranges){Ft.copied||(Ft=it[mt]=Ft.deepCopy(),Ft.copied=!0);for(var Kt=0;Kt<Ft.ranges.length;Kt++)ql(Ft.ranges[Kt].anchor,at,ct,dt),ql(Ft.ranges[Kt].head,at,ct,dt);continue}for(var Wt=0;Wt<Ft.changes.length;++Wt){var le=Ft.changes[Wt];if(ct<le.from.line)le.from=Ie(le.from.line+dt,le.from.ch),le.to=Ie(le.to.line+dt,le.to.ch);else if(at<=le.to.line){It=!1;break}}It||(it.splice(0,mt+1),mt=0)}}function Sg(it,at){var ct=at.from.line,dt=at.to.line,mt=at.text.length-(dt-ct)-1;Kp(it.done,ct,dt,mt),Kp(it.undone,ct,dt,mt)}function id(it,at,ct,dt){var mt=at,Ft=at;return typeof at=="number"?Ft=An(it,si(it,at)):mt=Gt(at),mt==null?null:(dt(Ft,mt)&&it.cm&&Ji(it.cm,mt,ct),Ft)}function Rd(it){this.lines=it,this.parent=null;for(var at=0,ct=0;ct<it.length;++ct)it[ct].parent=this,at+=it[ct].height;this.height=at}Rd.prototype={chunkSize:function(){return this.lines.length},removeInner:function(it,at){for(var ct=it,dt=it+at;ct<dt;++ct){var mt=this.lines[ct];this.height-=mt.height,qr(mt),nr(mt,"delete")}this.lines.splice(it,at)},collapse:function(it){it.push.apply(it,this.lines)},insertInner:function(it,at,ct){this.height+=ct,this.lines=this.lines.slice(0,it).concat(at).concat(this.lines.slice(it));for(var dt=0;dt<at.length;++dt)at[dt].parent=this},iterN:function(it,at,ct){for(var dt=it+at;it<dt;++it)if(ct(this.lines[it]))return!0}};function Ra(it){this.children=it;for(var at=0,ct=0,dt=0;dt<it.length;++dt){var mt=it[dt];at+=mt.chunkSize(),ct+=mt.height,mt.parent=this}this.size=at,this.height=ct,this.parent=null}Ra.prototype={chunkSize:function(){return this.size},removeInner:function(it,at){this.size-=at;for(var ct=0;ct<this.children.length;++ct){var dt=this.children[ct],mt=dt.chunkSize();if(it<mt){var Ft=Math.min(at,mt-it),It=dt.height;if(dt.removeInner(it,Ft),this.height-=It-dt.height,mt==Ft&&(this.children.splice(ct--,1),dt.parent=null),(at-=Ft)==0)break;it=0}else it-=mt}if(this.size-at<25&&(this.children.length>1||!(this.children[0]instanceof Rd))){var Kt=[];this.collapse(Kt),this.children=[new Rd(Kt)],this.children[0].parent=this}},collapse:function(it){for(var at=0;at<this.children.length;++at)this.children[at].collapse(it)},insertInner:function(it,at,ct){this.size+=at.length,this.height+=ct;for(var dt=0;dt<this.children.length;++dt){var mt=this.children[dt],Ft=mt.chunkSize();if(it<=Ft){if(mt.insertInner(it,at,ct),mt.lines&&mt.lines.length>50){for(var It=mt.lines.length%25+25,Kt=It;Kt<mt.lines.length;){var Wt=new Rd(mt.lines.slice(Kt,Kt+=25));mt.height-=Wt.height,this.children.splice(++dt,0,Wt),Wt.parent=this}mt.lines=mt.lines.slice(0,It),this.maybeSpill()}break}it-=Ft}},maybeSpill:function(){if(!(this.children.length<=10)){var it=this;do{var at=it.children.splice(it.children.length-5,5),ct=new Ra(at);if(it.parent){it.size-=ct.size,it.height-=ct.height;var mt=Ye(it.parent.children,it);it.parent.children.splice(mt+1,0,ct)}else{var dt=new Ra(it.children);dt.parent=it,it.children=[dt,ct],it=dt}ct.parent=it.parent}while(it.children.length>10);it.parent.maybeSpill()}},iterN:function(it,at,ct){for(var dt=0;dt<this.children.length;++dt){var mt=this.children[dt],Ft=mt.chunkSize();if(it<Ft){var It=Math.min(at,Ft-it);if(mt.iterN(it,It,ct))return!0;if((at-=It)==0)break;it=0}else it-=Ft}}};var sh=function(it,at,ct){if(ct)for(var dt in ct)ct.hasOwnProperty(dt)&&(this[dt]=ct[dt]);this.doc=it,this.node=at};sh.prototype.clear=function(){var it=this.doc.cm,at=this.line.widgets,ct=this.line,dt=Gt(ct);if(!(dt==null||!at)){for(var mt=0;mt<at.length;++mt)at[mt]==this&&at.splice(mt--,1);at.length||(ct.widgets=null);var Ft=fa(this);Xi(ct,Math.max(0,ct.height-Ft)),it&&(Ni(it,function(){Up(it,ct,-Ft),Ji(it,dt,"widget")}),nr(it,"lineWidgetCleared",it,this,dt))}},sh.prototype.changed=function(){var it=this,at=this.height,ct=this.doc.cm,dt=this.line;this.height=null;var mt=fa(this)-at;mt&&(on(this.doc,dt)||Xi(dt,dt.height+mt),ct&&Ni(ct,function(){ct.curOp.forceUpdate=!0,Up(ct,dt,mt),nr(ct,"lineWidgetChanged",ct,it,Gt(dt))}))},tn(sh);function Up(it,at,ct){Ui(at)<(it.curOp&&it.curOp.scrollTop||it.doc.scrollTop)&&Xl(it,ct)}function pf(it,at,ct,dt){var mt=new sh(it,ct,dt),Ft=it.cm;return Ft&&mt.noHScroll&&(Ft.display.alignWidgets=!0),id(it,at,"widget",function(It){var Kt=It.widgets||(It.widgets=[]);if(mt.insertAt==null?Kt.push(mt):Kt.splice(Math.min(Kt.length-1,Math.max(0,mt.insertAt)),0,mt),mt.line=It,Ft&&!on(it,It)){var Wt=Ui(It)<it.scrollTop;Xi(It,It.height+fa(mt)),Wt&&Xl(Ft,mt.height),Ft.curOp.forceUpdate=!0}return!0}),Ft&&nr(Ft,"lineWidgetAdded",Ft,mt,typeof at=="number"?at:Gt(at)),mt}var Yp=0,ke=function(it,at){this.lines=[],this.type=at,this.doc=it,this.id=++Yp};ke.prototype.clear=function(){if(!this.explicitlyCleared){var it=this.doc.cm,at=it&&!it.curOp;if(at&&hl(it),vn(this,"clear")){var ct=this.find();ct&&nr(this,"clear",ct.from,ct.to)}for(var dt=null,mt=null,Ft=0;Ft<this.lines.length;++Ft){var It=this.lines[Ft],Kt=Kr(It.markedSpans,this);it&&!this.collapsed?Ji(it,Gt(It),"text"):it&&(Kt.to!=null&&(mt=Gt(It)),Kt.from!=null&&(dt=Gt(It))),It.markedSpans=ji(It.markedSpans,Kt),Kt.from==null&&this.collapsed&&!on(this.doc,It)&&it&&Xi(It,sr(it.display))}if(it&&this.collapsed&&!it.options.lineWrapping)for(var Wt=0;Wt<this.lines.length;++Wt){var le=Dn(this.lines[Wt]),Ze=Tr(le);Ze>it.display.maxLineLength&&(it.display.maxLine=le,it.display.maxLineLength=Ze,it.display.maxLineChanged=!0)}dt!=null&&it&&this.collapsed&&ir(it,dt,mt+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,it&&xc(it.doc)),it&&nr(it,"markerCleared",it,this,dt,mt),at&&Il(it),this.parent&&this.parent.clear()}},ke.prototype.find=function(it,at){it==null&&this.type=="bookmark"&&(it=1);for(var ct,dt,mt=0;mt<this.lines.length;++mt){var Ft=this.lines[mt],It=Kr(Ft.markedSpans,this);if(It.from!=null&&(ct=Ie(at?Ft:Gt(Ft),It.from),it==-1))return ct;if(It.to!=null&&(dt=Ie(at?Ft:Gt(Ft),It.to),it==1))return dt}return ct&&{from:ct,to:dt}},ke.prototype.changed=function(){var it=this,at=this.find(-1,!0),ct=this,dt=this.doc.cm;!at||!dt||Ni(dt,function(){var mt=at.line,Ft=Gt(at.line),It=Zs(dt,Ft);if(It&&(ju(It),dt.curOp.selectionChanged=dt.curOp.forceUpdate=!0),dt.curOp.updateMaxLine=!0,!on(ct.doc,mt)&&ct.height!=null){var Kt=ct.height;ct.height=null;var Wt=fa(ct)-Kt;Wt&&Xi(mt,mt.height+Wt)}nr(dt,"markerChanged",dt,it)})},ke.prototype.attachLine=function(it){if(!this.lines.length&&this.doc.cm){var at=this.doc.cm.curOp;(!at.maybeHiddenMarkers||Ye(at.maybeHiddenMarkers,this)==-1)&&(at.maybeUnhiddenMarkers||(at.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(it)},ke.prototype.detachLine=function(it){if(this.lines.splice(Ye(this.lines,it),1),!this.lines.length&&this.doc.cm){var at=this.doc.cm.curOp;(at.maybeHiddenMarkers||(at.maybeHiddenMarkers=[])).push(this)}},tn(ke);function rd(it,at,ct,dt,mt){if(dt&&dt.shared)return Xp(it,at,ct,dt,mt);if(it.cm&&!it.cm.curOp)return Gr(it.cm,rd)(it,at,ct,dt,mt);var Ft=new ke(it,mt),It=$e(at,ct);if(dt&&Ke(dt,Ft,!1),It>0||It==0&&Ft.clearWhenEmpty!==!1)return Ft;if(Ft.replacedWith&&(Ft.collapsed=!0,Ft.widgetNode=ve("span",[Ft.replacedWith],"CodeMirror-widget"),dt.handleMouseEvents||Ft.widgetNode.setAttribute("cm-ignore-events","true"),dt.insertLeft&&(Ft.widgetNode.insertLeft=!0)),Ft.collapsed){if(Qn(it,at.line,at,ct,Ft)||at.line!=ct.line&&Qn(it,ct.line,at,ct,Ft))throw new Error("Inserting collapsed marker partially overlapping an existing one");pn()}Ft.addToHistory&&yc(it,{from:at,to:ct,origin:"markText"},it.sel,NaN);var Kt=at.line,Wt=it.cm,le;if(it.iter(Kt,ct.line+1,function(ge){Wt&&Ft.collapsed&&!Wt.options.lineWrapping&&Dn(ge)==Wt.display.maxLine&&(le=!0),Ft.collapsed&&Kt!=at.line&&Xi(ge,0),xo(ge,new Hi(Ft,Kt==at.line?at.ch:null,Kt==ct.line?ct.ch:null)),++Kt}),Ft.collapsed&&it.iter(at.line,ct.line+1,function(ge){on(it,ge)&&Xi(ge,0)}),Ft.clearOnEnter&&gn(Ft,"beforeCursorEnter",function(){return Ft.clear()}),Ft.readOnly&&(ho(),(it.history.done.length||it.history.undone.length)&&it.clearHistory()),Ft.collapsed&&(Ft.id=++Yp,Ft.atomic=!0),Wt){if(le&&(Wt.curOp.updateMaxLine=!0),Ft.collapsed)ir(Wt,at.line,ct.line+1);else if(Ft.className||Ft.startStyle||Ft.endStyle||Ft.css||Ft.attributes||Ft.title)for(var Ze=at.line;Ze<=ct.line;Ze++)Ji(Wt,Ze,"text");Ft.atomic&&xc(Wt.doc),nr(Wt,"markerAdded",Wt,Ft)}return Ft}var Zu=function(it,at){this.markers=it,this.primary=at;for(var ct=0;ct<it.length;++ct)it[ct].parent=this};Zu.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var it=0;it<this.markers.length;++it)this.markers[it].clear();nr(this,"clear")}},Zu.prototype.find=function(it,at){return this.primary.find(it,at)},tn(Zu);function Xp(it,at,ct,dt,mt){dt=Ke(dt),dt.shared=!1;var Ft=[rd(it,at,ct,dt,mt)],It=Ft[0],Kt=dt.widgetNode;return ku(it,function(Wt){Kt&&(dt.widgetNode=Kt.cloneNode(!0)),Ft.push(rd(Wt,ei(Wt,at),ei(Wt,ct),dt,mt));for(var le=0;le<Wt.linked.length;++le)if(Wt.linked[le].isParent)return;It=te(Ft)}),new Zu(Ft,It)}function xg(it){return it.findMarks(Ie(it.first,0),it.clipPos(Ie(it.lastLine())),function(at){return at.parent})}function Jp(it,at){for(var ct=0;ct<at.length;ct++){var dt=at[ct],mt=dt.find(),Ft=it.clipPos(mt.from),It=it.clipPos(mt.to);if($e(Ft,It)){var Kt=rd(it,Ft,It,dt.primary,dt.primary.type);dt.markers.push(Kt),Kt.parent=dt}}}function Pg(it){for(var at=function(dt){var mt=it[dt],Ft=[mt.primary.doc];ku(mt.primary.doc,function(Wt){return Ft.push(Wt)});for(var It=0;It<mt.markers.length;It++){var Kt=mt.markers[It];Ye(Ft,Kt.doc)==-1&&(Kt.parent=null,mt.markers.splice(It--,1))}},ct=0;ct<it.length;ct++)at(ct)}var tv=0,Ts=function(it,at,ct,dt,mt){if(!(this instanceof Ts))return new Ts(it,at,ct,dt,mt);ct==null&&(ct=0),Ra.call(this,[new Rd([new ao("",null)])]),this.first=ct,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=ct;var Ft=Ie(ct,0);this.sel=rh(Ft),this.history=new Dd(null),this.id=++tv,this.modeOption=at,this.lineSep=dt,this.direction=mt=="rtl"?"rtl":"ltr",this.extend=!1,typeof it=="string"&&(it=this.splitLines(it)),lf(this,{from:Ft,to:Ft,text:it}),Hs(this,rh(Ft),Oe)};Ts.prototype=Lt(Ra.prototype,{constructor:Ts,iter:function(it,at,ct){ct?this.iterN(it-this.first,at-it,ct):this.iterN(this.first,this.first+this.size,it)},insert:function(it,at){for(var ct=0,dt=0;dt<at.length;++dt)ct+=at[dt].height;this.insertInner(it-this.first,at,ct)},remove:function(it,at){this.removeInner(it-this.first,at)},getValue:function(it){var at=Ei(this,this.first,this.first+this.size);return it===!1?at:at.join(it||this.lineSeparator())},setValue:Pi(function(it){var at=Ie(this.first,0),ct=this.first+this.size-1;Fh(this,{from:at,to:Ie(ct,An(this,ct).text.length),text:this.splitLines(it),origin:"setValue",full:!0},!0),this.cm&&Dl(this.cm,0,0),Hs(this,rh(at),Oe)}),replaceRange:function(it,at,ct,dt){at=ei(this,at),ct=ct?ei(this,ct):at,nd(this,it,at,ct,dt)},getRange:function(it,at,ct){var dt=yi(this,ei(this,it),ei(this,at));return ct===!1?dt:dt.join(ct||this.lineSeparator())},getLine:function(it){var at=this.getLineHandle(it);return at&&at.text},getLineHandle:function(it){if(un(this,it))return An(this,it)},getLineNumber:function(it){return Gt(it)},getLineHandleVisualStart:function(it){return typeof it=="number"&&(it=An(this,it)),Dn(it)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(it){return ei(this,it)},getCursor:function(it){var at=this.sel.primary(),ct;return it==null||it=="head"?ct=at.head:it=="anchor"?ct=at.anchor:it=="end"||it=="to"||it===!1?ct=at.to():ct=at.from(),ct},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:Pi(function(it,at,ct){qh(this,ei(this,typeof it=="number"?Ie(it,at||0):it),null,ct)}),setSelection:Pi(function(it,at,ct){qh(this,ei(this,it),ei(this,at||it),ct)}),extendSelection:Pi(function(it,at,ct){ff(this,ei(this,it),at&&ei(this,at),ct)}),extendSelections:Pi(function(it,at){Hp(this,Ti(this,it),at)}),extendSelectionsBy:Pi(function(it,at){var ct=En(this.sel.ranges,it);Hp(this,Ti(this,ct),at)}),setSelections:Pi(function(it,at,ct){if(it.length){for(var dt=[],mt=0;mt<it.length;mt++)dt[mt]=new ua(ei(this,it[mt].anchor),ei(this,it[mt].head));at==null&&(at=Math.min(it.length-1,this.sel.primIndex)),Hs(this,gu(this.cm,dt,at),ct)}}),addSelection:Pi(function(it,at,ct){var dt=this.sel.ranges.slice(0);dt.push(new ua(ei(this,it),ei(this,at||it))),Hs(this,gu(this.cm,dt,dt.length-1),ct)}),getSelection:function(it){for(var at=this.sel.ranges,ct,dt=0;dt<at.length;dt++){var mt=yi(this,at[dt].from(),at[dt].to());ct=ct?ct.concat(mt):mt}return it===!1?ct:ct.join(it||this.lineSeparator())},getSelections:function(it){for(var at=[],ct=this.sel.ranges,dt=0;dt<ct.length;dt++){var mt=yi(this,ct[dt].from(),ct[dt].to());it!==!1&&(mt=mt.join(it||this.lineSeparator())),at[dt]=mt}return at},replaceSelection:function(it,at,ct){for(var dt=[],mt=0;mt<this.sel.ranges.length;mt++)dt[mt]=it;this.replaceSelections(dt,at,ct||"+input")},replaceSelections:Pi(function(it,at,ct){for(var dt=[],mt=this.sel,Ft=0;Ft<mt.ranges.length;Ft++){var It=mt.ranges[Ft];dt[Ft]={from:It.from(),to:It.to(),text:this.splitLines(it[Ft]),origin:ct}}for(var Kt=at&&at!="end"&&gc(this,dt,at),Wt=dt.length-1;Wt>=0;Wt--)Fh(this,dt[Wt]);Kt?gf(this,Kt):this.cm&&Js(this.cm)}),undo:Pi(function(){Ec(this,"undo")}),redo:Pi(function(){Ec(this,"redo")}),undoSelection:Pi(function(){Ec(this,"undo",!0)}),redoSelection:Pi(function(){Ec(this,"redo",!0)}),setExtending:function(it){this.extend=it},getExtending:function(){return this.extend},historySize:function(){for(var it=this.history,at=0,ct=0,dt=0;dt<it.done.length;dt++)it.done[dt].ranges||++at;for(var mt=0;mt<it.undone.length;mt++)it.undone[mt].ranges||++ct;return{undo:at,redo:ct}},clearHistory:function(){var it=this;this.history=new Dd(this.history.maxGeneration),ku(this,function(at){return at.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:oh(this.history.done),undone:oh(this.history.undone)}},setHistory:function(it){var at=this.history=new Dd(this.history.maxGeneration);at.done=oh(it.done.slice(0),null,!0),at.undone=oh(it.undone.slice(0),null,!0)},setGutterMarker:Pi(function(it,at,ct){return id(this,it,"gutter",function(dt){var mt=dt.gutterMarkers||(dt.gutterMarkers={});return mt[at]=ct,!ct&&Mt(mt)&&(dt.gutterMarkers=null),!0})}),clearGutter:Pi(function(it){var at=this;this.iter(function(ct){ct.gutterMarkers&&ct.gutterMarkers[it]&&id(at,ct,"gutter",function(){return ct.gutterMarkers[it]=null,Mt(ct.gutterMarkers)&&(ct.gutterMarkers=null),!0})})}),lineInfo:function(it){var at;if(typeof it=="number"){if(!un(this,it)||(at=it,it=An(this,it),!it))return null}else if(at=Gt(it),at==null)return null;return{line:at,handle:it,text:it.text,gutterMarkers:it.gutterMarkers,textClass:it.textClass,bgClass:it.bgClass,wrapClass:it.wrapClass,widgets:it.widgets}},addLineClass:Pi(function(it,at,ct){return id(this,it,at=="gutter"?"gutter":"class",function(dt){var mt=at=="text"?"textClass":at=="background"?"bgClass":at=="gutter"?"gutterClass":"wrapClass";if(!dt[mt])dt[mt]=ct;else{if(Tt(ct).test(dt[mt]))return!1;dt[mt]+=" "+ct}return!0})}),removeLineClass:Pi(function(it,at,ct){return id(this,it,at=="gutter"?"gutter":"class",function(dt){var mt=at=="text"?"textClass":at=="background"?"bgClass":at=="gutter"?"gutterClass":"wrapClass",Ft=dt[mt];if(Ft)if(ct==null)dt[mt]=null;else{var It=Ft.match(Tt(ct));if(!It)return!1;var Kt=It.index+It[0].length;dt[mt]=Ft.slice(0,It.index)+(!It.index||Kt==Ft.length?"":" ")+Ft.slice(Kt)||null}else return!1;return!0})}),addLineWidget:Pi(function(it,at,ct){return pf(this,it,at,ct)}),removeLineWidget:function(it){it.clear()},markText:function(it,at,ct){return rd(this,ei(this,it),ei(this,at),ct,ct&&ct.type||"range")},setBookmark:function(it,at){var ct={replacedWith:at&&(at.nodeType==null?at.widget:at),insertLeft:at&&at.insertLeft,clearWhenEmpty:!1,shared:at&&at.shared,handleMouseEvents:at&&at.handleMouseEvents};return it=ei(this,it),rd(this,it,it,ct,"bookmark")},findMarksAt:function(it){it=ei(this,it);var at=[],ct=An(this,it.line).markedSpans;if(ct)for(var dt=0;dt<ct.length;++dt){var mt=ct[dt];(mt.from==null||mt.from<=it.ch)&&(mt.to==null||mt.to>=it.ch)&&at.push(mt.marker.parent||mt.marker)}return at},findMarks:function(it,at,ct){it=ei(this,it),at=ei(this,at);var dt=[],mt=it.line;return this.iter(it.line,at.line+1,function(Ft){var It=Ft.markedSpans;if(It)for(var Kt=0;Kt<It.length;Kt++){var Wt=It[Kt];!(Wt.to!=null&&mt==it.line&&it.ch>=Wt.to||Wt.from==null&&mt!=it.line||Wt.from!=null&&mt==at.line&&Wt.from>=at.ch)&&(!ct||ct(Wt.marker))&&dt.push(Wt.marker.parent||Wt.marker)}++mt}),dt},getAllMarks:function(){var it=[];return this.iter(function(at){var ct=at.markedSpans;if(ct)for(var dt=0;dt<ct.length;++dt)ct[dt].from!=null&&it.push(ct[dt].marker)}),it},posFromIndex:function(it){var at,ct=this.first,dt=this.lineSeparator().length;return this.iter(function(mt){var Ft=mt.text.length+dt;if(Ft>it)return at=it,!0;it-=Ft,++ct}),ei(this,Ie(ct,at))},indexFromPos:function(it){it=ei(this,it);var at=it.ch;if(it.line<this.first||it.ch<0)return 0;var ct=this.lineSeparator().length;return this.iter(this.first,it.line,function(dt){at+=dt.text.length+ct}),at},copy:function(it){var at=new Ts(Ei(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return at.scrollTop=this.scrollTop,at.scrollLeft=this.scrollLeft,at.sel=this.sel,at.extend=!1,it&&(at.history.undoDepth=this.history.undoDepth,at.setHistory(this.getHistory())),at},linkedDoc:function(it){it||(it={});var at=this.first,ct=this.first+this.size;it.from!=null&&it.from>at&&(at=it.from),it.to!=null&&it.to<ct&&(ct=it.to);var dt=new Ts(Ei(this,at,ct),it.mode||this.modeOption,at,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}],Jp(dt,xg(this)),dt},unlinkDoc:function(it){if(it instanceof $o&&(it=it.doc),this.linked)for(var at=0;at<this.linked.length;++at){var ct=this.linked[at];if(ct.doc==it){this.linked.splice(at,1),it.unlinkDoc(this),Pg(xg(this));break}}if(it.history==this.history){var dt=[it.id];ku(it,function(mt){return dt.push(mt.id)},!0),it.history=new Dd(null),it.history.done=oh(this.history.done,dt),it.history.undone=oh(this.history.undone,dt)}},iterLinkedDocs:function(it){ku(this,it)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(it){return this.lineSep?it.split(this.lineSep):zi(it)},lineSeparator:function(){return this.lineSep||`
|
|
`},setDirection:Pi(function(it){it!="rtl"&&(it="ltr"),it!=this.direction&&(this.direction=it,this.iter(function(at){return at.order=null}),this.cm&&q0(this.cm))})}),Ts.prototype.eachLine=Ts.prototype.iter;var Lc=0;function wg(it){var at=this;if(qp(at),!(nn(at,it)||Uo(at.display,it))){Rn(it),he&&(Lc=+new Date);var ct=no(at,it,!0),dt=it.dataTransfer.files;if(!(!ct||at.isReadOnly()))if(dt&&dt.length&&window.FileReader&&window.File)for(var mt=dt.length,Ft=Array(mt),It=0,Kt=function(){++It==mt&&Gr(at,function(){ct=ei(at.doc,ct);var hn={from:ct,to:ct,text:at.doc.splitLines(Ft.filter(function(xi){return xi!=null}).join(at.doc.lineSeparator())),origin:"paste"};Fh(at.doc,hn),gf(at.doc,rh(ei(at.doc,ct),ei(at.doc,Ch(hn))))})()},Wt=function(hn,xi){if(at.options.allowDropFileTypes&&Ye(at.options.allowDropFileTypes,hn.type)==-1){Kt();return}var Fi=new FileReader;Fi.onerror=function(){return Kt()},Fi.onload=function(){var Ri=Fi.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(Ri)){Kt();return}Ft[xi]=Ri,Kt()},Fi.readAsText(hn)},le=0;le<dt.length;le++)Wt(dt[le],le);else{if(at.state.draggingText&&at.doc.sel.contains(ct)>-1){at.state.draggingText(it),setTimeout(function(){return at.display.input.focus()},20);return}try{var Ze=it.dataTransfer.getData("Text");if(Ze){var ge;if(at.state.draggingText&&!at.state.draggingText.copy&&(ge=at.listSelections()),td(at.doc,rh(ct,ct)),ge)for(var Sn=0;Sn<ge.length;++Sn)nd(at.doc,"",ge[Sn].anchor,ge[Sn].head,"drag");at.replaceSelection(Ze,"around","paste"),at.display.input.focus()}}catch(hn){}}}}function Qp(it,at){if(he&&(!it.state.draggingText||+new Date-Lc<100)){vi(at);return}if(!(nn(it,at)||Uo(it.display,at))&&(at.dataTransfer.setData("Text",it.getSelection()),at.dataTransfer.effectAllowed="copyMove",at.dataTransfer.setDragImage&&!Te)){var ct=Ht("img",null,null,"position: fixed; left: 0; top: 0;");ct.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",jt&&(ct.width=ct.height=1,it.display.wrapper.appendChild(ct),ct._top=ct.offsetTop),at.dataTransfer.setDragImage(ct,0,0),jt&&ct.parentNode.removeChild(ct)}}function $p(it,at){var ct=no(it,at);if(ct){var dt=document.createDocumentFragment();Li(it,ct,dt),it.display.dragCursor||(it.display.dragCursor=Ht("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),it.display.lineSpace.insertBefore(it.display.dragCursor,it.display.cursorDiv)),Xt(it.display.dragCursor,dt)}}function qp(it){it.display.dragCursor&&(it.display.lineSpace.removeChild(it.display.dragCursor),it.display.dragCursor=null)}function tm(it){if(document.getElementsByClassName){for(var at=document.getElementsByClassName("CodeMirror"),ct=[],dt=0;dt<at.length;dt++){var mt=at[dt].CodeMirror;mt&&ct.push(mt)}ct.length&&ct[0].operation(function(){for(var Ft=0;Ft<ct.length;Ft++)it(ct[Ft])})}}var Cg=!1;function Rl(){Cg||(jd(),Cg=!0)}function jd(){var it;gn(window,"resize",function(){it==null&&(it=setTimeout(function(){it=null,tm(Eg)},100))}),gn(window,"blur",function(){return tm(_a)})}function Eg(it){var at=it.display;at.cachedCharWidth=at.cachedTextHeight=at.cachedPaddingH=null,at.scrollbarsClipped=!1,it.setSize()}for(var Gu={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"},Fc=0;Fc<10;Fc++)Gu[Fc+48]=Gu[Fc+96]=String(Fc);for(var mf=65;mf<=90;mf++)Gu[mf]=String.fromCharCode(mf);for(var Mc=1;Mc<=12;Mc++)Gu[Mc+111]=Gu[Mc+63235]="F"+Mc;var Pl={};Pl.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"},Pl.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"},Pl.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"},Pl.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"]},Pl.default=ht?Pl.macDefault:Pl.pcDefault;function Lg(it){var at=it.split(/-(?!$)/);it=at[at.length-1];for(var ct,dt,mt,Ft,It=0;It<at.length-1;It++){var Kt=at[It];if(/^(cmd|meta|m)$/i.test(Kt))Ft=!0;else if(/^a(lt)?$/i.test(Kt))ct=!0;else if(/^(c|ctrl|control)$/i.test(Kt))dt=!0;else if(/^s(hift)?$/i.test(Kt))mt=!0;else throw new Error("Unrecognized modifier name: "+Kt)}return ct&&(it="Alt-"+it),dt&&(it="Ctrl-"+it),Ft&&(it="Cmd-"+it),mt&&(it="Shift-"+it),it}function Fg(it){var at={};for(var ct in it)if(it.hasOwnProperty(ct)){var dt=it[ct];if(/^(name|fallthrough|(de|at)tach)$/.test(ct))continue;if(dt=="..."){delete it[ct];continue}for(var mt=En(ct.split(" "),Lg),Ft=0;Ft<mt.length;Ft++){var It=void 0,Kt=void 0;Ft==mt.length-1?(Kt=mt.join(" "),It=dt):(Kt=mt.slice(0,Ft+1).join(" "),It="...");var Wt=at[Kt];if(!Wt)at[Kt]=It;else if(Wt!=It)throw new Error("Inconsistent bindings for "+Kt)}delete it[ct]}for(var le in at)it[le]=at[le];return it}function tu(it,at,ct,dt){at=od(at);var mt=at.call?at.call(it,dt):at[it];if(mt===!1)return"nothing";if(mt==="...")return"multi";if(mt!=null&&ct(mt))return"handled";if(at.fallthrough){if(Object.prototype.toString.call(at.fallthrough)!="[object Array]")return tu(it,at.fallthrough,ct,dt);for(var Ft=0;Ft<at.fallthrough.length;Ft++){var It=tu(it,at.fallthrough[Ft],ct,dt);if(It)return It}}}function zd(it){var at=typeof it=="string"?it:Gu[it.keyCode];return at=="Ctrl"||at=="Alt"||at=="Shift"||at=="Mod"}function Mg(it,at,ct){var dt=it;return at.altKey&&dt!="Alt"&&(it="Alt-"+it),(St?at.metaKey:at.ctrlKey)&&dt!="Ctrl"&&(it="Ctrl-"+it),(St?at.ctrlKey:at.metaKey)&&dt!="Mod"&&(it="Cmd-"+it),!ct&&at.shiftKey&&dt!="Shift"&&(it="Shift-"+it),it}function em(it,at){if(jt&&it.keyCode==34&&it.char)return!1;var ct=Gu[it.keyCode];return ct==null||it.altGraphKey?!1:(it.keyCode==3&&it.code&&(ct=it.code),Mg(ct,it,at))}function od(it){return typeof it=="string"?Pl[it]:it}function wl(it,at){for(var ct=it.doc.sel.ranges,dt=[],mt=0;mt<ct.length;mt++){for(var Ft=at(ct[mt]);dt.length&&$e(Ft.from,te(dt).to)<=0;){var It=dt.pop();if($e(It.from,Ft.from)<0){Ft.from=It.from;break}}dt.push(Ft)}Ni(it,function(){for(var Kt=dt.length-1;Kt>=0;Kt--)nd(it.doc,"",dt[Kt].from,dt[Kt].to,"+delete");Js(it)})}function kg(it,at,ct){var dt=De(it.text,at+ct,ct);return dt<0||dt>it.text.length?null:dt}function es(it,at,ct){var dt=kg(it,at.ch,ct);return dt==null?null:new Ie(at.line,dt,ct<0?"after":"before")}function kc(it,at,ct,dt,mt){if(it){at.doc.direction=="rtl"&&(mt=-mt);var Ft=qe(ct,at.doc.direction);if(Ft){var It=mt<0?te(Ft):Ft[0],Kt=mt<0==(It.level==1),Wt=Kt?"after":"before",le;if(It.level>0||at.doc.direction=="rtl"){var Ze=Al(at,ct);le=mt<0?ct.text.length-1:0;var ge=Gs(at,Ze,le).top;le=Ue(function(Sn){return Gs(at,Ze,Sn).top==ge},mt<0==(It.level==1)?It.from:It.to-1,le),Wt=="before"&&(le=kg(ct,le,1))}else le=mt<0?It.to:It.from;return new Ie(dt,le,Wt)}}return new Ie(dt,mt<0?ct.text.length:0,mt<0?"before":"after")}function vf(it,at,ct,dt){var mt=qe(at,it.doc.direction);if(!mt)return es(at,ct,dt);ct.ch>=at.text.length?(ct.ch=at.text.length,ct.sticky="before"):ct.ch<=0&&(ct.ch=0,ct.sticky="after");var Ft=Fe(mt,ct.ch,ct.sticky),It=mt[Ft];if(it.doc.direction=="ltr"&&It.level%2==0&&(dt>0?It.to>ct.ch:It.from<ct.ch))return es(at,ct,dt);var Kt=function(rr,Zr){return kg(at,rr instanceof Ie?rr.ch:rr,Zr)},Wt,le=function(rr){return it.options.lineWrapping?(Wt=Wt||Al(it,at),Re(it,at,Wt,rr)):{begin:0,end:at.text.length}},Ze=le(ct.sticky=="before"?Kt(ct,-1):ct.ch);if(it.doc.direction=="rtl"||It.level==1){var ge=It.level==1==dt<0,Sn=Kt(ct,ge?1:-1);if(Sn!=null&&(ge?Sn<=It.to&&Sn<=Ze.end:Sn>=It.from&&Sn>=Ze.begin)){var hn=ge?"before":"after";return new Ie(ct.line,Sn,hn)}}var xi=function(rr,Zr,xr){for(var Ur=function(Ma,ds){return ds?new Ie(ct.line,Kt(Ma,1),"before"):new Ie(ct.line,Ma,"after")};rr>=0&&rr<mt.length;rr+=Zr){var Eo=mt[rr],vr=Zr>0==(Eo.level!=1),Ho=vr?xr.begin:Kt(xr.end,-1);if(Eo.from<=Ho&&Ho<Eo.to||(Ho=vr?Eo.from:Kt(Eo.to,-1),xr.begin<=Ho&&Ho<xr.end))return Ur(Ho,vr)}},Fi=xi(Ft+dt,dt,Ze);if(Fi)return Fi;var Ri=dt>0?Ze.end:Kt(Ze.begin,-1);return Ri!=null&&!(dt>0&&Ri==at.text.length)&&(Fi=xi(dt>0?0:mt.length-1,dt,le(Ri)),Fi)?Fi:null}var Mh={selectAll:ts,singleSelection:function(it){return it.setSelection(it.getCursor("anchor"),it.getCursor("head"),Oe)},killLine:function(it){return wl(it,function(at){if(at.empty()){var ct=An(it.doc,at.head.line).text.length;return at.head.ch==ct&&at.head.line<it.lastLine()?{from:at.head,to:Ie(at.head.line+1,0)}:{from:at.head,to:Ie(at.head.line,ct)}}else return{from:at.from(),to:at.to()}})},deleteLine:function(it){return wl(it,function(at){return{from:Ie(at.from().line,0),to:ei(it.doc,Ie(at.to().line+1,0))}})},delLineLeft:function(it){return wl(it,function(at){return{from:Ie(at.from().line,0),to:at.from()}})},delWrappedLineLeft:function(it){return wl(it,function(at){var ct=it.charCoords(at.head,"div").top+5,dt=it.coordsChar({left:0,top:ct},"div");return{from:dt,to:at.from()}})},delWrappedLineRight:function(it){return wl(it,function(at){var ct=it.charCoords(at.head,"div").top+5,dt=it.coordsChar({left:it.display.lineDiv.offsetWidth+100,top:ct},"div");return{from:at.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(Ie(it.firstLine(),0))},goDocEnd:function(it){return it.extendSelection(Ie(it.lastLine()))},goLineStart:function(it){return it.extendSelectionsBy(function(at){return Zd(it,at.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(it){return it.extendSelectionsBy(function(at){return bg(it,at.head)},{origin:"+move",bias:1})},goLineEnd:function(it){return it.extendSelectionsBy(function(at){return Gd(it,at.head.line)},{origin:"+move",bias:-1})},goLineRight:function(it){return it.extendSelectionsBy(function(at){var ct=it.cursorCoords(at.head,"div").top+5;return it.coordsChar({left:it.display.lineDiv.offsetWidth+100,top:ct},"div")},ln)},goLineLeft:function(it){return it.extendSelectionsBy(function(at){var ct=it.cursorCoords(at.head,"div").top+5;return it.coordsChar({left:0,top:ct},"div")},ln)},goLineLeftSmart:function(it){return it.extendSelectionsBy(function(at){var ct=it.cursorCoords(at.head,"div").top+5,dt=it.coordsChar({left:0,top:ct},"div");return dt.ch<it.getLine(dt.line).search(/\S/)?bg(it,at.head):dt},ln)},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 at=[],ct=it.listSelections(),dt=it.options.tabSize,mt=0;mt<ct.length;mt++){var Ft=ct[mt].from(),It=re(it.getLine(Ft.line),Ft.ch,dt);at.push(yn(dt-It%dt))}it.replaceSelections(at)},defaultTab:function(it){it.somethingSelected()?it.indentSelection("add"):it.execCommand("insertTab")},transposeChars:function(it){return Ni(it,function(){for(var at=it.listSelections(),ct=[],dt=0;dt<at.length;dt++)if(at[dt].empty()){var mt=at[dt].head,Ft=An(it.doc,mt.line).text;if(Ft){if(mt.ch==Ft.length&&(mt=new Ie(mt.line,mt.ch-1)),mt.ch>0)mt=new Ie(mt.line,mt.ch+1),it.replaceRange(Ft.charAt(mt.ch-1)+Ft.charAt(mt.ch-2),Ie(mt.line,mt.ch-2),mt,"+transpose");else if(mt.line>it.doc.first){var It=An(it.doc,mt.line-1).text;It&&(mt=new Ie(mt.line,1),it.replaceRange(Ft.charAt(0)+it.doc.lineSeparator()+It.charAt(It.length-1),Ie(mt.line-1,It.length-1),mt,"+transpose"))}}ct.push(new ua(mt,mt))}it.setSelections(ct)})},newlineAndIndent:function(it){return Ni(it,function(){for(var at=it.listSelections(),ct=at.length-1;ct>=0;ct--)it.replaceRange(it.doc.lineSeparator(),at[ct].anchor,at[ct].head,"+input");at=it.listSelections();for(var dt=0;dt<at.length;dt++)it.indentLine(at[dt].from().line,null,!0);Js(it)})},openLine:function(it){return it.replaceSelection(`
|
|
`,"start")},toggleOverwrite:function(it){return it.toggleOverwrite()}};function Zd(it,at){var ct=An(it.doc,at),dt=Dn(ct);return dt!=ct&&(at=Gt(dt)),kc(!0,it,dt,at,1)}function Gd(it,at){var ct=An(it.doc,at),dt=Xn(ct);return dt!=ct&&(at=Gt(dt)),kc(!0,it,ct,at,-1)}function bg(it,at){var ct=Zd(it,at.line),dt=An(it.doc,ct.line),mt=qe(dt,it.doc.direction);if(!mt||mt[0].level==0){var Ft=Math.max(ct.ch,dt.text.search(/\S/)),It=at.line==ct.line&&at.ch<=Ft&&at.ch;return Ie(ct.line,It?0:Ft,ct.sticky)}return ct}function Hd(it,at,ct){if(typeof at=="string"&&(at=Mh[at],!at))return!1;it.display.input.ensurePolled();var dt=it.display.shift,mt=!1;try{it.isReadOnly()&&(it.state.suppressEdits=!0),ct&&(it.display.shift=!1),mt=at(it)!=dn}finally{it.display.shift=dt,it.state.suppressEdits=!1}return mt}function Ng(it,at,ct){for(var dt=0;dt<it.state.keyMaps.length;dt++){var mt=tu(at,it.state.keyMaps[dt],ct,it);if(mt)return mt}return it.options.extraKeys&&tu(at,it.options.extraKeys,ct,it)||tu(at,it.options.keyMap,ct,it)}var Hu=new Jt;function ad(it,at,ct,dt){var mt=it.state.keySeq;if(mt){if(zd(at))return"handled";if(/\'$/.test(at)?it.state.keySeq=null:Hu.set(50,function(){it.state.keySeq==mt&&(it.state.keySeq=null,it.display.input.reset())}),yf(it,mt+" "+at,ct,dt))return!0}return yf(it,at,ct,dt)}function yf(it,at,ct,dt){var mt=Ng(it,at,dt);return mt=="multi"&&(it.state.keySeq=at),mt=="handled"&&nr(it,"keyHandled",it,at,ct),(mt=="handled"||mt=="multi")&&(Rn(ct),ro(it)),!!mt}function Sf(it,at){var ct=em(at,!0);return ct?at.shiftKey&&!it.state.keySeq?ad(it,"Shift-"+ct,at,function(dt){return Hd(it,dt,!0)})||ad(it,ct,at,function(dt){if(typeof dt=="string"?/^go[A-Z]/.test(dt):dt.motion)return Hd(it,dt)}):ad(it,ct,at,function(dt){return Hd(it,dt)}):!1}function xf(it,at,ct){return ad(it,"'"+ct+"'",at,function(dt){return Hd(it,dt,!0)})}var sd=null;function Bg(it){var at=this;if(!(it.target&&it.target!=at.display.input.getField())&&(at.curOp.focus=xe(),!nn(at,it))){he&&Dt<11&&it.keyCode==27&&(it.returnValue=!1);var ct=it.keyCode;at.display.shift=ct==16||it.shiftKey;var dt=Sf(at,it);jt&&(sd=dt?ct:null,!dt&&ct==88&&!Xe&&(ht?it.metaKey:it.ctrlKey)&&at.replaceSelection("",null,"cut")),pt&&!ht&&!dt&&ct==46&&it.shiftKey&&!it.ctrlKey&&document.execCommand&&document.execCommand("cut"),ct==18&&!/\bCodeMirror-crosshair\b/.test(at.display.lineDiv.className)&&Ag(at)}}function Ag(it){var at=it.display.lineDiv;Pe(at,"CodeMirror-crosshair");function ct(dt){(dt.keyCode==18||!dt.altKey)&&(Ot(at,"CodeMirror-crosshair"),ze(document,"keyup",ct),ze(document,"mouseover",ct))}gn(document,"keyup",ct),gn(document,"mouseover",ct)}function Tg(it){it.keyCode==16&&(this.doc.sel.shift=!1),nn(this,it)}function bu(it){var at=this;if(!(it.target&&it.target!=at.display.input.getField())&&!(Uo(at.display,it)||nn(at,it)||it.ctrlKey&&!it.altKey||ht&&it.metaKey)){var ct=it.keyCode,dt=it.charCode;if(jt&&ct==sd){sd=null,Rn(it);return}if(!(jt&&(!it.which||it.which<10)&&Sf(at,it))){var mt=String.fromCharCode(dt==null?ct:dt);mt!="\b"&&(xf(at,it,mt)||at.display.input.onKeyPress(it))}}}var nm=400,Dg=function(it,at,ct){this.time=it,this.pos=at,this.button=ct};Dg.prototype.compare=function(it,at,ct){return this.time+nm>it&&$e(at,this.pos)==0&&ct==this.button};var Wd,ld;function Og(it,at){var ct=+new Date;return ld&&ld.compare(ct,it,at)?(Wd=ld=null,"triple"):Wd&&Wd.compare(ct,it,at)?(ld=new Dg(ct,it,at),Wd=null,"double"):(Wd=new Dg(ct,it,at),ld=null,"single")}function Nu(it){var at=this,ct=at.display;if(!(nn(at,it)||ct.activeTouch&&ct.input.supportsTouch())){if(ct.input.ensurePolled(),ct.shift=it.shiftKey,Uo(ct,it)){qt||(ct.scroller.draggable=!1,setTimeout(function(){return ct.scroller.draggable=!0},100));return}if(!Cf(at,it)){var dt=no(at,it),mt=Fn(it),Ft=dt?Og(dt,mt):"single";window.focus(),mt==1&&at.state.selectingText&&at.state.selectingText(it),!(dt&&Ig(at,mt,dt,Ft,it))&&(mt==1?dt?im(at,dt,Ft,it):Gi(it)==ct.scroller&&Rn(it):mt==2?(dt&&ff(at.doc,dt),setTimeout(function(){return ct.input.focus()},20)):mt==3&&(Et?at.display.input.onContextMenu(it):No(at)))}}}function Ig(it,at,ct,dt,mt){var Ft="Click";return dt=="double"?Ft="Double"+Ft:dt=="triple"&&(Ft="Triple"+Ft),Ft=(at==1?"Left":at==2?"Middle":"Right")+Ft,ad(it,Mg(Ft,mt),mt,function(It){if(typeof It=="string"&&(It=Mh[It]),!It)return!1;var Kt=!1;try{it.isReadOnly()&&(it.state.suppressEdits=!0),Kt=It(it,ct)!=dn}finally{it.state.suppressEdits=!1}return Kt})}function Pf(it,at,ct){var dt=it.getOption("configureMouse"),mt=dt?dt(it,at,ct):{};if(mt.unit==null){var Ft=st?ct.shiftKey&&ct.metaKey:ct.altKey;mt.unit=Ft?"rectangle":at=="single"?"char":at=="double"?"word":"line"}return(mt.extend==null||it.doc.extend)&&(mt.extend=it.doc.extend||ct.shiftKey),mt.addNew==null&&(mt.addNew=ht?ct.metaKey:ct.ctrlKey),mt.moveOnDrag==null&&(mt.moveOnDrag=!(ht?ct.altKey:ct.ctrlKey)),mt}function im(it,at,ct,dt){he?setTimeout(an(So,it),0):it.curOp.focus=xe();var mt=Pf(it,ct,dt),Ft=it.doc.sel,It;it.options.dragDrop&&xn&&!it.isReadOnly()&&ct=="single"&&(It=Ft.contains(at))>-1&&($e((It=Ft.ranges[It]).from(),at)<0||at.xRel>0)&&($e(It.to(),at)>0||at.xRel<0)?_g(it,dt,at,mt):ev(it,dt,at,mt)}function _g(it,at,ct,dt){var mt=it.display,Ft=!1,It=Gr(it,function(le){qt&&(mt.scroller.draggable=!1),it.state.draggingText=!1,ze(mt.wrapper.ownerDocument,"mouseup",It),ze(mt.wrapper.ownerDocument,"mousemove",Kt),ze(mt.scroller,"dragstart",Wt),ze(mt.scroller,"drop",It),Ft||(Rn(le),dt.addNew||ff(it.doc,ct,null,null,dt.extend),qt&&!Te||he&&Dt==9?setTimeout(function(){mt.wrapper.ownerDocument.body.focus({preventScroll:!0}),mt.input.focus()},20):mt.input.focus())}),Kt=function(le){Ft=Ft||Math.abs(at.clientX-le.clientX)+Math.abs(at.clientY-le.clientY)>=10},Wt=function(){return Ft=!0};qt&&(mt.scroller.draggable=!0),it.state.draggingText=It,It.copy=!dt.moveOnDrag,mt.scroller.dragDrop&&mt.scroller.dragDrop(),gn(mt.wrapper.ownerDocument,"mouseup",It),gn(mt.wrapper.ownerDocument,"mousemove",Kt),gn(mt.scroller,"dragstart",Wt),gn(mt.scroller,"drop",It),No(it),setTimeout(function(){return mt.input.focus()},20)}function Rg(it,at,ct){if(ct=="char")return new ua(at,at);if(ct=="word")return it.findWordAt(at);if(ct=="line")return new ua(Ie(at.line,0),ei(it.doc,Ie(at.line+1,0)));var dt=ct(it,at);return new ua(dt.from,dt.to)}function ev(it,at,ct,dt){var mt=it.display,Ft=it.doc;Rn(at);var It,Kt,Wt=Ft.sel,le=Wt.ranges;if(dt.addNew&&!dt.extend?(Kt=Ft.sel.contains(ct),Kt>-1?It=le[Kt]:It=new ua(ct,ct)):(It=Ft.sel.primary(),Kt=Ft.sel.primIndex),dt.unit=="rectangle")dt.addNew||(It=new ua(ct,ct)),ct=no(it,at,!0,!0),Kt=-1;else{var Ze=Rg(it,ct,dt.unit);dt.extend?It=cf(It,Ze.anchor,Ze.head,dt.extend):It=Ze}dt.addNew?Kt==-1?(Kt=le.length,Hs(Ft,gu(it,le.concat([It]),Kt),{scroll:!1,origin:"*mouse"})):le.length>1&&le[Kt].empty()&&dt.unit=="char"&&!dt.extend?(Hs(Ft,gu(it,le.slice(0,Kt).concat(le.slice(Kt+1)),0),{scroll:!1,origin:"*mouse"}),Wt=Ft.sel):Lh(Ft,Kt,It,sn):(Kt=0,Hs(Ft,new $l([It],0),sn),Wt=Ft.sel);var ge=ct;function Sn(xr){if($e(ge,xr)!=0)if(ge=xr,dt.unit=="rectangle"){for(var Ur=[],Eo=it.options.tabSize,vr=re(An(Ft,ct.line).text,ct.ch,Eo),Ho=re(An(Ft,xr.line).text,xr.ch,Eo),Ma=Math.min(vr,Ho),ds=Math.max(vr,Ho),ja=Math.min(ct.line,xr.line),fl=Math.min(it.lastLine(),Math.max(ct.line,xr.line));ja<=fl;ja++){var Ws=An(Ft,ja).text,as=Vn(Ws,Ma,Eo);Ma==ds?Ur.push(new ua(Ie(ja,as),Ie(ja,as))):Ws.length>as&&Ur.push(new ua(Ie(ja,as),Ie(ja,Vn(Ws,ds,Eo))))}Ur.length||Ur.push(new ua(ct,ct)),Hs(Ft,gu(it,Wt.ranges.slice(0,Kt).concat(Ur),Kt),{origin:"*mouse",scroll:!1}),it.scrollIntoView(xr)}else{var Cl=It,Ds=Rg(it,xr,dt.unit),ss=Cl.anchor,na;$e(Ds.anchor,ss)>0?(na=Ds.head,ss=Yn(Cl.from(),Ds.anchor)):(na=Ds.anchor,ss=hi(Cl.to(),Ds.head));var Va=Wt.ranges.slice(0);Va[Kt]=rm(it,new ua(ei(Ft,ss),na)),Hs(Ft,gu(it,Va,Kt),sn)}}var hn=mt.wrapper.getBoundingClientRect(),xi=0;function Fi(xr){var Ur=++xi,Eo=no(it,xr,!0,dt.unit=="rectangle");if(Eo)if($e(Eo,ge)!=0){it.curOp.focus=xe(),Sn(Eo);var vr=Ar(mt,Ft);(Eo.line>=vr.to||Eo.line<vr.from)&&setTimeout(Gr(it,function(){xi==Ur&&Fi(xr)}),150)}else{var Ho=xr.clientY<hn.top?-20:xr.clientY>hn.bottom?20:0;Ho&&setTimeout(Gr(it,function(){xi==Ur&&(mt.scroller.scrollTop+=Ho,Fi(xr))}),50)}}function Ri(xr){it.state.selectingText=!1,xi=1/0,xr&&(Rn(xr),mt.input.focus()),ze(mt.wrapper.ownerDocument,"mousemove",rr),ze(mt.wrapper.ownerDocument,"mouseup",Zr),Ft.history.lastSelOrigin=null}var rr=Gr(it,function(xr){xr.buttons===0||!Fn(xr)?Ri(xr):Fi(xr)}),Zr=Gr(it,Ri);it.state.selectingText=Zr,gn(mt.wrapper.ownerDocument,"mousemove",rr),gn(mt.wrapper.ownerDocument,"mouseup",Zr)}function rm(it,at){var ct=at.anchor,dt=at.head,mt=An(it.doc,ct.line);if($e(ct,dt)==0&&ct.sticky==dt.sticky)return at;var Ft=qe(mt);if(!Ft)return at;var It=Fe(Ft,ct.ch,ct.sticky),Kt=Ft[It];if(Kt.from!=ct.ch&&Kt.to!=ct.ch)return at;var Wt=It+(Kt.from==ct.ch==(Kt.level!=1)?0:1);if(Wt==0||Wt==Ft.length)return at;var le;if(dt.line!=ct.line)le=(dt.line-ct.line)*(it.doc.direction=="ltr"?1:-1)>0;else{var Ze=Fe(Ft,dt.ch,dt.sticky),ge=Ze-It||(dt.ch-ct.ch)*(Kt.level==1?-1:1);Ze==Wt-1||Ze==Wt?le=ge<0:le=ge>0}var Sn=Ft[Wt+(le?-1:0)],hn=le==(Sn.level==1),xi=hn?Sn.from:Sn.to,Fi=hn?"after":"before";return ct.ch==xi&&ct.sticky==Fi?at:new ua(new Ie(ct.line,xi,Fi),dt)}function wf(it,at,ct,dt){var mt,Ft;if(at.touches)mt=at.touches[0].clientX,Ft=at.touches[0].clientY;else try{mt=at.clientX,Ft=at.clientY}catch(Sn){return!1}if(mt>=Math.floor(it.display.gutters.getBoundingClientRect().right))return!1;dt&&Rn(at);var It=it.display,Kt=It.lineDiv.getBoundingClientRect();if(Ft>Kt.bottom||!vn(it,ct))return ti(at);Ft-=Kt.top-It.viewOffset;for(var Wt=0;Wt<it.display.gutterSpecs.length;++Wt){var le=It.gutters.childNodes[Wt];if(le&&le.getBoundingClientRect().right>=mt){var Ze=de(it.doc,Ft),ge=it.display.gutterSpecs[Wt];return Ve(it,ct,it,Ze,ge.className,at),ti(at)}}}function Cf(it,at){return wf(it,at,"gutterClick",!0)}function Ef(it,at){Uo(it.display,at)||om(it,at)||nn(it,at,"contextmenu")||Et||it.display.input.onContextMenu(at)}function om(it,at){return vn(it,"gutterContextMenu")?wf(it,at,"gutterContextMenu",!1):!1}function Lf(it){it.display.wrapper.className=it.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+it.options.theme.replace(/(^|\s)\s*/g," cm-s-"),du(it)}var kh={toString:function(){return"CodeMirror.Init"}},jg={},bc={};function am(it){var at=it.optionHandlers;function ct(dt,mt,Ft,It){it.defaults[dt]=mt,Ft&&(at[dt]=It?function(Kt,Wt,le){le!=kh&&Ft(Kt,Wt,le)}:Ft)}it.defineOption=ct,it.Init=kh,ct("value","",function(dt,mt){return dt.setValue(mt)},!0),ct("mode",null,function(dt,mt){dt.doc.modeOption=mt,Go(dt)},!0),ct("indentUnit",2,Go,!0),ct("indentWithTabs",!1),ct("smartIndent",!0),ct("tabSize",4,function(dt){pc(dt),du(dt),ir(dt)},!0),ct("lineSeparator",null,function(dt,mt){if(dt.doc.lineSep=mt,!!mt){var Ft=[],It=dt.doc.first;dt.doc.iter(function(Wt){for(var le=0;;){var Ze=Wt.text.indexOf(mt,le);if(Ze==-1)break;le=Ze+mt.length,Ft.push(Ie(It,Ze))}It++});for(var Kt=Ft.length-1;Kt>=0;Kt--)nd(dt.doc,mt,Ft[Kt],Ie(Ft[Kt].line,Ft[Kt].ch+mt.length))}}),ct("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(dt,mt,Ft){dt.state.specialChars=new RegExp(mt.source+(mt.test(" ")?"":"| "),"g"),Ft!=kh&&dt.refresh()}),ct("specialCharPlaceholder",so,function(dt){return dt.refresh()},!0),ct("electricChars",!0),ct("inputStyle",et?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),ct("spellcheck",!1,function(dt,mt){return dt.getInputField().spellcheck=mt},!0),ct("autocorrect",!1,function(dt,mt){return dt.getInputField().autocorrect=mt},!0),ct("autocapitalize",!1,function(dt,mt){return dt.getInputField().autocapitalize=mt},!0),ct("rtlMoveVisually",!gt),ct("wholeLineUpdateBefore",!0),ct("theme","default",function(dt){Lf(dt),Ss(dt)},!0),ct("keyMap","default",function(dt,mt,Ft){var It=od(mt),Kt=Ft!=kh&&od(Ft);Kt&&Kt.detach&&Kt.detach(dt,It),It.attach&&It.attach(dt,Kt||null)}),ct("extraKeys",null),ct("configureMouse",null),ct("lineWrapping",!1,sm,!0),ct("gutters",[],function(dt,mt){dt.display.gutterSpecs=Wa(mt,dt.options.lineNumbers),Ss(dt)},!0),ct("fixedGutter",!0,function(dt,mt){dt.display.gutters.style.left=mt?Xr(dt.display)+"px":"0",dt.refresh()},!0),ct("coverGutterNextToScrollbar",!1,function(dt){return rs(dt)},!0),ct("scrollbarStyle","native",function(dt){ul(dt),rs(dt),dt.display.scrollbars.setScrollTop(dt.doc.scrollTop),dt.display.scrollbars.setScrollLeft(dt.doc.scrollLeft)},!0),ct("lineNumbers",!1,function(dt,mt){dt.display.gutterSpecs=Wa(dt.options.gutters,mt),Ss(dt)},!0),ct("firstLineNumber",1,Ss,!0),ct("lineNumberFormatter",function(dt){return dt},Ss,!0),ct("showCursorWhenSelecting",!1,Zi,!0),ct("resetSelectionOnContextMenu",!0),ct("lineWiseCopyCut",!0),ct("pasteLinesPerSelection",!0),ct("selectionsMayTouch",!1),ct("readOnly",!1,function(dt,mt){mt=="nocursor"&&(_a(dt),dt.display.input.blur()),dt.display.input.readOnlyChanged(mt)}),ct("screenReaderLabel",null,function(dt,mt){mt=mt===""?null:mt,dt.display.input.screenReaderLabelChanged(mt)}),ct("disableInput",!1,function(dt,mt){mt||dt.display.input.reset()},!0),ct("dragDrop",!0,Ff),ct("allowDropFileTypes",null),ct("cursorBlinkRate",530),ct("cursorScrollMargin",0),ct("cursorHeight",1,Zi,!0),ct("singleCursorHeightPerLine",!0,Zi,!0),ct("workTime",100),ct("workDelay",100),ct("flattenSpans",!0,pc,!0),ct("addModeClass",!1,pc,!0),ct("pollInterval",100),ct("undoDepth",200,function(dt,mt){return dt.doc.history.undoDepth=mt}),ct("historyEventDelay",1250),ct("viewportMargin",10,function(dt){return dt.refresh()},!0),ct("maxHighlightLength",1e4,pc,!0),ct("moveInputWithCursor",!0,function(dt,mt){mt||dt.display.input.resetPosition()}),ct("tabindex",null,function(dt,mt){return dt.display.input.getField().tabIndex=mt||""}),ct("autofocus",null),ct("direction","ltr",function(dt,mt){return dt.doc.setDirection(mt)},!0),ct("phrases",null)}function Ff(it,at,ct){var dt=ct&&ct!=kh;if(!at!=!dt){var mt=it.display.dragFunctions,Ft=at?gn:ze;Ft(it.display.scroller,"dragstart",mt.start),Ft(it.display.scroller,"dragenter",mt.enter),Ft(it.display.scroller,"dragover",mt.over),Ft(it.display.scroller,"dragleave",mt.leave),Ft(it.display.scroller,"drop",mt.drop)}}function sm(it){it.options.lineWrapping?(Pe(it.display.wrapper,"CodeMirror-wrap"),it.display.sizer.style.minWidth="",it.display.sizerWidth=null):(Ot(it.display.wrapper,"CodeMirror-wrap"),hr(it)),Ki(it),ir(it),du(it),setTimeout(function(){return rs(it)},100)}function $o(it,at){var ct=this;if(!(this instanceof $o))return new $o(it,at);this.options=at=at?Ke(at):{},Ke(jg,at,!1);var dt=at.value;typeof dt=="string"?dt=new Ts(dt,at.mode,null,at.lineSeparator,at.direction):at.mode&&(dt.modeOption=at.mode),this.doc=dt;var mt=new $o.inputStyles[at.inputStyle](this),Ft=this.display=new wh(it,dt,mt,at);Ft.wrapper.CodeMirror=this,Lf(this),at.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),ul(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 Jt,keySeq:null,specialChars:null},at.autofocus&&!et&&Ft.input.focus(),he&&Dt<11&&setTimeout(function(){return ct.display.input.reset(!0)},20),Vd(this),Rl(),hl(this),this.curOp.forceUpdate=!0,uf(this,dt),at.autofocus&&!et||this.hasFocus()?setTimeout(function(){ct.hasFocus()&&!ct.state.focused&&$i(ct)},20):_a(this);for(var It in bc)bc.hasOwnProperty(It)&&bc[It](this,at[It],kh);Da(this),at.finishInit&&at.finishInit(this);for(var Kt=0;Kt<ud.length;++Kt)ud[Kt](this);Il(this),qt&&at.lineWrapping&&getComputedStyle(Ft.lineDiv).textRendering=="optimizelegibility"&&(Ft.lineDiv.style.textRendering="auto")}$o.defaults=jg,$o.optionHandlers=bc;function Vd(it){var at=it.display;gn(at.scroller,"mousedown",Gr(it,Nu)),he&&Dt<11?gn(at.scroller,"dblclick",Gr(it,function(Wt){if(!nn(it,Wt)){var le=no(it,Wt);if(!(!le||Cf(it,Wt)||Uo(it.display,Wt))){Rn(Wt);var Ze=it.findWordAt(le);ff(it.doc,Ze.anchor,Ze.head)}}})):gn(at.scroller,"dblclick",function(Wt){return nn(it,Wt)||Rn(Wt)}),gn(at.scroller,"contextmenu",function(Wt){return Ef(it,Wt)}),gn(at.input.getField(),"contextmenu",function(Wt){at.scroller.contains(Wt.target)||Ef(it,Wt)});var ct,dt={end:0};function mt(){at.activeTouch&&(ct=setTimeout(function(){return at.activeTouch=null},1e3),dt=at.activeTouch,dt.end=+new Date)}function Ft(Wt){if(Wt.touches.length!=1)return!1;var le=Wt.touches[0];return le.radiusX<=1&&le.radiusY<=1}function It(Wt,le){if(le.left==null)return!0;var Ze=le.left-Wt.left,ge=le.top-Wt.top;return Ze*Ze+ge*ge>20*20}gn(at.scroller,"touchstart",function(Wt){if(!nn(it,Wt)&&!Ft(Wt)&&!Cf(it,Wt)){at.input.ensurePolled(),clearTimeout(ct);var le=+new Date;at.activeTouch={start:le,moved:!1,prev:le-dt.end<=300?dt:null},Wt.touches.length==1&&(at.activeTouch.left=Wt.touches[0].pageX,at.activeTouch.top=Wt.touches[0].pageY)}}),gn(at.scroller,"touchmove",function(){at.activeTouch&&(at.activeTouch.moved=!0)}),gn(at.scroller,"touchend",function(Wt){var le=at.activeTouch;if(le&&!Uo(at,Wt)&&le.left!=null&&!le.moved&&new Date-le.start<300){var Ze=it.coordsChar(at.activeTouch,"page"),ge;!le.prev||It(le,le.prev)?ge=new ua(Ze,Ze):!le.prev.prev||It(le,le.prev.prev)?ge=it.findWordAt(Ze):ge=new ua(Ie(Ze.line,0),ei(it.doc,Ie(Ze.line+1,0))),it.setSelection(ge.anchor,ge.head),it.focus(),Rn(Wt)}mt()}),gn(at.scroller,"touchcancel",mt),gn(at.scroller,"scroll",function(){at.scroller.clientHeight&&(Qs(it,at.scroller.scrollTop),Jl(it,at.scroller.scrollLeft,!0),Ve(it,"scroll",it))}),gn(at.scroller,"mousewheel",function(Wt){return xs(it,Wt)}),gn(at.scroller,"DOMMouseScroll",function(Wt){return xs(it,Wt)}),gn(at.wrapper,"scroll",function(){return at.wrapper.scrollTop=at.wrapper.scrollLeft=0}),at.dragFunctions={enter:function(Wt){nn(it,Wt)||vi(Wt)},over:function(Wt){nn(it,Wt)||($p(it,Wt),vi(Wt))},start:function(Wt){return Qp(it,Wt)},drop:Gr(it,wg),leave:function(Wt){nn(it,Wt)||qp(it)}};var Kt=at.input.getField();gn(Kt,"keyup",function(Wt){return Tg.call(it,Wt)}),gn(Kt,"keydown",Gr(it,Bg)),gn(Kt,"keypress",Gr(it,bu)),gn(Kt,"focus",function(Wt){return $i(it,Wt)}),gn(Kt,"blur",function(Wt){return _a(it,Wt)})}var ud=[];$o.defineInitHook=function(it){return ud.push(it)};function hs(it,at,ct,dt){var mt=it.doc,Ft;ct==null&&(ct="add"),ct=="smart"&&(mt.mode.indent?Ft=$r(it,at).state:ct="prev");var It=it.options.tabSize,Kt=An(mt,at),Wt=re(Kt.text,null,It);Kt.stateAfter&&(Kt.stateAfter=null);var le=Kt.text.match(/^\s*/)[0],Ze;if(!dt&&!/\S/.test(Kt.text))Ze=0,ct="not";else if(ct=="smart"&&(Ze=mt.mode.indent(Ft,Kt.text.slice(le.length),Kt.text),Ze==dn||Ze>150)){if(!dt)return;ct="prev"}ct=="prev"?at>mt.first?Ze=re(An(mt,at-1).text,null,It):Ze=0:ct=="add"?Ze=Wt+it.options.indentUnit:ct=="subtract"?Ze=Wt-it.options.indentUnit:typeof ct=="number"&&(Ze=Wt+ct),Ze=Math.max(0,Ze);var ge="",Sn=0;if(it.options.indentWithTabs)for(var hn=Math.floor(Ze/It);hn;--hn)Sn+=It,ge+=" ";if(Sn<Ze&&(ge+=yn(Ze-Sn)),ge!=le)return nd(mt,ge,Ie(at,0),Ie(at,le.length),"+input"),Kt.stateAfter=null,!0;for(var xi=0;xi<mt.sel.ranges.length;xi++){var Fi=mt.sel.ranges[xi];if(Fi.head.line==at&&Fi.head.ch<le.length){var Ri=Ie(at,le.length);Lh(mt,xi,new ua(Ri,Ri));break}}}var cl=null;function hd(it){cl=it}function Nc(it,at,ct,dt,mt){var Ft=it.doc;it.display.shift=!1,dt||(dt=Ft.sel);var It=+new Date-200,Kt=mt=="paste"||it.state.pasteIncoming>It,Wt=zi(at),le=null;if(Kt&&dt.ranges.length>1)if(cl&&cl.text.join(`
|
|
`)==at){if(dt.ranges.length%cl.text.length==0){le=[];for(var Ze=0;Ze<cl.text.length;Ze++)le.push(Ft.splitLines(cl.text[Ze]))}}else Wt.length==dt.ranges.length&&it.options.pasteLinesPerSelection&&(le=En(Wt,function(rr){return[rr]}));for(var ge=it.curOp.updateInput,Sn=dt.ranges.length-1;Sn>=0;Sn--){var hn=dt.ranges[Sn],xi=hn.from(),Fi=hn.to();hn.empty()&&(ct&&ct>0?xi=Ie(xi.line,xi.ch-ct):it.state.overwrite&&!Kt?Fi=Ie(Fi.line,Math.min(An(Ft,Fi.line).text.length,Fi.ch+te(Wt).length)):Kt&&cl&&cl.lineWise&&cl.text.join(`
|
|
`)==Wt.join(`
|
|
`)&&(xi=Fi=Ie(xi.line,0)));var Ri={from:xi,to:Fi,text:le?le[Sn%le.length]:Wt,origin:mt||(Kt?"paste":it.state.cutIncoming>It?"cut":"+input")};Fh(it.doc,Ri),nr(it,"inputRead",it,Ri)}at&&!Kt&&Zg(it,at),Js(it),it.curOp.updateInput<2&&(it.curOp.updateInput=ge),it.curOp.typing=!0,it.state.pasteIncoming=it.state.cutIncoming=-1}function zg(it,at){var ct=it.clipboardData&&it.clipboardData.getData("Text");if(ct)return it.preventDefault(),!at.isReadOnly()&&!at.options.disableInput&&Ni(at,function(){return Nc(at,ct,0,null,"paste")}),!0}function Zg(it,at){if(!(!it.options.electricChars||!it.options.smartIndent))for(var ct=it.doc.sel,dt=ct.ranges.length-1;dt>=0;dt--){var mt=ct.ranges[dt];if(!(mt.head.ch>100||dt&&ct.ranges[dt-1].head.line==mt.head.line)){var Ft=it.getModeAt(mt.head),It=!1;if(Ft.electricChars){for(var Kt=0;Kt<Ft.electricChars.length;Kt++)if(at.indexOf(Ft.electricChars.charAt(Kt))>-1){It=hs(it,mt.head.line,"smart");break}}else Ft.electricInput&&Ft.electricInput.test(An(it.doc,mt.head.line).text.slice(0,mt.head.ch))&&(It=hs(it,mt.head.line,"smart"));It&&nr(it,"electricInput",it,mt.head.line)}}}function Gg(it){for(var at=[],ct=[],dt=0;dt<it.doc.sel.ranges.length;dt++){var mt=it.doc.sel.ranges[dt].head.line,Ft={anchor:Ie(mt,0),head:Ie(mt+1,0)};ct.push(Ft),at.push(it.getRange(Ft.anchor,Ft.head))}return{text:at,ranges:ct}}function Hg(it,at,ct,dt){it.setAttribute("autocorrect",ct?"":"off"),it.setAttribute("autocapitalize",dt?"":"off"),it.setAttribute("spellcheck",!!at)}function Wg(){var it=Ht("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),at=Ht("div",[it],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return qt?it.style.width="1000px":it.setAttribute("wrap","off"),Bt&&(it.style.border="1px solid black"),Hg(it),at}function bh(it){var at=it.optionHandlers,ct=it.helpers={};it.prototype={constructor:it,focus:function(){window.focus(),this.display.input.focus()},setOption:function(dt,mt){var Ft=this.options,It=Ft[dt];Ft[dt]==mt&&dt!="mode"||(Ft[dt]=mt,at.hasOwnProperty(dt)&&Gr(this,at[dt])(this,mt,It),Ve(this,"optionChange",this,dt))},getOption:function(dt){return this.options[dt]},getDoc:function(){return this.doc},addKeyMap:function(dt,mt){this.state.keyMaps[mt?"push":"unshift"](od(dt))},removeKeyMap:function(dt){for(var mt=this.state.keyMaps,Ft=0;Ft<mt.length;++Ft)if(mt[Ft]==dt||mt[Ft].name==dt)return mt.splice(Ft,1),!0},addOverlay:ur(function(dt,mt){var Ft=dt.token?dt:it.getMode(this.options,dt);if(Ft.startState)throw new Error("Overlays may not be stateful.");ri(this.state.overlays,{mode:Ft,modeSpec:dt,opaque:mt&&mt.opaque,priority:mt&&mt.priority||0},function(It){return It.priority}),this.state.modeGen++,ir(this)}),removeOverlay:ur(function(dt){for(var mt=this.state.overlays,Ft=0;Ft<mt.length;++Ft){var It=mt[Ft].modeSpec;if(It==dt||typeof dt=="string"&&It.name==dt){mt.splice(Ft,1),this.state.modeGen++,ir(this);return}}}),indentLine:ur(function(dt,mt,Ft){typeof mt!="string"&&typeof mt!="number"&&(mt==null?mt=this.options.smartIndent?"smart":"prev":mt=mt?"add":"subtract"),un(this.doc,dt)&&hs(this,dt,mt,Ft)}),indentSelection:ur(function(dt){for(var mt=this.doc.sel.ranges,Ft=-1,It=0;It<mt.length;It++){var Kt=mt[It];if(Kt.empty())Kt.head.line>Ft&&(hs(this,Kt.head.line,dt,!0),Ft=Kt.head.line,It==this.doc.sel.primIndex&&Js(this));else{var Wt=Kt.from(),le=Kt.to(),Ze=Math.max(Ft,Wt.line);Ft=Math.min(this.lastLine(),le.line-(le.ch?0:1))+1;for(var ge=Ze;ge<Ft;++ge)hs(this,ge,dt);var Sn=this.doc.sel.ranges;Wt.ch==0&&mt.length==Sn.length&&Sn[It].from().ch>0&&Lh(this.doc,It,new ua(Wt,Sn[It].to()),Oe)}}}),getTokenAt:function(dt,mt){return _i(this,dt,mt)},getLineTokens:function(dt,mt){return _i(this,Ie(dt),mt,!0)},getTokenTypeAt:function(dt){dt=ei(this.doc,dt);var mt=yr(this,An(this.doc,dt.line)),Ft=0,It=(mt.length-1)/2,Kt=dt.ch,Wt;if(Kt==0)Wt=mt[2];else for(;;){var le=Ft+It>>1;if((le?mt[le*2-1]:0)>=Kt)It=le;else if(mt[le*2+1]<Kt)Ft=le+1;else{Wt=mt[le*2+2];break}}var Ze=Wt?Wt.indexOf("overlay "):-1;return Ze<0?Wt:Ze==0?null:Wt.slice(0,Ze-1)},getModeAt:function(dt){var mt=this.doc.mode;return mt.innerMode?it.innerMode(mt,this.getTokenAt(dt).state).mode:mt},getHelper:function(dt,mt){return this.getHelpers(dt,mt)[0]},getHelpers:function(dt,mt){var Ft=[];if(!ct.hasOwnProperty(mt))return Ft;var It=ct[mt],Kt=this.getModeAt(dt);if(typeof Kt[mt]=="string")It[Kt[mt]]&&Ft.push(It[Kt[mt]]);else if(Kt[mt])for(var Wt=0;Wt<Kt[mt].length;Wt++){var le=It[Kt[mt][Wt]];le&&Ft.push(le)}else Kt.helperType&&It[Kt.helperType]?Ft.push(It[Kt.helperType]):It[Kt.name]&&Ft.push(It[Kt.name]);for(var Ze=0;Ze<It._global.length;Ze++){var ge=It._global[Ze];ge.pred(Kt,this)&&Ye(Ft,ge.val)==-1&&Ft.push(ge.val)}return Ft},getStateAfter:function(dt,mt){var Ft=this.doc;return dt=si(Ft,dt==null?Ft.first+Ft.size-1:dt),$r(this,dt+1,mt).state},cursorCoords:function(dt,mt){var Ft,It=this.doc.sel.primary();return dt==null?Ft=It.head:typeof dt=="object"?Ft=ei(this.doc,dt):Ft=dt?It.from():It.to(),Ro(this,Ft,mt||"page")},charCoords:function(dt,mt){return ma(this,ei(this.doc,dt),mt||"page")},coordsChar:function(dt,mt){return dt=Tl(this,dt,mt||"page"),Aa(this,dt.left,dt.top)},lineAtHeight:function(dt,mt){return dt=Tl(this,{top:dt,left:0},mt||"page").top,de(this.doc,dt+this.display.viewOffset)},heightAtLine:function(dt,mt,Ft){var It=!1,Kt;if(typeof dt=="number"){var Wt=this.doc.first+this.doc.size-1;dt<this.doc.first?dt=this.doc.first:dt>Wt&&(dt=Wt,It=!0),Kt=An(this.doc,dt)}else Kt=dt;return Ga(this,Kt,{top:0,left:0},mt||"page",Ft||It).top+(It?this.doc.height-Ui(Kt):0)},defaultTextHeight:function(){return sr(this.display)},defaultCharWidth:function(){return Pr(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(dt,mt,Ft,It,Kt){var Wt=this.display;dt=Ro(this,ei(this.doc,dt));var le=dt.bottom,Ze=dt.left;if(mt.style.position="absolute",mt.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(mt),Wt.sizer.appendChild(mt),It=="over")le=dt.top;else if(It=="above"||It=="near"){var ge=Math.max(Wt.wrapper.clientHeight,this.doc.height),Sn=Math.max(Wt.sizer.clientWidth,Wt.lineSpace.clientWidth);(It=="above"||dt.bottom+mt.offsetHeight>ge)&&dt.top>mt.offsetHeight?le=dt.top-mt.offsetHeight:dt.bottom+mt.offsetHeight<=ge&&(le=dt.bottom),Ze+mt.offsetWidth>Sn&&(Ze=Sn-mt.offsetWidth)}mt.style.top=le+"px",mt.style.left=mt.style.right="",Kt=="right"?(Ze=Wt.sizer.clientWidth-mt.offsetWidth,mt.style.right="0px"):(Kt=="left"?Ze=0:Kt=="middle"&&(Ze=(Wt.sizer.clientWidth-mt.offsetWidth)/2),mt.style.left=Ze+"px"),Ft&&la(this,{left:Ze,top:le,right:Ze+mt.offsetWidth,bottom:le+mt.offsetHeight})},triggerOnKeyDown:ur(Bg),triggerOnKeyPress:ur(bu),triggerOnKeyUp:Tg,triggerOnMouseDown:ur(Nu),execCommand:function(dt){if(Mh.hasOwnProperty(dt))return Mh[dt].call(null,this)},triggerElectric:ur(function(dt){Zg(this,dt)}),findPosH:function(dt,mt,Ft,It){var Kt=1;mt<0&&(Kt=-1,mt=-mt);for(var Wt=ei(this.doc,dt),le=0;le<mt&&(Wt=Bc(this.doc,Wt,Kt,Ft,It),!Wt.hitSide);++le);return Wt},moveH:ur(function(dt,mt){var Ft=this;this.extendSelectionsBy(function(It){return Ft.display.shift||Ft.doc.extend||It.empty()?Bc(Ft.doc,It.head,dt,mt,Ft.options.rtlMoveVisually):dt<0?It.from():It.to()},ln)}),deleteH:ur(function(dt,mt){var Ft=this.doc.sel,It=this.doc;Ft.somethingSelected()?It.replaceSelection("",null,"+delete"):wl(this,function(Kt){var Wt=Bc(It,Kt.head,dt,mt,!1);return dt<0?{from:Wt,to:Kt.head}:{from:Kt.head,to:Wt}})}),findPosV:function(dt,mt,Ft,It){var Kt=1,Wt=It;mt<0&&(Kt=-1,mt=-mt);for(var le=ei(this.doc,dt),Ze=0;Ze<mt;++Ze){var ge=Ro(this,le,"div");if(Wt==null?Wt=ge.left:ge.left=Wt,le=Nh(this,ge,Kt,Ft),le.hitSide)break}return le},moveV:ur(function(dt,mt){var Ft=this,It=this.doc,Kt=[],Wt=!this.display.shift&&!It.extend&&It.sel.somethingSelected();if(It.extendSelectionsBy(function(Ze){if(Wt)return dt<0?Ze.from():Ze.to();var ge=Ro(Ft,Ze.head,"div");Ze.goalColumn!=null&&(ge.left=Ze.goalColumn),Kt.push(ge.left);var Sn=Nh(Ft,ge,dt,mt);return mt=="page"&&Ze==It.sel.primary()&&Xl(Ft,ma(Ft,Sn,"div").top-ge.top),Sn},ln),Kt.length)for(var le=0;le<It.sel.ranges.length;le++)It.sel.ranges[le].goalColumn=Kt[le]}),findWordAt:function(dt){var mt=this.doc,Ft=An(mt,dt.line).text,It=dt.ch,Kt=dt.ch;if(Ft){var Wt=this.getHelper(dt,"wordChars");(dt.sticky=="before"||Kt==Ft.length)&&It?--It:++Kt;for(var le=Ft.charAt(It),Ze=Zt(le,Wt)?function(ge){return Zt(ge,Wt)}:/\s/.test(le)?function(ge){return/\s/.test(ge)}:function(ge){return!/\s/.test(ge)&&!Zt(ge)};It>0&&Ze(Ft.charAt(It-1));)--It;for(;Kt<Ft.length&&Ze(Ft.charAt(Kt));)++Kt}return new ua(Ie(dt.line,It),Ie(dt.line,Kt))},toggleOverwrite:function(dt){dt!=null&&dt==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?Pe(this.display.cursorDiv,"CodeMirror-overwrite"):Ot(this.display.cursorDiv,"CodeMirror-overwrite"),Ve(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==xe()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:ur(function(dt,mt){Dl(this,dt,mt)}),getScrollInfo:function(){var dt=this.display.scroller;return{left:dt.scrollLeft,top:dt.scrollTop,height:dt.scrollHeight-Qo(this)-this.display.barHeight,width:dt.scrollWidth-Qo(this)-this.display.barWidth,clientHeight:ms(this),clientWidth:ps(this)}},scrollIntoView:ur(function(dt,mt){dt==null?(dt={from:this.doc.sel.primary().head,to:null},mt==null&&(mt=this.options.cursorScrollMargin)):typeof dt=="number"?dt={from:Ie(dt,0),to:null}:dt.from==null&&(dt={from:dt,to:null}),dt.to||(dt.to=dt.from),dt.margin=mt||0,dt.from.line!=null?jo(this,dt):Ol(this,dt.from,dt.to,dt.margin)}),setSize:ur(function(dt,mt){var Ft=this,It=function(Wt){return typeof Wt=="number"||/^\d+$/.test(String(Wt))?Wt+"px":Wt};dt!=null&&(this.display.wrapper.style.width=It(dt)),mt!=null&&(this.display.wrapper.style.height=It(mt)),this.options.lineWrapping&&Yl(this);var Kt=this.display.viewFrom;this.doc.iter(Kt,this.display.viewTo,function(Wt){if(Wt.widgets){for(var le=0;le<Wt.widgets.length;le++)if(Wt.widgets[le].noHScroll){Ji(Ft,Kt,"widget");break}}++Kt}),this.curOp.forceUpdate=!0,Ve(this,"refresh",this)}),operation:function(dt){return Ni(this,dt)},startOperation:function(){return hl(this)},endOperation:function(){return Il(this)},refresh:ur(function(){var dt=this.display.cachedTextHeight;ir(this),this.curOp.forceUpdate=!0,du(this),Dl(this,this.doc.scrollLeft,this.doc.scrollTop),ys(this.display),(dt==null||Math.abs(dt-sr(this.display))>.5||this.options.lineWrapping)&&Ki(this),Ve(this,"refresh",this)}),swapDoc:ur(function(dt){var mt=this.doc;return mt.cm=null,this.state.selectingText&&this.state.selectingText(),uf(this,dt),du(this),this.display.input.reset(),Dl(this,dt.scrollLeft,dt.scrollTop),this.curOp.forceScroll=!0,nr(this,"swapDoc",this,mt),mt}),phrase:function(dt){var mt=this.options.phrases;return mt&&Object.prototype.hasOwnProperty.call(mt,dt)?mt[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}},tn(it),it.registerHelper=function(dt,mt,Ft){ct.hasOwnProperty(dt)||(ct[dt]=it[dt]={_global:[]}),ct[dt][mt]=Ft},it.registerGlobalHelper=function(dt,mt,Ft,It){it.registerHelper(dt,mt,It),ct[dt]._global.push({pred:Ft,val:It})}}function Bc(it,at,ct,dt,mt){var Ft=at,It=ct,Kt=An(it,at.line),Wt=mt&&it.direction=="rtl"?-ct:ct;function le(){var Zr=at.line+Wt;return Zr<it.first||Zr>=it.first+it.size?!1:(at=new Ie(Zr,at.ch,at.sticky),Kt=An(it,Zr))}function Ze(Zr){var xr;if(dt=="codepoint"){var Ur=Kt.text.charCodeAt(at.ch+(dt>0?0:-1));isNaN(Ur)?xr=null:xr=new Ie(at.line,Math.max(0,Math.min(Kt.text.length,at.ch+ct*(Ur>=55296&&Ur<56320?2:1))),-ct)}else mt?xr=vf(it.cm,Kt,at,ct):xr=es(Kt,at,ct);if(xr==null)if(!Zr&&le())at=kc(mt,it.cm,Kt,at.line,Wt);else return!1;else at=xr;return!0}if(dt=="char"||dt=="codepoint")Ze();else if(dt=="column")Ze(!0);else if(dt=="word"||dt=="group")for(var ge=null,Sn=dt=="group",hn=it.cm&&it.cm.getHelper(at,"wordChars"),xi=!0;!(ct<0&&!Ze(!xi));xi=!1){var Fi=Kt.text.charAt(at.ch)||`
|
|
`,Ri=Zt(Fi,hn)?"w":Sn&&Fi==`
|
|
`?"n":!Sn||/\s/.test(Fi)?null:"p";if(Sn&&!xi&&!Ri&&(Ri="s"),ge&&ge!=Ri){ct<0&&(ct=1,Ze(),at.sticky="after");break}if(Ri&&(ge=Ri),ct>0&&!Ze(!xi))break}var rr=wc(it,at,Ft,It,!0);return bn(Ft,rr)&&(rr.hitSide=!0),rr}function Nh(it,at,ct,dt){var mt=it.doc,Ft=at.left,It;if(dt=="page"){var Kt=Math.min(it.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),Wt=Math.max(Kt-.5*sr(it.display),3);It=(ct>0?at.bottom:at.top)+ct*Wt}else dt=="line"&&(It=ct>0?at.bottom+3:at.top-3);for(var le;le=Aa(it,Ft,It),!!le.outside;){if(ct<0?It<=0:It>=mt.height){le.hitSide=!0;break}It+=ct*5}return le}var va=function(it){this.cm=it,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new Jt,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};va.prototype.init=function(it){var at=this,ct=this,dt=ct.cm,mt=ct.div=it.lineDiv;Hg(mt,dt.options.spellcheck,dt.options.autocorrect,dt.options.autocapitalize);function Ft(Kt){for(var Wt=Kt.target;Wt;Wt=Wt.parentNode){if(Wt==mt)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(Wt.className))break}return!1}gn(mt,"paste",function(Kt){!Ft(Kt)||nn(dt,Kt)||zg(Kt,dt)||Dt<=11&&setTimeout(Gr(dt,function(){return at.updateFromDOM()}),20)}),gn(mt,"compositionstart",function(Kt){at.composing={data:Kt.data,done:!1}}),gn(mt,"compositionupdate",function(Kt){at.composing||(at.composing={data:Kt.data,done:!1})}),gn(mt,"compositionend",function(Kt){at.composing&&(Kt.data!=at.composing.data&&at.readFromDOMSoon(),at.composing.done=!0)}),gn(mt,"touchstart",function(){return ct.forceCompositionEnd()}),gn(mt,"input",function(){at.composing||at.readFromDOMSoon()});function It(Kt){if(!(!Ft(Kt)||nn(dt,Kt))){if(dt.somethingSelected())hd({lineWise:!1,text:dt.getSelections()}),Kt.type=="cut"&&dt.replaceSelection("",null,"cut");else if(dt.options.lineWiseCopyCut){var Wt=Gg(dt);hd({lineWise:!0,text:Wt.text}),Kt.type=="cut"&&dt.operation(function(){dt.setSelections(Wt.ranges,0,Oe),dt.replaceSelection("",null,"cut")})}else return;if(Kt.clipboardData){Kt.clipboardData.clearData();var le=cl.text.join(`
|
|
`);if(Kt.clipboardData.setData("Text",le),Kt.clipboardData.getData("Text")==le){Kt.preventDefault();return}}var Ze=Wg(),ge=Ze.firstChild;dt.display.lineSpace.insertBefore(Ze,dt.display.lineSpace.firstChild),ge.value=cl.text.join(`
|
|
`);var Sn=document.activeElement;_e(ge),setTimeout(function(){dt.display.lineSpace.removeChild(Ze),Sn.focus(),Sn==mt&&ct.showPrimarySelection()},50)}}gn(mt,"copy",It),gn(mt,"cut",It)},va.prototype.screenReaderLabelChanged=function(it){it?this.div.setAttribute("aria-label",it):this.div.removeAttribute("aria-label")},va.prototype.prepareSelection=function(){var it=Sr(this.cm,!1);return it.focus=document.activeElement==this.div,it},va.prototype.showSelection=function(it,at){!it||!this.cm.display.view.length||((it.focus||at)&&this.showPrimarySelection(),this.showMultipleSelections(it))},va.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},va.prototype.showPrimarySelection=function(){var it=this.getSelection(),at=this.cm,ct=at.doc.sel.primary(),dt=ct.from(),mt=ct.to();if(at.display.viewTo==at.display.viewFrom||dt.line>=at.display.viewTo||mt.line<at.display.viewFrom){it.removeAllRanges();return}var Ft=Ac(at,it.anchorNode,it.anchorOffset),It=Ac(at,it.focusNode,it.focusOffset);if(!(Ft&&!Ft.bad&&It&&!It.bad&&$e(Yn(Ft,It),dt)==0&&$e(hi(Ft,It),mt)==0)){var Kt=at.display.view,Wt=dt.line>=at.display.viewFrom&&Mf(at,dt)||{node:Kt[0].measure.map[2],offset:0},le=mt.line<at.display.viewTo&&Mf(at,mt);if(!le){var Ze=Kt[Kt.length-1].measure,ge=Ze.maps?Ze.maps[Ze.maps.length-1]:Ze.map;le={node:ge[ge.length-1],offset:ge[ge.length-2]-ge[ge.length-3]}}if(!Wt||!le){it.removeAllRanges();return}var Sn=it.rangeCount&&it.getRangeAt(0),hn;try{hn=ie(Wt.node,Wt.offset,le.offset,le.node)}catch(xi){}hn&&(!pt&&at.state.focused?(it.collapse(Wt.node,Wt.offset),hn.collapsed||(it.removeAllRanges(),it.addRange(hn))):(it.removeAllRanges(),it.addRange(hn)),Sn&&it.anchorNode==null?it.addRange(Sn):pt&&this.startGracePeriod()),this.rememberSelection()}},va.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)},va.prototype.showMultipleSelections=function(it){Xt(this.cm.display.cursorDiv,it.cursors),Xt(this.cm.display.selectionDiv,it.selection)},va.prototype.rememberSelection=function(){var it=this.getSelection();this.lastAnchorNode=it.anchorNode,this.lastAnchorOffset=it.anchorOffset,this.lastFocusNode=it.focusNode,this.lastFocusOffset=it.focusOffset},va.prototype.selectionInEditor=function(){var it=this.getSelection();if(!it.rangeCount)return!1;var at=it.getRangeAt(0).commonAncestorContainer;return Ne(this.div,at)},va.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},va.prototype.blur=function(){this.div.blur()},va.prototype.getField=function(){return this.div},va.prototype.supportsTouch=function(){return!0},va.prototype.receivedFocus=function(){var it=this;this.selectionInEditor()?this.pollSelection():Ni(this.cm,function(){return it.cm.curOp.selectionChanged=!0});function at(){it.cm.state.focused&&(it.pollSelection(),it.polling.set(it.cm.options.pollInterval,at))}this.polling.set(this.cm.options.pollInterval,at)},va.prototype.selectionChanged=function(){var it=this.getSelection();return it.anchorNode!=this.lastAnchorNode||it.anchorOffset!=this.lastAnchorOffset||it.focusNode!=this.lastFocusNode||it.focusOffset!=this.lastFocusOffset},va.prototype.pollSelection=function(){if(!(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())){var it=this.getSelection(),at=this.cm;if(nt&&ne&&this.cm.display.gutterSpecs.length&&Vg(it.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),this.focus();return}if(!this.composing){this.rememberSelection();var ct=Ac(at,it.anchorNode,it.anchorOffset),dt=Ac(at,it.focusNode,it.focusOffset);ct&&dt&&Ni(at,function(){Hs(at.doc,rh(ct,dt),Oe),(ct.bad||dt.bad)&&(at.curOp.selectionChanged=!0)})}}},va.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var it=this.cm,at=it.display,ct=it.doc.sel.primary(),dt=ct.from(),mt=ct.to();if(dt.ch==0&&dt.line>it.firstLine()&&(dt=Ie(dt.line-1,An(it.doc,dt.line-1).length)),mt.ch==An(it.doc,mt.line).text.length&&mt.line<it.lastLine()&&(mt=Ie(mt.line+1,0)),dt.line<at.viewFrom||mt.line>at.viewTo-1)return!1;var Ft,It,Kt;dt.line==at.viewFrom||(Ft=Wi(it,dt.line))==0?(It=Gt(at.view[0].line),Kt=at.view[0].node):(It=Gt(at.view[Ft].line),Kt=at.view[Ft-1].node.nextSibling);var Wt=Wi(it,mt.line),le,Ze;if(Wt==at.view.length-1?(le=at.viewTo-1,Ze=at.lineDiv.lastChild):(le=Gt(at.view[Wt+1].line)-1,Ze=at.view[Wt+1].node.previousSibling),!Kt)return!1;for(var ge=it.doc.splitLines(Ud(it,Kt,Ze,It,le)),Sn=yi(it.doc,Ie(It,0),Ie(le,An(it.doc,le).text.length));ge.length>1&&Sn.length>1;)if(te(ge)==te(Sn))ge.pop(),Sn.pop(),le--;else if(ge[0]==Sn[0])ge.shift(),Sn.shift(),It++;else break;for(var hn=0,xi=0,Fi=ge[0],Ri=Sn[0],rr=Math.min(Fi.length,Ri.length);hn<rr&&Fi.charCodeAt(hn)==Ri.charCodeAt(hn);)++hn;for(var Zr=te(ge),xr=te(Sn),Ur=Math.min(Zr.length-(ge.length==1?hn:0),xr.length-(Sn.length==1?hn:0));xi<Ur&&Zr.charCodeAt(Zr.length-xi-1)==xr.charCodeAt(xr.length-xi-1);)++xi;if(ge.length==1&&Sn.length==1&&It==dt.line)for(;hn&&hn>dt.ch&&Zr.charCodeAt(Zr.length-xi-1)==xr.charCodeAt(xr.length-xi-1);)hn--,xi++;ge[ge.length-1]=Zr.slice(0,Zr.length-xi).replace(/^\u200b+/,""),ge[0]=ge[0].slice(hn).replace(/\u200b+$/,"");var Eo=Ie(It,hn),vr=Ie(le,Sn.length?te(Sn).length-xi:0);if(ge.length>1||ge[0]||$e(Eo,vr))return nd(it.doc,ge,Eo,vr,"+input"),!0},va.prototype.ensurePolled=function(){this.forceCompositionEnd()},va.prototype.reset=function(){this.forceCompositionEnd()},va.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},va.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))},va.prototype.updateFromDOM=function(){var it=this;(this.cm.isReadOnly()||!this.pollContent())&&Ni(this.cm,function(){return ir(it.cm)})},va.prototype.setUneditable=function(it){it.contentEditable="false"},va.prototype.onKeyPress=function(it){it.charCode==0||this.composing||(it.preventDefault(),this.cm.isReadOnly()||Gr(this.cm,Nc)(this.cm,String.fromCharCode(it.charCode==null?it.keyCode:it.charCode),0))},va.prototype.readOnlyChanged=function(it){this.div.contentEditable=String(it!="nocursor")},va.prototype.onContextMenu=function(){},va.prototype.resetPosition=function(){},va.prototype.needsContentAttribute=!0;function Mf(it,at){var ct=Zs(it,at.line);if(!ct||ct.hidden)return null;var dt=An(it.doc,at.line),mt=Fa(ct,dt,at.line),Ft=qe(dt,it.doc.direction),It="left";if(Ft){var Kt=Fe(Ft,at.ch);It=Kt%2?"right":"left"}var Wt=hu(mt.map,at.ch,It);return Wt.offset=Wt.collapse=="right"?Wt.end:Wt.start,Wt}function Vg(it){for(var at=it;at;at=at.parentNode)if(/CodeMirror-gutter-wrapper/.test(at.className))return!0;return!1}function Kd(it,at){return at&&(it.bad=!0),it}function Ud(it,at,ct,dt,mt){var Ft="",It=!1,Kt=it.doc.lineSeparator(),Wt=!1;function le(hn){return function(xi){return xi.id==hn}}function Ze(){It&&(Ft+=Kt,Wt&&(Ft+=Kt),It=Wt=!1)}function ge(hn){hn&&(Ze(),Ft+=hn)}function Sn(hn){if(hn.nodeType==1){var xi=hn.getAttribute("cm-text");if(xi){ge(xi);return}var Fi=hn.getAttribute("cm-marker"),Ri;if(Fi){var rr=it.findMarks(Ie(dt,0),Ie(mt+1,0),le(+Fi));rr.length&&(Ri=rr[0].find(0))&&ge(yi(it.doc,Ri.from,Ri.to).join(Kt));return}if(hn.getAttribute("contenteditable")=="false")return;var Zr=/^(pre|div|p|li|table|br)$/i.test(hn.nodeName);if(!/^br$/i.test(hn.nodeName)&&hn.textContent.length==0)return;Zr&&Ze();for(var xr=0;xr<hn.childNodes.length;xr++)Sn(hn.childNodes[xr]);/^(pre|p)$/i.test(hn.nodeName)&&(Wt=!0),Zr&&(It=!0)}else hn.nodeType==3&&ge(hn.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;Sn(at),at!=ct;)at=at.nextSibling,Wt=!1;return Ft}function Ac(it,at,ct){var dt;if(at==it.display.lineDiv){if(dt=it.display.lineDiv.childNodes[ct],!dt)return Kd(it.clipPos(Ie(it.display.viewTo-1)),!0);at=null,ct=0}else for(dt=at;;dt=dt.parentNode){if(!dt||dt==it.display.lineDiv)return null;if(dt.parentNode&&dt.parentNode==it.display.lineDiv)break}for(var mt=0;mt<it.display.view.length;mt++){var Ft=it.display.view[mt];if(Ft.node==dt)return lm(Ft,at,ct)}}function lm(it,at,ct){var dt=it.text.firstChild,mt=!1;if(!at||!Ne(dt,at))return Kd(Ie(Gt(it.line),0),!0);if(at==dt&&(mt=!0,at=dt.childNodes[ct],ct=0,!at)){var Ft=it.rest?te(it.rest):it.line;return Kd(Ie(Gt(Ft),Ft.text.length),mt)}var It=at.nodeType==3?at:null,Kt=at;for(!It&&at.childNodes.length==1&&at.firstChild.nodeType==3&&(It=at.firstChild,ct&&(ct=It.nodeValue.length));Kt.parentNode!=dt;)Kt=Kt.parentNode;var Wt=it.measure,le=Wt.maps;function Ze(Ri,rr,Zr){for(var xr=-1;xr<(le?le.length:0);xr++)for(var Ur=xr<0?Wt.map:le[xr],Eo=0;Eo<Ur.length;Eo+=3){var vr=Ur[Eo+2];if(vr==Ri||vr==rr){var Ho=Gt(xr<0?it.line:it.rest[xr]),Ma=Ur[Eo]+Zr;return(Zr<0||vr!=Ri)&&(Ma=Ur[Eo+(Zr?1:0)]),Ie(Ho,Ma)}}}var ge=Ze(It,Kt,ct);if(ge)return Kd(ge,mt);for(var Sn=Kt.nextSibling,hn=It?It.nodeValue.length-ct:0;Sn;Sn=Sn.nextSibling){if(ge=Ze(Sn,Sn.firstChild,0),ge)return Kd(Ie(ge.line,ge.ch-hn),mt);hn+=Sn.textContent.length}for(var xi=Kt.previousSibling,Fi=ct;xi;xi=xi.previousSibling){if(ge=Ze(xi,xi.firstChild,-1),ge)return Kd(Ie(ge.line,ge.ch+Fi),mt);Fi+=xi.textContent.length}}var os=function(it){this.cm=it,this.prevInput="",this.pollingFast=!1,this.polling=new Jt,this.hasSelection=!1,this.composing=null};os.prototype.init=function(it){var at=this,ct=this,dt=this.cm;this.createField(it);var mt=this.textarea;it.wrapper.insertBefore(this.wrapper,it.wrapper.firstChild),Bt&&(mt.style.width="0px"),gn(mt,"input",function(){he&&Dt>=9&&at.hasSelection&&(at.hasSelection=null),ct.poll()}),gn(mt,"paste",function(It){nn(dt,It)||zg(It,dt)||(dt.state.pasteIncoming=+new Date,ct.fastPoll())});function Ft(It){if(!nn(dt,It)){if(dt.somethingSelected())hd({lineWise:!1,text:dt.getSelections()});else if(dt.options.lineWiseCopyCut){var Kt=Gg(dt);hd({lineWise:!0,text:Kt.text}),It.type=="cut"?dt.setSelections(Kt.ranges,null,Oe):(ct.prevInput="",mt.value=Kt.text.join(`
|
|
`),_e(mt))}else return;It.type=="cut"&&(dt.state.cutIncoming=+new Date)}}gn(mt,"cut",Ft),gn(mt,"copy",Ft),gn(it.scroller,"paste",function(It){if(!(Uo(it,It)||nn(dt,It))){if(!mt.dispatchEvent){dt.state.pasteIncoming=+new Date,ct.focus();return}var Kt=new Event("paste");Kt.clipboardData=It.clipboardData,mt.dispatchEvent(Kt)}}),gn(it.lineSpace,"selectstart",function(It){Uo(it,It)||Rn(It)}),gn(mt,"compositionstart",function(){var It=dt.getCursor("from");ct.composing&&ct.composing.range.clear(),ct.composing={start:It,range:dt.markText(It,dt.getCursor("to"),{className:"CodeMirror-composing"})}}),gn(mt,"compositionend",function(){ct.composing&&(ct.poll(),ct.composing.range.clear(),ct.composing=null)})},os.prototype.createField=function(it){this.wrapper=Wg(),this.textarea=this.wrapper.firstChild},os.prototype.screenReaderLabelChanged=function(it){it?this.textarea.setAttribute("aria-label",it):this.textarea.removeAttribute("aria-label")},os.prototype.prepareSelection=function(){var it=this.cm,at=it.display,ct=it.doc,dt=Sr(it);if(it.options.moveInputWithCursor){var mt=Ro(it,ct.sel.primary().head,"div"),Ft=at.wrapper.getBoundingClientRect(),It=at.lineDiv.getBoundingClientRect();dt.teTop=Math.max(0,Math.min(at.wrapper.clientHeight-10,mt.top+It.top-Ft.top)),dt.teLeft=Math.max(0,Math.min(at.wrapper.clientWidth-10,mt.left+It.left-Ft.left))}return dt},os.prototype.showSelection=function(it){var at=this.cm,ct=at.display;Xt(ct.cursorDiv,it.cursors),Xt(ct.selectionDiv,it.selection),it.teTop!=null&&(this.wrapper.style.top=it.teTop+"px",this.wrapper.style.left=it.teLeft+"px")},os.prototype.reset=function(it){if(!(this.contextMenuPending||this.composing)){var at=this.cm;if(at.somethingSelected()){this.prevInput="";var ct=at.getSelection();this.textarea.value=ct,at.state.focused&&_e(this.textarea),he&&Dt>=9&&(this.hasSelection=ct)}else it||(this.prevInput=this.textarea.value="",he&&Dt>=9&&(this.hasSelection=null))}},os.prototype.getField=function(){return this.textarea},os.prototype.supportsTouch=function(){return!1},os.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!et||xe()!=this.textarea))try{this.textarea.focus()}catch(it){}},os.prototype.blur=function(){this.textarea.blur()},os.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},os.prototype.receivedFocus=function(){this.slowPoll()},os.prototype.slowPoll=function(){var it=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){it.poll(),it.cm.state.focused&&it.slowPoll()})},os.prototype.fastPoll=function(){var it=!1,at=this;at.pollingFast=!0;function ct(){var dt=at.poll();!dt&&!it?(it=!0,at.polling.set(60,ct)):(at.pollingFast=!1,at.slowPoll())}at.polling.set(20,ct)},os.prototype.poll=function(){var it=this,at=this.cm,ct=this.textarea,dt=this.prevInput;if(this.contextMenuPending||!at.state.focused||wt(ct)&&!dt&&!this.composing||at.isReadOnly()||at.options.disableInput||at.state.keySeq)return!1;var mt=ct.value;if(mt==dt&&!at.somethingSelected())return!1;if(he&&Dt>=9&&this.hasSelection===mt||ht&&/[\uf700-\uf7ff]/.test(mt))return at.display.input.reset(),!1;if(at.doc.sel==at.display.selForContextMenu){var Ft=mt.charCodeAt(0);if(Ft==8203&&!dt&&(dt="\u200B"),Ft==8666)return this.reset(),this.cm.execCommand("undo")}for(var It=0,Kt=Math.min(dt.length,mt.length);It<Kt&&dt.charCodeAt(It)==mt.charCodeAt(It);)++It;return Ni(at,function(){Nc(at,mt.slice(It),dt.length-It,null,it.composing?"*compose":null),mt.length>1e3||mt.indexOf(`
|
|
`)>-1?ct.value=it.prevInput="":it.prevInput=mt,it.composing&&(it.composing.range.clear(),it.composing.range=at.markText(it.composing.start,at.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},os.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},os.prototype.onKeyPress=function(){he&&Dt>=9&&(this.hasSelection=null),this.fastPoll()},os.prototype.onContextMenu=function(it){var at=this,ct=at.cm,dt=ct.display,mt=at.textarea;at.contextMenuPending&&at.contextMenuPending();var Ft=no(ct,it),It=dt.scroller.scrollTop;if(!Ft||jt)return;var Kt=ct.options.resetSelectionOnContextMenu;Kt&&ct.doc.sel.contains(Ft)==-1&&Gr(ct,Hs)(ct.doc,rh(Ft),Oe);var Wt=mt.style.cssText,le=at.wrapper.style.cssText,Ze=at.wrapper.offsetParent.getBoundingClientRect();at.wrapper.style.cssText="position: static",mt.style.cssText=`position: absolute; width: 30px; height: 30px;
|
|
top: `+(it.clientY-Ze.top-5)+"px; left: "+(it.clientX-Ze.left-5)+`px;
|
|
z-index: 1000; background: `+(he?"rgba(255, 255, 255, .05)":"transparent")+`;
|
|
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var ge;qt&&(ge=window.scrollY),dt.input.focus(),qt&&window.scrollTo(null,ge),dt.input.reset(),ct.somethingSelected()||(mt.value=at.prevInput=" "),at.contextMenuPending=hn,dt.selForContextMenu=ct.doc.sel,clearTimeout(dt.detectingSelectAll);function Sn(){if(mt.selectionStart!=null){var Fi=ct.somethingSelected(),Ri="\u200B"+(Fi?mt.value:"");mt.value="\u21DA",mt.value=Ri,at.prevInput=Fi?"":"\u200B",mt.selectionStart=1,mt.selectionEnd=Ri.length,dt.selForContextMenu=ct.doc.sel}}function hn(){if(at.contextMenuPending==hn&&(at.contextMenuPending=!1,at.wrapper.style.cssText=le,mt.style.cssText=Wt,he&&Dt<9&&dt.scrollbars.setScrollTop(dt.scroller.scrollTop=It),mt.selectionStart!=null)){(!he||he&&Dt<9)&&Sn();var Fi=0,Ri=function(){dt.selForContextMenu==ct.doc.sel&&mt.selectionStart==0&&mt.selectionEnd>0&&at.prevInput=="\u200B"?Gr(ct,ts)(ct):Fi++<10?dt.detectingSelectAll=setTimeout(Ri,500):(dt.selForContextMenu=null,dt.input.reset())};dt.detectingSelectAll=setTimeout(Ri,200)}}if(he&&Dt>=9&&Sn(),Et){vi(it);var xi=function(){ze(window,"mouseup",xi),setTimeout(hn,20)};gn(window,"mouseup",xi)}else setTimeout(hn,50)},os.prototype.readOnlyChanged=function(it){it||this.reset(),this.textarea.disabled=it=="nocursor",this.textarea.readOnly=!!it},os.prototype.setUneditable=function(){},os.prototype.needsContentAttribute=!1;function um(it,at){if(at=at?Ke(at):{},at.value=it.value,!at.tabindex&&it.tabIndex&&(at.tabindex=it.tabIndex),!at.placeholder&&it.placeholder&&(at.placeholder=it.placeholder),at.autofocus==null){var ct=xe();at.autofocus=ct==it||it.getAttribute("autofocus")!=null&&ct==document.body}function dt(){it.value=Kt.getValue()}var mt;if(it.form&&(gn(it.form,"submit",dt),!at.leaveSubmitMethodAlone)){var Ft=it.form;mt=Ft.submit;try{var It=Ft.submit=function(){dt(),Ft.submit=mt,Ft.submit(),Ft.submit=It}}catch(Wt){}}at.finishInit=function(Wt){Wt.save=dt,Wt.getTextArea=function(){return it},Wt.toTextArea=function(){Wt.toTextArea=isNaN,dt(),it.parentNode.removeChild(Wt.getWrapperElement()),it.style.display="",it.form&&(ze(it.form,"submit",dt),!at.leaveSubmitMethodAlone&&typeof it.form.submit=="function"&&(it.form.submit=mt))}},it.style.display="none";var Kt=$o(function(Wt){return it.parentNode.insertBefore(Wt,it.nextSibling)},at);return Kt}function Yd(it){it.off=ze,it.on=gn,it.wheelEventPixels=_l,it.Doc=Ts,it.splitLines=zi,it.countColumn=re,it.findColumn=Vn,it.isWordChar=Nt,it.Pass=dn,it.signal=Ve,it.Line=ao,it.changeEnd=Ch,it.scrollbarModel=cu,it.Pos=Ie,it.cmpPos=$e,it.modes=Vi,it.mimeModes=dr,it.resolveMode=In,it.getMode=pe,it.modeExtensions=Se,it.extendMode=ye,it.copyState=jn,it.startState=Kn,it.innerMode=Ln,it.commands=Mh,it.keyMap=Pl,it.keyName=em,it.isModifierKey=zd,it.lookupKey=tu,it.normalizeKeyMap=Fg,it.StringStream=Je,it.SharedTextMarker=Zu,it.TextMarker=ke,it.LineWidget=sh,it.e_preventDefault=Rn,it.e_stopPropagation=gi,it.e_stop=vi,it.addClass=Pe,it.contains=Ne,it.rmClass=Ot,it.keyNames=Gu}am($o),bh($o);var lh="iter insert remove copy getEditor constructor".split(" ");for(var Tc in Ts.prototype)Ts.prototype.hasOwnProperty(Tc)&&Ye(lh,Tc)<0&&($o.prototype[Tc]=function(it){return function(){return it.apply(this.doc,arguments)}}(Ts.prototype[Tc]));return tn(Ts),$o.inputStyles={textarea:os,contenteditable:va},$o.defineMode=function(it){!$o.defaults.mode&&it!="null"&&($o.defaults.mode=it),kr.apply(this,arguments)},$o.defineMIME=ci,$o.defineMode("null",function(){return{token:function(it){return it.skipToEnd()}}}),$o.defineMIME("text/plain","null"),$o.defineExtension=function(it,at){$o.prototype[it]=at},$o.defineDocExtension=function(it,at){Ts.prototype[it]=at},$o.fromTextArea=um,Yd($o),$o.version="5.58.2",$o})},25419:function(Bn,zn,kt){(function(pt){pt(kt(89780),kt(15525),kt(98101))})(function(pt){"use strict";pt.defineMode("markdown",function(Ut,ue){var Le=pt.getMode(Ut,"text/html"),he=Le.name=="null";function Dt(re){if(pt.findModeByName){var Jt=pt.findModeByName(re);Jt&&(re=Jt.mime||Jt.mimes[0])}var Ye=pt.getMode(Ut,re);return Ye.name=="null"?null:Ye}ue.highlightFormatting===void 0&&(ue.highlightFormatting=!1),ue.maxBlockquoteDepth===void 0&&(ue.maxBlockquoteDepth=0),ue.taskLists===void 0&&(ue.taskLists=!1),ue.strikethrough===void 0&&(ue.strikethrough=!1),ue.emoji===void 0&&(ue.emoji=!1),ue.fencedCodeBlockHighlighting===void 0&&(ue.fencedCodeBlockHighlighting=!0),ue.fencedCodeBlockDefaultMode===void 0&&(ue.fencedCodeBlockDefaultMode="text/plain"),ue.xml===void 0&&(ue.xml=!0),ue.tokenTypeOverrides===void 0&&(ue.tokenTypeOverrides={});var qt={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 me in qt)qt.hasOwnProperty(me)&&ue.tokenTypeOverrides[me]&&(qt[me]=ue.tokenTypeOverrides[me]);var ne=/^([*\-_])(?:\s*\1){2,}\s*$/,jt=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,Te=/^\[(x| )\](?=\s)/i,se=ue.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,Ce=/^ {0,3}(?:\={1,}|-{2,})\s*$/,Bt=/^[^#!\[\]*_\\<>` "'(~:]+/,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]/,st=" ";function gt(re,Jt,Ye){return Jt.f=Jt.inline=Ye,Ye(re,Jt)}function vt(re,Jt,Ye){return Jt.f=Jt.block=Ye,Ye(re,Jt)}function St(re){return!re||!/\S/.test(re.string)}function Et(re){if(re.linkTitle=!1,re.linkHref=!1,re.linkText=!1,re.em=!1,re.strong=!1,re.strikethrough=!1,re.quote=0,re.indentedCode=!1,re.f==Ot){var Jt=he;if(!Jt){var Ye=pt.innerMode(Le,re.htmlState);Jt=Ye.mode.name=="xml"&&Ye.state.tagStart===null&&!Ye.state.context&&Ye.state.tokenize.isInText}Jt&&(re.f=ve,re.block=Tt,re.htmlState=null)}return re.trailingSpace=0,re.trailingSpaceNewLine=!1,re.prevLine=re.thisLine,re.thisLine={stream:null},null}function Tt(re,Jt){var Ye=re.column()===Jt.indentation,Gn=St(Jt.prevLine.stream),dn=Jt.indentedCode,Oe=Jt.prevLine.hr,sn=Jt.list!==!1,ln=(Jt.listStack[Jt.listStack.length-1]||0)+3;Jt.indentedCode=!1;var Vn=Jt.indentation;if(Jt.indentationDiff===null&&(Jt.indentationDiff=Jt.indentation,sn)){for(Jt.list=null;Vn<Jt.listStack[Jt.listStack.length-1];)Jt.listStack.pop(),Jt.listStack.length?Jt.indentation=Jt.listStack[Jt.listStack.length-1]:Jt.list=!1;Jt.list!==!1&&(Jt.indentationDiff=Vn-Jt.listStack[Jt.listStack.length-1])}var Ae=!Gn&&!Oe&&!Jt.prevLine.header&&(!sn||!dn)&&!Jt.prevLine.fencedCodeEnd,yn=(Jt.list===!1||Oe||Gn)&&Jt.indentation<=ln&&re.match(ne),te=null;if(Jt.indentationDiff>=4&&(dn||Jt.prevLine.fencedCodeEnd||Jt.prevLine.header||Gn))return re.skipToEnd(),Jt.indentedCode=!0,qt.code;if(re.eatSpace())return null;if(Ye&&Jt.indentation<=ln&&(te=re.match(se))&&te[1].length<=6)return Jt.quote=0,Jt.header=te[1].length,Jt.thisLine.header=!0,ue.highlightFormatting&&(Jt.formatting="header"),Jt.f=Jt.inline,Xt(Jt);if(Jt.indentation<=ln&&re.eat(">"))return Jt.quote=Ye?1:Jt.quote+1,ue.highlightFormatting&&(Jt.formatting="quote"),re.eatSpace(),Xt(Jt);if(!yn&&!Jt.setext&&Ye&&Jt.indentation<=ln&&(te=re.match(jt))){var En=te[1]?"ol":"ul";return Jt.indentation=Vn+re.current().length,Jt.list=!0,Jt.quote=0,Jt.listStack.push(Jt.indentation),Jt.em=!1,Jt.strong=!1,Jt.code=!1,Jt.strikethrough=!1,ue.taskLists&&re.match(Te,!1)&&(Jt.taskList=!0),Jt.f=Jt.inline,ue.highlightFormatting&&(Jt.formatting=["list","list-"+En]),Xt(Jt)}else{if(Ye&&Jt.indentation<=ln&&(te=re.match(nt,!0)))return Jt.quote=0,Jt.fencedEndRE=new RegExp(te[1]+"+ *$"),Jt.localMode=ue.fencedCodeBlockHighlighting&&Dt(te[2]||ue.fencedCodeBlockDefaultMode),Jt.localMode&&(Jt.localState=pt.startState(Jt.localMode)),Jt.f=Jt.block=$t,ue.highlightFormatting&&(Jt.formatting="code-block"),Jt.code=-1,Xt(Jt);if(Jt.setext||(!Ae||!sn)&&!Jt.quote&&Jt.list===!1&&!Jt.code&&!yn&&!et.test(re.string)&&(te=re.lookAhead(1))&&(te=te.match(Ce)))return Jt.setext?(Jt.header=Jt.setext,Jt.setext=0,re.skipToEnd(),ue.highlightFormatting&&(Jt.formatting="header")):(Jt.header=te[0].charAt(0)=="="?1:2,Jt.setext=Jt.header),Jt.thisLine.header=!0,Jt.f=Jt.inline,Xt(Jt);if(yn)return re.skipToEnd(),Jt.hr=!0,Jt.thisLine.hr=!0,qt.hr;if(re.peek()==="[")return gt(re,Jt,Qe)}return gt(re,Jt,Jt.inline)}function Ot(re,Jt){var Ye=Le.token(re,Jt.htmlState);if(!he){var Gn=pt.innerMode(Le,Jt.htmlState);(Gn.mode.name=="xml"&&Gn.state.tagStart===null&&!Gn.state.context&&Gn.state.tokenize.isInText||Jt.md_inside&&re.current().indexOf(">")>-1)&&(Jt.f=ve,Jt.block=Tt,Jt.htmlState=null)}return Ye}function $t(re,Jt){var Ye=Jt.listStack[Jt.listStack.length-1]||0,Gn=Jt.indentation<Ye,dn=Ye+3;if(Jt.fencedEndRE&&Jt.indentation<=dn&&(Gn||re.match(Jt.fencedEndRE))){ue.highlightFormatting&&(Jt.formatting="code-block");var Oe;return Gn||(Oe=Xt(Jt)),Jt.localMode=Jt.localState=null,Jt.block=Tt,Jt.f=ve,Jt.fencedEndRE=null,Jt.code=0,Jt.thisLine.fencedCodeEnd=!0,Gn?vt(re,Jt,Jt.block):Oe}else return Jt.localMode?Jt.localMode.token(re,Jt.localState):(re.skipToEnd(),qt.code)}function Xt(re){var Jt=[];if(re.formatting){Jt.push(qt.formatting),typeof re.formatting=="string"&&(re.formatting=[re.formatting]);for(var Ye=0;Ye<re.formatting.length;Ye++)Jt.push(qt.formatting+"-"+re.formatting[Ye]),re.formatting[Ye]==="header"&&Jt.push(qt.formatting+"-"+re.formatting[Ye]+"-"+re.header),re.formatting[Ye]==="quote"&&(!ue.maxBlockquoteDepth||ue.maxBlockquoteDepth>=re.quote?Jt.push(qt.formatting+"-"+re.formatting[Ye]+"-"+re.quote):Jt.push("error"))}if(re.taskOpen)return Jt.push("meta"),Jt.length?Jt.join(" "):null;if(re.taskClosed)return Jt.push("property"),Jt.length?Jt.join(" "):null;if(re.linkHref?Jt.push(qt.linkHref,"url"):(re.strong&&Jt.push(qt.strong),re.em&&Jt.push(qt.em),re.strikethrough&&Jt.push(qt.strikethrough),re.emoji&&Jt.push(qt.emoji),re.linkText&&Jt.push(qt.linkText),re.code&&Jt.push(qt.code),re.image&&Jt.push(qt.image),re.imageAltText&&Jt.push(qt.imageAltText,"link"),re.imageMarker&&Jt.push(qt.imageMarker)),re.header&&Jt.push(qt.header,qt.header+"-"+re.header),re.quote&&(Jt.push(qt.quote),!ue.maxBlockquoteDepth||ue.maxBlockquoteDepth>=re.quote?Jt.push(qt.quote+"-"+re.quote):Jt.push(qt.quote+"-"+ue.maxBlockquoteDepth)),re.list!==!1){var Gn=(re.listStack.length-1)%3;Gn?Gn===1?Jt.push(qt.list2):Jt.push(qt.list3):Jt.push(qt.list1)}return re.trailingSpaceNewLine?Jt.push("trailing-space-new-line"):re.trailingSpace&&Jt.push("trailing-space-"+(re.trailingSpace%2?"a":"b")),Jt.length?Jt.join(" "):null}function Ht(re,Jt){if(re.match(Bt,!0))return Xt(Jt)}function ve(re,Jt){var Ye=Jt.text(re,Jt);if(typeof Ye!="undefined")return Ye;if(Jt.list)return Jt.list=null,Xt(Jt);if(Jt.taskList){var Gn=re.match(Te,!0)[1]===" ";return Gn?Jt.taskOpen=!0:Jt.taskClosed=!0,ue.highlightFormatting&&(Jt.formatting="task"),Jt.taskList=!1,Xt(Jt)}if(Jt.taskOpen=!1,Jt.taskClosed=!1,Jt.header&&re.match(/^#+$/,!0))return ue.highlightFormatting&&(Jt.formatting="header"),Xt(Jt);var dn=re.next();if(Jt.linkTitle){Jt.linkTitle=!1;var Oe=dn;dn==="("&&(Oe=")"),Oe=(Oe+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var sn="^\\s*(?:[^"+Oe+"\\\\]+|\\\\\\\\|\\\\.)"+Oe;if(re.match(new RegExp(sn),!0))return qt.linkHref}if(dn==="`"){var ln=Jt.formatting;ue.highlightFormatting&&(Jt.formatting="code"),re.eatWhile("`");var Vn=re.current().length;if(Jt.code==0&&(!Jt.quote||Vn==1))return Jt.code=Vn,Xt(Jt);if(Vn==Jt.code){var Ae=Xt(Jt);return Jt.code=0,Ae}else return Jt.formatting=ln,Xt(Jt)}else if(Jt.code)return Xt(Jt);if(dn==="\\"&&(re.next(),ue.highlightFormatting)){var yn=Xt(Jt),te=qt.formatting+"-escape";return yn?yn+" "+te:te}if(dn==="!"&&re.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return Jt.imageMarker=!0,Jt.image=!0,ue.highlightFormatting&&(Jt.formatting="image"),Xt(Jt);if(dn==="["&&Jt.imageMarker&&re.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return Jt.imageMarker=!1,Jt.imageAltText=!0,ue.highlightFormatting&&(Jt.formatting="image"),Xt(Jt);if(dn==="]"&&Jt.imageAltText){ue.highlightFormatting&&(Jt.formatting="image");var yn=Xt(Jt);return Jt.imageAltText=!1,Jt.image=!1,Jt.inline=Jt.f=Ne,yn}if(dn==="["&&!Jt.image)return Jt.linkText&&re.match(/^.*?\]/)||(Jt.linkText=!0,ue.highlightFormatting&&(Jt.formatting="link")),Xt(Jt);if(dn==="]"&&Jt.linkText){ue.highlightFormatting&&(Jt.formatting="link");var yn=Xt(Jt);return Jt.linkText=!1,Jt.inline=Jt.f=re.match(/\(.*?\)| ?\[.*?\]/,!1)?Ne:ve,yn}if(dn==="<"&&re.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){Jt.f=Jt.inline=ie,ue.highlightFormatting&&(Jt.formatting="link");var yn=Xt(Jt);return yn?yn+=" ":yn="",yn+qt.linkInline}if(dn==="<"&&re.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){Jt.f=Jt.inline=ie,ue.highlightFormatting&&(Jt.formatting="link");var yn=Xt(Jt);return yn?yn+=" ":yn="",yn+qt.linkEmail}if(ue.xml&&dn==="<"&&re.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var En=re.string.indexOf(">",re.pos);if(En!=-1){var ri=re.string.substring(re.start,En);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(ri)&&(Jt.md_inside=!0)}return re.backUp(1),Jt.htmlState=pt.startState(Le),vt(re,Jt,Ot)}if(ue.xml&&dn==="<"&&re.match(/^\/\w*?>/))return Jt.md_inside=!1,"tag";if(dn==="*"||dn==="_"){for(var Rt=1,Lt=re.pos==1?" ":re.string.charAt(re.pos-2);Rt<3&&re.eat(dn);)Rt++;var Pt=re.peek()||" ",Nt=!/\s/.test(Pt)&&(!ht.test(Pt)||/\s/.test(Lt)||ht.test(Lt)),Zt=!/\s/.test(Lt)&&(!ht.test(Lt)||/\s/.test(Pt)||ht.test(Pt)),Mt=null,Yt=null;if(Rt%2&&(!Jt.em&&Nt&&(dn==="*"||!Zt||ht.test(Lt))?Mt=!0:Jt.em==dn&&Zt&&(dn==="*"||!Nt||ht.test(Pt))&&(Mt=!1)),Rt>1&&(!Jt.strong&&Nt&&(dn==="*"||!Zt||ht.test(Lt))?Yt=!0:Jt.strong==dn&&Zt&&(dn==="*"||!Nt||ht.test(Pt))&&(Yt=!1)),Yt!=null||Mt!=null){ue.highlightFormatting&&(Jt.formatting=Mt==null?"strong":Yt==null?"em":"strong em"),Mt===!0&&(Jt.em=dn),Yt===!0&&(Jt.strong=dn);var Ae=Xt(Jt);return Mt===!1&&(Jt.em=!1),Yt===!1&&(Jt.strong=!1),Ae}}else if(dn===" "&&(re.eat("*")||re.eat("_"))){if(re.peek()===" ")return Xt(Jt);re.backUp(1)}if(ue.strikethrough){if(dn==="~"&&re.eatWhile(dn)){if(Jt.strikethrough){ue.highlightFormatting&&(Jt.formatting="strikethrough");var Ae=Xt(Jt);return Jt.strikethrough=!1,Ae}else if(re.match(/^[^\s]/,!1))return Jt.strikethrough=!0,ue.highlightFormatting&&(Jt.formatting="strikethrough"),Xt(Jt)}else if(dn===" "&&re.match(/^~~/,!0)){if(re.peek()===" ")return Xt(Jt);re.backUp(2)}}if(ue.emoji&&dn===":"&&re.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){Jt.emoji=!0,ue.highlightFormatting&&(Jt.formatting="emoji");var Ge=Xt(Jt);return Jt.emoji=!1,Ge}return dn===" "&&(re.match(/^ +$/,!1)?Jt.trailingSpace++:Jt.trailingSpace&&(Jt.trailingSpaceNewLine=!0)),Xt(Jt)}function ie(re,Jt){var Ye=re.next();if(Ye===">"){Jt.f=Jt.inline=ve,ue.highlightFormatting&&(Jt.formatting="link");var Gn=Xt(Jt);return Gn?Gn+=" ":Gn="",Gn+qt.linkInline}return re.match(/^[^>]+/,!0),qt.linkInline}function Ne(re,Jt){if(re.eatSpace())return null;var Ye=re.next();return Ye==="("||Ye==="["?(Jt.f=Jt.inline=Pe(Ye==="("?")":"]"),ue.highlightFormatting&&(Jt.formatting="link-string"),Jt.linkHref=!0,Xt(Jt)):"error"}var xe={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function Pe(re){return function(Jt,Ye){var Gn=Jt.next();if(Gn===re){Ye.f=Ye.inline=ve,ue.highlightFormatting&&(Ye.formatting="link-string");var dn=Xt(Ye);return Ye.linkHref=!1,dn}return Jt.match(xe[re]),Ye.linkHref=!0,Xt(Ye)}}function Qe(re,Jt){return re.match(/^([^\]\\]|\\.)*\]:/,!1)?(Jt.f=_e,re.next(),ue.highlightFormatting&&(Jt.formatting="link"),Jt.linkText=!0,Xt(Jt)):gt(re,Jt,ve)}function _e(re,Jt){if(re.match(/^\]:/,!0)){Jt.f=Jt.inline=an,ue.highlightFormatting&&(Jt.formatting="link");var Ye=Xt(Jt);return Jt.linkText=!1,Ye}return re.match(/^([^\]\\]|\\.)+/,!0),qt.linkText}function an(re,Jt){return re.eatSpace()?null:(re.match(/^[^\s]+/,!0),re.peek()===void 0?Jt.linkTitle=!0:re.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),Jt.f=Jt.inline=ve,qt.linkHref+" url")}var Ke={startState:function(){return{f:Tt,prevLine:{stream:null},thisLine:{stream:null},block:Tt,htmlState:null,indentation:0,inline:ve,text:Ht,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(re){return{f:re.f,prevLine:re.prevLine,thisLine:re.thisLine,block:re.block,htmlState:re.htmlState&&pt.copyState(Le,re.htmlState),indentation:re.indentation,localMode:re.localMode,localState:re.localMode?pt.copyState(re.localMode,re.localState):null,inline:re.inline,text:re.text,formatting:!1,linkText:re.linkText,linkTitle:re.linkTitle,linkHref:re.linkHref,code:re.code,em:re.em,strong:re.strong,strikethrough:re.strikethrough,emoji:re.emoji,header:re.header,setext:re.setext,hr:re.hr,taskList:re.taskList,list:re.list,listStack:re.listStack.slice(0),quote:re.quote,indentedCode:re.indentedCode,trailingSpace:re.trailingSpace,trailingSpaceNewLine:re.trailingSpaceNewLine,md_inside:re.md_inside,fencedEndRE:re.fencedEndRE}},token:function(re,Jt){if(Jt.formatting=!1,re!=Jt.thisLine.stream){if(Jt.header=0,Jt.hr=!1,re.match(/^\s*$/,!0))return Et(Jt),null;if(Jt.prevLine=Jt.thisLine,Jt.thisLine={stream:re},Jt.taskList=!1,Jt.trailingSpace=0,Jt.trailingSpaceNewLine=!1,!Jt.localState&&(Jt.f=Jt.block,Jt.f!=Ot)){var Ye=re.match(/^\s*/,!0)[0].replace(/\t/g,st).length;if(Jt.indentation=Ye,Jt.indentationDiff=null,Ye>0)return null}}return Jt.f(re,Jt)},innerMode:function(re){return re.block==Ot?{state:re.htmlState,mode:Le}:re.localState?{state:re.localState,mode:re.localMode}:{state:re,mode:Ke}},indent:function(re,Jt,Ye){return re.block==Ot&&Le.indent?Le.indent(re.htmlState,Jt,Ye):re.localState&&re.localMode.indent?re.localMode.indent(re.localState,Jt,Ye):pt.Pass},blankLine:Et,getType:Xt,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return Ke},"xml"),pt.defineMIME("text/markdown","markdown"),pt.defineMIME("text/x-markdown","markdown")})},98101:function(Bn,zn,kt){(function(pt){pt(kt(89780))})(function(pt){"use strict";pt.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 Ut=0;Ut<pt.modeInfo.length;Ut++){var ue=pt.modeInfo[Ut];ue.mimes&&(ue.mime=ue.mimes[0])}pt.findModeByMIME=function(Le){Le=Le.toLowerCase();for(var he=0;he<pt.modeInfo.length;he++){var Dt=pt.modeInfo[he];if(Dt.mime==Le)return Dt;if(Dt.mimes){for(var qt=0;qt<Dt.mimes.length;qt++)if(Dt.mimes[qt]==Le)return Dt}}if(/\+xml$/.test(Le))return pt.findModeByMIME("application/xml");if(/\+json$/.test(Le))return pt.findModeByMIME("application/json")},pt.findModeByExtension=function(Le){Le=Le.toLowerCase();for(var he=0;he<pt.modeInfo.length;he++){var Dt=pt.modeInfo[he];if(Dt.ext){for(var qt=0;qt<Dt.ext.length;qt++)if(Dt.ext[qt]==Le)return Dt}}},pt.findModeByFileName=function(Le){for(var he=0;he<pt.modeInfo.length;he++){var Dt=pt.modeInfo[he];if(Dt.file&&Dt.file.test(Le))return Dt}var qt=Le.lastIndexOf("."),me=qt>-1&&Le.substring(qt+1,Le.length);if(me)return pt.findModeByExtension(me)},pt.findModeByName=function(Le){Le=Le.toLowerCase();for(var he=0;he<pt.modeInfo.length;he++){var Dt=pt.modeInfo[he];if(Dt.name.toLowerCase()==Le)return Dt;if(Dt.alias){for(var qt=0;qt<Dt.alias.length;qt++)if(Dt.alias[qt].toLowerCase()==Le)return Dt}}}})},67549:function(Bn,zn,kt){(function(pt){pt(kt(89780))})(function(pt){"use strict";pt.defineMode("stex",function(Ut,ue){"use strict";function Le(Bt,nt){Bt.cmdState.push(nt)}function he(Bt){return Bt.cmdState.length>0?Bt.cmdState[Bt.cmdState.length-1]:null}function Dt(Bt){var nt=Bt.cmdState.pop();nt&&nt.closeBracket()}function qt(Bt){for(var nt=Bt.cmdState,et=nt.length-1;et>=0;et--){var ht=nt[et];if(ht.name!="DEFAULT")return ht}return{styleIdentifier:function(){return null}}}function me(Bt,nt,et){return function(){this.name=Bt,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 ne={};ne.importmodule=me("importmodule","tag",["string","builtin"]),ne.documentclass=me("documentclass","tag",["","atom"]),ne.usepackage=me("usepackage","tag",["atom"]),ne.begin=me("begin","tag",["atom"]),ne.end=me("end","tag",["atom"]),ne.label=me("label","tag",["atom"]),ne.ref=me("ref","tag",["atom"]),ne.eqref=me("eqref","tag",["atom"]),ne.cite=me("cite","tag",["atom"]),ne.bibitem=me("bibitem","tag",["atom"]),ne.Bibitem=me("Bibitem","tag",["atom"]),ne.RBibitem=me("RBibitem","tag",["atom"]),ne.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function jt(Bt,nt){Bt.f=nt}function Te(Bt,nt){var et;if(Bt.match(/^\\[a-zA-Z@]+/)){var ht=Bt.current().slice(1);return et=ne.hasOwnProperty(ht)?ne[ht]:ne.DEFAULT,et=new et,Le(nt,et),jt(nt,Ce),et.style}if(Bt.match(/^\\[$&%#{}_]/)||Bt.match(/^\\[,;!\/\\]/))return"tag";if(Bt.match("\\["))return jt(nt,function(gt,vt){return se(gt,vt,"\\]")}),"keyword";if(Bt.match("\\("))return jt(nt,function(gt,vt){return se(gt,vt,"\\)")}),"keyword";if(Bt.match("$$"))return jt(nt,function(gt,vt){return se(gt,vt,"$$")}),"keyword";if(Bt.match("$"))return jt(nt,function(gt,vt){return se(gt,vt,"$")}),"keyword";var st=Bt.next();if(st=="%")return Bt.skipToEnd(),"comment";if(st=="}"||st=="]"){if(et=he(nt),et)et.closeBracket(st),jt(nt,Ce);else return"error";return"bracket"}else return st=="{"||st=="["?(et=ne.DEFAULT,et=new et,Le(nt,et),"bracket"):/\d/.test(st)?(Bt.eatWhile(/[\w.%]/),"atom"):(Bt.eatWhile(/[\w\-_]/),et=qt(nt),et.name=="begin"&&(et.argument=Bt.current()),et.styleIdentifier())}function se(Bt,nt,et){if(Bt.eatSpace())return null;if(et&&Bt.match(et))return jt(nt,Te),"keyword";if(Bt.match(/^\\[a-zA-Z@]+/))return"tag";if(Bt.match(/^[a-zA-Z]+/))return"variable-2";if(Bt.match(/^\\[$&%#{}_]/)||Bt.match(/^\\[,;!\/]/)||Bt.match(/^[\^_&]/))return"tag";if(Bt.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(Bt.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var ht=Bt.next();return ht=="{"||ht=="}"||ht=="["||ht=="]"||ht=="("||ht==")"?"bracket":ht=="%"?(Bt.skipToEnd(),"comment"):"error"}function Ce(Bt,nt){var et=Bt.peek(),ht;return et=="{"||et=="["?(ht=he(nt),ht.openBracket(et),Bt.eat(et),jt(nt,Te),"bracket"):/[ \t\r]/.test(et)?(Bt.eat(et),null):(jt(nt,Te),Dt(nt),Te(Bt,nt))}return{startState:function(){var Bt=ue.inMathMode?function(nt,et){return se(nt,et)}:Te;return{cmdState:[],f:Bt}},copyState:function(Bt){return{cmdState:Bt.cmdState.slice(),f:Bt.f}},token:function(Bt,nt){return nt.f(Bt,nt)},blankLine:function(Bt){Bt.f=Te,Bt.cmdState.length=0},lineComment:"%"}}),pt.defineMIME("text/x-stex","stex"),pt.defineMIME("text/x-latex","stex")})},15525:function(Bn,zn,kt){(function(pt){pt(kt(89780))})(function(pt){"use strict";var Ut={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},ue={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};pt.defineMode("xml",function(Le,he){var Dt=Le.indentUnit,qt={},me=he.htmlMode?Ut:ue;for(var ne in me)qt[ne]=me[ne];for(var ne in he)qt[ne]=he[ne];var jt,Te;function se(ie,Ne){function xe(_e){return Ne.tokenize=_e,_e(ie,Ne)}var Pe=ie.next();if(Pe=="<")return ie.eat("!")?ie.eat("[")?ie.match("CDATA[")?xe(nt("atom","]]>")):null:ie.match("--")?xe(nt("comment","-->")):ie.match("DOCTYPE",!0,!0)?(ie.eatWhile(/[\w\._\-]/),xe(et(1))):null:ie.eat("?")?(ie.eatWhile(/[\w\._\-]/),Ne.tokenize=nt("meta","?>"),"meta"):(jt=ie.eat("/")?"closeTag":"openTag",Ne.tokenize=Ce,"tag bracket");if(Pe=="&"){var Qe;return ie.eat("#")?ie.eat("x")?Qe=ie.eatWhile(/[a-fA-F\d]/)&&ie.eat(";"):Qe=ie.eatWhile(/[\d]/)&&ie.eat(";"):Qe=ie.eatWhile(/[\w\.\-:]/)&&ie.eat(";"),Qe?"atom":"error"}else return ie.eatWhile(/[^&<]/),null}se.isInText=!0;function Ce(ie,Ne){var xe=ie.next();if(xe==">"||xe=="/"&&ie.eat(">"))return Ne.tokenize=se,jt=xe==">"?"endTag":"selfcloseTag","tag bracket";if(xe=="=")return jt="equals",null;if(xe=="<"){Ne.tokenize=se,Ne.state=vt,Ne.tagName=Ne.tagStart=null;var Pe=Ne.tokenize(ie,Ne);return Pe?Pe+" tag error":"tag error"}else return/[\'\"]/.test(xe)?(Ne.tokenize=Bt(xe),Ne.stringStartCol=ie.column(),Ne.tokenize(ie,Ne)):(ie.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function Bt(ie){var Ne=function(xe,Pe){for(;!xe.eol();)if(xe.next()==ie){Pe.tokenize=Ce;break}return"string"};return Ne.isInAttribute=!0,Ne}function nt(ie,Ne){return function(xe,Pe){for(;!xe.eol();){if(xe.match(Ne)){Pe.tokenize=se;break}xe.next()}return ie}}function et(ie){return function(Ne,xe){for(var Pe;(Pe=Ne.next())!=null;){if(Pe=="<")return xe.tokenize=et(ie+1),xe.tokenize(Ne,xe);if(Pe==">")if(ie==1){xe.tokenize=se;break}else return xe.tokenize=et(ie-1),xe.tokenize(Ne,xe)}return"meta"}}function ht(ie,Ne,xe){this.prev=ie.context,this.tagName=Ne,this.indent=ie.indented,this.startOfLine=xe,(qt.doNotIndent.hasOwnProperty(Ne)||ie.context&&ie.context.noIndent)&&(this.noIndent=!0)}function st(ie){ie.context&&(ie.context=ie.context.prev)}function gt(ie,Ne){for(var xe;;){if(!ie.context||(xe=ie.context.tagName,!qt.contextGrabbers.hasOwnProperty(xe)||!qt.contextGrabbers[xe].hasOwnProperty(Ne)))return;st(ie)}}function vt(ie,Ne,xe){return ie=="openTag"?(xe.tagStart=Ne.column(),St):ie=="closeTag"?Et:vt}function St(ie,Ne,xe){return ie=="word"?(xe.tagName=Ne.current(),Te="tag",$t):qt.allowMissingTagName&&ie=="endTag"?(Te="tag bracket",$t(ie,Ne,xe)):(Te="error",St)}function Et(ie,Ne,xe){if(ie=="word"){var Pe=Ne.current();return xe.context&&xe.context.tagName!=Pe&&qt.implicitlyClosed.hasOwnProperty(xe.context.tagName)&&st(xe),xe.context&&xe.context.tagName==Pe||qt.matchClosing===!1?(Te="tag",Tt):(Te="tag error",Ot)}else return qt.allowMissingTagName&&ie=="endTag"?(Te="tag bracket",Tt(ie,Ne,xe)):(Te="error",Ot)}function Tt(ie,Ne,xe){return ie!="endTag"?(Te="error",Tt):(st(xe),vt)}function Ot(ie,Ne,xe){return Te="error",Tt(ie,Ne,xe)}function $t(ie,Ne,xe){if(ie=="word")return Te="attribute",Xt;if(ie=="endTag"||ie=="selfcloseTag"){var Pe=xe.tagName,Qe=xe.tagStart;return xe.tagName=xe.tagStart=null,ie=="selfcloseTag"||qt.autoSelfClosers.hasOwnProperty(Pe)?gt(xe,Pe):(gt(xe,Pe),xe.context=new ht(xe,Pe,Qe==xe.indented)),vt}return Te="error",$t}function Xt(ie,Ne,xe){return ie=="equals"?Ht:(qt.allowMissing||(Te="error"),$t(ie,Ne,xe))}function Ht(ie,Ne,xe){return ie=="string"?ve:ie=="word"&&qt.allowUnquoted?(Te="string",$t):(Te="error",$t(ie,Ne,xe))}function ve(ie,Ne,xe){return ie=="string"?ve:$t(ie,Ne,xe)}return{startState:function(ie){var Ne={tokenize:se,state:vt,indented:ie||0,tagName:null,tagStart:null,context:null};return ie!=null&&(Ne.baseIndent=ie),Ne},token:function(ie,Ne){if(!Ne.tagName&&ie.sol()&&(Ne.indented=ie.indentation()),ie.eatSpace())return null;jt=null;var xe=Ne.tokenize(ie,Ne);return(xe||jt)&&xe!="comment"&&(Te=null,Ne.state=Ne.state(jt||xe,ie,Ne),Te&&(xe=Te=="error"?xe+" error":Te)),xe},indent:function(ie,Ne,xe){var Pe=ie.context;if(ie.tokenize.isInAttribute)return ie.tagStart==ie.indented?ie.stringStartCol+1:ie.indented+Dt;if(Pe&&Pe.noIndent)return pt.Pass;if(ie.tokenize!=Ce&&ie.tokenize!=se)return xe?xe.match(/^(\s*)/)[0].length:0;if(ie.tagName)return qt.multilineTagIndentPastTag!==!1?ie.tagStart+ie.tagName.length+2:ie.tagStart+Dt*(qt.multilineTagIndentFactor||1);if(qt.alignCDATA&&/<!\[CDATA\[/.test(Ne))return 0;var Qe=Ne&&/^<(\/)?([\w_:\.-]*)/.exec(Ne);if(Qe&&Qe[1])for(;Pe;)if(Pe.tagName==Qe[2]){Pe=Pe.prev;break}else if(qt.implicitlyClosed.hasOwnProperty(Pe.tagName))Pe=Pe.prev;else break;else if(Qe)for(;Pe;){var _e=qt.contextGrabbers[Pe.tagName];if(_e&&_e.hasOwnProperty(Qe[2]))Pe=Pe.prev;else break}for(;Pe&&Pe.prev&&!Pe.startOfLine;)Pe=Pe.prev;return Pe?Pe.indent+Dt:ie.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:qt.htmlMode?"html":"xml",helperType:qt.htmlMode?"html":"xml",skipAttribute:function(ie){ie.state==Ht&&(ie.state=$t)},xmlCurrentTag:function(ie){return ie.tagName?{name:ie.tagName,close:ie.type=="closeTag"}:null},xmlCurrentContext:function(ie){for(var Ne=[],xe=ie.context;xe;xe=xe.prev)xe.tagName&&Ne.push(xe.tagName);return Ne.reverse()}}}),pt.defineMIME("text/xml","xml"),pt.defineMIME("application/xml","xml"),pt.mimeModes.hasOwnProperty("text/html")||pt.defineMIME("text/html",{name:"xml",htmlMode:!0})})},12378:function(Bn,zn,kt){"use strict";kt.d(zn,{$u:function(){return ne},BD:function(){return Rt},E9:function(){return me},FF:function(){return Tn},FJ:function(){return vt},Hn:function(){return gt},KX:function(){return Et},NB:function(){return we},S0:function(){return te},UL:function(){return jt},Vk:function(){return st},Vm:function(){return Fe},YI:function(){return En},ZA:function(){return ue},Zt:function(){return Te},al:function(){return Mt},bn:function(){return Zt},bx:function(){return Lt},g2:function(){return ri},h1:function(){return Ht},hD:function(){return tn},l4:function(){return Dt},rU:function(){return Ee},s_:function(){return Pt},uz:function(){return Ue},z6:function(){return se}}),Bn=kt.hmd(Bn),function(){var wt;function Xe(a){var y=0;return function(){return y<a.length?{done:!1,value:a[y++]}:{done:!0}}}function Hn(a){var y=typeof Symbol!="undefined"&&Symbol.iterator&&a[Symbol.iterator];return y?y.call(a):{next:Xe(a)}}function Ai(a){for(var y,x=[];!(y=a.next()).done;)x.push(y.value);return x}var Vi=typeof Object.create=="function"?Object.create:function(a){function y(){}return y.prototype=a,new y},dr;if(typeof Object.setPrototypeOf=="function")dr=Object.setPrototypeOf;else{var kr;t:{var ci={a:!0},In={};try{In.__proto__=ci,kr=In.a;break t}catch(a){}kr=!1}dr=kr?function(a,y){if(a.__proto__=y,a.__proto__!==y)throw new TypeError(a+" is not extensible");return a}:null}var pe=dr;function Se(a,y){if(a.prototype=Vi(y.prototype),a.prototype.constructor=a,pe)pe(a,y);else for(var x in y)if(x!="prototype")if(Object.defineProperties){var E=Object.getOwnPropertyDescriptor(y,x);E&&Object.defineProperty(a,x,E)}else a[x]=y[x];a.QA=y.prototype}var ye=typeof kt.g!="undefined"&&kt.g!=null?kt.g:self,jn=typeof Object.assign=="function"?Object.assign:function(a,y){for(var x=1;x<arguments.length;x++){var E=arguments[x];if(E)for(var b in E)Object.prototype.hasOwnProperty.call(E,b)&&(a[b]=E[b])}return a},Ln=typeof Object.defineProperties=="function"?Object.defineProperty:function(a,y,x){a!=Array.prototype&&a!=Object.prototype&&(a[y]=x.value)};function Kn(a,y){if(y){var x=ye;a=a.split(".");for(var E=0;E<a.length-1;E++){var b=a[E];b in x||(x[b]={}),x=x[b]}a=a[a.length-1],E=x[a],y=y(E),y!=E&&y!=null&&Ln(x,a,{writable:!0,value:y})}}Kn("Object.assign",function(a){return a||jn}),Kn("Array.prototype.fill",function(a){return a||function(y,x,E){var b=this.length||0;for(0>x&&(x=Math.max(0,b+x)),(E==null||E>b)&&(E=b),E=Number(E),0>E&&(E=Math.max(0,b+E)),x=Number(x||0);x<E;x++)this[x]=y;return this}});var Je=typeof globalThis=="object"&&globalThis||typeof kt.g=="object"&&kt.g.global===kt.g&&kt.g||typeof self=="object"&&self.self===self&&self||{};Je.requestAnimationFrame===void 0&&(Je.setImmediate===void 0?Je.requestAnimationFrame=function(a){Je.setTimeout(a,0)}:Je.requestAnimationFrame=Je.setImmediate);function An(){}function yi(a,y){var x=-1;return function(){var E=this,b=arguments;x!==-1&&Je.clearTimeout(x),x=Ei(function(){x=-1,a.apply(E,b)},y)}}function Ei(a,y){return Je.setTimeout(a,y)}function Xi(a){return Je.document.createElement(a)}function Gt(a){throw Error(a)}function de(a,y){a="The object is frozen, so its properties cannot be set: "+a.toString(),y!==void 0&&(a+=" to value: "+y),Gt(a)}function un(a,y,x,E){x=x===null?"*":typeof x=="string"?x:typeof x=="function"&&typeof x.className=="string"?x.className:"",E!==void 0&&(x+="."+E),Gt(x+" is not in the range "+y+": "+a)}function Mn(a){Je.console&&Je.console.log(a)}function Ie(a){return typeof a=="object"&&a!==null}function $e(a){return Array.isArray(a)||Je.NodeList&&a instanceof Je.NodeList||Je.HTMLCollection&&a instanceof Je.HTMLCollection}function bn(a){return Array.prototype.slice.call(a)}function _n(a,y,x){Array.isArray(a)?y>=a.length?a.push(x):a.splice(y,0,x):Gt("Cannot insert an object into an HTMLCollection or NodeList: "+x+" at "+y)}function hi(a,y){Array.isArray(a)?y>=a.length?a.pop():a.splice(y,1):Gt("Cannot remove an object from an HTMLCollection or NodeList at "+y)}function Yn(){var a=$r.pop();return a===void 0?[]:a}function si(a){a.length=0,$r.push(a)}function ei(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(Ie(a)&&a.constructor)return ei(a.constructor);return typeof a}function Ii(a){var y=a;return Ie(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 Ti(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 Di(a,y,x){Object.defineProperty(Ar.prototype,a,{get:y,set:x})}function We(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 E=0,b=0;b<a.length;b+=2)x[E++]=y[a.substr(b,2)];for(a=x.join(""),a=a===""?"0":a,y=[],x=0;256>x;x++)y[x]=x;for(x=E=0;256>x;x++)E=(E+y[x]+119)%256,b=y[x],y[x]=y[E],y[E]=b;E=x=0;for(var z="",tt=0;tt<a.length;tt++)x=(x+1)%256,E=(E+y[x])%256,b=y[x],y[x]=y[E],y[E]=b,z+=String.fromCharCode(a.charCodeAt(tt)^y[(y[x]+y[E])%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 gr=Je.navigator!==void 0&&0<Je.navigator.userAgent.indexOf("Trident/7"),yr=Je.navigator!==void 0&&Je.navigator.platform!==void 0&&Je.navigator.platform.match(/(iPhone|iPod|iPad|Mac)/i)!==null,$r=[];Object.freeze([]),An.className="Util",An.Dx="32ab5ff3b26f42dc0ed90f21472913b5",An.adym="gojs.net",An.vfo="28e645fdb266",An.className="Util";function rn(a,y,x){Hi(this),this.j=a,this.xa=y,this.o=x}rn.prototype.toString=function(){return"EnumValue."+this.xa};function On(a,y){return y==null||y===""?null:a[y]}ye.Object.defineProperties(rn.prototype,{classType:{get:function(){return this.j}},name:{get:function(){return this.xa}},value:{get:function(){return this.o}}}),rn.className="EnumValue";function bi(){this.ew=[]}bi.prototype.toString=function(){return this.ew.join("")},bi.prototype.add=function(a){a!==""&&this.ew.push(a)},bi.className="StringBuilder";function Mi(){}Mi.className="PropertyCollection";var _i={EA:!1,JA:!1,GA:!1,IA:!1,NA:!1,LA:!1,nx:!1,FA:null,trace:function(a){Je.console&&Je.console.log(a)},HA:function(a,y,x,E){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(E.left,E.top+20),a.lineTo(E.left,E.top),a.lineTo(E.left+20,E.top),a.moveTo(E.right,E.bottom-20),a.lineTo(E.right,E.bottom),a.lineTo(E.right-20,E.bottom),a.stroke(),a.fillText("DB: "+Math.round(E.x)+", "+Math.round(E.y)+", "+Math.round(E.width)+", "+Math.round(E.height),E.left,E.top-5)},DA:function(a){var y={},x;for(x in a){if(y.x=x,y.x!=="licenseKey"){var E=a[y.x];if(E.prototype!==void 0){y.Zl=Object.getOwnPropertyNames(E.prototype);for(var b={Tj:0};b.Tj<y.Zl.length;b={Tj:b.Tj},b.Tj++){var z=Object.getOwnPropertyDescriptor(E.prototype,y.Zl[b.Tj]);z.get!==void 0&&z.set===void 0&&Object.defineProperty(E.prototype,y.Zl[b.Tj],{set:function(tt,rt){return function(){throw Error("Property "+tt.Zl[rt.Tj]+" of "+tt.x+" is read-only.")}}(y,b)})}}}y={Zl:y.Zl,x:y.x}}}};function tr(){}tr.prototype.reset=function(){},tr.prototype.next=function(){return!1},tr.prototype.Ad=function(){return!1},tr.prototype.first=function(){return null},tr.prototype.any=function(){return!1},tr.prototype.all=function(){return!0},tr.prototype.each=function(){return this},tr.prototype.map=function(){return this},tr.prototype.filter=function(){return this},tr.prototype.de=function(){},tr.prototype.toString=function(){return"EmptyIterator"},ye.Object.defineProperties(tr.prototype,{iterator:{get:function(){return this}},count:{get:function(){return 0}}}),tr.prototype.first=tr.prototype.first,tr.prototype.hasNext=tr.prototype.Ad,tr.prototype.next=tr.prototype.next,tr.prototype.reset=tr.prototype.reset;var pr=null;tr.className="EmptyIterator",pr=new tr;function br(a){this.key=-1,this.value=a}br.prototype.reset=function(){this.key=-1},br.prototype.next=function(){return this.key===-1?(this.key=0,!0):!1},br.prototype.Ad=function(){return this.next()},br.prototype.first=function(){return this.key=0,this.value},br.prototype.any=function(a){return this.key=-1,a(this.value)},br.prototype.all=function(a){return this.key=-1,a(this.value)},br.prototype.each=function(a){return this.key=-1,a(this.value),this},br.prototype.map=function(a){return new br(a(this.value))},br.prototype.filter=function(a){return a(this.value)?new br(this.value):pr},br.prototype.de=function(){this.value=null},br.prototype.toString=function(){return"SingletonIterator("+this.value+")"},ye.Object.defineProperties(br.prototype,{iterator:{get:function(){return this}},count:{get:function(){return 1}}}),br.prototype.first=br.prototype.first,br.prototype.hasNext=br.prototype.Ad,br.prototype.next=br.prototype.next,br.prototype.reset=br.prototype.reset,br.className="SingletonIterator";function Or(a){this.Bb=a,this.qf=null,a.Sa=null,this.qa=a.Ja,this.Za=-1}Or.prototype.reset=function(){var a=this.Bb;a.Sa=null,this.qa=a.Ja,this.Za=-1},Or.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,E=this.qf;if(E!==null)for(;x<y;){var b=a[x];if(E(b))return this.key=this.Za=x,this.value=b,!0;x++}else{if(x<y)return this.key=x,this.value=a[x],!0;this.de()}return!1},Or.prototype.Ad=function(){return this.next()},Or.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 E=0;E<y;){var b=a[E];if(x(b))return this.key=this.Za=E,this.value=b;E++}return null}return 0<y?(a=a[0],this.key=0,this.value=a):null},Or.prototype.any=function(a){var y=this.Bb;y.Sa=null,this.Za=-1,y=y.s;for(var x=y.length,E=this.qf,b=0;b<x;b++){var z=y[b];if((E===null||E(z))&&a(z))return!0}return!1},Or.prototype.all=function(a){var y=this.Bb;y.Sa=null,this.Za=-1,y=y.s;for(var x=y.length,E=this.qf,b=0;b<x;b++){var z=y[b];if((E===null||E(z))&&!a(z))return!1}return!0},Or.prototype.each=function(a){var y=this.Bb;y.Sa=null,this.Za=-1,y=y.s;for(var x=y.length,E=this.qf,b=0;b<x;b++){var z=y[b];(E===null||E(z))&&a(z)}return this},Or.prototype.map=function(a){var y=this.Bb;y.Sa=null,this.Za=-1;var x=[];y=y.s;for(var E=y.length,b=this.qf,z=0;z<E;z++){var tt=y[z];(b===null||b(tt))&&x.push(a(tt))}return a=new fn,a.s=x,a.xb(),a.iterator},Or.prototype.filter=function(a){var y=this.Bb;y.Sa=null,this.Za=-1;var x=[];y=y.s;for(var E=y.length,b=this.qf,z=0;z<E;z++){var tt=y[z];(b===null||b(tt))&&a(tt)&&x.push(tt)}return a=new fn,a.s=x,a.xb(),a.iterator},Or.prototype.de=function(){this.key=-1,this.value=null,this.qa=-1,this.qf=null,this.Bb.Sa=this},Or.prototype.toString=function(){return"ListIterator@"+this.Za+"/"+this.Bb.count},ye.Object.defineProperties(Or.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,E=x.length,b=0;b<E;b++)a(x[b])&&y++;return y}return this.Bb.s.length}}}),Or.prototype.first=Or.prototype.first,Or.prototype.hasNext=Or.prototype.Ad,Or.prototype.next=Or.prototype.next,Or.prototype.reset=Or.prototype.reset,Or.className="ListIterator";function Ir(a){this.Bb=a,a.Hg=null,this.qa=a.Ja,this.Za=a.s.length}Ir.prototype.reset=function(){var a=this.Bb;a.Hg=null,this.qa=a.Ja,this.Za=a.s.length},Ir.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)},Ir.prototype.Ad=function(){return this.next()},Ir.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},Ir.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},Ir.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},Ir.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},Ir.prototype.map=function(a){var y=this.Bb;y.Hg=null;var x=[];y=y.s;var E=y.length;for(this.Za=E,--E;0<=E;E--)x.push(a(y[E]));return a=new fn,a.s=x,a.xb(),a.iterator},Ir.prototype.filter=function(a){var y=this.Bb;y.Hg=null;var x=[];y=y.s;var E=y.length;for(this.Za=E,--E;0<=E;E--){var b=y[E];a(b)&&x.push(b)}return a=new fn,a.s=x,a.xb(),a.iterator},Ir.prototype.de=function(){this.key=-1,this.value=null,this.qa=-1,this.Bb.Hg=this},Ir.prototype.toString=function(){return"ListIteratorBackwards("+this.Za+"/"+this.Bb.count+")"},ye.Object.defineProperties(Ir.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.Bb.s.length}}}),Ir.prototype.first=Ir.prototype.first,Ir.prototype.hasNext=Ir.prototype.Ad,Ir.prototype.next=Ir.prototype.next,Ir.prototype.reset=Ir.prototype.reset,Ir.className="ListIteratorBackwards";function fn(a){Hi(this),this._isFrozen=!1,this.s=[],this.Ja=0,this.Hg=this.Sa=null,typeof a=="string"&&Gt("Error: Since 2.0 List/Map/Set constructors no longer take an argument that enforces type."),a!==void 0&&this.addAll(a)}wt=fn.prototype,wt.xb=function(){var a=this.Ja;a++,999999999<a&&(a=0),this.Ja=a},wt.freeze=function(){return this._isFrozen=!0,this},wt.ka=function(){return this._isFrozen=!1,this},wt.toString=function(){return"List()#"+ji(this)},wt.add=function(a){return a===null?this:(this._isFrozen&&de(this,a),this.s.push(a),this.xb(),this)},wt.push=function(a){this.add(a)},wt.addAll=function(a){if(a===null)return this;this._isFrozen&&de(this);var y=this.s;if($e(a))for(var x=a.length,E=0;E<x;E++)y.push(a[E]);else for(a=a.iterator;a.next();)y.push(a.value);return this.xb(),this},wt.clear=function(){this._isFrozen&&de(this),this.s.length=0,this.xb()},wt.contains=function(a){return a===null?!1:this.s.indexOf(a)!==-1},wt.has=function(a){return this.contains(a)},wt.indexOf=function(a){return a===null?-1:this.s.indexOf(a)},wt.M=function(a){var y=this.s;return(0>a||a>=y.length)&&un(a,"0 <= i < length",fn,"elt:i"),y[a]},wt.get=function(a){return this.M(a)},wt.cd=function(a,y){var x=this.s;(0>a||a>=x.length)&&un(a,"0 <= i < length",fn,"setElt:i"),this._isFrozen&&de(this,a),x[a]=y},wt.set=function(a,y){this.cd(a,y)},wt.first=function(){var a=this.s;return a.length===0?null:a[0]},wt.jc=function(){var a=this.s,y=a.length;return 0<y?a[y-1]:null},wt.pop=function(){this._isFrozen&&de(this);var a=this.s;return 0<a.length?a.pop():null},fn.prototype.any=function(a){for(var y=this.s,x=y.length,E=0;E<x;E++)if(a(y[E]))return!0;return!1},fn.prototype.all=function(a){for(var y=this.s,x=y.length,E=0;E<x;E++)if(!a(y[E]))return!1;return!0},fn.prototype.each=function(a){for(var y=this.s,x=y.length,E=0;E<x;E++)a(y[E]);return this},fn.prototype.map=function(a){for(var y=new fn,x=[],E=this.s,b=E.length,z=0;z<b;z++)x.push(a(E[z]));return y.s=x,y.xb(),y},fn.prototype.filter=function(a){for(var y=new fn,x=[],E=this.s,b=E.length,z=0;z<b;z++){var tt=E[z];a(tt)&&x.push(tt)}return y.s=x,y.xb(),y},wt=fn.prototype,wt.Gb=function(a,y){0>a&&un(a,">= 0",fn,"insertAt:i"),this._isFrozen&&de(this,a);var x=this.s;a>=x.length?x.push(y):x.splice(a,0,y),this.xb()},wt.remove=function(a){if(a===null)return!1;this._isFrozen&&de(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)},wt.delete=function(a){return this.remove(a)},wt.mb=function(a){var y=this.s;(0>a||a>=y.length)&&un(a,"0 <= i < length",fn,"removeAt:i"),this._isFrozen&&de(this,a),a===y.length-1?y.pop():y.splice(a,1),this.xb()},wt.removeRange=function(a,y){var x=this.s,E=x.length;if(0>a)a=0;else if(a>=E)return this;if(0>y)return this;if(y>=E&&(y=E-1),a>y)return this;this._isFrozen&&de(this);for(var b=a,z=y+1;z<E;)x[b++]=x[z++];return x.length=E-(y-a+1),this.xb(),this},fn.prototype.copy=function(){var a=new fn,y=this.s;return 0<y.length&&(a.s=Array.prototype.slice.call(y)),a},wt=fn.prototype,wt.Fa=function(){for(var a=this.s,y=this.count,x=Array(y),E=0;E<y;E++)x[E]=a[E];return x},wt.Iv=function(){for(var a=new pn,y=this.s,x=this.count,E=0;E<x;E++)a.add(y[E]);return a},wt.sort=function(a){return this._isFrozen&&de(this),this.s.sort(a),this.xb(),this},wt.zi=function(a,y,x){var E=this.s,b=E.length;y===void 0&&(y=0),x===void 0&&(x=b),this._isFrozen&&de(this);var z=x-y;if(1>=z)return this;if((0>y||y>=b-1)&&un(y,"0 <= from < length",fn,"sortRange:from"),z===2)return x=E[y],b=E[y+1],0<a(x,b)&&(E[y]=b,E[y+1]=x,this.xb()),this;if(y===0)if(x>=b)E.sort(a);else for(y=E.slice(0,x),y.sort(a),a=0;a<x;a++)E[a]=y[a];else if(x>=b)for(x=E.slice(y),x.sort(a),a=y;a<b;a++)E[a]=x[a-y];else for(b=E.slice(y,x),b.sort(a),a=y;a<x;a++)E[a]=b[a-y];return this.xb(),this},wt.reverse=function(){return this._isFrozen&&de(this),this.s.reverse(),this.xb(),this},ye.Object.defineProperties(fn.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 pr;var a=this.Sa;return a!==null?(a.reset(),a):new Or(this)}},iteratorBackwards:{get:function(){if(0>=this.s.length)return pr;var a=this.Hg;return a!==null?(a.reset(),a):new Ir(this)}}}),fn.prototype.reverse=fn.prototype.reverse,fn.prototype.sortRange=fn.prototype.zi,fn.prototype.sort=fn.prototype.sort,fn.prototype.toSet=fn.prototype.Iv,fn.prototype.toArray=fn.prototype.Fa,fn.prototype.removeRange=fn.prototype.removeRange,fn.prototype.removeAt=fn.prototype.mb,fn.prototype.delete=fn.prototype.delete,fn.prototype.remove=fn.prototype.remove,fn.prototype.insertAt=fn.prototype.Gb,fn.prototype.pop=fn.prototype.pop,fn.prototype.last=fn.prototype.jc,fn.prototype.first=fn.prototype.first,fn.prototype.set=fn.prototype.set,fn.prototype.setElt=fn.prototype.cd,fn.prototype.get=fn.prototype.get,fn.prototype.elt=fn.prototype.M,fn.prototype.indexOf=fn.prototype.indexOf,fn.prototype.has=fn.prototype.has,fn.prototype.contains=fn.prototype.contains,fn.prototype.clear=fn.prototype.clear,fn.prototype.addAll=fn.prototype.addAll,fn.prototype.push=fn.prototype.push,fn.prototype.add=fn.prototype.add,fn.prototype.thaw=fn.prototype.ka,fn.prototype.freeze=fn.prototype.freeze,fn.className="List";function ho(a){this.eg=a,a.Sa=null,this.qa=a.Ja,this.sa=null}ho.prototype.reset=function(){var a=this.eg;a.Sa=null,this.qa=a.Ja,this.sa=null},ho.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)},ho.prototype.Ad=function(){return this.next()},ho.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},ho.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},ho.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},ho.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},ho.prototype.map=function(a){var y=this.eg;y.Sa=null;var x=new fn;for(y=y.ea;y!==null;)x.add(a(y.value)),y=y.va;return x.iterator},ho.prototype.filter=function(a){var y=this.eg;y.Sa=null;var x=new fn;for(y=y.ea;y!==null;){var E=y.value;a(E)&&x.add(E),y=y.va}return x.iterator},ho.prototype.de=function(){this.value=this.key=null,this.qa=-1,this.eg.Sa=this},ho.prototype.toString=function(){return this.sa!==null?"SetIterator@"+this.sa.value:"SetIterator"},ye.Object.defineProperties(ho.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.eg.Sb}}}),ho.prototype.first=ho.prototype.first,ho.prototype.hasNext=ho.prototype.Ad,ho.prototype.next=ho.prototype.next,ho.prototype.reset=ho.prototype.reset,ho.className="SetIterator";function pn(a){Hi(this),this._isFrozen=!1,this.Tb={},this.Sb=0,this.Sa=null,this.Ja=0,this.kf=this.ea=null,typeof a=="string"&&Gt("Error: Since 2.0 List/Map/Set constructors no longer take an argument that enforces type."),a!==void 0&&this.addAll(a)}wt=pn.prototype,wt.xb=function(){var a=this.Ja;a++,999999999<a&&(a=0),this.Ja=a},wt.freeze=function(){return this._isFrozen=!0,this},wt.ka=function(){return this._isFrozen=!1,this},wt.toString=function(){return"Set()#"+ji(this)},wt.add=function(a){if(a===null)return this;this._isFrozen&&de(this,a);var y=a;return Ie(a)&&(y=Kr(a)),this.Tb[y]===void 0&&(this.Sb++,a=new je(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},wt.addAll=function(a){if(a===null)return this;if(this._isFrozen&&de(this),$e(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},wt.contains=function(a){if(a===null)return!1;var y=a;return Ie(a)&&(y=ji(a),y===void 0)?!1:this.Tb[y]!==void 0},wt.has=function(a){return this.contains(a)},wt.Sy=function(a){if(a===null)return!0;for(a=a.iterator;a.next();)if(!this.contains(a.value))return!1;return!0},wt.Ty=function(a){if(a===null)return!0;for(a=a.iterator;a.next();)if(this.contains(a.value))return!0;return!1},wt.first=function(){var a=this.ea;return a===null?null:a.value},pn.prototype.any=function(a){for(var y=this.ea;y!==null;){if(a(y.value))return!0;y=y.va}return!1},pn.prototype.all=function(a){for(var y=this.ea;y!==null;){if(!a(y.value))return!1;y=y.va}return!0},pn.prototype.each=function(a){for(var y=this.ea;y!==null;)a(y.value),y=y.va;return this},pn.prototype.map=function(a){for(var y=new pn,x=this.ea;x!==null;)y.add(a(x.value)),x=x.va;return y},pn.prototype.filter=function(a){for(var y=new pn,x=this.ea;x!==null;){var E=x.value;a(E)&&y.add(E),x=x.va}return y},wt=pn.prototype,wt.remove=function(a){if(a===null)return!1;this._isFrozen&&de(this,a);var y=a;if(Ie(a)&&(y=ji(a),y===void 0)||(a=this.Tb[y],a===void 0))return!1;var x=a.va,E=a.ll;return x!==null&&(x.ll=E),E!==null&&(E.va=x),this.ea===a&&(this.ea=x),this.kf===a&&(this.kf=E),delete this.Tb[y],this.Sb--,this.xb(),!0},wt.delete=function(a){return this.remove(a)},wt.hp=function(a){if(a===null)return this;if(this._isFrozen&&de(this),$e(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},wt.pA=function(a){if(a===null||this.count===0)return this;this._isFrozen&&de(this);var y=new pn;y.addAll(a),a=[];for(var x=this.iterator;x.next();){var E=x.value;y.contains(E)||a.push(E)}return this.hp(a),this},wt.clear=function(){this._isFrozen&&de(this),this.Tb={},this.Sb=0,this.Sa!==null&&this.Sa.reset(),this.kf=this.ea=null,this.xb()},pn.prototype.copy=function(){var a=new pn,y=this.Tb,x;for(x in y)a.add(y[x].value);return a},pn.prototype.Fa=function(){var a=Array(this.Sb),y=this.Tb,x=0,E;for(E in y)a[x]=y[E].value,x++;return a},pn.prototype.Hv=function(){var a=new fn,y=this.Tb,x;for(x in y)a.add(y[x].value);return a};function Hi(a){a.__gohashid=xo++}function Kr(a){var y=a.__gohashid;return y===void 0&&(y=xo++,a.__gohashid=y),y}function ji(a){return a.__gohashid}ye.Object.defineProperties(pn.prototype,{count:{get:function(){return this.Sb}},size:{get:function(){return this.Sb}},iterator:{get:function(){if(0>=this.Sb)return pr;var a=this.Sa;return a!==null?(a.reset(),a):new ho(this)}}}),pn.prototype.toList=pn.prototype.Hv,pn.prototype.toArray=pn.prototype.Fa,pn.prototype.clear=pn.prototype.clear,pn.prototype.retainAll=pn.prototype.pA,pn.prototype.removeAll=pn.prototype.hp,pn.prototype.delete=pn.prototype.delete,pn.prototype.remove=pn.prototype.remove,pn.prototype.first=pn.prototype.first,pn.prototype.containsAny=pn.prototype.Ty,pn.prototype.containsAll=pn.prototype.Sy,pn.prototype.has=pn.prototype.has,pn.prototype.contains=pn.prototype.contains,pn.prototype.addAll=pn.prototype.addAll,pn.prototype.add=pn.prototype.add,pn.prototype.thaw=pn.prototype.ka,pn.prototype.freeze=pn.prototype.freeze;var xo=1;pn.className="Set",pn.uniqueHash=Hi,pn.hashIdUnique=Kr,pn.hashId=ji;function Yr(a){this.ma=a,this.qa=a.Ja,this.sa=null}Yr.prototype.reset=function(){this.qa=this.ma.Ja,this.sa=null},Yr.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)},Yr.prototype.Ad=function(){return this.next()},Yr.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},Yr.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},Yr.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},Yr.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},Yr.prototype.map=function(a){var y=this.ma;this.sa=null;var x=new fn;for(y=y.ea;y!==null;)x.add(a(y.key)),y=y.va;return x.iterator},Yr.prototype.filter=function(a){var y=this.ma;this.sa=null;var x=new fn;for(y=y.ea;y!==null;){var E=y.key;a(E)&&x.add(E),y=y.va}return x.iterator},Yr.prototype.de=function(){this.value=this.key=null,this.qa=-1},Yr.prototype.toString=function(){return this.sa!==null?"MapKeySetIterator@"+this.sa.value:"MapKeySetIterator"},ye.Object.defineProperties(Yr.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.ma.Sb}}}),Yr.prototype.first=Yr.prototype.first,Yr.prototype.hasNext=Yr.prototype.Ad,Yr.prototype.next=Yr.prototype.next,Yr.prototype.reset=Yr.prototype.reset,Yr.className="MapKeySetIterator";function Cr(a){pn.call(this),Hi(this),this._isFrozen=!0,this.ma=a}Se(Cr,pn),wt=Cr.prototype,wt.freeze=function(){return this},wt.ka=function(){return this},wt.toString=function(){return"MapKeySet("+this.ma.toString()+")"},wt.add=function(){Gt("This Set is read-only: "+this.toString())},wt.contains=function(a){return this.ma.contains(a)},wt.has=function(a){return this.contains(a)},wt.remove=function(){Gt("This Set is read-only: "+this.toString())},wt.delete=function(a){return this.remove(a)},wt.clear=function(){Gt("This Set is read-only: "+this.toString())},wt.first=function(){var a=this.ma.ea;return a!==null?a.key:null},Cr.prototype.any=function(a){for(var y=this.ma.ea;y!==null;){if(a(y.key))return!0;y=y.va}return!1},Cr.prototype.all=function(a){for(var y=this.ma.ea;y!==null;){if(!a(y.key))return!1;y=y.va}return!0},Cr.prototype.each=function(a){for(var y=this.ma.ea;y!==null;)a(y.key),y=y.va;return this},Cr.prototype.map=function(a){for(var y=new pn,x=this.ma.ea;x!==null;)y.add(a(x.key)),x=x.va;return y},Cr.prototype.filter=function(a){for(var y=new pn,x=this.ma.ea;x!==null;){var E=x.key;a(E)&&y.add(E),x=x.va}return y},Cr.prototype.copy=function(){return new Cr(this.ma)},Cr.prototype.Iv=function(){var a=new pn,y=this.ma.Tb,x;for(x in y)a.add(y[x].key);return a},Cr.prototype.Fa=function(){var a=this.ma.Tb,y=Array(this.ma.Sb),x=0,E;for(E in a)y[x]=a[E].key,x++;return y},Cr.prototype.Hv=function(){var a=new fn,y=this.ma.Tb,x;for(x in y)a.add(y[x].key);return a},ye.Object.defineProperties(Cr.prototype,{count:{get:function(){return this.ma.Sb}},size:{get:function(){return this.ma.Sb}},iterator:{get:function(){return 0>=this.ma.Sb?pr:new Yr(this.ma)}}}),Cr.prototype.toList=Cr.prototype.Hv,Cr.prototype.toArray=Cr.prototype.Fa,Cr.prototype.toSet=Cr.prototype.Iv,Cr.prototype.first=Cr.prototype.first,Cr.prototype.clear=Cr.prototype.clear,Cr.prototype.delete=Cr.prototype.delete,Cr.prototype.remove=Cr.prototype.remove,Cr.prototype.has=Cr.prototype.has,Cr.prototype.contains=Cr.prototype.contains,Cr.prototype.add=Cr.prototype.add,Cr.prototype.thaw=Cr.prototype.ka,Cr.prototype.freeze=Cr.prototype.freeze,Cr.className="MapKeySet";function Po(a){this.ma=a,a.jf=null,this.qa=a.Ja,this.sa=null}Po.prototype.reset=function(){var a=this.ma;a.jf=null,this.qa=a.Ja,this.sa=null},Po.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)},Po.prototype.Ad=function(){return this.next()},Po.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},Po.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},Po.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},Po.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},Po.prototype.map=function(a){var y=this.ma;this.sa=y.jf=null;var x=new fn;for(y=y.ea;y!==null;)x.add(a(y.value)),y=y.va;return x.iterator},Po.prototype.filter=function(a){var y=this.ma;this.sa=y.jf=null;var x=new fn;for(y=y.ea;y!==null;){var E=y.value;a(E)&&x.add(E),y=y.va}return x.iterator},Po.prototype.de=function(){this.value=this.key=null,this.qa=-1,this.ma.jf=this},Po.prototype.toString=function(){return this.sa!==null?"MapValueSetIterator@"+this.sa.value:"MapValueSetIterator"},ye.Object.defineProperties(Po.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.ma.Sb}}}),Po.prototype.first=Po.prototype.first,Po.prototype.hasNext=Po.prototype.Ad,Po.prototype.next=Po.prototype.next,Po.prototype.reset=Po.prototype.reset,Po.className="MapValueSetIterator";function je(a,y){this.key=a,this.value=y,this.ll=this.va=null}je.prototype.toString=function(){return"{"+this.key+":"+this.value+"}"},je.className="KeyValuePair";function Pn(a){this.ma=a,a.Sa=null,this.qa=a.Ja,this.sa=null}Pn.prototype.reset=function(){var a=this.ma;a.Sa=null,this.qa=a.Ja,this.sa=null},Pn.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)},Pn.prototype.Ad=function(){return this.next()},Pn.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},Pn.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},Pn.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},Pn.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},Pn.prototype.map=function(a){var y=this.ma;this.sa=y.Sa=null;var x=new fn;for(y=y.ea;y!==null;)x.add(a(y)),y=y.va;return x.iterator},Pn.prototype.filter=function(a){var y=this.ma;this.sa=y.Sa=null;var x=new fn;for(y=y.ea;y!==null;)a(y)&&x.add(y),y=y.va;return x.iterator},Pn.prototype.de=function(){this.value=this.key=null,this.qa=-1,this.ma.Sa=this},Pn.prototype.toString=function(){return this.sa!==null?"MapIterator@"+this.sa:"MapIterator"},ye.Object.defineProperties(Pn.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.ma.Sb}}}),Pn.prototype.first=Pn.prototype.first,Pn.prototype.hasNext=Pn.prototype.Ad,Pn.prototype.next=Pn.prototype.next,Pn.prototype.reset=Pn.prototype.reset,Pn.className="MapIterator";function be(a){Hi(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"&&Gt("Error: Since 2.0 List/Map/Set constructors no longer take an argument that enforces type."),a!==void 0&&this.addAll(a)}wt=be.prototype,wt.xb=function(){var a=this.Ja;a++,999999999<a&&(a=0),this.Ja=a},wt.freeze=function(){return this._isFrozen=!0,this},wt.ka=function(){return this._isFrozen=!1,this},wt.toString=function(){return"Map()#"+ji(this)},wt.add=function(a,y){this._isFrozen&&de(this,a);var x=a;Ie(a)&&(x=Kr(a));var E=this.Tb[x];return E===void 0?(this.Sb++,a=new je(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()):E.value=y,this},wt.set=function(a,y){return this.add(a,y)},wt.addAll=function(a){if(a===null)return this;if($e(a))for(var y=a.length,x=0;x<y;x++){var E=a[x];this.add(E.key,E.value)}else if(a instanceof be)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},wt.first=function(){return this.ea},be.prototype.any=function(a){for(var y=this.ea;y!==null;){if(a(y))return!0;y=y.va}return!1},be.prototype.all=function(a){for(var y=this.ea;y!==null;){if(!a(y))return!1;y=y.va}return!0},be.prototype.each=function(a){for(var y=this.ea;y!==null;)a(y),y=y.va;return this},be.prototype.map=function(a){for(var y=new be,x=this.ea;x!==null;)y.add(x.key,a(x)),x=x.va;return y},be.prototype.filter=function(a){for(var y=new be,x=this.ea;x!==null;)a(x)&&y.add(x.key,x.value),x=x.va;return y},wt=be.prototype,wt.contains=function(a){var y=a;return Ie(a)&&(y=ji(a),y===void 0)?!1:this.Tb[y]!==void 0},wt.has=function(a){return this.contains(a)},wt.I=function(a){var y=a;return Ie(a)&&(y=ji(a),y===void 0)?null:(a=this.Tb[y],a===void 0?null:a.value)},wt.get=function(a){return this.I(a)},wt.remove=function(a){if(a===null)return!1;this._isFrozen&&de(this,a);var y=a;if(Ie(a)&&(y=ji(a),y===void 0)||(a=this.Tb[y],a===void 0))return!1;var x=a.va,E=a.ll;return x!==null&&(x.ll=E),E!==null&&(E.va=x),this.ea===a&&(this.ea=x),this.kf===a&&(this.kf=E),delete this.Tb[y],this.Sb--,this.xb(),!0},wt.delete=function(a){return this.remove(a)},wt.clear=function(){this._isFrozen&&de(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()},be.prototype.copy=function(){var a=new be,y=this.Tb,x;for(x in y){var E=y[x];a.add(E.key,E.value)}return a},be.prototype.Fa=function(){var a=this.Tb,y=Array(this.Sb),x=0,E;for(E in a){var b=a[E];y[x]=new je(b.key,b.value),x++}return y},be.prototype.Lf=function(){return new Cr(this)},ye.Object.defineProperties(be.prototype,{count:{get:function(){return this.Sb}},size:{get:function(){return this.Sb}},iterator:{get:function(){if(0>=this.count)return pr;var a=this.Sa;return a!==null?(a.reset(),a):new Pn(this)}},iteratorKeys:{get:function(){return 0>=this.count?pr:new Yr(this)}},iteratorValues:{get:function(){if(0>=this.count)return pr;var a=this.jf;return a!==null?(a.reset(),a):new Po(this)}}}),be.prototype.toKeySet=be.prototype.Lf,be.prototype.toArray=be.prototype.Fa,be.prototype.clear=be.prototype.clear,be.prototype.delete=be.prototype.delete,be.prototype.remove=be.prototype.remove,be.prototype.get=be.prototype.get,be.prototype.getValue=be.prototype.I,be.prototype.has=be.prototype.has,be.prototype.contains=be.prototype.contains,be.prototype.first=be.prototype.first,be.prototype.addAll=be.prototype.addAll,be.prototype.set=be.prototype.set,be.prototype.add=be.prototype.add,be.prototype.thaw=be.prototype.ka,be.prototype.freeze=be.prototype.freeze,be.className="Map";function At(a,y){a===void 0?this.y=this.x=0:typeof a=="number"&&typeof y=="number"?(this.x=a,this.y=y):Gt("Invalid arguments to Point constructor: "+a+", "+y),this._isFrozen=!1}var Zn,Jn,Ci,Si,li;At.prototype.assign=function(a){return this.x=a.x,this.y=a.y,this},At.prototype.h=function(a,y){return this.x=a,this.y=y,this},At.prototype.sg=function(a,y){return this.x=a,this.y=y,this},At.prototype.set=function(a){return this.x=a.x,this.y=a.y,this},At.prototype.copy=function(){var a=new At;return a.x=this.x,a.y=this.y,a},wt=At.prototype,wt.ja=function(){return this._isFrozen=!0,Object.freeze(this),this},wt.J=function(){return this._isFrozen||Object.isFrozen(this)?this:this.copy().freeze()},wt.freeze=function(){return this._isFrozen=!0,this},wt.ka=function(){return Object.isFrozen(this)&&Gt("cannot thaw constant: "+this),this._isFrozen=!1,this};function mn(a){if(typeof a=="string"){a=a.split(" ");for(var y=0,x=0;a[y]==="";)y++;var E=a[y++];E&&(x=parseFloat(E));for(var b=0;a[y]==="";)y++;return(E=a[y++])&&(b=parseFloat(E)),new At(x,b)}return new At}function Un(a){return a.x.toString()+" "+a.y.toString()}wt.toString=function(){return"Point("+this.x+","+this.y+")"},wt.D=function(a){return a instanceof At?this.x===a.x&&this.y===a.y:!1},wt.hi=function(a,y){return this.x===a&&this.y===y},wt.Xa=function(a){return _t.B(this.x,a.x)&&_t.B(this.y,a.y)},wt.add=function(a){return this.x+=a.x,this.y+=a.y,this},wt.re=function(a){return this.x-=a.x,this.y-=a.y,this},wt.offset=function(a,y){return this.x+=a,this.y+=y,this},At.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 E=1}else a===180?(a=-1,E=0):a===270?(a=0,E=-1):(E=a*Math.PI/180,a=Math.cos(E),E=Math.sin(E));return this.x=a*y-E*x,this.y=E*y+a*x,this},wt=At.prototype,wt.scale=function(a,y){return this.x*=a,this.y*=y,this},wt.Bf=function(a){var y=a.x-this.x;return a=a.y-this.y,y*y+a*a},wt.zd=function(a,y){return a-=this.x,y-=this.y,a*a+y*y},wt.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},wt.ab=function(a){return Qn(a.x-this.x,a.y-this.y)},wt.direction=function(a,y){return Qn(a-this.x,y-this.y)};function Qn(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}wt.Ry=function(a,y){return _t.Fl(a.x,a.y,y.x,y.y,this.x,this.y)},wt.fA=function(a,y,x,E){return _t.qh(a,y,x,E,this.x,this.y,this),this},wt.gA=function(a,y){return _t.qh(a.x,a.y,y.x,y.y,this.x,this.y,this),this},wt.uA=function(a,y,x,E){return _t.No(this.x,this.y,a,y,x,E,this),this},wt.vA=function(a,y){return _t.No(this.x,this.y,a.x,a.y,y.width,y.height,this),this},wt.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},wt.yi=function(a,y,x,E,b){return this.x=a+b.x*x+b.offsetX,this.y=y+b.y*E+b.offsetY,this},wt.transform=function(a){return a.Ga(this),this};function Dn(a,y){return y.Cd(a),a}function Xn(a,y,x,E,b,z){var tt=b-x,rt=z-E,ot=tt*tt+rt*rt;x-=a,E-=y;var lt=-x*tt-E*rt;return 0>=lt||lt>=ot?(tt=b-a,rt=z-y,Math.min(x*x+E*E,tt*tt+rt*rt)):(a=tt*E-rt*x,a*a/ot)}function Oi(a,y,x,E){return a=x-a,y=E-y,a*a+y*y}function mi(a,y,x,E){return a=x-a,y=E-y,a===0?0<y?90:0>y?270:0:y===0?0<a?0:180:isNaN(a)||isNaN(y)?0:(E=180*Math.atan(Math.abs(y/a))/Math.PI,0>a?E=0>y?E+180:180-E:0>y&&(E=360-E),E)}wt.w=function(){return isFinite(this.x)&&isFinite(this.y)},At.alloc=function(){var a=ii.pop();return a===void 0?new At:a},At.allocAt=function(a,y){var x=ii.pop();return x===void 0?new At(a,y):(x.x=a,x.y=y,x)},At.free=function(a){ii.push(a)},At.prototype.isReal=At.prototype.w,At.prototype.setSpot=At.prototype.yi,At.prototype.setRectSpot=At.prototype.xi,At.prototype.snapToGridPoint=At.prototype.vA,At.prototype.snapToGrid=At.prototype.uA,At.prototype.projectOntoLineSegmentPoint=At.prototype.gA,At.prototype.projectOntoLineSegment=At.prototype.fA,At.intersectingLineSegments=function(a,y,x,E,b,z,tt,rt){return _t.Rl(a,y,x,E,b,z,tt,rt)},At.prototype.compareWithLineSegmentPoint=At.prototype.Ry,At.compareWithLineSegment=function(a,y,x,E,b,z){return _t.Fl(a,y,x,E,b,z)},At.prototype.direction=At.prototype.direction,At.prototype.directionPoint=At.prototype.ab,At.prototype.normalize=At.prototype.normalize,At.prototype.distanceSquared=At.prototype.zd,At.prototype.distanceSquaredPoint=At.prototype.Bf,At.prototype.scale=At.prototype.scale,At.prototype.rotate=At.prototype.rotate,At.prototype.offset=At.prototype.offset,At.prototype.subtract=At.prototype.re,At.prototype.add=At.prototype.add,At.prototype.equalsApprox=At.prototype.Xa,At.prototype.equalTo=At.prototype.hi,At.prototype.equals=At.prototype.D,At.prototype.set=At.prototype.set,At.prototype.setTo=At.prototype.sg;var ii=[];At.className="Point",At.parse=mn,At.stringify=Un,At.distanceLineSegmentSquared=Xn,At.distanceSquared=Oi,At.direction=mi,At.Origin=Zn=new At(0,0).ja(),At.InfiniteTopLeft=Jn=new At(-1/0,-1/0).ja(),At.InfiniteBottomRight=Ci=new At(1/0,1/0).ja(),At.SixPoint=Si=new At(6,6).ja(),At.NoPoint=li=new At(NaN,NaN).ja(),At.parse=mn,At.stringify=Un,At.distanceLineSegmentSquared=Xn,At.distanceSquared=Oi,At.direction=mi;function on(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):Gt("Invalid arguments to Size constructor: "+a+", "+y),this._isFrozen=!1}var ki,Ui,Tr,hr,ao,eo,qr;on.prototype.assign=function(a){return this.width=a.width,this.height=a.height,this},on.prototype.h=function(a,y){return this.width=a,this.height=y,this},on.prototype.sg=function(a,y){return this.width=a,this.height=y,this},on.prototype.set=function(a){return this.width=a.width,this.height=a.height,this},on.prototype.copy=function(){var a=new on;return a.width=this.width,a.height=this.height,a},wt=on.prototype,wt.ja=function(){return this._isFrozen=!0,Object.freeze(this),this},wt.J=function(){return this._isFrozen||Object.isFrozen(this)?this:this.copy().freeze()},wt.freeze=function(){return this._isFrozen=!0,this},wt.ka=function(){return Object.isFrozen(this)&&Gt("cannot thaw constant: "+this),this._isFrozen=!1,this};function co(a){if(typeof a=="string"){a=a.split(" ");for(var y=0,x=0;a[y]==="";)y++;var E=a[y++];E&&(x=parseFloat(E));for(var b=0;a[y]==="";)y++;return(E=a[y++])&&(b=parseFloat(E)),new on(x,b)}return new on}function uo(a){return a.width.toString()+" "+a.height.toString()}wt.toString=function(){return"Size("+this.width+","+this.height+")"},wt.D=function(a){return a instanceof on?this.width===a.width&&this.height===a.height:!1},wt.hi=function(a,y){return this.width===a&&this.height===y},wt.Xa=function(a){return _t.B(this.width,a.width)&&_t.B(this.height,a.height)},wt.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},wt.w=function(){return isFinite(this.width)&&isFinite(this.height)},on.alloc=function(){var a=bo.pop();return a===void 0?new on:a},on.free=function(a){bo.push(a)},on.prototype.isReal=on.prototype.w,on.prototype.inflate=on.prototype.Bc,on.prototype.equalsApprox=on.prototype.Xa,on.prototype.equalTo=on.prototype.hi,on.prototype.equals=on.prototype.D,on.prototype.set=on.prototype.set,on.prototype.setTo=on.prototype.sg;var bo=[];on.className="Size",on.parse=co,on.stringify=uo,on.ZeroSize=ki=new on(0,0).ja(),on.OneSize=Ui=new on(1,1).ja(),on.SixSize=Tr=new on(6,6).ja(),on.EightSize=hr=new on(8,8).ja(),on.TenSize=ao=new on(10,10).ja(),on.InfiniteSize=eo=new on(1/0,1/0).ja(),on.NoSize=qr=new on(NaN,NaN).ja(),on.parse=co,on.stringify=uo;function Be(a,y,x,E){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 E=="number"&&(0<=E||isNaN(E))?(this.x=a,this.y=y,this.width=x,this.height=E):a instanceof At?(x=a.x,a=a.y,y instanceof At?(E=y.x,y=y.y,this.x=Math.min(x,E),this.y=Math.min(a,y),this.width=Math.abs(x-E),this.height=Math.abs(a-y)):y instanceof on?(this.x=x,this.y=a,this.width=y.width,this.height=y.height):Gt("Incorrect second argument supplied to Rect constructor "+y)):Gt("Invalid arguments to Rect constructor: "+a+", "+y+", "+x+", "+E),this._isFrozen=!1}wt=Be.prototype,wt.assign=function(a){return this.x=a.x,this.y=a.y,this.width=a.width,this.height=a.height,this},wt.h=function(a,y,x,E){return this.x=a,this.y=y,this.width=x,this.height=E,this};function so(a,y,x){a.width=y,a.height=x}wt.sg=function(a,y,x,E){return this.x=a,this.y=y,this.width=x,this.height=E,this},wt.set=function(a){return this.x=a.x,this.y=a.y,this.width=a.width,this.height=a.height,this},wt.dd=function(a){return this.x=a.x,this.y=a.y,this},wt.tA=function(a){return this.width=a.width,this.height=a.height,this},Be.prototype.copy=function(){var a=new Be;return a.x=this.x,a.y=this.y,a.width=this.width,a.height=this.height,a},wt=Be.prototype,wt.ja=function(){return this._isFrozen=!0,Object.freeze(this),this},wt.J=function(){return this._isFrozen||Object.isFrozen(this)?this:this.copy().freeze()},wt.freeze=function(){return this._isFrozen=!0,this},wt.ka=function(){return Object.isFrozen(this)&&Gt("cannot thaw constant: "+this),this._isFrozen=!1,this};function Jr(a){if(typeof a=="string"){a=a.split(" ");for(var y=0,x=0;a[y]==="";)y++;var E=a[y++];E&&(x=parseFloat(E));for(var b=0;a[y]==="";)y++;(E=a[y++])&&(b=parseFloat(E));for(var z=0;a[y]==="";)y++;(E=a[y++])&&(z=parseFloat(E));for(var tt=0;a[y]==="";)y++;return(E=a[y++])&&(tt=parseFloat(E)),new Be(x,b,z,tt)}return new Be}function fr(a){return a.x.toString()+" "+a.y.toString()+" "+a.width.toString()+" "+a.height.toString()}wt.toString=function(){return"Rect("+this.x+","+this.y+","+this.width+","+this.height+")"},wt.D=function(a){return a instanceof Be?this.x===a.x&&this.y===a.y&&this.width===a.width&&this.height===a.height:!1},wt.hi=function(a,y,x,E){return this.x===a&&this.y===y&&this.width===x&&this.height===E},wt.Xa=function(a){return _t.B(this.x,a.x)&&_t.B(this.y,a.y)&&_t.B(this.width,a.width)&&_t.B(this.height,a.height)};function Hr(a,y){return _t.$(a.x,y.x)&&_t.$(a.y,y.y)&&_t.$(a.width,y.width)&&_t.$(a.height,y.height)}wt.ca=function(a){return this.x<=a.x&&this.x+this.width>=a.x&&this.y<=a.y&&this.y+this.height>=a.y},wt.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},wt.contains=function(a,y,x,E){return x===void 0&&(x=0),E===void 0&&(E=0),this.x<=a&&a+x<=this.x+this.width&&this.y<=y&&y+E<=this.y+this.height},wt.offset=function(a,y){return this.x+=a,this.y+=y,this},wt.Bc=function(a,y){return Er(this,y,a,y,a)},wt.Co=function(a){return Er(this,a.top,a.right,a.bottom,a.left)},wt.Fv=function(a){return Er(this,-a.top,-a.right,-a.bottom,-a.left)},wt.Hz=function(a,y,x,E){return Er(this,a,y,x,E)};function Er(a,y,x,E,b){var z=a.width;return x+b<=-z?(a.x+=z/2,a.width=0):(a.x-=b,a.width+=x+b),x=a.height,y+E<=-x?(a.y+=x/2,a.height=0):(a.y-=y,a.height+=y+E),a}wt.Ex=function(a){return Fo(this,a.x,a.y,a.width,a.height)},wt.Uu=function(a,y,x,E){return Fo(this,a,y,x,E)};function Fo(a,y,x,E,b){var z=Math.max(a.x,y),tt=Math.max(a.y,x);return y=Math.min(a.x+a.width,y+E),x=Math.min(a.y+a.height,x+b),a.x=z,a.y=tt,a.width=Math.max(0,y-z),a.height=Math.max(0,x-tt),a}wt.Yc=function(a){return this.Vu(a.x,a.y,a.width,a.height)},wt.Vu=function(a,y,x,E){var b=this.width,z=this.x;return b!==1/0&&x!==1/0&&(b+=z,x+=a,isNaN(x)||isNaN(b)||z>x||a>b)?!1:(a=this.height,x=this.y,!(a!==1/0&&E!==1/0&&(a+=x,E+=y,isNaN(E)||isNaN(a)||x>E||y>a)))};function Lo(a,y){var x=a.width,E=a.x,b=y.x-10;return E>y.width+10+10+b||b>x+E?!1:(x=a.height,a=a.y,E=y.y-10,!(a>y.height+10+10+E||E>x+a))}wt.Ye=function(a){return Rr(this,a.x,a.y,0,0)},wt.ed=function(a){return Rr(this,a.x,a.y,a.width,a.height)},wt.Kv=function(a,y,x,E){return x===void 0&&(x=0),E===void 0&&(E=0),Rr(this,a,y,x,E)};function Rr(a,y,x,E,b){var z=Math.min(a.x,y),tt=Math.min(a.y,x);return y=Math.max(a.x+a.width,y+E),x=Math.max(a.y+a.height,x+b),a.x=z,a.y=tt,a.width=y-z,a.height=x-tt,a}wt.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 jr(a,y,x,E,b,z,tt,rt){return tt===void 0&&(tt=0),rt===void 0&&(rt=0),a<=b&&b+tt<=a+x&&y<=z&&z+rt<=y+E}function Za(a,y,x,E,b,z,tt,rt){return a>tt+b||b>x+a?!1:!(y>rt+z||z>E+y)}wt.w=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)},wt.Mz=function(){return this.width===0&&this.height===0},Be.alloc=function(){var a=Na.pop();return a===void 0?new Be:a},Be.allocAt=function(a,y,x,E){var b=Na.pop();return b===void 0?new Be(a,y,x,E):b.h(a,y,x,E)},Be.free=function(a){Na.push(a)},ye.Object.defineProperties(Be.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 At(this.x,this.y)},set:function(a){this.x=a.x,this.y=a.y}},size:{get:function(){return new on(this.width,this.height)},set:function(a){this.width=a.width,this.height=a.height}},center:{get:function(){return new At(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}}}),Be.prototype.isEmpty=Be.prototype.Mz,Be.prototype.isReal=Be.prototype.w,Be.intersectsLineSegment=function(a,y,x,E,b,z,tt,rt){return _t.Fx(a,y,x,E,b,z,tt,rt)},Be.prototype.setSpot=Be.prototype.yi,Be.prototype.union=Be.prototype.Kv,Be.prototype.unionRect=Be.prototype.ed,Be.prototype.unionPoint=Be.prototype.Ye,Be.prototype.intersects=Be.prototype.Vu,Be.prototype.intersectsRect=Be.prototype.Yc,Be.prototype.intersect=Be.prototype.Uu,Be.prototype.intersectRect=Be.prototype.Ex,Be.prototype.grow=Be.prototype.Hz,Be.prototype.subtractMargin=Be.prototype.Fv,Be.prototype.addMargin=Be.prototype.Co,Be.prototype.inflate=Be.prototype.Bc,Be.prototype.offset=Be.prototype.offset,Be.prototype.contains=Be.prototype.contains,Be.prototype.containsRect=Be.prototype.Re,Be.prototype.containsPoint=Be.prototype.ca,Be.prototype.equalsApprox=Be.prototype.Xa,Be.prototype.equalTo=Be.prototype.hi,Be.prototype.equals=Be.prototype.D,Be.prototype.setSize=Be.prototype.tA,Be.prototype.setPoint=Be.prototype.dd,Be.prototype.set=Be.prototype.set,Be.prototype.setTo=Be.prototype.sg;var aa=null,As=null,Na=[];Be.className="Rect",Be.parse=Jr,Be.stringify=fr,Be.contains=jr,Be.intersects=Za,Be.ZeroRect=aa=new Be(0,0,0,0).ja(),Be.NoRect=As=new Be(NaN,NaN,NaN,NaN).ja(),Be.parse=Jr,Be.stringify=fr,Be.contains=jr,Be.intersects=Za;function nr(a,y,x,E){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):E!==void 0?(this.top=a,this.right=y,this.bottom=x,this.left=E):Gt("Invalid arguments to Margin constructor: "+a+", "+y+", "+x+", "+E),this._isFrozen=!1}nr.prototype.assign=function(a){return this.top=a.top,this.right=a.right,this.bottom=a.bottom,this.left=a.left,this},nr.prototype.sg=function(a,y,x,E){return this.top=a,this.right=y,this.bottom=x,this.left=E,this},nr.prototype.set=function(a){return this.top=a.top,this.right=a.right,this.bottom=a.bottom,this.left=a.left,this},nr.prototype.copy=function(){var a=new nr;return a.top=this.top,a.right=this.right,a.bottom=this.bottom,a.left=this.left,a},wt=nr.prototype,wt.ja=function(){return this._isFrozen=!0,Object.freeze(this),this},wt.J=function(){return this._isFrozen||Object.isFrozen(this)?this:this.copy().freeze()},wt.freeze=function(){return this._isFrozen=!0,this},wt.ka=function(){return Object.isFrozen(this)&&Gt("cannot thaw constant: "+this),this._isFrozen=!1,this};function qo(a){if(typeof a=="string"){a=a.split(" ");for(var y=0,x=NaN;a[y]==="";)y++;var E=a[y++];if(E&&(x=parseFloat(E)),isNaN(x))return new nr;for(var b=NaN;a[y]==="";)y++;if((E=a[y++])&&(b=parseFloat(E)),isNaN(b))return new nr(x);for(var z=NaN;a[y]==="";)y++;if((E=a[y++])&&(z=parseFloat(E)),isNaN(z))return new nr(x,b);for(var tt=NaN;a[y]==="";)y++;return(E=a[y++])&&(tt=parseFloat(E)),isNaN(tt)?new nr(x,b):new nr(x,b,z,tt)}return new nr}function ta(a){return a.top.toString()+" "+a.right.toString()+" "+a.bottom.toString()+" "+a.left.toString()}wt.toString=function(){return"Margin("+this.top+","+this.right+","+this.bottom+","+this.left+")"},wt.D=function(a){return a instanceof nr?this.top===a.top&&this.right===a.right&&this.bottom===a.bottom&&this.left===a.left:!1},wt.hi=function(a,y,x,E){return this.top===a&&this.right===y&&this.bottom===x&&this.left===E},wt.Xa=function(a){return _t.B(this.top,a.top)&&_t.B(this.right,a.right)&&_t.B(this.bottom,a.bottom)&&_t.B(this.left,a.left)},wt.w=function(){return isFinite(this.top)&&isFinite(this.right)&&isFinite(this.bottom)&&isFinite(this.left)},nr.alloc=function(){var a=pa.pop();return a===void 0?new nr:a},nr.free=function(a){pa.push(a)},nr.prototype.isReal=nr.prototype.w,nr.prototype.equalsApprox=nr.prototype.Xa,nr.prototype.equalTo=nr.prototype.hi,nr.prototype.equals=nr.prototype.D,nr.prototype.set=nr.prototype.set,nr.prototype.setTo=nr.prototype.sg;var ga=null,oa=null,pa=[];nr.className="Margin",nr.parse=qo,nr.stringify=ta,nr.ZeroMargin=ga=new nr(0,0,0,0).ja(),nr.TwoMargin=oa=new nr(2,2,2,2).ja(),nr.parse=qo,nr.stringify=ta;function fi(a,y,x,E){a===void 0?this.offsetY=this.offsetX=this.y=this.x=0:(y===void 0&&(y=0),x===void 0&&(x=0),E===void 0&&(E=0),this.x=a,this.y=y,this.offsetX=x,this.offsetY=E),this._isFrozen=!1}var ar,_r,to,fo,zo,lr,Xa,fa,Uo,lo,Pa,is,Qo,ps,ms,zs,Fa,Ru,Lu,Zs,Al,Gs,Ul,hu,Fu,wa,sl,ju,Yl,du,Ja,Qa,Ba,Ga,Tl,ma;fi.prototype.assign=function(a){return this.x=a.x,this.y=a.y,this.offsetX=a.offsetX,this.offsetY=a.offsetY,this},fi.prototype.sg=function(a,y,x,E){return this.x=a,this.y=y,this.offsetX=x,this.offsetY=E,this},fi.prototype.set=function(a){return this.x=a.x,this.y=a.y,this.offsetX=a.offsetX,this.offsetY=a.offsetY,this},fi.prototype.copy=function(){var a=new fi;return a.x=this.x,a.y=this.y,a.offsetX=this.offsetX,a.offsetY=this.offsetY,a},wt=fi.prototype,wt.ja=function(){return this._isFrozen=!0,Object.freeze(this),this},wt.J=function(){return this._isFrozen||Object.isFrozen(this)?this:this.copy().freeze()},wt.freeze=function(){return this._isFrozen=!0,this},wt.ka=function(){return Object.isFrozen(this)&&Gt("cannot thaw constant: "+this),this._isFrozen=!1,this};function Ro(a,y){return a.x=NaN,a.y=NaN,a.offsetX=y,a}function wo(a){if(typeof a=="string"){if(a=a.trim(),a==="None")return ar;if(a==="TopLeft")return _r;if(a==="Top"||a==="TopCenter"||a==="MiddleTop")return to;if(a==="TopRight")return fo;if(a==="Left"||a==="LeftCenter"||a==="MiddleLeft")return zo;if(a==="Center")return lr;if(a==="Right"||a==="RightCenter"||a==="MiddleRight")return Xa;if(a==="BottomLeft")return fa;if(a==="Bottom"||a==="BottomCenter"||a==="MiddleBottom")return Uo;if(a==="BottomRight")return lo;if(a==="TopSide")return Pa;if(a==="LeftSide")return is;if(a==="RightSide")return Qo;if(a==="BottomSide")return ps;if(a==="TopBottomSides")return ms;if(a==="LeftRightSides")return zs;if(a==="TopLeftSides")return Fa;if(a==="TopRightSides")return Ru;if(a==="BottomLeftSides")return Lu;if(a==="BottomRightSides")return Zs;if(a==="NotTopSide")return Al;if(a==="NotLeftSide")return Gs;if(a==="NotRightSide")return Ul;if(a==="NotBottomSide")return hu;if(a==="AllSides")return Fu;if(a==="Default")return wa;a=a.split(" ");for(var y=0,x=0;a[y]==="";)y++;var E=a[y++];E!==void 0&&0<E.length&&(x=parseFloat(E));for(var b=0;a[y]==="";)y++;E=a[y++],E!==void 0&&0<E.length&&(b=parseFloat(E));for(var z=0;a[y]==="";)y++;E=a[y++],E!==void 0&&0<E.length&&(z=parseFloat(E));for(var tt=0;a[y]==="";)y++;return E=a[y++],E!==void 0&&0<E.length&&(tt=parseFloat(E)),new fi(x,b,z,tt)}return new fi}function Do(a){return a.sb()?a.x.toString()+" "+a.y.toString()+" "+a.offsetX.toString()+" "+a.offsetY.toString():a.toString()}wt.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(ar)?"None":this.D(_r)?"TopLeft":this.D(to)?"Top":this.D(fo)?"TopRight":this.D(zo)?"Left":this.D(lr)?"Center":this.D(Xa)?"Right":this.D(fa)?"BottomLeft":this.D(Uo)?"Bottom":this.D(lo)?"BottomRight":this.D(Pa)?"TopSide":this.D(is)?"LeftSide":this.D(Qo)?"RightSide":this.D(ps)?"BottomSide":this.D(ms)?"TopBottomSides":this.D(zs)?"LeftRightSides":this.D(Fa)?"TopLeftSides":this.D(Ru)?"TopRightSides":this.D(Lu)?"BottomLeftSides":this.D(Zs)?"BottomRightSides":this.D(Al)?"NotTopSide":this.D(Gs)?"NotLeftSide":this.D(Ul)?"NotRightSide":this.D(hu)?"NotBottomSide":this.D(Fu)?"AllSides":this.D(wa)?"Default":"None"},wt.D=function(a){return a instanceof fi?(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},wt.gv=function(){return new fi(.5-(this.x-.5),.5-(this.y-.5),-this.offsetX,-this.offsetY)},wt.Hf=function(a){if(!this.$c())return!1;if(!a.$c())if(a.D(sl))a=is;else if(a.D(ju))a=Qo;else if(a.D(Yl))a=Pa;else if(a.D(du))a=ps;else return!1;return a=a.offsetY,(this.offsetY&a)===a},wt.sb=function(){return!isNaN(this.x)&&!isNaN(this.y)},wt.Mc=function(){return isNaN(this.x)||isNaN(this.y)},wt.$c=function(){return isNaN(this.x)&&isNaN(this.y)&&this.offsetX===1&&this.offsetY!==0},wt.ys=function(){return isNaN(this.x)&&isNaN(this.y)&&this.offsetX===0&&this.offsetY===0},wt.Xb=function(){return isNaN(this.x)&&isNaN(this.y)&&this.offsetX===-1&&this.offsetY===0},fi.alloc=function(){var a=Aa.pop();return a===void 0?new fi:a},fi.free=function(a){Aa.push(a)},fi.prototype.isDefault=fi.prototype.Xb,fi.prototype.isNone=fi.prototype.ys,fi.prototype.isSide=fi.prototype.$c,fi.prototype.isNoSpot=fi.prototype.Mc,fi.prototype.isSpot=fi.prototype.sb,fi.prototype.includesSide=fi.prototype.Hf,fi.prototype.opposite=fi.prototype.gv,fi.prototype.equals=fi.prototype.D,fi.prototype.set=fi.prototype.set,fi.prototype.setTo=fi.prototype.sg;var Aa=[];fi.className="Spot",fi.parse=wo,fi.stringify=Do,fi.None=ar=Ro(new fi(0,0,0,0),0).ja(),fi.Default=wa=Ro(new fi(0,0,-1,0),-1).ja(),fi.TopLeft=_r=new fi(0,0,0,0).ja(),fi.TopCenter=to=new fi(.5,0,0,0).ja(),fi.TopRight=fo=new fi(1,0,0,0).ja(),fi.LeftCenter=zo=new fi(0,.5,0,0).ja(),fi.Center=lr=new fi(.5,.5,0,0).ja(),fi.RightCenter=Xa=new fi(1,.5,0,0).ja(),fi.BottomLeft=fa=new fi(0,1,0,0).ja(),fi.BottomCenter=Uo=new fi(.5,1,0,0).ja(),fi.BottomRight=lo=new fi(1,1,0,0).ja(),fi.MiddleTop=Ja=to,fi.MiddleLeft=Qa=zo,fi.MiddleRight=Ba=Xa,fi.MiddleBottom=Ga=Uo,fi.Top=Yl=to,fi.Left=sl=zo,fi.Right=ju=Xa,fi.Bottom=du=Uo,fi.TopSide=Pa=Ro(new fi(0,0,1,1),1).ja(),fi.LeftSide=is=Ro(new fi(0,0,1,2),1).ja(),fi.RightSide=Qo=Ro(new fi(0,0,1,4),1).ja(),fi.BottomSide=ps=Ro(new fi(0,0,1,8),1).ja(),fi.TopBottomSides=ms=Ro(new fi(0,0,1,9),1).ja(),fi.LeftRightSides=zs=Ro(new fi(0,0,1,6),1).ja(),fi.TopLeftSides=Fa=Ro(new fi(0,0,1,3),1).ja(),fi.TopRightSides=Ru=Ro(new fi(0,0,1,5),1).ja(),fi.BottomLeftSides=Lu=Ro(new fi(0,0,1,10),1).ja(),fi.BottomRightSides=Zs=Ro(new fi(0,0,1,12),1).ja(),fi.NotTopSide=Al=Ro(new fi(0,0,1,14),1).ja(),fi.NotLeftSide=Gs=Ro(new fi(0,0,1,13),1).ja(),fi.NotRightSide=Ul=Ro(new fi(0,0,1,11),1).ja(),fi.NotBottomSide=hu=Ro(new fi(0,0,1,7),1).ja(),fi.AllSides=Fu=Ro(new fi(0,0,1,15),1).ja(),Tl=new fi(.156,.156).ja(),ma=new fi(.844,.844).ja(),fi.parse=wo,fi.stringify=Do;function ae(){this.m11=1,this.m21=this.m12=0,this.m22=1,this.dy=this.dx=0}ae.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},ae.prototype.setTransform=function(a,y,x,E,b,z){return this.m11=a,this.m12=y,this.m21=x,this.m22=E,this.dx=b,this.dy=z,this},ae.prototype.copy=function(){var a=new ae;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},ae.prototype.toString=function(){return"Transform("+this.m11+","+this.m12+","+this.m21+","+this.m22+","+this.dx+","+this.dy+")"},ae.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},ae.prototype.ws=function(){return this.dx===0&&this.dy===0&&this.m11===1&&this.m12===0&&this.m21===0&&this.m22===1},ae.prototype.reset=function(){return this.m11=1,this.m21=this.m12=0,this.m22=1,this.dy=this.dx=0,this},ae.prototype.multiply=function(a){var y=this.m11*a.m11+this.m21*a.m12,x=this.m12*a.m11+this.m22*a.m12,E=this.m11*a.m21+this.m21*a.m22,b=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=E,this.m22=b,this},ae.prototype.bv=function(a){var y=1/(a.m11*a.m22-a.m12*a.m21),x=a.m22*y,E=-a.m12*y,b=-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*E,x=this.m12*x+this.m22*E,E=this.m11*b+this.m21*z,b=this.m12*b+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=E,this.m22=b,this},ae.prototype.Vj=function(){var a=1/(this.m11*this.m22-this.m12*this.m21),y=-this.m12*a,x=-this.m21*a,E=this.m11*a,b=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=E,this.dx=b,this.dy=z,this},ae.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 E=1}else a===180?(a=-1,E=0):a===270?(a=0,E=-1):(E=a*Math.PI/180,a=Math.cos(E),E=Math.sin(E));var b=this.m12*a+this.m22*E,z=this.m11*-E+this.m21*a,tt=this.m12*-E+this.m22*a;return this.m11=this.m11*a+this.m21*E,this.m12=b,this.m21=z,this.m22=tt,this.translate(-y,-x),this},wt=ae.prototype,wt.translate=function(a,y){return this.dx+=this.m11*a+this.m21*y,this.dy+=this.m12*a+this.m22*y,this},wt.scale=function(a,y){return y===void 0&&(y=a),this.m11*=a,this.m12*=a,this.m21*=y,this.m22*=y,this},wt.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)},wt.Cd=function(a){var y=1/(this.m11*this.m22-this.m12*this.m21),x=a.x,E=a.y;return a.h(x*this.m22*y+E*-this.m21*y+y*(this.m21*this.dy-this.m22*this.dx),x*-this.m12*y+E*this.m11*y+y*(this.m12*this.dx-this.m11*this.dy))},wt.Eu=function(a){var y=1/(this.m11*this.m22-this.m12*this.m21),x=1.25*a.x,E=1.2*a.y;return a.h(x*this.m22*y+E*-this.m21*y+y*(this.m21*this.dy-this.m22*this.dx),x*-this.m12*y+E*this.m11*y+y*(this.m12*this.dx-this.m11*this.dy))},wt.pp=function(a){var y=a.x,x=a.y,E=y+a.width,b=x+a.height,z=this.m11,tt=this.m12,rt=this.m21,ot=this.m22,lt=this.dx,ut=this.dy,ft=y*z+x*rt+lt,yt=y*tt+x*ot+ut,xt=E*z+x*rt+lt,Ct=E*tt+x*ot+ut;return x=y*z+b*rt+lt,y=y*tt+b*ot+ut,z=E*z+b*rt+lt,E=E*tt+b*ot+ut,b=Math.min(ft,xt),ft=Math.max(ft,xt),xt=Math.min(yt,Ct),yt=Math.max(yt,Ct),b=Math.min(b,x),ft=Math.max(ft,x),xt=Math.min(xt,y),yt=Math.max(yt,y),b=Math.min(b,z),ft=Math.max(ft,z),xt=Math.min(xt,E),yt=Math.max(yt,E),a.h(b,xt,ft-b,yt-xt),a},ae.alloc=function(){var a=Re.pop();return a===void 0?new ae:a},ae.free=function(a){Re.push(a)},ae.prototype.transformRect=ae.prototype.pp,ae.prototype.transformPoint=ae.prototype.Ga,ae.prototype.scale=ae.prototype.scale,ae.prototype.translate=ae.prototype.translate,ae.prototype.rotate=ae.prototype.rotate,ae.prototype.invert=ae.prototype.Vj,ae.prototype.multiplyInverted=ae.prototype.bv,ae.prototype.multiply=ae.prototype.multiply,ae.prototype.reset=ae.prototype.reset,ae.prototype.isIdentity=ae.prototype.ws,ae.prototype.equals=ae.prototype.D,ae.prototype.setTransform=ae.prototype.setTransform,ae.prototype.set=ae.prototype.set;var Re=[];ae.className="Transform",ae.xF="54a702f3e53909c447824c6706603faf4c";var _t={AA:"7da71ca0ad381e90",wg:(Math.sqrt(2)-1)/3*4,Uv:null,sqrt:function(a){if(0>=a)return 0;var y=_t.Uv;if(y===null){y=[];for(var x=0;2e3>=x;x++)y[x]=Math.sqrt(x);_t.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,E,b,z,tt){if(0>=b&&(b=1e-6),a<x)var rt=a,ot=x;else rt=x,ot=a;if(y<E)var lt=y,ut=E;else lt=E,ut=y;if(a===x)return lt<=tt&&tt<=ut&&a-b<=z&&z<=a+b;if(y===E)return rt<=z&&z<=ot&&y-b<=tt&&tt<=y+b;if(ot+=b,rt-=b,rt<=z&&z<=ot&&(ut+=b,lt-=b,lt<=tt&&tt<=ut))if(ot-rt>ut-lt)if(a-x>b||x-a>b){if(z=(E-y)/(x-a)*(z-a)+y,z-b<=tt&&tt<=z+b)return!0}else return!0;else if(y-E>b||E-y>b){if(tt=(x-a)/(E-y)*(tt-y)+a,tt-b<=z&&z<=tt+b)return!0}else return!0;return!1},cs:function(a,y,x,E,b,z,tt,rt,ot,lt,ut,ft){if(_t.Yb(a,y,tt,rt,ft,x,E)&&_t.Yb(a,y,tt,rt,ft,b,z))return _t.Yb(a,y,tt,rt,ft,lt,ut);var yt=(a+x)/2,xt=(y+E)/2,Ct=(x+b)/2,bt=(E+z)/2;b=(b+tt)/2,z=(z+rt)/2,E=(yt+Ct)/2,x=(xt+bt)/2,Ct=(Ct+b)/2,bt=(bt+z)/2;var Vt=(E+Ct)/2,zt=(x+bt)/2;return _t.cs(a,y,yt,xt,E,x,Vt,zt,ot,lt,ut,ft)||_t.cs(Vt,zt,Ct,bt,b,z,tt,rt,ot,lt,ut,ft)},ax:function(a,y,x,E,b,z,tt,rt,ot){var lt=(x+b)/2,ut=(E+z)/2;return ot.h((((a+x)/2+lt)/2+(lt+(b+tt)/2)/2)/2,(((y+E)/2+ut)/2+(ut+(z+rt)/2)/2)/2),ot},My:function(a,y,x,E,b,z,tt,rt){var ot=(x+b)/2,lt=(E+z)/2;return mi(((a+x)/2+ot)/2,((y+E)/2+lt)/2,(ot+(b+tt)/2)/2,(lt+(z+rt)/2)/2)},Dl:function(a,y,x,E,b,z,tt,rt,ot,lt){if(_t.Yb(a,y,tt,rt,ot,x,E)&&_t.Yb(a,y,tt,rt,ot,b,z))Rr(lt,a,y,0,0),Rr(lt,tt,rt,0,0);else{var ut=(a+x)/2,ft=(y+E)/2,yt=(x+b)/2,xt=(E+z)/2;b=(b+tt)/2,z=(z+rt)/2,E=(ut+yt)/2,x=(ft+xt)/2,yt=(yt+b)/2,xt=(xt+z)/2;var Ct=(E+yt)/2,bt=(x+xt)/2;_t.Dl(a,y,ut,ft,E,x,Ct,bt,ot,lt),_t.Dl(Ct,bt,yt,xt,b,z,tt,rt,ot,lt)}return lt},Qe:function(a,y,x,E,b,z,tt,rt,ot,lt){if(_t.Yb(a,y,tt,rt,ot,x,E)&&_t.Yb(a,y,tt,rt,ot,b,z))lt.length===0&&(lt.push(a),lt.push(y)),lt.push(tt),lt.push(rt);else{var ut=(a+x)/2,ft=(y+E)/2,yt=(x+b)/2,xt=(E+z)/2;b=(b+tt)/2,z=(z+rt)/2,E=(ut+yt)/2,x=(ft+xt)/2,yt=(yt+b)/2,xt=(xt+z)/2;var Ct=(E+yt)/2,bt=(x+xt)/2;_t.Qe(a,y,ut,ft,E,x,Ct,bt,ot,lt),_t.Qe(Ct,bt,yt,xt,b,z,tt,rt,ot,lt)}return lt},jv:function(a,y,x,E,b,z,tt,rt,ot,lt){if(_t.Yb(a,y,b,z,lt,x,E))return _t.Yb(a,y,b,z,lt,rt,ot);var ut=(a+x)/2,ft=(y+E)/2;x=(x+b)/2,E=(E+z)/2;var yt=(ut+x)/2,xt=(ft+E)/2;return _t.jv(a,y,ut,ft,yt,xt,tt,rt,ot,lt)||_t.jv(yt,xt,x,E,b,z,tt,rt,ot,lt)},OA:function(a,y,x,E,b,z,tt){return tt.h(((a+x)/2+(x+b)/2)/2,((y+E)/2+(E+z)/2)/2),tt},iv:function(a,y,x,E,b,z,tt,rt){if(_t.Yb(a,y,b,z,tt,x,E))Rr(rt,a,y,0,0),Rr(rt,b,z,0,0);else{var ot=(a+x)/2,lt=(y+E)/2;x=(x+b)/2,E=(E+z)/2;var ut=(ot+x)/2,ft=(lt+E)/2;_t.iv(a,y,ot,lt,ut,ft,tt,rt),_t.iv(ut,ft,x,E,b,z,tt,rt)}return rt},ep:function(a,y,x,E,b,z,tt,rt){if(_t.Yb(a,y,b,z,tt,x,E))rt.length===0&&(rt.push(a),rt.push(y)),rt.push(b),rt.push(z);else{var ot=(a+x)/2,lt=(y+E)/2;x=(x+b)/2,E=(E+z)/2;var ut=(ot+x)/2,ft=(lt+E)/2;_t.ep(a,y,ot,lt,ut,ft,tt,rt),_t.ep(ut,ft,x,E,b,z,tt,rt)}return rt},Eo:function(a,y,x,E,b,z,tt,rt,ot,lt,ut,ft,yt,xt){if(_t.Yb(a,y,tt,rt,yt,x,E)&&_t.Yb(a,y,tt,rt,yt,b,z))return!_t.Rl(a,y,tt,rt,ot,lt,ut,ft)||(yt=(a-tt)*(lt-ft)-(y-rt)*(ot-ut),yt===0)?!1:(xt.h(((a*rt-y*tt)*(ot-ut)-(a-tt)*(ot*ft-lt*ut))/yt,((a*rt-y*tt)*(lt-ft)-(y-rt)*(ot*ft-lt*ut))/yt),!0);var Ct=(a+x)/2,bt=(y+E)/2,Vt=(x+b)/2,zt=(E+z)/2;b=(b+tt)/2,z=(z+rt)/2,E=(Ct+Vt)/2,x=(bt+zt)/2,Vt=(Vt+b)/2,zt=(zt+z)/2;var Qt=(E+Vt)/2,ee=(x+zt)/2,oe=1/0,ce=!1,Me=0,Wn=0;return _t.Eo(a,y,Ct,bt,E,x,Qt,ee,ot,lt,ut,ft,yt,xt)&&(a=(xt.x-ot)*(xt.x-ot)+(xt.y-lt)*(xt.y-lt),a<oe&&(oe=a,ce=!0,Me=xt.x,Wn=xt.y)),_t.Eo(Qt,ee,Vt,zt,b,z,tt,rt,ot,lt,ut,ft,yt,xt)&&(xt.x-ot)*(xt.x-ot)+(xt.y-lt)*(xt.y-lt)<oe&&(ce=!0,Me=xt.x,Wn=xt.y),ce&&(xt.x=Me,xt.y=Wn),ce},Fo:function(a,y,x,E,b,z,tt,rt,ot,lt,ut,ft,yt){var xt=0;if(_t.Yb(a,y,tt,rt,yt,x,E)&&_t.Yb(a,y,tt,rt,yt,b,z)){if(yt=(a-tt)*(lt-ft)-(y-rt)*(ot-ut),yt===0)return xt;var Ct=((a*rt-y*tt)*(ot-ut)-(a-tt)*(ot*ft-lt*ut))/yt,bt=((a*rt-y*tt)*(lt-ft)-(y-rt)*(ot*ft-lt*ut))/yt;if(Ct>=ut)return xt;if((ot>ut?ot-ut:ut-ot)<(lt>ft?lt-ft:ft-lt)){if(y<rt?(ot=y,a=rt):(ot=rt,a=y),bt<ot||bt>a)return xt}else if(a<tt?(ot=a,a=tt):ot=tt,Ct<ot||Ct>a)return xt;0<yt?xt++:0>yt&&xt--}else{Ct=(a+x)/2,bt=(y+E)/2;var Vt=(x+b)/2,zt=(E+z)/2;b=(b+tt)/2,z=(z+rt)/2,E=(Ct+Vt)/2,x=(bt+zt)/2,Vt=(Vt+b)/2,zt=(zt+z)/2;var Qt=(E+Vt)/2,ee=(x+zt)/2;xt+=_t.Fo(a,y,Ct,bt,E,x,Qt,ee,ot,lt,ut,ft,yt),xt+=_t.Fo(Qt,ee,Vt,zt,b,z,tt,rt,ot,lt,ut,ft,yt)}return xt},qh:function(a,y,x,E,b,z,tt){return _t.$(a,x)?(y<E?(x=y,y=E):x=E,z<x?(tt.h(a,x),!1):z>y?(tt.h(a,y),!1):(tt.h(a,z),!0)):_t.$(y,E)?(a<x?(E=a,a=x):E=x,b<E?(tt.h(E,y),!1):b>a?(tt.h(a,y),!1):(tt.h(b,y),!0)):(b=((a-b)*(a-x)+(y-z)*(y-E))/((x-a)*(x-a)+(E-y)*(E-y)),-5e-6>b?(tt.h(a,y),!1):1.000005<b?(tt.h(x,E),!1):(tt.h(a+b*(x-a),y+b*(E-y)),!0))},Ve:function(a,y,x,E,b,z,tt,rt,ot){return _t.B(a,x)&&_t.B(y,E)?(ot.h(a,y),!1):_t.$(b,tt)?_t.$(a,x)?(_t.qh(a,y,x,E,b,z,ot),!1):_t.qh(a,y,x,E,b,(E-y)/(x-a)*(b-a)+y,ot):(rt=(rt-z)/(tt-b),_t.$(a,x)?(x=rt*(a-b)+z,y<E?(b=y,y=E):b=E,x<b?(ot.h(a,b),!1):x>y?(ot.h(a,y),!1):(ot.h(a,x),!0)):(tt=(E-y)/(x-a),_t.$(rt,tt)?(_t.qh(a,y,x,E,b,z,ot),!1):(b=(tt*a-rt*b+z-y)/(tt-rt),_t.$(tt,0)?(a<x?(E=a,a=x):E=x,b<E?(ot.h(E,y),!1):b>a?(ot.h(a,y),!1):(ot.h(b,y),!0)):_t.qh(a,y,x,E,b,tt*(b-a)+y,ot))))},MA:function(a,y,x,E,b){return _t.Ve(x.x,x.y,E.x,E.y,a.x,a.y,y.x,y.y,b)},KA:function(a,y,x,E,b,z,tt,rt,ot,lt){function ut(Vt,zt){var Qt=(Vt-a)*(Vt-a)+(zt-y)*(zt-y);Qt<ft&&(ft=Qt,ot.h(Vt,zt))}var ft=1/0;ut(ot.x,ot.y);var yt=0,xt=0,Ct=0,bt=0;if(b<tt?(yt=b,xt=tt):(yt=tt,xt=b),z<rt?(Ct=b,bt=tt):(Ct=tt,bt=b),yt=(xt-yt)/2+lt,lt=(bt-Ct)/2+lt,b=(b+tt)/2,z=(z+rt)/2,yt===0||lt===0)return ot;if(.5>(x>a?x-a:a-x)){if(yt=1-(x-b)*(x-b)/(yt*yt),0>yt)return ot;yt=Math.sqrt(yt),E=-lt*yt+z,ut(x,lt*yt+z),ut(x,E)}else{if(x=(E-y)/(x-a),E=1/(yt*yt)+x*x/(lt*lt),rt=2*x*(y-x*a)/(lt*lt)-2*x*z/(lt*lt)-2*b/(yt*yt),yt=rt*rt-4*E*(2*x*a*z/(lt*lt)-2*y*z/(lt*lt)+z*z/(lt*lt)+b*b/(yt*yt)-1+(y-x*a)*(y-x*a)/(lt*lt)),0>yt)return ot;yt=Math.sqrt(yt),lt=(-rt+yt)/(2*E),ut(lt,x*lt-x*a+y),yt=(-rt-yt)/(2*E),ut(yt,x*yt-x*a+y)}return ot},Ff:function(a,y,x,E,b,z,tt,rt,ot){var lt=1e21,ut=a,ft=y;if(_t.Ve(a,y,a,E,b,z,tt,rt,ot)){var yt=(ot.x-b)*(ot.x-b)+(ot.y-z)*(ot.y-z);yt<lt&&(lt=yt,ut=ot.x,ft=ot.y)}return _t.Ve(x,y,x,E,b,z,tt,rt,ot)&&(yt=(ot.x-b)*(ot.x-b)+(ot.y-z)*(ot.y-z),yt<lt&&(lt=yt,ut=ot.x,ft=ot.y)),_t.Ve(a,y,x,y,b,z,tt,rt,ot)&&(y=(ot.x-b)*(ot.x-b)+(ot.y-z)*(ot.y-z),y<lt&&(lt=y,ut=ot.x,ft=ot.y)),_t.Ve(a,E,x,E,b,z,tt,rt,ot)&&(a=(ot.x-b)*(ot.x-b)+(ot.y-z)*(ot.y-z),a<lt&&(lt=a,ut=ot.x,ft=ot.y)),ot.h(ut,ft),1e21>lt},us:function(a,y,x){return _t.Fx(a.x,a.y,a.width,a.height,y.x,y.y,x.x,x.y)},Fx:function(a,y,x,E,b,z,tt,rt){var ot=a+x,lt=y+E;return b===tt?(z<rt?(tt=z,z=rt):tt=rt,a<=b&&b<=ot&&tt<=lt&&z>=y):z===rt?(b<tt?(rt=b,b=tt):rt=tt,y<=z&&z<=lt&&rt<=ot&&b>=a):!!(jr(a,y,x,E,b,z)||jr(a,y,x,E,tt,rt)||_t.Rl(a,y,ot,y,b,z,tt,rt)||_t.Rl(ot,y,ot,lt,b,z,tt,rt)||_t.Rl(ot,lt,a,lt,b,z,tt,rt)||_t.Rl(a,lt,a,y,b,z,tt,rt))},Rl:function(a,y,x,E,b,z,tt,rt){return a===x&&y===E&&b===tt&&z===rt?a===b&&y===z:0>=_t.Fl(a,y,x,E,b,z)*_t.Fl(a,y,x,E,tt,rt)&&0>=_t.Fl(b,z,tt,rt,a,y)*_t.Fl(b,z,tt,rt,x,E)},Fl:function(a,y,x,E,b,z){return x-=a,E-=y,a=b-a,y=z-y,z=a*E-y*x,z===0&&(z=a*x+y*E,0<z&&(z=(a-x)*x+(y-E)*E,0>z&&(z=0))),z},bp:function(a){return 0>a&&(a+=360),360<=a&&(a-=360),a},jx:function(a,y,x,E,b,z){var tt=Math.PI;z||(E*=tt/180,b*=tt/180);var rt=E>b?-1:1;z=[];var ot=tt/2,lt=E;if(E=Math.min(2*tt,Math.abs(b-E)),1e-5>E)return ot=lt+rt*Math.min(E,ot),rt=a+x*Math.cos(lt),lt=y+x*Math.sin(lt),a+=x*Math.cos(ot),y+=x*Math.sin(ot),x=(rt+a)/2,ot=(lt+y)/2,z.push([rt,lt,x,ot,x,ot,a,y]),z;for(;1e-5<E;)b=lt+rt*Math.min(E,ot),z.push(_t.Vy(x,lt,b,a,y)),E-=Math.abs(b-lt),lt=b;return z},Vy:function(a,y,x,E,b){var z=(x-y)/2,tt=a*Math.cos(z),rt=a*Math.sin(z),ot=-rt,lt=tt*tt+ot*ot,ut=lt+tt*tt+ot*rt;return lt=4/3*(Math.sqrt(2*lt*ut)-ut)/(tt*rt-ot*tt),rt=tt-lt*ot,tt=ot+lt*tt,ot=-tt,lt=z+y,z=Math.cos(lt),lt=Math.sin(lt),[E+a*Math.cos(y),b+a*Math.sin(y),E+rt*z-tt*lt,b+rt*lt+tt*z,E+rt*z-ot*lt,b+rt*lt+ot*z,E+a*Math.cos(x),b+a*Math.sin(x)]},No:function(a,y,x,E,b,z,tt){x=Math.floor((a-x)/b)*b+x,E=Math.floor((y-E)/z)*z+E;var rt=x;return x+b-a<b/2&&(rt=x+b),a=E,E+z-y<z/2&&(a=E+z),tt.h(rt,a),tt},vx:function(a,y){var x=Math.max(a,y);a=Math.min(a,y);var E;do y=x%a,x=E=a,a=y;while(0<y);return E},$y:function(a,y,x,E){var b=0>x,z=0>E;if(a<y)var tt=1,rt=0;else tt=0,rt=1;var ot=tt===0?a:y,lt=tt===0?x:E;return(tt===0?b:z)&&(lt=-lt),tt=rt,x=tt===0?x:E,(tt===0?b:z)&&(x=-x),_t.az(ot,tt===0?a:y,lt,x,0,0)},az:function(a,y,x,E,b,z){if(0<E)if(0<x){b=a*a,z=y*y,a*=x;var tt=y*E,rt=-z+tt,ot=-z+Math.sqrt(a*a+tt*tt);y=rt;for(var lt=0;9999999999>lt&&(y=.5*(rt+ot),!(y===rt||y===ot));++lt){var ut=a/(y+b),ft=tt/(y+z);if(ut=ut*ut+ft*ft-1,0<ut)rt=y;else if(0>ut)ot=y;else break}x=b*x/(y+b)-x,E=z*E/(y+z)-E,x=Math.sqrt(x*x+E*E)}else x=Math.abs(E-y);else E=a*a-y*y,z=a*x,z<E?(E=z/E,z=y*Math.sqrt(Math.abs(1-E*E)),x=a*E-x,x=Math.sqrt(x*x+z*z)):x=Math.abs(x-a);return x},Ze:new Mi,um:new Mi,Mf:new Mi,Nf:0,vm:100};_t.za=_t.AA;function fe(a){Hi(this),this.l=2,a===void 0&&(a=fe.o),this.na=a,this.Ec=this.Dc=this.pd=this.od=0,a===fe.o?this.ee=new fn:(fe.V===null&&(fe.V=new fn().freeze()),this.ee=fe.V),this.aq=this.ee.Ja,this.Ip=new Be().freeze(),this.ym=this.tk=null,this.zm=NaN,this.fg=_r,this.gg=lo,this.Rk=this.Sk=NaN,this.Uf=Sn}fe.prototype.copy=function(){var a=new fe;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===fe.o){for(var y=this.ee.s,x=a.ee,E=0;E<y.length;E++)x.add(y[E].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},fe.prototype.ja=function(){return this.freeze(),Object.freeze(this),this},fe.prototype.freeze=function(){if(this._isFrozen=!0,this.type!==fe.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},fe.prototype.ka=function(){if(Object.isFrozen(this)&&Gt("cannot thaw constant: "+this),this._isFrozen=!1,this.type!==fe.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},fe.prototype.Xa=function(a){if(!(a instanceof fe))return!1;if(this.type!==a.type)return this.type===fe.j&&a.type===fe.o?zr(this,a):a.type===fe.j&&this.type===fe.o?zr(a,this):!1;if(this.type===fe.o){var y=this.figures.s;a=a.figures.s;var x=y.length;if(x!==a.length)return!1;for(var E=0;E<x;E++)if(!y[E].Xa(a[E]))return!1;return!0}return _t.B(this.startX,a.startX)&&_t.B(this.startY,a.startY)&&_t.B(this.endX,a.endX)&&_t.B(this.endY,a.endY)};function zr(a,y){return a.type!==fe.j||y.type!==fe.o?!1:!!(y.figures.count===1&&(y=y.figures.M(0),y.segments.count===1&&_t.B(a.startX,y.startX)&&_t.B(a.startY,y.startY)&&(y=y.segments.M(0),y.type===Ji&&_t.B(a.endX,y.endX)&&_t.B(a.endY,y.endY))))}fe.ia=function(a){return a.toString()},fe.prototype.qb=function(a){a.classType===fe&&(this.type=a)},fe.prototype.toString=function(a){switch(a===void 0&&(a=-1),this.type){case fe.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 fe.u:var y=new Be(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 fe.F:if(y=new Be(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 fe.o:y="",x=this.figures.s;for(var E=x.length,b=0;b<E;b++){var z=x[b];0<b&&(y+=" x "),z.isFilled&&(y+="F "),y+=z.toString(a)}return y;default:return this.type.toString()}},fe.nb=function(a){a=a.split(/[Xx]/);for(var y=a.length,x="",E=0;E<y;E++){var b=a[E];x=b.match(/[Ff]/)!==null?E===0?x+b:x+("X"+(b[0]===" "?"":" ")+b):x+((E===0?"":"X ")+"F"+(b[0]===" "?"":" ")+b)}return x},fe.parse=function(a,y){function x(){return bt>=oe-1?!0:lt[bt+1].match(ce)!==null}function E(){return bt++,lt[bt]}function b(qi){var Yi=parseFloat(E()),oo=parseFloat(E());Vt===Vt.toLowerCase()&&(Yi=ee.x+Yi,oo=ee.y+oo),qi.h(Yi,oo)}function z(){return b(ee),ee}function tt(){return b(Qt),Qt}function rt(){var qi=zt.toLowerCase();return qi!=="c"&&qi!=="s"&&qi!=="q"&&qi!=="t"?ee:new At(2*ee.x-Qt.x,2*ee.y-Qt.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 lt=a.split(" ");for(a=0;a<lt.length;a++){var ut=lt[a];if(ut.match(/(\.[0-9]*)(\.)/gm)!==null){ot=Yn();for(var ft="",yt=!1,xt=0;xt<ut.length;xt++){var Ct=ut[xt];Ct!=="."||yt?Ct==="."?(ot.push(ft),ft="."):ft+=Ct:(yt=!0,ft+=Ct)}for(ot.push(ft),lt.splice(a,1),ut=0;ut<ot.length;ut++)lt.splice(a+ut,0,ot[ut]);a+=ot.length-1,si(ot)}}var bt=-1,Vt="",zt="";ot=new At(0,0);var Qt=new At(0,0),ee=new At(0,0),oe=lt.length;a=N1(null),yt=ft=ut=!1,xt=!0,Ct=null;for(var ce=/[UuBbMmZzLlHhVvCcSsQqTtAaFfXx]/;!(bt>=oe-1);)if(zt=Vt,Vt=E(),Vt!=="")switch(Vt.toUpperCase()){case"X":xt=!0,ft=ut=!1;break;case"M":for(Ct=z(),a.mc===null||xt===!0?(Zf(a,Ct.x,Ct.y,ut,!ft,yt),xt=!1):a.moveTo(Ct.x,Ct.y),ot.assign(ee);!x();)Ct=z(),a.lineTo(Ct.x,Ct.y);break;case"L":for(;!x();)Ct=z(),a.lineTo(Ct.x,Ct.y);break;case"H":for(;!x();)ee=new At((Vt===Vt.toLowerCase()?ee.x:0)+parseFloat(E()),ee.y),a.lineTo(ee.x,ee.y);break;case"V":for(;!x();)ee=new At(ee.x,(Vt===Vt.toLowerCase()?ee.y:0)+parseFloat(E())),a.lineTo(ee.x,ee.y);break;case"C":for(;!x();){Ct=new At,b(Ct);var Me=tt(),Wn=z();Dh(a,Ct.x,Ct.y,Me.x,Me.y,Wn.x,Wn.y)}break;case"S":for(;!x();)Ct=rt(),Me=tt(),Wn=z(),Dh(a,Ct.x,Ct.y,Me.x,Me.y,Wn.x,Wn.y);break;case"Q":for(;!x();)Ct=tt(),Me=z(),jm(a,Ct.x,Ct.y,Me.x,Me.y);break;case"T":for(;!x();)Qt=Ct=rt(),Me=z(),jm(a,Ct.x,Ct.y,Me.x,Me.y);break;case"B":for(;!x();){Ct=parseFloat(E()),Me=parseFloat(E()),Wn=parseFloat(E());var di=parseFloat(E()),oi=parseFloat(E()),kn=oi,en=!1;x()||(kn=parseFloat(E()),x()||(en=parseFloat(E())!==0)),Vt===Vt.toLowerCase()&&(Wn+=ee.x,di+=ee.y),a.arcTo(Ct,Me,Wn,di,oi,kn,en)}break;case"A":for(;!x();)Ct=Math.abs(parseFloat(E())),Me=Math.abs(parseFloat(E())),Wn=parseFloat(E()),oi=di=!1,en=kn=0,kn=E(),kn.length===1?(di=!!parseFloat(kn),oi=!!parseFloat(E()),kn=parseFloat(E())):kn.length===2?(di=!!parseFloat(kn[0]),oi=!!parseFloat(kn[1]),kn=parseFloat(E())):(di=!!parseFloat(kn[0]),oi=!!parseFloat(kn[1]),kn=parseFloat(kn.slice(2))),en=parseFloat(E()),Vt===Vt.toLowerCase()&&(kn=ee.x+kn,en=ee.y+en),ee.h(kn,en),wx(a,Ct,Me,Wn,di,oi,kn,en);break;case"Z":Px(a),ee.assign(ot);break;case"F":for(Ct="",Me=1;lt[bt+Me];)if(lt[bt+Me]==="0")yt=!0,Me++;else if(lt[bt+Me].match(/[Uu]/)!==null)Me++;else if(lt[bt+Me].match(ce)===null)Me++;else{Ct=lt[bt+Me];break}Ct.match(/[Mm]/)?ut=!0:0<a.mc.segments.length&&(a.mc.isFilled=!0);break;case"U":for(Ct="",Me=1;lt[bt+Me];)if(lt[bt+Me].match(/[Ff]/)!==null)Me++;else if(lt[bt+Me].match(ce)===null)Me++;else{Ct=lt[bt+Me];break}Ct.match(/[Mm]/)?ft=!0:a.mc.isShadowed=!1}if(ot=a.os,zm=a,y)for(y=ot.figures.iterator;y.next();)y.value.isFilled=!0;return ot},fe.Ha=function(a,y){for(var x=a.length,E=At.alloc(),b=0;b<x;b++){var z=a[b];E.x=z[0],E.y=z[1],y.Ga(E),z[0]=E.x,z[1]=E.y,E.x=z[2],E.y=z[3],y.Ga(E),z[2]=E.x,z[3]=E.y,E.x=z[4],E.y=z[5],y.Ga(E),z[4]=E.x,z[5]=E.y,E.x=z[6],E.y=z[7],y.Ga(E),z[6]=E.x,z[7]=E.y}At.free(E)},fe.prototype.Zu=function(){if(this._isInvalidBounds)return!0;if(this.type===fe.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},fe.prototype.computeBounds=function(){if(this._isInvalidBounds=!1,this.ym=this.tk=null,this.zm=NaN,this.type===fe.o){this.aq=this.figures.Ja;for(var a=this.figures.s,y=a.length,x=0;x<y;x++){var E=a[x];E._isInvalidBounds=!1;var b=E.segments;E.sr=b.Ja,E=b.s,b=E.length;for(var z=0;z<b;z++){var tt=E[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),mr(this,a,!1),Rr(a,0,0,0,0),a.freeze()},fe.prototype.ix=function(){var a=new Be;return mr(this,a,!0),a};function mr(a,y,x){switch(a.type){case fe.j:case fe.u:case fe.F:x?y.h(a.od,a.pd,0,0):Rr(y,a.od,a.pd,0,0),Rr(y,a.Dc,a.Ec,0,0);break;case fe.o:var E=a.figures;a=E.s,E=E.length;for(var b=0;b<E;b++){var z=a[b];x&&b===0?y.h(z.startX,z.startY,0,0):Rr(y,z.startX,z.startY,0,0);for(var tt=z.segments.s,rt=tt.length,ot=z.startX,lt=z.startY,ut=0;ut<rt;ut++){var ft=tt[ut];switch(ft.type){case Ji:case ir:ot=ft.endX,lt=ft.endY,Rr(y,ot,lt,0,0);break;case Mr:_t.Dl(ot,lt,ft.point1X,ft.point1Y,ft.point2X,ft.point2Y,ft.endX,ft.endY,.5,y),ot=ft.endX,lt=ft.endY;break;case Lr:_t.iv(ot,lt,ft.point1X,ft.point1Y,ft.endX,ft.endY,.5,y),ot=ft.endX,lt=ft.endY;break;case Br:case io:var yt=ft.type===Br?no(ft,z):Wi(ft,z,ot,lt),xt=yt.length;if(xt===0){ot=ft.type===Br?ft.centerX:ft.endX,lt=ft.type===Br?ft.centerY:ft.endY,Rr(y,ot,lt,0,0);break}ft=null;for(var Ct=0;Ct<xt;Ct++)ft=yt[Ct],_t.Dl(ft[0],ft[1],ft[2],ft[3],ft[4],ft[5],ft[6],ft[7],.5,y);ft!==null&&(ot=ft[6],lt=ft[7]);break;default:Gt("Unknown Segment type: "+ft.type)}}}break;default:Gt("Unknown Geometry type: "+a.type)}}fe.prototype.normalize=function(){this._isFrozen&&de(this);var a=this.ix();return this.offset(-a.x,-a.y),new At(-a.x,-a.y)},fe.prototype.offset=function(a,y){return this._isFrozen&&de(this),this.transform(1,0,0,1,a,y),this},fe.prototype.scale=function(a,y){return this._isFrozen&&de(this),this.transform(a,0,0,y,0,0),this},fe.prototype.rotate=function(a,y,x){this._isFrozen&&de(this),y===void 0&&(y=0),x===void 0&&(x=0);var E=ae.alloc();return E.reset(),E.rotate(a,y,x),this.transform(E.m11,E.m12,E.m21,E.m22,E.dx,E.dy),ae.free(E),this},wt=fe.prototype,wt.transform=function(a,y,x,E,b,z){switch(this.type){case fe.j:case fe.u:case fe.F:var tt=this.od,rt=this.pd;this.od=tt*a+rt*x+b,this.pd=tt*y+rt*E+z,tt=this.Dc,rt=this.Ec,this.Dc=tt*a+rt*x+b,this.Ec=tt*y+rt*E+z;break;case fe.o:for(var ot=this.figures.s,lt=ot.length,ut=0;ut<lt;ut++){var ft=ot[ut];tt=ft.startX,rt=ft.startY,ft.startX=tt*a+rt*x+b,ft.startY=tt*y+rt*E+z,ft=ft.segments.s;for(var yt=ft.length,xt=0;xt<yt;xt++){var Ct=ft[xt];switch(Ct.type){case Ji:case ir:tt=Ct.endX,rt=Ct.endY,Ct.endX=tt*a+rt*x+b,Ct.endY=tt*y+rt*E+z;break;case Mr:tt=Ct.point1X,rt=Ct.point1Y,Ct.point1X=tt*a+rt*x+b,Ct.point1Y=tt*y+rt*E+z,tt=Ct.point2X,rt=Ct.point2Y,Ct.point2X=tt*a+rt*x+b,Ct.point2Y=tt*y+rt*E+z,tt=Ct.endX,rt=Ct.endY,Ct.endX=tt*a+rt*x+b,Ct.endY=tt*y+rt*E+z;break;case Lr:tt=Ct.point1X,rt=Ct.point1Y,Ct.point1X=tt*a+rt*x+b,Ct.point1Y=tt*y+rt*E+z,tt=Ct.endX,rt=Ct.endY,Ct.endX=tt*a+rt*x+b,Ct.endY=tt*y+rt*E+z;break;case Br:tt=Ct.centerX,rt=Ct.centerY,Ct.centerX=tt*a+rt*x+b,Ct.centerY=tt*y+rt*E+z,y!==0&&(tt=180*Math.atan2(y,a)/Math.PI,0>tt&&(tt+=360),Ct.startAngle+=tt),0>a&&(Ct.startAngle=180-Ct.startAngle,Ct.sweepAngle=-Ct.sweepAngle),0>E&&(Ct.startAngle=-Ct.startAngle,Ct.sweepAngle=-Ct.sweepAngle),Ct.radiusX*=Math.sqrt(a*a+x*x),Ct.radiusY!==void 0&&(Ct.radiusY*=Math.sqrt(y*y+E*E));break;case io:if(tt=Ct.endX,rt=Ct.endY,Ct.endX=tt*a+rt*x+b,Ct.endY=tt*y+rt*E+z,Ct.radiusX===0||Ct.radiusY===0)break;y!==0&&(tt=180*Math.atan2(y,a)/Math.PI,0>tt&&(tt+=360),Ct.xAxisRotation+=tt),0>a&&(Ct.xAxisRotation=180-Ct.xAxisRotation,Ct.isClockwiseArc=!Ct.isClockwiseArc),0>E&&(Ct.xAxisRotation=-Ct.xAxisRotation,Ct.isClockwiseArc=!Ct.isClockwiseArc),Ct.radiusX*=Math.sqrt(a*a+x*x),Ct.radiusY*=Math.sqrt(y*y+E*E);break;default:Gt("Unknown Segment type: "+Ct.type)}}}}return this._isInvalidBounds=!0,this},wt.ca=function(a,y){y===void 0&&(y=0);var x=this.od,E=this.pd,b=this.Dc,z=this.Ec;switch(this.type){case fe.j:return _t.Yb(x,E,b,z,y,a.x,a.y);case fe.u:var tt=Be.allocAt(Math.min(x,b)-y,Math.min(E,z)-y,Math.abs(b-x)+2*y,Math.abs(z-E)+2*y);return a=tt.ca(a),Be.free(tt),a;case fe.F:tt=Math.min(x,b)-y;var rt=Math.min(E,z)-y;return x=(Math.abs(b-x)+2*y)/2,y=(Math.abs(z-E)+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 fe.o:return Fr(this,a,y,!0,!1);default:return!1}};function Fr(a,y,x,E,b){var z=y.x;y=y.y;for(var tt=a.bounds.x-20,rt=0,ot,lt,ut,ft,yt=a.figures.s,xt=yt.length,Ct=0;Ct<xt;Ct++){var bt=yt[Ct],Vt=!bt.isEvenOdd;if(bt.isFilled){if(E&&bt.ca(z,y,x))return!0;var zt=bt.segments;ot=bt.startX,lt=bt.startY;for(var Qt=ot,ee=lt,oe=zt.s,ce=0;ce<=zt.length;ce++){var Me=void 0;if(ce!==zt.length){Me=oe[ce];var Wn=Me.type;a=Me.endX,ft=Me.endY}else Wn=Ji,a=Qt,ft=ee;switch(Wn){case ir:if(Qt=sr(z,y,tt,y,ot,lt,Qt,ee),isNaN(Qt))return!0;rt+=Qt,Qt=a,ee=ft;break;case Ji:if(ot=sr(z,y,tt,y,ot,lt,a,ft),isNaN(ot))return!0;rt+=ot;break;case Mr:ut=_t.Fo(ot,lt,Me.point1X,Me.point1Y,Me.point2X,Me.point2Y,a,ft,tt,y,z,y,.5),rt+=ut;break;case Lr:ut=_t.Fo(ot,lt,(ot+2*Me.point1X)/3,(lt+2*Me.point1Y)/3,(2*Me.point1X+a)/3,(2*Me.point1Y+ft)/3,a,ft,tt,y,z,y,.5),rt+=ut;break;case Br:case io:Wn=Me.type===Br?no(Me,bt):Wi(Me,bt,ot,lt);var di=Wn.length;if(di===0){if(ot=sr(z,y,tt,y,ot,lt,Me.type===Br?Me.centerX:Me.endX,Me.type===Br?Me.centerY:Me.endY),isNaN(ot))return!0;rt+=ot;break}Me=null;for(var oi=0;oi<di;oi++){if(Me=Wn[oi],oi===0){if(ut=sr(z,y,tt,y,ot,lt,Me[0],Me[1]),isNaN(ut))return!0;rt+=ut}ut=_t.Fo(Me[0],Me[1],Me[2],Me[3],Me[4],Me[5],Me[6],Me[7],tt,y,z,y,.5),rt+=ut}Me!==null&&(a=Me[6],ft=Me[7]);break;default:Gt("Unknown Segment type: "+Me.type)}ot=a,lt=ft}if(Vt){if(rt!==0)return!0}else if(rt%2!==0)return!0;rt=0}else if(bt.ca(z,y,b?x:x+2))return!0}return!1}function sr(a,y,x,E,b,z,tt,rt){if(_t.Yb(b,z,tt,rt,.05,a,y))return NaN;var ot=(a-x)*(z-rt);if(ot===0)return 0;var lt=((a*E-y*x)*(b-tt)-(a-x)*(b*rt-z*tt))/ot;if(y=(a*E-y*x)*(z-rt)/ot,lt>=a)return 0;if((b>tt?b-tt:tt-b)<(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(b<tt){if(lt<b||lt>tt)return 0}else if(lt<tt||lt>b)return 0;return 0<ot?1:-1}function Pr(a,y,x,E){a=a.figures.s;for(var b=a.length,z=0;z<b;z++)if(a[z].ca(y,x,E))return!0;return!1}wt.Pu=function(a,y){if(0>a?a=0:1<a&&(a=1),y===void 0&&(y=new At),this.type===fe.j)return y.h(this.startX+a*(this.endX-this.startX),this.startY+a*(this.endY-this.startY)),y;for(var x=this.flattenedSegments,E=this.flattenedLengths,b=x.length,z=this.flattenedTotalLength*a,tt=0,rt=0;rt<b;rt++){var ot=E[rt],lt=ot.length;for(a=0;a<lt;a++){var ut=ot[a];if(tt+ut>=z)return E=z-tt,E=ut===0?0:E/ut,x=x[rt],rt=x[2*a],b=x[2*a+1],y.h(rt+(x[2*a+2]-rt)*E,b+(x[2*a+3]-b)*E),y;tt+=ut}}return y},wt.wx=function(a){if(0>a?a=0:1<a&&(a=1),this.type===fe.j)return 180*Math.atan2(this.endY-this.startY,this.endX-this.startX)/Math.PI;for(var y=this.flattenedSegments,x=this.flattenedLengths,E=y.length,b=this.flattenedTotalLength*a,z=0,tt=0;tt<E;tt++){var rt=x[tt],ot=rt.length;for(a=0;a<ot;a++){var lt=rt[a];if(z+lt>=b)return b=y[tt],y=b[2*a],x=b[2*a+1],E=b[2*a+2],a=b[2*a+3],1>Math.abs(E-y)&&1>Math.abs(a-x)?0:1>Math.abs(E-y)?0<=a-x?90:270:1>Math.abs(a-x)?0<=E-y?0:180:180*Math.atan2(a-x,E-y)/Math.PI;z+=lt}}return NaN},wt.Qu=function(a,y){if(0>a?a=0:1<a&&(a=1),y===void 0&&(y=[]),y.length=3,this.type===fe.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,E=this.flattenedLengths,b=x.length,z=this.flattenedTotalLength*a,tt=0,rt=0;rt<b;rt++){var ot=E[rt],lt=ot.length;for(a=0;a<lt;a++){var ut=ot[a];if(tt+ut>=z)return E=z-tt,E=ut===0?0:E/ut,ut=x[rt],x=ut[2*a],rt=ut[2*a+1],b=ut[2*a+2],a=ut[2*a+3],y[0]=x+(b-x)*E,y[1]=rt+(a-rt)*E,y[2]=1>Math.abs(b-x)&&1>Math.abs(a-rt)?0:1>Math.abs(b-x)?0<=a-rt?90:270:1>Math.abs(a-rt)?0<=b-x?0:180:180*Math.atan2(a-rt,b-x)/Math.PI,y;tt+=ut}}return y},wt.xx=function(a){if(this.type===fe.j){var y=this.startX,x=this.startY,E=this.endX,b=this.endY;if(y!==E||x!==b){var z=a.x;if(a=a.y,y===E){if(x<b){var tt=x;E=b}else tt=b,E=x;return a<=tt?tt===x?0:1:a>=E?E===x?0:1:Math.abs(a-x)/(E-tt)}if(x===b)return y<E?tt=y:(tt=E,E=y),z<=tt?tt===y?0:1:z>=E?E===y?0:1:Math.abs(z-y)/(E-tt);tt=(E-y)*(E-y)+(b-x)*(b-x);var rt=At.alloc();return _t.qh(y,x,E,b,z,a,rt),a=rt.x,z=rt.y,At.free(rt),Math.sqrt(((a-y)*(a-y)+(z-x)*(z-x))/tt)}}else if(this.type===fe.u){tt=this.startX,rt=this.startY;var ot=this.endX;if(b=this.endY,tt!==ot||rt!==b){y=ot-tt,x=b-rt,z=2*y+2*x,E=a.x,a=a.y,E=Math.min(Math.max(E,tt),ot),a=Math.min(Math.max(a,rt),b),tt=Math.abs(E-tt),ot=Math.abs(E-ot),rt=Math.abs(a-rt),b=Math.abs(a-b);var lt=Math.min(tt,ot,rt,b);if(lt===rt)return E/z;if(lt===ot)return(y+a)/z;if(lt===b)return(2*y+x-E)/z;if(lt===tt)return(2*y+2*x-a)/z}}else{y=this.flattenedSegments,x=this.flattenedLengths,z=this.flattenedTotalLength,E=At.alloc(),b=1/0,rt=tt=0,ot=y.length;for(var ut=lt=0,ft=0;ft<ot;ft++)for(var yt=y[ft],xt=x[ft],Ct=yt.length,bt=0;bt<Ct;bt+=2){var Vt=yt[bt],zt=yt[bt+1];if(bt!==0){_t.qh(lt,ut,Vt,zt,a.x,a.y,E);var Qt=(E.x-a.x)*(E.x-a.x)+(E.y-a.y)*(E.y-a.y);Qt<b&&(b=Qt,tt=rt,tt+=Math.sqrt((E.x-lt)*(E.x-lt)+(E.y-ut)*(E.y-ut))),rt+=xt[(bt-2)/2]}lt=Vt,ut=zt}return At.free(E),a=tt/z,0>a?0:1<a?1:a}return 0};function po(a){if(a.tk===null){var y=a.tk=[],x=a.ym=[],E=[],b=[];if(a.type===fe.j)E.push(a.startX),E.push(a.startY),E.push(a.endX),E.push(a.endY),y.push(E),b.push(Math.sqrt((a.startX-a.endX)*(a.startX-a.endX)+(a.startY-a.endY)*(a.startY-a.endY))),x.push(b);else if(a.type===fe.u)E.push(a.startX),E.push(a.startY),E.push(a.endX),E.push(a.startY),E.push(a.endX),E.push(a.endY),E.push(a.startX),E.push(a.endY),E.push(a.startX),E.push(a.startY),y.push(E),b.push(Math.abs(a.startX-a.endX)),b.push(Math.abs(a.startY-a.endY)),b.push(Math.abs(a.startX-a.endX)),b.push(Math.abs(a.startY-a.endY)),x.push(b);else if(a.type===fe.F){var z=new Dr;z.startX=a.endX,z.startY=(a.startY+a.endY)/2;var tt=new Ki(Br);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=no(tt,z),b=a.length,b===0)E.push(tt.centerX),E.push(tt.centerY);else{tt=z.startX,z=z.startY;for(var rt=0;rt<b;rt++){var ot=a[rt];_t.Qe(tt,z,ot[2],ot[3],ot[4],ot[5],ot[6],ot[7],.5,E),tt=ot[6],z=ot[7]}}y.push(E),x.push(Xr(E))}else for(a=a.figures.iterator;a.next();){b=a.value,E=[],E.push(b.startX),E.push(b.startY),tt=b.startX,z=b.startY,rt=tt,ot=z;for(var lt=b.segments.s,ut=lt.length,ft=0;ft<ut;ft++){var yt=lt[ft];switch(yt.type){case ir:4<=E.length&&(y.push(E),x.push(Xr(E))),E=[],E.push(yt.endX),E.push(yt.endY),tt=yt.endX,z=yt.endY,rt=tt,ot=z;break;case Ji:E.push(yt.endX),E.push(yt.endY),tt=yt.endX,z=yt.endY;break;case Mr:_t.Qe(tt,z,yt.point1X,yt.point1Y,yt.point2X,yt.point2Y,yt.endX,yt.endY,.5,E),tt=yt.endX,z=yt.endY;break;case Lr:_t.ep(tt,z,yt.point1X,yt.point1Y,yt.endX,yt.endY,.5,E),tt=yt.endX,z=yt.endY;break;case Br:var xt=no(yt,b),Ct=xt.length;if(Ct===0){E.push(yt.centerX),E.push(yt.centerY),tt=yt.centerX,z=yt.centerY;break}for(var bt=0;bt<Ct;bt++){var Vt=xt[bt];_t.Qe(tt,z,Vt[2],Vt[3],Vt[4],Vt[5],Vt[6],Vt[7],.5,E),tt=Vt[6],z=Vt[7]}break;case io:if(xt=Wi(yt,b,tt,z),Ct=xt.length,bt=yt.endX,Vt=yt.endY,Ct===0){E.push(bt),E.push(Vt),tt=bt,z=Vt;break}for(bt=0;bt<Ct;bt++)Vt=xt[bt],_t.Qe(tt,z,Vt[2],Vt[3],Vt[4],Vt[5],Vt[6],Vt[7],.5,E),tt=Vt[6],z=Vt[7];break;default:Gt("Segment not of valid type: "+yt.type)}yt.isClosed&&(E.push(rt),E.push(ot))}4<=E.length&&(y.push(E),x.push(Xr(E)))}}}function Xr(a){for(var y=[],x=0,E=0,b=a.length,z=0;z<b;z+=2){var tt=a[z],rt=a[z+1];z!==0&&y.push(Math.sqrt(Oi(x,E,tt,rt))),x=tt,E=rt}return y}wt.add=function(a){return this.ee.add(a),this},wt.pm=function(a,y,x,E,b,z,tt,rt){return this._isFrozen&&de(this),this.fg=new fi(a,y,b,z).freeze(),this.gg=new fi(x,E,tt,rt).freeze(),this},ye.Object.defineProperties(fe.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 po(this),this.tk}},flattenedLengths:{get:function(){return po(this),this.ym}},flattenedTotalLength:{get:function(){var a=this.zm;if(isNaN(a)){if(this.type===fe.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===fe.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,E=a=0;E<x;E++)for(var b=y[E],z=b.length,tt=0;tt<z;tt++)a+=b[tt]}this.zm=a}return a}},type:{get:function(){return this.na},set:function(a){this.na!==a&&(this._isFrozen&&de(this,a),this.na=a,a===fe.o?this.ee=new fn:(fe.V===null&&(fe.V=new fn().freeze()),this.ee=fe.V),this._isInvalidBounds=!0)}},startX:{get:function(){return this.od},set:function(a){this.od!==a&&(this._isFrozen&&de(this,a),this.od=a,this._isInvalidBounds=!0)}},startY:{get:function(){return this.pd},set:function(a){this.pd!==a&&(this._isFrozen&&de(this,a),this.pd=a,this._isInvalidBounds=!0)}},endX:{get:function(){return this.Dc},set:function(a){this.Dc!==a&&(this._isFrozen&&de(this,a),this.Dc=a,this._isInvalidBounds=!0)}},endY:{get:function(){return this.Ec},set:function(a){this.Ec!==a&&(this._isFrozen&&de(this,a),this.Ec=a,this._isInvalidBounds=!0)}},figures:{get:function(){return this.ee},set:function(a){this.ee!==a&&(this._isFrozen&&de(this,a),this.ee=a,this._isInvalidBounds=!0)}},spot1:{get:function(){return this.fg},set:function(a){this._isFrozen&&de(this,a),this.fg=a.J()}},spot2:{get:function(){return this.gg},set:function(a){this._isFrozen&&de(this,a),this.gg=a.J()}},defaultStretch:{get:function(){return this.Uf},set:function(a){this._isFrozen&&de(this,a),this.Uf=a}},bounds:{get:function(){return this.Zu()&&this.computeBounds(),this.Ip}}}),fe.prototype.setSpots=fe.prototype.pm,fe.prototype.add=fe.prototype.add,fe.prototype.getFractionForPoint=fe.prototype.xx,fe.prototype.getPointAndAngleAlongPath=fe.prototype.Qu,fe.prototype.getAngleAlongPath=fe.prototype.wx,fe.prototype.getPointAlongPath=fe.prototype.Pu,fe.prototype.containsPoint=fe.prototype.ca,fe.prototype.transform=fe.prototype.transform,fe.prototype.rotate=fe.prototype.rotate,fe.prototype.scale=fe.prototype.scale,fe.prototype.offset=fe.prototype.offset,fe.prototype.normalize=fe.prototype.normalize,fe.prototype.computeBoundsWithoutOrigin=fe.prototype.ix,fe.prototype.equalsApprox=fe.prototype.Xa,fe.className="Geometry",fe.j=new rn(fe,"Line",0),fe.u=new rn(fe,"Rectangle",1),fe.F=new rn(fe,"Ellipse",2),fe.o=new rn(fe,"Path",3),fe.V=null,fe.hb="UuBbMmZzLlHhVvCcSsQqTtAaFfXx",fe.className="Geometry",fe.stringify=fe.ia,fe.fillPath=fe.nb,fe.parse=fe.parse,fe.Line=fe.j,fe.Rectangle=fe.u,fe.Ellipse=fe.F,fe.Path=fe.o;function Dr(a,y,x,E,b){Hi(this),x===void 0&&(x=!0),E===void 0&&(E=!0),b===void 0&&(b=!1),this.l=2|(x?4:0)|(E?8:0)|(b?16:0),a!==void 0?this.od=a:this.od=0,y!==void 0?this.pd=y:this.pd=0,this.pl=new fn,this.sr=this.pl.Ja,this.fw=null}Dr.prototype.copy=function(){var a=new Dr;a.l=this.l&-2,a.od=this.od,a.pd=this.pd;for(var y=this.pl.s,x=y.length,E=a.pl,b=0;b<x;b++){var z=y[b].copy();E.add(z)}return a.sr=this.sr,a.fw=this.fw,a},wt=Dr.prototype,wt.Xa=function(a){if(!(a instanceof Dr&&_t.B(this.startX,a.startX)&&_t.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 E=0;E<x;E++)if(!y[E].Xa(a[E]))return!1;return!0},wt.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,E=x.length,b=0;b<E;b++)y+=" "+x[b].toString(a);return y},wt.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},wt.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},wt.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},wt.add=function(a){return this.pl.add(a),this},wt.ca=function(a,y,x){for(var E=this.startX,b=this.startY,z=E,tt=b,rt=this.segments.s,ot=rt.length,lt=0;lt<ot;lt++){var ut=rt[lt];switch(ut.type){case ir:z=ut.endX,tt=ut.endY,E=ut.endX,b=ut.endY;break;case Ji:if(_t.Yb(E,b,ut.endX,ut.endY,x,a,y))return!0;E=ut.endX,b=ut.endY;break;case Mr:if(_t.cs(E,b,ut.point1X,ut.point1Y,ut.point2X,ut.point2Y,ut.endX,ut.endY,.5,a,y,x))return!0;E=ut.endX,b=ut.endY;break;case Lr:if(_t.jv(E,b,ut.point1X,ut.point1Y,ut.endX,ut.endY,.5,a,y,x))return!0;E=ut.endX,b=ut.endY;break;case Br:case io:var ft=ut.type===Br?no(ut,this):Wi(ut,this,E,b),yt=ft.length,xt=ut.type===Br?ut.centerX:ut.endX,Ct=ut.type===Br?ut.centerY:ut.endY;if(yt===0){if(_t.Yb(E,b,xt,Ct,x,a,y))return!0;E=xt,b=Ct;break}for(xt=null,Ct=0;Ct<yt;Ct++)if(xt=ft[Ct],Ct===0&&_t.Yb(E,b,xt[0],xt[1],x,a,y)||_t.cs(xt[0],xt[1],xt[2],xt[3],xt[4],xt[5],xt[6],xt[7],.5,a,y,x))return!0;xt!==null&&(E=xt[6],b=xt[7]);break;default:Gt("Unknown Segment type: "+ut.type)}if(ut.isClosed&&(E!==z||b!==tt)&&_t.Yb(E,b,z,tt,x,a,y))return!0}return!1},ye.Object.defineProperties(Dr.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&&de(this,a),this.l=a?this.l|4:this.l&-5}},isShadowed:{get:function(){return(this.l&8)!==0},set:function(a){this._isFrozen&&de(this,a),this.l=a?this.l|8:this.l&-9}},isEvenOdd:{get:function(){return(this.l&16)!==0},set:function(a){this._isFrozen&&de(this,a),this.l=a?this.l|16:this.l&-17}},startX:{get:function(){return this.od},set:function(a){this._isFrozen&&de(this,a),this.od=a,this._isInvalidBounds=!0}},startY:{get:function(){return this.pd},set:function(a){this._isFrozen&&de(this,a),this.pd=a,this._isInvalidBounds=!0}},segments:{get:function(){return this.pl},set:function(a){this._isFrozen&&de(this,a),this.pl=a,this._isInvalidBounds=!0}}}),Dr.prototype.add=Dr.prototype.add,Dr.prototype.equalsApprox=Dr.prototype.Xa,Dr.className="PathFigure";function Ki(a,y,x,E,b,z,tt,rt){Hi(this),a===void 0&&(a=Ji),this.na=a,this.l=2,y!==void 0?this.Dc=y:this.Dc=0,x!==void 0?this.Ec=x:this.Ec=0,E===void 0&&(E=0),b===void 0&&(b=0),z===void 0&&(z=0),tt===void 0&&(tt=0),a===io?(a=z%360,0>a&&(a+=360),this.Ne=a,this.Vh=0,this.Wh=Math.max(E,0),this.Pg=Math.max(b,0),typeof tt=="boolean"?tt&&(this.isLargeArc=!0):typeof tt=="number"&&tt&&(this.isLargeArc=!0),rt&&(this.isClockwiseArc=!0)):(this.Ne=E,this.Vh=b,a===Br&&(z=Math.max(z,0)),this.Wh=z,typeof tt=="number"?(a===Br&&(tt=Math.max(tt,0)),this.Pg=tt):this.Pg=0),this.ae=null}Ki.prototype.copy=function(){var a=new Ki;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},wt=Ki.prototype,wt.Xa=function(a){if(!(a instanceof Ki)||this.type!==a.type||this.isClosed!==a.isClosed)return!1;switch(this.type){case ir:case Ji:return _t.B(this.endX,a.endX)&&_t.B(this.endY,a.endY);case Mr:return _t.B(this.endX,a.endX)&&_t.B(this.endY,a.endY)&&_t.B(this.point1X,a.point1X)&&_t.B(this.point1Y,a.point1Y)&&_t.B(this.point2X,a.point2X)&&_t.B(this.point2Y,a.point2Y);case Lr:return _t.B(this.endX,a.endX)&&_t.B(this.endY,a.endY)&&_t.B(this.point1X,a.point1X)&&_t.B(this.point1Y,a.point1Y);case Br:return _t.B(this.startAngle,a.startAngle)&&_t.B(this.sweepAngle,a.sweepAngle)&&_t.B(this.centerX,a.centerX)&&_t.B(this.centerY,a.centerY)&&_t.B(this.radiusX,a.radiusX)&&_t.B(this.radiusY,a.radiusY);case io:return this.isClockwiseArc===a.isClockwiseArc&&this.isLargeArc===a.isLargeArc&&_t.B(this.xAxisRotation,a.xAxisRotation)&&_t.B(this.endX,a.endX)&&_t.B(this.endY,a.endY)&&_t.B(this.radiusX,a.radiusX)&&_t.B(this.radiusY,a.radiusY);default:return!1}},wt.qb=function(a){a.classType===Ki&&(this.type=a)},wt.toString=function(a){switch(a===void 0&&(a=-1),this.type){case ir:a=0>a?"M"+this.endX.toString()+" "+this.endY.toString():"M"+this.endX.toFixed(a)+" "+this.endY.toFixed(a);break;case Ji:a=0>a?"L"+this.endX.toString()+" "+this.endY.toString():"L"+this.endX.toFixed(a)+" "+this.endY.toFixed(a);break;case Mr: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 Lr: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 Br: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 io: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":"")},wt.freeze=function(){return this._isFrozen=!0,this},wt.ka=function(){return this._isFrozen=!1,this},wt.close=function(){return this.isClosed=!0,this};function no(a,y){if(a.ae!==null&&y._isInvalidBounds===!1)return a.ae;var x=a.radiusX,E=a.radiusY;if(E===void 0&&(E=x),x===0||E===0)return a.ae=[],a.ae;y=a.Ne;var b=a.Vh,z=_t.jx(0,0,x<E?x:E,a.startAngle,a.startAngle+a.sweepAngle,!1);if(x!==E){var tt=ae.alloc();tt.reset(),x<E?tt.scale(1,E/x):tt.scale(x/E,1),fe.Ha(z,tt),ae.free(tt)}for(x=z.length,E=0;E<x;E++)tt=z[E],tt[0]+=y,tt[1]+=b,tt[2]+=y,tt[3]+=b,tt[4]+=y,tt[5]+=b,tt[6]+=y,tt[7]+=b;return a.ae=z,a.ae}function Wi(a,y,x,E){function b(bt,Vt,zt,Qt){return(bt*Qt<Vt*zt?-1:1)*Math.acos((bt*zt+Vt*Qt)/(Math.sqrt(bt*bt+Vt*Vt)*Math.sqrt(zt*zt+Qt*Qt)))}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,lt=a.Dc,ut=a.Ec,ft=Math.cos(tt),yt=Math.sin(tt),xt=ft*(x-lt)/2+yt*(E-ut)/2;tt=-yt*(x-lt)/2+ft*(E-ut)/2;var Ct=xt*xt/(y*y)+tt*tt/(z*z);return 1<Ct&&(y*=Math.sqrt(Ct),z*=Math.sqrt(Ct)),Ct=(rt===ot?-1:1)*Math.sqrt((y*y*z*z-y*y*tt*tt-z*z*xt*xt)/(y*y*tt*tt+z*z*xt*xt)),isNaN(Ct)&&(Ct=0),rt=Ct*y*tt/z,Ct=Ct*-z*xt/y,isNaN(rt)&&(rt=0),isNaN(Ct)&&(Ct=0),x=(x+lt)/2+ft*rt-yt*Ct,E=(E+ut)/2+yt*rt+ft*Ct,ut=b(1,0,(xt-rt)/y,(tt-Ct)/z),ft=(xt-rt)/y,lt=(tt-Ct)/z,xt=(-xt-rt)/y,rt=(-tt-Ct)/z,tt=b(ft,lt,xt,rt),xt=(ft*xt+lt*rt)/(Math.sqrt(ft*ft+lt*lt)*Math.sqrt(xt*xt+rt*rt)),-1>=xt?tt=Math.PI:1<=xt&&(tt=0),!ot&&0<tt&&(tt-=2*Math.PI),ot&&0>tt&&(tt+=2*Math.PI),ot=y>z?1:y/z,xt=y>z?z/y:1,y=_t.jx(0,0,y>z?y:z,ut,ut+tt,!0),z=ae.alloc(),z.reset(),z.translate(x,E),z.rotate(a.Ne,0,0),z.scale(ot,xt),fe.Ha(y,z),ae.free(z),a.ae=y,a.ae}ye.Object.defineProperties(Ki.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&&de(this,a),this.na=a,this._isInvalidBounds=!0}},endX:{get:function(){return this.Dc},set:function(a){this._isFrozen&&de(this,a),this.Dc=a,this._isInvalidBounds=!0}},endY:{get:function(){return this.Ec},set:function(a){this._isFrozen&&de(this,a),this.Ec=a,this._isInvalidBounds=!0}},point1X:{get:function(){return this.Ne},set:function(a){this._isFrozen&&de(this,a),this.Ne=a,this._isInvalidBounds=!0}},point1Y:{get:function(){return this.Vh},set:function(a){this._isFrozen&&de(this,a),this.Vh=a,this._isInvalidBounds=!0}},point2X:{get:function(){return this.Wh},set:function(a){this._isFrozen&&de(this,a),this.Wh=a,this._isInvalidBounds=!0}},point2Y:{get:function(){return this.Pg},set:function(a){this._isFrozen&&de(this,a),this.Pg=a,this._isInvalidBounds=!0}},centerX:{get:function(){return this.Ne},set:function(a){this._isFrozen&&de(this,a),this.Ne=a,this._isInvalidBounds=!0}},centerY:{get:function(){return this.Vh},set:function(a){this._isFrozen&&de(this,a),this.Vh=a,this._isInvalidBounds=!0}},radiusX:{get:function(){return this.Wh},set:function(a){0>a&&un(a,">= zero",Ki,"radiusX"),this._isFrozen&&de(this,a),this.Wh=a,this._isInvalidBounds=!0}},radiusY:{get:function(){return this.Pg},set:function(a){0>a&&un(a,">= zero",Ki,"radiusY"),this._isFrozen&&de(this,a),this.Pg=a,this._isInvalidBounds=!0}},startAngle:{get:function(){return this.Dc},set:function(a){this._isFrozen&&de(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&&de(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&&de(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&&de(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&&de(this,a),a%=360,0>a&&(a+=360),this.Ne=a,this._isInvalidBounds=!0}}}),Ki.prototype.equalsApprox=Ki.prototype.Xa;var ir=new rn(Ki,"Move",0),Ji=new rn(Ki,"Line",1),Mr=new rn(Ki,"Bezier",2),Lr=new rn(Ki,"QuadraticBezier",3),Br=new rn(Ki,"Arc",4),io=new rn(Ki,"SvgArc",4);Ki.className="PathSegment",Ki.Move=ir,Ki.Line=Ji,Ki.Bezier=Mr,Ki.QuadraticBezier=Lr,Ki.Arc=Br,Ki.SvgArc=io;function Zi(){this.H=null,this.xu=new At(0,0).freeze(),this.mt=new At(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}Zi.prototype.copy=function(){var a=new Zi;return this.clone(a)},Zi.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},Zi.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},Zi.prototype.So=function(a,y){var x=this.diagram;return x===null||Mg(x,a,y),y},Zi.prototype.Bz=function(a,y){var x=this.diagram;return x===null||(Mg(x,a,y),y.assign(x.Ps(y))),y},ye.Object.defineProperties(Zi.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}}}),Zi.prototype.getMultiTouchDocumentPoint=Zi.prototype.Bz,Zi.prototype.getMultiTouchViewPoint=Zi.prototype.So,Zi.className="InputEvent";function Sr(){this.H=null,this.xa="",this.ar=this.Lr=null}Sr.prototype.copy=function(){var a=new Sr;return a.H=this.H,a.xa=this.xa,a.Lr=this.Lr,a.ar=this.ar,a},Sr.prototype.toString=function(){var a="*"+this.name;return this.subject!==null&&(a+=":"+this.subject.toString()),this.parameter!==null&&(a+="("+this.parameter.toString()+")"),a},ye.Object.defineProperties(Sr.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}}}),Sr.className="DiagramEvent";function Li(){this.Fm=wr,this.rf=this.Qq="",this.Ln=this.Mn=this.Rn=this.Sn=this.Qn=this.H=this.cc=null}Li.prototype.clear=function(){this.Ln=this.Mn=this.Rn=this.Sn=this.Qn=this.H=this.cc=null},Li.prototype.copy=function(){var a=new Li;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=Ie(y)&&typeof y.J=="function"?y.J():y,y=this.Rn,a.Rn=Ie(y)&&typeof y.J=="function"?y.J():y,y=this.Mn,a.Mn=Ie(y)&&typeof y.J=="function"?y.J():y,y=this.Ln,a.Ln=Ie(y)&&typeof y.J=="function"?y.J():y,a},Li.prototype.qb=function(a){a.classType===Li&&(this.change=a)},Li.prototype.toString=function(){var a="";return a=this.change===Qi?a+"* ":this.change===wr?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===Qi?this.oldValue!==null&&(a+=" "+this.oldValue):(this.object!==null&&(a+=Ii(this.object)),this.oldValue!==null&&(a+=" old: "+Ii(this.oldValue)),this.oldParam!==null&&(a+=" "+this.oldParam),this.newValue!==null&&(a+=" new: "+Ii(this.newValue)),this.newParam!==null&&(a+=" "+this.newParam)),a},Li.prototype.I=function(a){return a?this.oldValue:this.newValue},Li.prototype.Dz=function(a){return a?this.oldParam:this.newParam},Li.prototype.canUndo=function(){return this.model!==null||this.diagram!==null},Li.prototype.undo=function(){this.canUndo()&&(this.model!==null?this.model.changeState(this,!0):this.diagram!==null&&this.diagram.changeState(this,!0))},Li.prototype.canRedo=function(){return this.model!==null||this.diagram!==null},Li.prototype.redo=function(){this.canRedo()&&(this.model!==null?this.model.changeState(this,!1):this.diagram!==null&&this.diagram.changeState(this,!1))},ye.Object.defineProperties(Li.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===Qi&&(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}}}),Li.prototype.redo=Li.prototype.redo,Li.prototype.canRedo=Li.prototype.canRedo,Li.prototype.undo=Li.prototype.undo,Li.prototype.canUndo=Li.prototype.canUndo,Li.prototype.getParam=Li.prototype.Dz,Li.prototype.getValue=Li.prototype.I,Li.prototype.clear=Li.prototype.clear;var Qi=new rn(Li,"Transaction",-1),wr=new rn(Li,"Property",0),ro=new rn(Li,"Insert",1),So=new rn(Li,"Remove",2);Li.className="ChangedEvent",Li.Transaction=Qi,Li.Property=wr,Li.Insert=ro,Li.Remove=So;function No(){this.o=new fn().freeze(),this.xa="",this.j=!1}No.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 E=this.changes.M(x);E!==null&&(y+=`
|
|
`+E.toString())}}return y},No.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()},No.prototype.canUndo=function(){return this.isComplete},No.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()}},No.prototype.canRedo=function(){return this.isComplete},No.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()}},No.prototype.ak=function(){if(this.isComplete){var a=this.changes;a.ka();for(var y=new be,x=0;x<a.count;x++){var E=a.M(x);if(E!==null&&E.change===wr&&E.object){var b=y.get(E.object);b||(b=new be,y.set(E.object,b));var z=b.get(E.propertyName);z===null?b.set(E.propertyName,-1):(0<z&&a.cd(z,null),b.set(E.propertyName,x))}}for(x=y=0;x<a.count;x++)E=a.M(x),E!==null&&(x>y&&a.cd(y,E),y++);for(;a.length>y;)a.pop();a.freeze()}},ye.Object.defineProperties(No.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}}}),No.prototype.optimize=No.prototype.ak,No.prototype.redo=No.prototype.redo,No.prototype.canRedo=No.prototype.canRedo,No.prototype.undo=No.prototype.undo,No.prototype.canUndo=No.prototype.canUndo,No.prototype.clear=No.prototype.clear,No.className="Transaction";function $i(){this.Pt=new pn,this.Jd=!1,this.u=new fn().freeze(),this.Ce=-1,this.o=999,this.Fe=!1,this.Np=null,this.bi=0,this.j=!1,this.Ie=new fn().freeze(),this.hl=new fn,this.tt=!0,this.Dt=this.rq=this.Gt=this.Ft=!1}$i.prototype.toString=function(a){var y="UndoManager "+this.historyIndex+"<"+this.history.count+"<="+this.maxHistoryLength;y+="[";for(var x=this.nestedTransactionNames.count,E=0;E<x;E++)0<E&&(y+=" "),y+=this.nestedTransactionNames.M(E);if(y+="]",a!==void 0&&0<a)for(x=this.history.count,E=0;E<x;E++)y+=`
|
|
`+this.history.M(E).toString(a-1);return y},$i.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},$i.prototype.copyProperties=function(a){this.isEnabled=a.isEnabled,this.maxHistoryLength=a.maxHistoryLength,this.checksTransactionLevel=a.checksTransactionLevel},wt=$i.prototype,wt.Xw=function(a){this.Pt.add(a)},wt.Rx=function(a){this.Pt.remove(a)},wt.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},wt.eb=function(a){return a===void 0&&(a=""),_a(this,!0,a)},wt.Kf=function(){return _a(this,!1,"")};function _a(a,y,x){if(a.isUndoingRedoing)return!1;a.checksTransactionLevel&&1>a.transactionLevel&&Mn("Ending transaction without having started a transaction: "+x);var E=a.transactionLevel===1,b=a.currentTransaction;E&&y&&(a.isInternalTransaction||a.Ob("CommittingTransaction",x,b));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(E){if(y)a.rq=!1,b===null&&x!==""&&(b=a.currentTransaction),a.isEnabled&&b!==null&&(b.isComplete||(b.isComplete=!0,b.name=x),a.lx(),y=a.history,y.ka(),E=a.maxHistoryLength,0<=E&&(E===0?y.clear():y.count>=E&&(z=y.M(0),z!==null&&z.clear(),y.mb(0),a.Ce--)),E===0||y.count!==0&&y.get(y.count-1)===b||(y.add(b),a.Ce++),y.freeze()),a.isInternalTransaction||a.Ob("CommittedTransaction",x,b);else{a.Fe=!0;try{a.isEnabled&&b!==null&&(b.isComplete=!0,b.undo())}finally{a.isInternalTransaction||a.Ob("RolledBackTransaction",x,b),a.Fe=!1}b!==null&&b.clear()}return a.Np=null,a.isPendingClear&&a.clear(),a.isPendingClear=!1,a.isPendingUnmodified=!1,!0}if(a.isEnabled&&!y&&b!==null){for(a=z,x=b.changes,b=x.count-1;b>=a;b--)y=x.M(b),y!==null&&y.undo(),x.ka(),x.mb(b);x.freeze()}return!1}wt.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()}},$i.prototype.canUndo=function(){if(!this.isEnabled||0<this.transactionLevel)return!1;var a=this.transactionToUndo;return!!(a!==null&&a.canUndo())},$i.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){Mn("undo error: "+y.toString())}finally{this.Ob("FinishedUndo","Undo",a),this.Fe=!1}}},$i.prototype.canRedo=function(){if(!this.isEnabled||0<this.transactionLevel)return!1;var a=this.transactionToRedo;return!!(a!==null&&a.canRedo())},$i.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){Mn("redo error: "+y.toString())}finally{this.Ob("FinishedRedo","Redo",a),this.Fe=!1}}},$i.prototype.Ob=function(a,y,x){x===void 0&&(x=null);var E=new Li;for(E.change=Qi,E.propertyName=a,E.object=x,E.oldValue=y,a=this.models;a.next();)y=a.value,E.model=y,y.ds(E)},$i.prototype.Tu=function(a){if(this.isEnabled&&!this.isUndoingRedoing&&!this.skipsEvent(a)){var y=this.currentTransaction;y===null&&(this.Np=y=new No);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||Mn("Change not within a transaction: "+x.toString()))}},$i.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},ye.Object.defineProperties($i.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}}}),$i.prototype.handleChanged=$i.prototype.Tu,$i.prototype.redo=$i.prototype.redo,$i.prototype.undo=$i.prototype.undo,$i.prototype.canUndo=$i.prototype.canUndo,$i.prototype.discardHistoryAfterIndex=$i.prototype.lx,$i.prototype.rollbackTransaction=$i.prototype.Kf,$i.prototype.commitTransaction=$i.prototype.eb,$i.prototype.startTransaction=$i.prototype.Ea,$i.prototype.removeModel=$i.prototype.Rx,$i.prototype.addModel=$i.prototype.Xw,$i.prototype.clear=$i.prototype.clear,$i.className="UndoManager";function or(){Hi(this),this.H=Zu,this.xa="",this.Jd=!0,this.nb=!1,this.wm=null,this.yy=new Zi,this.Zr=-1}or.prototype.toString=function(){return this.name!==""?this.name+" Tool":ei(this.constructor)},or.prototype.updateAdornments=function(){},or.prototype.canStart=function(){return this.isEnabled},or.prototype.doStart=function(){},or.prototype.doActivate=function(){this.isActive=!0},or.prototype.doDeactivate=function(){this.isActive=!1},or.prototype.doStop=function(){},or.prototype.doCancel=function(){this.transactionResult=null,this.stopTool()},or.prototype.stopTool=function(){var a=this.diagram;a.currentTool===this&&(a.currentTool=null,a.currentCursor="")},or.prototype.doMouseDown=function(){!this.isActive&&this.canStart()&&this.doActivate()},or.prototype.doMouseMove=function(){},or.prototype.doMouseUp=function(){this.stopTool()},or.prototype.doMouseWheel=function(){},or.prototype.canStartMultiTouch=function(){return!0},or.prototype.standardPinchZoomStart=function(){var a=this.diagram,y=a.lastInput,x=y.So(0,At.allocAt(NaN,NaN)),E=y.So(1,At.allocAt(NaN,NaN));if(x.w()&&E.w()&&(this.doCancel(),a.Ql("hasGestureZoom"))){a.Bw=a.scale;var b=E.x-x.x,z=E.y-x.y;a.Jw=Math.sqrt(b*b+z*z),y.bubbles=!1}At.free(x),At.free(E)},or.prototype.standardPinchZoomMove=function(){var a=this.diagram,y=a.lastInput,x=y.So(0,At.allocAt(NaN,NaN)),E=y.So(1,At.allocAt(NaN,NaN));if(x.w()&&E.w()&&(this.doCancel(),a.Ql("hasGestureZoom"))){var b=E.x-x.x,z=E.y-x.y;z=Math.sqrt(b*b+z*z)/a.Jw,b=new At((Math.min(E.x,x.x)+Math.max(E.x,x.x))/2,(Math.min(E.y,x.y)+Math.max(E.y,x.y))/2),z*=a.Bw;var tt=a.commandHandler;if(z!==a.scale&&tt.canResetZoom(z)){var rt=a.zoomPoint;a.zoomPoint=b,tt.resetZoom(z),a.zoomPoint=rt}y.bubbles=!1}At.free(x),At.free(E)},or.prototype.doKeyDown=function(){this.diagram.lastInput.key==="Esc"&&this.doCancel()},or.prototype.doKeyUp=function(){},or.prototype.Ea=function(a){return a===void 0&&(a=this.name),this.transactionResult=null,this.diagram.Ea(a)},or.prototype.stopTransaction=function(){var a=this.diagram;return this.transactionResult===null?a.Kf():a.eb(this.transactionResult)},or.prototype.standardMouseSelect=function(){var a=this.diagram;if(a.allowSelect){var y=a.lastInput,x=a.Ol(y.documentPoint,!1);if(x!==null){if(yr?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||(yr?y.meta:y.control)||y.shift||a.clearSelection()}},or.prototype.standardMouseClick=function(a,y){a===void 0&&(a=null),y===void 0&&(y=function(b){return!b.layer.isTemporary});var x=this.diagram,E=x.lastInput;return a=x.ic(E.documentPoint,a,y),E.targetObject=a,Oo(a,E,x),E.handled};function Oo(a,y,x){if(y.handled=!1,a===null||a.If()){var E=0;y.left?E=y.clickCount===1?1:y.clickCount===2?2:1:y.right&&y.clickCount===1&&(E=3);var b="ObjectSingleClicked";if(a!==null){switch(E){case 1:b="ObjectSingleClicked";break;case 2:b="ObjectDoubleClicked";break;case 3:b="ObjectContextClicked"}E!==0&&x.R(b,a)}else{switch(E){case 1:b="BackgroundSingleClicked";break;case 2:b="BackgroundDoubleClicked";break;case 3:b="BackgroundContextClicked"}E!==0&&x.R(b)}if(a!==null)for(;a!==null;){switch(x=null,E){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,E){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)}}}or.prototype.standardMouseOver=function(){var a=this.diagram,y=a.lastInput;if(a.animationManager.zb!==!0){var x=a.skipsUndoManager;a.skipsUndoManager=!0;var E=a.viewportBounds.ca(y.documentPoint)?a.ic(y.documentPoint,null,null):null;!y.event||y.event.type!=="pointercancel"&&y.event.type!=="pointerout"||(E=null),y.targetObject=E;var b=!1;if(E!==a.Ck){var z=a.Ck,tt=z;for(a.Ck=E,this.doCurrentObjectChanged(z,E),y.handled=!1;z!==null;){var rt=z.mouseLeave;if(rt!==null&&(E===z||E!==null&&E.rg(z)||(rt(y,z,E),b=!0,y.handled)))break;z=z.panel}for(z=tt,y.handled=!1;E!==null&&(tt=E.mouseEnter,!(tt!==null&&(z===E||z!==null&&z.rg(E)||(tt(y,E,z),b=!0,y.handled))));)E=E.panel;E=a.Ck}if(E!==null){for(z=E,tt="";z!==null&&(tt=z.cursor,tt==="");)z=z.panel;for(a.currentCursor=tt,y.handled=!1,z=E;z!==null&&(E=z.mouseOver,!(E!==null&&(E(y,z),b=!0,y.handled)));)z=z.panel}else this.doUpdateCursor(null),E=a.mouseOver,E!==null&&(E(y),b=!0);b&&a.$b(),a.skipsUndoManager=x}},or.prototype.doUpdateCursor=function(){var a=this.diagram;a&&(a.currentCursor="")},or.prototype.doCurrentObjectChanged=function(){},or.prototype.standardMouseWheel=function(){var a=this.diagram,y=a.lastInput,x=y.delta;if(x!==0&&a.documentBounds.w()){var E=a.commandHandler,b=a.toolManager.mouseWheelBehavior;if(E!==null&&(b===la&&!y.shift||b===Yo&&y.control))(0<x?E.canIncreaseZoom():E.canDecreaseZoom())&&(b=a.zoomPoint,a.zoomPoint=y.viewPoint,0<x?E.increaseZoom():E.decreaseZoom(),a.zoomPoint=b),y.bubbles=!1;else if(b===la&&y.shift||b===Yo&&!y.control){E=a.position.copy();var z=y.event;b=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(b){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,E,y)}}},or.prototype.doWheelChange=function(a,y,x){a.position.D(y)&&x.event.wheelDeltaX===0||(x.bubbles=!1)},or.prototype.standardWaitAfter=function(a,y){y===void 0&&(y=this.diagram.lastInput),this.cancelWaitAfter();var x=this,E=y.clone(this.yy);this.Zr=Ei(function(){x.doWaitAfter(E)},a)},or.prototype.cancelWaitAfter=function(){this.Zr!==-1&&Je.clearTimeout(this.Zr),this.Zr=-1},or.prototype.doWaitAfter=function(){},or.prototype.findToolHandleAt=function(a,y){return a=this.diagram.ic(a,function(x){for(;x!==null&&!(x.panel instanceof Qr);)x=x.panel;return x}),a===null?null:a.part.category===y?a:null},or.prototype.isBeyondDragSize=function(a,y){var x=this.diagram;a===void 0&&(a=x.firstInput.viewPoint),y===void 0&&(y=x.lastInput.viewPoint);var E=x.toolManager.dragSize,b=E.width;return E=E.height,x.firstInput.isTouchEvent&&(b+=6,E+=6),Math.abs(y.x-a.x)>b||Math.abs(y.y-a.y)>E},ye.Object.defineProperties(or.prototype,{diagram:{get:function(){return this.H},set:function(a){a instanceof ke&&(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}}}),or.prototype.startTransaction=or.prototype.Ea,or.className="Tool";function Ar(){or.call(this),this.name="ToolManager",this.hb=new fn,this.ob=new fn,this.Hb=new fn,this.F=this.V=850,this.o=new on(2,2).ja(),this.Ha=5e3,this.ia=Yo,this.u=Xl,this.Mp=this.j=null,this.zj=-1}Se(Ar,or),Ar.prototype.initializeStandardTools=function(){},Ar.prototype.updateAdornments=function(a){var y=this.currentToolTip;if(y instanceof Qr&&this.Mp===a){var x=y.adornedObject;(a!==null?x.part===a:x===null)?this.showToolTip(y,x):this.hideToolTip()}},Ar.prototype.doMouseDown=function(){var a=this.diagram,y=a.lastInput;if(y.isTouchEvent&&this.gestureBehavior===Js&&(y.bubbles=!1),y.isMultiTouch){if(this.cancelWaitAfter(),this.gestureBehavior===Dl){y.bubbles=!0;return}if(this.gestureBehavior===Js)return;if(a.currentTool.canStartMultiTouch()){a.currentTool.standardPinchZoomStart();return}}for(var x=this.mouseDownTools.length,E=0;E<x;E++){var b=this.mouseDownTools.M(E);if(b.diagram=this.diagram,b.canStart()){a.doFocus(),a.currentTool=b,a.currentTool===b&&(b.isActive||b.doActivate(),b.doMouseDown());return}}a.lastInput.button===1&&(this.mouseWheelBehavior===Yo?this.mouseWheelBehavior=la:this.mouseWheelBehavior===la&&(this.mouseWheelBehavior=Yo)),this.doActivate(),this.standardWaitAfter(this.holdDelay,y)},Ar.prototype.doMouseMove=function(){var a=this.diagram,y=a.lastInput;if(y.isMultiTouch){if(this.gestureBehavior===Dl){y.bubbles=!0;return}if(this.gestureBehavior===Js)return;if(a.currentTool.canStartMultiTouch()){a.currentTool.standardPinchZoomMove();return}}if(this.isActive)for(var x=this.mouseMoveTools.length,E=0;E<x;E++){var b=this.mouseMoveTools.M(E);if(b.diagram=this.diagram,b.canStart()){a.doFocus(),a.currentTool=b,a.currentTool===b&&(b.isActive||b.doActivate(),b.doMouseMove());return}}ea(this,a),a=y.event,a===null||a.type!=="pointermove"&&a.cancelable||(y.bubbles=!0)};function ea(a,y){a.standardMouseOver(),a.isBeyondDragSize()&&a.standardWaitAfter(a.isActive?a.holdDelay:a.hoverDelay,y.lastInput)}Ar.prototype.doCurrentObjectChanged=function(a,y){a=this.currentToolTip,a===null||y!==null&&a instanceof Qr&&(y===a||y.rg(a))||this.hideToolTip()},Ar.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()))},Ar.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)},Ar.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 Qr)||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()},Ar.prototype.showToolTip=function(a,y){var x=this.diagram;if(a!==this.currentToolTip&&this.hideToolTip(),a instanceof Qr){a.layerName="Tool",a.selectable=!1,a.scale=1/x.scale,a.category="ToolTip",a.placeholder!==null&&(a.placeholder.scale=x.scale);var E=a.diagram;E!==null&&E!==x&&E.remove(a),x.add(a),y!==null?a.adornedObject=y:a.data=x.model,a.Va(),this.positionToolTip(a,y)}else a instanceof Mu&&a!==this.currentToolTip&&a.show(y,x,this);if(this.currentToolTip=a,this.zj!==-1&&(Je.clearTimeout(this.zj),this.zj=-1),a=this.toolTipDuration,0<a&&a!==1/0){var b=this;this.zj=Ei(function(){b.hideToolTip()},a)}},Ar.prototype.positionToolTip=function(a){if(a.placeholder===null){var y=this.diagram,x=y.lastInput.documentPoint.copy(),E=a.measuredBounds,b=y.viewportBounds;y.lastInput.isTouchEvent&&(x.x-=E.width),x.x+E.width>b.right&&(x.x-=E.width+5/y.scale),x.x<b.x&&(x.x=b.x),x.y=x.y+20/y.scale+E.height>b.bottom?x.y-(E.height+5/y.scale):x.y+20/y.scale,x.y<b.y&&(x.y=b.y),a.position=x}},Ar.prototype.hideToolTip=function(){this.zj!==-1&&(Je.clearTimeout(this.zj),this.zj=-1);var a=this.diagram,y=this.currentToolTip;y!==null&&(y instanceof Qr?(a.remove(y),this.Mp!==null&&this.Mp.Jf(y.category),y.data=null,y.adornedObject=null):y instanceof Mu&&y.hide!==null&&y.hide(a,this),this.currentToolTip=null)},Ar.prototype.doMouseUp=function(){this.cancelWaitAfter();var a=this.diagram;if(this.isActive)for(var y=this.mouseUpTools.length,x=0;x<y;x++){var E=this.mouseUpTools.M(x);if(E.diagram=this.diagram,E.canStart()){a.doFocus(),a.currentTool=E,a.currentTool===E&&(E.isActive||E.doActivate(),E.doMouseUp());return}}a.doFocus(),this.doDeactivate()},Ar.prototype.doMouseWheel=function(){this.standardMouseWheel()},Ar.prototype.doKeyDown=function(){var a=this.diagram;a.commandHandler!==null&&a.commandHandler.doKeyDown()},Ar.prototype.doKeyUp=function(){var a=this.diagram;a.commandHandler!==null&&a.commandHandler.doKeyUp()},Ar.prototype.findTool=function(a){for(var y=this.mouseDownTools.length,x=0;x<y;x++){var E=this.mouseDownTools.M(x);if(E.name===a)return E}for(y=this.mouseMoveTools.length,x=0;x<y;x++)if(E=this.mouseMoveTools.M(x),E.name===a)return E;for(y=this.mouseUpTools.length,x=0;x<y;x++)if(E=this.mouseUpTools.M(x),E.name===a)return E;return null},Ar.prototype.replaceTool=function(a,y){y!==null&&(y.diagram=this.diagram);for(var x=this.mouseDownTools.length,E=0;E<x;E++){var b=this.mouseDownTools.M(E);if(b.name===a)return y!==null?this.mouseDownTools.cd(E,y):this.mouseDownTools.mb(E),b}for(x=this.mouseMoveTools.length,E=0;E<x;E++)if(b=this.mouseMoveTools.M(E),b.name===a)return y!==null?this.mouseMoveTools.cd(E,y):this.mouseMoveTools.mb(E),b;for(x=this.mouseUpTools.length,E=0;E<x;E++)if(b=this.mouseUpTools.M(E),b.name===a)return y!==null?this.mouseUpTools.cd(E,y):this.mouseUpTools.mb(E),b;return null},Ar.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)},ye.Object.defineProperties(Ar.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 Qr?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}}}),Ar.prototype.replaceStandardTool=Ar.prototype.gb;var Yo=new rn(Ar,"WheelScroll",0),la=new rn(Ar,"WheelZoom",1),ll=new rn(Ar,"WheelNone",2),Xl=new rn(Ar,"GestureZoom",3),Js=new rn(Ar,"GestureCancel",4),Dl=new rn(Ar,"GestureNone",5);Ar.className="ToolManager",Ar.WheelScroll=Yo,Ar.WheelZoom=la,Ar.WheelNone=ll,Ar.GestureZoom=Xl,Ar.GestureCancel=Js,Ar.GestureNone=Dl;function jo(){or.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 At(NaN,NaN),this.Fr=new At,this.hb=!0,this.Ik=100,this.Cg=[],this.te=new pn().freeze(),this.ia=new at,this.Bn=null,this.F="copy",this.Oc="",this.Pc="no-drop"}var vs;Se(jo,or),jo.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},jo.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},jo.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,(yr?y.meta:y.control)||y.shift||a.clearSelection(!0),this.currentPart.isSelected=!0,a.R("ChangedSelection",a.selection))}}},jo.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),Ta=null,this.isActive=!0,this.tl.set(a.position),Ol(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&&Ts(a),xf(a,this.draggedParts),this.Ea("Drag"),this.startPoint=a.firstInput.documentPoint,a.isMouseCaptured=!0,a.allowDragOut&&(this.isDragOutStarted=!0,this.Ym=!1,Ta=this,Cn=this.diagram,this.doSimulatedDragOut()))};function Ol(a,y){if(a.dragsLink){var x=a.diagram;x.allowRelink&&(x.model.Wj()&&y.count===1&&y.first()instanceof Nn?(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 Zo,a.Oe.diagram=x),a.Oe.originalLink=a.draggedLink):(a.draggedLink=null,a.Oe=null))}}jo.prototype.computeEffectiveCollection=function(a,y){return this.diagram.commandHandler.computeEffectiveCollection(a,y)},jo.prototype.Pd=function(a){return a===void 0?new lh(Zn):this.isGridSnapEnabled?new lh(new At(Math.round(1e3*a.x)/1e3,Math.round(1e3*a.y)/1e3)):new lh(a.copy())},jo.prototype.doDeactivate=function(){this.isActive=!1;var a=this.diagram;if(this.diagram.layout.isRealtime=this.Sw,a.Fu(!1),a.ug(),Qs(this),sd(a,this.draggedParts),this.draggedParts=this.currentPart=this.Bn=null,this.Ym=this.isDragOutStarted=!1,0<vs.count){for(var y=vs,x=y.length,E=0;E<x;E++){var b=y.M(E);Wo(b),Mo(b),Qs(b),b.diagram.ug()}y.clear()}Wo(this),this.tl.h(NaN,NaN),Cn!==null&&(Cn.currentCursor=""),Ta=Cn=null,Mo(this),a.isMouseCaptured=!1,a.currentCursor="",a.Ns=!1,this.stopTransaction(),Lc(a,!0)},jo.prototype.stopTransaction=function(){var a=this.diagram,y=or.prototype.stopTransaction.call(this);return y&&a.undoManager.transactionToUndo!==null&&a.undoManager.transactionToUndo.ak(),y};function Qs(a){var y=a.diagram,x=y.skipsUndoManager;y.skipsUndoManager=!0,cu(a,y.lastInput,null),y.skipsUndoManager=x,a.Cg.length=0}function Ph(){var a=Ta;Mo(a),rs(a);var y=a.diagram;a.tl.w()&&(y.position=a.tl),y.ug()}jo.prototype.doCancel=function(){Mo(this),rs(this);var a=this.diagram;this.tl.w()&&(a.position=this.tl),this.stopTool()},jo.prototype.doKeyDown=function(){var a=this.diagram,y=a.lastInput;this.isActive&&(y.key==="Esc"?this.doCancel():y.key!==a.previousInput.key&&this.doMouseMove())},jo.prototype.doKeyUp=function(){this.isActive&&this.doMouseMove()};function Jl(a,y){if(a.copiedParts===null){var x=a.diagram;if((!y||!x.isReadOnly&&!x.isModelReadOnly)&&a.draggedParts!==null){var E=x.undoManager;for(E.isEnabled&&E.isInTransaction?E.currentTransaction!==null&&0<E.currentTransaction.changes.count&&(x.undoManager.Kf(),x.Ea("Drag")):rs(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 be,E=a.draggedParts.iterator;E.next();){var b=E.key;if(b.Zc()&&b.canCopy()){var z=y.I(b);z!==null&&(z.location=b.location,z.Va(),x.add(z,a.Pd(z.location)))}}for(y=y.iterator;y.next();)E=y.value,E instanceof Nn&&E.canCopy()&&x.add(E,a.Pd());a.copiedParts=x,Ol(a,x.Lf()),a.draggedLink!==null&&(x=a.draggedLink,y=x.routeBounds,_h(x,a.startPoint.x-(y.x+y.width/2),a.startPoint.y-(y.y+y.height/2))),a.doUpdateCursor(null)}}}function Mo(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 Nn&&(x.value.point=new At(0,0));a.doUpdateCursor(null)}y.skipsUndoManager=!1,y.partManager.addsToTemporaryLayer=!1,a.startPoint=y.firstInput.documentPoint}function Wo(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 Ca(a,y,x){var E=a.diagram,b=a.startPoint,z=At.alloc();z.assign(E.lastInput.documentPoint),a.moveParts(y,z.re(b),x),At.free(z),E.Gf("temporaryPixelRatio")===!0&&E.Yh===null&&30<E.$w&&(Ts(E),E.hk())}jo.prototype.moveParts=function(a,y,x){x===void 0&&(x=!1);var E=this.diagram;E!==null&&ad(E,a,y,this.dragOptions,x)};function rs(a){if(a.draggedParts!==null){for(var y=a.diagram,x=a.draggedParts.iterator;x.next();){var E=x.key;E.Zc()&&(E.location=x.value.point)}for(x=a.draggedParts.iterator;x.next();)if(E=x.key,E instanceof Nn&&E.suspendsRouting){var b=x.value.point;a.draggedParts.add(E,a.Pd()),_h(E,-b.x,-b.y)}y.bd()}}function $a(a,y){var x=a.diagram;a.dragsLink&&(a.draggedLink!==null&&(a.draggedLink.fromNode=null,a.draggedLink.toNode=null),hl(a,!1));var E=a.findDragOverObject(y),b=x.lastInput;b.targetObject=E,a.doUpdateCursor(E);var z=x.skipsUndoManager,tt=!1;try{if(x.skipsUndoManager=!0,tt=cu(a,b,E),!a.isActive&&Ta===null)return;var rt=E!==null?E.part:null;if(rt===null||x.handlesDragDropForTopLevelParts&&rt.isTopLevel&&!(rt instanceof er)){var ot=x.mouseDragOver;ot!==null&&(ot(b),tt=!0)}if(!a.isActive&&Ta===null||(a.doDragOver(y,E),!a.isActive&&Ta===null))return}finally{x.skipsUndoManager=z,tt&&x.bd()}a.Bn=E,x.isReadOnly||!x.allowMove&&!x.allowCopy||!x.allowHorizontalScroll&&!x.allowVerticalScroll||x.gs(b.viewPoint)}jo.prototype.findDragOverObject=function(a){var y=this;return Gu(this.diagram,a,null,function(x){return x===null?x=!0:(x=x.part,x=!!(x===null||x instanceof Qr||x.layer.isTemporary||y.draggedParts&&y.draggedParts.contains(x)||y.copiedParts&&y.copiedParts.contains(x))),!x})},jo.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 cu(a,y,x){var E=!1,b=a.Cg.length,z=0<b?a.Cg[0]:null;if(x===z)return!1;y.handled=!1;for(var tt=0;tt<b;tt++){var rt=a.Cg[tt],ot=rt.mouseDragLeave;if(ot!==null&&(ot(y,rt,x),E=!0,y.handled))break}if(a.Cg.length=0,!a.isActive&&Ta===null||x===null)return E;for(y.handled=!1,b=x;b!==null;)a.Cg.push(b),b=ul(b);for(b=a.Cg.length,x=0;x<b&&(tt=a.Cg[x],rt=tt.mouseDragEnter,rt===null||(rt(y,tt,z),E=!0,!y.handled));x++);return E}function ul(a){var y=a.panel;return y!==null?y:a instanceof Bi&&!(a instanceof er)&&(a=a.containingGroup,a!==null&&a.handlesDragDropForMembers)?a:null}function fu(a,y,x){var E=a.Oe;if(E===null)return null;var b=a.diagram.og(y,E.portGravity,function(lt){return E.findValidLinkablePort(lt,x)});a=At.alloc();var z=1/0,tt=null;for(b=b.iterator;b.next();){var rt=b.value;if(rt.part!==null){var ot=rt.ga(lr,a);ot=y.Bf(ot),ot<z&&(tt=rt,z=ot)}}return At.free(a),tt}function hl(a,y){var x=a.draggedLink;if(x!==null&&!(2>x.pointsCount)){var E=a.diagram;if(!E.isReadOnly){var b=a.Oe;if(b!==null){var z=null,tt=null;x.fromNode===null&&(z=fu(a,x.i(0),!1),z!==null&&(tt=z.part));var rt=null,ot=null;x.toNode===null&&(rt=fu(a,x.i(x.pointsCount-1),!0),rt!==null&&(ot=rt.part)),b.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!==E.Mx&&E.R("LinkRelinked",x,E.Mx),x.toPort!==E.Nx&&E.R("LinkRelinked",x,E.Nx)):Sl(b,tt,z,ot,rt):Sl(b,null,null,null,null)}}}}jo.prototype.doDragOver=function(){};function Il(a,y){var x=a.diagram;a.dragsLink&&hl(a,!0),Qs(a);var E=a.findDragOverObject(y),b=x.lastInput;if(b.targetObject=E,E!==null){b.handled=!1;for(var z=E;z!==null;){var tt=z.mouseDrop;if(tt!==null&&(tt(b,z),b.handled))break;rf(a,b,z),z=ul(z)}}else z=x.mouseDrop,z!==null&&z(b);if(a.isActive||Ta!==null){for(b=(a.copiedParts||a.draggedParts).iterator;b.next();)z=b.key,z instanceof $n&&z.linksConnected.each(function(rt){rt.suspendsRouting=!1});if(a.doDropOnto(y,E),a.isActive||Ta!==null){for(a=Be.alloc(),y=x.selection.iterator;y.next();)E=y.value,E instanceof $n&&of(x,E,a);Be.free(a)}}}function rf(a,y,x){a=a.diagram,x=x.part,!a.handlesDragDropForTopLevelParts||!x.isTopLevel||x instanceof er||(x=a.mouseDrop,x!==null&&x(y))}function of(a,y,x){var E=!1;if(x=y.getAvoidableRect(x),a.viewportBounds.Re(x)&&(E=!0),a=a.Nu(x,function(b){return b.part},function(b){return b instanceof Nn},!0,function(b){return b instanceof Nn},E),a.count!==0)for(a=a.iterator;a.next();)x=a.value,!x.Td(y)&&x.isAvoiding&&x.bb()}jo.prototype.doDropOnto=function(){},jo.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()?(Jl(this,!1),xf(a,this.copiedParts),Ca(this,this.copiedParts,!1),sd(a,this.copiedParts)):this.mayMove()?(Mo(this),Ca(this,this.draggedParts,!0)):this.mayDragOut()?(Jl(this,!1),Ca(this,this.copiedParts,!1)):Mo(this),$a(this,a.lastInput.documentPoint))}},jo.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?(Mo(this),Jl(this,!0),xf(a,this.copiedParts),Ca(this,this.copiedParts,!1),sd(a,this.copiedParts),this.copiedParts!==null&&(a.R("ChangingSelection",a.selection),a.clearSelection(!0),this.copiedParts.iteratorKeys.each(function(b){b.isSelected=!0}))):(y=!0,Mo(this),this.mayMove()&&(Ca(this,this.draggedParts,!0),$a(this,a.lastInput.documentPoint))),this.Ym=!0,Il(this,a.lastInput.documentPoint),this.isActive){var E=x?this.copiedParts.Lf():this.draggedParts.Lf();this.copiedParts=null,y&&af(this),a.Ya(),sd(a,this.draggedParts),this.transactionResult=x?"Copy":"Move",a.R(x?"SelectionCopied":"SelectionMoved",E)}this.stopTool(),x&&a.R("ChangedSelection",a.selection)}}},jo.prototype.simulatedMouseMove=function(a,y,x){if(Ta===null)return!1;var E=Ta.diagram;x instanceof ke||(x=null);var b=Cn;return x!==b&&(b!==null&&b!==E&&(b.ug(),Ta.isDragOutStarted=!1,b=b.toolManager.findTool("Dragging"),b!==null&&b.doSimulatedDragLeave()),Cn=x,x!==null&&x!==E&&(Ph(),b=x.toolManager.findTool("Dragging"),b!==null&&(vs.contains(b)||vs.add(b),b.doSimulatedDragEnter())),this.doUpdateCursor(null)),x===null||x===E||!x.allowDrop||x.isReadOnly||!x.allowInsert?!1:(E=x.toolManager.findTool("Dragging"),E!==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,E.doSimulatedDragOver()),!0)},jo.prototype.simulatedMouseUp=function(a,y,x){if(Ta===null)return!1;var E=Cn,b=Ta.diagram;if(x===null)return Ta.doCancel(),!0;if(x!==E){var z=E.toolManager.findTool("Dragging");if(E!==null&&E!==b&&z!==null)return E.ug(),Ta.isDragOutStarted=!1,z.doSimulatedDragLeave(),!1;Cn=x,E=x.toolManager.findTool("Dragging"),E!==null&&(Ph(),vs.contains(E)||vs.add(E),E.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 At),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=Ta,a!==null&&(x=a.mayCopy(),a.transactionResult=x?"Copy":"Move",a.stopTool()),!0):!1};function af(a){if(a.draggedParts!==null)for(var y=a.draggedParts.iterator;y.next();){var x=y.key;x instanceof $n&&(x=x.containingGroup,x===null||x.placeholder===null||a.draggedParts.contains(x)||x.placeholder.v())}}jo.prototype.mayCopy=function(){if(!this.isCopyEnabled)return!1;var a=this.diagram;if(a.isReadOnly||a.isModelReadOnly||!a.allowInsert||!a.allowCopy||(yr?!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())},jo.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())},jo.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())},jo.prototype.computeBorder=function(a,y,x){return this.Ym||this.draggedParts===null||this.draggedParts.contains(a)?null:x.assign(y)},jo.prototype.Az=function(){return Ta},jo.prototype.mayDragIn=function(){var a=this.diagram;if(!a.allowDrop||a.isReadOnly||a.isModelReadOnly||!a.allowInsert)return!1;var y=Ta;return!(y===null||y.diagram.model.dataFormat!==a.model.dataFormat)},jo.prototype.doSimulatedDragEnter=function(){if(this.mayDragIn()){var a=this.diagram;a.animationManager.Cc(),wl(a),a.animationManager.Cc(),a=Ta,a!==null&&(a.diagram.Ns=!1),this.doUpdateCursor(null)}},jo.prototype.doSimulatedDragLeave=function(){var a=Ta;a!==null&&a.doSimulatedDragOut(),this.doCancel()},jo.prototype.doSimulatedDragOver=function(){var a=this.diagram;a.animationManager.Dm=!0;var y=Ta;if(y!==null&&y.draggedParts!==null){if(!this.mayDragIn())return;sf(this,y.draggedParts.Lf(),!1,a.firstInput),Ca(this,this.copiedParts,!1),$a(this,a.lastInput.documentPoint)}a.animationManager.Dm=!1},jo.prototype.doSimulatedDrop=function(){var a=this.diagram,y=Ta;if(y!==null){var x=y.diagram;if(y.Ym=!0,Mo(this),!this.mayDragIn())return;a.animationManager.Dm=!0,a.R("ChangingSelection",a.selection),this.Ea("Drop"),sf(this,y.draggedParts.Lf(),!0,a.lastInput),Ca(this,this.copiedParts,!1);var E=new pn;this.copiedParts!==null&&(a.clearSelection(!0),this.copiedParts.iteratorKeys.each(function(b){b.isSelected=!0,E.add(b)})),Il(this,a.lastInput.documentPoint),a.Ya(),this.copiedParts!==null&&(this.transactionResult="ExternalCopy"),this.copiedParts=null,a.doFocus(),a.R("ExternalObjectsDropped",E,x),this.stopTransaction(),a.R("ChangedSelection",a.selection)}a.animationManager.Dm=!1};function sf(a,y,x,E){if(a.copiedParts===null){var b=a.diagram;if(!b.isReadOnly&&!b.isModelReadOnly){b.skipsUndoManager=!x,b.partManager.addsToTemporaryLayer=!x,a.startPoint=E.documentPoint,x=b.Kj(y,b,!0);var z=Be.alloc();b=E=1/0;for(var tt=-1/0,rt=-1/0,ot=y.iterator;ot.next();){var lt=ot.value;if(lt.isVisible()){var ut=lt.location;lt=ut.x,ut=ut.y,isNaN(lt)||isNaN(ut)||(lt<E&&(E=lt),ut<b&&(b=ut),lt>tt&&(tt=lt),ut>rt&&(rt=ut))}}for(E===1/0?z.h(0,0,0,0):z.h(E,b,tt-E,rt-b),E=z.x+z.width/2,b=z.y+z.height/2,Be.free(z),z=a.Fr,tt=new be,rt=At.alloc(),ot=y.iterator;ot.next();)lt=ot.value,lt instanceof Nn&<.canCopy()&&(ut=x.I(lt),ut!==null&&(ut.points=lt.points,_h(ut,z.x-E,z.y-b),ut.suspendsRouting=!0,tt.add(ut,a.Pd())));for(y=y.iterator;y.next();)lt=y.value,lt.Zc()&<.canCopy()&&(ot=x.I(lt),ot!==null&&(lt=lt.location,rt.h(z.x-(E-lt.x),z.y-(b-lt.y)),ot.location=rt,ot.Va(),tt.add(ot,a.Pd(rt))));At.free(rt),a.copiedParts=tt,Ol(a,tt.Lf()),a.draggedLink!==null&&(x=a.draggedLink,y=x.routeBounds,_h(x,a.startPoint.x-(y.x+y.width/2),a.startPoint.y-(y.y+y.height/2))),a.doUpdateCursor(null)}}}jo.prototype.doSimulatedDragOut=function(){var a=this.diagram;a.Ns=!1,this.mayCopy()||this.mayMove()?a.currentCursor="":a.currentCursor=this.nodropCursor,this.Bn=null},jo.prototype.computeMove=function(a,y,x,E){return x=this.diagram,x!==null?x.computeMove(a,y,this.dragOptions,E):new At},ye.Object.defineProperties(jo.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}}}),jo.prototype.getDraggingSource=jo.prototype.Az;var Ta=null,Cn=null;jo.className="DraggingTool",vs=new fn,Di("draggingTool",function(){return this.findTool("Dragging")},function(a){this.gb("Dragging",a,this.mouseMoveTools)}),Ar.prototype.doCancel=function(){Ta!==null&&Ta.doCancel(),or.prototype.doCancel.call(this)};function Ni(){or.call(this),this.te=100,this.Ha=!1,this.u="pointer";var a=new Nn,y=new cr;y.isPanelMain=!0,y.stroke="blue",a.add(y),y=new cr,y.toArrow="Standard",y.fill="blue",y.stroke="blue",a.add(y),a.layerName="Tool",this.Ci=a,a=new $n,y=new cr,y.portId="",y.figure="Rectangle",y.fill=null,y.stroke="magenta",y.strokeWidth=2,y.desiredSize=Ui,a.add(y),a.selectable=!1,a.layerName="Tool",this.Bi=a,this.j=y,a=new $n,y=new cr,y.portId="",y.figure="Rectangle",y.fill=null,y.stroke="magenta",y.strokeWidth=2,y.desiredSize=Ui,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 be,this.Of=this.gj=this.Pf=null}Se(Ni,or),Ni.prototype.doStop=function(){this.diagram.ug(),this.originalToPort=this.originalToNode=this.originalFromPort=this.originalFromNode=this.originalLink=null,this.validPortsCache.clear(),this.targetPort=null},Ni.prototype.copyPortProperties=function(a,y,x,E,b){if(a!==null&&y!==null&&x!==null&&E!==null){var z=y.Df(),tt=on.alloc();tt.width=y.naturalBounds.width*z,tt.height=y.naturalBounds.height*z,E.desiredSize=tt,on.free(tt),b?(E.toSpot=y.toSpot,E.toEndSegmentLength=y.toEndSegmentLength):(E.fromSpot=y.fromSpot,E.fromEndSegmentLength=y.fromEndSegmentLength),x.locationSpot=lr,z=At.alloc(),x.location=y.ga(lr,z),At.free(z),E.angle=y.li(),this.portTargeted!==null&&this.portTargeted(a,y,x,E,b)}},Ni.prototype.setNoTargetPortProperties=function(a,y,x){y!==null&&(y.desiredSize=Ui,y.fromSpot=ar,y.toSpot=ar),a!==null&&(a.location=this.diagram.lastInput.documentPoint),this.portTargeted!==null&&this.portTargeted(null,null,a,y,x)},Ni.prototype.doMouseDown=function(){this.isActive&&this.doMouseMove()},Ni.prototype.doMouseMove=function(){if(this.isActive){var a=this.diagram;if(this.targetPort=this.findTargetPort(this.isForwards),this.targetPort!==null&&this.targetPort.part instanceof $n){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)}},Ni.prototype.findValidLinkablePort=function(a,y){if(a===null)return null;var x=a.part;if(!(x instanceof $n))return null;for(;a!==null;){var E=y?a.toLinkable:a.fromLinkable;if(E===!0&&(a.portId!==null||a instanceof $n)&&(y?this.isValidTo(x,a):this.isValidFrom(x,a)))return a;if(E===!1)break;a=a.panel}return null},Ni.prototype.findTargetPort=function(a){var y=this.diagram,x=y.lastInput.documentPoint,E=this.portGravity;0>=E&&(E=.1);var b=this,z=y.og(x,E,function(ft){return b.findValidLinkablePort(ft,a)},null,!0);for(E=1/0,y=null,z=z.iterator;z.next();){var tt=z.value,rt=tt.part;if(rt instanceof $n){var ot=tt.ga(lr,At.alloc()),lt=x.x-ot.x,ut=x.y-ot.y;At.free(ot),ot=lt*lt+ut*ut,ot<E&&(lt=this.validPortsCache.I(tt),lt!==null?lt&&(y=tt,E=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,E=ot):this.validPortsCache.add(tt,!1))}}return y!==null&&(x=y.part,x instanceof $n&&(x.layer===null||x.layer.allowLink))?y:null},Ni.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},Ni.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},Ni.prototype.isInSameNode=function(a,y){return a===null||y===null?!1:a===y?!0:(a=a.part,y=y.part,a!==null&&a===y)},Ni.prototype.isLinked=function(a,y){if(a===null||y===null)return!1;var x=a.part;if(!(x instanceof $n))return!1;a=a.portId,a===null&&(a="");var E=y.part;if(!(E instanceof $n))return!1;for(y=y.portId,y===null&&(y=""),y=E.Sd(y);y.next();)if(E=y.value,E.fromNode===x&&E.fromPortId===a)return!0;return!1},Ni.prototype.isValidLink=function(a,y,x,E){if(!this.isValidFrom(a,y)||!this.isValidTo(x,E)||!(y===null||E===null||(y.fromLinkableSelfNode&&E.toLinkableSelfNode||!this.isInSameNode(y,E))&&(y.fromLinkableDuplicates&&E.toLinkableDuplicates||!this.isLinked(y,E)))||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 b=a.linkValidation;if(b!==null&&!b(a,y,x,E,this.originalLink))return!1}return x!==null&&(b=x.linkValidation,b!==null&&!b(a,y,x,E,this.originalLink))?!1:(b=this.linkValidation,b!==null?b(a,y,x,E,this.originalLink):!0)},Ni.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 E=new pn;return E.add(a),Gr(this,x,y,E)};function Gr(a,y,x,E){if(y===x)return!0;var b=y.fromNode;return b!==null&&b.isLinkLabel&&(E.add(b),Gr(a,b.labeledLink,x,E))?!0:(y=y.toNode,!!(y!==null&&y.isLinkLabel&&(E.add(y),Gr(a,y.labeledLink,x,E))))}Ni.prototype.isValidCycle=function(a,y,x){if(x===void 0&&(x=null),a===null||y===null)return this.isUnconnectedLinkValid;var E=this.diagram.validCycle;if(E!==Nc){if(E===Hg){if(E=x||this.temporaryLink,E!==null&&!E.isTreeLink)return!0;for(E=y.linksConnected;E.next();){var b=E.value;if(b!==x&&b.isTreeLink&&b.toNode===y)return!1}return!ur(this,a,y,x,!0)}if(E===Wg){if(E=x||this.temporaryLink,E!==null&&!E.isTreeLink)return!0;for(E=a.linksConnected;E.next();)if(b=E.value,b!==x&&b.isTreeLink&&b.fromNode===a)return!1;return!ur(this,a,y,x,!0)}if(E===zg)return a===y?a=!0:(E=new pn,E.add(y),a=Pi(this,E,a,y,x)),!a;if(E===Zg)return!ur(this,a,y,x,!1);if(E===Gg)return a===y?a=!0:(E=new pn,E.add(y),a=Io(this,E,a,y,x)),!a}return!0};function ur(a,y,x,E,b){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!==E&&(!b||tt.isTreeLink)&&tt.toNode===y&&(tt=tt.fromNode,tt!==y&&ur(a,tt,x,E,b)))return!0}return!1}function Pi(a,y,x,E,b){if(x===E)return!0;if(x===null||E===null||y.contains(x))return!1;y.add(x);for(var z=x.linksConnected;z.next();){var tt=z.value;if(tt!==b&&tt.toNode===x&&(tt=tt.fromNode,tt!==x&&Pi(a,y,tt,E,b)))return!0}return!1}function Io(a,y,x,E,b){if(x===E)return!0;if(x===null||E===null||y.contains(x))return!1;y.add(x);for(var z=x.linksConnected;z.next();){var tt=z.value;if(tt!==b){var rt=tt.fromNode;if(tt=tt.toNode,rt=rt===x?tt:rt,rt!==x&&Io(a,y,rt,E,b))return!0}}return!1}ye.Object.defineProperties(Ni.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}}}),Ni.className="LinkingBaseTool";function Co(){Ni.call(this),this.name="Linking",this.V={},this.F=null,this.K=ia,this.Xd=null}Se(Co,Ni),Co.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},Co.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 $n)))return null;var x=this.direction;if(x===ia||x===Bo){var E=this.findValidLinkablePort(y,!1);if(E!==null||this.startObject===a&&(E=a.port,this.findValidLinkablePort(E,!1)))return this.isForwards=!0,E}return(x===ia||x===us)&&(y=this.findValidLinkablePort(y,!0),y!==null||this.startObject===a&&(y=a.port,this.findValidLinkablePort(y,!0)))?(this.isForwards=!1,y):null},Co.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 $n&&(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 $n&&(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)},Co.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()},Co.prototype.doStop=function(){Ni.prototype.doStop.call(this),this.startObject=null},Co.prototype.doMouseUp=function(){if(this.isActive){var a=this.diagram,y=this.transactionResult=null,x=null,E=null,b=null,z=null;try{var tt=this.targetPort=this.findTargetPort(this.isForwards);if(tt!==null){var rt=tt.part;rt instanceof $n&&(this.isForwards?(this.originalFromNode!==null&&(y=this.originalFromNode,x=this.originalFromPort),E=rt,b=tt):(y=rt,x=tt,this.originalToNode!==null&&(E=this.originalToNode,b=this.originalToPort)))}else this.isForwards?this.originalFromNode!==null&&this.isUnconnectedLinkValid&&(y=this.originalFromNode,x=this.originalFromPort):this.originalToNode!==null&&this.isUnconnectedLinkValid&&(E=this.originalToNode,b=this.originalToPort);y!==null||E!==null?(z=this.insertLink(y,x,E,b),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,E,b)):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)}}},Co.prototype.isNewTreeLink=function(){var a=this.archetypeLinkData;if(a===null)return!0;if(a instanceof Nn)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)},Co.prototype.insertLink=function(a,y,x,E){return this.diagram.partManager.insertLink(a,y,x,E)},Co.prototype.doNoLink=function(){},ye.Object.defineProperties(Co.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 ia=new rn(Co,"Either",0),Bo=new rn(Co,"ForwardsOnly",0),us=new rn(Co,"BackwardsOnly",0);Co.className="LinkingTool",Co.Either=ia,Co.ForwardsOnly=Bo,Co.BackwardsOnly=us;function Zo(){Ni.call(this),this.name="Relinking";var a=new cr;a.figure="Diamond",a.desiredSize=hr,a.fill="lightblue",a.stroke="dodgerblue",a.cursor=this.linkingCursor,a.segmentIndex=0,this.V=a,a=new cr,a.figure="Diamond",a.desiredSize=hr,a.fill="lightblue",a.stroke="dodgerblue",a.cursor=this.linkingCursor,a.segmentIndex=-1,this.Xd=a,this.F=null,this.Ew=new Be}Se(Zo,Ni),Zo.prototype.updateAdornments=function(a){if(a!==null&&a instanceof Nn){var y="RelinkFrom",x=null;if(a.isSelected&&!this.diagram.isReadOnly){var E=a.selectionObject;E!==null&&a.canRelinkFrom()&&a.actualBounds.w()&&a.isVisible()&&E.actualBounds.w()&&E.Ed()&&(x=a.Pj(y),x===null&&(x=this.makeAdornment(E,!1),a.bh(y,x)))}x===null&&a.Jf(y),y="RelinkTo",x=null,a.isSelected&&!this.diagram.isReadOnly&&(E=a.selectionObject,E!==null&&a.canRelinkTo()&&a.actualBounds.w()&&a.isVisible()&&E.actualBounds.w()&&E.Ed()&&(x=a.Pj(y),x===null?(x=this.makeAdornment(E,!0),a.bh(y,x)):x.v())),x===null&&a.Jf(y)}},Zo.prototype.makeAdornment=function(a,y){var x=new Qr;return x.type=wn.Link,y=y?this.toHandleArchetype:this.fromHandleArchetype,y!==null&&x.add(y.copy()),x.adornedObject=a,x},Zo.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},Zo.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 Qr&&x.adornedPart instanceof Nn))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=ki),this.temporaryFromNode!==null&&(this.temporaryFromNode.location=this.originalLink.i(0))),this.originalLink.toNode===null&&(this.temporaryToPort!==null&&(this.temporaryToPort.desiredSize=ki),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},Zo.prototype.copyLinkProperties=function(a,y){if(a!==null&&y!==null){y.adjusting=a.adjusting,y.corner=a.corner;var x=a.curve;(x===Wf||x===Rh)&&(x=Ls),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}},Zo.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()},Zo.prototype.doStop=function(){Ni.prototype.doStop.call(this),this.handle=null},Zo.prototype.doMouseUp=function(){if(this.isActive){var a=this.diagram;this.transactionResult=null;var y=this.originalFromNode,x=this.originalFromPort,E=this.originalToNode,b=this.originalToPort,z=this.originalLink;try{if(this.targetPort=this.findTargetPort(this.isForwards),this.targetPort!==null){var tt=this.targetPort.part;tt instanceof $n&&(this.isForwards?(E=tt,b=this.targetPort):(y=tt,x=this.targetPort))}else this.isUnconnectedLinkValid?this.isForwards?b=E=null:x=y=null:z=null;z!==null?(this.reconnectLink(z,this.isForwards?E:y,this.isForwards?b: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()}}},Zo.prototype.reconnectLink=function(a,y,x,E){return x=x!==null&&x.portId!==null?x.portId:"",E?(a.toNode=y,a.toPortId=x):(a.fromNode=y,a.fromPortId=x),!0},Zo.prototype.doNoRelink=function(){};function Sl(a,y,x,E,b){y!==null?(a.copyPortProperties(y,x,a.temporaryFromNode,a.temporaryFromPort,!1),a.diagram.add(a.temporaryFromNode)):a.diagram.remove(a.temporaryFromNode),E!==null?(a.copyPortProperties(E,b,a.temporaryToNode,a.temporaryToPort,!0),a.diagram.add(a.temporaryToNode)):a.diagram.remove(a.temporaryToNode)}ye.Object.defineProperties(Zo.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 Qr))throw Error("new handle is not in an Adornment: "+a);this.F=a}}}),Zo.className="RelinkingTool",Di("linkingTool",function(){return this.findTool("Linking")},function(a){this.gb("Linking",a,this.mouseMoveTools)}),Di("relinkingTool",function(){return this.findTool("Relinking")},function(a){this.gb("Relinking",a,this.mouseDownTools)});function Jo(){or.call(this),this.name="LinkReshaping";var a=new cr;a.figure="Rectangle",a.desiredSize=Tr,a.fill="lightblue",a.stroke="dodgerblue",this.o=a,a=new cr,a.figure="Diamond",a.desiredSize=hr,a.fill="lightblue",a.stroke="dodgerblue",a.cursor="move",this.u=a,this.F=3,this.Ts=this.j=null,this.Fw=new At,this.Yq=new fn}Se(Jo,or),Jo.prototype.Ru=function(a){return a&&a.reshapingBehavior.value!==0?a.reshapingBehavior:dl},Jo.prototype.om=function(a,y){a.reshapingBehavior=y},Jo.prototype.updateAdornments=function(a){if(a!==null&&a instanceof Nn){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)}},Jo.prototype.makeAdornment=function(a){var y=a.part,x=y.pointsCount,E=y.isOrthogonal,b=null;if(y.points!==null&&1<x){b=new Qr,b.type=wn.Link,x=y.firstPickIndex;var z=y.lastPickIndex,tt=E?1:0;if(y.resegmentable&&y.computeCurve()!==ml)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,b.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&&E){ot=y.i(x);var lt=y.i(x+1);_t.B(ot.x,lt.x)&&_t.B(ot.y,lt.y)&&(lt=y.i(x-1)),_t.B(ot.x,lt.x)?(this.om(rt,Ha),rt.cursor="n-resize"):_t.B(ot.y,lt.y)&&(this.om(rt,ys),rt.cursor="w-resize")}else tt===z-1&&E?(ot=y.i(z-1),lt=y.i(z),_t.B(ot.x,lt.x)&&_t.B(ot.y,lt.y)&&(ot=y.i(z+1)),_t.B(ot.x,lt.x)?(this.om(rt,Ha),rt.cursor="n-resize"):_t.B(ot.y,lt.y)&&(this.om(rt,ys),rt.cursor="w-resize")):tt!==z&&(this.om(rt,Ql),rt.cursor="move");b.add(rt)}b.adornedObject=a}return b},Jo.prototype.makeHandle=function(){var a=this.handleArchetype;return a===null?null:a.copy()},Jo.prototype.makeResegmentHandle=function(){var a=this.midHandleArchetype;return a===null?null:a.copy()},Jo.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},Jo.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 Nn){if(this.Ts=y,a.isMouseCaptured=!0,this.Ea(this.name),y.resegmentable&&this.handle.fromMaxLinks===999){var x=y.points.copy(),E=this.getResegmentingPoint();if(x.Gb(this.handle.segmentIndex+1,E),y.isOrthogonal&&x.Gb(this.handle.segmentIndex+1,E),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}}},Jo.prototype.doDeactivate=function(){this.stopTransaction(),this.Ts=this.handle=null,this.isActive=this.diagram.isMouseCaptured=!1},Jo.prototype.stopTransaction=function(){var a=this.diagram,y=or.prototype.stopTransaction.call(this);return y&&a.undoManager.transactionToUndo!==null&&a.undoManager.transactionToUndo.ak(),y},Jo.prototype.doCancel=function(){var a=this.adornedLink;a!==null&&(a.points=this.Yq),this.stopTool()},Jo.prototype.getResegmentingPoint=function(){return this.handle.ga(lr)},Jo.prototype.doMouseMove=function(){var a=this.diagram;this.isActive&&(a=this.computeReshape(a.lastInput.documentPoint),this.reshape(a))},Jo.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,E=y.i(x-1),b=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(E.x-b.x)<this.resegmentingDistance&&Math.abs(E.y-b.y)<this.resegmentingDistance&&(Wr(this,tt,E,b,z,!0)||Wr(this,tt,E,b,z,!1))){var rt=y.points.copy();Wr(this,tt,E,b,z,!0)?(rt.cd(x-2,new At(tt.x,(z.y+tt.y)/2)),rt.cd(x+1,new At(z.x,(z.y+tt.y)/2))):(rt.cd(x-2,new At((z.x+tt.x)/2,tt.y)),rt.cd(x+1,new At((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(b.x-z.x)<this.resegmentingDistance&&Math.abs(b.y-z.y)<this.resegmentingDistance&&(Wr(this,E,b,z,tt,!0)||Wr(this,E,b,z,tt,!1))&&(rt=y.points.copy(),Wr(this,E,b,z,tt,!0)?(rt.cd(x-1,new At(E.x,(E.y+tt.y)/2)),rt.cd(x+2,new At(tt.x,(E.y+tt.y)/2))):(rt.cd(x-1,new At((E.x+tt.x)/2,E.y)),rt.cd(x+2,new At((E.x+tt.x)/2,tt.y))),rt.mb(x+1),rt.mb(x),y.points=rt,y.Wb())}}else tt=At.alloc(),_t.qh(E.x,E.y,z.x,z.y,b.x,b.y,tt)&&tt.Bf(b)<this.resegmentingDistance*this.resegmentingDistance&&(E=y.points.copy(),E.mb(x),y.points=E,y.Wb()),At.free(tt)}a.Ya(),this.transactionResult=this.name,a.R("LinkReshaped",this.adornedLink,this.Yq)}this.stopTool()};function Wr(a,y,x,E,b,z){return z?Math.abs(y.y-x.y)<a.resegmentingDistance&&Math.abs(x.y-E.y)<a.resegmentingDistance&&Math.abs(E.y-b.y)<a.resegmentingDistance:Math.abs(y.x-x.x)<a.resegmentingDistance&&Math.abs(x.x-E.x)<a.resegmentingDistance&&Math.abs(E.x-b.x)<a.resegmentingDistance}Jo.prototype.reshape=function(a){var y=this.adornedLink;y.uh();var x=this.handle.segmentIndex,E=this.Ru(this.handle);if(y.isOrthogonal)if(x===y.firstPickIndex+1)x=y.firstPickIndex+1,E===Ha?(y.L(x,y.i(x-1).x,a.y),y.L(x+1,y.i(x+2).x,a.y)):E===ys&&(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,E===Ha?(y.L(x-1,y.i(x-2).x,a.y),y.L(x,y.i(x+1).x,a.y)):E===ys&&(y.L(x-1,a.x,y.i(x-2).y),y.L(x,a.x,y.i(x+1).y));else{E=x;var b=y.i(E),z=y.i(E-1),tt=y.i(E+1);_t.B(z.x,b.x)&&_t.B(b.y,tt.y)?(_t.B(z.x,y.i(E-2).x)&&!_t.B(z.y,y.i(E-2).y)?(y.m(E,a.x,z.y),x++,E++):y.L(E-1,a.x,z.y),_t.B(tt.y,y.i(E+2).y)&&!_t.B(tt.x,y.i(E+2).x)?y.m(E+1,tt.x,a.y):y.L(E+1,tt.x,a.y)):_t.B(z.y,b.y)&&_t.B(b.x,tt.x)?(_t.B(z.y,y.i(E-2).y)&&!_t.B(z.x,y.i(E-2).x)?(y.m(E,z.x,a.y),x++,E++):y.L(E-1,z.x,a.y),_t.B(tt.x,y.i(E+2).x)&&!_t.B(tt.y,y.i(E+2).y)?y.m(E+1,a.x,tt.y):y.L(E+1,a.x,tt.y)):_t.B(z.x,b.x)&&_t.B(b.x,tt.x)?(_t.B(z.x,y.i(E-2).x)&&!_t.B(z.y,y.i(E-2).y)?(y.m(E,a.x,z.y),x++,E++):y.L(E-1,a.x,z.y),_t.B(tt.x,y.i(E+2).x)&&!_t.B(tt.y,y.i(E+2).y)?y.m(E+1,a.x,tt.y):y.L(E+1,a.x,tt.y)):_t.B(z.y,b.y)&&_t.B(b.y,tt.y)&&(_t.B(z.y,y.i(E-2).y)&&!_t.B(z.x,y.i(E-2).x)?(y.m(E,z.x,a.y),x++,E++):y.L(E-1,z.x,a.y),_t.B(tt.y,y.i(E+2).y)&&!_t.B(tt.x,y.i(E+2).x)?y.m(E+1,tt.x,a.y):y.L(E+1,tt.x,a.y)),y.L(x,a.x,a.y)}else y.L(x,a.x,a.y),E=y.fromNode,b=y.fromPort,E!==null&&(z=E.findVisibleNode(),z!==null&&z!==E&&(E=z,b=E.port)),x===1&&y.computeSpot(!0,b).Mc()&&(z=b.ga(lr,At.alloc()),E=y.getLinkPointFromPoint(E,b,z,a,!0,At.alloc()),y.L(0,E.x,E.y),At.free(z),At.free(E)),E=y.toNode,b=y.toPort,E!==null&&(z=E.findVisibleNode(),z!==null&&z!==E&&(E=z,b=E.port)),x===y.pointsCount-2&&y.computeSpot(!1,b).Mc()&&(x=b.ga(lr,At.alloc()),a=y.getLinkPointFromPoint(E,b,x,a,!1,At.alloc()),y.L(y.pointsCount-1,a.x,a.y),At.free(x),At.free(a));y.zf()},Jo.prototype.computeReshape=function(a){var y=this.adornedLink,x=this.handle.segmentIndex;switch(this.Ru(this.handle)){case Ql:return a;case Ha:return new At(y.i(x).x,a.y);case ys:return new At(a.x,y.i(x).y);default:case dl:return y.i(x)}},ye.Object.defineProperties(Jo.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 Qr))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}}}),Jo.prototype.setReshapingBehavior=Jo.prototype.om,Jo.prototype.getReshapingBehavior=Jo.prototype.Ru;var dl=new rn(Jo,"None",0),ys=new rn(Jo,"Horizontal",1),Ha=new rn(Jo,"Vertical",2),Ql=new rn(Jo,"All",3);Jo.className="LinkReshapingTool",Jo.None=dl,Jo.Horizontal=ys,Jo.Vertical=Ha,Jo.All=Ql,Di("linkReshapingTool",function(){return this.findTool("LinkReshaping")},function(a){this.gb("LinkReshaping",a,this.mouseDownTools)});function Da(){or.call(this),this.name="Resizing",this.o=new on(1,1).freeze(),this.j=new on(9999,9999).freeze(),this.yg=new on(NaN,NaN).freeze(),this.V=!1,this.ia=!0,this.ue=null;var a=new cr;a.alignmentFocus=lr,a.figure="Rectangle",a.desiredSize=Tr,a.fill="lightblue",a.stroke="dodgerblue",a.strokeWidth=1,a.cursor="pointer",this.F=a,this.u=null,this.Xq=new At,this.Dw=new on,this.Tn=new At,this.rt=new on(0,0),this.qt=new on(1/0,1/0),this.pt=new on(1,1)}Se(Da,or),Da.prototype.updateAdornments=function(a){if(!(a===null||a instanceof Nn)){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(),fd(a)&&this.updateResizeHandles(x,y),a.bh(this.name,x);return}}a.Jf(this.name)}},Da.prototype.makeAdornment=function(a){var y=a.part.resizeAdornmentTemplate;if(y===null){y=new Qr,y.type=wn.Spot,y.locationSpot=lr;var x=new Es;x.isPanelMain=!0,y.add(x),y.add(this.makeHandle(a,_r)),y.add(this.makeHandle(a,fo)),y.add(this.makeHandle(a,lo)),y.add(this.makeHandle(a,fa)),y.add(this.makeHandle(a,Ja)),y.add(this.makeHandle(a,Ba)),y.add(this.makeHandle(a,Ga)),y.add(this.makeHandle(a,Qa))}else if(Zl(y),y=y.copy(),y===null)return null;return y.adornedObject=a,y},Da.prototype.makeHandle=function(a,y){return a=this.handleArchetype,a===null?null:(a=a.copy(),a.alignment=y,a)},Da.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=lr),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 wn)for(a=a.elements;a.next();)this.updateResizeHandles(a.value,y)}},Da.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},Da.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))},Da.prototype.doDeactivate=function(){var a=this.diagram;this.stopTransaction(),this.ue=this.handle=null,this.isActive=a.isMouseCaptured=!1},Da.prototype.stopTransaction=function(){var a=this.diagram,y=or.prototype.stopTransaction.call(this);return y&&a.undoManager.transactionToUndo!==null&&a.undoManager.transactionToUndo.ak(),y},Da.prototype.doCancel=function(){this.adornedObject!==null&&(this.adornedObject.desiredSize=this.originalDesiredSize,this.adornedObject.part.location=this.originalLocation),this.stopTool()},Da.prototype.doMouseMove=function(){var a=this.diagram;if(this.isActive){var y=this.rt,x=this.qt,E=this.pt,b=this.adornedObject.qs(a.lastInput.documentPoint,At.alloc()),z=this.computeReshape();y=this.computeResize(b,this.handle.alignment,y,x,E,z),this.resize(y),a.bd(),At.free(b)}},Da.prototype.doMouseUp=function(){var a=this.diagram;if(this.isActive){var y=this.rt,x=this.qt,E=this.pt,b=this.adornedObject.qs(a.lastInput.documentPoint,At.alloc()),z=this.computeReshape();y=this.computeResize(b,this.handle.alignment,y,x,E,z),this.resize(y),At.free(b),a.Ya(),this.transactionResult=this.name,a.R("PartResized",this.adornedObject,this.originalDesiredSize)}this.stopTool()},Da.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 er){var E=new fn;if(E.add(a),!this.dragsMembers&&a.placeholder===null){var b=new at;b.dragsMembers=!1}y.moveParts(E,this.oppositePoint.copy().re(x),!0,b)}else a.location=a.location.copy().re(x).add(this.oppositePoint);y.bd()}},Da.prototype.computeResize=function(a,y,x,E,b,z){y.Mc()&&(y=lr);var tt=this.adornedObject.naturalBounds,rt=tt.x,ot=tt.y,lt=tt.x+tt.width,ut=tt.y+tt.height,ft=1;if(!z){ft=tt.width;var yt=tt.height;0>=ft&&(ft=1),0>=yt&&(yt=1),ft=yt/ft}return yt=At.alloc(),_t.No(a.x,a.y,rt,ot,b.width,b.height,yt),a=tt.copy(),0>=y.x?0>=y.y?(a.x=Math.max(yt.x,lt-E.width),a.x=Math.min(a.x,lt-x.width),a.width=Math.max(lt-a.x,x.width),a.y=Math.max(yt.y,ut-E.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(ft*a.width,E.height),x.height),a.width=a.height/ft):(a.width=Math.max(Math.min(a.height/ft,E.width),x.width),a.height=ft*a.width),a.x=lt-a.width,a.y=ut-a.height)):1<=y.y?(a.x=Math.max(yt.x,lt-E.width),a.x=Math.min(a.x,lt-x.width),a.width=Math.max(lt-a.x,x.width),a.height=Math.max(Math.min(yt.y-ot,E.height),x.height),z||(1<=a.height/a.width?(a.height=Math.max(Math.min(ft*a.width,E.height),x.height),a.width=a.height/ft):(a.width=Math.max(Math.min(a.height/ft,E.width),x.width),a.height=ft*a.width),a.x=lt-a.width)):(a.x=Math.max(yt.x,lt-E.width),a.x=Math.min(a.x,lt-x.width),a.width=lt-a.x,z||(a.height=Math.max(Math.min(ft*a.width,E.height),x.height),a.width=a.height/ft,a.y=ot+.5*(ut-ot-a.height))):1<=y.x?0>=y.y?(a.width=Math.max(Math.min(yt.x-rt,E.width),x.width),a.y=Math.max(yt.y,ut-E.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(ft*a.width,E.height),x.height),a.width=a.height/ft):(a.width=Math.max(Math.min(a.height/ft,E.width),x.width),a.height=ft*a.width),a.y=ut-a.height)):1<=y.y?(a.width=Math.max(Math.min(yt.x-rt,E.width),x.width),a.height=Math.max(Math.min(yt.y-ot,E.height),x.height),z||(1<=a.height/a.width?(a.height=Math.max(Math.min(ft*a.width,E.height),x.height),a.width=a.height/ft):(a.width=Math.max(Math.min(a.height/ft,E.width),x.width),a.height=ft*a.width))):(a.width=Math.max(Math.min(yt.x-rt,E.width),x.width),z||(a.height=Math.max(Math.min(ft*a.width,E.height),x.height),a.width=a.height/ft,a.y=ot+.5*(ut-ot-a.height))):0>=y.y?(a.y=Math.max(yt.y,ut-E.height),a.y=Math.min(a.y,ut-x.height),a.height=ut-a.y,z||(a.width=Math.max(Math.min(a.height/ft,E.width),x.width),a.height=ft*a.width,a.x=rt+.5*(lt-rt-a.width))):1<=y.y&&(a.height=Math.max(Math.min(yt.y-ot,E.height),x.height),z||(a.width=Math.max(Math.min(a.height/ft,E.width),x.width),a.height=ft*a.width,a.x=rt+.5*(lt-rt-a.width))),At.free(yt),a},Da.prototype.computeReshape=function(){var a=hn;return this.adornedObject instanceof cr&&(a=Ev(this.adornedObject)),!(a===xi||this.diagram.lastInput.shift)},Da.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},Da.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},Da.prototype.computeCellSize=function(){var a=new on(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},ye.Object.defineProperties(Da.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 Qr))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 Qr)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}}}),Da.className="ResizingTool",Di("resizingTool",function(){return this.findTool("Resizing")},function(a){this.gb("Resizing",a,this.mouseDownTools)});function Wa(){or.call(this),this.name="Rotating",this.ia=45,this.V=2,this.Tn=new At,this.ue=null;var a=new cr;a.figure="Ellipse",a.desiredSize=hr,a.fill="lightblue",a.stroke="dodgerblue",a.strokeWidth=1,a.cursor="pointer",this.o=a,this.j=null,this.Cw=0,this.kr=new At(NaN,NaN),this.u=0,this.F=50}Se(Wa,or),Wa.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)}},Wa.prototype.makeAdornment=function(a){var y=a.part.rotateAdornmentTemplate;if(y===null){y=new Qr,y.type=wn.Position,y.locationSpot=lr;var x=this.handleArchetype;x!==null&&y.add(x.copy())}else if(Zl(y),y=y.copy(),y===null)return null;return y.adornedObject=a,y},Wa.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},Wa.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)},Wa.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(lr)},Wa.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 E=this.handleDistance;return x===0?y.x=a.naturalBounds.width+E:x===45?(y.x=a.naturalBounds.width+E,y.y=a.naturalBounds.height+E):x===90?y.y=a.naturalBounds.height+E:x===135?(y.x=-E,y.y=a.naturalBounds.height+E):x===180?y.x=-E:x===225?(y.x=-E,y.y=-E):x===270?y.y=-E:x===315&&(y.x=a.naturalBounds.width+E,y.y=-E),a.ga(y)},Wa.prototype.doDeactivate=function(){var a=this.diagram;this.stopTransaction(),this.ue=this.handle=null,this.kr=new At(NaN,NaN),this.isActive=a.isMouseCaptured=!1},Wa.prototype.stopTransaction=function(){var a=this.diagram,y=or.prototype.stopTransaction.call(this);return y&&a.undoManager.transactionToUndo!==null&&a.undoManager.transactionToUndo.ak(),y},Wa.prototype.doCancel=function(){this.diagram.delaysLayout=!1,this.rotate(this.originalAngle),this.stopTool()},Wa.prototype.doMouseMove=function(){var a=this.diagram;this.isActive&&(a=this.computeRotate(a.lastInput.documentPoint),this.rotate(a))},Wa.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()},Wa.prototype.rotate=function(a){var y=this.adornedObject;if(y!==null){y.angle=a,y=y.part,y.Va();var x=y.locationObject,E=y.rotateObject;(x===E||x.rg(E))&&(x=this.Tn.copy(),y.location=x.re(this.rotationPoint).rotate(a-this.originalAngle).add(this.rotationPoint)),this.diagram.bd()}},Wa.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},ye.Object.defineProperties(Wa.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 Qr))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 Qr)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}}}),Wa.className="RotatingTool",Di("rotatingTool",function(){return this.findTool("Rotating")},function(a){this.gb("Rotating",a,this.mouseDownTools)});function $s(){or.call(this),this.name="ClickSelecting"}Se($s,or),$s.prototype.canStart=function(){return!(!this.isEnabled||this.isBeyondDragSize())},$s.prototype.doMouseUp=function(){this.isActive&&(this.standardMouseSelect(),!this.standardMouseClick()&&this.diagram.lastInput.isTouchEvent&&this.diagram.toolManager.doToolTip()),this.stopTool()},$s.className="ClickSelectingTool";function Ss(){or.call(this),this.name="Action",this.pk=null}Se(Ss,or),Ss.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.diagram,y=a.lastInput,x=a.ic(y.documentPoint,function(E){for(;E.panel!==null&&!E.isActionable;)E=E.panel;return E});return x!==null&&x.isActionable?(this.pk=x,a.Ck=a.ic(y.documentPoint,null,null),!0):!1},Ss.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()},Ss.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))}},Ss.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()},Ss.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())},Ss.prototype.doStop=function(){this.pk=null},Ss.className="ActionTool";function wh(){or.call(this),this.name="ClickCreating",this.Ri=null,this.o=!0,this.j=!1,this.mw=new At(0,0)}Se(wh,or),wh.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)},wh.prototype.doMouseUp=function(){var a=this.diagram;this.isActive&&this.insertPart(a.lastInput.documentPoint),this.stopTool()},wh.prototype.insertPart=function(a){var y=this.diagram,x=this.archetypeNodeData;if(x===null)return null;var E=null;try{if(y.R("ChangingSelection",y.selection),this.Ea(this.name),x instanceof Bi)x.Zc()&&(Zl(x),E=x.copy(),E!==null&&y.add(E));else if(x!==null){var b=y.model.copyNodeData(x);Ie(b)&&(y.model.xf(b),E=y.Lc(b))}if(E!==null){var z=At.allocAt(a.x,a.y);this.isGridSnapEnabled&&Sf(this.diagram,E,a,z),E.location=z,y.allowSelect&&(y.clearSelection(!0),E.isSelected=!0),At.free(z)}y.Ya(),this.transactionResult=this.name,y.R("PartCreated",E)}finally{this.stopTransaction(),y.R("ChangedSelection",y.selection)}return E},ye.Object.defineProperties(wh.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}}}),wh.className="ClickCreatingTool";function xl(){or.call(this),this.name="DragSelecting",this.Ik=175,this.o=!1;var a=new Bi;a.layerName="Tool",a.selectable=!1;var y=new cr;y.name="SHAPE",y.figure="Rectangle",y.fill=null,y.stroke="magenta",a.add(y),this.j=a}Se(xl,or),xl.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))},xl.prototype.doActivate=function(){var a=this.diagram;this.isActive=!0,a.isMouseCaptured=!0,a.skipsUndoManager=!0,a.add(this.box),this.doMouseMove()},xl.prototype.doDeactivate=function(){var a=this.diagram;a.ug(),a.remove(this.box),a.skipsUndoManager=!1,this.isActive=a.isMouseCaptured=!1},xl.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 E=on.alloc().h(y.width,y.height);x.desiredSize=E,this.box.mm(y.x,y.y,!1),on.free(E),(a.allowHorizontalScroll||a.allowVerticalScroll)&&a.gs(a.lastInput.viewPoint)}},xl.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()},xl.prototype.computeBoxBounds=function(){var a=this.diagram;return new Be(a.firstInput.documentPoint,a.lastInput.documentPoint)},xl.prototype.selectInRect=function(a){var y=this.diagram,x=y.lastInput;if(a=y.ux(a,this.isPartialInclusion),yr?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 fn,y=y.selection.iterator;y.next();){var E=y.value;a.contains(E)||x.add(E)}for(y=x.iterator;y.next();)y.value.isSelected=!1;for(a=a.iterator;a.next();)y=a.value,y.isSelected||(y.isSelected=!0)}},ye.Object.defineProperties(xl.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}}}),xl.className="DragSelectingTool";function qa(){or.call(this),this.name="Panning",this.Xt=new At,this.xy=new At,this.xg=!1;var a=this;this.Kw=function(){var y=a.diagram;y!==null&&y.removeEventListener(Je.document,"scroll",a.Kw,!1),a.stopTool()}}Se(qa,or),qa.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())},qa.prototype.doActivate=function(){var a=this.diagram;this.xg?(a.lastInput.bubbles=!0,a.addEventListener(Je.document,"scroll",this.Kw,!1)):(a.currentCursor="move",a.isMouseCaptured=!0,this.Xt.assign(a.position)),this.isActive=!0},qa.prototype.doDeactivate=function(){var a=this.diagram;a.currentCursor="",this.isActive=a.isMouseCaptured=!1},qa.prototype.doCancel=function(){var a=this.diagram;a.position=this.Xt,a.isMouseCaptured=!1,this.stopTool()},qa.prototype.doMouseMove=function(){this.move()},qa.prototype.doMouseUp=function(){this.move(),this.stopTool()},qa.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,E=a.lastInput.documentPoint,b=y.x+x.x-E.x;x=y.y+x.y-E.y,a.allowHorizontalScroll||(b=y.x),a.allowVerticalScroll||(x=y.y),a.position=this.xy.h(b,x)}},ye.Object.defineProperties(qa.prototype,{bubbles:{get:function(){return this.xg},set:function(a){this.xg=a}},originalPosition:{get:function(){return this.Xt}}}),qa.className="PanningTool",Di("clickCreatingTool",function(){return this.findTool("ClickCreating")},function(a){this.gb("ClickCreating",a,this.mouseUpTools)}),Di("clickSelectingTool",function(){return this.findTool("ClickSelecting")},function(a){this.gb("ClickSelecting",a,this.mouseUpTools)}),Di("panningTool",function(){return this.findTool("Panning")},function(a){this.gb("Panning",a,this.mouseMoveTools)}),Di("dragSelectingTool",function(){return this.findTool("DragSelecting")},function(a){this.gb("DragSelecting",a,this.mouseMoveTools)}),Di("actionTool",function(){return this.findTool("Action")},function(a){this.gb("Action",a,this.mouseDownTools)});function Mu(){this.F=this.u=this.j=this.o=null}ye.Object.defineProperties(Mu.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}}}),Mu.className="HTMLInfo";function _l(a,y,x){this.text=a,this.hx=y,this.visible=x}_l.className="ContextMenuButtonInfo";function xs(){or.call(this),this.name="ContextMenu",this.o=this.ht=this.j=null,this.yw=new At,this.jt=null,this.Et=!1;var a=this;this.tu=function(){a.stopTool()}}Se(xs,or);function $l(a){var y=new Mu;y.show=function(b,z,tt){tt.showDefaultContextMenu()},y.hide=function(b,z){z.hideDefaultContextMenu()},$h=y,a.tu=function(){a.stopTool()},y=Xi("div");var x=Xi("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 E=Xi("style");Je.document.getElementsByTagName("head")[0].appendChild(E),E.sheet.insertRule(".goCXul { list-style: none; }",0),E.sheet.insertRule(".goCXli {font:700 1.5em Helvetica, Arial, sans-serif;position: relative;min-width: 60px; }",0),E.sheet.insertRule(".goCXa {color: #444;display: inline-block;padding: 4px;text-decoration: none;margin: 2px;border: 1px solid gray;border-radius: 10px; }",0),E=a.diagram,E!==null&&(E.addEventListener(y,"contextmenu",ua,!1),E.addEventListener(y,"selectstart",ua,!1),E.addEventListener(x,"contextmenu",ua,!1)),y.className="goCXforeground",x.className="goCXbackground",Je.document.body&&(Je.document.body.appendChild(y),Je.document.body.appendChild(x)),gc=y,Td=x,fc=!0}function ua(a){return a.preventDefault(),!1}xs.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)},xs.prototype.doStart=function(){this.yw.set(this.diagram.firstInput.documentPoint)},xs.prototype.doStop=function(){this.hideContextMenu(),this.currentObject=null},xs.prototype.findObjectWithContextMenu=function(a){a===void 0&&(a=null);var y=this.diagram,x=y.lastInput,E=null;if(a instanceof ke||(a instanceof ge?E=a:E=y.ic(x.documentPoint,null,function(b){return!b.layer.isTemporary})),E!==null){for(a=E;a!==null;){if(a.contextMenu!==null)return a;a=a.panel}if(y.lastInput.isTouchEvent&&this.defaultTouchContextMenu)return E.part}else if(y.contextMenu!==null)return y;return null},xs.prototype.doActivate=function(){},xs.prototype.doMouseDown=function(){if(or.prototype.doMouseDown.call(this),this.isActive&&this.currentContextMenu instanceof Qr){var a=this.diagram.toolManager.findTool("Action");a!==null&&a.canStart()&&(a.doActivate(),a.doMouseDown(),a.doDeactivate())}this.diagram.toolManager.mouseDownTools.contains(this)&&gu(this)},xs.prototype.doMouseUp=function(){if(this.isActive&&this.currentContextMenu instanceof Qr){var a=this.diagram.toolManager.findTool("Action");a!==null&&a.canStart()&&(a.doActivate(),a.doCancel(),a.doDeactivate())}gu(this)};function gu(a){var y=a.diagram;if(a.isActive){var x=a.currentContextMenu;if(x!==null){var E=null;x instanceof Mu||(E=y.ic(y.lastInput.documentPoint,null,null),E!==null&&E.rg(x)&&a.standardMouseClick(null,null)),a.maybeStopTool(E)}}else a.canStart()&&(rh(a,!0),a.isActive||a.stopTool())}xs.prototype.maybeStopTool=function(){this.stopTool(),this.canStart()&&(this.diagram.currentTool=this,this.doMouseUp())};function rh(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=$h,x===null&&(x=a.findObjectWithContextMenu()),x!==null){var E=x.contextMenu;E!==null?(a.currentObject=x instanceof ge?x:null,a.showContextMenu(E,a.currentObject)):y!==null&&a.showContextMenu(y,a.currentObject)}else y!==null&&a.showContextMenu(y,null);a.currentContextMenu instanceof Qr&&!a.currentContextMenu.visible&&a.stopTool()}}xs.prototype.doMouseMove=function(){var a=this.diagram.toolManager.findTool("Action");a!==null&&a.doMouseMove(),this.isActive&&this.diagram.toolManager.doMouseMove()},xs.prototype.showContextMenu=function(a,y){var x=this.diagram;if(a!==this.currentContextMenu&&this.hideContextMenu(),a instanceof Qr){a.layerName="Tool",a.selectable=!1,a.scale=1/x.scale,a.category=this.name,a.placeholder!==null&&(a.placeholder.scale=x.scale);var E=a.diagram;E!==null&&E!==x&&E.remove(a),x.add(a),y!==null?a.adornedObject=y:a.data=x.model,a.Va(),this.positionContextMenu(a,y)}else a instanceof Mu&&a.show(y,x,this);this.currentContextMenu=a},xs.prototype.positionContextMenu=function(a){if(a.placeholder===null){var y=this.diagram,x=y.lastInput.documentPoint.copy(),E=a.measuredBounds,b=y.viewportBounds;y.lastInput.isTouchEvent&&(x.x-=E.width),x.x+E.width>b.right&&(x.x-=E.width+5/y.scale),x.x<b.x&&(x.x=b.x),x.y+E.height>b.bottom&&(x.y-=E.height+5/y.scale),x.y<b.y&&(x.y=b.y),a.position=x}},xs.prototype.hideContextMenu=function(){var a=this.diagram,y=this.currentContextMenu;y!==null&&(y instanceof Qr?(a.remove(y),this.ht!==null&&this.ht.Jf(y.category),y.data=null,y.adornedObject=null):y instanceof Mu&&(y.hide!==null?y.hide(a,this):y.mainElement!==null&&(y.mainElement.style.display="none")),this.currentContextMenu=null,this.standardMouseOver())};function Ch(a){var y=new fn;return y.add(new _l("Copy",function(x){x.commandHandler.copySelection()},function(x){return x.commandHandler.canCopySelection()})),y.add(new _l("Cut",function(x){x.commandHandler.cutSelection()},function(x){return x.commandHandler.canCutSelection()})),y.add(new _l("Delete",function(x){x.commandHandler.deleteSelection()},function(x){return x.commandHandler.canDeleteSelection()})),y.add(new _l("Paste",function(x){x.commandHandler.pasteSelection(a.mouseDownPoint)},function(x){return x.commandHandler.canPasteSelection(a.mouseDownPoint)})),y.add(new _l("Select All",function(x){x.commandHandler.selectAll()},function(x){return x.commandHandler.canSelectAll()})),y.add(new _l("Undo",function(x){x.commandHandler.undo()},function(x){return x.commandHandler.canUndo()})),y.add(new _l("Redo",function(x){x.commandHandler.redo()},function(x){return x.commandHandler.canRedo()})),y.add(new _l("Scroll To Part",function(x){x.commandHandler.scrollToPart()},function(x){return x.commandHandler.canScrollToPart()})),y.add(new _l("Zoom To Fit",function(x){x.commandHandler.zoomToFit()},function(x){return x.commandHandler.canZoomToFit()})),y.add(new _l("Reset Zoom",function(x){x.commandHandler.resetZoom()},function(x){return x.commandHandler.canResetZoom()})),y.add(new _l("Group Selection",function(x){x.commandHandler.groupSelection()},function(x){return x.commandHandler.canGroupSelection()})),y.add(new _l("Ungroup Selection",function(x){x.commandHandler.ungroupSelection()},function(x){return x.commandHandler.canUngroupSelection()})),y.add(new _l("Edit Text",function(x){x.commandHandler.editTextBlock()},function(x){return x.commandHandler.canEditTextBlock()})),y}xs.prototype.showDefaultContextMenu=function(){var a=this.diagram;this.jt===null&&(this.jt=Ch(this)),gc.innerHTML="",Td.addEventListener("pointerdown",this.tu,!1);var y=this,x=Xi("ul");x.className="goCXul",gc.appendChild(x),x.innerHTML="";for(var E=this.jt.iterator;E.next();){var b=E.value,z=b.visible;if(typeof b.hx=="function"&&(typeof z!="function"||z(a))){z=Xi("li"),z.className="goCXli";var tt=Xi("a");tt.className="goCXa",tt.href="#",tt.ky=b.hx,tt.addEventListener("pointerdown",function(rt){return this.ky(a),y.stopTool(),rt.preventDefault(),!1},!1),tt.textContent=b.text,z.appendChild(tt),x.appendChild(z)}}gc.style.display="block",Td.style.display="block"},xs.prototype.hideDefaultContextMenu=function(){if(this.currentContextMenu!==null&&this.currentContextMenu===$h){gc.style.display="none",Td.style.display="none";var a=this.diagram;a!==null&&a.removeEventListener(Td,"pointerdown",this.tu,!1),this.currentContextMenu=null}},ye.Object.defineProperties(xs.prototype,{currentContextMenu:{get:function(){return this.j},set:function(a){this.j=a,this.ht=a instanceof Qr?a.adornedPart:null}},defaultTouchContextMenu:{get:function(){return fc===!1&&$h===null&&$o&&$l(this),$h},set:function(a){a===null&&(fc=!0),$h=a}},currentObject:{get:function(){return this.o},set:function(a){this.o=a}},mouseDownPoint:{get:function(){return this.yw}}});var $h=null,fc=!1,Td=null,gc=null;xs.className="ContextMenuTool",Di("contextMenuTool",function(){return this.findTool("ContextMenu")},function(a){this.gb("ContextMenu",a,this.mouseUpTools)});function Go(){or.call(this),this.name="TextEditing",this.Zh=new Ao,this.ia=null,this.V=Dd,this.vj=null,this.qa=Od,this.u=1,this.F=!0,this.o=null,this.j=new Mu,this.kt=null,pc(this,this.j)}Se(Go,or);function pc(a,y){if($o){var x=Xi("textarea");a.kt=x,x.addEventListener("input",function(){if(a.textBlock!==null){var E=a.Lx(this.value);this.style.width=20+E.measuredBounds.width*this.wA+"px",this.rows=E.lineCount}},!1),x.addEventListener("keydown",function(E){if(!E.isComposing&&a.textBlock!==null){var b=E.key;b==="Enter"?(a.textBlock.isMultiline===!1&&E.preventDefault(),a.acceptText(mc)):b==="Tab"?(a.acceptText(uf),E.preventDefault()):b==="Escape"&&(a.doCancel(),a.diagram!==null&&a.diagram.doFocus())}},!1),x.addEventListener("focus",function(){if(a.currentTextEditor!==null&&a.state!==Od){var E=a.kt;a.qa===vc&&(a.qa=yc),typeof E.select=="function"&&a.selectsTextOnActivate&&(E.select(),E.setSelectionRange(0,9999))}},!1),x.addEventListener("blur",function(){if(a.currentTextEditor!==null&&a.state!==Od){var E=a.kt;typeof E.focus=="function"&&E.focus(),typeof E.select=="function"&&a.selectsTextOnActivate&&(E.select(),E.setSelectionRange(0,9999))}},!1),y.valueFunction=function(){return x.value},y.mainElement=x,y.show=function(E,b,z){if(E instanceof Ao&&z instanceof Go)if(z.state===Sc)x.style.border="3px solid red",x.focus();else{var tt=E.ga(lr),rt=b.position,ot=b.scale,lt=E.Df()*ot;lt<z.minimumEditorScale&&(lt=z.minimumEditorScale);var ut=E.naturalBounds.width*lt+6,ft=E.naturalBounds.height*lt+2,yt=(tt.x-rt.x)*ot;tt=(tt.y-rt.y)*ot,rt=E.verticalAlignment,ot=(E.lineHeight+E.spacingAbove+E.spacingBelow)*E.lineCount*lt,ft=rt.y*ft-rt.y*ot+rt.offsetY-(.5*ft-.5*ot)-ot/2,x.value=E.text,b.div.style.font=E.font,x.style.position="absolute",x.style.zIndex="100",x.style.font="inherit",x.style.fontSize=100*lt+"%",x.style.lineHeight="normal",x.style.width=ut+"px",x.style.left=(yt-ut/2|0)-1+"px",x.style.top=(tt+ft|0)-1+"px",x.style.textAlign=E.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=E.lineCount,x.wA=lt,x.className="goTXarea",b.div.appendChild(x),x.focus(),z.selectsTextOnActivate&&(x.select(),x.setSelectionRange(0,9999))}},y.hide=function(E){E.div.removeChild(x)}}}Go.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.diagram;if(a===null||a.isReadOnly||Eh&&Eh!==this&&(Eh.acceptText(ku),Eh&&Eh!==this)||!a.lastInput.left||this.isBeyondDragSize())return!1;var y=a.ic(a.lastInput.documentPoint);return y!==null&&y instanceof Ao&&y.editable&&y.part.canEdit()?(y=y.part,!(y===null||this.starting===Dd&&!y.isSelected||this.starting===hf&&2>a.lastInput.clickCount)):!1},Go.prototype.doStart=function(){Eh=this,this.textBlock!==null&&this.doActivate()},Go.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 Ao&&(this.textBlock=y,y.part!==null)){a.animationManager.Cc(),this.isActive=!0,this.qa=vc;var x=this.defaultTextEditor;y.textEditor!==null&&(x=y.textEditor),this.Zh=this.textBlock.copy();var E=new Be(this.textBlock.ga(_r),this.textBlock.ga(lo));a.tv(E),x.show(y,a,this),this.currentTextEditor=x}}}},Go.prototype.doCancel=function(){this.stopTool()},Go.prototype.doMouseUp=function(){this.canStart()&&this.doActivate()},Go.prototype.doMouseDown=function(){this.isActive&&this.acceptText(ku)},Go.prototype.acceptText=function(a){switch(a){case ku:this.qa===Id?this.currentTextEditor instanceof HTMLElement&&this.currentTextEditor.focus():(this.qa===vc||this.qa===Sc||this.qa===yc)&&(this.qa=pg,gg(this));break;case lf:case mc:case uf:(mc!==a||this.textBlock.isMultiline!==!0)&&(this.qa===vc||this.qa===Sc||this.qa===yc)&&(this.qa=pg,gg(this))}};function gg(a){var y=a.textBlock,x=a.diagram,E=a.currentTextEditor;if(y!==null&&E!==null){var b=y.text,z="";E.valueFunction!==null&&(z=E.valueFunction()),a.isValidText(y,b,z)?(a.Ea(a.name),a.qa=Id,a.transactionResult=a.name,y.text=z,a.doSuccess(b,z),x!==null&&x.R("TextEdited",y,b),a.stopTransaction(),a.stopTool(),x!==null&&x.doFocus()):(a.qa=Sc,a.doError(b,z))}}Go.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)},Go.prototype.doSuccess=function(a,y){var x=this.textBlock;x.textEdited!==null&&x.textEdited(x,a,y)},Go.prototype.doDeactivate=function(){var a=this.diagram;a!==null&&(this.qa=Od,this.currentTextEditor!==null&&this.currentTextEditor.hide(a,this),this.textBlock=null,this.isActive=!1)},Go.prototype.doStop=function(){Eh=null},Go.prototype.isValidText=function(a,y,x){var E=this.textValidation;return E!==null&&!E(a,y,x)?!1:(E=a.textValidation,!!(E===null||E(a,y,x)))},Go.prototype.Lx=function(a){var y=this.Zh;return y.text=a,y.measure(this.textBlock.Ih,1/0),y},ye.Object.defineProperties(Go.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)}}}),Go.prototype.measureTemporaryTextBlock=Go.prototype.Lx;var lf=new rn(Go,"LostFocus",0),ku=new rn(Go,"MouseDown",1),uf=new rn(Go,"Tab",2),mc=new rn(Go,"Enter",3),q0=new rn(Go,"SingleClick",0),Dd=new rn(Go,"SingleClickSelected",1),hf=new rn(Go,"DoubleClick",2),Od=new rn(Go,"StateNone",0),vc=new rn(Go,"StateActive",1),yc=new rn(Go,"StateEditing",2),pg=new rn(Go,"StateValidating",3),Sc=new rn(Go,"StateInvalid",4),Id=new rn(Go,"StateValidated",5),Eh=null;Go.className="TextEditingTool",Go.LostFocus=lf,Go.MouseDown=ku,Go.Tab=uf,Go.Enter=mc,Go.SingleClick=q0,Go.SingleClickSelected=Dd,Go.DoubleClick=hf,Go.StateNone=Od,Go.StateActive=vc,Go.StateEditing=yc,Go.StateValidating=pg,Go.StateInvalid=Sc,Go.StateValidated=Id,Di("textEditingTool",function(){return this.findTool("TextEditing")},function(a){this.gb("TextEditing",a,this.mouseUpTools)});function qs(a){Pc||(mg(),Pc=!0),this.H=Zu,this.Ok=this.zb=this.vq=this.bc=!1,this.Qw=!0,this.Pk=ah,this.Dm=!1,this.Gh=this.Jd=!0,this.Dg=600,this.cw=this.Ow=!1,this.Zd=new pn,this.ce=new ts,this.ce.Yd=this,this.Ei=new pn,this.pu=new pn,this.Sr=new pn,this.pr=new pn,a&&Object.assign(this,a)}qs.prototype.Xe=function(a){this.H=a},qs.prototype.canStart=function(){return!0};function zu(a,y){a.Jd&&a.canStart(y)&&(a.Zd.add(y),a.defaultAnimation.isAnimating&&a.Cc(),es(a.H),a.zb=!0)}function df(a){if(a.Jd&&a.zb){var y=a.ce,x=a.H,E=a.Zd.contains("Model");E&&(a.Ok=!0,a.Pk===ah?(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===vg&&y.vc.clear(),a.Qw=!!(a.Pk===wc&&x.du.D(x.pa)),x.R("InitialAnimationStarting",a)),E&&!a.Gh||y.vc.count===0?(a.Zd.clear(),a.zb=!1,y.vc.clear(),Cc(y,x),a.Ok=!1,x.N()):(a.Zd.clear(),x.kg=!1,E=y.vc.get(x),x.autoScale!==hs&&E!==null&&(delete E.start.scale,delete E.end.scale),Je.requestAnimationFrame(function(){a.zb===!1||y.bc||(x.Gf("temporaryPixelRatio")&&Ts(x),wg(x),a.zb=!1,y.start(),y.bc&&(Lh(a),x.Ya(),yg(y,0),wl(x,!0),qh(a),x.R("AnimationStarting",a)))}))}}function oh(a){return a.Zd.contains("Trigger")&&a.Zd.count===1}function cf(a,y,x,E){a.isTicking||oh(a)||y instanceof Nn&&(y.fromNode!==null||y.toNode!==null)||a.ce.add(y,"position",x,E,!1)}wt=qs.prototype,wt.fv=function(a){return this.ce.fv(a)},wt.Xu=function(a){return this.ce.Xu(a)};function ff(a,y){function x(){if(0<b.Sr.count&&(E.addAll(b.Sr),b.Sr.clear(),b.bc=!0),b.bc!==!1&&E.count!==0){b.pu.addAll(E);for(var z=b.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 ge&&ot.diagram!==null||ot instanceof ke){rt=!0;break t}}rt=!1}rt?Ec(tt,!1):tt.Xk=!0}}b.pu.clear(),b.bc!==!1&&(Lh(b),wl(b.H),qh(b)),Je.requestAnimationFrame(x)}}var E=a.Ei,b=a;a.bc?a.Sr.add(y):(a.bc=!0,E.add(y),Je.requestAnimationFrame(function(){x()}))}function Hp(a){for(a=a.Ei.iterator;a.next();)a.value.Xk=!1}function Lh(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 qh(a){var y=a.H;y.skipsUndoManager=a.Ow,y.skipsModelSourceBindings=a.cw,a.vq=!1}wt.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(),Cc(y,null),a===!0)for(a=this.Ei.Fa(),y=0;y<a.length;y++)a[y].Ml(!0)}else y.vc.clear(),Cc(y,this.H)},wt.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))},wt.Cj=function(a,y){this.zb&&(this.Zd.contains("Expand Tree")||this.Zd.contains("Expand SubGraph"))&&(this.ce.Cj(a,y),Hs(this,a))},wt.Aj=function(a,y){this.zb&&(this.Zd.contains("Collapse Tree")||this.Zd.contains("Collapse SubGraph"))&&(this.ce.Aj(a,y),Fh(this.ce,y,"position",y.position,y.position),Hs(this,a))};function Wp(a,y,x){!a.zb||y.D(x)||oh(a)||(a.H.pi||(y=x.copy()),Fh(a.ce,a.H,"position",y,x))}function gf(a,y,x){y.fd&&(y.Tg=x,a.pr.add(y))}function Hs(a,y){for(y=y.findLinksConnected();y.next();){var x=y.value;x.fd&&(x.Tg=x.points.copy(),a.pr.add(x))}}function td(a,y,x,E,b){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],lt=y[1],ut=y[2];return y=y[3],rt===0||rt===100?(z=ot,tt=lt):(ut===0||ut===100)&&(ot=z,lt=tt),180<Math.abs(ot-z)&&(ot>z?z+=360:ot+=360),z=b(x,z,ot-z,E)%360,tt=b(x,tt,lt-tt,E),rt=b(x,rt,ut-rt,E),x=b(x,a,y-a,E),"hsla("+z+", "+tt+"%, "+rt+"%, "+x+")"}function mg(){function a(x,E,b,z,tt,rt){x.position=new At(z(tt,E.x,b.x-E.x,rt),z(tt,E.y,b.y-E.y,rt))}var y=new be;y.add("position:diagram",a),y.add("position",a),y.add("position:part",function(x,E,b,z,tt,rt){tt<rt?x.mm(z(tt,E.x,b.x-E.x,rt),z(tt,E.y,b.y-E.y,rt),!1):x.position=new At(z(tt,E.x,b.x-E.x,rt),z(tt,E.y,b.y-E.y,rt))}),y.add("location",function(x,E,b,z,tt,rt){tt<rt?x.mm(z(tt,E.x,b.x-E.x,rt),z(tt,E.y,b.y-E.y,rt),!0):x.location=new At(z(tt,E.x,b.x-E.x,rt),z(tt,E.y,b.y-E.y,rt))}),y.add("position:placeholder",function(x,E,b,z,tt,rt){tt<rt?x.mm(z(tt,E.x,b.x-E.x,rt),z(tt,E.y,b.y-E.y,rt),!1):x.position=new At(z(tt,E.x,b.x-E.x,rt),z(tt,E.y,b.y-E.y,rt))}),y.add("position:nodeCollapse",function(x,E,b,z,tt,rt){var ot=x.actualBounds,lt=b.actualBounds;b=lt.x+lt.width/2-ot.width/2,ot=lt.y+lt.height/2-ot.height/2,tt<rt?x.mm(z(tt,E.x,b-E.x,rt),z(tt,E.y,ot-E.y,rt),!1):x.position=new At(z(tt,E.x,b-E.x,rt),z(tt,E.y,ot-E.y,rt))}),y.add("desiredSize",function(x,E,b,z,tt,rt){x.desiredSize=new Be(z(tt,E.width,b.width-E.width,rt),z(tt,E.height,b.height-E.height,rt))}),y.add("width",function(x,E,b,z,tt,rt){x.width=z(tt,E,b-E,rt)}),y.add("height",function(x,E,b,z,tt,rt){x.height=z(tt,E,b-E,rt)}),y.add("fill",function(x,E,b,z,tt,rt){x.fill=td(E,b,tt,rt,z)}),y.add("stroke",function(x,E,b,z,tt,rt){x.stroke=td(E,b,tt,rt,z)}),y.add("strokeWidth",function(x,E,b,z,tt,rt){x.strokeWidth=z(tt,E,b-E,rt)}),y.add("strokeDashOffset",function(x,E,b,z,tt,rt){x.strokeDashOffset=z(tt,E,b-E,rt)}),y.add("background",function(x,E,b,z,tt,rt){x.background=td(E,b,tt,rt,z)}),y.add("areaBackground",function(x,E,b,z,tt,rt){x.areaBackground=td(E,b,tt,rt,z)}),y.add("opacity",function(x,E,b,z,tt,rt){x.opacity=z(tt,E,b-E,rt)}),y.add("scale",function(x,E,b,z,tt,rt){x.scale=z(tt,E,b-E,rt)}),y.add("angle",function(x,E,b,z,tt,rt){x.angle=z(tt,E,b-E,rt)}),xc=y}ye.Object.defineProperties(qs.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&&un(a,">= 1",qs,"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}}}),qs.prototype.stopAnimation=qs.prototype.Cc;var xc=null,Pc=!1,ah=new rn(qs,"Default",1),wc=new rn(qs,"AnimateLocations",2),vg=new rn(qs,"None",3);qs.className="AnimationManager",qs.defineAnimationEffect=function(a,y){Pc||(mg(),Pc=!0),xc.add(a,y)},qs.Default=ah,qs.AnimateLocations=wc,qs.None=vg;function ts(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=_d,this.Wk=this.ho=!1,this.cu=1,this.au=0,this.Gd=this.Dg=NaN,this.gw=0,this.dn=null,this.o=Zn,this.vc=new be,this.Tt=new be,this.yl=new pn,this.Ut=new pn,this.dw=bh,a&&Object.assign(this,a)}ts.prototype.suspend=function(){this.Xk=!0},ts.prototype.advanceTo=function(a,y){y&&(this.Xk=!1),this.ho&&a>=this.Gd&&(this.Wk=!0,a-=this.Gd),this.gw=a,Ec(this,!0),Lh(this.Yd),wl(this.H),qh(this.Yd),this.H.redraw()};function Cc(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}wt=ts.prototype,wt.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 ke?a=x:x instanceof ge&&(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===ah&&this===y.defaultAnimation&&(this.Lp=Vp,this.Gd=isNaN(this.Dg)?y.duration===600?900:y.duration:this.Dg),this.dw=a.scrollMode,this.isViewportUnconstrained&&(a.sj=Bc),Lh(y),this.yl.each(function(E){E.data=null,a.add(E)}),qh(y),this.bc=!0,this.Qd=+new Date,this.cn=this.Qd+this.Gd,ff(y,this),this)},wt.Iy=function(a,y){return a.Zc()?(this.yl.add(a),this.H=y,this):this},wt.add=function(a,y,x,E,b){if(y==="position"&&x.Xa(E))return this;if(this.H===null&&(a instanceof ke?this.H=a:a instanceof ge&&a.diagram!==null&&(this.H=a.diagram)),a instanceof Bi){if(!a.isAnimated)return this;y==="position"&&(y="position:part")}return Fh(this,a,y,x,E,b),this};function Fh(a,y,x,E,b,z){var tt=a.vc;if(y instanceof ke&&x==="position"&&(x="position:diagram"),(x==="fill"||x==="stroke"||x==="background"||x==="areaBackground")&&(hh(E),av(),E=[pl.j,pl.u,pl.o,pl.F],hh(b),av(),b=[pl.j,pl.u,pl.o,pl.F]),tt.contains(y)){var rt=tt.I(y),ot=rt.start,lt=rt.end;ot[x]===void 0&&(ot[x]=ed(E)),lt[x]=ed(b)}else ot={},lt={},ot[x]=ed(E),lt[x]=ed(b),rt=ot.position,y instanceof ge&&rt instanceof At&&!rt.w()&&y.diagram.animationManager.Zd.contains("Expand SubGraph")&&rt.assign(lt.position),rt=new nd(ot,lt,z),tt.add(y,rt);tt=ot[x],tt instanceof At&&!tt.w()&&tt.assign(a.o),z&&x.indexOf("position:")===0&&y instanceof Bi?rt.Ku.location=ed(y.location):z&&(rt.Ku[x]=ed(E))}function ed(a){return a instanceof At||a instanceof on?a.copy():a}wt.fv=function(a){return this.bc?(a=this.vc.I(a),a!==null&&a.nv):!1},wt.Xu=function(a){return this.bc?(a=this.vc.I(a),a!==null&&(a.start.position||a.start.location)):!1};function Ec(a,y){if(!a.Xk||y){var x=a.Yd;if(a.bc!==!1){var E=+new Date,b=E>a.cn?a.Gd:E-a.Qd;y&&(b=a.gw,b<a.Gd?(a.Qd=+new Date-b,a.cn=a.Qd+a.Gd):b=a.Gd),Lh(x),yg(a,b),wl(a.H,!0),qh(x),E>a.cn&&(a.ho&&!a.Wk?(a.Qd=+new Date,a.cn=a.Qd+a.Gd,a.Wk=!0):a.Ml(!1))}}}function yg(a,y){for(var x=a.Gd,E=a.vc.iterator,b=a.Wk;E.next();){var z=E.key;if(!(z instanceof ge&&z.diagram===null)){var tt=E.value,rt=b?tt.end:tt.start;tt=b?tt.start:tt.end;var ot=xc,lt;for(lt in tt)lt==="position"&&(tt["position:placeholder"]||tt["position:nodeCollapse"])||ot.get(lt)===null||ot.get(lt)(z,rt[lt],tt[lt],a.Lp,y,x,a)}}}wt.stop=function(){return this.bc?(this.Ml(!0),this):this},wt.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,Lh(x);for(var E=this.vc,b=this.yl.iterator;b.next();)y.remove(b.value);for(b=this.Ut.iterator;b.next();)b.value.v();b=this.ho,E=E.iterator;for(var z=xc;E.next();){var tt=E.key,rt=E.value,ot=b?rt.end:rt.start,lt=b?rt.start:rt.end,ut=rt.Ku,ft;for(ft in lt)if(z.get(ft)!==null){var yt=ft;!rt.Hu||yt!=="position:nodeCollapse"&&yt!=="position:placeholder"||(yt="position"),z.get(yt)(tt,ot[ft],ut[ft]!==void 0?ut[ft]:rt.Hu?ot[ft]:lt[ft],this.Lp,this.Gd,this.Gd,this)}rt.Hu&&ut.location!==void 0&&tt instanceof Bi&&(tt.location=ut.location),rt.nv&&tt instanceof Bi&&tt.Zb(!1)}if(y.As.clear(),Lc(y,!1),y.Ya(),y.N(),wl(y,!0),x.defaultAnimation===this){for(ft=x.pr.iterator;ft.next();)b=ft.value,b.Tg!==null&&(b.points=b.Tg,b.Tg=null);x.pr.clear()}wl(y,!0),this.isViewportUnconstrained&&(y.scrollMode=this.dw),qh(x),this.au++,!a&&this.cu>this.au?(this.Wk=!1,this.start()):(this.dn&&this.dn(this),Cc(this,null),x.Ml(this),y.$b())}},wt.Cj=function(a,y){var x=y.actualBounds,E=null;if(y instanceof er&&(E=y.placeholder),E!==null?(x=E.ga(_r),E=E.padding,x.x+=E.left,x.y+=E.top,this.add(a,"position",x,a.position,!1)):this.add(a,"position",new At(x.x+x.width/2,x.y+x.height/2),a.position,!1),this.add(a,"scale",.01,a.scale,!1),a instanceof er)for(a=a.memberParts;a.next();)E=a.value,E instanceof $n&&this.Cj(E,y)},wt.Aj=function(a,y){if(a.isVisible()){var x=null;if(y instanceof er&&(x=y.placeholder),x!==null){var E=x.ga(_r);x=x.padding,E.x+=x.left,E.y+=x.top,this.add(a,"position:placeholder",a.position,E,!0)}else this.add(a,"position:nodeCollapse",a.position,y,!0);if(this.add(a,"scale",a.scale,.01,!0),E=this.vc,E.contains(a)&&(E.I(a).nv=!0),a instanceof er)for(a=a.memberParts;a.next();)E=a.value,E instanceof $n&&this.Aj(E,y)}},wt.Ez=function(a){var y=this.Tt.get(a);return y===null&&(y={},this.Tt.add(a,y)),y},ye.Object.defineProperties(ts.prototype,{duration:{get:function(){return this.Dg},set:function(a){1>a&&un(a,">= 1",ts,"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:Gt("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}}}),ts.prototype.getTemporaryState=ts.prototype.Ez,ts.prototype.stop=ts.prototype.stop,ts.prototype.add=ts.prototype.add,ts.prototype.addTemporaryPart=ts.prototype.Iy;function _d(a,y,x,E){return a/=E/2,1>a?x/2*a*a+y:-x/2*(--a*(a-2)-1)+y}function Vp(a,y,x,E){return a===E?y+x:x*(-Math.pow(2,-10*a/E)+1)+y}ts.className="Animation",ts.EaseLinear=function(a,y,x,E){return x*a/E+y},ts.EaseInOutQuad=_d,ts.EaseInQuad=function(a,y,x,E){return x*(a/=E)*a+y},ts.EaseOutQuad=function(a,y,x,E){return-x*(a/=E)*(a-2)+y},ts.EaseInExpo=function(a,y,x,E){return a===0?y:x*Math.pow(2,10*(a/E-1))+y},ts.EaseOutExpo=Vp;function nd(a,y,x){this.start=a,this.end=y,this.Ku={},this.Hu=x,this.nv=!1}nd.className="AnimationState";function ql(a,y,x){this.xd=null,this.rf=a,this.so=x||Sg,this.uk=null,y!==void 0&&(this.uk=y,x===void 0&&(this.so=id))}ql.prototype.copy=function(){var a=new ql(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 Kp(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))}ye.Object.defineProperties(ql.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 Sg=new rn(ql,"Default",1),id=new rn(ql,"Immediate",2),Rd=new rn(ql,"Bundled",3);ql.className="AnimationTrigger",ql.Default=Sg,ql.Immediate=id,ql.Bundled=Rd;function Ra(a){Hi(this),this.H=null,this.Pa=new fn,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)}wt=Ra.prototype,wt.clear=function(){for(var a=this.Pa,y=0;y<a.length;y++){var x=a.s[y];x.Ig=null,ss(x)}a.clear(),this.Zq.length=0},wt.Xe=function(a){this.H=a},wt.toString=function(a){a===void 0&&(a=0);var y='Layer "'+this.name+'"';if(0>=a)return y;for(var x=0,E=0,b=0,z=0,tt=0,rt=this.Pa.iterator;rt.next();){var ot=rt.value;ot instanceof er?b++:ot instanceof $n?E++:ot instanceof Nn?z++:ot instanceof Qr?tt++:x++}if(rt="",0<x&&(rt+=x+" Parts "),0<E&&(rt+=E+" Nodes "),0<b&&(rt+=b+" 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(),E=x.data,E!==null&&ji(E)&&(rt+=" #"+ji(E)),x instanceof $n?rt+=" "+Ii(E):x instanceof Nn&&(rt+=" "+Ii(x.fromNode)+" "+Ii(x.toNode));return y+" "+this.Pa.count+": "+rt},wt.ic=function(a,y,x){if(y===void 0&&(y=null),x===void 0&&(x=null),this.Uh===!1)return null;var E=!1;this.diagram!==null&&this.diagram.viewportBounds.ca(a)&&(E=!0);for(var b=At.alloc(),z=this.Pa.s,tt=z.length;tt--;){var rt=z[tt];if((E!==!0||fd(rt)!==!1)&&rt.isVisible()&&(b.assign(a),Dn(b,rt.oe),rt=rt.ic(b,y,x),rt!==null&&(y!==null&&(rt=y(rt)),rt!==null&&(x===null||x(rt)))))return At.free(b),rt}return At.free(b),null},wt.ji=function(a,y,x,E){if(y===void 0&&(y=null),x===void 0&&(x=null),E instanceof fn||E instanceof pn||(E=new pn),this.Uh===!1)return E;var b=!1;this.diagram!==null&&this.diagram.viewportBounds.ca(a)&&(b=!0);for(var z=At.alloc(),tt=this.Pa.s,rt=tt.length;rt--;){var ot=tt[rt];if((b!==!0||fd(ot)!==!1)&&ot.isVisible()){z.assign(a),Dn(z,ot.oe);var lt=ot;ot.ji(z,y,x,E)&&(y!==null&&(lt=y(lt)),lt===null||x!==null&&!x(lt)||E.add(lt))}}return At.free(z),E},wt.Cf=function(a,y,x,E,b){if(y===void 0&&(y=null),x===void 0&&(x=null),E===void 0&&(E=!1),b instanceof fn||b instanceof pn||(b=new pn),this.Uh===!1)return b;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||fd(ot)!==!1)&&ot.isVisible()){var lt=ot;ot.Cf(a,y,x,E,b)&&(y!==null&&(lt=y(lt)),lt===null||x!==null&&!x(lt)||b.add(lt))}}return b},wt.Nu=function(a,y,x,E,b,z,tt){if(this.Uh===!1)return b;for(var rt=this.Pa.s,ot=rt.length;ot--;){var lt=rt[ot];if((tt!==!0||fd(lt)!==!1)&&z(lt)&<.isVisible()){var ut=lt;lt.Cf(a,y,x,E,b)&&(y!==null&&(ut=y(ut)),ut===null||x!==null&&!x(ut)||b.add(ut))}}return b},wt.og=function(a,y,x,E,b,z){if(x===void 0&&(x=null),E===void 0&&(E=null),b===void 0&&(b=!0),b!==!1&&b!==!0&&((b instanceof fn||b instanceof pn)&&(z=b),b=!0),z instanceof fn||z instanceof pn||(z=new pn),this.Uh===!1)return z;var tt=!1;this.diagram!==null&&this.diagram.viewportBounds.ca(a)&&(tt=!0);for(var rt=At.alloc(),ot=At.alloc(),lt=this.Pa.s,ut=lt.length;ut--;){var ft=lt[ut];if((tt!==!0||fd(ft)!==!1)&&ft.isVisible()){rt.assign(a),Dn(rt,ft.oe),ot.h(a.x+y,a.y),Dn(ot,ft.oe);var yt=ft;ft.og(rt,ot,x,E,b,z)&&(x!==null&&(yt=x(yt)),yt===null||E!==null&&!E(yt)||z.add(yt))}}return At.free(rt),At.free(ot),z},wt.Fd=function(a,y){if(this.visible){var x=this.Pa.s,E=x.length;if(E!==0){a=Yn();for(var b=Yn(),z=0;z<E;z++){var tt=x[z];if(tt.vw=z,tt instanceof Nn){if(tt.fd===!1)continue}else if(tt instanceof Qr&&tt.adornedPart!==null)continue;var rt=tt.actualBounds;tt.isVisible()&&Lo(rt,y)?(tt.Fd(!0),a.push(tt)):(tt.Fd(!1),tt.adornments!==null&&0<tt.adornments.count&&b.push(tt))}for(y=0;y<a.length;y++)for(x=a[y],Ov(x),x=x.adornments;x.next();)E=x.value,E.measure(1/0,1/0),E.arrange(),E.Fd(!0);for(y=0;y<b.length;y++)Ov(b[y]);si(a),si(b)}}};function sh(a,y){var x=1;return a.pb!==1&&(x=y.globalAlpha,y.globalAlpha=x*a.pb),x}wt.gc=function(a,y,x){if(this.visible&&this.pb!==0&&(x===void 0&&(x=!0),x||!this.isTemporary)){x=this.Pa.s;var E=x.length;if(E!==0){if(a.isTemporary)for(var b=0;b<E;b++)x[b].Gj();b=sh(this,a);var z=this.Zq;z.length=0;for(var tt=y.scale,rt=Be.alloc(),ot=0;ot<E;ot++)this.Oj(a,x[ot],y,z,tt,rt,!0);if(Be.free(rt),a.isTemporary)for(y=0;y<E;y++)x[y].Gj();a.globalAlpha=b}}};function Up(a,y,x,E,b){if(a.visible&&a.pb!==0&&(b||!a.isTemporary)){b=a.Pa.s;var z=b.length;if(z!==0){var tt=sh(a,y),rt=a.Zq;rt.length=0;for(var ot=x.scale,lt=Be.alloc(),ut=0;ut<z;ut++){var ft=b[ut];E.contains(ft)&&a.Oj(y,ft,x,rt,ot,lt,!1)}Be.free(lt),y.globalAlpha=tt}}}wt.Oj=function(a,y,x,E,b,z,tt){if(tt&&!fd(y))a.Hs(y);else{if(E!==null&&y instanceof Nn&&(y.isOrthogonal&&E.push(y),y.fd===!1)){a.Hs(y);return}for(tt=!1,E=y.containingGroup;E!==null;)tt?E.tb!==null&&z.Ex(E.tb):E.tb!==null&&(tt=!0,z.assign(E.tb)),E=E.containingGroup;var rt=y.actualBounds;if(E=!1,tt&&y.isVisible()){if(!z.Yc(rt)){a.Hs(y);return}E=!z.Re(rt)}E&&(a.save(),a instanceof tl?a.bk=z.copy():(a.beginPath(),a.rect(z.x,z.y,z.width,z.height),a.clip())),rt.width*b>x.Oq||rt.height*b>x.Oq?y.gc(a,x):(b=y.actualBounds,z=y.naturalBounds,b.width===0||b.height===0||isNaN(b.x)||isNaN(b.y)||!y.isVisible()||(x=y.transform,y.areaBackground!==null&&(na(y,a,y.areaBackground,!0,!0,z,b),a.fillRect(b.x,b.y,b.width,b.height)),y.areaBackground===null&&y.background===null&&(na(y,a,"rgba(0,0,0,0.3)",!0,!1,z,b),a.fillRect(b.x,b.y,b.width,b.height)),y.background!==null&&(a.transform(x.m11,x.m12,x.m21,x.m22,x.dx,x.dy),na(y,a,y.background,!0,!1,z,b),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)))))),E&&(a.restore(),a.Vc(!0))}},wt.g=function(a,y,x,E,b){var z=this.diagram;z!==null&&z.cb(wr,a,this,y,x,E,b)},wt.oi=function(a,y,x){var E=this.Pa;if(y.Ig=this,this===null&&ss(y),a>=E.count)a=E.count;else if(E.M(a)===y)return-1;return E.Gb(a,y),y.Vo(x),E=this.diagram,E!==null&&(x?E.N():E.oi(y)),pf(this,a,y),a},wt.pc=function(a,y,x){if(!x&&y.layer!==this&&y.layer!==null)return y.layer.pc(a,y,x);var E=this.Pa;if(0>a||a>=E.length){if(a=E.indexOf(y),0>a)return-1}else if(E.M(a)!==y&&(a=E.indexOf(y),0>a))return-1;return y.Wo(x),E.mb(a),E=this.diagram,E!==null&&(x?E.N():E.pc(y)),y.Ig=null,ss(y),a};function pf(a,y,x){if(y=Yp(a,y,x),x instanceof er&&x!==null&&isNaN(x.zOrder)){if(x.memberParts.count!==0){for(var E=-1,b=a.Pa.s,z=b.length,tt=0;tt<z;tt++){var rt=b[tt];if(rt===x&&(y=tt,0<=E)||0>E&&rt.containingGroup===x&&(E=tt,0<=y))break}!(0>E)&&E<y&&(b=a.Pa,b.mb(y),b.Gb(E,x))}y=x.containingGroup,y!==null&&pf(a,-1,y)}x.svg!==null&&x.svg.remove()}function Yp(a,y,x){var E=x.zOrder;if(isNaN(E))return y;a=a.Pa;var b=a.count;if(1>=b)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<b&&(ot=a.M(rt).zOrder,!!isNaN(ot));)rt++;if(!isNaN(tt)&&tt>E)for(;;){if(z===-1||tt<=E){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<E)for(;;){if(rt===b||ot>=E){if(rt--,rt===y)break;return a.mb(y),a.Gb(rt,x),rt}for(ot=NaN;++rt<b&&(ot=a.M(rt).zOrder,isNaN(ot)););}return y}ye.Object.defineProperties(Ra.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===""&&Gt("Cannot rename default Layer to: "+a),x=x.layers;x.next();)x.value.name===a&&Gt("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)&&un(a,"0 <= value <= 1",Ra,"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))}}}),Ra.prototype.findObjectsNear=Ra.prototype.og,Ra.prototype.findObjectsIn=Ra.prototype.Cf,Ra.prototype.findObjectsAt=Ra.prototype.ji,Ra.prototype.findObjectAt=Ra.prototype.ic,Ra.className="Layer";function ke(a,y){if(lm||(os(),lm=!0),Hi(this),Zu=this,this.vb=!0,this.Ka=null,this.ya=this.Aa=0,this.ta=null,$o){var x=this,E=function(){x.removeEventListener(Je.document,"DOMContentLoaded",E,!1),x.setRTL()};Je.document.body!==null?this.setRTL():x.addEventListener(Je.document,"DOMContentLoaded",E,!1)}this.ol=null,Ff.add("Model",vo);var b=this;return this.Hb=function(z){var tt=b.partManager;if(z.model===tt.diagram.model&&tt.diagram.aa){tt.diagram.aa=!1;try{var rt=z.change;z.modelChange===""&&rt===wr&&tt.updateDataBindings(z.object,z.propertyName)}finally{tt.diagram.aa=!0}}},this.Oc=function(z){b.partManager.doModelChanged(z)},this.hu=this.ku=null,Xp(this),this.model=hy(),this.Wg=!0,Qp(this),this.layout=new Ko,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 um,a!==void 0&&(typeof a=="string"||Je.Element&&a instanceof Element?Pg(this,a):y=a),this.vb=!1,y&&this.nm(y),this}var rd,Zu;function Xp(a){a.Yd=new qs,a.Yd.Xe(a),a.Db=17,a.Gw=!1,a.tn=!1,a.bu="default",a.Wa=new fn,a.pj=new be,a.nl="default",a.Tx(),a.Sx(),a.pb=1,a.pa=new At(NaN,NaN).freeze(),a.du=new At(NaN,NaN),a.Ca=1,a.Pp=1,a.zt=new At(NaN,NaN).freeze(),a.At=NaN,a.Ot=1e-4,a.Mt=100,a.Ab=new ae,a.zu=new At(NaN,NaN).freeze(),a.ut=new Be(NaN,NaN,NaN,NaN).freeze(),a.rj=new nr(0,0,0,0).freeze(),a.sj=bh,a.nu=!1,a.Zt=null,a.fu=null,a.yh=hs,a.zk=wa,a.Fg=hs,a.pq=wa,a.yt=_r,a.Bt=_r,a.Fc=!0,a.pn=!1,a.De=new pn,a.Eh=new be,a.Xm=!0,a.vp=250,a.vk=-1,a.xp=new nr(16,16,16,16).freeze(),a.kg=!1,a.Jk=!1,a.fn=!0,a.bq=new Zi,a.bq.diagram=a,a.Qg=new Zi,a.Qg.diagram=a,a.cj=new Zi,a.cj.diagram=a,a.zg=null,a.pf=null,a.qu=!1,ev(a),a.ai=new pn,a.Ht=!0,a.uu=Nh,a.pw=!1,a.wu=Nc,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 be,a.Xn=new fn,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 nr(5).freeze(),a.Hw=new pn().freeze(),a.Nt=999999999,a.nw=new pn().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 pn,a.ow=new pn,a.Xh=null,a.aw=new on(8,8),a.bw=999,a.Bw=1,a.Jw=0,a.fc={scale:1,position:new At,bounds:new Be,Py:new on,bA:new on,Oz:!1},a.fc.canvasSize=a.fc.Py,a.fc.newCanvasSize=a.fc.bA,a.fc.isScroll=!1,a.Rw=new Be(NaN,NaN,NaN,NaN).freeze(),a.wo=new on(NaN,NaN).freeze(),a.Sp=new Be(NaN,NaN,NaN,NaN).freeze(),a.It=!1,a.Lg=new be;var y=new $n,x=new Ao;x.bind(new ha("text","",Ii)),y.add(x),a.ny=y,a.Lg.add("",y),y=new $n,x=new Ao,x.stroke="brown",x.bind(new ha("text","",Ii)),y.add(x),a.Lg.add("Comment",y),y=new $n,y.selectable=!1,y.avoidable=!1,x=new cr,x.figure="Ellipse",x.fill="black",x.stroke=null,x.desiredSize=new on(3,3).ja(),y.add(x),a.Lg.add("LinkLabel",y),a.Yi=new be,y=new er,y.selectionObjectName="GROUPPANEL",y.type=wn.Vertical,x=new Ao,x.font="bold 12pt sans-serif",x.bind(new ha("text","",Ii)),y.add(x),x=new wn(wn.Auto),x.name="GROUPPANEL";var E=new cr;E.figure="Rectangle",E.fill="rgba(128,128,128,0.2)",E.stroke="black",x.add(E),E=new Es,E.padding=new nr(5,5,5,5).ja(),x.add(E),y.add(x),a.ly=y,a.Yi.add("",y),a.Kh=new be,y=new Nn,x=new cr,x.isPanelMain=!0,y.add(x),x=new cr,x.toArrow="Standard",x.fill="black",x.stroke=null,x.strokeWidth=0,y.add(x),a.my=y,a.Kh.add("",y),y=new Nn,x=new cr,x.isPanelMain=!0,x.stroke="brown",y.add(x),a.Kh.add("Comment",y),y=new Qr,y.type=wn.Auto,x=new cr,x.fill=null,x.stroke="dodgerblue",x.strokeWidth=3,y.add(x),x=new Es,x.margin=new nr(1.5,1.5,1.5,1.5).ja(),y.add(x),a.St=y,a.wt=y,y=new Qr,y.type=wn.Link,x=new cr,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 vo,a.toolManager=new Ar,a.toolManager.initializeStandardTools(),a.defaultTool=a.toolManager,a.currentTool=a.defaultTool,a.nt=null,a.Wm=new at,a.Vt=null,a.Wt=null,a.Mr=!1,a.commandHandler=Jp(),a.eq=null,a.fq=li,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 At,a.zy=500,a.wp=new At,a.wq=!1}ke.prototype.clear=function(){this.animationManager.Cc(),this.model.clear(),Vd=null,ud="",xg(this,!1),this.Xn.clear(),jf(),this.Og.clear(),this.Xh=null,this.Ya(),this.Va(),this.N()};function xg(a,y){a.animationManager.Cc(!0),a.Hw=new pn().freeze(),a.nw=new pn().freeze();var x=a.skipsUndoManager,E=a.cc!==null&&a.cc!==void 0;E&&(a.skipsUndoManager=!0);var b=null;a.fe!==null&&(b=a.fe.part,b!==null&&a.remove(b));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!==b&&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(),jf(),a.Og.clear(),$r=[],b!==null&&(a.add(b),a.partManager.parts.remove(b)),E&&(a.skipsUndoManager=x),z}function Jp(){return null}ke.prototype.reset=function(){this.clear(),this.vb=!0,Xp(this),Nu(this),this.Wg=!0,Qp(this),this.layout=new Ko,this.Wg=!1,this.model=hy(),this.model.undoManager=new $i,this.vb=this.rn=!1,this.N()},ke.prototype.setRTL=function(a){a=a===void 0?this.div:a,a===null&&(a=Je.document.body);var y=Xi("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},ke.prototype.setScrollWidth=function(a){a=a===void 0?this.div:a,a===null&&(a=Je.document.body);var y=0;if($o){var x=sm;y=rd,x===null&&(x=sm=Xi("p"),x.style.width="100%",x.style.height="200px",x.style.boxSizing="content-box",y=rd=Xi("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 E=x.offsetWidth;y.style.overflow="scroll",x=x.offsetWidth,E===x&&(x=y.clientWidth),a.removeChild(y),y=E-x,y!==0||yr||(y=11)}this.Db=y,this.Gw=!0},ke.prototype.qb=function(a){a.classType===ke&&(this.autoScale=a)},ke.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 Pg(a,y){if($o){if(y!=null||Gt("Diagram setup requires an argument DIV."),a.Ka!==null&&Gt("Diagram has already completed setup."),typeof y=="string"?a.Ka=Je.document.getElementById(y):y instanceof HTMLDivElement?a.Ka=y:Gt("No DIV or DIV id supplied: "+y),a.Ka===null&&Gt("Invalid DIV id; could not get element with id: "+y),a.Ka.H!==void 0&&Gt("Invalid div id; div already has a Diagram associated with it."),!a.ol&&Je.ResizeObserver){var x=yi(function(){a.$b()},250);a.ol=new Je.ResizeObserver(function(){x()}),a.ol.observe(a.Ka)}Je.getComputedStyle(a.Ka,null).position==="static"&&(a.Ka.style.position="relative"),y=5;var E="rgba(2"+y+"5, 255, 255, 0)";y--,a.Ka.style["-webkit-tap-highlight-color"]=E,a.Ka.innerHTML="",a.Ka.H=a,a.Ka.goDiagram=a,a.Ka.go=Je.go;var b=new zl(a);if(b.style!==void 0&&(b.style.position="absolute",b.style.top="0px",b.style.left="0px",Je.getComputedStyle(a.Ka,null).getPropertyValue("direction")==="rtl"&&(a.tn=!0),b.style.zIndex="2",b.style.userSelect="none",b.style.MozUserSelect="none",b.style.touchAction="none",b.style.letterSpacing="normal !important",b.style.wordSpacing="normal !important"),a.ta=b,a.ib=b.context,E=a.ib,a.Mb=a.computePixelRatio(),a.viewSize.w()||(a.Aa=a.Ka.clientWidth||1,a.ya=a.Ka.clientHeight||1),bg(a,a.Aa,a.ya),a.Ka.insertBefore(b.Oa,a.Ka.firstChild),b=new zl(null),b.width=1,b.height=1,a.jw=b,a.oy=b.context,$o){b=Xi("div");var z=Xi("div");b.style.position="absolute",b.style.overflow="auto",b.style.width=a.Aa+"px",b.style.height=a.ya+"px",b.style.zIndex="1",z.style.position="absolute",z.style.width="1px",z.style.height="1px",a.Ka.appendChild(b),b.appendChild(z),b.onscroll=qp,b.addEventListener("pointerdown",tm),b.H=a,b.uy=!0,b.vy=!0,a.ku=b,a.hu=z}a.hk=yi(function(){a.Yh=null,a.N()},300),a.Ov=yi(function(){wg(a)},250),a.preventDefault=function(tt){return tt.preventDefault(),!1},a.$j=function(tt){if(a.isEnabled){var rt=Pl(a,tt,!0);rt.bubbles=!0;var ot=0,lt=0;rt.delta=0,tt.deltaX!==void 0?(tt.deltaX!==0&&(ot=0<tt.deltaX?1:-1),tt.deltaY!==0&&(lt=0<tt.deltaY?1:-1),rt.delta=Math.abs(tt.deltaX)>Math.abs(tt.deltaY)?-ot:-lt):tt.wheelDeltaX!==void 0?(tt.wheelDeltaX!==0&&(ot=0<tt.wheelDeltaX?-1:1),tt.wheelDeltaY!==0&&(lt=0<tt.wheelDeltaY?-1:1),rt.delta=Math.abs(tt.wheelDeltaX)>Math.abs(tt.wheelDeltaY)?-ot:-lt):tt.wheelDelta!==void 0&&tt.wheelDelta!==0&&(rt.delta=0<tt.wheelDelta?1:-1),a.doMouseWheel(),tu(rt,tt)}},a.aA=function(tt){a.isEnabled&&(a.Vk=!1,Pl(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 lt=ot;ot=Fg(a,tt,!0,!1,!0,lt),zd(a,tt,ot),ot.targetDiagram=Lg(tt,tt.target),ot.targetObject=null,lt||ot.clone(a.bq),lt=a.uw,rt=rt?25:10,tt.timeStamp-a.tw<a.zy&&!(Math.abs(lt.x-tt.screenX)>rt||Math.abs(lt.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():tu(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=Fg(a,tt,!1,!1,!1,rt[1]!==null);var ot=Je.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 lt=a,ut=tt;ot&&ot.H&&(ut=tt,lt=ot.H),rt.targetDiagram=lt,zd(a,ut,rt),rt.targetObject=null,a.doMouseMove(),tu(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=Fg(a,tt,!1,!0,!0,!1);var lt=Je.document.elementFromPoint(tt.clientX,tt.clientY)||null;lt!==null&<.shadowRoot!==void 0&<.shadowRoot!==null&&(lt=lt.shadowRoot.elementFromPoint(tt.clientX,tt.clientY)),lt!==null&<.H instanceof ke&<.H!==a&&zd(lt.H,tt,ot),lt===null&&(lt=tt.target),zd(a,tt,ot),ot.clickCount=a.yq,ot.targetDiagram=Lg(tt,lt),ot.targetObject=null,a.doMouseUp(),tu(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=E.Z["d"+Tc[1]+Tc[2]+"wI"+Ud.slice(1,5)]["b"+Ax.slice(1,y)](E.Z,Ac,y,y),E.Vc(!0),tv(a),a.nl==="svg"&&(y=a.pj.get("svg"),a.Ka.appendChild(y.Oa),a.ib=y.context)}}ke.prototype.addEventListener=function(a,y,x,E){a.addEventListener(y,x,{capture:E,passive:!1})},ke.prototype.removeEventListener=function(a,y,x,E){a.removeEventListener(y,x,{capture:E})};function tv(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(Je,"resize",a.Ov,!1)}function Ts(a){30<a.Sq&&(a.Yh=1)}function Lc(a,y){a.Yh!==null&&(a.Yh=null,y&&a.hk(),_i&&_i.nx||(a.Sq=0,a.zw=[0,0,0,0,0],a.Tq=0))}ke.prototype.computePixelRatio=function(){return this.Yh!==null?this.Yh:Je.devicePixelRatio||1},ke.prototype.doMouseMove=function(){this.currentTool.doMouseMove()},ke.prototype.doMouseDown=function(){this.currentTool.doMouseDown()},ke.prototype.doMouseUp=function(){this.currentTool.doMouseUp()},ke.prototype.doMouseWheel=function(){this.currentTool.doMouseWheel()},ke.prototype.doKeyDown=function(){this.currentTool.doKeyDown()},ke.prototype.doKeyUp=function(){this.currentTool.doKeyUp()},ke.prototype.doFocus=function(){this.focus()},ke.prototype.focus=function(){if(this.ta)if(this.scrollsPageOnFocus)this.ta.focus();else{var a=Je.scrollX||Je.pageXOffset,y=Je.scrollY||Je.pageYOffset;this.ta.focus(),Je.scrollTo(a,y)}},ke.prototype.Oy=function(){this.H.R("GainedFocus")},ke.prototype.Ny=function(){this.H.R("LostFocus")};function wg(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,E=a.Be?a.Db:0,b=a.Mb;a.Mb=a.computePixelRatio(),a.Mb!==b&&(a.pn=!0,a.$b()),(y.clientWidth!==a.Aa+x||y.clientHeight!==a.ya+E)&&(a.Ee=!0,a.Fc=!0,y=a.layout,y!==null&&y.isViewportSized&&a.autoScale===hs&&(a.Jk=!0,y.C()),a.ld||a.$b())}}}function Qp(a){var y=new Ra;y.name="Background",a.Al(y),y=new Ra,y.name="",a.Al(y),y=new Ra,y.name="Foreground",a.Al(y),y=new Ra,y.name="Adornment",y.isTemporary=!0,y.isInDocumentBounds=!1,a.Al(y),y=new Ra,y.name="Tool",y.isTemporary=!0,y.isInDocumentBounds=!0,a.Al(y),y=new Ra,y.name="Grid",y.allowSelect=!1,y.pickable=!1,y.isTemporary=!0,y.isInDocumentBounds=!1,a.Ww(y,a.Qj("Background"))}function $p(a){var y=new wn(wn.Grid);y.name="GRID";var x=new cr;return x.figure="LineH",x.stroke="lightgray",x.strokeWidth=.5,x.interval=1,y.add(x),x=new cr,x.figure="LineH",x.stroke="gray",x.strokeWidth=.5,x.interval=5,y.add(x),x=new cr,x.figure="LineH",x.stroke="gray",x.strokeWidth=1,x.interval=10,y.add(x),x=new cr,x.figure="LineV",x.stroke="lightgray",x.strokeWidth=.5,x.interval=1,y.add(x),x=new cr,x.figure="LineV",x.stroke="gray",x.strokeWidth=.5,x.interval=5,y.add(x),x=new cr,x.figure="LineV",x.stroke="gray",x.strokeWidth=1,x.interval=10,y.add(x),x=new Bi,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 qp(){this.H.gu?this.H.gu=!1:this.H.isEnabled?this.H.kx(this):Hd(this.H)}function tm(a){this.H.isEnabled?(this.H.lu=a.target.scrollTop,this.H.ju=a.target.scrollLeft):Hd(this.H)}ke.prototype.kx=function(a){if(this.ta!==null){var y=this.ku,x=this.hu;this.qr=!0;var E=this.documentBounds,b=this.viewportBounds,z=this.rj,tt=E.x-z.left,rt=E.y-z.top,ot=E.width+z.left+z.right,lt=E.height+z.top+z.bottom,ut=E.right+z.right;z=E.bottom+z.bottom;var ft=b.x;E=b.y;var yt=b.width,xt=b.height,Ct=b.right,bt=b.bottom;b=this.scale;var Vt=a.scrollLeft;if(this.tn)switch(this.bu){case"negative":Vt=Vt+a.scrollWidth-a.clientWidth;break;case"reverse":Vt=a.scrollWidth-Vt-a.clientWidth}var zt=Vt;yt<ot||xt<lt?(Vt=At.allocAt(this.position.x,this.position.y),this.allowHorizontalScroll&&this.ju!==zt&&(Vt.x=zt/b+tt,this.ju=zt),this.allowVerticalScroll&&this.lu!==a.scrollTop&&(Vt.y=a.scrollTop/b+rt,this.lu=a.scrollTop),this.position=Vt,At.free(Vt),this.Ee=this.qr=!1):(Vt=At.alloc(),a.uy&&this.allowHorizontalScroll&&(tt<ft&&(this.position=Vt.h(zt+tt,this.position.y)),ut>Ct&&(this.position=Vt.h(-(y.scrollWidth-this.Aa)+zt-this.Aa/b+ut,this.position.y))),a.vy&&this.allowVerticalScroll&&(rt<E&&(this.position=Vt.h(this.position.x,a.scrollTop+rt)),z>bt&&(this.position=Vt.h(this.position.x,-(y.scrollHeight-this.ya)+a.scrollTop-this.ya/b+z))),At.free(Vt),this.vd=!0,this.Ee=this.qr=!1,E=this.documentBounds,b=this.viewportBounds,ut=E.right,Ct=b.right,z=E.bottom,bt=b.bottom,tt=E.x,ft=b.x,rt=E.y,E=b.y,yt>=ot&&tt>=ft&&ut<=Ct&&(x.style.width="1px"),xt>=lt&&rt>=E&&z<=bt&&(x.style.height="1px"))}},ke.prototype.computeBounds=function(a){return a===void 0&&(a=new Be),es(this),Cg(this,a)};function Cg(a,y){if(a.fixedBounds.w())return y.assign(a.fixedBounds),y.Co(a.yb),y;for(var x=!0,E=a.Wa.s,b=E.length,z=0;z<b;z++){var tt=E[z];if(tt.visible&&tt.isInDocumentBounds){tt=tt.Pa.s;for(var rt=tt.length,ot=0;ot<rt;ot++){var lt=tt[ot];lt.isInDocumentBounds&<.isVisible()&&(lt=lt.actualBounds,lt.w()&&(x?(x=!1,y.assign(lt)):y.ed(lt)))}}}return x&&y.h(0,0,0,0),y.Co(a.yb),y}ke.prototype.computePartsBounds=function(a,y){y===void 0&&(y=!1);var x=null;if($e(a))for(var E=0;E<a.length;E++){var b=a[E];!y&&b instanceof Nn||(b.Va(),x===null?x=b.actualBounds.copy():x.ed(b.actualBounds))}else for(a=a.iterator;a.next();)E=a.value,!y&&E instanceof Nn||(E.Va(),x===null?x=E.actualBounds.copy():x.ed(E.actualBounds));return x===null?new Be(NaN,NaN,0,0):x};function Rl(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=At.alloc(),x.xi(a.documentBounds,a.initialDocumentSpot);var E=a.viewportBounds;E=Be.allocAt(0,0,E.width,E.height);var b=At.alloc();b.xi(E,a.initialViewportSpot),b.h(x.x-b.x,x.y-b.y),a.position=b,Be.free(E),At.free(b),At.free(x)}x=a.yh,y&&a.Fg!==hs&&(x=a.Fg);var z=x!==hs?jd(a,x):a.scale;x=a.pa.x,E=a.pa.y,b=a.Aa/z;var tt=a.ya/z,rt=a.zk,ot=a.pq;y&&!rt.sb()&&(ot.sb()||ot.Xb())&&(rt=ot.Xb()?lr:ot),Eg(a,a.documentBounds,b,tt,rt,y),y=a.scale,a.scale=z,a.vb=!1,z=a.viewportBounds,_t.B(z.x,x)&&_t.B(z.y,E)&&_t.B(z.width,b)&&_t.B(z.height,tt)||a.onViewportBoundsChanged(new Be(x,E,b,tt),z,y,!1)}}function jd(a,y){var x=a.Pp;if(a.ta===null)return x;a.Va();var E=a.documentBounds;if(!E.w())return x;var b=E.width;E=E.height;var z=a.Aa+(a.gf?a.Db:0),tt=a.ya+(a.Be?a.Db:0),rt=z/b,ot=tt/E;return y===cl?(y=Math.min(ot,rt),y>x&&(y=x),y<a.minScale&&(y=a.minScale),y>a.maxScale&&(y=a.maxScale),y):y===hd?(y=ot>rt?(tt-a.Db)/E:(z-a.Db)/b,y>x&&(y=x),y<a.minScale&&(y=a.minScale),y>a.maxScale&&(y=a.maxScale),y):a.scale}ke.prototype.zoomToFit=function(){var a=this.sj;this.sj=bh,this.scale=jd(this,cl),a!==bh&&(Rl(this,!1),Eg(this,this.documentBounds,this.Aa/this.Ca,this.ya/this.Ca,this.zk,!1)),this.sj=a},wt=ke.prototype,wt.BA=function(a,y){y===void 0&&(y=cl);var x=a.width,E=a.height;if(!(x===0||E===0||isNaN(x)&&isNaN(E))){var b=1;if(y===cl||y===hd)if(isNaN(x))b=this.viewportBounds.height*this.scale/E;else if(isNaN(E))b=this.viewportBounds.width*this.scale/x;else{b=this.Aa;var z=this.ya;b=y===hd?z/E>b/x?(z-(this.Be?this.Db:0))/E:(b-(this.gf?this.Db:0))/x:Math.min(z/E,b/x)}this.scale=b,this.position=new At(a.x,a.y)}},wt.Jy=function(a,y){this.Va();var x=this.documentBounds,E=this.viewportBounds;this.position=new At(x.x+(a.x*x.width+a.offsetX)-(y.x*E.width-y.offsetX),x.y+(a.y*x.height+a.offsetY)-(y.y*E.height-y.offsetY))},wt.zz=function(a){if(a instanceof ge){this.eq=a;var y=At.alloc();this.fq=this.op(a.ga(_r,y)),At.free(y)}else this.eq=null,this.fq=li};function Eg(a,y,x,E,b,z){var tt=At.allocAt(a.pa.x,a.pa.y),rt=tt.x,ot=tt.y;if(a.eq!==null){var lt=At.alloc();lt=a.eq.ga(_r,lt),rt=lt.x-a.fq.x/a.scale,ot=lt.y-a.fq.y/a.scale,b=ar,At.free(lt)}(z||a.scrollMode===bh)&&(b.sb()&&(x>y.width&&(rt=y.x+(b.x*y.width+b.offsetX)-(b.x*x-b.offsetX)),E>y.height&&(ot=y.y+(b.y*y.height+b.offsetY)-(b.y*E-b.offsetY))),b=a.rj,z=x-y.width,x<y.width+b.left+b.right?(rt=Math.min(rt+x/2,y.right+Math.max(z,b.right)-x/2),rt=Math.max(rt,y.left-Math.max(z,b.left)+x/2),rt-=x/2):rt>y.left?rt=y.left:rt<y.right-x&&(rt=y.right-x),x=E-y.height,E<y.height+b.top+b.bottom?(ot=Math.min(ot+E/2,y.bottom+Math.max(x,b.bottom)-E/2),ot=Math.max(ot,y.top-Math.max(x,b.top)+E/2),ot-=E/2):ot>y.top?ot=y.top:ot<y.bottom-E&&(ot=y.bottom-E)),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),Wp(a.Yd,a.pa,tt),a.pa.h(tt.x,tt.y),Nu(a),At.free(tt)}wt.Ol=function(a,y){if(y===void 0&&(y=!0),y){if(a=Gu(this,a,function(x){return x.part},function(x){return x.canSelect()}),a instanceof Bi)return a}else if(a=Gu(this,a,function(x){return x.part}),a instanceof Bi)return a;return null},wt.ic=function(a,y,x){y===void 0&&(y=null),x===void 0&&(x=null),es(this);for(var E=this.Wa.iteratorBackwards;E.next();){var b=E.value;if(b.visible&&(b=b.ic(a,y,x),b!==null))return b}return null};function Gu(a,y,x,E){for(x===void 0&&(x=null),E===void 0&&(E=null),es(a),a=a.Wa.iteratorBackwards;a.next();){var b=a.value;if(b.visible&&!b.isTemporary&&(b=b.ic(y,x,E),b!==null))return b}return null}wt.lz=function(a,y,x){return y===void 0&&(y=!0),Fc(this,a,function(E){return E.part},y?function(E){return E instanceof Bi&&E.canSelect()}:null,x)};function Fc(a,y,x,E,b){for(x===void 0&&(x=null),E===void 0&&(E=null),b instanceof fn||b instanceof pn||(b=new pn),es(a),a=a.Wa.iteratorBackwards;a.next();){var z=a.value;z.visible&&!z.isTemporary&&z.ji(y,x,E,b)}return b}wt.ji=function(a,y,x,E){y===void 0&&(y=null),x===void 0&&(x=null),E instanceof fn||E instanceof pn||(E=new pn),es(this);for(var b=this.Wa.iteratorBackwards;b.next();){var z=b.value;z.visible&&z.ji(a,y,x,E)}return E},wt.ux=function(a,y,x,E){return y===void 0&&(y=!1),x===void 0&&(x=!0),mf(this,a,function(b){return b instanceof Bi&&(!x||b.canSelect())},y,E)},wt.Cf=function(a,y,x,E,b){y===void 0&&(y=null),x===void 0&&(x=null),E===void 0&&(E=!1),b instanceof fn||b instanceof pn||(b=new pn),es(this);for(var z=this.Wa.iteratorBackwards;z.next();){var tt=z.value;tt.visible&&tt.Cf(a,y,x,E,b)}return b},wt.Nu=function(a,y,x,E,b,z){var tt=new pn;es(this);for(var rt=this.Wa.iteratorBackwards;rt.next();){var ot=rt.value;ot.visible&&ot.Nu(a,y,x,E,tt,b,z)}return tt};function mf(a,y,x,E,b){var z=null;for(z===void 0&&(z=null),x===void 0&&(x=null),E===void 0&&(E=!1),b instanceof fn||b instanceof pn||(b=new pn),es(a),a=a.Wa.iteratorBackwards;a.next();){var tt=a.value;tt.visible&&!tt.isTemporary&&tt.Cf(y,z,x,E,b)}return b}wt.mz=function(a,y,x,E,b){return x===void 0&&(x=!0),E===void 0&&(E=!0),Mc(this,a,y,function(z){return z instanceof Bi&&(!E||z.canSelect())},x,b)},wt.og=function(a,y,x,E,b,z){x===void 0&&(x=null),E===void 0&&(E=null),b===void 0&&(b=!0),b!==!1&&b!==!0&&((b instanceof fn||b instanceof pn)&&(z=b),b=!0),z instanceof fn||z instanceof pn||(z=new pn),es(this);for(var tt=this.Wa.iteratorBackwards;tt.next();){var rt=tt.value;rt.visible&&rt.og(a,y,x,E,b,z)}return z};function Mc(a,y,x,E,b,z){var tt=null;for(tt===void 0&&(tt=null),E===void 0&&(E=null),b===void 0&&(b=!0),b!==!1&&b!==!0&&((b instanceof fn||b instanceof pn)&&(z=b),b=!0),z instanceof fn||z instanceof pn||(z=new pn),es(a),a=a.Wa.iteratorBackwards;a.next();){var rt=a.value;rt.visible&&!rt.isTemporary&&rt.og(y,x,tt,E,b,z)}return z}ke.prototype.acceptEvent=function(a){return Pl(this,a,a instanceof MouseEvent)};function Pl(a,y,x){var E=a.Qg;return a.Qg=a.cj,a.cj=E,E.diagram=a,E.event=y,x?zd(a,y,E):(E.viewPoint=a.Qg.viewPoint,E.documentPoint=a.Qg.documentPoint),a=0,y.ctrlKey&&(a+=1),y.altKey&&(a+=2),y.shiftKey&&(a+=4),y.metaKey&&(a+=8),E.modifiers=a,E.button=y.button,y.buttons!==void 0&&(E.buttons=y.buttons),yr&&y.button===0&&y.ctrlKey&&(E.button=2),E.down=!1,E.up=!1,E.clickCount=1,E.delta=0,E.handled=!1,E.bubbles=!1,E.timestamp=y.timeStamp,E.isMultiTouch=!1,E.targetDiagram=Lg(y,y.target),E.targetObject=null,E}function Lg(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 Fg(a,y,x,E,b,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,yr&&y.button===0&&y.ctrlKey&&(tt.button=2),tt.down=x,tt.up=E,tt.handled=!1,tt.bubbles=b,tt.isMultiTouch=z,tt}function tu(a,y){return a.bubbles?!0:(y.stopPropagation!==void 0&&y.stopPropagation(),y.cancelable!==!1&&y.preventDefault(),y.cancelBubble=!0,!1)}ke.prototype.Qz=function(a){var y=this.H;if(!this.H.isEnabled)return!1;var x=Pl(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(),tu(x,a)},ke.prototype.Rz=function(a){var y=this.H;if(!y.isEnabled)return!1;var x=Pl(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(),tu(x,a)},ke.prototype.bz=function(a){var y=this.H;if(!y.isEnabled)return!1;var x=Pl(y,a,!0);return y.mouseEnter!==null&&y.mouseEnter(x),y.currentTool.standardMouseOver(),tu(x,a)},ke.prototype.cz=function(a){var y=this.H;if(!y.isEnabled)return!1;var x=Pl(y,a,!0);return y.mouseLeave!==null&&y.mouseLeave(x),tu(x,a)},ke.prototype.getMouse=function(a){var y=this.ta;if(y===null)return new At(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?Dn(new At(y,a),this.Ab):new At(y,a)};function zd(a,y,x){var E=a.ta,b=a.Aa,z=a.ya,tt=0,rt=0;E!==null&&(E=E.getBoundingClientRect(),tt=y.clientX-b/E.width*E.left,rt=y.clientY-z/E.height*E.top),x.viewPoint.h(tt,rt),a.Ab!==null?(y=At.allocAt(tt,rt),a.Ab.Cd(y),x.documentPoint.assign(y),At.free(y)):x.documentPoint.h(tt,rt)}function Mg(a,y,x){if(a.oj[0]!==null){y=a.oj[y];var E=a.ta;E!==null&&(E=E.getBoundingClientRect(),x.h(y.clientX-a.Aa/E.width*E.left,y.clientY-a.ya/E.height*E.top))}}ke.prototype.Ya=function(){this.Zi||(this.Zi=!0,this.$b(!1))};function em(a){a.ld||es(a),a.Va()}ke.prototype.redraw=function(){this.vb||this.ld||(this.N(),this.bd())},wt=ke.prototype,wt.Pz=function(){return this.kg},wt.Xy=function(a){a===void 0&&(a=null);var y=this.animationManager,x=y.isEnabled;y.Cc(),y.isEnabled=!1,wl(this),this.hf=!1,this.du=new At(NaN,NaN),y.isEnabled=x,this.ld=!0;var E=this;a!==null&&Ei(function(){E.ld=!1,zu(y,"Model"),a(E)},1)},wt.$b=function(a){if(a===void 0&&(a=!1),this.kg!==!0&&!(this.vb||a===!1&&this.ld)){this.kg=!0;var y=this;Je.requestAnimationFrame(function(){y.kg&&y.bd()})}},wt.bd=function(){(!this.fn||this.kg)&&(this.fn&&(this.fn=!1),wl(this))};function od(a,y,x){!a.Ee||a.vb||a.animationManager.defaultAnimation.isAnimating||Hd(a)||(y&&es(a),x&&Rl(a,!1))}function wl(a,y){if(!a.ld&&(a.kg=!1,a.Ka!==null||a.wo.w())){a.ld=!0;var x=a.animationManager,E=a.Xn;if(!x.isAnimating&&E.length!==0){for(var b=E.s,z=b.length,tt=0;tt<z;tt++){var rt=b[tt];ya(rt,!1),rt.v()}E.clear()}E=a.ow,0<E.count&&(E.each(function(ot){ot.Nv()}),E.clear()),b=E=!1,x.defaultAnimation.isAnimating&&(b=!0,E=a.skipsUndoManager,a.skipsUndoManager=!0),x.zb||wg(a),od(a,!1,!0),a.fe!==null&&(a.fe.visible&&!a.mq&&(bu(a),a.mq=!0),!a.fe.visible&&a.mq&&(a.mq=!1)),es(a),z=!1,(!a.hf||a.xh)&&(a.hf?_g(a,!a.Jk):(a.Ea("Initial Layout"),x.isEnabled===!1&&x.Cc(),_g(a,!1)),z=!0),a.Jk=!1,es(a),a.ou||em(a),od(a,!0,!1),tt=!1,z?(x=Be.alloc(),x.assign(a.viewportBounds),a.hf||(tt=a.hf=!0,a.skipsUndoManager||(a.undoManager.isPendingClear=!0),a.undoManager.isPendingUnmodified=!0,kg(a)),a.R("LayoutCompleted"),od(a,!0,!1),Be.free(x)):x.Ok&&x.Qw&&(a.Fg!==hs?a.scale=jd(a,a.Fg):a.yh!==hs?a.scale=jd(a,a.yh):(x=a.initialScale,isFinite(x)&&0<x&&(a.scale=x)),Rl(a,!0)),z&&tt&&a.eb("Initial Layout"),es(a),y||a.gc(a.ib),b&&(a.skipsUndoManager=E),a.ld=!1}}function kg(a){if(a.Fg!==hs)a.scale=jd(a,a.Fg);else if(a.yh!==hs)a.scale=jd(a,a.yh);else{var y=a.initialScale;isFinite(y)&&0<y&&(a.scale=y)}Rl(a,!0),y=a.Wa.s,a.Fd(y,y.length,a,a.viewportBounds),a.R("InitialLayoutCompleted"),a.du.assign(a.pa),bu(a)}function es(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 pn,a.Nv(x,a.De)}a.nodes.each(function(E){E instanceof er&&E.U&65536&&(E.U=E.U^65536)})}}wt.Nv=function(a,y){for(a.reset();a.next();){var x=a.value;!x.Zc()||x instanceof er||(x.si()?(x.measure(1/0,1/0),x.arrange()):y.add(x))}for(a.reset();a.next();)x=a.value,x instanceof er&&x.isVisible()&&kc(this,x);for(a.reset();a.next();)x=a.value,x instanceof Nn&&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 Qr&&x.isVisible()&&(x.si()?(x.measure(1/0,1/0),x.arrange()):y.add(x))};function kc(a,y){for(var x=Yn(),E=Yn(),b=y.memberParts;b.next();){var z=b.value;z.isVisible()&&(z instanceof er?(gl(z)||ws(z)||cd(z))&&kc(a,z):z instanceof Nn?z.fromNode===y||z.toNode===y?E.push(z):x.push(z):(z.measure(1/0,1/0),z.arrange()))}for(a=x.length,b=0;b<a;b++)z=x[b],z.measure(1/0,1/0),z.arrange();for(si(x),y.measure(1/0,1/0),y.arrange(),a=E.length,y=0;y<a;y++)x=E[y],x.measure(1/0,1/0),x.arrange();si(E)}wt.Fd=function(a,y,x,E){if(this.vd||this.animationManager.isAnimating)for(var b=0;b<y;b++)a[b].Fd(x,E)},wt.gc=function(a){if(this.Ka!==null){if(this.ta===null&&Gt("No canvas specified"),this.nl==="svg"){if(this.Ka!==null){var y=this.animationManager;if(!y.zb&&(!y.isAnimating||y.isTicking)){Gd(this);var x=this.Aa,E=this.ya;if(a.Gv.resize(x,E,x,E),x=this.Wa.s,E=x.length,this.Fd(x,E,this,this.viewportBounds),this.Fc||y.isAnimating){y=this.pa;var b=this.Ca,z=Math.round(y.x*b)/b,tt=Math.round(y.y*b)/b,rt=this.Ab;for(rt.reset(),b!==1&&rt.scale(b),y.x===0&&y.y===0||rt.translate(-z,-tt),a.ti=null,Yy(a,rt.m11,rt.m12,rt.m21,rt.m22,rt.dx,rt.dy),this.pb!==1&&(a.globalAlpha=this.pb),Mh(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<E;y++)x[y].gc(a,this);a=!1,this.Yf?Yd(this.Yf,this)&&(a=this.Vp()):a=!0,a&&(ae.prototype.Cd=ae.prototype.Eu),this.Fc=this.vd=!1}}}}else t:if(z=this.animationManager,!z.zb&&(!z.isAnimating||z.isTicking)&&(x=new Date,Gd(this),this.Ka.style.opacity!=="0")){if(E=a!==this.ib,y=this.Wa.s,b=y.length,this.Fd(y,b,this,this.viewportBounds),E)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,lt=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(-lt,-ut),a.setTransform(tt,0,0,tt,0,0),a.clearRect(0,0,this.Aa,this.ya),this.pb!==1&&(a.globalAlpha=this.pb),Mh(this,a),rt=0;rt<b;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?Yd(this.Yf,this)&&(y=this.Vp()):y=!0,y&&(ae.prototype.Cd=ae.prototype.Eu),E?(this.ib.Vc(!0),this.vd=!0):this.Fc=this.vd=!1,y=+new Date-+x,E=_i&&_i.nx,x=this.zw,E||this.Yh===null){for(x[this.Tq]=y,this.Tq=(this.Tq+1)%x.length,b=y=0;b<x.length;b++)y+=x[b];this.Sq=y/x.length}if(this.pb!==1&&(a.globalAlpha=1),E)for(a.setTransform(1,0,0,1,0,0),E=0;E<x.length;E++)a.fillText(x[E].toString(),20,150+ +(20*E))}}};function vf(a,y,x,E,b,z,tt,rt,ot,lt){if(a.Ka!==null){a.ta===null&&Gt("No canvas specified"),tt===void 0&&(tt=null),rt===void 0&&(rt=null),ot===void 0&&(ot=!1),lt===void 0&&(lt=!1),Gd(a),a.ib.Vc(!0),a.vd=!0,a.$i=!0;var ut=a.Ca;a.Ca=b;var ft=a.Wa.s,yt=ft.length;try{var xt=new Be(z.x,z.y,E.width/b,E.height/b),Ct=xt.copy();Ct.Co(x),bu(a,Ct),es(a),a.Fd(ft,yt,a,xt),y.setTransform(1,0,0,1,0,0),y.clearRect(0,0,E.width,E.height),rt!==null&&rt!==""&&(y.fillStyle=rt,y.ox(0,0,E.width,E.height));var bt=a.Mb;y.scale(bt,bt);var Vt=ae.alloc();Vt.reset(),Vt.translate(x.left,x.top),Vt.scale(b),z.x===0&&z.y===0||Vt.translate(-z.x,-z.y),y.setTransform(Vt.m11,Vt.m12,Vt.m21,Vt.m22,Vt.dx,Vt.dy),y.yc(),y instanceof tl&&Yy(y,Vt.m11,Vt.m12,Vt.m21,Vt.m22,Vt.dx,Vt.dy),ae.free(Vt),Mh(a,y),y.globalAlpha=a.pb;var zt=a.Qj("Grid");if(tt){var Qt=new pn,ee=tt.iterator;for(ee.reset();ee.next();){var oe=ee.value;oe instanceof Bi&&(lt||oe.layer!==zt)&&(oe.Gj(),Qt.add(oe))}for(lt=0;lt<yt;lt++)Up(ft[lt],y,a,Qt,ot);Qt.each(function(Me){return Me.Gj()})}else for(Qt=0;Qt<yt;Qt++){var ce=ft[Qt];ce===zt?lt&&ce.gc(y,a,!0):ce.gc(y,a,ot)}a.$i=!1,a.Yf&&Yd(a.Yf,a)&&a.Vp()}finally{a.Ca=ut,a.ib.Vc(!0),a.vd=!0,a.Fd(ft,yt,a,a.viewportBounds),bu(a),a.ib instanceof tl&&(a.ib.Nj.PA(),a.redraw())}}}wt.Gf=function(a){return this.Rg[a]},wt.Xx=function(a,y){a==="minDrawingLength"&&(this.Oq=y),this.Rg[a]=y,this.redraw()},wt.Tx=function(){this.Rg=new Mi,this.Rg.drawShadows=!0,this.Rg.textGreeking=!0,this.Rg.viewportOptimizations=!(yr||gr),this.Rg.temporaryPixelRatio=!0,this.Rg.pictureRatioOptimization=!0,this.Oq=this.Rg.minDrawingLength=1};function Mh(a,y){a=a.Rg,a!==null&&(a.imageSmoothingEnabled!==void 0&&y.Wx(!!a.imageSmoothingEnabled),a=a.defaultFont,a!=null&&(y.font=a))}wt.Ql=function(a){return this.on[a]},wt.sA=function(a,y){this.on[a]=y},wt.Sx=function(){this.on=new Mi,this.on.extraTouchArea=10,this.on.extraTouchThreshold=10,this.on.hasGestureZoom=!0},wt.set=function(a){return Object.assign(this,a),this},wt.Du=function(a){return this.nm(a)},wt.nm=function(a){return Zd(this,a),this};function Zd(a,y){var x=a instanceof wn,E=a instanceof ke,b;for(b in y){b===""&&Gt("Setting properties requires non-empty property names");var z=a,tt=b;if(x||E){var rt=b.indexOf(".");if(0<rt){var ot=b.substring(0,rt);x?z=a.fb(ot):(z=a[ot],z==null&&(z=a.toolManager[ot])),Ie(z)?tt=b.substr(rt+1):Gt("Unable to find object named: "+ot+" in "+a.toString()+" when trying to set property: "+b)}}if(tt[0]!=="_"&&!Ti(z,tt))if(E&&tt==="ModelChanged"){a.Yw(y[tt]);continue}else if(E&&tt==="Changed"){a.Pe(y[tt]);continue}else if(E&&Ti(a.toolManager,tt))z=a.toolManager;else if(E&&rm(a,tt)){a.Bj(tt,y[tt]);continue}else if(a instanceof wi&&tt==="Changed"){a.Pe(y[tt]);continue}else Gt('Trying to set undefined property "'+tt+'" on object: '+z.toString());z[tt]=y[b],tt[0]==="_"&&z instanceof ge&&z.Vw(tt)}}wt.bx=function(){if(this.Eh.count!==0&&!(1<this.undoManager.transactionLevel)){for(;0<this.Eh.count;){var a=this.Eh;for(this.Eh=new be,a=a.iterator;a.next();){var y=a.key;y.Xo(a.value),y.qc()}}this.N()}},wt.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")},ke.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!==Bc&&this.rj.hi(0,0,0,0)&&y.width===a.width&&y.height===a.height){var E=this.scale,b=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))*E&&0<Math.max(0,z-b)*E){if(!(this.ld||(this.kg=!1,this.Ka===null||(this.ld=!0,this.documentBounds.w()||(E=Be.alloc(),Ig(this,this.computeBounds(E)),Be.free(E)),E=this.ta,E===null||E instanceof Bu)))){var tt=this.Mb;b=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!==b&&(ot.width=b),ot.height!==rt&&(ot.height=rt),a.clearRect(0,0,b,rt),ot=190*tt;var lt=70*tt,ut=Math.max(z,0),ft=Math.max(y,0),yt=Math.floor(b-ut),xt=Math.floor(rt-ft);a.drawImage(E.Oa,ut,ft,yt,xt,0,0,yt,xt),Yd(this.Yf,this)&&a.clearRect(0,0,ot,lt),E=Yn(),a=Yn(),xt=Math.abs(z),yt=Math.abs(y);var Ct=ut===0?0:b-xt;ut=At.allocAt(Ct,0),xt=At.allocAt(xt+Ct,rt),a.push(new Be(Math.min(ut.x,xt.x),Math.min(ut.y,xt.y),Math.abs(ut.x-xt.x),Math.abs(ut.y-xt.y)));var bt=this.Ab;if(bt.reset(),bt.scale(tt,tt),this.Ca!==1&&bt.scale(this.Ca),tt=this.pa,(tt.x!==0||tt.y!==0)&&isFinite(tt.x)&&isFinite(tt.y)&&bt.translate(-tt.x,-tt.y),Dn(ut,bt),Dn(xt,bt),E.push(new Be(Math.min(ut.x,xt.x),Math.min(ut.y,xt.y),Math.abs(ut.x-xt.x),Math.abs(ut.y-xt.y))),Ct=ft===0?0:rt-yt,ut.h(0,Ct),xt.h(b,yt+Ct),a.push(new Be(Math.min(ut.x,xt.x),Math.min(ut.y,xt.y),Math.abs(ut.x-xt.x),Math.abs(ut.y-xt.y))),Dn(ut,bt),Dn(xt,bt),E.push(new Be(Math.min(ut.x,xt.x),Math.min(ut.y,xt.y),Math.abs(ut.x-xt.x),Math.abs(ut.y-xt.y))),Yd(this.Yf,this)&&(b=0<z?0:-z,rt=0<y?0:-y,ut.h(b,rt),xt.h(ot+b,lt+rt),a.push(new Be(Math.min(ut.x,xt.x),Math.min(ut.y,xt.y),Math.abs(ut.x-xt.x),Math.abs(ut.y-xt.y))),Dn(ut,bt),Dn(xt,bt),E.push(new Be(Math.min(ut.x,xt.x),Math.min(ut.y,xt.y),Math.abs(ut.x-xt.x),Math.abs(ut.y-xt.y)))),At.free(ut),At.free(xt),od(this,!1,!0),this.Ka===null&&Gt("No div specified"),this.ta===null&&Gt("No canvas specified"),!this.animationManager.zb&&(b=this.ib,this.Fc)){for(Gd(this),rt=this.Mb,b.setTransform(1,0,0,1,0,0),b.clearRect(0,0,this.Aa*rt,this.ya*rt),b.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,lt=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,-lt),b.save(),b.beginPath(),z=a.length,tt=0;tt<z;tt++)ot=a[tt],ot.width!==0&&ot.height!==0&&b.rect(Math.floor(ot.x),Math.floor(ot.y),Math.ceil(ot.width),Math.ceil(ot.height));for(b.clip(),b.setTransform(rt,0,0,rt,0,0),b.transform(y.m11,y.m12,y.m21,y.m22,y.dx,y.dy),b.yc(),y=this.Wa.s,z=y.length,this.Fd(y,z,this,this.viewportBounds),Mh(this,b),b.globalAlpha=this.pb,rt=0;rt<z;rt++)if(tt=y[rt],ot=E,tt.visible&&tt.pb!==0){lt=sh(tt,b),ft=tt.Zq,ft.length=0,ut=this.scale,yt=Be.alloc(),xt=tt.Pa.s,bt=xt.length,Ct=ot.length;for(var Vt=0;Vt<bt;Vt++){var zt=xt[Vt],Qt=ec(zt,zt.actualBounds);t:{for(var ee=2/ut,oe=4/ut,ce=0;ce<Ct;ce++){var Me=ot[ce];if(Me.width!==0&&Me.height!==0&&Qt.Vu(Me.x-ee,Me.y-ee,Me.width+oe,Me.height+oe)){Qt=!0;break t}}Qt=!1}Qt&&tt.Oj(b,zt,this,ft,ut,yt,!0)}Be.free(yt),b.globalAlpha=lt}b.restore(),b.Vc(!0),this.Yf&&Yd(this.Yf,this)&&this.Vp(),this.Fc=this.vd=!1,this.hk()}si(E),si(a),this.ld=!1}}else this.bd();x&&(Ts(this),this.bd(),Lc(this,!0))}else x?(Ts(this),this.bd(),Lc(this,!0)):this.bd()}};function Gd(a){a.pn!==!1&&(a.pn=!1,bg(a,a.Aa,a.ya))}function bg(a,y,x){Nu(a);var E=a.Mb;a.ta.resize(y*E,x*E,y,x)&&(a.Fc=!0,a.ib.Vc(!0))}function Hd(a){var y=a.ta;if(y===null||a.wo.w())return!0;var x=a.Aa,E=a.ya,b=a.Ka,z=!1,tt=a.gf?a.Db:0,rt=a.Be?a.Db:0,ot=b.clientWidth||x+tt,lt=b.clientHeight||E+rt,ut=a.viewportBounds;b=ut.x;var ft=ut.y,yt=ut.width,xt=ut.height;if((ot!==x+tt||lt!==E+rt)&&(a.gf=!1,a.Be=!1,rt=tt=0,a.Aa=ot,a.ya=lt,z=a.pn=!0,Nu(a)),!a.hf||!a.viewportBounds.w())return!0;var Ct=a.ku,bt=a.hu;if(a.Ee=!1,!(z||a.gf||a.Be||a.mn||a.nn))return!0;var Vt=a.documentBounds,zt=0,Qt=0,ee=0,oe=0,ce=ut.width,Me=ut.height,Wn=a.rj;a.contentAlignment.sb()?(Vt.width>ce&&(zt=Wn.left,Qt=Wn.right),Vt.height>Me&&(ee=Wn.top,oe=Wn.bottom)):(zt=Wn.left,Qt=Wn.right,ee=Wn.top,oe=Wn.bottom);var di=Vt.width+zt+Qt,oi=Vt.height+ee+oe;Wn=a.scale;var kn=di>ot/Wn,en=oi>lt/Wn;if(!(z||a.gf||a.Be||kn||en))return!0;zt=Vt.x-zt,ot=ut.x,Qt=Vt.right+Qt,lt=ut.right+tt,ee=Vt.y-ee;var qi=ut.y;Vt=Vt.bottom+oe,ut=ut.bottom+rt;var Yi="1px";if(oe="1px",a.scrollMode===bh&&(kn||en)&&(kn&&a.hasHorizontalScrollbar&&a.allowHorizontalScroll&&(kn=1,zt+1<ot&&(kn=Math.max((ot-zt)*Wn+a.Aa,kn)),Qt>lt+1&&(kn=Math.max((Qt-lt)*Wn+a.Aa,kn)),ce+tt+1<di&&(kn=Math.max((di-ce)*Wn+a.Aa,kn)),Yi=kn.toString()+"px"),en&&a.hasVerticalScrollbar&&a.allowVerticalScroll&&(kn=1,ee+1<qi&&(kn=Math.max((qi-ee)*Wn+a.ya,kn)),Vt>ut+1&&(kn=Math.max((Vt-ut)*Wn+a.ya,kn)),Me+rt+1<oi&&(kn=Math.max((oi-Me)*Wn+a.ya,kn)),oe=kn.toString()+"px")),kn=Yi!=="1px",en=oe!=="1px",kn&&en||!kn&&!en||(en&&(lt-=a.Db),kn&&(ut-=a.Db),di<ce+tt||!a.hasHorizontalScrollbar||!a.allowHorizontalScroll||(tt=1,zt+1<ot&&(tt=Math.max((ot-zt)*Wn+a.Aa,tt)),Qt>lt+1&&(tt=Math.max((Qt-lt)*Wn+a.Aa,tt)),ce+1<di&&(tt=Math.max((di-ce)*Wn+a.Aa,tt)),Yi=tt.toString()+"px"),kn=Yi!=="1px",tt=a.ya,kn!==a.Be&&(tt=kn?a.ya-a.Db:a.ya+a.Db),oi<Me+rt||!a.hasVerticalScrollbar||!a.allowVerticalScroll||(rt=1,ee+1<qi&&(rt=Math.max((qi-ee)*Wn+tt,rt)),Vt>ut+1&&(rt=Math.max((Vt-ut)*Wn+tt,rt)),Me+1<oi&&(rt=Math.max((oi-Me)*Wn+tt,rt)),oe=rt.toString()+"px"),en=oe!=="1px"),a.qr&&kn===a.Be&&en===a.gf)return x===a.Aa&&E===a.ya||a.bd(),!1;if(kn!==a.Be&&(Yi==="1px"?a.ya=a.ya+a.Db:a.ya=Math.max(a.ya-a.Db,1),z=!0),a.Be=kn,bt.style.width=Yi,en!==a.gf&&(oe==="1px"?a.Aa=a.Aa+a.Db:a.Aa=Math.max(a.Aa-a.Db,1),z=!0,a.tn&&(rt=At.alloc(),en?(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)),At.free(rt))),z&&Nu(a),a.gf=en,bt.style.height=oe,a.gu=!0,z&&(a.pn=!0),y=Ct.scrollLeft,a.hasHorizontalScrollbar&&a.allowHorizontalScroll&&(ce+1<di?y=(a.position.x-zt)*Wn:zt+1<ot?y=Ct.scrollWidth-Ct.clientWidth:Qt>lt+1&&(y=a.position.x*Wn)),a.tn)switch(a.bu){case"negative":y=-(Ct.scrollWidth-y-Ct.clientWidth);break;case"reverse":y=Ct.scrollWidth-y-Ct.clientWidth}return Ct.scrollLeft=y,a.hasVerticalScrollbar&&a.allowVerticalScroll&&(Me+1<oi?Ct.scrollTop=(a.position.y-ee)*Wn:ee+1<qi?Ct.scrollTop=Ct.scrollHeight-Ct.clientHeight:Vt>ut+1&&(Ct.scrollTop=a.position.y*Wn)),ot=a.Aa,lt=a.ya,Ct.style.width=ot+(a.gf?a.Db:0)+"px",Ct.style.height=lt+(a.Be?a.Db:0)+"px",x!==ot||E!==lt||a.animationManager.zb?(x=Be.allocAt(b,ft,yt,xt),a.onViewportBoundsChanged(x,a.viewportBounds,Wn,z),Be.free(x),!1):!0}wt=ke.prototype,wt.add=function(a){var y=a.diagram;if(y!==this&&(y!==null&&Gt("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&&Gt('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(ro,"parts",y,null,a,null,x),y.isTemporary||this.Ya(),a.C(1),x=a.layerChanged,x!==null&&x(a,null,y)}},wt.oi=function(a){this.partManager.oi(a);var y=this;$d(a,function(x){Wd(y,x)}),(a instanceof Qr||a instanceof er&&a.placeholder!==null)&&a.v(),a.data!==null&&$d(a,function(x){sy(y.partManager,x)}),ws(a)!==!0&&cd(a)!==!0||this.De.add(a),_1(a,!0,this),j1(a)?(a.actualBounds.w()&&this.N(ec(a,a.actualBounds)),this.Ya()):a.isVisible()&&a.actualBounds.w()&&this.N(ec(a,a.actualBounds)),this.$b()},wt.pc=function(a){a.Ej(),this.partManager.pc(a);var y=this;a.data!==null&&$d(a,function(x){ly(y.partManager,x,y)}),this.De.remove(a),j1(a)?(a.actualBounds.w()&&this.N(ec(a,a.actualBounds)),this.Ya()):a.isVisible()&&a.actualBounds.w()&&this.N(ec(a,a.actualBounds)),this.$b()},wt.remove=function(a){Ng(this,a,!0)};function Ng(a,y,x){var E=y.layer;E!==null&&E.diagram===a&&(y.isSelected=!1,y.isHighlighted=!1,y.C(2),x&&y.Lj(),x=E.pc(-1,y,!1),0<=x&&a.cb(So,"parts",E,y,null,x,null),a=y.layerChanged,a!==null&&a(y,E,null))}wt.Is=function(a,y){if(y===void 0&&(y=!1),$e(a))for(var x=a.length,E=0;E<x;E++){var b=a[E];y&&!b.canDelete()||this.remove(b)}else for(x=new pn,x.addAll(a),a=x.iterator;a.next();)x=a.value,y&&!x.canDelete()||this.remove(x)},wt.Kj=function(a,y,x){return x===void 0&&(x=!1),this.partManager.Kj(a,y,x)},ke.prototype.moveParts=function(a,y,x,E){if(x===void 0&&(x=!1),E===void 0&&(E=yf(this)),this.toolManager!==null){var b=new be;if(a!==null)if($e(a))for(var z=0;z<a.length;z++)Hu(this,b,a[z],x,E);else for(a=a.iterator;a.next();)Hu(this,b,a.value,x,E);else{for(a=this.parts;a.next();)Hu(this,b,a.value,x,E);for(a=this.nodes;a.next();)Hu(this,b,a.value,x,E);for(a=this.links;a.next();)Hu(this,b,a.value,x,E)}ad(this,b,y,E,x)}};function Hu(a,y,x,E,b,z){if(!y.contains(x)&&(z===void 0&&(z=!1),!E||z||x.canMove()||x.canCopy()))if(b===void 0&&(b=yf(a)),x instanceof $n){if(y.add(x,a.Pd(b,x,x.location)),x instanceof er&&(x.placeholder!==null||b.dragsMembers))for(z=x.memberParts;z.next();)Hu(a,y,z.value,E,b,b.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)&&Hu(a,y,tt,E,b)}}if(b.dragsTree)for(x=x.Ou();x.next();)Hu(a,y,x.value,E,b)}else if(x instanceof Nn)for(y.add(x,a.Pd(b,x)),x=x.labelNodes;x.next();)Hu(a,y,x.value,E,b);else x instanceof Qr||y.add(x,a.Pd(b,x,x.location))}function ad(a,y,x,E,b){if(y!==null&&y.count!==0){var z=At.alloc(),tt=At.alloc();tt.assign(x),isNaN(tt.x)&&(tt.x=0),isNaN(tt.y)&&(tt.y=0),(x=a.Mr)||xf(a,y);for(var rt=Yn(),ot=Yn(),lt=y.iterator,ut=At.alloc();lt.next();){var ft=lt.key,yt=lt.value;if(ft.Zc()){var xt=Bg(a,ft,y);xt!==null?rt.push(new it(ft,yt,xt)):(!b||ft.canMove())&&(xt=yt.point,z.assign(xt),a.computeMove(ft,z.add(tt),E,ut),ft.location=ut,yt.shifted===void 0&&(yt.shifted=new At),yt.shifted.assign(ut.re(xt)))}else lt.key instanceof Nn&&ot.push(lt.sa)}for(At.free(ut),b=rt.length,lt=0;lt<b;lt++)ft=rt[lt],z.assign(ft.info.point),ft.Su.shifted===void 0&&(ft.Su.shifted=new At),ft.node.location=z.add(ft.Su.shifted);for(b=At.alloc(),lt=At.alloc(),ft=ot.length,yt=0;yt<ft;yt++){var Ct=ot[yt];if(xt=Ct.key,xt instanceof Nn)if(xt.suspendsRouting){xt.Tg=null,ut=xt.fromNode;var bt=xt.toNode;if(a.draggedLink!==null&&E.dragsLink)if(bt=Ct.value.point,xt.dragComputation===null)y.add(xt,a.Pd(E,xt,tt)),_h(xt,tt.x-bt.x,tt.y-bt.y);else{Ct=At.allocAt(0,0),(ut=xt.i(0))&&ut.w()&&Ct.assign(ut);var Vt=ut=At.alloc().assign(Ct).add(tt);E.isGridSnapEnabled&&(E.isGridSnapRealtime||a.lastInput.up)&&(Vt=At.alloc(),Sf(a,xt,ut,Vt,E)),ut.assign(xt.dragComputation(xt,ut,Vt)).re(Ct),y.add(xt,a.Pd(E,xt,ut)),_h(xt,ut.x-bt.x,ut.y-bt.y),At.free(Ct),At.free(ut),Vt!==ut&&At.free(Vt)}else ut!==null&&(b.assign(ut.location),Vt=y.I(ut),Vt!==null&&b.re(Vt.point)),bt!==null&&(lt.assign(bt.location),Vt=y.I(bt),Vt!==null&<.re(Vt.point)),ut!==null&&bt!==null?b.Xa(lt)?(ut=Ct.value.point,bt=z,bt.assign(b),bt.re(ut),y.add(xt,a.Pd(E,xt,b)),_h(xt,bt.x,bt.y)):(xt.suspendsRouting=!1,xt.bb()):(Ct=Ct.value.point,ut=ut!==null?b:bt!==null?lt:tt,y.add(xt,a.Pd(E,xt,ut)),_h(xt,ut.x-Ct.x,ut.y-Ct.y))}else(xt.fromNode===null||xt.toNode===null)&&(ut=Ct.value.point,y.add(xt,a.Pd(E,xt,tt)),_h(xt,tt.x-ut.x,tt.y-ut.y))}At.free(z),At.free(tt),At.free(b),At.free(lt),si(rt),si(ot),x||(es(a),sd(a,y))}}ke.prototype.computeMove=function(a,y,x,E){if(E===void 0&&(E=new At),E.assign(y),a===null)return E;var b=y,z=x.isGridSnapEnabled;z&&(x.isGridSnapRealtime||this.lastInput.up)&&(b=At.alloc(),Sf(this,a,y,b,x)),x=a.dragComputation!==null?a.dragComputation(a,y,b):b;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,lt=ot.x;return isNaN(lt)&&(lt=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),E.h(Math.max(rt,Math.min(x.x,lt)),Math.max(tt,Math.min(x.y,ot))),b!==y&&At.free(b),E};function yf(a){var y=a.toolManager.findTool("Dragging");return y!==null?y.dragOptions:a.Wm}function Sf(a,y,x,E,b){if(b===void 0&&(b=yf(a)),E.assign(x),y!==null){var z=a.grid;y=b.gridSnapCellSize,a=y.width,y=y.height;var tt=b.gridSnapOrigin,rt=tt.x;if(tt=tt.y,b=b.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=At.allocAt(0,0),z.yi(0,0,a,y,b),_t.No(x.x,x.y,rt+z.x,tt+z.y,a,y,E),At.free(z)}}function xf(a,y){if(y!==null)for(a.Mr=!0,a=y.iterator;a.next();)y=a.key,y instanceof Nn&&(y.suspendsRouting=!0)}function sd(a,y){if(y!==null){for(y=y.iterator;y.next();){var x=y.key;x instanceof Nn&&(x.suspendsRouting=!1,Uv(x)&&x.bb())}a.Mr=!1}}function Bg(a,y,x){return y=y.containingGroup,y!==null&&(a=Bg(a,y,x),a!==null||(a=x.I(y),a!==null))?a:null}wt=ke.prototype,wt.Pd=function(a,y,x){if(x===void 0)return new lh(Zn);var E=a.isGridSnapEnabled;return a.groupsSnapMembers||y.containingGroup===null||(E=!1),E?new lh(new At(Math.round(1e3*x.x)/1e3,Math.round(1e3*x.y)/1e3)):new lh(x.copy())};function Ag(a,y,x){if(y.diagram!==null&&y.diagram!==a&&Gt("Cannot share a Layer with another Diagram: "+y+" of "+y.diagram),x===null?y.diagram!==null&&Gt("Cannot add an existing Layer to this Diagram again: "+y):(x.diagram!==a&&Gt("Existing Layer must be in this Diagram: "+x+" not in "+x.diagram),y===x&&Gt("Cannot move a Layer before or after itself: "+y)),y.diagram!==a){y=y.name,a=a.Wa,x=a.count;for(var E=0;E<x;E++)a.M(E).name===y&&Gt("Cannot add Layer with the name '"+y+"'; a Layer with the same name is already present in this Diagram.")}}wt.Al=function(a){Ag(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(ro,"layers",this,null,a,null,x+1),this.N(),this.Ya(),this},wt.Ww=function(a,y){Ag(this,a,y),a.Xe(this);var x=this.Wa,E=x.indexOf(a);0<=E&&(x.remove(a),this.cc!==null&&this.cb(So,"layers",this,a,null,E,null));var b=x.count,z;for(z=0;z<b;z++)if(x.M(z)===y){x.Gb(z,a);break}return this.cc!==null&&this.cb(ro,"layers",this,null,a,null,z),this.N(),0>E&&this.Ya(),this},wt.Cy=function(a,y){Ag(this,a,y),a.Xe(this);var x=this.Wa,E=x.indexOf(a);0<=E&&(x.remove(a),this.cc!==null&&this.cb(So,"layers",this,a,null,E,null));var b=x.count,z;for(z=0;z<b;z++)if(x.M(z)===y){x.Gb(z+1,a);break}return this.cc!==null&&this.cb(ro,"layers",this,null,a,null,z+1),this.N(),0>E&&this.Ya(),this},wt.kA=function(a){if(a.diagram!==this&&Gt("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 E=y.value,b=E.layerName;b!==a.name?E.layerName=b:E.layerName=""}this.cc!==null&&this.cb(So,"layers",this,a,null,x,null),this.N(),this.Ya()}}},wt.Qj=function(a){for(var y=this.layers;y.next();){var x=y.value;if(x.name===a)return x}return null},wt.Yw=function(a){return this.pf===null&&(this.pf=new fn),this.pf.add(a),this.model.Pe(a),this},wt.mA=function(a){this.pf!==null&&(this.pf.remove(a),this.pf.count===0&&(this.pf=null)),this.model.ik(a)},wt.Pe=function(a){return this.zg===null&&(this.zg=new fn),this.zg.add(a),this},wt.ik=function(a){this.zg!==null&&(this.zg.remove(a),this.zg.count===0&&(this.zg=null))},wt.ds=function(a){if(this.skipsUndoManager||this.model.skipsUndoManager||this.model.undoManager.Tu(a),a.change!==Qi&&(this.isModified=!0),this.zg!==null)for(var y=this.zg,x=y.length,E=0;E<x;E++)y.M(E)(a)},wt.cb=function(a,y,x,E,b,z,tt){z===void 0&&(z=null),tt===void 0&&(tt=null);var rt=new Li;rt.diagram=this,rt.change=a,rt.propertyName=y,rt.object=x,rt.oldValue=E,rt.oldParam=z,rt.newValue=b,rt.newParam=tt,this.ds(rt)},wt.g=function(a,y,x,E,b){this.cb(wr,a,this,y,x,E,b)},ke.prototype.changeState=function(a,y){if(a!==null&&a.diagram===this){var x=this.skipsModelSourceBindings;try{this.skipsModelSourceBindings=!0;var E=a.change;if(E===wr){var b=a.object;if(Vo(b,a.propertyName,a.I(y)),b instanceof ge){var z=b.part;z!==null&&z.Wb()}this.isModified=!0}else if(E===ro){var tt=a.object,rt=a.newParam,ot=a.newValue;if(tt instanceof wn)if(typeof rt=="number"&&ot instanceof ge){y?tt.pc(rt):tt.Gb(rt,ot);var lt=tt.part;lt!==null&<.Wb()}else typeof rt=="number"&&ot instanceof Sa&&(ot.isRow?h1(tt,rt,y?void 0:ot):d1(tt,rt,y?void 0:ot));else if(tt instanceof Ra){var ut=a.oldParam===!0;typeof rt=="number"&&ot instanceof Bi&&(y?(ot.isSelected=!1,ot.isHighlighted=!1,ot.Wb(),tt.pc(ut?rt:-1,ot,ut)):tt.oi(rt,ot,ut))}else tt instanceof ke?typeof rt=="number"&&ot instanceof Ra&&(y?this.Wa.mb(rt):(ot.Xe(this),this.Wa.Gb(rt,ot))):Gt("unknown ChangedEvent.Insert object: "+a.toString());this.isModified=!0}else if(E===So){var ft=a.object,yt=a.oldParam,xt=a.oldValue;if(ft instanceof wn)typeof yt=="number"&&xt instanceof ge?y?ft.Gb(yt,xt):ft.pc(yt):typeof yt=="number"&&xt instanceof Sa&&(xt.isRow?h1(ft,yt,y?xt:void 0):d1(ft,yt,y?xt:void 0));else if(ft instanceof Ra){var Ct=a.newParam===!0;typeof yt=="number"&&xt instanceof Bi&&(y?0>ft.Pa.indexOf(xt)&&ft.oi(yt,xt,Ct):(xt.isSelected=!1,xt.isHighlighted=!1,xt.Wb(),ft.pc(Ct?yt:-1,xt,Ct)))}else ft instanceof ke?typeof yt=="number"&&xt instanceof Ra&&(y?(xt.Xe(this),this.Wa.Gb(yt,xt)):this.Wa.mb(yt)):Gt("unknown ChangedEvent.Remove object: "+a.toString());this.isModified=!0}else E!==Qi&&Gt("unknown ChangedEvent: "+a.toString())}finally{this.skipsModelSourceBindings=x}}},ke.prototype.Ea=function(a){return this.undoManager.Ea(a)},ke.prototype.eb=function(a){return this.undoManager.eb(a)},ke.prototype.Kf=function(){return this.undoManager.Kf()},ke.prototype.commit=function(a,y){y===void 0&&(y="");var x=this.skipsUndoManager;y===null&&(this.skipsUndoManager=!0,y=""),this.undoManager.Ea(y);var E=!1;try{a(this),E=!0}finally{E?this.undoManager.eb(y):this.undoManager.Kf(),this.skipsUndoManager=x}},ke.prototype.updateAllTargetBindings=function(a){this.partManager.updateAllTargetBindings(a)},ke.prototype.rp=function(){this.partManager.rp()};function Tg(a,y,x){var E=a.animationManager;if(a.vb||a.ld)a.Ca=x,Nu(a),a.N(),a.Ee=!0,E.zb&&(oh(E)||E.ce.add(E.H,"scale",y,a.Ca));else if(a.ta===null)a.Ca=x,Nu(a);else{a.vb=!0;var b=a.viewportBounds.copy(),z=a.Aa,tt=a.ya,rt=a.zoomPoint.x,ot=a.zoomPoint.y,lt=a.contentAlignment;isNaN(rt)&&(lt.$c()?lt.Hf(is)?rt=0:lt.Hf(Qo)&&(rt=z-1):rt=lt.sb()?lt.x*(z-1):z/2),isNaN(ot)&&(lt.$c()?lt.Hf(Pa)?ot=0:lt.Hf(ps)&&(ot=tt-1):ot=lt.sb()?lt.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=At.allocAt(a.pa.x+rt/y-rt/x,a.pa.y+ot/y-ot/x),a.position=z,At.free(z),a.Ca=x,Nu(a),a.vb=!1,a.onViewportBoundsChanged(b,a.viewportBounds,y,!1),Rl(a,!1),E.zb&&(oh(E)||E.ce.add(E.H,"scale",y,a.Ca))}}ke.prototype.onViewportBoundsChanged=function(a,y,x,E){if(!a.D(y)){E===void 0&&(E=!1),E||(this.Ee=!0),this.vd=!0;var b=this.layout;b===null||!b.isViewportSized||this.autoScale!==hs||a.width===y.width&&a.height===y.height||b.C(),b=this.currentTool,this.Vk===!0&&b instanceof Ar&&(this.lastInput.documentPoint=this.Ps(this.lastInput.viewPoint),ea(b,this)),this.vb||this.invalidateViewport(a,y),bu(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=E,this.R("ViewportBoundsChanged",this.fc,a),this.isVirtualized&&this.links.each(function(z){z.isAvoiding&&z.actualBounds.Yc(y)&&z.bb()})}};function bu(a,y){var x=a.fe;if(x!==null&&x.visible){for(var E=on.alloc(),b=1,z=1,tt=x.O.s,rt=tt.length,ot=0;ot<rt;ot++){var lt=tt[ot],ut=Math.abs(lt.interval);2>ut||(pv(lt.figure)?z=z*ut/_t.vx(z,ut):b=b*ut/_t.vx(b,ut))}if(tt=x.gridCellSize,E.h(z*tt.width,b*tt.height),y!==void 0)b=y.width,z=y.height,a=y.x,tt=y.y;else{if(y=Be.alloc(),a=a.viewportBounds,y.h(a.x,a.y,a.width,a.height),!y.w()){Be.free(y);return}b=y.width,z=y.height,a=y.x,tt=y.y,Be.free(y)}x.width=b+2*E.width,x.height=z+2*E.height,y=At.alloc(),_t.No(a,tt,0,0,E.width,E.height,y),y.offset(-E.width,-E.height),on.free(E),x.part.location=y,At.free(y)}}ke.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(),E=x.length,b=0;b<E;b++)x[b].isSelected=!1;y.ka(),y.clear(),y.freeze(),a||this.R("ChangedSelection",y)}},ke.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))},ke.prototype.rA=function(a){if(this.R("ChangingSelection",this.selection),this.clearSelection(!0),$e(a))for(var y=a.length,x=0;x<y;x++){var E=a[x];E instanceof Bi||Gt("Diagram.selectCollection given something that is not a Part: "+E),E.isSelected=!0}else for(a=a.iterator;a.next();)y=a.value,y instanceof Bi||Gt("Diagram.selectCollection given something that is not a Part: "+y),y.isSelected=!0;this.R("ChangedSelection",this.selection)},ke.prototype.clearHighlighteds=function(){var a=this.highlighteds;if(0<a.count){for(var y=a.Fa(),x=y.length,E=0;E<x;E++)y[E].isHighlighted=!1;a.ka(),a.clear(),a.freeze()}},wt=ke.prototype,wt.Iz=function(a){a!==null&&a.diagram===this&&(!a.isHighlighted||1<this.highlighteds.count)&&(this.clearHighlighteds(),a.isHighlighted=!0)},wt.Jz=function(a){a=new pn().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 Bi||Gt("Diagram.highlightCollection given something that is not a Part: "+y),y.isHighlighted=!0},wt.scroll=function(a,y,x){x===void 0&&(x=1);var E=y==="up"||y==="down",b=0,z=At.alloc();if(a==="pixel")b=x;else if(a==="line")b=x*(E?this.scrollVerticalLineChange:this.scrollHorizontalLineChange);else if(a==="page")a=E?this.viewportBounds.height:this.viewportBounds.width,a*=this.scale,a!==0&&(b=x*Math.max(a-(E?this.scrollVerticalLineChange:this.scrollHorizontalLineChange),0));else{if(a==="document"){b=this.documentBounds,x=this.viewportBounds,y==="up"?this.position=z.h(x.x,b.y):y==="left"?this.position=z.h(b.x,x.y):y==="down"?this.position=z.h(x.x,b.bottom-x.height):y==="right"&&(this.position=z.h(b.right-x.width,x.y)),At.free(z);return}Gt("scrolling unit must be 'pixel', 'line', 'page', or 'document', not: "+a)}b/=this.scale,x=this.position,y==="up"?this.position=z.h(x.x,x.y-b):y==="down"?this.position=z.h(x.x,x.y+b):y==="left"?this.position=z.h(x.x-b,x.y):y==="right"?this.position=z.h(x.x+b,x.y):Gt("scrolling direction must be 'up', 'down', 'left', or 'right', not: "+y),At.free(z)},wt.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)},wt.es=function(a){var y=this.viewportBounds;a=a.center,a.x-=y.width/2,a.y-=y.height/2,this.position=a},wt.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)},wt.zA=function(a){var y=this.Ab,x=a.x,E=a.y,b=x+a.width,z=E+a.height,tt=y.m11,rt=y.m12,ot=y.m21,lt=y.m22,ut=y.dx,ft=y.dy,yt=x*tt+E*ot+ut;y=x*rt+E*lt+ft;var xt=b*tt+E*ot+ut;return a=b*rt+E*lt+ft,E=x*tt+z*ot+ut,x=x*rt+z*lt+ft,tt=b*tt+z*ot+ut,b=b*rt+z*lt+ft,z=Math.min(yt,xt),yt=Math.max(yt,xt),xt=Math.min(y,a),y=Math.max(y,a),z=Math.min(z,E),yt=Math.max(yt,E),xt=Math.min(xt,x),y=Math.max(y,x),z=Math.min(z,tt),yt=Math.max(yt,tt),xt=Math.min(xt,b),y=Math.max(y,b),new Be(z,xt,yt-z,y-xt)},wt.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),Dn(a.copy(),this.Ab)};function nm(a){var y=a.isModified;a.Tw!==y&&(a.Tw=y,a.R("Modified"))}function Dg(a){return a=Ff.get(a),a!==null?new a:new vo}ke.prototype.doModelChanged=function(a){var y=this;if(a.model===this.model){var x=a.change,E=a.propertyName;if(x===Qi&&E[0]==="S")if(E==="StartingFirstTransaction"){var b=this;a=this.toolManager,a.mouseDownTools.each(function(ot){return ot.diagram=b}),a.mouseMoveTools.each(function(ot){return ot.diagram=b}),a.mouseUpTools.each(function(ot){return ot.diagram=b}),this.ld||this.hf||(this.Jk=!0,this.fn&&(this.kg=!0))}else E==="StartingUndo"||E==="StartingRedo"?(a=this.animationManager,a.defaultAnimation.isAnimating&&!this.skipsUndoManager&&a.Cc(),this.R("ChangingSelection",this.selection)):E==="StartedTransaction"&&(a=this.animationManager,a.defaultAnimation.isAnimating&&!this.skipsUndoManager&&a.Cc());else if(this.aa){this.aa=!1;try{if(a.modelChange===""&&x===Qi){(E==="FinishedUndo"||E==="FinishedRedo")&&(this.R("ChangedSelection",this.selection),es(this));var z=this.animationManager;E==="RolledBackTransaction"&&z.Cc(),this.bx(),this.Jk=!0,this.bd(),this.undoManager.transactionLevel!==0&&this.undoManager.transactionLevel!==1||df(z),E==="CommittedTransaction"&&this.undoManager.isJustDiscarded&&(this.Ce=Math.min(this.Ce,this.undoManager.historyIndex-1)),E!=="CommittedTransaction"&&E!=="RolledBackTransaction"||!this.undoManager.isPendingUnmodified||setTimeout(function(){y.isModified=!1},1);var tt=a.isTransactionFinished;if(tt&&(nm(this),this.As.clear(),Hp(this.animationManager)),!this.Rt&&tt&&this.lastInput.targetDiagram){this.Rt=!0;var rt=this;Ei(function(){rt.currentTool.standardMouseOver(),rt.Rt=!1},10)}}}finally{this.aa=!0}}}};function Wd(a,y){y=y.O.s;for(var x=y.length,E=0;E<x;E++)ld(a,y[E])}function ld(a,y){if(y instanceof _s){var x=y.element;if(x!==null&&x instanceof HTMLImageElement){x.Bg instanceof pn&&x.Bg.add(a);var E=y.Eg;if(E!==null&&E.sq===!0&&y.diagram!==null&&y.diagram.Xn.add(y),x.hn)if(x=x.getAttribute("src")||"",E=a.Og.I(x),E===null)E=[],E.push(y),a.Og.add(x,E);else{for(a=0;a<E.length;a++)if(E[a]===y)return;E.push(y)}}}}function Og(a,y){if(y instanceof _s){var x=y.element;if(x!==null&&x instanceof HTMLImageElement&&x.hn){var E=x.getAttribute("src")||"",b=a.Og.I(E);if(b!==null){for(var z=0;z<b.length;z++)if(b[z]===y){b.splice(z,1),b.length===0&&(a.Og.remove(E),x.Fq&&x.removeEventListener("load",x.Fq),x.Yp&&x.removeEventListener("error",x.Yp),delete x.Fq,delete x.Yp,x.Bg instanceof pn&&x.Bg.remove(a),jf(E));break}}}}}ke.prototype.Wd=function(){this.partManager.Wd()},ke.prototype.Aj=function(a,y){this.Yd.Aj(a,y)},ke.prototype.Cj=function(a,y){this.Yd.Cj(a,y)},ke.prototype.findPartForKey=function(a){return this.partManager.findPartForKey(a)},ke.prototype.Vb=function(a){return this.partManager.Vb(a)},ke.prototype.findLinkForKey=function(a){return this.partManager.findLinkForKey(a)},wt=ke.prototype,wt.Lc=function(a){return this.partManager.Lc(a)},wt.ii=function(a){return this.partManager.ii(a)},wt.Kc=function(a){return this.partManager.Kc(a)},wt.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:Ai(Hn(y)))},wt.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:Ai(Hn(y)))};function Nu(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 Ig(a,y){a.Zi=!1;var x=a.Sp;x.D(y)||(x=x.copy(),a.Sp.assign(y),Rl(a,!1),a.R("DocumentBoundsChanged",void 0,x),a.Ee=!0,a.N())}wt.Va=function(){if(this.Zi){var a=Be.alloc();Ig(this,this.computeBounds(a)),Be.free(a)}},wt.rz=function(){for(var a=new pn,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},wt.qz=function(){return this.ai.iterator},wt.Uz=function(a){es(this),a&&Pf(this,!0),this.ld?_g(this,!1):(this.Jk=!0,wl(this))};function Pf(a,y){for(var x=a.ai.iterator;x.next();)im(a,x.value,y);a.layout&&(y?a.layout.isValidLayout=!1:a.layout.C())}function im(a,y,x){if(y!==null){for(var E=y.gl.iterator;E.next();)im(a,E.value,x);y.layout!==null&&(x?y.layout.isValidLayout=!1:y.layout.C())}}function _g(a,y){if(a.xh&&!a.lt){var x=a.aa;a.aa=!0;var E=a.undoManager.transactionLevel,b=a.layout,z=a.animationManager;try{E===0&&(a.undoManager.isInternalTransaction=!0,a.Ea("Layout")),1>=E&&!z.defaultAnimation.isAnimating&&!z.zb&&(y||zu(z,"Layout")),a.xh=!1;for(var tt=a.ai.iterator;tt.next();)Rg(a,tt.value,y,E);b.isValidLayout||(!y||b.isRealtime||b.isRealtime===null||E===0?(b.doLayout(a),es(a),b.isValidLayout=!0):a.xh=!0)}finally{y=a.undoManager.isInternalTransaction,E===0&&(a.eb("Layout"),a.undoManager.isInternalTransaction=!1),!y||E!==0&&E!==1||df(z),a.aa=x}}}function Rg(a,y,x,E){if(y!==null){for(var b=y.gl.iterator;b.next();)Rg(a,b.value,x,E);b=y.layout,b===null||b.isValidLayout||(!x||b.isRealtime||E===0?(y.rh=!y.location.w(),b.doLayout(y),y.C(32),kc(a,y),b.isValidLayout=!0):a.xh=!0)}}wt.yz=function(){for(var a=new fn,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(b){var z=b.toLowerCase(),tt=new fn;x.add(b,tt),x.add(z,tt),E.add(b,b),E.add(z,b)}var x=new be,E=new be;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=E}function rm(a,y){var x=a.hw.I(y);return x!==null?x:a.hw.I(y.toLowerCase())}function wf(a,y){var x=a.iw.I(y);if(x!==null||(x=a.iw.I(y.toLowerCase()),x!==null))return x;Gt("Unknown DiagramEvent name: "+y)}wt.Bj=function(a,y){return a=wf(this,a),a!==null&&a.add(y),this},wt.am=function(a,y){a=wf(this,a),a!==null&&a.remove(y)},wt.R=function(a,y,x){var E=wf(this,a),b=new Sr;if(b.diagram=this,a=rm(this,a),a!==null&&(b.name=a),y!==void 0&&(b.subject=y),x!==void 0&&(b.parameter=x),y=E.length,y===1)E.M(0)(b);else if(y!==0)for(E=E.Fa(),x=0;x<y;x++)(0,E[x])(b)};function Cf(a){if(a.animationManager.isTicking)return!1;var y=a.currentTool;return y===a.toolManager.findTool("Dragging")?!a.Mr||y.isComplexRoutingRealtime:!0}wt.Yj=function(a,y){return Ef(this,!1,null,y||null).Yj(a.x,a.y,a.width,a.height)},ke.prototype.computeOccupiedArea=function(a){return this.isVirtualized?this.viewportBounds.copy():this.Zi?Cg(this,a):a.assign(this.documentBounds)};function Ef(a,y,x,E){var b=a.Xh;if(b===null&&(a.Xh=b=new fp(a.avoidanceCellSize)),b.vs||b.group!==x||b.Yx!==E){if(b.Hx=Math.max(b.Os+1,Math.floor(a.avoidanceLimit/a.avoidanceCellSize.width)),b.Ix=Math.max(b.Os+1,Math.floor(a.avoidanceLimit/a.avoidanceCellSize.height)),x!==null&&(x=om(a,x)),x===null){y=Be.alloc(),a.computeOccupiedArea(y),y.Bc(100,100),b.initialize(y);for(var z=a.nodes;z.next();){var tt=z.value,rt=tt.layer;rt!==null&&rt.visible&&!rt.isTemporary&&Lf(a,tt,E,y)}Be.free(y)}else{for(0<x.memberParts.count&&(y=a.computePartsBounds(x.memberParts,!1),y.Bc(20,20),b.initialize(y)),y=Be.alloc(),z=x.memberParts;z.next();)tt=z.value,tt instanceof $n&&Lf(a,tt,E,y);Be.free(y)}b.group=x,b.Yx=E,b.vs=!1}else y&&rS(b);return b}function om(a,y){return y.avoidable&&!y.isLinkLabel?y:y.containingGroup!==null?om(a,y.containingGroup):null}function Lf(a,y,x,E){if(y!==x&&y.isVisible()){if(y.avoidable&&!y.isLinkLabel){y=y.getAvoidableRect(E),a=a.Xh;var b=y.x,z=y.y;if(Vf(a,b,z))for(x=(z-a.Od)/a.sc|0,E=Math.min((b+y.width-a.Nd)/a.rc|0,a.di),y=Math.min((z+y.height-a.Od)/a.sc|0,a.ei),b=(b-a.Nd)/a.rc|0;b<=E;b++)if(z=a.ac[b],z.fill)z.fill(jh,x,y+1);else for(var tt=x;tt<=y;tt++)z[tt]=jh}else if(y instanceof er)for(y=y.memberParts;y.next();)b=y.value,b instanceof $n&&Lf(a,b,x,E)}}function kh(a,y){a.Xh===null||a.Xh.vs||y!==void 0&&(!y.avoidable||y.isLinkLabel)||(a.Xh.vs=!0)}ke.prototype.gs=function(a){this.wp.assign(a),this.computeAutoScrollPosition(this.wp).Xa(this.position)?this.ug():jg(this)};function jg(a){a.vk===-1&&(a.vk=Ei(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=Be.alloc(),a.computeBounds(y),y.ed(a.documentBounds),Ig(a,y),Be.free(y),a.Fc=!0,a.bd(),jg(a))}},a.vp))}ke.prototype.ug=function(){this.vk!==-1&&(Je.clearTimeout(this.vk),this.vk=-1)},ke.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 E=this.viewportBounds,b=this.scale;E=Be.allocAt(0,0,E.width*b,E.height*b);var z=At.allocAt(0,0);if(a.x>=E.x&&a.x<E.x+x.left&&this.allowHorizontalScroll){var tt=Math.max(this.scrollHorizontalLineChange,1);tt|=0,z.x-=tt,a.x<E.x+x.left/2&&(z.x-=tt),a.x<E.x+x.left/4&&(z.x-=4*tt)}else a.x<=E.x+E.width&&a.x>E.x+E.width-x.right&&this.allowHorizontalScroll&&(tt=Math.max(this.scrollHorizontalLineChange,1),tt|=0,z.x+=tt,a.x>E.x+E.width-x.right/2&&(z.x+=tt),a.x>E.x+E.width-x.right/4&&(z.x+=4*tt));return a.y>=E.y&&a.y<E.y+x.top&&this.allowVerticalScroll?(tt=Math.max(this.scrollVerticalLineChange,1),tt|=0,z.y-=tt,a.y<E.y+x.top/2&&(z.y-=tt),a.y<E.y+x.top/4&&(z.y-=4*tt)):a.y<=E.y+E.height&&a.y>E.y+E.height-x.bottom&&this.allowVerticalScroll&&(tt=Math.max(this.scrollVerticalLineChange,1),tt|=0,z.y+=tt,a.y>E.y+E.height-x.bottom/2&&(z.y+=tt),a.y>E.y+E.height-x.bottom/4&&(z.y+=4*tt)),z.Xa(Zn)||(y=new At(y.x+z.x/b,y.y+z.y/b)),Be.free(E),At.free(z),y},wt=ke.prototype,wt.Cs=function(){return null},wt.av=function(){return null},wt.bs=function(a,y){this.pj.add(a,y)},wt.Fu=function(a){(this.Pw=a)||this.nodes.each(function(y){y instanceof er&&(y.$p=null)})};function bc(a,y,x){function E(){var ut=+new Date;for(z=!0,tt.reset();tt.next();)if(!tt.value[0].al){z=!1;break}z||ut-lt>ot?y(x,b,rt):Je.requestAnimationFrame(E)}for(var b=x.callback,z=!0,tt=a.Og.iterator;tt.next();)if(!tt.value[0].al){z=!1;break}if(typeof b!="function"||z)return y(x,b,a);var rt=a,ot=x.callbackTimeout||300,lt=+new Date;return Je.requestAnimationFrame(function(){E()}),null}wt.Wz=function(a){return $o?(a===void 0&&(a={}),a.returnType="Image",this.Jx(a)):null},wt.Jx=function(a){return a===void 0&&(a={}),bc(this,this.Xz,a)},wt.Xz=function(a,y,x){var E=am(x,a,"canvas",null);if(E===null)return null;x=E.Z.canvas;var b=null;if(x!==null)switch(b=a.returnType,b===void 0?b="string":b=b.toLowerCase(),b){case Ud+"data":b=E.getImageData(0,0,x.width,x.height);break;case Ud:E=(a.document||document).createElement("img"),E.src=x.toDataURL(a.type,a.details),b=E;break;case"blob":return typeof y!="function"&&Gt('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:b=x.toDataURL(a.type,a.details)}return typeof y=="function"?(y(b),null):b};function am(a,y,x,E){if(a.animationManager.Cc(),a.bd(),a.ta===null)return null;typeof y!="object"&&Gt("properties argument must be an Object.");var b=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 on(1/0,1/0):new on(2e3,2e3));var rt=y.position||null,ot=y.parts||null,lt=y.padding===void 0?1:y.padding,ut=y.background||null,ft=y.omitTemporary;ft===void 0&&(ft=!0);var yt=y.document||document,xt=y.elementFinished||null,Ct=y.showTemporary;Ct===void 0&&(Ct=!ft),y=y.showGrid,y===void 0&&(y=Ct),b!==null&&isNaN(b.width)&&isNaN(b.height)&&(b=null),typeof lt=="number"?lt=new nr(lt):lt instanceof nr||Gt("MakeImage padding must be a Margin or a number."),lt.left=Math.max(lt.left,0),lt.right=Math.max(lt.right,0),lt.top=Math.max(lt.top,0),lt.bottom=Math.max(lt.bottom,0),a.ib.Vc(!0),ft=new zl(null,yt,void 0,!0);var bt=ft.context;if(!(b||z||ot||rt))return ft.width=a.Aa+Math.ceil(lt.left+lt.right),ft.height=a.ya+Math.ceil(lt.top+lt.bottom),x==="SVG"?E===null?null:(E.resize(ft.width,ft.height,ft.width,ft.height),E.ownerDocument=yt,E.hs=xt,vf(a,E.context,lt,new on(ft.width,ft.height),a.Ca,a.pa,ot,ut,Ct,y),E.context):(a.Xm=!1,vf(a,bt,lt,new on(ft.width,ft.height),a.Ca,a.pa,ot,ut,Ct,y),a.Xm=!0,ft.context);var Vt=a.Pp,zt=a.documentBounds.copy();if(zt.Fv(a.yb),Ct)for(var Qt=a.Wa.s,ee=Qt.length,oe=0;oe<ee;oe++){var ce=Qt[oe];if(ce.visible&&ce.isTemporary){ce=ce.Pa.s;for(var Me=ce.length,Wn=0;Wn<Me;Wn++){var di=ce[Wn];di.isInDocumentBounds&&di.isVisible()&&(di=di.actualBounds,di.w()&&zt.ed(di))}}}if(Qt=new At(zt.x,zt.y),ot!==null){for(ee=new Be(0,0,0,0),oe=!0,ce=ot.iterator,ce.reset();ce.next();)Me=ce.value,Me instanceof Bi&&(Wn=Me.layer,Wn!==null&&!Wn.visible||Wn!==null&&!Ct&&Wn.isTemporary||!Me.isVisible()||(Me=Me.actualBounds,Me.w()&&(oe?(oe=!1,ee.assign(Me)):ee.ed(Me))));zt.width=ee.width,zt.height=ee.height,Qt.x=ee.x,Qt.y=ee.y}return rt!==null&&rt.w()&&(Qt=rt,z||(z=Vt)),ee=rt=0,lt!==null&&(rt=lt.left+lt.right,ee=lt.top+lt.bottom),oe=ce=0,b!==null&&(ce=b.width,oe=b.height,isFinite(ce)&&(ce=Math.max(0,ce-rt)),isFinite(oe)&&(oe=Math.max(0,oe-ee))),b!==null&&z!==null?(z==="NaN"&&(z=Vt),b.w()?(b=ce,zt=oe):isNaN(oe)?(b=ce,zt=zt.height*z):(b=zt.width*z,zt=oe)):b!==null?b.w()?(z=Math.min(ce/zt.width,oe/zt.height),b=ce,zt=oe):isNaN(oe)?(z=ce/zt.width,b=ce,zt=zt.height*z):(z=oe/zt.height,b=zt.width*z,zt=oe):z!==null?z==="NaN"&&tt.w()?(z=Math.min((tt.width-rt)/zt.width,(tt.height-ee)/zt.height),z>Vt?(z=Vt,b=zt.width,zt=zt.height):(b=tt.width,zt=tt.height)):(b=zt.width*z,zt=zt.height*z):(z=Vt,b=zt.width,zt=zt.height),lt!==null?(b+=rt,zt+=ee):lt=new nr(0),tt!==null&&(Vt=tt.width,tt=tt.height,isNaN(Vt)&&(Vt=2e3),isNaN(tt)&&(tt=2e3),isFinite(Vt)&&(b=Math.min(b,Vt)),isFinite(tt)&&(zt=Math.min(zt,tt))),ft.width=Math.ceil(b),ft.height=Math.ceil(zt),x==="SVG"?E===null?null:(E.resize(ft.width,ft.height,ft.width,ft.height),E.ownerDocument=yt,E.hs=xt,vf(a,E.context,lt,new on(Math.ceil(b),Math.ceil(zt)),z,Qt,ot,ut,Ct,y),E.context):(a.Xm=!1,vf(a,bt,lt,new on(Math.ceil(b),Math.ceil(zt)),z,Qt,ot,ut,Ct,y),a.Xm=!0,ft.context)}ye.Object.defineProperties(ke.prototype,{renderer:{get:function(){return this.nl},set:function(a){this instanceof mt||(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 Bu(this,Je.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 Bu(this,Je.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(Je,"resize",this.Ov,!1),this.removeEventListener(Je,"wheel",this.$j,!0),Zu===this&&(Zu=null)):this.ui===null&&(this.hf=!1),this.Ka=null,a!==null&&((y=a.H)&&(y.div=null),Pg(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)&&un(a,"0 <= value <= 1",ke,"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),Rl(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),Rl(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),Rl(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),Rl(this,!1))}},scrollHorizontalLineChange:{get:function(){return this.iu},set:function(a){var y=this.iu;y!==a&&(0>a&&un(a,">= 0",ke,"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&&un(a,">= 0",ke,"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 E=y.style.cursor;y.style.cursor=a,x.style.cursor=a,y.style.cursor===E&&(y.style.cursor="-webkit-"+a,x.style.cursor="-webkit-"+a,y.style.cursor===E&&(y.style.cursor="-moz-"+a,x.style.cursor="-moz-"+a,y.style.cursor===E&&(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 un(a,">= 0",ke,"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||nm(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&&Gt("Do not replace a Diagram.model while a transaction is in progress."),this.animationManager.Cc(!0);var x=xg(this,!0);this.hf=!1,this.fn=!0,this.Ce=-2,this.kg=!1;var E=this.vb;this.vb=!0,zu(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=Dg(this.cc.type);for(var b=0;b<x.length;b++)this.add(x[b]);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=E,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(Je,"pointermove",this.dk,!0),this.addEventListener(Je,"pointerdown",this.ui,!0),this.addEventListener(Je,"pointerup",this.fk,!0),this.addEventListener(Je,"pointerout",this.ek,!0),this.addEventListener(Je,"pointercancel",this.ck,!0),this.removeEventListener(y,"wheel",this.$j,!1),this.addEventListener(Je,"wheel",this.$j,!0),this.addEventListener(Je,"selectstart",this.preventDefault,!1)):(this.removeEventListener(Je,"pointermove",this.dk,!0),this.removeEventListener(Je,"pointerdown",this.ui,!0),this.removeEventListener(Je,"pointerup",this.fk,!0),this.removeEventListener(Je,"pointerout",this.ek,!0),this.removeEventListener(Je,"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(Je,"wheel",this.$j,!0),this.removeEventListener(Je,"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=At.alloc().assign(this.pa);if(!y.D(a)){var x=this.viewportBounds.copy();this.pa.assign(a),Wp(this.animationManager,y,this.pa),this.vb||this.ta===null&&!this.wo.w()?Nu(this):(this.vb=!0,a=this.scale,Eg(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)}At.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=$p(this)),this.fe},set:function(a){var y=this.fe;if(y!==a){y===null&&(y=this.fe=$p(this)),a.type!==wn.Grid&&Gt("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),bu(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),Nu(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||Gt("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 nr(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===bh&&Rl(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,Rl(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,Tg(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&&Tg(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!==hs&&Rl(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()||Gt("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()||Gt("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)):un(a,"> 0",ke,"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)):un(a,"> 0",ke,"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),Rl(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 nr(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&&Gt("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();)ip(a.value)}},treeCollapsePolicy:{get:function(){return this.uu},set:function(a){var y=this.uu;y!==a&&(a!==Nh&&a!==va&&a!==Mf&&Gt("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 on(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 nr(a));var y=this.xp;y.D(a)||(this.xp=a=a.J(),this.Ya(),this.g("autoScrollRegion",y,a))}}}),ye.Object.defineProperties(ke,{licenseKey:{get:function(){return Vg.jc()},set:function(a){Vg.add(a.replace(/\s/g,""))}},version:{get:function(){return Kd}}}),ke.prototype.makeImageData=ke.prototype.Jx,ke.prototype.makeImage=ke.prototype.Wz,ke.prototype.cacheGroupExternalLinks=ke.prototype.Fu,ke.prototype.addRenderer=ke.prototype.bs,ke.prototype.makeSVG=ke.prototype.av,ke.prototype.makeSvg=ke.prototype.Cs,ke.prototype.stopAutoScroll=ke.prototype.ug,ke.prototype.doAutoScroll=ke.prototype.gs,ke.prototype.isUnoccupied=ke.prototype.Yj,ke.prototype.raiseDiagramEvent=ke.prototype.R,ke.prototype.removeDiagramListener=ke.prototype.am,ke.prototype.addDiagramListener=ke.prototype.Bj,ke.prototype.findTreeRoots=ke.prototype.yz,ke.prototype.layoutDiagram=ke.prototype.Uz,ke.prototype.findTopLevelGroups=ke.prototype.qz,ke.prototype.findTopLevelNodesAndLinks=ke.prototype.rz,ke.prototype.ensureBounds=ke.prototype.Va,ke.prototype.findLinksByExample=ke.prototype.ls,ke.prototype.findNodesByExample=ke.prototype.ms,ke.prototype.findLinkForData=ke.prototype.Kc,ke.prototype.findNodeForData=ke.prototype.ii,ke.prototype.findPartForData=ke.prototype.Lc,ke.prototype.findLinkForKey=ke.prototype.findLinkForKey,ke.prototype.findNodeForKey=ke.prototype.Vb,ke.prototype.findPartForKey=ke.prototype.findPartForKey,ke.prototype.rebuildParts=ke.prototype.Wd,ke.prototype.transformViewToDoc=ke.prototype.Ps,ke.prototype.transformRectDocToView=ke.prototype.zA,ke.prototype.transformDocToView=ke.prototype.op,ke.prototype.centerRect=ke.prototype.es,ke.prototype.scrollToRect=ke.prototype.tv,ke.prototype.scroll=ke.prototype.scroll,ke.prototype.highlightCollection=ke.prototype.Jz,ke.prototype.highlight=ke.prototype.Iz,ke.prototype.selectCollection=ke.prototype.rA,ke.prototype.select=ke.prototype.select,ke.prototype.updateAllRelationshipsFromData=ke.prototype.rp,ke.prototype.updateAllTargetBindings=ke.prototype.updateAllTargetBindings,ke.prototype.commit=ke.prototype.commit,ke.prototype.rollbackTransaction=ke.prototype.Kf,ke.prototype.commitTransaction=ke.prototype.eb,ke.prototype.startTransaction=ke.prototype.Ea,ke.prototype.raiseChanged=ke.prototype.g,ke.prototype.raiseChangedEvent=ke.prototype.cb,ke.prototype.removeChangedListener=ke.prototype.ik,ke.prototype.addChangedListener=ke.prototype.Pe,ke.prototype.removeModelChangedListener=ke.prototype.mA,ke.prototype.addModelChangedListener=ke.prototype.Yw,ke.prototype.findLayer=ke.prototype.Qj,ke.prototype.removeLayer=ke.prototype.kA,ke.prototype.addLayerAfter=ke.prototype.Cy,ke.prototype.addLayerBefore=ke.prototype.Ww,ke.prototype.addLayer=ke.prototype.Al,ke.prototype.moveParts=ke.prototype.moveParts,ke.prototype.copyParts=ke.prototype.Kj,ke.prototype.removeParts=ke.prototype.Is,ke.prototype.remove=ke.prototype.remove,ke.prototype.add=ke.prototype.add,ke.prototype.clearDelayedGeometries=ke.prototype.bx,ke.prototype.setProperties=ke.prototype.nm,ke.prototype.attach=ke.prototype.Du,ke.prototype.set=ke.prototype.set,ke.prototype.resetInputOptions=ke.prototype.Sx,ke.prototype.setInputOption=ke.prototype.sA,ke.prototype.getInputOption=ke.prototype.Ql,ke.prototype.resetRenderingHints=ke.prototype.Tx,ke.prototype.setRenderingHint=ke.prototype.Xx,ke.prototype.getRenderingHint=ke.prototype.Gf,ke.prototype.maybeUpdate=ke.prototype.bd,ke.prototype.requestUpdate=ke.prototype.$b,ke.prototype.delayInitialization=ke.prototype.Xy,ke.prototype.isUpdateRequested=ke.prototype.Pz,ke.prototype.invalidateDocumentBounds=ke.prototype.Ya,ke.prototype.findObjectsNear=ke.prototype.og,ke.prototype.findPartsNear=ke.prototype.mz,ke.prototype.findObjectsIn=ke.prototype.Cf,ke.prototype.findPartsIn=ke.prototype.ux,ke.prototype.findObjectsAt=ke.prototype.ji,ke.prototype.findPartsAt=ke.prototype.lz,ke.prototype.findObjectAt=ke.prototype.ic,ke.prototype.findPartAt=ke.prototype.Ol,ke.prototype.focusObject=ke.prototype.zz,ke.prototype.alignDocument=ke.prototype.Jy,ke.prototype.zoomToRect=ke.prototype.BA,ke.prototype.zoomToFit=ke.prototype.zoomToFit,ke.prototype.diagramScroll=ke.prototype.kx,ke.prototype.focus=ke.prototype.focus;var Ff=new be,sm=null,$o=Je.document!==void 0,Vd=null,ud="",hs=new rn(ke,"None",0),cl=new rn(ke,"Uniform",1),hd=new rn(ke,"UniformToFill",2),Nc=new rn(ke,"CycleAll",10),zg=new rn(ke,"CycleNotDirected",11),Zg=new rn(ke,"CycleNotDirectedFast",12),Gg=new rn(ke,"CycleNotUndirected",13),Hg=new rn(ke,"CycleDestinationTree",14),Wg=new rn(ke,"CycleSourceTree",15),bh=new rn(ke,"DocumentScroll",1),Bc=new rn(ke,"InfiniteScroll",2),Nh=new rn(ke,"TreeParentCollapsed",21),va=new rn(ke,"AllParentsCollapsed",22),Mf=new rn(ke,"AnyParentsCollapsed",23),Vg=new fn,Kd="2.3.10",Ud="image",Ac=null,lm=!1;function os(){if($o){var a=Je.document.createElement("canvas"),y=a.getContext("2d"),x=We("7ca11abfd022028846");y[x]=We("398c3597c01238");for(var E=["5da73c80a36455d7038e4972187c3cae51fd22",An.Dx+"4ae6247590da4bb21c324ba3a84e385776",ae.xF+"fb236cdfda5de14c134ba1a95a2d4c7cc6f93c1387",_t.za],b=1;5>b;b++)y[We("7ca11abfd7330390")](We(E[b-1]),10,15*b);for(y[x]=We("39f046ebb36e4b"),x=1;5>x;x++)y[We("7ca11abfd7330390")](We(E[x-1]),10,15*x);(E.length!==4||E[0][0]!=="5"||E[3][0]!=="7")&&(ae.prototype.Cd=ae.prototype.Eu),Ac=a}}ke.className="Diagram",ke.fromDiv=function(a){var y=a;return typeof a=="string"&&(y=Je.document.getElementById(a)),y instanceof HTMLDivElement&&y.H instanceof ke?y.H:null},ke.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},ke.useDOM=function(a){$o=a?Je.document!==void 0:!1},ke.isUsingDOM=function(){return $o},ke.None=hs,ke.Uniform=cl,ke.UniformToFill=hd,ke.CycleAll=Nc,ke.CycleNotDirected=zg,ke.CycleNotDirectedFast=Zg,ke.CycleNotUndirected=Gg,ke.CycleDestinationTree=Hg,ke.CycleSourceTree=Wg,ke.DocumentScroll=bh,ke.InfiniteScroll=Bc,ke.TreeParentCollapsed=Nh,ke.AllParentsCollapsed=va,ke.AnyParentsCollapsed=Mf;function um(){this.wy=null,this.j="zz@orderNum",this._tk==="63ad05bbe23a1786468a4c741b6d2"?this.Rc=this.j=!0:this.Rc=null}function Yd(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=Je[We("76a715b2f73f148a")][We("72ba13b5")]||"";if(a.Rc=!0,$o){var E=ke[We("76a115b6ed251eaf4692")];if(E)for(var b=Vg.iterator;b.next()&&(E=b.value,E=We(E).split(We("39e9")),!(6>E.length));){var z=We(E[1]).split(".");if(E[4]!=="7da71ca0")break;var tt=We(An[We("6cae19")]).split(".");if(z[0]>tt[0]||z[0]===tt[0]&&z[1]>=tt[1]){var rt=Je[We("74a900bae4370f8b51")][We("6fbb13a1c2311e8a57")].toLowerCase();if(tt=rt[We("73a612b6fb191d")](We("3aad1ab6e022098b4dc4")),z=We(E[2]),-1<tt&&(rt=rt[We("73a612b6fb191d")](z.toLowerCase()+"/"),a.Rc=!(-1<rt&&rt<tt),!a.Rc))break;for(tt=x[We("76ad18b4f73e")],rt=x[We("73a612b6fb191d")](We("35e7"))+2;rt<tt;rt++)y+=x[rt];if(tt=y[We("73a612b6fb191d")](z),0>tt&&z!==We("7da71ca0ad381e90")&&(tt=y[We("73a612b6fb191d")](We("76a715b2ef3e149757"))),0>tt&&(tt=y[We("73a612b6fb191d")](We("76a715b2ef3e149757"))),0>tt&&(tt=y[We("73a612b6fb191d")](We("2bfa41fdb3784bca12"))),0>tt&&(tt=x[We("73a612b6fb191d")](We("7baa19a6f76c1988428554"))),a.Rc=!(0<=tt&&tt<y[We("73a612b6fb191d")](We("35"))||y[We("73a612b6fb191d")](We("35"))===-1),!a.Rc||x[We("73a612b6fb191d")](We("7fb002b6ed25128b4da25b2e"))&&(a.Rc=!(-1<x[We("73a612b6fb191d")](z)),!a.Rc)||(tt=Je[We("76a715b2f73f148a")][We("69ad17a1e03e")],rt=tt[We("73a612b6fb191d")](We("7fb002b6ed25128b4da25b2e")),-1<rt&&(a.Rc=!(tt[We("73a612b6fb191d")](z)>rt),!a.Rc)))break;if(z[0]==="#"){tt=Je.document.createElement("div");for(var ot=E[0].replace(/[A-Za-z]/g,"");4>ot.length;)ot+="9";if(rt=ot,ot=ot.substr(ot.length-4),E="",E+=["gsh","gsf"][parseInt(ot.substr(0,1),10)%2],E+=["Header","Background","Display","Feedback"][parseInt(ot.substr(0,1),10)%4],tt[We("79a417a0f0181a8946")]=E,Je.document[We("78a712aa")]){Je.document[We("78a712aa")][We("7bb806b6ed32388c4a875b")](tt),ot=Je.getComputedStyle(tt).getPropertyValue(We("78a704b7e62456904c9b12701b6532a8"));var lt=Je.getComputedStyle(tt).getPropertyValue(We("75b817b0ea2202"));if(Je.document[We("78a712aa")][We("68ad1bbcf533388c4a875b")](tt),ot){if(tt=Je[We("77a902b0eb1b1e804a8a")],lt==="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(We("32ae19a1e0331fc94084537c067a67fa59f1386b89d006")).matches)for(E="."+E,z=0;z<document.styleSheets.length;z++){tt=document.styleSheets[z].rules||document.styleSheets[z].cssRules;for(var ut in tt)if(E===tt[ut].selectorText){a.Rc=!1;break t}}}}else a.Rc=null,a.Rc=!1}}}else{for(ut=x[We("76ad18b4f73e")],b=x[We("73a612b6fb191d")](We("35e7"))+2;b<ut;b++)y+=x[b];x=y[We("73a612b6fb191d")](We("7da71ca0ad381e90")),a.Rc=!(0<=x&&x<y[We("73a612b6fb191d")](We("35")))}}}return 0<a.Rc&&a!==a.wy}um.className="DiagramHelper";function lh(a){this.j=a===void 0?new At:a,this.o=new At}ye.Object.defineProperties(lh.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 Tc="DraggingInfo";lh.className="DraggingInfo";function it(a,y,x){this.node=a,this.info=y,this.Su=x}it.className="DraggingNodeInfoPair";function at(){this.reset()}at.prototype.reset=function(){this.isGridSnapEnabled=!1,this.isGridSnapRealtime=!0,this.gridSnapCellSize=new on(NaN,NaN).freeze(),this.gridSnapCellSpot=_r,this.gridSnapOrigin=new At(NaN,NaN).freeze(),this.groupsSnapMembers=this.dragsTree=this.dragsLink=!1,this.dragsMembers=this.groupsAlwaysMove=!0},at.className="DraggingOptions";function ct(a,y){if(typeof a=="string"||Je.Element&&a instanceof Element)var x=ke.call(this,a)||this;else x=ke.call(this)||this,y=a;return dt(x),y&&x.nm(y),x}Se(ct,ke);function dt(a){a.allowDragOut=!0,a.allowMove=!1,a.isReadOnly=!0,a.contentAlignment=to,a.layout=new Ka}ct.prototype.reset=function(){ke.prototype.reset.call(this),dt(this)},ct.className="Palette";function mt(a,y){if(typeof a=="string"||Je.Element&&a instanceof Element)var x=ke.call(this,a)||this;else x=ke.call(this)||this,y=a;var E=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 Bi;var b=new cr;return b.stroke="magenta",b.strokeWidth=2,b.fill="transparent",b.name="BOXSHAPE",a.selectable=!0,a.selectionAdorned=!1,a.selectionObjectName="BOXSHAPE",a.locationObjectName="BOXSHAPE",a.resizeObjectName="BOXSHAPE",a.cursor="move",a.add(b),x.j=a,x.allowCopy=!1,x.allowDelete=!1,x.allowSelect=!0,x.autoScrollRegion=new nr(0,0,0,0),x.pa.h(0,0),x.toolManager.gb("Dragging",new Kt,x.toolManager.mouseMoveTools),x.click=function(){var z=E.observed;if(z!==null){var tt=z.viewportBounds,rt=E.lastInput.documentPoint;z.position=new At(rt.x-tt.width/2,rt.y-tt.height/2)}},x.Pf=function(){E.Ya(),It(E)},x.Xd=function(){E.observed!==null&&(E.Ya(),E.N())},x.Ha=function(){1>E.updateDelay?E.N():E.o||(E.o=!0,setTimeout(function(){return E.redraw()},E.updateDelay))},x.Of=function(){E.observed!==null&&It(E)},x.autoScale=cl,x.vb=!1,y&&Object.assign(x,y),x}Se(mt,ke),mt.prototype.computePixelRatio=function(){return 1},mt.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(Gd(this),this.ql===null){var x=new zl(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),Ft(this)}finally{this.ta=a,this.ib=y}}}ke.prototype.redraw.call(this)},mt.prototype.gc=function(){if(this.Ka===null&&Gt("No div specified"),this.ta===null&&Gt("No canvas specified"),!(this.ta instanceof Bu)&&(Ov(this.box),this.Fc)){var a=this.observed;if(a!==null&&!a.animationManager.defaultAnimation.isAnimating&&a.pi){Gd(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?Ft(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,E=0;E<x;E++)y[E].gc(a,this);this.Fc=this.vd=!1}}};function Ft(a){var y=a.observed;if(y!==null){var x=a.drawsTemporaryLayers,E=a.drawsGrid&&x,b=y.grid;E&&b!==null&&b.visible&&!isNaN(b.width)&&!isNaN(b.height)&&(b=Be.alloc().assign(a.viewportBounds).ed(y.viewportBounds),bu(y,b),Be.free(b),es(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),b=a.ib,b.scale(a.Mb,a.Mb),b.transform(z.m11,z.m12,z.m21,z.m22,z.dx,z.dy),b.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 lt=rt.diagram.grid.part;if(!x&&rt.isTemporary)E&<.layer===rt&&(rt=sh(rt,b),lt.gc(b,ot),b.globalAlpha=rt);else{for(var ut=sh(rt,b),ft=ot.scale,yt=Be.alloc(),xt=rt.Pa.s,Ct=xt.length,bt=0;bt<Ct;bt++){var Vt=xt[bt];(E||Vt!==lt)&&rt.Oj(b,Vt,ot,null,ft,yt,!1)}Be.free(yt),b.globalAlpha=ut}}}}}function It(a){var y=a.box;if(y!==null){var x=a.observed;if(x!==null){a.Fc=!0,x=x.viewportBounds;var E=y.selectionObject,b=on.alloc();b.h(x.width,x.height),E.desiredSize=b,on.free(b),a=2/a.scale,E instanceof cr&&(E.strokeWidth=a),y.location=new At(x.x-a/2,x.y-a/2),y.isSelected=!0}}}mt.prototype.computeBounds=function(){var a=this.observed;if(a===null)return aa;var y=a.documentBounds.copy();return y.ed(a.viewportBounds),y},mt.prototype.invalidateViewport=function(){this.Fc!==!0&&(this.Fc=!0,this.$b())},mt.prototype.onViewportBoundsChanged=function(a,y,x,E){this.vb||(this.vd=!0,this.N(),this.Ee=!0,this.Ya(),It(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=E,this.R("ViewportBoundsChanged",this.fc,a))},ye.Object.defineProperties(mt.prototype,{observed:{get:function(){return this.V},set:function(a){var y=this.V;if(a instanceof mt&&Gt("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,E=this.ib;x&&E&&(E.setTransform(1,0,0,1,0,0),E.clearRect(0,0,x.width,x.height))}else this.Ha(null),It(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),It(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)}}}),mt.className="Overview";function Kt(){jo.call(this),this.j=null}Se(Kt,jo),Kt.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 At(x.width/2,x.height/2),a=a.firstInput.documentPoint,y.position=new At(a.x-this.j.x,a.y-this.j.y)),!0)},Kt.prototype.doActivate=function(){this.j=null,jo.prototype.doActivate.call(this)},Kt.prototype.doUpdateCursor=function(){var a=this.diagram,y=a.box;y!==null&&y.cursor&&(a.currentCursor=y.cursor)},Kt.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 E=a.firstInput.documentPoint;x=x.location,this.j=new At(E.x-x.x,E.y-x.y)}a=a.lastInput.documentPoint,y.position=new At(a.x-this.j.x,a.y-this.j.y)}}},Kt.className="OverviewDraggingTool";function Wt(){Hi(this),this.H=Zu,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=aa,this.hb=!0,this.cg=null,this.ob=200}Wt.prototype.toString=function(){return"CommandHandler"},Wt.prototype.Xe=function(a){this.H=a},Wt.prototype.doKeyDown=function(){var a=this.diagram,y=a.lastInput,x=yr?y.meta:y.control,E=y.shift,b=y.alt,z=y.key;!x||z!=="C"&&z!=="Insert"?x&&z==="X"||E&&z==="Del"?this.canCutSelection()&&this.cutSelection():x&&z==="V"||E&&z==="Insert"?this.canPasteSelection()&&this.pasteSelection():x&&z==="Y"||b&&E&&z==="Backspace"?this.canRedo()&&this.redo():x&&z==="Z"||b&&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"?E&&a.allowHorizontalScroll?a.scroll("page","left"):a.allowVerticalScroll&&a.scroll("page","up"):z==="PageDown"?E&&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():E&&z==="Z"?this.canZoomToFit()&&this.zoomToFit():x&&!E&&z==="G"?this.canGroupSelection()&&this.groupSelection():x&&E&&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()},Wt.prototype.doKeyUp=function(){this.diagram.lastInput.bubbles=!0},Wt.prototype.stopCommand=function(){var a=this.diagram,y=a.currentTool;y instanceof Ar&&a.allowSelect&&a.clearSelection(),y!==null&&y.doCancel()},Wt.prototype.canStopCommand=function(){return!0},Wt.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 E=a.links;E.next();)E.value.isSelected=!0}finally{a.R("ChangedSelection",a.selection),a.currentCursor=""}},Wt.prototype.canSelectAll=function(){return this.diagram.allowSelect},Wt.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 pn,x=a.selection.iterator;x.next();)gd(y,x.value,!0,this.deletesTree?1/0:0,this.deletesConnectedLinks?null:!1,function(E){return E.canDelete()});a.Is(y,!0),a.R("SelectionDeleted",y)}finally{a.eb("Delete"),a.R("ChangedSelection",a.selection),a.currentCursor=""}},Wt.prototype.canDeleteSelection=function(){var a=this.diagram;return!(a.isReadOnly||a.isModelReadOnly||!a.allowDelete||a.selection.count===0)},Wt.prototype.copySelection=function(){var a=this.diagram,y=new pn;for(a=a.selection.iterator;a.next();)gd(y,a.value,!0,this.copiesTree?1/0:0,this.copiesConnectedLinks,function(x){return x.canCopy()});this.copyToClipboard(y)},Wt.prototype.canCopySelection=function(){var a=this.diagram;return!!(a.allowCopy&&a.allowClipboard&&a.selection.count!==0)},Wt.prototype.cutSelection=function(){this.copySelection(),this.deleteSelection()},Wt.prototype.canCutSelection=function(){var a=this.diagram;return!!(!a.isReadOnly&&!a.isModelReadOnly&&a.allowCopy&&a.allowDelete&&a.allowClipboard&&a.selection.count!==0)},Wt.prototype.copyToClipboard=function(a){var y=this.diagram,x=null;if(a===null)Vd=null,ud="";else{x=y.model;var E=!1,b=!1,z=null;try{x.Tl()&&(E=x.Jj,x.Jj=this.copiesParentKey),x.Wj()&&(b=x.Ij,x.Ij=this.copiesGroupKey),z=y.Kj(a,null,!0)}finally{x.Tl()&&(x.Jj=E),x.Wj()&&(x.Ij=b),x=new fn,x.addAll(z),Vd=x,ud=y.model.dataFormat}}y.R("ClipboardChanged",x)},Wt.prototype.pasteFromClipboard=function(){var a=new pn,y=Vd;if(y===null)return a;var x=this.diagram;if(ud!==x.model.dataFormat)return a;var E=x.model,b=!1,z=!1,tt=null;try{E.Tl()&&(b=E.Jj,E.Jj=this.copiesParentKey),E.Wj()&&(z=E.Ij,E.Ij=this.copiesGroupKey),tt=x.Kj(y,x,!1)}finally{for(E.Tl()&&(E.Jj=b),E.Wj()&&(E.Ij=z),y=tt.iterator;y.next();)x=y.value,E=y.key,x.location.w()||(E.location.w()?x.location=E.location:!x.position.w()&&E.position.w()&&(x.position=E.position)),a.add(x)}return a},Wt.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 E=x.iterator;E.next();)E.value.isSelected=!0;if(a!==null){var b=y.computePartsBounds(y.selection);if(b.w()){var z=this.computeEffectiveCollection(y.selection,y.Wm);ad(y,z,new At(a.x-b.centerX,a.y-b.centerY),y.Wm,!1)}}y.R("ClipboardPasted",x)}finally{y.eb("Paste"),y.R("ChangedSelection",y.selection),y.currentCursor=""}},Wt.prototype.canPasteSelection=function(){var a=this.diagram;return!(a.isReadOnly||a.isModelReadOnly||!a.allowInsert||!a.allowClipboard||Vd===null||Vd.count===0||ud!==a.model.dataFormat)},Wt.prototype.undo=function(){this.diagram.undoManager.undo()},Wt.prototype.canUndo=function(){var a=this.diagram;return a.isReadOnly||a.isModelReadOnly?!1:a.allowUndo&&a.undoManager.canUndo()},Wt.prototype.redo=function(){this.diagram.undoManager.redo()},Wt.prototype.canRedo=function(){var a=this.diagram;return a.isReadOnly||a.isModelReadOnly?!1:a.allowUndo&&a.undoManager.canRedo()},Wt.prototype.decreaseZoom=function(a){a===void 0&&(a=1/this.zoomFactor);var y=this.diagram;y.autoScale===hs&&(a=y.scale*a,a<y.minScale||a>y.maxScale||(y.scale=a))},Wt.prototype.canDecreaseZoom=function(a){a===void 0&&(a=1/this.zoomFactor);var y=this.diagram;return y.autoScale!==hs?!1:(a=y.scale*a,a<y.minScale||a>y.maxScale?!1:y.allowZoom)},Wt.prototype.increaseZoom=function(a){a===void 0&&(a=this.zoomFactor);var y=this.diagram;y.autoScale===hs&&(a=y.scale*a,a<y.minScale||a>y.maxScale||(y.scale=a))},Wt.prototype.canIncreaseZoom=function(a){a===void 0&&(a=this.zoomFactor);var y=this.diagram;return y.autoScale!==hs?!1:(a=y.scale*a,a<y.minScale||a>y.maxScale?!1:y.allowZoom)},Wt.prototype.resetZoom=function(a){a===void 0&&(a=this.defaultScale);var y=this.diagram;a<y.minScale||a>y.maxScale||(y.scale=a)},Wt.prototype.canResetZoom=function(a){a===void 0&&(a=this.defaultScale);var y=this.diagram;return a<y.minScale||a>y.maxScale?!1:y.allowZoom},Wt.prototype.zoomToFit=function(){var a=this.diagram,y=a.animationManager;y.Cc(),a.redraw();var x=a.position,E=a.scale;zu(y,"Zoom To Fit"),this.isZoomToFitRestoreEnabled&&E===this.Au&&!isNaN(this.Jt)&&a.documentBounds.D(this.yu)?(a.scale=this.Jt,a.position=this.sw,this.Au=NaN,this.yu=aa):(this.Jt=E,this.sw=x.copy(),a.zoomToFit(),this.Au=a.scale,this.yu=a.documentBounds.copy()),df(y)},Wt.prototype.canZoomToFit=function(){return this.diagram.allowZoom},Wt.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;zu(x,"Scroll To Part");var E=this.scrollToPartPause;if(0<E){var b=le(this,a,[a]);if(b.length===1)y.Ea(),y.es(a.actualBounds),y.eb("Scroll To Part");else{var z=function(){y.Ea();for(var ot=b.pop();0<b.length&&ot instanceof $n&&ot.isTreeExpanded&&(!(ot instanceof er)||ot.isSubGraphExpanded);)ot=b.pop();0<b.length?(ot instanceof Bi&&y.tv(ot.actualBounds),ot instanceof $n&&!ot.isTreeExpanded&&(ot.isTreeExpanded=!0),ot instanceof er&&!ot.isSubGraphExpanded&&(ot.isSubGraphExpanded=!0)):(ot instanceof Bi&&y.es(ot.actualBounds),y.am("LayoutCompleted",tt)),y.eb("Scroll To Part")},tt=function(){Ei(z,(x.isEnabled?x.duration:0)+E)};y.Bj("LayoutCompleted",tt),z()}}else{var rt=y.position.copy();y.es(a.actualBounds),rt.Xa(y.position)&&x.Cc()}}};function le(a,y,x){if(y.isVisible())return x;if(y instanceof Qr)le(a,y.adornedPart,x);else if(y instanceof Nn){var E=y.fromNode;E!==null&&le(a,E,x),y=y.toNode,y!==null&&le(a,y,x)}else y instanceof $n&&(E=y.labeledLink,E!==null&&le(a,E,x),E=y.pg(),E!==null&&(E.isTreeExpanded||E.wasTreeExpanded||x.push(E),le(a,E,x))),y=y.containingGroup,y!==null&&(y.isSubGraphExpanded||y.wasSubGraphExpanded||x.push(y),le(a,y,x));return x}Wt.prototype.canScrollToPart=function(a){return a===void 0&&(a=null),a!==null&&!(a instanceof Bi)?!1:(a=this.diagram,a.selection.count===0&&a.highlighteds.count===0?!1:a.allowHorizontalScroll&&a.allowVerticalScroll)},Wt.prototype.collapseTree=function(a){a===void 0&&(a=null);var y=this.diagram;try{y.Ea("Collapse Tree"),zu(y.animationManager,"Collapse Tree");var x=new fn;if(a!==null&&a.isTreeExpanded)a.collapseTree(),x.add(a);else if(a===null)for(var E=y.selection.iterator;E.next();){var b=E.value;b instanceof $n&&b.isTreeExpanded&&(b.collapseTree(),x.add(b))}y.R("TreeCollapsed",x)}finally{y.eb("Collapse Tree")}},Wt.prototype.canCollapseTree=function(a){a===void 0&&(a=null);var y=this.diagram;if(y.isReadOnly)return!1;if(a!==null){if(!(a instanceof $n&&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 $n&&y.isTreeExpanded&&0<y.Qo().count)return!0;return!1},Wt.prototype.expandTree=function(a){a===void 0&&(a=null);var y=this.diagram;try{y.Ea("Expand Tree"),zu(y.animationManager,"Expand Tree");var x=new fn;if(a!==null&&!a.isTreeExpanded)a.expandTree(),x.add(a);else if(a===null)for(var E=y.selection.iterator;E.next();){var b=E.value;b instanceof $n&&!b.isTreeExpanded&&(b.expandTree(),x.add(b))}y.R("TreeExpanded",x)}finally{y.eb("Expand Tree")}},Wt.prototype.canExpandTree=function(a){a===void 0&&(a=null);var y=this.diagram;if(y.isReadOnly)return!1;if(a!==null){if(!(a instanceof $n)||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 $n&&!y.isTreeExpanded&&0<y.Qo().count)return!0;return!1},Wt.prototype.groupSelection=function(){var a=this.diagram,y=a.model;if(y.Xj()){var x=this.archetypeGroupData;if(x!==null){var E=null;try{a.currentCursor="wait",a.R("ChangingSelection",a.selection),a.Ea("Group");for(var b=new fn,z=a.selection.iterator;z.next();){var tt=z.value;tt.Zc()&&tt.canGroup()&&b.add(tt)}for(var rt=new fn,ot=b.iterator;ot.next();){var lt=ot.value;z=!1;for(var ut=b.iterator;ut.next();)if(lt.Td(ut.value)){z=!0;break}z||rt.add(lt)}if(0<rt.count){var ft=rt.first().containingGroup;if(ft!==null)for(;ft!==null;){b=!1;for(var yt=rt.iterator;yt.next();)if(!yt.value.Td(ft)){b=!0;break}if(b)ft=ft.containingGroup;else break}if(x instanceof er)Zl(x),E=x.copy(),E!==null&&a.add(E);else if(y.Yu(x)){var xt=y.copyNodeData(x);Ie(xt)&&(y.xf(xt),E=a.ii(xt))}if(E!==null){ft!==null&&this.isValidMember(ft,E)&&(E.containingGroup=ft);for(var Ct=rt.iterator;Ct.next();){var bt=Ct.value;this.isValidMember(E,bt)&&(bt.containingGroup=E)}a.clearSelection(!0),E.isSelected=!0}}a.R("SelectionGrouped",E)}finally{a.eb("Group"),a.R("ChangedSelection",a.selection),a.currentCursor=""}}}},Wt.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 Ze(a){var y=Yn();for(a=a.iterator;a.next();){var x=a.value;x instanceof Nn||y.push(x)}a=new pn,x=y.length;for(var E=0;E<x;E++){for(var b=y[E],z=!0,tt=0;tt<x;tt++)if(b.Td(y[tt])){z=!1;break}z&&a.add(b)}return si(y),a}Wt.prototype.isValidMember=function(a,y){if(y===null||a===y||y instanceof Nn)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},Wt.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 E=new fn;if(a!==null)E.add(a);else for(var b=y.selection.iterator;b.next();){var z=b.value;z instanceof er&&z.canUngroup()&&E.add(z)}var tt=new fn;if(0<E.count){y.clearSelection(!0);for(var rt=E.iterator;rt.next();){var ot=rt.value;ot.expandSubGraph();var lt=ot.containingGroup,ut=lt!==null&<.data!==null?x.wa(lt.data):void 0;tt.addAll(ot.memberParts);for(var ft=tt.iterator;ft.next();){var yt=ft.value;if(yt.isSelected=!0,!(yt instanceof Nn)){var xt=yt.data;xt!==null?x.mp(xt,ut):yt.containingGroup=lt}}y.remove(ot)}}y.R("SelectionUngrouped",E,tt)}finally{y.eb("Ungroup"),y.R("ChangedSelection",y.selection),y.currentCursor=""}},Wt.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 er))return!1;if(a.canUngroup())return!0}else for(a=y.selection.iterator;a.next();)if(y=a.value,y instanceof er&&y.canUngroup())return!0;return!1},Wt.prototype.addTopLevelParts=function(a,y){var x=!0;for(a=Ze(a).iterator;a.next();){var E=a.value;E.containingGroup!==null&&(!y||this.isValidMember(null,E)?E.containingGroup=null:x=!1)}return x},Wt.prototype.collapseSubGraph=function(a){a===void 0&&(a=null);var y=this.diagram;try{y.Ea("Collapse SubGraph"),zu(y.animationManager,"Collapse SubGraph");var x=new fn;if(a!==null&&a.isSubGraphExpanded)a.collapseSubGraph(),x.add(a);else if(a===null)for(var E=y.selection.iterator;E.next();){var b=E.value;b instanceof er&&b.isSubGraphExpanded&&(b.collapseSubGraph(),x.add(b))}y.R("SubGraphCollapsed",x)}finally{y.eb("Collapse SubGraph")}},Wt.prototype.canCollapseSubGraph=function(a){a===void 0&&(a=null);var y=this.diagram;if(y.isReadOnly)return!1;if(a!==null)return!!(a instanceof er&&a.isSubGraphExpanded);for(a=y.selection.iterator;a.next();)if(y=a.value,y instanceof er&&y.isSubGraphExpanded)return!0;return!1},Wt.prototype.expandSubGraph=function(a){a===void 0&&(a=null);var y=this.diagram;try{y.Ea("Expand SubGraph"),zu(y.animationManager,"Expand SubGraph");var x=new fn;if(a!==null&&!a.isSubGraphExpanded)a.expandSubGraph(),x.add(a);else if(a===null)for(var E=y.selection.iterator;E.next();){var b=E.value;b instanceof er&&!b.isSubGraphExpanded&&(b.expandSubGraph(),x.add(b))}y.R("SubGraphExpanded",x)}finally{y.eb("Expand SubGraph")}},Wt.prototype.canExpandSubGraph=function(a){a===void 0&&(a=null);var y=this.diagram;if(y.isReadOnly)return!1;if(a!==null)return a instanceof er&&!a.isSubGraphExpanded;for(a=y.selection.iterator;a.next();)if(y=a.value,y instanceof er&&!y.isSubGraphExpanded)return!0;return!1},Wt.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 E=y.selection.iterator;E.next();){var b=E.value;if(b.canEdit()){a=b;break}}if(a===null)return;a=a.Nl(function(z){return z instanceof Ao&&z.editable})}a!==null&&(y.currentTool=null,x.textBlock=a,y.currentTool=x)}},Wt.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 Ao))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 Ao&&x.editable}),a!==null))return!0;return!1},Wt.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 E=y.lastInput,b=null;a instanceof ge?b=a.ga(lr):y.viewportBounds.ca(E.documentPoint)||(b=y.viewportBounds,b=new At(b.x+b.width/2,b.y+b.height/2)),b!==null&&(E.viewPoint=y.op(b),E.documentPoint=b,E.left=!1,E.right=!0,E.up=!0),y.currentTool=x,rh(x,!1,a)}},Wt.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)},Wt.prototype.computeEffectiveCollection=function(a,y){var x=this.diagram,E=x.toolManager.findTool("Dragging"),b=x.currentTool===E;if(y===void 0&&(y=b?E.dragOptions:x.Wm),E=new be,a===null)return E;for(var z=a.iterator;z.next();)Hu(x,E,z.value,b,y);if(x.draggedLink!==null&&y.dragsLink)return E;for(z=a.iterator;z.next();)a=z.value,a instanceof Nn&&(y=a.fromNode,y===null||E.contains(y)?(y=a.toNode,y===null||E.contains(y)||E.remove(a)):E.remove(a));return E},ye.Object.defineProperties(Wt.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||Gt("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}}}),Wt.className="CommandHandler",Jp=function(){return new Wt};function ge(){Hi(this),this.l=30723,this.pb=1,this.bn="",this.Ma=this.Me=null,this.pa=new At(NaN,NaN).freeze(),this.jd=qr,this.Ab=new ae,this.wh=new ae,this.Lb=null,this.Ca=this.Kk=1,this.Kb=0,this.Kg=ga,this.uc=new Be(NaN,NaN,NaN,NaN).freeze(),this.Ib=new Be(NaN,NaN,NaN,NaN).freeze(),this.dc=new Be(0,0,NaN,NaN).freeze(),this.ba=this.Yn=this.Zn=null,this.sk=this.Jb=wa,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 Sn,hn,xi,Fi,Ri,rr,Zr,xr,Ur,Eo;ge.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=bn(this.Dh)),this.tb!==null&&(a.tb=this.tb.copy())},ge.prototype.Vw=function(a){var y=this.Dh;if($e(y)){for(var x=0;x<y.length;x++)if(y[x]===a)return}else this.Dh=y=[];y.push(a)},ge.prototype.Af=function(a){a.Zn=null,a.Ng=null,a.v()},ge.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},ge.prototype.copy=function(){return this.clone()},wt=ge.prototype,wt.qb=function(a){a.classType===Nn?a.name.indexOf("Orient")===0?this.segmentOrientation=a:Gt("Unknown Link enum value for GraphObject.segmentOrientation property: "+a):a.classType===ge&&(this.stretch=a)},wt.toString=function(){return ei(this.constructor)+"#"+ji(this)},wt.th=function(){this.A!==null&&(this.A.nc=!0)};function vr(a){a.A===null?a.A=new Oc:a.A.nc&&(a.A=a.A.copy())}wt.Xc=function(){if(this.ba===null){var a=new Kg;a.Xi=ar,a.yj=ar,a.Vi=10,a.wj=10,a.Wi=0,a.xj=0,this.ba=a}},wt.cb=function(a,y,x,E,b,z,tt){var rt=this.part;if(rt!==null&&(rt.gk(a,y,x,E,b,z,tt),x===this&&a===wr&&Ya(this)&&Ho(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 be),tt=z.undoManager.transactionLevel===0,a.startCondition===id?tt=!0:a.startCondition===Rd&&(tt=!1),tt?(z=new ts,Kp(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,E,b),z.start()):(zu(z.animationManager,"Trigger"),z.animationManager.defaultAnimation.add(this,y,E,b)))),this instanceof wn&&x===rt&&(rt.l&16777216)!==0&&rt.data!==null))for(x=this.O.s,E=x.length,b=0;b<E;b++)rt=x[b],rt instanceof wn&&$d(rt,function(ot){ot.data!==null&&ot.l&16777216&&ot.La(y)})};function Ho(a,y,x){var E=a.ih();if(E!==null)for(var b=a.localBindings.iterator;b.next();){var z=b.value,tt=null;if(z.sourceName!==null){if(tt=FS(z,E,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,E)}else{if(rt=E.data,rt===null)continue;var ot=y.diagram;ot===null||ot.skipsModelSourceBindings||z.sp(a,rt,x,E)}tt===a&&(rt=E.ks(z.Ai),rt!==null&&z.Mv(rt,tt,x))}}wt.ks=function(a){return this.bindingId===a?this:null},wt.g=function(a,y,x){this.cb(wr,a,this,y,x)},wt.Ge=function(a,y,x,E){var b=this.uc;if(b.h(a,y,x,E),this.Ca!==1||this.Kb!==0){this.Lb===null&&(this.Lb=new ae);var z=this.Lb;z.reset(),this.no(z,a,y,x,E),z.pp(b)}};function Ma(a,y,x,E){return a.pickable===!1?!1:(E.multiply(a.transform),x?a.Yc(y,E):a.fh(y,E))}wt.tx=function(a,y,x){if(this.pickable===!1)return!1;var E=this.naturalBounds;return y=a.Bf(y),x?Xn(a.x,a.y,0,0,0,E.height)<=y||Xn(a.x,a.y,0,E.height,E.width,E.height)<=y||Xn(a.x,a.y,E.width,E.height,E.width,0)<=y||Xn(a.x,a.y,E.width,0,0,0)<=y:a.zd(0,0)<=y&&a.zd(0,E.height)<=y&&a.zd(E.width,0)<=y&&a.zd(E.width,E.height)<=y},wt.se=function(){return!0},wt.ca=function(a){var y=At.alloc();y.assign(a),this.transform.Ga(y);var x=this.actualBounds;if(!x.w())return At.free(y),!1;var E=this.diagram;if(E!==null&&E.wq){var b=E.Ql("extraTouchThreshold"),z=E.Ql("extraTouchArea"),tt=z/2,rt=this.naturalBounds;E=this.Df()*E.scale;var ot=1/E;if(rt.width*E<b&&rt.height*E<b)return a=jr(x.x-tt*ot,x.y-tt*ot,x.width+z*ot,x.height+z*ot,y.x,y.y),At.free(y),a}return b=!1,(this instanceof Qr||this instanceof cr?jr(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)?b=!1:this.areaBackground!==null&&x.ca(y)||this.Ma!==null&&this.dc.ca(a)?b=!0:b=this.gh(a)),At.free(y),b},wt.gh=function(a){var y=this.naturalBounds;return jr(0,0,y.width,y.height,a.x,a.y)},wt.Re=function(a){if(this.angle===0)return this.actualBounds.Re(a);var y=this.naturalBounds;y=Be.allocAt(0,0,y.width,y.height);var x=this.transform,E=!1,b=At.allocAt(a.x,a.y);return y.ca(x.Cd(b))&&(b.h(a.x,a.bottom),y.ca(x.Cd(b))&&(b.h(a.right,a.bottom),y.ca(x.Cd(b))&&(b.h(a.right,a.y),y.ca(x.Cd(b))&&(E=!0)))),At.free(b),Be.free(y),E},wt.fh=function(a,y){if(y===void 0)return a.Re(this.actualBounds);var x=this.naturalBounds,E=!1,b=At.allocAt(0,0);return a.ca(y.Ga(b))&&(b.h(0,x.height),a.ca(y.Ga(b))&&(b.h(x.width,x.height),a.ca(y.Ga(b))&&(b.h(x.width,0),a.ca(y.Ga(b))&&(E=!0)))),At.free(b),E},wt.Yc=function(a,y){if(y===void 0&&(y=this.transform,this.angle===0))return a.Yc(this.actualBounds);var x=this.naturalBounds,E=At.allocAt(0,0),b=At.allocAt(0,x.height),z=At.allocAt(x.width,x.height),tt=At.allocAt(x.width,0),rt=!1;if(a.ca(y.Ga(E))||a.ca(y.Ga(b))||a.ca(y.Ga(z))||a.ca(y.Ga(tt)))rt=!0;else{x=Be.allocAt(0,0,x.width,x.height);var ot=At.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)))),At.free(ot),Be.free(x),!rt&&(_t.us(a,E,b)||_t.us(a,b,z)||_t.us(a,z,tt)||_t.us(a,tt,E))&&(rt=!0)}return At.free(E),At.free(b),At.free(z),At.free(tt),rt},wt.ga=function(a,y){if(y===void 0&&(y=new At),a instanceof fi){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},wt.mi=function(a){a===void 0&&(a=new Be);var y=this.naturalBounds,x=this.oe,E=At.allocAt(0,0).transform(x);return a.h(E.x,E.y,0,0),E.h(y.width,0).transform(x),Rr(a,E.x,E.y,0,0),E.h(y.width,y.height).transform(x),Rr(a,E.x,E.y,0,0),E.h(0,y.height).transform(x),Rr(a,E.x,E.y,0,0),At.free(E),a},wt.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},wt.Df=function(){if(!(this.l&4096))return this.Kk;var a=this.Ca;return this.panel!==null?a*this.panel.Df():a},wt.qs=function(a,y){return y===void 0&&(y=new At),y.assign(a),this.oe.Cd(y),y},wt.rs=function(a,y,x){return this.Sj(a.x,a.y,y.x,y.y,x)},wt.Sj=function(a,y,x,E,b){var z=this.transform,tt=1/(z.m11*z.m22-z.m12*z.m21),rt=z.m22*tt,ot=-z.m12*tt,lt=-z.m21*tt,ut=z.m11*tt,ft=tt*(z.m21*z.dy-z.m22*z.dx),yt=tt*(z.m12*z.dx-z.m11*z.dy);return this.areaBackground!==null?(z=this.actualBounds,_t.Ff(z.left,z.top,z.right,z.bottom,a,y,x,E,b)):(tt=a*rt+y*lt+ft,a=a*ot+y*ut+yt,y=x*rt+E*lt+ft,x=x*ot+E*ut+yt,b.h(0,0),E=this.naturalBounds,x=_t.Ff(0,0,E.width,E.height,tt,a,y,x,b),b.transform(z),x)},ge.prototype.measure=function(a,y,x,E){if(gl(this)!==!1){var b=this.Kg,z=b.right+b.left;b=b.top+b.bottom,a=Math.max(a-z,0),y=Math.max(y-b,0),x=Math.max((x||0)-z,0),E=Math.max((E||0)-b,0),z=this.angle,b=this.desiredSize;var tt=this.kq();z===90||z===270?(a=isFinite(b.height)?b.height+tt:a,y=isFinite(b.width)?b.width+tt:y):(a=isFinite(b.width)?b.width+tt:a,y=isFinite(b.height)?b.height+tt:y),b=x||0,tt=E||0;var rt=this instanceof wn;switch(Os(this,!0)){case hn:tt=b=0,rt&&(y=a=1/0);break;case Sn:isFinite(a)&&a>x&&(b=a),isFinite(y)&&y>E&&(tt=y);break;case Fi:isFinite(a)&&a>x&&(b=a),tt=0,rt&&(y=1/0);break;case Ri:isFinite(y)&&y>E&&(tt=y),b=0,rt&&(a=1/0)}rt=this.maxSize;var ot=this.minSize;b>rt.width&&ot.width<rt.width&&(b=rt.width),tt>rt.height&&ot.height<rt.height&&(tt=rt.height),x=Math.max(b,ot.width),E=Math.max(tt,ot.height),rt.width<x&&(x=Math.min(ot.width,x)),rt.height<E&&(E=Math.min(ot.height,E)),a=Math.min(rt.width,a),y=Math.min(rt.height,y),a=Math.max(x,a),y=Math.max(E,y),(z===90||z===270)&&(z=a,a=y,y=z,z=x,x=E,E=z),this.uc.ka(),this.Wl(a,y,x,E),this.uc.freeze(),this.uc.w()||Gt("Non-real measuredBounds has been set. Object "+this+", measuredBounds: "+this.uc.toString()),ya(this,!1)}},ge.prototype.Wl=function(){},ge.prototype.Dd=function(){return!1},ge.prototype.arrange=function(a,y,x,E,b){this.Uk();var z=Be.alloc();z.assign(this.Ib),this.Ib.ka(),ws(this)===!1?this.Ib.h(a,y,x,E):this.eh(a,y,x,E),this.Ib.freeze(),b===void 0?this.tb=null:this.tb=b,x=!1,b!==void 0?x=!0:(b=this.panel,b!==null&&Th(b)&&(b=b.panel),b!==null&&(b=b.dc,E=this.measuredBounds,this.areaBackground!==null&&(E=this.Ib),x=y+E.height,E=a+E.width,x=!(0<=a+.05&&E<=b.width+.05&&0<=y+.05&&x<=b.height+.05),this instanceof Ao&&(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()||Gt("Non-real actualBounds has been set. Object "+this+", actualBounds: "+this.Ib.toString()),this.Xl(z,this.Ib),Wu(this,!1),Be.free(z)},wt=ge.prototype,wt.eh=function(){};function ds(a,y,x,E,b){if(a.Ib.h(y,x,E,b),!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,E+=y,b+=tt,y=Os(a,!0),x===E&&z===b&&(y=hn),y){case hn:(x>E||z>b)&&(ya(a,!0),a.measure(x>E?E:x,z>b?b:z,0,0));break;case Sn:ya(a,!0),a.measure(E,b,0,0);break;case Fi:ya(a,!0),a.measure(E,z,0,0);break;case Ri:ya(a,!0),a.measure(x,b,0,0)}}}wt.Xl=function(a,y){var x=this.part;x!==null&&x.diagram!==null&&(x.selectionObject!==this&&x.resizeObject!==this&&x.rotateObject!==this||Rv(x,!0),this.N(),Hr(a,y)||(x.oh(),this.Pn(x)))},wt.Pn=function(a){this.portId!==null&&(Rv(a,!0),a instanceof $n&&H1(a,this))},wt.gc=function(a,y){if(!Cl(this,a,y)&&this.visible){var x=this.opacity;if(x!==0){var E=1;x!==1&&(E=a.globalAlpha,a.globalAlpha=E*x);var b="";this.filter!==""&&(b=a.filter,a.filter=this.filter);var z=this instanceof wn&&Th(this),tt=this.Ib;if(z){var rt=this.Ib,ot=this.dc,lt=this.areaBackground,ut=this.Ma;lt===null&&ut===null||a.yc(),lt!==null&&(na(this,a,lt,!0,!0,ot,rt),lt instanceof mo&<.type===Fl?(a.beginPath(),a.rect(rt.x,rt.y,rt.width,rt.height),a.ng(lt)):a.fillRect(rt.x,rt.y,rt.width,rt.height)),ut!==null&&(na(this,a,ut,!0,!1,ot,rt),ut instanceof mo&&ut.type===Fl?(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&&Va(this),lt=this.part,ot=!1;var ft=0;lt&&y.Gf("drawShadows")&&(ot=lt.isShadowed)&&(ut=lt.shadowOffset,ft=Math.max(ut.y,ut.x)*y.scale*y.Mb),ut=this.Dd();var yt;if(!(yt=y.$i||!ut)){var xt=this.naturalBounds;yt=this.wh;var Ct=yt.m11,bt=yt.m21,Vt=yt.dx,zt=yt.m12,Qt=yt.m22,ee=yt.dy,oe,ce=oe=0;yt=oe*Ct+ce*bt+Vt;var Me=oe*zt+ce*Qt+ee;oe=xt.width+ft,ce=0;var Wn=oe*Ct+ce*bt+Vt;oe=oe*zt+ce*Qt+ee,ce=Math.min(yt,Wn);var di=Math.min(Me,oe),oi=Math.max(yt+0,Wn)-ce,kn=Math.max(Me+0,oe)-di;yt=ce,Me=di,oe=xt.width+ft,ce=xt.height+ft,Wn=oe*Ct+ce*bt+Vt,oe=oe*zt+ce*Qt+ee,ce=Math.min(yt,Wn),di=Math.min(Me,oe),oi=Math.max(yt+oi,Wn)-ce,kn=Math.max(Me+kn,oe)-di,yt=ce,Me=di,oe=0,ce=xt.height+ft,Wn=oe*Ct+ce*bt+Vt,oe=oe*zt+ce*Qt+ee,ce=Math.min(yt,Wn),di=Math.min(Me,oe),oi=Math.max(yt+oi,Wn)-ce,kn=Math.max(Me+kn,oe)-di,yt=ce,Me=di,ft=y.viewportBounds,xt=ft.x,Ct=ft.y,yt=!(yt>ft.width+xt||xt>oi+yt||Me>ft.height+Ct||Ct>kn+Me)}if(yt){if(yt=(this.l&256)!==0,a.clipInsteadOfFill&&(yt=!1),this instanceof Ao&&(a.font=this.font),yt){if(Me=rt.se()?rt.naturalBounds:rt.actualBounds,oi=Math.max(tt.x,Me.x),kn=Math.max(tt.y,Me.y),ft=Math.min(tt.right,Me.right)-oi,xt=Math.min(tt.bottom,Me.bottom)-kn,Ct=this.tb,Ct!==null&&(oi=Ct.x,kn=Ct.y,ft=Ct.width,xt=Ct.height),oi>tt.width+tt.x||tt.x>Me.width+Me.x){x!==1&&(a.globalAlpha=E),this.filter!==""&&(a.filter=b);return}a.save(),a.beginPath(),a.rect(oi,kn,ft,xt),a.clip()}if(ut){if(!lt.isVisible()){x!==1&&(a.globalAlpha=E),this.filter!==""&&(a.filter=b);return}ot&&(Me=lt.shadowOffset,a.Ev(Me.x*y.scale*this.scale*y.Mb,Me.y*y.scale*this.scale*y.Mb,lt.shadowBlur),uh(a),a.shadowColor=lt.shadowColor)}ot&&this.shadowVisible===!0?uh(a):ot&&this.shadowVisible===!1&&Vu(a),lt=this.naturalBounds,this.areaBackground!==null&&(a.yc(),fl(this,a,lt,tt)),a.transform(z.m11,z.m12,z.m21,z.m22,z.dx,z.dy),ot&&ja(this,rt)&&this.shadowVisible===null&&Vu(a),this.Ma!==null&&(a.yc(),Ws(this,a,lt,tt)),ot&&(this.Ma!==null||this.areaBackground!==null||ja(this,rt))?(eu(this,!0),this.shadowVisible===null&&Vu(a)):eu(this,!1),this.hh(a,y),ot&&this.l&512&&uh(a),ut&&ot&&Vu(a),yt&&(a.restore(),a.Vc(this instanceof wn)),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=E),this.filter!==""&&(a.filter=b)}}};function ja(a,y){return y===null?!1:(Th(y)&&(y=y.panel),(y.l&512)!==0||(y.type===wn.Auto||y.type===wn.Spot)&&y.Pb()!==a)}wt.Dv=function(){};function fl(a,y,x,E){na(a,y,a.areaBackground,!0,!0,x,E),a.areaBackground instanceof mo&&a.areaBackground.type===Fl?(y.beginPath(),y.rect(E.x,E.y,E.width,E.height),y.ng(a.areaBackground)):y.fillRect(E.x,E.y,E.width,E.height)}function Ws(a,y,x,E){var b=a.kq(),z=x.x,tt=x.y,rt=x.width+b,ot=x.height+b;na(a,y,a.Ma,!0,!1,x,E),a.Ma instanceof mo&&a.Ma.type===Fl?(y.beginPath(),y.rect(z-b/2,tt-b/2,rt,ot),y.ng(a.Ma)):y.fillRect(z-b/2,tt-b/2,rt,ot)}function as(a,y,x){for(var E=y.O.s,b=E.length,z=-1,tt=0;tt<b;tt++)if(E[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===wn.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 Cl(a,y,x){if(!(y instanceof tl))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 E=a.panel,b=a.nk(y);if(a.kk(y,x,b))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):E&&as(a,E,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),uh(y),y.shadowColor=a.shadowColor}a instanceof Ao&&(y.font=a.font),y.yd=null;var tt=a.transform;z=a instanceof wn;var rt=a instanceof wn?Th(a):!1;a.l&4096&&Va(a);var ot=a.Ib;if(y.rb.ha=[1,0,0,1,0,0],y.o=!1,b&&(y.o=!0,z&&rt?(Ug(y,1,0,0,1,0,0),a.svg=y.ad):z?(Ug(y,tt.m11,tt.m12,tt.m21,tt.m22,tt.dx,tt.dy),a.svg=y.ad):Ug(y,1,0,0,1,0,0)),b=a.naturalBounds,a.areaBackground!==null){var lt=tt.copy().Vj();y.rb.ha=[lt.m11,lt.m12,lt.m21,lt.m22,lt.dx,lt.dy],fl(a,y,b,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]),Ws(a,y,b,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],Ws(a,y,b,ot)),y.yd.Ma=y.ad,y.yd.prepend(y.ad)),tt=y.yd,b=a.part,rt=!1,b&&x.Gf("drawShadows")&&(rt=b.isShadowed),y.clipInsteadOfFill&&(rt=!1),a.Dd()&&rt&&uh(y),rt&&a.shadowVisible===!0?uh(y):rt&&a.shadowVisible===!1&&Vu(y),b=a.panel,rt&&ja(a,b)&&a.shadowVisible===null&&Vu(y),y.Il&&(lt=x.computePixelRatio(),lt="drop-shadow("+y.shadowOffsetX/lt+"px "+y.shadowOffsetY/lt+"px "+y.shadowBlur/lt/2+"px "+y.shadowColor+")",a.background!==null&&tt.Ma.setAttributeNS(null,"filter",lt),a.areaBackground!==null&&tt.gd.setAttributeNS(null,"filter",lt)),rt&&(a.Ma!==null||a.areaBackground!==null||ja(a,b))?(eu(a,!0),a.shadowVisible===null&&Vu(y)):eu(a,!1),b=rt,a.hh(y,x),z&&y.nh.pop(),y.o&&y.nh.pop(),tt=y.Gv.hs,rt=z?a.svg:y.yd,lt=a.svg,!z&<!==null&&rt!==lt&<.parentNode===a.panel.svg?(a.svg.replaceWith(rt),a.svg=rt,rt!==null&&a.$o(y,E,ot,rt),Ds(y,lt),!0):(a.svg=rt,tt!==null&&rt===null&&(dm(y),y.nh.pop()),rt===null||(a.$o(y,E,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+")")),b&&a.l&512&&uh(y),a.Dd()&&Vu(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):E!==null&&as(a,E,rt),tt!==null&&tt(a,rt)),!0)}wt.$o=function(a,y,x,E){var b=(this.l&256)!==0;if(a.clipInsteadOfFill&&(b=!1),b){var z=y.se()?y.naturalBounds:y.actualBounds;y=Math.max(x.x,z.x),b=Math.max(x.y,z.y);var tt=Math.min(x.right,z.right)-y;x=Math.min(x.bottom,z.bottom)-b,z=this.tb,z!==null&&(y=z.x,b=z.y,tt=z.width,x=z.height),z=E.getAttribute("clip-path");var rt=null;z!==null&&(rt=a.svg.getElementById(z.split("#")[1].slice(0,-1))),rt===null?(z="CLIP"+xo++,rt=a.Ud("clipPath",{id:z}),y=a.Ud("rect",{x:y,y:b,width:tt,height:x}),this instanceof wn&&(b=this.transform.copy().Vj(),y.setAttribute("transform","matrix("+b.m11+", "+b.m12+", "+b.m21+", "+b.m22+", "+b.dx+", "+b.dy+")")),rt.appendChild(y),a.svg.appendChild(rt),E.setAttributeNS(null,"clip-path","url(#"+z+")")):(a=rt.firstElementChild,a.setAttribute("x",y.toString()),a.setAttribute("y",b.toString()),a.setAttribute("width",tt.toString()),a.setAttribute("height",x.toString()))}else E.removeAttributeNS(null,"clip-path"),Ds(a,E)};function Ds(a,y){y=y.getAttribute("clip-path"),y!==null&&(a=a.svg.getElementById(y.split("#")[1].slice(0,-1)),a!==null&&a.remove())}function ss(a){if(a.svg!==null){var y=a.svg.innerHTML.match(/url\(#((CLIP|GRAD).+?)\)/g),x=a.svg.ownerDocument;if(y!==null){y=Hn(y);for(var E=y.next();!E.done;E=y.next())E=x.getElementById(E.value.split("#")[1].slice(0,-1)),E!==null&&E.remove()}a.svg.remove()}}wt.hh=function(){},wt.lv=function(){this.Uc=!0},wt.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 E=this.transform,b=this instanceof wn?Th(this):!1;if(!(this instanceof wn&&b))if(this instanceof _s){var z=this.bt;a.rb.ha=[E.m11,E.m12,E.m21,E.m22,E.dx,E.dy],z!==null&&Xy(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 wn)y.setAttributeNS(null,"transform","matrix("+E.m11+", "+E.m12+", "+E.m21+", "+E.m22+", "+E.dx+", "+E.dy+")");else if(this instanceof cr){z=y.getElementsByTagName("path");for(var tt=0;tt<z.length;tt++)z[tt].setAttributeNS(null,"transform","matrix("+E.m11+", "+E.m12+", "+E.m21+", "+E.m22+", "+E.dx+", "+E.dy+")")}else y.lastElementChild.setAttributeNS(null,"transform","matrix("+E.m11+", "+E.m12+", "+E.m21+", "+E.m22+", "+E.dx+", "+E.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=E.copy().Vj(),a.rb.ha=[tt.m11,tt.m12,tt.m21,tt.m22,tt.dx,tt.dy],fl(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&&cm(a,z)),(this.background!==null||y.Ma!==void 0)&&(z=y.Ma,this.background===null?(cm(a,y.Ma),y.Ma.remove(),y.Ma=void 0):((b||x&&!(this instanceof wn))&&(a.rb.ha=[E.m11,E.m12,E.m21,E.m22,E.dx,E.dy]),Ws(this,a,this.naturalBounds,this.actualBounds),y.Ma?(cm(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&&cm(a,z)),this.$o(a,this.panel,this.actualBounds,y),!0},wt.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 na(a,y,x,E,b,z,tt){if(x!==null){var rt=1,ot=1;if(typeof x=="string")E?y.fillStyle=x:y.strokeStyle=x;else if(x.type===Ah)E?y.fillStyle=x.color:y.strokeStyle=x.color;else{var lt=a.kq();if(rt=z.width,ot=z.height,b?(rt=tt.width,ot=tt.height):E||(rt+=lt,ot+=lt),(z=y instanceof Qd)&&x.xe&&(x.type===Df||x.yk===rt&&x.ft===ot))var ut=x.xe;else{var ft=0,yt=0,xt=0,Ct=0,bt=0,Vt=0;if(Vt=bt=0,b?(bt=tt.x,Vt=tt.y):E||(bt-=lt/2,Vt-=lt/2),ft=x.start.x*rt+x.start.offsetX,yt=x.start.y*ot+x.start.offsetY,xt=x.end.x*rt+x.end.offsetX,Ct=x.end.y*ot+x.end.offsetY,ft+=bt,xt+=bt,yt+=Vt,Ct+=Vt,x.type===dh)ut=y.createLinearGradient(ft,yt,xt,Ct);else if(x.type===Fl)Vt=isNaN(x.endRadius)?Math.max(rt,ot)/2:x.endRadius,isNaN(x.startRadius)?(bt=0,Vt=Math.max(rt,ot)/2):bt=x.startRadius,ut=y.createRadialGradient(ft,yt,bt,xt,Ct,Vt);else if(x.type===Df)try{ut=y.createPattern(x.pattern,"repeat")}catch(Qt){ut=null}if(x.type!==Df&&(b=x.colorStops,b!==null))for(b=b.iterator;b.next();)ut.addColorStop(b.key,b.value);if(z&&(x.xe=ut,ut!==null&&(x.yk=rt,x.ft=ot),ut===null&&x.type===Df&&x.yk!==-1)){x.yk=-1;var zt=a.diagram;zt!==null&&x.yk===-1&&Ei(function(){zt.redraw()},600)}}E?y.fillStyle=ut:y.strokeStyle=ut}}}wt.rg=function(a){if(a instanceof wn)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},wt.Ed=function(){if(!this.visible)return!1;var a=this.panel;return a!==null?a.Ed():!0},wt.If=function(){for(var a=this instanceof wn?this:this.panel;a!==null&&a.isEnabled;)a=a.panel;return a===null};function Va(a){if(a.l&2048){var y=a.Ab;if(y.reset(),!a.Ib.w()||!a.uc.w()){jl(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)}jl(a,!1),El(a,!0)}a.l&4096&&(y=a.panel,y===null?(a.wh.set(a.Ab),a.Kk=a.scale,El(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,El(a,!1)))}wt.no=function(a,y,x,E,b){if(this.Ca!==1&&a.scale(this.Ca),this.Kb!==0){var z=At.alloc();z.yi(y,x,E,b,lr),a.rotate(this.Kb,z.x,z.y),At.free(z)}},wt.v=function(a){if(!gl(this)){a===void 0&&(a=!1),ya(this,!0),Wu(this,!0);var y=this.panel;y===null||a||y.v()}},wt.Uj=function(){gl(this)||(ya(this,!0),Wu(this,!0))};function Ps(a){if(!ws(a)){var y=a.panel;y!==null?y.v():a.Dd()&&(y=a.diagram,y!==null&&(y.De.add(a),a instanceof $n&&a.Bd(),y.$b())),Wu(a,!0)}}wt.Uk=function(){!(this.l&2048)&&(jl(this,!0),El(this,!0))},wt.Wu=function(){El(this,!0)},wt.N=function(){var a=this.part;a!==null&&a.N()};function Os(a,y){var x=a.stretch,E=a.panel;return E!==null&&E.type===wn.Table?pu(a,E.Fb(a.row),E.Eb(a.column),y):E!==null&&E.type===wn.Auto&&E.Pb()===a?za(a,Sn,y):x===rr?E!==null?E.type===wn.Spot&&E.Pb()===a?za(a,Sn,y):(x=E.defaultStretch,x===rr?za(a,hn,y):za(a,x,y)):za(a,hn,y):za(a,x,y)}function pu(a,y,x,E){var b=a.stretch;if(b!==rr)return za(a,b,E);var z=b=null;switch(y.stretch){case Ri:z=!0;break;case Sn:z=!0}switch(x.stretch){case Fi:b=!0;break;case Sn:b=!0}return y=a.panel.defaultStretch,b===null&&(b=y===Fi||y===Sn),z===null&&(z=y===Ri||y===Sn),b===!0&&z===!0?za(a,Sn,E):b===!0?za(a,Fi,E):z===!0?za(a,Ri,E):za(a,hn,E)}function za(a,y,x){if(x)return y;if(y===hn||(x=a.desiredSize,x.w()))return hn;if(a=a.angle,!isNaN(x.width))if(a!==90&&a!==270){if(y===Fi)return hn;if(y===Sn)return Ri}else{if(y===Ri)return hn;if(y===Sn)return Fi}if(!isNaN(x.height))if(a!==90&&a!==270){if(y===Ri)return hn;if(y===Sn)return Fi}else{if(y===Fi)return hn;if(y===Sn)return Ri}return y}function eu(a,y){a.l=y?a.l|512:a.l&-513}function Ya(a){return(a.l&1024)!==0}function Dc(a,y){a.l=y?a.l|1024:a.l&-1025}function jl(a,y){a.l=y?a.l|2048:a.l&-2049}function El(a,y){a.l=y?a.l|4096:a.l&-4097}function gl(a){return(a.l&8192)!==0}function ya(a,y){a.l=y?a.l|8192:a.l&-8193}function ws(a){return(a.l&16384)!==0}function Wu(a,y){a.l=y?a.l|16384:a.l&-16385}wt.Gj=function(){this.svg=null},wt.wi=function(a){this.Me=a,this.svg!==null&&this.svg.remove()},wt.Av=function(){},wt.zv=function(a){return this.pa=a,Ps(this),!0},wt.mm=function(a,y){(this.pa.x!==a||this.pa.y!==y)&&(this.pa.h(a,y),this.Uk())},wt.kq=function(){return 0};function Xd(a){var y=a.part;if(y instanceof $n&&(a.portId!==null||a===y.port)){var x=y.diagram;x===null||x.undoManager.isUndoingRedoing||H1(y,a)}}function Uy(a){var y=a.diagram;y===null||y.undoManager.isUndoingRedoing||(a instanceof wn?a instanceof $n?a.Bd():a.qm(a,function(x){Xd(x)}):Xd(a))}wt.bind=function(a,y,x,E){var b=null;return typeof a=="string"?b=new ha(a,y,x,E):b=a,b.xd=this,a=this.ih(),a!==null&&c1(a)&&Gt("Cannot add a Binding to a template that has already been copied: "+b),this.localBindings===null&&(this.localBindings=new fn),this.localBindings.add(b),this},wt.set=function(a){return Object.assign(this,a),this},wt.Du=function(a){return nv(this,a),this},wt.apply=function(a){return a(this),this},wt.nm=function(a){return Zd(this,a),this},wt.pz=function(){return this.ih()},wt.ih=function(){for(var a=this instanceof wn?this:this.panel;a!==null;){if(a.allBindings!==null)return a;a=a.panel}return null},wt.Jv=function(a){return a.xd=this,this.animationTriggers===null&&(this.animationTriggers=new be),this.animationTriggers.add(a.propertyName,a),this};function Ll(a,y){for(var x=1;x<arguments.length;++x);x=arguments;var E=null,b=null;if(typeof a=="function")b=a;else if(typeof a=="string"){var z=kf.I(a);typeof z=="function"?(x=bn(arguments),E=z(x),Ie(E)||Gt('GraphObject.make invoked object builder "'+a+'", but it did not return an Object')):b=Je.go[a]}if(E===null&&(b!=null&&b.constructor||Gt("GraphObject.make requires a class function or GoJS class name or name of an object builder, not: "+a),E=new b),b=1,E instanceof ke&&1<x.length){z=E;var tt=x[1];(typeof tt=="string"||tt instanceof HTMLDivElement)&&(Pg(z,tt),b++)}for(;b<x.length;b++)z=x[b],z===void 0?Gt("Undefined value at argument "+b+" for object being constructed by GraphObject.make: "+E):nv(E,z);return E}function nv(a,y){if(typeof y=="string")if(a instanceof Ao)a.text=y;else if(a instanceof cr)a.figure=y;else if(a instanceof _s)a.source=y;else if(a instanceof wn)y=nu.I(y),y!==null&&(a.type=y);else if(a instanceof mo){var x=On(mo,y);x!==null?a.type=x:Gt("Unknown Brush type as an argument to GraphObject.make: "+y)}else a instanceof fe?(y=On(fe,y),y!==null&&(a.type=y)):a instanceof Ki&&(y=On(Ki,y),y!==null&&(a.type=y));else if(y instanceof ge)a instanceof wn||Gt("A GraphObject can only be added to a Panel, not to: "+a),a.add(y);else if(y instanceof Sa){var E;y.isRow&&typeof a.getRowDefinition=="function"?E=a.getRowDefinition(y.index):y.isRow||typeof a.getColumnDefinition!="function"||(E=a.getColumnDefinition(y.index)),E instanceof Sa?km(E,y):Gt("A RowColumnDefinition can only be added to an object that implements getRowDefinition/getColumnDefinition, not to: "+a)}else if(y instanceof rn)typeof a.qb=="function"&&a.qb(y);else if(y instanceof Ea)a.type=y;else if(y instanceof ha)a instanceof ge||a instanceof Sa?a.bind(y):Gt("A Binding can only be applied to a GraphObject or RowColumnDefinition, not to: "+a);else if(y instanceof ql)a instanceof ge?a.Jv(y):Gt("An AnimationTrigger can only be applied to a GraphObject, not to: "+a);else if(y instanceof Dr)a instanceof fe&&a.type===fe.o?a.figures.add(y):Gt("A PathFigure can only be added to a Path Geometry, not to: "+a);else if(y instanceof Ki)a instanceof Dr?a.segments.add(y):Gt("A PathSegment can only be added to a PathFigure, not to: "+a);else if(y instanceof Ko)a instanceof ke||a instanceof er?a.layout=y:Gt("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 mo){x=new Mi;for(var b in y)E=parseFloat(b),isNaN(E)?x[b]=y[b]:a.addColorStop(E,y[b]);Zd(a,x)}else if(a instanceof Sa){y.row!==void 0?(b=y.row,(b==null||b===1/0||isNaN(b)||0>b)&&Gt("Must specify non-negative integer row for RowColumnDefinition "+y+", not: "+b),a.isRow=!0,a.index=b):y.column!==void 0&&(b=y.column,(b==null||b===1/0||isNaN(b)||0>b)&&Gt("Must specify non-negative integer column for RowColumnDefinition "+y+", not: "+b),a.isRow=!1,a.index=b),b=new Mi;for(x in y)x!=="row"&&x!=="column"&&(b[x]=y[x]);Zd(a,b)}else Zd(a,y);else Gt('Unknown initializer "'+y+'" for object being constructed by GraphObject.make: '+a)}function Bh(a,y){kf.add(a,y)}function hm(a,y,x){x===void 0&&(x=null);var E=a[1];if(typeof x=="function"?x(E):typeof E=="string")return a.splice(1,1),E;if(y===void 0)throw Error("no "+(typeof x=="function"?"satisfactory":"string")+" argument for GraphObject builder "+a[0]);return y}ye.Object.defineProperties(ge.prototype,{bindingId:{get:function(){return this.A!==null?this.A.zp:-1},set:function(a){this.bindingId!==a&&(this.A===null&&(this.A=new Oc),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 Oc),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 Oc),this.A.wm=a)}},shadowVisible:{get:function(){return this.A!==null?this.A.Ci:null},set:function(a){var y=this.shadowVisible;y!==a&&(vr(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&&(vr(this),this.A.Hb=a,this.g("enabledChanged",y,a))}},segmentOrientation:{get:function(){return this.Ua!==null?this.Ua.rr:Ls},set:function(a){var y=this.segmentOrientation;y!==a&&(this.Ua===null&&(this.Ua=new dd),this.Ua.rr=a,this.v(),this.g("segmentOrientation",y,a),a===Ls&&(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 dd),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 dd),this.Ua.o=a,this.v(),this.g("segmentFraction",y,a))}},segmentOffset:{get:function(){return this.Ua!==null?this.Ua.F:Zn},set:function(a){var y=this.segmentOffset;y.D(a)||(a=a.J(),this.Ua===null&&(this.Ua=new dd),this.Ua.F=a,this.v(),this.g("segmentOffset",y,a))}},stretch:{get:function(){return this.A!==null?this.A.hg:rr},set:function(a){var y=this.stretch;y!==a&&(vr(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&&(vr(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)&&un(a,"0 <= value <= 1",ge,"opacity"),this.pb=a,this.g("opacity",y,a),a=this.diagram,y=this.part,a!==null&&y!==null&&a.N(ec(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(ec(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(),Uy(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&&_c(a,"GraphObject.areaBackground"),a instanceof mo&&a.freeze(),vr(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&&_c(a,"GraphObject.background"),a instanceof mo&&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 Bi)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,E=this.pa,b=E.x;E=E.y,(b===y||isNaN(b)&&isNaN(y))&&(E===x||isNaN(E)&&isNaN(x))?this.Av():(a=a.copy(),this.zv(a,b,E)&&this.g("position",new At(b,E),a))}},actualBounds:{get:function(){return this.Ib}},scale:{get:function(){return this.Ca},set:function(a){var y=this.Ca;y!==a&&(0>=a&&Gt("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,Uy(this),this.v(),this.g("angle",y,a)))}},desiredSize:{get:function(){return this.jd},set:function(a){var y=a.width,x=a.height,E=this.jd,b=E.width,z=E.height;(b===y||isNaN(b)&&isNaN(y))&&(z===x||isNaN(z)&&isNaN(x))||(this.jd=a=a.J(),this.v(),this instanceof cr&&this.qc(),this.g("desiredSize",E,a),Ya(this)&&(a=this.part,a!==null&&(Ho(this,a,"width"),Ho(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 on(a,this.jd.height).freeze(),this.v(),this instanceof cr&&this.qc(),this.g("desiredSize",y,a),Ya(this)&&(a=this.part,a!==null&&Ho(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 on(this.jd.width,a).freeze(),this.v(),this instanceof cr&&this.qc(),this.g("desiredSize",y,a),Ya(this)&&(a=this.part,a!==null&&Ho(this,a,"height")))}},minSize:{get:function(){return this.A!==null?this.A.u:ki},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(),vr(this),this.A.u=a,this.v(),this.g("minSize",y,a))}},maxSize:{get:function(){return this.A!==null?this.A.o:eo},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(),vr(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 nr(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&&Va(this),this.Ab}},oe:{get:function(){return this.l&4096&&Va(this),this.wh}},animationTriggers:{get:function(){return this.A!==null?this.A.hb:null},set:function(a){this.animationTriggers!==a&&(vr(this),this.A.hb=a)}},reshapingBehavior:{get:function(){return this.A!==null?this.A.Pf:hn},set:function(a){this.reshapingBehavior!==a&&(vr(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()&&Gt("GraphObject.alignment for "+this+" must be a real Spot or Spot.Default, not: "+a),this.Jb=a=a.J(),Ps(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&&un(a,">= 0",ge,"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&&un(a,">= 1",ge,"columnSpan"),vr(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&&un(a,">= 0",ge,"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&&un(a,">= 1",ge,"rowSpan"),vr(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&&(vr(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 $n||Gt("Cannot set portID on a Link: "+a),y!==null&&x!==null&&Gv(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:ar},set:function(a){var y=this.toSpot;y.D(a)||(a=a.J(),this.Xc(),this.ba.yj=a,this.g("toSpot",y,a),Xd(this))}},toEndSegmentLength:{get:function(){return this.ba!==null?this.ba.wj:10},set:function(a){var y=this.toEndSegmentLength;y!==a&&(0>a&&un(a,">= 0",ge,"toEndSegmentLength"),this.Xc(),this.ba.wj=a,this.g("toEndSegmentLength",y,a),Xd(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),Xd(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&&un(a,">= 0",ge,"toMaxLinks"),this.Xc(),this.ba.Ur=a,this.g("toMaxLinks",y,a))}},fromSpot:{get:function(){return this.ba!==null?this.ba.Xi:ar},set:function(a){var y=this.fromSpot;y.D(a)||(a=a.J(),this.Xc(),this.ba.Xi=a,this.g("fromSpot",y,a),Xd(this))}},fromEndSegmentLength:{get:function(){return this.ba!==null?this.ba.Vi:10},set:function(a){var y=this.fromEndSegmentLength;y!==a&&(0>a&&un(a,">= 0",ge,"fromEndSegmentLength"),this.Xc(),this.ba.Vi=a,this.g("fromEndSegmentLength",y,a),Xd(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),Xd(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&&un(a,">= 0",ge,"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&&(vr(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&&(vr(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&&(vr(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&&(vr(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&&(vr(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&&(vr(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&&(vr(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&&(vr(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&&(vr(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&&(vr(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&&(vr(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&&(vr(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&&(vr(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&&(vr(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&&(vr(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&&(vr(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&&(vr(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&&(vr(this),this.A.Ch=a,this.g("contextMenu",y,a))}}}),ge.prototype.trigger=ge.prototype.Jv,ge.prototype.findBindingPanel=ge.prototype.ih,ge.prototype.findTemplateBinder=ge.prototype.pz,ge.prototype.setProperties=ge.prototype.nm,ge.prototype.apply=ge.prototype.apply,ge.prototype.attach=ge.prototype.Du,ge.prototype.set=ge.prototype.set,ge.prototype.isEnabledObject=ge.prototype.If,ge.prototype.isVisibleObject=ge.prototype.Ed,ge.prototype.isContainedBy=ge.prototype.rg,ge.prototype.getNearestIntersectionPoint=ge.prototype.rs,ge.prototype.getLocalPoint=ge.prototype.qs,ge.prototype.getDocumentScale=ge.prototype.Df,ge.prototype.getDocumentAngle=ge.prototype.li,ge.prototype.getDocumentBounds=ge.prototype.mi,ge.prototype.getDocumentPoint=ge.prototype.ga,ge.prototype.intersectsRect=ge.prototype.Yc,ge.prototype.containedInRect=ge.prototype.fh,ge.prototype.containsRect=ge.prototype.Re,ge.prototype.containsPoint=ge.prototype.ca,ge.prototype.raiseChanged=ge.prototype.g,ge.prototype.raiseChangedEvent=ge.prototype.cb,ge.prototype.addCopyProperty=ge.prototype.Vw;var kf=null;ge.className="GraphObject",kf=new be,Bh("Button",function(){function a(x,E){return x.diagram.ic(x.documentPoint,function(b){for(;b.panel!==null&&!b.isActionable;)b=b.panel;return b},function(b){return b===E})!==null}var y=Ll(wn,wn.Auto,{isActionable:!0,enabledChanged:function(x,E){if(x instanceof wn){var b=x.fb("ButtonBorder");b!==null&&(b.fill=E?x._buttonFillNormal:x._buttonFillDisabled)}},cursor:"pointer",_buttonFillNormal:"#F5F5F5",_buttonStrokeNormal:"#BDBDBD",_buttonFillOver:"#E0E0E0",_buttonStrokeOver:"#9E9E9E",_buttonFillPressed:"#BDBDBD",_buttonStrokePressed:"#9E9E9E",_buttonFillDisabled:"#E5E5E5"},Ll(cr,{name:"ButtonBorder",figure:"RoundedRectangle",spot1:new fi(0,0,2.76142374915397,2.761423749153969),spot2:new fi(1,1,-2.76142374915397,-2.761423749153969),parameter1:2,parameter2:2,fill:"#F5F5F5",stroke:"#BDBDBD"}));return y.mouseEnter=function(x,E){if(E.If()&&E instanceof wn&&(x=E.fb("ButtonBorder"),x instanceof cr)){var b=E._buttonFillOver;E._buttonFillNormal=x.fill,x.fill=b,b=E._buttonStrokeOver,E._buttonStrokeNormal=x.stroke,x.stroke=b}},y.mouseLeave=function(x,E){E.If()&&E instanceof wn&&(x=E.fb("ButtonBorder"),x instanceof cr&&(x.fill=E._buttonFillNormal,x.stroke=E._buttonStrokeNormal))},y.actionDown=function(x,E){if(E.If()&&E instanceof wn&&E._buttonFillPressed!==null&&x.button===0){var b=E.fb("ButtonBorder");if(b instanceof cr){x=x.diagram;var z=x.skipsUndoManager;x.skipsUndoManager=!0;var tt=E._buttonFillPressed;E._buttonFillOver=b.fill,b.fill=tt,tt=E._buttonStrokePressed,E._buttonStrokeOver=b.stroke,b.stroke=tt,x.skipsUndoManager=z}}},y.actionUp=function(x,E){if(E.If()&&E instanceof wn&&E._buttonFillPressed!==null&&x.button===0){var b=E.fb("ButtonBorder");if(b instanceof cr){var z=x.diagram,tt=z.skipsUndoManager;z.skipsUndoManager=!0,a(x,E)?(b.fill=E._buttonFillOver,b.stroke=E._buttonStrokeOver):(b.fill=E._buttonFillNormal,b.stroke=E._buttonStrokeNormal),z.skipsUndoManager=tt}}},y.actionCancel=function(x,E){if(E.If()&&E instanceof wn&&E._buttonFillPressed!==null){var b=E.fb("ButtonBorder");if(b instanceof cr){var z=x.diagram,tt=z.skipsUndoManager;z.skipsUndoManager=!0,a(x,E)?(b.fill=E._buttonFillOver,b.stroke=E._buttonStrokeOver):(b.fill=E._buttonFillNormal,b.stroke=E._buttonStrokeNormal),z.skipsUndoManager=tt}}},y.actionMove=function(x,E){if(E.If()&&E instanceof wn&&E._buttonFillPressed!==null){var b=x.diagram;if(b.firstInput.button===0&&(b.currentTool.standardMouseOver(),a(x,E)&&(x=E.fb("ButtonBorder"),x instanceof cr))){var z=b.skipsUndoManager;b.skipsUndoManager=!0;var tt=E._buttonFillPressed;x.fill!==tt&&(x.fill=tt),tt=E._buttonStrokePressed,x.stroke!==tt&&(x.stroke=tt),b.skipsUndoManager=z}}},y}),Bh("TreeExpanderButton",function(){var a=Ll("Button",{_treeExpandedFigure:"MinusLine",_treeCollapsedFigure:"PlusLine"},Ll(cr,{name:"ButtonIcon",figure:"MinusLine",stroke:"#424242",strokeWidth:2,desiredSize:hr},new ha("figure","isTreeExpanded",function(y,x){return x=x.panel,y?x._treeExpandedFigure:x._treeCollapsedFigure}).cp()),{visible:!1},new ha("visible","isTreeLeaf",function(y){return!y}).cp());return a.click=function(y,x){if(x=x.part,x instanceof Qr&&(x=x.adornedPart),x instanceof $n){var E=x.diagram;if(E!==null){if(E=E.commandHandler,x.isTreeExpanded){if(!E.canCollapseTree(x))return}else if(!E.canExpandTree(x))return;y.handled=!0,x.isTreeExpanded?E.collapseTree(x):E.expandTree(x)}}},a}),Bh("SubGraphExpanderButton",function(){var a=Ll("Button",{_subGraphExpandedFigure:"MinusLine",_subGraphCollapsedFigure:"PlusLine"},Ll(cr,{name:"ButtonIcon",figure:"MinusLine",stroke:"#424242",strokeWidth:2,desiredSize:hr},new ha("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 Qr&&(x=x.adornedPart),x instanceof er){var E=x.diagram;if(E!==null){if(E=E.commandHandler,x.isSubGraphExpanded){if(!E.canCollapseSubGraph(x))return}else if(!E.canExpandSubGraph(x))return;y.handled=!0,x.isSubGraphExpanded?E.collapseSubGraph(x):E.expandSubGraph(x)}}},a}),Bh("ToolTip",function(){return Ll(Qr,wn.Auto,{isShadowed:!0,shadowColor:"rgba(0, 0, 0, .4)",shadowOffset:new At(0,3),shadowBlur:5},Ll(cr,{name:"Border",figure:"RoundedRectangle",parameter1:1,parameter2:1,fill:"#F5F5F5",stroke:"#F0F0F0",spot1:new fi(0,0,4,6),spot2:new fi(1,1,-4,-4)}))}),Bh("ContextMenu",function(){return Ll(Qr,wn.Vertical,{background:"#F5F5F5",isShadowed:!0,shadowColor:"rgba(0, 0, 0, .4)",shadowOffset:new At(0,3),shadowBlur:5},new ha("background","",function(a){return a.adornedPart!==null&&a.placeholder!==null?null:"#F5F5F5"}))}),Bh("ContextMenuButton",function(){var a=Ll("Button");a.stretch=Fi;var y=a.fb("ButtonBorder");return y instanceof cr&&(y.figure="Rectangle",y.strokeWidth=0,y.spot1=new fi(0,0,2,3),y.spot2=new fi(1,1,-2,-2)),a}),Bh("PanelExpanderButton",function(a){var y=hm(a,"COLLAPSIBLE"),x=Ll("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},Ll(cr,{name:"ButtonIcon",strokeWidth:2},new ha("geometryString","visible",function(E){return E?x._buttonExpandedFigure:x._buttonCollapsedFigure}).cp(y)));return a=x.fb("ButtonBorder"),a instanceof cr&&(a.stroke=null,a.fill="rgba(0, 0, 0, 0)"),x.click=function(E,b){var z=b.diagram;if(z!==null&&!z.isReadOnly){var tt=b.ih();tt===null&&(tt=b.part),tt!==null&&(b=tt.fb(y),b!==null&&(E.handled=!0,z.Ea("Collapse/Expand Panel"),b.visible=!b.visible,z.eb("Collapse/Expand Panel")))}},x}),Bh("CheckBoxButton",function(a){var y=hm(a);return a=Ll("Button",{desiredSize:new on(14,14)},Ll(cr,{name:"ButtonIcon",geometryString:"M0 0 M0 8.85 L4.9 13.75 16.2 2.45 M16.2 16.2",strokeWidth:2,stretch:Sn,geometryStretch:xi,visible:!1},y!==""?new ha("visible",y).Kx():[])),a.click=function(x,E){if(E instanceof wn){var b=x.diagram;if(!(b===null||b.isReadOnly||y!==""&&b.model.isReadOnly)){x.handled=!0;var z=E.fb("ButtonIcon");b.Ea("checkbox"),z.visible=!z.visible,typeof E._doClick=="function"&&E._doClick(x,E),b.eb("checkbox")}}},a}),Bh("CheckBox",function(a){a=hm(a),a=Ll("CheckBoxButton",a,{name:"Button",isActionable:!1,margin:new nr(0,1,0,0)});var y=Ll(wn,"Horizontal",a,{isActionable:!0,cursor:a.cursor,margin:new nr(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}),ge.None=hn=new rn(ge,"None",0),ge.Default=rr=new rn(ge,"Default",0),ge.Vertical=Ri=new rn(ge,"Vertical",4),ge.Horizontal=Fi=new rn(ge,"Horizontal",5),ge.Fill=Sn=new rn(ge,"Fill",3),ge.Uniform=xi=new rn(ge,"Uniform",1),ge.UniformToFill=Zr=new rn(ge,"UniformToFill",2),ge.FlipVertical=xr=new rn(ge,"FlipVertical",1),ge.FlipHorizontal=Ur=new rn(ge,"FlipHorizontal",2),ge.FlipBoth=Eo=new rn(ge,"FlipBoth",3),ge.make=Ll,ge.getBuilders=function(){var a=new be,y;for(y in kf)if(y!==y.toLowerCase()){var x=kf.I(y);typeof x=="function"&&a.add(y,x)}return a.freeze(),a},ge.defineBuilder=Bh,ge.build=function(a,y,x){for(var E=[],b=2;b<arguments.length;++b)E[b-2]=arguments[b];if(b=kf.I(a),typeof b=="function"&&(E=b([a].concat(E)),E instanceof ge))return y&&E.set(y),E;Gt('GraphObject.build invoked object builder "'+a+'", but it did not return an Object')},ge.takeBuilderArgument=hm;function Oc(){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=ki,this.o=eo,this.hg=rr,this.ob=this.Bi=1,this.Pf=hn,this.Pc=this.Ci=this.gd=null,this.Oc="category"}Oc.prototype.copy=function(){var a=new Oc;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 dd(){this.u=-1/0,this.o=0,this.F=Zn,this.rr=Ls,this.j=this.V="None"}dd.prototype.copy=function(){var a=new dd;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},dd.className="LinkElementSettings";function Kg(){this.yj=this.Xi=wa,this.xj=this.Wi=this.wj=this.Vi=NaN,this.Tr=this.hq=null,this.Ur=this.iq=1/0}Kg.prototype.copy=function(){var a=new Kg;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},Kg.className="LinkSettings";function Jd(){this.ha=[1,0,0,1,0,0]}Jd.prototype.copy=function(){var a=new Jd;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},Jd.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},Jd.prototype.scale=function(a,y){this.ha[0]*=a,this.ha[1]*=a,this.ha[2]*=y,this.ha[3]*=y},Jd.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 E=1}else a===180?(a=-1,E=0):a===270?(a=0,E=-1):(E=a*Math.PI/180,a=Math.cos(E),E=Math.sin(E));var b=this.ha[1]*a+this.ha[3]*E,z=this.ha[0]*-E+this.ha[2]*a,tt=this.ha[1]*-E+this.ha[3]*a;this.ha[0]=this.ha[0]*a+this.ha[2]*E,this.ha[1]=b,this.ha[2]=z,this.ha[3]=tt,this.translate(-y,-x)}},Jd.className="STransform";function Ic(a){this.type=a,this.r2=this.y2=this.x2=this.r1=this.y1=this.x1=0,this.gx=[],this.pattern=null}Ic.prototype.addColorStop=function(a,y){this.gx.push({offset:a,color:y})},Ic.className="SGradient";function Bu(a,y,x){this.ownerDocument=a=y===void 0?Je.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 tl(this,x)}Bu.prototype.resize=function(a,y,x,E){return this.width!==a||this.height!==y?(this.width=a,this.height=y,this.style.width=x+"px",this.style.height=E+"px",this.Oa.setAttributeNS(null,"width",x+"px"),this.Oa.setAttributeNS(null,"height",E+"px"),this.Oa.setAttributeNS(null,"viewBox","0 0 "+x+" "+E),this.context.ww.firstElementChild.setAttributeNS(null,"width",x+"px"),this.context.ww.firstElementChild.setAttributeNS(null,"height",E+"px"),!0):!1},Bu.prototype.Ud=function(a,y,x){if(a=this.ownerDocument.createElementNS(this.cA,a),Ie(y))for(var E in y)a.setAttributeNS(E==="href"?"http://www.w3.org/1999/xlink":"",E,y[E]);return x!==void 0&&(a.textContent=x),a},Bu.prototype.getBoundingClientRect=function(){return this.Oa.getBoundingClientRect()},Bu.prototype.focus=function(){this.Oa.focus()},Bu.prototype.mx=function(){this.ownerDocument=null},ye.Object.defineProperties(Bu.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}}}),Bu.className="SVGSurface";function tl(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 Jd,this.j=dm(this),this.Nj=dm(this,"gojs-diagram"),this.Hl=this.ti=null;var x=xo++,E=this.Ud("clipPath",{id:"mainClip"+x});E.appendChild(this.Ud("rect",{x:0,y:0,width:a.width,height:a.height})),this.ww=E,this.svg.appendChild(this.j),this.j.appendChild(this.Nj),this.svg.appendChild(E),this.j.setAttributeNS(null,"clip-path","url(#mainClip"+x+")"),this.eA={},this.isTemporary=!!y,this.filter="",this.bk=null}function Yy(a,y,x,E,b,z,tt){a.Nj===void 0?Ug(a,y,x,E,b,z,tt):a.Nj.setAttribute("transform","matrix("+y+", "+x+", "+E+", "+b+", "+z+", "+tt+")")}wt=tl.prototype,wt.arc=function(a,y,x,E,b,z,tt,rt){var ot=2*Math.PI,lt=ot-1e-6,ut=x*Math.cos(E),ft=x*Math.sin(E),yt=a+ut,xt=y+ft,Ct=z?0:1;E=z?E-b:b-E,(1e-6<Math.abs(tt-yt)||1e-6<Math.abs(rt-xt))&&this.path.push(["L",yt,+xt]),0>E&&(E=E%ot+ot),E>lt?(this.path.push(["A",x,x,0,1,Ct,a-ut,y-ft]),this.path.push(["A",x,x,0,1,Ct,yt,xt])):1e-6<E&&this.path.push(["A",x,x,0,+(E>=Math.PI),Ct,a+x*Math.cos(b),y+x*Math.sin(b)])},wt.beginPath=function(){this.path=[],this.Yl={stroke:"none",fill:"none"}},wt.Se=function(a){this.addPath(this.path,this.rb,a||0)},wt.bezierCurveTo=function(a,y,x,E,b,z){this.path.push(["C",a,y,x,E,b,z])},wt.clearRect=function(){},wt.clip=function(){this.Yl.clipPath=!0},wt.closePath=function(){this.path.push(["z"])},wt.createLinearGradient=function(a,y,x,E){var b=new Ic("linear");return b.x1=a,b.y1=y,b.x2=x,b.y2=E,b},wt.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 E="PATTERN"+xo++,b={x:0,y:0,width:a.width,height:a.height,href:y};return a=this.Ud("pattern",{width:a.width,height:a.height,id:E,patternUnits:"userSpaceOnUse"}),a.appendChild(this.Ud(Ud,b)),this.svg.appendChild(a),x[y]=E,"url(#"+E+")"},wt.createRadialGradient=function(a,y,x,E,b,z){var tt=new Ic("radial");return tt.x1=a,tt.y1=y,tt.r1=x,tt.x2=E,tt.y2=b,tt.r2=z,tt};function Xy(a,y,x,E,b,z,tt,rt,ot){E=rt/E,b=ot/b,z===0&&tt===0||a.rb.translate(z,tt),E===1&&b===1||a.rb.scale(E,b),y===0&&x===0||a.rb.translate(-y,-x)}wt.drawImage=function(a,y,x,E,b,z,tt,rt,ot){var lt="";a instanceof HTMLCanvasElement&&(lt=a.toDataURL()),a instanceof HTMLImageElement&&(lt=a.getAttribute("src"));var ut=a instanceof HTMLImageElement?a.naturalWidth:a.width;a=a instanceof HTMLImageElement?a.naturalHeight:a.height,E===void 0&&(z=y,tt=x,rt=E=ut,ot=b=a),E=E||0,b=b||0,rt=rt||0,ot=ot||0,Xy(this,y,x,E,b,z||0,tt||0,rt,ot),z={x:0,y:0,width:ut||E,height:a||b,href:lt},_t.$(E,rt)&&_t.$(b,ot)?lt.toLowerCase().indexOf(".svg")===-1&<.toLowerCase().indexOf("data:image/svg")===-1&&(z.preserveAspectRatio="xMidYMid slice"):z.preserveAspectRatio="none",(y!==0||x!==0||E!==ut||b!==a)&&(E+=y,b+=x,z["clip-path"]="path('M "+y+","+x+" L "+E+" "+x+" L "+E+" "+b+" L "+y+" "+b+" z')"),bf(this,Ud,z,this.rb),this.addElement(Ud,z)},wt.fill=function(a){a&&(this.Yl["fill-rule"]="evenodd"),iv(this,this.Yl)},wt.ng=function(a,y){this.clipInsteadOfFill?this.clip():this.fill(y)},wt.fillRect=function(a,y,x,E){a=[a,y,x,E],a={x:a[0],y:a[1],width:a[2],height:a[3]},bf(this,"fill",a,this.rb),this.addElement("rect",a)},wt.ox=function(a,y,x,E){a={x:a,y,width:x,height:E},bf(this,"fill",a,this.rb),iv(this,a),this.svg.prepend(this.Ud("rect",a))},wt.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},bf(this,"fill",y,this.rb),this.addElement("text",y,a[0])},wt.lineTo=function(a,y){this.path.push(["L",a,y])},wt.moveTo=function(a,y){this.path.push(["M",a,y])},wt.quadraticCurveTo=function(a,y,x,E){this.path.push(["Q",a,y,x,E])},wt.rect=function(a,y,x,E){this.path.push(["M",a,y],["L",a+x,y],["L",a+x,y+E],["L",a,y+E],["z"])},wt.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},wt.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())},wt.setTransform=function(a,y,x,E,b,z){a===1&&y===0&&x===0&&E===1&&b===0&&z===0||Ug(this,a,y,x,E,b,z)};function Jy(a){return a=a.rb.ha,"matrix("+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+")"}wt.scale=function(a,y){this.rb.scale(a,y)},wt.translate=function(a,y){this.rb.translate(a,y)},wt.transform=function(){},wt.yc=function(){},wt.stroke=function(){$y(this,this.Yl)},wt.jk=function(){this.clipInsteadOfFill||this.stroke()},wt.Ud=function(a,y,x){return this.Gv.Ud(a,y,x)},wt.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 bf(a,y,x,E){y==="fill"?iv(a,x):y==="stroke"&&$y(a,x),E!==null&&(a=E.ha,x.transform="matrix("+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+")")}function iv(a,y){a.fillStyle instanceof Ic?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 Ic?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 Ic)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 E="";if(E=a.Hl!==null?a.Hl.getAttribute(x?"fill":"stroke"):null,E!==null&&E.indexOf("GRAD")!==-1?(E=E.split("#")[1].slice(0,-1),x=a.svg.getElementById(E),x!==null&&x.remove()):E="GRAD"+xo++,y.type==="linear")x=a.Ud("linearGradient",{x1:y.x1,x2:y.x2,y1:y.y1,y2:y.y2,id:E,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:E});else throw Error("invalid gradient");var b=y.gx;y=b.length;for(var z=[],tt=0;tt<y;tt++){var rt=b[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(lt,ut){return lt.offset>ut.offset?1:-1}),b=0;b<y;b++)x.appendChild(a.Ud("stop",z[b]));return a.svg.appendChild(x),"url(#"+E+")"}wt.addPath=function(a,y,x){for(var E=[],b=0;b<a.length;b++){var z=bn(a[b]),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());E.push(tt.join(" "))}if(E=E.join(" "),a=this.Yl,a.clipPath)0<this.nh.length&&this.nh[this.nh.length-1].setAttributeNS(null,"clip-path",'path("'+E+'")');else if(a.d=E,bf(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 Ug(a,y,x,E,b,z,tt){var rt=new Jd;rt.ha=[y,x,E,b,z,tt],y={},bf(a,"g",y,rt),rt=a.addElement("g",y),a.nh.push(rt)}function dm(a,y){var x={};return y&&(x.class=y),y=a.addElement("g",x),a.nh.push(y),y}wt.Ev=function(a,y,x){this.Ar=a,this.Br=y,this.Vg=x};function Vu(a){a.Il=!1,a.shadowOffsetX=0,a.shadowOffsetY=0,a.shadowBlur=0}function uh(a){a.Il=!0,a.shadowOffsetX=a.Ar,a.shadowOffsetY=a.Br,a.shadowBlur=a.Vg}wt.js=function(a,y){this.Ct=!0,this.Yg=a,this.uj=y},wt.fs=function(){this.Ct=!1},wt.Vc=function(){},wt.Wx=function(){},tl.prototype.rotate=function(a){this.rb.rotate(57.2958*a,0,0)},tl.prototype.getImageData=function(){return null},tl.prototype.measureText=function(){return null};function cm(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()))}tl.prototype.Hs=function(a){a.svg!==null&&a.svg.parentNode===this.Nj&&a.svg.remove()},tl.className="SVGContext",ke.prototype.Cs=function(a){this.pj.contains("SVG")||this.bs("SVG",new Bu(this,Je.document));var y=new Bu(this,Je.document,!0);a===void 0&&(a=new Mi);var x=this;return bc(this,function(E,b){return E=am(x,E,"SVG",y),E=E!==null?E.svg:null,typeof b=="function"?(b(E),null):E},a)},ke.prototype.makeSvg=ke.prototype.Cs,ke.prototype.av=function(a){return this.Cs(a)},ke.prototype.makeSVG=ke.prototype.av;function zl(a,y,x,E){this.ownerDocument=y=y===void 0?Je.document:y,this.hs=null,y=y.createElement("canvas"),y.tabIndex=0,this.Oa=y,this.context=new Qd(y,x,E),y.H=a}zl.prototype.resize=function(a,y,x,E){return this.width!==a||this.height!==y?(this.width=a,this.height=y,this.style.width=x+"px",this.style.height=E+"px",!0):!1},zl.prototype.toDataURL=function(a,y){return this.Oa.toDataURL(a,y)},zl.prototype.getBoundingClientRect=function(){return this.Oa.getBoundingClientRect()},zl.prototype.focus=function(){this.Oa.focus()},zl.prototype.mx=function(){this.ownerDocument=this.Oa.H=null},ye.Object.defineProperties(zl.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}}}),zl.className="CanvasSurface";function Qd(a,y,x){this.Z=a.getContext?a.getContext("2d",y):null,this.Z===null&&Gt("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 ae,this.isTemporary=!!x}wt=Qd.prototype,wt.Wx=function(a){this.Z.imageSmoothingEnabled=a},wt.arc=function(a,y,x,E,b,z){this.Z.arc(a,y,x,E,b,z)},wt.beginPath=function(){this.Z.beginPath()},wt.Se=function(){},wt.bezierCurveTo=function(a,y,x,E,b,z){this.Z.bezierCurveTo(a,y,x,E,b,z)},wt.clearRect=function(a,y,x,E){this.yc(),this.Z.clearRect(a,y,x,E)},wt.clip=function(){this.Z.clip()},wt.closePath=function(){this.Z.closePath()},wt.createLinearGradient=function(a,y,x,E){return this.Z.createLinearGradient(a,y,x,E)},wt.createPattern=function(a,y){return this.Z.createPattern(a,y)},wt.createRadialGradient=function(a,y,x,E,b,z){return this.Z.createRadialGradient(a,y,x,E,b,z)},wt.drawImage=function(a,y,x,E,b,z,tt,rt,ot){E===void 0?this.Z.drawImage(a,y,x):this.Z.drawImage(a,y,x,E,b,z,tt,rt,ot)},wt.fill=function(a){this.Z.fill(a?"evenodd":"nonzero")},wt.fillRect=function(a,y,x,E){this.Z.fillRect(a,y,x,E)},wt.ox=function(a,y,x,E){this.Z.fillRect(a,y,x,E)},wt.fillText=function(a,y,x){this.Z.fillText(a,y,x)},wt.getImageData=function(a,y,x,E){return this.Z.getImageData(a,y,x,E)},wt.lineTo=function(a,y){this.Z.lineTo(a,y)},wt.measureText=function(a){return this.Z.measureText(a)},wt.moveTo=function(a,y){this.Z.moveTo(a,y)},wt.quadraticCurveTo=function(a,y,x,E){this.Z.quadraticCurveTo(a,y,x,E)},wt.rect=function(a,y,x,E){this.Z.rect(a,y,x,E)},wt.restore=function(){this.Z.restore()},wt.save=function(){this.yc(),this.Z.save()},Qd.prototype.rotate=function(a){this.El.rotate(57.2958*a,0,0)},wt=Qd.prototype,wt.setTransform=function(a,y,x,E,b,z){this.El.setTransform(a,y,x,E,b,z)},wt.scale=function(a,y){this.El.scale(a,y)},wt.translate=function(a,y){this.El.translate(a,y)},wt.stroke=function(){this.Z.stroke()},wt.transform=function(a,y,x,E,b,z){if(a!==1||y!==0||x!==0||E!==1||b!==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*E,x=tt.m12*x+tt.m22*E,tt.dx=tt.m11*b+tt.m21*z+tt.dx,tt.dy=tt.m12*b+tt.m22*z+tt.dy,tt.m11=rt,tt.m12=a,tt.m21=y,tt.m22=x}},wt.yc=function(){var a=this.El;this.Z.setTransform(a.m11,a.m12,a.m21,a.m22,a.dx,a.dy)},wt.ng=function(a,y){if(a instanceof mo&&a.type===Fl){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)},wt.jk=function(){this.Hm||this.stroke()},wt.Ev=function(a,y,x){this.Ar=a,this.Br=y,this.Vg=x},wt.js=function(a,y){var x=this.Z;x.setLineDash!==void 0&&(x.setLineDash(a),x.lineDashOffset=y)},wt.fs=function(){var a=this.Z;a.setLineDash!==void 0&&(a.setLineDash(mx),a.lineDashOffset=0)},wt.Vc=function(a){a&&(this.dt=""),this.ct=this.et=""},wt.Hs=function(){},ye.Object.defineProperties(Qd.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([]);Qd.className="CanvasSurfaceContext";function Yg(){this.F=this.o=this.u=this.j=0}Yg.className="ColorNumbers";function mo(a,y){Tf||(hv(),Tf=!0),Hi(this),this._isFrozen=!1,a===void 0?(this.na=Ah,this.xk="black"):typeof a=="string"?(this.na=Ah,this.xk=a):(this.na=a,this.xk="black"),a=this.na,a===dh?(this.Qd=to,this.Lk=Uo):this.Lk=a===Fl?this.Qd=lr:this.Qd=ar,this.Gr=0,this.Xp=NaN,this.xe=this.cr=this.we=null,this.ft=this.yk=0,y&&Object.assign(this,y)}mo.prototype.copy=function(){var a=new mo;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},wt=mo.prototype,wt.freeze=function(){return this._isFrozen=!0,this.we!==null&&this.we.freeze(),this},wt.ka=function(){return Object.isFrozen(this)&&Gt("cannot thaw constant: "+this),this._isFrozen=!1,this.we!==null&&this.we.ka(),this},wt.qb=function(a){a.classType===mo&&(this.type=a)},wt.toString=function(){var a="Brush(";if(this.type===Ah)a+=this.color;else if(a=this.type===dh?a+"Linear ":this.type===Fl?a+"Radial ":this.type===Df?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+")"},wt.addColorStop=function(a,y){return this._isFrozen&&de(this),(typeof a!="number"||!isFinite(a)||1<a||0>a)&&un(a,"0 <= loc <= 1",mo,"addColorStop:loc"),this.we===null&&(this.we=new be),this.we.add(a,y),this.na===Ah&&(this.type=dh),this.xe=null,this},wt.Vz=function(a,y){if(this._isFrozen&&de(this),a=a===void 0||typeof a!="number"?.2:a,y=y===void 0?Of:y,this.type===Ah)hh(this.color),this.color=Bf(a,y);else if((this.type===dh||this.type===Fl)&&this.colorStops!==null)for(var x=this.colorStops.iterator;x.next();)hh(x.value),this.addColorStop(x.key,Bf(a,y));return this};function qy(a,y,x){return y=y===void 0||typeof y!="number"?.2:y,x=x===void 0?Of:x,hh(a),Bf(y,x)}wt.Wy=function(a,y){if(this._isFrozen&&de(this),a=a===void 0||typeof a!="number"?.2:a,y=y===void 0?Of:y,this.type===Ah)hh(this.color),this.color=Bf(-a,y);else if((this.type===dh||this.type===Fl)&&this.colorStops!==null)for(var x=this.colorStops.iterator;x.next();)hh(x.value),this.addColorStop(x.key,Bf(-a,y));return this};function t1(a,y,x){return y=y===void 0||typeof y!="number"?.2:y,x=x===void 0?Of:x,hh(a),Bf(-y,x)}function ov(a,y,x){hh(a),a=_o.j;var E=_o.u,b=_o.o,z=_o.F;return hh(y),x===void 0&&(x=.5),"rgba("+Math.round((_o.j-a)*x+a)+", "+Math.round((_o.u-E)*x+E)+", "+Math.round((_o.o-b)*x+b)+", "+Math.round((_o.F-z)*x+z)+")"}wt.Gx=function(){if(this.type===Ah)return Nf(this.color);if((this.type===dh||this.type===Fl)&&this.colorStops!==null){var a=this.colorStops;if(this.type===Fl)return Nf(a.first().value);if(a.get(.5)!==null)return Nf(a.get(.5));if(a.count===2)return a=a.Fa(),Nf(ov(a[0].value,a[1].value));for(var y=a.iterator,x=-1,E=-1,b=1,z=1;y.next();){var tt=y.key,rt=Math.abs(.5-y.key);b>z&&rt<b?(x=tt,b=rt):z>=b&&rt<z&&(E=tt,z=rt)}return x>E&&(z=x,x=E,E=z,z=b),b=E-x,Nf(ov(a.get(x),a.get(E),1-z/b))}return!1};function Nf(a){return a?a instanceof mo?a.Gx():(hh(a),128>(299*_o.j+587*_o.u+114*_o.o)/1e3):!1}function Bf(a,y){switch(y){case Of:y=100*sv(_o.j);var x=100*sv(_o.u),E=100*sv(_o.o);return Cs.j=.4124564*y+.3575761*x+.1804375*E,Cs.u=.2126729*y+.7151522*x+.072175*E,Cs.o=.0193339*y+.119192*x+.9503041*E,Cs.F=_o.F,y=uv(Cs.j/Af[0]),x=uv(Cs.u/Af[1]),E=uv(Cs.o/Af[2]),Ku.j=116*x-16,Ku.u=500*(y-x),Ku.o=200*(x-E),Ku.F=Cs.F,Ku.j=Math.min(100,Math.max(0,Ku.j+100*a)),a=(Ku.j+16)/116,y=a-Ku.o/200,Cs.j=Af[0]*e1(Ku.u/500+a),Cs.u=Af[1]*(Ku.j>fm*dv?Math.pow(a,3):Ku.j/fm),Cs.o=Af[2]*e1(y),Cs.F=Ku.F,a=-.969266*Cs.j+1.8760108*Cs.u+.041556*Cs.o,y=.0556434*Cs.j+-.2040259*Cs.u+1.0572252*Cs.o,_o.j=255*lv((3.2404542*Cs.j+-1.5371385*Cs.u+-.4985314*Cs.o)/100),_o.u=255*lv(a/100),_o.o=255*lv(y/100),_o.F=Cs.F,_o.j=Math.round(_o.j),255<_o.j?_o.j=255:0>_o.j&&(_o.j=0),_o.u=Math.round(_o.u),255<_o.u?_o.u=255:0>_o.u&&(_o.u=0),_o.o=Math.round(_o.o),255<_o.o?_o.o=255:0>_o.o&&(_o.o=0),"rgba("+_o.j+", "+_o.u+", "+_o.o+", "+_o.F+")";case n1:return av(),pl.o=Math.min(100,Math.max(0,pl.o+100*a)),"hsla("+pl.j+", "+pl.u+"%, "+pl.o+"%, "+pl.F+")";default:Gt("Unknown color space: "+y)}}function hh(a){Tf||(hv(),Tf=!0);var y=cv;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,_o.j=a[0],_o.u=a[1],_o.o=a[2],_o.F=a[3]/255):(y.fillStyle="#FFFFFF",y.fillStyle=a,_o.j=0,_o.u=0,_o.o=0,_o.F=1)}}function av(){var a=_o.j/255,y=_o.u/255,x=_o.o/255,E=Math.max(a,y,x),b=Math.min(a,y,x),z=E-b;if(b=(E+b)/2,z===0)var tt=a=0;else{switch(E){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*b-1))}pl.j=Math.round(tt),pl.u=Math.round(100*a),pl.o=Math.round(100*b),pl.F=_o.F}function sv(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):(fm*a+16)/116}function e1(a){var y=a*a*a;return y>dv?y:(116*a-16)/fm}function _c(a,y){typeof a!="string"&&(a instanceof mo||Gt("Value for "+y+" must be a color string or a Brush, not "+a))}function hv(){cv=$o?new zl(null,void 0,{willReadFrequently:!0}).context:null}ye.Object.defineProperties(mo.prototype,{type:{get:function(){return this.na},set:function(a){this._isFrozen&&de(this,a),this.na=a,this.start.Mc()&&(a===dh?this.start=to:a===Fl&&(this.start=lr)),this.end.Mc()&&(a===dh?this.end=Uo:a===Fl&&(this.end=lr)),this.xe=null}},color:{get:function(){return this.xk},set:function(a){this._isFrozen&&de(this,a),this.xk=a,this.xe=null}},start:{get:function(){return this.Qd},set:function(a){this._isFrozen&&de(this,a),this.Qd=a.J(),this.xe=null}},end:{get:function(){return this.Lk},set:function(a){this._isFrozen&&de(this,a),this.Lk=a.J(),this.xe=null}},startRadius:{get:function(){return this.Gr},set:function(a){this._isFrozen&&de(this,a),0>a&&un(a,">= zero",mo,"startRadius"),this.Gr=a,this.xe=null}},endRadius:{get:function(){return this.Xp},set:function(a){this._isFrozen&&de(this,a),0>a&&un(a,">= zero",mo,"endRadius"),this.Xp=a,this.xe=null}},colorStops:{get:function(){return this.we},set:function(a){this._isFrozen&&de(this,a),this.we=a,this.xe=null}},pattern:{get:function(){return this.cr},set:function(a){this._isFrozen&&de(this,a),this.cr=a,this.xe=null}}}),mo.prototype.isDark=mo.prototype.Gx,mo.prototype.darkenBy=mo.prototype.Wy,mo.prototype.lightenBy=mo.prototype.Vz,mo.prototype.addColorStop=mo.prototype.addColorStop;var dv=216/24389,fm=24389/27,Af=[95.047,100,108.883],cv=null,_o=new Yg,pl=new Yg,Cs=new Yg,Ku=new Yg,Tf=!1;mo.className="Brush";var Ah;mo.Solid=Ah=new rn(mo,"Solid",0);var dh;mo.Linear=dh=new rn(mo,"Linear",1);var Fl;mo.Radial=Fl=new rn(mo,"Radial",2);var Df;mo.Pattern=Df=new rn(mo,"Pattern",4);var Of;mo.Lab=Of=new rn(mo,"Lab",5);var n1;mo.HSL=n1=new rn(mo,"HSL",6),mo.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 E=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>E.length&&(E="0"+E),2>a.length&&(a="0"+a),"#"+y+E+a},mo.isValidColor=function(a){if(a==="black")return!0;if(a==="")return!1;Tf||(hv(),Tf=!0);var y=cv;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)},mo.lighten=function(a){return qy(a)},mo.lightenBy=qy,mo.darken=function(a){return t1(a)},mo.darkenBy=t1,mo.mix=ov,mo.isDark=Nf;function Ea(){this.xa="Base"}Ea.prototype.measure=function(){},Ea.prototype.Yz=function(a,y,x,E,b){a.measure(y,x,E,b)},Ea.prototype.arrange=function(){},Ea.prototype.Ly=function(a,y,x,E,b,z){a.arrange(y,x,E,b,z)},Ea.prototype.iA=function(a){a.Uj()},Ea.prototype.gc=function(){},ye.Object.defineProperties(Ea.prototype,{name:{get:function(){return this.xa},set:function(a){this.xa=a}},classType:{get:function(){return wn}}}),Ea.prototype.remeasureObject=Ea.prototype.iA,Ea.prototype.arrangeElement=Ea.prototype.Ly,Ea.prototype.measureElement=Ea.prototype.Yz,Ea.className="PanelLayout";function gm(){this.xa="Base"}Se(gm,Ea),gm.prototype.measure=function(a,y,x,E,b,z,tt){var rt=E.length;a=ch(a);for(var ot=0;ot<rt;ot++){var lt=E[ot];if(lt.visible||lt===a){var ut=lt.margin,ft=ut.right+ut.left;ut=ut.top+ut.bottom,lt.measure(y,x,z,tt);var yt=lt.measuredBounds;ft=Math.max(yt.width+ft,0),ut=Math.max(yt.height+ut,0),yt=lt.position.x;var xt=lt.position.y;isFinite(yt)||(yt=0),isFinite(xt)||(xt=0),lt instanceof cr&<.isGeometryPositioned&&(lt=lt.strokeWidth/2,yt-=lt,xt-=lt),Rr(b,yt,xt,ft,ut)}}},gm.prototype.arrange=function(a,y,x){var E=y.length,b=a.padding;for(a=x.x-b.left,x=x.y-b.top,b=0;b<E;b++){var z=y[b],tt=z.measuredBounds,rt=z.margin,ot=z.position.x,lt=z.position.y;if(ot=isNaN(ot)?-a:ot-a,lt=isNaN(lt)?-x:lt-x,z instanceof cr&&z.isGeometryPositioned){var ut=z.strokeWidth/2;ot-=ut,lt-=ut}z.visible&&z.arrange(ot+rt.left,lt+rt.top,tt.width,tt.height)}};function pm(){this.xa="Base"}Se(pm,Ea),pm.prototype.measure=function(a,y,x,E,b,z,tt){var rt=E.length;y=Yn(),z=ch(a);for(var ot=0;ot<rt;ot++){var lt=E[ot];if(lt.visible||lt===z){var ut=Os(lt,!1);if(ut!==hn&&ut!==Fi)y.push(lt);else{lt.measure(1/0,x,0,tt),ut=lt.margin,lt=lt.measuredBounds;var ft=Math.max(lt.height+ut.top+ut.bottom,0);b.width+=Math.max(lt.width+ut.right+ut.left,0),b.height=Math.max(b.height,ft)}}}for(E=y.length,a.desiredSize.height?x=Math.min(a.desiredSize.height,a.maxSize.height):b.height!==0&&(x=Math.min(b.height,a.maxSize.height)),a=0;a<E;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),b.width+=Math.max(ot.width+rt,0),b.height=Math.max(b.height,ut));si(y)},pm.prototype.arrange=function(a,y,x){for(var E=y.length,b=a.padding,z=b.top,tt=a.isOpposite,rt=tt?x.width:b.left,ot=0;ot<E;ot++){var lt=z,ut=y[ot];if(ut.visible){var ft=ut.measuredBounds,yt=ut.margin,xt=yt.top+yt.bottom,Ct=z+b.bottom,bt=ft.height,Vt=Os(ut,!1);(isNaN(ut.desiredSize.height)&&Vt===Sn||Vt===Ri)&&(bt=Math.max(x.height-xt-Ct,0)),xt=bt+xt+Ct,Ct=ut.alignment,Ct.Xb()&&(Ct=a.defaultAlignment),Ct.sb()||(Ct=lr),tt&&(rt-=ft.width+yt.left+yt.right),ut.arrange(rt+Ct.offsetX+yt.left,lt+Ct.offsetY+yt.top+(x.height*Ct.y-xt*Ct.y),ft.width,bt),tt||(rt+=ft.width+yt.left+yt.right)}}};function mm(){this.xa="Base"}Se(mm,Ea),mm.prototype.measure=function(a,y,x,E,b,z){var tt=E.length;x=Yn();for(var rt=ch(a),ot=0;ot<tt;ot++){var lt=E[ot];if(lt.visible||lt===rt){var ut=Os(lt,!1);if(ut!==hn&&ut!==Ri)x.push(lt);else{var ft=lt.margin;ut=ft.right+ft.left,ft=ft.top+ft.bottom,lt.measure(y,1/0,z,0),lt=lt.measuredBounds,so(b,Math.max(b.width,Math.max(lt.width+ut,0)),b.height+Math.max(lt.height+ft,0))}}}if(E=x.length,E!==0){for(a.desiredSize.width?y=Math.min(a.desiredSize.width,a.maxSize.width):b.width!==0&&(y=Math.min(b.width,a.maxSize.width)),a=0;a<E;a++)ot=x[a],(ot.visible||ot===rt)&&(lt=ot.margin,tt=lt.right+lt.left,lt=lt.top+lt.bottom,ot.measure(y,1/0,z,0),ot=ot.measuredBounds,lt=Math.max(ot.height+lt,0),b.width=Math.max(b.width,Math.max(ot.width+tt,0)),b.height+=lt);si(x)}},mm.prototype.arrange=function(a,y,x){for(var E=y.length,b=a.padding,z=b.left,tt=a.isOpposite,rt=tt?x.height:b.top,ot=0;ot<E;ot++){var lt=z,ut=y[ot];if(ut.visible){var ft=ut.measuredBounds,yt=ut.margin,xt=yt.left+yt.right,Ct=z+b.right,bt=ft.width,Vt=Os(ut,!1);(isNaN(ut.desiredSize.width)&&Vt===Sn||Vt===Fi)&&(bt=Math.max(x.width-xt-Ct,0)),xt=bt+xt+Ct,Ct=ut.alignment,Ct.Xb()&&(Ct=a.defaultAlignment),Ct.sb()||(Ct=lr),tt&&(rt-=ft.height+yt.bottom+yt.top),ut.arrange(lt+Ct.offsetX+yt.left+(x.width*Ct.x-xt*Ct.x),rt+Ct.offsetY+yt.top,bt,ft.height),tt||(rt+=ft.height+yt.bottom+yt.top)}}};function vm(){this.xa="Base"}Se(vm,Ea),vm.prototype.measure=function(a,y,x,E,b,z,tt){var rt=E.length,ot=a.Pb(),lt=ot.margin,ut=lt.right+lt.left,ft=lt.top+lt.bottom;ot.measure(y,x,z,tt);var yt=ot.measuredBounds;z=yt.width,tt=yt.height;var xt=Math.max(z+ut,0),Ct=Math.max(tt+ft,0),bt=a.isClipping,Vt=Be.allocAt(-lt.left,-lt.top,xt,Ct),zt=Be.allocAt(0,0,z,tt);fv(ot,zt,!0),z=zt.width,tt=zt.height;for(var Qt=!0,ee=ch(a),oe=0;oe<rt;oe++){var ce=E[oe];yt=y;var Me=x;if(ce!==ot&&(ce.visible||ce===ee)){lt=ce.margin;var Wn=lt.left,di=lt.top;switch(xt=lt.right+lt.left,Ct=lt.top+lt.bottom,lt=Os(ce,!1),lt){case Sn:yt=z,Me=tt,di=Wn=Ct=xt=0;break;case Fi:yt=z,Wn=xt=0;break;case Ri:Me=tt,di=Ct=0}ce.measure(yt,Me,0,0),yt=ce.measuredBounds,xt=Math.max(yt.width+xt,0),Ct=Math.max(yt.height+Ct,0),lt=ce.alignment,lt.Xb()&&(lt=a.defaultAlignment),lt.sb()||(lt=lr);var oi=ce.alignmentFocus;if(oi.Xb()&&(oi=lr),Me=null,ce instanceof wn&&ce.$e!==""&&(Me=ce.fb(ce.$e),Me===ce&&(Me=null)),Wn=zt.x-Wn,di=zt.y-di,Me!==null){for(ce.arrange(0,0,yt.width,yt.height),yt=Me.actualBounds,yt=At.allocAt(yt.x+(oi.x*yt.width-oi.offsetX),yt.y+(oi.y*yt.height-oi.offsetY)),Me=Me.panel;Me!==ce;)Me.transform.Ga(yt),Me=Me.panel;Wn+=lt.x*z+lt.offsetX-yt.x,di+=lt.y*tt+lt.offsetY-yt.y,At.free(yt)}else Wn+=lt.x*z+lt.offsetX-(oi.x*yt.width+oi.offsetX),di+=lt.y*tt+lt.offsetY-(oi.y*yt.height+oi.offsetY);Qt?(Qt=!1,b.h(Wn,di,xt,Ct)):Rr(b,Wn,di,xt,Ct)}}switch(Qt?b.assign(Vt):bt?b.Uu(zt.x,zt.y,zt.width,zt.height):Rr(b,Vt.x,Vt.y,Vt.width,Vt.height),Be.free(Vt),Be.free(zt),lt=ot.stretch,lt===rr&&(lt=Os(ot,!1)),lt){case hn:return;case Sn:if(!isFinite(y)&&!isFinite(x))return;break;case Fi:if(!isFinite(y))return;break;case Ri:if(!isFinite(x))return}for(yt=ot.measuredBounds,z=yt.width,tt=yt.height,xt=Math.max(z+ut,0),Ct=Math.max(tt+ft,0),lt=ot.margin,zt=Be.allocAt(-lt.left,-lt.top,xt,Ct),fv(ot,zt,!0),z=zt.width,tt=zt.height,y=0;y<rt;y++)x=E[y],x===ot||!x.visible&&x!==ee||(lt=x.margin,xt=lt.right+lt.left,Ct=lt.top+lt.bottom,yt=x.measuredBounds,xt=Math.max(yt.width+xt,0),Ct=Math.max(yt.height+Ct,0),ut=x.alignment,ut.Xb()&&(ut=a.defaultAlignment),ut.sb()||(ut=lr),x=x.alignmentFocus,x.Xb()&&(x=lr),Qt?(Qt=!1,b.h(ut.x*z+ut.offsetX-(x.x*yt.width+x.offsetX)-lt.left,ut.y*tt+ut.offsetY-(x.y*yt.height+x.offsetY)-lt.top,xt,Ct)):Rr(b,ut.x*z+ut.offsetX-(x.x*yt.width+x.offsetX)-lt.left,ut.y*tt+ut.offsetY-(x.y*yt.height+x.offsetY)-lt.top,xt,Ct));Qt?b.assign(Vt):bt?b.Uu(zt.x,zt.y,zt.width,zt.height):Rr(b,Vt.x,Vt.y,Vt.width,Vt.height),Be.free(zt)},vm.prototype.arrange=function(a,y,x){var E=y.length,b=a.Pb(),z=b.measuredBounds,tt=z.width,rt=z.height,ot=a.padding;z=ot.left,ot=ot.top;var lt=z-x.x,ut=ot-x.y;for(b.arrange(lt,ut,tt,rt),tt=Be.allocAt(0,0,tt,rt),fv(b,tt,!1),rt=0;rt<E;rt++){var ft=y[rt];if(ft!==b){lt=ft.measuredBounds;var yt=lt.width,xt=lt.height;ut=ft.alignment,ut.Xb()&&(ut=a.defaultAlignment),ut.sb()||(ut=lr);var Ct=ft.alignmentFocus;if(Ct.Xb()&&(Ct=lr),lt=null,ft instanceof wn&&ft.$e!==""&&(lt=ft.fb(ft.$e),lt===ft&&(lt=null)),lt!==null){var bt=lt.actualBounds;for(Ct=At.allocAt(bt.x+(Ct.x*bt.width-Ct.offsetX),bt.y+(Ct.y*bt.height-Ct.offsetY)),lt=lt.panel;lt!==ft;)lt.transform.Ga(Ct),lt=lt.panel;lt=ut.x*tt.width+ut.offsetX-Ct.x,ut=ut.y*tt.height+ut.offsetY-Ct.y,At.free(Ct)}else lt=ut.x*tt.width+ut.offsetX-(Ct.x*yt+Ct.offsetX),ut=ut.y*tt.height+ut.offsetY-(Ct.y*xt+Ct.offsetY);lt+=tt.x-x.x,ut+=tt.y-x.y,ft.visible&&ft.arrange(z+lt,ot+ut,yt,xt)}}Be.free(tt)};function fv(a,y,x){var E=null;if(a instanceof wn&&a.$e!==""&&(E=a.fb(a.$e),E===a&&(E=null)),E!==null)for(x&&a.arrange(0,0,y.width,y.height),y.assign(E.actualBounds),E=E.panel;E!==a;)E.transform.pp(y),E=E.panel}function ym(){this.xa="Base"}Se(ym,Ea),ym.prototype.measure=function(a,y,x,E,b,z,tt){var rt=E.length,ot=a.Pb(),lt=ot.margin,ut=y,ft=x,yt=lt.right+lt.left,xt=lt.top+lt.bottom;ot.measure(y,x,z,tt),lt=ot.measuredBounds;var Ct=0,bt=null;ot instanceof cr&&(bt=ot,Ct=bt.strokeWidth*bt.scale);var Vt=Math.max(lt.width+yt,0);lt=Math.max(lt.height+xt,0);var zt=vv(ot),Qt=zt.x*Vt+zt.offsetX;zt=zt.y*lt+zt.offsetY;var ee=yv(ot),oe=ee.x*Vt+ee.offsetX;for(ee=ee.y*lt+ee.offsetY,isFinite(y)&&(ut=Math.max(Math.abs(Qt-oe)-Ct,0)),isFinite(x)&&(ft=Math.max(Math.abs(zt-ee)-Ct,0)),Ct=on.alloc(),Ct.h(0,0),a=ch(a),ee=0;ee<rt;ee++)zt=E[ee],zt===ot||!zt.visible&&zt!==a||(lt=zt.margin,Vt=lt.right+lt.left,Qt=lt.top+lt.bottom,zt.measure(ut,ft,0,0),lt=zt.measuredBounds,Vt=Math.max(lt.width+Vt,0),lt=Math.max(lt.height+Qt,0),Ct.h(Math.max(Vt,Ct.width),Math.max(lt,Ct.height)));if(rt===1)b.width=Vt,b.height=lt,on.free(Ct);else{switch(zt=vv(ot),ee=yv(ot),rt=E=0,ee.x!==zt.x&&ee.y!==zt.y&&(E=Ct.width/Math.abs(ee.x-zt.x),rt=Ct.height/Math.abs(ee.y-zt.y)),on.free(Ct),Ct=0,bt!==null&&(Ct=bt.strokeWidth*bt.scale,Ev(bt)===xi&&(E=rt=Math.max(E,rt))),E+=Math.abs(zt.offsetX)+Math.abs(ee.offsetX)+Ct,rt+=Math.abs(zt.offsetY)+Math.abs(ee.offsetY)+Ct,bt=ot.stretch,bt===rr&&(bt=Os(ot,!1)),bt){case hn:tt=z=0;break;case Sn:isFinite(y)&&(E=y),isFinite(x)&&(rt=x);break;case Fi:isFinite(y)&&(E=y),tt=0;break;case Ri:z=0,isFinite(x)&&(rt=x)}ot.Uj(),ot.measure(E,rt,z,tt),b.width=ot.measuredBounds.width+yt,b.height=ot.measuredBounds.height+xt}},ym.prototype.arrange=function(a,y){var x=y.length,E=a.Pb(),b=E.measuredBounds,z=Be.alloc();z.h(0,0,1,1);var tt=E.margin,rt=tt.left;tt=tt.top;var ot=a.padding,lt=ot.left;ot=ot.top,E.arrange(lt+rt,ot+tt,b.width,b.height);var ut=vv(E),ft=yv(E),yt=ut.y*b.height+ut.offsetY,xt=ft.x*b.width+ft.offsetX;for(ft=ft.y*b.height+ft.offsetY,z.x=ut.x*b.width+ut.offsetX,z.y=yt,Rr(z,xt,ft,0,0),z.x+=rt+lt,z.y+=tt+ot,b=0;b<x;b++)rt=y[b],rt!==E&&(lt=rt.measuredBounds,tt=rt.margin,ot=Math.max(lt.width+tt.right+tt.left,0),ut=Math.max(lt.height+tt.top+tt.bottom,0),yt=rt.alignment,yt.Xb()&&(yt=a.defaultAlignment),yt.sb()||(yt=lr),ot=z.width*yt.x+yt.offsetX-ot*yt.x+tt.left+z.x,tt=z.height*yt.y+yt.offsetY-ut*yt.y+tt.top+z.y,rt.visible&&(jr(z.x,z.y,z.width,z.height,ot,tt,lt.width,lt.height)?rt.arrange(ot,tt,lt.width,lt.height):rt.arrange(ot,tt,lt.width,lt.height,new Be(z.x,z.y,z.width,z.height))));Be.free(z)};function Sm(){this.xa="Base",this.name="Table"}Se(Sm,Ea),Sm.prototype.measure=function(a,y,x,E,b){for(var z=E.length,tt=Yn(),rt=Yn(),ot=0;ot<z;ot++){var lt=E[ot],ut=lt instanceof wn?lt:null;if(ut!==null&&Th(ut)&<.visible){rt.push(ut);for(var ft=ut.O.s,yt=ft.length,xt=0;xt<yt;xt++){var Ct=ft[xt];ut.type===wn.TableRow?Ct.row=lt.row:ut.type===wn.TableColumn&&(Ct.column=lt.column),tt.push(Ct)}}else tt.push(lt)}z=tt.length,z===0&&(a.Fb(0),a.Eb(0));for(var bt=[],Vt=0;Vt<z;Vt++){var zt=tt[Vt];zt.visible&&(ya(zt,!0),Wu(zt,!0),bt[zt.row]||(bt[zt.row]=[]),bt[zt.row][zt.column]||(bt[zt.row][zt.column]=[]),bt[zt.row][zt.column].push(zt))}si(tt);var Qt=Yn(),ee=Yn(),oe=Yn(),ce={count:0},Me={count:0},Wn=y,di=x,oi=a.rowDefs,kn=a.colDefs,en=null;z=oi.length;for(var qi=0;qi<z;qi++)en=oi[qi],en!==void 0&&(en.actual=0);z=kn.length;for(var Yi=0;Yi<z;Yi++)en=kn[Yi],en!==void 0&&(en.actual=0);for(var oo=bt.length,ko=0,ka=0;ka<oo;ka++)bt[ka]&&(ko=Math.max(ko,bt[ka].length));var Ia=Math.min(a.topIndex,oo-1),cs=Math.min(a.leftIndex,ko-1),ba=0;oo=bt.length;for(var Hh=ch(a),da=0;da<oo;da++)if(bt[da]){ko=bt[da].length;var xu=a.Fb(da);xu.actual=0;for(var fs=xu.oc=0;fs<ko;fs++)if(bt[da][fs]){var Wh=a.Eb(fs);Qt[fs]===void 0&&(Wh.actual=0,Wh.oc=0,Qt[fs]=!0);for(var yl=bt[da][fs],Wl=yl.length,il=0;il<Wl;il++){var Ks=yl[il];if(Ks.visible||Ks===Hh){var Ld=1<Ks.rowSpan||1<Ks.columnSpan;Ld&&(da<Ia||fs<cs||ee.push(Ks));var Pu=Ks.margin,rg=Pu.right+Pu.left,rl=Pu.top+Pu.bottom,gs=pu(Ks,xu,Wh,!1),Op=Ks.desiredSize,Xc=!isNaN(Op.height),Du=!isNaN(Op.width)&&Xc;if(Ld||gs===hn||Du||da<Ia||fs<cs||(ce[fs]!==void 0||gs!==Sn&&gs!==Fi||(ce[fs]=-1,ce.count++),Me[da]!==void 0||gs!==Sn&&gs!==Ri||(Me[da]=-1,Me.count++),oe.push(Ks)),Ks.measure(1/0,1/0,0,0),!(da<Ia||fs<cs)){var Us=Ks.measuredBounds,ac=Math.max(Us.width+rg,0),ol=Math.max(Us.height+rl,0);if(Ks.rowSpan===1&&(gs===hn||gs===Fi)){en=a.Fb(da);var Fd=en.Wc();ba=Math.max(ol-en.actual,0),ba+Fd>di&&(ba=Math.max(di-Fd,0));var G0=en.oa===0;en.oc=en.oc+ba,en.actual=en.oa+ba,di=Math.max(di-(ba+(G0?Fd:0)),0)}if(Ks.columnSpan===1&&(gs===hn||gs===Ri)){en=a.Eb(fs);var Ip=en.Wc();ba=Math.max(ac-en.actual,0),ba+Ip>Wn&&(ba=Math.max(Wn-Ip,0));var zy=en.oa===0;en.oc=en.oc+ba,en.actual=en.oa+ba,Wn=Math.max(Wn-(ba+(zy?Ip:0)),0)}Ld&&Ks.Uj()}}}}}si(Qt);var eh=0,ph=0;z=a.columnCount;for(var Jc=0;Jc<z;Jc++){var Md=kn[Jc];Md!==void 0&&(eh+=isNaN(Md.Hc)?Md.oc:Md.Hc,Md.oc!==0&&(eh+=Md.Wc()))}z=a.rowCount;for(var og=0;og<z;og++){var kd=oi[og];kd!==void 0&&(ph+=isNaN(kd.Hc)?kd.oc:kd.Hc,kd.oc!==0&&(ph+=kd.Wc()))}Wn=Math.max(y-eh,0);var nh=di=Math.max(x-ph,0),Vh=Wn;z=oe.length;for(var Ys=0;Ys<z;Ys++){var Ou=oe[Ys],H0=a.Fb(Ou.row),mh=a.Eb(Ou.column),ag=Ou.measuredBounds,wu=Ou.margin,sc=wu.right+wu.left,Iu=wu.top+wu.bottom;ce[Ou.column]=mh.oc===0&&ce[Ou.column]!==void 0?Math.max(ag.width+sc,ce[Ou.column]):null,Me[Ou.row]=H0.oc===0&&Me[Ou.row]!==void 0?Math.max(ag.height+Iu,Me[Ou.row]):null}var Qc=0,sg=0,lu;for(lu in Me)lu!=="count"&&(Qc+=Me[lu]);for(lu in ce)lu!=="count"&&(sg+=ce[lu]);for(var Ua=on.alloc(),_p=0;_p<z;_p++){var Ns=oe[_p];if(Ns.visible||Ns===Hh){var ca=a.Fb(Ns.row),Bs=a.Eb(Ns.column),vh=0;isFinite(Bs.width)?vh=Bs.width:(isFinite(Wn)&&ce[Ns.column]!==null?sg===0?vh=Bs.actual+Wn:vh=ce[Ns.column]/sg*Vh:ce[Ns.column]!==null?vh=Wn:vh=Bs.actual||Wn,vh=Math.max(0,vh-Bs.Wc()));var Kh=0;switch(isFinite(ca.height)?Kh=ca.height:(isFinite(di)&&Me[Ns.row]!==null?Qc===0?Kh=ca.actual+di:Kh=Me[Ns.row]/Qc*nh:Me[Ns.row]!==null?Kh=di:Kh=ca.actual||di,Kh=Math.max(0,Kh-ca.Wc())),Ua.h(Math.max(Bs.minimum,Math.min(vh,Bs.maximum)),Math.max(ca.minimum,Math.min(Kh,ca.maximum))),gs=pu(Ns,ca,Bs,!1),gs){case Fi:Ua.height=Math.max(Ua.height,ca.actual+di);break;case Ri:Ua.width=Math.max(Ua.width,Bs.actual+Wn)}var lc=Ns.margin,Zy=lc.right+lc.left,W0=lc.top+lc.bottom;Ns.Uj(),Ns.measure(Ua.width,Ua.height,Bs.minimum,ca.minimum);var lg=Ns.measuredBounds,uc=Math.max(lg.width+Zy,0),$c=Math.max(lg.height+W0,0);isFinite(Wn)&&(uc=Math.min(uc,Ua.width)),isFinite(di)&&($c=Math.min($c,Ua.height));var Xs=0;Xs=ca.actual,ca.actual=Math.max(ca.actual,$c),ca.oc=Math.max(ca.oc,$c),ba=ca.actual-Xs,di=Math.max(di-ba,0),Me[Ns.row]===null&&(nh=Math.max(nh-ba,0)),Xs=Bs.actual,Bs.actual=Math.max(Bs.actual,uc),Bs.oc=Math.max(Bs.oc,uc),ba=Bs.actual-Xs,Wn=Math.max(Wn-ba,0),ce[Ns.column]===null&&(Vh=Math.max(Vh-ba,0))}}si(oe);var yh=on.alloc(),Cu=Yn(),Bl=Yn();if(z=ee.length,z!==0){for(var bd=0;bd<oo;bd++)if(bt[bd]){ko=bt[bd].length;var ug=a.Fb(bd);Cu[bd]=ug.actual;for(var Nd=0;Nd<ko;Nd++)if(bt[bd][Nd]){var V0=a.Eb(Nd);Bl[Nd]=V0.actual}}}for(var hg=0;hg<z;hg++){var ra=ee[hg];if(ra.visible||ra===Hh){var uu=a.Fb(ra.row),Vl=a.Eb(ra.column);switch(Ua.h(Math.max(Vl.minimum,Math.min(y,Vl.maximum)),Math.max(uu.minimum,Math.min(x,uu.maximum))),gs=pu(ra,uu,Vl,!1),gs){case Sn:Bl[Vl.index]!==0&&(Ua.width=Math.min(Ua.width,Bl[Vl.index])),Cu[uu.index]!==0&&(Ua.height=Math.min(Ua.height,Cu[uu.index]));break;case Fi:Bl[Vl.index]!==0&&(Ua.width=Math.min(Ua.width,Bl[Vl.index]));break;case Ri:Cu[uu.index]!==0&&(Ua.height=Math.min(Ua.height,Cu[uu.index]))}isFinite(Vl.width)&&(Ua.width=Vl.width),isFinite(uu.height)&&(Ua.height=uu.height),yh.h(0,0);for(var K0=Vl.minimum,al=uu.minimum,Uh=1;Uh<ra.rowSpan&&!(ra.row+Uh>=a.rowCount);Uh++)en=a.Fb(ra.row+Uh),ba=0,ba=gs===Sn||gs===Ri?Math.max(en.minimum,Cu[ra.row+Uh]===0?en.maximum:Math.min(Cu[ra.row+Uh],en.maximum)):Math.max(en.minimum,isNaN(en.Hc)?en.maximum:Math.min(en.Hc,en.maximum)),yh.height+=ba,al+=en.minimum;for(var Kl=1;Kl<ra.columnSpan&&!(ra.column+Kl>=a.columnCount);Kl++)en=a.Eb(ra.column+Kl),ba=0,ba=gs===Sn||gs===Fi?Math.max(en.minimum,Bl[ra.column+Kl]===0?en.maximum:Math.min(Bl[ra.column+Kl],en.maximum)):Math.max(en.minimum,isNaN(en.Hc)?en.maximum:Math.min(en.Hc,en.maximum)),yh.width+=ba,K0+=en.minimum;Ua.width+=yh.width,Ua.height+=yh.height;var dg=ra.margin,Bd=dg.right+dg.left,Rp=dg.top+dg.bottom;ra.measure(Ua.width,Ua.height,K0,al);for(var cg=ra.measuredBounds,_u=Math.max(cg.width+Bd,0),hc=Math.max(cg.height+Rp,0),Ad=0,fg=0;fg<ra.rowSpan&&!(ra.row+fg>=a.rowCount);fg++)en=a.Fb(ra.row+fg),Ad+=en.total||0;if(Ad<hc){var Yh=hc-Ad,ih=hc-Ad;if(ra.spanAllocation!==null)for(var Xh=ra.spanAllocation,Sh=0;Sh<ra.rowSpan&&!(0>=Yh)&&!(ra.row+Sh>=a.rowCount);Sh++){en=a.Fb(ra.row+Sh);var Jh=en.oa||0,dc=Xh(ra,en,ih);en.actual=Math.min(en.maximum,Jh+dc),en.oa!==Jh&&(Yh-=en.oa-Jh)}for(;0<Yh;){var Eu=en.oa||0;if(isNaN(en.height)&&en.maximum>Eu&&(en.actual=Math.min(en.maximum,Eu+Yh),en.oa!==Eu&&(Yh-=en.oa-Eu)),en.index===0)break;en=a.Fb(en.index-1)}}for(var qc=0,Qh=0;Qh<ra.columnSpan&&!(ra.column+Qh>=a.columnCount);Qh++)en=a.Eb(ra.column+Qh),qc+=en.total||0;if(qc<_u){var tf=_u-qc,Gy=_u-qc;if(ra.spanAllocation!==null)for(var xh=ra.spanAllocation,cc=0;cc<ra.columnSpan&&!(0>=tf)&&!(ra.column+cc>=a.columnCount);cc++){en=a.Eb(ra.column+cc);var jp=en.oa||0,Hy=xh(ra,en,Gy);en.actual=Math.min(en.maximum,jp+Hy),en.oa!==jp&&(tf-=en.oa-jp)}for(;0<tf;){var U0=en.oa||0;if(isNaN(en.width)&&en.maximum>U0&&(en.actual=Math.min(en.maximum,U0+tf),en.oa!==U0&&(tf-=en.oa-U0)),en.index===0)break;en=a.Eb(en.index-1)}}}}si(ee),on.free(yh),on.free(Ua),Cu!==void 0&&si(Cu),Bl!==void 0&&si(Bl);var ef=0,nf=0,Y0=a.desiredSize,gx=a.maxSize;gs=Os(a,!0);var zp=ph=eh=0,Zp=0;z=a.columnCount;for(var X0=0;X0<z;X0++)kn[X0]!==void 0&&(en=a.Eb(X0),isFinite(en.width)?(zp+=en.width,zp+=en.Wc()):bm(en)===$g?(zp+=en.oa,zp+=en.Wc()):en.oa!==0&&(eh+=en.oa,eh+=en.Wc()));isFinite(Y0.width)?ef=Math.min(Y0.width,gx.width):ef=gs!==hn&&isFinite(y)?y:eh,ef=Math.max(ef,a.minSize.width),ef=Math.max(ef-zp,0);for(var Qx=eh===0?1:Math.max(ef/eh,1),J0=0;J0<z;J0++)kn[J0]!==void 0&&(en=a.Eb(J0),isFinite(en.width)||bm(en)===$g||(en.actual=en.oa*Qx),en.position=b.width,en.oa!==0&&(b.width+=en.oa,b.width+=en.Wc()));z=a.rowCount;for(var Q0=0;Q0<z;Q0++)oi[Q0]!==void 0&&(en=a.Fb(Q0),isFinite(en.height)?(Zp+=en.height,Zp+=en.Wc()):bm(en)===$g?(Zp+=en.oa,Zp+=en.Wc()):en.oa!==0&&(ph+=en.oa,ph+=en.Wc()));isFinite(Y0.height)?nf=Math.min(Y0.height,gx.height):nf=gs!==hn&&isFinite(x)?x:ph,nf=Math.max(nf,a.minSize.height),nf=Math.max(nf-Zp,0);for(var $x=ph===0?1:Math.max(nf/ph,1),$0=0;$0<z;$0++)oi[$0]!==void 0&&(en=a.Fb($0),isFinite(en.height)||bm(en)===$g||(en.actual=en.oa*$x),en.position=b.height,en.oa!==0&&(b.height+=en.oa,b.height+=en.Wc()));z=rt.length;for(var Wy=0;Wy<z;Wy++){var Gp=rt[Wy],Vy=0,Ky=0;Gp.type===wn.TableRow?(Vy=b.width,en=a.Fb(Gp.row),Ky=en.actual):(en=a.Eb(Gp.column),Vy=en.actual,Ky=b.height),Gp.measuredBounds.h(0,0,Vy,Ky),ya(Gp,!1)}si(rt),a.inRowsCols=bt},Sm.prototype.arrange=function(a,y,x){var E=y.length,b=a.padding,z=b.left;b=b.top;var tt=a.inRowsCols;if(tt!==null){for(var rt,ot,lt=tt.length,ut=0,ft=0;ft<lt;ft++)tt[ft]&&(ut=Math.max(ut,tt[ft].length));ot=a.rowDefs,rt=a.colDefs;var yt=ft=0,xt=Math.min(a.topIndex,lt-1);if(0<ot.length){for(;xt!==lt&&(ot[xt]===void 0||ot[xt].oa===0);)xt++;xt=Math.max(Math.min(xt,lt-1),0),ft=-ot[xt].position}var Ct=Math.min(a.leftIndex,ut-1);if(0<rt.length){for(;Ct!==ut&&(rt[Ct]===void 0||rt[Ct].oa===0);)Ct++;Ct=Math.max(Math.min(Ct,ut-1),0),yt=-rt[Ct].position}for(var bt=0,Vt=0;bt!==lt&&ot[bt]===void 0;)bt++;for(;Vt!==lt&&rt[Vt]===void 0;)Vt++;ut=a.part,a.Fb(bt),a.Eb(Vt);for(var zt=0;zt<y.length;zt++){var Qt=y[zt];if(Qt instanceof wn&&Qt.visible&&Th(Qt)){if(Qt.type===wn.TableRow){rt=a.Fb(Qt.row);var ee=a.Eb(Vt)}else rt=a.Fb(bt),ee=a.Eb(Qt.column);ot=rt.position+ft+b,rt.oa!==0&&(ot+=rt.Io(Math.max(bt,xt))),rt=ee.position+yt+z,ee.oa!==0&&(rt+=ee.Io(Math.max(Vt,Ct))),ee=Qt.measuredBounds,Qt.Uk(),Qt.actualBounds.ka();var oe=Qt.actualBounds,ce=Be.allocAt(oe.x,oe.y,oe.width,oe.height);oe.x=Qt.type===wn.TableRow?z:rt,oe.y=Qt.type===wn.TableColumn?b:ot,oe.width=ee.width,oe.height=ee.height,Qt.actualBounds.freeze(),Wu(Qt,!1),Hr(ce,oe)||ut===null||(ut.oh(),Qt.Pn(ut)),Be.free(ce)}}for(zt=on.alloc(),Qt=0;Qt<lt;Qt++)if(tt[Qt]){for(ut=tt[Qt].length,ee=a.Fb(Qt),ot=ee.position+ft+b,ee.oa!==0&&(ot+=ee.Io(Math.max(bt,xt))),oe=0;oe<ut;oe++)if(tt[Qt][oe]){ce=a.Eb(oe),rt=ce.position+yt+z,ce.oa!==0&&(rt+=ce.Io(Math.max(Vt,Ct)));for(var Me=tt[Qt][oe],Wn=Me.length,di=0;di<Wn;di++){var oi=Me[di],kn=oi.measuredBounds;zt.h(0,0);for(var en=1;en<oi.rowSpan&&!(Qt+en>=a.rowCount);en++){var qi=a.Fb(Qt+en);qi.oa!==0&&(zt.height+=qi.total)}for(en=1;en<oi.columnSpan&&!(oe+en>=a.columnCount);en++)qi=a.Eb(oe+en),qi.oa!==0&&(zt.width+=qi.total);var Yi=ce.oa+zt.width,oo=ee.oa+zt.height;en=rt,qi=ot;var ko=Yi,ka=oo,Ia=rt,cs=ot,ba=Yi,Hh=oo;rt+Yi>x.width&&(ba=Math.max(x.width-rt,0)),ot+oo>x.height&&(Hh=Math.max(x.height-ot,0));var da=oi.alignment;if(da.Xb()){da=a.defaultAlignment,da.sb()||(da=lr);var xu=da.x,fs=da.y,Wh=da.offsetX;da=da.offsetY;var yl=ce.alignment,Wl=ee.alignment;yl.sb()&&(xu=yl.x,Wh=yl.offsetX),Wl.sb()&&(fs=Wl.y,da=Wl.offsetY)}else xu=da.x,fs=da.y,Wh=da.offsetX,da=da.offsetY;(isNaN(xu)||isNaN(fs))&&(fs=xu=.5,da=Wh=0),yl=kn.width,Wl=kn.height;var il=oi.margin,Ks=il.left+il.right,Ld=il.top+il.bottom,Pu=pu(oi,ee,ce,!1);!isNaN(oi.desiredSize.width)||Pu!==Sn&&Pu!==Fi||(yl=Math.max(Yi-Ks,0)),!isNaN(oi.desiredSize.height)||Pu!==Sn&&Pu!==Ri||(Wl=Math.max(oo-Ld,0)),Yi=oi.maxSize,oo=oi.minSize,yl=Math.min(Yi.width,yl),Wl=Math.min(Yi.height,Wl),yl=Math.max(oo.width,yl),Wl=Math.max(oo.height,Wl),Yi=Wl+Ld,en+=ko*xu-(yl+Ks)*xu+Wh+il.left,qi+=ka*fs-Yi*fs+da+il.top,oi.visible&&(jr(Ia,cs,ba,Hh,en,qi,kn.width,kn.height)?oi.arrange(en,qi,yl,Wl):oi.arrange(en,qi,yl,Wl,new Be(Ia,cs,ba,Hh)))}}}for(on.free(zt),a=0;a<E;a++)x=y[a],z=x instanceof wn?x:null,z!==null&&Th(z)&&(z=x.actualBounds,x.naturalBounds.ka(),x.naturalBounds.h(0,0,z.width,z.height),x.naturalBounds.freeze())}};function xm(){this.xa="Base"}Se(xm,Ea),xm.prototype.measure=function(){},xm.prototype.arrange=function(){};function Pm(){this.xa="Base"}Se(Pm,Ea),Pm.prototype.measure=function(){},Pm.prototype.arrange=function(){};function wm(){this.xa="Base"}Se(wm,Ea),wm.prototype.measure=function(a,y,x,E,b,z,tt){1<E.length&&Gt("Viewbox Panel cannot contain more than one GraphObject."),E=E[0],E.Ca=1,E.Uj(),E.measure(1/0,1/0,z,tt);var rt=E.measuredBounds,ot=E.margin,lt=ot.right+ot.left;if(ot=ot.top+ot.bottom,isFinite(y)||isFinite(x)){var ut=E.scale,ft=rt.width;rt=rt.height;var yt=Math.max(y-lt,0),xt=Math.max(x-ot,0),Ct=1;a.viewboxStretch===xi?ft!==0&&rt!==0&&(Ct=Math.min(yt/ft,xt/rt)):ft!==0&&rt!==0&&(Ct=Math.max(yt/ft,xt/rt)),Ct===0&&(Ct=1e-4),E.Ca*=Ct,ut!==E.scale&&(ya(E,!0),E.measure(1/0,1/0,z,tt))}rt=E.measuredBounds,b.width=isFinite(y)?y:Math.max(rt.width+lt,0),b.height=isFinite(x)?x:Math.max(rt.height+ot,0)},wm.prototype.arrange=function(a,y,x){y=y[0];var E=y.measuredBounds,b=y.margin,z=Math.max(E.width+(b.right+b.left),0);b=Math.max(E.height+(b.top+b.bottom),0);var tt=y.alignment;tt.Xb()&&(tt=a.defaultAlignment),tt.sb()||(tt=lr),y.arrange(x.width*tt.x-z*tt.x+tt.offsetX,x.height*tt.y-b*tt.y+tt.offsetY,E.width,E.height)};function Xg(){this.xa="Base"}Se(Xg,Ea),Xg.prototype.measure=function(){},Xg.prototype.arrange=function(){},Xg.prototype.gc=function(a,y,x){x=a.Df()*x.scale,0>=x&&(x=1);var E=a.gridCellSize,b=E.width;E=E.height;var z=a.naturalBounds,tt=a.actualBounds,rt=z.width,ot=z.height,lt=Math.ceil(rt/b),ut=Math.ceil(ot/E),ft=a.gridOrigin,yt=ft.x;ft=ft.y,y.save(),y.beginPath(),y.rect(0,0,rt,ot),y.clip(),y.Se();for(var xt=[],Ct=a.O.s,bt=Ct.length,Vt=0;Vt<bt;Vt++){var zt=Ct[Vt],Qt=[];if(xt.push(Qt),zt.visible){var ee=zt.interval;if(!(0>ee)){zt=pv(zt.figure);for(var oe=0;oe<bt;oe++)if(oe!==Vt){var ce=Ct[oe];ce.visible&&pv(ce.figure)===zt&&(ce=ce.interval,ce>ee&&Qt.push(ce))}}}}for(Ct=a.O.s,bt=Ct.length,Vt=0;Vt<bt;Vt++){var Me=Ct[Vt];if(Me.visible&&(Qt=Me.interval||1,zt=Math.abs(Qt),!(2>b*zt*x))){if(ee=Me.segmentIndex,(!isFinite(ee)||isNaN(ee))&&(ee=0),0>ee&&(ee=zt-Math.min(-ee,zt)),ee=Math.round(ee%zt),zt=Me.opacity,oe=1,zt!==1){if(zt===0)continue;oe=y.globalAlpha,y.globalAlpha=oe*zt}ce=xt[Vt];var Wn=!1,di=Me.strokeDashArray;if(di!==null&&(Wn=!0,y.js(di,Me.strokeDashOffset)),Me.figure==="LineV"&&Me.stroke!==null&&0<Me.strokeWidth){for(y.lineWidth=Me.strokeWidth,na(a,y,Me.stroke,!1,!1,z,tt),y.beginPath(),di=Me=Math.floor((yt-b)/b);di<=Me+lt;di++){var oi=di*b+yt;0<=oi&&oi<=rt&&Cm(di,Qt,ee,ce)&&(y.moveTo(oi,0),y.lineTo(oi,ot))}y.stroke(),y.Se()}else if(Me.figure==="LineH"&&Me.stroke!==null&&0<Me.strokeWidth){for(y.lineWidth=Me.strokeWidth,na(a,y,Me.stroke,!1,!1,z,tt),y.beginPath(),di=Me=Math.floor((ft-E)/E);di<=Me+ut;di++)oi=di*E+ft,0<=oi&&oi<=ot&&Cm(di,Qt,ee,ce)&&(y.moveTo(0,oi),y.lineTo(rt,oi));y.stroke(),y.Se()}else if(Me.figure==="BarV"&&Me.fill!==null)for(na(a,y,Me.fill,!0,!1,z,tt),Me=Me.width,isNaN(Me)&&(Me=b),oi=di=Math.floor((yt-b)/b);oi<=di+lt;oi++){var kn=oi*b+yt;0<=kn+Me&&kn<=rt&&Cm(oi,Qt,ee,ce)&&y.fillRect(kn,0,Me,ot)}else if(Me.figure==="BarH"&&Me.fill!==null)for(na(a,y,Me.fill,!0,!1,z,tt),Me=Me.height,isNaN(Me)&&(Me=E),oi=di=Math.floor((ft-E)/E);oi<=di+ut;oi++)kn=oi*E+ft,0<=kn+Me&&kn<=ot&&Cm(oi,Qt,ee,ce)&&y.fillRect(0,kn,rt,Me);Wn&&y.fs(),zt!==1&&(y.globalAlpha=oe)}}y.restore(),y.Vc(!1)};function Cm(a,y,x,E){if(0>y)return a%y===x;if(a%y!==x)return!1;y=E.length;for(var b=0;b<y;b++)if(a%E[b]===x)return!1;return!0}function Em(){this.xa="Base"}Se(Em,Ea),Em.prototype.measure=function(a,y,x,E,b){var z=E.length;if(a instanceof Qr||a instanceof Nn){var tt=null,rt=null;if(a instanceof Nn&&(tt=a),a instanceof Qr&&(rt=a,tt=rt.adornedPart,a.j===null&&(a.j=[])),tt instanceof Nn){var ot=tt;if(z===0)so(a.naturalBounds,0,0),a.measuredBounds.h(0,0,0,0);else{var lt=a instanceof Qr?null:tt.path;y=tt.routeBounds,x=a.jg,x.h(0,0,y.width,y.height);var ut=ot.points,ft=tt.pointsCount;rt!==null?rt.Ul(!1):tt!==null&&tt.Ul(!1),rt=y.width;var yt=y.height,xt=a.j;if(xt.length=0,lt!==null){i1(a,rt,yt,lt);var Ct=lt.measuredBounds;x.ed(Ct),xt.push(Ct)}Ct=ae.alloc();for(var bt=At.alloc(),Vt=At.alloc(),zt=0;zt<z;zt++){var Qt=E[zt];if(Qt!==lt)if(Qt.isPanelMain&&Qt instanceof cr){i1(a,rt,yt,Qt);var ee=Qt.measuredBounds;x.ed(ee),xt.push(ee)}else if(2>ft)Qt.measure(1/0,1/0,0,0),ee=Qt.measuredBounds,x.ed(ee),xt.push(ee);else{var oe=Qt.segmentIndex,ce=Qt.segmentFraction,Me=Qt.alignmentFocus;Me.Mc()&&(Me=lr);var Wn=Qt.segmentOrientation,di=Qt.segmentOffset;if(isNaN(oe)){var oi=ot.ua;ee=Yn(),oi.Qu(ce,ee);var kn=At.allocAt(ee[0],ee[1]);if(kn.add(ot.i(0)),oi.type===fe.j?kn.offset(-oi.startX,-oi.startY):(oi=oi.figures.first(),oi!==null&&kn.offset(-oi.startX,-oi.startY)),oi=ee[2],Wn!==Ls){var en=ot.computeAngle(Qt,Wn,oi);Qt.Kb=en}en=kn.x-y.x;var qi=kn.y-y.y;At.free(kn),si(ee)}else if(oe<-ft||oe>=ft)ee=At.alloc(),ot.vg(),ot.computeMidPoint(ee),oi=ot.midAngle,Wn!==Ls&&(en=ot.computeAngle(Qt,Wn,oi),Qt.Kb=en),en=ee.x-y.x,qi=ee.y-y.y,At.free(ee);else{if(en=0,0<=oe?(qi=ut.M(oe),ee=oe<ft-1?ut.M(oe+1):qi):(en=ft+oe,qi=ut.M(en),ee=0<en?ut.M(en-1):qi),qi.Xa(ee)){0<=oe?(oi=0<oe?ut.M(oe-1):qi,en=oe<ft-2?ut.M(oe+2):ee):(oi=en<ft-1?ut.M(en+1):qi,en=1<en?ut.M(en-2):ee),kn=oi.Bf(qi);var Yi=ee.Bf(en);oi=kn>Yi+10?0<=oe?oi.ab(qi):qi.ab(oi):Yi>kn+10?0<=oe?ee.ab(en):en.ab(ee):0<=oe?oi.ab(en):en.ab(oi)}else oi=0<=oe?qi.ab(ee):ee.ab(qi);Wn!==Ls&&(en=ot.computeAngle(Qt,Wn,oi),Qt.Kb=en),en=qi.x+(ee.x-qi.x)*ce-y.x,qi=qi.y+(ee.y-qi.y)*ce-y.y}Qt.measure(1/0,1/0,0,0),ee=Qt.measuredBounds,kn=Qt.naturalBounds;var oo=0;Qt instanceof cr&&(oo=Qt.strokeWidth),Yi=kn.width+oo;var ko=kn.height+oo;Ct.reset(),Ct.translate(-ee.x,-ee.y),Ct.scale(Qt.scale,Qt.scale),Ct.rotate(Wn===Ls?Qt.angle:oi,Yi/2,ko/2),Wn!==lp&&Wn!==hp||Ct.rotate(90,Yi/2,ko/2),Wn!==up&&Wn!==dp||Ct.rotate(-90,Yi/2,ko/2),Wn===t0&&(45<oi&&135>oi||225<oi&&315>oi)&&Ct.rotate(-oi,Yi/2,ko/2),kn=new Be(0,0,Yi,ko),bt.xi(kn,Me),Ct.Ga(bt),Me=-bt.x+oo/2*Qt.scale,Qt=-bt.y+oo/2*Qt.scale,Vt.assign(di),oo=isNaN(di.x);var ka=isNaN(di.y);if(oo||ka){Yi=Yi/2+3,ko=ko/2+3;var Ia=45<=oi&&135>=oi,cs=225<=oi&&315>=oi;Wn===Ls&&(Ia||cs)?(Vt.x=ka?Yi:di.y,Vt.y=oo?ko:di.x,Ia?0<=oe||isNaN(oe)&&.5>ce||!oo||(Vt.y=-ko):cs&&((0<=oe||isNaN(oe)&&.5>ce)&&oo&&(Vt.y=-ko),ka&&(Vt.x=-Yi))):(oo&&(Vt.x=0<=oe||isNaN(oe)&&.5>ce?Yi:-Yi),ka&&(Vt.y=-ko),Vt.rotate(oi))}else Vt.rotate(oi);en+=Vt.x,qi+=Vt.y,kn.set(ee),kn.h(en+Me,qi+Qt,ee.width,ee.height),xt.push(kn),x.ed(kn)}}if(tt!==null)for(E=tt.labelNodes;E.next();)E.value.measure(1/0,1/0);a.jg=x,a.position.h(y.x+x.x,y.y+x.y),so(b,x.width||0,x.height||0),ae.free(Ct),At.free(bt),At.free(Vt)}}}},Em.prototype.arrange=function(a,y){var x=y.length;if(a instanceof Qr||a instanceof Nn){var E=a,b=null;a instanceof Qr&&(b=a,E=b.adornedPart);var z=a instanceof Qr?null:E.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 lt=y[ot];if(lt!==z&&rt<tt.length){var ut=tt[rt];rt++,lt.arrange(ut.x-a.jg.x,ut.y-a.jg.y,ut.width,ut.height)}}}if(y=E.points,x=y.count,2<=x&&a instanceof Nn)for(z=a.labelNodes;z.next();){var ft=a;tt=z.value,rt=tt.segmentIndex,ot=tt.segmentFraction;var yt=tt.alignmentFocus;if(lt=tt.segmentOrientation,ut=tt.segmentOffset,isNaN(rt)){var xt=ft.ua,Ct=Yn();xt.Qu(ot,Ct);var bt=At.allocAt(Ct[0],Ct[1]);bt.add(ft.i(0)),xt.type===fe.j||(xt=xt.figures.first()),bt.offset(-xt.startX,-xt.startY),xt=Ct[2],lt!==Ls&&(ft=ft.computeAngle(tt,lt,xt),tt.angle=ft),ft=bt.x;var Vt=bt.y;At.free(bt),si(Ct)}else if(rt<-x||rt>=x)Ct=At.alloc(),xt=ft,Vt=Ct,xt.vg(),xt.computeMidPoint(Vt),xt=ft.midAngle,lt!==Ls&&(ft=ft.computeAngle(tt,lt,xt),tt.angle=ft),ft=Ct.x,Vt=Ct.y,At.free(Ct);else{if(bt=0,0<=rt?(Ct=y.s[rt],Vt=rt<x-1?y.s[rt+1]:Ct):(bt=x+rt,Ct=y.s[bt],Vt=0<bt?y.s[bt-1]:Ct),Ct.Xa(Vt)){0<=rt?(xt=0<rt?y.s[rt-1]:Ct,bt=rt<x-2?y.s[rt+2]:Vt):(xt=bt<x-1?y.s[bt+1]:Ct,bt=1<bt?y.s[bt-2]:Vt);var zt=xt.Bf(Ct),Qt=Vt.Bf(bt);xt=zt>Qt+10?0<=rt?xt.ab(Ct):Ct.ab(xt):Qt>zt+10?0<=rt?Vt.ab(bt):bt.ab(Vt):0<=rt?xt.ab(bt):bt.ab(xt)}else xt=0<=rt?Ct.ab(Vt):Vt.ab(Ct);lt!==Ls&&(ft=ft.computeAngle(tt,lt,xt),tt.angle=ft),ft=Ct.x+(Vt.x-Ct.x)*ot,Vt=Ct.y+(Vt.y-Ct.y)*ot}if(yt.ys())tt.location=new At(ft,Vt);else{yt.Mc()&&(yt=lr),Ct=ae.alloc(),Ct.reset(),Ct.scale(tt.scale,tt.scale),Ct.rotate(tt.angle,0,0);var ee=tt.naturalBounds;bt=Be.allocAt(0,0,ee.width,ee.height),zt=At.alloc(),zt.xi(bt,yt),Ct.Ga(zt),yt=-zt.x,Qt=-zt.y;var oe=ee.width,ce=ee.height;ee=At.alloc(),ee.assign(ut);var Me=isNaN(ut.x),Wn=isNaN(ut.y);if(Me||Wn){oe=oe/2+3,ce=ce/2+3;var di=45<=xt&&135>=xt,oi=225<=xt&&315>=xt;lt===Ls&&(di||oi)?(ee.x=Wn?oe:ut.y,ee.y=Me?ce:ut.x,di?0<=rt||isNaN(rt)&&.5>ot||!Me||(ee.y=-ce):oi&&((0<=rt||isNaN(rt)&&.5>ot)&&Me&&(ee.y=-ce),Wn&&(ee.x=-oe))):(Me&&(ee.x=0<=rt||isNaN(rt)&&.5>ot?oe:-oe),Wn&&(ee.y=-ce),ee.rotate(xt))}else ee.rotate(xt);ft+=ee.x,Vt+=ee.y,Ct.pp(bt),yt+=bt.x,Qt+=bt.y,rt=At.allocAt(ft+yt,Vt+Qt),tt.move(rt),At.free(rt),At.free(ee),At.free(zt),Be.free(bt),ae.free(Ct)}}b!==null?b.Ul(!1):E.Ul(!1),E=A1(a),a.location.h(a.position.x+E.x,a.position.y+E.y),At.free(E)}};function i1(a,y,x,E){if(gl(E)!==!1){var b=E.strokeWidth;b===0&&a instanceof Qr&&a.type===wn.Link&&a.adornedObject instanceof cr&&(b=a.adornedObject.strokeWidth),b*=E.Ca,a instanceof Nn&&a.ua!==null?(a=a.geometry.bounds,E.Ge(a.x-b/2,a.y-b/2,a.width+b,a.height+b)):a instanceof Qr&&a.adornedPart.ua!==null?(a=a.adornedPart.ua.bounds,E.Ge(a.x-b/2,a.y-b/2,a.width+b,a.height+b)):E.Ge(-(b/2),-(b/2),y+b,x+b),b=E.desiredSize,b.w()||E.ua===null?E.dc.h(0,0,b.width,b.height):E.dc.assign(E.ua.bounds),ya(E,!1)}}function Jg(){this.xa="Base"}Se(Jg,Ea),Jg.prototype.measure=function(a,y,x,E,b,z,tt){var rt=a.Pb();a.graduatedBounds=[];var ot=rt.margin,lt=ot.right+ot.left,ut=ot.top+ot.bottom;rt.measure(y,x,z,tt);var ft=rt.measuredBounds,yt=new Be(-ot.left,-ot.top,Math.max(ft.width+lt,0),Math.max(ft.height+ut,0));a.graduatedBounds.push(yt),b.assign(yt);for(var xt=rt.geometry,Ct=rt.strokeWidth,bt=xt.flattenedSegments,Vt=xt.flattenedLengths,zt=xt.flattenedTotalLength,Qt=bt.length,ee=0,oe=0,ce=Yn(),Me=0;Me<Qt;Me++){var Wn=bt[Me],di=[];oe=ee=0;for(var oi=Wn.length,kn=0;kn<oi;kn+=2){var en=Wn[kn],qi=Wn[kn+1];if(kn!==0){var Yi=180*Math.atan2(qi-oe,en-ee)/Math.PI;0>Yi&&(Yi+=360),di.push(Yi)}ee=en,oe=qi}ce.push(di)}if(a.graduatedIntervals===null){for(var oo=[],ko=a.O.s,ka=ko.length,Ia=0;Ia<ka;Ia++){var cs=ko[Ia],ba=[];if(oo.push(ba),cs.visible){var Hh=cs.interval;if(!(0>Hh)){for(var da=0;da<ka;da++)if(da!==Ia){var xu=ko[da];if(xu.visible&&cs.constructor===xu.constructor){var fs=xu.interval;fs>Hh&&ba.push(fs)}}}}}a.graduatedIntervals=oo}var Wh=a.graduatedIntervals,yl=a.O.s,Wl=yl.length,il=0,Ks=0,Ld=zt;a.graduatedMarks=[];for(var Pu,rg=0;rg<Wl;rg++){var rl=yl[rg];if(Pu=[],rl.visible&&rl!==rt){var gs=Math.abs(rl.interval),Op=a.graduatedTickUnit;if(!(2>Op*gs*zt/a.graduatedRange&&rl.graduatedSkip===null)){var Xc=Vt[0][0],Du=0,Us=0;Ks=zt*rl.graduatedStart-1e-4,Ld=zt*rl.graduatedEnd+1e-4;var ac=Op*gs,ol=a.graduatedTickBase;if(ol<a.graduatedMin){var Fd=(a.graduatedMin-ol)/ac;Fd=Fd%1===0?Fd:Math.floor(Fd+1),ol+=Fd*ac}else ol>a.graduatedMin+ac&&(ol-=Math.floor((ol-a.graduatedMin)/ac)*ac);for(var G0=Wh[rg],Ip=ol,zy=1e-6*a.graduatedMax,eh=1;ol<=a.graduatedMax+zy;eh++){t:{for(var ph=G0.length,Jc=0;Jc<ph;Jc++){var Md=(ol-a.graduatedTickBase)%(G0[Jc]*a.graduatedTickUnit),og=1e-6*a.graduatedTickUnit;if(Md<og&&Md>-og){var kd=!1;break t}}kd=!0}if(kd&&(ol>a.graduatedMax&&(ol=a.graduatedMax),rl.graduatedSkip===null||rl instanceof Ao&&!rl.graduatedSkip(ol,rl)||rl instanceof cr&&!rl.graduatedSkip(ol,rl))&&(il=(ol-a.graduatedMin)*zt/a.graduatedRange,il>zt&&(il=zt),Ks<=il&&il<=Ld)){for(var nh=ce[Du][Us],Vh=Vt[Du][Us];Du<Vt.length;){for(;il>Xc&&Us<Vt[Du].length-1;)Us++,nh=ce[Du][Us],Vh=Vt[Du][Us],Xc+=Vh;if(il<=Xc)break;Du++,Us=0,nh=ce[Du][Us],Vh=Vt[Du][Us],Xc+=Vh}var Ys=bt[Du],Ou=Ys[2*Us],H0=Ys[2*Us+1],mh=(il-(Xc-Vh))/Vh,ag=new At(Ou+(Ys[2*Us+2]-Ou)*mh+Ct/2-xt.bounds.x,H0+(Ys[2*Us+3]-H0)*mh+Ct/2-xt.bounds.y);ag.scale(rt.scale,rt.scale);t:{var wu=nh,sc=ce[Du];if(!(.5005>mh&&.4995<mh)){var Iu=wu;if(.5>mh?0<Us?Iu=sc[Us-1]:_t.$(Ys[0],Ys[Ys.length-2])&&_t.$(Ys[1],Ys[Ys.length-1])&&(Iu=sc[sc.length-1]):.5<mh&&(Us+1<sc.length?Iu=sc[Us+1]:_t.$(Ys[0],Ys[Ys.length-2])&&_t.$(Ys[1],Ys[Ys.length-1])&&(Iu=sc[0])),wu!==Iu){var Qc=Math.abs(wu-Iu);if(180<Qc&&(wu<Iu?wu+=360:Iu+=360,Qc=Math.abs(wu-Iu)),5e-4>mh||.9995<mh){nh=(wu+Iu)/2%360;break t}if(10>Qc){var sg=1-Math.abs(.5-mh);nh=(wu*sg+Iu*(1-sg))%360;break t}}}nh=wu}if(rl instanceof Ao){var lu="";rl.graduatedFunction!==null?(lu=rl.graduatedFunction(ol,rl),lu=lu!=null?lu.toString():""):lu=(+ol.toFixed(2)).toString(),lu!==""&&Pu.push({$l:ag,angle:nh,text:lu})}else Pu.push({$l:ag,angle:nh})}ol=Ip+eh*ac}}}a.graduatedMarks.push(Pu)}si(ce);var Ua=a.graduatedMarks;if(Ua!==null)for(var _p=E.length,Ns=0;Ns<_p;Ns++){var ca=E[Ns],Bs=Ua[Ns];if(ca.visible&&ca!==rt&&Bs.length!==0){if(ca instanceof cr){var vh=a,Kh=b,lc=ca.alignmentFocus;lc.Mc()&&(lc=to);var Zy=ca.angle;ca.Kb=0,ca.measure(1/0,1/0,0,0),ca.Kb=Zy;var W0=ca.measuredBounds,lg=W0.width,uc=W0.height,$c=Be.allocAt(0,0,lg,uc),Xs=At.alloc();Xs.xi($c,lc),Be.free($c);for(var yh=-Xs.x,Cu=-Xs.y,Bl=new Be,bd=Bs.length,ug=0;ug<bd;ug++)for(var Nd=Bs[ug],V0=Nd.$l.x,hg=Nd.$l.y,ra=Nd.angle,uu=0;4>uu;uu++){switch(uu){case 0:Xs.h(yh,Cu);break;case 1:Xs.h(yh+lg,Cu);break;case 2:Xs.h(yh,Cu+uc);break;case 3:Xs.h(yh+lg,Cu+uc)}Xs.rotate(ra+ca.angle),Xs.offset(V0,hg),ug===0&&uu===0?Bl.h(Xs.x,Xs.y,0,0):Bl.Ye(Xs),Xs.offset(-V0,-hg),Xs.rotate(-ra-ca.angle)}At.free(Xs),vh.graduatedBounds!==null&&vh.graduatedBounds.push(Bl),Rr(Kh,Bl.x,Bl.y,Bl.width,Bl.height)}else if(ca instanceof Ao){var Vl=a,K0=b;Vl.temporaryTextBlock===null&&(Vl.temporaryTextBlock=new Ao);var al=Vl.temporaryTextBlock;y1(al,ca);var Uh=ca.alignmentFocus;Uh.Mc()&&(Uh=to);for(var Kl=ca.segmentOrientation,dg=ca.segmentOffset,Bd=new Be,Rp=0,cg=0,_u=0,hc=0,Ad=0,fg=Bs.length,Yh=0;Yh<fg;Yh++){var ih=Bs[Yh];Rp=ih.$l.x,cg=ih.$l.y,_u=ih.angle,Ad=hc=ca.angle,Kl!==Ls&&(Ad=Kl===sp||Kl===qm?_u+ca.angle:_u,hc=Nn.computeAngle(Kl,Ad)),al.Kb=hc,al.text=ih.text||"",al.measure(1/0,1/0,0,0);var Xh=al.measuredBounds,Sh=al.naturalBounds,Jh=Sh.width,dc=Sh.height,Eu=ae.alloc();Eu.reset(),Eu.translate(-Xh.x,-Xh.y),Eu.scale(al.scale,al.scale),Eu.rotate(Ad,Jh/2,dc/2),Kl!==lp&&Kl!==hp||Eu.rotate(90,Jh/2,dc/2),Kl!==up&&Kl!==dp||Eu.rotate(-90,Jh/2,dc/2),Kl===t0&&(45<_u&&135>_u||225<_u&&315>_u)&&Eu.rotate(-_u,Jh/2,dc/2);var qc=Be.allocAt(0,0,Jh,dc),Qh=At.alloc();Qh.xi(qc,Uh),Eu.Ga(Qh);var tf=-Qh.x,Gy=-Qh.y,xh=At.alloc();xh.assign(dg),isNaN(xh.x)&&(xh.x=Jh/2+3),isNaN(xh.y)&&(xh.y=-(dc/2+3)),xh.rotate(_u),Rp+=xh.x+tf,cg+=xh.y+Gy;var cc=new Be(Rp,cg,Xh.width,Xh.height),jp=new Be(Xh.x,Xh.y,Xh.width,Xh.height),Hy=new Be(Sh.x,Sh.y,Sh.width,Sh.height);ih.Sz=hc,ih.lineCount=al.lineCount,ih.lines=[al.Cb,al.Ih,al.df,al.Le,al.Qc,al.Qb,al.ze],ih.actualBounds=cc,ih.measuredBounds=jp,ih.naturalBounds=Hy,Yh===0?Bd.assign(cc):Bd.ed(cc),At.free(xh),At.free(Qh),Be.free(qc),ae.free(Eu)}Vl.graduatedBounds!==null&&Vl.graduatedBounds.push(Bd),Rr(K0,Bd.x,Bd.y,Bd.width,Bd.height)}ya(ca,!1)}}},Jg.prototype.arrange=function(a,y,x){if(a.graduatedBounds!==null){var E=a.Pb(),b=a.graduatedMarks;if(b!==null){var z=a.graduatedBounds,tt=0,rt=z[tt];tt++,E!==null&&E.arrange(rt.x-x.x,rt.y-x.y,rt.width,rt.height);for(var ot=y.length,lt=0;lt<ot;lt++){var ut=y[lt];rt=b[lt],ut.visible&&ut!==E&&rt.length!==0&&(rt=z[tt],tt++,ut.arrange(rt.x-x.x,rt.y-x.y,rt.width,rt.height))}a.graduatedBounds=null}}},Jg.prototype.gc=function(a,y,x){var E=x.$i;x.$i=!0;var b=a.naturalBounds,z=b.width,tt=b.height;b=y instanceof tl,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,lt=a.graduatedMarks,ut=ot.length,ft=0;ft<ut;ft++){var yt=ot[ft],xt=lt[ft],Ct=xt.length;if(yt.visible&&yt!==z&&xt.length!==0){if(yt instanceof cr){if(!(2>a.graduatedTickUnit*yt.interval*z.geometry.flattenedTotalLength/a.graduatedRange*tt&&yt.graduatedSkip===null)){var bt=yt.measuredBounds,Vt=yt.strokeWidth*yt.scale,zt=yt.alignmentFocus;zt.Mc()&&(zt=to);for(var Qt=0;Qt<Ct;Qt++){var ee=xt[Qt].$l,oe=xt[Qt].angle,ce=zt,Me=yt.Ab;Me.reset(),Me.translate(ee.x+rt.x,ee.y+rt.y),Me.rotate(oe+yt.angle,0,0),Me.translate(-bt.width*ce.x+ce.offsetX+Vt/2,-bt.height*ce.y+ce.offsetY+Vt/2),Me.scale(yt.scale,yt.scale),jl(yt,!1),yt.wh.set(yt.Ab),yt.Kk=yt.scale,El(yt,!1),yt.gc(y,x),b&&(a.svg.appendChild(yt.svg),yt.svg=null),yt.Ab.reset()}}}else if(yt instanceof Ao)for(a.temporaryTextBlock===null&&(a.temporaryTextBlock=new Ao),bt=a.temporaryTextBlock,y1(bt,yt),Vt=0;Vt<Ct;Vt++)zt=xt[Vt],zt.actualBounds&&zt.measuredBounds&&zt.naturalBounds&&(bt.ec=zt.text||"",bt.Kb=zt.Sz||0,bt.Gc=zt.lineCount||0,Qt=zt.lines,Qt!==void 0&&(bt.Cb=Qt[0],bt.Ih=Qt[1],bt.df=Qt[2],bt.Le=Qt[3],bt.Qc=Qt[4],bt.Qb=Qt[5],bt.ze=Qt[6]),zt.naturalBounds&&(bt.dc=zt.naturalBounds),zt.actualBounds&&(Qt=zt.actualBounds,bt.arrange(Qt.x,Qt.y,Qt.width,Qt.height)),Qt=zt.actualBounds,bt.arrange(Qt.x,Qt.y,Qt.width,Qt.height),ee=zt.measuredBounds,zt=zt.naturalBounds,oe=bt.Ab,oe.reset(),oe.translate(Qt.x+rt.x,Qt.y+rt.y),oe.translate(-ee.x,-ee.y),bt.no(oe,zt.x,zt.y,zt.width,zt.height),jl(bt,!1),bt.wh.set(bt.Ab),bt.Kk=bt.scale,El(bt,!1),bt.Ng=yt.part,bt.Me=yt.panel,bt.gc(y,x),bt.Me=null,bt.Ng=null,b&&(a.svg.appendChild(bt.svg),bt.svg=null))}}x.$i=E,y.restore(),y.Vc(!0)};function wn(a,y){if(ge.call(this),this.na=null,a===void 0)this.na=wn.Position;else if(typeof a=="string"){var x=nu.I(a);x!==null&&(this.na=x)}else a instanceof Ea?this.na=a:a&&(this.na=wn.Position,y=a);this.na===null&&Gt("Panel type not specified or PanelLayout not loaded: "+a),this.l=this.l|4194304|(this.na===wn.Grid?1048576:0),this.O=new fn,this.yb=ga,this.Tm=wa,this.Uf=rr,this.$g=null,this.$e="",this.jg=new Be(NaN,NaN,NaN,NaN),this.T=this.F=null,this.xo=xi,this.jn=ao,this.kn=Zn,this.ub=this.ra=null,this.zn=NaN,this.ge=this.Hh=null,y&&Object.assign(this,y)}Se(wn,ge),wn.prototype.cloneProtected=function(a){ge.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},wn.prototype.Af=function(a){ge.prototype.Af.call(this,a),a.O=this.O;for(var y=a.O.s,x=y.length,E=0;E<x;E++)y[E].Me=a;a.$g=null},wn.prototype.copy=function(){var a=ge.prototype.copy.call(this);if(a!==null){for(var y=this.O.s,x=y.length,E=0;E<x;E++){var b=y[E].copy();b.wi(a),b.Ng=null;var z=a.O,tt=z.count;if(z.Gb(tt,b),z=a.part,z!==null){z.Rh=null,b.portId!==null&&z instanceof $n&&(z.Te=!0);var rt=a.diagram;rt!==null&&rt.undoManager.isUndoingRedoing||z.cb(ro,"elements",a,null,b,null,tt)}}return a}return null},wt=wn.prototype,wt.toString=function(){return"Panel("+this.type.name+")#"+ji(this)},wt.Pn=function(a){ge.prototype.Pn.call(this,a);for(var y=this.O.s,x=y.length,E=0;E<x;E++)y[E].Pn(a)},wt.hh=function(a,y){if(this.na===wn.Grid)a.yc(),this.na.gc(this,a,y);else if(this.na===wn.Graduated)a.yc(),this.na.gc(this,a,y);else{if(this.na===wn.Table)if(a.yc(),a instanceof tl){var x=a.yd;a.yd=dm(a,"gojs-ts"),gv(this,a),a.nh.pop(),a.yd=x}else gv(this,a);(x=this.isClipping&&this.na===wn.Spot)&&a.save();for(var E=this.Pb(),b=this.O.s,z=b.length,tt=0;tt<z;tt++){var rt=b[tt];x&&rt===E&&(a.clipInsteadOfFill=!0),rt.gc(a,y),x&&rt===E&&(a.clipInsteadOfFill=!1)}x&&(a.restore(),a.Vc(!0))}};function gv(a,y){y.lineCap="butt";var x=0<a.rowCount?a.rowDefs:null,E=0<a.columnCount?a.colDefs:null;x!==null&&Lm(a,y,!0,x,!0),E!==null&&Lm(a,y,!1,E,!0),x!==null&&r1(a,y,!0,x),E!==null&&r1(a,y,!1,E),x!==null&&Lm(a,y,!0,x,!1),E!==null&&Lm(a,y,!1,E,!1)}function r1(a,y,x,E){for(var b=E.length,z=a.actualBounds,tt=a.naturalBounds,rt=!0,ot=0;ot<b;ot++){var lt=E[ot];if(lt!==void 0&<.actual!==0)if(rt)rt=!1;else{if(x){if(lt.position>tt.height)continue}else if(lt.position>tt.width)continue;var ut=lt.separatorStrokeWidth;isNaN(ut)&&(ut=x?a.defaultRowSeparatorStrokeWidth:a.defaultColumnSeparatorStrokeWidth);var ft=lt.separatorStroke;if(ft===null&&(ft=x?a.defaultRowSeparatorStroke:a.defaultColumnSeparatorStroke),ut!==0&&ft!==null){na(a,y,ft,!1,!1,tt,z),ft=!1;var yt=lt.separatorDashArray;yt===null&&(yt=x?a.defaultRowSeparatorDashArray:a.defaultColumnSeparatorDashArray),yt!==null&&(ft=!0,y.js(yt,0)),y.beginPath(),yt=lt.position+ut,x?yt>tt.height&&(ut-=yt-tt.height):yt>tt.width&&(ut-=yt-tt.width),lt=lt.position+ut/2,y.lineWidth=ut,ut=a.yb,x?(lt+=ut.top,yt=tt.width-ut.right,y.moveTo(ut.left,lt),y.lineTo(yt,lt)):(lt+=ut.left,yt=tt.height-ut.bottom,y.moveTo(lt,ut.top),y.lineTo(lt,yt)),y.stroke(),y.Se(),ft&&y.fs()}}}}function Lm(a,y,x,E,b){for(var z=E.length,tt=a.actualBounds,rt=a.naturalBounds,ot=o1(a,!0),lt=o1(a,!1),ut=0;ut<z;ut++){var ft=E[ut];if(ft!==void 0&&ft.background!==null&&ft.coversSeparators!==b&&ft.actual!==0){var yt=x?tt.height:tt.width;if(!(ft.position>yt)){var xt=ft.Wc(),Ct=ft.separatorStrokeWidth;isNaN(Ct)&&(Ct=x?a.defaultRowSeparatorStrokeWidth:a.defaultColumnSeparatorStrokeWidth);var bt=ft.separatorStroke;bt===null&&(bt=x?a.defaultRowSeparatorStroke:a.defaultColumnSeparatorStroke),(bt===null||ft.index===(x?ot:lt))&&(Ct=0),xt-=Ct,Ct=ft.position+Ct,xt+=ft.actual,Ct+xt>yt&&(xt=yt-Ct),0>=xt||(yt=a.yb,na(a,y,ft.background,!0,!1,rt,tt),x?y.fillRect(yt.left,Ct+yt.top,tt.width-(yt.left+yt.right),xt):y.fillRect(Ct+yt.left,yt.top,xt,tt.height-(yt.top+yt.bottom)))}}}}function o1(a,y){for(var x=y?a.rowCount:a.columnCount,E=0;E<x;E++){var b=y?a.rowDefs[E]:a.colDefs[E];if(b!==void 0)return b.index}return 0}function pv(a){return a==="LineV"||a==="BarV"}wt.lv=function(){for(var a=this.O.s,y=a.length,x=0;x<y;x++)a[x].lv();this.Uc=!0},wt.kk=function(a,y,x){if(!ge.prototype.kk.call(this,a,y,x))return!1;if(this.type===wn.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===wn.Grid||this.na===wn.Graduated)return this.svg.innerHTML="",this.svg.remove(),!1;x=this.O.s;for(var E=x.length,b=0;b<E;b++)x[b].gc(a,y);return!0},wt.nk=function(){return!0},wt.$o=function(a,y,x,E){if(!this.isClipping)if(this.Dd()&&a.bk!==null){a=a.bk,y=this.O.s;for(var b=0,z=0,tt=0;tt<y.length;tt++)if(y[tt].Ed()){var rt=y[tt].actualBounds;b=tt===0?rt.x:Math.min(rt.x,b),z=tt===0?rt.y:Math.min(rt.y,z)}E.setAttributeNS(null,"clip-path","path('M "+(a.x-x.x-b)+","+(a.y-x.y-z)+" l "+a.width+" 0 l 0 "+a.height+" l -"+a.width+" 0 z')")}else ge.prototype.$o.call(this,a,y,x,E)},wt.Sj=function(a,y,x,E,b){var z=this.se(),tt=this.transform,rt=1/(tt.m11*tt.m22-tt.m12*tt.m21),ot=tt.m22*rt,lt=-tt.m12*rt,ut=-tt.m21*rt,ft=tt.m11*rt,yt=rt*(tt.m21*tt.dy-tt.m22*tt.dx),xt=rt*(tt.m12*tt.dx-tt.m11*tt.dy);if(this.areaBackground!==null)return tt=this.actualBounds,_t.Ff(tt.left,tt.top,tt.right,tt.bottom,a,y,x,E,b);if(this.background!==null)return z=a*ot+y*ut+yt,rt=a*lt+y*ft+xt,a=x*ot+E*ut+yt,ot=x*lt+E*ft+xt,b.h(0,0),x=this.naturalBounds,z=_t.Ff(0,0,x.width,x.height,z,rt,a,ot,b),b.transform(tt),z;z||(ot=1,ut=lt=0,ft=1,xt=yt=0),rt=a*ot+y*ut+yt,a=a*lt+y*ft+xt,ot=x*ot+E*ut+yt,x=x*lt+E*ft+xt,b.h(ot,x),E=(ot-rt)*(ot-rt)+(x-a)*(x-a),lt=!1,ft=this.O.s,xt=ft.length,ut=At.alloc(),yt=null,y=1/0;var Ct=null,bt=this.isClipping&&this.na===wn.Spot;bt&&(Ct=At.alloc(),yt=this.Pb(),(lt=yt.Sj(rt,a,ot,x,Ct))&&(y=(rt-Ct.x)*(rt-Ct.x)+(a-Ct.y)*(a-Ct.y)));for(var Vt=0;Vt<xt;Vt++){var zt=ft[Vt];zt.visible&&zt!==yt&&zt.Sj(rt,a,ot,x,ut)&&(lt=!0,zt=(rt-ut.x)*(rt-ut.x)+(a-ut.y)*(a-ut.y),zt<E&&(E=zt,b.set(ut)))}return bt&&(y>E&&b.set(Ct),At.free(Ct)),At.free(ut),z&&b.transform(tt),lt},wt.Gj=function(){for(var a=this.O.s,y=a.length,x=0;x<y;x++)a[x].Gj();ge.prototype.Gj.call(this)},wt.v=function(a){if(!gl(this)){ge.prototype.v.call(this,a),a=null,(this.na===wn.Auto||this.na===wn.Link)&&(a=this.Pb());for(var y=this.O.s,x=y.length,E=0;E<x;E++){var b=y[E];if((b===a||b.isPanelMain)&&b.v(!0),!b.desiredSize.w()){var z=Os(b,!1);(b instanceof Es||b instanceof wn||b instanceof Ao||z!==hn)&&b.v(!0)}}}},wt.Uj=function(){if(!gl(this)){ya(this,!0),Wu(this,!0);for(var a=this.O.s,y=a.length,x=0;x<y;x++)a[x].Uj()}},wt.Uk=function(){if(!(this.l&2048)){jl(this,!0),El(this,!0);for(var a=this.O.s,y=a.length,x=0;x<y;x++)a[x].Wu()}},wt.Wu=function(){El(this,!0);for(var a=this.O.s,y=a.length,x=0;x<y;x++)a[x].Wu()},wt.Wl=function(a,y,x,E){var b=this.jg;b.h(0,0,0,0);var z=this.desiredSize,tt=this.minSize;x===void 0&&(x=tt.width,E=tt.height),x=Math.max(x,tt.width),E=Math.max(E,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(E,y);var ot=this.yb;a=Math.max(a-ot.left-ot.right,0),y=Math.max(y-ot.top-ot.bottom,0);var lt=this.O.s;lt.length!==0&&this.na.measure(this,a,y,lt,b,x,E),a=b.width+ot.left+ot.right,ot=b.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(E,ot),so(b,a,ot),so(this.naturalBounds,a,ot),this.Ge(0,0,a,ot)},wt.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 E=a[x];if(E.isPanelMain===!0)return this.$g=E}this.$g=a[0]}return this.$g};function ch(a){return a.part!==null?a.part.locationObject:null}wt.eh=function(a,y,x,E){var b=this.O.s;if(this.actualBounds.h(a,y,x,E),b.length!==0){if(!this.desiredSize.w()){a=Os(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===E&&(a=hn),a){case hn:(y>x||z>E)&&(this.v(),this.measure(y>x?x:y,z>E?E:z,0,0));break;case Sn:this.v(!0),this.measure(x+rt,E+tt,0,0);break;case Fi:this.v(!0),this.measure(x+rt,z+tt,0,0);break;case Ri:this.v(!0),this.measure(y+rt,E+tt,0,0)}}this.na.arrange(this,b,this.jg)}},wt.gh=function(a){var y=this.naturalBounds,x=ch(this);if(jr(0,0,y.width,y.height,a.x,a.y)){y=this.O.s;for(var E=y.length,b=At.allocAt(0,0);E--;){var z=y[E];if((z.visible||z===x)&&(Dn(b.set(a),z.transform),z.ca(b)))return At.free(b),!0}return At.free(b),!(this.Ma===null&&this.areaBackground===null)}return!1},wt.ks=function(a){if(this.bindingId===a)return this;for(var y=this.O.s,x=y.length,E=0;E<x;E++){var b=y[E].ks(a);if(b!==null)return b}return null},wt.qm=function(a,y){if(y(this,a),a instanceof wn){a=a.O.s;for(var x=a.length,E=0;E<x;E++)this.qm(a[E],y)}};function $d(a,y){a1(a,a,y)}function a1(a,y,x){x(y),y=y.O.s;for(var E=y.length,b=0;b<E;b++){var z=y[b];z instanceof wn&&a1(a,z,x)}}function vx(a,y){s1(a,a,y)}function s1(a,y,x){if(x(y),y instanceof wn){y=y.O.s;for(var E=y.length,b=0;b<E;b++)s1(a,y[b],x)}}wt.Nl=function(a){return l1(this,this,a)};function l1(a,y,x){if(x(y))return y;if(y instanceof wn){y=y.O.s;for(var E=y.length,b=0;b<E;b++){var z=l1(a,y[b],x);if(z!==null)return z}}return null}wt.fb=function(a){if(this.name===a)return this;var y=this.O.s,x=y.length;this.Hh===null&&this.itemTemplateMap===null||(x=Qg(this));for(var E=0;E<x;E++){var b=y[E];if(b instanceof wn){var z=b.fb(a);if(z!==null)return z}if(b.name===a)return b}return null};function u1(a){a=a.O.s;for(var y=a.length,x=0,E=0;E<y;E++){var b=a[E];b instanceof wn?x=Math.max(x,u1(b)):b instanceof cr&&(x=Math.max(x,b.ig/2*b.strokeMiterLimit*b.Df()))}return x}wt.se=function(){return!(this.type===wn.TableRow||this.type===wn.TableColumn)};function Th(a){return a.type===wn.TableRow||a.type===wn.TableColumn}wt.ic=function(a,y,x){if(this.pickable===!1||(y===void 0&&(y=null),x===void 0&&(x=null),ws(this)))return null;var E=this.naturalBounds,b=1/this.Df(),z=this.se(),tt=z?a:Dn(At.allocAt(a.x,a.y),this.transform),rt=this.diagram,ot=10,lt=5;if(rt!==null&&(ot=rt.Ql("extraTouchArea"),lt=ot/2),jr(-(lt*b),-(lt*b),E.width+ot*b,E.height+ot*b,tt.x,tt.y)){if(!this.isAtomic){b=this.O.s;var ut=b.length;if(rt=At.alloc(),lt=(ot=this.isClipping&&this.na===wn.Spot)?this.Pb():null,ot&&(lt.se()?Dn(rt.set(a),lt.transform):rt.set(a),!lt.ca(rt)))return At.free(rt),z||At.free(tt),null;for(var ft=ch(this);ut--;){var yt=b[ut];if((yt.visible||yt===ft)&&(yt.se()?Dn(rt.set(a),yt.transform):rt.set(a),!ot||yt!==lt)){var xt=null;if(yt instanceof wn?xt=yt.ic(rt,y,x):yt.pickable===!0&&yt.ca(rt)&&(xt=yt),xt!==null&&(y!==null&&(xt=y(xt)),xt!==null&&(x===null||x(xt))))return At.free(rt),z||At.free(tt),xt}}At.free(rt)}return this.background===null&&this.areaBackground===null?(z||At.free(tt),null):(a=jr(0,0,E.width,E.height,tt.x,tt.y)?this:null,z||At.free(tt),a)}return z||At.free(tt),null},wt.ji=function(a,y,x,E){if(this.pickable===!1)return!1;y===void 0&&(y=null),x===void 0&&(x=null);var b=this.naturalBounds,z=this.se(),tt=z?a:Dn(At.allocAt(a.x,a.y),this.transform);if(b=jr(0,0,b.width,b.height,tt.x,tt.y),Th(this)||b){if(!this.isAtomic){for(var rt=this.O.s,ot=rt.length,lt=At.alloc(),ut=ch(this);ot--;){var ft=rt[ot];if(ft.visible||ft===ut){ft.se()?Dn(lt.set(a),ft.transform):lt.set(a);var yt=ft;ft=ft instanceof wn?ft:null,(ft!==null?ft.ji(lt,y,x,E):yt.ca(lt))&&yt.pickable!==!1&&(y!==null&&(yt=y(yt)),yt===null||x!==null&&!x(yt)||E.add(yt))}}At.free(lt)}return z||At.free(tt),b&&(this.background!==null||this.areaBackground!==null)}return z||At.free(tt),!1},wt.Cf=function(a,y,x,E,b,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=ae.alloc(),tt.reset()),tt.multiply(this.transform),this.fh(a,tt))return mv(this,y,x,b),z===void 0&&ae.free(tt),!0;if(this.Yc(a,tt)){if(!this.isAtomic)for(var rt=ch(this),ot=this.O.s,lt=ot.length;lt--;){var ut=ot[lt];if(ut.visible||ut===rt){var ft=ut.actualBounds,yt=this.naturalBounds;ft.x>yt.width||ft.y>yt.height||0>ft.x+ft.width||0>ft.y+ft.height||(ft=ut,ut=ut instanceof wn?ut:null,yt=ae.alloc(),yt.set(tt),(ut!==null?ut.Cf(a,y,x,E,b,yt):Ma(ft,a,E,yt))&&(y!==null&&(ft=y(ft)),ft===null||x!==null&&!x(ft)||b.add(ft)),ae.free(yt))}}return z===void 0&&ae.free(tt),E}return z===void 0&&ae.free(tt),!1};function mv(a,y,x,E){for(var b=a.O.s,z=b.length;z--;){var tt=b[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 wn&&mv(tt,y,x,E),y!==null&&(tt=y(tt)),tt===null||x!==null&&!x(tt)||E.add(tt))}}}wt.og=function(a,y,x,E,b,z){if(this.pickable===!1)return!1;x===void 0&&(x=null),E===void 0&&(E=null);var tt=this.naturalBounds,rt=this.se(),ot=rt?a:Dn(At.allocAt(a.x,a.y),this.transform),lt=rt?y:Dn(At.allocAt(y.x,y.y),this.transform),ut=ot.Bf(lt),ft=0<ot.x&&ot.x<tt.width&&0<ot.y&&ot.y<tt.height||Xn(ot.x,ot.y,0,0,0,tt.height)<=ut||Xn(ot.x,ot.y,0,tt.height,tt.width,tt.height)<=ut||Xn(ot.x,ot.y,tt.width,tt.height,tt.width,0)<=ut||Xn(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||(At.free(ot),At.free(lt)),ft){if(!this.isAtomic){ot=At.alloc(),lt=At.alloc(),ut=ch(this);for(var yt=this.O.s,xt=yt.length;xt--;){var Ct=yt[xt];if(Ct.visible||Ct===ut){var bt=Ct.actualBounds,Vt=this.naturalBounds;(!rt||!(bt.x>Vt.width||bt.y>Vt.height||0>bt.x+bt.width||0>bt.y+bt.height))&&(Ct.se()?(bt=Ct.transform,Dn(ot.set(a),bt),Dn(lt.set(y),bt)):(ot.set(a),lt.set(y)),bt=Ct,Ct=Ct instanceof wn?Ct:null,(Ct!==null?Ct.og(ot,lt,x,E,b,z):bt.tx(ot,lt,b))&&(x!==null&&(bt=x(bt)),bt===null||E!==null&&!E(bt)||z.add(bt)))}}At.free(ot),At.free(lt)}return b?ft:tt}return!1};function vv(a){var y=null;return a instanceof cr&&(y=a.spot1,y===wa&&(y=null),a=a.geometry,a!==null&&y===null&&(y=a.spot1)),y===null&&(y=_r),y}function yv(a){var y=null;return a instanceof cr&&(y=a.spot2,y===wa&&(y=null),a=a.geometry,a!==null&&y===null&&(y=a.spot2)),y===null&&(y=lo),y}wt.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},wt.M=function(a){return this.O.M(a)},wt.Gb=function(a,y){y instanceof Bi&&Gt("Cannot add a Part to a Panel: "+y+"; use a Panel instead"),(this===y||this.rg(y))&&(this===y&&Gt("Cannot make a Panel contain itself: "+this.toString()),Gt("Cannot make a Panel indirectly contain itself: "+this.toString()+" already contains "+y.toString()));var x=y.panel;if(x!==null&&x!==this&&Gt("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!==wn.Grid||y instanceof cr||Gt("Can only add Shapes to a Grid Panel, not: "+y),this.na!==wn.Graduated||y instanceof cr||y instanceof Ao||Gt("Can only add Shapes or TextBlocks to a Graduated Panel, not: "+y),y.wi(this),y.Ng=null,this.itemArray!==null){var E=y.data;E!==null&&typeof E=="object"&&(this.ge===null&&(this.ge=new be),this.ge.add(E,y))}var b=this.O;if(E=-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>=b.count&&a>=b.count)return;b.mb(z),E=z}else Gt("element "+y.toString()+" has panel "+x.toString()+" but is not contained by it.")}(0>a||a>b.count)&&(a=b.count),b.Gb(a,y),(a===0||y.isPanelMain)&&(this.$g=null),gl(this)||this.v(),y.v(!1),y.portId!==null?this.Te=!0:y instanceof wn&&y.Te===!0&&(this.Te=!0),this.graduatedIntervals=null,this.If()||Mm(this,y,!1),x=this.part,x!==null&&(x.Rh=null,x.ag=NaN,this.Te&&x instanceof $n&&(x.Te=!0),x.Te&&x instanceof $n&&(x.wc=null),b=this.diagram,b!==null&&b.undoManager.isUndoingRedoing||(E!==-1&&x.cb(So,"elements",this,y,null,E,null),x.cb(ro,"elements",this,null,y,null,a)))};function Sv(a,y){a.l=y?a.l|16777216:a.l&-16777217}wt.remove=function(a){for(var y=this.O.s,x=y.length,E=-1,b=0;b<x;b++)if(y[b]===a){E=b;break}E!==-1&&this.pc(E,!0)},wt.mb=function(a){0<=a&&this.pc(a,!0)},wt.pc=function(a,y){var x=this.O,E=x.M(a);if(E.Ng=null,E.wi(null),this.ge!==null){var b=E.data;typeof b=="object"&&this.ge.remove(b)}x.mb(a),ya(this,!1),this.v(),this.$g===E&&(this.$g=null),this.graduatedIntervals=null;var z=this.part;z!==null&&(z.Rh=null,z.ag=NaN,z.Wb(),z instanceof $n&&(E instanceof wn?E.qm(E,function(tt,rt){Gv(z,rt,y)}):Gv(z,E,y)),x=this.diagram,x!==null&&x.undoManager.isUndoingRedoing||z.cb(So,"elements",this,E,null,a,null))},wt.Fb=function(a){0>a&&un(a,">= 0",wn,"getRowDefinition:idx"),a=Math.round(a);var y=this.rowDefs;if(y[a]===void 0){var x=new Sa;x.wi(this),x.isRow=!0,x.index=a,y[a]=x,this.cb(ro,"rowdefs",this,null,x,null,a)}return y[a]},wt.oA=function(a){if(0>a&&un(a,">= 0",wn,"removeRowDefinition:idx"),this.rowCount!==0){a=Math.round(a);var y=this.rowDefs,x=y[a];if(x){y[a]=void 0;for(var E=y.length-1;0<=E&&y[E--]===void 0;)y.length--;this.cb(So,"rowdefs",this,x,null,a,null),this.v()}}};function h1(a,y,x){var E=a.rowDefs;if(!(0>y)){if(E[y]=x instanceof Sa?x:void 0,!x)for(y=E.length-1;0<=y&&E[y--]===void 0;)E.length--;a.v()}}wt.Eb=function(a){0>a&&un(a,">= 0",wn,"getColumnDefinition:idx"),a=Math.round(a);var y=this.colDefs;if(y[a]===void 0){var x=new Sa;x.wi(this),x.isRow=!1,x.index=a,y[a]=x,this.cb(ro,"coldefs",this,null,x,null,a)}return y[a]},wt.jA=function(a){if(0>a&&un(a,">= 0",wn,"removeColumnDefinition:idx"),this.columnCount!==0){a=Math.round(a);var y=this.colDefs,x=y[a];if(x){y[a]=void 0;for(var E=y.length-1;0<=E&&y[E--]===void 0;)y.length--;this.cb(So,"coldefs",this,x,null,a,null),this.v()}}};function d1(a,y,x){var E=a.colDefs;if(!(0>y)){if(E[y]=x instanceof Sa?x:void 0,!x)for(y=E.length-1;0<=y&&E[y--]===void 0;)E.length--;a.v()}}wt.Gy=function(a){var y=null;return a.isRow?y=this.Fb(a.index):a.isRow||(y=this.Eb(a.index)),y&&km(y,a),this},wt.Hy=function(a,y){return(a=this.Fb(a))&&km(a,new Sa(y)),this},wt.By=function(a,y){return(a=this.Eb(a))&&km(a,new Sa(y)),this},wt.nz=function(a){if(0>a||this.type!==wn.Table||this.rowCount===0)return-1;for(var y=0,x=this.rowDefs,E=x.length,b=this.topIndex;b<E;b++){var z=x[b];if(z!==void 0&&(y+=z.total,a<y))break}return b},wt.fz=function(a){if(0>a||this.type!==wn.Table||this.columnCount===0)return-1;for(var y=0,x=this.colDefs,E=x.length,b=this.leftIndex;b<E;b++){var z=x[b];if(z!==void 0&&(y+=z.total,a<y))break}return b},wt.Fz=function(a,y){if(y===void 0&&(y=new At(NaN,NaN)),this.type!==wn.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)},wt.Gz=function(a){if(this.type!==wn.Graduated)return NaN;var y=this.Pb();return y.transform.Cd(a),y.geometry.xx(a)*this.graduatedRange+this.graduatedMin};function c1(a){return a=a.allBindings,a!==null&&a._isFrozen}function Zl(a){var y=a.allBindings;if(y===null)a.data!==null&&Gt("Template cannot have .data be non-null: "+a),a.allBindings=y=new fn;else if(y._isFrozen)return;var x=new fn;Sv(a,!1),a.qm(a,function(lt,ut){ut.th();var ft=ut.localBindings;if(ft!==null)for(Dc(ut,!1),ft=ft.iterator;ft.next();){var yt=ft.value;yt.mode===Sp&&Dc(ut,!0);var xt=yt.sourceName;xt!==null&&(xt==="/"&&Sv(lt,!0),xt=FS(yt,lt,ut),xt!==null&&(x.add(xt),xt.srcBindings===null&&(xt.srcBindings=new fn),xt.srcBindings.add(yt))),y.add(yt)}if(ut instanceof wn&&ut.type===wn.Table){if(0<ut.rowCount){for(lt=ut.rowDefs,ft=lt.length,yt=0;yt<ft;yt++)if(xt=lt[yt],xt!==void 0&&xt.be!==null)for(var Ct=xt.be.iterator;Ct.next();){var bt=Ct.value;bt.xd=xt,bt.to=2,bt.wl=xt.index,y.add(bt)}}if(0<ut.columnCount){for(ut=ut.colDefs,lt=ut.length,ft=0;ft<lt;ft++)if(yt=ut[ft],yt!==void 0&&yt.be!==null)for(xt=yt.be.iterator;xt.next();)Ct=xt.value,Ct.xd=yt,Ct.to=1,Ct.wl=yt.index,y.add(Ct)}}});for(var E=x.iterator;E.next();){var b=E.value;if(b.srcBindings!==null){Dc(b,!0);for(var z=b.srcBindings.iterator;z.next();){var tt=z.value;b.localBindings===null&&(b.localBindings=new fn),b.localBindings.add(tt)}}b.srcBindings=null}for(E=y.iterator;E.next();)if(b=E.value,z=b.xd,z!==null){b.xd=null;var rt=b.targetProperty,ot=rt.indexOf(".");0<ot&&z instanceof wn&&(tt=rt.substring(0,ot),rt=rt.substr(ot+1),ot=z.fb(tt),ot!==null?(z=ot,b.targetProperty=rt):Mn('Warning: unable to find GraphObject named "'+tt+'" for Binding: '+b.toString())),z instanceof Sa?(tt=ji(z.panel),b.Ai=tt===void 0?-1:tt,z.panel.bindingId=b.Ai):z instanceof ge?(tt=ji(z),b.Ai=tt===void 0?-1:tt,z.bindingId=b.Ai):Gt("Unknown type of binding target: "+z)}y.freeze(),a instanceof Bi&&a.Zc()&&a.Va()}wt.Uy=function(a){a===void 0&&(a=!1);var y=this.copy();return vx(y,function(x){x instanceof wn&&(x.allBindings=null,x.ub=null);var E=x.localBindings;E!==null&&(x.localBindings=null,E.each(function(b){x.bind(b.copy())})),E=x.animationTriggers,E!==null&&(x.animationTriggers=null,E.each(function(b){x.Jv(b.value.copy())}))}),a&&Zl(y),y},wt.La=function(a){var y=this.allBindings;if(y!==null)for(a===void 0&&(a=""),y=y.iterator;y.next();){var x=y.value,E=x.sourceProperty;if((a===""||E===""||E===a)&&(E=x.targetProperty,x.converter!==null||E!=="")){E=this.data;var b=x.sourceName;if(b!==null){if(b==="")E=this;else if(b==="/")E=this;else if(b===".")E=this;else if(b==="..")E=this;else if(E=this.fb(b),E===null)continue}else if(x.isToModel)if(E=this.diagram,E!==null)E=E.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(b==="/"?E=z.part:b==="."?E=z:b===".."&&(E=z.panel),b=x.to,b!==0){if(!(z instanceof wn))continue;b===1?z=z.Eb(x.wl):b===2&&(z=z.Fb(x.wl))}z!==void 0&&x.Mv(z,E)}}},wt.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,E=y.length,b=0,z=null;b<x&&(z=a[b],!(z instanceof wn&&z.data!==null));)b++,z=a[b];if(x-b!==E)return!0;if(z===null)return 0<E;for(var tt=0;b<x&&tt<E;){if(z=a[b],!(z instanceof wn)||z.data!==y[tt])return!0;b++,tt++}return!1}function Qg(a){if(a.type===wn.Spot||a.type===wn.Auto)return Math.min(a.O.length,1);if(a.type===wn.Link){a=a.O;for(var y=a.length,x=0;x<y;x++){var E=a.M(x);if(!(E instanceof cr&&E.isPanelMain))break}return x}return a.type===wn.Table&&0<a.O.length&&(a=a.O.M(0),a.isPanelMain&&a instanceof wn&&Th(a))?1:0}wt.mv=function(){for(var a=Qg(this);this.O.length>a;)this.pc(this.O.length-1,!1);f1(this,this.itemArray)};function f1(a,y){var x=Qg(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 E=0;E<x;E++)Fm(a,y[E],E,!0)}else{E=x;for(var b=0;b<y.length;b++,E++){var z=y[b],tt=E<a.O.length?a.O.M(E):null;if(tt instanceof wn){if(tt.data!==z){var rt=Pv(a,tt.data),ot=Pv(a,z),lt=ot!==rt;lt||(rt=wv(a,rt),lt=wv(a,ot)!==rt),lt?(a.pc(E,!1),Fm(a,z,b,!1)):tt.data=z}}else Fm(a,z,b,!1)}for(;E<a.O.length;)a.pc(E,!1);a.$g=null,xv(a,x,0),gl(a)||a.v(),a.graduatedIntervals=null,a.If()||Mm(a,a,!1),y=a.part,y!==null&&(y.Rh=null,y.ag=NaN,a.Te&&y instanceof $n&&(y.Te=!0),y.Te&&y instanceof $n&&(y.wc=null))}}function Fm(a,y,x,E){if(!(y==null||0>x)){var b=Pv(a,y);if(b=wv(a,b),b!==null){if(Zl(b),b=b.copy(),b.l&16777216){var z=a.ih();z!==null&&Sv(z,!0)}typeof y=="object"&&(a.ge===null&&(a.ge=new be),a.ge.add(y,b)),z=x+Qg(a),a.Gb(z,b),E&&(b.ub=y,xv(a,z,x),b.ub=null),b.data=y}}}function xv(a,y,x){for(a=a.O;y<a.length;){var E=a.M(y);if(E instanceof wn){var b=y,z=x;E.type===wn.TableRow?E.row=b:E.type===wn.TableColumn&&(E.column=b),E.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=sa(y,a)}else return"";if(a===void 0)return"";if(typeof a=="string")return a;Gt("Panel.getCategoryForItemData found a non-string category for "+y+": "+a)}function wv(a,y){var x=a.itemTemplateMap,E=null;return x!==null&&(E=x.I(y)),E===null&&(x!==null&&(E=x.I("")),E===null&&(g1||(g1=!0,Mn('No item template Panel found for category "'+y+'" on '+a),Mn(" Using default item template."),a=new wn,y=new Ao,y.bind(new ha("text","",Ii)),a.add(y),p1=a),E=p1)),E}function Mm(a,y,x){var E=y.enabledChanged;if(E!==null&&E(y,x),y instanceof wn){y=y.O.s,E=y.length;for(var b=0;b<E;b++){var z=y[b];x&&z instanceof wn&&!z.isEnabled||Mm(a,z,x)}}}function Au(a,y){y.name=a,nu.add(a,y)}ye.Object.defineProperties(wn.prototype,{type:{get:function(){return this.na},set:function(a){var y=this.na;y!==a&&(this.na=a,this.isAtomic=this.na===wn.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&&un(a,">= 0",wn,"padding"),a=new nr(a)):(0>a.left&&un(a.left,">= 0",wn,"padding:value.left"),0>a.right&&un(a.right,">= 0",wn,"padding:value.right"),0>a.top&&un(a.top,">= 0",wn,"padding:value.top"),0>a.bottom&&un(a.bottom,">= 0",wn,"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:ga},set:function(a){typeof a=="number"&&(a=new nr(a));var y=this.defaultSeparatorPadding;y.D(a)||(a=a.J(),this.T===null&&(this.T=new Ml),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 mo)&&(a instanceof mo&&a.freeze(),this.T===null&&(this.T=new Ml),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 Ml),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,E=0,b=0;b<x;b++){var z=a[b];typeof z=="number"&&0<=z&&isFinite(z)||Gt("defaultRowSeparatorDashArray value "+z+" at index "+b+" must be a positive number or zero."),E+=z}if(E===0){if(y===null)return;a=null}}this.T===null&&(this.T=new Ml),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 mo)&&(a instanceof mo&&a.freeze(),this.T===null&&(this.T=new Ml),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 Ml),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,E=0,b=0;b<x;b++){var z=a[b];typeof z=="number"&&0<=z&&isFinite(z)||Gt("defaultColumnSeparatorDashArray value "+z+" at index "+b+" must be a positive number or zero."),E+=z}if(E===0){if(y===null)return;a=null}}this.T===null&&(this.T=new Ml),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 Ml),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||Gt("Invalid Panel.gridCellSize: "+a),this.jn=a.J();var x=this.diagram;x!==null&&this===x.grid&&bu(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()||Gt("Invalid Panel.gridOrigin: "+a),this.kn=a.J();var x=this.diagram;x!==null&&this===x.grid&&bu(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 fh),this.ra.lq=a,this.v(),this.g("graduatedMin",y,a),Ya(this)&&(a=this.part,a!==null&&Ho(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 fh),this.ra.F=a,this.v(),this.g("graduatedMax",y,a),Ya(this)&&(a=this.part,a!==null&&Ho(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 fh),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 fh),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 fh,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 fh,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 fh,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 fh,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 Ml),this.T.Pc}},rowCount:{get:function(){return this.T===null?0:this.rowDefs.length}},colDefs:{get:function(){return this.T===null&&(this.T=new Ml),this.T.Oc}},columnCount:{get:function(){return this.T===null?0:this.colDefs.length}},rowSizing:{get:function(){return this.T!==null?this.T.ob:Nm},set:function(a){var y=this.rowSizing;y!==a&&(this.T===null&&(this.T=new Ml),this.T.ob=a,this.v(),this.g("rowSizing",y,a))}},columnSizing:{get:function(){return this.T!==null?this.T.j:Nm},set:function(a){var y=this.columnSizing;y!==a&&(this.T===null&&(this.T=new Ml),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)&&Gt("Panel.topIndex must be greater than zero and a real number, not: "+a),this.T===null&&(this.T=new Ml),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)&&Gt("Panel.leftIndex must be greater than zero and a real number, not: "+a),this.T===null&&(this.T=new Ml),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 Bi&&!(this instanceof Qr);Zl(this),this.ub=a;var E=this.diagram;E!==null&&(x?(x=E.partManager,this instanceof Nn?(y!==null&&x.bf.remove(y),a!==null&&x.bf.add(a,this)):this instanceof Bi&&(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),E!==null&&E.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 Oc),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&&sy(x.partManager,this)),this.g("itemArray",y,a),x!==null&&x.undoManager.isUndoingRedoing||f1(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 be}var y=this.itemTemplateMap.I("");y!==a&&((a instanceof Bi||a.isPanelMain)&&Gt("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(););vr(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&&(vr(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 er&&(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&&Mm(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))}}}),ye.Object.defineProperties(wn,{Position:{get:function(){return nu.I("Position")}},Horizontal:{get:function(){return nu.I("Horizontal")}},Vertical:{get:function(){return nu.I("Vertical")}},Spot:{get:function(){return nu.I("Spot")}},Auto:{get:function(){return nu.I("Auto")}},Table:{get:function(){return nu.I("Table")}},Viewbox:{get:function(){return nu.I("Viewbox")}},TableRow:{get:function(){return nu.I("TableRow")}},TableColumn:{get:function(){return nu.I("TableColumn")}},Link:{get:function(){return nu.I("Link")}},Grid:{get:function(){return nu.I("Grid")}},Graduated:{get:function(){return nu.I("Graduated")}}}),wn.prototype.rebuildItemElements=wn.prototype.mv,wn.prototype.findItemPanelForData=wn.prototype.sx,wn.prototype.updateTargetBindings=wn.prototype.La,wn.prototype.copyTemplate=wn.prototype.Uy,wn.prototype.graduatedValueForPoint=wn.prototype.Gz,wn.prototype.graduatedPointForValue=wn.prototype.Fz,wn.prototype.findColumnForLocalX=wn.prototype.fz,wn.prototype.findRowForLocalY=wn.prototype.nz,wn.prototype.addColumnDefinition=wn.prototype.By,wn.prototype.addRowDefinition=wn.prototype.Hy,wn.prototype.addRowColumnDefinition=wn.prototype.Gy,wn.prototype.removeColumnDefinition=wn.prototype.jA,wn.prototype.getColumnDefinition=wn.prototype.Eb,wn.prototype.removeRowDefinition=wn.prototype.oA,wn.prototype.getRowDefinition=wn.prototype.Fb,wn.prototype.removeAt=wn.prototype.mb,wn.prototype.remove=wn.prototype.remove,wn.prototype.insertAt=wn.prototype.Gb,wn.prototype.elt=wn.prototype.M,wn.prototype.add=wn.prototype.add,wn.prototype.findObject=wn.prototype.fb,wn.prototype.findInVisualTree=wn.prototype.Nl,wn.prototype.walkVisualTreeFrom=wn.prototype.qm,wn.prototype.findMainElement=wn.prototype.Pb;var g1=!1,p1=null,nu=new be;wn.className="Panel",wn.definePanelLayout=Au,Au("Position",new gm),Au("Vertical",new mm),Au("Auto",new ym),Au("Link",new Em);function fh(){this.lq=0,this.F=100,this.ia=10,this.V=0,this.Zh=this.o=this.j=this.u=null}fh.prototype.copy=function(){var a=new fh;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},fh.className="GradPanelSettings";function Ml(){this.Pc=[],this.Oc=[],this.j=this.ob=Nm,this.hb=this.Hb=0,this.Qp=ga,this.Ha=1,this.V=this.ia=null,this.F=1,this.nb=this.o=this.u=null}Ml.prototype.copy=function(a){for(var y=new Ml,x=this.Pc,E=x.length,b=y.Pc,z=0;z<E;z++)if(x[z]!==void 0){var tt=x[z].copy();tt.wi(a),b[z]=tt}for(x=this.Oc,E=x.length,b=y.Oc,z=0;z<E;z++)x[z]!==void 0&&(tt=x[z].copy(),tt.wi(a),b[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},Ml.className="TablePanelSettings";function Sa(a){Hi(this),this.Me=null,this.uq=!0,this.Za=0,this.Hc=NaN,this.jj=0,this.hj=1/0,this.Jb=wa,this.pa=this.oc=this.oa=0,this.be=null,this.oo=Cv,this.hg=rr,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))}Sa.prototype.copy=function(){var a=new Sa;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=bn(this.separatorDashArray)),a.Ma=this.Ma,a.Pm=this.Pm,a.be=this.be,a};function km(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=bn(y.separatorDashArray)),a.background=y.background,a.coversSeparators=y.coversSeparators,a.be=y.be}wt=Sa.prototype,wt.qb=function(a){a.classType===Sa&&(this.sizing=a)},wt.toString=function(){return"RowColumnDefinition "+(this.isRow?"(Row ":"(Column ")+this.index+") #"+ji(this)},wt.wi=function(a){this.Me=a},wt.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)},wt.Wc=function(){var a=0,y=this.Me,x=0,E=this.isRow;if(y!==null&&y.type===wn.Table)for(var b=E?y.rowDefs.length:y.colDefs.length,z=0;z<b;z++){var tt=E?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=E?y.defaultRowSeparatorStroke:y.defaultColumnSeparatorStroke),x!==null&&(a=this.separatorStrokeWidth,isNaN(a)&&(y!==null?a=E?y.defaultRowSeparatorStrokeWidth:y.defaultColumnSeparatorStrokeWidth:a=0))),E=this.dg,E===null)if(y!==null)E=y.defaultSeparatorPadding;else return a;return a+(this.isRow?E.top+E.bottom:E.left+E.right)},wt.Ob=function(a,y,x){var E=this.Me;if(E!==null&&(E.cb(wr,a,this,y,x,void 0,void 0),this.be!==null&&(y=E.diagram,y!==null&&!y.skipsModelSourceBindings&&(E=E.ih(),E!==null&&(y=E.data,y!==null)))))for(x=this.be.iterator;x.next();)x.value.sp(this,y,a,E)};function bm(a){if(a.sizing===Cv){var y=a.Me;return a.isRow?y.rowSizing:y.columnSizing}return a.sizing}wt.bind=function(a,y,x,E){var b=null;return typeof a=="string"?b=new ha(a,y,x,E):b=a,b.xd=this,a=this.panel,a!==null&&(y=a.ih(),y!==null&&c1(y)&&Gt("Cannot add a Binding to a RowColumnDefinition that is already frozen: "+b+" on "+a)),this.be===null&&(this.be=new fn),this.be.add(b),this},ye.Object.defineProperties(Sa.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&&un(a,">= 0",Sa,"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&&un(a,">= 0",Sa,"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))&&un(a,">= 0",Sa,"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&&un(a,">= 0",Sa,"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 nr(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&&_c(a,"RowColumnDefinition.separatorStroke"),a instanceof mo&&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,E=0,b=0;b<x;b++){var z=a[b];typeof z=="number"&&0<=z&&isFinite(z)||Gt("separatorDashArray value "+z+" at index "+b+" must be a positive number or zero."),E+=z}if(E===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&&_c(a,"RowColumnDefinition.background"),a instanceof mo&&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}}}),Sa.prototype.computeEffectiveSpacing=Sa.prototype.Wc,Sa.prototype.computeEffectiveSpacingTop=Sa.prototype.Io;var Cv=new rn(Sa,"Default",0),$g=new rn(Sa,"None",1),Nm=new rn(Sa,"ProportionalExtra",2);Sa.className="RowColumnDefinition",Sa.Default=Cv,Sa.None=$g,Sa.ProportionalExtra=Nm;function cr(a,y){ge.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)}Se(cr,ge),cr.prototype.cloneProtected=function(a){ge.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=bn(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 qd(a){a.Na===null?a.Na=new Fv:a.Na.nc&&(a.Na=a.Na.copy())}wt=cr.prototype,wt.th=function(){ge.prototype.th.call(this),this.Na!==null&&(this.Na.nc=!0)},wt.qb=function(a){a===hn||a===xi||a===Zr||a===rr?this.geometryStretch=a:ge.prototype.qb.call(this,a)},wt.toString=function(){return"Shape("+(this.figure!=="None"?this.figure:this.toArrow!=="None"?this.toArrow:this.fromArrow)+")#"+ji(this)};function If(a,y,x,E){var b=x.length;if(!(4>b)){var z=E.measuredBounds,tt=Math.max(1,z.width);z=z.height;for(var rt=x[0],ot=x[1],lt,ut,ft,yt,xt,Ct,bt=0,Vt=Yn(),zt=2;zt<b;zt+=2)lt=x[zt],ut=x[zt+1],ft=lt-rt,rt=ut-ot,ft===0&&(ft=.001),yt=rt/ft,xt=Math.atan2(rt,ft),Ct=Math.sqrt(ft*ft+rt*rt),Vt.push([ft,xt,yt,Ct]),bt+=Ct,rt=lt,ot=ut;rt=x[0],ot=x[1],ft=E.measuredBounds.width,E instanceof cr&&(ft-=E.strokeWidth),1>ft&&(ft=1),b=x=ft,lt=tt/2,ut=lt!==0,zt=0,Ct=Vt[zt],ft=Ct[0],xt=Ct[1],yt=Ct[2],Ct=Ct[3];for(var Qt=0;.1<=bt;){if(Qt===0&&(ut?(b=x,b-=lt,bt-=lt,ut=!1):b=x,b===0&&(b=1)),b>bt){si(Vt);return}b>Ct?(Qt=b-Ct,b=Ct):Qt=0;var ee=Math.sqrt(b*b/(1+yt*yt));if(0>ft&&(ee=-ee),rt+=ee,ot+=yt*ee,a.translate(rt,ot),a.rotate(xt),a.translate(-(tt/2),-(z/2)),Qt===0&&E.hh(a,y),a.translate(tt/2,z/2),a.rotate(-xt),a.translate(-rt,-ot),bt-=b,Ct-=b,Qt!==0){if(zt++,zt===Vt.length){si(Vt);return}Ct=Vt[zt],ft=Ct[0],xt=Ct[1],yt=Ct[2],Ct=Ct[3],b=Qt}}si(Vt)}}wt.hh=function(a,y){var x=this.xc,E=this.Ui;if(x!==null||E!==null){var b=this.ua;if(b!==null){a.yc();var z=this.actualBounds,tt=this.naturalBounds;E!==null&&na(this,a,E,!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===wn.Link&&rt instanceof Qr&&rt.category==="Selection"&&rt.adornedObject instanceof cr&&rt.adornedPart.Pb()===rt.adornedObject?rt.adornedObject.strokeWidth:0),ot===0&&(x=null),x!==null&&ot!==0&&(na(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||E!==null&&E!=="transparent"||(rt=!1),tt=!1,ot=this.strokeDashArray,ot!==null&&(tt=!0,a.js(ot,this.strokeDashOffset)),b.type===fe.j)a.beginPath(),a.moveTo(b.startX,b.startY),a.lineTo(b.endX,b.endY),x!==null&&a.jk(),a.Se();else if(b.type===fe.u){var lt=b.startX;ot=b.startY;var ut=b.endX,ft=b.endY;b=Math.min(lt,ut);var yt=Math.min(ot,ft);lt=Math.abs(ut-lt),ot=Math.abs(ft-ot),a.beginPath(),a.rect(b,yt,lt,ot),E!==null&&a.ng(E),x!==null&&(rt&&z&&Vu(a),a.jk(),rt&&z&&uh(a)),a.Se()}else if(b.type===fe.F)lt=b.startX,ot=b.startY,ut=b.endX,ft=b.endY,b=Math.abs(ut-lt)/2,yt=Math.abs(ft-ot)/2,lt=Math.min(lt,ut)+b,ot=Math.min(ot,ft)+yt,a.beginPath(),a.moveTo(lt,ot-yt),a.bezierCurveTo(lt+_t.wg*b,ot-yt,lt+b,ot-_t.wg*yt,lt+b,ot),a.bezierCurveTo(lt+b,ot+_t.wg*yt,lt+_t.wg*b,ot+yt,lt,ot+yt),a.bezierCurveTo(lt-_t.wg*b,ot+yt,lt-b,ot+_t.wg*yt,lt-b,ot),a.bezierCurveTo(lt-b,ot-_t.wg*yt,lt-_t.wg*b,ot-yt,lt,ot-yt),a.closePath(),E!==null&&a.ng(E),x!==null&&(rt&&z&&Vu(a),a.jk(),rt&&z&&uh(a)),a.Se();else if(b.type===fe.o)for(b=b.figures,ot=b.length,yt=0;yt<ot;yt++){lt=b.s[yt],a.beginPath(),a.moveTo(lt.startX,lt.startY),ut=lt.segments.s,ft=ut.length;for(var xt=null,Ct=0;Ct<ft;Ct++){var bt=ut[Ct];switch(bt.type){case ir:a.moveTo(bt.endX,bt.endY);break;case Ji:a.lineTo(bt.endX,bt.endY);break;case Mr:a.bezierCurveTo(bt.point1X,bt.point1Y,bt.point2X,bt.point2Y,bt.endX,bt.endY);break;case Lr:a.quadraticCurveTo(bt.point1X,bt.point1Y,bt.endX,bt.endY);break;case Br:if(bt.radiusX===bt.radiusY){var Vt=Math.PI/180;a.arc(bt.point1X,bt.point1Y,bt.radiusX,bt.startAngle*Vt,(bt.startAngle+bt.sweepAngle)*Vt,0>bt.sweepAngle,xt!==null?xt.endX:lt.startX,xt!==null?xt.endY:lt.startY)}else if(xt=no(bt,lt),Vt=xt.length,Vt===0)a.lineTo(bt.centerX,bt.centerY);else for(var zt=0;zt<Vt;zt++){var Qt=xt[zt];zt===0&&a.lineTo(Qt[0],Qt[1]),a.bezierCurveTo(Qt[2],Qt[3],Qt[4],Qt[5],Qt[6],Qt[7])}break;case io:if(zt=Vt=0,xt!==null&&xt.type===Br){if(xt=no(xt,lt),Qt=xt.length,Qt===0){a.lineTo(bt.endX,bt.endY);break}xt=xt[Qt-1]||null,xt!==null&&(Vt=xt[6],zt=xt[7])}else Vt=xt!==null?xt.endX:lt.startX,zt=xt!==null?xt.endY:lt.startY;if(xt=Wi(bt,lt,Vt,zt),Vt=xt.length,Vt===0){a.lineTo(bt.endX,bt.endY);break}for(zt=0;zt<Vt;zt++)Qt=xt[zt],a.bezierCurveTo(Qt[2],Qt[3],Qt[4],Qt[5],Qt[6],Qt[7]);break;default:Gt("Segment not of valid type: "+bt.type)}bt.isClosed&&a.closePath(),xt=bt}ut=lt.isFilled,z?lt.isShadowed?(ut===!0&&E!=="transparent"&&E!==null&&a.ng(E,lt.isEvenOdd),x!==null&&(ut&&rt&&Vu(a),a.jk(),ut&&rt&&uh(a))):(Vu(a),ut&&E!=="transparent"&&E!==null&&a.ng(E,lt.isEvenOdd),x!==null&&a.jk(),uh(a)):(ut&&E!==null&&a.ng(E,lt.isEvenOdd),x!==null&&a.jk()),a.Se(yt)}if(tt&&a.fs(),this.pathPattern!==null){if(x=this.pathPattern,x.measure(1/0,1/0),E=x.measuredBounds,x.arrange(0,0,E.width,E.height),z=this.geometry,a.save(),a.beginPath(),E=Yn(),z.type===fe.j)E.push(z.startX),E.push(z.startY),E.push(z.endX),E.push(z.endY),If(a,y,E,x);else if(z.type===fe.o)for(z=z.figures.iterator;z.next();){for(rt=z.value,E.length=0,E.push(rt.startX),E.push(rt.startY),tt=rt.startX,b=rt.startY,ot=tt,yt=b,lt=rt.segments.s,ut=lt.length,ft=0;ft<ut;ft++){switch(Ct=lt[ft],Ct.type){case ir:If(a,y,E,x),E.length=0,E.push(Ct.endX),E.push(Ct.endY),tt=Ct.endX,b=Ct.endY,ot=tt,yt=b;break;case Ji:E.push(Ct.endX),E.push(Ct.endY),tt=Ct.endX,b=Ct.endY;break;case Mr:_t.Qe(tt,b,Ct.point1X,Ct.point1Y,Ct.point2X,Ct.point2Y,Ct.endX,Ct.endY,.5,E),tt=Ct.endX,b=Ct.endY;break;case Lr:_t.ep(tt,b,Ct.point1X,Ct.point1Y,Ct.endX,Ct.endY,.5,E),tt=Ct.endX,b=Ct.endY;break;case Br:if(bt=no(Ct,rt),xt=bt.length,xt===0){E.push(Ct.centerX),E.push(Ct.centerY),tt=Ct.centerX,b=Ct.centerY;break}for(Vt=0;Vt<xt;Vt++)zt=bt[Vt],_t.Qe(tt,b,zt[2],zt[3],zt[4],zt[5],zt[6],zt[7],.5,E),tt=zt[6],b=zt[7];break;case io:if(bt=Wi(Ct,rt,tt,b),xt=bt.length,xt===0){E.push(Ct.endX),E.push(Ct.endY),tt=Ct.endX,b=Ct.endY;break}for(Vt=0;Vt<xt;Vt++)zt=bt[Vt],_t.Qe(tt,b,zt[2],zt[3],zt[4],zt[5],zt[6],zt[7],.5,E),tt=zt[6],b=zt[7];break;default:Gt("Segment not of valid type: "+Ct.type)}Ct.isClosed&&(E.push(ot),E.push(yt),If(a,y,E,x))}If(a,y,E,x)}else if(z.type===fe.u)E.push(z.startX),E.push(z.startY),E.push(z.endX),E.push(z.startY),E.push(z.endX),E.push(z.endY),E.push(z.startX),E.push(z.endY),E.push(z.startX),E.push(z.startY),If(a,y,E,x);else if(z.type===fe.F){if(b=new Dr,b.startX=z.endX,b.startY=(z.startY+z.endY)/2,tt=new Ki(Br),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,b.add(tt),z=no(tt,b),rt=z.length,rt===0)E.push(tt.centerX),E.push(tt.centerY);else for(tt=b.startX,b=b.startY,ot=0;ot<rt;ot++)yt=z[ot],_t.Qe(tt,b,yt[2],yt[3],yt[4],yt[5],yt[6],yt[7],.5,E),tt=yt[6],b=yt[7];If(a,y,E,x)}si(E),a.restore(),a.Vc(!1)}}}},wt.kk=function(a,y,x){return!ge.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)},wt.nk=function(a){return this.geometry!==null&&1<this.geometry.figures.length||this.pathPattern!==null?!0:ge.prototype.nk.call(this,a)},wt.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)}},wt.ga=function(a,y){if(y===void 0&&(y=new At),a instanceof fi){a.Mc()&&Gt("getDocumentPoint Spot must be a real, specific Spot, not: "+a.toString());var x=this.naturalBounds,E=this.strokeWidth;y.h(a.x*(x.width+E)-E/2+x.x+a.offsetX,a.y*(x.height+E)-E/2+x.y+a.offsetY)}else y.set(a);return this.oe.Ga(y),y},wt.mi=function(a){a===void 0&&(a=new Be);var y=this.naturalBounds,x=this.oe;y=Be.allocAt(y.x,y.y,y.width,y.height);var E=this.strokeWidth;return y.Bc(E/2,E/2),E=At.allocAt(y.x,y.y).transform(x),a.h(E.x,E.y,0,0),E.h(y.right,y.y).transform(x),Rr(a,E.x,E.y,0,0),E.h(y.right,y.bottom).transform(x),Rr(a,E.x,E.y,0,0),E.h(y.x,y.bottom).transform(x),Rr(a,E.x,E.y,0,0),Be.free(y),At.free(E),a},wt.gh=function(a,y){var x=this.geometry;if(x===null||this.fill===null&&this.stroke===null)return!1;var E=x.bounds,b=this.strokeWidth/2;x.type!==fe.j||y||(b+=2);var z=Be.alloc();if(z.assign(E),z.Bc(b+2,b+2),!z.ca(a))return Be.free(z),!1;if(E=b+1e-4,x.type===fe.j)return this.stroke===null||(E=(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>E)?!1:(Be.free(z),_t.Yb(x.startX,x.startY,x.endX,x.endY,b,a.x,a.y));if(x.type===fe.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(-E,-E),z.ca(a))return Be.free(z),!1;z.Bc(E,E)}return this.stroke!==null&&z.Bc(b,b),a=z.ca(a),Be.free(z),a}if(x.type===fe.F){tt=x.startX,b=x.startY,rt=x.endX;var ot=x.endY;if(x=Math.min(tt,rt),y=Math.min(b,ot),tt=Math.abs(rt-tt)/2,b=Math.abs(ot-b)/2,x=a.x-(x+tt),y=a.y-(y+b),this.fill===null){if(tt-=E,b-=E,0>=tt||0>=b||1>=x*x/(tt*tt)+y*y/(b*b))return Be.free(z),!1;tt+=E,b+=E}return this.stroke!==null&&(tt+=E,b+=E),Be.free(z),0>=tt||0>=b?!1:1>=x*x/(tt*tt)+y*y/(b*b)}if(x.type===fe.o)return Be.free(z),this.fill===null?Pr(x,a.x,a.y,b):Fr(x,a,b,1<this.strokeWidth,y);Gt("Unknown Geometry type: "+x.type)},wt.Wl=function(a,y,x,E){var b=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=Lv[rt];if(ot===void 0){var lt=_t.Ze[rt];typeof lt=="string"&&(lt=_t.Ze[lt]),typeof lt=="function"?(ot=lt(null,100,100),Lv[rt]=ot):Gt("Unsupported Figure: "+rt)}tt=ot.bounds}rt=tt.width,ot=tt.height,lt=tt.width;var ut=tt.height;switch(Os(this,!0)){case hn:E=x=0;break;case Sn:lt=Math.max(a-z,0),ut=Math.max(y-z,0);break;case Fi:lt=Math.max(a-z,0),E=0;break;case Ri:x=0,ut=Math.max(y-z,0)}isFinite(b.width)&&(lt=b.width),isFinite(b.height)&&(ut=b.height);var ft=this.maxSize,yt=this.minSize;switch(x=Math.max(x-z,yt.width),E=Math.max(E-z,yt.height),lt=Math.min(ft.width,lt),ut=Math.min(ft.height,ut),lt=isFinite(lt)?Math.max(x,lt):Math.max(rt,x),ut=isFinite(ut)?Math.max(E,ut):Math.max(ot,E),x=Ev(this),x){case hn:break;case Sn:rt=lt,ot=ut;break;case xi:x=Math.min(lt/rt,ut/ot),isFinite(x)||(x=1),rt*=x,ot*=x;break;default:Gt(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,E=rt/tt.width,tt=ot/tt.height,isFinite(E)||(E=1),isFinite(tt)||(tt=1),this.ua=E===1&&tt===1?x:x.copy().scale(E,tt)):this.ua!==null&&_t.$(this.ua.Sk,a-z)&&_t.$(this.ua.Rk,y-z)||(this.ua=cr.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),lt+z,ut+z),b.w()?(lt=b.width,ut=b.height,lt=Math.min(ft.width,lt),ut=Math.min(ft.height,ut),lt=Math.max(yt.width,lt),ut=Math.max(yt.height,ut),this.dc.h(0,0,lt,ut)):this.dc.assign(tt)};function Ev(a){var y=a.geometryStretch;return a.Rd!==null?y===rr?Sn:y:y===rr?Lv[a.figure].defaultStretch:y}wt.eh=function(a,y,x,E){ds(this,a,y,x,E)},wt.rs=function(a,y,x){return this.Sj(a.x,a.y,y.x,y.y,x)},wt.Sj=function(a,y,x,E,b){var z=this.transform,tt=1/(z.m11*z.m22-z.m12*z.m21),rt=z.m22*tt,ot=-z.m12*tt,lt=-z.m21*tt,ut=z.m11*tt,ft=tt*(z.m21*z.dy-z.m22*z.dx),yt=tt*(z.m12*z.dx-z.m11*z.dy);z=a*rt+y*lt+ft,tt=a*ot+y*ut+yt,rt=x*rt+E*lt+ft,ot=x*ot+E*ut+yt,ft=this.ig/2,lt=this.ua,lt===null&&(this.measure(1/0,1/0),lt=this.ua);var xt=lt.bounds;if(ut=!1,lt.type===fe.j)if(1.5>=this.strokeWidth)ut=_t.Ve(lt.startX,lt.startY,lt.endX,lt.endY,z,tt,rt,ot,b);else{if(lt.startX===lt.endX?(E=ft,ut=0):(y=(lt.endY-lt.startY)/(lt.endX-lt.startX),ut=ft/Math.sqrt(1+y*y),E=ut*y),y=Yn(),a=new At,_t.Ve(lt.startX+E,lt.startY+ut,lt.endX+E,lt.endY+ut,z,tt,rt,ot,a)&&y.push(a),a=new At,_t.Ve(lt.startX-E,lt.startY-ut,lt.endX-E,lt.endY-ut,z,tt,rt,ot,a)&&y.push(a),a=new At,_t.Ve(lt.startX+E,lt.startY+ut,lt.startX-E,lt.startY-ut,z,tt,rt,ot,a)&&y.push(a),a=new At,_t.Ve(lt.endX+E,lt.endY+ut,lt.endX-E,lt.endY-ut,z,tt,rt,ot,a)&&y.push(a),rt=y.length,rt===0)return si(y),!1;for(ut=!0,ot=1/0,E=0;E<rt;E++)a=y[E],x=(a.x-z)*(a.x-z)+(a.y-tt)*(a.y-tt),x<ot&&(ot=x,b.x=a.x,b.y=a.y);si(y)}else if(lt.type===fe.u)ut=_t.Ff(xt.x-ft,xt.y-ft,xt.x+xt.width+ft,xt.y+xt.height+ft,z,tt,rt,ot,b);else if(lt.type===fe.F){y=Be.allocAt(xt.x,xt.y,xt.width,xt.height).Bc(ft,ft);t:if(y.width===0)ut=_t.Ve(y.x,y.y,y.x,y.y+y.height,z,tt,rt,ot,b);else if(y.height===0)ut=_t.Ve(y.x,y.y,y.x+y.width,y.y,z,tt,rt,ot,b);else{if(a=y.width/2,lt=y.height/2,E=y.x+a,ut=y.y+lt,x=9999,z!==rt&&(x=(tt-ot)/(z-rt)),9999>Math.abs(x)){if(ot=tt-ut-x*(z-E),0>a*a*x*x+lt*lt-ot*ot){b.x=NaN,b.y=NaN,ut=!1;break t}ft=Math.sqrt(a*a*x*x+lt*lt-ot*ot),rt=(-(a*a*x*ot)+a*lt*ft)/(lt*lt+a*a*x*x)+E,a=(-(a*a*x*ot)-a*lt*ft)/(lt*lt+a*a*x*x)+E,lt=x*(rt-E)+ot+ut,ot=x*(a-E)+ot+ut,Math.abs((z-rt)*(z-rt))+Math.abs((tt-lt)*(tt-lt))<Math.abs((z-a)*(z-a))+Math.abs((tt-ot)*(tt-ot))?(b.x=rt,b.y=lt):(b.x=a,b.y=ot)}else{if(rt=lt*lt,ot=z-E,rt-=rt/(a*a)*ot*ot,0>rt){b.x=NaN,b.y=NaN,ut=!1;break t}ot=Math.sqrt(rt),rt=ut+ot,ot=ut-ot,Math.abs(rt-tt)<Math.abs(ot-tt)?(b.x=z,b.y=rt):(b.x=z,b.y=ot)}ut=!0}Be.free(y)}else if(lt.type===fe.o){yt=At.alloc();var Ct=rt-z,bt=ot-tt,Vt=Ct*Ct+bt*bt,zt=z,Qt=tt;if(0<Vt&&xt.contains(zt,Qt)&&(yt.x=zt,yt.y=Qt,this.ca(yt)))for(Ct!==0&&.5>Math.abs(Ct)?(bt*=.5/Ct,Ct=.5):bt!==0&&.5>Math.abs(bt)&&(Ct*=.5/bt,bt=.5),zt-=Ct,Qt-=bt;xt.contains(zt,Qt);)zt-=Ct,Qt-=bt;for(b.x=rt,b.y=ot,bt=0;bt<lt.figures.count;bt++){var ee=lt.figures.s[bt],oe=ee.isFilled?zt:z,ce=ee.isFilled?Qt:tt,Me=ee.segments;xt=ee.startX,Ct=ee.startY;for(var Wn=xt,di=Ct,oi=0;oi<Me.count;oi++){var kn=Me.s[oi],en=kn.type,qi=kn.endX,Yi=kn.endY,oo=!1;switch(en){case ir:Wn=qi,di=Yi;break;case Ji:oo=Am(xt,Ct,qi,Yi,oe,ce,rt,ot,yt);break;case Mr:oo=_t.Eo(xt,Ct,kn.point1X,kn.point1Y,kn.point2X,kn.point2Y,qi,Yi,oe,ce,rt,ot,.6,yt);break;case Lr:oo=_t.Eo(xt,Ct,xt+2/3*(kn.point1X-xt),Ct+2/3*(kn.point1Y-Ct),qi+2/3*(kn.point1X-qi),Yi+2/3*(kn.point1Y-Yi),qi,Yi,oe,ce,rt,ot,.6,yt);break;case Br:case io:en=kn.type===Br?no(kn,ee):Wi(kn,ee,xt,Ct);var ko=en.length;if(ko===0){oo=Am(xt,Ct,kn.type===Br?kn.centerX:kn.endX,kn.type===Br?kn.centerY:kn.endY,oe,ce,rt,ot,yt);break}for(Yi=null,qi=0;qi<ko;qi++){if(Yi=en[qi],qi===0&&Am(xt,Ct,Yi[0],Yi[1],oe,ce,rt,ot,yt)){var ka=Bm(oe,ce,yt,Vt,b);ka<Vt&&(Vt=ka,ut=!0)}_t.Eo(Yi[0],Yi[1],Yi[2],Yi[3],Yi[4],Yi[5],Yi[6],Yi[7],oe,ce,rt,ot,.6,yt)&&(ka=Bm(oe,ce,yt,Vt,b),ka<Vt&&(Vt=ka,ut=!0))}qi=Yi[6],Yi=Yi[7];break;default:Gt("Unknown Segment type: "+en)}xt=qi,Ct=Yi,oo&&(oo=Bm(oe,ce,yt,Vt,b),oo<Vt&&(Vt=oo,ut=!0)),kn.isClosed&&(qi=Wn,Yi=di,Am(xt,Ct,qi,Yi,oe,ce,rt,ot,yt)&&(kn=Bm(oe,ce,yt,Vt,b),kn<Vt&&(Vt=kn,ut=!0)))}}z=x-a,tt=E-y,rt=Math.sqrt(z*z+tt*tt),rt!==0&&(z/=rt,tt/=rt),b.x-=z*ft,b.y-=tt*ft,At.free(yt)}else Gt("Unknown Geometry type: "+lt.type);return ut?(this.transform.Ga(b),!0):!1};function Bm(a,y,x,E,b){return a=x.x-a,y=x.y-y,y=a*a+y*y,y<E?(b.x=x.x,b.y=x.y,y):E}function Am(a,y,x,E,b,z,tt,rt,ot){if(_t.$(a,x)&&_t.$(y,E)||_t.$(b,tt)&&_t.$(z,rt))return!1;var lt=!1,ut=(b-tt)*(y-E)-(z-rt)*(a-x);return ut===0?!1:(ot.x=((b*rt-z*tt)*(a-x)-(b-tt)*(a*E-y*x))/ut,ot.y=((b*rt-z*tt)*(y-E)-(z-rt)*(a*E-y*x))/ut,(a>x?a-x:x-a)<(y>E?y-E:E-y)?(a=y<E?y:E,y=y<E?E:y,(ot.y>a||_t.$(ot.y,a))&&(ot.y<y||_t.$(ot.y,y))&&(lt=!0)):(y=a<x?a:x,a=a<x?x:a,(ot.x>y||_t.$(ot.x,y))&&(ot.x<a||_t.$(ot.x,a))&&(lt=!0)),lt)}wt.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 E=this.strokeWidth/2,b=!1,z=At.alloc();return z.h(x.x-E,x.y-E),a.ca(y.Ga(z))&&(z.h(x.x-E,x.bottom+E),a.ca(y.Ga(z))&&(z.h(x.right+E,x.bottom+E),a.ca(y.Ga(z))&&(z.h(x.right+E,x.y-E),a.ca(y.Ga(z))&&(b=!0)))),At.free(z),b},wt.Yc=function(a,y){if(this.fh(a,y)||y===void 0&&(y=this.transform,a.Re(this.actualBounds)))return!0;var x=ae.alloc();x.set(y),x.Vj();var E=a.left,b=a.right,z=a.top;a=a.bottom;var tt=At.alloc();if(tt.h(E,z),x.Ga(tt),this.gh(tt,!0)||(tt.h(b,z),x.Ga(tt),this.gh(tt,!0))||(tt.h(E,a),x.Ga(tt),this.gh(tt,!0))||(tt.h(b,a),x.Ga(tt),this.gh(tt,!0)))return At.free(tt),!0;var rt=At.alloc(),ot=At.alloc();return x.set(y),x.bv(this.transform),x.Vj(),rt.x=b,rt.y=z,rt.transform(x),tt.x=E,tt.y=z,tt.transform(x),y=!1,tc(this,tt,rt,ot)?y=!0:(tt.x=b,tt.y=a,tt.transform(x),tc(this,tt,rt,ot)?y=!0:(rt.x=E,rt.y=a,rt.transform(x),tc(this,tt,rt,ot)?y=!0:(tt.x=E,tt.y=z,tt.transform(x),tc(this,tt,rt,ot)&&(y=!0)))),At.free(tt),ae.free(x),At.free(rt),At.free(ot),y};function tc(a,y,x,E){if(!a.rs(y,x,E))return!1;a=y.x,y=y.y;var b=x.x,z=x.y;return x=E.x,E=E.y,a===b?(y<z?(a=y,y=z):a=z,E>=a&&E<=y):(a<b?(E=a,a=b):E=b,x>=E&&x<=a)}wt.tx=function(a,y,x){function E(Vt,zt){for(var Qt=Vt.length,ee=0;ee<Qt;ee+=2)if(zt.zd(Vt[ee],Vt[ee+1])>b)return!0;return!1}if(x&&this.fill!==null&&this.gh(a,!0))return!0;var b=a.Bf(y),z=b;if(1.5<this.strokeWidth&&(b=this.strokeWidth/2+Math.sqrt(b),b*=b),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,lt=tt.x+tt.width;if(tt=tt.y+tt.height,Oi(a.x,a.y,rt,ot)<=b&&Oi(a.x,a.y,lt,ot)<=b&&Oi(a.x,a.y,rt,tt)<=b&&Oi(a.x,a.y,lt,tt)<=b)return!0}if(rt=y.startX,ot=y.startY,lt=y.endX,tt=y.endY,y.type===fe.j){if(x=(rt-lt)*(a.x-lt)+(ot-tt)*(a.y-tt),Xn(a.x,a.y,rt,ot,lt,tt)<=(0<=(lt-rt)*(a.x-rt)+(tt-ot)*(a.y-ot)&&0<=x?b:z))return!0}else{if(y.type===fe.u)return y=!1,x&&(y=Xn(a.x,a.y,rt,ot,rt,tt)<=b||Xn(a.x,a.y,rt,ot,lt,ot)<=b||Xn(a.x,a.y,lt,ot,lt,tt)<=b||Xn(a.x,a.y,rt,tt,lt,tt)<=b),y;if(y.type===fe.F){y=a.x-(rt+lt)/2,z=a.y-(ot+tt)/2;var ut=Math.abs(lt-rt)/2,ft=Math.abs(tt-ot)/2;if(ut===0||ft===0)return Xn(a.x,a.y,rt,ot,lt,tt)<=b;if(x){if(a=_t.$y(ut,ft,y,z),a*a<=b)return!0}else return!(Oi(y,z,-ut,0)>=b||Oi(y,z,0,-ft)>=b||Oi(y,z,0,ft)>=b||Oi(y,z,ut,0)>=b)}else if(y.type===fe.o){if(lt=y.bounds,z=lt.x,rt=lt.y,ot=lt.x+lt.width,lt=lt.y+lt.height,a.x>ot&&a.x<z&&a.y>lt&&a.y<rt&&Xn(a.x,a.y,z,rt,z,lt)>b&&Xn(a.x,a.y,z,rt,ot,rt)>b&&Xn(a.x,a.y,ot,lt,z,lt)>b&&Xn(a.x,a.y,ot,lt,ot,rt)>b)return!1;if(z=Math.sqrt(b),x){if(this.fill===null?Pr(y,a.x,a.y,z):Fr(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)>b)return!1;for(rt=z.segments.s,ot=rt.length,lt=0;lt<ot;lt++)switch(ft=rt[lt],ft.type){case ir:case Ji:if(tt=ft.endX,ut=ft.endY,a.zd(tt,ut)>b)return!1;break;case Mr:var yt=Yn();if(_t.Qe(tt,ut,ft.point1X,ft.point1Y,ft.point2X,ft.point2Y,ft.endX,ft.endY,.8,yt),tt=E(yt,a),si(yt),tt||(tt=ft.endX,ut=ft.endY,a.zd(tt,ut)>b))return!1;break;case Lr:if(yt=Yn(),_t.ep(tt,ut,ft.point1X,ft.point1Y,ft.endX,ft.endY,.8,yt),tt=E(yt,a),si(yt),tt||(tt=ft.endX,ut=ft.endY,a.zd(tt,ut)>b))return!1;break;case Br:case io:yt=ft.type===Br?no(ft,z):Wi(ft,z,tt,ut);var xt=yt.length;if(xt===0){if(tt=ft.type===Br?ft.centerX:ft.endX,ut=ft.type===Br?ft.centerY:ft.endY,a.zd(tt,ut)>b)return!1;break}ft=null;for(var Ct=Yn(),bt=0;bt<xt;bt++)if(ft=yt[bt],Ct.length=0,_t.Qe(ft[0],ft[1],ft[2],ft[3],ft[4],ft[5],ft[6],ft[7],.8,Ct),E(Ct,a))return si(Ct),!1;si(Ct),ft!==null&&(tt=ft[6],ut=ft[7]);break;default:Gt("Unknown Segment type: "+ft.type)}}return!0}}}return!1},wt.qc=function(){this.ua=null},wt.kq=function(){return this.ig};function m1(a){var y=a.diagram;y!==null&&y.undoManager.isUndoingRedoing||(a.segmentOrientation=sp,a.toArrow!=="None"?(a.segmentIndex=-1,a.alignmentFocus=Ba):a.fromArrow!=="None"&&(a.segmentIndex=0,a.alignmentFocus=new fi(1-Ba.x,Ba.y)))}cr.makeGeometry=function(a,y,x){if(a.toArrow!=="None")var E=Uu[a.toArrow];else a.fromArrow!=="None"?E=Uu[a.fromArrow]:(E=_t.Ze[a.figure],typeof E=="string"&&(E=_t.Ze[E]),E===void 0&&Gt("Unknown Shape.figure: "+a.figure),E=E(a,y,x),E.Sk=y,E.Rk=x);if(E===null){var b=_t.Ze.Rectangle;typeof b=="function"&&(E=b(a,y,x))}return E};function v1(a){var y=Uu[a];if(y===void 0){var x=a.toLowerCase();if(x==="none")return"None";if(y=Uu[x],y===void 0){var E=null,b;for(b in _t.um)if(b.toLowerCase()===x){E=b;break}if(E!==null)return a=fe.parse(_t.um[E],!1),Uu[E]=a,x!==E&&(Uu[x]=E),E}}return typeof y=="string"?y:y instanceof fe?a:null}ye.Object.defineProperties(cr.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 E=this.part;E!==null&&(E.ag=NaN),this.v(),this.g("geometry",y||x,a),Ya(this)&&(a=this.part,a!==null&&Ho(this,a,"geometryString"))}}},geometryString:{get:function(){return this.geometry===null?"":this.geometry.toString()},set:function(a){a=fe.parse(a);var y=a.normalize();this.geometry=a,this.position=a=At.allocAt(-y.x,-y.y),At.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&&_c(a,"Shape.fill"),a instanceof mo&&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&&_c(a,"Shape.stroke"),a instanceof mo&&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 un(a,"value >= 0",cr,"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"?un(a,'"butt", "round", or "square"',cr,"strokeCap"):(qd(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"?un(a,'"miter", "bevel", or "round"',cr,"strokeJoin"):(qd(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){qd(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,E=0,b=0;b<x;b++){var z=a[b];0<=z&&isFinite(z)||Gt("strokeDashArray:value "+z+" at index "+b+" must be a positive number or zero."),E+=z}if(E===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&&(qd(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=_t.Ze[a];typeof x=="function"?x=a:(x=_t.Ze[a.toLowerCase()])||Gt("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?Gt("Unknown Shape.toArrow: "+a):y!==x&&(this.Ua===null&&(this.Ua=new dd),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?Gt("Unknown Shape.fromArrow: "+a):y!==x&&(this.Ua===null&&(this.Ua=new dd),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:wa},set:function(a){var y=this.spot1;y.D(a)||(a=a.J(),qd(this),this.Na.fg=a,this.v(),this.g("spot1",y,a))}},spot2:{get:function(){return this.Na!==null?this.Na.gg:wa},set:function(a){var y=this.spot2;y.D(a)||(a=a.J(),qd(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&&(qd(this),this.Na.br=a,this.N(),this.g("pathPattern",y,a))}},geometryStretch:{get:function(){return this.Na!==null?this.Na.jq:rr},set:function(a){var y=this.geometryStretch;y!==a&&(qd(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 Yu),this.fa.Tk=a;var x=this.diagram;x!==null&&this.panel===x.grid&&bu(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 Yu),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 Yu),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 Yu),this.fa.o=a,this.v(),this.g("graduatedSkip",y,a))}}}),cr.prototype.intersectsRect=cr.prototype.Yc,cr.prototype.containedInRect=cr.prototype.fh,cr.prototype.getNearestIntersectionPoint=cr.prototype.rs,cr.prototype.getDocumentBounds=cr.prototype.mi,cr.prototype.getDocumentPoint=cr.prototype.ga;var Uu=new Mi,Lv=new Mi;cr.className="Shape",cr.getFigureGenerators=function(){var a=new be,y;for(y in _t.Ze)y!==y.toLowerCase()&&a.add(y,_t.Ze[y]);return a.freeze(),a},cr.defineFigureGenerator=function(a,y){var x=a.toLowerCase(),E=_t.Ze;E[a]=y,E[x]=a},cr.getArrowheadGeometries=function(){var a=new be;for(E in _t.um)if(Uu[E]===void 0){var y=fe.parse(_t.um[E],!1);Uu[E]=y,y=E.toLowerCase(),y!==E&&(Uu[y]=E)}for(var x in Uu)if(x!==x.toLowerCase()){var E=Uu[x];E instanceof fe&&a.add(x,E)}return a.freeze(),a},cr.defineArrowheadGeometry=function(a,y){var x=null;typeof y=="string"?x=fe.parse(y,!1):x=y,y=a.toLowerCase(),y!=="none"&&a!==y||Gt("Shape.defineArrowheadGeometry name must not be empty or None or all-lower-case: "+a);var E=Uu;E[a]=x,E[y]=a};function Fv(){this.nc=!1,this.Hr="butt",this.Ir="miter",this.Jr=10,this.uj=0,this.br=null,this.jq=rr,this.gg=this.fg=wa}Fv.prototype.copy=function(){var a=new Fv;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 Ao(a,y){return ge.call(this),_m||(Is=$o?new zl(null).context:null,_m=!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}Se(Ao,ge),Ao.prototype.cloneProtected=function(a){ge.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 Tu(a){a.da===null?a.da=new Tv:a.da.nc&&(a.da=a.da.copy())}wt=Ao.prototype,wt.th=function(){ge.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}wt.qb=function(a){a.classType===Ao?this.wrap=a:ge.prototype.qb.call(this,a)},wt.toString=function(){return 22<this.ec.length?'TextBlock("'+this.ec.substring(0,20)+'"...)':'TextBlock("'+this.ec+'")'},wt.v=function(){ge.prototype.v.call(this)},wt.hh=function(a,y){if(this.xc!==null&&this.ec.length!==0&&this.Ae!==null){var x=this.naturalBounds,E=this.actualBounds,b=x.width,z=x.height,tt=tp(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 lt=this.isStrikethrough;na(this,a,this.xc,!0,!1,x,E),(ot||lt)&&na(this,a,this.xc,!1,!1,x,E),E=0,x=!1;var ut=this.oe,ft=ut.dx-(tt*ut.m21+ut.dx);ut=ut.dy-(tt*ut.m22+ut.dy);var yt=y.scale;switch(8>(ft*ft+ut*ut)*yt*yt&&(x=!0),y.ib!==a&&(x=!1),y.ib instanceof tl&&(x=!1),y.Gf("textGreeking")===!1&&(x=!1),y=this.spacingAbove,ft=this.spacingBelow,this.flip){case Ur:a.translate(b,0),a.scale(-1,1);break;case xr:a.translate(0,z),a.scale(1,-1);break;case Eo:a.translate(b,z),a.scale(-1,-1)}if(a.yc(),ut=this.Gc,yt=(y+tt+ft)*ut,z>yt&&(E=this.verticalAlignment,E=E.y*z-E.y*yt+E.offsetY),ut===1&&this.ze!==null)ft=this.Cb,ft>b&&(ft=b),this.Oj(this.ze,a,0,E+y,b,tt,ft,x,rt,ot,lt);else if(this.Qc!==null&&this.Qb!==null)for(yt=0;yt<ut;yt++){var xt=this.Qc[yt];xt>b&&(xt=b),E+=y,this.Oj(this.Qb[yt],a,0,E,b,tt,xt,x,rt,ot,lt),E+=tt+ft}switch(this.flip){case Ur:a.scale(-1,1),a.translate(-b,0);break;case xr:a.scale(1,-1),a.translate(0,-z);break;case Eo:a.scale(-1,-1),a.translate(-b,-z)}}},wt.Oj=function(a,y,x,E,b,z,tt,rt,ot,lt,ut){var ft=0;if(rt)ot==="left"?ft=0:ot==="right"?ft=b-tt:ot==="center"&&(ft=(b-tt)/2),y.fillRect(x+ft,E+.25*z,tt,1);else{if(ot==="left"?ft=0:ot==="right"?ft=b:ot==="center"&&(ft=b/2),b=Tm!==null?Tm(this,z):.75*z,y.fillText(a,x+ft,E+b),a=z/20|0,a===0&&(a=1),ot==="right"?ft-=tt:ot==="center"&&(ft-=tt/2),lt){rt=Dm!==null?Dm(this,z):.8*z,ot=x+ft,lt=E+rt,b=x+ft+tt,rt=E+rt;var yt=a;y.beginPath(),y.lineWidth=yt,y.moveTo(ot,lt),y.lineTo(b,rt),y.stroke(),y.Se(),y instanceof tl&&y.ad.classList.add("gojs-td")}ut&&(ut=E+z-z/2.2|0,a%2!==0&&(ut+=.5),E=x+ft,z=ut,x=x+ft+tt,tt=ut,ft=a,y.beginPath(),y.lineWidth=ft,y.moveTo(E,z),y.lineTo(x,tt),y.stroke(),y.Se(),y instanceof tl&&y.ad.classList.add("gojs-td"))}},wt.kk=function(a,y,x){if(!ge.prototype.kk.call(this,a,y,x))return!1;if(na(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},wt.nk=function(a){return 1<this.lineCount||this.isUnderline||this.isStrikethrough?!0:ge.prototype.nk.call(this,a)},wt.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)}},wt.Wl=function(a,y,x,E){var b=this.Gc;this.Ih=a,this.l&=-16777217;var z=this.Ae;Is!==null&&L1!==z&&(L1=Is.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 lt=z.indexOf(`
|
|
`,rt);lt===-1&&(lt=z.length,ot=!0),rt=z.substr(rt,lt-rt),this.formatting===ep&&(rt=rt.trim()),tt=Math.max(tt,iu(rt)),rt=lt+1}z=tt}else tt=z.indexOf(`
|
|
`,0),0<=tt&&(z=z.substr(0,tt)),z=iu(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===Om&&(y=this.Ae,y=this.overflow===Om?S1(y):0,lt=this.spacingAbove+this.spacingBelow,lt=Math.max(0,tp(this)+lt),ot=Math.min(this.maxLines-1,Math.max(Math.floor(ot/lt+.01)-1,0)),!(ot+1>=this.Qb.length))){for(this.l|=16777216,lt=this.Qb[ot],y=Math.max(1,a-y);iu(lt)>y&&1<lt.length;)lt=lt.substr(0,lt.length-1);lt+=np,y=iu(lt),this.Qb[ot]=lt,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(E,tt),so(this.dc,z,tt),this.Ge(0,0,z,tt),this.svg!==null&&b!==this.Gc&&(this.Uc=!0)},wt.eh=function(a,y,x,E){ds(this,a,y,x,E)};function qg(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 Mv(a,y,x,E){var b=a.formatting===ep;b&&(y=y.trim());var z=0,tt=a.Ae,rt=a.spacingAbove+a.spacingBelow;rt=Math.max(0,tp(a)+rt);var ot=a.overflow===Om?S1(tt):0;if(a.Gc>=a.maxLines)E!==null&&E.h(0,rt);else if(tt=y,a.wrap===kv){a.Le=1;var lt=iu(y);if(ot===0||lt<=x)a.Cb=Math.max(a.Cb,lt),qg(a,y,a.Cb),E!==null&&E.h(lt,rt);else{for(z=_f(a,tt),tt=tt.substr(z.length),y=_f(a,tt),lt=iu(z+y);0<y.length&<<=x;)z+=y,tt=tt.substr(y.length),y=_f(a,tt),lt=z+y,b&&(lt=lt.trim()),lt=iu(lt);for(b&&(y=y.trim()),z+=y,x=Math.max(1,x-ot);iu(z)>x&&1<z.length;)z=z.substr(0,z.length-1);a.l|=16777216,z+=np;var ut=iu(z);a.Cb=ut,qg(a,z,ut),E!==null&&E.h(ut,rt)}}else{for(ot=0,tt.length===0&&(ot=1,qg(a,tt,0));0<tt.length;){for(y=_f(a,tt),tt=tt.substr(y.length);iu(y)>x;){var ft=1;for(lt=iu(y.substr(0,ft)),ut=0;lt<=x;)ft++,ut=lt,lt=iu(y.substr(0,ft));if(ft===1){var yt=lt;z=Math.max(z,lt)}else yt=ut,z=Math.max(z,ut);if(ft--,1>ft&&(ft=1),qg(a,y.substr(0,ft),yt),ot++,y=y.substr(ft),a.Gc+ot>a.maxLines)break}for(ut=_f(a,tt),lt=iu(y+ut);0<ut.length&<<=x;)y+=ut,tt=tt.substr(ut.length),ut=_f(a,tt),lt=y+ut,b&&(lt=lt.trim()),lt=iu(lt);if(b&&(y=y.trim()),y!==""&&(y[y.length-1]==="\xAD"&&(y=y.substring(0,y.length-1)+"\u2010"),ut.length===0?(ft=lt,z=Math.max(z,lt)):(ft=ut=iu(y),z=Math.max(z,ut)),qg(a,y,ft),ot++,a.Gc+ot>a.maxLines))break}a.Le=Math.min(a.maxLines,ot),a.Cb=Math.max(a.Cb,z),E!==null&&E.h(a.Cb,rt*a.Le)}}function _f(a,y){if(a.wrap===w1)return y.substr(0,1);for(var x=y.length,E=0,b=Sx;E<x&&!b.test(y.charAt(E));)E++;for(a.formatting===C1&&(x=Math.min(x,E+1));E<x&&b.test(y.charAt(E));)E++;return E>=y.length?y:y.substr(0,E)}function iu(a){return Is===null?8*a.length:Is.measureText(a).width}function tp(a){if(a.df!==null)return a.df;var y=a.Ae;if(Is===null){var x=16;return a.df=x}return Bv[y]!==void 0&&5e3>E1?x=Bv[y]:(x=1.3*Is.measureText("M").width,Bv[y]=x,E1++),a.df=x}function S1(a){if(Is===null)return 6;if(Im[a]!==void 0&&5e3>Av)var y=Im[a];else y=Is.measureText(np).width,Im[a]=y,Av++;return y}function x1(a,y){var x=a.ec.replace(/\r\n/g,`
|
|
`).replace(/\r/g,`
|
|
`),E=a.spacingAbove+a.spacingBelow;if(E=Math.max(0,tp(a)+E),x.length===0)return a.Cb=0,a.Gc=1,E;if(!a.isMultiline){var b=x.indexOf(`
|
|
`,0);0<=b&&(x=x.substr(0,b))}b=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!==kv){a.Le=0;var ot=on.alloc();Mv(a,z,y,ot),b+=ot.height,on.free(ot),a.Gc+=a.Le}else Mv(a,z,y,null),b+=E,a.Gc++;a.Gc===a.maxLines&&(rt=!0)}z=tt+1}return a.Lq=b}ye.Object.defineProperties(Ao.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"||(Tu(this),this.da.Or=a,this.N(),this.g("textAlign",y,a))}},flip:{get:function(){return this.da!==null?this.da.Xf:hn},set:function(a){var y=this.flip;y!==a&&(Tu(this),this.da.Xf=a,this.N(),this.g("flip",y,a))}},verticalAlignment:{get:function(){return this.da!==null?this.da.Yr:Yl},set:function(a){var y=this.verticalAlignment;y.D(a)||(a=a.J(),Tu(this),this.da.Yr=a,Ps(this),this.g("verticalAlignment",y,a))}},naturalBounds:{get:function(){if(!this.dc.w()){var a=on.alloc();Mv(this,this.ec,999999,a);var y=a.width;on.free(a),a=x1(this,y);var x=this.desiredSize;isNaN(x.width)||(y=x.width),isNaN(x.height)||(a=x.height),so(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:bv},set:function(a){var y=this.wrap;y!==a&&(Tu(this),this.da.$r=a,this.v(),this.g("wrap",y,a))}},overflow:{get:function(){return this.da!==null?this.da.$q:Nv},set:function(a){var y=this.overflow;y!==a&&(Tu(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&&_c(a,"TextBlock.stroke"),a instanceof mo&&a.freeze(),this.xc=a,this.N(),this.g("stroke",y,a))}},lineCount:{get:function(){return this.Gc}},lineHeight:{get:function(){return tp(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&&(Tu(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&&(Tu(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 Yu),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 Yu),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 Yu),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 Yu),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 Yu),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&&(Tu(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&&(Tu(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&&(Tu(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&&(Tu(this),this.da.Er=a,this.v(),this.g("spacingBelow",y,a))}},formatting:{get:function(){return this.da!==null?this.da.gq:ep},set:function(a){var y=this.formatting;y!==a&&(Tu(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&&un(a,"> 0",Ao,"maxLines"),Tu(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 Tm=null,Dm=null,kv=new rn(Ao,"None",0),P1=new rn(Ao,"WrapFit",1),bv=new rn(Ao,"WrapDesiredSize",2),w1=new rn(Ao,"WrapBreakAll",3),Nv=new rn(Ao,"OverflowClip",0),Om=new rn(Ao,"OverflowEllipsis",1),ep=new rn(Ao,"FormatTrim",0),C1=new rn(Ao,"FormatNone",0),Sx=/[ \u200b\u00ad]/,Bv=new Mi,E1=0,Im=new Mi,Av=0,np="...",L1="",Is=null,_m=!1;Ao.className="TextBlock";function Tv(){this.nc=!1,this.Hd=null,this.Xf=hn,this.gq=ep,this.Jq=1/0,this.$q=Nv,this.Er=this.Dr=0,this.Or="start",this.vj=this.Qr=this.Pr=null,this.Yr=Yl,this.$r=bv}Tv.prototype.copy=function(){var a=new Tv;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},Ao.getEllipsis=function(){return np},Ao.setEllipsis=function(a){np=a,Im=new Mi,Av=0},Ao.getBaseline=function(){return Tm},Ao.setBaseline=function(a){Tm=a},Ao.getUnderline=function(){return Dm},Ao.setUnderline=function(a){Dm=a},Ao.isValidFont=function(a){if(_m||(Is=$o?new zl(null).context:null,_m=!0),Is===null)return!0;var y=Is.font;if(a===y||a==="10px sans-serif")return!0;Is.font="10px sans-serif",Is.font=a;var x=Is.font;if(x!=="10px sans-serif")return Is.font=y,!0;Is.font="19px serif";var E=Is.font;return Is.font=a,x=Is.font,Is.font=y,x!==E},Ao.FormatNone=C1,Ao.FormatTrim=ep,Ao.None=kv,Ao.OverflowClip=Nv,Ao.OverflowEllipsis=Om,Ao.WrapBreakAll=w1,Ao.WrapDesiredSize=bv,Ao.WrapFit=P1;function Yu(){this.Tk=1,this.u=0,this.j=1,this.o=this.F=null}Yu.prototype.copy=function(){var a=new Yu;return a.Tk=this.Tk,a.u=this.u,a.j=this.j,a.F=this.F,a.o=this.o,a},Yu.className="GradElementSettings";function _s(a,y){ge.call(this),this.Eg=null,this.qo="",this.Xg=As,this.Nk=Sn,this.Zg=this.Hd=null,this.Mk=lr,this.Xf=hn,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 Rf;Se(_s,ge),_s.prototype.cloneProtected=function(a){ge.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},_s.prototype.qb=function(a){a===hn||a===xi||a===Zr?this.imageStretch=a:ge.prototype.qb.call(this,a)},_s.prototype.toString=function(){return"Picture("+this.source+")#"+ji(this)};function jf(a){a===void 0&&(a=""),a!==""?Rf[a]&&(delete Rf[a],Rm--):(Rf=new Mi,Rm=0)}function F1(a,y){y.qy||(y.Fq=function(x){y.sq=!0,y.ln=!1;var E=y.Bg.copy();if(E!=null){for(E=E.iterator;E.next();){var b=E.value;b.N();var z=y.getAttribute("src")||"",tt=b.Og.I(z);if(tt!==null)for(var rt=tt.length,ot=0;ot<rt;ot++)z=tt[ot],b.Xn.add(z),z.Uc=!0,b.$b(),y.hn&&(y.eu===void 0&&(y.eu=x),z.Zg!==null&&z.Zg(z,x))}y.Bg.clear()}a.desiredSize.w()||(ya(a,!1),a.v())},y.Yp=function(x){y.ln=x;var E=y.Bg.copy();if(E!=null){for(E=E.iterator;E.next();){var b=E.value,z=y.getAttribute("src")||"",tt=b.Og.I(z);if(tt!==null){b=tt.length,z=Yn();for(var rt=0;rt<b;rt++)z.push(tt[rt]);if(y.hn)for(rt=0;rt<b;rt++)tt=z[rt],tt.Hd!==null&&tt.Hd(tt,x);si(z)}}y.Bg.clear()}},y.addEventListener("load",y.Fq),y.addEventListener("error",y.Yp),y.qy=!0)}_s.prototype.hA=function(){if(this.source!==""){jf(this.source);var a=this.source;this.source="",this.source=a}},_s.prototype.redraw=function(){this.N(),this.Uc=!0},_s.prototype.hh=function(a,y){var x=this.Eg;if(x!==null){var E=x.getAttribute("src");if(!(x instanceof HTMLImageElement&&(E===null||E==="")||x.ln instanceof Event&&a instanceof Qd)){var b=a instanceof tl;E=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||E.width,rt=rt||E.height,ot!==0&&rt!==0){var lt=ot,ut=rt;this.sourceRect.w()&&(z=this.Xg.x,tt=this.Xg.y,ot=this.Xg.width,rt=this.Xg.height);var ft=ot,yt=rt,xt=this.Nk,Ct=this.Mk;switch(xt){case hn:if(this.sourceRect.w())break;ft>=E.width&&(z=z+Ct.offsetX+(ft*Ct.x-E.width*Ct.x)),yt>=E.height&&(tt=tt+Ct.offsetY+(yt*Ct.y-E.height*Ct.y)),ot=Math.min(E.width,ft),rt=Math.min(E.height,yt);break;case Sn:ft=E.width,yt=E.height;break;case xi:case Zr:xt===xi?(xt=Math.min(E.height/yt,E.width/ft),ft*=xt,yt*=xt):xt===Zr&&(xt=Math.max(E.height/yt,E.width/ft),ft*=xt,yt*=xt,ft>=E.width&&(z=(z+Ct.offsetX+(ft*Ct.x-E.width*Ct.x)/ft)*ot),yt>=E.height&&(tt=(tt+Ct.offsetY+(yt*Ct.y-E.height*Ct.y)/yt)*rt),ot*=1/(ft/E.width),rt*=1/(yt/E.height),ft=E.width,yt=E.height)}xt=this.Df()*y.scale;var bt=ft*xt*yt*xt,Vt=ot*rt/bt,zt=x.__goCache;xt=null;var Qt=xx;if(!b){if(x.sq&&zt!==void 0&&4<bt&&Vt>Qt*Qt)for(zt.gi===null&&(k1(zt,4,lt,ut,x),k1(zt,16,lt,ut,x)),b=zt.gi,lt=b.length,ut=0;ut<lt&&b[ut].ratio*b[ut].ratio<Vt;ut++)xt=b[ut];if(!y.Xm){if(this.vl===null)if(this.Eg===null)this.vl=!1;else{b=new zl(null).context;try{b.drawImage(this.Eg,0,0)}catch(ee){this.en=!1}try{b.getImageData(0,0,1,1).data[3]&&(this.vl=!1),this.vl=!1}catch(ee){this.vl=!0}}if(this.vl)return}}switch(b=ft<E.width?Ct.offsetX+(E.width*Ct.x-ft*Ct.x):0,Ct=yt<E.height?Ct.offsetY+(E.height*Ct.y-yt*Ct.y):0,this.flip){case Ur:a.translate(Math.min(E.width,ft),0),a.scale(-1,1);break;case xr:a.translate(0,Math.min(E.height,yt)),a.scale(1,-1);break;case Eo:a.translate(Math.min(E.width,ft),Math.min(E.height,yt)),a.scale(-1,-1)}if(a.yc(),y.Gf("pictureRatioOptimization")&&!y.$i&&zt!==void 0&&xt!==null&&xt.ratio!==1){a.save(),y=xt.ratio;try{a.drawImage(xt.source,z/y,tt/y,Math.min(xt.source.width,ot/y),Math.min(xt.source.height,rt/y),b,Ct,Math.min(E.width,ft),Math.min(E.height,yt)),a instanceof tl&&(this.bt=[z/y,tt/y,Math.min(xt.source.width,ot/y),Math.min(xt.source.height,rt/y),b,Ct,Math.min(E.width,ft),Math.min(E.height,yt)])}catch(ee){this.en=!1}a.restore()}else try{a.drawImage(x,z,tt,ot,rt,b,Ct,Math.min(E.width,ft),Math.min(E.height,yt)),a instanceof tl&&(this.bt=[z,tt,ot,rt,b,Ct,Math.min(E.width,ft),Math.min(E.height,yt)])}catch(ee){this.en=!1}switch(this.flip){case Ur:a.scale(-1,1),a.translate(-Math.min(E.width,ft),0);break;case xr:a.scale(1,-1),a.translate(0,-Math.min(E.height,yt));break;case Eo:a.scale(-1,-1),a.translate(-Math.min(E.width,ft),-Math.min(E.height,yt))}}}}},_s.prototype.Wl=function(a,y,x,E){var b=this.desiredSize,z=Os(this,!0),tt=this.Eg,rt=this.qn,ot=0,lt=0;(rt||!this.al&&tt&&tt.complete)&&(this.al=!0),tt===null?(isFinite(b.width)||(a=0),isFinite(b.height)||(y=0)):(ot=rt?+tt.width:tt.naturalWidth,lt=rt?+tt.height:tt.naturalHeight),isFinite(b.width)||z===Sn||z===Fi?(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(b.height)||z===Sn||z===Ri?(isFinite(y)||(this.sourceRect.w()?y=this.sourceRect.height:tt!==null&&(y=lt)),E=0):tt!==null&&this.al!==!1&&(y=this.sourceRect.w()?this.sourceRect.height:lt),isFinite(b.width)&&(a=b.width),isFinite(b.height)&&(y=b.height),b=this.maxSize,z=this.minSize,x=Math.max(x||0,z.width),E=Math.max(E||0,z.height),a=Math.min(b.width,a),y=Math.min(b.height,y),a=Math.max(x,a),y=Math.max(E,y),tt===null||tt.complete||(isFinite(a)||(a=0),isFinite(y)||(y=0)),so(this.dc,a,y),this.Ge(0,0,a,y)},_s.prototype.eh=function(a,y,x,E){ds(this,a,y,x,E)},ye.Object.defineProperties(_s.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||Gt("Picture.element must be an instance of Image, Canvas, or Video, not: "+a);var E=this.diagram;E!==null&&Og(E,this),this.Eg=a,a!==null&&x&&a.Bg===void 0&&(a.Bg=new pn),E!==null&&x&&ld(E,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()||(ya(this,!1),this.v())):x&&F1(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=Rf;if($o){var E=null;if(x[a]!==void 0)E=x[a];else if(a!==""){30<Rm&&(jf(),x=Rf),E=Xi("img"),E.hn=!0,F1(this,E);var b=this.rl;b!==null&&(E.crossOrigin=b(this)),E.src=a,x[a]=E,Rm++}this.element=E,E!==null&&E.__goCache===void 0&&(E.__goCache=new M1),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}}}),_s.prototype.redraw=_s.prototype.redraw,_s.prototype.reloadSource=_s.prototype.hA;var Rm=0,xx=4;_s.className="Picture",Rf=new Mi,_s.clearCache=jf;function M1(){this.gi=null}function k1(a,y,x,E,b){a.gi===null&&(a.gi=[]);var z=new zl(null),tt=z.context,rt=1/y;z.width=x/y,z.height=E/y,z.width!==0&&z.height!==0&&(y=new b1(z.Oa,y),x=1,0<a.gi.length&&(x=a.gi[a.gi.length-1],b=x.source,x=x.ratio),tt.setTransform(rt*x,0,0,rt*x,0,0),tt.yc(),tt.drawImage(b,0,0),a.gi.push(y))}M1.className="PictureCacheArray";function b1(a,y){this.source=a,this.ratio=y}b1.className="PictureCacheInstance";function zf(){this.os=new fe,this.mc=null}zf.prototype.reset=function(a){a!==null?(a.ka(),this.os=a,a.figures.clear()):this.os=new fe,this.mc=null};function Zf(a,y,x,E,b,z){a.mc=new Dr,a.mc.startX=y,a.mc.startY=x,a.mc.isFilled=E,a.mc.isEvenOdd=z||!1,a.os.figures.add(a.mc),b!==void 0&&(a.mc.isShadowed=b)}function Px(a){var y=a.mc.segments.length;0<y&&a.mc.segments.M(y-1).close()}zf.prototype.moveTo=function(a,y,x){x===void 0&&(x=!1);var E=new Ki(ir);E.endX=a,E.endY=y,x&&E.close(),this.mc.segments.add(E)},zf.prototype.lineTo=function(a,y,x){x===void 0&&(x=!1);var E=new Ki(Ji);E.endX=a,E.endY=y,x&&E.close(),this.mc.segments.add(E)};function Dh(a,y,x,E,b,z,tt){var rt;rt===void 0&&(rt=!1);var ot=new Ki(Mr);ot.point1X=y,ot.point1Y=x,ot.point2X=E,ot.point2Y=b,ot.endX=z,ot.endY=tt,rt&&ot.close(),a.mc.segments.add(ot)}function jm(a,y,x,E,b){var z;z===void 0&&(z=!1);var tt=new Ki(Lr);tt.point1X=y,tt.point1Y=x,tt.endX=E,tt.endY=b,z&&tt.close(),a.mc.segments.add(tt)}zf.prototype.arcTo=function(a,y,x,E,b,z,tt){z===void 0&&(z=0),tt===void 0&&(tt=!1);var rt=new Ki(Br);rt.startAngle=a,rt.sweepAngle=y,rt.centerX=x,rt.centerY=E,rt.radiusX=b,rt.radiusY=z!==0?z:b,tt&&rt.close(),this.mc.segments.add(rt)};function wx(a,y,x,E,b,z,tt,rt){var ot;ot===void 0&&(ot=!1),y=new Ki(io,tt,rt,y,x,E,b,z),ot&&y.close(),a.mc.segments.add(y)}function N1(a){var y=zm;return y!==null?(zm=null,y.reset(a),y):(y=new zf,y.reset(a),y)}var zm=null;zf.className="StreamGeometryContext";function ls(a,y){var x=a.toLowerCase(),E=_t.Ze;E[a]=y,E[x]=a}ls("Rectangle",function(a,y,x){a="r"+y+","+x;var E=_t.Mf[a];return E!==void 0||(E=new fe(fe.u),E.endX=y,E.endY=x,_t.Nf<_t.vm&&(_t.Mf[a]=E,_t.Nf++)),E}),ls("Square",function(a,y,x){a="s"+y+","+x;var E=_t.Mf[a];return E!==void 0||(E=new fe(fe.u),E.endX=y,E.endY=x,E.defaultStretch=xi,_t.Nf<_t.vm&&(_t.Mf[a]=E,_t.Nf++)),E}),ls("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 E="rr"+y+","+x+","+a,b=_t.Mf[E];if(b!==void 0)return b;var z=a*_t.wg;return b=new fe().add(new Dr(a,0,!0).add(new Ki(Ji,y-a,0)).add(new Ki(Mr,y,a,y-z,0,y,z)).add(new Ki(Ji,y,x-a)).add(new Ki(Mr,y-a,x,y,x-z,y-z,x)).add(new Ki(Ji,a,x)).add(new Ki(Mr,0,x-a,z,x,0,x-z)).add(new Ki(Ji,0,a)).add(new Ki(Mr,a,0,0,z,z,0).close())),1<z&&(b.spot1=new fi(0,0,z,z),b.spot2=new fi(1,1,-z,-z)),_t.Nf<_t.vm&&(_t.Mf[E]=b,_t.Nf++),b}),ls("Border","RoundedRectangle"),ls("Ellipse",function(a,y,x){a="e"+y+","+x;var E=_t.Mf[a];return E!==void 0||(E=new fe(fe.F),E.endX=y,E.endY=x,E.spot1=Tl,E.spot2=ma,_t.Nf<_t.vm&&(_t.Mf[a]=E,_t.Nf++)),E}),ls("Circle",function(a,y,x){a="c"+y+","+x;var E=_t.Mf[a];return E!==void 0||(E=new fe(fe.F),E.endX=y,E.endY=x,E.spot1=Tl,E.spot2=ma,E.defaultStretch=xi,_t.Nf<_t.vm&&(_t.Mf[a]=E,_t.Nf++)),E}),ls("TriangleRight",function(a,y,x){return new fe().add(new Dr(0,0).add(new Ki(Ji,y,.5*x)).add(new Ki(Ji,0,x).close())).pm(0,.25,.5,.75)}),ls("TriangleDown",function(a,y,x){return new fe().add(new Dr(0,0).add(new Ki(Ji,y,0)).add(new Ki(Ji,.5*y,x).close())).pm(.25,0,.75,.5)}),ls("TriangleLeft",function(a,y,x){return new fe().add(new Dr(y,x).add(new Ki(Ji,0,.5*x)).add(new Ki(Ji,y,0).close())).pm(.5,.25,1,.75)}),ls("TriangleUp",function(a,y,x){return new fe().add(new Dr(y,x).add(new Ki(Ji,0,x)).add(new Ki(Ji,.5*y,0).close())).pm(.25,.5,.75,1)}),ls("Triangle","TriangleUp"),ls("Diamond",function(a,y,x){return new fe().add(new Dr(.5*y,0).add(new Ki(Ji,0,.5*x)).add(new Ki(Ji,.5*y,x)).add(new Ki(Ji,y,.5*x).close())).pm(.25,.25,.75,.75)}),ls("LineH",function(a,y,x){return a=new fe(fe.j),a.startX=0,a.startY=x/2,a.endX=y,a.endY=x/2,a}),ls("LineV",function(a,y,x){return a=new fe(fe.j),a.startX=y/2,a.startY=0,a.endX=y/2,a.endY=x,a}),ls("None","Rectangle"),ls("BarH","Rectangle"),ls("BarV","Rectangle"),ls("MinusLine","LineH"),ls("PlusLine",function(a,y,x){return new fe().add(new Dr(0,x/2,!1).add(new Ki(Ji,y,x/2)).add(new Ki(ir,y/2,0)).add(new Ki(Ji,y/2,x)))}),ls("XLine",function(a,y,x){return new fe().add(new Dr(0,x,!1).add(new Ki(Ji,y,0)).add(new Ki(ir,0,0)).add(new Ki(Ji,y,x)))}),ls("LineRight",function(a,y,x){return new fe().add(new Dr(.25*y,0,!1).add(new Ki(Ji,.75*y,.5*x)).add(new Ki(Ji,.25*y,x)))}),ls("LineDown",function(a,y,x){return new fe().add(new Dr(0,.25*x,!1).add(new Ki(Ji,.5*y,.75*x)).add(new Ki(Ji,y,.25*x)))}),ls("LineLeft",function(a,y,x){return new fe().add(new Dr(.75*y,0,!1).add(new Ki(Ji,.25*y,.5*x)).add(new Ki(Ji,.75*y,x)))}),ls("LineUp",function(a,y,x){return new fe().add(new Dr(0,.75*x,!1).add(new Ki(Ji,.5*y,.25*x)).add(new Ki(Ji,y,.75*x)))}),_t.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 Dv(){this.nc=!1,this.tr=this.Kp=this.zq=null,this.vr="",this.fr=this.oq=this.ur=null,this.hr="",this.gr=qr,this.ir=null,this.jr="",this.lr=wa,this.Gq="",this.Hq=_r,this.Pq=Jn,this.Kq=Ci,this.Up=null,this.Cq=127,this.zr=Si,this.yr="gray",this.Vg=4}Dv.prototype.copy=function(){var a=new Dv;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 Bi(a,y){a===void 0||a instanceof Ea||typeof a=="string"?wn.call(this,a):(wn.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 At(NaN,NaN).freeze(),this.nf=null,this.Ao=NaN,this.vw=-1,this.py=new Be,this.Rh=null,this.ag=NaN,y&&Object.assign(this,y)}Se(Bi,wn),Bi.prototype.cloneProtected=function(a){wn.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},wt=Bi.prototype,wt.Af=function(a){wn.prototype.Af.call(this,a),a.oh(),a.Ug=null,a.nf=null,a.Rh=null},wt.toString=function(){var a=ei(this.constructor)+"#"+ji(this);return this.data!==null&&(a+="("+Ii(this.data)+")"),a};function Rs(a){a.P===null?a.P=new Dv:a.P.nc&&(a.P=a.P.copy())}wt.th=function(){wn.prototype.th.call(this),this.P!==null&&(this.P.nc=!0)},wt.gk=function(a,y,x,E,b,z,tt){var rt=this.diagram;rt!==null&&(a===ro&&y==="elements"?b instanceof wn?$d(b,function(ot){sy(rt.partManager,ot),Wd(rt,ot)}):ld(rt,b):a===So&&y==="elements"&&(b instanceof wn?$d(b,function(ot){ly(rt.partManager,ot,rt)}):Og(rt,b)),rt.cb(a,y,x,E,b,z,tt))},wt.La=function(a){if(wn.prototype.La.call(this,a),this.data!==null){for(var y=this.O.s,x=y.length,E=0;E<x;E++){var b=y[E];b instanceof wn&&$d(b,function(z){z.data!==null&&z.La()})}for(y=this.adornments;y.next();)y.value.La(a)}},Bi.prototype.updateRelationshipsFromData=function(){var a;this.data!==null&&((a=this.diagram)===null||a===void 0||a.partManager.updateRelationshipsFromData(this))},Bi.prototype.Pj=function(a){var y=this.Qf;return y===null?null:y.I(a)},Bi.prototype.bh=function(a,y){if(y!==null){var x=null,E=this.Qf;if(E!==null&&(x=E.I(a)),x!==y){if(x!==null){var b=x.diagram;b!==null&&b.remove(x)}E===null&&(this.Qf=E=new be),y.Tf!==a&&(y.category=a),E.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)))}}},Bi.prototype.Jf=function(a){var y=this.Qf;if(y!==null){var x=y.I(a);if(x!==null){var E=x.diagram;E!==null&&E.remove(x)}y.remove(a),y.count===0&&(this.Qf=null)}},Bi.prototype.Ej=function(){var a=this.Qf;if(a!==null){var y=Yn();for(a=a.iterator;a.next();)y.push(a.key);a=y.length;for(var x=0;x<a;x++)this.Jf(y[x]);si(y)}},Bi.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 er?a.groupSelectionAdornmentTemplate:a.nodeSelectionAdornmentTemplate),!(x instanceof Qr))break t;Zl(x),x=x.copy(),x!==null&&(this.ph()&&this.selectionObject===this.path&&(x.type=wn.Link),x.adornedObject=y)}if(x!==null){x.type===wn.Link&&x.v(),this.bh("Selection",x);break t}}this.Jf("Selection")}for(Cx(this,a),y=this.adornments;y.next();)y.value.La()}},Bi.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 Zm(a){if(cd(a)===!1){_v(a,!0),a.Uk();var y=a.diagram;y!==null&&(y.De.add(a),y.$b())}}function B1(a){if(a.G|=2097152,cd(a)!==!1){var y=a.position,x=a.location;x.w()&&y.w()||D1(a,y,x),x=a.Ib;var E=Be.alloc().assign(x);x.ka(),x.x=y.x,x.y=y.y,x.freeze(),a.Xl(E,x),Be.free(E),_v(a,!1)}}Bi.prototype.Ge=function(a,y,x,E){var b=this.uc;b.h(a,y,x,E),this.Lb===null&&(this.Lb=new ae);var z=this.Lb;z.reset(),this.no(z,a,y,x,E),this.Lb=z,z.ws()||z.pp(b)},Bi.prototype.no=function(a,y,x,E,b){if(this.Ca!==1&&a.scale(this.Ca),this.Kb!==0){var z=lr;this.locationSpot.sb()&&(z=this.locationSpot);var tt=At.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,E,b,z);a.rotate(this.Kb,tt.x,tt.y),At.free(tt)}},Bi.prototype.move=function(a,y){y===!0?this.location=a:this.position=a},Bi.prototype.moveTo=function(a,y,x){a=At.allocAt(a,y),this.move(a,x),At.free(a)},Bi.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())},Bi.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())},Bi.prototype.fb=function(a){if(this.name===a)return this;var y=this.Rh;if(y===null&&(this.Rh=y=new be),y.I(a)!==null)return y.I(a);var x=wn.prototype.fb.call(this,a);return x!==null?(y.set(a,x),x):(y.set(a,null),null)};function Oh(a,y,x,E){E===void 0&&(E=new At),x=x.Mc()?lr:x;var b=y.naturalBounds;if(E.h(b.width*x.x+x.offsetX,b.height*x.y+x.offsetY),y===null||y===a)return E;for(y.transform.Ga(E),y=y.panel;y!==null&&y!==a;)y.transform.Ga(E),y=y.panel;return a.Lb!==null&&a.Lb.Ga(E),E.offset(-a.uc.x,-a.uc.y),E}Bi.prototype.mi=function(a){return a===void 0&&(a=new Be),a.assign(this.actualBounds)},Bi.prototype.Va=function(){this.measure(1/0,1/0),this.arrange()};function A1(a){var y=At.alloc(),x=a.locationObject,E=x.naturalBounds,b=x instanceof cr?x.strokeWidth:0;if(y.yi(0,0,E.width+b,E.height+b,a.locationSpot),x!==a)for(y.offset(-b/2,-b/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 ec(a,y){var x=a.py;isNaN(a.ag)&&(a.ag=u1(a));var E=a.ag,b=2*E;if(!a.isShadowed)return x.h(y.x-1-E,y.y-1-E,y.width+2+b,y.height+2+b),x;E=y.x,b=y.y;var z=y.width;y=y.height;var tt=a.shadowBlur;return a=a.shadowOffset,z+=tt,y+=tt,E-=tt/2,b-=tt/2,0<a.x?z+=a.x:(E+=a.x,z-=a.x),0<a.y?y+=a.y:(b+=a.y,y-=a.y),x.h(E-1,b-1,z+2,y+2),x}Bi.prototype.arrange=function(){if(ws(this)===!1)B1(this);else{Wu(this,!1);var a=this.Ib,y=Be.alloc();y.assign(a);var x=fd(this);this.eh(0,0,this.uc.width,this.uc.height);var E=this.position;D1(this,E,this.location),a.ka(),a.x=E.x,a.y=E.y,a.freeze(),this.Xl(y,a),y.D(a)?this.Fd(x):!this.Zc()||_t.B(y.width,a.width)&&_t.B(y.height,a.height)||0<=this.vw&&this.C(16),Be.free(y),_v(this,!1)}},wt=Bi.prototype,wt.Xl=function(a,y){var x=this.diagram;if(x!==null){var E=!1;if(x.Zi===!1&&a.w()){var b=Be.alloc();b.assign(x.documentBounds),b.Fv(x.padding),a.x>b.x&&a.y>b.y&&a.right<b.right&&a.bottom<b.bottom&&y.x>b.x&&y.y>b.y&&y.right<b.right&&y.bottom<b.bottom&&(E=!0),Be.free(b)}!(this.G&65536)&&a.D(y)||_1(this,E,x),x.N(),!a.w()&&!y.w()||Hr(a,y)||(this instanceof $n&&!x.undoManager.isUndoingRedoing&&this.Bd(),this.oh())}},wt.zv=function(a,y,x){if(this.ph()||!a.w())return!1;var E=this.diagram;return E!==null&&T1(this,E,a,y,x),this.pa=a,this.G&=-2097153,!this.ke.w()||E!==null&&!E.animationManager.isTicking&&E.undoManager.isUndoingRedoing||(E=this.ke,this.ke=new At(E.x+(a.x-y),E.y+(a.y-x)),this.g("location",E,this.ke.copy())),cd(this)===!1&&ws(this)===!1&&(Zm(this),B1(this)),!0};function T1(a,y,x,E,b){y===null||a instanceof Qr||(y=y.animationManager,y.zb&&cf(y,a,new At(E,b),x))}wt.mm=function(a,y,x){var E=this.ke,b=this.pa;if(x){if(E.x===a&&E.y===y)return;cd(this)||ws(this)?b.h(NaN,NaN):b.h(b.x+a-E.x,b.y+y-E.y),E.h(a,y)}else{if(b.x===a&&b.y===y)return;E.h(E.x+a-b.x,E.y+y-b.y),b.h(a,y)}Zm(this)},wt.Av=function(){this.G&=-2097153,Zm(this)};function D1(a,y,x){var E=A1(a),b=a.diagram,z=x.w(),tt=y.w();z&&tt?a.G&2097152?O1(a,y,x,b,E):I1(a,y,x,b,E):z?O1(a,y,x,b,E):tt&&I1(a,y,x,b,E),a.G|=2097152,At.free(E),a.Uk()}function O1(a,y,x,E,b){var z=y.x,tt=y.y;y.h(x.x-b.x,x.y-b.y),E!==null&&(x=E.animationManager,(E=x.defaultAnimation.isAnimating)||!x.zb||a instanceof Qr||cf(x,a,new At(z,tt),y),E||y.x===z&&y.y===tt||a.g("position",new At(z,tt),y.copy()))}function I1(a,y,x,E,b){var z=x.copy();x.h(y.x+b.x,y.y+b.y),x.D(z)||E===null||a.g("location",z,x.copy())}function _1(a,y,x){Rv(a,!1),a instanceof $n&&kh(x,a),a.layer.isTemporary||y||x.Ya(),y=a.Ib;var E=x.viewportBounds;E.w()?fd(a)?(Lo(y,E)||a.Fd(!1),a.updateAdornments()):a.isVisible()&&y.Yc(E)?(a.Fd(!0),a.updateAdornments()):a.Wb():x.vd=!0}wt.si=function(){return!0},wt.Zc=function(){return!0},wt.ph=function(){return!1},wt.Dd=function(){return!0};function Iv(a,y,x,E){y.constructor===a.constructor||z1||(z1=!0,Mn('Should not change the class of the Part when changing category from "'+x+'" to "'+E+'"'),Mn(" Old class: "+ei(a.constructor)+", new class: "+ei(y.constructor)+", part: "+a.toString())),a.Ej();var b=a.data;x=a.layerName;var z=a.isSelected,tt=a.isHighlighted,rt=!0,ot=!0,lt=!1;a instanceof $n&&(rt=a.isTreeLeaf,ot=a.isTreeExpanded,lt=a.wasTreeExpanded),y.Af(a),y.cloneProtected(a),a.Tf=E,a.svg!==null&&(a.svg.remove(),a.svg=null,a.Uc=!0),a.v(),a.N(),y=a.diagram,E=!0,y!==null&&(E=y.skipsUndoManager,y.skipsUndoManager=!0),a.ub=b,a.G=z?a.G|4096:a.G&-4097,a.G=tt?a.G|524288:a.G&-524289,a instanceof $n&&(a.U=rt?a.U|4:a.U&-5,a.U=ot?a.U|1:a.U&-2,a.U=lt?a.U|2:a.U&-3),b!==null&&a.La(),b=a.layerName,b!==x&&(a.Jg=x,a.layerName=b),y!==null&&(y.skipsUndoManager=E),a.Zc()&&a.C(64)}Bi.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},Bi.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},Bi.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},Bi.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},Bi.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},Bi.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},Bi.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},Bi.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},Bi.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 cd(a){return(a.G&32768)!==0}function _v(a,y){a.G=y?a.G|32768:a.G&-32769}function Rv(a,y){a.G=y?a.G|65536:a.G&-65537}function fd(a){return(a.G&131072)!==0}wt=Bi.prototype,wt.Fd=function(a){this.G=a?this.G|131072:this.G&-131073};function Gm(a,y){a.G=y?a.G|1048576:a.G&-1048577}wt.oh=function(){var a=this.containingGroup;a!==null&&(a.v(),a.placeholder!==null&&a.placeholder.v(),a.Bd())},wt.N=function(){var a=this.diagram;a!==null&&!ws(this)&&!cd(this)&&this.isVisible()&&this.Ib.w()&&a.N(ec(this,this.Ib))},wt.v=function(){wn.prototype.v.call(this);var a=this.diagram;a!==null&&(a.De.add(this),this instanceof $n&&this.labeledLink!==null&&Ps(this.labeledLink),a.$b(!0))},wt.Vo=function(a){a||(a=this.Ah,a!==null&&Wv(a,this))},wt.Wo=function(a){a||(a=this.Ah,a!==null&&Vv(a,this))},wt.Lj=function(){var a=this.data;if(a!==null){var y=this.diagram;y!==null&&(y=y.model,y!==null&&y.cm(a))}},wt.oz=function(){return jv(this,this)};function jv(a,y){var x=y.containingGroup;return x!==null?1+jv(a,x):y instanceof $n&&(y=y.labeledLink,y!==null)?jv(a,y):0}wt.sz=function(){return R1(this,this)};function R1(a,y){var x=y.containingGroup;return x!==null||y instanceof $n&&(x=y.labeledLink,x!==null)?R1(a,x):y}wt.Td=function(a){return a instanceof er?zv(this,this,a):!1};function zv(a,y,x){if(y===x||x===null)return!1;var E=y.containingGroup;return E===null||E!==x&&!zv(a,E,x)?y instanceof $n&&(y=y.labeledLink,y!==null)?zv(a,y,x):!1:!0}wt.px=function(a){if(a===null)return null;if(this===a)return this.containingGroup;for(var y=this;y!==null;){if(y instanceof er&&Gm(y,!0),y instanceof $n){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 $n&&(a=y.labeledLink,a!==null&&(y=a)),y=y.containingGroup}for(y=this;y!==null;)y instanceof er&&Gm(y,!1),y instanceof $n&&(a=y.labeledLink,a!==null&&(y=a)),y=y.containingGroup;return x},Bi.prototype.canLayout=function(){if(!this.isLayoutPositioned||!this.isVisible())return!1;var a=this.layer;return!(a!==null&&a.isTemporary||this instanceof $n&&this.isLinkLabel)},Bi.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 $n&&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 j1(a){return a.isVisible()?(a=a.layer,!(a!==null&&a.isTemporary)):!1}function gd(a,y,x,E,b,z){if(z===void 0&&(z=null),!(a.contains(y)||z!==null&&!z(y)||y instanceof Qr)){if(a.add(y),y instanceof $n){if(x&&y instanceof er)for(var tt=y.memberParts;tt.next();)gd(a,tt.value,x,E,b,z);if(b!==!1)for(tt=y.linksConnected;tt.next();){var rt=tt.value;if(!a.contains(rt)){var ot=rt.fromNode,lt=rt.toNode;ot=ot===null||a.contains(ot),lt=lt===null||a.contains(lt),(b?ot&<:ot||lt)&&gd(a,rt,x,E,b,z)}}if(1<E)for(y=y.Ou();y.next();)gd(a,y.value,x,E-1,b,z)}else if(y instanceof Nn)for(y=y.labelNodes;y.next();)gd(a,y.value,x,E,b,z)}}ye.Object.defineProperties(Bi.prototype,{key:{get:function(){var a=this.diagram;if(a!==null)return a.model.wa(this.data)}},adornments:{get:function(){return this.Qf===null?pr: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 E=y.pc(-1,this,!0);if(0<=E&&x.cb(So,"parts",y,this,null,E,!0),E=a.oi(99999999,this,!0),y.visible!==a.visible&&this.Zb(a.visible),0<=E&&x.cb(ro,"parts",a,null,this,!0,E),E=this.layerChanged,E!==null){var b=x.aa;x.aa=!0,E(this,y,a),x.aa=b}}}}},layerChanged:{get:function(){return this.P!==null?this.P.zq:null},set:function(a){var y=this.layerChanged;y!==a&&(Rs(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&&pf(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 Qr?this.type!==wn.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:Jn},set:function(a){var y=this.minLocation;y.D(a)||(a=a.J(),Rs(this),this.P.Pq=a,this.g("minLocation",y,a))}},maxLocation:{get:function(){return this.P!==null?this.P.Kq:Ci},set:function(a){var y=this.maxLocation;y.D(a)||(a=a.J(),Rs(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&&(Rs(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:_r},set:function(a){var y=this.locationSpot;y.D(a)||(a=a.J(),Rs(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,E=this.ke;if(!(E.x===y||isNaN(E.x)&&isNaN(y))||!(E.y===x||isNaN(E.y)&&isNaN(x))){if(a=a.copy(),y=a,this.ph())y=!1;else{if(this.ke=y,this.G|=2097152,ws(this)===!1&&(Zm(this),x=this.pa,x.w())){var b=this.diagram;if(b===null||b.animationManager.isTicking||!b.undoManager.isUndoingRedoing){var z=x.copy();x.h(x.x+(y.x-E.x),x.y+(y.y-E.y)),T1(this,b,x,z.x,z.y),this.g("position",z,x.copy())}}y=!0}y&&this.g("location",E,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,E=this.data,b=null;if(x!==null&&E!==null&&!(this instanceof Qr)){var z=x.model.undoManager;z.isEnabled&&!z.isUndoingRedoing&&(b=this.clone(),b.O.addAll(this.O))}this.Tf=a,this.g("category",y,a),x===null||E===null||this instanceof Qr?this instanceof Qr&&(b=this.adornedPart,b!==null&&(a=b.Qf,a!==null&&a.remove(y),b.bh(this.category,this))):(z=x.model,z.undoManager.isUndoingRedoing||(this.ph()?(x.partManager.setLinkCategoryForData(E,a),x=x.partManager.findLinkTemplateForCategory(a),x!==null&&(Zl(x),x=x.copy(),x!==null&&Iv(this,x,y,a))):(z!==null&&z.jm(E,a),x=dS(x.partManager,E,a),x!==null&&(Zl(x),x=x.copy(),x===null||x instanceof Nn||(E=this.location.copy(),Iv(this,x,y,a),this.location.w()||(this.location=E)))),b!==null&&(y=this.clone(),y.O.addAll(this.O),this.g("self",b,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 E=!1;if(x!==null){E=x.skipsUndoManager,x.skipsUndoManager=!0;var b=x.selection;b.ka(),a?b.add(this):b.remove(this),b.freeze()}this.g("isSelected",y,a),this.Wb(),a=this.selectionChanged,a!==null&&a(this),x!==null&&(x.$b(),x.skipsUndoManager=E)}}}},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&&(Rs(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&&(Rs(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&&(Rs(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 Nn?(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&&(Rs(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&&(Rs(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&&(Rs(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:qr},set:function(a){var y=this.resizeCellSize;y.D(a)||(a=a.J(),Rs(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&&(Rs(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&&(Rs(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:wa},set:function(a){var y=this.rotationSpot;y.D(a)||(a=a.J(),Rs(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&&Gt("Cannot make a Group a member of itself: "+this.toString()),Gt("Cannot make a Group indirectly contain itself: "+this.toString()+" already contains "+a.toString())),this.C(2);var x=this.diagram;if(y!==null?Vv(y,this):this instanceof er&&x!==null&&x.ai.remove(this),this.Ah=a,a!==null?Wv(a,this):this instanceof er&&x!==null&&x.ai.add(this),this.C(1),x!==null&&x.aa){var E=this.data,b=x.model;if(E!==null&&b.Xj()){var z=b.wa(a!==null?a.data:null);b.mp(E,z)}}if(E=this.containingGroupChanged,E!==null&&(b=!0,x!==null&&(b=x.aa,x.aa=!0),E(this,y,a),x!==null&&(x.aa=b)),this instanceof er){for(x=new pn,gd(x,this,!0,0,!0),x=x.iterator;x.next();)if(E=x.value,E instanceof $n)for(E=E.linksConnected;E.next();)Gf(E.value)}if(this instanceof $n){for(x=this.linksConnected;x.next();)Gf(x.value);x=this.labeledLink,x!==null&&Gf(x)}this.g("containingGroup",y,a),a!==null&&(y=a.layer,y!==null&&pf(y,-1,a))}}else Gt("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&&(Rs(this),this.P.Kp=a,this.g("containingGroupChanged",y,a))}},isTopLevel:{get:function(){return!(this.containingGroup!==null||this instanceof $n&&this.labeledLink!==null)}},layoutConditions:{get:function(){return this.P!==null?this.P.Cq:127},set:function(a){var y=this.layoutConditions;y!==a&&(Rs(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&&(Rs(this),this.P.Up=a,this.g("dragComputation",y,a))}},shadowOffset:{get:function(){return this.P!==null?this.P.zr:Si},set:function(a){var y=this.shadowOffset;y.D(a)||(a=a.J(),Rs(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&&(Rs(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&&(Rs(this),this.P.Vg=a,this.N(),this.g("shadowBlur",y,a))}}}),Bi.prototype.invalidateLayout=Bi.prototype.C,Bi.prototype.findCommonContainingGroup=Bi.prototype.px,Bi.prototype.isMemberOf=Bi.prototype.Td,Bi.prototype.findTopLevelPart=Bi.prototype.sz,Bi.prototype.findSubGraphLevel=Bi.prototype.oz,Bi.prototype.ensureBounds=Bi.prototype.Va,Bi.prototype.getDocumentBounds=Bi.prototype.mi,Bi.prototype.findObject=Bi.prototype.fb,Bi.prototype.moveTo=Bi.prototype.moveTo,Bi.prototype.invalidateAdornments=Bi.prototype.Wb,Bi.prototype.clearAdornments=Bi.prototype.Ej,Bi.prototype.removeAdornment=Bi.prototype.Jf,Bi.prototype.addAdornment=Bi.prototype.bh,Bi.prototype.findAdornment=Bi.prototype.Pj,Bi.prototype.updateTargetBindings=Bi.prototype.La;var z1=!1;Bi.className="Part",Bi.LayoutNone=0,Bi.LayoutAdded=1,Bi.LayoutRemoved=2,Bi.LayoutShown=4,Bi.LayoutHidden=8,Bi.LayoutNodeSized=16,Bi.LayoutGroupLayout=32,Bi.LayoutNodeReplaced=64,Bi.LayoutStandard=127,Bi.LayoutAll=16777215;function Qr(a,y){a===void 0||a instanceof Ea||typeof a=="string"?Bi.call(this,a):(Bi.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)}Se(Qr,Bi),Qr.prototype.toString=function(){var a=this.adornedPart;return"Adornment("+this.category+")"+(a!==null?a.toString():"")},Qr.prototype.updateRelationshipsFromData=function(){},Qr.prototype.Ul=function(a){var y=this.adornedObject,x=y==null?void 0:y.part;if(x instanceof Nn&&y instanceof cr){y=x.path,x.Ul(a),a=y.geometry,x=this.O.s,y=x.length;for(var E=0;E<y;E++){var b=x[E];b.isPanelMain&&b instanceof cr&&(b.ua=a)}}},Qr.prototype.si=function(){var a=this.ue;return a===null?!0:(a=a.part,a===null||!ws(a))},Qr.prototype.Zc=function(){return!1},Qr.prototype.gk=function(a,y,x,E,b,z,tt){if(a===ro&&y==="elements"){if(b instanceof Es)this.$a===null&&(this.$a=b);else if(b instanceof wn){var rt=b.Nl(function(ot){return ot instanceof Es});rt instanceof Es&&this.$a===null&&(this.$a=rt)}}else a===So&&y==="elements"&&this.$a!==null&&(E===this.$a?this.$a=null:E instanceof wn&&this.$a.rg(E)&&(this.$a=null));Bi.prototype.gk.call(this,a,y,x,E,b,z,tt)},Qr.prototype.updateAdornments=function(){},Qr.prototype.Lj=function(){},ye.Object.defineProperties(Qr.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}}}),Qr.className="Adornment";function Zv(){this.nc=!1,this.Vr=this.gj=this.Eq=this.Dq=null,this.yp=oa,this.er=Vm,this.Kr=this.ij=this.Nq=this.Mq=null}Zv.prototype.copy=function(){var a=new Zv;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 $n(a,y){a===void 0||a instanceof Ea||typeof a=="string"?Bi.call(this,a):(Bi.call(this),a&&(y=a)),this.U=13,this.Ba=null,this.jb=new fn,this.wc=this.af=this.Yk=null,this.ci=!1,y&&Object.assign(this,y)}Se($n,Bi),$n.prototype.cloneProtected=function(a){Bi.prototype.cloneProtected.call(this,a),a.U=this.U,this.Ba!==null&&(a.Ba=this.Ba.nc?this.Ba:this.Ba.copy())},wt=$n.prototype,wt.Af=function(a){Bi.prototype.Af.call(this,a),a.Bd(),a.af=this.af,a.wc=null};function Ih(a){a.Ba===null?a.Ba=new Zv:a.Ba.nc&&(a.Ba=a.Ba.copy())}wt.th=function(){Bi.prototype.th.call(this),this.Ba!==null&&(this.Ba.nc=!0)};function Z1(a,y){y!==null&&(a.af===null&&(a.af=new pn),a.af.add(y))}function G1(a,y,x,E){if(y===null||a.af===null)return null;for(var b=a.af.iterator;b.next();){var z=b.value;if(z.Ds===a&&z.cv===y&&z.Ox===x&&z.Px===E||z.Ds===y&&z.cv===a&&z.Ox===E&&z.Px===x)return z}return null}wt.Lz=function(a,y,x){y==null&&(y=""),x==null&&(x=""),a=G1(this,a,y,x),a!==null&&a.Sl()},wt.gk=function(a,y,x,E,b,z,tt){a===ro&&y==="elements"?this.wc=null:a===So&&y==="elements"&&(this.wc=null),Bi.prototype.gk.call(this,a,y,x,E,b,z,tt)},wt.Bd=function(a){for(var y=this.linksConnected;y.next();){var x=y.value;a!==void 0&&a.contains(x)||(el(x.fromPort),el(x.toPort),x.bb())}};function H1(a,y){for(a=a.linksConnected;a.next();){var x=a.value;(x.fromPort===y||x.toPort===y)&&(el(x.fromPort),el(x.toPort),x.bb())}}function el(a){if(a!==null){var y=a.Zn;y!==null&&y.Sl(),a=a.part,y=a.containingGroup,y===null||a.isVisible()||el(y.port)}}wt.si=function(){return!0},$n.prototype.getAvoidableRect=function(a){return a.set(this.actualBounds),a.Co(this.avoidableMargin),a},$n.prototype.findVisibleNode=function(){for(var a=this;a!==null&&!a.isVisible();)a=a.containingGroup;return a},$n.prototype.isVisible=function(){if(!Bi.prototype.isVisible.call(this))return!1;var a=!0,y=Nh,x=this.diagram;if(x!==null&&(a=x.isTreePathToChildren,y=x.treeCollapsePolicy),y===Nh){if(a=this.pg(),a!==null&&!a.isTreeExpanded)return!1}else if(y===va){if(a=a?this.Oo():this.Po(),0<a.count&&a.all(function(E){return!E.isTreeExpanded}))return!1}else if(y===Mf&&(a=a?this.Oo():this.Po(),0<a.count&&a.any(function(E){return!E.isTreeExpanded})))return!1;return a=this.labeledLink,a!==null?a.isVisible():!0},$n.prototype.Zb=function(a){Bi.prototype.Zb.call(this,a);for(var y=this.linksConnected;y.next();){var x=y.value;if(a&&this.containingGroup!==null){var E=x.To(this);E===null||E.Td(this.containingGroup)||x.bb()}x.Zb(a)}},$n.prototype.qx=function(){var a=new pn,y=new pn;return W1(this,this,a,y),y.iterator};function W1(a,y,x,E){if(y!==null&&!x.has(y)){x.add(y);var b=!0,z=a.diagram;z!==null&&(b=z.isTreePathToChildren),y.linksConnected.each(function(tt){tt.isTreeLink?(b?tt.fromNode===y:tt.toNode===y)&&W1(a,b?tt.toNode:tt.fromNode,x,E):E.add(tt)})}}$n.prototype.findLinksConnected=function(a){if(a===void 0&&(a=null),a===null)return this.jb.iterator;var y=new Or(this.jb),x=this;return y.predicate=function(E){return E.fromNode===x&&E.fromPortId===a||E.toNode===x&&E.toPortId===a},y},wt=$n.prototype,wt.Mo=function(a){a===void 0&&(a=null);var y=new Or(this.jb),x=this;return y.predicate=function(E){return E.fromNode!==x?!1:a===null?!0:E.fromPortId===a},y},wt.Sd=function(a){a===void 0&&(a=null);var y=new Or(this.jb),x=this;return y.predicate=function(E){return E.toNode!==x?!1:a===null?!0:E.toPortId===a},y},wt.Mu=function(a){a===void 0&&(a=null);for(var y=null,x=null,E=this.jb.iterator;E.next();){var b=E.value;b.fromNode===this?(a===null||b.fromPortId===a)&&(b=b.toNode,y!==null?y.add(b):x!==null&&x!==b?(y=new pn,y.add(x),y.add(b)):x=b):b.toNode!==this||a!==null&&b.toPortId!==a||(b=b.fromNode,y!==null?y.add(b):x!==null&&x!==b?(y=new pn,y.add(x),y.add(b)):x=b)}return y!==null?y.iterator:x!==null?new br(x):pr},wt.Po=function(a){a===void 0&&(a=null);for(var y=null,x=null,E=this.jb.iterator;E.next();){var b=E.value;b.fromNode!==this||a!==null&&b.fromPortId!==a||(b=b.toNode,y!==null?y.add(b):x!==null&&x!==b?(y=new pn,y.add(x),y.add(b)):x=b)}return y!==null?y.iterator:x!==null?new br(x):pr},wt.Oo=function(a){a===void 0&&(a=null);for(var y=null,x=null,E=this.jb.iterator;E.next();){var b=E.value;b.toNode!==this||a!==null&&b.toPortId!==a||(b=b.fromNode,y!==null?y.add(b):x!==null&&x!==b?(y=new pn,y.add(x),y.add(b)):x=b)}return y!==null?y.iterator:x!==null?new br(x):pr},wt.jz=function(a,y,x){y===void 0&&(y=null),x===void 0&&(x=null);var E=new Or(this.jb),b=this;return E.predicate=function(z){return!((z.fromNode!==b||z.toNode!==a||y!==null&&z.fromPortId!==y||x!==null&&z.toPortId!==x)&&(z.fromNode!==a||z.toNode!==b||x!==null&&z.fromPortId!==x||y!==null&&z.toPortId!==y))},E},wt.kz=function(a,y,x){y===void 0&&(y=null),x===void 0&&(x=null);var E=new Or(this.jb),b=this;return E.predicate=function(z){return!(z.fromNode!==b||z.toNode!==a||y!==null&&z.fromPortId!==y||x!==null&&z.toPortId!==x)},E};function Hm(a,y,x){el(x);var E=a.jb.contains(y);if(E||a.jb.add(y),!E||y.fromNode===y.toNode){var b=a.linkConnected;if(b!==null){var z=!0,tt=a.diagram;tt!==null&&(z=tt.aa,tt.aa=!0),b(a,y,x),tt!==null&&(tt.aa=z)}}!E&&y.isTreeLink&&(x=y.fromNode,y=y.toNode,x!==null&&y!==null&&x!==y&&(E=!0,a=a.diagram,a!==null&&(E=a.isTreePathToChildren),b=E?y:x,z=E?x:y,b.ci||(b.ci=z),!z.isTreeLeaf||a!==null&&a.undoManager.isUndoingRedoing||(E?x===z&&(z.isTreeLeaf=!1):y===z&&(z.isTreeLeaf=!1))))}function Wm(a,y,x){el(x);var E=a.jb.remove(y),b=null;if(E||y.toNode===y.fromNode){var z=a.linkDisconnected;if(b=a.diagram,z!==null){var tt=!0;b!==null&&(tt=b.aa,b.aa=!0),z(a,y,x),b!==null&&(b.aa=tt)}}E&&y.isTreeLink&&(x=!0,b!==null&&(x=b.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,b!==null&&b.undoManager.isUndoingRedoing||(y.isTreeLeaf=!0)):ip(y)))}function ip(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 E=x.value;if(E.isTreeLink){if(y){if(E.fromNode===a){a.isTreeLeaf=!1;return}}else if(E.toNode===a){a.isTreeLeaf=!1;return}}}a.isTreeLeaf=!0}}}$n.prototype.updateRelationshipsFromData=function(){var a=this.diagram;a!==null&&a.partManager.updateRelationshipsFromData(this)},wt=$n.prototype,wt.Vo=function(a){Bi.prototype.Vo.call(this,a),a||(ip(this),a=this.Yk,a!==null&&q1(a,this))},wt.Wo=function(a){Bi.prototype.Wo.call(this,a),a||(a=this.Yk,a!==null&&a.wd!==null&&(a.wd.remove(this),a.v()))},wt.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 E=x.value;y?a.remove(E):(E.fromNode===this&&(E.fromNode=null),E.toNode===this&&(E.toNode=null))}}this.labeledLink=null,Bi.prototype.Lj.call(this)},wt.ns=function(a){if(this.wc===null){if(a===""&&this.Te===!1)return this;V1(this)}var y=this.wc.I(a);return y!==null||a!==""&&(y=this.wc.I(""),y!==null)?y:this};function V1(a){a.wc===null?a.wc=new be: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 Gv(a,y,x){var E=y.portId;if(E!==null&&(a.wc!==null&&a.wc.remove(E),y=a.diagram,y!==null&&x)){for(x=null,a=a.findLinksConnected(E);a.next();)E=a.value,x===null&&(x=Yn()),x.push(E);if(x!==null){for(a=0;a<x.length;a++)y.remove(x[a]);si(x)}}}wt.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 E=x.jb.iterator;E.next();){var b=E.value;if(b.isTreeLink&&(y=b.fromNode,y!==x&&y!==this))break}if(y===this||y===null||y===x)return!1;x=y}else for(;x!==a;){for(y=null,E=x.jb.iterator;E.next()&&(b=E.value,!b.isTreeLink||(y=b.toNode,y===x||y===this)););if(y===this||y===null||y===x)return!1;x=y}return!0},wt.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 E=x.value;if(E.isTreeLink&&(a=E.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()&&(E=x.value,!E.isTreeLink||(a=E.toNode,a===y||a===this)););if(a===this)return this;if(a===null||a===y)return y;y=a}},wt.gz=function(a){if(a===null)return null;if(this===a)return this;for(var y=this;y!==null;)Gm(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;)Gm(y,!1),y=y.pg();return x},wt.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},wt.pg=function(){var a=this.ci;if(a===null)return null;if(a instanceof $n)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},wt.vz=function(){function a(x,E){E.add(x);var b=x.kh();b!==null&&(E.add(b),x=x.pg(),x!==null&&a(x,E))}var y=new pn;return a(this,y),y},wt.uz=function(){return U1(this,this)};function U1(a,y){return y=y.pg(),y===null?0:1+U1(a,y)}wt.Qo=function(){var a=!0,y=this.diagram;y!==null&&(a=y.isTreePathToChildren),y=new Or(this.jb);var x=this;return y.predicate=a?function(E){return!!(E.isTreeLink&&E.fromNode===x)}:function(E){return!!(E.isTreeLink&&E.toNode===x)},y},wt.Ou=function(){var a=!0,y=this.diagram;y!==null&&(a=y.isTreePathToChildren);var x=y=null,E=this.jb.iterator;if(a)for(;E.next();)a=E.value,a.isTreeLink&&a.fromNode===this&&(a=a.toNode,y!==null?y.add(a):x!==null&&x!==a?(y=new fn,y.add(x),y.add(a)):x=a);else for(;E.next();)a=E.value,a.isTreeLink&&a.toNode===this&&(a=a.fromNode,y!==null?y.add(a):x!==null&&x!==a?(y=new fn,y.add(x),y.add(a)):x=a);return y!==null?y.iterator:x!==null?new br(x):pr},wt.wz=function(a){a===void 0&&(a=1/0);var y=new pn;return gd(y,this,!1,a,!0),y},$n.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 pn;x.add(this),Y1(this,x,y.isTreePathToChildren,a,y,this,y.treeCollapsePolicy===Nh),y.Ue=!1}};function Y1(a,y,x,E,b,z,tt){if(1<E)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),Y1(ot,y,x,E-1,b,z,tt)))}else X1(a,y,x,b,z,tt)}function X1(a,y,x,E,b,z){for(var tt=b===a?!0:a.isTreeExpanded,rt=x?a.Mo():a.Sd(),ot={};rt.next();){var lt=rt.value;if(lt.isTreeLink&&(lt=lt.To(a),lt!==null&<!==a)){var ut=y.contains(lt);if(ut||y.add(lt),tt){var ft=x?lt.Oo():lt.Po();ot.uv=a,ft.all(function(yt){return function(xt){return xt===yt.uv||!xt.isTreeExpanded}}(ot))&&E.Aj(lt,b),lt.oh(),lt.Zb(!1)}lt.isTreeExpanded&&(lt.wasTreeExpanded=lt.isTreeExpanded,ut||X1(lt,y,x,E,b,z))}ot={uv:ot.uv}}a.isTreeExpanded=!1}$n.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 pn;x.add(this),J1(this,x,y.isTreePathToChildren,a,y,this,y.treeCollapsePolicy===Nh),y.Ue=!1}};function J1(a,y,x,E,b,z,tt){for(var rt=z===a?!1:a.isTreeExpanded,ot=x?a.Mo():a.Sd(),lt={};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 ft=x?ut.Oo():ut.Po();lt.vv=a,ft.all(function(yt){return function(xt){return xt===yt.vv||!xt.isTreeExpanded}}(lt))&&b.Cj(ut,z)}(2<E||ut.wasTreeExpanded)&&(ut.wasTreeExpanded=!1,J1(ut,y,x,E-1,b,z,tt))}lt={vv:lt.vv}}a.isTreeExpanded=!0}ye.Object.defineProperties($n.prototype,{portSpreading:{get:function(){return this.Ba!==null?this.Ba.er:Vm},set:function(a){var y=this.portSpreading;y!==a&&(Ih(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&&kh(x,this),this.g("avoidable",y,a)}}},avoidableMargin:{get:function(){return this.Ba!==null?this.Ba.yp:oa},set:function(a){typeof a=="number"&&(a=new nr(a));var y=this.avoidableMargin;if(!y.D(a)){a=a.J(),Ih(this),this.Ba.yp=a;var x=this.diagram;x!==null&&kh(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&&(Ih(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&&(Ih(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&&(Ih(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,E=this.data;if(y!==null){if(y.wd!==null&&(y.wd.remove(this),y.v()),x!==null&&E!==null&&!x.undoManager.isUndoingRedoing){var b=y.data,z=x.model;if(b!==null&&z.ri()){var tt=z.wa(E);tt!==void 0&&z.Qx(b,tt)}}this.containingGroup=null}this.Yk=a,a!==null&&(q1(a,this),x===null||E===null||x.undoManager.isUndoingRedoing||(b=a.data,x=x.model,b!==null&&x.ri()&&(E=x.wa(E),E!==void 0&&x.Bu(b,E))),this.containingGroup=a.containingGroup),Ps(this),this.g("labeledLink",y,a)}}},port:{get:function(){return this.ns("")}},ports:{get:function(){return this.wc===null&&V1(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 E=!0;x!==null&&(E=x.aa,x.aa=!0),y(this),x!==null&&(x.aa=E)}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&&(Ih(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))}}}),$n.prototype.expandTree=$n.prototype.expandTree,$n.prototype.collapseTree=$n.prototype.collapseTree,$n.prototype.findTreeParts=$n.prototype.wz,$n.prototype.findTreeChildrenNodes=$n.prototype.Ou,$n.prototype.findTreeChildrenLinks=$n.prototype.Qo,$n.prototype.findTreeLevel=$n.prototype.uz,$n.prototype.findTreeParentChain=$n.prototype.vz,$n.prototype.findTreeParentNode=$n.prototype.pg,$n.prototype.findTreeParentLink=$n.prototype.kh,$n.prototype.findCommonTreeParent=$n.prototype.gz,$n.prototype.findTreeRoot=$n.prototype.xz,$n.prototype.isInTreeOf=$n.prototype.Nz,$n.prototype.findPort=$n.prototype.ns,$n.prototype.findLinksTo=$n.prototype.kz,$n.prototype.findLinksBetween=$n.prototype.jz,$n.prototype.findNodesInto=$n.prototype.Oo,$n.prototype.findNodesOutOf=$n.prototype.Po,$n.prototype.findNodesConnected=$n.prototype.Mu,$n.prototype.findLinksInto=$n.prototype.Sd,$n.prototype.findLinksOutOf=$n.prototype.Mo,$n.prototype.findExternalTreeLinksConnected=$n.prototype.qx,$n.prototype.invalidateConnectedLinks=$n.prototype.Bd,$n.prototype.invalidateLinkBundle=$n.prototype.Lz;var Ex=new rn($n,"SpreadingNone",10),Vm=new rn($n,"SpreadingEvenly",11),Hv=new rn($n,"SpreadingPacked",12);$n.className="Node",$n.SpreadingNone=Ex,$n.SpreadingEvenly=Vm,$n.SpreadingPacked=Hv;function er(a,y){a===void 0||a instanceof Ea||typeof a=="string"?$n.call(this,a):($n.call(this),a&&(y=a)),this.U|=4608,this.Gn=new pn,this.$a=null,this.Sc=new Ko,this.Sc.group=this,this.gl=new pn,this.tb=this.$p=null,y&&Object.assign(this,y)}Se(er,$n),er.prototype.cloneProtected=function(a){$n.prototype.cloneProtected.call(this,a),this.U=this.U&-32769;var y=a.Nl(function(x){return x instanceof Es});y instanceof Es?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())},wt=er.prototype,wt.Af=function(a){$n.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 $n)x.Bd(y);else if(x instanceof Nn)for(x=x.labelNodes;x.next();)x.value.Bd(y)}},wt.gk=function(a,y,x,E,b,z,tt){if(a===ro&&y==="elements"){if(b instanceof Es)this.$a===null?this.$a=b:this.$a!==b&&Gt("Cannot insert a second Placeholder into the visual tree of a Group.");else if(b instanceof wn){var rt=b.Nl(function(ot){return ot instanceof Es});rt instanceof Es&&(this.$a===null?this.$a=rt:this.$a!==rt&&Gt("Cannot insert a second Placeholder into the visual tree of a Group."))}}else a===So&&y==="elements"&&this.$a!==null&&(E===this.$a?this.$a=null:E instanceof wn&&this.$a.rg(E)&&(this.$a=null));$n.prototype.gk.call(this,a,y,x,E,b,z,tt)},wt.Xl=function(a,y){$n.prototype.Xl.call(this,a,y),this.isClipping&&this.type!==wn.Spot&&this.isSubGraphExpanded&&(a=this.resizeObject,a instanceof wn&&(a=a.Pb()),this.tb===null&&(this.tb=new Be),a.mi(this.tb),a instanceof cr&&this.tb.Bc(-a.strokeWidth,-a.strokeWidth))},wt.eh=function(a,y,x,E){this.nf=this.$a,$n.prototype.eh.call(this,a,y,x,E)},wt.Va=function(){var a=this;a.isSubGraphExpanded&&this.memberParts.each(function(y){!a.computesBoundsIncludingLinks&&y instanceof Nn||y.Va()}),$n.prototype.Va.call(this)},wt.si=function(){if(!$n.prototype.si.call(this))return!1;for(var a=this.memberParts;a.next();){var y=a.value;if(y instanceof $n){if(y.isVisible()&&ws(y))return!1}else if(y instanceof Nn&&y.isVisible()&&ws(y)&&y.fromNode!==this&&y.toNode!==this)return!1}return!0};function Wv(a,y){if(a.Gn.add(y)){y instanceof er&&a.gl.add(y);var x=a.memberAdded;if(x!==null){var E=!0,b=a.diagram;b!==null&&(E=b.aa,b.aa=!0),x(a,y),b!==null&&(b.aa=E)}a.isVisible()&&a.isSubGraphExpanded||y.Zb(!1)}y instanceof Nn&&!a.computesBoundsIncludingLinks||(y=a.$a,y===null&&(y=a),y.v())}function Vv(a,y){if(a.Gn.remove(y)){y instanceof er&&a.gl.remove(y);var x=a.memberRemoved;if(x!==null){var E=!0,b=a.diagram;b!==null&&(E=b.aa,b.aa=!0),x(a,y),b!==null&&(b.aa=E)}a.isVisible()&&a.isSubGraphExpanded||y.Zb(!0)}y instanceof Nn&&!a.computesBoundsIncludingLinks||(y=a.$a,y===null&&(y=a),y.v())}wt.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)}$n.prototype.Lj.call(this)},er.prototype.canAddMembers=function(a){var y=this.diagram;if(y===null)return!1;for(y=y.commandHandler,a=Ze(a).iterator;a.next();)if(!y.isValidMember(this,a.value))return!1;return!0},er.prototype.addMembers=function(a,y){var x=this.diagram;if(x===null)return!1;x=x.commandHandler;var E=!0;for(a=Ze(a).iterator;a.next();){var b=a.value;!y||x.isValidMember(this,b)?b.containingGroup=this:E=!1}return E},er.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))},wt=er.prototype,wt.Bd=function(a){var y=(this.U&65536)!==0;if($n.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 E=x.fromNode;E!==null&&E!==this&&E.Td(this)&&!E.isVisible()?(el(x.fromPort),el(x.toPort),x.bb()):(E=x.toNode,E!==null&&E!==this&&E.Td(this)&&!E.isVisible()&&(el(x.fromPort),el(x.toPort),x.bb()))}}},wt.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 pn,E=y.iterator;E.next();){var b=E.value;if(b instanceof $n)for(b=b.linksConnected;b.next();){var z=b.value;y.contains(z)||x.add(z)}}return a&&(this.$p=x),x.iterator},wt.iz=function(){var a=this.Rj();a.add(this);for(var y=new pn,x=a.iterator;x.next();){var E=x.value;if(E instanceof $n)for(E=E.linksConnected;E.next();){var b=E.value,z=b.fromNode;z===null||a.contains(z)&&z!==this||y.add(z),b=b.toNode,b===null||a.contains(b)&&b!==this||y.add(b)}}return y.iterator},wt.hz=function(){function a(x,E){x!==null&&(E.add(x),a(x.containingGroup,E))}var y=new pn;return a(this,y),y},wt.Rj=function(){var a=new pn;return gd(a,this,!0,0,!0),a.remove(this),a},wt.Zb=function(a){$n.prototype.Zb.call(this,a);for(var y=this.memberParts;y.next();)y.value.Zb(a)},er.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,E){for(var b=a.memberParts;b.next();){var z=b.value;if(z.Zb(!1),z instanceof er&&z.isSubGraphExpanded&&(z.wasSubGraphExpanded=z.isSubGraphExpanded,Q1(z,y,x,E)),z instanceof $n)z.Bd(y),x.Aj(z,E);else if(z instanceof Nn)for(z=z.labelNodes;z.next();)z.value.Bd(y)}a.isSubGraphExpanded=!1}er.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,E){for(var b=a.memberParts;b.next();){var z=b.value;if(z.Zb(!0),z instanceof er&&z.wasSubGraphExpanded&&(z.wasSubGraphExpanded=!1,$1(z,y,x,E)),z instanceof $n)z.Bd(y),x.Cj(z,E);else if(z instanceof Nn)for(z=z.labelNodes;z.next();)z.value.Bd(y)}a.isSubGraphExpanded=!0}er.prototype.move=function(a,y){y===void 0&&(y=!1);var x=y?this.location:this.position,E=x.x;x=x.y;var b=a.x,z=a.y;if(!(E===b||isNaN(E)&&isNaN(b))||!(x===z||isNaN(x)&&isNaN(z))){for(E=b-(isNaN(E)?0:E),x=z-(isNaN(x)?0:x),z=At.alloc(),$n.prototype.move.call(this,a,y),a=new pn,y=this.Rj().iterator;y.next();)b=y.value,b instanceof Nn&&(b.suspendsRouting&&a.add(b),b.fd||b.fromNode!==this&&b.toNode!==this)&&(b.suspendsRouting=!0);for(y.reset();y.next();)if(b=y.value,!(b.ph()||b instanceof $n&&b.isLinkLabel)){var tt=b.position,rt=b.location;tt.w()?(z.x=tt.x+E,z.y=tt.y+x,b.position=z):rt.w()&&(z.x=rt.x+E,z.y=rt.y+x,b.location=z)}for(y.reset();y.next();)b=y.value,b instanceof Nn&&(b.suspendsRouting=a.contains(b),b.fd||b.fromNode!==this&&b.toNode!==this)&&(tt=b.position,z.x=tt.x+E,z.y=tt.y+x,z.w()?b.move(z):b.bb(),Uv(b)&&b.bb());At.free(z)}},ye.Object.defineProperties(er.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&&Gt("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&&(Ih(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&&(Ih(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&&(Ih(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 E=!0;x!==null&&(E=x.aa,x.aa=!0),y(this),x!==null&&(x.aa=E)}x!==null&&x.undoManager.isUndoingRedoing?(this.$a!==null&&this.$a.v(),this.memberParts.each(function(b){b.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&&(Ih(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)}}}),er.prototype.expandSubGraph=er.prototype.expandSubGraph,er.prototype.collapseSubGraph=er.prototype.collapseSubGraph,er.prototype.findSubGraphParts=er.prototype.Rj,er.prototype.findContainingGroupChain=er.prototype.hz,er.prototype.findExternalNodesConnected=er.prototype.iz,er.prototype.findExternalLinksConnected=er.prototype.Lu,er.prototype.ensureBounds=er.prototype.Va,er.className="Group";function Es(a){ge.call(this),this.yb=ga,this.ko=new Be(NaN,NaN,NaN,NaN),a&&Object.assign(this,a)}Se(Es,ge),Es.prototype.cloneProtected=function(a){ge.prototype.cloneProtected.call(this,a),a.yb=this.yb.J(),a.ko=this.ko.copy()},Es.prototype.gh=function(a){if(this.background===null&&this.areaBackground===null)return!1;var y=this.naturalBounds;return jr(0,0,y.width,y.height,a.x,a.y)},Es.prototype.Wl=function(){var a=this.part;if(a!==null&&(a instanceof er||a instanceof Qr)||Gt("Placeholder is not inside a Group or Adornment."),a instanceof er){var y=this.computeBorder(this.ko),x=this.minSize,E=this.dc;for(so(E,(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,E.width,E.height),E=a.memberParts,x=!1;E.next();)if(E.value.isVisible()){x=!0;break}E=a.diagram,!x||E===null||E.animationManager.Xu(a)||isNaN(y.x)||isNaN(y.y)||(x=At.alloc(),x.xi(y,a.locationSpot),x.D(a.location)||(a.location=x),At.free(x))}else{y=this.dc,x=this.yb,E=x.left+x.right;var b=x.top+x.bottom,z=a.adornedObject;a.angle=z.li();var tt=0;z instanceof cr&&(tt=z.strokeWidth);var rt=z.Df(),ot=z.naturalBounds,lt=(ot.width+tt)*rt;tt=(ot.height+tt)*rt,a.type!==wn.Link&&(rt=z.ga(a.category==="Selection"?_r:a.locationSpot,At.alloc()),a.location=rt,At.free(rt)),isNaN(lt)||isNaN(tt)?(a=z.ga(_r,At.alloc()),lt=Be.allocAt(a.x,a.y,0,0),lt.Ye(z.ga(lo,a)),lt.Ye(z.ga(fo,a)),lt.Ye(z.ga(fa,a)),so(y,lt.width+E||0,lt.height+b||0),this.Ge(-x.left,-x.top,y.width,y.height),At.free(a),Be.free(lt)):(so(y,lt+E||0,tt+b||0),this.Ge(-x.left,-x.top,y.width,y.height))}},Es.prototype.eh=function(a,y,x,E){this.actualBounds.h(a,y,x,E)},Es.prototype.computeBorder=function(a){var y=this.part,x=y.diagram,E=x===null||!x.animationManager.isAnimating;if(x!==null&&y instanceof er&&!y.layer.isTemporary&&y.computesBoundsAfterDrag&&this.ko.w()){var b=x.toolManager.findTool("Dragging");if(b===x.currentTool&&(x=b.computeBorder(y,this.ko,a),x!==null))return x}x=Be.alloc(),b=this.computeMemberBounds(x);var z=this.yb;return y instanceof er&&!y.isSubGraphExpanded?a.h(b.x-z.left,b.y-z.top,0,0):a.h(b.x-z.left,b.y-z.top,Math.max(b.width+z.left+z.right,0),Math.max(b.height+z.top+z.bottom,0)),Be.free(x),E&&y instanceof er&&y.computesBoundsIncludingLocation&&y.location.w()&&a.Ye(y.location),a},Es.prototype.computeMemberBounds=function(a){if(!(this.part instanceof er))return a.h(0,0,0,0),a;for(var y=this.part,x=1/0,E=1/0,b=-1/0,z=-1/0,tt=y.memberParts;tt.next();){var rt=tt.value;if(rt.isVisible()){if(rt instanceof Nn&&(!y.computesBoundsIncludingLinks||gl(rt)||rt.fromNode===y||rt.toNode===y))continue;rt=rt.actualBounds,rt.left<x&&(x=rt.left),rt.top<E&&(E=rt.top),rt.right>b&&(b=rt.right),rt.bottom>z&&(z=rt.bottom)}}return isFinite(x)&&isFinite(E)?a.h(x,E,b-x,z-E):(y=y.location,a.h(y.x,y.y,0,0)),a},ye.Object.defineProperties(Es.prototype,{padding:{get:function(){return this.yb},set:function(a){typeof a=="number"&&(a=new nr(a));var y=this.yb;y.D(a)||(this.yb=a=a.J(),this.g("padding",y,a),this.v())}}}),Es.className="Placeholder";function Nn(a){Bi.call(this,wn.Link),this.Qa=8,this.ef=null,this.ff="",this.uf=this.gn=null,this.vf="",this.uo=null,this.qk=Ls,this.Om=0,this.Qm=Ls,this.Rm=NaN,this.qj=Jv,this.po=.5,this.wd=null,this.Nb=new fn().freeze(),this.Tg=this.Mg=null,this.ml=new Be,this.ua=new fe,this.u=this.o=this.Sf=this.Wf=null,this.su=new At,this.cq=this.Mw=this.Lw=null,this.vt=NaN,this.ba=null,this.j=[],a&&Object.assign(this,a)}Se(Nn,Bi),Nn.prototype.cloneProtected=function(a){Bi.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())},wt=Nn.prototype,wt.Af=function(a){Bi.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&&el(y),a=a.toPort,a!==null&&el(a)},wt.qb=function(a){a.classType===Nn?(a.value&2)===2?this.routing=a:a===ml||a===Rh||a===Wf?this.curve=a:a===ap||a===Qm||a===$m?this.adjusting=a:a!==Jv&&a!==Ls&&Gt("Unknown Link enum value for a Link property: "+a):Bi.prototype.qb.call(this,a)},wt.Xc=function(){this.ba===null&&(this.ba=new Kg)},wt.si=function(){var a=this.fromNode;if(a!==null){var y=a.findVisibleNode();if(y!==null&&(a=y),ws(a)||cd(a))return!1}return a=this.toNode,!(a!==null&&(y=a.findVisibleNode(),y!==null&&(a=y),ws(a)||cd(a)))},wt.zv=function(){return!1},wt.Av=function(){},wt.Zc=function(){return!1},Nn.prototype.computeAngle=function(a,y,x){return Nn.computeAngle(y,x)},Nn.computeAngle=function(a,y){switch(a){default:case Ls:a=0;break;case sp:a=y;break;case lp:a=y+90;break;case up:a=y-90;break;case Qv:a=y+180;break;case qm:a=_t.bp(y),90<a&&270>a&&(a-=180);break;case hp:a=_t.bp(y+90),90<a&&270>a&&(a-=180);break;case dp:a=_t.bp(y-90),90<a&&270>a&&(a-=180);break;case t0:if(a=_t.bp(y),45<a&&135>a||225<a&&315>a)return 0;90<a&&270>a&&(a-=180)}return _t.bp(a)};function Gf(a){var y=a.fromNode,x=a.toNode,E=null;if(y!==null?E=x!==null?y.px(x):y.containingGroup:x!==null?E=x.containingGroup:E=null,y=E,x=a.Ah,x!==y){x!==null&&Vv(x,a),a.Ah=y,y!==null&&Wv(y,a);var b=a.containingGroupChanged;if(b!==null){var z=!0,tt=a.diagram;tt!==null&&(z=tt.aa,tt.aa=!0),b(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=E}wt=Nn.prototype,wt.oh=function(){var a=this.containingGroup;a!==null&&this.fromNode!==a&&this.toNode!==a&&a.computesBoundsIncludingLinks&&Bi.prototype.oh.call(this)},wt.To=function(a){var y=this.fromNode;return a===y?this.toNode:y},wt.Cz=function(a){var y=this.fromPort;return a===y?this.toPort:y};function q1(a,y){a.wd===null&&(a.wd=new pn),a.wd.add(y),a.v()}wt.Vo=function(a){if(Bi.prototype.Vo.call(this,a),nc(this)&&this.Xo(this.actualBounds),!a){a=this.ef;var y=null;a!==null&&(y=this.fromPort,Hm(a,this,y));var x=this.uf;if(x!==null){var E=this.toPort;x===a&&E===y||Hm(x,this,E)}rp(this)}},wt.Wo=function(a){if(Bi.prototype.Wo.call(this,a),nc(this)&&this.Xo(this.actualBounds),!a){a=this.ef;var y=null;a!==null&&(y=this.fromPort,Wm(a,this,y));var x=this.uf;if(x!==null){var E=this.toPort;x===a&&E===y||Wm(x,this,E)}op(this)}},wt.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))},Nn.prototype.updateRelationshipsFromData=function(){if(this.data!==null){var a=this.diagram;a!==null&&a.partManager.updateRelationshipsFromData(this)}},Nn.prototype.move=function(a,y){var x=y?this.location:this.position,E=x.x;isNaN(E)&&(E=0);var b=x.y;for(isNaN(b)&&(b=0),E=a.x-E,b=a.y-b,y===!0?Bi.prototype.move.call(this,a,!1):(a=At.allocAt(x.x+E,x.y+b),Bi.prototype.move.call(this,a,!1),At.free(a)),_h(this,E,b),a=this.labelNodes;a.next();)y=a.value,x=y.position,y.moveTo(x.x+E,x.y+b)},Nn.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},Nn.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},Nn.prototype.computeMidPoint=function(a){var y=this.pointsCount;if(y===0)return a.assign(li),a;if(y===1)return a.assign(this.i(0)),a;if(y===2){var x=this.i(0),E=this.i(1);return a.h((x.x+E.x)/2,(x.y+E.y)/2),a}if(this.isOrthogonal&&(15<=this.computeCorner()||this.computeCurve()===ml))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()===ml){if(y===3){x=this.i(0),E=this.i(1);var b=this.i(2);return _t.ax(x.x,x.y,E.x,E.y,E.x,E.y,b.x,b.y,a),a}if(E=(y-1)/3|0,x=3*(E/2|0),E%2===1){E=this.i(x),b=this.i(x+1);var z=this.i(x+2);x=this.i(x+3),_t.ax(E.x,E.y,b.x,b.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,b=z=E=0;E<x/2&&z<y&&(b=tt[z],!(E+b>x/2));)E+=b,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-E)):a.h(y.x,y.y+(x/2-E)):1>Math.abs(y.y-z.y)?y.x>z.x?a.h(y.x-(x/2-E),y.y):a.h(y.x+(x/2-E),y.y):(x=(x/2-E)/b,a.h(y.x+x*(z.x-y.x),y.y+x*(z.y-y.y))),a},Nn.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()===ml))return this.ua.wx(.5);if(this.computeCurve()===ml&&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 E=this.i(x+2);return x=this.i(x+3),_t.My(a.x,a.y,y.x,y.y,E.x,E.y,x.x,x.y)}if(0<x&&x+1<a)return this.i(x-1).ab(this.i(x+1))}y=this.flattenedLengths,E=this.flattenedTotalLength;var b=0;x=0;for(var z;b<E/2&&x<a&&(z=y[x],!(b+z>E/2));)b+=z,x++;if(y=this.i(x),E=this.i(x+1),1>Math.abs(y.x-E.x)&&1>Math.abs(y.y-E.y)){if(0<x&&x+2<a)return this.i(x-1).ab(this.i(x+2))}else{if(1>Math.abs(y.x-E.x))return y.y>E.y?270:90;if(1>Math.abs(y.y-E.y))return y.x>E.x?180:0}return y.ab(E)},wt=Nn.prototype,wt.i=function(a){return this.Nb.s[a]},wt.dd=function(a,y){this.Nb.cd(a,y)},wt.L=function(a,y,x){this.Nb.cd(a,new At(y,x))},wt.Kz=function(a,y){this.Nb.Gb(a,y)},wt.m=function(a,y,x){this.Nb.Gb(a,new At(y,x))},wt.ne=function(a){this.Nb.add(a)},wt.yf=function(a,y){this.Nb.add(new At(a,y))},wt.pv=function(a){this.Nb.mb(a)},wt.Fj=function(){this.Nb.clear()};function _h(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 E=a.fd,b=new fn,z=a.Nb.iterator;z.next();){var tt=z.value;b.add(new At(tt.x+y,tt.y+x).freeze())}b.freeze(),z=a.Nb,a.Nb=b,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),Ps(a)),E?Km(a):(a.defaultFromPoint&&(a.defaultFromPoint=a.i(0)),a.defaultToPoint&&(a.defaultToPoint=a.i(a.pointsCount-1))),tt!==null&&tt.animationManager.zb&&gf(tt.animationManager,a,b),a.g("points",z,b)}}wt.uh=function(){this.Mg===null&&(this.Mg=this.Nb,this.Nb=this.Nb.copy())},wt.zf=function(){if(this.Mg!==null){for(var a=this.Mg,y=this.Nb,x=1/0,E=1/0,b=a.s,z=b.length,tt=0;tt<z;tt++){var rt=b[tt];x=Math.min(rt.x,x),E=Math.min(rt.y,E)}rt=tt=1/0;for(var ot=y.s,lt=ot.length,ut=0;ut<lt;ut++){var ft=ot[ut];tt=Math.min(ft.x,tt),rt=Math.min(ft.y,rt),ft.freeze()}if(y.freeze(),lt===z){for(z=0;z<lt;z++)if(ut=b[z],ft=ot[z],ut.x-x!==ft.x-tt||ut.y-E!==ft.y-rt){this.qc();break}}else this.qc();this.Mg=null,x=this.diagram,x!==null&&x.animationManager.zb&&gf(x.animationManager,this,y),Km(this),this.g("points",a,y)}},wt.rv=function(){this.Mg!==null&&(this.Nb=this.Mg,this.Mg=null)};function Km(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),Jm(a,!1))}wt.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())}},wt.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()}}},Nn.prototype.computePoints=function(){if(this.diagram===null)return!1;var a=this.fromNode,y=null;if(a===null?(zc||(zc=new $n,zc.desiredSize=ki,zc.Va()),this.defaultFromPoint&&(zc.location=this.defaultFromPoint,zc.Va(),y=a=zc)):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 E=this.toNode,b=null;if(E===null?(Zc||(Zc=new $n,Zc.desiredSize=ki,Zc.Va()),this.defaultToPoint&&(Zc.location=this.defaultToPoint,Zc.Va(),b=E=Zc)):b=this.toPort,b===null||E.isVisible()||(x=E.findVisibleNode(),x!==null&&x!==E?(E=x,b=x.port):E=x),this.Mw=E,E===null||!E.location.w())return!1;for(;!(b===null||b.actualBounds.w()&&b.Ed());)b=b.panel;if(b===null)return!1;var z=this.pointsCount,tt=this.computeSpot(!0,y);x=this.computeSpot(!1,b);var rt=Hf(tt),ot=Hf(x),lt=y===b&&y!==null,ut=this.isOrthogonal,ft=this.curve===ml;this.Wf=lt&&!ut?ft=!0:!1;var yt=this.computeAdjusting()===Ls||lt;if(!ut&&!lt&&rt&&ot){if(rt=!1,!yt&&3<=z&&(yt=this.getLinkPoint(a,y,tt,!0,!1,E,b),ot=this.getLinkPoint(E,b,x,!1,!1,a,y),rt=this.adjustPoints(0,yt,z-1,ot))&&(yt=this.getLinkPoint(a,y,tt,!0,!1,E,b),ot=this.getLinkPoint(E,b,x,!1,!1,a,y),this.adjustPoints(0,yt,z-1,ot)),!rt)if(this.Fj(),ft){z=this.getLinkPoint(a,y,tt,!0,!1,E,b),yt=this.getLinkPoint(E,b,x,!1,!1,a,y),rt=yt.x-z.x,ot=yt.y-z.y,lt=this.computeCurviness(),ft=ut=0;var xt=z.x+rt/3,Ct=z.y+ot/3,bt=xt,Vt=Ct;_t.B(ot,0)?Vt=0<rt?Vt-lt:Vt+lt:(ut=-rt/ot,ft=Math.sqrt(lt*lt/(ut*ut+1)),0>lt&&(ft=-ft),bt=(0>ot?-1:1)*ft+xt,Vt=ut*(bt-xt)+Ct),xt=z.x+2*rt/3,Ct=z.y+2*ot/3;var zt=xt,Qt=Ct;_t.B(ot,0)?Qt=0<rt?Qt-lt:Qt+lt:(zt=(0>ot?-1:1)*ft+xt,Qt=ut*(zt-xt)+Ct),this.Fj(),this.ne(z),this.yf(bt,Vt),this.yf(zt,Qt),this.ne(yt),this.dd(0,this.getLinkPoint(a,y,tt,!0,!1,E,b)),this.dd(3,this.getLinkPoint(E,b,x,!1,!1,a,y))}else z=E,yt=b,E=this.getLinkPoint(a,y,tt,!0,!1,z,yt),b=this.getLinkPoint(z,yt,x,!1,!1,a,y),this.hasCurviness()?(yt=b.x-E.x,x=b.y-E.y,tt=this.computeCurviness(),a=E.x+yt/2,y=E.y+x/2,z=a,rt=y,_t.B(x,0)?rt=0<yt?rt-tt:rt+tt:(yt=-yt/x,z=Math.sqrt(tt*tt/(yt*yt+1)),0>tt&&(z=-z),z=(0>x?-1:1)*z+a,rt=yt*(z-a)+y),this.ne(E),this.yf(z,rt),this.ne(b)):(this.ne(E),this.ne(b),rt=Be.alloc(),y.mi(rt),ot=rt.ca(b),yt.mi(rt),lt=rt.ca(E),(ot||lt)&&(tt=y.ga(Ym(tt),new At),this.dd(0,this.getLinkPointFromPoint(a,y,tt,b,!0,tt)),x=yt.ga(Ym(x),new At),this.dd(1,this.getLinkPointFromPoint(z,yt,x,E,!1,x))),Be.free(rt))}else{ft=this.isAvoiding,yt&&(ut&&ft||lt)&&this.Fj();var ee=lt?this.computeCurviness():0;ft=this.getLinkPoint(a,y,tt,!0,ut,E,b),xt=bt=Ct=0,(ut||!rt||lt)&&(Vt=this.computeEndSegmentLength(a,y,tt,!0),xt=this.getLinkDirection(a,y,ft,tt,!0,ut,E,b),lt&&(rt||tt.D(x)||!ut&&tt.x+x.x===1&&tt.y+x.y===1)&&(xt-=ut?90:30,0>ee&&(xt-=180)),0>xt?xt+=360:360<=xt&&(xt-=360),lt&&(Vt+=Math.abs(ee)*(ut?1:2)),xt===0?Ct=Vt:xt===90?bt=Vt:xt===180?Ct=-Vt:xt===270?bt=-Vt:(Ct=Vt*Math.cos(xt*Math.PI/180),bt=Vt*Math.sin(xt*Math.PI/180)),tt.Mc()&<&&(Vt=y.ga(lr,At.alloc()),zt=At.allocAt(Vt.x+1e3*Ct,Vt.y+1e3*bt),this.getLinkPointFromPoint(a,y,Vt,zt,!0,ft),At.free(Vt),At.free(zt))),Vt=this.getLinkPoint(E,b,x,!1,ut,a,y);var oe=Qt=zt=0;if(ut||!ot||lt){var ce=this.computeEndSegmentLength(E,b,x,!1);oe=this.getLinkDirection(E,b,Vt,x,!1,ut,a,y),lt&&(ot||tt.D(x)||!ut&&tt.x+x.x===1&&tt.y+x.y===1)&&(oe+=ut?0:30,0>ee&&(oe+=180)),0>oe?oe+=360:360<=oe&&(oe-=360),lt&&(ce+=Math.abs(ee)*(ut?1:2)),oe===0?zt=ce:oe===90?Qt=ce:oe===180?zt=-ce:oe===270?Qt=-ce:(zt=ce*Math.cos(oe*Math.PI/180),Qt=ce*Math.sin(oe*Math.PI/180)),x.Mc()&<&&(x=b.ga(lr,At.alloc()),tt=At.allocAt(x.x+1e3*zt,x.y+1e3*Qt),this.getLinkPointFromPoint(E,b,x,tt,!1,Vt),At.free(x),At.free(tt))}x=ft,(ut||!rt||lt)&&(x=new At(ft.x+Ct,ft.y+bt)),tt=Vt,(ut||!ot||lt)&&(tt=new At(Vt.x+zt,Vt.y+Qt)),!yt&&!ut&&rt&&3<z&&this.adjustPoints(0,ft,z-2,tt)?this.dd(z-1,Vt):!yt&&!ut&&ot&&3<z&&this.adjustPoints(1,x,z-1,Vt)?this.dd(0,ft):!yt&&(ut?6<=z:4<z)&&this.adjustPoints(1,x,z-2,tt)?(this.dd(0,ft),this.dd(z-1,Vt)):(this.Fj(),this.ne(ft),(ut||!rt||lt)&&this.ne(x),ut&&this.addOrthoPoints(x,xt,tt,oe,a,E),(ut||!ot||lt)&&this.ne(tt),this.ne(Vt))}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}Nn.prototype.getLinkPointFromPoint=function(a,y,x,E,b,z){if(z===void 0&&(z=new At),a===null||y===null)return z.assign(x),z;if(a.isVisible()||(b=a.findVisibleNode(),b!==null&&b!==a&&(y=b.port)),a=null,b=y.panel,b===null||b.se()||(b=b.panel),b===null){b=E.x,E=E.y;var tt=x.x;x=x.y}else{a=b.oe,b=1/(a.m11*a.m22-a.m12*a.m21),tt=a.m22*b;var rt=-a.m12*b,ot=-a.m21*b,lt=a.m11*b,ut=b*(a.m21*a.dy-a.m22*a.dx),ft=b*(a.m12*a.dx-a.m11*a.dy);b=E.x*tt+E.y*ot+ut,E=E.x*rt+E.y*lt+ft,tt=x.x*tt+x.y*ot+ut,x=x.x*rt+x.y*lt+ft}return y.Sj(b,E,tt,x,z),a!==null&&z.transform(a),z};function Um(a,y){var x=y.Zn;return x===null&&(x=new Gc,x.port=y,x.node=y.part,y.Zn=x),sS(x,a)}Nn.prototype.getLinkPoint=function(a,y,x,E,b,z,tt,rt){if(rt===void 0&&(rt=new At),x.sb()&&!Hf(x))return y.ga(x,rt),rt;if(x.$c()){var ot=Um(this,y);if(ot!==null){if(rt.assign(ot.Zo),b&&this.routing===eS){var lt=Um(this,tt);if(lt!==null&&ot.Gl<lt.Gl){ot=At.alloc(),lt=At.alloc();var ut=new Be(y.ga(_r,ot),y.ga(lo,lt)),ft=this.computeSpot(!E,tt);a=this.getLinkPoint(z,tt,ft,!E,b,a,y,lt),(x.Hf(is)||x.Hf(Qo))&&a.y>=ut.y&&a.y<=ut.y+ut.height?rt.y=a.y:(x.Hf(Pa)||x.Hf(ps))&&a.x>=ut.x&&a.x<=ut.x+ut.width&&(rt.x=a.x),At.free(ot),At.free(lt)}}return rt}}return x=y.ga(Ym(x),At.alloc()),this.pointsCount>(b?6:2)?(tt=E?this.i(1):this.i(this.pointsCount-2),b&&(tt=Kv(x,tt.copy()))):(ot=this.computeSpot(!E,tt),z=At.alloc(),tt=tt.ga(Ym(ot),z),b&&(tt=Kv(x,tt)),At.free(z)),this.getLinkPointFromPoint(a,y,x,tt,E,rt),At.free(x),rt},Nn.prototype.getLinkDirection=function(a,y,x,E,b,z,tt,rt){t:if(E.sb())var ot=E.x>E.y?E.x>1-E.y?0:E.x<1-E.y?270:315:E.x<E.y?E.x>1-E.y?90:E.x<1-E.y?180:135:.5>E.x?225:.5<E.x?45:0;else{if(E.$c()&&(ot=Um(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(lr,At.alloc()),this.pointsCount>(z?6:2)?(rt=b?this.i(1):this.i(this.pointsCount-2),rt=z?Kv(ot,rt.copy()):x):(x=At.alloc(),rt=rt.ga(lr,x),At.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,At.free(ot),ot=x}return E.Mc()&&tt.Td(a)&&(ot+=180,360<=ot&&(ot-=360)),Hf(E)||(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},Nn.prototype.computeEndSegmentLength=function(a,y,x,E){return y!==null&&x.$c()&&(a=Um(this,y),a!==null)?a.Ju:(a=E?this.fromEndSegmentLength:this.toEndSegmentLength,y!==null&&isNaN(a)&&(a=E?y.fromEndSegmentLength:y.toEndSegmentLength),isNaN(a)&&(a=10),a)},Nn.prototype.computeSpot=function(a,y){return y===void 0&&(y=null),a?(a=y||this.fromPort,a===null?a=lr:(y=this.fromSpot,y.Xb()&&(y=a.fromSpot),a=y===wa?ar:y)):(a=y||this.toPort,a===null?a=lr:(y=this.toSpot,y.Xb()&&(y=a.toSpot),a=y===wa?ar:y)),a};function Hf(a){return a===ar||a.x===.5&&a.y===.5}function Ym(a){return a.x===.5&&a.y===.5?a:lr}Nn.prototype.computeOtherPoint=function(a,y){return this.computeAdjusting()!==Ls&&4<this.pointsCount?this.computeMidPoint(new At):(a=y.Zn,a=a!==null?sS(a,this):null,a!==null?a.Zo:y.ga(lr))},Nn.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},Nn.prototype.Cf=function(a,y,x,E,b,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=ae.alloc(),tt.reset()),tt.multiply(this.transform),this.fh(a,tt))return mv(this,y,x,b),z===void 0&&ae.free(tt),!0;if(this.Yc(a,tt)){var rt=!1;if(!this.isAtomic)for(var ot=this.O.s,lt=ot.length;lt--;){var ut=ot[lt];if(ut.visible||ut===this.locationObject){var ft=ut.actualBounds,yt=this.naturalBounds;if(!(ft.x>yt.width||ft.y>yt.height||0>ft.x+ft.width||0>ft.y+ft.height)){if(ft=ae.alloc(),ft.set(tt),ut instanceof wn)rt=ut.Cf(a,y,x,E,b,ft);else if(this.path===ut){if(ut instanceof cr)if(rt=a,yt=E,ut.pickable===!1)rt=!1;else if(ft.multiply(ut.transform),yt)t:{var xt=rt,Ct=ft;if(ut.fh(xt,Ct))rt=!0;else{if(Ct===void 0&&(Ct=ut.transform,xt.Re(ut.actualBounds))){rt=!0;break t}rt=xt.left,yt=xt.right;var bt=xt.top;xt=xt.bottom;var Vt=At.alloc(),zt=At.alloc(),Qt=At.alloc(),ee=ae.alloc();ee.set(Ct),ee.bv(ut.transform),ee.Vj(),zt.x=yt,zt.y=bt,zt.transform(ee),Vt.x=rt,Vt.y=bt,Vt.transform(ee),Ct=!1,tc(ut,Vt,zt,Qt)?Ct=!0:(Vt.x=yt,Vt.y=xt,Vt.transform(ee),tc(ut,Vt,zt,Qt)?Ct=!0:(zt.x=rt,zt.y=xt,zt.transform(ee),tc(ut,Vt,zt,Qt)?Ct=!0:(Vt.x=rt,Vt.y=bt,Vt.transform(ee),tc(ut,Vt,zt,Qt)&&(Ct=!0)))),ae.free(ee),At.free(Vt),At.free(zt),At.free(Qt),rt=Ct}}else rt=ut.fh(rt,ft)}else rt=Ma(ut,a,E,ft);rt&&(yt=ut,y!==null&&(yt=y(ut)),yt&&(x===null||x(yt))&&b.add(yt)),ae.free(ft)}}}return z===void 0&&ae.free(tt),rt||this.background!==null||this.areaBackground!==null}return z===void 0&&ae.free(tt),!1},Nn.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?ml:this.curve},Nn.prototype.computeCorner=function(){if(this.curve===ml)return 0;var a=this.corner;return(isNaN(a)||0>a)&&(a=10),a},Nn.prototype.findMidLabel=function(){for(var a=this.path,y=this.O.s,x=y.length,E=0;E<x;E++){var b=y[E];if(b!==a&&!b.isPanelMain&&(b.segmentIndex===-1/0||isNaN(b.segmentIndex)))return b}for(a=this.labelNodes;a.next();)if(y=a.value,y.segmentIndex===-1/0||isNaN(y.segmentIndex))return y;return null},Nn.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 E=this.findMidLabel();if(E!==null){var b=E.naturalBounds,z=E.margin,tt=isNaN(b.width)?30:b.width*E.scale+z.left+z.right;b=isNaN(b.height)?14:b.height*E.scale+z.top+z.bottom,E=E.segmentOrientation,E===sp||E===qm||E===Qv?a=Math.max(a,b):E===up||E===dp||E===lp||E===hp?a=Math.max(a,tt):(y=y.ga(lr).ab(x.ga(lr))/180*Math.PI,a=Math.max(a,Math.abs(Math.sin(y)*tt)+Math.abs(Math.cos(y)*b)+1)),this.curve===ml&&(a*=1.333)}}return a},Nn.prototype.arrangeBundledLinks=function(a,y){if(y)for(y=0;y<a.length;y++){var x=a[y];x.computeAdjusting()===Ls&&x.bb()}},Nn.prototype.computeCurviness=function(){var a=this.curviness;if(isNaN(a)){a=nS;var y=this.Sf;if(y!==null){for(var x=Yn(),E=0,b=y.links,z=0;z<b.length;z++){var tt=b[z].computeSpacing();x.push(tt),E+=tt}for(E=-E/2,z=0;z<b.length;z++){if(b[z]===this){a=E+x[z]/2;break}E+=x[z]}y.Ds===this.fromNode&&(a=-a),si(x)}}return a},Nn.prototype.computeThickness=function(){if(!this.isVisible())return 0;var a=this.path;return a!==null?Math.max(a.strokeWidth,1):1},Nn.prototype.hasCurviness=function(){return!isNaN(this.curviness)||this.Sf!==null},Nn.prototype.adjustPoints=function(a,y,x,E){var b=this.computeAdjusting();if(this.isOrthogonal){if(b===Qm)return!1;b===$m&&(b=ap)}switch(b){case Qm:var z=this.i(a),tt=this.i(x);if(!z.Xa(y)||!tt.Xa(E)){b=z.x,z=z.y;var rt=tt.x-b,ot=tt.y-z,lt=Math.sqrt(rt*rt+ot*ot);if(!_t.$(lt,0)){if(_t.$(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 ft=y.y;rt=E.x-tt;var yt=E.y-ft;for(ot=Math.sqrt(rt*rt+yt*yt),_t.$(rt,0)?yt=0>yt?-Math.PI/2:Math.PI/2:(yt=Math.atan(yt/Math.abs(rt)),0>rt&&(yt=Math.PI-yt)),lt=ot/lt,ut=yt-ut,this.dd(a,y),a+=1;a<x;a++)y=this.i(a),rt=y.x-b,ot=y.y-z,y=Math.sqrt(rt*rt+ot*ot),_t.$(y,0)||(_t.$(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*=lt,this.L(a,tt+y*Math.cos(rt),ft+y*Math.sin(rt)));this.dd(x,E)}}return!0;case $m:if(z=this.i(a),ft=this.i(x),!z.Xa(y)||!ft.Xa(E)){b=z.x,z=z.y,tt=ft.x,ft=ft.y,lt=(tt-b)*(tt-b)+(ft-z)*(ft-z),rt=y.x,ut=y.y,ot=E.x,yt=E.y;var xt=1;if(ot-rt!==0){var Ct=(yt-ut)/(ot-rt);xt=Math.sqrt(1+1/(Ct*Ct))}else Ct=9e9;for(this.dd(a,y),a+=1;a<x;a++){y=this.i(a);var bt=y.x,Vt=y.y,zt=.5;lt!==0&&(zt=((b-bt)*(b-tt)+(z-Vt)*(z-ft))/lt);var Qt=b+zt*(tt-b),ee=z+zt*(ft-z);y=Math.sqrt((bt-Qt)*(bt-Qt)+(Vt-ee)*(Vt-ee)),Vt<Ct*(bt-Qt)+ee&&(y=-y),0<Ct&&(y=-y),bt=rt+zt*(ot-rt),zt=ut+zt*(yt-ut),Ct!==0?(y=bt+y/xt,this.L(a,y,zt-(y-bt)/Ct)):this.L(a,bt,zt+y)}this.dd(x,E)}return!0;case ap:t:{if(this.isOrthogonal&&(b=this.i(a),z=this.i(a+1),tt=this.i(a+2),rt=z.x,ut=z.y,ft=rt,lt=ut,_t.B(b.y,z.y)?_t.B(z.x,tt.x)?ut=y.y:_t.B(z.y,tt.y)&&(rt=y.x):_t.B(b.x,z.x)&&(_t.B(z.y,tt.y)?rt=y.x:_t.B(z.x,tt.x)&&(ut=y.y)),this.L(a+1,rt,ut),b=this.i(x),z=this.i(x-1),tt=this.i(x-2),rt=z.x,ut=z.y,ot=rt,yt=ut,_t.B(b.y,z.y)?_t.B(z.x,tt.x)?ut=E.y:_t.B(z.y,tt.y)&&(rt=E.x):_t.B(b.x,z.x)&&(_t.B(z.y,tt.y)?rt=E.x:_t.B(z.x,tt.x)&&(ut=E.y)),this.L(x-1,rt,ut),Uv(this))){this.L(a+1,ft,lt),this.L(x-1,ot,yt),x=!1;break t}this.dd(a,y),this.dd(x,E),x=!0}return x;default:return!1}},Nn.prototype.addOrthoPoints=function(a,y,x,E,b,z){0>y?y+=360:360<=y&&(y-=360),0>E?E+=360:360<=E&&(E-=360);var tt=E;y=315<=y||45>y?0:45<=y&&135>y?90:135<=y&&225>y?180:270,E=315<=E||45>E?0:45<=E&&135>E?90:135<=E&&225>E?180:270;var rt=b.actualBounds.copy(),ot=z.actualBounds.copy();if(rt.w()&&ot.w()){rt.Bc(cp,cp),ot.Bc(cp,cp),rt.Ye(a),ot.Ye(x);var lt=At.alloc(),ut=At.alloc();y===0?x.x>a.x||E===270&&x.y<a.y&&ot.right>a.x||E===90&&x.y>a.y&&ot.right>a.x?(lt.h(x.x,a.y),ut.h(x.x,(a.y+x.y)/2),E===180?(lt.x=this.computeMidOrthoPosition(a.x,a.y,x.x,x.y,!1),ut.x=lt.x,ut.y=x.y):E===270&&x.y<a.y||E===90&&x.y>a.y?(lt.x=a.x<ot.left?this.computeMidOrthoPosition(a.x,a.y,ot.left,x.y,!1):a.x<ot.right&&(E===270&&a.y<ot.top||E===90&&a.y>ot.bottom)?this.computeMidOrthoPosition(a.x,a.y,x.x,x.y,!1):ot.right,ut.x=lt.x,ut.y=x.y):E===0&&a.x<ot.left&&a.y>ot.top&&a.y<ot.bottom&&(lt.x=a.x,lt.y=a.y<x.y?Math.min(x.y,ot.top):Math.max(x.y,ot.bottom),ut.y=lt.y)):(lt.h(a.x,x.y),ut.h((a.x+x.x)/2,x.y),(E===180||E===90&&x.y<rt.top||E===270&&x.y>rt.bottom)&&(E===180&&(ot.ca(a)||rt.ca(x))?lt.y=this.computeMidOrthoPosition(a.x,a.y,x.x,x.y,!0):x.y<a.y&&(E===180||E===90)?lt.y=this.computeMidOrthoPosition(a.x,rt.top,x.x,Math.max(x.y,ot.bottom),!0):x.y>a.y&&(E===180||E===270)&&(lt.y=this.computeMidOrthoPosition(a.x,rt.bottom,x.x,Math.min(x.y,ot.top),!0)),ut.x=x.x,ut.y=lt.y),lt.y>rt.top&<.y<rt.bottom&&(x.x>=rt.left&&x.x<=a.x||a.x<=ot.right&&a.x>=x.x?(E===90||E===270)&&(lt.h(Math.max((a.x+x.x)/2,a.x),a.y),ut.h(lt.x,x.y)):(lt.y=E===270||(E===0||E===180)&&x.y<a.y?Math.min(x.y,E===0?rt.top:Math.min(rt.top,ot.top)):Math.max(x.y,E===0?rt.bottom:Math.max(rt.bottom,ot.bottom)),ut.x=x.x,ut.y=lt.y))):y===180?x.x<a.x||E===270&&x.y<a.y&&ot.left<a.x||E===90&&x.y>a.y&&ot.left<a.x?(lt.h(x.x,a.y),ut.h(x.x,(a.y+x.y)/2),E===0?(lt.x=this.computeMidOrthoPosition(a.x,a.y,x.x,x.y,!1),ut.x=lt.x,ut.y=x.y):E===270&&x.y<a.y||E===90&&x.y>a.y?(lt.x=a.x>ot.right?this.computeMidOrthoPosition(a.x,a.y,ot.right,x.y,!1):a.x>ot.left&&(E===270&&a.y<ot.top||E===90&&a.y>ot.bottom)?this.computeMidOrthoPosition(a.x,a.y,x.x,x.y,!1):ot.left,ut.x=lt.x,ut.y=x.y):E===180&&a.x>ot.right&&a.y>ot.top&&a.y<ot.bottom&&(lt.x=a.x,lt.y=a.y<x.y?Math.min(x.y,ot.top):Math.max(x.y,ot.bottom),ut.y=lt.y)):(lt.h(a.x,x.y),ut.h((a.x+x.x)/2,x.y),(E===0||E===90&&x.y<rt.top||E===270&&x.y>rt.bottom)&&(E===0&&(ot.ca(a)||rt.ca(x))?lt.y=this.computeMidOrthoPosition(a.x,a.y,x.x,x.y,!0):x.y<a.y&&(E===0||E===90)?lt.y=this.computeMidOrthoPosition(a.x,rt.top,x.x,Math.max(x.y,ot.bottom),!0):x.y>a.y&&(E===0||E===270)&&(lt.y=this.computeMidOrthoPosition(a.x,rt.bottom,x.x,Math.min(x.y,ot.top),!0)),ut.x=x.x,ut.y=lt.y),lt.y>rt.top&<.y<rt.bottom&&(x.x<=rt.right&&x.x>=a.x||a.x>=ot.left&&a.x<=x.x?(E===90||E===270)&&(lt.h(Math.min((a.x+x.x)/2,a.x),a.y),ut.h(lt.x,x.y)):(lt.y=E===270||(E===0||E===180)&&x.y<a.y?Math.min(x.y,E===180?rt.top:Math.min(rt.top,ot.top)):Math.max(x.y,E===180?rt.bottom:Math.max(rt.bottom,ot.bottom)),ut.x=x.x,ut.y=lt.y))):y===90?x.y>a.y||E===180&&x.x<a.x&&ot.bottom>a.y||E===0&&x.x>a.x&&ot.bottom>a.y?(lt.h(a.x,x.y),ut.h((a.x+x.x)/2,x.y),E===270?(lt.y=this.computeMidOrthoPosition(a.x,a.y,x.x,x.y,!0),ut.x=x.x,ut.y=lt.y):E===180&&x.x<a.x||E===0&&x.x>a.x?(lt.y=a.y<ot.top?this.computeMidOrthoPosition(a.x,a.y,x.x,ot.top,!0):a.y<ot.bottom&&(E===180&&a.x<ot.left||E===0&&a.x>ot.right)?this.computeMidOrthoPosition(a.x,a.y,x.x,x.y,!0):ot.bottom,ut.x=x.x,ut.y=lt.y):E===90&&a.y<ot.top&&a.x>ot.left&&a.x<ot.right&&(lt.x=a.x<x.x?Math.min(x.x,ot.left):Math.max(x.x,ot.right),lt.y=a.y,ut.x=lt.x)):(lt.h(x.x,a.y),ut.h(x.x,(a.y+x.y)/2),(E===270||E===0&&x.x<rt.left||E===180&&x.x>rt.right)&&(E===270&&(ot.ca(a)||rt.ca(x))?lt.x=this.computeMidOrthoPosition(a.x,a.y,x.x,x.y,!1):x.x<a.x&&(E===270||E===0)?lt.x=this.computeMidOrthoPosition(rt.left,a.y,Math.max(x.x,ot.right),x.y,!1):x.x>a.x&&(E===270||E===180)&&(lt.x=this.computeMidOrthoPosition(rt.right,a.y,Math.min(x.x,ot.left),x.y,!1)),ut.x=lt.x,ut.y=x.y),lt.x>rt.left&<.x<rt.right&&(x.y>=rt.top&&x.y<=a.y||a.y<=ot.bottom&&a.y>=x.y?(E===0||E===180)&&(lt.h(a.x,Math.max((a.y+x.y)/2,a.y)),ut.h(x.x,lt.y)):(lt.x=E===180||(E===90||E===270)&&x.x<a.x?Math.min(x.x,E===90?rt.left:Math.min(rt.left,ot.left)):Math.max(x.x,E===90?rt.right:Math.max(rt.right,ot.right)),ut.x=lt.x,ut.y=x.y))):x.y<a.y||E===180&&x.x<a.x&&ot.top<a.y||E===0&&x.x>a.x&&ot.top<a.y?(lt.h(a.x,x.y),ut.h((a.x+x.x)/2,x.y),E===90?(lt.y=this.computeMidOrthoPosition(a.x,a.y,x.x,x.y,!0),ut.x=x.x,ut.y=lt.y):E===180&&x.x<a.x||E===0&&x.x>=a.x?(lt.y=a.y>ot.bottom?this.computeMidOrthoPosition(a.x,a.y,x.x,ot.bottom,!0):a.y>ot.top&&(E===180&&a.x<ot.left||E===0&&a.x>ot.right)?this.computeMidOrthoPosition(a.x,a.y,x.x,x.y,!0):ot.top,ut.x=x.x,ut.y=lt.y):E===270&&a.y>ot.bottom&&a.x>ot.left&&a.x<ot.right&&(lt.x=a.x<x.x?Math.min(x.x,ot.left):Math.max(x.x,ot.right),lt.y=a.y,ut.x=lt.x)):(lt.h(x.x,a.y),ut.h(x.x,(a.y+x.y)/2),(E===90||E===0&&x.x<rt.left||E===180&&x.x>rt.right)&&(E===90&&(ot.ca(a)||rt.ca(x))?lt.x=this.computeMidOrthoPosition(a.x,a.y,x.x,x.y,!1):x.x<a.x&&(E===90||E===0)?lt.x=this.computeMidOrthoPosition(rt.left,a.y,Math.max(x.x,ot.right),x.y,!1):x.x>a.x&&(E===90||E===180)&&(lt.x=this.computeMidOrthoPosition(rt.right,a.y,Math.min(x.x,ot.left),x.y,!1)),ut.x=lt.x,ut.y=x.y),lt.x>rt.left&<.x<rt.right&&(x.y<=rt.bottom&&x.y>=a.y||a.y>=ot.top&&a.y<=x.y?(E===0||E===180)&&(lt.h(a.x,Math.min((a.y+x.y)/2,a.y)),ut.h(x.x,lt.y)):(lt.x=E===180||(E===90||E===270)&&x.x<a.x?Math.min(x.x,E===270?rt.left:Math.min(rt.left,ot.left)):Math.max(x.x,E===270?rt.right:Math.max(rt.right,ot.right)),ut.x=lt.x,ut.y=x.y)));var ft=x;if(this.isAvoiding){var yt=this.diagram;if(yt===null||b===z||this.layer.isTemporary||!Cf(yt)||rt.ca(ft)&&!z.Td(b)||ot.ca(a)&&!b.Td(z))y=!1;else{var xt=Ef(yt,!0,this.containingGroup,null);if(this.segmentIndex!==17&&xt.Yj(Math.min(a.x,lt.x),Math.min(a.y,lt.y),Math.abs(a.x-lt.x),Math.abs(a.y-lt.y))&&xt.Yj(Math.min(lt.x,ut.x),Math.min(lt.y,ut.y),Math.abs(lt.x-ut.x),Math.abs(lt.y-ut.y))&&xt.Yj(Math.min(ut.x,ft.x),Math.min(ut.y,ft.y),Math.abs(ut.x-ft.x),Math.abs(ut.y-ft.y)))y=!1;else{b=a,z=ft;var Ct=x=null;if(yt.isVirtualized){yt=xt.bounds.copy(),yt.Bc(-xt.Ho,-xt.Go);var bt=At.alloc();Vf(xt,a.x,a.y)||(_t.Ff(yt.x,yt.y,yt.x+yt.width,yt.y+yt.height,a.x,a.y,lt.x,lt.y,bt)?(x=a=bt.copy(),y=bt.ab(lt)):_t.Ff(yt.x,yt.y,yt.x+yt.width,yt.y+yt.height,lt.x,lt.y,ut.x,ut.y,bt)?(x=a=bt.copy(),y=bt.ab(ut)):_t.Ff(yt.x,yt.y,yt.x+yt.width,yt.y+yt.height,ut.x,ut.y,ft.x,ft.y,bt)&&(x=a=bt.copy(),y=bt.ab(ft))),Vf(xt,ft.x,ft.y)||(_t.Ff(yt.x,yt.y,yt.x+yt.width,yt.y+yt.height,ft.x,ft.y,ut.x,ut.y,bt)?(Ct=ft=bt.copy(),E=ut.ab(bt)):_t.Ff(yt.x,yt.y,yt.x+yt.width,yt.y+yt.height,ut.x,ut.y,lt.x,lt.y,bt)?(Ct=ft=bt.copy(),E=lt.ab(bt)):_t.Ff(yt.x,yt.y,yt.x+yt.width,yt.y+yt.height,lt.x,lt.y,a.x,a.y,bt)&&(Ct=ft=bt.copy(),E=a.ab(bt))),At.free(bt)}rt=rt.copy().ed(ot),rt.Bc(xt.Ho*xt.Os,xt.Go*xt.Os),oS(xt,a,y,ft,E,rt,!0),ot=Xu(xt,ft.x,ft.y),!xt.abort&&ot>=Kf&&(rS(xt),rt.Bc(xt.Ho*xt.Hx,xt.Go*xt.Ix),oS(xt,a,y,ft,E,rt,!1),ot=Xu(xt,ft.x,ft.y)),!xt.abort&&ot<Kf&&Xu(xt,ft.x,ft.y)!==jh?(Yv(this,xt,ft.x,ft.y,E,!0,tt),rt=this.i(2),4>this.pointsCount?(y===0||y===180?(rt.x=a.x,rt.y=ft.y):(rt.x=ft.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?_t.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)):_t.B(rt.y,tt.y)?(Math.abs(a.y-rt.y)<=xt.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)&&(_t.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)):_t.B(rt.x,tt.x)?(Math.abs(a.x-rt.x)<=xt.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,b.x,x.y):this.m(2,x.x,b.y)),Ct!==null&&(E===0||E===180?this.yf(z.x,Ct.y):this.yf(Ct.x,z.y)),y=!0):y=!1}}}else y=!1;y||(this.ne(lt.copy()),this.ne(ut.copy())),At.free(lt),At.free(ut)}},Nn.prototype.computeMidOrthoPosition=function(a,y,x,E,b){var z=0;return!this.hasCurviness()||this.computeSpot(!0,this.fromPort).$c()||this.computeSpot(!1,this.toPort).$c()||(z=this.computeCurviness()),b?(y+E)/2+z:(a+x)/2+z};function Uv(a){if(a.diagram===null||!a.isAvoiding||!Cf(a.diagram))return!1;var y=a.points.s,x=y.length;if(4>x)return!1;a=Ef(a.diagram,!0,a.containingGroup,null);for(var E=1;E<x-2;E++){var b=y[E],z=y[E+1];if(!a.Yj(Math.min(b.x,z.x),Math.min(b.y,z.y),Math.abs(b.x-z.x),Math.abs(b.y-z.y)))return!0}return!1}function Yv(a,y,x,E,b,z,tt){var rt=y.Ho,ot=y.Go,lt=Xu(y,x,E),ut=x,ft=E;for(b===0?ut+=rt:b===90?ft+=ot:b===180?ut-=rt:ft-=ot,b!==tt&<>ic&&Xu(y,ut,ft)!==lt-1&&(Xu(y,x-rt,E)===lt-1?(b=180,ut=x-rt,ft=E):Xu(y,x+rt,E)===lt-1?(b=0,ut=x+rt,ft=E):Xu(y,x,E-ot)===lt-1?(b=270,ut=x,ft=E-ot):Xu(y,x,E+ot)===lt-1&&(b=90,ut=x,ft=E+ot));lt>ic&&Xu(y,ut,ft)===lt-1;)x=ut,E=ft,b===0?ut+=rt:b===90?ft+=ot:b===180?ut-=rt:ft-=ot,--lt;z?lt>ic&&(b===180||b===0?x=Math.floor(x/rt)*rt+rt/2:(b===90||b===270)&&(E=Math.floor(E/ot)*ot+ot/2)):(x=Math.floor(x/rt)*rt+rt/2,E=Math.floor(E/ot)*ot+ot/2),lt>ic&&(z=b,tt=x,ut=E,b===0?(z=90,ut+=ot):b===90?(z=180,tt-=rt):b===180?(z=270,ut-=ot):b===270&&(z=0,tt+=rt),Xu(y,tt,ut)===lt-1?Yv(a,y,tt,ut,z,!1,z):(tt=x,ut=E,b===0?(z=270,ut-=ot):b===90?(z=0,tt+=rt):b===180?(z=90,ut+=ot):b===270&&(z=180,tt-=rt),Xu(y,tt,ut)===lt-1&&Yv(a,y,tt,ut,z,!1,z))),a.yf(x,E)}Nn.prototype.ez=function(a){var y=a.x;a=a.y;for(var x=this.i(0),E=this.i(1),b=Xn(y,a,x.x,x.y,E.x,E.y),z=0,tt=1;tt<this.pointsCount-1;tt++){x=this.i(tt+1);var rt=Xn(y,a,E.x,E.y,x.x,x.y);E=x,rt<b&&(z=tt,b=rt)}return z},Nn.prototype.qc=function(){this.lk=!1,this.v()},Nn.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,E=0;E<x;E++){var b=y[E];b!==a&&b.isPanelMain&&b instanceof cr&&(b.ua=this.ua)}}},Nn.prototype.makeGeometry=function(){var a=this.ua,y=this.pointsCount,x=!1,E=this.diagram;E!==null&&nc(this)&&E.Eh.contains(this)&&(this.ml.width!==0||this.ml.height!==0)&&(E.animationManager.isAnimating||E.currentTool!==E.toolManager)&&(x=!0);var b=this.i(0).copy(),z=b.copy();E=this.Nb.s;var tt=this.computeCurve();if(tt===ml&&3<=y&&!_t.$(this.smoothness,0))if(y===3){var rt=this.i(1);E=Math.min(b.x,rt.x);var ot=Math.min(b.y,rt.y);rt=this.i(2),E=Math.min(E,rt.x),ot=Math.min(ot,rt.y)}else{if(this.isOrthogonal)for(ot=0;ot<y;ot++)rt=E[ot],z.x=Math.min(rt.x,z.x),z.y=Math.min(rt.y,z.y);else for(E=3;E<y;E+=3)E+3>=y&&(E=y-1),ot=this.i(E),z.x=Math.min(ot.x,z.x),z.y=Math.min(ot.y,z.y);E=z.x,ot=z.y}else{for(ot=0;ot<y;ot++)rt=E[ot],z.x=Math.min(rt.x,z.x),z.y=Math.min(rt.y,z.y);E=z.x,ot=z.y}if(E-=this.su.x,ot-=this.su.y,b.x-=E,b.y-=ot,y!==2||nc(this)){if(a.type=fe.o,rt=N1(a),this.computeShortLength(!0)!==0&&(b=Rc(this,b,!0,z)),Zf(rt,b.x,b.y,!1),tt===ml&&3<=y&&!_t.$(this.smoothness,0))if(y===3)x=this.i(1),y=x.x-E,x=x.y-ot,b=this.i(2).copy(),b.x-=E,b.y-=ot,this.computeShortLength(!1)!==0&&(b=Rc(this,b,!1,z)),Dh(rt,y,x,y,x,b.x,b.y);else if(this.isOrthogonal){y=At.allocAt(E,ot),x=At.alloc(),x.assign(this.i(1)),z=At.allocAt(E,ot),b=At.allocAt(E,ot),tt=this.i(0);for(var lt,ut=this.smoothness/3,ft=1;ft<this.pointsCount-1;ft++){lt=this.i(ft);var yt=tt,xt=lt,Ct=this.i(Xv(this,lt,ft,!1));if((!_t.$(yt.x,xt.x)||!_t.$(xt.x,Ct.x))&&(!_t.$(yt.y,xt.y)||!_t.$(xt.y,Ct.y))){var bt=ut;isNaN(bt)&&(bt=this.smoothness/3);var Vt=yt.x;yt=yt.y;var zt=xt.x;xt=xt.y;var Qt=Ct.x;Ct=Ct.y;var ee=bt*Xm(Vt,yt,zt,xt);bt*=Xm(zt,xt,Qt,Ct),_t.$(yt,xt)&&_t.$(zt,Qt)&&(zt>Vt?Ct>xt?(z.x=zt-ee,z.y=xt-ee,b.x=zt+bt,b.y=xt+bt):(z.x=zt-ee,z.y=xt+ee,b.x=zt+bt,b.y=xt-bt):Ct>xt?(z.x=zt+ee,z.y=xt-ee,b.x=zt-bt,b.y=xt+bt):(z.x=zt+ee,z.y=xt+ee,b.x=zt-bt,b.y=xt-bt)),_t.$(Vt,zt)&&_t.$(xt,Ct)&&(xt>yt?(Qt>zt?(z.x=zt-ee,z.y=xt-ee,b.x=zt+bt):(z.x=zt+ee,z.y=xt-ee,b.x=zt-bt),b.y=xt+bt):(Qt>zt?(z.x=zt-ee,z.y=xt+ee,b.x=zt+bt):(z.x=zt+ee,z.y=xt+ee,b.x=zt-bt),b.y=xt-bt)),(_t.$(Vt,zt)&&_t.$(zt,Qt)||_t.$(yt,xt)&&_t.$(xt,Ct))&&(Vt=.5*(Vt+Qt),yt=.5*(yt+Ct),z.x=Vt,z.y=yt,b.x=Vt,b.y=yt),(ft===1||ft===2&&_t.$(tt.x,this.i(0).x)&&_t.$(tt.y,this.i(0).y))&&(x.x=.5*(tt.x+lt.x),x.y=.5*(tt.y+lt.y)),Dh(rt,x.x-E,x.y-ot,z.x-E,z.y-ot,lt.x-E,lt.y-ot),y.set(z),x.set(b),tt=lt}}lt=tt.x,tt=tt.y,ut=this.i(this.pointsCount-1),this.computeShortLength(!1)!==0&&(ut=Rc(this,ut.copy(),!1,Zn)),lt=.5*(lt+ut.x),tt=.5*(tt+ut.y),Dh(rt,b.x-E,b.y-ot,lt-E,tt-ot,ut.x-E,ut.y-ot),At.free(y),At.free(x),At.free(z),At.free(b)}else for(x=3;x<y;x+=3)z=this.i(x-2),x+3>=y&&(x=y-1),b=this.i(x-1),tt=this.i(x),x===y-1&&this.computeShortLength(!1)!==0&&(tt=Rc(this,tt.copy(),!1,Zn)),Dh(rt,z.x-E,z.y-ot,b.x-E,b.y-ot,tt.x-E,tt.y-ot);else{for(z=At.alloc(),z.assign(this.i(0)),b=At.alloc(),b.assign(z),tt=this.computeCorner(),ft=1,lt=0;ft<y;){if(ft=Xv(this,z,ft,1<ft),ut=this.i(ft),ft>=y-1){if(!z.D(ut))this.computeShortLength(!1)!==0&&(ut=Rc(this,ut.copy(),!1,Zn)),jc(this,rt,-E,-ot,z,ut,x);else if(lt===0)for(ft=1;ft<y;)b.assign(z),ut=this.i(ft++),jc(this,rt,-E,-ot,z,ut,x),z.assign(ut);break}if(lt=Xv(this,ut,ft+1,ft<y-3),ft=-E,Vt=-ot,yt=ut,zt=this.i(lt),bt=x,_t.B(z.y,yt.y)&&_t.B(yt.x,zt.x))if(Ct=Math.min(tt,Math.abs(yt.x-b.x)/2),Ct=ee=Math.min(Ct,Math.abs(zt.y-yt.y)/2),_t.B(Ct,0))jc(this,rt,ft,Vt,z,yt,bt),z.assign(yt);else{var oe=yt.x,ce=yt.y;xt=oe,Qt=ce,yt.x>z.x?oe=yt.x-Ct:oe=yt.x+Ct,zt.y>yt.y?Qt=yt.y+ee:Qt=yt.y-ee,zt=At.allocAt(oe,ce),jc(this,rt,ft,Vt,z,zt,bt),At.free(zt),jm(rt,yt.x+ft,yt.y+Vt,xt+ft,Qt+Vt),z.h(xt,Qt)}else _t.B(z.x,yt.x)&&_t.B(yt.y,zt.y)?(Ct=Math.min(tt,Math.abs(yt.y-b.y)/2),Ct=ee=Math.min(Ct,Math.abs(zt.x-yt.x)/2),_t.B(ee,0)?(jc(this,rt,ft,Vt,z,yt,bt),z.assign(yt)):(oe=yt.x,ce=yt.y,xt=oe,Qt=ce,yt.y>z.y?ce=yt.y-Ct:ce=yt.y+Ct,zt.x>yt.x?xt=yt.x+ee:xt=yt.x-ee,zt=At.allocAt(oe,ce),jc(this,rt,ft,Vt,z,zt,bt),At.free(zt),jm(rt,yt.x+ft,yt.y+Vt,xt+ft,Qt+Vt),z.h(xt,Qt))):(jc(this,rt,ft,Vt,z,yt,bt),z.assign(yt));b.assign(ut),ft=lt}At.free(z)}zm=rt}else rt=this.i(1).copy(),rt.x-=E,rt.y-=ot,this.computeShortLength(!0)!==0&&(b=Rc(this,b,!0,z)),this.computeShortLength(!1)!==0&&(rt=Rc(this,rt,!1,z)),a.type=fe.j,a.startX=b.x,a.startY=b.y,a.endX=rt.x,a.endY=rt.y;return this.lk=!0,a};function Xm(a,y,x,E){return a=x-a,isNaN(a)||a===1/0||a===-1/0?NaN:(0>a&&(a=-a),y=E-y,isNaN(y)||y===1/0||y===-1/0?NaN:(0>y&&(y=-y),_t.$(a,0)?y:_t.$(y,0)?a:Math.sqrt(a*a+y*y)))}function Rc(a,y,x,E){var b=a.pointsCount;if(2>b)return y;if(x){var z=a.i(1);if(x=z.x-E.x,z=z.y-E.y,E=Xm(y.x,y.y,x,z),E===0)return y;b=b===2?.5*E:E,a=a.computeShortLength(!0),a>b&&(a=b),b=a*(z-y.y)/E,y.x+=a*(x-y.x)/E,y.y+=b}else{if(z=a.i(b-2),x=z.x-E.x,z=z.y-E.y,E=Xm(y.x,y.y,x,z),E===0)return y;b=b===2?.5*E:E,a=a.computeShortLength(!1),a>b&&(a=b),b=a*(y.y-z)/E,y.x-=a*(y.x-x)/E,y.y-=b}return y}function Xv(a,y,x,E){for(var b=a.pointsCount,z=y;_t.$(y.x,z.x)&&_t.$(y.y,z.y);){if(x>=b)return b-1;z=a.i(x++)}if(!_t.$(y.x,z.x)&&!_t.$(y.y,z.y))return x-1;for(var tt=z;_t.$(y.x,z.x)&&_t.$(z.x,tt.x)&&(!E||(y.y>=z.y?z.y>=tt.y:z.y<=tt.y))||_t.$(y.y,z.y)&&_t.$(z.y,tt.y)&&(!E||(y.x>=z.x?z.x>=tt.x:z.x<=tt.x));){if(x>=b)return b-1;tt=a.i(x++)}return x-2}Nn.prototype.computeJumpLength=function(){return 10};function jc(a,y,x,E,b,z,tt){if(!tt&&nc(a)){tt=a.computeJumpLength();var rt=tt/2,ot=[],lt=0;if(a.isVisible()&&(lt=Lx(a,b,z,ot)),0<lt){if(_t.B(b.y,z.y))if(b.x<z.x)for(var ut=0;ut<lt;){var ft=Math.max(b.x,Math.min(ot[ut++]-rt,z.x-tt));y.lineTo(ft+x,z.y+E);for(var yt=ft+x,xt=Math.min(ft+tt,z.x);ut<lt&&(ft=ot[ut],ft<xt+tt);)ut++,xt=Math.min(ft+rt,z.x);ft=z.y-tt+E,xt+=x;var Ct=z.y+E;a.curve===Rh?Zf(y,xt,Ct,!1):Dh(y,yt,ft,xt,ft,xt,Ct)}else for(--lt;0<=lt;){for(ut=Math.min(b.x,Math.max(ot[lt--]+rt,z.x+tt)),y.lineTo(ut+x,z.y+E),yt=ut+x,ft=Math.max(ut-tt,z.x);0<=lt&&(ut=ot[lt],ut>ft-tt);)lt--,ft=Math.max(ut-rt,z.x);ut=z.y-tt+E,ft+=x,xt=z.y+E,a.curve===Rh?Zf(y,ft,xt,!1):Dh(y,yt,ut,ft,ut,ft,xt)}else if(_t.B(b.x,z.x))if(b.y<z.y)for(ut=0;ut<lt;){for(ft=Math.max(b.y,Math.min(ot[ut++]-rt,z.y-tt)),y.lineTo(z.x+x,ft+E),yt=ft+E,ft=Math.min(ft+tt,z.y);ut<lt&&(xt=ot[ut],xt<ft+tt);)ut++,ft=Math.min(xt+rt,z.y);xt=z.x-tt+x,Ct=z.x+x,ft+=E,a.curve===Rh?Zf(y,Ct,ft,!1):Dh(y,xt,yt,xt,ft,Ct,ft)}else for(--lt;0<=lt;){for(ut=Math.min(b.y,Math.max(ot[lt--]+rt,z.y+tt)),y.lineTo(z.x+x,ut+E),yt=ut+E,ut=Math.max(ut-tt,z.y);0<=lt&&(ft=ot[lt],ft>ut-tt);)lt--,ut=Math.max(ft-rt,z.y);ft=z.x-tt+x,xt=z.x+x,ut+=E,a.curve===Rh?Zf(y,xt,ut,!1):Dh(y,ft,yt,ft,ut,xt,ut)}}}y.lineTo(z.x+x,z.y+E)}function Lx(a,y,x,E){var b=a.diagram;if(b===null||y.D(x))return 0;for(b=b.layers;b.next();){var z=b.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 Nn){if(ot===a)return 0<E.length&&E.sort(function(ut,ft){return ut-ft}),E.length;if(ot.isVisible()&&nc(ot)){var lt=ot.routeBounds;lt.w()&&a.routeBounds.Yc(lt)&&!a.usesSamePort(ot)&&(lt=ot.path,lt!==null&<.Ed()&&Fx(y,x,E,ot))}}}}}return 0<E.length&&E.sort(function(ut,ft){return ut-ft}),E.length}function Fx(a,y,x,E){for(var b=_t.B(a.y,y.y),z=E.pointsCount,tt=E.i(0),rt=At.alloc(),ot=1;ot<z;ot++){var lt=E.i(ot);if(ot<z-1){var ut=E.i(ot+1);if(tt.y===lt.y&<.y===ut.y){if(lt.x>tt.x&&ut.x>=lt.x||lt.x<tt.x&&ut.x<=lt.x)continue}else if(tt.x===lt.x&<.x===ut.x&&(lt.y>tt.y&&ut.y>=lt.y||lt.y<tt.y&&ut.y<=lt.y))continue}t:{ut=a.x;var ft=a.y,yt=y.x,xt=y.y,Ct=tt.x;tt=tt.y;var bt=lt.x,Vt=lt.y;if(_t.B(ut,yt)){if(!_t.B(ft,xt)&&_t.B(tt,Vt)&&Math.min(ft,xt)<tt&&Math.max(ft,xt)>tt&&Math.min(Ct,bt)<ut&&Math.max(Ct,bt)>ut&&!_t.B(Ct,bt)){rt.x=ut,rt.y=tt,ut=!0;break t}}else if(_t.B(ft,xt)&&_t.B(Ct,bt)&&Math.min(ut,yt)<Ct&&Math.max(ut,yt)>Ct&&Math.min(tt,Vt)<ft&&Math.max(tt,Vt)>ft&&!_t.B(tt,Vt)){rt.x=Ct,rt.y=ft,ut=!0;break t}rt.x=0,rt.y=0,ut=!1}ut&&(b?x.push(rt.x):x.push(rt.y)),tt=lt}At.free(rt)}function nc(a){return a=a.curve,a===Wf||a===Rh}function Jm(a,y){(y||nc(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()))}Nn.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 E=!1;for(x=x.layers;x.next();){var b=x.value;if(b.visible){if(b===y){E=!0;var z=!1;b=b.Pa.s;for(var tt=b.length,rt=0;rt<tt;rt++){var ot=b[rt];ot instanceof Nn&&(ot===this?z=!0:z&&tS(this,ot,a))}}else if(E)for(z=b.Pa.s,b=z.length,tt=0;tt<b;tt++)rt=z[tt],rt instanceof Nn&&tS(this,rt,a)}}}}};function tS(a,y,x){if(y!==null&&y.lk&&y.fd&&nc(y)){var E=y.routeBounds;E.w()&&(a.routeBounds.Yc(E)||x.Yc(E))&&(a.usesSamePort(y)||y.qc())}}Nn.prototype.usesSamePort=function(a){var y=this.pointsCount,x=a.pointsCount;if(0<y&&0<x){var E=this.i(0),b=a.i(0);if(E.Xa(b)||(y=this.i(y-1),a=a.i(x-1),y.Xa(a)||E.Xa(a)||y.Xa(b)))return!0}else if(this.fromNode===a.fromNode||this.toNode===a.toNode||this.fromNode===a.toNode||this.toNode===a.fromNode)return!0;return!1},Nn.prototype.isVisible=function(){if(!Bi.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 E=x;E!==null;){if(E.labeledLink===this)return!0;E=E.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},Nn.prototype.Zb=function(a){if(Bi.prototype.Zb.call(this,a),a&&Jm(this,!1),this.Sf!==null&&this.Sf.Sl(),this.wd!==null)for(var y=this.wd.iterator;y.next();)y.value.Zb(a)},Nn.prototype.computeAdjusting=function(){return this.isAvoiding&&this.diagram!==null&&this.diagram.animationManager.defaultAnimation.isAnimating?ap:this.qk};function rp(a){var y=a.ef;if(y!==null){var x=a.uf;if(x!==null&&isNaN(a.curviness)){for(var E=a.ff,b=a.vf,z=a=null,tt=y.jb.s,rt=tt.length,ot=0;ot<rt;ot++){var lt=tt[ot];(lt.ef===y&<.ff===E&<.uf===x&<.vf===b||lt.ef===x&<.ff===b&<.uf===y&<.vf===E)&&(z===null?z=lt:(a===null&&(a=[],a.push(z)),a.push(lt)))}if(a!==null){for(z=G1(y,x,E,b),z===null&&(z=new e0(y,E,x,b),Z1(y,z),Z1(x,z)),z.links=a,y=0;y<a.length;y++)a[y].Sf=z;z.Sl()}}}}function op(a){var y=a.Sf;y!==null&&isNaN(a.curviness)&&(a.Sf=null,a=y.links.indexOf(a),0<=a&&(hi(y.links,a),y.Sl()))}Nn.prototype.ph=function(){return!0},ye.Object.defineProperties(Nn.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&&Wm(y,this,x),op(this),this.C(2)),this.ef=a,a!==null&&this.Zb(a.isVisible()),this.Wf=null,this.bb();var E=this.diagram;E!==null&&E.aa&&E.partManager.setFromNodeForLink(this,a,y);var b=this.fromPort,z=this.fromPortChanged;if(z!==null){var tt=!0;E!==null&&(tt=E.aa,E.aa=!0),z(this,x,b),E!==null&&(E.aa=tt)}a!==null&&(this.uf!==a&&Hm(a,this,b),rp(this),this.C(1)),this.g("fromNode",y,a),Gf(this)}}},fromPortId:{get:function(){return this.ff},set:function(a){var y=this.ff;if(y!==a){var x=this.fromPort;x!==null&&el(x),op(this),this.ff=a;var E=this.fromPort;E!==null&&el(E);var b=this.diagram;if(b!==null){var z=this.data,tt=b.model;z!==null&&tt.ri()&&tt.xv(z,a)}x!==E&&(this.Wf=null,this.bb(),z=this.fromPortChanged,z!==null&&(tt=!0,b!==null&&(tt=b.aa,b.aa=!0),z(this,x,E),b!==null&&(b.aa=tt))),rp(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&&Wm(y,this,x),op(this),this.C(2)),this.uf=a,a!==null&&this.Zb(a.isVisible()),this.Wf=null,this.bb();var E=this.diagram;E!==null&&E.aa&&E.partManager.setToNodeForLink(this,a,y);var b=this.toPort,z=this.toPortChanged;if(z!==null){var tt=!0;E!==null&&(tt=E.aa,E.aa=!0),z(this,x,b),E!==null&&(E.aa=tt)}a!==null&&(this.ef!==a&&Hm(a,this,b),rp(this),this.C(1)),this.g("toNode",y,a),Gf(this)}}},toPortId:{get:function(){return this.vf},set:function(a){var y=this.vf;if(y!==a){var x=this.toPort;x!==null&&el(x),op(this),this.vf=a;var E=this.toPort;E!==null&&el(E);var b=this.diagram;if(b!==null){var z=this.data,tt=b.model;z!==null&&tt.ri()&&tt.Cv(z,a)}x!==E&&(this.Wf=null,this.bb(),z=this.toPortChanged,z!==null&&(tt=!0,b!==null&&(tt=b.aa,b.aa=!0),z(this,x,E),b!==null&&(b.aa=tt))),rp(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:wa},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&&el(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&&un(a,">= 0",Nn,"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:wa},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&&el(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&&un(a,">= 0",Nn,"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?pr: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&&ip(this.fromNode),this.toNode!==null&&ip(this.toNode))}},path:{get:function(){var a=this.Pb();return a instanceof cr?a:null}},routeBounds:{get:function(){this.vg();var a=this.ml,y=1/0,x=1/0,E=this.pointsCount;if(E===0)a.h(NaN,NaN,0,0);else{if(E===1)E=this.i(0),y=Math.min(E.x,y),x=Math.min(E.y,x),a.h(E.x,E.y,0,0);else if(E===2){E=this.i(0);var b=this.i(1);y=Math.min(E.x,b.x),x=Math.min(E.y,b.y),a.h(E.x,E.y,0,0),a.Ye(b)}else if(this.computeCurve()===ml&&3<=E&&!this.isOrthogonal)if(b=this.i(0),y=b.x,x=b.y,a.h(y,x,0,0),E===3){E=this.i(1),y=Math.min(E.x,y),x=Math.min(E.y,x);var z=this.i(2);y=Math.min(z.x,y),x=Math.min(z.y,x),_t.Dl(b.x,b.y,E.x,E.y,E.x,E.y,z.x,z.y,.5,a)}else for(z=3;z<E;z+=3){var tt=this.i(z-2);z+3>=E&&(z=E-1);var rt=this.i(z-1),ot=this.i(z);_t.Dl(b.x,b.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),b=ot}else for(b=this.i(0),z=this.i(1),y=Math.min(b.x,z.x),x=Math.min(b.y,z.y),a.h(b.x,b.y,0,0),a.Ye(z),b=2;b<E;b++)z=this.i(b),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 At)}},midAngle:{get:function(){return this.vg(),this.computeMidAngle()}},flattenedLengths:{get:function(){if(this.cq===null){this.fd||Km(this);for(var a=this.cq=[],y=this.pointsCount,x=0;x<y-1;x++){var E=this.i(x),b=this.i(x+1);_t.$(E.x,b.x)?(E=b.y-E.y,0>E&&(E=-E)):_t.$(E.y,b.y)?(E=b.x-E.x,0>E&&(E=-E)):E=Math.sqrt(E.Bf(b)),a.push(E)}}return this.cq}},flattenedTotalLength:{get:function(){var a=this.vt;if(isNaN(a)){for(var y=this.flattenedLengths,x=y.length,E=a=0;E<x;E++)a+=y[E];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 E=a.length%2===0;if(E){for(var b=0;b<a.length;b++)if(typeof a[b]!="number"||isNaN(a[b])){E=!1;break}}if(E)for(x=new fn,E=0;E<a.length/2;E++)b=new At(a[2*E],a[2*E+1]).freeze(),x.add(b);else{for(E=!0,b=0;b<a.length;b++){var z=a[b];if(!Ie(z)||typeof z.x!="number"||isNaN(z.x)||typeof z.y!="number"||isNaN(z.y)){E=!1;break}}if(E)for(x=new fn,E=0;E<a.length;E++)b=a[E],x.add(new At(b.x,b.y).freeze())}}else if(a instanceof fn)for(x=a.copy(),a=x.iterator;a.next();)a.value.freeze();else Gt("Link.points value is not an instance of List or Array: "+a);x.freeze(),this.Nb=x,this.qc(),Km(this),a=this.diagram,a!==null&&(a.pi||a.undoManager.isUndoingRedoing||a.As.add(this),a.animationManager.zb&&gf(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||!Hf(this.computeSpot(!0))?1:0}},lastPickIndex:{get:function(){var a=this.pointsCount;return a===0?0:2>=a?a-1:this.isOrthogonal||!Hf(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(),Jm(this,y===Rh||y===Wf||a===Rh||a===Wf),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(),Jm(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)}}}),Nn.prototype.invalidateOtherJumpOvers=Nn.prototype.Xo,Nn.prototype.findClosestSegment=Nn.prototype.ez,Nn.prototype.updateRoute=Nn.prototype.vg,Nn.prototype.invalidateRoute=Nn.prototype.bb,Nn.prototype.rollbackRoute=Nn.prototype.rv,Nn.prototype.commitRoute=Nn.prototype.zf,Nn.prototype.startRoute=Nn.prototype.uh,Nn.prototype.clearPoints=Nn.prototype.Fj,Nn.prototype.removePoint=Nn.prototype.pv,Nn.prototype.addPointAt=Nn.prototype.yf,Nn.prototype.addPoint=Nn.prototype.ne,Nn.prototype.insertPointAt=Nn.prototype.m,Nn.prototype.insertPoint=Nn.prototype.Kz,Nn.prototype.setPointAt=Nn.prototype.L,Nn.prototype.setPoint=Nn.prototype.dd,Nn.prototype.getPoint=Nn.prototype.i,Nn.prototype.getOtherPort=Nn.prototype.Cz,Nn.prototype.getOtherNode=Nn.prototype.To;var zc=null,Zc=null,Jv=new rn(Nn,"Normal",1),Mx=new rn(Nn,"Orthogonal",2),kx=new rn(Nn,"AvoidsNodes",6),eS=new rn(Nn,"AvoidsNodesStraight",7),Ls=new rn(Nn,"None",0),ml=new rn(Nn,"Bezier",9),Rh=new rn(Nn,"JumpGap",10),Wf=new rn(Nn,"JumpOver",11),ap=new rn(Nn,"End",17),Qm=new rn(Nn,"Scale",18),$m=new rn(Nn,"Stretch",19),sp=new rn(Nn,"OrientAlong",21),lp=new rn(Nn,"OrientPlus90",22),up=new rn(Nn,"OrientMinus90",23),Qv=new rn(Nn,"OrientOpposite",24),qm=new rn(Nn,"OrientUpright",25),hp=new rn(Nn,"OrientPlus90Upright",26),dp=new rn(Nn,"OrientMinus90Upright",27),t0=new rn(Nn,"OrientUpright45",28),nS=16,iS=14,cp=8;Nn.className="Link",Nn.Normal=Jv,Nn.Orthogonal=Mx,Nn.AvoidsNodes=kx,Nn.AvoidsNodesStraight=eS,Nn.None=Ls,Nn.Bezier=ml,Nn.JumpGap=Rh,Nn.JumpOver=Wf,Nn.End=ap,Nn.Scale=Qm,Nn.Stretch=$m,Nn.OrientAlong=sp,Nn.OrientPlus90=lp,Nn.OrientMinus90=up,Nn.OrientOpposite=Qv,Nn.OrientUpright=qm,Nn.OrientPlus90Upright=hp,Nn.OrientMinus90Upright=dp,Nn.OrientUpright45=t0,Nn.EndSegmentStep=8,Nn.CurvinessStart=nS,Nn.SpacingMin=iS,Nn.OrthoShortCut=cp;function e0(a,y,x,E){Hi(this),this.Fe=this.qq=!1,this.Ds=a,this.Ox=y,this.cv=x,this.Px=E,this.links=[]}e0.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},e0.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))}},e0.className="LinkBundle";function fp(a){Hi(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,E=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((E+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=[],E=0;E<=a;E++)x[E]=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(E=0;E<=this.ei;E++)x[E]=a}};function Vf(a,y,x){return a.Nd<=y&&y<=a.En&&a.Od<=x&&x<=a.Fn}function Xu(a,y,x){return Vf(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],E=0;E<=a.ei;E++)x[E]>=ic&&(x[E]=$v)}fp.prototype.Yj=function(a,y,x,E){if(a>this.En||a+x<this.Nd||y>this.Fn||y+E<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 b=Math.max(0,E)/this.sc+1|0;if(0>a&&(x+=a,a=0),0>y&&(b+=y,y=0),0>x||0>b)return!0;for(E=Math.min(a+x-1,this.di)|0,x=Math.min(y+b-1,this.ei)|0;a<=E;a++){b=this.ac[a];for(var z=y;z<=x;z++)if(b[z]===jh)return!1}return!0};function Ju(a,y,x,E,b,z,tt,rt,ot){if(!(y<z||y>tt||x<rt||x>ot)){var lt=y|0,ut=x|0,ft=a.ac[lt][ut];if(ft>=ic&&ft<Kf)for(b?ut+=E:lt+=E,ft+=1;z<=lt&<<=tt&&rt<=ut&&ut<=ot&&!(ft>=a.ac[lt][ut]);)a.ac[lt][ut]=ft,ft+=1,b?ut+=E:lt+=E;if(lt=b?ut:lt,b)if(0<E)for(x+=E;x<lt;x+=E)Ju(a,y,x,1,!b,z,tt,rt,ot),Ju(a,y,x,-1,!b,z,tt,rt,ot);else for(x+=E;x>lt;x+=E)Ju(a,y,x,1,!b,z,tt,rt,ot),Ju(a,y,x,-1,!b,z,tt,rt,ot);else if(0<E)for(y+=E;y<lt;y+=E)Ju(a,y,x,1,!b,z,tt,rt,ot),Ju(a,y,x,-1,!b,z,tt,rt,ot);else for(y+=E;y>lt;y+=E)Ju(a,y,x,1,!b,z,tt,rt,ot),Ju(a,y,x,-1,!b,z,tt,rt,ot)}}function n0(a,y,x,E,b,z,tt,rt,ot){y|=0,x|=0;var lt=jh,ut=ic;for(a.ac[y][x]=ut;lt===jh&&y>z&&y<tt&&x>rt&&x<ot;)ut+=1,a.ac[y][x]=ut,b?x+=E:y+=E,lt=a.ac[y][x]}function i0(a,y,x,E,b,z,tt,rt,ot){y|=0,x|=0;var lt=jh,ut=Kf;for(a.ac[y][x]=ut;lt===jh&&y>z&&y<tt&&x>rt&&x<ot;)a.ac[y][x]=ut,b?x+=E:y+=E,lt=a.ac[y][x]}function oS(a,y,x,E,b,z,tt){if(a.ac!==null){a.abort=!1;var rt=y.x,ot=y.y;if(Vf(a,rt,ot)){rt-=a.Nd,rt/=a.rc,ot-=a.Od,ot/=a.sc;var lt=E.x,ut=E.y;if(Vf(a,lt,ut))if(lt-=a.Nd,lt/=a.rc,ut-=a.Od,ut/=a.sc,1>=Math.abs(rt-lt)&&1>=Math.abs(ot-ut))a.abort=!0;else{var ft=z.x;E=z.y,y=z.x+z.width;var yt=z.y+z.height;ft-=a.Nd,ft/=a.rc,E-=a.Od,E/=a.sc,y-=a.Nd,y/=a.rc,yt-=a.Od,yt/=a.sc,z=Math.max(0,Math.min(a.di,ft|0)),y=Math.min(a.di,Math.max(0,y|0)),ft=Math.max(0,Math.min(a.ei,E|0)),yt=Math.min(a.ei,Math.max(0,yt|0)),E=a.ac,rt|=0,ot|=0,lt|=0,ut|=0;var xt=x===0||x===90?1:-1;if(x=x===90||x===270,E[rt][ot]===jh?(n0(a,rt,ot,xt,x,z,y,ft,yt),n0(a,rt,ot,1,!x,z,y,ft,yt),n0(a,rt,ot,-1,!x,z,y,ft,yt)):n0(a,rt,ot,xt,x,rt,ot,rt,ot),E[lt][ut]===jh?(i0(a,lt,ut,b===0||b===90?1:-1,b===90||b===270,z,y,ft,yt),i0(a,lt,ut,1,!(b===90||b===270),z,y,ft,yt),i0(a,lt,ut,-1,!(b===90||b===270),z,y,ft,yt)):i0(a,lt,ut,xt,x,lt,ut,lt,ut),x=Yn(),tt&&aS(a,lt,ut,b,rt,ot,x))for((x[0]!==lt||x[1]!==ut)&&(x.unshift(ut),x.unshift(lt)),(x[x.length-2]!==rt||x[x.length-1]!==ot)&&(x.push(rt),x.push(ot)),a=ic,b=x[x.length-2],tt=x[x.length-1],E[b][tt]=a++,z=x.length-4;0<=z;z-=2)for(b=x[z+2],tt=x[z+3],y=x[z],lt=x[z+1];y>b?b++:y<b?b--:lt>tt?tt++:lt<tt&&tt--,E[b][tt]=a++,b!==y||tt!==lt;);else Ju(a,rt,ot,1,!1,z,y,ft,yt),Ju(a,rt,ot,-1,!1,z,y,ft,yt),Ju(a,rt,ot,1,!0,z,y,ft,yt),Ju(a,rt,ot,-1,!0,z,y,ft,yt);si(x)}}}}function aS(a,y,x,E,b,z,tt){for(var rt=a.ac,ot=y,lt=x;;){if(ot===b&<===z)return!0;var ut=ot,ft=lt;if(E===0)if(ut<b)ut++;else break;else if(E===90)if(ft<z)ft++;else break;else if(E===180)if(ut>b)ut--;else break;else if(ft>z)ft--;else break;var yt=rt[ut][ft];if(yt===0||yt===qv)break;ot=ut,lt=ft}for(;;){if(ut=E,ft=ot,yt=lt,E===0?yt<z?(ut=90,yt++):yt>z&&(ut=270,yt--):E===90?ft<b?(ut=0,ft++):ft>b&&(ut=180,ft--):E===180?yt<z?(ut=90,yt++):yt>z&&(ut=270,yt--):ft<b?(ut=0,ft++):ft>b&&(ut=180,ft--),ft=rt[ft][yt],ut!==E&&ft!==0&&ft!==qv){if(tt.push(ot),tt.push(lt),aS(a,ot,lt,ut,b,z,tt))return!0;tt.pop(),tt.pop()}if(rt[ot][lt]=qv,E===0){if(ot===y)return!1;ot--}else if(E===90){if(lt===x)return!1;lt--}else if(E===180){if(ot===y)return!1;ot++}else{if(lt===x)return!1;lt++}}}ye.Object.defineProperties(fp.prototype,{bounds:{get:function(){return new Be(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 jh=0,ic=1,Kf=999999,$v=Kf+1,qv=Kf+2;fp.className="PositionArray";function Gc(){Hi(this),this.port=this.node=null,this.pe=[],this.ap=!1}Gc.prototype.toString=function(){for(var a=this.pe,y=this.node.toString()+" "+a.length.toString()+":",x=0;x<a.length;x++){var E=a[x];E!==null&&(y+=`
|
|
`+E.toString())}return y};function bx(a,y,x,E){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 E&&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}Gc.prototype.Sl=function(){this.pe.length=0};function sS(a,y){var x=a.pe;if(x.length===0){t:if(!a.ap){x=a.ap,a.ap=!0;var E=null,b=a.node,z=b instanceof er?b:null;if(z===null||z.isSubGraphExpanded)var tt=b.isTreeExpanded?b.findLinksConnected(a.port.portId):b.qx();else{if(!z.actualBounds.w()){a.ap=x;break t}E=z,tt=E.Lu()}z=a.pe.length=0;var rt=a.port.ga(_r,At.alloc()),ot=a.port.ga(lo,At.alloc());for(b=Be.allocAt(rt.x,rt.y,0,0),b.Ye(ot),At.free(rt),At.free(ot),rt=At.allocAt(b.x+b.width/2,b.y+b.height/2),ot=a.port.li(),tt=tt.iterator;tt.next();){var lt=tt.value;if(lt.isVisible()&<.fromPort!==lt.toPort){var ut=lt.fromPort===a.port||lt.fromNode!==null&<.fromNode.Td(E),ft=lt.computeSpot(ut,a.port);if(ft.$c()&&(ut=ut?lt.toPort:lt.fromPort,ut!==null)){var yt=ut.part;if(yt!==null){var xt=yt.findVisibleNode();xt!==null&&xt!==yt&&(yt=xt,ut=yt.port),ut=lt.computeOtherPoint(yt,ut),yt=rt.ab(ut),yt-=ot,0>yt?yt+=360:360<=yt&&(yt-=360),ft=bx(b,ft,yt,lt.isOrthogonal),ft===0?(ft=4,180<yt&&(yt-=360)):ft===90?(ft=8,270<yt&&(yt-=360)):ft===180?ft=2:(ft=1,90>yt&&(yt+=360)),xt=a.pe[z],xt===void 0?(xt=new ty(lt,yt,ft),a.pe[z]=xt):(xt.link=lt,xt.angle=yt,xt.Nc=ft),xt.hv.set(ut),z++}}}}for(At.free(rt),a.pe.sort(Gc.prototype.j),ot=a.pe.length,E=-1,z=rt=0;z<ot;z++)tt=a.pe[z],tt!==void 0&&(tt.Nc!==E&&(E=tt.Nc,rt=0),tt.Uo=rt,rt++);for(E=-1,rt=0,z=ot-1;0<=z;z--)ot=a.pe[z],ot!==void 0&&(ot.Nc!==E&&(E=ot.Nc,rt=ot.Uo+1),ot.Gl=rt);if(z=a.pe,ft=a.port,E=a.node.portSpreading,rt=At.alloc(),ot=At.alloc(),tt=At.alloc(),lt=At.alloc(),ft.ga(_r,rt),ft.ga(fo,ot),ft.ga(lo,tt),ft.ga(fa,lt),xt=yt=ut=ft=0,E===Hv)for(var Ct=0;Ct<z.length;Ct++){var bt=z[Ct];if(bt!==null){var Vt=bt.link.computeThickness();switch(bt.Nc){case 8:yt+=Vt;break;case 2:xt+=Vt;break;case 1:ft+=Vt;break;default:case 4:ut+=Vt}}}var zt=Ct=0,Qt=1,ee=bt=0;for(Vt=0;Vt<z.length;Vt++){var oe=z[Vt];if(oe!==null){if(Ct!==oe.Nc){switch(Ct=oe.Nc,Ct){case 8:var ce=tt;zt=lt;break;case 2:ce=lt,zt=rt;break;case 1:ce=rt,zt=ot;break;default:case 4:ce=ot,zt=tt}switch(bt=zt.x-ce.x,ee=zt.y-ce.y,Ct){case 8:yt>Math.abs(bt)?(Qt=Math.abs(bt)/yt,yt=Math.abs(bt)):Qt=1;break;case 2:xt>Math.abs(ee)?(Qt=Math.abs(ee)/xt,xt=Math.abs(ee)):Qt=1;break;case 1:ft>Math.abs(bt)?(Qt=Math.abs(bt)/ft,ft=Math.abs(bt)):Qt=1;break;default:case 4:ut>Math.abs(ee)?(Qt=Math.abs(ee)/ut,ut=Math.abs(ee)):Qt=1}zt=0}var Me=oe.Zo;if(E===Hv){switch(oe=oe.link.computeThickness(),oe*=Qt,Me.set(ce),Ct){case 8:Me.x=ce.x+bt/2+yt/2-zt-oe/2;break;case 2:Me.y=ce.y+ee/2+xt/2-zt-oe/2;break;case 1:Me.x=ce.x+bt/2-ft/2+zt+oe/2;break;default:case 4:Me.y=ce.y+ee/2-ut/2+zt+oe/2}zt+=oe}else{var Wn=.5;E===Vm&&(Wn=(oe.Uo+1)/(oe.Gl+1)),Me.x=ce.x+bt*Wn,Me.y=ce.y+ee*Wn}}}for(At.free(rt),At.free(ot),At.free(tt),At.free(lt),ce=a.pe,z=0;z<ce.length;z++)E=ce[z],E!==null&&(E.Ju=a.computeEndSegmentLength(E));a.ap=x,Be.free(b)}x=a.pe}for(a=0;a<x.length;a++)if(b=x[a],b!==null&&b.link===y)return b;return null}Gc.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},Gc.prototype.computeEndSegmentLength=function(a){var y=a.link,x=y.computeEndSegmentLength(this.node,this.port,ar,y.fromPort===this.port),E=a.Uo;if(0>E)return x;var b=a.Gl;if(1>=b||!y.isOrthogonal)return x;y=a.hv;var z=a.Zo;return(a.Nc===2||a.Nc===8)&&(E=b-1-E),((a=a.Nc===2||a.Nc===4)?y.y<z.y:y.x<z.x)?x+8*E:(a?y.y===z.y:y.x===z.x)?x:x+8*(b-1-E)},Gc.className="Knot";function ty(a,y,x){this.link=a,this.angle=y,this.Nc=x,this.hv=new At,this.Gl=this.Uo=0,this.Zo=new At,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 Ko(a){Hi(this),this.o=this.H=null,this.Gh=this.sn=!0,this.yn=!1,this.Am=new At(0,0).freeze(),this.vn=!0,this.Em=this.un=null,this.xn=!1,this.j=null,a&&Object.assign(this,a)}Ko.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},Ko.prototype.copy=function(){var a=new this.constructor;return this.cloneProtected(a),a},Ko.prototype.qb=function(){},Ko.prototype.toString=function(){var a=ei(this.constructor);return a+="(",this.group!==null&&(a+=" in "+this.group),this.diagram!==null&&(a+=" for "+this.diagram),a+")"},Ko.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())}}},Ko.prototype.createNetwork=function(){return new To(this)},Ko.prototype.makeNetwork=function(a){var y=this.createNetwork();return a instanceof ke?(y.lg(a.nodes,!0),y.lg(a.links,!0)):a instanceof er?y.lg(a.memberParts):y.lg(a.iterator),y},Ko.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")}},Ko.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()}},Ko.prototype.doLayout=function(a){var y=new pn;a instanceof ke?(pd(this,y,a.nodes,!0,this.rh,!0,!1,!0),pd(this,y,a.parts,!0,this.rh,!0,!1,!0)):a instanceof er?pd(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},Ko.prototype.doMinimalNoNetworkLayout=function(a){var y=Math.ceil(Math.sqrt(a.count));this.arrangementOrigin=this.initialOrigin(this.arrangementOrigin);var x=this.arrangementOrigin.x,E=x,b=this.arrangementOrigin.y,z=0,tt=0;for(a=a.iterator;a.next();){var rt=a.value;gp(rt);var ot=rt.measuredBounds,lt=ot.width;ot=ot.height,rt.moveTo(E,b),rt instanceof er&&(rt.rh=!1),E+=Math.max(lt,50)+20,tt=Math.max(tt,Math.max(ot,50)),z>=y-1?(z=0,E=x,b+=tt+20,tt=0):z++}},Ko.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,E=this.arrangementOrigin.y,b=0,z=0,tt=this.network.vertexes.iterator;tt.next();){var rt=tt.value.node;if(!(rt===null||rt instanceof Nn)&&(gp(rt),this.rh(rt))){var ot=rt.measuredBounds,lt=ot.width;ot=ot.height,rt.moveTo(x,E),rt instanceof er&&(rt.rh=!1),x+=Math.max(lt,50)+20,z=Math.max(z,Math.max(ot,50)),b>=a-1?(b=0,x=y,E+=z+20,z=0):b++}}},Ko.prototype.rh=function(a){return!!(!a.location.w()||a instanceof er&&a.rh)};function pd(a,y,x,E,b,z,tt,rt){for(x=x.iterator;x.next();){var ot=x.value;E&&!ot.isTopLevel||b!==null&&!b(ot)||!ot.canLayout()||(z&&ot instanceof $n?ot.isLinkLabel||(ot instanceof er&&ot.layout===null?pd(a,y,ot.memberParts,!1,b,z,tt,rt):(gp(ot),y.add(ot))):tt&&ot instanceof Nn?y.add(ot):!rt||!ot.Zc()||ot instanceof $n||(gp(ot),y.add(ot)))}}function gp(a){var y=a.actualBounds;(y.width===0||y.height===0||isNaN(y.width)||isNaN(y.height))&&a.Va()}Ko.prototype.ni=function(a,y){var x=this.boundsComputation;return x!==null?(y||(y=new Be),x(a,this,y)):y?(y.set(a.actualBounds),y):a.actualBounds},Ko.prototype.ex=function(a){var y=new pn;return a instanceof ke?(pd(this,y,a.nodes,!0,null,!0,!0,!0),pd(this,y,a.links,!0,null,!0,!0,!0),pd(this,y,a.parts,!0,null,!0,!0,!0)):a instanceof er?pd(this,y,a.memberParts,!1,null,!0,!0,!0):pd(this,y,a.iterator,!1,null,!0,!0,!0),y},Ko.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(_r),(isNaN(x.x)||isNaN(x.y))&&x.set(a),a=y.padding,x.x+=a.left,x.y+=a.top),x}return a},ye.Object.defineProperties(Ko.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())}}}),Ko.prototype.collectParts=Ko.prototype.ex,Ko.prototype.getLayoutBounds=Ko.prototype.ni,Ko.prototype.invalidateLayout=Ko.prototype.C,Ko.className="Layout";function To(a){Hi(this),this.Sc=a,this.wf=new pn,this.ye=new pn,this.Es=new be,this.zs=new be}To.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 pn,this.ye=new pn,this.Es=new be,this.zs=new be},To.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},To.prototype.createVertex=function(){return new La(this)},To.prototype.createEdge=function(){return new nl(this)},To.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 $n)return!tt.isLinkLabel;if(tt instanceof Nn){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 E=a.value;if(E instanceof $n&&(!y||E.isTopLevel)&&E.canLayout()&&x(E)){if(E instanceof er&&E.layout===null)this.lg(E.memberParts,!1);else if(this.ki(E)===null){var b=this.createVertex();b.node=E,this.dh(b)}}}for(a.reset();a.next();)if(E=a.value,E instanceof Nn&&(!y||E.isTopLevel)&&E.canLayout()&&x(E)&&this.Lo(E)===null){var z=E.fromNode;b=E.toNode,z!==null&&b!==null&&z!==b&&(z=this.findGroupVertex(z),b=this.findGroupVertex(b),z!==null&&b!==null&&this.Zj(z,b,E))}}},To.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},wt=To.prototype,wt.dh=function(a){if(a!==null){this.wf.add(a);var y=a.node;y!==null&&this.Es.add(y,a),a.network=this}},wt.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},wt.Iu=function(a){if(a!==null&&lS(this,a)){for(var y=a.tg,x=y.count-1;0<=x;x--){var E=y.M(x);this.Mj(E)}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}wt.Zy=function(a){a!==null&&(a=this.ki(a),a!==null&&this.Iu(a))},wt.ki=function(a){return a===null?null:this.Es.I(a)},wt.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}}wt.Dy=function(a){if(a===null)return null;var y=a.fromNode,x=a.toNode,E=this.Lo(a);return E===null?(E=this.createEdge(),E.link=a,y!==null&&(E.fromVertex=this.Bl(y)),x!==null&&(E.toVertex=this.Bl(x)),this.Bo(E)):(y!==null?E.fromVertex=this.Bl(y):E.fromVertex=null,x!==null?E.toVertex=this.Bl(x):E.toVertex=null),E},wt.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))}wt.Yy=function(a){a!==null&&(a=this.Lo(a),a!==null&&this.Mj(a))},wt.Lo=function(a){return a===null?null:this.zs.I(a)},wt.Zj=function(a,y,x){if(a===null||y===null)return null;if(a.network===this&&y.network===this){var E=this.createEdge();return E.link=x,E.fromVertex=a,E.toVertex=y,this.Bo(E),E}return null},wt.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))}},wt.Ko=function(){for(var a=Yn(),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]);si(a)},To.prototype.deleteArtificialVertexes=function(){for(var a=Yn(),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=Yn(),x=this.ye.iterator;x.next();){var E=x.value;E.link===null&&E.data===null&&y.push(E)}for(x=y.length,E=0;E<x;E++)this.Mj(y[E]);si(a),si(y)};function Nx(a){for(var y=Yn(),x=a.ye.iterator;x.next();){var E=x.value;E.fromVertex!==null&&E.toVertex!==null||y.push(E)}for(x=y.length,E=0;E<x;E++)a.Mj(y[E]);si(y)}To.prototype.Zx=function(a){a===void 0&&(a=!0),a&&(this.deleteArtificialVertexes(),Nx(this),this.Ko()),a=new fn;for(var y=!0;y;){y=!1;for(var x=this.wf.iterator;x.next();){var E=x.value;if(0<E.tg.count||0<E.mg.count){y=this.layout.createNetwork(),a.add(y),iy(this,y,E),y=!0;break}}}return a.sort(function(b,z){return b===null||z===null||b===z?0:z.vertexes.count-b.vertexes.count}),a};function iy(a,y,x){if(x!==null&&x.network!==y){lS(a,x),y.dh(x);for(var E=x.sourceEdges;E.next();){var b=E.value;b.network!==y&&(ny(a,b),ey(y,b),iy(a,y,b.fromVertex))}for(E=x.destinationEdges;E.next();)x=E.value,x.network!==y&&(ny(a,x),ey(y,x),iy(a,y,x.toVertex))}}To.prototype.dz=function(){for(var a=new pn,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},ye.Object.defineProperties(To.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}}}),To.prototype.findAllParts=To.prototype.dz,To.prototype.splitIntoSubNetworks=To.prototype.Zx,To.prototype.deleteSelfEdges=To.prototype.Ko,To.prototype.reverseEdge=To.prototype.gm,To.prototype.linkVertexes=To.prototype.Zj,To.prototype.findEdge=To.prototype.Lo,To.prototype.deleteLink=To.prototype.Yy,To.prototype.deleteEdge=To.prototype.Mj,To.prototype.addLink=To.prototype.Dy,To.prototype.addEdge=To.prototype.Bo,To.prototype.findVertex=To.prototype.ki,To.prototype.deleteNode=To.prototype.Zy,To.prototype.deleteVertex=To.prototype.Iu,To.prototype.addNode=To.prototype.Bl,To.prototype.addVertex=To.prototype.dh,To.prototype.addParts=To.prototype.lg,To.className="LayoutNetwork";function La(a){Hi(this),this.ob=a,this.j=new Be(0,0,10,10).freeze(),this.o=new At(5,5).freeze(),this.Sh=this.ub=null,this.tg=new fn,this.mg=new fn}La.prototype.clear=function(){this.Sh=this.ub=null,this.tg=new fn,this.mg=new fn},La.prototype.toString=function(a){a===void 0&&(a=0);var y="LayoutVertex#"+ji(this);if(0<a&&(y+=this.node!==null?"("+this.node.toString()+")":"",1<a)){a="";for(var x=!0,E=this.tg.iterator;E.next();){var b=E.value;x?x=!1:a+=",",a+=b.toString(0)}for(b="",x=!0,E=this.mg.iterator;E.next();){var z=E.value;x?x=!1:b+=",",b+=z.toString(0)}y+=" sources: "+a+" destinations: "+b}return y},La.prototype.commit=function(){var a=this.ub;if(a!==null){var y=this.bounds,x=a.bounds;Ie(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 er)){x=Be.alloc(),a.Va();var E=this.network.layout.ni(a,x),b=a.locationObject.ga(lr);if(E.w()&&b.w()){a.moveTo(y.x+this.focusX-(b.x-E.x),y.y+this.focusY-(b.y-E.y)),Be.free(x);return}Be.free(x)}a.moveTo(y.x,y.y)}},La.prototype.Cl=function(a){a!==null&&(this.tg.contains(a)||this.tg.add(a))},La.prototype.Kl=function(a){a!==null&&this.tg.remove(a)},La.prototype.zl=function(a){a!==null&&(this.mg.contains(a)||this.mg.add(a))},La.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}ye.Object.defineProperties(La.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,E=y.width;y=y.height,this.o.h(E/2,y/2),this.j.h(a,x,E,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=Be.alloc(),E=y.ni(a,x);y=E.x;var b=E.y,z=E.width;if(E=E.height,isNaN(y)&&(y=0),isNaN(b)&&(b=0),this.j.h(y,b,z,E),Be.free(x),!(a instanceof er)&&(a=a.locationObject.ga(lr),a.w())){this.o.h(a.x-y,a.y-b);return}this.o.h(z/2,E/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 pn,y=this.sourceEdges;y.next();)a.add(y.value.fromVertex);return a.iterator}},destinationVertexes:{get:function(){for(var a=new pn,y=this.destinationEdges;y.next();)a.add(y.value.toVertex);return a.iterator}},vertexes:{get:function(){for(var a=new pn,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 fn,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}}}),La.prototype.deleteDestinationEdge=La.prototype.Jl,La.prototype.addDestinationEdge=La.prototype.zl,La.prototype.deleteSourceEdge=La.prototype.Kl,La.prototype.addSourceEdge=La.prototype.Cl,La.className="LayoutVertex",La.standardComparer=ry,La.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 E=parseFloat(y[x]),b=parseFloat(a[x]);if(isNaN(E))if(isNaN(b)){if(y[x].localeCompare(a[x])!==0)return y[x].localeCompare(a[x])}else return 1;else{if(isNaN(b))return-1;if(E-b!==0)return E-b}}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 nl(a){Hi(this),this.nb=a,this.qd=this.kd=this.$k=this.ub=null}nl.prototype.clear=function(){this.qd=this.kd=this.$k=this.ub=null},nl.prototype.toString=function(a){a===void 0&&(a=0);var y="LayoutEdge#"+ji(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},nl.prototype.gm=function(){var a=this.kd;this.kd=this.qd,this.qd=a},nl.prototype.commit=function(){},nl.prototype.Ax=function(a){return this.qd===a?this.kd:this.kd===a?this.qd:null},ye.Object.defineProperties(nl.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)}}}),nl.prototype.getOtherVertex=nl.prototype.Ax,nl.className="LayoutEdge";function Ka(a){Ko.call(this),this.isViewportSized=!0,this.yo=this.zo=NaN,this.yg=new on(NaN,NaN).freeze(),this.tf=new on(10,10).freeze(),this.Jb=pp,this.Rb=o0,this.nd=mp,this.hd=uS,a&&Object.assign(this,a)}Se(Ka,Ko),Ka.prototype.cloneProtected=function(a){Ko.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},Ka.prototype.qb=function(a){a.classType===Ka?a===mp||a===s0||a===oy||a===a0?this.sorting=a:a===o0||a===mu?this.arrangement=a:a===pp||a===r0?this.alignment=a:Gt("Unknown enum value: "+a):Ko.prototype.qb.call(this,a)},Ka.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 E=x.value;if(!E.ph()||E.fromNode===null&&E.toNode===null){if(E.Va(),E instanceof er)for(E=E.memberParts;E.next();)y.remove(E.value)}else y.remove(E)}var b=y.Fa();if(b.length!==0){switch(this.sorting){case a0:b.reverse();break;case mp:b.sort(this.comparer);break;case s0:b.sort(this.comparer),b.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"),E=[],this.alignment){case r0:var rt=y,ot=x,lt=Be.alloc(),ut=Math.max(this.cellSize.width,1);if(!isFinite(ut))for(var ft=ut=0;ft<b.length;ft++){var yt=this.ni(b[ft],lt);ut=Math.max(ut,yt.width)}if(ut=Math.max(ut+rt,1),ft=Math.max(this.cellSize.height,1),!isFinite(ft))for(yt=ft=0;yt<b.length;yt++){var xt=this.ni(b[yt],lt);ft=Math.max(ft,xt.height)}ft=Math.max(ft+ot,1),yt=this.arrangement;for(var Ct=xt=this.arrangementOrigin.x,bt=this.arrangementOrigin.y,Vt=0,zt=0,Qt=0;Qt<b.length;Qt++){var ee=b[Qt],oe=this.ni(ee,lt),ce=Math.ceil((oe.width+rt)/ut)*ut,Me=Math.ceil((oe.height+ot)/ft)*ft;switch(yt){case mu:var Wn=Math.abs(Ct-oe.width);break;default:Wn=Ct+oe.width}switch((0<z&&Vt>z-1||0<tt&&0<Vt&&Wn-xt>tt)&&(E.push(new Be(0,bt,tt+rt,zt)),Vt=0,Ct=xt,bt+=zt,zt=0),zt=Math.max(zt,Me),yt){case mu:oe=-oe.width;break;default:oe=0}switch(ee.moveTo(Ct+oe,bt),yt){case mu:Ct-=ce;break;default:Ct+=ce}Vt++}E.push(new Be(0,bt,tt+rt,zt)),Be.free(lt);break;case pp:for(ot=tt,ut=z,ft=y,yt=x,tt=Be.alloc(),xt=Math.max(this.cellSize.width,1),z=bt=lt=0,rt=At.alloc(),Ct=0;Ct<b.length;Ct++)zt=b[Ct],Vt=this.ni(zt,tt),zt=Oh(zt,zt.locationObject,zt.locationSpot,rt),lt=Math.max(lt,zt.x),bt=Math.max(bt,Vt.width-zt.x),z=Math.max(z,zt.y);switch(Ct=this.arrangement,Ct){case mu:lt+=ft;break;default:bt+=ft}xt=isFinite(xt)?Math.max(xt+ft,1):Math.max(lt+bt,1);var di=zt=this.arrangementOrigin.x;for(Qt=this.arrangementOrigin.y,bt=0,ot>=lt&&(ot-=lt),lt=ee=0,ce=Math.max(this.cellSize.height,1),oe=z=0,Me=!0,Vt=At.alloc(),Wn=0;Wn<b.length;Wn++){var oi=b[Wn],kn=this.ni(oi,tt),en=Oh(oi,oi.locationObject,oi.locationSpot,rt);if(0<bt)switch(Ct){case mu:di=(di-zt-(kn.width-en.x))/xt,di=_t.$(Math.round(di),di)?Math.round(di):Math.floor(di),di=di*xt+zt;break;default:di=(di-zt+en.x)/xt,di=_t.$(Math.round(di),di)?Math.round(di):Math.ceil(di),di=di*xt+zt}else switch(Ct){case mu:ee=di+en.x+kn.width;break;default:ee=di-en.x}switch(Ct){case mu:var qi=-(di+en.x)+ee;break;default:qi=di+kn.width-en.x-ee}if(0<ut&&bt>ut-1||0<ot&&0<bt&&qi>ot){for(E.push(new Be(0,Me?Qt-z:Qt,ot+ft,oe+z+yt)),di=0;di<bt&&Wn!==bt;di++){qi=b[Wn-bt+di];var Yi=Oh(qi,qi.locationObject,qi.locationSpot,Vt);qi.moveTo(qi.position.x,qi.position.y+z-Yi.y)}oe+=yt,Qt=Me?Qt+oe:Qt+(oe+z),bt=oe=z=0,di=zt,Me=!1}switch(di===zt&&(lt=Ct===mu?Math.max(lt,kn.width-en.x):Math.min(lt,-en.x)),z=Math.max(z,en.y),oe=Math.max(oe,kn.height-en.y),isFinite(ce)&&(oe=Math.max(oe,Math.max(kn.height,ce)-en.y)),Me?oi.moveTo(di-en.x,Qt-en.y):oi.moveTo(di-en.x,Qt),Ct){case mu:di-=en.x+ft;break;default:di+=kn.width-en.x+ft}bt++}if(E.push(new Be(0,Qt,ot+ft,(Me?oe:oe+z)+yt)),b.length!==bt)for(ot=0;ot<bt;ot++)ut=b[b.length-bt+ot],ft=Oh(ut,ut.locationObject,ut.locationSpot,rt),ut.moveTo(ut.position.x,ut.position.y+z-ft.y);if(At.free(rt),At.free(Vt),Ct===mu)for(b=0;b<E.length;b++)z=E[b],z.width+=lt,z.x-=lt;else for(b=0;b<E.length;b++)z=E[b],z.x>lt&&(z.width+=z.x-lt,z.x=lt);Be.free(tt)}for(rt=z=tt=b=0;rt<E.length;rt++)ot=E[rt],b=Math.min(b,ot.x),tt=Math.min(tt,ot.y),z=Math.max(z,ot.x+ot.width);this.arrangement===mu?this.commitLayers(E,new At(b+y/2-(z+b),tt-x/2)):this.commitLayers(E,new At(b-y/2,tt-x/2)),a!==null&&a.eb("Layout"),this.isValidLayout=!0}},Ka.prototype.commitLayers=function(){};function uS(a,y){return a=a.text,y=y.text,a<y?-1:a>y?1:0}ye.Object.defineProperties(Ka.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!==pp&&a!==r0||(this.Jb=a,this.C())}},arrangement:{get:function(){return this.Rb},set:function(a){this.Rb===a||a!==o0&&a!==mu||(this.Rb=a,this.C())}},sorting:{get:function(){return this.nd},set:function(a){this.nd===a||a!==oy&&a!==a0&&a!==mp&&a!==s0||(this.nd=a,this.C())}},comparer:{get:function(){return this.hd},set:function(a){this.hd!==a&&(this.hd=a,this.C())}}});var r0=new rn(Ka,"Position",0),pp=new rn(Ka,"Location",1),o0=new rn(Ka,"LeftToRight",2),mu=new rn(Ka,"RightToLeft",3),oy=new rn(Ka,"Forward",4),a0=new rn(Ka,"Reverse",5),mp=new rn(Ka,"Ascending",6),s0=new rn(Ka,"Descending",7);Ka.className="GridLayout",Ka.standardComparer=uS,Ka.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 E=parseFloat(a[x]),b=parseFloat(y[x]);if(isNaN(E))if(isNaN(b)){if(a[x].localeCompare(y[x])!==0)return a[x].localeCompare(y[x])}else return 1;else{if(isNaN(b))return-1;if(E-b!==0)return E-b}}else if(a[x]!=="")return 1;return y[x]!==""&&y[x]!==void 0?-1:0}return 1}return y!==null?-1:0},Ka.Position=r0,Ka.Location=pp,Ka.LeftToRight=o0,Ka.RightToLeft=mu,Ka.Forward=oy,Ka.Reverse=a0,Ka.Ascending=mp,Ka.Descending=s0;function vo(){this.On=new pn,this.Dn=new pn,this.Pa=new pn,this.cf=new be,this.bf=new be,this.aj=new be,this.H=null,this.tp=!1}wt=vo.prototype,wt.clear=function(){this.On.clear(),this.Dn.clear(),this.Pa.clear(),this.cf.clear(),this.bf.clear(),this.aj.clear()},wt.Xe=function(a){this.H=a},wt.oi=function(a){if(a instanceof $n){if(this.On.add(a),a instanceof er){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 Nn?this.Dn.add(a):a instanceof Qr||this.Pa.add(a);y=a.data,y===null||a instanceof Qr||(a instanceof Nn?this.bf.add(y,a):this.cf.add(y,a))},wt.pc=function(a){if(a.Ej(),a instanceof $n){if(this.On.remove(a),a instanceof er){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 Nn?this.Dn.remove(a):a instanceof Qr||this.Pa.remove(a);y=a.data,y===null||a instanceof Qr||(a instanceof Nn?this.bf.remove(y):this.cf.remove(y))},wt.Wd=function(){var a=this.H;if(a!==null){for(var y=a.nodeTemplateMap.iterator;y.next();){var x=y.value,E=y.key;(!x.Zc()||x instanceof er)&&Gt('Invalid node template in Diagram.nodeTemplateMap: template for "'+E+'" must be a Node or a simple Part, not a Group or Link: '+x)}for(y=a.groupTemplateMap.iterator;y.next();)x=y.value,E=y.key,x instanceof er||Gt('Invalid group template in Diagram.groupTemplateMap: template for "'+E+'" must be a Group, not a normal Node or Link: '+x);for(y=a.linkTemplateMap.iterator;y.next();)x=y.value,E=y.key,x instanceof Nn||Gt('Invalid link template in Diagram.linkTemplateMap: template for "'+E+'" must be a Link, not a normal Node or simple Part: '+x);for(y=Yn(),x=a.selection.iterator;x.next();)(E=x.value.data)&&y.push(E);for(x=Yn(),a=a.highlighteds.iterator;a.next();)(E=a.value.data)&&x.push(E);for(a=Yn(),E=this.nodes.iterator;E.next();){var b=E.value;b.data!==null&&(a.push(b.data),a.push(b.location))}for(E=this.links.iterator;E.next();)b=E.value,b.data!==null&&(a.push(b.data),a.push(b.location));for(E=this.parts.iterator;E.next();)b=E.value,b.data!==null&&(a.push(b.data),a.push(b.location));for(this.removeAllModeledParts(),this.addAllModeledParts(),E=0;E<y.length;E++)b=this.Lc(y[E]),b!==null&&(b.isSelected=!0);for(E=0;E<x.length;E++)b=this.Lc(x[E]),b!==null&&(b.isHighlighted=!0);for(E=0;E<a.length;E+=2)b=this.Lc(a[E]),b!==null&&(b.location=a[E+1]);si(y),si(x),si(a)}},vo.prototype.addAllModeledParts=function(){this.addModeledParts(this.diagram.model.nodeDataArray)},vo.prototype.addModeledParts=function(a,y){var x=this,E=this.diagram.model;a.forEach(function(b){E.lb(b)&&hS(x,b,!1)}),a.forEach(function(b){E.lb(b)&&x.resolveReferencesForData(b)}),y!==!1&&Pf(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 E=a.Ro(y),b=dS(a,y,E);if(b!==null&&(Zl(b),b=b.copy(),b!==null)){var z=a.diagram.skipsModelSourceBindings;a.diagram.skipsModelSourceBindings=!0,b.Tf=E,b.ub=y,a.tp&&(b.Jg="Tool"),a.diagram.add(b),b.ub=null,b.data=y,a.diagram.skipsModelSourceBindings=z,E=b;break t}}E=null}E!==null&&x&&a.resolveReferencesForData(y)}}vo.prototype.insertLink=function(){return null},vo.prototype.resolveReferencesForData=function(){},vo.prototype.Ro=function(a){return this.H.model.Ro(a)};function dS(a,y,x){a=a.H;var E=a.model;return E.Xj()&&E.Yu(y)?(y=a.groupTemplateMap.I(x),y===null&&(y=a.groupTemplateMap.I(""),y===null&&(gS||(gS=!0,Mn('No Group template found for category "'+x+'"'),Mn(" Using default group template")),y=a.ly))):(y=a.nodeTemplateMap.I(x),y===null&&(y=a.nodeTemplateMap.I(""),y===null&&(fS||(fS=!0,Mn('No Node template found for category "'+x+'"'),Mn(" Using default node template")),y=a.ny))),y}vo.prototype.getLinkCategoryForData=function(){return""},vo.prototype.setLinkCategoryForData=function(){},vo.prototype.setFromNodeForLink=function(){},vo.prototype.setToNodeForLink=function(){},vo.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,Mn('No Link template found for category "'+a+'"'),Mn(" Using default link template")),x=y.my)),x},vo.prototype.removeAllModeledParts=function(){this.Gs(this.diagram.model.nodeDataArray)},vo.prototype.Gs=function(a){var y=this;a.forEach(function(x){y.ip(x)})},vo.prototype.ip=function(a){a=this.Lc(a),a!==null&&(Ng(this.diagram,a,!1),this.unresolveReferencesForPart(a))},vo.prototype.unresolveReferencesForPart=function(){},vo.prototype.removeDataForLink=function(){},vo.prototype.findPartForKey=function(a){return a==null?null:(a=this.H.model.hc(a),a!==null?this.cf.I(a):null)},vo.prototype.Vb=function(a){return a==null||(a=this.H.model.hc(a),a===null)?null:(a=this.cf.I(a),a instanceof $n?a:null)},vo.prototype.findLinkForKey=function(){return null},wt=vo.prototype,wt.Lc=function(a){if(a===null)return null;var y=this.cf.I(a);return y!==null?y:y=this.bf.I(a)},wt.ii=function(a){return a===null?null:(a=this.cf.I(a),a instanceof $n?a:null)},wt.Kc=function(a){return a===null?null:this.bf.I(a)},wt.ms=function(a){for(var y=0;y<arguments.length;++y);y=new pn;for(var x=this.On.iterator;x.next();){var E=x.value,b=E.data;if(b!==null)for(var z=0;z<arguments.length;z++){var tt=arguments[z];if(Ie(tt)&&ay(this,b,tt)){y.add(E);break}}}return y.iterator},wt.ls=function(a){for(var y=0;y<arguments.length;++y);y=new pn;for(var x=this.Dn.iterator;x.next();){var E=x.value,b=E.data;if(b!==null)for(var z=0;z<arguments.length;z++){var tt=arguments[z];if(Ie(tt)&&ay(this,b,tt)){y.add(E);break}}}return y.iterator};function ay(a,y,x){for(var E in x){var b=y[E],z=x[E];if($e(z)){if(!$e(b)||b.length<z.length)return!1;for(var tt=0;tt<b.length;tt++){var rt=z[tt];if(rt!==void 0&&!cS(a,b[tt],rt))return!1}}else if(!cS(a,b,z))return!1}return!0}function cS(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(Ie(y)&&Ie(x)){if(!ay(a,y,x))return!1}else if(y!==x)return!1;return!0}vo.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 E=a.modelChange;if(E!=="")if(x===wr){if(E==="nodeCategory"){var b=this.Lc(a.object),z=a.newValue;b!==null&&typeof z=="string"&&(b.category=z)}else E==="nodeDataArray"&&(this.Gs(a.oldValue),this.addModeledParts(a.newValue));y.isModified=!0}else if(x===ro){var tt=a.newValue;E==="nodeDataArray"&&Ie(tt)&&hS(this,tt),y.isModified=!0}else if(x===So){var rt=a.oldValue;E==="nodeDataArray"&&Ie(rt)&&this.ip(rt),y.isModified=!0}else x===Qi&&(E==="SourceChanged"?a.object!==null?this.updateDataBindings(a.object,a.propertyName):(this.rp(),this.updateAllTargetBindings()):E==="ModelDisplaced"&&this.Wd());else if(x===wr){var ot=a.propertyName,lt=a.object;lt===y.model?(ot==="nodeKeyProperty"||ot==="nodeCategoryProperty")&&(y.undoManager.isUndoingRedoing||this.Wd()):this.updateDataBindings(lt,ot),y.isModified=!0}else if(x===ro||x===So){var ut=a.change===ro,ft=ut?a.newParam:a.oldParam,yt=ut?a.newValue:a.oldValue,xt=this.aj.I(a.object);if(Array.isArray(xt))for(a=0;a<xt.length;a++){var Ct=xt[a];if(ut)Fm(Ct,yt,ft,!0);else if(!(0>ft)){var bt=ft+Qg(Ct);Ct.pc(bt,!0),xv(Ct,bt,ft)}}y.isModified=!0}}finally{y.aa=!0}}}}},vo.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)},vo.prototype.rp=function(){for(var a=this.H.model,y=new pn,x=a.nodeDataArray,E=0;E<x.length;E++)y.add(x[E]);var b=[];for(this.nodes.each(function(tt){tt.data===null||y.contains(tt.data)||b.push(tt.data)}),this.parts.each(function(tt){tt.data===null||y.contains(tt.data)||b.push(tt.data)}),b.forEach(function(tt){ES(a,tt,!1)}),E=0;E<x.length;E++){var z=x[E];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()},vo.prototype.refreshDataBoundLinks=function(){},vo.prototype.updateRelationshipsFromData=function(){},vo.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 E=this.aj.iterator;E.next();){for(var b=E.value,z=0;z<b.length;z++){var tt=b[z].sx(a);tt!==null&&(x===null&&(x=Yn()),x.push(tt))}if(x!==null)break}if(x!==null){for(E=0;E<x.length;E++)x[E].La(y);si(x)}}a===this.diagram.model.modelData&&this.updateAllTargetBindings(y)}};function sy(a,y){var x=y.Hh;if($e(x)){var E=a.aj.I(x);if(E===null)E=[],E.push(y),a.aj.add(x,E);else{for(a=0;a<E.length;a++)if(E[a]===y)return;E.push(y)}}}function ly(a,y,x){$d(y,function(tt){tt=tt.O.s;for(var rt=tt.length,ot=0;ot<rt;ot++)Og(x,tt[ot])});var E=y.Hh;if($e(E)){var b=a.aj.I(E);if(b!==null){for(var z=0;z<b.length;z++)if(b[z]===y){b.splice(z,1),b.length===0&&a.aj.remove(E);break}}}}vo.prototype.Kj=function(a,y,x){x===void 0&&(x=!1);var E=new be;if($e(a))for(var b=0;b<a.length;b++)l0(this,a[b],y,E,x);else for(a=a.iterator;a.next();)l0(this,a.value,y,E,x);if(y!==null){x=y.model,a=y.toolManager.findTool("Dragging"),a=a!==null?a.dragOptions.dragsLink:y.Wm.dragsLink,b=new pn;for(var z=new be,tt=E.iterator;tt.next();){var rt=tt.value;if(rt instanceof Nn)a||rt.fromNode!==null&&rt.toNode!==null||b.add(rt);else if(rt instanceof $n&&rt.data!==null&&x.Tl()){var ot=rt;rt=tt.key;var lt=rt.pg();lt!==null&&(lt=E.I(lt),lt!==null?(x.qe(ot.data,x.wa(lt.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<b.count&&y.Is(b,!1),0<z.count)for(x=z.iterator;x.next();)E.add(x.key,x.value)}if(y!==null&&this.H!==null&&(y=y.model,x=y.afterCopyFunction,x!==null)){var ut=new be;E.each(function(ft){ft.key.data!==null&&ut.add(ft.key.data,ft.value.data)}),x(ut,y,this.H.model)}for(y=E.iterator;y.next();)y.value.La();return E};function l0(a,y,x,E,b){if(y===null||b&&!y.canCopy())return null;if(E.contains(y))return E.I(y);var z=a.copyPartData(y,x);if(!(z instanceof Bi))return null;if(z.isSelected=!1,z.isHighlighted=!1,E.add(y,z),y instanceof $n){for(var tt=y.linksConnected;tt.next();){var rt=tt.value;if(rt.fromNode===y){var ot=E.I(rt);ot!==null&&(ot.fromNode=z)}rt.toNode===y&&(rt=E.I(rt),rt!==null&&(rt.toNode=z))}if(y instanceof er&&z instanceof er)for(y=y.memberParts;y.next();)tt=l0(a,y.value,x,E,b),tt instanceof Nn||tt===null||(tt.containingGroup=z)}else if(y instanceof Nn&&z instanceof Nn)for(tt=y.fromNode,tt!==null&&(tt=E.I(tt),tt!==null&&(z.fromNode=tt)),tt=y.toNode,tt!==null&&(tt=E.I(tt),tt!==null&&(z.toNode=tt)),y=y.labelNodes;y.next();)tt=l0(a,y.value,x,E,b),tt!==null&&tt instanceof $n&&(tt.labeledLink=z);return z}vo.prototype.copyPartData=function(a,y){var x=null,E=a.data;if(E!==null&&y!==null){var b=y.model;a instanceof Nn||(E=b.copyNodeData(E),Ie(E)&&(b.xf(E),x=y.Lc(E)))}else Zl(a),x=a.copy(),x!==null&&(b=this.H,y!==null?y.add(x):E!==null&&b!==null&&b.commandHandler!==null&&b.commandHandler.copiesClipboardData&&(y=b.model,b=null,x instanceof Nn||(b=y.copyNodeData(E)),Ie(b)&&(x.data=b)));return x},ye.Object.defineProperties(vo.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}}}),vo.prototype.updateAllRelationshipsFromData=vo.prototype.rp,vo.prototype.findLinksByExample=vo.prototype.ls,vo.prototype.findNodesByExample=vo.prototype.ms,vo.prototype.findLinkForData=vo.prototype.Kc,vo.prototype.findNodeForData=vo.prototype.ii,vo.prototype.findPartForData=vo.prototype.Lc,vo.prototype.findNodeForKey=vo.prototype.Vb,vo.prototype.removeModeledPart=vo.prototype.ip,vo.prototype.removeModeledParts=vo.prototype.Gs,vo.prototype.rebuildParts=vo.prototype.Wd;var fS=!1,gS=!1,pS=!1;vo.className="PartManager";function Oa(a){vo.apply(this,arguments)}Se(Oa,vo),Oa.prototype.addAllModeledParts=function(){var a=this.diagram.model;this.addModeledParts(a.nodeDataArray),mS(this,a.linkDataArray)},Oa.prototype.addModeledParts=function(a){for(vo.prototype.addModeledParts.call(this,a,!1),a=this.links.iterator;a.next();)Gf(a.value);Pf(this.diagram,!1)};function mS(a,y){y.forEach(function(x){vS(a,x)}),Pf(a.diagram,!1)}function vS(a,y){if(y!=null&&!a.diagram.undoManager.isUndoingRedoing&&!a.bf.contains(y)){var x=a.getLinkCategoryForData(y),E=a.findLinkTemplateForCategory(x);if(E!==null){Zl(E);var b=E.copy();if(b!==null){E=a.diagram.skipsModelSourceBindings,a.diagram.skipsModelSourceBindings=!0,b.Tf=x,b.ub=y,x=a.diagram.model;var z=c0(x,y,!0);z!==""&&(b.fromPortId=z),z=vl(x,y,!0),z!==void 0&&(z=a.Vb(z),z instanceof $n&&(b.fromNode=z)),z=c0(x,y,!1),z!==""&&(b.toPortId=z),z=vl(x,y,!1),z!==void 0&&(z=a.Vb(z),z instanceof $n&&(b.toNode=z)),x=x.Ef(y),Array.isArray(x)&&x.forEach(function(tt){tt=a.Vb(tt),tt!==null&&(tt.labeledLink=b)}),a.tp&&(b.Jg="Tool"),a.diagram.add(b),b.ub=null,b.data=y,a.diagram.skipsModelSourceBindings=E}}}}Oa.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)})}Oa.prototype.getLinkCategoryForData=function(a){return this.diagram.model.ps(a)},Oa.prototype.setLinkCategoryForData=function(a,y){return this.diagram.model.lp(a,y)},Oa.prototype.setFromNodeForLink=function(a,y){var x=this.diagram.model;x.wv(a.data,x.wa(y!==null?y.data:null))},Oa.prototype.setToNodeForLink=function(a,y){var x=this.diagram.model;x.Bv(a.data,x.wa(y!==null?y.data:null))},Oa.prototype.removeDataForLink=function(a){this.diagram.model.bm(a.data)},Oa.prototype.findPartForKey=function(a){var y=vo.prototype.findPartForKey.call(this,a);return y===null&&(a=this.diagram.model.jh(a),a!==null)?this.bf.I(a):y},Oa.prototype.findLinkForKey=function(a){return a==null?null:(a=this.diagram.model.jh(a),a!==null?this.bf.I(a):null)},Oa.prototype.doModelChanged=function(a){var y=this;if(vo.prototype.doModelChanged.call(this,a),this.diagram){var x=this.diagram;if(a.model===x.model){var E=a.change;if(x.aa){x.aa=!1;try{var b=a.modelChange;if(b!==""){if(E===wr){if(b==="linkFromKey"){var z=this.Kc(a.object);if(z!==null){var tt=this.Vb(a.newValue);z.fromNode=tt}}else if(b==="linkToKey"){var rt=this.Kc(a.object);if(rt!==null){var ot=this.Vb(a.newValue);rt.toNode=ot}}else if(b==="linkFromPortId"){var lt=this.Kc(a.object);if(lt!==null){var ut=a.newValue;typeof ut=="string"&&(lt.fromPortId=ut)}}else if(b==="linkToPortId"){var ft=this.Kc(a.object);if(ft!==null){var yt=a.newValue;typeof yt=="string"&&(ft.toPortId=yt)}}else if(b==="nodeGroupKey"){var xt=this.Lc(a.object);if(xt!==null){var Ct=a.newValue;if(Ct!==void 0){var bt=this.Vb(Ct);bt instanceof er?xt.containingGroup=bt:xt.containingGroup=null}else xt.containingGroup=null}}else if(b==="linkLabelKeys"){var Vt=this.Kc(a.object);if(Vt!==null){var zt=a.oldValue,Qt=a.newValue;Array.isArray(zt)&&zt.forEach(function(en){0<=Qt.indexOf(en)||(en=y.Vb(en),en!==null&&(en.labeledLink=null))}),Array.isArray(Qt)&&Qt.forEach(function(en){en=y.Vb(en),en!==null&&(en.labeledLink=Vt)})}}else if(b==="linkCategory"){var ee=this.Kc(a.object),oe=a.newValue;ee!==null&&typeof oe=="string"&&(ee.category=oe)}else b==="linkDataArray"&&(yS(this,a.oldValue),mS(this,a.newValue));x.isModified=!0}else if(E===ro){var ce=a.newValue;if(b==="linkDataArray"&&typeof ce=="object"&&ce!==null)vS(this,ce);else if(b==="linkLabelKeys"&&vd(ce)){var Me=this.Kc(a.object),Wn=this.Vb(ce);Me!==null&&Wn!==null&&(Wn.labeledLink=Me)}x.isModified=!0}else if(E===So){var di=a.oldValue;if(b==="linkDataArray"&&typeof di=="object"&&di!==null)this.ip(di);else if(b==="linkLabelKeys"&&vd(di)){var oi=this.Vb(di);oi!==null&&(oi.labeledLink=null)}x.isModified=!0}}else if(E===wr){var kn=a.propertyName;a.object!==x.model||kn!=="linkFromKeyProperty"&&kn!=="linkToKeyProperty"&&kn!=="linkFromPortIdProperty"&&kn!=="linkToPortIdProperty"&&kn!=="linkLabelKeysProperty"&&kn!=="nodeIsGroupProperty"&&kn!=="nodeGroupKeyProperty"&&kn!=="linkCategoryProperty"||x.undoManager.isUndoingRedoing||this.Wd(),x.isModified=!0}}finally{x.aa=!0}}}}},Oa.prototype.refreshDataBoundLinks=function(){var a=this,y=this.diagram.model,x=new pn,E=y.linkDataArray;E.forEach(function(z){x.add(z)});var b=[];this.links.each(function(z){z.data===null||x.contains(z.data)||b.push(z.data)}),b.forEach(function(z){NS(y,z,!1)}),E.forEach(function(z){a.Kc(z)===null&&bS(y,z,!1)})},Oa.prototype.updateRelationshipsFromData=function(a){var y=a.data;if(y!==null){var x=a.diagram;if(x!==null){var E=x.model;if(a instanceof Nn){var b=vl(E,y,!0);if(b=x.Vb(b),a.fromNode=b,b=vl(E,y,!1),b=x.Vb(b),a.toNode=b,y=E.Ef(y),0<y.length||0<a.labelNodes.count){if(y.length===1&&a.labelNodes.count===1){b=y[0];var z=a.labelNodes.first();if(E.wa(z.data)===b)return}b=new pn().addAll(y);var tt=new pn;a.labelNodes.each(function(rt){rt.data!==null&&(rt=E.wa(rt.data),rt!==void 0&&tt.add(rt))}),y=tt.copy(),y.hp(b),b=b.copy(),b.hp(tt),(0<y.count||0<b.count)&&(y.each(function(rt){rt=x.Vb(rt),rt!==null&&rt.labeledLink===a&&(rt.labeledLink=null)}),b.each(function(rt){rt=x.Vb(rt),rt!==null&&rt.labeledLink!==a&&(rt.labeledLink=a)}))}}else!(a instanceof Qr)&&(y=E.lh(y),y=x.findPartForKey(y),y===null||y instanceof er)&&(a.containingGroup=y)}}},Oa.prototype.resolveReferencesForData=function(a){var y=this.diagram.model,x=y.wa(a);if(x!==void 0){var E=vp(y,x),b=this.Lc(a);if(E!==null&&b!==null){E=E.iterator;for(var z={};E.next();){var tt=E.value;y.lb(tt)?b instanceof er&&y.lh(tt)===x&&(tt=this.Lc(tt),tt!==null&&(tt.containingGroup=b)):(z.link=this.Kc(tt),z.link!==null&&b instanceof $n&&(vl(y,tt,!0)===x&&(z.link.fromNode=b),vl(y,tt,!1)===x&&(z.link.toNode=b),tt=y.Ef(tt),Array.isArray(tt)&&tt.some(function(rt){return function(ot){return ot===x?(b.labeledLink=rt.link,!0):!1}}(z)))),z={link:z.link}}yu(y,x)}a=y.lh(a),a!==void 0&&(a=this.Vb(a),a instanceof er&&(b.containingGroup=a))}},Oa.prototype.unresolveReferencesForPart=function(a){var y=this.diagram.model;if(a instanceof $n){var x=y.wa(a.data);if(x!==void 0){for(var E=a.linksConnected;E.next();)vu(y,x,E.value.data);if(a.isLinkLabel&&(E=a.labeledLink,E!==null&&vu(y,x,E.data)),a instanceof er)for(a=a.memberParts;a.next();)E=a.value.data,y.lb(E)&&vu(y,x,E)}}},Oa.prototype.copyPartData=function(a,y){var x=vo.prototype.copyPartData.call(this,a,y);if(a instanceof Nn)if(a=a.data,a!==null&&y!==null){var E=y.model;a=E.Jo(a),typeof a=="object"&&a!==null&&(E.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},Oa.prototype.insertLink=function(a,y,x,E){var b=this.diagram,z=b.model,tt=b.toolManager.findTool("Linking"),rt="";if(a!==null&&(y===null&&(y=a),rt=y.portId,rt===null&&(rt="")),y="",x!==null&&(E===null&&(E=x),y=E.portId,y===null&&(y="")),E=tt.archetypeLinkData,E instanceof Nn){if(Zl(E),z=E.copy(),z!==null)return z.fromNode=a,z.fromPortId=rt,z.toNode=x,z.toPortId=y,b.add(z),a=tt.archetypeLabelNodeData,a instanceof $n&&(Zl(a),a=a.copy(),a!==null&&(a.labeledLink=z,b.add(a))),z}else if(E!==null&&(E=z.Jo(E),typeof E=="object"&&E!==null))return a!==null&&Yf(z,E,z.wa(a.data),!0),Xf(z,E,rt,!0),x!==null&&Yf(z,E,z.wa(x.data),!1),Xf(z,E,y,!1),z.fi(E),a=tt.archetypeLabelNodeData,a===null||a instanceof $n||(a=z.copyNodeData(a),typeof a=="object"&&a!==null&&(z.xf(a),a=z.wa(a),a!==void 0&&z.Bu(E,a))),b.Kc(E);return null},Oa.prototype.findLinkForKey=Oa.prototype.findLinkForKey,Oa.prototype.findPartForKey=Oa.prototype.findPartForKey,Oa.prototype.removeAllModeledParts=Oa.prototype.removeAllModeledParts,Oa.prototype.addModeledParts=Oa.prototype.addModeledParts,Oa.prototype.addAllModeledParts=Oa.prototype.addAllModeledParts,Oa.className="GraphLinksPartManager";function kl(){vo.apply(this,arguments),this.Sg=null}Se(kl,vo);function u0(a,y,x){if(y!==null&&x!==null&&x.kh()===null){var E=a.diagram.toolManager.findTool("Linking"),b=y,z=x;if(a.diagram.isTreePathToChildren||(b=x,z=y),(E===null||!ur(E,b,z,null,!0))&&(y=a.getLinkCategoryForData(x.data),E=a.findLinkTemplateForCategory(y),E!==null&&(Zl(E),E=E.copy(),E!==null))){var tt=a.diagram.skipsModelSourceBindings;a.diagram.skipsModelSourceBindings=!0,E.Tf=y,E.ub=x.data,E.fromNode=b,E.toNode=z,a.diagram.add(E),E.ub=null,E.data=x.data,a.diagram.skipsModelSourceBindings=tt}}}kl.prototype.getLinkCategoryForData=function(a){return this.diagram.model.ss(a)},kl.prototype.setLinkCategoryForData=function(a,y){this.diagram.model.Ms(a,y)},kl.prototype.setFromNodeForLink=function(a,y,x){var E=this.diagram.model;if(x===void 0&&(x=null),y=y!==null?y.data:null,this.diagram.isTreePathToChildren)E.qe(a.data,E.wa(y));else{var b=this.Sg;this.Sg=a,x!==null&&E.qe(x.data,void 0),E.qe(y,E.wa(a.toNode!==null?a.toNode.data:null)),this.Sg=b}},kl.prototype.setToNodeForLink=function(a,y,x){var E=this.diagram.model;if(x===void 0&&(x=null),y=y!==null?y.data:null,this.diagram.isTreePathToChildren){var b=this.Sg;this.Sg=a,x!==null&&E.qe(x.data,void 0),E.qe(y,E.wa(a.fromNode!==null?a.fromNode.data:null)),this.Sg=b}else E.qe(a.data,E.wa(y))},kl.prototype.removeDataForLink=function(a){this.diagram.model.qe(a.data,void 0)},kl.prototype.findLinkForKey=function(a){return a==null?null:(a=this.diagram.model.hc(a),a!==null?this.bf.I(a):null)},kl.prototype.doModelChanged=function(a){if(vo.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 E=a.modelChange;if(E!==""){if(x===wr){if(E==="nodeParentKey"){var b=a.object,z=this.Vb(a.newValue),tt=this.ii(b);if(this.Sg!==null)z!==null&&(this.Sg.data=b,this.Sg.category=this.getLinkCategoryForData(b));else if(tt!==null){var rt=tt.kh();rt!==null?z===null?y.remove(rt):y.isTreePathToChildren?rt.fromNode=z:rt.toNode=z:u0(this,z,tt)}}else if(E==="parentLinkCategory"){var ot=this.ii(a.object),lt=a.newValue;if(ot!==null&&typeof lt=="string"){var ut=ot.kh();ut!==null&&(ut.category=lt)}}y.isModified=!0}}else if(x===wr){var ft=a.propertyName;a.object===y.model&&ft==="nodeParentKeyProperty"&&(y.undoManager.isUndoingRedoing||this.Wd()),y.isModified=!0}}finally{y.aa=!0}}}}},kl.prototype.updateRelationshipsFromData=function(a){var y=a.data;if(y!==null){var x=a.diagram;if(x!==null){var E=x.model;a instanceof $n&&(y=E.mh(y),y=x.Vb(y),E=a.pg(),y!==E&&(E=a.kh(),y!==null?E!==null?x.isTreePathToChildren?E.fromNode=y:E.toNode=y:u0(this,y,a):E!==null&&Ng(x,E,!1)))}}},kl.prototype.updateDataBindings=function(a,y){vo.prototype.updateDataBindings.call(this,a,y),typeof y=="string"&&this.Lc(a)!==null&&(a=this.Kc(a),a!==null&&a.La(y))},kl.prototype.resolveReferencesForData=function(a){var y=this.diagram.model,x=y.wa(a);if(x!==void 0){var E=vp(y,x),b=this.Lc(a);if(E!==null&&b!==null){for(E=E.iterator;E.next();){var z=E.value;y.lb(z)&&b instanceof $n&&y.mh(z)===x&&u0(this,b,this.ii(z))}yu(y,x)}a=y.mh(a),a!==void 0&&b instanceof $n&&(a=this.Vb(a),u0(this,a,b))}},kl.prototype.unresolveReferencesForPart=function(a){var y=this.diagram.model;if(a instanceof $n){var x=y.wa(a.data),E=this.Kc(a.data);if(E!==null){E.isSelected=!1,E.isHighlighted=!1;var b=E.layer;if(b!==null){var z=b.pc(-1,E,!1);0<=z&&this.diagram.cb(So,"parts",b,E,null,z,null),z=E.layerChanged,z!==null&&z(E,b,null)}}for(E=this.diagram.isTreePathToChildren,a=a.linksConnected;a.next();)b=a.value,b=(E?b.toNode:b.fromNode).data,y.lb(b)&&vu(y,x,b)}},kl.prototype.insertLink=function(a,y,x){y=this.diagram.model;var E=a,b=x;return this.diagram.isTreePathToChildren||(E=x,b=a),E!==null&&b!==null?(y.qe(b.data,y.wa(E.data)),b.kh()):null},kl.prototype.findLinkForKey=kl.prototype.findLinkForKey,kl.className="TreePartManager";function wi(a,y){this.kl=new pn,this.il=new pn,this.Wv=`,
|
|
"insertedNodeKeys": `,this.jy=`,
|
|
"modifiedNodeData": `,this.Yv=`,
|
|
"removedNodeKeys": `,this.vh=null,Hi(this),this.Sm=this.xa="",this.Gg=!1,this.j={},this.Tc=[],this.kb=new be,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 be,this.Lt=new fn,this.Wg=!1,this.o=null,this.undoManager=new $i,a!==void 0&&($e(a)?this.nodeDataArray=a:y=a),y&&(Object.assign(this,y),a=y.Changed)&&(delete this.Changed,this.Pe(a))}wi.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},wi.prototype.copy=function(){var a=new this.constructor;return this.cloneProtected(a),a},wi.prototype.clear=function(){this.Tc=[],this.kb.clear(),this.Vf.clear(),this.undoManager.clear()},wi.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,E=0;E<x;E++){var b=a[E];y+=" "+this.wa(b)+":"+Ii(b)}}return y},wi.prototype.xA=function(a){a.change!==Qi&&Gt("Model.toIncrementalData argument is not a Transaction ChangedEvent:"+a.toString());var y=a.object;return a.isTransactionFinished&&y instanceof No?(xS(this,y),a=this.Qv(y,a.propertyName==="FinishedUndo"),this.vh=null,a):null},wi.prototype.Qv=function(a,y){var x=this,E=!1,b=new pn,z=new pn,tt=new pn,rt=this.vh;a.changes.each(function(ft){ft.model===x&&(ft.modelChange==="nodeDataArray"?ft.change===ro?b.add(ft.newValue):ft.change===So&&tt.add(ft.oldValue):x.lb(ft.object)?z.add(ft.object):ft.change!==wr||x.modelData!==ft.object&&ft.propertyName!=="modelData"?ft.object!==null&&(rt&&rt.contains(ft.object)?rt.get(ft.object).each(function(yt){x.lb(yt)&&z.add(yt)}):ft.object instanceof wi||x.ri()&&x.Jc(ft.object)||PS(x,ft.object).each(function(yt){z.add(yt)})):E=!0)});var ot=this.il;ot.clear(),b.each(function(ft){ot.add(x.wa(ft)),y||z.add(ft)});var lt=this.kl;lt.clear(),tt.each(function(ft){lt.add(x.wa(ft)),y&&z.add(ft)}),a=x.cloneDeep(z.Fa());var ut=null;return E&&(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<lt.count&&(ut===null&&(ut={}),y?ut.insertedNodeKeys=lt.Fa():ut.removedNodeKeys=lt.Fa()),lt.clear(),ot.clear(),ut},wi.prototype.cloneDeep=function(a){return Uf(this,a,!0)};function Uf(a,y,x,E,b,z){function tt(ft,yt){rt?(ft.__gohashid===void 0&&z.push(ft),E.set(ft,yt)):(ft=xo++,E.set(ft,yt),b.set(ft,y))}if(!Ie(y))return y;z||(z=[]);var rt=Object.isExtensible(y);if(E||(E=new be),rt){var ot=E.get(y);if(ot)return ot}else for(b||(b=new be),ot=b.iterator;ot.next();){var lt=ot.key;if(ot.value===y&&(lt=E.get(lt)))return lt}if(Array.isArray(y)){ot=[],tt(y,ot);for(var ut=0;ut<y.length;ut++)ot.push(Uf(a,y[ut],!1,E,b,z))}else if(y instanceof At||y instanceof on||y instanceof Be||y instanceof nr||y instanceof fi)ot=y.copy(),tt(y,ot);else{if(y instanceof mo||y instanceof fe||y instanceof rn)return y;if(y instanceof fn)ot=new fn().addAll(Uf(a,y.Fa(),!1,E,b,z)),tt(y,ot);else if(y instanceof pn)ot=new pn().addAll(Uf(a,y.Fa(),!1,E,b,z)),tt(y,ot);else if(y instanceof be)ot=new be().addAll(Uf(a,y.Fa(),!1,E,b,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]=Uf(a,y[ut],!1,E,b,z))}return x&&z.forEach(function(ft){delete ft.__gohashid}),ot}wt=wi.prototype,wt.quote=function(a){return JSON.stringify(a).replace(/[\u007F-\uFFFF]/g,function(y){return"\\u"+("0000"+y.charCodeAt(0).toString(16)).substr(-4)})},wt.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},wt.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,Ie(y)&&(a.dm(y),a.modelData=y)}wt.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": `+md(this,this.nodeDataArray,!0)},wt.kv=function(a){SS(this,a),a=a.nodeDataArray,$e(a)&&(this.dm(a),this.nodeDataArray=a)};function xS(a,y){function x(b,z){if((z=z.part)&&(z=z.data,b!==z)){var tt=E.get(b);tt===null?(tt=new pn,tt.add(z),E.add(b,tt)):tt.add(z)}}var E=a.vh;E===null&&(E=new be,y.changes.each(function(b){if(b.diagram!==null){var z=b.change;z===wr?(b=b.object.panel)&&(z=b.data)&&x(z,b):(z===ro||z===So)&&(b=b.object,(z=b.itemArray)&&x(z,b))}}),a.vh=E)}function PS(a,y){for(var x=new pn,E=0;E<a.nodeDataArray.length;E++){var b=a.nodeDataArray[E];h0(a,y,b,b,x)}return x}function h0(a,y,x,E,b){if(Array.isArray(x))for(var z=0;z<x.length;z++){var tt=x[z];if(tt===y)return b.add(E),!0;if(h0(a,y,tt,E,b))return!0}else if(Ie(x)&&Object.getPrototypeOf(x)===Object.prototype)for(z in x){if(tt=x[z],tt===y)return b.add(E),!0;if(h0(a,y,tt,E,b))return!0}return!1}wt.Pv=function(a,y){var x=this,E=!1,b=new pn,z=new pn,tt=new pn,rt=this.vh;a.changes.each(function(ut){ut.model===x&&(ut.modelChange==="nodeDataArray"?ut.change===ro?b.add(ut.newValue):ut.change===So&&tt.add(ut.oldValue):x.lb(ut.object)?z.add(ut.object):ut.change!==wr||x.modelData!==ut.object&&ut.propertyName!=="modelData"?ut.object!==null&&(rt&&rt.contains(ut.object)?rt.get(ut.object).each(function(ft){x.lb(ft)&&z.add(ft)}):ut.object instanceof wi||x.ri()&&x.Jc(ut.object)||PS(x,ut.object).each(function(ft){z.add(ft)})):E=!0)});var ot=this.il;ot.clear(),b.each(function(ut){ot.add(x.wa(ut)),y||z.add(ut)});var lt=this.kl;return lt.clear(),tt.each(function(ut){lt.add(x.wa(ut)),y&&z.add(ut)}),a="",E&&(a+=`,
|
|
"modelData": `+uy(this,this.modelData)),0<ot.count&&(a+=(y?this.Yv:this.Wv)+md(this,ot.Fa(),!0)),0<z.count&&(a+=this.jy+md(this,z.Fa(),!0)),0<lt.count&&(a+=(y?this.Wv:this.Yv)+md(this,lt.Fa(),!0)),lt.clear(),ot.clear(),a},wt.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)&&Gt("applyIncrementalJson cannot change Model properties"),SS(this,a);var y=a.insertedNodeKeys,x=a.modifiedNodeData,E=new be;if(Array.isArray(x))for(var b=0;b<x.length;b++){var z=x[b],tt=this.wa(z);tt!=null&&E.set(tt,z)}if(Array.isArray(y))for(b=y.length,z=0;z<b;z++){tt=y[z];var rt=this.hc(tt);rt===null&&(rt=(rt=E.get(tt))?rt:this.copyNodeData({}),this.km(rt,tt),this.xf(rt))}if(Array.isArray(x)){for(y=x.length,E=0;E<y;E++)if(b=x[E],z=this.wa(b),z=this.hc(z),z!==null){for(var ot in b)ot==="__gohashid"||ot===this.nodeKeyProperty||this.Wj()&&ot===this.nodeIsGroupProperty||this.setDataProperty(z,ot,b[ot]);this.lm(b,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)},wt.$x=function(a,y){a.change!==Qi&&Gt("Model.toIncrementalJson argument is not a Transaction ChangedEvent:"+a.toString());var x=a.object;return a.isTransactionFinished&&x instanceof No?(y===void 0&&(y=yp(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 }'},wt.yA=function(a,y){return this.$x(a,y)},wt.np=function(a){return a===void 0&&(a=yp(this,this)),'{ "class": '+this.quote(a)+this.rm()+this.Rv()+"}"},wt.toJSON=function(a){return this.np(a)},wt.Zw=function(a){var y=null;if(typeof a=="string")try{y=Je.JSON.parse(a)}catch(E){}else typeof a=="object"?y=a:Gt("Unable to modify a Model from: "+a);var x=y.incremental;typeof x!="number"&&Gt("Unable to apply non-incremental changes to Model: "+a),x!==0&&(this.Ea("applyIncrementalJson"),this.fp(y),this.eb("applyIncrementalJson"))},wt.Ky=function(a){return this.Zw(a)},wi.constructGraphLinksModel=function(){return new wi},wt=wi.prototype,wt.dm=function(a){if($e(a))for(var y=a.length,x=0;x<y;x++){var E=a[x];if(Ie(E)){var b=x;E=this.dm(E),Array.isArray(a)?a[b]=E:Gt("Cannot replace an object in an HTMLCollection or NodeList at "+b)}}else if(Ie(a)){for(y in a)if(x=a[y],Ie(x)&&(x=this.dm(x),a[y]=x,y==="points"&&Array.isArray(x))){for(b=x.length%2===0,E=0;E<x.length;E++)if(typeof x[E]!="number"){b=!1;break}if(b){for(b=new fn,E=0;E<x.length/2;E++)b.add(new At(x[2*E],x[2*E+1]));b.freeze(),a[y]=b}}return Bx(a)}return a},wt.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()):$e(a)?md(this,a):Ie(a)?uy(this,a):typeof a=="function"?"null":a.toString()};function md(a,y,x){x===void 0&&(x=!1);var E=y.length;if(0>=E)return"[]";var b=new bi;b.add("["),x&&1<E&&b.add(`
|
|
`);for(var z=0;z<E;z++){var tt=y[z];tt!==void 0&&(0<z&&(b.add(","),x&&b.add(`
|
|
`)),b.add(a.sm(tt)))}return x&&1<E&&b.add(`
|
|
`),b.add("]"),b.toString()}function wS(a,y){return y===void 0||a==="__gohashid"||a[0]==="_"||typeof y=="function"}function Fs(a){return isNaN(a)?"NaN":a===1/0?"9e9999":a===-1/0?"-9e9999":a}function uy(a,y){var x=y;if(x instanceof At)y={class:"go.Point",x:Fs(x.x),y:Fs(x.y)};else if(x instanceof on)y={class:"go.Size",width:Fs(x.width),height:Fs(x.height)};else if(x instanceof Be)y={class:"go.Rect",x:Fs(x.x),y:Fs(x.y),width:Fs(x.width),height:Fs(x.height)};else if(x instanceof nr)y={class:"go.Margin",top:Fs(x.top),right:Fs(x.right),bottom:Fs(x.bottom),left:Fs(x.left)};else if(x instanceof fi)x.sb()?y={class:"go.Spot",x:Fs(x.x),y:Fs(x.y),offsetX:Fs(x.offsetX),offsetY:Fs(x.offsetY)}:y={class:"go.Spot",enum:x.toString()};else if(x instanceof mo){if(y={class:"go.Brush",type:x.type.name},x.type===Ah?y.color=x.color:(x.type===dh||x.type===Fl)&&(y.start=x.start,y.end=x.end,x.type===Fl&&(x.startRadius!==0&&(y.startRadius=Fs(x.startRadius)),isNaN(x.endRadius)||(y.endRadius=Fs(x.endRadius)))),x.colorStops!==null){var E={};for(x=x.colorStops.iterator;x.next();)E[x.key]=x.value;y.colorStops=E}}else x instanceof fe?(y={class:"go.Geometry",type:x.type.name},x.startX!==0&&(y.startX=Fs(x.startX)),x.startY!==0&&(y.startY=Fs(x.startY)),x.endX!==0&&(y.endX=Fs(x.endX)),x.endY!==0&&(y.endY=Fs(x.endY)),x.spot1.D(_r)||(y.spot1=x.spot1),x.spot2.D(lo)||(y.spot2=x.spot2),x.type===fe.o&&(y.path=fe.ia(x))):x instanceof rn&&(y={class:"go.EnumValue",classType:yp(a,x.classType),name:x.name});E="{",x=!0;for(var b in y){var z=sa(y,b);if(!wS(b,z))if(x?x=!1:E+=",",E+=a.quote(b)+":",b==="points"&&z instanceof fn){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+="]",E+=tt}else E+=a.sm(z)}return E+"}"}function Ms(a){return typeof a=="number"?a:a==="NaN"?NaN:a==="9e9999"?1/0:a==="-9e9999"?-1/0:parseFloat(a)}function Bx(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 At(Ms(a.x),Ms(a.y));else if(y==="Size")x=new on(Ms(a.width),Ms(a.height));else if(y==="Rect")x=new Be(Ms(a.x),Ms(a.y),Ms(a.width),Ms(a.height));else if(y==="Margin")x=new nr(Ms(a.top),Ms(a.right),Ms(a.bottom),Ms(a.left));else if(y==="Spot")typeof a.enum=="string"?x=wo(a.enum):x=new fi(Ms(a.x),Ms(a.y),Ms(a.offsetX),Ms(a.offsetY));else if(y==="Brush"){if(x=new mo,x.type=On(mo,a.type),typeof a.color=="string"&&(x.color=a.color),a.start instanceof fi&&(x.start=a.start),a.end instanceof fi&&(x.end=a.end),typeof a.startRadius=="number"&&(x.startRadius=Ms(a.startRadius)),typeof a.endRadius=="number"&&(x.endRadius=Ms(a.endRadius)),a=a.colorStops,Ie(a))for(var E in a)x.addColorStop(parseFloat(E),a[E])}else y==="Geometry"?(x=null,typeof a.path=="string"?x=fe.parse(a.path):x=new fe,x.type=On(fe,a.type),typeof a.startX=="number"&&(x.startX=Ms(a.startX)),typeof a.startY=="number"&&(x.startY=Ms(a.startY)),typeof a.endX=="number"&&(x.endX=Ms(a.endX)),typeof a.endY=="number"&&(x.endY=Ms(a.endY)),a.spot1 instanceof fi&&(x.spot1=a.spot1),a.spot2 instanceof fi&&(x.spot2=a.spot2)):y==="EnumValue"&&(E=a.classType,E.indexOf("go.")===0&&(E=E.substr(3)),E=dy(E),typeof E=="function"&&(x=On(E,a.name)));return x}wt.Pe=function(a){return this.Lt.add(a),this},wt.ik=function(a){this.Lt.remove(a)},wt.ds=function(a){this.skipsUndoManager||this.undoManager.Tu(a);for(var y=this.Lt,x=y.length,E=0;E<x;E++)y.M(E)(a)},wt.cb=function(a,y,x,E,b,z,tt){xa(this,"",a,y,x,E,b,z,tt)},wt.g=function(a,y,x,E,b){xa(this,"",wr,a,this,y,x,E,b)},wt.Fs=function(a,y,x,E,b,z){xa(this,"",wr,y,a,x,E,b,z)};function xa(a,y,x,E,b,z,tt,rt,ot){rt===void 0&&(rt=null),ot===void 0&&(ot=null);var lt=new Li;lt.model=a,lt.change=x,lt.modelChange=y,lt.propertyName=E,lt.object=b,lt.oldValue=z,lt.oldParam=rt,lt.newValue=tt,lt.newParam=ot,a.ds(lt)}wi.prototype.changeState=function(a,y){if(a!==null&&a.model===this)if(a.change===wr){var x=a.object,E=a.propertyName,b=a.I(y);E===this.nodeKeyProperty&&this.lb(x)&&(y=a.I(!y),y!==void 0&&this.kb.remove(y),b!==void 0&&this.kb.add(b,x)),Vo(x,E,b)}else a.change===ro?(x=a.newParam,a.modelChange==="nodeDataArray"?(a=a.newValue,Ie(a)&&typeof x=="number"&&(E=this.wa(a),y?(this.Tc[x]===a&&hi(this.Tc,x),E!==void 0&&this.kb.remove(E)):(this.Tc[x]!==a&&_n(this.Tc,x,a),E!==void 0&&this.kb.add(E,a)))):a.modelChange===""?((E=a.object)&&!$e(E)&&a.propertyName&&(E=sa(a.object,a.propertyName)),$e(E)&&typeof x=="number"&&(a=a.newValue,y?hi(E,x):_n(E,x,a))):Gt("unknown ChangedEvent.Insert modelChange: "+a.toString())):a.change===So?(x=a.oldParam,a.modelChange==="nodeDataArray"?(a=a.oldValue,Ie(a)&&typeof x=="number"&&(E=this.wa(a),y?(this.Tc[x]!==a&&_n(this.Tc,x,a),E!==void 0&&this.kb.add(E,a)):(this.Tc[x]===a&&hi(this.Tc,x),E!==void 0&&this.kb.remove(E)))):a.modelChange===""?((E=a.object)&&!$e(E)&&a.propertyName&&(E=sa(a.object,a.propertyName)),$e(E)&&typeof x=="number"&&(a=a.oldValue,y?_n(E,x,a):hi(E,x))):Gt("unknown ChangedEvent.Remove modelChange: "+a.toString())):a.change!==Qi&&Gt("unknown ChangedEvent: "+a.toString())},wi.prototype.Ea=function(a){return this.undoManager.Ea(a)},wi.prototype.eb=function(a){return this.undoManager.eb(a)},wi.prototype.Kf=function(){return this.undoManager.Kf()},wi.prototype.commit=function(a,y){y===void 0&&(y="");var x=this.skipsUndoManager;y===null&&(this.skipsUndoManager=!0,y=""),this.undoManager.Ea(y);var E=!1;try{a(this),E=!0}finally{E?this.undoManager.eb(y):this.undoManager.Kf(),this.skipsUndoManager=x}},wt=wi.prototype,wt.La=function(a,y){y===void 0&&(y=""),xa(this,"SourceChanged",Qi,y,a,null,null)},wt.wa=function(a){if(a!==null){var y=this.Th;if(y!==""&&(y=sa(a,y),y!==void 0)){if(vd(y))return y;Gt("Key value for node data "+a+" is not a number or a string: "+y)}}},wt.km=function(a,y){if(a!==null){var x=this.Th;if(x!=="")if(this.lb(a)){var E=sa(a,x);E!==y&&this.hc(y)===null&&(Vo(a,x,y),E!==void 0&&this.kb.remove(E),this.kb.add(y,a),xa(this,"nodeKey",wr,x,a,E,y),typeof x=="string"&&this.La(a,x),this.jp(E,y))}else Vo(a,x,y)}};function vd(a){return typeof a=="number"||typeof a=="string"}wt.lb=function(a){var y=this.wa(a);return y===void 0?!1:this.kb.I(y)===a},wt.hc=function(a){return a===null&&Gt("Model.findNodeDataForKey:key must not be null"),a!==void 0&&vd(a)?this.kb.I(a):null},wt.$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 E=this.bl;if(E!==null&&(x=E(this,a),x!=null&&!this.kb.contains(x))){Vo(a,y,x);return}if(typeof x=="string"){for(E=2;this.kb.contains(x+E);)E++;Vo(a,y,x+E)}else if(x===void 0||typeof x=="number"){for(x=-this.kb.count-1;this.kb.contains(x);)x--;Vo(a,y,x)}}}}},wt.xf=function(a){a!==null&&(Kr(a),this.lb(a)||CS(this,a,!0))};function CS(a,y,x){var E=a.wa(y);(E===void 0||a.kb.I(E)!==y)&&(a.$u(y),E=a.wa(y),E===void 0&&Gt("Model.makeNodeDataKeyUnique failed on "+y+". Data not added to Model."),a.kb.add(E,y),E=null,x&&(E=a.Tc.length,_n(a.Tc,E,y)),xa(a,"nodeDataArray",ro,"nodeDataArray",a,null,y,null,E),a.fm(y),a.em(y))}wt.Fy=function(a){if($e(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)},wt.cm=function(a){a!==null&&ES(this,a,!0)};function ES(a,y,x){var E=a.wa(y);if(E!==void 0&&a.kb.remove(E),E=null,x){t:if(x=a.Tc,Array.isArray(x))E=x.indexOf(y);else{E=x.length;for(var b=0;b<E;b++)if(x[b]===y){E=b;break t}E=-1}if(0>E)return;hi(a.Tc,E)}xa(a,"nodeDataArray",So,"nodeDataArray",a,y,null,E,null),a.qp(y)}wt.nA=function(a){if($e(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)},wt.$z=function(a){if(a!==this.nodeDataArray&&$e(a)){var y=this.kl;y.clear(),y.addAll(this.kb.iteratorKeys);var x=this.il;x.clear();for(var E=a.length,b=0;b<E;b++){var z=a[b],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();)E=a.value,x.contains(E)||(E=this.hc(E))&&this.cm(E);y.clear(),x.clear()}},wt.jp=function(a,y){y!==void 0&&(a=vp(this,a),a instanceof pn&&this.Vf.add(y,a))},wt.Lv=function(){},wt.fm=function(){},wt.em=function(){},wt.qp=function(){};function vu(a,y,x){if(y!==void 0){var E=a.Vf.I(y);E===null&&(E=new pn,a.Vf.add(y,E)),E.add(x)}}function yu(a,y,x){if(y!==void 0){var E=a.Vf.I(y);E instanceof pn&&(x==null?a.Vf.remove(y):(E.remove(x),E.count===0&&a.Vf.remove(y)))}}function vp(a,y){return y===void 0?null:(a=a.Vf.I(y),a instanceof pn?a:null)}wt.Qy=function(a){a===void 0?this.Vf.clear():this.Vf.remove(a)},wi.prototype.copyNodeData=function(a){if(a===null)return null;var y=this.Bk;return a=y!==null?y(a,this):d0(this,a,!0),Ie(a)&&Hi(a),a};function d0(a,y,x){if(a.copiesArrays&&Array.isArray(y)){var E=[];for(x=0;x<y.length;x++){var b=d0(a,y[x],a.copiesArrayObjects);E.push(b)}return Hi(E),E}if(x&&Ie(y)){x=(x=y.constructor)?new x:{},b=a.copiesKey||typeof a.nodeKeyProperty!="string"?null:a.nodeKeyProperty;for(E in y)if(E==="__gohashid")x.__gohashid=void 0;else if(E===b)x[b]=void 0;else{var z=sa(y,E),tt=yp(a,z);tt==="GraphObject"||tt==="Diagram"||tt==="Layer"||tt==="RowColumnDefinition"||tt==="AnimationManager"||tt==="Tool"||tt==="CommandHandler"||tt==="Layout"||tt==="InputEvent"||tt==="DiagramEvent"||z instanceof wi||z instanceof $i||z instanceof No||z instanceof Li||(z=d0(a,z,!1)),Vo(x,E,z)}return Hi(x),x}return y instanceof At||y instanceof on||y instanceof Be||y instanceof fi||y instanceof nr?y.copy():y}wi.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!LS&&a instanceof ge&&(LS=!0,Mn('Model.setDataProperty is modifying a GraphObject, "'+a.toString()+'"'),Mn(" Is that really your intent?"));var E=sa(a,y);E!==x&&(Vo(a,y,x),this.Fs(a,y,E,x))},wt=wi.prototype,wt.set=function(a,y,x){this.setDataProperty(a,y,x)},wt.Do=function(a,y){if(y){var x=this.lb(a),E;for(E in y)E==="__gohashid"||x&&E===this.nodeKeyProperty||this.setDataProperty(a,E,y[E])}},wt.Ay=function(a,y){this.ts(a,-1,y)},wt.ts=function(a,y,x){0>y&&(y=a.length),_n(a,y,x),xa(this,"",ro,"",a,null,x,null,y)},wt.ov=function(a,y){y===void 0&&(y=-1),a===this.Tc&&Gt("Model.removeArrayItem should not be called on the Model.nodeDataArray"),y===-1&&(y=a.length-1);var x=a[y];hi(a,y),xa(this,"",So,"",a,x,null,y,null)},wt.Ro=function(a){if(a===null)return"";var y=this.lj;if(y===""||(y=sa(a,y),y===void 0))return"";if(typeof y=="string")return y;Gt("getCategoryForNodeData found a non-string category for "+a+": "+y)},wt.jm=function(a,y){if(a!==null){var x=this.lj;if(x!=="")if(this.lb(a)){var E=sa(a,x);E===void 0&&(E=""),E!==y&&(Vo(a,x,y),xa(this,"nodeCategory",wr,x,a,E,y))}else Vo(a,x,y)}},wt.lm=function(a,y){this.jm(y,this.Ro(a))},wt.Tl=function(){return!1},wt.Wj=function(){return!1},wt.ri=function(){return!1},wt.xs=function(){return!1},wt.Xj=function(){return!1};function hy(){return new wi}function yp(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 yp(a,y.constructor);return typeof y}function dy(a){return ru[a]?ru[a]:Je.go!==void 0&&Je.go[a]?Je.go[a]:null}function sa(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(E){}return x}function Vo(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(E){}}ye.Object.defineProperties(wi.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===""&&Gt("Model.nodeKeyProperty may not be the empty string"),0<this.kb.count&&Gt("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,E=0;E<x;E++){var b=a[E];Ie(b)||Gt("Model.nodeDataArray must only contain Objects, not: "+b),Kr(b)}for(this.Tc=a,E=new fn,b=0;b<x;b++){var z=a[b],tt=this.wa(z);tt===void 0||this.kb.I(tt)!==null?E.add(z):this.kb.add(tt,z)}for(E=E.iterator;E.next();)b=E.value,this.$u(b),z=this.wa(b),z!==void 0&&this.kb.add(z,b);for(xa(this,"nodeDataArray",wr,"nodeDataArray",this,y,a),y=0;y<x;y++)E=a[y],this.fm(E),this.em(E);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"}}}),wi.prototype.setCategoryForNodeData=wi.prototype.jm,wi.prototype.getCategoryForNodeData=wi.prototype.Ro,wi.prototype.removeArrayItem=wi.prototype.ov,wi.prototype.insertArrayItem=wi.prototype.ts,wi.prototype.addArrayItem=wi.prototype.Ay,wi.prototype.assignAllDataProperties=wi.prototype.Do,wi.prototype.set=wi.prototype.set,wi.prototype.clearUnresolvedReferences=wi.prototype.Qy,wi.prototype.mergeNodeDataArray=wi.prototype.$z,wi.prototype.removeNodeDataCollection=wi.prototype.nA,wi.prototype.removeNodeData=wi.prototype.cm,wi.prototype.addNodeDataCollection=wi.prototype.Fy,wi.prototype.addNodeData=wi.prototype.xf,wi.prototype.makeNodeDataKeyUnique=wi.prototype.$u,wi.prototype.findNodeDataForKey=wi.prototype.hc,wi.prototype.containsNodeData=wi.prototype.lb,wi.prototype.setKeyForNodeData=wi.prototype.km,wi.prototype.getKeyForNodeData=wi.prototype.wa,wi.prototype.updateTargetBindings=wi.prototype.La,wi.prototype.commit=wi.prototype.commit,wi.prototype.rollbackTransaction=wi.prototype.Kf,wi.prototype.commitTransaction=wi.prototype.eb,wi.prototype.startTransaction=wi.prototype.Ea,wi.prototype.raiseDataChanged=wi.prototype.Fs,wi.prototype.raiseChanged=wi.prototype.g,wi.prototype.raiseChangedEvent=wi.prototype.cb,wi.prototype.removeChangedListener=wi.prototype.ik,wi.prototype.addChangedListener=wi.prototype.Pe,wi.prototype.writeJsonValue=wi.prototype.sm,wi.prototype.replaceJsonObjects=wi.prototype.dm,wi.prototype.applyIncrementalJSON=wi.prototype.Ky,wi.prototype.applyIncrementalJson=wi.prototype.Zw,wi.prototype.toJSON=wi.prototype.toJSON,wi.prototype.toJson=wi.prototype.np,wi.prototype.toIncrementalJSON=wi.prototype.yA,wi.prototype.toIncrementalJson=wi.prototype.$x,wi.prototype.toIncrementalData=wi.prototype.xA,wi.prototype.clear=wi.prototype.clear;var LS=!1,ru={};wi.className="Model",wi.fromJSON=wi.fromJson=function(a,y){y===void 0&&(y=null);var x=null;if(typeof a=="string")try{x=Je.JSON.parse(a)}catch(z){}else typeof a=="object"?x=a:Gt("Unable to construct a Model from: "+a);if(y===null){a=null;var E=x.class;if(typeof E=="string")try{var b=null;E.indexOf("go.")===0?(E=E.substr(3),b=dy(E)):(b=dy(E),b===null&&(b=Je[E])),typeof b=="function"&&(a=new b)}catch(z){}a===null||a instanceof wi?y=a:Gt("Unable to construct a Model of declared class: "+x.class)}return y===null&&(y=wi.constructGraphLinksModel()),y.gp(x),y.kv(x),y},wi.safePropertyValue=sa,wi.safePropertySet=Vo,ru.Brush=mo,ru.ChangedEvent=Li,ru.Geometry=fe,ru.Margin=nr,ru.Panel=wn,ru.Point=At,ru.Rect=Be,ru.Size=on,ru.Spot=fi,ru.Transaction=No,ru.UndoManager=$i;function ha(a,y,x,E){Hi(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,E===void 0?(this.el=MS,this.wk=null):(this.el=Sp,this.wk=E),this.st=new pn}ha.prototype.copy=function(){var a=new ha;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},wt=ha.prototype,wt.qb=function(a){a.classType===ha&&(this.mode=a)},wt.toString=function(){return"Binding("+this.targetProperty+":"+this.sourceProperty+(this.Ai!==-1?" "+this.Ai:"")+" "+this.mode.name+")"},wt.freeze=function(){return this._isFrozen=!0,this},wt.ka=function(){return this._isFrozen=!1,this},wt.Kx=function(a){return a===void 0&&(a=null),this.mode=Sp,this.backConverter=a,this},wt.cp=function(a){return a===void 0&&(a=""),this.sourceName=a,this.isToModel=!1,this},wt.dA=function(){return this.sourceName=null,this.isToModel=!0,this};function FS(a,y,x){return a=a.sourceName,a===null||a===""?y:a==="/"?x.part:a==="."?x:a===".."?x.panel:y.fb(a)}wt.Mv=function(a,y,x){var E=this.sl;if(x===void 0||E===""||E===x){x=this.xl;var b=this.Im;if(b===null&&x==="")Mn("Binding error: target property is the empty string: "+this.toString());else{var z=y;if(E!==""&&(z=sa(y,E)),z!==void 0)if(b===null)x!==""&&Vo(a,x,z);else try{if(x!==""){var tt=b(z,a);Vo(a,x,tt)}else b(z,a)}catch(rt){}}}},wt.sp=function(a,y,x,E){if(this.el===Sp){var b=this.xl;if(x===void 0||b===x){x=this.sl;var z=this.wk,tt=a;if(b!==""&&(tt=sa(a,b)),tt!==void 0&&!this.st.contains(a))try{this.st.add(a);var rt=E!==null?E.diagram:null,ot=rt!==null?rt.model:null;if(z===null){if(x!=="")ot!==null?ot.setDataProperty(y,x,tt):Vo(y,x,tt);else if(ot!==null&&E!==null&&0<=E.itemIndex&&E.panel!==null&&Array.isArray(E.panel.itemArray)){var lt=E.itemIndex,ut=E.panel.itemArray;ot.ov(ut,lt),ot.ts(ut,lt,tt)}}else try{if(x!==""){var ft=z(tt,y,ot);ot!==null?ot.setDataProperty(y,x,ft):Vo(y,x,ft)}else{var yt=z(tt,y,ot);if(yt!==void 0&&ot!==null&&E!==null&&0<=E.itemIndex&&E.panel!==null&&Array.isArray(E.panel.itemArray)){var xt=E.itemIndex,Ct=E.panel.itemArray;ot.ov(Ct,xt),ot.ts(Ct,xt,yt)}}}catch(bt){}}finally{this.st.remove(a)}}}},ye.Object.defineProperties(ha.prototype,{Ai:{get:function(){return this.j},set:function(a){this._isFrozen&&de(this),this.j=a}},targetProperty:{get:function(){return this.xl},set:function(a){this._isFrozen&&de(this),this.xl=a}},sourceName:{get:function(){return this.Cr},set:function(a){this._isFrozen&&de(this),this.Cr=a,a!==null&&(this.wn=!1)}},isToModel:{get:function(){return this.wn},set:function(a){this._isFrozen&&de(this),this.wn=a}},sourceProperty:{get:function(){return this.sl},set:function(a){this._isFrozen&&de(this),this.sl=a}},converter:{get:function(){return this.Im},set:function(a){this._isFrozen&&de(this),this.Im=a}},backConverter:{get:function(){return this.wk},set:function(a){this._isFrozen&&de(this),this.wk=a}},mode:{get:function(){return this.el},set:function(a){this._isFrozen&&de(this),this.el=a}}}),ha.prototype.updateSource=ha.prototype.sp,ha.prototype.updateTarget=ha.prototype.Mv,ha.prototype.ofModel=ha.prototype.dA,ha.prototype.ofObject=ha.prototype.cp,ha.prototype.makeTwoWay=ha.prototype.Kx;var Ax="Binding",MS=new rn(ha,"OneWay",1),Sp=new rn(ha,"TwoWay",2);ha.className="Binding",ha.parseEnum=function(a,y){return function(x){return x=On(a,x),x===null?y:x}},ha.toString=Ii,ha.OneWay=MS,ha.TwoWay=Sp;function Vr(a,y,x){wi.call(this),this.Vv=`,
|
|
"insertedLinkKeys": `,this.iy=`,
|
|
"modifiedLinkData": `,this.Xv=`,
|
|
"removedLinkKeys": `,this.md=[],this.$f=new pn,this.wb=new be,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&&($e(a)?this.nodeDataArray=a:x=a),x&&(Object.assign(this,x),a=x.Changed)&&(delete this.Changed,this.Pe(a))}Se(Vr,wi),Vr.constructGraphLinksModel=wi.constructGraphLinksModel,Vr.prototype.cloneProtected=function(a){wi.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},wt=Vr.prototype,wt.clear=function(){wi.prototype.clear.call(this),this.md=[],this.wb.clear(),this.$f.clear()},wt.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,E;for(E=0;E<x;E++){var b=a[E];y+=" "+this.wa(b)+":"+Ii(b)}for(y+=`
|
|
link data:`,a=this.linkDataArray,x=a.length,E=0;E<x;E++)b=a[E],y+=" "+vl(this,b,!0)+"-->"+vl(this,b,!1)}return y},wt.Qv=function(a,y){this.linkKeyProperty===""&&Gt("GraphLinksModel.linkKeyProperty must not be an empty string for .toIncrementalData() to succeed.");var x=wi.prototype.Qv.call(this,a,y),E=this,b=new pn,z=new pn,tt=new pn,rt=this.vh;a.changes.each(function(ut){ut.model===E&&(ut.modelChange==="linkDataArray"?ut.change===ro?b.add(ut.newValue):ut.change===So&&tt.add(ut.oldValue):E.Jc(ut.object)?z.add(ut.object):ut.object!==null&&(ut.object!==null&&rt&&rt.contains(ut.object)?rt.get(ut.object).each(function(ft){E.Jc(ft)&&z.add(ft)}):ut.object instanceof wi||E.lb(ut.object)||kS(E,ut.object).each(function(ft){z.add(ft)})))});var ot=this.il;ot.clear(),b.each(function(ut){ot.add(E.Ac(ut)),y||z.add(ut)});var lt=this.kl;return lt.clear(),tt.each(function(ut){lt.add(E.Ac(ut)),y&&z.add(ut)}),a=E.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<lt.count&&(x===null&&(x={}),y?x.insertedLinkKeys=lt.Fa():x.removedLinkKeys=lt.Fa()),lt.clear(),ot.clear(),x},wt.rm=function(){var a=wi.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},wt.gp=function(a){wi.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)},wt.Rv=function(){var a=wi.prototype.Rv.call(this),y=`,
|
|
"linkDataArray": `+md(this,this.linkDataArray,!0);return a+y},wt.kv=function(a){wi.prototype.kv.call(this,a),a=a.linkDataArray,Array.isArray(a)&&(this.dm(a),this.linkDataArray=a)};function kS(a,y){for(var x=new pn,E=0;E<a.linkDataArray.length;E++){var b=a.linkDataArray[E];h0(a,y,b,b,x)}return x}wt.Pv=function(a,y){this.linkKeyProperty===""&&Gt("GraphLinksModel.linkKeyProperty must not be an empty string for .toIncrementalJson() to succeed.");var x=wi.prototype.Pv.call(this,a,y),E=this,b=new pn,z=new pn,tt=new pn,rt=this.vh;a.changes.each(function(ut){ut.model===E&&(ut.modelChange==="linkDataArray"?ut.change===ro?b.add(ut.newValue):ut.change===So&&tt.add(ut.oldValue):E.Jc(ut.object)?z.add(ut.object):ut.object!==null&&(ut.object!==null&&rt&&rt.contains(ut.object)?rt.get(ut.object).each(function(ft){E.Jc(ft)&&z.add(ft)}):ut.object instanceof wi||E.lb(ut.object)||kS(E,ut.object).each(function(ft){z.add(ft)})))});var ot=this.il;ot.clear(),b.each(function(ut){ot.add(E.Ac(ut)),y||z.add(ut)});var lt=this.kl;return lt.clear(),tt.each(function(ut){lt.add(E.Ac(ut)),y&&z.add(ut)}),a=x,0<ot.count&&(a+=(y?this.Xv:this.Vv)+md(this,ot.Fa(),!0)),0<z.count&&(a+=this.iy+md(this,z.Fa(),!0)),0<lt.count&&(a+=(y?this.Vv:this.Xv)+md(this,lt.Fa(),!0)),lt.clear(),ot.clear(),a},wt.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)&&Gt("applyIncrementalJson cannot change Model properties"),wi.prototype.fp.call(this,a);var y=a.insertedLinkKeys;if(Array.isArray(y))for(var x=y.length,E=0;E<x;E++){var b=y[E],z=this.jh(b);z===null&&(z=this.Jo({}),this.Ks(z,b),this.fi(z))}if(y=a.modifiedLinkData,Array.isArray(y)){for(x=y.length,E=0;E<x;E++)if(b=y[E],z=this.Ac(b),z=this.jh(z),z!==null){for(var tt in b)tt!=="__gohashid"&&tt!==this.linkKeyProperty&&this.setDataProperty(z,tt,b[tt]);BS(this,b,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)},Vr.prototype.changeState=function(a,y){if(a!==null&&a.model===this){if(a.change===wr){var x=a.object,E=a.propertyName;if(E===this.linkKeyProperty&&this.Jc(x)){var b=a.I(y);y=a.I(!y),y!==void 0&&this.wb.remove(y),b!==void 0&&this.wb.add(b,x),Vo(x,E,b);return}}else if(a.change===ro){if(x=a.newParam,a.modelChange==="linkDataArray"){a=a.newValue,Ie(a)&&typeof x=="number"&&(E=this.Ac(a),y?(this.$f.remove(a),this.md[x]===a&&this.md.splice(x,1),E!==void 0&&this.wb.remove(E)):(this.$f.add(a),this.md[x]!==a&&this.md.splice(x,0,a),E!==void 0&&this.wb.add(E,a)));return}if(a.modelChange==="linkLabelKeys"){E=this.Ef(a.object),Array.isArray(E)&&typeof x=="number"&&(y?(x=E.indexOf(a.newValue),0<=x&&E.splice(x,1)):0>E.indexOf(a.newValue)&&E.splice(x,0,a.newValue));return}}else if(a.change===So){if(x=a.oldParam,a.modelChange==="linkDataArray"){a=a.oldValue,Ie(a)&&typeof x=="number"&&(E=this.Ac(a),y?(this.$f.add(a),this.md[x]!==a&&this.md.splice(x,0,a),E!==void 0&&this.wb.add(E,a)):(this.$f.remove(a),this.md[x]===a&&this.md.splice(x,1),E!==void 0&&this.wb.remove(E)));return}if(a.modelChange==="linkLabelKeys"){E=this.Ef(a.object),Array.isArray(E)&&typeof x=="number"&&(y?0>E.indexOf(a.newValue)&&E.splice(x,0,a.newValue):(x=E.indexOf(a.newValue),0<=x&&E.splice(x,1)));return}}wi.prototype.changeState.call(this,a,y)}},wt=Vr.prototype,wt.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),Vo(x,this.nodeKeyProperty,a),this.xf(x))}return a}},wt.yx=function(a){return vl(this,a,!0)},wt.wv=function(a,y){Yf(this,a,y,!0)},wt.Bx=function(a){return vl(this,a,!1)},wt.Bv=function(a,y){Yf(this,a,y,!1)};function vl(a,y,x){if(y!==null&&(a=x?a.lf:a.mf,a!==""&&(a=sa(y,a),a!==void 0))){if(vd(a))return a;Gt((x?"FromKey":"ToKey")+" value for link data "+y+" is not a number or a string: "+a)}}function Yf(a,y,x,E){if(x===null&&(x=void 0),y!==null){var b=E?a.lf:a.mf;if(b!=="")if(x=a.Vl(x),a.Jc(y)){var z=sa(y,b);z!==x&&(yu(a,z,y),Vo(y,b,x),a.hc(x)===null&&vu(a,x,y),xa(a,E?"linkFromKey":"linkToKey",wr,b,y,z,x),typeof b=="string"&&a.La(y,b))}else Vo(y,b,x)}}wt.zx=function(a){return c0(this,a,!0)},wt.xv=function(a,y){Xf(this,a,y,!0)},wt.Cx=function(a){return c0(this,a,!1)},wt.Cv=function(a,y){Xf(this,a,y,!1)};function c0(a,y,x){return y===null||(a=x?a.ej:a.fj,a==="")?"":(y=sa(y,a),y===void 0?"":y)}function Xf(a,y,x,E){if(y!==null){var b=E?a.ej:a.fj;if(b!=="")if(a.Jc(y)){var z=sa(y,b);z===void 0&&(z=""),z!==x&&(Vo(y,b,x),xa(a,E?"linkFromPortId":"linkToPortId",wr,b,y,z,x),typeof b=="string"&&a.La(y,b))}else Vo(y,b,x)}}wt.Ef=function(a){if(a===null)return f0;var y=this.je;return y===""?f0:(a=sa(a,y),a===void 0?f0:a)},wt.Ls=function(a,y){if(a!==null){var x=this.je;if(x!=="")if(this.Jc(a)){var E=sa(a,x);if(E===void 0&&(E=f0),E!==y){if(Array.isArray(E))for(var b=E.length,z=0;z<b;z++)yu(this,E[z],a);for(Vo(a,x,y),b=y.length,z=0;z<b;z++){var tt=y[z];this.hc(tt)===null&&vu(this,tt,a)}xa(this,"linkLabelKeys",wr,x,a,E,y),typeof x=="string"&&this.La(a,x)}}else Vo(a,x,y)}},wt.Bu=function(a,y){if(y!=null&&a!==null){var x=this.je;if(x!==""){var E=sa(a,x);if(E===void 0)x=[],x.push(y),this.Ls(a,x);else if(Array.isArray(E)){var b=E.indexOf(y);0<=b||(b=E.length,E.push(y),this.Jc(a)&&(this.hc(y)===null&&vu(this,y,a),xa(this,"linkLabelKeys",ro,x,a,null,y,null,b)))}else Gt(x+" property is not an Array; cannot addLabelKeyForLinkData: "+a)}}},wt.Qx=function(a,y){if(y!=null&&a!==null){var x=this.je;if(x!==""){var E=sa(a,x);if(Array.isArray(E)){var b=E.indexOf(y);0>b||(E.splice(b,1),this.Jc(a)&&(yu(this,y,a),xa(this,"linkLabelKeys",So,x,a,y,null,b,null)))}else E!==void 0&&Gt(x+" property is not an Array; cannot removeLabelKeyforLinkData: "+a)}}},wt.Ac=function(a){if(a!==null){var y=this.Jh;if(y!==""&&(y=sa(a,y),y!==void 0)){if(vd(y))return y;Gt("Key value for link data "+a+" is not a number or a string: "+y)}}},wt.Ks=function(a,y){if(a!==null){var x=this.Jh;if(x!=="")if(this.Jc(a)){var E=sa(a,x);E!==y&&this.jh(y)===null&&(Vo(a,x,y),E!==void 0&&this.wb.remove(E),this.wb.add(y,a),xa(this,"linkKey",wr,x,a,E,y),typeof x=="string"&&this.La(a,x))}else Vo(a,x,y)}},wt.jh=function(a){return a===null&&Gt("GraphLinksModel.findLinkDataForKey:key must not be null"),a!==void 0&&vd(a)?this.wb.I(a):null},wt.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 E=this.cl;if(E!==null&&(x=E(this,a),x!=null&&!this.wb.contains(x))){Vo(a,y,x);return}if(typeof x=="string"){for(E=2;this.wb.contains(x+E);)E++;Vo(a,y,x+E)}else if(x===void 0||typeof x=="number"){for(x=-this.wb.count-1;this.wb.contains(x);)x--;Vo(a,y,x)}}}}},wt.Jc=function(a){return a===null?!1:this.$f.contains(a)},wt.fi=function(a){a!==null&&(Kr(a),this.Jc(a)||bS(this,a,!0))};function bS(a,y,x){if(a.linkKeyProperty!==""){var E=a.Ac(y);if(E!==void 0&&a.wb.I(E)===y)return;a.Bs(y),E=a.Ac(y),E===void 0&&Gt("GraphLinksModel.makeLinkDataKeyUnique failed on "+y+". Data not added to model."),a.wb.add(E,y)}a.$f.add(y),E=null,x&&(E=a.md.length,a.md.splice(E,0,y)),xa(a,"linkDataArray",ro,"linkDataArray",a,null,y,null,E),cy(a,y)}wt.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)},wt.bm=function(a){a!==null&&NS(this,a,!0)};function NS(a,y,x){a.$f.remove(y);var E=a.Ac(y);if(E!==void 0&&a.wb.remove(E),E=null,x){if(E=a.md.indexOf(y),0>E)return;a.md.splice(E,1)}if(xa(a,"linkDataArray",So,"linkDataArray",a,y,null,E,null),x=vl(a,y,!0),yu(a,x,y),x=vl(a,y,!1),yu(a,x,y),E=a.Ef(y),Array.isArray(E))for(var b=E.length,z=0;z<b;z++)x=E[z],yu(a,x,y)}wt.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)},wt.Zz=function(a){if(this.linkKeyProperty===""&&Gt("GraphLinksModel.linkKeyProperty must not be an empty string for .mergeLinkDataArray() to succeed."),a!==this.linkDataArray&&$e(a)){var y=this.kl;y.clear(),y.addAll(this.wb.iteratorKeys);var x=this.il;x.clear();for(var E=a.length,b=0;b<E;b++){var z=a[b],tt=this.Ac(z);if(tt!==void 0){x.add(tt);var rt=this.jh(tt);rt!==z&&(rt!==null?(this.Do(rt,z),BS(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();)E=a.value,x.contains(E)||(E=this.jh(E))&&this.bm(E);y.clear(),x.clear()}};function cy(a,y){var x=vl(a,y,!0);x=a.Vl(x),a.hc(x)===null&&vu(a,x,y),x=vl(a,y,!1),x=a.Vl(x),a.hc(x)===null&&vu(a,x,y);var E=a.Ef(y);if(Array.isArray(E))for(var b=E.length,z=0;z<b;z++)x=E[z],a.hc(x)===null&&vu(a,x,y)}wt.Jo=function(a){if(a===null)return null;var y=this.Ak;return a=y!==null?y(a,this):d0(this,a,!0),Ie(a)&&(Hi(a),this.lf!==""&&Vo(a,this.lf,void 0),this.mf!==""&&Vo(a,this.mf,void 0),this.je!==""&&Vo(a,this.je,[])),a},wt.Yu=function(a){if(a===null)return!1;var y=this.jl;return y===""?!1:!!sa(a,y)},wt.lh=function(a){if(a!==null){var y=this.Je;if(y!==""&&(y=sa(a,y),y!==void 0)){if(vd(y))return y;Gt("GroupKey value for node data "+a+" is not a number or a string: "+y)}}},wt.mp=function(a,y){if(y===null&&(y=void 0),a!==null){var x=this.Je;if(x!=="")if(this.lb(a)){var E=sa(a,x);E!==y&&(yu(this,E,a),Vo(a,x,y),this.hc(y)===null&&vu(this,y,a),xa(this,"nodeGroupKey",wr,x,a,E,y),typeof x=="string"&&this.La(a,x))}else Vo(a,x,y)}},Vr.prototype.copyNodeData=function(a){return a===null?null:(a=wi.prototype.copyNodeData.call(this,a),this.Ij||this.Je===""||sa(a,this.Je)===void 0||Vo(a,this.Je,void 0),a)},Vr.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){Yf(this,a,x,!0);return}if(y===this.linkToKeyProperty){Yf(this,a,x,!1);return}if(y===this.linkFromPortIdProperty){Xf(this,a,x,!0);return}if(y===this.linkToPortIdProperty){Xf(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 E=sa(a,y);E!==x&&(Vo(a,y,x),this.Fs(a,y,E,x))},wt=Vr.prototype,wt.Do=function(a,y){if(y){var x=this.lb(a),E=this.Jc(a),b;for(b in y)b==="__gohashid"||x&&b===this.nodeKeyProperty||x&&b===this.nodeIsGroupProperty&&sa(a,b)===y[b]||E&&b===this.linkKeyProperty||this.setDataProperty(a,b,y[b])}},wt.jp=function(a,y){wi.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 E=x.value,b=a,z=y;if(vl(this,E,!0)===b){var tt=this.lf;Vo(E,tt,z),xa(this,"linkFromKey",wr,tt,E,b,z),typeof tt=="string"&&this.La(E,tt)}if(vl(this,E,!1)===b&&(tt=this.mf,Vo(E,tt,z),xa(this,"linkToKey",wr,tt,E,b,z),typeof tt=="string"&&this.La(E,tt)),tt=this.Ef(E),Array.isArray(tt))for(var rt=tt.length,ot=this.je,lt=0;lt<rt;lt++)tt[lt]===b&&(tt[lt]=z,xa(this,"linkLabelKeys",ro,ot,E,b,z,lt,lt))}},wt.qv=function(a,y,x){if(this.lh(a)===y){var E=this.Je;Vo(a,E,x),xa(this,"nodeGroupKey",wr,E,a,y,x),typeof E=="string"&&this.La(a,E)}},wt.Lv=function(){wi.prototype.Lv.call(this);for(var a=this.linkDataArray,y=a.length,x=0;x<y;x++)cy(this,a[x])},wt.fm=function(a){wi.prototype.fm.call(this,a),a=this.wa(a);var y=vp(this,a);if(y!==null){var x=Yn();for(y=y.iterator;y.next();){var E=y.value;if(this.lb(E)){if(this.lh(E)===a){var b=this.Je;xa(this,"nodeGroupKey",wr,b,E,a,a),typeof b=="string"&&this.La(E,b),x.push(E)}}else if(vl(this,E,!0)===a&&(b=this.lf,xa(this,"linkFromKey",wr,b,E,a,a),typeof b=="string"&&this.La(E,b),x.push(E)),vl(this,E,!1)===a&&(b=this.mf,xa(this,"linkToKey",wr,b,E,a,a),typeof b=="string"&&this.La(E,b),x.push(E)),b=this.Ef(E),Array.isArray(b))for(var z=b.length,tt=this.je,rt=0;rt<z;rt++)b[rt]===a&&(xa(this,"linkLabelKeys",ro,tt,E,a,a,rt,rt),x.push(E))}for(y=0;y<x.length;y++)yu(this,a,x[y]);si(x)}},wt.em=function(a){wi.prototype.em.call(this,a);var y=this.lh(a);this.hc(y)===null&&vu(this,y,a)},wt.qp=function(a){wi.prototype.qp.call(this,a);var y=this.lh(a);yu(this,y,a)},wt.ps=function(a){if(a===null)return"";var y=this.dj;if(y===""||(y=sa(a,y),y===void 0))return"";if(typeof y=="string")return y;Gt("getCategoryForLinkData found a non-string category for "+a+": "+y)},Vr.prototype.getLinkCategoryForData=function(a){return this.ps(a)},Vr.prototype.lp=function(a,y){if(a!==null){var x=this.dj;if(x!=="")if(this.Jc(a)){var E=sa(a,x);E===void 0&&(E=""),E!==y&&(Vo(a,x,y),xa(this,"linkCategory",wr,x,a,E,y),typeof x=="string"&&this.La(a,x))}else Vo(a,x,y)}},Vr.prototype.setLinkCategoryForData=function(a,y){this.lp(a,y)},wt=Vr.prototype,wt.lm=function(a,y){wi.prototype.lm.call(this,a,y),this.mp(y,this.lh(a))};function BS(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))}wt.Wj=function(){return!0},wt.ri=function(){return!0},wt.xs=function(){return!0},wt.Xj=function(){return!0},ye.Object.defineProperties(Vr.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,E=0;E<x;E++){var b=a[E];Ie(b)||Gt("GraphLinksModel.linkDataArray must only contain Objects, not: "+b),Kr(b)}if(this.md=a,this.linkKeyProperty!==""){for(E=new fn,b=0;b<x;b++){var z=a[b],tt=this.Ac(z);tt===void 0||this.wb.I(tt)!==null?E.add(z):this.wb.add(tt,z)}for(E=E.iterator;E.next();)b=E.value,this.Bs(b),z=this.Ac(b),z!==void 0&&this.wb.add(z,b)}for(E=new pn,b=0;b<x;b++)E.add(a[b]);for(this.$f=E,xa(this,"linkDataArray",wr,"linkDataArray",this,y,a),y=0;y<x;y++)cy(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,E=0;E<x;E++){var b=this.linkDataArray[E],z=this.Ac(b);z===void 0&&(this.Bs(b),z=this.Ac(b)),z!==void 0&&this.wb.add(z,b)}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"}}}),Vr.prototype.setCategoryForLinkData=Vr.prototype.lp,Vr.prototype.getCategoryForLinkData=Vr.prototype.ps,Vr.prototype.assignAllDataProperties=Vr.prototype.Do,Vr.prototype.setGroupKeyForNodeData=Vr.prototype.mp,Vr.prototype.getGroupKeyForNodeData=Vr.prototype.lh,Vr.prototype.isGroupForNodeData=Vr.prototype.Yu,Vr.prototype.copyLinkData=Vr.prototype.Jo,Vr.prototype.mergeLinkDataArray=Vr.prototype.Zz,Vr.prototype.removeLinkDataCollection=Vr.prototype.lA,Vr.prototype.removeLinkData=Vr.prototype.bm,Vr.prototype.addLinkDataCollection=Vr.prototype.Ey,Vr.prototype.addLinkData=Vr.prototype.fi,Vr.prototype.containsLinkData=Vr.prototype.Jc,Vr.prototype.makeLinkDataKeyUnique=Vr.prototype.Bs,Vr.prototype.findLinkDataForKey=Vr.prototype.jh,Vr.prototype.setKeyForLinkData=Vr.prototype.Ks,Vr.prototype.getKeyForLinkData=Vr.prototype.Ac,Vr.prototype.removeLabelKeyForLinkData=Vr.prototype.Qx,Vr.prototype.addLabelKeyForLinkData=Vr.prototype.Bu,Vr.prototype.setLabelKeysForLinkData=Vr.prototype.Ls,Vr.prototype.getLabelKeysForLinkData=Vr.prototype.Ef,Vr.prototype.setToPortIdForLinkData=Vr.prototype.Cv,Vr.prototype.getToPortIdForLinkData=Vr.prototype.Cx,Vr.prototype.setFromPortIdForLinkData=Vr.prototype.xv,Vr.prototype.getFromPortIdForLinkData=Vr.prototype.zx,Vr.prototype.setToKeyForLinkData=Vr.prototype.Bv,Vr.prototype.getToKeyForLinkData=Vr.prototype.Bx,Vr.prototype.setFromKeyForLinkData=Vr.prototype.wv,Vr.prototype.getFromKeyForLinkData=Vr.prototype.yx,Vr.prototype.clear=Vr.prototype.clear;var f0=Object.freeze([]);Vr.className="GraphLinksModel",ru.GraphLinksModel=Vr,wi.constructGraphLinksModel=wi.constructGraphLinksModel=function(){return new Vr},wi.initDiagramModel=hy=function(){return new Vr};function ks(a,y){wi.call(this),this.Ke="parent",this.Nm=!1,this.nj="parentLinkCategory",a!==void 0&&($e(a)?this.nodeDataArray=a:y=a),y&&(Object.assign(this,y),a=y.Changed)&&(delete this.Changed,this.Pe(a))}Se(ks,wi),ks.constructGraphLinksModel=wi.constructGraphLinksModel,ks.prototype.cloneProtected=function(a){wi.prototype.cloneProtected.call(this,a),a.Ke=this.Ke,a.Nm=this.Nm,a.nj=this.nj},wt=ks.prototype,wt.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,E=0;E<x;E++){var b=a[E];y+=" "+this.wa(b)+":"+Ii(b)}}return y},wt.rm=function(){var a=wi.prototype.rm.call(this),y="";return this.nodeParentKeyProperty!=="parent"&&typeof this.nodeParentKeyProperty=="string"&&(y+=`,
|
|
"nodeParentKeyProperty": `+this.quote(this.nodeParentKeyProperty)),a+y},wt.gp=function(a){wi.prototype.gp.call(this,a),a.nodeParentKeyProperty&&(this.nodeParentKeyProperty=a.nodeParentKeyProperty)},wt.fp=function(a){a.nodeParentKeyProperty!==void 0&&a.nodeParentKeyProperty!==this.nodeParentKeyProperty&&Gt("applyIncrementalJson cannot change Model properties"),wi.prototype.fp.call(this,a)},wt.Vl=function(a){return a},wt.mh=function(a){if(a!==null){var y=this.Ke;if(y!==""&&(y=sa(a,y),y!==void 0)){if(vd(y))return y;Gt("ParentKey value for node data "+a+" is not a number or a string: "+y)}}},wt.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 E=sa(a,x);E!==y&&(yu(this,E,a),Vo(a,x,y),this.hc(y)===null&&vu(this,y,a),xa(this,"nodeParentKey",wr,x,a,E,y),typeof x=="string"&&this.La(a,x))}else Vo(a,x,y)}},wt.ss=function(a){if(a===null)return"";var y=this.nj;return y===""||(y=sa(a,y),y===void 0)?"":typeof y=="string"?y:(Gt("getParentLinkCategoryForNodeData found a non-string category for "+a+": "+y),"")},ks.prototype.getLinkCategoryForData=function(a){return this.ss(a)},ks.prototype.Ms=function(a,y){if(a!==null){var x=this.nj;if(x!=="")if(this.lb(a)){var E=sa(a,x);E===void 0&&(E=""),E!==y&&(Vo(a,x,y),xa(this,"parentLinkCategory",wr,x,a,E,y),typeof x=="string"&&this.La(a,x))}else Vo(a,x,y)}},ks.prototype.setLinkCategoryForData=function(a,y){this.Ms(a,y)},ks.prototype.copyNodeData=function(a){return a===null?null:(a=wi.prototype.copyNodeData.call(this,a),this.Jj||this.Ke===""||sa(a,this.Ke)===void 0||Vo(a,this.Ke,void 0),a)},ks.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 E=sa(a,y);E!==x&&(Vo(a,y,x),this.Fs(a,y,E,x))},wt=ks.prototype,wt.jp=function(a,y){wi.prototype.jp.call(this,a,y);for(var x=this.kb.iterator;x.next();)this.qv(x.value,a,y)},wt.qv=function(a,y,x){if(this.mh(a)===y){var E=this.Ke;Vo(a,E,x),xa(this,"nodeParentKey",wr,E,a,y,x),typeof E=="string"&&this.La(a,E)}},wt.fm=function(a){wi.prototype.fm.call(this,a),a=this.wa(a);var y=vp(this,a);if(y!==null){var x=Yn();for(y=y.iterator;y.next();){var E=y.value;if(this.lb(E)&&this.mh(E)===a){var b=this.Ke;xa(this,"nodeParentKey",wr,b,E,a,a),typeof b=="string"&&this.La(E,b),x.push(E)}}for(y=0;y<x.length;y++)yu(this,a,x[y]);si(x)}},wt.em=function(a){wi.prototype.em.call(this,a);var y=this.mh(a);y=this.Vl(y),this.hc(y)===null&&vu(this,y,a)},wt.qp=function(a){wi.prototype.qp.call(this,a);var y=this.mh(a);yu(this,y,a)},wt.lm=function(a,y){wi.prototype.lm.call(this,a,y),this.Ms(y,this.ss(a)),this.qe(y,this.mh(a))},wt.Tl=function(){return!0},wt.xs=function(){return!0},ye.Object.defineProperties(ks.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"}}}),ks.prototype.setParentLinkCategoryForNodeData=ks.prototype.Ms,ks.prototype.getParentLinkCategoryForNodeData=ks.prototype.ss,ks.prototype.setParentKeyForNodeData=ks.prototype.qe,ks.prototype.getParentKeyForNodeData=ks.prototype.mh,ks.className="TreeModel",ru.TreeModel=ks;function Xo(a){Ko.call(this),this.lw=this.Zm=this.lc=0,this.Wp=360,this.kw=ou,this.Ti=0,this.Zv=new At,this.Jp=this.me=0,this.Xr=new Cp,this.gt=this.mj=0,this.ty=600,this.eo=NaN,this.Cm=1,this.ro=0,this.ul=360,this.Rb=ou,this.K=bs,this.nd=Qf,this.hd=ry,this.tf=6,this.Nn=x0,a&&Object.assign(this,a)}Se(Xo,Ko),Xo.prototype.cloneProtected=function(a){Ko.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},Xo.prototype.qb=function(a){a.classType===Xo?a===y0||a===S0||a===m0||a===v0||a===Qf?this.sorting=a:a===rc||a===Jf||a===bs||a===Sd?this.direction=a:a===zh||a===yd||a===ou||a===au?this.arrangement=a:(a===Hc||a===x0)&&(this.nodeDiameterFormula=a):Ko.prototype.qb.call(this,a)},Xo.prototype.createNetwork=function(){return new $f(this)},Xo.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 fn;y.addAll(a.iterator),a=new fn;var x=new fn,E=this.sort(y),b,z,tt=this.Jp,rt=this.arrangement,ot=this.nodeDiameterFormula,lt=this.radius;(!isFinite(lt)||0>=lt)&&(lt=NaN);var ut=this.aspectRatio;(!isFinite(ut)||0>=ut)&&(ut=1);var ft=this.startAngle;isFinite(ft)||(ft=0);var yt=this.sweepAngle;if((!isFinite(yt)||360<yt||1>yt)&&(yt=360),y=this.spacing,isFinite(y)||(y=NaN),rt===au&&ot===Hc?rt=ou:rt===au&&ot!==Hc&&(rt=this.arrangement),(this.direction===rc||this.direction===Jf)&&this.sorting!==Qf){for(ot=0;!(ot>=E.length)&&(a.add(E.M(ot)),!(ot+1>=E.length));ot+=2)x.add(E.M(ot+1));this.direction===rc?(this.arrangement===au&&a.reverse(),E=new fn,E.addAll(a),E.addAll(x)):(this.arrangement===au&&x.reverse(),E=new fn,E.addAll(x),E.addAll(a))}ot=E.length;for(var xt=z=b=0;xt<E.length;xt++){var Ct=ft+yt*z*(this.direction===bs?1:-1)/ot,bt=E.M(xt).diameter;isNaN(bt)&&(bt=xd(E.M(xt),Ct)),360>yt&&(xt===0||xt===E.length-1)&&(bt/=2),b+=bt,z++}if(isNaN(lt)||rt===au){if(isNaN(y)&&(y=6),rt!==ou&&rt!==au){for(z=-1/0,tt=0;tt<ot;tt++)xt=E.M(tt),b=E.M(tt===ot-1?0:tt+1),isNaN(xt.diameter)&&xd(xt,0),isNaN(b.diameter)&&xd(b,0),z=Math.max(z,(xt.diameter+b.diameter)/2);tt=z+y,rt===zh?lt=(z+y)/(2*Math.PI/ot):lt=g0(this,tt*(360<=yt?ot:ot-1),ut,ft*Math.PI/180,yt*Math.PI/180)}else lt=g0(this,b+(360<=yt?ot:ot-1)*(rt!==au?y:1.6*y),ut,ft*Math.PI/180,yt*Math.PI/180);z=lt*ut}else if(z=lt*ut,xt=fy(this,lt,z,ft*Math.PI/180,yt*Math.PI/180),isNaN(y))(rt===ou||rt===au)&&(y=(xt-b)/(360<=yt?ot:ot-1));else if(rt===ou||rt===au)xt=(xt-b)/(360<=yt?ot:ot-1),xt<y?(lt=g0(this,b+y*(360<=yt?ot:ot-1),ut,ft*Math.PI/180,yt*Math.PI/180),z=lt*ut):y=xt;else{for(tt=-1/0,b=0;b<ot;b++)Ct=E.M(b),bt=E.M(b===ot-1?0:b+1),isNaN(Ct.diameter)&&xd(Ct,0),isNaN(bt.diameter)&&xd(bt,0),tt=Math.max(tt,(Ct.diameter+bt.diameter)/2);tt+=y,b=g0(this,tt*(360<=yt?ot:ot-1),ut,ft*Math.PI/180,yt*Math.PI/180),b>lt?(lt=b,z=lt*ut):tt=xt/(360<=yt?ot:ot-1)}if(this.kw=rt,this.lc=lt,this.Zm=ut,this.lw=ft,this.Wp=yt,this.Ti=y,this.me=z,this.Jp=tt,y=E,E=this.kw,rt=this.lc,lt=this.lw,ut=this.Wp,ft=this.Ti,yt=this.me,ot=this.Jp,this.direction!==rc&&this.direction!==Jf||E!==au)if(this.direction===rc||this.direction===Jf){switch(tt=0,E){case yd:tt=180*p0(this,rt,yt,lt,ot)/Math.PI;break;case ou:ot=y=0,tt=a.first(),tt!==null&&(y=xd(tt,Math.PI/2)),tt=x.first(),tt!==null&&(ot=xd(tt,Math.PI/2)),tt=180*p0(this,rt,yt,lt,ft+(y+ot)/2)/Math.PI;break;case zh:tt=ut/y.length}if(this.direction===rc){switch(E){case yd:wp(this,a,lt,Sd);break;case ou:Pp(this,a,lt,Sd);break;case zh:xp(this,a,ut/2,lt,Sd)}switch(E){case yd:wp(this,x,lt+tt,bs);break;case ou:Pp(this,x,lt+tt,bs);break;case zh:xp(this,x,ut/2,lt+tt,bs)}}else{switch(E){case yd:wp(this,x,lt,Sd);break;case ou:Pp(this,x,lt,Sd);break;case zh:xp(this,x,ut/2,lt,Sd)}switch(E){case yd:wp(this,a,lt+tt,bs);break;case ou:Pp(this,a,lt+tt,bs);break;case zh:xp(this,a,ut/2,lt+tt,bs)}}}else switch(E){case yd:wp(this,y,lt,this.direction);break;case ou:Pp(this,y,lt,this.direction);break;case zh:xp(this,y,ut,lt,this.direction);break;case au:AS(this,y,ut,lt,this.direction)}else AS(this,y,ut,lt-ut/2,bs)}this.updateParts(),this.network=null,this.isValidLayout=!0};function xp(a,y,x,E,b){var z=a.Wp,tt=a.lc;a=a.me,E=E*Math.PI/180,x=x*Math.PI/180;for(var rt=y.length,ot=0;ot<rt;ot++){var lt=E+(b===bs?ot*x/(360<=z?rt:rt-1):-(ot*x)/rt),ut=y.M(ot),ft=tt*Math.tan(lt)/a;ft=Math.sqrt((tt*tt+a*a*ft*ft)/(1+ft*ft)),ut.centerX=ft*Math.cos(lt),ut.centerY=ft*Math.sin(lt),ut.actualAngle=180*lt/Math.PI}}function Pp(a,y,x,E){var b=a.lc,z=a.me,tt=a.Ti;x=x*Math.PI/180;for(var rt=y.length,ot=0;ot<rt;ot++){var lt=y.M(ot),ut=y.M(ot===rt-1?0:ot+1),ft=z*Math.sin(x);lt.centerX=b*Math.cos(x),lt.centerY=ft,lt.actualAngle=180*x/Math.PI,isNaN(lt.diameter)&&xd(lt,0),isNaN(ut.diameter)&&xd(ut,0),lt=p0(a,b,z,E===bs?x:-x,(lt.diameter+ut.diameter)/2+tt),x+=E===bs?lt:-lt}}function wp(a,y,x,E){var b=a.lc,z=a.me,tt=a.Jp;x=x*Math.PI/180;for(var rt=y.length,ot=0;ot<rt;ot++){var lt=y.M(ot);lt.centerX=b*Math.cos(x),lt.centerY=z*Math.sin(x),lt.actualAngle=180*x/Math.PI,lt=p0(a,b,z,E===bs?x:-x,tt),x+=E===bs?lt:-lt}}function AS(a,y,x,E,b){var z=a.Wp;if(a.mj=0,a.Xr=new Cp,360>x){for(z=E+(b===bs?z:-z);0>z;)z+=360;z%=360,180<z&&(z-=360),z*=Math.PI/180,a.gt=z,DS(a,y,x,E,b)}else TS(a,y,x,E,b);a.Xr.commit(y)}function TS(a,y,x,E,b){var z=a.lc,tt=a.Ti,rt=a.Zm,ot=z*Math.cos(E*Math.PI/180),lt=a.me*Math.sin(E*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=At.alloc();for(var ft=0;ft<ut.length&&(ut[ft].centerX=ot,ut[ft].centerY=lt,!(ft>=ut.length-1));ft++)OS(a,ot,lt,ut,ft,b,z)||IS(a,ot,lt,ut,ft,b,z),ot=z.x,lt=z.y;if(At.free(z),a.mj++,!(23<a.mj)){ot=ut[0].centerX,lt=ut[0].centerY,z=ut[ut.length-1].centerX,ft=ut[ut.length-1].centerY;var yt=Math.abs(ot-z)-((ut[0].width+ut[ut.length-1].width)/2+tt),xt=Math.abs(lt-ft)-((ut[0].height+ut[ut.length-1].height)/2+tt);tt=0,1>Math.abs(xt)?Math.abs(ot-z)<(ut[0].width+ut[ut.length-1].width)/2&&(tt=0):tt=0<xt?xt:1>Math.abs(yt)?0:yt,ot=Math.abs(z)>Math.abs(ft)?0<z!=lt>ft:0<ft!=ot<z,(ot=b===bs?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,TS(a,y,x,E,b))}}}function DS(a,y,x,E,b){for(var z=a.lc,tt=a.me,rt=a.Zm,ot=z*Math.cos(E*Math.PI/180),lt=tt*Math.sin(E*Math.PI/180),ut=At.alloc(),ft=y.Fa(),yt=0;yt<ft.length&&(ft[yt].centerX=ot,ft[yt].centerY=lt,!(yt>=ft.length-1));yt++)OS(a,ot,lt,ft,yt,b,ut)||IS(a,ot,lt,ft,yt,b,ut),ot=ut.x,lt=ut.y;if(At.free(ut),a.mj++,!(23<a.mj)){if(ot=Math.atan2(lt,ot),ot=b===bs?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<ft.length;ot++)tt.mk[ot]=ft[ot].bounds.x,tt.tm[ot]=ft[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,DS(a,y,x,E,b))}}function OS(a,y,x,E,b,z,tt){var rt=a.lc,ot=a.me,lt=0;a=(E[b].width+E[b+1].width)/2+a.Ti;var ut=!1;if(0<=x!=(z===bs)){if(z=y+a,z>rt){if(z=y-a,z<-rt)return tt.x=z,tt.y=lt,!1;ut=!0}}else if(z=y-a,z<-rt){if(z=y+a,z>rt)return tt.x=z,tt.y=lt,!1;ut=!0}return lt=Math.sqrt(1-Math.min(1,z*z/(rt*rt)))*ot,0>x!==ut&&(lt=-lt),Math.abs(x-lt)>(E[b].height+E[b+1].height)/2?(tt.x=z,tt.y=lt,!1):(tt.x=z,tt.y=lt,!0)}function IS(a,y,x,E,b,z,tt){var rt=a.lc,ot=a.me,lt=0;if(a=(E[b].height+E[b+1].height)/2+a.Ti,E=!1,0<=y!=(z===bs)){if(z=x-a,z<-ot){if(z=x+a,z>ot){tt.x=lt,tt.y=z;return}E=!0}}else if(z=x+a,z>ot){if(z=x-a,z<-ot){tt.x=lt,tt.y=z;return}E=!0}lt=Math.sqrt(1-Math.min(1,z*z/(ot*ot)))*rt,0>y!==E&&(lt=-lt),tt.x=lt,tt.y=z}Xo.prototype.commitLayout=function(){this.commitNodes(),this.isRouting&&this.commitLinks()},Xo.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 At(0,0):(x.x=this.arrangementOrigin.x+this.lc,x.y=this.arrangementOrigin.y+this.me);for(var E=this.network.vertexes.iterator;E.next();){var b=E.value;b.x+=x.x,b.y+=x.y,b.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))},Xo.prototype.commitLinks=function(){for(var a=this.network.edges.iterator;a.next();)a.value.commit()};function fy(a,y,x,E,b){var z=a.ty;if(.001>Math.abs(a.Zm-1))return E!==void 0&&b!==void 0?b*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=E!==void 0&&b!==void 0?b/(z+1):Math.PI/(2*(z+1)),ot=0,lt=0;lt<=z;lt++){E!==void 0&&b!==void 0?ot=E+lt*b/z:ot=lt*Math.PI/(2*z);var ut=Math.sin(ot);tt+=Math.sqrt(1-a*a*ut*ut)*rt}return E!==void 0&&b!==void 0?(y>x?y:x)*tt:4*(y>x?y:x)*tt}function g0(a,y,x,E,b){return y/(E!==void 0&&b!==void 0?fy(a,1,x,E,b):fy(a,1,x))}function p0(a,y,x,E,b){if(.001>Math.abs(a.Zm-1))return b/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&&(E+=Math.PI/2);for(var rt=0;;rt++){var ot=Math.sin(E+rt*a);if(tt+=(y>x?y:x)*Math.sqrt(1-z*z*ot*ot)*a,tt>=b)return rt*a}}Xo.prototype.sort=function(a){switch(this.sorting){case m0:break;case v0:a.reverse();break;case y0:a.sort(this.comparer);break;case S0:a.sort(this.comparer),a.reverse();break;case Qf:return this.ak(Tx(a));default:Gt("Invalid sorting type.")}return a};function Tx(a){for(var y=[],x=0;x<a.length;x++)y.push(0);x=new fn;for(var E=0;E<a.length;E++){var b=-1,z=-1;if(E===0)for(var tt=0;tt<a.length;tt++){var rt=a.M(tt).edgesCount;rt>b&&(b=rt,z=tt)}else for(tt=0;tt<a.length;tt++)rt=y[tt],rt>b&&(b=rt,z=tt);for(x.add(a.M(z)),y[z]=-1,z=a.M(z),tt=z.sourceEdges;tt.next();)b=a.indexOf(tt.value.fromVertex),0>b||0<=y[b]&&y[b]++;for(z=z.destinationEdges;z.next();)b=a.indexOf(z.value.toVertex),0>b||0<=y[b]&&y[b]++}return x}Xo.prototype.ak=function(a){for(var y=[],x=0;x<a.length;x++){var E=a.M(x);y[x]=[];for(var b,z=E.destinationEdges;z.next();)b=a.indexOf(z.value.toVertex),b!==x&&0>y[x].indexOf(b)&&y[x].push(b);for(E=E.sourceEdges;E.next();)b=a.indexOf(E.value.fromVertex),b!==x&&0>y[x].indexOf(b)&&y[x].push(b)}for(z=[],x=0;x<y.length;x++)z[x]=0;x=[];var tt=[],rt=[];E=[],b=new fn;for(var ot=0,lt=0;lt<y.length;lt++){var ut=y[lt].length;if(ut===1)E.push(lt);else if(ut===0)b.add(a.M(lt));else{if(ot===0)x.push(lt);else{for(var ft=ut=1/0,yt=-1,xt=[],Ct=0;Ct<x.length;Ct++)0>y[x[Ct]].indexOf(x[Ct===x.length-1?0:Ct+1])&&xt.push(Ct===x.length-1?0:Ct+1);if(xt.length===0)for(Ct=0;Ct<x.length;Ct++)xt.push(Ct);for(Ct=0;Ct<xt.length;Ct++){for(var bt=xt[Ct],Vt=y[lt],zt=0,Qt=0;Qt<tt.length;Qt++){var ee=z[tt[Qt]],oe=z[rt[Qt]];if(ee<oe){var ce=ee;ee=oe}else ce=oe;if(ce<bt&&bt<=ee)for(oe=0;oe<Vt.length;oe++){var Me=Vt[oe];0>x.indexOf(Me)||ce<z[Me]&&z[Me]<ee||ce===z[Me]||ee===z[Me]||zt++}else for(oe=0;oe<Vt.length;oe++)Me=Vt[oe],0>x.indexOf(Me)||ce<z[Me]&&z[Me]<ee&&ce!==z[Me]&&ee!==z[Me]&&zt++}for(Vt=zt,Qt=zt=0;Qt<y[lt].length;Qt++)ce=x.indexOf(y[lt][Qt]),0<=ce&&(ce=Math.abs(bt-(ce>=bt?ce+1:ce)),zt+=ce<x.length+1-ce?ce:x.length+1-ce);for(Qt=0;Qt<tt.length;Qt++)ce=z[tt[Qt]],ee=z[rt[Qt]],ce>=bt&&ce++,ee>=bt&&ee++,ce>ee&&(oe=ee,ee=ce,ce=oe),ee-ce<(x.length+2)/2==(ce<bt&&bt<=ee)&&zt++;(Vt<ut||Vt===ut&&zt<ft)&&(ut=Vt,ft=zt,yt=bt)}for(x.splice(yt,0,lt),ut=0;ut<x.length;ut++)z[x[ut]]=ut;for(ut=0;ut<y[lt].length;ut++)ft=y[lt][ut],0<=x.indexOf(ft)&&(tt.push(lt),rt.push(ft))}ot++}}for(tt=x.length;;){for(z=!0,rt=0;rt<E.length;rt++)if(ot=E[rt],lt=y[ot][0],ut=x.indexOf(lt),0<=ut){for(yt=ft=0;yt<y[lt].length;yt++)xt=x.indexOf(y[lt][yt]),0>xt||xt===ut||(Ct=xt>ut?xt-ut:ut-xt,ft+=xt<ut!=Ct>tt-Ct?1:-1);x.splice(0>ft?ut:ut+1,0,ot),E.splice(rt,1),rt--}else z=!1;if(z)break;x.push(E[0]),E.splice(0,1)}for(y=0;y<x.length;y++)b.add(a.M(x[y]));return b},ye.Object.defineProperties(Xo.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!==au&&a!==ou&&a!==yd&&a!==zh||(this.Rb=a,this.C())}},direction:{get:function(){return this.K},set:function(a){this.K===a||a!==bs&&a!==Sd&&a!==rc&&a!==Jf||(this.K=a,this.C())}},sorting:{get:function(){return this.nd},set:function(a){this.nd===a||a!==m0&&a!==v0&&a!==y0&&!S0&&a!==Qf||(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!==x0&&a!==Hc||(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 ou=new rn(Xo,"ConstantSpacing",0),yd=new rn(Xo,"ConstantDistance",1),zh=new rn(Xo,"ConstantAngle",2),au=new rn(Xo,"Packed",3),bs=new rn(Xo,"Clockwise",4),Sd=new rn(Xo,"Counterclockwise",5),rc=new rn(Xo,"BidirectionalLeft",6),Jf=new rn(Xo,"BidirectionalRight",7),m0=new rn(Xo,"Forwards",8),v0=new rn(Xo,"Reverse",9),y0=new rn(Xo,"Ascending",10),S0=new rn(Xo,"Descending",11),Qf=new rn(Xo,"Optimized",12),x0=new rn(Xo,"Pythagorean",13),Hc=new rn(Xo,"Circular",14);Xo.className="CircularLayout",Xo.ConstantSpacing=ou,Xo.ConstantDistance=yd,Xo.ConstantAngle=zh,Xo.Packed=au,Xo.Clockwise=bs,Xo.Counterclockwise=Sd,Xo.BidirectionalLeft=rc,Xo.BidirectionalRight=Jf,Xo.Forwards=m0,Xo.Reverse=v0,Xo.Ascending=y0,Xo.Descending=S0,Xo.Optimized=Qf,Xo.Pythagorean=x0,Xo.Circular=Hc;function Cp(){this.Pl=-1/0,this.tm=this.mk=null}Cp.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},Cp.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]}},Cp.className="VertexArrangement";function $f(a){To.call(this,a)}Se($f,To),$f.prototype.createVertex=function(){return new Ep(this)},$f.prototype.createEdge=function(){return new P0(this)},$f.className="CircularNetwork";function Ep(a){La.call(this,a),this.u=this.Si=NaN}Se(Ep,La);function xd(a,y){var x=a.network;if(x===null)return NaN;if(x=x.layout,x===null)return NaN;if(x.arrangement===au)if(x.nodeDiameterFormula===Hc)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===Hc?Math.max(a.width,a.height):Math.sqrt(a.width*a.width+a.height*a.height);return a.Si}ye.Object.defineProperties(Ep.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)}}}),Ep.className="CircularVertex";function P0(a){nl.call(this,a)}Se(P0,nl),P0.className="CircularEdge";function ns(a){Ko.call(this),this.ah=null,this.An=0,this.$d=new on(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)}Se(ns,Ko),ns.prototype.cloneProtected=function(a){Ko.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},ns.prototype.createNetwork=function(){return new Wc(this)},ns.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 E=x.iterator;E.next();){this.network=E.value;for(var b=this.network.vertexes.iterator;b.next();){var z=b.value;z.Vd=z.vertexes.count,z.sh=1,z.Hj=null,z.We=null}_S(this,0,a)}this.network=y;var tt=E=x.iterator;E=this.arrangementSpacing;var rt=tt.count,ot=!0;z=b=0;for(var lt=Yn(),ut=0;ut<rt+y.vertexes.count+2;ut++)lt[ut]=null;rt=0,tt.reset();for(var ft=Be.alloc();tt.next();)if(ut=tt.value,this.computeBounds(ut,ft),ot)ot=!1,b=ft.x+ft.width/2,z=ft.y+ft.height/2,lt[0]=new At(ft.x+ft.width+E.width,ft.y),lt[1]=new At(ft.x,ft.y+ft.height+E.height),rt=2;else{var yt=RS(lt,rt,b,z,ft.width,ft.height,E),xt=lt[yt],Ct=new At(xt.x+ft.width+E.width,xt.y),bt=new At(xt.x,xt.y+ft.height+E.height);for(yt+1<rt&<.splice(yt+1,0,null),lt[yt]=Ct,lt[yt+1]=bt,rt++,yt=xt.x-ft.x,xt=xt.y-ft.y,ut=ut.vertexes.iterator;ut.next();)Ct=ut.value,Ct.centerX+=yt,Ct.centerY+=xt}for(Be.free(ft),ut=y.vertexes.iterator;ut.next();)tt=ut.value,yt=tt.bounds,2>rt?(b=yt.x+yt.width/2,z=yt.y+yt.height/2,lt[0]=new At(yt.x+yt.width+E.width,yt.y),lt[1]=new At(yt.x,yt.y+yt.height+E.height),rt=2):(ot=RS(lt,rt,b,z,yt.width,yt.height,E),ft=lt[ot],xt=new At(ft.x+yt.width+E.width,ft.y),yt=new At(ft.x,ft.y+yt.height+E.height),ot+1<rt&<.splice(ot+1,0,null),lt[ot]=xt,lt[ot+1]=yt,rt++,tt.centerX=ft.x+tt.width/2,tt.centerY=ft.y+tt.height/2);for(si(lt),E=x.iterator;E.next();){for(x=E.value,b=x.vertexes.iterator;b.next();)y.dh(b.value);for(x=x.edges.iterator;x.next();)y.Bo(x.value)}}zS(this,a),this.updateParts()}this.dl=a,this.network=null,this.isValidLayout=!0},ns.prototype.needsClusterLayout=function(){if(3>this.network.vertexes.count)return!1;for(var a=0,y=0,x=this.network.vertexes.first().bounds,E=this.network.vertexes.iterator;E.next();){if(E.value.bounds.Yc(x)&&(a++,2<a))return!0;if(10<y)break;y++}return!1},ns.prototype.computeBounds=function(a,y){var x=!0;for(a=a.vertexes.iterator;a.next();){var E=a.value;x?(x=!1,y.set(E.bounds)):y.ed(E.bounds)}return y};function _S(a,y,x){if(Dx(a,y)){var E=a.Zf;a.Zf*=1+1/(y+1);var b=Ox(a,y),z=Math.max(0,Math.max(Math.min(a.network.vertexes.count,x*(y+1)/11),10));for(a.maxIterations+=z,_S(a,y+1,x),zS(a,z),Ix(a,b),y=b.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++)_x(a,y[x]);a.Zf=E}}function Dx(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,E){return x===null||E===null||x===E?0:E.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,E=new Wc(a),b=0;b<a.ah.length;b++){var z=a.ah[b];if(1<z.Vd){E.dh(z);var tt=new ZS;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 fn),z.We.add(tt),z.sv=z.We.count-1}else break}for(z=x.edges.iterator;z.next();){var rt=z.value;b=rt.fromVertex,tt=rt.toVertex,b.network===E&&tt.network===E?E.Bo(rt):b.network===E?(rt=b.Hj,rt===null&&(rt=new fn,b.Hj=rt),rt.add(tt),b.Vd--,b.sh+=tt.sh):tt.network===E&&(rt=tt.Hj,rt===null&&(rt=new fn,tt.Hj=rt),rt.add(b),tt.Vd--,tt.sh+=b.sh)}for(b=E.edges.iterator;b.next();)z=b.value,z.length*=Math.max(1,_t.sqrt((z.fromVertex.sh+z.toVertex.sh)/(4*y+1)));for(y=E.vertexes.iterator;y.next();){b=y.value;var ot=b.Hj;if(ot!==null&&0<ot.count&&(tt=b.We.M(b.We.count-1).Rs-b.Vd,!(0>=tt))){for(var lt=rt=0,ut=ot.count-tt;ut<ot.count;ut++){var ft=ot.M(ut),yt=null;for(z=ft.edges.iterator;z.next();){var xt=z.value;if(xt.Ax(ft)===b){yt=xt;break}}yt!==null&&(lt+=yt.length,rt+=ft.width*ft.height)}z=b.centerX,ot=b.centerY,ut=b.width,ft=b.height,yt=b.focus,xt=ut*ft,1>xt&&(xt=1),rt=_t.sqrt((rt+xt+lt*lt*4/(tt*tt))/xt),tt=(rt-1)*ut/2,rt=(rt-1)*ft/2,b.bounds=new Be(z-yt.x-tt,ot-yt.y-rt,ut+2*tt,ft+2*rt),b.focus=new At(yt.x+tt,yt.y+rt)}}return a.network=E,x}function Ix(a,y){for(var x=a.network.vertexes.iterator;x.next();){var E=x.value;if(E.network=y,E.We!==null){var b=E.We.M(E.sv);E.Vd=b.Rs;var z=b.Sv,tt=b.Tv;E.bounds=new Be(E.centerX-z,E.centerY-tt,b.Ss,b.Qs),E.focus=new At(z,tt),E.sv--}}for(x=a.network.edges.iterator;x.next();)x.value.network=y;a.network=y}function _x(a,y){var x=y.Hj;if(x!==null&&x.count!==0){var E=y.centerX,b=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=_t.sqrt(z*z+tt*tt)/2;for(var rt=!1,ot=tt=0,lt=0,ut=y.vertexes.iterator;ut.next();){var ft=ut.value;1>=ft.Vd?ot++:(rt=!0,lt++,tt+=Math.atan2(y.centerY-ft.centerY,y.centerX-ft.centerX))}if(ot!==0){for(0<lt&&(tt/=lt),lt=y=0,y=rt?2*Math.PI/(ot+1):2*Math.PI/ot,ot%2===0&&(lt=y/2),1<x.count&&x.sort(function(xt,Ct){return xt===null||Ct===null||xt===Ct?0:Ct.width*Ct.height-xt.width*xt.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,ft=ot.edges.iterator;ft.next();){ut=ft.value;break}ft=ot.width;var yt=ot.height;ft=_t.sqrt(ft*ft+yt*yt)/2,ut=z+ut.length+ft,ft=tt+(y*(rt/2>>1)+lt)*(rt%2===0?1:-1),ot.centerX=E+ut*Math.cos(ft),ot.centerY=b+ut*Math.sin(ft),rt++}}}}function RS(a,y,x,E,b,z,tt){var rt=9e19,ot=-1,lt=0;t:for(;lt<y;lt++){var ut=a[lt],ft=ut.x-x,yt=ut.y-E;if(ft=ft*ft+yt*yt,ft<rt){for(yt=lt-1;0<=yt;yt--)if(a[yt].y>ut.y&&a[yt].x-ut.x<b+tt.width)continue t;for(yt=lt+1;yt<y;yt++)if(a[yt].x>ut.x&&a[yt].y-ut.y<z+tt.height)continue t;ot=lt,rt=ft}}return ot}ns.prototype.Cu=function(){if(this.comments)for(var a=this.network.vertexes.iterator;a.next();)this.addComments(a.value)},ns.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 E=this.network.ki(x);E===null&&(E=this.network.Bl(x)),E.charge=this.defaultCommentElectricalCharge,x=null;for(var b=E.destinationEdges;b.next();){var z=b.value;if(z.toVertex===a){x=z;break}}if(x===null){for(b=E.sourceEdges;b.next();)if(z=b.value,z.fromVertex===a){x=z;break}}x===null&&(x=this.network.Zj(a,E,null)),x.length=this.defaultCommentSpringLength}}};function jS(a,y){var x=a.bounds,E=x.x;a=x.y;var b=x.width;x=x.height;var z=y.bounds,tt=z.x;y=z.y;var rt=z.width;return z=z.height,E+b<tt?a>y+z?(x=E+b-tt,a=a-y-z,_t.sqrt(x*x+a*a)):a+x<y?(E=E+b-tt,a=a+x-y,_t.sqrt(E*E+a*a)):tt-(E+b):E>tt+rt?a>y+z?(x=E-tt-rt,a=a-y-z,_t.sqrt(x*x+a*a)):a+x<y?(E=E-tt-rt,a=a+x-y,_t.sqrt(E*E+a*a)):E-(tt+rt):a>y+z?a-(y+z):a+x<y?y-(a+x):.1}function zS(a,y){for(a.ah=null,y=a.An+y;a.An<y&&(a.An++,Rx(a)););a.ah=null}function Rx(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 E=x.centerX,b=E,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,E=Math.min(E,ot),b=Math.max(b,ot),x=Math.min(x,rt),z=Math.max(z,rt)}(b=b-E>z-x)?y.sort(function(bt,Vt){return bt===null||Vt===null||bt===Vt?0:bt.centerX-Vt.centerX}):y.sort(function(bt,Vt){return bt===null||Vt===null||bt===Vt?0:bt.centerY-Vt.centerY}),x=a.Zf;var lt=E=rt=0;for(z=0;z<y.length;z++){tt=y[z],E=tt.bounds,rt=tt.focus,ot=E.x+rt.x;var ut=E.y+rt.y;E=tt.charge*a.electricalFieldX(ot,ut),lt=tt.charge*a.electricalFieldY(ot,ut),E+=tt.mass*a.gravitationalFieldX(ot,ut),lt+=tt.mass*a.gravitationalFieldY(ot,ut),tt.forceX+=E,tt.forceY+=lt;for(var ft=z+1;ft<y.length;ft++){var yt=y[ft];if(yt!==tt){E=yt.bounds,rt=yt.focus,lt=E.x+rt.x;var xt=E.y+rt.y;if(ot-lt>x||lt-ot>x){if(b)break}else if(ut-xt>x||xt-ut>x){if(!b)break}else{var Ct=jS(tt,yt);1>Ct?(E=a.randomNumberGenerator,E===null&&(a.randomNumberGenerator=E=new w0),Ct=E.random(),rt=E.random(),ot>lt?(E=Math.abs(yt.bounds.right-tt.bounds.x),E=(1+E)*Ct):ot<lt?(E=Math.abs(yt.bounds.x-tt.bounds.right),E=-(1+E)*Ct):(E=Math.max(yt.width,tt.width),E=(1+E)*Ct-E/2),ut>xt?(lt=Math.abs(yt.bounds.bottom-tt.bounds.y),lt=(1+lt)*rt):ot<lt?(lt=Math.abs(yt.bounds.y-tt.bounds.bottom),lt=-(1+lt)*rt):(lt=Math.max(yt.height,tt.height),lt=(1+lt)*rt-lt/2)):(rt=-(tt.charge*yt.charge)/(Ct*Ct),E=(lt-ot)/Ct*rt,lt=(xt-ut)/Ct*rt),tt.forceX+=E,tt.forceY+=lt,yt.forceX-=E,yt.forceY-=lt}}}}for(b=a.network.edges.iterator;b.next();)rt=b.value,x=rt.fromVertex,z=rt.toVertex,tt=x.bounds,ot=x.focus,E=tt.x+ot.x,tt=tt.y+ot.y,ut=z.bounds,ft=z.focus,ot=ut.x+ft.x,ut=ut.y+ft.y,ft=jS(x,z),1>ft?(ft=a.randomNumberGenerator,ft===null&&(a.randomNumberGenerator=ft=new w0),rt=ft.random(),ft=ft.random(),E=(E>ot?1:-1)*(1+(z.width>x.width?z.width:x.width))*rt,lt=(tt>ut?1:-1)*(1+(z.height>x.height?z.height:x.height))*ft):(rt=rt.stiffness*(ft-rt.length),E=(ot-E)/ft*rt,lt=(ut-tt)/ft*rt),x.forceX+=E,x.forceY+=lt,z.forceX-=E,z.forceY-=lt;for(b=E=0;b<y.length;b++)x=y[b],a.isFixed(x)?a.moveFixedVertex(x):E=Math.max(E,a.moveVertex(x)||0);return E>a.epsilonDistance*a.epsilonDistance}ns.prototype.moveVertex=function(a){var y=a.forceX,x=a.forceY,E=this.moveLimit;return y<-E?y=-E:y>E&&(y=E),x<-E?x=-E:x>E&&(x=E),a.centerX+=y,a.centerY+=x,y*y+x*x},ns.prototype.moveFixedVertex=function(){},ns.prototype.commitLayout=function(){this.yv(),this.commitNodes(),this.isRouting&&this.commitLinks()},ns.prototype.yv=function(){if(this.setsPortSpots)for(var a=this.network.edges.iterator;a.next();){var y=a.value.link;y!==null&&(y.fromSpot=wa,y.toSpot=wa)}},ns.prototype.commitNodes=function(){var a=0,y=0;if(this.arrangesToOrigin){var x=Be.alloc();this.computeBounds(this.network,x),y=this.arrangementOrigin,a=y.x-x.x,y=y.y-x.y,Be.free(x)}x=Be.alloc();for(var E=this.network.vertexes.iterator;E.next();){var b=E.value;(a!==0||y!==0)&&(x.assign(b.bounds),x.x+=a,x.y+=y,b.bounds=x),b.commit()}Be.free(x)},ns.prototype.commitLinks=function(){for(var a=this.network.edges.iterator;a.next();)a.value.commit()},ns.prototype.springStiffness=function(a){return a=a.stiffness,isNaN(a)?this.Hk:a},ns.prototype.springLength=function(a){return a=a.length,isNaN(a)?this.Gk:a},ns.prototype.electricalCharge=function(a){return a=a.charge,isNaN(a)?this.Ek:a},ns.prototype.electricalFieldX=function(){return 0},ns.prototype.electricalFieldY=function(){return 0},ns.prototype.gravitationalMass=function(a){return a=a.mass,isNaN(a)?this.Fk:a},ns.prototype.gravitationalFieldX=function(){return 0},ns.prototype.gravitationalFieldY=function(){return 0},ns.prototype.isFixed=function(a){return a.isFixed},ye.Object.defineProperties(ns.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"&&Gt('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())}}}),ns.className="ForceDirectedLayout";function ZS(){this.Tv=this.Sv=this.Qs=this.Ss=this.Rs=0}ZS.className="ForceDirectedSubnet";function Wc(a){To.call(this,a)}Se(Wc,To),Wc.prototype.createVertex=function(){return new Lp(this)},Wc.prototype.createEdge=function(){return new Fp(this)},Wc.className="ForceDirectedNetwork";function Lp(a){La.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}Se(Lp,La),ye.Object.defineProperties(Lp.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)}}}),Lp.className="ForceDirectedVertex";function Fp(a){nl.call(this,a),this.j=this.o=NaN}Se(Fp,nl),ye.Object.defineProperties(Fp.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)}}}),Fp.className="ForceDirectedEdge";function w0(){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()}w0.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},w0.className="RandomNumberGenerator";function yo(a){Ko.call(this),this.kc=this.ie=25,this.K=0,this.Dk=M0,this.Zk=k0,this.Qk=b0,this.bj=4,this.rk=N0,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 At,this.He=[],this.He.length=100,this.xw=this.ve=0,a&&Object.assign(this,a)}Se(yo,Ko),yo.prototype.cloneProtected=function(a){Ko.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},yo.prototype.qb=function(a){a.classType===yo?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:Gt("Unknown enum value: "+a):Ko.prototype.qb.call(this,a)},yo.prototype.createNetwork=function(){return new tg(this)},yo.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!==kp&&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===kp&&this.removeCycles(),a=this.network;for(var y=[],x=a.edges.iterator;x.next();){var E=x.value;E.valid=!1,y.push(E)}for(x=0;x<y.length;x++){E=y[x];var b=E.fromVertex,z=E.toVertex;if(!(E.valid||(b.node===null&&b.data===null||z.node===null&&z.data===null)&&b.layer===z.layer)){var tt=0,rt=0,ot=0,lt=0;if(E.link!==null){if(rt=E.link,rt===null)continue;var ut=b.node;if(tt=z.node,ut===null||tt===null)continue;var ft=rt.fromNode;ot=rt.toNode;for(var yt=rt.fromPort;yt!==null&&!yt.Ed();)yt=yt.panel;for(rt=rt.toPort;rt!==null&&!rt.Ed();)rt=rt.panel;if(E.rev){lt=ft;var xt=yt;ft=ot,yt=rt,ot=lt,rt=xt}var Ct=b.focus;lt=z.focus;var bt=E.rev?z.bounds:b.bounds;xt=At.alloc(),ut!==ft?bt.w()&&ft.isVisible()?ft.actualBounds.w()?(Oh(ft,yt,lr,xt),xt.x+=ft.actualBounds.x-bt.x,xt.y+=ft.actualBounds.y-bt.y):(Oh(ft,yt,lr,xt),xt.w()||xt.assign(Ct)):xt.assign(Ct):bt.w()?(Oh(ft,yt,lr,xt),xt.w()||xt.assign(Ct)):xt.assign(Ct),ft=E.rev?b.bounds:z.bounds,ut=At.alloc(),tt!==ot?ft.w()&&ot.isVisible()?ot.actualBounds.w()?(Oh(ot,rt,lr,ut),ut.x+=ot.actualBounds.x-ft.x,ut.y+=ot.actualBounds.y-ft.y):(Oh(ot,rt,lr,ut),ut.w()||ut.assign(lt)):ut.assign(lt):ft.w()?(Oh(ot,rt,lr,ut),ut.w()||ut.assign(lt)):ut.assign(lt),this.K===90||this.K===270?(tt=Math.round((xt.x-Ct.x)/this.kc),ot=xt.x,rt=Math.round((ut.x-lt.x)/this.kc),lt=ut.x):(tt=Math.round((xt.y-Ct.y)/this.kc),ot=xt.y,rt=Math.round((ut.y-lt.y)/this.kc),lt=ut.y),At.free(xt),At.free(ut),E.portFromColOffset=tt,E.portFromPos=ot,E.portToColOffset=rt,E.portToPos=lt}else E.portFromColOffset=0,E.portFromPos=0,E.portToColOffset=0,E.portToPos=0;if(xt=b.layer,ut=z.layer,ft=0,bt=E.link,bt!==null){var Vt=bt.fromPort,zt=bt.toPort;if(Vt!==null&&zt!==null){var Qt=bt.fromNode;if(yt=bt.toNode,Qt!==null&&yt!==null){var ee=F0(this,!0),oe=F0(this,!1),ce=this.setsPortSpots?ee:bt.computeSpot(!0,Vt);Ct=this.setsPortSpots?oe:bt.computeSpot(!1,zt);var Me=bt.isOrthogonal;ce.$c()&&ce.Hf(oe)&&Ct.$c()&&Ct.Hf(ee)?ft=0:(ee=bt.getLinkPoint(Qt,Vt,ce,!0,Me,yt,zt,At.alloc()),oe=bt.getLinkDirection(Qt,Vt,ee,ce,!0,Me,yt,zt),At.free(ee),ce.ys()||oe!==JS(this,E,!0)?this.setsPortSpots&&Qt!==null&&Qt.ports.count===1&&E.rev&&(ft+=1):ft+=1,ce=bt.getLinkPoint(yt,zt,Ct,!1,Me,Qt,Vt,At.alloc()),bt=bt.getLinkDirection(yt,zt,ce,Ct,!1,Me,Qt,Vt),At.free(ce),Ct.ys()||bt!==JS(this,E,!1)?this.setsPortSpots&&yt!==null&&yt.ports.count===1&&E.rev&&(ft+=2):ft+=2)}}}if(yt=ft,ft=yt===1||yt===3,(yt=yt===2||yt===3)&&(Ct=a.createVertex(),Ct.node=null,Ct.Dj=1,Ct.layer=xt,Ct.near=b,a.dh(Ct),b=a.Zj(b,Ct,E.link),b.valid=!1,b.rev=E.rev,b.portFromColOffset=tt,b.portToColOffset=0,b.portFromPos=ot,b.portToPos=0,b=Ct),bt=1,ft&&bt--,xt-ut>bt&&0<xt){for(E.valid=!1,Ct=a.createVertex(),Ct.node=null,Ct.Dj=2,Ct.layer=xt-1,a.dh(Ct),b=a.Zj(b,Ct,E.link),b.valid=!0,b.rev=E.rev,b.portFromColOffset=yt?0:tt,b.portToColOffset=0,b.portFromPos=yt?0:ot,b.portToPos=0,b=Ct,xt--;xt-ut>bt&&0<xt;)Ct=a.createVertex(),Ct.node=null,Ct.Dj=3,Ct.layer=xt-1,a.dh(Ct),b=a.Zj(b,Ct,E.link),b.valid=!0,b.rev=E.rev,b.portFromColOffset=0,b.portToColOffset=0,b.portFromPos=0,b.portToPos=0,b=Ct,xt--;b=a.Zj(Ct,z,E.link),b.valid=!ft,ft&&(Ct.near=z),b.rev=E.rev,b.portFromColOffset=0,b.portToColOffset=rt,b.portFromPos=0,b.portToPos=lt}else E.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=Pd(this,a),x=0,E=this.tc[a],z=0;z<E;z++)b=y[z],x+=this.nodeMinColumnSpace(b,!0),b.column=x,x+=1,x+=this.nodeMinColumnSpace(b,!1);this.Ra=Math.max(this.Ra,x-1),wd(this,a,y)}this.reduceCrossings(),this.straightenAndPack(),this.updateParts()}this.network=null,this.isValidLayout=!0},yo.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}yo.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},yo.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 js(a){a.kj===null&&(a.kj=[]);for(var y=0,x=a.network.vertexes.iterator;x.next();){var E=x.value;a.kj[y]=E.layer,y++,a.kj[y]=E.column,y++,a.kj[y]=E.index,y++}return a.kj}function bl(a,y){var x=0;for(a=a.network.vertexes.iterator;a.next();){var E=a.value;E.layer=y[x],x++,E.column=y[x],x++,E.index=y[x],x++}}function GS(a,y,x){var E=Pd(a,y),b=a.tc[y];(a.Jn===null||a.Jn.length<b*b)&&(a.Jn=[]);for(var z=a.Jn,tt=0;tt<b;tt++){var rt=0,ot=E[tt],lt=ot.near;if(lt!==null&<.layer===ot.layer)if(ot=lt.index,ot>tt)for(var ut=tt+1;ut<ot;ut++){var ft=E[ut];ft.near===lt&&ft.Dj===lt.Dj||rt++}else for(ut=tt-1;ut>ot;ut--)ft=E[ut],ft.near===lt&&ft.Dj===lt.Dj||rt++;var yt;if(0<=x)for(ot=E[tt].sourceEdgesArrayAccess,lt=0;lt<ot.length;lt++){var xt=ot[lt];if(xt.valid&&xt.fromVertex.layer!==y)for(ft=xt.fromVertex.index,ut=xt.portToPos,xt=xt.portFromPos,yt=lt+1;yt<ot.length;yt++){var Ct=ot[yt];if(Ct.valid&&Ct.fromVertex.layer!==y){var bt=Ct.fromVertex.index,Vt=Ct.portToPos;Ct=Ct.portFromPos,ut<Vt&&(ft>bt||ft===bt&&xt>Ct)&&rt++,Vt<ut&&(bt>ft||bt===ft&&Ct>xt)&&rt++}}}if(0>=x){for(ot=E[tt].destinationEdgesArrayAccess,lt=0;lt<ot.length;lt++)if(xt=ot[lt],xt.valid&&xt.toVertex.layer!==y)for(ft=xt.toVertex.index,ut=xt.portToPos,xt=xt.portFromPos,yt=lt+1;yt<ot.length;yt++)Ct=ot[yt],Ct.valid&&Ct.toVertex.layer!==y&&(bt=Ct.toVertex.index,Vt=Ct.portToPos,Ct=Ct.portFromPos,xt<Ct&&(ft>bt||ft===bt&&ut>Vt)&&rt++,Ct<xt&&(bt>ft||bt===ft&&Vt>ut)&&rt++)}for(z[tt*b+tt]=rt,ot=tt+1;ot<b;ot++){var zt=0,Qt=0;if(0<=x){rt=E[tt].sourceEdgesArrayAccess;var ee=E[ot].sourceEdgesArrayAccess;for(lt=0;lt<rt.length;lt++)if(xt=rt[lt],xt.valid&&xt.fromVertex.layer!==y)for(ft=xt.fromVertex.index,xt=xt.portFromPos,yt=0;yt<ee.length;yt++)Ct=ee[yt],Ct.valid&&Ct.fromVertex.layer!==y&&(bt=Ct.fromVertex.index,Ct=Ct.portFromPos,(ft<bt||ft===bt&&xt<Ct)&&Qt++,(bt<ft||bt===ft&&Ct<xt)&&zt++)}if(0>=x){for(rt=E[tt].destinationEdgesArrayAccess,ee=E[ot].destinationEdgesArrayAccess,lt=0;lt<rt.length;lt++)if(xt=rt[lt],xt.valid&&xt.toVertex.layer!==y)for(ft=xt.toVertex.index,ut=xt.portToPos,yt=0;yt<ee.length;yt++)Ct=ee[yt],Ct.valid&&Ct.toVertex.layer!==y&&(bt=Ct.toVertex.index,Vt=Ct.portToPos,(ft<bt||ft===bt&&ut<Vt)&&Qt++,(bt<ft||bt===ft&&Vt<ut)&&zt++)}z[tt*b+ot]=zt,z[ot*b+tt]=Qt}}return wd(a,y,E),z}yo.prototype.countCrossings=function(){for(var a=0,y=0;y<=this.Ia;y++)for(var x=GS(this,y,1),E=this.tc[y],b=0;b<E;b++)for(var z=b;z<E;z++)a+=x[b*E+z];return a};function C0(a){for(var y=0,x=0;x<=a.Ia;x++){for(var E=a,b=x,z=Pd(E,b),tt=E.tc[b],rt=0,ot=0;ot<tt;ot++){var lt=z[ot].destinationEdgesArrayAccess;if(lt!==null)for(var ut=0;ut<lt.length;ut++){var ft=lt[ut];if(ft.valid&&ft.toVertex.layer!==b){var yt=ft.fromVertex.column+ft.portFromColOffset,xt=ft.toVertex.column+ft.portToColOffset;rt+=(Math.abs(yt-xt)+1)*gy(ft)}}}wd(E,b,z),y+=rt}return y}yo.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 E=Pd(a,y),b=a.tc[y],z=[],tt=0;tt<b;tt++){var rt=E[tt],ot=null;0>=x&&(ot=rt.sourceEdgesArrayAccess);var lt=null;0<=x&&(lt=rt.destinationEdgesArrayAccess);var ut=0,ft=0,yt=rt.near;if(yt!==null&&yt.layer===rt.layer&&(ut+=yt.column-1,ft++),ot!==null)for(yt=0;yt<ot.length;yt++){rt=ot[yt];var xt=rt.fromVertex;rt.valid&&!rt.rev&&xt.layer!==y&&(ut+=xt.column,ft++)}if(lt!==null)for(ot=0;ot<lt.length;ot++)rt=lt[ot],yt=rt.toVertex,rt.valid&&!rt.rev&&yt.layer!==y&&(ut+=yt.column,ft++);z[tt]=ft===0?-1:ut/ft}return wd(a,y,E),z}function HS(a,y,x){for(var E=Pd(a,y),b=a.tc[y],z=[],tt=0;tt<b;tt++){var rt=E[tt],ot=null;0>=x&&(ot=rt.sourceEdgesArrayAccess);var lt=null;0<=x&&(lt=rt.destinationEdgesArrayAccess);var ut=0,ft=[],yt=rt.near;if(yt!==null&&yt.layer===rt.layer&&(ft[ut]=yt.column-1,ut++),rt=void 0,ot!==null)for(yt=0;yt<ot.length;yt++){rt=ot[yt];var xt=rt.fromVertex;rt.valid&&!rt.rev&&xt.layer!==y&&(ft[ut]=xt.column+rt.portFromColOffset,ut++)}if(lt!==null)for(ot=0;ot<lt.length;ot++)rt=lt[ot],yt=rt.toVertex,rt.valid&&!rt.rev&&yt.layer!==y&&(ft[ut]=yt.column+rt.portToColOffset,ut++);ut===0?z[tt]=-1:(ft.sort(function(Ct,bt){return Ct-bt}),lt=ut>>1,z[tt]=ut&1?ft[lt]:ft[lt-1]+ft[lt]>>1)}return wd(a,y,E),z}function Mp(a,y,x,E,b,z){if(y.component===E){if(y.component=x,b)for(var tt=y.destinationEdges;tt.next();){var rt=tt.value,ot=rt.toVertex,lt=y.layer-ot.layer;rt=a.linkMinLength(rt),lt===rt&&Mp(a,ot,x,E,b,z)}if(z)for(tt=y.sourceEdges;tt.next();)rt=tt.value,ot=rt.fromVertex,lt=ot.layer-y.layer,rt=a.linkMinLength(rt),lt===rt&&Mp(a,ot,x,E,b,z)}}function my(a,y,x,E,b,z){if(y.component===E){if(y.component=x,b)for(var tt=y.destinationEdges;tt.next();)my(a,tt.value.toVertex,x,E,b,z);if(z)for(y=y.sourceEdges;y.next();)my(a,y.value.fromVertex,x,E,b,z)}}yo.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,E=[];E.length=x+1;for(var b=a.vertexes.iterator;b.next();)b.value.valid=!0;for(;jx(a)!==null;){for(b=WS(a);b!==null;)E[x]=b,x--,b.valid=!1,b=WS(a);for(b=VS(a);b!==null;)E[y]=b,y++,b.valid=!1,b=VS(a);b=null;for(var z=0,tt=this.network.vertexes.iterator;tt.next();){var rt=tt.value;if(rt.valid){for(var ot=0,lt=rt.destinationEdges;lt.next();)lt.value.toVertex.valid&&ot++;lt=0;for(var ut=rt.sourceEdges;ut.next();)ut.value.fromVertex.valid&<++;(b===null||z<ot-lt)&&(b=rt,z=ot-lt)}}b!==null&&(E[y]=b,y++,b.valid=!1)}for(y=0;y<a.vertexes.count;y++)E[y].index=y;for(E=a.edges.iterator;E.next();)y=E.value,y.fromVertex.index>y.toVertex.index&&(a.gm(y),y.rev=!0);break;case M0:for(E=this.network.vertexes.iterator;E.next();)a=E.value,a.Ll=-1,a.finish=-1;for(a=this.network.edges.iterator;a.next();)a.value.forest=!1;for(this.Kn=0,E.reset();E.next();)y=E.value,y.sourceEdges.count===0&&vy(this,y);for(E.reset();E.next();)y=E.value,y.Ll===-1&&vy(this,y);for(a.reset();a.next();)E=a.value,E.forest||(y=E.fromVertex,x=y.finish,b=E.toVertex,z=b.finish,b.Ll<y.Ll&&x<z&&(this.network.gm(E),E.rev=!0));break;case kp:for(a=this.network,y=a.vertexes.iterator,E=1/0;y.next();)E=Math.min(E,y.value.layer);if(1/0>E){if(0>E)for(y.reset();y.next();)y.value.layer-=E;for(E=[],y.reset();y.next();)x=y.value,b=E[x.layer],b===void 0?E[x.layer]=[x]:b.push(x);for(x=y=0;x<E.length;x++)if(b=E[x],!b||b.length===0)y++;else if(0<x)for(z=0;z<b.length;z++)b[z].layer-=y;for(E=a.edges.iterator;E.next();)y=E.value,y.fromVertex.layer<y.toVertex.layer&&(a.gm(y),y.rev=!0)}}};function jx(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,E=y.destinationEdges;E.next();)if(E.value.toVertex.valid){x=!1;break}if(x)return y}}return null}function VS(a){for(a=a.vertexes.iterator;a.next();){var y=a.value;if(y.valid){for(var x=!0,E=y.sourceEdges;E.next();)if(E.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 E=x.value,b=E.toVertex;b.Ll===-1&&(E.forest=!0,vy(a,b))}y.finish=a.Kn,a.Kn++}yo.prototype.assignLayers=function(){switch(this.Zk){case xy:KS(this);break;case Py:for(var a,y=this.network.vertexes.iterator;y.next();)a=YS(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 k0: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&&XS(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=US(a,y.value);a.Ia=Math.max(x,a.Ia)}}function US(a,y){var x=0;if(y.layer===-1){for(var E=y.destinationEdges;E.next();){var b=E.value,z=b.toVertex;b=a.linkMinLength(b),x=Math.max(x,US(a,z)+b)}y.layer=x}else x=y.layer;return x}function YS(a,y){var x=0;if(y.layer===-1){for(var E=y.sourceEdges;E.next();){var b=E.value,z=b.fromVertex;b=a.linkMinLength(b),x=Math.max(x,YS(a,z)+b)}y.layer=x}else x=y.layer;return x}function XS(a,y){if(!y.valid){y.valid=!0;for(var x=y.destinationEdges;x.next();)XS(a,x.value.toVertex);for(x=a.network.vertexes.iterator;x.next();)x.value.component=-1;for(var E=y.sourceEdgesArrayAccess,b=E.length,z=0;z<b;z++){var tt=E[z],rt=tt.fromVertex,ot=tt.toVertex;tt=a.linkMinLength(tt),rt.layer-ot.layer>tt&&Mp(a,rt,0,-1,!0,!1)}for(Mp(a,y,1,-1,!0,!0);y.component!==0;){for(z=0,E=1/0,rt=0,ot=null,tt=a.network.vertexes.iterator;tt.next();){var lt=tt.value;if(lt.component===1){var ut=0,ft=!1,yt=lt.sourceEdgesArrayAccess;b=yt.length;for(var xt=0;xt<b;xt++){var Ct=yt[xt],bt=Ct.fromVertex;ut+=1,bt.component!==1&&(z+=1,bt=bt.layer-lt.layer,Ct=a.linkMinLength(Ct),E=Math.min(E,bt-Ct))}for(yt=lt.destinationEdgesArrayAccess,b=yt.length,xt=0;xt<b;xt++)Ct=yt[xt].toVertex,--ut,Ct.component!==1?--z:ft=!0;(ot===null||ut<rt)&&!ft&&(ot=lt,rt=ut)}}if(0<z){for(x.reset();x.next();)b=x.value,b.component===1&&(b.layer+=E);y.component=0}else ot.component=0}for(x=a.network.vertexes.iterator;x.next();)x.value.component=-1;for(Mp(a,y,1,-1,!0,!1);y.component!==0;){for(E=0,b=1/0,z=0,rt=null,ot=a.network.vertexes.iterator;ot.next();)if(tt=ot.value,tt.component===1){for(lt=0,ut=!1,yt=tt.sourceEdgesArrayAccess,ft=yt.length,xt=0;xt<ft;xt++)Ct=yt[xt].fromVertex,lt+=1,Ct.component!==1?E+=1:ut=!0;for(yt=tt.destinationEdgesArrayAccess,ft=yt.length,xt=0;xt<ft;xt++)Ct=yt[xt],bt=Ct.toVertex,--lt,bt.component!==1&&(--E,bt=tt.layer-bt.layer,Ct=a.linkMinLength(Ct),b=Math.min(b,bt-Ct));(rt===null||lt>z)&&!ut&&(rt=tt,z=lt)}if(0>E){for(x.reset();x.next();)E=x.value,E.component===1&&(E.layer-=b);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}yo.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 b0: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 E=0;E<y.length-1;E++){var b=y[E],z=y[E+1];b.portFromColOffset>z.portFromColOffset&&(x=!0,y[E]=z,y[E+1]=b)}}for(x=0;x<y.length;x++)E=y[x],E.valid&&(E=E.toVertex,E.index===-1&&QS(a,E))}function $S(a,y){var x=y.layer;y.index=a.tc[x],a.tc[x]++,y=y.sourceEdgesArrayAccess;for(var E=!0;E;)for(E=!1,x=0;x<y.length-1;x++){var b=y[x],z=y[x+1];b.portToColOffset>z.portToColOffset&&(E=!0,y[x]=z,y[x+1]=b)}for(x=0;x<y.length;x++)E=y[x],E.valid&&(E=E.fromVertex,E.index===-1&&$S(a,E))}yo.prototype.reduceCrossings=function(){var a=this.countCrossings(),y=js(this),x,E;for(x=0;x<this.bj;x++){for(E=0;E<=this.Ia;E++)E0(this,E,1),Gl(this,E,1);var b=this.countCrossings();for(b<a&&(a=b,y=js(this)),E=this.Ia;0<=E;E--)E0(this,E,-1),Gl(this,E,-1);b=this.countCrossings(),b<a&&(a=b,y=js(this))}for(bl(this,y),x=0;x<this.bj;x++){for(E=0;E<=this.Ia;E++)E0(this,E,0),Gl(this,E,0);for(b=this.countCrossings(),b<a&&(a=b,y=js(this)),E=this.Ia;0<=E;E--)E0(this,E,0),Gl(this,E,0);b=this.countCrossings(),b<a&&(a=b,y=js(this))}bl(this,y);var z,tt,rt;switch(this.rk){case Ey:break;case Ly:for(rt=a+1;(E=this.countCrossings())<rt;)for(rt=E,x=this.Ia;0<=x;x--)for(tt=0;tt<=x;tt++){for(z=!0;z;)for(z=!1,E=x;E>=tt;E--)z=Gl(this,E,-1)||z;for(b=this.countCrossings(),b>=a?bl(this,y):(a=b,y=js(this)),z=!0;z;)for(z=!1,E=x;E>=tt;E--)z=Gl(this,E,1)||z;for(b=this.countCrossings(),b>=a?bl(this,y):(a=b,y=js(this)),z=!0;z;)for(z=!1,E=tt;E<=x;E++)z=Gl(this,E,1)||z;for(b>=a?bl(this,y):(a=b,y=js(this)),z=!0;z;)for(z=!1,E=tt;E<=x;E++)z=Gl(this,E,-1)||z;for(b>=a?bl(this,y):(a=b,y=js(this)),z=!0;z;)for(z=!1,E=x;E>=tt;E--)z=Gl(this,E,0)||z;for(b>=a?bl(this,y):(a=b,y=js(this)),z=!0;z;)for(z=!1,E=tt;E<=x;E++)z=Gl(this,E,0)||z;b>=a?bl(this,y):(a=b,y=js(this))}break;default:case N0:for(x=this.Ia,tt=0,rt=a+1;(E=this.countCrossings())<rt;){for(rt=E,z=!0;z;)for(z=!1,E=x;E>=tt;E--)z=Gl(this,E,-1)||z;for(b=this.countCrossings(),b>=a?bl(this,y):(a=b,y=js(this)),z=!0;z;)for(z=!1,E=x;E>=tt;E--)z=Gl(this,E,1)||z;for(b=this.countCrossings(),b>=a?bl(this,y):(a=b,y=js(this)),z=!0;z;)for(z=!1,E=tt;E<=x;E++)z=Gl(this,E,1)||z;for(b>=a?bl(this,y):(a=b,y=js(this)),z=!0;z;)for(z=!1,E=tt;E<=x;E++)z=Gl(this,E,-1)||z;for(b>=a?bl(this,y):(a=b,y=js(this)),z=!0;z;)for(z=!1,E=x;E>=tt;E--)z=Gl(this,E,0)||z;for(b>=a?bl(this,y):(a=b,y=js(this)),z=!0;z;)for(z=!1,E=tt;E<=x;E++)z=Gl(this,E,0)||z;b>=a?bl(this,y):(a=b,y=js(this))}}bl(this,y)};function E0(a,y,x){var E=Pd(a,y),b=a.tc[y],z=HS(a,y,x),tt=py(a,y,x);for(x=0;x<b;x++)tt[x]===-1&&(tt[x]=E[x].column),z[x]===-1&&(z[x]=E[x].column);for(var rt=!0,ot;rt;)for(rt=!1,x=0;x<b-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=E[x],E[x]=E[x+1],E[x+1]=ot);for(x=z=0;x<b;x++)ot=E[x],ot.index=x,z+=a.nodeMinColumnSpace(ot,!0),ot.column=z,z+=1,z+=a.nodeMinColumnSpace(ot,!1);wd(a,y,E)}function Gl(a,y,x){var E=Pd(a,y),b=a.tc[y];x=GS(a,y,x);var z,tt=[];for(z=0;z<b;z++)tt[z]=-1;var rt=[];for(z=0;z<b;z++)rt[z]=-1;for(var ot=!1,lt=!0;lt;)for(lt=!1,z=0;z<b-1;z++){var ut=x[E[z].index*b+E[z+1].index],ft=x[E[z+1].index*b+E[z].index],yt=0,xt=0,Ct=E[z].column,bt=E[z+1].column,Vt=a.nodeMinColumnSpace(E[z],!0),zt=a.nodeMinColumnSpace(E[z],!1),Qt=a.nodeMinColumnSpace(E[z+1],!0),ee=a.nodeMinColumnSpace(E[z+1],!1);Vt=Ct-Vt+Qt,zt=bt-zt+ee;var oe=E[z].sourceEdges.iterator;for(oe.reset();oe.next();)if(Qt=oe.value,ee=Qt.fromVertex,Qt.valid&&ee.layer===y){for(Qt=0;E[Qt]!==ee;)Qt++;Qt<z&&(yt+=2*(z-Qt),xt+=2*(z+1-Qt)),Qt===z+1&&(yt+=1),Qt>z+1&&(yt+=4*(Qt-z),xt+=4*(Qt-(z+1)))}for(oe=E[z].destinationEdges.iterator,oe.reset();oe.next();)if(Qt=oe.value,ee=Qt.toVertex,Qt.valid&&ee.layer===y){for(Qt=0;E[Qt]!==ee;)Qt++;Qt===z+1&&(xt+=1)}for(oe=E[z+1].sourceEdges.iterator,oe.reset();oe.next();)if(Qt=oe.value,ee=Qt.fromVertex,Qt.valid&&ee.layer===y){for(Qt=0;E[Qt]!==ee;)Qt++;Qt<z&&(yt+=2*(z+1-Qt),xt+=2*(z-Qt)),Qt===z&&(xt+=1),Qt>z+1&&(yt+=4*(Qt-(z+1)),xt+=4*(Qt-z))}for(oe=E[z+1].destinationEdges.iterator,oe.reset();oe.next();)if(Qt=oe.value,ee=Qt.toVertex,Qt.valid&&ee.layer===y){for(Qt=0;E[Qt]!==ee;)Qt++;Qt===z&&(yt+=1)}Qt=ee=0,oe=tt[E[z].index];var ce=rt[E[z].index],Me=tt[E[z+1].index],Wn=rt[E[z+1].index];oe!==-1&&(ee+=Math.abs(oe-Ct),Qt+=Math.abs(oe-zt)),ce!==-1&&(ee+=Math.abs(ce-Ct),Qt+=Math.abs(ce-zt)),Me!==-1&&(ee+=Math.abs(Me-bt),Qt+=Math.abs(Me-Vt)),Wn!==-1&&(ee+=Math.abs(Wn-bt),Qt+=Math.abs(Wn-Vt)),(xt<yt-.5||xt===yt&&ft<ut-.5||xt===yt&&ft===ut&&Qt<ee-.5)&&(lt=ot=!0,E[z].column=zt,E[z+1].column=Vt,ut=E[z],E[z]=E[z+1],E[z+1]=ut)}for(z=0;z<b;z++)E[z].index=z;return wd(a,y,E),ot}yo.prototype.straightenAndPack=function(){if(this.ve===0){var a=(this.bg&1)!==0,y=(this.bg&Ux)!==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 E,b=this.network.vertexes.iterator;b.next();){var z=b.value;y=z.layer,E=z.column,z=this.nodeMinColumnSpace(z,!1),x[y]=Math.max(x[y],E+z)}for(b.reset();b.next();)z=b.value,y=z.layer,E=z.column,z.column=(8*(this.Ra-x[y])>>1)+8*E;this.Ra*=8}if(this.bg&2)for(x=!0;x;){for(x=!1,y=this.Md+1;y<=this.Ia;y++)x=qf(this,y,1)||x;for(y=this.Md-1;0<=y;y--)x=qf(this,y,-1)||x;x=qf(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=qf(this,this.Md,0)||x,y=this.Md+1;y<=this.Ia;y++)x=qf(this,y,0)||x;for(y=this.Md-1;0<=y;y--)x=qf(this,y,0)||x}}else Hx(this)};function qf(a,y,x){for(var E=!1;zx(a,y,x);)E=!0;return E}function zx(a,y,x){var E,b=Pd(a,y),z=a.tc[y],tt=py(a,y,-1);if(0<x)for(E=0;E<z;E++)tt[E]=-1;var rt=py(a,y,1);if(0>x)for(E=0;E<z;E++)rt[E]=-1;for(var ot=!1,lt=!0;lt;)for(lt=!1,E=0;E<z;E++){var ut=b[E].column,ft=a.nodeMinColumnSpace(b[E],!0),yt=a.nodeMinColumnSpace(b[E],!1),xt=0;0>E-1||ut-b[E-1].column-1>ft+a.nodeMinColumnSpace(b[E-1],!1)?xt=ut-1:xt=ut,ft=E+1>=z||b[E+1].column-ut-1>yt+a.nodeMinColumnSpace(b[E+1],!0)?ut+1:ut;var Ct=yt=0,bt=0;if(0>=x)for(var Vt=b[E].sourceEdges.iterator;Vt.next();){var zt=Vt.value,Qt=zt.fromVertex;if(zt.valid&&Qt.layer!==y){var ee=gy(zt),oe=zt.portFromColOffset;zt=zt.portToColOffset,Qt=Qt.column,yt+=(Math.abs(ut+zt-(Qt+oe))+1)*ee,Ct+=(Math.abs(xt+zt-(Qt+oe))+1)*ee,bt+=(Math.abs(ft+zt-(Qt+oe))+1)*ee}}if(0<=x)for(Vt=b[E].destinationEdges.iterator;Vt.next();)zt=Vt.value,Qt=zt.toVertex,zt.valid&&Qt.layer!==y&&(ee=gy(zt),oe=zt.portFromColOffset,zt=zt.portToColOffset,Qt=Qt.column,yt+=(Math.abs(ut+oe-(Qt+zt))+1)*ee,Ct+=(Math.abs(xt+oe-(Qt+zt))+1)*ee,bt+=(Math.abs(ft+oe-(Qt+zt))+1)*ee);zt=oe=ee=0,Vt=tt[b[E].index],Qt=rt[b[E].index],Vt!==-1&&(ee+=Math.abs(Vt-ut),oe+=Math.abs(Vt-xt),zt+=Math.abs(Vt-ft)),Qt!==-1&&(ee+=Math.abs(Qt-ut),oe+=Math.abs(Qt-xt),zt+=Math.abs(Qt-ft)),Ct<yt||Ct===yt&&oe<ee?(lt=ot=!0,b[E].column=xt):(bt<yt||bt===yt&&zt<ee)&&(lt=ot=!0,b[E].column=ft)}return wd(a,y,b),a.normalize(),ot}function yy(a,y,x){var E=Pd(a,y),b=a.tc[y],z=HS(a,y,x),tt=[];for(x=0;x<b;x++)tt[x]=z[x];for(z=!0;z;)for(z=!1,x=0;x<b;x++){var rt=E[x].column,ot=a.nodeMinColumnSpace(E[x],!0),lt=a.nodeMinColumnSpace(E[x],!1),ut=0;if(tt[x]===-1)if(x===0&&x===b-1)ut=rt;else if(x===0){var ft=E[x+1].column;ft-rt===lt+a.nodeMinColumnSpace(E[x+1],!0)?ut=rt-1:ut=rt}else x===b-1?(ft=E[x-1].column,ut=rt-ft===ot+a.nodeMinColumnSpace(E[x-1],!1)?rt+1:rt):(ft=E[x-1].column,ot=ft+a.nodeMinColumnSpace(E[x-1],!1)+ot+1,ft=E[x+1].column,lt=ft-a.nodeMinColumnSpace(E[x+1],!0)-lt-1,ut=(ot+lt)/2|0);else x===0&&x===b-1?ut=tt[x]:x===0?(ft=E[x+1].column,lt=ft-a.nodeMinColumnSpace(E[x+1],!0)-lt-1,ut=Math.min(tt[x],lt)):x===b-1?(ft=E[x-1].column,ot=ft+a.nodeMinColumnSpace(E[x-1],!1)+ot+1,ut=Math.max(tt[x],ot)):(ft=E[x-1].column,ot=ft+a.nodeMinColumnSpace(E[x-1],!1)+ot+1,ft=E[x+1].column,lt=ft-a.nodeMinColumnSpace(E[x+1],!0)-lt-1,ot<tt[x]&&tt[x]<lt?ut=tt[x]:ot>=tt[x]?ut=ot:lt<=tt[x]&&(ut=lt));ut!==rt&&(z=!0,E[x].column=ut)}wd(a,y,E),a.normalize()}function Zx(a,y){for(var x=!0,E=a.network.vertexes.iterator;E.next();){var b=E.value,z=a.nodeMinColumnSpace(b,!0),tt=a.nodeMinColumnSpace(b,!1);if(b.column-z<=y&&b.column+tt>=y){x=!1;break}}if(a=!1,x)for(E.reset();E.next();)x=E.value,x.column>y&&(--x.column,a=!0);return a}function Gx(a,y){var x=y+1,E,b=[],z=[];for(E=0;E<=a.Ia;E++)b[E]=!1,z[E]=!1;for(var tt=a.network.vertexes.iterator;tt.next();){E=tt.value;var rt=E.column-a.nodeMinColumnSpace(E,!0),ot=E.column+a.nodeMinColumnSpace(E,!1);rt<=y&&ot>=y&&(b[E.layer]=!0),rt<=x&&ot>=x&&(z[E.layer]=!0)}for(rt=!0,x=!1,E=0;E<=a.Ia;E++)rt=rt&&!(b[E]&&z[E]);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(;Zx(a,x););for(a.normalize(),x=0;x<a.Ra;x++)for(;Gx(a,x););a.normalize();var E;if(0<y)for(x=0;x<=a.Ra;x++){var b=js(a),z=C0(a);for(E=z+1;z<E;){E=z,tx(a,x,1);var tt=C0(a);tt>z?bl(a,b):tt<z&&(z=tt,b=js(a))}}if(0>y)for(x=a.Ra;0<=x;x--)for(b=js(a),z=C0(a),E=z+1;z<E;)E=z,tx(a,x,-1),tt=C0(a),tt>z?bl(a,b):tt<z&&(z=tt,b=js(a));a.normalize()}function tx(a,y,x){a.le=0;for(var E=a.network.vertexes.iterator;E.next();)E.value.component=-1;if(0<x)for(E.reset();E.next();){var b=E.value;b.column-a.nodeMinColumnSpace(b,!0)<=y&&(b.component=a.le)}if(0>x)for(E.reset();E.next();)b=E.value,b.column+a.nodeMinColumnSpace(b,!1)>=y&&(b.component=a.le);for(a.le++,E.reset();E.next();)y=E.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(b=[],z=0;z<(a.Ia+1)*(a.Ra+1);z++)b[z]=-1;for(E.reset();E.next();){z=E.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++)b[tt*(a.Ra+1)+rt]=z.component}for(z=0;z<=a.Ia;z++){if(0<x)for(tt=0;tt<a.Ra;tt++)b[z*(a.Ra+1)+tt]!==-1&&b[z*(a.Ra+1)+tt+1]!==-1&&b[z*(a.Ra+1)+tt]!==b[z*(a.Ra+1)+tt+1]&&(y[b[z*(a.Ra+1)+tt]*a.le+b[z*(a.Ra+1)+tt+1]]=!0);if(0>x)for(tt=a.Ra;0<tt;tt--)b[z*(a.Ra+1)+tt]!==-1&&b[z*(a.Ra+1)+tt-1]!==-1&&b[z*(a.Ra+1)+tt]!==b[z*(a.Ra+1)+tt-1]&&(y[b[z*(a.Ra+1)+tt]*a.le+b[z*(a.Ra+1)+tt-1]]=!0)}for(b=[],z=0;z<a.le;z++)b[z]=!0;for(tt=[],tt.push(0);tt.length!==0;)if(ot=tt[tt.length-1],tt.pop(),b[ot])for(b[ot]=!1,z=0;z<a.le;z++)y[ot*a.le+z]&&tt.splice(0,0,z);if(0<x)for(E.reset();E.next();)a=E.value,b[a.component]&&--a.column;if(0>x)for(E.reset();E.next();)x=E.value,b[x.component]&&(x.column+=1)}function Hx(a){for(var y=Yn(),x=a.fl.length,E=0;E<=x;E++)y[E]=[];for(E=a.network.vertexes.iterator;E.next();){var b=E.value;y[x-b.layer][b.index]=b}x=new pn,Wx(y,x);var z=null,tt=null,rt=null,ot=null,lt=(a.ve&1)!==0,ut=(a.ve&2)!==0,ft=(a.ve&4)!==0,yt=(a.ve&8)!==0;for(lt&&(a.verticalAlignment(y,x,!0),z=L0(a,y,!0,!1)),y.reverse(),ft&&(a.verticalAlignment(y,x,!1),rt=L0(a,y,!1,!1)),E=Hn(y),b=E.next();!b.done;b=E.next())b.value.reverse();yt&&(a.verticalAlignment(y,x,!1),ot=L0(a,y,!1,!0)),y.reverse(),ut&&(a.verticalAlignment(y,x,!0),tt=L0(a,y,!0,!0)),si(y),a.u(z,tt,rt,ot),a.network.vertexes.each(function(xt){var Ct=Yn();lt&&Ct.push(z.get(xt)),ut&&Ct.push(tt.get(xt)),ft&&Ct.push(rt.get(xt)),yt&&Ct.push(ot.get(xt)),Ct.sort(function(Vt,zt){return Vt-zt});var bt=Ct.length;bt=(Ct[Math.floor((bt-1)/2)]+Ct[Math.ceil((bt-1)/2)])/2,si(Ct),xt.zc=bt})}function Wx(a,y){for(var x=a.length,E=1;E<x-1;E++)for(var b=0,z=0,tt=a[E],rt=a[E+1],ot=0;z<rt.length;ot++){var lt=rt[ot];t:{if(lt.node===null){var ut=Fy(lt);if(0<ut.length){ut=ut[0].node===null;break t}}ut=!1}var ft=ut;if(ot===rt.length-1||ft){for(ut=tt.length-1,ft&&(ut=Fy(lt)[0].index);z<=ot;){if(lt=rt[z],!lt.bo){ft=[];for(var yt=Hn(lt.sourceEdgesArrayAccess),xt=yt.next();!xt.done;xt=yt.next())xt=xt.value,xt.valid&&ft.push(xt);lt.bo=ft}for(lt=Hn(lt.bo),ft=lt.next();!ft.done;ft=lt.next())ft=ft.value,yt=ft.fromVertex.index,(yt<b||yt>ut)&&y.add(ft);z++}b=ut}}}yo.prototype.verticalAlignment=function(a,y,x){Vx(a),a=Hn(a);for(var E=a.next();!E.done;E=a.next()){var b=-1;E=Hn(E.value);for(var z=E.next();!z.done;z=E.next()){z=z.value;var tt=x?Fy(z):Yx(z),rt=tt.length;if(0<rt){tt.sort(function(ft,yt){return ft.vi-yt.vi});var ot=(rt-1)/2;for(rt=Math.floor(ot),ot=Math.ceil(ot);rt<=ot;rt++)if(z.align===z){var lt=tt[rt],ut=void 0;ut=x?B0(lt,z):B0(z,lt),!y.contains(ut)&&b<lt.vi&&(lt.align=z,z.root=lt.root,z.align=lt.root,b=lt.vi)}}}}};function Vx(a){for(var y=0;y<a.length;y++)for(var x=a[y],E=0;E<x.length;E++){var b=x[E];b.root=b,b.align=b,b.Tz=y,b.vi=E}}function L0(a,y,x,E){for(var b=a.K===90||a.K===270,z=Hn(y),tt=z.next();!tt.done;tt=z.next()){var rt=Hn(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=Hn(y),rt=z.next();!rt.done;rt=z.next()){rt=Hn(rt.value);for(var ot=rt.next();!ot.done;ot=rt.next())if(ot=ot.value,ot.root===ot){for(var lt=0,ut=ot;ut.align!==ot;){var ft=ut.align,yt=tt?ut.width:ut.height,xt=tt?ft.width:ft.height;if(x){var Ct=B0(ut,ft),bt=Ct.portFromPos,Vt=Ct.portToPos;Ct.link!==null&&(ut.node&&ut.node!==Ct.link.fromNode&&(bt=tt?ut.focusX:ut.focusY),ft.node&&ft.node!==Ct.link.toNode&&(Vt=tt?ft.focusX:ft.focusY))}else Ct=B0(ft,ut),bt=Ct.portToPos,Vt=Ct.portFromPos,Ct.link!==null&&(ut.node&&ut.node!==Ct.link.toNode&&(bt=tt?ut.focusX:ut.focusY),ft.node&&ft.node!==Ct.link.fromNode&&(Vt=tt?ft.focusX:ft.focusY));yt=E?ut.qg+(yt-bt)-(xt-Vt):ut.qg+bt-Vt,ft.qg=yt,lt=Math.min(lt,yt),ut=ut.align}ut=ot;do ut.qg=ut.qg-lt,ut=ut.align;while(ut!==ot)}}for(x=Hn(y),tt=x.next();!tt.done;tt=x.next())for(z=Hn(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+(b?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 be,y=Hn(y),tt=y.next();!tt.done;tt=y.next())for(x=Hn(tt.value),tt=x.next();!tt.done;tt=x.next())tt=tt.value,tt.zc=tt.zc+tt.sd.shift+tt.qg,z=b?tt.width:tt.height,a.add(tt,E?-tt.zc-z:tt.zc);return a}function ex(a,y,x){if(isNaN(y.zc)){y.zc=0;var E=y;do{if(0<E.vi){var b=nx(E,x),z=b.root;ex(a,z,x),y.sd===y&&(y.sd=z.sd);var tt=a.K===90||a.K===270?b.width:b.height;y.sd===z.sd&&(y.zc=Math.max(y.zc,z.zc+b.qg+tt-E.qg+a.columnSpacing))}E=E.align}while(E!==y);for(;E.align!==y;)E=E.align,E.zc=y.zc,E.sd=y.sd}}function nx(a,y){var x=a.Tz;return a=a.vi,1>a&&Gt("Could not determine previous vertex in layer"),y[x][a-1]}yo.prototype.u=function(a){for(var y=[],x=0;x<arguments.length;++x)y[x]=arguments[x];x=-1;for(var E=Yn(),b=Yn(),z=1/0,tt=0;4>tt;tt++)if(y[tt]){var rt=Kx(this,y[tt],E,b,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?E[x]-E[tt]:b[x]-b[tt],z.delta!==0&&y[tt].each(function(ot){return function(lt){lt.value+=ot.delta}}(z)));si(E),si(b)};function Kx(a,y,x,E,b){if(!y||y.count===0)return x[b]=0,E[b]=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[b]=z,E[b]=tt,tt-z}yo.prototype.commitLayout=function(){if(this.setsPortSpots)for(var a=F0(this,!0),y=F0(this,!1),x=this.network.edges.iterator;x.next();){var E=x.value.link;E!==null&&(E.fromSpot=a,E.toSpot=y)}this.commitNodes(),this.Gu(),this.isRouting&&this.commitLinks()};function F0(a,y){return a.K===270?y?Ja:Ga:a.K===90?y?Ga:Ja:a.K===180?y?Qa:Ba:y?Ba:Qa}yo.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 E=0;E<=this.Ia;E++){var b=x;0>=this.he[E]+this.Ld[E]&&(b=0),0<E&&(y+=b/2),this.K===90||this.K===0?(y+=this.Ld[E],this.Kd[E]=y,y+=this.he[E]):(y+=this.he[E],this.Kd[E]=y,y+=this.Ld[E]),E<this.Ia&&(y+=b/2),this.Ta[E]=y}for(x=y,y=this.arrangementOrigin,E=0;E<=this.Ia;E++)this.K===270?this.Kd[E]=y.y+this.Kd[E]:this.K===90?(this.Kd[E]=y.y+x-this.Kd[E],this.Ta[E]=x-this.Ta[E]):this.K===180?this.Kd[E]=y.x+this.Kd[E]:(this.Kd[E]=y.x+x-this.Kd[E],this.Ta[E]=x-this.Ta[E]);x=this.ve!==0,a.reset(),E=this.K===270||this.K===90;for(var z=1/0,tt=b=1/0,rt=-1/0;a.next();){var ot=a.value,lt=ot.layer,ut=ot.column|0;E?(tt=y.x+this.kc*ut,lt=this.Kd[lt]):(tt=this.Kd[lt],lt=y.y+this.kc*ut),ot.centerX=tt,ot.centerY=lt,x&&isFinite(ot.zc)&&(E?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),b=Math.min(ot.y,b),E?(tt=z,rt=Math.max(rt,ot.bounds.right)):(tt=b,rt=Math.max(rt,ot.bounds.bottom))}for(this.xw=rt-tt,z=y.x-z,y=y.y-b,this.Rf=new At(x&&E?0:z,x&&!E?0:y),a.reset();a.next();)x=a.value,x.x+=z,x.y+=y,x.commit()},yo.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 E=this.maxLayer;0<=E;E--)this.K===270?E===0?y.push(new Be(0,0,x,Math.abs(this.Ta[0]))):y.push(new Be(0,this.Ta[E-1],x,Math.abs(this.Ta[E-1]-this.Ta[E]))):this.K===90?E===0?y.push(new Be(0,this.Ta[0],x,Math.abs(this.Ta[0]-a))):y.push(new Be(0,this.Ta[E],x,Math.abs(this.Ta[E-1]-this.Ta[E]))):this.K===180?E===0?y.push(new Be(0,0,Math.abs(this.Ta[0]),x)):y.push(new Be(this.Ta[E-1],0,Math.abs(this.Ta[E-1]-this.Ta[E]),x)):E===0?y.push(new Be(this.Ta[0],0,Math.abs(this.Ta[0]-a),x)):y.push(new Be(this.Ta[E],0,Math.abs(this.Ta[E-1]-this.Ta[E]),x));this.commitLayers(y,this.Rf)},yo.prototype.commitLayers=function(){},yo.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 E=y,b=E.fromNode,z=E.toNode,tt=E.fromPort,rt=E.toPort;if(b!==null){var ot=b.findVisibleNode();ot!==null&&ot!==b&&(b=ot,tt=ot.port)}z!==null&&(ot=z.findVisibleNode(),ot!==null&&ot!==z&&(z=ot,rt=ot.port));var lt=y.computeSpot(!0,tt);ot=y.computeSpot(!1,rt);var ut=x.fromVertex,ft=x.toVertex;if(x.valid)y.curve===ml&&y.pointsCount===4&&(ut.column===ft.column&&this.alignOption===0?(x=y.getLinkPoint(b,tt,lt,!0,!1,z,rt),rt=y.getLinkPoint(z,rt,ot,!1,!1,b,tt),x.w()||x.set(b.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=E=!1,tt!==null&<===ar&&(E=!0),rt!==null&&ot===ar&&(x=!0),(E||x)&&(ot=null,E&&(ot=y.getLinkPointFromPoint(b,tt,tt.ga(lr),y.i(3),!0),ot.w()||ot.set(b.actualBounds.center),y.L(0,ot.x,ot.y)),b=null,x&&(b=y.getLinkPointFromPoint(z,rt,rt.ga(lr),y.i(0),!1),b.w()||b.set(z.actualBounds.center),y.L(3,b.x,b.y)),ot&&(z=y.i(2),y.L(1,(2*ot.x+z.x)/3,(2*ot.y+z.y)/3)),b&&(z=y.i(1),y.L(2,(2*b.x+z.x)/3,(2*b.y+z.y)/3))))),y.zf();else if(ut.layer===ft.layer)y.zf();else{var yt=!1,xt=!1,Ct=this.ie,bt=y.firstPickIndex+1;if(y.isOrthogonal){xt=!0;var Vt=y.pointsCount;4<Vt&&y.points.removeRange(2,Vt-3)}else if(y.curve===ml)yt=!0,Vt=y.pointsCount,4<Vt&&y.points.removeRange(2,Vt-3),Vt===4&&(bt=2);else{Vt=y.pointsCount;var zt=lt===ar,Qt=ot===ar;2<Vt&&zt&&Qt?y.points.removeRange(1,Vt-2):3<Vt&&zt&&!Qt?y.points.removeRange(1,Vt-3):3<Vt&&!zt&&Qt?y.points.removeRange(2,Vt-2):4<Vt&&!zt&&!Qt&&y.points.removeRange(2,Vt-3)}if(x.rev){for(;ft!==null&&ut!==ft;){var ee=Vt=null;for(zt=ft.sourceEdges.iterator;zt.next()&&(Qt=zt.value,Qt.link!==x.link||(Vt=Qt.fromVertex,ee=Qt.toVertex,Vt.node!==null)););if(Vt===null)break;if(Vt!==ut){zt=y.i(bt-1).x,Qt=y.i(bt-1).y;var oe=Vt.centerX,ce=Vt.centerY;if(xt)this.K===180||this.K===0?bt===y.firstPickIndex+1?(y.m(bt++,zt,Qt),y.m(bt++,zt,ce)):(ee!==null?ee.centerY:Qt)!==ce&&(ee=this.Ta[Vt.layer-1]+this.Rf.x,y.m(bt++,ee,Qt),y.m(bt++,ee,ce)):bt===y.firstPickIndex+1?(y.m(bt++,zt,Qt),y.m(bt++,oe,Qt)):(ee!==null?ee.centerX:zt)!==oe&&(ee=this.Ta[Vt.layer-1]+this.Rf.y,y.m(bt++,zt,ee),y.m(bt++,oe,ee));else if(bt===y.firstPickIndex+1){ee=Math.max(10,this.he[ft.layer]);var Me=Math.max(10,this.Ld[ft.layer]);if(yt)this.K===180?oe<=ft.bounds.x?(ft=ft.bounds.x,y.m(bt++,ft-ee,ce),y.m(bt++,ft,ce),y.m(bt++,ft+Me,ce)):(y.m(bt++,oe-ee,ce),y.m(bt++,oe,ce),y.m(bt++,oe+Me,ce)):this.K===90?ce>=ft.bounds.bottom?(ft=ft.bounds.y+ft.bounds.height,y.m(bt++,oe,ft+Me),y.m(bt++,oe,ft),y.m(bt++,oe,ft-ee)):(y.m(bt++,oe,ce+Me),y.m(bt++,oe,ce),y.m(bt++,oe,ce-ee)):this.K===270?ce<=ft.bounds.y?(ft=ft.bounds.y,y.m(bt++,oe,ft-ee),y.m(bt++,oe,ft),y.m(bt++,oe,ft+Me)):(y.m(bt++,oe,ce-ee),y.m(bt++,oe,ce),y.m(bt++,oe,ce+Me)):this.K===0&&(oe>=ft.bounds.right?(ft=ft.bounds.x+ft.bounds.width,y.m(bt++,ft+Me,ce),y.m(bt++,ft,ce),y.m(bt++,ft-ee,ce)):(y.m(bt++,oe+Me,ce),y.m(bt++,oe,ce),y.m(bt++,oe-ee,ce)));else{y.m(bt++,zt,Qt);var Wn=0;this.K===180||this.K===0?((this.K===180?oe>=ft.bounds.right:oe<=ft.bounds.x)&&(Wn=(this.K===0?-ee:Me)/2),y.m(bt++,zt+Wn,ce)):((this.K===270?ce>=ft.bounds.bottom:ce<=ft.bounds.y)&&(Wn=(this.K===90?-ee:Me)/2),y.m(bt++,oe,Qt+Wn)),y.m(bt++,oe,ce)}}else ee=Math.max(10,this.he[Vt.layer]),Me=Math.max(10,this.Ld[Vt.layer]),yt?this.K===180?(y.m(bt++,oe-ee-Ct,ce),y.m(bt++,Math.min(oe-ee+Ct/2,oe),ce),y.m(bt++,oe,ce),y.m(bt++,oe,ce),y.m(bt++,Math.max(oe+Me-Ct/2,oe),ce),y.m(bt++,oe+Me+Ct,ce)):this.K===90?(y.m(bt++,oe,ce+Me+Ct),y.m(bt++,oe,Math.max(ce+Me-Ct/2,ce)),y.m(bt++,oe,ce),y.m(bt++,oe,ce),y.m(bt++,oe,Math.min(ce-ee+Ct/2,ce)),y.m(bt++,oe,ce-ee-Ct)):this.K===270?(y.m(bt++,oe,ce-ee-Ct),y.m(bt++,oe,Math.min(ce-ee+Ct/2,ce)),y.m(bt++,oe,ce),y.m(bt++,oe,ce),y.m(bt++,oe,Math.max(ce+Me-Ct/2,ce)),y.m(bt++,oe,ce+Me+Ct)):(y.m(bt++,oe+Me+Ct,ce),y.m(bt++,Math.max(oe+Me-Ct/2,oe),ce),y.m(bt++,oe,ce),y.m(bt++,oe,ce),y.m(bt++,Math.min(oe-ee+Ct/2,oe),ce),y.m(bt++,oe-ee-Ct,ce)):y.m(bt++,oe,ce)}ft=Vt}(rt===null||lt!==ar||xt)&&(zt=y.i(bt-1).x,Qt=y.i(bt-1).y,oe=y.i(bt).x,ce=y.i(bt).y,xt?(Ct=this.Ld[ut.layer],this.K===180||this.K===0?(xt=Qt,xt>=ut.bounds.y&&xt<=ut.bounds.bottom&&(this.K===180?oe>=ut.bounds.x:oe<=ut.bounds.right)&&(ft=ut.centerX+(this.K===180?-Ct:Ct),xt<ut.bounds.y+ut.bounds.height/2?xt=ut.bounds.y-this.kc/2:xt=ut.bounds.bottom+this.kc/2,y.m(bt++,ft,Qt),y.m(bt++,ft,xt)),y.m(bt++,oe,xt)):(xt=zt,xt>=ut.bounds.x&&xt<=ut.bounds.right&&(this.K===270?ce>=ut.bounds.y:ce<=ut.bounds.bottom)&&(ft=ut.centerY+(this.K===270?-Ct:Ct),xt<ut.bounds.x+ut.bounds.width/2?xt=ut.bounds.x-this.kc/2:xt=ut.bounds.right+this.kc/2,y.m(bt++,zt,ft),y.m(bt++,xt,ft)),y.m(bt++,xt,ce)),y.m(bt++,oe,ce)):yt?(ee=Math.max(10,this.he[ut.layer]),Me=Math.max(10,this.Ld[ut.layer]),this.K===180&&oe>=ut.bounds.x?(ft=ut.bounds.x+ut.bounds.width,y.L(bt-2,ft,Qt),y.L(bt-1,ft+Me,Qt)):this.K===90&&ce<=ut.bounds.bottom?(ft=ut.bounds.y,y.L(bt-2,zt,ft),y.L(bt-1,zt,ft-ee)):this.K===270&&ce>=ut.bounds.y?(ft=ut.bounds.y+ut.bounds.height,y.L(bt-2,zt,ft),y.L(bt-1,zt,ft+Me)):this.K===0&&oe<=ut.bounds.right&&(ft=ut.bounds.x,y.L(bt-2,ft,Qt),y.L(bt-1,ft-ee,Qt))):(ee=Math.max(10,this.he[ut.layer]),Me=Math.max(10,this.Ld[ut.layer]),xt=0,this.K===180||this.K===0?((this.K===180?oe<=ut.bounds.x:oe>=ut.bounds.right)&&(xt=(this.K===0?Me:-ee)/2),y.m(bt++,oe+xt,Qt)):((this.K===270?ce<=ut.bounds.y:ce>=ut.bounds.bottom)&&(xt=(this.K===90?Me:-ee)/2),y.m(bt++,zt,ce+xt)),y.m(bt++,oe,ce)))}else{for(;ut!==null&&ut!==ft;){for(ee=Vt=null,ut=ut.destinationEdges.iterator;ut.next()&&(zt=ut.value,zt.link!==x.link||(Vt=zt.toVertex,ee=zt.fromVertex,ee.node!==null&&(ee=null),Vt.node!==null)););if(Vt===null)break;Vt!==ft&&(zt=y.i(bt-1).x,Qt=y.i(bt-1).y,oe=Vt.centerX,ce=Vt.centerY,xt?this.K===180||this.K===0?(ee!==null?ee.centerY:Qt)!==ce&&(ee=this.Ta[Vt.layer]+this.Rf.x,bt===y.firstPickIndex+1&&(ee=this.K===0?Math.max(ee,zt):Math.min(ee,zt)),y.m(bt++,ee,Qt),y.m(bt++,ee,ce)):(ee!==null?ee.centerX:zt)!==oe&&(ee=this.Ta[Vt.layer]+this.Rf.y,bt===y.firstPickIndex+1&&(ee=this.K===90?Math.max(ee,Qt):Math.min(ee,Qt)),y.m(bt++,zt,ee),y.m(bt++,oe,ee)):(ee=Math.max(10,this.he[Vt.layer]),Me=Math.max(10,this.Ld[Vt.layer]),yt?this.K===180?(y.m(bt++,oe+Me+Ct,ce),y.m(bt++,Math.max(oe+Me-Ct/2,oe),ce),y.m(bt++,oe,ce),y.m(bt++,oe,ce),y.m(bt++,Math.min(oe-ee+Ct/2,oe),ce),y.m(bt++,oe-ee-Ct,ce)):this.K===90?(y.m(bt++,oe,ce-ee-Ct),y.m(bt++,oe,Math.min(ce-ee+Ct/2,ce)),y.m(bt++,oe,ce),y.m(bt++,oe,ce),y.m(bt++,oe,Math.max(ce+Me-Ct/2,ce)),y.m(bt++,oe,ce+Me+Ct)):this.K===270?(y.m(bt++,oe,ce+Me+Ct),y.m(bt++,oe,Math.max(ce+Me-Ct/2,ce)),y.m(bt++,oe,ce),y.m(bt++,oe,ce),y.m(bt++,oe,Math.min(ce-ee+Ct/2,ce)),y.m(bt++,oe,ce-ee-Ct)):(y.m(bt++,oe-ee-Ct,ce),y.m(bt++,Math.min(oe-ee+Ct/2,oe),ce),y.m(bt++,oe,ce),y.m(bt++,oe,ce),y.m(bt++,Math.max(oe+Me-Ct/2,oe),ce),y.m(bt++,oe+Me+Ct,ce)):this.K===180?(y.m(bt++,oe+Me,ce),y.m(bt++,oe-ee,ce)):this.K===90?(y.m(bt++,oe,ce-ee),y.m(bt++,oe,ce+Me)):this.K===270?(y.m(bt++,oe,ce+Me),y.m(bt++,oe,ce-ee)):(y.m(bt++,oe-ee,ce),y.m(bt++,oe+Me,ce)))),ut=Vt}xt&&(zt=y.i(bt-1).x,Qt=y.i(bt-1).y,oe=y.i(bt).x,ce=y.i(bt).y,this.K===180||this.K===0?Qt!==ce&&(ee=this.K===0?Math.min(Math.max((oe+zt)/2,this.Ta[ft.layer]+this.Rf.x),oe):Math.max(Math.min((oe+zt)/2,this.Ta[ft.layer]+this.Rf.x),oe),y.m(bt++,ee,Qt),y.m(bt++,ee,ce)):zt!==oe&&(ee=this.K===90?Math.min(Math.max((ce+Qt)/2,this.Ta[ft.layer]+this.Rf.y),ce):Math.max(Math.min((ce+Qt)/2,this.Ta[ft.layer]+this.Rf.y),ce),y.m(bt++,zt,ee),y.m(bt++,oe,ee)))}E!==null&&yt&&4<=y.pointsCount&&(tt!==null&&(tt=lt===ar?y.getLinkPointFromPoint(b,tt,tt.ga(lr),y.i(3),!0):y.i(0),lt===ar&&(lt=y.i(2),E=y.i(3),this.direction===90||this.direction===270?(y.L(1,(tt.x+lt.x)/2,lt.y),y.L(2,E.x,(lt.y+E.y)/2)):(y.L(1,lt.x,(tt.y+lt.y)/2),y.L(2,(lt.x+E.x)/2,E.y))),tt.w()||tt.set(b.actualBounds.center),y.L(0,tt.x,tt.y)),rt!==null&&(b=ot===ar?y.getLinkPointFromPoint(z,rt,rt.ga(lr),y.i(y.pointsCount-4),!1):y.i(y.pointsCount-1),ot===ar&&(rt=y.i(y.pointsCount-3),ot=y.i(y.pointsCount-4),this.direction===90||this.direction===270?(y.L(y.pointsCount-2,(b.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,(b.y+rt.y)/2),y.L(y.pointsCount-3,(rt.x+ot.x)/2,ot.y))),b.w()||b.set(z.actualBounds.center),y.L(y.pointsCount-1,b.x,b.y))),y.zf(),x.commit()}}}this.avoidOrthogonalOverlaps()},yo.prototype.avoidOrthogonalOverlaps=function(){if(!(0>=this.linkSpacing)){for(var a=new fn,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 E=a.value;if(E!==null&&E.isOrthogonal)for(var b=2;b<E.pointsCount-3;b++){var z=E.i(b),tt=E.i(b+1);if(this.B(z.y,tt.y)&&!this.B(z.x,tt.x)){var rt=new Cd;rt.layer=Math.floor(z.y/2);var ot=E.i(0),lt=E.i(E.pointsCount-1);if(rt.first=ot.x*ot.x+ot.y,rt.jc=lt.x*lt.x+lt.y,rt.rd=Math.min(z.x,tt.x),rt.Ic=Math.max(z.x,tt.x),rt.index=b,rt.link=E,b+2<E.pointsCount){ot=E.i(b-1),lt=E.i(b+2);var ut=0;ot.y<z.y?ut=lt.y<z.y?3:z.x<tt.x?2:1:ot.y>z.y&&(ut=lt.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,E=a+1;E<x.length&&x[E].layer===z;)E++;if(1<E-a)for(z=a;z<E;){for(tt=x[z].Ic,b=a+1;b<E&&x[b].rd<tt;)tt=Math.max(tt,x[b].Ic),b++;if(tt=b-z,1<tt){for(this.zi(x,this.Js,z,z+tt),ut=1,rt=x[z].jc,ot=z;ot<b;ot++)lt=x[ot],lt.jc!==rt&&(ut++,rt=lt.jc);this.zi(x,this.Ux,z,z+tt);var ft=1;for(rt=x[z].first,ot=z;ot<b;ot++)lt=x[ot],lt.first!==rt&&(ft++,rt=lt.first);for(ot=!0,lt=ft,ut<ft?(ot=!1,lt=ut,rt=x[z].jc,this.zi(x,this.Js,z,z+tt)):rt=x[z].first,ut=0,ft=z;ft<b;ft++){var yt=x[ft];(ot?yt.first:yt.jc)!==rt&&(ut++,rt=ot?yt.first:yt.jc);var xt=yt.link;z=xt.i(yt.index),tt=xt.i(yt.index+1);var Ct=this.linkSpacing*(ut-(lt-1)/2);y++,xt.uh(),xt.L(yt.index,z.x,z.y+Ct),xt.L(yt.index+1,tt.x,tt.y+Ct),xt.zf()}}z=b}a=E}}else{for(y=0,x=[],a=a.iterator;a.next();)if(E=a.value,E!==null&&E.isOrthogonal)for(b=2;b<E.pointsCount-3;b++)z=E.i(b),tt=E.i(b+1),this.B(z.x,tt.x)&&!this.B(z.y,tt.y)&&(rt=new Cd,rt.layer=Math.floor(z.x/2),ot=E.i(0),lt=E.i(E.pointsCount-1),rt.first=ot.x+ot.y*ot.y,rt.jc=lt.x+lt.y*lt.y,rt.rd=Math.min(z.y,tt.y),rt.Ic=Math.max(z.y,tt.y),rt.index=b,rt.link=E,b+2<E.pointsCount&&(ot=E.i(b-1),lt=E.i(b+2),ut=0,ot.x<z.x?ut=lt.x<z.x?3:z.y<tt.y?2:1:ot.x>z.x&&(ut=lt.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,E=a+1;E<x.length&&x[E].layer===z;)E++;if(1<E-a)for(z=a;z<E;){for(tt=x[z].Ic,b=a+1;b<E&&x[b].rd<tt;)tt=Math.max(tt,x[b].Ic),b++;if(tt=b-z,1<tt){for(this.zi(x,this.Js,z,z+tt),ut=1,rt=x[z].jc,ot=z;ot<b;ot++)lt=x[ot],lt.jc!==rt&&(ut++,rt=lt.jc);for(this.zi(x,this.Ux,z,z+tt),ft=1,rt=x[z].first,ot=z;ot<b;ot++)lt=x[ot],lt.first!==rt&&(ft++,rt=lt.first);for(ot=!0,lt=ft,ut<ft?(ot=!1,lt=ut,rt=x[z].jc,this.zi(x,this.Js,z,z+tt)):rt=x[z].first,ut=0,ft=z;ft<b;ft++)yt=x[ft],(ot?yt.first:yt.jc)!==rt&&(ut++,rt=ot?yt.first:yt.jc),xt=yt.link,z=xt.i(yt.index),tt=xt.i(yt.index+1),Ct=this.linkSpacing*(ut-(lt-1)/2),y++,xt.uh(),xt.L(yt.index,z.x+Ct,z.y),xt.L(yt.index+1,tt.x+Ct,tt.y),xt.zf()}z=b}a=E}}}},wt=yo.prototype,wt.Vx=function(a,y){return a instanceof Cd&&y instanceof Cd&&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},wt.Ux=function(a,y){return a instanceof Cd&&y instanceof Cd&&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},wt.Js=function(a,y){return a instanceof Cd&&y instanceof Cd&&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},wt.B=function(a,y){return a-=y,-1<a&&1>a},wt.zi=function(a,y,x,E){var b=a.length,z=E-x;if(!(1>=z))if((0>x||x>=b-1)&&Gt("not in range 0 <= from < length: "+x),z===2)E=a[x],b=a[x+1],0<y(E,b)&&(a[x]=b,a[x+1]=E);else if(x===0)if(E>=b)a.sort(y);else for(x=a.slice(0,E),x.sort(y),y=0;y<E;y++)a[y]=x[y];else if(E>=b)for(E=a.slice(x),E.sort(y),y=x;y<b;y++)a[y]=E[y-x];else for(b=a.slice(x,E),b.sort(y),y=x;y<E;y++)a[y]=b[y-x]};function Pd(a,y){var x=a.tc[y];if(x>=a.He.length){for(var E=[],b=0;b<a.He.length;b++)E[b]=a.He[b];a.He=E}for(a.He[x]===void 0||a.He[x]===null?E=[]:(E=a.He[x],a.He[x]=null),a=a.fl[y],y=0;y<a.length;y++)x=a[y],E[x.index]=x;return E}function wd(a,y,x){a.He[a.tc[y]]=x}ye.Object.defineProperties(yo.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()):Gt("LayeredDigraphLayout.direction must be 0, 90, 180, or 270"))}},cycleRemoveOption:{get:function(){return this.Dk},set:function(a){this.Dk===a||a!==Sy&&a!==M0&&a!==kp||(this.Dk=a,this.C())}},layeringOption:{get:function(){return this.Zk},set:function(a){this.Zk===a||a!==k0&&a!==xy&&a!==Py||(this.Zk=a,this.C())}},initializeOption:{get:function(){return this.Qk},set:function(a){this.Qk===a||a!==b0&&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!==Ey&&a!==N0&&a!==Ly||(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 M0=new rn(yo,"CycleDepthFirst",0),Sy=new rn(yo,"CycleGreedy",1),kp=new rn(yo,"CycleFromLayers",2),k0=new rn(yo,"LayerOptimalLinkLength",0),xy=new rn(yo,"LayerLongestPathSink",1),Py=new rn(yo,"LayerLongestPathSource",2),b0=new rn(yo,"InitDepthFirstOut",0),wy=new rn(yo,"InitDepthFirstIn",1),Cy=new rn(yo,"InitNaive",2),Ey=new rn(yo,"AggressiveNone",0),N0=new rn(yo,"AggressiveLess",1),Ly=new rn(yo,"AggressiveMore",2),Ux=8;yo.className="LayeredDigraphLayout",yo.CycleDepthFirst=M0,yo.CycleGreedy=Sy,yo.CycleFromLayers=kp,yo.LayerOptimalLinkLength=k0,yo.LayerLongestPathSink=xy,yo.LayerLongestPathSource=Py,yo.InitDepthFirstOut=b0,yo.InitDepthFirstIn=wy,yo.InitNaive=Cy,yo.AggressiveNone=Ey,yo.AggressiveLess=N0,yo.AggressiveMore=Ly,yo.PackNone=0,yo.PackExpand=1,yo.PackStraighten=2,yo.PackMedian=4,yo.PackAll=15,yo.AlignNone=0,yo.AlignUpperLeft=1,yo.AlignUpperRight=2,yo.AlignLowerLeft=4,yo.AlignLowerRight=8,yo.AlignAll=15;function Cd(){this.index=this.Ic=this.rd=this.jc=this.first=this.layer=0,this.link=null,this.j=0}Cd.className="SegInfo";function tg(a){To.call(this,a)}Se(tg,To),tg.prototype.createVertex=function(){return new Nl(this)},tg.prototype.createEdge=function(){return new bp(this)},tg.className="LayeredDigraphNetwork";function Nl(a){La.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}Se(Nl,La);function ix(a,y){return a.index-y.index}function B0(a,y){if(!a.$n){for(var x=[],E=Hn(a.destinationEdgesArrayAccess),b=E.next();!b.done;b=E.next())b=b.value,b.valid&&x.push(b);a.$n=x}for(a=Hn(a.$n),x=a.next();!x.done;x=a.next())if(x=x.value,x.toVertex===y)return x;Gt("Unable to find destination edge to given vertex")}function Fy(a){if(!a.co){for(var y=[],x=Hn(a.sourceEdgesArrayAccess),E=x.next();!E.done;E=x.next())E=E.value,E.valid&&y.push(E.fromVertex);y.sort(ix),a.co=y}return a.co}function Yx(a){if(!a.ao){for(var y=[],x=Hn(a.destinationEdgesArrayAccess),E=x.next();!E.done;E=x.next())E=E.value,E.valid&&y.push(E.toVertex);y.sort(ix),a.ao=y}return a.ao}Nl.prototype.Cl=function(a){La.prototype.Cl.call(this,a),this.bo=this.co=null},Nl.prototype.Kl=function(a){La.prototype.Kl.call(this,a),this.bo=this.co=null},Nl.prototype.zl=function(a){La.prototype.zl.call(this,a),this.$n=this.ao=null},Nl.prototype.Jl=function(a){La.prototype.Jl.call(this,a),this.$n=this.ao=null},ye.Object.defineProperties(Nl.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)}}}),Nl.prototype.deleteDestinationEdge=Nl.prototype.Jl,Nl.prototype.addDestinationEdge=Nl.prototype.zl,Nl.prototype.deleteSourceEdge=Nl.prototype.Kl,Nl.prototype.addSourceEdge=Nl.prototype.Cl,Nl.className="LayeredDigraphVertex";function bp(a){nl.call(this,a),this.j=this.ia=this.Ha=!1,this.V=this.u=NaN,this.F=this.o=0}Se(bp,nl),ye.Object.defineProperties(bp.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)}}}),bp.className="LayeredDigraphEdge";function Nr(a){Ko.call(this),this.Ub=new pn,this.Wn=O0,this.ud=Qu,this.vo=_0,this.Bq=_y,this.$v=[],this.td=!0,this.Rb=R0,this.$d=new on(10,10).freeze();var y=new Yc(this);this.W=new Hl(y),this.Y=new Hl(y),this.ru=[],a&&Object.assign(this,a)}Se(Nr,Ko),Nr.prototype.cloneProtected=function(a){Ko.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)},Nr.prototype.qb=function(a){a.classType===Nr?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:Gt("Unknown enum value: "+a):Ko.prototype.qb.call(this,a)},Nr.prototype.createNetwork=function(){return new Yc(this)},Nr.prototype.makeNetwork=function(a){function y(E){if(E instanceof $n)return!E.isLinkLabel&&E.category!=="Comment";if(E instanceof Nn){var b=E.fromNode;return b===null||b.isLinkLabel||b.category==="Comment"?!1:(E=E.toNode,!(E===null||E.isLinkLabel||E.category==="Comment"))}return!1}var x=this.createNetwork();return a instanceof ke?(x.lg(a.nodes,!0,y),x.lg(a.links,!0,y)):a instanceof er?x.lg(a.memberParts,!1,y):x.lg(a.iterator,!1,y),x},Nr.prototype.doLayout=function(a){this.network===null&&(this.network=this.makeNetwork(a)),this.arrangement!==j0&&(this.arrangementOrigin=this.initialOrigin(this.arrangementOrigin));var y=this.diagram;if(y===null&&a instanceof ke&&(y=a),this.path===O0&&y!==null?this.ud=y.isTreePathToChildren?Qu:Kc:this.ud=this.path===O0?Qu: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 pn,y=this.Ub.iterator;y.next();){var x=y.value;x instanceof $n?(x=this.network.ki(x),x!==null&&a.add(x)):x instanceof Hl&&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,My(this,y));for(y=this.network.vertexes,a=null;a=Xx(y),0<a.count;)y=rx(this,a),y!==null&&this.Ub.add(y),y.initialized=!0,My(this,y),y=a;for(a=this.Ub.iterator;a.next();)y=a.value,y instanceof Hl&&ax(this,y);for(a=this.Ub.iterator;a.next();)y=a.value,y instanceof Hl&&sx(this,y);for(a=this.Ub.iterator;a.next();)y=a.value,y instanceof Hl&&lx(this,y);if(this.Cu(),this.layerStyle===z0){for(a=[],y=this.network.vertexes.iterator;y.next();){x=y.value;var E=x.parent;E===null&&(E=x),E=E.angle===0||E.angle===180;var b=a[x.level];b===void 0&&(b=0),a[x.level]=Math.max(b,E?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,E=x.parent,E===null&&(E=x),E.angle===0||E.angle===180?(E.angle===180&&(x.focusX+=a[x.level]-x.width),x.width=a[x.level]):(E.angle===270&&(x.focusY+=a[x.level]-x.height),x.height=a[x.level])}else if(this.layerStyle===Ry)for(a=this.network.vertexes.iterator;a.next();){for(y=a.value,x=y.angle===0||y.angle===180,E=-1,b=0;b<y.children.length;b++){var z=y.children[b];E=Math.max(E,x?z.width:z.height)}if(0<=E)for(b=0;b<y.children.length;b++)z=y.children[b],x?(y.angle===180&&(z.focusX+=E-z.width),z.width=E):(y.angle===270&&(z.focusY+=E-z.height),z.height=E)}for(a=this.Ub.iterator;a.next();)y=a.value,y instanceof Hl&&this.layoutTree(y);this.arrangeTrees(),this.updateParts()}this.network=null,this.Ub=new pn,this.isValidLayout=!0};function Xx(a){var y=new pn;for(a=a.iterator;a.next();){var x=a.value;x.initialized||y.add(x)}return y}Nr.prototype.findRoots=function(){for(var a=this.network.vertexes,y=a.iterator;y.next();){var x=y.value;switch(this.ud){case Qu:x.sourceEdges.count===0&&this.Ub.add(x);break;case Kc:x.destinationEdges.count===0&&this.Ub.add(x);break;default:Gt("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,E=null;for(y=y.iterator;y.next();){var b=y.value;switch(a.ud){case Qu:b.sourceEdges.count<x&&(x=b.sourceEdges.count,E=b);break;case Kc:b.destinationEdges.count<x&&(x=b.destinationEdges.count,E=b);break;default:Gt("Unhandled path value "+a.ud.toString())}}return E}function My(a,y){if(y!==null){switch(a.ud){case Qu:if(0<y.destinationEdges.count){for(var x=new fn,E=y.destinationVertexes;E.next();){var b=E.value;ox(a,y,b)&&x.add(b)}0<x.count&&(y.children=x.Fa())}break;case Kc:if(0<y.sourceEdges.count){for(x=new fn,E=y.sourceVertexes;E.next();)b=E.value,ox(a,y,b)&&x.add(b);0<x.count&&(y.children=x.Fa())}break;default:Gt("Unhandled path value"+a.ud.toString())}for(x=y.children,E=x.length,b=0;b<E;b++){var z=x[b];z.initialized=!0,z.level=y.level+1,z.parent=y,a.Ub.remove(z)}for(y=0;y<E;y++)My(a,x[y])}}function ox(a,y,x){if(x.initialized){if(y===null)var E=!1;else{for(E=y.parent;E!==null&&E!==x;)E=E.parent;E=E===x}if(E||x.level>y.level)return!1;a.removeChild(x.parent,x)}return!0}Nr.prototype.removeChild=function(a,y){if(a!==null&&y!==null){for(var x=a.children,E=0,b=0;b<x.length;b++)x[b]===y&&E++;if(0<E){E=Array(x.length-E);for(var z=b=0;z<x.length;z++)x[z]!==y&&(E[b++]=x[z]);a.children=E}}};function ax(a,y){if(y!==null){a.initializeTreeVertexValues(y),y.alignment===th&&a.sortTreeVertexChildren(y);for(var x=0,E=y.childrenCount,b=0,z=y.children,tt=z.length,rt=0;rt<tt;rt++){var ot=z[rt];ax(a,ot),x+=ot.descendantCount+1,E=Math.max(E,ot.maxChildrenCount),b=Math.max(b,ot.maxGenerationCount)}y.descendantCount=x,y.maxChildrenCount=E,y.maxGenerationCount=0<E?b+1:0}}function Jx(a,y){switch(a.vo){default:case _0: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 Dy:return y.parent!==null?y.parent.parent!==null?y.parent.parent:a.Y:a.W;case Ty:var x=!0;if(y.childrenCount===0)x=!1;else for(var E=y.children,b=E.length,z=0;z<b;z++)if(0<E[z].childrenCount){x=!1;break}return x&&y.parent!==null?a.Y:y.parent!==null?y.parent:a.W}}Nr.prototype.initializeTreeVertexValues=function(a){if(a.copyInheritedPropertiesFrom(Jx(this,a)),a.parent!==null&&a.parent.alignment===th){for(var y=a.angle,x=a.parent.children,E=0;E<x.length&&a!==x[E];)E++;E%2===0?E!==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 sx(a,y){if(y!==null){a.assignTreeVertexValues(y),y=y.children;for(var x=y.length,E=0;E<x;E++)sx(a,y[E])}}Nr.prototype.assignTreeVertexValues=function(){};function lx(a,y){if(y!==null){y.alignment!==th&&a.sortTreeVertexChildren(y),y=y.children;for(var x=y.length,E=0;E<x;E++)lx(a,y[E])}}Nr.prototype.sortTreeVertexChildren=function(a){switch(a.sorting){case eg:break;case Bp:a.children.reverse();break;case Ap:a.children.sort(a.comparer);break;case Tp:a.children.sort(a.comparer),a.children.reverse();break;default:Gt("Unhandled sorting value "+a.sorting.toString())}},Nr.prototype.Cu=function(){if(this.comments)for(var a=this.network.vertexes.iterator;a.next();)this.addComments(a.value)},Nr.prototype.addComments=function(a){var y=a.angle,x=a.parent,E=0,b=!1;x!==null&&(E=x.angle,b=x.alignment,b=Ed(b)),y=y===90||y===270,E=E===90||E===270,x=a.childrenCount===0;var z=0,tt=0,rt=0,ot=a.commentSpacing;if(a.node!==null)for(var lt=a.node.Mu();lt.next();){var ut=lt.value;ut.category==="Comment"&&ut.canLayout()&&(a.comments===null&&(a.comments=[]),a.comments.push(ut),ut.Va(),ut=ut.measuredBounds,y&&!x||!b&&!E&&x||b&&E&&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||!b&&!E&&x||b&&E&&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)),b=Be.allocAt(0,0,a.bounds.width+z,a.bounds.height+tt),a.bounds=b,Be.free(b))};function Ed(a){return a===Zh||a===th||a===Gh||a===gh}function Np(a){return a===Zh||a===th}function ky(a){var y=a.parent;if(y!==null){var x=y.alignment;if(Ed(x)){if(Np(x)){for(y=y.children,x=0;x<y.length&&a!==y[x];)x++;return x%2===0}if(x===Gh)return!0}}return!1}Nr.prototype.layoutComments=function(a){if(a.comments!==null){var y=a.node.measuredBounds,x=a.parent,E=a.angle,b=0,z=!1;x!==null&&(b=x.angle,z=x.alignment,z=Ed(z)),E=E===90||E===270,x=b===90||b===270;for(var tt=a.childrenCount===0,rt=ky(a),ot=0,lt=a.comments,ut=lt.length,ft=At.alloc(),yt=0;yt<ut;yt++){var xt=lt[yt],Ct=xt.measuredBounds;if(E&&!tt||!z&&!x&&tt||z&&x&&tt){if(135<b&&!z||x&&rt)if(0<=a.commentMargin)for(ft.h(a.bounds.x-a.commentMargin-Ct.width,a.bounds.y+ot),xt.move(ft),xt=xt.Sd();xt.next();){var bt=xt.value;bt.fromSpot=Qa,bt.toSpot=Ba}else for(ft.h(a.bounds.x+2*a.focus.x-a.commentMargin,a.bounds.y+ot),xt.move(ft),xt=xt.Sd();xt.next();)bt=xt.value,bt.fromSpot=Ba,bt.toSpot=Qa;else if(0<=a.commentMargin)for(ft.h(a.bounds.x+2*a.focus.x+a.commentMargin,a.bounds.y+ot),xt.move(ft),xt=xt.Sd();xt.next();)bt=xt.value,bt.fromSpot=Ba,bt.toSpot=Qa;else for(ft.h(a.bounds.x+a.commentMargin-Ct.width,a.bounds.y+ot),xt.move(ft),xt=xt.Sd();xt.next();)bt=xt.value,bt.fromSpot=Qa,bt.toSpot=Ba;ot=0<=a.commentSpacing?ot+(Ct.height+a.commentSpacing):ot+(a.commentSpacing-Ct.height)}else{if(135<b&&!z||!x&&rt)if(0<=a.commentMargin)for(ft.h(a.bounds.x+ot,a.bounds.y-a.commentMargin-Ct.height),xt.move(ft),xt=xt.Sd();xt.next();)bt=xt.value,bt.fromSpot=Ja,bt.toSpot=Ga;else for(ft.h(a.bounds.x+ot,a.bounds.y+2*a.focus.y-a.commentMargin),xt.move(ft),xt=xt.Sd();xt.next();)bt=xt.value,bt.fromSpot=Ga,bt.toSpot=Ja;else if(0<=a.commentMargin)for(ft.h(a.bounds.x+ot,a.bounds.y+2*a.focus.y+a.commentMargin),xt.move(ft),xt=xt.Sd();xt.next();)bt=xt.value,bt.fromSpot=Ga,bt.toSpot=Ja;else for(ft.h(a.bounds.x+ot,a.bounds.y+a.commentMargin-Ct.height),xt.move(ft),xt=xt.Sd();xt.next();)bt=xt.value,bt.fromSpot=Ja,bt.toSpot=Ga;ot=0<=a.commentSpacing?ot+(Ct.width+a.commentSpacing):ot+(a.commentSpacing-Ct.width)}}if(At.free(ft),y=ot-a.commentSpacing-(E?y.height:y.width),this.ud===Qu)for(a=a.destinationEdges;a.next();)b=a.value.link,b===null||b.isAvoiding||(b.fromEndSegmentLength=0<y?y:NaN);else for(a=a.sourceEdges;a.next();)b=a.value.link,b===null||b.isAvoiding||(b.toEndSegmentLength=0<y?y:NaN)}},Nr.prototype.layoutTree=function(a){if(a!==null){for(var y=a.children,x=y.length,E=0;E<x;E++)this.layoutTree(y[E]);switch(a.compaction){case I0:ux(this,a);break;case Dp:if(a.alignment===th)ux(this,a);else if(a.childrenCount===0)E=a.parent,x=!1,y=0,E!==null&&(y=E.angle,x=E.alignment,x=Ed(x)),E=ky(a),a.S.h(0,0),a.Da.h(a.width,a.height),a.parent===null||a.comments===null||(y!==180&&y!==270||x)&&!E?a.la.h(0,0):y===180&&!x||(y===90||y===270)&&E?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 b=su(a);y=b===90||b===270;var z=0,tt=a.children,rt=tt.length;for(x=0;x<rt;x++)E=tt[x],z=Math.max(z,y?E.Da.width:E.Da.height);var ot=a.alignment;E=ot===$u;var lt=ot===qu,ut=Ed(ot),ft=Math.max(0,a.breadthLimit);x=this.computeLayerSpacing(a);var yt=a.nodeSpacing,xt=this.computeNodeIndent(a),Ct=a.rowSpacing,bt=0;(E||lt||a.hm||a.im&&a.maxGenerationCount===1)&&(bt=Math.max(0,a.rowIndent)),E=a.width;var Vt=a.height,zt=0,Qt=0,ee=0,oe=null,ce=null,Me=0,Wn=0,di=0,oi=0,kn=0,en=0,qi=0,Yi=0;if(ut&&!Np(ot)&&135<b&&tt.reverse(),Np(ot))if(1<rt)for(var oo=0;oo<rt;oo++)oo%2===0&&oo!==rt-1&&(Yi=Math.max(Yi,y?tt[oo].Da.width:tt[oo].Da.height));else rt===1&&(Yi=y?tt[0].Da.width:tt[0].Da.height);if(ut){switch(ot){case Zh:Qt=135>b?hx(this,a,tt,Yi,zt,Qt):dx(this,a,tt,Yi,zt,Qt),Yi=Qt.x,zt=Qt.width,Qt=Qt.height;break;case Gh:for(oe=0;oe<rt;oe++)ce=tt[oe],ft=ce.Da,ee=en===0?0:Ct,y?(ce.S.h(z-ft.width,oi+ee),zt=Math.max(zt,ft.width),Qt=Math.max(Qt,oi+ee+ft.height),oi+=ee+ft.height):(ce.S.h(di+ee,z-ft.height),zt=Math.max(zt,di+ee+ft.width),Qt=Math.max(Qt,ft.height),di+=ee+ft.width),en++;break;case gh:for(oe=0;oe<rt;oe++)ce=tt[oe],z=ce.Da,ft=en===0?0:Ct,y?(ce.S.h(yt/2+a.focus.x,oi+ft),zt=Math.max(zt,z.width),Qt=Math.max(Qt,oi+ft+z.height),oi+=ft+z.height):(ce.S.h(di+ft,yt/2+a.focus.y),zt=Math.max(zt,di+ft+z.width),Qt=Math.max(Qt,z.height),di+=ft+z.width),en++}oe=Vs(this,2),ce=Vs(this,2),y?(oe[0].h(0,0),oe[1].h(0,Qt),ce[0].h(zt,0)):(oe[0].h(0,0),oe[1].h(zt,0),ce[0].h(0,Qt)),ce[1].h(zt,Qt)}else for(oo=0;oo<rt;oo++){var ko=tt[oo],ka=ko.Da;if(y){0<ft&&0<en&&di+yt+ka.width>ft&&(di<z&&oc(a,ot,z-di,0,qi,oo-1),kn++,en=0,qi=oo,ee=Qt,di=0,oi=135<b?-Qt-Ct:Qt+Ct),T0(this,ko,0,oi);var Ia=0;if(en===0)oe=ko.Yo,ce=ko.kp,Me=ka.width,Wn=ka.height,(oe===null||ce===null||b!==su(ko))&&(oe=Vs(this,2),ce=Vs(this,2),oe[0].h(0,0),oe[1].h(0,Wn),ce[0].h(Me,0),ce[1].h(Me,Wn));else{var cs=Yn();Wn=cx(this,a,ko,oe,ce,Me,Wn,cs),Ia=Wn.x,oe=cs[0],ce=cs[1],Me=Wn.width,Wn=Wn.height,si(cs),di<ka.width&&0>Ia&&(Vc(a,-Ia,0,qi,oo-1),D0(oe,-Ia,0),D0(ce,-Ia,0),Ia=0)}ko.S.h(Ia,oi),zt=Math.max(zt,Me),Qt=Math.max(Qt,ee+(kn===0?0:Ct)+ka.height),di=Me}else 0<ft&&0<en&&oi+yt+ka.height>ft&&(oi<z&&oc(a,ot,0,z-oi,qi,oo-1),kn++,en=0,qi=oo,ee=zt,oi=0,di=135<b?-zt-Ct:zt+Ct),T0(this,ko,di,0),Ia=0,en===0?(oe=ko.Yo,ce=ko.kp,Me=ka.width,Wn=ka.height,(oe===null||ce===null||b!==su(ko))&&(oe=Vs(this,2),ce=Vs(this,2),oe[0].h(0,0),oe[1].h(Me,0),ce[0].h(0,Wn),ce[1].h(Me,Wn))):(cs=Yn(),Wn=cx(this,a,ko,oe,ce,Me,Wn,cs),Ia=Wn.x,oe=cs[0],ce=cs[1],Me=Wn.width,Wn=Wn.height,si(cs),oi<ka.height&&0>Ia&&(Vc(a,0,-Ia,qi,oo-1),D0(oe,0,-Ia),D0(ce,0,-Ia),Ia=0)),ko.S.h(di,Ia),Qt=Math.max(Qt,Wn),zt=Math.max(zt,ee+(kn===0?0:Ct)+ka.width),oi=Wn;en++}switch(0<kn&&(y?(Qt+=Math.max(0,x),di<zt&&oc(a,ot,zt-di,0,qi,rt-1),0<bt&&(lt||Vc(a,bt,0,0,rt-1),zt+=bt)):(zt+=Math.max(0,x),oi<Qt&&oc(a,ot,0,Qt-oi,qi,rt-1),0<bt&&(lt||Vc(a,0,bt,0,rt-1),Qt+=bt))),bt=lt=0,ot){case ng:y?lt+=zt/2-a.focus.x-xt/2:bt+=Qt/2-a.focus.y-xt/2;break;case Uc:0<kn?y?lt+=zt/2-a.focus.x-xt/2:bt+=Qt/2-a.focus.y-xt/2:y?(Yi=tt[0].S.x+tt[0].la.x,lt+=Yi+(tt[rt-1].S.x+tt[rt-1].la.x+2*tt[rt-1].focus.x-Yi)/2-a.focus.x-xt/2):(Yi=tt[0].S.y+tt[0].la.y,bt+=Yi+(tt[rt-1].S.y+tt[rt-1].la.y+2*tt[rt-1].focus.y-Yi)/2-a.focus.y-xt/2);break;case $u:y?(lt-=xt,zt+=xt):(bt-=xt,Qt+=xt);break;case qu:y?(lt+=zt-a.width+xt,zt+=xt):(bt+=Qt-a.height+xt,Qt+=xt);break;case Zh:y?1<rt?lt+=Yi+yt/2-a.focus.x:lt+=tt[0].focus.x-a.focus.x+tt[0].la.x:1<rt?bt+=Yi+yt/2-a.focus.y:bt+=tt[0].focus.y-a.focus.y+tt[0].la.y;break;case Gh:y?lt+=zt+yt/2-a.focus.x:bt+=Qt+yt/2-a.focus.y;break;case gh:break;default:Qt=this.customAlignment(a,lt,bt,zt,Qt),lt=Qt[0],bt=Qt[1],zt=Qt[2],Qt=Qt[3]}for(xt=0;xt<rt;xt++)Yi=tt[xt],y?Yi.S.h(Yi.S.x+Yi.la.x-lt,Yi.S.y+(135<b?(ut?-Qt:-Yi.Da.height)+Yi.la.y-x:Vt+x+Yi.la.y)):Yi.S.h(Yi.S.x+(135<b?(ut?-zt:-Yi.Da.width)+Yi.la.x-x:E+x+Yi.la.x),Yi.S.y+Yi.la.y-bt);if(rt=tt=0,ut?y?(zt=by(a,zt,lt),0>lt&&(lt=0),135<b&&(bt+=Qt+x),Qt+=Vt+x,ot===gh&&(tt+=yt/2+a.focus.x),rt+=Vt+x):(135<b&&(lt+=zt+x),zt+=E+x,Qt=Ny(a,Qt,bt),0>bt&&(bt=0),ot===gh&&(rt+=yt/2+a.focus.y),tt+=E+x):y?(a.comments===null?E>zt&&(zt=By(ot,E-zt,0),tt=zt.x,rt=zt.y,zt=E,lt=0):zt=by(a,zt,lt),0>lt&&(tt-=lt,lt=0),135<b&&(bt+=Qt+x),Qt=Math.max(Math.max(Qt,Vt),Qt+Vt+x),rt+=Vt+x):(135<b&&(lt+=zt+x),zt=Math.max(Math.max(zt,E),zt+E+x),a.comments===null?Vt>Qt&&(Qt=By(ot,0,Vt-Qt),tt=Qt.x,rt=Qt.y,Qt=Vt,bt=0):Qt=Ny(a,Qt,bt),0>bt&&(rt-=bt,bt=0),tt+=E+x),0<kn)b=Vs(this,4),kn=Vs(this,4),y?(b[2].h(0,Vt+x),b[3].h(b[2].x,Qt),kn[2].h(zt,b[2].y),kn[3].h(kn[2].x,b[3].y)):(b[2].h(E+x,0),b[3].h(zt,b[2].y),kn[2].h(b[2].x,Qt),kn[3].h(b[3].x,kn[2].y));else{for(b=Vs(this,oe.length+2),kn=Vs(this,ce.length+2),ot=0;ot<oe.length;ot++)ut=oe[ot],b[ot+2].h(ut.x+tt,ut.y+rt);for(ot=0;ot<ce.length;ot++)ut=ce[ot],kn[ot+2].h(ut.x+tt,ut.y+rt)}y?(b[0].h(lt,0),b[1].h(b[0].x,Vt),b[2].y<b[1].y&&(b[2].x>b[0].x?b[2].assign(b[1]):b[1].assign(b[2])),b[3].y<b[2].y&&(b[3].x>b[0].x?b[3].assign(b[2]):b[2].assign(b[3])),kn[0].h(lt+E,0),kn[1].h(kn[0].x,Vt),kn[2].y<kn[1].y&&(kn[2].x<kn[0].x?kn[2].assign(kn[1]):kn[1].assign(kn[2])),kn[3].y<kn[2].y&&(kn[3].x<kn[0].x?kn[3].assign(kn[2]):kn[2].assign(kn[3])),b[2].y-=x/2,kn[2].y-=x/2):(b[0].h(0,bt),b[1].h(E,b[0].y),b[2].x<b[1].x&&(b[2].y>b[0].y?b[2].assign(b[1]):b[1].assign(b[2])),b[3].x<b[2].x&&(b[3].y>b[0].y?b[3].assign(b[2]):b[2].assign(b[3])),kn[0].h(0,bt+Vt),kn[1].h(E,kn[0].y),kn[2].x<kn[1].x&&(kn[2].y<kn[0].y?kn[2].assign(kn[1]):kn[1].assign(kn[2])),kn[3].x<kn[2].x&&(kn[3].y<kn[0].y?kn[3].assign(kn[2]):kn[2].assign(kn[3])),b[2].x-=x/2,kn[2].x-=x/2),Su(this,oe),Su(this,ce),a.Yo=b,a.kp=kn,a.la.h(lt,bt),a.Da.h(zt,Qt)}break;default:Gt("Unhandled compaction value "+a.compaction.toString())}}};function ux(a,y){if(y.childrenCount===0){var x=!1,E=0;y.parent!==null&&(E=y.parent.angle,x=y.parent.alignment,x=Ed(x));var b=ky(y);y.S.h(0,0),y.Da.h(y.width,y.height),y.parent===null||y.comments===null||(E!==180&&E!==270||x)&&!b?y.la.h(0,0):E===180&&!x||(E===90||E===270)&&b?y.la.h(y.width-2*y.focus.x,0):y.la.h(0,y.height-2*y.focus.y)}else{E=su(y),x=E===90||E===270;var z=0;b=y.children;for(var tt=b.length,rt=0;rt<tt;rt++){var ot=b[rt];z=Math.max(z,x?ot.Da.width:ot.Da.height)}var lt=y.alignment,ut=lt===$u,ft=lt===qu;rt=Ed(lt);var yt=Math.max(0,y.breadthLimit);ot=a.computeLayerSpacing(y);var xt=y.nodeSpacing,Ct=a.computeNodeIndent(y),bt=ut||ft?0:Ct/2,Vt=y.rowSpacing,zt=0;(ut||ft||y.hm||y.im&&y.maxGenerationCount===1)&&(zt=Math.max(0,y.rowIndent)),ut=y.width;var Qt=y.height,ee=0,oe=0,ce=0,Me=0,Wn=0,di=0,oi=0,kn=0,en=0,qi=0;if(rt&&!Np(lt)&&135<E&&b.reverse(),Np(lt))if(1<tt)for(var Yi=0;Yi<tt;Yi++){var oo=b[Yi],ko=oo.Da;Yi%2===0&&Yi!==tt-1?en=Math.max(en,(x?ko.width:ko.height)+a.computeBusNodeSpacing(oo)-xt):Yi%2!==0&&(qi=Math.max(qi,(x?ko.width:ko.height)+a.computeBusNodeSpacing(oo)-xt))}else tt===1&&(en=x?b[0].Da.width:b[0].Da.height);if(rt)switch(lt){case Zh:case th:oe=135>E?hx(a,y,b,en,ee,oe):dx(a,y,b,en,ee,oe),en=oe.x,ee=oe.width,oe=oe.height;break;case Gh:for(yt=0;yt<tt;yt++)bt=b[yt],ce=bt.Da,qi=oi===0?0:Vt,x?(bt.S.h(z-ce.width,Wn+qi),ee=Math.max(ee,ce.width),oe=Math.max(oe,Wn+qi+ce.height),Wn+=qi+ce.height):(bt.S.h(Me+qi,z-ce.height),ee=Math.max(ee,Me+qi+ce.width),oe=Math.max(oe,ce.height),Me+=qi+ce.width),oi++;break;case gh:for(z=0;z<tt;z++)yt=b[z],bt=yt.Da,ce=oi===0?0:Vt,x?(yt.S.h(xt/2+y.focus.x,Wn+ce),ee=Math.max(ee,bt.width),oe=Math.max(oe,Wn+ce+bt.height),Wn+=ce+bt.height):(yt.S.h(Me+ce,xt/2+y.focus.y),ee=Math.max(ee,Me+ce+bt.width),oe=Math.max(oe,bt.height),Me+=ce+bt.width),oi++}else for(qi=0;qi<tt;qi++)Yi=b[qi],oo=Yi.Da,x?(0<yt&&0<oi&&Me+xt+oo.width>yt&&(Me<z&&oc(y,lt,z-Me,0,kn,qi-1),di++,oi=0,kn=qi,ce=oe,Me=0,Wn=135<E?-oe-Vt:oe+Vt),ko=oi===0?bt:xt,T0(a,Yi,0,Wn),Yi.S.h(Me+ko,Wn),ee=Math.max(ee,Me+ko+oo.width),oe=Math.max(oe,ce+(di===0?0:Vt)+oo.height),Me+=ko+oo.width):(0<yt&&0<oi&&Wn+xt+oo.height>yt&&(Wn<z&&oc(y,lt,0,z-Wn,kn,qi-1),di++,oi=0,kn=qi,ce=ee,Wn=0,Me=135<E?-ee-Vt:ee+Vt),ko=oi===0?bt:xt,T0(a,Yi,Me,0),Yi.S.h(Me,Wn+ko),oe=Math.max(oe,Wn+ko+oo.height),ee=Math.max(ee,ce+(di===0?0:Vt)+oo.width),Wn+=ko+oo.height),oi++;switch(0<di&&(x?(oe+=Math.max(0,ot),Me<ee&&oc(y,lt,ee-Me,0,kn,tt-1),0<zt&&(ft||Vc(y,zt,0,0,tt-1),ee+=zt)):(ee+=Math.max(0,ot),Wn<oe&&oc(y,lt,0,oe-Wn,kn,tt-1),0<zt&&(ft||Vc(y,0,zt,0,tt-1),oe+=zt))),zt=ft=0,lt){case ng:x?ft+=ee/2-y.focus.x-Ct/2:zt+=oe/2-y.focus.y-Ct/2;break;case Uc:0<di?x?ft+=ee/2-y.focus.x-Ct/2:zt+=oe/2-y.focus.y-Ct/2:x?(a=b[0].S.x+b[0].la.x,ft+=a+(b[tt-1].S.x+b[tt-1].la.x+2*b[tt-1].focus.x-a)/2-y.focus.x-Ct/2):(a=b[0].S.y+b[0].la.y,zt+=a+(b[tt-1].S.y+b[tt-1].la.y+2*b[tt-1].focus.y-a)/2-y.focus.y-Ct/2);break;case $u:x?(ft-=Ct,ee+=Ct):(zt-=Ct,oe+=Ct);break;case qu:x?(ft+=ee-y.width+Ct,ee+=Ct):(zt+=oe-y.height+Ct,oe+=Ct);break;case Zh:case th:x?1<tt?ft+=en+xt/2-y.focus.x:ft+=b[0].focus.x-y.focus.x+b[0].la.x:1<tt?zt+=en+xt/2-y.focus.y:zt+=b[0].focus.y-y.focus.y+b[0].la.y;break;case Gh:x?ft+=ee+xt/2-y.focus.x:zt+=oe+xt/2-y.focus.y;break;case gh:break;default:a=a.customAlignment(y,ft,zt,ee,oe),ft=a[0],zt=a[1],ee=a[2],oe=a[3]}for(a=0;a<tt;a++)Ct=b[a],x?Ct.S.h(Ct.S.x+Ct.la.x-ft,Ct.S.y+(135<E?(rt?-oe:-Ct.Da.height)+Ct.la.y-ot:Qt+ot+Ct.la.y)):Ct.S.h(Ct.S.x+(135<E?(rt?-ee:-Ct.Da.width)+Ct.la.x-ot:ut+ot+Ct.la.x),Ct.S.y+Ct.la.y-zt);x?(ee=by(y,ee,ft),0>ft&&(ft=0),135<E&&(zt+=oe+ot),oe=Math.max(Math.max(oe,Qt),oe+Qt+ot)):(135<E&&(ft+=ee+ot),ee=Math.max(Math.max(ee,ut),ee+ut+ot),oe=Ny(y,oe,zt),0>zt&&(zt=0)),y.la.h(ft,zt),y.Da.h(ee,oe)}}Nr.prototype.customAlignment=function(a,y,x,E,b){return[y,x,E,b]};function hx(a,y,x,E,b,z){var tt=x.length;if(tt===0)return new Be(E,0,b,z);if(tt===1)return y=x[0],b=y.Da.width,z=y.Da.height,new Be(E,0,b,z);for(var rt=y.nodeSpacing,ot=y.rowSpacing,lt=su(y)===90,ut=0,ft=0,yt=0,xt=0;xt<tt;xt++)if(!(xt%2!==0||1<tt&&xt===tt-1)){var Ct=x[xt],bt=Ct.Da,Vt=ut===0?0:ot;if(lt){var zt=a.computeBusNodeSpacing(Ct)-rt;Ct.S.h(E-(bt.width+zt),yt+Vt),b=Math.max(b,bt.width+zt),z=Math.max(z,yt+Vt+bt.height),yt+=Vt+bt.height}else zt=a.computeBusNodeSpacing(Ct)-rt,Ct.S.h(ft+Vt,E-(bt.height+zt)),z=Math.max(z,bt.height+zt),b=Math.max(b,ft+Vt+bt.width),ft+=Vt+bt.width;ut++}for(ut=0,Ct=ft,xt=yt,lt?(ft=E+rt,yt=0):(ft=0,yt=E+rt),bt=0;bt<tt;bt++)if(bt%2!==0){Vt=x[bt],zt=Vt.Da;var Qt=ut===0?0:ot;if(lt){var ee=a.computeBusNodeSpacing(Vt)-rt;Vt.S.h(ft+ee,yt+Qt),b=Math.max(b,ft+zt.width+ee),z=Math.max(z,yt+Qt+zt.height),yt+=Qt+zt.height}else ee=a.computeBusNodeSpacing(Vt)-rt,Vt.S.h(ft+Qt,yt+ee),b=Math.max(b,ft+Qt+zt.width),z=Math.max(z,yt+zt.height+ee),ft+=Qt+zt.width;ut++}return 1<tt&&tt%2===1&&(x=x[tt-1],tt=x.Da,a=a.computeBusLastRowSpacing(x,lt?Math.max(Math.abs(xt),Math.abs(yt)):Math.max(Math.abs(Ct),Math.abs(ft))),lt?(x.S.h(E+rt/2-x.focus.x-x.la.x,z+a),lt=E+rt/2-x.focus.x-x.la.x,b=Math.max(b,lt+tt.width),0>lt&&(b-=lt),z=Math.max(z,Math.max(xt,yt)+a+tt.height),0>x.S.x&&(E=A0(y,x.S.x,!1,E,rt))):(x.S.h(b+a,E+rt/2-x.focus.y-x.la.y),b=Math.max(b,Math.max(Ct,ft)+a+tt.width),yt=E+rt/2-x.focus.y-x.la.y,z=Math.max(z,yt+tt.height),0>yt&&(z-=yt),0>x.S.y&&(E=A0(y,x.S.y,!0,E,rt)))),new Be(E,0,b,z)}function dx(a,y,x,E,b,z){var tt=x.length;if(tt===0)return new Be(E,0,b,z);if(tt===1)return x=x[0],b=x.Da.width,z=x.Da.height,new Be(E,0,b,z);for(var rt=y.nodeSpacing,ot=y.rowSpacing,lt=su(y)===270,ut=0,ft=0,yt=0,xt=0;xt<tt;xt++)if(!(xt%2!==0||1<tt&&xt===tt-1)){var Ct=x[xt],bt=Ct.Da,Vt=ut===0?0:ot;if(lt){var zt=a.computeBusNodeSpacing(Ct)-rt;yt-=Vt+bt.height,Ct.S.h(E-(bt.width+zt),yt),b=Math.max(b,bt.width+zt),z=Math.max(z,Math.abs(yt))}else zt=a.computeBusNodeSpacing(Ct)-rt,ft-=Vt+bt.width,Ct.S.h(ft,E-(bt.height+zt)),z=Math.max(z,bt.height+zt),b=Math.max(b,Math.abs(ft));ut++}for(ut=0,Ct=ft,xt=yt,lt?(ft=E+rt,yt=0):(ft=0,yt=E+rt),bt=0;bt<tt;bt++)if(bt%2!==0){Vt=x[bt],zt=Vt.Da;var Qt=ut===0?0:ot;if(lt){var ee=a.computeBusNodeSpacing(Vt)-rt;yt-=Qt+zt.height,Vt.S.h(ft+ee,yt),b=Math.max(b,ft+zt.width+ee),z=Math.max(z,Math.abs(yt))}else ee=a.computeBusNodeSpacing(Vt)-rt,ft-=Qt+zt.width,Vt.S.h(ft,yt+ee),z=Math.max(z,yt+zt.height+ee),b=Math.max(b,Math.abs(ft));ut++}for(1<tt&&tt%2===1&&(ot=x[tt-1],ut=ot.Da,a=a.computeBusLastRowSpacing(ot,lt?Math.max(Math.abs(xt),Math.abs(yt)):Math.max(Math.abs(Ct),Math.abs(ft))),lt?(ot.S.h(E+rt/2-ot.focus.x-ot.la.x,-z-ut.height-a),ft=E+rt/2-ot.focus.x-ot.la.x,b=Math.max(b,ft+ut.width),0>ft&&(b-=ft),z=Math.max(z,Math.abs(Math.min(xt,yt))+a+ut.height),0>ot.S.x&&(E=A0(y,ot.S.x,!1,E,rt))):(ot.S.h(-b-ut.width-a,E+rt/2-ot.focus.y-ot.la.y),b=Math.max(b,Math.abs(Math.min(Ct,ft))+a+ut.width),yt=E+rt/2-ot.focus.y-ot.la.y,z=Math.max(z,yt+ut.height),0>yt&&(z-=yt),0>ot.S.y&&(E=A0(y,ot.S.y,!0,E,rt)))),y=0;y<tt;y++)rt=x[y],lt?rt.S.h(rt.S.x,rt.S.y+z):rt.S.h(rt.S.x+b,rt.S.y);return new Be(E,0,b,z)}Nr.prototype.computeBusNodeSpacing=function(a){return a.parent===null?0:a.parent.nodeSpacing},Nr.prototype.computeBusLastRowSpacing=function(a){return a.parent===null?0:a.parent.rowSpacing};function A0(a,y,x,E,b){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(E,x?y.la.y+y.focus.y-b/2:y.la.x+y.focus.x-b/2)}function by(a,y,x){switch(a.alignment){case Uc:case ng:return x+a.width>y&&(y=x+a.width),0>x&&(y-=x),y;case $u:return a.width>y?a.width:y;case qu:return 2*a.focus.x>y?a.width:y+a.width-2*a.focus.x;case Zh:case th:return Math.max(a.width,Math.max(y,x+a.width)-Math.min(0,x));case Gh:return a.width-a.focus.x+a.nodeSpacing/2+y;case gh:return Math.max(a.width,a.focus.x+a.nodeSpacing/2+y);default:return y}}function Ny(a,y,x){switch(a.alignment){case Uc:case ng:return x+a.height>y&&(y=x+a.height),0>x&&(y-=x),y;case $u:return a.height>y?a.height:y;case qu:return 2*a.focus.y>y?a.height:y+a.height-2*a.focus.y;case Zh:case th:return Math.max(a.height,Math.max(y,x+a.height)-Math.min(0,x));case Gh:return a.height-a.focus.y+a.nodeSpacing/2+y;case gh:return Math.max(a.height,a.focus.y+a.nodeSpacing/2+y);default:return y}}function By(a,y,x){switch(a){case ng:y/=2,x/=2;break;case Uc:y/=2,x/=2;break;case $u:x=y=0;break;case qu:break;default:Gt("Unhandled alignment value "+a.toString())}return new At(y,x)}function oc(a,y,x,E,b,z){y=By(y,x,E),Vc(a,y.x,y.y,b,z)}function Vc(a,y,x,E,b){if(y!==0||x!==0)for(a=a.children;E<=b;E++){var z=a[E].S;z.x+=y,z.y+=x}}function T0(a,y,x,E){var b=y.parent;switch(a.ud){case Qu:for(a=y.sourceEdges;a.next();)y=a.value,y.fromVertex===b&&y.relativePoint.h(x,E);break;case Kc:for(a=y.destinationEdges;a.next();)y=a.value,y.toVertex===b&&y.relativePoint.h(x,E);break;default:Gt("Unhandled path value "+a.ud.toString())}}function D0(a,y,x){for(var E=0;E<a.length;E++){var b=a[E];b.x+=y,b.y+=x}}function cx(a,y,x,E,b,z,tt,rt){var ot=su(y),lt=ot===90||ot===270,ut=y.nodeSpacing;y=E;var ft=b;E=z;var yt=tt,xt=x.Yo,Ct=x.kp;tt=x.Da;var bt=lt?Math.max(yt,tt.height):Math.max(E,tt.width);if((xt===null||ot!==su(x))&&(xt=Vs(a,2),Ct=Vs(a,2),lt?(xt[0].h(0,0),xt[1].h(0,tt.height),Ct[0].h(tt.width,0),Ct[1].h(Ct[0].x,xt[1].y)):(xt[0].h(0,0),xt[1].h(tt.width,0),Ct[0].h(0,tt.height),Ct[1].h(xt[1].x,Ct[0].y))),lt){if(yt=9999999,!(ft===null||2>ft.length||xt===null||2>xt.length))for(b=x=0;x<ft.length&&b<xt.length;){z=ft[x];var Vt=xt[b];ot=Vt.x,lt=Vt.y,ot+=E;var zt=z;x+1<ft.length&&(zt=ft[x+1]);var Qt=Vt;Vt=Qt.x,Qt=Qt.y,b+1<xt.length&&(Qt=xt[b+1],Vt=Qt.x,Qt=Qt.y,Vt+=E);var ee=yt;z.y===lt?ee=ot-z.x:z.y>lt&&z.y<Qt?ee=ot+(z.y-lt)/(Qt-lt)*(Vt-ot)-z.x:lt>z.y&<<zt.y&&(ee=ot-(z.x+(lt-z.y)/(zt.y-z.y)*(zt.x-z.x))),ee<yt&&(yt=ee),zt.y<=z.y?x++:Qt<=lt?b++:(zt.y<=Qt&&x++,Qt<=zt.y&&b++)}if(yt=E-yt,yt+=ut,x=xt,b=yt,y===null||2>y.length||x===null||2>x.length)E=null;else{for(ut=Vs(a,y.length+x.length),E=z=ot=0;z<x.length&&x[z].y<y[0].y;)lt=x[z++],ut[E++].h(lt.x+b,lt.y);for(;ot<y.length;)lt=y[ot++],ut[E++].h(lt.x,lt.y);for(ot=y[y.length-1].y;z<x.length&&x[z].y<=ot;)z++;for(;z<x.length&&x[z].y>ot;)lt=x[z++],ut[E++].h(lt.x+b,lt.y);for(x=Vs(a,E),ot=0;ot<E;ot++)x[ot].assign(ut[ot]);Su(a,ut),E=x}if(z=Ct,ot=yt,ft===null||2>ft.length||z===null||2>z.length)b=null;else{for(ut=Vs(a,ft.length+z.length),b=lt=x=0;x<ft.length&&ft[x].y<z[0].y;)zt=ft[x++],ut[b++].h(zt.x,zt.y);for(;lt<z.length;)zt=z[lt++],ut[b++].h(zt.x+ot,zt.y);for(z=z[z.length-1].y;x<ft.length&&ft[x].y<=z;)x++;for(;x<ft.length&&ft[x].y>z;)ot=ft[x++],ut[b++].h(ot.x,ot.y);for(z=Vs(a,b),x=0;x<b;x++)z[x].assign(ut[x]);Su(a,ut),b=z}return z=Math.max(0,yt)+tt.width,tt=bt,Su(a,y),Su(a,xt),Su(a,ft),Su(a,Ct),rt[0]=E,rt[1]=b,new Be(yt,0,z,tt)}if(E=9999999,!(ft===null||2>ft.length||xt===null||2>xt.length))for(b=x=0;x<ft.length&&b<xt.length;)z=ft[x],Vt=xt[b],ot=Vt.x,lt=Vt.y,lt+=yt,zt=z,x+1<ft.length&&(zt=ft[x+1]),Qt=Vt,Vt=Qt.x,Qt=Qt.y,b+1<xt.length&&(Qt=xt[b+1],Vt=Qt.x,Qt=Qt.y,Qt+=yt),ee=E,z.x===ot?ee=lt-z.y:z.x>ot&&z.x<Vt?ee=lt+(z.x-ot)/(Vt-ot)*(Qt-lt)-z.y:ot>z.x&&ot<zt.x&&(ee=lt-(z.y+(ot-z.x)/(zt.x-z.x)*(zt.y-z.y))),ee<E&&(E=ee),zt.x<=z.x?x++:Vt<=ot?b++:(zt.x<=Vt&&x++,Vt<=zt.x&&b++);if(yt-=E,yt+=ut,x=xt,b=yt,y===null||2>y.length||x===null||2>x.length)E=null;else{for(ut=Vs(a,y.length+x.length),E=z=ot=0;z<x.length&&x[z].x<y[0].x;)lt=x[z++],ut[E++].h(lt.x,lt.y+b);for(;ot<y.length;)lt=y[ot++],ut[E++].h(lt.x,lt.y);for(ot=y[y.length-1].x;z<x.length&&x[z].x<=ot;)z++;for(;z<x.length&&x[z].x>ot;)lt=x[z++],ut[E++].h(lt.x,lt.y+b);for(x=Vs(a,E),ot=0;ot<E;ot++)x[ot].assign(ut[ot]);Su(a,ut),E=x}if(z=Ct,ot=yt,ft===null||2>ft.length||z===null||2>z.length)b=null;else{for(ut=Vs(a,ft.length+z.length),b=lt=x=0;x<ft.length&&ft[x].x<z[0].x;)zt=ft[x++],ut[b++].h(zt.x,zt.y);for(;lt<z.length;)zt=z[lt++],ut[b++].h(zt.x,zt.y+ot);for(z=z[z.length-1].x;x<ft.length&&ft[x].x<=z;)x++;for(;x<ft.length&&ft[x].x>z;)ot=ft[x++],ut[b++].h(ot.x,ot.y);for(z=Vs(a,b),x=0;x<b;x++)z[x].assign(ut[x]);Su(a,ut),b=z}return z=bt,tt=Math.max(0,yt)+tt.height,Su(a,y),Su(a,xt),Su(a,ft),Su(a,Ct),rt[0]=E,rt[1]=b,new Be(yt,0,z,tt)}function Vs(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 At;return a}function Su(a,y){var x=y.length,E=a.ru[x];E===void 0&&(E=[],a.ru[x]=E),E.push(y)}Nr.prototype.arrangeTrees=function(){if(this.Rb===j0)for(var a=this.Ub.iterator;a.next();){var y=a.value;if(y instanceof Hl){var x=y.node;if(x!==null){var E=x.position;x=E.x,E=E.y,isFinite(x)||(x=0),isFinite(E)||(E=0),Ay(this,y,x,E)}}}else{for(a=[],y=this.Ub.iterator;y.next();)x=y.value,x instanceof Hl&&a.push(x);switch(this.sorting){case eg:break;case Bp:a.reverse();break;case Ap:a.sort(this.comparer);break;case Tp:a.sort(this.comparer),a.reverse();break;default:Gt("Unhandled sorting value "+this.sorting.toString())}for(x=this.arrangementOrigin,y=x.x,x=x.y,E=0;E<a.length;E++){var b=a[E];switch(Ay(this,b,y+b.la.x,x+b.la.y),this.Rb){case R0:x+=b.Da.height+this.$d.height;break;case Iy:y+=b.Da.width+this.$d.width;break;default:Gt("Unhandled arrangement value "+this.Rb.toString())}}}};function Ay(a,y,x,E){if(y!==null){y.x=x,y.y=E,y=y.children;for(var b=y.length,z=0;z<b;z++){var tt=y[z];Ay(a,tt,x+tt.S.x,E+tt.S.y)}}}Nr.prototype.commitLayout=function(){this.yv(),this.commitNodes(),this.Gu(),this.isRouting&&this.commitLinks()},Nr.prototype.commitNodes=function(){for(var a=this.network.vertexes.iterator;a.next();)a.value.commit();for(a.reset();a.next();)this.layoutComments(a.value)},Nr.prototype.Gu=function(){if(this.layerStyle===z0){for(var a=this.$v,y=[],x=null,E=this.network.vertexes.iterator;E.next();){var b=E.value;x===null?x=b.bounds.copy():x.ed(b.bounds);var z=y[b.level];z===void 0?z=this.computeLayerSpacing(b):z=Math.max(z,this.computeLayerSpacing(b)),y[b.level]=z}for(E=0;E<y.length;E++)y[E]===void 0&&(y[E]=0);if(this.angle===90||this.angle===270?(x.Bc(this.nodeSpacing/2,this.layerSpacing),E=new At(-this.nodeSpacing/2,-this.layerSpacing/2)):(x.Bc(this.layerSpacing,this.nodeSpacing/2),E=new At(-this.layerSpacing/2,-this.nodeSpacing/2)),b=[],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,b.push(new Be(0,z,x,rt))):this.angle===90?(b.push(new Be(0,z,x,rt)),z+=rt):this.angle===180?(z-=rt,b.push(new Be(z,0,rt,x))):(b.push(new Be(z,0,rt,x)),z+=rt)}this.commitLayers(b,E)}},Nr.prototype.commitLayers=function(){},Nr.prototype.commitLinks=function(){for(var a=this.network.edges.iterator;a.next();)a.value.commit()},Nr.prototype.yv=function(){for(var a=this.Ub.iterator;a.next();){var y=a.value;y instanceof Hl&&fx(this,y)}};function fx(a,y){if(y!==null){a.setPortSpots(y),y=y.children;for(var x=y.length,E=0;E<x;E++)fx(a,y[E])}}Nr.prototype.setPortSpots=function(a){var y=a.alignment;if(Ed(y)){var x=this.ud===Qu,E=su(a);switch(E){case 0:var b=Ba;break;case 90:b=Ga;break;case 180:b=Qa;break;default:b=Ja}var z=a.children,tt=z.length;switch(y){case Zh:case th: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=E===90||E===270?Qa:Ja;if(tt===1||y===tt-1&&tt%2===1)switch(E){case 0:ot=Qa;break;case 90:ot=Ja;break;case 180:ot=Ba;break;default:ot=Ga}else y%2===0&&(ot=E===90||E===270?Ba:Ga);x?(a.setsPortSpot&&(rt.fromSpot=b),a.setsChildPortSpot&&(rt.toSpot=ot)):(a.setsPortSpot&&(rt.fromSpot=ot),a.setsChildPortSpot&&(rt.toSpot=b))}}break;case Gh:for(E=E===90||E===270?Ba:Ga,z=x?a.destinationEdges:a.sourceEdges;z.next();)tt=z.value.link,tt!==null&&(x?(a.setsPortSpot&&(tt.fromSpot=b),a.setsChildPortSpot&&(tt.toSpot=E)):(a.setsPortSpot&&(tt.fromSpot=E),a.setsChildPortSpot&&(tt.toSpot=b)));break;case gh:for(E=E===90||E===270?Qa:Ja,z=x?a.destinationEdges:a.sourceEdges;z.next();)tt=z.value.link,tt!==null&&(x?(a.setsPortSpot&&(tt.fromSpot=b),a.setsChildPortSpot&&(tt.toSpot=E)):(a.setsPortSpot&&(tt.fromSpot=E),a.setsChildPortSpot&&(tt.toSpot=b)))}}else if(x=su(a),this.ud===Qu){for(b=a.destinationEdges;b.next();)if(E=b.value.link,E!==null){if(a.setsPortSpot)if(a.portSpot.Xb())switch(x){case 0:E.fromSpot=Ba;break;case 90:E.fromSpot=Ga;break;case 180:E.fromSpot=Qa;break;default:E.fromSpot=Ja}else E.fromSpot=a.portSpot;if(a.setsChildPortSpot)if(a.childPortSpot.Xb())switch(x){case 0:E.toSpot=Qa;break;case 90:E.toSpot=Ja;break;case 180:E.toSpot=Ba;break;default:E.toSpot=Ga}else E.toSpot=a.childPortSpot}}else for(b=a.sourceEdges;b.next();)if(E=b.value.link,E!==null){if(a.setsPortSpot)if(a.portSpot.Xb())switch(x){case 0:E.toSpot=Ba;break;case 90:E.toSpot=Ga;break;case 180:E.toSpot=Qa;break;default:E.toSpot=Ja}else E.toSpot=a.portSpot;if(a.setsChildPortSpot)if(a.childPortSpot.Xb())switch(x){case 0:E.fromSpot=Qa;break;case 90:E.fromSpot=Ja;break;case 180:E.fromSpot=Ba;break;default:E.fromSpot=Ga}else E.fromSpot=a.childPortSpot}};function su(a){return a=a.angle,45>=a?0:135>=a?90:225>=a?180:315>=a?270:0}Nr.prototype.computeLayerSpacing=function(a){var y=su(a);y=y===90||y===270;var x=a.layerSpacing;if(0<a.layerSpacingParentOverlap){var E=Math.min(1,a.layerSpacingParentOverlap);x-=y?a.height*E:a.width*E}return x<(y?-a.height:-a.width)&&(x=y?-a.height:-a.width),x},Nr.prototype.computeNodeIndent=function(a){var y=su(a),x=a.nodeIndent;if(0<a.nodeIndentPastParent){var E=Math.min(1,a.nodeIndentPastParent);x+=y===90||y===270?a.width*E:a.height*E}return x=Math.max(0,x)},ye.Object.defineProperties(Nr.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!==_0&&a!==Dy&&a!==Ty&&a!==Oy||(this.vo=a,this.C())}},layerStyle:{get:function(){return this.Bq},set:function(a){this.Rb===a||a!==_y&&a!==Ry&&a!==z0||(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!==R0&&a!==Iy&&a!==j0||(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!==eg&&a!==Bp&&a!==Ap&&!Tp||(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()):Gt("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!==I0&&a!==Dp||(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!==eg&&a!==Bp&&a!==Ap&&!Tp||(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!==I0&&a!==Dp||(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 O0=new rn(Nr,"PathDefault",-1),Qu=new rn(Nr,"PathDestination",0),Kc=new rn(Nr,"PathSource",1),eg=new rn(Nr,"SortingForwards",10),Bp=new rn(Nr,"SortingReverse",11),Ap=new rn(Nr,"SortingAscending",12),Tp=new rn(Nr,"SortingDescending",13),ng=new rn(Nr,"AlignmentCenterSubtrees",20),Uc=new rn(Nr,"AlignmentCenterChildren",21),$u=new rn(Nr,"AlignmentStart",22),qu=new rn(Nr,"AlignmentEnd",23),Zh=new rn(Nr,"AlignmentBus",24),th=new rn(Nr,"AlignmentBusBranching",25),Gh=new rn(Nr,"AlignmentTopLeftBus",26),gh=new rn(Nr,"AlignmentBottomRightBus",27),I0=new rn(Nr,"CompactionNone",30),Dp=new rn(Nr,"CompactionBlock",31),_0=new rn(Nr,"StyleLayered",40),Ty=new rn(Nr,"StyleLastParents",41),Dy=new rn(Nr,"StyleAlternating",42),Oy=new rn(Nr,"StyleRootOnly",43),R0=new rn(Nr,"ArrangementVertical",50),Iy=new rn(Nr,"ArrangementHorizontal",51),j0=new rn(Nr,"ArrangementFixedRoots",52),_y=new rn(Nr,"LayerIndividual",60),Ry=new rn(Nr,"LayerSiblings",61),z0=new rn(Nr,"LayerUniform",62);Nr.className="TreeLayout",Nr.PathDefault=O0,Nr.PathDestination=Qu,Nr.PathSource=Kc,Nr.SortingForwards=eg,Nr.SortingReverse=Bp,Nr.SortingAscending=Ap,Nr.SortingDescending=Tp,Nr.AlignmentCenterSubtrees=ng,Nr.AlignmentCenterChildren=Uc,Nr.AlignmentStart=$u,Nr.AlignmentEnd=qu,Nr.AlignmentBus=Zh,Nr.AlignmentBusBranching=th,Nr.AlignmentTopLeftBus=Gh,Nr.AlignmentBottomRightBus=gh,Nr.CompactionNone=I0,Nr.CompactionBlock=Dp,Nr.StyleLayered=_0,Nr.StyleLastParents=Ty,Nr.StyleAlternating=Dy,Nr.StyleRootOnly=Oy,Nr.ArrangementVertical=R0,Nr.ArrangementHorizontal=Iy,Nr.ArrangementFixedRoots=j0,Nr.LayerIndividual=_y,Nr.LayerSiblings=Ry,Nr.LayerUniform=z0;function Yc(a){To.call(this,a)}Se(Yc,To),Yc.prototype.createVertex=function(){return new Hl(this)},Yc.prototype.createEdge=function(){return new ig(this)},Yc.className="TreeNetwork";function Hl(a){La.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 At(0,0),this.Da=new on(0,0),this.la=new At(0,0),this.im=this.hm=this.qA=!1,this.kp=this.Yo=null,this.nd=eg,this.hd=ry,this.Kb=0,this.Jb=Uc,this.Vq=this.Uq=0,this.Wq=20,this.ie=50,this.Aq=0,this.Hp=Dp,this.Ap=0,this.nr=25,this.Gp=this.mr=10,this.Fp=20,this.xr=!0,this.dr=wa,this.wr=!0,this.Dp=wa}Se(Hl,La),Hl.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)},ye.Object.defineProperties(Hl.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)}}}),Hl.className="TreeVertex";function ig(a){nl.call(this,a),this.$t=new At(0,0)}Se(ig,nl),ig.prototype.commit=function(){var a=this.link;if(a!==null&&!a.isAvoiding){var y=this.network.layout,x=null,E=null;switch(y.ud){case Qu:x=this.fromVertex,E=this.toVertex;break;case Kc:x=this.toVertex,E=this.fromVertex;break;default:Gt("Unhandled path value "+y.ud.toString())}if(x!==null&&E!==null){var b=this.$t;if(b.x!==0||b.y!==0||x.qA){E=x.bounds;var z=su(x),tt=y.computeLayerSpacing(x),rt=x.rowSpacing;a.vg();var ot=a.curve===ml,lt=a.isOrthogonal,ut;if(a.uh(),lt||ot){for(ut=2;4<a.pointsCount;)a.pv(2);var ft=a.i(1),yt=a.i(2)}else{for(ut=1;3<a.pointsCount;)a.pv(1);ft=a.i(0),yt=a.i(a.pointsCount-1)}var xt=a.i(a.pointsCount-1);z===0?(x.alignment===qu?(z=E.bottom+b.y,b.y===0&&ft.y>xt.y+x.rowIndent&&(z=Math.min(z,Math.max(ft.y,z-y.computeNodeIndent(x))))):x.alignment===$u?(z=E.top+b.y,b.y===0&&ft.y<xt.y-x.rowIndent&&(z=Math.max(z,Math.min(ft.y,z+y.computeNodeIndent(x))))):z=x.hm||x.im&&x.maxGenerationCount===1?E.top-x.la.y+b.y:E.y+E.height/2+b.y,ot?(a.m(ut,ft.x,z),ut++,a.m(ut,E.right+tt,z),ut++,a.m(ut,E.right+tt+(b.x-rt)/3,z),ut++,a.m(ut,E.right+tt+2*(b.x-rt)/3,z),ut++,a.m(ut,E.right+tt+(b.x-rt),z),ut++,a.m(ut,yt.x,z)):(lt&&(a.m(ut,E.right+tt/2,ft.y),ut++),a.m(ut,E.right+tt/2,z),ut++,a.m(ut,E.right+tt+b.x-(lt?rt/2:rt),z),ut++,lt&&a.m(ut,a.i(ut-1).x,yt.y))):z===90?(x.alignment===qu?(z=E.right+b.x,b.x===0&&ft.x>xt.x+x.rowIndent&&(z=Math.min(z,Math.max(ft.x,z-y.computeNodeIndent(x))))):x.alignment===$u?(z=E.left+b.x,b.x===0&&ft.x<xt.x-x.rowIndent&&(z=Math.max(z,Math.min(ft.x,z+y.computeNodeIndent(x))))):z=x.hm||x.im&&x.maxGenerationCount===1?E.left-x.la.x+b.x:E.x+E.width/2+b.x,ot?(a.m(ut,z,ft.y),ut++,a.m(ut,z,E.bottom+tt),ut++,a.m(ut,z,E.bottom+tt+(b.y-rt)/3),ut++,a.m(ut,z,E.bottom+tt+2*(b.y-rt)/3),ut++,a.m(ut,z,E.bottom+tt+(b.y-rt)),ut++,a.m(ut,z,yt.y)):(lt&&(a.m(ut,ft.x,E.bottom+tt/2),ut++),a.m(ut,z,E.bottom+tt/2),ut++,a.m(ut,z,E.bottom+tt+b.y-(lt?rt/2:rt)),ut++,lt&&a.m(ut,yt.x,a.i(ut-1).y))):z===180?(x.alignment===qu?(z=E.bottom+b.y,b.y===0&&ft.y>xt.y+x.rowIndent&&(z=Math.min(z,Math.max(ft.y,z-y.computeNodeIndent(x))))):x.alignment===$u?(z=E.top+b.y,b.y===0&&ft.y<xt.y-x.rowIndent&&(z=Math.max(z,Math.min(ft.y,z+y.computeNodeIndent(x))))):z=x.hm||x.im&&x.maxGenerationCount===1?E.top-x.la.y+b.y:E.y+E.height/2+b.y,ot?(a.m(ut,ft.x,z),ut++,a.m(ut,E.left-tt,z),ut++,a.m(ut,E.left-tt+(b.x+rt)/3,z),ut++,a.m(ut,E.left-tt+2*(b.x+rt)/3,z),ut++,a.m(ut,E.left-tt+(b.x+rt),z),ut++,a.m(ut,yt.x,z)):(lt&&(a.m(ut,E.left-tt/2,ft.y),ut++),a.m(ut,E.left-tt/2,z),ut++,a.m(ut,E.left-tt+b.x+(lt?rt/2:rt),z),ut++,lt&&a.m(ut,a.i(ut-1).x,yt.y))):z===270?(x.alignment===qu?(z=E.right+b.x,b.x===0&&ft.x>xt.x+x.rowIndent&&(z=Math.min(z,Math.max(ft.x,z-y.computeNodeIndent(x))))):x.alignment===$u?(z=E.left+b.x,b.x===0&&ft.x<xt.x-x.rowIndent&&(z=Math.max(z,Math.min(ft.x,z+y.computeNodeIndent(x))))):z=x.hm||x.im&&x.maxGenerationCount===1?E.left-x.la.x+b.x:E.x+E.width/2+b.x,ot?(a.m(ut,z,ft.y),ut++,a.m(ut,z,E.top-tt),ut++,a.m(ut,z,E.top-tt+(b.y+rt)/3),ut++,a.m(ut,z,E.top-tt+2*(b.y+rt)/3),ut++,a.m(ut,z,E.top-tt+(b.y+rt)),ut++,a.m(ut,z,yt.y)):(lt&&(a.m(ut,ft.x,E.top-tt/2),ut++),a.m(ut,z,E.top-tt/2),ut++,a.m(ut,z,E.top-tt+b.y+(lt?rt/2:rt)),ut++,lt&&a.m(ut,yt.x,a.i(ut-1).y))):Gt("Invalid angle "+z),a.zf()}else b=E,a=this.link,E=this.network.layout,y=su(x),y!==su(b)&&(tt=E.computeLayerSpacing(x),rt=x.bounds,x=b.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===ml,b=a.isOrthogonal,E=Ed(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)):b?E?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)):b?E?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)):b?E?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)):b?E?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()))}}},ye.Object.defineProperties(ig.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)}}}),ig.className="TreeEdge",Ar.prototype.initializeStandardTools=function(){this.gb("Action",new Ss,this.mouseDownTools),this.gb("Relinking",new Zo,this.mouseDownTools),this.gb("LinkReshaping",new Jo,this.mouseDownTools),this.gb("Rotating",new Wa,this.mouseDownTools),this.gb("Resizing",new Da,this.mouseDownTools),this.gb("Linking",new Co,this.mouseMoveTools),this.gb("Dragging",new jo,this.mouseMoveTools),this.gb("DragSelecting",new xl,this.mouseMoveTools),this.gb("Panning",new qa,this.mouseMoveTools),this.gb("ContextMenu",new xs,this.mouseUpTools),this.gb("TextEditing",new Go,this.mouseUpTools),this.gb("ClickCreating",new wh,this.mouseUpTools),this.gb("ClickSelecting",new $s,this.mouseUpTools)},Au("Horizontal",new pm),Au("Spot",new vm),Au("Table",new Sm),Au("Viewbox",new wm),Au("TableRow",new xm),Au("TableColumn",new Pm),Au("Graduated",new Jg),Au("Grid",new Xg),Ff.add("GraphLinksModel",Oa),Ff.add("TreeModel",kl);var Z0=Je.go,jy={get licenseKey(){return ke.licenseKey},set licenseKey(a){ke.licenseKey=a},get version(){return ke.version},Group:er,EnumValue:rn,List:fn,Set:pn,Map:be,Point:At,Size:on,Rect:Be,Margin:nr,Spot:fi,Geometry:fe,PathFigure:Dr,PathSegment:Ki,InputEvent:Zi,DiagramEvent:Sr,ChangedEvent:Li,Model:wi,GraphLinksModel:Vr,TreeModel:ks,Binding:ha,Transaction:No,UndoManager:$i,CommandHandler:Wt,Tool:or,DraggingTool:jo,DraggingInfo:lh,DraggingOptions:at,LinkingBaseTool:Ni,LinkingTool:Co,RelinkingTool:Zo,LinkReshapingTool:Jo,ResizingTool:Da,RotatingTool:Wa,ClickSelectingTool:$s,ActionTool:Ss,ClickCreatingTool:wh,HTMLInfo:Mu,ContextMenuTool:xs,DragSelectingTool:xl,PanningTool:qa,TextEditingTool:Go,ToolManager:Ar,Animation:ts,AnimationManager:qs,AnimationTrigger:ql,Layer:Ra,Diagram:ke,Palette:ct,Overview:mt,Brush:mo,GraphObject:ge,Panel:wn,RowColumnDefinition:Sa,Shape:cr,TextBlock:Ao,Picture:_s,Part:Bi,Adornment:Qr,Node:$n,Link:Nn,Placeholder:Es,Layout:Ko,LayoutNetwork:To,LayoutVertex:La,LayoutEdge:nl,GridLayout:Ka,PanelLayout:Ea,CircularLayout:Xo,CircularNetwork:$f,CircularVertex:Ep,CircularEdge:P0,ForceDirectedLayout:ns,ForceDirectedNetwork:Wc,ForceDirectedVertex:Lp,ForceDirectedEdge:Fp,LayeredDigraphLayout:yo,LayeredDigraphNetwork:tg,LayeredDigraphVertex:Nl,LayeredDigraphEdge:bp,TreeLayout:Nr,TreeNetwork:Yc,TreeVertex:Hl,TreeEdge:ig};typeof Z0=="object"&&Z0.version&&Mn("WARNING: a `go` object on the root object is already defined. "+("Debug"in Z0?"debug ":"")+"version: "+Z0.version+", replaced with version: "+jy.version),ke.prototype.go=jy,Je.go=jy,typeof Bn.exports=="object"&&(Bn.exports=typeof kt.g!="undefined"?kt.g.go:self.go)}();var pt=typeof kt.g!="undefined"?kt.g.go:self.go;const Ut=typeof kt.g!="undefined"?kt.g.go:self.go,ue=Ut.Group,Le=Ut.EnumValue,he=Ut.List,Dt=Ut.Set,qt=Ut.Map,me=Ut.Point,ne=Ut.Size,jt=Ut.Rect,Te=Ut.Margin,se=Ut.Spot,Ce=Ut.Geometry,Bt=Ut.PathFigure,nt=Ut.PathSegment,et=Ut.InputEvent,ht=Ut.DiagramEvent,st=Ut.ChangedEvent,gt=Ut.Model,vt=Ut.GraphLinksModel,St=Ut.TreeModel,Et=Ut.Binding,Tt=Ut.Transaction,Ot=Ut.UndoManager,$t=Ut.CommandHandler,Xt=Ut.Tool,Ht=Ut.DraggingTool,ve=Ut.DraggingInfo,ie=Ut.LinkingBaseTool,Ne=Ut.LinkingTool,xe=Ut.RelinkingTool,Pe=Ut.LinkReshapingTool,Qe=Ut.ResizingTool,_e=Ut.RotatingTool,an=Ut.ClickSelectingTool,Ke=Ut.ActionTool,re=Ut.ClickCreatingTool,Jt=Ut.HTMLInfo,Ye=Ut.ContextMenuTool,Gn=Ut.DragSelectingTool,dn=Ut.PanningTool,Oe=Ut.TextEditingTool,sn=Ut.ToolManager,ln=Ut.Animation,Vn=Ut.AnimationManager,Ae=Ut.AnimationTrigger,yn=Ut.Layer,te=Ut.Diagram,En=Ut.Palette,ri=Ut.Overview,Rt=Ut.Brush,Lt=Ut.GraphObject,Pt=Ut.Panel,Nt=Ut.RowColumnDefinition,Zt=Ut.Shape,Mt=Ut.TextBlock,Yt=Ut.TextBlockMetrics,Ge=Ut.Picture,De=Ut.Part,Ue=Ut.Adornment,we=Ut.Node,Ee=Ut.Link,Fe=Ut.Placeholder,He=Ut.Layout,qe=Ut.LayoutNetwork,cn=Ut.LayoutVertex,gn=Ut.LayoutEdge,ni=Ut.GridLayout,ze=Ut.PanelLayout,Ve=Ut.CircularLayout,nn=Ut.CircularNetwork,qn=Ut.CircularVertex,vn=Ut.CircularEdge,tn=Ut.ForceDirectedLayout,Rn=Ut.ForceDirectedNetwork,gi=Ut.ForceDirectedVertex,ti=Ut.ForceDirectedEdge,vi=Ut.LayeredDigraphLayout,Gi=Ut.LayeredDigraphNetwork,Fn=Ut.LayeredDigraphVertex,xn=Ut.LayeredDigraphEdge,Tn=Ut.TreeLayout,ai=Ut.TreeNetwork,pi=Ut.TreeVertex,ui=Ut.TreeEdge,zi=Ut.version},24334:function(Bn,zn,kt){var pt,Ut;(function(ue,Le){Bn.exports=Le(ue)})(typeof self!="undefined"?self:typeof window!="undefined"?window:typeof kt.g!="undefined"?kt.g:this,function(ue){"use strict";ue=ue||{};var Le=ue.Base64,he="2.6.4",Dt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",qt=function(xe){for(var Pe={},Qe=0,_e=xe.length;Qe<_e;Qe++)Pe[xe.charAt(Qe)]=Qe;return Pe}(Dt),me=String.fromCharCode,ne=function(xe){if(xe.length<2){var Pe=xe.charCodeAt(0);return Pe<128?xe:Pe<2048?me(192|Pe>>>6)+me(128|Pe&63):me(224|Pe>>>12&15)+me(128|Pe>>>6&63)+me(128|Pe&63)}else{var Pe=65536+(xe.charCodeAt(0)-55296)*1024+(xe.charCodeAt(1)-56320);return me(240|Pe>>>18&7)+me(128|Pe>>>12&63)+me(128|Pe>>>6&63)+me(128|Pe&63)}},jt=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,Te=function(xe){return xe.replace(jt,ne)},se=function(xe){var Pe=[0,2,1][xe.length%3],Qe=xe.charCodeAt(0)<<16|(xe.length>1?xe.charCodeAt(1):0)<<8|(xe.length>2?xe.charCodeAt(2):0),_e=[Dt.charAt(Qe>>>18),Dt.charAt(Qe>>>12&63),Pe>=2?"=":Dt.charAt(Qe>>>6&63),Pe>=1?"=":Dt.charAt(Qe&63)];return _e.join("")},Ce=ue.btoa&&typeof ue.btoa=="function"?function(xe){return ue.btoa(xe)}:function(xe){if(xe.match(/[^\x00-\xFF]/))throw new RangeError("The string contains invalid characters.");return xe.replace(/[\s\S]{1,3}/g,se)},Bt=function(xe){return Ce(Te(String(xe)))},nt=function(xe){return xe.replace(/[+\/]/g,function(Pe){return Pe=="+"?"-":"_"}).replace(/=/g,"")},et=function(xe,Pe){return Pe?nt(Bt(xe)):Bt(xe)},ht=function(xe){return et(xe,!0)},st;ue.Uint8Array&&(st=function(xe,Pe){for(var Qe="",_e=0,an=xe.length;_e<an;_e+=3){var Ke=xe[_e],re=xe[_e+1],Jt=xe[_e+2],Ye=Ke<<16|re<<8|Jt;Qe+=Dt.charAt(Ye>>>18)+Dt.charAt(Ye>>>12&63)+(typeof re!="undefined"?Dt.charAt(Ye>>>6&63):"=")+(typeof Jt!="undefined"?Dt.charAt(Ye&63):"=")}return Pe?nt(Qe):Qe});var gt=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,vt=function(xe){switch(xe.length){case 4:var Pe=(7&xe.charCodeAt(0))<<18|(63&xe.charCodeAt(1))<<12|(63&xe.charCodeAt(2))<<6|63&xe.charCodeAt(3),Qe=Pe-65536;return me((Qe>>>10)+55296)+me((Qe&1023)+56320);case 3:return me((15&xe.charCodeAt(0))<<12|(63&xe.charCodeAt(1))<<6|63&xe.charCodeAt(2));default:return me((31&xe.charCodeAt(0))<<6|63&xe.charCodeAt(1))}},St=function(xe){return xe.replace(gt,vt)},Et=function(xe){var Pe=xe.length,Qe=Pe%4,_e=(Pe>0?qt[xe.charAt(0)]<<18:0)|(Pe>1?qt[xe.charAt(1)]<<12:0)|(Pe>2?qt[xe.charAt(2)]<<6:0)|(Pe>3?qt[xe.charAt(3)]:0),an=[me(_e>>>16),me(_e>>>8&255),me(_e&255)];return an.length-=[0,0,2,1][Qe],an.join("")},Tt=ue.atob&&typeof ue.atob=="function"?function(xe){return ue.atob(xe)}:function(xe){return xe.replace(/\S{1,4}/g,Et)},Ot=function(xe){return Tt(String(xe).replace(/[^A-Za-z0-9\+\/]/g,""))},$t=function(xe){return St(Tt(xe))},Xt=function(xe){return String(xe).replace(/[-_]/g,function(Pe){return Pe=="-"?"+":"/"}).replace(/[^A-Za-z0-9\+\/]/g,"")},Ht=function(xe){return $t(Xt(xe))},ve;ue.Uint8Array&&(ve=function(xe){return Uint8Array.from(Ot(Xt(xe)),function(Pe){return Pe.charCodeAt(0)})});var ie=function(){var xe=ue.Base64;return ue.Base64=Le,xe};if(ue.Base64={VERSION:he,atob:Ot,btoa:Ce,fromBase64:Ht,toBase64:et,utob:Te,encode:et,encodeURI:ht,btou:St,decode:Ht,noConflict:ie,fromUint8Array:st,toUint8Array:ve},typeof Object.defineProperty=="function"){var Ne=function(xe){return{value:xe,enumerable:!1,writable:!0,configurable:!0}};ue.Base64.extendString=function(){Object.defineProperty(String.prototype,"fromBase64",Ne(function(){return Ht(this)})),Object.defineProperty(String.prototype,"toBase64",Ne(function(xe){return et(this,xe)})),Object.defineProperty(String.prototype,"toBase64URI",Ne(function(){return et(this,!0)}))}}return ue.Meteor&&(Base64=ue.Base64),Bn.exports?Bn.exports.Base64=ue.Base64:(pt=[],Ut=function(){return ue.Base64}.apply(zn,pt),Ut!==void 0&&(Bn.exports=Ut)),{Base64:ue.Base64}})},2859:function(Bn,zn,kt){"use strict";kt.d(zn,{hP:function(){return ri}});var pt=function(Rt,Lt){return(pt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Pt,Nt){Pt.__proto__=Nt}||function(Pt,Nt){for(var Zt in Nt)Object.prototype.hasOwnProperty.call(Nt,Zt)&&(Pt[Zt]=Nt[Zt])})(Rt,Lt)};function Ut(Rt,Lt){function Pt(){this.constructor=Rt}pt(Rt,Lt),Rt.prototype=Lt===null?Object.create(Lt):(Pt.prototype=Lt.prototype,new Pt)}function ue(Rt,Lt,Pt,Nt){return new(Pt||(Pt=Promise))(function(Zt,Mt){function Yt(Ue){try{De(Nt.next(Ue))}catch(we){Mt(we)}}function Ge(Ue){try{De(Nt.throw(Ue))}catch(we){Mt(we)}}function De(Ue){var we;Ue.done?Zt(Ue.value):(we=Ue.value,we instanceof Pt?we:new Pt(function(Ee){Ee(we)})).then(Yt,Ge)}De((Nt=Nt.apply(Rt,Lt||[])).next())})}function Le(Rt,Lt){var Pt,Nt,Zt,Mt,Yt={label:0,sent:function(){if(1&Zt[0])throw Zt[1];return Zt[1]},trys:[],ops:[]};return Mt={next:Ge(0),throw:Ge(1),return:Ge(2)},typeof Symbol=="function"&&(Mt[Symbol.iterator]=function(){return this}),Mt;function Ge(De){return function(Ue){return function(we){if(Pt)throw new TypeError("Generator is already executing.");for(;Yt;)try{if(Pt=1,Nt&&(Zt=2&we[0]?Nt.return:we[0]?Nt.throw||((Zt=Nt.return)&&Zt.call(Nt),0):Nt.next)&&!(Zt=Zt.call(Nt,we[1])).done)return Zt;switch(Nt=0,Zt&&(we=[2&we[0],Zt.value]),we[0]){case 0:case 1:Zt=we;break;case 4:return Yt.label++,{value:we[1],done:!1};case 5:Yt.label++,Nt=we[1],we=[0];continue;case 7:we=Yt.ops.pop(),Yt.trys.pop();continue;default:if(Zt=Yt.trys,!((Zt=Zt.length>0&&Zt[Zt.length-1])||we[0]!==6&&we[0]!==2)){Yt=0;continue}if(we[0]===3&&(!Zt||we[1]>Zt[0]&&we[1]<Zt[3])){Yt.label=we[1];break}if(we[0]===6&&Yt.label<Zt[1]){Yt.label=Zt[1],Zt=we;break}if(Zt&&Yt.label<Zt[2]){Yt.label=Zt[2],Yt.ops.push(we);break}Zt[2]&&Yt.ops.pop(),Yt.trys.pop();continue}we=Lt.call(Rt,Yt)}catch(Ee){we=[6,Ee],Nt=0}finally{Pt=Zt=0}if(5&we[0])throw we[1];return{value:we[0]?we[1]:void 0,done:!0}}([De,Ue])}}}function he(){for(var Rt=0,Lt=0,Pt=arguments.length;Lt<Pt;Lt++)Rt+=arguments[Lt].length;var Nt=Array(Rt),Zt=0;for(Lt=0;Lt<Pt;Lt++)for(var Mt=arguments[Lt],Yt=0,Ge=Mt.length;Yt<Ge;Yt++,Zt++)Nt[Zt]=Mt[Yt];return Nt}var Dt=function(){function Rt(){}return Rt.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},Rt.setAttributes=function(Lt,Pt){for(var Nt=0,Zt=Pt;Nt<Zt.length;Nt++){var Mt=Zt[Nt],Yt=Mt[0],Ge=Mt[1];Lt.setAttribute(Yt,Ge)}},Rt.createRect=function(Lt,Pt,Nt){var Zt=document.createElementNS("http://www.w3.org/2000/svg","rect");return Zt.setAttribute("width",Lt.toString()),Zt.setAttribute("height",Pt.toString()),Nt&&Rt.setAttributes(Zt,Nt),Zt},Rt.createLine=function(Lt,Pt,Nt,Zt,Mt){var Yt=document.createElementNS("http://www.w3.org/2000/svg","line");return Yt.setAttribute("x1",Lt.toString()),Yt.setAttribute("y1",Pt.toString()),Yt.setAttribute("x2",Nt.toString()),Yt.setAttribute("y2",Zt.toString()),Mt&&Rt.setAttributes(Yt,Mt),Yt},Rt.createPolygon=function(Lt,Pt){var Nt=document.createElementNS("http://www.w3.org/2000/svg","polygon");return Nt.setAttribute("points",Lt),Pt&&Rt.setAttributes(Nt,Pt),Nt},Rt.createCircle=function(Lt,Pt){var Nt=document.createElementNS("http://www.w3.org/2000/svg","circle");return Nt.setAttribute("cx",(Lt/2).toString()),Nt.setAttribute("cy",(Lt/2).toString()),Nt.setAttribute("r",Lt.toString()),Pt&&Rt.setAttributes(Nt,Pt),Nt},Rt.createEllipse=function(Lt,Pt,Nt){var Zt=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return Zt.setAttribute("cx",(Lt/2).toString()),Zt.setAttribute("cy",(Pt/2).toString()),Zt.setAttribute("rx",(Lt/2).toString()),Zt.setAttribute("ry",(Pt/2).toString()),Nt&&Rt.setAttributes(Zt,Nt),Zt},Rt.createGroup=function(Lt){var Pt=document.createElementNS("http://www.w3.org/2000/svg","g");return Lt&&Rt.setAttributes(Pt,Lt),Pt},Rt.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},Rt.createMarker=function(Lt,Pt,Nt,Zt,Mt,Yt,Ge){var De=document.createElementNS("http://www.w3.org/2000/svg","marker");return Rt.setAttributes(De,[["id",Lt],["orient",Pt],["markerWidth",Nt.toString()],["markerHeight",Zt.toString()],["refX",Mt.toString()],["refY",Yt.toString()]]),De.appendChild(Ge),De},Rt.createText=function(Lt){var Pt=document.createElementNS("http://www.w3.org/2000/svg","text");return Pt.setAttribute("x","0"),Pt.setAttribute("y","0"),Lt&&Rt.setAttributes(Pt,Lt),Pt},Rt.createTSpan=function(Lt,Pt){var Nt=document.createElementNS("http://www.w3.org/2000/svg","tspan");return Nt.textContent=Lt,Pt&&Rt.setAttributes(Nt,Pt),Nt},Rt.createImage=function(Lt){var Pt=document.createElementNS("http://www.w3.org/2000/svg","image");return Lt&&Rt.setAttributes(Pt,Lt),Pt},Rt.createPoint=function(Lt,Pt){var Nt=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return Nt.x=Lt,Nt.y=Pt,Nt},Rt.createPath=function(Lt,Pt){var Nt=document.createElementNS("http://www.w3.org/2000/svg","path");return Nt.setAttribute("d",Lt),Pt&&Rt.setAttributes(Nt,Pt),Nt},Rt}(),qt=function(){function Rt(){}return Rt.addKey=function(Lt){Rt.key=Lt},Object.defineProperty(Rt,"isLicensed",{get:function(){return!!Rt.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(Rt.key)},enumerable:!1,configurable:!0}),Rt}(),me=function(){function Rt(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return Rt.prototype.rasterize=function(Lt,Pt,Nt){var Zt=this;return new Promise(function(Mt){var Yt=Nt!==void 0?Nt:document.createElement("canvas");Lt===null&&(Zt.markersOnly=!0,Zt.naturalSize=!1);var Ge=document.createElementNS("http://www.w3.org/2000/svg","svg");Ge.setAttribute("xmlns","http://www.w3.org/2000/svg"),Ge.setAttribute("width",Pt.width.baseVal.valueAsString),Ge.setAttribute("height",Pt.height.baseVal.valueAsString),Ge.setAttribute("viewBox","0 0 "+Pt.viewBox.baseVal.width.toString()+" "+Pt.viewBox.baseVal.height.toString()),Ge.innerHTML=Pt.innerHTML,Zt.naturalSize===!0?(Ge.width.baseVal.value=Lt.naturalWidth,Ge.height.baseVal.value=Lt.naturalHeight):Zt.width!==void 0&&Zt.height!==void 0&&(Ge.width.baseVal.value=Zt.width,Ge.height.baseVal.value=Zt.height),Yt.width=Ge.width.baseVal.value,Yt.height=Ge.height.baseVal.value;var De=Ge.outerHTML,Ue=Yt.getContext("2d");Zt.markersOnly!==!0&&Ue.drawImage(Lt,0,0,Yt.width,Yt.height);var we=window.URL,Ee=new Image(Yt.width,Yt.height);Ee.setAttribute("crossOrigin","anonymous");var Fe=new Blob([De],{type:"image/svg+xml"}),He=we.createObjectURL(Fe);Ee.onload=function(){Ue.drawImage(Ee,0,0),we.revokeObjectURL(He);var qe=Yt.toDataURL(Zt.imageType,Zt.imageQuality);Mt(qe)},Ee.src=He})},Rt}(),ne=function(){},jt=function(){function Rt(Lt){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+Lt+"_"}return Object.defineProperty(Rt.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(Rt.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(Rt.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(Rt.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(Rt.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"fade_out"},enumerable:!1,configurable:!0}),Rt.prototype.addClass=function(Lt){return this.styleSheet===void 0&&this.addStyleSheet(),Lt.name=""+this.classNamePrefix+Lt.localName,this.classes.push(Lt),this.styleSheet.sheet.insertRule("."+Lt.name+" {"+Lt.style+"}",this.styleSheet.sheet.cssRules.length),Lt},Rt.prototype.addRule=function(Lt){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(Lt),this.styleSheet.sheet.insertRule(Lt.selector+" {"+Lt.style+"}",this.styleSheet.sheet.cssRules.length)},Rt.prototype.addStyleSheet=function(){var Lt;this.styleSheet=document.createElement("style"),((Lt=this.styleSheetRoot)!==null&&Lt!==void 0?Lt:document.head).appendChild(this.styleSheet),this.addRule(new Te("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new Te("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
|
|
from {
|
|
opacity: 0;
|
|
}
|
|
to {
|
|
opacity: 1;
|
|
}
|
|
`)),this.addRule(new Te("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
|
|
from {
|
|
opacity: 1;
|
|
}
|
|
to {
|
|
opacity: 0;
|
|
}
|
|
`)),this.addClass(new se("fade_in",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
|
|
`)),this.addClass(new se("fade_out",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
|
|
`))},Rt.prototype.removeStyleSheet=function(){var Lt;this.styleSheet&&(((Lt=this.styleSheetRoot)!==null&&Lt!==void 0?Lt:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},Rt}(),Te=function(Rt,Lt){this.selector=Rt,this.style=Lt},se=function(Rt,Lt){this.localName=Rt,this.style=Lt},Ce=function(){function Rt(Lt,Pt,Nt,Zt,Mt){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=Lt,this.displayMode=Pt,this.markerItems=Nt,this.uiStyleSettings=Zt,this.styles=Mt,this.addStyles(),this.adjustLayout=this.adjustLayout.bind(this),this.overflowButtonClicked=this.overflowButtonClicked.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this)}return Rt.prototype.show=function(Lt){var Pt=this;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=Lt,this.uiContainer.className=this.toolbarStyleClass.name+" "+this.styles.fadeInAnimationClassName+" "+(this.uiStyleSettings.toolbarStyleColorsClassName?this.uiStyleSettings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name);var Nt=document.createElement("div");Nt.className=this.toolbarBlockStyleClass.name,Nt.style.whiteSpace="nowrap",this.uiContainer.appendChild(Nt),this.addActionButton(Nt,'<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(Nt,'<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(Nt,'<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(Nt,'<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(Nt,'<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(Nt,'<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(Nt,'<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(Nt,'<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(Mt){var Yt=document.createElement("div");Yt.className=""+Pt.toolbarButtonStyleClass.name,Yt.setAttribute("data-type-name",Mt.typeName),Yt.innerHTML=Mt.icon,Yt.addEventListener("click",function(){Pt.markerToolbarButtonClicked(Yt,Mt)}),Pt.buttons.push(Yt),Pt.markerButtons.push(Yt)}),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 Zt=document.createElement("div");Zt.className=this.toolbarBlockStyleClass.name,Zt.style.whiteSpace="nowrap",Zt.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(Zt),this.addActionButton(Zt,'<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(Zt,'<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()},Rt.prototype.addButtonClickListener=function(Lt){this.buttonClickListeners.push(Lt)},Rt.prototype.removeButtonClickListener=function(Lt){this.buttonClickListeners.indexOf(Lt)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(Lt),1)},Rt.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},Rt.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var Lt=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var Pt=0;Pt<this.markerButtons.length;Pt++)Pt<Lt||Pt===Lt&&this.markerButtons.length-1===Lt?this.markerButtonBlock.appendChild(this.markerButtons[Pt]):(Pt===Lt&&this.markerButtonBlock.appendChild(this.overflowButton),this.markerButtonOverflowBlock.appendChild(this.markerButtons[Pt]))}},Rt.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")},Rt.prototype.resetButtonStyles=function(){var Lt=this;this.buttons.forEach(function(Pt){Pt.className=Pt.className.replace(Lt.uiStyleSettings.toolbarButtonStyleColorsClassName?Lt.uiStyleSettings.toolbarButtonStyleColorsClassName:Lt.toolbarButtonStyleColorsClass.name,"").trim(),Pt.className=Pt.className.replace(Lt.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?Lt.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:Lt.toolbarActiveButtonStyleColorsClass.name,"").trim(),Pt.className+=" "+(Lt.uiStyleSettings.toolbarButtonStyleColorsClassName?Lt.uiStyleSettings.toolbarButtonStyleColorsClassName:Lt.toolbarButtonStyleColorsClass.name)})},Rt.prototype.addActionButton=function(Lt,Pt,Nt){var Zt=this,Mt=document.createElement("div");switch(Mt.className=""+this.toolbarButtonStyleClass.name,Mt.innerHTML=Pt,Mt.setAttribute("data-action",Nt),Mt.addEventListener("click",function(){Zt.actionToolbarButtonClicked(Mt,Nt)}),Nt){case"select":Mt.style.fill=this.uiStyleSettings.selectButtonColor;break;case"delete":case"clear":Mt.style.fill=this.uiStyleSettings.deleteButtonColor;break;case"undo":case"redo":Mt.style.fill=this.uiStyleSettings.selectButtonColor;break;case"render":Mt.style.fill=this.uiStyleSettings.okButtonColor;break;case"close":Mt.style.fill=this.uiStyleSettings.closeButtonColor}Lt.appendChild(Mt),this.buttons.push(Mt)},Rt.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new se("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 se("toolbar_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
|
|
`)),this.toolbarBlockStyleClass=this.styles.addClass(new se("toolbar-block",`
|
|
display: inline-block;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new se("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 se("toolbar-overflow-block_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
`));var Lt=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new se("toolbar_button",`
|
|
display: inline-block;
|
|
width: `+(this.uiStyleSettings.toolbarHeight-2*Lt)+`px;
|
|
height: `+(this.uiStyleSettings.toolbarHeight-2*Lt)+`px;
|
|
padding: `+Lt+`px;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new se("toolbar_button_colors",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new se("toolbar_active_button",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`)),this.styles.addRule(new Te("."+this.toolbarButtonStyleClass.name+" svg",`
|
|
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
|
|
`)),this.styles.addRule(new Te("."+this.toolbarButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`))},Rt.prototype.markerToolbarButtonClicked=function(Lt,Pt){this.setActiveButton(Lt),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(Nt){return Nt("marker",Pt)}),this.markerButtonOverflowBlock.style.display="none"},Rt.prototype.actionToolbarButtonClicked=function(Lt,Pt){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(Nt){return Nt("action",Pt)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},Rt.prototype.setActiveButton=function(Lt){this.resetButtonStyles(),Lt.className=Lt.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),Lt.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},Rt.prototype.setActiveMarkerButton=function(Lt){var Pt=this.markerButtons.find(function(Nt){return Nt.getAttribute("data-type-name")===Lt});Pt&&this.setActiveButton(Pt)},Rt.prototype.setCurrentMarker=function(Lt){var Pt=this;this.currentMarker=Lt,this.buttons.filter(function(Nt){return/delete|notes/.test(Nt.getAttribute("data-action"))}).forEach(function(Nt){Pt.currentMarker===void 0?(Nt.style.fillOpacity="0.4",Nt.style.pointerEvents="none"):(Nt.style.fillOpacity="1",Nt.style.pointerEvents="all")})},Rt}(),Bt=function(){function Rt(Lt,Pt,Nt,Zt){this.panels=[],this.panelButtons=[],this.markerjsContainer=Lt,this.displayMode=Pt,this.uiStyleSettings=Nt,this.styles=Zt,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return Rt.prototype.addStyles=function(){var Lt;this.toolboxStyleClass=this.styles.addClass(new se("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 se("toolbox_colors",`
|
|
color: `+this.uiStyleSettings.toolboxColor+`;
|
|
`));var Pt=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new se("toolbox-button-row",`
|
|
display: flex;
|
|
cursor: default;
|
|
box-sizing: content-box;
|
|
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new se("toolbox-button-row_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new se("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 se("toolbox-panel-row_colors",`
|
|
background-color: `+((Lt=this.uiStyleSettings.toolboxBackgroundColor)!==null&&Lt!==void 0?Lt:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
|
|
`)),this.toolboxButtonStyleClass=this.styles.addClass(new se("toolbox_button",`
|
|
display: inline-block;
|
|
width: `+(this.uiStyleSettings.toolbarHeight-2*Pt)+`px;
|
|
height: `+(this.uiStyleSettings.toolbarHeight-2*Pt)+`px;
|
|
padding: `+Pt+`px;
|
|
box-sizing: content-box;
|
|
`)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new se("toolbox-button_colors",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new se("toolbox-active-button_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.styles.addRule(new Te("."+this.toolboxButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`)),this.styles.addRule(new Te("."+this.toolboxButtonStyleClass.name+" svg",`
|
|
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
|
|
`))},Rt.prototype.show=function(Lt){var Pt;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=Lt,this.uiContainer.className=this.toolboxStyleClass.name+" "+((Pt=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&Pt!==void 0?Pt:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},Rt.prototype.setPanelButtons=function(Lt){var Pt,Nt,Zt=this;this.panels=Lt,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((Pt=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&Pt!==void 0?Pt:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((Nt=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&Nt!==void 0?Nt:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(Mt){var Yt;Mt.uiStyleSettings=Zt.uiStyleSettings;var Ge=document.createElement("div");Ge.className=Zt.toolboxButtonStyleClass.name+" "+((Yt=Zt.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&Yt!==void 0?Yt:Zt.toolboxButtonStyleColorsClass.name),Ge.innerHTML=Mt.icon,Ge.title=Mt.title,Ge.addEventListener("click",function(){Zt.panelButtonClick(Mt)}),Zt.panelButtons.push(Ge),Zt.buttonRow.appendChild(Ge)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},Rt.prototype.panelButtonClick=function(Lt){var Pt=this,Nt=-1;if(Lt!==this.activePanel){Nt=this.panels.indexOf(Lt),this.panelRow.innerHTML="";var Zt=Lt.getUi();Zt.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(Zt),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=Lt}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){Pt.displayMode==="inline"?Pt.panelRow.style.display="none":Pt.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(Mt,Yt){var Ge,De;Mt.className=Pt.toolboxButtonStyleClass.name+" "+(Yt===Nt?""+((Ge=Pt.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&Ge!==void 0?Ge:Pt.toolboxActiveButtonStyleColorsClass.name):""+((De=Pt.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&De!==void 0?De:Pt.toolboxButtonStyleColorsClass.name))})},Rt}(),nt=function(Rt,Lt){this.title=Rt,this.icon=Lt},et=function(Rt){function Lt(Pt,Nt,Zt,Mt){var Yt=Rt.call(this,Pt,Mt||'<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 Yt.colors=[],Yt.addTransparent=!1,Yt.colorBoxes=[],Yt.colors=Nt,Yt.currentColor=Zt,Yt.setCurrentColor=Yt.setCurrentColor.bind(Yt),Yt.getColorBox=Yt.getColorBox.bind(Yt),Yt}return Ut(Lt,Rt),Lt.prototype.getUi=function(){var Pt=this,Nt=document.createElement("div");return Nt.style.overflow="hidden",Nt.style.whiteSpace="nowrap",this.colors.forEach(function(Zt){var Mt=Pt.getColorBox(Zt);Nt.appendChild(Mt),Pt.colorBoxes.push(Mt)}),Nt},Lt.prototype.getColorBox=function(Pt){var Nt=this,Zt=this.uiStyleSettings.toolbarHeight/4,Mt=this.uiStyleSettings.toolbarHeight-Zt,Yt=document.createElement("div");Yt.style.display="inline-block",Yt.style.boxSizing="content-box",Yt.style.width=Mt-2+"px",Yt.style.height=Mt-2+"px",Yt.style.padding="1px",Yt.style.marginRight="2px",Yt.style.marginBottom="2px",Yt.style.borderWidth="2px",Yt.style.borderStyle="solid",Yt.style.borderRadius=(Mt+2)/2+"px",Yt.style.borderColor=Pt===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",Yt.addEventListener("click",function(){Nt.setCurrentColor(Pt,Yt)});var Ge=document.createElement("div");return Ge.style.display="inline-block",Ge.style.width=Mt-2+"px",Ge.style.height=Mt-2+"px",Ge.style.backgroundColor=Pt,Ge.style.borderRadius=Mt/2+"px",Pt==="transparent"&&(Ge.style.fill=this.uiStyleSettings.toolboxAccentColor,Ge.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>`),Yt.appendChild(Ge),Yt},Lt.prototype.setCurrentColor=function(Pt,Nt){var Zt=this;this.currentColor=Pt,this.colorBoxes.forEach(function(Mt){Mt.style.borderColor=Mt===Nt?Zt.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(Pt)},Lt}(nt),ht=function(){function Rt(Lt,Pt,Nt){this._state="new",this._isSelected=!1,this._container=Lt,this._overlayContainer=Pt,this.globalSettings=Nt,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(Rt.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(Rt.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(Rt.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(Rt.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(Rt.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),Rt.prototype.ownsTarget=function(Lt){return!1},Object.defineProperty(Rt.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),Rt.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},Rt.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},Rt.prototype.pointerDown=function(Lt,Pt){},Rt.prototype.dblClick=function(Lt,Pt){},Rt.prototype.manipulate=function(Lt){},Rt.prototype.pointerUp=function(Lt){this.stateChanged()},Rt.prototype.dispose=function(){},Rt.prototype.addMarkerVisualToContainer=function(Lt){this.container.childNodes.length>0?this.container.insertBefore(Lt,this.container.childNodes[0]):this.container.appendChild(Lt)},Rt.prototype.getState=function(){return{typeName:Rt.typeName,state:this.state,notes:this.notes}},Rt.prototype.restoreState=function(Lt){this._state=Lt.state,this.notes=Lt.notes},Rt.prototype.scale=function(Lt,Pt){},Rt.prototype.colorChanged=function(Lt){this.onColorChanged&&this.onColorChanged(Lt),this.stateChanged()},Rt.prototype.fillColorChanged=function(Lt){this.onFillColorChanged&&this.onFillColorChanged(Lt),this.stateChanged()},Rt.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var Lt=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),Lt.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(Lt)&&this.onStateChanged(this)}},Rt.typeName="MarkerBase",Rt}(),st=function(){function Rt(){this.findGripByVisual=this.findGripByVisual.bind(this)}return Rt.prototype.findGripByVisual=function(Lt){return this.topLeft.ownsTarget(Lt)?this.topLeft:this.topCenter.ownsTarget(Lt)?this.topCenter:this.topRight.ownsTarget(Lt)?this.topRight:this.centerLeft.ownsTarget(Lt)?this.centerLeft:this.centerRight.ownsTarget(Lt)?this.centerRight:this.bottomLeft.ownsTarget(Lt)?this.bottomLeft:this.bottomCenter.ownsTarget(Lt)?this.bottomCenter:this.bottomRight.ownsTarget(Lt)?this.bottomRight:void 0},Rt}(),gt=function(){function Rt(){this.GRIP_SIZE=10,this.visual=Dt.createGroup(),this.visual.appendChild(Dt.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(Dt.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return Rt.prototype.ownsTarget=function(Lt){return Lt===this.visual||Lt===this.visual.childNodes[0]||Lt===this.visual.childNodes[1]},Rt}(),vt=function(){function Rt(){}return Rt.toITransformMatrix=function(Lt){return{a:Lt.a,b:Lt.b,c:Lt.c,d:Lt.d,e:Lt.e,f:Lt.f}},Rt.toSVGMatrix=function(Lt,Pt){return Lt.a=Pt.a,Lt.b=Pt.b,Lt.c=Pt.c,Lt.d=Pt.d,Lt.e=Pt.e,Lt.f=Pt.f,Lt},Rt}(),St=function(Rt){function Lt(Pt,Nt,Zt){var Mt=Rt.call(this,Pt,Nt,Zt)||this;return Mt.left=0,Mt.top=0,Mt.width=0,Mt.height=0,Mt.defaultSize={x:50,y:20},Mt.offsetX=0,Mt.offsetY=0,Mt.rotationAngle=0,Mt.CB_DISTANCE=10,Mt._suppressMarkerCreateEvent=!1,Mt.container.transform.baseVal.appendItem(Dt.createTransform()),Mt.setupControlBox(),Mt}return Ut(Lt,Rt),Object.defineProperty(Lt.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(Lt.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(Lt.prototype,"visual",{get:function(){return this._visual},set:function(Pt){this._visual=Pt;var Nt=Dt.createTransform();this._visual.transform.baseVal.appendItem(Nt)},enumerable:!1,configurable:!0}),Lt.prototype.ownsTarget=function(Pt){return!!Rt.prototype.ownsTarget.call(this,Pt)||!!(this.controlGrips.findGripByVisual(Pt)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(Pt))},Lt.prototype.pointerDown=function(Pt,Nt){Rt.prototype.pointerDown.call(this,Pt,Nt),this.state==="new"&&(this.left=Pt.x,this.top=Pt.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var Zt=this.unrotatePoint(Pt);if(this.manipulationStartX=Zt.x,this.manipulationStartY=Zt.y,this.offsetX=Zt.x-this.left,this.offsetY=Zt.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(Nt),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(Nt)){this.activeGrip=this.rotatorGrip;var Mt=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=Mt.x-this.width/2,this.top=Mt.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var Yt=this.container.transform.baseVal.getItem(0);Yt.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(Yt,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},Lt.prototype.pointerUp=function(Pt){var Nt=this.state;Rt.prototype.pointerUp.call(this,Pt),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(Pt),this._state="select",Nt==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},Lt.prototype.moveVisual=function(Pt){this.visual.style.transform="translate("+Pt.x+"px, "+Pt.y+"px)"},Lt.prototype.manipulate=function(Pt){var Nt=this.unrotatePoint(Pt);this.state==="creating"?this.resize(Pt):this.state==="move"?(this.left=this.manipulationStartLeft+(Nt.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(Nt.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(Nt):this.state==="rotate"&&this.rotate(Pt)},Lt.prototype.resize=function(Pt){var Nt=this.manipulationStartLeft,Zt=this.manipulationStartWidth,Mt=this.manipulationStartTop,Yt=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:Nt=this.manipulationStartLeft+Pt.x-this.manipulationStartX,Zt=this.manipulationStartWidth+this.manipulationStartLeft-Nt;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:Zt=this.manipulationStartWidth+Pt.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:Mt=this.manipulationStartTop+Pt.y-this.manipulationStartY,Yt=this.manipulationStartHeight+this.manipulationStartTop-Mt;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:Yt=this.manipulationStartHeight+Pt.y-this.manipulationStartY}Zt>=0?(this.left=Nt,this.width=Zt):(this.left=Nt+Zt,this.width=-Zt),Yt>=0?(this.top=Mt,this.height=Yt):(this.top=Mt+Yt,this.height=-Yt),this.setSize()},Lt.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},Lt.prototype.rotate=function(Pt){if(Math.abs(Pt.x-this.centerX)>.1){var Nt=Math.sign(Pt.x-this.centerX);this.rotationAngle=180*Math.atan((Pt.y-this.centerY)/(Pt.x-this.centerX))/Math.PI+90*Nt,this.applyRotation()}},Lt.prototype.applyRotation=function(){var Pt=this.container.transform.baseVal.getItem(0);Pt.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(Pt,0)},Lt.prototype.rotatePoint=function(Pt){if(this.rotationAngle===0)return Pt;var Nt=this.container.getCTM(),Zt=Dt.createPoint(Pt.x,Pt.y);return{x:(Zt=Zt.matrixTransform(Nt)).x,y:Zt.y}},Lt.prototype.unrotatePoint=function(Pt){if(this.rotationAngle===0)return Pt;var Nt=this.container.getCTM();Nt=Nt.inverse();var Zt=Dt.createPoint(Pt.x,Pt.y);return{x:(Zt=Zt.matrixTransform(Nt)).x,y:Zt.y}},Lt.prototype.select=function(){Rt.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},Lt.prototype.deselect=function(){Rt.prototype.deselect.call(this),this.controlBox.style.display="none"},Lt.prototype.setupControlBox=function(){this.controlBox=Dt.createGroup();var Pt=Dt.createTransform();Pt.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(Pt),this.container.appendChild(this.controlBox),this.controlRect=Dt.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=Dt.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 st,this.addControlGrips(),this.controlBox.style.display="none"},Lt.prototype.adjustControlBox=function(){var Pt=this.controlBox.transform.baseVal.getItem(0);Pt.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(Pt,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()},Lt.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()},Lt.prototype.createGrip=function(){var Pt=new gt;return Pt.visual.transform.baseVal.appendItem(Dt.createTransform()),this.controlBox.appendChild(Pt.visual),Pt},Lt.prototype.positionGrips=function(){var Pt=this.controlGrips.topLeft.GRIP_SIZE,Nt=-Pt/2,Zt=Nt,Mt=(this.width+this.CB_DISTANCE)/2-Pt/2,Yt=(this.height+this.CB_DISTANCE)/2-Pt/2,Ge=this.height+this.CB_DISTANCE-Pt/2,De=this.width+this.CB_DISTANCE-Pt/2;this.positionGrip(this.controlGrips.topLeft.visual,Nt,Zt),this.positionGrip(this.controlGrips.topCenter.visual,Mt,Zt),this.positionGrip(this.controlGrips.topRight.visual,De,Zt),this.positionGrip(this.controlGrips.centerLeft.visual,Nt,Yt),this.positionGrip(this.controlGrips.centerRight.visual,De,Yt),this.positionGrip(this.controlGrips.bottomLeft.visual,Nt,Ge),this.positionGrip(this.controlGrips.bottomCenter.visual,Mt,Ge),this.positionGrip(this.controlGrips.bottomRight.visual,De,Ge),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,Mt,Zt-3*this.CB_DISTANCE)},Lt.prototype.positionGrip=function(Pt,Nt,Zt){var Mt=Pt.transform.baseVal.getItem(0);Mt.setTranslate(Nt,Zt),Pt.transform.baseVal.replaceItem(Mt,0)},Lt.prototype.hideControlBox=function(){this.controlBox.style.display="none"},Lt.prototype.showControlBox=function(){this.controlBox.style.display=""},Lt.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)},Rt.prototype.getState.call(this))},Lt.prototype.restoreState=function(Pt){Rt.prototype.restoreState.call(this,Pt);var Nt=Pt;this.left=Nt.left,this.top=Nt.top,this.width=Nt.width,this.height=Nt.height,this.rotationAngle=Nt.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(vt.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,Nt.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(vt.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,Nt.containerTransformMatrix))},Lt.prototype.scale=function(Pt,Nt){Rt.prototype.scale.call(this,Pt,Nt);var Zt=this.rotatePoint({x:this.left,y:this.top}),Mt=this.unrotatePoint({x:Zt.x*Pt,y:Zt.y*Nt});this.left=Mt.x,this.top=Mt.y,this.width=this.width*Pt,this.height=this.height*Nt,this.adjustControlBox()},Lt}(ht),Et=function(Rt){function Lt(Pt,Nt,Zt){var Mt=Rt.call(this,Pt,Nt,Zt)||this;return Mt.fillColor="transparent",Mt.strokeColor="transparent",Mt.strokeWidth=0,Mt.strokeDasharray="",Mt.opacity=1,Mt.setStrokeColor=Mt.setStrokeColor.bind(Mt),Mt.setFillColor=Mt.setFillColor.bind(Mt),Mt.setStrokeWidth=Mt.setStrokeWidth.bind(Mt),Mt.setStrokeDasharray=Mt.setStrokeDasharray.bind(Mt),Mt.createVisual=Mt.createVisual.bind(Mt),Mt}return Ut(Lt,Rt),Lt.prototype.ownsTarget=function(Pt){return!(!Rt.prototype.ownsTarget.call(this,Pt)&&Pt!==this.visual)},Lt.prototype.createVisual=function(){this.visual=Dt.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)},Lt.prototype.pointerDown=function(Pt,Nt){Rt.prototype.pointerDown.call(this,Pt,Nt),this.state==="new"&&(this.createVisual(),this.moveVisual(Pt),this._state="creating")},Lt.prototype.manipulate=function(Pt){Rt.prototype.manipulate.call(this,Pt)},Lt.prototype.resize=function(Pt){Rt.prototype.resize.call(this,Pt),this.setSize()},Lt.prototype.setSize=function(){Rt.prototype.setSize.call(this),Dt.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},Lt.prototype.pointerUp=function(Pt){Rt.prototype.pointerUp.call(this,Pt),this.setSize()},Lt.prototype.setStrokeColor=function(Pt){this.strokeColor=Pt,this.visual&&Dt.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(Pt),this.stateChanged()},Lt.prototype.setFillColor=function(Pt){this.fillColor=Pt,this.visual&&Dt.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},Lt.prototype.setStrokeWidth=function(Pt){this.strokeWidth=Pt,this.visual&&Dt.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},Lt.prototype.setStrokeDasharray=function(Pt){this.strokeDasharray=Pt,this.visual&&Dt.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},Lt.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},Rt.prototype.getState.call(this))},Lt.prototype.restoreState=function(Pt){var Nt=Pt;this.fillColor=Nt.fillColor,this.strokeColor=Nt.strokeColor,this.strokeWidth=Nt.strokeWidth,this.strokeDasharray=Nt.strokeDasharray,this.opacity=Nt.opacity,this.createVisual(),Rt.prototype.restoreState.call(this,Pt),this.setSize()},Lt.prototype.scale=function(Pt,Nt){Rt.prototype.scale.call(this,Pt,Nt),this.setSize()},Lt.title="Rectangle marker",Lt}(St),Tt=function(Rt){function Lt(Pt,Nt,Zt,Mt){var Yt=Rt.call(this,Pt,Mt||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return Yt.widths=[],Yt.widthBoxes=[],Yt.widths=Nt,Yt.currentWidth=Zt,Yt.setCurrentWidth=Yt.setCurrentWidth.bind(Yt),Yt}return Ut(Lt,Rt),Lt.prototype.getUi=function(){var Pt=this,Nt=document.createElement("div");return Nt.style.display="flex",Nt.style.overflow="hidden",Nt.style.flexGrow="2",this.widths.forEach(function(Zt){var Mt=document.createElement("div");Mt.style.display="flex",Mt.style.flexGrow="2",Mt.style.alignItems="center",Mt.style.justifyContent="space-between",Mt.style.padding="5px",Mt.style.borderWidth="2px",Mt.style.borderStyle="solid",Mt.style.borderColor=Zt===Pt.currentWidth?Pt.uiStyleSettings.toolboxAccentColor:"transparent",Mt.addEventListener("click",function(){Pt.setCurrentWidth(Zt,Mt)}),Nt.appendChild(Mt);var Yt=document.createElement("div");Yt.innerText=Zt.toString(),Yt.style.marginRight="5px",Mt.appendChild(Yt);var Ge=document.createElement("div");Ge.style.minHeight="20px",Ge.style.flexGrow="2",Ge.style.display="flex",Ge.style.alignItems="center";var De=document.createElement("hr");De.style.minWidth="20px",De.style.border="0px",De.style.borderTop=Zt+"px solid "+Pt.uiStyleSettings.toolboxColor,De.style.flexGrow="2",Ge.appendChild(De),Mt.appendChild(Ge),Pt.widthBoxes.push(Mt)}),Nt},Lt.prototype.setCurrentWidth=function(Pt,Nt){var Zt=this;this.currentWidth=Pt,this.widthBoxes.forEach(function(Mt){Mt.style.borderColor=Mt===Nt?Zt.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},Lt}(nt),Ot=function(Rt){function Lt(Pt,Nt,Zt,Mt){var Yt=Rt.call(this,Pt,Mt||'<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 Yt.styles=[],Yt.styleBoxes=[],Yt.styles=Nt,Yt.currentStyle=Zt,Yt.setCurrentStyle=Yt.setCurrentStyle.bind(Yt),Yt}return Ut(Lt,Rt),Lt.prototype.getUi=function(){var Pt=this,Nt=document.createElement("div");return Nt.style.display="flex",Nt.style.overflow="hidden",Nt.style.flexGrow="2",this.styles.forEach(function(Zt){var Mt=document.createElement("div");Mt.style.display="flex",Mt.style.alignItems="center",Mt.style.justifyContent="space-between",Mt.style.padding="5px",Mt.style.borderWidth="2px",Mt.style.borderStyle="solid",Mt.style.overflow="hidden",Mt.style.maxWidth=100/Pt.styles.length-5+"%",Mt.style.borderColor=Zt===Pt.currentStyle?Pt.uiStyleSettings.toolboxAccentColor:"transparent",Mt.addEventListener("click",function(){Pt.setCurrentStyle(Zt,Mt)}),Nt.appendChild(Mt);var Yt=document.createElement("div");Yt.style.minHeight="20px",Yt.style.flexGrow="2",Yt.style.overflow="hidden";var Ge=`<svg width="100" height="20">
|
|
<line x1="0" y1="10" x2="100" y2="10" stroke="`+Pt.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(Zt!==""?'stroke-dasharray="'+Zt+'"':"")+` />
|
|
</svg>`;Yt.innerHTML=Ge,Mt.appendChild(Yt),Pt.styleBoxes.push(Mt)}),Nt},Lt.prototype.setCurrentStyle=function(Pt,Nt){var Zt=this;this.currentStyle=Pt,this.styleBoxes.forEach(function(Mt){Mt.style.borderColor=Mt===Nt?Zt.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},Lt}(nt),$t=function(Rt){function Lt(Pt,Nt,Zt){var Mt=Rt.call(this,Pt,Nt,Zt)||this;return Mt.strokeColor=Zt.defaultColor,Mt.strokeWidth=Zt.defaultStrokeWidth,Mt.strokeDasharray=Zt.defaultStrokeDasharray,Mt.strokePanel=new et("Line color",Zt.defaultColorSet,Zt.defaultColor),Mt.strokePanel.onColorChanged=Mt.setStrokeColor,Mt.strokeWidthPanel=new Tt("Line width",Zt.defaultStrokeWidths,Zt.defaultStrokeWidth),Mt.strokeWidthPanel.onWidthChanged=Mt.setStrokeWidth,Mt.strokeStylePanel=new Ot("Line style",Zt.defaultStrokeDasharrays,Zt.defaultStrokeDasharray),Mt.strokeStylePanel.onStyleChanged=Mt.setStrokeDasharray,Mt}return Ut(Lt,Rt),Object.defineProperty(Lt.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),Lt.prototype.getState=function(){var Pt=Rt.prototype.getState.call(this);return Pt.typeName=Lt.typeName,Pt},Lt.typeName="FrameMarker",Lt.title="Frame marker",Lt.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4m14 11H6V8h12v9z"/></svg>',Lt}(Et),Xt=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"},Ht=function(Rt){function Lt(Pt,Nt,Zt){var Mt=Rt.call(this,Pt,Nt,Zt)||this;return Mt.x1=0,Mt.y1=0,Mt.x2=0,Mt.y2=0,Mt.defaultLength=50,Mt.manipulationStartX=0,Mt.manipulationStartY=0,Mt.manipulationStartX1=0,Mt.manipulationStartY1=0,Mt.manipulationStartX2=0,Mt.manipulationStartY2=0,Mt.setupControlBox(),Mt}return Ut(Lt,Rt),Lt.prototype.ownsTarget=function(Pt){return!!Rt.prototype.ownsTarget.call(this,Pt)||!(!this.grip1.ownsTarget(Pt)&&!this.grip2.ownsTarget(Pt))},Lt.prototype.pointerDown=function(Pt,Nt){Rt.prototype.pointerDown.call(this,Pt,Nt),this.manipulationStartX=Pt.x,this.manipulationStartY=Pt.y,this.state==="new"&&(this.x1=Pt.x,this.y1=Pt.y,this.x2=Pt.x,this.y2=Pt.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(Nt)?this.activeGrip=this.grip1:this.grip2.ownsTarget(Nt)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},Lt.prototype.pointerUp=function(Pt){var Nt=this.state;Rt.prototype.pointerUp.call(this,Pt),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(Pt),this._state="select",Nt==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},Lt.prototype.adjustVisual=function(){},Lt.prototype.manipulate=function(Pt){this.state==="creating"?this.resize(Pt):this.state==="move"?(this.x1=this.manipulationStartX1+Pt.x-this.manipulationStartX,this.y1=this.manipulationStartY1+Pt.y-this.manipulationStartY,this.x2=this.manipulationStartX2+Pt.x-this.manipulationStartX,this.y2=this.manipulationStartY2+Pt.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(Pt)},Lt.prototype.resize=function(Pt){switch(this.activeGrip){case this.grip1:this.x1=Pt.x,this.y1=Pt.y;break;case this.grip2:case void 0:this.x2=Pt.x,this.y2=Pt.y}this.adjustVisual(),this.adjustControlBox()},Lt.prototype.select=function(){Rt.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},Lt.prototype.deselect=function(){Rt.prototype.deselect.call(this),this.controlBox.style.display="none"},Lt.prototype.setupControlBox=function(){this.controlBox=Dt.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},Lt.prototype.adjustControlBox=function(){this.positionGrips()},Lt.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},Lt.prototype.createGrip=function(){var Pt=new gt;return Pt.visual.transform.baseVal.appendItem(Dt.createTransform()),this.controlBox.appendChild(Pt.visual),Pt},Lt.prototype.positionGrips=function(){var Pt=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-Pt/2,this.y1-Pt/2),this.positionGrip(this.grip2.visual,this.x2-Pt/2,this.y2-Pt/2)},Lt.prototype.positionGrip=function(Pt,Nt,Zt){var Mt=Pt.transform.baseVal.getItem(0);Mt.setTranslate(Nt,Zt),Pt.transform.baseVal.replaceItem(Mt,0)},Lt.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},Rt.prototype.getState.call(this))},Lt.prototype.restoreState=function(Pt){Rt.prototype.restoreState.call(this,Pt);var Nt=Pt;this.x1=Nt.x1,this.y1=Nt.y1,this.x2=Nt.x2,this.y2=Nt.y2},Lt.prototype.scale=function(Pt,Nt){Rt.prototype.scale.call(this,Pt,Nt),this.x1=this.x1*Pt,this.y1=this.y1*Nt,this.x2=this.x2*Pt,this.y2=this.y2*Nt,this.adjustVisual(),this.adjustControlBox()},Lt}(ht),ve=function(Rt){function Lt(Pt,Nt,Zt){var Mt=Rt.call(this,Pt,Nt,Zt)||this;return Mt.strokeColor="transparent",Mt.strokeWidth=0,Mt.strokeDasharray="",Mt.setStrokeColor=Mt.setStrokeColor.bind(Mt),Mt.setStrokeWidth=Mt.setStrokeWidth.bind(Mt),Mt.setStrokeDasharray=Mt.setStrokeDasharray.bind(Mt),Mt.strokeColor=Zt.defaultColor,Mt.strokeWidth=Zt.defaultStrokeWidth,Mt.strokeDasharray=Zt.defaultStrokeDasharray,Mt.strokePanel=new et("Line color",Zt.defaultColorSet,Zt.defaultColor),Mt.strokePanel.onColorChanged=Mt.setStrokeColor,Mt.strokeWidthPanel=new Tt("Line width",Zt.defaultStrokeWidths,Zt.defaultStrokeWidth),Mt.strokeWidthPanel.onWidthChanged=Mt.setStrokeWidth,Mt.strokeStylePanel=new Ot("Line style",Zt.defaultStrokeDasharrays,Zt.defaultStrokeDasharray),Mt.strokeStylePanel.onStyleChanged=Mt.setStrokeDasharray,Mt}return Ut(Lt,Rt),Lt.prototype.ownsTarget=function(Pt){return!(!Rt.prototype.ownsTarget.call(this,Pt)&&Pt!==this.visual&&Pt!==this.selectorLine&&Pt!==this.visibleLine)},Lt.prototype.createVisual=function(){this.visual=Dt.createGroup(),this.selectorLine=Dt.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=Dt.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)},Lt.prototype.pointerDown=function(Pt,Nt){Rt.prototype.pointerDown.call(this,Pt,Nt),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},Lt.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()),Dt.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),Dt.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),Dt.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},Lt.prototype.setStrokeColor=function(Pt){this.strokeColor=Pt,this.adjustVisual(),this.colorChanged(Pt)},Lt.prototype.setStrokeWidth=function(Pt){this.strokeWidth=Pt,this.adjustVisual()},Lt.prototype.setStrokeDasharray=function(Pt){this.strokeDasharray=Pt,this.adjustVisual(),this.stateChanged()},Object.defineProperty(Lt.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),Lt.prototype.getState=function(){var Pt=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},Rt.prototype.getState.call(this));return Pt.typeName=Lt.typeName,Pt},Lt.prototype.restoreState=function(Pt){Rt.prototype.restoreState.call(this,Pt);var Nt=Pt;this.strokeColor=Nt.strokeColor,this.strokeWidth=Nt.strokeWidth,this.strokeDasharray=Nt.strokeDasharray,this.createVisual(),this.adjustVisual()},Lt.typeName="LineMarker",Lt.title="Line marker",Lt.icon='<svg viewBox="0 0 24 24"><path d="M19 13H5v-2h14v2z"/></svg>',Lt}(Ht),ie=function(Rt){function Lt(Pt,Nt,Zt,Mt){var Yt=Rt.call(this,Pt,Mt||'<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 Yt.fonts=[],Yt.fontBoxes=[],Yt.fonts=Nt,Yt.currentFont=Zt,Yt.setCurrentFont=Yt.setCurrentFont.bind(Yt),Yt}return Ut(Lt,Rt),Lt.prototype.getUi=function(){var Pt=this,Nt=document.createElement("div");return Nt.style.overflow="hidden",Nt.style.flexGrow="2",this.fonts.forEach(function(Zt){var Mt=document.createElement("div");Mt.style.display="inline-block",Mt.style.alignItems="center",Mt.style.justifyContent="space-between",Mt.style.padding="5px",Mt.style.borderWidth="2px",Mt.style.borderStyle="solid",Mt.style.overflow="hidden",Mt.style.maxWidth=100/Pt.fonts.length-5+"%",Mt.style.borderColor=Zt===Pt.currentFont?Pt.uiStyleSettings.toolboxAccentColor:"transparent",Mt.addEventListener("click",function(){Pt.setCurrentFont(Zt,Mt)}),Nt.appendChild(Mt);var Yt=document.createElement("div");Yt.style.display="flex",Yt.style.minHeight="20px",Yt.style.flexGrow="2",Yt.style.fontFamily=Zt,Yt.style.overflow="hidden";var Ge=document.createElement("div");Ge.style.whiteSpace="nowrap",Ge.style.overflow="hidden",Ge.style.textOverflow="ellipsis",Ge.innerHTML="The quick brown fox jumps over the lazy dog",Yt.appendChild(Ge),Mt.appendChild(Yt),Pt.fontBoxes.push(Mt)}),Nt},Lt.prototype.setCurrentFont=function(Pt,Nt){var Zt=this;this.currentFont=Pt,this.fontBoxes.forEach(function(Mt){Mt.style.borderColor=Mt===Nt?Zt.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},Lt}(nt),Ne=function(Rt){function Lt(Pt,Nt,Zt){var Mt=Rt.call(this,Pt,Nt,Zt)||this;return Mt.color="transparent",Mt.padding=5,Mt.DEFAULT_TEXT="\u8BF7\u8F93\u5165\u6587\u672C",Mt.text=Mt.DEFAULT_TEXT,Mt.isMoved=!1,Mt.color=Zt.defaultColor,Mt.fontFamily=Zt.defaultFontFamily,Mt.defaultSize={x:100,y:30},Mt.setColor=Mt.setColor.bind(Mt),Mt.setFont=Mt.setFont.bind(Mt),Mt.renderText=Mt.renderText.bind(Mt),Mt.sizeText=Mt.sizeText.bind(Mt),Mt.textEditDivClicked=Mt.textEditDivClicked.bind(Mt),Mt.showTextEditor=Mt.showTextEditor.bind(Mt),Mt.setSize=Mt.setSize.bind(Mt),Mt.positionTextEditor=Mt.positionTextEditor.bind(Mt),Mt.colorPanel=new et("Color",Zt.defaultColorSet,Zt.defaultColor),Mt.colorPanel.onColorChanged=Mt.setColor,Mt.fontFamilyPanel=new ie("Font",Zt.defaultFontFamilies,Zt.defaultFontFamily),Mt.fontFamilyPanel.onFontChanged=Mt.setFont,Mt}return Ut(Lt,Rt),Lt.prototype.ownsTarget=function(Pt){if(Rt.prototype.ownsTarget.call(this,Pt)||Pt===this.visual||Pt===this.textElement||Pt===this.bgRectangle)return!0;var Nt=!1;return this.textElement.childNodes.forEach(function(Zt){Zt===Pt&&(Nt=!0)}),Nt},Lt.prototype.createVisual=function(){this.visual=Dt.createGroup(),this.bgRectangle=Dt.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=Dt.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(Dt.createTransform()),this.textElement.transform.baseVal.appendItem(Dt.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},Lt.prototype.pointerDown=function(Pt,Nt){Rt.prototype.pointerDown.call(this,Pt,Nt),this.isMoved=!1,this.pointerDownPoint=Pt,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(Pt),this._state="creating")},Lt.prototype.renderText=function(){var Pt=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(Nt){Pt.textElement.appendChild(Dt.createTSpan(Nt.trim()===""?" ":Nt.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},Lt.prototype.getTextScale=function(){var Pt=this.textElement.getBBox(),Nt=1;if(Pt.width>0&&Pt.height>0){var Zt=(1*this.width-this.width*this.padding*2/100)/Pt.width,Mt=(1*this.height-this.height*this.padding*2/100)/Pt.height;Nt=Math.min(Zt,Mt)}return Nt},Lt.prototype.getTextPosition=function(Pt){var Nt=this.textElement.getBBox(),Zt=0,Mt=0;return Nt.width>0&&Nt.height>0&&(Zt=(this.width-Nt.width*Pt)/2,Mt=this.height/2-Nt.height*Pt/2),{x:Zt,y:Mt}},Lt.prototype.sizeText=function(){var Pt=this.textElement.getBBox(),Nt=this.getTextScale(),Zt=this.getTextPosition(Nt);Zt.y-=Pt.y*Nt,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+Zt.x+"px, "+Zt.y+"px) scale("+Nt+", "+Nt+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(Zt.x,Zt.y),this.textElement.transform.baseVal.getItem(1).setScale(Nt,Nt))},Lt.prototype.manipulate=function(Pt){Rt.prototype.manipulate.call(this,Pt),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(Pt.x-this.pointerDownPoint.x)>5||Math.abs(Pt.y-this.pointerDownPoint.y)>5)},Lt.prototype.resize=function(Pt){Rt.prototype.resize.call(this,Pt),this.isMoved=!0,this.setSize(),this.sizeText()},Lt.prototype.setSize=function(){Rt.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(Dt.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),Dt.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},Lt.prototype.pointerUp=function(Pt){var Nt=this.state;Nt==="creating"&&(this._suppressMarkerCreateEvent=!0),Rt.prototype.pointerUp.call(this,Pt),this.setSize(),(Nt==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},Lt.prototype.showTextEditor=function(){var Pt=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(Nt){Nt.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var Nt=Number.parseFloat(Pt.textEditor.style.fontSize);Pt.textEditor.clientWidth>=Number.parseInt(Pt.textEditor.style.maxWidth)&&Nt>.9;)Nt-=.1,Pt.textEditor.style.fontSize=Math.max(Nt,.9)+"em"}),this.textEditor.addEventListener("keyup",function(Nt){Nt.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(Nt){if(Nt.clipboardData){var Zt=Nt.clipboardData.getData("text"),Mt=window.getSelection();if(!Mt.rangeCount)return!1;Mt.deleteFromDocument(),Mt.getRangeAt(0).insertNode(document.createTextNode(Zt)),Nt.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){Pt.textEditDivClicked(Pt.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},Lt.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var Pt=this.getTextScale(),Nt=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),Zt=this.textElement.getBBox(),Mt={x:Zt.width*Pt,y:Zt.height*Pt};Nt.x-=Mt.x/2,Nt.y-=Mt.y/2,this.textEditor.style.top=Nt.y+"px",this.textEditor.style.left=Nt.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-Nt.x+"px",this.textEditor.style.fontSize=Math.max(16*Pt,12)+"px",this.textElement.style.display="none"}},Lt.prototype.textEditDivClicked=function(Pt){this.text=Pt.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},Lt.prototype.select=function(){Rt.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},Lt.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),Rt.prototype.deselect.call(this)},Lt.prototype.dblClick=function(Pt,Nt){Rt.prototype.dblClick.call(this,Pt,Nt),this.showTextEditor()},Lt.prototype.setColor=function(Pt){this.textElement&&Dt.setAttributes(this.textElement,[["fill",Pt]]),this.color=Pt,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(Pt)},Lt.prototype.setFont=function(Pt){this.textElement&&Dt.setAttributes(this.textElement,[["font-family",Pt]]),this.fontFamily=Pt,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},Lt.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},Lt.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(Lt.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),Lt.prototype.getState=function(){var Pt=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},Rt.prototype.getState.call(this));return Pt.typeName=Lt.typeName,Pt},Lt.prototype.restoreState=function(Pt){var Nt=Pt;this.color=Nt.color,this.fontFamily=Nt.fontFamily,this.padding=Nt.padding,this.text=Nt.text,this.createVisual(),Rt.prototype.restoreState.call(this,Pt),this.setSize()},Lt.prototype.scale=function(Pt,Nt){Rt.prototype.scale.call(this,Pt,Nt),this.setSize(),this.sizeText(),this.positionTextEditor()},Lt.typeName="TextMarker",Lt.title="Text marker",Lt.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>',Lt}(St),xe=function(Rt){function Lt(Pt,Nt,Zt){var Mt=Rt.call(this,Pt,Nt,Zt)||this;return Mt.color="transparent",Mt.lineWidth=3,Mt.drawing=!1,Mt.pixelRatio=1,Mt.color=Zt.defaultColor,Mt.lineWidth=Zt.defaultStrokeWidth,Mt.pixelRatio=Zt.freehandPixelRatio,Mt.setColor=Mt.setColor.bind(Mt),Mt.addCanvas=Mt.addCanvas.bind(Mt),Mt.finishCreation=Mt.finishCreation.bind(Mt),Mt.setLineWidth=Mt.setLineWidth.bind(Mt),Mt.colorPanel=new et("Color",Zt.defaultColorSet,Zt.defaultColor),Mt.colorPanel.onColorChanged=Mt.setColor,Mt.lineWidthPanel=new Tt("Line width",Zt.defaultStrokeWidths,Zt.defaultStrokeWidth),Mt.lineWidthPanel.onWidthChanged=Mt.setLineWidth,Mt}return Ut(Lt,Rt),Lt.prototype.ownsTarget=function(Pt){return!(!Rt.prototype.ownsTarget.call(this,Pt)&&Pt!==this.visual&&Pt!==this.drawingImage)},Lt.prototype.createVisual=function(){this.visual=Dt.createGroup(),this.drawingImage=Dt.createImage(),this.visual.appendChild(this.drawingImage);var Pt=Dt.createTransform();this.visual.transform.baseVal.appendItem(Pt),this.addMarkerVisualToContainer(this.visual)},Lt.prototype.pointerDown=function(Pt,Nt){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(Pt.x,Pt.y),this.drawing=!0):Rt.prototype.pointerDown.call(this,Pt,Nt)},Lt.prototype.manipulate=function(Pt){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(Pt.x,Pt.y),this.canvasContext.stroke()):Rt.prototype.manipulate.call(this,Pt)},Lt.prototype.resize=function(Pt){Rt.prototype.resize.call(this,Pt),Dt.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),Dt.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},Lt.prototype.pointerUp=function(Pt){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):Rt.prototype.pointerUp.call(this,Pt)},Lt.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)},Lt.prototype.select=function(){this.state==="creating"&&this.finishCreation(),Rt.prototype.select.call(this)},Lt.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),Rt.prototype.deselect.call(this)},Lt.prototype.finishCreation=function(){for(var Pt=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),Nt=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],Zt=Nt[0],Mt=Nt[1],Yt=Nt[2],Ge=Nt[3],De=!1,Ue=0;Ue<this.canvasElement.height;Ue++)for(var we=0;we<this.canvasElement.width;we++)Pt.data[Ue*this.canvasElement.width*4+4*we+3]>0&&(De=!0,Ue<Mt&&(Mt=Ue),we<Zt&&(Zt=we),Ue>Ge&&(Ge=Ue),we>Yt&&(Yt=we));if(De){this.left=Zt/this.pixelRatio,this.top=Mt/this.pixelRatio,this.width=(Yt-Zt)/this.pixelRatio,this.height=(Ge-Mt)/this.pixelRatio;var Ee=document.createElement("canvas");Ee.width=Yt-Zt,Ee.height=Ge-Mt,Ee.getContext("2d").putImageData(this.canvasContext.getImageData(Zt,Mt,Yt-Zt,Ge-Mt),0,0),this.drawingImgUrl=Ee.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},Lt.prototype.setDrawingImage=function(){Dt.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),Dt.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},Lt.prototype.setColor=function(Pt){this.color=Pt,this.colorChanged(Pt)},Lt.prototype.setLineWidth=function(Pt){this.lineWidth=Pt},Object.defineProperty(Lt.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),Lt.prototype.getState=function(){var Pt=Object.assign({drawingImgUrl:this.drawingImgUrl},Rt.prototype.getState.call(this));return Pt.typeName=Lt.typeName,Pt},Lt.prototype.restoreState=function(Pt){this.createVisual(),Rt.prototype.restoreState.call(this,Pt),this.drawingImgUrl=Pt.drawingImgUrl,this.setDrawingImage()},Lt.prototype.scale=function(Pt,Nt){Rt.prototype.scale.call(this,Pt,Nt),this.setDrawingImage()},Lt.typeName="FreehandMarker",Lt.title="Freehand marker",Lt.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>',Lt}(St),Pe=function(Rt){function Lt(Pt,Nt,Zt){var Mt=Rt.call(this,Pt,Zt||'<svg viewBox="0 0 24 24"><path d="M8 14v4l-6-6 6-6v4h8V6l6 6-6 6v-4H8z"/></svg>')||this;return Mt.typeBoxes=[],Mt.currentType=Nt,Mt.setCurrentType=Mt.setCurrentType.bind(Mt),Mt}return Ut(Lt,Rt),Lt.prototype.getUi=function(){var Pt=this,Nt=document.createElement("div");Nt.style.display="flex",Nt.style.overflow="hidden",Nt.style.flexGrow="2";for(var Zt=function(Ge){var De="both";switch(Ge){case 0:De="both";break;case 1:De="start";break;case 2:De="end";break;case 3:De="none"}var Ue=document.createElement("div");if(Ue.style.display="flex",Ue.style.flexGrow="2",Ue.style.alignItems="center",Ue.style.justifyContent="space-between",Ue.style.padding="5px",Ue.style.borderWidth="2px",Ue.style.borderStyle="solid",Ue.style.borderColor=De===Mt.currentType?Mt.uiStyleSettings.toolboxAccentColor:"transparent",Ue.addEventListener("click",function(){Pt.setCurrentType(De,Ue)}),Nt.appendChild(Ue),De==="both"||De==="start"){var we=document.createElement("div");we.style.display="flex",we.style.alignItems="center",we.style.minHeight="20px",we.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="`+(Mt.uiStyleSettings!==void 0?Mt.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
|
|
</svg>`,we.style.marginLeft="5px",Ue.appendChild(we)}var Ee=document.createElement("div");Ee.style.display="flex",Ee.style.alignItems="center",Ee.style.minHeight="20px",Ee.style.flexGrow="2";var Fe=document.createElement("hr");if(Fe.style.minWidth="20px",Fe.style.border="0px",Fe.style.borderTop="3px solid "+(Mt.uiStyleSettings!==void 0?Mt.uiStyleSettings.toolboxColor:"#eeeeee"),Fe.style.flexGrow="2",Ee.appendChild(Fe),Ue.appendChild(Ee),De==="both"||De==="end"){var He=document.createElement("div");He.style.display="flex",He.style.alignItems="center",He.style.minHeight="20px",He.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="`+(Mt.uiStyleSettings!==void 0?Mt.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
|
|
</svg>`,He.style.marginRight="5px",Ue.appendChild(He)}Mt.typeBoxes.push(Ue)},Mt=this,Yt=0;Yt<4;Yt++)Zt(Yt);return Nt},Lt.prototype.setCurrentType=function(Pt,Nt){var Zt=this;this.currentType=Pt,this.typeBoxes.forEach(function(Mt){Mt.style.borderColor=Mt===Nt?Zt.uiStyleSettings!==void 0?Zt.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},Lt}(nt),Qe=function(Rt){function Lt(Pt,Nt,Zt){var Mt=Rt.call(this,Pt,Nt,Zt)||this;return Mt.arrowType="end",Mt.arrowBaseHeight=10,Mt.arrowBaseWidth=10,Mt.getArrowPoints=Mt.getArrowPoints.bind(Mt),Mt.setArrowType=Mt.setArrowType.bind(Mt),Mt.arrowTypePanel=new Pe("Arrow type","end"),Mt.arrowTypePanel.onArrowTypeChanged=Mt.setArrowType,Mt}return Ut(Lt,Rt),Lt.prototype.ownsTarget=function(Pt){return!(!Rt.prototype.ownsTarget.call(this,Pt)&&Pt!==this.arrow1&&Pt!==this.arrow2)},Lt.prototype.getArrowPoints=function(Pt,Nt){var Zt=this.arrowBaseWidth+2*this.strokeWidth,Mt=this.arrowBaseHeight+2*this.strokeWidth;return Pt-Zt/2+","+(Nt+Mt/2)+" "+Pt+","+(Nt-Mt/2)+" "+(Pt+Zt/2)+","+(Nt+Mt/2)},Lt.prototype.createTips=function(){this.arrow1=Dt.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(Dt.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=Dt.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(Dt.createTransform()),this.visual.appendChild(this.arrow2)},Lt.prototype.pointerDown=function(Pt,Nt){Rt.prototype.pointerDown.call(this,Pt,Nt),this.state==="creating"&&this.createTips()},Lt.prototype.adjustVisual=function(){if(Rt.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",Dt.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),Dt.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]);var Pt=0;Math.abs(this.x1-this.x2)>.1&&(Pt=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2));var Nt=this.arrow1.transform.baseVal.getItem(0);Nt.setRotate(Pt,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(Nt,0);var Zt=this.arrow2.transform.baseVal.getItem(0);Zt.setRotate(Pt+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(Zt,0)}},Lt.prototype.setArrowType=function(Pt){this.arrowType=Pt,this.adjustVisual(),this.stateChanged()},Object.defineProperty(Lt.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),Lt.prototype.getState=function(){var Pt=Object.assign({arrowType:this.arrowType},Rt.prototype.getState.call(this));return Pt.typeName=Lt.typeName,Pt},Lt.prototype.restoreState=function(Pt){Rt.prototype.restoreState.call(this,Pt);var Nt=Pt;this.arrowType=Nt.arrowType,this.createTips(),this.adjustVisual()},Lt.typeName="ArrowMarker",Lt.title="Arrow marker",Lt.icon='<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 7 15.59V9H5v10h10v-2H8.41L19 6.41z"/></svg>',Lt}(ve),_e=function(Rt){function Lt(Pt,Nt,Zt){var Mt=Rt.call(this,Pt,Nt,Zt)||this;return Mt.fillColor=Zt.defaultFillColor,Mt.strokeWidth=0,Mt.fillPanel=new et("Color",Zt.defaultColorSet,Zt.defaultFillColor),Mt.fillPanel.onColorChanged=Mt.setFillColor,Mt}return Ut(Lt,Rt),Object.defineProperty(Lt.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),Lt.prototype.getState=function(){var Pt=Rt.prototype.getState.call(this);return Pt.typeName=Lt.typeName,Pt},Lt.typeName="CoverMarker",Lt.title="Cover marker",Lt.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4z"/></svg>',Lt}(Et),an=function(Rt){function Lt(Pt,Nt,Zt,Mt){var Yt=Rt.call(this,Pt,Mt||'<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 Yt.opacities=[],Yt.opacityBoxes=[],Yt.opacities=Nt,Yt.currentOpacity=Zt,Yt.setCurrentOpacity=Yt.setCurrentOpacity.bind(Yt),Yt}return Ut(Lt,Rt),Lt.prototype.getUi=function(){var Pt=this,Nt=document.createElement("div");return Nt.style.display="flex",Nt.style.overflow="hidden",Nt.style.flexGrow="2",Nt.style.justifyContent="space-between",this.opacities.forEach(function(Zt){var Mt=document.createElement("div");Mt.style.display="flex",Mt.style.alignItems="center",Mt.style.justifyContent="center",Mt.style.padding="5px",Mt.style.borderWidth="2px",Mt.style.borderStyle="solid",Mt.style.borderColor=Zt===Pt.currentOpacity?Pt.uiStyleSettings.toolboxAccentColor:"transparent",Mt.addEventListener("click",function(){Pt.setCurrentOpacity(Zt,Mt)}),Nt.appendChild(Mt);var Yt=document.createElement("div");Yt.innerText=100*Zt+"%",Mt.appendChild(Yt),Pt.opacityBoxes.push(Mt)}),Nt},Lt.prototype.setCurrentOpacity=function(Pt,Nt){var Zt=this;this.currentOpacity=Pt,this.opacityBoxes.forEach(function(Mt){Mt.style.borderColor=Mt===Nt?Zt.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},Lt}(nt),Ke=function(Rt){function Lt(Pt,Nt,Zt){var Mt=Rt.call(this,Pt,Nt,Zt)||this;return Mt.setOpacity=Mt.setOpacity.bind(Mt),Mt.fillColor=Zt.defaultHighlightColor,Mt.strokeWidth=0,Mt.opacity=Zt.defaultHighlightOpacity,Mt.fillPanel=new et("Color",Zt.defaultColorSet,Mt.fillColor),Mt.fillPanel.onColorChanged=Mt.setFillColor,Mt.opacityPanel=new an("Opacity",Zt.defaultOpacitySteps,Mt.opacity),Mt.opacityPanel.onOpacityChanged=Mt.setOpacity,Mt}return Ut(Lt,Rt),Lt.prototype.setOpacity=function(Pt){this.opacity=Pt,this.visual&&Dt.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(Lt.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),Lt.prototype.getState=function(){var Pt=Rt.prototype.getState.call(this);return Pt.typeName=Lt.typeName,Pt},Lt.typeName="HighlightMarker",Lt.title="Highlight marker",Lt.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>',Lt}(_e),re='<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>',Jt='<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>',Ye=function(Rt){function Lt(Pt,Nt,Zt){var Mt=Rt.call(this,Pt,Nt,Zt)||this;return Mt.bgColor="transparent",Mt.tipPosition={x:0,y:0},Mt.tipBase1Position={x:0,y:0},Mt.tipBase2Position={x:0,y:0},Mt.tipMoving=!1,Mt.color=Zt.defaultStrokeColor,Mt.bgColor=Zt.defaultFillColor,Mt.fontFamily=Zt.defaultFontFamily,Mt.defaultSize={x:100,y:30},Mt.setBgColor=Mt.setBgColor.bind(Mt),Mt.getTipPoints=Mt.getTipPoints.bind(Mt),Mt.positionTip=Mt.positionTip.bind(Mt),Mt.setTipPoints=Mt.setTipPoints.bind(Mt),Mt.colorPanel=new et("Text color",Zt.defaultColorSet,Mt.color,re),Mt.colorPanel.onColorChanged=Mt.setColor,Mt.bgColorPanel=new et("Fill color",Zt.defaultColorSet,Mt.bgColor,Jt),Mt.bgColorPanel.onColorChanged=Mt.setBgColor,Mt.fontFamilyPanel=new ie("Font",Zt.defaultFontFamilies,Zt.defaultFontFamily),Mt.fontFamilyPanel.onFontChanged=Mt.setFont,Mt.tipGrip=new gt,Mt.tipGrip.visual.transform.baseVal.appendItem(Dt.createTransform()),Mt.controlBox.appendChild(Mt.tipGrip.visual),Mt}return Ut(Lt,Rt),Lt.prototype.ownsTarget=function(Pt){return Rt.prototype.ownsTarget.call(this,Pt)||this.tipGrip.ownsTarget(Pt)||this.tip===Pt},Lt.prototype.createTip=function(){Dt.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=Dt.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},Lt.prototype.pointerDown=function(Pt,Nt){this.state==="new"&&Rt.prototype.pointerDown.call(this,Pt,Nt),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(Nt)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):Rt.prototype.pointerDown.call(this,Pt,Nt)},Lt.prototype.pointerUp=function(Pt){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,Rt.prototype.pointerUp.call(this,Pt);else{var Nt=this.state==="creating";Rt.prototype.pointerUp.call(this,Pt),this.setTipPoints(Nt),this.positionTip()}},Lt.prototype.manipulate=function(Pt){if(this.tipMoving){var Nt=this.unrotatePoint(Pt);this.tipPosition={x:Nt.x-this.manipulationStartLeft,y:Nt.y-this.manipulationStartTop},this.positionTip()}else Rt.prototype.manipulate.call(this,Pt)},Lt.prototype.setBgColor=function(Pt){this.bgRectangle&&this.tip&&(Dt.setAttributes(this.bgRectangle,[["fill",Pt]]),Dt.setAttributes(this.tip,[["fill",Pt]])),this.bgColor=Pt,this.fillColorChanged(Pt)},Lt.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},Lt.prototype.setTipPoints=function(Pt){Pt===void 0&&(Pt=!1);var Nt=Math.min(this.height/2,15),Zt=this.height/5;Pt&&(this.tipPosition={x:Nt+Zt/2,y:this.height+20});var Mt=Math.atan(this.height/2/(this.width/2));this.tipPosition.x<this.width/2&&this.tipPosition.y<this.height/2?Mt<Math.atan((this.height/2-this.tipPosition.y)/(this.width/2-this.tipPosition.x))?(Zt=this.width/5,Nt=Math.min(this.width/2,15),this.tipBase1Position={x:Nt,y:0},this.tipBase2Position={x:Nt+Zt,y:0}):(this.tipBase1Position={x:0,y:Nt},this.tipBase2Position={x:0,y:Nt+Zt}):this.tipPosition.x>=this.width/2&&this.tipPosition.y<this.height/2?Mt<Math.atan((this.height/2-this.tipPosition.y)/(this.tipPosition.x-this.width/2))?(Zt=this.width/5,Nt=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-Nt-Zt,y:0},this.tipBase2Position={x:this.width-Nt,y:0}):(this.tipBase1Position={x:this.width,y:Nt},this.tipBase2Position={x:this.width,y:Nt+Zt}):this.tipPosition.x>=this.width/2&&this.tipPosition.y>=this.height/2?Mt<Math.atan((this.tipPosition.y-this.height/2)/(this.tipPosition.x-this.width/2))?(Zt=this.width/5,Nt=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-Nt-Zt,y:this.height},this.tipBase2Position={x:this.width-Nt,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-Nt-Zt},this.tipBase2Position={x:this.width,y:this.height-Nt}):Mt<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(Zt=this.width/5,Nt=Math.min(this.width/2,15),this.tipBase1Position={x:Nt,y:this.height},this.tipBase2Position={x:Nt+Zt,y:this.height}):(this.tipBase1Position={x:0,y:this.height-Nt},this.tipBase2Position={x:0,y:this.height-Nt-Zt})},Lt.prototype.resize=function(Pt){Rt.prototype.resize.call(this,Pt),this.positionTip()},Lt.prototype.positionTip=function(){Dt.setAttributes(this.tip,[["points",this.getTipPoints()]]);var Pt=this.tipGrip.visual.transform.baseVal.getItem(0);Pt.setTranslate(this.tipPosition.x,this.tipPosition.y),this.tipGrip.visual.transform.baseVal.replaceItem(Pt,0)},Object.defineProperty(Lt.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.bgColorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),Lt.prototype.select=function(){this.positionTip(),Rt.prototype.select.call(this)},Lt.prototype.getState=function(){var Pt=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},Rt.prototype.getState.call(this));return Pt.typeName=Lt.typeName,Pt},Lt.prototype.restoreState=function(Pt){var Nt=Pt;this.bgColor=Nt.bgColor,this.tipPosition=Nt.tipPosition,Rt.prototype.restoreState.call(this,Pt),this.createTip(),this.setTipPoints()},Lt.prototype.scale=function(Pt,Nt){Rt.prototype.scale.call(this,Pt,Nt),this.tipPosition={x:this.tipPosition.x*Pt,y:this.tipPosition.y*Nt},this.positionTip()},Lt.typeName="CalloutMarker",Lt.title="Callout marker",Lt.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>',Lt}(Ne),Gn=function(Rt){function Lt(Pt,Nt,Zt){var Mt=Rt.call(this,Pt,Nt,Zt)||this;return Mt.fillColor="transparent",Mt.strokeColor="transparent",Mt.strokeWidth=0,Mt.strokeDasharray="",Mt.opacity=1,Mt.strokeColor=Zt.defaultColor,Mt.strokeWidth=Zt.defaultStrokeWidth,Mt.strokeDasharray=Zt.defaultStrokeDasharray,Mt.fillColor=Zt.defaultFillColor,Mt.setStrokeColor=Mt.setStrokeColor.bind(Mt),Mt.setFillColor=Mt.setFillColor.bind(Mt),Mt.setStrokeWidth=Mt.setStrokeWidth.bind(Mt),Mt.setStrokeDasharray=Mt.setStrokeDasharray.bind(Mt),Mt.setOpacity=Mt.setOpacity.bind(Mt),Mt.createVisual=Mt.createVisual.bind(Mt),Mt.strokePanel=new et("Line color",he(Zt.defaultColorSet,["transparent"]),Zt.defaultColor),Mt.strokePanel.onColorChanged=Mt.setStrokeColor,Mt.fillPanel=new et("Fill color",he(Zt.defaultColorSet,["transparent"]),Mt.fillColor,Jt),Mt.fillPanel.onColorChanged=Mt.setFillColor,Mt.strokeWidthPanel=new Tt("Line width",Zt.defaultStrokeWidths,Zt.defaultStrokeWidth),Mt.strokeWidthPanel.onWidthChanged=Mt.setStrokeWidth,Mt.strokeStylePanel=new Ot("Line style",Zt.defaultStrokeDasharrays,Zt.defaultStrokeDasharray),Mt.strokeStylePanel.onStyleChanged=Mt.setStrokeDasharray,Mt.opacityPanel=new an("Opacity",Zt.defaultOpacitySteps,Mt.opacity),Mt.opacityPanel.onOpacityChanged=Mt.setOpacity,Mt}return Ut(Lt,Rt),Lt.prototype.ownsTarget=function(Pt){return!(!Rt.prototype.ownsTarget.call(this,Pt)&&Pt!==this.visual)},Lt.prototype.createVisual=function(){this.visual=Dt.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)},Lt.prototype.pointerDown=function(Pt,Nt){Rt.prototype.pointerDown.call(this,Pt,Nt),this.state==="new"&&(this.createVisual(),this.moveVisual(Pt),this._state="creating")},Lt.prototype.manipulate=function(Pt){Rt.prototype.manipulate.call(this,Pt)},Lt.prototype.resize=function(Pt){Rt.prototype.resize.call(this,Pt),this.setSize()},Lt.prototype.setSize=function(){Rt.prototype.setSize.call(this),Dt.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},Lt.prototype.pointerUp=function(Pt){Rt.prototype.pointerUp.call(this,Pt),this.setSize()},Lt.prototype.setStrokeColor=function(Pt){this.strokeColor=Pt,this.visual&&Dt.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(Pt),this.stateChanged()},Lt.prototype.setFillColor=function(Pt){this.fillColor=Pt,this.visual&&Dt.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(Pt),this.stateChanged()},Lt.prototype.setStrokeWidth=function(Pt){this.strokeWidth=Pt,this.visual&&Dt.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},Lt.prototype.setStrokeDasharray=function(Pt){this.strokeDasharray=Pt,this.visual&&Dt.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},Lt.prototype.setOpacity=function(Pt){this.opacity=Pt,this.visual&&Dt.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(Lt.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),Lt.prototype.getState=function(){var Pt=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},Rt.prototype.getState.call(this));return Pt.typeName=Lt.typeName,Pt},Lt.prototype.restoreState=function(Pt){var Nt=Pt;this.fillColor=Nt.fillColor,this.strokeColor=Nt.strokeColor,this.strokeWidth=Nt.strokeWidth,this.strokeDasharray=Nt.strokeDasharray,this.opacity=Nt.opacity,this.createVisual(),Rt.prototype.restoreState.call(this,Pt),this.setSize()},Lt.prototype.scale=function(Pt,Nt){Rt.prototype.scale.call(this,Pt,Nt),this.setSize()},Lt.typeName="EllipseMarker",Lt.title="Ellipse marker",Lt.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>',Lt}(St),dn=function(Rt){function Lt(Pt,Nt,Zt){return Rt.call(this,Pt,Nt,Zt)||this}return Ut(Lt,Rt),Object.defineProperty(Lt.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),Lt.prototype.ownsTarget=function(Pt){return!(!Rt.prototype.ownsTarget.call(this,Pt)&&Pt!==this.tip1&&Pt!==this.tip2)},Lt.prototype.createTips=function(){this.tip1=Dt.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(Dt.createTransform()),this.visual.appendChild(this.tip1),this.tip2=Dt.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(Dt.createTransform()),this.visual.appendChild(this.tip2)},Lt.prototype.pointerDown=function(Pt,Nt){Rt.prototype.pointerDown.call(this,Pt,Nt),this.state==="creating"&&this.createTips()},Lt.prototype.adjustVisual=function(){if(Rt.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(Dt.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()]]),Dt.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 Pt=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),Nt=this.tip1.transform.baseVal.getItem(0);Nt.setRotate(Pt,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(Nt,0);var Zt=this.tip2.transform.baseVal.getItem(0);Zt.setRotate(Pt+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(Zt,0)}},Object.defineProperty(Lt.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),Lt.prototype.getState=function(){var Pt=Rt.prototype.getState.call(this);return Pt.typeName=Lt.typeName,Pt},Lt.prototype.restoreState=function(Pt){Rt.prototype.restoreState.call(this,Pt),this.createTips(),this.adjustVisual()},Lt.typeName="MeasurementMarker",Lt.title="Measurement marker",Lt.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>',Lt}(ve),Oe=function(Rt){function Lt(Pt,Nt,Zt){var Mt=Rt.call(this,Pt,Nt,Zt)||this;return Mt.strokePanel.colors=Zt.defaultColorSet,Mt.fillColor="transparent",Mt}return Ut(Lt,Rt),Object.defineProperty(Lt.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),Lt.prototype.getState=function(){var Pt=Rt.prototype.getState.call(this);return Pt.typeName=Lt.typeName,Pt},Lt.typeName="EllipseFrameMarker",Lt.title="Ellipse frame marker",Lt.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>',Lt}(Gn),sn=function(){function Rt(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(Rt.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(Rt.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(Rt.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(Rt.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),Rt.prototype.addUndoStep=function(Lt){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(Lt)||(this.undoStack.push(Lt),JSON.stringify(this.lastRedoStep)!==JSON.stringify(Lt)&&this.redoStack.splice(0,this.redoStack.length))},Rt.prototype.replaceLastUndoStep=function(Lt){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=Lt)},Rt.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},Rt.prototype.undo=function(){if(this.undoStack.length>1){var Lt=this.undoStack.pop();return Lt!==void 0&&this.redoStack.push(Lt),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},Rt.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},Rt}(),ln=function(Rt){function Lt(Pt,Nt,Zt){var Mt=Rt.call(this,Pt,Nt,Zt)||this;return Mt.strokeColor="transparent",Mt.strokeWidth=0,Mt.strokeDasharray="",Mt.curveX=0,Mt.curveY=0,Mt.manipulationStartCurveX=0,Mt.manipulationStartCurveY=0,Mt.setStrokeColor=Mt.setStrokeColor.bind(Mt),Mt.setStrokeWidth=Mt.setStrokeWidth.bind(Mt),Mt.setStrokeDasharray=Mt.setStrokeDasharray.bind(Mt),Mt.positionGrips=Mt.positionGrips.bind(Mt),Mt.addControlGrips=Mt.addControlGrips.bind(Mt),Mt.adjustVisual=Mt.adjustVisual.bind(Mt),Mt.setupControlBox=Mt.setupControlBox.bind(Mt),Mt.resize=Mt.resize.bind(Mt),Mt.strokeColor=Zt.defaultColor,Mt.strokeWidth=Zt.defaultStrokeWidth,Mt.strokeDasharray=Zt.defaultStrokeDasharray,Mt.strokePanel=new et("Line color",Zt.defaultColorSet,Zt.defaultColor),Mt.strokePanel.onColorChanged=Mt.setStrokeColor,Mt.strokeWidthPanel=new Tt("Line width",Zt.defaultStrokeWidths,Zt.defaultStrokeWidth),Mt.strokeWidthPanel.onWidthChanged=Mt.setStrokeWidth,Mt.strokeStylePanel=new Ot("Line style",Zt.defaultStrokeDasharrays,Zt.defaultStrokeDasharray),Mt.strokeStylePanel.onStyleChanged=Mt.setStrokeDasharray,Mt}return Ut(Lt,Rt),Lt.prototype.ownsTarget=function(Pt){return!(!Rt.prototype.ownsTarget.call(this,Pt)&&Pt!==this.visual&&Pt!==this.selectorCurve&&Pt!==this.visibleCurve&&!this.curveGrip.ownsTarget(Pt))},Lt.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},Lt.prototype.createVisual=function(){this.visual=Dt.createGroup(),this.selectorCurve=Dt.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=Dt.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)},Lt.prototype.pointerDown=function(Pt,Nt){Rt.prototype.pointerDown.call(this,Pt,Nt),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=Pt.x,this.curveY=Pt.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(Nt)&&(this.activeGrip=this.curveGrip,this._state="resize")},Lt.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),Dt.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),Dt.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),Dt.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},Lt.prototype.setupControlBox=function(){Rt.prototype.setupControlBox.call(this),this.curveControlLine1=Dt.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=Dt.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)},Lt.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,Rt.prototype.addControlGrips.call(this)},Lt.prototype.positionGrips=function(){Rt.prototype.positionGrips.call(this);var Pt=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-Pt/2,this.curveY-Pt/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()))},Lt.prototype.manipulate=function(Pt){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+Pt.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+Pt.y-this.manipulationStartY),Rt.prototype.manipulate.call(this,Pt)},Lt.prototype.resize=function(Pt){this.activeGrip===this.curveGrip&&(this.curveX=Pt.x,this.curveY=Pt.y),Rt.prototype.resize.call(this,Pt),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},Lt.prototype.setStrokeColor=function(Pt){this.strokeColor=Pt,this.adjustVisual(),this.colorChanged(Pt)},Lt.prototype.setStrokeWidth=function(Pt){this.strokeWidth=Pt,this.adjustVisual()},Lt.prototype.setStrokeDasharray=function(Pt){this.strokeDasharray=Pt,this.adjustVisual()},Lt.prototype.scale=function(Pt,Nt){this.curveX=this.curveX*Pt,this.curveY=this.curveY*Nt,Rt.prototype.scale.call(this,Pt,Nt)},Object.defineProperty(Lt.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),Lt.prototype.getState=function(){var Pt=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},Rt.prototype.getState.call(this));return Pt.typeName=Lt.typeName,Pt},Lt.prototype.restoreState=function(Pt){Rt.prototype.restoreState.call(this,Pt);var Nt=Pt;this.strokeColor=Nt.strokeColor,this.strokeWidth=Nt.strokeWidth,this.strokeDasharray=Nt.strokeDasharray,this.curveX=Nt.curveX,this.curveY=Nt.curveY,this.createVisual(),this.adjustVisual()},Lt.typeName="CurveMarker",Lt.title="Curve marker",Lt.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>',Lt}(Ht),Vn=function(Rt){function Lt(Pt,Nt,Zt){var Mt=Rt.call(this,Pt,Nt,Zt)||this;return Mt.fillColor="transparent",Mt.strokeColor="transparent",Mt.strokeWidth=0,Mt.strokeDasharray="",Mt.textColor="transparent",Mt.fontSize="1rem",Mt.isMoved=!1,Mt.captionText="Caption",Mt.PADDING=5,Mt.captionBoxWidth=0,Mt.captionBoxHeight=0,Mt.strokeColor=Zt.defaultColor,Mt.strokeWidth=Zt.defaultStrokeWidth,Mt.strokeDasharray=Zt.defaultStrokeDasharray,Mt.fillColor=Zt.defaultFillColor,Mt.textColor=Zt.defaultStrokeColor,Mt.fontFamily=Zt.defaultFontFamily,Mt.fontSize=Zt.defaultCaptionFontSize,Mt.captionText=Zt.defaultCaptionText,Mt.setStrokeColor=Mt.setStrokeColor.bind(Mt),Mt.setFillColor=Mt.setFillColor.bind(Mt),Mt.setStrokeWidth=Mt.setStrokeWidth.bind(Mt),Mt.setStrokeDasharray=Mt.setStrokeDasharray.bind(Mt),Mt.createVisual=Mt.createVisual.bind(Mt),Mt.sizeCaption=Mt.sizeCaption.bind(Mt),Mt.setCaptionText=Mt.setCaptionText.bind(Mt),Mt.showTextEditor=Mt.showTextEditor.bind(Mt),Mt.positionTextEditor=Mt.positionTextEditor.bind(Mt),Mt.finishTextEditing=Mt.finishTextEditing.bind(Mt),Mt.setFont=Mt.setFont.bind(Mt),Mt.setTextColor=Mt.setTextColor.bind(Mt),Mt.strokePanel=new et("Line color",he(Zt.defaultColorSet,["transparent"]),Mt.strokeColor),Mt.strokePanel.onColorChanged=Mt.setStrokeColor,Mt.fillPanel=new et("Fill color",he(Zt.defaultColorSet,["transparent"]),Mt.fillColor,Jt),Mt.fillPanel.onColorChanged=Mt.setFillColor,Mt.strokeWidthPanel=new Tt("Line width",Zt.defaultStrokeWidths,Zt.defaultStrokeWidth),Mt.strokeWidthPanel.onWidthChanged=Mt.setStrokeWidth,Mt.strokeStylePanel=new Ot("Line style",Zt.defaultStrokeDasharrays,Zt.defaultStrokeDasharray),Mt.strokeStylePanel.onStyleChanged=Mt.setStrokeDasharray,Mt.fontFamilyPanel=new ie("Font",Zt.defaultFontFamilies,Zt.defaultFontFamily),Mt.fontFamilyPanel.onFontChanged=Mt.setFont,Mt.textColorPanel=new et("Text color",Zt.defaultColorSet,Mt.textColor,re),Mt.textColorPanel.onColorChanged=Mt.setTextColor,Mt}return Ut(Lt,Rt),Lt.prototype.ownsTarget=function(Pt){return!(!Rt.prototype.ownsTarget.call(this,Pt)&&Pt!==this.visual&&Pt!==this.frame&&Pt!==this.captionBg&&Pt!==this.captionElement)},Lt.prototype.createVisual=function(){this.visual=Dt.createGroup(),this.addMarkerVisualToContainer(this.visual),this.captionBg=Dt.createRect(1,1,[["fill",this.fillColor]]),this.visual.appendChild(this.captionBg),this.captionElement=Dt.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=Dt.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()},Lt.prototype.setCaptionText=function(Pt){this.captionText=Pt,this.captionElement.textContent=this.captionText,this.sizeCaption()},Lt.prototype.pointerDown=function(Pt,Nt){Rt.prototype.pointerDown.call(this,Pt,Nt),this.isMoved=!1,this.pointerDownPoint=Pt,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(Pt),this._state="creating")},Lt.prototype.manipulate=function(Pt){Rt.prototype.manipulate.call(this,Pt),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(Pt.x-this.pointerDownPoint.x)>5||Math.abs(Pt.y-this.pointerDownPoint.y)>5)},Lt.prototype.resize=function(Pt){Rt.prototype.resize.call(this,Pt),this.setSize()},Lt.prototype.sizeCaption=function(){var Pt=this.captionElement.getBBox();this.captionText.trim()!==""?(this.captionBoxWidth=Pt.width+2*this.PADDING,this.captionBoxHeight=Pt.height+2*this.PADDING):(this.captionBoxWidth=0,this.captionBoxHeight=0),Dt.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')"]]),Dt.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')"]])},Lt.prototype.showTextEditor=function(){var Pt=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(Nt){Nt.stopPropagation()}),this.textEditBox.addEventListener("keypress",function(Nt){Nt.key==="Enter"&&Pt.finishTextEditing(Pt.textEditBox.value)}),this.textEditBox.addEventListener("keyup",function(Nt){Nt.cancelBubble=!0}),this.textEditBox.addEventListener("blur",function(){Pt.finishTextEditing(Pt.textEditBox.value)}),this.textEditDiv.addEventListener("pointerup",function(){Pt.finishTextEditing(Pt.textEditBox.value)}),this.positionTextEditor(),this.textEditBox.focus()},Lt.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"))},Lt.prototype.finishTextEditing=function(Pt){this.setCaptionText(Pt.trim()),this.overlayContainer.innerHTML="",this.stateChanged()},Lt.prototype.setFont=function(Pt){this.captionElement&&Dt.setAttributes(this.captionElement,[["font-family",Pt]]),this.fontFamily=Pt,this.textEditBox&&(this.textEditBox.style.fontFamily=this.fontFamily),this.sizeCaption(),this.stateChanged()},Lt.prototype.setTextColor=function(Pt){this.captionElement&&Dt.setAttributes(this.captionElement,[["fill",Pt]]),this.textColor=Pt,this.textEditBox&&(this.textEditBox.style.color=this.textColor),this.stateChanged()},Lt.prototype.setSize=function(){Rt.prototype.setSize.call(this),Dt.setAttributes(this.frame,[["width",this.width.toString()],["height",this.height.toString()]]),this.sizeCaption()},Lt.prototype.pointerUp=function(Pt){Rt.prototype.pointerUp.call(this,Pt),this.setSize(),!this.isMoved&&Date.now()-this.pointerDownTimestamp>500&&this.showTextEditor(),this.pointerDownPoint=void 0},Lt.prototype.dblClick=function(Pt,Nt){Rt.prototype.dblClick.call(this,Pt,Nt),this.showTextEditor()},Lt.prototype.setStrokeColor=function(Pt){this.strokeColor=Pt,this.frame&&Dt.setAttributes(this.frame,[["stroke",this.strokeColor]]),this.colorChanged(Pt),this.stateChanged()},Lt.prototype.setFillColor=function(Pt){this.fillColor=Pt,this.captionBg&&Dt.setAttributes(this.captionBg,[["fill",this.fillColor]]),this.fillColorChanged(Pt),this.stateChanged()},Lt.prototype.setStrokeWidth=function(Pt){this.strokeWidth=Pt,this.frame&&Dt.setAttributes(this.frame,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},Lt.prototype.setStrokeDasharray=function(Pt){this.strokeDasharray=Pt,this.frame&&Dt.setAttributes(this.frame,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},Object.defineProperty(Lt.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.fontFamilyPanel,this.textColorPanel]},enumerable:!1,configurable:!0}),Lt.prototype.getState=function(){var Pt=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},Rt.prototype.getState.call(this));return Pt.typeName=this.typeName,Pt},Lt.prototype.restoreState=function(Pt){var Nt=Pt;this.fillColor=Nt.fillColor,this.strokeColor=Nt.strokeColor,this.strokeWidth=Nt.strokeWidth,this.strokeDasharray=Nt.strokeDasharray,this.textColor=Nt.textColor,this.fontFamily=Nt.fontFamily,this.captionText=Nt.captionText,this.fontSize=Nt.fontSize,this.createVisual(),Rt.prototype.restoreState.call(this,Pt),this.setSize()},Lt.prototype.scale=function(Pt,Nt){Rt.prototype.scale.call(this,Pt,Nt),this.setSize()},Lt.typeName="CaptionFrameMarker",Lt.title="Caption frame marker",Lt.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>',Lt}(St),Ae=function(){function Rt(Lt,Pt){Pt===void 0&&(Pt=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=Lt,this.cancelable=Pt}return Object.defineProperty(Rt.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),Rt.prototype.preventDefault=function(){this._defaultPrevented=!0},Rt}(),yn=function(Rt){function Lt(Pt,Nt,Zt){var Mt=Rt.call(this,Pt,!1)||this;return Mt.dataUrl=Nt,Mt.state=Zt,Mt}return Ut(Lt,Rt),Lt}(Ae),te=function(Rt){function Lt(Pt,Nt,Zt){Zt===void 0&&(Zt=!1);var Mt=Rt.call(this,Pt,Zt)||this;return Mt.marker=Nt,Mt}return Ut(Lt,Rt),Lt}(Ae),En=function(){function Rt(){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 Rt.prototype.addEventListener=function(Lt,Pt){this[Lt].push(Pt)},Rt.prototype.removeEventListener=function(Lt,Pt){var Nt=this[Lt].indexOf(Pt);Nt>-1&&this[Lt].splice(Nt,1)},Rt}(),ri=function(){function Rt(Lt){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new Xt,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 En,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=Rt.instanceCounter++,this.styles=new jt(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=Lt,this.targetRoot=document.body,this.width=Lt.clientWidth,this.height=Lt.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(Rt.prototype,"ALL_MARKER_TYPES",{get:function(){return[$t,xe,Qe,Ne,Oe,Gn,Ke,Ye,dn,_e,ve,ln,Vn]},enumerable:!1,configurable:!0}),Object.defineProperty(Rt.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[$t,xe,Qe,Ne,Gn,Ke,Ye]},enumerable:!1,configurable:!0}),Object.defineProperty(Rt.prototype,"BASIC_MARKER_TYPES",{get:function(){return[$t,xe,Qe,Ne,Ke]},enumerable:!1,configurable:!0}),Object.defineProperty(Rt.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(Lt){var Pt=this;this._availableMarkerTypes.splice(0),Lt.forEach(function(Nt){if(typeof Nt=="string"){var Zt=Pt.ALL_MARKER_TYPES.find(function(Mt){return Mt.typeName===Nt});Zt!==void 0&&Pt._availableMarkerTypes.push(Zt)}else Pt._availableMarkerTypes.push(Nt)})},enumerable:!1,configurable:!0}),Object.defineProperty(Rt.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(Rt.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(Rt.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(Rt.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(Rt.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(Lt){this._zoomLevel=Lt,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(Rt.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Rt.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),qt.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},Rt.prototype.show=function(){var Lt=this;this.styles.styleSheetRoot===void 0&&ne.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=ne.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(Pt){return Pt(new Ae(Lt))})},Rt.prototype.render=function(){return ue(this,void 0,void 0,function(){var Lt;return Le(this,function(Pt){switch(Pt.label){case 0:return this.setCurrentMarker(),(Lt=new me).naturalSize=this.renderAtNaturalSize,Lt.imageType=this.renderImageType,Lt.imageQuality=this.renderImageQuality,Lt.markersOnly=this.renderMarkersOnly,Lt.width=this.renderWidth,Lt.height=this.renderHeight,[4,Lt.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return Pt.sent(),[4,Lt.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,Pt.sent()]}})})},Rt.prototype.close=function(Lt){var Pt=this;if(Lt===void 0&&(Lt=!1),this.isOpen){var Nt=!1;Lt||this.eventListeners.beforeclose.forEach(function(Zt){var Mt=new Ae(Pt,!0);Zt(Mt),Mt.defaultPrevented&&(Nt=!0)}),Nt||(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(Zt){return Zt(new Ae(Pt))}),this.detachEvents(),this._isOpen=!1)}},Rt.prototype.addMarkersToToolbar=function(){for(var Lt,Pt=[],Nt=0;Nt<arguments.length;Nt++)Pt[Nt]=arguments[Nt];(Lt=this._availableMarkerTypes).push.apply(Lt,Pt)},Rt.prototype.addRenderEventListener=function(Lt){this.addEventListener("render",function(Pt){Lt(Pt.dataUrl,Pt.state)})},Rt.prototype.removeRenderEventListener=function(Lt){},Rt.prototype.addCloseEventListener=function(Lt){this.addEventListener("close",function(){Lt()})},Rt.prototype.removeCloseEventListener=function(Lt){},Rt.prototype.setupResizeObserver=function(){var Lt=this;this.settings.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){Lt.resize(Lt.target.clientWidth,Lt.target.clientHeight)}),this.targetObserver.observe(this.target)):this.settings.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){return Lt.onPopupTargetResize()}),this.targetObserver.observe(this.editorCanvas)),window.addEventListener("resize",this.setWindowHeight))},Rt.prototype.onPopupTargetResize=function(){var Lt=1*this.target.clientWidth/this.target.clientHeight,Pt=this.editorCanvas.clientWidth/Lt>this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*Lt:this.editorCanvas.clientWidth,Nt=Pt<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/Lt;this.resize(Pt,Nt)},Rt.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},Rt.prototype.resize=function(Lt,Pt){this._isResizing=!0;var Nt=Lt/this.imageWidth,Zt=Pt/this.imageHeight;this.imageWidth=Math.round(Lt),this.imageHeight=Math.round(Pt),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(Nt,Zt),this._isResizing=!1},Rt.prototype.scaleMarkers=function(Lt,Pt){var Nt,Zt=this;this._currentMarker&&this._currentMarker instanceof Ne?this._currentMarker.scale(Lt,Pt):(Nt=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function(Mt){Mt!==Zt._currentMarker&&Mt.scale(Lt,Pt)}),Nt!==void 0&&this.setCurrentMarker(Nt)},Rt.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"},Rt.prototype.setTopLeft=function(){var Lt=this.editingTarget.getBoundingClientRect(),Pt=this.editorCanvas.getBoundingClientRect();this.left=Lt.left-Pt.left,this.top=Lt.top-Pt.top},Rt.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)},Rt.prototype.addDefs=function(){for(var Lt,Pt=[],Nt=0;Nt<arguments.length;Nt++)Pt[Nt]=arguments[Nt];this.defs=Dt.createDefs(),this.addDefsToImage(),(Lt=this.defs).append.apply(Lt,Pt)},Rt.prototype.addDefsToImage=function(){this.defs&&this.markerImage.insertBefore(this.defs,this.markerImage.firstChild)},Rt.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)},Rt.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},Rt.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},Rt.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)},Rt.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},Rt.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)},Rt.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 Lt=document.createElement("a");Lt.href="https://markerjs.com/",Lt.target="_blank",Lt.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>',Lt.title="Powered by marker.js",Lt.style.display="grid",Lt.style.alignItems="center",Lt.style.justifyItems="center",Lt.style.padding="3px",Lt.style.width="20px",Lt.style.height="20px",this.logoUI.appendChild(Lt),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},Rt.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")},Rt.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"},Rt.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},Rt.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 Lt=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=Lt+"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 Ce(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 Bt(this.uiDiv,this.settings.displayMode,this.uiStyleSettings,this.styles),this.toolbox.show(this._silentRenderMode||this.uiStyleSettings.hideToolbox?"hidden":"visible")},Rt.prototype.closeUI=function(){this.settings.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},Rt.prototype.removeMarker=function(Lt){this.markerImage.removeChild(Lt.container),this.markers.indexOf(Lt)>-1&&this.markers.splice(this.markers.indexOf(Lt),1),Lt.dispose()},Rt.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())},Rt.prototype.toolbarButtonClicked=function(Lt,Pt){if(Lt==="marker"&&Pt!==void 0)this.createNewMarker(Pt);else if(Lt==="action")switch(Pt){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()}},Rt.prototype.deleteSelectedMarker=function(){var Lt=this;if(this._currentMarker!==void 0){var Pt=!1;if(this.eventListeners.markerbeforedelete.forEach(function(Zt){var Mt=new te(Lt,Lt._currentMarker,!0);Zt(Mt),Mt.defaultPrevented&&(Pt=!0)}),!Pt){var Nt=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(Zt){return Zt(new te(Lt,Nt))})}}},Rt.prototype.clear=function(){var Lt=this,Pt=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(Yt){var Ge=new te(Lt,void 0,!0);Yt(Ge),Ge.defaultPrevented&&(Pt=!0)}),!Pt)){this.setCurrentMarker();for(var Nt=function(Yt){var Ge=Zt.markers[Yt];Zt.setCurrentMarker(Zt.markers[Yt]),Zt._currentMarker.dispose(),Zt.markerImage.removeChild(Zt._currentMarker.container),Zt.markers.splice(Zt.markers.indexOf(Zt._currentMarker),1),Zt.eventListeners.markerdelete.forEach(function(De){return De(new te(Lt,Ge))})},Zt=this,Mt=this.markers.length-1;Mt>=0;Mt--)Nt(Mt);this.addUndoStep()}},Object.defineProperty(Rt.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),Rt.prototype.showNotesEditor=function(){var Lt;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=(Lt=this._currentMarker.notes)!==null&&Lt!==void 0?Lt:"",this.overlayContainer.appendChild(this.notesArea))},Rt.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)},Rt.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},Rt.prototype.addUndoStep=function(){var Lt=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var Pt=this.getState(),Nt=this.undoRedoManager.getLastUndoStep();if(!Nt||Nt.width===Pt.width&&Nt.height===Pt.height){var Zt=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(Pt),Zt<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach(function(Mt){return Mt(new Ae(Lt))})}else this.undoRedoManager.replaceLastUndoStep(Pt),this.eventListeners.statechange.forEach(function(Mt){return Mt(new Ae(Lt))})}},Rt.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},Rt.prototype.undoStep=function(){var Lt=this,Pt=this.undoRedoManager.undo();Pt!==void 0&&(this.restoreState(Pt),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(Nt){return Nt(new Ae(Lt))}))},Rt.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},Rt.prototype.redoStep=function(){var Lt=this,Pt=this.undoRedoManager.redo();Pt!==void 0&&(this.restoreState(Pt),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(Nt){return Nt(new Ae(Lt))}))},Rt.prototype.stepZoom=function(){var Lt=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=Lt<this.zoomSteps.length-1?this.zoomSteps[Lt+1]:this.zoomSteps[0]},Rt.prototype.panTo=function(Lt){this.contentDiv.scrollBy({left:this.prevPanPoint.x-Lt.x,top:this.prevPanPoint.y-Lt.y}),this.prevPanPoint=Lt},Rt.prototype.startRenderAndClose=function(){return ue(this,void 0,void 0,function(){var Lt,Pt,Nt=this;return Le(this,function(Zt){switch(Zt.label){case 0:return[4,this.render()];case 1:return Lt=Zt.sent(),Pt=this.getState(),this.eventListeners.render.forEach(function(Mt){return Mt(new yn(Nt,Lt,Pt))}),this.close(!0),[2]}})})},Rt.prototype.getState=function(Lt){Lt===!0&&this.setCurrentMarker();var Pt={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach(function(Nt){return Pt.markers.push(Nt.getState())}),Pt},Rt.prototype.restoreState=function(Lt){var Pt=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);Lt.markers.forEach(function(Nt){var Zt=Pt._availableMarkerTypes.find(function(Yt){return Yt.typeName===Nt.typeName});if(Zt!==void 0){var Mt=Pt.addNewMarker(Zt);Mt.restoreState(Nt),Pt.markers.push(Mt)}}),Lt.width&&Lt.height&&(Lt.width!==this.imageWidth||Lt.height!==this.imageHeight)&&this.scaleMarkers(this.imageWidth/Lt.width,this.imageHeight/Lt.height),this.eventListeners.restorestate.forEach(function(Nt){return Nt(new Ae(Pt))})},Rt.prototype.addNewMarker=function(Lt){var Pt=Dt.createGroup();return this.markerImage.appendChild(Pt),new Lt(Pt,this.overlayContainer,this.settings)},Rt.prototype.createNewMarker=function(Lt){var Pt,Nt=this;(Pt=typeof Lt=="string"?this._availableMarkerTypes.find(function(Zt){return Zt.typeName===Lt}):Lt)&&(this.setCurrentMarker(),this.addUndoStep(),this._currentMarker=this.addNewMarker(Pt),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(Pt.typeName),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this.eventListeners.markercreating.forEach(function(Zt){return Zt(new te(Nt,Nt._currentMarker))}))},Rt.prototype.markerCreated=function(Lt){var Pt=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(Lt),this.setCurrentMarker(Lt),Lt instanceof xe&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(xe):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(Nt){return Nt(new te(Pt,Pt._currentMarker))})},Rt.prototype.colorChanged=function(Lt){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=Lt,this.settings.defaultStrokeColor=Lt)},Rt.prototype.fillColorChanged=function(Lt){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=Lt)},Rt.prototype.markerStateChanged=function(Lt){var Pt=this;this.eventListeners.markerchange.forEach(function(Nt){return Nt(new te(Pt,Lt))})},Rt.prototype.setCurrentMarker=function(Lt){var Pt=this;this._currentMarker!==Lt&&this._currentMarker!==void 0&&(this._currentMarker.deselect(),this.toolbar.setCurrentMarker(),this.toolbox.setPanelButtons([]),this._isResizing||this.eventListeners.markerdeselect.forEach(function(Nt){return Nt(new te(Pt,Pt._currentMarker))})),this._currentMarker=Lt,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(Nt){return Nt(new te(Pt,Pt._currentMarker))}))},Rt.prototype.onPointerDown=function(Lt){if(this._isFocused||this.focus(),this.touchPoints++,this.touchPoints===1||Lt.pointerType!=="touch")if(this._currentMarker===void 0||this._currentMarker.state!=="new"&&this._currentMarker.state!=="creating"){if(this.mode==="select"){var Pt=this.markers.find(function(Nt){return Nt.ownsTarget(Lt.target)});Pt!==void 0?(this.setCurrentMarker(Pt),this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(Lt.clientX,Lt.clientY),Lt.target)):(this.setCurrentMarker(),this.isDragging=!0,this.prevPanPoint={x:Lt.clientX,y:Lt.clientY})}}else this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(Lt.clientX,Lt.clientY))},Rt.prototype.onDblClick=function(Lt){if(this._isFocused||this.focus(),this.mode==="select"){var Pt=this.markers.find(function(Nt){return Nt.ownsTarget(Lt.target)});Pt!==void 0&&Pt!==this._currentMarker&&this.setCurrentMarker(Pt),this._currentMarker!==void 0?this._currentMarker.dblClick(this.clientToLocalCoordinates(Lt.clientX,Lt.clientY),Lt.target):this.setCurrentMarker()}},Rt.prototype.onPointerMove=function(Lt){this.touchPoints!==1&&Lt.pointerType==="touch"||(this._currentMarker!==void 0||this.isDragging)&&(this._currentMarker!==void 0&&this._currentMarker.state==="edit"||Lt.preventDefault(),this._currentMarker!==void 0?this._currentMarker.manipulate(this.clientToLocalCoordinates(Lt.clientX,Lt.clientY)):this.zoomLevel>1&&this.panTo({x:Lt.clientX,y:Lt.clientY}))},Rt.prototype.onPointerUp=function(Lt){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(Lt.clientX,Lt.clientY)),this.isDragging=!1,this.addUndoStep()},Rt.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},Rt.prototype.onKeyUp=function(Lt){this._currentMarker===void 0||this.notesArea!==void 0||Lt.key!=="Delete"&&Lt.key!=="Backspace"||this.deleteSelectedMarker()},Rt.prototype.clientToLocalCoordinates=function(Lt,Pt){var Nt=this.markerImage.getBoundingClientRect();return{x:(Lt-Nt.left)/this.zoomLevel,y:(Pt-Nt.top)/this.zoomLevel}},Rt.prototype.onWindowResize=function(){this.positionUI()},Rt.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var Lt=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=Lt+"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()},Rt.prototype.addLicenseKey=function(Lt){qt.addKey(Lt)},Rt.prototype.addEventListener=function(Lt,Pt){this.eventListeners.addEventListener(Lt,Pt)},Rt.prototype.removeEventListener=function(Lt,Pt){this.eventListeners.removeEventListener(Lt,Pt)},Rt.prototype.renderState=function(Lt){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(Lt),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(Rt.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),Rt.prototype.focus=function(){var Lt=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(Pt){return Pt(new Ae(Lt))}))},Rt.prototype.blur=function(){var Lt=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(Pt){return Pt(new Ae(Lt))}))},Rt.instanceCounter=0,Rt}()},63727:function(Bn,zn,kt){"use strict";kt.d(zn,{s:function(){return we},default:function(){return ni}});var pt=kt(5016),Ut=kt(20049),ue=kt(92393),Le=kt(52456),he=kt(5883),Dt=kt(37463),qt=kt(6551),me=kt(6089),ne=kt(18929),jt=kt(59301),Te=jt.createContext({}),se=Te,Ce=kt(10928),Bt=kt(18082),nt="__rc_cascader_search_mark__",et=function(Ve,nn,qn){var vn=qn.label,tn=vn===void 0?"":vn;return nn.some(function(Rn){return String(Rn[tn]).toLowerCase().includes(Ve.toLowerCase())})},ht=function(Ve,nn,qn,vn){return nn.map(function(tn){return tn[vn.label]}).join(" / ")},st=function(Ve,nn,qn,vn,tn,Rn){var gi=tn.filter,ti=gi===void 0?et:gi,vi=tn.render,Gi=vi===void 0?ht:vi,Fn=tn.limit,xn=Fn===void 0?50:Fn,Tn=tn.sort;return jt.useMemo(function(){var ai=[];if(!Ve)return[];function pi(ui,zi){var wt=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;ui.forEach(function(Xe){if(!(!Tn&&xn!==!1&&xn>0&&ai.length>=xn)){var Hn=[].concat((0,ue.Z)(zi),[Xe]),Ai=Xe[qn.children],Vi=wt||Xe.disabled;if((!Ai||Ai.length===0||Rn)&&ti(Ve,Hn,{label:qn.label})){var dr;ai.push((0,Ut.Z)((0,Ut.Z)({},Xe),{},(dr={disabled:Vi},(0,Bt.Z)(dr,qn.label,Gi(Ve,Hn,vn,qn)),(0,Bt.Z)(dr,nt,Hn),(0,Bt.Z)(dr,qn.children,void 0),dr)))}Ai&&pi(Xe[qn.children],Hn,Vi)}})}return pi(nn,[]),Tn&&ai.sort(function(ui,zi){return Tn(ui[nt],zi[nt],Ve,qn)}),xn!==!1&&xn>0?ai.slice(0,xn):ai},[Ve,nn,qn,vn,Gi,Rn,ti,Tn,xn])},gt=st,vt="__RC_CASCADER_SPLIT__",St="SHOW_PARENT",Et="SHOW_CHILD";function Tt(ze){return ze.join(vt)}function Ot(ze){return ze.map(Tt)}function $t(ze){return ze.split(vt)}function Xt(ze){var Ve=ze||{},nn=Ve.label,qn=Ve.value,vn=Ve.children,tn=qn||"value";return{label:nn||"label",value:tn,key:tn,children:vn||"children"}}function Ht(ze,Ve){var nn,qn;return(nn=ze.isLeaf)!==null&&nn!==void 0?nn:!((qn=ze[Ve.children])!==null&&qn!==void 0&&qn.length)}function ve(ze){var Ve=ze.parentElement;if(Ve){var nn=ze.offsetTop-Ve.offsetTop;nn-Ve.scrollTop<0?Ve.scrollTo({top:nn}):nn+ze.offsetHeight-Ve.scrollTop>Ve.offsetHeight&&Ve.scrollTo({top:nn+ze.offsetHeight-Ve.offsetHeight})}}function ie(ze,Ve){return ze.map(function(nn){var qn;return(qn=nn[nt])===null||qn===void 0?void 0:qn.map(function(vn){return vn[Ve.value]})})}function Ne(ze){return Array.isArray(ze)&&Array.isArray(ze[0])}function xe(ze){return ze?Ne(ze)?ze:(ze.length===0?[]:[ze]).map(function(Ve){return Array.isArray(Ve)?Ve:[Ve]}):[]}function Pe(ze,Ve,nn){var qn=new Set(ze),vn=Ve();return ze.filter(function(tn){var Rn=vn[tn],gi=Rn?Rn.parent:null,ti=Rn?Rn.children:null;return Rn&&Rn.node.disabled?!0:nn===Et?!(ti&&ti.some(function(vi){return vi.key&&qn.has(vi.key)})):!(gi&&!gi.node.disabled&&qn.has(gi.key))})}function Qe(ze,Ve,nn){for(var qn=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,vn=Ve,tn=[],Rn=function(){var vi,Gi,Fn,xn=ze[gi],Tn=(vi=vn)===null||vi===void 0?void 0:vi.findIndex(function(pi){var ui=pi[nn.value];return qn?String(ui)===String(xn):ui===xn}),ai=Tn!==-1?(Gi=vn)===null||Gi===void 0?void 0:Gi[Tn]:null;tn.push({value:(Fn=ai==null?void 0:ai[nn.value])!==null&&Fn!==void 0?Fn:xn,index:Tn,option:ai}),vn=ai==null?void 0:ai[nn.children]},gi=0;gi<ze.length;gi+=1)Rn();return tn}var _e=function(ze,Ve,nn,qn,vn){return jt.useMemo(function(){var tn=vn||function(Rn){var gi=qn?Rn.slice(-1):Rn,ti=" / ";return gi.every(function(vi){return["string","number"].includes((0,Ce.Z)(vi))})?gi.join(ti):gi.reduce(function(vi,Gi,Fn){var xn=jt.isValidElement(Gi)?jt.cloneElement(Gi,{key:Fn}):Gi;return Fn===0?[xn]:[].concat((0,ue.Z)(vi),[ti,xn])},[])};return ze.map(function(Rn){var gi,ti=Qe(Rn,Ve,nn),vi=tn(ti.map(function(Fn){var xn,Tn=Fn.option,ai=Fn.value;return(xn=Tn==null?void 0:Tn[nn.label])!==null&&xn!==void 0?xn:ai}),ti.map(function(Fn){var xn=Fn.option;return xn})),Gi=Tt(Rn);return{label:vi,value:Gi,key:Gi,valueCells:Rn,disabled:(gi=ti[ti.length-1])===null||gi===void 0||(gi=gi.option)===null||gi===void 0?void 0:gi.disabled}})},[ze,Ve,nn,vn,qn])};function an(ze,Ve){return jt.useCallback(function(nn){var qn=[],vn=[];return nn.forEach(function(tn){var Rn=Qe(tn,ze,Ve);Rn.every(function(gi){return gi.option})?vn.push(tn):qn.push(tn)}),[vn,qn]},[ze,Ve])}var Ke=kt(34061),re=function(ze,Ve){var nn=jt.useRef({options:[],info:{keyEntities:{},pathKeyEntities:{}}}),qn=jt.useCallback(function(){return nn.current.options!==ze&&(nn.current.options=ze,nn.current.info=(0,Ke.I8)(ze,{fieldNames:Ve,initWrapper:function(tn){return(0,Ut.Z)((0,Ut.Z)({},tn),{},{pathKeyEntities:{}})},processEntity:function(tn,Rn){var gi=tn.nodes.map(function(ti){return ti[Ve.value]}).join(vt);Rn.pathKeyEntities[gi]=tn,tn.key=gi}})),nn.current.info.pathKeyEntities},[Ve,ze]);return qn};function Jt(ze,Ve){var nn=jt.useMemo(function(){return Ve||[]},[Ve]),qn=re(nn,ze),vn=jt.useCallback(function(tn){var Rn=qn();return tn.map(function(gi){var ti=Rn[gi].nodes;return ti.map(function(vi){return vi[ze.value]})})},[qn,ze]);return[nn,qn,vn]}var Ye=kt(48736);function Gn(ze){return jt.useMemo(function(){if(!ze)return[!1,{}];var Ve={matchInputWidth:!0,limit:50};return ze&&(0,Ce.Z)(ze)==="object"&&(Ve=(0,Ut.Z)((0,Ut.Z)({},Ve),ze)),Ve.limit<=0&&(Ve.limit=!1),[!0,Ve]},[ze])}var dn=kt(34643);function Oe(ze,Ve,nn,qn,vn,tn,Rn,gi){return function(ti){if(!ze)Ve(ti);else{var vi=Tt(ti),Gi=Ot(nn),Fn=Ot(qn),xn=Gi.includes(vi),Tn=vn.some(function(Vi){return Tt(Vi)===vi}),ai=nn,pi=vn;if(Tn&&!xn)pi=vn.filter(function(Vi){return Tt(Vi)!==vi});else{var ui=xn?Gi.filter(function(Vi){return Vi!==vi}):[].concat((0,ue.Z)(Gi),[vi]),zi=tn(),wt;if(xn){var Xe=(0,dn.S)(ui,{checked:!1,halfCheckedKeys:Fn},zi);wt=Xe.checkedKeys}else{var Hn=(0,dn.S)(ui,!0,zi);wt=Hn.checkedKeys}var Ai=Pe(wt,tn,gi);ai=Rn(Ai)}Ve([].concat((0,ue.Z)(pi),(0,ue.Z)(ai)))}}}function sn(ze,Ve,nn,qn,vn){return jt.useMemo(function(){var tn=vn(Ve),Rn=(0,Le.Z)(tn,2),gi=Rn[0],ti=Rn[1];if(!ze||!Ve.length)return[gi,[],ti];var vi=Ot(gi),Gi=nn(),Fn=(0,dn.S)(vi,!0,Gi),xn=Fn.checkedKeys,Tn=Fn.halfCheckedKeys;return[qn(xn),qn(Tn),ti]},[ze,Ve,nn,qn,vn])}var ln=kt(92310),Vn=kt.n(ln),Ae=jt.memo(function(ze){var Ve=ze.children;return Ve},function(ze,Ve){return!Ve.open}),yn=Ae;function te(ze){var Ve,nn=ze.prefixCls,qn=ze.checked,vn=ze.halfChecked,tn=ze.disabled,Rn=ze.onClick,gi=ze.disableCheckbox,ti=jt.useContext(se),vi=ti.checkable,Gi=typeof vi!="boolean"?vi:null;return jt.createElement("span",{className:Vn()("".concat(nn),(Ve={},(0,Bt.Z)(Ve,"".concat(nn,"-checked"),qn),(0,Bt.Z)(Ve,"".concat(nn,"-indeterminate"),!qn&&vn),(0,Bt.Z)(Ve,"".concat(nn,"-disabled"),tn||gi),Ve)),onClick:Rn},Gi)}var En="__cascader_fix_label__";function ri(ze){var Ve=ze.prefixCls,nn=ze.multiple,qn=ze.options,vn=ze.activeValue,tn=ze.prevValuePath,Rn=ze.onToggleOpen,gi=ze.onSelect,ti=ze.onActive,vi=ze.checkedSet,Gi=ze.halfCheckedSet,Fn=ze.loadingKeys,xn=ze.isSelectable,Tn=ze.disabled,ai="".concat(Ve,"-menu"),pi="".concat(Ve,"-menu-item"),ui=jt.useContext(se),zi=ui.fieldNames,wt=ui.changeOnSelect,Xe=ui.expandTrigger,Hn=ui.expandIcon,Ai=ui.loadingIcon,Vi=ui.dropdownMenuColumnStyle,dr=ui.optionRender,kr=Xe==="hover",ci=function(Se){return Tn||Se},In=jt.useMemo(function(){return qn.map(function(pe){var Se,ye=pe.disabled,jn=pe.disableCheckbox,Ln=pe[nt],Kn=(Se=pe[En])!==null&&Se!==void 0?Se:pe[zi.label],Je=pe[zi.value],An=Ht(pe,zi),yi=Ln?Ln.map(function(un){return un[zi.value]}):[].concat((0,ue.Z)(tn),[Je]),Ei=Tt(yi),Xi=Fn.includes(Ei),Gt=vi.has(Ei),de=Gi.has(Ei);return{disabled:ye,label:Kn,value:Je,isLeaf:An,isLoading:Xi,checked:Gt,halfChecked:de,option:pe,disableCheckbox:jn,fullPath:yi,fullPathKey:Ei}})},[qn,vi,zi,Gi,Fn,tn]);return jt.createElement("ul",{className:ai,role:"menu"},In.map(function(pe){var Se,ye=pe.disabled,jn=pe.label,Ln=pe.value,Kn=pe.isLeaf,Je=pe.isLoading,An=pe.checked,yi=pe.halfChecked,Ei=pe.option,Xi=pe.fullPath,Gt=pe.fullPathKey,de=pe.disableCheckbox,un=function(){if(!ci(ye)){var bn=(0,ue.Z)(Xi);kr&&Kn&&bn.pop(),ti(bn)}},Mn=function(){xn(Ei)&&!ci(ye)&&gi(Xi,Kn)},Ie;return typeof Ei.title=="string"?Ie=Ei.title:typeof jn=="string"&&(Ie=jn),jt.createElement("li",{key:Gt,className:Vn()(pi,(Se={},(0,Bt.Z)(Se,"".concat(pi,"-expand"),!Kn),(0,Bt.Z)(Se,"".concat(pi,"-active"),vn===Ln||vn===Gt),(0,Bt.Z)(Se,"".concat(pi,"-disabled"),ci(ye)),(0,Bt.Z)(Se,"".concat(pi,"-loading"),Je),Se)),style:Vi,role:"menuitemcheckbox",title:Ie,"aria-checked":An,"data-path-key":Gt,onClick:function(){un(),!de&&(!nn||Kn)&&Mn()},onDoubleClick:function(){wt&&Rn(!1)},onMouseEnter:function(){kr&&un()},onMouseDown:function(bn){bn.preventDefault()}},nn&&jt.createElement(te,{prefixCls:"".concat(Ve,"-checkbox"),checked:An,halfChecked:yi,disabled:ci(ye)||de,disableCheckbox:de,onClick:function(bn){de||(bn.stopPropagation(),Mn())}}),jt.createElement("div",{className:"".concat(pi,"-content")},dr?dr(Ei):jn),!Je&&Hn&&!Kn&&jt.createElement("div",{className:"".concat(pi,"-expand-icon")},Hn),Je&&Ai&&jt.createElement("div",{className:"".concat(pi,"-loading-icon")},Ai))}))}var Rt=function(Ve,nn){var qn=jt.useContext(se),vn=qn.values,tn=vn[0],Rn=jt.useState([]),gi=(0,Le.Z)(Rn,2),ti=gi[0],vi=gi[1];return jt.useEffect(function(){Ve||vi(tn||[])},[nn,tn]),[ti,vi]},Lt=Rt,Pt=kt(10228),Nt=function(ze,Ve,nn,qn,vn,tn,Rn){var gi=Rn.direction,ti=Rn.searchValue,vi=Rn.toggleOpen,Gi=Rn.open,Fn=gi==="rtl",xn=jt.useMemo(function(){for(var Vi=-1,dr=Ve,kr=[],ci=[],In=qn.length,pe=ie(Ve,nn),Se=function(Je){var An=dr.findIndex(function(yi,Ei){return(pe[Ei]?Tt(pe[Ei]):yi[nn.value])===qn[Je]});if(An===-1)return 1;Vi=An,kr.push(Vi),ci.push(qn[Je]),dr=dr[Vi][nn.children]},ye=0;ye<In&&dr&&!Se(ye);ye+=1);for(var jn=Ve,Ln=0;Ln<kr.length-1;Ln+=1)jn=jn[kr[Ln]][nn.children];return[ci,Vi,jn,pe]},[qn,nn,Ve]),Tn=(0,Le.Z)(xn,4),ai=Tn[0],pi=Tn[1],ui=Tn[2],zi=Tn[3],wt=function(dr){vn(dr)},Xe=function(dr){var kr=ui.length,ci=pi;ci===-1&&dr<0&&(ci=kr);for(var In=0;In<kr;In+=1){ci=(ci+dr+kr)%kr;var pe=ui[ci];if(pe&&!pe.disabled){var Se=ai.slice(0,-1).concat(zi[ci]?Tt(zi[ci]):pe[nn.value]);wt(Se);return}}},Hn=function(){if(ai.length>1){var dr=ai.slice(0,-1);wt(dr)}else vi(!1)},Ai=function(){var dr,kr=((dr=ui[pi])===null||dr===void 0?void 0:dr[nn.children])||[],ci=kr.find(function(pe){return!pe.disabled});if(ci){var In=[].concat((0,ue.Z)(ai),[ci[nn.value]]);wt(In)}};jt.useImperativeHandle(ze,function(){return{onKeyDown:function(dr){var kr=dr.which;switch(kr){case Pt.Z.UP:case Pt.Z.DOWN:{var ci=0;kr===Pt.Z.UP?ci=-1:kr===Pt.Z.DOWN&&(ci=1),ci!==0&&Xe(ci);break}case Pt.Z.LEFT:{if(ti)break;Fn?Ai():Hn();break}case Pt.Z.RIGHT:{if(ti)break;Fn?Hn():Ai();break}case Pt.Z.BACKSPACE:{ti||Hn();break}case Pt.Z.ENTER:{if(ai.length){var In=ui[pi],pe=(In==null?void 0:In[nt])||[];pe.length?tn(pe.map(function(Se){return Se[nn.value]}),pe[pe.length-1]):tn(ai,ui[pi])}break}case Pt.Z.ESC:vi(!1),Gi&&dr.stopPropagation()}},onKeyUp:function(){}}})},Zt=jt.forwardRef(function(ze,Ve){var nn,qn,vn,tn=ze.prefixCls,Rn=ze.multiple,gi=ze.searchValue,ti=ze.toggleOpen,vi=ze.notFoundContent,Gi=ze.direction,Fn=ze.open,xn=ze.disabled,Tn=jt.useRef(null),ai=Gi==="rtl",pi=jt.useContext(se),ui=pi.options,zi=pi.values,wt=pi.halfValues,Xe=pi.fieldNames,Hn=pi.changeOnSelect,Ai=pi.onSelect,Vi=pi.searchOptions,dr=pi.dropdownPrefixCls,kr=pi.loadData,ci=pi.expandTrigger,In=dr||tn,pe=jt.useState([]),Se=(0,Le.Z)(pe,2),ye=Se[0],jn=Se[1],Ln=function(Ii){if(!(!kr||gi)){var Ti=Qe(Ii,ui,Xe),Di=Ti.map(function(yr){var $r=yr.option;return $r}),We=Di[Di.length-1];if(We&&!Ht(We,Xe)){var gr=Tt(Ii);jn(function(yr){return[].concat((0,ue.Z)(yr),[gr])}),kr(Di)}}};jt.useEffect(function(){ye.length&&ye.forEach(function(ei){var Ii=$t(ei),Ti=Qe(Ii,ui,Xe,!0).map(function(We){var gr=We.option;return gr}),Di=Ti[Ti.length-1];(!Di||Di[Xe.children]||Ht(Di,Xe))&&jn(function(We){return We.filter(function(gr){return gr!==ei})})})},[ui,ye,Xe]);var Kn=jt.useMemo(function(){return new Set(Ot(zi))},[zi]),Je=jt.useMemo(function(){return new Set(Ot(wt))},[wt]),An=Lt(Rn,Fn),yi=(0,Le.Z)(An,2),Ei=yi[0],Xi=yi[1],Gt=function(Ii){Xi(Ii),Ln(Ii)},de=function(Ii){if(xn)return!1;var Ti=Ii.disabled,Di=Ht(Ii,Xe);return!Ti&&(Di||Hn||Rn)},un=function(Ii,Ti){var Di=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;Ai(Ii),!Rn&&(Ti||Hn&&(ci==="hover"||Di))&&ti(!1)},Mn=jt.useMemo(function(){return gi?Vi:ui},[gi,Vi,ui]),Ie=jt.useMemo(function(){for(var ei=[{options:Mn}],Ii=Mn,Ti=ie(Ii,Xe),Di=function(){var yr=Ei[We],$r=Ii.find(function(On,bi){return(Ti[bi]?Tt(Ti[bi]):On[Xe.value])===yr}),rn=$r==null?void 0:$r[Xe.children];if(!(rn!=null&&rn.length))return 1;Ii=rn,ei.push({options:rn})},We=0;We<Ei.length&&!Di();We+=1);return ei},[Mn,Ei,Xe]),$e=function(Ii,Ti){de(Ti)&&un(Ii,Ht(Ti,Xe),!0)};Nt(Ve,Mn,Xe,Ei,Gt,$e,{direction:Gi,searchValue:gi,toggleOpen:ti,open:Fn}),jt.useEffect(function(){if(!gi)for(var ei=0;ei<Ei.length;ei+=1){var Ii,Ti=Ei.slice(0,ei+1),Di=Tt(Ti),We=(Ii=Tn.current)===null||Ii===void 0?void 0:Ii.querySelector('li[data-path-key="'.concat(Di.replace(/\\{0,2}"/g,'\\"'),'"]'));We&&ve(We)}},[Ei,gi]);var bn=!((nn=Ie[0])!==null&&nn!==void 0&&(nn=nn.options)!==null&&nn!==void 0&&nn.length),_n=[(qn={},(0,Bt.Z)(qn,Xe.value,"__EMPTY__"),(0,Bt.Z)(qn,En,vi),(0,Bt.Z)(qn,"disabled",!0),qn)],hi=(0,Ut.Z)((0,Ut.Z)({},ze),{},{multiple:!bn&&Rn,onSelect:un,onActive:Gt,onToggleOpen:ti,checkedSet:Kn,halfCheckedSet:Je,loadingKeys:ye,isSelectable:de}),Yn=bn?[{options:_n}]:Ie,si=Yn.map(function(ei,Ii){var Ti=Ei.slice(0,Ii),Di=Ei[Ii];return jt.createElement(ri,(0,pt.Z)({key:Ii},hi,{prefixCls:In,options:ei.options,prevValuePath:Ti,activeValue:Di}))});return jt.createElement(yn,{open:Fn},jt.createElement("div",{className:Vn()("".concat(In,"-menus"),(vn={},(0,Bt.Z)(vn,"".concat(In,"-menu-empty"),bn),(0,Bt.Z)(vn,"".concat(In,"-rtl"),ai),vn)),ref:Tn},si))}),Mt=Zt,Yt=jt.forwardRef(function(ze,Ve){var nn=(0,Dt.lk)();return jt.createElement(Mt,(0,pt.Z)({},ze,nn,{ref:Ve}))}),Ge=Yt,De=kt(70425);function Ue(){}function we(ze){var Ve,nn=ze,qn=nn.prefixCls,vn=qn===void 0?"rc-cascader":qn,tn=nn.style,Rn=nn.className,gi=nn.options,ti=nn.checkable,vi=nn.defaultValue,Gi=nn.value,Fn=nn.fieldNames,xn=nn.changeOnSelect,Tn=nn.onChange,ai=nn.showCheckedStrategy,pi=nn.loadData,ui=nn.expandTrigger,zi=nn.expandIcon,wt=zi===void 0?">":zi,Xe=nn.loadingIcon,Hn=nn.direction,Ai=nn.notFoundContent,Vi=Ai===void 0?"Not Found":Ai,dr=nn.disabled,kr=!!ti,ci=(0,De.C8)(vi,{value:Gi,postState:xe}),In=(0,Le.Z)(ci,2),pe=In[0],Se=In[1],ye=jt.useMemo(function(){return Xt(Fn)},[JSON.stringify(Fn)]),jn=Jt(ye,gi),Ln=(0,Le.Z)(jn,3),Kn=Ln[0],Je=Ln[1],An=Ln[2],yi=an(Kn,ye),Ei=sn(kr,pe,Je,An,yi),Xi=(0,Le.Z)(Ei,3),Gt=Xi[0],de=Xi[1],un=Xi[2],Mn=(0,De.zX)(function(Yn){if(Se(Yn),Tn){var si=xe(Yn),ei=si.map(function(Di){return Qe(Di,Kn,ye).map(function(We){return We.option})}),Ii=kr?si:si[0],Ti=kr?ei:ei[0];Tn(Ii,Ti)}}),Ie=Oe(kr,Mn,Gt,de,un,Je,An,ai),$e=(0,De.zX)(function(Yn){Ie(Yn)}),bn=jt.useMemo(function(){return{options:Kn,fieldNames:ye,values:Gt,halfValues:de,changeOnSelect:xn,onSelect:$e,checkable:ti,searchOptions:[],dropdownPrefixCls:void 0,loadData:pi,expandTrigger:ui,expandIcon:wt,loadingIcon:Xe,dropdownMenuColumnStyle:void 0}},[Kn,ye,Gt,de,xn,$e,ti,pi,ui,wt,Xe]),_n="".concat(vn,"-panel"),hi=!Kn.length;return jt.createElement(se.Provider,{value:bn},jt.createElement("div",{className:Vn()(_n,(Ve={},(0,Bt.Z)(Ve,"".concat(_n,"-rtl"),Hn==="rtl"),(0,Bt.Z)(Ve,"".concat(_n,"-empty"),hi),Ve),Rn),style:tn},hi?Vi:jt.createElement(Mt,{prefixCls:vn,searchValue:"",multiple:kr,toggleOpen:Ue,open:!0,direction:Hn,disabled:dr})))}function Ee(ze){var Ve=ze.onPopupVisibleChange,nn=ze.popupVisible,qn=ze.popupClassName,vn=ze.popupPlacement;warning(!Ve,"`onPopupVisibleChange` is deprecated. Please use `onDropdownVisibleChange` instead."),warning(nn===void 0,"`popupVisible` is deprecated. Please use `open` instead."),warning(qn===void 0,"`popupClassName` is deprecated. Please use `dropdownClassName` instead."),warning(vn===void 0,"`popupPlacement` is deprecated. Please use `placement` instead.")}function Fe(ze,Ve){if(ze){var nn=function qn(vn){for(var tn=0;tn<vn.length;tn++){var Rn=vn[tn];if(Rn[Ve==null?void 0:Ve.value]===null)return warning(!1,"`value` in Cascader options should not be `null`."),!0;if(Array.isArray(Rn[Ve==null?void 0:Ve.children])&&qn(Rn[Ve==null?void 0:Ve.children]))return!0}};nn(ze)}}var He=null,qe=["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"],cn=jt.forwardRef(function(ze,Ve){var nn=ze.id,qn=ze.prefixCls,vn=qn===void 0?"rc-cascader":qn,tn=ze.fieldNames,Rn=ze.defaultValue,gi=ze.value,ti=ze.changeOnSelect,vi=ze.onChange,Gi=ze.displayRender,Fn=ze.checkable,xn=ze.autoClearSearchValue,Tn=xn===void 0?!0:xn,ai=ze.searchValue,pi=ze.onSearch,ui=ze.showSearch,zi=ze.expandTrigger,wt=ze.options,Xe=ze.dropdownPrefixCls,Hn=ze.loadData,Ai=ze.popupVisible,Vi=ze.open,dr=ze.popupClassName,kr=ze.dropdownClassName,ci=ze.dropdownMenuColumnStyle,In=ze.dropdownStyle,pe=ze.popupPlacement,Se=ze.placement,ye=ze.onDropdownVisibleChange,jn=ze.onPopupVisibleChange,Ln=ze.expandIcon,Kn=Ln===void 0?">":Ln,Je=ze.loadingIcon,An=ze.children,yi=ze.dropdownMatchSelectWidth,Ei=yi===void 0?!1:yi,Xi=ze.showCheckedStrategy,Gt=Xi===void 0?St:Xi,de=ze.optionRender,un=(0,he.Z)(ze,qe),Mn=(0,qt.ZP)(nn),Ie=!!Fn,$e=(0,ne.Z)(Rn,{value:gi,postState:xe}),bn=(0,Le.Z)($e,2),_n=bn[0],hi=bn[1],Yn=jt.useMemo(function(){return Xt(tn)},[JSON.stringify(tn)]),si=Jt(Yn,wt),ei=(0,Le.Z)(si,3),Ii=ei[0],Ti=ei[1],Di=ei[2],We=(0,ne.Z)("",{value:ai,postState:function(Ci){return Ci||""}}),gr=(0,Le.Z)(We,2),yr=gr[0],$r=gr[1],rn=function(Ci,Si){$r(Ci),Si.source!=="blur"&&pi&&pi(Ci)},On=Gn(ui),bi=(0,Le.Z)(On,2),Mi=bi[0],_i=bi[1],tr=gt(yr,Ii,Yn,Xe||vn,_i,ti||Ie),pr=an(Ii,Yn),br=sn(Ie,_n,Ti,Di,pr),Or=(0,Le.Z)(br,3),Ir=Or[0],fn=Or[1],ho=Or[2],pn=jt.useMemo(function(){var Jn=Ot(Ir),Ci=Pe(Jn,Ti,Gt);return[].concat((0,ue.Z)(ho),(0,ue.Z)(Di(Ci)))},[Ir,Ti,Di,ho,Gt]),Hi=_e(pn,Ii,Yn,Ie,Gi),Kr=(0,me.Z)(function(Jn){if(hi(Jn),vi){var Ci=xe(Jn),Si=Ci.map(function(Un){return Qe(Un,Ii,Yn).map(function(Qn){return Qn.option})}),li=Ie?Ci:Ci[0],mn=Ie?Si:Si[0];vi(li,mn)}}),ji=Oe(Ie,Kr,Ir,fn,ho,Ti,Di,Gt),xo=(0,me.Z)(function(Jn){(!Ie||Tn)&&$r(""),ji(Jn)}),Yr=function(Ci,Si){if(Si.type==="clear"){Kr([]);return}var li=Si.values[0],mn=li.valueCells;xo(mn)},Cr=Vi!==void 0?Vi:Ai,Po=kr||dr,je=Se||pe,Pn=function(Ci){ye==null||ye(Ci),jn==null||jn(Ci)},be=jt.useMemo(function(){return{options:Ii,fieldNames:Yn,values:Ir,halfValues:fn,changeOnSelect:ti,onSelect:xo,checkable:Fn,searchOptions:tr,dropdownPrefixCls:Xe,loadData:Hn,expandTrigger:zi,expandIcon:Kn,loadingIcon:Je,dropdownMenuColumnStyle:ci,optionRender:de}},[Ii,Yn,Ir,fn,ti,xo,Fn,tr,Xe,Hn,zi,Kn,Je,ci,de]),At=!(yr?tr:Ii).length,Zn=yr&&_i.matchInputWidth||At?{}:{minWidth:"auto"};return jt.createElement(se.Provider,{value:be},jt.createElement(Dt.Ac,(0,pt.Z)({},un,{ref:Ve,id:Mn,prefixCls:vn,autoClearSearchValue:Tn,dropdownMatchSelectWidth:Ei,dropdownStyle:(0,Ut.Z)((0,Ut.Z)({},Zn),In),displayValues:Hi,onDisplayValuesChange:Yr,mode:Ie?"multiple":void 0,searchValue:yr,onSearch:rn,showSearch:Mi,OptionList:Ge,emptyOptions:At,open:Cr,dropdownClassName:Po,placement:je,onDropdownVisibleChange:Pn,getRawInputElement:function(){return An}})))});cn.SHOW_PARENT=St,cn.SHOW_CHILD=Et,cn.Panel=we;var gn=cn,ni=gn},98535:function(Bn,zn,kt){"use strict";kt.r(zn),kt.d(zn,{Panel:function(){return xe},default:function(){return Ne}});var pt=kt(5016),Ut=kt(92393),ue=kt(52456),Le=kt(10928),he=kt(92310),Dt=kt.n(he),qt=kt(18929),me=kt(48736),ne=kt(59301),jt=kt(5883),Te=kt(11592),se=kt(20049),Ce=kt(18082),Bt=kt(77900),nt=kt(10228),et=ne.forwardRef(function(Pe,Qe){var _e=Pe.prefixCls,an=Pe.forceRender,Ke=Pe.className,re=Pe.style,Jt=Pe.children,Ye=Pe.isActive,Gn=Pe.role,dn=Pe.classNames,Oe=Pe.styles,sn=ne.useState(Ye||an),ln=(0,ue.Z)(sn,2),Vn=ln[0],Ae=ln[1];return ne.useEffect(function(){(an||Ye)&&Ae(!0)},[an,Ye]),Vn?ne.createElement("div",{ref:Qe,className:Dt()("".concat(_e,"-content"),(0,Ce.Z)((0,Ce.Z)({},"".concat(_e,"-content-active"),Ye),"".concat(_e,"-content-inactive"),!Ye),Ke),style:re,role:Gn},ne.createElement("div",{className:Dt()("".concat(_e,"-content-box"),dn==null?void 0:dn.body),style:Oe==null?void 0:Oe.body},Jt)):null});et.displayName="PanelContent";var ht=et,st=["showArrow","headerClass","isActive","onItemClick","forceRender","className","classNames","styles","prefixCls","collapsible","accordion","panelKey","extra","header","expandIcon","openMotion","destroyInactivePanel","children"],gt=ne.forwardRef(function(Pe,Qe){var _e=Pe.showArrow,an=_e===void 0?!0:_e,Ke=Pe.headerClass,re=Pe.isActive,Jt=Pe.onItemClick,Ye=Pe.forceRender,Gn=Pe.className,dn=Pe.classNames,Oe=dn===void 0?{}:dn,sn=Pe.styles,ln=sn===void 0?{}:sn,Vn=Pe.prefixCls,Ae=Pe.collapsible,yn=Pe.accordion,te=Pe.panelKey,En=Pe.extra,ri=Pe.header,Rt=Pe.expandIcon,Lt=Pe.openMotion,Pt=Pe.destroyInactivePanel,Nt=Pe.children,Zt=(0,jt.Z)(Pe,st),Mt=Ae==="disabled",Yt=En!=null&&typeof En!="boolean",Ge=(0,Ce.Z)((0,Ce.Z)((0,Ce.Z)({onClick:function(){Jt==null||Jt(te)},onKeyDown:function(qe){(qe.key==="Enter"||qe.keyCode===nt.Z.ENTER||qe.which===nt.Z.ENTER)&&(Jt==null||Jt(te))},role:yn?"tab":"button"},"aria-expanded",re),"aria-disabled",Mt),"tabIndex",Mt?-1:0),De=typeof Rt=="function"?Rt(Pe):ne.createElement("i",{className:"arrow"}),Ue=De&&ne.createElement("div",(0,pt.Z)({className:"".concat(Vn,"-expand-icon")},["header","icon"].includes(Ae)?Ge:{}),De),we=Dt()("".concat(Vn,"-item"),(0,Ce.Z)((0,Ce.Z)({},"".concat(Vn,"-item-active"),re),"".concat(Vn,"-item-disabled"),Mt),Gn),Ee=Dt()(Ke,"".concat(Vn,"-header"),(0,Ce.Z)({},"".concat(Vn,"-collapsible-").concat(Ae),!!Ae),Oe.header),Fe=(0,se.Z)({className:Ee,style:ln.header},["header","icon"].includes(Ae)?{}:Ge);return ne.createElement("div",(0,pt.Z)({},Zt,{ref:Qe,className:we}),ne.createElement("div",Fe,an&&Ue,ne.createElement("span",(0,pt.Z)({className:"".concat(Vn,"-header-text")},Ae==="header"?Ge:{}),ri),Yt&&ne.createElement("div",{className:"".concat(Vn,"-extra")},En)),ne.createElement(Bt.default,(0,pt.Z)({visible:re,leavedClassName:"".concat(Vn,"-content-hidden")},Lt,{forceRender:Ye,removeOnLeave:Pt}),function(He,qe){var cn=He.className,gn=He.style;return ne.createElement(ht,{ref:qe,prefixCls:Vn,className:cn,classNames:Oe,style:gn,styles:ln,isActive:re,forceRender:Ye,role:yn?"tabpanel":void 0},Nt)}))}),vt=gt,St=["children","label","key","collapsible","onItemClick","destroyInactivePanel"],Et=function(Qe,_e){var an=_e.prefixCls,Ke=_e.accordion,re=_e.collapsible,Jt=_e.destroyInactivePanel,Ye=_e.onItemClick,Gn=_e.activeKey,dn=_e.openMotion,Oe=_e.expandIcon;return Qe.map(function(sn,ln){var Vn=sn.children,Ae=sn.label,yn=sn.key,te=sn.collapsible,En=sn.onItemClick,ri=sn.destroyInactivePanel,Rt=(0,jt.Z)(sn,St),Lt=String(yn!=null?yn:ln),Pt=te!=null?te:re,Nt=ri!=null?ri:Jt,Zt=function(Ge){Pt!=="disabled"&&(Ye(Ge),En==null||En(Ge))},Mt=!1;return Ke?Mt=Gn[0]===Lt:Mt=Gn.indexOf(Lt)>-1,ne.createElement(vt,(0,pt.Z)({},Rt,{prefixCls:an,key:Lt,panelKey:Lt,isActive:Mt,accordion:Ke,openMotion:dn,expandIcon:Oe,header:Ae,collapsible:Pt,onItemClick:Zt,destroyInactivePanel:Nt}),Vn)})},Tt=function(Qe,_e,an){if(!Qe)return null;var Ke=an.prefixCls,re=an.accordion,Jt=an.collapsible,Ye=an.destroyInactivePanel,Gn=an.onItemClick,dn=an.activeKey,Oe=an.openMotion,sn=an.expandIcon,ln=Qe.key||String(_e),Vn=Qe.props,Ae=Vn.header,yn=Vn.headerClass,te=Vn.destroyInactivePanel,En=Vn.collapsible,ri=Vn.onItemClick,Rt=!1;re?Rt=dn[0]===ln:Rt=dn.indexOf(ln)>-1;var Lt=En!=null?En:Jt,Pt=function(Mt){Lt!=="disabled"&&(Gn(Mt),ri==null||ri(Mt))},Nt={key:ln,panelKey:ln,header:Ae,headerClass:yn,isActive:Rt,prefixCls:Ke,destroyInactivePanel:te!=null?te:Ye,openMotion:Oe,accordion:re,children:Qe.props.children,onItemClick:Pt,expandIcon:sn,collapsible:Lt};return typeof Qe.type=="string"?Qe:(Object.keys(Nt).forEach(function(Zt){typeof Nt[Zt]=="undefined"&&delete Nt[Zt]}),ne.cloneElement(Qe,Nt))};function Ot(Pe,Qe,_e){return Array.isArray(Pe)?Et(Pe,_e):(0,Te.Z)(Qe).map(function(an,Ke){return Tt(an,Ke,_e)})}var $t=Ot,Xt=kt(26112);function Ht(Pe){var Qe=Pe;if(!Array.isArray(Qe)){var _e=(0,Le.Z)(Qe);Qe=_e==="number"||_e==="string"?[Qe]:[]}return Qe.map(function(an){return String(an)})}var ve=ne.forwardRef(function(Pe,Qe){var _e=Pe.prefixCls,an=_e===void 0?"rc-collapse":_e,Ke=Pe.destroyInactivePanel,re=Ke===void 0?!1:Ke,Jt=Pe.style,Ye=Pe.accordion,Gn=Pe.className,dn=Pe.children,Oe=Pe.collapsible,sn=Pe.openMotion,ln=Pe.expandIcon,Vn=Pe.activeKey,Ae=Pe.defaultActiveKey,yn=Pe.onChange,te=Pe.items,En=Dt()(an,Gn),ri=(0,qt.Z)([],{value:Vn,onChange:function(Yt){return yn==null?void 0:yn(Yt)},defaultValue:Ae,postState:Ht}),Rt=(0,ue.Z)(ri,2),Lt=Rt[0],Pt=Rt[1],Nt=function(Yt){return Pt(function(){if(Ye)return Lt[0]===Yt?[]:[Yt];var Ge=Lt.indexOf(Yt),De=Ge>-1;return De?Lt.filter(function(Ue){return Ue!==Yt}):[].concat((0,Ut.Z)(Lt),[Yt])})};(0,me.ZP)(!dn,"[rc-collapse] `children` will be removed in next major version. Please use `items` instead.");var Zt=$t(te,dn,{prefixCls:an,accordion:Ye,openMotion:sn,expandIcon:ln,collapsible:Oe,destroyInactivePanel:re,onItemClick:Nt,activeKey:Lt});return ne.createElement("div",(0,pt.Z)({ref:Qe,className:En,style:Jt,role:Ye?"tablist":void 0},(0,Xt.Z)(Pe,{aria:!0,data:!0})),Zt)}),ie=Object.assign(ve,{Panel:vt}),Ne=ie,xe=ie.Panel},23425:function(Bn,zn,kt){"use strict";kt.d(zn,{Z:function(){return Ot}});var pt=kt(18082),Ut=kt(5016),ue=kt(10928),Le=kt(20049),he=kt(52456),Dt=kt(92310),qt=kt.n(Dt),me=kt(18929),ne=kt(10228),jt=kt(26112),Te=kt(48736),se=kt(59301),Ce=kt(17119),Bt=[10,20,50,100],nt=function(Xt){var Ht=Xt.pageSizeOptions,ve=Ht===void 0?Bt:Ht,ie=Xt.locale,Ne=Xt.changeSize,xe=Xt.pageSize,Pe=Xt.goButton,Qe=Xt.quickGo,_e=Xt.rootPrefixCls,an=Xt.disabled,Ke=Xt.buildOptionText,re=Xt.showSizeChanger,Jt=Xt.sizeChangerRender,Ye=se.useState(""),Gn=(0,he.Z)(Ye,2),dn=Gn[0],Oe=Gn[1],sn=function(){return!dn||Number.isNaN(dn)?void 0:Number(dn)},ln=typeof Ke=="function"?Ke:function(Pt){return"".concat(Pt," ").concat(ie.items_per_page)},Vn=function(Nt){Oe(Nt.target.value)},Ae=function(Nt){Pe||dn===""||(Oe(""),!(Nt.relatedTarget&&(Nt.relatedTarget.className.indexOf("".concat(_e,"-item-link"))>=0||Nt.relatedTarget.className.indexOf("".concat(_e,"-item"))>=0))&&(Qe==null||Qe(sn())))},yn=function(Nt){dn!==""&&(Nt.keyCode===ne.Z.ENTER||Nt.type==="click")&&(Oe(""),Qe==null||Qe(sn()))},te=function(){return ve.some(function(Nt){return Nt.toString()===xe.toString()})?ve:ve.concat([xe]).sort(function(Nt,Zt){var Mt=Number.isNaN(Number(Nt))?0:Number(Nt),Yt=Number.isNaN(Number(Zt))?0:Number(Zt);return Mt-Yt})},En="".concat(_e,"-options");if(!re&&!Qe)return null;var ri=null,Rt=null,Lt=null;return re&&Jt&&(ri=Jt({disabled:an,size:xe,onSizeChange:function(Nt){Ne==null||Ne(Number(Nt))},"aria-label":ie.page_size,className:"".concat(En,"-size-changer"),options:te().map(function(Pt){return{label:ln(Pt),value:Pt}})})),Qe&&(Pe&&(Lt=typeof Pe=="boolean"?se.createElement("button",{type:"button",onClick:yn,onKeyUp:yn,disabled:an,className:"".concat(En,"-quick-jumper-button")},ie.jump_to_confirm):se.createElement("span",{onClick:yn,onKeyUp:yn},Pe)),Rt=se.createElement("div",{className:"".concat(En,"-quick-jumper")},ie.jump_to,se.createElement("input",{disabled:an,type:"text",value:dn,onChange:Vn,onKeyUp:yn,onBlur:Ae,"aria-label":ie.page}),ie.page,Lt)),se.createElement("li",{className:En},ri,Rt)},et=nt,ht=function(Xt){var Ht=Xt.rootPrefixCls,ve=Xt.page,ie=Xt.active,Ne=Xt.className,xe=Xt.showTitle,Pe=Xt.onClick,Qe=Xt.onKeyPress,_e=Xt.itemRender,an="".concat(Ht,"-item"),Ke=qt()(an,"".concat(an,"-").concat(ve),(0,pt.Z)((0,pt.Z)({},"".concat(an,"-active"),ie),"".concat(an,"-disabled"),!ve),Ne),re=function(){Pe(ve)},Jt=function(dn){Qe(dn,Pe,ve)},Ye=_e(ve,"page",se.createElement("a",{rel:"nofollow"},ve));return Ye?se.createElement("li",{title:xe?String(ve):null,className:Ke,onClick:re,onKeyDown:Jt,tabIndex:0},Ye):null},st=ht,gt=function(Xt,Ht,ve){return ve};function vt(){}function St($t){var Xt=Number($t);return typeof Xt=="number"&&!Number.isNaN(Xt)&&isFinite(Xt)&&Math.floor(Xt)===Xt}function Et($t,Xt,Ht){var ve=typeof $t=="undefined"?Xt:$t;return Math.floor((Ht-1)/ve)+1}var Tt=function(Xt){var Ht=Xt.prefixCls,ve=Ht===void 0?"rc-pagination":Ht,ie=Xt.selectPrefixCls,Ne=ie===void 0?"rc-select":ie,xe=Xt.className,Pe=Xt.current,Qe=Xt.defaultCurrent,_e=Qe===void 0?1:Qe,an=Xt.total,Ke=an===void 0?0:an,re=Xt.pageSize,Jt=Xt.defaultPageSize,Ye=Jt===void 0?10:Jt,Gn=Xt.onChange,dn=Gn===void 0?vt:Gn,Oe=Xt.hideOnSinglePage,sn=Xt.align,ln=Xt.showPrevNextJumpers,Vn=ln===void 0?!0:ln,Ae=Xt.showQuickJumper,yn=Xt.showLessItems,te=Xt.showTitle,En=te===void 0?!0:te,ri=Xt.onShowSizeChange,Rt=ri===void 0?vt:ri,Lt=Xt.locale,Pt=Lt===void 0?Ce.Z:Lt,Nt=Xt.style,Zt=Xt.totalBoundaryShowSizeChanger,Mt=Zt===void 0?50:Zt,Yt=Xt.disabled,Ge=Xt.simple,De=Xt.showTotal,Ue=Xt.showSizeChanger,we=Ue===void 0?Ke>Mt:Ue,Ee=Xt.sizeChangerRender,Fe=Xt.pageSizeOptions,He=Xt.itemRender,qe=He===void 0?gt:He,cn=Xt.jumpPrevIcon,gn=Xt.jumpNextIcon,ni=Xt.prevIcon,ze=Xt.nextIcon,Ve=se.useRef(null),nn=(0,me.Z)(10,{value:re,defaultValue:Ye}),qn=(0,he.Z)(nn,2),vn=qn[0],tn=qn[1],Rn=(0,me.Z)(1,{value:Pe,defaultValue:_e,postState:function(Kr){return Math.max(1,Math.min(Kr,Et(void 0,vn,Ke)))}}),gi=(0,he.Z)(Rn,2),ti=gi[0],vi=gi[1],Gi=se.useState(ti),Fn=(0,he.Z)(Gi,2),xn=Fn[0],Tn=Fn[1];(0,se.useEffect)(function(){Tn(ti)},[ti]);var ai=dn!==vt,pi="current"in Xt,ui=Math.max(1,ti-(yn?3:5)),zi=Math.min(Et(void 0,vn,Ke),ti+(yn?3:5));function wt(Hi,Kr){var ji=Hi||se.createElement("button",{type:"button","aria-label":Kr,className:"".concat(ve,"-item-link")});return typeof Hi=="function"&&(ji=se.createElement(Hi,(0,Le.Z)({},Xt))),ji}function Xe(Hi){var Kr=Hi.target.value,ji=Et(void 0,vn,Ke),xo;return Kr===""?xo=Kr:Number.isNaN(Number(Kr))?xo=xn:Kr>=ji?xo=ji:xo=Number(Kr),xo}function Hn(Hi){return St(Hi)&&Hi!==ti&&St(Ke)&&Ke>0}var Ai=Ke>vn?Ae:!1;function Vi(Hi){(Hi.keyCode===ne.Z.UP||Hi.keyCode===ne.Z.DOWN)&&Hi.preventDefault()}function dr(Hi){var Kr=Xe(Hi);switch(Kr!==xn&&Tn(Kr),Hi.keyCode){case ne.Z.ENTER:In(Kr);break;case ne.Z.UP:In(Kr-1);break;case ne.Z.DOWN:In(Kr+1);break;default:break}}function kr(Hi){In(Xe(Hi))}function ci(Hi){var Kr=Et(Hi,vn,Ke),ji=ti>Kr&&Kr!==0?Kr:ti;tn(Hi),Tn(ji),Rt==null||Rt(ti,Hi),vi(ji),dn==null||dn(ji,Hi)}function In(Hi){if(Hn(Hi)&&!Yt){var Kr=Et(void 0,vn,Ke),ji=Hi;return Hi>Kr?ji=Kr:Hi<1&&(ji=1),ji!==xn&&Tn(ji),vi(ji),dn==null||dn(ji,vn),ji}return ti}var pe=ti>1,Se=ti<Et(void 0,vn,Ke);function ye(){pe&&In(ti-1)}function jn(){Se&&In(ti+1)}function Ln(){In(ui)}function Kn(){In(zi)}function Je(Hi,Kr){if(Hi.key==="Enter"||Hi.charCode===ne.Z.ENTER||Hi.keyCode===ne.Z.ENTER){for(var ji=arguments.length,xo=new Array(ji>2?ji-2:0),Yr=2;Yr<ji;Yr++)xo[Yr-2]=arguments[Yr];Kr.apply(void 0,xo)}}function An(Hi){Je(Hi,ye)}function yi(Hi){Je(Hi,jn)}function Ei(Hi){Je(Hi,Ln)}function Xi(Hi){Je(Hi,Kn)}function Gt(Hi){var Kr=qe(Hi,"prev",wt(ni,"prev page"));return se.isValidElement(Kr)?se.cloneElement(Kr,{disabled:!pe}):Kr}function de(Hi){var Kr=qe(Hi,"next",wt(ze,"next page"));return se.isValidElement(Kr)?se.cloneElement(Kr,{disabled:!Se}):Kr}function un(Hi){(Hi.type==="click"||Hi.keyCode===ne.Z.ENTER)&&In(xn)}var Mn=null,Ie=(0,jt.Z)(Xt,{aria:!0,data:!0}),$e=De&&se.createElement("li",{className:"".concat(ve,"-total-text")},De(Ke,[Ke===0?0:(ti-1)*vn+1,ti*vn>Ke?Ke:ti*vn])),bn=null,_n=Et(void 0,vn,Ke);if(Oe&&Ke<=vn)return null;var hi=[],Yn={rootPrefixCls:ve,onClick:In,onKeyPress:Je,showTitle:En,itemRender:qe,page:-1},si=ti-1>0?ti-1:0,ei=ti+1<_n?ti+1:_n,Ii=Ae&&Ae.goButton,Ti=(0,ue.Z)(Ge)==="object"?Ge.readOnly:!Ge,Di=Ii,We=null;Ge&&(Ii&&(typeof Ii=="boolean"?Di=se.createElement("button",{type:"button",onClick:un,onKeyUp:un},Pt.jump_to_confirm):Di=se.createElement("span",{onClick:un,onKeyUp:un},Ii),Di=se.createElement("li",{title:En?"".concat(Pt.jump_to).concat(ti,"/").concat(_n):null,className:"".concat(ve,"-simple-pager")},Di)),We=se.createElement("li",{title:En?"".concat(ti,"/").concat(_n):null,className:"".concat(ve,"-simple-pager")},Ti?xn:se.createElement("input",{type:"text","aria-label":Pt.jump_to,value:xn,disabled:Yt,onKeyDown:Vi,onKeyUp:dr,onChange:dr,onBlur:kr,size:3}),se.createElement("span",{className:"".concat(ve,"-slash")},"/"),_n));var gr=yn?1:2;if(_n<=3+gr*2){_n||hi.push(se.createElement(st,(0,Ut.Z)({},Yn,{key:"noPager",page:1,className:"".concat(ve,"-item-disabled")})));for(var yr=1;yr<=_n;yr+=1)hi.push(se.createElement(st,(0,Ut.Z)({},Yn,{key:yr,page:yr,active:ti===yr})))}else{var $r=yn?Pt.prev_3:Pt.prev_5,rn=yn?Pt.next_3:Pt.next_5,On=qe(ui,"jump-prev",wt(cn,"prev page")),bi=qe(zi,"jump-next",wt(gn,"next page"));Vn&&(Mn=On?se.createElement("li",{title:En?$r:null,key:"prev",onClick:Ln,tabIndex:0,onKeyDown:Ei,className:qt()("".concat(ve,"-jump-prev"),(0,pt.Z)({},"".concat(ve,"-jump-prev-custom-icon"),!!cn))},On):null,bn=bi?se.createElement("li",{title:En?rn:null,key:"next",onClick:Kn,tabIndex:0,onKeyDown:Xi,className:qt()("".concat(ve,"-jump-next"),(0,pt.Z)({},"".concat(ve,"-jump-next-custom-icon"),!!gn))},bi):null);var Mi=Math.max(1,ti-gr),_i=Math.min(ti+gr,_n);ti-1<=gr&&(_i=1+gr*2),_n-ti<=gr&&(Mi=_n-gr*2);for(var tr=Mi;tr<=_i;tr+=1)hi.push(se.createElement(st,(0,Ut.Z)({},Yn,{key:tr,page:tr,active:ti===tr})));if(ti-1>=gr*2&&ti!==3&&(hi[0]=se.cloneElement(hi[0],{className:qt()("".concat(ve,"-item-after-jump-prev"),hi[0].props.className)}),hi.unshift(Mn)),_n-ti>=gr*2&&ti!==_n-2){var pr=hi[hi.length-1];hi[hi.length-1]=se.cloneElement(pr,{className:qt()("".concat(ve,"-item-before-jump-next"),pr.props.className)}),hi.push(bn)}Mi!==1&&hi.unshift(se.createElement(st,(0,Ut.Z)({},Yn,{key:1,page:1}))),_i!==_n&&hi.push(se.createElement(st,(0,Ut.Z)({},Yn,{key:_n,page:_n})))}var br=Gt(si);if(br){var Or=!pe||!_n;br=se.createElement("li",{title:En?Pt.prev_page:null,onClick:ye,tabIndex:Or?null:0,onKeyDown:An,className:qt()("".concat(ve,"-prev"),(0,pt.Z)({},"".concat(ve,"-disabled"),Or)),"aria-disabled":Or},br)}var Ir=de(ei);if(Ir){var fn,ho;Ge?(fn=!Se,ho=pe?0:null):(fn=!Se||!_n,ho=fn?null:0),Ir=se.createElement("li",{title:En?Pt.next_page:null,onClick:jn,tabIndex:ho,onKeyDown:yi,className:qt()("".concat(ve,"-next"),(0,pt.Z)({},"".concat(ve,"-disabled"),fn)),"aria-disabled":fn},Ir)}var pn=qt()(ve,xe,(0,pt.Z)((0,pt.Z)((0,pt.Z)((0,pt.Z)((0,pt.Z)({},"".concat(ve,"-start"),sn==="start"),"".concat(ve,"-center"),sn==="center"),"".concat(ve,"-end"),sn==="end"),"".concat(ve,"-simple"),Ge),"".concat(ve,"-disabled"),Yt));return se.createElement("ul",(0,Ut.Z)({className:pn,style:Nt,ref:Ve},Ie),$e,br,Ge?We:hi,Ir,se.createElement(et,{locale:Pt,rootPrefixCls:ve,disabled:Yt,selectPrefixCls:Ne,changeSize:ci,pageSize:vn,pageSizeOptions:Fe,quickGo:Ai?In:null,goButton:Di,showSizeChanger:we,sizeChangerRender:Ee}))},Ot=Tt},738:function(Bn,zn,kt){"use strict";kt.d(zn,{Z:function(){return vt}});var pt=kt(5016),Ut=kt(18082),ue=kt(52456),Le=kt(5883),he=kt(92310),Dt=kt.n(he),qt=kt(18929),me=kt(10228),ne=kt(26112),jt=kt(59301);function Te(St,Et){var Tt=St.disabled,Ot=St.prefixCls,$t=St.character,Xt=St.characterRender,Ht=St.index,ve=St.count,ie=St.value,Ne=St.allowHalf,xe=St.focused,Pe=St.onHover,Qe=St.onClick,_e=function(Oe){Pe(Oe,Ht)},an=function(Oe){Qe(Oe,Ht)},Ke=function(Oe){Oe.keyCode===me.Z.ENTER&&Qe(Oe,Ht)},re=Ht+1,Jt=new Set([Ot]);ie===0&&Ht===0&&xe?Jt.add("".concat(Ot,"-focused")):Ne&&ie+.5>=re&&ie<re?(Jt.add("".concat(Ot,"-half")),Jt.add("".concat(Ot,"-active")),xe&&Jt.add("".concat(Ot,"-focused"))):(re<=ie?Jt.add("".concat(Ot,"-full")):Jt.add("".concat(Ot,"-zero")),re===ie&&xe&&Jt.add("".concat(Ot,"-focused")));var Ye=typeof $t=="function"?$t(St):$t,Gn=jt.createElement("li",{className:Dt()(Array.from(Jt)),ref:Et},jt.createElement("div",{onClick:Tt?null:an,onKeyDown:Tt?null:Ke,onMouseMove:Tt?null:_e,role:"radio","aria-checked":ie>Ht?"true":"false","aria-posinset":Ht+1,"aria-setsize":ve,tabIndex:Tt?-1:0},jt.createElement("div",{className:"".concat(Ot,"-first")},Ye),jt.createElement("div",{className:"".concat(Ot,"-second")},Ye)));return Xt&&(Gn=Xt(Gn,St)),Gn}var se=jt.forwardRef(Te);function Ce(){var St=jt.useRef({});function Et(Ot){return St.current[Ot]}function Tt(Ot){return function($t){St.current[Ot]=$t}}return[Et,Tt]}function Bt(St){var Et=St.pageXOffset,Tt="scrollLeft";if(typeof Et!="number"){var Ot=St.document;Et=Ot.documentElement[Tt],typeof Et!="number"&&(Et=Ot.body[Tt])}return Et}function nt(St){var Et,Tt,Ot=St.ownerDocument,$t=Ot.body,Xt=Ot&&Ot.documentElement,Ht=St.getBoundingClientRect();return Et=Ht.left,Tt=Ht.top,Et-=Xt.clientLeft||$t.clientLeft||0,Tt-=Xt.clientTop||$t.clientTop||0,{left:Et,top:Tt}}function et(St){var Et=nt(St),Tt=St.ownerDocument,Ot=Tt.defaultView||Tt.parentWindow;return Et.left+=Bt(Ot),Et.left}var ht=["prefixCls","className","defaultValue","value","count","allowHalf","allowClear","keyboard","character","characterRender","disabled","direction","tabIndex","autoFocus","onHoverChange","onChange","onFocus","onBlur","onKeyDown","onMouseLeave"];function st(St,Et){var Tt=St.prefixCls,Ot=Tt===void 0?"rc-rate":Tt,$t=St.className,Xt=St.defaultValue,Ht=St.value,ve=St.count,ie=ve===void 0?5:ve,Ne=St.allowHalf,xe=Ne===void 0?!1:Ne,Pe=St.allowClear,Qe=Pe===void 0?!0:Pe,_e=St.keyboard,an=_e===void 0?!0:_e,Ke=St.character,re=Ke===void 0?"\u2605":Ke,Jt=St.characterRender,Ye=St.disabled,Gn=St.direction,dn=Gn===void 0?"ltr":Gn,Oe=St.tabIndex,sn=Oe===void 0?0:Oe,ln=St.autoFocus,Vn=St.onHoverChange,Ae=St.onChange,yn=St.onFocus,te=St.onBlur,En=St.onKeyDown,ri=St.onMouseLeave,Rt=(0,Le.Z)(St,ht),Lt=Ce(),Pt=(0,ue.Z)(Lt,2),Nt=Pt[0],Zt=Pt[1],Mt=jt.useRef(null),Yt=function(){if(!Ye){var ui;(ui=Mt.current)===null||ui===void 0||ui.focus()}};jt.useImperativeHandle(Et,function(){return{focus:Yt,blur:function(){if(!Ye){var ui;(ui=Mt.current)===null||ui===void 0||ui.blur()}}}});var Ge=(0,qt.Z)(Xt||0,{value:Ht}),De=(0,ue.Z)(Ge,2),Ue=De[0],we=De[1],Ee=(0,qt.Z)(null),Fe=(0,ue.Z)(Ee,2),He=Fe[0],qe=Fe[1],cn=function(ui,zi){var wt=dn==="rtl",Xe=ui+1;if(xe){var Hn=Nt(ui),Ai=et(Hn),Vi=Hn.clientWidth;(wt&&zi-Ai>Vi/2||!wt&&zi-Ai<Vi/2)&&(Xe-=.5)}return Xe},gn=function(ui){we(ui),Ae==null||Ae(ui)},ni=jt.useState(!1),ze=(0,ue.Z)(ni,2),Ve=ze[0],nn=ze[1],qn=function(){nn(!0),yn==null||yn()},vn=function(){nn(!1),te==null||te()},tn=jt.useState(null),Rn=(0,ue.Z)(tn,2),gi=Rn[0],ti=Rn[1],vi=function(ui,zi){var wt=cn(zi,ui.pageX);wt!==He&&(ti(wt),qe(null)),Vn==null||Vn(wt)},Gi=function(ui){Ye||(ti(null),qe(null),Vn==null||Vn(void 0)),ui&&(ri==null||ri(ui))},Fn=function(ui,zi){var wt=cn(zi,ui.pageX),Xe=!1;Qe&&(Xe=wt===Ue),Gi(),gn(Xe?0:wt),qe(Xe?wt:null)},xn=function(ui){var zi=ui.keyCode,wt=dn==="rtl",Xe=xe?.5:1;an&&(zi===me.Z.RIGHT&&Ue<ie&&!wt?(gn(Ue+Xe),ui.preventDefault()):zi===me.Z.LEFT&&Ue>0&&!wt||zi===me.Z.RIGHT&&Ue>0&&wt?(gn(Ue-Xe),ui.preventDefault()):zi===me.Z.LEFT&&Ue<ie&&wt&&(gn(Ue+Xe),ui.preventDefault())),En==null||En(ui)};jt.useEffect(function(){ln&&!Ye&&Yt()},[]);var Tn=new Array(ie).fill(0).map(function(pi,ui){return jt.createElement(se,{ref:Zt(ui),index:ui,count:ie,disabled:Ye,prefixCls:"".concat(Ot,"-star"),allowHalf:xe,value:gi===null?Ue:gi,onClick:Fn,onHover:vi,key:pi||ui,character:re,characterRender:Jt,focused:Ve})}),ai=Dt()(Ot,$t,(0,Ut.Z)((0,Ut.Z)({},"".concat(Ot,"-disabled"),Ye),"".concat(Ot,"-rtl"),dn==="rtl"));return jt.createElement("ul",(0,pt.Z)({className:ai,onMouseLeave:Gi,tabIndex:Ye?-1:sn,onFocus:Ye?null:qn,onBlur:Ye?null:vn,onKeyDown:Ye?null:xn,ref:Mt},(0,ne.Z)(Rt,{aria:!0,data:!0,attr:!0})),Tn)}var gt=jt.forwardRef(st),vt=gt},6551:function(Bn,zn,kt){"use strict";kt.d(zn,{ZP:function(){return qt}});var pt=kt(52456),Ut=kt(59301),ue=kt(47273),Le=0,he=(0,ue.Z)();function Dt(){var me;return he?(me=Le,Le+=1):me="TEST_OR_SSR",me}function qt(me){var ne=Ut.useState(),jt=(0,pt.Z)(ne,2),Te=jt[0],se=jt[1];return Ut.useEffect(function(){se("rc_select_".concat(Dt()))},[]),me||Te}},37463:function(Bn,zn,kt){"use strict";kt.d(zn,{Ac:function(){return nn},Xo:function(){return vn},Wx:function(){return Rn},ZP:function(){return Xi},lk:function(){return vt}});var pt=kt(5016),Ut=kt(92393),ue=kt(18082),Le=kt(20049),he=kt(52456),Dt=kt(5883),qt=kt(10928),me=kt(18929),ne=kt(48736),jt=kt(59301),Te=kt(92310),se=kt.n(Te),Ce=kt(34280),Bt=kt(49658),nt=kt(8654),et=function(de){var un=de.className,Mn=de.customizeIcon,Ie=de.customizeIconProps,$e=de.children,bn=de.onMouseDown,_n=de.onClick,hi=typeof Mn=="function"?Mn(Ie):Mn;return jt.createElement("span",{className:un,onMouseDown:function(si){si.preventDefault(),bn==null||bn(si)},style:{userSelect:"none",WebkitUserSelect:"none"},unselectable:"on",onClick:_n,"aria-hidden":!0},hi!==void 0?hi:jt.createElement("span",{className:se()(un.split(/\s+/).map(function(Yn){return"".concat(Yn,"-icon")}))},$e))},ht=et,st=function(de,un,Mn,Ie,$e){var bn=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!1,_n=arguments.length>6?arguments[6]:void 0,hi=arguments.length>7?arguments[7]:void 0,Yn=jt.useMemo(function(){if((0,qt.Z)(Ie)==="object")return Ie.clearIcon;if($e)return $e},[Ie,$e]),si=jt.useMemo(function(){return!!(!bn&&Ie&&(Mn.length||_n)&&!(hi==="combobox"&&_n===""))},[Ie,bn,Mn.length,_n,hi]);return{allowClear:si,clearIcon:jt.createElement(ht,{className:"".concat(de,"-clear"),onMouseDown:un,customizeIcon:Yn},"\xD7")}},gt=jt.createContext(null);function vt(){return jt.useContext(gt)}function St(){var Gt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:10,de=jt.useState(!1),un=(0,he.Z)(de,2),Mn=un[0],Ie=un[1],$e=jt.useRef(null),bn=function(){window.clearTimeout($e.current)};jt.useEffect(function(){return bn},[]);var _n=function(Yn,si){bn(),$e.current=window.setTimeout(function(){Ie(Yn),si&&si()},Gt)};return[Mn,_n,bn]}function Et(){var Gt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:250,de=jt.useRef(null),un=jt.useRef(null);jt.useEffect(function(){return function(){window.clearTimeout(un.current)}},[]);function Mn(Ie){(Ie||de.current===null)&&(de.current=Ie),window.clearTimeout(un.current),un.current=window.setTimeout(function(){de.current=null},Gt)}return[function(){return de.current},Mn]}function Tt(Gt,de,un,Mn){var Ie=jt.useRef(null);Ie.current={open:de,triggerOpen:un,customizedTrigger:Mn},jt.useEffect(function(){function $e(bn){var _n;if(!((_n=Ie.current)!==null&&_n!==void 0&&_n.customizedTrigger)){var hi=bn.target;hi.shadowRoot&&bn.composed&&(hi=bn.composedPath()[0]||hi),Ie.current.open&&Gt().filter(function(Yn){return Yn}).every(function(Yn){return!Yn.contains(hi)&&Yn!==hi})&&Ie.current.triggerOpen(!1)}}return window.addEventListener("mousedown",$e),function(){return window.removeEventListener("mousedown",$e)}},[])}var Ot=kt(10228);function $t(Gt){return Gt&&![Ot.Z.ESC,Ot.Z.SHIFT,Ot.Z.BACKSPACE,Ot.Z.TAB,Ot.Z.WIN_KEY,Ot.Z.ALT,Ot.Z.META,Ot.Z.WIN_KEY_RIGHT,Ot.Z.CTRL,Ot.Z.SEMICOLON,Ot.Z.EQUALS,Ot.Z.CAPS_LOCK,Ot.Z.CONTEXT_MENU,Ot.Z.F1,Ot.Z.F2,Ot.Z.F3,Ot.Z.F4,Ot.Z.F5,Ot.Z.F6,Ot.Z.F7,Ot.Z.F8,Ot.Z.F9,Ot.Z.F10,Ot.Z.F11,Ot.Z.F12].includes(Gt)}var Xt=kt(26112),Ht=kt(11780);function ve(Gt,de,un){var Mn=(0,Le.Z)((0,Le.Z)({},Gt),un?de:{});return Object.keys(de).forEach(function(Ie){var $e=de[Ie];typeof $e=="function"&&(Mn[Ie]=function(){for(var bn,_n=arguments.length,hi=new Array(_n),Yn=0;Yn<_n;Yn++)hi[Yn]=arguments[Yn];return $e.apply(void 0,hi),(bn=Gt[Ie])===null||bn===void 0?void 0:bn.call.apply(bn,[Gt].concat(hi))})}),Mn}var ie=ve,Ne=["prefixCls","id","inputElement","autoFocus","autoComplete","editable","activeDescendantId","value","open","attrs"],xe=function(de,un){var Mn=de.prefixCls,Ie=de.id,$e=de.inputElement,bn=de.autoFocus,_n=de.autoComplete,hi=de.editable,Yn=de.activeDescendantId,si=de.value,ei=de.open,Ii=de.attrs,Ti=(0,Dt.Z)(de,Ne),Di=$e||jt.createElement("input",null),We=Di,gr=We.ref,yr=We.props;return(0,ne.Kp)(!("maxLength"in Di.props),"Passing 'maxLength' to input element directly may not work because input in BaseSelect is controlled."),Di=jt.cloneElement(Di,(0,Le.Z)((0,Le.Z)((0,Le.Z)({type:"search"},ie(Ti,yr,!0)),{},{id:Ie,ref:(0,nt.sQ)(un,gr),autoComplete:_n||"off",autoFocus:bn,className:se()("".concat(Mn,"-selection-search-input"),yr==null?void 0:yr.className),role:"combobox","aria-expanded":ei||!1,"aria-haspopup":"listbox","aria-owns":"".concat(Ie,"_list"),"aria-autocomplete":"list","aria-controls":"".concat(Ie,"_list"),"aria-activedescendant":ei?Yn:void 0},Ii),{},{value:hi?si:"",readOnly:!hi,unselectable:hi?null:"on",style:(0,Le.Z)((0,Le.Z)({},yr.style),{},{opacity:hi?null:0})})),Di},Pe=jt.forwardRef(xe),Qe=Pe;function _e(Gt){return Array.isArray(Gt)?Gt:Gt!==void 0?[Gt]:[]}var an=typeof window!="undefined"&&window.document&&window.document.documentElement,Ke=an;function re(Gt){return Gt!=null}function Jt(Gt){return!Gt&&Gt!==0}function Ye(Gt){return["string","number"].includes((0,qt.Z)(Gt))}function Gn(Gt){var de=void 0;return Gt&&(Ye(Gt.title)?de=Gt.title.toString():Ye(Gt.label)&&(de=Gt.label.toString())),de}function dn(Gt,de){Ke?jt.useLayoutEffect(Gt,de):jt.useEffect(Gt,de)}function Oe(Gt){var de;return(de=Gt.key)!==null&&de!==void 0?de:Gt.value}var sn=function(de){de.preventDefault(),de.stopPropagation()},ln=function(de){var un=de.id,Mn=de.prefixCls,Ie=de.values,$e=de.open,bn=de.searchValue,_n=de.autoClearSearchValue,hi=de.inputRef,Yn=de.placeholder,si=de.disabled,ei=de.mode,Ii=de.showSearch,Ti=de.autoFocus,Di=de.autoComplete,We=de.activeDescendantId,gr=de.tabIndex,yr=de.removeIcon,$r=de.maxTagCount,rn=de.maxTagTextLength,On=de.maxTagPlaceholder,bi=On===void 0?function(Qn){return"+ ".concat(Qn.length," ...")}:On,Mi=de.tagRender,_i=de.onToggleOpen,tr=de.onRemove,pr=de.onInputChange,br=de.onInputPaste,Or=de.onInputKeyDown,Ir=de.onInputMouseDown,fn=de.onInputCompositionStart,ho=de.onInputCompositionEnd,pn=de.onInputBlur,Hi=jt.useRef(null),Kr=(0,jt.useState)(0),ji=(0,he.Z)(Kr,2),xo=ji[0],Yr=ji[1],Cr=(0,jt.useState)(!1),Po=(0,he.Z)(Cr,2),je=Po[0],Pn=Po[1],be="".concat(Mn,"-selection"),At=$e||ei==="multiple"&&_n===!1||ei==="tags"?bn:"",Zn=ei==="tags"||ei==="multiple"&&_n===!1||Ii&&($e||je);dn(function(){Yr(Hi.current.scrollWidth)},[At]);var Jn=function(Dn,Xn,Oi,mi,ii){return jt.createElement("span",{title:Gn(Dn),className:se()("".concat(be,"-item"),(0,ue.Z)({},"".concat(be,"-item-disabled"),Oi))},jt.createElement("span",{className:"".concat(be,"-item-content")},Xn),mi&&jt.createElement(ht,{className:"".concat(be,"-item-remove"),onMouseDown:sn,onClick:ii,customizeIcon:yr},"\xD7"))},Ci=function(Dn,Xn,Oi,mi,ii,on){var ki=function(Tr){sn(Tr),_i(!$e)};return jt.createElement("span",{onMouseDown:ki},Mi({label:Xn,value:Dn,disabled:Oi,closable:mi,onClose:ii,isMaxTag:!!on}))},Si=function(Dn){var Xn=Dn.disabled,Oi=Dn.label,mi=Dn.value,ii=!si&&!Xn,on=Oi;if(typeof rn=="number"&&(typeof Oi=="string"||typeof Oi=="number")){var ki=String(on);ki.length>rn&&(on="".concat(ki.slice(0,rn),"..."))}var Ui=function(hr){hr&&hr.stopPropagation(),tr(Dn)};return typeof Mi=="function"?Ci(mi,on,Xn,ii,Ui):Jn(Dn,on,Xn,ii,Ui)},li=function(Dn){if(!Ie.length)return null;var Xn=typeof bi=="function"?bi(Dn):bi;return typeof Mi=="function"?Ci(void 0,Xn,!1,!1,void 0,!0):Jn({title:Xn},Xn,!1)},mn=jt.createElement("div",{className:"".concat(be,"-search"),style:{width:xo},onFocus:function(){Pn(!0)},onBlur:function(){Pn(!1)}},jt.createElement(Qe,{ref:hi,open:$e,prefixCls:Mn,id:un,inputElement:null,disabled:si,autoFocus:Ti,autoComplete:Di,editable:Zn,activeDescendantId:We,value:At,onKeyDown:Or,onMouseDown:Ir,onChange:pr,onPaste:br,onCompositionStart:fn,onCompositionEnd:ho,onBlur:pn,tabIndex:gr,attrs:(0,Xt.Z)(de,!0)}),jt.createElement("span",{ref:Hi,className:"".concat(be,"-search-mirror"),"aria-hidden":!0},At,"\xA0")),Un=jt.createElement(Ht.Z,{prefixCls:"".concat(be,"-overflow"),data:Ie,renderItem:Si,renderRest:li,suffix:mn,itemKey:Oe,maxCount:$r});return jt.createElement("span",{className:"".concat(be,"-wrap")},Un,!Ie.length&&!At&&jt.createElement("span",{className:"".concat(be,"-placeholder")},Yn))},Vn=ln,Ae=function(de){var un=de.inputElement,Mn=de.prefixCls,Ie=de.id,$e=de.inputRef,bn=de.disabled,_n=de.autoFocus,hi=de.autoComplete,Yn=de.activeDescendantId,si=de.mode,ei=de.open,Ii=de.values,Ti=de.placeholder,Di=de.tabIndex,We=de.showSearch,gr=de.searchValue,yr=de.activeValue,$r=de.maxLength,rn=de.onInputKeyDown,On=de.onInputMouseDown,bi=de.onInputChange,Mi=de.onInputPaste,_i=de.onInputCompositionStart,tr=de.onInputCompositionEnd,pr=de.onInputBlur,br=de.title,Or=jt.useState(!1),Ir=(0,he.Z)(Or,2),fn=Ir[0],ho=Ir[1],pn=si==="combobox",Hi=pn||We,Kr=Ii[0],ji=gr||"";pn&&yr&&!fn&&(ji=yr),jt.useEffect(function(){pn&&ho(!1)},[pn,yr]);var xo=si!=="combobox"&&!ei&&!We?!1:!!ji,Yr=br===void 0?Gn(Kr):br,Cr=jt.useMemo(function(){return Kr?null:jt.createElement("span",{className:"".concat(Mn,"-selection-placeholder"),style:xo?{visibility:"hidden"}:void 0},Ti)},[Kr,xo,Ti,Mn]);return jt.createElement("span",{className:"".concat(Mn,"-selection-wrap")},jt.createElement("span",{className:"".concat(Mn,"-selection-search")},jt.createElement(Qe,{ref:$e,prefixCls:Mn,id:Ie,open:ei,inputElement:un,disabled:bn,autoFocus:_n,autoComplete:hi,editable:Hi,activeDescendantId:Yn,value:ji,onKeyDown:rn,onMouseDown:On,onChange:function(je){ho(!0),bi(je)},onPaste:Mi,onCompositionStart:_i,onCompositionEnd:tr,onBlur:pr,tabIndex:Di,attrs:(0,Xt.Z)(de,!0),maxLength:pn?$r:void 0})),!pn&&Kr?jt.createElement("span",{className:"".concat(Mn,"-selection-item"),title:Yr,style:xo?{visibility:"hidden"}:void 0},Kr.label):null,Cr)},yn=Ae,te=function(de,un){var Mn=(0,jt.useRef)(null),Ie=(0,jt.useRef)(!1),$e=de.prefixCls,bn=de.open,_n=de.mode,hi=de.showSearch,Yn=de.tokenWithEnter,si=de.disabled,ei=de.prefix,Ii=de.autoClearSearchValue,Ti=de.onSearch,Di=de.onSearchSubmit,We=de.onToggleOpen,gr=de.onInputKeyDown,yr=de.onInputBlur,$r=de.domRef;jt.useImperativeHandle(un,function(){return{focus:function(Yr){Mn.current.focus(Yr)},blur:function(){Mn.current.blur()}}});var rn=Et(0),On=(0,he.Z)(rn,2),bi=On[0],Mi=On[1],_i=function(Yr){var Cr=Yr.which,Po=Mn.current instanceof HTMLTextAreaElement;!Po&&bn&&(Cr===Ot.Z.UP||Cr===Ot.Z.DOWN)&&Yr.preventDefault(),gr&&gr(Yr),Cr===Ot.Z.ENTER&&_n==="tags"&&!Ie.current&&!bn&&(Di==null||Di(Yr.target.value)),!(Po&&!bn&&~[Ot.Z.UP,Ot.Z.DOWN,Ot.Z.LEFT,Ot.Z.RIGHT].indexOf(Cr))&&$t(Cr)&&We(!0)},tr=function(){Mi(!0)},pr=(0,jt.useRef)(null),br=function(Yr){Ti(Yr,!0,Ie.current)!==!1&&We(!0)},Or=function(){Ie.current=!0},Ir=function(Yr){Ie.current=!1,_n!=="combobox"&&br(Yr.target.value)},fn=function(Yr){var Cr=Yr.target.value;if(Yn&&pr.current&&/[\r\n]/.test(pr.current)){var Po=pr.current.replace(/[\r\n]+$/,"").replace(/\r\n/g," ").replace(/[\r\n]/g," ");Cr=Cr.replace(Po,pr.current)}pr.current=null,br(Cr)},ho=function(Yr){var Cr=Yr.clipboardData,Po=Cr==null?void 0:Cr.getData("text");pr.current=Po||""},pn=function(Yr){var Cr=Yr.target;if(Cr!==Mn.current){var Po=document.body.style.msTouchAction!==void 0;Po?setTimeout(function(){Mn.current.focus()}):Mn.current.focus()}},Hi=function(Yr){var Cr=bi();Yr.target!==Mn.current&&!Cr&&!(_n==="combobox"&&si)&&Yr.preventDefault(),(_n!=="combobox"&&(!hi||!Cr)||!bn)&&(bn&&Ii!==!1&&Ti("",!0,!1),We())},Kr={inputRef:Mn,onInputKeyDown:_i,onInputMouseDown:tr,onInputChange:fn,onInputPaste:ho,onInputCompositionStart:Or,onInputCompositionEnd:Ir,onInputBlur:yr},ji=_n==="multiple"||_n==="tags"?jt.createElement(Vn,(0,pt.Z)({},de,Kr)):jt.createElement(yn,(0,pt.Z)({},de,Kr));return jt.createElement("div",{ref:$r,className:"".concat($e,"-selector"),onClick:pn,onMouseDown:Hi},ei&&jt.createElement("div",{className:"".concat($e,"-prefix")},ei),ji)},En=jt.forwardRef(te),ri=En,Rt=kt(65352),Lt=["prefixCls","disabled","visible","children","popupElement","animation","transitionName","dropdownStyle","dropdownClassName","direction","placement","builtinPlacements","dropdownMatchSelectWidth","dropdownRender","dropdownAlign","getPopupContainer","empty","getTriggerDOMNode","onPopupVisibleChange","onPopupMouseEnter"],Pt=function(de){var un=de===!0?0:1;return{bottomLeft:{points:["tl","bl"],offset:[0,4],overflow:{adjustX:un,adjustY:1},htmlRegion:"scroll"},bottomRight:{points:["tr","br"],offset:[0,4],overflow:{adjustX:un,adjustY:1},htmlRegion:"scroll"},topLeft:{points:["bl","tl"],offset:[0,-4],overflow:{adjustX:un,adjustY:1},htmlRegion:"scroll"},topRight:{points:["br","tr"],offset:[0,-4],overflow:{adjustX:un,adjustY:1},htmlRegion:"scroll"}}},Nt=function(de,un){var Mn=de.prefixCls,Ie=de.disabled,$e=de.visible,bn=de.children,_n=de.popupElement,hi=de.animation,Yn=de.transitionName,si=de.dropdownStyle,ei=de.dropdownClassName,Ii=de.direction,Ti=Ii===void 0?"ltr":Ii,Di=de.placement,We=de.builtinPlacements,gr=de.dropdownMatchSelectWidth,yr=de.dropdownRender,$r=de.dropdownAlign,rn=de.getPopupContainer,On=de.empty,bi=de.getTriggerDOMNode,Mi=de.onPopupVisibleChange,_i=de.onPopupMouseEnter,tr=(0,Dt.Z)(de,Lt),pr="".concat(Mn,"-dropdown"),br=_n;yr&&(br=yr(_n));var Or=jt.useMemo(function(){return We||Pt(gr)},[We,gr]),Ir=hi?"".concat(pr,"-").concat(hi):Yn,fn=typeof gr=="number",ho=jt.useMemo(function(){return fn?null:gr===!1?"minWidth":"width"},[gr,fn]),pn=si;fn&&(pn=(0,Le.Z)((0,Le.Z)({},pn),{},{width:gr}));var Hi=jt.useRef(null);return jt.useImperativeHandle(un,function(){return{getPopupElement:function(){var ji;return(ji=Hi.current)===null||ji===void 0?void 0:ji.popupElement}}}),jt.createElement(Rt.Z,(0,pt.Z)({},tr,{showAction:Mi?["click"]:[],hideAction:Mi?["click"]:[],popupPlacement:Di||(Ti==="rtl"?"bottomRight":"bottomLeft"),builtinPlacements:Or,prefixCls:pr,popupTransitionName:Ir,popup:jt.createElement("div",{onMouseEnter:_i},br),ref:Hi,stretch:ho,popupAlign:$r,popupVisible:$e,getPopupContainer:rn,popupClassName:se()(ei,(0,ue.Z)({},"".concat(pr,"-empty"),On)),popupStyle:pn,getTriggerDOMNode:bi,onPopupVisibleChange:Mi}),bn)},Zt=jt.forwardRef(Nt),Mt=Zt,Yt=kt(74604);function Ge(Gt,de){var un=Gt.key,Mn;return"value"in Gt&&(Mn=Gt.value),un!=null?un:Mn!==void 0?Mn:"rc-index-key-".concat(de)}function De(Gt){return typeof Gt!="undefined"&&!Number.isNaN(Gt)}function Ue(Gt,de){var un=Gt||{},Mn=un.label,Ie=un.value,$e=un.options,bn=un.groupLabel,_n=Mn||(de?"children":"label");return{label:_n,value:Ie||"value",options:$e||"options",groupLabel:bn||_n}}function we(Gt){var de=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},un=de.fieldNames,Mn=de.childrenAsData,Ie=[],$e=Ue(un,!1),bn=$e.label,_n=$e.value,hi=$e.options,Yn=$e.groupLabel;function si(ei,Ii){Array.isArray(ei)&&ei.forEach(function(Ti){if(Ii||!(hi in Ti)){var Di=Ti[_n];Ie.push({key:Ge(Ti,Ie.length),groupOption:Ii,data:Ti,label:Ti[bn],value:Di})}else{var We=Ti[Yn];We===void 0&&Mn&&(We=Ti.label),Ie.push({key:Ge(Ti,Ie.length),group:!0,data:Ti,label:We}),si(Ti[hi],!0)}})}return si(Gt,!1),Ie}function Ee(Gt){var de=(0,Le.Z)({},Gt);return"props"in de||Object.defineProperty(de,"props",{get:function(){return(0,ne.ZP)(!1,"Return type is option instead of Option instance. Please read value directly instead of reading from `props`."),de}}),de}var Fe=function(de,un,Mn){if(!un||!un.length)return null;var Ie=!1,$e=function _n(hi,Yn){var si=(0,Yt.Z)(Yn),ei=si[0],Ii=si.slice(1);if(!ei)return[hi];var Ti=hi.split(ei);return Ie=Ie||Ti.length>1,Ti.reduce(function(Di,We){return[].concat((0,Ut.Z)(Di),(0,Ut.Z)(_n(We,Ii)))},[]).filter(Boolean)},bn=$e(de,un);return Ie?typeof Mn!="undefined"?bn.slice(0,Mn):bn:null},He=jt.createContext(null),qe=He;function cn(Gt){var de=Gt.visible,un=Gt.values;if(!de)return null;var Mn=50;return jt.createElement("span",{"aria-live":"polite",style:{width:0,height:0,position:"absolute",overflow:"hidden",opacity:0}},"".concat(un.slice(0,Mn).map(function(Ie){var $e=Ie.label,bn=Ie.value;return["number","string"].includes((0,qt.Z)($e))?$e:bn}).join(", ")),un.length>Mn?", ...":null)}var gn=["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"],ni=["value","onChange","removeIcon","placeholder","autoFocus","maxTagCount","maxTagTextLength","maxTagPlaceholder","choiceTransitionName","onInputKeyDown","onPopupScroll","tabIndex"],ze=function(de){return de==="tags"||de==="multiple"},Ve=jt.forwardRef(function(Gt,de){var un,Mn=Gt.id,Ie=Gt.prefixCls,$e=Gt.className,bn=Gt.showSearch,_n=Gt.tagRender,hi=Gt.direction,Yn=Gt.omitDomProps,si=Gt.displayValues,ei=Gt.onDisplayValuesChange,Ii=Gt.emptyOptions,Ti=Gt.notFoundContent,Di=Ti===void 0?"Not Found":Ti,We=Gt.onClear,gr=Gt.mode,yr=Gt.disabled,$r=Gt.loading,rn=Gt.getInputElement,On=Gt.getRawInputElement,bi=Gt.open,Mi=Gt.defaultOpen,_i=Gt.onDropdownVisibleChange,tr=Gt.activeValue,pr=Gt.onActiveValueChange,br=Gt.activeDescendantId,Or=Gt.searchValue,Ir=Gt.autoClearSearchValue,fn=Gt.onSearch,ho=Gt.onSearchSplit,pn=Gt.tokenSeparators,Hi=Gt.allowClear,Kr=Gt.prefix,ji=Gt.suffixIcon,xo=Gt.clearIcon,Yr=Gt.OptionList,Cr=Gt.animation,Po=Gt.transitionName,je=Gt.dropdownStyle,Pn=Gt.dropdownClassName,be=Gt.dropdownMatchSelectWidth,At=Gt.dropdownRender,Zn=Gt.dropdownAlign,Jn=Gt.placement,Ci=Gt.builtinPlacements,Si=Gt.getPopupContainer,li=Gt.showAction,mn=li===void 0?[]:li,Un=Gt.onFocus,Qn=Gt.onBlur,Dn=Gt.onKeyUp,Xn=Gt.onKeyDown,Oi=Gt.onMouseDown,mi=(0,Dt.Z)(Gt,gn),ii=ze(gr),on=(bn!==void 0?bn:ii)||gr==="combobox",ki=(0,Le.Z)({},mi);ni.forEach(function(wo){delete ki[wo]}),Yn==null||Yn.forEach(function(wo){delete ki[wo]});var Ui=jt.useState(!1),Tr=(0,he.Z)(Ui,2),hr=Tr[0],ao=Tr[1];jt.useEffect(function(){ao((0,Bt.Z)())},[]);var eo=jt.useRef(null),qr=jt.useRef(null),co=jt.useRef(null),uo=jt.useRef(null),bo=jt.useRef(null),Be=jt.useRef(!1),so=St(),Jr=(0,he.Z)(so,3),fr=Jr[0],Hr=Jr[1],Er=Jr[2];jt.useImperativeHandle(de,function(){var wo,Do;return{focus:(wo=uo.current)===null||wo===void 0?void 0:wo.focus,blur:(Do=uo.current)===null||Do===void 0?void 0:Do.blur,scrollTo:function(ae){var Re;return(Re=bo.current)===null||Re===void 0?void 0:Re.scrollTo(ae)},nativeElement:eo.current||qr.current}});var Fo=jt.useMemo(function(){var wo;if(gr!=="combobox")return Or;var Do=(wo=si[0])===null||wo===void 0?void 0:wo.value;return typeof Do=="string"||typeof Do=="number"?String(Do):""},[Or,gr,si]),Lo=gr==="combobox"&&typeof rn=="function"&&rn()||null,Rr=typeof On=="function"&&On(),jr=(0,nt.x1)(qr,Rr==null||(un=Rr.props)===null||un===void 0?void 0:un.ref),Za=jt.useState(!1),aa=(0,he.Z)(Za,2),As=aa[0],Na=aa[1];(0,Ce.Z)(function(){Na(!0)},[]);var nr=(0,me.Z)(!1,{defaultValue:Mi,value:bi}),qo=(0,he.Z)(nr,2),ta=qo[0],ga=qo[1],oa=As?ta:!1,pa=!Di&&Ii;(yr||pa&&oa&&gr==="combobox")&&(oa=!1);var fi=pa?!1:oa,ar=jt.useCallback(function(wo){var Do=wo!==void 0?wo:!oa;yr||(ga(Do),oa!==Do&&(_i==null||_i(Do)))},[yr,oa,ga,_i]),_r=jt.useMemo(function(){return(pn||[]).some(function(wo){return[`
|
|
`,`\r
|
|
`].includes(wo)})},[pn]),to=jt.useContext(qe)||{},fo=to.maxCount,zo=to.rawValues,lr=function(Do,Aa,ae){if(!(ii&&De(fo)&&(zo==null?void 0:zo.size)>=fo)){var Re=!0,_t=Do;pr==null||pr(null);var fe=Fe(Do,pn,De(fo)?fo-zo.size:void 0),zr=ae?null:fe;return gr!=="combobox"&&zr&&(_t="",ho==null||ho(zr),ar(!1),Re=!1),fn&&Fo!==_t&&fn(_t,{source:Aa?"typing":"effect"}),Re}},Xa=function(Do){!Do||!Do.trim()||fn(Do,{source:"submit"})};jt.useEffect(function(){!oa&&!ii&&gr!=="combobox"&&lr("",!1,!1)},[oa]),jt.useEffect(function(){ta&&yr&&ga(!1),yr&&!Be.current&&Hr(!1)},[yr]);var fa=Et(),Uo=(0,he.Z)(fa,2),lo=Uo[0],Pa=Uo[1],is=jt.useRef(!1),Qo=function(Do){var Aa=lo(),ae=Do.key,Re=ae==="Enter";if(Re&&(gr!=="combobox"&&Do.preventDefault(),oa||ar(!0)),Pa(!!Fo),ae==="Backspace"&&!Aa&&ii&&!Fo&&si.length){for(var _t=(0,Ut.Z)(si),fe=null,zr=_t.length-1;zr>=0;zr-=1){var mr=_t[zr];if(!mr.disabled){_t.splice(zr,1),fe=mr;break}}fe&&ei(_t,{type:"remove",values:[fe]})}for(var Fr=arguments.length,sr=new Array(Fr>1?Fr-1:0),Pr=1;Pr<Fr;Pr++)sr[Pr-1]=arguments[Pr];if(oa&&(!Re||!is.current)){var po;Re&&(is.current=!0),(po=bo.current)===null||po===void 0||po.onKeyDown.apply(po,[Do].concat(sr))}Xn==null||Xn.apply(void 0,[Do].concat(sr))},ps=function(Do){for(var Aa=arguments.length,ae=new Array(Aa>1?Aa-1:0),Re=1;Re<Aa;Re++)ae[Re-1]=arguments[Re];if(oa){var _t;(_t=bo.current)===null||_t===void 0||_t.onKeyUp.apply(_t,[Do].concat(ae))}Do.key==="Enter"&&(is.current=!1),Dn==null||Dn.apply(void 0,[Do].concat(ae))},ms=function(Do){var Aa=si.filter(function(ae){return ae!==Do});ei(Aa,{type:"remove",values:[Do]})},zs=function(){is.current=!1},Fa=jt.useRef(!1),Ru=function(){Hr(!0),yr||(Un&&!Fa.current&&Un.apply(void 0,arguments),mn.includes("focus")&&ar(!0)),Fa.current=!0},Lu=function(){Be.current=!0,Hr(!1,function(){Fa.current=!1,Be.current=!1,ar(!1)}),!yr&&(Fo&&(gr==="tags"?fn(Fo,{source:"submit"}):gr==="multiple"&&fn("",{source:"blur"})),Qn&&Qn.apply(void 0,arguments))},Zs=[];jt.useEffect(function(){return function(){Zs.forEach(function(wo){return clearTimeout(wo)}),Zs.splice(0,Zs.length)}},[]);var Al=function(Do){var Aa,ae=Do.target,Re=(Aa=co.current)===null||Aa===void 0?void 0:Aa.getPopupElement();if(Re&&Re.contains(ae)){var _t=setTimeout(function(){var Fr=Zs.indexOf(_t);if(Fr!==-1&&Zs.splice(Fr,1),Er(),!hr&&!Re.contains(document.activeElement)){var sr;(sr=uo.current)===null||sr===void 0||sr.focus()}});Zs.push(_t)}for(var fe=arguments.length,zr=new Array(fe>1?fe-1:0),mr=1;mr<fe;mr++)zr[mr-1]=arguments[mr];Oi==null||Oi.apply(void 0,[Do].concat(zr))},Gs=jt.useState({}),Ul=(0,he.Z)(Gs,2),hu=Ul[1];function Fu(){hu({})}var wa;Rr&&(wa=function(Do){ar(Do)}),Tt(function(){var wo;return[eo.current,(wo=co.current)===null||wo===void 0?void 0:wo.getPopupElement()]},fi,ar,!!Rr);var sl=jt.useMemo(function(){return(0,Le.Z)((0,Le.Z)({},Gt),{},{notFoundContent:Di,open:oa,triggerOpen:fi,id:Mn,showSearch:on,multiple:ii,toggleOpen:ar})},[Gt,Di,fi,oa,Mn,on,ii,ar]),ju=!!ji||$r,Yl;ju&&(Yl=jt.createElement(ht,{className:se()("".concat(Ie,"-arrow"),(0,ue.Z)({},"".concat(Ie,"-arrow-loading"),$r)),customizeIcon:ji,customizeIconProps:{loading:$r,searchValue:Fo,open:oa,focused:fr,showSearch:on}}));var du=function(){var Do;We==null||We(),(Do=uo.current)===null||Do===void 0||Do.focus(),ei([],{type:"clear",values:si}),lr("",!1,!1)},Ja=st(Ie,du,si,Hi,xo,yr,Fo,gr),Qa=Ja.allowClear,Ba=Ja.clearIcon,Ga=jt.createElement(Yr,{ref:bo}),Tl=se()(Ie,$e,(0,ue.Z)((0,ue.Z)((0,ue.Z)((0,ue.Z)((0,ue.Z)((0,ue.Z)((0,ue.Z)((0,ue.Z)((0,ue.Z)((0,ue.Z)({},"".concat(Ie,"-focused"),fr),"".concat(Ie,"-multiple"),ii),"".concat(Ie,"-single"),!ii),"".concat(Ie,"-allow-clear"),Hi),"".concat(Ie,"-show-arrow"),ju),"".concat(Ie,"-disabled"),yr),"".concat(Ie,"-loading"),$r),"".concat(Ie,"-open"),oa),"".concat(Ie,"-customize-input"),Lo),"".concat(Ie,"-show-search"),on)),ma=jt.createElement(Mt,{ref:co,disabled:yr,prefixCls:Ie,visible:fi,popupElement:Ga,animation:Cr,transitionName:Po,dropdownStyle:je,dropdownClassName:Pn,direction:hi,dropdownMatchSelectWidth:be,dropdownRender:At,dropdownAlign:Zn,placement:Jn,builtinPlacements:Ci,getPopupContainer:Si,empty:Ii,getTriggerDOMNode:function(Do){return qr.current||Do},onPopupVisibleChange:wa,onPopupMouseEnter:Fu},Rr?jt.cloneElement(Rr,{ref:jr}):jt.createElement(ri,(0,pt.Z)({},Gt,{domRef:qr,prefixCls:Ie,inputElement:Lo,ref:uo,id:Mn,prefix:Kr,showSearch:on,autoClearSearchValue:Ir,mode:gr,activeDescendantId:br,tagRender:_n,values:si,open:oa,onToggleOpen:ar,activeValue:tr,searchValue:Fo,onSearch:lr,onSearchSubmit:Xa,onRemove:ms,tokenWithEnter:_r,onInputBlur:zs}))),Ro;return Rr?Ro=ma:Ro=jt.createElement("div",(0,pt.Z)({className:Tl},ki,{ref:eo,onMouseDown:Al,onKeyDown:Qo,onKeyUp:ps,onFocus:Ru,onBlur:Lu}),jt.createElement(cn,{visible:fr&&!oa,values:si}),ma,Yl,Qa&&Ba),jt.createElement(gt.Provider,{value:sl},Ro)}),nn=Ve,qn=function(){return null};qn.isSelectOptGroup=!0;var vn=qn,tn=function(){return null};tn.isSelectOption=!0;var Rn=tn,gi=kt(80547),ti=kt(2738),vi=kt(65283);function Gi(){return/(mac\sos|macintosh)/i.test(navigator.appVersion)}var Fn=["disabled","title","children","style","className"];function xn(Gt){return typeof Gt=="string"||typeof Gt=="number"}var Tn=function(de,un){var Mn=vt(),Ie=Mn.prefixCls,$e=Mn.id,bn=Mn.open,_n=Mn.multiple,hi=Mn.mode,Yn=Mn.searchValue,si=Mn.toggleOpen,ei=Mn.notFoundContent,Ii=Mn.onPopupScroll,Ti=jt.useContext(qe),Di=Ti.maxCount,We=Ti.flattenOptions,gr=Ti.onActiveValue,yr=Ti.defaultActiveFirstOption,$r=Ti.onSelect,rn=Ti.menuItemSelectedIcon,On=Ti.rawValues,bi=Ti.fieldNames,Mi=Ti.virtual,_i=Ti.direction,tr=Ti.listHeight,pr=Ti.listItemHeight,br=Ti.optionRender,Or="".concat(Ie,"-item"),Ir=(0,gi.Z)(function(){return We},[bn,We],function(li,mn){return mn[0]&&li[1]!==mn[1]}),fn=jt.useRef(null),ho=jt.useMemo(function(){return _n&&De(Di)&&(On==null?void 0:On.size)>=Di},[_n,Di,On==null?void 0:On.size]),pn=function(mn){mn.preventDefault()},Hi=function(mn){var Un;(Un=fn.current)===null||Un===void 0||Un.scrollTo(typeof mn=="number"?{index:mn}:mn)},Kr=jt.useCallback(function(li){return hi==="combobox"?!1:On.has(li)},[hi,(0,Ut.Z)(On).toString(),On.size]),ji=function(mn){for(var Un=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,Qn=Ir.length,Dn=0;Dn<Qn;Dn+=1){var Xn=(mn+Dn*Un+Qn)%Qn,Oi=Ir[Xn]||{},mi=Oi.group,ii=Oi.data;if(!mi&&!(ii!=null&&ii.disabled)&&(Kr(ii.value)||!ho))return Xn}return-1},xo=jt.useState(function(){return ji(0)}),Yr=(0,he.Z)(xo,2),Cr=Yr[0],Po=Yr[1],je=function(mn){var Un=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;Po(mn);var Qn={source:Un?"keyboard":"mouse"},Dn=Ir[mn];if(!Dn){gr(null,-1,Qn);return}gr(Dn.value,mn,Qn)};(0,jt.useEffect)(function(){je(yr!==!1?ji(0):-1)},[Ir.length,Yn]);var Pn=jt.useCallback(function(li){return hi==="combobox"?String(li).toLowerCase()===Yn.toLowerCase():On.has(li)},[hi,Yn,(0,Ut.Z)(On).toString(),On.size]);(0,jt.useEffect)(function(){var li=setTimeout(function(){if(!_n&&bn&&On.size===1){var Un=Array.from(On)[0],Qn=Ir.findIndex(function(Dn){var Xn=Dn.data;return Yn?String(Xn.value).startsWith(Yn):Xn.value===Un});Qn!==-1&&(je(Qn),Hi(Qn))}});if(bn){var mn;(mn=fn.current)===null||mn===void 0||mn.scrollTo(void 0)}return function(){return clearTimeout(li)}},[bn,Yn]);var be=function(mn){mn!==void 0&&$r(mn,{selected:!On.has(mn)}),_n||si(!1)};if(jt.useImperativeHandle(un,function(){return{onKeyDown:function(mn){var Un=mn.which,Qn=mn.ctrlKey;switch(Un){case Ot.Z.N:case Ot.Z.P:case Ot.Z.UP:case Ot.Z.DOWN:{var Dn=0;if(Un===Ot.Z.UP?Dn=-1:Un===Ot.Z.DOWN?Dn=1:Gi()&&Qn&&(Un===Ot.Z.N?Dn=1:Un===Ot.Z.P&&(Dn=-1)),Dn!==0){var Xn=ji(Cr+Dn,Dn);Hi(Xn),je(Xn,!0)}break}case Ot.Z.TAB:case Ot.Z.ENTER:{var Oi,mi=Ir[Cr];mi&&!(mi!=null&&(Oi=mi.data)!==null&&Oi!==void 0&&Oi.disabled)&&!ho?be(mi.value):be(void 0),bn&&mn.preventDefault();break}case Ot.Z.ESC:si(!1),bn&&mn.stopPropagation()}},onKeyUp:function(){},scrollTo:function(mn){Hi(mn)}}}),Ir.length===0)return jt.createElement("div",{role:"listbox",id:"".concat($e,"_list"),className:"".concat(Or,"-empty"),onMouseDown:pn},ei);var At=Object.keys(bi).map(function(li){return bi[li]}),Zn=function(mn){return mn.label};function Jn(li,mn){var Un=li.group;return{role:Un?"presentation":"option",id:"".concat($e,"_list_").concat(mn)}}var Ci=function(mn){var Un=Ir[mn];if(!Un)return null;var Qn=Un.data||{},Dn=Qn.value,Xn=Un.group,Oi=(0,Xt.Z)(Qn,!0),mi=Zn(Un);return Un?jt.createElement("div",(0,pt.Z)({"aria-label":typeof mi=="string"&&!Xn?mi:null},Oi,{key:mn},Jn(Un,mn),{"aria-selected":Pn(Dn)}),Dn):null},Si={role:"listbox",id:"".concat($e,"_list")};return jt.createElement(jt.Fragment,null,Mi&&jt.createElement("div",(0,pt.Z)({},Si,{style:{height:0,width:0,overflow:"hidden"}}),Ci(Cr-1),Ci(Cr),Ci(Cr+1)),jt.createElement(vi.Z,{itemKey:"key",ref:fn,data:Ir,height:tr,itemHeight:pr,fullHeight:!1,onMouseDown:pn,onScroll:Ii,virtual:Mi,direction:_i,innerProps:Mi?null:Si},function(li,mn){var Un=li.group,Qn=li.groupOption,Dn=li.data,Xn=li.label,Oi=li.value,mi=Dn.key;if(Un){var ii,on=(ii=Dn.title)!==null&&ii!==void 0?ii:xn(Xn)?Xn.toString():void 0;return jt.createElement("div",{className:se()(Or,"".concat(Or,"-group"),Dn.className),title:on},Xn!==void 0?Xn:mi)}var ki=Dn.disabled,Ui=Dn.title,Tr=Dn.children,hr=Dn.style,ao=Dn.className,eo=(0,Dt.Z)(Dn,Fn),qr=(0,ti.Z)(eo,At),co=Kr(Oi),uo=ki||!co&&ho,bo="".concat(Or,"-option"),Be=se()(Or,bo,ao,(0,ue.Z)((0,ue.Z)((0,ue.Z)((0,ue.Z)({},"".concat(bo,"-grouped"),Qn),"".concat(bo,"-active"),Cr===mn&&!uo),"".concat(bo,"-disabled"),uo),"".concat(bo,"-selected"),co)),so=Zn(li),Jr=!rn||typeof rn=="function"||co,fr=typeof so=="number"?so:so||Oi,Hr=xn(fr)?fr.toString():void 0;return Ui!==void 0&&(Hr=Ui),jt.createElement("div",(0,pt.Z)({},(0,Xt.Z)(qr),Mi?{}:Jn(li,mn),{"aria-selected":Pn(Oi),className:Be,title:Hr,onMouseMove:function(){Cr===mn||uo||je(mn)},onClick:function(){uo||be(Oi)},style:hr}),jt.createElement("div",{className:"".concat(bo,"-content")},typeof br=="function"?br(li,{index:mn}):fr),jt.isValidElement(rn)||co,Jr&&jt.createElement(ht,{className:"".concat(Or,"-option-state"),customizeIcon:rn,customizeIconProps:{value:Oi,disabled:uo,isSelected:co}},co?"\u2713":null))}))},ai=jt.forwardRef(Tn),pi=ai,ui=function(Gt,de){var un=jt.useRef({values:new Map,options:new Map}),Mn=jt.useMemo(function(){var $e=un.current,bn=$e.values,_n=$e.options,hi=Gt.map(function(ei){if(ei.label===void 0){var Ii;return(0,Le.Z)((0,Le.Z)({},ei),{},{label:(Ii=bn.get(ei.value))===null||Ii===void 0?void 0:Ii.label})}return ei}),Yn=new Map,si=new Map;return hi.forEach(function(ei){Yn.set(ei.value,ei),si.set(ei.value,de.get(ei.value)||_n.get(ei.value))}),un.current.values=Yn,un.current.options=si,hi},[Gt,de]),Ie=jt.useCallback(function($e){return de.get($e)||un.current.options.get($e)},[de]);return[Mn,Ie]};function zi(Gt,de){return _e(Gt).join("").toUpperCase().includes(de)}var wt=function(Gt,de,un,Mn,Ie){return jt.useMemo(function(){if(!un||Mn===!1)return Gt;var $e=de.options,bn=de.label,_n=de.value,hi=[],Yn=typeof Mn=="function",si=un.toUpperCase(),ei=Yn?Mn:function(Ti,Di){return Ie?zi(Di[Ie],si):Di[$e]?zi(Di[bn!=="children"?bn:"label"],si):zi(Di[_n],si)},Ii=Yn?function(Ti){return Ee(Ti)}:function(Ti){return Ti};return Gt.forEach(function(Ti){if(Ti[$e]){var Di=ei(un,Ii(Ti));if(Di)hi.push(Ti);else{var We=Ti[$e].filter(function(gr){return ei(un,Ii(gr))});We.length&&hi.push((0,Le.Z)((0,Le.Z)({},Ti),{},(0,ue.Z)({},$e,We)))}return}ei(un,Ii(Ti))&&hi.push(Ti)}),hi},[Gt,Mn,Ie,un,de])},Xe=kt(6551),Hn=kt(11592),Ai=["children","value"],Vi=["children"];function dr(Gt){var de=Gt,un=de.key,Mn=de.props,Ie=Mn.children,$e=Mn.value,bn=(0,Dt.Z)(Mn,Ai);return(0,Le.Z)({key:un,value:$e!==void 0?$e:un,children:Ie},bn)}function kr(Gt){var de=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return(0,Hn.Z)(Gt).map(function(un,Mn){if(!jt.isValidElement(un)||!un.type)return null;var Ie=un,$e=Ie.type.isSelectOptGroup,bn=Ie.key,_n=Ie.props,hi=_n.children,Yn=(0,Dt.Z)(_n,Vi);return de||!$e?dr(un):(0,Le.Z)((0,Le.Z)({key:"__RC_SELECT_GRP__".concat(bn===null?Mn:bn,"__"),label:bn},Yn),{},{options:kr(hi)})}).filter(function(un){return un})}var ci=function(de,un,Mn,Ie,$e){return jt.useMemo(function(){var bn=de,_n=!de;_n&&(bn=kr(un));var hi=new Map,Yn=new Map,si=function(Ti,Di,We){We&&typeof We=="string"&&Ti.set(Di[We],Di)},ei=function Ii(Ti){for(var Di=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,We=0;We<Ti.length;We+=1){var gr=Ti[We];!gr[Mn.options]||Di?(hi.set(gr[Mn.value],gr),si(Yn,gr,Mn.label),si(Yn,gr,Ie),si(Yn,gr,$e)):Ii(gr[Mn.options],!0)}};return ei(bn),{options:bn,valueOptions:hi,labelOptions:Yn}},[de,un,Mn,Ie,$e])},In=ci;function pe(Gt){var de=jt.useRef();de.current=Gt;var un=jt.useCallback(function(){return de.current.apply(de,arguments)},[]);return un}function Se(Gt){var de=Gt.mode,un=Gt.options,Mn=Gt.children,Ie=Gt.backfill,$e=Gt.allowClear,bn=Gt.placeholder,_n=Gt.getInputElement,hi=Gt.showSearch,Yn=Gt.onSearch,si=Gt.defaultOpen,ei=Gt.autoFocus,Ii=Gt.labelInValue,Ti=Gt.value,Di=Gt.inputValue,We=Gt.optionLabelProp,gr=isMultiple(de),yr=hi!==void 0?hi:gr||de==="combobox",$r=un||convertChildrenToData(Mn);if(warning(de!=="tags"||$r.every(function(Mi){return!Mi.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),de==="tags"||de==="combobox"){var rn=$r.some(function(Mi){return Mi.options?Mi.options.some(function(_i){return typeof("value"in _i?_i.value:_i.key)=="number"}):typeof("value"in Mi?Mi.value:Mi.key)=="number"});warning(!rn,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(warning(de!=="combobox"||!We,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),warning(de==="combobox"||!Ie,"`backfill` only works with `combobox` mode."),warning(de==="combobox"||!_n,"`getInputElement` only work with `combobox` mode."),noteOnce(de!=="combobox"||!_n||!$e||!bn,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),Yn&&!yr&&de!=="combobox"&&de!=="tags"&&warning(!1,"`onSearch` should work with `showSearch` instead of use alone."),noteOnce(!si||ei,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),Ti!=null){var On=toArray(Ti);warning(!Ii||On.every(function(Mi){return _typeof(Mi)==="object"&&("key"in Mi||"value"in Mi)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),warning(!gr||Array.isArray(Ti),"`value` should be array when `mode` is `multiple` or `tags`")}if(Mn){var bi=null;toNodeArray(Mn).some(function(Mi){if(!React.isValidElement(Mi)||!Mi.type)return!1;var _i=Mi,tr=_i.type;if(tr.isSelectOption)return!1;if(tr.isSelectOptGroup){var pr=toNodeArray(Mi.props.children).every(function(br){return!React.isValidElement(br)||!Mi.type||br.type.isSelectOption?!0:(bi=br.type,!1)});return!pr}return bi=tr,!0}),bi&&warning(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(bi.displayName||bi.name||bi,"`.")),warning(Di===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}function ye(Gt,de){if(Gt){var un=function Mn(Ie){for(var $e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,bn=0;bn<Ie.length;bn++){var _n=Ie[bn];if(_n[de==null?void 0:de.value]===null)return warning(!1,"`value` in Select options should not be `null`."),!0;if(!$e&&Array.isArray(_n[de==null?void 0:de.options])&&Mn(_n[de==null?void 0:de.options],!0))break}};un(Gt)}}var jn=null,Ln=["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"],Kn=["inputValue"];function Je(Gt){return!Gt||(0,qt.Z)(Gt)!=="object"}var An=jt.forwardRef(function(Gt,de){var un=Gt.id,Mn=Gt.mode,Ie=Gt.prefixCls,$e=Ie===void 0?"rc-select":Ie,bn=Gt.backfill,_n=Gt.fieldNames,hi=Gt.inputValue,Yn=Gt.searchValue,si=Gt.onSearch,ei=Gt.autoClearSearchValue,Ii=ei===void 0?!0:ei,Ti=Gt.onSelect,Di=Gt.onDeselect,We=Gt.dropdownMatchSelectWidth,gr=We===void 0?!0:We,yr=Gt.filterOption,$r=Gt.filterSort,rn=Gt.optionFilterProp,On=Gt.optionLabelProp,bi=Gt.options,Mi=Gt.optionRender,_i=Gt.children,tr=Gt.defaultActiveFirstOption,pr=Gt.menuItemSelectedIcon,br=Gt.virtual,Or=Gt.direction,Ir=Gt.listHeight,fn=Ir===void 0?200:Ir,ho=Gt.listItemHeight,pn=ho===void 0?20:ho,Hi=Gt.labelRender,Kr=Gt.value,ji=Gt.defaultValue,xo=Gt.labelInValue,Yr=Gt.onChange,Cr=Gt.maxCount,Po=(0,Dt.Z)(Gt,Ln),je=(0,Xe.ZP)(un),Pn=ze(Mn),be=!!(!bi&&_i),At=jt.useMemo(function(){return yr===void 0&&Mn==="combobox"?!1:yr},[yr,Mn]),Zn=jt.useMemo(function(){return Ue(_n,be)},[JSON.stringify(_n),be]),Jn=(0,me.Z)("",{value:Yn!==void 0?Yn:hi,postState:function(_r){return _r||""}}),Ci=(0,he.Z)(Jn,2),Si=Ci[0],li=Ci[1],mn=In(bi,_i,Zn,rn,On),Un=mn.valueOptions,Qn=mn.labelOptions,Dn=mn.options,Xn=jt.useCallback(function(ar){var _r=_e(ar);return _r.map(function(to){var fo,zo,lr,Xa,fa;if(Je(to))fo=to;else{var Uo;lr=to.key,zo=to.label,fo=(Uo=to.value)!==null&&Uo!==void 0?Uo:lr}var lo=Un.get(fo);if(lo){var Pa;if(zo===void 0&&(zo=lo==null?void 0:lo[On||Zn.label]),lr===void 0&&(lr=(Pa=lo==null?void 0:lo.key)!==null&&Pa!==void 0?Pa:fo),Xa=lo==null?void 0:lo.disabled,fa=lo==null?void 0:lo.title,0)var is}return{label:zo,value:fo,key:lr,disabled:Xa,title:fa}})},[Zn,On,Un]),Oi=(0,me.Z)(ji,{value:Kr}),mi=(0,he.Z)(Oi,2),ii=mi[0],on=mi[1],ki=jt.useMemo(function(){var ar,_r=Pn&&ii===null?[]:ii,to=Xn(_r);return Mn==="combobox"&&Jt((ar=to[0])===null||ar===void 0?void 0:ar.value)?[]:to},[ii,Xn,Mn,Pn]),Ui=ui(ki,Un),Tr=(0,he.Z)(Ui,2),hr=Tr[0],ao=Tr[1],eo=jt.useMemo(function(){if(!Mn&&hr.length===1){var ar=hr[0];if(ar.value===null&&(ar.label===null||ar.label===void 0))return[]}return hr.map(function(_r){var to;return(0,Le.Z)((0,Le.Z)({},_r),{},{label:(to=typeof Hi=="function"?Hi(_r):_r.label)!==null&&to!==void 0?to:_r.value})})},[Mn,hr,Hi]),qr=jt.useMemo(function(){return new Set(hr.map(function(ar){return ar.value}))},[hr]);jt.useEffect(function(){if(Mn==="combobox"){var ar,_r=(ar=hr[0])===null||ar===void 0?void 0:ar.value;li(re(_r)?String(_r):"")}},[hr]);var co=pe(function(ar,_r){var to=_r!=null?_r:ar;return(0,ue.Z)((0,ue.Z)({},Zn.value,ar),Zn.label,to)}),uo=jt.useMemo(function(){if(Mn!=="tags")return Dn;var ar=(0,Ut.Z)(Dn),_r=function(fo){return Un.has(fo)};return(0,Ut.Z)(hr).sort(function(to,fo){return to.value<fo.value?-1:1}).forEach(function(to){var fo=to.value;_r(fo)||ar.push(co(fo,to.label))}),ar},[co,Dn,Un,hr,Mn]),bo=wt(uo,Zn,Si,At,rn),Be=jt.useMemo(function(){return Mn!=="tags"||!Si||bo.some(function(ar){return ar[rn||"value"]===Si})||bo.some(function(ar){return ar[Zn.value]===Si})?bo:[co(Si)].concat((0,Ut.Z)(bo))},[co,rn,Mn,bo,Si,Zn]),so=function ar(_r){var to=(0,Ut.Z)(_r).sort(function(fo,zo){return $r(fo,zo,{searchValue:Si})});return to.map(function(fo){return Array.isArray(fo.options)?(0,Le.Z)((0,Le.Z)({},fo),{},{options:fo.options.length>0?ar(fo.options):fo.options}):fo})},Jr=jt.useMemo(function(){return $r?so(Be):Be},[Be,$r,Si]),fr=jt.useMemo(function(){return we(Jr,{fieldNames:Zn,childrenAsData:be})},[Jr,Zn,be]),Hr=function(_r){var to=Xn(_r);if(on(to),Yr&&(to.length!==hr.length||to.some(function(lr,Xa){var fa;return((fa=hr[Xa])===null||fa===void 0?void 0:fa.value)!==(lr==null?void 0:lr.value)}))){var fo=xo?to:to.map(function(lr){return lr.value}),zo=to.map(function(lr){return Ee(ao(lr.value))});Yr(Pn?fo:fo[0],Pn?zo:zo[0])}},Er=jt.useState(null),Fo=(0,he.Z)(Er,2),Lo=Fo[0],Rr=Fo[1],jr=jt.useState(0),Za=(0,he.Z)(jr,2),aa=Za[0],As=Za[1],Na=tr!==void 0?tr:Mn!=="combobox",nr=jt.useCallback(function(ar,_r){var to=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},fo=to.source,zo=fo===void 0?"keyboard":fo;As(_r),bn&&Mn==="combobox"&&ar!==null&&zo==="keyboard"&&Rr(String(ar))},[bn,Mn]),qo=function(_r,to,fo){var zo=function(){var ms,zs=ao(_r);return[xo?{label:zs==null?void 0:zs[Zn.label],value:_r,key:(ms=zs==null?void 0:zs.key)!==null&&ms!==void 0?ms:_r}:_r,Ee(zs)]};if(to&&Ti){var lr=zo(),Xa=(0,he.Z)(lr,2),fa=Xa[0],Uo=Xa[1];Ti(fa,Uo)}else if(!to&&Di&&fo!=="clear"){var lo=zo(),Pa=(0,he.Z)(lo,2),is=Pa[0],Qo=Pa[1];Di(is,Qo)}},ta=pe(function(ar,_r){var to,fo=Pn?_r.selected:!0;fo?to=Pn?[].concat((0,Ut.Z)(hr),[ar]):[ar]:to=hr.filter(function(zo){return zo.value!==ar}),Hr(to),qo(ar,fo),Mn==="combobox"?Rr(""):(!ze||Ii)&&(li(""),Rr(""))}),ga=function(_r,to){Hr(_r);var fo=to.type,zo=to.values;(fo==="remove"||fo==="clear")&&zo.forEach(function(lr){qo(lr.value,!1,fo)})},oa=function(_r,to){if(li(_r),Rr(null),to.source==="submit"){var fo=(_r||"").trim();if(fo){var zo=Array.from(new Set([].concat((0,Ut.Z)(qr),[fo])));Hr(zo),qo(fo,!0),li("")}return}to.source!=="blur"&&(Mn==="combobox"&&Hr(_r),si==null||si(_r))},pa=function(_r){var to=_r;Mn!=="tags"&&(to=_r.map(function(zo){var lr=Qn.get(zo);return lr==null?void 0:lr.value}).filter(function(zo){return zo!==void 0}));var fo=Array.from(new Set([].concat((0,Ut.Z)(qr),(0,Ut.Z)(to))));Hr(fo),fo.forEach(function(zo){qo(zo,!0)})},fi=jt.useMemo(function(){var ar=br!==!1&&gr!==!1;return(0,Le.Z)((0,Le.Z)({},mn),{},{flattenOptions:fr,onActiveValue:nr,defaultActiveFirstOption:Na,onSelect:ta,menuItemSelectedIcon:pr,rawValues:qr,fieldNames:Zn,virtual:ar,direction:Or,listHeight:fn,listItemHeight:pn,childrenAsData:be,maxCount:Cr,optionRender:Mi})},[Cr,mn,fr,nr,Na,ta,pr,qr,Zn,br,gr,Or,fn,pn,be,Mi]);return jt.createElement(qe.Provider,{value:fi},jt.createElement(nn,(0,pt.Z)({},Po,{id:je,prefixCls:$e,ref:de,omitDomProps:Kn,mode:Mn,displayValues:eo,onDisplayValuesChange:ga,direction:Or,searchValue:Si,onSearch:oa,autoClearSearchValue:Ii,onSearchSplit:pa,dropdownMatchSelectWidth:gr,OptionList:pi,emptyOptions:!fr.length,activeValue:Lo,activeDescendantId:"".concat(je,"_list_").concat(aa)})))}),yi=An;yi.Option=Rn,yi.OptGroup=vn;var Ei=yi,Xi=Ei},63158:function(Bn,zn,kt){"use strict";var pt=kt(5016),Ut=kt(18082),ue=kt(52456),Le=kt(5883),he=kt(59301),Dt=kt(92310),qt=kt.n(Dt),me=kt(18929),ne=kt(10228),jt=["prefixCls","className","checked","defaultChecked","disabled","loadingIcon","checkedChildren","unCheckedChildren","onClick","onChange","onKeyDown"],Te=he.forwardRef(function(se,Ce){var Bt,nt=se.prefixCls,et=nt===void 0?"rc-switch":nt,ht=se.className,st=se.checked,gt=se.defaultChecked,vt=se.disabled,St=se.loadingIcon,Et=se.checkedChildren,Tt=se.unCheckedChildren,Ot=se.onClick,$t=se.onChange,Xt=se.onKeyDown,Ht=(0,Le.Z)(se,jt),ve=(0,me.Z)(!1,{value:st,defaultValue:gt}),ie=(0,ue.Z)(ve,2),Ne=ie[0],xe=ie[1];function Pe(Ke,re){var Jt=Ne;return vt||(Jt=Ke,xe(Jt),$t==null||$t(Jt,re)),Jt}function Qe(Ke){Ke.which===ne.Z.LEFT?Pe(!1,Ke):Ke.which===ne.Z.RIGHT&&Pe(!0,Ke),Xt==null||Xt(Ke)}function _e(Ke){var re=Pe(!Ne,Ke);Ot==null||Ot(re,Ke)}var an=qt()(et,ht,(Bt={},(0,Ut.Z)(Bt,"".concat(et,"-checked"),Ne),(0,Ut.Z)(Bt,"".concat(et,"-disabled"),vt),Bt));return he.createElement("button",(0,pt.Z)({},Ht,{type:"button",role:"switch","aria-checked":Ne,disabled:vt,className:an,ref:Ce,onKeyDown:Qe,onClick:_e}),St,he.createElement("span",{className:"".concat(et,"-inner")},he.createElement("span",{className:"".concat(et,"-inner-checked")},Et),he.createElement("span",{className:"".concat(et,"-inner-unchecked")},Tt)))});Te.displayName="Switch",zn.Z=Te},86351:function(Bn,zn,kt){"use strict";kt.d(zn,{R:function(){return Ut},w:function(){return pt}});var pt={},Ut="rc-table-internal-hook"},97347:function(Bn,zn,kt){"use strict";kt.d(zn,{L:function(){return et},Z:function(){return St}});var pt=kt(52456),Ut=kt(18082),ue=kt(92393),Le=kt(10928),he=kt(20049),Dt=kt(5883),qt=kt(11592),me=kt(48736),ne=kt(59301),jt=kt(86351),Te=kt(54451);function se(Et){var Tt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";return typeof Tt=="number"?Tt:Tt.endsWith("%")?Et*parseFloat(Tt)/100:null}function Ce(Et,Tt,Ot){return ne.useMemo(function(){if(Tt&&Tt>0){var $t=0,Xt=0;Et.forEach(function(_e){var an=se(Tt,_e.width);an?$t+=an:Xt+=1});var Ht=Math.max(Tt,Ot),ve=Math.max(Ht-$t,Xt),ie=Xt,Ne=ve/Xt,xe=0,Pe=Et.map(function(_e){var an=(0,he.Z)({},_e),Ke=se(Tt,an.width);if(Ke)an.width=Ke;else{var re=Math.floor(Ne);an.width=ie===1?ve:re,ve-=re,ie-=1}return xe+=an.width,an});if(xe<Ht){var Qe=Ht/xe;ve=Ht,Pe.forEach(function(_e,an){var Ke=Math.floor(_e.width*Qe);_e.width=an===Pe.length-1?ve:Ke,ve-=Ke})}return[Pe,Math.max(xe,Ht)]}return[Et,Tt]},[Et,Tt,Ot])}var Bt=["children"],nt=["fixed"];function et(Et){return(0,qt.Z)(Et).filter(function(Tt){return ne.isValidElement(Tt)}).map(function(Tt){var Ot=Tt.key,$t=Tt.props,Xt=$t.children,Ht=(0,Dt.Z)($t,Bt),ve=(0,he.Z)({key:Ot},Ht);return Xt&&(ve.children=et(Xt)),ve})}function ht(Et){return Et.filter(function(Tt){return Tt&&(0,Le.Z)(Tt)==="object"&&!Tt.hidden}).map(function(Tt){var Ot=Tt.children;return Ot&&Ot.length>0?(0,he.Z)((0,he.Z)({},Tt),{},{children:ht(Ot)}):Tt})}function st(Et){var Tt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"key";return Et.filter(function(Ot){return Ot&&(0,Le.Z)(Ot)==="object"}).reduce(function(Ot,$t,Xt){var Ht=$t.fixed,ve=Ht===!0?"left":Ht,ie="".concat(Tt,"-").concat(Xt),Ne=$t.children;return Ne&&Ne.length>0?[].concat((0,ue.Z)(Ot),(0,ue.Z)(st(Ne,ie).map(function(xe){return(0,he.Z)({fixed:ve},xe)}))):[].concat((0,ue.Z)(Ot),[(0,he.Z)((0,he.Z)({key:ie},$t),{},{fixed:ve})])},[])}function gt(Et){return Et.map(function(Tt){var Ot=Tt.fixed,$t=(0,Dt.Z)(Tt,nt),Xt=Ot;return Ot==="left"?Xt="right":Ot==="right"&&(Xt="left"),(0,he.Z)({fixed:Xt},$t)})}function vt(Et,Tt){var Ot=Et.prefixCls,$t=Et.columns,Xt=Et.children,Ht=Et.expandable,ve=Et.expandedKeys,ie=Et.columnTitle,Ne=Et.getRowKey,xe=Et.onTriggerExpand,Pe=Et.expandIcon,Qe=Et.rowExpandable,_e=Et.expandIconColumnIndex,an=Et.direction,Ke=Et.expandRowByClick,re=Et.columnWidth,Jt=Et.fixed,Ye=Et.scrollWidth,Gn=Et.clientWidth,dn=ne.useMemo(function(){var ri=$t||et(Xt)||[];return ht(ri.slice())},[$t,Xt]),Oe=ne.useMemo(function(){if(Ht){var ri=dn.slice();if(!ri.includes(jt.w)){var Rt=_e||0;Rt>=0&&(Rt||Jt==="left"||!Jt)&&ri.splice(Rt,0,jt.w),Jt==="right"&&ri.splice(dn.length,0,jt.w)}var Lt=ri.indexOf(jt.w);ri=ri.filter(function(Mt,Yt){return Mt!==jt.w||Yt===Lt});var Pt=dn[Lt],Nt;Jt?Nt=Jt:Nt=Pt?Pt.fixed:null;var Zt=(0,Ut.Z)((0,Ut.Z)((0,Ut.Z)((0,Ut.Z)((0,Ut.Z)((0,Ut.Z)({},Te.v,{className:"".concat(Ot,"-expand-icon-col"),columnType:"EXPAND_COLUMN"}),"title",ie),"fixed",Nt),"className","".concat(Ot,"-row-expand-icon-cell")),"width",re),"render",function(Yt,Ge,De){var Ue=Ne(Ge,De),we=ve.has(Ue),Ee=Qe?Qe(Ge):!0,Fe=Pe({prefixCls:Ot,expanded:we,expandable:Ee,record:Ge,onExpand:xe});return Ke?ne.createElement("span",{onClick:function(qe){return qe.stopPropagation()}},Fe):Fe});return ri.map(function(Mt){return Mt===jt.w?Zt:Mt})}return dn.filter(function(Mt){return Mt!==jt.w})},[Ht,dn,Ne,ve,Pe,an]),sn=ne.useMemo(function(){var ri=Oe;return Tt&&(ri=Tt(ri)),ri.length||(ri=[{render:function(){return null}}]),ri},[Tt,Oe,an]),ln=ne.useMemo(function(){return an==="rtl"?gt(st(sn)):st(sn)},[sn,an,Ye]),Vn=ne.useMemo(function(){for(var ri=-1,Rt=ln.length-1;Rt>=0;Rt-=1){var Lt=ln[Rt].fixed;if(Lt==="left"||Lt===!0){ri=Rt;break}}if(ri>=0)for(var Pt=0;Pt<=ri;Pt+=1){var Nt=ln[Pt].fixed;if(Nt!=="left"&&Nt!==!0)return!0}var Zt=ln.findIndex(function(Ge){var De=Ge.fixed;return De==="right"});if(Zt>=0)for(var Mt=Zt;Mt<ln.length;Mt+=1){var Yt=ln[Mt].fixed;if(Yt!=="right")return!0}return!1},[ln]),Ae=Ce(ln,Ye,Gn),yn=(0,pt.Z)(Ae,2),te=yn[0],En=yn[1];return[sn,te,En,Vn]}var St=vt},4030:function(Bn,zn,kt){"use strict";kt.d(zn,{w2:function(){return pt.w},vP:function(){return xn.v},RQ:function(){return pt.R},ER:function(){return Ue},Q$:function(){return yr},TN:function(){return Yr}});var pt=kt(86351),Ut=kt(52456),ue=kt(6089),Le=kt(34280),he=kt(13697),Dt=kt(59301),qt=kt(4676);function me(je){var Pn=Dt.createContext(void 0),be=function(Zn){var Jn=Zn.value,Ci=Zn.children,Si=Dt.useRef(Jn);Si.current=Jn;var li=Dt.useState(function(){return{getValue:function(){return Si.current},listeners:new Set}}),mn=(0,Ut.Z)(li,1),Un=mn[0];return(0,Le.Z)(function(){(0,qt.unstable_batchedUpdates)(function(){Un.listeners.forEach(function(Qn){Qn(Jn)})})},[Jn]),Dt.createElement(Pn.Provider,{value:Un},Ci)};return{Context:Pn,Provider:be,defaultValue:je}}function ne(je,Pn){var be=(0,ue.Z)(typeof Pn=="function"?Pn:function(Qn){if(Pn===void 0)return Qn;if(!Array.isArray(Pn))return Qn[Pn];var Dn={};return Pn.forEach(function(Xn){Dn[Xn]=Qn[Xn]}),Dn}),At=Dt.useContext(je==null?void 0:je.Context),Zn=At||{},Jn=Zn.listeners,Ci=Zn.getValue,Si=Dt.useRef();Si.current=be(At?Ci():je==null?void 0:je.defaultValue);var li=Dt.useState({}),mn=(0,Ut.Z)(li,2),Un=mn[1];return(0,Le.Z)(function(){if(!At)return;function Qn(Dn){var Xn=be(Dn);(0,he.Z)(Si.current,Xn,!0)||Un({})}return Jn.add(Qn),function(){Jn.delete(Qn)}},[At]),Si.current}var jt=kt(5016),Te=kt(8654);function se(){var je=Dt.createContext(null);function Pn(){return Dt.useContext(je)}function be(Zn,Jn){var Ci=(0,Te.Yr)(Zn),Si=function(mn,Un){var Qn=Ci?{ref:Un}:{},Dn=Dt.useRef(0),Xn=Dt.useRef(mn),Oi=Pn();return Oi!==null?Dt.createElement(Zn,(0,jt.Z)({},mn,Qn)):((!Jn||Jn(Xn.current,mn))&&(Dn.current+=1),Xn.current=mn,Dt.createElement(je.Provider,{value:Dn.current},Dt.createElement(Zn,(0,jt.Z)({},mn,Qn))))};return Ci?Dt.forwardRef(Si):Si}function At(Zn,Jn){var Ci=(0,Te.Yr)(Zn),Si=function(mn,Un){var Qn=Ci?{ref:Un}:{};return Pn(),Dt.createElement(Zn,(0,jt.Z)({},mn,Qn))};return Ci?Dt.memo(Dt.forwardRef(Si),Jn):Dt.memo(Si,Jn)}return{makeImmutable:be,responseImmutable:At,useImmutableMark:Pn}}var Ce=se(),Bt=Ce.makeImmutable,nt=Ce.responseImmutable,et=Ce.useImmutableMark,ht=se(),st=ht.makeImmutable,gt=ht.responseImmutable,vt=ht.useImmutableMark,St=me(),Et=St;function Tt(je,Pn){var be=React.useRef(0);be.current+=1;var At=React.useRef(je),Zn=[];Object.keys(je||{}).map(function(Ci){var Si;(je==null?void 0:je[Ci])!==((Si=At.current)===null||Si===void 0?void 0:Si[Ci])&&Zn.push(Ci)}),At.current=je;var Jn=React.useRef([]);return Zn.length&&(Jn.current=Zn),React.useDebugValue(be.current),React.useDebugValue(Jn.current.join(", ")),Pn&&console.log("".concat(Pn,":"),be.current,Jn.current),be.current}var Ot=null,$t=null,Xt=kt(10928),Ht=kt(20049),ve=kt(18082),ie=kt(92310),Ne=kt.n(ie),xe=kt(80547),Pe=kt(97938),Qe=kt(48736),_e=Dt.createContext({renderWithProps:!1}),an=_e,Ke="RC_TABLE_KEY";function re(je){return je==null?[]:Array.isArray(je)?je:[je]}function Jt(je){var Pn=[],be={};return je.forEach(function(At){for(var Zn=At||{},Jn=Zn.key,Ci=Zn.dataIndex,Si=Jn||re(Ci).join("-")||Ke;be[Si];)Si="".concat(Si,"_next");be[Si]=!0,Pn.push(Si)}),Pn}function Ye(je){return je!=null}function Gn(je){return typeof je=="number"&&!Number.isNaN(je)}function dn(je){return je&&(0,Xt.Z)(je)==="object"&&!Array.isArray(je)&&!Dt.isValidElement(je)}function Oe(je,Pn,be,At,Zn,Jn){var Ci=Dt.useContext(an),Si=vt(),li=(0,xe.Z)(function(){if(Ye(At))return[At];var mn=Pn==null||Pn===""?[]:Array.isArray(Pn)?Pn:[Pn],Un=(0,Pe.Z)(je,mn),Qn=Un,Dn=void 0;if(Zn){var Xn=Zn(Un,je,be);dn(Xn)?(Qn=Xn.children,Dn=Xn.props,Ci.renderWithProps=!0):Qn=Xn}return[Qn,Dn]},[Si,je,At,Pn,Zn,be],function(mn,Un){if(Jn){var Qn=(0,Ut.Z)(mn,2),Dn=Qn[1],Xn=(0,Ut.Z)(Un,2),Oi=Xn[1];return Jn(Oi,Dn)}return Ci.renderWithProps?!0:!(0,he.Z)(mn,Un,!0)});return li}function sn(je,Pn,be,At){var Zn=je+Pn-1;return je<=At&&Zn>=be}function ln(je,Pn){return ne(Et,function(be){var At=sn(je,Pn||1,be.hoverStartRow,be.hoverEndRow);return[At,be.onHover]})}var Vn=kt(70425),Ae=function(Pn){var be=Pn.ellipsis,At=Pn.rowType,Zn=Pn.children,Jn,Ci=be===!0?{showTitle:!0}:be;return Ci&&(Ci.showTitle||At==="header")&&(typeof Zn=="string"||typeof Zn=="number"?Jn=Zn.toString():Dt.isValidElement(Zn)&&typeof Zn.props.children=="string"&&(Jn=Zn.props.children)),Jn};function yn(je){var Pn,be,At,Zn,Jn,Ci,Si,li,mn=je.component,Un=je.children,Qn=je.ellipsis,Dn=je.scope,Xn=je.prefixCls,Oi=je.className,mi=je.align,ii=je.record,on=je.render,ki=je.dataIndex,Ui=je.renderIndex,Tr=je.shouldCellUpdate,hr=je.index,ao=je.rowType,eo=je.colSpan,qr=je.rowSpan,co=je.fixLeft,uo=je.fixRight,bo=je.firstFixLeft,Be=je.lastFixLeft,so=je.firstFixRight,Jr=je.lastFixRight,fr=je.appendNode,Hr=je.additionalProps,Er=Hr===void 0?{}:Hr,Fo=je.isSticky,Lo="".concat(Xn,"-cell"),Rr=ne(Et,["supportSticky","allColumnsFixedLeft","rowHoverable"]),jr=Rr.supportSticky,Za=Rr.allColumnsFixedLeft,aa=Rr.rowHoverable,As=Oe(ii,ki,Ui,Un,on,Tr),Na=(0,Ut.Z)(As,2),nr=Na[0],qo=Na[1],ta={},ga=typeof co=="number"&&jr,oa=typeof uo=="number"&&jr;ga&&(ta.position="sticky",ta.left=co),oa&&(ta.position="sticky",ta.right=uo);var pa=(Pn=(be=(At=qo==null?void 0:qo.colSpan)!==null&&At!==void 0?At:Er.colSpan)!==null&&be!==void 0?be:eo)!==null&&Pn!==void 0?Pn:1,fi=(Zn=(Jn=(Ci=qo==null?void 0:qo.rowSpan)!==null&&Ci!==void 0?Ci:Er.rowSpan)!==null&&Jn!==void 0?Jn:qr)!==null&&Zn!==void 0?Zn:1,ar=ln(hr,fi),_r=(0,Ut.Z)(ar,2),to=_r[0],fo=_r[1],zo=(0,Vn.zX)(function(is){var Qo;ii&&fo(hr,hr+fi-1),Er==null||(Qo=Er.onMouseEnter)===null||Qo===void 0||Qo.call(Er,is)}),lr=(0,Vn.zX)(function(is){var Qo;ii&&fo(-1,-1),Er==null||(Qo=Er.onMouseLeave)===null||Qo===void 0||Qo.call(Er,is)});if(pa===0||fi===0)return null;var Xa=(Si=Er.title)!==null&&Si!==void 0?Si:Ae({rowType:ao,ellipsis:Qn,children:nr}),fa=Ne()(Lo,Oi,(li={},(0,ve.Z)((0,ve.Z)((0,ve.Z)((0,ve.Z)((0,ve.Z)((0,ve.Z)((0,ve.Z)((0,ve.Z)((0,ve.Z)((0,ve.Z)(li,"".concat(Lo,"-fix-left"),ga&&jr),"".concat(Lo,"-fix-left-first"),bo&&jr),"".concat(Lo,"-fix-left-last"),Be&&jr),"".concat(Lo,"-fix-left-all"),Be&&Za&&jr),"".concat(Lo,"-fix-right"),oa&&jr),"".concat(Lo,"-fix-right-first"),so&&jr),"".concat(Lo,"-fix-right-last"),Jr&&jr),"".concat(Lo,"-ellipsis"),Qn),"".concat(Lo,"-with-append"),fr),"".concat(Lo,"-fix-sticky"),(ga||oa)&&Fo&&jr),(0,ve.Z)(li,"".concat(Lo,"-row-hover"),!qo&&to)),Er.className,qo==null?void 0:qo.className),Uo={};mi&&(Uo.textAlign=mi);var lo=(0,Ht.Z)((0,Ht.Z)((0,Ht.Z)((0,Ht.Z)({},qo==null?void 0:qo.style),ta),Uo),Er.style),Pa=nr;return(0,Xt.Z)(Pa)==="object"&&!Array.isArray(Pa)&&!Dt.isValidElement(Pa)&&(Pa=null),Qn&&(Be||so)&&(Pa=Dt.createElement("span",{className:"".concat(Lo,"-content")},Pa)),Dt.createElement(mn,(0,jt.Z)({},qo,Er,{className:fa,style:lo,title:Xa,scope:Dn,onMouseEnter:aa?zo:void 0,onMouseLeave:aa?lr:void 0,colSpan:pa!==1?pa:null,rowSpan:fi!==1?fi:null}),fr,Pa)}var te=Dt.memo(yn);function En(je,Pn,be,At,Zn){var Jn=be[je]||{},Ci=be[Pn]||{},Si,li;Jn.fixed==="left"?Si=At.left[Zn==="rtl"?Pn:je]:Ci.fixed==="right"&&(li=At.right[Zn==="rtl"?je:Pn]);var mn=!1,Un=!1,Qn=!1,Dn=!1,Xn=be[Pn+1],Oi=be[je-1],mi=Xn&&!Xn.fixed||Oi&&!Oi.fixed||be.every(function(Tr){return Tr.fixed==="left"});if(Zn==="rtl"){if(Si!==void 0){var ii=Oi&&Oi.fixed==="left";Dn=!ii&&mi}else if(li!==void 0){var on=Xn&&Xn.fixed==="right";Qn=!on&&mi}}else if(Si!==void 0){var ki=Xn&&Xn.fixed==="left";mn=!ki&&mi}else if(li!==void 0){var Ui=Oi&&Oi.fixed==="right";Un=!Ui&&mi}return{fixLeft:Si,fixRight:li,lastFixLeft:mn,firstFixRight:Un,lastFixRight:Qn,firstFixLeft:Dn,isSticky:At.isSticky}}var ri=Dt.createContext({}),Rt=ri;function Lt(je){var Pn=je.className,be=je.index,At=je.children,Zn=je.colSpan,Jn=Zn===void 0?1:Zn,Ci=je.rowSpan,Si=je.align,li=ne(Et,["prefixCls","direction"]),mn=li.prefixCls,Un=li.direction,Qn=Dt.useContext(Rt),Dn=Qn.scrollColumnIndex,Xn=Qn.stickyOffsets,Oi=Qn.flattenColumns,mi=be+Jn-1,ii=mi+1===Dn?Jn+1:Jn,on=En(be,be+ii-1,Oi,Xn,Un);return Dt.createElement(te,(0,jt.Z)({className:Pn,index:be,component:"td",prefixCls:mn,record:null,dataIndex:null,align:Si,colSpan:ii,rowSpan:Ci,render:function(){return At}},on))}var Pt=kt(5883),Nt=["children"];function Zt(je){var Pn=je.children,be=(0,Pt.Z)(je,Nt);return Dt.createElement("tr",be,Pn)}function Mt(je){var Pn=je.children;return Pn}Mt.Row=Zt,Mt.Cell=Lt;var Yt=Mt;function Ge(je){var Pn=je.children,be=je.stickyOffsets,At=je.flattenColumns,Zn=ne(Et,"prefixCls"),Jn=At.length-1,Ci=At[Jn],Si=Dt.useMemo(function(){return{stickyOffsets:be,flattenColumns:At,scrollColumnIndex:Ci!=null&&Ci.scrollbar?Jn:null}},[Ci,At,Jn,be]);return Dt.createElement(Rt.Provider,{value:Si},Dt.createElement("tfoot",{className:"".concat(Zn,"-summary")},Pn))}var De=gt(Ge),Ue=Yt,we=kt(29301),Ee=kt(24514),Fe=kt(75152),He=kt(26112);function qe(je,Pn,be,At,Zn,Jn,Ci){je.push({record:Pn,indent:be,index:Ci});var Si=Jn(Pn),li=Zn==null?void 0:Zn.has(Si);if(Pn&&Array.isArray(Pn[At])&&li)for(var mn=0;mn<Pn[At].length;mn+=1)qe(je,Pn[At][mn],be+1,At,Zn,Jn,mn)}function cn(je,Pn,be,At){var Zn=Dt.useMemo(function(){if(be!=null&&be.size){for(var Jn=[],Ci=0;Ci<(je==null?void 0:je.length);Ci+=1){var Si=je[Ci];qe(Jn,Si,0,Pn,be,At,Ci)}return Jn}return je==null?void 0:je.map(function(li,mn){return{record:li,indent:0,index:mn}})},[je,Pn,be,At]);return Zn}function gn(je,Pn,be,At){var Zn=ne(Et,["prefixCls","fixedInfoList","flattenColumns","expandableType","expandRowByClick","onTriggerExpand","rowClassName","expandedRowClassName","indentSize","expandIcon","expandedRowRender","expandIconColumnIndex","expandedKeys","childrenColumnName","rowExpandable","onRow"]),Jn=Zn.flattenColumns,Ci=Zn.expandableType,Si=Zn.expandedKeys,li=Zn.childrenColumnName,mn=Zn.onTriggerExpand,Un=Zn.rowExpandable,Qn=Zn.onRow,Dn=Zn.expandRowByClick,Xn=Zn.rowClassName,Oi=Ci==="nest",mi=Ci==="row"&&(!Un||Un(je)),ii=mi||Oi,on=Si&&Si.has(Pn),ki=li&&je&&je[li],Ui=(0,Vn.zX)(mn),Tr=Qn==null?void 0:Qn(je,be),hr=Tr==null?void 0:Tr.onClick,ao=function(uo){Dn&&ii&&mn(je,uo);for(var bo=arguments.length,Be=new Array(bo>1?bo-1:0),so=1;so<bo;so++)Be[so-1]=arguments[so];hr==null||hr.apply(void 0,[uo].concat(Be))},eo;typeof Xn=="string"?eo=Xn:typeof Xn=="function"&&(eo=Xn(je,be,At));var qr=Jt(Jn);return(0,Ht.Z)((0,Ht.Z)({},Zn),{},{columnsKey:qr,nestExpandable:Oi,expanded:on,hasNestChildren:ki,record:je,onTriggerExpand:Ui,rowSupportExpand:mi,expandable:ii,rowProps:(0,Ht.Z)((0,Ht.Z)({},Tr),{},{className:Ne()(eo,Tr==null?void 0:Tr.className),onClick:ao})})}function ni(je){var Pn=je.prefixCls,be=je.children,At=je.component,Zn=je.cellComponent,Jn=je.className,Ci=je.expanded,Si=je.colSpan,li=je.isEmpty,mn=ne(Et,["scrollbarSize","fixHeader","fixColumn","componentWidth","horizonScroll"]),Un=mn.scrollbarSize,Qn=mn.fixHeader,Dn=mn.fixColumn,Xn=mn.componentWidth,Oi=mn.horizonScroll,mi=be;return(li?Oi&&Xn:Dn)&&(mi=Dt.createElement("div",{style:{width:Xn-(Qn&&!li?Un:0),position:"sticky",left:0,overflow:"hidden"},className:"".concat(Pn,"-expanded-row-fixed")},mi)),Dt.createElement(At,{className:Jn,style:{display:Ci?null:"none"}},Dt.createElement(te,{component:Zn,prefixCls:Pn,colSpan:Si},mi))}var ze=ni;function Ve(je){var Pn=je.prefixCls,be=je.record,At=je.onExpand,Zn=je.expanded,Jn=je.expandable,Ci="".concat(Pn,"-row-expand-icon");if(!Jn)return Dt.createElement("span",{className:Ne()(Ci,"".concat(Pn,"-row-spaced"))});var Si=function(mn){At(be,mn),mn.stopPropagation()};return Dt.createElement("span",{className:Ne()(Ci,(0,ve.Z)((0,ve.Z)({},"".concat(Pn,"-row-expanded"),Zn),"".concat(Pn,"-row-collapsed"),!Zn)),onClick:Si})}function nn(je,Pn,be){var At=[];function Zn(Jn){(Jn||[]).forEach(function(Ci,Si){At.push(Pn(Ci,Si)),Zn(Ci[be])})}return Zn(je),At}function qn(je,Pn,be,At){return typeof je=="string"?je:typeof je=="function"?je(Pn,be,At):""}function vn(je,Pn,be,At,Zn){var Jn=je.record,Ci=je.prefixCls,Si=je.columnsKey,li=je.fixedInfoList,mn=je.expandIconColumnIndex,Un=je.nestExpandable,Qn=je.indentSize,Dn=je.expandIcon,Xn=je.expanded,Oi=je.hasNestChildren,mi=je.onTriggerExpand,ii=Si[be],on=li[be],ki;be===(mn||0)&&Un&&(ki=Dt.createElement(Dt.Fragment,null,Dt.createElement("span",{style:{paddingLeft:"".concat(Qn*At,"px")},className:"".concat(Ci,"-row-indent indent-level-").concat(At)}),Dn({prefixCls:Ci,expanded:Xn,expandable:Oi,record:Jn,onExpand:mi})));var Ui;return Pn.onCell&&(Ui=Pn.onCell(Jn,Zn)),{key:ii,fixedInfo:on,appendCellNode:ki,additionalCellProps:Ui||{}}}function tn(je){var Pn=je.className,be=je.style,At=je.record,Zn=je.index,Jn=je.renderIndex,Ci=je.rowKey,Si=je.indent,li=Si===void 0?0:Si,mn=je.rowComponent,Un=je.cellComponent,Qn=je.scopeCellComponent,Dn=gn(At,Ci,Zn,li),Xn=Dn.prefixCls,Oi=Dn.flattenColumns,mi=Dn.expandedRowClassName,ii=Dn.expandedRowRender,on=Dn.rowProps,ki=Dn.expanded,Ui=Dn.rowSupportExpand,Tr=Dt.useRef(!1);Tr.current||(Tr.current=ki);var hr=qn(mi,At,Zn,li),ao=Dt.createElement(mn,(0,jt.Z)({},on,{"data-row-key":Ci,className:Ne()(Pn,"".concat(Xn,"-row"),"".concat(Xn,"-row-level-").concat(li),on==null?void 0:on.className,(0,ve.Z)({},hr,li>=1)),style:(0,Ht.Z)((0,Ht.Z)({},be),on==null?void 0:on.style)}),Oi.map(function(co,uo){var bo=co.render,Be=co.dataIndex,so=co.className,Jr=vn(Dn,co,uo,li,Zn),fr=Jr.key,Hr=Jr.fixedInfo,Er=Jr.appendCellNode,Fo=Jr.additionalCellProps;return Dt.createElement(te,(0,jt.Z)({className:so,ellipsis:co.ellipsis,align:co.align,scope:co.rowScope,component:co.rowScope?Qn:Un,prefixCls:Xn,key:fr,record:At,index:Zn,renderIndex:Jn,dataIndex:Be,render:bo,shouldCellUpdate:co.shouldCellUpdate},Hr,{appendNode:Er,additionalProps:Fo}))})),eo;if(Ui&&(Tr.current||ki)){var qr=ii(At,Zn,li+1,ki);eo=Dt.createElement(ze,{expanded:ki,className:Ne()("".concat(Xn,"-expanded-row"),"".concat(Xn,"-expanded-row-level-").concat(li+1),hr),prefixCls:Xn,component:mn,cellComponent:Un,colSpan:Oi.length,isEmpty:!1},qr)}return Dt.createElement(Dt.Fragment,null,ao,eo)}var Rn=gt(tn);function gi(je){var Pn=je.columnKey,be=je.onColumnResize,At=Dt.useRef();return(0,Le.Z)(function(){At.current&&be(Pn,At.current.offsetWidth)},[]),Dt.createElement(we.Z,{data:Pn},Dt.createElement("td",{ref:At,style:{padding:0,border:0,height:0}},Dt.createElement("div",{style:{height:0,overflow:"hidden"}},"\xA0")))}var ti=kt(29194);function vi(je){var Pn=je.prefixCls,be=je.columnsKey,At=je.onColumnResize,Zn=Dt.useRef(null);return Dt.createElement("tr",{"aria-hidden":"true",className:"".concat(Pn,"-measure-row"),style:{height:0,fontSize:0},ref:Zn},Dt.createElement(we.Z.Collection,{onBatchResize:function(Ci){(0,ti.Z)(Zn.current)&&Ci.forEach(function(Si){var li=Si.data,mn=Si.size;At(li,mn.offsetWidth)})}},be.map(function(Jn){return Dt.createElement(gi,{key:Jn,columnKey:Jn,onColumnResize:At})})))}function Gi(je){var Pn=je.data,be=je.measureColumnWidth,At=ne(Et,["prefixCls","getComponent","onColumnResize","flattenColumns","getRowKey","expandedKeys","childrenColumnName","emptyNode"]),Zn=At.prefixCls,Jn=At.getComponent,Ci=At.onColumnResize,Si=At.flattenColumns,li=At.getRowKey,mn=At.expandedKeys,Un=At.childrenColumnName,Qn=At.emptyNode,Dn=cn(Pn,Un,mn,li),Xn=Dt.useRef({renderWithProps:!1}),Oi=Jn(["body","wrapper"],"tbody"),mi=Jn(["body","row"],"tr"),ii=Jn(["body","cell"],"td"),on=Jn(["body","cell"],"th"),ki;Pn.length?ki=Dn.map(function(Tr,hr){var ao=Tr.record,eo=Tr.indent,qr=Tr.index,co=li(ao,hr);return Dt.createElement(Rn,{key:co,rowKey:co,record:ao,index:hr,renderIndex:qr,rowComponent:mi,cellComponent:ii,scopeCellComponent:on,indent:eo})}):ki=Dt.createElement(ze,{expanded:!0,className:"".concat(Zn,"-placeholder"),prefixCls:Zn,component:mi,cellComponent:ii,colSpan:Si.length,isEmpty:!0},Qn);var Ui=Jt(Si);return Dt.createElement(an.Provider,{value:Xn.current},Dt.createElement(Oi,{className:"".concat(Zn,"-tbody")},be&&Dt.createElement(vi,{prefixCls:Zn,columnsKey:Ui,onColumnResize:Ci}),ki))}var Fn=gt(Gi),xn=kt(54451),Tn=["columnType"];function ai(je){for(var Pn=je.colWidths,be=je.columns,At=je.columCount,Zn=ne(Et,["tableLayout"]),Jn=Zn.tableLayout,Ci=[],Si=At||be.length,li=!1,mn=Si-1;mn>=0;mn-=1){var Un=Pn[mn],Qn=be&&be[mn],Dn=void 0,Xn=void 0;if(Qn&&(Dn=Qn[xn.v],Jn==="auto"&&(Xn=Qn.minWidth)),Un||Xn||Dn||li){var Oi=Dn||{},mi=Oi.columnType,ii=(0,Pt.Z)(Oi,Tn);Ci.unshift(Dt.createElement("col",(0,jt.Z)({key:mn,style:{width:Un,minWidth:Xn}},ii))),li=!0}}return Dt.createElement("colgroup",null,Ci)}var pi=ai,ui=kt(92393),zi=["className","noData","columns","flattenColumns","colWidths","columCount","stickyOffsets","direction","fixHeader","stickyTopOffset","stickyBottomOffset","stickyClassName","onScroll","maxContentScroll","children"];function wt(je,Pn){return(0,Dt.useMemo)(function(){for(var be=[],At=0;At<Pn;At+=1){var Zn=je[At];if(Zn!==void 0)be[At]=Zn;else return null}return be},[je.join("_"),Pn])}var Xe=Dt.forwardRef(function(je,Pn){var be=je.className,At=je.noData,Zn=je.columns,Jn=je.flattenColumns,Ci=je.colWidths,Si=je.columCount,li=je.stickyOffsets,mn=je.direction,Un=je.fixHeader,Qn=je.stickyTopOffset,Dn=je.stickyBottomOffset,Xn=je.stickyClassName,Oi=je.onScroll,mi=je.maxContentScroll,ii=je.children,on=(0,Pt.Z)(je,zi),ki=ne(Et,["prefixCls","scrollbarSize","isSticky","getComponent"]),Ui=ki.prefixCls,Tr=ki.scrollbarSize,hr=ki.isSticky,ao=ki.getComponent,eo=ao(["header","table"],"table"),qr=hr&&!Un?0:Tr,co=Dt.useRef(null),uo=Dt.useCallback(function(Fo){(0,Te.mH)(Pn,Fo),(0,Te.mH)(co,Fo)},[]);Dt.useEffect(function(){var Fo;function Lo(Rr){var jr=Rr,Za=jr.currentTarget,aa=jr.deltaX;aa&&(Oi({currentTarget:Za,scrollLeft:Za.scrollLeft+aa}),Rr.preventDefault())}return(Fo=co.current)===null||Fo===void 0||Fo.addEventListener("wheel",Lo,{passive:!1}),function(){var Rr;(Rr=co.current)===null||Rr===void 0||Rr.removeEventListener("wheel",Lo)}},[]);var bo=Dt.useMemo(function(){return Jn.every(function(Fo){return Fo.width})},[Jn]),Be=Jn[Jn.length-1],so={fixed:Be?Be.fixed:null,scrollbar:!0,onHeaderCell:function(){return{className:"".concat(Ui,"-cell-scrollbar")}}},Jr=(0,Dt.useMemo)(function(){return qr?[].concat((0,ui.Z)(Zn),[so]):Zn},[qr,Zn]),fr=(0,Dt.useMemo)(function(){return qr?[].concat((0,ui.Z)(Jn),[so]):Jn},[qr,Jn]),Hr=(0,Dt.useMemo)(function(){var Fo=li.right,Lo=li.left;return(0,Ht.Z)((0,Ht.Z)({},li),{},{left:mn==="rtl"?[].concat((0,ui.Z)(Lo.map(function(Rr){return Rr+qr})),[0]):Lo,right:mn==="rtl"?Fo:[].concat((0,ui.Z)(Fo.map(function(Rr){return Rr+qr})),[0]),isSticky:hr})},[qr,li,hr]),Er=wt(Ci,Si);return Dt.createElement("div",{style:(0,Ht.Z)({overflow:"hidden"},hr?{top:Qn,bottom:Dn}:{}),ref:uo,className:Ne()(be,(0,ve.Z)({},Xn,!!Xn))},Dt.createElement(eo,{style:{tableLayout:"fixed",visibility:At||Er?null:"hidden"}},(!At||!mi||bo)&&Dt.createElement(pi,{colWidths:Er?[].concat((0,ui.Z)(Er),[qr]):[],columCount:Si+1,columns:fr}),ii((0,Ht.Z)((0,Ht.Z)({},on),{},{stickyOffsets:Hr,columns:Jr,flattenColumns:fr}))))}),Hn=Dt.memo(Xe),Ai=function(Pn){var be=Pn.cells,At=Pn.stickyOffsets,Zn=Pn.flattenColumns,Jn=Pn.rowComponent,Ci=Pn.cellComponent,Si=Pn.onHeaderRow,li=Pn.index,mn=ne(Et,["prefixCls","direction"]),Un=mn.prefixCls,Qn=mn.direction,Dn;Si&&(Dn=Si(be.map(function(Oi){return Oi.column}),li));var Xn=Jt(be.map(function(Oi){return Oi.column}));return Dt.createElement(Jn,Dn,be.map(function(Oi,mi){var ii=Oi.column,on=En(Oi.colStart,Oi.colEnd,Zn,At,Qn),ki;return ii&&ii.onHeaderCell&&(ki=Oi.column.onHeaderCell(ii)),Dt.createElement(te,(0,jt.Z)({},Oi,{scope:ii.title?Oi.colSpan>1?"colgroup":"col":null,ellipsis:ii.ellipsis,align:ii.align,component:Ci,prefixCls:Un,key:Xn[mi]},on,{additionalProps:ki,rowType:"header"}))}))},Vi=Ai;function dr(je){var Pn=[];function be(Ci,Si){var li=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;Pn[li]=Pn[li]||[];var mn=Si,Un=Ci.filter(Boolean).map(function(Qn){var Dn={key:Qn.key,className:Qn.className||"",children:Qn.title,column:Qn,colStart:mn},Xn=1,Oi=Qn.children;return Oi&&Oi.length>0&&(Xn=be(Oi,mn,li+1).reduce(function(mi,ii){return mi+ii},0),Dn.hasSubColumns=!0),"colSpan"in Qn&&(Xn=Qn.colSpan),"rowSpan"in Qn&&(Dn.rowSpan=Qn.rowSpan),Dn.colSpan=Xn,Dn.colEnd=Dn.colStart+Xn-1,Pn[li].push(Dn),mn+=Xn,Xn});return Un}be(je,0);for(var At=Pn.length,Zn=function(Si){Pn[Si].forEach(function(li){!("rowSpan"in li)&&!li.hasSubColumns&&(li.rowSpan=At-Si)})},Jn=0;Jn<At;Jn+=1)Zn(Jn);return Pn}var kr=function(Pn){var be=Pn.stickyOffsets,At=Pn.columns,Zn=Pn.flattenColumns,Jn=Pn.onHeaderRow,Ci=ne(Et,["prefixCls","getComponent"]),Si=Ci.prefixCls,li=Ci.getComponent,mn=Dt.useMemo(function(){return dr(At)},[At]),Un=li(["header","wrapper"],"thead"),Qn=li(["header","row"],"tr"),Dn=li(["header","cell"],"th");return Dt.createElement(Un,{className:"".concat(Si,"-thead")},mn.map(function(Xn,Oi){var mi=Dt.createElement(Vi,{key:Oi,flattenColumns:Zn,cells:Xn,stickyOffsets:be,rowComponent:Qn,cellComponent:Dn,onHeaderRow:Jn,index:Oi});return mi}))},ci=gt(kr),In=kt(97347);function pe(je,Pn,be){var At=(0,xn.g)(je),Zn=At.expandIcon,Jn=At.expandedRowKeys,Ci=At.defaultExpandedRowKeys,Si=At.defaultExpandAllRows,li=At.expandedRowRender,mn=At.onExpand,Un=At.onExpandedRowsChange,Qn=At.childrenColumnName,Dn=Zn||Ve,Xn=Qn||"children",Oi=Dt.useMemo(function(){return li?"row":je.expandable&&je.internalHooks===pt.R&&je.expandable.__PARENT_RENDER_ICON__||Pn.some(function(hr){return hr&&(0,Xt.Z)(hr)==="object"&&hr[Xn]})?"nest":!1},[!!li,Pn]),mi=Dt.useState(function(){return Ci||(Si?nn(Pn,be,Xn):[])}),ii=(0,Ut.Z)(mi,2),on=ii[0],ki=ii[1],Ui=Dt.useMemo(function(){return new Set(Jn||on||[])},[Jn,on]),Tr=Dt.useCallback(function(hr){var ao=be(hr,Pn.indexOf(hr)),eo,qr=Ui.has(ao);qr?(Ui.delete(ao),eo=(0,ui.Z)(Ui)):eo=[].concat((0,ui.Z)(Ui),[ao]),ki(eo),mn&&mn(!qr,hr),Un&&Un(eo)},[be,Ui,Pn,mn,Un]);return[At,Oi,Ui,Dn,Xn,Tr]}function Se(je,Pn,be){var At=je.map(function(Zn,Jn){return En(Jn,Jn,je,Pn,be)});return(0,xe.Z)(function(){return At},[At],function(Zn,Jn){return!(0,he.Z)(Zn,Jn)})}function ye(je){var Pn=(0,Dt.useRef)(je),be=(0,Dt.useState)({}),At=(0,Ut.Z)(be,2),Zn=At[1],Jn=(0,Dt.useRef)(null),Ci=(0,Dt.useRef)([]);function Si(li){Ci.current.push(li);var mn=Promise.resolve();Jn.current=mn,mn.then(function(){if(Jn.current===mn){var Un=Ci.current,Qn=Pn.current;Ci.current=[],Un.forEach(function(Dn){Pn.current=Dn(Pn.current)}),Jn.current=null,Qn!==Pn.current&&Zn({})}})}return(0,Dt.useEffect)(function(){return function(){Jn.current=null}},[]),[Pn.current,Si]}function jn(je){var Pn=(0,Dt.useRef)(je||null),be=(0,Dt.useRef)();function At(){window.clearTimeout(be.current)}function Zn(Ci){Pn.current=Ci,At(),be.current=window.setTimeout(function(){Pn.current=null,be.current=void 0},100)}function Jn(){return Pn.current}return(0,Dt.useEffect)(function(){return At},[]),[Zn,Jn]}function Ln(){var je=Dt.useState(-1),Pn=(0,Ut.Z)(je,2),be=Pn[0],At=Pn[1],Zn=Dt.useState(-1),Jn=(0,Ut.Z)(Zn,2),Ci=Jn[0],Si=Jn[1],li=Dt.useCallback(function(mn,Un){At(mn),Si(Un)},[]);return[be,Ci,li]}var Kn=kt(47273),Je=(0,Kn.Z)()?window:null;function An(je,Pn){var be=(0,Xt.Z)(je)==="object"?je:{},At=be.offsetHeader,Zn=At===void 0?0:At,Jn=be.offsetSummary,Ci=Jn===void 0?0:Jn,Si=be.offsetScroll,li=Si===void 0?0:Si,mn=be.getContainer,Un=mn===void 0?function(){return Je}:mn,Qn=Un()||Je,Dn=!!je;return Dt.useMemo(function(){return{isSticky:Dn,stickyClassName:Dn?"".concat(Pn,"-sticky-holder"):"",offsetHeader:Zn,offsetSummary:Ci,offsetScroll:li,container:Qn}},[Dn,li,Zn,Ci,Pn,Qn])}function yi(je,Pn,be){var At=(0,Dt.useMemo)(function(){var Zn=Pn.length,Jn=function(mn,Un,Qn){for(var Dn=[],Xn=0,Oi=mn;Oi!==Un;Oi+=Qn)Dn.push(Xn),Pn[Oi].fixed&&(Xn+=je[Oi]||0);return Dn},Ci=Jn(0,Zn,1),Si=Jn(Zn-1,-1,-1).reverse();return be==="rtl"?{left:Si,right:Ci}:{left:Ci,right:Si}},[je,Pn,be]);return At}var Ei=yi;function Xi(je){var Pn=je.className,be=je.children;return Dt.createElement("div",{className:Pn},be)}var Gt=Xi,de=kt(8224),un=kt(16089),Mn=kt(76846);function Ie(je){var Pn=(0,Mn.bn)(je),be=Pn.getBoundingClientRect(),At=document.documentElement;return{left:be.left+(window.pageXOffset||At.scrollLeft)-(At.clientLeft||document.body.clientLeft||0),top:be.top+(window.pageYOffset||At.scrollTop)-(At.clientTop||document.body.clientTop||0)}}var $e=function(Pn,be){var At,Zn,Jn=Pn.scrollBodyRef,Ci=Pn.onScroll,Si=Pn.offsetScroll,li=Pn.container,mn=Pn.direction,Un=ne(Et,"prefixCls"),Qn=((At=Jn.current)===null||At===void 0?void 0:At.scrollWidth)||0,Dn=((Zn=Jn.current)===null||Zn===void 0?void 0:Zn.clientWidth)||0,Xn=Qn&&Dn*(Dn/Qn),Oi=Dt.useRef(),mi=ye({scrollLeft:0,isHiddenScrollBar:!0}),ii=(0,Ut.Z)(mi,2),on=ii[0],ki=ii[1],Ui=Dt.useRef({delta:0,x:0}),Tr=Dt.useState(!1),hr=(0,Ut.Z)(Tr,2),ao=hr[0],eo=hr[1],qr=Dt.useRef(null);Dt.useEffect(function(){return function(){un.Z.cancel(qr.current)}},[]);var co=function(){eo(!1)},uo=function(fr){fr.persist(),Ui.current.delta=fr.pageX-on.scrollLeft,Ui.current.x=0,eo(!0),fr.preventDefault()},bo=function(fr){var Hr,Er=fr||((Hr=window)===null||Hr===void 0?void 0:Hr.event),Fo=Er.buttons;if(!ao||Fo===0){ao&&eo(!1);return}var Lo=Ui.current.x+fr.pageX-Ui.current.x-Ui.current.delta,Rr=mn==="rtl";Lo=Math.max(Rr?Xn-Dn:0,Math.min(Rr?0:Dn-Xn,Lo));var jr=!Rr||Math.abs(Lo)+Math.abs(Xn)<Dn;jr&&(Ci({scrollLeft:Lo/Dn*(Qn+2)}),Ui.current.x=fr.pageX)},Be=function(){un.Z.cancel(qr.current),qr.current=(0,un.Z)(function(){if(Jn.current){var fr=Ie(Jn.current).top,Hr=fr+Jn.current.offsetHeight,Er=li===window?document.documentElement.scrollTop+window.innerHeight:Ie(li).top+li.clientHeight;Hr-(0,Fe.Z)()<=Er||fr>=Er-Si?ki(function(Fo){return(0,Ht.Z)((0,Ht.Z)({},Fo),{},{isHiddenScrollBar:!0})}):ki(function(Fo){return(0,Ht.Z)((0,Ht.Z)({},Fo),{},{isHiddenScrollBar:!1})})}})},so=function(fr){ki(function(Hr){return(0,Ht.Z)((0,Ht.Z)({},Hr),{},{scrollLeft:fr/Qn*Dn||0})})};return Dt.useImperativeHandle(be,function(){return{setScrollLeft:so,checkScrollBarVisible:Be}}),Dt.useEffect(function(){var Jr=(0,de.Z)(document.body,"mouseup",co,!1),fr=(0,de.Z)(document.body,"mousemove",bo,!1);return Be(),function(){Jr.remove(),fr.remove()}},[Xn,ao]),Dt.useEffect(function(){if(Jn.current){for(var Jr=[],fr=(0,Mn.bn)(Jn.current);fr;)Jr.push(fr),fr=fr.parentElement;return Jr.forEach(function(Hr){return Hr.addEventListener("scroll",Be,!1)}),window.addEventListener("resize",Be,!1),window.addEventListener("scroll",Be,!1),li.addEventListener("scroll",Be,!1),function(){Jr.forEach(function(Hr){return Hr.removeEventListener("scroll",Be)}),window.removeEventListener("resize",Be),window.removeEventListener("scroll",Be),li.removeEventListener("scroll",Be)}}},[li]),Dt.useEffect(function(){on.isHiddenScrollBar||ki(function(Jr){var fr=Jn.current;return fr?(0,Ht.Z)((0,Ht.Z)({},Jr),{},{scrollLeft:fr.scrollLeft/fr.scrollWidth*fr.clientWidth}):Jr})},[on.isHiddenScrollBar]),Qn<=Dn||!Xn||on.isHiddenScrollBar?null:Dt.createElement("div",{style:{height:(0,Fe.Z)(),width:Dn,bottom:Si},className:"".concat(Un,"-sticky-scroll")},Dt.createElement("div",{onMouseDown:uo,ref:Oi,className:Ne()("".concat(Un,"-sticky-scroll-bar"),(0,ve.Z)({},"".concat(Un,"-sticky-scroll-bar-active"),ao)),style:{width:"".concat(Xn,"px"),transform:"translate3d(".concat(on.scrollLeft,"px, 0, 0)")}}))},bn=Dt.forwardRef($e);function _n(je){return null}var hi=_n;function Yn(je){return null}var si=Yn,ei="rc-table",Ii=[],Ti={};function Di(){return"No Data"}function We(je,Pn){var be=(0,Ht.Z)({rowKey:"key",prefixCls:ei,emptyText:Di},je),At=be.prefixCls,Zn=be.className,Jn=be.rowClassName,Ci=be.style,Si=be.data,li=be.rowKey,mn=be.scroll,Un=be.tableLayout,Qn=be.direction,Dn=be.title,Xn=be.footer,Oi=be.summary,mi=be.caption,ii=be.id,on=be.showHeader,ki=be.components,Ui=be.emptyText,Tr=be.onRow,hr=be.onHeaderRow,ao=be.onScroll,eo=be.internalHooks,qr=be.transformColumns,co=be.internalRefs,uo=be.tailor,bo=be.getContainerWidth,Be=be.sticky,so=be.rowHoverable,Jr=so===void 0?!0:so,fr=Si||Ii,Hr=!!fr.length,Er=eo===pt.R,Fo=Dt.useCallback(function(Mo,Wo){return(0,Pe.Z)(ki,Mo)||Wo},[ki]),Lo=Dt.useMemo(function(){return typeof li=="function"?li:function(Mo){var Wo=Mo&&Mo[li];return Wo}},[li]),Rr=Fo(["body"]),jr=Ln(),Za=(0,Ut.Z)(jr,3),aa=Za[0],As=Za[1],Na=Za[2],nr=pe(be,fr,Lo),qo=(0,Ut.Z)(nr,6),ta=qo[0],ga=qo[1],oa=qo[2],pa=qo[3],fi=qo[4],ar=qo[5],_r=mn==null?void 0:mn.x,to=Dt.useState(0),fo=(0,Ut.Z)(to,2),zo=fo[0],lr=fo[1],Xa=(0,In.Z)((0,Ht.Z)((0,Ht.Z)((0,Ht.Z)({},be),ta),{},{expandable:!!ta.expandedRowRender,columnTitle:ta.columnTitle,expandedKeys:oa,getRowKey:Lo,onTriggerExpand:ar,expandIcon:pa,expandIconColumnIndex:ta.expandIconColumnIndex,direction:Qn,scrollWidth:Er&&uo&&typeof _r=="number"?_r:null,clientWidth:zo}),Er?qr:null),fa=(0,Ut.Z)(Xa,4),Uo=fa[0],lo=fa[1],Pa=fa[2],is=fa[3],Qo=Pa!=null?Pa:_r,ps=Dt.useMemo(function(){return{columns:Uo,flattenColumns:lo}},[Uo,lo]),ms=Dt.useRef(),zs=Dt.useRef(),Fa=Dt.useRef(),Ru=Dt.useRef();Dt.useImperativeHandle(Pn,function(){return{nativeElement:ms.current,scrollTo:function(Wo){var Ca;if(Fa.current instanceof HTMLElement){var rs=Wo.index,$a=Wo.top,cu=Wo.key;if(Gn($a)){var ul;(ul=Fa.current)===null||ul===void 0||ul.scrollTo({top:$a})}else{var fu,hl=cu!=null?cu:Lo(fr[rs]);(fu=Fa.current.querySelector('[data-row-key="'.concat(hl,'"]')))===null||fu===void 0||fu.scrollIntoView()}}else(Ca=Fa.current)!==null&&Ca!==void 0&&Ca.scrollTo&&Fa.current.scrollTo(Wo)}}});var Lu=Dt.useRef(),Zs=Dt.useState(!1),Al=(0,Ut.Z)(Zs,2),Gs=Al[0],Ul=Al[1],hu=Dt.useState(!1),Fu=(0,Ut.Z)(hu,2),wa=Fu[0],sl=Fu[1],ju=Dt.useState(new Map),Yl=(0,Ut.Z)(ju,2),du=Yl[0],Ja=Yl[1],Qa=Jt(lo),Ba=Qa.map(function(Mo){return du.get(Mo)}),Ga=Dt.useMemo(function(){return Ba},[Ba.join("_")]),Tl=Ei(Ga,lo,Qn),ma=mn&&Ye(mn.y),Ro=mn&&Ye(Qo)||!!ta.fixed,wo=Ro&&lo.some(function(Mo){var Wo=Mo.fixed;return Wo}),Do=Dt.useRef(),Aa=An(Be,At),ae=Aa.isSticky,Re=Aa.offsetHeader,_t=Aa.offsetSummary,fe=Aa.offsetScroll,zr=Aa.stickyClassName,mr=Aa.container,Fr=Dt.useMemo(function(){return Oi==null?void 0:Oi(fr)},[Oi,fr]),sr=(ma||ae)&&Dt.isValidElement(Fr)&&Fr.type===Yt&&Fr.props.fixed,Pr,po,Xr;ma&&(po={overflowY:Hr?"scroll":"auto",maxHeight:mn.y}),Ro&&(Pr={overflowX:"auto"},ma||(po={overflowY:"hidden"}),Xr={width:Qo===!0?"auto":Qo,minWidth:"100%"});var Dr=Dt.useCallback(function(Mo,Wo){Ja(function(Ca){if(Ca.get(Mo)!==Wo){var rs=new Map(Ca);return rs.set(Mo,Wo),rs}return Ca})},[]),Ki=jn(null),no=(0,Ut.Z)(Ki,2),Wi=no[0],ir=no[1];function Ji(Mo,Wo){Wo&&(typeof Wo=="function"?Wo(Mo):Wo.scrollLeft!==Mo&&(Wo.scrollLeft=Mo,Wo.scrollLeft!==Mo&&setTimeout(function(){Wo.scrollLeft=Mo},0)))}var Mr=(0,ue.Z)(function(Mo){var Wo=Mo.currentTarget,Ca=Mo.scrollLeft,rs=Qn==="rtl",$a=typeof Ca=="number"?Ca:Wo.scrollLeft,cu=Wo||Ti;if(!ir()||ir()===cu){var ul;Wi(cu),Ji($a,zs.current),Ji($a,Fa.current),Ji($a,Lu.current),Ji($a,(ul=Do.current)===null||ul===void 0?void 0:ul.setScrollLeft)}var fu=Wo||zs.current;if(fu){var hl=Er&&uo&&typeof Qo=="number"?Qo:fu.scrollWidth,Il=fu.clientWidth;if(hl===Il){Ul(!1),sl(!1);return}rs?(Ul(-$a<hl-Il),sl(-$a>0)):(Ul($a>0),sl($a<hl-Il))}}),Lr=(0,ue.Z)(function(Mo){Mr(Mo),ao==null||ao(Mo)}),Br=function(){if(Ro&&Fa.current){var Wo;Mr({currentTarget:(0,Mn.bn)(Fa.current),scrollLeft:(Wo=Fa.current)===null||Wo===void 0?void 0:Wo.scrollLeft})}else Ul(!1),sl(!1)},io=function(Wo){var Ca,rs=Wo.width;(Ca=Do.current)===null||Ca===void 0||Ca.checkScrollBarVisible();var $a=ms.current?ms.current.offsetWidth:rs;Er&&bo&&ms.current&&($a=bo(ms.current,$a)||$a),$a!==zo&&(Br(),lr($a))},Zi=Dt.useRef(!1);Dt.useEffect(function(){Zi.current&&Br()},[Ro,Si,Uo.length]),Dt.useEffect(function(){Zi.current=!0},[]);var Sr=Dt.useState(0),Li=(0,Ut.Z)(Sr,2),Qi=Li[0],wr=Li[1],ro=Dt.useState(!0),So=(0,Ut.Z)(ro,2),No=So[0],$i=So[1];(0,Le.Z)(function(){(!uo||!Er)&&(Fa.current instanceof Element?wr((0,Fe.o)(Fa.current).width):wr((0,Fe.o)(Ru.current).width)),$i((0,Ee.G)("position","sticky"))},[]),Dt.useEffect(function(){Er&&co&&(co.body.current=Fa.current)});var _a=Dt.useCallback(function(Mo){return Dt.createElement(Dt.Fragment,null,Dt.createElement(ci,Mo),sr==="top"&&Dt.createElement(De,Mo,Fr))},[sr,Fr]),or=Dt.useCallback(function(Mo){return Dt.createElement(De,Mo,Fr)},[Fr]),Oo=Fo(["table"],"table"),Ar=Dt.useMemo(function(){return Un||(wo?Qo==="max-content"?"auto":"fixed":ma||ae||lo.some(function(Mo){var Wo=Mo.ellipsis;return Wo})?"fixed":"auto")},[ma,wo,lo,Un,ae]),ea,Yo={colWidths:Ga,columCount:lo.length,stickyOffsets:Tl,onHeaderRow:hr,fixHeader:ma,scroll:mn},la=Dt.useMemo(function(){return Hr?null:typeof Ui=="function"?Ui():Ui},[Hr,Ui]),ll=Dt.createElement(Fn,{data:fr,measureColumnWidth:ma||Ro||ae}),Xl=Dt.createElement(pi,{colWidths:lo.map(function(Mo){var Wo=Mo.width;return Wo}),columns:lo}),Js=mi!=null?Dt.createElement("caption",{className:"".concat(At,"-caption")},mi):void 0,Dl=(0,He.Z)(be,{data:!0}),jo=(0,He.Z)(be,{aria:!0});if(ma||ae){var vs;typeof Rr=="function"?(vs=Rr(fr,{scrollbarSize:Qi,ref:Fa,onScroll:Mr}),Yo.colWidths=lo.map(function(Mo,Wo){var Ca=Mo.width,rs=Wo===lo.length-1?Ca-Qi:Ca;return typeof rs=="number"&&!Number.isNaN(rs)?rs:0})):vs=Dt.createElement("div",{style:(0,Ht.Z)((0,Ht.Z)({},Pr),po),onScroll:Lr,ref:Fa,className:Ne()("".concat(At,"-body"))},Dt.createElement(Oo,(0,jt.Z)({style:(0,Ht.Z)((0,Ht.Z)({},Xr),{},{tableLayout:Ar})},jo),Js,Xl,ll,!sr&&Fr&&Dt.createElement(De,{stickyOffsets:Tl,flattenColumns:lo},Fr)));var Ol=(0,Ht.Z)((0,Ht.Z)((0,Ht.Z)({noData:!fr.length,maxContentScroll:Ro&&Qo==="max-content"},Yo),ps),{},{direction:Qn,stickyClassName:zr,onScroll:Mr});ea=Dt.createElement(Dt.Fragment,null,on!==!1&&Dt.createElement(Hn,(0,jt.Z)({},Ol,{stickyTopOffset:Re,className:"".concat(At,"-header"),ref:zs}),_a),vs,sr&&sr!=="top"&&Dt.createElement(Hn,(0,jt.Z)({},Ol,{stickyBottomOffset:_t,className:"".concat(At,"-summary"),ref:Lu}),or),ae&&Fa.current&&Fa.current instanceof Element&&Dt.createElement(bn,{ref:Do,offsetScroll:fe,scrollBodyRef:Fa,onScroll:Mr,container:mr,direction:Qn}))}else ea=Dt.createElement("div",{style:(0,Ht.Z)((0,Ht.Z)({},Pr),po),className:Ne()("".concat(At,"-content")),onScroll:Mr,ref:Fa},Dt.createElement(Oo,(0,jt.Z)({style:(0,Ht.Z)((0,Ht.Z)({},Xr),{},{tableLayout:Ar})},jo),Js,Xl,on!==!1&&Dt.createElement(ci,(0,jt.Z)({},Yo,ps)),ll,Fr&&Dt.createElement(De,{stickyOffsets:Tl,flattenColumns:lo},Fr)));var Qs=Dt.createElement("div",(0,jt.Z)({className:Ne()(At,Zn,(0,ve.Z)((0,ve.Z)((0,ve.Z)((0,ve.Z)((0,ve.Z)((0,ve.Z)((0,ve.Z)((0,ve.Z)((0,ve.Z)((0,ve.Z)({},"".concat(At,"-rtl"),Qn==="rtl"),"".concat(At,"-ping-left"),Gs),"".concat(At,"-ping-right"),wa),"".concat(At,"-layout-fixed"),Un==="fixed"),"".concat(At,"-fixed-header"),ma),"".concat(At,"-fixed-column"),wo),"".concat(At,"-fixed-column-gapped"),wo&&is),"".concat(At,"-scroll-horizontal"),Ro),"".concat(At,"-has-fix-left"),lo[0]&&lo[0].fixed),"".concat(At,"-has-fix-right"),lo[lo.length-1]&&lo[lo.length-1].fixed==="right")),style:Ci,id:ii,ref:ms},Dl),Dn&&Dt.createElement(Gt,{className:"".concat(At,"-title")},Dn(fr)),Dt.createElement("div",{ref:Ru,className:"".concat(At,"-container")},ea),Xn&&Dt.createElement(Gt,{className:"".concat(At,"-footer")},Xn(fr)));Ro&&(Qs=Dt.createElement(we.Z,{onResize:io},Qs));var Ph=Se(lo,Tl,Qn),Jl=Dt.useMemo(function(){return{scrollX:Qo,prefixCls:At,getComponent:Fo,scrollbarSize:Qi,direction:Qn,fixedInfoList:Ph,isSticky:ae,supportSticky:No,componentWidth:zo,fixHeader:ma,fixColumn:wo,horizonScroll:Ro,tableLayout:Ar,rowClassName:Jn,expandedRowClassName:ta.expandedRowClassName,expandIcon:pa,expandableType:ga,expandRowByClick:ta.expandRowByClick,expandedRowRender:ta.expandedRowRender,onTriggerExpand:ar,expandIconColumnIndex:ta.expandIconColumnIndex,indentSize:ta.indentSize,allColumnsFixedLeft:lo.every(function(Mo){return Mo.fixed==="left"}),emptyNode:la,columns:Uo,flattenColumns:lo,onColumnResize:Dr,hoverStartRow:aa,hoverEndRow:As,onHover:Na,rowExpandable:ta.rowExpandable,onRow:Tr,getRowKey:Lo,expandedKeys:oa,childrenColumnName:fi,rowHoverable:Jr}},[Qo,At,Fo,Qi,Qn,Ph,ae,No,zo,ma,wo,Ro,Ar,Jn,ta.expandedRowClassName,pa,ga,ta.expandRowByClick,ta.expandedRowRender,ar,ta.expandIconColumnIndex,ta.indentSize,la,Uo,lo,Dr,aa,As,Na,ta.rowExpandable,Tr,Lo,oa,fi,Jr]);return Dt.createElement(Et.Provider,{value:Jl},Qs)}var gr=Dt.forwardRef(We);function yr(je){return st(gr,je)}var $r=yr();$r.EXPAND_COLUMN=pt.w,$r.INTERNAL_HOOKS=pt.R,$r.Column=hi,$r.ColumnGroup=si,$r.Summary=Ue;var rn=$r,On=kt(65283),bi=me(null),Mi=me(null);function _i(je,Pn,be){var At=Pn||1;return be[je+At]-(be[je]||0)}function tr(je){var Pn=je.rowInfo,be=je.column,At=je.colIndex,Zn=je.indent,Jn=je.index,Ci=je.component,Si=je.renderIndex,li=je.record,mn=je.style,Un=je.className,Qn=je.inverse,Dn=je.getHeight,Xn=be.render,Oi=be.dataIndex,mi=be.className,ii=be.width,on=ne(Mi,["columnsOffset"]),ki=on.columnsOffset,Ui=vn(Pn,be,At,Zn,Jn),Tr=Ui.key,hr=Ui.fixedInfo,ao=Ui.appendCellNode,eo=Ui.additionalCellProps,qr=eo.style,co=eo.colSpan,uo=co===void 0?1:co,bo=eo.rowSpan,Be=bo===void 0?1:bo,so=At-1,Jr=_i(so,uo,ki),fr=uo>1?ii-Jr:0,Hr=(0,Ht.Z)((0,Ht.Z)((0,Ht.Z)({},qr),mn),{},{flex:"0 0 ".concat(Jr,"px"),width:"".concat(Jr,"px"),marginRight:fr,pointerEvents:"auto"}),Er=Dt.useMemo(function(){return Qn?Be<=1:uo===0||Be===0||Be>1},[Be,uo,Qn]);Er?Hr.visibility="hidden":Qn&&(Hr.height=Dn==null?void 0:Dn(Be));var Fo=Er?function(){return null}:Xn,Lo={};return(Be===0||uo===0)&&(Lo.rowSpan=1,Lo.colSpan=1),Dt.createElement(te,(0,jt.Z)({className:Ne()(mi,Un),ellipsis:be.ellipsis,align:be.align,scope:be.rowScope,component:Ci,prefixCls:Pn.prefixCls,key:Tr,record:li,index:Jn,renderIndex:Si,dataIndex:Oi,render:Fo,shouldCellUpdate:be.shouldCellUpdate},hr,{appendNode:ao,additionalProps:(0,Ht.Z)((0,Ht.Z)({},eo),{},{style:Hr},Lo)}))}var pr=tr,br=["data","index","className","rowKey","style","extra","getHeight"],Or=Dt.forwardRef(function(je,Pn){var be=je.data,At=je.index,Zn=je.className,Jn=je.rowKey,Ci=je.style,Si=je.extra,li=je.getHeight,mn=(0,Pt.Z)(je,br),Un=be.record,Qn=be.indent,Dn=be.index,Xn=ne(Et,["prefixCls","flattenColumns","fixColumn","componentWidth","scrollX"]),Oi=Xn.scrollX,mi=Xn.flattenColumns,ii=Xn.prefixCls,on=Xn.fixColumn,ki=Xn.componentWidth,Ui=ne(bi,["getComponent"]),Tr=Ui.getComponent,hr=gn(Un,Jn,At,Qn),ao=Tr(["body","row"],"div"),eo=Tr(["body","cell"],"div"),qr=hr.rowSupportExpand,co=hr.expanded,uo=hr.rowProps,bo=hr.expandedRowRender,Be=hr.expandedRowClassName,so;if(qr&&co){var Jr=bo(Un,At,Qn+1,co),fr=qn(Be,Un,At,Qn),Hr={};on&&(Hr={style:(0,ve.Z)({},"--virtual-width","".concat(ki,"px"))});var Er="".concat(ii,"-expanded-row-cell");so=Dt.createElement(ao,{className:Ne()("".concat(ii,"-expanded-row"),"".concat(ii,"-expanded-row-level-").concat(Qn+1),fr)},Dt.createElement(te,{component:eo,prefixCls:ii,className:Ne()(Er,(0,ve.Z)({},"".concat(Er,"-fixed"),on)),additionalProps:Hr},Jr))}var Fo=(0,Ht.Z)((0,Ht.Z)({},Ci),{},{width:Oi});Si&&(Fo.position="absolute",Fo.pointerEvents="none");var Lo=Dt.createElement(ao,(0,jt.Z)({},uo,mn,{"data-row-key":Jn,ref:qr?null:Pn,className:Ne()(Zn,"".concat(ii,"-row"),uo==null?void 0:uo.className,(0,ve.Z)({},"".concat(ii,"-row-extra"),Si)),style:(0,Ht.Z)((0,Ht.Z)({},Fo),uo==null?void 0:uo.style)}),mi.map(function(Rr,jr){return Dt.createElement(pr,{key:jr,component:eo,rowInfo:hr,column:Rr,colIndex:jr,indent:Qn,index:At,renderIndex:Dn,record:Un,inverse:Si,getHeight:li})}));return qr?Dt.createElement("div",{ref:Pn},Lo,so):Lo}),Ir=gt(Or),fn=Ir,ho=Dt.forwardRef(function(je,Pn){var be=je.data,At=je.onScroll,Zn=ne(Et,["flattenColumns","onColumnResize","getRowKey","prefixCls","expandedKeys","childrenColumnName","scrollX","direction"]),Jn=Zn.flattenColumns,Ci=Zn.onColumnResize,Si=Zn.getRowKey,li=Zn.expandedKeys,mn=Zn.prefixCls,Un=Zn.childrenColumnName,Qn=Zn.scrollX,Dn=Zn.direction,Xn=ne(bi),Oi=Xn.sticky,mi=Xn.scrollY,ii=Xn.listItemHeight,on=Xn.getComponent,ki=Xn.onScroll,Ui=Dt.useRef(),Tr=cn(be,Un,li,Si),hr=Dt.useMemo(function(){var so=0;return Jn.map(function(Jr){var fr=Jr.width,Hr=Jr.key;return so+=fr,[Hr,fr,so]})},[Jn]),ao=Dt.useMemo(function(){return hr.map(function(so){return so[2]})},[hr]);Dt.useEffect(function(){hr.forEach(function(so){var Jr=(0,Ut.Z)(so,2),fr=Jr[0],Hr=Jr[1];Ci(fr,Hr)})},[hr]),Dt.useImperativeHandle(Pn,function(){var so,Jr={scrollTo:function(Hr){var Er;(Er=Ui.current)===null||Er===void 0||Er.scrollTo(Hr)},nativeElement:(so=Ui.current)===null||so===void 0?void 0:so.nativeElement};return Object.defineProperty(Jr,"scrollLeft",{get:function(){var Hr;return((Hr=Ui.current)===null||Hr===void 0?void 0:Hr.getScrollInfo().x)||0},set:function(Hr){var Er;(Er=Ui.current)===null||Er===void 0||Er.scrollTo({left:Hr})}}),Jr});var eo=function(Jr,fr){var Hr,Er=(Hr=Tr[fr])===null||Hr===void 0?void 0:Hr.record,Fo=Jr.onCell;if(Fo){var Lo,Rr=Fo(Er,fr);return(Lo=Rr==null?void 0:Rr.rowSpan)!==null&&Lo!==void 0?Lo:1}return 1},qr=function(Jr){var fr=Jr.start,Hr=Jr.end,Er=Jr.getSize,Fo=Jr.offsetY;if(Hr<0)return null;for(var Lo=Jn.filter(function(pa){return eo(pa,fr)===0}),Rr=fr,jr=function(fi){if(Lo=Lo.filter(function(ar){return eo(ar,fi)===0}),!Lo.length)return Rr=fi,1},Za=fr;Za>=0&&!jr(Za);Za-=1);for(var aa=Jn.filter(function(pa){return eo(pa,Hr)!==1}),As=Hr,Na=function(fi){if(aa=aa.filter(function(ar){return eo(ar,fi)!==1}),!aa.length)return As=Math.max(fi-1,Hr),1},nr=Hr;nr<Tr.length&&!Na(nr);nr+=1);for(var qo=[],ta=function(fi){var ar=Tr[fi];if(!ar)return 1;Jn.some(function(_r){return eo(_r,fi)>1})&&qo.push(fi)},ga=Rr;ga<=As;ga+=1)ta(ga);var oa=qo.map(function(pa){var fi=Tr[pa],ar=Si(fi.record,pa),_r=function(zo){var lr=pa+zo-1,Xa=Si(Tr[lr].record,lr),fa=Er(ar,Xa);return fa.bottom-fa.top},to=Er(ar);return Dt.createElement(fn,{key:pa,data:fi,rowKey:ar,index:pa,style:{top:-Fo+to.top},extra:!0,getHeight:_r})});return oa},co=Dt.useMemo(function(){return{columnsOffset:ao}},[ao]),uo="".concat(mn,"-tbody"),bo=on(["body","wrapper"]),Be={};return Oi&&(Be.position="sticky",Be.bottom=0,(0,Xt.Z)(Oi)==="object"&&Oi.offsetScroll&&(Be.bottom=Oi.offsetScroll)),Dt.createElement(Mi.Provider,{value:co},Dt.createElement(On.Z,{fullHeight:!1,ref:Ui,prefixCls:"".concat(uo,"-virtual"),styles:{horizontalScrollBar:Be},className:uo,height:mi,itemHeight:ii||24,data:Tr,itemKey:function(Jr){return Si(Jr.record)},component:bo,scrollWidth:Qn,direction:Dn,onVirtualScroll:function(Jr){var fr,Hr=Jr.x;At({currentTarget:(fr=Ui.current)===null||fr===void 0?void 0:fr.nativeElement,scrollLeft:Hr})},onScroll:ki,extraRender:qr},function(so,Jr,fr){var Hr=Si(so.record,Jr);return Dt.createElement(fn,{data:so,rowKey:Hr,index:Jr,style:fr.style})}))}),pn=gt(ho),Hi=pn,Kr=function(Pn,be){var At=be.ref,Zn=be.onScroll;return Dt.createElement(Hi,{ref:At,data:Pn,onScroll:Zn})};function ji(je,Pn){var be=je.data,At=je.columns,Zn=je.scroll,Jn=je.sticky,Ci=je.prefixCls,Si=Ci===void 0?ei:Ci,li=je.className,mn=je.listItemHeight,Un=je.components,Qn=je.onScroll,Dn=Zn||{},Xn=Dn.x,Oi=Dn.y;typeof Xn!="number"&&(Xn=1),typeof Oi!="number"&&(Oi=500);var mi=(0,Vn.zX)(function(ki,Ui){return(0,Pe.Z)(Un,ki)||Ui}),ii=(0,Vn.zX)(Qn),on=Dt.useMemo(function(){return{sticky:Jn,scrollY:Oi,listItemHeight:mn,getComponent:mi,onScroll:ii}},[Jn,Oi,mn,mi,ii]);return Dt.createElement(bi.Provider,{value:on},Dt.createElement(rn,(0,jt.Z)({},je,{className:Ne()(li,"".concat(Si,"-virtual")),scroll:(0,Ht.Z)((0,Ht.Z)({},Zn),{},{x:Xn}),components:(0,Ht.Z)((0,Ht.Z)({},Un),{},{body:be!=null&&be.length?Kr:void 0}),columns:At,internalHooks:pt.R,tailor:!0,ref:Pn})))}var xo=Dt.forwardRef(ji);function Yr(je){return st(xo,je)}var Cr=Yr(),Po=null},54451:function(Bn,zn,kt){"use strict";kt.d(zn,{g:function(){return Dt},v:function(){return he}});var pt=kt(20049),Ut=kt(5883),ue=kt(48736),Le=["expandable"],he="RC_TABLE_INTERNAL_COL_DEFINE";function Dt(qt){var me=qt.expandable,ne=(0,Ut.Z)(qt,Le),jt;return"expandable"in qt?jt=(0,pt.Z)((0,pt.Z)({},ne),me):jt=ne,jt.showExpandColumn===!1&&(jt.expandIconColumnIndex=-1),jt}},22711:function(Bn,zn,kt){"use strict";kt.r(zn),kt.d(zn,{ResizableTextArea:function(){return ie},default:function(){return Qe}});var pt=kt(5016),Ut=kt(18082),ue=kt(20049),Le=kt(92393),he=kt(52456),Dt=kt(5883),qt=kt(92310),me=kt.n(qt),ne=kt(36901),jt=kt(66003),Te=kt(30292),se=kt(18929),Ce=kt(59301),Bt=kt(10928),nt=kt(29301),et=kt(34280),ht=kt(16089),st=`
|
|
min-height:0 !important;
|
|
max-height:none !important;
|
|
height:0 !important;
|
|
visibility:hidden !important;
|
|
overflow:hidden !important;
|
|
position:absolute !important;
|
|
z-index:-1000 !important;
|
|
top:0 !important;
|
|
right:0 !important;
|
|
pointer-events: none !important;
|
|
`,gt=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","font-variant","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break","white-space"],vt={},St;function Et(_e){var an=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Ke=_e.getAttribute("id")||_e.getAttribute("data-reactid")||_e.getAttribute("name");if(an&&vt[Ke])return vt[Ke];var re=window.getComputedStyle(_e),Jt=re.getPropertyValue("box-sizing")||re.getPropertyValue("-moz-box-sizing")||re.getPropertyValue("-webkit-box-sizing"),Ye=parseFloat(re.getPropertyValue("padding-bottom"))+parseFloat(re.getPropertyValue("padding-top")),Gn=parseFloat(re.getPropertyValue("border-bottom-width"))+parseFloat(re.getPropertyValue("border-top-width")),dn=gt.map(function(sn){return"".concat(sn,":").concat(re.getPropertyValue(sn))}).join(";"),Oe={sizingStyle:dn,paddingSize:Ye,borderSize:Gn,boxSizing:Jt};return an&&Ke&&(vt[Ke]=Oe),Oe}function Tt(_e){var an=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Ke=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,re=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;St||(St=document.createElement("textarea"),St.setAttribute("tab-index","-1"),St.setAttribute("aria-hidden","true"),St.setAttribute("name","hiddenTextarea"),document.body.appendChild(St)),_e.getAttribute("wrap")?St.setAttribute("wrap",_e.getAttribute("wrap")):St.removeAttribute("wrap");var Jt=Et(_e,an),Ye=Jt.paddingSize,Gn=Jt.borderSize,dn=Jt.boxSizing,Oe=Jt.sizingStyle;St.setAttribute("style","".concat(Oe,";").concat(st)),St.value=_e.value||_e.placeholder||"";var sn=void 0,ln=void 0,Vn,Ae=St.scrollHeight;if(dn==="border-box"?Ae+=Gn:dn==="content-box"&&(Ae-=Ye),Ke!==null||re!==null){St.value=" ";var yn=St.scrollHeight-Ye;Ke!==null&&(sn=yn*Ke,dn==="border-box"&&(sn=sn+Ye+Gn),Ae=Math.max(sn,Ae)),re!==null&&(ln=yn*re,dn==="border-box"&&(ln=ln+Ye+Gn),Vn=Ae>ln?"":"hidden",Ae=Math.min(ln,Ae))}var te={height:Ae,overflowY:Vn,resize:"none"};return sn&&(te.minHeight=sn),ln&&(te.maxHeight=ln),te}var Ot=["prefixCls","defaultValue","value","autoSize","onResize","className","style","disabled","onChange","onInternalAutoSize"],$t=0,Xt=1,Ht=2,ve=Ce.forwardRef(function(_e,an){var Ke=_e,re=Ke.prefixCls,Jt=Ke.defaultValue,Ye=Ke.value,Gn=Ke.autoSize,dn=Ke.onResize,Oe=Ke.className,sn=Ke.style,ln=Ke.disabled,Vn=Ke.onChange,Ae=Ke.onInternalAutoSize,yn=(0,Dt.Z)(Ke,Ot),te=(0,se.Z)(Jt,{value:Ye,postState:function(Rn){return Rn!=null?Rn:""}}),En=(0,he.Z)(te,2),ri=En[0],Rt=En[1],Lt=function(Rn){Rt(Rn.target.value),Vn==null||Vn(Rn)},Pt=Ce.useRef();Ce.useImperativeHandle(an,function(){return{textArea:Pt.current}});var Nt=Ce.useMemo(function(){return Gn&&(0,Bt.Z)(Gn)==="object"?[Gn.minRows,Gn.maxRows]:[]},[Gn]),Zt=(0,he.Z)(Nt,2),Mt=Zt[0],Yt=Zt[1],Ge=!!Gn,De=function(){try{if(document.activeElement===Pt.current){var Rn=Pt.current,gi=Rn.selectionStart,ti=Rn.selectionEnd,vi=Rn.scrollTop;Pt.current.setSelectionRange(gi,ti),Pt.current.scrollTop=vi}}catch(Gi){}},Ue=Ce.useState(Ht),we=(0,he.Z)(Ue,2),Ee=we[0],Fe=we[1],He=Ce.useState(),qe=(0,he.Z)(He,2),cn=qe[0],gn=qe[1],ni=function(){Fe($t)};(0,et.Z)(function(){Ge&&ni()},[Ye,Mt,Yt,Ge]),(0,et.Z)(function(){if(Ee===$t)Fe(Xt);else if(Ee===Xt){var tn=Tt(Pt.current,!1,Mt,Yt);Fe(Ht),gn(tn)}else De()},[Ee]);var ze=Ce.useRef(),Ve=function(){ht.Z.cancel(ze.current)},nn=function(Rn){Ee===Ht&&(dn==null||dn(Rn),Gn&&(Ve(),ze.current=(0,ht.Z)(function(){ni()})))};Ce.useEffect(function(){return Ve},[]);var qn=Ge?cn:null,vn=(0,ue.Z)((0,ue.Z)({},sn),qn);return(Ee===$t||Ee===Xt)&&(vn.overflowY="hidden",vn.overflowX="hidden"),Ce.createElement(nt.Z,{onResize:nn,disabled:!(Gn||dn)},Ce.createElement("textarea",(0,pt.Z)({},yn,{ref:Pt,style:vn,className:me()(re,Oe,(0,Ut.Z)({},"".concat(re,"-disabled"),ln)),disabled:ln,value:ri,onChange:Lt})))}),ie=ve,Ne=["defaultValue","value","onFocus","onBlur","onChange","allowClear","maxLength","onCompositionStart","onCompositionEnd","suffix","prefixCls","showCount","count","className","style","disabled","hidden","classNames","styles","onResize","onClear","onPressEnter","readOnly","autoSize","onKeyDown"],xe=Ce.forwardRef(function(_e,an){var Ke,re=_e.defaultValue,Jt=_e.value,Ye=_e.onFocus,Gn=_e.onBlur,dn=_e.onChange,Oe=_e.allowClear,sn=_e.maxLength,ln=_e.onCompositionStart,Vn=_e.onCompositionEnd,Ae=_e.suffix,yn=_e.prefixCls,te=yn===void 0?"rc-textarea":yn,En=_e.showCount,ri=_e.count,Rt=_e.className,Lt=_e.style,Pt=_e.disabled,Nt=_e.hidden,Zt=_e.classNames,Mt=_e.styles,Yt=_e.onResize,Ge=_e.onClear,De=_e.onPressEnter,Ue=_e.readOnly,we=_e.autoSize,Ee=_e.onKeyDown,Fe=(0,Dt.Z)(_e,Ne),He=(0,se.Z)(re,{value:Jt,defaultValue:re}),qe=(0,he.Z)(He,2),cn=qe[0],gn=qe[1],ni=cn==null?"":String(cn),ze=Ce.useState(!1),Ve=(0,he.Z)(ze,2),nn=Ve[0],qn=Ve[1],vn=Ce.useRef(!1),tn=Ce.useState(null),Rn=(0,he.Z)(tn,2),gi=Rn[0],ti=Rn[1],vi=(0,Ce.useRef)(null),Gi=(0,Ce.useRef)(null),Fn=function(){var yi;return(yi=Gi.current)===null||yi===void 0?void 0:yi.textArea},xn=function(){Fn().focus()};(0,Ce.useImperativeHandle)(an,function(){var An;return{resizableTextArea:Gi.current,focus:xn,blur:function(){Fn().blur()},nativeElement:((An=vi.current)===null||An===void 0?void 0:An.nativeElement)||Fn()}}),(0,Ce.useEffect)(function(){qn(function(An){return!Pt&&An})},[Pt]);var Tn=Ce.useState(null),ai=(0,he.Z)(Tn,2),pi=ai[0],ui=ai[1];Ce.useEffect(function(){if(pi){var An;(An=Fn()).setSelectionRange.apply(An,(0,Le.Z)(pi))}},[pi]);var zi=(0,jt.Z)(ri,En),wt=(Ke=zi.max)!==null&&Ke!==void 0?Ke:sn,Xe=Number(wt)>0,Hn=zi.strategy(ni),Ai=!!wt&&Hn>wt,Vi=function(yi,Ei){var Xi=Ei;!vn.current&&zi.exceedFormatter&&zi.max&&zi.strategy(Ei)>zi.max&&(Xi=zi.exceedFormatter(Ei,{max:zi.max}),Ei!==Xi&&ui([Fn().selectionStart||0,Fn().selectionEnd||0])),gn(Xi),(0,Te.rJ)(yi.currentTarget,yi,dn,Xi)},dr=function(yi){vn.current=!0,ln==null||ln(yi)},kr=function(yi){vn.current=!1,Vi(yi,yi.currentTarget.value),Vn==null||Vn(yi)},ci=function(yi){Vi(yi,yi.target.value)},In=function(yi){yi.key==="Enter"&&De&&De(yi),Ee==null||Ee(yi)},pe=function(yi){qn(!0),Ye==null||Ye(yi)},Se=function(yi){qn(!1),Gn==null||Gn(yi)},ye=function(yi){gn(""),xn(),(0,Te.rJ)(Fn(),yi,dn)},jn=Ae,Ln;zi.show&&(zi.showFormatter?Ln=zi.showFormatter({value:ni,count:Hn,maxLength:wt}):Ln="".concat(Hn).concat(Xe?" / ".concat(wt):""),jn=Ce.createElement(Ce.Fragment,null,jn,Ce.createElement("span",{className:me()("".concat(te,"-data-count"),Zt==null?void 0:Zt.count),style:Mt==null?void 0:Mt.count},Ln)));var Kn=function(yi){var Ei;Yt==null||Yt(yi),(Ei=Fn())!==null&&Ei!==void 0&&Ei.style.height&&ti(!0)},Je=!we&&!En&&!Oe;return Ce.createElement(ne.BaseInput,{ref:vi,value:ni,allowClear:Oe,handleReset:ye,suffix:jn,prefixCls:te,classNames:(0,ue.Z)((0,ue.Z)({},Zt),{},{affixWrapper:me()(Zt==null?void 0:Zt.affixWrapper,(0,Ut.Z)((0,Ut.Z)({},"".concat(te,"-show-count"),En),"".concat(te,"-textarea-allow-clear"),Oe))}),disabled:Pt,focused:nn,className:me()(Rt,Ai&&"".concat(te,"-out-of-range")),style:(0,ue.Z)((0,ue.Z)({},Lt),gi&&!Je?{height:"auto"}:{}),dataAttrs:{affixWrapper:{"data-count":typeof Ln=="string"?Ln:void 0}},hidden:Nt,readOnly:Ue,onClear:Ge},Ce.createElement(ie,(0,pt.Z)({},Fe,{autoSize:we,maxLength:sn,onKeyDown:In,onChange:ci,onFocus:pe,onBlur:Se,onCompositionStart:dr,onCompositionEnd:kr,className:me()(Zt==null?void 0:Zt.textarea),style:(0,ue.Z)((0,ue.Z)({},Mt==null?void 0:Mt.textarea),{},{resize:Lt==null?void 0:Lt.resize}),disabled:Pt,prefixCls:te,onResize:Kn,ref:Gi,readOnly:Ue})))}),Pe=xe,Qe=Pe},639:function(Bn,zn,kt){"use strict";kt.d(zn,{Z:function(){return vt}});var pt=kt(5016),Ut=kt(18082),ue=kt(20049),Le=kt(52456),he=kt(5883),Dt=kt(59301),qt=kt(92310),me=kt.n(qt),ne=kt(26112),jt=kt(30699),Te=function(Et){for(var Tt=Et.prefixCls,Ot=Et.level,$t=Et.isStart,Xt=Et.isEnd,Ht="".concat(Tt,"-indent-unit"),ve=[],ie=0;ie<Ot;ie+=1)ve.push(Dt.createElement("span",{key:ie,className:me()(Ht,(0,Ut.Z)((0,Ut.Z)({},"".concat(Ht,"-start"),$t[ie]),"".concat(Ht,"-end"),Xt[ie]))}));return Dt.createElement("span",{"aria-hidden":"true",className:"".concat(Tt,"-indent")},ve)},se=Dt.memo(Te),Ce=kt(65065),Bt=kt(34061),nt=["eventKey","className","style","dragOver","dragOverGapTop","dragOverGapBottom","isLeaf","isStart","isEnd","expanded","selected","checked","halfChecked","loading","domRef","active","data","onMouseMove","selectable"],et="open",ht="close",st="---",gt=function(Et){var Tt,Ot,$t,Xt=Et.eventKey,Ht=Et.className,ve=Et.style,ie=Et.dragOver,Ne=Et.dragOverGapTop,xe=Et.dragOverGapBottom,Pe=Et.isLeaf,Qe=Et.isStart,_e=Et.isEnd,an=Et.expanded,Ke=Et.selected,re=Et.checked,Jt=Et.halfChecked,Ye=Et.loading,Gn=Et.domRef,dn=Et.active,Oe=Et.data,sn=Et.onMouseMove,ln=Et.selectable,Vn=(0,he.Z)(Et,nt),Ae=Dt.useContext(jt.k),yn=Dt.useContext(jt.y),te=Dt.useRef(null),En=Dt.useState(!1),ri=(0,Le.Z)(En,2),Rt=ri[0],Lt=ri[1],Pt=!!(Ae.disabled||Et.disabled||(Tt=yn.nodeDisabled)!==null&&Tt!==void 0&&Tt.call(yn,Oe)),Nt=Dt.useMemo(function(){return!Ae.checkable||Et.checkable===!1?!1:Ae.checkable},[Ae.checkable,Et.checkable]),Zt=function(Hn){Pt||Ae.onNodeSelect(Hn,(0,Bt.F)(Et))},Mt=function(Hn){Pt||!Nt||Et.disableCheckbox||Ae.onNodeCheck(Hn,(0,Bt.F)(Et),!re)},Yt=Dt.useMemo(function(){return typeof ln=="boolean"?ln:Ae.selectable},[ln,Ae.selectable]),Ge=function(Hn){Ae.onNodeClick(Hn,(0,Bt.F)(Et)),Yt?Zt(Hn):Mt(Hn)},De=function(Hn){Ae.onNodeDoubleClick(Hn,(0,Bt.F)(Et))},Ue=function(Hn){Ae.onNodeMouseEnter(Hn,(0,Bt.F)(Et))},we=function(Hn){Ae.onNodeMouseLeave(Hn,(0,Bt.F)(Et))},Ee=function(Hn){Ae.onNodeContextMenu(Hn,(0,Bt.F)(Et))},Fe=Dt.useMemo(function(){return!!(Ae.draggable&&(!Ae.draggable.nodeDraggable||Ae.draggable.nodeDraggable(Oe)))},[Ae.draggable,Oe]),He=function(Hn){Hn.stopPropagation(),Lt(!0),Ae.onNodeDragStart(Hn,Et);try{Hn.dataTransfer.setData("text/plain","")}catch(Ai){}},qe=function(Hn){Hn.preventDefault(),Hn.stopPropagation(),Ae.onNodeDragEnter(Hn,Et)},cn=function(Hn){Hn.preventDefault(),Hn.stopPropagation(),Ae.onNodeDragOver(Hn,Et)},gn=function(Hn){Hn.stopPropagation(),Ae.onNodeDragLeave(Hn,Et)},ni=function(Hn){Hn.stopPropagation(),Lt(!1),Ae.onNodeDragEnd(Hn,Et)},ze=function(Hn){Hn.preventDefault(),Hn.stopPropagation(),Lt(!1),Ae.onNodeDrop(Hn,Et)},Ve=function(Hn){Ye||Ae.onNodeExpand(Hn,(0,Bt.F)(Et))},nn=Dt.useMemo(function(){var Xe=(0,Ce.Z)(Ae.keyEntities,Xt)||{},Hn=Xe.children;return!!(Hn||[]).length},[Ae.keyEntities,Xt]),qn=Dt.useMemo(function(){return Pe===!1?!1:Pe||!Ae.loadData&&!nn||Ae.loadData&&Et.loaded&&!nn},[Pe,Ae.loadData,nn,Et.loaded]);Dt.useEffect(function(){Ye||typeof Ae.loadData=="function"&&an&&!qn&&!Et.loaded&&Ae.onNodeLoad((0,Bt.F)(Et))},[Ye,Ae.loadData,Ae.onNodeLoad,an,qn,Et]);var vn=Dt.useMemo(function(){var Xe;return(Xe=Ae.draggable)!==null&&Xe!==void 0&&Xe.icon?Dt.createElement("span",{className:"".concat(Ae.prefixCls,"-draggable-icon")},Ae.draggable.icon):null},[Ae.draggable]),tn=function(Hn){var Ai=Et.switcherIcon||Ae.switcherIcon;return typeof Ai=="function"?Ai((0,ue.Z)((0,ue.Z)({},Et),{},{isLeaf:Hn})):Ai},Rn=function(){if(qn){var Hn=tn(!0);return Hn!==!1?Dt.createElement("span",{className:me()("".concat(Ae.prefixCls,"-switcher"),"".concat(Ae.prefixCls,"-switcher-noop"))},Hn):null}var Ai=tn(!1);return Ai!==!1?Dt.createElement("span",{onClick:Ve,className:me()("".concat(Ae.prefixCls,"-switcher"),"".concat(Ae.prefixCls,"-switcher_").concat(an?et:ht))},Ai):null},gi=Dt.useMemo(function(){if(!Nt)return null;var Xe=typeof Nt!="boolean"?Nt:null;return Dt.createElement("span",{className:me()("".concat(Ae.prefixCls,"-checkbox"),(0,Ut.Z)((0,Ut.Z)((0,Ut.Z)({},"".concat(Ae.prefixCls,"-checkbox-checked"),re),"".concat(Ae.prefixCls,"-checkbox-indeterminate"),!re&&Jt),"".concat(Ae.prefixCls,"-checkbox-disabled"),Pt||Et.disableCheckbox)),onClick:Mt,role:"checkbox","aria-checked":Jt?"mixed":re,"aria-disabled":Pt||Et.disableCheckbox,"aria-label":"Select ".concat(typeof Et.title=="string"?Et.title:"tree node")},Xe)},[Nt,re,Jt,Pt,Et.disableCheckbox,Et.title]),ti=Dt.useMemo(function(){return qn?null:an?et:ht},[qn,an]),vi=Dt.useMemo(function(){return Dt.createElement("span",{className:me()("".concat(Ae.prefixCls,"-iconEle"),"".concat(Ae.prefixCls,"-icon__").concat(ti||"docu"),(0,Ut.Z)({},"".concat(Ae.prefixCls,"-icon_loading"),Ye))})},[Ae.prefixCls,ti,Ye]),Gi=Dt.useMemo(function(){var Xe=!!Ae.draggable,Hn=!Et.disabled&&Xe&&Ae.dragOverNodeKey===Xt;return Hn?Ae.dropIndicatorRender({dropPosition:Ae.dropPosition,dropLevelOffset:Ae.dropLevelOffset,indent:Ae.indent,prefixCls:Ae.prefixCls,direction:Ae.direction}):null},[Ae.dropPosition,Ae.dropLevelOffset,Ae.indent,Ae.prefixCls,Ae.direction,Ae.draggable,Ae.dragOverNodeKey,Ae.dropIndicatorRender]),Fn=Dt.useMemo(function(){var Xe=Et.title,Hn=Xe===void 0?st:Xe,Ai="".concat(Ae.prefixCls,"-node-content-wrapper"),Vi;if(Ae.showIcon){var dr=Et.icon||Ae.icon;Vi=dr?Dt.createElement("span",{className:me()("".concat(Ae.prefixCls,"-iconEle"),"".concat(Ae.prefixCls,"-icon__customize"))},typeof dr=="function"?dr(Et):dr):vi}else Ae.loadData&&Ye&&(Vi=vi);var kr;return typeof Hn=="function"?kr=Hn(Oe):Ae.titleRender?kr=Ae.titleRender(Oe):kr=Hn,Dt.createElement("span",{ref:te,title:typeof Hn=="string"?Hn:"",className:me()(Ai,"".concat(Ai,"-").concat(ti||"normal"),(0,Ut.Z)({},"".concat(Ae.prefixCls,"-node-selected"),!Pt&&(Ke||Rt))),onMouseEnter:Ue,onMouseLeave:we,onContextMenu:Ee,onClick:Ge,onDoubleClick:De},Vi,Dt.createElement("span",{className:"".concat(Ae.prefixCls,"-title")},kr),Gi)},[Ae.prefixCls,Ae.showIcon,Et,Ae.icon,vi,Ae.titleRender,Oe,ti,Ue,we,Ee,Ge,De]),xn=(0,ne.Z)(Vn,{aria:!0,data:!0}),Tn=(0,Ce.Z)(Ae.keyEntities,Xt)||{},ai=Tn.level,pi=_e[_e.length-1],ui=!Pt&&Fe,zi=Ae.draggingNodeKey===Xt,wt=ln!==void 0?{"aria-selected":!!ln}:void 0;return Dt.createElement("div",(0,pt.Z)({ref:Gn,role:"treeitem","aria-expanded":Pe?void 0:an,className:me()(Ht,"".concat(Ae.prefixCls,"-treenode"),($t={},(0,Ut.Z)((0,Ut.Z)((0,Ut.Z)((0,Ut.Z)((0,Ut.Z)((0,Ut.Z)((0,Ut.Z)((0,Ut.Z)((0,Ut.Z)((0,Ut.Z)($t,"".concat(Ae.prefixCls,"-treenode-disabled"),Pt),"".concat(Ae.prefixCls,"-treenode-switcher-").concat(an?"open":"close"),!Pe),"".concat(Ae.prefixCls,"-treenode-checkbox-checked"),re),"".concat(Ae.prefixCls,"-treenode-checkbox-indeterminate"),Jt),"".concat(Ae.prefixCls,"-treenode-selected"),Ke),"".concat(Ae.prefixCls,"-treenode-loading"),Ye),"".concat(Ae.prefixCls,"-treenode-active"),dn),"".concat(Ae.prefixCls,"-treenode-leaf-last"),pi),"".concat(Ae.prefixCls,"-treenode-draggable"),Fe),"dragging",zi),(0,Ut.Z)((0,Ut.Z)((0,Ut.Z)((0,Ut.Z)((0,Ut.Z)((0,Ut.Z)((0,Ut.Z)($t,"drop-target",Ae.dropTargetKey===Xt),"drop-container",Ae.dropContainerKey===Xt),"drag-over",!Pt&&ie),"drag-over-gap-top",!Pt&&Ne),"drag-over-gap-bottom",!Pt&&xe),"filter-node",(Ot=Ae.filterTreeNode)===null||Ot===void 0?void 0:Ot.call(Ae,(0,Bt.F)(Et))),"".concat(Ae.prefixCls,"-treenode-leaf"),qn))),style:ve,draggable:ui,onDragStart:ui?He:void 0,onDragEnter:Fe?qe:void 0,onDragOver:Fe?cn:void 0,onDragLeave:Fe?gn:void 0,onDrop:Fe?ze:void 0,onDragEnd:Fe?ni:void 0,onMouseMove:sn},wt,xn),Dt.createElement(se,{prefixCls:Ae.prefixCls,level:ai,isStart:Qe,isEnd:_e}),vn,Rn(),gi,Fn)};gt.isTreeNode=1;var vt=gt},30699:function(Bn,zn,kt){"use strict";kt.d(zn,{k:function(){return Ut},y:function(){return ue}});var pt=kt(59301),Ut=pt.createContext(null),ue=pt.createContext({})},28390:function(Bn,zn,kt){"use strict";kt.d(zn,{OF:function(){return Xt.Z},y6:function(){return ht.y},ZP:function(){return Pt}});var pt=kt(5016),Ut=kt(10928),ue=kt(20049),Le=kt(92393),he=kt(6487),Dt=kt(56789),qt=kt(41281),me=kt(7942),ne=kt(76773),jt=kt(18082),Te=kt(92310),se=kt.n(Te),Ce=kt(10228),Bt=kt(26112),nt=kt(48736),et=kt(59301),ht=kt(30699),st=function(Zt){var Mt=Zt.dropPosition,Yt=Zt.dropLevelOffset,Ge=Zt.indent,De={pointerEvents:"none",position:"absolute",right:0,backgroundColor:"red",height:2};switch(Mt){case-1:De.top=0,De.left=-Yt*Ge;break;case 1:De.bottom=0,De.left=-Yt*Ge;break;case 0:De.bottom=0,De.left=Ge;break}return et.createElement("div",{style:De})},gt=st;function vt(Nt){if(Nt==null)throw new TypeError("Cannot destructure "+Nt)}var St=kt(52456),Et=kt(5883),Tt=kt(34280),Ot=kt(65283),$t=kt(77900),Xt=kt(639);function Ht(Nt,Zt){var Mt=et.useState(!1),Yt=(0,St.Z)(Mt,2),Ge=Yt[0],De=Yt[1];(0,Tt.Z)(function(){if(Ge)return Nt(),function(){Zt()}},[Ge]),(0,Tt.Z)(function(){return De(!0),function(){De(!1)}},[])}var ve=Ht,ie=kt(34061),Ne=["className","style","motion","motionNodes","motionType","onMotionStart","onMotionEnd","active","treeNodeRequiredProps"],xe=et.forwardRef(function(Nt,Zt){var Mt=Nt.className,Yt=Nt.style,Ge=Nt.motion,De=Nt.motionNodes,Ue=Nt.motionType,we=Nt.onMotionStart,Ee=Nt.onMotionEnd,Fe=Nt.active,He=Nt.treeNodeRequiredProps,qe=(0,Et.Z)(Nt,Ne),cn=et.useState(!0),gn=(0,St.Z)(cn,2),ni=gn[0],ze=gn[1],Ve=et.useContext(ht.k),nn=Ve.prefixCls,qn=De&&Ue!=="hide";(0,Tt.Z)(function(){De&&qn!==ni&&ze(qn)},[De]);var vn=function(){De&&we()},tn=et.useRef(!1),Rn=function(){De&&!tn.current&&(tn.current=!0,Ee())};ve(vn,Rn);var gi=function(vi){qn===vi&&Rn()};return De?et.createElement($t.default,(0,pt.Z)({ref:Zt,visible:ni},Ge,{motionAppear:Ue==="show",onVisibleChanged:gi}),function(ti,vi){var Gi=ti.className,Fn=ti.style;return et.createElement("div",{ref:vi,className:se()("".concat(nn,"-treenode-motion"),Gi),style:Fn},De.map(function(xn){var Tn=Object.assign({},(vt(xn.data),xn.data)),ai=xn.title,pi=xn.key,ui=xn.isStart,zi=xn.isEnd;delete Tn.children;var wt=(0,ie.H8)(pi,He);return et.createElement(Xt.Z,(0,pt.Z)({},Tn,wt,{title:ai,active:Fe,data:xn.data,key:pi,isStart:ui,isEnd:zi}))}))}):et.createElement(Xt.Z,(0,pt.Z)({domRef:Zt,className:Mt,style:Yt},qe,{active:Fe}))}),Pe=xe;function Qe(){var Nt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],Zt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],Mt=Nt.length,Yt=Zt.length;if(Math.abs(Mt-Yt)!==1)return{add:!1,key:null};function Ge(De,Ue){var we=new Map;De.forEach(function(Fe){we.set(Fe,!0)});var Ee=Ue.filter(function(Fe){return!we.has(Fe)});return Ee.length===1?Ee[0]:null}return Mt<Yt?{add:!0,key:Ge(Nt,Zt)}:{add:!1,key:Ge(Zt,Nt)}}function _e(Nt,Zt,Mt){var Yt=Nt.findIndex(function(we){return we.key===Mt}),Ge=Nt[Yt+1],De=Zt.findIndex(function(we){return we.key===Mt});if(Ge){var Ue=Zt.findIndex(function(we){return we.key===Ge.key});return Zt.slice(De+1,Ue)}return Zt.slice(De+1)}var an=["prefixCls","data","selectable","checkable","expandedKeys","selectedKeys","checkedKeys","loadedKeys","loadingKeys","halfCheckedKeys","keyEntities","disabled","dragging","dragOverNodeKey","dropPosition","motion","height","itemHeight","virtual","scrollWidth","focusable","activeItem","focused","tabIndex","onKeyDown","onFocus","onBlur","onActiveChange","onListChangeStart","onListChangeEnd"],Ke={width:0,height:0,display:"flex",overflow:"hidden",opacity:0,border:0,padding:0,margin:0},re=function(){},Jt="RC_TREE_MOTION_".concat(Math.random()),Ye={key:Jt},Gn={key:Jt,level:0,index:0,pos:"0",node:Ye,nodes:[Ye]},dn={parent:null,children:[],pos:Gn.pos,data:Ye,title:null,key:Jt,isStart:[],isEnd:[]};function Oe(Nt,Zt,Mt,Yt){return Zt===!1||!Mt?Nt:Nt.slice(0,Math.ceil(Mt/Yt)+1)}function sn(Nt){var Zt=Nt.key,Mt=Nt.pos;return(0,ie.km)(Zt,Mt)}function ln(Nt){for(var Zt=String(Nt.data.key),Mt=Nt;Mt.parent;)Mt=Mt.parent,Zt="".concat(Mt.data.key," > ").concat(Zt);return Zt}var Vn=et.forwardRef(function(Nt,Zt){var Mt=Nt.prefixCls,Yt=Nt.data,Ge=Nt.selectable,De=Nt.checkable,Ue=Nt.expandedKeys,we=Nt.selectedKeys,Ee=Nt.checkedKeys,Fe=Nt.loadedKeys,He=Nt.loadingKeys,qe=Nt.halfCheckedKeys,cn=Nt.keyEntities,gn=Nt.disabled,ni=Nt.dragging,ze=Nt.dragOverNodeKey,Ve=Nt.dropPosition,nn=Nt.motion,qn=Nt.height,vn=Nt.itemHeight,tn=Nt.virtual,Rn=Nt.scrollWidth,gi=Nt.focusable,ti=Nt.activeItem,vi=Nt.focused,Gi=Nt.tabIndex,Fn=Nt.onKeyDown,xn=Nt.onFocus,Tn=Nt.onBlur,ai=Nt.onActiveChange,pi=Nt.onListChangeStart,ui=Nt.onListChangeEnd,zi=(0,Et.Z)(Nt,an),wt=et.useRef(null),Xe=et.useRef(null);et.useImperativeHandle(Zt,function(){return{scrollTo:function(_n){wt.current.scrollTo(_n)},getIndentWidth:function(){return Xe.current.offsetWidth}}});var Hn=et.useState(Ue),Ai=(0,St.Z)(Hn,2),Vi=Ai[0],dr=Ai[1],kr=et.useState(Yt),ci=(0,St.Z)(kr,2),In=ci[0],pe=ci[1],Se=et.useState(Yt),ye=(0,St.Z)(Se,2),jn=ye[0],Ln=ye[1],Kn=et.useState([]),Je=(0,St.Z)(Kn,2),An=Je[0],yi=Je[1],Ei=et.useState(null),Xi=(0,St.Z)(Ei,2),Gt=Xi[0],de=Xi[1],un=et.useRef(Yt);un.current=Yt;function Mn(){var bn=un.current;pe(bn),Ln(bn),yi([]),de(null),ui()}(0,Tt.Z)(function(){dr(Ue);var bn=Qe(Vi,Ue);if(bn.key!==null)if(bn.add){var _n=In.findIndex(function(Ti){var Di=Ti.key;return Di===bn.key}),hi=Oe(_e(In,Yt,bn.key),tn,qn,vn),Yn=In.slice();Yn.splice(_n+1,0,dn),Ln(Yn),yi(hi),de("show")}else{var si=Yt.findIndex(function(Ti){var Di=Ti.key;return Di===bn.key}),ei=Oe(_e(Yt,In,bn.key),tn,qn,vn),Ii=Yt.slice();Ii.splice(si+1,0,dn),Ln(Ii),yi(ei),de("hide")}else In!==Yt&&(pe(Yt),Ln(Yt))},[Ue,Yt]),et.useEffect(function(){ni||Mn()},[ni]);var Ie=nn?jn:Yt,$e={expandedKeys:Ue,selectedKeys:we,loadedKeys:Fe,loadingKeys:He,checkedKeys:Ee,halfCheckedKeys:qe,dragOverNodeKey:ze,dropPosition:Ve,keyEntities:cn};return et.createElement(et.Fragment,null,vi&&ti&&et.createElement("span",{style:Ke,"aria-live":"assertive"},ln(ti)),et.createElement("div",null,et.createElement("input",{style:Ke,disabled:gi===!1||gn,tabIndex:gi!==!1?Gi:null,onKeyDown:Fn,onFocus:xn,onBlur:Tn,value:"",onChange:re,"aria-label":"for screen reader"})),et.createElement("div",{className:"".concat(Mt,"-treenode"),"aria-hidden":!0,style:{position:"absolute",pointerEvents:"none",visibility:"hidden",height:0,overflow:"hidden",border:0,padding:0}},et.createElement("div",{className:"".concat(Mt,"-indent")},et.createElement("div",{ref:Xe,className:"".concat(Mt,"-indent-unit")}))),et.createElement(Ot.Z,(0,pt.Z)({},zi,{data:Ie,itemKey:sn,height:qn,fullHeight:!1,virtual:tn,itemHeight:vn,scrollWidth:Rn,prefixCls:"".concat(Mt,"-list"),ref:wt,role:"tree",onVisibleChange:function(_n){_n.every(function(hi){return sn(hi)!==Jt})&&Mn()}}),function(bn){var _n=bn.pos,hi=Object.assign({},(vt(bn.data),bn.data)),Yn=bn.title,si=bn.key,ei=bn.isStart,Ii=bn.isEnd,Ti=(0,ie.km)(si,_n);delete hi.key,delete hi.children;var Di=(0,ie.H8)(Ti,$e);return et.createElement(Pe,(0,pt.Z)({},hi,Di,{title:Yn,active:!!ti&&si===ti.key,pos:_n,data:bn.data,isStart:ei,isEnd:Ii,motion:nn,motionNodes:si===Jt?An:null,motionType:Gt,onMotionStart:pi,onMotionEnd:Mn,treeNodeRequiredProps:$e,onMouseMove:function(){ai(null)}}))}))}),Ae=Vn,yn=kt(82661),te=kt(34643),En=kt(65065),ri=10,Rt=function(Nt){(0,me.Z)(Mt,Nt);var Zt=(0,ne.Z)(Mt);function Mt(){var Yt;(0,he.Z)(this,Mt);for(var Ge=arguments.length,De=new Array(Ge),Ue=0;Ue<Ge;Ue++)De[Ue]=arguments[Ue];return Yt=Zt.call.apply(Zt,[this].concat(De)),(0,jt.Z)((0,qt.Z)(Yt),"destroyed",!1),(0,jt.Z)((0,qt.Z)(Yt),"delayedDragEnterLogic",void 0),(0,jt.Z)((0,qt.Z)(Yt),"loadingRetryTimes",{}),(0,jt.Z)((0,qt.Z)(Yt),"state",{keyEntities:{},indent:null,selectedKeys:[],checkedKeys:[],halfCheckedKeys:[],loadedKeys:[],loadingKeys:[],expandedKeys:[],draggingNodeKey:null,dragChildrenKeys:[],dropTargetKey:null,dropPosition:null,dropContainerKey:null,dropLevelOffset:null,dropTargetPos:null,dropAllowed:!0,dragOverNodeKey:null,treeData:[],flattenNodes:[],focused:!1,activeKey:null,listChanging:!1,prevProps:null,fieldNames:(0,ie.w$)()}),(0,jt.Z)((0,qt.Z)(Yt),"dragStartMousePosition",null),(0,jt.Z)((0,qt.Z)(Yt),"dragNodeProps",null),(0,jt.Z)((0,qt.Z)(Yt),"currentMouseOverDroppableNodeKey",null),(0,jt.Z)((0,qt.Z)(Yt),"listRef",et.createRef()),(0,jt.Z)((0,qt.Z)(Yt),"onNodeDragStart",function(we,Ee){var Fe=Yt.state,He=Fe.expandedKeys,qe=Fe.keyEntities,cn=Yt.props.onDragStart,gn=Ee.eventKey;Yt.dragNodeProps=Ee,Yt.dragStartMousePosition={x:we.clientX,y:we.clientY};var ni=(0,yn._5)(He,gn);Yt.setState({draggingNodeKey:gn,dragChildrenKeys:(0,yn.wA)(gn,qe),indent:Yt.listRef.current.getIndentWidth()}),Yt.setExpandedKeys(ni),window.addEventListener("dragend",Yt.onWindowDragEnd),cn==null||cn({event:we,node:(0,ie.F)(Ee)})}),(0,jt.Z)((0,qt.Z)(Yt),"onNodeDragEnter",function(we,Ee){var Fe=Yt.state,He=Fe.expandedKeys,qe=Fe.keyEntities,cn=Fe.dragChildrenKeys,gn=Fe.flattenNodes,ni=Fe.indent,ze=Yt.props,Ve=ze.onDragEnter,nn=ze.onExpand,qn=ze.allowDrop,vn=ze.direction,tn=Ee.pos,Rn=Ee.eventKey;if(Yt.currentMouseOverDroppableNodeKey!==Rn&&(Yt.currentMouseOverDroppableNodeKey=Rn),!Yt.dragNodeProps){Yt.resetDragState();return}var gi=(0,yn.OM)(we,Yt.dragNodeProps,Ee,ni,Yt.dragStartMousePosition,qn,gn,qe,He,vn),ti=gi.dropPosition,vi=gi.dropLevelOffset,Gi=gi.dropTargetKey,Fn=gi.dropContainerKey,xn=gi.dropTargetPos,Tn=gi.dropAllowed,ai=gi.dragOverNodeKey;if(cn.includes(Gi)||!Tn){Yt.resetDragState();return}if(Yt.delayedDragEnterLogic||(Yt.delayedDragEnterLogic={}),Object.keys(Yt.delayedDragEnterLogic).forEach(function(pi){clearTimeout(Yt.delayedDragEnterLogic[pi])}),Yt.dragNodeProps.eventKey!==Ee.eventKey&&(we.persist(),Yt.delayedDragEnterLogic[tn]=window.setTimeout(function(){if(Yt.state.draggingNodeKey!==null){var pi=(0,Le.Z)(He),ui=(0,En.Z)(qe,Ee.eventKey);ui&&(ui.children||[]).length&&(pi=(0,yn.L0)(He,Ee.eventKey)),Yt.props.hasOwnProperty("expandedKeys")||Yt.setExpandedKeys(pi),nn==null||nn(pi,{node:(0,ie.F)(Ee),expanded:!0,nativeEvent:we.nativeEvent})}},800)),Yt.dragNodeProps.eventKey===Gi&&vi===0){Yt.resetDragState();return}Yt.setState({dragOverNodeKey:ai,dropPosition:ti,dropLevelOffset:vi,dropTargetKey:Gi,dropContainerKey:Fn,dropTargetPos:xn,dropAllowed:Tn}),Ve==null||Ve({event:we,node:(0,ie.F)(Ee),expandedKeys:He})}),(0,jt.Z)((0,qt.Z)(Yt),"onNodeDragOver",function(we,Ee){var Fe=Yt.state,He=Fe.dragChildrenKeys,qe=Fe.flattenNodes,cn=Fe.keyEntities,gn=Fe.expandedKeys,ni=Fe.indent,ze=Yt.props,Ve=ze.onDragOver,nn=ze.allowDrop,qn=ze.direction;if(Yt.dragNodeProps){var vn=(0,yn.OM)(we,Yt.dragNodeProps,Ee,ni,Yt.dragStartMousePosition,nn,qe,cn,gn,qn),tn=vn.dropPosition,Rn=vn.dropLevelOffset,gi=vn.dropTargetKey,ti=vn.dropContainerKey,vi=vn.dropTargetPos,Gi=vn.dropAllowed,Fn=vn.dragOverNodeKey;He.includes(gi)||!Gi||(Yt.dragNodeProps.eventKey===gi&&Rn===0?Yt.state.dropPosition===null&&Yt.state.dropLevelOffset===null&&Yt.state.dropTargetKey===null&&Yt.state.dropContainerKey===null&&Yt.state.dropTargetPos===null&&Yt.state.dropAllowed===!1&&Yt.state.dragOverNodeKey===null||Yt.resetDragState():tn===Yt.state.dropPosition&&Rn===Yt.state.dropLevelOffset&&gi===Yt.state.dropTargetKey&&ti===Yt.state.dropContainerKey&&vi===Yt.state.dropTargetPos&&Gi===Yt.state.dropAllowed&&Fn===Yt.state.dragOverNodeKey||Yt.setState({dropPosition:tn,dropLevelOffset:Rn,dropTargetKey:gi,dropContainerKey:ti,dropTargetPos:vi,dropAllowed:Gi,dragOverNodeKey:Fn}),Ve==null||Ve({event:we,node:(0,ie.F)(Ee)}))}}),(0,jt.Z)((0,qt.Z)(Yt),"onNodeDragLeave",function(we,Ee){Yt.currentMouseOverDroppableNodeKey===Ee.eventKey&&!we.currentTarget.contains(we.relatedTarget)&&(Yt.resetDragState(),Yt.currentMouseOverDroppableNodeKey=null);var Fe=Yt.props.onDragLeave;Fe==null||Fe({event:we,node:(0,ie.F)(Ee)})}),(0,jt.Z)((0,qt.Z)(Yt),"onWindowDragEnd",function(we){Yt.onNodeDragEnd(we,null,!0),window.removeEventListener("dragend",Yt.onWindowDragEnd)}),(0,jt.Z)((0,qt.Z)(Yt),"onNodeDragEnd",function(we,Ee){var Fe=Yt.props.onDragEnd;Yt.setState({dragOverNodeKey:null}),Yt.cleanDragState(),Fe==null||Fe({event:we,node:(0,ie.F)(Ee)}),Yt.dragNodeProps=null,window.removeEventListener("dragend",Yt.onWindowDragEnd)}),(0,jt.Z)((0,qt.Z)(Yt),"onNodeDrop",function(we,Ee){var Fe,He=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,qe=Yt.state,cn=qe.dragChildrenKeys,gn=qe.dropPosition,ni=qe.dropTargetKey,ze=qe.dropTargetPos,Ve=qe.dropAllowed;if(Ve){var nn=Yt.props.onDrop;if(Yt.setState({dragOverNodeKey:null}),Yt.cleanDragState(),ni!==null){var qn=(0,ue.Z)((0,ue.Z)({},(0,ie.H8)(ni,Yt.getTreeNodeRequiredProps())),{},{active:((Fe=Yt.getActiveItem())===null||Fe===void 0?void 0:Fe.key)===ni,data:(0,En.Z)(Yt.state.keyEntities,ni).node}),vn=cn.includes(ni);(0,nt.ZP)(!vn,"Can not drop to dragNode's children node. This is a bug of rc-tree. Please report an issue.");var tn=(0,yn.yx)(ze),Rn={event:we,node:(0,ie.F)(qn),dragNode:Yt.dragNodeProps?(0,ie.F)(Yt.dragNodeProps):null,dragNodesKeys:[Yt.dragNodeProps.eventKey].concat(cn),dropToGap:gn!==0,dropPosition:gn+Number(tn[tn.length-1])};He||nn==null||nn(Rn),Yt.dragNodeProps=null}}}),(0,jt.Z)((0,qt.Z)(Yt),"cleanDragState",function(){var we=Yt.state.draggingNodeKey;we!==null&&Yt.setState({draggingNodeKey:null,dropPosition:null,dropContainerKey:null,dropTargetKey:null,dropLevelOffset:null,dropAllowed:!0,dragOverNodeKey:null}),Yt.dragStartMousePosition=null,Yt.currentMouseOverDroppableNodeKey=null}),(0,jt.Z)((0,qt.Z)(Yt),"triggerExpandActionExpand",function(we,Ee){var Fe=Yt.state,He=Fe.expandedKeys,qe=Fe.flattenNodes,cn=Ee.expanded,gn=Ee.key,ni=Ee.isLeaf;if(!(ni||we.shiftKey||we.metaKey||we.ctrlKey)){var ze=qe.filter(function(nn){return nn.key===gn})[0],Ve=(0,ie.F)((0,ue.Z)((0,ue.Z)({},(0,ie.H8)(gn,Yt.getTreeNodeRequiredProps())),{},{data:ze.data}));Yt.setExpandedKeys(cn?(0,yn._5)(He,gn):(0,yn.L0)(He,gn)),Yt.onNodeExpand(we,Ve)}}),(0,jt.Z)((0,qt.Z)(Yt),"onNodeClick",function(we,Ee){var Fe=Yt.props,He=Fe.onClick,qe=Fe.expandAction;qe==="click"&&Yt.triggerExpandActionExpand(we,Ee),He==null||He(we,Ee)}),(0,jt.Z)((0,qt.Z)(Yt),"onNodeDoubleClick",function(we,Ee){var Fe=Yt.props,He=Fe.onDoubleClick,qe=Fe.expandAction;qe==="doubleClick"&&Yt.triggerExpandActionExpand(we,Ee),He==null||He(we,Ee)}),(0,jt.Z)((0,qt.Z)(Yt),"onNodeSelect",function(we,Ee){var Fe=Yt.state.selectedKeys,He=Yt.state,qe=He.keyEntities,cn=He.fieldNames,gn=Yt.props,ni=gn.onSelect,ze=gn.multiple,Ve=Ee.selected,nn=Ee[cn.key],qn=!Ve;qn?ze?Fe=(0,yn.L0)(Fe,nn):Fe=[nn]:Fe=(0,yn._5)(Fe,nn);var vn=Fe.map(function(tn){var Rn=(0,En.Z)(qe,tn);return Rn?Rn.node:null}).filter(Boolean);Yt.setUncontrolledState({selectedKeys:Fe}),ni==null||ni(Fe,{event:"select",selected:qn,node:Ee,selectedNodes:vn,nativeEvent:we.nativeEvent})}),(0,jt.Z)((0,qt.Z)(Yt),"onNodeCheck",function(we,Ee,Fe){var He=Yt.state,qe=He.keyEntities,cn=He.checkedKeys,gn=He.halfCheckedKeys,ni=Yt.props,ze=ni.checkStrictly,Ve=ni.onCheck,nn=Ee.key,qn,vn={event:"check",node:Ee,checked:Fe,nativeEvent:we.nativeEvent};if(ze){var tn=Fe?(0,yn.L0)(cn,nn):(0,yn._5)(cn,nn),Rn=(0,yn._5)(gn,nn);qn={checked:tn,halfChecked:Rn},vn.checkedNodes=tn.map(function(xn){return(0,En.Z)(qe,xn)}).filter(Boolean).map(function(xn){return xn.node}),Yt.setUncontrolledState({checkedKeys:tn})}else{var gi=(0,te.S)([].concat((0,Le.Z)(cn),[nn]),!0,qe),ti=gi.checkedKeys,vi=gi.halfCheckedKeys;if(!Fe){var Gi=new Set(ti);Gi.delete(nn);var Fn=(0,te.S)(Array.from(Gi),{checked:!1,halfCheckedKeys:vi},qe);ti=Fn.checkedKeys,vi=Fn.halfCheckedKeys}qn=ti,vn.checkedNodes=[],vn.checkedNodesPositions=[],vn.halfCheckedKeys=vi,ti.forEach(function(xn){var Tn=(0,En.Z)(qe,xn);if(Tn){var ai=Tn.node,pi=Tn.pos;vn.checkedNodes.push(ai),vn.checkedNodesPositions.push({node:ai,pos:pi})}}),Yt.setUncontrolledState({checkedKeys:ti},!1,{halfCheckedKeys:vi})}Ve==null||Ve(qn,vn)}),(0,jt.Z)((0,qt.Z)(Yt),"onNodeLoad",function(we){var Ee,Fe=we.key,He=Yt.state.keyEntities,qe=(0,En.Z)(He,Fe);if(!(qe!=null&&(Ee=qe.children)!==null&&Ee!==void 0&&Ee.length)){var cn=new Promise(function(gn,ni){Yt.setState(function(ze){var Ve=ze.loadedKeys,nn=Ve===void 0?[]:Ve,qn=ze.loadingKeys,vn=qn===void 0?[]:qn,tn=Yt.props,Rn=tn.loadData,gi=tn.onLoad;if(!Rn||nn.includes(Fe)||vn.includes(Fe))return null;var ti=Rn(we);return ti.then(function(){var vi=Yt.state.loadedKeys,Gi=(0,yn.L0)(vi,Fe);gi==null||gi(Gi,{event:"load",node:we}),Yt.setUncontrolledState({loadedKeys:Gi}),Yt.setState(function(Fn){return{loadingKeys:(0,yn._5)(Fn.loadingKeys,Fe)}}),gn()}).catch(function(vi){if(Yt.setState(function(Fn){return{loadingKeys:(0,yn._5)(Fn.loadingKeys,Fe)}}),Yt.loadingRetryTimes[Fe]=(Yt.loadingRetryTimes[Fe]||0)+1,Yt.loadingRetryTimes[Fe]>=ri){var Gi=Yt.state.loadedKeys;(0,nt.ZP)(!1,"Retry for `loadData` many times but still failed. No more retry."),Yt.setUncontrolledState({loadedKeys:(0,yn.L0)(Gi,Fe)}),gn()}ni(vi)}),{loadingKeys:(0,yn.L0)(vn,Fe)}})});return cn.catch(function(){}),cn}}),(0,jt.Z)((0,qt.Z)(Yt),"onNodeMouseEnter",function(we,Ee){var Fe=Yt.props.onMouseEnter;Fe==null||Fe({event:we,node:Ee})}),(0,jt.Z)((0,qt.Z)(Yt),"onNodeMouseLeave",function(we,Ee){var Fe=Yt.props.onMouseLeave;Fe==null||Fe({event:we,node:Ee})}),(0,jt.Z)((0,qt.Z)(Yt),"onNodeContextMenu",function(we,Ee){var Fe=Yt.props.onRightClick;Fe&&(we.preventDefault(),Fe({event:we,node:Ee}))}),(0,jt.Z)((0,qt.Z)(Yt),"onFocus",function(){var we=Yt.props.onFocus;Yt.setState({focused:!0});for(var Ee=arguments.length,Fe=new Array(Ee),He=0;He<Ee;He++)Fe[He]=arguments[He];we==null||we.apply(void 0,Fe)}),(0,jt.Z)((0,qt.Z)(Yt),"onBlur",function(){var we=Yt.props.onBlur;Yt.setState({focused:!1}),Yt.onActiveChange(null);for(var Ee=arguments.length,Fe=new Array(Ee),He=0;He<Ee;He++)Fe[He]=arguments[He];we==null||we.apply(void 0,Fe)}),(0,jt.Z)((0,qt.Z)(Yt),"getTreeNodeRequiredProps",function(){var we=Yt.state,Ee=we.expandedKeys,Fe=we.selectedKeys,He=we.loadedKeys,qe=we.loadingKeys,cn=we.checkedKeys,gn=we.halfCheckedKeys,ni=we.dragOverNodeKey,ze=we.dropPosition,Ve=we.keyEntities;return{expandedKeys:Ee||[],selectedKeys:Fe||[],loadedKeys:He||[],loadingKeys:qe||[],checkedKeys:cn||[],halfCheckedKeys:gn||[],dragOverNodeKey:ni,dropPosition:ze,keyEntities:Ve}}),(0,jt.Z)((0,qt.Z)(Yt),"setExpandedKeys",function(we){var Ee=Yt.state,Fe=Ee.treeData,He=Ee.fieldNames,qe=(0,ie.oH)(Fe,we,He);Yt.setUncontrolledState({expandedKeys:we,flattenNodes:qe},!0)}),(0,jt.Z)((0,qt.Z)(Yt),"onNodeExpand",function(we,Ee){var Fe=Yt.state.expandedKeys,He=Yt.state,qe=He.listChanging,cn=He.fieldNames,gn=Yt.props,ni=gn.onExpand,ze=gn.loadData,Ve=Ee.expanded,nn=Ee[cn.key];if(!qe){var qn=Fe.includes(nn),vn=!Ve;if((0,nt.ZP)(Ve&&qn||!Ve&&!qn,"Expand state not sync with index check"),Fe=vn?(0,yn.L0)(Fe,nn):(0,yn._5)(Fe,nn),Yt.setExpandedKeys(Fe),ni==null||ni(Fe,{node:Ee,expanded:vn,nativeEvent:we.nativeEvent}),vn&&ze){var tn=Yt.onNodeLoad(Ee);tn&&tn.then(function(){var Rn=(0,ie.oH)(Yt.state.treeData,Fe,cn);Yt.setUncontrolledState({flattenNodes:Rn})}).catch(function(){var Rn=Yt.state.expandedKeys,gi=(0,yn._5)(Rn,nn);Yt.setExpandedKeys(gi)})}}}),(0,jt.Z)((0,qt.Z)(Yt),"onListChangeStart",function(){Yt.setUncontrolledState({listChanging:!0})}),(0,jt.Z)((0,qt.Z)(Yt),"onListChangeEnd",function(){setTimeout(function(){Yt.setUncontrolledState({listChanging:!1})})}),(0,jt.Z)((0,qt.Z)(Yt),"onActiveChange",function(we){var Ee=Yt.state.activeKey,Fe=Yt.props,He=Fe.onActiveChange,qe=Fe.itemScrollOffset,cn=qe===void 0?0:qe;Ee!==we&&(Yt.setState({activeKey:we}),we!==null&&Yt.scrollTo({key:we,offset:cn}),He==null||He(we))}),(0,jt.Z)((0,qt.Z)(Yt),"getActiveItem",function(){var we=Yt.state,Ee=we.activeKey,Fe=we.flattenNodes;return Ee===null?null:Fe.find(function(He){var qe=He.key;return qe===Ee})||null}),(0,jt.Z)((0,qt.Z)(Yt),"offsetActiveKey",function(we){var Ee=Yt.state,Fe=Ee.flattenNodes,He=Ee.activeKey,qe=Fe.findIndex(function(ni){var ze=ni.key;return ze===He});qe===-1&&we<0&&(qe=Fe.length),qe=(qe+we+Fe.length)%Fe.length;var cn=Fe[qe];if(cn){var gn=cn.key;Yt.onActiveChange(gn)}else Yt.onActiveChange(null)}),(0,jt.Z)((0,qt.Z)(Yt),"onKeyDown",function(we){var Ee=Yt.state,Fe=Ee.activeKey,He=Ee.expandedKeys,qe=Ee.checkedKeys,cn=Ee.fieldNames,gn=Yt.props,ni=gn.onKeyDown,ze=gn.checkable,Ve=gn.selectable;switch(we.which){case Ce.Z.UP:{Yt.offsetActiveKey(-1),we.preventDefault();break}case Ce.Z.DOWN:{Yt.offsetActiveKey(1),we.preventDefault();break}}var nn=Yt.getActiveItem();if(nn&&nn.data){var qn=Yt.getTreeNodeRequiredProps(),vn=nn.data.isLeaf===!1||!!(nn.data[cn.children]||[]).length,tn=(0,ie.F)((0,ue.Z)((0,ue.Z)({},(0,ie.H8)(Fe,qn)),{},{data:nn.data,active:!0}));switch(we.which){case Ce.Z.LEFT:{vn&&He.includes(Fe)?Yt.onNodeExpand({},tn):nn.parent&&Yt.onActiveChange(nn.parent.key),we.preventDefault();break}case Ce.Z.RIGHT:{vn&&!He.includes(Fe)?Yt.onNodeExpand({},tn):nn.children&&nn.children.length&&Yt.onActiveChange(nn.children[0].key),we.preventDefault();break}case Ce.Z.ENTER:case Ce.Z.SPACE:{ze&&!tn.disabled&&tn.checkable!==!1&&!tn.disableCheckbox?Yt.onNodeCheck({},tn,!qe.includes(Fe)):!ze&&Ve&&!tn.disabled&&tn.selectable!==!1&&Yt.onNodeSelect({},tn);break}}}ni==null||ni(we)}),(0,jt.Z)((0,qt.Z)(Yt),"setUncontrolledState",function(we){var Ee=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Fe=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;if(!Yt.destroyed){var He=!1,qe=!0,cn={};Object.keys(we).forEach(function(gn){if(Yt.props.hasOwnProperty(gn)){qe=!1;return}He=!0,cn[gn]=we[gn]}),He&&(!Ee||qe)&&Yt.setState((0,ue.Z)((0,ue.Z)({},cn),Fe))}}),(0,jt.Z)((0,qt.Z)(Yt),"scrollTo",function(we){Yt.listRef.current.scrollTo(we)}),Yt}return(0,Dt.Z)(Mt,[{key:"componentDidMount",value:function(){this.destroyed=!1,this.onUpdated()}},{key:"componentDidUpdate",value:function(){this.onUpdated()}},{key:"onUpdated",value:function(){var Ge=this.props,De=Ge.activeKey,Ue=Ge.itemScrollOffset,we=Ue===void 0?0:Ue;De!==void 0&&De!==this.state.activeKey&&(this.setState({activeKey:De}),De!==null&&this.scrollTo({key:De,offset:we}))}},{key:"componentWillUnmount",value:function(){window.removeEventListener("dragend",this.onWindowDragEnd),this.destroyed=!0}},{key:"resetDragState",value:function(){this.setState({dragOverNodeKey:null,dropPosition:null,dropLevelOffset:null,dropTargetKey:null,dropContainerKey:null,dropTargetPos:null,dropAllowed:!1})}},{key:"render",value:function(){var Ge=this.state,De=Ge.focused,Ue=Ge.flattenNodes,we=Ge.keyEntities,Ee=Ge.draggingNodeKey,Fe=Ge.activeKey,He=Ge.dropLevelOffset,qe=Ge.dropContainerKey,cn=Ge.dropTargetKey,gn=Ge.dropPosition,ni=Ge.dragOverNodeKey,ze=Ge.indent,Ve=this.props,nn=Ve.prefixCls,qn=Ve.className,vn=Ve.style,tn=Ve.showLine,Rn=Ve.focusable,gi=Ve.tabIndex,ti=gi===void 0?0:gi,vi=Ve.selectable,Gi=Ve.showIcon,Fn=Ve.icon,xn=Ve.switcherIcon,Tn=Ve.draggable,ai=Ve.checkable,pi=Ve.checkStrictly,ui=Ve.disabled,zi=Ve.motion,wt=Ve.loadData,Xe=Ve.filterTreeNode,Hn=Ve.height,Ai=Ve.itemHeight,Vi=Ve.scrollWidth,dr=Ve.virtual,kr=Ve.titleRender,ci=Ve.dropIndicatorRender,In=Ve.onContextMenu,pe=Ve.onScroll,Se=Ve.direction,ye=Ve.rootClassName,jn=Ve.rootStyle,Ln=(0,Bt.Z)(this.props,{aria:!0,data:!0}),Kn;Tn&&((0,Ut.Z)(Tn)==="object"?Kn=Tn:typeof Tn=="function"?Kn={nodeDraggable:Tn}:Kn={});var Je={prefixCls:nn,selectable:vi,showIcon:Gi,icon:Fn,switcherIcon:xn,draggable:Kn,draggingNodeKey:Ee,checkable:ai,checkStrictly:pi,disabled:ui,keyEntities:we,dropLevelOffset:He,dropContainerKey:qe,dropTargetKey:cn,dropPosition:gn,dragOverNodeKey:ni,indent:ze,direction:Se,dropIndicatorRender:ci,loadData:wt,filterTreeNode:Xe,titleRender:kr,onNodeClick:this.onNodeClick,onNodeDoubleClick:this.onNodeDoubleClick,onNodeExpand:this.onNodeExpand,onNodeSelect:this.onNodeSelect,onNodeCheck:this.onNodeCheck,onNodeLoad:this.onNodeLoad,onNodeMouseEnter:this.onNodeMouseEnter,onNodeMouseLeave:this.onNodeMouseLeave,onNodeContextMenu:this.onNodeContextMenu,onNodeDragStart:this.onNodeDragStart,onNodeDragEnter:this.onNodeDragEnter,onNodeDragOver:this.onNodeDragOver,onNodeDragLeave:this.onNodeDragLeave,onNodeDragEnd:this.onNodeDragEnd,onNodeDrop:this.onNodeDrop};return et.createElement(ht.k.Provider,{value:Je},et.createElement("div",{className:se()(nn,qn,ye,(0,jt.Z)((0,jt.Z)((0,jt.Z)({},"".concat(nn,"-show-line"),tn),"".concat(nn,"-focused"),De),"".concat(nn,"-active-focused"),Fe!==null)),style:jn},et.createElement(Ae,(0,pt.Z)({ref:this.listRef,prefixCls:nn,style:vn,data:Ue,disabled:ui,selectable:vi,checkable:!!ai,motion:zi,dragging:Ee!==null,height:Hn,itemHeight:Ai,virtual:dr,focusable:Rn,focused:De,tabIndex:ti,activeItem:this.getActiveItem(),onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:this.onKeyDown,onActiveChange:this.onActiveChange,onListChangeStart:this.onListChangeStart,onListChangeEnd:this.onListChangeEnd,onContextMenu:In,onScroll:pe,scrollWidth:Vi},this.getTreeNodeRequiredProps(),Ln))))}}],[{key:"getDerivedStateFromProps",value:function(Ge,De){var Ue=De.prevProps,we={prevProps:Ge};function Ee(ti){return!Ue&&Ge.hasOwnProperty(ti)||Ue&&Ue[ti]!==Ge[ti]}var Fe,He=De.fieldNames;if(Ee("fieldNames")&&(He=(0,ie.w$)(Ge.fieldNames),we.fieldNames=He),Ee("treeData")?Fe=Ge.treeData:Ee("children")&&((0,nt.ZP)(!1,"`children` of Tree is deprecated. Please use `treeData` instead."),Fe=(0,ie.zn)(Ge.children)),Fe){we.treeData=Fe;var qe=(0,ie.I8)(Fe,{fieldNames:He});we.keyEntities=(0,ue.Z)((0,jt.Z)({},Jt,Gn),qe.keyEntities)}var cn=we.keyEntities||De.keyEntities;if(Ee("expandedKeys")||Ue&&Ee("autoExpandParent"))we.expandedKeys=Ge.autoExpandParent||!Ue&&Ge.defaultExpandParent?(0,yn.r7)(Ge.expandedKeys,cn):Ge.expandedKeys;else if(!Ue&&Ge.defaultExpandAll){var gn=(0,ue.Z)({},cn);delete gn[Jt];var ni=[];Object.keys(gn).forEach(function(ti){var vi=gn[ti];vi.children&&vi.children.length&&ni.push(vi.key)}),we.expandedKeys=ni}else!Ue&&Ge.defaultExpandedKeys&&(we.expandedKeys=Ge.autoExpandParent||Ge.defaultExpandParent?(0,yn.r7)(Ge.defaultExpandedKeys,cn):Ge.defaultExpandedKeys);if(we.expandedKeys||delete we.expandedKeys,Fe||we.expandedKeys){var ze=(0,ie.oH)(Fe||De.treeData,we.expandedKeys||De.expandedKeys,He);we.flattenNodes=ze}if(Ge.selectable&&(Ee("selectedKeys")?we.selectedKeys=(0,yn.BT)(Ge.selectedKeys,Ge):!Ue&&Ge.defaultSelectedKeys&&(we.selectedKeys=(0,yn.BT)(Ge.defaultSelectedKeys,Ge))),Ge.checkable){var Ve;if(Ee("checkedKeys")?Ve=(0,yn.E6)(Ge.checkedKeys)||{}:!Ue&&Ge.defaultCheckedKeys?Ve=(0,yn.E6)(Ge.defaultCheckedKeys)||{}:Fe&&(Ve=(0,yn.E6)(Ge.checkedKeys)||{checkedKeys:De.checkedKeys,halfCheckedKeys:De.halfCheckedKeys}),Ve){var nn=Ve,qn=nn.checkedKeys,vn=qn===void 0?[]:qn,tn=nn.halfCheckedKeys,Rn=tn===void 0?[]:tn;if(!Ge.checkStrictly){var gi=(0,te.S)(vn,!0,cn);vn=gi.checkedKeys,Rn=gi.halfCheckedKeys}we.checkedKeys=vn,we.halfCheckedKeys=Rn}}return Ee("loadedKeys")&&(we.loadedKeys=Ge.loadedKeys),we}}]),Mt}(et.Component);(0,jt.Z)(Rt,"defaultProps",{prefixCls:"rc-tree",showLine:!1,showIcon:!0,selectable:!0,multiple:!1,checkable:!1,disabled:!1,checkStrictly:!1,draggable:!1,defaultExpandParent:!0,autoExpandParent:!1,defaultExpandAll:!1,defaultExpandedKeys:[],defaultCheckedKeys:[],defaultSelectedKeys:[],dropIndicatorRender:gt,allowDrop:function(){return!0},expandAction:!1}),(0,jt.Z)(Rt,"TreeNode",Xt.Z);var Lt=Rt,Pt=Lt},82661:function(Bn,zn,kt){"use strict";kt.d(zn,{BT:function(){return et},E6:function(){return gt},L0:function(){return jt},OM:function(){return nt},_5:function(){return ne},r7:function(){return vt},wA:function(){return se},yx:function(){return Te}});var pt=kt(92393),Ut=kt(10928),ue=kt(48736),Le=kt(59301),he=kt(639),Dt=kt(65065),qt=kt(34061),me=null;function ne(St,Et){if(!St)return[];var Tt=St.slice(),Ot=Tt.indexOf(Et);return Ot>=0&&Tt.splice(Ot,1),Tt}function jt(St,Et){var Tt=(St||[]).slice();return Tt.indexOf(Et)===-1&&Tt.push(Et),Tt}function Te(St){return St.split("-")}function se(St,Et){var Tt=[],Ot=(0,Dt.Z)(Et,St);function $t(){var Xt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];Xt.forEach(function(Ht){var ve=Ht.key,ie=Ht.children;Tt.push(ve),$t(ie)})}return $t(Ot.children),Tt}function Ce(St){if(St.parent){var Et=Te(St.pos);return Number(Et[Et.length-1])===St.parent.children.length-1}return!1}function Bt(St){var Et=Te(St.pos);return Number(Et[Et.length-1])===0}function nt(St,Et,Tt,Ot,$t,Xt,Ht,ve,ie,Ne){var xe,Pe=St.clientX,Qe=St.clientY,_e=St.target.getBoundingClientRect(),an=_e.top,Ke=_e.height,re=(Ne==="rtl"?-1:1)*((($t==null?void 0:$t.x)||0)-Pe),Jt=(re-12)/Ot,Ye=ie.filter(function(Pt){var Nt;return(Nt=ve[Pt])===null||Nt===void 0||(Nt=Nt.children)===null||Nt===void 0?void 0:Nt.length}),Gn=(0,Dt.Z)(ve,Tt.eventKey);if(Qe<an+Ke/2){var dn=Ht.findIndex(function(Pt){return Pt.key===Gn.key}),Oe=dn<=0?0:dn-1,sn=Ht[Oe].key;Gn=(0,Dt.Z)(ve,sn)}var ln=Gn.key,Vn=Gn,Ae=Gn.key,yn=0,te=0;if(!Ye.includes(ln))for(var En=0;En<Jt&&Ce(Gn);En+=1)Gn=Gn.parent,te+=1;var ri=Et.data,Rt=Gn.node,Lt=!0;return Bt(Gn)&&Gn.level===0&&Qe<an+Ke/2&&Xt({dragNode:ri,dropNode:Rt,dropPosition:-1})&&Gn.key===Tt.eventKey?yn=-1:(Vn.children||[]).length&&Ye.includes(Ae)?Xt({dragNode:ri,dropNode:Rt,dropPosition:0})?yn=0:Lt=!1:te===0?Jt>-1.5?Xt({dragNode:ri,dropNode:Rt,dropPosition:1})?yn=1:Lt=!1:Xt({dragNode:ri,dropNode:Rt,dropPosition:0})?yn=0:Xt({dragNode:ri,dropNode:Rt,dropPosition:1})?yn=1:Lt=!1:Xt({dragNode:ri,dropNode:Rt,dropPosition:1})?yn=1:Lt=!1,{dropPosition:yn,dropLevelOffset:te,dropTargetKey:Gn.key,dropTargetPos:Gn.pos,dragOverNodeKey:Ae,dropContainerKey:yn===0?null:((xe=Gn.parent)===null||xe===void 0?void 0:xe.key)||null,dropAllowed:Lt}}function et(St,Et){if(St){var Tt=Et.multiple;return Tt?St.slice():St.length?[St[0]]:St}}var ht=function(Et){return Et};function st(St,Et){if(!St)return[];var Tt=Et||{},Ot=Tt.processProps,$t=Ot===void 0?ht:Ot,Xt=Array.isArray(St)?St:[St];return Xt.map(function(Ht){var ve=Ht.children,ie=_objectWithoutProperties(Ht,me),Ne=st(ve,Et);return React.createElement(TreeNode,_extends({key:ie.key},$t(ie)),Ne)})}function gt(St){if(!St)return null;var Et;if(Array.isArray(St))Et={checkedKeys:St,halfCheckedKeys:void 0};else if((0,Ut.Z)(St)==="object")Et={checkedKeys:St.checked||void 0,halfCheckedKeys:St.halfChecked||void 0};else return(0,ue.ZP)(!1,"`checkedKeys` is not an array or an object"),null;return Et}function vt(St,Et){var Tt=new Set;function Ot($t){if(!Tt.has($t)){var Xt=(0,Dt.Z)(Et,$t);if(Xt){Tt.add($t);var Ht=Xt.parent,ve=Xt.node;ve.disabled||Ht&&Ot(Ht.key)}}}return(St||[]).forEach(function($t){Ot($t)}),(0,pt.Z)(Tt)}},34643:function(Bn,zn,kt){"use strict";kt.d(zn,{S:function(){return qt}});var pt=kt(48736),Ut=kt(65065);function ue(me,ne){var jt=new Set;return me.forEach(function(Te){ne.has(Te)||jt.add(Te)}),jt}function Le(me){var ne=me||{},jt=ne.disabled,Te=ne.disableCheckbox,se=ne.checkable;return!!(jt||Te)||se===!1}function he(me,ne,jt,Te){for(var se=new Set(me),Ce=new Set,Bt=0;Bt<=jt;Bt+=1){var nt=ne.get(Bt)||new Set;nt.forEach(function(gt){var vt=gt.key,St=gt.node,Et=gt.children,Tt=Et===void 0?[]:Et;se.has(vt)&&!Te(St)&&Tt.filter(function(Ot){return!Te(Ot.node)}).forEach(function(Ot){se.add(Ot.key)})})}for(var et=new Set,ht=jt;ht>=0;ht-=1){var st=ne.get(ht)||new Set;st.forEach(function(gt){var vt=gt.parent,St=gt.node;if(!(Te(St)||!gt.parent||et.has(gt.parent.key))){if(Te(gt.parent.node)){et.add(vt.key);return}var Et=!0,Tt=!1;(vt.children||[]).filter(function(Ot){return!Te(Ot.node)}).forEach(function(Ot){var $t=Ot.key,Xt=se.has($t);Et&&!Xt&&(Et=!1),!Tt&&(Xt||Ce.has($t))&&(Tt=!0)}),Et&&se.add(vt.key),Tt&&Ce.add(vt.key),et.add(vt.key)}})}return{checkedKeys:Array.from(se),halfCheckedKeys:Array.from(ue(Ce,se))}}function Dt(me,ne,jt,Te,se){for(var Ce=new Set(me),Bt=new Set(ne),nt=0;nt<=Te;nt+=1){var et=jt.get(nt)||new Set;et.forEach(function(vt){var St=vt.key,Et=vt.node,Tt=vt.children,Ot=Tt===void 0?[]:Tt;!Ce.has(St)&&!Bt.has(St)&&!se(Et)&&Ot.filter(function($t){return!se($t.node)}).forEach(function($t){Ce.delete($t.key)})})}Bt=new Set;for(var ht=new Set,st=Te;st>=0;st-=1){var gt=jt.get(st)||new Set;gt.forEach(function(vt){var St=vt.parent,Et=vt.node;if(!(se(Et)||!vt.parent||ht.has(vt.parent.key))){if(se(vt.parent.node)){ht.add(St.key);return}var Tt=!0,Ot=!1;(St.children||[]).filter(function($t){return!se($t.node)}).forEach(function($t){var Xt=$t.key,Ht=Ce.has(Xt);Tt&&!Ht&&(Tt=!1),!Ot&&(Ht||Bt.has(Xt))&&(Ot=!0)}),Tt||Ce.delete(St.key),Ot&&Bt.add(St.key),ht.add(St.key)}})}return{checkedKeys:Array.from(Ce),halfCheckedKeys:Array.from(ue(Bt,Ce))}}function qt(me,ne,jt,Te){var se=[],Ce;Te?Ce=Te:Ce=Le;var Bt=new Set(me.filter(function(st){var gt=!!(0,Ut.Z)(jt,st);return gt||se.push(st),gt})),nt=new Map,et=0;Object.keys(jt).forEach(function(st){var gt=jt[st],vt=gt.level,St=nt.get(vt);St||(St=new Set,nt.set(vt,St)),St.add(gt),et=Math.max(et,vt)}),(0,pt.ZP)(!se.length,"Tree missing follow keys: ".concat(se.slice(0,100).map(function(st){return"'".concat(st,"'")}).join(", ")));var ht;return ne===!0?ht=he(Bt,nt,et,Ce):ht=Dt(Bt,ne.halfCheckedKeys,nt,et,Ce),ht}},65065:function(Bn,zn,kt){"use strict";kt.d(zn,{Z:function(){return pt}});function pt(Ut,ue){return Ut[ue]}},34061:function(Bn,zn,kt){"use strict";kt.d(zn,{F:function(){return vt},H8:function(){return gt},I8:function(){return st},km:function(){return se},oH:function(){return et},w$:function(){return Ce},zn:function(){return nt}});var pt=kt(10928),Ut=kt(92393),ue=kt(20049),Le=kt(5883),he=kt(11592),Dt=kt(2738),qt=kt(48736),me=kt(65065),ne=["children"];function jt(St,Et){return"".concat(St,"-").concat(Et)}function Te(St){return St&&St.type&&St.type.isTreeNode}function se(St,Et){return St!=null?St:Et}function Ce(St){var Et=St||{},Tt=Et.title,Ot=Et._title,$t=Et.key,Xt=Et.children,Ht=Tt||"title";return{title:Ht,_title:Ot||[Ht],key:$t||"key",children:Xt||"children"}}function Bt(St,Et){var Tt=new Map;function Ot($t){var Xt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";($t||[]).forEach(function(Ht){var ve=Ht[Et.key],ie=Ht[Et.children];warning(ve!=null,"Tree node must have a certain key: [".concat(Xt).concat(ve,"]"));var Ne=String(ve);warning(!Tt.has(Ne)||ve===null||ve===void 0,"Same 'key' exist in the Tree: ".concat(Ne)),Tt.set(Ne,!0),Ot(ie,"".concat(Xt).concat(Ne," > "))})}Ot(St)}function nt(St){function Et(Tt){var Ot=(0,he.Z)(Tt);return Ot.map(function($t){if(!Te($t))return(0,qt.ZP)(!$t,"Tree/TreeNode can only accept TreeNode as children."),null;var Xt=$t.key,Ht=$t.props,ve=Ht.children,ie=(0,Le.Z)(Ht,ne),Ne=(0,ue.Z)({key:Xt},ie),xe=Et(ve);return xe.length&&(Ne.children=xe),Ne}).filter(function($t){return $t})}return Et(St)}function et(St,Et,Tt){var Ot=Ce(Tt),$t=Ot._title,Xt=Ot.key,Ht=Ot.children,ve=new Set(Et===!0?[]:Et),ie=[];function Ne(xe){var Pe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return xe.map(function(Qe,_e){for(var an=jt(Pe?Pe.pos:"0",_e),Ke=se(Qe[Xt],an),re,Jt=0;Jt<$t.length;Jt+=1){var Ye=$t[Jt];if(Qe[Ye]!==void 0){re=Qe[Ye];break}}var Gn=Object.assign((0,Dt.Z)(Qe,[].concat((0,Ut.Z)($t),[Xt,Ht])),{title:re,key:Ke,parent:Pe,pos:an,children:null,data:Qe,isStart:[].concat((0,Ut.Z)(Pe?Pe.isStart:[]),[_e===0]),isEnd:[].concat((0,Ut.Z)(Pe?Pe.isEnd:[]),[_e===xe.length-1])});return ie.push(Gn),Et===!0||ve.has(Ke)?Gn.children=Ne(Qe[Ht]||[],Gn):Gn.children=[],Gn})}return Ne(St),ie}function ht(St,Et,Tt){var Ot={};(0,pt.Z)(Tt)==="object"?Ot=Tt:Ot={externalGetKey:Tt},Ot=Ot||{};var $t=Ot,Xt=$t.childrenPropName,Ht=$t.externalGetKey,ve=$t.fieldNames,ie=Ce(ve),Ne=ie.key,xe=ie.children,Pe=Xt||xe,Qe;Ht?typeof Ht=="string"?Qe=function(Ke){return Ke[Ht]}:typeof Ht=="function"&&(Qe=function(Ke){return Ht(Ke)}):Qe=function(Ke,re){return se(Ke[Ne],re)};function _e(an,Ke,re,Jt){var Ye=an?an[Pe]:St,Gn=an?jt(re.pos,Ke):"0",dn=an?[].concat((0,Ut.Z)(Jt),[an]):[];if(an){var Oe=Qe(an,Gn),sn={node:an,index:Ke,pos:Gn,key:Oe,parentPos:re.node?re.pos:null,level:re.level+1,nodes:dn};Et(sn)}Ye&&Ye.forEach(function(ln,Vn){_e(ln,Vn,{node:an,pos:Gn,level:re?re.level+1:-1},dn)})}_e(null)}function st(St){var Et=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Tt=Et.initWrapper,Ot=Et.processEntity,$t=Et.onProcessFinished,Xt=Et.externalGetKey,Ht=Et.childrenPropName,ve=Et.fieldNames,ie=arguments.length>2?arguments[2]:void 0,Ne=Xt||ie,xe={},Pe={},Qe={posEntities:xe,keyEntities:Pe};return Tt&&(Qe=Tt(Qe)||Qe),ht(St,function(_e){var an=_e.node,Ke=_e.index,re=_e.pos,Jt=_e.key,Ye=_e.parentPos,Gn=_e.level,dn=_e.nodes,Oe={node:an,nodes:dn,index:Ke,key:Jt,pos:re,level:Gn},sn=se(Jt,re);xe[re]=Oe,Pe[sn]=Oe,Oe.parent=xe[Ye],Oe.parent&&(Oe.parent.children=Oe.parent.children||[],Oe.parent.children.push(Oe)),Ot&&Ot(Oe,Qe)},{externalGetKey:Ne,childrenPropName:Ht,fieldNames:ve}),$t&&$t(Qe),Qe}function gt(St,Et){var Tt=Et.expandedKeys,Ot=Et.selectedKeys,$t=Et.loadedKeys,Xt=Et.loadingKeys,Ht=Et.checkedKeys,ve=Et.halfCheckedKeys,ie=Et.dragOverNodeKey,Ne=Et.dropPosition,xe=Et.keyEntities,Pe=(0,me.Z)(xe,St),Qe={eventKey:St,expanded:Tt.indexOf(St)!==-1,selected:Ot.indexOf(St)!==-1,loaded:$t.indexOf(St)!==-1,loading:Xt.indexOf(St)!==-1,checked:Ht.indexOf(St)!==-1,halfChecked:ve.indexOf(St)!==-1,pos:String(Pe?Pe.pos:""),dragOver:ie===St&&Ne===0,dragOverGapTop:ie===St&&Ne===-1,dragOverGapBottom:ie===St&&Ne===1};return Qe}function vt(St){var Et=St.data,Tt=St.expanded,Ot=St.selected,$t=St.checked,Xt=St.loaded,Ht=St.loading,ve=St.halfChecked,ie=St.dragOver,Ne=St.dragOverGapTop,xe=St.dragOverGapBottom,Pe=St.pos,Qe=St.active,_e=St.eventKey,an=(0,ue.Z)((0,ue.Z)({},Et),{},{expanded:Tt,selected:Ot,checked:$t,loaded:Xt,loading:Ht,halfChecked:ve,dragOver:ie,dragOverGapTop:Ne,dragOverGapBottom:xe,pos:Pe,active:Qe,key:_e});return"props"in an||Object.defineProperty(an,"props",{get:function(){return(0,qt.ZP)(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),St}}),an}},8224:function(Bn,zn,kt){"use strict";kt.d(zn,{Z:function(){return Ut}});var pt=kt(4676);function Ut(ue,Le,he,Dt){var qt=pt.unstable_batchedUpdates?function(ne){pt.unstable_batchedUpdates(he,ne)}:he;return ue!=null&&ue.addEventListener&&ue.addEventListener(Le,qt,Dt),{remove:function(){ue!=null&&ue.removeEventListener&&ue.removeEventListener(Le,qt,Dt)}}}},24514:function(Bn,zn,kt){"use strict";kt.d(zn,{G:function(){return Le}});var pt=kt(47273),Ut=function(Dt){if((0,pt.Z)()&&window.document.documentElement){var qt=Array.isArray(Dt)?Dt:[Dt],me=window.document.documentElement;return qt.some(function(ne){return ne in me.style})}return!1},ue=function(Dt,qt){if(!Ut(Dt))return!1;var me=document.createElement("div"),ne=me.style[Dt];return me.style[Dt]=qt,me.style[Dt]!==ne};function Le(he,Dt){return!Array.isArray(he)&&Dt!==void 0?ue(he,Dt):Ut(he)}},65283:function(Bn,zn,kt){"use strict";kt.d(zn,{Z:function(){return ri}});var pt=kt(5016),Ut=kt(10928),ue=kt(20049),Le=kt(18082),he=kt(52456),Dt=kt(5883),qt=kt(92310),me=kt.n(qt),ne=kt(29301),jt=kt(70425),Te=kt(34280),se=kt(59301),Ce=kt(4676),Bt=se.forwardRef(function(Rt,Lt){var Pt=Rt.height,Nt=Rt.offsetY,Zt=Rt.offsetX,Mt=Rt.children,Yt=Rt.prefixCls,Ge=Rt.onInnerResize,De=Rt.innerProps,Ue=Rt.rtl,we=Rt.extra,Ee={},Fe={display:"flex",flexDirection:"column"};return Nt!==void 0&&(Ee={height:Pt,position:"relative",overflow:"hidden"},Fe=(0,ue.Z)((0,ue.Z)({},Fe),{},(0,Le.Z)((0,Le.Z)((0,Le.Z)((0,Le.Z)((0,Le.Z)({transform:"translateY(".concat(Nt,"px)")},Ue?"marginRight":"marginLeft",-Zt),"position","absolute"),"left",0),"right",0),"top",0))),se.createElement("div",{style:Ee},se.createElement(ne.Z,{onResize:function(qe){var cn=qe.offsetHeight;cn&&Ge&&Ge()}},se.createElement("div",(0,pt.Z)({style:Fe,className:me()((0,Le.Z)({},"".concat(Yt,"-holder-inner"),Yt)),ref:Lt},De),Mt,we)))});Bt.displayName="Filler";var nt=Bt;function et(Rt){var Lt=Rt.children,Pt=Rt.setRef,Nt=se.useCallback(function(Zt){Pt(Zt)},[]);return se.cloneElement(Lt,{ref:Nt})}function ht(Rt,Lt,Pt,Nt,Zt,Mt,Yt,Ge){var De=Ge.getKey;return Rt.slice(Lt,Pt+1).map(function(Ue,we){var Ee=Lt+we,Fe=Yt(Ue,Ee,{style:{width:Nt},offsetX:Zt}),He=De(Ue);return se.createElement(et,{key:He,setRef:function(cn){return Mt(Ue,cn)}},Fe)})}function st(Rt,Lt,Pt,Nt){var Zt=Pt-Rt,Mt=Lt-Pt,Yt=Math.min(Zt,Mt)*2;if(Nt<=Yt){var Ge=Math.floor(Nt/2);return Nt%2?Pt+Ge+1:Pt-Ge}return Zt>Mt?Pt-(Nt-Mt):Pt+(Nt-Zt)}function gt(Rt,Lt,Pt){var Nt=Rt.length,Zt=Lt.length,Mt,Yt;if(Nt===0&&Zt===0)return null;Nt<Zt?(Mt=Rt,Yt=Lt):(Mt=Lt,Yt=Rt);var Ge={__EMPTY_ITEM__:!0};function De(qe){return qe!==void 0?Pt(qe):Ge}for(var Ue=null,we=Math.abs(Nt-Zt)!==1,Ee=0;Ee<Yt.length;Ee+=1){var Fe=De(Mt[Ee]),He=De(Yt[Ee]);if(Fe!==He){Ue=Ee,we=we||Fe!==De(Yt[Ee+1]);break}}return Ue===null?null:{index:Ue,multiple:we}}function vt(Rt,Lt,Pt){var Nt=se.useState(Rt),Zt=(0,he.Z)(Nt,2),Mt=Zt[0],Yt=Zt[1],Ge=se.useState(null),De=(0,he.Z)(Ge,2),Ue=De[0],we=De[1];return se.useEffect(function(){var Ee=gt(Mt||[],Rt||[],Lt);(Ee==null?void 0:Ee.index)!==void 0&&(Pt==null||Pt(Ee.index),we(Rt[Ee.index])),Yt(Rt)},[Rt]),[Ue]}var St=kt(16089),Et=(typeof navigator=="undefined"?"undefined":(0,Ut.Z)(navigator))==="object"&&/Firefox/i.test(navigator.userAgent),Tt=Et,Ot=function(Rt,Lt,Pt,Nt){var Zt=(0,se.useRef)(!1),Mt=(0,se.useRef)(null);function Yt(){clearTimeout(Mt.current),Zt.current=!0,Mt.current=setTimeout(function(){Zt.current=!1},50)}var Ge=(0,se.useRef)({top:Rt,bottom:Lt,left:Pt,right:Nt});return Ge.current.top=Rt,Ge.current.bottom=Lt,Ge.current.left=Pt,Ge.current.right=Nt,function(De,Ue){var we=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,Ee=De?Ue<0&&Ge.current.left||Ue>0&&Ge.current.right:Ue<0&&Ge.current.top||Ue>0&&Ge.current.bottom;return we&&Ee?(clearTimeout(Mt.current),Zt.current=!1):(!Ee||Zt.current)&&Yt(),!Zt.current&&Ee}};function $t(Rt,Lt,Pt,Nt,Zt,Mt,Yt){var Ge=(0,se.useRef)(0),De=(0,se.useRef)(null),Ue=(0,se.useRef)(null),we=(0,se.useRef)(!1),Ee=Ot(Lt,Pt,Nt,Zt);function Fe(ze,Ve){if(St.Z.cancel(De.current),!Ee(!1,Ve)){var nn=ze;if(!nn._virtualHandled)nn._virtualHandled=!0;else return;Ge.current+=Ve,Ue.current=Ve,Tt||nn.preventDefault(),De.current=(0,St.Z)(function(){var qn=we.current?10:1;Yt(Ge.current*qn,!1),Ge.current=0})}}function He(ze,Ve){Yt(Ve,!0),Tt||ze.preventDefault()}var qe=(0,se.useRef)(null),cn=(0,se.useRef)(null);function gn(ze){if(Rt){St.Z.cancel(cn.current),cn.current=(0,St.Z)(function(){qe.current=null},2);var Ve=ze.deltaX,nn=ze.deltaY,qn=ze.shiftKey,vn=Ve,tn=nn;(qe.current==="sx"||!qe.current&&qn&&nn&&!Ve)&&(vn=nn,tn=0,qe.current="sx");var Rn=Math.abs(vn),gi=Math.abs(tn);qe.current===null&&(qe.current=Mt&&Rn>gi?"x":"y"),qe.current==="y"?Fe(ze,tn):He(ze,vn)}}function ni(ze){Rt&&(we.current=ze.detail===Ue.current)}return[gn,ni]}function Xt(Rt,Lt,Pt,Nt){var Zt=se.useMemo(function(){return[new Map,[]]},[Rt,Pt.id,Nt]),Mt=(0,he.Z)(Zt,2),Yt=Mt[0],Ge=Mt[1],De=function(we){var Ee=arguments.length>1&&arguments[1]!==void 0?arguments[1]:we,Fe=Yt.get(we),He=Yt.get(Ee);if(Fe===void 0||He===void 0)for(var qe=Rt.length,cn=Ge.length;cn<qe;cn+=1){var gn,ni=Rt[cn],ze=Lt(ni);Yt.set(ze,cn);var Ve=(gn=Pt.get(ze))!==null&&gn!==void 0?gn:Nt;if(Ge[cn]=(Ge[cn-1]||0)+Ve,ze===we&&(Fe=cn),ze===Ee&&(He=cn),Fe!==void 0&&He!==void 0)break}return{top:Ge[Fe-1]||0,bottom:Ge[He]}};return De}var Ht=kt(6487),ve=kt(56789),ie=function(){function Rt(){(0,Ht.Z)(this,Rt),(0,Le.Z)(this,"maps",void 0),(0,Le.Z)(this,"id",0),(0,Le.Z)(this,"diffRecords",new Map),this.maps=Object.create(null)}return(0,ve.Z)(Rt,[{key:"set",value:function(Pt,Nt){this.diffRecords.set(Pt,this.maps[Pt]),this.maps[Pt]=Nt,this.id+=1}},{key:"get",value:function(Pt){return this.maps[Pt]}},{key:"resetRecord",value:function(){this.diffRecords.clear()}},{key:"getRecord",value:function(){return this.diffRecords}}]),Rt}(),Ne=ie;function xe(Rt){var Lt=parseFloat(Rt);return isNaN(Lt)?0:Lt}function Pe(Rt,Lt,Pt){var Nt=se.useState(0),Zt=(0,he.Z)(Nt,2),Mt=Zt[0],Yt=Zt[1],Ge=(0,se.useRef)(new Map),De=(0,se.useRef)(new Ne),Ue=(0,se.useRef)(0);function we(){Ue.current+=1}function Ee(){var He=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;we();var qe=function(){var ni=!1;Ge.current.forEach(function(ze,Ve){if(ze&&ze.offsetParent){var nn=ze.offsetHeight,qn=getComputedStyle(ze),vn=qn.marginTop,tn=qn.marginBottom,Rn=xe(vn),gi=xe(tn),ti=nn+Rn+gi;De.current.get(Ve)!==ti&&(De.current.set(Ve,ti),ni=!0)}}),ni&&Yt(function(ze){return ze+1})};if(He)qe();else{Ue.current+=1;var cn=Ue.current;Promise.resolve().then(function(){cn===Ue.current&&qe()})}}function Fe(He,qe){var cn=Rt(He),gn=Ge.current.get(cn);qe?(Ge.current.set(cn,qe),Ee()):Ge.current.delete(cn),!gn!=!qe&&(qe?Lt==null||Lt(He):Pt==null||Pt(He))}return(0,se.useEffect)(function(){return we},[]),[Fe,Ee,De.current,Mt]}var Qe=14/15;function _e(Rt,Lt,Pt){var Nt=(0,se.useRef)(!1),Zt=(0,se.useRef)(0),Mt=(0,se.useRef)(0),Yt=(0,se.useRef)(null),Ge=(0,se.useRef)(null),De,Ue=function(He){if(Nt.current){var qe=Math.ceil(He.touches[0].pageX),cn=Math.ceil(He.touches[0].pageY),gn=Zt.current-qe,ni=Mt.current-cn,ze=Math.abs(gn)>Math.abs(ni);ze?Zt.current=qe:Mt.current=cn;var Ve=Pt(ze,ze?gn:ni,!1,He);Ve&&He.preventDefault(),clearInterval(Ge.current),Ve&&(Ge.current=setInterval(function(){ze?gn*=Qe:ni*=Qe;var nn=Math.floor(ze?gn:ni);(!Pt(ze,nn,!0)||Math.abs(nn)<=.1)&&clearInterval(Ge.current)},16))}},we=function(){Nt.current=!1,De()},Ee=function(He){De(),He.touches.length===1&&!Nt.current&&(Nt.current=!0,Zt.current=Math.ceil(He.touches[0].pageX),Mt.current=Math.ceil(He.touches[0].pageY),Yt.current=He.target,Yt.current.addEventListener("touchmove",Ue,{passive:!1}),Yt.current.addEventListener("touchend",we,{passive:!0}))};De=function(){Yt.current&&(Yt.current.removeEventListener("touchmove",Ue),Yt.current.removeEventListener("touchend",we))},(0,Te.Z)(function(){return Rt&&Lt.current.addEventListener("touchstart",Ee,{passive:!0}),function(){var Fe;(Fe=Lt.current)===null||Fe===void 0||Fe.removeEventListener("touchstart",Ee),De(),clearInterval(Ge.current)}},[Rt])}function an(Rt){return Math.floor(Math.pow(Rt,.5))}function Ke(Rt,Lt){var Pt="touches"in Rt?Rt.touches[0]:Rt;return Pt[Lt?"pageX":"pageY"]-window[Lt?"scrollX":"scrollY"]}function re(Rt,Lt,Pt){se.useEffect(function(){var Nt=Lt.current;if(Rt&&Nt){var Zt=!1,Mt,Yt,Ge=function(){St.Z.cancel(Mt)},De=function Fe(){Ge(),Mt=(0,St.Z)(function(){Pt(Yt),Fe()})},Ue=function(He){if(!(He.target.draggable||He.button!==0)){var qe=He;qe._virtualHandled||(qe._virtualHandled=!0,Zt=!0)}},we=function(){Zt=!1,Ge()},Ee=function(He){if(Zt){var qe=Ke(He,!1),cn=Nt.getBoundingClientRect(),gn=cn.top,ni=cn.bottom;if(qe<=gn){var ze=gn-qe;Yt=-an(ze),De()}else if(qe>=ni){var Ve=qe-ni;Yt=an(Ve),De()}else Ge()}};return Nt.addEventListener("mousedown",Ue),Nt.ownerDocument.addEventListener("mouseup",we),Nt.ownerDocument.addEventListener("mousemove",Ee),function(){Nt.removeEventListener("mousedown",Ue),Nt.ownerDocument.removeEventListener("mouseup",we),Nt.ownerDocument.removeEventListener("mousemove",Ee),Ge()}}},[Rt])}var Jt=10;function Ye(Rt,Lt,Pt,Nt,Zt,Mt,Yt,Ge){var De=se.useRef(),Ue=se.useState(null),we=(0,he.Z)(Ue,2),Ee=we[0],Fe=we[1];return(0,Te.Z)(function(){if(Ee&&Ee.times<Jt){if(!Rt.current){Fe(function(zi){return(0,ue.Z)({},zi)});return}Mt();var He=Ee.targetAlign,qe=Ee.originAlign,cn=Ee.index,gn=Ee.offset,ni=Rt.current.clientHeight,ze=!1,Ve=He,nn=null;if(ni){for(var qn=He||qe,vn=0,tn=0,Rn=0,gi=Math.min(Lt.length-1,cn),ti=0;ti<=gi;ti+=1){var vi=Zt(Lt[ti]);tn=vn;var Gi=Pt.get(vi);Rn=tn+(Gi===void 0?Nt:Gi),vn=Rn}for(var Fn=qn==="top"?gn:ni-gn,xn=gi;xn>=0;xn-=1){var Tn=Zt(Lt[xn]),ai=Pt.get(Tn);if(ai===void 0){ze=!0;break}if(Fn-=ai,Fn<=0)break}switch(qn){case"top":nn=tn-gn;break;case"bottom":nn=Rn-ni+gn;break;default:{var pi=Rt.current.scrollTop,ui=pi+ni;tn<pi?Ve="top":Rn>ui&&(Ve="bottom")}}nn!==null&&Yt(nn),nn!==Ee.lastTop&&(ze=!0)}ze&&Fe((0,ue.Z)((0,ue.Z)({},Ee),{},{times:Ee.times+1,targetAlign:Ve,lastTop:nn}))}},[Ee,Rt.current]),function(He){if(He==null){Ge();return}if(St.Z.cancel(De.current),typeof He=="number")Yt(He);else if(He&&(0,Ut.Z)(He)==="object"){var qe,cn=He.align;"index"in He?qe=He.index:qe=Lt.findIndex(function(ze){return Zt(ze)===He.key});var gn=He.offset,ni=gn===void 0?0:gn;Fe({times:0,index:qe,offset:ni,originAlign:cn})}}}var Gn=se.forwardRef(function(Rt,Lt){var Pt=Rt.prefixCls,Nt=Rt.rtl,Zt=Rt.scrollOffset,Mt=Rt.scrollRange,Yt=Rt.onStartMove,Ge=Rt.onStopMove,De=Rt.onScroll,Ue=Rt.horizontal,we=Rt.spinSize,Ee=Rt.containerSize,Fe=Rt.style,He=Rt.thumbStyle,qe=Rt.showScrollBar,cn=se.useState(!1),gn=(0,he.Z)(cn,2),ni=gn[0],ze=gn[1],Ve=se.useState(null),nn=(0,he.Z)(Ve,2),qn=nn[0],vn=nn[1],tn=se.useState(null),Rn=(0,he.Z)(tn,2),gi=Rn[0],ti=Rn[1],vi=!Nt,Gi=se.useRef(),Fn=se.useRef(),xn=se.useState(qe),Tn=(0,he.Z)(xn,2),ai=Tn[0],pi=Tn[1],ui=se.useRef(),zi=function(){qe===!0||qe===!1||(clearTimeout(ui.current),pi(!0),ui.current=setTimeout(function(){pi(!1)},3e3))},wt=Mt-Ee||0,Xe=Ee-we||0,Hn=se.useMemo(function(){if(Zt===0||wt===0)return 0;var ye=Zt/wt;return ye*Xe},[Zt,wt,Xe]),Ai=function(jn){jn.stopPropagation(),jn.preventDefault()},Vi=se.useRef({top:Hn,dragging:ni,pageY:qn,startTop:gi});Vi.current={top:Hn,dragging:ni,pageY:qn,startTop:gi};var dr=function(jn){ze(!0),vn(Ke(jn,Ue)),ti(Vi.current.top),Yt(),jn.stopPropagation(),jn.preventDefault()};se.useEffect(function(){var ye=function(Je){Je.preventDefault()},jn=Gi.current,Ln=Fn.current;return jn.addEventListener("touchstart",ye,{passive:!1}),Ln.addEventListener("touchstart",dr,{passive:!1}),function(){jn.removeEventListener("touchstart",ye),Ln.removeEventListener("touchstart",dr)}},[]);var kr=se.useRef();kr.current=wt;var ci=se.useRef();ci.current=Xe,se.useEffect(function(){if(ni){var ye,jn=function(Je){var An=Vi.current,yi=An.dragging,Ei=An.pageY,Xi=An.startTop;St.Z.cancel(ye);var Gt=Gi.current.getBoundingClientRect(),de=Ee/(Ue?Gt.width:Gt.height);if(yi){var un=(Ke(Je,Ue)-Ei)*de,Mn=Xi;!vi&&Ue?Mn-=un:Mn+=un;var Ie=kr.current,$e=ci.current,bn=$e?Mn/$e:0,_n=Math.ceil(bn*Ie);_n=Math.max(_n,0),_n=Math.min(_n,Ie),ye=(0,St.Z)(function(){De(_n,Ue)})}},Ln=function(){ze(!1),Ge()};return window.addEventListener("mousemove",jn,{passive:!0}),window.addEventListener("touchmove",jn,{passive:!0}),window.addEventListener("mouseup",Ln,{passive:!0}),window.addEventListener("touchend",Ln,{passive:!0}),function(){window.removeEventListener("mousemove",jn),window.removeEventListener("touchmove",jn),window.removeEventListener("mouseup",Ln),window.removeEventListener("touchend",Ln),St.Z.cancel(ye)}}},[ni]),se.useEffect(function(){return zi(),function(){clearTimeout(ui.current)}},[Zt]),se.useImperativeHandle(Lt,function(){return{delayHidden:zi}});var In="".concat(Pt,"-scrollbar"),pe={position:"absolute",visibility:ai?null:"hidden"},Se={position:"absolute",background:"rgba(0, 0, 0, 0.5)",borderRadius:99,cursor:"pointer",userSelect:"none"};return Ue?(pe.height=8,pe.left=0,pe.right=0,pe.bottom=0,Se.height="100%",Se.width=we,vi?Se.left=Hn:Se.right=Hn):(pe.width=8,pe.top=0,pe.bottom=0,vi?pe.right=0:pe.left=0,Se.width="100%",Se.height=we,Se.top=Hn),se.createElement("div",{ref:Gi,className:me()(In,(0,Le.Z)((0,Le.Z)((0,Le.Z)({},"".concat(In,"-horizontal"),Ue),"".concat(In,"-vertical"),!Ue),"".concat(In,"-visible"),ai)),style:(0,ue.Z)((0,ue.Z)({},pe),Fe),onMouseDown:Ai,onMouseMove:zi},se.createElement("div",{ref:Fn,className:me()("".concat(In,"-thumb"),(0,Le.Z)({},"".concat(In,"-thumb-moving"),ni)),style:(0,ue.Z)((0,ue.Z)({},Se),He),onMouseDown:dr}))}),dn=Gn,Oe=20;function sn(){var Rt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,Lt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,Pt=Rt/Lt*Rt;return isNaN(Pt)&&(Pt=0),Pt=Math.max(Pt,Oe),Math.floor(Pt)}var ln=["prefixCls","className","height","itemHeight","fullHeight","style","data","children","itemKey","virtual","direction","scrollWidth","component","onScroll","onVirtualScroll","onVisibleChange","innerProps","extraRender","styles","showScrollBar"],Vn=[],Ae={overflowY:"auto",overflowAnchor:"none"};function yn(Rt,Lt){var Pt=Rt.prefixCls,Nt=Pt===void 0?"rc-virtual-list":Pt,Zt=Rt.className,Mt=Rt.height,Yt=Rt.itemHeight,Ge=Rt.fullHeight,De=Ge===void 0?!0:Ge,Ue=Rt.style,we=Rt.data,Ee=Rt.children,Fe=Rt.itemKey,He=Rt.virtual,qe=Rt.direction,cn=Rt.scrollWidth,gn=Rt.component,ni=gn===void 0?"div":gn,ze=Rt.onScroll,Ve=Rt.onVirtualScroll,nn=Rt.onVisibleChange,qn=Rt.innerProps,vn=Rt.extraRender,tn=Rt.styles,Rn=Rt.showScrollBar,gi=Rn===void 0?"optional":Rn,ti=(0,Dt.Z)(Rt,ln),vi=se.useCallback(function(mn){return typeof Fe=="function"?Fe(mn):mn==null?void 0:mn[Fe]},[Fe]),Gi=Pe(vi,null,null),Fn=(0,he.Z)(Gi,4),xn=Fn[0],Tn=Fn[1],ai=Fn[2],pi=Fn[3],ui=!!(He!==!1&&Mt&&Yt),zi=se.useMemo(function(){return Object.values(ai.maps).reduce(function(mn,Un){return mn+Un},0)},[ai.id,ai.maps]),wt=ui&&we&&(Math.max(Yt*we.length,zi)>Mt||!!cn),Xe=qe==="rtl",Hn=me()(Nt,(0,Le.Z)({},"".concat(Nt,"-rtl"),Xe),Zt),Ai=we||Vn,Vi=(0,se.useRef)(),dr=(0,se.useRef)(),kr=(0,se.useRef)(),ci=(0,se.useState)(0),In=(0,he.Z)(ci,2),pe=In[0],Se=In[1],ye=(0,se.useState)(0),jn=(0,he.Z)(ye,2),Ln=jn[0],Kn=jn[1],Je=(0,se.useState)(!1),An=(0,he.Z)(Je,2),yi=An[0],Ei=An[1],Xi=function(){Ei(!0)},Gt=function(){Ei(!1)},de={getKey:vi};function un(mn){Se(function(Un){var Qn;typeof mn=="function"?Qn=mn(Un):Qn=mn;var Dn=tr(Qn);return Vi.current.scrollTop=Dn,Dn})}var Mn=(0,se.useRef)({start:0,end:Ai.length}),Ie=(0,se.useRef)(),$e=vt(Ai,vi),bn=(0,he.Z)($e,1),_n=bn[0];Ie.current=_n;var hi=se.useMemo(function(){if(!ui)return{scrollHeight:void 0,start:0,end:Ai.length-1,offset:void 0};if(!wt){var mn;return{scrollHeight:((mn=dr.current)===null||mn===void 0?void 0:mn.offsetHeight)||0,start:0,end:Ai.length-1,offset:void 0}}for(var Un=0,Qn,Dn,Xn,Oi=Ai.length,mi=0;mi<Oi;mi+=1){var ii=Ai[mi],on=vi(ii),ki=ai.get(on),Ui=Un+(ki===void 0?Yt:ki);Ui>=pe&&Qn===void 0&&(Qn=mi,Dn=Un),Ui>pe+Mt&&Xn===void 0&&(Xn=mi),Un=Ui}return Qn===void 0&&(Qn=0,Dn=0,Xn=Math.ceil(Mt/Yt)),Xn===void 0&&(Xn=Ai.length-1),Xn=Math.min(Xn+1,Ai.length-1),{scrollHeight:Un,start:Qn,end:Xn,offset:Dn}},[wt,ui,pe,Ai,pi,Mt]),Yn=hi.scrollHeight,si=hi.start,ei=hi.end,Ii=hi.offset;Mn.current.start=si,Mn.current.end=ei,se.useLayoutEffect(function(){var mn=ai.getRecord();if(mn.size===1){var Un=Array.from(mn.keys())[0],Qn=mn.get(Un),Dn=Ai[si];if(Dn&&Qn===void 0){var Xn=vi(Dn);if(Xn===Un){var Oi=ai.get(Un),mi=Oi-Yt;un(function(ii){return ii+mi})}}}ai.resetRecord()},[Yn]);var Ti=se.useState({width:0,height:Mt}),Di=(0,he.Z)(Ti,2),We=Di[0],gr=Di[1],yr=function(Un){gr({width:Un.offsetWidth,height:Un.offsetHeight})},$r=(0,se.useRef)(),rn=(0,se.useRef)(),On=se.useMemo(function(){return sn(We.width,cn)},[We.width,cn]),bi=se.useMemo(function(){return sn(We.height,Yn)},[We.height,Yn]),Mi=Yn-Mt,_i=(0,se.useRef)(Mi);_i.current=Mi;function tr(mn){var Un=mn;return Number.isNaN(_i.current)||(Un=Math.min(Un,_i.current)),Un=Math.max(Un,0),Un}var pr=pe<=0,br=pe>=Mi,Or=Ln<=0,Ir=Ln>=cn,fn=Ot(pr,br,Or,Ir),ho=function(){return{x:Xe?-Ln:Ln,y:pe}},pn=(0,se.useRef)(ho()),Hi=(0,jt.zX)(function(mn){if(Ve){var Un=(0,ue.Z)((0,ue.Z)({},ho()),mn);(pn.current.x!==Un.x||pn.current.y!==Un.y)&&(Ve(Un),pn.current=Un)}});function Kr(mn,Un){var Qn=mn;Un?((0,Ce.flushSync)(function(){Kn(Qn)}),Hi()):un(Qn)}function ji(mn){var Un=mn.currentTarget.scrollTop;Un!==pe&&un(Un),ze==null||ze(mn),Hi()}var xo=function(Un){var Qn=Un,Dn=cn?cn-We.width:0;return Qn=Math.max(Qn,0),Qn=Math.min(Qn,Dn),Qn},Yr=(0,jt.zX)(function(mn,Un){Un?((0,Ce.flushSync)(function(){Kn(function(Qn){var Dn=Qn+(Xe?-mn:mn);return xo(Dn)})}),Hi()):un(function(Qn){var Dn=Qn+mn;return Dn})}),Cr=$t(ui,pr,br,Or,Ir,!!cn,Yr),Po=(0,he.Z)(Cr,2),je=Po[0],Pn=Po[1];_e(ui,Vi,function(mn,Un,Qn,Dn){var Xn=Dn;return fn(mn,Un,Qn)?!1:!Xn||!Xn._virtualHandled?(Xn&&(Xn._virtualHandled=!0),je({preventDefault:function(){},deltaX:mn?Un:0,deltaY:mn?0:Un}),!0):!1}),re(wt,Vi,function(mn){un(function(Un){return Un+mn})}),(0,Te.Z)(function(){function mn(Qn){var Dn=pr&&Qn.detail<0,Xn=br&&Qn.detail>0;ui&&!Dn&&!Xn&&Qn.preventDefault()}var Un=Vi.current;return Un.addEventListener("wheel",je,{passive:!1}),Un.addEventListener("DOMMouseScroll",Pn,{passive:!0}),Un.addEventListener("MozMousePixelScroll",mn,{passive:!1}),function(){Un.removeEventListener("wheel",je),Un.removeEventListener("DOMMouseScroll",Pn),Un.removeEventListener("MozMousePixelScroll",mn)}},[ui,pr,br]),(0,Te.Z)(function(){if(cn){var mn=xo(Ln);Kn(mn),Hi({x:mn})}},[We.width,cn]);var be=function(){var Un,Qn;(Un=$r.current)===null||Un===void 0||Un.delayHidden(),(Qn=rn.current)===null||Qn===void 0||Qn.delayHidden()},At=Ye(Vi,Ai,ai,Yt,vi,function(){return Tn(!0)},un,be);se.useImperativeHandle(Lt,function(){return{nativeElement:kr.current,getScrollInfo:ho,scrollTo:function(Un){function Qn(Dn){return Dn&&(0,Ut.Z)(Dn)==="object"&&("left"in Dn||"top"in Dn)}Qn(Un)?(Un.left!==void 0&&Kn(xo(Un.left)),At(Un.top)):At(Un)}}}),(0,Te.Z)(function(){if(nn){var mn=Ai.slice(si,ei+1);nn(mn,Ai)}},[si,ei,Ai]);var Zn=Xt(Ai,vi,ai,Yt),Jn=vn==null?void 0:vn({start:si,end:ei,virtual:wt,offsetX:Ln,offsetY:Ii,rtl:Xe,getSize:Zn}),Ci=ht(Ai,si,ei,cn,Ln,xn,Ee,de),Si=null;Mt&&(Si=(0,ue.Z)((0,Le.Z)({},De?"height":"maxHeight",Mt),Ae),ui&&(Si.overflowY="hidden",cn&&(Si.overflowX="hidden"),yi&&(Si.pointerEvents="none")));var li={};return Xe&&(li.dir="rtl"),se.createElement("div",(0,pt.Z)({ref:kr,style:(0,ue.Z)((0,ue.Z)({},Ue),{},{position:"relative"}),className:Hn},li,ti),se.createElement(ne.Z,{onResize:yr},se.createElement(ni,{className:"".concat(Nt,"-holder"),style:Si,ref:Vi,onScroll:ji,onMouseEnter:be},se.createElement(nt,{prefixCls:Nt,height:Yn,offsetX:Ln,offsetY:Ii,scrollWidth:cn,onInnerResize:Tn,ref:dr,innerProps:qn,rtl:Xe,extra:Jn},Ci))),wt&&Yn>Mt&&se.createElement(dn,{ref:$r,prefixCls:Nt,scrollOffset:pe,scrollRange:Yn,rtl:Xe,onScroll:Kr,onStartMove:Xi,onStopMove:Gt,spinSize:bi,containerSize:We.height,style:tn==null?void 0:tn.verticalScrollBar,thumbStyle:tn==null?void 0:tn.verticalScrollBarThumb,showScrollBar:gi}),wt&&cn>We.width&&se.createElement(dn,{ref:rn,prefixCls:Nt,scrollOffset:Ln,scrollRange:cn,rtl:Xe,onScroll:Kr,onStartMove:Xi,onStopMove:Gt,spinSize:On,containerSize:We.width,horizontal:!0,style:tn==null?void 0:tn.horizontalScrollBar,thumbStyle:tn==null?void 0:tn.horizontalScrollBarThumb,showScrollBar:gi}))}var te=se.forwardRef(yn);te.displayName="List";var En=te,ri=En},32637:function(Bn,zn,kt){"use strict";Bn.exports=kt.p+"static/AssistantCode3.a8740efb.jpeg"},93314:function(Bn){"use strict";Bn.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=="},96908:function(Bn){"use strict";Bn.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKQAAAA8CAYAAADogBFvAAAAAXNSR0IArs4c6QAADzxJREFUeF7tnQl4VcUVx3/3JSEBARFEFllcQAMJuKDUD7FqtVbFtUqtS6ufS1soxaW1Si0KBaFVWy2ittqqdQ9xpYq4tLgVFWUThYQlJIEkkJXs63u333lzL+/mrfeF9/KSeM/35Xv3zZw5c+bM/83MOTN3ouGQY4EuZAGtC+niqOJYAAeQDgi6lAU0fUayHqCR5gJXEriS/T6TICkZNOMzIN/gFx7/8vvLiFxDtpfP4G2Xb5Ej6SaPKddav6mPtb5g9e/PF9nSvmTVlpD1S36Sr63WOj1ukD/d+PR+b1NpAekmj5Gve8Dd5lc2ivK4G2lzV4K7Eo/8eSrQ3ZW424rw6J/ST1utTb2jtkuhLAplwgDS7BDj09txdgFqgsjCbwVOKMCYAPH+IAzABIDf8qPYz+OygMus0+8HFQDmYDpaypj1mp+m/qKbgMoKQO+zxwIyCzhNPhOIQQFrAas/uK3l5dlt/SEY9bbn0ZsrS1obynfXNJQXFTeUbPugua5utQZrM7PZHgU2EsIaHJAJUcWp1JYFklKgVx/fX0oqpPSBgw6BASOh/xAlxgC+u6WJqh0bqdi2nrb66gI0sjQXL2W8xHpb9XUykwPITjZ43KuTpcnBw2HA4TBwFBw81Dt66+42aoq2U7FjAw0Ve8R52KxpLB6v86KWjTvuetmswAGkTUN1W7aDBsHIieiHjkVDlhpuavbkU7ThE9wtjQLMbTosyFzGc5pGoD/RyQ13ANnJBk9YdSm9YVg6+tB0NC2ZtqZ6dn/1P+rKirwqaRqrknVuSM9mZ8J0FD2CetmJ1MipO74WkPXn0VOg72CvY1ZRuJU9uRvQPW4ZLes0jdszlvG3+CoRWroDyERZPtH1Dk1HH56B5vHQWFvJzrUf42lrUaMlPJ4BMxOxtnQAmWhgJLL+3gPQR5+E1qsPDdXl5G9YjUdipIreGpzGFUOfpb4zVXQA2ZnW7op1paSiH30qWlIqdVWlFGz6Al1ipmqkXH0wnD0ym8bOUt0BZGdZuivXk9IH/ajJaK4Uasr3UJizUQX/Fb2WOZ7LtfniosefHEDG38bdo4bUvuijJqG5XFQU5VOSv22/3hr8NTObWzqjIQ4gO8PK3aWO3v3RR57gHR13blpHQ121FZTTM7N5Od5NcQAZbwt3N/mDjvDu8jQ11rHj6/XoskevqKxXMuOPfZHyeDbJAWQ8rdsdZct2zYjj0VJS2bu7gLLiXdZRMiszmx/Hs1kOIONp3e4qO60/+rBx6O5WdmzeRHOTz8lO0pg2fhkr4tU0B5Dxsmx3lytTd99B1FZVUZC31dqanMzxTNDmsz9gGcumOoCMpTV7kixXEvrwCV4HZ1vuZlqamqytu2VCNn+NR3MdQMbDqj1Epj5wBFqfgVSU7qWkWB3CENKgEhibme39jCklBpCysf/H3aohrY1w64CYNqrLCJOziRJg1hN+qqtjJklJQx88xrudmJuzBY+cVveBcmlmNr/qmODQpRIHyPuKlVYtjXBL/1i3K7HyDh4Gp94IU2+Ee0+A+pgPJJ3WPn3QEWgpvSkpKaaiosJabxsuJk7IYksslXEAGUtrmrIW5sHAkerb7UO6NSBJ6wcDhnvXkFu354HlDK8GKzOzOS+WJnQAGUtrmrIW5atXCHoCIDXwDDwSlyuJvIICGhran7OIdRjIAaQDyIgW0PsNRkvtR2l5OaXlAcuPmIaBuh4gp1wP/QYrI338ODRUBRpM0+Cc36p0OVT6nwd9PIcdAydcqr7nroL8NXDi5TBmKoyepPgL16n0dS+3dzgGjoaTjY0If7n+Wow+GdK/p1Jr9sC+Ihg1SX0X3Xob6+K3F0FLg0r/egUUbWovSRy8SdNh5PEw4jho2Ae71sOuDbDhVaWvP1nbWLIZvvo3TLwQvjtDvdQlaf+eB2Uxeuu1V2/oP4yGhnryCn3etqmWS+PmjGUsiYhsGwxdD5C/WwsjJirV7xkX3KjyPvZSY+poqoXbBvqaetzF8HPjDMAbc2HIWDjlp8FNsfldePIaH+iTU2FxIRxkyHvgu5D3afCyM5dDprF8emuBN4jM6TPDm/zZG+HTf/l4xpwG1z/nXaMFpYIv4fHpUGVEJEwmaxu/eBFyP4Br/t5exMPnwZb3bUDADouGPmiU9+3FnLxC3BZvW0rHMgzUswEpI5O8Q9LaDAVroHgzDE2H0SdB6kGqJyryYdFJ0GicbLnsfjjLOGn1yT/ghRmBPSajmgBXLg+Qwwd3j4WzboXTDV4J95jkPZxghH2e+xl89ozKEVDdlKVu8RAq/lqNikm91Eg++GiVXlsGD52tRr1ggCz+BgaPAXk/20oxBSTo/YagJfdiV8lequuMEd9SnwYxCQP1bECKwerK4ZELQUYbk2RbbNZbMOQYlbJyMSy/Wz3LdDjvG/XcWAN3Hg6t7XYp4IxZ8CNjmSCj7NJp7cEQyamRH8m8zT7H54WZ8MkTPhlyO4ZM+xcvUGkb3oDHLw8OSDP1m3fgw0ehtlSBWUb2ysL2eh3It7T+iMddVV1LUVnQMFZMwkA9H5CPXQqb3gzsChlVBBSyHm2uh7ljFHiFbn4Pjj1DPT/1U5Bp0Uq/XQ1HnKxSnrgC1r8aHSAvnAfn3aXKfPYsPHN9cKiYywIJrC+a5Ft/WqfsSDIOBITWsnJjRr/DaG1pIbewJKjUWISBejYgZTqeOzZ0l9zyPhxzusp/7BLY9JZ6FifjhhfUc85/YckPfDKsI6iMRnNGq3t+rBRphJyzBuQgrNBD34etHwTXcfLVcN3TKu/d++H136lnKyDlx3TXkcGdv1iB0ZTT7zDv0/aiMppaWoNKP9AwUM8G5Fdvwt8MjzuY+ab/Bc40dr+yfw2rDEdRRgMBlXSArAFl9KwyzgVaR7f3HoDX5gRKjgTIh6rV2lZow+uBSwJTojhX489R32QUltHYH5A7P4P7T4s19ILLk2k7JY3SqhpK99WFqvOAwkA9G5Af/R1emhW6s865HS5ZpPJXLYXsW328Fy+EH9yhvi+/B1YafH/YCoceqdLnZUBpu6NZKj0cICVgLvnRkoSCFk8OBOSXy+DJq6OV1jH+5F6Q1p/G5mZ2lAQJxxlSDyQMFHtATpgGR56iVNvyHmz7KLDxstcrXqpQUx3cdoiPJ5ZhnzUvwNPXhjb+tLth2lyV/86f4I3f+3jF8Zmfq+6SLNsB96TDUVPgNx8qHmnXg2cFlx0OkDIyPrhPrV2FJNbqe8MvtK4S3go2Zcv6Vta5nUGicp9B3vuBcooraXMHfxHxQMJAsQfkRQvg3DuVeazeq9Vgo06EOz9XKXu3wvwMX651fbXgeCgxPF5reQlgLzSCvuHikOJpSiwxFF3zBEy5TuU+exN8aqzXTP5fvgkZxvrxz2fC5CvhtJ+p3KevgzXPRw9IKWHd6w41yoYDmH8csrMAKTql9vWGqoqr6qisaw6pZUfDQLEH5Hd+Atc+qRRdmw3/vCpQaStPzn9gybk+nl+8BhMvUN+XXgCb3wksf+1T8J1rVHo4QMoux7xxwcMfElwXUJt7zg+cDnmr29clux+/MDxoGW0zzlVBc9lNmTMy9Nov0hpy1goY/31Vl3/Ix6rB8ZfACT9UKRJe+vw59ZxIQMq0nZJGbUMzBRVhL7XoUBgo9oCUoPMdxu6GBKQXTIByy4VaKWnwm4/VVpnQf5fAy7/2dcP0B+FMY90XbMo9fCLM+UJNpZEAKflfZqndGH8SZ0acGiEJSC82wjhWPokH3pvnA62ZJ/G+rJsDZZop1nWmePni7VvpuIvg56+oFNlynJ8JzX5OgswCd63zbUH+5Xuw/ePEA1KWGvIOt9vNlr21eDyhz3p2JAwUe0CKyWavhHRjfVVXoUAni38x8ik/geHGFC33yMgIZu2wcWfDr972dZ/slnz+PNTuhaNPhUvuVd6vSeFGSPGQBbjrXoH3/gxl22BIOpz0I593LXIevQi+ttRpBc/5c+ECI2hupt8rMcGvQgPSGk6SsFHO+2rPXLxyk2a8DrLeFirdrtaHEryXy0ZlmTD5Kt9uzTcrVXDfpESOkKKD7G3rOruqmqhuCv9qjcvF+RlZhDBuoAnjA0iJ1ckoaR4wCNV1794HrxsBYivPze/CsWcGLyUgWz5XAVMoHCAFiEInXhZcloBkxQKQvehQJFP6wh2+Lb78L+C+KaH5JUeWE7Ks8KdZaeqqZaFDRsCMN3z79qEk7t4IMjo21XQdQLpSvP8QoKaxlcJ9odeRorCmsSVjHBPtvhQWH0CKJtKRVz3mO4BgNXhFgQrHyC8/GMmhUNlTPvWG9rnVJarcphX2DleIByrOxxVL1Mhsxv5EqkyVWbNh4/Lw4JLc2e/4TvbI3raM2pFo6k1wxkwYPNa3z2wFpJSXeOf5v1d751bdJE/WqfJDkeWBf+A90SOkTNtJvdA9bWwpa8ET4RWNaMJA8QOk2WF9DlEHGmS6FhDszVX7rXao76EwdJy6yF2OjJXLieUIFKqzpPMlHCWjdsFadWTMDglQFhVAnwFqi/HOEYHrPTtywvFIBx96FAzPVODbk6PW3XbCQQdad0fLiz11D7urW9nXHP4eqmjCQPEHZEcb3NFysR49JMxz5SNKm9VPgZzYcQjE4ZOzKy1u8qtt3Jmv8fCEZcyOZDoHkJEsNHcjDBuvuO6bCvlG/DRSuW9Dvly74tHZUumOOG3LUWo7L4U5gAwHHHGsxMESkvOKC40DEd8GsEXRxqI6D1VNka+P1ODtzGzOD7t66XGX3sdyypaguATHhbJvg1UPR9FN3x7WxjbYsc/ezSqRwkA9b4QclqE8aiEJeH/5UseQITs5F81X/+tQSPa6g73f0zHpPaqUhMa3VrppDRMkNxscKQzU8wDZo7q6+zSmtFGntN6GcwOECwM5gOw+fd6lNW31QG6lADLytTHhwkAOILt0N3cv5XZWe6gXZNqhEGEgB5B2jOfw2LLAvmad3bX2pu1QYSAHkLZM7TDZsYD4NDn2YpJeccHCQA4g7Vja4bFtgeJ6D5WNNqdtcXD8TgM5gLRtaofRjgWa3LC9yl5M0jtK+p0GcgBpx8oOT1QWyKt209Aa2ds2hbpczM7Iwrvr4AAyKlM7zHYsEKVz0+5uIAeQdizs8Ni2gIyL8icxSbeNnZv9go0wkANI26Z2GKOxwJ56D+VRODdmGMgBZDRWdnhtW6C6WWeX/Zjk/jDQ/wHkSLPJ/mcrgQAAAABJRU5ErkJggg=="},57177:function(Bn){"use strict";Bn.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAANQAAAA8CAYAAAAeyZT3AAAAAXNSR0IArs4c6QAAEpJJREFUeF7tXQeYFdUV/mcbS1F6UUEsoLC7IGKNJWpERbEgSoxGo7HEQFDRWCAGgdASNBbEhglqsC1rAxVBNGg0qNgLsJRddmFhe3vby3uT7393ZmfeezOv7M57W3LP9/EtM3Pn3DPn3n/uvf85c58CKdID0gOOeUBxTJNUJD0gPQAJKNkJpAcc9EALoNRpCaqt3rh4QIkDvH/jxV/zuZZjrVy8uRzvSzDdrx3HxWnnEnz1eevhOf/79HpNdrAs6wrQr9VvtiMc+/kc0HSan9Nrq8Uzt9hquuZjv8kPev26r8x16X5VPYDHDYT7Vy/L8vo94d7P8u5mcV+w+1U34GEZ7a+5Tg/vV31tbrmu36ff23JcB9VdBo9a5v2rekq14/1wN30GNXGzctPKKgf7eExVKUGBpJsSEkgWYPMHXEuH0sHlB5iW8jrAtE6sd9AW8GidVD9mR/fvxDrAzJ3Yp/ObAGL3srC1XweJnf0awHUQWgGJ52i3P+D9OyOP/QHSAjYT8Lwd3gRGH3Bp5dza34D7LUDsD04vmPzuN9cZGkSAF3xm4JttNoFWdasNlRVNta4SV21l6YHakvyPGurrNivA12kZ2B1TdLSisvAA1QrF8hbpAUsP8EWVkAwkdgMSugHxiUB8EpDcC+g1AOjeG+BciSBWPXA3NaA8Pxel+7LRXF+bCwXpShxeTX0V33ZED0tAdcRW+X+2iaN3j35Ar/7iX/e+XnCpbg9cZfkozctBrauci/9tioIlKSpeUTLg7iguk4DqKC0h7bD2QPJBQP/hUHsNhsIVv+qBq7QI+7O2w93USGDtUoEFaavxoqJ4x7Z2FQmodnW/rDxsD3Ba2PcwqL0PhaLEobmxAXnZmaiuKPOqUBRsSlBx06gM7AlbZxQKSkBFwalSZRQ9kJAEDD4GSD7Yyz6WFu5HQV4uVI+Ho1W1ouCe1NV4OooWBFUtAdVenpf1ts0DfQ6F2mcoOMurq6nCnp2Z8DAMwNEKWJEKTG+PtZUEVNuaVd7dnh5I6gF1wFFQEpJQW+1CTtYueBgeEPLuwGRcNWQVamJpogRULL0t63LeA/GJUAeNhBKXgOpqF3Kzs6Ey3iVGqs29gQnDMlDnfMXWGiWgYuVpWU/0PBCfBHXQ0VCUeLgqK7B3b67I4BDyZloKrlTmQ6AsyiIBFWUHS/Ux8kBCMtT+w70MYGlJMfILCloqVoDH0jIwMxaWSEDFwsuyjth4IKk71D7DGKzCnj05qK0zZnoKMDUtA69F2xAJqGh7WOqPrQeYvtSjL+rr65C1JxeqMfUrTkpAyrGvoCSaBklARdO7UnfsPaAAat/DocTFo7C4FMWlIvBLUYD0tAz8KppGSUBF07tSd/t4ILE71N5DoHrcyMrJQ0NjY4sd8QompazGumgZJgEVLc9Kve3rgZ79gW49UVVdg9wDhWZbMtNSMEaZDxEFdlgkoBx2qFTXQTygxHnz/gAPdu3NR2Njk9mwmWMy8Fg0LJWAioZXpU7DA/0OB479hTguyQZ2/Sdm3lF79IWS2B2llVXILylvqVcBuLAamZbh/euotA+geg0E/ponHqSpDrizj6MP1WGU8WM671eq7fhVweTFwIQ/Cpe8PRfY8NfYuue4y4BbNbb6y1eA534Tu/rjEqEeNAAejxs7cgvg4VfGmijA8rQM3Oa0Me0HqKUHxLM01gEzD3b6udpXX+9DgNNvBs64GVh0PFDj+Isw/Oe7fAlw3t2i/NoHgPVLwr/XiZLtCShGpHr29zJ++aWVKHX5pPU1Iw5jx6RjuxOP2QLUsPaUcLJG6uII1ZUBtTAb6McAI4B7BktAtdcIRf/zM/vkg9HY3IydeQxBGbMFBVifloELnezecoRy0pu6rsU5QJ/DJKDogXYeoWiCp2c/7mWF7MJy1Nb7kBNwmkaXgJKAioYHDJ0dAFBqt55Q4ruhyFWDooqArzkcpdE7HqBOuxE4aKBokE9WALUGO9PSStxc4Px7xWFzI/DhI0YDDjoGOP5ycbxjE5CzBRh/JTDiDGD4CaL83m/E+W9e8yUM+g0HTtIC6f56/bvd8JOAURp75SoAKvYDh58gStG27tq68L3FQGOtOP/TOmD/j76aOP09YSowbBww9DigtgLY9y2w7zvguzeEvf5ifsb8bcAPbwNjLwF+Pg3oPQTgubfnAcW7ASfXUAOOBH52PTB0nKiHn6UXZwFFu4DPVwEFFssRK0BRz7gpwn/0U+7XQM6XwFfpYrsxpyUhEUjqhdqGJmQXVgRoj1NwR+pqLHOi2o4HqD99DQwdK55t7mjRKfyF++4t1xIf66uAu/oZJcwNuGYOMHgkcKoNs7TtfWDltQZoOd9eshfoqel76OdA9mfWfp6+FkjTpt/vLhA79Jw1PXibrLoZ+OwFo8yIM4EbXwT6MF5iIblfASumAuUaI6oX8e+kOz4Crn3GV8HjFwLbP3AOUJfMBybO9m7eYCnuJmDjQ4L4MIu/rR8+Bty2zvCxuezuT4AVVwHVxU70bR8dao8+XsY1c38F3Ca2j4WcpNG7NqA4MiT1AJoagNwtwIFtwJBRwPATvVF0r5TmAItPBOoqxfEVDwLnapn+n/4DeHlaYONyVCHw4hPErqoPjATOvRM4Syvr3RVWE2/jaQvhF38HfP4vcYEd7ZZ0sWsu5cBPYlTiW58j6cCjxfmqYuDRCWLU0cXcSQ9sBQaOEPvcmcVJQF08F7joz4b2sr3iRcOX2eHjxT9dVl4HfPWqta0cnRmX4r58WZ8CRbsD24Mvj8UnOE7kqN16eT/t2FdWjcrawFHfKRq9awOKzVpdAjxxCcC3vS79jwBmvCs2+6CQStbfrJxOzdsqzte5gFmHAU31vp317BnAL7VpJke55ZN8r4ciJQjyedsM4uLl6cCnzxo6uDcdp42XLRDnvlsDrLjSupPqZ7duAD5+EqgqEmBkh2fHb+uUjy+eJXliI0rK6/f6TrF5ji+TK5aK65wCzh1lbyvb48nJQM4XRpkBRwHT3gIOGS3Obfw78OYsX5+29YgvnLgklNc0YH+FNgX31ekIjd71AfXU5cCP7wQ2B9/q7NScwjTUAHNGCPBR7tgIHHu2+D8DkQxImuXezcARJ4kzz14FfPuG7/VQgLpkHnDh/eIerj3+daN1d9GnlQwM862tr7/MI1QoHW0FFNdLE+8ToQ6uFTlFtpJFe4C+Q8WVmb2NdaO/rS/cCHyxyro95m4Ve9ozNsn24MvBKeHW10nd0dTsxo5C663TnaDRuzagOJ2bM9K+SWZ+ABxzlrj+1GTgx3fF/0kS3PSy+H/mv4FlFxg6zCMYG3z28MCFdChAzd4CDDte6Hz0PGDnR9Y2nvxr4IbnxbX3HwTe+pP4v7mT8mVw/5HW5A3LthVQ4XboO94Hjj1HlF403hr8ZfsEULQ9HwJUz1gHpJwnTj89RZAtTgpHW9WD3cU1qG+y/iK+rTR61wbUD+8AT2uMn1XDTH0YOEfLPsn4I7BJI3q43zZBcdAgsUZiJyjfJzSYRxcuwt+cHag5FKAerRRrO8p3bwVOKXWNJEdSzhdHHAU5GvoDas/nwINn2nc7JwHF2NrxUwCydP2PFEQMiRzulcdjfV1Ke2iXv61b14vpt52Y169v3Ad88LCTcBJ2KvEoqmpAUbUFeypqaxON3rUB9Z9ngFdn2DfK+fcAzHWjbFoOZNxplL1sIXDBfeJ47VxgvVbuLztFh6LMSwWKdgbqDwYodkpej1RIpS85ObCTfrUaWPnr6AKKDNlVy4DxUwURE0rsABWqPZhzOEXLNfz4KSD99lA1RXbd+1NCiahrdCOrzH4jpLbQ6M4Daswk4MhTxYNu32idXcxcN7JklPpq4K6+hmOcpM23vAw8f7290yc9AEyaI65v+BuwxsRkkbiYv0PM6fWF9lGnAXd/LMoza/qRc611BwMUR6ZHKgz6mbE2uymQWTsZNaspX6iE07aOUInJwO0bgKNPM9qL8bHCXUBVoRhdmxuAibOMaawdoL54EXjht/btYR791y0E3pkfGWBClSbjH0c21IPM4no0e6yTlttCozsPqEsXCOdSzOyZ+WFJs87SWJ7CncD8VOOqeX2xYByQrzFu5vsZgF2oxaeCxaHIdDGWZCfXPgucdoO4uuoW4DNtvaKX/8M7QKq2fvr7OcDJVwNn/k5cff4GYMtLkQOKd5hz/exGuWCdI5Lsg7YCimzj5EXCmrzvBYXP4LO/zPrcCGzbASrYS4j6rvuHCBxT7MiLUKAJdZ3Teag44GpCWZ39j3a0lkZ3HlCnXAdcv1I81tcZwD+vCXxEc5nMD4FlE40yv38TGHuxOF5+MbBtQ+D91z8HnKKxTcEAxSyDeaMFfewvDA4TlHrO3UNnAdmbfUsx++D3GoPH0S51oghIskPNHma/9gm1hjIvvv0pc7MF4yaLNQuF9Dzf8JRYAop0NmcdlGeuBL5fE+hL/qbT0gJjOmgHKLbHn48CXD5f0Ap9bA/67eDB4njp6SKbxWnRfjmzqr4ZuZVBszJaRaM7DygGTe/TsgsYUF0wBigx/SACpxB3fyJSbSj/Xga8pn2vw+OpjwDnaOseqynbYWOB2V+KqRglGKB4neksVlQvyQiSEhQGVJdoNLi5ARkPWpRtgE6/xnhP+h32TW1eZ5FlJNtoluMuBW59XZxhytL8NKCh2rcMR+H7vzFSmB7+BcBMAkosAWWegvPlyJekv5hBx2t2gOK1/64EXro1UMeEu4ApfxPnmYa0VJti2nu59Vfi4r27y24vaYYnyLdqraHRnQcUH/P29cAobX1RXSpAw8U7O8mp1wGHalM8bu7OEcTc4UZPAG57z3AWsxW+eEnM148+XUw/yL7pEgxQZOgIvG9eF8HC4l3A4FHAib802D3qefJS4CdTneamumgOcLFfOs0ixoR+sG9QMx1P2j3zA5EzSFZQF3MnZMYA10cMPvOzbU4zT77GyJbwZ8daCyjq58sjHPlhrfDJb1aKNqMU7gBemgZk/VdkeHCtfPliY82s6w0GKJYhkULSgdN5Zq4wTKGzrbzOGQtnLtES9gmPB/uqPKhsCL6hbFwcLkpNh03nCDQwOoBirIajlJ4gaueY95cCb2kBTnMZc0zD/16CZO0cY14fDFAEEmX8FdYWsJOvWwAwF89OOCVcmGWkCIXz9uR0lNNSf5mRLH6rlsIg6LQ1Rt6iXf1ct3B0qncZJVoLqEg6qM5sWrUlM0hIruiM386PBdj09aUdoLZtFOSGTq8HtK1bZKywX0RVvL/cBlejir2u4D9+qCjYnjoaY8Pd1CU6gKIz2BGvecpIIDU7qDRX0Nl881oJf7WOMYnTb/K9Wpkv7vtxXXjJsWTASB6Q8uVbVo/9UCunWqRlv18buunIcumZ5czt46gZSs64BTh7OjBwpJFnZwYU7+cCmTlyzB0028ZrXKcR6Jxe+mdgxxJQtOWIU4CrHzdYPP3Z2Y7fvi5GV+b7MXmWYgcopi0xiM2g+aARvh7kfhP0LUf0GAk5vu2l7qDTPpoSCY0ePUDpTunRVwzrnO6xE/NNFm5KCXcBHTJaLFT5yQWdHkrsOhs7L6co+ucCTKMJR9jRF+cCjMUwK2HW0MD1Tjh6gpVh+hPz2Q5NE+ApyBTrznDo9LbWHe79tHFIigACaXJOH/VUrXB1mMuxTbne1j+nqSltjZY235NX5UFFiGlfJDR69AHV5keOUEEkb+9wVHMac/UTouTm5wBmjEvpMh6oblKRUxnGb14reHzMaoSMNEtAheoac74HDkkRpZae4ZslHepeeb3De4DL6O1load9/JQ1nE1dJKCCNTmTPUmQUPi90kItobXDdxNpYCQe2F/tQXl96J+PUoD30jJwUdDZe7vsehTJ00Za1skpH4O6DO5SMu4CNj0eqTWyfCfwQF0zkFUR3qf3oWj0rjdCHZJqxE0YczF/PRpJ4zJyf+l8b3ayV5jrZ7W/RSQ6ZdkO6QGyfTvL3Giyye0zGx2KRu96gOqQTSaN6ugeKKpTUVQTBjkRgkaXgOroLS3ti4kH+L3hjjICKvS22cFodAmomDSXrKQzeGBPpQc1Nl/yBthvQ6NLQHWGlpY2xsQDFQ0q8qrCm/bZ0egSUDFpKllJZ/AAOYnM8GJS3sexotEloDpDS0sbY+aBAzUelNWFjknpBvnT6BJQMWsqWVFn8EC9G9hdHl5MyjtK+WWjS0B1hlaWNsbUA9mVbtQ2hWb7TKPU7anp8Eb9JaBi2lSyss7ggQjJCZ+90SWgOkMLSxtj5gGOS/zHmJQ7jMyJFsM0Gl0CKmZNJSvqTB4oqPGgJAJyQqfRJaA6UytLW2PmgcoGFfvCj0m10Oj/A9jGm+feuyEMAAAAAElFTkSuQmCC"},81378:function(Bn){"use strict";Bn.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALAAAAA8CAYAAADGxTD9AAAAAXNSR0IArs4c6QAAFoFJREFUeF7tXQl4k1W6fv8sTbqvlJa2tJSy74ugsiMqq4AKIlDUueNwR2dGHR0XdLwixW3uuF6Xq3O9o15nxuUiIIsCsijK1pa20NJ937eke5tmmec7f/40TfInaUNK6+R7nj5Jk7Of93z/t55w8JBnBYbwCnBDeOyeoXtWAB4Ae0AwpFeA+1SWbbA1A07KQSID6JWT0ivAyThIpBwgBSQy4+fCq0T4jANnrEdlWFkpjK/0ndAetd/znpMaTO0LZcz74tsxti0xjqVXfeNYZcZyxvHSuK3GbDYX03iMbbLy5nOz+pzGbGDrwpfj52DQG2DQAwad8Gcwvudf9ToDQN/pDdBrDYBFWfqMry/UAytP9fjPjJ/rYVHf2L7Qph4GaA0tOj1UnBYqvd6gMugMKr0OKoOOq+UMhhQ5DGfHPRNWMaSRaxy8bQBzPGAZAI3AFMAoAIJtnBnA2WaagdlU39iOAKKeje85FKY2TYDkwWh+APi2ebD0AJ8HMn/AzAHFA4x9Jxwss7bN5yXUpbnwB4SvY3Nu9LmwLr36NIKWAEhA1BlMgOUBCAZYBtJe761Byx+A3vV54Av1efDrtUawm4G+N+D5MfUcHH5s7H890KnqNjRWNGkaqlXqhgp1VV1JwxkOSJUAqUB0xk4s0Q4FgIty4KEweM8Yba+ARCmBzBuQeksgVXKQKugVkAdIoRwhhU+EHJycg0GrNz01Whs6UJhegtLsCmi7tI0GYC8H7osYTPhuO2Z3D9a19gB4sO6Mm8flFSKBd4QcyuFS+MbKIfOWMM6v69KjIq8WhVlFaKpvAQeuFsCr/gh45wmsbXHzsPrcvAfAfV6yn18FjgN8YmUInKiAd4TMJObUlNQj42wWutq7SNtXA9zrIVC88nts7Bgsq+AB8GDZiUEyDrm/BAFj5PBLUAASniNnpeSgvLCSjZADl8dBev8ubD41GIbsAfBg2IVBOAaSnUNnK6GM5DlyQ5UKmSlZ6GjvJBiT5epdGRSP7MRGzbUcvgfA13L1h0DfPtFyBE9VMKuMVqNH2rl0NNapBG78vQ98b9+B2xuu1VQ8AL5WKz+E+pV6cQiaqoAyXAp9tx5pyZfQUNdoBDEKAG5VEhJzrsWUPAC+Fqs+RPsMnOgF3xg5dBod0i9eRmM9D2IAFYB03m5sKRnoqXkAPNArPsT7CxingE+UFDqdHpfSMtHYYJIecn2hnL8DG+sGcooeAA/kav9M+gpIkEMZJYdBq0PqxXS0NDcLMvEFKRTzB1Kx8wD4ZwKqgZ6G/2g5vCPlaGttR+rFZMaRiSSQvLILW58YqPF4ADxQK/1z64cDs05IlByqqiqRX5gvKHV6gLspCYknB2LKHgAPxCr/TPuQ+XAImOQFzsDh0pVLUDcJ5jWUSaGcuBMbW9099WsOYDKYU8Qbi5zqshnZ6e41uGrtSxScU3NQhErR1UBhae4hstkaBiiWzDtSykSJri4NLmYmQ6s1dfz6bmx7xD0z7Gn1mgN4bX48CyapP9eBI/NLXZ5v3JYAzHlnOGvnyMJSqNO7TG36xMjYe41KB22r+GGR+nC48aNIVrb4780o2+OYkYTOVWLRnijk/JcKee+qoVHzMqE5zXlvOGLW+0MRIsXBGUVouuweJ9bys7HwjpJBldaJk2vcH/brP9aLRb1V11aisLzAKEpwWimks3Zic4bLm2qngUED4K5GHWpOttuda+U3bSj83ya7ZeLvCcD1f+HBd3hOMVQXeQDL/DhsVI1l71MerUXOm/zjzhYRV1lfmsC+Sn28FtmviZcV6t/wUSRGbQ5g/575RRWKPuE1c3Ma8+sgXPcmf7gynqvH5d3OO7DkARIowigzwDEtPxcLryApmrK7cGqtYwB31evQ3Wx94Bz3xJcgOThwrBd0Wj1Ssi6gW8sfTA44swuJ8zje9ewWGjQAdmZ2OW+rkPIwRfeJ09UAsH+CHGuuxLNOzj9Yjfz37R8axTAp1hWPBnmsOuu02BtXCL3Ges8IhOvLRkPmI0FjSie+ud55u//YB4Iw+w0e/Febkh+qQe47apea9Y2VQeYrQXlNGcpqeubFQfKrJGz9wKXG7VQeNADuqNKi6FNrrmU+9rqfOlDxtf3HudMAfkuFmPV+iN0QgMyXG6BK6xE1gqYpsDI5jnX9071VKHYwrklPhWDa88NY+csvNiDj2XrRJZ/7fgRG3xfIvv8qrgAdFc4Jq4MdwHQoCcQkA6fmXIBOz8v4HNAog2zcc9gsviguoNutAKZHsdRHYnd4y76LgU+UHKr0TvxwFx+y54iIu7WX9Ww8SwGS8/mp8YkBmPNuBHv/7fwSHph6A0jBshQhVqbGIWiKAgUfqnFue42p22HzvHHzyZHs/+83VKB8r/ihoRQjkuMp6IVShvYlFGLyjlCEzVXanIZXiJS5Y4laizSij+78/2lisrRA8kAJCz53RKO2BLL+ic5tr0btaftiGZXrrNGhu6n/IoQwJt+RMrbOJTVFqG4030vJX3dj632Oxt6f790K4CWHohF5s29/xmW3DoH98Oyex9TY3wRh9mvij1f15S4cWVBiBWCBW2vb9fhqZIFpEyNv9sGSQzFsDCdWlqHqqDgIiIsv+DyKlS39/xac3lSJpd9EI+Im1+Z9+YUGZPyHbaYVMlOB0DneNtdo5J3+GL7Ih31HcraYtYPmXPSx/SdeXzeORAifETJ0dnYivTgFBoMgRpEMLF24G5tP97VNR+WHJIBL97TgtBm37i+AJV4c1hbEsywEc8XOHJRHl5Si7rTtBASZLwfi4n7xXmydT60rR8XBNkx/IQwhM3s4cMgsJVOqCDT1Z5xLZij6W7MowMxFFkcbLPZ9R7UWX8XwFoOrSd4jOUilMuRWZkHdZq78cpdliJ5xtZNFBwTAxAW+u7nMap1uOhbDTEo1p9qR8oh95Ywe9YJp68fESpT8oyc9K+x6JUas8GPtB09TIGoV/55Eg45qHTprtSj8qMmmFWLKs6GY8scwNOdqcGBSEas3KjEAN3xotGRcV9xLPjafBJnFEv4tyPTRsZtKUfu9NUBJTApf6NOrD1dAYw7gikOt0Hc7r+SHTFcys6W7AOwVLIFXoBQ16iqU1BdaTvOJ3dj2iitzt6w7IADuqNHiq2jr0357xWgow2UoP9CK8/9eDZ8YOXxjZPAZaXyNkcN7uBRHF5dh7gcRGH1vIHQaA/ZE5ovKjk4rcUYzmt9oOW7L5i0Ox28tQ/Xxdkz+YyimPhvGPvsyPA8albV8GLXaF4u+iu61nqIAPhGD8Pk+aM7R4MBk/pC4QuYA3juqAJo+yK/XvRUOkpPdBWB6qpHuo9F0I73sgsU0uTYZFOShc93gb2x5wAD89YQiDLteyUBKDgVSZGI3+bOUb0e0L6EAEx8PRfQaP6gyOnFytbhts68Apr5vOT0SYXO9Uba3BT9sqMSNn0QiblMAOuu12BNpffDIbLYqLY4dPnMSA/CKlFgET1UyRdVcdnc0b7HvB7MIQWP2jiJlk8OVqgy0a6wU4H27sW1df+d+zTjwiRXlTF60R6TFd1Rq0VbSjbYyLdpLu9FW2s2UoxG3+qK1RIumzC67GnN/AEwmqmlJw5D3ngppO+pBjgCSYet+bGfc35IW7olih4mIQK4M44EsBuC1hfHswDYkd+LECuv2zNunC0wcORXMAaxR060nzsNB6ith9mp3cWAaiVewFBQnUaEqRVVzudXgOEjWJGHrAedHLV5ywDjw/rGFWF86Gu2lWrSV8cCM3xbIjPoElB+3VjHw0gbaIsHlXPyPZvyUWCU6I0sAtxV3Y/QvApH332pRTxx56TgJZwLOBtUYyP0kKPhrE87dX92rL6k3hzvrEtiTgwBZ+HGTybsmBuCN6jHMyO8M0eElU5w9MgfwF2F5fTKBCXZodwKY3MoE4rauVmTX2vQkF4dCOfFqpOcPGIBtycArLsQieLoS3a16ZL/WaFOWkyo4hN3gjejVPMdLe7oOWa+YUlms9tkcwAR2Uuh0HXrsH1folCuZYgjWF4/m+9pRh6w/Wfe1+EAUgiYp8M0NJezJILiubQGYAmvu7hjnDHZZmeY8DQ5MtC8nmwOY5Gq6b81Z8o6UMYuIOwFM3gvv4TLGjDJqkqHVWcd8SICXdmHbU86OW6zcNQWwI/OX5aAJ6IdnFqO1yPZNR8RJJz8dhomPhfSqShz/4NQipwAcscwHSw/zNuDv76hA+X5rJwYFDJFtmQKFzA+MLQCbx1VUHmlD9bE2m3sx/qFg5tBRZ3bh0PRipzlwfwHgVgADkAdL2F1zZc1FqG/v/RQzjrmbg9e0JGy60t85UD23AniZUfsmj9P+sdZchTRWAgxxMb943jtli7Tt5HnrRsnnLWg4T/cS9KaEXwZi5EZ/pulLjB45KkHyYe7bauS8pWIXdDgTzDPrtXCM+00w62BPTD46q+2HPToCcNQqXyzay1srLM1/5rNYkRyL4GlKNKZ24pu59mMkzDnwoZnF0DQ5H5o546VhzH3ubgBLlRLI/Tk0dzQjX51pc185cCeTkLhk0AL4ttxR8BvlxdyZx5bwygu5Q8l1KRDJpxTk0pKnYU4Aoti7/EEu1/Zyba/YB3Kn2nJ5Lvh8BAtTtKRvbyxBwwUe8M5Go60rjudd2xmdODzLcbCNIwBPfT4Mk5/iXbv2QihXpsUxsaTuTAeOLrRvZTIHcOmXLcy06CyRJYgcL+4GMF1XJQ+RsvvWLjcmQ0fXadogCbh7diHxY2fHb1nOrRz4rtYxTNkp+byZhQ7OejUc4Yt9cHBKEVryeDFAUM7MvWurMuIQOEGB6hNtOH4Lr8WS6eq23HhUHm5F+tP1vcSIcb8NwqQdoaDNNHQD437Lc1BnwinZ3b7G8xS+0BvLvuNjILLfaETqY44TbB0BeOmRaEQs8WXOhs8CckUDzVdfHoWAcV6oOtYGstjYo8FuRhPGToyJ4lRKW4rQ2NUTa2I+N7o8UAq/cTuxvl/hcG4DMGUd3FHNx9ReebWRKV7ktiVtPPcdFZIf4j1vzgJ4WlIYJj0RCl0nKWRFzGIhELl0dZ383bt9MaORy3j6i8NwfHk5yFohgI3abS3U4OCMYuja7XM3ewCmw3Fn3RjQfWP15ztwZJ44Z70tLx5+cXKTLdpZAP90TxW0rc4H4ox9MAgRS33dzoFp/BTYQ0p4i6YZha1Z9qb03m5s+3V/uLDbAEw3uaxM4e2+KY/VIucNFWb+aRjGPxzCrA57YwuY2coZAFMg9205o9j9tln/2Yi0p8Q5oxiAzZUpciuTB45kZqLkR2qgvtSFZcd47isQZVc4cnHbA/DIDf6Y/7cRrDlH1hMyMZKFoOj/mnDmvt5KD3FmWk+BYtb5IXYjHzx/9pdVIB3BWRqzPYgF+5B+cP6BHq6ozuhinsKrSSRGyPwl7B7izJZU6ETynDhAL4X0hp3Ycr6v/bsNwObKy+m7K9njnUxUxIVJO039Qy2yX1c5BeDrP4xAfGIgU1b2jym06doVJi4GYOK0ltYJqlN9vA2Xkhow+9VwZtKjCKqa4+0smozeH1taJhrMQ/XtAfjmUyMx7EY+auzriYUmscnWJt1Zn8BiCLLfVCH10d5xIRMeDcaMl8L7urd9Kn/xyVpc+bPjzJM+NUpc2FsCCQeUdRRA1S3OeDjg4lQor9uIjc5rpO60Qlz39nCM+RUf6GKuTC3aH4WoFX4sFpZEgbV5fE6cmAx8OanBJJemP1uHzBfFbcCWgBJkYP8xcqzJ4uMdiAiYFBif+VIjU/JINhfk5rz31YzDr8kZxTxsZJc9NKNYNFlTDMAhsxRYfpZ/AjnjQt7UOZYd7LRn6pD1cu85DmUAc3L6SQgJ2rXNKOiwK0ZQbu9Du7Dtzb4cErdwYDLe316eAJKDyQa7L77HsxS9zg8Lv4hC7Q/tOL25EreejrULYJKdKZWGLBDkzeuLTGquxJFiSMmHJZ+1IOvlBjRl8Y9LYTz0XrAXU8KneQaEvYMjBmDzWGjhCSS2MaSg3lHJ6wskEhR+ZB2nS8qQJUUs8wVF01Ecx8Wn6pD9qu3DPeU53hJCQVXkkcx/X42uut6MTswD2hcwiZUlzxz9NkduZxq6DeJiCgeu2RsY/zTsuFotOnELgEes9MXifbzt0zLFhsBNFgaSOYmckYFJGfIf44XmbMcy2vTdYSzwh+jgtCITUClIvTmvmylrAo1Y7osFX45glhLiyidXlZuC16nPVem8ZYBk9q8nFNq0CdsCsLmVwBnuO/EPIZj+Ap+SRFkkDeesbd3CmAkMI1b4ghwfw+bxMjwRJcSeWF1u/aTggDlvDwc5X8htT0Q28eK/tzD7OMm+7ibBNl+tKUO9zn7WDQd8loRtm5wdk1sALERz0SBI9qOYh/GP8KYtSxKi0djPTxnjWsnBwXEcA5Wt5Ehq48y91UyuJgpf5I15n4xgSiEBjoiSK/dEFYgGukTe4ouFe3rAe+GBGuT/pXfyprkcbysugvqxBDB9tvRIDBMHaPxkEqv+js/oGLbAGzNfCYeuXQ9dFz9fUlDDjNkVFAdB4ZZkUbEkGi/FKUet9mNxGgK1FGhw8ck6u2lPVJZMWgRicvpQZJwJ+KfaWYZ2OeUaOq8LOosvVo7iTCgxuVuvQW53msO6UnC3PI/Eow4LuksGnvnncIz/XTDqz3bgyIJSZqqypUA5M0CxMj9urWTiABFpuhvqE/iFMpKjDGaSUZedGMnuM7jwYA3yP7CdeXzT0RgMX+xjU7myBWAy7y0+EA3/0V649Hw9Lu3qSZ2nQKA7ahLYD6pYEkXiHVtSivqztrmv5RqSKzv/AzX70/fxN4ToYFL0XdBk3rJBThvy/rnzMhT62TNyahTpMtFhsO1OF9aEfsYgHKFTfoeVDh8PbuHANJCJj4ewC0QIGOQgEMvh6i+IKw609hIpxv8+mAWp0O0+ZftanLo0hOKRyUYrBl4aG5mvKOWo6ojtRY+72x+z3+Lz8egOhrofOxhXpUd8+h+tc9oS7g9EAF0EYvwJLNJc6n/qQOW3bb0SVS3XhTyYK5LjUL6vlUXJNSaLixlOrSnHZ55MeSaU5fE1pjrEilPNOiqkMtSiSmc/1oNxbXDPJSFxp6P23AZgRx17vu/HCtAD5mo/5t3Rpp2p6aFHji4VBgdaIwd0SsFN2YlE/tZAEfIAuB848lRxbQUq9Plo0ts3hxp7+HY3ti33ANi19fbUvsor0GFoRZHOvk1Y6FIC7q5dSPzcw4Gv8iZ4mnNtBQp0l9BlcHzFAAeu0h8B48V+JdQjQri2D57a/VyBBkMNanSOw1WNCt0bSUh82FZXHgD3cwM81VxbAT10yNWlQm+6vceupKuTQTJ7J7ZYGZE9AHZtHzy1XViBSn0B1Hpnr5jlziZh642WV7V6AOzCBniqurYCnWhDodZ2upGtliXA9l3Y9r75dx4Au7YHntourkChLhOdDjxzPV1wKl8oxpn/Fp0HwC5ugKe6ayvQbGhAuc75SwY5cB8lIfFeoVcPgF1bf09tl1fAgDxdut0wS+supIt2Y8v3zELxqSz7ajsnXZ6Sp4F/rRVoMFShRmf/yq3eK8JljcSE6dsxu9sD4H8trAzK2eqgQ54uDXohPdyJUXLgnkxC4sseADuxWJ4i7l+Ban0JGvW2U+9t9c4B7QZIJ3oA7P698fTgxAo0GepRobN/qaFlMxy4/f8E90wA8RE2tUgAAAAASUVORK5CYII="},16722:function(Bn,zn,kt){"use strict";kt.d(zn,{Z:function(){return me}});const pt=ne=>typeof ne=="object"&&ne!=null&&ne.nodeType===1,Ut=(ne,jt)=>(!jt||ne!=="hidden")&&ne!=="visible"&&ne!=="clip",ue=(ne,jt)=>{if(ne.clientHeight<ne.scrollHeight||ne.clientWidth<ne.scrollWidth){const Te=getComputedStyle(ne,null);return Ut(Te.overflowY,jt)||Ut(Te.overflowX,jt)||(se=>{const Ce=(Bt=>{if(!Bt.ownerDocument||!Bt.ownerDocument.defaultView)return null;try{return Bt.ownerDocument.defaultView.frameElement}catch(nt){return null}})(se);return!!Ce&&(Ce.clientHeight<se.scrollHeight||Ce.clientWidth<se.scrollWidth)})(ne)}return!1},Le=(ne,jt,Te,se,Ce,Bt,nt,et)=>Bt<ne&&nt>jt||Bt>ne&&nt<jt?0:Bt<=ne&&et<=Te||nt>=jt&&et>=Te?Bt-ne-se:nt>jt&&et<Te||Bt<ne&&et>Te?nt-jt+Ce:0,he=ne=>{const jt=ne.parentElement;return jt==null?ne.getRootNode().host||null:jt},Dt=(ne,jt)=>{var Te,se,Ce,Bt;if(typeof document=="undefined")return[];const{scrollMode:nt,block:et,inline:ht,boundary:st,skipOverflowHiddenElements:gt}=jt,vt=typeof st=="function"?st:dn=>dn!==st;if(!pt(ne))throw new TypeError("Invalid target");const St=document.scrollingElement||document.documentElement,Et=[];let Tt=ne;for(;pt(Tt)&&vt(Tt);){if(Tt=he(Tt),Tt===St){Et.push(Tt);break}Tt!=null&&Tt===document.body&&ue(Tt)&&!ue(document.documentElement)||Tt!=null&&ue(Tt,gt)&&Et.push(Tt)}const Ot=(se=(Te=window.visualViewport)==null?void 0:Te.width)!=null?se:innerWidth,$t=(Bt=(Ce=window.visualViewport)==null?void 0:Ce.height)!=null?Bt:innerHeight,{scrollX:Xt,scrollY:Ht}=window,{height:ve,width:ie,top:Ne,right:xe,bottom:Pe,left:Qe}=ne.getBoundingClientRect(),{top:_e,right:an,bottom:Ke,left:re}=(dn=>{const Oe=window.getComputedStyle(dn);return{top:parseFloat(Oe.scrollMarginTop)||0,right:parseFloat(Oe.scrollMarginRight)||0,bottom:parseFloat(Oe.scrollMarginBottom)||0,left:parseFloat(Oe.scrollMarginLeft)||0}})(ne);let Jt=et==="start"||et==="nearest"?Ne-_e:et==="end"?Pe+Ke:Ne+ve/2-_e+Ke,Ye=ht==="center"?Qe+ie/2-re+an:ht==="end"?xe+an:Qe-re;const Gn=[];for(let dn=0;dn<Et.length;dn++){const Oe=Et[dn],{height:sn,width:ln,top:Vn,right:Ae,bottom:yn,left:te}=Oe.getBoundingClientRect();if(nt==="if-needed"&&Ne>=0&&Qe>=0&&Pe<=$t&&xe<=Ot&&(Oe===St&&!ue(Oe)||Ne>=Vn&&Pe<=yn&&Qe>=te&&xe<=Ae))return Gn;const En=getComputedStyle(Oe),ri=parseInt(En.borderLeftWidth,10),Rt=parseInt(En.borderTopWidth,10),Lt=parseInt(En.borderRightWidth,10),Pt=parseInt(En.borderBottomWidth,10);let Nt=0,Zt=0;const Mt="offsetWidth"in Oe?Oe.offsetWidth-Oe.clientWidth-ri-Lt:0,Yt="offsetHeight"in Oe?Oe.offsetHeight-Oe.clientHeight-Rt-Pt:0,Ge="offsetWidth"in Oe?Oe.offsetWidth===0?0:ln/Oe.offsetWidth:0,De="offsetHeight"in Oe?Oe.offsetHeight===0?0:sn/Oe.offsetHeight:0;if(St===Oe)Nt=et==="start"?Jt:et==="end"?Jt-$t:et==="nearest"?Le(Ht,Ht+$t,$t,Rt,Pt,Ht+Jt,Ht+Jt+ve,ve):Jt-$t/2,Zt=ht==="start"?Ye:ht==="center"?Ye-Ot/2:ht==="end"?Ye-Ot:Le(Xt,Xt+Ot,Ot,ri,Lt,Xt+Ye,Xt+Ye+ie,ie),Nt=Math.max(0,Nt+Ht),Zt=Math.max(0,Zt+Xt);else{Nt=et==="start"?Jt-Vn-Rt:et==="end"?Jt-yn+Pt+Yt:et==="nearest"?Le(Vn,yn,sn,Rt,Pt+Yt,Jt,Jt+ve,ve):Jt-(Vn+sn/2)+Yt/2,Zt=ht==="start"?Ye-te-ri:ht==="center"?Ye-(te+ln/2)+Mt/2:ht==="end"?Ye-Ae+Lt+Mt:Le(te,Ae,ln,ri,Lt+Mt,Ye,Ye+ie,ie);const{scrollLeft:Ue,scrollTop:we}=Oe;Nt=De===0?0:Math.max(0,Math.min(we+Nt/De,Oe.scrollHeight-sn/De+Yt)),Zt=Ge===0?0:Math.max(0,Math.min(Ue+Zt/Ge,Oe.scrollWidth-ln/Ge+Mt)),Jt+=we-Nt,Ye+=Ue-Zt}Gn.push({el:Oe,top:Nt,left:Zt})}return Gn},qt=ne=>ne===!1?{block:"end",inline:"nearest"}:(jt=>jt===Object(jt)&&Object.keys(jt).length!==0)(ne)?ne:{block:"start",inline:"nearest"};function me(ne,jt){if(!ne.isConnected||!(Ce=>{let Bt=Ce;for(;Bt&&Bt.parentNode;){if(Bt.parentNode===document)return!0;Bt=Bt.parentNode instanceof ShadowRoot?Bt.parentNode.host:Bt.parentNode}return!1})(ne))return;const Te=(Ce=>{const Bt=window.getComputedStyle(Ce);return{top:parseFloat(Bt.scrollMarginTop)||0,right:parseFloat(Bt.scrollMarginRight)||0,bottom:parseFloat(Bt.scrollMarginBottom)||0,left:parseFloat(Bt.scrollMarginLeft)||0}})(ne);if((Ce=>typeof Ce=="object"&&typeof Ce.behavior=="function")(jt))return jt.behavior(Dt(ne,jt));const se=typeof jt=="boolean"||jt==null?void 0:jt.behavior;for(const{el:Ce,top:Bt,left:nt}of Dt(ne,qt(jt))){const et=Bt-Te.top+Te.bottom,ht=nt-Te.left+Te.right;Ce.scroll({top:et,left:ht,behavior:se})}}}}]);
|