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(Mn,Rn){"use strict";Rn.Z={lists:"lists___xhHyq",item:"item___pWJAA",children:"children___sDG61",diamond:"diamond___FwgzD",button:"button___WPN6r",mathWrap:"mathWrap___FmnMJ",mathFillWrap:"mathFillWrap___PmY3H"}},8423:function(Mn,Rn){"use strict";Rn.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(Mn,Rn,kt){"use strict";var ft=kt(59301),Kt=Object.defineProperty,le=Object.getOwnPropertySymbols,we=Object.prototype.hasOwnProperty,ue=Object.prototype.propertyIsEnumerable,Dt=(Jt,jt,De)=>jt in Jt?Kt(Jt,jt,{enumerable:!0,configurable:!0,writable:!0,value:De}):Jt[jt]=De,ee=(Jt,jt)=>{for(var De in jt||(jt={}))we.call(jt,De)&&Dt(Jt,De,jt[De]);if(le)for(var De of le(jt))ue.call(jt,De)&&Dt(Jt,De,jt[De]);return Jt};const pe=Jt=>React.createElement("svg",ee({width:14,height:14,xmlns:"http://www.w3.org/2000/svg"},Jt),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"})));Rn.Z="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTQiIGhlaWdodD0iMTQiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48Y2lyY2xlIGZpbGw9IiNGQ0IwNDEiIGN4PSI3IiBjeT0iNyIgcj0iNyIvPjxwYXRoIGQ9Ik03LjUzMSA5LjYzOGEuNjE2LjYxNiAwIDEgMS0xLjIzMSAwdi0uMDJhLjYxNi42MTYgMCAxIDEgMS4yMzEgMHYuMDJabTAtMi4yNWEuNjE2LjYxNiAwIDEgMS0xLjIzMSAwVjQuMTE3YS42MTYuNjE2IDAgMSAxIDEuMjMxIDB2My4yNzNaIiBmaWxsPSIjRkZGIiBmaWxsLXJ1bGU9Im5vbnplcm8iLz48L2c+PC9zdmc+"},63720:function(){"use strict";function Mn(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(Mn.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(Mn.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(Mn.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(Mn.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 Mn))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 Rn=[];function kt(Bt,nt){var et=Rn.pop();return et===void 0?new go.Point(Bt,nt):(et.x=Bt,et.y=nt,et)}function ft(){var Bt=Rn.pop();return Bt===void 0?new go.Point:Bt}function Kt(Bt){Rn.push(Bt)}function le(Bt,nt,et,ht,st,pt,vt,St,Et){Et||(Et=new go.Point);var At=Bt-et,It=st-vt,qt=NaN,Ut=NaN;if(At===0)if(It===0)Bt===et&&(qt=Bt,Ut=nt);else{var Gt=(pt-St)/It,ge=pt-Gt*st;qt=Bt,Ut=Gt*qt+ge}else if(It===0){var ie=(nt-ht)/At,Te=nt-ie*Bt;qt=st,Ut=ie*qt+Te}else{var ie=(nt-ht)/At,Gt=(pt-St)/It,Te=nt-ie*Bt,ge=pt-Gt*st;qt=(ge-Te)/(ie-Gt),Ut=ie*qt+Te}return Et.x=qt,Et.y=Ut,Et}function we(Bt,nt,et,ht,st,pt,vt,St,Et,At,It,qt,Ut,Gt){var ge=1-Et,ie=Et,Te=Bt*ge+et*ie,ve=nt*ge+ht*ie,ye=et*ge+st*ie,Ye=ht*ge+pt*ie,Ze=st*ge+vt*ie,qe=pt*ge+St*ie,pn=Te*ge+ye*ie,te=ve*ge+Ye*ie,Xt=ye*ge+Ze*ie,Qe=Ye*ge+qe*ie,On=pn*ge+Xt*ie,En=te*ge+Qe*ie;At.x=Te,At.y=ve,It.x=pn,It.y=te,qt.x=On,qt.y=En,Ut.x=Xt,Ut.y=Qe,Gt.x=Ze,Gt.y=qe}var ue=new go.Spot(.156,.156),Dt=new go.Spot(.844,.844),ee=4*((Math.sqrt(2)-1)/3);go.Shape.setFigureParameter("RoundedRectangle",0,new Mn("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*ee,pt=new go.Geometry().add(new go.PathFigure(ht,0,!0).add(new go.PathSegment(go.PathSegment.Line,nt-ht,0)).add(new go.PathSegment(go.PathSegment.Bezier,nt,ht,nt-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&&(pt.spot1=new go.Spot(0,0,st,st),pt.spot2=new go.Spot(1,1,-st,-st)),pt}),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=ue,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,ee*nt,0,nt,(1-ee)*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,ee*et,(1-ee)*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,ee*et,ee*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-ee)*nt,0,0,(1-ee)*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 Mn("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 pt=new go.Geometry(go.Geometry.Rectangle);return pt.startX=0,pt.startY=0,pt.endX=nt,pt.endY=et,pt}else{var pt=new go.Geometry;return ht>0?pt.add(new go.PathFigure(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())):pt.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&&pt.setSpots(st/nt,0,(nt-st)/nt,1),pt}}),go.Shape.defineFigureGenerator("Parallelogram","Parallelogram1"),go.Shape.setFigureParameter("Parallelogram2",0,new Mn("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 pt=new go.Geometry(go.Geometry.Rectangle);return pt.startX=0,pt.startY=0,pt.endX=nt,pt.endY=et,pt}else{var pt=new go.Geometry;return ht>0?pt.add(new go.PathFigure(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())):pt.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&&pt.setSpots(st/nt,0,(nt-st)/nt,1),pt}}),go.Shape.setFigureParameter("Trapezoid1",0,new Mn("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 pt=new go.Geometry(go.Geometry.Rectangle);return pt.startX=0,pt.startY=0,pt.endX=nt,pt.endY=et,pt}else{var pt=new go.Geometry;return ht>0?pt.add(new go.PathFigure(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())):pt.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&&pt.setSpots(st/nt,0,(nt-st)/nt,1),pt}}),go.Shape.defineFigureGenerator("Trapezoid","Trapezoid1"),go.Shape.setFigureParameter("Trapezoid2",0,new Mn("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 pt=new go.Geometry(go.Geometry.Rectangle);return pt.startX=0,pt.startY=0,pt.endX=nt,pt.endY=et,pt}else{var pt=new go.Geometry;return ht>0?pt.add(new go.PathFigure(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())):pt.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&&pt.setSpots(st/nt,0,(nt-st)/nt,1),pt}}),go.Shape.setFigureParameter("ManualOperation",0,new Mn("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 pt=new go.Geometry(go.Geometry.Rectangle);return pt.startX=0,pt.startY=0,pt.endX=nt,pt.endY=et,pt}else{var pt=new go.Geometry;return ht>0?pt.add(new go.PathFigure(0,0).add(new go.PathSegment(go.PathSegment.Line,nt,0)).add(new go.PathSegment(go.PathSegment.Line,nt-st,et)).add(new go.PathSegment(go.PathSegment.Line,st,et).close())):pt.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&&pt.setSpots(st/nt,0,(nt-st)/nt,1),pt}});var pe=[];function Jt(){var Bt=pe.pop();return Bt===void 0?[]:Bt}function jt(Bt){Bt.length=0,pe.push(Bt)}function De(Bt){for(var nt=Jt(),et=.5,ht=.5,st=Math.PI*1.5,pt=0,vt=0;vt<Bt;vt++)pt=2*Math.PI/Bt*vt+st,nt[vt]=new go.Point(ht+et*Math.cos(pt),ht+et*Math.sin(pt));return nt.push(nt[0]),nt}function ae(Bt){var nt=Le(Bt),et=Jt();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 Le(Bt){for(var nt=De(Bt),et=Jt(),ht=Math.floor(nt.length/2),st=nt.length-1,pt=Bt%2===0?2:1,vt=0;vt<st;vt++){var St=nt[vt],Et=nt[vt+1],At=nt[(ht+vt-1)%st],It=nt[(ht+vt+pt)%st];et[vt*2]=St,et[vt*2+1]=le(St.x,St.y,At.x,At.y,Et.x,Et.y,It.x,It.y,new go.Point)}return et[et.length]=et[0],jt(nt),et}go.Shape.defineFigureGenerator("Pentagon",function(Bt,nt,et){var ht=De(5),st=new go.Geometry,pt=new go.PathFigure(ht[0].x*nt,ht[0].y*et,!0);st.add(pt);for(var vt=1;vt<5;vt++)pt.add(new go.PathSegment(go.PathSegment.Line,ht[vt].x*nt,ht[vt].y*et));return pt.add(new go.PathSegment(go.PathSegment.Line,ht[0].x*nt,ht[0].y*et).close()),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=De(6),st=new go.Geometry,pt=new go.PathFigure(ht[0].x*nt,ht[0].y*et,!0);st.add(pt);for(var vt=1;vt<6;vt++)pt.add(new go.PathSegment(go.PathSegment.Line,ht[vt].x*nt,ht[vt].y*et));return pt.add(new go.PathSegment(go.PathSegment.Line,ht[0].x*nt,ht[0].y*et).close()),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=De(7),st=new go.Geometry,pt=new go.PathFigure(ht[0].x*nt,ht[0].y*et,!0);st.add(pt);for(var vt=1;vt<7;vt++)pt.add(new go.PathSegment(go.PathSegment.Line,ht[vt].x*nt,ht[vt].y*et));return pt.add(new go.PathSegment(go.PathSegment.Line,ht[0].x*nt,ht[0].y*et).close()),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=De(8),st=new go.Geometry,pt=new go.PathFigure(ht[0].x*nt,ht[0].y*et,!0);st.add(pt);for(var vt=1;vt<8;vt++)pt.add(new go.PathSegment(go.PathSegment.Line,ht[vt].x*nt,ht[vt].y*et));return pt.add(new go.PathSegment(go.PathSegment.Line,ht[0].x*nt,ht[0].y*et).close()),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=De(9),st=new go.Geometry,pt=new go.PathFigure(ht[0].x*nt,ht[0].y*et,!0);st.add(pt);for(var vt=1;vt<9;vt++)pt.add(new go.PathSegment(go.PathSegment.Line,ht[vt].x*nt,ht[vt].y*et));return pt.add(new go.PathSegment(go.PathSegment.Line,ht[0].x*nt,ht[0].y*et).close()),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=De(10),st=new go.Geometry,pt=new go.PathFigure(ht[0].x*nt,ht[0].y*et,!0);st.add(pt);for(var vt=1;vt<10;vt++)pt.add(new go.PathSegment(go.PathSegment.Line,ht[vt].x*nt,ht[vt].y*et));return pt.add(new go.PathSegment(go.PathSegment.Line,ht[0].x*nt,ht[0].y*et).close()),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=De(12),st=new go.Geometry,pt=new go.PathFigure(ht[0].x*nt,ht[0].y*et,!0);st.add(pt);for(var vt=1;vt<12;vt++)pt.add(new go.PathSegment(go.PathSegment.Line,ht[vt].x*nt,ht[vt].y*et));return pt.add(new go.PathSegment(go.PathSegment.Line,ht[0].x*nt,ht[0].y*et).close()),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=Le(5),st=new go.Geometry,pt=new go.PathFigure(ht[0].x*nt,ht[0].y*et,!0);st.add(pt);for(var vt=1;vt<10;vt++)pt.add(new go.PathSegment(go.PathSegment.Line,ht[vt].x*nt,ht[vt].y*et));return pt.add(new go.PathSegment(go.PathSegment.Line,ht[0].x*nt,ht[0].y*et).close()),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=Le(6),st=new go.Geometry,pt=new go.PathFigure(ht[0].x*nt,ht[0].y*et,!0);st.add(pt);for(var vt=1;vt<12;vt++)pt.add(new go.PathSegment(go.PathSegment.Line,ht[vt].x*nt,ht[vt].y*et));return pt.add(new go.PathSegment(go.PathSegment.Line,ht[0].x*nt,ht[0].y*et).close()),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=Le(7),st=new go.Geometry,pt=new go.PathFigure(ht[0].x*nt,ht[0].y*et,!0);st.add(pt);for(var vt=1;vt<14;vt++)pt.add(new go.PathSegment(go.PathSegment.Line,ht[vt].x*nt,ht[vt].y*et));return pt.add(new go.PathSegment(go.PathSegment.Line,ht[0].x*nt,ht[0].y*et).close()),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=Le(8),st=new go.Geometry,pt=new go.PathFigure(ht[0].x*nt,ht[0].y*et,!0);st.add(pt);for(var vt=1;vt<16;vt++)pt.add(new go.PathSegment(go.PathSegment.Line,ht[vt].x*nt,ht[vt].y*et));return pt.add(new go.PathSegment(go.PathSegment.Line,ht[0].x*nt,ht[0].y*et).close()),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=Le(9),st=new go.Geometry,pt=new go.PathFigure(ht[0].x*nt,ht[0].y*et,!0);st.add(pt);for(var vt=1;vt<18;vt++)pt.add(new go.PathSegment(go.PathSegment.Line,ht[vt].x*nt,ht[vt].y*et));return pt.add(new go.PathSegment(go.PathSegment.Line,ht[0].x*nt,ht[0].y*et).close()),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=Le(10),st=new go.Geometry,pt=new go.PathFigure(ht[0].x*nt,ht[0].y*et,!0);st.add(pt);for(var vt=1;vt<20;vt++)pt.add(new go.PathSegment(go.PathSegment.Line,ht[vt].x*nt,ht[vt].y*et));return pt.add(new go.PathSegment(go.PathSegment.Line,ht[0].x*nt,ht[0].y*et).close()),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=ae(5),st=new go.Geometry,pt=new go.PathFigure(ht[0].x*nt,ht[0].y*et,!0);st.add(pt);for(var vt=1;vt<ht.length;vt+=3)pt.add(new go.PathSegment(go.PathSegment.Bezier,ht[vt+2].x*nt,ht[vt+2].y*et,ht[vt].x*nt,ht[vt].y*et,ht[vt+1].x*nt,ht[vt+1].y*et));return pt.segments.last().close(),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=ae(6),st=new go.Geometry,pt=new go.PathFigure(ht[0].x*nt,ht[0].y*et,!0);st.add(pt);for(var vt=1;vt<ht.length;vt+=3)pt.add(new go.PathSegment(go.PathSegment.Bezier,ht[vt+2].x*nt,ht[vt+2].y*et,ht[vt].x*nt,ht[vt].y*et,ht[vt+1].x*nt,ht[vt+1].y*et));return pt.segments.last().close(),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=ae(7),st=new go.Geometry,pt=new go.PathFigure(ht[0].x*nt,ht[0].y*et,!0);st.add(pt);for(var vt=1;vt<ht.length;vt+=3)pt.add(new go.PathSegment(go.PathSegment.Bezier,ht[vt+2].x*nt,ht[vt+2].y*et,ht[vt].x*nt,ht[vt].y*et,ht[vt+1].x*nt,ht[vt+1].y*et));return pt.segments.last().close(),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=ae(8),st=new go.Geometry,pt=new go.PathFigure(ht[0].x*nt,ht[0].y*et,!0);st.add(pt);for(var vt=1;vt<ht.length;vt+=3)pt.add(new go.PathSegment(go.PathSegment.Bezier,ht[vt+2].x*nt,ht[vt+2].y*et,ht[vt].x*nt,ht[vt].y*et,ht[vt+1].x*nt,ht[vt+1].y*et));return pt.segments.last().close(),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=ae(9),st=new go.Geometry,pt=new go.PathFigure(ht[0].x*nt,ht[0].y*et,!0);st.add(pt);for(var vt=1;vt<ht.length;vt+=3)pt.add(new go.PathSegment(go.PathSegment.Bezier,ht[vt+2].x*nt,ht[vt+2].y*et,ht[vt].x*nt,ht[vt].y*et,ht[vt+1].x*nt,ht[vt+1].y*et));return pt.segments.last().close(),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=ae(10),st=new go.Geometry,pt=new go.PathFigure(ht[0].x*nt,ht[0].y*et,!0);st.add(pt);for(var vt=1;vt<ht.length;vt+=3)pt.add(new go.PathSegment(go.PathSegment.Bezier,ht[vt+2].x*nt,ht[vt+2].y*et,ht[vt].x*nt,ht[vt].y*et,ht[vt+1].x*nt,ht[vt+1].y*et));return pt.segments.last().close(),jt(ht),st.spot1=new go.Spot(.222,.222),st.spot2=new go.Spot(.777,.777),st}),go.Shape.setFigureParameter("FramedRectangle",0,new Mn("ThicknessX",8)),go.Shape.setFigureParameter("FramedRectangle",1,new Mn("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 pt=new go.Geometry,vt=new go.PathFigure(0,0,!0);return pt.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,nt,0)),vt.add(new go.PathSegment(go.PathSegment.Line,nt,et)),vt.add(new go.PathSegment(go.PathSegment.Line,0,et).close()),ht<nt/2&&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())),pt.setSpots(0,0,1,1,ht,st,-ht,-st),pt}),go.Shape.setFigureParameter("Ring",0,new Mn("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,pt=new go.Geometry,vt=new go.PathFigure(nt,nt/2,!0);pt.add(vt),vt.add(new go.PathSegment(go.PathSegment.Arc,0,360,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())),pt.spot1=ue,pt.spot2=Dt,pt.defaultStretch=go.GraphObject.Uniform,pt}),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 Mn("Start",0,-360,360)),go.Shape.setFigureParameter("Pie",1,new Mn("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 pt=ht%360;pt<0&&(pt+=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,pt,vt,St,St,St,St).close()))}),go.Shape.defineFigureGenerator("PiePiece",function(Bt,nt,et){var ht=ee/Math.SQRT2*.5,st=Math.SQRT2/2,pt=1-Math.SQRT2/2;return new go.Geometry().add(new go.PathFigure(nt,et,!0).add(new go.PathSegment(go.PathSegment.Bezier,st*nt,pt*et,nt,(1-ht)*et,(st+ht)*nt,(pt+ht)*et)).add(new go.PathSegment(go.PathSegment.Line,0,et).close()))}),go.Shape.setFigureParameter("ThickCross",0,new Mn("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,pt=nt/2,vt=et/2;return new go.Geometry().add(new go.PathFigure(pt-st,0,!0).add(new go.PathSegment(go.PathSegment.Line,pt+st,0)).add(new go.PathSegment(go.PathSegment.Line,pt+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,pt+st,vt+st)).add(new go.PathSegment(go.PathSegment.Line,pt+st,et)).add(new go.PathSegment(go.PathSegment.Line,pt-st,et)).add(new go.PathSegment(go.PathSegment.Line,pt-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,pt-st,vt-st).close()))}),go.Shape.setFigureParameter("ThinCross",0,new Mn("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,pt=nt/2,vt=et/2;return new go.Geometry().add(new go.PathFigure(pt-st,0,!0).add(new go.PathSegment(go.PathSegment.Line,pt+st,0)).add(new go.PathSegment(go.PathSegment.Line,pt+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,pt+st,vt+st)).add(new go.PathSegment(go.PathSegment.Line,pt+st,et)).add(new go.PathSegment(go.PathSegment.Line,pt-st,et)).add(new go.PathSegment(go.PathSegment.Line,pt-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,pt-st,vt-st).close()))}),go.Shape.setFigureParameter("ThickX",0,new Mn("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 pt=nt/2,vt=et/2,St=Math.atan2(et,nt),Et=ht-Math.min(Math.cos(St)*ht/2,pt),At=ht-Math.min(Math.sin(St)*ht/2,vt),st=new go.Geometry,It=new go.PathFigure(Et,0,!0);return st.add(It),It.add(new go.PathSegment(go.PathSegment.Line,pt,.2*et)),It.add(new go.PathSegment(go.PathSegment.Line,nt-Et,0)),It.add(new go.PathSegment(go.PathSegment.Line,nt,At)),It.add(new go.PathSegment(go.PathSegment.Line,.8*nt,vt)),It.add(new go.PathSegment(go.PathSegment.Line,nt,et-At)),It.add(new go.PathSegment(go.PathSegment.Line,nt-Et,et)),It.add(new go.PathSegment(go.PathSegment.Line,pt,.8*et)),It.add(new go.PathSegment(go.PathSegment.Line,Et,et)),It.add(new go.PathSegment(go.PathSegment.Line,0,et-At)),It.add(new go.PathSegment(go.PathSegment.Line,.2*nt,vt)),It.add(new go.PathSegment(go.PathSegment.Line,0,At).close()),st}}),go.Shape.setFigureParameter("ThinX",0,new Mn("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,pt=new go.PathFigure(.1*nt,0,!0);return st.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,.5*nt,.4*et)),pt.add(new go.PathSegment(go.PathSegment.Line,.9*nt,0)),pt.add(new go.PathSegment(go.PathSegment.Line,nt,.1*et)),pt.add(new go.PathSegment(go.PathSegment.Line,.6*nt,.5*et)),pt.add(new go.PathSegment(go.PathSegment.Line,nt,.9*et)),pt.add(new go.PathSegment(go.PathSegment.Line,.9*nt,et)),pt.add(new go.PathSegment(go.PathSegment.Line,.5*nt,.6*et)),pt.add(new go.PathSegment(go.PathSegment.Line,.1*nt,et)),pt.add(new go.PathSegment(go.PathSegment.Line,0,.9*et)),pt.add(new go.PathSegment(go.PathSegment.Line,.4*nt,.5*et)),pt.add(new go.PathSegment(go.PathSegment.Line,0,.1*et).close()),st}),go.Shape.setFigureParameter("SquareIBeam",0,new Mn("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,pt=new go.PathFigure(0,0,!0);return st.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,nt,0)),pt.add(new go.PathSegment(go.PathSegment.Line,nt,ht*et)),pt.add(new go.PathSegment(go.PathSegment.Line,(.5+ht/2)*nt,ht*et)),pt.add(new go.PathSegment(go.PathSegment.Line,(.5+ht/2)*nt,(1-ht)*et)),pt.add(new go.PathSegment(go.PathSegment.Line,nt,(1-ht)*et)),pt.add(new go.PathSegment(go.PathSegment.Line,nt,et)),pt.add(new go.PathSegment(go.PathSegment.Line,0,et)),pt.add(new go.PathSegment(go.PathSegment.Line,0,(1-ht)*et)),pt.add(new go.PathSegment(go.PathSegment.Line,(.5-ht/2)*nt,(1-ht)*et)),pt.add(new go.PathSegment(go.PathSegment.Line,(.5-ht/2)*nt,ht*et)),pt.add(new go.PathSegment(go.PathSegment.Line,0,ht*et).close()),st}),go.Shape.setFigureParameter("RoundedIBeam",0,new Mn("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,pt=new go.PathFigure(0,0,!0);return st.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,nt,0)),pt.add(new go.PathSegment(go.PathSegment.Bezier,nt,et,Math.abs(1-ht)*nt,.25*et,Math.abs(1-ht)*nt,.75*et)),pt.add(new go.PathSegment(go.PathSegment.Line,0,et)),pt.add(new go.PathSegment(go.PathSegment.Bezier,0,0,ht*nt,.75*et,ht*nt,.25*et).close()),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,ee*nt,0,nt,(.5-ee/2)*et)).add(new go.PathSegment(go.PathSegment.Bezier,0,et,nt,(.5+ee/2)*et,ee*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 pt=.2,vt=.3,St=0,Et=pt*ee;return st.add(new go.PathSegment(go.PathSegment.Bezier,(.5+vt)*nt,(.5+pt+St)*et,(.5-pt+vt)*nt,(.5+Et+St)*et,(.5-Et+vt)*nt,(.5+pt+St)*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,(1-.5+pt+vt)*nt,(.5+St)*et,(.5+Et+vt)*nt,(.5+pt+St)*et,(.5+pt+vt)*nt,(.5+Et+St)*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,(.5+vt)*nt,(.5-pt+St)*et,(1-.5+pt+vt)*nt,(.5-Et+St)*et,(.5+Et+vt)*nt,(.5-pt+St)*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,.65*nt,.36771243*et,(.5-Et+vt)*nt,(.5-pt+St)*et,(.5-pt+vt+.05)*nt,(.5-Et+St-.02)*et)),pt=.2,vt=0,St=-.3,Et=pt*ee,st.add(new go.PathSegment(go.PathSegment.Bezier,(1-.5+pt+vt)*nt,(.5+St)*et,(.5+Et+vt)*nt,(.5+pt+St)*et,(.5+pt+vt)*nt,(.5+Et+St)*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,(.5+vt)*nt,(.5-pt+St)*et,(1-.5+pt+vt)*nt,(.5-Et+St)*et,(.5+Et+vt)*nt,(.5-pt+St)*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,(.5-pt+vt)*nt,(.5+St)*et,(.5-Et+vt)*nt,(.5-pt+St)*et,(.5-pt+vt)*nt,(.5-Et+St)*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,(.5-Et+vt)*nt,(.5+pt+St)*et,(.5-pt+vt)*nt,(.5+Et+St)*et,(.5-Et+vt)*nt,(.5+pt+St)*et)),pt=.2,vt=-.3,St=0,Et=pt*ee,st.add(new go.PathSegment(go.PathSegment.Bezier,(.5+vt)*nt,(.5-pt+St)*et,(1-.5+pt+vt-.05)*nt,(.5-Et+St-.02)*et,(.5+Et+vt)*nt,(.5-pt+St)*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,(.5-pt+vt)*nt,(.5+St)*et,(.5-Et+vt)*nt,(.5-pt+St)*et,(.5-pt+vt)*nt,(.5-Et+St)*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,(.5+vt)*nt,(.5+pt+St)*et,(.5-pt+vt)*nt,(.5+Et+St)*et,(.5-Et+vt)*nt,(.5+pt+St)*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,.4*nt,.6*et,(.5+Et+vt)*nt,(.5+pt+St)*et,(.5+pt+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 pt=.1,vt=.5,St=.25;return st.add(new go.PathSegment(go.PathSegment.Move,(vt+pt)*nt,St*et)),st.add(new go.PathSegment(go.PathSegment.Arc,0,-360,nt*vt,et*St,pt*nt,pt*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+pt)*nt,St*et,!0),ht.add(st),st.add(new go.PathSegment(go.PathSegment.Arc,0,360,nt*vt,et*St,pt*nt,pt*nt).close()),ht.defaultStretch=go.GraphObject.Uniform,ht}),go.Shape.defineFigureGenerator("Peace",function(Bt,nt,et){var ht=.8535533905932737,st=.5*nt,pt=.5*et;return new go.Geometry().add(new go.PathFigure(st,0,!1).add(new go.PathSegment(go.PathSegment.Arc,270,360,st,pt,st,pt)).add(new go.PathSegment(go.PathSegment.Line,st,et)).add(new go.PathSegment(go.PathSegment.Move,st,pt)).add(new go.PathSegment(go.PathSegment.Line,(1-ht)*nt,ht*et)).add(new go.PathSegment(go.PathSegment.Move,st,pt)).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=ee*.5,pt=.5,vt=.5,St=.5,Et=new go.PathFigure(vt*nt,(St-pt)*et);ht.add(Et),Et.add(new go.PathSegment(go.PathSegment.Bezier,(vt-pt)*nt,St*et,(vt-st)*nt,(St-pt)*et,(vt-pt)*nt,(St-st)*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,(St+pt)*et,(vt-pt)*nt,(St+st)*et,(vt-st)*nt,(St+pt)*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,(vt+pt)*nt,St*et,(vt+st)*nt,(St+pt)*et,(vt+pt)*nt,(St+st)*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,(St-pt)*et,(vt+pt)*nt,(St-st)*et,(vt+st)*nt,(St-pt)*et)),pt=.4,st=ee*.4;var At=ft(),It=ft(),qt=ft(),Ut=ft();we(vt,St-pt,vt+st,St-pt,vt+pt,St-st,vt+pt,St,.42,At,It,qt,Ut,Ut);var Gt=ft(),ge=ft(),ie=ft();we(vt,St-pt,vt+st,St-pt,vt+pt,St-st,vt+pt,St,.58,Ut,Ut,ie,Gt,ge);var Te=ft(),ve=ft(),ye=ft();we(vt,St+pt,vt-st,St+pt,vt-pt,St+st,vt-pt,St,.42,Te,ve,ye,Ut,Ut);var Ye=ft(),Ze=ft(),qe=ft();return we(vt,St+pt,vt-st,St+pt,vt-pt,St+st,vt-pt,St,.58,Ut,Ut,qe,Ye,Ze),Et.add(new go.PathSegment(go.PathSegment.Move,qe.x*nt,qe.y*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,(vt-pt)*nt,St*et,Ye.x*nt,Ye.y*et,Ze.x*nt,Ze.y*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,(St-pt)*et,(vt-pt)*nt,(St-st)*et,(vt-st)*nt,(St-pt)*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,qt.x*nt,qt.y*et,At.x*nt,At.y*et,It.x*nt,It.y*et)),Et.add(new go.PathSegment(go.PathSegment.Line,qe.x*nt,qe.y*et).close()),Et.add(new go.PathSegment(go.PathSegment.Move,ye.x*nt,ye.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+pt)*nt,St*et,Gt.x*nt,Gt.y*et,ge.x*nt,ge.y*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,(St+pt)*et,(vt+pt)*nt,(St+st)*et,(vt+st)*nt,(St+pt)*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,ye.x*nt,ye.y*et,Te.x*nt,Te.y*et,ve.x*nt,ve.y*et).close()),Kt(At),Kt(It),Kt(qt),Kt(Ut),Kt(Gt),Kt(ge),Kt(ie),Kt(Te),Kt(ve),Kt(ye),Kt(Ye),Kt(Ze),Kt(qe),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 Mn("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,pt=st+ht;return new go.Geometry().add(new go.PathFigure(pt,.5*et).add(new go.PathSegment(go.PathSegment.Line,nt,et)).add(new go.PathSegment(go.PathSegment.Line,0,et)).add(new go.PathSegment(go.PathSegment.Line,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=ee*.4,pt=.4,vt=.5,St=.5,Et=ft(),At=ft(),It=ft(),qt=ft(),Ut=new go.PathFigure((vt-pt)*nt,St*et,!1);ht.add(Ut),Ut.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,(St-pt)*et,(vt-pt)*nt,(St-st)*et,(vt-st)*nt,(St-pt)*et)),we(vt,St-pt,vt+st,St-pt,vt+pt,St-st,vt+pt,St,.44,It,qt,At,Et,Et),Ut.add(new go.PathSegment(go.PathSegment.Bezier,At.x*nt,At.y*et,It.x*nt,It.y*et,qt.x*nt,qt.y*et));var Gt=kt(At.x,At.y);we(vt,St-pt,vt+st,St-pt,vt+pt,St-st,vt+pt,St,.56,Et,Et,At,It,qt);var ge=kt(At.x,At.y);Ut.add(new go.PathSegment(go.PathSegment.Line,(Gt.x*.1+.95*.9)*nt,Gt.y*.1*et)),Ut.add(new go.PathSegment(go.PathSegment.Line,.85*nt,Gt.y*.1*et)),Ut.add(new go.PathSegment(go.PathSegment.Line,.85*nt,0)),Ut.add(new go.PathSegment(go.PathSegment.Line,nt,0)),Ut.add(new go.PathSegment(go.PathSegment.Line,nt,.15*et)),Ut.add(new go.PathSegment(go.PathSegment.Line,(ge.x*.1+.9)*nt,.15*et)),Ut.add(new go.PathSegment(go.PathSegment.Line,(ge.x*.1+.9)*nt,(ge.y*.1+.05*.9)*et)),Ut.add(new go.PathSegment(go.PathSegment.Line,ge.x*nt,ge.y*et)),Ut.add(new go.PathSegment(go.PathSegment.Bezier,(vt+pt)*nt,St*et,It.x*nt,It.y*et,qt.x*nt,qt.y*et)),Ut.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,(St+pt)*et,(vt+pt)*nt,(St+st)*et,(vt+st)*nt,(St+pt)*et)),Ut.add(new go.PathSegment(go.PathSegment.Bezier,(vt-pt)*nt,St*et,(vt-st)*nt,(St+pt)*et,(vt-pt)*nt,(St+st)*et)),pt=.35,st=ee*.35;var ie=new go.PathFigure(vt*nt,(St-pt)*et,!1);ht.add(ie),ie.add(new go.PathSegment(go.PathSegment.Bezier,(vt-pt)*nt,St*et,(vt-st)*nt,(St-pt)*et,(vt-pt)*nt,(St-st)*et)),ie.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,(St+pt)*et,(vt-pt)*nt,(St+st)*et,(vt-st)*nt,(St+pt)*et)),ie.add(new go.PathSegment(go.PathSegment.Bezier,(vt+pt)*nt,St*et,(vt+st)*nt,(St+pt)*et,(vt+pt)*nt,(St+st)*et)),ie.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,(St-pt)*et,(vt+pt)*nt,(St-st)*et,(vt+st)*nt,(St-pt)*et));var Te=new go.PathFigure((vt-pt)*nt,St*et,!1);return ht.add(Te),Kt(Et),Kt(At),Kt(It),Kt(qt),Kt(Gt),Kt(ge),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,pt=0,vt=-.125,St=st*ee,Et=new go.PathFigure((.525+pt)*nt,(.5+st+vt)*et,!1);ht.add(Et),Et.add(new go.PathSegment(go.PathSegment.Bezier,(1-.5+st+pt)*nt,(.5+vt)*et,(.5+St+pt)*nt,(.5+st+vt)*et,(.5+st+pt)*nt,(.5+St+vt)*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,(.5+pt)*nt,(.5-st+vt)*et,(1-.5+st+pt)*nt,(.5-St+vt)*et,(.5+St+pt)*nt,(.5-st+vt)*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,(.5-st+pt)*nt,(.5+vt)*et,(.5-St+pt)*nt,(.5-st+vt)*et,(.5-st+pt)*nt,(.5-St+vt)*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,(.475+pt)*nt,(.5+st+vt)*et,(.5-st+pt)*nt,(.5+St+vt)*et,(.5-St+pt)*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,pt=0,vt=-.125,St=st*ee;var Et=new go.PathFigure((1-.5+st+pt)*nt,(.5+vt)*et,!1);ht.add(Et),Et.add(new go.PathSegment(go.PathSegment.Bezier,(.5+pt)*nt,(.5+st+vt)*et,(.5+st+pt)*nt,(.5+St+vt)*et,(.5+St+pt)*nt,(.5+st+vt)*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,(.5-st+pt)*nt,(.5+vt)*et,(.5-St+pt)*nt,(.5+st+vt)*et,(.5-st+pt)*nt,(.5+St+vt)*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,(.5+pt)*nt,(.5-st+vt)*et,(.5-st+pt)*nt,(.5-St+vt)*et,(.5-St+pt)*nt,(.5-st+vt)*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,(1-.5+st+pt)*nt,(.5+vt)*et,(.5+St+pt)*nt,(.5-st+vt)*et,(1-.5+st+pt)*nt,(.5-St+vt)*et));var Et=new go.PathFigure((.525+pt)*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 Mn("ArrowheadWidth",.3,.01,.99)),go.Shape.setFigureParameter("Arrow",1,new Mn("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 pt=(1-ht)*nt,vt=(.5-st/2)*et,St=(.5+st/2)*et,Et=new go.Geometry,At=new go.PathFigure(0,vt,!0);Et.add(At),At.add(new go.PathSegment(go.PathSegment.Line,pt,vt)),At.add(new go.PathSegment(go.PathSegment.Line,pt,0)),At.add(new go.PathSegment(go.PathSegment.Line,nt,.5*et)),At.add(new go.PathSegment(go.PathSegment.Line,pt,et)),At.add(new go.PathSegment(go.PathSegment.Line,pt,St)),At.add(new go.PathSegment(go.PathSegment.Line,0,St).close()),Et.spot1=new go.Spot(0,vt/et);var It=le(0,St/et,1,St/et,pt/nt,1,1,.5,ft());return Et.spot2=new go.Spot(It.x,It.y),Kt(It),Et}),go.Shape.setFigureParameter("Arrow2",0,new Mn("ArrowheadWidth",30)),go.Shape.setFigureParameter("Arrow2",0,new Mn("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 pt=nt-ht,vt=(et-st)/2,St=vt+st,Et=new go.Geometry,At=new go.PathFigure(0,vt,!0);Et.add(At),At.add(new go.PathSegment(go.PathSegment.Line,pt,vt)),At.add(new go.PathSegment(go.PathSegment.Line,pt,0)),At.add(new go.PathSegment(go.PathSegment.Line,nt,.5*et)),At.add(new go.PathSegment(go.PathSegment.Line,pt,et)),At.add(new go.PathSegment(go.PathSegment.Line,pt,St)),At.add(new go.PathSegment(go.PathSegment.Line,0,St).close()),Et.spot1=new go.Spot(0,vt/et);var It=le(0,St/et,1,St/et,pt/nt,1,1,.5,ft());return Et.spot2=new go.Spot(It.x,It.y),Kt(It),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 Mn("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,pt=(.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,pt)),St.add(new go.PathSegment(go.PathSegment.Line,.3*nt,pt)),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=le(0,.5,.3,0,0,st/et,.1,st/et,ft());return vt.spot1=new go.Spot(Et.x,Et.y),Et=le(.7,1,1,.5,0,pt/et,1,pt/et,Et),vt.spot2=new go.Spot(Et.x,Et.y),Kt(Et),vt}),go.Shape.setFigureParameter("DoubleEndArrow2",0,new Mn("ConnecterHeight",40)),go.Shape.setFigureParameter("DoubleEndArrow2",1,new Mn("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 pt=(et-ht)/2,vt=pt+ht,St=(et-st)/2,Et=St+st;(ht>et||st>et)&&(st>ht?(ht=ht*et/st,pt=(et-ht)/2,vt=pt+ht,St=0,Et=et):(pt=0,vt=et,St=0,Et=et));var At=new go.Geometry,It=new go.PathFigure(nt,.5*et,!0);At.add(It),It.add(new go.PathSegment(go.PathSegment.Line,.7*nt,Et)),It.add(new go.PathSegment(go.PathSegment.Line,.7*nt,vt)),It.add(new go.PathSegment(go.PathSegment.Line,.3*nt,vt)),It.add(new go.PathSegment(go.PathSegment.Line,.3*nt,Et)),It.add(new go.PathSegment(go.PathSegment.Line,0,.5*et)),It.add(new go.PathSegment(go.PathSegment.Line,.3*nt,St)),It.add(new go.PathSegment(go.PathSegment.Line,.3*nt,pt)),It.add(new go.PathSegment(go.PathSegment.Line,.7*nt,pt)),It.add(new go.PathSegment(go.PathSegment.Line,.7*nt,St).close());var qt=le(0,.5,.3,St/et,0,pt/et,1,pt/et,ft());return At.spot1=new go.Spot(qt.x,qt.y),qt=le(.7,Et/et,1,.5,0,vt/et,1,vt/et,qt),At.spot2=new go.Spot(qt.x,qt.y),Kt(qt),At}),go.Shape.setFigureParameter("IBeamArrow",0,new Mn("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,pt=(.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,pt)),St.add(new go.PathSegment(go.PathSegment.Line,.2*nt,pt)),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=le(.7,1,1,.5,0,pt/et,1,pt/et,ft());return vt.spot2=new go.Spot(Et.x,Et.y),Kt(Et),vt}),go.Shape.setFigureParameter("IBeamArrow2",0,new Mn("ConnectorHeight",40)),go.Shape.setFigureParameter("IBeamArrow2",1,new Mn("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 pt=(et-ht)/2,vt=pt+ht,St=(et-st)/2,Et=St+st;(ht>et||st>et)&&(st>ht?(ht=ht*et/st,pt=(et-ht)/2,vt=pt+ht,St=0,Et=et):(pt=0,vt=et,St=0,Et=et));var At=new go.Geometry,It=new go.PathFigure(nt,.5*et,!0);At.add(It),It.add(new go.PathSegment(go.PathSegment.Line,.7*nt,Et)),It.add(new go.PathSegment(go.PathSegment.Line,.7*nt,vt)),It.add(new go.PathSegment(go.PathSegment.Line,.2*nt,vt)),It.add(new go.PathSegment(go.PathSegment.Line,.2*nt,Et)),It.add(new go.PathSegment(go.PathSegment.Line,0,Et)),It.add(new go.PathSegment(go.PathSegment.Line,0,St)),It.add(new go.PathSegment(go.PathSegment.Line,.2*nt,St)),It.add(new go.PathSegment(go.PathSegment.Line,.2*nt,pt)),It.add(new go.PathSegment(go.PathSegment.Line,.7*nt,pt)),It.add(new go.PathSegment(go.PathSegment.Line,.7*nt,St).close()),At.spot1=new go.Spot(0,pt/et);var qt=le(.7,Et/et,1,.5,0,vt/et,1,vt/et,ft());return At.spot2=new go.Spot(qt.x,qt.y),Kt(qt),At}),go.Shape.setFigureParameter("Pointer",0,new Mn("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,pt=new go.PathFigure(nt,.5*et,!0);st.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,0,et)),pt.add(new go.PathSegment(go.PathSegment.Line,ht*nt,.5*et)),pt.add(new go.PathSegment(go.PathSegment.Line,0,0).close()),st.spot1=new go.Spot(ht,.35);var vt=le(.2,.65,1,.65,0,1,1,.5,ft());return st.spot2=new go.Spot(vt.x,vt.y),Kt(vt),st}),go.Shape.setFigureParameter("RoundedPointer",0,new Mn("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,pt=new go.PathFigure(nt,.5*et,!0);st.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,0,et)),pt.add(new go.PathSegment(go.PathSegment.Bezier,0,0,ht*nt,.75*et,ht*nt,.25*et).close()),st.spot1=new go.Spot(ht,.35);var vt=le(0,.65,1,.65,0,1,1,.5,ft());return st.spot2=new go.Spot(vt.x,vt.y),Kt(vt),st}),go.Shape.setFigureParameter("SplitEndArrow",0,new Mn("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,pt=(.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,pt)),St.add(new go.PathSegment(go.PathSegment.Line,0,pt)),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=le(.7,1,1,.5,0,pt/et,1,pt/et,ft());return vt.spot2=new go.Spot(Et.x,Et.y),Kt(Et),vt}),go.Shape.setFigureParameter("SplitEndArrow2",0,new Mn("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,pt=st+ht;ht>et&&(st=0,pt=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,pt)),St.add(new go.PathSegment(go.PathSegment.Line,0,pt)),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=le(.7,1,1,.5,0,pt/et,1,pt/et,ft());return vt.spot2=new go.Spot(Et.x,Et.y),Kt(Et),vt}),go.Shape.setFigureParameter("SquareArrow",0,new Mn("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,pt=new go.PathFigure(nt,.5*et,!0);return st.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,ht*nt,et)),pt.add(new go.PathSegment(go.PathSegment.Line,0,et)),pt.add(new go.PathSegment(go.PathSegment.Line,0,0)),pt.add(new go.PathSegment(go.PathSegment.Line,ht*nt,0).close()),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=ee*.5,pt=ee*.1,vt=new go.PathFigure(0,.9*et,!0);return ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,.5*nt,0)),vt.add(new go.PathSegment(go.PathSegment.Line,nt,.9*et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,.5*nt,et,nt,(.9+pt)*et,(.5+st)*nt,et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,0,.9*et,(.5-st)*nt,et,0,(.9+pt)*et).close()),ht.spot1=new go.Spot(.25,.5),ht.spot2=new go.Spot(.75,.97),ht}),go.Shape.defineFigureGenerator("Cone2",function(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 pt=new go.PathFigure(0,.9*et,!1);return ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Bezier,nt,.9*et,(1-.85/.9)*nt,.8*et,.85/.9*nt,.8*et)),ht.spot1=new go.Spot(.25,.5),ht.spot2=new go.Spot(.75,.82),ht}),go.Shape.defineFigureGenerator("Cube1",function(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 pt=new go.PathFigure(.5*nt,et,!1);return ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,.5*nt,.3*et)),pt.add(new go.PathSegment(go.PathSegment.Line,0,.15*et)),pt.add(new go.PathSegment(go.PathSegment.Move,.5*nt,.3*et)),pt.add(new go.PathSegment(go.PathSegment.Line,nt,.15*et)),ht.spot1=new go.Spot(0,.3),ht.spot2=new go.Spot(.5,.85),ht}),go.Shape.defineFigureGenerator("Cube2",function(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 pt=new go.PathFigure(0,.3*et,!1);return ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,.7*nt,.3*et)),pt.add(new go.PathSegment(go.PathSegment.Line,nt,0)),pt.add(new go.PathSegment(go.PathSegment.Move,.7*nt,.3*et)),pt.add(new go.PathSegment(go.PathSegment.Line,.7*nt,et)),ht.spot1=new go.Spot(0,.3),ht.spot2=new go.Spot(.7,1),ht}),go.Shape.defineFigureGenerator("Cylinder1",function(Bt,nt,et){var ht=Bt?Bt.parameter1:NaN;isNaN(ht)&&(ht=5),ht=Math.min(ht,et/3);var st=new go.Geometry,pt=ee*.5,vt=new go.PathFigure(0,ht,!0);st.add(vt),vt.add(new go.PathSegment(go.PathSegment.Bezier,.5*nt,0,0,ee*ht,(.5-pt)*nt,0)),vt.add(new go.PathSegment(go.PathSegment.Bezier,1*nt,ht,(.5+pt)*nt,0,1*nt,ee*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-ee*ht,(.5+pt)*nt,1*et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,0,et-ht,(.5-pt)*nt,1*et,0,et-ee*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-ee*ht,(.5+pt)*nt,2*ht)),St.add(new go.PathSegment(go.PathSegment.Bezier,0,ht,(.5-pt)*nt,2*ht,0,2*ht-ee*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,pt=ee*.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,ee*ht,(.5-pt)*nt,0)),vt.add(new go.PathSegment(go.PathSegment.Bezier,nt,ht,(.5+pt)*nt,0,nt,ee*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-ee*ht,(.5+pt)*nt,et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,0,et-ht,(.5-pt)*nt,et,0,et-ee*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-ee*ht,(.5-pt)*nt,et-2*ht)),St.add(new go.PathSegment(go.PathSegment.Bezier,nt,et-ht,(.5+pt)*nt,et-2*ht,nt,et-ht-ee*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,pt=ee*.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-ee*ht,0,nt,(.5-pt)*et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,nt-ht,et,nt,(.5+pt)*et,nt-ee*ht,et)),vt.add(new go.PathSegment(go.PathSegment.Line,ht,et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,0,.5*et,ee*ht,et,0,(.5+pt)*et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,ht,0,0,(.5-pt)*et,ee*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+ee*ht,0,2*ht,(.5-pt)*et)),St.add(new go.PathSegment(go.PathSegment.Bezier,ht,et,2*ht,(.5+pt)*et,ht+ee*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,pt=ee*.5,vt=new go.PathFigure(nt-ht,0,!0);st.add(vt),vt.add(new go.PathSegment(go.PathSegment.Bezier,nt,.5*et,nt-ee*ht,0,nt,(.5-pt)*et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,nt-ht,et,nt,(.5+pt)*et,nt-ee*ht,et)),vt.add(new go.PathSegment(go.PathSegment.Line,ht,et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,0,.5*et,ee*ht,et,0,(.5+pt)*et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,ht,0,0,(.5-pt)*et,ee*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-ee*ht,0,nt-2*ht,(.5-pt)*et)),St.add(new go.PathSegment(go.PathSegment.Bezier,nt-ht,et,nt-2*ht,(.5+pt)*et,nt-ht-ee*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 pt=new go.PathFigure(.25*nt,.25*et,!1);return ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,.5*nt,et)),ht.spot1=new go.Spot(.408,.172),ht.spot2=new go.Spot(.833,.662),ht}),go.Shape.defineFigureGenerator("Prism2",function(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 pt=new go.PathFigure(0,et,!1);return ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,.25*nt,.5*et)),pt.add(new go.PathSegment(go.PathSegment.Line,nt,.25*et)),pt.add(new go.PathSegment(go.PathSegment.Move,0,.25*et)),pt.add(new go.PathSegment(go.PathSegment.Line,.25*nt,.5*et)),ht.spot1=new go.Spot(.25,.5),ht.spot2=new go.Spot(.75,.75),ht}),go.Shape.defineFigureGenerator("Pyramid1",function(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 pt=new go.PathFigure(.5*nt,0,!1);return ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,.5*nt,et)),ht.spot1=new go.Spot(.25,.367),ht.spot2=new go.Spot(.75,.875),ht}),go.Shape.defineFigureGenerator("Pyramid2",function(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 pt=new go.PathFigure(.5*nt,0,!1);return ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,.5*nt,.7*et)),pt.add(new go.PathSegment(go.PathSegment.Line,0,.85*et)),pt.add(new go.PathSegment(go.PathSegment.Move,.5*nt,.7*et)),pt.add(new go.PathSegment(go.PathSegment.Line,nt,.85*et)),ht.spot1=new go.Spot(.25,.367),ht.spot2=new go.Spot(.75,.875),ht}),go.Shape.defineFigureGenerator("Actor",function(Bt,nt,et){var ht=new go.Geometry,st=.2,pt=.1,vt=ee*st,St=ee*pt,Et=.5,At=.1,It=new go.PathFigure(Et*nt,(At+pt)*et,!0);ht.add(It),It.add(new go.PathSegment(go.PathSegment.Bezier,(Et-st)*nt,At*et,(Et-vt)*nt,(At+pt)*et,(Et-st)*nt,(At+St)*et)),It.add(new go.PathSegment(go.PathSegment.Bezier,Et*nt,(At-pt)*et,(Et-st)*nt,(At-St)*et,(Et-vt)*nt,(At-pt)*et)),It.add(new go.PathSegment(go.PathSegment.Bezier,(Et+st)*nt,At*et,(Et+vt)*nt,(At-pt)*et,(Et+st)*nt,(At-St)*et)),It.add(new go.PathSegment(go.PathSegment.Bezier,Et*nt,(At+pt)*et,(Et+st)*nt,(At+St)*et,(Et+vt)*nt,(At+pt)*et));var qt=.05,Ut=ee*qt;Et=.05,At=.25;var Gt=new go.PathFigure(.5*nt,.2*et,!0);return ht.add(Gt),Gt.add(new go.PathSegment(go.PathSegment.Line,.95*nt,.2*et)),Et=.95,At=.25,Gt.add(new go.PathSegment(go.PathSegment.Bezier,(Et+qt)*nt,At*et,(Et+Ut)*nt,(At-qt)*et,(Et+qt)*nt,(At-Ut)*et)),Gt.add(new go.PathSegment(go.PathSegment.Line,nt,.6*et)),Gt.add(new go.PathSegment(go.PathSegment.Line,.85*nt,.6*et)),Gt.add(new go.PathSegment(go.PathSegment.Line,.85*nt,.35*et)),qt=.025,Ut=ee*qt,Et=.825,At=.35,Gt.add(new go.PathSegment(go.PathSegment.Bezier,Et*nt,(At-qt)*et,(Et+qt)*nt,(At-Ut)*et,(Et+Ut)*nt,(At-qt)*et)),Gt.add(new go.PathSegment(go.PathSegment.Bezier,(Et-qt)*nt,At*et,(Et-Ut)*nt,(At-qt)*et,(Et-qt)*nt,(At-Ut)*et)),Gt.add(new go.PathSegment(go.PathSegment.Line,.8*nt,et)),Gt.add(new go.PathSegment(go.PathSegment.Line,.55*nt,et)),Gt.add(new go.PathSegment(go.PathSegment.Line,.55*nt,.7*et)),qt=.05,Ut=ee*qt,Et=.5,At=.7,Gt.add(new go.PathSegment(go.PathSegment.Bezier,Et*nt,(At-qt)*et,(Et+qt)*nt,(At-Ut)*et,(Et+Ut)*nt,(At-qt)*et)),Gt.add(new go.PathSegment(go.PathSegment.Bezier,(Et-qt)*nt,At*et,(Et-Ut)*nt,(At-qt)*et,(Et-qt)*nt,(At-Ut)*et)),Gt.add(new go.PathSegment(go.PathSegment.Line,.45*nt,et)),Gt.add(new go.PathSegment(go.PathSegment.Line,.2*nt,et)),Gt.add(new go.PathSegment(go.PathSegment.Line,.2*nt,.35*et)),qt=.025,Ut=ee*qt,Et=.175,At=.35,Gt.add(new go.PathSegment(go.PathSegment.Bezier,Et*nt,(At-qt)*et,(Et+qt)*nt,(At-Ut)*et,(Et+Ut)*nt,(At-qt)*et)),Gt.add(new go.PathSegment(go.PathSegment.Bezier,(Et-qt)*nt,At*et,(Et-Ut)*nt,(At-qt)*et,(Et-qt)*nt,(At-Ut)*et)),Gt.add(new go.PathSegment(go.PathSegment.Line,.15*nt,.6*et)),Gt.add(new go.PathSegment(go.PathSegment.Line,0,.6*et)),Gt.add(new go.PathSegment(go.PathSegment.Line,0,.25*et)),qt=.05,Ut=ee*qt,Et=.05,At=.25,Gt.add(new go.PathSegment(go.PathSegment.Bezier,Et*nt,(At-qt)*et,(Et-qt)*nt,(At-Ut)*et,(Et-Ut)*nt,(At-qt)*et)),Gt.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 Mn("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,pt=new go.PathFigure(nt,0,!0);return st.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,nt,et)),pt.add(new go.PathSegment(go.PathSegment.Line,0,et)),pt.add(new go.PathSegment(go.PathSegment.Line,0,ht*et)),pt.add(new go.PathSegment(go.PathSegment.Line,ht*nt,0).close()),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 pt=new go.PathFigure(.5*nt,.5*et,!0);return ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,nt,et)),pt.add(new go.PathSegment(go.PathSegment.Line,0,et)),pt.add(new go.PathSegment(go.PathSegment.Line,.5*nt,.5*et)),ht.spot1=new go.Spot(.25,0),ht.spot2=new go.Spot(.75,.25),ht}),go.Shape.defineFigureGenerator("CreateRequest",function(Bt,nt,et){var ht=new go.Geometry,st=Bt?Bt.parameter1:NaN;isNaN(st)&&(st=.1);var pt=new go.PathFigure(0,0,!0);ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,nt,0)),pt.add(new go.PathSegment(go.PathSegment.Line,nt,et)),pt.add(new go.PathSegment(go.PathSegment.Line,0,et).close());var vt=new go.PathFigure(0,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=ee*.5,pt=ee*.1,vt=new go.PathFigure(nt,.1*et,!0);ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,nt,.9*et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,.5*nt,et,nt,(.9+pt)*et,(.5+st)*nt,et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,0,.9*et,(.5-st)*nt,et,0,(.9+pt)*et)),vt.add(new go.PathSegment(go.PathSegment.Line,0,.1*et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,.5*nt,0,0,(.1-pt)*et,(.5-st)*nt,0)),vt.add(new go.PathSegment(go.PathSegment.Bezier,nt,.1*et,(.5+st)*nt,0,nt,(.1-pt)*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+pt)*et,(.5+st)*nt,.2*et)),St.add(new go.PathSegment(go.PathSegment.Bezier,0,.1*et,(.5-st)*nt,.2*et,0,(.1+pt)*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+pt)*et,(.5+st)*nt,.3*et)),St.add(new go.PathSegment(go.PathSegment.Bezier,0,.2*et,(.5-st)*nt,.3*et,0,(.2+pt)*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+pt)*et,(.5+st)*nt,.4*et)),St.add(new go.PathSegment(go.PathSegment.Bezier,0,.3*et,(.5-st)*nt,.4*et,0,(.3+pt)*et)),ht.spot1=new go.Spot(0,.4),ht.spot2=new go.Spot(1,.9),ht}),go.Shape.defineFigureGenerator("DataStorage",function(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=ee*.5,pt=ee*.1,vt=new go.PathFigure(nt,.1*et,!0);ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,nt,.9*et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,.5*nt,et,nt,(.9+pt)*et,(.5+st)*nt,et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,0,.9*et,(.5-st)*nt,et,0,(.9+pt)*et)),vt.add(new go.PathSegment(go.PathSegment.Line,0,.1*et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,.5*nt,0,0,(.1-pt)*et,(.5-st)*nt,0)),vt.add(new go.PathSegment(go.PathSegment.Bezier,nt,.1*et,(.5+st)*nt,0,nt,(.1-pt)*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+pt)*et,(.5+st)*nt,.2*et)),St.add(new go.PathSegment(go.PathSegment.Bezier,0,.1*et,(.5-st)*nt,.2*et,0,(.1+pt)*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+pt)*et,(.5+st)*nt,.3*et)),St.add(new go.PathSegment(go.PathSegment.Bezier,0,.2*et,(.5-st)*nt,.3*et,0,(.2+pt)*et)),ht.spot1=new go.Spot(0,.3),ht.spot2=new go.Spot(1,.9),ht}),go.Shape.defineFigureGenerator("Display",function(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 pt=ee*.2,vt=new go.PathFigure(0,.2*et,!0);ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Bezier,.2*nt,0,0,(.2-pt)*et,(.2-pt)*nt,0)),vt.add(new go.PathSegment(go.PathSegment.Line,.8*nt,0)),vt.add(new go.PathSegment(go.PathSegment.Bezier,nt,.2*et,(.8+pt)*nt,0,nt,(.2-pt)*et)),vt.add(new go.PathSegment(go.PathSegment.Line,nt,.8*et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,.8*nt,et,nt,(.8+pt)*et,(.8+pt)*nt,et)),vt.add(new go.PathSegment(go.PathSegment.Line,.2*nt,et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,0,.8*et,(.2-pt)*nt,et,0,(.8+pt)*et)),vt.add(new go.PathSegment(go.PathSegment.Line,0,.2*et));var 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 pt=new go.PathFigure(0,0,!0);ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,nt,0)),pt.add(new go.PathSegment(go.PathSegment.Line,nt,et)),pt.add(new go.PathSegment(go.PathSegment.Line,0,et).close());var vt=new go.PathFigure(0,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 pt=new go.PathFigure(0,0,!0);ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,nt,0)),pt.add(new go.PathSegment(go.PathSegment.Line,nt,et)),pt.add(new go.PathSegment(go.PathSegment.Line,0,et).close());var vt=new go.PathFigure(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 pt=new go.PathFigure(.1*nt,.4*et,!1);return ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,.1*nt,.6*et)),pt.add(new go.PathSegment(go.PathSegment.Move,.9*nt,.6*et)),pt.add(new go.PathSegment(go.PathSegment.Line,.9*nt,.4*et)),pt.add(new go.PathSegment(go.PathSegment.Move,.6*nt,.1*et)),pt.add(new go.PathSegment(go.PathSegment.Line,.4*nt,.1*et)),pt.add(new go.PathSegment(go.PathSegment.Move,.4*nt,.9*et)),pt.add(new go.PathSegment(go.PathSegment.Line,.6*nt,.9*et)),ht.spot1=new go.Spot(.25,.25),ht.spot2=new go.Spot(.75,.75),ht}),go.Shape.defineFigureGenerator("File",function(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 pt=new go.PathFigure(.75*nt,0,!1);return ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,.75*nt,.25*et)),pt.add(new go.PathSegment(go.PathSegment.Line,nt,.25*et)),ht.spot1=new go.Spot(0,.25),ht.spot2=go.Spot.BottomRight,ht}),go.Shape.defineFigureGenerator("Interrupt",function(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 pt=new go.PathFigure(nt,.5*et,!1);ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,nt,et));var vt=new go.PathFigure(nt,.5*et,!1);return ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,nt,0)),ht.spot1=new go.Spot(0,.25),ht.spot2=new go.Spot(.5,.75),ht}),go.Shape.defineFigureGenerator("InternalStorage",function(Bt,nt,et){var ht=new go.Geometry,st=Bt?Bt.parameter1:NaN,pt=Bt?Bt.parameter2:NaN;isNaN(st)&&(st=.1),isNaN(pt)&&(pt=.1);var vt=new go.PathFigure(0,0,!0);ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,nt,0)),vt.add(new go.PathSegment(go.PathSegment.Line,nt,et)),vt.add(new go.PathSegment(go.PathSegment.Line,0,et).close());var 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,pt*et)),St.add(new go.PathSegment(go.PathSegment.Line,nt,pt*et)),ht}),go.Shape.defineFigureGenerator("Junction",function(Bt,nt,et){var ht=new go.Geometry,st=1/Math.SQRT2,pt=(1-1/Math.SQRT2)/2,vt=ee*.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 At=new go.PathFigure((pt+st)*nt,(pt+st)*et,!1);return ht.add(At),At.add(new go.PathSegment(go.PathSegment.Line,pt*nt,pt*et)),At.add(new go.PathSegment(go.PathSegment.Move,pt*nt,(pt+st)*et)),At.add(new go.PathSegment(go.PathSegment.Line,(pt+st)*nt,pt*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 pt=new go.PathFigure(.1*nt,0,!1);return ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,.1*nt,.75*et)),ht.spot1=new go.Spot(.1,0),ht.spot2=new go.Spot(1,.6),ht}),go.Shape.defineFigureGenerator("LoopLimit",function(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=ee*.5,pt=.5,vt=new go.PathFigure(.5*nt,et,!0);return ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Bezier,0,pt*et,(pt-st)*nt,et,0,(pt+st)*et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,pt*nt,0,0,(pt-st)*et,(pt-st)*nt,0)),vt.add(new go.PathSegment(go.PathSegment.Bezier,nt,pt*et,(pt+st)*nt,0,nt,(pt-st)*et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,(pt+.1)*nt,.9*et,nt,(pt+st)*et,(pt+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 pt=new go.PathFigure(0,0,!0);return ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,nt,0)),pt.add(new go.PathSegment(go.PathSegment.Line,st*nt,.5*et)),pt.add(new go.PathSegment(go.PathSegment.Line,nt,et)),pt.add(new go.PathSegment(go.PathSegment.Line,0,et).close()),ht.spot1=go.Spot.TopLeft,ht}),go.Shape.defineFigureGenerator("MicroformProcessing",function(Bt,nt,et){var ht=new go.Geometry,st=Bt?Bt.parameter1:NaN;isNaN(st)&&(st=.25);var pt=new go.PathFigure(0,0,!0);return ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,.5*nt,st*et)),pt.add(new go.PathSegment(go.PathSegment.Line,nt,0)),pt.add(new go.PathSegment(go.PathSegment.Line,nt,et)),pt.add(new go.PathSegment(go.PathSegment.Line,.5*nt,(1-st)*et)),pt.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 pt=new go.PathFigure(.1*nt,.2*et,!1);return ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,.8*nt,.2*et)),pt.add(new go.PathSegment(go.PathSegment.Line,.8*nt,.54*et)),pt.add(new go.PathSegment(go.PathSegment.Move,.2*nt,.1*et)),pt.add(new go.PathSegment(go.PathSegment.Line,.9*nt,.1*et)),pt.add(new go.PathSegment(go.PathSegment.Line,.9*nt,.44*et)),ht.spot1=new go.Spot(0,.25),ht.spot2=new go.Spot(.8,.77),ht}),go.Shape.defineFigureGenerator("MultiProcess",function(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 pt=new go.PathFigure(.2*nt,.1*et,!1);return ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,.9*nt,.1*et)),pt.add(new go.PathSegment(go.PathSegment.Line,.9*nt,.8*et)),pt.add(new go.PathSegment(go.PathSegment.Move,.1*nt,.2*et)),pt.add(new go.PathSegment(go.PathSegment.Line,.8*nt,.2*et)),pt.add(new go.PathSegment(go.PathSegment.Line,.8*nt,.9*et)),ht.spot1=new go.Spot(0,.2),ht.spot2=new go.Spot(.8,1),ht}),go.Shape.defineFigureGenerator("OfflineStorage",function(Bt,nt,et){var ht=new go.Geometry,st=Bt?Bt.parameter1:NaN;isNaN(st)&&(st=.1);var pt=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=ee*.5,pt=.5,vt=new go.PathFigure(nt,pt*et,!0);ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Bezier,pt*nt,et,nt,(pt+st)*et,(pt+st)*nt,et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,0,pt*et,(pt-st)*nt,et,0,(pt+st)*et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,pt*nt,0,0,(pt-st)*et,(pt-st)*nt,0)),vt.add(new go.PathSegment(go.PathSegment.Bezier,nt,pt*et,(pt+st)*nt,0,nt,(pt-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,pt=Bt?Bt.parameter2:NaN;isNaN(st)&&(st=.1),isNaN(pt)&&(pt=.3);var vt=new go.PathFigure(0,0,!0);return ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,nt,0)),vt.add(new go.PathSegment(go.PathSegment.Line,(1-pt)*nt,.5*et)),vt.add(new go.PathSegment(go.PathSegment.Line,nt,et)),vt.add(new go.PathSegment(go.PathSegment.Line,0,et).close()),ht}),go.Shape.defineFigureGenerator("PrimitiveToCall",function(Bt,nt,et){var ht=new go.Geometry,st=Bt?Bt.parameter1:NaN,pt=Bt?Bt.parameter2:NaN;isNaN(st)&&(st=.1),isNaN(pt)&&(pt=.3);var vt=new go.PathFigure(0,0,!0);return ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,(1-pt)*nt,0)),vt.add(new go.PathSegment(go.PathSegment.Line,nt,.5*et)),vt.add(new go.PathSegment(go.PathSegment.Line,(1-pt)*nt,et)),vt.add(new go.PathSegment(go.PathSegment.Line,0,et).close()),ht}),go.Shape.defineFigureGenerator("Procedure",function(Bt,nt,et){var ht=new go.Geometry,st=Bt?Bt.parameter1:NaN;isNaN(st)&&(st=.1);var pt=new go.PathFigure(0,0,!0);ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,nt,0)),pt.add(new go.PathSegment(go.PathSegment.Line,nt,et)),pt.add(new go.PathSegment(go.PathSegment.Line,0,et).close());var vt=new go.PathFigure((1-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 pt=new go.PathFigure(0,0,!0);ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,nt,0)),pt.add(new go.PathSegment(go.PathSegment.Line,nt,et)),pt.add(new go.PathSegment(go.PathSegment.Line,0,et).close());var vt=new go.PathFigure(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 pt=new go.PathFigure(0,.5*et,!1);return ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,nt,.5*et)),ht.spot1=new go.Spot(.25,.25),ht.spot2=new go.Spot(.75,.5),ht}),go.Shape.defineFigureGenerator("Start",function(Bt,nt,et){var ht=new go.Geometry,st=Bt?Bt.parameter1:NaN;isNaN(st)&&(st=.25);var pt=new go.PathFigure(st*nt,0,!0);ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Arc,270,180,.75*nt,.5*et,.25*nt,.5*et)),pt.add(new go.PathSegment(go.PathSegment.Arc,90,180,.25*nt,.5*et,.25*nt,.5*et));var vt=new go.PathFigure(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 pt=new go.PathFigure(0,0,!0);return ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,nt,0)),pt.add(new go.PathSegment(go.PathSegment.Line,nt,et)),pt.add(new go.PathSegment(go.PathSegment.Line,.75*nt,(1-st)*et)),pt.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=ee*.5,pt=new go.PathFigure(0,0,!0);return ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,.5*nt,0)),pt.add(new go.PathSegment(go.PathSegment.Bezier,nt,.5*et,(.5+st)*nt,0,nt,(.5-st)*et)),pt.add(new go.PathSegment(go.PathSegment.Bezier,.5*nt,et,nt,(.5+st)*et,(.5+st)*nt,et)),pt.add(new go.PathSegment(go.PathSegment.Line,0,et).close()),ht.spot1=go.Spot.TopLeft,ht.spot2=new go.Spot(.55,1),ht}),go.Shape.defineFigureGenerator("Buffer",function(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=ee*.5,pt=.5,vt=new go.PathFigure(nt,pt*et,!0);ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Bezier,pt*nt,et,nt,(pt+st)*et,(pt+st)*nt,et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,0,pt*et,(pt-st)*nt,et,0,(pt+st)*et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,pt*nt,0,0,(pt-st)*et,(pt-st)*nt,0)),vt.add(new go.PathSegment(go.PathSegment.Bezier,nt,pt*et,(pt+st)*nt,0,nt,(pt-st)*et));var St=new go.PathFigure(nt,pt*et,!1);ht.add(St),St.add(new go.PathSegment(go.PathSegment.Line,nt,pt*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=ee*.1,pt=.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 At=new go.PathFigure((vt+pt)*nt,St*et,!0);return ht.add(At),At.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,(St+pt)*et,(vt+pt)*nt,(St+st)*et,(vt+st)*nt,(St+pt)*et)),At.add(new go.PathSegment(go.PathSegment.Bezier,(vt-pt)*nt,St*et,(vt-st)*nt,(St+pt)*et,(vt-pt)*nt,(St+st)*et)),At.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,(St-pt)*et,(vt-pt)*nt,(St-st)*et,(vt-st)*nt,(St-pt)*et)),At.add(new go.PathSegment(go.PathSegment.Bezier,(vt+pt)*nt,St*et,(vt+st)*nt,(St-pt)*et,(vt+pt)*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=ee*.5,pt=ee*.4,vt=ee*.1,St=.1,Et=.9,At=.5,It=new go.PathFigure(.8*nt,.5*et,!0);ht.add(It),It.add(new go.PathSegment(go.PathSegment.Bezier,.4*nt,et,.8*nt,(.5+pt)*et,(.4+st)*nt,et)),It.add(new go.PathSegment(go.PathSegment.Line,0,et)),It.add(new go.PathSegment(go.PathSegment.Line,0,0)),It.add(new go.PathSegment(go.PathSegment.Line,.4*nt,0)),It.add(new go.PathSegment(go.PathSegment.Bezier,.8*nt,.5*et,(.4+st)*nt,0,.8*nt,(.5-pt)*et));var qt=new go.PathFigure((Et+St)*nt,At*et,!0);return ht.add(qt),qt.add(new go.PathSegment(go.PathSegment.Bezier,Et*nt,(At+St)*et,(Et+St)*nt,(At+vt)*et,(Et+vt)*nt,(At+St)*et)),qt.add(new go.PathSegment(go.PathSegment.Bezier,(Et-St)*nt,At*et,(Et-vt)*nt,(At+St)*et,(Et-St)*nt,(At+vt)*et)),qt.add(new go.PathSegment(go.PathSegment.Bezier,Et*nt,(At-St)*et,(Et-St)*nt,(At-vt)*et,(Et-vt)*nt,(At-St)*et)),qt.add(new go.PathSegment(go.PathSegment.Bezier,(Et+St)*nt,At*et,(Et+vt)*nt,(At-St)*et,(Et+St)*nt,(At-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,pt=ee*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+pt)*et,(vt+pt)*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+pt)*nt,(St-st)*et,.7*nt,(St-pt)*et)),st=.1,pt=ee*.1,vt=.9,St=.5;var At=new go.PathFigure((vt-st)*nt,St*et,!0);return ht.add(At),At.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,(St-st)*et,(vt-st)*nt,(St-pt)*et,(vt-pt)*nt,(St-st)*et)),At.add(new go.PathSegment(go.PathSegment.Bezier,(vt+st)*nt,St*et,(vt+pt)*nt,(St-st)*et,(vt+st)*nt,(St-pt)*et)),At.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,(St+st)*et,(vt+st)*nt,(St+pt)*et,(vt+pt)*nt,(St+st)*et)),At.add(new go.PathSegment(go.PathSegment.Bezier,(vt-st)*nt,St*et,(vt-pt)*nt,(St+st)*et,(vt-st)*nt,(St+pt)*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,pt=ee*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+pt+pt)*nt,(St-st)*et,.8*nt,(St-pt)*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,0,et,.8*nt,(St+pt)*et,(vt+pt+pt)*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,pt=ee*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 At=new go.PathFigure(.8*nt,.5*et,!0);ht.add(At),At.add(new go.PathSegment(go.PathSegment.Bezier,.2*nt,et,.7*nt,(St+pt)*et,(vt+pt)*nt,(St+st)*et)),At.add(new go.PathSegment(go.PathSegment.Bezier,.2*nt,0,.45*nt,.75*et,.45*nt,.25*et)),At.add(new go.PathSegment(go.PathSegment.Bezier,.8*nt,.5*et,(vt+pt)*nt,(St-st)*et,.7*nt,(St-pt)*et)),st=.1,pt=ee*.1,vt=.9,St=.5;var It=new go.PathFigure((vt-st)*nt,St*et,!0);return ht.add(It),It.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,(St-st)*et,(vt-st)*nt,(St-pt)*et,(vt-pt)*nt,(St-st)*et)),It.add(new go.PathSegment(go.PathSegment.Bezier,(vt+st)*nt,St*et,(vt+pt)*nt,(St-st)*et,(vt+st)*nt,(St-pt)*et)),It.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,(St+st)*et,(vt+st)*nt,(St+pt)*et,(vt+pt)*nt,(St+st)*et)),It.add(new go.PathSegment(go.PathSegment.Bezier,(vt-st)*nt,St*et,(vt-pt)*nt,(St+st)*et,(vt-st)*nt,(St+pt)*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,pt=ee*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 At=new go.PathFigure(.2*nt,0,!0);return ht.add(At),At.add(new go.PathSegment(go.PathSegment.Bezier,nt,.5*et,(vt+pt)*nt,(St-st)*et,.9*nt,(St-pt)*et)),At.add(new go.PathSegment(go.PathSegment.Bezier,.2*nt,et,.9*nt,(St+pt)*et,(vt+pt)*nt,(St+st)*et)),At.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=ee*.1,pt=.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+pt)*nt,0,(vt-st)*nt,et,(vt-pt)*nt,0)),vt=.3,Et.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,et,(vt+pt)*nt,0,(vt+st)*nt,et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,(vt+pt)*nt,0,(vt-st)*nt,et,(vt-pt)*nt,0)),vt=.5,Et.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,et,(vt+pt)*nt,0,(vt+st)*nt,et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,(vt+pt)*nt,0,(vt-st)*nt,et,(vt-pt)*nt,0)),vt=.7,Et.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,et,(vt+pt)*nt,0,(vt+st)*nt,et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,(vt+pt)*nt,0,(vt-st)*nt,et,(vt-pt)*nt,0)),vt=.9,Et.add(new go.PathSegment(go.PathSegment.Bezier,(vt+st*.5)*nt,et,(vt+pt)*nt,0,(vt+st)*nt,et)),ht}),go.Shape.defineFigureGenerator("ACvoltageSource",function(Bt,nt,et){var ht=new go.Geometry,st=ee*.5,pt=.5,vt=.5,St=.5,Et=new go.PathFigure((vt-pt)*nt,St*et,!1);return ht.add(Et),Et.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,(St-pt)*et,(vt-pt)*nt,(St-st)*et,(vt-st)*nt,(St-pt)*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,(vt+pt)*nt,St*et,(vt+st)*nt,(St-pt)*et,(vt+pt)*nt,(St-st)*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,(St+pt)*et,(vt+pt)*nt,(St+st)*et,(vt+st)*nt,(St+pt)*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,(vt-pt)*nt,St*et,(vt-st)*nt,(St+pt)*et,(vt-pt)*nt,(St+st)*et)),Et.add(new go.PathSegment(go.PathSegment.Move,(vt-pt+.1)*nt,St*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,(vt+pt-.1)*nt,St*et,vt*nt,(St-pt)*et,vt*nt,(St+pt)*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,pt=et;nt=nt*.38,et=et*.6;var vt=ee*.8,St=.8,Et=0,At=.5,It=(st-nt)/2,qt=(pt-et)/2,Ut=new go.PathFigure(Et*nt+It,(At+St)*et+qt,!0);ht.add(Ut),Ut.add(new go.PathSegment(go.PathSegment.Bezier,(Et-St)*nt+It,At*et+qt,(Et-vt)*nt+It,(At+St)*et+qt,(Et-St)*nt+It,(At+vt)*et+qt)),Ut.add(new go.PathSegment(go.PathSegment.Bezier,Et*nt+It,(At-St)*et+qt,(Et-St)*nt+It,(At-vt)*et+qt,(Et-vt)*nt+It,(At-St)*et+qt)),Ut.add(new go.PathSegment(go.PathSegment.Bezier,(Et-St+vt*.5)*nt+It,At*et+qt,Et*nt+It,(At-St)*et+qt,(Et-St+vt*.5)*nt+It,(At-vt)*et+qt)),Ut.add(new go.PathSegment(go.PathSegment.Bezier,Et*nt+It,(At+St)*et+qt,(Et-St+vt*.5)*nt+It,(At+vt)*et+qt,Et*nt+It,(At+St)*et+qt).close()),vt=ee*.4,St=.4,Et=.2,At=.5;var Gt=new go.PathFigure(Et*nt+It,(At+St)*et+qt,!0);ht.add(Gt),Gt.add(new go.PathSegment(go.PathSegment.Bezier,(Et-St)*nt+It,At*et+qt,(Et-vt)*nt+It,(At+St)*et+qt,(Et-St)*nt+It,(At+vt)*et+qt)),Gt.add(new go.PathSegment(go.PathSegment.Bezier,Et*nt+It,(At-St)*et+qt,(Et-St)*nt+It,(At-vt)*et+qt,(Et-vt)*nt+It,(At-St)*et+qt)),Gt.add(new go.PathSegment(go.PathSegment.Bezier,(Et-St+vt*.5)*nt+It,At*et+qt,Et*nt+It,(At-St)*et+qt,(Et-St+vt*.5)*nt+It,(At-vt)*et+qt)),Gt.add(new go.PathSegment(go.PathSegment.Bezier,Et*nt+It,(At+St)*et+qt,(Et-St+vt*.5)*nt+It,(At+vt)*et+qt,Et*nt+It,(At+St)*et+qt).close()),vt=ee*.2,St=.2,Et=.5,At=.5;var ge=new go.PathFigure((Et-St)*nt+It,At*et+qt,!0);ht.add(ge),ge.add(new go.PathSegment(go.PathSegment.Bezier,Et*nt+It,(At-St)*et+qt,(Et-St)*nt+It,(At-vt)*et+qt,(Et-vt)*nt+It,(At-St)*et+qt)),ge.add(new go.PathSegment(go.PathSegment.Bezier,(Et+St)*nt+It,At*et+qt,(Et+vt)*nt+It,(At-St)*et+qt,(Et+St)*nt+It,(At-vt)*et+qt)),ge.add(new go.PathSegment(go.PathSegment.Bezier,Et*nt+It,(At+St)*et+qt,(Et+St)*nt+It,(At+vt)*et+qt,(Et+vt)*nt+It,(At+St)*et+qt)),ge.add(new go.PathSegment(go.PathSegment.Bezier,(Et-St)*nt+It,At*et+qt,(Et-vt)*nt+It,(At+St)*et+qt,(Et-St)*nt+It,(At+vt)*et+qt)),vt=ee*.4,St=.4,Et=.8,At=.5;var ie=new go.PathFigure(Et*nt+It,(At-St)*et+qt,!0);ht.add(ie),ie.add(new go.PathSegment(go.PathSegment.Bezier,(Et+St)*nt+It,At*et+qt,(Et+vt)*nt+It,(At-St)*et+qt,(Et+St)*nt+It,(At-vt)*et+qt)),ie.add(new go.PathSegment(go.PathSegment.Bezier,Et*nt+It,(At+St)*et+qt,(Et+St)*nt+It,(At+vt)*et+qt,(Et+vt)*nt+It,(At+St)*et+qt)),ie.add(new go.PathSegment(go.PathSegment.Bezier,(Et+St-vt*.5)*nt+It,At*et+qt,Et*nt+It,(At+St)*et+qt,(Et+St-vt*.5)*nt+It,(At+vt)*et+qt)),ie.add(new go.PathSegment(go.PathSegment.Bezier,Et*nt+It,(At-St)*et+qt,(Et+St-vt*.5)*nt+It,(At-vt)*et+qt,Et*nt+It,(At-St)*et+qt).close()),vt=ee*.8,St=.8,Et=1,At=.5;var Te=new go.PathFigure(Et*nt+It,(At-St)*et+qt,!0);return ht.add(Te),Te.add(new go.PathSegment(go.PathSegment.Bezier,(Et+St)*nt+It,At*et+qt,(Et+vt)*nt+It,(At-St)*et+qt,(Et+St)*nt+It,(At-vt)*et+qt)),Te.add(new go.PathSegment(go.PathSegment.Bezier,Et*nt+It,(At+St)*et+qt,(Et+St)*nt+It,(At+vt)*et+qt,(Et+vt)*nt+It,(At+St)*et+qt)),Te.add(new go.PathSegment(go.PathSegment.Bezier,(Et+St-vt*.5)*nt+It,At*et+qt,Et*nt+It,(At+St)*et+qt,(Et+St-vt*.5)*nt+It,(At+vt)*et+qt)),Te.add(new go.PathSegment(go.PathSegment.Bezier,Et*nt+It,(At-St)*et+qt,(Et+St-vt*.5)*nt+It,(At-vt)*et+qt,Et*nt+It,(At-St)*et+qt).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 pt=new go.PathFigure(0,0,!1);return ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,.5*nt,.6*et)),pt.add(new go.PathSegment(go.PathSegment.Line,nt,0)),pt.add(new go.PathSegment(go.PathSegment.Move,0,et)),pt.add(new go.PathSegment(go.PathSegment.Line,.45*nt,.54*et)),pt.add(new go.PathSegment(go.PathSegment.Move,nt,et)),pt.add(new go.PathSegment(go.PathSegment.Line,.55*nt,.54*et)),ht}),go.Shape.defineFigureGenerator("Ethernet",function(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 pt=new go.PathFigure(.1*nt,et,!0,!0);ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,.4*nt,et)),pt.add(new go.PathSegment(go.PathSegment.Line,.4*nt,.6*et)),pt.add(new go.PathSegment(go.PathSegment.Line,.1*nt,.6*et)),pt.add(new go.PathSegment(go.PathSegment.Line,.1*nt,et).close());var vt=new go.PathFigure(.6*nt,et,!0,!0);ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,.9*nt,et)),vt.add(new go.PathSegment(go.PathSegment.Line,.9*nt,.6*et)),vt.add(new go.PathSegment(go.PathSegment.Line,.6*nt,.6*et)),vt.add(new go.PathSegment(go.PathSegment.Line,.6*nt,et).close());var 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=ee*.4,pt=.4,vt=.5,St=.5,Et=ft(),At=ft(),It=ft(),qt=ft();we(vt,St-pt,vt+st,St-pt,vt+pt,St-st,vt+pt,St,.5,Et,Et,At,It,qt);var Ut=kt(At.x,At.y),Gt=new go.PathFigure(At.x*nt,At.y*et,!0);ht.add(Gt),Gt.add(new go.PathSegment(go.PathSegment.Bezier,(vt+pt)*nt,St*et,It.x*nt,It.y*et,qt.x*nt,qt.y*et)),Gt.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,(St+pt)*et,(vt+pt)*nt,(St+st)*et,(vt+st)*nt,(St+pt)*et)),Gt.add(new go.PathSegment(go.PathSegment.Bezier,(vt-pt)*nt,St*et,(vt-st)*nt,(St+pt)*et,(vt-pt)*nt,(St+st)*et)),we(vt-pt,St,vt-pt,St-st,vt-st,St-pt,vt,St-pt,.5,It,qt,At,Et,Et),Gt.add(new go.PathSegment(go.PathSegment.Bezier,At.x*nt,At.y*et,It.x*nt,It.y*et,qt.x*nt,qt.y*et)),st=ee*.3,pt=.3,we(vt-pt,St,vt-pt,St-st,vt-st,St-pt,vt,St-pt,.5,It,qt,At,Et,Et),Gt.add(new go.PathSegment(go.PathSegment.Line,At.x*nt,At.y*et)),Gt.add(new go.PathSegment(go.PathSegment.Bezier,(vt-pt)*nt,St*et,qt.x*nt,qt.y*et,It.x*nt,It.y*et)),Gt.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,(St+pt)*et,(vt-pt)*nt,(St+st)*et,(vt-st)*nt,(St+pt)*et)),Gt.add(new go.PathSegment(go.PathSegment.Bezier,(vt+pt)*nt,St*et,(vt+st)*nt,(St+pt)*et,(vt+pt)*nt,(St+st)*et)),we(vt,St-pt,vt+st,St-pt,vt+pt,St-st,vt+pt,St,.5,Et,Et,At,It,qt),Gt.add(new go.PathSegment(go.PathSegment.Bezier,At.x*nt,At.y*et,qt.x*nt,qt.y*et,It.x*nt,It.y*et).close());var Gt=new go.PathFigure(.45*nt,0,!0);return ht.add(Gt),Gt.add(new go.PathSegment(go.PathSegment.Line,.45*nt,.5*et)),Gt.add(new go.PathSegment(go.PathSegment.Line,.55*nt,.5*et)),Gt.add(new go.PathSegment(go.PathSegment.Line,.55*nt,0).close()),Kt(Et),Kt(At),Kt(It),Kt(qt),Kt(Ut),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 pt(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 pt(st,0,0),pt(st,.4,0),pt(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,pt=0,vt=0,St=st*ee,Et=.4*Math.SQRT2/2+.5,At=.5-.5*Math.SQRT2/2,It=1,qt=.5,Ut=.5,Gt=0,ge=new go.PathFigure(Et*nt,(1-At)*et,!1);return ht.add(ge),ge.add(new go.PathSegment(go.PathSegment.Bezier,It*nt,qt*et,It*nt,.7*et,It*nt,qt*et)),ge.add(new go.PathSegment(go.PathSegment.Bezier,(Ut+pt)*nt,(Gt+pt)*et,(.5+st+pt)*nt,(.5-St+pt)*et,(.5+St+pt)*nt,(.5-st+pt)*et)),ge.add(new go.PathSegment(go.PathSegment.Bezier,(.5-st+pt)*nt,(.5+vt)*et,(.5-St+pt)*nt,(.5-st+vt)*et,(.5-st+pt)*nt,(.5-St+vt)*et)),ge.add(new go.PathSegment(go.PathSegment.Bezier,(.35+pt)*nt,.9*et,(.5-st+pt)*nt,(.5+St+vt)*et,(.5-St+pt)*nt,.9*et)),ge.add(new go.PathSegment(go.PathSegment.Move,(.25+pt)*nt,.8*et)),ge.add(new go.PathSegment(go.PathSegment.Line,(.35+pt)*nt,.9*et)),ge.add(new go.PathSegment(go.PathSegment.Line,(.2+pt)*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 pt=new go.PathFigure(nt,et,!1);ht.add(pt);var vt=new go.PathFigure(0,.5*et,!1);return ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Bezier,.5*nt,.5*et,.2*nt,.35*et,.3*nt,.35*et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,nt,.5*et,.7*nt,.65*et,.8*nt,.65*et)),ht}),go.Shape.defineFigureGenerator("BpmnActivityCompensation",function(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 pt=new go.PathFigure(.45*nt,.73*et,!1);return ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,.7*nt,.73*et)),pt.add(new go.PathSegment(go.PathSegment.Move,.38*nt,.5*et)),pt.add(new go.PathSegment(go.PathSegment.Line,.63*nt,.5*et)),pt.add(new go.PathSegment(go.PathSegment.Move,.31*nt,.27*et)),pt.add(new go.PathSegment(go.PathSegment.Line,.56*nt,.27*et)),ht}),go.Shape.defineFigureGenerator("BpmnTaskUser",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,0,!1);ht.add(st);var pt=new go.PathFigure(.335*nt,(1-.555)*et,!0);ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,.335*nt,(1-.405)*et)),pt.add(new go.PathSegment(go.PathSegment.Line,(1-.335)*nt,(1-.405)*et)),pt.add(new go.PathSegment(go.PathSegment.Line,(1-.335)*nt,(1-.555)*et)),pt.add(new go.PathSegment(go.PathSegment.Bezier,nt,.68*et,(1-.12)*nt,.46*et,(1-.02)*nt,.54*et)),pt.add(new go.PathSegment(go.PathSegment.Line,nt,et)),pt.add(new go.PathSegment(go.PathSegment.Line,0,et)),pt.add(new go.PathSegment(go.PathSegment.Line,0,.68*et)),pt.add(new go.PathSegment(go.PathSegment.Bezier,.335*nt,(1-.555)*et,.02*nt,.54*et,.12*nt,.46*et)),pt.add(new go.PathSegment(go.PathSegment.Line,.365*nt,(1-.595)*et));var vt=.5-.285,St=.5,Et=vt,At=Math.PI/4,It=4*(1-Math.cos(At))/(3*Math.sin(At)),qt=It*.5,Ut=vt,Gt=vt,ge=It*Ut,ie=It*Gt;pt.add(new go.PathSegment(go.PathSegment.Bezier,(St-Ut)*nt,Et*et,(St-(ge+Ut)/2)*nt,(Et+(Gt+ie)/2)*et,(St-Ut)*nt,(Et+ie)*et)),pt.add(new go.PathSegment(go.PathSegment.Bezier,St*nt,(Et-Gt)*et,(St-Ut)*nt,(Et-ie)*et,(St-ge)*nt,(Et-Gt)*et)),pt.add(new go.PathSegment(go.PathSegment.Bezier,(St+Ut)*nt,Et*et,(St+ge)*nt,(Et-Gt)*et,(St+Ut)*nt,(Et-ie)*et)),pt.add(new go.PathSegment(go.PathSegment.Bezier,(1-.365)*nt,(1-.595)*et,(St+Ut)*nt,(Et+ie)*et,(St+(ge+Ut)/2)*nt,(Et+(Gt+ie)/2)*et)),pt.add(new go.PathSegment(go.PathSegment.Line,(1-.365)*nt,(1-.595)*et)),pt.add(new go.PathSegment(go.PathSegment.Line,(1-.335)*nt,(1-.555)*et)),pt.add(new go.PathSegment(go.PathSegment.Line,(1-.335)*nt,(1-.405)*et)),pt.add(new go.PathSegment(go.PathSegment.Line,.335*nt,(1-.405)*et));var Te=new go.PathFigure(.2*nt,et,!1);ht.add(Te),Te.add(new go.PathSegment(go.PathSegment.Line,.2*nt,.8*et));var ve=new go.PathFigure(.8*nt,et,!1);return ht.add(ve),ve.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 pt=new go.PathFigure(.2*nt,.2*et,!1);return ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,.8*nt,.2*et)),pt.add(new go.PathSegment(go.PathSegment.Move,.2*nt,.4*et)),pt.add(new go.PathSegment(go.PathSegment.Line,.8*nt,.4*et)),pt.add(new go.PathSegment(go.PathSegment.Move,.2*nt,.6*et)),pt.add(new go.PathSegment(go.PathSegment.Line,.8*nt,.6*et)),pt.add(new go.PathSegment(go.PathSegment.Move,.2*nt,.8*et)),pt.add(new go.PathSegment(go.PathSegment.Line,.8*nt,.8*et)),ht}),go.Shape.defineFigureGenerator("BpmnEventError",function(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 pt=new go.PathFigure(nt,et,!1);ht.add(pt);var vt=new go.PathFigure(.1*nt,et,!0);return ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,.5*nt,0)),vt.add(new go.PathSegment(go.PathSegment.Line,.9*nt,et)),vt.add(new go.PathSegment(go.PathSegment.Line,.5*nt,.5*et).close()),ht}),go.Shape.defineFigureGenerator("Caution",function(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 pt=.05;return st.add(new go.PathSegment(go.PathSegment.Move,(.5-pt)*nt,.875*et)),st.add(new go.PathSegment(go.PathSegment.Arc,180,-360,.5*nt,.875*et,pt*nt,pt*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 pt=new go.PathFigure(.475*nt,.2*et,!1);ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,.4*nt,.4*et)),pt.add(new go.PathSegment(go.PathSegment.Line,.225*nt,.3*et)),pt.add(new go.PathSegment(go.PathSegment.Line,.275*nt,.175*et)),pt.add(new go.PathSegment(go.PathSegment.Line,.325*nt,.05*et)),pt.add(new go.PathSegment(go.PathSegment.Bezier,.4*nt,.05*et,.35*nt,0,.375*nt,0)),pt.add(new go.PathSegment(go.PathSegment.Line,.575*nt,.375*et)),pt.add(new go.PathSegment(go.PathSegment.Line,.525*nt,.4*et)),pt.add(new go.PathSegment(go.PathSegment.Line,.75*nt,.475*et)),pt.add(new go.PathSegment(go.PathSegment.Line,.85*nt,.315*et)),pt.add(new go.PathSegment(go.PathSegment.Line,.8*nt,.32*et)),pt.add(new go.PathSegment(go.PathSegment.Line,.65*nt,.05*et)),pt.add(new go.PathSegment(go.PathSegment.Bezier,.575*nt,0,.65*nt,.05*et,.625*nt,0)),pt.add(new go.PathSegment(go.PathSegment.Line,.38*nt,.0105*et));var vt=new go.PathFigure(.675*nt,.575*et,!1);return ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,.875*nt,.525*et)),vt.add(new go.PathSegment(go.PathSegment.Line,nt,.775*et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,.85*nt,.95*et,nt,.8*et,nt,.85*et)),vt.add(new go.PathSegment(go.PathSegment.Line,.65*nt,.95*et)),vt.add(new go.PathSegment(go.PathSegment.Line,.65*nt,et)),vt.add(new go.PathSegment(go.PathSegment.Line,.55*nt,.85*et)),vt.add(new go.PathSegment(go.PathSegment.Line,.65*nt,.725*et)),vt.add(new go.PathSegment(go.PathSegment.Line,.65*nt,.775*et)),vt.add(new go.PathSegment(go.PathSegment.Line,.7*nt,.775*et)),vt.add(new go.PathSegment(go.PathSegment.Line,nt,.775*et)),vt.add(new go.PathSegment(go.PathSegment.Move,.675*nt,.575*et)),vt.add(new go.PathSegment(go.PathSegment.Line,.775*nt,.775*et)),ht}),go.Shape.defineFigureGenerator("BpmnEventTimer",function(Bt,nt,et){var ht=new go.Geometry,st=.5,pt=ee*.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+pt)*et,(st+pt)*nt,et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,0,st*et,(st-pt)*nt,et,0,(st+pt)*et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,st*nt,0,0,(st-pt)*et,(st-pt)*nt,0)),vt.add(new go.PathSegment(go.PathSegment.Bezier,nt,st*et,(st+pt)*nt,0,nt,(st-pt)*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 pt=new go.PathFigure(0,.15*et,!0);return ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,0,0)),pt.add(new go.PathSegment(go.PathSegment.Line,.6*nt,0)),pt.add(new go.PathSegment(go.PathSegment.Line,.65*nt,.15*et).close()),ht.spot1=new go.Spot(0,.1),ht.spot2=new go.Spot(1,1),ht}),go.Shape.defineFigureGenerator("Class",function(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 pt=new go.PathFigure(0,.2*et,!1);ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,nt,.2*et).close());var vt=new go.PathFigure(0,.5*et,!1);return ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,nt,.5*et).close()),ht}),go.Shape.defineFigureGenerator("Component",function(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 pt=new go.PathFigure(0,.2*et,!0);ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,.45*nt,.2*et)),pt.add(new go.PathSegment(go.PathSegment.Line,.45*nt,.4*et)),pt.add(new go.PathSegment(go.PathSegment.Line,0,.4*et)),pt.add(new go.PathSegment(go.PathSegment.Line,0,.2*et).close());var vt=new go.PathFigure(0,.6*et,!0);return ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,.45*nt,.6*et)),vt.add(new go.PathSegment(go.PathSegment.Line,.45*nt,.8*et)),vt.add(new go.PathSegment(go.PathSegment.Line,0,.8*et)),vt.add(new go.PathSegment(go.PathSegment.Line,0,.6*et).close()),ht}),go.Shape.defineFigureGenerator("Boat Shipment",function(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 pt=new go.PathFigure(.15*nt,.6*et,!1);return ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,.85*nt,.6*et)),ht}),go.Shape.defineFigureGenerator("Customer/Supplier",function(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 pt=new go.PathFigure(nt,.8*et,!0);ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,nt,.4*et)),pt.add(new go.PathSegment(go.PathSegment.Line,.6*nt,.4*et)),pt.add(new go.PathSegment(go.PathSegment.Line,.6*nt,.8*et)),pt.add(new go.PathSegment(go.PathSegment.Line,nt,.8*et).close());var vt=.1,St=ee*.1,Et=.2,At=.9,It=new go.PathFigure((Et-vt)*nt,At*et,!0);ht.add(It),It.add(new go.PathSegment(go.PathSegment.Bezier,Et*nt,(At-vt)*et,(Et-vt)*nt,(At-St)*et,(Et-St)*nt,(At-vt)*et)),It.add(new go.PathSegment(go.PathSegment.Bezier,(Et+vt)*nt,At*et,(Et+St)*nt,(At-vt)*et,(Et+vt)*nt,(At-St)*et)),It.add(new go.PathSegment(go.PathSegment.Bezier,Et*nt,(At+vt)*et,(Et+vt)*nt,(At+St)*et,(Et+St)*nt,(At+vt)*et)),It.add(new go.PathSegment(go.PathSegment.Bezier,(Et-vt)*nt,At*et,(Et-St)*nt,(At+vt)*et,(Et-vt)*nt,(At+St)*et).close()),vt=.1,St=ee*.1,Et=.8,At=.9;var qt=new go.PathFigure((Et-vt)*nt,At*et,!0);return ht.add(qt),qt.add(new go.PathSegment(go.PathSegment.Bezier,Et*nt,(At-vt)*et,(Et-vt)*nt,(At-St)*et,(Et-St)*nt,(At-vt)*et)),qt.add(new go.PathSegment(go.PathSegment.Bezier,(Et+vt)*nt,At*et,(Et+St)*nt,(At-vt)*et,(Et+vt)*nt,(At-St)*et)),qt.add(new go.PathSegment(go.PathSegment.Bezier,Et*nt,(At+vt)*et,(Et+vt)*nt,(At+St)*et,(Et+St)*nt,(At+vt)*et)),qt.add(new go.PathSegment(go.PathSegment.Bezier,(Et-vt)*nt,At*et,(Et-St)*nt,(At+vt)*et,(Et-vt)*nt,(At+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 pt=new go.PathFigure(0,.5*et,!0);ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,0,.8*et)),pt.add(new go.PathSegment(go.PathSegment.Line,.5*nt,.8*et)),pt.add(new go.PathSegment(go.PathSegment.Line,.5*nt,.5*et)),pt.add(new go.PathSegment(go.PathSegment.Line,0,.5*et));var vt=new go.PathFigure(.5*nt,.8*et,!0);ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,.5*nt,.1*et)),vt.add(new go.PathSegment(go.PathSegment.Line,.55*nt,.1*et)),vt.add(new go.PathSegment(go.PathSegment.Line,.55*nt,.8*et)),vt.add(new go.PathSegment(go.PathSegment.Line,.5*nt,.8*et));var 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,At=ee*.1,It=.1,qt=.9,Ut=new go.PathFigure((It-Et)*nt,qt*et,!0);ht.add(Ut),Ut.add(new go.PathSegment(go.PathSegment.Bezier,It*nt,(qt-Et)*et,(It-Et)*nt,(qt-At)*et,(It-At)*nt,(qt-Et)*et)),Ut.add(new go.PathSegment(go.PathSegment.Bezier,(It+Et)*nt,qt*et,(It+At)*nt,(qt-Et)*et,(It+Et)*nt,(qt-At)*et)),Ut.add(new go.PathSegment(go.PathSegment.Bezier,It*nt,(qt+Et)*et,(It+Et)*nt,(qt+At)*et,(It+At)*nt,(qt+Et)*et)),Ut.add(new go.PathSegment(go.PathSegment.Bezier,(It-Et)*nt,qt*et,(It-At)*nt,(qt+Et)*et,(It-Et)*nt,(qt+At)*et)),Et=.1,At=ee*.1,It=.4,qt=.9;var Gt=new go.PathFigure((It-Et)*nt,qt*et,!0);return ht.add(Gt),Gt.add(new go.PathSegment(go.PathSegment.Bezier,It*nt,(qt-Et)*et,(It-Et)*nt,(qt-At)*et,(It-At)*nt,(qt-Et)*et)),Gt.add(new go.PathSegment(go.PathSegment.Bezier,(It+Et)*nt,qt*et,(It+At)*nt,(qt-Et)*et,(It+Et)*nt,(qt-At)*et)),Gt.add(new go.PathSegment(go.PathSegment.Bezier,It*nt,(qt+Et)*et,(It+Et)*nt,(qt+At)*et,(It+At)*nt,(qt+Et)*et)),Gt.add(new go.PathSegment(go.PathSegment.Bezier,(It-Et)*nt,qt*et,(It-At)*nt,(qt+Et)*et,(It-Et)*nt,(qt+At)*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 pt=new go.PathFigure(.45*nt,.7*et,!1);ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,.55*nt,.7*et));var vt=new go.PathFigure(.55*nt,.4*et,!0);ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,.9*nt,.4*et)),vt.add(new go.PathSegment(go.PathSegment.Line,.9*nt,.9*et)),vt.add(new go.PathSegment(go.PathSegment.Line,.55*nt,.9*et)),vt.add(new go.PathSegment(go.PathSegment.Line,.55*nt,.4*et).close());var It=.05,qt=ee*.05,Ut=.175,Gt=.95,St=new go.PathFigure((Ut-It)*nt,Gt*et,!0);ht.add(St),St.add(new go.PathSegment(go.PathSegment.Bezier,Ut*nt,(Gt-It)*et,(Ut-It)*nt,(Gt-qt)*et,(Ut-qt)*nt,(Gt-It)*et)),St.add(new go.PathSegment(go.PathSegment.Bezier,(Ut+It)*nt,Gt*et,(Ut+qt)*nt,(Gt-It)*et,(Ut+It)*nt,(Gt-qt)*et)),St.add(new go.PathSegment(go.PathSegment.Bezier,Ut*nt,(Gt+It)*et,(Ut+It)*nt,(Gt+qt)*et,(Ut+qt)*nt,(Gt+It)*et)),St.add(new go.PathSegment(go.PathSegment.Bezier,(Ut-It)*nt,Gt*et,(Ut-qt)*nt,(Gt+It)*et,(Ut-It)*nt,(Gt+qt)*et));var It=.05,qt=ee*.05,Ut=.375,Gt=.95,Et=new go.PathFigure((Ut-It)*nt,Gt*et,!0);ht.add(Et),Et.add(new go.PathSegment(go.PathSegment.Bezier,Ut*nt,(Gt-It)*et,(Ut-It)*nt,(Gt-qt)*et,(Ut-qt)*nt,(Gt-It)*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,(Ut+It)*nt,Gt*et,(Ut+qt)*nt,(Gt-It)*et,(Ut+It)*nt,(Gt-qt)*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,Ut*nt,(Gt+It)*et,(Ut+It)*nt,(Gt+qt)*et,(Ut+qt)*nt,(Gt+It)*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,(Ut-It)*nt,Gt*et,(Ut-qt)*nt,(Gt+It)*et,(Ut-It)*nt,(Gt+qt)*et));var It=.05,qt=ee*.05,Ut=.625,Gt=.95,At=new go.PathFigure((Ut-It)*nt,Gt*et,!0);ht.add(At),At.add(new go.PathSegment(go.PathSegment.Bezier,Ut*nt,(Gt-It)*et,(Ut-It)*nt,(Gt-qt)*et,(Ut-qt)*nt,(Gt-It)*et)),At.add(new go.PathSegment(go.PathSegment.Bezier,(Ut+It)*nt,Gt*et,(Ut+qt)*nt,(Gt-It)*et,(Ut+It)*nt,(Gt-qt)*et)),At.add(new go.PathSegment(go.PathSegment.Bezier,Ut*nt,(Gt+It)*et,(Ut+It)*nt,(Gt+qt)*et,(Ut+qt)*nt,(Gt+It)*et)),At.add(new go.PathSegment(go.PathSegment.Bezier,(Ut-It)*nt,Gt*et,(Ut-qt)*nt,(Gt+It)*et,(Ut-It)*nt,(Gt+qt)*et));var It=.05,qt=ee*.05,Ut=.825,Gt=.95,ge=new go.PathFigure((Ut-It)*nt,Gt*et,!0);ht.add(ge),ge.add(new go.PathSegment(go.PathSegment.Bezier,Ut*nt,(Gt-It)*et,(Ut-It)*nt,(Gt-qt)*et,(Ut-qt)*nt,(Gt-It)*et)),ge.add(new go.PathSegment(go.PathSegment.Bezier,(Ut+It)*nt,Gt*et,(Ut+qt)*nt,(Gt-It)*et,(Ut+It)*nt,(Gt-qt)*et)),ge.add(new go.PathSegment(go.PathSegment.Bezier,Ut*nt,(Gt+It)*et,(Ut+It)*nt,(Gt+qt)*et,(Ut+qt)*nt,(Gt+It)*et)),ge.add(new go.PathSegment(go.PathSegment.Bezier,(Ut-It)*nt,Gt*et,(Ut-qt)*nt,(Gt+It)*et,(Ut-It)*nt,(Gt+qt)*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 pt=new go.PathFigure(0,.2*et,!1);ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,nt,.2*et).close());var vt=new go.PathFigure(.15*nt,et,!0);ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,.15*nt,.5*et)),vt.add(new go.PathSegment(go.PathSegment.Line,.4*nt,.5*et)),vt.add(new go.PathSegment(go.PathSegment.Line,.4*nt,et)),vt.add(new go.PathSegment(go.PathSegment.Line,.15*nt,et).close());var St=.05,Et=ee*.05,At=.35,It=.775,qt=new go.PathFigure((At-St)*nt,It*et,!0);return ht.add(qt),qt.add(new go.PathSegment(go.PathSegment.Bezier,At*nt,(It-St)*et,(At-St)*nt,(It-Et)*et,(At-Et)*nt,(It-St)*et)),qt.add(new go.PathSegment(go.PathSegment.Bezier,(At+St)*nt,It*et,(At+Et)*nt,(It-St)*et,(At+St)*nt,(It-Et)*et)),qt.add(new go.PathSegment(go.PathSegment.Bezier,At*nt,(It+St)*et,(At+St)*nt,(It+Et)*et,(At+Et)*nt,(It+St)*et)),qt.add(new go.PathSegment(go.PathSegment.Bezier,(At-St)*nt,It*et,(At-Et)*nt,(It+St)*et,(At-St)*nt,(It+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,pt=ee*.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-pt)*et,(vt-pt)*nt,(St-st)*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,(vt+st)*nt,St*et,(vt+pt)*nt,(St-st)*et,(vt+st)*nt,(St-pt)*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,(St+st)*et,(vt+st)*nt,(St+pt)*et,(vt+pt)*nt,(St+st)*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,(vt-st)*nt,St*et,(vt-pt)*nt,(St+st)*et,(vt-st)*nt,(St+pt)*et));var At=new go.PathFigure(0,.7*et,!1);return ht.add(At),At.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 pt=new go.PathFigure(0,.6*et,!1);return ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Move,0,.4*et)),pt.add(new go.PathSegment(go.PathSegment.Line,nt,.4*et)),ht}),go.Shape.defineFigureGenerator("Delete",function(Bt,nt,et){var ht=new go.Geometry,st=.5,pt=ee*.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-pt)*et,(vt-pt)*nt,(St-st)*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,(vt+st)*nt,St*et,(vt+pt)*nt,(St-st)*et,(vt+st)*nt,(St-pt)*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,(St+st)*et,(vt+st)*nt,(St+pt)*et,(vt+pt)*nt,(St+st)*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,(vt-st)*nt,St*et,(vt-pt)*nt,(St+st)*et,(vt-st)*nt,(St+pt)*et));var At=new go.PathFigure(.15*nt,.5*et,!1);return ht.add(At),At.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,pt=ee*.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-pt)*et,(vt-pt)*nt,(St-st)*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,(vt+st)*nt,St*et,(vt+pt)*nt,(St-st)*et,(vt+st)*nt,(St-pt)*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,(St+st)*et,(vt+st)*nt,(St+pt)*et,(vt+pt)*nt,(St+st)*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,(vt-st)*nt,St*et,(vt-pt)*nt,(St+st)*et,(vt-st)*nt,(St+pt)*et).close()),st=.05,pt=ee*.05,vt=.5,St=.8;var At=new go.PathFigure((vt-st)*nt,St*et,!1);return ht.add(At),At.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,(St-st)*et,(vt-st)*nt,(St-pt)*et,(vt-pt)*nt,(St-st)*et)),At.add(new go.PathSegment(go.PathSegment.Bezier,(vt+st)*nt,St*et,(vt+pt)*nt,(St-st)*et,(vt+st)*nt,(St-pt)*et)),At.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,(St+st)*et,(vt+st)*nt,(St+pt)*et,(vt+pt)*nt,(St+st)*et)),At.add(new go.PathSegment(go.PathSegment.Bezier,(vt-st)*nt,St*et,(vt-pt)*nt,(St+st)*et,(vt-st)*nt,(St+pt)*et).close()),At.add(new go.PathSegment(go.PathSegment.Move,.5*nt,.7*et)),At.add(new go.PathSegment(go.PathSegment.Line,.5*nt,.5*et)),At.add(new go.PathSegment(go.PathSegment.Bezier,.5*nt,.2*et,.75*nt,.475*et,.75*nt,.225*et)),At.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 pt=new go.PathFigure(.2*nt,.5*et,!1);return ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Move,.2*nt,.5*et)),pt.add(new go.PathSegment(go.PathSegment.Line,.2*nt,.3*et)),pt.add(new go.PathSegment(go.PathSegment.Bezier,.8*nt,.3*et,.25*nt,0,.75*nt,0)),pt.add(new go.PathSegment(go.PathSegment.Line,.8*nt,.5*et)),pt.add(new go.PathSegment(go.PathSegment.Line,.8*nt,.3*et)),ht}),go.Shape.defineFigureGenerator("Unlocked",function(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 pt=new go.PathFigure(.2*nt,.5*et,!1);return ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Move,.2*nt,.5*et)),pt.add(new go.PathSegment(go.PathSegment.Line,.2*nt,.3*et)),pt.add(new go.PathSegment(go.PathSegment.Bezier,.8*nt,.3*et,.25*nt,0,.75*nt,0)),pt.add(new go.PathSegment(go.PathSegment.Line,.8*nt,.35*et)),ht}),go.Shape.defineFigureGenerator("Gear",function(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 pt=new go.PathFigure(0,et*.6,!0);return ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,nt,.6*et)),pt.add(new go.PathSegment(go.PathSegment.Line,.5*nt,0).close()),ht}),go.Shape.defineFigureGenerator("Pencil",function(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 pt=new go.PathFigure(.126*nt,.85*et,!1);ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,.126*nt,.45*et)),pt.add(new go.PathSegment(go.PathSegment.Line,.322*nt,.45*et)),pt.add(new go.PathSegment(go.PathSegment.Line,.322*nt,.85*et).close());var vt=new go.PathFigure(.402*nt,.85*et,!1);ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,.402*nt,.45*et)),vt.add(new go.PathSegment(go.PathSegment.Line,.598*nt,.45*et)),vt.add(new go.PathSegment(go.PathSegment.Line,.598*nt,.85*et).close());var 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 pt=new go.PathFigure(nt*.204,et,!0);ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,nt*.204,et*(1-.184))),pt.add(new go.PathSegment(go.PathSegment.Line,nt*.388,et*(1-.184*2))),pt.add(new go.PathSegment(go.PathSegment.Line,nt*.388,et*1).close());var vt=new go.PathFigure(nt*.408,et,!0);ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,nt*.408,et*(1-.184*2))),vt.add(new go.PathSegment(go.PathSegment.Line,nt*.592,et*(1-.184*3))),vt.add(new go.PathSegment(go.PathSegment.Line,nt*.592,et*1).close());var 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 pt=new go.PathFigure(nt*.055,.07*et,!0);ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,nt*.245,et*.07)),pt.add(new go.PathSegment(go.PathSegment.Line,nt*.245,et*.1)),pt.add(new go.PathSegment(go.PathSegment.Line,nt*.055,et*.1).close());var vt=new go.PathFigure(nt*.055,.13*et,!0);ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,nt*.245,et*.13)),vt.add(new go.PathSegment(go.PathSegment.Line,nt*.245,et*.16)),vt.add(new go.PathSegment(go.PathSegment.Line,nt*.055,et*.16).close());var 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 pt=new go.PathFigure(0,0,!1);ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,nt*1,et*0)),pt.add(new go.PathSegment(go.PathSegment.Arc,270,-180,nt*1,nt*.3,nt*.055)),pt.add(new go.PathSegment(go.PathSegment.Line,nt*1,et*1));var vt=new go.PathFigure(nt*.11,et*.1,!1);ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,nt*(.11+.24133333*1+.028*0),et*.1)),vt.add(new go.PathSegment(go.PathSegment.Line,nt*(.11+.24133333*1+.028*0),et*.8)),vt.add(new go.PathSegment(go.PathSegment.Line,nt*.11,et*.8).close());var 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,pt=st*ee,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-pt,nt-pt,et)),vt.add(new go.PathSegment(go.PathSegment.Line,st,et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,0,et-st,pt,et,0,et-pt)),vt.add(new go.PathSegment(go.PathSegment.Line,0,st)),vt.add(new go.PathSegment(go.PathSegment.Bezier,st,0,0,pt,pt,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 At=new go.PathFigure(nt*.78,et*.05,!1);return ht.add(At),At.add(new go.PathSegment(go.PathSegment.Line,nt*.66,et*.05)),At.add(new go.PathSegment(go.PathSegment.Line,nt*.66,et*.25)),At.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*ee,pt=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,pt-ht)),St.add(new go.PathSegment(go.PathSegment.Bezier,nt-ht,pt,nt,pt-st,nt-st,pt)),St.add(new go.PathSegment(go.PathSegment.Line,nt*.7,pt)),St.add(new go.PathSegment(go.PathSegment.Line,nt*.7,et)),St.add(new go.PathSegment(go.PathSegment.Line,nt*.55,pt)),St.add(new go.PathSegment(go.PathSegment.Line,ht,pt)),St.add(new go.PathSegment(go.PathSegment.Bezier,0,pt-ht,st,pt,0,pt-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 pt=new go.PathFigure(nt*1,et*.55,!0);return ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,nt*.75,et*1)),pt.add(new go.PathSegment(go.PathSegment.Line,nt*.5,et*.55)),pt.add(new go.PathSegment(go.PathSegment.Line,nt*.7,et*.55)),pt.add(new go.PathSegment(go.PathSegment.Line,nt*.7,et*.1)),pt.add(new go.PathSegment(go.PathSegment.Line,nt*.4,et*.1)),pt.add(new go.PathSegment(go.PathSegment.Line,nt*.35,et*0)),pt.add(new go.PathSegment(go.PathSegment.Line,nt*.8,et*0)),pt.add(new go.PathSegment(go.PathSegment.Line,nt*.8,et*.55).close()),ht}),go.Shape.defineFigureGenerator("Windows",function(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 pt=new go.PathFigure(nt*.1,et*.2,!0);ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,nt*.1,et*.25)),pt.add(new go.PathSegment(go.PathSegment.Line,nt*.22,et*.285)),pt.add(new go.PathSegment(go.PathSegment.Line,nt*.1,et*.32)),pt.add(new go.PathSegment(go.PathSegment.Line,nt*.1,et*.37)),pt.add(new go.PathSegment(go.PathSegment.Line,nt*.275,et*.32)),pt.add(new go.PathSegment(go.PathSegment.Line,nt*.275,et*.25).close());var vt=new go.PathFigure(nt*.28,et*.37,!0);return ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,nt*.45,et*.37)),vt.add(new go.PathSegment(go.PathSegment.Line,nt*.45,et*.41)),vt.add(new go.PathSegment(go.PathSegment.Line,nt*.28,et*.41).close()),ht}),go.Shape.defineFigureGenerator("Beaker",function(Bt,nt,et){var ht=new go.Geometry,st=15,pt=st*ee,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-pt,nt-pt,et)),vt.add(new go.PathSegment(go.PathSegment.Line,st,et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,0,et-st,pt,et,0,et-pt)),vt.add(new go.PathSegment(go.PathSegment.Line,nt*.38,et*.475)),vt.add(new go.PathSegment(go.PathSegment.Line,nt*.38,et*.03)),vt.add(new go.PathSegment(go.PathSegment.Line,nt*.36,et*0)),vt.add(new go.PathSegment(go.PathSegment.Line,nt*.64,et*0)),vt.add(new go.PathSegment(go.PathSegment.Line,nt*.62,et*.03).close()),pt>1?(ht.spot1=new go.Spot(0,0,pt,pt),ht.spot2=new go.Spot(1,1,-pt,-pt)):(ht.spot1=go.Spot.TopLeft,ht.spot2=go.Spot.BottomRight),ht}),go.Shape.defineFigureGenerator("Download",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(nt*0,et*1,!0);ht.add(st);var pt=.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-pt))),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-pt))),st.add(new go.PathSegment(go.PathSegment.Line,nt*.64,et*(1-pt))),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-pt))),st.add(new go.PathSegment(go.PathSegment.Line,nt*.07,et*(1-pt))),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-pt)).close());var vt=new go.PathFigure(nt*.4,et*0,!0);return ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,nt*.4,et*.44)),vt.add(new go.PathSegment(go.PathSegment.Line,nt*.26,et*.44)),vt.add(new go.PathSegment(go.PathSegment.Line,nt*.5,et*.66)),vt.add(new go.PathSegment(go.PathSegment.Line,nt*(1-.26),et*.44)),vt.add(new go.PathSegment(go.PathSegment.Line,nt*.6,et*.44)),vt.add(new go.PathSegment(go.PathSegment.Line,nt*.6,et*0).close()),ht}),go.Shape.defineFigureGenerator("Bin",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(nt*0,et*1,!0);ht.add(st);var pt=.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-pt))),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-pt))),st.add(new go.PathSegment(go.PathSegment.Line,nt*.64,et*(1-pt))),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-pt))),st.add(new go.PathSegment(go.PathSegment.Line,nt*.07,et*(1-pt))),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-pt)).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 pt=.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-pt))),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-pt))),st.add(new go.PathSegment(go.PathSegment.Line,nt*.64,et*(1-pt))),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-pt))),st.add(new go.PathSegment(go.PathSegment.Line,nt*.07,et*(1-pt))),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-pt)).close());var vt=new go.PathFigure(nt*.5,et*0,!0);return ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,nt*.26,et*.25)),vt.add(new go.PathSegment(go.PathSegment.Line,nt*.4,et*.25)),vt.add(new go.PathSegment(go.PathSegment.Line,nt*.4,et*.63)),vt.add(new go.PathSegment(go.PathSegment.Line,nt*.6,et*.63)),vt.add(new go.PathSegment(go.PathSegment.Line,nt*.6,et*.25)),vt.add(new go.PathSegment(go.PathSegment.Line,nt*.74,et*.25).close()),ht}),go.Shape.defineFigureGenerator("EmptyDrink",function(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 pt=new go.PathFigure(nt*.235,et*.28,!0);return ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,nt*.765,et*.28)),pt.add(new go.PathSegment(go.PathSegment.Line,nt*.655,et*.97)),pt.add(new go.PathSegment(go.PathSegment.Line,nt*.345,et*.97).close()),ht}),go.Shape.defineFigureGenerator("4Arrows",function(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 Mn={},Rn="5.0",kt={},ft=null,Kt=!1,le=!1,we=null,ue=!1,Dt=null,ee=null,pe=0;pe<arguments.length;pe++){var Jt=arguments[pe];if(Jt!==null)switch(typeof Jt){case"number":Rn=Jt.toFixed(1);break;case"string":Jt.match(new RegExp("^[0-9]\\.[0-9]+$"))?Rn=Jt:we=Jt;break;case"object":typeof Jt.is3D!="undefined"?ft=Jt:kt=Jt;break;case"boolean":Kt=Jt,le=!0;break}}ft===null&&(ft={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&&!le&&(Kt=!0)),we!==null&&kt.id===void 0&&(kt.id=we);var jt="",De="",ae=!1,Le=null,Bt=null,nt=null,et=!1,ht=null,st=null,pt=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(Ie){return parseFloat(Ie)>4?parseFloat(Ie):5};Mn.setHTML5Codebase=function(Ie,on){ee=Ie,Qe(Ie,on)},Mn.setJavaCodebase=Mn.setJavaCodebaseVersion=Mn.isCompiledInstalled=Mn.setPreCompiledScriptPath=Mn.setPreCompiledResourcePath=function(){},Mn.setHTML5CodebaseVersion=function(Ie,on){var cn=parseFloat(Ie);if(cn!==NaN&&cn<5){console.log("The GeoGebra HTML5 codebase version "+cn+" is deprecated. Using version latest instead.");return}Dt=Ie,Xt(Ie,on)},Mn.getHTML5CodebaseVersion=function(){return Bt},Mn.getParameters=function(){return kt},Mn.setFontsCSSURL=function(Ie){vt=Ie},Mn.setGiacJSURL=function(Ie){},Mn.setJNLPFile=function(Ie){jt=Ie},Mn.setJNLPBaseDir=function(Ie){},Mn.inject=function(){function Ie(){return window.frameElement&&window.frameElement.getAttribute("data-singleton")}for(var on="auto",cn=kt.id,Vn,Me=!1,he=0;he<arguments.length;he++){var Ce=arguments[he];typeof Ce=="string"?(Ce=Ce.toLowerCase(),Ce.match(/^(prefer)?(java|html5|compiled|auto|screenshot)$/)?on=Ce:cn=arguments[he]):typeof Ce=="boolean"?Me=Ce:Ce instanceof HTMLElement&&(Vn=Ce)}Yn();function Yn(){if(!ue){setTimeout(Yn,200);return}on=pn(on);var Si=Vn||document.getElementById(cn);if(!Si){console.log("possibly bug on ajax loading? ");return}if(Mn.removeExistingApplet(Si,!1),kt.width===void 0&&Si.clientWidth&&(kt.width=Si.clientWidth),kt.height===void 0&&Si.clientHeight&&(kt.height=Si.clientHeight),!(kt.width&&kt.height)&&on==="html5"&&(delete kt.width,delete kt.height),Le=on,on==="screenshot")ve(Si,kt);else{var Rt=!1;kt.hasOwnProperty("playButton")&&kt.playButton||kt.hasOwnProperty("clickToLoad")&&kt.clickToLoad?Rt=!0:kt.hasOwnProperty("playButtonAutoDecide")&&kt.playButtonAutoDecide&&(Rt=(!At()||Ie())&&It()),Rt?(Le="screenshot",Ye(Si,kt,Me,on)):Te(Si,kt,Me)}}};function At(){try{return window.self!==window.top}catch(Ie){return!0}}function It(){return kt.hasOwnProperty("screenshotGenerator")&&kt.screenshotGenerator?!1:Math.max(screen.width,screen.height)<800}Mn.getViews=function(){return ft},Mn.isJavaInstalled=function(){return!1};var qt=function(Ie){var on=function(he){var Ce=JSON.parse(he),Yn=function(Ft){return Ft.type=="G"||Ft.type=="E"},Si=Ce.elements?Ce.elements.filter(Yn)[0]:Ce;if(!Si||!Si.url){cn();return}kt.fileName=Si.url,Ut(Si.settings||{}),ft.is3D=!0;var Rt="https://www.geogebra.org/images/";Mn.setPreviewImage(ht||Si.previewUrl,Rt+"GeoGebra_loading.png",Rt+"applet_play.png"),Ie()},cn=function(){kt.onError&&kt.onError(),On("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",Me="/materials/"+kt.material_id+"?scope=basic";Gt("https://"+Vn+"/api/proxy.php?path="+encodeURIComponent(Me),on,cn)};function Ut(Ie){var on=["width","height","showToolBar","showMenuBar","showAlgebraInput","allowStyleBar","showResetIcon","enableLabelDrags","enableShiftDragZoom","enableRightClick","appName"];["enableLabelDrags","enableShiftDragZoom","enableRightClick"].forEach(function(cn){Ie[cn]=!!Ie[cn]}),on.forEach(function(cn){kt[cn]===void 0&&Ie[cn]!==void 0&&(kt[cn]=Ie[cn])}),kt.showToolBarHelp===void 0&&(kt.showToolBarHelp=kt.showToolBar)}function Gt(Ie,on,cn){var Vn=new XMLHttpRequest;Vn.open("GET",Ie),Vn.onload=function(){on(Vn.responseText)},Vn.onerror=cn,Vn.send()}Mn.isHTML5Installed=function(){return!0},Mn.getLoadedAppletType=function(){return Le},Mn.setPreviewImage=function(Ie,on,cn){ht=Ie,st=on,pt=cn},Mn.removeExistingApplet=function(Ie,on){var cn;typeof Ie=="string"&&(Ie=document.getElementById(Ie)),Le=null;var Vn=null;for(cn=0;cn<Ie.childNodes.length;cn++){var Me=Ie.childNodes[cn],he=Me.className;he==="applet_screenshot"?on?(Me.style.display="block",Le="screenshot"):Me.style.display="none":he!=="applet_scaler prerender"&&(Ie.removeChild(Me),Vn=he&&he.indexOf("appletParameters")!=-1?Me.id:null,cn--)}var Ce=kt.id!==void 0?kt.id:Vn,Yn=window[Ce];Yn&&typeof Yn.getBase64=="function"&&(Yn.remove(),window[Ce]=null)},Mn.refreshHitPoints=function(){if(Et(ggbHTML5LoadedCodebaseVersion)>=5)return!0;var Ie=Mn.getAppletObject();return Ie&&typeof Ie.recalculateEnvironments=="function"?(Ie.recalculateEnvironments(),!0):!1},Mn.startAnimation=function(){var Ie=Mn.getAppletObject();return Ie&&typeof Ie.startAnimation=="function"?(Ie.startAnimation(),!0):!1},Mn.stopAnimation=function(){var Ie=Mn.getAppletObject();return Ie&&typeof Ie.stopAnimation=="function"?(Ie.stopAnimation(),!0):!1},Mn.getAppletObject=function(){var Ie=kt.id!==void 0?kt.id:"ggbApplet";return window[Ie]},Mn.resize=function(){};var ge=function(Ie,on,cn){var Vn=document.createElement("param");Vn.setAttribute("name",on),Vn.setAttribute("value",cn),Ie.appendChild(Vn)},ie=function(Ie){return Ie&&Ie!=="false"},Te=function(Ie,on,cn){Et(Bt)<=4.2&&(cn=!0);var Vn=!isRenderGGBElementEnabled&&!scriptLoadStarted;(!isRenderGGBElementEnabled&&!scriptLoadStarted||ggbHTML5LoadedCodebaseVersion!==Bt||ggbHTML5LoadedCodebaseIsWebSimple&&!et)&&(Vn=!0,isRenderGGBElementEnabled=!1,scriptLoadStarted=!1);var Me=document.createElement("div");Me.classList.add("appletParameters","notranslate");var he=on.width,Ce=on.height;if(on.disableAutoScale=on.disableAutoScale===void 0?GGBAppletUtils.isFlexibleWorksheetEditor():on.disableAutoScale,on.width!==void 0)if(Et(Bt)<=4.4)ie(on.showToolBar)&&(on.height-=7),ie(on.showAlgebraInput)&&(on.height-=37),on.width<605&&ie(on.showToolBar)&&(on.width=605,he=605);else{var Yn=100;(ie(on.showToolBar)||ie(on.showMenuBar))&&(on.hasOwnProperty("customToolBar")&&(on.customToolbar=on.customToolBar),Yn=ie(on.showMenuBar)?245:155),he<Yn&&(on.width=Yn,he=Yn)}Me.style.border="none",Me.style.display="inline-block";for(var Si in on)on.hasOwnProperty(Si)&&Si!=="appletOnLoad"&&Me.setAttribute("data-param-"+Si,on[Si]);vt&&Me.setAttribute("data-param-fontscssurl",vt),Mn.resize=function(){GGBAppletUtils.responsiveResize(Ie,on)},window.addEventListener("resize",function(ke){Mn.resize()});var Rt=typeof on.appletOnLoad=="function"?on.appletOnLoad:function(){};if(!cn&&on.width!==void 0){on.hasOwnProperty("showSplash")||Me.setAttribute("data-param-showSplash","false");var Ft=Ie.querySelector(".applet_scaler.prerender"),Pt=Ft!==null;if(Pt)var Nt=Ft.querySelector(".ggb_preview");else{var Nt=qe(he,Ce,on.borderColor,!1);Ft=document.createElement("div"),Ft.className="applet_scaler",Ft.style.position="relative",Ft.style.display="block",Ft.style.width=he+"px",Ft.style.height=Ce+"px"}window.GGBT_spinner&&window.GGBT_spinner.attachSpinner(Ft,"66%"),Et(Bt)>=5?(on.appletOnLoad=function(ke){var Ve=Ie.querySelector(".ggb_preview");Ve&&Ve.parentNode.removeChild(Ve),window.GGBT_spinner&&window.GGBT_spinner.removeSpinner(Ft),window.GGBT_wsf_view&&$(window).trigger("resize"),Rt(ke)},Pt||Ft.appendChild(Nt)):Me.appendChild(Nt),Ft.appendChild(Me),Pt||Ie.appendChild(Ft),setTimeout(function(){Mn.resize()},1)}else{var zt=document.createElement("div");zt.className="applet_scaler",zt.style.position="relative",zt.style.display="block",zt.appendChild(Me),Ie.appendChild(zt),on.appletOnLoad=function(ke){Mn.resize(),Rt(ke)}}function Mt(ke,Ve){Ve&&typeof Ve.appletOnLoad=="function"&&typeof renderGGBElement=="function"?renderGGBElement(ke,Ve.appletOnLoad):renderGGBElement(ke),On("GeoGebra HTML5 applet injected and rendered with previously loaded codebase.",Ve)}function Yt(ke,Ve){typeof renderGGBElement=="undefined"?(html5AppletsToProcess===null&&(html5AppletsToProcess=[]),html5AppletsToProcess.push({article:ke,params:Ve}),window.renderGGBElementReady=function(){isRenderGGBElementEnabled=!0,html5AppletsToProcess!==null&&html5AppletsToProcess.length&&(html5AppletsToProcess.forEach(function(tn){Mt(tn.article,tn.params)}),html5AppletsToProcess=null)},Et(Bt)<5&&(ke.className+=" geogebraweb")):Mt(ke,Ve)}if(Vn){scriptLoadStarted=!0;for(var He=0;He<Me.childNodes.length;He++){var _e=Me.childNodes[He].tagName;_e==="TABLE"&&(Me.removeChild(Me.childNodes[He]),He--)}if(ggbHTML5LoadedScript!==null){var Xe=document.querySelector('script[src="'+ggbHTML5LoadedScript+'"]');Xe!=null&&Xe.parentNode.removeChild(Xe)}var xe=document.createElement("script"),Pe=function(){Yt(Me,on)};xe.src=De+nt,ggbHTML5LoadedCodebaseIsWebSimple=et,ggbHTML5LoadedCodebaseVersion=Bt,ggbHTML5LoadedScript=xe.src,On("GeoGebra HTML5 codebase loaded: '"+De+"'.",on),!ee&&(!Dt||Dt=="5.0")?(et?webSimple.succeeded=webSimple.succeeded||webSimple():web3d.succeeded=web3d.succeeded||web3d(),Pe()):De.requirejs?__webpack_require__.e(7963).then(function(){var ke=[__webpack_require__(87963)];Pe.apply(null,ke)}.bind(this)).catch(__webpack_require__.oe):(xe.onload=Pe,Ie.appendChild(xe))}else Yt(Me,on);on.height=Ce,on.width=he},ve=function(Ie,on,cn){var Vn=qe(on.width,on.height,on.borderColor,cn),Me=document.createElement("div");Me.style.position="relative",Me.style.display="block",Me.style.width=on.width+"px",Me.style.height=on.height+"px",Me.className="applet_screenshot applet_scaler"+(cn?" applet_screenshot_play":""),Me.appendChild(Vn);var he=GGBAppletUtils.getScale(on,Ie,cn);cn?(Ie.appendChild(Ze()),window.GGBT_wsf_view||(Ie.style.position="relative")):window.GGBT_spinner&&window.GGBT_spinner.attachSpinner(Me,"66%"),Ie.appendChild(Me),he!==1&&!isNaN(he)&&(GGBAppletUtils.scaleElement(Me,he),Me.style.width=on.width+"px",Me.style.height=on.height+"px",Me.parentNode.style.width=on.width*he+"px",Me.parentNode.style.height=on.height*he+"px"),Mn.resize=function(){ye(Ie,Vn,Me,cn)},window.addEventListener("resize",function(Ce){Mn.resize()}),Mn.resize()};function ye(Ie,on,cn,Vn){if(Ie.contains(on)){if(typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()){if(Ie.id!=="fullscreencontent")return;window.GGBT_wsf_view.setCloseBtnPosition(Ie)}var Me=GGBAppletUtils.getScale(kt,Ie,Vn);cn.parentNode!==null&&(!isNaN(Me)&&Me!==1?(GGBAppletUtils.scaleElement(cn,Me),cn.parentNode.style.width=kt.width*Me+"px",cn.parentNode.style.height=kt.height*Me+"px"):(GGBAppletUtils.scaleElement(cn,1),cn.parentNode.style.width=kt.width+"px",cn.parentNode.style.height=kt.height+"px")),typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()&&GGBAppletUtils.positionCenter(Ie),typeof window.GGBT_ws_header_footer=="object"&&window.GGBT_ws_header_footer.setWsScrollerHeight()}}Mn.onExitFullscreen=function(Ie,on){on.appendChild(Ie)};var Ye=function(Ie,on,cn,Vn){ve(Ie,on,!0);for(var Me=function(){var Yn=[];for(Ce=0;Ce<Ie.childNodes.length;Ce++)Yn.push(Ie.childNodes[Ce]);if(window.GGBT_wsf_view){var Si=window.GGBT_wsf_view.renderFullScreen(Ie,on.id),Rt=document.getElementById("fullscreencontainer"),Ft=jQuery(Ie).find(".fullscreencontent");Ft.length>0?(Si.remove(),Ft.attr("id","fullscreencontent").show(),jQuery(Rt).append(Ft),window.dispatchEvent(new Event("resize"))):Te(Si,on,!1),window.GGBT_wsf_view.launchFullScreen(Rt)}else Le=Vn,Te(Ie,on,!1);if(!window.GGBT_wsf_view)for(Ce=0;Ce<Yn.length;Ce++)Ie.removeChild(Yn[Ce])},he=Ie.getElementsByClassName("ggb_preview_play"),Ce=0;Ce<he.length;Ce++)he[Ce].addEventListener("click",Me,!1),he[Ce].addEventListener("ontouchstart",Me,!1);typeof window.ggbAppletPlayerOnload=="function"&&window.ggbAppletPlayerOnload(Ie),It()&&window.GGBT_wsf_view&&$(".wsf-element-fullscreen-button").remove()},Ze=function(){var Ie=document.createElement("div");if(Ie.className="ggb_preview_play icon-applet-play",!window.GGBT_wsf_view){var on='.icon-applet-play { width: 100%; height: 100%;box-sizing: border-box;position: absolute;z-index: 1001;cursor: pointer;border-width: 0px; background-color: transparent;background-repeat: no-repeat;left: 0;top: 0;background-position: center center; background-image: url("https://www.geogebra.org/images/worksheet/icon-start-applet.png");}.icon-applet-play:hover {background-image: url("https://www.geogebra.org/images/worksheet/icon-start-applet-hover.png");}',cn=document.createElement("style");cn.styleSheet?cn.styleSheet.cssText=on:cn.appendChild(document.createTextNode(on)),document.getElementsByTagName("head")[0].appendChild(cn)}return Ie},qe=function(Ie,on,cn,Vn){var Me=document.createElement("div");Me.className="ggb_preview",Me.style.position="absolute",Me.style.zIndex="90",Me.style.width=Ie-2+"px",Me.style.height=on-2+"px",Me.style.top="0px",Me.style.left="0px",Me.style.overflow="hidden",Me.style.backgroundColor="white";var he="lightgrey";cn!==void 0&&(cn==="none"?he="transparent":he=cn),Me.style.border="1px solid "+he;var Ce=document.createElement("img");if(Ce.style.position="relative",Ce.style.zIndex="1000",Ce.style.top="-1px",Ce.style.left="-1px",ht!==null&&Ce.setAttribute("src",ht),Ce.style.opacity=.7,st!==null){var Yn,Si,Rt;if(!Vn){Yn=document.createElement("img"),Yn.style.position="absolute",Yn.style.zIndex="1001",Yn.style.opacity=1,Ce.style.opacity=.3,Si=360,Si>Ie/4*3&&(Si=Ie/4*3),Rt=Si/5.8,Yn.setAttribute("src",st),Yn.setAttribute("width",Si),Yn.setAttribute("height",Rt);var Ft=(Ie-Si)/2,Pt=(on-Rt)/2;Yn.style.left=Ft+"px",Yn.style.top=Pt+"px",Me.appendChild(Yn)}}return Me.appendChild(Ce),Me},pn=function(Ie){return Ie=Ie.toLowerCase(),Ie==="html5"||Ie==="screenshot"?Ie:"html5"},te=["web","webSimple","web3d","tablet","tablet3d","phone"],Xt=function(Ie,on){if(Bt=Ie,on){Qe(Bt,!0);return}var cn=!Kt;if(cn){var Vn=Et(Bt);!isNaN(Vn)&&Vn<4.4&&(cn=!1)}var Me,he;window.location.protocol.substr(0,4)==="http"?Me=window.location.protocol:Me="http:";var Ce=Bt.indexOf("//");Ce>0?he=Bt:Ce===0?he=Me+Bt:he="https://www.geogebra.org/apps/5.2.814.0/";for(var Yn in te)if(Bt.slice(te[Yn].length*-1)===te[Yn]||Bt.slice((te[Yn].length+1)*-1)===te[Yn]+"/"){Qe(he,!1);return}!GGBAppletUtils.isFlexibleWorksheetEditor()&&cn&&!ft.is3D&&!ft.AV&&!ft.SV&&!ft.CV&&!ft.EV2&&!ft.CP&&!ft.PC&&!ft.DA&&!ft.FI&&!ft.PV&&!ie(kt.showToolBar)&&!ie(kt.showMenuBar)&&!ie(kt.showAlgebraInput)&&!ie(kt.enableRightClick)&&(!kt.appName||kt.appName=="classic")?he+="webSimple/":he+="web3d/",Qe(he,!1)},Qe=function(Ie,on){if(Ie.requirejs){De=Ie;return}Ie.slice(-1)!=="/"&&(Ie+="/"),De=Ie,on===null&&(on=Ie.indexOf("http")===-1),ae=on,nt="web.nocache.js",et=!1;var cn=De.split("/");cn.length>1&&(!on&&cn[cn.length-2]==="webSimple"?(nt="webSimple.nocache.js",et=!0):te.indexOf(cn[cn.length-2])>=0&&(nt=cn[cn.length-2]+".nocache.js")),cn=Ie.split("/"),Bt=cn[cn.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&&Ie.indexOf("geogebra.org")>=0&&(console.log("The GeoGebra HTML5 codebase version "+Vn+" is deprecated. Using version latest instead."),Xt("5.0",on))},On=function(Ie,on){window.console&&window.console.log&&(!on||typeof on.showLogging=="undefined"||on.showLogging&&on.showLogging!=="false")&&console.log(Ie)};kt.material_id!==void 0?qt(En):En();function En(){var Ie=Rn;Dt!==null?Ie=Dt:parseFloat(Ie)<5&&(Ie="5.0"),Xt(Ie,!1),ee!==null&&Qe(ee,ae),ue=!0}return Mn},GGBAppletUtils=function(){"use strict";function Mn(){return window.GGBT_wsf_edit!==void 0}function Rn(ue,Dt){Dt!=1?(ue.style.transformOrigin="0% 0% 0px",ue.style.webkitTransformOrigin="0% 0% 0px",ue.style.transform="scale("+Dt+","+Dt+")",ue.style.webkitTransform="scale("+Dt+","+Dt+")",ue.style.maxWidth="initial",ue.querySelector(".ggb_preview")!==null&&(ue.querySelector(".ggb_preview").style.maxWidth="initial"),ue.querySelectorAll(".ggb_preview img")[0]!==void 0&&(ue.querySelectorAll(".ggb_preview img")[0].style.maxWidth="initial"),ue.querySelectorAll(".ggb_preview img")[1]!==void 0&&(ue.querySelectorAll(".ggb_preview img")[1].style.maxWidth="initial")):(ue.style.transform="none",ue.style.webkitTransform="none")}function kt(ue,Dt,ee,pe,Jt,jt){var De=null;if(jt!=null&&jt!="")for(var ae=ue.parentNode;ae!=null;)if((" "+ae.className+" ").indexOf(" "+jt+" ")>-1){De=ae;break}else ae=ae.parentNode;var Le=0,Bt=0,nt=0,et=0,ht=0,st=0,pt=0;if(De)Le=De.offsetWidth,Bt=Math.max(pe?De.offsetWidth:0,De.offsetHeight);else{if(window.innerWidth&&document.documentElement.clientWidth?(Le=Math.min(window.innerWidth,document.documentElement.clientWidth),Bt=Math.min(window.innerHeight,document.documentElement.clientHeight),nt=Le):(Le=window.innerWidth,Bt=window.innerHeight,nt=window.innerWidth),ue){var vt=ue.getBoundingClientRect();vt.left>0&&vt.left<=Le&&(Jt===void 0||!Jt)&&(document.dir==="rtl"?(ht=Le-vt.width-vt.left,st=nt<=480?10:30):(st=vt.left,ht=nt<=480?10:30),et=st+ht)}if(ue&&typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()){var St=ue.getBoundingClientRect();window.GGBT_wsf_view.getCloseBtnPosition()==="closePositionRight"?(et=40,pt=0):window.GGBT_wsf_view.getCloseBtnPosition()==="closePositionTop"&&(et=0,pt=40)}}return ue&&((ee===void 0||!ee)&&Dt>0&&Dt+et<Le?Le=Dt:Le-=et,typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()&&(ee===void 0||!ee)&&(Bt-=pt)),{width:Le,height:Bt}}function ft(ue,Dt,ee,pe,Jt){if(ue.isScreenshoGenerator)return 1;var jt=pe!==void 0&&pe,De=ue.noScaleMargin!=null&&ue.noScaleMargin,ae=function(St){return St&&St!=="false"},Le=ae(ue.autoHeight),Bt=kt(Dt,ue.width,ee,Le,jt&&window.GGBT_wsf_view||De,Jt),nt=parseInt(Bt.width),et=ue.width,ht=ue.height;if(et===void 0){var st=Dt.querySelector(".appletParameters");st&&(et=st.offsetWidth,ht=st.offsetHeight)}var pt=nt/et,vt=jt?1:Bt.height/ht;return ee!==void 0&&!ee&&(pt=Math.min(1,pt),vt=Math.min(1,vt)),Math.min(pt,vt)}function Kt(ue,Dt,ee){var pe=1,Jt,jt=!1;if(ue.hasOwnProperty("allowUpscale")&&(jt=ue.allowUpscale),ue.hasOwnProperty("scale")&&(pe=parseFloat(ue.scale),(isNaN(pe)||pe===null||pe===0)&&(pe=1),pe>1&&(jt=!0)),Dt&&typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()&&(jt=!0),!(ue.hasOwnProperty("disableAutoScale")&&ue.disableAutoScale))Jt=ft(ue,Dt,jt,ee,ue.scaleContainerClass);else return pe;return jt&&(!ue.hasOwnProperty("scale")||pe===1)?Jt:Math.min(pe,Jt)}function le(ue){var Dt=Math.min(window.innerWidth,document.documentElement.clientWidth),ee=Math.min(window.innerHeight,document.documentElement.clientHeight),pe=ue.getBoundingClientRect(),Jt=(Dt-pe.width)/2,jt=(ee-pe.height)/2;jt<0&&(jt=0),ue.style.position="relative",window.GGBT_wsf_view.getCloseBtnPosition()==="closePositionRight"?(Jt<40?ue.style.left="40px":ue.style.left=Jt+"px",ue.style.top=jt+"px"):window.GGBT_wsf_view.getCloseBtnPosition()==="closePositionTop"&&(jt<40?ue.style.top="40px":ue.style.top=jt+"px",ue.style.left=Jt+"px")}function we(ue,Dt){var ee=ue.querySelector(".appletParameters");if(ee){if(typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()){if(Dt.id!==ee.getAttribute("data-param-id"))return;window.GGBT_wsf_view.setCloseBtnPosition(ue)}if(ee.parentElement&&/fullscreen/.test(ee.parentElement.className))return;var pe=Kt(Dt,ue);Mn()&&ee.setAttribute("data-param-scale",pe);for(var Jt=null,jt=0;jt<ue.childNodes.length;jt++)if(ue.childNodes[jt].className!==void 0&&ue.childNodes[jt].className.match(/^applet_scaler/)){Jt=ue.childNodes[jt];break}if(Jt!==null&&Jt.querySelector(".noscale")!==null)return;var De=Dt.id!==void 0?Dt.id:"ggbApplet",ae=window[De];(ae==null||!ae.recalculateEnvironments)&&Jt!==null&&!Jt.className.match(/fullscreen/)&&(Jt.parentNode.style.transform="",!isNaN(pe)&&pe!==1?(Jt.parentNode.style.width=Dt.width*pe+"px",Jt.parentNode.style.height=Dt.height*pe+"px",Rn(Jt,pe)):(Rn(Jt,1),Jt.parentNode.style.width=Dt.width+"px",Jt.parentNode.style.height=Dt.height+"px")),typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()&&le(ue),window.GGBT_wsf_view&&!window.GGBT_wsf_view.isFullscreen()&&window.GGBT_wsf_general.adjustContentToResize($(ee).parents(".content-added-content"))}}return{responsiveResize:we,isFlexibleWorksheetEditor:Mn,positionCenter:le,getScale:Kt,scaleElement:Rn}}();__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 Mn=n.location.search;return Mn.indexOf(J)!=-1||Mn.indexOf(K)!=-1}function q(Mn,Rn){}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(Mn){var Rn=s[L].bindings;s[L].bindings=function(){for(var kt=Rn?Rn():{},ft=Mn[webModule.__softPermutationId],Kt=O;Kt<ft.length;Kt++){var le=ft[Kt];kt[le[O]]=le[P]}return kt}};var t;function u(){return v(),t}function v(){if(!t){var Mn=o.createElement(Q);if(Mn.id=L,Mn.style.cssText=R+S,Mn.tabIndex=-1,o.body.appendChild(Mn),t=Mn.contentWindow.document,navigator.userAgent.indexOf(T)==-1){t.open();var Rn=document.compatMode==U?V:W;t.write(Rn+X),t.close()}}}function w(Mn){function Rn(ft){function Kt(){return typeof o.readyState==Y?typeof o.body!=Y&&o.body!=null:/loaded|complete/.test(o.readyState)}var le=Kt();if(le){ft();return}function we(){if(!le){if(!Kt())return;le=!0,ft(),o.removeEventListener&&o.removeEventListener(Z,we,!1),ue&&clearInterval(ue)}}o.addEventListener&&o.addEventListener(Z,we,!1);var ue=setInterval(function(){we()},$)}function kt(ft){var Kt=u(),le=Kt.body,we=Kt.createElement(_);we.language=ab,we.crossOrigin=W,we.src=ft,webModule.__errFn&&(we.onerror=function(){webModule.__errFn(L,new Error(bb+ft))}),le.appendChild(we)}Rn(function(){kt(Mn)})}webModule.__startLoadingFragment=function(Mn){return C(Mn)},webModule.__installRunAsyncCode=function(Mn){var Rn=u(),kt=Rn.body,ft=Rn.createElement(_);ft.language=ab,ft.text=Mn,kt.appendChild(ft),kt.removeChild(ft)};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(Mn){alert(nb+k+ob)}}else if(j==pb&&(k=i.getAttribute(kb),k))try{e=eval(k)}catch(Mn){alert(nb+k+qb)}}}__gwt_getMetaProperty=function(Mn){var Rn=c[Mn];return Rn==null?null:Rn},r=d,webModule.__errFn=e}function B(){function Mn(ue){var Dt=ue.lastIndexOf(rb);Dt==-1&&(Dt=ue.length);var ee=ue.indexOf(sb);ee==-1&&(ee=ue.length);var pe=ue.lastIndexOf(tb,Math.min(ee,Dt));return pe>=O?ue.substring(O,pe+P):W}function Rn(ue){if(!ue.match(/^\w+:\/\//)){var Dt=o.createElement(ub);Dt.src=ue+vb,ue=Mn(Dt.src)}return ue}function kt(){var ue=__gwt_getMetaProperty(wb);return ue!=null?ue:W}function ft(){for(var ue=o.getElementsByTagName(_),Dt=O;Dt<ue.length;++Dt)if(ue[Dt].src.indexOf(xb)!=-1)return Mn(ue[Dt].src);return W}function Kt(){var ue=o.getElementsByTagName(yb);return ue.length>O?ue[ue.length-P].href:W}function le(){var ue=o.location;return ue.href==ue.protocol+zb+ue.host+ue.pathname+ue.search+ue.hash}var we=kt();return we==W&&(we=ft()),we==W&&(we=Kt()),we==W&&le()&&(we=Mn(o.location.href)),we=Rn(we),we}function C(Mn){return Mn.match(/^\//)||Mn.match(/^[a-zA-Z]+:\/\//)?Mn:webModule.__moduleBase+Mn}function D(){var Mn=[],Rn=O,kt=[],ft=[];function Kt(ue){var Dt=ft[ue](),ee=kt[ue];if(Dt in ee)return Dt;var pe=[];for(var Jt in ee)pe[ee[Jt]]=Jt;throw r&&r(ue,pe,Dt),null}if(__gwt_isKnownPropertyValue=function(ue,Dt){return Dt in kt[ue]},webModule.__getPropMap=function(){var ue={};for(var Dt in kt)kt.hasOwnProperty(Dt)&&(ue[Dt]=Kt(Dt));return ue},webModule.__computePropValue=Kt,n.__gwt_activeModules[L].bindings=webModule.__getPropMap,p())return C(Bb);var le;try{le=Cb;var we=le.indexOf(Db);we!=-1&&(Rn=parseInt(le.substring(we+P),$),le=le.substring(O,we))}catch(ue){}return webModule.__softPermutationId=Rn,C(le+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(Mn,Rn,kt){"use strict";kt.d(Rn,{Ax:function(){return we},Ds:function(){return ue},KI:function(){return ee},SI:function(){return le},f1:function(){return Kt}});var ft=kt(346);function Kt(pe){let Jt=!0;if(pe.length>0){for(let jt=0;jt<pe.length;jt++)if(pe[jt].compile_success==0||!pe[jt].compile_success){Jt=!1;break}}else Jt=!1;return Jt}function le(pe,Jt=""){let jt=[];for(let De=0;De<pe.length;De++){let ae=pe[De],Le=Jt?`${Jt}/${ae.name}`:`${ae.name}`;jt.push({title:ae.name,type:ae.type,isLeaf:ae.type!=="tree",key:Le})}return jt}function we(pe,Jt,jt){for(let De=0;De<pe.length;De++){let ae=pe[De];if(ae.key===Jt){ae.children=jt;break}ae.children&&we(ae.children,Jt,jt)}return pe}function ue(pe,Jt,jt){let De;return function(){let ae=this,Le=arguments,Bt=function(){De=null,jt||pe.apply(ae,Le)},nt=jt&&!De;clearTimeout(De),De=setTimeout(Bt,Jt),nt&&pe.apply(ae,Le)}}const Dt=!0,ee=ft.Z.API_SERVER},84842:function(Mn,Rn,kt){"use strict";kt.d(Rn,{Z:function(){return Bt}});var ft=kt(99571),Kt=kt(59301),le=Object.defineProperty,we=Object.defineProperties,ue=Object.getOwnPropertyDescriptors,Dt=Object.getOwnPropertySymbols,ee=Object.prototype.hasOwnProperty,pe=Object.prototype.propertyIsEnumerable,Jt=(nt,et,ht)=>et in nt?le(nt,et,{enumerable:!0,configurable:!0,writable:!0,value:ht}):nt[et]=ht,jt=(nt,et)=>{for(var ht in et||(et={}))ee.call(et,ht)&&Jt(nt,ht,et[ht]);if(Dt)for(var ht of Dt(et))pe.call(et,ht)&&Jt(nt,ht,et[ht]);return nt},De=(nt,et)=>we(nt,ue(et)),ae=(nt,et)=>{var ht={};for(var st in nt)ee.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&&pe.call(nt,st)&&(ht[st]=nt[st]);return ht},Le=(nt,et,ht)=>new Promise((st,pt)=>{var vt=At=>{try{Et(ht.next(At))}catch(It){pt(It)}},St=At=>{try{Et(ht.throw(At))}catch(It){pt(It)}},Et=At=>At.done?st(At.value):Promise.resolve(At.value).then(vt,St);Et((ht=ht.apply(nt,et)).next())});const Bt=nt=>{var et=nt,{children:ht}=et,st=ae(et,["children"]);const[pt,vt]=(0,Kt.useState)(!1);return Kt.createElement(ft.ZP,De(jt({},st),{loading:pt,onClick:St=>Le(void 0,null,function*(){try{vt(!0),yield st.onClick(St),vt(!1)}catch(Et){console.error(Et),vt(!1)}})}),ht)}},54650:function(Mn,Rn,kt){"use strict";kt.d(Rn,{Z:function(){return Le}});var ft=kt(59301),Kt=kt(6767),le=kt(37568),we={codeBox:"codeBox___WpkVl"},ue=kt(92310),Dt=kt.n(ue),ee=Object.defineProperty,pe=(Bt,nt,et)=>nt in Bt?ee(Bt,nt,{enumerable:!0,configurable:!0,writable:!0,value:et}):Bt[nt]=et,Jt=(Bt,nt,et)=>pe(Bt,typeof nt!="symbol"?nt+"":nt,et),jt=(Bt,nt,et)=>new Promise((ht,st)=>{var pt=Et=>{try{St(et.next(Et))}catch(At){st(At)}},vt=Et=>{try{St(et.throw(Et))}catch(At){st(At)}},St=Et=>Et.done?ht(Et.value):Promise.resolve(Et.value).then(pt,vt);St((et=et.apply(Bt,nt)).next())});class De extends ft.Component{constructor(nt){super(nt),Jt(this,"canvas"),Jt(this,"randomNum",(et,ht)=>Math.floor(Math.random()*(ht-et)+et)),Jt(this,"drawPic",()=>{this.randomCode()}),Jt(this,"reloadPic",()=>{this.drawPic()}),Jt(this,"changeCode",et=>{console.log(et.target.value,222),this.setState({value:et.target.value,showError:!1})}),Jt(this,"onVerify",()=>{let et;return this.state.value.toLowerCase()!==""&&this.state.value.toLowerCase()!==this.state.code.toLowerCase()?(et=!0,Kt.ZP.error("\u8BF7\u8F93\u5165\u6B63\u786E\u7684\u9A8C\u8BC1\u7801"),this.reloadPic()):this.state.value.toLowerCase()===""?(et=!0,Kt.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=ft.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),pt=this.randomNum(nt,et);return`rgb(${ht}, ${st}, ${pt})`}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 pt=10,vt=(this.state.contentWidth-40)/(this.state.code.length-1);let St=pt;ht>0&&(St=pt+ht*vt);let Et=this.randomNum(this.state.fontSizeMax,this.state.contentHeight-5);st>40&&(Et=40);const At=this.randomNum(-10,10);nt.translate(St,Et),nt.rotate(At*Math.PI/180),nt.fillText(et,0,0),nt.rotate(-At*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 pt=0;pt<this.state.code.length;pt++)this.drawText(st,this.state.code[pt],pt);this.drawLine(st),this.drawDot(st)})}render(){const{className:nt,width:et=300}=this.props;return ft.createElement("div",{className:Dt()(we.codeBox,nt),style:{width:et}},ft.createElement("aside",null,ft.createElement(le.default,{value:this.state.value,onChange:this.changeCode,placeholder:"\u8BF7\u8F93\u5165\u56FE\u7247\u4E2D\u7684\u9A8C\u8BC1\u7801"})),ft.createElement("div",null,ft.createElement("canvas",{onClick:this.reloadPic,ref:this.canvas,width:"100",height:"30"}),ft.createElement("div",{className:"current",onClick:this.reloadPic},"\u770B\u4E0D\u6E05\uFF1F\u6362\u4E00\u5F20")))}}const ae=(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(De,{ref:ht=>et=ht})),onOk:()=>jt(void 0,null,function*(){if(et.onVerify())return Promise.reject();Bt()})})};var Le=De},30371:function(Mn,Rn,kt){"use strict";kt.d(Rn,{Z:function(){return Jt}});var ft=kt(59301),Kt=kt(37568),le=kt(96599),we=kt(6767),ue={flex:"flex___eLcnP",flex1:"flex1___yUTT7",color666:"color666___TiUhG",error:"error___gTTtv",deleteIcon:"deleteIcon___mnZW1",addIcon:"addIcon___JC5NS"},Dt=kt(62772);const{TextArea:ee}=Kt.default;class pe extends ft.Component{constructor(De){super(De),this.state={inputVisible:!1,EditInputIndex:-1}}render(){let{index:De,onAnswerChange:ae,addChildAnswer:Le,exerciseIsPublish:Bt,answers:nt,activeOptionErrorIndex:et,flex:ht="0 0 1000px"}=this.props;console.log("----",nt);let{inputVisible:st,EditInputIndex:pt}=this.state;return ft.createElement("div",{className:ue.flex},ft.createElement("div",{className:`${ue.color666} mb5 mt6`,style:{flex:"0 0 90px"}},"\u7B54\u6848(\u586B\u7A7A",De+1,"):"),ft.createElement("div",{style:{border:"1px solid #f6f6f6",flex:1,padding:10}},nt==null?void 0:nt.map((vt,St)=>ft.createElement(ft.Fragment,null,pt!==St?(vt==null?void 0:vt.length)>0?ft.createElement(le.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(De,St):this.props.deleteChildAnswer(De,St)}},ft.createElement("span",{onDoubleClick:Et=>{this.setState({EditInputIndex:St}),Et.preventDefault()}},vt)):ft.createElement(Kt.default,{defaultValue:vt,style:{width:78,marginRight:8,height:24,verticalAlign:"top"},onBlur:Et=>{if(Et.target.value.replaceAll(" ","").length<=0){we.ZP.info("\u5185\u5BB9\u4E0D\u80FD\u4E3A\u7EAF\u7A7A\u683C");return}ae(De,St,Et.target.value),this.setState({EditInputIndex:-1,inputVisible:!1})}}):ft.createElement(Kt.default,{defaultValue:vt,style:{width:78,marginRight:8,height:24,verticalAlign:"top"},onBlur:Et=>{if(Et.target.value.replaceAll(" ","").length<=0){we.ZP.info("\u5185\u5BB9\u4E0D\u80FD\u4E3A\u7EAF\u7A7A\u683C");return}ae(De,St,Et.target.value),this.setState({EditInputIndex:-1,inputVisible:!1})}}))),!st&&ft.createElement(le.default,{className:"site-tag-plus",onClick:()=>{Le(De),this.setState({inputVisible:!0})}},ft.createElement(Dt.Z,null)," \u65B0\u589E\u7B54\u6848")))}}var Jt=pe},61011:function(Mn,Rn,kt){"use strict";kt.d(Rn,{Z:function(){return Bt}});var ft=kt(59301),Kt=kt(39793),le=Object.defineProperty,we=Object.defineProperties,ue=Object.getOwnPropertyDescriptors,Dt=Object.getOwnPropertySymbols,ee=Object.prototype.hasOwnProperty,pe=Object.prototype.propertyIsEnumerable,Jt=(nt,et,ht)=>et in nt?le(nt,et,{enumerable:!0,configurable:!0,writable:!0,value:ht}):nt[et]=ht,jt=(nt,et)=>{for(var ht in et||(et={}))ee.call(et,ht)&&Jt(nt,ht,et[ht]);if(Dt)for(var ht of Dt(et))pe.call(et,ht)&&Jt(nt,ht,et[ht]);return nt},De=(nt,et)=>we(nt,ue(et)),ae=(nt,et,ht)=>Jt(nt,typeof et!="symbol"?et+"":et,ht);const Le="\u2581";class Bt extends ft.Component{constructor(){super(...arguments),ae(this,"getChCountBeforeCursor",(et,ht)=>{const st=ht.line;let pt=0;for(let St=0;St<st;St++)pt+=et.getLine(St).split(Le).length-1;const vt=et.getLine(st).substring(0,ht.ch);return pt+=vt.split(Le).length-1,pt}),ae(this,"onCMBeforeChange",(et,ht)=>{const st=et.getRange(ht.from,ht.to);let pt=0;if(ht.text.forEach(vt=>{pt+=vt.split(Le).length-1}),st&&st.indexOf(Le)!=-1){const vt=st.split(Le).length-1,St=this.getChCountBeforeCursor(et,ht.from);console.log(`\u5220\u9664${vt}\u4E2A\uFF0C \u4E4B\u524D\u6709${St}\u4E2A\uFF0C\u65B0\u589E${pt}\u4E2A`),this.props.deleteEmptyDisabled?ht.cancel():this.props.onPlaceholderChange&&this.props.onPlaceholderChange(St,vt,pt)}else if(pt){const vt=this.getChCountBeforeCursor(et,ht.from);console.log(`\u65B0\u589E${pt}\u4E2A\uFF0C\u4E4B\u524D\u6709${vt}\u4E2A`),this.props.onPlaceholderChange&&this.props.onPlaceholderChange(vt,0,pt)}})}render(){return ft.createElement(Kt.Z,De(jt({},this.props),{onCMBeforeChange:this.onCMBeforeChange}))}}},94361:function(Mn,Rn,kt){"use strict";kt.d(Rn,{Z:function(){return Dt}});var ft=kt(37639),Kt={text:"text___FxbAX",wrap:"wrap___UlBQ1",contact:"contact____pUDq",img:"img___BapAv"},le=kt(32637),we=kt(59301),Dt=({type:ee,style:pe})=>{const Jt=we.createElement("div",{className:Kt.wrap,onClick:jt=>{jt.preventDefault(),jt.stopPropagation()}},we.createElement("p",null,ee==="shixun"||ee==="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",we.createElement("br",null),"\u6839\u636E\u5E73\u53F0\u4F7F\u7528\u89C4\u5219\uFF0C\u9700\u8981\u6388\u6743\u624D\u80FD\u4F7F\u7528\u3002",ee==="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"),we.createElement("div",{className:Kt.contact},we.createElement("div",{className:Kt.img},we.createElement("img",{src:le,width:"124px",height:"124px"})),we.createElement("div",{className:"tc font14 mt10",style:{color:"#777A93"}},"\u626B\u4E00\u626B\uFF0C\u83B7\u53D6\u6388\u6743\u7801")));return we.createElement(ft.Z,{content:Jt},we.createElement("span",{className:Kt.text,style:pe},"\u9AD8\u6D88\u8017"))}},9507:function(Mn,Rn,kt){"use strict";kt.d(Rn,{Z:function(){return De}});var ft=kt(59301),Kt={imageDimensions:"imageDimensions___a7crR",img:"img___Kroat",fullWidth:"fullWidth___c492T"},le=kt(92310),we=kt.n(le),ue=kt(29787),Dt=kt(2859),ee=kt(38986),pe=kt(51257),Jt=(ae,Le,Bt)=>new Promise((nt,et)=>{var ht=vt=>{try{pt(Bt.next(vt))}catch(St){et(St)}},st=vt=>{try{pt(Bt.throw(vt))}catch(St){et(St)}},pt=vt=>vt.done?nt(vt.value):Promise.resolve(vt.value).then(ht,st);pt((Bt=Bt.apply(ae,Le)).next())}),De=({data:ae,className:Le,fullWidth:Bt,style:nt={},onClose:et,onOk:ht,showFullTools:st,noAssociationId:pt})=>{const vt=(0,ft.useRef)(null),St=(0,ft.useRef)(null),Et=(0,ft.useRef)(null),At=(0,ft.useRef)(null),[It,qt]=(0,ft.useState)(!1),[Ut,Gt]=(0,ft.useState)("\u6B63\u5728\u52A0\u8F7D\u4E2D");(0,ft.useEffect)(()=>(Et.current||(Et.current=document.createElement("style"),document.head.appendChild(Et.current)),ae!=null&&ae.visible?(document.body.setAttribute("data-custom","y-hidden"),Et.current.innerHTML=" html { overflow-y: hidden; }",ae!=null&&ae.src&&ge()):(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)}),[ae==null?void 0:ae.visible]);const ge=()=>Jt(void 0,null,function*(){qt(!0),Gt("\u6B63\u5728\u52A0\u8F7D\u4E2D");const ye=yield(0,pe.ZJ)(ae==null?void 0:ae.src);vt.current.src="",vt.current.src=ye,vt.current.onload=function(){ve()},qt(!1),Gt("")}),ie=ye=>Jt(void 0,null,function*(){qt(!0),Gt("\u6B63\u5728\u4FDD\u5B58\u4E2D");const Ye=yield(0,ee.ZP)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:ae.title,file:ye.dataUrl}});Ye!=null&&Ye.id&&!pt?(yield(0,ee.ZP)(`/api/attachments/${ae.id}/add_subitem.json`,{method:"post",body:{subitem_id:Ye==null?void 0:Ye.id,settings:JSON.stringify(ye.state)}})).status===0&&ht():Ye!=null&&Ye.id&&ht(Ye),qt(!1),Gt("")}),Te=()=>{const ye=document.querySelector('a[href="https://markerjs.com/"]');ye&&ye.parentNode&&(ye.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(Ze=>{const qe=document.querySelector(Ze.name);qe&&qe.setAttribute("title",Ze.title)})},ve=()=>{St.current=new Dt.hP(vt.current),St.current.targetRoot=At.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(),ae!=null&&ae.snapshotData&&St.current.restoreState(ae.snapshotData),setTimeout(()=>{window.scrollTo(0,0),Te()},300)};return ft.createElement(ft.Fragment,null,(ae==null?void 0:ae.visible)&&ft.createElement(ue.Z,{spinning:It,tip:Ut,style:{position:"absolute",width:"100vw"}},ft.createElement("div",{ref:At,className:we()(Kt.imageDimensions,Le,Bt?Kt.fullWidth:""),style:nt},ft.createElement("img",{className:Kt.img,ref:vt}))))}},19105:function(Mn,Rn,kt){"use strict";var ft=kt(59301),Kt=kt(99587),le=kt(48136),we=kt(76562),ue=kt(62957),Dt=kt(59301);const ee=(0,ft.forwardRef)(({callback:pe,width:Jt,onChange:jt,disabled:De,readOnly:ae,type:Le="",value:Bt="",style:nt={}},et)=>{const ht=(0,ft.useRef)(),st=(0,ft.useRef)(),[pt,vt]=(0,ft.useState)(0),[St,Et]=(0,ft.useState)(0),[At,It]=(0,ft.useState)(!1),qt=()=>{var ie=document.createElement("div");ie.innerHTML=ht.current.getValue();var Te=ie.innerText;return pe&&pe(Te),Te};(0,ft.useImperativeHandle)(et,()=>({getData:qt}));const Ut=ie=>{ie.preventDefault();const Te=ie.clientX-pt,ve=ie.clientY-St;document.body.onmousemove=ye=>{let Ye=ye.clientX-Te,Ze=ye.clientY-ve;const qe=document.getElementsByClassName("markdown-popup-form")[0],pn=window.innerWidth-qe.offsetWidth,te=window.innerHeight-qe.offsetHeight;Ye=Math.max(0,Math.min(Ye,pn)),Ze=Math.max(0,Math.min(Ze,te)),Gt(ye.clientX,ye.clientY,Te,ve)&&(vt(Ye),Et(Ze))},document.body.onmouseup=function(){document.body.onmousemove=null}},Gt=(ie,Te,ve,ye)=>{const Ye=document.body.clientHeight,Ze=document.body.clientWidth;return ie<20&&ve>ie||ie>Ze-20&&ve<ie||Te<20&&ye>Te||Te>Ye-20&&ye<Te?(document.body.onmousemove=null,document.body.onmouseup=null,!1):!0};(0,ft.useEffect)(()=>{At&&setTimeout(()=>{const ie=document.getElementsByClassName("markdown-popup-form")[0],Te=window.innerWidth/2-ie.offsetWidth/2,ve=window.innerHeight/2-ie.offsetHeight/2;vt(Te),Et(ve)},0)},[At]);const ge=()=>{De||ae||It(!0)};return Dt.createElement("div",{style:nt},Dt.createElement("div",{style:{width:Jt||"100%",position:"relative"},className:`${Kt.Z.mathFillWrap} ${De||ae?"cursorDefault":""}`,onClick:()=>ge()},Dt.createElement("math-field",{disabled:De,locale:"zh_cn",class:`${Kt.Z.mathField} ${Le}`,readOnly:ae,placeholder:"\u8BF7\u8F93\u5165\u516C\u5F0F",ref:ht,style:{width:"100%",fontSize:Bt?18:14},value:Bt||""})),Dt.createElement(ue.default,{maskClosable:!1,centered:!0,width:860,style:{position:"absolute",left:pt,top:St},title:Dt.createElement("div",{style:{cursor:"move"},onMouseDown:Ut},"\u8F93\u5165\u516C\u5F0F"),open:At,onOk:()=>{const ie=st.current.getData();ht.current.setValue(ie),jt(ie),It(!1)},onCancel:()=>{It(!1)},destroyOnClose:!0,className:"markdown-popup-form"},Dt.createElement(we.Z,{value:Bt,ref:st,onChange:jt,showSaveButton:!1})))});Rn.Z=ee},76562:function(Mn,Rn,kt){"use strict";var ft=kt(59301),Kt=kt(77019),le=kt(5269),we=kt(20554),ue=kt(99571),Dt=kt(76902),ee=kt(99587),pe=kt(48136),Jt=kt(59301);const jt=(0,ft.forwardRef)(({callback:De,showSaveButton:ae,value:Le=""},Bt)=>{const nt=(0,ft.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+" ")},pt=[{key:"1",label:"\u5FEB\u6377\u6A21\u677F",children:Jt.createElement(Kt.Z,{className:ee.Z.lists,gutter:[10,10]},et.map((St,Et)=>Jt.createElement(le.Z,{flex:"110px",className:ee.Z.item},Jt.createElement("div",null,Jt.createElement(Dt.Z,{value:`$$${St.value}$$`}),St.name),Jt.createElement("div",{className:ee.Z.children},St.children.map((At,It)=>Jt.createElement("div",{key:It},Jt.createElement("h1",null,At.name),Jt.createElement(Kt.Z,{gutter:[10,10]},At.data.map((qt,Ut)=>Jt.createElement(le.Z,{key:Ut,onClick:()=>st(qt),className:ee.Z.diamond},Jt.createElement(Dt.Z,{value:"`$$"+qt.value+"$$`"}))))))))))},{key:"2",label:"\u516C\u5F0F\u6A21\u677F",children:Jt.createElement(Kt.Z,{className:ee.Z.lists,gutter:[10,10]},ht.map((St,Et)=>Jt.createElement(le.Z,{flex:"110px",className:ee.Z.item},Jt.createElement("div",null,Jt.createElement(Dt.Z,{value:"`$$"+St.value+"$$`"}),St.name),Jt.createElement("div",{className:ee.Z.children},St.children.map((At,It)=>Jt.createElement("div",{key:It},At.name&&Jt.createElement("h1",null,At.name),Jt.createElement(Kt.Z,{gutter:[10,10]},At.data.map((qt,Ut)=>Jt.createElement(le.Z,{key:Ut,onClick:()=>st(qt),className:ee.Z.diamond},Jt.createElement(Dt.Z,{value:"`$$"+qt.value+"$$`"}))))))))))}],vt=()=>{var St=document.createElement("div");St.innerHTML=nt.current.getValue();var Et=St.innerText;return De&&De(Et),Et};return(0,ft.useImperativeHandle)(Bt,()=>({getData:vt})),Jt.createElement("div",{className:ee.Z.mathWrap},Jt.createElement(we.default,{defaultActiveKey:"1",items:pt}),Jt.createElement("math-field",{locale:"zh_cn",className:ee.Z.mathField,placeholder:"\u8BF7\u6253\u5F00\u952E\u76D8\uFF0C\u8F93\u5165\u516C\u5F0F",ref:nt,style:{width:800,marginTop:30,fontSize:18}},Le||""),ae&&Jt.createElement("div",{className:ee.Z.button},Jt.createElement(ue.ZP,{size:"large",onClick:vt,style:{zIndex:8,marginTop:10},type:"primary"},"\u4FDD\u5B58\u5230\u7F16\u8F91\u5668")))});Rn.Z=jt},28426:function(Mn,Rn,kt){"use strict";var ft=kt(59301),Kt=kt(93314),le=kt(99571),we=Object.defineProperty,ue=Object.defineProperties,Dt=Object.getOwnPropertyDescriptors,ee=Object.getOwnPropertySymbols,pe=Object.prototype.hasOwnProperty,Jt=Object.prototype.propertyIsEnumerable,jt=(Bt,nt,et)=>nt in Bt?we(Bt,nt,{enumerable:!0,configurable:!0,writable:!0,value:et}):Bt[nt]=et,De=(Bt,nt)=>{for(var et in nt||(nt={}))pe.call(nt,et)&&jt(Bt,et,nt[et]);if(ee)for(var et of ee(nt))Jt.call(nt,et)&&jt(Bt,et,nt[et]);return Bt},ae=(Bt,nt)=>ue(Bt,Dt(nt));const Le=({img:Bt,buttonProps:nt={},styles:et={},customText:ht,ButtonText:st,ButtonClick:pt,Buttonclass:vt,ButtonTwo:St,imgStyles:Et,loading:At=!1,className:It=""})=>ft.createElement("section",{className:`tc animated fadeIn ${It}`,style:De({color:"#999",margin:"100px auto",visibility:At?"hidden":"visible"},et)},ft.createElement("img",{src:Bt||Kt,style:ae(De({},Et),{pointerEvents:"none",userSelect:"none"})}),ft.createElement("p",{className:"mt20 font14"},ht||"\u6682\u65F6\u8FD8\u6CA1\u6709\u76F8\u5173\u6570\u636E\u54E6!"),st&&ft.createElement(le.ZP,De({className:vt,onClick:pt},nt),st),St&&St);Rn.Z=Le},45677:function(Mn,Rn,kt){"use strict";kt.d(Rn,{Z:function(){return vt}});var ft=kt(59301),Kt={wrp:"wrp___dq7YK",bgBlack:"bgBlack___ARIUV",monaco:"monaco___VnZC3",darkBlue:"darkBlue___UprA9",close:"close___LKoWu",embed:"embed___hvpEJ"},le=kt(99571),we=kt(70557),ue=kt(75975),Dt=kt(25399),ee=kt(51257),pe=kt(81722),Jt=kt(28426),jt=kt(346),De=kt(44203),ae=kt(59301),Le=Object.defineProperty,Bt=Object.getOwnPropertySymbols,nt=Object.prototype.hasOwnProperty,et=Object.prototype.propertyIsEnumerable,ht=(St,Et,At)=>Et in St?Le(St,Et,{enumerable:!0,configurable:!0,writable:!0,value:At}):St[Et]=At,st=(St,Et)=>{for(var At in Et||(Et={}))nt.call(Et,At)&&ht(St,At,Et[At]);if(Bt)for(var At of Bt(Et))et.call(Et,At)&&ht(St,At,Et[At]);return St},pt=(St,Et,At)=>new Promise((It,qt)=>{var Ut=ie=>{try{ge(At.next(ie))}catch(Te){qt(Te)}},Gt=ie=>{try{ge(At.throw(ie))}catch(Te){qt(Te)}},ge=ie=>ie.done?It(ie.value):Promise.resolve(ie.value).then(Ut,Gt);ge((At=At.apply(St,Et)).next())}),vt=({editOffice:St="view",data:Et,issaver:At,onSaver:It,theme:qt,type:Ut,filename:Gt,monacoEditor:ge,className:ie,style:Te,close:ve,onClose:ye,hasMask:Ye,disabledDownload:Ze,onImgDimensions:qe,showNodata:pn,recordInfo:te})=>{const[Xt,Qe]=(0,ft.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),[On,En]=(0,ft.useState)(""),[Ie,on]=(0,ft.useState)(),cn=window.ENV==="build"?"/react/build":"",Vn=location.host.startsWith("localhost")?jt.Z.PROXY_SERVER:jt.Z.API_SERVER,he=10*(1024*1024),Ce=(0,ft.useRef)();Et!=null&&Et.startsWith("/api")&&Ut!=="txt"&&(Et=jt.Z.API_SERVER+Et);const Yn=Nt=>Nt.substring(Nt.lastIndexOf("/")+1).split(".").pop();Gt&&ge&&(ge.filename=Gt),(0,ft.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 He=Yt.split("=");He[0]==="_educoder_session"&&En(He[1])})},[]),(0,ft.useEffect)(()=>{Ut==="office"&&(Et.indexOf("bigfilescdn.")>-1||Et.indexOf("bigfiles1")>-1?on({url:Et,fileType:Yn(Et),model:Et.indexOf("model=edit")?"edit":"view"}):Rt())},[Ut,Et]);function Si(Nt){return pt(this,null,function*(){Nt.data.type==="pdfdata"&&(It(Nt.data.data),window.removeEventListener("message",Si,!1)),console.log("mess---:",Nt.data)})}const Rt=()=>pt(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,pe.gJ)({attachment_id:zt});Mt.url=Vn+Mt.url,on(Mt)}),Ft=()=>{if(Et.startsWith("http")||Et.startsWith("blob:")){Pt();return}(0,ee.Sv)(Gt||"educoder",Et,Gt)},Pt=()=>{te&&(0,De.fc)({id:te==null?void 0:te.id,watch_type:1,course_id:te==null?void 0:te.course_id}),(0,ee.Nd)(Gt||"educoder",decodeURIComponent(Et))};return ae.createElement("div",{style:st({},Te||{}),className:`${Ye&&Kt.bgBlack} ${Ut?Kt.wrp:"hide"}`},ve&&ae.createElement("div",{className:Kt.close,ref:Ce},!!qe&&ae.createElement(Dt.Z,{title:"\u70B9\u51FB\u5BF9\u56FE\u7247\u8FDB\u884C\u6279\u6CE8",getPopupContainer:()=>Ce.current},ae.createElement("span",{onClick:()=>{ye(),qe()}},ae.createElement("i",{className:"icon-yulanpizhu"}))),!Ze&&ae.createElement(Dt.Z,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:()=>Ce.current},ae.createElement("span",{onClick:Pt},ae.createElement("i",{className:"icon-quxiaozhiding"}))),At&&ae.createElement(Dt.Z,{title:"\u4FDD\u5B58pdf\u5E76\u9000\u51FA",getPopupContainer:()=>Ce.current},ae.createElement("span",{className:"",onClick:()=>{const Nt=document.getElementById("pdfiframe");window.addEventListener("message",Si,!1),setTimeout(()=>{Nt.contentWindow.postMessage("getData","*")},300)}},ae.createElement("i",{className:"icon-baocun"}))),ae.createElement(Dt.Z,{title:"\u5173\u95ED",getPopupContainer:()=>Ce.current},ae.createElement("span",{className:"",onClick:()=>{ye()}},ae.createElement("i",{className:"icon-guanbi1"})))),ae.createElement("div",{className:`${Kt[ie]} ${ie} ${Kt.monaco} ${Ut==="txt"?"show":"hide"}`},Ut==="txt"&&ae.createElement(ae.Fragment,null,ae.createElement(ue.ZP,st({},ge)))),Ut==="audio"&&ae.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}),Ut==="video"&&ae.createElement(ae.Fragment,null,(Et==null?void 0:Et.indexOf("http"))>-1?ae.createElement("video",{controls:!0,src:`${Et}`,autoPlay:!0}):ae.createElement("video",{controls:!0,src:`data:video/mp4;base64,${Et}`,autoPlay:!0})),Ut==="office"&&Ie&&ae.createElement("iframe",{src:`${cn}/office.html?key=${Ie.key}&url=${btoa(Ie.url)}&callbackUrl=${Vn+(Ie.callbackUrl||"")}&fileType=${Ie.fileType}&title=${Ie.title||""}&model=${St}&officeServer=${jt.Z.ONLYOFFICE}&disabledDownload=${!!Ze}`}),Ut==="html"&&ae.createElement("iframe",{src:Et+"&disposition=inline"}),Ut==="pdf"&&ae.createElement("iframe",{id:"pdfiframe",src:`${cn}/js/pdfview/index.html?filename=${Gt||"educoder.pdf"}&url=${encodeURIComponent(Et)}&disabledDownload=${!!Ze}&model=${St}`}),Ut==="image"&&ae.createElement("img",{src:`${(Et==null?void 0:Et.indexOf("http://"))>-1||(Et==null?void 0:Et.indexOf("https://"))>-1?"":"data:image/png;base64,"}${Et}`}),(Ut==="other"||Ut==="download")&&ae.createElement(ae.Fragment,null,pn?ae.createElement(Jt.Z,{customText:"\u5F53\u524D\u6587\u4EF6\u4E0D\u652F\u6301\u9884\u89C8\uFF0C\u53EF\u70B9\u51FB\u4E0B\u8F7D\u67E5\u770B",ButtonTwo:ae.createElement(le.ZP,{icon:ae.createElement("i",{className:"iconfont icon-xiazai4 font14"}),type:"primary",size:"middle",onClick:Ft,disabled:Ze},"\u4E0B\u8F7D")}):ae.createElement(le.ZP,{type:"primary",size:"middle",onClick:Ft,disabled:Ze},ae.createElement(we.Z,null),"\u70B9\u51FB\u4E0B\u8F7D")))}},68571:function(Mn,Rn,kt){"use strict";kt.d(Rn,{t:function(){return Pt}});var ft=kt(59301),Kt=kt(37568),le=kt(28284),we=kt(62957),ue=kt(77019),Dt=kt(5269),ee=kt(71051),pe=kt(82326),Jt=kt(47889),jt=kt(31457),De=kt(25690),ae=kt(8423),Le=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),pt=kt(81072),vt=kt(39793),St=kt(56102),Et=kt(37345),At=kt(59301),It=Object.defineProperty,qt=Object.defineProperties,Ut=Object.getOwnPropertyDescriptors,Gt=Object.getOwnPropertySymbols,ge=Object.prototype.hasOwnProperty,ie=Object.prototype.propertyIsEnumerable,Te=(Nt,zt,Mt)=>zt in Nt?It(Nt,zt,{enumerable:!0,configurable:!0,writable:!0,value:Mt}):Nt[zt]=Mt,ve=(Nt,zt)=>{for(var Mt in zt||(zt={}))ge.call(zt,Mt)&&Te(Nt,Mt,zt[Mt]);if(Gt)for(var Mt of Gt(zt))ie.call(zt,Mt)&&Te(Nt,Mt,zt[Mt]);return Nt},ye=(Nt,zt)=>qt(Nt,Ut(zt)),Ye=(Nt,zt,Mt)=>new Promise((Yt,He)=>{var _e=Pe=>{try{xe(Mt.next(Pe))}catch(ke){He(ke)}},Xe=Pe=>{try{xe(Mt.throw(Pe))}catch(ke){He(ke)}},xe=Pe=>Pe.done?Yt(Pe.value):Promise.resolve(Pe.value).then(_e,Xe);xe((Mt=Mt.apply(Nt,zt)).next())}),qe=({buttonProps:Nt,buttonText:zt,form:Mt,hackIdentifier:Yt="",answerKey:He,data:_e})=>{const[Xe,xe]=(0,ft.useState)(!1),[Pe,ke]=(0,ft.useState)(!1),[Ve,tn]=(0,ft.useState)(!1),[dn,fn]=(0,ft.useState)({}),[ni,Ge]=(0,ft.useState)(""),[Ke,nn]=(0,ft.useState)(""),Qn=(0,ft.useRef)(Yt),gn=(0,ft.useRef)(""),an=(0,ft.useRef)(!1);(0,ft.useEffect)(()=>{Ve&&wi()},[Ve]),(0,ft.useEffect)(()=>()=>{sessionStorage.removeItem("projectFill")},[]);const zn=()=>new Date().getTime(),gi=_e==null?void 0:_e.code,ti=()=>{var Pn,Bn;let si=gi?_e==null?void 0:_e.code:(Pn=Mt.getFieldValue("hack_codes"))==null?void 0:Pn.code,Ei=gi?_e==null?void 0:_e.answer_content:Mt.getFieldValue(He),ci=gi?_e==null?void 0:_e.input:(Bn=Mt.getFieldValue("hack_sets"))==null?void 0:Bn.input;Ei==null||Ei.forEach(Zi=>{const wt=Zi.value||Zi.answer_text||"";si=si.replace(/(@▁@|@▁▁@)/,wt)}),nn(ci),Ge(si),fn({}),tn(!0)},wi=()=>Ye(void 0,null,function*(){var Pn,Bn,si,Ei;const ci=zn(),Zi=gi?_e==null?void 0:_e.time_limit:(Pn=Mt.getFieldsValue())==null?void 0:Pn.hack.time_limit,wt=gi?(Bn=_e==null?void 0:_e.answer_content)==null?void 0:Bn.length:(Ei=(si=Mt.getFieldsValue())==null?void 0:si.standard_answers)==null?void 0:Ei.length;xe(!0),yield(0,pt.bM)(gn.current,{test_hack_code:ni,test_input:Ke});function Je(){return Ye(this,null,function*(){const{status:Hn,data:Ln}=yield(0,pt.rX)(gn.current,"submit"),li=zn()-ci>(Zi+3)*1e3*wt;if(an.current){if(li){Le.ZP.error("\u8C03\u8BD5\u4EE3\u7801\u8D85\u65F6"),xe(!1);return}if(Hn===0){xe(!1),fn(ye(ve({},Ln),{showText:!0}));return}setTimeout(Je,1e3)}})}Je()}),Wi=()=>Ye(void 0,null,function*(){var Pn,Bn,si,Ei,ci,Zi,wt;if(!_e){try{yield Mt.validateFields()}catch(jn){(si=(Bn=(Pn=jn==null?void 0:jn.errorFields)==null?void 0:Pn[0])==null?void 0:Bn.name)!=null&&si.includes("standard_answers")?Le.ZP.error("\u586B\u7A7A\u9879\u7B54\u6848\u4E0D\u80FD\u4E3A\u7A7A"):Le.ZP.error(jn.errorFields[0].errors[0]),Mt.scrollToField(jn.errorFields[0].name,{behavior:"smooth",block:"center"});return}ke(!0);let Hn="";const Ln=Mt.getFieldsValue();Qn.current?Hn=yield(0,st.ZP)(`/api/problems/${Qn.current}.json`,{method:"put",body:ye(ve({},Ln),{hack:ye(ve({},Ln==null?void 0:Ln.hack),{sub_discipline_id:(wt=(Zi=Ln==null?void 0:Ln.hack)==null?void 0:Zi.sub_discipline_id)==null?void 0:wt[1],difficult:Ln.difficulty,item_banks_group_id:Ln.item_banks_group_id}),hack_codes:ye(ve({},Ln.hack_codes),{code:et.Base64.encode(Ln.hack_codes.code)}),update_hack_sets:[ve({},Ln.hack_sets)],is_blank:!0,item_type:"BPROGRAM"})}):(Hn=yield(0,st.ZP)("/api/problems.json",{method:"post",body:ye(ve({},Ln),{hack:ye(ve({},Ln==null?void 0:Ln.hack),{sub_discipline_id:(ci=(Ei=Ln==null?void 0:Ln.hack)==null?void 0:Ei.sub_discipline_id)==null?void 0:ci[1],difficult:Ln.difficulty,item_banks_group_id:Ln.item_banks_group_id}),hack_codes:ye(ve({},Ln.hack_codes),{code:et.Base64.encode(Ln.hack_codes.code)}),hack_sets:[ve({},Ln.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 Je=yield(0,st.ZP)(`/api/problems/${Qn.current}/start.json`,{method:"get"});if((Je==null?void 0:Je.status)===0){gn.current=Je==null?void 0:Je.identifier,an.current=!0,ke(!1),ti();return}ke(!1)}),Cn=Pn=>{const{status:Bn,error_msg:si,execute_time:Ei,output:ci,input:Zi,expected_output:wt}=Pn;let Je=null;switch(Bn){case Et.h.OK:Je=At.createElement(At.Fragment,null,At.createElement("p",null,"\u6267\u884C\u7528\u65F6\uFF1A",Ei/1e3,"\u79D2"),At.createElement("p",null,"\u6267\u884C\u7ED3\u679C\uFF1A\u8C03\u8BD5\u901A\u8FC7"));break;case Et.h.NOMATCH:Je=At.createElement(At.Fragment,null,At.createElement("div",null,"\u8F93\u5165\uFF1A"),At.createElement("pre",{style:{fontFamily:"initial"}},Zi),At.createElement("div",null,"\u8F93\u51FA\uFF1A"),At.createElement("pre",{style:{fontFamily:"initial"}},ci&&et.Base64.decode(ci)),At.createElement("div",null,"\u9884\u671F\u8F93\u51FA\uFF1A"),At.createElement("pre",{style:{fontFamily:"initial"}},wt&&et.Base64.decode(wt)));break;case Et.h.EXECUTEFAILURE:Je=At.createElement(At.Fragment,null,At.createElement("p",null,"\u6700\u540E\u6267\u884C\u7684\u8F93\u5165\uFF1A",At.createElement("pre",null,Zi)),At.createElement("p",null,"\u6267\u884C\u51FA\u9519\u4FE1\u606F\uFF1A"),At.createElement("pre",{className:"error"},et.Base64.decode(si)));break;case Et.h.COMPILEFAILURE:Je=At.createElement(At.Fragment,null,At.createElement("p",null,"\u6700\u540E\u6267\u884C\u7684\u8F93\u5165\uFF1A",At.createElement("pre",null,Zi)),At.createElement("p",null,"\u6267\u884C\u51FA\u9519\u4FE1\u606F\uFF1A"),At.createElement("pre",{className:"error"},et.Base64.decode(si)));break;case Et.h.PODFAILURE:Je=At.createElement("p",null,"\u521B\u5EFApod\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");break;case Et.h.TIMEOUT:Je=At.createElement("p",null,"\u8BC4\u6D4B\u8D85\u65F6\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");break}return At.createElement(At.Fragment,null," ",Je," ")};return At.createElement("div",null,At.createElement(Bt.ZP,ye(ve({loading:Pe},Nt),{onClick:Wi}),zt),At.createElement(we.default,{open:Ve,title:"\u8C03\u8BD5\u4EE3\u7801",destroyOnClose:!0,width:1200,okText:"\u8FD0\u884C\u6D4B\u8BD5",confirmLoading:Xe,cancelButtonProps:{style:{display:"none"}},onOk:()=>wi(),onCancel:()=>{an.current=!1,tn(!1)}},At.createElement("div",{className:ht.result},At.createElement("div",{className:ht.left},At.createElement("div",{className:"mb20"},At.createElement("span",{className:"c-black"},"\u6267\u884C\u4EE3\u7801"),!_e&&At.createElement(St.CopyToClipboard,{text:ni,onCopy:()=>Le.ZP.success("\u590D\u5236\u6210\u529F")},At.createElement("span",{style:{float:"right"},className:"current c-light-primary"},At.createElement("i",{className:"iconfont icon-fuzhi8 mr5"}),"\u590D\u5236"))),At.createElement(vt.Z,{height:510,className:"mb0",hidetoolBar:!0,defaultValue:ni,onChange:Pn=>Ge(Pn)})),At.createElement("div",{className:ht.right},At.createElement("div",{className:"c-black mb20"},"\u81EA\u5B9A\u4E49\u6D4B\u8BD5\u7528\u4F8B"),At.createElement("div",{className:ht.box},At.createElement("div",{className:ht.li},At.createElement(Kt.default.TextArea,{placeholder:"\u8BF7\u8F93\u5165",value:Ke,onChange:Pn=>nn(Pn.target.value),bordered:!1,style:{height:180}}))),At.createElement("div",{className:"c-black mb20 mt30"},"\u4EE3\u7801\u6267\u884C\u7ED3\u679C"),At.createElement("div",{className:ht.box},At.createElement(nt.Z,{spinning:Xe,tip:"\u4EE3\u7801\u6267\u884C\u4E2D"},At.createElement("div",{className:ht.li,style:{height:196,overflow:"auto",padding:10}},Cn(dn))))))))},pn=kt(87169),te=kt(59301),Xt=Object.defineProperty,Qe=Object.defineProperties,On=Object.getOwnPropertyDescriptors,En=Object.getOwnPropertySymbols,Ie=Object.prototype.hasOwnProperty,on=Object.prototype.propertyIsEnumerable,cn=(Nt,zt,Mt)=>zt in Nt?Xt(Nt,zt,{enumerable:!0,configurable:!0,writable:!0,value:Mt}):Nt[zt]=Mt,Vn=(Nt,zt)=>{for(var Mt in zt||(zt={}))Ie.call(zt,Mt)&&cn(Nt,Mt,zt[Mt]);if(En)for(var Mt of En(zt))on.call(zt,Mt)&&cn(Nt,Mt,zt[Mt]);return Nt},Me=(Nt,zt)=>Qe(Nt,On(zt)),he=(Nt,zt)=>{var Mt={};for(var Yt in Nt)Ie.call(Nt,Yt)&&zt.indexOf(Yt)<0&&(Mt[Yt]=Nt[Yt]);if(Nt!=null&&En)for(var Yt of En(Nt))zt.indexOf(Yt)<0&&on.call(Nt,Yt)&&(Mt[Yt]=Nt[Yt]);return Mt};const{TextArea:Ce}=Kt.default,Yn=[{title:"C",key:"C"},{title:"C++",key:"C++"},{title:"Python",key:"Python"},{title:"Java",key:"Java"}],Si=({value:Nt,onChange:zt})=>te.createElement(Switch,{checked:Nt,onChange:Mt=>{zt(Mt)}}),Rt="@\u2581@",Ft="@\u2581\u2581@",Pt=({questionTitlePlaceholder:Nt,form:zt,scoreByBlank:Mt=!1,hackidentifier:Yt,answerKey:He})=>{const[_e,Xe]=(0,ft.useState)(!1),[xe,Pe]=(0,ft.useState)(!1),Ve=(0,De.useParams)().type==="edit",tn=(gn,an)=>{const zn=an.line;let gi=0;for(let wi=0;wi<zn;wi++)gi+=gn.getLine(wi).split(Rt).length-1;for(let wi=0;wi<zn;wi++)gi+=gn.getLine(wi).split(Ft).length-1;const ti=gn.getLine(zn).substring(0,an.ch);return gi+=ti.split(Rt).length-1,gi+=ti.split(Ft).length-1,gi},dn=(gn,an,zn,gi)=>{const ti=gn.getRange(an.from,an.to);let wi=0;if(an.text.forEach(Wi=>{wi+=Wi.split(Rt).length-1}),an.text.forEach(Wi=>{wi+=Wi.split(Ft).length-1}),an.origin!=="setValue"){if(ti&&(ti.indexOf(Rt)!==-1||ti.indexOf(Ft)!==-1)){const Wi=ti.split(Rt).length-1+ti.split(Ft).length-1,Cn=tn(gn,an.from);if(console.log(`\u5220\u9664${Wi}\u4E2A\uFF0C \u524D\u9762\u6709${Cn}\u4E2A\uFF0C\u65B0\u589E${wi}\u4E2A`),Wi>1){const Pn=Array.from({length:Wi},(Bn,si)=>Cn+si);gi(Pn)}else gi(Cn)}else if(wi>0){const Wi=tn(gn,an.from);console.log(`\u65B0\u589E${wi}\u4E2A\uFF0C\u4E4B\u524D\u6709${Wi}\u4E2A`),zn(wi,Wi)}}},fn=()=>{const gn=zt.getFieldValue(He);zt.setFieldsValue({[He]:gn==null?void 0:gn.map((an,zn)=>Me(Vn({},an),{position:zn+1}))})},ni=(0,ft.useRef)(),Ge=(gn,an)=>{for(let zn=0;zn<gn;zn++)ni.current({position:null,answer_text:""},an+zn);fn()},Ke=(0,ft.useRef)(),nn=gn=>{Ke.current(gn),fn()},Qn=le.default.useWatch(He,zt);return te.createElement("div",{className:ae.Z.wrap},te.createElement(le.default.Item,{label:"\u8BD5\u9898\u63CF\u8FF0",name:["hack","description"],style:{display:"table"},className:"w100",labelCol:{span:24},rules:[{required:!0}]},te.createElement(jt.h,{scrollId:"name",watch:!0,height:140})),te.createElement("div",{className:ae.Z.questionTitleEditorWrap},te.createElement(le.default.Item,{label:"\u7A0B\u5E8F\u4EE3\u7801",name:["hack_codes","code"],labelCol:{span:24},rules:[{required:!0}]},te.createElement(jt.h,{scrollId:"name",watch:!0,height:400,showNullProgramButton:!0,onChange:(gn,an)=>{const zn=zt.getFieldValue(He);console.log("--preAnswerData",zn,an),zt.setFieldsValue({[He]:zn==null?void 0:zn.map((gi,ti)=>{var wi;return Me(Vn({},gi),{position:ti+1,multi_line:(wi=an==null?void 0:an[ti])==null?void 0:wi.multiLine})})})},placeholder:Nt,onCMBeforeChange:(gn,an)=>{dn(gn,an,Ge,nn)}}))),te.createElement(le.default.List,{name:He,rules:[{validator(gn,an){if(!(an!=null&&an.length))return Promise.reject(new Error("\u7B54\u6848\u4E0D\u80FD\u4E3A\u7A7A"));for(const zn of an){const{answer_text:gi}=zn||{};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()}}]},(gn,{add:an,remove:zn},{errors:gi})=>(ni.current=an,Ke.current=zn,te.createElement(te.Fragment,null,te.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"}},te.createElement(le.default.Item,{label:"\u586B\u7A7A\u9879\u7B54\u6848",required:!0,labelCol:{span:24}}),te.createElement("div",{onClick:()=>{we.default.warning({title:"\u7ED9\u5206\u8BF4\u660E",icon:null,width:700,centered:!0,content:te.createElement("div",null,te.createElement("div",null,"1.\u5B66\u751F\u586B\u5199\u7B54\u6848\u4E4B\u540E\uFF0C\u5FC5\u987B\u63D0\u4EA4\u4EE3\u7801",te.createElement("span",{style:{color:"#e30000"}},"\u8FDB\u884C\u8BC4\u6D4B"),"\u624D\u80FD\u5F97\u5206\u3002"),te.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"}},te.createElement(pn.Z,{style:{marginRight:3,color:"#3061D0"}}),te.createElement("span",null," \u7ED9\u5206\u8BF4\u660E"))),gn.map((ti,wi)=>{var Wi=ti,{key:Cn,name:Pn}=Wi,Bn=he(Wi,["key","name"]),si,Ei;return te.createElement(ue.Z,{className:"mb20",key:Cn,align:"middle",wrap:!1},te.createElement(Dt.Z,{flex:"0 0 auto",className:`${ae.Z.blankIndex}`},"\u586B\u7A7A\u9879",wi+1),te.createElement(Dt.Z,{flex:1},te.createElement(ue.Z,{align:"top",justify:"space-between",wrap:!1},te.createElement(Dt.Z,null,te.createElement(le.default.Item,Me(Vn({},Bn),{name:[Pn,"answer_text"],noStyle:!0}),(si=Qn==null?void 0:Qn[Pn])!=null&&si.multi_line||(Ei=Qn==null?void 0:Qn[Pn])!=null&&Ei.multiLine?te.createElement(Ce,{spellCheck:!1,style:{marginLeft:10,width:550}}):te.createElement(Kt.default,{style:{marginLeft:10,width:550},className:ae.Z.blankInput,size:"large",maxLength:1e3,onBlur:ci=>{}}))),Mt&&te.createElement(Dt.Z,{flex:"224px"},te.createElement(le.default.Item,Me(Vn({},Bn),{name:[Pn,"score"],label:"\u5206\u503C",rules:[{required:!0}]}),te.createElement(ee.Z,{size:"large",className:ae.Z.blankInput,min:.1,max:100,precision:1,style:{width:"100%"},placeholder:"\u8BF7\u8F93\u5165\u5206\u503C"}))))))})))),te.createElement("div",{onClick:()=>Xe(!0)},te.createElement(le.default.Item,{name:["hack","analysis"],label:"\u9898\u76EE\u89E3\u6790",labelCol:{span:24}},te.createElement(jt.x,{placeholder:"\u8BF7\u7F16\u8F91\u9898\u76EE\u89E3\u6790\uFF08\u975E\u5FC5\u586B\uFF09",isEdit:_e}))),te.createElement(le.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"}]},te.createElement(pe.default,{size:"large"},Yn.map(gn=>te.createElement(pe.default.Option,{key:gn.title,value:gn.key}," ",gn.title)))),te.createElement(le.default.Item,{label:"\u6700\u5927\u8BC4\u6D4B\u65F6\u957F\uFF08\u79D2\uFF09",style:{marginTop:30},labelCol:{span:24},required:!0},te.createElement(le.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},te.createElement(ee.Z,{precision:0,max:10,min:3,size:"large",style:{width:"97%"}})),te.createElement("span",{className:"ml10 font14"},"\u79D2")),te.createElement(le.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"}]},te.createElement(Jt.ZP.Group,{style:{marginTop:-10}},te.createElement(Jt.ZP,{value:0},"\u4E0D\u5FFD\u7565\u7A7A\u683C"),te.createElement(Jt.ZP,{value:1},"\u5FFD\u7565\u9996\u5C3E\u7A7A\u683C"),te.createElement(Jt.ZP,{value:2},"\u5FFD\u7565\u6240\u6709\u7A7A\u683C"))),te.createElement(le.default.Item,{label:"\u6D4B\u8BD5\u7528\u4F8B",required:!0,style:{marginTop:30}}),te.createElement("div",{style:{background:"#F6F7F9",padding:15}},te.createElement(le.default.Item,{label:"\u8F93\u5165",labelCol:{span:24},name:["hack_sets","input"]},te.createElement(Ce,{rows:4})),te.createElement(le.default.Item,{label:"\u8F93\u51FA",labelCol:{span:24},name:["hack_sets","output"],rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u8F93\u51FA\u5185\u5BB9"}]},te.createElement(Ce,{rows:4}))),te.createElement(qe,{form:zt,answerKey:He,hackIdentifier:Yt,buttonText:"\u8FD0\u884C\u8C03\u8BD5",buttonProps:{ghost:!0,icon:te.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(Mn,Rn,kt){"use strict";kt.d(Rn,{u:function(){return At}});var ft=kt(59301),Kt=kt(77019),le=kt(5269),we=kt(25399),ue=kt(28284),Dt=kt(8423),ee=kt(32134),pe=kt(12893),Jt=kt(31457),jt=kt(59301),De=Object.defineProperty,ae=Object.defineProperties,Le=Object.getOwnPropertyDescriptors,Bt=Object.getOwnPropertySymbols,nt=Object.prototype.hasOwnProperty,et=Object.prototype.propertyIsEnumerable,ht=(It,qt,Ut)=>qt in It?De(It,qt,{enumerable:!0,configurable:!0,writable:!0,value:Ut}):It[qt]=Ut,st=(It,qt)=>{for(var Ut in qt||(qt={}))nt.call(qt,Ut)&&ht(It,Ut,qt[Ut]);if(Bt)for(var Ut of Bt(qt))et.call(qt,Ut)&&ht(It,Ut,qt[Ut]);return It},pt=(It,qt)=>ae(It,Le(qt)),vt=(It,qt)=>{var Ut={};for(var Gt in It)nt.call(It,Gt)&&qt.indexOf(Gt)<0&&(Ut[Gt]=It[Gt]);if(It!=null&&Bt)for(var Gt of Bt(It))qt.indexOf(Gt)<0&&et.call(It,Gt)&&(Ut[Gt]=It[Gt]);return Ut};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:It,onChange:qt,choiceTextKey:Ut,answerKey:Gt,index:ge,isEdit:ie,setInputActive:Te,form:ve,choiceOptionsPath:ye,allowChangeMode:Ye,showAddIcon:Ze,addItem:qe,deleteItem:pn})=>{console.log(It,"value");const te=(It==null?void 0:It[Gt])===1,Xt=()=>{const On=ve.getFieldValue(ye);ve.setFieldValue(ye,On.map(En=>pt(st({},En),{[Gt]:0})))},Qe=()=>{te?qt(pt(st({},It),{[Gt]:0})):(Ye||Xt(),qt(pt(st({},It),{[Gt]:1})))};return jt.createElement(Kt.Z,{className:Dt.Z.choiceWrap,align:"middle",wrap:!1},jt.createElement(le.Z,{onClick:Qe,className:`${Dt.Z.choiceIndex} ${te?Dt.Z.activeAnswer:""}`},St[ge]),jt.createElement(le.Z,{flex:1,className:`${Dt.Z.editorWrap} ml15`,onClick:Te},jt.createElement(Jt.x,{height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9009\u9879",isEdit:ie,value:It==null?void 0:It[Ut],onChange:On=>{qt(pt(st({},It),{[Ut]:On}))}})),jt.createElement(le.Z,{flex:"0 0 auto",className:"ml15"},jt.createElement("div",{onClick:Qe,className:`${Dt.Z.setAnswerBtn} ${te?Dt.Z.activeAnswer:""}`},te?"\u6B63\u786E\u7B54\u6848":"\u8BBE\u4E3A\u7B54\u6848")),jt.createElement(le.Z,{className:Dt.Z.actionWrapper},jt.createElement(we.Z,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},jt.createElement(ee.Z,{className:Dt.Z.addIcon,onClick:qe,style:{visibility:Ze?"visible":"hidden"}})),jt.createElement(we.Z,{title:"\u5220\u9664"},jt.createElement(pe.Z,{className:Dt.Z.deleteIcon,onClick:pn,style:{visibility:ge>1?"visible":"hidden"}}))))},At=({questionTitlePlaceholder:It,titleKey:qt,choiceKey:Ut,analysisKey:Gt,choiceTextKey:ge,answerKey:ie,choiceOptionsPath:Te,allowChangeMode:ve=!0,form:ye,showAnalysis:Ye=!0})=>{const[Ze,qe]=(0,ft.useState)(),[pn,te]=(0,ft.useState)(!1);return jt.createElement("div",{className:Dt.Z.wrap},jt.createElement("div",{className:Dt.Z.questionTitleEditorWrap},jt.createElement(ue.default.Item,{label:"\u9898\u5E72",name:qt,labelCol:{span:24},rules:[{required:!0}]},jt.createElement(Jt.h,{scrollId:Array.isArray(qt)?qt.join("_"):`${qt}`,watch:!0,height:140,placeholder:It}))),jt.createElement(ue.default.Item,{label:"\u7B54\u6848\u9009\u9879",required:!0,labelCol:{span:24}}),jt.createElement(ue.default.List,{name:Ut,rules:[{validator(Xt,Qe){const On=Qe.some(Ie=>Ie[ie]===1),En=Qe.findIndex(Ie=>{var on;return((on=Ie[ge])==null?void 0:on.length)<=0});return En!==-1?Promise.reject(new Error(`\u8BF7\u5148\u8F93\u5165${St[En]}\u9009\u9879\u7684\u5185\u5BB9`)):On?Promise.resolve():Promise.reject(new Error("\u8BF7\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))}}]},(Xt,{add:Qe,remove:On})=>jt.createElement("div",{id:Array.isArray(Te)?Te.join("_"):`${Te}`},Xt.map((En,Ie)=>{var on=En,{key:cn,name:Vn}=on,Me=vt(on,["key","name"]);const he=Ze===cn,Ce=()=>{qe(cn)},Yn=Ie<7&&Ie===Xt.length-1,Si=()=>Qe({[ge]:"",[ie]:0}),Rt=()=>On(Vn);return jt.createElement(ue.default.Item,pt(st({},Me),{key:cn,name:Vn,className:Dt.Z.choiceListWrap,rules:[{validator(Ft,Pt){return Pt!=null&&Pt.choice_text?Promise.resolve():Promise.reject(new Error(`\u8BF7\u5148\u8F93\u5165${St[Ie]}\u9009\u9879\u7684\u5185\u5BB9`))}}]}),jt.createElement(Et,{choiceTextKey:ge,answerKey:ie,index:Ie,isEdit:he,setInputActive:Ce,form:ye,choiceOptionsPath:Te,allowChangeMode:ve,showAddIcon:Yn,addItem:Si,deleteItem:Rt}))}),Xt.length<8&&jt.createElement("div",{className:`${Dt.Z.addBtn} mb30`,onClick:()=>Qe({[ge]:"",[ie]:0})},"\u6DFB\u52A0\u9009\u9879"))),Ye&&jt.createElement("div",{onClick:()=>te(!0)},jt.createElement(ue.default.Item,{name:Gt,label:"\u9898\u76EE\u89E3\u6790",labelCol:{span:24}},jt.createElement(Jt.x,{placeholder:"\u8BF7\u7F16\u8F91\u9898\u76EE\u89E3\u6790\uFF08\u975E\u5FC5\u586B\uFF09",isEdit:pn}))))}},92046:function(Mn,Rn,kt){"use strict";kt.d(Rn,{u:function(){return ve}});var ft=kt(59301),Kt=kt(62957),le=kt(77019),we=kt(5269),ue=kt(37568),Dt=kt(25399),ee=kt(71411),pe=kt(28284),Jt=kt(47889),jt=kt(71051),De=kt(31457),ae=kt(12893),Le=kt(61485),Bt=kt(8423),nt=kt(19105),et=kt(59301),ht=Object.defineProperty,st=Object.defineProperties,pt=Object.getOwnPropertyDescriptors,vt=Object.getOwnPropertySymbols,St=Object.prototype.hasOwnProperty,Et=Object.prototype.propertyIsEnumerable,At=(ye,Ye,Ze)=>Ye in ye?ht(ye,Ye,{enumerable:!0,configurable:!0,writable:!0,value:Ze}):ye[Ye]=Ze,It=(ye,Ye)=>{for(var Ze in Ye||(Ye={}))St.call(Ye,Ze)&&At(ye,Ze,Ye[Ze]);if(vt)for(var Ze of vt(Ye))Et.call(Ye,Ze)&&At(ye,Ze,Ye[Ze]);return ye},qt=(ye,Ye)=>st(ye,pt(Ye)),Ut=(ye,Ye)=>{var Ze={};for(var qe in ye)St.call(ye,qe)&&Ye.indexOf(qe)<0&&(Ze[qe]=ye[qe]);if(ye!=null&&vt)for(var qe of vt(ye))Ye.indexOf(qe)<0&&Et.call(ye,qe)&&(Ze[qe]=ye[qe]);return Ze};const Gt=({value:ye,onChange:Ye})=>{const Ze=pn=>{Kt.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 te=[...ye];te.splice(pn,1),Ye(te)}})},qe=()=>{const pn=[...ye];pn.push(""),Ye(pn)};return et.createElement(le.Z,{className:"ml20"},et.createElement(we.Z,{flex:1},ye==null?void 0:ye.map((pn,te)=>et.createElement(le.Z,{key:`${pn}_${te}`,className:"mb20"},et.createElement(ue.default.TextArea,{style:{flex:1,minHeight:44},defaultValue:pn,autoSize:{maxRows:3},maxLength:1e3,onBlur:Xt=>{const Qe=[...ye],On=Xt.target.value.trim();Qe[te]=On,Ye(Qe)}}),et.createElement(Dt.Z,{title:"\u5220\u9664"},et.createElement(ae.Z,{className:Bt.Z.deleteIcon,style:{marginLeft:15,visibility:te>0?"visible":"hidden"},onClick:()=>Ze(te)}))))),et.createElement(we.Z,null,et.createElement("div",{className:`${Bt.Z.addBtn}`,onClick:()=>{qe()}},"\u65B0\u589E\u7B54\u6848")))},ge=({value:ye,onChange:Ye})=>{const Ze=pn=>{Kt.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 te=[...ye];te.splice(pn,1),Ye(te)}})},qe=()=>{const pn=[...ye];pn.push(""),Ye(pn)};return et.createElement(le.Z,{className:"ml20"},et.createElement(we.Z,{flex:1},ye==null?void 0:ye.map((pn,te)=>et.createElement(le.Z,{key:`${pn}_${te}`,align:"middle",className:"mb20"},et.createElement(nt.Z,{value:pn,style:{flex:1},onChange:Xt=>{const Qe=[...ye];Qe[te]=Xt,Ye(Qe)}}),et.createElement(Dt.Z,{title:"\u5220\u9664"},et.createElement(ae.Z,{className:Bt.Z.deleteIcon,style:{marginLeft:15,visibility:te>0?"visible":"hidden"},onClick:()=>Ze(te)}))))),et.createElement(we.Z,null,et.createElement("div",{className:`${Bt.Z.addBtn}`,onClick:()=>{qe()}},"\u65B0\u589E\u7B54\u6848")))},ie=({value:ye=!0,onChange:Ye})=>et.createElement(ee.Z,{checked:!ye,onChange:Ze=>{Ye(!Ze)}}),Te="\u2581",ve=({questionTitlePlaceholder:ye,form:Ye,scoreByBlank:Ze=!1,answerKey:qe})=>{const[pn,te]=(0,ft.useState)(!1),Xt=(Me,he)=>{const Ce=he.line;let Yn=0;for(let Rt=0;Rt<Ce;Rt++)Yn+=Me.getLine(Rt).split(Te).length-1;const Si=Me.getLine(Ce).substring(0,he.ch);return Yn+=Si.split(Te).length-1,Yn},Qe=(Me,he,Ce,Yn)=>{const Si=Me.getRange(he.from,he.to);let Rt=0;if(he.text.forEach(Ft=>{Rt+=Ft.split(Te).length-1}),he.origin!=="setValue"){if(Si&&Si.indexOf(Te)!==-1){const Ft=Si.split(Te).length-1,Pt=Xt(Me,he.from);if(console.log(`\u5220\u9664${Ft}\u4E2A\uFF0C \u524D\u9762\u6709${Pt}\u4E2A\uFF0C\u65B0\u589E${Rt}\u4E2A`),Ft>1){const Nt=Array.from({length:Ft},(zt,Mt)=>Pt+Mt);Yn(Nt)}else Yn(Pt)}else if(Rt>0){const Ft=Xt(Me,he.from);console.log(`\u65B0\u589E${Rt}\u4E2A\uFF0C\u4E4B\u524D\u6709${Ft}\u4E2A`),Ce(Rt,Ft)}}},On=()=>{const Me=Ye.getFieldValue(qe);Ye.setFieldsValue({[qe]:Me.map((he,Ce)=>qt(It({},he),{position:Ce+1}))})},En=(0,ft.useRef)(),Ie=(Me,he)=>{for(let Ce=0;Ce<Me;Ce++)En.current({position:null,answer_text:[""],model:1},he+Ce);On()},on=(0,ft.useRef)(),cn=Me=>{on.current(Me),On()},Vn=pe.default.useWatch(qe,Ye);return et.createElement("div",{className:Bt.Z.wrap},et.createElement("div",{className:Bt.Z.questionTitleEditorWrap},et.createElement(pe.default.Item,{label:"\u9898\u5E72",name:"name",labelCol:{span:24},rules:[{required:!0}]},et.createElement(De.h,{scrollId:"name",watch:!0,height:140,placeholder:ye,showNullButton:!0,onCMBeforeChange:(Me,he)=>{Qe(Me,he,Ie,cn)}}))),et.createElement(pe.default.List,{name:qe,rules:[{validator(Me,he){if(!(he!=null&&he.length))return Promise.reject(new Error("\u8BF7\u5148\u5728\u9898\u5E72\u4E2D\u63D2\u5165\u586B\u7A7A\u9879"));for(const Ce of he){const{answer_text:Yn}=Ce||{};if(Yn!=null&&Yn.some(Si=>(Si==null?void 0:Si.length)===0))return Promise.reject(new Error("\u586B\u7A7A\u9879\u7B54\u6848\u4E0D\u80FD\u4E3A\u7A7A"))}return Promise.resolve()}}]},(Me,{add:he,remove:Ce},{errors:Yn})=>(En.current=he,on.current=Ce,et.createElement(et.Fragment,null,et.createElement(pe.default.Item,{label:et.createElement("span",null,"\u586B\u7A7A\u9879\u7B54\u6848",!(Me!=null&&Me.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}}),Me.map((Si,Rt)=>{var Ft=Si,{key:Pt,name:Nt}=Ft,zt=Ut(Ft,["key","name"]),Mt,Yt;return et.createElement("div",{style:{marginBottom:10},key:Pt},et.createElement(le.Z,{className:"mb20",align:"middle",wrap:!1},et.createElement(we.Z,{style:{marginRight:10},flex:"0 0 auto",className:`${Bt.Z.blankIndex}`},"\u586B\u7A7A\u9879",Rt+1),et.createElement(pe.default.Item,qt(It({},zt),{name:[Nt,"model"],noStyle:!0}),et.createElement(Jt.ZP.Group,{onChange:()=>{const He=Ye.getFieldValue(qe);Ye.setFieldsValue({[qe]:He.map((_e,Xe)=>qt(It({},_e),{answer_text:Nt===Xe?[""]:_e.answer_text}))})}},et.createElement(Jt.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(Le.Z,null))),et.createElement(Jt.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(Le.Z,null)))))),et.createElement(le.Z,{style:{marginLeft:20},align:"middle",wrap:!1},et.createElement(we.Z,{flex:1},et.createElement(le.Z,{align:"top",justify:"space-between",wrap:!1},et.createElement(we.Z,{flex:1},et.createElement(pe.default.Item,qt(It({},zt),{name:[Nt,"answer_text"],noStyle:!0}),((Yt=(Mt=Ye.getFieldValue(qe))==null?void 0:Mt[Nt])==null?void 0:Yt.model)===1?et.createElement(Gt,null):et.createElement(ge,null))),Ze&&et.createElement(we.Z,{flex:"224px",style:{margin:"-7px 0 0 20px"}},et.createElement(pe.default.Item,qt(It({},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(pe.default.Item,qt(It({},zt),{name:[Nt,"position"],noStyle:!0}),et.createElement(ue.default,{type:"hidden"})))))})))),et.createElement(le.Z,{align:"middle"},et.createElement(pe.default.Item,{name:"downcase",valuePropName:"checked"},et.createElement(ee.Z,null)),et.createElement(we.Z,{className:"ml10"},"\u5224\u5206\u65F6\u5FFD\u7565\u7B54\u6848\u4E2D\u7684\u5B57\u6BCD\u5927\u5C0F\u5199")),et.createElement(le.Z,{align:"middle"},et.createElement(pe.default.Item,{name:"no_space",valuePropName:"checked"},et.createElement(ee.Z,null)),et.createElement(we.Z,{className:"ml10"},"\u5224\u5206\u65F6\u5FFD\u7565\u7B54\u6848\u4E2D\u7684\u7A7A\u683C")),(Vn==null?void 0:Vn.length)>1&&et.createElement(le.Z,{align:"middle",className:(Vn==null?void 0:Vn.length)>1?"mb30":`${Bt.Z.hide}`},et.createElement(pe.default.Item,{name:"is_ordered"},et.createElement(ie,null)),et.createElement(we.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:()=>te(!0)},et.createElement(pe.default.Item,{name:"analysis",label:"\u9898\u76EE\u89E3\u6790",labelCol:{span:24}},et.createElement(De.x,{placeholder:"\u8BF7\u7F16\u8F91\u9898\u76EE\u89E3\u6790\uFF08\u975E\u5FC5\u586B\uFF09",isEdit:pn}))))}},14289:function(Mn,Rn,kt){"use strict";kt.d(Rn,{Z:function(){return vt}});var ft=kt(59301),Kt=kt(77019),le=kt(5269),we=kt(28284),ue=kt(8423),Dt=kt(31457),ee=kt(59301),pe=Object.defineProperty,Jt=Object.defineProperties,jt=Object.getOwnPropertyDescriptors,De=Object.getOwnPropertySymbols,ae=Object.prototype.hasOwnProperty,Le=Object.prototype.propertyIsEnumerable,Bt=(St,Et,At)=>Et in St?pe(St,Et,{enumerable:!0,configurable:!0,writable:!0,value:At}):St[Et]=At,nt=(St,Et)=>{for(var At in Et||(Et={}))ae.call(Et,At)&&Bt(St,At,Et[At]);if(De)for(var At of De(Et))Le.call(Et,At)&&Bt(St,At,Et[At]);return St},et=(St,Et)=>Jt(St,jt(Et)),ht=(St,Et)=>{var At={};for(var It in St)ae.call(St,It)&&Et.indexOf(It)<0&&(At[It]=St[It]);if(St!=null&&De)for(var It of De(St))Et.indexOf(It)<0&&Le.call(St,It)&&(At[It]=St[It]);return At};const st={\u6B63\u786E:"T",\u9519\u8BEF:"F"},pt=({value:St,onChange:Et,form:At})=>{const It=(St==null?void 0:St.is_answer)===1,qt=St==null?void 0:St.choice_text,Ut=()=>{const Gt=At.getFieldsValue().choices.map(ge=>({choice_text:ge.choice_text,is_answer:0}));At.setFieldsValue({choices:Gt}),Et(et(nt({},St),{is_answer:1}))};return ee.createElement(Kt.Z,{className:ue.Z.choiceWrap,align:"middle",wrap:!1,style:{marginBottom:"20px"}},ee.createElement(le.Z,{onClick:Ut,className:`${ue.Z.choiceIndex} ${ue.Z.judgementIndex} ${It?ue.Z.activeAnswer:""}`},st[qt]),ee.createElement(le.Z,{flex:1,className:`${ue.Z.editorWrap} ml15`},ee.createElement("div",{className:`${ue.Z.inputBorder} ${ue.Z.placeholder} ${It?ue.Z.activeJudgementAnswer:""}`},qt)),ee.createElement(le.Z,{flex:"0 0 auto",className:"ml15"},ee.createElement("div",{onClick:Ut,className:`${ue.Z.setAnswerBtn} ${It?ue.Z.activeAnswer:""}`},It?"\u6B63\u786E\u7B54\u6848":"\u8BBE\u4E3A\u7B54\u6848")))},vt=({questionTitlePlaceholder:St,choiceKey:Et,form:At})=>{const[It,qt]=(0,ft.useState)(!1);return ee.createElement("div",{className:ue.Z.wrap},ee.createElement("div",{className:ue.Z.questionTitleEditorWrap},ee.createElement(we.default.Item,{label:"\u9898\u5E72",name:"name",labelCol:{span:24},rules:[{required:!0}]},ee.createElement(Dt.h,{scrollId:"name",watch:!0,height:140,placeholder:St}))),ee.createElement(we.default.Item,{label:"\u7B54\u6848\u9009\u9879",required:!0,labelCol:{span:24}},ee.createElement(we.default.List,{name:"choices",rules:[{validator(Ut,Gt){return Gt.some(ie=>(ie==null?void 0:ie.is_answer)===1)?Promise.resolve():Promise.reject(new Error("\u8BF7\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))}}]},Ut=>ee.createElement("div",{id:"choices"},Ut.map(Gt=>{var ge=Gt,{key:ie,name:Te}=ge,ve=ht(ge,["key","name"]);return ee.createElement(we.default.Item,et(nt({},ve),{key:ie,name:Te,noStyle:!0}),ee.createElement(pt,{form:At}))})))),ee.createElement("div",{onClick:()=>qt(!0)},ee.createElement(we.default.Item,{name:"analysis",label:"\u9898\u76EE\u89E3\u6790",labelCol:{span:24}},ee.createElement(Dt.x,{placeholder:"\u8BF7\u7F16\u8F91\u9898\u76EE\u89E3\u6790\uFF08\u975E\u5FC5\u586B\uFF09",isEdit:It}))))}},31457:function(Mn,Rn,kt){"use strict";kt.d(Rn,{h:function(){return nt},x:function(){return et}});var ft=kt(39793),Kt=kt(8423),le=kt(76902),we=kt(59301),ue=Object.defineProperty,Dt=Object.defineProperties,ee=Object.getOwnPropertyDescriptors,pe=Object.getOwnPropertySymbols,Jt=Object.prototype.hasOwnProperty,jt=Object.prototype.propertyIsEnumerable,De=(ht,st,pt)=>st in ht?ue(ht,st,{enumerable:!0,configurable:!0,writable:!0,value:pt}):ht[st]=pt,ae=(ht,st)=>{for(var pt in st||(st={}))Jt.call(st,pt)&&De(ht,pt,st[pt]);if(pe)for(var pt of pe(st))jt.call(st,pt)&&De(ht,pt,st[pt]);return ht},Le=(ht,st)=>Dt(ht,ee(st)),Bt=(ht,st)=>{var pt={};for(var vt in ht)Jt.call(ht,vt)&&st.indexOf(vt)<0&&(pt[vt]=ht[vt]);if(ht!=null&&pe)for(var vt of pe(ht))st.indexOf(vt)<0&&jt.call(ht,vt)&&(pt[vt]=ht[vt]);return pt};const nt=ht=>{var st=ht,{value:pt,onChange:vt,scrollId:St}=st,Et=Bt(st,["value","onChange","scrollId"]);return we.createElement("div",{id:St||""},we.createElement(ft.Z,Le(ae({},Et),{defaultValue:pt,onChange:(At,It)=>{It!=null&&It.length?vt(At,It):vt(At)}})))},et=({value:ht,onChange:st,placeholder:pt,height:vt=140,isEdit:St,miniToolbar:Et,watch:At=!0})=>St?we.createElement(ft.Z,{watch:At,isFocus:!0,height:vt||void 0,placeholder:pt,defaultValue:ht,onChange:st,miniToolbar:Et}):we.createElement("div",{style:{cursor:"pointer"}},ht?we.createElement(le.Z,{className:Kt.Z.inputBorder,value:ht}):we.createElement("div",{className:`${Kt.Z.inputBorder} ${Kt.Z.placeholder} inputBorderError`},pt))},44272:function(Mn,Rn,kt){"use strict";kt.d(Rn,{W:function(){return ge}});var ft=kt(59301),Kt=kt(6767),le=kt(96599),we=kt(28284),ue=kt(71411),Dt=kt(77019),ee=kt(5269),pe=kt(25399),Jt=kt(37568),jt=kt(71051),De=kt(8423),ae=kt(31457),Le=kt(39793),Bt=kt(61485),nt=Object.defineProperty,et=Object.defineProperties,ht=Object.getOwnPropertyDescriptors,st=Object.getOwnPropertySymbols,pt=Object.prototype.hasOwnProperty,vt=Object.prototype.propertyIsEnumerable,St=(ie,Te,ve)=>Te in ie?nt(ie,Te,{enumerable:!0,configurable:!0,writable:!0,value:ve}):ie[Te]=ve,Et=(ie,Te)=>{for(var ve in Te||(Te={}))pt.call(Te,ve)&&St(ie,ve,Te[ve]);if(st)for(var ve of st(Te))vt.call(Te,ve)&&St(ie,ve,Te[ve]);return ie},At=(ie,Te)=>et(ie,ht(Te)),It=(ie,Te)=>{var ve={};for(var ye in ie)pt.call(ie,ye)&&Te.indexOf(ye)<0&&(ve[ye]=ie[ye]);if(ie!=null&&st)for(var ye of st(ie))Te.indexOf(ye)<0&&vt.call(ie,ye)&&(ve[ye]=ie[ye]);return ve};const qt=ie=>{var Te=ie,{value:ve,onChange:ye}=Te,Ye=It(Te,["value","onChange"]);const Ze=qe=>{ye([qe])};return ft.createElement(Le.Z,At(Et({},Ye),{defaultValue:ve==null?void 0:ve[0],onChange:Ze}))},Ut=ie=>{if(!ie)return!1;if(/^s*$/.test(ie)||ie.trim()===""){Kt.ZP.warning("\u5173\u952E\u8BCD\u4E0D\u80FD\u5168\u4E3A\u7A7A\u683C");return}let Te=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==="|"?(Kt.ZP.warning("\u5173\u952E\u8BCD\u4E0D\u80FD\u53EA\u8F93\u5165\u4E00\u4E2A\u201C|\u201D\u5B57\u7B26\uFF01"),!1):!0},Gt=({value:ie=[],onClose:Te})=>ft.createElement(le.default,{closable:!0,onClose:Te,className:De.Z.keywordTag},ft.createElement("pre",{style:{margin:"0px",whiteSpace:"pre-wrap"}},ie.join(" \u6216 "))),ge=({questionTitlePlaceholder:ie,form:Te,showKeywords:ve,isMustKeyWords:ye=ve})=>{const[Ye,Ze]=(0,ft.useState)(!1),[qe,pn]=(0,ft.useState)(""),te=we.default.useWatch("use_keywords",Te),Xt=we.default.useWatch("question_score",Te);return ft.createElement("div",{className:De.Z.wrap},ft.createElement("div",{className:De.Z.questionTitleEditorWrap},ft.createElement(we.default.Item,{label:"\u9898\u5E72",name:"name",labelCol:{span:24},rules:[{required:!0}]},ft.createElement(ae.h,{scrollId:"name",watch:!0,height:140,placeholder:ie}))),ft.createElement(we.default.Item,{label:"\u53C2\u8003\u7B54\u6848",name:"answer_texts",labelCol:{span:24}},ft.createElement(qt,{watch:!0,height:140,placeholder:"\u8BF7\u7F16\u8F91\u53C2\u8003\u7B54\u6848\uFF08\u975E\u5FC5\u586B\uFF09"})),ve&&!ye&&ft.createElement(we.default.Item,{hidden:!0,name:"use_keywords",valuePropName:"checked"},ft.createElement(ue.Z,{defaultChecked:!0})),ve&&ye&&ft.createElement(Dt.Z,{align:"middle",className:"mb30"},ft.createElement(we.default.Item,{name:"use_keywords",valuePropName:"checked"},ft.createElement(ue.Z,null)),ft.createElement(ee.Z,{className:"ml10"},"\u5F00\u542F\u5173\u952E\u8BCD\u81EA\u52A8\u5224\u5206"),ft.createElement(ee.Z,null,ft.createElement(pe.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"},ft.createElement(Bt.Z,{style:{color:"#3061D0",marginLeft:6,cursor:"pointer"}})))),(te||!ye)&&ft.createElement(we.default.List,{name:"keywords",rules:[{validator(Qe,On){return ye?On!=null&&On.length?(On==null?void 0:On.reduce((Ie,on)=>Ie+on.score,0))>parseFloat(Xt)?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()}}]},(Qe,{add:On,remove:En})=>ft.createElement(ft.Fragment,null,ft.createElement("div",{className:`${De.Z.title} mb10`},ye?"\u5173\u952E\u8BCD":ft.createElement("span",{style:{color:"#9096A3"}},"\u5224\u5206\u5173\u952E\u8BCD")),ft.createElement(Dt.Z,{align:"middle",className:"font14 mb30"},ft.createElement(ee.Z,{flex:1},ft.createElement(Jt.default,{value:qe,onChange:Ie=>{pn(Ie.target.value)},maxLength:50,allowClear:!0,onPressEnter:Ie=>{var on,cn,Vn,Me;const he=`${(on=Ie.target)==null?void 0:on.value}`,Ce=(Vn=(cn=he==null?void 0:he.split("|"))==null?void 0:cn.filter(Rt=>!!Rt))==null?void 0:Vn.map(Rt=>Rt==null?void 0:Rt.trim()),Yn=Te.getFieldValue("keywords"),Si=((Me=Yn==null?void 0:Yn.map(Rt=>Rt==null?void 0:Rt.keyword))==null?void 0:Me.flat())||[];for(const Rt of Ce)if(Si.includes(Rt)){Kt.ZP.error("\u4E3A\u907F\u514D\u5224\u5206\u9519\u8BEF\uFF0C\u8BF7\u52FF\u8BBE\u7F6E\u76F8\u540C\u7684\u5173\u952E\u8BCD");return}Ut(he)&&(On({keyword:Ce,score:1}),pn(""))},className:De.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"})),ft.createElement(ee.Z,{flex:"148px",style:{textAlign:"right",color:"#e99237"}},"\u201C\u56DE\u8F66\u952E\u201D\u4FDD\u5B58\u5173\u952E\u8BCD")),Qe.map(Ie=>{var on=Ie,{key:cn,name:Vn}=on,Me=It(on,["key","name"]);return ft.createElement(Dt.Z,{key:cn,className:"mb20",style:{marginRight:148}},ft.createElement(ee.Z,{flex:1},ft.createElement(Dt.Z,{align:"middle",justify:"space-between"},ft.createElement(we.default.Item,At(Et({},Me),{name:[Vn,"keyword"]}),ft.createElement(Gt,{onClose:()=>En(Vn)})),ye&&ft.createElement(we.default.Item,At(Et({},Me),{name:[Vn,"score"],label:"\u5206\u503C",rules:[{required:!0}],className:De.Z.blankInputNumberWrapper}),ft.createElement(jt.Z,{className:De.Z.blankInput,min:.1,max:100,precision:1,style:{width:"100%"},placeholder:"\u8BF7\u8F93\u5165\u5173\u952E\u8BCD\u5206\u6570"})))))}))),ft.createElement("div",{onClick:()=>Ze(!0)},ft.createElement(we.default.Item,{name:"analysis",label:"\u9898\u76EE\u89E3\u6790",labelCol:{span:24}},ft.createElement(ae.x,{placeholder:"\u8BF7\u7F16\u8F91\u9898\u76EE\u89E3\u6790\uFF08\u975E\u5FC5\u586B\uFF09",isEdit:Ye}))))}},77762:function(Mn,Rn,kt){"use strict";kt.d(Rn,{tc:function(){return Wi.t},uh:function(){return ft.u},rL:function(){return wi},u8:function(){return le.u},ZZ:function(){return Kt.Z},Wk:function(){return we.W}});var ft=kt(81727),Kt=kt(14289),le=kt(92046),we=kt(44272),ue=kt(59301),Dt=kt(8848),ee=kt(28284),pe=kt(77019),Jt=kt(5269),jt=kt(71051),De=kt(25399),ae=kt(75727),Le=kt(8423),Bt=kt(12893),nt=kt(31457),et=kt(62957),ht=kt(37568),st=kt(71411),pt=kt(59301),vt=Object.defineProperty,St=Object.defineProperties,Et=Object.getOwnPropertyDescriptors,At=Object.getOwnPropertySymbols,It=Object.prototype.hasOwnProperty,qt=Object.prototype.propertyIsEnumerable,Ut=(Cn,Pn,Bn)=>Pn in Cn?vt(Cn,Pn,{enumerable:!0,configurable:!0,writable:!0,value:Bn}):Cn[Pn]=Bn,Gt=(Cn,Pn)=>{for(var Bn in Pn||(Pn={}))It.call(Pn,Bn)&&Ut(Cn,Bn,Pn[Bn]);if(At)for(var Bn of At(Pn))qt.call(Pn,Bn)&&Ut(Cn,Bn,Pn[Bn]);return Cn},ge=(Cn,Pn)=>St(Cn,Et(Pn)),ie=(Cn,Pn)=>{var Bn={};for(var si in Cn)It.call(Cn,si)&&Pn.indexOf(si)<0&&(Bn[si]=Cn[si]);if(Cn!=null&&At)for(var si of At(Cn))Pn.indexOf(si)<0&&qt.call(Cn,si)&&(Bn[si]=Cn[si]);return Bn};const Te=({value:Cn,onChange:Pn})=>{const Bn=Ei=>{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:Le.Z.modal,onOk:()=>{const ci=[...Cn];ci.splice(Ei,1),Pn(ci)}})},si=()=>{const Ei=[...Cn];Ei.push(""),Pn(Ei)};return pt.createElement(pe.Z,{className:"ml20"},pt.createElement(Jt.Z,{flex:1},Cn==null?void 0:Cn.map((Ei,ci)=>pt.createElement(pe.Z,{key:`${Ei}_${ci}`,align:"middle",className:"mb20"},pt.createElement(ht.default.TextArea,{style:{flex:1,minHeight:44},defaultValue:Ei,autoSize:{maxRows:3},maxLength:1e3,onBlur:Zi=>{const wt=[...Cn],Je=Zi.target.value.trim();wt[ci]=Je,Pn(wt)}}),pt.createElement(De.Z,{title:"\u5220\u9664"},pt.createElement(Bt.Z,{className:Le.Z.deleteIcon,style:{marginLeft:15,visibility:ci>0?"visible":"hidden"},onClick:()=>Bn(ci)}))))),pt.createElement(Jt.Z,null,pt.createElement("div",{className:`${Le.Z.addBtn}`,onClick:()=>{si()}},"\u65B0\u589E\u7B54\u6848")))},ve=({value:Cn=!0,onChange:Pn})=>pt.createElement(st.Z,{checked:!Cn,onChange:Bn=>{Pn(!Bn)}}),ye="\u2581",Ye=({questionTitlePlaceholder:Cn,form:Pn,name:Bn,scoreByBlank:si=!1,answerKey:Ei,titleKey:ci="name",analysisKey:Zi="analysis",isOrdered:wt="is_ordered"})=>{var Je,Hn;const[Ln,jn]=(0,ue.useState)(!1),li=(Kn,Pi)=>{const $e=Pi.line;let Gn=0;for(let ji=0;ji<$e;ji++)Gn+=Kn.getLine(ji).split(ye).length-1;const Ai=Kn.getLine($e).substring(0,Pi.ch);return Gn+=Ai.split(ye).length-1,Gn},Ci=(Kn,Pi,$e,Gn)=>{const Ai=Kn.getRange(Pi.from,Pi.to);let ji=0;if(Pi.text.forEach(Tn=>{ji+=Tn.split(ye).length-1}),Pi.origin!=="setValue"){if(Ai&&Ai.indexOf(ye)!==-1){const Tn=Ai.split(ye).length-1,Qt=li(Kn,Pi.from);if(console.log(`\u5220\u9664${Tn}\u4E2A\uFF0C \u524D\u9762\u6709${Qt}\u4E2A\uFF0C\u65B0\u589E${ji}\u4E2A`),Tn>1){const me=Array.from({length:Tn},(bn,_n)=>Qt+_n);Gn(me)}else Gn(Qt)}else if(ji>0){const Tn=li(Kn,Pi.from);console.log(`\u65B0\u589E${ji}\u4E2A\uFF0C\u4E4B\u524D\u6709${Tn}\u4E2A`),$e(ji,Tn)}}},Yi=()=>{const Kn=Pn.getFieldValue(["sub_item_banks",...Ei]);Pn.setFieldValue(["sub_item_banks",...Ei],Kn==null?void 0:Kn.map((Pi,$e)=>ge(Gt({},Pi),{position:$e+1})))},Be=(0,ue.useRef)(),Se=(Kn,Pi)=>{for(let $e=0;$e<Kn;$e++)Be.current({position:null,answer_text:[""]},Pi+$e);Yi()},Ee=(0,ue.useRef)(),Ue=Kn=>{Ee.current(Kn),Yi()},xi=(Hn=(Je=Pn.getFieldValue("sub_item_banks"))==null?void 0:Je[Ei==null?void 0:Ei[0]])==null?void 0:Hn[Ei==null?void 0:Ei[1]];return(0,ue.useEffect)(()=>{console.log("========",Pn.getFieldsValue())},[Pn]),pt.createElement("div",{className:Le.Z.wrap},pt.createElement("div",{className:Le.Z.questionTitleEditorWrap},pt.createElement(ee.default.Item,{label:"\u9898\u5E72",name:ci,labelCol:{span:24},rules:[{required:!0}]},pt.createElement(nt.h,{scrollId:"name",watch:!0,height:140,placeholder:Cn,showNullButton:!0,onCMBeforeChange:(Kn,Pi)=>{Ci(Kn,Pi,Se,Ue)}}))),pt.createElement(ee.default.List,{name:Ei,rules:[{validator(Kn,Pi){if((Pi==null?void 0:Pi.length)===0)return Promise.reject(new Error("\u8BF7\u5148\u5728\u9898\u5E72\u4E2D\u63D2\u5165\u586B\u7A7A\u9879"));for(const $e of Pi){const{answer_text:Gn}=$e||{};if(Gn!=null&&Gn.some(Ai=>(Ai==null?void 0:Ai.length)===0))return Promise.reject(new Error("\u586B\u7A7A\u9879\u7B54\u6848\u4E0D\u80FD\u4E3A\u7A7A"))}return Promise.resolve()}}]},(Kn,{add:Pi,remove:$e},{errors:Gn})=>(Be.current=Pi,Ee.current=$e,pt.createElement(pt.Fragment,null,pt.createElement(ee.default.Item,{label:pt.createElement("span",null,"\u586B\u7A7A\u9879\u7B54\u6848",!(Kn!=null&&Kn.length)&&pt.createElement("span",{style:{color:"#E99237"}},"\uFF08\u8BF7\u5148\u5728\u9898\u5E72\u4E2D\u63D2\u5165\u586B\u7A7A\u9879\uFF09")),required:!0,labelCol:{span:24}}),Kn.map((Ai,ji)=>{var Tn=Ai,{key:Qt,name:me}=Tn,bn=ie(Tn,["key","name"]);return pt.createElement(pe.Z,{align:"top",key:Qt},pt.createElement(Jt.Z,{className:`${Le.Z.blankIndex} pt5`},"\u586B\u7A7A\u9879",ji+1),pt.createElement(Jt.Z,{flex:1},pt.createElement(pe.Z,{align:"top",justify:"space-between"},pt.createElement(Jt.Z,{flex:1},pt.createElement(ee.default.Item,ge(Gt({},bn),{name:[me,"answer_text"],noStyle:!0}),pt.createElement(Te,null))),si&&pt.createElement(Jt.Z,{flex:"224px"},pt.createElement(ee.default.Item,ge(Gt({},bn),{name:[me,"score"],label:"\u5206\u503C",rules:[{required:!0}],className:Le.Z.blankInputNumberWrapper}),pt.createElement(jt.Z,{className:Le.Z.blankInput,min:.1,max:100,precision:1,style:{width:"100%"},placeholder:"\u6309\u7A7A\u7ED9\u5206\u8BF7\u8F93\u5165\u5206\u503C"})))),pt.createElement(ee.default.Item,ge(Gt({},bn),{name:[me,"position"],noStyle:!0}),pt.createElement(ht.default,{type:"hidden"}))))})))),pt.createElement(pe.Z,{align:"middle"},pt.createElement(ee.default.Item,{name:[Bn,"downcase"],valuePropName:"checked"},pt.createElement(st.Z,null)),pt.createElement(Jt.Z,{className:"ml10"},"\u5224\u5206\u65F6\u5FFD\u7565\u7B54\u6848\u4E2D\u7684\u5B57\u6BCD\u5927\u5C0F\u5199")),pt.createElement(pe.Z,{align:"middle"},pt.createElement(ee.default.Item,{name:[Bn,"no_space"],valuePropName:"checked"},pt.createElement(st.Z,null)),pt.createElement(Jt.Z,{className:"ml10"},"\u5224\u5206\u65F6\u5FFD\u7565\u7B54\u6848\u4E2D\u7684\u7A7A\u683C")),(xi==null?void 0:xi.length)>1&&pt.createElement(pe.Z,{align:"middle",className:(xi==null?void 0:xi.length)>1?"mb30":`${Le.Z.hide}`},pt.createElement(ee.default.Item,{name:wt},pt.createElement(ve,null)),pt.createElement(Jt.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")),pt.createElement("div",{className:"mt30",onClick:()=>jn(!0)},pt.createElement(ee.default.Item,{name:Zi,label:"\u9898\u76EE\u89E3\u6790",labelCol:{span:24}},pt.createElement(nt.x,{placeholder:"\u8BF7\u7F16\u8F91\u9898\u76EE\u89E3\u6790\uFF08\u975E\u5FC5\u586B\uFF09",isEdit:Ln}))))};var Ze=kt(59301),qe=Object.defineProperty,pn=Object.defineProperties,te=Object.getOwnPropertyDescriptors,Xt=Object.getOwnPropertySymbols,Qe=Object.prototype.hasOwnProperty,On=Object.prototype.propertyIsEnumerable,En=(Cn,Pn,Bn)=>Pn in Cn?qe(Cn,Pn,{enumerable:!0,configurable:!0,writable:!0,value:Bn}):Cn[Pn]=Bn,Ie=(Cn,Pn)=>{for(var Bn in Pn||(Pn={}))Qe.call(Pn,Bn)&&En(Cn,Bn,Pn[Bn]);if(Xt)for(var Bn of Xt(Pn))On.call(Pn,Bn)&&En(Cn,Bn,Pn[Bn]);return Cn},on=(Cn,Pn)=>pn(Cn,te(Pn)),cn=(Cn,Pn)=>{var Bn={};for(var si in Cn)Qe.call(Cn,si)&&Pn.indexOf(si)<0&&(Bn[si]=Cn[si]);if(Cn!=null&&Xt)for(var si of Xt(Cn))Pn.indexOf(si)<0&&On.call(Cn,si)&&(Bn[si]=Cn[si]);return Bn};const Vn={\u6B63\u786E:"T",\u9519\u8BEF:"F"},Me=({value:Cn,onChange:Pn,form:Bn,choiceKey:si})=>{const Ei=(Cn==null?void 0:Cn.is_answer)===1,ci=Cn==null?void 0:Cn.choice_text,Zi=()=>{var wt;const Je=(wt=Bn==null?void 0:Bn.getFieldValue(["sub_item_banks",...si]))==null?void 0:wt.map(Hn=>({choice_text:Hn.choice_text,is_answer:0}));Bn==null||Bn.setFieldValue(["sub_item_banks",...si],Je),Pn(on(Ie({},Cn),{is_answer:1}))};return Ze.createElement(pe.Z,{className:Le.Z.choiceWrap,align:"middle",wrap:!1},Ze.createElement(Jt.Z,{onClick:Zi,className:`${Le.Z.choiceIndex} ${Le.Z.judgementIndex} ${Ei?Le.Z.activeAnswer:""}`},Vn[ci]),Ze.createElement(Jt.Z,{flex:1,className:`${Le.Z.editorWrap} ml15`},Ze.createElement("div",{className:`${Le.Z.inputBorder} ${Le.Z.placeholder} ${Ei?Le.Z.activeJudgementAnswer:""}`},ci)),Ze.createElement(Jt.Z,{flex:"0 0 auto",className:"ml15"},Ze.createElement("div",{onClick:Zi,className:`${Le.Z.setAnswerBtn} ${Ei?Le.Z.activeAnswer:""}`},Ei?"\u6B63\u786E\u7B54\u6848":"\u8BBE\u4E3A\u7B54\u6848")))},he=({questionTitlePlaceholder:Cn,choiceKey:Pn="choices",form:Bn,titleKey:si="name",analysisKey:Ei="analysis"})=>{const[ci,Zi]=(0,ue.useState)(!1);return Ze.createElement("div",{className:Le.Z.wrap},Ze.createElement("div",{className:Le.Z.questionTitleEditorWrap},Ze.createElement(ee.default.Item,{label:"\u9898\u5E72",name:si,labelCol:{span:24},rules:[{required:!0}]},Ze.createElement(nt.h,{scrollId:"name",watch:!0,height:140,placeholder:Cn}))),Ze.createElement(ee.default.Item,{label:"\u7B54\u6848\u9009\u9879",required:!0,labelCol:{span:24}},Ze.createElement(ee.default.List,{name:Pn,rules:[{validator(wt,Je){return Je.some(Ln=>(Ln==null?void 0:Ln.is_answer)===1)?Promise.resolve():Promise.reject(new Error("\u8BF7\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))}}]},wt=>Ze.createElement("div",{id:"choices",style:{display:"flex",flexDirection:"column",gap:"20px"}},wt.map(Je=>{var Hn=Je,{key:Ln,name:jn}=Hn,li=cn(Hn,["key","name"]);return Ze.createElement(ee.default.Item,on(Ie({},li),{key:Ln,name:jn,noStyle:!0}),Ze.createElement(Me,{form:Bn,choiceKey:Pn}))})))),Ze.createElement("div",{className:"mt30",onClick:()=>Zi(!0)},Ze.createElement(ee.default.Item,{name:Ei,label:"\u9898\u76EE\u89E3\u6790",labelCol:{span:24}},Ze.createElement(nt.x,{placeholder:"\u8BF7\u7F16\u8F91\u9898\u76EE\u89E3\u6790\uFF08\u975E\u5FC5\u586B\uFF09",isEdit:ci}))))};var Ce=kt(6767),Yn=kt(96599),Si=kt(39793),Rt=kt(61485),Ft=Object.defineProperty,Pt=Object.defineProperties,Nt=Object.getOwnPropertyDescriptors,zt=Object.getOwnPropertySymbols,Mt=Object.prototype.hasOwnProperty,Yt=Object.prototype.propertyIsEnumerable,He=(Cn,Pn,Bn)=>Pn in Cn?Ft(Cn,Pn,{enumerable:!0,configurable:!0,writable:!0,value:Bn}):Cn[Pn]=Bn,_e=(Cn,Pn)=>{for(var Bn in Pn||(Pn={}))Mt.call(Pn,Bn)&&He(Cn,Bn,Pn[Bn]);if(zt)for(var Bn of zt(Pn))Yt.call(Pn,Bn)&&He(Cn,Bn,Pn[Bn]);return Cn},Xe=(Cn,Pn)=>Pt(Cn,Nt(Pn)),xe=(Cn,Pn)=>{var Bn={};for(var si in Cn)Mt.call(Cn,si)&&Pn.indexOf(si)<0&&(Bn[si]=Cn[si]);if(Cn!=null&&zt)for(var si of zt(Cn))Pn.indexOf(si)<0&&Yt.call(Cn,si)&&(Bn[si]=Cn[si]);return Bn};const Pe=Cn=>{var Pn=Cn,{value:Bn,onChange:si}=Pn,Ei=xe(Pn,["value","onChange"]);const ci=Zi=>{si([Zi])};return ue.createElement(Si.Z,Xe(_e({},Ei),{defaultValue:Bn==null?void 0:Bn[0],onChange:ci}))},ke=Cn=>{if(!Cn)return!1;let Pn=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 Cn==="|"?(Ce.ZP.warning("\u5173\u952E\u8BCD\u4E0D\u80FD\u53EA\u8F93\u5165\u4E00\u4E2A\u201C|\u201D\u5B57\u7B26\uFF01"),!1):!0},Ve=({value:Cn=[],onClose:Pn})=>ue.createElement(Yn.default,{closable:!0,onClose:Pn,className:Le.Z.keywordTag},ue.createElement("pre",{style:{margin:"0px",whiteSpace:"pre-wrap"}},Cn.join(" \u6216 "))),tn=({questionTitlePlaceholder:Cn,form:Pn,showKeywords:Bn,isMustKeyWords:si=Bn,titleKey:Ei="name",analysisKey:ci="analysis",answerTexts:Zi="answer_texts",keywords:wt="keywords",useKeywords:Je="use_keywords",indexs:Hn})=>{const[Ln,jn]=(0,ue.useState)(!1),[li,Ci]=(0,ue.useState)(""),[Yi,Be]=(0,ue.useState)(!1),Se=ee.default.useWatch("question_score",Pn);return ue.createElement("div",{className:Le.Z.wrap},ue.createElement("div",{className:Le.Z.questionTitleEditorWrap},ue.createElement(ee.default.Item,{label:"\u9898\u5E72",name:Ei,labelCol:{span:24},rules:[{required:!0}]},ue.createElement(nt.h,{scrollId:"name",watch:!0,height:140,placeholder:Cn}))),ue.createElement(ee.default.Item,{label:"\u53C2\u8003\u7B54\u6848",name:Zi,labelCol:{span:24}},ue.createElement(Pe,{watch:!0,height:140,placeholder:"\u8BF7\u7F16\u8F91\u53C2\u8003\u7B54\u6848\uFF08\u975E\u5FC5\u586B\uFF09"})),Bn&&!si&&ue.createElement(ee.default.Item,{hidden:!0,name:Je,valuePropName:"checked"},ue.createElement(st.Z,{defaultChecked:!0})),Bn&&si&&ue.createElement(pe.Z,{align:"middle",className:"mb30"},ue.createElement(ee.default.Item,{name:Je,valuePropName:"checked"},ue.createElement(st.Z,{onChange:()=>{var Ee,Ue,xi,Kn,Pi,$e;console.log(Pn.getFieldsValue()),Be((xi=(Ue=(Ee=Pn.getFieldsValue())==null?void 0:Ee.sub_item_banks)==null?void 0:Ue[Hn])==null?void 0:xi.use_keywords),console.log(($e=(Pi=(Kn=Pn.getFieldsValue())==null?void 0:Kn.sub_item_banks)==null?void 0:Pi[Hn])==null?void 0:$e.use_keywords),console.log(Yi)}})),ue.createElement(Jt.Z,{className:"ml10"},"\u5F00\u542F\u5173\u952E\u8BCD\u81EA\u52A8\u5224\u5206"),ue.createElement(Jt.Z,null,ue.createElement(De.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"},ue.createElement(Rt.Z,{style:{color:"#3061D0",marginLeft:6,cursor:"pointer"}})))),(Yi||!si)&&ue.createElement(ee.default.List,{name:wt,rules:[{validator(Ee,Ue){return si?Ue!=null&&Ue.length?(Ue==null?void 0:Ue.reduce((Kn,Pi)=>Kn+Pi.score,0))>parseFloat(Se)?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()}}]},(Ee,{add:Ue,remove:xi})=>ue.createElement(ue.Fragment,null,ue.createElement("div",{className:`${Le.Z.title} mb10`},si?"\u5173\u952E\u8BCD":ue.createElement("span",{style:{color:"#9096A3"}},"\u5224\u5206\u5173\u952E\u8BCD")),ue.createElement(pe.Z,{align:"middle",className:"font14 mb30"},ue.createElement(Jt.Z,{flex:1},ue.createElement(ht.default,{value:li,onChange:Kn=>{Ci(Kn.target.value)},maxLength:50,allowClear:!0,onPressEnter:Kn=>{var Pi,$e,Gn,Ai;const ji=`${(Pi=Kn.target)==null?void 0:Pi.value}`,Tn=(Gn=($e=ji==null?void 0:ji.split("|"))==null?void 0:$e.filter(bn=>!!bn))==null?void 0:Gn.map(bn=>bn==null?void 0:bn.trim()),Qt=Pn.getFieldValue(["sub_item_banks",...wt]),me=((Ai=Qt==null?void 0:Qt.map(bn=>bn==null?void 0:bn.keyword))==null?void 0:Ai.flat())||[];for(const bn of Tn)if(me.includes(bn)){Ce.ZP.error("\u4E3A\u907F\u514D\u5224\u5206\u9519\u8BEF\uFF0C\u8BF7\u52FF\u8BBE\u7F6E\u76F8\u540C\u7684\u5173\u952E\u8BCD");return}ke(ji)&&(Ue({keyword:Tn,score:1}),Ci(""))},className:Le.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"})),ue.createElement(Jt.Z,{flex:"148px",style:{textAlign:"right",color:"#e99237"}},"\u201C\u56DE\u8F66\u952E\u201D\u4FDD\u5B58\u5173\u952E\u8BCD")),Ee.map(Kn=>{var Pi=Kn,{key:$e,name:Gn}=Pi,Ai=xe(Pi,["key","name"]);return ue.createElement(pe.Z,{key:$e,className:"mb20",style:{marginRight:148}},ue.createElement(Jt.Z,{flex:1},ue.createElement(pe.Z,{align:"middle",justify:"space-between"},ue.createElement(ee.default.Item,Xe(_e({},Ai),{name:[Gn,"keyword"]}),ue.createElement(Ve,{onClose:()=>xi(Gn)})),si&&ue.createElement(ee.default.Item,Xe(_e({},Ai),{name:[Gn,"score"],label:"\u5206\u503C",rules:[{required:!0}],className:Le.Z.blankInputNumberWrapper}),ue.createElement(jt.Z,{className:Le.Z.blankInput,min:.1,max:100,precision:1,style:{width:"100%"},placeholder:"\u8BF7\u8F93\u5165\u5173\u952E\u8BCD\u5206\u6570"})))))}))),ue.createElement("div",{onClick:()=>jn(!0)},ue.createElement(ee.default.Item,{name:ci,label:"\u9898\u76EE\u89E3\u6790",labelCol:{span:24}},ue.createElement(nt.x,{placeholder:"\u8BF7\u7F16\u8F91\u9898\u76EE\u89E3\u6790\uFF08\u975E\u5FC5\u586B\uFF09",isEdit:Ln}))))};var dn=kt(59301),fn=Object.defineProperty,ni=Object.defineProperties,Ge=Object.getOwnPropertyDescriptors,Ke=Object.getOwnPropertySymbols,nn=Object.prototype.hasOwnProperty,Qn=Object.prototype.propertyIsEnumerable,gn=(Cn,Pn,Bn)=>Pn in Cn?fn(Cn,Pn,{enumerable:!0,configurable:!0,writable:!0,value:Bn}):Cn[Pn]=Bn,an=(Cn,Pn)=>{for(var Bn in Pn||(Pn={}))nn.call(Pn,Bn)&&gn(Cn,Bn,Pn[Bn]);if(Ke)for(var Bn of Ke(Pn))Qn.call(Pn,Bn)&&gn(Cn,Bn,Pn[Bn]);return Cn},zn=(Cn,Pn)=>ni(Cn,Ge(Pn)),gi=(Cn,Pn)=>{var Bn={};for(var si in Cn)nn.call(Cn,si)&&Pn.indexOf(si)<0&&(Bn[si]=Cn[si]);if(Cn!=null&&Ke)for(var si of Ke(Cn))Pn.indexOf(si)<0&&Qn.call(Cn,si)&&(Bn[si]=Cn[si]);return Bn};const{Panel:ti}=Dt.default,wi=({questionTitlePlaceholder:Cn,choiceKey:Pn,form:Bn,withScore:si})=>{const[Ei,ci]=(0,ue.useState)([]),Zi=wt=>{ci(wt)};return dn.createElement("div",{className:Le.Z.wrap},dn.createElement("div",{className:Le.Z.questionTitleEditorWrap},dn.createElement(ee.default.Item,{label:"\u9898\u5E72",name:"name",labelCol:{span:24},rules:[{required:!0}]},dn.createElement(nt.h,{scrollId:"name",watch:!0,height:140,placeholder:Cn}))),dn.createElement(ee.default.Item,{label:"\u5C0F\u9898",required:!0,labelCol:{span:24}}),dn.createElement(ee.default.List,{name:"sub_item_banks",rules:[{validator(wt,Je){return Je?Promise.resolve():Promise.reject(new Error("\u8BF7\u6DFB\u52A0\u5C0F\u9898"))}}]},(wt,{add:Je,remove:Hn,move:Ln})=>{const jn=Bn.getFieldValue("sub_item_banks");return dn.createElement(dn.Fragment,null,dn.createElement(Dt.default,{className:wt.length>0?Le.Z.collapseWrapper:"",bordered:!1,activeKey:Ei,onChange:Zi,expandIcon:({isActive:li})=>dn.createElement("i",{className:`iconfont icon-weizhankai ${li?Le.Z.open:Le.Z.close}`,style:{fontSize:14,transition:"all .2s"}})},wt.map((li,Ci)=>{var Yi=li,{key:Be,name:Se}=Yi,Ee=gi(Yi,["key","name"]),Ue,xi,Kn,Pi,$e,Gn,Ai,ji,Tn,Qt;return dn.createElement(ti,{className:Le.Z.panel,forceRender:!0,header:dn.createElement("div",{className:Le.Z.panelHeader},"\u7B2C",Ci+1,"\u5C0F\u9898",dn.createElement("span",null,"\uFF08",((Ue=jn==null?void 0:jn[Se])==null?void 0:Ue.item_type)=="SINGLE"?"\u5355\u9009\u9898":((xi=jn==null?void 0:jn[Se])==null?void 0:xi.item_type)=="MULTIPLE"?"\u591A\u9009\u9898":((Kn=jn==null?void 0:jn[Se])==null?void 0:Kn.item_type)=="COMPLETION"?"\u586B\u7A7A\u9898":((Pi=jn==null?void 0:jn[Se])==null?void 0:Pi.item_type)=="JUDGMENT"?"\u5224\u65AD\u9898":"\u7B80\u7B54\u9898","\uFF09")),key:Se,extra:dn.createElement(pe.Z,{align:"middle",onClick:me=>me.stopPropagation()},si&&dn.createElement(Jt.Z,null,dn.createElement(ee.default.Item,zn(an({},Ee),{rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5C0F\u9898\u5206\u503C"}],label:"\u5206\u503C",name:[Se,"question_score"],className:Le.Z.blankInputNumberWrapper}),dn.createElement(jt.Z,{className:Le.Z.blankInput,placeholder:"\u8BF7\u8F93\u5165\u5F53\u524D\u5C0F\u9898\u5206\u6570",min:.1,precision:1,max:100,style:{width:150}}))),dn.createElement(Jt.Z,null,dn.createElement(pe.Z,{align:"middle",className:"pl40",justify:"end"},Ci!==0&&dn.createElement("div",{onClick:()=>{var me;Ln(Ci,Ci-1);const bn=(me=Bn.getFieldValue("sub_item_banks"))==null?void 0:me.map((_n,ze)=>(wt.map((hn,Nn)=>{ze===Nn&&(_n.q_position=Number(hn.name)+1)}),_n));Bn.setFieldValue("sub_item_banks",bn)}},dn.createElement(De.Z,{title:"\u4E0A\u79FB"},dn.createElement("i",{className:"iconfont icon-shangyi3 c-grey-999 primary-hover"}))),Ci<wt.length-1&&dn.createElement("div",{onClick:()=>{var me;Ln(Ci,Ci+1);const bn=(me=Bn.getFieldValue("sub_item_banks"))==null?void 0:me.map((_n,ze)=>(wt.map((hn,Nn)=>{ze===Nn&&(_n.q_position=Number(hn.name)+1)}),_n));Bn.setFieldValue("sub_item_banks",bn)},className:Ci===0?"":"ml15"},dn.createElement(De.Z,{title:"\u4E0B\u79FB"},dn.createElement("i",{className:"iconfont icon-xiayi3 c-grey-999 primary-hover"}))))),dn.createElement(Jt.Z,null,dn.createElement(De.Z,{title:"\u5220\u9664"},dn.createElement(Bt.Z,{className:`${Le.Z.deleteIcon} ml15`,onClick:()=>Hn(Se)}))))},dn.createElement(ee.default.Item,zn(an({},Ee),{name:Se}),((($e=jn==null?void 0:jn[Se])==null?void 0:$e.item_type)=="SINGLE"||((Gn=jn==null?void 0:jn[Se])==null?void 0:Gn.item_type)=="MULTIPLE")&&dn.createElement(ft.u,{questionTitlePlaceholder:"\u8BF7\u7F16\u8F91\u9009\u62E9\u9898\u9898\u5E72\u5185\u5BB9",allowChangeMode:((Ai=jn==null?void 0:jn[Se])==null?void 0:Ai.item_type)=="MULTIPLE",form:Bn,choiceKey:[Se,"choices"],titleKey:[Se,"name"],analysisKey:[Se,"analysis"],choiceOptionsPath:["sub_item_banks",Se,"choices"],choiceTextKey:"choice_text",answerKey:"is_answer"}),((ji=jn==null?void 0:jn[Se])==null?void 0:ji.item_type)=="COMPLETION"&&dn.createElement(Ye,{form:Bn,questionTitlePlaceholder:"\u8BF7\u7F16\u8F91\u9898\u5E72\u5E76\u8BBE\u7F6E\u586B\u7A7A\u9879",scoreByBlank:!1,name:Se,titleKey:[Se,"name"],analysisKey:[Se,"analysis"],isOrdered:[Se,"is_ordered"],answerKey:[Se,"standard_answers"]}),((Tn=jn==null?void 0:jn[Se])==null?void 0:Tn.item_type)=="JUDGMENT"&&dn.createElement(he,{form:Bn,questionTitlePlaceholder:"\u8BF7\u7F16\u8F91\u5224\u65AD\u9898\u9898\u5E72\u5185\u5BB9",titleKey:[Se,"name"],analysisKey:[Se,"analysis"],choiceKey:[Se,"choices"]}),((Qt=jn==null?void 0:jn[Se])==null?void 0:Qt.item_type)=="SUBJECTIVE"&&dn.createElement(tn,{showKeywords:!0,isMustKeyWords:!1,form:Bn,titleKey:[Se,"name"],analysisKey:[Se,"analysis"],answerTexts:[Se,"answer_texts"],useKeywords:[Se,"use_keywords"],keywords:[Se,"keywords"],indexs:Se,questionTitlePlaceholder:"\u8BF7\u7F16\u8F91\u7B80\u7B54\u9898\u9898\u5E72\u5185\u5BB9"})))})),wt.length<20&&dn.createElement(ae.Z,{menu:{items:[{label:dn.createElement("div",{onClick:()=>{Je({name:"",choices:Array.from({length:4},()=>({choice_text:"",is_answer:0})),analysis:"",item_type:"SINGLE"}),ci([wt==null?void 0:wt.length,...Ei])}},"\u5355\u9009\u9898"),key:"1",show:!0},{label:dn.createElement("div",{onClick:()=>{Je({name:"",choices:Array.from({length:4},()=>({choice_text:"",is_answer:0})),analysis:"",item_type:"MULTIPLE"}),ci([wt==null?void 0:wt.length,...Ei])}},"\u591A\u9009\u9898"),key:"2",show:!0},{label:dn.createElement("div",{onClick:()=>{Je({name:"",choices:[{choice_text:"\u6B63\u786E",is_answer:0},{choice_text:"\u9519\u8BEF",is_answer:0}],analysis:"",item_type:"JUDGMENT"}),ci([wt==null?void 0:wt.length,...Ei])}},"\u5224\u65AD\u9898"),key:"3",show:!0},{label:dn.createElement("div",{onClick:()=>{Je({name:"",analysis:"",is_ordered:!0,standard_answers:[],item_type:"COMPLETION",downcase:!0,no_space:!0}),ci([wt==null?void 0:wt.length,...Ei])}},"\u586B\u7A7A\u9898"),key:"4",show:!0},{label:dn.createElement("div",{onClick:()=>{Je({name:"",answer_texts:[],keywords:[],use_keywords:!0,analysis:"",item_type:"SUBJECTIVE"}),ci([wt==null?void 0:wt.length,...Ei])}},"\u7B80\u7B54\u9898"),key:"5",show:!0}].filter(li=>li.show).map(li=>({label:li.label,key:li.key}))}},dn.createElement("div",{className:`${Le.Z.addBtn}`},"\u6DFB\u52A0\u5C0F\u9898")))}))};var Wi=kt(68571)},76902:function(Mn,Rn,kt){"use strict";kt.d(Rn,{z:function(){return qt},Z:function(){return Ut}});var ft=kt(59301),Kt=kt(8944),le=kt(81428),we=kt(64018),ue=kt(15360),Dt=kt(346),ee=kt(51257),pe=kt(15342),Jt=kt(1012),jt=kt(45677),De=kt(59301),Le=({html:Gt})=>{const ge=(0,ft.useRef)(null),ie=(0,ft.useRef)(null),Te=`.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,ft.useEffect)(()=>{const ve=ge.current.attachShadow({mode:"open"});ie.current=document.createElement("div"),ie.current.className="markdown-body",ie.current.innerHTML=Gt,ve.appendChild(ie.current);const ye=document.createElement("style");return ye.textContent=Te,ve.appendChild(ye),()=>{ve.innerHTML=""}},[]),(0,ft.useEffect)(()=>{ie.current&&(ie.current.innerHTML=Gt)},[Gt]),De.createElement("div",{ref:ge})};function Bt(Gt){const ge=["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(${ge.join("|")})\\s*=\\s*(?:"[^"]*"|'[^']*'|[^\\s>]*)`,"gi");return Gt.replace(ie,"").trim()}var nt=Object.defineProperty,et=Object.getOwnPropertySymbols,ht=Object.prototype.hasOwnProperty,st=Object.prototype.propertyIsEnumerable,pt=(Gt,ge,ie)=>ge in Gt?nt(Gt,ge,{enumerable:!0,configurable:!0,writable:!0,value:ie}):Gt[ge]=ie,vt=(Gt,ge)=>{for(var ie in ge||(ge={}))ht.call(ge,ie)&&pt(Gt,ie,ge[ie]);if(et)for(var ie of et(ge))st.call(ge,ie)&&pt(Gt,ie,ge[ie]);return Gt};const St="@\u2581\u2581@",Et="@\u2581@",At=/<pre[^>]*>/g;function It(Gt){let ge=document.createElement("div");return ge.innerHTML=Gt,ge.childNodes.length===0?"":ge.childNodes[0].nodeValue}const qt=(Gt,ge)=>{Gt=Gt||"";const ie=/(?:https?:\/\/[^\/]+)?\/api\/attachments\/([A-Za-z0-9+/=]+)(\?.*?)?\)|(?:https?:\/\/[^\/]+)?\/api\/attachments\/([A-Za-z0-9+/=]+)(\?.*?)?|(?:https?:\/\/[^\/]+)?\/attachments\/download\/([A-Za-z0-9+/=]+)(\?.*?)?\//g,Te=/\"(?:https?:\/\/[^\/]+)?\/api\/attachments\/([A-Za-z0-9+/=]+)(\?.*?)?|\"(?:https?:\/\/[^\/]+)?\/attachments\/download\/([A-Za-z0-9+/=]+)(\?.*?)?\//g,ve=/\(\s+(?:https?:\/\/[^\/]+)?\/files\/uploads\/([A-Za-z0-9+/=]+)(\?.*?)?|\"(?:https?:\/\/[^\/]+)?\/files\/uploads\/([A-Za-z0-9+/=]+)(\?.*?)?\//g,ye=/(?:https?:\/\/[^\/]+)?\/attachments\/download\/([A-Za-z0-9+/=]+)(\?.*?)?\//g;return ge?Gt.replaceAll("https://www.educoder.net","").replaceAll("https://www-cdn.educoder.net","").replaceAll("//api/attachments","/api/attachments").replace(ie,(Ye,Ze,qe,pn,te,Xt,Qe)=>{const On=Ze||pn||Xt,En=qe||te||Qe||"?";return Dt.Z.API_SERVER+"/api/attachments/"+On+En+"&t="+(0,ee.Jn)(On,Date.now())+(Ye.indexOf(")")>-1?")":"&")}).replaceAll('src="(','src="').replaceAll("src='(",'src="'):(Gt=Gt.replace(ye,(Ye,Ze,qe,pn,te,Xt,Qe)=>{const On=Ze||pn||Xt,En=qe||te||Qe||"?";return Dt.Z.API_SERVER+"/attachments/download/"+On+En+"&t="+(0,ee.Jn)(On,Date.now())+(Ye.indexOf(")")>-1?")":"&")}).replace(ie,(Ye,Ze,qe,pn,te,Xt,Qe)=>{const On=Ze||pn||Xt,En=qe||te||Qe||"?";return Dt.Z.API_SERVER+"/api/attachments/"+On+En+"&t="+(0,ee.Jn)(On,Date.now())+(Ye.indexOf(")")>-1?")":"&")}).replace(Te,(Ye,Ze,qe,pn,te)=>{const Xt=Ze||pn,Qe=qe||te||"";return'"'+Dt.Z.API_SERVER+"/api/attachments/"+Xt+Qe+Xt+Qe+"&t="+(0,ee.Jn)(Xt,Date.now())}).replace(ve,(Ye,Ze,qe,pn,te)=>{const Xt=Ze||pn,Qe=qe||te||"";return"("+Dt.Z.API_SERVER+"/files/uploads/"+Xt+Qe+Xt+Qe+"&t="+(0,ee.Jn)(Xt,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,`
|
|
`),Gt)};var Ut=({value:Gt="",className:ge,showTextOnly:ie,showLines:Te,style:ve={},stylesPrev:ye={},highlightKeywords:Ye,showProgramFill:Ze,isProgramFill:qe,disabledFill:pn=!1,programFillValue:te,onFillChange:Xt=En=>{},onFillBlur:Qe=()=>{},onFillFocus:On=()=>{}})=>{let En=Bt(String(Gt||""));const[Ie,on]=(0,ft.useState)(""),[cn,Vn]=(0,ft.useState)("office"),[Me,he]=(0,ft.useState)([]),Ce=(0,ft.useRef)("a"+(0,Jt.Z)()),Yn={},Si=Pe=>/<style[\s\S]*?>/i.test(Pe||""),Rt=(Pe,ke,Ve)=>{const tn=document.createElement(Pe===Et?"input":"textarea");tn.style.width="100%",tn.style.height=Pe===Et?"40px":"151px",tn.rows=5,tn.spellcheck=!1,tn.name="edu-program-fill",tn.placeholder="\u8BF7\u8F93\u5165",tn.dataset.id=ke;const dn=Object.keys(Yn).length;return Yn[dn]=tn,`<span class="edu-program-fill-wrap ${Pe===Et?"":"show"}" style="width:${Pe===Et?"400px":"100%"}" title=${Ve||""}><span>${tn.outerHTML}<span class="edu-program-fill-score" style="margin:0 6px"></span></span></span>`};function Ft(Pe){return Pe=Pe.replace(/!\[.*?\]\(.*?\)/g,""),Pe=Pe.replace(/\[.*?\]\(.*?\)/g,""),Pe=Pe.replace(new RegExp("<iframe.*?<\\/iframe>","gs"),""),Pe=Pe.replace(/<embed.*?>/g,""),Pe=Pe.replace(/<img.*?>/g,""),Pe=Pe.replace(new RegExp("<video.*?>.*?<\\/video>","gs"),""),Pe=Pe.replace(new RegExp("<audio.*?>.*?<\\/audio>","gs"),""),Pe=Pe.replace(new RegExp("<style.*?>.*?<\\/style>","gs"),""),Pe=Pe.replace(new RegExp("<script.*?>.*?<\\/script>","gs"),""),Pe}const Pt=Pe=>!ie&&Si(En)?Pe:Pe.replace(/<style.*?>([\s\S]+?)<\/style>/gim,function(ke,Ve){let tn=Ve.replace(/(\n|\r)/g,"").split("}"),dn=[];return tn.map(fn=>{fn!=""&&dn.push(`.${Ce.current} ${fn}`)}),`<style>${dn.join("}")}</style>`}),Nt=(0,ft.useMemo)(()=>{try{const tn=/\(\s+\/api\/attachments\/|\(\/api\/attachments\//g,dn=/\"\/api\/attachments\/|\"\/attachments\/download\//g,fn=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g,ni=/\(\/attachments\/download\//g;En=En.replace(ni,"("+Dt.Z.API_SERVER+"/attachments/download/").replace(tn,"("+Dt.Z.API_SERVER+"/api/attachments/").replace(dn,'"'+Dt.Z.API_SERVER+"/api/attachments/").replace(fn,'"'+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(tn){}if(Ze){let tn=-1;return En=En.replaceAll("<","<").replaceAll(">",">").replace(/(@▁▁@|@▁@)/g,function(dn,fn,ni){var Ge;return++tn,Rt(dn,tn,(Ge=te==null?void 0:te[tn])==null?void 0:Ge.value.replaceAll("<","<").replaceAll(">",">"))}),`<pre style="background:#fff;padding:4px">${Pt(En||"")}</pre>`}let Pe=Pt(En);Pe=(0,le.ZP)(Pe);const ke=(0,le.ez)();En.match(/\[TOC\]/)&&(Pe=Pe.replace("<p>[TOC]</p>",(0,le.Qv)()),(0,le.Iy)()),Pe=Pe.replace(/(__special_katext_id_\d+__)/g,(tn,dn)=>{const{type:fn,expression:ni}=ke[dn];return(0,pe.renderToString)(It(ni)||"",{displayMode:fn==="block",throwOnError:!1,output:"html"})}),Pe=Pe.replace(/▁/g,"\u2581\u2581\u2581\u2581\u2581"),(0,le.AL)();const Ve=document.createElement("div");if(Ve.innerHTML=Pe,ie)return Ve.innerText;if(Ye){const tn=Ye.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return He(Ve,tn),Ve.innerHTML}return setTimeout(()=>xe(),500),Ve.innerHTML},[En,Ye]);(0,ft.useEffect)(()=>{_e.current&&_e.current.querySelectorAll(["input","textarea"]).forEach(ke=>{ke.oninput=zt,ke.onblur=Mt,ke.onfocus=Yt})},[Me]),(0,ft.useEffect)(()=>{var Pe,ke,Ve,tn,dn;if(te!=null&&te.length)try{const fn=_e.current.querySelectorAll(".edu-program-fill-score"),ni=_e.current.querySelectorAll('[name="edu-program-fill"]');for(const[Ge,Ke]of ni.entries())Ke.value=((Pe=te==null?void 0:te[Ge])==null?void 0:Pe.value)||"",((ke=te==null?void 0:te[Ge])==null?void 0:ke.type)==="warning"?Ke.className="program-fill-warning":((Ve=te==null?void 0:te[Ge])==null?void 0:Ve.type)==="success"?Ke.className="program-fill-success":Ke.className="";for(const[Ge,Ke]of fn.entries())Ke.innerHTML=(tn=te==null?void 0:te[Ge])!=null&&tn.score?`${(dn=te==null?void 0:te[Ge])==null?void 0:dn.score}\u5206`:"";he(te)}catch(fn){console.log(fn,"error")}},[te]);const zt=Pe=>{Me[Pe.target.dataset.id]=Me[Pe.target.dataset.id]||{},Me[Pe.target.dataset.id].value=Pe.target.value,he([...Me]),Xt(Me,Pe.target.dataset.id)},Mt=Pe=>{Me[Pe.target.dataset.id]=Me[Pe.target.dataset.id]||{},Me[Pe.target.dataset.id].value=Pe.target.value,he([...Me]),Qe(Me,Pe.target.dataset.id)},Yt=Pe=>{Me[Pe.target.dataset.id]=Me[Pe.target.dataset.id]||{},Me[Pe.target.dataset.id].value=Pe.target.value,he([...Me]),On(Me,Pe.target.dataset.id)};function He(Pe,ke){return Pe.childNodes.forEach(Ve=>{var tn;if(Ve.childNodes.length>0)He(Ve,ke);else if(Ve.nodeName!=="IMG")if(Ve.innerHTML)Ve.innerHTML=(tn=Ve.innerHTML)==null?void 0:tn.replace(new RegExp(ke,"gi"),'<span style="color:#0152d9;background-color:#1890ff33">$&</span>');else{const dn=document.createElement("span");dn.innerHTML=Ve.textContent.replace(new RegExp(ke,"gi"),'<span style="color:#0152d9;background-color:#1890ff33">$&</span>'),Ve.replaceWith(dn)}})}const _e=(0,ft.useRef)();le.jb.WebkitLineClamp=Te,Te&&(ve=vt(vt({},ve),le.jb));function Xe(Pe){let ke=Pe.target;if(ke.tagName.toUpperCase()==="A"){let Ve=ke.getAttribute("href");if(Ve.indexOf("office")>-1)Pe.preventDefault(),on(Ve),Vn("office");else if(Ve.indexOf("application/pdf")>-1)Pe.preventDefault(),on(Ve),Vn("pdf");else if(Ve.indexOf("text/html")>-1)Pe.preventDefault(),on(Ve),Vn("html");else if(Ve.startsWith("#")){Pe.preventDefault();let tn=document.getElementById(Ve.replace("#",""));tn&&tn.scrollIntoView(!0)}}}const xe=()=>{var Pe;const ke=(Pe=_e.current)==null?void 0:Pe.querySelectorAll("video");ke==null||ke.forEach(Ve=>{if(Ve.oncontextmenu=()=>!1,Ve.src.indexOf(".m3u8")>-1&&!Ve.canPlayType("application/vnd.apple.mpegurl")){if(ue.ZP.isSupported()){var tn=new ue.ZP;tn.loadSource(Ve.src),tn.attachMedia(Ve)}}})};return(0,ft.useEffect)(()=>{if(_e.current&&Nt&&Nt.match(At)&&window.PR.prettyPrint(),_e.current)return _e.current.addEventListener("click",Xe),()=>{var Pe;(Pe=_e.current)==null||Pe.removeEventListener("click",Xe),(0,le.AL)(),(0,le.Iy)()}},[Nt,_e.current,Xe]),(0,ft.useEffect)(()=>{var Pe;const ke=Ve=>{Ve.preventDefault(),Ve.clipboardData.setData("text",window.getSelection().toString())};return(Pe=_e.current)==null||Pe.addEventListener("copy",ke),()=>{var Ve;(Ve=_e.current)==null||Ve.removeEventListener("copy",ke)}},[_e.current]),ft.createElement(ft.Fragment,null,ie&&ft.createElement("div",{ref:_e},Nt),!ie&&!Si(Nt)&&ft.createElement("div",{ref:_e,style:vt({},ve),className:`${ge||""} ${pn?"disabled-fill":""} markdown-body ${Ce.current}`,dangerouslySetInnerHTML:{__html:Nt}}),!ie&&Si(Nt)&&ft.createElement(Le,{html:Nt}),ft.createElement(jt.Z,{close:!0,data:Ie,type:Ie!=null&&Ie.length?cn:"",style:vt({},ye),onClose:()=>on("")}))}},60572:function(Mn,Rn,kt){"use strict";kt.d(Rn,{C:function(){return Ye}});var ft=kt(59301),Kt={recalculation:"recalculation____i9AE",tips:"tips___GoMu8",filter:"filter___Vx7VO",input:"input___OEMMv",operating:"operating___TS9iA",operatingItem:"operatingItem___AT84q"},le=kt(92310),we=kt.n(le),ue=kt(62673),Dt=kt(77019),ee=kt(6767),pe=kt(25399),Jt=kt(99571),jt=kt(62957),De=kt(54172),ae=kt(71051),Le=kt(28284),Bt=kt(29787),nt=kt(51257),et=kt(38986),ht=kt(48790),st=kt(54650),pt=kt(9148),vt=Object.defineProperty,St=Object.defineProperties,Et=Object.getOwnPropertyDescriptors,At=Object.getOwnPropertySymbols,It=Object.prototype.hasOwnProperty,qt=Object.prototype.propertyIsEnumerable,Ut=(Ze,qe,pn)=>qe in Ze?vt(Ze,qe,{enumerable:!0,configurable:!0,writable:!0,value:pn}):Ze[qe]=pn,Gt=(Ze,qe)=>{for(var pn in qe||(qe={}))It.call(qe,pn)&&Ut(Ze,pn,qe[pn]);if(At)for(var pn of At(qe))qt.call(qe,pn)&&Ut(Ze,pn,qe[pn]);return Ze},ge=(Ze,qe)=>St(Ze,Et(qe)),ie=(Ze,qe,pn)=>new Promise((te,Xt)=>{var Qe=Ie=>{try{En(pn.next(Ie))}catch(on){Xt(on)}},On=Ie=>{try{En(pn.throw(Ie))}catch(on){Xt(on)}},En=Ie=>Ie.done?te(Ie.value):Promise.resolve(Ie.value).then(Qe,On);En((pn=pn.apply(Ze,qe)).next())});const Te=ue.default.Group,ve=({className:Ze,title:qe,items:pn=[],value:te,onChange:Xt})=>{const Qe=(pn==null?void 0:pn.length)===(te==null?void 0:te.length),On=(te==null?void 0:te.length)>0&&(te==null?void 0:te.length)<(pn==null?void 0:pn.length),En=Ie=>{const on=pn.map(cn=>cn.id);Xt(Ie.target.checked?on:[])};return ft.createElement(Dt.Z,{align:"middle",className:Ze},!!qe&&ft.createElement("div",{className:"mr20",style:{color:"#5F6368"}},qe),ft.createElement(ue.default,{indeterminate:On,onChange:En,checked:Qe},"\u5168\u90E8"),ft.createElement(Te,{value:te,onChange:Xt},pn.map(Ie=>ft.createElement(ue.default,{className:"ml30 c-black",key:Ie.id,value:Ie.id},Ie.name,ft.createElement("span",null,`(${Ie.count})`)))))};var Ye=({className:Ze,style:qe,dataSource:pn})=>{var te,Xt,Qe,On,En,Ie,on;const[cn,Vn]=(0,ft.useState)({}),[Me,he]=(0,ft.useState)(!0),[Ce,Yn]=(0,ft.useState)(!1),[Si,Rt]=(0,ft.useState)(!1),[Ft,Pt]=(0,ft.useState)(null),[Nt,zt]=(0,ft.useState)(0),[Mt,Yt]=(0,ft.useState)({}),[He,_e]=(0,ft.useState)(!0),[Xe,xe]=(0,ft.useState)(0),[Pe,ke]=(0,ft.useState)(0),[Ve,tn]=(0,ft.useState)(!1),dn=(0,ft.useRef)(null),[fn,ni]=(0,ft.useState)(!1),[Ge,Ke]=(0,ft.useState)(!0),[nn,Qn]=(0,ft.useState)([]),gn={page:1,per_page:5,keyword:"",review:[],question_status:[],success_status:[],sort_by:null,direction:null},[an,zn]=(0,ft.useState)(Gt({},gn));(0,ft.useEffect)(()=>{pn!=null&&pn.question_id&&Vn(pn)},[pn==null?void 0:pn.question_id]),(0,ft.useEffect)(()=>{var Je;if(((Je=cn==null?void 0:cn.exercise_question_resubmit)==null?void 0:Je.status)==="running"){const Hn=setInterval(()=>{wi()},3e3);return()=>clearInterval(Hn)}},[(te=cn==null?void 0:cn.exercise_question_resubmit)==null?void 0:te.status]),(0,ft.useEffect)(()=>{var Je;Si&&(Si===1&&(an.question_status=Wi.map(Hn=>Hn.value),an.review=Cn.map(Hn=>Hn.value)),Si===2&&(an.exercise_question_resubmit_id=(Je=cn==null?void 0:cn.exercise_question_resubmit)==null?void 0:Je.id,Ft===1&&(an.success_status=[1]),Ft===2&&(an.success_status=[0])),zn(Gt({},an)),gi(an),ke(cn!=null&&cn.is_mirror?3:10),xe(cn!=null&&cn.is_mirror?1:5))},[Si]),(0,ft.useEffect)(()=>{fn&&ti()},[fn]);const gi=Je=>ie(void 0,null,function*(){he(!0);const Hn=yield(0,et.ZP)(`/api/exercise_questions/${cn==null?void 0:cn.question_id}/resubmit_student_list.json`,{method:"get",params:Je});(Hn==null?void 0:Hn.status)==0&&(Yt(Hn||[]),zt(Hn==null?void 0:Hn.count)),he(!1)}),ti=()=>ie(void 0,null,function*(){Ke(!0);const Je=yield(0,et.ZP)(`/api/exercise_questions/${cn==null?void 0:cn.question_id}/resubmit_history.json`,{method:"get"});(Je==null?void 0:Je.status)==0&&Qn((Je==null?void 0:Je.data)||[]),Ke(!1)}),wi=()=>ie(void 0,null,function*(){const Je=yield(0,et.ZP)(`/api/exercise_questions/${cn==null?void 0:cn.question_id}/resubmit_status.json`,{method:"get"});(Je==null?void 0:Je.status)==0&&Vn(ge(Gt({},cn),{show_resubmit_history:!0,exercise_question_resubmit:(Je==null?void 0:Je.data)||{}}))}),Wi=[{label:"\u672A\u8BC4\u6D4B",value:2,color:"#9096A3"},{label:"\u672A\u901A\u5173",value:0,color:"#E30000"},{label:"\u5DF2\u901A\u5173",value:1,color:"#00B187"}],Cn=[{label:"\u672A\u8BC4\u9605",value:0,color:"#9096A3"},{label:"\u8BC4\u9605\u4E2D",value:2,color:"#FF9D18"},{label:"\u5DF2\u8BC4\u9605",value:1,color:"#3061D0"}],Pn=[{label:"\u6210\u529F",value:1,color:"#00B187"},{label:"\u5931\u8D25",value:0,color:"#E30000"}],Bn=[{title:"\u5E8F\u53F7",dataIndex:"key",render:(Je,Hn,Ln)=>ft.createElement("span",{className:"c-black"},Ln+1+(an.page-1)*an.per_page)},{title:"\u59D3\u540D",dataIndex:"user_name",render:Je=>ft.createElement("span",{className:"c-black"},Je)},{title:"\u5B66\u53F7",dataIndex:"student_id",sorter:!0,render:Je=>ft.createElement("span",{className:"c-grey-666"},Je||"--")},{title:"\u5206\u73ED",dataIndex:"group_name",render:Je=>ft.createElement("span",{className:"c-black"},Je)},{title:"\u9898\u76EE\u72B6\u6001",dataIndex:"question_status",render:Je=>{const{label:Hn,color:Ln}=Wi.find(jn=>jn.value===Je)||{};return ft.createElement("span",{style:{color:Ln}},Hn)}},{title:"\u9898\u76EE\u5F97\u5206",dataIndex:"question_score",sorter:!0,render:Je=>ft.createElement("span",{className:"c-black"},Je)},{title:"\u6700\u7EC8\u6210\u7EE9",dataIndex:"score",sorter:!0,render:Je=>ft.createElement("span",{className:"c-black"},Je)},{title:"\u8BC4\u9605\u72B6\u6001",dataIndex:"review",render:Je=>{const{label:Hn,color:Ln}=Cn.find(jn=>jn.value===Je)||{};return ft.createElement("span",{style:{color:Ln}},Hn)}},Si===2&&{title:"\u91CD\u65B0\u8BC4\u6D4B\u7ED3\u679C",dataIndex:"success_status",render:Je=>{const{label:Hn,color:Ln}=Pn.find(jn=>jn.value===Je)||{};return ft.createElement("span",{style:{color:Ln}},Hn)}}].filter(Boolean),si=(Je,Hn,Ln)=>{an.page=Je==null?void 0:Je.current,an.per_page=Je==null?void 0:Je.pageSize,Ln!=null&&Ln.order?(an.sort_by=Ln==null?void 0:Ln.field,an.direction=(Ln==null?void 0:Ln.order)==="ascend"?"asc":"desc"):(an.sort_by=null,an.direction=null),zn(Gt({},an)),gi(an)},Ei=()=>{if(!Xe){ee.ZP.warning("\u8BF7\u8F93\u5165\u91CD\u65B0\u8BC4\u6D4B\u4EFB\u52A1\u5E76\u53D1\u4EBA\u6570");return}tn(!0)},ci=()=>ie(void 0,null,function*(){var Je,Hn;if((Je=dn.current)!=null&&Je.onVerify())return;Yn(!0);const Ln=yield(0,et.ZP)(`/api/exercise_questions/${cn==null?void 0:cn.question_id}/resubmit.json`,{method:"post",body:{keyword:an.keyword,question_status:an.question_status,review:an.review_status,success_status:an.success_status,use_max_score:He,permits:Xe,exercise_question_resubmit_id:Si===1?null:(Hn=cn==null?void 0:cn.exercise_question_resubmit)==null?void 0:Hn.id}});(Ln==null?void 0:Ln.status)==0&&(yield wi(),ee.ZP.success("\u64CD\u4F5C\u6210\u529F"),tn(!1),Rt(!1)),Yn(!1)}),Zi=(Je,Hn)=>{an.page=1,an[Hn]=Je,zn(Gt({},an)),gi(an)},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 ft.createElement(ft.Fragment,null,ft.createElement("div",{className:we()(Kt.recalculation,Ze),style:qe},ft.createElement(pe.Z,{title:wt[(cn==null?void 0:cn.disable_resubmit_reason)||0]},ft.createElement(Jt.ZP,{disabled:(cn==null?void 0:cn.disable_resubmit)||((Xt=cn==null?void 0:cn.exercise_question_resubmit)==null?void 0:Xt.status)==="running",onClick:()=>Rt(1),icon:ft.createElement("i",{className:"iconfont icon-zhongxinpingce font14"}),type:"primary",ghost:!0},"\u91CD\u65B0\u8BC4\u6D4B\u7B97\u5206")),(cn==null?void 0:cn.show_resubmit_history)&&ft.createElement(ft.Fragment,null,((Qe=cn==null?void 0:cn.exercise_question_resubmit)==null?void 0:Qe.status)==="running"?ft.createElement("div",{className:"c-grey-666"},"\u91CD\u65B0\u8BC4\u6D4B\u4E2D\uFF0C\u5F53\u524D\u8FDB\u5EA6",ft.createElement("span",{className:"c-light-primary ml3"},(On=cn==null?void 0:cn.exercise_question_resubmit)==null?void 0:On.rate)):ft.createElement("div",{className:"c-grey-666"},"\u91CD\u65B0\u8BC4\u6D4B\u6210\u529F",ft.createElement("span",{onClick:()=>{Rt(2),Pt(1)},className:"current",style:{color:"#3061D0",textDecoration:"underline",margin:"0 3px"}},(En=cn==null?void 0:cn.exercise_question_resubmit)==null?void 0:En.success_student_count),"\u4EBA\uFF0C\u5931\u8D25",ft.createElement("span",{onClick:()=>{Rt(2),Pt(2)},className:"current",style:{color:"#E30000",textDecoration:"underline",margin:"0 3px"}},(Ie=cn==null?void 0:cn.exercise_question_resubmit)==null?void 0:Ie.fail_count),"\u4EBA"),ft.createElement(pe.Z,{title:"\u64CD\u4F5C\u8BB0\u5F55"},ft.createElement("i",{onClick:()=>ni(!0),className:"iconfont icon-chakanshenqingjilu c-light-primary current font14"})))),ft.createElement(jt.default,{centered:!0,open:!!Si,title:`\u91CD\u65B0\u8BC4\u6D4B${Si===1?"\u7B97\u5206":"\u7ED3\u679C"}`,width:870,okText:"\u91CD\u65B0\u8BC4\u6D4B\u7B97\u5206",onCancel:()=>Rt(!1),onOk:Ei,afterClose:()=>{_e(!0),Pt(null),zn(Gt({},gn))}},ft.createElement("div",{className:Kt.filter},Si===1&&ft.createElement(ft.Fragment,null,ft.createElement("div",{className:Kt.tips},ft.createElement("div",{className:"mb5",style:{color:"#FF9D18"}},ft.createElement("i",{className:"iconfont icon-tishi9 mr10 font14"}),"\u6E29\u99A8\u63D0\u793A"),ft.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"),ft.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"),ft.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")),ft.createElement(ve,{className:"mt10",title:"\u9898\u76EE\u72B6\u6001",items:(Mt==null?void 0:Mt.question_status)||[],value:an.question_status,onChange:Je=>Zi(Je,"question_status")}),ft.createElement(ve,{className:"mt10",title:"\u8BC4\u9605\u72B6\u6001",items:(Mt==null?void 0:Mt.review_status)||[],value:an.review,onChange:Je=>Zi(Je,"review")})),Si===2&&ft.createElement(ft.Fragment,null,ft.createElement(ve,{className:"mt10",title:"\u91CD\u65B0\u8BC4\u6D4B\u7ED3\u679C",items:(Mt==null?void 0:Mt.success_status)||[],value:an.success_status,onChange:Je=>Zi(Je,"success_status")})),ft.createElement(pt.t7,{className:Kt.input,style:{bottom:Si===1?10:-5},value:an.keyword,onChange:Je=>Zi(Je,"keyword"),placeholder:"\u8BF7\u8F93\u5165\u59D3\u540D\u6216\u8005\u5B66\u53F7\u641C\u7D22"})),ft.createElement(De.default,{className:"mt20",columns:Bn,scroll:((on=Mt==null?void 0:Mt.data)==null?void 0:on.length)>7?{y:300}:{},dataSource:(Mt==null?void 0:Mt.data)||[],loading:Me,onChange:si,pagination:{total:Nt,pageSize:an.per_page,current:an.page,hideOnSinglePage:!Nt,showSizeChanger:!0,pageSizeOptions:["5","10","20","50","100"],showQuickJumper:!0,size:"default",showTotal:nt.rU}}),ft.createElement(Dt.Z,{justify:"space-between",align:"middle",className:"mt10"},ft.createElement(ue.default,{className:"c-black",checked:He,onChange:Je=>_e(Je.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)()&&ft.createElement("div",{className:"c-black"},"\u91CD\u65B0\u8BC4\u6D4B\u4EFB\u52A1\u5E76\u53D1\u4EBA\u6570",ft.createElement(ae.Z,{className:"ml10 mr10",value:Xe,max:Pe,min:1,precision:0,onChange:Je=>xe(Je)}),"\u4EBA",ft.createElement(pe.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"},ft.createElement("i",{style:{color:"#9096A3"},className:"iconfont icon-tishi5 font13 ml10"}))))),ft.createElement(jt.default,{centered:!0,title:"\u91CD\u65B0\u8BC4\u6D4B\u7B97\u5206",open:Ve,width:494,zIndex:1001,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",confirmLoading:Ce,destroyOnClose:!0,onOk:ci,onCancel:()=>tn(!1)},ft.createElement(Le.default.Item,{className:"mb0",colon:!1,label:"\u9A8C\u8BC1\u7801",name:"code",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u9A8C\u8BC1\u7801"}]},ft.createElement(st.Z,{ref:Je=>dn.current=Je}))),ft.createElement(jt.default,{centered:!0,title:"\u64CD\u4F5C\u8BB0\u5F55",open:fn,width:710,onCancel:()=>ni(!1),footer:null},ft.createElement(Bt.Z,{spinning:Ge},ft.createElement("div",{className:Kt.operating},nn.map((Je,Hn)=>ft.createElement("div",{key:Hn,className:Kt.operatingItem},ft.createElement("div",{style:{flex:"0 0 180px"},className:"c-grey-666"},Je==null?void 0:Je.created_at),ft.createElement("div",{className:"c-black"},Je==null?void 0:Je.user_name,"\u64CD\u4F5C\u4E86\u91CD\u65B0\u8BC4\u6D4B\u7B97\u5206"),(Je==null?void 0:Je.status)==="running"?ft.createElement("div",{className:"c-black"},"\u91CD\u65B0\u8BC4\u6D4B\u4E2D\uFF0C\u5F53\u524D\u8FDB\u5EA6",ft.createElement("span",{className:"c-light-primary ml3"},Je==null?void 0:Je.rate)):ft.createElement("div",{className:"c-black"},"\u91CD\u65B0\u8BC4\u6D4B\u6210\u529F",ft.createElement("span",{style:{color:"#3061D0",margin:"0 3px"}},Je==null?void 0:Je.success_student_count),"\u4EBA\uFF0C\u5931\u8D25",ft.createElement("span",{style:{color:"#E30000",margin:"0 3px"}},Je==null?void 0:Je.fail_count),"\u4EBA")))),ft.createElement("div",{style:{height:20}}))))}},3039:function(Mn,Rn,kt){"use strict";kt.d(Rn,{Z:function(){return pe}});var ft=kt(59301),Kt={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"},le=kt(62957),we="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAPCAYAAADUFP50AAAAAXNSR0IArs4c6QAAAUFJREFUOE+V0ktKw1AUxvH/rVqIxT4wkgwEUSmK4APRBfiYCKU7cOZEBOkadAMZiwhuwJETBQciFRTtwJkPBLW2BRGrRanU9kpN2sSYiGaWc/PjuznnCN2Qh8AkPo+AzXxKLLiPhW7ICtDqB4GzQkqM/huGFZgZcDCBBDaaicsTMKbZH2xfwdY5/ICAEGSasC0AwRYblj+gKkENwfy4WS9V4LHsgsk49EZteJKHdBa6w7AybdZzr3D64ILxGKjtNrx9gfsSRBSYtf6xZh1/u+qQClrIhtdFuHmGvhisJcz65RPsZl2Jc/3QE7FhpgDHuT80x2+O9cR1K/GiCDt3rkQ/+Ns43gDFD0YVmHIuQGOOmiGTARhxwkGd1cZ7Vwd0OppWr3911StpcV++Iwn67q/kyBMuHchErcqwFxT1XZXsfQJqo2zI6kdI4QAAAABJRU5ErkJggg==",ue="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=(Jt,jt,De)=>new Promise((ae,Le)=>{var Bt=ht=>{try{et(De.next(ht))}catch(st){Le(st)}},nt=ht=>{try{et(De.throw(ht))}catch(st){Le(st)}},et=ht=>ht.done?ae(ht.value):Promise.resolve(ht.value).then(Bt,nt);et((De=De.apply(Jt,jt)).next())}),pe=({type:Jt,resdata:jt,onok:De,oktext:ae,okloading:Le})=>{const[Bt,nt]=(0,ft.useState)(!1),{can_copy_list:et,can_copy_num:ht,challenge_type:st,course_data_list:pt,no_copy_list:vt,no_copy_num:St,no_use_list:Et,no_use_num:At,repeat_shixun_num:It,student_count:qt,total_num:Ut,use_num:Gt}=jt;let ge=ht>0||Jt==="exercise";(0,ft.useEffect)(()=>{(jt==null?void 0:jt.student_count)>0&&nt(!0)},[jt]),console.log("---11",Le),(0,ft.useEffect)(()=>{Le||nt(!1)},[Le]);const ie=()=>{if(Jt==="exercise"&&st===1)return ft.createElement(ft.Fragment,null,"\u8BFE\u5802\u5185\u6709",ft.createElement("span",{className:Kt.orangeColor},qt),"\u540D\u5B66\u751F\u5DF2\u5728\u5176\u4ED6\u8003\u8BD5\u4E2D\u6311\u6218\u8FC7\u5176\u4E2D\u7684",ft.createElement("span",{className:Kt.orangeColor},Gt),"\u4E2A\u5B9E\u8DF5\u9879\u76EE\uFF0C",ft.createElement("span",{className:Kt.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(Jt==="exercise"&&st===2)return ft.createElement(ft.Fragment,null,"\u8BFE\u5802\u5185\u6709",ft.createElement("span",{className:Kt.orangeColor},qt),"\u540D\u5B66\u751F\u5DF2\u5728\u8BFE\u5802\u5B9E\u9A8C\u4E2D\u6311\u6218\u8FC7\u5176\u4E2D\u7684",ft.createElement("span",{className:Kt.orangeColor},Gt),"\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",ft.createElement("span",{className:Kt.redColor},"\u91CD\u590D\u53D1\u5E03\u4F1A\u5BFC\u81F4\u8FD9\u90E8\u5206\u5B66\u751F\u65E0\u6CD5\u518D\u63D0\u4EA4\u4F5C\u4E1A\u3002"));if(Jt==="shixun"&&st===1)return ft.createElement(ft.Fragment,null,"\u8BFE\u5802\u5185\u6709",ft.createElement("span",{className:Kt.orangeColor},qt),"\u540D\u5B66\u751F\u5DF2\u5728\u8003\u8BD5\u4E2D\u6311\u6218\u8FC7\u8BE5\u5B9E\u8DF5\u9879\u76EE\uFF0C",ft.createElement("span",{className:Kt.redColor},"\u91CD\u590D\u53D1\u9001\u4F1A\u5BFC\u81F4\u8FD9\u90E8\u5206\u5B66\u751F\u65E0\u6CD5\u518D\u63D0\u4EA4\u4F5C\u4E1A\u3002"));if(Jt==="shixun"&&st===2)return ft.createElement(ft.Fragment,null,"\u8BFE\u5802\u5185\u6709",ft.createElement("span",{className:Kt.orangeColor},qt),"\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",ft.createElement("span",{className:Kt.redColor},"\u91CD\u590D\u53D1\u9001\u4F1A\u5BFC\u81F4\u8FD9\u90E8\u5206\u5B66\u751F\u65E0\u6CD5\u518D\u63D0\u4EA4\u4F5C\u4E1A\u3002"));if(Jt==="subject"&&st===1)return ft.createElement(ft.Fragment,null,"\u8BFE\u5802\u5185\u6709",ft.createElement("span",{className:Kt.orangeColor},qt),"\u540D\u5B66\u751F\u5DF2\u5728\u8003\u8BD5\u4E2D\u6311\u6218\u8FC7\u5176\u4E2D\u7684",ft.createElement("span",{className:Kt.orangeColor},Gt),"\u4E2A\u5B9E\u8DF5\u9879\u76EE\uFF0C",ft.createElement("span",{className:Kt.redColor},"\u91CD\u590D\u53D1\u9001\u4F1A\u5BFC\u81F4\u8FD9\u90E8\u5206\u5B66\u751F\u65E0\u6CD5\u518D\u63D0\u4EA4\u4F5C\u4E1A\u3002"));if(Jt==="subject"&&st===2)return ft.createElement(ft.Fragment,null,"\u8BFE\u5802\u5185\u6709 ",ft.createElement("span",{className:Kt.orangeColor},qt)," \u540D\u5B66\u751F\u5DF2\u5728\u8BFE\u5802\u5B9E\u9A8C\u6311\u6218\u8FC7\u5176\u4E2D\u7684 ",ft.createElement("span",{className:Kt.orangeColor},Gt)," \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",ft.createElement("span",{className:Kt.redColor},"\u91CD\u590D\u53D1\u9001\u4F1A\u5BFC\u81F4\u8FD9\u90E8\u5206\u5B66\u751F\u65E0\u6CD5\u518D\u63D0\u4EA4\u4F5C\u4E1A\u3002"));if(Jt==="exercisepush")return ft.createElement(ft.Fragment,null,"\u8BFE\u5802\u5185\u6709",ft.createElement("span",{className:Kt.orangeColor},qt),"\u540D\u5B66\u751F\u5DF2\u5728\u5176\u4ED6\u8003\u8BD5\u4E2D\u6311\u6218\u8FC7\u8BD5\u5377\u4E2D\u7684",ft.createElement("span",{className:Kt.orangeColor},Gt),"\u4E2A\u5B9E\u8DF5\u9879\u76EE \uFF0C",ft.createElement("span",{className:Kt.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(Jt==="shixunpush"&&st===1)return ft.createElement(ft.Fragment,null,"\u8BFE\u5802\u5185\u6709",ft.createElement("span",{className:Kt.orangeColor},qt),"\u540D\u5B66\u751F\u5DF2\u5728\u8003\u8BD5\u4E2D\u6311\u6218\u8FC7\u5176\u4E2D\u7684",ft.createElement("span",{className:Kt.orangeColor},Gt),"\u4E2A\u5B9E\u8DF5\u9879\u76EE\uFF0C",ft.createElement("span",{className:Kt.redColor},"\u91CD\u590D\u53D1\u5E03\u4F1A\u5BFC\u81F4\u8FD9\u90E8\u5206\u5B66\u751F\u65E0\u6CD5\u518D\u63D0\u4EA4\u4F5C\u4E1A\u3002"));if(Jt==="shixunpush"&&st===2)return ft.createElement(ft.Fragment,null,"\u8BFE\u5802\u5185\u6709",ft.createElement("span",{className:Kt.orangeColor},qt),"\u540D\u5B66\u751F\u5DF2\u5728\u8BFE\u5802\u5B9E\u9A8C\u4E2D\u6311\u6218\u8FC7",ft.createElement("span",{className:Kt.orangeColor},Gt),"\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",ft.createElement("span",{className:Kt.redColor},"\u91CD\u590D\u53D1\u5E03\u4F1A\u5BFC\u81F4\u8FD9\u90E8\u5206\u5B66\u751F\u65E0\u6CD5\u518D\u63D0\u4EA4\u4F5C\u4E1A\u3002"))},Te=()=>{if(Jt==="exercise"||Jt==="subject"||Jt==="exercisepush"||Jt==="shixunpush")return ft.createElement("div",{style:{marginTop:20}},St>0&&ft.createElement("div",null,ft.createElement("span",{className:Kt.flex},ft.createElement("img",{src:ue,style:{width:14}}),ft.createElement("span",{className:Kt.statustitle},"\u4E0D\u652F\u6301\u590D\u5236\u7684\u5B9E\u8DF5\u9879\u76EE")),ft.createElement("div",{className:Kt.statusbody},Jt==="exercise"&&ft.createElement("div",{style:{marginBottom:15}},"\u6CA1\u6709\u590D\u5236\u6743\u9650\u7684\u5B9E\u8DF5\u9879\u76EE\uFF0C",ft.createElement("span",{className:Kt.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"),(Jt==="subject"||Jt==="exercisepush")&&ft.createElement("div",{style:{marginBottom:15}},"\u6CA1\u6709\u590D\u5236\u6743\u9650\u7684\u5B9E\u8DF5\u9879\u76EE\uFF0C",ge&&ft.createElement("span",{className:Kt.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"),Jt==="shixunpush"&&ft.createElement("div",{style:{marginBottom:15}},"\u6CA1\u6709\u590D\u5236\u6743\u9650\u7684\u5B9E\u8DF5\u9879\u76EE\uFF0C",ge&&ft.createElement("span",{className:Kt.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"),ft.createElement("div",null,vt==null?void 0:vt.map((ve,ye)=>ft.createElement("a",{href:`/shixuns/${ve.identifier}/challenges`,target:"_blank"},"\u300A",ve==null?void 0:ve.name,"\u300B",ye+1!==St&&"\u3001"))))),ht>0&&ft.createElement("div",{style:{marginTop:20}},ft.createElement("span",{className:Kt.flex},ft.createElement("img",{src:we,style:{width:14}}),ft.createElement("span",{className:Kt.statustitle},"\u652F\u6301\u590D\u5236\u7684\u5B9E\u8DF5\u9879\u76EE")),ft.createElement("div",{className:Kt.statusbody},Jt==="exercise"&&ft.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"),(Jt==="subject"||Jt==="exercisepush")&&ft.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"),Jt==="shixunpush"&&ft.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"),ft.createElement("div",null,et==null?void 0:et.map((ve,ye)=>ft.createElement("a",{href:`/shixuns/${ve.identifier}/challenges`,target:"_blank"},"\u300A",ve==null?void 0:ve.name,"\u300B",ye+1!==ht&&"\u3001"))))));if(Jt==="shixun")return ft.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 ft.createElement(le.default,{open:Bt,onCancel:()=>{nt(!1)},cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",width:700,centered:!0,cancelButtonProps:{style:{display:!ge&&"none"}},zIndex:1003,confirmLoading:Le,okText:ge?ae:"\u6211\u77E5\u9053\u4E86",onOk:()=>Dt(void 0,null,function*(){ge?yield De([...et,...Et]):nt(!1)})},ft.createElement("div",{style:{maxHeight:600,overflow:"auto"}},ie(),Te()))}},90283:function(Mn,Rn,kt){"use strict";kt.d(Rn,{Z:function(){return Dt}});var ft=kt(59301),Kt={btn:"btn___kReTL",redBtn:"redBtn___UFEL0"},le=kt(92310),we=kt.n(le),Dt=({className:ee,style:pe,state:Jt,onClick:jt})=>{var De,ae;return ft.createElement("div",{onClick:jt,className:we()(Jt?(De=Kt)==null?void 0:De.redBtn:(ae=Kt)==null?void 0:ae.btn,ee),style:pe},Jt?ft.createElement(ft.Fragment,null,ft.createElement("i",{className:"iconfont icon-biaoji1"}),ft.createElement("span",null,"\u53D6\u6D88\u6807\u8BB0\u9519\u9898")):ft.createElement(ft.Fragment,null,ft.createElement("i",{className:"iconfont icon-biaojigaiti"}),ft.createElement("span",null,"\u6807\u8BB0\u9519\u9898")))}},69720:function(Mn,Rn,kt){"use strict";kt.d(Rn,{h:function(){return St}});var ft=kt(59301),Kt=kt(82326),le=kt(28284),we=kt(99571),ue=kt(89780),Dt=kt.n(ue),ee=kt(8336),pe=kt(12469),Jt=Object.defineProperty,jt=Object.defineProperties,De=Object.getOwnPropertyDescriptors,ae=Object.getOwnPropertySymbols,Le=Object.prototype.hasOwnProperty,Bt=Object.prototype.propertyIsEnumerable,nt=(Et,At,It)=>At in Et?Jt(Et,At,{enumerable:!0,configurable:!0,writable:!0,value:It}):Et[At]=It,et=(Et,At)=>{for(var It in At||(At={}))Le.call(At,It)&&nt(Et,It,At[It]);if(ae)for(var It of ae(At))Bt.call(At,It)&&nt(Et,It,At[It]);return Et},ht=(Et,At)=>jt(Et,De(At));const st=Kt.default.Option,pt={labelCol:{span:4},wrapperCol:{span:20}},vt={asp:["ASP","vbscript"],actionscript:["ActionScript(3.0)/Flash/Flex","clike"],bash:["Bash/Bat","shell"],css:["CSS","css"],c:["C","clike"],cpp:["C++","clike"],csharp:["C#","clike"],coffeescript:["CoffeeScript","coffeescript"],d:["D","d"],dart:["Dart","dart"],delphi:["Delphi/Pascal","pascal"],erlang:["Erlang","erlang"],go:["Golang","go"],groovy:["Groovy","groovy"],html:["HTML","text/html"],java:["Java","clike"],json:["JSON","text/json"],javascript:["Javascript","javascript"],lua:["Lua","lua"],less:["LESS","css"],markdown:["Markdown","gfm"],"objective-c":["Objective-C","clike"],php:["PHP","php"],perl:["Perl","perl"],python:["Python","python"],r:["R","r"],rst:["reStructedText","rst"],ruby:["Ruby","ruby"],sql:["SQL","sql"],sass:["SASS/SCSS","sass"],shell:["Shell","shell"],scala:["Scala","clike"],swift:["Swift","clike"],vb:["VB/VBScript","vb"],xml:["XML","text/xml"],yaml:["YAML","yaml"]};Rn.Z=({callback:Et,onCancel:At})=>{const[It,qt]=(0,ft.useState)("python");function Ut(ge){qt(vt[ge][1])}function Gt(ge){Et(ge)}return ft.createElement(le.default,ht(et({},pt),{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:Gt,style:{width:500}}),ft.createElement(le.default.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},ft.createElement(Kt.default,{getPopupContainer:ge=>ge.parentNode,onChange:Ut},Object.keys(vt).map(ge=>ft.createElement(st,{key:ge,value:ge},vt[ge][0])))),ft.createElement(le.default.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},ft.createElement(St,{mode:It})),ft.createElement("div",{className:"flex-container flex-end"},ft.createElement(we.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),ft.createElement(we.ZP,{type:"ghost",onClick:At},"\u53D6\u6D88")))};function St({value:Et,onChange:At,mode:It,options:qt={}}){const Ut=(0,ft.useRef)(),[Gt,ge]=(0,ft.useState)();return(0,ft.useEffect)(()=>{if(Gt){let ie=function(Te){const ve=Te.getValue();At&&At(ve)};return Gt.on("change",ie),()=>{Gt.off("change",ie)}}},[Gt,At]),(0,ft.useEffect)(()=>{Gt&&Gt.setOption("mode",It)},[Gt,It]),(0,ft.useEffect)(()=>{Gt&&(Et!==Gt.getValue()||Et==="")&&setTimeout(()=>{Gt.setValue(Et||"")},300)},[Gt,Et]),(0,ft.useEffect)(()=>{if(Ut.current&&!Gt){const ie=Dt().fromTextArea(Ut.current,et({mode:It,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},qt));ge(ie)}},[Ut.current,Gt]),ft.createElement("div",{className:"my-codemirror-container"},ft.createElement("textarea",{ref:Ut}))}},39793:function(Mn,Rn,kt){"use strict";kt.d(Rn,{Z:function(){return Yi}});var ft=kt(59301),Kt=kt(89780),le=kt.n(Kt),we=kt(76374),ue=kt(8336),Dt=kt(6313),ee=kt(25717),pe=kt(99498),Jt=kt(25419),jt=kt(67549),De=kt(76902),ae=({value:Be="",className:Se,showTextOnly:Ee,showLines:Ue,style:xi={}})=>{const Kn=(0,ft.useMemo)(()=>"",[Be]);return ft.createElement(ft.Fragment,null,ft.createElement("div",{dangerouslySetInnerHTML:{__html:Kn}}))},Le=Object.defineProperty,Bt=Object.defineProperties,nt=Object.getOwnPropertyDescriptors,et=Object.getOwnPropertySymbols,ht=Object.prototype.hasOwnProperty,st=Object.prototype.propertyIsEnumerable,pt=(Be,Se,Ee)=>Se in Be?Le(Be,Se,{enumerable:!0,configurable:!0,writable:!0,value:Ee}):Be[Se]=Ee,vt=(Be,Se)=>{for(var Ee in Se||(Se={}))ht.call(Se,Ee)&&pt(Be,Ee,Se[Ee]);if(et)for(var Ee of et(Se))st.call(Se,Ee)&&pt(Be,Ee,Se[Ee]);return Be},St=(Be,Se)=>Bt(Be,nt(Se));let Et=[{title:"\u7C97\u4F53",icon:"md-iconfont icon-bold",actionName:"bold"},{title:"\u659C\u4F53",icon:"md-iconfont icon-italic",actionName:"italic"},"|",{title:"\u65E0\u5E8F\u5217\u8868",icon:"md-iconfont icon-unorder-list",actionName:"list-ul"},{title:"\u6709\u5E8F\u5217\u8868",icon:"md-iconfont icon-order-list",actionName:"list-ol"},"|",{title:"\u884C\u5185\u4EE3\u7801",icon:"md-iconfont icon-code",actionName:"code"},{title:"\u4EE3\u7801\u5757\uFF08\u591A\u8BED\u8A00\u98CE\u683C\uFF09",icon:"md-iconfont icon-file-code",actionName:"code-block"},{title:"\u94FE\u63A5",icon:"md-iconfont icon-link",actionName:"link"},"|",{title:"\u884C\u5185\u516C\u5F0F",icon:"md-iconfont icon-sum",actionName:"inline-latex"},{title:"\u6570\u5B66\u516C\u5F0F",icon:"iconfont icon-shuxuetuxiang2",actionName:"maths-latex"},{title:"\u591A\u884C\u516C\u5F0F",icon:"md-iconfont icon-formula",actionName:"latex"},"|",{title:"\u6DFB\u52A0\u56FE\u7247",icon:"md-iconfont icon-picture",actionName:"upload-image"},{title:"\u63D2\u5165\u753B\u56FE",icon:"iconfont icon-sheji",actionName:"draw-image"},{title:"\u63D2\u5165\u6D41\u7A0B\u56FE",icon:"iconfont icon-liucheng",actionName:"add-flowchart"},{title:"\u8868\u683C",icon:"md-iconfont icon-table",actionName:"add-table"},"|",{title:"\u6362\u884C",icon:"md-iconfont icon-minus",actionName:"line-break"},{title:"\u6E05\u7A7A",icon:"md-iconfont icon-eraser",actionName:"eraser"}];function At({onActionCallback:Be,title:Se,icon:Ee,actionName:Ue,className:xi="",children:Kn}){function Pi(){Be(Ue)}return ft.createElement("a",{title:Se,className:xi,onClick:Pi},ft.createElement("i",{className:`${Ee}`}),Kn)}var It=({watch:Be,showNullButton:Se,showNullProgramButton:Ee,onActionCallback:Ue,fullScreen:xi,insertTemp:Kn,hidetoolBar:Pi,extraUse:$e})=>{const Gn=[...Et,{title:`${Be?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"}`,icon:`${Be?"md-iconfont icon-eye-slash":"md-iconfont icon-eye"}`,actionName:"trigger-watch"}];return ft.createElement("ul",{className:"markdown-toolbar-container"},!Pi&&Gn.map((Ai,ji)=>ft.createElement("li",{key:ji},Ai.actionName?ft.createElement(At,St(vt({},Ai),{onActionCallback:Ue})):ft.createElement("span",{className:"v-line"}))),Se?ft.createElement("li",null,ft.createElement(At,{icon:"md-iconfont icon-edit insert-blank",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:Ue},ft.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,Ee?ft.createElement(ft.Fragment,null,ft.createElement("li",null,ft.createElement(At,{icon:"md-iconfont icon-edit insert-blank",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-signal",onActionCallback:Ue},ft.createElement("span",{className:"fill-tip"},"\u6DFB\u52A0\u5355\u884C\u586B\u7A7A\u9879"))),ft.createElement("li",null,ft.createElement(At,{icon:"md-iconfont icon-uniE900 insert-blank",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-multiple",onActionCallback:Ue},ft.createElement("span",{className:"fill-tip"},"\u6DFB\u52A0\u591A\u884C\u586B\u7A7A\u9879")))):null,Kn&&ft.createElement("li",null,ft.createElement(At,{icon:"md-iconfont icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:`inster-template-${Kn}`,onActionCallback:Ue},ft.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),$e&&ft.createElement("li",null,$e),ft.createElement("li",{className:"btn-full-screen"},ft.createElement(At,{icon:`${xi?"md-iconfont icon-shrink":"md-iconfont icon-enlarge"}`,title:xi?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:Ue})))},qt=kt(91558),Ut=kt(28284),Gt=kt(37568),ge=kt(99571),ie=Object.defineProperty,Te=Object.defineProperties,ve=Object.getOwnPropertyDescriptors,ye=Object.getOwnPropertySymbols,Ye=Object.prototype.hasOwnProperty,Ze=Object.prototype.propertyIsEnumerable,qe=(Be,Se,Ee)=>Se in Be?ie(Be,Se,{enumerable:!0,configurable:!0,writable:!0,value:Ee}):Be[Se]=Ee,pn=(Be,Se)=>{for(var Ee in Se||(Se={}))Ye.call(Se,Ee)&&qe(Be,Ee,Se[Ee]);if(ye)for(var Ee of ye(Se))Ze.call(Se,Ee)&&qe(Be,Ee,Se[Ee]);return Be},te=(Be,Se)=>Te(Be,ve(Se));const Xt={labelCol:{span:4},wrapperCol:{span:20}};var Qe=({callback:Be,onCancel:Se})=>{function Ee(Ue){Be(Ue)}return ft.createElement(Ut.default,te(pn({},Xt),{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:Ee,style:{width:500}}),ft.createElement(Ut.default.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},ft.createElement(Gt.default,null)),ft.createElement(Ut.default.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},ft.createElement(Gt.default,null)),ft.createElement("div",{className:"flex-container flex-end"},ft.createElement(ge.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),ft.createElement(ge.ZP,{type:"ghost",onClick:Se},"\u53D6\u6D88")))},On=kt(69720),En=kt(17077),Ie=kt(62957),on=kt(77019),cn=kt(9507),Vn=kt(59301),Me=({callback:Be,onCancel:Se})=>{const Ee=document.createElement("canvas"),Ue=Ee.getContext("2d");Ee.width=1e3,Ee.height=800,Ue.fillStyle="#ffffff",Ue.fillRect(0,0,Ee.width,Ee.height);const xi=Ee.toDataURL("image/png");return Vn.createElement(Ie.default,{open:!0,width:"100vw",style:{height:"100vh",top:0},footer:null,title:null,closable:!1},Vn.createElement(on.Z,{style:{height:"100vh"}},Vn.createElement(cn.Z,{fullWidth:!0,noAssociationId:!0,showFullTools:!0,data:{src:xi,visible:!0,title:String(Date.now())},onOk:Kn=>{Be({src:Kn.url})},onClose:Se})))},he=kt(12378);function Ce(){go.CommandHandler.call(this),this._arrowKeyBehavior="move",this._pasteOffset=new go.Point(10,10),this._lastPasteOffset=new go.Point(0,0)}go.Diagram.inherit(Ce,go.CommandHandler),Ce.prototype.canAlignSelection=function(){var Be=this.diagram;return!(Be===null||Be.isReadOnly||Be.isModelReadOnly||Be.selection.count<2)},Ce.prototype.alignLeft=function(){var Be=this.diagram;Be.startTransaction("aligning left");var Se=1/0;Be.selection.each(function(Ee){Ee instanceof go.Link||(Se=Math.min(Ee.position.x,Se))}),Be.selection.each(function(Ee){Ee instanceof go.Link||Ee.move(new go.Point(Se,Ee.position.y))}),Be.commitTransaction("aligning left")},Ce.prototype.alignRight=function(){var Be=this.diagram;Be.startTransaction("aligning right");var Se=-1/0;Be.selection.each(function(Ee){if(!(Ee instanceof go.Link)){var Ue=Ee.actualBounds.x+Ee.actualBounds.width;Se=Math.max(Ue,Se)}}),Be.selection.each(function(Ee){Ee instanceof go.Link||Ee.move(new go.Point(Se-Ee.actualBounds.width,Ee.position.y))}),Be.commitTransaction("aligning right")},Ce.prototype.alignTop=function(){var Be=this.diagram;Be.startTransaction("alignTop");var Se=1/0;Be.selection.each(function(Ee){Ee instanceof go.Link||(Se=Math.min(Ee.position.y,Se))}),Be.selection.each(function(Ee){Ee instanceof go.Link||Ee.move(new go.Point(Ee.position.x,Se))}),Be.commitTransaction("alignTop")},Ce.prototype.alignBottom=function(){var Be=this.diagram;Be.startTransaction("aligning bottom");var Se=-1/0;Be.selection.each(function(Ee){if(!(Ee instanceof go.Link)){var Ue=Ee.actualBounds.y+Ee.actualBounds.height;Se=Math.max(Ue,Se)}}),Be.selection.each(function(Ee){Ee instanceof go.Link||Ee.move(new go.Point(Ee.actualBounds.x,Se-Ee.actualBounds.height))}),Be.commitTransaction("aligning bottom")},Ce.prototype.alignCenterX=function(){var Be=this.diagram,Se=Be.selection.first();if(Se){Be.startTransaction("aligning Center X");var Ee=Se.actualBounds.x+Se.actualBounds.width/2;Be.selection.each(function(Ue){Ue instanceof go.Link||Ue.move(new go.Point(Ee-Ue.actualBounds.width/2,Ue.actualBounds.y))}),Be.commitTransaction("aligning Center X")}},Ce.prototype.alignCenterY=function(){var Be=this.diagram,Se=Be.selection.first();if(Se){Be.startTransaction("aligning Center Y");var Ee=Se.actualBounds.y+Se.actualBounds.height/2;Be.selection.each(function(Ue){Ue instanceof go.Link||Ue.move(new go.Point(Ue.actualBounds.x,Ee-Ue.actualBounds.height/2))}),Be.commitTransaction("aligning Center Y")}},Ce.prototype.alignColumn=function(Be){var Se=this.diagram;Se.startTransaction("align Column"),Be===void 0&&(Be=0),Be=parseFloat(Be);var Ee=new Array;Se.selection.each(function($e){$e instanceof go.Link||Ee.push($e)});for(var Ue=0;Ue<Ee.length-1;Ue++){var xi=Ee[Ue],Kn=xi.actualBounds.y+xi.actualBounds.height+Be,Pi=Ee[Ue+1];Pi.move(new go.Point(xi.actualBounds.x,Kn))}Se.commitTransaction("align Column")},Ce.prototype.alignRow=function(Be){Be===void 0&&(Be=0),Be=parseFloat(Be);var Se=this.diagram;Se.startTransaction("align Row");var Ee=new Array;Se.selection.each(function($e){$e instanceof go.Link||Ee.push($e)});for(var Ue=0;Ue<Ee.length-1;Ue++){var xi=Ee[Ue],Kn=xi.actualBounds.x+xi.actualBounds.width+Be,Pi=Ee[Ue+1];Pi.move(new go.Point(Kn,xi.actualBounds.y))}Se.commitTransaction("align Row")},Ce.prototype.canRotate=function(Be){var Se=this.diagram;return!(Se===null||Se.isReadOnly||Se.isModelReadOnly||Se.selection.count<1)},Ce.prototype.rotate=function(Be){Be===void 0&&(Be=90);var Se=this.diagram;Se.startTransaction("rotate "+Be.toString());var Se=this.diagram;Se.selection.each(function(Ee){Ee instanceof go.Link||Ee instanceof go.Group||(Ee.angle+=Be)}),Se.commitTransaction("rotate "+Be.toString())},Ce.prototype.pullToFront=function(){var Be=this.diagram;Be.startTransaction("pullToFront");var Se=new go.Map;Be.selection.each(function(Ee){Se.set(Ee.layer,0)}),Se.iteratorKeys.each(function(Ee){var Ue=0;Ee.parts.each(function(xi){if(!xi.isSelected){var Kn=xi.zOrder;isNaN(Kn)?xi.zOrder=0:Ue=Math.max(Ue,Kn)}}),Se.set(Ee,Ue)}),Be.selection.each(function(Ee){Ce._assignZOrder(Ee,Se.get(Ee.layer)+1)}),Be.commitTransaction("pullToFront")},Ce.prototype.pushToBack=function(){var Be=this.diagram;Be.startTransaction("pushToBack");var Se=new go.Map;Be.selection.each(function(Ee){Se.set(Ee.layer,0)}),Se.iteratorKeys.each(function(Ee){var Ue=0;Ee.parts.each(function(xi){if(!xi.isSelected){var Kn=xi.zOrder;isNaN(Kn)?xi.zOrder=0:Ue=Math.min(Ue,Kn)}}),Se.set(Ee,Ue)}),Be.selection.each(function(Ee){Ce._assignZOrder(Ee,Se.get(Ee.layer)-1-Ce._findGroupDepth(Ee))}),Be.commitTransaction("pushToBack")},Ce._assignZOrder=function(Be,Se,Ee){Ee===void 0&&(Ee=Be),Be.layer===Ee.layer&&(Be.zOrder=Se),Be instanceof go.Group&&Be.memberParts.each(function(Ue){Ce._assignZOrder(Ue,Se+1,Ee)})},Ce._findGroupDepth=function(Be){if(Be instanceof go.Group){var Se=0;return Be.memberParts.each(function(Ee){Se=Math.max(Se,Ce._findGroupDepth(Ee))}),Se+1}else return 0},Ce.prototype.doKeyDown=function(){var Be=this.diagram;if(Be!==null){var Se=Be.lastInput;if(Se.key==="Up"||Se.key==="Down"||Se.key==="Left"||Se.key==="Right"){var Ee=this.arrowKeyBehavior;if(Ee==="none")return;if(Ee==="select"){this._arrowKeySelect();return}else if(Ee==="move"){this._arrowKeyMove();return}else if(Ee==="tree"){this._arrowKeyTree();return}}go.CommandHandler.prototype.doKeyDown.call(this)}},Ce.prototype._getAllParts=function(){var Be=new Array;return this.diagram.nodes.each(function(Se){Be.push(Se)}),this.diagram.parts.each(function(Se){Be.push(Se)}),Be},Ce.prototype._arrowKeyMove=function(){var Be=this.diagram,Se=Be.lastInput,Ee=0,Ue=0;if(Se.control||Se.meta)Ee=1,Ue=1;else if(Be.grid!==null){var xi=Be.grid.gridCellSize;Ue=xi.width,Ee=xi.height}Be.startTransaction("arrowKeyMove"),Be.selection.each(function(Kn){Se.key==="Up"?Kn.move(new go.Point(Kn.actualBounds.x,Kn.actualBounds.y-Ee)):Se.key==="Down"?Kn.move(new go.Point(Kn.actualBounds.x,Kn.actualBounds.y+Ee)):Se.key==="Left"?Kn.move(new go.Point(Kn.actualBounds.x-Ue,Kn.actualBounds.y)):Se.key==="Right"&&Kn.move(new go.Point(Kn.actualBounds.x+Ue,Kn.actualBounds.y))}),Be.commitTransaction("arrowKeyMove")},Ce.prototype._arrowKeySelect=function(){var Be=this.diagram,Se=Be.lastInput,Ee=null;Se.key==="Up"?Ee=this._findNearestPartTowards(270):Se.key==="Down"?Ee=this._findNearestPartTowards(90):Se.key==="Left"?Ee=this._findNearestPartTowards(180):Se.key==="Right"&&(Ee=this._findNearestPartTowards(0)),Ee!==null&&(Se.shift?Ee.isSelected=!0:Se.control||Se.meta?Ee.isSelected=!Ee.isSelected:Be.select(Ee))},Ce.prototype._findNearestPartTowards=function(Be){var Se=this.diagram.selection.first();if(Se===null)return null;for(var Ee=Se.actualBounds.center,Ue=this._getAllParts(),xi=1/0,Kn=Se,Pi=0;Pi<Ue.length;Pi++){var $e=Ue[Pi];if($e!==Se&&$e.canSelect()){var Gn=$e.actualBounds.center,Ai=Ee.directionPoint(Gn),ji=this._angleCloseness(Ai,Be);if(ji<=45){var Tn=Ee.distanceSquaredPoint(Gn);Tn*=1+Math.sin(ji*Math.PI/180),Tn<xi&&(xi=Tn,Kn=$e)}}}return Kn},Ce.prototype._angleCloseness=function(Be,Se){return Math.min(Math.abs(Se-Be),Math.min(Math.abs(Se+360-Be),Math.abs(Se-360-Be)))},Ce.prototype._arrowKeyTree=function(){var Be=this.diagram,Se=Be.selection.first();if(Se instanceof go.Node){var Ee=Be.lastInput;if(Ee.key==="Right"){if(!Se.isTreeLeaf)if(!Se.isTreeExpanded)Be.commandHandler.canExpandTree(Se)&&Be.commandHandler.expandTree(Se);else{var Ue=this._sortTreeChildrenByY(Se).first();Ue!==null&&Be.select(Ue)}}else if(Ee.key==="Left")if(!Se.isTreeLeaf&&Se.isTreeExpanded)Be.commandHandler.canCollapseTree(Se)&&Be.commandHandler.collapseTree(Se);else{var xi=Se.findTreeParentNode();xi!==null&&Be.select(xi)}else if(Ee.key==="Up"){var xi=Se.findTreeParentNode();if(xi!==null){var Kn=this._sortTreeChildrenByY(xi),Pi=Kn.indexOf(Se);if(Pi>0){for(var $e=Kn.elt(Pi-1);$e!==null&&$e.isTreeExpanded&&!$e.isTreeLeaf;){var Gn=this._sortTreeChildrenByY($e);$e=Gn.last()}$e!==null&&Be.select($e)}else Be.select(xi)}}else if(Ee.key==="Down")if(Se.isTreeExpanded&&!Se.isTreeLeaf){var Ue=this._sortTreeChildrenByY(Se).first();Ue!==null&&Be.select(Ue)}else for(;Se!==null;){var xi=Se.findTreeParentNode();if(xi===null)break;var Kn=this._sortTreeChildrenByY(xi),Pi=Kn.indexOf(Se);if(Pi<Kn.length-1){Be.select(Kn.elt(Pi+1));break}else Se=xi}var Ai=Be.selection.first();Ai!==null&&Be.scrollToRect(Ai.actualBounds)}},Ce.prototype._sortTreeChildrenByY=function(Be){var Se=new go.List().addAll(Be.findTreeChildrenNodes());return Se.sort(function(Ee,Ue){var xi=Ee.location,Kn=Ue.location;return xi.y<Kn.y?-1:xi.y>Kn.y?1:xi.x<Kn.x?-1:xi.x>Kn.x?1:0}),Se},Ce.prototype.copyToClipboard=function(Be){go.CommandHandler.prototype.copyToClipboard.call(this,Be),this._lastPasteOffset.set(this.pasteOffset)},Ce.prototype.pasteFromClipboard=function(){var Be=go.CommandHandler.prototype.pasteFromClipboard.call(this);return this.diagram.moveParts(Be,this._lastPasteOffset),this._lastPasteOffset.add(this.pasteOffset),Be},Object.defineProperty(Ce.prototype,"arrowKeyBehavior",{get:function(){return this._arrowKeyBehavior},set:function(Be){if(Be!=="move"&&Be!=="select"&&Be!=="scroll"&&Be!=="tree"&&Be!=="none")throw new Error('DrawCommandHandler.arrowKeyBehavior must be either "move", "select", "scroll", "tree", or "none", not: '+Be);this._arrowKeyBehavior=Be}}),Object.defineProperty(Ce.prototype,"pasteOffset",{get:function(){return this._pasteOffset},set:function(Be){if(!(Be instanceof go.Point))throw new Error("DrawCommandHandler.pasteOffset must be a Point, not: "+Be);this._pasteOffset.set(Be)}});var Yn=Ce,Si=kt(63720),Rt=kt(5269),Ft=kt(38986),Pt={myPaletteDiv:"myPaletteDiv___Xjz2I",flowChartWrp:"flowChartWrp____f45r",maxH60:"maxH60___Pd4Re"},Nt=kt(48790),zt=kt(59301),Mt=(Be,Se,Ee)=>new Promise((Ue,xi)=>{var Kn=Gn=>{try{$e(Ee.next(Gn))}catch(Ai){xi(Ai)}},Pi=Gn=>{try{$e(Ee.throw(Gn))}catch(Ai){xi(Ai)}},$e=Gn=>Gn.done?Ue(Gn.value):Promise.resolve(Gn.value).then(Kn,Pi);$e((Ee=Ee.apply(Be,Se)).next())});function Yt({onCancel:Be,callback:Se}){let Ee=(0,ft.useRef)(),Ue=(0,ft.useRef)(),xi=(0,ft.useRef)(),Kn=(0,ft.useRef)(!1);const Pi=(0,ft.useRef)(!1),[$e,Gn]=(0,ft.useState)(0);function Ai(){const Tn=he.bx.make,Qt={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"};Ee.current=new he.S0(Ue.current,{padding:20,grid:Tn(he.s_,"Grid",Tn(he.bn,"LineH",{stroke:"lightgray",strokeWidth:.5}),Tn(he.bn,"LineV",{stroke:"lightgray",strokeWidth:.5})),"draggingTool.isGridSnapEnabled":!0,handlesDragDropForTopLevelParts:!0,mouseDrop:Ae=>{var ri=Ae.diagram.commandHandler.addTopLevelParts(Ae.diagram.selection,!0);ri||Ae.diagram.currentTool.doCancel()},commandHandler:Tn(Yn),"clickCreatingTool.archetypeNodeData":{text:"\u672A\u547D\u540D",fill:null,stroke:null,borderColor:"rgba(0,0,0,0)"},PartCreated:Ae=>{var ri=Ae.subject;ri.location=ri.location.copy().snapToGridPoint(Ae.diagram.grid.gridOrigin,Ae.diagram.grid.gridCellSize),setTimeout(()=>{Ae.diagram.commandHandler.editTextBlock()},20)},"commandHandler.archetypeGroupData":{isGroup:!0,text:"NEW GROUP"},SelectionGrouped:Ae=>{var ri=Ae.subject;setTimeout(()=>{Ae.diagram.commandHandler.editTextBlock()})},LinkRelinked:Ae=>{var ri=Ae.parameter.part;ri.invalidateConnectedLinks();var Ri=Ae.subject;Ae.diagram.toolManager.linkingTool.isForwards?Ri.toNode.invalidateConnectedLinks():Ri.fromNode.invalidateConnectedLinks()},"undoManager.isEnabled":!0}),Ee.current.nodeTemplate=Tn(he.NB,"Auto",{locationSpot:he.z6.Center,locationObjectName:"SHAPE",desiredSize:new he.$u(120,60),minSize:new he.$u(40,40),resizable:!0,resizeCellSize:new he.$u(10,10),rotatable:!0},new he.KX("location","loc",he.E9.parse).makeTwoWay(he.E9.stringify),new he.KX("desiredSize","size",he.$u.parse).makeTwoWay(he.$u.stringify),Tn(he.bn,{name:"SHAPE",fill:Qt.white,cursor:"pointer",portId:"",fromLinkable:!0,toLinkable:!0,fromLinkableDuplicates:!0,toLinkableDuplicates:!0,fromSpot:he.z6.AllSides,toSpot:he.z6.AllSides},new he.KX("figure"),new he.KX("fill"),new he.KX("stroke","borderColor"),new he.KX("strokeWidth","thickness"),new he.KX("strokeDashArray","dash")),Tn(he.bn,{width:100,height:20,strokeWidth:0,fill:"transparent"}),Tn(he.al,{margin:1,textAlign:"center",overflow:he.al.OverflowEllipsis,editable:!0},new he.KX("text").makeTwoWay(),new he.KX("stroke","color"))),Ee.current.nodeTemplate.toolTip=Tn("ToolTip",Tn(he.s_,"Vertical",{maxSize:new he.$u(200,NaN)},Tn(he.al,{font:"bold 10pt sans-serif",textAlign:"center"},new he.KX("text")),Tn(he.al,{font:"10pt sans-serif",textAlign:"center"},new he.KX("text","details"))));function me(Ae,ri){var Ri=(fi,br)=>{fi.handled=!0,fi.diagram.model.commit(ur=>{var Lr=br.part.adornedPart,Dr=new he.E9().setRectSpot(Lr.actualBounds,Ae);Dr.subtract(Lr.location),Dr.scale(2,2),Dr.x+=Math.sign(Dr.x)*130,Dr.y+=Math.sign(Dr.y)*130,Dr.add(Lr.location),Dr.snapToGridPoint(fi.diagram.grid.gridOrigin,fi.diagram.grid.gridCellSize);var Zr=ur.copyNodeData(Lr.data);ur.setGroupKeyForNodeData(Zr,ur.getGroupKeyForNodeData(Lr.data)),ur.addNodeData(Zr);var Jr={from:Lr.key,to:ur.getKeyForNodeData(Zr)};ur.addLinkData(Jr);var un=fi.diagram.findNodeForData(Zr);un.location=Dr,fi.diagram.select(un),setTimeout(()=>{fi.diagram.commandHandler.editTextBlock()},20)})};return Tn(he.bn,{figure:ri,alignment:Ae,alignmentFocus:Ae.opposite(),width:Ae.equals(he.z6.Top)||Ae.equals(he.z6.Bottom)?25:18,height:Ae.equals(he.z6.Top)||Ae.equals(he.z6.Bottom)?18:25,fill:"orange",stroke:Qt.white,strokeWidth:4,mouseEnter:(fi,br)=>br.fill="dodgerblue",mouseLeave:(fi,br)=>br.fill="orange",isActionable:!0,click:Ri,contextClick:Ri})}function bn(Ae){return Tn(he.bn,{fill:"orange",stroke:"rgba(0, 0, 0, 0)",strokeWidth:15,background:"transparent",geometryString:"F1 M0 0 b 0 360 -4 0 4 z M10 0 b 0 360 -4 0 4 z M20 0 b 0 360 -4 0 4",isActionable:!0,cursor:"context-menu",mouseEnter:(ri,Ri)=>Ri.fill="dodgerblue",mouseLeave:(ri,Ri)=>Ri.fill="orange",click:(ri,Ri)=>{ri.diagram.commandHandler.showContextMenu(Ri.part.adornedPart)}},Ae||{})}Ee.current.nodeTemplate.selectionAdornmentTemplate=Tn(he.uz,"Spot",Tn(he.Vm,{padding:10}),me(he.z6.Top,"TriangleUp"),me(he.z6.Left,"TriangleLeft"),me(he.z6.Right,"TriangleRight"),me(he.z6.Bottom,"TriangleDown"),bn({alignment:new he.z6(.75,0)}));function _n(Ae,ri){return(Ri,fi)=>{Ri.handled=!0,Ri.diagram.model.commit(br=>{br.set(fi.part.adornedPart.data,Ae,ri)})}}function ze(Ae,ri){return ri||(ri="color"),Tn(he.bn,{width:16,height:16,stroke:"lightgray",fill:Ae,margin:1,background:"transparent",mouseEnter:(Ri,fi)=>fi.stroke="dodgerblue",mouseLeave:(Ri,fi)=>fi.stroke="lightgray",click:_n(ri,Ae),contextClick:_n(ri,Ae)})}function hn(){return[Tn("ContextMenuButton",Tn(he.s_,"Horizontal",ze(Qt.white,"fill"),ze(Qt.beige,"fill"),ze(Qt.extralightblue,"fill"),ze(Qt.extralightred,"fill"))),Tn("ContextMenuButton",Tn(he.s_,"Horizontal",ze(Qt.lightgray,"fill"),ze(Qt.lightgreen,"fill"),ze(Qt.lightblue,"fill"),ze(Qt.lightred,"fill")))]}function Nn(){return[Tn("ContextMenuButton",Tn(he.s_,"Horizontal",ze(Qt.black),ze(Qt.green),ze(Qt.blue),ze(Qt.red))),Tn("ContextMenuButton",Tn(he.s_,"Horizontal",ze(Qt.white),ze(Qt.magenta),ze(Qt.purple),ze(Qt.orange)))]}function In(Ae,ri){return ri||(ri="thickness"),Tn(he.bn,"LineH",{width:16,height:16,strokeWidth:Ae,margin:1,background:"transparent",mouseEnter:(Ri,fi)=>fi.background="dodgerblue",mouseLeave:(Ri,fi)=>fi.background="transparent",click:_n(ri,Ae),contextClick:_n(ri,Ae)})}function vi(Ae,ri){return ri||(ri="dash"),Tn(he.bn,"LineH",{width:24,height:16,strokeWidth:2,strokeDashArray:Ae,margin:1,background:"transparent",mouseEnter:(Ri,fi)=>fi.background="dodgerblue",mouseLeave:(Ri,fi)=>fi.background="transparent",click:_n(ri,Ae),contextClick:_n(ri,Ae)})}function Jn(){return[Tn("ContextMenuButton",Tn(he.s_,"Horizontal",In(1),In(2),In(3),In(4))),Tn("ContextMenuButton",Tn(he.s_,"Horizontal",vi(null),vi([2,4]),vi([4,4])))]}function ii(Ae,ri){return ri||(ri="figure"),Tn(he.bn,{width:32,height:32,scale:.5,fill:"lightgray",figure:Ae,margin:1,background:"transparent",mouseEnter:(Ri,fi)=>fi.fill="dodgerblue",mouseLeave:(Ri,fi)=>fi.fill="lightgray",click:_n(ri,Ae),contextClick:_n(ri,Ae)})}Ee.current.nodeTemplate.contextMenu=Tn("ContextMenu",Tn("ContextMenuButton",Tn(he.s_,"Horizontal",ii("Rectangle"),ii("RoundedRectangle"),ii("Ellipse"),ii("Diamond"))),Tn("ContextMenuButton",Tn(he.s_,"Horizontal",ii("Parallelogram2"),ii("ManualOperation"),ii("Procedure"),ii("Cylinder1"))),Tn("ContextMenuButton",Tn(he.s_,"Horizontal",ii("Terminator"),ii("CreateRequest"),ii("Document"),ii("TriangleDown"))),hn(),Nn(),Jn()),Ee.current.groupTemplate=Tn(he.ZA,"Spot",{layerName:"Background",ungroupable:!0,locationSpot:he.z6.Center,selectionObjectName:"BODY",computesBoundsAfterDrag:!0,handlesDragDropForMembers:!0,mouseDrop:(Ae,ri)=>{var Ri=ri.addMembers(ri.diagram.selection,!0);Ri||ri.diagram.currentTool.doCancel()},avoidable:!1},new he.KX("location","loc",he.E9.parse).makeTwoWay(he.E9.stringify),Tn(he.s_,"Auto",{name:"BODY"},Tn(he.bn,{parameter1:10,fill:Qt.white,strokeWidth:2,cursor:"pointer",fromLinkable:!0,toLinkable:!0,fromLinkableDuplicates:!0,toLinkableDuplicates:!0,fromSpot:he.z6.AllSides,toSpot:he.z6.AllSides},new he.KX("fill"),new he.KX("stroke","color"),new he.KX("strokeWidth","thickness"),new he.KX("strokeDashArray","dash")),Tn(he.Vm,{background:"transparent",margin:20})),Tn(he.al,{alignment:he.z6.Top,alignmentFocus:he.z6.Bottom,font:"bold 12pt sans-serif",editable:!0},new he.KX("text"),new he.KX("stroke","color"))),Ee.current.groupTemplate.selectionAdornmentTemplate=Tn(he.uz,"Spot",Tn(he.s_,"Auto",Tn(he.bn,{fill:null,stroke:"dodgerblue",strokeWidth:3}),Tn(he.Vm,{margin:1.5})),bn({alignment:he.z6.TopRight,alignmentFocus:he.z6.BottomRight})),Ee.current.groupTemplate.contextMenu=Tn("ContextMenu",hn(),Nn(),Jn()),Ee.current.linkTemplate=Tn(he.rU,{layerName:"Foreground",routing:he.rU.AvoidsNodes,corner:10,fromShortLength:10,toShortLength:15,relinkableFrom:!0,relinkableTo:!0,reshapable:!0,resegmentable:!0},new he.KX("fromSpot","fromSpot",he.z6.parse),new he.KX("toSpot","toSpot",he.z6.parse),new he.KX("fromShortLength","dir",Ae=>Ae>=1?10:0),new he.KX("toShortLength","dir",Ae=>Ae>=1?10:0),new he.KX("points").makeTwoWay(),Tn(he.bn,{strokeWidth:2},new he.KX("stroke","color"),new he.KX("strokeWidth","thickness"),new he.KX("strokeDashArray","dash")),Tn(he.bn,{segmentIndex:0,segmentOffset:new he.E9(15,0),segmentOrientation:he.rU.OrientAlong,alignmentFocus:he.z6.Right,figure:"circle",width:10,strokeWidth:0},new he.KX("fill","color"),new he.KX("visible","dir",Ae=>Ae===1)),Tn(he.bn,{segmentIndex:-1,segmentOffset:new he.E9(-10,6),segmentOrientation:he.rU.OrientPlus90,alignmentFocus:he.z6.Right,figure:"triangle",width:12,height:12,strokeWidth:0},new he.KX("fill","color"),new he.KX("visible","dir",Ae=>Ae>=1),new he.KX("width","thickness",Ae=>7+3*Ae),new he.KX("height","thickness",Ae=>7+3*Ae),new he.KX("segmentOffset","thickness",Ae=>new he.E9(-15,4+1.5*Ae))),Tn(he.bn,{segmentIndex:0,segmentOffset:new he.E9(15,-6),segmentOrientation:he.rU.OrientMinus90,alignmentFocus:he.z6.Right,figure:"triangle",width:12,height:12,strokeWidth:0},new he.KX("fill","color"),new he.KX("visible","dir",Ae=>Ae===2),new he.KX("width","thickness",Ae=>7+3*Ae),new he.KX("height","thickness",Ae=>7+3*Ae),new he.KX("segmentOffset","thickness",Ae=>new he.E9(-15,4+1.5*Ae))),Tn(he.al,{alignmentFocus:new he.z6(0,1,-4,0),editable:!0},new he.KX("text").makeTwoWay(),new he.KX("stroke","color"))),Ee.current.linkTemplate.selectionAdornmentTemplate=Tn(he.uz,Tn(he.bn,{isPanelMain:!0,stroke:"transparent",strokeWidth:6,pathPattern:hi(2)},new he.KX("pathPattern","thickness",hi)),bn({alignmentFocus:new he.z6(0,0,-6,-4)}));function hi(Ae){return Tn(he.bn,{stroke:"dodgerblue",strokeWidth:2,strokeCap:"square",geometryString:"M0 0 M4 2 H3 M4 "+(Ae+4).toString()+" H3"})}function Ii(Ae){var ri="M0 0 M8 16 M0 8 L16 8 M12 11 L16 8 L12 5";return Ae===0?ri="M0 0 M16 16 M0 8 L16 8":Ae===2&&(ri="M0 0 M16 16 M0 8 L16 8 M12 11 L16 8 L12 5 M4 11 L0 8 L4 5"),Tn(he.bn,{geometryString:ri,margin:2,background:"transparent",mouseEnter:(Ri,fi)=>fi.background="dodgerblue",mouseLeave:(Ri,fi)=>fi.background="transparent",click:_n("dir",Ae),contextClick:_n("dir",Ae)})}function Di(Ae){var ri=(Ri,fi)=>{Ri.handled=!0,Ri.diagram.model.commit(br=>{var ur=fi.part.adornedPart;br.set(ur.data,Ae?"toSpot":"fromSpot",he.z6.stringify(he.z6.AllSides)),(Ae?ur.toNode:ur.fromNode).invalidateConnectedLinks()})};return Tn(he.bn,{width:12,height:12,fill:"transparent",mouseEnter:(Ri,fi)=>fi.background="dodgerblue",mouseLeave:(Ri,fi)=>fi.background="transparent",click:ri,contextClick:ri})}function mn(Ae,ri){var Ri=0,fi=he.z6.RightSide;Ae.equals(he.z6.Top)?(Ri=270,fi=he.z6.TopSide):Ae.equals(he.z6.Left)?(Ri=180,fi=he.z6.LeftSide):Ae.equals(he.z6.Bottom)&&(Ri=90,fi=he.z6.BottomSide),ri||(Ri-=180);var br=(ur,Lr)=>{ur.handled=!0,ur.diagram.model.commit(Dr=>{var Zr=Lr.part.adornedPart;Dr.set(Zr.data,ri?"toSpot":"fromSpot",he.z6.stringify(fi)),(ri?Zr.toNode:Zr.fromNode).invalidateConnectedLinks()})};return Tn(he.bn,{alignment:Ae,alignmentFocus:Ae.opposite(),geometryString:"M0 0 M12 12 M12 6 L1 6 L4 4 M1 6 L4 8",angle:Ri,background:"transparent",mouseEnter:(ur,Lr)=>Lr.background="dodgerblue",mouseLeave:(ur,Lr)=>Lr.background="transparent",click:br,contextClick:br})}Ee.current.linkTemplate.contextMenu=Tn("ContextMenu",Nn(),Jn(),Tn("ContextMenuButton",Tn(he.s_,"Horizontal",Ii(0),Ii(1),Ii(2))),Tn("ContextMenuButton",Tn(he.s_,"Horizontal",Tn(he.s_,"Spot",Di(!1),mn(he.z6.Top,!1),mn(he.z6.Left,!1),mn(he.z6.Right,!1),mn(he.z6.Bottom,!1)),Tn(he.s_,"Spot",{margin:new he.Zt(0,0,0,2)},Di(!0),mn(he.z6.Top,!0),mn(he.z6.Left,!0),mn(he.z6.Right,!0),mn(he.z6.Bottom,!0)))));const oi=`{ "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 fr=["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 Mr(Ae){return console.log("shapeName:",Ae),fr.indexOf(Ae)>=0}var Xr=new he.YI(xi.current,{maxSelectionCount:1,linkTemplate:Tn(he.rU,{locationSpot:he.z6.Center,selectionAdornmentTemplate:Tn(he.uz,"Link",{locationSpot:he.z6.Center},Tn(he.bn,{isPanelMain:!0,fill:null,stroke:"deepskyblue",strokeWidth:0}),Tn(he.bn,{toArrow:"Standard",stroke:null}))},{routing:he.rU.AvoidsNodes,curve:he.rU.JumpOver,corner:5,toShortLength:4},new he.KX("points"),Tn(he.bn,{isPanelMain:!0,strokeWidth:2}),Tn(he.bn,{toArrow:"Standard",stroke:null})),model:new he.FJ([{text:"\u672A\u547D\u540D",size:"100 100",fill:null,stroke:"#000"},...he.bn.getFigureGenerators().toArray().map(Ae=>({text:"\u672A\u547D\u540D",size:"100 100",figure:Ae.key,fill:"white",stroke:"#666",borderColor:"#000"}))])});return Ee.current.addDiagramListener("TextEdited",function(Ae){var ri;const Ri=Ae.subject.part;var fi=(ri=document.activeElement)==null?void 0:ri.value;typeof fi=="string"&&fi.trim()===""&&Ee.current.model.commit(function(br){br.set(Ri.data,"text","\u672A\u547D\u540D"),Ee.current.commandHandler.stopCommand()},"increment")}),Xr.nodeTemplate=Tn(he.NB,"Auto",{locationSpot:he.z6.Center},new he.KX("location","location",he.E9.parse).makeTwoWay(he.E9.stringify),Tn(he.bn,"Circle",{fill:"white",stroke:"gray",strokeWidth:2,width:20,height:20,portId:"",fromLinkable:!0,toLinkable:!0,fromLinkableDuplicates:!0,toLinkableDuplicates:!0,fromLinkableSelfNode:!0,toLinkableSelfNode:!0},new he.KX("stroke").makeTwoWay(),new he.KX("fill").makeTwoWay(),new he.KX("figure")),Tn(he.al,{margin:new he.Zt(5,5,3,5),font:"10pt sans-serif",minSize:new he.$u(16,16),maxSize:new he.$u(10,NaN),textAlign:"center",editable:!0},new he.KX("key").makeTwoWay())),setTimeout(()=>{Ee.current.grid=Tn(he.s_,"Grid",Tn(he.bn,"LineH",{stroke:"lightgray",strokeWidth:.5}),Tn(he.bn,"LineV",{stroke:"lightgray",strokeWidth:.5})),Ee.current.grid.visible=!0,Ee.current.grid.gridCellStroke="darkgray",Ee.current.grid.gridCellStrokeWidth=1},300),window.myDiagrams=Ee.current,Ee.current}const ji=()=>Mt(this,null,function*(){var Tn,Qt=Ee.current.makeImage();const me=yield(0,Ft.ZP)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:Date.now(),file:Qt.src,file_data:JSON.stringify({login:(Tn=(0,Nt.eY)())==null?void 0:Tn.login,data:JSON.parse(Ee.current.model.toJson())})}});Se({src:me.url})});return(0,ft.useEffect)(()=>(setTimeout(()=>{Ai()},500),Gn($e+1),()=>{Ee.current=null}),[]),zt.createElement("div",{ref:Pi,className:"body-overflow-initial"},zt.createElement(Ie.default,{width:1200,icon:null,footer:null,closable:!0,visible:!!$e,destroyOnClose:!0,maskClosable:!1,rootClassName:"zIndex-9999",title:zt.createElement(on.Z,null,zt.createElement(Rt.Z,{flex:1},"\u63D2\u5165\u6D41\u7A0B\u56FE"),zt.createElement(Rt.Z,{onClick:()=>{var Tn,Qt,me=Ee.current.selection.first();if(Kn.current=!Kn.current,document.activeElement&&me){let bn=(Qt=(Tn=document.activeElement)==null?void 0:Tn.value)==null?void 0:Qt.trim();typeof bn=="string"&&Ee.current.model.commit(function(_n){_n.set(me.data,"text",bn||"\u672A\u547D\u540D"),Ee.current.commandHandler.stopCommand()},"increment")}Gn($e+1)}},zt.createElement("span",{className:"current c-blue mr30",style:{fontWeight:400}},"\u5C55\u5F00/\u6536\u8D77"))),onCancel:Be},zt.createElement("div",{style:{width:"100%",height:"80vh",overflow:"hidden",position:"relative",display:Kn.current?"none":"block"},className:Pt.flowChartWrp},zt.createElement("div",{style:{display:"flex",height:"100%"}},zt.createElement("div",{style:{width:"300px",height:"100%"}},zt.createElement("div",{style:{background:"#fff",position:"relative",zIndex:12,fontSize:16,color:"#3061d0"}},"\u56FE\u5F62\u5E93"),zt.createElement("div",{style:{height:"calc(100% - 50px)"},className:Pt.myPaletteDiv,ref:xi})),zt.createElement("div",{style:{flex:1,position:"relative"}},zt.createElement("div",{ref:Ue,style:{height:"80vh"}}))),zt.createElement("div",{className:"tr"},zt.createElement(ge.ZP,{size:"large",onClick:ji,style:{position:"absolute",right:0,bottom:0,zIndex:8},type:"primary"},"\u4FDD\u5B58\u5230\u7F16\u8F91\u5668")))))}var He=Yt,_e=kt(47889),Xe=kt(71051);const xe=_e.ZP.Group,Pe={margin:"0 8px"};var ke=({callback:Be,onCancel:Se})=>{function Ee(Ue){Be(Ue)}return ft.createElement(Ut.default,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:Ee},ft.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},ft.createElement("span",{style:Pe},"\u5355\u5143\u683C\u6570\uFF1A"),ft.createElement("span",{style:Pe},"\u884C\u6570"),ft.createElement(Ut.default.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},ft.createElement(Xe.Z,null)),ft.createElement("span",{style:Pe},"\u5217\u6570"),ft.createElement(Ut.default.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},ft.createElement(Xe.Z,null))),ft.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},ft.createElement("span",{style:Pe},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),ft.createElement(Ut.default.Item,{name:"align"},ft.createElement(xe,null,ft.createElement(_e.ZP,{value:"default"},ft.createElement("i",{className:"fa fa-align-justify"})),ft.createElement(_e.ZP,{value:"left"},ft.createElement("i",{className:"fa fa-align-left"})),ft.createElement(_e.ZP,{value:"center"},ft.createElement("i",{className:"fa fa-align-center"})),ft.createElement(_e.ZP,{value:"right"},ft.createElement("i",{className:"fa fa-align-right"}))))),ft.createElement("div",{className:"flex-container flex-end"},ft.createElement(ge.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),ft.createElement(ge.ZP,{type:"ghost",onClick:Se},"\u53D6\u6D88")))},Ve=kt(71411),tn=kt(43001),dn=kt.n(tn),ni=(0,ft.forwardRef)(({use3d:Be,width:Se,height:Ee,callback:Ue,showSaveButton:xi},Kn)=>{const Pi=(0,ft.useRef)(),$e=(0,ft.useRef)(),[Gn,Ai]=(0,ft.useState)(!1),ji=(0,ft.useRef)({id:Pi,appName:"graphing",width:Se||1e3,height:Ee||600,showToolBar:!0,showMenuBar:!0,allowStyleBar:!0,showAlgebraInput:!0,enableLabelDrags:!1,enableShiftDragZoom:!0,showToolBarHelp:!1,errorDialogsActive:!0,showTutorialLink:!0,showLogging:!0,useBrowserForJS:!1});(0,ft.useEffect)(()=>{$e.current=new(dn())(ji.current,!0),window.onload=function(){$e.current.inject("applet_container")}},[]);const Tn=()=>{var Qt=window.ggbApplet.getPNGBase64(1,!0,72);return Ue&&Ue(Qt),Qt};return(0,ft.useEffect)(()=>{ji.current.appName=Gn?"3D":"graphing",$e.current.inject("applet_container")},[Gn]),(0,ft.useEffect)(()=>{Ai(Be)},[Be]),(0,ft.useImperativeHandle)(Kn,()=>({getImgData:Tn})),ft.createElement(ft.Fragment,null,ft.createElement("div",{style:{width:"100%",height:"100%"},id:"applet_container",ref:Pi}),ft.createElement(on.Z,{align:"middle"},ft.createElement(Rt.Z,{flex:1},ft.createElement(Ve.Z,{size:"default",checkedChildren:"\u5173\u95ED3D\u56FE\u50CF",unCheckedChildren:"\u5F00\u542F3D\u56FE\u50CF",checked:Gn,onChange:Qt=>Ai(Qt)})),ft.createElement(Rt.Z,null,ft.createElement(ge.ZP,{size:"large",onClick:Tn,style:{zIndex:8,marginTop:10},type:"primary"},"\u4FDD\u5B58\u5230\u7F16\u8F91\u5668"))))}),Ge=kt(76562),Ke=kt(6767);const nn="link",Qn="upload-image",gn="add-flowchart",an="draw-image",zn="add-flowchart",gi="code-block",ti="add-table",wi="------------",Wi={default:wi,left:`:${wi}`,center:`:${wi}:`,right:`${wi}:`};var Cn=kt(37808);function Pn(){}let Bn=0;const si=1e4,Ei="\u2581",ci="@\u2581\u2581@",Zi="@\u2581@",wt=`
|
|
**\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`,Je=["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 Hn(Be){return/^\d+$/.test(Be)?`${Be}px`:Be}const jn=navigator.platform.toUpperCase().indexOf("MAC")>=0?"Cmd":"Ctrl",li={[jn+"-B"]:"bold",[jn+"-I"]:"italic"},Ci={[nn]:"\u6DFB\u52A0\u94FE\u63A5",[gi]:"\u6DFB\u52A0\u4EE3\u7801\u5757",[Qn]:"\u6DFB\u52A0\u56FE\u7247",[an]:"\u6DFB\u52A0\u753B\u56FE",[gn]:"\u63D2\u5165\u6D41\u7A0B\u56FE",[ti]:"\u6DFB\u52A0\u8868\u683C","maths-latex":"\u6570\u5B66\u56FE\u50CF","inline-latex":"LATEX\u516C\u5F0F"};var Yi=({defaultValue:Be="",onChange:Se,width:Ee="100%",height:Ue=400,miniToolbar:xi=!1,isFocus:Kn=!1,watch:Pi,insertTemp:$e,mode:Gn="markdown",id:Ai="markdown-editor-id",showResizeBar:ji=!1,noStorage:Tn=!1,showNullButton:Qt=!1,showNullProgramButton:me=!1,hidetoolBar:bn=!1,fullScreen:_n=!1,onBlur:ze,onCMBeforeChange:hn,onFullScreen:Nn,className:In="",disablePaste:vi=!1,disabled:Jn=!1,disabledFill:ii=!1,placeholder:hi="",values:Ii="",extraUse:Di})=>{const[mn,oi]=(0,ft.useState)(null),[fr,Mr]=(0,ft.useState)(Be),[Xr,Ae]=(0,ft.useState)(Pi),[ri,Ri]=(0,ft.useState)(_n),[fi,br]=(0,ft.useState)(""),[ur,Lr]=(0,ft.useState)(0),[Dr,Zr]=(0,ft.useState)(Ue),[Jr,un]=(0,ft.useState)(!1),[yo,vn]=(0,ft.useState)(0),[Gi,Wr]=(0,ft.useState)(0),Oi=(0,ft.useRef)(),ko=(0,ft.useRef)(),Ur=(0,ft.useRef)(),Cr=(0,ft.useRef)();(0,ft.useEffect)(()=>{const Zn=window.scrollY||window.pageYOffset;Mr(Ii),mn==null||mn.setValue(Ii),window.scrollTo(0,Zn)},[Ii]),(0,ft.useEffect)(()=>{Nn==null||Nn(ri)},[ri]),(0,ft.useEffect)(()=>{if(Oi.current){let Zn=function(pi,en){var Qi;if(vi){en.preventDefault();return}const tr=en.clipboardData;if(tr){const Vr=tr.types.toString(),or=tr.items;if(Vr==="Files"||tr.types.indexOf("Files")>-1){if(en.preventDefault(),Gn=="stex")return;try{let so=or[1];((Qi=or[0])==null?void 0:Qi.kind)==="file"&&(so=or[0]);const qr=so.getAsFile(),po=qr.name.split(".").pop();(0,En.I)(qr,ro=>{var Po,Bo,Oe;ro.id?((Po=qr==null?void 0:qr.type)==null?void 0:Po.indexOf("image"))>-1?ai.replaceSelection(`<img width="100%" src="/api/attachments/${ro.id}?type=${ro.content_type})" alt="" />`):((Bo=qr==null?void 0:qr.type)==null?void 0:Bo.indexOf("video"))>-1?ai.replaceSelection(`<video width="100%" controls src="/api/attachments/${ro.id}"></video>`):((Oe=qr==null?void 0:qr.type)==null?void 0:Oe.indexOf("pdf"))>-1?ai.replaceSelection(`<a href="/api/attachments/${ro.id}?type=${qr.type}&disposition=inline" target="_blank">${qr.name}</a>`):Je.includes(po)?ai.replaceSelection(`<a href="/api/attachments/${ro.id}?type=office&disposition=inline" target="_blank">${qr.name}</a>`):ai.replaceSelection(`[${qr.name}](/api/attachments/${ro.id}?type=${ro.content_type})`):(ro==null?void 0:ro.status)===401&&(document.location.href="/user/login")})}catch(so){Ke.ZP.warning("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0};const ai=le().fromTextArea(Oi.current,{mode:Gn,lineNumbers:!xi,lineWrapping:!0,value:Be,autoCloseTags:!0,autoCloseBrackets:!0});return ai.on("keyup",function(pi,en){en.keyCode===8&&(pi.getValue()==""?ai.setOption("placeholder",hi):ai.setOption("placeholder",null))}),ai.on("keydown",function(pi,en){if(en.keyCode===8){var Qi=je(pi);Qi&&en.preventDefault()}}),Kn&&ai.focus(),ai.on("paste",Zn),Jn&&ai.on("beforeChange",function(pi,en){(en.origin==="paste"||en.origin==="+input")&&en.cancel()}),oi(ai),()=>{ai.off("paste",Zn)}}},[]);const Lo=(0,ft.useCallback)(()=>{if(ko.current)try{}catch(Zn){console.log(Zn,"---- to set md editor body height")}},[Dr,ko,ri]);(0,ft.useEffect)(()=>{function Zn(){let ai=new we.Z(pi=>{for(let en of pi)(en.target.offsetHeight>0||en.target.offsetWidth>0)&&(Lo(),mn.setSize("100%","100%"),mn.refresh())});return ai.observe(Oi.current.parentElement),ai}if(mn){const ai=Zn();return()=>{var pi,en;(pi=Oi.current)!=null&&pi.parentElement&&ai.unobserve((en=Oi.current)==null?void 0:en.parentElement)}}},[mn,Lo]),(0,ft.useEffect)(()=>{if(mn){let Zn=[];for(const[ai,pi]of Object.entries(li)){let en={[ai]:()=>{xn(pi)}};Zn.push(en),mn.addKeyMap(en)}return()=>{for(let ai of Zn)mn.removeKeyMap(ai)}}},[mn]),(0,ft.useEffect)(()=>{_n!==ri&&Ri(_n)},[_n]),(0,Cn.Z)(()=>{if(!Tn&&ur>0){let Zn=new Date().getTime(),ai=window.sessionStorage.getItem(Ai);Zn>=ur+si&&(!ai||ai!==fr)&&(window.sessionStorage.setItem(Ai,fr),un(!0))}},si),(0,ft.useEffect)(()=>{Ae(Pi)},[mn,Pi]),(0,ft.useEffect)(()=>{mn&&Kn&&mn.focus()},[mn,Kn]),(0,ft.useEffect)(()=>{if(Xr&&mn){let Zn=function(pi){let en=pi.target;if(Cr.current){let Qi=en.scrollTop/en.scrollHeight;Cr.current.scrollTop=Cr.current.scrollHeight*Qi}};const ai=mn.getScrollerElement();return ai.addEventListener("scroll",Zn),()=>{ai.removeEventListener("scroll",Zn)}}},[mn,Xr]),(0,ft.useEffect)(()=>{if(mn&&hn){let Zn=function(ai,pi){hn(ai,pi)};return mn.on("beforeChange",Zn),()=>{mn.off("beforeChange",Zn)}}},[mn,hn]),(0,ft.useEffect)(()=>{if(mn&&ze){let Zn=function(){ze(mn.getValue())};return mn.on("blur",Zn),()=>{mn.off("blur",Zn)}}},[mn,ze]);function je(Zn,ai){var pi=Zn.getDoc(),en=pi.getCursor(),Qi=pi.getLine(en.line),tr=Qi.charAt(en.ch-1),Vr=Qi.lastIndexOf("@\u2581@",en.ch),or=Qi.lastIndexOf("@\u2581\u2581@",en.ch),so=Vr>or?Vr:or,qr=Vr>or?3:4;if(ci.indexOf(tr)===-1)return null;if(console.log("change1:",ai,Zn,Qi,en,so,Vr,or,tr),so>=0&&en.ch-so<5){var po=so+qr;return pi.replaceRange("",{line:en.line,ch:so},{line:en.line,ch:po}),{line:en.line,ch:po}}return null}(0,ft.useEffect)(()=>{if(mn){let Zn=function(ai,pi){const en=ai.getValue();Mr(en),Lr(new Date().getTime()),ai.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),Se&&(me?Se(en,yn(en)):Se(en))};return mn.on("change",Zn),()=>{mn.off("change",Zn)}}},[mn,Se]),(0,ft.useEffect)(()=>{if(mn)if(Be==null)mn.setValue(""),Mr("");else{const Zn=window.scrollY||window.pageYOffset;Be!==mn.getValue()&&(mn.setValue(Be),Mr(Be),mn.setCursor(Jn?1:mn.lineCount(),0),window.scrollTo(0,Zn))}},[mn,Be]);const xn=(0,ft.useCallback)(Zn=>{const ai=mn.getCursor(),pi=mn.getSelection();let en=pi.split(`
|
|
`);switch(Zn){case"bold":return mn.replaceSelection("**"+pi+"**"),pi===""&&mn.setCursor(ai.line,ai.ch+2),mn.focus();case"italic":return mn.replaceSelection("*"+pi+"*"),pi===""&&mn.setCursor(ai.line,ai.ch+1),mn.focus();case"code":return mn.replaceSelection("`"+pi+"`"),pi===""&&mn.setCursor(ai.line,ai.ch+1),mn.focus();case"inline-latex":return br("inline-latex"),mn.focus();case"latex":return mn.replaceSelection("```latex\n"+pi+"\n```"),mn.setCursor(ai.line+1,pi.length+1),mn.focus();case"line-break":return mn.replaceSelection(`<br/>
|
|
`),mn.focus();case"list-ul":return pi===""?mn.replaceSelection("- "+pi):mn.replaceSelection(en.map(Qi=>Qi===""?"":`- ${Qi}`).join(`
|
|
`)),mn.focus();case"list-ol":return pi===""?mn.replaceSelection("1. "+pi):mn.replaceSelection(en.map((Qi,tr)=>Qi===""?"":`${tr+1}. ${Qi}`).join(`
|
|
`)),mn.focus();case"add-null-ch":return pi===""&&mn.setCursor(ai.line,ai.ch),mn.replaceSelection(Ei),mn.focus();case"add-signal":return pi===""&&mn.setCursor(ai.line,ai.ch),mn.replaceSelection(Zi),mn.focus();case"add-multiple":return pi===""&&mn.setCursor(ai.line,ai.ch),mn.replaceSelection(ci),mn.focus();case"inster-template-1":return pi===""&&mn.setCursor(ai.line,ai.ch),mn.replaceSelection(wt),mn.focus();case"eraser":return mn.setValue(""),mn.focus();case"trigger-watch":return Ae(!Xr),mn.focus();case"trigger-full-screen":return Ri(!ri),mn.focus();case nn:br(nn);return;case gi:br(gi);return;case Qn:br(Qn);return;case an:br(an);return;case"maths-latex":br("maths-latex");return;case gn:br(gn);return;case ti:br(ti);return;default:throw new Error}},[mn,Xr,ri]),be=(0,ft.useCallback)((Zn,ai)=>{var pi,en,Qi,tr,Vr,or;switch(br(""),fi){case nn:const{title:Po,link:Bo}=Zn;return mn.replaceSelection(`[${Po}](${Bo})`),mn.focus();case gi:const{language:Oe,content:lo}=Zn;return mn.replaceSelection(["```"+Oe,lo,"```"].join(`
|
|
`)),mn.focus();case"maths-latex":for(var so=atob(Zn),qr=new Uint8Array(so.length),po=0;po<so.length;po++)qr[po]=so.charCodeAt(po);var ro=new Blob([qr],{type:"image/png"});(0,En.I)(ro,ha=>{ha.id?mn.replaceSelection(``):(ha==null?void 0:ha.status)===401&&(document.location.href="/user/login")});break;case"inline-latex":mn.replaceSelection("`$$"+Zn+"$$`");break;case Qn:case an:case zn:const{src:Gr,alt:Sr}=Zn,hr=ai,oo=(Qi=(en=(pi=hr==null?void 0:hr.name)==null?void 0:pi.split("."))==null?void 0:en.pop)==null?void 0:Qi.call(en);return((tr=hr==null?void 0:hr.type)==null?void 0:tr.indexOf("image"))>-1||!(hr!=null&&hr.type)?hr!=null&&hr.align||hr!=null&&hr.width?mn.replaceSelection(`<p style="text-align:${hr.align||"initial"}"><img width="${hr.width?hr.width+"%":"initial"}" src="${Gr}" alt="${Sr||""}" /></p>`):mn.replaceSelection(`<img width="100%" src="${Gr}" alt="${Sr||""}" />`):((Vr=hr==null?void 0:hr.type)==null?void 0:Vr.indexOf("video"))>-1?mn.replaceSelection(`<video width="100%" controls src="${Gr}"></video>`):((or=hr==null?void 0:hr.type)==null?void 0:or.indexOf("pdf"))>-1?mn.replaceSelection(`<a href="${Gr}?type=${hr.type}&disposition=inline" target="_blank">${hr.name}</a>`):Je.includes(oo)?mn.replaceSelection(`<a href="${Gr}?type=office&disposition=inline" target="_blank">${hr.name}</a>`):mn.replaceSelection(`[${hr.name}](${Gr})`),mn.focus();case ti:const{row:Fo,col:wo,align:zr}=Zn;let Or=`
|
|
`;for(let ha=0;ha<Fo;ha++){let Ia=[],bs=[];for(let Ba=0;Ba<wo;Ba++)ha===1&&bs.push(Wi[zr]),Ia.push(" ");ha===1&&(Or+=`| ${bs.join(" | ")} |
|
|
`),Or+=`| ${Ia.join(wo===1?"":" | ")} |
|
|
`}return mn.replaceSelection(Or+`
|
|
`),mn.focus();default:throw new Error}},[mn,fi]),Tt=(0,ft.useMemo)(()=>{switch(fi){case nn:return ft.createElement(Qe,{callback:be,onCancel:Dn});case gi:return ft.createElement(On.Z,{callback:be,onCancel:Dn});case Qn:return ft.createElement(En.Z,{callback:be,onCancel:Dn});case gn:return ft.createElement(He,{callback:be,onCancel:Dn});case ti:return ft.createElement(ke,{callback:be,onCancel:Dn});case"maths-latex":return ft.createElement(ni,{showSaveButton:!0,callback:be});case"inline-latex":return ft.createElement(Ge.Z,{showSaveButton:!0,callback:be});default:return null}},[fi]);function Dn(){br("")}(0,ft.useEffect)(()=>{if(Ur.current){let Zn=function(Vr){Qi=!0,tr=Vr.pageY},ai=function(){Qi=!1},pi=function(Vr){if(Qi){let or=Vr.pageY-tr;or<0&&(or=0),or>300&&(or=300);let so=Ue+or+"px";Zr(so)}},en=Ur.current,Qi=!1,tr=0;return en.addEventListener("mousedown",Zn),document.addEventListener("mousemove",pi),document.addEventListener("mouseup",ai),()=>{en.removeEventListener("mousedown",Zn),document.removeEventListener("mousemove",pi),document.removeEventListener("mouseup",ai)}}},[mn,Ur]),(0,ft.useEffect)(()=>{Zr(Ue)},[Ue]);const ei=Hn(Ee),Ni=Hn(Dr),Li={width:ei,height:Ni},di=(0,ft.useMemo)(()=>{if(ur){let Zn=new Date(ur),ai=Zn.getHours(),pi=Zn.getMinutes(),en=Zn.getSeconds();return ai=ai<10?"0"+ai:ai,pi=pi<10?"0"+pi:pi,en=en<10?"0"+en:en,`${ai}:${pi}:${en}`}return 0},[ur]),yn=Zn=>{const ai=[];if(me){let pi=-1;Zn=Zn.replace(/(@▁▁@|@▁@)/g,function(en,Qi,tr){ai.push({multiLine:en!==Zi})})}return ai};function Un(){window.sessionStorage.removeItem(Ai),un(!1),Lr(0)}function $n(){un(!1),Lr(0),mn.setValue(window.sessionStorage.getItem(Ai))}(0,ft.useEffect)(()=>{Ci[fi]&&fi!==an&&fi!==gn&&setTimeout(()=>{const Zn=document.getElementsByClassName("markdown-popup-form")[0],ai=window.innerWidth/2-Zn.offsetWidth/2,pi=window.innerHeight/2-Zn.offsetHeight/2;vn(ai),Wr(pi)},0)},[fi]);const An=Zn=>{Zn.preventDefault();const ai=Zn.clientX-yo,pi=Zn.clientY-Gi;document.body.onmousemove=en=>{let Qi=en.clientX-ai,tr=en.clientY-pi;const Vr=document.getElementsByClassName("markdown-popup-form")[0],or=window.innerWidth-Vr.offsetWidth,so=window.innerHeight-Vr.offsetHeight;Qi=Math.max(0,Math.min(Qi,or)),tr=Math.max(0,Math.min(tr,so)),Xn(en.clientX,en.clientY,ai,pi)&&(vn(Qi),Wr(tr))},document.body.onmouseup=function(){document.body.onmousemove=null}},Xn=(Zn,ai,pi,en)=>{const Qi=document.body.clientHeight,tr=document.body.clientWidth;return Zn<20&&pi>Zn||Zn>tr-20&&pi<Zn||ai<20&&en>ai||ai>Qi-20&&en<ai?(document.body.onmousemove=null,document.body.onmouseup=null,!1):!0};return ft.createElement(ft.Fragment,null,ft.createElement("div",{className:"markdown-editor-wrapper",ref:ko},ft.createElement("div",{className:`markdown-editor-container ${In} ${Xr?"on-preview":""} ${xi?"mini":""} ${ri?"full-screen":""}`,style:Li},ft.createElement(It,{insertTemp:$e,watch:Xr,fullScreen:ri,showNullButton:Qt,showNullProgramButton:me,onActionCallback:xn,hidetoolBar:bn,extraUse:Di}),ft.createElement("div",{className:"markdown-editor-body"},ft.createElement("div",{className:"codemirror-container"},ft.createElement("textarea",{ref:Oi,placeholder:hi})),Xr?ft.createElement("div",{ref:Cr,className:"preview-container"},Gn==="stex"&&ft.createElement(ae,{value:fr}),Gn!=="stex"&&ft.createElement(De.Z,{disabledFill:ii,showProgramFill:me,value:fr})):null))),ji?ft.createElement("a",{ref:Ur,className:"editor-resize"}):null,fi===an&&ft.createElement(Me,{callback:be,onCancel:Dn}),fi===gn&&ft.createElement(He,{callback:be,onCancel:Dn}),ft.createElement(qt.Z,null,Ci[fi]&&fi!==an&&fi!==gn?ft.createElement(Ie.default,{maskClosable:!1,centered:!0,style:{position:"absolute",left:yo,top:Gi},title:ft.createElement("div",{style:{cursor:"move"},onMouseDown:An},Ci[fi]),open:!0,onCancel:Dn,footer:null,destroyOnClose:!0,width:fi===gn?"1200px":null,height:fi===gn?"80vh":null,className:"markdown-popup-form"},Tt):null))}},17077:function(Mn,Rn,kt){"use strict";kt.d(Rn,{Z:function(){return At},I:function(){return qt}});var ft=kt(28284),Kt=kt(6767),le=kt(37568),we=kt(77736),ue=kt(71051),Dt=kt(47889),ee=kt(99571),pe=kt(46699),Jt=kt(59301),jt=kt(59301),De=Object.defineProperty,ae=Object.defineProperties,Le=Object.getOwnPropertyDescriptors,Bt=Object.getOwnPropertySymbols,nt=Object.prototype.hasOwnProperty,et=Object.prototype.propertyIsEnumerable,ht=(Ut,Gt,ge)=>Gt in Ut?De(Ut,Gt,{enumerable:!0,configurable:!0,writable:!0,value:ge}):Ut[Gt]=ge,st=(Ut,Gt)=>{for(var ge in Gt||(Gt={}))nt.call(Gt,ge)&&ht(Ut,ge,Gt[ge]);if(Bt)for(var ge of Bt(Gt))et.call(Gt,ge)&&ht(Ut,ge,Gt[ge]);return Ut},pt=(Ut,Gt)=>ae(Ut,Le(Gt));const{useForm:vt}=ft.default,St={width:280,marginRight:10},Et={labelCol:{span:5},wrapperCol:{span:19}};var At=({callback:Ut,onCancel:Gt})=>{const[ge]=vt();let ie=(0,Jt.useRef)();function Te(Ye){ie.current.width=ge.getFieldValue("width"),ie.current.align=ge.getFieldValue("align"),Ut(Ye,ie.current)}function ve(Ye,Ze){if(Ye.status===-1){Kt.ZP.error(Ye.message);return}ge.setFieldsValue({src:`/api/attachments/${Ye.id}`,type:Ze.type})}function ye(Ye){let Ze=Ye.target.files[0];ie.current=Ze,qt(Ze,ve)}return jt.createElement(ft.default,pt(st({form:ge},Et),{className:"upload-image-panel",onFinish:Te,style:{width:470,overflow:"hidden"}}),jt.createElement(ft.default.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},jt.createElement("div",{className:"flex-container"},jt.createElement(ft.default.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u5730\u5740"}]},jt.createElement(le.default,{style:St})),jt.createElement(It,{onFileChange:ye}))),jt.createElement(ft.default.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},jt.createElement(le.default,{style:{width:264}})),jt.createElement(ft.default.Item,{label:"\u56FE\u7247\u5BBD\u5EA6",name:"width"},jt.createElement(we.Z,null,jt.createElement(ft.default.Item,{name:"width",style:{margin:0}},jt.createElement(ue.Z,{style:{width:264}})),jt.createElement("span",{className:"ml8"},"%"))),jt.createElement(ft.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(ft.default.Item,{style:{textAlign:"right",position:"relative",right:-98}},jt.createElement(ee.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),jt.createElement(ee.ZP,{type:"default",onClick:Gt},"\u53D6\u6D88"))))};function It({onFileChange:Ut}){return jt.createElement("label",{className:"upload-button",style:{cursor:"pointer"}},"\u672C\u5730\u4E0A\u4F20",jt.createElement("input",{type:"file",onChange:Ut}))}function qt(Ut,Gt){if(!Ut)throw new String("\u6CA1\u6709\u6587\u4EF6");let ge=new FormData;ge.append("editormd-image-file",Ut),ge.append("file_param_name","editormd-image-file"),ge.append("byxhr","true");var ie=new window.XMLHttpRequest;ie.withCredentials=!0,ie.addEventListener("load",function(Te){Gt(JSON.parse(Te.target.responseText),Ut)},!1),ie.addEventListener("error",function(Te){console.error(Te)},!1),ie.open("POST",`${pe.KI}/api/attachments.json`),ie.send(ge)}},91558:function(Mn,Rn,kt){"use strict";kt.d(Rn,{Z:function(){return le}});var ft=kt(59301),Kt=kt(4676);class le extends ft.Component{constructor(ue){super(ue);const Dt=window.document;this.node=Dt.createElement("div"),Dt.body.appendChild(this.node)}render(){const{children:ue}=this.props;return(0,Kt.createPortal)(ue,this.node)}componentWillUnmount(){window.document.body.removeChild(this.node)}}},75975:function(Mn,Rn,kt){"use strict";kt.d(Rn,{SV:function(){return He},ZP:function(){return Yt}});var ft=kt(59301),Kt=kt(76374);const le={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"]},we={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"]},ue={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(`
|
|
`)}]},ee={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 pe=kt(53184),Jt=kt.n(pe),jt=Object.defineProperty,De=Object.defineProperties,ae=Object.getOwnPropertyDescriptors,Le=Object.getOwnPropertySymbols,Bt=Object.prototype.hasOwnProperty,nt=Object.prototype.propertyIsEnumerable,et=(_e,Xe,xe)=>Xe in _e?jt(_e,Xe,{enumerable:!0,configurable:!0,writable:!0,value:xe}):_e[Xe]=xe,ht=(_e,Xe)=>{for(var xe in Xe||(Xe={}))Bt.call(Xe,xe)&&et(_e,xe,Xe[xe]);if(Le)for(var xe of Le(Xe))nt.call(Xe,xe)&&et(_e,xe,Xe[xe]);return _e},st=(_e,Xe)=>De(_e,ae(Xe)),pt=(_e,Xe,xe)=>new Promise((Pe,ke)=>{var Ve=fn=>{try{dn(xe.next(fn))}catch(ni){ke(ni)}},tn=fn=>{try{dn(xe.throw(fn))}catch(ni){ke(ni)}},dn=fn=>fn.done?Pe(fn.value):Promise.resolve(fn.value).then(Ve,tn);dn((xe=xe.apply(_e,Xe)).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=(_e,Xe)=>Xe.map(xe=>({label:xe,kind:_e.languages.CompletionItemKind.Keyword,insertText:xe})),Et=_e=>Object.keys(vt.tables).map(Xe=>({label:Xe,kind:_e.languages.CompletionItemKind.Variable,insertText:Xe})),At=(_e,Xe)=>{const xe=vt.tables[_e];return xe?xe.map(Pe=>({label:Pe,kind:Xe.languages.CompletionItemKind.Field,insertText:Pe})):[]};function It(_e,Xe,xe,Pe,ke){let Ve=Xe.getWordUntilPosition(xe),tn={startLineNumber:xe.lineNumber,endLineNumber:xe.lineNumber,startColumn:Ve.startColumn,endColumn:Ve.endColumn},dn=Pe.map(fn=>({label:fn,kind:_e.languages.CompletionItemKind.Keyword,insertText:fn,insertTextRules:_e.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:tn}));return ke.map(fn=>{dn.push(st(ht({},fn),{range:tn}))}),dn}var qt=_e=>{vt.languages.map(ke=>(_e.languages.registerDocumentFormattingEditProvider(ke,{provideDocumentFormattingEdits(Ve,tn,dn){return pt(this,null,function*(){const fn=Jt()(Ve.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:Ve.getFullModelRange(),text:fn}]})}}),ke));const Xe=ue.quickKey.map(ke=>({label:ke.label,kind:_e.languages.CompletionItemKind.Method,insertText:ke.content,insertTextRules:_e.languages.CompletionItemInsertTextRule.InsertAsSnippet})),xe=Dt.quickKey.map(ke=>({label:ke.label,kind:_e.languages.CompletionItemKind.Method,insertText:ke.content,insertTextRules:_e.languages.CompletionItemInsertTextRule.InsertAsSnippet})),Pe=we.quickKey.map(ke=>({label:ke.label,kind:_e.languages.CompletionItemKind.Method,insertText:ke.content,insertTextRules:_e.languages.CompletionItemInsertTextRule.InsertAsSnippet}));_e.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(ke,Ve){var tn=ke.getWordUntilPosition(Ve),dn={startLineNumber:Ve.lineNumber,endLineNumber:Ve.lineNumber,startColumn:tn.startColumn,endColumn:tn.endColumn},fn=ke.getLineContent(Ve.lineNumber).substring(tn.startColumn-2,tn.endColumn);return{suggestions:[...ue.keywords.map(ni=>({label:ni,kind:_e.languages.CompletionItemKind.Function,documentation:ni,insertText:ni,insertTextRules:_e.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:dn})),...ue.quickKey.map(ni=>({label:ni.label,kind:_e.languages.CompletionItemKind.Function,documentation:ni.content,insertText:fn.startsWith("#")?ni.content.replace(/#/,""):ni.content,insertTextRules:_e.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:dn}))]}}}),_e.languages.registerCompletionItemProvider("c",{provideCompletionItems:function(ke,Ve){var tn=ke.getWordUntilPosition(Ve),dn={startLineNumber:Ve.lineNumber,endLineNumber:Ve.lineNumber,startColumn:tn.startColumn,endColumn:tn.endColumn};return{suggestions:[...le.keywords.map(fn=>({label:fn,kind:_e.languages.CompletionItemKind.Function,documentation:fn,insertText:fn,insertTextRules:_e.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:dn}))]}}}),_e.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(ke,Ve){var tn=ke.getWordUntilPosition(Ve),dn={startLineNumber:Ve.lineNumber,endLineNumber:Ve.lineNumber,startColumn:tn.startColumn,endColumn:tn.endColumn},fn=ke.getLineContent(Ve.lineNumber).substring(tn.startColumn-2,tn.endColumn);return{suggestions:[...we.keywords.map(ni=>({label:ni,kind:_e.languages.CompletionItemKind.Function,documentation:ni,insertText:ni,insertTextRules:_e.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:dn})),...we.quickKey.map(ni=>({label:ni.label,kind:_e.languages.CompletionItemKind.Function,documentation:ni.content,insertText:fn.startsWith("#")?ni.content.replace(/#/,""):ni.content,insertTextRules:_e.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:dn}))]}}}),_e.languages.registerCompletionItemProvider("scala",{provideCompletionItems:function(ke,Ve){var tn=ke.getWordUntilPosition(Ve),dn={startLineNumber:Ve.lineNumber,endLineNumber:Ve.lineNumber,startColumn:tn.startColumn,endColumn:tn.endColumn},fn=ke.getLineContent(Ve.lineNumber).substring(tn.startColumn-2,tn.endColumn);return{suggestions:[...ee.keywords.map(ni=>({label:ni,kind:_e.languages.CompletionItemKind.Function,documentation:ni,insertText:ni,insertTextRules:_e.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:dn})),...ee.quickKey.map(ni=>({label:ni.label,kind:_e.languages.CompletionItemKind.Function,documentation:ni.content,insertText:fn.startsWith("#")?ni.content.replace(/#/,""):ni.content,insertTextRules:_e.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:dn}))]}}}),_e.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(ke,Ve){var tn=ke.getWordUntilPosition(Ve),dn={startLineNumber:Ve.lineNumber,endLineNumber:Ve.lineNumber,startColumn:tn.startColumn,endColumn:tn.endColumn},fn=ke.getLineContent(Ve.lineNumber).substring(tn.startColumn-2,tn.endColumn);return{suggestions:[...Dt.keywords.map(ni=>({label:ni,kind:_e.languages.CompletionItemKind.Function,documentation:ni,insertText:ni,insertTextRules:_e.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:dn})),...Dt.quickKey.map(ni=>({label:ni.label,kind:_e.languages.CompletionItemKind.Function,documentation:ni.content,insertText:fn.startsWith("#")?ni.content.replace(/#/,""):ni.content,insertTextRules:_e.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:dn}))]}}})};const Ut="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002";var Gt=Object.defineProperty,ge=(_e,Xe,xe)=>Xe in _e?Gt(_e,Xe,{enumerable:!0,configurable:!0,writable:!0,value:xe}):_e[Xe]=xe,ie=(_e,Xe,xe)=>ge(_e,typeof Xe!="symbol"?Xe+"":Xe,xe);const Te=class px{constructor(Xe,xe,Pe){this.placeholder=Xe,this.editor=xe,this.monaco=Pe,xe.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(Te,"ID","editor.widget.placeholderHint");var ye=Te,Ye=kt(96236),Ze=kt(6767),qe=kt(25399),pn=kt(89392),te=kt(49535),Xt=kt(56102),Qe=Object.defineProperty,On=Object.defineProperties,En=Object.getOwnPropertyDescriptors,Ie=Object.getOwnPropertySymbols,on=Object.prototype.hasOwnProperty,cn=Object.prototype.propertyIsEnumerable,Vn=(_e,Xe,xe)=>Xe in _e?Qe(_e,Xe,{enumerable:!0,configurable:!0,writable:!0,value:xe}):_e[Xe]=xe,Me=(_e,Xe)=>{for(var xe in Xe||(Xe={}))on.call(Xe,xe)&&Vn(_e,xe,Xe[xe]);if(Ie)for(var xe of Ie(Xe))cn.call(Xe,xe)&&Vn(_e,xe,Xe[xe]);return _e},he=(_e,Xe)=>On(_e,En(Xe)),Ce=(_e,Xe)=>{var xe={};for(var Pe in _e)on.call(_e,Pe)&&Xe.indexOf(Pe)<0&&(xe[Pe]=_e[Pe]);if(_e!=null&&Ie)for(var Pe of Ie(_e))Xe.indexOf(Pe)<0&&cn.call(_e,Pe)&&(xe[Pe]=_e[Pe]);return xe},Yn=(_e,Xe,xe)=>new Promise((Pe,ke)=>{var Ve=fn=>{try{dn(xe.next(fn))}catch(ni){ke(ni)}},tn=fn=>{try{dn(xe.throw(fn))}catch(ni){ke(ni)}},dn=fn=>fn.done?Pe(fn.value):Promise.resolve(fn.value).then(Ve,tn);dn((xe=xe.apply(_e,Xe)).next())});function Si(_e){return/^\d+$/.test(_e)?`${_e}px`:_e}function Rt(){}let Ft=!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(_e=[]){let Xe=_e;if(Array.isArray(_e)){for(let xe=0;xe<_e.length;xe++){let Pe=Pt[_e[xe]];if(Pe)return Pe}return Xe[0]}return Pt[Xe]||Xe}let zt=null;const Mt=()=>Yn(void 0,null,function*(){try{yield navigator.clipboard.writeText(" "),console.log("\u5185\u5BB9\u5DF2\u81EA\u52A8\u590D\u5236\u5230\u526A\u8D34\u677F:")}catch(_e){console.error("\u81EA\u52A8\u590D\u5236\u5931\u8D25:",_e)}});var Yt=_e=>{var Xe=_e,{width:xe="100%",height:Pe="100%",value:ke,language:Ve="javascript",style:tn={},options:dn={},overrideServices:fn={},theme:ni="vs-dark",onEditBlur:Ge,isCopy:Ke=!1,onSave:nn,autoHeight:Qn=!1,forbidCopy:gn=!1,onChange:an=Rt,editorDidMount:zn=Rt,onFocus:gi=Rt,onBreakPoint:ti=Rt,breakPointValue:wi=[],filename:Wi="educoder.txt",errorLine:Cn,errorContent:Pn="",highlightLine:Bn,openBreakPoint:si=!1,placeholder:Ei="",showMiniMap:ci=!0}=Xe,Zi=Ce(Xe,["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,ft.useRef)(),Je=(0,ft.useRef)({}),Hn=(0,ft.useRef)(),Ln=(0,ft.useRef)(),jn=(0,ft.useRef)([]),li=(0,ft.useRef)(!1),Ci=(0,ft.useRef)(),Yi=(0,ft.useRef)(),Be=(0,ft.useRef)(!1),[Se,Ee]=(0,ft.useState)(!1);function Ue(){let Nn;return wt.current&&(Nn=new Kt.Z(In=>{for(let vi of In)(vi.target.offsetHeight>0||vi.target.offsetWidth>0)&&Je.current.instance.layout()}),Nn.observe(wt.current)),Nn}function xi(){Ze.ZP.warning({content:decodeURIComponent(Ut),key:"monaco-editor-tip"})}const Kn=()=>{let Nn=Je.current.instance;if(ke!=null&&Nn&&Se){const In=Nn.getModel();In&&ke!==In.getValue()&&(Ft=!0,In.setValue(ke),Nn.layout(),Ft=!1)}};(0,ft.useEffect)(()=>{const Nn=te.Z.subscribe("formatDocument",In=>{var vi;let Jn=Je.current.instance;(vi=Jn==null?void 0:Jn.getAction)==null||vi.call(Jn,"editor.action.formatDocument").run()});return window.updateMonacoValue=In=>{an(In)},Nn},[]),(0,ft.useEffect)(()=>{var Nn;let In=Je.current.instance;Ln.current&&clearTimeout(Ln.current),Ln.current=setTimeout(()=>{Kn()},500),ke&&(ke!=null&&ke.length)&&((Nn=In==null?void 0:In.updateOptions)==null||Nn.call(In,{lineNumbersMinChars:Math.max(Math.floor(Math.log10(ke.split(/\r\n|\r|\n/g).length))+3,5)}))},[ke,Se,Je.current]),(0,ft.useEffect)(()=>{if(Cn&&Je.current&&Je.current.instance){let In=Je.current.instance;In.changeViewZones(function(vi){var Jn=document.createElement("div");Jn.style.padding="10px 20px",Jn.style.width="calc(100% - 20px)",Jn.className="my-error-line-wrp",Jn.innerHTML=Pn,vi.addZone({afterLineNumber:Cn||11,heightInLines:3,domNode:Jn})});var Nn={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}};In.addOverlayWidget(Nn),In.revealPositionInCenter({lineNumber:20,column:1})}},[Cn,Je.current,Se]);const Pi=(Nn="",In)=>{if(!Nn||Nn.trim()==="")return!0;const Jn=Je.current.instance.getModel().getLineTokens(In);let ii=!1;for(let hi=0;hi<2;hi++)Jn.getStandardTokenType(hi)===1&&(ii=!0);return ii};(0,ft.useEffect)(()=>{var Nn;const In=(Nn=Je.current)==null?void 0:Nn.instance;if(In&&Se&&gn){const vi=In.onDidBlurEditorWidget(()=>{Be.current=!1}),Jn=In.onDidFocusEditorText(()=>{Be.current=!0});return()=>{vi.dispose(),Jn.dispose()}}},[Je.current,Se,gn]),(0,ft.useEffect)(()=>{var Nn;if((Nn=Je.current)!=null&&Nn.instance&&Se&&si){let In=Je.current.instance,vi=In.getModel();if(!vi)return;(()=>{var ri;let Ri=[],fi=[];const br=vi.getAllDecorations();for(let Lr of br)Lr.options.className==="highlighted-line"&&(Ri.push((ri=Lr==null?void 0:Lr.range)==null?void 0:ri.startLineNumber),fi.push(Lr==null?void 0:Lr.id));if(Bn===Ri[0])return;vi.deltaDecorations(fi,[]);const ur=vi.getLineCount();Bn&&Bn<=ur&&(In.deltaDecorations([],[{range:new zt.Range(Bn,1,Bn,vi.getLineMaxColumn(Bn)),options:{isWholeLine:!0,className:"highlighted-line"}}]),In.revealLineInCenter(Bn))})();const ii=(ri=!1)=>{var Ri;let fi=[],br=[];const ur=vi.getAllDecorations();for(let Lr of ur)Lr.options.linesDecorationsClassName==="breakpoints-select"&&(fi.push((Ri=Lr==null?void 0:Lr.range)==null?void 0:Ri.startLineNumber),br.push(Lr==null?void 0:Lr.id));if(ri)return{lines:fi,ids:br};ti(fi)},hi=ri=>Yn(void 0,null,function*(){let Ri={range:new zt.Range(ri,1,ri,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints-select"}};yield vi.deltaDecorations([],[Ri]),ii()}),Ii=ri=>Yn(void 0,null,function*(){let Ri=[];const fi=In.getLineDecorations(ri);for(let br of fi)br.options.linesDecorationsClassName==="breakpoints-select"&&Ri.push(br.id);yield vi.deltaDecorations(Ri,[]),ii()}),Di=ri=>{let Ri=In.getLineDecorations(ri);for(let fi of Ri)if(fi.options.linesDecorationsClassName==="breakpoints-select")return!0;return!1};if(!(0,pn.isEqual)(wi,ii(!0).lines)){vi.deltaDecorations(ii(!0).ids,[]);const ri=wi.map(Ri=>({range:new zt.Range(Ri,1,Ri,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints-select"}}));vi.deltaDecorations([],ri)}const mn=In.onDidChangeModelContent(ri=>{let Ri=In.getPosition();if(Ri){let fi=Ri.lineNumber;clearTimeout(Yi.current),Yi.current=setTimeout(()=>{Pi(vi.getLineContent(fi),fi)?Ii(fi):Di(fi)?(Ii(fi),hi(fi)):ii()},100)}}),oi=In.onMouseDown(ri=>{var Ri,fi,br;if(ri.target.detail&&((br=(fi=(Ri=ri.target)==null?void 0:Ri.element)==null?void 0:fi.className)!=null&&br.includes("line-numbers"))){let ur=ri.target.position.lineNumber;if(Pi(vi.getLineContent(ur),ur))return;Di(ur)?Ii(ur):hi(ur)}}),fr=ri=>{let Ri={range:new zt.Range(ri,1,ri,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints-fake"}};jn.current=In.deltaDecorations(jn.current,[Ri])},Mr=()=>{jn.current=In.deltaDecorations(jn.current,[])},Xr=In.onMouseMove(ri=>{var Ri,fi,br;if(Mr(),ri.target.detail&&((br=(fi=(Ri=ri.target)==null?void 0:Ri.element)==null?void 0:fi.className)!=null&&br.includes("line-numbers"))){let ur=ri.target.position.lineNumber;if(Pi(vi.getLineContent(ur),ur))return;fr(ur)}}),Ae=In.onMouseLeave(()=>{Mr()});return()=>{mn.dispose(),oi.dispose(),Xr.dispose(),Ae.dispose()}}},[Je.current,Se,wi,Bn,si,Ve]),(0,ft.useEffect)(()=>{var Nn;(Nn=Je.current)!=null&&Nn.instance&&si&&Je.current.instance.setPosition({lineNumber:0,column:0})},[Bn]);function $e(){let Nn=Je.current.instance;if(Nn){const In=Nn.getSelection(),vi=Je.current.pastePos||{},Jn=new zt.Range(vi.startLineNumber||In.endLineNumber,vi.startColumn||In.endColumn,vi.endLineNumber||In.endLineNumber,vi.endColumn||In.endColumn);setTimeout(()=>{Nn.executeEdits("",[{range:Jn,text:""}])},300)}}function Gn(Nn){(window.navigator.platform.match("Mac")?Nn.metaKey:Nn.ctrlKey)&&Nn.keyCode==83&&(Nn.preventDefault(),nn())}const Ai=()=>{if(Qn&&Je.current.instance){const Nn=Je.current.instance.getContentHeight();ze(Nn<Pe?Pe:Nn)}else ze(Pe)};function ji(Nn){var In=document.createEvent("MouseEvents");In.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),Nn.dispatchEvent(In)}const Tn=Nn=>{if(!Be.current)return;const{keyCode:In,ctrlKey:vi,metaKey:Jn,target:ii,type:hi}=Nn;return(hi==="paste"||(In===67||In===86)&&(Jn||vi))&&ii.nodeName==="TEXTAREA"&&(xi(),Nn.preventDefault()),!1};function Qt(Nn,In){var vi=window.URL||window.webkitURL||window,Jn=new Blob([In]),ii=document.createElementNS("http://www.w3.org/1999/xhtml","a");ii.href=vi.createObjectURL(Jn),ii.download=Nn,ji(ii)}(0,ft.useEffect)(()=>{Ai()},[Ai]),(0,ft.useEffect)(()=>{wt.current&&!Se&&Promise.all([kt.e(8909),kt.e(6656)]).then(kt.bind(kt,71448)).then(Nn=>{try{zt=Nn,Je.current.instance=zt.editor.create(wt.current,{value:ke,language:Nt(Ve),theme:ni,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0,autoIndent:!0,contextmenu:!0,formatOnType:!0,minimap:{enabled:ci||!1}},fn);const In=Je.current.instance;let ii=[...Ye.BH._menuItems].find(mn=>mn[0]._debugName=="EditorContext")[1],hi=["editor.action.clipboardCopyWithSyntaxHighlightingAction","editor.action.quickCommand","editor.action.clipboardCopyAction","editor.action.clipboardPasteAction","editor.action.clipboardCutAction"],Ii=(mn,oi)=>{var fr,Mr;let Xr=mn._first;do oi.includes((Mr=(fr=Xr.element)==null?void 0:fr.command)==null?void 0:Mr.id)&&mn._remove(Xr);while(Xr=Xr.next)};if(zn(In,zt),setTimeout(()=>{Ai(),Je.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:()=>{Qt(Wi||"educoder.txt",In.getValue())}})},500),Je.current.subscription=In.onDidChangeModelContent(mn=>{li.current?clearTimeout(Ci.current):(Ai(),an(In.getValue(),mn)),Ci.current=setTimeout(()=>{li.current=!1},500)}),window.Monaco||qt(zt,Nt(Ve)),gn&&(Ii(ii,hi),wt.current.classList.add("noCopyPaste"),window.removeEventListener("keydown",Tn),window.removeEventListener("paste",Tn),window.addEventListener("keydown",Tn),window.addEventListener("paste",Tn)),window.Monaco=zt,Ge&&In.onDidBlurEditorWidget(()=>{Ge(In.getValue())}),gi&&In.onDidFocusEditorText(()=>{gn&&Mt(),gi(In.getValue())}),gn){Mt();try{In.onDidPaste(mn=>{const oi=In.getSelection(),fr=Je.current.pastePos||{},Mr=new zt.Range(fr.startLineNumber||oi.endLineNumber,fr.startColumn||oi.endColumn,fr.endLineNumber||oi.endLineNumber,fr.endColumn||oi.endColumn);In.executeEdits("",[{range:mn.range,text:""}])})}catch(mn){}}let Di=Ue();return Ei&&typeof Ei=="string"&&new ye(Ei,In,zt),Ee(!0),()=>{const mn=Je.current.instance;mn.dispose();const oi=mn.getModel();oi&&oi.dispose(),Je.current.subscription&&Je.current.subscription.dispose(),Di.unobserve(wt.current)}}catch(In){}})},[]),(0,ft.useEffect)(()=>{if(Je.current.instance&&Se)return document.addEventListener("keydown",Gn,!1),()=>{document.removeEventListener("keydown",Gn)}},[nn,Se]),(0,ft.useEffect)(()=>{let Nn=Je.current.instance;if(Nn&&Se){let In=Nt(Ve);zt.editor.setModelLanguage(Nn.getModel(),In)}},[Ve,Se]),(0,ft.useEffect)(()=>{Je.current.instance&&Se&&zt.editor.setTheme(ni)},[ni,Se]),(0,ft.useEffect)(()=>{let Nn=Je.current.instance;Hn.current=dn,Nn&&Se&&(Nn.updateOptions(Me({},dn)),setTimeout(()=>{Nn.getModel().updateOptions(Me({},dn))},200))},[JSON.stringify(dn),Se]),(0,ft.useEffect)(()=>{let Nn=Je.current.instance;Nn&&Se&&Nn.layout()},[xe,Pe,Se]);const[me,bn]=(0,ft.useState)(Si(xe)),[_n,ze]=(0,ft.useState)(Si(Pe)),hn=he(Me({},tn),{width:me,height:_n,position:"relative"});return ft.createElement("div",{className:"my-monaco-editor",ref:wt,style:hn},Ke&&ft.createElement(Xt.CopyToClipboard,{text:ke,onCopy:()=>Ze.ZP.success("\u590D\u5236\u6210\u529F")},ft.createElement(qe.Z,{title:"\u590D\u5236\u4EE3\u7801"},ft.createElement("div",{style:{position:"absolute",top:0,right:10,cursor:"pointer",zIndex:10,color:"#165DFF"}},ft.createElement("i",{className:"iconfont icon-fuzhi8",style:{fontSize:14}})," \u590D\u5236\u4EE3\u7801"))))};function He({width:_e="100%",height:Xe="100%",original:xe,modified:Pe,language:ke,options:Ve={}}){const tn=(0,ft.useRef)(),[dn,fn]=(0,ft.useState)(null);function ni(Qn){let gn;return tn.current&&(gn=new Kt.Z(an=>{for(let zn of an)(zn.target.offsetHeight>0||zn.target.offsetWidth>0)&&Qn.layout()}),gn.observe(tn.current)),gn}(0,ft.useEffect)(()=>(tn.current&&Promise.all([kt.e(8909),kt.e(9404)]).then(kt.bind(kt,2550)).then(Qn=>{zt=Qn;const gn=zt.editor.createDiffEditor(tn.current,he(Me({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},Ve),{wordWrap:!0}));fn(gn);let an=ni(gn);return()=>{gn.dispose();const zn=gn.getModel();zn&&zn.dispose(),an.unobserve(tn.current)}}),()=>{window.removeEventListener("keydown",checkPaste),window.removeEventListener("paste",checkPaste)}),[]),(0,ft.useEffect)(()=>{dn&&dn.setModel({original:zt.editor.createModel(xe,ke),modified:zt.editor.createModel(Pe,ke)})},[xe,Pe,ke,dn]);const Ge=Si(_e),Ke=Si(Xe),nn={width:Ge,height:Ke};return ft.createElement("div",{className:"my-diff-editor",ref:tn,style:nn})}},10661:function(Mn,Rn,kt){"use strict";kt.d(Rn,{Z:function(){return De}});var ft={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"},Kt=kt(29787),le=kt(25399),we=kt(92310),ue=kt.n(we),Dt=kt(51257),ee=kt(28426),pe=kt(48790),Jt=kt(59301),De=({className:ae,dataSource:Le=[],col:Bt=4,right:nt,bottom:et=23,precision:ht=0,wrapWidth:st=1200,trackEventItems:pt,loading:vt,onRemove:St=()=>{},isCurrent:Et=!0,showAlias:At=!1})=>{const It=Math.floor((st-(Bt-1)*nt)/Bt),qt=[{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 Jt.createElement(Kt.Z,{spinning:vt},Jt.createElement("div",{className:ue()(ft.list,ae)},!!(Le!=null&&Le.length)&&(Le==null?void 0:Le.map((Ut,Gt)=>{var ge;const{name:ie,id:Te,identifier:ve,featured:ye,school_name:Ye,image_url:Ze,excellent:qe,is_plan:pn}=Ut;return Jt.createElement("div",{key:Te,className:ft.wrap,style:{width:It,marginRight:(1+Gt)%Bt===0?0:nt+ht,marginBottom:et}},Jt.createElement("a",{className:ft.li,onClick:te=>{te.preventDefault(),te.stopPropagation(),pt&&(0,Dt.L9)([pt]),(0,Dt.xg)(`/paths/${ve}`)}},Jt.createElement("div",{className:ft.img},Jt.createElement("img",{className:ft.cover,src:`${Ze}`}),Et&&(0,pe.bg)()&&(Ut==null?void 0:Ut.studying)&&Jt.createElement("div",{className:`${ft.movebq} user-path-items`,onClick:te=>{te.stopPropagation(),St(Ut)}},Jt.createElement("i",{className:"iconfont icon-yichu1 mr5 c-red"}),Jt.createElement("span",{className:"c-red"},"\u79FB\u9664")),(ge=Ut==null?void 0:Ut.subject_tags)==null?void 0:ge.map((te,Xt)=>{var Qe,On;if(Xt===0){const Ie=(Qe=qt.find(on=>on.name==te))==null?void 0:Qe.swimg;return Jt.createElement("img",{className:ft.sign,src:Ie,style:{left:"-4px"}})}const En=(On=qt.find(Ie=>Ie.name==te))==null?void 0:On.ptimg;return Jt.createElement("img",{className:ft.sign,src:En,style:{left:`${48+52*(Xt-1)+2*Xt}px`}})}),Jt.createElement("div",{style:{position:"absolute",top:"150px",left:"4px"}},(Ut==null?void 0:Ut.excellent)&&Jt.createElement("div",{className:ft.bq},"\u5F00\u653E\u8BFE\u7A0B"))),Jt.createElement("div",{className:ft.name},Jt.createElement(le.Z,{title:At&&(Ut!=null&&Ut.excellent_alias_name)?Jt.createElement("span",null,`\u8BFE\u7A0B\u539F\u540D\uFF1A${ie}`,Jt.createElement("br",null),Jt.createElement("span",null,`\u8BFE\u7A0B\u522B\u540D\uFF1A${Ut==null?void 0:Ut.excellent_alias_name}`)):ie},Jt.createElement("span",{className:ft.e},At&&(Ut==null?void 0:Ut.excellent_alias_name)||ie))),Jt.createElement(le.Z,{title:`\u53D1\u5E03\u5355\u4F4D\uFF1A${Ye}`},Jt.createElement("div",{className:ft.unit},Jt.createElement("i",{className:"iconfont icon-danwei1 font14 mr3"}),Ye)),Jt.createElement("div",{className:ft.tags},Jt.createElement("div",null,Jt.createElement(le.Z,{placement:"bottom",title:"\u7AE0\u8282\u6570"},Jt.createElement("span",null,Jt.createElement("i",{className:"iconfont icon-zhangjie1 font14 mr3"}),Jt.createElement("span",null,Ut.stages_count))),Jt.createElement(le.Z,{placement:"bottom",title:"\u5B66\u4E60\u4EBA\u6570"},Jt.createElement("span",null,Jt.createElement("i",{className:"iconfont icon-chengyuan font14 mr3"}),Jt.createElement("span",null,Ut.members_count)))))))})),!Le.length&&Jt.createElement(ee.Z,null)))}},9148:function(Mn,Rn,kt){"use strict";kt.d(Rn,{jL:function(){return ue},w9:function(){return Qe},QD:function(){return Ge},cQ:function(){return Ze.Z},op:function(){return ke},O5:function(){return Hn},_b:function(){return zn},t7:function(){return st},Gi:function(){return Vn},YG:function(){return on},qp:function(){return De},vr:function(){return Qn},qE:function(){return dn},Je:function(){return St},wb:function(){return Ye},cq:function(){return Rt},tp:function(){return Bt}});var ft=kt(59301),Kt={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"},le="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==",ue=({dataSource:Ln=[],img:jn,imgWidth:li=346,title:Ci,sunTitle:Yi,bannerExtraContent:Be})=>ft.createElement("div",{className:Kt.banner},ft.createElement("div",{className:Kt.content},ft.createElement("aside",null,ft.createElement("p",null,ft.createElement("b",null,Ci),ft.createElement("span",null,Yi)),Ln.length>0&&ft.createElement("div",{className:Kt.btns},Ln.map((Se,Ee)=>ft.createElement("div",{key:Ee,onClick:Se.click},Se.name,Se.sign?ft.createElement("img",{src:le,width:39}):null))),Be),jn&&ft.createElement("img",{style:{marginTop:33,marginRight:38},src:jn,width:li}))),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"},ee=kt(92310),pe=kt.n(ee),Jt=kt(89392),De=({dataSource:Ln=[],value:jn,onChange:li,onTitleChange:Ci,className:Yi,title:Be,titleWidth:Se=41,style:Ee={},fontColor:Ue="#6A7283",showCount:xi})=>{const[Kn,Pi]=(0,ft.useState)(0),[$e,Gn]=(0,ft.useState)(!1),Ai=(0,ft.useRef)(null),ji=(0,ft.useRef)(null);return(0,ft.useEffect)(()=>{var Tn;Ln.length!==0&&(((Tn=Ai==null?void 0:Ai.current)==null?void 0:Tn.clientHeight)>97?Pi(1):Pi(0)),Ln.length===0&&Pi(0),Gn(!1)},[Ln]),ft.createElement("div",{className:pe()(Dt.row,Yi),style:Ee},ft.createElement("div",{onClick:(0,Jt.throttle)(()=>Ci==null?void 0:Ci(),2e3),style:{width:Se,marginTop:$e?12:4},className:`${Dt.title} ${Ci?"current":""}`},Be),ft.createElement("div",{className:$e?`${Dt.tagsWrap} ${Dt.tagsBorderWrap}`:Dt.tagsWrap},ft.createElement("div",{className:Dt.bar,ref:ji,style:Kn>0?{height:Kn===1?97:"auto",overflow:Kn===1?"hidden":"auto",paddingRight:55}:{paddingRight:0}},ft.createElement("div",{className:Dt.tag,ref:Ai},Ln==null?void 0:Ln.map(Tn=>ft.createElement("span",{onClick:()=>li(Tn.id),key:Tn.id,style:{color:Ue},className:jn===Tn.id?Dt.active:""},ft.createElement("span",{title:Tn.name,className:Dt.name},Tn.name),!!xi&&ft.createElement("span",{className:Dt.num},Tn.count))))),!!Kn&&ft.createElement(ft.Fragment,null,Kn===1?ft.createElement("div",{onClick:()=>{var Tn;Pi(2),((Tn=Ai==null?void 0:Ai.current)==null?void 0:Tn.clientHeight)>245?Gn(!0):Gn(!1)},className:Dt.action},"\u5C55\u5F00",ft.createElement("i",{style:{transform:"translateY(1px) scale(0.6)"},className:"iconfont icon-zhankai4"})):ft.createElement("div",{onClick:()=>{ji.current.scrollTop=0,Pi(1),Gn(!1)},className:Dt.action},"\u6536\u8D77",ft.createElement("i",{style:{transform:"translateY(0px) scale(0.6)"},className:"iconfont icon-shouqi3"})))))},ae={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:Ln=[],value:jn,onChange:li,className:Ci,style:Yi={}})=>ft.createElement("div",{style:Yi,className:pe()(ae.tabs,Ci)},Ln.map(Be=>ft.createElement("span",{onClick:()=>li(Be.id),className:jn===Be.id?ae.active:"",key:Be.id},Be.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:Ln=[],value:jn="",onChange:li,onInputChange:Ci=()=>{},className:Yi,style:Be={},placeholder:Se,allowClear:Ee=!1})=>{var Ue;const[xi,Kn]=(0,ft.useState)(""),[Pi,$e]=(0,ft.useState)("");(0,ft.useEffect)(()=>{var ji;let Tn=jn;(ji=JSON.stringify(jn))!=null&&ji.includes("{")&&(Kn(jn.id),Tn=jn.value||"");try{$e(decodeURIComponent(Tn||""))}catch(Qt){$e(decodeURIComponent(Tn||""))}},[jn]);const Gn=()=>{li(encodeURIComponent(Pi),xi||null)},Ai=ji=>{ji!==xi&&(Kn(ji),li(encodeURIComponent(Pi),ji))};return ft.createElement("div",{className:pe()(nt.input,Yi),style:Be},!!Ln.length&&ft.createElement("div",{className:nt.dropdown},ft.createElement("div",{className:nt.text},(Ue=Ln.find(ji=>ji.id===xi))==null?void 0:Ue.name,ft.createElement("i",{className:"iconfont icon-zhankai4"}),ft.createElement("b",{className:nt.b1}),ft.createElement("b",{className:nt.b2})),ft.createElement("div",{className:nt.menu},Ln.map((ji,Tn)=>ft.createElement("div",{key:Tn,onClick:()=>Ai(ji.id)},ji.name)))),ft.createElement(et.default,{onPressEnter:Gn,value:Pi,onChange:ji=>{$e(ji.target.value),Ci(encodeURIComponent(ji.target.value),xi||null)},bordered:!1,placeholder:Se}),ft.createElement("i",{onClick:Gn,className:"iconfont icon-sousuo9 font14 pl10 current"}))},pt={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:Ln,onChange:jn,className:li,total:Ci,pageSize:Yi,style:Be={}})=>{const Se=Ln<2,Ee=Ln>=Math.ceil(Ci/Yi);return Ci<=Yi?ft.createElement(ft.Fragment,null):ft.createElement("div",{className:pe()(pt.quickPager,li),style:Be},ft.createElement("div",{onClick:()=>{Se||jn(Ln-1,"prev")},className:Se?pt.disabled:""},"\u4E0A\u4E00\u9875"),ft.createElement("div",{onClick:()=>{Ee||jn(Ln+1,"next")},className:Ee?pt.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"},At=kt(29787),It=kt(25399),qt=kt(58018),Ut=kt(346),Gt=kt(51257),ge=kt(96908),ie=kt(57177),Te=kt(81378),ve=kt(28426),Ye=({className:Ln,dataSource:jn=[],col:li=4,right:Ci,bottom:Yi=23,precision:Be=0,wrapWidth:Se=1200,trackEventItems:Ee,loading:Ue})=>{const xi=Math.floor((Se-(li-1)*Ci)/li);return ft.createElement(At.Z,{spinning:Ue},ft.createElement("div",{className:pe()(Et.list,Ln)},!!jn.length&&jn.map((Kn,Pi)=>{const{name:$e,id:Gn,identifier:Ai,power:ji,cover_image_id:Tn,pic:Qt}=Kn;return ft.createElement("div",{className:Et.wrap,key:Gn,style:{width:xi,marginRight:(1+Pi)%li===0?0:Ci+Be,marginBottom:Yi}},ft.createElement("a",{target:"_blank",href:`/shixuns/${Ai}/challenges`,className:Et.li,onClick:me=>{me.preventDefault(),Ee&&(0,Gt.L9)([Ee]),ji&&(0,Gt.xg)(`/shixuns/${Ai}/challenges`)}},ft.createElement("div",{className:Et.img},ft.createElement("img",{className:Et.cover,src:`${Qt}`}),Kn.is_jupyter&&ft.createElement("img",{className:Et.sign,src:ge}),Kn.is_jupyter_lab&&ft.createElement("img",{className:Et.sign,src:ie}),Kn.is_unity_3d&&ft.createElement("img",{className:Et.sign,src:Te})),ft.createElement("div",{className:Et.name},ft.createElement(It.Z,{title:$e||"\u5B9E\u8DF5\u9879\u76EE\u540D\u79F0-\u672A\u586B\u5199"},ft.createElement("span",{className:Et.e},$e||"\u5B9E\u8DF5\u9879\u76EE\u540D\u79F0-\u672A\u586B\u5199"))),ft.createElement("div",{className:Et.tags},ft.createElement(It.Z,{placement:"bottom",title:"\u5173\u5361\u6570"},ft.createElement("span",null,ft.createElement("i",{className:"iconfont icon-shixunguanqia font14 mr2"}),ft.createElement("span",null,Kn.challenges_count))),!!Kn.myshixuns_count&&ft.createElement(It.Z,{placement:"bottom",title:"\u5B66\u4E60\u4EBA\u6570"},ft.createElement("span",null,ft.createElement("i",{className:"iconfont icon-chengyuan font14 mr2"}),ft.createElement("span",null,Kn.myshixuns_count))),ft.createElement(It.Z,{placement:"bottom",title:"\u96BE\u5EA6\u7B49\u7EA7"},ft.createElement("span",null,ft.createElement("span",null,Kn.level))),ft.createElement("div",{className:Et.rate},ft.createElement(qt.Z,{allowHalf:!0,disabled:!0,defaultValue:Kn.score_info}),ft.createElement("span",null,"\xA0",Kn.score_info?`${Kn.score_info}\u5206`:"5\u5206")))),!ji&&ft.createElement("div",{className:Et.lockWrap},ft.createElement("img",{src:`${Ut.Z.IMG_SERVER}/images/educoder/icon/lockclose.svg`}),ft.createElement("span",{className:"mt15 font16 c-white"},"\u5B9A\u5411\u5F00\u653E\u5185\u5BB9\uFF0C\u9700\u8981\u6388\u6743")))}),!jn.length&&ft.createElement(ve.Z,null)))},Ze=kt(10661),qe={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"},pn="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",te=kt(59301),Qe=({className:Ln,dataSource:jn=[],col:li=4,right:Ci,bottom:Yi=23,precision:Be=0,wrapWidth:Se=1200,trackEventItems:Ee,loading:Ue,handleVery:xi=()=>!0})=>{const Kn=Math.floor((Se-(li-1)*Ci)/li);return te.createElement(At.Z,{spinning:Ue},te.createElement("div",{className:pe()(qe.list,Ln)},!!jn.length&&jn.map((Pi,$e)=>{const{subject_identifier:Gn,id:Ai,identifier:ji,power:Tn}=Pi,Qt=Pi.is_public!=0&&Pi.is_public;return te.createElement("div",{className:qe.wrap,key:Ai,style:{width:Kn,marginRight:(1+$e)%li===0?0:Ci+Be,marginBottom:Yi}},te.createElement("a",{className:qe.li,onClick:me=>{me.preventDefault(),xi(Pi==null?void 0:Pi.first_category_url)&&(Ee&&(0,Gt.L9)([Ee]),(0,Gt.xg)(Pi.first_category_url))}},te.createElement("div",{className:qe.top},te.createElement(It.Z,{title:Pi.name},te.createElement("div",{className:qe.name},Pi.name)),te.createElement("img",{className:qe.img,src:Ut.Z.IMG_SERVER+"/images/"+Pi.avatar_url}),te.createElement("div",{className:qe.text,title:Pi.creator},Pi.creator),Gn&&te.createElement("div",{className:qe.btns},te.createElement("div",null,"\u5F00\u653E\u8BFE\u7A0B"),te.createElement("aside",null,"\u5F00\u653E\u8BFE\u5802")),Qt&&te.createElement("div",{className:qe.sign},"\u516C\u5F00")),te.createElement("div",{className:qe.bottom},Pi.visits>0&&te.createElement(It.Z,{title:"\u8BBF\u95EE\u91CF",placement:"bottom"},te.createElement("span",null,te.createElement("i",{className:"iconfont icon-liulanyan"}),te.createElement("span",null,Pi.visits))),Pi.course_members_count>0&&te.createElement(It.Z,{title:"\u6210\u5458",placement:"bottom"},te.createElement("span",null,te.createElement("i",{className:"iconfont icon-chengyuan"}),Pi.course_members_count)),Pi.tasks_count>0&&te.createElement(It.Z,{title:"\u4F5C\u4E1A",placement:"bottom"},te.createElement("span",null,te.createElement("i",{className:"iconfont icon-zuoye"}),Pi.tasks_count)),Pi.is_end?te.createElement("div",{style:{color:"#6B758B"}},"\u5DF2\u7ED3\u675F"):te.createElement("div",{style:{color:"#00B187"}},"\u8FDB\u884C\u4E2D"))),!Pi.is_accessible&&te.createElement("div",{className:qe.lockWrap},te.createElement("img",{src:`${Ut.Z.IMG_SERVER}/images/educoder/icon/lockclose.svg`}),te.createElement("span",{className:"mt15 font16 c-white"},"\u975E\u8BFE\u5802\u6210\u5458\u4E0D\u53EF\u8FDB\u5165")))}),!jn.length&&te.createElement(ve.Z,null)))},On={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"},En=kt(25690),on=({dataSource:Ln=[],value:jn,onChange:li,className:Ci,style:Yi={},tabBarExtraContent:Be})=>ft.createElement("div",{className:pe()(On.tabs,Ci),style:Yi},ft.createElement("div",{className:On.tabsWrap},Ln.map((Se,Ee)=>!(Se!=null&&Se.hide)&&ft.createElement("aside",{className:On.tab,onClick:()=>{li(Se.id),Se.link&&En.history.push(Se.link)},key:Ee},ft.createElement("div",{className:jn===Se.id?On.active:""},Se.name),(Se==null?void 0:Se.resetCount)==null&&(Se==null?void 0:Se.total)!==void 0&&ft.createElement("span",null,"\uFF08",Se==null?void 0:Se.total,"\uFF09"),(Se==null?void 0:Se.resetCount)!==void 0&&(Se==null?void 0:Se.total)!==void 0&&ft.createElement(It.Z,{title:(Se==null?void 0:Se.tip)!=null?Se==null?void 0:Se.tip:""},ft.createElement("span",{style:{color:"#9096A3"}},"\uFF08",ft.createElement("span",{style:{color:"#000"}},Se==null?void 0:Se.resetCount),"/",ft.createElement("span",null,Se==null?void 0:Se.total),"\uFF09"))))),ft.createElement("div",{className:On.tabBar},Be)),Vn=({className:Ln,style:jn={},children:li})=>ft.createElement("div",{className:pe()(Ln),style:jn},li),Me={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"},he=kt(75727),Ce=kt(93041);const Yn=[{id:"updated_at",name:"\u6700\u65B0\u52A8\u6001"},{id:"created_at",name:"\u6700\u65B0\u521B\u5EFA"},{id:"name",name:"\u540D\u79F0\u6392\u5E8F"}];var Rt=({sortValue:Ln,dropValue:jn,className:li,onSort:Ci,onDrop:Yi,dataSource:Be=Yn})=>{var Se;return ft.createElement("div",{className:pe()(Me.orderWrap,li)},ft.createElement(he.Z,{dropdownRender:()=>ft.createElement(Ce.default,null,Be.map((Ee,Ue)=>ft.createElement(Ce.default.Item,{key:Ue,onClick:()=>Yi(Ee.id)},Ee.name)))},ft.createElement("span",{className:Me.orderTextWrap},(Se=Be.find(Ee=>jn===Ee.id))==null?void 0:Se.name)),ft.createElement("span",{className:Me.orderIconWrap},ft.createElement("span",{className:Me.orderAsc},ft.createElement("i",{className:Ln==="asc"?`iconfont icon-sanjiaoxing-up font12 ${Me.cursorPointer} ${Me.active}`:`iconfont icon-sanjiaoxing-up font12 ${Me.cursorPointer}`,onClick:()=>Ci(Ln==="asc"?"desc":"asc")})),ft.createElement("span",{className:Me.orderDesc},ft.createElement("i",{className:Ln==="desc"?`iconfont icon-sanjiaoxing-down font12 ${Me.cursorPointer} ${Me.active}`:`iconfont icon-sanjiaoxing-down font12 ${Me.cursorPointer}`,onClick:()=>Ci(Ln==="asc"?"desc":"asc")}))))},Ft={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"},Pt=kt(99571),Nt=Object.defineProperty,zt=Object.getOwnPropertySymbols,Mt=Object.prototype.hasOwnProperty,Yt=Object.prototype.propertyIsEnumerable,He=(Ln,jn,li)=>jn in Ln?Nt(Ln,jn,{enumerable:!0,configurable:!0,writable:!0,value:li}):Ln[jn]=li,_e=(Ln,jn)=>{for(var li in jn||(jn={}))Mt.call(jn,li)&&He(Ln,li,jn[li]);if(zt)for(var li of zt(jn))Yt.call(jn,li)&&He(Ln,li,jn[li]);return Ln},Xe=(Ln,jn)=>{var li={};for(var Ci in Ln)Mt.call(Ln,Ci)&&jn.indexOf(Ci)<0&&(li[Ci]=Ln[Ci]);if(Ln!=null&&zt)for(var Ci of zt(Ln))jn.indexOf(Ci)<0&&Yt.call(Ln,Ci)&&(li[Ci]=Ln[Ci]);return li},xe=(Ln,jn,li)=>new Promise((Ci,Yi)=>{var Be=Ue=>{try{Ee(li.next(Ue))}catch(xi){Yi(xi)}},Se=Ue=>{try{Ee(li.throw(Ue))}catch(xi){Yi(xi)}},Ee=Ue=>Ue.done?Ci(Ue.value):Promise.resolve(Ue.value).then(Be,Se);Ee((li=li.apply(Ln,jn)).next())}),ke=Ln=>{var jn=Ln,{className:li,style:Ci,children:Yi,loading:Be=!1,openLoading:Se,onClick:Ee=()=>{},size:Ue="middle",shape:xi="round"}=jn,Kn=Xe(jn,["className","style","children","loading","openLoading","onClick","size","shape"]);const[Pi,$e]=(0,ft.useState)(!1);return ft.createElement(Pt.ZP,_e({onClick:(0,Jt.throttle)(Gn=>xe(void 0,null,function*(){Se&&$e(!0);try{yield Ee(Gn)}catch(Ai){console.log("error",Ai)}Se&&$e(!1)}),2e3,{leading:!0,trailing:!1}),className:pe()(Ft.btn,Ft[`${Ue}-${xi}`],li),style:Ci,size:Ue,shape:xi,loading:Pi||Be},Kn),Yi)},Ve={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"},dn=({className:Ln,style:jn,children:li=null,onClick:Ci,title:Yi})=>ft.createElement("div",{className:pe()(Ve.head,Ln),style:jn},ft.createElement("span",{className:"primary-hover",onClick:Ci},ft.createElement("i",{className:"iconfont icon-fanhui2 font12"}),"\u8FD4\u56DE"),ft.createElement("b",{title:Yi},Yi),ft.createElement("div",{className:Ve.node},li)),fn={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"},Ge=({confirmShow:Ln=!0,confirmTitle:jn,confirmClick:li,cancelShow:Ci=!0,cancelTitle:Yi,cancelClick:Be,className:Se,style:Ee,confirmLoading:Ue=!1})=>ft.createElement("div",{className:pe()(fn.btns,Se),style:Ee},Ln&&ft.createElement(Pt.ZP,{loading:Ue,onClick:li,type:"primary",className:fn.confirm},jn),Ci&&ft.createElement(Pt.ZP,{onClick:Be,className:fn.cancel},Yi)),Ke={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"},Qn=({className:Ln,style:jn={},LeftContent:li,children:Ci,RightContent:Yi})=>ft.createElement("div",{className:pe()(Ke.fixedBottom,Ln),style:jn},ft.createElement("div",{className:Ke.wrap},ft.createElement("div",{className:Ke.left},li),ft.createElement("div",{className:Ke.center},Ci),ft.createElement("div",{className:Ke.right},Yi))),gn={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"},zn=({className:Ln,style:jn={},dataSource:li=[]})=>ft.createElement("div",{className:pe()(gn.crumbs,Ln),style:jn},li.map((Ci,Yi)=>Yi<li.length-1?ft.createElement(ft.Fragment,{key:Yi},Ci.path||Ci.onClick?ft.createElement("span",{className:gn.hover,onClick:Ci!=null&&Ci.onClick?Ci.onClick:()=>En.history.push(Ci.path)},Ci.name):ft.createElement("span",null,Ci.name),ft.createElement("span",null,"\xA0",">","\xA0")):ft.createElement("span",{key:Yi,style:{color:"#5F6368"}},Ci.name))),gi=kt(11938),ti=Object.defineProperty,wi=Object.defineProperties,Wi=Object.getOwnPropertyDescriptors,Cn=Object.getOwnPropertySymbols,Pn=Object.prototype.hasOwnProperty,Bn=Object.prototype.propertyIsEnumerable,si=(Ln,jn,li)=>jn in Ln?ti(Ln,jn,{enumerable:!0,configurable:!0,writable:!0,value:li}):Ln[jn]=li,Ei=(Ln,jn)=>{for(var li in jn||(jn={}))Pn.call(jn,li)&&si(Ln,li,jn[li]);if(Cn)for(var li of Cn(jn))Bn.call(jn,li)&&si(Ln,li,jn[li]);return Ln},ci=(Ln,jn)=>wi(Ln,Wi(jn)),Zi=(Ln,jn)=>{var li={};for(var Ci in Ln)Pn.call(Ln,Ci)&&jn.indexOf(Ci)<0&&(li[Ci]=Ln[Ci]);if(Ln!=null&&Cn)for(var Ci of Cn(Ln))jn.indexOf(Ci)<0&&Bn.call(Ln,Ci)&&(li[Ci]=Ln[Ci]);return li};const{Countdown:wt}=gi.default;var Hn=Ln=>{var jn=Ln,{onChange:li}=jn,Ci=Zi(jn,["onChange"]);const[Yi,Be]=(0,ft.useState)(null);(0,ft.useEffect)(()=>{typeof Yi=="number"&&Yi>=0&&li(Yi)},[Yi]);const Se=Ee=>{const Ue=Math.floor(Ee/1e3);Be(Ue)};return ft.createElement(wt,ci(Ei({},Ci),{onChange:Se}))}},37808:function(Mn,Rn,kt){"use strict";kt.d(Rn,{Z:function(){return Kt}});var ft=kt(59301);function Kt(le,we){const ue=(0,ft.useRef)();(0,ft.useEffect)(()=>{ue.current=le}),(0,ft.useEffect)(()=>{function Dt(){ue.current()}if(we!==null){let ee=setInterval(Dt,we);return()=>clearInterval(ee)}},[we])}},37345:function(Mn,Rn,kt){"use strict";kt.d(Rn,{h:function(){return ft}});var ft=(Kt=>(Kt[Kt.NOMATCH=-1]="NOMATCH",Kt[Kt.OK=0]="OK",Kt[Kt.TIMEOUT=2]="TIMEOUT",Kt[Kt.PODFAILURE=3]="PODFAILURE",Kt[Kt.COMPILEFAILURE=4]="COMPILEFAILURE",Kt[Kt.EXECUTEFAILURE=5]="EXECUTEFAILURE",Kt[Kt.HIDE_COMPILE_STATUS=11]="HIDE_COMPILE_STATUS",Kt))(ft||{})},81072:function(Mn,Rn,kt){"use strict";kt.d(Rn,{H7:function(){return nt},MK:function(){return Bt},MU:function(){return jt},X6:function(){return ae},bM:function(){return Jt},fi:function(){return et},fu:function(){return pe},n4:function(){return ht},rX:function(){return Le},vl:function(){return st},zO:function(){return De}});var ft=kt(38986),Kt=Object.defineProperty,le=Object.getOwnPropertySymbols,we=Object.prototype.hasOwnProperty,ue=Object.prototype.propertyIsEnumerable,Dt=(pt,vt,St)=>vt in pt?Kt(pt,vt,{enumerable:!0,configurable:!0,writable:!0,value:St}):pt[vt]=St,ee=(pt,vt)=>{for(var St in vt||(vt={}))we.call(vt,St)&&Dt(pt,St,vt[St]);if(le)for(var St of le(vt))ue.call(vt,St)&&Dt(pt,St,vt[St]);return pt};function pe(pt,vt){return(0,ft.U2)(`myproblems/${pt}.json`,ee({hidePopLogin:!0},vt||{}))}function Jt(pt,vt){return(0,ft.v_)(`myproblems/${pt}/code_submit.json`,vt)}function jt(pt,vt){return(0,ft.v_)(`myproblems/${pt}/code_debug.json`,vt)}function De(pt,vt){return vt.language&&(vt.language=encodeURIComponent(vt.language)),(0,ft.U2)(`myproblems/${pt}/submit_records.json`,vt)}function ae(pt){return(0,ft.U2)("myproblems/record_detail.json",{id:pt})}function Le(pt,vt){return(0,ft.U2)(`myproblems/${pt}/result.json`,{mode:vt})}function Bt(pt,vt){return(0,ft.v_)(`myproblems/${pt}/add_notes.json`,vt)}function nt(pt,vt){return(0,ft.v_)(`myproblems/${pt}/restore_initial_code.json`,vt)}function et(pt){return(0,ft.v_)(`myproblems/${pt}/sync_code.json`)}function ht(pt,vt){return(0,ft.v_)(`myproblems/${pt}/update_code.json`,vt)}function st(pt,vt){return(0,ft.v_)(`discusses/${pt}/plus.json`,vt)}},43554:function(Mn,Rn,kt){"use strict";kt.d(Rn,{Z:function(){return Ta}});var ft=kt(59301),Kt={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"},le=kt(28284),we=kt(25399),ue=kt(99571),Dt=kt(62957),ee=kt(71051),pe=kt(6767),Jt=kt(37568),jt=kt(37285),De=kt(62673),ae=kt(37639),Le=kt(77019),Bt=kt(5269),nt=kt(13747),et=Object.defineProperty,ht=Object.getOwnPropertySymbols,st=Object.prototype.hasOwnProperty,pt=Object.prototype.propertyIsEnumerable,vt=(oe,Re,_t)=>Re in oe?et(oe,Re,{enumerable:!0,configurable:!0,writable:!0,value:_t}):oe[Re]=_t,St=(oe,Re)=>{for(var _t in Re||(Re={}))st.call(Re,_t)&&vt(oe,_t,Re[_t]);if(ht)for(var _t of ht(Re))pt.call(Re,_t)&&vt(oe,_t,Re[_t]);return oe};const Et=oe=>React.createElement("svg",St({width:34,height:34,xmlns:"http://www.w3.org/2000/svg"},oe),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 At="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzQiIGhlaWdodD0iMzQiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48cmVjdCBmaWxsPSIjRTRFNkZEIiB3aWR0aD0iMzQiIGhlaWdodD0iMzQiIHJ4PSIxMCIvPjxnIGZpbGwtcnVsZT0ibm9uemVybyI+PHBhdGggZD0iTTEzLjgwOCAxMS40NDhhLjU1OC41NTggMCAwIDEgMCAuNzg4bC0xLjU2NCAxLjU2NWEuNTU4LjU1OCAwIDEgMS0uNzg5LS43OWwxLjU2NC0xLjU2M2EuNTU4LjU1OCAwIDAgMSAuNzkgMFptOS44ODIgMi40NjJhLjU1OC41NTggMCAwIDEtLjc4OSAwbC0xLjU2NC0xLjU2M2EuNTU4LjU1OCAwIDEgMSAuNzg5LS43ODlsMS41NjQgMS41NjRhLjU1Ni41NTYgMCAwIDEgMCAuNzg4WiIgZmlsbD0iIzY2NzhFQiIvPjxwYXRoIGQ9Ik0yMS43NTMgMjEuNzA3YTUuOTM3IDUuOTM3IDAgMSAwLTguNTguMDE1bC0uOTM3LjkzNmEuNTU4LjU1OCAwIDEgMCAuNzg5Ljc4OGwuOTk1LS45OTRhNS45MSA1LjkxIDAgMCAwIDMuNDM2IDEuMDk1YzEuMjg3IDAgMi40OC0uNDEgMy40NTItMS4xMDZsLjk5Mi45OTJhLjU1OC41NTggMCAxIDAgLjc4OS0uNzg5bC0uOTM2LS45MzdaIiBmaWxsPSIjNjY3OEVCIi8+PHBhdGggZD0ibTIwLjg1OCAxOC45NS0zLjAyNC0xLjc0NXYtMi4wNTRhLjU1OC41NTggMCAxIDAtMS4xMTcgMHYyLjM1MWMwIC4wNjQuMDExLjEyNi4wMzEuMTg0YS41NTEuNTUxIDAgMCAwIC4yNTguMzNsMy4yOTMgMS45YS41NTcuNTU3IDAgMCAwIC41NTktLjk2NloiIGZpbGw9IiNGRkYiLz48L2c+PC9nPjwvc3ZnPg==",It=kt(76902),qt=kt(25690),Ut=kt(51257),Gt=kt(38986),ge=Object.defineProperty,ie=Object.getOwnPropertySymbols,Te=Object.prototype.hasOwnProperty,ve=Object.prototype.propertyIsEnumerable,ye=(oe,Re,_t)=>Re in oe?ge(oe,Re,{enumerable:!0,configurable:!0,writable:!0,value:_t}):oe[Re]=_t,Ye=(oe,Re)=>{for(var _t in Re||(Re={}))Te.call(Re,_t)&&ye(oe,_t,Re[_t]);if(ie)for(var _t of ie(Re))ve.call(Re,_t)&&ye(oe,_t,Re[_t]);return oe};const Ze=oe=>React.createElement("svg",Ye({width:34,height:34,xmlns:"http://www.w3.org/2000/svg"},oe),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 qe="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzQiIGhlaWdodD0iMzQiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48cmVjdCB3aWR0aD0iMzQiIGhlaWdodD0iMzQiIHJ4PSIxMCIgZmlsbD0iI0VBRjNGNCIvPjxwYXRoIGQ9Ik0yNS45MDUgMTUuMzdhLjc3NS43NzUgMCAwIDAtLjYyNi0uNTI5bC00LjgxNC0uNy0yLjE1Mi00LjM2MmEuNzc2Ljc3NiAwIDAgMC0xLjM5MiAwbC0yLjE1MyA0LjM2My00LjgxNC42OTlhLjc3NS43NzUgMCAwIDAtLjQzIDEuMzIzbDMuNDg0IDMuMzk2LS44MjMgNC43OTRhLjc3Ny43NzcgMCAwIDAgMS4xMjYuODE4bDQuMzA2LTIuMjY0IDQuMzA1IDIuMjY0YS43NzguNzc4IDAgMCAwIC44MTctLjA1OS43NzcuNzc3IDAgMCAwIC4zMS0uNzU5bC0uODIzLTQuNzk0IDMuNDgzLTMuMzk2YS43NzcuNzc3IDAgMCAwIC4xOTYtLjc5NVoiIGZpbGw9IiMyMUMwQTYiIGZpbGwtcnVsZT0ibm9uemVybyIvPjwvZz48L3N2Zz4=",pn=Object.defineProperty,te=Object.getOwnPropertySymbols,Xt=Object.prototype.hasOwnProperty,Qe=Object.prototype.propertyIsEnumerable,On=(oe,Re,_t)=>Re in oe?pn(oe,Re,{enumerable:!0,configurable:!0,writable:!0,value:_t}):oe[Re]=_t,En=(oe,Re)=>{for(var _t in Re||(Re={}))Xt.call(Re,_t)&&On(oe,_t,Re[_t]);if(te)for(var _t of te(Re))Qe.call(Re,_t)&&On(oe,_t,Re[_t]);return oe};const Ie=oe=>React.createElement("svg",En({width:34,height:34,xmlns:"http://www.w3.org/2000/svg"},oe),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 on="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzQiIGhlaWdodD0iMzQiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48cmVjdCBmaWxsPSIjRTdGM0ZGIiB3aWR0aD0iMzQiIGhlaWdodD0iMzQiIHJ4PSIxMCIvPjxnIGZpbGw9IiM0QzZGRkYiIGZpbGwtcnVsZT0ibm9uemVybyI+PHBhdGggZD0ibTIzLjcxOSAxMy4zMjUtNC4wOTgtMy45NGMtLjA5Ny0uMTMtLjIyNS0uMTYyLS4zNTUtLjE2Mi0uMTI5IDAtLjI1OC4wNjQtLjM4Ny4xNjFsLTcuNTUgNy43NTNjLS4wNjUuMDY1LS4wOTguMTYyLS4xMy4yMjdsLTEuMDMyIDUuNDI3Yy0uMDMzLjE5NC4wMzIuMzIzLjE2LjQ4NC4xMy4xMy4yMjcuMTYyLjM4OS4xNjJoLjA5Nmw0Ljc3Ni0xLjA5OWMuMDk3LS4wMzIuMTk0LS4wNjQuMjU4LS4xNjFsNy44NDEtOC4xMDhjLjE5NC0uMTYyLjE5NC0uNTE3LjAzMy0uNzQ0aC0uMDAxWm0tOC4xIDguMDQ0YS41MzQuNTM0IDAgMCAxLS4zODYuMTYyLjU2LjU2IDAgMCAxLS4zODgtLjE2MmwtMy0yLjgxYy0uMjI2LS4xOTQtLjIyNi0uNTE3LS4wMzMtLjc0My4xOTQtLjIyNy41MTctLjIyNy43NDMtLjAzM2wzIDIuODExYy4yNTkuMjI2LjI5MS41NS4wNjUuNzc2Wk0xNyAyMi45Mmg2Ljg0NHYxLjA1NUgxN3oiLz48L2c+PC9nPjwvc3ZnPg==",cn=kt(12327),Vn=kt(39793),Me=kt(61011),he=kt(30371),Ce={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"},Yn=kt(59301),Si=Object.defineProperty,Rt=Object.defineProperties,Ft=Object.getOwnPropertyDescriptors,Pt=Object.getOwnPropertySymbols,Nt=Object.prototype.hasOwnProperty,zt=Object.prototype.propertyIsEnumerable,Mt=(oe,Re,_t)=>Re in oe?Si(oe,Re,{enumerable:!0,configurable:!0,writable:!0,value:_t}):oe[Re]=_t,Yt=(oe,Re)=>{for(var _t in Re||(Re={}))Nt.call(Re,_t)&&Mt(oe,_t,Re[_t]);if(Pt)for(var _t of Pt(Re))zt.call(Re,_t)&&Mt(oe,_t,Re[_t]);return oe},He=(oe,Re)=>Rt(oe,Ft(Re)),_e=(oe,Re)=>{var _t={};for(var ce in oe)Nt.call(oe,ce)&&Re.indexOf(ce)<0&&(_t[ce]=oe[ce]);if(oe!=null&&Pt)for(var ce of Pt(oe))Re.indexOf(ce)<0&&zt.call(oe,ce)&&(_t[ce]=oe[ce]);return _t};const Xe=null,xe=(oe,Re)=>{var _t=oe,{globalSetting:ce,loading:Rr,dispatch:vr,isEdit:Fr,editData:sr}=_t,Pr=_e(_t,["globalSetting","loading","dispatch","isEdit","editData"]);const[fo,Yr]=(0,ft.useState)(""),[Ir,Vi]=(0,ft.useState)(""),[to,Hi]=(0,ft.useState)([]),[ir,Ui]=(0,ft.useState)(""),[kr,Er]=(0,ft.useState)(),[Tr,eo]=(0,ft.useState)(!1),[zi,Nr]=(0,ft.useState)({}),[Fi,Xi]=(0,ft.useState)([]);(0,ft.useEffect)(()=>{!sr||!Fr||(Yr(sr==null?void 0:sr.name),Vi(sr==null?void 0:sr.analysis),Er(sr==null?void 0:sr.is_ordered),Nr(sr),eo(!0))},[sr]),(0,ft.useEffect)(()=>{if(!Tr)return;const uo=sr==null?void 0:sr.standard_answer.map(ea=>ea==null?void 0:ea.answer_text);Hi(uo);const Br=sr==null?void 0:sr.standard_answer.map(ea=>ea==null?void 0:ea.score);Xi(Br),eo(!1)},[Tr]),(0,ft.useImperativeHandle)(Re,()=>({onSave:pr,Clear:ao}));const pr=()=>{let uo=[],Br=!1;return fo?(to.forEach((ea,Zo)=>{uo.push({position:Zo+1,answer_text:[],score:Fi[Zo]}),ea==null||ea.forEach((Fa,Al)=>{uo[Zo].answer_text.push(Fa),(!Fa||!(0,Ut.eR)(Fa,1e4))&&(Ui(`${Zo}-${Al}`),pe.ZP.info(Fa?"\u7B54\u6848\u4E0D\u80FD\u8D85\u8FC710000\u5B57\u7B26":"\u7B54\u6848\uFF1A\u4E0D\u80FD\u4E3A\u7A7A"),Br=!0)})}),Br?!1:(uo==null?void 0:uo.length)>20?(pe.ZP.warning("\u586B\u7A7A\u9898\u6807\u51C6\u7B54\u6848\u4E0D\u80FD\u4E3A\u7A7A/\u4E0D\u80FD\u8D85\u8FC720\u4E2A\uFF01"),!1):{name:fo,analysis:Ir,standard_answers:uo,is_ordered:kr,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}):(pe.ZP.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),!1)},ao=()=>{Yr(""),Vi(""),Hi([]),Er(!1)},mo=(uo,Br,ea)=>{const Zo=to.slice();if(Br&&Zo.splice(uo,Br),ea)for(let Fa=0;Fa<ea;Fa++)Zo.splice(uo+Fa,0,[""]);Hi(Zo)},Ro=(uo,Br,ea)=>{Ui("");let Zo=to.slice();Zo[uo][Br]=ea,Hi(Zo)},Ji=uo=>{let Br=to.slice();Br[uo]=[...Br[uo],""],Hi(Br)},_a=(uo,Br)=>{let ea=to.slice();if(!ea[uo][Br]){ea[uo]=ea[uo].filter((Zo,Fa)=>Fa!==Br),Hi(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:Ce.modal,onOk:()=>{ea[uo]=ea[uo].filter((Zo,Fa)=>Fa!==Br),Hi(ea)}})},wr=uo=>{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:Ce.modal,onOk:()=>{let Br=to.slice();Br=to.filter((ea,Zo)=>uo!==Zo),Hi(Br)}})};return Yn.createElement("section",{className:Ce.wrap},Yn.createElement("p",{className:Ce.titleWrap},Yn.createElement("span",{className:Ce.required},"*"),Yn.createElement("span",{className:Ce.title},"\u9898\u5E72\uFF1A")),Yn.createElement("div",null,Yn.createElement(Me.Z,{id:"completion-question-tittle",placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE",height:155,defaultValue:fo,onChange:uo=>Yr(uo),showNullButton:!0,onPlaceholderChange:mo})),Yn.createElement("div",{className:"mt20"},to.map((uo,Br)=>Yn.createElement("div",{style:{display:"flex"}},Yn.createElement("div",{style:{flex:1}},Yn.createElement(he.Z,{key:Br,answers:uo,index:Br,flex:1,is_md:!0,activeOptionErrorIndex:ir,onAnswerChange:Ro,addChildAnswer:Ji,deleteChildAnswer:_a,deleteChildAnswermain:wr})),zi.use_blank_score&&Yn.createElement("div",{style:{display:"flex",alignItems:"center",width:"165px"}},Yn.createElement("span",{style:{color:"red",margin:"auto 5px auto 10px"}},"*"),"\u5206\u503C\uFF1A",Yn.createElement(ee.Z,{style:{width:"100px"},size:"large",defaultValue:Fi[Br],onBlur:ea=>{Fi[Br]=ea.target.value,Xi([...Fi])}}))))),Yn.createElement("div",null,Yn.createElement(De.default,{className:`${Ce.color333} font14 mt20`,checked:zi.use_blank_score,onChange:uo=>Nr(He(Yt({},zi),{use_blank_score:uo.target.checked}))},"\u5224\u5206\u65F6\u6309\u7A7A\u7ED9\u5206"),Yn.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")),Yn.createElement("div",null,Yn.createElement(De.default,{className:`${Ce.color333} font14 mt20`,checked:zi.downcase,onChange:uo=>Nr(He(Yt({},zi),{downcase:uo.target.checked}))},"\u5224\u5206\u65F6\u5FFD\u7565\u7B54\u6848\u4E2D\u7684\u5B57\u6BCD\u5927\u5C0F\u5199")),Yn.createElement("div",null,Yn.createElement(De.default,{className:`${Ce.color333} font14 mt20`,checked:zi.no_space,onChange:uo=>Nr(He(Yt({},zi),{no_space:uo.target.checked}))},"\u5224\u5206\u65F6\u5FFD\u7565\u7B54\u6848\u4E2D\u7684\u7A7A\u683C")),Yn.createElement("div",{className:"mt20"},(to==null?void 0:to.length)>1&&Yn.createElement("span",null,Yn.createElement(De.default,{checked:kr,onChange:uo=>Er(uo.target.checked),className:`${Ce.color333} font14`},"\u591A\u4E2A\u586B\u7A7A\u7684\u7B54\u6848\u6709\u987A\u5E8F\u8981\u6C42"),Yn.createElement("span",{className:`${Ce.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"))),Yn.createElement("p",{className:Ce.titleWrap},Yn.createElement("span",{className:Ce.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),Yn.createElement(Vn.Z,{id:"single-question-answer",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:Ir,onChange:uo=>Vi(uo)}))};var Pe=(0,qt.connect)(({loading:oe,globalSetting:Re})=>({globalSetting:Re,loading:oe.effects}),null,null,{forwardRef:!0})((0,ft.forwardRef)(xe)),ke=kt(47889),Ve=Object.getOwnPropertySymbols,tn=Object.prototype.hasOwnProperty,dn=Object.prototype.propertyIsEnumerable,fn=(oe,Re)=>{var _t={};for(var ce in oe)tn.call(oe,ce)&&Re.indexOf(ce)<0&&(_t[ce]=oe[ce]);if(oe!=null&&Ve)for(var ce of Ve(oe))Re.indexOf(ce)<0&&dn.call(oe,ce)&&(_t[ce]=oe[ce]);return _t};const ni=null,Ge=(oe,Re)=>{var _t=oe,{globalSetting:ce,loading:Rr,editData:vr,dispatch:Fr,onRef:sr=()=>{},isEdit:Pr}=_t,fo=fn(_t,["globalSetting","loading","editData","dispatch","onRef","isEdit"]);const[Yr,Ir]=(0,ft.useState)(),[Vi,to]=(0,ft.useState)(""),[Hi,ir]=(0,ft.useState)("");(0,ft.useEffect)(()=>{if(!vr||!Pr)return;to(vr==null?void 0:vr.name),ir(vr==null?void 0:vr.analysis);const Er=vr==null?void 0:vr.choices.find(Tr=>Tr.is_answer);Ir(Er.choice_text==="\u6B63\u786E"?"0":"1")},[vr]),(0,ft.useImperativeHandle)(Re,()=>({onSave:Ui,Clear:kr}));const Ui=()=>Vi?Yr?{name:Vi,choices:[{choice_text:"\u6B63\u786E",is_answer:Yr==="0"?1:0},{choice_text:"\u9519\u8BEF",is_answer:Yr==="1"?1:0}],analysis:Hi}:(pe.ZP.info("\u8BF7\u5148\u70B9\u51FB\u9009\u62E9\u672C\u9009\u62E9\u9898\u7684\u6B63\u786E\u9009\u9879"),!1):(pe.ZP.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),!1),kr=()=>{to(""),ir(""),Ir("")};return ft.createElement("section",{className:Ce.wrap},ft.createElement("p",{className:Ce.titleWrap},ft.createElement("span",{className:Ce.required},"*"),ft.createElement("span",{className:Ce.title},"\u9898\u5E72\uFF1A")),ft.createElement(Vn.Z,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:Vi,onChange:Er=>to(Er)}),ft.createElement("p",{className:Ce.titleWrap},ft.createElement("span",{className:Ce.required},"*"),ft.createElement("span",{className:Ce.title},"\u7B54\u6848\u9009\u9879\uFF1A",ft.createElement("span",{className:Ce.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),ft.createElement(ke.ZP.Group,{buttonStyle:"solid",value:Yr,onChange:Er=>Ir(Er.target.value)},ft.createElement(ke.ZP.Button,{value:"0",className:`${Ce.radio} mr40`},"\u6B63\u786E"),ft.createElement(ke.ZP.Button,{value:"1",className:Ce.radio},"\u9519\u8BEF")),ft.createElement("p",{className:Ce.titleWrap},ft.createElement("span",{className:Ce.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),ft.createElement(Vn.Z,{id:"single-question-answer",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:Hi,onChange:Er=>ir(Er)}))};var Ke=(0,qt.connect)(({loading:oe,globalSetting:Re})=>({globalSetting:Re,loading:oe.effects}),null,null,{forwardRef:!0})((0,ft.forwardRef)(Ge)),nn=Object.getOwnPropertySymbols,Qn=Object.prototype.hasOwnProperty,gn=Object.prototype.propertyIsEnumerable,an=(oe,Re)=>{var _t={};for(var ce in oe)Qn.call(oe,ce)&&Re.indexOf(ce)<0&&(_t[ce]=oe[ce]);if(oe!=null&&nn)for(var ce of nn(oe))Re.indexOf(ce)<0&&gn.call(oe,ce)&&(_t[ce]=oe[ce]);return _t};const zn=null,gi=(oe,Re)=>{var _t=oe,{globalSetting:ce,loading:Rr,editData:vr,dispatch:Fr,onRef:sr=()=>{},isEdit:Pr}=_t,fo=an(_t,["globalSetting","loading","editData","dispatch","onRef","isEdit"]);const[Yr,Ir]=(0,ft.useState)([]);(0,ft.useEffect)(()=>{var ir;if(!vr||!Pr)return;const Ui=(ir=vr==null?void 0:vr.shixun)==null?void 0:ir.challenges.map(kr=>({id:kr==null?void 0:kr.id,score:kr.score}));Ir(Ui)},[vr]),(0,ft.useImperativeHandle)(Re,()=>({onSave:Vi,Clear:to}));const Vi=()=>({challenges:[...Yr]}),to=()=>{Ir([])};console.log("editData--",vr);const Hi=ir=>{var Ui,kr;return ft.createElement("div",null,(kr=(Ui=ir==null?void 0:ir.shixun)==null?void 0:Ui.challenges)==null?void 0:kr.map((Er,Tr)=>{var eo;return ft.createElement("div",{className:"c-grey-666 font14 ml25",style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"15px"}},ft.createElement("div",null,ft.createElement("span",{className:"mr5"},"\u7B2C",Tr+1,"\u5173"),ft.createElement(we.Z,{key:Tr,title:Er==null?void 0:Er.challenge_name},ft.createElement("span",null,(0,Ut.Pq)(Er==null?void 0:Er.challenge_name,44)))),ft.createElement("p",{style:{marginBottom:0}},ft.createElement("span",{className:Ce.required},"*"),ft.createElement("span",{className:Ce.title},"\u5206\u503C\uFF1A"),ft.createElement(ee.Z,{precision:1,min:1,max:100,className:Ce.baseFormItem,style:{width:176},value:(eo=Yr.find(zi=>zi.id===Er.id))==null?void 0:eo.score,onChange:zi=>{Yr.find(Nr=>Nr.id===Er.id).score=zi,Ir([...Yr])}})))}),ft.createElement("div",{style:{clear:"both"}}))};return ft.createElement("section",{className:Ce.wrap},ft.createElement(It.Z,{style:{paddingRight:10},className:Ce.titleHtml,value:`${vr==null?void 0:vr.position}\u3001${vr==null?void 0:vr.name}`}),ft.createElement("p",{style:{marginBottom:"10px",marginTop:"25px"}},ft.createElement("span",{className:Ce.required},"*"),ft.createElement("span",{className:Ce.title},"\u5173\u5361")),Hi(vr))};var ti=(0,qt.connect)(({loading:oe,globalSetting:Re})=>({globalSetting:Re,loading:oe.effects}),null,null,{forwardRef:!0})((0,ft.forwardRef)(gi)),wi=Object.getOwnPropertySymbols,Wi=Object.prototype.hasOwnProperty,Cn=Object.prototype.propertyIsEnumerable,Pn=(oe,Re)=>{var _t={};for(var ce in oe)Wi.call(oe,ce)&&Re.indexOf(ce)<0&&(_t[ce]=oe[ce]);if(oe!=null&&wi)for(var ce of wi(oe))Re.indexOf(ce)<0&&Cn.call(oe,ce)&&(_t[ce]=oe[ce]);return _t};const Bn=["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"],si=(oe,Re)=>{var _t=oe,{editData:ce,globalSetting:Rr,loading:vr,dispatch:Fr,onRef:sr=()=>{},isEdit:Pr}=_t,fo=Pn(_t,["editData","globalSetting","loading","dispatch","onRef","isEdit"]);const[Yr,Ir]=(0,ft.useState)([]),[Vi,to]=(0,ft.useState)(),[Hi,ir]=(0,ft.useState)([]),[Ui,kr]=(0,ft.useState)(""),[Er,Tr]=(0,ft.useState)("");(0,ft.useEffect)(()=>{Ir(["","","",""])},[]),(0,ft.useEffect)(()=>{if(!ce||!Pr)return;kr(ce==null?void 0:ce.name),Tr(ce==null?void 0:ce.analysis),Ir(ce==null?void 0:ce.choices.map(Fi=>Fi.choice_text));const Nr=[];ce==null||ce.choices.map((Fi,Xi)=>{Fi.is_answer&&Nr.push(Xi)}),ir(Nr)},[ce]),(0,ft.useImperativeHandle)(Re,()=>({onSave:eo,Clear:zi}));const eo=()=>{if(!Ui)return pe.ZP.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),!1;const Nr=Yr.findIndex(Xi=>!Xi);if(Nr>-1)return pe.ZP.info(`\u8BF7\u5148\u8F93\u5165 ${Bn[Nr]} \u9009\u9879\u7684\u5185\u5BB9`),!1;if(!Hi.length)return pe.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(Hi.length<2)return pe.ZP.info("\u591A\u9009\u9898\u6700\u5C0F\u6B63\u786E\u9009\u9879\u4E3A2\u4E2A"),!1;const Fi=Yr.map((Xi,pr)=>({choice_text:Xi,is_answer:Hi.includes(pr)?1:0}));return{name:Ui,choices:Fi,analysis:Er}},zi=()=>{Ir(["","","",""]),kr(""),Tr(""),ir("")};return ft.createElement("section",{className:Ce.wrap},ft.createElement("p",{className:Ce.titleWrap},ft.createElement("span",{className:Ce.required},"*"),ft.createElement("span",{className:Ce.title},"\u9898\u5E72\uFF1A")),ft.createElement(Vn.Z,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:Ui,onChange:Nr=>kr(Nr)}),ft.createElement("p",{className:Ce.titleWrap},ft.createElement("span",{className:Ce.required},"*"),ft.createElement("span",{className:Ce.title},"\u7B54\u6848\u9009\u9879\uFF1A",ft.createElement("span",{className:Ce.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),Yr.map((Nr,Fi)=>ft.createElement("div",{className:Ce.choiceWrap,key:Fi},ft.createElement(we.Z,{title:"\u70B9\u51FB\u8BBE\u7F6E\u4E3A\u6807\u51C6\u7B54\u6848",placement:"left"},ft.createElement("div",{className:`${Ce.answer} ${Hi.includes(Fi)?Ce.activeAnswer:""}`,onClick:()=>{Hi.includes(Fi)?ir(Hi.filter(Xi=>Xi!==Fi)):ir([...Hi,Fi])}},Bn[Fi])),ft.createElement("div",{className:Ce.editorWrap},Vi===Fi?ft.createElement(Vn.Z,{id:`single-question-option-${Fi}`,watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9009\u9879",defaultValue:Nr,onChange:Xi=>{Yr[Fi]=Xi,Ir(Yr)}}):ft.createElement("div",{className:Ce.htmlWrap,onClick:()=>to(Fi)},ft.createElement(It.Z,{value:Nr}))),Fi>1&&ft.createElement(we.Z,{title:"\u5220\u9664"},ft.createElement("i",{className:`${Ce.deleteIcon} iconfont icon-htmal5icon19`,onClick:()=>{Ir(Yr.filter((Xi,pr)=>pr!==Fi)),Hi.includes(Fi)?ir(Hi.filter(Xi=>Xi!==Fi)):ir([...Hi,Fi])}})),Fi<7&&Fi===Yr.length-1&&ft.createElement(we.Z,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},ft.createElement("i",{className:`${Ce.addIcon} iconfont icon-roundaddfill ml6`,onClick:()=>Ir([...Yr,""])})))),ft.createElement("p",{className:Ce.titleWrap},ft.createElement("span",{className:Ce.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),ft.createElement(Vn.Z,{id:"single-question-answer",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:Er,onChange:Nr=>Tr(Nr)}))};var Ei=(0,qt.connect)(({loading:oe,globalSetting:Re})=>({globalSetting:Re,loading:oe.effects}),null,null,{forwardRef:!0})((0,ft.forwardRef)(si)),ci=Object.getOwnPropertySymbols,Zi=Object.prototype.hasOwnProperty,wt=Object.prototype.propertyIsEnumerable,Je=(oe,Re)=>{var _t={};for(var ce in oe)Zi.call(oe,ce)&&Re.indexOf(ce)<0&&(_t[ce]=oe[ce]);if(oe!=null&&ci)for(var ce of ci(oe))Re.indexOf(ce)<0&&wt.call(oe,ce)&&(_t[ce]=oe[ce]);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"],Ln=(oe,Re)=>{var _t=oe,{editData:ce,globalSetting:Rr,loading:vr,dispatch:Fr,onRef:sr=()=>{},isEdit:Pr}=_t,fo=Je(_t,["editData","globalSetting","loading","dispatch","onRef","isEdit"]);const[Yr,Ir]=(0,ft.useState)([]),[Vi,to]=(0,ft.useState)(),[Hi,ir]=(0,ft.useState)(),[Ui,kr]=(0,ft.useState)(""),[Er,Tr]=(0,ft.useState)("");(0,ft.useEffect)(()=>{Ir(["","","",""])},[]),(0,ft.useEffect)(()=>{if(!ce||!Pr)return;const Nr=[],Fi=[];ce==null||ce.choices.forEach((Xi,pr)=>{Nr.push(Xi.choice_text),Xi.is_answer&&Fi.push(pr)}),kr(ce==null?void 0:ce.name),Tr(ce==null?void 0:ce.analysis),Ir(Nr),ir(Fi)},[ce]),(0,ft.useImperativeHandle)(Re,()=>({onSave:eo,Clear:zi}));const eo=()=>{if(!Ui)return pe.ZP.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),!1;const Nr=Yr.findIndex(Xi=>!Xi);if(Nr>-1)return pe.ZP.info(`\u8BF7\u5148\u8F93\u5165 ${Hn[Nr]} \u9009\u9879\u7684\u5185\u5BB9`),!1;if(!Array.isArray(Hi))return pe.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 Fi=Yr.map((Xi,pr)=>({choice_text:Xi,is_answer:Hi.includes(pr)?1:0}));return{name:Ui,choices:Fi,analysis:Er}},zi=()=>{Ir(["","","",""]),kr(""),Tr(""),ir("")};return ft.createElement("section",{className:Ce.wrap},ft.createElement("p",{className:Ce.titleWrap},ft.createElement("span",{className:Ce.required},"*"),ft.createElement("span",{className:Ce.title},"\u9898\u5E72\uFF1A")),ft.createElement(Vn.Z,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:Ui,onChange:Nr=>kr(Nr)}),ft.createElement("p",{className:Ce.titleWrap},ft.createElement("span",{className:Ce.required},"*"),ft.createElement("span",{className:Ce.title},"\u7B54\u6848\u9009\u9879\uFF1A",ft.createElement("span",{className:Ce.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),Yr.map((Nr,Fi)=>ft.createElement("div",{className:Ce.choiceWrap,key:Fi},ft.createElement(we.Z,{title:"\u70B9\u51FB\u8BBE\u7F6E\u4E3A\u6807\u51C6\u7B54\u6848",placement:"left"},ft.createElement("div",{className:`${Ce.answer} ${Hi!=null&&Hi.includes(Fi)?Ce.activeAnswer:""}`,onClick:()=>ir([Fi])},Hn[Fi])),ft.createElement("div",{className:Ce.editorWrap},Vi===Fi?ft.createElement(Vn.Z,{id:`single-question-option-${Fi}`,watch:!0,height:155,isFocus:!0,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9009\u9879",defaultValue:Nr,onChange:Xi=>{Yr[Fi]=Xi,Ir(Yr)}}):ft.createElement("div",{className:Ce.htmlWrap,onClick:()=>to(Fi)},ft.createElement(It.Z,{value:Nr}))),Fi>1&&ft.createElement(we.Z,{title:"\u5220\u9664"},ft.createElement("i",{className:`${Ce.deleteIcon} iconfont icon-htmal5icon19`,onClick:()=>{Ir(Yr.filter((Xi,pr)=>pr!==Fi)),Fi===Hi&&ir(null)}})),Fi<7&&Fi===Yr.length-1&&ft.createElement(we.Z,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},ft.createElement("i",{className:`${Ce.addIcon} iconfont icon-roundaddfill ml6`,onClick:()=>Ir([...Yr,""])})))),ft.createElement("p",{className:Ce.titleWrap},ft.createElement("span",{className:Ce.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),ft.createElement(Vn.Z,{id:"single-question-answer",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:Er,onChange:Nr=>Tr(Nr)}))};var jn=(0,qt.connect)(({loading:oe,globalSetting:Re})=>({globalSetting:Re,loading:oe.effects}),null,null,{forwardRef:!0})((0,ft.forwardRef)(Ln)),li=kt(96599),Ci=kt(71411),Yi=kt(61485),Be=kt(59301),Se=Object.defineProperty,Ee=Object.defineProperties,Ue=Object.getOwnPropertyDescriptors,xi=Object.getOwnPropertySymbols,Kn=Object.prototype.hasOwnProperty,Pi=Object.prototype.propertyIsEnumerable,$e=(oe,Re,_t)=>Re in oe?Se(oe,Re,{enumerable:!0,configurable:!0,writable:!0,value:_t}):oe[Re]=_t,Gn=(oe,Re)=>{for(var _t in Re||(Re={}))Kn.call(Re,_t)&&$e(oe,_t,Re[_t]);if(xi)for(var _t of xi(Re))Pi.call(Re,_t)&&$e(oe,_t,Re[_t]);return oe},Ai=(oe,Re)=>Ee(oe,Ue(Re)),ji=(oe,Re)=>{var _t={};for(var ce in oe)Kn.call(oe,ce)&&Re.indexOf(ce)<0&&(_t[ce]=oe[ce]);if(oe!=null&&xi)for(var ce of xi(oe))Re.indexOf(ce)<0&&Pi.call(oe,ce)&&(_t[ce]=oe[ce]);return _t},Tn=(oe,Re,_t)=>new Promise((ce,Rr)=>{var vr=Pr=>{try{sr(_t.next(Pr))}catch(fo){Rr(fo)}},Fr=Pr=>{try{sr(_t.throw(Pr))}catch(fo){Rr(fo)}},sr=Pr=>Pr.done?ce(Pr.value):Promise.resolve(Pr.value).then(vr,Fr);sr((_t=_t.apply(oe,Re)).next())});const Qt=oe=>{if(!oe)return!1;if(/^s*$/.test(oe)||oe.trim()===""){pe.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 oe==="|"?(pe.ZP.warning("\u5173\u952E\u8BCD\u4E0D\u80FD\u53EA\u8F93\u5165\u4E00\u4E2A\u201C|\u201D\u5B57\u7B26\uFF01"),!1):!0},me=({value:oe=[],onClose:Re})=>Be.createElement(li.default,{closable:!0,onClose:Re,className:Ce.keywordTag},Be.createElement("pre",{style:{margin:"0px",whiteSpace:"pre-wrap"}},oe.join(" \u6216 "))),bn=(oe,Re)=>{var _t=oe,{editData:ce,globalSetting:Rr,loading:vr,dispatch:Fr,onRef:sr=()=>{},isEdit:Pr}=_t,fo=ji(_t,["editData","globalSetting","loading","dispatch","onRef","isEdit"]);const[Yr,Ir]=(0,ft.useState)(""),[Vi,to]=(0,ft.useState)(""),[Hi,ir]=(0,ft.useState)(""),[Ui,kr]=(0,ft.useState)(""),[Er]=le.default.useForm(),Tr=le.default.useWatch("use_keywords",Er);(0,ft.useEffect)(()=>{var Fi;!ce||!Pr||(Ir(ce==null?void 0:ce.name),to(ce==null?void 0:ce.analysis),ir((Fi=ce==null?void 0:ce.answer_texts)==null?void 0:Fi[0]),Er.setFieldsValue(Gn({},ce)))},[ce]),(0,ft.useImperativeHandle)(Re,()=>({onSave:eo,Clear:zi}));const eo=()=>Tn(void 0,null,function*(){if(!Yr)return pe.ZP.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),!1;try{yield Er.validateFields()}catch(Xi){pe.ZP.error(Xi.errorFields[0].errors[0]);return}const Fi=Er.getFieldsValue();return console.log(Fi,"values"),Gn({name:Yr,answer_texts:[Hi],analysis:Vi},Fi)}),zi=()=>{Ir(""),to(""),ir(""),Er.resetFields()},Nr=ce==null?void 0:ce.score;return Be.createElement("section",{className:Ce.wrap},Be.createElement("p",{className:Ce.titleWrap},Be.createElement("span",{className:Ce.required},"*"),Be.createElement("span",{className:Ce.title},"\u9898\u5E72\uFF1A")),Be.createElement(Vn.Z,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:Yr,onChange:Fi=>Ir(Fi)}),Be.createElement("p",{className:Ce.titleWrap},Be.createElement("span",{className:Ce.title},"\u53C2\u8003\u7B54\u6848\uFF1A")),Be.createElement(Vn.Z,{id:"single-question-reference-answer",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u53C2\u8003\u7B54\u6848",defaultValue:Hi,onChange:Fi=>ir(Fi)}),Be.createElement("p",{className:Ce.titleWrap},Be.createElement("span",{className:Ce.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),Be.createElement(Vn.Z,{id:"single-question-answer",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:Vi,onChange:Fi=>to(Fi)}),Be.createElement(le.default,{form:Er,size:"large",onFinishFailed:Fi=>Tn(void 0,null,function*(){var Xi,pr;pe.ZP.error(Fi.errorFields[0].errors[0]),Er.scrollToField((pr=(Xi=Fi==null?void 0:Fi.errorFields)==null?void 0:Xi[0])==null?void 0:pr.name,{behavior:"smooth",block:"center"})})},Be.createElement(Le.Z,{align:"middle",className:"mb30 mt20"},Be.createElement(le.default.Item,{noStyle:!0,name:"use_keywords",valuePropName:"checked"},Be.createElement(Ci.Z,null)),Be.createElement(Bt.Z,{className:"ml10"},"\u5F00\u542F\u5173\u952E\u8BCD\u81EA\u52A8\u5224\u5206"),Be.createElement(Bt.Z,null,Be.createElement(we.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"},Be.createElement(Yi.Z,{style:{color:"#3061D0",marginLeft:6,cursor:"pointer"}})))),Tr&&Be.createElement(le.default.List,{name:"keywords",rules:[{validator(Fi,Xi){return Xi!=null&&Xi.length?(Xi==null?void 0:Xi.reduce((ao,mo)=>ao+mo.score,0))>parseFloat(Nr)?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"))}}]},(Fi,{add:Xi,remove:pr})=>Be.createElement(Be.Fragment,null,Be.createElement("div",{className:"mb10"},"\u5173\u952E\u8BCD"),Be.createElement(Le.Z,{align:"middle",className:"font14 mb30"},Be.createElement(Bt.Z,{flex:1},Be.createElement(Jt.default,{value:Ui,onChange:ao=>{kr(ao.target.value)},maxLength:50,allowClear:!0,onPressEnter:ao=>{var mo,Ro,Ji,_a;const wr=`${(mo=ao.target)==null?void 0:mo.value}`,uo=(Ji=(Ro=wr==null?void 0:wr.split("|"))==null?void 0:Ro.filter(Zo=>!!Zo))==null?void 0:Ji.map(Zo=>Zo==null?void 0:Zo.trim()),Br=Er.getFieldValue("keywords"),ea=((_a=Br==null?void 0:Br.map(Zo=>Zo==null?void 0:Zo.keyword))==null?void 0:_a.flat())||[];for(const Zo of uo)if(ea.includes(Zo)){pe.ZP.error("\u4E3A\u907F\u514D\u5224\u5206\u9519\u8BEF\uFF0C\u8BF7\u52FF\u8BBE\u7F6E\u76F8\u540C\u7684\u5173\u952E\u8BCD");return}Qt(wr)&&(Xi({keyword:uo,score:1}),kr(""))},className:Ce.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"})),Be.createElement(Bt.Z,{flex:"148px",style:{textAlign:"right",color:"#e99237"}},"\u201C\u56DE\u8F66\u952E\u201D\u4FDD\u5B58\u5173\u952E\u8BCD")),Fi.map(ao=>{var mo=ao,{key:Ro,name:Ji}=mo,_a=ji(mo,["key","name"]);return Be.createElement(Le.Z,{key:Ro,style:{marginRight:148}},Be.createElement(Bt.Z,{flex:1},Be.createElement(Le.Z,{align:"middle",justify:"space-between"},Be.createElement(le.default.Item,Ai(Gn({},_a),{name:[Ji,"keyword"]}),Be.createElement(me,{onClose:()=>pr(Ji)})),Be.createElement(le.default.Item,Ai(Gn({},_a),{name:[Ji,"score"],label:"\u5206\u503C",rules:[{required:!0}]}),Be.createElement(ee.Z,{min:.1,max:100,precision:1,style:{width:"100%"},placeholder:"\u8BF7\u8F93\u5165\u5173\u952E\u8BCD\u5206\u6570"})))))})))))};var _n=(0,qt.connect)(({loading:oe,globalSetting:Re})=>({globalSetting:Re,loading:oe.effects}),null,null,{forwardRef:!0})((0,ft.forwardRef)(bn)),ze=kt(8848),hn={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"},Nn=kt(32134),In=kt(12893),vi=Object.defineProperty,Jn=Object.defineProperties,ii=Object.getOwnPropertyDescriptors,hi=Object.getOwnPropertySymbols,Ii=Object.prototype.hasOwnProperty,Di=Object.prototype.propertyIsEnumerable,mn=(oe,Re,_t)=>Re in oe?vi(oe,Re,{enumerable:!0,configurable:!0,writable:!0,value:_t}):oe[Re]=_t,oi=(oe,Re)=>{for(var _t in Re||(Re={}))Ii.call(Re,_t)&&mn(oe,_t,Re[_t]);if(hi)for(var _t of hi(Re))Di.call(Re,_t)&&mn(oe,_t,Re[_t]);return oe},fr=(oe,Re)=>Jn(oe,ii(Re)),Mr=(oe,Re)=>{var _t={};for(var ce in oe)Ii.call(oe,ce)&&Re.indexOf(ce)<0&&(_t[ce]=oe[ce]);if(oe!=null&&hi)for(var ce of hi(oe))Re.indexOf(ce)<0&&Di.call(oe,ce)&&(_t[ce]=oe[ce]);return _t};const Xr=oe=>{var Re=oe,{value:_t,onChange:ce,scrollId:Rr}=Re,vr=Mr(Re,["value","onChange","scrollId"]);return ft.createElement("div",{id:Rr||""},ft.createElement(Vn.Z,fr(oi({},vr),{defaultValue:_t,onChange:(Fr,sr)=>{sr!=null&&sr.length?ce(Fr,sr):ce(Fr)}})))},Ae=({value:oe,onChange:Re,placeholder:_t,height:ce=140,isEdit:Rr})=>Rr?ft.createElement(Vn.Z,{watch:!0,isFocus:!0,height:ce,placeholder:_t,defaultValue:oe,onChange:Re}):ft.createElement("div",{style:{cursor:"pointer"}},oe?ft.createElement(It.Z,{className:hn.inputBorder,value:oe}):ft.createElement("div",{className:`${hn.inputBorder} ${hn.placeholder}`},_t));var ri=kt(59301),Ri=Object.defineProperty,fi=Object.defineProperties,br=Object.getOwnPropertyDescriptors,ur=Object.getOwnPropertySymbols,Lr=Object.prototype.hasOwnProperty,Dr=Object.prototype.propertyIsEnumerable,Zr=(oe,Re,_t)=>Re in oe?Ri(oe,Re,{enumerable:!0,configurable:!0,writable:!0,value:_t}):oe[Re]=_t,Jr=(oe,Re)=>{for(var _t in Re||(Re={}))Lr.call(Re,_t)&&Zr(oe,_t,Re[_t]);if(ur)for(var _t of ur(Re))Dr.call(Re,_t)&&Zr(oe,_t,Re[_t]);return oe},un=(oe,Re)=>fi(oe,br(Re)),yo=(oe,Re)=>{var _t={};for(var ce in oe)Lr.call(oe,ce)&&Re.indexOf(ce)<0&&(_t[ce]=oe[ce]);if(oe!=null&&ur)for(var ce of ur(oe))Re.indexOf(ce)<0&&Dr.call(oe,ce)&&(_t[ce]=oe[ce]);return _t};const vn=["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"],Gi=({value:oe,onChange:Re,choiceTextKey:_t,answerKey:ce,index:Rr,isEdit:vr,setInputActive:Fr,form:sr,choiceOptionsPath:Pr,allowChangeMode:fo,showAddIcon:Yr,addItem:Ir,deleteItem:Vi})=>{const to=(oe==null?void 0:oe[ce])===!0,Hi=()=>{const Ui=sr.getFieldValue(Pr);sr.setFieldValue(Pr,Ui.map(kr=>un(Jr({},kr),{[ce]:!1})))},ir=()=>{to?Re(un(Jr({},oe),{[ce]:!1})):(fo||Hi(),Re(un(Jr({},oe),{[ce]:!0})))};return ri.createElement(Le.Z,{className:hn.choiceWrap,align:"middle",wrap:!1},ri.createElement(Bt.Z,{onClick:ir,className:`${hn.choiceIndex} ${to?hn.activeAnswer:""}`},vn[Rr]),ri.createElement(Bt.Z,{flex:1,className:`${hn.editorWrap} ml15`,onClick:Fr},ri.createElement(Ae,{height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9009\u9879",isEdit:vr,value:oe==null?void 0:oe[_t],onChange:Ui=>{Re(un(Jr({},oe),{[_t]:Ui}))}})),ri.createElement(Bt.Z,{flex:"0 0 auto",className:"ml15"},ri.createElement("div",{onClick:ir,className:`${hn.setAnswerBtn} ${to?hn.activeAnswer:""}`},to?"\u6B63\u786E\u7B54\u6848":"\u8BBE\u4E3A\u7B54\u6848")),ri.createElement(Bt.Z,{className:hn.actionWrapper},ri.createElement(we.Z,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},ri.createElement(Nn.Z,{className:hn.addIcon,onClick:Ir,style:{visibility:Yr?"visible":"hidden"}})),ri.createElement(we.Z,{title:"\u5220\u9664"},ri.createElement(In.Z,{className:hn.deleteIcon,onClick:Vi,style:{visibility:Rr>1?"visible":"hidden"}}))))},Wr=({questionTitlePlaceholder:oe,titleKey:Re,choiceKey:_t,analysisKey:ce,choiceTextKey:Rr,answerKey:vr,choiceOptionsPath:Fr,allowChangeMode:sr=!0,form:Pr,showAnalysis:fo=!0})=>{const[Yr,Ir]=(0,ft.useState)(),[Vi,to]=(0,ft.useState)(!1);return ri.createElement("div",{className:hn.wrap},ri.createElement("div",{className:hn.questionTitleEditorWrap},ri.createElement(le.default.Item,{label:"\u9898\u5E72",name:Re,labelCol:{span:24},rules:[{required:!0}]},ri.createElement(Xr,{scrollId:Array.isArray(Re)?Re.join("_"):`${Re}`,watch:!0,height:140,placeholder:oe}))),ri.createElement(le.default.Item,{label:"\u7B54\u6848\u9009\u9879",required:!0,labelCol:{span:24}}),ri.createElement(le.default.List,{name:_t,rules:[{validator(Hi,ir){const Ui=ir.some(Er=>Er[vr]),kr=ir.findIndex(Er=>{var Tr;return((Tr=Er[Rr])==null?void 0:Tr.length)<=0});return kr!==-1?Promise.reject(new Error(`\u8BF7\u5148\u8F93\u5165${vn[kr]}\u9009\u9879\u7684\u5185\u5BB9`)):Ui?Promise.resolve():Promise.reject(new Error("\u8BF7\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))}}]},(Hi,{add:ir,remove:Ui})=>ri.createElement("div",{id:Array.isArray(Fr)?Fr.join("_"):`${Fr}`},Hi.map((kr,Er)=>{var Tr=kr,{key:eo,name:zi}=Tr,Nr=yo(Tr,["key","name"]);const Fi=Yr===eo,Xi=()=>{Ir(eo)},pr=Er<7&&Er===Hi.length-1,ao=()=>ir({[Rr]:"",[vr]:0}),mo=()=>Ui(zi);return ri.createElement(le.default.Item,un(Jr({},Nr),{key:eo,name:zi,noStyle:!0}),ri.createElement(Gi,{choiceTextKey:Rr,answerKey:vr,index:Er,isEdit:Fi,setInputActive:Xi,form:Pr,choiceOptionsPath:Fr,allowChangeMode:sr,showAddIcon:pr,addItem:ao,deleteItem:mo}))}),Hi.length<8&&ri.createElement("div",{className:`${hn.addBtn} mb30`,onClick:()=>ir({[Rr]:"",[vr]:0})},"\u6DFB\u52A0\u9009\u9879"))),fo&&ri.createElement("div",{onClick:()=>to(!0)},ri.createElement(le.default.Item,{name:ce,label:"\u9898\u76EE\u89E3\u6790",labelCol:{span:24}},ri.createElement(Ae,{placeholder:"\u8BF7\u7F16\u8F91\u9898\u76EE\u89E3\u6790\uFF08\u975E\u5FC5\u586B\uFF09",isEdit:Vi}))))};var Oi=kt(59301),ko=Object.defineProperty,Ur=Object.defineProperties,Cr=Object.getOwnPropertyDescriptors,Lo=Object.getOwnPropertySymbols,je=Object.prototype.hasOwnProperty,xn=Object.prototype.propertyIsEnumerable,be=(oe,Re,_t)=>Re in oe?ko(oe,Re,{enumerable:!0,configurable:!0,writable:!0,value:_t}):oe[Re]=_t,Tt=(oe,Re)=>{for(var _t in Re||(Re={}))je.call(Re,_t)&&be(oe,_t,Re[_t]);if(Lo)for(var _t of Lo(Re))xn.call(Re,_t)&&be(oe,_t,Re[_t]);return oe},Dn=(oe,Re)=>Ur(oe,Cr(Re)),ei=(oe,Re)=>{var _t={};for(var ce in oe)je.call(oe,ce)&&Re.indexOf(ce)<0&&(_t[ce]=oe[ce]);if(oe!=null&&Lo)for(var ce of Lo(oe))Re.indexOf(ce)<0&&xn.call(oe,ce)&&(_t[ce]=oe[ce]);return _t};const Ni=({value:oe,onChange:Re})=>{const _t=Rr=>{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:hn.modal,onOk:()=>{const vr=[...oe];vr.splice(Rr,1),Re(vr)}})},ce=()=>{const Rr=[...oe];Rr.push(""),Re(Rr)};return Oi.createElement(Le.Z,{align:"middle",className:"ml20",gutter:[40,20]},oe==null?void 0:oe.map((Rr,vr)=>Oi.createElement(Bt.Z,{key:`${Rr}_${vr}`,className:hn.blankWrapper},Oi.createElement(Jt.default,{className:hn.blankInput,defaultValue:Rr,maxLength:1e3,onBlur:Fr=>{const sr=[...oe],Pr=Fr.target.value.trim();sr[vr]=Pr,Re(sr)}}),Oi.createElement(we.Z,{title:"\u5220\u9664"},Oi.createElement(In.Z,{className:hn.deleteIcon,style:{marginLeft:15,visibility:vr>0?"visible":"hidden"},onClick:()=>_t(vr)})))),Oi.createElement(Bt.Z,null,Oi.createElement("div",{className:`${hn.addBtn}`,onClick:()=>{ce()}},"\u65B0\u589E\u7B54\u6848")))},Li=({value:oe=!0,onChange:Re})=>Oi.createElement(Ci.Z,{checked:!oe,onChange:_t=>{Re(!_t)}}),di="\u2581",yn=({questionTitlePlaceholder:oe,form:Re,name:_t,scoreByBlank:ce="use_blank_score",answerKey:Rr,titleKey:vr="name",analysisKey:Fr="analysis",isOrdered:sr="is_ordered"})=>{var Pr,fo;const[Yr,Ir]=(0,ft.useState)(!1),Vi=(eo,zi)=>{const Nr=zi.line;let Fi=0;for(let pr=0;pr<Nr;pr++)Fi+=eo.getLine(pr).split(di).length-1;const Xi=eo.getLine(Nr).substring(0,zi.ch);return Fi+=Xi.split(di).length-1,Fi},to=(eo,zi,Nr,Fi)=>{const Xi=eo.getRange(zi.from,zi.to);let pr=0;if(zi.text.forEach(ao=>{pr+=ao.split(di).length-1}),zi.origin!=="setValue"){if(Xi&&Xi.indexOf(di)!==-1){const ao=Xi.split(di).length-1,mo=Vi(eo,zi.from);if(console.log(`\u5220\u9664${ao}\u4E2A\uFF0C \u524D\u9762\u6709${mo}\u4E2A\uFF0C\u65B0\u589E${pr}\u4E2A`),ao>1){const Ro=Array.from({length:ao},(Ji,_a)=>mo+_a);Fi(Ro)}else Fi(mo)}else if(pr>0){const ao=Vi(eo,zi.from);console.log(`\u65B0\u589E${pr}\u4E2A\uFF0C\u4E4B\u524D\u6709${ao}\u4E2A`),Nr(pr,ao)}}},Hi=()=>{const eo=Re.getFieldValue(["sub_item_banks",...Rr]);Re.setFieldValue(["sub_item_banks",...Rr],eo==null?void 0:eo.map((zi,Nr)=>Dn(Tt({},zi),{position:Nr+1})))},ir=(0,ft.useRef)(),Ui=(eo,zi)=>{for(let Nr=0;Nr<eo;Nr++)ir.current({position:null,answer_text:[""]},zi+Nr);Hi()},kr=(0,ft.useRef)(),Er=eo=>{kr.current(eo),Hi()},Tr=(fo=(Pr=Re.getFieldValue("sub_item_banks"))==null?void 0:Pr[Rr==null?void 0:Rr[0]])==null?void 0:fo[Rr==null?void 0:Rr[1]];return Oi.createElement("div",{className:hn.wrap},Oi.createElement("div",{className:hn.questionTitleEditorWrap},Oi.createElement(le.default.Item,{label:"\u9898\u5E72",name:vr,labelCol:{span:24},rules:[{required:!0}]},Oi.createElement(Xr,{scrollId:"name",watch:!0,height:140,placeholder:oe,showNullButton:!0,onCMBeforeChange:(eo,zi)=>{to(eo,zi,Ui,Er)}}))),Oi.createElement(le.default.List,{name:Rr,rules:[{validator(eo,zi){if((zi==null?void 0:zi.length)===0)return Promise.reject(new Error("\u7B54\u6848\u4E0D\u80FD\u4E3A\u7A7A"));for(const Nr of zi){const{answer_text:Fi}=Nr||{};if(Fi!=null&&Fi.some(Xi=>(Xi==null?void 0:Xi.length)===0))return Promise.reject(new Error("\u586B\u7A7A\u9879\u7B54\u6848\u4E0D\u80FD\u4E3A\u7A7A"))}return Promise.resolve()}}]},(eo,{add:zi,remove:Nr},{errors:Fi})=>(ir.current=zi,kr.current=Nr,Oi.createElement(Oi.Fragment,null,Oi.createElement(le.default.Item,{label:"\u7B54\u6848\u9009\u9879",required:!0,labelCol:{span:24}}),eo.map((Xi,pr)=>{var ao=Xi,{key:mo,name:Ro}=ao,Ji=ei(ao,["key","name"]);return Oi.createElement(Le.Z,{className:"mb20",key:mo,align:"middle",wrap:!1},Oi.createElement(Bt.Z,{flex:"0 0 auto",className:`${hn.blankIndex}`},"\u586B\u7A7A\u9879",pr+1),Oi.createElement(Bt.Z,{flex:1},Oi.createElement(Le.Z,{align:"top",justify:"space-between",wrap:!1},Oi.createElement(Bt.Z,null,Oi.createElement(le.default.Item,Dn(Tt({},Ji),{name:[Ro,"answer_text"],noStyle:!0}),Oi.createElement(Ni,null))),(Re==null?void 0:Re.getFieldValue(["sub_item_banks",...ce]))&&Oi.createElement(Bt.Z,{flex:"224px"},Oi.createElement(le.default.Item,Dn(Tt({},Ji),{name:[Ro,"score"],label:"\u5206\u503C",rules:[{required:!0}],className:hn.blankInputNumberWrapper}),Oi.createElement(ee.Z,{className:hn.blankInput,min:.1,max:100,style:{width:"100%"},placeholder:"\u6309\u7A7A\u7ED9\u5206\u8BF7\u8F93\u5165\u5206\u503C"})))),Oi.createElement(le.default.Item,Dn(Tt({},Ji),{name:[Ro,"position"],noStyle:!0}),Oi.createElement(Jt.default,{type:"hidden"}))))})))),Oi.createElement(Le.Z,{align:"middle"},Oi.createElement(le.default.Item,{name:[_t,"downcase"],valuePropName:"checked"},Oi.createElement(Ci.Z,null)),Oi.createElement(Bt.Z,{className:"ml10"},"\u5224\u5206\u65F6\u5FFD\u7565\u7B54\u6848\u4E2D\u7684\u5B57\u6BCD\u5927\u5C0F\u5199")),Oi.createElement(Le.Z,{align:"middle"},Oi.createElement(le.default.Item,{name:[_t,"no_space"],valuePropName:"checked"},Oi.createElement(Ci.Z,null)),Oi.createElement(Bt.Z,{className:"ml10"},"\u5224\u5206\u65F6\u5FFD\u7565\u7B54\u6848\u4E2D\u7684\u7A7A\u683C")),(Tr==null?void 0:Tr.length)>1&&Oi.createElement(Le.Z,{align:"middle",className:(Tr==null?void 0:Tr.length)>1?"mb30":`${hn.hide}`},Oi.createElement(le.default.Item,{name:sr},Oi.createElement(Li,null)),Oi.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")),Oi.createElement("div",{onClick:()=>Ir(!0)},Oi.createElement(le.default.Item,{name:Fr,label:"\u9898\u76EE\u89E3\u6790",labelCol:{span:24}},Oi.createElement(Ae,{placeholder:"\u8BF7\u7F16\u8F91\u9898\u76EE\u89E3\u6790\uFF08\u975E\u5FC5\u586B\uFF09",isEdit:Yr}))))};var Un=Object.defineProperty,$n=Object.defineProperties,An=Object.getOwnPropertyDescriptors,Xn=Object.getOwnPropertySymbols,Zn=Object.prototype.hasOwnProperty,ai=Object.prototype.propertyIsEnumerable,pi=(oe,Re,_t)=>Re in oe?Un(oe,Re,{enumerable:!0,configurable:!0,writable:!0,value:_t}):oe[Re]=_t,en=(oe,Re)=>{for(var _t in Re||(Re={}))Zn.call(Re,_t)&&pi(oe,_t,Re[_t]);if(Xn)for(var _t of Xn(Re))ai.call(Re,_t)&&pi(oe,_t,Re[_t]);return oe},Qi=(oe,Re)=>$n(oe,An(Re)),tr=(oe,Re)=>{var _t={};for(var ce in oe)Zn.call(oe,ce)&&Re.indexOf(ce)<0&&(_t[ce]=oe[ce]);if(oe!=null&&Xn)for(var ce of Xn(oe))Re.indexOf(ce)<0&&ai.call(oe,ce)&&(_t[ce]=oe[ce]);return _t};const Vr={\u6B63\u786E:"T",\u9519\u8BEF:"F"},or=({value:oe,onChange:Re,form:_t,choiceKey:ce})=>{const Rr=(oe==null?void 0:oe.is_answer)===!0,vr=oe==null?void 0:oe.choice_text,Fr=()=>{var sr;const Pr=(sr=_t==null?void 0:_t.getFieldValue(["sub_item_banks",...ce]))==null?void 0:sr.map(fo=>({choice_text:fo==null?void 0:fo.choice_text,is_answer:!1}));_t==null||_t.setFieldValue(["sub_item_banks",...ce],Pr),Re(Qi(en({},oe),{is_answer:!0}))};return ft.createElement(Le.Z,{className:hn.choiceWrap,align:"middle",wrap:!1},ft.createElement(Bt.Z,{onClick:Fr,className:`${hn.choiceIndex} ${hn.judgementIndex} ${Rr?hn.activeAnswer:""}`},Vr[vr]),ft.createElement(Bt.Z,{flex:1,className:`${hn.editorWrap} ml15`},ft.createElement("div",{className:`${hn.inputBorder} ${hn.placeholder} ${Rr?hn.activeJudgementAnswer:""}`},vr)),ft.createElement(Bt.Z,{flex:"0 0 auto",className:"ml15"},ft.createElement("div",{onClick:Fr,className:`${hn.setAnswerBtn} ${Rr?hn.activeAnswer:""}`},Rr?"\u6B63\u786E\u7B54\u6848":"\u8BBE\u4E3A\u7B54\u6848")))},so=({questionTitlePlaceholder:oe,choiceKey:Re="choices",form:_t,titleKey:ce="name",analysisKey:Rr="analysis"})=>{const[vr,Fr]=(0,ft.useState)(!1);return ft.createElement("div",{className:hn.wrap},ft.createElement("div",{className:hn.questionTitleEditorWrap},ft.createElement(le.default.Item,{label:"\u9898\u5E72",name:ce,labelCol:{span:24},rules:[{required:!0}]},ft.createElement(Xr,{scrollId:"name",watch:!0,height:140,placeholder:oe}))),ft.createElement(le.default.Item,{label:"\u7B54\u6848\u9009\u9879",required:!0,labelCol:{span:24}},ft.createElement(le.default.List,{name:Re,rules:[{validator(sr,Pr){return Pr.some(Yr=>(Yr==null?void 0:Yr.is_answer)===!0)?Promise.resolve():Promise.reject(new Error("\u8BF7\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))}}]},sr=>ft.createElement("div",{id:"choices"},sr.map(Pr=>{var fo=Pr,{key:Yr,name:Ir}=fo,Vi=tr(fo,["key","name"]);return ft.createElement(le.default.Item,Qi(en({},Vi),{key:Yr,name:Ir,noStyle:!0}),ft.createElement(or,{form:_t,choiceKey:Re}))})))),ft.createElement("div",{onClick:()=>Fr(!0)},ft.createElement(le.default.Item,{name:Rr,label:"\u9898\u76EE\u89E3\u6790",labelCol:{span:24}},ft.createElement(Ae,{placeholder:"\u8BF7\u7F16\u8F91\u9898\u76EE\u89E3\u6790\uFF08\u975E\u5FC5\u586B\uFF09",isEdit:vr}))))};var qr=Object.defineProperty,po=Object.defineProperties,ro=Object.getOwnPropertyDescriptors,Po=Object.getOwnPropertySymbols,Bo=Object.prototype.hasOwnProperty,Oe=Object.prototype.propertyIsEnumerable,lo=(oe,Re,_t)=>Re in oe?qr(oe,Re,{enumerable:!0,configurable:!0,writable:!0,value:_t}):oe[Re]=_t,Gr=(oe,Re)=>{for(var _t in Re||(Re={}))Bo.call(Re,_t)&&lo(oe,_t,Re[_t]);if(Po)for(var _t of Po(Re))Oe.call(Re,_t)&&lo(oe,_t,Re[_t]);return oe},Sr=(oe,Re)=>po(oe,ro(Re)),hr=(oe,Re)=>{var _t={};for(var ce in oe)Bo.call(oe,ce)&&Re.indexOf(ce)<0&&(_t[ce]=oe[ce]);if(oe!=null&&Po)for(var ce of Po(oe))Re.indexOf(ce)<0&&Oe.call(oe,ce)&&(_t[ce]=oe[ce]);return _t};const oo=oe=>{var Re=oe,{value:_t,onChange:ce}=Re,Rr=hr(Re,["value","onChange"]);const vr=Fr=>{ce([Fr])};return ft.createElement(Vn.Z,Sr(Gr({},Rr),{defaultValue:_t==null?void 0:_t[0],onChange:vr}))},Fo=oe=>{if(!oe)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 oe==="|"?(pe.ZP.warning("\u5173\u952E\u8BCD\u4E0D\u80FD\u53EA\u8F93\u5165\u4E00\u4E2A\u201C|\u201D\u5B57\u7B26\uFF01"),!1):!0},wo=({value:oe=[],onClose:Re})=>ft.createElement(li.default,{closable:!0,onClose:Re,className:hn.keywordTag},oe==null?void 0:oe.join(" \u6216 ")),zr=({questionTitlePlaceholder:oe,form:Re,showKeywords:_t,isMustKeyWords:ce=_t,titleKey:Rr="name",analysisKey:vr="analysis",answerTexts:Fr="answer_texts",keywords:sr="keywords",useKeywords:Pr="use_keywords",indexs:fo})=>{const[Yr,Ir]=(0,ft.useState)(!1),[Vi,to]=(0,ft.useState)(""),Hi=le.default.useWatch("sub_item_banks",Re),{use_keywords:ir,score:Ui}=(Hi==null?void 0:Hi[fo])||{};return console.log(ir,Ui,"itemValues"),ft.createElement("div",{className:hn.wrap},ft.createElement("div",{className:hn.questionTitleEditorWrap},ft.createElement(le.default.Item,{label:"\u9898\u5E72",name:Rr,labelCol:{span:24},rules:[{required:!0}]},ft.createElement(Xr,{scrollId:"name",watch:!0,height:140,placeholder:oe}))),ft.createElement(le.default.Item,{label:"\u53C2\u8003\u7B54\u6848",name:Fr,labelCol:{span:24}},ft.createElement(oo,{watch:!0,height:140,placeholder:"\u8BF7\u7F16\u8F91\u53C2\u8003\u7B54\u6848\uFF08\u975E\u5FC5\u586B\uFF09"})),_t&&!ce&&ft.createElement(le.default.Item,{hidden:!0,name:Pr,valuePropName:"checked"},ft.createElement(Ci.Z,{defaultChecked:!0})),_t&&ce&&ft.createElement(Le.Z,{align:"middle",className:"mb30"},ft.createElement(le.default.Item,{name:Pr,valuePropName:"checked"},ft.createElement(Ci.Z,null)),ft.createElement(Bt.Z,{className:"ml10"},"\u5F00\u542F\u5173\u952E\u8BCD\u81EA\u52A8\u5224\u5206"),ft.createElement(Bt.Z,null,ft.createElement(we.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"},ft.createElement(Yi.Z,{style:{color:"#3061D0",marginLeft:6,cursor:"pointer"}})))),(ir||!ce)&&ft.createElement(le.default.List,{name:sr,rules:[{validator(kr,Er){return ce?Er!=null&&Er.length?(Er==null?void 0:Er.reduce((eo,zi)=>eo+zi.score,0))>parseFloat(Ui)?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()}}]},(kr,{add:Er,remove:Tr})=>ft.createElement(ft.Fragment,null,ft.createElement("div",{className:`${hn.title} mb10`},ce?"\u5173\u952E\u8BCD":ft.createElement("span",{style:{color:"#9096A3"}},"\u5224\u5206\u5173\u952E\u8BCD")),ft.createElement(Le.Z,{align:"middle",className:"font14 mb30"},ft.createElement(Bt.Z,{flex:1},ft.createElement(Jt.default,{value:Vi,onChange:eo=>{to(eo.target.value)},maxLength:50,allowClear:!0,onPressEnter:eo=>{var zi,Nr,Fi,Xi;const pr=`${(zi=eo.target)==null?void 0:zi.value}`,ao=(Fi=(Nr=pr==null?void 0:pr.split("|"))==null?void 0:Nr.filter(Ji=>!!Ji))==null?void 0:Fi.map(Ji=>Ji==null?void 0:Ji.trim()),mo=Re.getFieldValue(["sub_item_banks",...sr]),Ro=((Xi=mo==null?void 0:mo.map(Ji=>Ji==null?void 0:Ji.keyword))==null?void 0:Xi.flat())||[];for(const Ji of ao)if(Ro.includes(Ji)){pe.ZP.error("\u4E3A\u907F\u514D\u5224\u5206\u9519\u8BEF\uFF0C\u8BF7\u52FF\u8BBE\u7F6E\u76F8\u540C\u7684\u5173\u952E\u8BCD");return}Fo(pr)&&(Er({keyword:ao,score:1}),to(""))},className:hn.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"})),ft.createElement(Bt.Z,{flex:"148px",style:{textAlign:"right",color:"#e99237"}},"\u201C\u56DE\u8F66\u952E\u201D\u4FDD\u5B58\u5173\u952E\u8BCD")),kr.map(eo=>{var zi=eo,{key:Nr,name:Fi}=zi,Xi=hr(zi,["key","name"]);return ft.createElement(Le.Z,{key:Nr,className:"mb20",style:{marginRight:148}},ft.createElement(Bt.Z,{flex:1},ft.createElement(Le.Z,{align:"middle",justify:"space-between"},ft.createElement(le.default.Item,Sr(Gr({},Xi),{name:[Fi,"keyword"]}),ft.createElement(wo,{onClose:()=>Tr(Fi)})),ce&&ft.createElement(le.default.Item,Sr(Gr({},Xi),{name:[Fi,"score"],label:"\u5206\u503C",rules:[{required:!0}],className:hn.blankInputNumberWrapper}),ft.createElement(ee.Z,{className:hn.blankInput,min:.1,max:100,precision:1,style:{width:"100%"},placeholder:"\u8BF7\u8F93\u5165\u5173\u952E\u8BCD\u5206\u6570"})))))}))),ft.createElement("div",{onClick:()=>Ir(!0)},ft.createElement(le.default.Item,{name:vr,label:"\u9898\u76EE\u89E3\u6790",labelCol:{span:24}},ft.createElement(Ae,{placeholder:"\u8BF7\u7F16\u8F91\u9898\u76EE\u89E3\u6790\uFF08\u975E\u5FC5\u586B\uFF09",isEdit:Yr}))))};var Or=kt(59301),ha=Object.defineProperty,Ia=Object.defineProperties,bs=Object.getOwnPropertyDescriptors,Ba=Object.getOwnPropertySymbols,dr=Object.prototype.hasOwnProperty,$o=Object.prototype.propertyIsEnumerable,qo=(oe,Re,_t)=>Re in oe?ha(oe,Re,{enumerable:!0,configurable:!0,writable:!0,value:_t}):oe[Re]=_t,ca=(oe,Re)=>{for(var _t in Re||(Re={}))dr.call(Re,_t)&&qo(oe,_t,Re[_t]);if(Ba)for(var _t of Ba(Re))$o.call(Re,_t)&&qo(oe,_t,Re[_t]);return oe},ia=(oe,Re)=>Ia(oe,bs(Re)),fa=(oe,Re)=>{var _t={};for(var ce in oe)dr.call(oe,ce)&&Re.indexOf(ce)<0&&(_t[ce]=oe[ce]);if(oe!=null&&Ba)for(var ce of Ba(oe))Re.indexOf(ce)<0&&$o.call(oe,ce)&&(_t[ce]=oe[ce]);return _t},yi=(oe,Re,_t)=>new Promise((ce,Rr)=>{var vr=Pr=>{try{sr(_t.next(Pr))}catch(fo){Rr(fo)}},Fr=Pr=>{try{sr(_t.throw(Pr))}catch(fo){Rr(fo)}},sr=Pr=>Pr.done?ce(Pr.value):Promise.resolve(Pr.value).then(vr,Fr);sr((_t=_t.apply(oe,Re)).next())});const{Panel:ar}=ze.default,_r=null,$r=(oe,Re)=>{var _t=oe,{globalSetting:ce,loading:Rr,dispatch:vr,editData:Fr,onRef:sr=()=>{},isEdit:Pr}=_t,fo=fa(_t,["globalSetting","loading","dispatch","editData","onRef","isEdit"]);const[Yr,Ir]=(0,ft.useState)(""),[Vi,to]=(0,ft.useState)([]),[Hi]=le.default.useForm();(0,ft.useEffect)(()=>{!Fr||!Pr||(Ir(Fr==null?void 0:Fr.name),to(Fr==null?void 0:Fr.sub_item_banks),Hi.setFieldsValue(ca({},Fr)))},[Fr]),(0,ft.useEffect)(()=>{to(Hi.getFieldValue("sub_item_banks"))},[le.default.useWatch("sub_item_banks",Hi)]),(0,ft.useImperativeHandle)(Re,()=>({onSave:ir,Clear:Ui}));const ir=()=>yi(void 0,null,function*(){if(!Yr)return pe.ZP.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),!1;try{yield Hi.validateFields()}catch(Nr){return console.log(Nr,"errInfo"),pe.ZP.error(Nr.errorFields[0].errors[0]),!1}const zi=Vi.map(Nr=>ca({id:Nr.id>1?Nr.id:null},Nr));return{name:Yr,sub_item_banks:zi}}),Ui=()=>{Ir(""),to([])},kr={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"},Er=({value:zi})=>Or.createElement("div",{style:{textAlign:"center",color:"#DF3065",margin:"0 5px"}},zi),[Tr,eo]=(0,ft.useState)();return Or.createElement("section",{className:Ce.wrap},Or.createElement("p",{className:Ce.titleWrap},Or.createElement("span",{className:Ce.required},"*"),Or.createElement("span",{className:Ce.title},"\u9898\u5E72\uFF1A")),Or.createElement(Vn.Z,{id:"combination-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:Yr,onChange:zi=>Ir(zi)}),Or.createElement(le.default,{form:Hi,autoComplete:"off"},Or.createElement(le.default.List,{name:"sub_item_banks",rules:[{validator(zi,Nr){return Nr?Promise.resolve():Promise.reject(new Error("\u8BF7\u6DFB\u52A0\u5C0F\u9898"))}}]},(zi,{add:Nr,remove:Fi})=>{const Xi=Hi.getFieldValue("sub_item_banks");return Or.createElement(Or.Fragment,null,Or.createElement(ze.default,{className:zi.length>0?Ce.collapseWrapper:"",bordered:!1,expandIcon:({isActive:pr})=>Or.createElement("i",{className:`iconfont icon-weizhankai ${pr?Ce.open:Ce.close}`,style:{fontSize:14,transition:"all .2s"}})},zi.map((pr,ao)=>{var mo=pr,{key:Ro,name:Ji}=mo,_a=fa(mo,["key","name"]),wr,uo,Br,ea,Zo,Fa,Al,hu,Ys,Tl,Oo,Ns;return Or.createElement(ar,{className:Ce.panel,forceRender:!0,header:Or.createElement("div",{className:Ce.panelHeader},"\u7B2C",ao+1,"\u5C0F\u9898",Or.createElement("span",null,"\uFF08",kr[(wr=Xi==null?void 0:Xi[Ji])==null?void 0:wr.item_type],"\uFF09")),extra:Or.createElement(Le.Z,{align:"middle",onClick:gl=>gl.stopPropagation(),style:{display:"flex",alignItems:"center"}},((uo=Xi==null?void 0:Xi[Ji])==null?void 0:uo.item_type)=="completion"&&Or.createElement(le.default.Item,ia(ca({},_a),{name:[Ji,"score"],className:Ce.blankInputNumberWrapper,style:{marginBottom:0}}),((Br=Xi==null?void 0:Xi[Ji])==null?void 0:Br.item_type)=="completion"&&Or.createElement("div",{style:{display:"flex",alignItems:"center",color:"#191919"}},"\u5171",Or.createElement(Er,{value:(ea=Xi==null?void 0:Xi[Ji])==null?void 0:ea.score}),"\u5206")),((Zo=Xi==null?void 0:Xi[Ji])==null?void 0:Zo.item_type)=="completion"&&Or.createElement(Or.Fragment,null,Or.createElement(ke.ZP.Group,{defaultValue:(Fa=Xi==null?void 0:Xi[Ji])==null?void 0:Fa.use_blank_score,className:Ce.scoreByBlankRadio,style:{marginRight:10},optionType:"button",options:[{label:"\u6309\u7A7A\u7ED9\u5206",value:!0},{label:"\u6309\u9898\u7ED9\u5206",value:!1}],onChange:gl=>{var ol;console.log(Hi.getFieldsValue()),Hi==null||Hi.setFieldValue(["sub_item_banks",Ji,"use_blank_score"],(ol=gl==null?void 0:gl.target)==null?void 0:ol.value),eo(new Date)}}),Or.createElement(we.Z,{overlayInnerStyle:{width:460},title:Or.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",Or.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")},Or.createElement("i",{className:"icon-tishixiaowenhao font18 c-3061d0"})))),key:Ro},Or.createElement(le.default.Item,ia(ca({},_a),{name:Ji}),(((Al=Xi==null?void 0:Xi[Ji])==null?void 0:Al.item_type)=="single"||((hu=Xi==null?void 0:Xi[Ji])==null?void 0:hu.item_type)=="multiple")&&Or.createElement(Wr,{questionTitlePlaceholder:"\u8BF7\u7F16\u8F91\u9009\u62E9\u9898\u9898\u5E72\u5185\u5BB9",allowChangeMode:((Ys=Xi==null?void 0:Xi[Ji])==null?void 0:Ys.item_type)!="single",form:Hi,choiceKey:[Ji,"choices"],titleKey:[Ji,"name"],analysisKey:[Ji,"analysis"],choiceOptionsPath:["sub_item_banks",Ji,"choices"],choiceTextKey:"choice_text",answerKey:"is_answer"}),((Tl=Xi==null?void 0:Xi[Ji])==null?void 0:Tl.item_type)=="completion"&&Or.createElement(yn,{form:Hi,name:Ji,questionTitlePlaceholder:"\u8BF7\u7F16\u8F91\u9898\u5E72\u5E76\u8BBE\u7F6E\u586B\u7A7A\u9879",scoreByBlank:[Ji,"use_blank_score"],titleKey:[Ji,"name"],analysisKey:[Ji,"analysis"],isOrdered:[Ji,"is_ordered"],answerKey:[Ji,"standard_answer"],key:Tr}),((Oo=Xi==null?void 0:Xi[Ji])==null?void 0:Oo.item_type)=="judgement"&&Or.createElement(so,{form:Hi,questionTitlePlaceholder:"\u8BF7\u7F16\u8F91\u5224\u65AD\u9898\u9898\u5E72\u5185\u5BB9",titleKey:[Ji,"name"],analysisKey:[Ji,"analysis"],choiceKey:[Ji,"choices"]}),((Ns=Xi==null?void 0:Xi[Ji])==null?void 0:Ns.item_type)=="subjective"&&Or.createElement(zr,{showKeywords:!0,form:Hi,titleKey:[Ji,"name"],analysisKey:[Ji,"analysis"],answerTexts:[Ji,"answer_texts"],useKeywords:[Ji,"use_keywords"],keywords:[Ji,"keywords"],indexs:Ji,questionTitlePlaceholder:"\u8BF7\u7F16\u8F91\u7B80\u7B54\u9898\u9898\u5E72\u5185\u5BB9"})))})))})))};var co=(0,qt.connect)(({loading:oe,globalSetting:Re})=>({globalSetting:Re,loading:oe.effects}),null,null,{forwardRef:!0})((0,ft.forwardRef)($r)),zo=kt(84842),cr=kt(17149),Ya=kt(82326),da=kt(54172),Yo={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"},io=kt(9148),Sa=kt(58433),ns=kt(82264),Jo=kt(45937),ps=kt(28426),ms=kt(94361),La=({open:oe,onCancel:Re,onOk:_t})=>{const ce=(0,Sa.g)(),[Rr,vr,Fr,sr]=(0,Jo.U)(ns.Gm,{page:1,limit:10,keyword:"",diff:"",shixun_publish_status:"",discipline_id:"",sub_discipline_id:"",type:0,include_shixuns:!0,item_type:"SHIXUN"}),[Pr,fo]=(0,ft.useState)(!1);(0,ft.useEffect)(()=>{oe&&Fr({page:1,limit:10,type:0},!0).then(Hi=>{(Hi==null?void 0:Hi.shixuns_count)===0&&fo(!0)})},[oe]);const[Yr,Ir]=(0,ft.useState)([]),[Vi,to]=(0,ft.useState)([]);return ft.createElement(Dt.default,{title:"\u9009\u62E9\u5B9E\u8BAD\u9898",open:oe,width:948,centered:!0,closable:!0,onCancel:Re,onOk:()=>_t(Vi),destroyOnClose:!0},ft.createElement(Le.Z,{justify:"space-between",className:"mb20",style:{maxHeight:650}},ft.createElement(Bt.Z,null,ft.createElement(cr.Z,{style:{width:160},size:"large",placeholder:"\u8BF7\u9009\u62E9\u65B9\u5411&\u8BFE\u7A0B",options:ce,onChange:Hi=>{Fr({page:1,discipline_id:Hi==null?void 0:Hi[0],sub_discipline_id:Hi==null?void 0:Hi[1]})}}),ft.createElement(Ya.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:Hi=>Fr({page:1,diff:Hi})}),ft.createElement(Ya.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:Hi=>Fr({page:1,shixun_publish_status:Hi})})),ft.createElement(io.t7,{placeholder:"\u8BF7\u8F93\u5165\u5173\u952E\u8BCD\u641C\u7D22",style:{width:290},onChange:Hi=>{Fr({keyword:Hi,page:1})}})),Pr?ft.createElement("div",null,ft.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,Ut.xg)("/shixuns")})):ft.createElement(da.default,{loading:vr,rowKey:"id",columns:[{title:"\u8BD5\u9898\u540D\u79F0",dataIndex:"name",width:"30%",ellipsis:{showTitle:!0},render:(Hi,ir)=>ft.createElement("div",{style:{display:"flex",alignItems:"center"}},ft.createElement("div",{className:ir!=null&&ir.high_resources_consume?Yo.title:"",title:Hi||"--"},ft.createElement(It.Z,{key:1,showLines:1,showTextOnly:!0,value:Hi||"--"})),(ir==null?void 0:ir.high_resources_consume)&&ft.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:(Hi,ir,Ui)=>ft.createElement("span",null,Hi||"- -")},{title:"\u4F7F\u7528\u6B21\u6570",dataIndex:"study_count"},{title:ft.createElement("span",null,"\u53D1\u5E03\u72B6\u6001 ",ft.createElement(we.Z,{title:"\u672A\u53D1\u5E03\u7684\u5B9E\u8DF5\u9879\u76EE\u4E0D\u80FD\u88AB\u9009\u7528"},ft.createElement(Yi.Z,null))),dataIndex:"shixun_tag_num_name",key:"shixun_tag_num_name",width:100,render:(Hi,ir,Ui)=>ft.createElement("span",null,Hi||"- -")},{title:"\u64CD\u4F5C",render(Hi,ir){const{title:Ui,challenge_names:kr,author_name:Er,identifier:Tr,author_school_name:eo,study_count:zi}=ir||{};return ft.createElement("div",null,ft.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:ft.createElement("div",null,ft.createElement(It.Z,{value:Ui,style:{marginBottom:18}}),ft.createElement("div",{className:Yo.challengeNameWrapper},kr.map((Nr,Fi)=>ft.createElement("div",{className:Yo.challengeName,key:Fi},"\u7B2C",(0,Ut.EM)(Fi+1),"\u9898\xA0",Nr))),ft.createElement(Le.Z,{className:Yo.shixunPreviewFooter,justify:"space-between",style:{alignItems:"center"}},ft.createElement(Bt.Z,{className:Yo.shixunInfoWrapper},ft.createElement("span",null,"\u521B\u5EFA\u8005"),ft.createElement("span",{className:Yo.shixunInfo},Er.split("\u3001")[0]),ft.createElement("span",null,"\u6240\u5C5E\u5355\u4F4D"),ft.createElement("span",{className:Yo.shixunInfo},eo),ft.createElement("span",null,"\u5B66\u4E60\u4EBA\u6570"),ft.createElement("span",{className:Yo.shixunInfo},zi)),ft.createElement(ue.ZP,{type:"primary",className:Yo.btnToDetail,onClick:()=>(0,Ut.xg)(`/shixuns/${Tr}/challenges?exercise=true`)},ft.createElement("i",{className:"iconfont icon-shixunkecheng"}),"\u5B9E\u8BAD\u8BE6\u60C5")))})}},"\u67E5\u770B"),(ir==null?void 0:ir.shixun_tag_num)===1&&ft.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:Yr,preserveSelectedRowKeys:!0,getCheckboxProps:Hi=>({disabled:Hi.shixun_tag_num===1}),onChange(Hi,ir){var Ui,kr,Er;console.log(Hi),Ir(Hi);const Tr=[];for(const zi of Vi)Hi.includes(zi.id)&&Tr.push(zi);const eo=Tr.map(zi=>zi.id);for(const zi of ir)zi&&Hi.includes(zi.id)&&!eo.includes(zi.id)&&Tr.push({id:zi.id,difficulty:zi.level,identifier:zi.identifier,name:zi.name,real_name:(Ui=zi==null?void 0:zi.author_name)==null?void 0:Ui.split("\u3001")[0],school_name:zi.author_school_name,challenge_names:zi.challenge_names,challenges:(kr=zi.challenge_names)==null?void 0:kr.map((Nr,Fi)=>({subject:Nr,id:Fi,score:5})),score:((Er=zi.challenge_names)==null?void 0:Er.length)*5,study_count:zi.study_count,challenges_count:zi.challenges_count});to(Tr)}},pagination:{current:Rr.page,pageSize:Rr.limit,total:sr==null?void 0:sr.items_count,showTotal:Hi=>ft.createElement("span",null,"\u5171\xA0",ft.createElement("span",{style:{color:"#165DFF"}},Hi),"\xA0\u6761\u6570\u636E"),showQuickJumper:!0,onChange(Hi,ir){Fr({page:Hi,limit:ir})},size:"default"},scroll:{y:400}}))},Iu=kt(3039),Cu=kt(75736),js=(oe,Re,_t)=>new Promise((ce,Rr)=>{var vr=Pr=>{try{sr(_t.next(Pr))}catch(fo){Rr(fo)}},Fr=Pr=>{try{sr(_t.throw(Pr))}catch(fo){Rr(fo)}},sr=Pr=>Pr.done?ce(Pr.value):Promise.resolve(Pr.value).then(vr,Fr);sr((_t=_t.apply(oe,Re)).next())}),zs=({visible:oe,getdata:Re,onCancel:_t,onRandomExchange:ce,selectFromProblemSet:Rr,questionParams:vr})=>{const[Fr,sr]=(0,ft.useState)(!1),[Pr,fo]=(0,ft.useState)(!1),[Yr,Ir]=(0,ft.useState)({}),Vi=(0,qt.useParams)(),[to,Hi]=(0,ft.useState)(),ir=(Ui,kr)=>js(void 0,null,function*(){fo(!0);const Er=yield(0,Gt.ZP)(`/api/exercises/${Vi.categoryId}/toggle_random_question.json`,{method:"post",body:{question_id:vr.id,item_bank_id:Ui,shixuns_info:[{id:Ui,is_copy:kr!=1,is_use:kr!=1}]}});fo(!1),Er!=null&&Er.status||(pe.ZP.info("\u6362\u9898\u6210\u529F"),_t(),Re())});return ft.createElement(Dt.default,{title:"\u8BF7\u9009\u62E9\u66FF\u6362\u65B9\u5F0F",open:oe,onCancel:_t,centered:!0,maskClosable:!0,footer:null},ft.createElement(Le.Z,{justify:"center",className:"pb20"},ft.createElement(zo.Z,{onClick:ce},"\u968F\u673A\u66F4\u6362"),(vr==null?void 0:vr.type)!=="PRACTICAL"&&ft.createElement(ue.ZP,{style:{marginLeft:24},onClick:Rr},"\u4ECE\u9898\u5E93\u4E2D\u9009\u62E9"),(vr==null?void 0:vr.type)==="PRACTICAL"&&ft.createElement(ue.ZP,{style:{marginLeft:24},onClick:()=>{sr(!0)}},"\u4ECE\u9898\u5E93\u4E2D\u9009\u62E9")),ft.createElement(La,{open:Fr,onCancel:()=>sr(!1),onOk:Ui=>js(void 0,null,function*(){if(console.log("----selectedRows",Ui,Vi),(Ui==null?void 0:Ui.length)<=0){pe.ZP.info("\u8BF7\u9009\u62E9\u5B9E\u8BAD");return}let kr=Ui==null?void 0:Ui.map(Tr=>Tr==null?void 0:Tr.id),Er=yield(0,Cu.Tr)({id:[...kr],course_id:Vi.coursesId,type:"shixun"});(Er==null?void 0:Er.student_count)===0?ir(kr==null?void 0:kr[0],1):(Hi(kr),Ir(Er)),sr(!1)})}),ft.createElement(Iu.Z,{resdata:Yr,type:"shixun",okloading:Pr,oktext:(Yr==null?void 0:Yr.can_copy_num)===0?"\u786E\u5B9A":"\u4E00\u952E\u590D\u5236\u5E76\u66FF\u6362",onok:Ui=>js(void 0,null,function*(){ir(to==null?void 0:to[0],2)})}))},Vl=kt(77762),lu=kt(24334),Eu=kt(90283),xa=kt(60572),rl=kt(32162),_u=kt(48790),Kl=Object.defineProperty,uu=Object.defineProperties,Xa=Object.getOwnPropertyDescriptors,Ja=Object.getOwnPropertySymbols,Aa=Object.prototype.hasOwnProperty,Ga=Object.prototype.propertyIsEnumerable,Bl=(oe,Re,_t)=>Re in oe?Kl(oe,Re,{enumerable:!0,configurable:!0,writable:!0,value:_t}):oe[Re]=_t,ga=(oe,Re)=>{for(var _t in Re||(Re={}))Aa.call(Re,_t)&&Bl(oe,_t,Re[_t]);if(Ja)for(var _t of Ja(Re))Ga.call(Re,_t)&&Bl(oe,_t,Re[_t]);return oe},_o=(oe,Re)=>uu(oe,Xa(Re)),Co=(oe,Re,_t)=>new Promise((ce,Rr)=>{var vr=Pr=>{try{sr(_t.next(Pr))}catch(fo){Rr(fo)}},Fr=Pr=>{try{sr(_t.throw(Pr))}catch(fo){Rr(fo)}},sr=Pr=>Pr.done?ce(Pr.value):Promise.resolve(Pr.value).then(vr,Fr);sr((_t=_t.apply(oe,Re)).next())});const Ao=({data:oe,submit:Re,goBack:_t,loading:ce,onTypeScore:Rr,editPreview:vr=!1,onSkipExamination:Fr,selectValue:sr,onExchange:Pr,getdata:fo,handleMarkWrongQuestion:Yr,dispatch:Ir})=>{var Vi,to,Hi,ir,Ui,kr,Er,Tr,eo,zi,Nr;const Fi=(0,ft.useRef)(),[Xi,pr]=(0,ft.useState)(null),[ao,mo]=(0,ft.useState)(!1),[Ro,Ji]=(0,ft.useState)(!1),_a=(0,ft.useRef)(),[wr]=le.default.useForm(),uo=(0,qt.useParams)(),[Br,ea]=(0,ft.useState)(!1),[Zo,Fa]=(0,ft.useState)([]);(0,ft.useEffect)(()=>{mo(!0)},[]),(0,ft.useEffect)(()=>{vr||(0,Ut.Dk)("\u8BD5\u5377\u9884\u89C8")},[vr]),(0,ft.useEffect)(()=>{var sn;((sn=oe==null?void 0:oe.questionList)==null?void 0:sn.length)>0&&(oe==null||oe.questionList.forEach($i=>{var mr;$i.type==="PRACTICAL"&&((mr=$i==null?void 0:$i.questions)==null||mr.forEach((lr,ki)=>{var ho;Zo[ki]=!((ho=lr==null?void 0:lr.shixun)!=null&&ho.ignore_prompt),Fa([...Zo])}))}))},[oe]);const Al=["\u5BB9\u6613","\u7B80\u5355","\u9002\u4E2D","\u56F0\u96BE"],hu={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"},Ys={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"},Tl=sn=>{var $i;const mr=[];return ft.createElement(ft.Fragment,null,ft.createElement("aside",{className:Kt.single},($i=sn==null?void 0:sn.choices)==null?void 0:$i.map((lr,ki)=>(lr.is_answer&&mr.push(rl.k4[ki]),ft.createElement("ul",{key:ki},ft.createElement("li",null,rl.k4[ki],"\u3001"),ft.createElement("li",null,ft.createElement(It.Z,{value:lr.choice_text})))))),ft.createElement("div",{className:Kt.analysis},ft.createElement("div",null,"\u6B63\u786E\u7B54\u6848\uFF1A",mr.join(""),ft.createElement("span",{className:"ml30"},"\u96BE\u5EA6\uFF1A",Al[sn.difficulty])),ft.createElement("aside",null,ft.createElement("span",{className:Kt.text},"\u89E3\u6790:"),ft.createElement(It.Z,{value:sn.analysis?sn.analysis:"\u6682\u65E0\u89E3\u6790"})),ft.createElement("ul",null,ft.createElement("li",null,ft.createElement("span",{style:{color:"#007AFF",marginRight:10}},"\u65B9\u5411&\u8BFE\u7A0B:"),`${(sn==null?void 0:sn.discipline_name)||"--"}/${sn==null?void 0:sn.sub_discipline_name}`),ft.createElement(we.Z,{title:sn==null?void 0:sn.tag_discipline_name},ft.createElement("li",{style:{maxWidth:"400px",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}},ft.createElement("span",{style:{color:"#5AB891",marginRight:10}},"\u77E5\u8BC6\u70B9:"),sn==null?void 0:sn.tag_discipline_name)))))},Oo=(sn,$i)=>{var mr;const lr=(mr=sn==null?void 0:sn.standard_answer)==null?void 0:mr.map((ki,ho)=>{var Uo;return ft.createElement("div",{key:ho},`\u7B54\u6848\uFF08\u586B\u7A7A${ki==null?void 0:ki.position}\uFF09\uFF1A${(Uo=ki==null?void 0:ki.answer_text)==null?void 0:Uo.join("\u3001")}`)});return ft.createElement(ft.Fragment,null,ft.createElement("div",{className:Kt.analysis},ft.createElement("div",{style:{display:"flex"}},ft.createElement("div",null,"\u6B63\u786E\u7B54\u6848\uFF1A"),ft.createElement("div",null,lr)),ft.createElement("aside",null,ft.createElement("span",{className:Kt.text},"\u89E3\u6790:"),ft.createElement(It.Z,{value:sn.analysis?sn.analysis:"\u6682\u65E0\u89E3\u6790"})),ft.createElement("ul",null,ft.createElement("li",null,ft.createElement("span",{style:{color:"#007AFF",marginRight:10}},"\u65B9\u5411&\u8BFE\u7A0B:"),$i?`${($i==null?void 0:$i.discipline_name)||"--"}/${$i==null?void 0:$i.sub_discipline_name}`:`${(sn==null?void 0:sn.discipline_name)||"--"}/${sn==null?void 0:sn.sub_discipline_name}`),ft.createElement(we.Z,{title:$i?$i==null?void 0:$i.tag_discipline_name:sn==null?void 0:sn.tag_discipline_name},ft.createElement("li",{style:{maxWidth:"400px",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}},ft.createElement("span",{style:{color:"#5AB891",marginRight:10}},"\u77E5\u8BC6\u70B9:"),$i?$i==null?void 0:$i.tag_discipline_name:sn==null?void 0:sn.tag_discipline_name)))))},Ns=sn=>{var $i;const mr=($i=sn==null?void 0:sn.standard_answer)==null?void 0:$i.map((lr,ki)=>ft.createElement("div",{key:ki},`\u7B54\u6848\uFF08\u586B\u7A7A${(lr==null?void 0:lr.position)||(lr==null?void 0:lr.exercise_choice_id)}\uFF09\uFF1A${lr==null?void 0:lr.answer_text}`));return ft.createElement(ft.Fragment,null,ft.createElement("div",{className:Kt.analysis},ft.createElement("div",{style:{display:"flex"}},ft.createElement("div",null,"\u6B63\u786E\u7B54\u6848\uFF1A"),ft.createElement("div",null,mr)),ft.createElement("aside",null,ft.createElement("span",{className:Kt.text},"\u89E3\u6790:"),ft.createElement(It.Z,{value:sn.analysis?sn.analysis:"\u6682\u65E0\u89E3\u6790"})),ft.createElement("ul",null,ft.createElement("li",null,ft.createElement("span",{style:{color:"#007AFF",marginRight:10}},"\u65B9\u5411&\u8BFE\u7A0B:"),`${(sn==null?void 0:sn.discipline_name)||"--"}/${sn==null?void 0:sn.sub_discipline_name}`),ft.createElement(we.Z,{title:sn==null?void 0:sn.tag_discipline_name},ft.createElement("li",{style:{maxWidth:"400px",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}},ft.createElement("span",{style:{color:"#5AB891",marginRight:10}},"\u77E5\u8BC6\u70B9:"),sn==null?void 0:sn.tag_discipline_name)))))},gl=(sn,$i)=>{var mr;return ft.createElement("div",{className:Kt.analysis},ft.createElement("div",null,"\u6B63\u786E\u7B54\u6848\uFF1A",(mr=sn==null?void 0:sn.answer_texts)==null?void 0:mr[0]),ft.createElement("aside",null,ft.createElement("span",{className:Kt.text},"\u89E3\u6790:"),ft.createElement(It.Z,{value:sn.analysis?sn.analysis:"\u6682\u65E0\u89E3\u6790"})),ft.createElement("ul",null,ft.createElement("li",null,ft.createElement("span",{style:{color:"#007AFF",marginRight:10}},"\u65B9\u5411&\u8BFE\u7A0B:"),$i?`${($i==null?void 0:$i.discipline_name)||"--"}/${$i==null?void 0:$i.sub_discipline_name}`:`${(sn==null?void 0:sn.discipline_name)||"--"}/${sn==null?void 0:sn.sub_discipline_name}`),ft.createElement(we.Z,{title:$i?$i==null?void 0:$i.tag_discipline_name:sn==null?void 0:sn.tag_discipline_name},ft.createElement("li",{style:{maxWidth:"400px",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}},ft.createElement("span",{style:{color:"#5AB891",marginRight:10}},"\u77E5\u8BC6\u70B9:"),$i?$i==null?void 0:$i.tag_discipline_name:sn==null?void 0:sn.tag_discipline_name))))},ol=sn=>{var $i,mr;return ft.createElement("div",{className:Kt.analysis},ft.createElement("aside",null,ft.createElement("span",{className:Kt.text},"\u9884\u671F\u8F93\u51FA:"),ft.createElement(It.Z,{value:($i=sn==null?void 0:sn.program_attr)==null?void 0:$i.description})),ft.createElement("div",{style:{marginTop:20}},"\u6B63\u786E\u7B54\u6848\uFF1A",((mr=sn==null?void 0:sn.program_attr)==null?void 0:mr.answer_text)||"--"),ft.createElement("aside",null,ft.createElement("span",{className:Kt.text},"\u89E3\u6790:"),ft.createElement(It.Z,{value:sn.analysis?sn.analysis:"\u6682\u65E0\u89E3\u6790"})),ft.createElement("ul",null,ft.createElement("li",null,ft.createElement("span",{style:{color:"#007AFF",marginRight:10}},"\u65B9\u5411&\u8BFE\u7A0B:"),`${(sn==null?void 0:sn.discipline_name)||"--"}/${sn==null?void 0:sn.sub_discipline_name}`),ft.createElement(we.Z,{title:sn==null?void 0:sn.tag_discipline_name},ft.createElement("li",{style:{maxWidth:"400px",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}},ft.createElement("span",{style:{color:"#5AB891",marginRight:10}},"\u77E5\u8BC6\u70B9:"),sn==null?void 0:sn.tag_discipline_name))))},Ph=(sn,$i)=>{var mr;return ft.createElement("div",null,(mr=sn==null?void 0:sn.sub_item_banks)==null?void 0:mr.map((lr,ki)=>{var ho,Uo;const jo=[];return ft.createElement(ft.Fragment,null,ft.createElement("div",{style:{marginLeft:25,fontSize:"16px",color:"#333",paddingTop:"15px"}},$i+1+"."+(ki+1),"\uFF08",hu[lr.item_type]||Ys[lr.item_type],"\uFF09",lr.name),(lr.item_type=="SINGLE"||lr.item_type=="MULTIPLE"||lr.item_type=="JUDGMENT"||lr.item_type=="single"||lr.item_type=="multiple"||lr.item_type=="judgement")&&ft.createElement(ft.Fragment,null,ft.createElement("aside",{className:Kt.single},(ho=lr==null?void 0:lr.choices)==null?void 0:ho.map((Mo,ls)=>(Mo.is_answer&&jo.push(rl.k4[ls]),ft.createElement("ul",{key:ls},ft.createElement("li",null,rl.k4[ls],"\u3001"),ft.createElement("li",null,ft.createElement(It.Z,{value:Mo.choice_text})))))),ft.createElement("div",{className:Kt.analysis},ft.createElement("div",null,"\u6B63\u786E\u7B54\u6848\uFF1A",jo.join(""),ft.createElement("span",{className:"ml30"},"\u96BE\u5EA6\uFF1A",Al[lr.difficulty])),ft.createElement("aside",null,ft.createElement("span",{className:Kt.text},"\u89E3\u6790:"),ft.createElement(It.Z,{value:lr.analysis?lr.analysis:"\u6682\u65E0\u89E3\u6790"})),ft.createElement("ul",null,ft.createElement("li",null,ft.createElement("span",{style:{color:"#007AFF",marginRight:10}},"\u65B9\u5411&\u8BFE\u7A0B:"),`${(sn==null?void 0:sn.discipline_name)||"--"}/${sn==null?void 0:sn.sub_discipline_name}`),ft.createElement(we.Z,{title:sn==null?void 0:sn.tag_discipline_name},ft.createElement("li",{style:{maxWidth:"400px",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}},ft.createElement("span",{style:{color:"#5AB891",marginRight:10}},"\u77E5\u8BC6\u70B9:"),sn==null?void 0:sn.tag_discipline_name))))),(lr.item_type=="COMPLETION"||lr.item_type=="completion")&&Oo(lr,sn),(lr.item_type=="SUBJECTIVE"||lr.item_type=="subjective")&&gl(lr,sn),((Uo=oe==null?void 0:oe.exam)==null?void 0:Uo.exercise_status)===3&&ft.createElement("div",{className:"flex gap-20px mt20"},ft.createElement(Eu.Z,{state:lr==null?void 0:lr.is_wrong,onClick:()=>{Yr==null||Yr({value:_o(ga({},lr),{question_id:lr==null?void 0:lr.id,question_score:lr==null?void 0:lr.score})})}}),lr.item_type=="single"&&ft.createElement(ue.ZP,{style:{color:"#3061D0"},onClick:()=>{ml({value:lr})}},"\u589E\u8BBE\u6B63\u786E\u7B54\u6848")))}))},Ul=sn=>{var $i,mr,lr;return ft.createElement("div",{style:{marginTop:"12px"}},(mr=($i=sn==null?void 0:sn.shixun)==null?void 0:$i.challenges)==null?void 0:mr.map((ki,ho)=>ft.createElement("div",{className:"c-grey-666 font14 mb10 ml25",style:{display:"flex",alignItems:"center",justifyContent:"space-between"}},ft.createElement("div",null,ft.createElement("span",{className:"mr5"},"\u7B2C",ho+1,"\u5173"),ft.createElement(we.Z,{key:ho,title:ki==null?void 0:ki.challenge_name},ft.createElement("span",null,(0,Ut.Pq)(ki==null?void 0:ki.challenge_name,44)))),vr&&ft.createElement("div",null,"\u5206\u503C\uFF1A",ki.score,"\u5206"))),ft.createElement(qt.Link,{style:{float:"right"},target:"_blank",to:`/shixuns/${(lr=sn==null?void 0:sn.shixun)==null?void 0:lr.identifier}/challenges`},"\u5B9E\u8BAD\u8BE6\u60C5"),ft.createElement("div",{style:{clear:"both"}}))},bo=sn=>{let $i=sn.questions_score/sn.questions_count;Dt.default.confirm({icon:null,centered:!0,title:"\u5206\u6570\u8BBE\u7F6E",content:ft.createElement("div",{className:Kt.modalColumn},ft.createElement("div",{className:Kt.modalRow,style:{justifyContent:"flex-start"}},ft.createElement("sup",{className:Kt.sup},"*"),ft.createElement("span",null,sn==null?void 0:sn.name,"\uFF1A"),ft.createElement(ee.Z,{min:0,precision:1,defaultValue:$i,onChange:mr=>{$i=mr}}),ft.createElement("span",{className:"ml5"},"\u5206/\u9898"))),okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",onOk:()=>Co(void 0,null,function*(){var mr;if(!$i)return pe.ZP.warning("\u5206\u6570\u4E0D\u80FD\u4E3A\u7A7A\u6216\u4E3A0"),Promise.reject();const lr={type:sn==null?void 0:sn.type,score:$i,scoreTotal:Number((mr=$i*sn.questions_count)==null?void 0:mr.toFixed(1))};Rr(lr)})})},Wo=()=>{let sn="";Dt.default.confirm({icon:null,centered:!0,title:"\u4FDD\u5B58\u8BD5\u5377",content:ft.createElement("div",{className:Kt.modalColumn},ft.createElement("div",{style:{color:"#676A6C",display:"flex",alignItems:"center"},className:"font14 mt20"},ft.createElement("img",{style:{marginRight:5},src:cn.Z}),"\u4FDD\u5B58\u540E\u5355\u72EC\u751F\u6210\u4E00\u4EFD\u4EBA\u5DE5\u7EC4\u5377\u7C7B\u578B\u7684\u56FA\u5B9A\u8BD5\u5377\u3002"),ft.createElement("div",{className:Kt.modalRow,style:{marginTop:20}},ft.createElement("sup",{className:Kt.sup},"*"),ft.createElement("span",{style:{flexShrink:0}},"\u8BD5\u5377\u540D\u79F0\uFF1A"),ft.createElement(Jt.default,{placeholder:"\u8BF7\u8F93\u5165\u8BD5\u5377\u540D\u79F0",min:0,maxLength:60,defaultValue:sn,onChange:$i=>{sn=$i.target.value}}))),okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",onOk:()=>Co(void 0,null,function*(){var $i;if(!sn)return pe.ZP.warning("\u8BD5\u5377\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A"),Promise.reject();const mr=[],lr=[],ki=[],ho=[];($i=oe==null?void 0:oe.questionList)==null||$i.forEach(jo=>{var Mo;(Mo=jo.questions)==null||Mo.forEach(ls=>{let ra=jo.questions_score/jo.questions_count;ra=ra&&ra.toFixed(1),jo.type==="COMBINATION"&&ki.push({id:ls.id,sub_item_bank_ids:ls.sub_item_banks.map(Ra=>Ra.id)}),jo.type==="PRACTICAL"?ho.push(ls.id):(mr.push(ls.id),lr.push(ra))})}),console.log("-----",ki),yield Re({item_bank_ids:mr,item_bank_scores:lr,name:sn,combination_item_banks:ki,shixun_ids:ho})})})},Pa=(sn,$i,mr,lr)=>{var ki;const ho=`${location.pathname}${location.search}`,Uo=(ki=lr.questions)==null?void 0:ki.map(jo=>jo==null?void 0:jo.id);if(ho.includes("exercise"))_a.current={id:sn,ids:Uo,type:$i,index:mr},Ji(!0);else{let jo=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:()=>Co(void 0,null,function*(){jo.update({cancelButtonProps:{disabled:!0}}),yield Pr({single_question_id:sn,seleted_item_bank_ids:Uo},{type:$i,index:mr}),jo.update({cancelButtonProps:{disabled:!1}}),pe.ZP.success("\u5DF2\u91CD\u65B0\u968F\u673A\u751F\u6210\u8BD5\u9898")})})}},is=sn=>{var $i;const mr=($i=sn.questions)==null?void 0:$i.map(ho=>ho==null?void 0:ho.id),lr=sn.name;let ki=Dt.default.confirm({icon:null,centered:!0,title:"\u6E29\u99A8\u63D0\u793A",content:`\u786E\u8BA4\u66F4\u6362${lr}\u4E2D\u7684\u6240\u6709\u8BD5\u9898\u5417\uFF1F`,cancelButtonProps:{disabled:!1},maskClosable:!1,keyboard:!1,okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",onOk:()=>Co(void 0,null,function*(){ki.update({cancelButtonProps:{disabled:!0}}),yield Pr({seleted_item_bank_ids:mr},{type:sn.type}),ki.update({cancelButtonProps:{disabled:!1}}),pe.ZP.success(`\u5DF2\u91CD\u65B0\u968F\u673A\u751F\u6210${lr}\u8BD5\u9898`)})})},Qa=()=>{let sn=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:()=>Co(void 0,null,function*(){sn.update({cancelButtonProps:{disabled:!0}}),yield Pr(),sn.update({cancelButtonProps:{disabled:!1}}),pe.ZP.success("\u5DF2\u91CD\u65B0\u968F\u673A\u751F\u6210\u6574\u5F20\u8BD5\u9898")})})},pl=sn=>{console.log(sn,"key"),Fr(sn-1)},Yl=(sn,$i)=>{var mr,lr;if($i==="SINGLE")return ft.createElement(ft.Fragment,null,ft.createElement(jn,{ref:Fi,editData:sn,isEdit:!0}),ft.createElement(jt.Z,null));if($i==="MULTIPLE")return ft.createElement(ft.Fragment,null,ft.createElement(Ei,{ref:Fi,editData:sn,isEdit:!0}),ft.createElement(jt.Z,null));if($i==="JUDGMENT")return ft.createElement(ft.Fragment,null,ft.createElement(Ke,{ref:Fi,editData:sn,isEdit:!0}),ft.createElement(jt.Z,null));if($i==="COMPLETION")return ft.createElement(ft.Fragment,null,ft.createElement(Pe,{ref:Fi,editData:sn,isEdit:!0}),ft.createElement(jt.Z,null));if($i==="SUBJECTIVE")return ft.createElement(ft.Fragment,null,ft.createElement(_n,{ref:Fi,editData:sn,isEdit:!0}),ft.createElement(jt.Z,null));if($i==="COMBINATION")return ft.createElement(ft.Fragment,null,ft.createElement(co,{ref:Fi,editData:sn,isEdit:!0}),ft.createElement(jt.Z,null));if($i==="BPROGRAM")return ft.createElement(ft.Fragment,null,ft.createElement(le.default,{form:wr,style:{marginTop:20},onFinishFailed:ki=>{var ho,Uo;ki.errorFields[0].name.includes("standard_answers")?pe.ZP.error("\u586B\u7A7A\u9879\u7B54\u6848\u4E0D\u80FD\u4E3A\u7A7A"):pe.ZP.error(ki.errorFields[0].errors[0]),wr.scrollToField((Uo=(ho=ki==null?void 0:ki.errorFields)==null?void 0:ho[0])==null?void 0:Uo.name,{behavior:"smooth",block:"center"})},onFinish:ki=>Co(void 0,null,function*(){var ho;let Uo=_o(ga({question_score:sn.score},ki),{question_type:8,hack:_o(ga({},ki.hack),{difficult:sn.program_attr.difficult}),hack_codes:_o(ga({},ki.hack_codes),{code:lu.Base64.encode((ho=ki.hack_codes)==null?void 0:ho.code)})});Br&&(Uo.is_cover=1);const jo=yield(0,Gt.ZP)(`/api/exercise_questions/${sn.id}.json`,{method:"put",body:Uo});(jo==null?void 0:jo.status)===0&&(pe.ZP.success("\u7F16\u8F91\u6210\u529F"),pl(sr+1)),pr(null)})},ft.createElement(Vl.tc,{form:wr,questionTitlePlaceholder:"\u8BF7\u7F16\u8F91\u9898\u5E72\u5E76\u8BBE\u7F6E\u586B\u7A7A\u9879",scoreByBlank:!1,hackidentifier:(mr=sn==null?void 0:sn.program_attr)==null?void 0:mr.identifier,answerKey:"standard_answers"}),ft.createElement(jt.Z,null)));if($i==="PROGRAM"&&qt.history.push(`/problems/${(lr=sn==null?void 0:sn.program_attr)==null?void 0:lr.identifier}/edit?type=exercises&express_id=${uo.categoryId}&question_id=${sn==null?void 0:sn.id}&score=${sn==null?void 0:sn.score}&callback_url=${location.pathname}&select=${sr}&exercise=true`),$i==="PRACTICAL")return ft.createElement(ft.Fragment,null,ft.createElement(ti,{ref:Fi,editData:sn,isEdit:!0}),ft.createElement(jt.Z,null))},du=(sn,$i)=>Co(void 0,null,function*(){var mr,lr,ki,ho,Uo,jo;const Mo=yield(mr=Fi.current)==null?void 0:mr.onSave();if(!Mo)return;const ls=qi=>{const us=qi.map(Ha=>Ha.choice_text.trim().replace(/^\s+|\s+$/g,""));return new Set(us).size!==us.length},ra={question_score:$i.score,analysis:Mo.analysis};if(sn==="SINGLE"||sn==="MULTIPLE"||sn==="JUDGMENT"){if(sn!=="JUDGMENT"&&ls(Mo==null?void 0:Mo.choices)){pe.ZP.error("\u9009\u62E9\u9898\u9009\u9879\u5185\u5BB9\u4E0D\u80FD\u91CD\u590D\uFF0C\u8BF7\u4FEE\u6539\u540E\u518D\u4FDD\u5B58");return}const qi=[],us=[];ra.question_type=sn==="JUDGMENT"?2:1,ra.question_title=Mo==null?void 0:Mo.name,(lr=Mo==null?void 0:Mo.choices)==null||lr.forEach((vl,Ha)=>{qi.push(vl.choice_text),vl!=null&&vl.is_answer&&us.push(Ha+1)}),ra.question_choices=qi,ra.standard_answers=us}if(sn==="COMPLETION"){let qi=(ki=Mo==null?void 0:Mo.standard_answers)==null?void 0:ki.map((Ha,Xs)=>(Ha==null?void 0:Ha.score)<=0?Xs+1:null).filter(Ha=>Ha!==null);if((qi==null?void 0:qi.length)>0)return pe.ZP.warning(`\u7B2C${qi.join("\u3001")}\u9879\u7684\u5206\u503C\u4E0D\u80FD\u4E3A\u7A7A`),!1;let us=(ho=Mo==null?void 0:Mo.standard_answers)==null?void 0:ho.reduce((Ha,Xs)=>Ha+(Number(Xs==null?void 0:Xs.score)||0),0);if(parseFloat(us.toFixed(2))!=(ra==null?void 0:ra.question_score))return pe.ZP.warning("\u5404\u586B\u7A7A\u9879\u5206\u503C\u4E4B\u548C\u5FC5\u987B\u7B49\u4E8E\u8BE5\u5C0F\u9898\u5206\u503C\uFF01"),!1;ra.is_ordered=Mo.is_ordered,ra.question_title=Mo==null?void 0:Mo.name,ra.use_blank_score=Mo==null?void 0:Mo.use_blank_score,ra.question_type=3;const vl=[];(Uo=Mo==null?void 0:Mo.standard_answers)==null||Uo.forEach((Ha,Xs)=>{vl.push({choice_id:Ha.position,answer_text:Ha.answer_text,score:Ha.score})}),ra.standard_answers=vl,ra.downcase=Mo==null?void 0:Mo.downcase,ra.no_space=Mo==null?void 0:Mo.no_space}if(sn==="SUBJECTIVE"&&(console.log("editorData"),console.log(Mo),ra.question_title=Mo==null?void 0:Mo.name,ra.question_type=4,ra.answer_texts=Mo==null?void 0:Mo.answer_texts,ra.use_keywords=Mo==null?void 0:Mo.use_keywords,ra.keywords=Mo==null?void 0:Mo.keywords),sn==="COMBINATION"){ra.question_title=Mo==null?void 0:Mo.name,ra.question_type=7;try{ra.sub_questions=(jo=Mo==null?void 0:Mo.sub_item_banks)==null?void 0:jo.map((qi,us)=>{var vl,Ha,Xs;if((qi==null?void 0:qi.item_type)=="single"||(qi==null?void 0:qi.item_type)=="multiple"){if(ls(qi==null?void 0:qi.choices))throw new Error(`\u7B2C${us+1}\u5C0F\u9898\u9009\u9879\u5185\u5BB9\u91CD\u590D\uFF0C\u8BF7\u4FEE\u6539\u540E\u518D\u4FDD\u5B58`);const ih=[],Ma=[];return(vl=qi==null?void 0:qi.choices)==null||vl.forEach((Ea,Xl)=>{ih.push(Ea.choice_text),Ea!=null&&Ea.is_answer&&Ma.push(Xl+1)}),{id:qi.id,question_id:qi.id,question_title:qi.name,difficulty:qi.difficulty,question_type:(qi==null?void 0:qi.item_type)=="single"?0:(qi==null?void 0:qi.item_type)=="multiple"?1:2,question_choices:ih,standard_answers:Ma,analysis:qi.analysis,question_score:qi==null?void 0:qi.score}}else if((qi==null?void 0:qi.item_type)=="completion"){let ih=(Ha=qi==null?void 0:qi.standard_answer)==null?void 0:Ha.reduce((Ea,Xl)=>Ea+(Number(Xl==null?void 0:Xl.score)||0),0);if(parseFloat(ih.toFixed(2))!=(qi==null?void 0:qi.score))throw new Error("\u5404\u586B\u7A7A\u9879\u5206\u503C\u4E4B\u548C\u5FC5\u987B\u7B49\u4E8E\u8BE5\u5C0F\u9898\u5206\u503C\uFF01");const Ma=[];return(Xs=qi==null?void 0:qi.standard_answer)==null||Xs.forEach((Ea,Xl)=>{Ma.push({choice_id:Ea.position,answer_text:Ea.answer_text,score:Ea.score})}),{id:qi.id,question_id:qi.id,is_ordered:qi.is_ordered,question_title:qi.name,difficulty:qi.difficulty,question_type:3,standard_answers:Ma,use_blank_score:qi.use_blank_score,analysis:qi.analysis,downcase:qi==null?void 0:qi.downcase,no_space:qi==null?void 0:qi.no_space,question_score:qi==null?void 0:qi.score}}else if((qi==null?void 0:qi.item_type)=="subjective")return{id:qi.id,question_id:qi.id,question_title:qi.name,question_type:4,difficulty:qi.difficulty,answer_texts:qi==null?void 0:qi.answer_texts,analysis:qi.analysis,question_score:qi==null?void 0:qi.score,use_keywords:qi.use_keywords,keywords:qi==null?void 0:qi.keywords}})}catch(qi){pe.ZP.warning(qi.message);return}delete ra.analysis}let Ra=!1;($i==null?void 0:$i.is_my)===1&&(Ra=yield new Promise((us,vl)=>{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:()=>{us(!0)},onCancel:()=>{us(!1)}})})),Ra&&(ra.is_cover=1);const Ru=sn!=="PRACTICAL"?yield(0,Gt.ZP)(`/api/exercise_questions/${$i.id}.json`,{method:"put",body:ra}):yield(0,Gt.ZP)(`/api/exercise_questions/${$i.id}/update_shixun_score.json`,{method:"post",body:ga({},Mo)});(Ru==null?void 0:Ru.status)===0&&(pe.ZP.success("\u7F16\u8F91\u6210\u529F"),pl(sr+1),pr(null))}),al=()=>Co(void 0,null,function*(){(0,qt.getDvaApp)()._store.dispatch({type:"globalSetting/setGlobalLoading",payload:{show:!0,text:"\u6B63\u5728\u66F4\u65B0\u8BD5\u5377\uFF0C\u8BF7\u7A0D\u540E..."}}),(yield(0,Gt.ZP)(`/api/exercises/${uo.categoryId}/sync_random_question.json`,{method:"post"})).status===0&&(yield Fr(sr),pe.ZP.success("\u66F4\u65B0\u6210\u529F")),(0,qt.getDvaApp)()._store.dispatch({type:"globalSetting/setGlobalLoading",payload:{show:!1}})}),ml=({value:sn}={})=>{var $i;const mr=[];let lr=[];const ki=($i=sn==null?void 0:sn.choices)==null?void 0:$i.map((Uo,jo)=>{var Mo;const ls=jo+1;return Uo!=null&&Uo.is_answer&&(mr.push(ls),lr.push(ls)),{value:ls,label:ft.createElement(It.Z,{className:"c-black font14",value:`${(Mo=rl.k4)==null?void 0:Mo[jo]}. ${Uo==null?void 0:Uo.choice_text}`}),disabled:Uo==null?void 0:Uo.origin_standard_answer}}),ho=Dt.default.confirm({centered:!0,icon:null,title:"\u589E\u8BBE\u6B63\u786E\u7B54\u6848",width:800,content:ft.createElement(ft.Fragment,null,"\u5F53\u524D\u8BD5\u9898\u7684\u6B63\u786E\u7B54\u6848\u4E3A ",mr==null?void 0:mr.map(Uo=>{var jo;return(jo=rl.k4)==null?void 0:jo[Uo-1]}),"\uFF0C\u8BF7\u9009\u62E9\u9700\u8981\u589E\u8BBE\u4E3A\u6B63\u786E\u7B54\u6848\u7684\u9009\u9879\u3002",ft.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",ft.createElement("br",null),ft.createElement(De.default.Group,{className:"flex-col mt20",options:ki,defaultValue:lr,onChange:Uo=>{lr=Uo}})),onOk:()=>Co(void 0,null,function*(){const Uo=yield(0,Gt.ZP)(`/api/exercises/${uo.categoryId}/questions/${sn==null?void 0:sn.id}/add_standard_answers.json`,{method:"put",body:{standard_answer:lr}});(Uo==null?void 0:Uo.status)===0&&(pe.ZP.success("\u4FEE\u6539\u6210\u529F"),pl(sr+1))})})},rf=(Vi=oe==null?void 0:oe.questionList)==null?void 0:Vi.reduce((sn,$i)=>sn+Number($i.questions_score),0),of=vr&&((to=oe==null?void 0:oe.exam)==null?void 0:to.exercise_status)!==1,fg=sn=>Co(void 0,null,function*(){const $i=yield(0,Gt.ZP)(`/api/courses/${uo==null?void 0:uo.coursesId}/sync_shixuns.json`,{method:"post",body:{exercise_ids:[uo==null?void 0:uo.categoryId],exercise_question_id:sn.id}});($i==null?void 0:$i.status)===0&&(Ir({type:"classroomList/setActionTabs",payload:{}}),pe.ZP.info("\u5B9E\u8BAD\u540C\u6B65\u4E2D\uFF0C\u8BF7\u7A0D\u540E"))}),af=(sn,$i)=>Co(void 0,null,function*(){let mr=yield(0,Gt.ZP)(`/api/courses/${uo==null?void 0:uo.coursesId}/ignore_prompt.json`,{method:"post",body:{container_type:"Exercise",container_id:uo==null?void 0:uo.categoryId,exercise_question_id:sn==null?void 0:sn.id}});(mr==null?void 0:mr.status)===0&&(Zo[$i]=!1,Fa([...Zo]))});return ft.createElement("section",{className:Kt.wrap},ft.createElement("div",{id:"id_left_preview",className:Kt.left,onMouseEnter:sn=>{const $i=document.getElementById("id_left_preview");$i.style.overflowY="auto"},onMouseLeave:sn=>{const $i=document.getElementById("id_left_preview");$i.style.overflowY="hidden"}},ft.createElement("div",{className:Kt.title},ft.createElement("div",{className:"body-overflow-initial"},ft.createElement("b",null),ft.createElement("span",null,"\u7B54\u9898\u5361"))),ft.createElement("div",{className:Kt.total},ft.createElement("div",null,ft.createElement("img",{src:qe}),ft.createElement("span",null,"\u9898\u6570(\u9053)"),ft.createElement("aside",null,oe==null?void 0:oe.all_questions_count)),ft.createElement("div",{className:"mr30 ml30"},ft.createElement("img",{src:on}),ft.createElement("span",null,"\u603B\u5206(\u5206)"),ft.createElement("aside",null,rf&&rf.toFixed(1))),ft.createElement("div",null,ft.createElement("img",{src:At}),ft.createElement("span",null,"\u65F6\u957F(\u5206)"),ft.createElement("aside",null,((Hi=oe==null?void 0:oe.exam)==null?void 0:Hi.time)===-1||((ir=oe==null?void 0:oe.exam)==null?void 0:ir.time)===null?"\u4E0D\u9650":(Ui=oe==null?void 0:oe.exam)==null?void 0:Ui.time))),(kr=oe==null?void 0:oe.questionList)==null?void 0:kr.map((sn,$i)=>{var mr;return ft.createElement("div",{className:Kt.list,key:$i},ft.createElement("div",{className:Kt.name},ft.createElement("b",null),ft.createElement("span",null,sn.name)),ft.createElement("aside",null,ft.createElement("div",null,"\u5171",ft.createElement("span",{className:Kt.b},sn.questions_count),"\u9898 ",ft.createElement("span",{className:Kt.l},"|"),"\u5171",ft.createElement("span",{className:Kt.r},sn.questions_score),"\u5206"),ft.createElement("div",{className:Kt.answerSheet},(mr=sn==null?void 0:sn.questions)==null?void 0:mr.map((lr,ki)=>ft.createElement("div",{onClick:()=>{const ho=`Anchor_${lr==null?void 0:lr.id}`;let Uo=document.getElementById(ho);Uo&&setTimeout(()=>Uo.scrollIntoView({block:"center",behavior:"smooth"}))},key:lr==null?void 0:lr.id,className:Kt.tag},ki+1)))))})),ft.createElement("div",{className:Kt.right},ft.createElement("div",{className:Kt.examName,id:"examName"},ft.createElement("div",{className:Kt.name},ft.createElement(we.Z,{title:(Er=oe==null?void 0:oe.exam)==null?void 0:Er.name,getPopupContainer:sn=>sn.parentNode},ft.createElement("span",{className:Kt.t},(Tr=oe==null?void 0:oe.exam)==null?void 0:Tr.name))),vr&&((eo=oe==null?void 0:oe.exam)==null?void 0:eo.exercise_status)===1&&ft.createElement(io.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:()=>{al()}})},type:"primary"},"\u66F4\u65B0\u8BD5\u5377"),!vr&&ft.createElement(ue.ZP,{onClick:Qa,type:"primary"},"\u968F\u673A\u66F4\u6362")),ft.createElement("div",{className:Kt.topWarp},(zi=oe==null?void 0:oe.questionList)==null?void 0:zi.map((sn,$i)=>{var mr,lr;return ft.createElement(ft.Fragment,{key:$i},ft.createElement("div",{className:Kt.head,style:$i===0?{border:0,marginTop:-16}:{}},ft.createElement("div",{className:Kt.name},ft.createElement("b",null),ft.createElement("span",null,sn.name)),ft.createElement("div",{className:Kt.so},"\u5171",ft.createElement("span",{className:Kt.b},sn.questions_count," "),"\u9898 ",sn.type==="COMBINATION"&&`\uFF08\u5305\u542B${(mr=sn==null?void 0:sn.questions)==null?void 0:mr.map(ki=>{var ho;return(ho=ki==null?void 0:ki.sub_item_banks)==null?void 0:ho.length}).reduce((ki,ho)=>ki+ho)}\u5C0F\u9898\uFF09`,ft.createElement("span",{className:Kt.l},"|"),"\u5171",ft.createElement("span",{className:Kt.r},sn.questions_score),"\u5206"),!vr&&ft.createElement("div",{className:Kt.btn},ft.createElement(ue.ZP,{onClick:()=>{bo(sn)},type:"primary",ghost:!0,className:"mr20"},"\u8BBE\u7F6E\u5F97\u5206"),ft.createElement(ue.ZP,{onClick:()=>is(sn),type:"primary",ghost:!0},"\u968F\u673A\u66F4\u6362"))),(lr=sn==null?void 0:sn.questions)==null?void 0:lr.map((ki,ho)=>{var Uo,jo,Mo,ls,ra;return Xi===(ki==null?void 0:ki.id)?ft.createElement("div",{id:`Anchor_${ki==null?void 0:ki.id}`,className:Kt.content,style:{padding:0,marginTop:24},key:ki==null?void 0:ki.id},ft.createElement("div",{style:{float:"right",marginTop:`${(sn==null?void 0:sn.type)==="PRACTICAL"?"-2px":"-6px"}`}},ft.createElement(ue.ZP,{onClick:()=>pr(null),className:"mr20",type:"primary",ghost:!0},"\u53D6\u6D88"),ft.createElement(ue.ZP,{onClick:()=>{du(sn==null?void 0:sn.type,ki)},type:"primary"},"\u4FDD\u5B58")),Yl(ki,sn.type)):ft.createElement("div",{id:`Anchor_${ki==null?void 0:ki.id}`,className:Kt.content,key:ki==null?void 0:ki.id},ft.createElement("div",{className:Kt.titleWrap},(ki==null?void 0:ki.item_type)==="bprogram"?ft.createElement(It.Z,{style:{paddingRight:10},value:ho+1+"\u3001"+((Uo=ki==null?void 0:ki.program_attr)==null?void 0:Uo.description)}):ft.createElement(It.Z,{style:{paddingRight:10},className:Kt.titleHtml,value:ho+1+`\u3001${(ki==null?void 0:ki.item_type)==="combination"?"\uFF08\u9898\u5E72\uFF09":""}`+(ki==null?void 0:ki.name)}),(0,_u.G5)()&&((jo=ki==null?void 0:ki.shixun)==null?void 0:jo.shixun_change)&&ft.createElement(ae.Z,{trigger:"click",open:Zo[ho],onOpenChange:Ra=>{Zo[ho]=!0,Fa([...Zo])},placement:"bottomLeft",autoAdjustOverflow:!1,title:null,content:ft.createElement("div",{style:{width:"310px",color:"#000"}},ft.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"),ft.createElement("div",{className:Kt.btn_warp},ft.createElement(ue.ZP,{size:"small",onClick:()=>af(ki,ho)},"\u5FFD\u7565"),ft.createElement(ue.ZP,{className:"ml20",size:"small",type:"primary",onClick:()=>{Zo[ho]=!1,Fa([...Zo]),Ir({type:"classroomList/setActionTabs",payload:{key:"\u5B9E\u8BAD\u540C\u6B65\u786E\u8BA4",onOK:()=>fg(ki)}})}},"\u786E\u8BA4\u540C\u6B65"),ft.createElement(ue.ZP,{className:"ml20",size:"small",type:"primary",onClick:()=>(0,Ut.xg)(`/shixuns/${ki==null?void 0:ki.forked_shixun_identifier}/challenges?exercise=true`)},"\u524D\u5F80\u67E5\u770B")))},ft.createElement("i",{className:"iconfont icon-tongzhi1 pl10 current",style:{fontSize:"16px",color:"#F7B500"},onClick:Ra=>Ra.stopPropagation()})),vr&&ft.createElement(ue.ZP,{onClick:()=>{var Ra,Ru,qi;if(Xi){pe.ZP.warning("\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u8BD5\u9898");return}wr.setFieldsValue({standard_answers:ki==null?void 0:ki.standard_answer,hack:ga(ga({},ki),ki==null?void 0:ki.program_attr),hack_codes:_o(ga({},ki==null?void 0:ki.program_attr),{code:lu.Base64.decode(((Ra=ki==null?void 0:ki.program_attr)==null?void 0:Ra.code)||"")}),hack_sets:ga({},(Ru=ki==null?void 0:ki.hack_sets)==null?void 0:Ru[0])}),(ki==null?void 0:ki.item_type)=="program"?qt.history.push(`/problems/newedit/${(qi=ki==null?void 0:ki.program_attr)==null?void 0:qi.identifier}?type=exercises&express_id=${uo.categoryId}&question_id=${ki==null?void 0:ki.id}&score=${ki==null?void 0:ki.score}&exercise=true&callback_url=/classrooms/${uo.coursesId}/exercise/${uo.categoryId}/detail?random=true`):pr(ki==null?void 0:ki.id)},type:"primary",style:{marginLeft:"auto"},ghost:!0},"\u7F16\u8F91"),!of&&ft.createElement(ue.ZP,{disabled:of,className:"ml20",onClick:()=>Pa(ki==null?void 0:ki.id,sn.type,ho,sn),type:"primary",ghost:!0},"\u6362\u4E00\u9898")),(ki==null?void 0:ki.item_type)==="bprogram"&&ft.createElement(It.Z,{style:{paddingRight:10,paddingLeft:25},showProgramFill:!0,disabledFill:!0,className:Kt.titleHtml,value:lu.Base64.decode(((Mo=ki==null?void 0:ki.program_attr)==null?void 0:Mo.code)||"")}),(sn.type==="SINGLE"||sn.type==="JUDGMENT"||sn.type==="MULTIPLE")&&Tl(ki),sn.type==="COMPLETION"&&Oo(ki),sn.type==="SUBJECTIVE"&&gl(ki),sn.type==="PROGRAM"&&ol(ki),sn.type==="BPROGRAM"&&Ns(ki),sn.type==="COMBINATION"&&Ph(ki,ho),sn.type==="PRACTICAL"&&Ul(ki),ft.createElement(Le.Z,{className:"mt20",wrap:!1,align:"middle",gutter:20},((ls=oe==null?void 0:oe.exam)==null?void 0:ls.exercise_status)===3&&!["PROGRAM","BPROGRAM","PRACTICAL","COMBINATION"].includes(sn.type)&&ft.createElement(Bt.Z,null,ft.createElement(Eu.Z,{state:ki==null?void 0:ki.is_wrong,onClick:()=>{Yr==null||Yr({value:_o(ga({},ki),{question_id:ki==null?void 0:ki.id,question_score:ki==null?void 0:ki.score})})}})),["PROGRAM","BPROGRAM","PRACTICAL"].includes(sn.type)&&(ki==null?void 0:ki.show_resubmit)&&ft.createElement(Bt.Z,null,ft.createElement(xa.C,{dataSource:_o(ga({},ki),{question_id:ki==null?void 0:ki.id})})),((ra=oe==null?void 0:oe.exam)==null?void 0:ra.exercise_status)===3&&["SINGLE"].includes(sn.type)&&ft.createElement(Bt.Z,null,ft.createElement(ue.ZP,{style:{color:"#3061D0"},onClick:()=>{ml({value:ki})}},"\u589E\u8BBE\u6B63\u786E\u7B54\u6848"))))}))}))),vr?ft.createElement(io.vr,null,ft.createElement(nt.Z,{showTotal:Ut.rU,total:(Nr=oe==null?void 0:oe.exam)==null?void 0:Nr.total_num,pageSize:1,current:sr+1,showSizeChanger:!1,onChange:pl,showQuickJumper:!1,hideOnSinglePage:!1})):ft.createElement(io.vr,{LeftContent:ft.createElement(io.op,{onClick:_t,shape:"default",style:{height:38,background:"#fff",boxShadow:"none"}},"\u8FD4\u56DE"),RightContent:ft.createElement(Le.Z,{align:"middle"},ft.createElement(ae.Z,{color:"#55575D",overlayClassName:Kt.popover,open:ao,getPopupContainer:sn=>sn==null?void 0:sn.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"},ft.createElement(io.op,{onMouseEnter:()=>mo(!0),onMouseLeave:()=>mo(!1),onClick:()=>Wo(),shape:"default",style:{height:38,background:"#fff",boxShadow:"none"}},"\u4FDD\u5B58")),ft.createElement(io.op,{shape:"default",type:"primary",onClick:()=>Re(),style:{height:38,marginLeft:20}},"\u63D0\u4EA4"))}),ft.createElement(zs,{visible:Ro,questionParams:_a.current,getdata:fo,onRandomExchange:()=>Co(void 0,null,function*(){const sn=_a.current;yield Pr({single_question_id:sn.id,seleted_item_bank_ids:sn.ids},{type:sn.type,index:sn.index}),Ji(!1)}),selectFromProblemSet:()=>{const sn=_a.current,$i=`${location.pathname}${location.search}`;$i.includes("exercise")&&qt.history.push(`/paperlibrary/exchangequestion?type=exercise&qid=${sn.id}&qtype=${sn.type}&exerciseid=${uo.categoryId}&from=${$i}`)},onCancel:()=>{Ji(!1)}}))};var Ta=(0,qt.connect)(({classroomList:oe})=>({classroomList:oe}))(Ao)},23129:function(Mn,Rn,kt){"use strict";kt.r(Rn),kt.d(Rn,{default:function(){return st}});var ft=kt(59301),Kt=kt(25690),le={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"},we=kt(43554),ue=kt(6767),Dt=kt(458),ee=kt(38986),pe=kt(51257),Jt=kt(59301),jt=Object.defineProperty,De=Object.getOwnPropertySymbols,ae=Object.prototype.hasOwnProperty,Le=Object.prototype.propertyIsEnumerable,Bt=(pt,vt,St)=>vt in pt?jt(pt,vt,{enumerable:!0,configurable:!0,writable:!0,value:St}):pt[vt]=St,nt=(pt,vt)=>{for(var St in vt||(vt={}))ae.call(vt,St)&&Bt(pt,St,vt[St]);if(De)for(var St of De(vt))Le.call(vt,St)&&Bt(pt,St,vt[St]);return pt},et=(pt,vt,St)=>new Promise((Et,At)=>{var It=Gt=>{try{Ut(St.next(Gt))}catch(ge){At(ge)}},qt=Gt=>{try{Ut(St.throw(Gt))}catch(ge){At(ge)}},Ut=Gt=>Gt.done?Et(Gt.value):Promise.resolve(Gt.value).then(It,qt);Ut((St=St.apply(pt,vt)).next())});const ht=({paperlibrary:pt,user:vt,globalSetting:St,dispatch:Et,location:At})=>{var It,qt,Ut,Gt;const[ge]=(0,Kt.useSearchParams)(),ie=ge.get("select")||0,[Te,ve]=(0,ft.useState)(!1),[ye,Ye]=(0,ft.useState)(!0),[Ze,qe]=(0,ft.useState)(Number(ie)),[pn,te]=(0,ft.useState)({}),Xt=(0,Kt.useParams)(),{userInfo:Qe}=vt,{actionTabs:On}=pt;(0,ft.useEffect)(()=>(Et({type:"globalSetting/footerToggle",payload:!1}),()=>{Et({type:"globalSetting/footerToggle",payload:!0})}),[]),(0,ft.useEffect)(()=>(Et({type:"globalSetting/onlyShowBackTopToggle",payload:!1}),Et({type:"globalSetting/onlyShowBackTopIconToggle",payload:!1}),Et({type:"exercise/getWorkSetting",payload:nt({},Xt)}),()=>{Et({type:"globalSetting/onlyShowBackTopToggle",payload:!0}),Et({type:"globalSetting/onlyShowBackTopIconToggle",payload:!0})}),[]),(0,ft.useEffect)(()=>{En(Ze)},[]),(0,ft.useEffect)(()=>{var he;(he=On==null?void 0:On.params)!=null&&he.isUpdateData&&En(Ze)},[(It=On==null?void 0:On.params)==null?void 0:It.isUpdateData]);const En=(he=0)=>et(void 0,null,function*(){console.log(Xt),Ye(!0);const Ce=yield(0,ee.ZP)(`/api/exercises/${Xt.categoryId}/preview_random_exercise.json`,{method:"get",params:{num:he}});Et({type:"paperlibrary/setActionTabs",payload:{params:{isUpdateData:!1}}}),Ye(!1),te((0,pe.PF)(Ce))}),Ie=()=>{Kt.history.push(`/classrooms/${Xt.coursesId}/exercise`)},on=()=>{alert("\u4FDD\u5B58")},cn=(he,Ce)=>et(void 0,null,function*(){const Yn=yield(0,ee.ZP)(`/api/exercises/${Xt.categoryId}/toggle_random_question.json`,{method:"post",body:{question_id:he==null?void 0:he.single_question_id}});Yn!=null&&Yn.question&&(ue.ZP.info("\u6362\u9898\u6210\u529F"),En(Ze))}),Vn=he=>et(void 0,null,function*(){document.body.scrollIntoView(),qe(he),yield En(he)}),Me=he=>{Et({type:"exercise/setActionTabs",payload:{key:"\u6807\u8BB0\u9519\u9898",params:he}})};return console.log((0,Kt.useLocation)(),"location333"),Jt.createElement("section",{className:le.wrap},Jt.createElement(Dt.Z,{loading:ye,active:!0,paragraph:{rows:5}},((Ut=(qt=(0,Kt.useLocation)())==null?void 0:qt.pathname)==null?void 0:Ut.includes("preview"))&&Jt.createElement("div",{className:le.crumbs},Jt.createElement("b",null),Jt.createElement("span",{className:"current",onClick:()=>Kt.history.push(`/classrooms/${Xt.coursesId}/exercise`)},`${(Gt=Qe==null?void 0:Qe.course)==null?void 0:Gt.course_name}>`),Jt.createElement("span",{className:"current",onClick:()=>Kt.history.push(`/classrooms/${Xt.coursesId}/exercise`)},"\u8BD5\u5377\u5217\u8868>"),Jt.createElement("span",{style:{color:"#bebebe"}},"\u9884\u89C8")),Jt.createElement(we.Z,{loading:Te,submit:on,goBack:Ie,data:pn,getdata:()=>{En(Ze)},selectValue:Ze,editPreview:!0,onExchange:cn,onSkipExamination:Vn,handleMarkWrongQuestion:Me})))};var st=(0,Kt.connect)(({paperlibrary:pt,user:vt,globalSetting:St})=>({paperlibrary:pt,user:vt,globalSetting:St}))(ht)},58433:function(Mn,Rn,kt){"use strict";kt.d(Rn,{g:function(){return ue}});var ft=kt(59301),Kt=kt(93629),le=kt(55305),we=(Dt,ee,pe)=>new Promise((Jt,jt)=>{var De=Bt=>{try{Le(pe.next(Bt))}catch(nt){jt(nt)}},ae=Bt=>{try{Le(pe.throw(Bt))}catch(nt){jt(nt)}},Le=Bt=>Bt.done?Jt(Bt.value):Promise.resolve(Bt.value).then(De,ae);Le((pe=pe.apply(Dt,ee)).next())});const ue=()=>{const[Dt,ee]=(0,ft.useState)([]);return(0,ft.useEffect)(()=>{we(void 0,null,function*(){const Jt=yield(0,Kt.d1)({source:"question"});Jt!=null&&Jt.disciplines&&ee((0,le.L)(Jt==null?void 0:Jt.disciplines))})},[]),Dt}},45937:function(Mn,Rn,kt){"use strict";kt.d(Rn,{U:function(){return Jt}});var ft=kt(59301),Kt=Object.defineProperty,le=Object.getOwnPropertySymbols,we=Object.prototype.hasOwnProperty,ue=Object.prototype.propertyIsEnumerable,Dt=(jt,De,ae)=>De in jt?Kt(jt,De,{enumerable:!0,configurable:!0,writable:!0,value:ae}):jt[De]=ae,ee=(jt,De)=>{for(var ae in De||(De={}))we.call(De,ae)&&Dt(jt,ae,De[ae]);if(le)for(var ae of le(De))ue.call(De,ae)&&Dt(jt,ae,De[ae]);return jt},pe=(jt,De,ae)=>new Promise((Le,Bt)=>{var nt=st=>{try{ht(ae.next(st))}catch(pt){Bt(pt)}},et=st=>{try{ht(ae.throw(st))}catch(pt){Bt(pt)}},ht=st=>st.done?Le(st.value):Promise.resolve(st.value).then(nt,et);ht((ae=ae.apply(jt,De)).next())});function Jt(jt,De){const[ae,Le]=(0,ft.useState)(De),[Bt,nt]=(0,ft.useState)(!1),[et,ht]=(0,ft.useState)();return[ae,Bt,(pt,vt=!1)=>pe(this,null,function*(){const St=vt?De:ee(ee({},ae),pt);nt(!0),Le(St);const Et=yield jt(St);return nt(!1),ht(Et),Et}),et,ht]}},81428:function(Mn,Rn,kt){"use strict";kt.d(Rn,{AL:function(){return St},Iy:function(){return De},Qv:function(){return Bt},ez:function(){return vt},jb:function(){return ae}});var ft=kt(32834),Kt=kt.n(ft),le=kt(11690),we=kt.n(le);let ue=1;function Dt(Ut,Gt){const ge=Ut.match(/^(\s+)(?:```)/);if(ge===null)return Gt;const ie=ge[1];return Gt.split(`
|
|
`).map(Te=>{const ve=Te.match(/^\s+/);if(ve===null)return Te;const[ye]=ve;return ye.length>=ie.length?Te.slice(ie.length):Te}).join(`
|
|
`)}let ee=[],pe=["<ul>"];const Jt=new(Kt()).Renderer,jt=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function De(){ee.length=0,pe=["<ul>"]}const ae={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function Le(Ut,Gt,ge,ie){if(Gt>=Ut.length||Ut[Gt].level<=ge)return Gt;var Te=Ut[Gt];ie.push("<li><a href='#"+ue+Te.anchor+"'>"+Te.text+"</a>"),Gt++;var ve=[];return Gt=Le(Ut,Gt,Te.level,ve),ve.length>0&&(ie.push("<ul>"),ve.forEach(function(ye){ie.push(ye)}),ie.push("</ul>")),ie.push("</li>"),Gt=Le(Ut,Gt,ge,ie),Gt}function Bt(){return Le(ee,0,0,pe),pe.push("</ul>"),pe.join("")}const nt={heading(Ut){const Gt=jt.exec(Ut);if(ue+=1,Gt)return{type:"heading",raw:Gt[0],depth:Gt[1].length,text:Gt[2]}},fences(Ut){const Gt=this.rules.block.fences.exec(Ut);if(Gt){const ge=Gt[0];let ie=Dt(ge,Gt[3]||"");const Te=Gt[2]?Gt[2].trim():Gt[2];if(["latex","katex","math"].indexOf(Te)>=0){const ve=st(),ye=ie;ie=ve,pt[ve]={type:"block",expression:ye}}return{type:"code",raw:ge,lang:Te,text:ie}}}},et=/(?:\${2})([^\n`]+?)(?:\${2})/gi;let ht=0;const st=()=>`__special_katext_id_${ht++}__`;let pt={};function vt(){return pt}function St(){ht=0,pt={}}function Et(Ut){return Ut=Ut.replace(et,(Gt,ge)=>{const ie=st();return pt[ie]={type:"inline",expression:ge},ie}),Ut}const At=Jt.listitem;Jt.listitem=function(Ut){return At(Et(Ut))};const It=Jt.paragraph;Jt.paragraph=function(Ut){return It(Et(Ut))};const qt=Jt.tablecell;Jt.tablecell=function(Ut,Gt){return qt(Et(Ut),Gt)},Jt.code=function(Ut,Gt,ge){const ie=(Gt||"").match(/\S*/)[0];return ie?["latex","katex","math"].indexOf(ie)>=0?`<p class='editormd-tex'>${Ut}</p>`:`<pre class="prettyprint linenums"><code class="language-${Gt}">${ge?Ut:(0,le.escape)(Ut,!0)}</code></pre>
|
|
`:'<pre class="prettyprint linenums"><code>'+(ge?Ut:(0,le.escape)(Ut,!0))+"</code></pre>"},Jt.heading=function(Ut,Gt,ge){let ie=this.options.headerPrefix+ge.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return ee.push({anchor:ie,level:Gt,text:Ut}),"<h"+Gt+' id="'+ue+ie+'">'+Ut+"</h"+Gt+">"},Kt().setOptions({silent:!0,gfm:!0,pedantic:!1}),Kt().use({tokenizer:nt,renderer:Jt}),Rn.ZP=Kt()},99498:function(Mn,Rn,kt){(function(ft){ft(kt(89780))})(function(ft){ft.defineOption("placeholder","",function(pe,Jt,jt){var De=jt&&jt!=ft.Init;if(Jt&&!De)pe.on("blur",ue),pe.on("change",Dt),pe.on("swapDoc",Dt),ft.on(pe.getInputField(),"compositionupdate",pe.state.placeholderCompose=function(){we(pe)}),Dt(pe);else if(!Jt&&De){pe.off("blur",ue),pe.off("change",Dt),pe.off("swapDoc",Dt),ft.off(pe.getInputField(),"compositionupdate",pe.state.placeholderCompose),Kt(pe);var ae=pe.getWrapperElement();ae.className=ae.className.replace(" CodeMirror-empty","")}Jt&&!pe.hasFocus()&&ue(pe)});function Kt(pe){pe.state.placeholder&&(pe.state.placeholder.parentNode.removeChild(pe.state.placeholder),pe.state.placeholder=null)}function le(pe){Kt(pe);var Jt=pe.state.placeholder=document.createElement("pre");Jt.style.cssText="height: 0; overflow: visible",Jt.style.direction=pe.getOption("direction"),Jt.className="CodeMirror-placeholder CodeMirror-line-like";var jt=pe.getOption("placeholder");typeof jt=="string"&&(jt=document.createTextNode(jt)),Jt.appendChild(jt),pe.display.lineSpace.insertBefore(Jt,pe.display.lineSpace.firstChild)}function we(pe){setTimeout(function(){var Jt=!1,jt=pe.getInputField();jt.nodeName=="TEXTAREA"?Jt=!jt.value:pe.lineCount()==1&&(Jt=!/[^\u200b]/.test(jt.querySelector(".CodeMirror-line").textContent)),Jt?le(pe):Kt(pe)},20)}function ue(pe){ee(pe)&&le(pe)}function Dt(pe){var Jt=pe.getWrapperElement(),jt=ee(pe);Jt.className=Jt.className.replace(" CodeMirror-empty","")+(jt?" CodeMirror-empty":""),jt?le(pe):Kt(pe)}function ee(pe){return pe.lineCount()===1&&pe.getLine(0)===""}})},25717:function(Mn,Rn,kt){(function(ft){ft(kt(89780))})(function(ft){var Kt={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},le=ft.Pos;ft.defineOption("autoCloseBrackets",!1,function(nt,et,ht){ht&&ht!=ft.Init&&(nt.removeKeyMap(ue),nt.state.closeBrackets=null),et&&(Dt(we(et,"pairs")),nt.state.closeBrackets=et,nt.addKeyMap(ue))});function we(nt,et){return et=="pairs"&&typeof nt=="string"?nt:typeof nt=="object"&&nt[et]!=null?nt[et]:Kt[et]}var ue={Backspace:Jt,Enter:jt};function Dt(nt){for(var et=0;et<nt.length;et++){var ht=nt.charAt(et),st="'"+ht+"'";ue[st]||(ue[st]=ee(ht))}}Dt(Kt.pairs+"`");function ee(nt){return function(et){return ae(et,nt)}}function pe(nt){var et=nt.state.closeBrackets;if(!et||et.override)return et;var ht=nt.getModeAt(nt.getCursor());return ht.closeBrackets||et}function Jt(nt){var et=pe(nt);if(!et||nt.getOption("disableInput"))return ft.Pass;for(var ht=we(et,"pairs"),st=nt.listSelections(),pt=0;pt<st.length;pt++){if(!st[pt].empty())return ft.Pass;var vt=Le(nt,st[pt].head);if(!vt||ht.indexOf(vt)%2!=0)return ft.Pass}for(var pt=st.length-1;pt>=0;pt--){var St=st[pt].head;nt.replaceRange("",le(St.line,St.ch-1),le(St.line,St.ch+1),"+delete")}}function jt(nt){var et=pe(nt),ht=et&&we(et,"explode");if(!ht||nt.getOption("disableInput"))return ft.Pass;for(var st=nt.listSelections(),pt=0;pt<st.length;pt++){if(!st[pt].empty())return ft.Pass;var vt=Le(nt,st[pt].head);if(!vt||ht.indexOf(vt)%2!=0)return ft.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 At=st[Et].head.line;nt.indentLine(At,null,!0),nt.indentLine(At+1,null,!0)}})}function De(nt){var et=ft.cmpPos(nt.anchor,nt.head)>0;return{anchor:new le(nt.anchor.line,nt.anchor.ch+(et?-1:1)),head:new le(nt.head.line,nt.head.ch+(et?1:-1))}}function ae(nt,et){var ht=pe(nt);if(!ht||nt.getOption("disableInput"))return ft.Pass;var st=we(ht,"pairs"),pt=st.indexOf(et);if(pt==-1)return ft.Pass;for(var vt=we(ht,"closeBefore"),St=we(ht,"triples"),Et=st.charAt(pt+1)==et,At=nt.listSelections(),It=pt%2==0,qt,Ut=0;Ut<At.length;Ut++){var Gt=At[Ut],ge=Gt.head,ie,Te=nt.getRange(ge,le(ge.line,ge.ch+1));if(It&&!Gt.empty())ie="surround";else if((Et||!It)&&Te==et)Et&&Bt(nt,ge)?ie="both":St.indexOf(et)>=0&&nt.getRange(ge,le(ge.line,ge.ch+3))==et+et+et?ie="skipThree":ie="skip";else if(Et&&ge.ch>1&&St.indexOf(et)>=0&&nt.getRange(le(ge.line,ge.ch-2),ge)==et+et){if(ge.ch>2&&/\bstring/.test(nt.getTokenTypeAt(le(ge.line,ge.ch-2))))return ft.Pass;ie="addFour"}else if(Et){var ve=ge.ch==0?" ":nt.getRange(le(ge.line,ge.ch-1),ge);if(!ft.isWordChar(Te)&&ve!=et&&!ft.isWordChar(ve))ie="both";else return ft.Pass}else if(It&&(Te.length===0||/\s/.test(Te)||vt.indexOf(Te)>-1))ie="both";else return ft.Pass;if(!qt)qt=ie;else if(qt!=ie)return ft.Pass}var ye=pt%2?st.charAt(pt-1):et,Ye=pt%2?et:st.charAt(pt+1);nt.operation(function(){if(qt=="skip")nt.execCommand("goCharRight");else if(qt=="skipThree")for(var Ze=0;Ze<3;Ze++)nt.execCommand("goCharRight");else if(qt=="surround"){for(var qe=nt.getSelections(),Ze=0;Ze<qe.length;Ze++)qe[Ze]=ye+qe[Ze]+Ye;nt.replaceSelections(qe,"around"),qe=nt.listSelections().slice();for(var Ze=0;Ze<qe.length;Ze++)qe[Ze]=De(qe[Ze]);nt.setSelections(qe)}else qt=="both"?(nt.replaceSelection(ye+Ye,null),nt.triggerElectric(ye+Ye),nt.execCommand("goCharLeft")):qt=="addFour"&&(nt.replaceSelection(ye+ye+ye+ye,"before"),nt.execCommand("goCharRight"))})}function Le(nt,et){var ht=nt.getRange(le(et.line,et.ch-1),le(et.line,et.ch+1));return ht.length==2?ht:null}function Bt(nt,et){var ht=nt.getTokenAt(le(et.line,et.ch+1));return/\bstring/.test(ht.type)&&ht.start==et.ch&&(et.ch==0||!/\bstring/.test(nt.getTokenTypeAt(et)))}})},6313:function(Mn,Rn,kt){(function(ft){ft(kt(89780),kt(32855))})(function(ft){ft.defineOption("autoCloseTags",!1,function(Jt,jt,De){if(De!=ft.Init&&De&&Jt.removeKeyMap("autoCloseTags"),!!jt){var ae={name:"autoCloseTags"};(typeof jt!="object"||jt.whenClosing!==!1)&&(ae["'/'"]=function(Le){return Dt(Le)}),(typeof jt!="object"||jt.whenOpening!==!1)&&(ae["'>'"]=function(Le){return we(Le)}),Jt.addKeyMap(ae)}});var Kt=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],le=["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 we(Jt){if(Jt.getOption("disableInput"))return ft.Pass;for(var jt=Jt.listSelections(),De=[],ae=Jt.getOption("autoCloseTags"),Le=0;Le<jt.length;Le++){if(!jt[Le].empty())return ft.Pass;var Bt=jt[Le].head,nt=Jt.getTokenAt(Bt),et=ft.innerMode(Jt.getMode(),nt.state),ht=et.state,st=et.mode.xmlCurrentTag&&et.mode.xmlCurrentTag(ht),pt=st&&st.name;if(!pt)return ft.Pass;var vt=et.mode.configuration=="html",St=typeof ae=="object"&&ae.dontCloseTags||vt&&Kt,Et=typeof ae=="object"&&ae.indentTags||vt&≤nt.end>Bt.ch&&(pt=pt.slice(0,pt.length-nt.end+Bt.ch));var At=pt.toLowerCase();if(!pt||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&&ee(St,At)>-1||pe(Jt,et.mode.xmlCurrentContext&&et.mode.xmlCurrentContext(ht)||[],pt,Bt,!0))return ft.Pass;var It=typeof ae=="object"&&ae.emptyTags;if(It&&ee(It,pt)>-1){De[Le]={text:"/>",newPos:ft.Pos(Bt.line,Bt.ch+2)};continue}var qt=Et&&ee(Et,At)>-1;De[Le]={indent:qt,text:">"+(qt?`
|
|
|
|
`:"")+"</"+pt+">",newPos:qt?ft.Pos(Bt.line+1,0):ft.Pos(Bt.line,Bt.ch+1)}}for(var Ut=typeof ae=="object"&&ae.dontIndentOnAutoClose,Le=jt.length-1;Le>=0;Le--){var Gt=De[Le];Jt.replaceRange(Gt.text,jt[Le].head,jt[Le].anchor,"+insert");var ge=Jt.listSelections().slice(0);ge[Le]={head:Gt.newPos,anchor:Gt.newPos},Jt.setSelections(ge),!Ut&&Gt.indent&&(Jt.indentLine(Gt.newPos.line,null,!0),Jt.indentLine(Gt.newPos.line+1,null,!0))}}function ue(Jt,jt){for(var De=Jt.listSelections(),ae=[],Le=jt?"/":"</",Bt=Jt.getOption("autoCloseTags"),nt=typeof Bt=="object"&&Bt.dontIndentOnSlash,et=0;et<De.length;et++){if(!De[et].empty())return ft.Pass;var ht=De[et].head,st=Jt.getTokenAt(ht),pt=ft.innerMode(Jt.getMode(),st.state),vt=pt.state;if(jt&&(st.type=="string"||st.string.charAt(0)!="<"||st.start!=ht.ch-1))return ft.Pass;var St,Et=pt.mode.name!="xml"&&Jt.getMode().name=="htmlmixed";if(Et&&pt.mode.name=="javascript")St=Le+"script";else if(Et&&pt.mode.name=="css")St=Le+"style";else{var At=pt.mode.xmlCurrentContext&&pt.mode.xmlCurrentContext(vt);if(!At||At.length&&pe(Jt,At,At[At.length-1],ht))return ft.Pass;St=Le+At[At.length-1]}Jt.getLine(ht.line).charAt(st.end)!=">"&&(St+=">"),ae[et]=St}if(Jt.replaceSelections(ae),De=Jt.listSelections(),!nt)for(var et=0;et<De.length;et++)(et==De.length-1||De[et].head.line<De[et+1].head.line)&&Jt.indentLine(De[et].head.line)}function Dt(Jt){return Jt.getOption("disableInput")?ft.Pass:ue(Jt,!0)}ft.commands.closeTag=function(Jt){return ue(Jt)};function ee(Jt,jt){if(Jt.indexOf)return Jt.indexOf(jt);for(var De=0,ae=Jt.length;De<ae;++De)if(Jt[De]==jt)return De;return-1}function pe(Jt,jt,De,ae,Le){if(!ft.scanForClosingTag)return!1;var Bt=Math.min(Jt.lastLine()+1,ae.line+500),nt=ft.scanForClosingTag(Jt,ae,null,Bt);if(!nt||nt.tag!=De)return!1;for(var et=Le?1:0,ht=jt.length-1;ht>=0&&jt[ht]==De;ht--)++et;ae=nt.to;for(var ht=1;ht<et;ht++){var st=ft.scanForClosingTag(Jt,ae,null,Bt);if(!st||st.tag!=De)return!1;ae=st.to}return!0}})},32855:function(Mn,Rn,kt){(function(ft){ft(kt(89780))})(function(ft){"use strict";var Kt=ft.Pos;function le(ht,st){return ht.line-st.line||ht.ch-st.ch}var we="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",ue=we+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",Dt=new RegExp("<(/?)(["+we+"]["+ue+"]*)","g");function ee(ht,st,pt,vt){this.line=st,this.ch=pt,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 pe(ht,st){var pt=ht.cm.getTokenTypeAt(Kt(ht.line,st));return pt&&/\btag\b/.test(pt)}function Jt(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 De(ht){for(;;){var st=ht.text.indexOf(">",ht.ch);if(st==-1){if(Jt(ht))continue;return}if(!pe(ht,st+1)){ht.ch=st+1;continue}var pt=ht.text.lastIndexOf("/",st),vt=pt>-1&&!/\S/.test(ht.text.slice(pt+1,st));return ht.ch=st+1,vt?"selfClose":"regular"}}function ae(ht){for(;;){var st=ht.ch?ht.text.lastIndexOf("<",ht.ch-1):-1;if(st==-1){if(jt(ht))continue;return}if(!pe(ht,st+1)){ht.ch=st;continue}Dt.lastIndex=st,ht.ch=st;var pt=Dt.exec(ht.text);if(pt&&pt.index==st)return pt}}function Le(ht){for(;;){Dt.lastIndex=ht.ch;var st=Dt.exec(ht.text);if(!st){if(Jt(ht))continue;return}if(!pe(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(!pe(ht,st+1)){ht.ch=st;continue}var pt=ht.text.lastIndexOf("/",st),vt=pt>-1&&!/\S/.test(ht.text.slice(pt+1,st));return ht.ch=st+1,vt?"selfClose":"regular"}}function nt(ht,st){for(var pt=[];;){var vt=Le(ht),St,Et=ht.line,At=ht.ch-(vt?vt[0].length:0);if(!vt||!(St=De(ht)))return;if(St!="selfClose")if(vt[1]){for(var It=pt.length-1;It>=0;--It)if(pt[It]==vt[2]){pt.length=It;break}if(It<0&&(!st||st==vt[2]))return{tag:vt[2],from:Kt(Et,At),to:Kt(ht.line,ht.ch)}}else pt.push(vt[2])}}function et(ht,st){for(var pt=[];;){var vt=Bt(ht);if(!vt)return;if(vt=="selfClose"){ae(ht);continue}var St=ht.line,Et=ht.ch,At=ae(ht);if(!At)return;if(At[1])pt.push(At[2]);else{for(var It=pt.length-1;It>=0;--It)if(pt[It]==At[2]){pt.length=It;break}if(It<0&&(!st||st==At[2]))return{tag:At[2],from:Kt(ht.line,ht.ch),to:Kt(St,Et)}}}}ft.registerHelper("fold","xml",function(ht,st){for(var pt=new ee(ht,st.line,0);;){var vt=Le(pt);if(!vt||pt.line!=st.line)return;var St=De(pt);if(!St)return;if(!vt[1]&&St!="selfClose"){var Et=Kt(pt.line,pt.ch),At=nt(pt,vt[2]);return At&&le(At.from,Et)>0?{from:Et,to:At.from}:null}}}),ft.findMatchingTag=function(ht,st,pt){var vt=new ee(ht,st.line,st.ch,pt);if(!(vt.text.indexOf(">")==-1&&vt.text.indexOf("<")==-1)){var St=De(vt),Et=St&&Kt(vt.line,vt.ch),At=St&&ae(vt);if(!(!St||!At||le(vt,st)>0)){var It={from:Kt(vt.line,vt.ch),to:Et,tag:At[2]};return St=="selfClose"?{open:It,close:null,at:"open"}:At[1]?{open:et(vt,At[2]),close:It,at:"close"}:(vt=new ee(ht,Et.line,Et.ch,pt),{open:It,close:nt(vt,At[2]),at:"open"})}}},ft.findEnclosingTag=function(ht,st,pt,vt){for(var St=new ee(ht,st.line,st.ch,pt);;){var Et=et(St,vt);if(!Et)break;var At=new ee(ht,st.line,st.ch,pt),It=nt(At,Et.tag);if(It)return{open:Et,close:It}}},ft.scanForClosingTag=function(ht,st,pt,vt){var St=new ee(ht,st.line,st.ch,vt?{from:0,to:vt}:null);return nt(St,pt)}})},89780:function(Mn){(function(Rn,kt){Mn.exports=kt()})(this,function(){"use strict";var Rn=navigator.userAgent,kt=navigator.platform,ft=/gecko\/\d/i.test(Rn),Kt=/MSIE \d/.test(Rn),le=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Rn),we=/Edge\/(\d+)/.exec(Rn),ue=Kt||le||we,Dt=ue&&(Kt?document.documentMode||6:+(we||le)[1]),ee=!we&&/WebKit\//.test(Rn),pe=ee&&/Qt\/\d+\.\d+/.test(Rn),Jt=!we&&/Chrome\//.test(Rn),jt=/Opera\//.test(Rn),De=/Apple Computer/.test(navigator.vendor),ae=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(Rn),Le=/PhantomJS/.test(Rn),Bt=!we&&/AppleWebKit/.test(Rn)&&/Mobile\/\w+/.test(Rn),nt=/Android/.test(Rn),et=Bt||nt||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(Rn),ht=Bt||/Mac/.test(kt),st=/\bCrOS\b/.test(Rn),pt=/win/i.test(kt),vt=jt&&Rn.match(/Version\/(\d*\.\d*)/);vt&&(vt=Number(vt[1])),vt&&vt>=15&&(jt=!1,ee=!0);var St=ht&&(pe||jt&&(vt==null||vt<12.11)),Et=ft||ue&&Dt>=9;function At(it){return new RegExp("(^|\\s)"+it+"(?:$|\\s)\\s*")}var It=function(it,at){var ct=it.className,dt=At(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 qt(it){for(var at=it.childNodes.length;at>0;--at)it.removeChild(it.firstChild);return it}function Ut(it,at){return qt(it).appendChild(at)}function Gt(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 Lt=0;Lt<at.length;++Lt)mt.appendChild(at[Lt]);return mt}function ge(it,at,ct,dt){var mt=Gt(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 Te(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 ve(){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 ye(it,at){var ct=it.className;At(at).test(ct)||(it.className+=(ct?" ":"")+at)}function Ye(it,at){for(var ct=it.split(" "),dt=0;dt<ct.length;dt++)ct[dt]&&!At(ct[dt]).test(at)&&(at+=" "+ct[dt]);return at}var Ze=function(it){it.select()};Bt?Ze=function(it){it.selectionStart=0,it.selectionEnd=it.value.length}:ue&&(Ze=function(it){try{it.select()}catch(at){}});function qe(it){var at=Array.prototype.slice.call(arguments,1);return function(){return it.apply(null,at)}}function pn(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 te(it,at,ct,dt,mt){at==null&&(at=it.search(/[^\s\u00a0]/),at==-1&&(at=it.length));for(var Lt=dt||0,Ot=mt||0;;){var Vt=it.indexOf(" ",Lt);if(Vt<0||Vt>=at)return Ot+(at-Lt);Ot+=Vt-Lt,Ot+=ct-Ot%ct,Lt=Vt+1}}var Xt=function(){this.id=null,this.f=null,this.time=0,this.handler=qe(this.onTimeout,this)};Xt.prototype.onTimeout=function(it){it.id=0,it.time<=+new Date?it.f():setTimeout(it.handler,it.time-+new Date)},Xt.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 Qe(it,at){for(var ct=0;ct<it.length;++ct)if(it[ct]==at)return ct;return-1}var On=50,En={toString:function(){return"CodeMirror.Pass"}},Ie={scroll:!1},on={origin:"*mouse"},cn={origin:"+move"};function Vn(it,at,ct){for(var dt=0,mt=0;;){var Lt=it.indexOf(" ",dt);Lt==-1&&(Lt=it.length);var Ot=Lt-dt;if(Lt==it.length||mt+Ot>=at)return dt+Math.min(Ot,at-mt);if(mt+=Lt-dt,mt+=ct-mt%ct,dt=Lt+1,mt>=at)return dt}}var Me=[""];function he(it){for(;Me.length<=it;)Me.push(Ce(Me)+" ");return Me[it]}function Ce(it){return it[it.length-1]}function Yn(it,at){for(var ct=[],dt=0;dt<it.length;dt++)ct[dt]=at(it[dt],dt);return ct}function Si(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 Ft(it,at){var ct;return Object.create?ct=Object.create(it):(Rt.prototype=it,ct=new Rt),at&&pn(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 He(it){return it.charCodeAt(0)>=768&&Yt.test(it)}function _e(it,at,ct){for(;(ct<0?at>0:at<it.length)&&He(it.charAt(at));)at+=ct;return at}function Xe(it,at,ct){for(var dt=at>ct?-1:1;;){if(at==ct)return at;var mt=(at+ct)/2,Lt=dt<0?Math.ceil(mt):Math.floor(mt);if(Lt==at)return it(Lt)?at:ct;it(Lt)?ct=Lt:at=Lt+dt}}function xe(it,at,ct,dt){if(!it)return dt(at,ct,"ltr",0);for(var mt=!1,Lt=0;Lt<it.length;++Lt){var Ot=it[Lt];(Ot.from<ct&&Ot.to>at||at==ct&&Ot.to==at)&&(dt(Math.max(Ot.from,at),Math.min(Ot.to,ct),Ot.level==1?"rtl":"ltr",Lt),mt=!0)}mt||dt(at,ct,"ltr")}var Pe=null;function ke(it,at,ct){var dt;Pe=null;for(var mt=0;mt<it.length;++mt){var Lt=it[mt];if(Lt.from<at&&Lt.to>at)return mt;Lt.to==at&&(Lt.from!=Lt.to&&ct=="before"?dt=mt:Pe=mt),Lt.from==at&&(Lt.from!=Lt.to&&ct!="before"?dt=mt:Pe=mt)}return dt!=null?dt:Pe}var Ve=function(){var it="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",at="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function ct(se){return se<=247?it.charAt(se):1424<=se&&se<=1524?"R":1536<=se&&se<=1785?at.charAt(se-1536):1774<=se&&se<=2220?"r":8192<=se&&se<=8203?"w":se==8204?"b":"L"}var dt=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,mt=/[stwN]/,Lt=/[LRr]/,Ot=/[Lb1n]/,Vt=/[1n]/;function Ht(se,We,fe){this.level=se,this.from=We,this.to=fe}return function(se,We){var fe=We=="ltr"?"L":"R";if(se.length==0||We=="ltr"&&!dt.test(se))return!1;for(var Sn=se.length,ln=[],Mi=0;Mi<Sn;++Mi)ln.push(ct(se.charCodeAt(Mi)));for(var Bi=0,_i=fe;Bi<Sn;++Bi){var rr=ln[Bi];rr=="m"?ln[Bi]=_i:_i=rr}for(var jr=0,xr=fe;jr<Sn;++jr){var Kr=ln[jr];Kr=="1"&&xr=="r"?ln[jr]="n":Lt.test(Kr)&&(xr=Kr,Kr=="r"&&(ln[jr]="R"))}for(var Eo=1,yr=ln[0];Eo<Sn-1;++Eo){var Ho=ln[Eo];Ho=="+"&&yr=="1"&&ln[Eo+1]=="1"?ln[Eo]="1":Ho==","&&yr==ln[Eo+1]&&(yr=="1"||yr=="n")&&(ln[Eo]=yr),yr=Ho}for(var ka=0;ka<Sn;++ka){var ds=ln[ka];if(ds==",")ln[ka]="N";else if(ds=="%"){var za=void 0;for(za=ka+1;za<Sn&&ln[za]=="%";++za);for(var ll=ka&&ln[ka-1]=="!"||za<Sn&&ln[za]=="1"?"1":"N",Gs=ka;Gs<za;++Gs)ln[Gs]=ll;ka=za-1}}for(var os=0,Pl=fe;os<Sn;++os){var As=ln[os];Pl=="L"&&As=="1"?ln[os]="L":Lt.test(As)&&(Pl=As)}for(var as=0;as<Sn;++as)if(mt.test(ln[as])){var ta=void 0;for(ta=as+1;ta<Sn&&mt.test(ln[ta]);++ta);for(var Wa=(as?ln[as-1]:fe)=="L",ys=(ta<Sn?ln[ta]:fe)=="L",Ts=Wa==ys?Wa?"L":"R":fe,fu=as;fu<ta;++fu)ln[fu]=Ts;as=ta-1}for(var Za=[],ql,Ua=0;Ua<Sn;)if(Ot.test(ln[Ua])){var Dc=Ua;for(++Ua;Ua<Sn&&Ot.test(ln[Ua]);++Ua);Za.push(new Ht(0,Dc,Ua))}else{var _l=Ua,wl=Za.length,ul=We=="rtl"?1:0;for(++Ua;Ua<Sn&&ln[Ua]!="L";++Ua);for(var ma=_l;ma<Ua;)if(Vt.test(ln[ma])){_l<ma&&(Za.splice(wl,0,new Ht(1,_l,ma)),wl+=ul);var Ss=ma;for(++ma;ma<Ua&&Vt.test(ln[ma]);++ma);Za.splice(wl,0,new Ht(2,Ss,ma)),wl+=ul,_l=ma}else++ma;_l<Ua&&Za.splice(wl,0,new Ht(1,_l,Ua))}return We=="ltr"&&(Za[0].level==1&&(ql=se.match(/^\s+/))&&(Za[0].from=ql[0].length,Za.unshift(new Ht(0,0,ql[0].length))),Ce(Za).level==1&&(ql=se.match(/\s+$/))&&(Ce(Za).to-=ql[0].length,Za.push(new Ht(0,Sn-ql[0].length,Sn)))),We=="rtl"?Za.reverse():Za}}();function tn(it,at){var ct=it.order;return ct==null&&(ct=it.order=Ve(it.text,at)),ct}var dn=[],fn=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]||dn).concat(ct)}};function ni(it,at){return it._handlers&&it._handlers[at]||dn}function Ge(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 Lt=Qe(mt,ct);Lt>-1&&(dt[at]=mt.slice(0,Lt).concat(mt.slice(Lt+1)))}}}function Ke(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}}),Ke(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)Qe(ct,at[dt])==-1&&ct.push(at[dt])}function gn(it,at){return ni(it,at).length>0}function an(it){it.prototype.on=function(at,ct){fn(this,at,ct)},it.prototype.off=function(at,ct){Ge(this,at,ct)}}function zn(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 wi(it){zn(it),gi(it)}function Wi(it){return it.target||it.srcElement}function Cn(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 Pn=function(){if(ue&&Dt<9)return!1;var it=Gt("div");return"draggable"in it||"dragDrop"in it}(),Bn;function si(it){if(Bn==null){var at=Gt("span","\u200B");Ut(it,Gt("span",[at,document.createTextNode("x")])),it.firstChild.offsetHeight!=0&&(Bn=at.offsetWidth<=1&&at.offsetHeight>2&&!(ue&&Dt<8))}var ct=Bn?Gt("span","\u200B"):Gt("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return ct.setAttribute("cm-text",""),ct}var Ei;function ci(it){if(Ei!=null)return Ei;var at=Ut(it,document.createTextNode("A\u062EA")),ct=ie(at,0,1).getBoundingClientRect(),dt=ie(at,1,2).getBoundingClientRect();return qt(it),!ct||ct.left==ct.right?!1:Ei=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 Lt=it.slice(at,it.charAt(mt-1)=="\r"?mt-1:mt),Ot=Lt.indexOf("\r");Ot!=-1?(ct.push(Lt.slice(0,Ot)),at+=Ot+1):(ct.push(Lt),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},Je=function(){var it=Gt("div");return"oncopy"in it?!0:(it.setAttribute("oncopy","return;"),typeof it.oncopy=="function")}(),Hn=null;function Ln(it){if(Hn!=null)return Hn;var at=Ut(it,Gt("span","x")),ct=at.getBoundingClientRect(),dt=ie(at,0,1).getBoundingClientRect();return Hn=Math.abs(ct.left-dt.left)>1}var jn={},li={};function Ci(it,at){arguments.length>2&&(at.dependencies=Array.prototype.slice.call(arguments,2)),jn[it]=at}function Yi(it,at){li[it]=at}function Be(it){if(typeof it=="string"&&li.hasOwnProperty(it))it=li[it];else if(it&&typeof it.name=="string"&&li.hasOwnProperty(it.name)){var at=li[it.name];typeof at=="string"&&(at={name:at}),it=Ft(at,it),it.name=at.name}else{if(typeof it=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(it))return Be("application/xml");if(typeof it=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(it))return Be("application/json")}return typeof it=="string"?{name:it}:it||{name:"null"}}function Se(it,at){at=Be(at);var ct=jn[at.name];if(!ct)return Se(it,"text/plain");var dt=ct(it,at);if(Ee.hasOwnProperty(at.name)){var mt=Ee[at.name];for(var Lt in mt)mt.hasOwnProperty(Lt)&&(dt.hasOwnProperty(Lt)&&(dt["_"+Lt]=dt[Lt]),dt[Lt]=mt[Lt])}if(dt.name=at.name,at.helperType&&(dt.helperType=at.helperType),at.modeProps)for(var Ot in at.modeProps)dt[Ot]=at.modeProps[Ot];return dt}var Ee={};function Ue(it,at){var ct=Ee.hasOwnProperty(it)?Ee[it]:Ee[it]={};pn(at,ct)}function xi(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 Kn(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 Pi(it,at,ct){return it.startState?it.startState(at,ct):!0}var $e=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};$e.prototype.eol=function(){return this.pos>=this.string.length},$e.prototype.sol=function(){return this.pos==this.lineStart},$e.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},$e.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},$e.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},$e.prototype.eatWhile=function(it){for(var at=this.pos;this.eat(it););return this.pos>at},$e.prototype.eatSpace=function(){for(var it=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>it},$e.prototype.skipToEnd=function(){this.pos=this.string.length},$e.prototype.skipTo=function(it){var at=this.string.indexOf(it,this.pos);if(at>-1)return this.pos=at,!0},$e.prototype.backUp=function(it){this.pos-=it},$e.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=te(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?te(this.string,this.lineStart,this.tabSize):0)},$e.prototype.indentation=function(){return te(this.string,null,this.tabSize)-(this.lineStart?te(this.string,this.lineStart,this.tabSize):0)},$e.prototype.match=function(it,at,ct){if(typeof it=="string"){var dt=function(Ot){return ct?Ot.toLowerCase():Ot},mt=this.string.substr(this.pos,it.length);if(dt(mt)==dt(it))return at!==!1&&(this.pos+=it.length),!0}else{var Lt=this.string.slice(this.pos).match(it);return Lt&&Lt.index>0?null:(Lt&&at!==!1&&(this.pos+=Lt[0].length),Lt)}},$e.prototype.current=function(){return this.string.slice(this.start,this.pos)},$e.prototype.hideFirstChars=function(it,at){this.lineStart+=it;try{return at()}finally{this.lineStart-=it}},$e.prototype.lookAhead=function(it){var at=this.lineOracle;return at&&at.lookAhead(it)},$e.prototype.baseToken=function(){var it=this.lineOracle;return it&&it.baseToken(this.pos)};function Gn(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],Lt=mt.chunkSize();if(at<Lt){ct=mt;break}at-=Lt}return ct.lines[at]}function Ai(it,at,ct){var dt=[],mt=at.line;return it.iter(at.line,ct.line+1,function(Lt){var Ot=Lt.text;mt==ct.line&&(Ot=Ot.slice(0,ct.ch)),mt==at.line&&(Ot=Ot.slice(at.ch)),dt.push(Ot),++mt}),dt}function ji(it,at,ct){var dt=[];return it.iter(at,ct,function(mt){dt.push(mt.text)}),dt}function Tn(it,at){var ct=at-it.height;if(ct)for(var dt=it;dt;dt=dt.parent)dt.height+=ct}function Qt(it){if(it.parent==null)return null;for(var at=it.parent,ct=Qe(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 me(it,at){var ct=it.first;t:do{for(var dt=0;dt<it.children.length;++dt){var mt=it.children[dt],Lt=mt.height;if(at<Lt){it=mt;continue t}at-=Lt,ct+=mt.chunkSize()}return ct}while(!it.lines);for(var Ot=0;Ot<it.lines.length;++Ot){var Vt=it.lines[Ot],Ht=Vt.height;if(at<Ht)break;at-=Ht}return ct+Ot}function bn(it,at){return at>=it.first&&at<it.first+it.size}function _n(it,at){return String(it.lineNumberFormatter(at+it.firstLineNumber))}function ze(it,at,ct){if(ct===void 0&&(ct=null),!(this instanceof ze))return new ze(it,at,ct);this.line=it,this.ch=at,this.sticky=ct}function hn(it,at){return it.line-at.line||it.ch-at.ch}function Nn(it,at){return it.sticky==at.sticky&&hn(it,at)==0}function In(it){return ze(it.line,it.ch)}function vi(it,at){return hn(it,at)<0?at:it}function Jn(it,at){return hn(it,at)<0?it:at}function ii(it,at){return Math.max(it.first,Math.min(at,it.first+it.size-1))}function hi(it,at){if(at.line<it.first)return ze(it.first,0);var ct=it.first+it.size-1;return at.line>ct?ze(ct,Gn(it,ct).text.length):Ii(at,Gn(it,at.line).text.length)}function Ii(it,at){var ct=it.ch;return ct==null||ct>at?ze(it.line,at):ct<0?ze(it.line,0):it}function Di(it,at){for(var ct=[],dt=0;dt<at.length;dt++)ct[dt]=hi(it,at[dt]);return ct}var mn=function(it,at){this.state=it,this.lookAhead=at},oi=function(it,at,ct,dt){this.state=at,this.doc=it,this.line=ct,this.maxLookAhead=dt||0,this.baseTokens=null,this.baseTokenPos=1};oi.prototype.lookAhead=function(it){var at=this.doc.getLine(this.line+it);return at!=null&&it>this.maxLookAhead&&(this.maxLookAhead=it),at},oi.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}},oi.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},oi.fromSaved=function(it,at,ct){return at instanceof mn?new oi(it,xi(it.mode,at.state),ct,at.lookAhead):new oi(it,xi(it.mode,at),ct)},oi.prototype.save=function(it){var at=it!==!1?xi(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new mn(at,this.maxLookAhead):at};function fr(it,at,ct,dt){var mt=[it.state.modeGen],Lt={};Lr(it,at.text,it.doc.mode,ct,function(se,We){return mt.push(se,We)},Lt,dt);for(var Ot=ct.state,Vt=function(se){ct.baseTokens=mt;var We=it.state.overlays[se],fe=1,Sn=0;ct.state=!0,Lr(it,at.text,We.mode,ct,function(ln,Mi){for(var Bi=fe;Sn<ln;){var _i=mt[fe];_i>ln&&mt.splice(fe,1,ln,mt[fe+1],_i),fe+=2,Sn=Math.min(ln,_i)}if(Mi)if(We.opaque)mt.splice(Bi,fe-Bi,ln,"overlay "+Mi),fe=Bi+2;else for(;Bi<fe;Bi+=2){var rr=mt[Bi+1];mt[Bi+1]=(rr?rr+" ":"")+"overlay "+Mi}},Lt),ct.state=Ot,ct.baseTokens=null,ct.baseTokenPos=1},Ht=0;Ht<it.state.overlays.length;++Ht)Vt(Ht);return{styles:mt,classes:Lt.bgClass||Lt.textClass?Lt:null}}function Mr(it,at,ct){if(!at.styles||at.styles[0]!=it.state.modeGen){var dt=Xr(it,Qt(at)),mt=at.text.length>it.options.maxHighlightLength&&xi(it.doc.mode,dt.state),Lt=fr(it,at,dt);mt&&(dt.state=mt),at.stateAfter=dt.save(!mt),at.styles=Lt.styles,Lt.classes?at.styleClasses=Lt.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 Xr(it,at,ct){var dt=it.doc,mt=it.display;if(!dt.mode.startState)return new oi(dt,!0,at);var Lt=Dr(it,at,ct),Ot=Lt>dt.first&&Gn(dt,Lt-1).stateAfter,Vt=Ot?oi.fromSaved(dt,Ot,Lt):new oi(dt,Pi(dt.mode),Lt);return dt.iter(Lt,at,function(Ht){Ae(it,Ht.text,Vt);var se=Vt.line;Ht.stateAfter=se==at-1||se%5==0||se>=mt.viewFrom&&se<mt.viewTo?Vt.save():null,Vt.nextLine()}),ct&&(dt.modeFrontier=Vt.line),Vt}function Ae(it,at,ct,dt){var mt=it.doc.mode,Lt=new $e(at,it.options.tabSize,ct);for(Lt.start=Lt.pos=dt||0,at==""&&ri(mt,ct.state);!Lt.eol();)Ri(mt,Lt,ct.state),Lt.start=Lt.pos}function ri(it,at){if(it.blankLine)return it.blankLine(at);if(it.innerMode){var ct=Kn(it,at);if(ct.mode.blankLine)return ct.mode.blankLine(ct.state)}}function Ri(it,at,ct,dt){for(var mt=0;mt<10;mt++){dt&&(dt[0]=Kn(it,ct).mode);var Lt=it.token(at,ct);if(at.pos>at.start)return Lt}throw new Error("Mode "+it.name+" failed to advance stream.")}var fi=function(it,at,ct){this.start=it.start,this.end=it.pos,this.string=it.current(),this.type=at||null,this.state=ct};function br(it,at,ct,dt){var mt=it.doc,Lt=mt.mode,Ot;at=hi(mt,at);var Vt=Gn(mt,at.line),Ht=Xr(it,at.line,ct),se=new $e(Vt.text,it.options.tabSize,Ht),We;for(dt&&(We=[]);(dt||se.pos<at.ch)&&!se.eol();)se.start=se.pos,Ot=Ri(Lt,se,Ht.state),dt&&We.push(new fi(se,Ot,xi(mt.mode,Ht.state)));return dt?We:new fi(se,Ot,Ht.state)}function ur(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 Lr(it,at,ct,dt,mt,Lt,Ot){var Vt=ct.flattenSpans;Vt==null&&(Vt=it.options.flattenSpans);var Ht=0,se=null,We=new $e(at,it.options.tabSize,dt),fe,Sn=it.options.addModeClass&&[null];for(at==""&&ur(ri(ct,dt.state),Lt);!We.eol();){if(We.pos>it.options.maxHighlightLength?(Vt=!1,Ot&&Ae(it,at,dt,We.pos),We.pos=at.length,fe=null):fe=ur(Ri(ct,We,dt.state,Sn),Lt),Sn){var ln=Sn[0].name;ln&&(fe="m-"+(fe?ln+" "+fe:ln))}if(!Vt||se!=fe){for(;Ht<We.start;)Ht=Math.min(We.start,Ht+5e3),mt(Ht,se);se=fe}We.start=We.pos}for(;Ht<We.pos;){var Mi=Math.min(We.pos,Ht+5e3);mt(Mi,se),Ht=Mi}}function Dr(it,at,ct){for(var dt,mt,Lt=it.doc,Ot=ct?-1:at-(it.doc.mode.innerMode?1e3:100),Vt=at;Vt>Ot;--Vt){if(Vt<=Lt.first)return Lt.first;var Ht=Gn(Lt,Vt-1),se=Ht.stateAfter;if(se&&(!ct||Vt+(se instanceof mn?se.lookAhead:0)<=Lt.modeFrontier))return Vt;var We=te(Ht.text,null,it.options.tabSize);(mt==null||dt>We)&&(mt=Vt-1,dt=We)}return mt}function Zr(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=Gn(it,dt).stateAfter;if(mt&&(!(mt instanceof mn)||dt+mt.lookAhead<at)){ct=dt+1;break}}it.highlightFrontier=Math.min(it.highlightFrontier,ct)}}var Jr=!1,un=!1;function yo(){Jr=!0}function vn(){un=!0}function Gi(it,at,ct){this.marker=it,this.from=at,this.to=ct}function Wr(it,at){if(it)for(var ct=0;ct<it.length;++ct){var dt=it[ct];if(dt.marker==at)return dt}}function Oi(it,at){for(var ct,dt=0;dt<it.length;++dt)it[dt]!=at&&(ct||(ct=[])).push(it[dt]);return ct}function ko(it,at){it.markedSpans=it.markedSpans?it.markedSpans.concat([at]):[at],at.marker.attachLine(it)}function Ur(it,at,ct){var dt;if(it)for(var mt=0;mt<it.length;++mt){var Lt=it[mt],Ot=Lt.marker,Vt=Lt.from==null||(Ot.inclusiveLeft?Lt.from<=at:Lt.from<at);if(Vt||Lt.from==at&&Ot.type=="bookmark"&&(!ct||!Lt.marker.insertLeft)){var Ht=Lt.to==null||(Ot.inclusiveRight?Lt.to>=at:Lt.to>at);(dt||(dt=[])).push(new Gi(Ot,Lt.from,Ht?null:Lt.to))}}return dt}function Cr(it,at,ct){var dt;if(it)for(var mt=0;mt<it.length;++mt){var Lt=it[mt],Ot=Lt.marker,Vt=Lt.to==null||(Ot.inclusiveRight?Lt.to>=at:Lt.to>at);if(Vt||Lt.from==at&&Ot.type=="bookmark"&&(!ct||Lt.marker.insertLeft)){var Ht=Lt.from==null||(Ot.inclusiveLeft?Lt.from<=at:Lt.from<at);(dt||(dt=[])).push(new Gi(Ot,Ht?null:Lt.from-at,Lt.to==null?null:Lt.to-at))}}return dt}function Lo(it,at){if(at.full)return null;var ct=bn(it,at.from.line)&&Gn(it,at.from.line).markedSpans,dt=bn(it,at.to.line)&&Gn(it,at.to.line).markedSpans;if(!ct&&!dt)return null;var mt=at.from.ch,Lt=at.to.ch,Ot=hn(at.from,at.to)==0,Vt=Ur(ct,mt,Ot),Ht=Cr(dt,Lt,Ot),se=at.text.length==1,We=Ce(at.text).length+(se?mt:0);if(Vt)for(var fe=0;fe<Vt.length;++fe){var Sn=Vt[fe];if(Sn.to==null){var ln=Wr(Ht,Sn.marker);ln?se&&(Sn.to=ln.to==null?null:ln.to+We):Sn.to=mt}}if(Ht)for(var Mi=0;Mi<Ht.length;++Mi){var Bi=Ht[Mi];if(Bi.to!=null&&(Bi.to+=We),Bi.from==null){var _i=Wr(Vt,Bi.marker);_i||(Bi.from=We,se&&(Vt||(Vt=[])).push(Bi))}else Bi.from+=We,se&&(Vt||(Vt=[])).push(Bi)}Vt&&(Vt=je(Vt)),Ht&&Ht!=Vt&&(Ht=je(Ht));var rr=[Vt];if(!se){var jr=at.text.length-2,xr;if(jr>0&&Vt)for(var Kr=0;Kr<Vt.length;++Kr)Vt[Kr].to==null&&(xr||(xr=[])).push(new Gi(Vt[Kr].marker,null,null));for(var Eo=0;Eo<jr;++Eo)rr.push(xr);rr.push(Ht)}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 xn(it,at,ct){var dt=null;if(it.iter(at.line,ct.line+1,function(ln){if(ln.markedSpans)for(var Mi=0;Mi<ln.markedSpans.length;++Mi){var Bi=ln.markedSpans[Mi].marker;Bi.readOnly&&(!dt||Qe(dt,Bi)==-1)&&(dt||(dt=[])).push(Bi)}}),!dt)return null;for(var mt=[{from:at,to:ct}],Lt=0;Lt<dt.length;++Lt)for(var Ot=dt[Lt],Vt=Ot.find(0),Ht=0;Ht<mt.length;++Ht){var se=mt[Ht];if(!(hn(se.to,Vt.from)<0||hn(se.from,Vt.to)>0)){var We=[Ht,1],fe=hn(se.from,Vt.from),Sn=hn(se.to,Vt.to);(fe<0||!Ot.inclusiveLeft&&!fe)&&We.push({from:se.from,to:Vt.from}),(Sn>0||!Ot.inclusiveRight&&!Sn)&&We.push({from:Vt.to,to:se.to}),mt.splice.apply(mt,We),Ht+=We.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 Tt(it,at){if(at){for(var ct=0;ct<at.length;++ct)at[ct].marker.attachLine(it);it.markedSpans=at}}function Dn(it){return it.inclusiveLeft?-1:0}function ei(it){return it.inclusiveRight?1:0}function Ni(it,at){var ct=it.lines.length-at.lines.length;if(ct!=0)return ct;var dt=it.find(),mt=at.find(),Lt=hn(dt.from,mt.from)||Dn(it)-Dn(at);if(Lt)return-Lt;var Ot=hn(dt.to,mt.to)||ei(it)-ei(at);return Ot||at.id-it.id}function Li(it,at){var ct=un&&it.markedSpans,dt;if(ct)for(var mt=void 0,Lt=0;Lt<ct.length;++Lt)mt=ct[Lt],mt.marker.collapsed&&(at?mt.from:mt.to)==null&&(!dt||Ni(dt,mt.marker)<0)&&(dt=mt.marker);return dt}function di(it){return Li(it,!0)}function yn(it){return Li(it,!1)}function Un(it,at){var ct=un&&it.markedSpans,dt;if(ct)for(var mt=0;mt<ct.length;++mt){var Lt=ct[mt];Lt.marker.collapsed&&(Lt.from==null||Lt.from<at)&&(Lt.to==null||Lt.to>at)&&(!dt||Ni(dt,Lt.marker)<0)&&(dt=Lt.marker)}return dt}function $n(it,at,ct,dt,mt){var Lt=Gn(it,at),Ot=un&&Lt.markedSpans;if(Ot)for(var Vt=0;Vt<Ot.length;++Vt){var Ht=Ot[Vt];if(Ht.marker.collapsed){var se=Ht.marker.find(0),We=hn(se.from,ct)||Dn(Ht.marker)-Dn(mt),fe=hn(se.to,dt)||ei(Ht.marker)-ei(mt);if(!(We>=0&&fe<=0||We<=0&&fe>=0)&&(We<=0&&(Ht.marker.inclusiveRight&&mt.inclusiveLeft?hn(se.to,ct)>=0:hn(se.to,ct)>0)||We>=0&&(Ht.marker.inclusiveRight&&mt.inclusiveLeft?hn(se.from,dt)<=0:hn(se.from,dt)<0)))return!0}}}function An(it){for(var at;at=di(it);)it=at.find(-1,!0).line;return it}function Xn(it){for(var at;at=yn(it);)it=at.find(1,!0).line;return it}function Zn(it){for(var at,ct;at=yn(it);)it=at.find(1,!0).line,(ct||(ct=[])).push(it);return ct}function ai(it,at){var ct=Gn(it,at),dt=An(ct);return ct==dt?at:Qt(dt)}function pi(it,at){if(at>it.lastLine())return at;var ct=Gn(it,at),dt;if(!en(it,ct))return at;for(;dt=yn(ct);)ct=dt.find(1,!0).line;return Qt(ct)+1}function en(it,at){var ct=un&&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&&Qi(it,at,dt))return!0}}}function Qi(it,at,ct){if(ct.to==null){var dt=ct.marker.find(1,!0);return Qi(it,dt.line,Wr(dt.line.markedSpans,ct.marker))}if(ct.marker.inclusiveRight&&ct.to==at.text.length)return!0;for(var mt=void 0,Lt=0;Lt<at.markedSpans.length;++Lt)if(mt=at.markedSpans[Lt],mt.marker.collapsed&&!mt.marker.widgetNode&&mt.from==ct.to&&(mt.to==null||mt.to!=ct.from)&&(mt.marker.inclusiveLeft||ct.marker.inclusiveRight)&&Qi(it,at,mt))return!0}function tr(it){it=An(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 Lt=ct.parent;Lt;ct=Lt,Lt=ct.parent)for(var Ot=0;Ot<Lt.children.length;++Ot){var Vt=Lt.children[Ot];if(Vt==ct)break;at+=Vt.height}return at}function Vr(it){if(it.height==0)return 0;for(var at=it.text.length,ct,dt=it;ct=di(dt);){var mt=ct.find(0,!0);dt=mt.from.line,at+=mt.from.ch-mt.to.ch}for(dt=it;ct=yn(dt);){var Lt=ct.find(0,!0);at-=dt.text.length-Lt.from.ch,dt=Lt.to.line,at+=dt.text.length-Lt.to.ch}return at}function or(it){var at=it.display,ct=it.doc;at.maxLine=Gn(ct,ct.first),at.maxLineLength=Vr(at.maxLine),at.maxLineChanged=!0,ct.iter(function(dt){var mt=Vr(dt);mt>at.maxLineLength&&(at.maxLineLength=mt,at.maxLine=dt)})}var so=function(it,at,ct){this.text=it,Tt(this,at),this.height=ct?ct(this):1};so.prototype.lineNo=function(){return Qt(this)},an(so);function qr(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),Tt(it,ct);var mt=dt?dt(it):1;mt!=it.height&&Tn(it,mt)}function po(it){it.parent=null,be(it)}var ro={},Po={};function Bo(it,at){if(!it||/^\s*$/.test(it))return null;var ct=at.addModeClass?Po:ro;return ct[it]||(ct[it]=it.replace(/\S+/g,"cm-$&"))}function Oe(it,at){var ct=ge("span",null,null,ee?"padding-right: .1px":null),dt={pre:ge("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 Lt=mt?at.rest[mt-1]:at.line,Ot=void 0;dt.pos=0,dt.addToken=Gr,ci(it.display.measure)&&(Ot=tn(Lt,it.doc.direction))&&(dt.addToken=hr(dt.addToken,Ot)),dt.map=[];var Vt=at!=it.display.externalMeasured&&Qt(Lt);Fo(Lt,dt,Mr(it,Lt,Vt)),Lt.styleClasses&&(Lt.styleClasses.bgClass&&(dt.bgClass=Ye(Lt.styleClasses.bgClass,dt.bgClass||"")),Lt.styleClasses.textClass&&(dt.textClass=Ye(Lt.styleClasses.textClass,dt.textClass||""))),dt.map.length==0&&dt.map.push(0,0,dt.content.appendChild(si(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(ee){var Ht=dt.content.lastChild;(/\bcm-tab\b/.test(Ht.className)||Ht.querySelector&&Ht.querySelector(".cm-tab"))&&(dt.content.className="cm-tab-wrap-hack")}return Ke(it,"renderLine",it,at.line,dt.pre),dt.pre.className&&(dt.textClass=Ye(dt.pre.className,dt.textClass||"")),dt}function lo(it){var at=Gt("span","\u2022","cm-invalidchar");return at.title="\\u"+it.charCodeAt(0).toString(16),at.setAttribute("aria-label",at.title),at}function Gr(it,at,ct,dt,mt,Lt,Ot){if(at){var Vt=it.splitSpaces?Sr(at,it.trailingSpace):at,Ht=it.cm.state.specialChars,se=!1,We;if(!Ht.test(at))it.col+=at.length,We=document.createTextNode(Vt),it.map.push(it.pos,it.pos+at.length,We),ue&&Dt<9&&(se=!0),it.pos+=at.length;else{We=document.createDocumentFragment();for(var fe=0;;){Ht.lastIndex=fe;var Sn=Ht.exec(at),ln=Sn?Sn.index-fe:at.length-fe;if(ln){var Mi=document.createTextNode(Vt.slice(fe,fe+ln));ue&&Dt<9?We.appendChild(Gt("span",[Mi])):We.appendChild(Mi),it.map.push(it.pos,it.pos+ln,Mi),it.col+=ln,it.pos+=ln}if(!Sn)break;fe+=ln+1;var Bi=void 0;if(Sn[0]==" "){var _i=it.cm.options.tabSize,rr=_i-it.col%_i;Bi=We.appendChild(Gt("span",he(rr),"cm-tab")),Bi.setAttribute("role","presentation"),Bi.setAttribute("cm-text"," "),it.col+=rr}else Sn[0]=="\r"||Sn[0]==`
|
|
`?(Bi=We.appendChild(Gt("span",Sn[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),Bi.setAttribute("cm-text",Sn[0]),it.col+=1):(Bi=it.cm.options.specialCharPlaceholder(Sn[0]),Bi.setAttribute("cm-text",Sn[0]),ue&&Dt<9?We.appendChild(Gt("span",[Bi])):We.appendChild(Bi),it.col+=1);it.map.push(it.pos,it.pos+1,Bi),it.pos++}}if(it.trailingSpace=Vt.charCodeAt(at.length-1)==32,ct||dt||mt||se||Lt||Ot){var jr=ct||"";dt&&(jr+=dt),mt&&(jr+=mt);var xr=Gt("span",[We],jr,Lt);if(Ot)for(var Kr in Ot)Ot.hasOwnProperty(Kr)&&Kr!="style"&&Kr!="class"&&xr.setAttribute(Kr,Ot[Kr]);return it.content.appendChild(xr)}it.content.appendChild(We)}}function Sr(it,at){if(it.length>1&&!/ /.test(it))return it;for(var ct=at,dt="",mt=0;mt<it.length;mt++){var Lt=it.charAt(mt);Lt==" "&&ct&&(mt==it.length-1||it.charCodeAt(mt+1)==32)&&(Lt="\xA0"),dt+=Lt,ct=Lt==" "}return dt}function hr(it,at){return function(ct,dt,mt,Lt,Ot,Vt,Ht){mt=mt?mt+" cm-force-border":"cm-force-border";for(var se=ct.pos,We=se+dt.length;;){for(var fe=void 0,Sn=0;Sn<at.length&&(fe=at[Sn],!(fe.to>se&&fe.from<=se));Sn++);if(fe.to>=We)return it(ct,dt,mt,Lt,Ot,Vt,Ht);it(ct,dt.slice(0,fe.to-se),mt,Lt,null,Vt,Ht),Lt=null,dt=dt.slice(fe.to-se),se=fe.to}}}function oo(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,Lt=0;if(!dt){for(var Ot=1;Ot<ct.length;Ot+=2)at.addToken(at,mt.slice(Lt,Lt=ct[Ot]),Bo(ct[Ot+1],at.cm.options));return}for(var Vt=mt.length,Ht=0,se=1,We="",fe,Sn,ln=0,Mi,Bi,_i,rr,jr;;){if(ln==Ht){Mi=Bi=_i=Sn="",jr=null,rr=null,ln=1/0;for(var xr=[],Kr=void 0,Eo=0;Eo<dt.length;++Eo){var yr=dt[Eo],Ho=yr.marker;if(Ho.type=="bookmark"&&yr.from==Ht&&Ho.widgetNode)xr.push(Ho);else if(yr.from<=Ht&&(yr.to==null||yr.to>Ht||Ho.collapsed&&yr.to==Ht&&yr.from==Ht)){if(yr.to!=null&&yr.to!=Ht&&ln>yr.to&&(ln=yr.to,Bi=""),Ho.className&&(Mi+=" "+Ho.className),Ho.css&&(Sn=(Sn?Sn+";":"")+Ho.css),Ho.startStyle&&yr.from==Ht&&(_i+=" "+Ho.startStyle),Ho.endStyle&&yr.to==ln&&(Kr||(Kr=[])).push(Ho.endStyle,yr.to),Ho.title&&((jr||(jr={})).title=Ho.title),Ho.attributes)for(var ka in Ho.attributes)(jr||(jr={}))[ka]=Ho.attributes[ka];Ho.collapsed&&(!rr||Ni(rr.marker,Ho)<0)&&(rr=yr)}else yr.from>Ht&&ln>yr.from&&(ln=yr.from)}if(Kr)for(var ds=0;ds<Kr.length;ds+=2)Kr[ds+1]==ln&&(Bi+=" "+Kr[ds]);if(!rr||rr.from==Ht)for(var za=0;za<xr.length;++za)oo(at,0,xr[za]);if(rr&&(rr.from||0)==Ht){if(oo(at,(rr.to==null?Vt+1:rr.to)-Ht,rr.marker,rr.from==null),rr.to==null)return;rr.to==Ht&&(rr=!1)}}if(Ht>=Vt)break;for(var ll=Math.min(Vt,ln);;){if(We){var Gs=Ht+We.length;if(!rr){var os=Gs>ll?We.slice(0,ll-Ht):We;at.addToken(at,os,fe?fe+Mi:Mi,_i,Ht+os.length==ln?Bi:"",Sn,jr)}if(Gs>=ll){We=We.slice(ll-Ht),Ht=ll;break}Ht=Gs,_i=""}We=mt.slice(Lt,Lt=ct[se++]),fe=Bo(ct[se++],at.cm.options)}}}function wo(it,at,ct){this.line=at,this.rest=Zn(at),this.size=this.rest?Qt(Ce(this.rest))-ct+1:1,this.node=this.text=null,this.hidden=en(it,at)}function zr(it,at,ct){for(var dt=[],mt,Lt=at;Lt<ct;Lt=mt){var Ot=new wo(it.doc,Gn(it.doc,Lt),Lt);mt=Lt+Ot.size,dt.push(Ot)}return dt}var Or=null;function ha(it){Or?Or.ops.push(it):it.ownsGroup=Or={ops:[it],delayedCallbacks:[]}}function Ia(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 bs(it,at){var ct=it.ownsGroup;if(ct)try{Ia(ct)}finally{Or=null,at(ct)}}var Ba=null;function dr(it,at){var ct=ni(it,at);if(ct.length){var dt=Array.prototype.slice.call(arguments,2),mt;Or?mt=Or.delayedCallbacks:Ba?mt=Ba:(mt=Ba=[],setTimeout($o,0));for(var Lt=function(Vt){mt.push(function(){return ct[Vt].apply(null,dt)})},Ot=0;Ot<ct.length;++Ot)Lt(Ot)}}function $o(){var it=Ba;Ba=null;for(var at=0;at<it.length;++at)it[at]()}function qo(it,at,ct,dt){for(var mt=0;mt<at.changes.length;mt++){var Lt=at.changes[mt];Lt=="text"?yi(it,at):Lt=="gutter"?_r(it,at,ct,dt):Lt=="class"?ar(it,at):Lt=="widget"&&$r(it,at,dt)}at.changes=null}function ca(it){return it.node==it.text&&(it.node=Gt("div",null,null,"position: relative"),it.text.parentNode&&it.text.parentNode.replaceChild(it.node,it.text),it.node.appendChild(it.text),ue&&Dt<8&&(it.node.style.zIndex=2)),it.node}function ia(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=ca(at);at.background=dt.insertBefore(Gt("div",null,ct),dt.firstChild),it.display.input.setUneditable(at.background)}}function fa(it,at){var ct=it.display.externalMeasured;return ct&&ct.line==at.line?(it.display.externalMeasured=null,at.measure=ct.measure,ct.built):Oe(it,at)}function yi(it,at){var ct=at.text.className,dt=fa(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){ia(it,at),at.line.wrapClass?ca(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=ca(at);at.gutterBackground=Gt("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 Lt=at.line.gutterMarkers;if(it.options.lineNumbers||Lt){var Ot=ca(at),Vt=at.gutter=Gt("div",null,"CodeMirror-gutter-wrapper","left: "+(it.options.fixedGutter?dt.fixedPos:-dt.gutterTotalWidth)+"px");if(it.display.input.setUneditable(Vt),Ot.insertBefore(Vt,at.text),at.line.gutterClass&&(Vt.className+=" "+at.line.gutterClass),it.options.lineNumbers&&(!Lt||!Lt["CodeMirror-linenumbers"])&&(at.lineNumber=Vt.appendChild(Gt("div",_n(it.options,ct),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+dt.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+it.display.lineNumInnerWidth+"px"))),Lt)for(var Ht=0;Ht<it.display.gutterSpecs.length;++Ht){var se=it.display.gutterSpecs[Ht].className,We=Lt.hasOwnProperty(se)&&Lt[se];We&&Vt.appendChild(Gt("div",[We],"CodeMirror-gutter-elt","left: "+dt.gutterLeft[se]+"px; width: "+dt.gutterWidth[se]+"px"))}}}function $r(it,at,ct){at.alignable&&(at.alignable=null);for(var dt=At("CodeMirror-linewidget"),mt=at.node.firstChild,Lt=void 0;mt;mt=Lt)Lt=mt.nextSibling,dt.test(mt.className)&&at.node.removeChild(mt);zo(it,at,ct)}function co(it,at,ct,dt){var mt=fa(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(cr(it,at.line,at,ct,!0),at.rest)for(var dt=0;dt<at.rest.length;dt++)cr(it,at.rest[dt],at,ct,!1)}function cr(it,at,ct,dt,mt){if(at.widgets)for(var Lt=ca(ct),Ot=0,Vt=at.widgets;Ot<Vt.length;++Ot){var Ht=Vt[Ot],se=Gt("div",[Ht.node],"CodeMirror-linewidget"+(Ht.className?" "+Ht.className:""));Ht.handleMouseEvents||se.setAttribute("cm-ignore-events","true"),Ya(Ht,se,ct,dt),it.display.input.setUneditable(se),mt&&Ht.above?Lt.insertBefore(se,ct.gutter||ct.text):Lt.appendChild(se),dr(Ht,"redraw")}}function Ya(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 da(it){if(it.height!=null)return it.height;var at=it.doc.cm;if(!at)return 0;if(!Te(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;"),Ut(at.display.measure,Gt("div",[it.node],null,ct))}return it.height=it.node.parentNode.offsetHeight}function Yo(it,at){for(var ct=Wi(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 io(it){return it.lineSpace.offsetTop}function Sa(it){return it.mover.offsetHeight-it.lineSpace.offsetHeight}function ns(it){if(it.cachedPaddingH)return it.cachedPaddingH;var at=Ut(it.measure,Gt("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 Jo(it){return On-it.display.nativeBarWidth}function ps(it){return it.display.scroller.clientWidth-Jo(it)-it.display.barWidth}function ms(it){return it.display.scroller.clientHeight-Jo(it)-it.display.barHeight}function Rs(it,at,ct){var dt=it.options.lineWrapping,mt=dt&&ps(it);if(!at.measure.heights||dt&&at.measure.width!=mt){var Lt=at.measure.heights=[];if(dt){at.measure.width=mt;for(var Ot=at.text.firstChild.getClientRects(),Vt=0;Vt<Ot.length-1;Vt++){var Ht=Ot[Vt],se=Ot[Vt+1];Math.abs(Ht.bottom-se.bottom)>2&&Lt.push((Ht.bottom+se.top)/2-ct.top)}}Lt.push(ct.bottom-ct.top)}}function La(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(Qt(it.rest[mt])>ct)return{map:it.measure.maps[mt],cache:it.measure.caches[mt],before:!0}}function Iu(it,at){at=An(at);var ct=Qt(at),dt=it.display.externalMeasured=new wo(it.doc,at,ct);dt.lineN=ct;var mt=dt.built=Oe(it,dt);return dt.text=mt.pre,Ut(it.display.lineMeasure,mt.pre),dt}function Cu(it,at,ct,dt){return zs(it,Nl(it,at),ct,dt)}function js(it,at){if(at>=it.display.viewFrom&&at<it.display.viewTo)return it.display.view[Hi(it,at)];var ct=it.display.externalMeasured;if(ct&&at>=ct.lineN&&at<ct.lineN+ct.size)return ct}function Nl(it,at){var ct=Qt(at),dt=js(it,ct);dt&&!dt.text?dt=null:dt&&dt.changes&&(qo(it,dt,ct,fo(it)),it.curOp.forceUpdate=!0),dt||(dt=Iu(it,at));var mt=La(dt,at,ct);return{line:at,view:dt,rect:null,map:mt.map,cache:mt.cache,before:mt.before,hasHeights:!1}}function zs(it,at,ct,dt,mt){at.before&&(ct=-1);var Lt=ct+(dt||""),Ot;return at.cache.hasOwnProperty(Lt)?Ot=at.cache[Lt]:(at.rect||(at.rect=at.view.text.getBoundingClientRect()),at.hasHeights||(Rs(it,at.view,at.rect),at.hasHeights=!0),Ot=xa(it,at,ct,dt),Ot.bogus||(at.cache[Lt]=Ot)),{left:Ot.left,right:Ot.right,top:mt?Ot.rtop:Ot.top,bottom:mt?Ot.rbottom:Ot.bottom}}var Vl={left:0,right:0,top:0,bottom:0};function lu(it,at,ct){for(var dt,mt,Lt,Ot,Vt,Ht,se=0;se<it.length;se+=3)if(Vt=it[se],Ht=it[se+1],at<Vt?(mt=0,Lt=1,Ot="left"):at<Ht?(mt=at-Vt,Lt=mt+1):(se==it.length-3||at==Ht&&it[se+3]>at)&&(Lt=Ht-Vt,mt=Lt-1,at>=Ht&&(Ot="right")),mt!=null){if(dt=it[se+2],Vt==Ht&&ct==(dt.insertLeft?"left":"right")&&(Ot=ct),ct=="left"&&mt==0)for(;se&&it[se-2]==it[se-3]&&it[se-1].insertLeft;)dt=it[(se-=3)+2],Ot="left";if(ct=="right"&&mt==Ht-Vt)for(;se<it.length-3&&it[se+3]==it[se+4]&&!it[se+5].insertLeft;)dt=it[(se+=3)+2],Ot="right";break}return{node:dt,start:mt,end:Lt,collapse:Ot,coverStart:Vt,coverEnd:Ht}}function Eu(it,at){var ct=Vl;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 xa(it,at,ct,dt){var mt=lu(at.map,ct,dt),Lt=mt.node,Ot=mt.start,Vt=mt.end,Ht=mt.collapse,se;if(Lt.nodeType==3){for(var We=0;We<4;We++){for(;Ot&&He(at.line.text.charAt(mt.coverStart+Ot));)--Ot;for(;mt.coverStart+Vt<mt.coverEnd&&He(at.line.text.charAt(mt.coverStart+Vt));)++Vt;if(ue&&Dt<9&&Ot==0&&Vt==mt.coverEnd-mt.coverStart?se=Lt.parentNode.getBoundingClientRect():se=Eu(ie(Lt,Ot,Vt).getClientRects(),dt),se.left||se.right||Ot==0)break;Vt=Ot,Ot=Ot-1,Ht="right"}ue&&Dt<11&&(se=rl(it.display.measure,se))}else{Ot>0&&(Ht=dt="right");var fe;it.options.lineWrapping&&(fe=Lt.getClientRects()).length>1?se=fe[dt=="right"?fe.length-1:0]:se=Lt.getBoundingClientRect()}if(ue&&Dt<9&&!Ot&&(!se||!se.left&&!se.right)){var Sn=Lt.parentNode.getClientRects()[0];Sn?se={left:Sn.left,right:Sn.left+Pr(it.display),top:Sn.top,bottom:Sn.bottom}:se=Vl}for(var ln=se.top-at.rect.top,Mi=se.bottom-at.rect.top,Bi=(ln+Mi)/2,_i=at.view.measure.heights,rr=0;rr<_i.length-1&&!(Bi<_i[rr]);rr++);var jr=rr?_i[rr-1]:0,xr=_i[rr],Kr={left:(Ht=="right"?se.right:se.left)-at.rect.left,right:(Ht=="left"?se.left:se.right)-at.rect.left,top:jr,bottom:xr};return!se.left&&!se.right&&(Kr.bogus=!0),it.options.singleCursorHeightPerLine||(Kr.rtop=ln,Kr.rbottom=Mi),Kr}function rl(it,at){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!Ln(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 _u(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 Kl(it){it.display.externalMeasure=null,qt(it.display.lineMeasure);for(var at=0;at<it.display.view.length;at++)_u(it.display.view[at])}function uu(it){Kl(it),it.display.cachedCharWidth=it.display.cachedTextHeight=it.display.cachedPaddingH=null,it.options.lineWrapping||(it.display.maxLineChanged=!0),it.display.lineNumChars=null}function Xa(){return Jt&&nt?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function Ja(){return Jt&&nt?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function Aa(it){var at=0;if(it.widgets)for(var ct=0;ct<it.widgets.length;++ct)it.widgets[ct].above&&(at+=da(it.widgets[ct]));return at}function Ga(it,at,ct,dt,mt){if(!mt){var Lt=Aa(at);ct.top+=Lt,ct.bottom+=Lt}if(dt=="line")return ct;dt||(dt="local");var Ot=tr(at);if(dt=="local"?Ot+=io(it.display):Ot-=it.display.viewOffset,dt=="page"||dt=="window"){var Vt=it.display.lineSpace.getBoundingClientRect();Ot+=Vt.top+(dt=="window"?0:Ja());var Ht=Vt.left+(dt=="window"?0:Xa());ct.left+=Ht,ct.right+=Ht}return ct.top+=Ot,ct.bottom+=Ot,ct}function Bl(it,at,ct){if(ct=="div")return at;var dt=at.left,mt=at.top;if(ct=="page")dt-=Xa(),mt-=Ja();else if(ct=="local"||!ct){var Lt=it.display.sizer.getBoundingClientRect();dt+=Lt.left,mt+=Lt.top}var Ot=it.display.lineSpace.getBoundingClientRect();return{left:dt-Ot.left,top:mt-Ot.top}}function ga(it,at,ct,dt,mt){return dt||(dt=Gn(it.doc,at.line)),Ga(it,dt,Cu(it,dt,at.ch,mt),ct)}function _o(it,at,ct,dt,mt,Lt){dt=dt||Gn(it.doc,at.line),mt||(mt=Nl(it,dt));function Ot(Mi,Bi){var _i=zs(it,mt,Mi,Bi?"right":"left",Lt);return Bi?_i.left=_i.right:_i.right=_i.left,Ga(it,dt,_i,ct)}var Vt=tn(dt,it.doc.direction),Ht=at.ch,se=at.sticky;if(Ht>=dt.text.length?(Ht=dt.text.length,se="before"):Ht<=0&&(Ht=0,se="after"),!Vt)return Ot(se=="before"?Ht-1:Ht,se=="before");function We(Mi,Bi,_i){var rr=Vt[Bi],jr=rr.level==1;return Ot(_i?Mi-1:Mi,jr!=_i)}var fe=ke(Vt,Ht,se),Sn=Pe,ln=We(Ht,fe,se=="before");return Sn!=null&&(ln.other=We(Ht,Sn,se!="before")),ln}function Co(it,at){var ct=0;at=hi(it.doc,at),it.options.lineWrapping||(ct=Pr(it.display)*at.ch);var dt=Gn(it.doc,at.line),mt=tr(dt)+io(it.display);return{left:ct,right:ct,top:mt,bottom:mt+dt.height}}function Ao(it,at,ct,dt,mt){var Lt=ze(it,at,ct);return Lt.xRel=mt,dt&&(Lt.outside=dt),Lt}function Ta(it,at,ct){var dt=it.doc;if(ct+=it.display.viewOffset,ct<0)return Ao(dt.first,0,null,-1,-1);var mt=me(dt,ct),Lt=dt.first+dt.size-1;if(mt>Lt)return Ao(dt.first+dt.size-1,Gn(dt,Lt).text.length,null,1,1);at<0&&(at=0);for(var Ot=Gn(dt,mt);;){var Vt=ce(it,Ot,mt,at,ct),Ht=Un(Ot,Vt.ch+(Vt.xRel>0||Vt.outside>0?1:0));if(!Ht)return Vt;var se=Ht.find(1);if(se.line==mt)return se;Ot=Gn(dt,mt=se.line)}}function oe(it,at,ct,dt){dt-=Aa(at);var mt=at.text.length,Lt=Xe(function(Ot){return zs(it,ct,Ot-1).bottom<=dt},mt,0);return mt=Xe(function(Ot){return zs(it,ct,Ot).top>dt},Lt,mt),{begin:Lt,end:mt}}function Re(it,at,ct,dt){ct||(ct=Nl(it,at));var mt=Ga(it,at,zs(it,ct,dt),"line").top;return oe(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 ce(it,at,ct,dt,mt){mt-=tr(at);var Lt=Nl(it,at),Ot=Aa(at),Vt=0,Ht=at.text.length,se=!0,We=tn(at,it.doc.direction);if(We){var fe=(it.options.lineWrapping?vr:Rr)(it,at,ct,Lt,We,dt,mt);se=fe.level!=1,Vt=se?fe.from:fe.to-1,Ht=se?fe.to:fe.from-1}var Sn=null,ln=null,Mi=Xe(function(Eo){var yr=zs(it,Lt,Eo);return yr.top+=Ot,yr.bottom+=Ot,_t(yr,dt,mt,!1)?(yr.top<=mt&&yr.left<=dt&&(Sn=Eo,ln=yr),!0):!1},Vt,Ht),Bi,_i,rr=!1;if(ln){var jr=dt-ln.left<ln.right-dt,xr=jr==se;Mi=Sn+(xr?0:1),_i=xr?"after":"before",Bi=jr?ln.left:ln.right}else{!se&&(Mi==Ht||Mi==Vt)&&Mi++,_i=Mi==0?"after":Mi==at.text.length?"before":zs(it,Lt,Mi-(se?1:0)).bottom+Ot<=mt==se?"after":"before";var Kr=_o(it,ze(ct,Mi,_i),"line",at,Lt);Bi=Kr.left,rr=mt<Kr.top?-1:mt>=Kr.bottom?1:0}return Mi=_e(at.text,Mi,1),Ao(ct,Mi,_i,rr,dt-Bi)}function Rr(it,at,ct,dt,mt,Lt,Ot){var Vt=Xe(function(fe){var Sn=mt[fe],ln=Sn.level!=1;return _t(_o(it,ze(ct,ln?Sn.to:Sn.from,ln?"before":"after"),"line",at,dt),Lt,Ot,!0)},0,mt.length-1),Ht=mt[Vt];if(Vt>0){var se=Ht.level!=1,We=_o(it,ze(ct,se?Ht.from:Ht.to,se?"after":"before"),"line",at,dt);_t(We,Lt,Ot,!0)&&We.top>Ot&&(Ht=mt[Vt-1])}return Ht}function vr(it,at,ct,dt,mt,Lt,Ot){var Vt=oe(it,at,dt,Ot),Ht=Vt.begin,se=Vt.end;/\s/.test(at.text.charAt(se-1))&&se--;for(var We=null,fe=null,Sn=0;Sn<mt.length;Sn++){var ln=mt[Sn];if(!(ln.from>=se||ln.to<=Ht)){var Mi=ln.level!=1,Bi=zs(it,dt,Mi?Math.min(se,ln.to)-1:Math.max(Ht,ln.from)).right,_i=Bi<Lt?Lt-Bi+1e9:Bi-Lt;(!We||fe>_i)&&(We=ln,fe=_i)}}return We||(We=mt[mt.length-1]),We.from<Ht&&(We={from:Ht,to:We.to,level:We.level}),We.to>se&&(We={from:We.from,to:se,level:We.level}),We}var Fr;function sr(it){if(it.cachedTextHeight!=null)return it.cachedTextHeight;if(Fr==null){Fr=Gt("pre",null,"CodeMirror-line-like");for(var at=0;at<49;++at)Fr.appendChild(document.createTextNode("x")),Fr.appendChild(Gt("br"));Fr.appendChild(document.createTextNode("x"))}Ut(it.measure,Fr);var ct=Fr.offsetHeight/50;return ct>3&&(it.cachedTextHeight=ct),qt(it.measure),ct||1}function Pr(it){if(it.cachedCharWidth!=null)return it.cachedCharWidth;var at=Gt("span","xxxxxxxxxx"),ct=Gt("pre",[at],"CodeMirror-line-like");Ut(it.measure,ct);var dt=at.getBoundingClientRect(),mt=(dt.right-dt.left)/10;return mt>2&&(it.cachedCharWidth=mt),mt||10}function fo(it){for(var at=it.display,ct={},dt={},mt=at.gutters.clientLeft,Lt=at.gutters.firstChild,Ot=0;Lt;Lt=Lt.nextSibling,++Ot){var Vt=it.display.gutterSpecs[Ot].className;ct[Vt]=Lt.offsetLeft+Lt.clientLeft+mt,dt[Vt]=Lt.clientWidth}return{fixedPos:Yr(at),gutterTotalWidth:at.gutters.offsetWidth,gutterLeft:ct,gutterWidth:dt,wrapperWidth:at.wrapper.clientWidth}}function Yr(it){return it.scroller.getBoundingClientRect().left-it.sizer.getBoundingClientRect().left}function Ir(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(en(it.doc,mt))return 0;var Lt=0;if(mt.widgets)for(var Ot=0;Ot<mt.widgets.length;Ot++)mt.widgets[Ot].height&&(Lt+=mt.widgets[Ot].height);return ct?Lt+(Math.ceil(mt.text.length/dt)||1)*at:Lt+at}}function Vi(it){var at=it.doc,ct=Ir(it);at.iter(function(dt){var mt=ct(dt);mt!=dt.height&&Tn(dt,mt)})}function to(it,at,ct,dt){var mt=it.display;if(!ct&&Wi(at).getAttribute("cm-not-content")=="true")return null;var Lt,Ot,Vt=mt.lineSpace.getBoundingClientRect();try{Lt=at.clientX-Vt.left,Ot=at.clientY-Vt.top}catch(fe){return null}var Ht=Ta(it,Lt,Ot),se;if(dt&&Ht.xRel>0&&(se=Gn(it.doc,Ht.line).text).length==Ht.ch){var We=te(se,se.length,it.options.tabSize)-se.length;Ht=ze(Ht.line,Math.max(0,Math.round((Lt-ns(it.display).left)/Pr(it.display))-We))}return Ht}function Hi(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)un&&ai(it.doc,at)<mt.viewTo&&kr(it);else if(ct<=mt.viewFrom)un&&pi(it.doc,ct+dt)>mt.viewFrom?kr(it):(mt.viewFrom+=dt,mt.viewTo+=dt);else if(at<=mt.viewFrom&&ct>=mt.viewTo)kr(it);else if(at<=mt.viewFrom){var Lt=Er(it,ct,ct+dt,1);Lt?(mt.view=mt.view.slice(Lt.index),mt.viewFrom=Lt.lineN,mt.viewTo+=dt):kr(it)}else if(ct>=mt.viewTo){var Ot=Er(it,at,at,-1);Ot?(mt.view=mt.view.slice(0,Ot.index),mt.viewTo=Ot.lineN):kr(it)}else{var Vt=Er(it,at,at,-1),Ht=Er(it,ct,ct+dt,1);Vt&&Ht?(mt.view=mt.view.slice(0,Vt.index).concat(zr(it,Vt.lineN,Ht.lineN)).concat(mt.view.slice(Ht.index)),mt.viewTo+=dt):kr(it)}var se=mt.externalMeasured;se&&(ct<se.lineN?se.lineN+=dt:at<se.lineN+se.size&&(mt.externalMeasured=null))}function Ui(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 Lt=dt.view[Hi(it,at)];if(Lt.node!=null){var Ot=Lt.changes||(Lt.changes=[]);Qe(Ot,ct)==-1&&Ot.push(ct)}}}function kr(it){it.display.viewFrom=it.display.viewTo=it.doc.first,it.display.view=[],it.display.viewOffset=0}function Er(it,at,ct,dt){var mt=Hi(it,at),Lt,Ot=it.display.view;if(!un||ct==it.doc.first+it.doc.size)return{index:mt,lineN:ct};for(var Vt=it.display.viewFrom,Ht=0;Ht<mt;Ht++)Vt+=Ot[Ht].size;if(Vt!=at){if(dt>0){if(mt==Ot.length-1)return null;Lt=Vt+Ot[mt].size-at,mt++}else Lt=Vt-at;at+=Lt,ct+=Lt}for(;ai(it.doc,ct)!=ct;){if(mt==(dt<0?0:Ot.length-1))return null;ct+=dt*Ot[mt-(dt<0?1:0)].size,mt+=dt}return{index:mt,lineN:ct}}function Tr(it,at,ct){var dt=it.display,mt=dt.view;mt.length==0||at>=dt.viewTo||ct<=dt.viewFrom?(dt.view=zr(it,at,ct),dt.viewFrom=at):(dt.viewFrom>at?dt.view=zr(it,at,dt.viewFrom).concat(dt.view):dt.viewFrom<at&&(dt.view=dt.view.slice(Hi(it,at))),dt.viewFrom=at,dt.viewTo<ct?dt.view=dt.view.concat(zr(it,dt.viewTo,ct)):dt.viewTo>ct&&(dt.view=dt.view.slice(0,Hi(it,ct)))),dt.viewTo=ct}function eo(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 Nr(it,at){at===void 0&&(at=!0);for(var ct=it.doc,dt={},mt=dt.cursors=document.createDocumentFragment(),Lt=dt.selection=document.createDocumentFragment(),Ot=0;Ot<ct.sel.ranges.length;Ot++)if(!(!at&&Ot==ct.sel.primIndex)){var Vt=ct.sel.ranges[Ot];if(!(Vt.from().line>=it.display.viewTo||Vt.to().line<it.display.viewFrom)){var Ht=Vt.empty();(Ht||it.options.showCursorWhenSelecting)&&Fi(it,Vt.head,mt),Ht||pr(it,Vt,Lt)}}return dt}function Fi(it,at,ct){var dt=_o(it,at,"div",null,null,!it.options.singleCursorHeightPerLine),mt=ct.appendChild(Gt("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 Lt=ct.appendChild(Gt("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));Lt.style.display="",Lt.style.left=dt.other.left+"px",Lt.style.top=dt.other.top+"px",Lt.style.height=(dt.other.bottom-dt.other.top)*.85+"px"}}function Xi(it,at){return it.top-at.top||it.left-at.left}function pr(it,at,ct){var dt=it.display,mt=it.doc,Lt=document.createDocumentFragment(),Ot=ns(it.display),Vt=Ot.left,Ht=Math.max(dt.sizerWidth,ps(it)-dt.sizer.offsetLeft)-Ot.right,se=mt.direction=="ltr";function We(xr,Kr,Eo,yr){Kr<0&&(Kr=0),Kr=Math.round(Kr),yr=Math.round(yr),Lt.appendChild(Gt("div",null,"CodeMirror-selected","position: absolute; left: "+xr+`px;
|
|
top: `+Kr+"px; width: "+(Eo==null?Ht-xr:Eo)+`px;
|
|
height: `+(yr-Kr)+"px"))}function fe(xr,Kr,Eo){var yr=Gn(mt,xr),Ho=yr.text.length,ka,ds;function za(os,Pl){return ga(it,ze(xr,os),"div",yr,Pl)}function ll(os,Pl,As){var as=Re(it,yr,null,os),ta=Pl=="ltr"==(As=="after")?"left":"right",Wa=As=="after"?as.begin:as.end-(/\s/.test(yr.text.charAt(as.end-1))?2:1);return za(Wa,ta)[ta]}var Gs=tn(yr,mt.direction);return xe(Gs,Kr||0,Eo==null?Ho:Eo,function(os,Pl,As,as){var ta=As=="ltr",Wa=za(os,ta?"left":"right"),ys=za(Pl-1,ta?"right":"left"),Ts=Kr==null&&os==0,fu=Eo==null&&Pl==Ho,Za=as==0,ql=!Gs||as==Gs.length-1;if(ys.top-Wa.top<=3){var Ua=(se?Ts:fu)&&Za,Dc=(se?fu:Ts)&&ql,_l=Ua?Vt:(ta?Wa:ys).left,wl=Dc?Ht:(ta?ys:Wa).right;We(_l,Wa.top,wl-_l,Wa.bottom)}else{var ul,ma,Ss,Hu;ta?(ul=se&&Ts&&Za?Vt:Wa.left,ma=se?Ht:ll(os,As,"before"),Ss=se?Vt:ll(Pl,As,"after"),Hu=se&&fu&&ql?Ht:ys.right):(ul=se?ll(os,As,"before"):Vt,ma=!se&&Ts&&Za?Ht:Wa.right,Ss=!se&&fu&&ql?Vt:ys.left,Hu=se?ll(Pl,As,"after"):Ht),We(ul,Wa.top,ma-ul,Wa.bottom),Wa.bottom<ys.top&&We(Vt,Wa.bottom,null,ys.top),We(Ss,ys.top,Hu-Ss,ys.bottom)}(!ka||Xi(Wa,ka)<0)&&(ka=Wa),Xi(ys,ka)<0&&(ka=ys),(!ds||Xi(Wa,ds)<0)&&(ds=Wa),Xi(ys,ds)<0&&(ds=ys)}),{start:ka,end:ds}}var Sn=at.from(),ln=at.to();if(Sn.line==ln.line)fe(Sn.line,Sn.ch,ln.ch);else{var Mi=Gn(mt,Sn.line),Bi=Gn(mt,ln.line),_i=An(Mi)==An(Bi),rr=fe(Sn.line,Sn.ch,_i?Mi.text.length+1:null).end,jr=fe(ln.line,_i?0:null,ln.ch).start;_i&&(rr.top<jr.top-2?(We(rr.right,rr.top,null,rr.bottom),We(Vt,jr.top,jr.left,jr.bottom)):We(rr.right,rr.top,jr.left-rr.right,rr.bottom)),rr.bottom<jr.top&&We(Vt,rr.bottom,null,jr.top)}ct.appendChild(Lt)}function ao(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 mo(it){it.state.focused||(it.display.input.focus(),Ji(it))}function Ro(it){it.state.delayingBlurEvent=!0,setTimeout(function(){it.state.delayingBlurEvent&&(it.state.delayingBlurEvent=!1,_a(it))},100)}function Ji(it,at){it.state.delayingBlurEvent&&(it.state.delayingBlurEvent=!1),it.options.readOnly!="nocursor"&&(it.state.focused||(Ke(it,"focus",it,at),it.state.focused=!0,ye(it.display.wrapper,"CodeMirror-focused"),!it.curOp&&it.display.selForContextMenu!=it.doc.sel&&(it.display.input.reset(),ee&&setTimeout(function(){return it.display.input.reset(!0)},20)),it.display.input.receivedFocus()),ao(it))}function _a(it,at){it.state.delayingBlurEvent||(it.state.focused&&(Ke(it,"blur",it,at),it.state.focused=!1,It(it.display.wrapper,"CodeMirror-focused")),clearInterval(it.display.blinker),setTimeout(function(){it.state.focused||(it.display.shift=!1)},150))}function wr(it){for(var at=it.display,ct=at.lineDiv.offsetTop,dt=0;dt<at.view.length;dt++){var mt=at.view[dt],Lt=it.options.lineWrapping,Ot=void 0,Vt=0;if(!mt.hidden){if(ue&&Dt<8){var Ht=mt.node.offsetTop+mt.node.offsetHeight;Ot=Ht-ct,ct=Ht}else{var se=mt.node.getBoundingClientRect();Ot=se.bottom-se.top,!Lt&&mt.text.firstChild&&(Vt=mt.text.firstChild.getBoundingClientRect().right-se.left-1)}var We=mt.line.height-Ot;if((We>.005||We<-.005)&&(Tn(mt.line,Ot),uo(mt.line),mt.rest))for(var fe=0;fe<mt.rest.length;fe++)uo(mt.rest[fe]);if(Vt>it.display.sizerWidth){var Sn=Math.ceil(Vt/Pr(it.display));Sn>it.display.maxLineLength&&(it.display.maxLineLength=Sn,it.display.maxLine=mt.line,it.display.maxLineChanged=!0)}}}}function uo(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 Br(it,at,ct){var dt=ct&&ct.top!=null?Math.max(0,ct.top):it.scroller.scrollTop;dt=Math.floor(dt-io(it));var mt=ct&&ct.bottom!=null?ct.bottom:dt+it.wrapper.clientHeight,Lt=me(at,dt),Ot=me(at,mt);if(ct&&ct.ensure){var Vt=ct.ensure.from.line,Ht=ct.ensure.to.line;Vt<Lt?(Lt=Vt,Ot=me(at,tr(Gn(at,Vt))+it.wrapper.clientHeight)):Math.min(Ht,at.lastLine())>=Ot&&(Lt=me(at,tr(Gn(at,Ht))-it.wrapper.clientHeight),Ot=Ht)}return{from:Lt,to:Math.max(Ot,Lt+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&&!Le){var Lt=Gt("div","\u200B",null,`position: absolute;
|
|
top: `+(at.top-ct.viewOffset-io(it.display))+`px;
|
|
height: `+(at.bottom-at.top+Jo(it)+ct.barHeight)+`px;
|
|
left: `+at.left+"px; width: "+Math.max(2,at.right-at.left)+"px;");it.display.lineSpace.appendChild(Lt),Lt.scrollIntoView(mt),it.display.lineSpace.removeChild(Lt)}}}function Zo(it,at,ct,dt){dt==null&&(dt=0);var mt;!it.options.lineWrapping&&at==ct&&(at=at.ch?ze(at.line,at.sticky=="before"?at.ch-1:at.ch,"after"):at,ct=at.sticky=="before"?ze(at.line,at.ch+1,"before"):at);for(var Lt=0;Lt<5;Lt++){var Ot=!1,Vt=_o(it,at),Ht=!ct||ct==at?Vt:_o(it,ct);mt={left:Math.min(Vt.left,Ht.left),top:Math.min(Vt.top,Ht.top)-dt,right:Math.max(Vt.left,Ht.left),bottom:Math.max(Vt.bottom,Ht.bottom)+dt};var se=Al(it,mt),We=it.doc.scrollTop,fe=it.doc.scrollLeft;if(se.scrollTop!=null&&(ol(it,se.scrollTop),Math.abs(it.doc.scrollTop-We)>1&&(Ot=!0)),se.scrollLeft!=null&&(Ul(it,se.scrollLeft),Math.abs(it.doc.scrollLeft-fe)>1&&(Ot=!0)),!Ot)break}return mt}function Fa(it,at){var ct=Al(it,at);ct.scrollTop!=null&&ol(it,ct.scrollTop),ct.scrollLeft!=null&&Ul(it,ct.scrollLeft)}function Al(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,Lt=ms(it),Ot={};at.bottom-at.top>Lt&&(at.bottom=at.top+Lt);var Vt=it.doc.height+Sa(ct),Ht=at.top<dt,se=at.bottom>Vt-dt;if(at.top<mt)Ot.scrollTop=Ht?0:at.top;else if(at.bottom>mt+Lt){var We=Math.min(at.top,(se?Vt:at.bottom)-Lt);We!=mt&&(Ot.scrollTop=We)}var fe=it.options.fixedGutter?0:ct.gutters.offsetWidth,Sn=it.curOp&&it.curOp.scrollLeft!=null?it.curOp.scrollLeft:ct.scroller.scrollLeft-fe,ln=ps(it)-ct.gutters.offsetWidth,Mi=at.right-at.left>ln;return Mi&&(at.right=at.left+ln),at.left<10?Ot.scrollLeft=0:at.left<Sn?Ot.scrollLeft=Math.max(0,at.left+fe-(Mi?0:10)):at.right>ln+Sn-3&&(Ot.scrollLeft=at.right+(Mi?0:10)-ln),Ot}function hu(it,at){at!=null&&(Ns(it),it.curOp.scrollTop=(it.curOp.scrollTop==null?it.doc.scrollTop:it.curOp.scrollTop)+at)}function Ys(it){Ns(it);var at=it.getCursor();it.curOp.scrollToPos={from:at,to:at,margin:it.options.cursorScrollMargin}}function Tl(it,at,ct){(at!=null||ct!=null)&&Ns(it),at!=null&&(it.curOp.scrollLeft=at),ct!=null&&(it.curOp.scrollTop=ct)}function Oo(it,at){Ns(it),it.curOp.scrollToPos=at}function Ns(it){var at=it.curOp.scrollToPos;if(at){it.curOp.scrollToPos=null;var ct=Co(it,at.from),dt=Co(it,at.to);gl(it,ct,dt,at.margin)}}function gl(it,at,ct,dt){var mt=Al(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});Tl(it,mt.scrollLeft,mt.scrollTop)}function ol(it,at){Math.abs(it.doc.scrollTop-at)<2||(ft||us(it,{top:at}),Ph(it,at,!0),ft&&us(it),Uo(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 Ul(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,ih(it),it.display.scroller.scrollLeft!=at&&(it.display.scroller.scrollLeft=at),it.display.scrollbars.setScrollLeft(at))}function bo(it){var at=it.display,ct=at.gutters.offsetWidth,dt=Math.round(it.doc.height+Sa(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+Jo(it)+at.barHeight,nativeBarWidth:at.nativeBarWidth,gutterWidth:ct}}var Wo=function(it,at,ct){this.cm=ct;var dt=this.vert=Gt("div",[Gt("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),mt=this.horiz=Gt("div",[Gt("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");dt.tabIndex=mt.tabIndex=-1,it(dt),it(mt),fn(dt,"scroll",function(){dt.clientHeight&&at(dt.scrollTop,"vertical")}),fn(mt,"scroll",function(){mt.clientWidth&&at(mt.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,ue&&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 Lt=it.viewWidth-it.barLeft-(ct?dt:0);this.horiz.firstChild.style.width=Math.max(0,it.scrollWidth-it.clientWidth+Lt)+"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&&!ae?"12px":"18px";this.horiz.style.height=this.vert.style.width=it,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new Xt,this.disableVert=new Xt},Wo.prototype.enableZeroWidthBar=function(it,at,ct){it.style.pointerEvents="auto";function dt(){var mt=it.getBoundingClientRect(),Lt=ct=="vert"?document.elementFromPoint(mt.right-1,(mt.top+mt.bottom)/2):document.elementFromPoint((mt.right+mt.left)/2,mt.bottom-1);Lt!=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 Pa=function(){};Pa.prototype.update=function(){return{bottom:0,right:0}},Pa.prototype.setScrollLeft=function(){},Pa.prototype.setScrollTop=function(){},Pa.prototype.clear=function(){};function is(it,at){at||(at=bo(it));var ct=it.display.barWidth,dt=it.display.barHeight;Qa(it,at);for(var mt=0;mt<4&&ct!=it.display.barWidth||dt!=it.display.barHeight;mt++)ct!=it.display.barWidth&&it.options.lineWrapping&&wr(it),Qa(it,bo(it)),ct=it.display.barWidth,dt=it.display.barHeight}function Qa(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 pl={native:Wo,null:Pa};function Yl(it){it.display.scrollbars&&(it.display.scrollbars.clear(),it.display.scrollbars.addClass&&It(it.display.wrapper,it.display.scrollbars.addClass)),it.display.scrollbars=new pl[it.options.scrollbarStyle](function(at){it.display.wrapper.insertBefore(at,it.display.scrollbarFiller),fn(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"?Ul(it,at):ol(it,at)},it),it.display.scrollbars.addClass&&ye(it.display.wrapper,it.display.scrollbars.addClass)}var du=0;function al(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:++du},ha(it.curOp)}function ml(it){var at=it.curOp;at&&bs(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++)fg(at[dt]);for(var mt=0;mt<at.length;mt++)af(at[mt]);for(var Lt=0;Lt<at.length;Lt++)sn(at[Lt]);for(var Ot=0;Ot<at.length;Ot++)$i(at[Ot])}function of(it){var at=it.cm,ct=at.display;ls(at),it.updateMaxLine&&or(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 Mo(at,it.mustUpdate&&{top:it.scrollTop,ensure:it.scrollToPos},it.forceUpdate)}function fg(it){it.updatedDisplay=it.mustUpdate&&Ru(it.cm,it.update)}function af(it){var at=it.cm,ct=at.display;it.updatedDisplay&&wr(at),it.barMeasure=bo(at),ct.maxLineChanged&&!at.options.lineWrapping&&(it.adjustWidthTo=Cu(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+Jo(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 sn(it){var at=it.cm;it.adjustWidthTo!=null&&(at.display.sizer.style.minWidth=it.adjustWidthTo+"px",it.maxScrollLeft<at.doc.scrollLeft&&Ul(at,Math.min(at.display.scroller.scrollLeft,it.maxScrollLeft),!0),at.display.maxLineChanged=!1);var ct=it.focus&&it.focus==ve();it.preparedSelection&&at.display.input.showSelection(it.preparedSelection,ct),(it.updatedDisplay||it.startHeight!=at.doc.height)&&is(at,it.barMeasure),it.updatedDisplay&&Xs(at,it.barMeasure),it.selectionChanged&&ao(at),at.state.focused&&it.updateInput&&at.display.input.reset(it.typing),ct&&mo(it.cm)}function $i(it){var at=it.cm,ct=at.display,dt=at.doc;if(it.updatedDisplay&&qi(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&&Ul(at,it.scrollLeft,!0,!0),it.scrollToPos){var mt=Zo(at,hi(dt,it.scrollToPos.from),hi(dt,it.scrollToPos.to),it.scrollToPos.margin);ea(at,mt)}var Lt=it.maybeHiddenMarkers,Ot=it.maybeUnhiddenMarkers;if(Lt)for(var Vt=0;Vt<Lt.length;++Vt)Lt[Vt].lines.length||Ke(Lt[Vt],"hide");if(Ot)for(var Ht=0;Ht<Ot.length;++Ht)Ot[Ht].lines.length&&Ke(Ot[Ht],"unhide");ct.wrapper.offsetHeight&&(dt.scrollTop=at.display.scroller.scrollTop),it.changeObjs&&Ke(at,"changes",at,it.changeObjs),it.update&&it.update.finish()}function mr(it,at){if(it.curOp)return at();al(it);try{return at()}finally{ml(it)}}function lr(it,at){return function(){if(it.curOp)return at.apply(it,arguments);al(it);try{return at.apply(it,arguments)}finally{ml(it)}}}function ki(it){return function(){if(this.curOp)return it.apply(this,arguments);al(this);try{return it.apply(this,arguments)}finally{ml(this)}}}function ho(it){return function(){var at=this.cm;if(!at||at.curOp)return it.apply(this,arguments);al(at);try{return it.apply(this,arguments)}finally{ml(at)}}}function Uo(it,at){it.doc.highlightFrontier<it.display.viewTo&&it.state.highlight.set(at,qe(jo,it))}function jo(it){var at=it.doc;if(!(at.highlightFrontier>=it.display.viewTo)){var ct=+new Date+it.options.workTime,dt=Xr(it,at.highlightFrontier),mt=[];at.iter(dt.line,Math.min(at.first+at.size,it.display.viewTo+500),function(Lt){if(dt.line>=it.display.viewFrom){var Ot=Lt.styles,Vt=Lt.text.length>it.options.maxHighlightLength?xi(at.mode,dt.state):null,Ht=fr(it,Lt,dt,!0);Vt&&(dt.state=Vt),Lt.styles=Ht.styles;var se=Lt.styleClasses,We=Ht.classes;We?Lt.styleClasses=We:se&&(Lt.styleClasses=null);for(var fe=!Ot||Ot.length!=Lt.styles.length||se!=We&&(!se||!We||se.bgClass!=We.bgClass||se.textClass!=We.textClass),Sn=0;!fe&&Sn<Ot.length;++Sn)fe=Ot[Sn]!=Lt.styles[Sn];fe&&mt.push(dt.line),Lt.stateAfter=dt.save(),dt.nextLine()}else Lt.text.length<=it.options.maxHighlightLength&&Ae(it,Lt.text,dt),Lt.stateAfter=dt.line%5==0?dt.save():null,dt.nextLine();if(+new Date>ct)return Uo(it,it.options.workDelay),!0}),at.highlightFrontier=dt.line,at.modeFrontier=Math.max(at.modeFrontier,dt.line),mt.length&&mr(it,function(){for(var Lt=0;Lt<mt.length;Lt++)Ui(it,mt[Lt],"text")})}}var Mo=function(it,at,ct){var dt=it.display;this.viewport=at,this.visible=Br(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=fo(it),this.events=[]};Mo.prototype.signal=function(it,at){gn(it,at)&&this.events.push(arguments)},Mo.prototype.finish=function(){for(var it=0;it<this.events.length;it++)Ke.apply(null,this.events[it])};function ls(it){var at=it.display;!at.scrollbarsClipped&&at.scroller.offsetWidth&&(at.nativeBarWidth=at.scroller.offsetWidth-at.scroller.clientWidth,at.heightForcer.style.height=Jo(it)+"px",at.sizer.style.marginBottom=-at.nativeBarWidth+"px",at.sizer.style.borderRightWidth=Jo(it)+"px",at.scrollbarsClipped=!0)}function ra(it){if(it.hasFocus())return null;var at=ve();if(!at||!Te(it.display.lineDiv,at))return null;var ct={activeElt:at};if(window.getSelection){var dt=window.getSelection();dt.anchorNode&&dt.extend&&Te(it.display.lineDiv,dt.anchorNode)&&(ct.anchorNode=dt.anchorNode,ct.anchorOffset=dt.anchorOffset,ct.focusNode=dt.focusNode,ct.focusOffset=dt.focusOffset)}return ct}function Ra(it){if(!(!it||!it.activeElt||it.activeElt==ve())&&(it.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(it.activeElt.nodeName)&&it.anchorNode&&Te(document.body,it.anchorNode)&&Te(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 Ru(it,at){var ct=it.display,dt=it.doc;if(at.editorIsHidden)return kr(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&&eo(it)==0)return!1;Ma(it)&&(kr(it),at.dims=fo(it));var mt=dt.first+dt.size,Lt=Math.max(at.visible.from-it.options.viewportMargin,dt.first),Ot=Math.min(mt,at.visible.to+it.options.viewportMargin);ct.viewFrom<Lt&&Lt-ct.viewFrom<20&&(Lt=Math.max(dt.first,ct.viewFrom)),ct.viewTo>Ot&&ct.viewTo-Ot<20&&(Ot=Math.min(mt,ct.viewTo)),un&&(Lt=ai(it.doc,Lt),Ot=pi(it.doc,Ot));var Vt=Lt!=ct.viewFrom||Ot!=ct.viewTo||ct.lastWrapHeight!=at.wrapperHeight||ct.lastWrapWidth!=at.wrapperWidth;Tr(it,Lt,Ot),ct.viewOffset=tr(Gn(it.doc,ct.viewFrom)),it.display.mover.style.top=ct.viewOffset+"px";var Ht=eo(it);if(!Vt&&Ht==0&&!at.force&&ct.renderedView==ct.view&&(ct.updateLineNumbers==null||ct.updateLineNumbers>=ct.viewTo))return!1;var se=ra(it);return Ht>4&&(ct.lineDiv.style.display="none"),vl(it,ct.updateLineNumbers,at.dims),Ht>4&&(ct.lineDiv.style.display=""),ct.renderedView=ct.view,Ra(se),qt(ct.cursorDiv),qt(ct.selectionDiv),ct.gutters.style.height=ct.sizer.style.minHeight=0,Vt&&(ct.lastWrapHeight=at.wrapperHeight,ct.lastWrapWidth=at.wrapperWidth,Uo(it,400)),ct.updateLineNumbers=null,!0}function qi(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+Sa(it.display)-ms(it),ct.top)}),at.visible=Br(it.display,it.doc,ct),at.visible.from>=it.display.viewFrom&&at.visible.to<=it.display.viewTo)break}else dt&&(at.visible=Br(it.display,it.doc,ct));if(!Ru(it,at))break;wr(it);var mt=bo(it);zi(it),is(it,mt),Xs(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 us(it,at){var ct=new Mo(it,at);if(Ru(it,ct)){wr(it),qi(it,ct);var dt=bo(it);zi(it),is(it,dt),Xs(it,dt),ct.finish()}}function vl(it,at,ct){var dt=it.display,mt=it.options.lineNumbers,Lt=dt.lineDiv,Ot=Lt.firstChild;function Vt(Mi){var Bi=Mi.nextSibling;return ee&&ht&&it.display.currentWheelTarget==Mi?Mi.style.display="none":Mi.parentNode.removeChild(Mi),Bi}for(var Ht=dt.view,se=dt.viewFrom,We=0;We<Ht.length;We++){var fe=Ht[We];if(!fe.hidden)if(!fe.node||fe.node.parentNode!=Lt){var Sn=co(it,fe,se,ct);Lt.insertBefore(Sn,Ot)}else{for(;Ot!=fe.node;)Ot=Vt(Ot);var ln=mt&&at!=null&&at<=se&&fe.lineNumber;fe.changes&&(Qe(fe.changes,"gutter")>-1&&(ln=!1),qo(it,fe,se,ct)),ln&&(qt(fe.lineNumber),fe.lineNumber.appendChild(document.createTextNode(_n(it.options,se)))),Ot=fe.node.nextSibling}se+=fe.size}for(;Ot;)Ot=Vt(Ot)}function Ha(it){var at=it.gutters.offsetWidth;it.sizer.style.marginLeft=at+"px"}function Xs(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+Jo(it)+"px"}function ih(it){var at=it.display,ct=at.view;if(!(!at.alignWidgets&&(!at.gutters.firstChild||!it.options.fixedGutter))){for(var dt=Yr(at)-at.scroller.scrollLeft+it.doc.scrollLeft,mt=at.gutters.offsetWidth,Lt=dt+"px",Ot=0;Ot<ct.length;Ot++)if(!ct[Ot].hidden){it.options.fixedGutter&&(ct[Ot].gutter&&(ct[Ot].gutter.style.left=Lt),ct[Ot].gutterBackground&&(ct[Ot].gutterBackground.style.left=Lt));var Vt=ct[Ot].alignable;if(Vt)for(var Ht=0;Ht<Vt.length;Ht++)Vt[Ht].style.left=Lt}it.options.fixedGutter&&(at.gutters.style.left=dt+mt+"px")}}function Ma(it){if(!it.options.lineNumbers)return!1;var at=it.doc,ct=_n(it.options,at.first+at.size-1),dt=it.display;if(ct.length!=dt.lineNumChars){var mt=dt.measure.appendChild(Gt("div",[Gt("div",ct)],"CodeMirror-linenumber CodeMirror-gutter-elt")),Lt=mt.firstChild.offsetWidth,Ot=mt.offsetWidth-Lt;return dt.lineGutter.style.width="",dt.lineNumInnerWidth=Math.max(Lt,dt.lineGutter.offsetWidth-Ot)+1,dt.lineNumWidth=dt.lineNumInnerWidth+Ot,dt.lineNumChars=dt.lineNumInnerWidth?ct.length:-1,dt.lineGutter.style.width=dt.lineNumWidth+"px",Ha(it.display),!0}return!1}function Ea(it,at){for(var ct=[],dt=!1,mt=0;mt<it.length;mt++){var Lt=it[mt],Ot=null;if(typeof Lt!="string"&&(Ot=Lt.style,Lt=Lt.className),Lt=="CodeMirror-linenumbers")if(at)dt=!0;else continue;ct.push({className:Lt,style:Ot})}return at&&!dt&&ct.push({className:"CodeMirror-linenumbers",style:null}),ct}function Xl(it){var at=it.gutters,ct=it.gutterSpecs;qt(at),it.lineGutter=null;for(var dt=0;dt<ct.length;++dt){var mt=ct[dt],Lt=mt.className,Ot=mt.style,Vt=at.appendChild(Gt("div",null,"CodeMirror-gutter "+Lt));Ot&&(Vt.style.cssText=Ot),Lt=="CodeMirror-linenumbers"&&(it.lineGutter=Vt,Vt.style.width=(it.lineNumWidth||1)+"px")}at.style.display=ct.length?"":"none",Ha(it)}function Dl(it){Xl(it.display),ir(it),ih(it)}function wh(it,at,ct,dt){var mt=this;this.input=ct,mt.scrollbarFiller=Gt("div",null,"CodeMirror-scrollbar-filler"),mt.scrollbarFiller.setAttribute("cm-not-content","true"),mt.gutterFiller=Gt("div",null,"CodeMirror-gutter-filler"),mt.gutterFiller.setAttribute("cm-not-content","true"),mt.lineDiv=ge("div",null,"CodeMirror-code"),mt.selectionDiv=Gt("div",null,null,"position: relative; z-index: 1"),mt.cursorDiv=Gt("div",null,"CodeMirror-cursors"),mt.measure=Gt("div",null,"CodeMirror-measure"),mt.lineMeasure=Gt("div",null,"CodeMirror-measure"),mt.lineSpace=ge("div",[mt.measure,mt.lineMeasure,mt.selectionDiv,mt.cursorDiv,mt.lineDiv],null,"position: relative; outline: none");var Lt=ge("div",[mt.lineSpace],"CodeMirror-lines");mt.mover=Gt("div",[Lt],null,"position: relative"),mt.sizer=Gt("div",[mt.mover],"CodeMirror-sizer"),mt.sizerWidth=null,mt.heightForcer=Gt("div",null,null,"position: absolute; height: "+On+"px; width: 1px;"),mt.gutters=Gt("div",null,"CodeMirror-gutters"),mt.lineGutter=null,mt.scroller=Gt("div",[mt.sizer,mt.heightForcer,mt.gutters],"CodeMirror-scroll"),mt.scroller.setAttribute("tabIndex","-1"),mt.wrapper=Gt("div",[mt.scrollbarFiller,mt.gutterFiller,mt.scroller],"CodeMirror"),ue&&Dt<8&&(mt.gutters.style.zIndex=-1,mt.scroller.style.paddingRight=0),!ee&&!(ft&&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=Ea(dt.gutters,dt.lineNumbers),Xl(mt),ct.init(mt)}var yl=0,$a=null;ue?$a=-.53:ft?$a=15:Jt?$a=-.7:De&&($a=-1/3);function Lu(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 Ol(it){var at=Lu(it);return at.x*=$a,at.y*=$a,at}function vs(it,at){var ct=Lu(at),dt=ct.x,mt=ct.y,Lt=it.display,Ot=Lt.scroller,Vt=Ot.scrollWidth>Ot.clientWidth,Ht=Ot.scrollHeight>Ot.clientHeight;if(dt&&Vt||mt&&Ht){if(mt&&ht&&ee){t:for(var se=at.target,We=Lt.view;se!=Ot;se=se.parentNode)for(var fe=0;fe<We.length;fe++)if(We[fe].node==se){it.display.currentWheelTarget=se;break t}}if(dt&&!ft&&!jt&&$a!=null){mt&&Ht&&ol(it,Math.max(0,Ot.scrollTop+mt*$a)),Ul(it,Math.max(0,Ot.scrollLeft+dt*$a)),(!mt||mt&&Ht)&&zn(at),Lt.wheelStartX=null;return}if(mt&&$a!=null){var Sn=mt*$a,ln=it.doc.scrollTop,Mi=ln+Lt.wrapper.clientHeight;Sn<0?ln=Math.max(0,ln+Sn-50):Mi=Math.min(it.doc.height,Mi+Sn+50),us(it,{top:ln,bottom:Mi})}yl<20&&(Lt.wheelStartX==null?(Lt.wheelStartX=Ot.scrollLeft,Lt.wheelStartY=Ot.scrollTop,Lt.wheelDX=dt,Lt.wheelDY=mt,setTimeout(function(){if(Lt.wheelStartX!=null){var Bi=Ot.scrollLeft-Lt.wheelStartX,_i=Ot.scrollTop-Lt.wheelStartY,rr=_i&&Lt.wheelDY&&_i/Lt.wheelDY||Bi&&Lt.wheelDX&&Bi/Lt.wheelDX;Lt.wheelStartX=Lt.wheelStartY=null,rr&&($a=($a*yl+rr)/(yl+1),++yl)}},200)):(Lt.wheelDX+=dt,Lt.wheelDY+=mt))}}var Jl=function(it,at){this.ranges=it,this.primIndex=at};Jl.prototype.primary=function(){return this.ranges[this.primIndex]},Jl.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(!Nn(ct.anchor,dt.anchor)||!Nn(ct.head,dt.head))return!1}return!0},Jl.prototype.deepCopy=function(){for(var it=[],at=0;at<this.ranges.length;at++)it[at]=new aa(In(this.ranges[at].anchor),In(this.ranges[at].head));return new Jl(it,this.primIndex)},Jl.prototype.somethingSelected=function(){for(var it=0;it<this.ranges.length;it++)if(!this.ranges[it].empty())return!0;return!1},Jl.prototype.contains=function(it,at){at||(at=it);for(var ct=0;ct<this.ranges.length;ct++){var dt=this.ranges[ct];if(hn(at,dt.from())>=0&&hn(it,dt.to())<=0)return ct}return-1};var aa=function(it,at){this.anchor=it,this.head=at};aa.prototype.from=function(){return Jn(this.anchor,this.head)},aa.prototype.to=function(){return vi(this.anchor,this.head)},aa.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function cu(it,at,ct){var dt=it&&it.options.selectionsMayTouch,mt=at[ct];at.sort(function(Sn,ln){return hn(Sn.from(),ln.from())}),ct=Qe(at,mt);for(var Lt=1;Lt<at.length;Lt++){var Ot=at[Lt],Vt=at[Lt-1],Ht=hn(Vt.to(),Ot.from());if(dt&&!Ot.empty()?Ht>0:Ht>=0){var se=Jn(Vt.from(),Ot.from()),We=vi(Vt.to(),Ot.to()),fe=Vt.empty()?Ot.from()==Ot.head:Vt.from()==Vt.head;Lt<=ct&&--ct,at.splice(--Lt,2,new aa(fe?We:se,fe?se:We))}}return new Jl(at,ct)}function rh(it,at){return new Jl([new aa(it,at||it)],0)}function Ch(it){return it.text?ze(it.from.line+it.text.length-1,Ce(it.text).length+(it.text.length==1?it.from.ch:0)):it.to}function $h(it,at){if(hn(it,at.from)<0)return it;if(hn(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),ze(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 aa($h(mt.anchor,at),$h(mt.head,at)))}return cu(it.cm,ct,it.sel.primIndex)}function Td(it,at,ct){return it.line==at.line?ze(ct.line,it.ch-at.ch+ct.ch):ze(ct.line+(it.line-at.line),it.ch)}function gc(it,at,ct){for(var dt=[],mt=ze(it.first,0),Lt=mt,Ot=0;Ot<at.length;Ot++){var Vt=at[Ot],Ht=Td(Vt.from,mt,Lt),se=Td(Ch(Vt),mt,Lt);if(mt=Vt.to,Lt=se,ct=="around"){var We=it.sel.ranges[Ot],fe=hn(We.head,We.anchor)<0;dt[Ot]=new aa(fe?se:Ht,fe?Ht:se)}else dt[Ot]=new aa(Ht,Ht)}return new Jl(dt,it.sel.primIndex)}function Go(it){it.doc.mode=Se(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,Uo(it,100),it.state.modeGen++,it.curOp&&ir(it)}function gg(it,at){return at.from.ch==0&&at.to.ch==0&&Ce(at.text)==""&&(!it.cm||it.cm.options.wholeLineUpdateBefore)}function sf(it,at,ct,dt){function mt(jr){return ct?ct[jr]:null}function Lt(jr,xr,Kr){qr(jr,xr,Kr,dt),dr(jr,"change",jr,at)}function Ot(jr,xr){for(var Kr=[],Eo=jr;Eo<xr;++Eo)Kr.push(new so(se[Eo],mt(Eo),dt));return Kr}var Vt=at.from,Ht=at.to,se=at.text,We=Gn(it,Vt.line),fe=Gn(it,Ht.line),Sn=Ce(se),ln=mt(se.length-1),Mi=Ht.line-Vt.line;if(at.full)it.insert(0,Ot(0,se.length)),it.remove(se.length,it.size-se.length);else if(gg(it,at)){var Bi=Ot(0,se.length-1);Lt(fe,fe.text,ln),Mi&&it.remove(Vt.line,Mi),Bi.length&&it.insert(Vt.line,Bi)}else if(We==fe)if(se.length==1)Lt(We,We.text.slice(0,Vt.ch)+Sn+We.text.slice(Ht.ch),ln);else{var _i=Ot(1,se.length-1);_i.push(new so(Sn+We.text.slice(Ht.ch),ln,dt)),Lt(We,We.text.slice(0,Vt.ch)+se[0],mt(0)),it.insert(Vt.line+1,_i)}else if(se.length==1)Lt(We,We.text.slice(0,Vt.ch)+se[0]+fe.text.slice(Ht.ch),mt(0)),it.remove(Vt.line+1,Mi);else{Lt(We,We.text.slice(0,Vt.ch)+se[0],mt(0)),Lt(fe,Sn+fe.text.slice(Ht.ch),ln);var rr=Ot(1,se.length-1);Mi>1&&it.remove(Vt.line+1,Mi-1),it.insert(Vt.line+1,rr)}dr(it,"change",it,at)}function Fu(it,at,ct){function dt(mt,Lt,Ot){if(mt.linked)for(var Vt=0;Vt<mt.linked.length;++Vt){var Ht=mt.linked[Vt];if(Ht.doc!=Lt){var se=Ot&&Ht.sharedHist;ct&&!se||(at(Ht.doc,se),dt(Ht.doc,mt,se))}}}dt(it,null,!0)}function lf(it,at){if(at.cm)throw new Error("This document is already in use.");it.doc=at,at.cm=it,Vi(it),Go(it),mc(it),it.options.lineWrapping||or(it),it.options.mode=at.modeOption,ir(it)}function mc(it){(it.doc.direction=="rtl"?ye:It)(it.display.lineDiv,"CodeMirror-rtl")}function q0(it){mr(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 uf(it,at){var ct={from:In(at.from),to:Ch(at),text:Ai(it,at.from,at.to)};return Eh(it,ct,at.from.line,at.to.line+1),Fu(it,function(dt){return Eh(dt,ct,at.from.line,at.to.line+1)},!0),ct}function Od(it){for(;it.length;){var at=Ce(it);if(at.ranges)it.pop();else break}}function vc(it,at){if(at)return Od(it.done),Ce(it.done);if(it.done.length&&!Ce(it.done).ranges)return Ce(it.done);if(it.done.length>1&&!it.done[it.done.length-2].ranges)return it.done.pop(),Ce(it.done)}function yc(it,at,ct,dt){var mt=it.history;mt.undone.length=0;var Lt=+new Date,Ot,Vt;if((mt.lastOp==dt||mt.lastOrigin==at.origin&&at.origin&&(at.origin.charAt(0)=="+"&&mt.lastModTime>Lt-(it.cm?it.cm.options.historyEventDelay:500)||at.origin.charAt(0)=="*"))&&(Ot=vc(mt,mt.lastOp==dt)))Vt=Ce(Ot.changes),hn(at.from,at.to)==0&&hn(at.from,Vt.to)==0?Vt.to=Ch(at):Ot.changes.push(uf(it,at));else{var Ht=Ce(mt.done);for((!Ht||!Ht.ranges)&&Id(it.sel,mt.done),Ot={changes:[uf(it,at)],generation:mt.generation},mt.done.push(Ot);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=Lt,mt.lastOp=mt.lastSelOp=dt,mt.lastOrigin=mt.lastSelOrigin=at.origin,Vt||Ke(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,Lt=dt&&dt.origin;ct==mt.lastSelOp||Lt&&mt.lastSelOrigin==Lt&&(mt.lastModTime==mt.lastSelTime&&mt.lastOrigin==Lt||pg(it,Lt,Ce(mt.done),at))?mt.done[mt.done.length-1]=at:Id(at,mt.done),mt.lastSelTime=+new Date,mt.lastSelOrigin=Lt,mt.lastSelOp=ct,dt&&dt.clearRedo!==!1&&Od(mt.undone)}function Id(it,at){var ct=Ce(at);ct&&ct.ranges&&ct.equals(it)||at.push(it)}function Eh(it,at,ct,dt){var mt=at["spans_"+it.id],Lt=0;it.iter(Math.max(it.first,ct),Math.min(it.first+it.size,dt),function(Ot){Ot.markedSpans&&((mt||(mt=at["spans_"+it.id]={}))[Lt]=Ot.markedSpans),++Lt})}function Js(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 ju(it,at){var ct=at["spans_"+it.id];if(!ct)return null;for(var dt=[],mt=0;mt<at.text.length;++mt)dt.push(Js(ct[mt]));return dt}function hf(it,at){var ct=ju(it,at),dt=Lo(it,at);if(!ct)return dt;if(!dt)return ct;for(var mt=0;mt<ct.length;++mt){var Lt=ct[mt],Ot=dt[mt];if(Lt&&Ot)t:for(var Vt=0;Vt<Ot.length;++Vt){for(var Ht=Ot[Vt],se=0;se<Lt.length;++se)if(Lt[se].marker==Ht.marker)continue t;Lt.push(Ht)}else Ot&&(ct[mt]=Ot)}return ct}function oh(it,at,ct){for(var dt=[],mt=0;mt<it.length;++mt){var Lt=it[mt];if(Lt.ranges){dt.push(ct?Jl.prototype.deepCopy.call(Lt):Lt);continue}var Ot=Lt.changes,Vt=[];dt.push({changes:Vt});for(var Ht=0;Ht<Ot.length;++Ht){var se=Ot[Ht],We=void 0;if(Vt.push({from:se.from,to:se.to,text:se.text}),at)for(var fe in se)(We=fe.match(/^spans_(\d+)$/))&&Qe(at,Number(We[1]))>-1&&(Ce(Vt)[fe]=se[fe],delete se[fe])}}return dt}function df(it,at,ct,dt){if(dt){var mt=it.anchor;if(ct){var Lt=hn(at,mt)<0;Lt!=hn(ct,mt)<0?(mt=at,at=ct):Lt!=hn(at,ct)<0&&(at=ct)}return new aa(mt,at)}else return new aa(ct||at,at)}function cf(it,at,ct,dt,mt){mt==null&&(mt=it.cm&&(it.cm.display.shift||it.extend)),Zs(it,new Jl([df(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),Lt=0;Lt<it.sel.ranges.length;Lt++)dt[Lt]=df(it.sel.ranges[Lt],at[Lt],null,mt);var Ot=cu(it.cm,dt,it.sel.primIndex);Zs(it,Ot,ct)}function Lh(it,at,ct,dt){var mt=it.sel.ranges.slice(0);mt[at]=ct,Zs(it,cu(it.cm,mt,it.sel.primIndex),dt)}function qh(it,at,ct,dt){Zs(it,rh(at,ct),dt)}function Wp(it,at,ct){var dt={ranges:at.ranges,update:function(mt){this.ranges=[];for(var Lt=0;Lt<mt.length;Lt++)this.ranges[Lt]=new aa(hi(it,mt[Lt].anchor),hi(it,mt[Lt].head))},origin:ct&&ct.origin};return Ke(it,"beforeSelectionChange",it,dt),it.cm&&Ke(it.cm,"beforeSelectionChange",it.cm,dt),dt.ranges!=at.ranges?cu(it.cm,dt.ranges,dt.ranges.length-1):at}function ff(it,at,ct){var dt=it.history.done,mt=Ce(dt);mt&&mt.ranges?(dt[dt.length-1]=at,td(it,at,ct)):Zs(it,at,ct)}function Zs(it,at,ct){td(it,at,ct),Sc(it,it.sel,it.cm?it.cm.curOp.id:NaN,ct)}function td(it,at,ct){(gn(it,"beforeSelectionChange")||it.cm&&gn(it.cm,"beforeSelectionChange"))&&(at=Wp(it,at,ct));var dt=ct&&ct.bias||(hn(at.primary().head,it.sel.primary().head)<0?-1:1);mg(it,Pc(it,at,dt,!0)),!(ct&&ct.scroll===!1)&&it.cm&&Ys(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)),dr(it,"cursorActivity",it))}function xc(it){mg(it,Pc(it,it.sel,null,!1))}function Pc(it,at,ct,dt){for(var mt,Lt=0;Lt<at.ranges.length;Lt++){var Ot=at.ranges[Lt],Vt=at.ranges.length==it.sel.ranges.length&&it.sel.ranges[Lt],Ht=wc(it,Ot.anchor,Vt&&Vt.anchor,ct,dt),se=wc(it,Ot.head,Vt&&Vt.head,ct,dt);(mt||Ht!=Ot.anchor||se!=Ot.head)&&(mt||(mt=at.ranges.slice(0,Lt)),mt[Lt]=new aa(Ht,se))}return mt?cu(it.cm,mt,at.primIndex):at}function ah(it,at,ct,dt,mt){var Lt=Gn(it,at.line);if(Lt.markedSpans)for(var Ot=0;Ot<Lt.markedSpans.length;++Ot){var Vt=Lt.markedSpans[Ot],Ht=Vt.marker,se="selectLeft"in Ht?!Ht.selectLeft:Ht.inclusiveLeft,We="selectRight"in Ht?!Ht.selectRight:Ht.inclusiveRight;if((Vt.from==null||(se?Vt.from<=at.ch:Vt.from<at.ch))&&(Vt.to==null||(We?Vt.to>=at.ch:Vt.to>at.ch))){if(mt&&(Ke(Ht,"beforeCursorEnter"),Ht.explicitlyCleared))if(Lt.markedSpans){--Ot;continue}else break;if(!Ht.atomic)continue;if(ct){var fe=Ht.find(dt<0?1:-1),Sn=void 0;if((dt<0?We:se)&&(fe=vg(it,fe,-dt,fe&&fe.line==at.line?Lt:null)),fe&&fe.line==at.line&&(Sn=hn(fe,ct))&&(dt<0?Sn<0:Sn>0))return ah(it,fe,at,dt,mt)}var ln=Ht.find(dt<0?-1:1);return(dt<0?se:We)&&(ln=vg(it,ln,dt,ln.line==at.line?Lt:null)),ln?ah(it,ln,at,dt,mt):null}}return at}function wc(it,at,ct,dt,mt){var Lt=dt||1,Ot=ah(it,at,ct,Lt,mt)||!mt&&ah(it,at,ct,Lt,!0)||ah(it,at,ct,-Lt,mt)||!mt&&ah(it,at,ct,-Lt,!0);return Ot||(it.cantEdit=!0,ze(it.first,0))}function vg(it,at,ct,dt){return ct<0&&at.ch==0?at.line>it.first?hi(it,ze(at.line-1)):null:ct>0&&at.ch==(dt||Gn(it,at.line)).text.length?at.line<it.first+it.size-1?ze(at.line+1,0):null:new ze(at.line,at.ch+ct)}function qa(it){it.setSelection(ze(it.firstLine(),0),ze(it.lastLine()),Ie)}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,Lt,Ot,Vt){mt&&(dt.from=hi(it,mt)),Lt&&(dt.to=hi(it,Lt)),Ot&&(dt.text=Ot),Vt!==void 0&&(dt.origin=Vt)}),Ke(it,"beforeChange",it,dt),it.cm&&Ke(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 lr(it.cm,Fh)(it,at,ct);if(it.cm.state.suppressEdits)return}if(!((gn(it,"beforeChange")||it.cm&&gn(it.cm,"beforeChange"))&&(at=Cc(it,at,!0),!at))){var dt=Jr&&!ct&&xn(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]==""&&hn(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,Lo(it,at));var dt=[];Fu(it,function(mt,Lt){!Lt&&Qe(dt,mt.history)==-1&&(Sg(mt.history,at),dt.push(mt.history)),_d(mt,at,null,Lo(mt,at))})}}function Ec(it,at,ct){var dt=it.cm&&it.cm.state.suppressEdits;if(!(dt&&!ct)){for(var mt=it.history,Lt,Ot=it.sel,Vt=at=="undo"?mt.done:mt.undone,Ht=at=="undo"?mt.undone:mt.done,se=0;se<Vt.length&&(Lt=Vt[se],!(ct?Lt.ranges&&!Lt.equals(it.sel):!Lt.ranges));se++);if(se!=Vt.length){for(mt.lastOrigin=mt.lastSelOrigin=null;;)if(Lt=Vt.pop(),Lt.ranges){if(Id(Lt,Ht),ct&&!Lt.equals(it.sel)){Zs(it,Lt,{clearRedo:!1});return}Ot=Lt}else if(dt){Vt.push(Lt);return}else break;var We=[];Id(Ot,Ht),Ht.push({changes:We,generation:mt.generation}),mt.generation=Lt.generation||++mt.maxGeneration;for(var fe=gn(it,"beforeChange")||it.cm&&gn(it.cm,"beforeChange"),Sn=function(Bi){var _i=Lt.changes[Bi];if(_i.origin=at,fe&&!Cc(it,_i,!1))return Vt.length=0,{};We.push(uf(it,_i));var rr=Bi?fc(it,_i):Ce(Vt);_d(it,_i,rr,hf(it,_i)),!Bi&&it.cm&&it.cm.scrollIntoView({from:_i.from,to:Ch(_i)});var jr=[];Fu(it,function(xr,Kr){!Kr&&Qe(jr,xr.history)==-1&&(Sg(xr.history,_i),jr.push(xr.history)),_d(xr,_i,null,hf(xr,_i))})},ln=Lt.changes.length-1;ln>=0;--ln){var Mi=Sn(ln);if(Mi)return Mi.v}}}}function yg(it,at){if(at!=0&&(it.first+=at,it.sel=new Jl(Yn(it.sel.ranges,function(mt){return new aa(ze(mt.anchor.line+at,mt.anchor.ch),ze(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++)Ui(it.cm,dt,"gutter")}}function _d(it,at,ct,dt){if(it.cm&&!it.cm.curOp)return lr(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:ze(it.first,0),to:ze(at.to.line+mt,at.to.ch),text:[Ce(at.text)],origin:at.origin}}var Lt=it.lastLine();at.to.line>Lt&&(at={from:at.from,to:ze(Lt,Gn(it,Lt).text.length),text:[at.text[0]],origin:at.origin}),at.removed=Ai(it,at.from,at.to),ct||(ct=fc(it,at)),it.cm?Vp(it.cm,at,dt):sf(it,at,dt),td(it,ct,Ie),it.cantEdit&&wc(it,ze(it.firstLine(),0))&&(it.cantEdit=!1)}}function Vp(it,at,ct){var dt=it.doc,mt=it.display,Lt=at.from,Ot=at.to,Vt=!1,Ht=Lt.line;it.options.lineWrapping||(Ht=Qt(An(Gn(dt,Lt.line))),dt.iter(Ht,Ot.line+1,function(ln){if(ln==mt.maxLine)return Vt=!0,!0})),dt.sel.contains(at.from,at.to)>-1&&Qn(it),sf(dt,at,ct,Ir(it)),it.options.lineWrapping||(dt.iter(Ht,Lt.line+at.text.length,function(ln){var Mi=Vr(ln);Mi>mt.maxLineLength&&(mt.maxLine=ln,mt.maxLineLength=Mi,mt.maxLineChanged=!0,Vt=!1)}),Vt&&(it.curOp.updateMaxLine=!0)),Zr(dt,Lt.line),Uo(it,400);var se=at.text.length-(Ot.line-Lt.line)-1;at.full?ir(it):Lt.line==Ot.line&&at.text.length==1&&!gg(it.doc,at)?Ui(it,Lt.line,"text"):ir(it,Lt.line,Ot.line+1,se);var We=gn(it,"changes"),fe=gn(it,"change");if(fe||We){var Sn={from:Lt,to:Ot,text:at.text,removed:at.removed,origin:at.origin};fe&&dr(it,"change",it,Sn),We&&(it.curOp.changeObjs||(it.curOp.changeObjs=[])).push(Sn)}it.display.selForContextMenu=null}function nd(it,at,ct,dt,mt){var Lt;dt||(dt=ct),hn(dt,ct)<0&&(Lt=[dt,ct],ct=Lt[0],dt=Lt[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 Lt=it[mt],Ot=!0;if(Lt.ranges){Lt.copied||(Lt=it[mt]=Lt.deepCopy(),Lt.copied=!0);for(var Vt=0;Vt<Lt.ranges.length;Vt++)Ql(Lt.ranges[Vt].anchor,at,ct,dt),Ql(Lt.ranges[Vt].head,at,ct,dt);continue}for(var Ht=0;Ht<Lt.changes.length;++Ht){var se=Lt.changes[Ht];if(ct<se.from.line)se.from=ze(se.from.line+dt,se.from.ch),se.to=ze(se.to.line+dt,se.to.ch);else if(at<=se.to.line){Ot=!1;break}}Ot||(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,Lt=at;return typeof at=="number"?Lt=Gn(it,ii(it,at)):mt=Qt(at),mt==null?null:(dt(Lt,mt)&&it.cm&&Ui(it.cm,mt,ct),Lt)}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,po(mt),dr(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 ja(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}ja.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 Lt=Math.min(at,mt-it),Ot=dt.height;if(dt.removeInner(it,Lt),this.height-=Ot-dt.height,mt==Lt&&(this.children.splice(ct--,1),dt.parent=null),(at-=Lt)==0)break;it=0}else it-=mt}if(this.size-at<25&&(this.children.length>1||!(this.children[0]instanceof Rd))){var Vt=[];this.collapse(Vt),this.children=[new Rd(Vt)],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],Lt=mt.chunkSize();if(it<=Lt){if(mt.insertInner(it,at,ct),mt.lines&&mt.lines.length>50){for(var Ot=mt.lines.length%25+25,Vt=Ot;Vt<mt.lines.length;){var Ht=new Rd(mt.lines.slice(Vt,Vt+=25));mt.height-=Ht.height,this.children.splice(++dt,0,Ht),Ht.parent=this}mt.lines=mt.lines.slice(0,Ot),this.maybeSpill()}break}it-=Lt}},maybeSpill:function(){if(!(this.children.length<=10)){var it=this;do{var at=it.children.splice(it.children.length-5,5),ct=new ja(at);if(it.parent){it.size-=ct.size,it.height-=ct.height;var mt=Qe(it.parent.children,it);it.parent.children.splice(mt+1,0,ct)}else{var dt=new ja(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],Lt=mt.chunkSize();if(it<Lt){var Ot=Math.min(at,Lt-it);if(mt.iterN(it,Ot,ct))return!0;if((at-=Ot)==0)break;it=0}else it-=Lt}}};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=Qt(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 Lt=da(this);Tn(ct,Math.max(0,ct.height-Lt)),it&&(mr(it,function(){Up(it,ct,-Lt),Ui(it,dt,"widget")}),dr(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=da(this)-at;mt&&(en(this.doc,dt)||Tn(dt,dt.height+mt),ct&&mr(ct,function(){ct.curOp.forceUpdate=!0,Up(ct,dt,mt),dr(ct,"lineWidgetChanged",ct,it,Qt(dt))}))},an(sh);function Up(it,at,ct){tr(at)<(it.curOp&&it.curOp.scrollTop||it.doc.scrollTop)&&hu(it,ct)}function gf(it,at,ct,dt){var mt=new sh(it,ct,dt),Lt=it.cm;return Lt&&mt.noHScroll&&(Lt.display.alignWidgets=!0),id(it,at,"widget",function(Ot){var Vt=Ot.widgets||(Ot.widgets=[]);if(mt.insertAt==null?Vt.push(mt):Vt.splice(Math.min(Vt.length-1,Math.max(0,mt.insertAt)),0,mt),mt.line=Ot,Lt&&!en(it,Ot)){var Ht=tr(Ot)<it.scrollTop;Tn(Ot,Ot.height+da(mt)),Ht&&hu(Lt,mt.height),Lt.curOp.forceUpdate=!0}return!0}),Lt&&dr(Lt,"lineWidgetAdded",Lt,mt,typeof at=="number"?at:Qt(at)),mt}var Yp=0,Ne=function(it,at){this.lines=[],this.type=at,this.doc=it,this.id=++Yp};Ne.prototype.clear=function(){if(!this.explicitlyCleared){var it=this.doc.cm,at=it&&!it.curOp;if(at&&al(it),gn(this,"clear")){var ct=this.find();ct&&dr(this,"clear",ct.from,ct.to)}for(var dt=null,mt=null,Lt=0;Lt<this.lines.length;++Lt){var Ot=this.lines[Lt],Vt=Wr(Ot.markedSpans,this);it&&!this.collapsed?Ui(it,Qt(Ot),"text"):it&&(Vt.to!=null&&(mt=Qt(Ot)),Vt.from!=null&&(dt=Qt(Ot))),Ot.markedSpans=Oi(Ot.markedSpans,Vt),Vt.from==null&&this.collapsed&&!en(this.doc,Ot)&&it&&Tn(Ot,sr(it.display))}if(it&&this.collapsed&&!it.options.lineWrapping)for(var Ht=0;Ht<this.lines.length;++Ht){var se=An(this.lines[Ht]),We=Vr(se);We>it.display.maxLineLength&&(it.display.maxLine=se,it.display.maxLineLength=We,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&&dr(it,"markerCleared",it,this,dt,mt),at&&ml(it),this.parent&&this.parent.clear()}},Ne.prototype.find=function(it,at){it==null&&this.type=="bookmark"&&(it=1);for(var ct,dt,mt=0;mt<this.lines.length;++mt){var Lt=this.lines[mt],Ot=Wr(Lt.markedSpans,this);if(Ot.from!=null&&(ct=ze(at?Lt:Qt(Lt),Ot.from),it==-1))return ct;if(Ot.to!=null&&(dt=ze(at?Lt:Qt(Lt),Ot.to),it==1))return dt}return ct&&{from:ct,to:dt}},Ne.prototype.changed=function(){var it=this,at=this.find(-1,!0),ct=this,dt=this.doc.cm;!at||!dt||mr(dt,function(){var mt=at.line,Lt=Qt(at.line),Ot=js(dt,Lt);if(Ot&&(_u(Ot),dt.curOp.selectionChanged=dt.curOp.forceUpdate=!0),dt.curOp.updateMaxLine=!0,!en(ct.doc,mt)&&ct.height!=null){var Vt=ct.height;ct.height=null;var Ht=da(ct)-Vt;Ht&&Tn(mt,mt.height+Ht)}dr(dt,"markerChanged",dt,it)})},Ne.prototype.attachLine=function(it){if(!this.lines.length&&this.doc.cm){var at=this.doc.cm.curOp;(!at.maybeHiddenMarkers||Qe(at.maybeHiddenMarkers,this)==-1)&&(at.maybeUnhiddenMarkers||(at.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(it)},Ne.prototype.detachLine=function(it){if(this.lines.splice(Qe(this.lines,it),1),!this.lines.length&&this.doc.cm){var at=this.doc.cm.curOp;(at.maybeHiddenMarkers||(at.maybeHiddenMarkers=[])).push(this)}},an(Ne);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 lr(it.cm,rd)(it,at,ct,dt,mt);var Lt=new Ne(it,mt),Ot=hn(at,ct);if(dt&&pn(dt,Lt,!1),Ot>0||Ot==0&&Lt.clearWhenEmpty!==!1)return Lt;if(Lt.replacedWith&&(Lt.collapsed=!0,Lt.widgetNode=ge("span",[Lt.replacedWith],"CodeMirror-widget"),dt.handleMouseEvents||Lt.widgetNode.setAttribute("cm-ignore-events","true"),dt.insertLeft&&(Lt.widgetNode.insertLeft=!0)),Lt.collapsed){if($n(it,at.line,at,ct,Lt)||at.line!=ct.line&&$n(it,ct.line,at,ct,Lt))throw new Error("Inserting collapsed marker partially overlapping an existing one");vn()}Lt.addToHistory&&yc(it,{from:at,to:ct,origin:"markText"},it.sel,NaN);var Vt=at.line,Ht=it.cm,se;if(it.iter(Vt,ct.line+1,function(fe){Ht&&Lt.collapsed&&!Ht.options.lineWrapping&&An(fe)==Ht.display.maxLine&&(se=!0),Lt.collapsed&&Vt!=at.line&&Tn(fe,0),ko(fe,new Gi(Lt,Vt==at.line?at.ch:null,Vt==ct.line?ct.ch:null)),++Vt}),Lt.collapsed&&it.iter(at.line,ct.line+1,function(fe){en(it,fe)&&Tn(fe,0)}),Lt.clearOnEnter&&fn(Lt,"beforeCursorEnter",function(){return Lt.clear()}),Lt.readOnly&&(yo(),(it.history.done.length||it.history.undone.length)&&it.clearHistory()),Lt.collapsed&&(Lt.id=++Yp,Lt.atomic=!0),Ht){if(se&&(Ht.curOp.updateMaxLine=!0),Lt.collapsed)ir(Ht,at.line,ct.line+1);else if(Lt.className||Lt.startStyle||Lt.endStyle||Lt.css||Lt.attributes||Lt.title)for(var We=at.line;We<=ct.line;We++)Ui(Ht,We,"text");Lt.atomic&&xc(Ht.doc),dr(Ht,"markerAdded",Ht,Lt)}return Lt}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();dr(this,"clear")}},zu.prototype.find=function(it,at){return this.primary.find(it,at)},an(zu);function Xp(it,at,ct,dt,mt){dt=pn(dt),dt.shared=!1;var Lt=[rd(it,at,ct,dt,mt)],Ot=Lt[0],Vt=dt.widgetNode;return Fu(it,function(Ht){Vt&&(dt.widgetNode=Vt.cloneNode(!0)),Lt.push(rd(Ht,hi(Ht,at),hi(Ht,ct),dt,mt));for(var se=0;se<Ht.linked.length;++se)if(Ht.linked[se].isParent)return;Ot=Ce(Lt)}),new zu(Lt,Ot)}function xg(it){return it.findMarks(ze(it.first,0),it.clipPos(ze(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(),Lt=it.clipPos(mt.from),Ot=it.clipPos(mt.to);if(hn(Lt,Ot)){var Vt=rd(it,Lt,Ot,dt.primary,dt.primary.type);dt.markers.push(Vt),Vt.parent=dt}}}function Pg(it){for(var at=function(dt){var mt=it[dt],Lt=[mt.primary.doc];Fu(mt.primary.doc,function(Ht){return Lt.push(Ht)});for(var Ot=0;Ot<mt.markers.length;Ot++){var Vt=mt.markers[Ot];Qe(Lt,Vt.doc)==-1&&(Vt.parent=null,mt.markers.splice(Ot--,1))}},ct=0;ct<it.length;ct++)at(ct)}var tv=0,Bs=function(it,at,ct,dt,mt){if(!(this instanceof Bs))return new Bs(it,at,ct,dt,mt);ct==null&&(ct=0),ja.call(this,[new Rd([new so("",null)])]),this.first=ct,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=ct;var Lt=ze(ct,0);this.sel=rh(Lt),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)),sf(this,{from:Lt,to:Lt,text:it}),Zs(this,rh(Lt),Ie)};Bs.prototype=Ft(ja.prototype,{constructor:Bs,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=ji(this,this.first,this.first+this.size);return it===!1?at:at.join(it||this.lineSeparator())},setValue:ho(function(it){var at=ze(this.first,0),ct=this.first+this.size-1;Fh(this,{from:at,to:ze(ct,Gn(this,ct).text.length),text:this.splitLines(it),origin:"setValue",full:!0},!0),this.cm&&Tl(this.cm,0,0),Zs(this,rh(at),Ie)}),replaceRange:function(it,at,ct,dt){at=hi(this,at),ct=ct?hi(this,ct):at,nd(this,it,at,ct,dt)},getRange:function(it,at,ct){var dt=Ai(this,hi(this,it),hi(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(bn(this,it))return Gn(this,it)},getLineNumber:function(it){return Qt(it)},getLineHandleVisualStart:function(it){return typeof it=="number"&&(it=Gn(this,it)),An(it)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(it){return hi(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:ho(function(it,at,ct){qh(this,hi(this,typeof it=="number"?ze(it,at||0):it),null,ct)}),setSelection:ho(function(it,at,ct){qh(this,hi(this,it),hi(this,at||it),ct)}),extendSelection:ho(function(it,at,ct){cf(this,hi(this,it),at&&hi(this,at),ct)}),extendSelections:ho(function(it,at){Hp(this,Di(this,it),at)}),extendSelectionsBy:ho(function(it,at){var ct=Yn(this.sel.ranges,it);Hp(this,Di(this,ct),at)}),setSelections:ho(function(it,at,ct){if(it.length){for(var dt=[],mt=0;mt<it.length;mt++)dt[mt]=new aa(hi(this,it[mt].anchor),hi(this,it[mt].head));at==null&&(at=Math.min(it.length-1,this.sel.primIndex)),Zs(this,cu(this.cm,dt,at),ct)}}),addSelection:ho(function(it,at,ct){var dt=this.sel.ranges.slice(0);dt.push(new aa(hi(this,it),hi(this,at||it))),Zs(this,cu(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=Ai(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=Ai(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:ho(function(it,at,ct){for(var dt=[],mt=this.sel,Lt=0;Lt<mt.ranges.length;Lt++){var Ot=mt.ranges[Lt];dt[Lt]={from:Ot.from(),to:Ot.to(),text:this.splitLines(it[Lt]),origin:ct}}for(var Vt=at&&at!="end"&&gc(this,dt,at),Ht=dt.length-1;Ht>=0;Ht--)Fh(this,dt[Ht]);Vt?ff(this,Vt):this.cm&&Ys(this.cm)}),undo:ho(function(){Ec(this,"undo")}),redo:ho(function(){Ec(this,"redo")}),undoSelection:ho(function(){Ec(this,"undo",!0)}),redoSelection:ho(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),Fu(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:ho(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:ho(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(!bn(this,it)||(at=it,it=Gn(this,it),!it))return null}else if(at=Qt(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:ho(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(At(ct).test(dt[mt]))return!1;dt[mt]+=" "+ct}return!0})}),removeLineClass:ho(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",Lt=dt[mt];if(Lt)if(ct==null)dt[mt]=null;else{var Ot=Lt.match(At(ct));if(!Ot)return!1;var Vt=Ot.index+Ot[0].length;dt[mt]=Lt.slice(0,Ot.index)+(!Ot.index||Vt==Lt.length?"":" ")+Lt.slice(Vt)||null}else return!1;return!0})}),addLineWidget:ho(function(it,at,ct){return gf(this,it,at,ct)}),removeLineWidget:function(it){it.clear()},markText:function(it,at,ct){return rd(this,hi(this,it),hi(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=hi(this,it),rd(this,it,it,ct,"bookmark")},findMarksAt:function(it){it=hi(this,it);var at=[],ct=Gn(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=hi(this,it),at=hi(this,at);var dt=[],mt=it.line;return this.iter(it.line,at.line+1,function(Lt){var Ot=Lt.markedSpans;if(Ot)for(var Vt=0;Vt<Ot.length;Vt++){var Ht=Ot[Vt];!(Ht.to!=null&&mt==it.line&&it.ch>=Ht.to||Ht.from==null&&mt!=it.line||Ht.from!=null&&mt==at.line&&Ht.from>=at.ch)&&(!ct||ct(Ht.marker))&&dt.push(Ht.marker.parent||Ht.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 Lt=mt.text.length+dt;if(Lt>it)return at=it,!0;it-=Lt,++ct}),hi(this,ze(ct,at))},indexFromPos:function(it){it=hi(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 Bs(ji(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 Bs(ji(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 Qo&&(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];Fu(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){Fu(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:ho(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))})}),Bs.prototype.eachLine=Bs.prototype.iter;var Lc=0;function wg(it){var at=this;if(qp(at),!(nn(at,it)||Yo(at.display,it))){zn(it),ue&&(Lc=+new Date);var ct=to(at,it,!0),dt=it.dataTransfer.files;if(!(!ct||at.isReadOnly()))if(dt&&dt.length&&window.FileReader&&window.File)for(var mt=dt.length,Lt=Array(mt),Ot=0,Vt=function(){++Ot==mt&&lr(at,function(){ct=hi(at.doc,ct);var ln={from:ct,to:ct,text:at.doc.splitLines(Lt.filter(function(Mi){return Mi!=null}).join(at.doc.lineSeparator())),origin:"paste"};Fh(at.doc,ln),ff(at.doc,rh(hi(at.doc,ct),hi(at.doc,Ch(ln))))})()},Ht=function(ln,Mi){if(at.options.allowDropFileTypes&&Qe(at.options.allowDropFileTypes,ln.type)==-1){Vt();return}var Bi=new FileReader;Bi.onerror=function(){return Vt()},Bi.onload=function(){var _i=Bi.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(_i)){Vt();return}Lt[Mi]=_i,Vt()},Bi.readAsText(ln)},se=0;se<dt.length;se++)Ht(dt[se],se);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 We=it.dataTransfer.getData("Text");if(We){var fe;if(at.state.draggingText&&!at.state.draggingText.copy&&(fe=at.listSelections()),td(at.doc,rh(ct,ct)),fe)for(var Sn=0;Sn<fe.length;++Sn)nd(at.doc,"",fe[Sn].anchor,fe[Sn].head,"drag");at.replaceSelection(We,"around","paste"),at.display.input.focus()}}catch(ln){}}}}function Qp(it,at){if(ue&&(!it.state.draggingText||+new Date-Lc<100)){wi(at);return}if(!(nn(it,at)||Yo(it.display,at))&&(at.dataTransfer.setData("Text",it.getSelection()),at.dataTransfer.effectAllowed="copyMove",at.dataTransfer.setDragImage&&!De)){var ct=Gt("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=to(it,at);if(ct){var dt=document.createDocumentFragment();Fi(it,ct,dt),it.display.dragCursor||(it.display.dragCursor=Gt("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),it.display.lineSpace.insertBefore(it.display.dragCursor,it.display.cursorDiv)),Ut(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 Lt=0;Lt<ct.length;Lt++)it(ct[Lt])})}}var Cg=!1;function Il(){Cg||(jd(),Cg=!0)}function jd(){var it;fn(window,"resize",function(){it==null&&(it=setTimeout(function(){it=null,tm(Eg)},100))}),fn(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 Zu={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++)Zu[Fc+48]=Zu[Fc+96]=String(Fc);for(var pf=65;pf<=90;pf++)Zu[pf]=String.fromCharCode(pf);for(var Mc=1;Mc<=12;Mc++)Zu[Mc+111]=Zu[Mc+63235]="F"+Mc;var Sl={};Sl.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"},Sl.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"},Sl.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"},Sl.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"]},Sl.default=ht?Sl.macDefault:Sl.pcDefault;function Lg(it){var at=it.split(/-(?!$)/);it=at[at.length-1];for(var ct,dt,mt,Lt,Ot=0;Ot<at.length-1;Ot++){var Vt=at[Ot];if(/^(cmd|meta|m)$/i.test(Vt))Lt=!0;else if(/^a(lt)?$/i.test(Vt))ct=!0;else if(/^(c|ctrl|control)$/i.test(Vt))dt=!0;else if(/^s(hift)?$/i.test(Vt))mt=!0;else throw new Error("Unrecognized modifier name: "+Vt)}return ct&&(it="Alt-"+it),dt&&(it="Ctrl-"+it),Lt&&(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=Yn(ct.split(" "),Lg),Lt=0;Lt<mt.length;Lt++){var Ot=void 0,Vt=void 0;Lt==mt.length-1?(Vt=mt.join(" "),Ot=dt):(Vt=mt.slice(0,Lt+1).join(" "),Ot="...");var Ht=at[Vt];if(!Ht)at[Vt]=Ot;else if(Ht!=Ot)throw new Error("Inconsistent bindings for "+Vt)}delete it[ct]}for(var se in at)it[se]=at[se];return it}function $l(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 $l(it,at.fallthrough,ct,dt);for(var Lt=0;Lt<at.fallthrough.length;Lt++){var Ot=$l(it,at.fallthrough[Lt],ct,dt);if(Ot)return Ot}}}function zd(it){var at=typeof it=="string"?it:Zu[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=Zu[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"?Sl[it]:it}function xl(it,at){for(var ct=it.doc.sel.ranges,dt=[],mt=0;mt<ct.length;mt++){for(var Lt=at(ct[mt]);dt.length&&hn(Lt.from,Ce(dt).to)<=0;){var Ot=dt.pop();if(hn(Ot.from,Lt.from)<0){Lt.from=Ot.from;break}}dt.push(Lt)}mr(it,function(){for(var Vt=dt.length-1;Vt>=0;Vt--)nd(it.doc,"",dt[Vt].from,dt[Vt].to,"+delete");Ys(it)})}function kg(it,at,ct){var dt=_e(it.text,at+ct,ct);return dt<0||dt>it.text.length?null:dt}function ts(it,at,ct){var dt=kg(it,at.ch,ct);return dt==null?null:new ze(at.line,dt,ct<0?"after":"before")}function kc(it,at,ct,dt,mt){if(it){at.doc.direction=="rtl"&&(mt=-mt);var Lt=tn(ct,at.doc.direction);if(Lt){var Ot=mt<0?Ce(Lt):Lt[0],Vt=mt<0==(Ot.level==1),Ht=Vt?"after":"before",se;if(Ot.level>0||at.doc.direction=="rtl"){var We=Nl(at,ct);se=mt<0?ct.text.length-1:0;var fe=zs(at,We,se).top;se=Xe(function(Sn){return zs(at,We,Sn).top==fe},mt<0==(Ot.level==1)?Ot.from:Ot.to-1,se),Ht=="before"&&(se=kg(ct,se,1))}else se=mt<0?Ot.to:Ot.from;return new ze(dt,se,Ht)}}return new ze(dt,mt<0?ct.text.length:0,mt<0?"before":"after")}function mf(it,at,ct,dt){var mt=tn(at,it.doc.direction);if(!mt)return ts(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 Lt=ke(mt,ct.ch,ct.sticky),Ot=mt[Lt];if(it.doc.direction=="ltr"&&Ot.level%2==0&&(dt>0?Ot.to>ct.ch:Ot.from<ct.ch))return ts(at,ct,dt);var Vt=function(rr,jr){return kg(at,rr instanceof ze?rr.ch:rr,jr)},Ht,se=function(rr){return it.options.lineWrapping?(Ht=Ht||Nl(it,at),Re(it,at,Ht,rr)):{begin:0,end:at.text.length}},We=se(ct.sticky=="before"?Vt(ct,-1):ct.ch);if(it.doc.direction=="rtl"||Ot.level==1){var fe=Ot.level==1==dt<0,Sn=Vt(ct,fe?1:-1);if(Sn!=null&&(fe?Sn<=Ot.to&&Sn<=We.end:Sn>=Ot.from&&Sn>=We.begin)){var ln=fe?"before":"after";return new ze(ct.line,Sn,ln)}}var Mi=function(rr,jr,xr){for(var Kr=function(ka,ds){return ds?new ze(ct.line,Vt(ka,1),"before"):new ze(ct.line,ka,"after")};rr>=0&&rr<mt.length;rr+=jr){var Eo=mt[rr],yr=jr>0==(Eo.level!=1),Ho=yr?xr.begin:Vt(xr.end,-1);if(Eo.from<=Ho&&Ho<Eo.to||(Ho=yr?Eo.from:Vt(Eo.to,-1),xr.begin<=Ho&&Ho<xr.end))return Kr(Ho,yr)}},Bi=Mi(Lt+dt,dt,We);if(Bi)return Bi;var _i=dt>0?We.end:Vt(We.begin,-1);return _i!=null&&!(dt>0&&_i==at.text.length)&&(Bi=Mi(dt>0?0:mt.length-1,dt,se(_i)),Bi)?Bi:null}var Mh={selectAll:qa,singleSelection:function(it){return it.setSelection(it.getCursor("anchor"),it.getCursor("head"),Ie)},killLine:function(it){return xl(it,function(at){if(at.empty()){var ct=Gn(it.doc,at.head.line).text.length;return at.head.ch==ct&&at.head.line<it.lastLine()?{from:at.head,to:ze(at.head.line+1,0)}:{from:at.head,to:ze(at.head.line,ct)}}else return{from:at.from(),to:at.to()}})},deleteLine:function(it){return xl(it,function(at){return{from:ze(at.from().line,0),to:hi(it.doc,ze(at.to().line+1,0))}})},delLineLeft:function(it){return xl(it,function(at){return{from:ze(at.from().line,0),to:at.from()}})},delWrappedLineLeft:function(it){return xl(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 xl(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(ze(it.firstLine(),0))},goDocEnd:function(it){return it.extendSelection(ze(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")},cn)},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")},cn)},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},cn)},goLineUp:function(it){return it.moveV(-1,"line")},goLineDown:function(it){return it.moveV(1,"line")},goPageUp:function(it){return it.moveV(-1,"page")},goPageDown:function(it){return it.moveV(1,"page")},goCharLeft:function(it){return it.moveH(-1,"char")},goCharRight:function(it){return it.moveH(1,"char")},goColumnLeft:function(it){return it.moveH(-1,"column")},goColumnRight:function(it){return it.moveH(1,"column")},goWordLeft:function(it){return it.moveH(-1,"word")},goGroupRight:function(it){return it.moveH(1,"group")},goGroupLeft:function(it){return it.moveH(-1,"group")},goWordRight:function(it){return it.moveH(1,"word")},delCharBefore:function(it){return it.deleteH(-1,"codepoint")},delCharAfter:function(it){return it.deleteH(1,"char")},delWordBefore:function(it){return it.deleteH(-1,"word")},delWordAfter:function(it){return it.deleteH(1,"word")},delGroupBefore:function(it){return it.deleteH(-1,"group")},delGroupAfter:function(it){return it.deleteH(1,"group")},indentAuto:function(it){return it.indentSelection("smart")},indentMore:function(it){return it.indentSelection("add")},indentLess:function(it){return it.indentSelection("subtract")},insertTab:function(it){return it.replaceSelection(" ")},insertSoftTab:function(it){for(var at=[],ct=it.listSelections(),dt=it.options.tabSize,mt=0;mt<ct.length;mt++){var Lt=ct[mt].from(),Ot=te(it.getLine(Lt.line),Lt.ch,dt);at.push(he(dt-Ot%dt))}it.replaceSelections(at)},defaultTab:function(it){it.somethingSelected()?it.indentSelection("add"):it.execCommand("insertTab")},transposeChars:function(it){return mr(it,function(){for(var at=it.listSelections(),ct=[],dt=0;dt<at.length;dt++)if(at[dt].empty()){var mt=at[dt].head,Lt=Gn(it.doc,mt.line).text;if(Lt){if(mt.ch==Lt.length&&(mt=new ze(mt.line,mt.ch-1)),mt.ch>0)mt=new ze(mt.line,mt.ch+1),it.replaceRange(Lt.charAt(mt.ch-1)+Lt.charAt(mt.ch-2),ze(mt.line,mt.ch-2),mt,"+transpose");else if(mt.line>it.doc.first){var Ot=Gn(it.doc,mt.line-1).text;Ot&&(mt=new ze(mt.line,1),it.replaceRange(Lt.charAt(0)+it.doc.lineSeparator()+Ot.charAt(Ot.length-1),ze(mt.line-1,Ot.length-1),mt,"+transpose"))}}ct.push(new aa(mt,mt))}it.setSelections(ct)})},newlineAndIndent:function(it){return mr(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);Ys(it)})},openLine:function(it){return it.replaceSelection(`
|
|
`,"start")},toggleOverwrite:function(it){return it.toggleOverwrite()}};function Zd(it,at){var ct=Gn(it.doc,at),dt=An(ct);return dt!=ct&&(at=Qt(dt)),kc(!0,it,dt,at,1)}function Gd(it,at){var ct=Gn(it.doc,at),dt=Xn(ct);return dt!=ct&&(at=Qt(dt)),kc(!0,it,ct,at,-1)}function bg(it,at){var ct=Zd(it,at.line),dt=Gn(it.doc,ct.line),mt=tn(dt,it.doc.direction);if(!mt||mt[0].level==0){var Lt=Math.max(ct.ch,dt.text.search(/\S/)),Ot=at.line==ct.line&&at.ch<=Lt&&at.ch;return ze(ct.line,Ot?0:Lt,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)!=En}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=$l(at,it.state.keyMaps[dt],ct,it);if(mt)return mt}return it.options.extraKeys&&$l(at,it.options.extraKeys,ct,it)||$l(at,it.options.keyMap,ct,it)}var Gu=new Xt;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:Gu.set(50,function(){it.state.keySeq==mt&&(it.state.keySeq=null,it.display.input.reset())}),vf(it,mt+" "+at,ct,dt))return!0}return vf(it,at,ct,dt)}function vf(it,at,ct,dt){var mt=Ng(it,at,dt);return mt=="multi"&&(it.state.keySeq=at),mt=="handled"&&dr(it,"keyHandled",it,at,ct),(mt=="handled"||mt=="multi")&&(zn(ct),ao(it)),!!mt}function yf(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 Sf(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=ve(),!nn(at,it))){ue&&Dt<11&&it.keyCode==27&&(it.returnValue=!1);var ct=it.keyCode;at.display.shift=ct==16||it.shiftKey;var dt=yf(at,it);jt&&(sd=dt?ct:null,!dt&&ct==88&&!Je&&(ht?it.metaKey:it.ctrlKey)&&at.replaceSelection("",null,"cut")),ft&&!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;ye(at,"CodeMirror-crosshair");function ct(dt){(dt.keyCode==18||!dt.altKey)&&(It(at,"CodeMirror-crosshair"),Ge(document,"keyup",ct),Ge(document,"mouseover",ct))}fn(document,"keyup",ct),fn(document,"mouseover",ct)}function Tg(it){it.keyCode==16&&(this.doc.sel.shift=!1),nn(this,it)}function Mu(it){var at=this;if(!(it.target&&it.target!=at.display.input.getField())&&!(Yo(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,zn(it);return}if(!(jt&&(!it.which||it.which<10)&&yf(at,it))){var mt=String.fromCharCode(dt==null?ct:dt);mt!="\b"&&(Sf(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&&hn(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 ku(it){var at=this,ct=at.display;if(!(nn(at,it)||ct.activeTouch&&ct.input.supportsTouch())){if(ct.input.ensurePolled(),ct.shift=it.shiftKey,Yo(ct,it)){ee||(ct.scroller.draggable=!1,setTimeout(function(){return ct.scroller.draggable=!0},100));return}if(!wf(at,it)){var dt=to(at,it),mt=Cn(it),Lt=dt?Og(dt,mt):"single";window.focus(),mt==1&&at.state.selectingText&&at.state.selectingText(it),!(dt&&Ig(at,mt,dt,Lt,it))&&(mt==1?dt?im(at,dt,Lt,it):Wi(it)==ct.scroller&&zn(it):mt==2?(dt&&cf(at.doc,dt),setTimeout(function(){return ct.input.focus()},20)):mt==3&&(Et?at.display.input.onContextMenu(it):Ro(at)))}}}function Ig(it,at,ct,dt,mt){var Lt="Click";return dt=="double"?Lt="Double"+Lt:dt=="triple"&&(Lt="Triple"+Lt),Lt=(at==1?"Left":at==2?"Middle":"Right")+Lt,ad(it,Mg(Lt,mt),mt,function(Ot){if(typeof Ot=="string"&&(Ot=Mh[Ot]),!Ot)return!1;var Vt=!1;try{it.isReadOnly()&&(it.state.suppressEdits=!0),Vt=Ot(it,ct)!=En}finally{it.state.suppressEdits=!1}return Vt})}function xf(it,at,ct){var dt=it.getOption("configureMouse"),mt=dt?dt(it,at,ct):{};if(mt.unit==null){var Lt=st?ct.shiftKey&&ct.metaKey:ct.altKey;mt.unit=Lt?"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){ue?setTimeout(qe(mo,it),0):it.curOp.focus=ve();var mt=xf(it,ct,dt),Lt=it.doc.sel,Ot;it.options.dragDrop&&Pn&&!it.isReadOnly()&&ct=="single"&&(Ot=Lt.contains(at))>-1&&(hn((Ot=Lt.ranges[Ot]).from(),at)<0||at.xRel>0)&&(hn(Ot.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,Lt=!1,Ot=lr(it,function(se){ee&&(mt.scroller.draggable=!1),it.state.draggingText=!1,Ge(mt.wrapper.ownerDocument,"mouseup",Ot),Ge(mt.wrapper.ownerDocument,"mousemove",Vt),Ge(mt.scroller,"dragstart",Ht),Ge(mt.scroller,"drop",Ot),Lt||(zn(se),dt.addNew||cf(it.doc,ct,null,null,dt.extend),ee&&!De||ue&&Dt==9?setTimeout(function(){mt.wrapper.ownerDocument.body.focus({preventScroll:!0}),mt.input.focus()},20):mt.input.focus())}),Vt=function(se){Lt=Lt||Math.abs(at.clientX-se.clientX)+Math.abs(at.clientY-se.clientY)>=10},Ht=function(){return Lt=!0};ee&&(mt.scroller.draggable=!0),it.state.draggingText=Ot,Ot.copy=!dt.moveOnDrag,mt.scroller.dragDrop&&mt.scroller.dragDrop(),fn(mt.wrapper.ownerDocument,"mouseup",Ot),fn(mt.wrapper.ownerDocument,"mousemove",Vt),fn(mt.scroller,"dragstart",Ht),fn(mt.scroller,"drop",Ot),Ro(it),setTimeout(function(){return mt.input.focus()},20)}function Rg(it,at,ct){if(ct=="char")return new aa(at,at);if(ct=="word")return it.findWordAt(at);if(ct=="line")return new aa(ze(at.line,0),hi(it.doc,ze(at.line+1,0)));var dt=ct(it,at);return new aa(dt.from,dt.to)}function ev(it,at,ct,dt){var mt=it.display,Lt=it.doc;zn(at);var Ot,Vt,Ht=Lt.sel,se=Ht.ranges;if(dt.addNew&&!dt.extend?(Vt=Lt.sel.contains(ct),Vt>-1?Ot=se[Vt]:Ot=new aa(ct,ct)):(Ot=Lt.sel.primary(),Vt=Lt.sel.primIndex),dt.unit=="rectangle")dt.addNew||(Ot=new aa(ct,ct)),ct=to(it,at,!0,!0),Vt=-1;else{var We=Rg(it,ct,dt.unit);dt.extend?Ot=df(Ot,We.anchor,We.head,dt.extend):Ot=We}dt.addNew?Vt==-1?(Vt=se.length,Zs(Lt,cu(it,se.concat([Ot]),Vt),{scroll:!1,origin:"*mouse"})):se.length>1&&se[Vt].empty()&&dt.unit=="char"&&!dt.extend?(Zs(Lt,cu(it,se.slice(0,Vt).concat(se.slice(Vt+1)),0),{scroll:!1,origin:"*mouse"}),Ht=Lt.sel):Lh(Lt,Vt,Ot,on):(Vt=0,Zs(Lt,new Jl([Ot],0),on),Ht=Lt.sel);var fe=ct;function Sn(xr){if(hn(fe,xr)!=0)if(fe=xr,dt.unit=="rectangle"){for(var Kr=[],Eo=it.options.tabSize,yr=te(Gn(Lt,ct.line).text,ct.ch,Eo),Ho=te(Gn(Lt,xr.line).text,xr.ch,Eo),ka=Math.min(yr,Ho),ds=Math.max(yr,Ho),za=Math.min(ct.line,xr.line),ll=Math.min(it.lastLine(),Math.max(ct.line,xr.line));za<=ll;za++){var Gs=Gn(Lt,za).text,os=Vn(Gs,ka,Eo);ka==ds?Kr.push(new aa(ze(za,os),ze(za,os))):Gs.length>os&&Kr.push(new aa(ze(za,os),ze(za,Vn(Gs,ds,Eo))))}Kr.length||Kr.push(new aa(ct,ct)),Zs(Lt,cu(it,Ht.ranges.slice(0,Vt).concat(Kr),Vt),{origin:"*mouse",scroll:!1}),it.scrollIntoView(xr)}else{var Pl=Ot,As=Rg(it,xr,dt.unit),as=Pl.anchor,ta;hn(As.anchor,as)>0?(ta=As.head,as=Jn(Pl.from(),As.anchor)):(ta=As.anchor,as=vi(Pl.to(),As.head));var Wa=Ht.ranges.slice(0);Wa[Vt]=rm(it,new aa(hi(Lt,as),ta)),Zs(Lt,cu(it,Wa,Vt),on)}}var ln=mt.wrapper.getBoundingClientRect(),Mi=0;function Bi(xr){var Kr=++Mi,Eo=to(it,xr,!0,dt.unit=="rectangle");if(Eo)if(hn(Eo,fe)!=0){it.curOp.focus=ve(),Sn(Eo);var yr=Br(mt,Lt);(Eo.line>=yr.to||Eo.line<yr.from)&&setTimeout(lr(it,function(){Mi==Kr&&Bi(xr)}),150)}else{var Ho=xr.clientY<ln.top?-20:xr.clientY>ln.bottom?20:0;Ho&&setTimeout(lr(it,function(){Mi==Kr&&(mt.scroller.scrollTop+=Ho,Bi(xr))}),50)}}function _i(xr){it.state.selectingText=!1,Mi=1/0,xr&&(zn(xr),mt.input.focus()),Ge(mt.wrapper.ownerDocument,"mousemove",rr),Ge(mt.wrapper.ownerDocument,"mouseup",jr),Lt.history.lastSelOrigin=null}var rr=lr(it,function(xr){xr.buttons===0||!Cn(xr)?_i(xr):Bi(xr)}),jr=lr(it,_i);it.state.selectingText=jr,fn(mt.wrapper.ownerDocument,"mousemove",rr),fn(mt.wrapper.ownerDocument,"mouseup",jr)}function rm(it,at){var ct=at.anchor,dt=at.head,mt=Gn(it.doc,ct.line);if(hn(ct,dt)==0&&ct.sticky==dt.sticky)return at;var Lt=tn(mt);if(!Lt)return at;var Ot=ke(Lt,ct.ch,ct.sticky),Vt=Lt[Ot];if(Vt.from!=ct.ch&&Vt.to!=ct.ch)return at;var Ht=Ot+(Vt.from==ct.ch==(Vt.level!=1)?0:1);if(Ht==0||Ht==Lt.length)return at;var se;if(dt.line!=ct.line)se=(dt.line-ct.line)*(it.doc.direction=="ltr"?1:-1)>0;else{var We=ke(Lt,dt.ch,dt.sticky),fe=We-Ot||(dt.ch-ct.ch)*(Vt.level==1?-1:1);We==Ht-1||We==Ht?se=fe<0:se=fe>0}var Sn=Lt[Ht+(se?-1:0)],ln=se==(Sn.level==1),Mi=ln?Sn.from:Sn.to,Bi=ln?"after":"before";return ct.ch==Mi&&ct.sticky==Bi?at:new aa(new ze(ct.line,Mi,Bi),dt)}function Pf(it,at,ct,dt){var mt,Lt;if(at.touches)mt=at.touches[0].clientX,Lt=at.touches[0].clientY;else try{mt=at.clientX,Lt=at.clientY}catch(Sn){return!1}if(mt>=Math.floor(it.display.gutters.getBoundingClientRect().right))return!1;dt&&zn(at);var Ot=it.display,Vt=Ot.lineDiv.getBoundingClientRect();if(Lt>Vt.bottom||!gn(it,ct))return ti(at);Lt-=Vt.top-Ot.viewOffset;for(var Ht=0;Ht<it.display.gutterSpecs.length;++Ht){var se=Ot.gutters.childNodes[Ht];if(se&&se.getBoundingClientRect().right>=mt){var We=me(it.doc,Lt),fe=it.display.gutterSpecs[Ht];return Ke(it,ct,it,We,fe.className,at),ti(at)}}}function wf(it,at){return Pf(it,at,"gutterClick",!0)}function Cf(it,at){Yo(it.display,at)||om(it,at)||nn(it,at,"contextmenu")||Et||it.display.input.onContextMenu(at)}function om(it,at){return gn(it,"gutterContextMenu")?Pf(it,at,"gutterContextMenu",!1):!1}function Ef(it){it.display.wrapper.className=it.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+it.options.theme.replace(/(^|\s)\s*/g," cm-s-"),uu(it)}var kh={toString:function(){return"CodeMirror.Init"}},jg={},bc={};function am(it){var at=it.optionHandlers;function ct(dt,mt,Lt,Ot){it.defaults[dt]=mt,Lt&&(at[dt]=Ot?function(Vt,Ht,se){se!=kh&&Lt(Vt,Ht,se)}:Lt)}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),uu(dt),ir(dt)},!0),ct("lineSeparator",null,function(dt,mt){if(dt.doc.lineSep=mt,!!mt){var Lt=[],Ot=dt.doc.first;dt.doc.iter(function(Ht){for(var se=0;;){var We=Ht.text.indexOf(mt,se);if(We==-1)break;se=We+mt.length,Lt.push(ze(Ot,We))}Ot++});for(var Vt=Lt.length-1;Vt>=0;Vt--)nd(dt.doc,mt,Lt[Vt],ze(Lt[Vt].line,Lt[Vt].ch+mt.length))}}),ct("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(dt,mt,Lt){dt.state.specialChars=new RegExp(mt.source+(mt.test(" ")?"":"| "),"g"),Lt!=kh&&dt.refresh()}),ct("specialCharPlaceholder",lo,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",!pt),ct("wholeLineUpdateBefore",!0),ct("theme","default",function(dt){Ef(dt),Dl(dt)},!0),ct("keyMap","default",function(dt,mt,Lt){var Ot=od(mt),Vt=Lt!=kh&&od(Lt);Vt&&Vt.detach&&Vt.detach(dt,Ot),Ot.attach&&Ot.attach(dt,Vt||null)}),ct("extraKeys",null),ct("configureMouse",null),ct("lineWrapping",!1,sm,!0),ct("gutters",[],function(dt,mt){dt.display.gutterSpecs=Ea(mt,dt.options.lineNumbers),Dl(dt)},!0),ct("fixedGutter",!0,function(dt,mt){dt.display.gutters.style.left=mt?Yr(dt.display)+"px":"0",dt.refresh()},!0),ct("coverGutterNextToScrollbar",!1,function(dt){return is(dt)},!0),ct("scrollbarStyle","native",function(dt){Yl(dt),is(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=Ea(dt.options.gutters,mt),Dl(dt)},!0),ct("firstLineNumber",1,Dl,!0),ct("lineNumberFormatter",function(dt){return dt},Dl,!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,Lf),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 Lf(it,at,ct){var dt=ct&&ct!=kh;if(!at!=!dt){var mt=it.display.dragFunctions,Lt=at?fn:Ge;Lt(it.display.scroller,"dragstart",mt.start),Lt(it.display.scroller,"dragenter",mt.enter),Lt(it.display.scroller,"dragover",mt.over),Lt(it.display.scroller,"dragleave",mt.leave),Lt(it.display.scroller,"drop",mt.drop)}}function sm(it){it.options.lineWrapping?(ye(it.display.wrapper,"CodeMirror-wrap"),it.display.sizer.style.minWidth="",it.display.sizerWidth=null):(It(it.display.wrapper,"CodeMirror-wrap"),or(it)),Vi(it),ir(it),uu(it),setTimeout(function(){return is(it)},100)}function Qo(it,at){var ct=this;if(!(this instanceof Qo))return new Qo(it,at);this.options=at=at?pn(at):{},pn(jg,at,!1);var dt=at.value;typeof dt=="string"?dt=new Bs(dt,at.mode,null,at.lineSeparator,at.direction):at.mode&&(dt.modeOption=at.mode),this.doc=dt;var mt=new Qo.inputStyles[at.inputStyle](this),Lt=this.display=new wh(it,dt,mt,at);Lt.wrapper.CodeMirror=this,Ef(this),at.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Yl(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 Xt,keySeq:null,specialChars:null},at.autofocus&&!et&&Lt.input.focus(),ue&&Dt<11&&setTimeout(function(){return ct.display.input.reset(!0)},20),Vd(this),Il(),al(this),this.curOp.forceUpdate=!0,lf(this,dt),at.autofocus&&!et||this.hasFocus()?setTimeout(function(){ct.hasFocus()&&!ct.state.focused&&Ji(ct)},20):_a(this);for(var Ot in bc)bc.hasOwnProperty(Ot)&&bc[Ot](this,at[Ot],kh);Ma(this),at.finishInit&&at.finishInit(this);for(var Vt=0;Vt<ud.length;++Vt)ud[Vt](this);ml(this),ee&&at.lineWrapping&&getComputedStyle(Lt.lineDiv).textRendering=="optimizelegibility"&&(Lt.lineDiv.style.textRendering="auto")}Qo.defaults=jg,Qo.optionHandlers=bc;function Vd(it){var at=it.display;fn(at.scroller,"mousedown",lr(it,ku)),ue&&Dt<11?fn(at.scroller,"dblclick",lr(it,function(Ht){if(!nn(it,Ht)){var se=to(it,Ht);if(!(!se||wf(it,Ht)||Yo(it.display,Ht))){zn(Ht);var We=it.findWordAt(se);cf(it.doc,We.anchor,We.head)}}})):fn(at.scroller,"dblclick",function(Ht){return nn(it,Ht)||zn(Ht)}),fn(at.scroller,"contextmenu",function(Ht){return Cf(it,Ht)}),fn(at.input.getField(),"contextmenu",function(Ht){at.scroller.contains(Ht.target)||Cf(it,Ht)});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 Lt(Ht){if(Ht.touches.length!=1)return!1;var se=Ht.touches[0];return se.radiusX<=1&&se.radiusY<=1}function Ot(Ht,se){if(se.left==null)return!0;var We=se.left-Ht.left,fe=se.top-Ht.top;return We*We+fe*fe>20*20}fn(at.scroller,"touchstart",function(Ht){if(!nn(it,Ht)&&!Lt(Ht)&&!wf(it,Ht)){at.input.ensurePolled(),clearTimeout(ct);var se=+new Date;at.activeTouch={start:se,moved:!1,prev:se-dt.end<=300?dt:null},Ht.touches.length==1&&(at.activeTouch.left=Ht.touches[0].pageX,at.activeTouch.top=Ht.touches[0].pageY)}}),fn(at.scroller,"touchmove",function(){at.activeTouch&&(at.activeTouch.moved=!0)}),fn(at.scroller,"touchend",function(Ht){var se=at.activeTouch;if(se&&!Yo(at,Ht)&&se.left!=null&&!se.moved&&new Date-se.start<300){var We=it.coordsChar(at.activeTouch,"page"),fe;!se.prev||Ot(se,se.prev)?fe=new aa(We,We):!se.prev.prev||Ot(se,se.prev.prev)?fe=it.findWordAt(We):fe=new aa(ze(We.line,0),hi(it.doc,ze(We.line+1,0))),it.setSelection(fe.anchor,fe.head),it.focus(),zn(Ht)}mt()}),fn(at.scroller,"touchcancel",mt),fn(at.scroller,"scroll",function(){at.scroller.clientHeight&&(ol(it,at.scroller.scrollTop),Ul(it,at.scroller.scrollLeft,!0),Ke(it,"scroll",it))}),fn(at.scroller,"mousewheel",function(Ht){return vs(it,Ht)}),fn(at.scroller,"DOMMouseScroll",function(Ht){return vs(it,Ht)}),fn(at.wrapper,"scroll",function(){return at.wrapper.scrollTop=at.wrapper.scrollLeft=0}),at.dragFunctions={enter:function(Ht){nn(it,Ht)||wi(Ht)},over:function(Ht){nn(it,Ht)||($p(it,Ht),wi(Ht))},start:function(Ht){return Qp(it,Ht)},drop:lr(it,wg),leave:function(Ht){nn(it,Ht)||qp(it)}};var Vt=at.input.getField();fn(Vt,"keyup",function(Ht){return Tg.call(it,Ht)}),fn(Vt,"keydown",lr(it,Bg)),fn(Vt,"keypress",lr(it,Mu)),fn(Vt,"focus",function(Ht){return Ji(it,Ht)}),fn(Vt,"blur",function(Ht){return _a(it,Ht)})}var ud=[];Qo.defineInitHook=function(it){return ud.push(it)};function hs(it,at,ct,dt){var mt=it.doc,Lt;ct==null&&(ct="add"),ct=="smart"&&(mt.mode.indent?Lt=Xr(it,at).state:ct="prev");var Ot=it.options.tabSize,Vt=Gn(mt,at),Ht=te(Vt.text,null,Ot);Vt.stateAfter&&(Vt.stateAfter=null);var se=Vt.text.match(/^\s*/)[0],We;if(!dt&&!/\S/.test(Vt.text))We=0,ct="not";else if(ct=="smart"&&(We=mt.mode.indent(Lt,Vt.text.slice(se.length),Vt.text),We==En||We>150)){if(!dt)return;ct="prev"}ct=="prev"?at>mt.first?We=te(Gn(mt,at-1).text,null,Ot):We=0:ct=="add"?We=Ht+it.options.indentUnit:ct=="subtract"?We=Ht-it.options.indentUnit:typeof ct=="number"&&(We=Ht+ct),We=Math.max(0,We);var fe="",Sn=0;if(it.options.indentWithTabs)for(var ln=Math.floor(We/Ot);ln;--ln)Sn+=Ot,fe+=" ";if(Sn<We&&(fe+=he(We-Sn)),fe!=se)return nd(mt,fe,ze(at,0),ze(at,se.length),"+input"),Vt.stateAfter=null,!0;for(var Mi=0;Mi<mt.sel.ranges.length;Mi++){var Bi=mt.sel.ranges[Mi];if(Bi.head.line==at&&Bi.head.ch<se.length){var _i=ze(at,se.length);Lh(mt,Mi,new aa(_i,_i));break}}}var sl=null;function hd(it){sl=it}function Nc(it,at,ct,dt,mt){var Lt=it.doc;it.display.shift=!1,dt||(dt=Lt.sel);var Ot=+new Date-200,Vt=mt=="paste"||it.state.pasteIncoming>Ot,Ht=Zi(at),se=null;if(Vt&&dt.ranges.length>1)if(sl&&sl.text.join(`
|
|
`)==at){if(dt.ranges.length%sl.text.length==0){se=[];for(var We=0;We<sl.text.length;We++)se.push(Lt.splitLines(sl.text[We]))}}else Ht.length==dt.ranges.length&&it.options.pasteLinesPerSelection&&(se=Yn(Ht,function(rr){return[rr]}));for(var fe=it.curOp.updateInput,Sn=dt.ranges.length-1;Sn>=0;Sn--){var ln=dt.ranges[Sn],Mi=ln.from(),Bi=ln.to();ln.empty()&&(ct&&ct>0?Mi=ze(Mi.line,Mi.ch-ct):it.state.overwrite&&!Vt?Bi=ze(Bi.line,Math.min(Gn(Lt,Bi.line).text.length,Bi.ch+Ce(Ht).length)):Vt&&sl&&sl.lineWise&&sl.text.join(`
|
|
`)==Ht.join(`
|
|
`)&&(Mi=Bi=ze(Mi.line,0)));var _i={from:Mi,to:Bi,text:se?se[Sn%se.length]:Ht,origin:mt||(Vt?"paste":it.state.cutIncoming>Ot?"cut":"+input")};Fh(it.doc,_i),dr(it,"inputRead",it,_i)}at&&!Vt&&Zg(it,at),Ys(it),it.curOp.updateInput<2&&(it.curOp.updateInput=fe),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&&mr(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 Lt=it.getModeAt(mt.head),Ot=!1;if(Lt.electricChars){for(var Vt=0;Vt<Lt.electricChars.length;Vt++)if(at.indexOf(Lt.electricChars.charAt(Vt))>-1){Ot=hs(it,mt.head.line,"smart");break}}else Lt.electricInput&&Lt.electricInput.test(Gn(it.doc,mt.head.line).text.slice(0,mt.head.ch))&&(Ot=hs(it,mt.head.line,"smart"));Ot&&dr(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,Lt={anchor:ze(mt,0),head:ze(mt+1,0)};ct.push(Lt),at.push(it.getRange(Lt.anchor,Lt.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=Gt("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),at=Gt("div",[it],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return ee?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 Lt=this.options,Ot=Lt[dt];Lt[dt]==mt&&dt!="mode"||(Lt[dt]=mt,at.hasOwnProperty(dt)&&lr(this,at[dt])(this,mt,Ot),Ke(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,Lt=0;Lt<mt.length;++Lt)if(mt[Lt]==dt||mt[Lt].name==dt)return mt.splice(Lt,1),!0},addOverlay:ki(function(dt,mt){var Lt=dt.token?dt:it.getMode(this.options,dt);if(Lt.startState)throw new Error("Overlays may not be stateful.");Si(this.state.overlays,{mode:Lt,modeSpec:dt,opaque:mt&&mt.opaque,priority:mt&&mt.priority||0},function(Ot){return Ot.priority}),this.state.modeGen++,ir(this)}),removeOverlay:ki(function(dt){for(var mt=this.state.overlays,Lt=0;Lt<mt.length;++Lt){var Ot=mt[Lt].modeSpec;if(Ot==dt||typeof dt=="string"&&Ot.name==dt){mt.splice(Lt,1),this.state.modeGen++,ir(this);return}}}),indentLine:ki(function(dt,mt,Lt){typeof mt!="string"&&typeof mt!="number"&&(mt==null?mt=this.options.smartIndent?"smart":"prev":mt=mt?"add":"subtract"),bn(this.doc,dt)&&hs(this,dt,mt,Lt)}),indentSelection:ki(function(dt){for(var mt=this.doc.sel.ranges,Lt=-1,Ot=0;Ot<mt.length;Ot++){var Vt=mt[Ot];if(Vt.empty())Vt.head.line>Lt&&(hs(this,Vt.head.line,dt,!0),Lt=Vt.head.line,Ot==this.doc.sel.primIndex&&Ys(this));else{var Ht=Vt.from(),se=Vt.to(),We=Math.max(Lt,Ht.line);Lt=Math.min(this.lastLine(),se.line-(se.ch?0:1))+1;for(var fe=We;fe<Lt;++fe)hs(this,fe,dt);var Sn=this.doc.sel.ranges;Ht.ch==0&&mt.length==Sn.length&&Sn[Ot].from().ch>0&&Lh(this.doc,Ot,new aa(Ht,Sn[Ot].to()),Ie)}}}),getTokenAt:function(dt,mt){return br(this,dt,mt)},getLineTokens:function(dt,mt){return br(this,ze(dt),mt,!0)},getTokenTypeAt:function(dt){dt=hi(this.doc,dt);var mt=Mr(this,Gn(this.doc,dt.line)),Lt=0,Ot=(mt.length-1)/2,Vt=dt.ch,Ht;if(Vt==0)Ht=mt[2];else for(;;){var se=Lt+Ot>>1;if((se?mt[se*2-1]:0)>=Vt)Ot=se;else if(mt[se*2+1]<Vt)Lt=se+1;else{Ht=mt[se*2+2];break}}var We=Ht?Ht.indexOf("overlay "):-1;return We<0?Ht:We==0?null:Ht.slice(0,We-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 Lt=[];if(!ct.hasOwnProperty(mt))return Lt;var Ot=ct[mt],Vt=this.getModeAt(dt);if(typeof Vt[mt]=="string")Ot[Vt[mt]]&&Lt.push(Ot[Vt[mt]]);else if(Vt[mt])for(var Ht=0;Ht<Vt[mt].length;Ht++){var se=Ot[Vt[mt][Ht]];se&&Lt.push(se)}else Vt.helperType&&Ot[Vt.helperType]?Lt.push(Ot[Vt.helperType]):Ot[Vt.name]&&Lt.push(Ot[Vt.name]);for(var We=0;We<Ot._global.length;We++){var fe=Ot._global[We];fe.pred(Vt,this)&&Qe(Lt,fe.val)==-1&&Lt.push(fe.val)}return Lt},getStateAfter:function(dt,mt){var Lt=this.doc;return dt=ii(Lt,dt==null?Lt.first+Lt.size-1:dt),Xr(this,dt+1,mt).state},cursorCoords:function(dt,mt){var Lt,Ot=this.doc.sel.primary();return dt==null?Lt=Ot.head:typeof dt=="object"?Lt=hi(this.doc,dt):Lt=dt?Ot.from():Ot.to(),_o(this,Lt,mt||"page")},charCoords:function(dt,mt){return ga(this,hi(this.doc,dt),mt||"page")},coordsChar:function(dt,mt){return dt=Bl(this,dt,mt||"page"),Ta(this,dt.left,dt.top)},lineAtHeight:function(dt,mt){return dt=Bl(this,{top:dt,left:0},mt||"page").top,me(this.doc,dt+this.display.viewOffset)},heightAtLine:function(dt,mt,Lt){var Ot=!1,Vt;if(typeof dt=="number"){var Ht=this.doc.first+this.doc.size-1;dt<this.doc.first?dt=this.doc.first:dt>Ht&&(dt=Ht,Ot=!0),Vt=Gn(this.doc,dt)}else Vt=dt;return Ga(this,Vt,{top:0,left:0},mt||"page",Lt||Ot).top+(Ot?this.doc.height-tr(Vt):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,Lt,Ot,Vt){var Ht=this.display;dt=_o(this,hi(this.doc,dt));var se=dt.bottom,We=dt.left;if(mt.style.position="absolute",mt.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(mt),Ht.sizer.appendChild(mt),Ot=="over")se=dt.top;else if(Ot=="above"||Ot=="near"){var fe=Math.max(Ht.wrapper.clientHeight,this.doc.height),Sn=Math.max(Ht.sizer.clientWidth,Ht.lineSpace.clientWidth);(Ot=="above"||dt.bottom+mt.offsetHeight>fe)&&dt.top>mt.offsetHeight?se=dt.top-mt.offsetHeight:dt.bottom+mt.offsetHeight<=fe&&(se=dt.bottom),We+mt.offsetWidth>Sn&&(We=Sn-mt.offsetWidth)}mt.style.top=se+"px",mt.style.left=mt.style.right="",Vt=="right"?(We=Ht.sizer.clientWidth-mt.offsetWidth,mt.style.right="0px"):(Vt=="left"?We=0:Vt=="middle"&&(We=(Ht.sizer.clientWidth-mt.offsetWidth)/2),mt.style.left=We+"px"),Lt&&Fa(this,{left:We,top:se,right:We+mt.offsetWidth,bottom:se+mt.offsetHeight})},triggerOnKeyDown:ki(Bg),triggerOnKeyPress:ki(Mu),triggerOnKeyUp:Tg,triggerOnMouseDown:ki(ku),execCommand:function(dt){if(Mh.hasOwnProperty(dt))return Mh[dt].call(null,this)},triggerElectric:ki(function(dt){Zg(this,dt)}),findPosH:function(dt,mt,Lt,Ot){var Vt=1;mt<0&&(Vt=-1,mt=-mt);for(var Ht=hi(this.doc,dt),se=0;se<mt&&(Ht=Bc(this.doc,Ht,Vt,Lt,Ot),!Ht.hitSide);++se);return Ht},moveH:ki(function(dt,mt){var Lt=this;this.extendSelectionsBy(function(Ot){return Lt.display.shift||Lt.doc.extend||Ot.empty()?Bc(Lt.doc,Ot.head,dt,mt,Lt.options.rtlMoveVisually):dt<0?Ot.from():Ot.to()},cn)}),deleteH:ki(function(dt,mt){var Lt=this.doc.sel,Ot=this.doc;Lt.somethingSelected()?Ot.replaceSelection("",null,"+delete"):xl(this,function(Vt){var Ht=Bc(Ot,Vt.head,dt,mt,!1);return dt<0?{from:Ht,to:Vt.head}:{from:Vt.head,to:Ht}})}),findPosV:function(dt,mt,Lt,Ot){var Vt=1,Ht=Ot;mt<0&&(Vt=-1,mt=-mt);for(var se=hi(this.doc,dt),We=0;We<mt;++We){var fe=_o(this,se,"div");if(Ht==null?Ht=fe.left:fe.left=Ht,se=Nh(this,fe,Vt,Lt),se.hitSide)break}return se},moveV:ki(function(dt,mt){var Lt=this,Ot=this.doc,Vt=[],Ht=!this.display.shift&&!Ot.extend&&Ot.sel.somethingSelected();if(Ot.extendSelectionsBy(function(We){if(Ht)return dt<0?We.from():We.to();var fe=_o(Lt,We.head,"div");We.goalColumn!=null&&(fe.left=We.goalColumn),Vt.push(fe.left);var Sn=Nh(Lt,fe,dt,mt);return mt=="page"&&We==Ot.sel.primary()&&hu(Lt,ga(Lt,Sn,"div").top-fe.top),Sn},cn),Vt.length)for(var se=0;se<Ot.sel.ranges.length;se++)Ot.sel.ranges[se].goalColumn=Vt[se]}),findWordAt:function(dt){var mt=this.doc,Lt=Gn(mt,dt.line).text,Ot=dt.ch,Vt=dt.ch;if(Lt){var Ht=this.getHelper(dt,"wordChars");(dt.sticky=="before"||Vt==Lt.length)&&Ot?--Ot:++Vt;for(var se=Lt.charAt(Ot),We=zt(se,Ht)?function(fe){return zt(fe,Ht)}:/\s/.test(se)?function(fe){return/\s/.test(fe)}:function(fe){return!/\s/.test(fe)&&!zt(fe)};Ot>0&&We(Lt.charAt(Ot-1));)--Ot;for(;Vt<Lt.length&&We(Lt.charAt(Vt));)++Vt}return new aa(ze(dt.line,Ot),ze(dt.line,Vt))},toggleOverwrite:function(dt){dt!=null&&dt==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?ye(this.display.cursorDiv,"CodeMirror-overwrite"):It(this.display.cursorDiv,"CodeMirror-overwrite"),Ke(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==ve()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:ki(function(dt,mt){Tl(this,dt,mt)}),getScrollInfo:function(){var dt=this.display.scroller;return{left:dt.scrollLeft,top:dt.scrollTop,height:dt.scrollHeight-Jo(this)-this.display.barHeight,width:dt.scrollWidth-Jo(this)-this.display.barWidth,clientHeight:ms(this),clientWidth:ps(this)}},scrollIntoView:ki(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:ze(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?Oo(this,dt):gl(this,dt.from,dt.to,dt.margin)}),setSize:ki(function(dt,mt){var Lt=this,Ot=function(Ht){return typeof Ht=="number"||/^\d+$/.test(String(Ht))?Ht+"px":Ht};dt!=null&&(this.display.wrapper.style.width=Ot(dt)),mt!=null&&(this.display.wrapper.style.height=Ot(mt)),this.options.lineWrapping&&Kl(this);var Vt=this.display.viewFrom;this.doc.iter(Vt,this.display.viewTo,function(Ht){if(Ht.widgets){for(var se=0;se<Ht.widgets.length;se++)if(Ht.widgets[se].noHScroll){Ui(Lt,Vt,"widget");break}}++Vt}),this.curOp.forceUpdate=!0,Ke(this,"refresh",this)}),operation:function(dt){return mr(this,dt)},startOperation:function(){return al(this)},endOperation:function(){return ml(this)},refresh:ki(function(){var dt=this.display.cachedTextHeight;ir(this),this.curOp.forceUpdate=!0,uu(this),Tl(this,this.doc.scrollLeft,this.doc.scrollTop),Ha(this.display),(dt==null||Math.abs(dt-sr(this.display))>.5||this.options.lineWrapping)&&Vi(this),Ke(this,"refresh",this)}),swapDoc:ki(function(dt){var mt=this.doc;return mt.cm=null,this.state.selectingText&&this.state.selectingText(),lf(this,dt),uu(this),this.display.input.reset(),Tl(this,dt.scrollLeft,dt.scrollTop),this.curOp.forceScroll=!0,dr(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}},an(it),it.registerHelper=function(dt,mt,Lt){ct.hasOwnProperty(dt)||(ct[dt]=it[dt]={_global:[]}),ct[dt][mt]=Lt},it.registerGlobalHelper=function(dt,mt,Lt,Ot){it.registerHelper(dt,mt,Ot),ct[dt]._global.push({pred:Lt,val:Ot})}}function Bc(it,at,ct,dt,mt){var Lt=at,Ot=ct,Vt=Gn(it,at.line),Ht=mt&&it.direction=="rtl"?-ct:ct;function se(){var jr=at.line+Ht;return jr<it.first||jr>=it.first+it.size?!1:(at=new ze(jr,at.ch,at.sticky),Vt=Gn(it,jr))}function We(jr){var xr;if(dt=="codepoint"){var Kr=Vt.text.charCodeAt(at.ch+(dt>0?0:-1));isNaN(Kr)?xr=null:xr=new ze(at.line,Math.max(0,Math.min(Vt.text.length,at.ch+ct*(Kr>=55296&&Kr<56320?2:1))),-ct)}else mt?xr=mf(it.cm,Vt,at,ct):xr=ts(Vt,at,ct);if(xr==null)if(!jr&&se())at=kc(mt,it.cm,Vt,at.line,Ht);else return!1;else at=xr;return!0}if(dt=="char"||dt=="codepoint")We();else if(dt=="column")We(!0);else if(dt=="word"||dt=="group")for(var fe=null,Sn=dt=="group",ln=it.cm&&it.cm.getHelper(at,"wordChars"),Mi=!0;!(ct<0&&!We(!Mi));Mi=!1){var Bi=Vt.text.charAt(at.ch)||`
|
|
`,_i=zt(Bi,ln)?"w":Sn&&Bi==`
|
|
`?"n":!Sn||/\s/.test(Bi)?null:"p";if(Sn&&!Mi&&!_i&&(_i="s"),fe&&fe!=_i){ct<0&&(ct=1,We(),at.sticky="after");break}if(_i&&(fe=_i),ct>0&&!We(!Mi))break}var rr=wc(it,at,Lt,Ot,!0);return Nn(Lt,rr)&&(rr.hitSide=!0),rr}function Nh(it,at,ct,dt){var mt=it.doc,Lt=at.left,Ot;if(dt=="page"){var Vt=Math.min(it.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),Ht=Math.max(Vt-.5*sr(it.display),3);Ot=(ct>0?at.bottom:at.top)+ct*Ht}else dt=="line"&&(Ot=ct>0?at.bottom+3:at.top-3);for(var se;se=Ta(it,Lt,Ot),!!se.outside;){if(ct<0?Ot<=0:Ot>=mt.height){se.hitSide=!0;break}Ot+=ct*5}return se}var pa=function(it){this.cm=it,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new Xt,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};pa.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 Lt(Vt){for(var Ht=Vt.target;Ht;Ht=Ht.parentNode){if(Ht==mt)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(Ht.className))break}return!1}fn(mt,"paste",function(Vt){!Lt(Vt)||nn(dt,Vt)||zg(Vt,dt)||Dt<=11&&setTimeout(lr(dt,function(){return at.updateFromDOM()}),20)}),fn(mt,"compositionstart",function(Vt){at.composing={data:Vt.data,done:!1}}),fn(mt,"compositionupdate",function(Vt){at.composing||(at.composing={data:Vt.data,done:!1})}),fn(mt,"compositionend",function(Vt){at.composing&&(Vt.data!=at.composing.data&&at.readFromDOMSoon(),at.composing.done=!0)}),fn(mt,"touchstart",function(){return ct.forceCompositionEnd()}),fn(mt,"input",function(){at.composing||at.readFromDOMSoon()});function Ot(Vt){if(!(!Lt(Vt)||nn(dt,Vt))){if(dt.somethingSelected())hd({lineWise:!1,text:dt.getSelections()}),Vt.type=="cut"&&dt.replaceSelection("",null,"cut");else if(dt.options.lineWiseCopyCut){var Ht=Gg(dt);hd({lineWise:!0,text:Ht.text}),Vt.type=="cut"&&dt.operation(function(){dt.setSelections(Ht.ranges,0,Ie),dt.replaceSelection("",null,"cut")})}else return;if(Vt.clipboardData){Vt.clipboardData.clearData();var se=sl.text.join(`
|
|
`);if(Vt.clipboardData.setData("Text",se),Vt.clipboardData.getData("Text")==se){Vt.preventDefault();return}}var We=Wg(),fe=We.firstChild;dt.display.lineSpace.insertBefore(We,dt.display.lineSpace.firstChild),fe.value=sl.text.join(`
|
|
`);var Sn=document.activeElement;Ze(fe),setTimeout(function(){dt.display.lineSpace.removeChild(We),Sn.focus(),Sn==mt&&ct.showPrimarySelection()},50)}}fn(mt,"copy",Ot),fn(mt,"cut",Ot)},pa.prototype.screenReaderLabelChanged=function(it){it?this.div.setAttribute("aria-label",it):this.div.removeAttribute("aria-label")},pa.prototype.prepareSelection=function(){var it=Nr(this.cm,!1);return it.focus=document.activeElement==this.div,it},pa.prototype.showSelection=function(it,at){!it||!this.cm.display.view.length||((it.focus||at)&&this.showPrimarySelection(),this.showMultipleSelections(it))},pa.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},pa.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 Lt=Ac(at,it.anchorNode,it.anchorOffset),Ot=Ac(at,it.focusNode,it.focusOffset);if(!(Lt&&!Lt.bad&&Ot&&!Ot.bad&&hn(Jn(Lt,Ot),dt)==0&&hn(vi(Lt,Ot),mt)==0)){var Vt=at.display.view,Ht=dt.line>=at.display.viewFrom&&Ff(at,dt)||{node:Vt[0].measure.map[2],offset:0},se=mt.line<at.display.viewTo&&Ff(at,mt);if(!se){var We=Vt[Vt.length-1].measure,fe=We.maps?We.maps[We.maps.length-1]:We.map;se={node:fe[fe.length-1],offset:fe[fe.length-2]-fe[fe.length-3]}}if(!Ht||!se){it.removeAllRanges();return}var Sn=it.rangeCount&&it.getRangeAt(0),ln;try{ln=ie(Ht.node,Ht.offset,se.offset,se.node)}catch(Mi){}ln&&(!ft&&at.state.focused?(it.collapse(Ht.node,Ht.offset),ln.collapsed||(it.removeAllRanges(),it.addRange(ln))):(it.removeAllRanges(),it.addRange(ln)),Sn&&it.anchorNode==null?it.addRange(Sn):ft&&this.startGracePeriod()),this.rememberSelection()}},pa.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)},pa.prototype.showMultipleSelections=function(it){Ut(this.cm.display.cursorDiv,it.cursors),Ut(this.cm.display.selectionDiv,it.selection)},pa.prototype.rememberSelection=function(){var it=this.getSelection();this.lastAnchorNode=it.anchorNode,this.lastAnchorOffset=it.anchorOffset,this.lastFocusNode=it.focusNode,this.lastFocusOffset=it.focusOffset},pa.prototype.selectionInEditor=function(){var it=this.getSelection();if(!it.rangeCount)return!1;var at=it.getRangeAt(0).commonAncestorContainer;return Te(this.div,at)},pa.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},pa.prototype.blur=function(){this.div.blur()},pa.prototype.getField=function(){return this.div},pa.prototype.supportsTouch=function(){return!0},pa.prototype.receivedFocus=function(){var it=this;this.selectionInEditor()?this.pollSelection():mr(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)},pa.prototype.selectionChanged=function(){var it=this.getSelection();return it.anchorNode!=this.lastAnchorNode||it.anchorOffset!=this.lastAnchorOffset||it.focusNode!=this.lastFocusNode||it.focusOffset!=this.lastFocusOffset},pa.prototype.pollSelection=function(){if(!(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())){var it=this.getSelection(),at=this.cm;if(nt&&Jt&&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&&mr(at,function(){Zs(at.doc,rh(ct,dt),Ie),(ct.bad||dt.bad)&&(at.curOp.selectionChanged=!0)})}}},pa.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=ze(dt.line-1,Gn(it.doc,dt.line-1).length)),mt.ch==Gn(it.doc,mt.line).text.length&&mt.line<it.lastLine()&&(mt=ze(mt.line+1,0)),dt.line<at.viewFrom||mt.line>at.viewTo-1)return!1;var Lt,Ot,Vt;dt.line==at.viewFrom||(Lt=Hi(it,dt.line))==0?(Ot=Qt(at.view[0].line),Vt=at.view[0].node):(Ot=Qt(at.view[Lt].line),Vt=at.view[Lt-1].node.nextSibling);var Ht=Hi(it,mt.line),se,We;if(Ht==at.view.length-1?(se=at.viewTo-1,We=at.lineDiv.lastChild):(se=Qt(at.view[Ht+1].line)-1,We=at.view[Ht+1].node.previousSibling),!Vt)return!1;for(var fe=it.doc.splitLines(Ud(it,Vt,We,Ot,se)),Sn=Ai(it.doc,ze(Ot,0),ze(se,Gn(it.doc,se).text.length));fe.length>1&&Sn.length>1;)if(Ce(fe)==Ce(Sn))fe.pop(),Sn.pop(),se--;else if(fe[0]==Sn[0])fe.shift(),Sn.shift(),Ot++;else break;for(var ln=0,Mi=0,Bi=fe[0],_i=Sn[0],rr=Math.min(Bi.length,_i.length);ln<rr&&Bi.charCodeAt(ln)==_i.charCodeAt(ln);)++ln;for(var jr=Ce(fe),xr=Ce(Sn),Kr=Math.min(jr.length-(fe.length==1?ln:0),xr.length-(Sn.length==1?ln:0));Mi<Kr&&jr.charCodeAt(jr.length-Mi-1)==xr.charCodeAt(xr.length-Mi-1);)++Mi;if(fe.length==1&&Sn.length==1&&Ot==dt.line)for(;ln&&ln>dt.ch&&jr.charCodeAt(jr.length-Mi-1)==xr.charCodeAt(xr.length-Mi-1);)ln--,Mi++;fe[fe.length-1]=jr.slice(0,jr.length-Mi).replace(/^\u200b+/,""),fe[0]=fe[0].slice(ln).replace(/\u200b+$/,"");var Eo=ze(Ot,ln),yr=ze(se,Sn.length?Ce(Sn).length-Mi:0);if(fe.length>1||fe[0]||hn(Eo,yr))return nd(it.doc,fe,Eo,yr,"+input"),!0},pa.prototype.ensurePolled=function(){this.forceCompositionEnd()},pa.prototype.reset=function(){this.forceCompositionEnd()},pa.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},pa.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))},pa.prototype.updateFromDOM=function(){var it=this;(this.cm.isReadOnly()||!this.pollContent())&&mr(this.cm,function(){return ir(it.cm)})},pa.prototype.setUneditable=function(it){it.contentEditable="false"},pa.prototype.onKeyPress=function(it){it.charCode==0||this.composing||(it.preventDefault(),this.cm.isReadOnly()||lr(this.cm,Nc)(this.cm,String.fromCharCode(it.charCode==null?it.keyCode:it.charCode),0))},pa.prototype.readOnlyChanged=function(it){this.div.contentEditable=String(it!="nocursor")},pa.prototype.onContextMenu=function(){},pa.prototype.resetPosition=function(){},pa.prototype.needsContentAttribute=!0;function Ff(it,at){var ct=js(it,at.line);if(!ct||ct.hidden)return null;var dt=Gn(it.doc,at.line),mt=La(ct,dt,at.line),Lt=tn(dt,it.doc.direction),Ot="left";if(Lt){var Vt=ke(Lt,at.ch);Ot=Vt%2?"right":"left"}var Ht=lu(mt.map,at.ch,Ot);return Ht.offset=Ht.collapse=="right"?Ht.end:Ht.start,Ht}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 Lt="",Ot=!1,Vt=it.doc.lineSeparator(),Ht=!1;function se(ln){return function(Mi){return Mi.id==ln}}function We(){Ot&&(Lt+=Vt,Ht&&(Lt+=Vt),Ot=Ht=!1)}function fe(ln){ln&&(We(),Lt+=ln)}function Sn(ln){if(ln.nodeType==1){var Mi=ln.getAttribute("cm-text");if(Mi){fe(Mi);return}var Bi=ln.getAttribute("cm-marker"),_i;if(Bi){var rr=it.findMarks(ze(dt,0),ze(mt+1,0),se(+Bi));rr.length&&(_i=rr[0].find(0))&&fe(Ai(it.doc,_i.from,_i.to).join(Vt));return}if(ln.getAttribute("contenteditable")=="false")return;var jr=/^(pre|div|p|li|table|br)$/i.test(ln.nodeName);if(!/^br$/i.test(ln.nodeName)&&ln.textContent.length==0)return;jr&&We();for(var xr=0;xr<ln.childNodes.length;xr++)Sn(ln.childNodes[xr]);/^(pre|p)$/i.test(ln.nodeName)&&(Ht=!0),jr&&(Ot=!0)}else ln.nodeType==3&&fe(ln.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;Sn(at),at!=ct;)at=at.nextSibling,Ht=!1;return Lt}function Ac(it,at,ct){var dt;if(at==it.display.lineDiv){if(dt=it.display.lineDiv.childNodes[ct],!dt)return Kd(it.clipPos(ze(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 Lt=it.display.view[mt];if(Lt.node==dt)return lm(Lt,at,ct)}}function lm(it,at,ct){var dt=it.text.firstChild,mt=!1;if(!at||!Te(dt,at))return Kd(ze(Qt(it.line),0),!0);if(at==dt&&(mt=!0,at=dt.childNodes[ct],ct=0,!at)){var Lt=it.rest?Ce(it.rest):it.line;return Kd(ze(Qt(Lt),Lt.text.length),mt)}var Ot=at.nodeType==3?at:null,Vt=at;for(!Ot&&at.childNodes.length==1&&at.firstChild.nodeType==3&&(Ot=at.firstChild,ct&&(ct=Ot.nodeValue.length));Vt.parentNode!=dt;)Vt=Vt.parentNode;var Ht=it.measure,se=Ht.maps;function We(_i,rr,jr){for(var xr=-1;xr<(se?se.length:0);xr++)for(var Kr=xr<0?Ht.map:se[xr],Eo=0;Eo<Kr.length;Eo+=3){var yr=Kr[Eo+2];if(yr==_i||yr==rr){var Ho=Qt(xr<0?it.line:it.rest[xr]),ka=Kr[Eo]+jr;return(jr<0||yr!=_i)&&(ka=Kr[Eo+(jr?1:0)]),ze(Ho,ka)}}}var fe=We(Ot,Vt,ct);if(fe)return Kd(fe,mt);for(var Sn=Vt.nextSibling,ln=Ot?Ot.nodeValue.length-ct:0;Sn;Sn=Sn.nextSibling){if(fe=We(Sn,Sn.firstChild,0),fe)return Kd(ze(fe.line,fe.ch-ln),mt);ln+=Sn.textContent.length}for(var Mi=Vt.previousSibling,Bi=ct;Mi;Mi=Mi.previousSibling){if(fe=We(Mi,Mi.firstChild,-1),fe)return Kd(ze(fe.line,fe.ch+Bi),mt);Bi+=Mi.textContent.length}}var rs=function(it){this.cm=it,this.prevInput="",this.pollingFast=!1,this.polling=new Xt,this.hasSelection=!1,this.composing=null};rs.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"),fn(mt,"input",function(){ue&&Dt>=9&&at.hasSelection&&(at.hasSelection=null),ct.poll()}),fn(mt,"paste",function(Ot){nn(dt,Ot)||zg(Ot,dt)||(dt.state.pasteIncoming=+new Date,ct.fastPoll())});function Lt(Ot){if(!nn(dt,Ot)){if(dt.somethingSelected())hd({lineWise:!1,text:dt.getSelections()});else if(dt.options.lineWiseCopyCut){var Vt=Gg(dt);hd({lineWise:!0,text:Vt.text}),Ot.type=="cut"?dt.setSelections(Vt.ranges,null,Ie):(ct.prevInput="",mt.value=Vt.text.join(`
|
|
`),Ze(mt))}else return;Ot.type=="cut"&&(dt.state.cutIncoming=+new Date)}}fn(mt,"cut",Lt),fn(mt,"copy",Lt),fn(it.scroller,"paste",function(Ot){if(!(Yo(it,Ot)||nn(dt,Ot))){if(!mt.dispatchEvent){dt.state.pasteIncoming=+new Date,ct.focus();return}var Vt=new Event("paste");Vt.clipboardData=Ot.clipboardData,mt.dispatchEvent(Vt)}}),fn(it.lineSpace,"selectstart",function(Ot){Yo(it,Ot)||zn(Ot)}),fn(mt,"compositionstart",function(){var Ot=dt.getCursor("from");ct.composing&&ct.composing.range.clear(),ct.composing={start:Ot,range:dt.markText(Ot,dt.getCursor("to"),{className:"CodeMirror-composing"})}}),fn(mt,"compositionend",function(){ct.composing&&(ct.poll(),ct.composing.range.clear(),ct.composing=null)})},rs.prototype.createField=function(it){this.wrapper=Wg(),this.textarea=this.wrapper.firstChild},rs.prototype.screenReaderLabelChanged=function(it){it?this.textarea.setAttribute("aria-label",it):this.textarea.removeAttribute("aria-label")},rs.prototype.prepareSelection=function(){var it=this.cm,at=it.display,ct=it.doc,dt=Nr(it);if(it.options.moveInputWithCursor){var mt=_o(it,ct.sel.primary().head,"div"),Lt=at.wrapper.getBoundingClientRect(),Ot=at.lineDiv.getBoundingClientRect();dt.teTop=Math.max(0,Math.min(at.wrapper.clientHeight-10,mt.top+Ot.top-Lt.top)),dt.teLeft=Math.max(0,Math.min(at.wrapper.clientWidth-10,mt.left+Ot.left-Lt.left))}return dt},rs.prototype.showSelection=function(it){var at=this.cm,ct=at.display;Ut(ct.cursorDiv,it.cursors),Ut(ct.selectionDiv,it.selection),it.teTop!=null&&(this.wrapper.style.top=it.teTop+"px",this.wrapper.style.left=it.teLeft+"px")},rs.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&&Ze(this.textarea),ue&&Dt>=9&&(this.hasSelection=ct)}else it||(this.prevInput=this.textarea.value="",ue&&Dt>=9&&(this.hasSelection=null))}},rs.prototype.getField=function(){return this.textarea},rs.prototype.supportsTouch=function(){return!1},rs.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!et||ve()!=this.textarea))try{this.textarea.focus()}catch(it){}},rs.prototype.blur=function(){this.textarea.blur()},rs.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},rs.prototype.receivedFocus=function(){this.slowPoll()},rs.prototype.slowPoll=function(){var it=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){it.poll(),it.cm.state.focused&&it.slowPoll()})},rs.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)},rs.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(ue&&Dt>=9&&this.hasSelection===mt||ht&&/[\uf700-\uf7ff]/.test(mt))return at.display.input.reset(),!1;if(at.doc.sel==at.display.selForContextMenu){var Lt=mt.charCodeAt(0);if(Lt==8203&&!dt&&(dt="\u200B"),Lt==8666)return this.reset(),this.cm.execCommand("undo")}for(var Ot=0,Vt=Math.min(dt.length,mt.length);Ot<Vt&&dt.charCodeAt(Ot)==mt.charCodeAt(Ot);)++Ot;return mr(at,function(){Nc(at,mt.slice(Ot),dt.length-Ot,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},rs.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},rs.prototype.onKeyPress=function(){ue&&Dt>=9&&(this.hasSelection=null),this.fastPoll()},rs.prototype.onContextMenu=function(it){var at=this,ct=at.cm,dt=ct.display,mt=at.textarea;at.contextMenuPending&&at.contextMenuPending();var Lt=to(ct,it),Ot=dt.scroller.scrollTop;if(!Lt||jt)return;var Vt=ct.options.resetSelectionOnContextMenu;Vt&&ct.doc.sel.contains(Lt)==-1&&lr(ct,Zs)(ct.doc,rh(Lt),Ie);var Ht=mt.style.cssText,se=at.wrapper.style.cssText,We=at.wrapper.offsetParent.getBoundingClientRect();at.wrapper.style.cssText="position: static",mt.style.cssText=`position: absolute; width: 30px; height: 30px;
|
|
top: `+(it.clientY-We.top-5)+"px; left: "+(it.clientX-We.left-5)+`px;
|
|
z-index: 1000; background: `+(ue?"rgba(255, 255, 255, .05)":"transparent")+`;
|
|
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var fe;ee&&(fe=window.scrollY),dt.input.focus(),ee&&window.scrollTo(null,fe),dt.input.reset(),ct.somethingSelected()||(mt.value=at.prevInput=" "),at.contextMenuPending=ln,dt.selForContextMenu=ct.doc.sel,clearTimeout(dt.detectingSelectAll);function Sn(){if(mt.selectionStart!=null){var Bi=ct.somethingSelected(),_i="\u200B"+(Bi?mt.value:"");mt.value="\u21DA",mt.value=_i,at.prevInput=Bi?"":"\u200B",mt.selectionStart=1,mt.selectionEnd=_i.length,dt.selForContextMenu=ct.doc.sel}}function ln(){if(at.contextMenuPending==ln&&(at.contextMenuPending=!1,at.wrapper.style.cssText=se,mt.style.cssText=Ht,ue&&Dt<9&&dt.scrollbars.setScrollTop(dt.scroller.scrollTop=Ot),mt.selectionStart!=null)){(!ue||ue&&Dt<9)&&Sn();var Bi=0,_i=function(){dt.selForContextMenu==ct.doc.sel&&mt.selectionStart==0&&mt.selectionEnd>0&&at.prevInput=="\u200B"?lr(ct,qa)(ct):Bi++<10?dt.detectingSelectAll=setTimeout(_i,500):(dt.selForContextMenu=null,dt.input.reset())};dt.detectingSelectAll=setTimeout(_i,200)}}if(ue&&Dt>=9&&Sn(),Et){wi(it);var Mi=function(){Ge(window,"mouseup",Mi),setTimeout(ln,20)};fn(window,"mouseup",Mi)}else setTimeout(ln,50)},rs.prototype.readOnlyChanged=function(it){it||this.reset(),this.textarea.disabled=it=="nocursor",this.textarea.readOnly=!!it},rs.prototype.setUneditable=function(){},rs.prototype.needsContentAttribute=!1;function um(it,at){if(at=at?pn(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=ve();at.autofocus=ct==it||it.getAttribute("autofocus")!=null&&ct==document.body}function dt(){it.value=Vt.getValue()}var mt;if(it.form&&(fn(it.form,"submit",dt),!at.leaveSubmitMethodAlone)){var Lt=it.form;mt=Lt.submit;try{var Ot=Lt.submit=function(){dt(),Lt.submit=mt,Lt.submit(),Lt.submit=Ot}}catch(Ht){}}at.finishInit=function(Ht){Ht.save=dt,Ht.getTextArea=function(){return it},Ht.toTextArea=function(){Ht.toTextArea=isNaN,dt(),it.parentNode.removeChild(Ht.getWrapperElement()),it.style.display="",it.form&&(Ge(it.form,"submit",dt),!at.leaveSubmitMethodAlone&&typeof it.form.submit=="function"&&(it.form.submit=mt))}},it.style.display="none";var Vt=Qo(function(Ht){return it.parentNode.insertBefore(Ht,it.nextSibling)},at);return Vt}function Yd(it){it.off=Ge,it.on=fn,it.wheelEventPixels=Ol,it.Doc=Bs,it.splitLines=Zi,it.countColumn=te,it.findColumn=Vn,it.isWordChar=Nt,it.Pass=En,it.signal=Ke,it.Line=so,it.changeEnd=Ch,it.scrollbarModel=pl,it.Pos=ze,it.cmpPos=hn,it.modes=jn,it.mimeModes=li,it.resolveMode=Be,it.getMode=Se,it.modeExtensions=Ee,it.extendMode=Ue,it.copyState=xi,it.startState=Pi,it.innerMode=Kn,it.commands=Mh,it.keyMap=Sl,it.keyName=em,it.isModifierKey=zd,it.lookupKey=$l,it.normalizeKeyMap=Fg,it.StringStream=$e,it.SharedTextMarker=zu,it.TextMarker=Ne,it.LineWidget=sh,it.e_preventDefault=zn,it.e_stopPropagation=gi,it.e_stop=wi,it.addClass=ye,it.contains=Te,it.rmClass=It,it.keyNames=Zu}am(Qo),bh(Qo);var lh="iter insert remove copy getEditor constructor".split(" ");for(var Tc in Bs.prototype)Bs.prototype.hasOwnProperty(Tc)&&Qe(lh,Tc)<0&&(Qo.prototype[Tc]=function(it){return function(){return it.apply(this.doc,arguments)}}(Bs.prototype[Tc]));return an(Bs),Qo.inputStyles={textarea:rs,contenteditable:pa},Qo.defineMode=function(it){!Qo.defaults.mode&&it!="null"&&(Qo.defaults.mode=it),Ci.apply(this,arguments)},Qo.defineMIME=Yi,Qo.defineMode("null",function(){return{token:function(it){return it.skipToEnd()}}}),Qo.defineMIME("text/plain","null"),Qo.defineExtension=function(it,at){Qo.prototype[it]=at},Qo.defineDocExtension=function(it,at){Bs.prototype[it]=at},Qo.fromTextArea=um,Yd(Qo),Qo.version="5.58.2",Qo})},25419:function(Mn,Rn,kt){(function(ft){ft(kt(89780),kt(15525),kt(98101))})(function(ft){"use strict";ft.defineMode("markdown",function(Kt,le){var we=ft.getMode(Kt,"text/html"),ue=we.name=="null";function Dt(te){if(ft.findModeByName){var Xt=ft.findModeByName(te);Xt&&(te=Xt.mime||Xt.mimes[0])}var Qe=ft.getMode(Kt,te);return Qe.name=="null"?null:Qe}le.highlightFormatting===void 0&&(le.highlightFormatting=!1),le.maxBlockquoteDepth===void 0&&(le.maxBlockquoteDepth=0),le.taskLists===void 0&&(le.taskLists=!1),le.strikethrough===void 0&&(le.strikethrough=!1),le.emoji===void 0&&(le.emoji=!1),le.fencedCodeBlockHighlighting===void 0&&(le.fencedCodeBlockHighlighting=!0),le.fencedCodeBlockDefaultMode===void 0&&(le.fencedCodeBlockDefaultMode="text/plain"),le.xml===void 0&&(le.xml=!0),le.tokenTypeOverrides===void 0&&(le.tokenTypeOverrides={});var ee={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 pe in ee)ee.hasOwnProperty(pe)&&le.tokenTypeOverrides[pe]&&(ee[pe]=le.tokenTypeOverrides[pe]);var Jt=/^([*\-_])(?:\s*\1){2,}\s*$/,jt=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,De=/^\[(x| )\](?=\s)/i,ae=le.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,Le=/^ {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 pt(te,Xt,Qe){return Xt.f=Xt.inline=Qe,Qe(te,Xt)}function vt(te,Xt,Qe){return Xt.f=Xt.block=Qe,Qe(te,Xt)}function St(te){return!te||!/\S/.test(te.string)}function Et(te){if(te.linkTitle=!1,te.linkHref=!1,te.linkText=!1,te.em=!1,te.strong=!1,te.strikethrough=!1,te.quote=0,te.indentedCode=!1,te.f==It){var Xt=ue;if(!Xt){var Qe=ft.innerMode(we,te.htmlState);Xt=Qe.mode.name=="xml"&&Qe.state.tagStart===null&&!Qe.state.context&&Qe.state.tokenize.isInText}Xt&&(te.f=ge,te.block=At,te.htmlState=null)}return te.trailingSpace=0,te.trailingSpaceNewLine=!1,te.prevLine=te.thisLine,te.thisLine={stream:null},null}function At(te,Xt){var Qe=te.column()===Xt.indentation,On=St(Xt.prevLine.stream),En=Xt.indentedCode,Ie=Xt.prevLine.hr,on=Xt.list!==!1,cn=(Xt.listStack[Xt.listStack.length-1]||0)+3;Xt.indentedCode=!1;var Vn=Xt.indentation;if(Xt.indentationDiff===null&&(Xt.indentationDiff=Xt.indentation,on)){for(Xt.list=null;Vn<Xt.listStack[Xt.listStack.length-1];)Xt.listStack.pop(),Xt.listStack.length?Xt.indentation=Xt.listStack[Xt.listStack.length-1]:Xt.list=!1;Xt.list!==!1&&(Xt.indentationDiff=Vn-Xt.listStack[Xt.listStack.length-1])}var Me=!On&&!Ie&&!Xt.prevLine.header&&(!on||!En)&&!Xt.prevLine.fencedCodeEnd,he=(Xt.list===!1||Ie||On)&&Xt.indentation<=cn&&te.match(Jt),Ce=null;if(Xt.indentationDiff>=4&&(En||Xt.prevLine.fencedCodeEnd||Xt.prevLine.header||On))return te.skipToEnd(),Xt.indentedCode=!0,ee.code;if(te.eatSpace())return null;if(Qe&&Xt.indentation<=cn&&(Ce=te.match(ae))&&Ce[1].length<=6)return Xt.quote=0,Xt.header=Ce[1].length,Xt.thisLine.header=!0,le.highlightFormatting&&(Xt.formatting="header"),Xt.f=Xt.inline,Ut(Xt);if(Xt.indentation<=cn&&te.eat(">"))return Xt.quote=Qe?1:Xt.quote+1,le.highlightFormatting&&(Xt.formatting="quote"),te.eatSpace(),Ut(Xt);if(!he&&!Xt.setext&&Qe&&Xt.indentation<=cn&&(Ce=te.match(jt))){var Yn=Ce[1]?"ol":"ul";return Xt.indentation=Vn+te.current().length,Xt.list=!0,Xt.quote=0,Xt.listStack.push(Xt.indentation),Xt.em=!1,Xt.strong=!1,Xt.code=!1,Xt.strikethrough=!1,le.taskLists&&te.match(De,!1)&&(Xt.taskList=!0),Xt.f=Xt.inline,le.highlightFormatting&&(Xt.formatting=["list","list-"+Yn]),Ut(Xt)}else{if(Qe&&Xt.indentation<=cn&&(Ce=te.match(nt,!0)))return Xt.quote=0,Xt.fencedEndRE=new RegExp(Ce[1]+"+ *$"),Xt.localMode=le.fencedCodeBlockHighlighting&&Dt(Ce[2]||le.fencedCodeBlockDefaultMode),Xt.localMode&&(Xt.localState=ft.startState(Xt.localMode)),Xt.f=Xt.block=qt,le.highlightFormatting&&(Xt.formatting="code-block"),Xt.code=-1,Ut(Xt);if(Xt.setext||(!Me||!on)&&!Xt.quote&&Xt.list===!1&&!Xt.code&&!he&&!et.test(te.string)&&(Ce=te.lookAhead(1))&&(Ce=Ce.match(Le)))return Xt.setext?(Xt.header=Xt.setext,Xt.setext=0,te.skipToEnd(),le.highlightFormatting&&(Xt.formatting="header")):(Xt.header=Ce[0].charAt(0)=="="?1:2,Xt.setext=Xt.header),Xt.thisLine.header=!0,Xt.f=Xt.inline,Ut(Xt);if(he)return te.skipToEnd(),Xt.hr=!0,Xt.thisLine.hr=!0,ee.hr;if(te.peek()==="[")return pt(te,Xt,Ye)}return pt(te,Xt,Xt.inline)}function It(te,Xt){var Qe=we.token(te,Xt.htmlState);if(!ue){var On=ft.innerMode(we,Xt.htmlState);(On.mode.name=="xml"&&On.state.tagStart===null&&!On.state.context&&On.state.tokenize.isInText||Xt.md_inside&&te.current().indexOf(">")>-1)&&(Xt.f=ge,Xt.block=At,Xt.htmlState=null)}return Qe}function qt(te,Xt){var Qe=Xt.listStack[Xt.listStack.length-1]||0,On=Xt.indentation<Qe,En=Qe+3;if(Xt.fencedEndRE&&Xt.indentation<=En&&(On||te.match(Xt.fencedEndRE))){le.highlightFormatting&&(Xt.formatting="code-block");var Ie;return On||(Ie=Ut(Xt)),Xt.localMode=Xt.localState=null,Xt.block=At,Xt.f=ge,Xt.fencedEndRE=null,Xt.code=0,Xt.thisLine.fencedCodeEnd=!0,On?vt(te,Xt,Xt.block):Ie}else return Xt.localMode?Xt.localMode.token(te,Xt.localState):(te.skipToEnd(),ee.code)}function Ut(te){var Xt=[];if(te.formatting){Xt.push(ee.formatting),typeof te.formatting=="string"&&(te.formatting=[te.formatting]);for(var Qe=0;Qe<te.formatting.length;Qe++)Xt.push(ee.formatting+"-"+te.formatting[Qe]),te.formatting[Qe]==="header"&&Xt.push(ee.formatting+"-"+te.formatting[Qe]+"-"+te.header),te.formatting[Qe]==="quote"&&(!le.maxBlockquoteDepth||le.maxBlockquoteDepth>=te.quote?Xt.push(ee.formatting+"-"+te.formatting[Qe]+"-"+te.quote):Xt.push("error"))}if(te.taskOpen)return Xt.push("meta"),Xt.length?Xt.join(" "):null;if(te.taskClosed)return Xt.push("property"),Xt.length?Xt.join(" "):null;if(te.linkHref?Xt.push(ee.linkHref,"url"):(te.strong&&Xt.push(ee.strong),te.em&&Xt.push(ee.em),te.strikethrough&&Xt.push(ee.strikethrough),te.emoji&&Xt.push(ee.emoji),te.linkText&&Xt.push(ee.linkText),te.code&&Xt.push(ee.code),te.image&&Xt.push(ee.image),te.imageAltText&&Xt.push(ee.imageAltText,"link"),te.imageMarker&&Xt.push(ee.imageMarker)),te.header&&Xt.push(ee.header,ee.header+"-"+te.header),te.quote&&(Xt.push(ee.quote),!le.maxBlockquoteDepth||le.maxBlockquoteDepth>=te.quote?Xt.push(ee.quote+"-"+te.quote):Xt.push(ee.quote+"-"+le.maxBlockquoteDepth)),te.list!==!1){var On=(te.listStack.length-1)%3;On?On===1?Xt.push(ee.list2):Xt.push(ee.list3):Xt.push(ee.list1)}return te.trailingSpaceNewLine?Xt.push("trailing-space-new-line"):te.trailingSpace&&Xt.push("trailing-space-"+(te.trailingSpace%2?"a":"b")),Xt.length?Xt.join(" "):null}function Gt(te,Xt){if(te.match(Bt,!0))return Ut(Xt)}function ge(te,Xt){var Qe=Xt.text(te,Xt);if(typeof Qe!="undefined")return Qe;if(Xt.list)return Xt.list=null,Ut(Xt);if(Xt.taskList){var On=te.match(De,!0)[1]===" ";return On?Xt.taskOpen=!0:Xt.taskClosed=!0,le.highlightFormatting&&(Xt.formatting="task"),Xt.taskList=!1,Ut(Xt)}if(Xt.taskOpen=!1,Xt.taskClosed=!1,Xt.header&&te.match(/^#+$/,!0))return le.highlightFormatting&&(Xt.formatting="header"),Ut(Xt);var En=te.next();if(Xt.linkTitle){Xt.linkTitle=!1;var Ie=En;En==="("&&(Ie=")"),Ie=(Ie+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var on="^\\s*(?:[^"+Ie+"\\\\]+|\\\\\\\\|\\\\.)"+Ie;if(te.match(new RegExp(on),!0))return ee.linkHref}if(En==="`"){var cn=Xt.formatting;le.highlightFormatting&&(Xt.formatting="code"),te.eatWhile("`");var Vn=te.current().length;if(Xt.code==0&&(!Xt.quote||Vn==1))return Xt.code=Vn,Ut(Xt);if(Vn==Xt.code){var Me=Ut(Xt);return Xt.code=0,Me}else return Xt.formatting=cn,Ut(Xt)}else if(Xt.code)return Ut(Xt);if(En==="\\"&&(te.next(),le.highlightFormatting)){var he=Ut(Xt),Ce=ee.formatting+"-escape";return he?he+" "+Ce:Ce}if(En==="!"&&te.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return Xt.imageMarker=!0,Xt.image=!0,le.highlightFormatting&&(Xt.formatting="image"),Ut(Xt);if(En==="["&&Xt.imageMarker&&te.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return Xt.imageMarker=!1,Xt.imageAltText=!0,le.highlightFormatting&&(Xt.formatting="image"),Ut(Xt);if(En==="]"&&Xt.imageAltText){le.highlightFormatting&&(Xt.formatting="image");var he=Ut(Xt);return Xt.imageAltText=!1,Xt.image=!1,Xt.inline=Xt.f=Te,he}if(En==="["&&!Xt.image)return Xt.linkText&&te.match(/^.*?\]/)||(Xt.linkText=!0,le.highlightFormatting&&(Xt.formatting="link")),Ut(Xt);if(En==="]"&&Xt.linkText){le.highlightFormatting&&(Xt.formatting="link");var he=Ut(Xt);return Xt.linkText=!1,Xt.inline=Xt.f=te.match(/\(.*?\)| ?\[.*?\]/,!1)?Te:ge,he}if(En==="<"&&te.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){Xt.f=Xt.inline=ie,le.highlightFormatting&&(Xt.formatting="link");var he=Ut(Xt);return he?he+=" ":he="",he+ee.linkInline}if(En==="<"&&te.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){Xt.f=Xt.inline=ie,le.highlightFormatting&&(Xt.formatting="link");var he=Ut(Xt);return he?he+=" ":he="",he+ee.linkEmail}if(le.xml&&En==="<"&&te.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var Yn=te.string.indexOf(">",te.pos);if(Yn!=-1){var Si=te.string.substring(te.start,Yn);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(Si)&&(Xt.md_inside=!0)}return te.backUp(1),Xt.htmlState=ft.startState(we),vt(te,Xt,It)}if(le.xml&&En==="<"&&te.match(/^\/\w*?>/))return Xt.md_inside=!1,"tag";if(En==="*"||En==="_"){for(var Rt=1,Ft=te.pos==1?" ":te.string.charAt(te.pos-2);Rt<3&&te.eat(En);)Rt++;var Pt=te.peek()||" ",Nt=!/\s/.test(Pt)&&(!ht.test(Pt)||/\s/.test(Ft)||ht.test(Ft)),zt=!/\s/.test(Ft)&&(!ht.test(Ft)||/\s/.test(Pt)||ht.test(Pt)),Mt=null,Yt=null;if(Rt%2&&(!Xt.em&&Nt&&(En==="*"||!zt||ht.test(Ft))?Mt=!0:Xt.em==En&&zt&&(En==="*"||!Nt||ht.test(Pt))&&(Mt=!1)),Rt>1&&(!Xt.strong&&Nt&&(En==="*"||!zt||ht.test(Ft))?Yt=!0:Xt.strong==En&&zt&&(En==="*"||!Nt||ht.test(Pt))&&(Yt=!1)),Yt!=null||Mt!=null){le.highlightFormatting&&(Xt.formatting=Mt==null?"strong":Yt==null?"em":"strong em"),Mt===!0&&(Xt.em=En),Yt===!0&&(Xt.strong=En);var Me=Ut(Xt);return Mt===!1&&(Xt.em=!1),Yt===!1&&(Xt.strong=!1),Me}}else if(En===" "&&(te.eat("*")||te.eat("_"))){if(te.peek()===" ")return Ut(Xt);te.backUp(1)}if(le.strikethrough){if(En==="~"&&te.eatWhile(En)){if(Xt.strikethrough){le.highlightFormatting&&(Xt.formatting="strikethrough");var Me=Ut(Xt);return Xt.strikethrough=!1,Me}else if(te.match(/^[^\s]/,!1))return Xt.strikethrough=!0,le.highlightFormatting&&(Xt.formatting="strikethrough"),Ut(Xt)}else if(En===" "&&te.match(/^~~/,!0)){if(te.peek()===" ")return Ut(Xt);te.backUp(2)}}if(le.emoji&&En===":"&&te.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){Xt.emoji=!0,le.highlightFormatting&&(Xt.formatting="emoji");var He=Ut(Xt);return Xt.emoji=!1,He}return En===" "&&(te.match(/^ +$/,!1)?Xt.trailingSpace++:Xt.trailingSpace&&(Xt.trailingSpaceNewLine=!0)),Ut(Xt)}function ie(te,Xt){var Qe=te.next();if(Qe===">"){Xt.f=Xt.inline=ge,le.highlightFormatting&&(Xt.formatting="link");var On=Ut(Xt);return On?On+=" ":On="",On+ee.linkInline}return te.match(/^[^>]+/,!0),ee.linkInline}function Te(te,Xt){if(te.eatSpace())return null;var Qe=te.next();return Qe==="("||Qe==="["?(Xt.f=Xt.inline=ye(Qe==="("?")":"]"),le.highlightFormatting&&(Xt.formatting="link-string"),Xt.linkHref=!0,Ut(Xt)):"error"}var ve={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function ye(te){return function(Xt,Qe){var On=Xt.next();if(On===te){Qe.f=Qe.inline=ge,le.highlightFormatting&&(Qe.formatting="link-string");var En=Ut(Qe);return Qe.linkHref=!1,En}return Xt.match(ve[te]),Qe.linkHref=!0,Ut(Qe)}}function Ye(te,Xt){return te.match(/^([^\]\\]|\\.)*\]:/,!1)?(Xt.f=Ze,te.next(),le.highlightFormatting&&(Xt.formatting="link"),Xt.linkText=!0,Ut(Xt)):pt(te,Xt,ge)}function Ze(te,Xt){if(te.match(/^\]:/,!0)){Xt.f=Xt.inline=qe,le.highlightFormatting&&(Xt.formatting="link");var Qe=Ut(Xt);return Xt.linkText=!1,Qe}return te.match(/^([^\]\\]|\\.)+/,!0),ee.linkText}function qe(te,Xt){return te.eatSpace()?null:(te.match(/^[^\s]+/,!0),te.peek()===void 0?Xt.linkTitle=!0:te.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),Xt.f=Xt.inline=ge,ee.linkHref+" url")}var pn={startState:function(){return{f:At,prevLine:{stream:null},thisLine:{stream:null},block:At,htmlState:null,indentation:0,inline:ge,text:Gt,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(te){return{f:te.f,prevLine:te.prevLine,thisLine:te.thisLine,block:te.block,htmlState:te.htmlState&&ft.copyState(we,te.htmlState),indentation:te.indentation,localMode:te.localMode,localState:te.localMode?ft.copyState(te.localMode,te.localState):null,inline:te.inline,text:te.text,formatting:!1,linkText:te.linkText,linkTitle:te.linkTitle,linkHref:te.linkHref,code:te.code,em:te.em,strong:te.strong,strikethrough:te.strikethrough,emoji:te.emoji,header:te.header,setext:te.setext,hr:te.hr,taskList:te.taskList,list:te.list,listStack:te.listStack.slice(0),quote:te.quote,indentedCode:te.indentedCode,trailingSpace:te.trailingSpace,trailingSpaceNewLine:te.trailingSpaceNewLine,md_inside:te.md_inside,fencedEndRE:te.fencedEndRE}},token:function(te,Xt){if(Xt.formatting=!1,te!=Xt.thisLine.stream){if(Xt.header=0,Xt.hr=!1,te.match(/^\s*$/,!0))return Et(Xt),null;if(Xt.prevLine=Xt.thisLine,Xt.thisLine={stream:te},Xt.taskList=!1,Xt.trailingSpace=0,Xt.trailingSpaceNewLine=!1,!Xt.localState&&(Xt.f=Xt.block,Xt.f!=It)){var Qe=te.match(/^\s*/,!0)[0].replace(/\t/g,st).length;if(Xt.indentation=Qe,Xt.indentationDiff=null,Qe>0)return null}}return Xt.f(te,Xt)},innerMode:function(te){return te.block==It?{state:te.htmlState,mode:we}:te.localState?{state:te.localState,mode:te.localMode}:{state:te,mode:pn}},indent:function(te,Xt,Qe){return te.block==It&&we.indent?we.indent(te.htmlState,Xt,Qe):te.localState&&te.localMode.indent?te.localMode.indent(te.localState,Xt,Qe):ft.Pass},blankLine:Et,getType:Ut,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return pn},"xml"),ft.defineMIME("text/markdown","markdown"),ft.defineMIME("text/x-markdown","markdown")})},98101:function(Mn,Rn,kt){(function(ft){ft(kt(89780))})(function(ft){"use strict";ft.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 Kt=0;Kt<ft.modeInfo.length;Kt++){var le=ft.modeInfo[Kt];le.mimes&&(le.mime=le.mimes[0])}ft.findModeByMIME=function(we){we=we.toLowerCase();for(var ue=0;ue<ft.modeInfo.length;ue++){var Dt=ft.modeInfo[ue];if(Dt.mime==we)return Dt;if(Dt.mimes){for(var ee=0;ee<Dt.mimes.length;ee++)if(Dt.mimes[ee]==we)return Dt}}if(/\+xml$/.test(we))return ft.findModeByMIME("application/xml");if(/\+json$/.test(we))return ft.findModeByMIME("application/json")},ft.findModeByExtension=function(we){we=we.toLowerCase();for(var ue=0;ue<ft.modeInfo.length;ue++){var Dt=ft.modeInfo[ue];if(Dt.ext){for(var ee=0;ee<Dt.ext.length;ee++)if(Dt.ext[ee]==we)return Dt}}},ft.findModeByFileName=function(we){for(var ue=0;ue<ft.modeInfo.length;ue++){var Dt=ft.modeInfo[ue];if(Dt.file&&Dt.file.test(we))return Dt}var ee=we.lastIndexOf("."),pe=ee>-1&&we.substring(ee+1,we.length);if(pe)return ft.findModeByExtension(pe)},ft.findModeByName=function(we){we=we.toLowerCase();for(var ue=0;ue<ft.modeInfo.length;ue++){var Dt=ft.modeInfo[ue];if(Dt.name.toLowerCase()==we)return Dt;if(Dt.alias){for(var ee=0;ee<Dt.alias.length;ee++)if(Dt.alias[ee].toLowerCase()==we)return Dt}}}})},67549:function(Mn,Rn,kt){(function(ft){ft(kt(89780))})(function(ft){"use strict";ft.defineMode("stex",function(Kt,le){"use strict";function we(Bt,nt){Bt.cmdState.push(nt)}function ue(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 ee(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 pe(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 Jt={};Jt.importmodule=pe("importmodule","tag",["string","builtin"]),Jt.documentclass=pe("documentclass","tag",["","atom"]),Jt.usepackage=pe("usepackage","tag",["atom"]),Jt.begin=pe("begin","tag",["atom"]),Jt.end=pe("end","tag",["atom"]),Jt.label=pe("label","tag",["atom"]),Jt.ref=pe("ref","tag",["atom"]),Jt.eqref=pe("eqref","tag",["atom"]),Jt.cite=pe("cite","tag",["atom"]),Jt.bibitem=pe("bibitem","tag",["atom"]),Jt.Bibitem=pe("Bibitem","tag",["atom"]),Jt.RBibitem=pe("RBibitem","tag",["atom"]),Jt.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function jt(Bt,nt){Bt.f=nt}function De(Bt,nt){var et;if(Bt.match(/^\\[a-zA-Z@]+/)){var ht=Bt.current().slice(1);return et=Jt.hasOwnProperty(ht)?Jt[ht]:Jt.DEFAULT,et=new et,we(nt,et),jt(nt,Le),et.style}if(Bt.match(/^\\[$&%#{}_]/)||Bt.match(/^\\[,;!\/\\]/))return"tag";if(Bt.match("\\["))return jt(nt,function(pt,vt){return ae(pt,vt,"\\]")}),"keyword";if(Bt.match("\\("))return jt(nt,function(pt,vt){return ae(pt,vt,"\\)")}),"keyword";if(Bt.match("$$"))return jt(nt,function(pt,vt){return ae(pt,vt,"$$")}),"keyword";if(Bt.match("$"))return jt(nt,function(pt,vt){return ae(pt,vt,"$")}),"keyword";var st=Bt.next();if(st=="%")return Bt.skipToEnd(),"comment";if(st=="}"||st=="]"){if(et=ue(nt),et)et.closeBracket(st),jt(nt,Le);else return"error";return"bracket"}else return st=="{"||st=="["?(et=Jt.DEFAULT,et=new et,we(nt,et),"bracket"):/\d/.test(st)?(Bt.eatWhile(/[\w.%]/),"atom"):(Bt.eatWhile(/[\w\-_]/),et=ee(nt),et.name=="begin"&&(et.argument=Bt.current()),et.styleIdentifier())}function ae(Bt,nt,et){if(Bt.eatSpace())return null;if(et&&Bt.match(et))return jt(nt,De),"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 Le(Bt,nt){var et=Bt.peek(),ht;return et=="{"||et=="["?(ht=ue(nt),ht.openBracket(et),Bt.eat(et),jt(nt,De),"bracket"):/[ \t\r]/.test(et)?(Bt.eat(et),null):(jt(nt,De),Dt(nt),De(Bt,nt))}return{startState:function(){var Bt=le.inMathMode?function(nt,et){return ae(nt,et)}:De;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=De,Bt.cmdState.length=0},lineComment:"%"}}),ft.defineMIME("text/x-stex","stex"),ft.defineMIME("text/x-latex","stex")})},15525:function(Mn,Rn,kt){(function(ft){ft(kt(89780))})(function(ft){"use strict";var Kt={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},le={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};ft.defineMode("xml",function(we,ue){var Dt=we.indentUnit,ee={},pe=ue.htmlMode?Kt:le;for(var Jt in pe)ee[Jt]=pe[Jt];for(var Jt in ue)ee[Jt]=ue[Jt];var jt,De;function ae(ie,Te){function ve(Ze){return Te.tokenize=Ze,Ze(ie,Te)}var ye=ie.next();if(ye=="<")return ie.eat("!")?ie.eat("[")?ie.match("CDATA[")?ve(nt("atom","]]>")):null:ie.match("--")?ve(nt("comment","-->")):ie.match("DOCTYPE",!0,!0)?(ie.eatWhile(/[\w\._\-]/),ve(et(1))):null:ie.eat("?")?(ie.eatWhile(/[\w\._\-]/),Te.tokenize=nt("meta","?>"),"meta"):(jt=ie.eat("/")?"closeTag":"openTag",Te.tokenize=Le,"tag bracket");if(ye=="&"){var Ye;return ie.eat("#")?ie.eat("x")?Ye=ie.eatWhile(/[a-fA-F\d]/)&&ie.eat(";"):Ye=ie.eatWhile(/[\d]/)&&ie.eat(";"):Ye=ie.eatWhile(/[\w\.\-:]/)&&ie.eat(";"),Ye?"atom":"error"}else return ie.eatWhile(/[^&<]/),null}ae.isInText=!0;function Le(ie,Te){var ve=ie.next();if(ve==">"||ve=="/"&&ie.eat(">"))return Te.tokenize=ae,jt=ve==">"?"endTag":"selfcloseTag","tag bracket";if(ve=="=")return jt="equals",null;if(ve=="<"){Te.tokenize=ae,Te.state=vt,Te.tagName=Te.tagStart=null;var ye=Te.tokenize(ie,Te);return ye?ye+" tag error":"tag error"}else return/[\'\"]/.test(ve)?(Te.tokenize=Bt(ve),Te.stringStartCol=ie.column(),Te.tokenize(ie,Te)):(ie.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function Bt(ie){var Te=function(ve,ye){for(;!ve.eol();)if(ve.next()==ie){ye.tokenize=Le;break}return"string"};return Te.isInAttribute=!0,Te}function nt(ie,Te){return function(ve,ye){for(;!ve.eol();){if(ve.match(Te)){ye.tokenize=ae;break}ve.next()}return ie}}function et(ie){return function(Te,ve){for(var ye;(ye=Te.next())!=null;){if(ye=="<")return ve.tokenize=et(ie+1),ve.tokenize(Te,ve);if(ye==">")if(ie==1){ve.tokenize=ae;break}else return ve.tokenize=et(ie-1),ve.tokenize(Te,ve)}return"meta"}}function ht(ie,Te,ve){this.prev=ie.context,this.tagName=Te,this.indent=ie.indented,this.startOfLine=ve,(ee.doNotIndent.hasOwnProperty(Te)||ie.context&&ie.context.noIndent)&&(this.noIndent=!0)}function st(ie){ie.context&&(ie.context=ie.context.prev)}function pt(ie,Te){for(var ve;;){if(!ie.context||(ve=ie.context.tagName,!ee.contextGrabbers.hasOwnProperty(ve)||!ee.contextGrabbers[ve].hasOwnProperty(Te)))return;st(ie)}}function vt(ie,Te,ve){return ie=="openTag"?(ve.tagStart=Te.column(),St):ie=="closeTag"?Et:vt}function St(ie,Te,ve){return ie=="word"?(ve.tagName=Te.current(),De="tag",qt):ee.allowMissingTagName&&ie=="endTag"?(De="tag bracket",qt(ie,Te,ve)):(De="error",St)}function Et(ie,Te,ve){if(ie=="word"){var ye=Te.current();return ve.context&&ve.context.tagName!=ye&&ee.implicitlyClosed.hasOwnProperty(ve.context.tagName)&&st(ve),ve.context&&ve.context.tagName==ye||ee.matchClosing===!1?(De="tag",At):(De="tag error",It)}else return ee.allowMissingTagName&&ie=="endTag"?(De="tag bracket",At(ie,Te,ve)):(De="error",It)}function At(ie,Te,ve){return ie!="endTag"?(De="error",At):(st(ve),vt)}function It(ie,Te,ve){return De="error",At(ie,Te,ve)}function qt(ie,Te,ve){if(ie=="word")return De="attribute",Ut;if(ie=="endTag"||ie=="selfcloseTag"){var ye=ve.tagName,Ye=ve.tagStart;return ve.tagName=ve.tagStart=null,ie=="selfcloseTag"||ee.autoSelfClosers.hasOwnProperty(ye)?pt(ve,ye):(pt(ve,ye),ve.context=new ht(ve,ye,Ye==ve.indented)),vt}return De="error",qt}function Ut(ie,Te,ve){return ie=="equals"?Gt:(ee.allowMissing||(De="error"),qt(ie,Te,ve))}function Gt(ie,Te,ve){return ie=="string"?ge:ie=="word"&&ee.allowUnquoted?(De="string",qt):(De="error",qt(ie,Te,ve))}function ge(ie,Te,ve){return ie=="string"?ge:qt(ie,Te,ve)}return{startState:function(ie){var Te={tokenize:ae,state:vt,indented:ie||0,tagName:null,tagStart:null,context:null};return ie!=null&&(Te.baseIndent=ie),Te},token:function(ie,Te){if(!Te.tagName&&ie.sol()&&(Te.indented=ie.indentation()),ie.eatSpace())return null;jt=null;var ve=Te.tokenize(ie,Te);return(ve||jt)&&ve!="comment"&&(De=null,Te.state=Te.state(jt||ve,ie,Te),De&&(ve=De=="error"?ve+" error":De)),ve},indent:function(ie,Te,ve){var ye=ie.context;if(ie.tokenize.isInAttribute)return ie.tagStart==ie.indented?ie.stringStartCol+1:ie.indented+Dt;if(ye&&ye.noIndent)return ft.Pass;if(ie.tokenize!=Le&&ie.tokenize!=ae)return ve?ve.match(/^(\s*)/)[0].length:0;if(ie.tagName)return ee.multilineTagIndentPastTag!==!1?ie.tagStart+ie.tagName.length+2:ie.tagStart+Dt*(ee.multilineTagIndentFactor||1);if(ee.alignCDATA&&/<!\[CDATA\[/.test(Te))return 0;var Ye=Te&&/^<(\/)?([\w_:\.-]*)/.exec(Te);if(Ye&&Ye[1])for(;ye;)if(ye.tagName==Ye[2]){ye=ye.prev;break}else if(ee.implicitlyClosed.hasOwnProperty(ye.tagName))ye=ye.prev;else break;else if(Ye)for(;ye;){var Ze=ee.contextGrabbers[ye.tagName];if(Ze&&Ze.hasOwnProperty(Ye[2]))ye=ye.prev;else break}for(;ye&&ye.prev&&!ye.startOfLine;)ye=ye.prev;return ye?ye.indent+Dt:ie.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:ee.htmlMode?"html":"xml",helperType:ee.htmlMode?"html":"xml",skipAttribute:function(ie){ie.state==Gt&&(ie.state=qt)},xmlCurrentTag:function(ie){return ie.tagName?{name:ie.tagName,close:ie.type=="closeTag"}:null},xmlCurrentContext:function(ie){for(var Te=[],ve=ie.context;ve;ve=ve.prev)ve.tagName&&Te.push(ve.tagName);return Te.reverse()}}}),ft.defineMIME("text/xml","xml"),ft.defineMIME("application/xml","xml"),ft.mimeModes.hasOwnProperty("text/html")||ft.defineMIME("text/html",{name:"xml",htmlMode:!0})})},12378:function(Mn,Rn,kt){"use strict";kt.d(Rn,{$u:function(){return Jt},BD:function(){return Rt},E9:function(){return pe},FF:function(){return Bn},FJ:function(){return vt},Hn:function(){return pt},KX:function(){return Et},NB:function(){return xe},S0:function(){return Ce},UL:function(){return jt},Vk:function(){return st},Vm:function(){return ke},YI:function(){return Yn},ZA:function(){return le},Zt:function(){return De},al:function(){return Mt},bn:function(){return zt},bx:function(){return Ft},g2:function(){return Si},h1:function(){return Gt},hD:function(){return an},l4:function(){return Dt},rU:function(){return Pe},s_:function(){return Pt},uz:function(){return Xe},z6:function(){return ae}}),Mn=kt.hmd(Mn),function(){var wt;function Je(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:Je(a)}}function Ln(a){for(var y,x=[];!(y=a.next()).done;)x.push(y.value);return x}var jn=typeof Object.create=="function"?Object.create:function(a){function y(){}return y.prototype=a,new y},li;if(typeof Object.setPrototypeOf=="function")li=Object.setPrototypeOf;else{var Ci;t:{var Yi={a:!0},Be={};try{Be.__proto__=Yi,Ci=Be.a;break t}catch(a){}Ci=!1}li=Ci?function(a,y){if(a.__proto__=y,a.__proto__!==y)throw new TypeError(a+" is not extensible");return a}:null}var Se=li;function Ee(a,y){if(a.prototype=jn(y.prototype),a.prototype.constructor=a,Se)Se(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 Ue=typeof kt.g!="undefined"&&kt.g!=null?kt.g:self,xi=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},Kn=typeof Object.defineProperties=="function"?Object.defineProperty:function(a,y,x){a!=Array.prototype&&a!=Object.prototype&&(a[y]=x.value)};function Pi(a,y){if(y){var x=Ue;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&&Kn(x,a,{writable:!0,value:y})}}Pi("Object.assign",function(a){return a||xi}),Pi("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 $e=typeof globalThis=="object"&&globalThis||typeof kt.g=="object"&&kt.g.global===kt.g&&kt.g||typeof self=="object"&&self.self===self&&self||{};$e.requestAnimationFrame===void 0&&($e.setImmediate===void 0?$e.requestAnimationFrame=function(a){$e.setTimeout(a,0)}:$e.requestAnimationFrame=$e.setImmediate);function Gn(){}function Ai(a,y){var x=-1;return function(){var E=this,b=arguments;x!==-1&&$e.clearTimeout(x),x=ji(function(){x=-1,a.apply(E,b)},y)}}function ji(a,y){return $e.setTimeout(a,y)}function Tn(a){return $e.document.createElement(a)}function Qt(a){throw Error(a)}function me(a,y){a="The object is frozen, so its properties cannot be set: "+a.toString(),y!==void 0&&(a+=" to value: "+y),Qt(a)}function bn(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),Qt(x+" is not in the range "+y+": "+a)}function _n(a){$e.console&&$e.console.log(a)}function ze(a){return typeof a=="object"&&a!==null}function hn(a){return Array.isArray(a)||$e.NodeList&&a instanceof $e.NodeList||$e.HTMLCollection&&a instanceof $e.HTMLCollection}function Nn(a){return Array.prototype.slice.call(a)}function In(a,y,x){Array.isArray(a)?y>=a.length?a.push(x):a.splice(y,0,x):Qt("Cannot insert an object into an HTMLCollection or NodeList: "+x+" at "+y)}function vi(a,y){Array.isArray(a)?y>=a.length?a.pop():a.splice(y,1):Qt("Cannot remove an object from an HTMLCollection or NodeList at "+y)}function Jn(){var a=Xr.pop();return a===void 0?[]:a}function ii(a){a.length=0,Xr.push(a)}function hi(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(ze(a)&&a.constructor)return hi(a.constructor);return typeof a}function Ii(a){var y=a;return ze(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 Di(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 mn(a,y,x){Object.defineProperty(Br.prototype,a,{get:y,set:x})}function oi(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 fr=$e.navigator!==void 0&&0<$e.navigator.userAgent.indexOf("Trident/7"),Mr=$e.navigator!==void 0&&$e.navigator.platform!==void 0&&$e.navigator.platform.match(/(iPhone|iPod|iPad|Mac)/i)!==null,Xr=[];Object.freeze([]),Gn.className="Util",Gn.Dx="32ab5ff3b26f42dc0ed90f21472913b5",Gn.adym="gojs.net",Gn.vfo="28e645fdb266",Gn.className="Util";function Ae(a,y,x){Gi(this),this.j=a,this.xa=y,this.o=x}Ae.prototype.toString=function(){return"EnumValue."+this.xa};function ri(a,y){return y==null||y===""?null:a[y]}Ue.Object.defineProperties(Ae.prototype,{classType:{get:function(){return this.j}},name:{get:function(){return this.xa}},value:{get:function(){return this.o}}}),Ae.className="EnumValue";function Ri(){this.ew=[]}Ri.prototype.toString=function(){return this.ew.join("")},Ri.prototype.add=function(a){a!==""&&this.ew.push(a)},Ri.className="StringBuilder";function fi(){}fi.className="PropertyCollection";var br={EA:!1,JA:!1,GA:!1,IA:!1,NA:!1,LA:!1,nx:!1,FA:null,trace:function(a){$e.console&&$e.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 ur(){}ur.prototype.reset=function(){},ur.prototype.next=function(){return!1},ur.prototype.Ad=function(){return!1},ur.prototype.first=function(){return null},ur.prototype.any=function(){return!1},ur.prototype.all=function(){return!0},ur.prototype.each=function(){return this},ur.prototype.map=function(){return this},ur.prototype.filter=function(){return this},ur.prototype.de=function(){},ur.prototype.toString=function(){return"EmptyIterator"},Ue.Object.defineProperties(ur.prototype,{iterator:{get:function(){return this}},count:{get:function(){return 0}}}),ur.prototype.first=ur.prototype.first,ur.prototype.hasNext=ur.prototype.Ad,ur.prototype.next=ur.prototype.next,ur.prototype.reset=ur.prototype.reset;var Lr=null;ur.className="EmptyIterator",Lr=new ur;function Dr(a){this.key=-1,this.value=a}Dr.prototype.reset=function(){this.key=-1},Dr.prototype.next=function(){return this.key===-1?(this.key=0,!0):!1},Dr.prototype.Ad=function(){return this.next()},Dr.prototype.first=function(){return this.key=0,this.value},Dr.prototype.any=function(a){return this.key=-1,a(this.value)},Dr.prototype.all=function(a){return this.key=-1,a(this.value)},Dr.prototype.each=function(a){return this.key=-1,a(this.value),this},Dr.prototype.map=function(a){return new Dr(a(this.value))},Dr.prototype.filter=function(a){return a(this.value)?new Dr(this.value):Lr},Dr.prototype.de=function(){this.value=null},Dr.prototype.toString=function(){return"SingletonIterator("+this.value+")"},Ue.Object.defineProperties(Dr.prototype,{iterator:{get:function(){return this}},count:{get:function(){return 1}}}),Dr.prototype.first=Dr.prototype.first,Dr.prototype.hasNext=Dr.prototype.Ad,Dr.prototype.next=Dr.prototype.next,Dr.prototype.reset=Dr.prototype.reset,Dr.className="SingletonIterator";function Zr(a){this.Bb=a,this.qf=null,a.Sa=null,this.qa=a.Ja,this.Za=-1}Zr.prototype.reset=function(){var a=this.Bb;a.Sa=null,this.qa=a.Ja,this.Za=-1},Zr.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},Zr.prototype.Ad=function(){return this.next()},Zr.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},Zr.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},Zr.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},Zr.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},Zr.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 un,a.s=x,a.xb(),a.iterator},Zr.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 un,a.s=x,a.xb(),a.iterator},Zr.prototype.de=function(){this.key=-1,this.value=null,this.qa=-1,this.qf=null,this.Bb.Sa=this},Zr.prototype.toString=function(){return"ListIterator@"+this.Za+"/"+this.Bb.count},Ue.Object.defineProperties(Zr.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}}}),Zr.prototype.first=Zr.prototype.first,Zr.prototype.hasNext=Zr.prototype.Ad,Zr.prototype.next=Zr.prototype.next,Zr.prototype.reset=Zr.prototype.reset,Zr.className="ListIterator";function Jr(a){this.Bb=a,a.Hg=null,this.qa=a.Ja,this.Za=a.s.length}Jr.prototype.reset=function(){var a=this.Bb;a.Hg=null,this.qa=a.Ja,this.Za=a.s.length},Jr.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)},Jr.prototype.Ad=function(){return this.next()},Jr.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},Jr.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},Jr.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},Jr.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},Jr.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 un,a.s=x,a.xb(),a.iterator},Jr.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 un,a.s=x,a.xb(),a.iterator},Jr.prototype.de=function(){this.key=-1,this.value=null,this.qa=-1,this.Bb.Hg=this},Jr.prototype.toString=function(){return"ListIteratorBackwards("+this.Za+"/"+this.Bb.count+")"},Ue.Object.defineProperties(Jr.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.Bb.s.length}}}),Jr.prototype.first=Jr.prototype.first,Jr.prototype.hasNext=Jr.prototype.Ad,Jr.prototype.next=Jr.prototype.next,Jr.prototype.reset=Jr.prototype.reset,Jr.className="ListIteratorBackwards";function un(a){Gi(this),this._isFrozen=!1,this.s=[],this.Ja=0,this.Hg=this.Sa=null,typeof a=="string"&&Qt("Error: Since 2.0 List/Map/Set constructors no longer take an argument that enforces type."),a!==void 0&&this.addAll(a)}wt=un.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()#"+Oi(this)},wt.add=function(a){return a===null?this:(this._isFrozen&&me(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&&me(this);var y=this.s;if(hn(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&&me(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)&&bn(a,"0 <= i < length",un,"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)&&bn(a,"0 <= i < length",un,"setElt:i"),this._isFrozen&&me(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&&me(this);var a=this.s;return 0<a.length?a.pop():null},un.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},un.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},un.prototype.each=function(a){for(var y=this.s,x=y.length,E=0;E<x;E++)a(y[E]);return this},un.prototype.map=function(a){for(var y=new un,x=[],E=this.s,b=E.length,z=0;z<b;z++)x.push(a(E[z]));return y.s=x,y.xb(),y},un.prototype.filter=function(a){for(var y=new un,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=un.prototype,wt.Gb=function(a,y){0>a&&bn(a,">= 0",un,"insertAt:i"),this._isFrozen&&me(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&&me(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)&&bn(a,"0 <= i < length",un,"removeAt:i"),this._isFrozen&&me(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&&me(this);for(var b=a,z=y+1;z<E;)x[b++]=x[z++];return x.length=E-(y-a+1),this.xb(),this},un.prototype.copy=function(){var a=new un,y=this.s;return 0<y.length&&(a.s=Array.prototype.slice.call(y)),a},wt=un.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 vn,y=this.s,x=this.count,E=0;E<x;E++)a.add(y[E]);return a},wt.sort=function(a){return this._isFrozen&&me(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&&me(this);var z=x-y;if(1>=z)return this;if((0>y||y>=b-1)&&bn(y,"0 <= from < length",un,"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&&me(this),this.s.reverse(),this.xb(),this},Ue.Object.defineProperties(un.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 Lr;var a=this.Sa;return a!==null?(a.reset(),a):new Zr(this)}},iteratorBackwards:{get:function(){if(0>=this.s.length)return Lr;var a=this.Hg;return a!==null?(a.reset(),a):new Jr(this)}}}),un.prototype.reverse=un.prototype.reverse,un.prototype.sortRange=un.prototype.zi,un.prototype.sort=un.prototype.sort,un.prototype.toSet=un.prototype.Iv,un.prototype.toArray=un.prototype.Fa,un.prototype.removeRange=un.prototype.removeRange,un.prototype.removeAt=un.prototype.mb,un.prototype.delete=un.prototype.delete,un.prototype.remove=un.prototype.remove,un.prototype.insertAt=un.prototype.Gb,un.prototype.pop=un.prototype.pop,un.prototype.last=un.prototype.jc,un.prototype.first=un.prototype.first,un.prototype.set=un.prototype.set,un.prototype.setElt=un.prototype.cd,un.prototype.get=un.prototype.get,un.prototype.elt=un.prototype.M,un.prototype.indexOf=un.prototype.indexOf,un.prototype.has=un.prototype.has,un.prototype.contains=un.prototype.contains,un.prototype.clear=un.prototype.clear,un.prototype.addAll=un.prototype.addAll,un.prototype.push=un.prototype.push,un.prototype.add=un.prototype.add,un.prototype.thaw=un.prototype.ka,un.prototype.freeze=un.prototype.freeze,un.className="List";function yo(a){this.eg=a,a.Sa=null,this.qa=a.Ja,this.sa=null}yo.prototype.reset=function(){var a=this.eg;a.Sa=null,this.qa=a.Ja,this.sa=null},yo.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)},yo.prototype.Ad=function(){return this.next()},yo.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},yo.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},yo.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},yo.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},yo.prototype.map=function(a){var y=this.eg;y.Sa=null;var x=new un;for(y=y.ea;y!==null;)x.add(a(y.value)),y=y.va;return x.iterator},yo.prototype.filter=function(a){var y=this.eg;y.Sa=null;var x=new un;for(y=y.ea;y!==null;){var E=y.value;a(E)&&x.add(E),y=y.va}return x.iterator},yo.prototype.de=function(){this.value=this.key=null,this.qa=-1,this.eg.Sa=this},yo.prototype.toString=function(){return this.sa!==null?"SetIterator@"+this.sa.value:"SetIterator"},Ue.Object.defineProperties(yo.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.eg.Sb}}}),yo.prototype.first=yo.prototype.first,yo.prototype.hasNext=yo.prototype.Ad,yo.prototype.next=yo.prototype.next,yo.prototype.reset=yo.prototype.reset,yo.className="SetIterator";function vn(a){Gi(this),this._isFrozen=!1,this.Tb={},this.Sb=0,this.Sa=null,this.Ja=0,this.kf=this.ea=null,typeof a=="string"&&Qt("Error: Since 2.0 List/Map/Set constructors no longer take an argument that enforces type."),a!==void 0&&this.addAll(a)}wt=vn.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()#"+Oi(this)},wt.add=function(a){if(a===null)return this;this._isFrozen&&me(this,a);var y=a;return ze(a)&&(y=Wr(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&&me(this),hn(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 ze(a)&&(y=Oi(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},vn.prototype.any=function(a){for(var y=this.ea;y!==null;){if(a(y.value))return!0;y=y.va}return!1},vn.prototype.all=function(a){for(var y=this.ea;y!==null;){if(!a(y.value))return!1;y=y.va}return!0},vn.prototype.each=function(a){for(var y=this.ea;y!==null;)a(y.value),y=y.va;return this},vn.prototype.map=function(a){for(var y=new vn,x=this.ea;x!==null;)y.add(a(x.value)),x=x.va;return y},vn.prototype.filter=function(a){for(var y=new vn,x=this.ea;x!==null;){var E=x.value;a(E)&&y.add(E),x=x.va}return y},wt=vn.prototype,wt.remove=function(a){if(a===null)return!1;this._isFrozen&&me(this,a);var y=a;if(ze(a)&&(y=Oi(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&&me(this),hn(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&&me(this);var y=new vn;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&&me(this),this.Tb={},this.Sb=0,this.Sa!==null&&this.Sa.reset(),this.kf=this.ea=null,this.xb()},vn.prototype.copy=function(){var a=new vn,y=this.Tb,x;for(x in y)a.add(y[x].value);return a},vn.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},vn.prototype.Hv=function(){var a=new un,y=this.Tb,x;for(x in y)a.add(y[x].value);return a};function Gi(a){a.__gohashid=ko++}function Wr(a){var y=a.__gohashid;return y===void 0&&(y=ko++,a.__gohashid=y),y}function Oi(a){return a.__gohashid}Ue.Object.defineProperties(vn.prototype,{count:{get:function(){return this.Sb}},size:{get:function(){return this.Sb}},iterator:{get:function(){if(0>=this.Sb)return Lr;var a=this.Sa;return a!==null?(a.reset(),a):new yo(this)}}}),vn.prototype.toList=vn.prototype.Hv,vn.prototype.toArray=vn.prototype.Fa,vn.prototype.clear=vn.prototype.clear,vn.prototype.retainAll=vn.prototype.pA,vn.prototype.removeAll=vn.prototype.hp,vn.prototype.delete=vn.prototype.delete,vn.prototype.remove=vn.prototype.remove,vn.prototype.first=vn.prototype.first,vn.prototype.containsAny=vn.prototype.Ty,vn.prototype.containsAll=vn.prototype.Sy,vn.prototype.has=vn.prototype.has,vn.prototype.contains=vn.prototype.contains,vn.prototype.addAll=vn.prototype.addAll,vn.prototype.add=vn.prototype.add,vn.prototype.thaw=vn.prototype.ka,vn.prototype.freeze=vn.prototype.freeze;var ko=1;vn.className="Set",vn.uniqueHash=Gi,vn.hashIdUnique=Wr,vn.hashId=Oi;function Ur(a){this.ma=a,this.qa=a.Ja,this.sa=null}Ur.prototype.reset=function(){this.qa=this.ma.Ja,this.sa=null},Ur.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)},Ur.prototype.Ad=function(){return this.next()},Ur.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},Ur.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},Ur.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},Ur.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},Ur.prototype.map=function(a){var y=this.ma;this.sa=null;var x=new un;for(y=y.ea;y!==null;)x.add(a(y.key)),y=y.va;return x.iterator},Ur.prototype.filter=function(a){var y=this.ma;this.sa=null;var x=new un;for(y=y.ea;y!==null;){var E=y.key;a(E)&&x.add(E),y=y.va}return x.iterator},Ur.prototype.de=function(){this.value=this.key=null,this.qa=-1},Ur.prototype.toString=function(){return this.sa!==null?"MapKeySetIterator@"+this.sa.value:"MapKeySetIterator"},Ue.Object.defineProperties(Ur.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.ma.Sb}}}),Ur.prototype.first=Ur.prototype.first,Ur.prototype.hasNext=Ur.prototype.Ad,Ur.prototype.next=Ur.prototype.next,Ur.prototype.reset=Ur.prototype.reset,Ur.className="MapKeySetIterator";function Cr(a){vn.call(this),Gi(this),this._isFrozen=!0,this.ma=a}Ee(Cr,vn),wt=Cr.prototype,wt.freeze=function(){return this},wt.ka=function(){return this},wt.toString=function(){return"MapKeySet("+this.ma.toString()+")"},wt.add=function(){Qt("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(){Qt("This Set is read-only: "+this.toString())},wt.delete=function(a){return this.remove(a)},wt.clear=function(){Qt("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 vn,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 vn,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 vn,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 un,y=this.ma.Tb,x;for(x in y)a.add(y[x].key);return a},Ue.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?Lr:new Ur(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 Lo(a){this.ma=a,a.jf=null,this.qa=a.Ja,this.sa=null}Lo.prototype.reset=function(){var a=this.ma;a.jf=null,this.qa=a.Ja,this.sa=null},Lo.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)},Lo.prototype.Ad=function(){return this.next()},Lo.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},Lo.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},Lo.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},Lo.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},Lo.prototype.map=function(a){var y=this.ma;this.sa=y.jf=null;var x=new un;for(y=y.ea;y!==null;)x.add(a(y.value)),y=y.va;return x.iterator},Lo.prototype.filter=function(a){var y=this.ma;this.sa=y.jf=null;var x=new un;for(y=y.ea;y!==null;){var E=y.value;a(E)&&x.add(E),y=y.va}return x.iterator},Lo.prototype.de=function(){this.value=this.key=null,this.qa=-1,this.ma.jf=this},Lo.prototype.toString=function(){return this.sa!==null?"MapValueSetIterator@"+this.sa.value:"MapValueSetIterator"},Ue.Object.defineProperties(Lo.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.ma.Sb}}}),Lo.prototype.first=Lo.prototype.first,Lo.prototype.hasNext=Lo.prototype.Ad,Lo.prototype.next=Lo.prototype.next,Lo.prototype.reset=Lo.prototype.reset,Lo.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 xn(a){this.ma=a,a.Sa=null,this.qa=a.Ja,this.sa=null}xn.prototype.reset=function(){var a=this.ma;a.Sa=null,this.qa=a.Ja,this.sa=null},xn.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)},xn.prototype.Ad=function(){return this.next()},xn.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},xn.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},xn.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},xn.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},xn.prototype.map=function(a){var y=this.ma;this.sa=y.Sa=null;var x=new un;for(y=y.ea;y!==null;)x.add(a(y)),y=y.va;return x.iterator},xn.prototype.filter=function(a){var y=this.ma;this.sa=y.Sa=null;var x=new un;for(y=y.ea;y!==null;)a(y)&&x.add(y),y=y.va;return x.iterator},xn.prototype.de=function(){this.value=this.key=null,this.qa=-1,this.ma.Sa=this},xn.prototype.toString=function(){return this.sa!==null?"MapIterator@"+this.sa:"MapIterator"},Ue.Object.defineProperties(xn.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.ma.Sb}}}),xn.prototype.first=xn.prototype.first,xn.prototype.hasNext=xn.prototype.Ad,xn.prototype.next=xn.prototype.next,xn.prototype.reset=xn.prototype.reset,xn.className="MapIterator";function be(a){Gi(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"&&Qt("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()#"+Oi(this)},wt.add=function(a,y){this._isFrozen&&me(this,a);var x=a;ze(a)&&(x=Wr(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(hn(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 ze(a)&&(y=Oi(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 ze(a)&&(y=Oi(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&&me(this,a);var y=a;if(ze(a)&&(y=Oi(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&&me(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)},Ue.Object.defineProperties(be.prototype,{count:{get:function(){return this.Sb}},size:{get:function(){return this.Sb}},iterator:{get:function(){if(0>=this.count)return Lr;var a=this.Sa;return a!==null?(a.reset(),a):new xn(this)}},iteratorKeys:{get:function(){return 0>=this.count?Lr:new Ur(this)}},iteratorValues:{get:function(){if(0>=this.count)return Lr;var a=this.jf;return a!==null?(a.reset(),a):new Lo(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 Tt(a,y){a===void 0?this.y=this.x=0:typeof a=="number"&&typeof y=="number"?(this.x=a,this.y=y):Qt("Invalid arguments to Point constructor: "+a+", "+y),this._isFrozen=!1}var Dn,ei,Ni,Li,di;Tt.prototype.assign=function(a){return this.x=a.x,this.y=a.y,this},Tt.prototype.h=function(a,y){return this.x=a,this.y=y,this},Tt.prototype.sg=function(a,y){return this.x=a,this.y=y,this},Tt.prototype.set=function(a){return this.x=a.x,this.y=a.y,this},Tt.prototype.copy=function(){var a=new Tt;return a.x=this.x,a.y=this.y,a},wt=Tt.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)&&Qt("cannot thaw constant: "+this),this._isFrozen=!1,this};function yn(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 Tt(x,b)}return new Tt}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 Tt?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},Tt.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=Tt.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 $n(a.x-this.x,a.y-this.y)},wt.direction=function(a,y){return $n(a-this.x,y-this.y)};function $n(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 An(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 Zn(a,y,x,E){return a=x-a,y=E-y,a*a+y*y}function ai(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)},Tt.alloc=function(){var a=pi.pop();return a===void 0?new Tt:a},Tt.allocAt=function(a,y){var x=pi.pop();return x===void 0?new Tt(a,y):(x.x=a,x.y=y,x)},Tt.free=function(a){pi.push(a)},Tt.prototype.isReal=Tt.prototype.w,Tt.prototype.setSpot=Tt.prototype.yi,Tt.prototype.setRectSpot=Tt.prototype.xi,Tt.prototype.snapToGridPoint=Tt.prototype.vA,Tt.prototype.snapToGrid=Tt.prototype.uA,Tt.prototype.projectOntoLineSegmentPoint=Tt.prototype.gA,Tt.prototype.projectOntoLineSegment=Tt.prototype.fA,Tt.intersectingLineSegments=function(a,y,x,E,b,z,tt,rt){return _t.Rl(a,y,x,E,b,z,tt,rt)},Tt.prototype.compareWithLineSegmentPoint=Tt.prototype.Ry,Tt.compareWithLineSegment=function(a,y,x,E,b,z){return _t.Fl(a,y,x,E,b,z)},Tt.prototype.direction=Tt.prototype.direction,Tt.prototype.directionPoint=Tt.prototype.ab,Tt.prototype.normalize=Tt.prototype.normalize,Tt.prototype.distanceSquared=Tt.prototype.zd,Tt.prototype.distanceSquaredPoint=Tt.prototype.Bf,Tt.prototype.scale=Tt.prototype.scale,Tt.prototype.rotate=Tt.prototype.rotate,Tt.prototype.offset=Tt.prototype.offset,Tt.prototype.subtract=Tt.prototype.re,Tt.prototype.add=Tt.prototype.add,Tt.prototype.equalsApprox=Tt.prototype.Xa,Tt.prototype.equalTo=Tt.prototype.hi,Tt.prototype.equals=Tt.prototype.D,Tt.prototype.set=Tt.prototype.set,Tt.prototype.setTo=Tt.prototype.sg;var pi=[];Tt.className="Point",Tt.parse=yn,Tt.stringify=Un,Tt.distanceLineSegmentSquared=Xn,Tt.distanceSquared=Zn,Tt.direction=ai,Tt.Origin=Dn=new Tt(0,0).ja(),Tt.InfiniteTopLeft=ei=new Tt(-1/0,-1/0).ja(),Tt.InfiniteBottomRight=Ni=new Tt(1/0,1/0).ja(),Tt.SixPoint=Li=new Tt(6,6).ja(),Tt.NoPoint=di=new Tt(NaN,NaN).ja(),Tt.parse=yn,Tt.stringify=Un,Tt.distanceLineSegmentSquared=Xn,Tt.distanceSquared=Zn,Tt.direction=ai;function en(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):Qt("Invalid arguments to Size constructor: "+a+", "+y),this._isFrozen=!1}var Qi,tr,Vr,or,so,qr,po;en.prototype.assign=function(a){return this.width=a.width,this.height=a.height,this},en.prototype.h=function(a,y){return this.width=a,this.height=y,this},en.prototype.sg=function(a,y){return this.width=a,this.height=y,this},en.prototype.set=function(a){return this.width=a.width,this.height=a.height,this},en.prototype.copy=function(){var a=new en;return a.width=this.width,a.height=this.height,a},wt=en.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)&&Qt("cannot thaw constant: "+this),this._isFrozen=!1,this};function ro(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 en(x,b)}return new en}function Po(a){return a.width.toString()+" "+a.height.toString()}wt.toString=function(){return"Size("+this.width+","+this.height+")"},wt.D=function(a){return a instanceof en?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)},en.alloc=function(){var a=Bo.pop();return a===void 0?new en:a},en.free=function(a){Bo.push(a)},en.prototype.isReal=en.prototype.w,en.prototype.inflate=en.prototype.Bc,en.prototype.equalsApprox=en.prototype.Xa,en.prototype.equalTo=en.prototype.hi,en.prototype.equals=en.prototype.D,en.prototype.set=en.prototype.set,en.prototype.setTo=en.prototype.sg;var Bo=[];en.className="Size",en.parse=ro,en.stringify=Po,en.ZeroSize=Qi=new en(0,0).ja(),en.OneSize=tr=new en(1,1).ja(),en.SixSize=Vr=new en(6,6).ja(),en.EightSize=or=new en(8,8).ja(),en.TenSize=so=new en(10,10).ja(),en.InfiniteSize=qr=new en(1/0,1/0).ja(),en.NoSize=po=new en(NaN,NaN).ja(),en.parse=ro,en.stringify=Po;function Oe(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 Tt?(x=a.x,a=a.y,y instanceof Tt?(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 en?(this.x=x,this.y=a,this.width=y.width,this.height=y.height):Qt("Incorrect second argument supplied to Rect constructor "+y)):Qt("Invalid arguments to Rect constructor: "+a+", "+y+", "+x+", "+E),this._isFrozen=!1}wt=Oe.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 lo(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},Oe.prototype.copy=function(){var a=new Oe;return a.x=this.x,a.y=this.y,a.width=this.width,a.height=this.height,a},wt=Oe.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)&&Qt("cannot thaw constant: "+this),this._isFrozen=!1,this};function Gr(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 Oe(x,b,z,tt)}return new Oe}function Sr(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 Oe?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 oo(this,y,a,y,a)},wt.Co=function(a){return oo(this,a.top,a.right,a.bottom,a.left)},wt.Fv=function(a){return oo(this,-a.top,-a.right,-a.bottom,-a.left)},wt.Hz=function(a,y,x,E){return oo(this,a,y,x,E)};function oo(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 wo(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 zr(this,a.x,a.y,0,0)},wt.ed=function(a){return zr(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),zr(this,a,y,x,E)};function zr(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 Or(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 ha(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},Oe.alloc=function(){var a=Ba.pop();return a===void 0?new Oe:a},Oe.allocAt=function(a,y,x,E){var b=Ba.pop();return b===void 0?new Oe(a,y,x,E):b.h(a,y,x,E)},Oe.free=function(a){Ba.push(a)},Ue.Object.defineProperties(Oe.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 Tt(this.x,this.y)},set:function(a){this.x=a.x,this.y=a.y}},size:{get:function(){return new en(this.width,this.height)},set:function(a){this.width=a.width,this.height=a.height}},center:{get:function(){return new Tt(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}}}),Oe.prototype.isEmpty=Oe.prototype.Mz,Oe.prototype.isReal=Oe.prototype.w,Oe.intersectsLineSegment=function(a,y,x,E,b,z,tt,rt){return _t.Fx(a,y,x,E,b,z,tt,rt)},Oe.prototype.setSpot=Oe.prototype.yi,Oe.prototype.union=Oe.prototype.Kv,Oe.prototype.unionRect=Oe.prototype.ed,Oe.prototype.unionPoint=Oe.prototype.Ye,Oe.prototype.intersects=Oe.prototype.Vu,Oe.prototype.intersectsRect=Oe.prototype.Yc,Oe.prototype.intersect=Oe.prototype.Uu,Oe.prototype.intersectRect=Oe.prototype.Ex,Oe.prototype.grow=Oe.prototype.Hz,Oe.prototype.subtractMargin=Oe.prototype.Fv,Oe.prototype.addMargin=Oe.prototype.Co,Oe.prototype.inflate=Oe.prototype.Bc,Oe.prototype.offset=Oe.prototype.offset,Oe.prototype.contains=Oe.prototype.contains,Oe.prototype.containsRect=Oe.prototype.Re,Oe.prototype.containsPoint=Oe.prototype.ca,Oe.prototype.equalsApprox=Oe.prototype.Xa,Oe.prototype.equalTo=Oe.prototype.hi,Oe.prototype.equals=Oe.prototype.D,Oe.prototype.setSize=Oe.prototype.tA,Oe.prototype.setPoint=Oe.prototype.dd,Oe.prototype.set=Oe.prototype.set,Oe.prototype.setTo=Oe.prototype.sg;var Ia=null,bs=null,Ba=[];Oe.className="Rect",Oe.parse=Gr,Oe.stringify=Sr,Oe.contains=Or,Oe.intersects=ha,Oe.ZeroRect=Ia=new Oe(0,0,0,0).ja(),Oe.NoRect=bs=new Oe(NaN,NaN,NaN,NaN).ja(),Oe.parse=Gr,Oe.stringify=Sr,Oe.contains=Or,Oe.intersects=ha;function dr(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):Qt("Invalid arguments to Margin constructor: "+a+", "+y+", "+x+", "+E),this._isFrozen=!1}dr.prototype.assign=function(a){return this.top=a.top,this.right=a.right,this.bottom=a.bottom,this.left=a.left,this},dr.prototype.sg=function(a,y,x,E){return this.top=a,this.right=y,this.bottom=x,this.left=E,this},dr.prototype.set=function(a){return this.top=a.top,this.right=a.right,this.bottom=a.bottom,this.left=a.left,this},dr.prototype.copy=function(){var a=new dr;return a.top=this.top,a.right=this.right,a.bottom=this.bottom,a.left=this.left,a},wt=dr.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)&&Qt("cannot thaw constant: "+this),this._isFrozen=!1,this};function $o(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 dr;for(var b=NaN;a[y]==="";)y++;if((E=a[y++])&&(b=parseFloat(E)),isNaN(b))return new dr(x);for(var z=NaN;a[y]==="";)y++;if((E=a[y++])&&(z=parseFloat(E)),isNaN(z))return new dr(x,b);for(var tt=NaN;a[y]==="";)y++;return(E=a[y++])&&(tt=parseFloat(E)),isNaN(tt)?new dr(x,b):new dr(x,b,z,tt)}return new dr}function qo(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 dr?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)},dr.alloc=function(){var a=fa.pop();return a===void 0?new dr:a},dr.free=function(a){fa.push(a)},dr.prototype.isReal=dr.prototype.w,dr.prototype.equalsApprox=dr.prototype.Xa,dr.prototype.equalTo=dr.prototype.hi,dr.prototype.equals=dr.prototype.D,dr.prototype.set=dr.prototype.set,dr.prototype.setTo=dr.prototype.sg;var ca=null,ia=null,fa=[];dr.className="Margin",dr.parse=$o,dr.stringify=qo,dr.ZeroMargin=ca=new dr(0,0,0,0).ja(),dr.TwoMargin=ia=new dr(2,2,2,2).ja(),dr.parse=$o,dr.stringify=qo;function yi(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,$r,co,zo,cr,Ya,da,Yo,io,Sa,ns,Jo,ps,ms,Rs,La,Iu,Cu,js,Nl,zs,Vl,lu,Eu,xa,rl,_u,Kl,uu,Xa,Ja,Aa,Ga,Bl,ga;yi.prototype.assign=function(a){return this.x=a.x,this.y=a.y,this.offsetX=a.offsetX,this.offsetY=a.offsetY,this},yi.prototype.sg=function(a,y,x,E){return this.x=a,this.y=y,this.offsetX=x,this.offsetY=E,this},yi.prototype.set=function(a){return this.x=a.x,this.y=a.y,this.offsetX=a.offsetX,this.offsetY=a.offsetY,this},yi.prototype.copy=function(){var a=new yi;return a.x=this.x,a.y=this.y,a.offsetX=this.offsetX,a.offsetY=this.offsetY,a},wt=yi.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)&&Qt("cannot thaw constant: "+this),this._isFrozen=!1,this};function _o(a,y){return a.x=NaN,a.y=NaN,a.offsetX=y,a}function Co(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 $r;if(a==="TopRight")return co;if(a==="Left"||a==="LeftCenter"||a==="MiddleLeft")return zo;if(a==="Center")return cr;if(a==="Right"||a==="RightCenter"||a==="MiddleRight")return Ya;if(a==="BottomLeft")return da;if(a==="Bottom"||a==="BottomCenter"||a==="MiddleBottom")return Yo;if(a==="BottomRight")return io;if(a==="TopSide")return Sa;if(a==="LeftSide")return ns;if(a==="RightSide")return Jo;if(a==="BottomSide")return ps;if(a==="TopBottomSides")return ms;if(a==="LeftRightSides")return Rs;if(a==="TopLeftSides")return La;if(a==="TopRightSides")return Iu;if(a==="BottomLeftSides")return Cu;if(a==="BottomRightSides")return js;if(a==="NotTopSide")return Nl;if(a==="NotLeftSide")return zs;if(a==="NotRightSide")return Vl;if(a==="NotBottomSide")return lu;if(a==="AllSides")return Eu;if(a==="Default")return xa;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 yi(x,b,z,tt)}return new yi}function Ao(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($r)?"Top":this.D(co)?"TopRight":this.D(zo)?"Left":this.D(cr)?"Center":this.D(Ya)?"Right":this.D(da)?"BottomLeft":this.D(Yo)?"Bottom":this.D(io)?"BottomRight":this.D(Sa)?"TopSide":this.D(ns)?"LeftSide":this.D(Jo)?"RightSide":this.D(ps)?"BottomSide":this.D(ms)?"TopBottomSides":this.D(Rs)?"LeftRightSides":this.D(La)?"TopLeftSides":this.D(Iu)?"TopRightSides":this.D(Cu)?"BottomLeftSides":this.D(js)?"BottomRightSides":this.D(Nl)?"NotTopSide":this.D(zs)?"NotLeftSide":this.D(Vl)?"NotRightSide":this.D(lu)?"NotBottomSide":this.D(Eu)?"AllSides":this.D(xa)?"Default":"None"},wt.D=function(a){return a instanceof yi?(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 yi(.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(rl))a=ns;else if(a.D(_u))a=Jo;else if(a.D(Kl))a=Sa;else if(a.D(uu))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},yi.alloc=function(){var a=Ta.pop();return a===void 0?new yi:a},yi.free=function(a){Ta.push(a)},yi.prototype.isDefault=yi.prototype.Xb,yi.prototype.isNone=yi.prototype.ys,yi.prototype.isSide=yi.prototype.$c,yi.prototype.isNoSpot=yi.prototype.Mc,yi.prototype.isSpot=yi.prototype.sb,yi.prototype.includesSide=yi.prototype.Hf,yi.prototype.opposite=yi.prototype.gv,yi.prototype.equals=yi.prototype.D,yi.prototype.set=yi.prototype.set,yi.prototype.setTo=yi.prototype.sg;var Ta=[];yi.className="Spot",yi.parse=Co,yi.stringify=Ao,yi.None=ar=_o(new yi(0,0,0,0),0).ja(),yi.Default=xa=_o(new yi(0,0,-1,0),-1).ja(),yi.TopLeft=_r=new yi(0,0,0,0).ja(),yi.TopCenter=$r=new yi(.5,0,0,0).ja(),yi.TopRight=co=new yi(1,0,0,0).ja(),yi.LeftCenter=zo=new yi(0,.5,0,0).ja(),yi.Center=cr=new yi(.5,.5,0,0).ja(),yi.RightCenter=Ya=new yi(1,.5,0,0).ja(),yi.BottomLeft=da=new yi(0,1,0,0).ja(),yi.BottomCenter=Yo=new yi(.5,1,0,0).ja(),yi.BottomRight=io=new yi(1,1,0,0).ja(),yi.MiddleTop=Xa=$r,yi.MiddleLeft=Ja=zo,yi.MiddleRight=Aa=Ya,yi.MiddleBottom=Ga=Yo,yi.Top=Kl=$r,yi.Left=rl=zo,yi.Right=_u=Ya,yi.Bottom=uu=Yo,yi.TopSide=Sa=_o(new yi(0,0,1,1),1).ja(),yi.LeftSide=ns=_o(new yi(0,0,1,2),1).ja(),yi.RightSide=Jo=_o(new yi(0,0,1,4),1).ja(),yi.BottomSide=ps=_o(new yi(0,0,1,8),1).ja(),yi.TopBottomSides=ms=_o(new yi(0,0,1,9),1).ja(),yi.LeftRightSides=Rs=_o(new yi(0,0,1,6),1).ja(),yi.TopLeftSides=La=_o(new yi(0,0,1,3),1).ja(),yi.TopRightSides=Iu=_o(new yi(0,0,1,5),1).ja(),yi.BottomLeftSides=Cu=_o(new yi(0,0,1,10),1).ja(),yi.BottomRightSides=js=_o(new yi(0,0,1,12),1).ja(),yi.NotTopSide=Nl=_o(new yi(0,0,1,14),1).ja(),yi.NotLeftSide=zs=_o(new yi(0,0,1,13),1).ja(),yi.NotRightSide=Vl=_o(new yi(0,0,1,11),1).ja(),yi.NotBottomSide=lu=_o(new yi(0,0,1,7),1).ja(),yi.AllSides=Eu=_o(new yi(0,0,1,15),1).ja(),Bl=new yi(.156,.156).ja(),ga=new yi(.844,.844).ja(),yi.parse=Co,yi.stringify=Ao;function oe(){this.m11=1,this.m21=this.m12=0,this.m22=1,this.dy=this.dx=0}oe.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},oe.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},oe.prototype.copy=function(){var a=new oe;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},oe.prototype.toString=function(){return"Transform("+this.m11+","+this.m12+","+this.m21+","+this.m22+","+this.dx+","+this.dy+")"},oe.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},oe.prototype.ws=function(){return this.dx===0&&this.dy===0&&this.m11===1&&this.m12===0&&this.m21===0&&this.m22===1},oe.prototype.reset=function(){return this.m11=1,this.m21=this.m12=0,this.m22=1,this.dy=this.dx=0,this},oe.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},oe.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},oe.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},oe.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=oe.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,gt=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(gt,xt),gt=Math.max(gt,xt),xt=Math.min(yt,Ct),yt=Math.max(yt,Ct),b=Math.min(b,x),gt=Math.max(gt,x),xt=Math.min(xt,y),yt=Math.max(yt,y),b=Math.min(b,z),gt=Math.max(gt,z),xt=Math.min(xt,E),yt=Math.max(yt,E),a.h(b,xt,gt-b,yt-xt),a},oe.alloc=function(){var a=Re.pop();return a===void 0?new oe:a},oe.free=function(a){Re.push(a)},oe.prototype.transformRect=oe.prototype.pp,oe.prototype.transformPoint=oe.prototype.Ga,oe.prototype.scale=oe.prototype.scale,oe.prototype.translate=oe.prototype.translate,oe.prototype.rotate=oe.prototype.rotate,oe.prototype.invert=oe.prototype.Vj,oe.prototype.multiplyInverted=oe.prototype.bv,oe.prototype.multiply=oe.prototype.multiply,oe.prototype.reset=oe.prototype.reset,oe.prototype.isIdentity=oe.prototype.ws,oe.prototype.equals=oe.prototype.D,oe.prototype.setTransform=oe.prototype.setTransform,oe.prototype.set=oe.prototype.set;var Re=[];oe.className="Transform",oe.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,gt){if(_t.Yb(a,y,tt,rt,gt,x,E)&&_t.Yb(a,y,tt,rt,gt,b,z))return _t.Yb(a,y,tt,rt,gt,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 Wt=(E+Ct)/2,Zt=(x+bt)/2;return _t.cs(a,y,yt,xt,E,x,Wt,Zt,ot,lt,ut,gt)||_t.cs(Wt,Zt,Ct,bt,b,z,tt,rt,ot,lt,ut,gt)},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 ai(((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))zr(lt,a,y,0,0),zr(lt,tt,rt,0,0);else{var ut=(a+x)/2,gt=(y+E)/2,yt=(x+b)/2,xt=(E+z)/2;b=(b+tt)/2,z=(z+rt)/2,E=(ut+yt)/2,x=(gt+xt)/2,yt=(yt+b)/2,xt=(xt+z)/2;var Ct=(E+yt)/2,bt=(x+xt)/2;_t.Dl(a,y,ut,gt,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,gt=(y+E)/2,yt=(x+b)/2,xt=(E+z)/2;b=(b+tt)/2,z=(z+rt)/2,E=(ut+yt)/2,x=(gt+xt)/2,yt=(yt+b)/2,xt=(xt+z)/2;var Ct=(E+yt)/2,bt=(x+xt)/2;_t.Qe(a,y,ut,gt,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,gt=(y+E)/2;x=(x+b)/2,E=(E+z)/2;var yt=(ut+x)/2,xt=(gt+E)/2;return _t.jv(a,y,ut,gt,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))zr(rt,a,y,0,0),zr(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,gt=(lt+E)/2;_t.iv(a,y,ot,lt,ut,gt,tt,rt),_t.iv(ut,gt,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,gt=(lt+E)/2;_t.ep(a,y,ot,lt,ut,gt,tt,rt),_t.ep(ut,gt,x,E,b,z,tt,rt)}return rt},Eo:function(a,y,x,E,b,z,tt,rt,ot,lt,ut,gt,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,gt)||(yt=(a-tt)*(lt-gt)-(y-rt)*(ot-ut),yt===0)?!1:(xt.h(((a*rt-y*tt)*(ot-ut)-(a-tt)*(ot*gt-lt*ut))/yt,((a*rt-y*tt)*(lt-gt)-(y-rt)*(ot*gt-lt*ut))/yt),!0);var Ct=(a+x)/2,bt=(y+E)/2,Wt=(x+b)/2,Zt=(E+z)/2;b=(b+tt)/2,z=(z+rt)/2,E=(Ct+Wt)/2,x=(bt+Zt)/2,Wt=(Wt+b)/2,Zt=(Zt+z)/2;var $t=(E+Wt)/2,ne=(x+Zt)/2,re=1/0,de=!1,Fe=0,Wn=0;return _t.Eo(a,y,Ct,bt,E,x,$t,ne,ot,lt,ut,gt,yt,xt)&&(a=(xt.x-ot)*(xt.x-ot)+(xt.y-lt)*(xt.y-lt),a<re&&(re=a,de=!0,Fe=xt.x,Wn=xt.y)),_t.Eo($t,ne,Wt,Zt,b,z,tt,rt,ot,lt,ut,gt,yt,xt)&&(xt.x-ot)*(xt.x-ot)+(xt.y-lt)*(xt.y-lt)<re&&(de=!0,Fe=xt.x,Wn=xt.y),de&&(xt.x=Fe,xt.y=Wn),de},Fo:function(a,y,x,E,b,z,tt,rt,ot,lt,ut,gt,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-gt)-(y-rt)*(ot-ut),yt===0)return xt;var Ct=((a*rt-y*tt)*(ot-ut)-(a-tt)*(ot*gt-lt*ut))/yt,bt=((a*rt-y*tt)*(lt-gt)-(y-rt)*(ot*gt-lt*ut))/yt;if(Ct>=ut)return xt;if((ot>ut?ot-ut:ut-ot)<(lt>gt?lt-gt:gt-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 Wt=(x+b)/2,Zt=(E+z)/2;b=(b+tt)/2,z=(z+rt)/2,E=(Ct+Wt)/2,x=(bt+Zt)/2,Wt=(Wt+b)/2,Zt=(Zt+z)/2;var $t=(E+Wt)/2,ne=(x+Zt)/2;xt+=_t.Fo(a,y,Ct,bt,E,x,$t,ne,ot,lt,ut,gt,yt),xt+=_t.Fo($t,ne,Wt,Zt,b,z,tt,rt,ot,lt,ut,gt,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(Wt,Zt){var $t=(Wt-a)*(Wt-a)+(Zt-y)*(Zt-y);$t<gt&&(gt=$t,ot.h(Wt,Zt))}var gt=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,gt=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,gt=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,gt=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,gt=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,gt=ot.y)),ot.h(ut,gt),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):!!(Or(a,y,x,E,b,z)||Or(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),gt=tt/(y+z);if(ut=ut*ut+gt*gt-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 fi,um:new fi,Mf:new fi,Nf:0,vm:100};_t.za=_t.AA;function ce(a){Gi(this),this.l=2,a===void 0&&(a=ce.o),this.na=a,this.Ec=this.Dc=this.pd=this.od=0,a===ce.o?this.ee=new un:(ce.V===null&&(ce.V=new un().freeze()),this.ee=ce.V),this.aq=this.ee.Ja,this.Ip=new Oe().freeze(),this.ym=this.tk=null,this.zm=NaN,this.fg=_r,this.gg=io,this.Rk=this.Sk=NaN,this.Uf=Sn}ce.prototype.copy=function(){var a=new ce;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===ce.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},ce.prototype.ja=function(){return this.freeze(),Object.freeze(this),this},ce.prototype.freeze=function(){if(this._isFrozen=!0,this.type!==ce.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},ce.prototype.ka=function(){if(Object.isFrozen(this)&&Qt("cannot thaw constant: "+this),this._isFrozen=!1,this.type!==ce.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},ce.prototype.Xa=function(a){if(!(a instanceof ce))return!1;if(this.type!==a.type)return this.type===ce.j&&a.type===ce.o?Rr(this,a):a.type===ce.j&&this.type===ce.o?Rr(a,this):!1;if(this.type===ce.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 Rr(a,y){return a.type!==ce.j||y.type!==ce.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===Ui&&_t.B(a.endX,y.endX)&&_t.B(a.endY,y.endY))))}ce.ia=function(a){return a.toString()},ce.prototype.qb=function(a){a.classType===ce&&(this.type=a)},ce.prototype.toString=function(a){switch(a===void 0&&(a=-1),this.type){case ce.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 ce.u:var y=new Oe(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 ce.F:if(y=new Oe(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 ce.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()}},ce.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},ce.parse=function(a,y){function x(){return bt>=re-1?!0:lt[bt+1].match(de)!==null}function E(){return bt++,lt[bt]}function b(er){var Ki=parseFloat(E()),no=parseFloat(E());Wt===Wt.toLowerCase()&&(Ki=ne.x+Ki,no=ne.y+no),er.h(Ki,no)}function z(){return b(ne),ne}function tt(){return b($t),$t}function rt(){var er=Zt.toLowerCase();return er!=="c"&&er!=="s"&&er!=="q"&&er!=="t"?ne:new Tt(2*ne.x-$t.x,2*ne.y-$t.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=Jn();for(var gt="",yt=!1,xt=0;xt<ut.length;xt++){var Ct=ut[xt];Ct!=="."||yt?Ct==="."?(ot.push(gt),gt="."):gt+=Ct:(yt=!0,gt+=Ct)}for(ot.push(gt),lt.splice(a,1),ut=0;ut<ot.length;ut++)lt.splice(a+ut,0,ot[ut]);a+=ot.length-1,ii(ot)}}var bt=-1,Wt="",Zt="";ot=new Tt(0,0);var $t=new Tt(0,0),ne=new Tt(0,0),re=lt.length;a=N1(null),yt=gt=ut=!1,xt=!0,Ct=null;for(var de=/[UuBbMmZzLlHhVvCcSsQqTtAaFfXx]/;!(bt>=re-1);)if(Zt=Wt,Wt=E(),Wt!=="")switch(Wt.toUpperCase()){case"X":xt=!0,gt=ut=!1;break;case"M":for(Ct=z(),a.mc===null||xt===!0?(zf(a,Ct.x,Ct.y,ut,!gt,yt),xt=!1):a.moveTo(Ct.x,Ct.y),ot.assign(ne);!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();)ne=new Tt((Wt===Wt.toLowerCase()?ne.x:0)+parseFloat(E()),ne.y),a.lineTo(ne.x,ne.y);break;case"V":for(;!x();)ne=new Tt(ne.x,(Wt===Wt.toLowerCase()?ne.y:0)+parseFloat(E())),a.lineTo(ne.x,ne.y);break;case"C":for(;!x();){Ct=new Tt,b(Ct);var Fe=tt(),Wn=z();Dh(a,Ct.x,Ct.y,Fe.x,Fe.y,Wn.x,Wn.y)}break;case"S":for(;!x();)Ct=rt(),Fe=tt(),Wn=z(),Dh(a,Ct.x,Ct.y,Fe.x,Fe.y,Wn.x,Wn.y);break;case"Q":for(;!x();)Ct=tt(),Fe=z(),jm(a,Ct.x,Ct.y,Fe.x,Fe.y);break;case"T":for(;!x();)$t=Ct=rt(),Fe=z(),jm(a,Ct.x,Ct.y,Fe.x,Fe.y);break;case"B":for(;!x();){Ct=parseFloat(E()),Fe=parseFloat(E()),Wn=parseFloat(E());var mi=parseFloat(E()),ui=parseFloat(E()),Fn=ui,rn=!1;x()||(Fn=parseFloat(E()),x()||(rn=parseFloat(E())!==0)),Wt===Wt.toLowerCase()&&(Wn+=ne.x,mi+=ne.y),a.arcTo(Ct,Fe,Wn,mi,ui,Fn,rn)}break;case"A":for(;!x();)Ct=Math.abs(parseFloat(E())),Fe=Math.abs(parseFloat(E())),Wn=parseFloat(E()),ui=mi=!1,rn=Fn=0,Fn=E(),Fn.length===1?(mi=!!parseFloat(Fn),ui=!!parseFloat(E()),Fn=parseFloat(E())):Fn.length===2?(mi=!!parseFloat(Fn[0]),ui=!!parseFloat(Fn[1]),Fn=parseFloat(E())):(mi=!!parseFloat(Fn[0]),ui=!!parseFloat(Fn[1]),Fn=parseFloat(Fn.slice(2))),rn=parseFloat(E()),Wt===Wt.toLowerCase()&&(Fn=ne.x+Fn,rn=ne.y+rn),ne.h(Fn,rn),wx(a,Ct,Fe,Wn,mi,ui,Fn,rn);break;case"Z":Px(a),ne.assign(ot);break;case"F":for(Ct="",Fe=1;lt[bt+Fe];)if(lt[bt+Fe]==="0")yt=!0,Fe++;else if(lt[bt+Fe].match(/[Uu]/)!==null)Fe++;else if(lt[bt+Fe].match(de)===null)Fe++;else{Ct=lt[bt+Fe];break}Ct.match(/[Mm]/)?ut=!0:0<a.mc.segments.length&&(a.mc.isFilled=!0);break;case"U":for(Ct="",Fe=1;lt[bt+Fe];)if(lt[bt+Fe].match(/[Ff]/)!==null)Fe++;else if(lt[bt+Fe].match(de)===null)Fe++;else{Ct=lt[bt+Fe];break}Ct.match(/[Mm]/)?gt=!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},ce.Ha=function(a,y){for(var x=a.length,E=Tt.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}Tt.free(E)},ce.prototype.Zu=function(){if(this._isInvalidBounds)return!0;if(this.type===ce.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},ce.prototype.computeBounds=function(){if(this._isInvalidBounds=!1,this.ym=this.tk=null,this.zm=NaN,this.type===ce.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),vr(this,a,!1),zr(a,0,0,0,0),a.freeze()},ce.prototype.ix=function(){var a=new Oe;return vr(this,a,!0),a};function vr(a,y,x){switch(a.type){case ce.j:case ce.u:case ce.F:x?y.h(a.od,a.pd,0,0):zr(y,a.od,a.pd,0,0),zr(y,a.Dc,a.Ec,0,0);break;case ce.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):zr(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 gt=tt[ut];switch(gt.type){case Ui:case ir:ot=gt.endX,lt=gt.endY,zr(y,ot,lt,0,0);break;case kr:_t.Dl(ot,lt,gt.point1X,gt.point1Y,gt.point2X,gt.point2Y,gt.endX,gt.endY,.5,y),ot=gt.endX,lt=gt.endY;break;case Er:_t.iv(ot,lt,gt.point1X,gt.point1Y,gt.endX,gt.endY,.5,y),ot=gt.endX,lt=gt.endY;break;case Tr:case eo:var yt=gt.type===Tr?to(gt,z):Hi(gt,z,ot,lt),xt=yt.length;if(xt===0){ot=gt.type===Tr?gt.centerX:gt.endX,lt=gt.type===Tr?gt.centerY:gt.endY,zr(y,ot,lt,0,0);break}gt=null;for(var Ct=0;Ct<xt;Ct++)gt=yt[Ct],_t.Dl(gt[0],gt[1],gt[2],gt[3],gt[4],gt[5],gt[6],gt[7],.5,y);gt!==null&&(ot=gt[6],lt=gt[7]);break;default:Qt("Unknown Segment type: "+gt.type)}}}break;default:Qt("Unknown Geometry type: "+a.type)}}ce.prototype.normalize=function(){this._isFrozen&&me(this);var a=this.ix();return this.offset(-a.x,-a.y),new Tt(-a.x,-a.y)},ce.prototype.offset=function(a,y){return this._isFrozen&&me(this),this.transform(1,0,0,1,a,y),this},ce.prototype.scale=function(a,y){return this._isFrozen&&me(this),this.transform(a,0,0,y,0,0),this},ce.prototype.rotate=function(a,y,x){this._isFrozen&&me(this),y===void 0&&(y=0),x===void 0&&(x=0);var E=oe.alloc();return E.reset(),E.rotate(a,y,x),this.transform(E.m11,E.m12,E.m21,E.m22,E.dx,E.dy),oe.free(E),this},wt=ce.prototype,wt.transform=function(a,y,x,E,b,z){switch(this.type){case ce.j:case ce.u:case ce.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 ce.o:for(var ot=this.figures.s,lt=ot.length,ut=0;ut<lt;ut++){var gt=ot[ut];tt=gt.startX,rt=gt.startY,gt.startX=tt*a+rt*x+b,gt.startY=tt*y+rt*E+z,gt=gt.segments.s;for(var yt=gt.length,xt=0;xt<yt;xt++){var Ct=gt[xt];switch(Ct.type){case Ui:case ir:tt=Ct.endX,rt=Ct.endY,Ct.endX=tt*a+rt*x+b,Ct.endY=tt*y+rt*E+z;break;case kr: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 Er: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 Tr: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 eo: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:Qt("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 ce.j:return _t.Yb(x,E,b,z,y,a.x,a.y);case ce.u:var tt=Oe.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),Oe.free(tt),a;case ce.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 ce.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,gt,yt=a.figures.s,xt=yt.length,Ct=0;Ct<xt;Ct++){var bt=yt[Ct],Wt=!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 $t=ot,ne=lt,re=Zt.s,de=0;de<=Zt.length;de++){var Fe=void 0;if(de!==Zt.length){Fe=re[de];var Wn=Fe.type;a=Fe.endX,gt=Fe.endY}else Wn=Ui,a=$t,gt=ne;switch(Wn){case ir:if($t=sr(z,y,tt,y,ot,lt,$t,ne),isNaN($t))return!0;rt+=$t,$t=a,ne=gt;break;case Ui:if(ot=sr(z,y,tt,y,ot,lt,a,gt),isNaN(ot))return!0;rt+=ot;break;case kr:ut=_t.Fo(ot,lt,Fe.point1X,Fe.point1Y,Fe.point2X,Fe.point2Y,a,gt,tt,y,z,y,.5),rt+=ut;break;case Er:ut=_t.Fo(ot,lt,(ot+2*Fe.point1X)/3,(lt+2*Fe.point1Y)/3,(2*Fe.point1X+a)/3,(2*Fe.point1Y+gt)/3,a,gt,tt,y,z,y,.5),rt+=ut;break;case Tr:case eo:Wn=Fe.type===Tr?to(Fe,bt):Hi(Fe,bt,ot,lt);var mi=Wn.length;if(mi===0){if(ot=sr(z,y,tt,y,ot,lt,Fe.type===Tr?Fe.centerX:Fe.endX,Fe.type===Tr?Fe.centerY:Fe.endY),isNaN(ot))return!0;rt+=ot;break}Fe=null;for(var ui=0;ui<mi;ui++){if(Fe=Wn[ui],ui===0){if(ut=sr(z,y,tt,y,ot,lt,Fe[0],Fe[1]),isNaN(ut))return!0;rt+=ut}ut=_t.Fo(Fe[0],Fe[1],Fe[2],Fe[3],Fe[4],Fe[5],Fe[6],Fe[7],tt,y,z,y,.5),rt+=ut}Fe!==null&&(a=Fe[6],gt=Fe[7]);break;default:Qt("Unknown Segment type: "+Fe.type)}ot=a,lt=gt}if(Wt){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 Tt),this.type===ce.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===ce.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===ce.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===ce.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=Tt.alloc();return _t.qh(y,x,E,b,z,a,rt),a=rt.x,z=rt.y,Tt.free(rt),Math.sqrt(((a-y)*(a-y)+(z-x)*(z-x))/tt)}}else if(this.type===ce.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=Tt.alloc(),b=1/0,rt=tt=0,ot=y.length;for(var ut=lt=0,gt=0;gt<ot;gt++)for(var yt=y[gt],xt=x[gt],Ct=yt.length,bt=0;bt<Ct;bt+=2){var Wt=yt[bt],Zt=yt[bt+1];if(bt!==0){_t.qh(lt,ut,Wt,Zt,a.x,a.y,E);var $t=(E.x-a.x)*(E.x-a.x)+(E.y-a.y)*(E.y-a.y);$t<b&&(b=$t,tt=rt,tt+=Math.sqrt((E.x-lt)*(E.x-lt)+(E.y-ut)*(E.y-ut))),rt+=xt[(bt-2)/2]}lt=Wt,ut=Zt}return Tt.free(E),a=tt/z,0>a?0:1<a?1:a}return 0};function fo(a){if(a.tk===null){var y=a.tk=[],x=a.ym=[],E=[],b=[];if(a.type===ce.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===ce.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===ce.F){var z=new Ir;z.startX=a.endX,z.startY=(a.startY+a.endY)/2;var tt=new Vi(Tr);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=to(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(Yr(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,gt=0;gt<ut;gt++){var yt=lt[gt];switch(yt.type){case ir:4<=E.length&&(y.push(E),x.push(Yr(E))),E=[],E.push(yt.endX),E.push(yt.endY),tt=yt.endX,z=yt.endY,rt=tt,ot=z;break;case Ui:E.push(yt.endX),E.push(yt.endY),tt=yt.endX,z=yt.endY;break;case kr:_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 Er:_t.ep(tt,z,yt.point1X,yt.point1Y,yt.endX,yt.endY,.5,E),tt=yt.endX,z=yt.endY;break;case Tr:var xt=to(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 Wt=xt[bt];_t.Qe(tt,z,Wt[2],Wt[3],Wt[4],Wt[5],Wt[6],Wt[7],.5,E),tt=Wt[6],z=Wt[7]}break;case eo:if(xt=Hi(yt,b,tt,z),Ct=xt.length,bt=yt.endX,Wt=yt.endY,Ct===0){E.push(bt),E.push(Wt),tt=bt,z=Wt;break}for(bt=0;bt<Ct;bt++)Wt=xt[bt],_t.Qe(tt,z,Wt[2],Wt[3],Wt[4],Wt[5],Wt[6],Wt[7],.5,E),tt=Wt[6],z=Wt[7];break;default:Qt("Segment not of valid type: "+yt.type)}yt.isClosed&&(E.push(rt),E.push(ot))}4<=E.length&&(y.push(E),x.push(Yr(E)))}}}function Yr(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(Zn(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&&me(this),this.fg=new yi(a,y,b,z).freeze(),this.gg=new yi(x,E,tt,rt).freeze(),this},Ue.Object.defineProperties(ce.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 fo(this),this.tk}},flattenedLengths:{get:function(){return fo(this),this.ym}},flattenedTotalLength:{get:function(){var a=this.zm;if(isNaN(a)){if(this.type===ce.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===ce.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&&me(this,a),this.na=a,a===ce.o?this.ee=new un:(ce.V===null&&(ce.V=new un().freeze()),this.ee=ce.V),this._isInvalidBounds=!0)}},startX:{get:function(){return this.od},set:function(a){this.od!==a&&(this._isFrozen&&me(this,a),this.od=a,this._isInvalidBounds=!0)}},startY:{get:function(){return this.pd},set:function(a){this.pd!==a&&(this._isFrozen&&me(this,a),this.pd=a,this._isInvalidBounds=!0)}},endX:{get:function(){return this.Dc},set:function(a){this.Dc!==a&&(this._isFrozen&&me(this,a),this.Dc=a,this._isInvalidBounds=!0)}},endY:{get:function(){return this.Ec},set:function(a){this.Ec!==a&&(this._isFrozen&&me(this,a),this.Ec=a,this._isInvalidBounds=!0)}},figures:{get:function(){return this.ee},set:function(a){this.ee!==a&&(this._isFrozen&&me(this,a),this.ee=a,this._isInvalidBounds=!0)}},spot1:{get:function(){return this.fg},set:function(a){this._isFrozen&&me(this,a),this.fg=a.J()}},spot2:{get:function(){return this.gg},set:function(a){this._isFrozen&&me(this,a),this.gg=a.J()}},defaultStretch:{get:function(){return this.Uf},set:function(a){this._isFrozen&&me(this,a),this.Uf=a}},bounds:{get:function(){return this.Zu()&&this.computeBounds(),this.Ip}}}),ce.prototype.setSpots=ce.prototype.pm,ce.prototype.add=ce.prototype.add,ce.prototype.getFractionForPoint=ce.prototype.xx,ce.prototype.getPointAndAngleAlongPath=ce.prototype.Qu,ce.prototype.getAngleAlongPath=ce.prototype.wx,ce.prototype.getPointAlongPath=ce.prototype.Pu,ce.prototype.containsPoint=ce.prototype.ca,ce.prototype.transform=ce.prototype.transform,ce.prototype.rotate=ce.prototype.rotate,ce.prototype.scale=ce.prototype.scale,ce.prototype.offset=ce.prototype.offset,ce.prototype.normalize=ce.prototype.normalize,ce.prototype.computeBoundsWithoutOrigin=ce.prototype.ix,ce.prototype.equalsApprox=ce.prototype.Xa,ce.className="Geometry",ce.j=new Ae(ce,"Line",0),ce.u=new Ae(ce,"Rectangle",1),ce.F=new Ae(ce,"Ellipse",2),ce.o=new Ae(ce,"Path",3),ce.V=null,ce.hb="UuBbMmZzLlHhVvCcSsQqTtAaFfXx",ce.className="Geometry",ce.stringify=ce.ia,ce.fillPath=ce.nb,ce.parse=ce.parse,ce.Line=ce.j,ce.Rectangle=ce.u,ce.Ellipse=ce.F,ce.Path=ce.o;function Ir(a,y,x,E,b){Gi(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 un,this.sr=this.pl.Ja,this.fw=null}Ir.prototype.copy=function(){var a=new Ir;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=Ir.prototype,wt.Xa=function(a){if(!(a instanceof Ir&&_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 Ui:if(_t.Yb(E,b,ut.endX,ut.endY,x,a,y))return!0;E=ut.endX,b=ut.endY;break;case kr: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 Er: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 Tr:case eo:var gt=ut.type===Tr?to(ut,this):Hi(ut,this,E,b),yt=gt.length,xt=ut.type===Tr?ut.centerX:ut.endX,Ct=ut.type===Tr?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=gt[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:Qt("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},Ue.Object.defineProperties(Ir.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&&me(this,a),this.l=a?this.l|4:this.l&-5}},isShadowed:{get:function(){return(this.l&8)!==0},set:function(a){this._isFrozen&&me(this,a),this.l=a?this.l|8:this.l&-9}},isEvenOdd:{get:function(){return(this.l&16)!==0},set:function(a){this._isFrozen&&me(this,a),this.l=a?this.l|16:this.l&-17}},startX:{get:function(){return this.od},set:function(a){this._isFrozen&&me(this,a),this.od=a,this._isInvalidBounds=!0}},startY:{get:function(){return this.pd},set:function(a){this._isFrozen&&me(this,a),this.pd=a,this._isInvalidBounds=!0}},segments:{get:function(){return this.pl},set:function(a){this._isFrozen&&me(this,a),this.pl=a,this._isInvalidBounds=!0}}}),Ir.prototype.add=Ir.prototype.add,Ir.prototype.equalsApprox=Ir.prototype.Xa,Ir.className="PathFigure";function Vi(a,y,x,E,b,z,tt,rt){Gi(this),a===void 0&&(a=Ui),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===eo?(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===Tr&&(z=Math.max(z,0)),this.Wh=z,typeof tt=="number"?(a===Tr&&(tt=Math.max(tt,0)),this.Pg=tt):this.Pg=0),this.ae=null}Vi.prototype.copy=function(){var a=new Vi;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=Vi.prototype,wt.Xa=function(a){if(!(a instanceof Vi)||this.type!==a.type||this.isClosed!==a.isClosed)return!1;switch(this.type){case ir:case Ui:return _t.B(this.endX,a.endX)&&_t.B(this.endY,a.endY);case kr: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 Er: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 Tr: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 eo: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===Vi&&(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 Ui:a=0>a?"L"+this.endX.toString()+" "+this.endY.toString():"L"+this.endX.toFixed(a)+" "+this.endY.toFixed(a);break;case kr: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 Er: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 Tr: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 eo: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 to(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=oe.alloc();tt.reset(),x<E?tt.scale(1,E/x):tt.scale(x/E,1),ce.Ha(z,tt),oe.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 Hi(a,y,x,E){function b(bt,Wt,Zt,$t){return(bt*$t<Wt*Zt?-1:1)*Math.acos((bt*Zt+Wt*$t)/(Math.sqrt(bt*bt+Wt*Wt)*Math.sqrt(Zt*Zt+$t*$t)))}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,gt=Math.cos(tt),yt=Math.sin(tt),xt=gt*(x-lt)/2+yt*(E-ut)/2;tt=-yt*(x-lt)/2+gt*(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+gt*rt-yt*Ct,E=(E+ut)/2+yt*rt+gt*Ct,ut=b(1,0,(xt-rt)/y,(tt-Ct)/z),gt=(xt-rt)/y,lt=(tt-Ct)/z,xt=(-xt-rt)/y,rt=(-tt-Ct)/z,tt=b(gt,lt,xt,rt),xt=(gt*xt+lt*rt)/(Math.sqrt(gt*gt+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=oe.alloc(),z.reset(),z.translate(x,E),z.rotate(a.Ne,0,0),z.scale(ot,xt),ce.Ha(y,z),oe.free(z),a.ae=y,a.ae}Ue.Object.defineProperties(Vi.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&&me(this,a),this.na=a,this._isInvalidBounds=!0}},endX:{get:function(){return this.Dc},set:function(a){this._isFrozen&&me(this,a),this.Dc=a,this._isInvalidBounds=!0}},endY:{get:function(){return this.Ec},set:function(a){this._isFrozen&&me(this,a),this.Ec=a,this._isInvalidBounds=!0}},point1X:{get:function(){return this.Ne},set:function(a){this._isFrozen&&me(this,a),this.Ne=a,this._isInvalidBounds=!0}},point1Y:{get:function(){return this.Vh},set:function(a){this._isFrozen&&me(this,a),this.Vh=a,this._isInvalidBounds=!0}},point2X:{get:function(){return this.Wh},set:function(a){this._isFrozen&&me(this,a),this.Wh=a,this._isInvalidBounds=!0}},point2Y:{get:function(){return this.Pg},set:function(a){this._isFrozen&&me(this,a),this.Pg=a,this._isInvalidBounds=!0}},centerX:{get:function(){return this.Ne},set:function(a){this._isFrozen&&me(this,a),this.Ne=a,this._isInvalidBounds=!0}},centerY:{get:function(){return this.Vh},set:function(a){this._isFrozen&&me(this,a),this.Vh=a,this._isInvalidBounds=!0}},radiusX:{get:function(){return this.Wh},set:function(a){0>a&&bn(a,">= zero",Vi,"radiusX"),this._isFrozen&&me(this,a),this.Wh=a,this._isInvalidBounds=!0}},radiusY:{get:function(){return this.Pg},set:function(a){0>a&&bn(a,">= zero",Vi,"radiusY"),this._isFrozen&&me(this,a),this.Pg=a,this._isInvalidBounds=!0}},startAngle:{get:function(){return this.Dc},set:function(a){this._isFrozen&&me(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&&me(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&&me(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&&me(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&&me(this,a),a%=360,0>a&&(a+=360),this.Ne=a,this._isInvalidBounds=!0}}}),Vi.prototype.equalsApprox=Vi.prototype.Xa;var ir=new Ae(Vi,"Move",0),Ui=new Ae(Vi,"Line",1),kr=new Ae(Vi,"Bezier",2),Er=new Ae(Vi,"QuadraticBezier",3),Tr=new Ae(Vi,"Arc",4),eo=new Ae(Vi,"SvgArc",4);Vi.className="PathSegment",Vi.Move=ir,Vi.Line=Ui,Vi.Bezier=kr,Vi.QuadraticBezier=Er,Vi.Arc=Tr,Vi.SvgArc=eo;function zi(){this.H=null,this.xu=new Tt(0,0).freeze(),this.mt=new Tt(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},Ue.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 Nr(){this.H=null,this.xa="",this.ar=this.Lr=null}Nr.prototype.copy=function(){var a=new Nr;return a.H=this.H,a.xa=this.xa,a.Lr=this.Lr,a.ar=this.ar,a},Nr.prototype.toString=function(){var a="*"+this.name;return this.subject!==null&&(a+=":"+this.subject.toString()),this.parameter!==null&&(a+="("+this.parameter.toString()+")"),a},Ue.Object.defineProperties(Nr.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}}}),Nr.className="DiagramEvent";function Fi(){this.Fm=pr,this.rf=this.Qq="",this.Ln=this.Mn=this.Rn=this.Sn=this.Qn=this.H=this.cc=null}Fi.prototype.clear=function(){this.Ln=this.Mn=this.Rn=this.Sn=this.Qn=this.H=this.cc=null},Fi.prototype.copy=function(){var a=new Fi;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=ze(y)&&typeof y.J=="function"?y.J():y,y=this.Rn,a.Rn=ze(y)&&typeof y.J=="function"?y.J():y,y=this.Mn,a.Mn=ze(y)&&typeof y.J=="function"?y.J():y,y=this.Ln,a.Ln=ze(y)&&typeof y.J=="function"?y.J():y,a},Fi.prototype.qb=function(a){a.classType===Fi&&(this.change=a)},Fi.prototype.toString=function(){var a="";return a=this.change===Xi?a+"* ":this.change===pr?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===Xi?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},Fi.prototype.I=function(a){return a?this.oldValue:this.newValue},Fi.prototype.Dz=function(a){return a?this.oldParam:this.newParam},Fi.prototype.canUndo=function(){return this.model!==null||this.diagram!==null},Fi.prototype.undo=function(){this.canUndo()&&(this.model!==null?this.model.changeState(this,!0):this.diagram!==null&&this.diagram.changeState(this,!0))},Fi.prototype.canRedo=function(){return this.model!==null||this.diagram!==null},Fi.prototype.redo=function(){this.canRedo()&&(this.model!==null?this.model.changeState(this,!1):this.diagram!==null&&this.diagram.changeState(this,!1))},Ue.Object.defineProperties(Fi.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===Xi&&(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}}}),Fi.prototype.redo=Fi.prototype.redo,Fi.prototype.canRedo=Fi.prototype.canRedo,Fi.prototype.undo=Fi.prototype.undo,Fi.prototype.canUndo=Fi.prototype.canUndo,Fi.prototype.getParam=Fi.prototype.Dz,Fi.prototype.getValue=Fi.prototype.I,Fi.prototype.clear=Fi.prototype.clear;var Xi=new Ae(Fi,"Transaction",-1),pr=new Ae(Fi,"Property",0),ao=new Ae(Fi,"Insert",1),mo=new Ae(Fi,"Remove",2);Fi.className="ChangedEvent",Fi.Transaction=Xi,Fi.Property=pr,Fi.Insert=ao,Fi.Remove=mo;function Ro(){this.o=new un().freeze(),this.xa="",this.j=!1}Ro.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},Ro.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()},Ro.prototype.canUndo=function(){return this.isComplete},Ro.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()}},Ro.prototype.canRedo=function(){return this.isComplete},Ro.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()}},Ro.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===pr&&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()}},Ue.Object.defineProperties(Ro.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}}}),Ro.prototype.optimize=Ro.prototype.ak,Ro.prototype.redo=Ro.prototype.redo,Ro.prototype.canRedo=Ro.prototype.canRedo,Ro.prototype.undo=Ro.prototype.undo,Ro.prototype.canUndo=Ro.prototype.canUndo,Ro.prototype.clear=Ro.prototype.clear,Ro.className="Transaction";function Ji(){this.Pt=new vn,this.Jd=!1,this.u=new un().freeze(),this.Ce=-1,this.o=999,this.Fe=!1,this.Np=null,this.bi=0,this.j=!1,this.Ie=new un().freeze(),this.hl=new un,this.tt=!0,this.Dt=this.rq=this.Gt=this.Ft=!1}Ji.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},Ji.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},Ji.prototype.copyProperties=function(a){this.isEnabled=a.isEnabled,this.maxHistoryLength=a.maxHistoryLength,this.checksTransactionLevel=a.checksTransactionLevel},wt=Ji.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&&_n("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()}},Ji.prototype.canUndo=function(){if(!this.isEnabled||0<this.transactionLevel)return!1;var a=this.transactionToUndo;return!!(a!==null&&a.canUndo())},Ji.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){_n("undo error: "+y.toString())}finally{this.Ob("FinishedUndo","Undo",a),this.Fe=!1}}},Ji.prototype.canRedo=function(){if(!this.isEnabled||0<this.transactionLevel)return!1;var a=this.transactionToRedo;return!!(a!==null&&a.canRedo())},Ji.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){_n("redo error: "+y.toString())}finally{this.Ob("FinishedRedo","Redo",a),this.Fe=!1}}},Ji.prototype.Ob=function(a,y,x){x===void 0&&(x=null);var E=new Fi;for(E.change=Xi,E.propertyName=a,E.object=x,E.oldValue=y,a=this.models;a.next();)y=a.value,E.model=y,y.ds(E)},Ji.prototype.Tu=function(a){if(this.isEnabled&&!this.isUndoingRedoing&&!this.skipsEvent(a)){var y=this.currentTransaction;y===null&&(this.Np=y=new Ro);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||_n("Change not within a transaction: "+x.toString()))}},Ji.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},Ue.Object.defineProperties(Ji.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}}}),Ji.prototype.handleChanged=Ji.prototype.Tu,Ji.prototype.redo=Ji.prototype.redo,Ji.prototype.undo=Ji.prototype.undo,Ji.prototype.canUndo=Ji.prototype.canUndo,Ji.prototype.discardHistoryAfterIndex=Ji.prototype.lx,Ji.prototype.rollbackTransaction=Ji.prototype.Kf,Ji.prototype.commitTransaction=Ji.prototype.eb,Ji.prototype.startTransaction=Ji.prototype.Ea,Ji.prototype.removeModel=Ji.prototype.Rx,Ji.prototype.addModel=Ji.prototype.Xw,Ji.prototype.clear=Ji.prototype.clear,Ji.className="UndoManager";function wr(){Gi(this),this.H=zu,this.xa="",this.Jd=!0,this.nb=!1,this.wm=null,this.yy=new zi,this.Zr=-1}wr.prototype.toString=function(){return this.name!==""?this.name+" Tool":hi(this.constructor)},wr.prototype.updateAdornments=function(){},wr.prototype.canStart=function(){return this.isEnabled},wr.prototype.doStart=function(){},wr.prototype.doActivate=function(){this.isActive=!0},wr.prototype.doDeactivate=function(){this.isActive=!1},wr.prototype.doStop=function(){},wr.prototype.doCancel=function(){this.transactionResult=null,this.stopTool()},wr.prototype.stopTool=function(){var a=this.diagram;a.currentTool===this&&(a.currentTool=null,a.currentCursor="")},wr.prototype.doMouseDown=function(){!this.isActive&&this.canStart()&&this.doActivate()},wr.prototype.doMouseMove=function(){},wr.prototype.doMouseUp=function(){this.stopTool()},wr.prototype.doMouseWheel=function(){},wr.prototype.canStartMultiTouch=function(){return!0},wr.prototype.standardPinchZoomStart=function(){var a=this.diagram,y=a.lastInput,x=y.So(0,Tt.allocAt(NaN,NaN)),E=y.So(1,Tt.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}Tt.free(x),Tt.free(E)},wr.prototype.standardPinchZoomMove=function(){var a=this.diagram,y=a.lastInput,x=y.So(0,Tt.allocAt(NaN,NaN)),E=y.So(1,Tt.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 Tt((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}Tt.free(x),Tt.free(E)},wr.prototype.doKeyDown=function(){this.diagram.lastInput.key==="Esc"&&this.doCancel()},wr.prototype.doKeyUp=function(){},wr.prototype.Ea=function(a){return a===void 0&&(a=this.name),this.transactionResult=null,this.diagram.Ea(a)},wr.prototype.stopTransaction=function(){var a=this.diagram;return this.transactionResult===null?a.Kf():a.eb(this.transactionResult)},wr.prototype.standardMouseSelect=function(){var a=this.diagram;if(a.allowSelect){var y=a.lastInput,x=a.Ol(y.documentPoint,!1);if(x!==null){if(Mr?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||(Mr?y.meta:y.control)||y.shift||a.clearSelection()}},wr.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,uo(a,E,x),E.handled};function uo(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)}}}wr.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}},wr.prototype.doUpdateCursor=function(){var a=this.diagram;a&&(a.currentCursor="")},wr.prototype.doCurrentObjectChanged=function(){},wr.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===Fa&&!y.shift||b===Zo&&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===Fa&&y.shift||b===Zo&&!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)}}},wr.prototype.doWheelChange=function(a,y,x){a.position.D(y)&&x.event.wheelDeltaX===0||(x.bubbles=!1)},wr.prototype.standardWaitAfter=function(a,y){y===void 0&&(y=this.diagram.lastInput),this.cancelWaitAfter();var x=this,E=y.clone(this.yy);this.Zr=ji(function(){x.doWaitAfter(E)},a)},wr.prototype.cancelWaitAfter=function(){this.Zr!==-1&&$e.clearTimeout(this.Zr),this.Zr=-1},wr.prototype.doWaitAfter=function(){},wr.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},wr.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},Ue.Object.defineProperties(wr.prototype,{diagram:{get:function(){return this.H},set:function(a){a instanceof Ne&&(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}}}),wr.prototype.startTransaction=wr.prototype.Ea,wr.className="Tool";function Br(){wr.call(this),this.name="ToolManager",this.hb=new un,this.ob=new un,this.Hb=new un,this.F=this.V=850,this.o=new en(2,2).ja(),this.Ha=5e3,this.ia=Zo,this.u=hu,this.Mp=this.j=null,this.zj=-1}Ee(Br,wr),Br.prototype.initializeStandardTools=function(){},Br.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()}},Br.prototype.doMouseDown=function(){var a=this.diagram,y=a.lastInput;if(y.isTouchEvent&&this.gestureBehavior===Ys&&(y.bubbles=!1),y.isMultiTouch){if(this.cancelWaitAfter(),this.gestureBehavior===Tl){y.bubbles=!0;return}if(this.gestureBehavior===Ys)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===Zo?this.mouseWheelBehavior=Fa:this.mouseWheelBehavior===Fa&&(this.mouseWheelBehavior=Zo)),this.doActivate(),this.standardWaitAfter(this.holdDelay,y)},Br.prototype.doMouseMove=function(){var a=this.diagram,y=a.lastInput;if(y.isMultiTouch){if(this.gestureBehavior===Tl){y.bubbles=!0;return}if(this.gestureBehavior===Ys)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)}Br.prototype.doCurrentObjectChanged=function(a,y){a=this.currentToolTip,a===null||y!==null&&a instanceof Qr&&(y===a||y.rg(a))||this.hideToolTip()},Br.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()))},Br.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)},Br.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()},Br.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 Lu&&a!==this.currentToolTip&&a.show(y,x,this);if(this.currentToolTip=a,this.zj!==-1&&($e.clearTimeout(this.zj),this.zj=-1),a=this.toolTipDuration,0<a&&a!==1/0){var b=this;this.zj=ji(function(){b.hideToolTip()},a)}},Br.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}},Br.prototype.hideToolTip=function(){this.zj!==-1&&($e.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 Lu&&y.hide!==null&&y.hide(a,this),this.currentToolTip=null)},Br.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()},Br.prototype.doMouseWheel=function(){this.standardMouseWheel()},Br.prototype.doKeyDown=function(){var a=this.diagram;a.commandHandler!==null&&a.commandHandler.doKeyDown()},Br.prototype.doKeyUp=function(){var a=this.diagram;a.commandHandler!==null&&a.commandHandler.doKeyUp()},Br.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},Br.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},Br.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)},Ue.Object.defineProperties(Br.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}}}),Br.prototype.replaceStandardTool=Br.prototype.gb;var Zo=new Ae(Br,"WheelScroll",0),Fa=new Ae(Br,"WheelZoom",1),Al=new Ae(Br,"WheelNone",2),hu=new Ae(Br,"GestureZoom",3),Ys=new Ae(Br,"GestureCancel",4),Tl=new Ae(Br,"GestureNone",5);Br.className="ToolManager",Br.WheelScroll=Zo,Br.WheelZoom=Fa,Br.WheelNone=Al,Br.GestureZoom=hu,Br.GestureCancel=Ys,Br.GestureNone=Tl;function Oo(){wr.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 Tt(NaN,NaN),this.Fr=new Tt,this.hb=!0,this.Ik=100,this.Cg=[],this.te=new vn().freeze(),this.ia=new at,this.Bn=null,this.F="copy",this.Oc="",this.Pc="no-drop"}var Ns;Ee(Oo,wr),Oo.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},Oo.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},Oo.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,(Mr?y.meta:y.control)||y.shift||a.clearSelection(!0),this.currentPart.isSelected=!0,a.R("ChangedSelection",a.selection))}}},Oo.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),sn=null,this.isActive=!0,this.tl.set(a.position),gl(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&&Bs(a),Sf(a,this.draggedParts),this.Ea("Drag"),this.startPoint=a.firstInput.documentPoint,a.isMouseCaptured=!0,a.allowDragOut&&(this.isDragOutStarted=!0,this.Ym=!1,sn=this,$i=this.diagram,this.doSimulatedDragOut()))};function gl(a,y){if(a.dragsLink){var x=a.diagram;x.allowRelink&&(x.model.Wj()&&y.count===1&&y.first()instanceof kn?(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 Ra,a.Oe.diagram=x),a.Oe.originalLink=a.draggedLink):(a.draggedLink=null,a.Oe=null))}}Oo.prototype.computeEffectiveCollection=function(a,y){return this.diagram.commandHandler.computeEffectiveCollection(a,y)},Oo.prototype.Pd=function(a){return a===void 0?new lh(Dn):this.isGridSnapEnabled?new lh(new Tt(Math.round(1e3*a.x)/1e3,Math.round(1e3*a.y)/1e3)):new lh(a.copy())},Oo.prototype.doDeactivate=function(){this.isActive=!1;var a=this.diagram;if(this.diagram.layout.isRealtime=this.Sw,a.Fu(!1),a.ug(),ol(this),sd(a,this.draggedParts),this.draggedParts=this.currentPart=this.Bn=null,this.Ym=this.isDragOutStarted=!1,0<Ns.count){for(var y=Ns,x=y.length,E=0;E<x;E++){var b=y.M(E);Wo(b),bo(b),ol(b),b.diagram.ug()}y.clear()}Wo(this),this.tl.h(NaN,NaN),$i!==null&&($i.currentCursor=""),sn=$i=null,bo(this),a.isMouseCaptured=!1,a.currentCursor="",a.Ns=!1,this.stopTransaction(),Lc(a,!0)},Oo.prototype.stopTransaction=function(){var a=this.diagram,y=wr.prototype.stopTransaction.call(this);return y&&a.undoManager.transactionToUndo!==null&&a.undoManager.transactionToUndo.ak(),y};function ol(a){var y=a.diagram,x=y.skipsUndoManager;y.skipsUndoManager=!0,pl(a,y.lastInput,null),y.skipsUndoManager=x,a.Cg.length=0}function Ph(){var a=sn;bo(a),is(a);var y=a.diagram;a.tl.w()&&(y.position=a.tl),y.ug()}Oo.prototype.doCancel=function(){bo(this),is(this);var a=this.diagram;this.tl.w()&&(a.position=this.tl),this.stopTool()},Oo.prototype.doKeyDown=function(){var a=this.diagram,y=a.lastInput;this.isActive&&(y.key==="Esc"?this.doCancel():y.key!==a.previousInput.key&&this.doMouseMove())},Oo.prototype.doKeyUp=function(){this.isActive&&this.doMouseMove()};function Ul(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")):is(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 kn&&E.canCopy()&&x.add(E,a.Pd());a.copiedParts=x,gl(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 bo(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 kn&&(x.value.point=new Tt(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 Pa(a,y,x){var E=a.diagram,b=a.startPoint,z=Tt.alloc();z.assign(E.lastInput.documentPoint),a.moveParts(y,z.re(b),x),Tt.free(z),E.Gf("temporaryPixelRatio")===!0&&E.Yh===null&&30<E.$w&&(Bs(E),E.hk())}Oo.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 is(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 kn&&E.suspendsRouting){var b=x.value.point;a.draggedParts.add(E,a.Pd()),_h(E,-b.x,-b.y)}y.bd()}}function Qa(a,y){var x=a.diagram;a.dragsLink&&(a.draggedLink!==null&&(a.draggedLink.fromNode=null,a.draggedLink.toNode=null),al(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=pl(a,b,E),!a.isActive&&sn===null)return;var rt=E!==null?E.part:null;if(rt===null||x.handlesDragDropForTopLevelParts&&rt.isTopLevel&&!(rt instanceof nr)){var ot=x.mouseDragOver;ot!==null&&(ot(b),tt=!0)}if(!a.isActive&&sn===null||(a.doDragOver(y,E),!a.isActive&&sn===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)}Oo.prototype.findDragOverObject=function(a){var y=this;return Zu(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})},Oo.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 pl(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&&sn===null||x===null)return E;for(y.handled=!1,b=x;b!==null;)a.Cg.push(b),b=Yl(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 Yl(a){var y=a.panel;return y!==null?y:a instanceof Ti&&!(a instanceof nr)&&(a=a.containingGroup,a!==null&&a.handlesDragDropForMembers)?a:null}function du(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=Tt.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(cr,a);ot=y.Bf(ot),ot<z&&(tt=rt,z=ot)}}return Tt.free(a),tt}function al(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=du(a,x.i(0),!1),z!==null&&(tt=z.part));var rt=null,ot=null;x.toNode===null&&(rt=du(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)):Ru(b,tt,z,ot,rt):Ru(b,null,null,null,null)}}}}Oo.prototype.doDragOver=function(){};function ml(a,y){var x=a.diagram;a.dragsLink&&al(a,!0),ol(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=Yl(z)}}else z=x.mouseDrop,z!==null&&z(b);if(a.isActive||sn!==null){for(b=(a.copiedParts||a.draggedParts).iterator;b.next();)z=b.key,z instanceof qn&&z.linksConnected.each(function(rt){rt.suspendsRouting=!1});if(a.doDropOnto(y,E),a.isActive||sn!==null){for(a=Oe.alloc(),y=x.selection.iterator;y.next();)E=y.value,E instanceof qn&&of(x,E,a);Oe.free(a)}}}function rf(a,y,x){a=a.diagram,x=x.part,!a.handlesDragDropForTopLevelParts||!x.isTopLevel||x instanceof nr||(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 kn},!0,function(b){return b instanceof kn},E),a.count!==0)for(a=a.iterator;a.next();)x=a.value,!x.Td(y)&&x.isAvoiding&&x.bb()}Oo.prototype.doDropOnto=function(){},Oo.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()?(Ul(this,!1),Sf(a,this.copiedParts),Pa(this,this.copiedParts,!1),sd(a,this.copiedParts)):this.mayMove()?(bo(this),Pa(this,this.draggedParts,!0)):this.mayDragOut()?(Ul(this,!1),Pa(this,this.copiedParts,!1)):bo(this),Qa(this,a.lastInput.documentPoint))}},Oo.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?(bo(this),Ul(this,!0),Sf(a,this.copiedParts),Pa(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,bo(this),this.mayMove()&&(Pa(this,this.draggedParts,!0),Qa(this,a.lastInput.documentPoint))),this.Ym=!0,ml(this,a.lastInput.documentPoint),this.isActive){var E=x?this.copiedParts.Lf():this.draggedParts.Lf();this.copiedParts=null,y&&fg(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)}}},Oo.prototype.simulatedMouseMove=function(a,y,x){if(sn===null)return!1;var E=sn.diagram;x instanceof Ne||(x=null);var b=$i;return x!==b&&(b!==null&&b!==E&&(b.ug(),sn.isDragOutStarted=!1,b=b.toolManager.findTool("Dragging"),b!==null&&b.doSimulatedDragLeave()),$i=x,x!==null&&x!==E&&(Ph(),b=x.toolManager.findTool("Dragging"),b!==null&&(Ns.contains(b)||Ns.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)},Oo.prototype.simulatedMouseUp=function(a,y,x){if(sn===null)return!1;var E=$i,b=sn.diagram;if(x===null)return sn.doCancel(),!0;if(x!==E){var z=E.toolManager.findTool("Dragging");if(E!==null&&E!==b&&z!==null)return E.ug(),sn.isDragOutStarted=!1,z.doSimulatedDragLeave(),!1;$i=x,E=x.toolManager.findTool("Dragging"),E!==null&&(Ph(),Ns.contains(E)||Ns.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 Tt),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=sn,a!==null&&(x=a.mayCopy(),a.transactionResult=x?"Copy":"Move",a.stopTool()),!0):!1};function fg(a){if(a.draggedParts!==null)for(var y=a.draggedParts.iterator;y.next();){var x=y.key;x instanceof qn&&(x=x.containingGroup,x===null||x.placeholder===null||a.draggedParts.contains(x)||x.placeholder.v())}}Oo.prototype.mayCopy=function(){if(!this.isCopyEnabled)return!1;var a=this.diagram;if(a.isReadOnly||a.isModelReadOnly||!a.allowInsert||!a.allowCopy||(Mr?!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())},Oo.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())},Oo.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())},Oo.prototype.computeBorder=function(a,y,x){return this.Ym||this.draggedParts===null||this.draggedParts.contains(a)?null:x.assign(y)},Oo.prototype.Az=function(){return sn},Oo.prototype.mayDragIn=function(){var a=this.diagram;if(!a.allowDrop||a.isReadOnly||a.isModelReadOnly||!a.allowInsert)return!1;var y=sn;return!(y===null||y.diagram.model.dataFormat!==a.model.dataFormat)},Oo.prototype.doSimulatedDragEnter=function(){if(this.mayDragIn()){var a=this.diagram;a.animationManager.Cc(),xl(a),a.animationManager.Cc(),a=sn,a!==null&&(a.diagram.Ns=!1),this.doUpdateCursor(null)}},Oo.prototype.doSimulatedDragLeave=function(){var a=sn;a!==null&&a.doSimulatedDragOut(),this.doCancel()},Oo.prototype.doSimulatedDragOver=function(){var a=this.diagram;a.animationManager.Dm=!0;var y=sn;if(y!==null&&y.draggedParts!==null){if(!this.mayDragIn())return;af(this,y.draggedParts.Lf(),!1,a.firstInput),Pa(this,this.copiedParts,!1),Qa(this,a.lastInput.documentPoint)}a.animationManager.Dm=!1},Oo.prototype.doSimulatedDrop=function(){var a=this.diagram,y=sn;if(y!==null){var x=y.diagram;if(y.Ym=!0,bo(this),!this.mayDragIn())return;a.animationManager.Dm=!0,a.R("ChangingSelection",a.selection),this.Ea("Drop"),af(this,y.draggedParts.Lf(),!0,a.lastInput),Pa(this,this.copiedParts,!1);var E=new vn;this.copiedParts!==null&&(a.clearSelection(!0),this.copiedParts.iteratorKeys.each(function(b){b.isSelected=!0,E.add(b)})),ml(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 af(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=Oe.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,Oe.free(z),z=a.Fr,tt=new be,rt=Tt.alloc(),ot=y.iterator;ot.next();)lt=ot.value,lt instanceof kn&<.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))));Tt.free(rt),a.copiedParts=tt,gl(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)}}}Oo.prototype.doSimulatedDragOut=function(){var a=this.diagram;a.Ns=!1,this.mayCopy()||this.mayMove()?a.currentCursor="":a.currentCursor=this.nodropCursor,this.Bn=null},Oo.prototype.computeMove=function(a,y,x,E){return x=this.diagram,x!==null?x.computeMove(a,y,this.dragOptions,E):new Tt},Ue.Object.defineProperties(Oo.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}}}),Oo.prototype.getDraggingSource=Oo.prototype.Az;var sn=null,$i=null;Oo.className="DraggingTool",Ns=new un,mn("draggingTool",function(){return this.findTool("Dragging")},function(a){this.gb("Dragging",a,this.mouseMoveTools)}),Br.prototype.doCancel=function(){sn!==null&&sn.doCancel(),wr.prototype.doCancel.call(this)};function mr(){wr.call(this),this.te=100,this.Ha=!1,this.u="pointer";var a=new kn,y=new gr;y.isPanelMain=!0,y.stroke="blue",a.add(y),y=new gr,y.toArrow="Standard",y.fill="blue",y.stroke="blue",a.add(y),a.layerName="Tool",this.Ci=a,a=new qn,y=new gr,y.portId="",y.figure="Rectangle",y.fill=null,y.stroke="magenta",y.strokeWidth=2,y.desiredSize=tr,a.add(y),a.selectable=!1,a.layerName="Tool",this.Bi=a,this.j=y,a=new qn,y=new gr,y.portId="",y.figure="Rectangle",y.fill=null,y.stroke="magenta",y.strokeWidth=2,y.desiredSize=tr,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}Ee(mr,wr),mr.prototype.doStop=function(){this.diagram.ug(),this.originalToPort=this.originalToNode=this.originalFromPort=this.originalFromNode=this.originalLink=null,this.validPortsCache.clear(),this.targetPort=null},mr.prototype.copyPortProperties=function(a,y,x,E,b){if(a!==null&&y!==null&&x!==null&&E!==null){var z=y.Df(),tt=en.alloc();tt.width=y.naturalBounds.width*z,tt.height=y.naturalBounds.height*z,E.desiredSize=tt,en.free(tt),b?(E.toSpot=y.toSpot,E.toEndSegmentLength=y.toEndSegmentLength):(E.fromSpot=y.fromSpot,E.fromEndSegmentLength=y.fromEndSegmentLength),x.locationSpot=cr,z=Tt.alloc(),x.location=y.ga(cr,z),Tt.free(z),E.angle=y.li(),this.portTargeted!==null&&this.portTargeted(a,y,x,E,b)}},mr.prototype.setNoTargetPortProperties=function(a,y,x){y!==null&&(y.desiredSize=tr,y.fromSpot=ar,y.toSpot=ar),a!==null&&(a.location=this.diagram.lastInput.documentPoint),this.portTargeted!==null&&this.portTargeted(null,null,a,y,x)},mr.prototype.doMouseDown=function(){this.isActive&&this.doMouseMove()},mr.prototype.doMouseMove=function(){if(this.isActive){var a=this.diagram;if(this.targetPort=this.findTargetPort(this.isForwards),this.targetPort!==null&&this.targetPort.part instanceof qn){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)}},mr.prototype.findValidLinkablePort=function(a,y){if(a===null)return null;var x=a.part;if(!(x instanceof qn))return null;for(;a!==null;){var E=y?a.toLinkable:a.fromLinkable;if(E===!0&&(a.portId!==null||a instanceof qn)&&(y?this.isValidTo(x,a):this.isValidFrom(x,a)))return a;if(E===!1)break;a=a.panel}return null},mr.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(gt){return b.findValidLinkablePort(gt,a)},null,!0);for(E=1/0,y=null,z=z.iterator;z.next();){var tt=z.value,rt=tt.part;if(rt instanceof qn){var ot=tt.ga(cr,Tt.alloc()),lt=x.x-ot.x,ut=x.y-ot.y;Tt.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 qn&&(x.layer===null||x.layer.allowLink))?y:null},mr.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},mr.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},mr.prototype.isInSameNode=function(a,y){return a===null||y===null?!1:a===y?!0:(a=a.part,y=y.part,a!==null&&a===y)},mr.prototype.isLinked=function(a,y){if(a===null||y===null)return!1;var x=a.part;if(!(x instanceof qn))return!1;a=a.portId,a===null&&(a="");var E=y.part;if(!(E instanceof qn))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},mr.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)},mr.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 vn;return E.add(a),lr(this,x,y,E)};function lr(a,y,x,E){if(y===x)return!0;var b=y.fromNode;return b!==null&&b.isLinkLabel&&(E.add(b),lr(a,b.labeledLink,x,E))?!0:(y=y.toNode,!!(y!==null&&y.isLinkLabel&&(E.add(y),lr(a,y.labeledLink,x,E))))}mr.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!ki(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!ki(this,a,y,x,!0)}if(E===zg)return a===y?a=!0:(E=new vn,E.add(y),a=ho(this,E,a,y,x)),!a;if(E===Zg)return!ki(this,a,y,x,!1);if(E===Gg)return a===y?a=!0:(E=new vn,E.add(y),a=Uo(this,E,a,y,x)),!a}return!0};function ki(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&&ki(a,tt,x,E,b)))return!0}return!1}function ho(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&&ho(a,y,tt,E,b)))return!0}return!1}function Uo(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&&Uo(a,y,rt,E,b))return!0}}return!1}Ue.Object.defineProperties(mr.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}}}),mr.className="LinkingBaseTool";function jo(){mr.call(this),this.name="Linking",this.V={},this.F=null,this.K=Mo,this.Xd=null}Ee(jo,mr),jo.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},jo.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 qn)))return null;var x=this.direction;if(x===Mo||x===ls){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===Mo||x===ra)&&(y=this.findValidLinkablePort(y,!0),y!==null||this.startObject===a&&(y=a.port,this.findValidLinkablePort(y,!0)))?(this.isForwards=!1,y):null},jo.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 qn&&(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 qn&&(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)},jo.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()},jo.prototype.doStop=function(){mr.prototype.doStop.call(this),this.startObject=null},jo.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 qn&&(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)}}},jo.prototype.isNewTreeLink=function(){var a=this.archetypeLinkData;if(a===null)return!0;if(a instanceof kn)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)},jo.prototype.insertLink=function(a,y,x,E){return this.diagram.partManager.insertLink(a,y,x,E)},jo.prototype.doNoLink=function(){},Ue.Object.defineProperties(jo.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 Mo=new Ae(jo,"Either",0),ls=new Ae(jo,"ForwardsOnly",0),ra=new Ae(jo,"BackwardsOnly",0);jo.className="LinkingTool",jo.Either=Mo,jo.ForwardsOnly=ls,jo.BackwardsOnly=ra;function Ra(){mr.call(this),this.name="Relinking";var a=new gr;a.figure="Diamond",a.desiredSize=or,a.fill="lightblue",a.stroke="dodgerblue",a.cursor=this.linkingCursor,a.segmentIndex=0,this.V=a,a=new gr,a.figure="Diamond",a.desiredSize=or,a.fill="lightblue",a.stroke="dodgerblue",a.cursor=this.linkingCursor,a.segmentIndex=-1,this.Xd=a,this.F=null,this.Ew=new Oe}Ee(Ra,mr),Ra.prototype.updateAdornments=function(a){if(a!==null&&a instanceof kn){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)}},Ra.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},Ra.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},Ra.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 kn))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=Qi),this.temporaryFromNode!==null&&(this.temporaryFromNode.location=this.originalLink.i(0))),this.originalLink.toNode===null&&(this.temporaryToPort!==null&&(this.temporaryToPort.desiredSize=Qi),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},Ra.prototype.copyLinkProperties=function(a,y){if(a!==null&&y!==null){y.adjusting=a.adjusting,y.corner=a.corner;var x=a.curve;(x===Hf||x===Rh)&&(x=ws),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}},Ra.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()},Ra.prototype.doStop=function(){mr.prototype.doStop.call(this),this.handle=null},Ra.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 qn&&(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()}}},Ra.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},Ra.prototype.doNoRelink=function(){};function Ru(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)}Ue.Object.defineProperties(Ra.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}}}),Ra.className="RelinkingTool",mn("linkingTool",function(){return this.findTool("Linking")},function(a){this.gb("Linking",a,this.mouseMoveTools)}),mn("relinkingTool",function(){return this.findTool("Relinking")},function(a){this.gb("Relinking",a,this.mouseDownTools)});function qi(){wr.call(this),this.name="LinkReshaping";var a=new gr;a.figure="Rectangle",a.desiredSize=Vr,a.fill="lightblue",a.stroke="dodgerblue",this.o=a,a=new gr,a.figure="Diamond",a.desiredSize=or,a.fill="lightblue",a.stroke="dodgerblue",a.cursor="move",this.u=a,this.F=3,this.Ts=this.j=null,this.Fw=new Tt,this.Yq=new un}Ee(qi,wr),qi.prototype.Ru=function(a){return a&&a.reshapingBehavior.value!==0?a.reshapingBehavior:vl},qi.prototype.om=function(a,y){a.reshapingBehavior=y},qi.prototype.updateAdornments=function(a){if(a!==null&&a instanceof kn){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)}},qi.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()!==dl)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,Xs),rt.cursor="n-resize"):_t.B(ot.y,lt.y)&&(this.om(rt,Ha),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,Xs),rt.cursor="n-resize"):_t.B(ot.y,lt.y)&&(this.om(rt,Ha),rt.cursor="w-resize")):tt!==z&&(this.om(rt,ih),rt.cursor="move");b.add(rt)}b.adornedObject=a}return b},qi.prototype.makeHandle=function(){var a=this.handleArchetype;return a===null?null:a.copy()},qi.prototype.makeResegmentHandle=function(){var a=this.midHandleArchetype;return a===null?null:a.copy()},qi.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},qi.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 kn){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}}},qi.prototype.doDeactivate=function(){this.stopTransaction(),this.Ts=this.handle=null,this.isActive=this.diagram.isMouseCaptured=!1},qi.prototype.stopTransaction=function(){var a=this.diagram,y=wr.prototype.stopTransaction.call(this);return y&&a.undoManager.transactionToUndo!==null&&a.undoManager.transactionToUndo.ak(),y},qi.prototype.doCancel=function(){var a=this.adornedLink;a!==null&&(a.points=this.Yq),this.stopTool()},qi.prototype.getResegmentingPoint=function(){return this.handle.ga(cr)},qi.prototype.doMouseMove=function(){var a=this.diagram;this.isActive&&(a=this.computeReshape(a.lastInput.documentPoint),this.reshape(a))},qi.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&&(us(this,tt,E,b,z,!0)||us(this,tt,E,b,z,!1))){var rt=y.points.copy();us(this,tt,E,b,z,!0)?(rt.cd(x-2,new Tt(tt.x,(z.y+tt.y)/2)),rt.cd(x+1,new Tt(z.x,(z.y+tt.y)/2))):(rt.cd(x-2,new Tt((z.x+tt.x)/2,tt.y)),rt.cd(x+1,new Tt((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&&(us(this,E,b,z,tt,!0)||us(this,E,b,z,tt,!1))&&(rt=y.points.copy(),us(this,E,b,z,tt,!0)?(rt.cd(x-1,new Tt(E.x,(E.y+tt.y)/2)),rt.cd(x+2,new Tt(tt.x,(E.y+tt.y)/2))):(rt.cd(x-1,new Tt((E.x+tt.x)/2,E.y)),rt.cd(x+2,new Tt((E.x+tt.x)/2,tt.y))),rt.mb(x+1),rt.mb(x),y.points=rt,y.Wb())}}else tt=Tt.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()),Tt.free(tt)}a.Ya(),this.transactionResult=this.name,a.R("LinkReshaped",this.adornedLink,this.Yq)}this.stopTool()};function us(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}qi.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===Xs?(y.L(x,y.i(x-1).x,a.y),y.L(x+1,y.i(x+2).x,a.y)):E===Ha&&(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===Xs?(y.L(x-1,y.i(x-2).x,a.y),y.L(x,y.i(x+1).x,a.y)):E===Ha&&(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(cr,Tt.alloc()),E=y.getLinkPointFromPoint(E,b,z,a,!0,Tt.alloc()),y.L(0,E.x,E.y),Tt.free(z),Tt.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(cr,Tt.alloc()),a=y.getLinkPointFromPoint(E,b,x,a,!1,Tt.alloc()),y.L(y.pointsCount-1,a.x,a.y),Tt.free(x),Tt.free(a));y.zf()},qi.prototype.computeReshape=function(a){var y=this.adornedLink,x=this.handle.segmentIndex;switch(this.Ru(this.handle)){case ih:return a;case Xs:return new Tt(y.i(x).x,a.y);case Ha:return new Tt(a.x,y.i(x).y);default:case vl:return y.i(x)}},Ue.Object.defineProperties(qi.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}}}),qi.prototype.setReshapingBehavior=qi.prototype.om,qi.prototype.getReshapingBehavior=qi.prototype.Ru;var vl=new Ae(qi,"None",0),Ha=new Ae(qi,"Horizontal",1),Xs=new Ae(qi,"Vertical",2),ih=new Ae(qi,"All",3);qi.className="LinkReshapingTool",qi.None=vl,qi.Horizontal=Ha,qi.Vertical=Xs,qi.All=ih,mn("linkReshapingTool",function(){return this.findTool("LinkReshaping")},function(a){this.gb("LinkReshaping",a,this.mouseDownTools)});function Ma(){wr.call(this),this.name="Resizing",this.o=new en(1,1).freeze(),this.j=new en(9999,9999).freeze(),this.yg=new en(NaN,NaN).freeze(),this.V=!1,this.ia=!0,this.ue=null;var a=new gr;a.alignmentFocus=cr,a.figure="Rectangle",a.desiredSize=Vr,a.fill="lightblue",a.stroke="dodgerblue",a.strokeWidth=1,a.cursor="pointer",this.F=a,this.u=null,this.Xq=new Tt,this.Dw=new en,this.Tn=new Tt,this.rt=new en(0,0),this.qt=new en(1/0,1/0),this.pt=new en(1,1)}Ee(Ma,wr),Ma.prototype.updateAdornments=function(a){if(!(a===null||a instanceof kn)){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)}},Ma.prototype.makeAdornment=function(a){var y=a.part.resizeAdornmentTemplate;if(y===null){y=new Qr,y.type=wn.Spot,y.locationSpot=cr;var x=new Ps;x.isPanelMain=!0,y.add(x),y.add(this.makeHandle(a,_r)),y.add(this.makeHandle(a,co)),y.add(this.makeHandle(a,io)),y.add(this.makeHandle(a,da)),y.add(this.makeHandle(a,Xa)),y.add(this.makeHandle(a,Aa)),y.add(this.makeHandle(a,Ga)),y.add(this.makeHandle(a,Ja))}else if(jl(y),y=y.copy(),y===null)return null;return y.adornedObject=a,y},Ma.prototype.makeHandle=function(a,y){return a=this.handleArchetype,a===null?null:(a=a.copy(),a.alignment=y,a)},Ma.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=cr),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)}},Ma.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},Ma.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))},Ma.prototype.doDeactivate=function(){var a=this.diagram;this.stopTransaction(),this.ue=this.handle=null,this.isActive=a.isMouseCaptured=!1},Ma.prototype.stopTransaction=function(){var a=this.diagram,y=wr.prototype.stopTransaction.call(this);return y&&a.undoManager.transactionToUndo!==null&&a.undoManager.transactionToUndo.ak(),y},Ma.prototype.doCancel=function(){this.adornedObject!==null&&(this.adornedObject.desiredSize=this.originalDesiredSize,this.adornedObject.part.location=this.originalLocation),this.stopTool()},Ma.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,Tt.alloc()),z=this.computeReshape();y=this.computeResize(b,this.handle.alignment,y,x,E,z),this.resize(y),a.bd(),Tt.free(b)}},Ma.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,Tt.alloc()),z=this.computeReshape();y=this.computeResize(b,this.handle.alignment,y,x,E,z),this.resize(y),Tt.free(b),a.Ya(),this.transactionResult=this.name,a.R("PartResized",this.adornedObject,this.originalDesiredSize)}this.stopTool()},Ma.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 nr){var E=new un;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()}},Ma.prototype.computeResize=function(a,y,x,E,b,z){y.Mc()&&(y=cr);var tt=this.adornedObject.naturalBounds,rt=tt.x,ot=tt.y,lt=tt.x+tt.width,ut=tt.y+tt.height,gt=1;if(!z){gt=tt.width;var yt=tt.height;0>=gt&&(gt=1),0>=yt&&(yt=1),gt=yt/gt}return yt=Tt.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(gt*a.width,E.height),x.height),a.width=a.height/gt):(a.width=Math.max(Math.min(a.height/gt,E.width),x.width),a.height=gt*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(gt*a.width,E.height),x.height),a.width=a.height/gt):(a.width=Math.max(Math.min(a.height/gt,E.width),x.width),a.height=gt*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(gt*a.width,E.height),x.height),a.width=a.height/gt,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(gt*a.width,E.height),x.height),a.width=a.height/gt):(a.width=Math.max(Math.min(a.height/gt,E.width),x.width),a.height=gt*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(gt*a.width,E.height),x.height),a.width=a.height/gt):(a.width=Math.max(Math.min(a.height/gt,E.width),x.width),a.height=gt*a.width))):(a.width=Math.max(Math.min(yt.x-rt,E.width),x.width),z||(a.height=Math.max(Math.min(gt*a.width,E.height),x.height),a.width=a.height/gt,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/gt,E.width),x.width),a.height=gt*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/gt,E.width),x.width),a.height=gt*a.width,a.x=rt+.5*(lt-rt-a.width))),Tt.free(yt),a},Ma.prototype.computeReshape=function(){var a=ln;return this.adornedObject instanceof gr&&(a=Ev(this.adornedObject)),!(a===Mi||this.diagram.lastInput.shift)},Ma.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},Ma.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},Ma.prototype.computeCellSize=function(){var a=new en(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},Ue.Object.defineProperties(Ma.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}}}),Ma.className="ResizingTool",mn("resizingTool",function(){return this.findTool("Resizing")},function(a){this.gb("Resizing",a,this.mouseDownTools)});function Ea(){wr.call(this),this.name="Rotating",this.ia=45,this.V=2,this.Tn=new Tt,this.ue=null;var a=new gr;a.figure="Ellipse",a.desiredSize=or,a.fill="lightblue",a.stroke="dodgerblue",a.strokeWidth=1,a.cursor="pointer",this.o=a,this.j=null,this.Cw=0,this.kr=new Tt(NaN,NaN),this.u=0,this.F=50}Ee(Ea,wr),Ea.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)}},Ea.prototype.makeAdornment=function(a){var y=a.part.rotateAdornmentTemplate;if(y===null){y=new Qr,y.type=wn.Position,y.locationSpot=cr;var x=this.handleArchetype;x!==null&&y.add(x.copy())}else if(jl(y),y=y.copy(),y===null)return null;return y.adornedObject=a,y},Ea.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},Ea.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)},Ea.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(cr)},Ea.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)},Ea.prototype.doDeactivate=function(){var a=this.diagram;this.stopTransaction(),this.ue=this.handle=null,this.kr=new Tt(NaN,NaN),this.isActive=a.isMouseCaptured=!1},Ea.prototype.stopTransaction=function(){var a=this.diagram,y=wr.prototype.stopTransaction.call(this);return y&&a.undoManager.transactionToUndo!==null&&a.undoManager.transactionToUndo.ak(),y},Ea.prototype.doCancel=function(){this.diagram.delaysLayout=!1,this.rotate(this.originalAngle),this.stopTool()},Ea.prototype.doMouseMove=function(){var a=this.diagram;this.isActive&&(a=this.computeRotate(a.lastInput.documentPoint),this.rotate(a))},Ea.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()},Ea.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()}},Ea.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},Ue.Object.defineProperties(Ea.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}}}),Ea.className="RotatingTool",mn("rotatingTool",function(){return this.findTool("Rotating")},function(a){this.gb("Rotating",a,this.mouseDownTools)});function Xl(){wr.call(this),this.name="ClickSelecting"}Ee(Xl,wr),Xl.prototype.canStart=function(){return!(!this.isEnabled||this.isBeyondDragSize())},Xl.prototype.doMouseUp=function(){this.isActive&&(this.standardMouseSelect(),!this.standardMouseClick()&&this.diagram.lastInput.isTouchEvent&&this.diagram.toolManager.doToolTip()),this.stopTool()},Xl.className="ClickSelectingTool";function Dl(){wr.call(this),this.name="Action",this.pk=null}Ee(Dl,wr),Dl.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},Dl.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()},Dl.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))}},Dl.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()},Dl.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())},Dl.prototype.doStop=function(){this.pk=null},Dl.className="ActionTool";function wh(){wr.call(this),this.name="ClickCreating",this.Ri=null,this.o=!0,this.j=!1,this.mw=new Tt(0,0)}Ee(wh,wr),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 Ti)x.Zc()&&(jl(x),E=x.copy(),E!==null&&y.add(E));else if(x!==null){var b=y.model.copyNodeData(x);ze(b)&&(y.model.xf(b),E=y.Lc(b))}if(E!==null){var z=Tt.allocAt(a.x,a.y);this.isGridSnapEnabled&&yf(this.diagram,E,a,z),E.location=z,y.allowSelect&&(y.clearSelection(!0),E.isSelected=!0),Tt.free(z)}y.Ya(),this.transactionResult=this.name,y.R("PartCreated",E)}finally{this.stopTransaction(),y.R("ChangedSelection",y.selection)}return E},Ue.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 yl(){wr.call(this),this.name="DragSelecting",this.Ik=175,this.o=!1;var a=new Ti;a.layerName="Tool",a.selectable=!1;var y=new gr;y.name="SHAPE",y.figure="Rectangle",y.fill=null,y.stroke="magenta",a.add(y),this.j=a}Ee(yl,wr),yl.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))},yl.prototype.doActivate=function(){var a=this.diagram;this.isActive=!0,a.isMouseCaptured=!0,a.skipsUndoManager=!0,a.add(this.box),this.doMouseMove()},yl.prototype.doDeactivate=function(){var a=this.diagram;a.ug(),a.remove(this.box),a.skipsUndoManager=!1,this.isActive=a.isMouseCaptured=!1},yl.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=en.alloc().h(y.width,y.height);x.desiredSize=E,this.box.mm(y.x,y.y,!1),en.free(E),(a.allowHorizontalScroll||a.allowVerticalScroll)&&a.gs(a.lastInput.viewPoint)}},yl.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()},yl.prototype.computeBoxBounds=function(){var a=this.diagram;return new Oe(a.firstInput.documentPoint,a.lastInput.documentPoint)},yl.prototype.selectInRect=function(a){var y=this.diagram,x=y.lastInput;if(a=y.ux(a,this.isPartialInclusion),Mr?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 un,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)}},Ue.Object.defineProperties(yl.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}}}),yl.className="DragSelectingTool";function $a(){wr.call(this),this.name="Panning",this.Xt=new Tt,this.xy=new Tt,this.xg=!1;var a=this;this.Kw=function(){var y=a.diagram;y!==null&&y.removeEventListener($e.document,"scroll",a.Kw,!1),a.stopTool()}}Ee($a,wr),$a.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())},$a.prototype.doActivate=function(){var a=this.diagram;this.xg?(a.lastInput.bubbles=!0,a.addEventListener($e.document,"scroll",this.Kw,!1)):(a.currentCursor="move",a.isMouseCaptured=!0,this.Xt.assign(a.position)),this.isActive=!0},$a.prototype.doDeactivate=function(){var a=this.diagram;a.currentCursor="",this.isActive=a.isMouseCaptured=!1},$a.prototype.doCancel=function(){var a=this.diagram;a.position=this.Xt,a.isMouseCaptured=!1,this.stopTool()},$a.prototype.doMouseMove=function(){this.move()},$a.prototype.doMouseUp=function(){this.move(),this.stopTool()},$a.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)}},Ue.Object.defineProperties($a.prototype,{bubbles:{get:function(){return this.xg},set:function(a){this.xg=a}},originalPosition:{get:function(){return this.Xt}}}),$a.className="PanningTool",mn("clickCreatingTool",function(){return this.findTool("ClickCreating")},function(a){this.gb("ClickCreating",a,this.mouseUpTools)}),mn("clickSelectingTool",function(){return this.findTool("ClickSelecting")},function(a){this.gb("ClickSelecting",a,this.mouseUpTools)}),mn("panningTool",function(){return this.findTool("Panning")},function(a){this.gb("Panning",a,this.mouseMoveTools)}),mn("dragSelectingTool",function(){return this.findTool("DragSelecting")},function(a){this.gb("DragSelecting",a,this.mouseMoveTools)}),mn("actionTool",function(){return this.findTool("Action")},function(a){this.gb("Action",a,this.mouseDownTools)});function Lu(){this.F=this.u=this.j=this.o=null}Ue.Object.defineProperties(Lu.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}}}),Lu.className="HTMLInfo";function Ol(a,y,x){this.text=a,this.hx=y,this.visible=x}Ol.className="ContextMenuButtonInfo";function vs(){wr.call(this),this.name="ContextMenu",this.o=this.ht=this.j=null,this.yw=new Tt,this.jt=null,this.Et=!1;var a=this;this.tu=function(){a.stopTool()}}Ee(vs,wr);function Jl(a){var y=new Lu;y.show=function(b,z,tt){tt.showDefaultContextMenu()},y.hide=function(b,z){z.hideDefaultContextMenu()},$h=y,a.tu=function(){a.stopTool()},y=Tn("div");var x=Tn("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=Tn("style");$e.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",aa,!1),E.addEventListener(y,"selectstart",aa,!1),E.addEventListener(x,"contextmenu",aa,!1)),y.className="goCXforeground",x.className="goCXbackground",$e.document.body&&($e.document.body.appendChild(y),$e.document.body.appendChild(x)),gc=y,Td=x,fc=!0}function aa(a){return a.preventDefault(),!1}vs.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)},vs.prototype.doStart=function(){this.yw.set(this.diagram.firstInput.documentPoint)},vs.prototype.doStop=function(){this.hideContextMenu(),this.currentObject=null},vs.prototype.findObjectWithContextMenu=function(a){a===void 0&&(a=null);var y=this.diagram,x=y.lastInput,E=null;if(a instanceof Ne||(a instanceof fe?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},vs.prototype.doActivate=function(){},vs.prototype.doMouseDown=function(){if(wr.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)&&cu(this)},vs.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())}cu(this)};function cu(a){var y=a.diagram;if(a.isActive){var x=a.currentContextMenu;if(x!==null){var E=null;x instanceof Lu||(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())}vs.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 fe?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()}}vs.prototype.doMouseMove=function(){var a=this.diagram.toolManager.findTool("Action");a!==null&&a.doMouseMove(),this.isActive&&this.diagram.toolManager.doMouseMove()},vs.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 Lu&&a.show(y,x,this);this.currentContextMenu=a},vs.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}},vs.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 Lu&&(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 un;return y.add(new Ol("Copy",function(x){x.commandHandler.copySelection()},function(x){return x.commandHandler.canCopySelection()})),y.add(new Ol("Cut",function(x){x.commandHandler.cutSelection()},function(x){return x.commandHandler.canCutSelection()})),y.add(new Ol("Delete",function(x){x.commandHandler.deleteSelection()},function(x){return x.commandHandler.canDeleteSelection()})),y.add(new Ol("Paste",function(x){x.commandHandler.pasteSelection(a.mouseDownPoint)},function(x){return x.commandHandler.canPasteSelection(a.mouseDownPoint)})),y.add(new Ol("Select All",function(x){x.commandHandler.selectAll()},function(x){return x.commandHandler.canSelectAll()})),y.add(new Ol("Undo",function(x){x.commandHandler.undo()},function(x){return x.commandHandler.canUndo()})),y.add(new Ol("Redo",function(x){x.commandHandler.redo()},function(x){return x.commandHandler.canRedo()})),y.add(new Ol("Scroll To Part",function(x){x.commandHandler.scrollToPart()},function(x){return x.commandHandler.canScrollToPart()})),y.add(new Ol("Zoom To Fit",function(x){x.commandHandler.zoomToFit()},function(x){return x.commandHandler.canZoomToFit()})),y.add(new Ol("Reset Zoom",function(x){x.commandHandler.resetZoom()},function(x){return x.commandHandler.canResetZoom()})),y.add(new Ol("Group Selection",function(x){x.commandHandler.groupSelection()},function(x){return x.commandHandler.canGroupSelection()})),y.add(new Ol("Ungroup Selection",function(x){x.commandHandler.ungroupSelection()},function(x){return x.commandHandler.canUngroupSelection()})),y.add(new Ol("Edit Text",function(x){x.commandHandler.editTextBlock()},function(x){return x.commandHandler.canEditTextBlock()})),y}vs.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=Tn("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=Tn("li"),z.className="goCXli";var tt=Tn("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"},vs.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}},Ue.Object.defineProperties(vs.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&&Qo&&Jl(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;vs.className="ContextMenuTool",mn("contextMenuTool",function(){return this.findTool("ContextMenu")},function(a){this.gb("ContextMenu",a,this.mouseUpTools)});function Go(){wr.call(this),this.name="TextEditing",this.Zh=new To,this.ia=null,this.V=Dd,this.vj=null,this.qa=Od,this.u=1,this.F=!0,this.o=null,this.j=new Lu,this.kt=null,pc(this,this.j)}Ee(Go,wr);function pc(a,y){if(Qo){var x=Tn("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(lf),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 To&&z instanceof Go)if(z.state===Sc)x.style.border="3px solid red",x.focus();else{var tt=E.ga(cr),rt=b.position,ot=b.scale,lt=E.Df()*ot;lt<z.minimumEditorScale&&(lt=z.minimumEditorScale);var ut=E.naturalBounds.width*lt+6,gt=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,gt=rt.y*gt-rt.y*ot+rt.offsetY-(.5*gt-.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+gt|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(Fu),Eh&&Eh!==this)||!a.lastInput.left||this.isBeyondDragSize())return!1;var y=a.ic(a.lastInput.documentPoint);return y!==null&&y instanceof To&&y.editable&&y.part.canEdit()?(y=y.part,!(y===null||this.starting===Dd&&!y.isSelected||this.starting===uf&&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 To&&(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 Oe(this.textBlock.ga(_r),this.textBlock.ga(io));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(Fu)},Go.prototype.acceptText=function(a){switch(a){case Fu: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 sf:case mc:case lf:(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},Ue.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 sf=new Ae(Go,"LostFocus",0),Fu=new Ae(Go,"MouseDown",1),lf=new Ae(Go,"Tab",2),mc=new Ae(Go,"Enter",3),q0=new Ae(Go,"SingleClick",0),Dd=new Ae(Go,"SingleClickSelected",1),uf=new Ae(Go,"DoubleClick",2),Od=new Ae(Go,"StateNone",0),vc=new Ae(Go,"StateActive",1),yc=new Ae(Go,"StateEditing",2),pg=new Ae(Go,"StateValidating",3),Sc=new Ae(Go,"StateInvalid",4),Id=new Ae(Go,"StateValidated",5),Eh=null;Go.className="TextEditingTool",Go.LostFocus=sf,Go.MouseDown=Fu,Go.Tab=lf,Go.Enter=mc,Go.SingleClick=q0,Go.SingleClickSelected=Dd,Go.DoubleClick=uf,Go.StateNone=Od,Go.StateActive=vc,Go.StateEditing=yc,Go.StateValidating=pg,Go.StateInvalid=Sc,Go.StateValidated=Id,mn("textEditingTool",function(){return this.findTool("TextEditing")},function(a){this.gb("TextEditing",a,this.mouseUpTools)});function Js(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 vn,this.ce=new qa,this.ce.Yd=this,this.Ei=new vn,this.pu=new vn,this.Sr=new vn,this.pr=new vn,a&&Object.assign(this,a)}Js.prototype.Xe=function(a){this.H=a},Js.prototype.canStart=function(){return!0};function ju(a,y){a.Jd&&a.canStart(y)&&(a.Zd.add(y),a.defaultAnimation.isAnimating&&a.Cc(),ts(a.H),a.zb=!0)}function hf(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),$e.requestAnimationFrame(function(){a.zb===!1||y.bc||(x.Gf("temporaryPixelRatio")&&Bs(x),wg(x),a.zb=!1,y.start(),y.bc&&(Lh(a),x.Ya(),yg(y,0),xl(x,!0),qh(a),x.R("AnimationStarting",a)))}))}}function oh(a){return a.Zd.contains("Trigger")&&a.Zd.count===1}function df(a,y,x,E){a.isTicking||oh(a)||y instanceof kn&&(y.fromNode!==null||y.toNode!==null)||a.ce.add(y,"position",x,E,!1)}wt=Js.prototype,wt.fv=function(a){return this.ce.fv(a)},wt.Xu=function(a){return this.ce.Xu(a)};function cf(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 fe&&ot.diagram!==null||ot instanceof Ne){rt=!0;break t}}rt=!1}rt?Ec(tt,!1):tt.Xk=!0}}b.pu.clear(),b.bc!==!1&&(Lh(b),xl(b.H),qh(b)),$e.requestAnimationFrame(x)}}var E=a.Ei,b=a;a.bc?a.Sr.add(y):(a.bc=!0,E.add(y),$e.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),Zs(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),Zs(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 ff(a,y,x){y.fd&&(y.Tg=x,a.pr.add(y))}function Zs(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 Tt(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 Tt(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 Tt(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 Tt(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 Tt(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 Oe(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}Ue.Object.defineProperties(Js.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&&bn(a,">= 1",Js,"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}}}),Js.prototype.stopAnimation=Js.prototype.Cc;var xc=null,Pc=!1,ah=new Ae(Js,"Default",1),wc=new Ae(Js,"AnimateLocations",2),vg=new Ae(Js,"None",3);Js.className="AnimationManager",Js.defineAnimationEffect=function(a,y){Pc||(mg(),Pc=!0),xc.add(a,y)},Js.Default=ah,Js.AnimateLocations=wc,Js.None=vg;function qa(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=Dn,this.vc=new be,this.Tt=new be,this.yl=new vn,this.Ut=new vn,this.dw=bh,a&&Object.assign(this,a)}qa.prototype.suspend=function(){this.Xk=!0},qa.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),xl(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=qa.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 Ne?a=x:x instanceof fe&&(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,cf(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 Ne?this.H=a:a instanceof fe&&a.diagram!==null&&(this.H=a.diagram)),a instanceof Ti){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 Ne&&x==="position"&&(x="position:diagram"),(x==="fill"||x==="stroke"||x==="background"||x==="areaBackground")&&(hh(E),av(),E=[hl.j,hl.u,hl.o,hl.F],hh(b),av(),b=[hl.j,hl.u,hl.o,hl.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 fe&&rt instanceof Tt&&!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 Tt&&!tt.w()&&tt.assign(a.o),z&&x.indexOf("position:")===0&&y instanceof Ti?rt.Ku.location=ed(y.location):z&&(rt.Ku[x]=ed(E))}function ed(a){return a instanceof Tt||a instanceof en?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),xl(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 fe&&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,gt;for(gt in lt)if(z.get(gt)!==null){var yt=gt;!rt.Hu||yt!=="position:nodeCollapse"&&yt!=="position:placeholder"||(yt="position"),z.get(yt)(tt,ot[gt],ut[gt]!==void 0?ut[gt]:rt.Hu?ot[gt]:lt[gt],this.Lp,this.Gd,this.Gd,this)}rt.Hu&&ut.location!==void 0&&tt instanceof Ti&&(tt.location=ut.location),rt.nv&&tt instanceof Ti&&tt.Zb(!1)}if(y.As.clear(),Lc(y,!1),y.Ya(),y.N(),xl(y,!0),x.defaultAnimation===this){for(gt=x.pr.iterator;gt.next();)b=gt.value,b.Tg!==null&&(b.points=b.Tg,b.Tg=null);x.pr.clear()}xl(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 nr&&(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 Tt(x.x+x.width/2,x.y+x.height/2),a.position,!1),this.add(a,"scale",.01,a.scale,!1),a instanceof nr)for(a=a.memberParts;a.next();)E=a.value,E instanceof qn&&this.Cj(E,y)},wt.Aj=function(a,y){if(a.isVisible()){var x=null;if(y instanceof nr&&(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 nr)for(a=a.memberParts;a.next();)E=a.value,E instanceof qn&&this.Aj(E,y)}},wt.Ez=function(a){var y=this.Tt.get(a);return y===null&&(y={},this.Tt.add(a,y)),y},Ue.Object.defineProperties(qa.prototype,{duration:{get:function(){return this.Dg},set:function(a){1>a&&bn(a,">= 1",qa,"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:Qt("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}}}),qa.prototype.getTemporaryState=qa.prototype.Ez,qa.prototype.stop=qa.prototype.stop,qa.prototype.add=qa.prototype.add,qa.prototype.addTemporaryPart=qa.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}qa.className="Animation",qa.EaseLinear=function(a,y,x,E){return x*a/E+y},qa.EaseInOutQuad=_d,qa.EaseInQuad=function(a,y,x,E){return x*(a/=E)*a+y},qa.EaseOutQuad=function(a,y,x,E){return-x*(a/=E)*(a-2)+y},qa.EaseInExpo=function(a,y,x,E){return a===0?y:x*Math.pow(2,10*(a/E-1))+y},qa.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))}Ue.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 Ae(Ql,"Default",1),id=new Ae(Ql,"Immediate",2),Rd=new Ae(Ql,"Bundled",3);Ql.className="AnimationTrigger",Ql.Default=Sg,Ql.Immediate=id,Ql.Bundled=Rd;function ja(a){Gi(this),this.H=null,this.Pa=new un,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=ja.prototype,wt.clear=function(){for(var a=this.Pa,y=0;y<a.length;y++){var x=a.s[y];x.Ig=null,as(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 nr?b++:ot instanceof qn?E++:ot instanceof kn?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&&Oi(E)&&(rt+=" #"+Oi(E)),x instanceof qn?rt+=" "+Ii(E):x instanceof kn&&(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=Tt.alloc(),z=this.Pa.s,tt=z.length;tt--;){var rt=z[tt];if((E!==!0||fd(rt)!==!1)&&rt.isVisible()&&(b.assign(a),An(b,rt.oe),rt=rt.ic(b,y,x),rt!==null&&(y!==null&&(rt=y(rt)),rt!==null&&(x===null||x(rt)))))return Tt.free(b),rt}return Tt.free(b),null},wt.ji=function(a,y,x,E){if(y===void 0&&(y=null),x===void 0&&(x=null),E instanceof un||E instanceof vn||(E=new vn),this.Uh===!1)return E;var b=!1;this.diagram!==null&&this.diagram.viewportBounds.ca(a)&&(b=!0);for(var z=Tt.alloc(),tt=this.Pa.s,rt=tt.length;rt--;){var ot=tt[rt];if((b!==!0||fd(ot)!==!1)&&ot.isVisible()){z.assign(a),An(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 Tt.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 un||b instanceof vn||(b=new vn),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 un||b instanceof vn)&&(z=b),b=!0),z instanceof un||z instanceof vn||(z=new vn),this.Uh===!1)return z;var tt=!1;this.diagram!==null&&this.diagram.viewportBounds.ca(a)&&(tt=!0);for(var rt=Tt.alloc(),ot=Tt.alloc(),lt=this.Pa.s,ut=lt.length;ut--;){var gt=lt[ut];if((tt!==!0||fd(gt)!==!1)&>.isVisible()){rt.assign(a),An(rt,gt.oe),ot.h(a.x+y,a.y),An(ot,gt.oe);var yt=gt;gt.og(rt,ot,x,E,b,z)&&(x!==null&&(yt=x(yt)),yt===null||E!==null&&!E(yt)||z.add(yt))}}return Tt.free(rt),Tt.free(ot),z},wt.Fd=function(a,y){if(this.visible){var x=this.Pa.s,E=x.length;if(E!==0){a=Jn();for(var b=Jn(),z=0;z<E;z++){var tt=x[z];if(tt.vw=z,tt instanceof kn){if(tt.fd===!1)continue}else if(tt instanceof Qr&&tt.adornedPart!==null)continue;var rt=tt.actualBounds;tt.isVisible()&&wo(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]);ii(a),ii(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=Oe.alloc(),ot=0;ot<E;ot++)this.Oj(a,x[ot],y,z,tt,rt,!0);if(Oe.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=Oe.alloc(),ut=0;ut<z;ut++){var gt=b[ut];E.contains(gt)&&a.Oj(y,gt,x,rt,ot,lt,!1)}Oe.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 kn&&(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 Qs?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&&(ta(y,a,y.areaBackground,!0,!0,z,b),a.fillRect(b.x,b.y,b.width,b.height)),y.areaBackground===null&&y.background===null&&(ta(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),ta(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(pr,a,this,y,x,E,b)},wt.oi=function(a,y,x){var E=this.Pa;if(y.Ig=this,this===null&&as(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)),gf(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,as(y),a};function gf(a,y,x){if(y=Yp(a,y,x),x instanceof nr&&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&&gf(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}Ue.Object.defineProperties(ja.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===""&&Qt("Cannot rename default Layer to: "+a),x=x.layers;x.next();)x.value.name===a&&Qt("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)&&bn(a,"0 <= value <= 1",ja,"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))}}}),ja.prototype.findObjectsNear=ja.prototype.og,ja.prototype.findObjectsIn=ja.prototype.Cf,ja.prototype.findObjectsAt=ja.prototype.ji,ja.prototype.findObjectAt=ja.prototype.ic,ja.className="Layer";function Ne(a,y){if(lm||(rs(),lm=!0),Gi(this),zu=this,this.vb=!0,this.Ka=null,this.ya=this.Aa=0,this.ta=null,Qo){var x=this,E=function(){x.removeEventListener($e.document,"DOMContentLoaded",E,!1),x.setRTL()};$e.document.body!==null?this.setRTL():x.addEventListener($e.document,"DOMContentLoaded",E,!1)}this.ol=null,Lf.add("Model",So);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===pr&&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"||$e.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 Js,a.Yd.Xe(a),a.Db=17,a.Gw=!1,a.tn=!1,a.bu="default",a.Wa=new un,a.pj=new be,a.nl="default",a.Tx(),a.Sx(),a.pb=1,a.pa=new Tt(NaN,NaN).freeze(),a.du=new Tt(NaN,NaN),a.Ca=1,a.Pp=1,a.zt=new Tt(NaN,NaN).freeze(),a.At=NaN,a.Ot=1e-4,a.Mt=100,a.Ab=new oe,a.zu=new Tt(NaN,NaN).freeze(),a.ut=new Oe(NaN,NaN,NaN,NaN).freeze(),a.rj=new dr(0,0,0,0).freeze(),a.sj=bh,a.nu=!1,a.Zt=null,a.fu=null,a.yh=hs,a.zk=xa,a.Fg=hs,a.pq=xa,a.yt=_r,a.Bt=_r,a.Fc=!0,a.pn=!1,a.De=new vn,a.Eh=new be,a.Xm=!0,a.vp=250,a.vk=-1,a.xp=new dr(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 vn,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 un,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 dr(5).freeze(),a.Hw=new vn().freeze(),a.Nt=999999999,a.nw=new vn().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 vn,a.ow=new vn,a.Xh=null,a.aw=new en(8,8),a.bw=999,a.Bw=1,a.Jw=0,a.fc={scale:1,position:new Tt,bounds:new Oe,Py:new en,bA:new en,Oz:!1},a.fc.canvasSize=a.fc.Py,a.fc.newCanvasSize=a.fc.bA,a.fc.isScroll=!1,a.Rw=new Oe(NaN,NaN,NaN,NaN).freeze(),a.wo=new en(NaN,NaN).freeze(),a.Sp=new Oe(NaN,NaN,NaN,NaN).freeze(),a.It=!1,a.Lg=new be;var y=new qn,x=new To;x.bind(new sa("text","",Ii)),y.add(x),a.ny=y,a.Lg.add("",y),y=new qn,x=new To,x.stroke="brown",x.bind(new sa("text","",Ii)),y.add(x),a.Lg.add("Comment",y),y=new qn,y.selectable=!1,y.avoidable=!1,x=new gr,x.figure="Ellipse",x.fill="black",x.stroke=null,x.desiredSize=new en(3,3).ja(),y.add(x),a.Lg.add("LinkLabel",y),a.Yi=new be,y=new nr,y.selectionObjectName="GROUPPANEL",y.type=wn.Vertical,x=new To,x.font="bold 12pt sans-serif",x.bind(new sa("text","",Ii)),y.add(x),x=new wn(wn.Auto),x.name="GROUPPANEL";var E=new gr;E.figure="Rectangle",E.fill="rgba(128,128,128,0.2)",E.stroke="black",x.add(E),E=new Ps,E.padding=new dr(5,5,5,5).ja(),x.add(E),y.add(x),a.ly=y,a.Yi.add("",y),a.Kh=new be,y=new kn,x=new gr,x.isPanelMain=!0,y.add(x),x=new gr,x.toArrow="Standard",x.fill="black",x.stroke=null,x.strokeWidth=0,y.add(x),a.my=y,a.Kh.add("",y),y=new kn,x=new gr,x.isPanelMain=!0,x.stroke="brown",y.add(x),a.Kh.add("Comment",y),y=new Qr,y.type=wn.Auto,x=new gr,x.fill=null,x.stroke="dodgerblue",x.strokeWidth=3,y.add(x),x=new Ps,x.margin=new dr(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 gr,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 So,a.toolManager=new Br,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=di,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 Tt,a.zy=500,a.wp=new Tt,a.wq=!1}Ne.prototype.clear=function(){this.animationManager.Cc(),this.model.clear(),Vd=null,ud="",xg(this,!1),this.Xn.clear(),Rf(),this.Og.clear(),this.Xh=null,this.Ya(),this.Va(),this.N()};function xg(a,y){a.animationManager.Cc(!0),a.Hw=new vn().freeze(),a.nw=new vn().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(),Rf(),a.Og.clear(),Xr=[],b!==null&&(a.add(b),a.partManager.parts.remove(b)),E&&(a.skipsUndoManager=x),z}function Jp(){return null}Ne.prototype.reset=function(){this.clear(),this.vb=!0,Xp(this),ku(this),this.Wg=!0,Qp(this),this.layout=new Ko,this.Wg=!1,this.model=hy(),this.model.undoManager=new Ji,this.vb=this.rn=!1,this.N()},Ne.prototype.setRTL=function(a){a=a===void 0?this.div:a,a===null&&(a=$e.document.body);var y=Tn("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},Ne.prototype.setScrollWidth=function(a){a=a===void 0?this.div:a,a===null&&(a=$e.document.body);var y=0;if(Qo){var x=sm;y=rd,x===null&&(x=sm=Tn("p"),x.style.width="100%",x.style.height="200px",x.style.boxSizing="content-box",y=rd=Tn("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||Mr||(y=11)}this.Db=y,this.Gw=!0},Ne.prototype.qb=function(a){a.classType===Ne&&(this.autoScale=a)},Ne.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(Qo){if(y!=null||Qt("Diagram setup requires an argument DIV."),a.Ka!==null&&Qt("Diagram has already completed setup."),typeof y=="string"?a.Ka=$e.document.getElementById(y):y instanceof HTMLDivElement?a.Ka=y:Qt("No DIV or DIV id supplied: "+y),a.Ka===null&&Qt("Invalid DIV id; could not get element with id: "+y),a.Ka.H!==void 0&&Qt("Invalid div id; div already has a Diagram associated with it."),!a.ol&&$e.ResizeObserver){var x=Ai(function(){a.$b()},250);a.ol=new $e.ResizeObserver(function(){x()}),a.ol.observe(a.Ka)}$e.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=$e.go;var b=new Rl(a);if(b.style!==void 0&&(b.style.position="absolute",b.style.top="0px",b.style.left="0px",$e.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 Rl(null),b.width=1,b.height=1,a.jw=b,a.oy=b.context,Qo){b=Tn("div");var z=Tn("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=Ai(function(){a.Yh=null,a.N()},300),a.Ov=Ai(function(){wg(a)},250),a.preventDefault=function(tt){return tt.preventDefault(),!1},a.$j=function(tt){if(a.isEnabled){var rt=Sl(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(),$l(rt,tt)}},a.aA=function(tt){a.isEnabled&&(a.Vk=!1,Sl(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():$l(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=$e.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(),$l(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=$e.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 Ne&<.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(),$l(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)}}Ne.prototype.addEventListener=function(a,y,x,E){a.addEventListener(y,x,{capture:E,passive:!1})},Ne.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($e,"resize",a.Ov,!1)}function Bs(a){30<a.Sq&&(a.Yh=1)}function Lc(a,y){a.Yh!==null&&(a.Yh=null,y&&a.hk(),br&&br.nx||(a.Sq=0,a.zw=[0,0,0,0,0],a.Tq=0))}Ne.prototype.computePixelRatio=function(){return this.Yh!==null?this.Yh:$e.devicePixelRatio||1},Ne.prototype.doMouseMove=function(){this.currentTool.doMouseMove()},Ne.prototype.doMouseDown=function(){this.currentTool.doMouseDown()},Ne.prototype.doMouseUp=function(){this.currentTool.doMouseUp()},Ne.prototype.doMouseWheel=function(){this.currentTool.doMouseWheel()},Ne.prototype.doKeyDown=function(){this.currentTool.doKeyDown()},Ne.prototype.doKeyUp=function(){this.currentTool.doKeyUp()},Ne.prototype.doFocus=function(){this.focus()},Ne.prototype.focus=function(){if(this.ta)if(this.scrollsPageOnFocus)this.ta.focus();else{var a=$e.scrollX||$e.pageXOffset,y=$e.scrollY||$e.pageYOffset;this.ta.focus(),$e.scrollTo(a,y)}},Ne.prototype.Oy=function(){this.H.R("GainedFocus")},Ne.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 ja;y.name="Background",a.Al(y),y=new ja,y.name="",a.Al(y),y=new ja,y.name="Foreground",a.Al(y),y=new ja,y.name="Adornment",y.isTemporary=!0,y.isInDocumentBounds=!1,a.Al(y),y=new ja,y.name="Tool",y.isTemporary=!0,y.isInDocumentBounds=!0,a.Al(y),y=new ja,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 gr;return x.figure="LineH",x.stroke="lightgray",x.strokeWidth=.5,x.interval=1,y.add(x),x=new gr,x.figure="LineH",x.stroke="gray",x.strokeWidth=.5,x.interval=5,y.add(x),x=new gr,x.figure="LineH",x.stroke="gray",x.strokeWidth=1,x.interval=10,y.add(x),x=new gr,x.figure="LineV",x.stroke="lightgray",x.strokeWidth=.5,x.interval=1,y.add(x),x=new gr,x.figure="LineV",x.stroke="gray",x.strokeWidth=.5,x.interval=5,y.add(x),x=new gr,x.figure="LineV",x.stroke="gray",x.strokeWidth=1,x.interval=10,y.add(x),x=new Ti,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)}Ne.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 gt=b.x;E=b.y;var yt=b.width,xt=b.height,Ct=b.right,bt=b.bottom;b=this.scale;var Wt=a.scrollLeft;if(this.tn)switch(this.bu){case"negative":Wt=Wt+a.scrollWidth-a.clientWidth;break;case"reverse":Wt=a.scrollWidth-Wt-a.clientWidth}var Zt=Wt;yt<ot||xt<lt?(Wt=Tt.allocAt(this.position.x,this.position.y),this.allowHorizontalScroll&&this.ju!==Zt&&(Wt.x=Zt/b+tt,this.ju=Zt),this.allowVerticalScroll&&this.lu!==a.scrollTop&&(Wt.y=a.scrollTop/b+rt,this.lu=a.scrollTop),this.position=Wt,Tt.free(Wt),this.Ee=this.qr=!1):(Wt=Tt.alloc(),a.uy&&this.allowHorizontalScroll&&(tt<gt&&(this.position=Wt.h(Zt+tt,this.position.y)),ut>Ct&&(this.position=Wt.h(-(y.scrollWidth-this.Aa)+Zt-this.Aa/b+ut,this.position.y))),a.vy&&this.allowVerticalScroll&&(rt<E&&(this.position=Wt.h(this.position.x,a.scrollTop+rt)),z>bt&&(this.position=Wt.h(this.position.x,-(y.scrollHeight-this.ya)+a.scrollTop-this.ya/b+z))),Tt.free(Wt),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,gt=b.x,rt=E.y,E=b.y,yt>=ot&&tt>=gt&&ut<=Ct&&(x.style.width="1px"),xt>=lt&&rt>=E&&z<=bt&&(x.style.height="1px"))}},Ne.prototype.computeBounds=function(a){return a===void 0&&(a=new Oe),ts(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}Ne.prototype.computePartsBounds=function(a,y){y===void 0&&(y=!1);var x=null;if(hn(a))for(var E=0;E<a.length;E++){var b=a[E];!y&&b instanceof kn||(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 kn||(E.Va(),x===null?x=E.actualBounds.copy():x.ed(E.actualBounds));return x===null?new Oe(NaN,NaN,0,0):x};function Il(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=Tt.alloc(),x.xi(a.documentBounds,a.initialDocumentSpot);var E=a.viewportBounds;E=Oe.allocAt(0,0,E.width,E.height);var b=Tt.alloc();b.xi(E,a.initialViewportSpot),b.h(x.x-b.x,x.y-b.y),a.position=b,Oe.free(E),Tt.free(b),Tt.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()?cr: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 Oe(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===sl?(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}Ne.prototype.zoomToFit=function(){var a=this.sj;this.sj=bh,this.scale=jd(this,sl),a!==bh&&(Il(this,!1),Eg(this,this.documentBounds,this.Aa/this.Ca,this.ya/this.Ca,this.zk,!1)),this.sj=a},wt=Ne.prototype,wt.BA=function(a,y){y===void 0&&(y=sl);var x=a.width,E=a.height;if(!(x===0||E===0||isNaN(x)&&isNaN(E))){var b=1;if(y===sl||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 Tt(a.x,a.y)}},wt.Jy=function(a,y){this.Va();var x=this.documentBounds,E=this.viewportBounds;this.position=new Tt(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 fe){this.eq=a;var y=Tt.alloc();this.fq=this.op(a.ga(_r,y)),Tt.free(y)}else this.eq=null,this.fq=di};function Eg(a,y,x,E,b,z){var tt=Tt.allocAt(a.pa.x,a.pa.y),rt=tt.x,ot=tt.y;if(a.eq!==null){var lt=Tt.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,Tt.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),ku(a),Tt.free(tt)}wt.Ol=function(a,y){if(y===void 0&&(y=!0),y){if(a=Zu(this,a,function(x){return x.part},function(x){return x.canSelect()}),a instanceof Ti)return a}else if(a=Zu(this,a,function(x){return x.part}),a instanceof Ti)return a;return null},wt.ic=function(a,y,x){y===void 0&&(y=null),x===void 0&&(x=null),ts(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 Zu(a,y,x,E){for(x===void 0&&(x=null),E===void 0&&(E=null),ts(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 Ti&&E.canSelect()}:null,x)};function Fc(a,y,x,E,b){for(x===void 0&&(x=null),E===void 0&&(E=null),b instanceof un||b instanceof vn||(b=new vn),ts(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 un||E instanceof vn||(E=new vn),ts(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),pf(this,a,function(b){return b instanceof Ti&&(!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 un||b instanceof vn||(b=new vn),ts(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 vn;ts(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 pf(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 un||b instanceof vn||(b=new vn),ts(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 Ti&&(!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 un||b instanceof vn)&&(z=b),b=!0),z instanceof un||z instanceof vn||(z=new vn),ts(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 un||b instanceof vn)&&(z=b),b=!0),z instanceof un||z instanceof vn||(z=new vn),ts(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}Ne.prototype.acceptEvent=function(a){return Sl(this,a,a instanceof MouseEvent)};function Sl(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),Mr&&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,Mr&&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 $l(a,y){return a.bubbles?!0:(y.stopPropagation!==void 0&&y.stopPropagation(),y.cancelable!==!1&&y.preventDefault(),y.cancelBubble=!0,!1)}Ne.prototype.Qz=function(a){var y=this.H;if(!this.H.isEnabled)return!1;var x=Sl(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(),$l(x,a)},Ne.prototype.Rz=function(a){var y=this.H;if(!y.isEnabled)return!1;var x=Sl(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(),$l(x,a)},Ne.prototype.bz=function(a){var y=this.H;if(!y.isEnabled)return!1;var x=Sl(y,a,!0);return y.mouseEnter!==null&&y.mouseEnter(x),y.currentTool.standardMouseOver(),$l(x,a)},Ne.prototype.cz=function(a){var y=this.H;if(!y.isEnabled)return!1;var x=Sl(y,a,!0);return y.mouseLeave!==null&&y.mouseLeave(x),$l(x,a)},Ne.prototype.getMouse=function(a){var y=this.ta;if(y===null)return new Tt(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?An(new Tt(y,a),this.Ab):new Tt(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=Tt.allocAt(tt,rt),a.Ab.Cd(y),x.documentPoint.assign(y),Tt.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))}}Ne.prototype.Ya=function(){this.Zi||(this.Zi=!0,this.$b(!1))};function em(a){a.ld||ts(a),a.Va()}Ne.prototype.redraw=function(){this.vb||this.ld||(this.N(),this.bd())},wt=Ne.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,xl(this),this.hf=!1,this.du=new Tt(NaN,NaN),y.isEnabled=x,this.ld=!0;var E=this;a!==null&&ji(function(){E.ld=!1,ju(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;$e.requestAnimationFrame(function(){y.kg&&y.bd()})}},wt.bd=function(){(!this.fn||this.kg)&&(this.fn&&(this.fn=!1),xl(this))};function od(a,y,x){!a.Ee||a.vb||a.animationManager.defaultAnimation.isAnimating||Hd(a)||(y&&ts(a),x&&Il(a,!1))}function xl(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];ma(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&&(Mu(a),a.mq=!0),!a.fe.visible&&a.mq&&(a.mq=!1)),ts(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,ts(a),a.ou||em(a),od(a,!0,!1),tt=!1,z?(x=Oe.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),Oe.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)),Il(a,!0)),z&&tt&&a.eb("Initial Layout"),ts(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)}Il(a,!0),y=a.Wa.s,a.Fd(y,y.length,a,a.viewportBounds),a.R("InitialLayoutCompleted"),a.du.assign(a.pa),Mu(a)}function ts(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 vn,a.Nv(x,a.De)}a.nodes.each(function(E){E instanceof nr&&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 nr||(x.si()?(x.measure(1/0,1/0),x.arrange()):y.add(x))}for(a.reset();a.next();)x=a.value,x instanceof nr&&x.isVisible()&&kc(this,x);for(a.reset();a.next();)x=a.value,x instanceof kn&&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=Jn(),E=Jn(),b=y.memberParts;b.next();){var z=b.value;z.isVisible()&&(z instanceof nr?(ul(z)||Ss(z)||cd(z))&&kc(a,z):z instanceof kn?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(ii(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();ii(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&&Qt("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&&(oe.prototype.Cd=oe.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&&(oe.prototype.Cd=oe.prototype.Eu),E?(this.ib.Vc(!0),this.vd=!0):this.Fc=this.vd=!1,y=+new Date-+x,E=br&&br.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 mf(a,y,x,E,b,z,tt,rt,ot,lt){if(a.Ka!==null){a.ta===null&&Qt("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 gt=a.Wa.s,yt=gt.length;try{var xt=new Oe(z.x,z.y,E.width/b,E.height/b),Ct=xt.copy();Ct.Co(x),Mu(a,Ct),ts(a),a.Fd(gt,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 Wt=oe.alloc();Wt.reset(),Wt.translate(x.left,x.top),Wt.scale(b),z.x===0&&z.y===0||Wt.translate(-z.x,-z.y),y.setTransform(Wt.m11,Wt.m12,Wt.m21,Wt.m22,Wt.dx,Wt.dy),y.yc(),y instanceof Qs&&Yy(y,Wt.m11,Wt.m12,Wt.m21,Wt.m22,Wt.dx,Wt.dy),oe.free(Wt),Mh(a,y),y.globalAlpha=a.pb;var Zt=a.Qj("Grid");if(tt){var $t=new vn,ne=tt.iterator;for(ne.reset();ne.next();){var re=ne.value;re instanceof Ti&&(lt||re.layer!==Zt)&&(re.Gj(),$t.add(re))}for(lt=0;lt<yt;lt++)Up(gt[lt],y,a,$t,ot);$t.each(function(Fe){return Fe.Gj()})}else for($t=0;$t<yt;$t++){var de=gt[$t];de===Zt?lt&&de.gc(y,a,!0):de.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(gt,yt,a,a.viewportBounds),Mu(a),a.ib instanceof Qs&&(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 fi,this.Rg.drawShadows=!0,this.Rg.textGreeking=!0,this.Rg.viewportOptimizations=!(Mr||fr),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 fi,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 Ne,b;for(b in y){b===""&&Qt("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])),ze(z)?tt=b.substr(rt+1):Qt("Unable to find object named: "+ot+" in "+a.toString()+" when trying to set property: "+b)}}if(tt[0]!=="_"&&!Di(z,tt))if(E&&tt==="ModelChanged"){a.Yw(y[tt]);continue}else if(E&&tt==="Changed"){a.Pe(y[tt]);continue}else if(E&&Di(a.toolManager,tt))z=a.toolManager;else if(E&&rm(a,tt)){a.Bj(tt,y[tt]);continue}else if(a instanceof bi&&tt==="Changed"){a.Pe(y[tt]);continue}else Qt('Trying to set undefined property "'+tt+'" on object: '+z.toString());z[tt]=y[b],tt[0]==="_"&&z instanceof fe&&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")},Ne.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=Oe.alloc(),Ig(this,this.computeBounds(E)),Oe.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),gt=Math.max(y,0),yt=Math.floor(b-ut),xt=Math.floor(rt-gt);a.drawImage(E.Oa,ut,gt,yt,xt,0,0,yt,xt),Yd(this.Yf,this)&&a.clearRect(0,0,ot,lt),E=Jn(),a=Jn(),xt=Math.abs(z),yt=Math.abs(y);var Ct=ut===0?0:b-xt;ut=Tt.allocAt(Ct,0),xt=Tt.allocAt(xt+Ct,rt),a.push(new Oe(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),An(ut,bt),An(xt,bt),E.push(new Oe(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=gt===0?0:rt-yt,ut.h(0,Ct),xt.h(b,yt+Ct),a.push(new Oe(Math.min(ut.x,xt.x),Math.min(ut.y,xt.y),Math.abs(ut.x-xt.x),Math.abs(ut.y-xt.y))),An(ut,bt),An(xt,bt),E.push(new Oe(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 Oe(Math.min(ut.x,xt.x),Math.min(ut.y,xt.y),Math.abs(ut.x-xt.x),Math.abs(ut.y-xt.y))),An(ut,bt),An(xt,bt),E.push(new Oe(Math.min(ut.x,xt.x),Math.min(ut.y,xt.y),Math.abs(ut.x-xt.x),Math.abs(ut.y-xt.y)))),Tt.free(ut),Tt.free(xt),od(this,!1,!0),this.Ka===null&&Qt("No div specified"),this.ta===null&&Qt("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),gt=tt.Zq,gt.length=0,ut=this.scale,yt=Oe.alloc(),xt=tt.Pa.s,bt=xt.length,Ct=ot.length;for(var Wt=0;Wt<bt;Wt++){var Zt=xt[Wt],$t=ec(Zt,Zt.actualBounds);t:{for(var ne=2/ut,re=4/ut,de=0;de<Ct;de++){var Fe=ot[de];if(Fe.width!==0&&Fe.height!==0&&$t.Vu(Fe.x-ne,Fe.y-ne,Fe.width+re,Fe.height+re)){$t=!0;break t}}$t=!1}$t&&tt.Oj(b,Zt,this,gt,ut,yt,!0)}Oe.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()}ii(E),ii(a),this.ld=!1}}else this.bd();x&&(Bs(this),this.bd(),Lc(this,!0))}else x?(Bs(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){ku(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 gt=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,ku(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 Wt=a.documentBounds,Zt=0,$t=0,ne=0,re=0,de=ut.width,Fe=ut.height,Wn=a.rj;a.contentAlignment.sb()?(Wt.width>de&&(Zt=Wn.left,$t=Wn.right),Wt.height>Fe&&(ne=Wn.top,re=Wn.bottom)):(Zt=Wn.left,$t=Wn.right,ne=Wn.top,re=Wn.bottom);var mi=Wt.width+Zt+$t,ui=Wt.height+ne+re;Wn=a.scale;var Fn=mi>ot/Wn,rn=ui>lt/Wn;if(!(z||a.gf||a.Be||Fn||rn))return!0;Zt=Wt.x-Zt,ot=ut.x,$t=Wt.right+$t,lt=ut.right+tt,ne=Wt.y-ne;var er=ut.y;Wt=Wt.bottom+re,ut=ut.bottom+rt;var Ki="1px";if(re="1px",a.scrollMode===bh&&(Fn||rn)&&(Fn&&a.hasHorizontalScrollbar&&a.allowHorizontalScroll&&(Fn=1,Zt+1<ot&&(Fn=Math.max((ot-Zt)*Wn+a.Aa,Fn)),$t>lt+1&&(Fn=Math.max(($t-lt)*Wn+a.Aa,Fn)),de+tt+1<mi&&(Fn=Math.max((mi-de)*Wn+a.Aa,Fn)),Ki=Fn.toString()+"px"),rn&&a.hasVerticalScrollbar&&a.allowVerticalScroll&&(Fn=1,ne+1<er&&(Fn=Math.max((er-ne)*Wn+a.ya,Fn)),Wt>ut+1&&(Fn=Math.max((Wt-ut)*Wn+a.ya,Fn)),Fe+rt+1<ui&&(Fn=Math.max((ui-Fe)*Wn+a.ya,Fn)),re=Fn.toString()+"px")),Fn=Ki!=="1px",rn=re!=="1px",Fn&&rn||!Fn&&!rn||(rn&&(lt-=a.Db),Fn&&(ut-=a.Db),mi<de+tt||!a.hasHorizontalScrollbar||!a.allowHorizontalScroll||(tt=1,Zt+1<ot&&(tt=Math.max((ot-Zt)*Wn+a.Aa,tt)),$t>lt+1&&(tt=Math.max(($t-lt)*Wn+a.Aa,tt)),de+1<mi&&(tt=Math.max((mi-de)*Wn+a.Aa,tt)),Ki=tt.toString()+"px"),Fn=Ki!=="1px",tt=a.ya,Fn!==a.Be&&(tt=Fn?a.ya-a.Db:a.ya+a.Db),ui<Fe+rt||!a.hasVerticalScrollbar||!a.allowVerticalScroll||(rt=1,ne+1<er&&(rt=Math.max((er-ne)*Wn+tt,rt)),Wt>ut+1&&(rt=Math.max((Wt-ut)*Wn+tt,rt)),Fe+1<ui&&(rt=Math.max((ui-Fe)*Wn+tt,rt)),re=rt.toString()+"px"),rn=re!=="1px"),a.qr&&Fn===a.Be&&rn===a.gf)return x===a.Aa&&E===a.ya||a.bd(),!1;if(Fn!==a.Be&&(Ki==="1px"?a.ya=a.ya+a.Db:a.ya=Math.max(a.ya-a.Db,1),z=!0),a.Be=Fn,bt.style.width=Ki,rn!==a.gf&&(re==="1px"?a.Aa=a.Aa+a.Db:a.Aa=Math.max(a.Aa-a.Db,1),z=!0,a.tn&&(rt=Tt.alloc(),rn?(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)),Tt.free(rt))),z&&ku(a),a.gf=rn,bt.style.height=re,a.gu=!0,z&&(a.pn=!0),y=Ct.scrollLeft,a.hasHorizontalScrollbar&&a.allowHorizontalScroll&&(de+1<mi?y=(a.position.x-Zt)*Wn:Zt+1<ot?y=Ct.scrollWidth-Ct.clientWidth:$t>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&&(Fe+1<ui?Ct.scrollTop=(a.position.y-ne)*Wn:ne+1<er?Ct.scrollTop=Ct.scrollHeight-Ct.clientHeight:Wt>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=Oe.allocAt(b,gt,yt,xt),a.onViewportBoundsChanged(x,a.viewportBounds,Wn,z),Oe.free(x),!1):!0}wt=Ne.prototype,wt.add=function(a){var y=a.diagram;if(y!==this&&(y!==null&&Qt("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&&Qt('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(ao,"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 nr&&a.placeholder!==null)&&a.v(),a.data!==null&&$d(a,function(x){sy(y.partManager,x)}),Ss(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(mo,"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),hn(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 vn,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)},Ne.prototype.moveParts=function(a,y,x,E){if(x===void 0&&(x=!1),E===void 0&&(E=vf(this)),this.toolManager!==null){var b=new be;if(a!==null)if(hn(a))for(var z=0;z<a.length;z++)Gu(this,b,a[z],x,E);else for(a=a.iterator;a.next();)Gu(this,b,a.value,x,E);else{for(a=this.parts;a.next();)Gu(this,b,a.value,x,E);for(a=this.nodes;a.next();)Gu(this,b,a.value,x,E);for(a=this.links;a.next();)Gu(this,b,a.value,x,E)}ad(this,b,y,E,x)}};function Gu(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=vf(a)),x instanceof qn){if(y.add(x,a.Pd(b,x,x.location)),x instanceof nr&&(x.placeholder!==null||b.dragsMembers))for(z=x.memberParts;z.next();)Gu(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)&&Gu(a,y,tt,E,b)}}if(b.dragsTree)for(x=x.Ou();x.next();)Gu(a,y,x.value,E,b)}else if(x instanceof kn)for(y.add(x,a.Pd(b,x)),x=x.labelNodes;x.next();)Gu(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=Tt.alloc(),tt=Tt.alloc();tt.assign(x),isNaN(tt.x)&&(tt.x=0),isNaN(tt.y)&&(tt.y=0),(x=a.Mr)||Sf(a,y);for(var rt=Jn(),ot=Jn(),lt=y.iterator,ut=Tt.alloc();lt.next();){var gt=lt.key,yt=lt.value;if(gt.Zc()){var xt=Bg(a,gt,y);xt!==null?rt.push(new it(gt,yt,xt)):(!b||gt.canMove())&&(xt=yt.point,z.assign(xt),a.computeMove(gt,z.add(tt),E,ut),gt.location=ut,yt.shifted===void 0&&(yt.shifted=new Tt),yt.shifted.assign(ut.re(xt)))}else lt.key instanceof kn&&ot.push(lt.sa)}for(Tt.free(ut),b=rt.length,lt=0;lt<b;lt++)gt=rt[lt],z.assign(gt.info.point),gt.Su.shifted===void 0&&(gt.Su.shifted=new Tt),gt.node.location=z.add(gt.Su.shifted);for(b=Tt.alloc(),lt=Tt.alloc(),gt=ot.length,yt=0;yt<gt;yt++){var Ct=ot[yt];if(xt=Ct.key,xt instanceof kn)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=Tt.allocAt(0,0),(ut=xt.i(0))&&ut.w()&&Ct.assign(ut);var Wt=ut=Tt.alloc().assign(Ct).add(tt);E.isGridSnapEnabled&&(E.isGridSnapRealtime||a.lastInput.up)&&(Wt=Tt.alloc(),yf(a,xt,ut,Wt,E)),ut.assign(xt.dragComputation(xt,ut,Wt)).re(Ct),y.add(xt,a.Pd(E,xt,ut)),_h(xt,ut.x-bt.x,ut.y-bt.y),Tt.free(Ct),Tt.free(ut),Wt!==ut&&Tt.free(Wt)}else ut!==null&&(b.assign(ut.location),Wt=y.I(ut),Wt!==null&&b.re(Wt.point)),bt!==null&&(lt.assign(bt.location),Wt=y.I(bt),Wt!==null&<.re(Wt.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))}Tt.free(z),Tt.free(tt),Tt.free(b),Tt.free(lt),ii(rt),ii(ot),x||(ts(a),sd(a,y))}}Ne.prototype.computeMove=function(a,y,x,E){if(E===void 0&&(E=new Tt),E.assign(y),a===null)return E;var b=y,z=x.isGridSnapEnabled;z&&(x.isGridSnapRealtime||this.lastInput.up)&&(b=Tt.alloc(),yf(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&&Tt.free(b),E};function vf(a){var y=a.toolManager.findTool("Dragging");return y!==null?y.dragOptions:a.Wm}function yf(a,y,x,E,b){if(b===void 0&&(b=vf(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=Tt.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),Tt.free(z)}}function Sf(a,y){if(y!==null)for(a.Mr=!0,a=y.iterator;a.next();)y=a.key,y instanceof kn&&(y.suspendsRouting=!0)}function sd(a,y){if(y!==null){for(y=y.iterator;y.next();){var x=y.key;x instanceof kn&&(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=Ne.prototype,wt.Pd=function(a,y,x){if(x===void 0)return new lh(Dn);var E=a.isGridSnapEnabled;return a.groupsSnapMembers||y.containingGroup===null||(E=!1),E?new lh(new Tt(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&&Qt("Cannot share a Layer with another Diagram: "+y+" of "+y.diagram),x===null?y.diagram!==null&&Qt("Cannot add an existing Layer to this Diagram again: "+y):(x.diagram!==a&&Qt("Existing Layer must be in this Diagram: "+x+" not in "+x.diagram),y===x&&Qt("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&&Qt("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(ao,"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(mo,"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(ao,"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(mo,"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(ao,"layers",this,null,a,null,z+1),this.N(),0>E&&this.Ya(),this},wt.kA=function(a){if(a.diagram!==this&&Qt("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(mo,"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 un),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 un),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!==Xi&&(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 Fi;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(pr,a,this,y,x,E,b)},Ne.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===pr){var b=a.object;if(Vo(b,a.propertyName,a.I(y)),b instanceof fe){var z=b.part;z!==null&&z.Wb()}this.isModified=!0}else if(E===ao){var tt=a.object,rt=a.newParam,ot=a.newValue;if(tt instanceof wn)if(typeof rt=="number"&&ot instanceof fe){y?tt.pc(rt):tt.Gb(rt,ot);var lt=tt.part;lt!==null&<.Wb()}else typeof rt=="number"&&ot instanceof va&&(ot.isRow?h1(tt,rt,y?void 0:ot):d1(tt,rt,y?void 0:ot));else if(tt instanceof ja){var ut=a.oldParam===!0;typeof rt=="number"&&ot instanceof Ti&&(y?(ot.isSelected=!1,ot.isHighlighted=!1,ot.Wb(),tt.pc(ut?rt:-1,ot,ut)):tt.oi(rt,ot,ut))}else tt instanceof Ne?typeof rt=="number"&&ot instanceof ja&&(y?this.Wa.mb(rt):(ot.Xe(this),this.Wa.Gb(rt,ot))):Qt("unknown ChangedEvent.Insert object: "+a.toString());this.isModified=!0}else if(E===mo){var gt=a.object,yt=a.oldParam,xt=a.oldValue;if(gt instanceof wn)typeof yt=="number"&&xt instanceof fe?y?gt.Gb(yt,xt):gt.pc(yt):typeof yt=="number"&&xt instanceof va&&(xt.isRow?h1(gt,yt,y?xt:void 0):d1(gt,yt,y?xt:void 0));else if(gt instanceof ja){var Ct=a.newParam===!0;typeof yt=="number"&&xt instanceof Ti&&(y?0>gt.Pa.indexOf(xt)&>.oi(yt,xt,Ct):(xt.isSelected=!1,xt.isHighlighted=!1,xt.Wb(),gt.pc(Ct?yt:-1,xt,Ct)))}else gt instanceof Ne?typeof yt=="number"&&xt instanceof ja&&(y?(xt.Xe(this),this.Wa.Gb(yt,xt)):this.Wa.mb(yt)):Qt("unknown ChangedEvent.Remove object: "+a.toString());this.isModified=!0}else E!==Xi&&Qt("unknown ChangedEvent: "+a.toString())}finally{this.skipsModelSourceBindings=x}}},Ne.prototype.Ea=function(a){return this.undoManager.Ea(a)},Ne.prototype.eb=function(a){return this.undoManager.eb(a)},Ne.prototype.Kf=function(){return this.undoManager.Kf()},Ne.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}},Ne.prototype.updateAllTargetBindings=function(a){this.partManager.updateAllTargetBindings(a)},Ne.prototype.rp=function(){this.partManager.rp()};function Tg(a,y,x){var E=a.animationManager;if(a.vb||a.ld)a.Ca=x,ku(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,ku(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(ns)?rt=0:lt.Hf(Jo)&&(rt=z-1):rt=lt.sb()?lt.x*(z-1):z/2),isNaN(ot)&&(lt.$c()?lt.Hf(Sa)?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=Tt.allocAt(a.pa.x+rt/y-rt/x,a.pa.y+ot/y-ot/x),a.position=z,Tt.free(z),a.Ca=x,ku(a),a.vb=!1,a.onViewportBoundsChanged(b,a.viewportBounds,y,!1),Il(a,!1),E.zb&&(oh(E)||E.ce.add(E.H,"scale",y,a.Ca))}}Ne.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 Br&&(this.lastInput.documentPoint=this.Ps(this.lastInput.viewPoint),ea(b,this)),this.vb||this.invalidateViewport(a,y),Mu(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 Mu(a,y){var x=a.fe;if(x!==null&&x.visible){for(var E=en.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=Oe.alloc(),a=a.viewportBounds,y.h(a.x,a.y,a.width,a.height),!y.w()){Oe.free(y);return}b=y.width,z=y.height,a=y.x,tt=y.y,Oe.free(y)}x.width=b+2*E.width,x.height=z+2*E.height,y=Tt.alloc(),_t.No(a,tt,0,0,E.width,E.height,y),y.offset(-E.width,-E.height),en.free(E),x.part.location=y,Tt.free(y)}}Ne.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)}},Ne.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))},Ne.prototype.rA=function(a){if(this.R("ChangingSelection",this.selection),this.clearSelection(!0),hn(a))for(var y=a.length,x=0;x<y;x++){var E=a[x];E instanceof Ti||Qt("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 Ti||Qt("Diagram.selectCollection given something that is not a Part: "+y),y.isSelected=!0;this.R("ChangedSelection",this.selection)},Ne.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=Ne.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 vn().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 Ti||Qt("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=Tt.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)),Tt.free(z);return}Qt("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):Qt("scrolling direction must be 'up', 'down', 'left', or 'right', not: "+y),Tt.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,gt=y.dy,yt=x*tt+E*ot+ut;y=x*rt+E*lt+gt;var xt=b*tt+E*ot+ut;return a=b*rt+E*lt+gt,E=x*tt+z*ot+ut,x=x*rt+z*lt+gt,tt=b*tt+z*ot+ut,b=b*rt+z*lt+gt,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 Oe(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),An(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=Lf.get(a),a!==null?new a:new So}Ne.prototype.doModelChanged=function(a){var y=this;if(a.model===this.model){var x=a.change,E=a.propertyName;if(x===Xi&&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===Xi){(E==="FinishedUndo"||E==="FinishedRedo")&&(this.R("ChangedSelection",this.selection),ts(this));var z=this.animationManager;E==="RolledBackTransaction"&&z.Cc(),this.bx(),this.Jk=!0,this.bd(),this.undoManager.transactionLevel!==0&&this.undoManager.transactionLevel!==1||hf(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;ji(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 Os){var x=y.element;if(x!==null&&x instanceof HTMLImageElement){x.Bg instanceof vn&&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 Os){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 vn&&x.Bg.remove(a),Rf(E));break}}}}}Ne.prototype.Wd=function(){this.partManager.Wd()},Ne.prototype.Aj=function(a,y){this.Yd.Aj(a,y)},Ne.prototype.Cj=function(a,y){this.Yd.Cj(a,y)},Ne.prototype.findPartForKey=function(a){return this.partManager.findPartForKey(a)},Ne.prototype.Vb=function(a){return this.partManager.Vb(a)},Ne.prototype.findLinkForKey=function(a){return this.partManager.findLinkForKey(a)},wt=Ne.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:Ln(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:Ln(Hn(y)))};function ku(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),Il(a,!1),a.R("DocumentBoundsChanged",void 0,x),a.Ee=!0,a.N())}wt.Va=function(){if(this.Zi){var a=Oe.alloc();Ig(this,this.computeBounds(a)),Oe.free(a)}},wt.rz=function(){for(var a=new vn,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){ts(this),a&&xf(this,!0),this.ld?_g(this,!1):(this.Jk=!0,xl(this))};function xf(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||ju(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),ts(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||hf(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 un,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 un;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 Pf(a,y){var x=a.iw.I(y);if(x!==null||(x=a.iw.I(y.toLowerCase()),x!==null))return x;Qt("Unknown DiagramEvent name: "+y)}wt.Bj=function(a,y){return a=Pf(this,a),a!==null&&a.add(y),this},wt.am=function(a,y){a=Pf(this,a),a!==null&&a.remove(y)},wt.R=function(a,y,x){var E=Pf(this,a),b=new Nr;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 wf(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 Cf(this,!1,null,y||null).Yj(a.x,a.y,a.width,a.height)},Ne.prototype.computeOccupiedArea=function(a){return this.isVirtualized?this.viewportBounds.copy():this.Zi?Cg(this,a):a.assign(this.documentBounds)};function Cf(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=Oe.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&&Ef(a,tt,E,y)}Oe.free(y)}else{for(0<x.memberParts.count&&(y=a.computePartsBounds(x.memberParts,!1),y.Bc(20,20),b.initialize(y)),y=Oe.alloc(),z=x.memberParts;z.next();)tt=z.value,tt instanceof qn&&Ef(a,tt,E,y);Oe.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 Ef(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(Wf(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 nr)for(y=y.memberParts;y.next();)b=y.value,b instanceof qn&&Ef(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)}Ne.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=ji(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=Oe.alloc(),a.computeBounds(y),y.ed(a.documentBounds),Ig(a,y),Oe.free(y),a.Fc=!0,a.bd(),jg(a))}},a.vp))}Ne.prototype.ug=function(){this.vk!==-1&&($e.clearTimeout(this.vk),this.vk=-1)},Ne.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=Oe.allocAt(0,0,E.width*b,E.height*b);var z=Tt.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(Dn)||(y=new Tt(y.x+z.x/b,y.y+z.y/b)),Oe.free(E),Tt.free(z),y},wt=Ne.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 nr&&(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):$e.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 $e.requestAnimationFrame(function(){E()}),null}wt.Wz=function(a){return Qo?(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"&&Qt('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"&&Qt("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 en(1/0,1/0):new en(2e3,2e3));var rt=y.position||null,ot=y.parts||null,lt=y.padding===void 0?1:y.padding,ut=y.background||null,gt=y.omitTemporary;gt===void 0&&(gt=!0);var yt=y.document||document,xt=y.elementFinished||null,Ct=y.showTemporary;Ct===void 0&&(Ct=!gt),y=y.showGrid,y===void 0&&(y=Ct),b!==null&&isNaN(b.width)&&isNaN(b.height)&&(b=null),typeof lt=="number"?lt=new dr(lt):lt instanceof dr||Qt("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),gt=new Rl(null,yt,void 0,!0);var bt=gt.context;if(!(b||z||ot||rt))return gt.width=a.Aa+Math.ceil(lt.left+lt.right),gt.height=a.ya+Math.ceil(lt.top+lt.bottom),x==="SVG"?E===null?null:(E.resize(gt.width,gt.height,gt.width,gt.height),E.ownerDocument=yt,E.hs=xt,mf(a,E.context,lt,new en(gt.width,gt.height),a.Ca,a.pa,ot,ut,Ct,y),E.context):(a.Xm=!1,mf(a,bt,lt,new en(gt.width,gt.height),a.Ca,a.pa,ot,ut,Ct,y),a.Xm=!0,gt.context);var Wt=a.Pp,Zt=a.documentBounds.copy();if(Zt.Fv(a.yb),Ct)for(var $t=a.Wa.s,ne=$t.length,re=0;re<ne;re++){var de=$t[re];if(de.visible&&de.isTemporary){de=de.Pa.s;for(var Fe=de.length,Wn=0;Wn<Fe;Wn++){var mi=de[Wn];mi.isInDocumentBounds&&mi.isVisible()&&(mi=mi.actualBounds,mi.w()&&Zt.ed(mi))}}}if($t=new Tt(Zt.x,Zt.y),ot!==null){for(ne=new Oe(0,0,0,0),re=!0,de=ot.iterator,de.reset();de.next();)Fe=de.value,Fe instanceof Ti&&(Wn=Fe.layer,Wn!==null&&!Wn.visible||Wn!==null&&!Ct&&Wn.isTemporary||!Fe.isVisible()||(Fe=Fe.actualBounds,Fe.w()&&(re?(re=!1,ne.assign(Fe)):ne.ed(Fe))));Zt.width=ne.width,Zt.height=ne.height,$t.x=ne.x,$t.y=ne.y}return rt!==null&&rt.w()&&($t=rt,z||(z=Wt)),ne=rt=0,lt!==null&&(rt=lt.left+lt.right,ne=lt.top+lt.bottom),re=de=0,b!==null&&(de=b.width,re=b.height,isFinite(de)&&(de=Math.max(0,de-rt)),isFinite(re)&&(re=Math.max(0,re-ne))),b!==null&&z!==null?(z==="NaN"&&(z=Wt),b.w()?(b=de,Zt=re):isNaN(re)?(b=de,Zt=Zt.height*z):(b=Zt.width*z,Zt=re)):b!==null?b.w()?(z=Math.min(de/Zt.width,re/Zt.height),b=de,Zt=re):isNaN(re)?(z=de/Zt.width,b=de,Zt=Zt.height*z):(z=re/Zt.height,b=Zt.width*z,Zt=re):z!==null?z==="NaN"&&tt.w()?(z=Math.min((tt.width-rt)/Zt.width,(tt.height-ne)/Zt.height),z>Wt?(z=Wt,b=Zt.width,Zt=Zt.height):(b=tt.width,Zt=tt.height)):(b=Zt.width*z,Zt=Zt.height*z):(z=Wt,b=Zt.width,Zt=Zt.height),lt!==null?(b+=rt,Zt+=ne):lt=new dr(0),tt!==null&&(Wt=tt.width,tt=tt.height,isNaN(Wt)&&(Wt=2e3),isNaN(tt)&&(tt=2e3),isFinite(Wt)&&(b=Math.min(b,Wt)),isFinite(tt)&&(Zt=Math.min(Zt,tt))),gt.width=Math.ceil(b),gt.height=Math.ceil(Zt),x==="SVG"?E===null?null:(E.resize(gt.width,gt.height,gt.width,gt.height),E.ownerDocument=yt,E.hs=xt,mf(a,E.context,lt,new en(Math.ceil(b),Math.ceil(Zt)),z,$t,ot,ut,Ct,y),E.context):(a.Xm=!1,mf(a,bt,lt,new en(Math.ceil(b),Math.ceil(Zt)),z,$t,ot,ut,Ct,y),a.Xm=!0,gt.context)}Ue.Object.defineProperties(Ne.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,$e.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,$e.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($e,"resize",this.Ov,!1),this.removeEventListener($e,"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)&&bn(a,"0 <= value <= 1",Ne,"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),Il(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),Il(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),Il(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),Il(this,!1))}},scrollHorizontalLineChange:{get:function(){return this.iu},set:function(a){var y=this.iu;y!==a&&(0>a&&bn(a,">= 0",Ne,"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&&bn(a,">= 0",Ne,"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 bn(a,">= 0",Ne,"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&&Qt("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,ju(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($e,"pointermove",this.dk,!0),this.addEventListener($e,"pointerdown",this.ui,!0),this.addEventListener($e,"pointerup",this.fk,!0),this.addEventListener($e,"pointerout",this.ek,!0),this.addEventListener($e,"pointercancel",this.ck,!0),this.removeEventListener(y,"wheel",this.$j,!1),this.addEventListener($e,"wheel",this.$j,!0),this.addEventListener($e,"selectstart",this.preventDefault,!1)):(this.removeEventListener($e,"pointermove",this.dk,!0),this.removeEventListener($e,"pointerdown",this.ui,!0),this.removeEventListener($e,"pointerup",this.fk,!0),this.removeEventListener($e,"pointerout",this.ek,!0),this.removeEventListener($e,"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($e,"wheel",this.$j,!0),this.removeEventListener($e,"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=Tt.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()?ku(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)}Tt.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&&Qt("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),Mu(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),ku(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||Qt("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 dr(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&&Il(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,Il(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&&Il(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()||Qt("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()||Qt("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)):bn(a,"> 0",Ne,"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)):bn(a,"> 0",Ne,"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),Il(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 dr(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&&Qt("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!==pa&&a!==Ff&&Qt("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 en(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 dr(a));var y=this.xp;y.D(a)||(this.xp=a=a.J(),this.Ya(),this.g("autoScrollRegion",y,a))}}}),Ue.Object.defineProperties(Ne,{licenseKey:{get:function(){return Vg.jc()},set:function(a){Vg.add(a.replace(/\s/g,""))}},version:{get:function(){return Kd}}}),Ne.prototype.makeImageData=Ne.prototype.Jx,Ne.prototype.makeImage=Ne.prototype.Wz,Ne.prototype.cacheGroupExternalLinks=Ne.prototype.Fu,Ne.prototype.addRenderer=Ne.prototype.bs,Ne.prototype.makeSVG=Ne.prototype.av,Ne.prototype.makeSvg=Ne.prototype.Cs,Ne.prototype.stopAutoScroll=Ne.prototype.ug,Ne.prototype.doAutoScroll=Ne.prototype.gs,Ne.prototype.isUnoccupied=Ne.prototype.Yj,Ne.prototype.raiseDiagramEvent=Ne.prototype.R,Ne.prototype.removeDiagramListener=Ne.prototype.am,Ne.prototype.addDiagramListener=Ne.prototype.Bj,Ne.prototype.findTreeRoots=Ne.prototype.yz,Ne.prototype.layoutDiagram=Ne.prototype.Uz,Ne.prototype.findTopLevelGroups=Ne.prototype.qz,Ne.prototype.findTopLevelNodesAndLinks=Ne.prototype.rz,Ne.prototype.ensureBounds=Ne.prototype.Va,Ne.prototype.findLinksByExample=Ne.prototype.ls,Ne.prototype.findNodesByExample=Ne.prototype.ms,Ne.prototype.findLinkForData=Ne.prototype.Kc,Ne.prototype.findNodeForData=Ne.prototype.ii,Ne.prototype.findPartForData=Ne.prototype.Lc,Ne.prototype.findLinkForKey=Ne.prototype.findLinkForKey,Ne.prototype.findNodeForKey=Ne.prototype.Vb,Ne.prototype.findPartForKey=Ne.prototype.findPartForKey,Ne.prototype.rebuildParts=Ne.prototype.Wd,Ne.prototype.transformViewToDoc=Ne.prototype.Ps,Ne.prototype.transformRectDocToView=Ne.prototype.zA,Ne.prototype.transformDocToView=Ne.prototype.op,Ne.prototype.centerRect=Ne.prototype.es,Ne.prototype.scrollToRect=Ne.prototype.tv,Ne.prototype.scroll=Ne.prototype.scroll,Ne.prototype.highlightCollection=Ne.prototype.Jz,Ne.prototype.highlight=Ne.prototype.Iz,Ne.prototype.selectCollection=Ne.prototype.rA,Ne.prototype.select=Ne.prototype.select,Ne.prototype.updateAllRelationshipsFromData=Ne.prototype.rp,Ne.prototype.updateAllTargetBindings=Ne.prototype.updateAllTargetBindings,Ne.prototype.commit=Ne.prototype.commit,Ne.prototype.rollbackTransaction=Ne.prototype.Kf,Ne.prototype.commitTransaction=Ne.prototype.eb,Ne.prototype.startTransaction=Ne.prototype.Ea,Ne.prototype.raiseChanged=Ne.prototype.g,Ne.prototype.raiseChangedEvent=Ne.prototype.cb,Ne.prototype.removeChangedListener=Ne.prototype.ik,Ne.prototype.addChangedListener=Ne.prototype.Pe,Ne.prototype.removeModelChangedListener=Ne.prototype.mA,Ne.prototype.addModelChangedListener=Ne.prototype.Yw,Ne.prototype.findLayer=Ne.prototype.Qj,Ne.prototype.removeLayer=Ne.prototype.kA,Ne.prototype.addLayerAfter=Ne.prototype.Cy,Ne.prototype.addLayerBefore=Ne.prototype.Ww,Ne.prototype.addLayer=Ne.prototype.Al,Ne.prototype.moveParts=Ne.prototype.moveParts,Ne.prototype.copyParts=Ne.prototype.Kj,Ne.prototype.removeParts=Ne.prototype.Is,Ne.prototype.remove=Ne.prototype.remove,Ne.prototype.add=Ne.prototype.add,Ne.prototype.clearDelayedGeometries=Ne.prototype.bx,Ne.prototype.setProperties=Ne.prototype.nm,Ne.prototype.attach=Ne.prototype.Du,Ne.prototype.set=Ne.prototype.set,Ne.prototype.resetInputOptions=Ne.prototype.Sx,Ne.prototype.setInputOption=Ne.prototype.sA,Ne.prototype.getInputOption=Ne.prototype.Ql,Ne.prototype.resetRenderingHints=Ne.prototype.Tx,Ne.prototype.setRenderingHint=Ne.prototype.Xx,Ne.prototype.getRenderingHint=Ne.prototype.Gf,Ne.prototype.maybeUpdate=Ne.prototype.bd,Ne.prototype.requestUpdate=Ne.prototype.$b,Ne.prototype.delayInitialization=Ne.prototype.Xy,Ne.prototype.isUpdateRequested=Ne.prototype.Pz,Ne.prototype.invalidateDocumentBounds=Ne.prototype.Ya,Ne.prototype.findObjectsNear=Ne.prototype.og,Ne.prototype.findPartsNear=Ne.prototype.mz,Ne.prototype.findObjectsIn=Ne.prototype.Cf,Ne.prototype.findPartsIn=Ne.prototype.ux,Ne.prototype.findObjectsAt=Ne.prototype.ji,Ne.prototype.findPartsAt=Ne.prototype.lz,Ne.prototype.findObjectAt=Ne.prototype.ic,Ne.prototype.findPartAt=Ne.prototype.Ol,Ne.prototype.focusObject=Ne.prototype.zz,Ne.prototype.alignDocument=Ne.prototype.Jy,Ne.prototype.zoomToRect=Ne.prototype.BA,Ne.prototype.zoomToFit=Ne.prototype.zoomToFit,Ne.prototype.diagramScroll=Ne.prototype.kx,Ne.prototype.focus=Ne.prototype.focus;var Lf=new be,sm=null,Qo=$e.document!==void 0,Vd=null,ud="",hs=new Ae(Ne,"None",0),sl=new Ae(Ne,"Uniform",1),hd=new Ae(Ne,"UniformToFill",2),Nc=new Ae(Ne,"CycleAll",10),zg=new Ae(Ne,"CycleNotDirected",11),Zg=new Ae(Ne,"CycleNotDirectedFast",12),Gg=new Ae(Ne,"CycleNotUndirected",13),Hg=new Ae(Ne,"CycleDestinationTree",14),Wg=new Ae(Ne,"CycleSourceTree",15),bh=new Ae(Ne,"DocumentScroll",1),Bc=new Ae(Ne,"InfiniteScroll",2),Nh=new Ae(Ne,"TreeParentCollapsed",21),pa=new Ae(Ne,"AllParentsCollapsed",22),Ff=new Ae(Ne,"AnyParentsCollapsed",23),Vg=new un,Kd="2.3.10",Ud="image",Ac=null,lm=!1;function rs(){if(Qo){var a=$e.document.createElement("canvas"),y=a.getContext("2d"),x=oi("7ca11abfd022028846");y[x]=oi("398c3597c01238");for(var E=["5da73c80a36455d7038e4972187c3cae51fd22",Gn.Dx+"4ae6247590da4bb21c324ba3a84e385776",oe.xF+"fb236cdfda5de14c134ba1a95a2d4c7cc6f93c1387",_t.za],b=1;5>b;b++)y[oi("7ca11abfd7330390")](oi(E[b-1]),10,15*b);for(y[x]=oi("39f046ebb36e4b"),x=1;5>x;x++)y[oi("7ca11abfd7330390")](oi(E[x-1]),10,15*x);(E.length!==4||E[0][0]!=="5"||E[3][0]!=="7")&&(oe.prototype.Cd=oe.prototype.Eu),Ac=a}}Ne.className="Diagram",Ne.fromDiv=function(a){var y=a;return typeof a=="string"&&(y=$e.document.getElementById(a)),y instanceof HTMLDivElement&&y.H instanceof Ne?y.H:null},Ne.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},Ne.useDOM=function(a){Qo=a?$e.document!==void 0:!1},Ne.isUsingDOM=function(){return Qo},Ne.None=hs,Ne.Uniform=sl,Ne.UniformToFill=hd,Ne.CycleAll=Nc,Ne.CycleNotDirected=zg,Ne.CycleNotDirectedFast=Zg,Ne.CycleNotUndirected=Gg,Ne.CycleDestinationTree=Hg,Ne.CycleSourceTree=Wg,Ne.DocumentScroll=bh,Ne.InfiniteScroll=Bc,Ne.TreeParentCollapsed=Nh,Ne.AllParentsCollapsed=pa,Ne.AnyParentsCollapsed=Ff;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=$e[oi("76a715b2f73f148a")][oi("72ba13b5")]||"";if(a.Rc=!0,Qo){var E=Ne[oi("76a115b6ed251eaf4692")];if(E)for(var b=Vg.iterator;b.next()&&(E=b.value,E=oi(E).split(oi("39e9")),!(6>E.length));){var z=oi(E[1]).split(".");if(E[4]!=="7da71ca0")break;var tt=oi(Gn[oi("6cae19")]).split(".");if(z[0]>tt[0]||z[0]===tt[0]&&z[1]>=tt[1]){var rt=$e[oi("74a900bae4370f8b51")][oi("6fbb13a1c2311e8a57")].toLowerCase();if(tt=rt[oi("73a612b6fb191d")](oi("3aad1ab6e022098b4dc4")),z=oi(E[2]),-1<tt&&(rt=rt[oi("73a612b6fb191d")](z.toLowerCase()+"/"),a.Rc=!(-1<rt&&rt<tt),!a.Rc))break;for(tt=x[oi("76ad18b4f73e")],rt=x[oi("73a612b6fb191d")](oi("35e7"))+2;rt<tt;rt++)y+=x[rt];if(tt=y[oi("73a612b6fb191d")](z),0>tt&&z!==oi("7da71ca0ad381e90")&&(tt=y[oi("73a612b6fb191d")](oi("76a715b2ef3e149757"))),0>tt&&(tt=y[oi("73a612b6fb191d")](oi("76a715b2ef3e149757"))),0>tt&&(tt=y[oi("73a612b6fb191d")](oi("2bfa41fdb3784bca12"))),0>tt&&(tt=x[oi("73a612b6fb191d")](oi("7baa19a6f76c1988428554"))),a.Rc=!(0<=tt&&tt<y[oi("73a612b6fb191d")](oi("35"))||y[oi("73a612b6fb191d")](oi("35"))===-1),!a.Rc||x[oi("73a612b6fb191d")](oi("7fb002b6ed25128b4da25b2e"))&&(a.Rc=!(-1<x[oi("73a612b6fb191d")](z)),!a.Rc)||(tt=$e[oi("76a715b2f73f148a")][oi("69ad17a1e03e")],rt=tt[oi("73a612b6fb191d")](oi("7fb002b6ed25128b4da25b2e")),-1<rt&&(a.Rc=!(tt[oi("73a612b6fb191d")](z)>rt),!a.Rc)))break;if(z[0]==="#"){tt=$e.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[oi("79a417a0f0181a8946")]=E,$e.document[oi("78a712aa")]){$e.document[oi("78a712aa")][oi("7bb806b6ed32388c4a875b")](tt),ot=$e.getComputedStyle(tt).getPropertyValue(oi("78a704b7e62456904c9b12701b6532a8"));var lt=$e.getComputedStyle(tt).getPropertyValue(oi("75b817b0ea2202"));if($e.document[oi("78a712aa")][oi("68ad1bbcf533388c4a875b")](tt),ot){if(tt=$e[oi("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(oi("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[oi("76ad18b4f73e")],b=x[oi("73a612b6fb191d")](oi("35e7"))+2;b<ut;b++)y+=x[b];x=y[oi("73a612b6fb191d")](oi("7da71ca0ad381e90")),a.Rc=!(0<=x&&x<y[oi("73a612b6fb191d")](oi("35")))}}}return 0<a.Rc&&a!==a.wy}um.className="DiagramHelper";function lh(a){this.j=a===void 0?new Tt:a,this.o=new Tt}Ue.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 en(NaN,NaN).freeze(),this.gridSnapCellSpot=_r,this.gridSnapOrigin=new Tt(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"||$e.Element&&a instanceof Element)var x=Ne.call(this,a)||this;else x=Ne.call(this)||this,y=a;return dt(x),y&&x.nm(y),x}Ee(ct,Ne);function dt(a){a.allowDragOut=!0,a.allowMove=!1,a.isReadOnly=!0,a.contentAlignment=$r,a.layout=new Va}ct.prototype.reset=function(){Ne.prototype.reset.call(this),dt(this)},ct.className="Palette";function mt(a,y){if(typeof a=="string"||$e.Element&&a instanceof Element)var x=Ne.call(this,a)||this;else x=Ne.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 Ti;var b=new gr;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 dr(0,0,0,0),x.pa.h(0,0),x.toolManager.gb("Dragging",new Vt,x.toolManager.mouseMoveTools),x.click=function(){var z=E.observed;if(z!==null){var tt=z.viewportBounds,rt=E.lastInput.documentPoint;z.position=new Tt(rt.x-tt.width/2,rt.y-tt.height/2)}},x.Pf=function(){E.Ya(),Ot(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&&Ot(E)},x.autoScale=sl,x.vb=!1,y&&Object.assign(x,y),x}Ee(mt,Ne),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 Rl(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),Lt(this)}finally{this.ta=a,this.ib=y}}}Ne.prototype.redraw.call(this)},mt.prototype.gc=function(){if(this.Ka===null&&Qt("No div specified"),this.ta===null&&Qt("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?Lt(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 Lt(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=Oe.alloc().assign(a.viewportBounds).ed(y.viewportBounds),Mu(y,b),Oe.free(b),ts(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),gt=ot.scale,yt=Oe.alloc(),xt=rt.Pa.s,Ct=xt.length,bt=0;bt<Ct;bt++){var Wt=xt[bt];(E||Wt!==lt)&&rt.Oj(b,Wt,ot,null,gt,yt,!1)}Oe.free(yt),b.globalAlpha=ut}}}}}function Ot(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=en.alloc();b.h(x.width,x.height),E.desiredSize=b,en.free(b),a=2/a.scale,E instanceof gr&&(E.strokeWidth=a),y.location=new Tt(x.x-a/2,x.y-a/2),y.isSelected=!0}}}mt.prototype.computeBounds=function(){var a=this.observed;if(a===null)return Ia;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(),Ot(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))},Ue.Object.defineProperties(mt.prototype,{observed:{get:function(){return this.V},set:function(a){var y=this.V;if(a instanceof mt&&Qt("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),Ot(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),Ot(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 Vt(){Oo.call(this),this.j=null}Ee(Vt,Oo),Vt.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 Tt(x.width/2,x.height/2),a=a.firstInput.documentPoint,y.position=new Tt(a.x-this.j.x,a.y-this.j.y)),!0)},Vt.prototype.doActivate=function(){this.j=null,Oo.prototype.doActivate.call(this)},Vt.prototype.doUpdateCursor=function(){var a=this.diagram,y=a.box;y!==null&&y.cursor&&(a.currentCursor=y.cursor)},Vt.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 Tt(E.x-x.x,E.y-x.y)}a=a.lastInput.documentPoint,y.position=new Tt(a.x-this.j.x,a.y-this.j.y)}}},Vt.className="OverviewDraggingTool";function Ht(){Gi(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=Ia,this.hb=!0,this.cg=null,this.ob=200}Ht.prototype.toString=function(){return"CommandHandler"},Ht.prototype.Xe=function(a){this.H=a},Ht.prototype.doKeyDown=function(){var a=this.diagram,y=a.lastInput,x=Mr?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()},Ht.prototype.doKeyUp=function(){this.diagram.lastInput.bubbles=!0},Ht.prototype.stopCommand=function(){var a=this.diagram,y=a.currentTool;y instanceof Br&&a.allowSelect&&a.clearSelection(),y!==null&&y.doCancel()},Ht.prototype.canStopCommand=function(){return!0},Ht.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=""}},Ht.prototype.canSelectAll=function(){return this.diagram.allowSelect},Ht.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 vn,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=""}},Ht.prototype.canDeleteSelection=function(){var a=this.diagram;return!(a.isReadOnly||a.isModelReadOnly||!a.allowDelete||a.selection.count===0)},Ht.prototype.copySelection=function(){var a=this.diagram,y=new vn;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)},Ht.prototype.canCopySelection=function(){var a=this.diagram;return!!(a.allowCopy&&a.allowClipboard&&a.selection.count!==0)},Ht.prototype.cutSelection=function(){this.copySelection(),this.deleteSelection()},Ht.prototype.canCutSelection=function(){var a=this.diagram;return!!(!a.isReadOnly&&!a.isModelReadOnly&&a.allowCopy&&a.allowDelete&&a.allowClipboard&&a.selection.count!==0)},Ht.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 un,x.addAll(z),Vd=x,ud=y.model.dataFormat}}y.R("ClipboardChanged",x)},Ht.prototype.pasteFromClipboard=function(){var a=new vn,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},Ht.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 Tt(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=""}},Ht.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)},Ht.prototype.undo=function(){this.diagram.undoManager.undo()},Ht.prototype.canUndo=function(){var a=this.diagram;return a.isReadOnly||a.isModelReadOnly?!1:a.allowUndo&&a.undoManager.canUndo()},Ht.prototype.redo=function(){this.diagram.undoManager.redo()},Ht.prototype.canRedo=function(){var a=this.diagram;return a.isReadOnly||a.isModelReadOnly?!1:a.allowUndo&&a.undoManager.canRedo()},Ht.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))},Ht.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)},Ht.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))},Ht.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)},Ht.prototype.resetZoom=function(a){a===void 0&&(a=this.defaultScale);var y=this.diagram;a<y.minScale||a>y.maxScale||(y.scale=a)},Ht.prototype.canResetZoom=function(a){a===void 0&&(a=this.defaultScale);var y=this.diagram;return a<y.minScale||a>y.maxScale?!1:y.allowZoom},Ht.prototype.zoomToFit=function(){var a=this.diagram,y=a.animationManager;y.Cc(),a.redraw();var x=a.position,E=a.scale;ju(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=Ia):(this.Jt=E,this.sw=x.copy(),a.zoomToFit(),this.Au=a.scale,this.yu=a.documentBounds.copy()),hf(y)},Ht.prototype.canZoomToFit=function(){return this.diagram.allowZoom},Ht.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;ju(x,"Scroll To Part");var E=this.scrollToPartPause;if(0<E){var b=se(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 qn&&ot.isTreeExpanded&&(!(ot instanceof nr)||ot.isSubGraphExpanded);)ot=b.pop();0<b.length?(ot instanceof Ti&&y.tv(ot.actualBounds),ot instanceof qn&&!ot.isTreeExpanded&&(ot.isTreeExpanded=!0),ot instanceof nr&&!ot.isSubGraphExpanded&&(ot.isSubGraphExpanded=!0)):(ot instanceof Ti&&y.es(ot.actualBounds),y.am("LayoutCompleted",tt)),y.eb("Scroll To Part")},tt=function(){ji(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 se(a,y,x){if(y.isVisible())return x;if(y instanceof Qr)se(a,y.adornedPart,x);else if(y instanceof kn){var E=y.fromNode;E!==null&&se(a,E,x),y=y.toNode,y!==null&&se(a,y,x)}else y instanceof qn&&(E=y.labeledLink,E!==null&&se(a,E,x),E=y.pg(),E!==null&&(E.isTreeExpanded||E.wasTreeExpanded||x.push(E),se(a,E,x))),y=y.containingGroup,y!==null&&(y.isSubGraphExpanded||y.wasSubGraphExpanded||x.push(y),se(a,y,x));return x}Ht.prototype.canScrollToPart=function(a){return a===void 0&&(a=null),a!==null&&!(a instanceof Ti)?!1:(a=this.diagram,a.selection.count===0&&a.highlighteds.count===0?!1:a.allowHorizontalScroll&&a.allowVerticalScroll)},Ht.prototype.collapseTree=function(a){a===void 0&&(a=null);var y=this.diagram;try{y.Ea("Collapse Tree"),ju(y.animationManager,"Collapse Tree");var x=new un;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 qn&&b.isTreeExpanded&&(b.collapseTree(),x.add(b))}y.R("TreeCollapsed",x)}finally{y.eb("Collapse Tree")}},Ht.prototype.canCollapseTree=function(a){a===void 0&&(a=null);var y=this.diagram;if(y.isReadOnly)return!1;if(a!==null){if(!(a instanceof qn&&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 qn&&y.isTreeExpanded&&0<y.Qo().count)return!0;return!1},Ht.prototype.expandTree=function(a){a===void 0&&(a=null);var y=this.diagram;try{y.Ea("Expand Tree"),ju(y.animationManager,"Expand Tree");var x=new un;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 qn&&!b.isTreeExpanded&&(b.expandTree(),x.add(b))}y.R("TreeExpanded",x)}finally{y.eb("Expand Tree")}},Ht.prototype.canExpandTree=function(a){a===void 0&&(a=null);var y=this.diagram;if(y.isReadOnly)return!1;if(a!==null){if(!(a instanceof qn)||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 qn&&!y.isTreeExpanded&&0<y.Qo().count)return!0;return!1},Ht.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 un,z=a.selection.iterator;z.next();){var tt=z.value;tt.Zc()&&tt.canGroup()&&b.add(tt)}for(var rt=new un,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 gt=rt.first().containingGroup;if(gt!==null)for(;gt!==null;){b=!1;for(var yt=rt.iterator;yt.next();)if(!yt.value.Td(gt)){b=!0;break}if(b)gt=gt.containingGroup;else break}if(x instanceof nr)jl(x),E=x.copy(),E!==null&&a.add(E);else if(y.Yu(x)){var xt=y.copyNodeData(x);ze(xt)&&(y.xf(xt),E=a.ii(xt))}if(E!==null){gt!==null&&this.isValidMember(gt,E)&&(E.containingGroup=gt);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=""}}}},Ht.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 We(a){var y=Jn();for(a=a.iterator;a.next();){var x=a.value;x instanceof kn||y.push(x)}a=new vn,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 ii(y),a}Ht.prototype.isValidMember=function(a,y){if(y===null||a===y||y instanceof kn)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},Ht.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 un;if(a!==null)E.add(a);else for(var b=y.selection.iterator;b.next();){var z=b.value;z instanceof nr&&z.canUngroup()&&E.add(z)}var tt=new un;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 gt=tt.iterator;gt.next();){var yt=gt.value;if(yt.isSelected=!0,!(yt instanceof kn)){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=""}},Ht.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 nr))return!1;if(a.canUngroup())return!0}else for(a=y.selection.iterator;a.next();)if(y=a.value,y instanceof nr&&y.canUngroup())return!0;return!1},Ht.prototype.addTopLevelParts=function(a,y){var x=!0;for(a=We(a).iterator;a.next();){var E=a.value;E.containingGroup!==null&&(!y||this.isValidMember(null,E)?E.containingGroup=null:x=!1)}return x},Ht.prototype.collapseSubGraph=function(a){a===void 0&&(a=null);var y=this.diagram;try{y.Ea("Collapse SubGraph"),ju(y.animationManager,"Collapse SubGraph");var x=new un;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 nr&&b.isSubGraphExpanded&&(b.collapseSubGraph(),x.add(b))}y.R("SubGraphCollapsed",x)}finally{y.eb("Collapse SubGraph")}},Ht.prototype.canCollapseSubGraph=function(a){a===void 0&&(a=null);var y=this.diagram;if(y.isReadOnly)return!1;if(a!==null)return!!(a instanceof nr&&a.isSubGraphExpanded);for(a=y.selection.iterator;a.next();)if(y=a.value,y instanceof nr&&y.isSubGraphExpanded)return!0;return!1},Ht.prototype.expandSubGraph=function(a){a===void 0&&(a=null);var y=this.diagram;try{y.Ea("Expand SubGraph"),ju(y.animationManager,"Expand SubGraph");var x=new un;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 nr&&!b.isSubGraphExpanded&&(b.expandSubGraph(),x.add(b))}y.R("SubGraphExpanded",x)}finally{y.eb("Expand SubGraph")}},Ht.prototype.canExpandSubGraph=function(a){a===void 0&&(a=null);var y=this.diagram;if(y.isReadOnly)return!1;if(a!==null)return a instanceof nr&&!a.isSubGraphExpanded;for(a=y.selection.iterator;a.next();)if(y=a.value,y instanceof nr&&!y.isSubGraphExpanded)return!0;return!1},Ht.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 To&&z.editable})}a!==null&&(y.currentTool=null,x.textBlock=a,y.currentTool=x)}},Ht.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 To))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 To&&x.editable}),a!==null))return!0;return!1},Ht.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 fe?b=a.ga(cr):y.viewportBounds.ca(E.documentPoint)||(b=y.viewportBounds,b=new Tt(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)}},Ht.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)},Ht.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();)Gu(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 kn&&(y=a.fromNode,y===null||E.contains(y)?(y=a.toNode,y===null||E.contains(y)||E.remove(a)):E.remove(a));return E},Ue.Object.defineProperties(Ht.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||Qt("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}}}),Ht.className="CommandHandler",Jp=function(){return new Ht};function fe(){Gi(this),this.l=30723,this.pb=1,this.bn="",this.Ma=this.Me=null,this.pa=new Tt(NaN,NaN).freeze(),this.jd=po,this.Ab=new oe,this.wh=new oe,this.Lb=null,this.Ca=this.Kk=1,this.Kb=0,this.Kg=ca,this.uc=new Oe(NaN,NaN,NaN,NaN).freeze(),this.Ib=new Oe(NaN,NaN,NaN,NaN).freeze(),this.dc=new Oe(0,0,NaN,NaN).freeze(),this.ba=this.Yn=this.Zn=null,this.sk=this.Jb=xa,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,ln,Mi,Bi,_i,rr,jr,xr,Kr,Eo;fe.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=Nn(this.Dh)),this.tb!==null&&(a.tb=this.tb.copy())},fe.prototype.Vw=function(a){var y=this.Dh;if(hn(y)){for(var x=0;x<y.length;x++)if(y[x]===a)return}else this.Dh=y=[];y.push(a)},fe.prototype.Af=function(a){a.Zn=null,a.Ng=null,a.v()},fe.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},fe.prototype.copy=function(){return this.clone()},wt=fe.prototype,wt.qb=function(a){a.classType===kn?a.name.indexOf("Orient")===0?this.segmentOrientation=a:Qt("Unknown Link enum value for GraphObject.segmentOrientation property: "+a):a.classType===fe&&(this.stretch=a)},wt.toString=function(){return hi(this.constructor)+"#"+Oi(this)},wt.th=function(){this.A!==null&&(this.A.nc=!0)};function yr(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===pr&&Ua(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 qa,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()):(ju(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(pr,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 oe);var z=this.Lb;z.reset(),this.no(z,a,y,x,E),z.pp(b)}};function ka(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=Tt.alloc();y.assign(a),this.transform.Ga(y);var x=this.actualBounds;if(!x.w())return Tt.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=Or(x.x-tt*ot,x.y-tt*ot,x.width+z*ot,x.height+z*ot,y.x,y.y),Tt.free(y),a}return b=!1,(this instanceof Qr||this instanceof gr?Or(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)),Tt.free(y),b},wt.gh=function(a){var y=this.naturalBounds;return Or(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=Oe.allocAt(0,0,y.width,y.height);var x=this.transform,E=!1,b=Tt.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)))),Tt.free(b),Oe.free(y),E},wt.fh=function(a,y){if(y===void 0)return a.Re(this.actualBounds);var x=this.naturalBounds,E=!1,b=Tt.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)))),Tt.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=Tt.allocAt(0,0),b=Tt.allocAt(0,x.height),z=Tt.allocAt(x.width,x.height),tt=Tt.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=Oe.allocAt(0,0,x.width,x.height);var ot=Tt.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)))),Tt.free(ot),Oe.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 Tt.free(E),Tt.free(b),Tt.free(z),Tt.free(tt),rt},wt.ga=function(a,y){if(y===void 0&&(y=new Tt),a instanceof yi){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 Oe);var y=this.naturalBounds,x=this.oe,E=Tt.allocAt(0,0).transform(x);return a.h(E.x,E.y,0,0),E.h(y.width,0).transform(x),zr(a,E.x,E.y,0,0),E.h(y.width,y.height).transform(x),zr(a,E.x,E.y,0,0),E.h(0,y.height).transform(x),zr(a,E.x,E.y,0,0),Tt.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 Tt),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,gt=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+gt,a=a*ot+y*ut+yt,y=x*rt+E*lt+gt,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)},fe.prototype.measure=function(a,y,x,E){if(ul(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(Ts(this,!0)){case ln: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 Bi:isFinite(a)&&a>x&&(b=a),tt=0,rt&&(y=1/0);break;case _i: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()||Qt("Non-real measuredBounds has been set. Object "+this+", measuredBounds: "+this.uc.toString()),ma(this,!1)}},fe.prototype.Wl=function(){},fe.prototype.Dd=function(){return!1},fe.prototype.arrange=function(a,y,x,E,b){this.Uk();var z=Oe.alloc();z.assign(this.Ib),this.Ib.ka(),Ss(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 To&&(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()||Qt("Non-real actualBounds has been set. Object "+this+", actualBounds: "+this.Ib.toString()),this.Xl(z,this.Ib),Hu(this,!1),Oe.free(z)},wt=fe.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=Ts(a,!0),x===E&&z===b&&(y=ln),y){case ln:(x>E||z>b)&&(ma(a,!0),a.measure(x>E?E:x,z>b?b:z,0,0));break;case Sn:ma(a,!0),a.measure(E,b,0,0);break;case Bi:ma(a,!0),a.measure(E,z,0,0);break;case _i:ma(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 qn&&H1(a,this))},wt.gc=function(a,y){if(!Pl(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&&(ta(this,a,lt,!0,!0,ot,rt),lt instanceof vo&<.type===El?(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&&(ta(this,a,ut,!0,!1,ot,rt),ut instanceof vo&&ut.type===El?(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&&Wa(this),lt=this.part,ot=!1;var gt=0;lt&&y.Gf("drawShadows")&&(ot=lt.isShadowed)&&(ut=lt.shadowOffset,gt=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,Wt=yt.dx,Zt=yt.m12,$t=yt.m22,ne=yt.dy,re,de=re=0;yt=re*Ct+de*bt+Wt;var Fe=re*Zt+de*$t+ne;re=xt.width+gt,de=0;var Wn=re*Ct+de*bt+Wt;re=re*Zt+de*$t+ne,de=Math.min(yt,Wn);var mi=Math.min(Fe,re),ui=Math.max(yt+0,Wn)-de,Fn=Math.max(Fe+0,re)-mi;yt=de,Fe=mi,re=xt.width+gt,de=xt.height+gt,Wn=re*Ct+de*bt+Wt,re=re*Zt+de*$t+ne,de=Math.min(yt,Wn),mi=Math.min(Fe,re),ui=Math.max(yt+ui,Wn)-de,Fn=Math.max(Fe+Fn,re)-mi,yt=de,Fe=mi,re=0,de=xt.height+gt,Wn=re*Ct+de*bt+Wt,re=re*Zt+de*$t+ne,de=Math.min(yt,Wn),mi=Math.min(Fe,re),ui=Math.max(yt+ui,Wn)-de,Fn=Math.max(Fe+Fn,re)-mi,yt=de,Fe=mi,gt=y.viewportBounds,xt=gt.x,Ct=gt.y,yt=!(yt>gt.width+xt||xt>ui+yt||Fe>gt.height+Ct||Ct>Fn+Fe)}if(yt){if(yt=(this.l&256)!==0,a.clipInsteadOfFill&&(yt=!1),this instanceof To&&(a.font=this.font),yt){if(Fe=rt.se()?rt.naturalBounds:rt.actualBounds,ui=Math.max(tt.x,Fe.x),Fn=Math.max(tt.y,Fe.y),gt=Math.min(tt.right,Fe.right)-ui,xt=Math.min(tt.bottom,Fe.bottom)-Fn,Ct=this.tb,Ct!==null&&(ui=Ct.x,Fn=Ct.y,gt=Ct.width,xt=Ct.height),ui>tt.width+tt.x||tt.x>Fe.width+Fe.x){x!==1&&(a.globalAlpha=E),this.filter!==""&&(a.filter=b);return}a.save(),a.beginPath(),a.rect(ui,Fn,gt,xt),a.clip()}if(ut){if(!lt.isVisible()){x!==1&&(a.globalAlpha=E),this.filter!==""&&(a.filter=b);return}ot&&(Fe=lt.shadowOffset,a.Ev(Fe.x*y.scale*this.scale*y.Mb,Fe.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&&Wu(a),lt=this.naturalBounds,this.areaBackground!==null&&(a.yc(),ll(this,a,lt,tt)),a.transform(z.m11,z.m12,z.m21,z.m22,z.dx,z.dy),ot&&za(this,rt)&&this.shadowVisible===null&&Wu(a),this.Ma!==null&&(a.yc(),Gs(this,a,lt,tt)),ot&&(this.Ma!==null||this.areaBackground!==null||za(this,rt))?(ql(this,!0),this.shadowVisible===null&&Wu(a)):ql(this,!1),this.hh(a,y),ot&&this.l&512&&uh(a),ut&&ot&&Wu(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 za(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 ll(a,y,x,E){ta(a,y,a.areaBackground,!0,!0,x,E),a.areaBackground instanceof vo&&a.areaBackground.type===El?(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 Gs(a,y,x,E){var b=a.kq(),z=x.x,tt=x.y,rt=x.width+b,ot=x.height+b;ta(a,y,a.Ma,!0,!1,x,E),a.Ma instanceof vo&&a.Ma.type===El?(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 os(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 Pl(a,y,x){if(!(y instanceof Qs))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&&os(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 To&&(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&&Wa(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],ll(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]),Gs(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],Gs(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&&Wu(y),b=a.panel,rt&&za(a,b)&&a.shadowVisible===null&&Wu(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||za(a,b))?(ql(a,!0),a.shadowVisible===null&&Wu(y)):ql(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),As(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()&&Wu(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&&os(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"+ko++,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"),As(a,E)};function As(a,y){y=y.getAttribute("clip-path"),y!==null&&(a=a.svg.getElementById(y.split("#")[1].slice(0,-1)),a!==null&&a.remove())}function as(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 Os){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 gr){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],ll(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]),Gs(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 ta(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===Tf||x.yk===rt&&x.ft===ot))var ut=x.xe;else{var gt=0,yt=0,xt=0,Ct=0,bt=0,Wt=0;if(Wt=bt=0,b?(bt=tt.x,Wt=tt.y):E||(bt-=lt/2,Wt-=lt/2),gt=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,gt+=bt,xt+=bt,yt+=Wt,Ct+=Wt,x.type===dh)ut=y.createLinearGradient(gt,yt,xt,Ct);else if(x.type===El)Wt=isNaN(x.endRadius)?Math.max(rt,ot)/2:x.endRadius,isNaN(x.startRadius)?(bt=0,Wt=Math.max(rt,ot)/2):bt=x.startRadius,ut=y.createRadialGradient(gt,yt,bt,xt,Ct,Wt);else if(x.type===Tf)try{ut=y.createPattern(x.pattern,"repeat")}catch($t){ut=null}if(x.type!==Tf&&(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===Tf&&x.yk!==-1)){x.yk=-1;var Zt=a.diagram;Zt!==null&&x.yk===-1&&ji(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 Wa(a){if(a.l&2048){var y=a.Ab;if(y.reset(),!a.Ib.w()||!a.uc.w()){_l(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)}_l(a,!1),wl(a,!0)}a.l&4096&&(y=a.panel,y===null?(a.wh.set(a.Ab),a.Kk=a.scale,wl(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,wl(a,!1)))}wt.no=function(a,y,x,E,b){if(this.Ca!==1&&a.scale(this.Ca),this.Kb!==0){var z=Tt.alloc();z.yi(y,x,E,b,cr),a.rotate(this.Kb,z.x,z.y),Tt.free(z)}},wt.v=function(a){if(!ul(this)){a===void 0&&(a=!1),ma(this,!0),Hu(this,!0);var y=this.panel;y===null||a||y.v()}},wt.Uj=function(){ul(this)||(ma(this,!0),Hu(this,!0))};function ys(a){if(!Ss(a)){var y=a.panel;y!==null?y.v():a.Dd()&&(y=a.diagram,y!==null&&(y.De.add(a),a instanceof qn&&a.Bd(),y.$b())),Hu(a,!0)}}wt.Uk=function(){!(this.l&2048)&&(_l(this,!0),wl(this,!0))},wt.Wu=function(){wl(this,!0)},wt.N=function(){var a=this.part;a!==null&&a.N()};function Ts(a,y){var x=a.stretch,E=a.panel;return E!==null&&E.type===wn.Table?fu(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,ln,y):Za(a,x,y)):Za(a,ln,y):Za(a,x,y)}function fu(a,y,x,E){var b=a.stretch;if(b!==rr)return Za(a,b,E);var z=b=null;switch(y.stretch){case _i:z=!0;break;case Sn:z=!0}switch(x.stretch){case Bi:b=!0;break;case Sn:b=!0}return y=a.panel.defaultStretch,b===null&&(b=y===Bi||y===Sn),z===null&&(z=y===_i||y===Sn),b===!0&&z===!0?Za(a,Sn,E):b===!0?Za(a,Bi,E):z===!0?Za(a,_i,E):Za(a,ln,E)}function Za(a,y,x){if(x)return y;if(y===ln||(x=a.desiredSize,x.w()))return ln;if(a=a.angle,!isNaN(x.width))if(a!==90&&a!==270){if(y===Bi)return ln;if(y===Sn)return _i}else{if(y===_i)return ln;if(y===Sn)return Bi}if(!isNaN(x.height))if(a!==90&&a!==270){if(y===_i)return ln;if(y===Sn)return Bi}else{if(y===Bi)return ln;if(y===Sn)return _i}return y}function ql(a,y){a.l=y?a.l|512:a.l&-513}function Ua(a){return(a.l&1024)!==0}function Dc(a,y){a.l=y?a.l|1024:a.l&-1025}function _l(a,y){a.l=y?a.l|2048:a.l&-2049}function wl(a,y){a.l=y?a.l|4096:a.l&-4097}function ul(a){return(a.l&8192)!==0}function ma(a,y){a.l=y?a.l|8192:a.l&-8193}function Ss(a){return(a.l&16384)!==0}function Hu(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,ys(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 qn&&(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 qn?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 sa(a,y,x,E):b=a,b.xd=this,a=this.ih(),a!==null&&c1(a)&&Qt("Cannot add a Binding to a template that has already been copied: "+b),this.localBindings===null&&(this.localBindings=new un),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 Cl(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=Mf.I(a);typeof z=="function"?(x=Nn(arguments),E=z(x),ze(E)||Qt('GraphObject.make invoked object builder "'+a+'", but it did not return an Object')):b=$e.go[a]}if(E===null&&(b!=null&&b.constructor||Qt("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 Ne&&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?Qt("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 To)a.text=y;else if(a instanceof gr)a.figure=y;else if(a instanceof Os)a.source=y;else if(a instanceof wn)y=tu.I(y),y!==null&&(a.type=y);else if(a instanceof vo){var x=ri(vo,y);x!==null?a.type=x:Qt("Unknown Brush type as an argument to GraphObject.make: "+y)}else a instanceof ce?(y=ri(ce,y),y!==null&&(a.type=y)):a instanceof Vi&&(y=ri(Vi,y),y!==null&&(a.type=y));else if(y instanceof fe)a instanceof wn||Qt("A GraphObject can only be added to a Panel, not to: "+a),a.add(y);else if(y instanceof va){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 va?km(E,y):Qt("A RowColumnDefinition can only be added to an object that implements getRowDefinition/getColumnDefinition, not to: "+a)}else if(y instanceof Ae)typeof a.qb=="function"&&a.qb(y);else if(y instanceof wa)a.type=y;else if(y instanceof sa)a instanceof fe||a instanceof va?a.bind(y):Qt("A Binding can only be applied to a GraphObject or RowColumnDefinition, not to: "+a);else if(y instanceof Ql)a instanceof fe?a.Jv(y):Qt("An AnimationTrigger can only be applied to a GraphObject, not to: "+a);else if(y instanceof Ir)a instanceof ce&&a.type===ce.o?a.figures.add(y):Qt("A PathFigure can only be added to a Path Geometry, not to: "+a);else if(y instanceof Vi)a instanceof Ir?a.segments.add(y):Qt("A PathSegment can only be added to a PathFigure, not to: "+a);else if(y instanceof Ko)a instanceof Ne||a instanceof nr?a.layout=y:Qt("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 vo){x=new fi;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 va){y.row!==void 0?(b=y.row,(b==null||b===1/0||isNaN(b)||0>b)&&Qt("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)&&Qt("Must specify non-negative integer column for RowColumnDefinition "+y+", not: "+b),a.isRow=!1,a.index=b),b=new fi;for(x in y)x!=="row"&&x!=="column"&&(b[x]=y[x]);Zd(a,b)}else Zd(a,y);else Qt('Unknown initializer "'+y+'" for object being constructed by GraphObject.make: '+a)}function Bh(a,y){Mf.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}Ue.Object.defineProperties(fe.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&&(yr(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&&(yr(this),this.A.Hb=a,this.g("enabledChanged",y,a))}},segmentOrientation:{get:function(){return this.Ua!==null?this.Ua.rr:ws},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===ws&&(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:Dn},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&&(yr(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&&(yr(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)&&bn(a,"0 <= value <= 1",fe,"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 vo&&a.freeze(),yr(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 vo&&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 Ti)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 Tt(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&&Qt("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 gr&&this.qc(),this.g("desiredSize",E,a),Ua(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 en(a,this.jd.height).freeze(),this.v(),this instanceof gr&&this.qc(),this.g("desiredSize",y,a),Ua(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 en(this.jd.width,a).freeze(),this.v(),this instanceof gr&&this.qc(),this.g("desiredSize",y,a),Ua(this)&&(a=this.part,a!==null&&Ho(this,a,"height")))}},minSize:{get:function(){return this.A!==null?this.A.u:Qi},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(),yr(this),this.A.u=a,this.v(),this.g("minSize",y,a))}},maxSize:{get:function(){return this.A!==null?this.A.o:qr},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(),yr(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 dr(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&&Wa(this),this.Ab}},oe:{get:function(){return this.l&4096&&Wa(this),this.wh}},animationTriggers:{get:function(){return this.A!==null?this.A.hb:null},set:function(a){this.animationTriggers!==a&&(yr(this),this.A.hb=a)}},reshapingBehavior:{get:function(){return this.A!==null?this.A.Pf:ln},set:function(a){this.reshapingBehavior!==a&&(yr(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()&&Qt("GraphObject.alignment for "+this+" must be a real Spot or Spot.Default, not: "+a),this.Jb=a=a.J(),ys(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&&bn(a,">= 0",fe,"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&&bn(a,">= 1",fe,"columnSpan"),yr(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&&bn(a,">= 0",fe,"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&&bn(a,">= 1",fe,"rowSpan"),yr(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&&(yr(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 qn||Qt("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&&bn(a,">= 0",fe,"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&&bn(a,">= 0",fe,"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&&bn(a,">= 0",fe,"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&&bn(a,">= 0",fe,"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&&(yr(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&&(yr(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&&(yr(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&&(yr(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&&(yr(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&&(yr(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&&(yr(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&&(yr(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&&(yr(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&&(yr(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&&(yr(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&&(yr(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&&(yr(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&&(yr(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&&(yr(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&&(yr(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&&(yr(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&&(yr(this),this.A.Ch=a,this.g("contextMenu",y,a))}}}),fe.prototype.trigger=fe.prototype.Jv,fe.prototype.findBindingPanel=fe.prototype.ih,fe.prototype.findTemplateBinder=fe.prototype.pz,fe.prototype.setProperties=fe.prototype.nm,fe.prototype.apply=fe.prototype.apply,fe.prototype.attach=fe.prototype.Du,fe.prototype.set=fe.prototype.set,fe.prototype.isEnabledObject=fe.prototype.If,fe.prototype.isVisibleObject=fe.prototype.Ed,fe.prototype.isContainedBy=fe.prototype.rg,fe.prototype.getNearestIntersectionPoint=fe.prototype.rs,fe.prototype.getLocalPoint=fe.prototype.qs,fe.prototype.getDocumentScale=fe.prototype.Df,fe.prototype.getDocumentAngle=fe.prototype.li,fe.prototype.getDocumentBounds=fe.prototype.mi,fe.prototype.getDocumentPoint=fe.prototype.ga,fe.prototype.intersectsRect=fe.prototype.Yc,fe.prototype.containedInRect=fe.prototype.fh,fe.prototype.containsRect=fe.prototype.Re,fe.prototype.containsPoint=fe.prototype.ca,fe.prototype.raiseChanged=fe.prototype.g,fe.prototype.raiseChangedEvent=fe.prototype.cb,fe.prototype.addCopyProperty=fe.prototype.Vw;var Mf=null;fe.className="GraphObject",Mf=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=Cl(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"},Cl(gr,{name:"ButtonBorder",figure:"RoundedRectangle",spot1:new yi(0,0,2.76142374915397,2.761423749153969),spot2:new yi(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 gr)){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 gr&&(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 gr){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 gr){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 gr){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 gr))){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=Cl("Button",{_treeExpandedFigure:"MinusLine",_treeCollapsedFigure:"PlusLine"},Cl(gr,{name:"ButtonIcon",figure:"MinusLine",stroke:"#424242",strokeWidth:2,desiredSize:or},new sa("figure","isTreeExpanded",function(y,x){return x=x.panel,y?x._treeExpandedFigure:x._treeCollapsedFigure}).cp()),{visible:!1},new sa("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 qn){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=Cl("Button",{_subGraphExpandedFigure:"MinusLine",_subGraphCollapsedFigure:"PlusLine"},Cl(gr,{name:"ButtonIcon",figure:"MinusLine",stroke:"#424242",strokeWidth:2,desiredSize:or},new sa("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 nr){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 Cl(Qr,wn.Auto,{isShadowed:!0,shadowColor:"rgba(0, 0, 0, .4)",shadowOffset:new Tt(0,3),shadowBlur:5},Cl(gr,{name:"Border",figure:"RoundedRectangle",parameter1:1,parameter2:1,fill:"#F5F5F5",stroke:"#F0F0F0",spot1:new yi(0,0,4,6),spot2:new yi(1,1,-4,-4)}))}),Bh("ContextMenu",function(){return Cl(Qr,wn.Vertical,{background:"#F5F5F5",isShadowed:!0,shadowColor:"rgba(0, 0, 0, .4)",shadowOffset:new Tt(0,3),shadowBlur:5},new sa("background","",function(a){return a.adornedPart!==null&&a.placeholder!==null?null:"#F5F5F5"}))}),Bh("ContextMenuButton",function(){var a=Cl("Button");a.stretch=Bi;var y=a.fb("ButtonBorder");return y instanceof gr&&(y.figure="Rectangle",y.strokeWidth=0,y.spot1=new yi(0,0,2,3),y.spot2=new yi(1,1,-2,-2)),a}),Bh("PanelExpanderButton",function(a){var y=hm(a,"COLLAPSIBLE"),x=Cl("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},Cl(gr,{name:"ButtonIcon",strokeWidth:2},new sa("geometryString","visible",function(E){return E?x._buttonExpandedFigure:x._buttonCollapsedFigure}).cp(y)));return a=x.fb("ButtonBorder"),a instanceof gr&&(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=Cl("Button",{desiredSize:new en(14,14)},Cl(gr,{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:Mi,visible:!1},y!==""?new sa("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=Cl("CheckBoxButton",a,{name:"Button",isActionable:!1,margin:new dr(0,1,0,0)});var y=Cl(wn,"Horizontal",a,{isActionable:!0,cursor:a.cursor,margin:new dr(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}),fe.None=ln=new Ae(fe,"None",0),fe.Default=rr=new Ae(fe,"Default",0),fe.Vertical=_i=new Ae(fe,"Vertical",4),fe.Horizontal=Bi=new Ae(fe,"Horizontal",5),fe.Fill=Sn=new Ae(fe,"Fill",3),fe.Uniform=Mi=new Ae(fe,"Uniform",1),fe.UniformToFill=jr=new Ae(fe,"UniformToFill",2),fe.FlipVertical=xr=new Ae(fe,"FlipVertical",1),fe.FlipHorizontal=Kr=new Ae(fe,"FlipHorizontal",2),fe.FlipBoth=Eo=new Ae(fe,"FlipBoth",3),fe.make=Cl,fe.getBuilders=function(){var a=new be,y;for(y in Mf)if(y!==y.toLowerCase()){var x=Mf.I(y);typeof x=="function"&&a.add(y,x)}return a.freeze(),a},fe.defineBuilder=Bh,fe.build=function(a,y,x){for(var E=[],b=2;b<arguments.length;++b)E[b-2]=arguments[b];if(b=Mf.I(a),typeof b=="function"&&(E=b([a].concat(E)),E instanceof fe))return y&&E.set(y),E;Qt('GraphObject.build invoked object builder "'+a+'", but it did not return an Object')},fe.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=Qi,this.o=qr,this.hg=rr,this.ob=this.Bi=1,this.Pf=ln,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=Dn,this.rr=ws,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=xa,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?$e.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 Qs(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),ze(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},Ue.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 Qs(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=ko++,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=Qs.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),gt=x*Math.sin(E),yt=a+ut,xt=y+gt,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-gt]),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"+ko++,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')"),kf(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]},kf(this,"fill",a,this.rb),this.addElement("rect",a)},wt.ox=function(a,y,x,E){a={x:a,y,width:x,height:E},kf(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},kf(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 kf(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"+ko++,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=Nn(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,kf(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={},kf(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 Wu(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(){},Qs.prototype.rotate=function(a){this.rb.rotate(57.2958*a,0,0)},Qs.prototype.getImageData=function(){return null},Qs.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()))}Qs.prototype.Hs=function(a){a.svg!==null&&a.svg.parentNode===this.Nj&&a.svg.remove()},Qs.className="SVGContext",Ne.prototype.Cs=function(a){this.pj.contains("SVG")||this.bs("SVG",new bu(this,$e.document));var y=new bu(this,$e.document,!0);a===void 0&&(a=new fi);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)},Ne.prototype.makeSvg=Ne.prototype.Cs,Ne.prototype.av=function(a){return this.Cs(a)},Ne.prototype.makeSVG=Ne.prototype.av;function Rl(a,y,x,E){this.ownerDocument=y=y===void 0?$e.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}Rl.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},Rl.prototype.toDataURL=function(a,y){return this.Oa.toDataURL(a,y)},Rl.prototype.getBoundingClientRect=function(){return this.Oa.getBoundingClientRect()},Rl.prototype.focus=function(){this.Oa.focus()},Rl.prototype.mx=function(){this.ownerDocument=this.Oa.H=null},Ue.Object.defineProperties(Rl.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}}}),Rl.className="CanvasSurface";function Qd(a,y,x){this.Z=a.getContext?a.getContext("2d",y):null,this.Z===null&&Qt("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 oe,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 vo&&a.type===El){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(){},Ue.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 vo(a,y){Af||(hv(),Af=!0),Gi(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=$r,this.Lk=Yo):this.Lk=a===El?this.Qd=cr: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)}vo.prototype.copy=function(){var a=new vo;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=vo.prototype,wt.freeze=function(){return this._isFrozen=!0,this.we!==null&&this.we.freeze(),this},wt.ka=function(){return Object.isFrozen(this)&&Qt("cannot thaw constant: "+this),this._isFrozen=!1,this.we!==null&&this.we.ka(),this},wt.qb=function(a){a.classType===vo&&(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===El?a+"Radial ":this.type===Tf?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&&me(this),(typeof a!="number"||!isFinite(a)||1<a||0>a)&&bn(a,"0 <= loc <= 1",vo,"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&&me(this),a=a===void 0||typeof a!="number"?.2:a,y=y===void 0?Df:y,this.type===Ah)hh(this.color),this.color=Nf(a,y);else if((this.type===dh||this.type===El)&&this.colorStops!==null)for(var x=this.colorStops.iterator;x.next();)hh(x.value),this.addColorStop(x.key,Nf(a,y));return this};function qy(a,y,x){return y=y===void 0||typeof y!="number"?.2:y,x=x===void 0?Df:x,hh(a),Nf(y,x)}wt.Wy=function(a,y){if(this._isFrozen&&me(this),a=a===void 0||typeof a!="number"?.2:a,y=y===void 0?Df:y,this.type===Ah)hh(this.color),this.color=Nf(-a,y);else if((this.type===dh||this.type===El)&&this.colorStops!==null)for(var x=this.colorStops.iterator;x.next();)hh(x.value),this.addColorStop(x.key,Nf(-a,y));return this};function t1(a,y,x){return y=y===void 0||typeof y!="number"?.2:y,x=x===void 0?Df:x,hh(a),Nf(-y,x)}function ov(a,y,x){hh(a),a=Io.j;var E=Io.u,b=Io.o,z=Io.F;return hh(y),x===void 0&&(x=.5),"rgba("+Math.round((Io.j-a)*x+a)+", "+Math.round((Io.u-E)*x+E)+", "+Math.round((Io.o-b)*x+b)+", "+Math.round((Io.F-z)*x+z)+")"}wt.Gx=function(){if(this.type===Ah)return bf(this.color);if((this.type===dh||this.type===El)&&this.colorStops!==null){var a=this.colorStops;if(this.type===El)return bf(a.first().value);if(a.get(.5)!==null)return bf(a.get(.5));if(a.count===2)return a=a.Fa(),bf(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,bf(ov(a.get(x),a.get(E),1-z/b))}return!1};function bf(a){return a?a instanceof vo?a.Gx():(hh(a),128>(299*Io.j+587*Io.u+114*Io.o)/1e3):!1}function Nf(a,y){switch(y){case Df:y=100*sv(Io.j);var x=100*sv(Io.u),E=100*sv(Io.o);return xs.j=.4124564*y+.3575761*x+.1804375*E,xs.u=.2126729*y+.7151522*x+.072175*E,xs.o=.0193339*y+.119192*x+.9503041*E,xs.F=Io.F,y=uv(xs.j/Bf[0]),x=uv(xs.u/Bf[1]),E=uv(xs.o/Bf[2]),Vu.j=116*x-16,Vu.u=500*(y-x),Vu.o=200*(x-E),Vu.F=xs.F,Vu.j=Math.min(100,Math.max(0,Vu.j+100*a)),a=(Vu.j+16)/116,y=a-Vu.o/200,xs.j=Bf[0]*e1(Vu.u/500+a),xs.u=Bf[1]*(Vu.j>fm*dv?Math.pow(a,3):Vu.j/fm),xs.o=Bf[2]*e1(y),xs.F=Vu.F,a=-.969266*xs.j+1.8760108*xs.u+.041556*xs.o,y=.0556434*xs.j+-.2040259*xs.u+1.0572252*xs.o,Io.j=255*lv((3.2404542*xs.j+-1.5371385*xs.u+-.4985314*xs.o)/100),Io.u=255*lv(a/100),Io.o=255*lv(y/100),Io.F=xs.F,Io.j=Math.round(Io.j),255<Io.j?Io.j=255:0>Io.j&&(Io.j=0),Io.u=Math.round(Io.u),255<Io.u?Io.u=255:0>Io.u&&(Io.u=0),Io.o=Math.round(Io.o),255<Io.o?Io.o=255:0>Io.o&&(Io.o=0),"rgba("+Io.j+", "+Io.u+", "+Io.o+", "+Io.F+")";case n1:return av(),hl.o=Math.min(100,Math.max(0,hl.o+100*a)),"hsla("+hl.j+", "+hl.u+"%, "+hl.o+"%, "+hl.F+")";default:Qt("Unknown color space: "+y)}}function hh(a){Af||(hv(),Af=!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,Io.j=a[0],Io.u=a[1],Io.o=a[2],Io.F=a[3]/255):(y.fillStyle="#FFFFFF",y.fillStyle=a,Io.j=0,Io.u=0,Io.o=0,Io.F=1)}}function av(){var a=Io.j/255,y=Io.u/255,x=Io.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))}hl.j=Math.round(tt),hl.u=Math.round(100*a),hl.o=Math.round(100*b),hl.F=Io.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 vo||Qt("Value for "+y+" must be a color string or a Brush, not "+a))}function hv(){cv=Qo?new Rl(null,void 0,{willReadFrequently:!0}).context:null}Ue.Object.defineProperties(vo.prototype,{type:{get:function(){return this.na},set:function(a){this._isFrozen&&me(this,a),this.na=a,this.start.Mc()&&(a===dh?this.start=$r:a===El&&(this.start=cr)),this.end.Mc()&&(a===dh?this.end=Yo:a===El&&(this.end=cr)),this.xe=null}},color:{get:function(){return this.xk},set:function(a){this._isFrozen&&me(this,a),this.xk=a,this.xe=null}},start:{get:function(){return this.Qd},set:function(a){this._isFrozen&&me(this,a),this.Qd=a.J(),this.xe=null}},end:{get:function(){return this.Lk},set:function(a){this._isFrozen&&me(this,a),this.Lk=a.J(),this.xe=null}},startRadius:{get:function(){return this.Gr},set:function(a){this._isFrozen&&me(this,a),0>a&&bn(a,">= zero",vo,"startRadius"),this.Gr=a,this.xe=null}},endRadius:{get:function(){return this.Xp},set:function(a){this._isFrozen&&me(this,a),0>a&&bn(a,">= zero",vo,"endRadius"),this.Xp=a,this.xe=null}},colorStops:{get:function(){return this.we},set:function(a){this._isFrozen&&me(this,a),this.we=a,this.xe=null}},pattern:{get:function(){return this.cr},set:function(a){this._isFrozen&&me(this,a),this.cr=a,this.xe=null}}}),vo.prototype.isDark=vo.prototype.Gx,vo.prototype.darkenBy=vo.prototype.Wy,vo.prototype.lightenBy=vo.prototype.Vz,vo.prototype.addColorStop=vo.prototype.addColorStop;var dv=216/24389,fm=24389/27,Bf=[95.047,100,108.883],cv=null,Io=new Yg,hl=new Yg,xs=new Yg,Vu=new Yg,Af=!1;vo.className="Brush";var Ah;vo.Solid=Ah=new Ae(vo,"Solid",0);var dh;vo.Linear=dh=new Ae(vo,"Linear",1);var El;vo.Radial=El=new Ae(vo,"Radial",2);var Tf;vo.Pattern=Tf=new Ae(vo,"Pattern",4);var Df;vo.Lab=Df=new Ae(vo,"Lab",5);var n1;vo.HSL=n1=new Ae(vo,"HSL",6),vo.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},vo.isValidColor=function(a){if(a==="black")return!0;if(a==="")return!1;Af||(hv(),Af=!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)},vo.lighten=function(a){return qy(a)},vo.lightenBy=qy,vo.darken=function(a){return t1(a)},vo.darkenBy=t1,vo.mix=ov,vo.isDark=bf;function wa(){this.xa="Base"}wa.prototype.measure=function(){},wa.prototype.Yz=function(a,y,x,E,b){a.measure(y,x,E,b)},wa.prototype.arrange=function(){},wa.prototype.Ly=function(a,y,x,E,b,z){a.arrange(y,x,E,b,z)},wa.prototype.iA=function(a){a.Uj()},wa.prototype.gc=function(){},Ue.Object.defineProperties(wa.prototype,{name:{get:function(){return this.xa},set:function(a){this.xa=a}},classType:{get:function(){return wn}}}),wa.prototype.remeasureObject=wa.prototype.iA,wa.prototype.arrangeElement=wa.prototype.Ly,wa.prototype.measureElement=wa.prototype.Yz,wa.className="PanelLayout";function gm(){this.xa="Base"}Ee(gm,wa),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,gt=ut.right+ut.left;ut=ut.top+ut.bottom,lt.measure(y,x,z,tt);var yt=lt.measuredBounds;gt=Math.max(yt.width+gt,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 gr&<.isGeometryPositioned&&(lt=lt.strokeWidth/2,yt-=lt,xt-=lt),zr(b,yt,xt,gt,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 gr&&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"}Ee(pm,wa),pm.prototype.measure=function(a,y,x,E,b,z,tt){var rt=E.length;y=Jn(),z=ch(a);for(var ot=0;ot<rt;ot++){var lt=E[ot];if(lt.visible||lt===z){var ut=Ts(lt,!1);if(ut!==ln&&ut!==Bi)y.push(lt);else{lt.measure(1/0,x,0,tt),ut=lt.margin,lt=lt.measuredBounds;var gt=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,gt)}}}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));ii(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 gt=ut.measuredBounds,yt=ut.margin,xt=yt.top+yt.bottom,Ct=z+b.bottom,bt=gt.height,Wt=Ts(ut,!1);(isNaN(ut.desiredSize.height)&&Wt===Sn||Wt===_i)&&(bt=Math.max(x.height-xt-Ct,0)),xt=bt+xt+Ct,Ct=ut.alignment,Ct.Xb()&&(Ct=a.defaultAlignment),Ct.sb()||(Ct=cr),tt&&(rt-=gt.width+yt.left+yt.right),ut.arrange(rt+Ct.offsetX+yt.left,lt+Ct.offsetY+yt.top+(x.height*Ct.y-xt*Ct.y),gt.width,bt),tt||(rt+=gt.width+yt.left+yt.right)}}};function mm(){this.xa="Base"}Ee(mm,wa),mm.prototype.measure=function(a,y,x,E,b,z){var tt=E.length;x=Jn();for(var rt=ch(a),ot=0;ot<tt;ot++){var lt=E[ot];if(lt.visible||lt===rt){var ut=Ts(lt,!1);if(ut!==ln&&ut!==_i)x.push(lt);else{var gt=lt.margin;ut=gt.right+gt.left,gt=gt.top+gt.bottom,lt.measure(y,1/0,z,0),lt=lt.measuredBounds,lo(b,Math.max(b.width,Math.max(lt.width+ut,0)),b.height+Math.max(lt.height+gt,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);ii(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 gt=ut.measuredBounds,yt=ut.margin,xt=yt.left+yt.right,Ct=z+b.right,bt=gt.width,Wt=Ts(ut,!1);(isNaN(ut.desiredSize.width)&&Wt===Sn||Wt===Bi)&&(bt=Math.max(x.width-xt-Ct,0)),xt=bt+xt+Ct,Ct=ut.alignment,Ct.Xb()&&(Ct=a.defaultAlignment),Ct.sb()||(Ct=cr),tt&&(rt-=gt.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,gt.height),tt||(rt+=gt.height+yt.bottom+yt.top)}}};function vm(){this.xa="Base"}Ee(vm,wa),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,gt=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+gt,0),bt=a.isClipping,Wt=Oe.allocAt(-lt.left,-lt.top,xt,Ct),Zt=Oe.allocAt(0,0,z,tt);fv(ot,Zt,!0),z=Zt.width,tt=Zt.height;for(var $t=!0,ne=ch(a),re=0;re<rt;re++){var de=E[re];yt=y;var Fe=x;if(de!==ot&&(de.visible||de===ne)){lt=de.margin;var Wn=lt.left,mi=lt.top;switch(xt=lt.right+lt.left,Ct=lt.top+lt.bottom,lt=Ts(de,!1),lt){case Sn:yt=z,Fe=tt,mi=Wn=Ct=xt=0;break;case Bi:yt=z,Wn=xt=0;break;case _i:Fe=tt,mi=Ct=0}de.measure(yt,Fe,0,0),yt=de.measuredBounds,xt=Math.max(yt.width+xt,0),Ct=Math.max(yt.height+Ct,0),lt=de.alignment,lt.Xb()&&(lt=a.defaultAlignment),lt.sb()||(lt=cr);var ui=de.alignmentFocus;if(ui.Xb()&&(ui=cr),Fe=null,de instanceof wn&&de.$e!==""&&(Fe=de.fb(de.$e),Fe===de&&(Fe=null)),Wn=Zt.x-Wn,mi=Zt.y-mi,Fe!==null){for(de.arrange(0,0,yt.width,yt.height),yt=Fe.actualBounds,yt=Tt.allocAt(yt.x+(ui.x*yt.width-ui.offsetX),yt.y+(ui.y*yt.height-ui.offsetY)),Fe=Fe.panel;Fe!==de;)Fe.transform.Ga(yt),Fe=Fe.panel;Wn+=lt.x*z+lt.offsetX-yt.x,mi+=lt.y*tt+lt.offsetY-yt.y,Tt.free(yt)}else Wn+=lt.x*z+lt.offsetX-(ui.x*yt.width+ui.offsetX),mi+=lt.y*tt+lt.offsetY-(ui.y*yt.height+ui.offsetY);$t?($t=!1,b.h(Wn,mi,xt,Ct)):zr(b,Wn,mi,xt,Ct)}}switch($t?b.assign(Wt):bt?b.Uu(Zt.x,Zt.y,Zt.width,Zt.height):zr(b,Wt.x,Wt.y,Wt.width,Wt.height),Oe.free(Wt),Oe.free(Zt),lt=ot.stretch,lt===rr&&(lt=Ts(ot,!1)),lt){case ln:return;case Sn:if(!isFinite(y)&&!isFinite(x))return;break;case Bi:if(!isFinite(y))return;break;case _i:if(!isFinite(x))return}for(yt=ot.measuredBounds,z=yt.width,tt=yt.height,xt=Math.max(z+ut,0),Ct=Math.max(tt+gt,0),lt=ot.margin,Zt=Oe.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!==ne||(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=cr),x=x.alignmentFocus,x.Xb()&&(x=cr),$t?($t=!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)):zr(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));$t?b.assign(Wt):bt?b.Uu(Zt.x,Zt.y,Zt.width,Zt.height):zr(b,Wt.x,Wt.y,Wt.width,Wt.height),Oe.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=Oe.allocAt(0,0,tt,rt),fv(b,tt,!1),rt=0;rt<E;rt++){var gt=y[rt];if(gt!==b){lt=gt.measuredBounds;var yt=lt.width,xt=lt.height;ut=gt.alignment,ut.Xb()&&(ut=a.defaultAlignment),ut.sb()||(ut=cr);var Ct=gt.alignmentFocus;if(Ct.Xb()&&(Ct=cr),lt=null,gt instanceof wn&>.$e!==""&&(lt=gt.fb(gt.$e),lt===gt&&(lt=null)),lt!==null){var bt=lt.actualBounds;for(Ct=Tt.allocAt(bt.x+(Ct.x*bt.width-Ct.offsetX),bt.y+(Ct.y*bt.height-Ct.offsetY)),lt=lt.panel;lt!==gt;)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,Tt.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,gt.visible&>.arrange(z+lt,ot+ut,yt,xt)}}Oe.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"}Ee(ym,wa),ym.prototype.measure=function(a,y,x,E,b,z,tt){var rt=E.length,ot=a.Pb(),lt=ot.margin,ut=y,gt=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 gr&&(bt=ot,Ct=bt.strokeWidth*bt.scale);var Wt=Math.max(lt.width+yt,0);lt=Math.max(lt.height+xt,0);var Zt=vv(ot),$t=Zt.x*Wt+Zt.offsetX;Zt=Zt.y*lt+Zt.offsetY;var ne=yv(ot),re=ne.x*Wt+ne.offsetX;for(ne=ne.y*lt+ne.offsetY,isFinite(y)&&(ut=Math.max(Math.abs($t-re)-Ct,0)),isFinite(x)&&(gt=Math.max(Math.abs(Zt-ne)-Ct,0)),Ct=en.alloc(),Ct.h(0,0),a=ch(a),ne=0;ne<rt;ne++)Zt=E[ne],Zt===ot||!Zt.visible&&Zt!==a||(lt=Zt.margin,Wt=lt.right+lt.left,$t=lt.top+lt.bottom,Zt.measure(ut,gt,0,0),lt=Zt.measuredBounds,Wt=Math.max(lt.width+Wt,0),lt=Math.max(lt.height+$t,0),Ct.h(Math.max(Wt,Ct.width),Math.max(lt,Ct.height)));if(rt===1)b.width=Wt,b.height=lt,en.free(Ct);else{switch(Zt=vv(ot),ne=yv(ot),rt=E=0,ne.x!==Zt.x&&ne.y!==Zt.y&&(E=Ct.width/Math.abs(ne.x-Zt.x),rt=Ct.height/Math.abs(ne.y-Zt.y)),en.free(Ct),Ct=0,bt!==null&&(Ct=bt.strokeWidth*bt.scale,Ev(bt)===Mi&&(E=rt=Math.max(E,rt))),E+=Math.abs(Zt.offsetX)+Math.abs(ne.offsetX)+Ct,rt+=Math.abs(Zt.offsetY)+Math.abs(ne.offsetY)+Ct,bt=ot.stretch,bt===rr&&(bt=Ts(ot,!1)),bt){case ln:tt=z=0;break;case Sn:isFinite(y)&&(E=y),isFinite(x)&&(rt=x);break;case Bi:isFinite(y)&&(E=y),tt=0;break;case _i: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=Oe.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),gt=yv(E),yt=ut.y*b.height+ut.offsetY,xt=gt.x*b.width+gt.offsetX;for(gt=gt.y*b.height+gt.offsetY,z.x=ut.x*b.width+ut.offsetX,z.y=yt,zr(z,xt,gt,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=cr),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&&(Or(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 Oe(z.x,z.y,z.width,z.height))));Oe.free(z)};function Sm(){this.xa="Base",this.name="Table"}Ee(Sm,wa),Sm.prototype.measure=function(a,y,x,E,b){for(var z=E.length,tt=Jn(),rt=Jn(),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 gt=ut.O.s,yt=gt.length,xt=0;xt<yt;xt++){var Ct=gt[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=[],Wt=0;Wt<z;Wt++){var Zt=tt[Wt];Zt.visible&&(ma(Zt,!0),Hu(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))}ii(tt);var $t=Jn(),ne=Jn(),re=Jn(),de={count:0},Fe={count:0},Wn=y,mi=x,ui=a.rowDefs,Fn=a.colDefs,rn=null;z=ui.length;for(var er=0;er<z;er++)rn=ui[er],rn!==void 0&&(rn.actual=0);z=Fn.length;for(var Ki=0;Ki<z;Ki++)rn=Fn[Ki],rn!==void 0&&(rn.actual=0);for(var no=bt.length,No=0,ba=0;ba<no;ba++)bt[ba]&&(No=Math.max(No,bt[ba].length));var Oa=Math.min(a.topIndex,no-1),cs=Math.min(a.leftIndex,No-1),Na=0;no=bt.length;for(var Hh=ch(a),la=0;la<no;la++)if(bt[la]){No=bt[la].length;var yu=a.Fb(la);yu.actual=0;for(var fs=yu.oc=0;fs<No;fs++)if(bt[la][fs]){var Wh=a.Eb(fs);$t[fs]===void 0&&(Wh.actual=0,Wh.oc=0,$t[fs]=!0);for(var fl=bt[la][fs],Gl=fl.length,tl=0;tl<Gl;tl++){var Ws=fl[tl];if(Ws.visible||Ws===Hh){var Ld=1<Ws.rowSpan||1<Ws.columnSpan;Ld&&(la<Oa||fs<cs||ne.push(Ws));var Su=Ws.margin,ig=Su.right+Su.left,el=Su.top+Su.bottom,gs=fu(Ws,yu,Wh,!1),Op=Ws.desiredSize,Xc=!isNaN(Op.height),Au=!isNaN(Op.width)&&Xc;if(Ld||gs===ln||Au||la<Oa||fs<cs||(de[fs]!==void 0||gs!==Sn&&gs!==Bi||(de[fs]=-1,de.count++),Fe[la]!==void 0||gs!==Sn&&gs!==_i||(Fe[la]=-1,Fe.count++),re.push(Ws)),Ws.measure(1/0,1/0,0,0),!(la<Oa||fs<cs)){var Vs=Ws.measuredBounds,ac=Math.max(Vs.width+ig,0),nl=Math.max(Vs.height+el,0);if(Ws.rowSpan===1&&(gs===ln||gs===Bi)){rn=a.Fb(la);var Fd=rn.Wc();Na=Math.max(nl-rn.actual,0),Na+Fd>mi&&(Na=Math.max(mi-Fd,0));var G0=rn.oa===0;rn.oc=rn.oc+Na,rn.actual=rn.oa+Na,mi=Math.max(mi-(Na+(G0?Fd:0)),0)}if(Ws.columnSpan===1&&(gs===ln||gs===_i)){rn=a.Eb(fs);var Ip=rn.Wc();Na=Math.max(ac-rn.actual,0),Na+Ip>Wn&&(Na=Math.max(Wn-Ip,0));var zy=rn.oa===0;rn.oc=rn.oc+Na,rn.actual=rn.oa+Na,Wn=Math.max(Wn-(Na+(zy?Ip:0)),0)}Ld&&Ws.Uj()}}}}}ii($t);var th=0,ph=0;z=a.columnCount;for(var Jc=0;Jc<z;Jc++){var Md=Fn[Jc];Md!==void 0&&(th+=isNaN(Md.Hc)?Md.oc:Md.Hc,Md.oc!==0&&(th+=Md.Wc()))}z=a.rowCount;for(var rg=0;rg<z;rg++){var kd=ui[rg];kd!==void 0&&(ph+=isNaN(kd.Hc)?kd.oc:kd.Hc,kd.oc!==0&&(ph+=kd.Wc()))}Wn=Math.max(y-th,0);var eh=mi=Math.max(x-ph,0),Vh=Wn;z=re.length;for(var Ks=0;Ks<z;Ks++){var Tu=re[Ks],H0=a.Fb(Tu.row),mh=a.Eb(Tu.column),og=Tu.measuredBounds,xu=Tu.margin,sc=xu.right+xu.left,Du=xu.top+xu.bottom;de[Tu.column]=mh.oc===0&&de[Tu.column]!==void 0?Math.max(og.width+sc,de[Tu.column]):null,Fe[Tu.row]=H0.oc===0&&Fe[Tu.row]!==void 0?Math.max(og.height+Du,Fe[Tu.row]):null}var Qc=0,ag=0,au;for(au in Fe)au!=="count"&&(Qc+=Fe[au]);for(au in de)au!=="count"&&(ag+=de[au]);for(var Ka=en.alloc(),_p=0;_p<z;_p++){var Ms=re[_p];if(Ms.visible||Ms===Hh){var ua=a.Fb(Ms.row),ks=a.Eb(Ms.column),vh=0;isFinite(ks.width)?vh=ks.width:(isFinite(Wn)&&de[Ms.column]!==null?ag===0?vh=ks.actual+Wn:vh=de[Ms.column]/ag*Vh:de[Ms.column]!==null?vh=Wn:vh=ks.actual||Wn,vh=Math.max(0,vh-ks.Wc()));var Kh=0;switch(isFinite(ua.height)?Kh=ua.height:(isFinite(mi)&&Fe[Ms.row]!==null?Qc===0?Kh=ua.actual+mi:Kh=Fe[Ms.row]/Qc*eh:Fe[Ms.row]!==null?Kh=mi:Kh=ua.actual||mi,Kh=Math.max(0,Kh-ua.Wc())),Ka.h(Math.max(ks.minimum,Math.min(vh,ks.maximum)),Math.max(ua.minimum,Math.min(Kh,ua.maximum))),gs=fu(Ms,ua,ks,!1),gs){case Bi:Ka.height=Math.max(Ka.height,ua.actual+mi);break;case _i:Ka.width=Math.max(Ka.width,ks.actual+Wn)}var lc=Ms.margin,Zy=lc.right+lc.left,W0=lc.top+lc.bottom;Ms.Uj(),Ms.measure(Ka.width,Ka.height,ks.minimum,ua.minimum);var sg=Ms.measuredBounds,uc=Math.max(sg.width+Zy,0),$c=Math.max(sg.height+W0,0);isFinite(Wn)&&(uc=Math.min(uc,Ka.width)),isFinite(mi)&&($c=Math.min($c,Ka.height));var Us=0;Us=ua.actual,ua.actual=Math.max(ua.actual,$c),ua.oc=Math.max(ua.oc,$c),Na=ua.actual-Us,mi=Math.max(mi-Na,0),Fe[Ms.row]===null&&(eh=Math.max(eh-Na,0)),Us=ks.actual,ks.actual=Math.max(ks.actual,uc),ks.oc=Math.max(ks.oc,uc),Na=ks.actual-Us,Wn=Math.max(Wn-Na,0),de[Ms.column]===null&&(Vh=Math.max(Vh-Na,0))}}ii(re);var yh=en.alloc(),Pu=Jn(),bl=Jn();if(z=ne.length,z!==0){for(var bd=0;bd<no;bd++)if(bt[bd]){No=bt[bd].length;var lg=a.Fb(bd);Pu[bd]=lg.actual;for(var Nd=0;Nd<No;Nd++)if(bt[bd][Nd]){var V0=a.Eb(Nd);bl[Nd]=V0.actual}}}for(var ug=0;ug<z;ug++){var na=ne[ug];if(na.visible||na===Hh){var su=a.Fb(na.row),Hl=a.Eb(na.column);switch(Ka.h(Math.max(Hl.minimum,Math.min(y,Hl.maximum)),Math.max(su.minimum,Math.min(x,su.maximum))),gs=fu(na,su,Hl,!1),gs){case Sn:bl[Hl.index]!==0&&(Ka.width=Math.min(Ka.width,bl[Hl.index])),Pu[su.index]!==0&&(Ka.height=Math.min(Ka.height,Pu[su.index]));break;case Bi:bl[Hl.index]!==0&&(Ka.width=Math.min(Ka.width,bl[Hl.index]));break;case _i:Pu[su.index]!==0&&(Ka.height=Math.min(Ka.height,Pu[su.index]))}isFinite(Hl.width)&&(Ka.width=Hl.width),isFinite(su.height)&&(Ka.height=su.height),yh.h(0,0);for(var K0=Hl.minimum,il=su.minimum,Uh=1;Uh<na.rowSpan&&!(na.row+Uh>=a.rowCount);Uh++)rn=a.Fb(na.row+Uh),Na=0,Na=gs===Sn||gs===_i?Math.max(rn.minimum,Pu[na.row+Uh]===0?rn.maximum:Math.min(Pu[na.row+Uh],rn.maximum)):Math.max(rn.minimum,isNaN(rn.Hc)?rn.maximum:Math.min(rn.Hc,rn.maximum)),yh.height+=Na,il+=rn.minimum;for(var Wl=1;Wl<na.columnSpan&&!(na.column+Wl>=a.columnCount);Wl++)rn=a.Eb(na.column+Wl),Na=0,Na=gs===Sn||gs===Bi?Math.max(rn.minimum,bl[na.column+Wl]===0?rn.maximum:Math.min(bl[na.column+Wl],rn.maximum)):Math.max(rn.minimum,isNaN(rn.Hc)?rn.maximum:Math.min(rn.Hc,rn.maximum)),yh.width+=Na,K0+=rn.minimum;Ka.width+=yh.width,Ka.height+=yh.height;var hg=na.margin,Bd=hg.right+hg.left,Rp=hg.top+hg.bottom;na.measure(Ka.width,Ka.height,K0,il);for(var dg=na.measuredBounds,Ou=Math.max(dg.width+Bd,0),hc=Math.max(dg.height+Rp,0),Ad=0,cg=0;cg<na.rowSpan&&!(na.row+cg>=a.rowCount);cg++)rn=a.Fb(na.row+cg),Ad+=rn.total||0;if(Ad<hc){var Yh=hc-Ad,nh=hc-Ad;if(na.spanAllocation!==null)for(var Xh=na.spanAllocation,Sh=0;Sh<na.rowSpan&&!(0>=Yh)&&!(na.row+Sh>=a.rowCount);Sh++){rn=a.Fb(na.row+Sh);var Jh=rn.oa||0,dc=Xh(na,rn,nh);rn.actual=Math.min(rn.maximum,Jh+dc),rn.oa!==Jh&&(Yh-=rn.oa-Jh)}for(;0<Yh;){var wu=rn.oa||0;if(isNaN(rn.height)&&rn.maximum>wu&&(rn.actual=Math.min(rn.maximum,wu+Yh),rn.oa!==wu&&(Yh-=rn.oa-wu)),rn.index===0)break;rn=a.Fb(rn.index-1)}}for(var qc=0,Qh=0;Qh<na.columnSpan&&!(na.column+Qh>=a.columnCount);Qh++)rn=a.Eb(na.column+Qh),qc+=rn.total||0;if(qc<Ou){var tf=Ou-qc,Gy=Ou-qc;if(na.spanAllocation!==null)for(var xh=na.spanAllocation,cc=0;cc<na.columnSpan&&!(0>=tf)&&!(na.column+cc>=a.columnCount);cc++){rn=a.Eb(na.column+cc);var jp=rn.oa||0,Hy=xh(na,rn,Gy);rn.actual=Math.min(rn.maximum,jp+Hy),rn.oa!==jp&&(tf-=rn.oa-jp)}for(;0<tf;){var U0=rn.oa||0;if(isNaN(rn.width)&&rn.maximum>U0&&(rn.actual=Math.min(rn.maximum,U0+tf),rn.oa!==U0&&(tf-=rn.oa-U0)),rn.index===0)break;rn=a.Eb(rn.index-1)}}}}ii(ne),en.free(yh),en.free(Ka),Pu!==void 0&&ii(Pu),bl!==void 0&&ii(bl);var ef=0,nf=0,Y0=a.desiredSize,gx=a.maxSize;gs=Ts(a,!0);var zp=ph=th=0,Zp=0;z=a.columnCount;for(var X0=0;X0<z;X0++)Fn[X0]!==void 0&&(rn=a.Eb(X0),isFinite(rn.width)?(zp+=rn.width,zp+=rn.Wc()):bm(rn)===$g?(zp+=rn.oa,zp+=rn.Wc()):rn.oa!==0&&(th+=rn.oa,th+=rn.Wc()));isFinite(Y0.width)?ef=Math.min(Y0.width,gx.width):ef=gs!==ln&&isFinite(y)?y:th,ef=Math.max(ef,a.minSize.width),ef=Math.max(ef-zp,0);for(var Qx=th===0?1:Math.max(ef/th,1),J0=0;J0<z;J0++)Fn[J0]!==void 0&&(rn=a.Eb(J0),isFinite(rn.width)||bm(rn)===$g||(rn.actual=rn.oa*Qx),rn.position=b.width,rn.oa!==0&&(b.width+=rn.oa,b.width+=rn.Wc()));z=a.rowCount;for(var Q0=0;Q0<z;Q0++)ui[Q0]!==void 0&&(rn=a.Fb(Q0),isFinite(rn.height)?(Zp+=rn.height,Zp+=rn.Wc()):bm(rn)===$g?(Zp+=rn.oa,Zp+=rn.Wc()):rn.oa!==0&&(ph+=rn.oa,ph+=rn.Wc()));isFinite(Y0.height)?nf=Math.min(Y0.height,gx.height):nf=gs!==ln&&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++)ui[$0]!==void 0&&(rn=a.Fb($0),isFinite(rn.height)||bm(rn)===$g||(rn.actual=rn.oa*$x),rn.position=b.height,rn.oa!==0&&(b.height+=rn.oa,b.height+=rn.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,rn=a.Fb(Gp.row),Ky=rn.actual):(rn=a.Eb(Gp.column),Vy=rn.actual,Ky=b.height),Gp.measuredBounds.h(0,0,Vy,Ky),ma(Gp,!1)}ii(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,gt=0;gt<lt;gt++)tt[gt]&&(ut=Math.max(ut,tt[gt].length));ot=a.rowDefs,rt=a.colDefs;var yt=gt=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),gt=-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,Wt=0;bt!==lt&&ot[bt]===void 0;)bt++;for(;Wt!==lt&&rt[Wt]===void 0;)Wt++;ut=a.part,a.Fb(bt),a.Eb(Wt);for(var Zt=0;Zt<y.length;Zt++){var $t=y[Zt];if($t instanceof wn&&$t.visible&&Th($t)){if($t.type===wn.TableRow){rt=a.Fb($t.row);var ne=a.Eb(Wt)}else rt=a.Fb(bt),ne=a.Eb($t.column);ot=rt.position+gt+b,rt.oa!==0&&(ot+=rt.Io(Math.max(bt,xt))),rt=ne.position+yt+z,ne.oa!==0&&(rt+=ne.Io(Math.max(Wt,Ct))),ne=$t.measuredBounds,$t.Uk(),$t.actualBounds.ka();var re=$t.actualBounds,de=Oe.allocAt(re.x,re.y,re.width,re.height);re.x=$t.type===wn.TableRow?z:rt,re.y=$t.type===wn.TableColumn?b:ot,re.width=ne.width,re.height=ne.height,$t.actualBounds.freeze(),Hu($t,!1),hr(de,re)||ut===null||(ut.oh(),$t.Pn(ut)),Oe.free(de)}}for(Zt=en.alloc(),$t=0;$t<lt;$t++)if(tt[$t]){for(ut=tt[$t].length,ne=a.Fb($t),ot=ne.position+gt+b,ne.oa!==0&&(ot+=ne.Io(Math.max(bt,xt))),re=0;re<ut;re++)if(tt[$t][re]){de=a.Eb(re),rt=de.position+yt+z,de.oa!==0&&(rt+=de.Io(Math.max(Wt,Ct)));for(var Fe=tt[$t][re],Wn=Fe.length,mi=0;mi<Wn;mi++){var ui=Fe[mi],Fn=ui.measuredBounds;Zt.h(0,0);for(var rn=1;rn<ui.rowSpan&&!($t+rn>=a.rowCount);rn++){var er=a.Fb($t+rn);er.oa!==0&&(Zt.height+=er.total)}for(rn=1;rn<ui.columnSpan&&!(re+rn>=a.columnCount);rn++)er=a.Eb(re+rn),er.oa!==0&&(Zt.width+=er.total);var Ki=de.oa+Zt.width,no=ne.oa+Zt.height;rn=rt,er=ot;var No=Ki,ba=no,Oa=rt,cs=ot,Na=Ki,Hh=no;rt+Ki>x.width&&(Na=Math.max(x.width-rt,0)),ot+no>x.height&&(Hh=Math.max(x.height-ot,0));var la=ui.alignment;if(la.Xb()){la=a.defaultAlignment,la.sb()||(la=cr);var yu=la.x,fs=la.y,Wh=la.offsetX;la=la.offsetY;var fl=de.alignment,Gl=ne.alignment;fl.sb()&&(yu=fl.x,Wh=fl.offsetX),Gl.sb()&&(fs=Gl.y,la=Gl.offsetY)}else yu=la.x,fs=la.y,Wh=la.offsetX,la=la.offsetY;(isNaN(yu)||isNaN(fs))&&(fs=yu=.5,la=Wh=0),fl=Fn.width,Gl=Fn.height;var tl=ui.margin,Ws=tl.left+tl.right,Ld=tl.top+tl.bottom,Su=fu(ui,ne,de,!1);!isNaN(ui.desiredSize.width)||Su!==Sn&&Su!==Bi||(fl=Math.max(Ki-Ws,0)),!isNaN(ui.desiredSize.height)||Su!==Sn&&Su!==_i||(Gl=Math.max(no-Ld,0)),Ki=ui.maxSize,no=ui.minSize,fl=Math.min(Ki.width,fl),Gl=Math.min(Ki.height,Gl),fl=Math.max(no.width,fl),Gl=Math.max(no.height,Gl),Ki=Gl+Ld,rn+=No*yu-(fl+Ws)*yu+Wh+tl.left,er+=ba*fs-Ki*fs+la+tl.top,ui.visible&&(Or(Oa,cs,Na,Hh,rn,er,Fn.width,Fn.height)?ui.arrange(rn,er,fl,Gl):ui.arrange(rn,er,fl,Gl,new Oe(Oa,cs,Na,Hh)))}}}for(en.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"}Ee(xm,wa),xm.prototype.measure=function(){},xm.prototype.arrange=function(){};function Pm(){this.xa="Base"}Ee(Pm,wa),Pm.prototype.measure=function(){},Pm.prototype.arrange=function(){};function wm(){this.xa="Base"}Ee(wm,wa),wm.prototype.measure=function(a,y,x,E,b,z,tt){1<E.length&&Qt("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,gt=rt.width;rt=rt.height;var yt=Math.max(y-lt,0),xt=Math.max(x-ot,0),Ct=1;a.viewboxStretch===Mi?gt!==0&&rt!==0&&(Ct=Math.min(yt/gt,xt/rt)):gt!==0&&rt!==0&&(Ct=Math.max(yt/gt,xt/rt)),Ct===0&&(Ct=1e-4),E.Ca*=Ct,ut!==E.scale&&(ma(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=cr),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"}Ee(Xg,wa),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),gt=a.gridOrigin,yt=gt.x;gt=gt.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,Wt=0;Wt<bt;Wt++){var Zt=Ct[Wt],$t=[];if(xt.push($t),Zt.visible){var ne=Zt.interval;if(!(0>ne)){Zt=pv(Zt.figure);for(var re=0;re<bt;re++)if(re!==Wt){var de=Ct[re];de.visible&&pv(de.figure)===Zt&&(de=de.interval,de>ne&&$t.push(de))}}}}for(Ct=a.O.s,bt=Ct.length,Wt=0;Wt<bt;Wt++){var Fe=Ct[Wt];if(Fe.visible&&($t=Fe.interval||1,Zt=Math.abs($t),!(2>b*Zt*x))){if(ne=Fe.segmentIndex,(!isFinite(ne)||isNaN(ne))&&(ne=0),0>ne&&(ne=Zt-Math.min(-ne,Zt)),ne=Math.round(ne%Zt),Zt=Fe.opacity,re=1,Zt!==1){if(Zt===0)continue;re=y.globalAlpha,y.globalAlpha=re*Zt}de=xt[Wt];var Wn=!1,mi=Fe.strokeDashArray;if(mi!==null&&(Wn=!0,y.js(mi,Fe.strokeDashOffset)),Fe.figure==="LineV"&&Fe.stroke!==null&&0<Fe.strokeWidth){for(y.lineWidth=Fe.strokeWidth,ta(a,y,Fe.stroke,!1,!1,z,tt),y.beginPath(),mi=Fe=Math.floor((yt-b)/b);mi<=Fe+lt;mi++){var ui=mi*b+yt;0<=ui&&ui<=rt&&Cm(mi,$t,ne,de)&&(y.moveTo(ui,0),y.lineTo(ui,ot))}y.stroke(),y.Se()}else if(Fe.figure==="LineH"&&Fe.stroke!==null&&0<Fe.strokeWidth){for(y.lineWidth=Fe.strokeWidth,ta(a,y,Fe.stroke,!1,!1,z,tt),y.beginPath(),mi=Fe=Math.floor((gt-E)/E);mi<=Fe+ut;mi++)ui=mi*E+gt,0<=ui&&ui<=ot&&Cm(mi,$t,ne,de)&&(y.moveTo(0,ui),y.lineTo(rt,ui));y.stroke(),y.Se()}else if(Fe.figure==="BarV"&&Fe.fill!==null)for(ta(a,y,Fe.fill,!0,!1,z,tt),Fe=Fe.width,isNaN(Fe)&&(Fe=b),ui=mi=Math.floor((yt-b)/b);ui<=mi+lt;ui++){var Fn=ui*b+yt;0<=Fn+Fe&&Fn<=rt&&Cm(ui,$t,ne,de)&&y.fillRect(Fn,0,Fe,ot)}else if(Fe.figure==="BarH"&&Fe.fill!==null)for(ta(a,y,Fe.fill,!0,!1,z,tt),Fe=Fe.height,isNaN(Fe)&&(Fe=E),ui=mi=Math.floor((gt-E)/E);ui<=mi+ut;ui++)Fn=ui*E+gt,0<=Fn+Fe&&Fn<=ot&&Cm(ui,$t,ne,de)&&y.fillRect(0,Fn,rt,Fe);Wn&&y.fs(),Zt!==1&&(y.globalAlpha=re)}}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"}Ee(Em,wa),Em.prototype.measure=function(a,y,x,E,b){var z=E.length;if(a instanceof Qr||a instanceof kn){var tt=null,rt=null;if(a instanceof kn&&(tt=a),a instanceof Qr&&(rt=a,tt=rt.adornedPart,a.j===null&&(a.j=[])),tt instanceof kn){var ot=tt;if(z===0)lo(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,gt=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=oe.alloc();for(var bt=Tt.alloc(),Wt=Tt.alloc(),Zt=0;Zt<z;Zt++){var $t=E[Zt];if($t!==lt)if($t.isPanelMain&&$t instanceof gr){i1(a,rt,yt,$t);var ne=$t.measuredBounds;x.ed(ne),xt.push(ne)}else if(2>gt)$t.measure(1/0,1/0,0,0),ne=$t.measuredBounds,x.ed(ne),xt.push(ne);else{var re=$t.segmentIndex,de=$t.segmentFraction,Fe=$t.alignmentFocus;Fe.Mc()&&(Fe=cr);var Wn=$t.segmentOrientation,mi=$t.segmentOffset;if(isNaN(re)){var ui=ot.ua;ne=Jn(),ui.Qu(de,ne);var Fn=Tt.allocAt(ne[0],ne[1]);if(Fn.add(ot.i(0)),ui.type===ce.j?Fn.offset(-ui.startX,-ui.startY):(ui=ui.figures.first(),ui!==null&&Fn.offset(-ui.startX,-ui.startY)),ui=ne[2],Wn!==ws){var rn=ot.computeAngle($t,Wn,ui);$t.Kb=rn}rn=Fn.x-y.x;var er=Fn.y-y.y;Tt.free(Fn),ii(ne)}else if(re<-gt||re>=gt)ne=Tt.alloc(),ot.vg(),ot.computeMidPoint(ne),ui=ot.midAngle,Wn!==ws&&(rn=ot.computeAngle($t,Wn,ui),$t.Kb=rn),rn=ne.x-y.x,er=ne.y-y.y,Tt.free(ne);else{if(rn=0,0<=re?(er=ut.M(re),ne=re<gt-1?ut.M(re+1):er):(rn=gt+re,er=ut.M(rn),ne=0<rn?ut.M(rn-1):er),er.Xa(ne)){0<=re?(ui=0<re?ut.M(re-1):er,rn=re<gt-2?ut.M(re+2):ne):(ui=rn<gt-1?ut.M(rn+1):er,rn=1<rn?ut.M(rn-2):ne),Fn=ui.Bf(er);var Ki=ne.Bf(rn);ui=Fn>Ki+10?0<=re?ui.ab(er):er.ab(ui):Ki>Fn+10?0<=re?ne.ab(rn):rn.ab(ne):0<=re?ui.ab(rn):rn.ab(ui)}else ui=0<=re?er.ab(ne):ne.ab(er);Wn!==ws&&(rn=ot.computeAngle($t,Wn,ui),$t.Kb=rn),rn=er.x+(ne.x-er.x)*de-y.x,er=er.y+(ne.y-er.y)*de-y.y}$t.measure(1/0,1/0,0,0),ne=$t.measuredBounds,Fn=$t.naturalBounds;var no=0;$t instanceof gr&&(no=$t.strokeWidth),Ki=Fn.width+no;var No=Fn.height+no;Ct.reset(),Ct.translate(-ne.x,-ne.y),Ct.scale($t.scale,$t.scale),Ct.rotate(Wn===ws?$t.angle:ui,Ki/2,No/2),Wn!==lp&&Wn!==hp||Ct.rotate(90,Ki/2,No/2),Wn!==up&&Wn!==dp||Ct.rotate(-90,Ki/2,No/2),Wn===t0&&(45<ui&&135>ui||225<ui&&315>ui)&&Ct.rotate(-ui,Ki/2,No/2),Fn=new Oe(0,0,Ki,No),bt.xi(Fn,Fe),Ct.Ga(bt),Fe=-bt.x+no/2*$t.scale,$t=-bt.y+no/2*$t.scale,Wt.assign(mi),no=isNaN(mi.x);var ba=isNaN(mi.y);if(no||ba){Ki=Ki/2+3,No=No/2+3;var Oa=45<=ui&&135>=ui,cs=225<=ui&&315>=ui;Wn===ws&&(Oa||cs)?(Wt.x=ba?Ki:mi.y,Wt.y=no?No:mi.x,Oa?0<=re||isNaN(re)&&.5>de||!no||(Wt.y=-No):cs&&((0<=re||isNaN(re)&&.5>de)&&no&&(Wt.y=-No),ba&&(Wt.x=-Ki))):(no&&(Wt.x=0<=re||isNaN(re)&&.5>de?Ki:-Ki),ba&&(Wt.y=-No),Wt.rotate(ui))}else Wt.rotate(ui);rn+=Wt.x,er+=Wt.y,Fn.set(ne),Fn.h(rn+Fe,er+$t,ne.width,ne.height),xt.push(Fn),x.ed(Fn)}}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),lo(b,x.width||0,x.height||0),oe.free(Ct),Tt.free(bt),Tt.free(Wt)}}}},Em.prototype.arrange=function(a,y){var x=y.length;if(a instanceof Qr||a instanceof kn){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 kn)for(z=a.labelNodes;z.next();){var gt=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=gt.ua,Ct=Jn();xt.Qu(ot,Ct);var bt=Tt.allocAt(Ct[0],Ct[1]);bt.add(gt.i(0)),xt.type===ce.j||(xt=xt.figures.first()),bt.offset(-xt.startX,-xt.startY),xt=Ct[2],lt!==ws&&(gt=gt.computeAngle(tt,lt,xt),tt.angle=gt),gt=bt.x;var Wt=bt.y;Tt.free(bt),ii(Ct)}else if(rt<-x||rt>=x)Ct=Tt.alloc(),xt=gt,Wt=Ct,xt.vg(),xt.computeMidPoint(Wt),xt=gt.midAngle,lt!==ws&&(gt=gt.computeAngle(tt,lt,xt),tt.angle=gt),gt=Ct.x,Wt=Ct.y,Tt.free(Ct);else{if(bt=0,0<=rt?(Ct=y.s[rt],Wt=rt<x-1?y.s[rt+1]:Ct):(bt=x+rt,Ct=y.s[bt],Wt=0<bt?y.s[bt-1]:Ct),Ct.Xa(Wt)){0<=rt?(xt=0<rt?y.s[rt-1]:Ct,bt=rt<x-2?y.s[rt+2]:Wt):(xt=bt<x-1?y.s[bt+1]:Ct,bt=1<bt?y.s[bt-2]:Wt);var Zt=xt.Bf(Ct),$t=Wt.Bf(bt);xt=Zt>$t+10?0<=rt?xt.ab(Ct):Ct.ab(xt):$t>Zt+10?0<=rt?Wt.ab(bt):bt.ab(Wt):0<=rt?xt.ab(bt):bt.ab(xt)}else xt=0<=rt?Ct.ab(Wt):Wt.ab(Ct);lt!==ws&&(gt=gt.computeAngle(tt,lt,xt),tt.angle=gt),gt=Ct.x+(Wt.x-Ct.x)*ot,Wt=Ct.y+(Wt.y-Ct.y)*ot}if(yt.ys())tt.location=new Tt(gt,Wt);else{yt.Mc()&&(yt=cr),Ct=oe.alloc(),Ct.reset(),Ct.scale(tt.scale,tt.scale),Ct.rotate(tt.angle,0,0);var ne=tt.naturalBounds;bt=Oe.allocAt(0,0,ne.width,ne.height),Zt=Tt.alloc(),Zt.xi(bt,yt),Ct.Ga(Zt),yt=-Zt.x,$t=-Zt.y;var re=ne.width,de=ne.height;ne=Tt.alloc(),ne.assign(ut);var Fe=isNaN(ut.x),Wn=isNaN(ut.y);if(Fe||Wn){re=re/2+3,de=de/2+3;var mi=45<=xt&&135>=xt,ui=225<=xt&&315>=xt;lt===ws&&(mi||ui)?(ne.x=Wn?re:ut.y,ne.y=Fe?de:ut.x,mi?0<=rt||isNaN(rt)&&.5>ot||!Fe||(ne.y=-de):ui&&((0<=rt||isNaN(rt)&&.5>ot)&&Fe&&(ne.y=-de),Wn&&(ne.x=-re))):(Fe&&(ne.x=0<=rt||isNaN(rt)&&.5>ot?re:-re),Wn&&(ne.y=-de),ne.rotate(xt))}else ne.rotate(xt);gt+=ne.x,Wt+=ne.y,Ct.pp(bt),yt+=bt.x,$t+=bt.y,rt=Tt.allocAt(gt+yt,Wt+$t),tt.move(rt),Tt.free(rt),Tt.free(ne),Tt.free(Zt),Oe.free(bt),oe.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),Tt.free(E)}};function i1(a,y,x,E){if(ul(E)!==!1){var b=E.strokeWidth;b===0&&a instanceof Qr&&a.type===wn.Link&&a.adornedObject instanceof gr&&(b=a.adornedObject.strokeWidth),b*=E.Ca,a instanceof kn&&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),ma(E,!1)}}function Jg(){this.xa="Base"}Ee(Jg,wa),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 gt=rt.measuredBounds,yt=new Oe(-ot.left,-ot.top,Math.max(gt.width+lt,0),Math.max(gt.height+ut,0));a.graduatedBounds.push(yt),b.assign(yt);for(var xt=rt.geometry,Ct=rt.strokeWidth,bt=xt.flattenedSegments,Wt=xt.flattenedLengths,Zt=xt.flattenedTotalLength,$t=bt.length,ne=0,re=0,de=Jn(),Fe=0;Fe<$t;Fe++){var Wn=bt[Fe],mi=[];re=ne=0;for(var ui=Wn.length,Fn=0;Fn<ui;Fn+=2){var rn=Wn[Fn],er=Wn[Fn+1];if(Fn!==0){var Ki=180*Math.atan2(er-re,rn-ne)/Math.PI;0>Ki&&(Ki+=360),mi.push(Ki)}ne=rn,re=er}de.push(mi)}if(a.graduatedIntervals===null){for(var no=[],No=a.O.s,ba=No.length,Oa=0;Oa<ba;Oa++){var cs=No[Oa],Na=[];if(no.push(Na),cs.visible){var Hh=cs.interval;if(!(0>Hh)){for(var la=0;la<ba;la++)if(la!==Oa){var yu=No[la];if(yu.visible&&cs.constructor===yu.constructor){var fs=yu.interval;fs>Hh&&Na.push(fs)}}}}}a.graduatedIntervals=no}var Wh=a.graduatedIntervals,fl=a.O.s,Gl=fl.length,tl=0,Ws=0,Ld=Zt;a.graduatedMarks=[];for(var Su,ig=0;ig<Gl;ig++){var el=fl[ig];if(Su=[],el.visible&&el!==rt){var gs=Math.abs(el.interval),Op=a.graduatedTickUnit;if(!(2>Op*gs*Zt/a.graduatedRange&&el.graduatedSkip===null)){var Xc=Wt[0][0],Au=0,Vs=0;Ws=Zt*el.graduatedStart-1e-4,Ld=Zt*el.graduatedEnd+1e-4;var ac=Op*gs,nl=a.graduatedTickBase;if(nl<a.graduatedMin){var Fd=(a.graduatedMin-nl)/ac;Fd=Fd%1===0?Fd:Math.floor(Fd+1),nl+=Fd*ac}else nl>a.graduatedMin+ac&&(nl-=Math.floor((nl-a.graduatedMin)/ac)*ac);for(var G0=Wh[ig],Ip=nl,zy=1e-6*a.graduatedMax,th=1;nl<=a.graduatedMax+zy;th++){t:{for(var ph=G0.length,Jc=0;Jc<ph;Jc++){var Md=(nl-a.graduatedTickBase)%(G0[Jc]*a.graduatedTickUnit),rg=1e-6*a.graduatedTickUnit;if(Md<rg&&Md>-rg){var kd=!1;break t}}kd=!0}if(kd&&(nl>a.graduatedMax&&(nl=a.graduatedMax),el.graduatedSkip===null||el instanceof To&&!el.graduatedSkip(nl,el)||el instanceof gr&&!el.graduatedSkip(nl,el))&&(tl=(nl-a.graduatedMin)*Zt/a.graduatedRange,tl>Zt&&(tl=Zt),Ws<=tl&&tl<=Ld)){for(var eh=de[Au][Vs],Vh=Wt[Au][Vs];Au<Wt.length;){for(;tl>Xc&&Vs<Wt[Au].length-1;)Vs++,eh=de[Au][Vs],Vh=Wt[Au][Vs],Xc+=Vh;if(tl<=Xc)break;Au++,Vs=0,eh=de[Au][Vs],Vh=Wt[Au][Vs],Xc+=Vh}var Ks=bt[Au],Tu=Ks[2*Vs],H0=Ks[2*Vs+1],mh=(tl-(Xc-Vh))/Vh,og=new Tt(Tu+(Ks[2*Vs+2]-Tu)*mh+Ct/2-xt.bounds.x,H0+(Ks[2*Vs+3]-H0)*mh+Ct/2-xt.bounds.y);og.scale(rt.scale,rt.scale);t:{var xu=eh,sc=de[Au];if(!(.5005>mh&&.4995<mh)){var Du=xu;if(.5>mh?0<Vs?Du=sc[Vs-1]:_t.$(Ks[0],Ks[Ks.length-2])&&_t.$(Ks[1],Ks[Ks.length-1])&&(Du=sc[sc.length-1]):.5<mh&&(Vs+1<sc.length?Du=sc[Vs+1]:_t.$(Ks[0],Ks[Ks.length-2])&&_t.$(Ks[1],Ks[Ks.length-1])&&(Du=sc[0])),xu!==Du){var Qc=Math.abs(xu-Du);if(180<Qc&&(xu<Du?xu+=360:Du+=360,Qc=Math.abs(xu-Du)),5e-4>mh||.9995<mh){eh=(xu+Du)/2%360;break t}if(10>Qc){var ag=1-Math.abs(.5-mh);eh=(xu*ag+Du*(1-ag))%360;break t}}}eh=xu}if(el instanceof To){var au="";el.graduatedFunction!==null?(au=el.graduatedFunction(nl,el),au=au!=null?au.toString():""):au=(+nl.toFixed(2)).toString(),au!==""&&Su.push({$l:og,angle:eh,text:au})}else Su.push({$l:og,angle:eh})}nl=Ip+th*ac}}}a.graduatedMarks.push(Su)}ii(de);var Ka=a.graduatedMarks;if(Ka!==null)for(var _p=E.length,Ms=0;Ms<_p;Ms++){var ua=E[Ms],ks=Ka[Ms];if(ua.visible&&ua!==rt&&ks.length!==0){if(ua instanceof gr){var vh=a,Kh=b,lc=ua.alignmentFocus;lc.Mc()&&(lc=$r);var Zy=ua.angle;ua.Kb=0,ua.measure(1/0,1/0,0,0),ua.Kb=Zy;var W0=ua.measuredBounds,sg=W0.width,uc=W0.height,$c=Oe.allocAt(0,0,sg,uc),Us=Tt.alloc();Us.xi($c,lc),Oe.free($c);for(var yh=-Us.x,Pu=-Us.y,bl=new Oe,bd=ks.length,lg=0;lg<bd;lg++)for(var Nd=ks[lg],V0=Nd.$l.x,ug=Nd.$l.y,na=Nd.angle,su=0;4>su;su++){switch(su){case 0:Us.h(yh,Pu);break;case 1:Us.h(yh+sg,Pu);break;case 2:Us.h(yh,Pu+uc);break;case 3:Us.h(yh+sg,Pu+uc)}Us.rotate(na+ua.angle),Us.offset(V0,ug),lg===0&&su===0?bl.h(Us.x,Us.y,0,0):bl.Ye(Us),Us.offset(-V0,-ug),Us.rotate(-na-ua.angle)}Tt.free(Us),vh.graduatedBounds!==null&&vh.graduatedBounds.push(bl),zr(Kh,bl.x,bl.y,bl.width,bl.height)}else if(ua instanceof To){var Hl=a,K0=b;Hl.temporaryTextBlock===null&&(Hl.temporaryTextBlock=new To);var il=Hl.temporaryTextBlock;y1(il,ua);var Uh=ua.alignmentFocus;Uh.Mc()&&(Uh=$r);for(var Wl=ua.segmentOrientation,hg=ua.segmentOffset,Bd=new Oe,Rp=0,dg=0,Ou=0,hc=0,Ad=0,cg=ks.length,Yh=0;Yh<cg;Yh++){var nh=ks[Yh];Rp=nh.$l.x,dg=nh.$l.y,Ou=nh.angle,Ad=hc=ua.angle,Wl!==ws&&(Ad=Wl===sp||Wl===qm?Ou+ua.angle:Ou,hc=kn.computeAngle(Wl,Ad)),il.Kb=hc,il.text=nh.text||"",il.measure(1/0,1/0,0,0);var Xh=il.measuredBounds,Sh=il.naturalBounds,Jh=Sh.width,dc=Sh.height,wu=oe.alloc();wu.reset(),wu.translate(-Xh.x,-Xh.y),wu.scale(il.scale,il.scale),wu.rotate(Ad,Jh/2,dc/2),Wl!==lp&&Wl!==hp||wu.rotate(90,Jh/2,dc/2),Wl!==up&&Wl!==dp||wu.rotate(-90,Jh/2,dc/2),Wl===t0&&(45<Ou&&135>Ou||225<Ou&&315>Ou)&&wu.rotate(-Ou,Jh/2,dc/2);var qc=Oe.allocAt(0,0,Jh,dc),Qh=Tt.alloc();Qh.xi(qc,Uh),wu.Ga(Qh);var tf=-Qh.x,Gy=-Qh.y,xh=Tt.alloc();xh.assign(hg),isNaN(xh.x)&&(xh.x=Jh/2+3),isNaN(xh.y)&&(xh.y=-(dc/2+3)),xh.rotate(Ou),Rp+=xh.x+tf,dg+=xh.y+Gy;var cc=new Oe(Rp,dg,Xh.width,Xh.height),jp=new Oe(Xh.x,Xh.y,Xh.width,Xh.height),Hy=new Oe(Sh.x,Sh.y,Sh.width,Sh.height);nh.Sz=hc,nh.lineCount=il.lineCount,nh.lines=[il.Cb,il.Ih,il.df,il.Le,il.Qc,il.Qb,il.ze],nh.actualBounds=cc,nh.measuredBounds=jp,nh.naturalBounds=Hy,Yh===0?Bd.assign(cc):Bd.ed(cc),Tt.free(xh),Tt.free(Qh),Oe.free(qc),oe.free(wu)}Hl.graduatedBounds!==null&&Hl.graduatedBounds.push(Bd),zr(K0,Bd.x,Bd.y,Bd.width,Bd.height)}ma(ua,!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 Qs,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,gt=0;gt<ut;gt++){var yt=ot[gt],xt=lt[gt],Ct=xt.length;if(yt.visible&&yt!==z&&xt.length!==0){if(yt instanceof gr){if(!(2>a.graduatedTickUnit*yt.interval*z.geometry.flattenedTotalLength/a.graduatedRange*tt&&yt.graduatedSkip===null)){var bt=yt.measuredBounds,Wt=yt.strokeWidth*yt.scale,Zt=yt.alignmentFocus;Zt.Mc()&&(Zt=$r);for(var $t=0;$t<Ct;$t++){var ne=xt[$t].$l,re=xt[$t].angle,de=Zt,Fe=yt.Ab;Fe.reset(),Fe.translate(ne.x+rt.x,ne.y+rt.y),Fe.rotate(re+yt.angle,0,0),Fe.translate(-bt.width*de.x+de.offsetX+Wt/2,-bt.height*de.y+de.offsetY+Wt/2),Fe.scale(yt.scale,yt.scale),_l(yt,!1),yt.wh.set(yt.Ab),yt.Kk=yt.scale,wl(yt,!1),yt.gc(y,x),b&&(a.svg.appendChild(yt.svg),yt.svg=null),yt.Ab.reset()}}}else if(yt instanceof To)for(a.temporaryTextBlock===null&&(a.temporaryTextBlock=new To),bt=a.temporaryTextBlock,y1(bt,yt),Wt=0;Wt<Ct;Wt++)Zt=xt[Wt],Zt.actualBounds&&Zt.measuredBounds&&Zt.naturalBounds&&(bt.ec=Zt.text||"",bt.Kb=Zt.Sz||0,bt.Gc=Zt.lineCount||0,$t=Zt.lines,$t!==void 0&&(bt.Cb=$t[0],bt.Ih=$t[1],bt.df=$t[2],bt.Le=$t[3],bt.Qc=$t[4],bt.Qb=$t[5],bt.ze=$t[6]),Zt.naturalBounds&&(bt.dc=Zt.naturalBounds),Zt.actualBounds&&($t=Zt.actualBounds,bt.arrange($t.x,$t.y,$t.width,$t.height)),$t=Zt.actualBounds,bt.arrange($t.x,$t.y,$t.width,$t.height),ne=Zt.measuredBounds,Zt=Zt.naturalBounds,re=bt.Ab,re.reset(),re.translate($t.x+rt.x,$t.y+rt.y),re.translate(-ne.x,-ne.y),bt.no(re,Zt.x,Zt.y,Zt.width,Zt.height),_l(bt,!1),bt.wh.set(bt.Ab),bt.Kk=bt.scale,wl(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(fe.call(this),this.na=null,a===void 0)this.na=wn.Position;else if(typeof a=="string"){var x=tu.I(a);x!==null&&(this.na=x)}else a instanceof wa?this.na=a:a&&(this.na=wn.Position,y=a);this.na===null&&Qt("Panel type not specified or PanelLayout not loaded: "+a),this.l=this.l|4194304|(this.na===wn.Grid?1048576:0),this.O=new un,this.yb=ca,this.Tm=xa,this.Uf=rr,this.$g=null,this.$e="",this.jg=new Oe(NaN,NaN,NaN,NaN),this.T=this.F=null,this.xo=Mi,this.jn=so,this.kn=Dn,this.ub=this.ra=null,this.zn=NaN,this.ge=this.Hh=null,y&&Object.assign(this,y)}Ee(wn,fe),wn.prototype.cloneProtected=function(a){fe.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){fe.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=fe.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 qn&&(z.Te=!0);var rt=a.diagram;rt!==null&&rt.undoManager.isUndoingRedoing||z.cb(ao,"elements",a,null,b,null,tt)}}return a}return null},wt=wn.prototype,wt.toString=function(){return"Panel("+this.type.name+")#"+Oi(this)},wt.Pn=function(a){fe.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 Qs){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 gt=lt.separatorStroke;if(gt===null&&(gt=x?a.defaultRowSeparatorStroke:a.defaultColumnSeparatorStroke),ut!==0&>!==null){ta(a,y,gt,!1,!1,tt,z),gt=!1;var yt=lt.separatorDashArray;yt===null&&(yt=x?a.defaultRowSeparatorDashArray:a.defaultColumnSeparatorDashArray),yt!==null&&(gt=!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(),gt&&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 gt=E[ut];if(gt!==void 0&>.background!==null&>.coversSeparators!==b&>.actual!==0){var yt=x?tt.height:tt.width;if(!(gt.position>yt)){var xt=gt.Wc(),Ct=gt.separatorStrokeWidth;isNaN(Ct)&&(Ct=x?a.defaultRowSeparatorStrokeWidth:a.defaultColumnSeparatorStrokeWidth);var bt=gt.separatorStroke;bt===null&&(bt=x?a.defaultRowSeparatorStroke:a.defaultColumnSeparatorStroke),(bt===null||gt.index===(x?ot:lt))&&(Ct=0),xt-=Ct,Ct=gt.position+Ct,xt+=gt.actual,Ct+xt>yt&&(xt=yt-Ct),0>=xt||(yt=a.yb,ta(a,y,gt.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(!fe.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 fe.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,gt=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*gt+xt,a=x*ot+E*ut+yt,ot=x*lt+E*gt+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,gt=1,xt=yt=0),rt=a*ot+y*ut+yt,a=a*lt+y*gt+xt,ot=x*ot+E*ut+yt,x=x*lt+E*gt+xt,b.h(ot,x),E=(ot-rt)*(ot-rt)+(x-a)*(x-a),lt=!1,gt=this.O.s,xt=gt.length,ut=Tt.alloc(),yt=null,y=1/0;var Ct=null,bt=this.isClipping&&this.na===wn.Spot;bt&&(Ct=Tt.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 Wt=0;Wt<xt;Wt++){var Zt=gt[Wt];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),Tt.free(Ct)),Tt.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();fe.prototype.Gj.call(this)},wt.v=function(a){if(!ul(this)){fe.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=Ts(b,!1);(b instanceof Ps||b instanceof wn||b instanceof To||z!==ln)&&b.v(!0)}}}},wt.Uj=function(){if(!ul(this)){ma(this,!0),Hu(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)){_l(this,!0),wl(this,!0);for(var a=this.O.s,y=a.length,x=0;x<y;x++)a[x].Wu()}},wt.Wu=function(){wl(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),lo(b,a,ot),lo(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=Ts(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=ln),a){case ln:(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 Bi:this.v(!0),this.measure(x+rt,z+tt,0,0);break;case _i: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(Or(0,0,y.width,y.height,a.x,a.y)){y=this.O.s;for(var E=y.length,b=Tt.allocAt(0,0);E--;){var z=y[E];if((z.visible||z===x)&&(An(b.set(a),z.transform),z.ca(b)))return Tt.free(b),!0}return Tt.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 gr&&(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),Ss(this)))return null;var E=this.naturalBounds,b=1/this.Df(),z=this.se(),tt=z?a:An(Tt.allocAt(a.x,a.y),this.transform),rt=this.diagram,ot=10,lt=5;if(rt!==null&&(ot=rt.Ql("extraTouchArea"),lt=ot/2),Or(-(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=Tt.alloc(),lt=(ot=this.isClipping&&this.na===wn.Spot)?this.Pb():null,ot&&(lt.se()?An(rt.set(a),lt.transform):rt.set(a),!lt.ca(rt)))return Tt.free(rt),z||Tt.free(tt),null;for(var gt=ch(this);ut--;){var yt=b[ut];if((yt.visible||yt===gt)&&(yt.se()?An(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 Tt.free(rt),z||Tt.free(tt),xt}}Tt.free(rt)}return this.background===null&&this.areaBackground===null?(z||Tt.free(tt),null):(a=Or(0,0,E.width,E.height,tt.x,tt.y)?this:null,z||Tt.free(tt),a)}return z||Tt.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:An(Tt.allocAt(a.x,a.y),this.transform);if(b=Or(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=Tt.alloc(),ut=ch(this);ot--;){var gt=rt[ot];if(gt.visible||gt===ut){gt.se()?An(lt.set(a),gt.transform):lt.set(a);var yt=gt;gt=gt instanceof wn?gt:null,(gt!==null?gt.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))}}Tt.free(lt)}return z||Tt.free(tt),b&&(this.background!==null||this.areaBackground!==null)}return z||Tt.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=oe.alloc(),tt.reset()),tt.multiply(this.transform),this.fh(a,tt))return mv(this,y,x,b),z===void 0&&oe.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 gt=ut.actualBounds,yt=this.naturalBounds;gt.x>yt.width||gt.y>yt.height||0>gt.x+gt.width||0>gt.y+gt.height||(gt=ut,ut=ut instanceof wn?ut:null,yt=oe.alloc(),yt.set(tt),(ut!==null?ut.Cf(a,y,x,E,b,yt):ka(gt,a,E,yt))&&(y!==null&&(gt=y(gt)),gt===null||x!==null&&!x(gt)||b.add(gt)),oe.free(yt))}}return z===void 0&&oe.free(tt),E}return z===void 0&&oe.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:An(Tt.allocAt(a.x,a.y),this.transform),lt=rt?y:An(Tt.allocAt(y.x,y.y),this.transform),ut=ot.Bf(lt),gt=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||(Tt.free(ot),Tt.free(lt)),gt){if(!this.isAtomic){ot=Tt.alloc(),lt=Tt.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,Wt=this.naturalBounds;(!rt||!(bt.x>Wt.width||bt.y>Wt.height||0>bt.x+bt.width||0>bt.y+bt.height))&&(Ct.se()?(bt=Ct.transform,An(ot.set(a),bt),An(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)))}}Tt.free(ot),Tt.free(lt)}return b?gt:tt}return!1};function vv(a){var y=null;return a instanceof gr&&(y=a.spot1,y===xa&&(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 gr&&(y=a.spot2,y===xa&&(y=null),a=a.geometry,a!==null&&y===null&&(y=a.spot2)),y===null&&(y=io),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 Ti&&Qt("Cannot add a Part to a Panel: "+y+"; use a Panel instead"),(this===y||this.rg(y))&&(this===y&&Qt("Cannot make a Panel contain itself: "+this.toString()),Qt("Cannot make a Panel indirectly contain itself: "+this.toString()+" already contains "+y.toString()));var x=y.panel;if(x!==null&&x!==this&&Qt("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 gr||Qt("Can only add Shapes to a Grid Panel, not: "+y),this.na!==wn.Graduated||y instanceof gr||y instanceof To||Qt("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 Qt("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),ul(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 qn&&(x.Te=!0),x.Te&&x instanceof qn&&(x.wc=null),b=this.diagram,b!==null&&b.undoManager.isUndoingRedoing||(E!==-1&&x.cb(mo,"elements",this,y,null,E,null),x.cb(ao,"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),ma(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 qn&&(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(mo,"elements",this,E,null,a,null))},wt.Fb=function(a){0>a&&bn(a,">= 0",wn,"getRowDefinition:idx"),a=Math.round(a);var y=this.rowDefs;if(y[a]===void 0){var x=new va;x.wi(this),x.isRow=!0,x.index=a,y[a]=x,this.cb(ao,"rowdefs",this,null,x,null,a)}return y[a]},wt.oA=function(a){if(0>a&&bn(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(mo,"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 va?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&&bn(a,">= 0",wn,"getColumnDefinition:idx"),a=Math.round(a);var y=this.colDefs;if(y[a]===void 0){var x=new va;x.wi(this),x.isRow=!1,x.index=a,y[a]=x,this.cb(ao,"coldefs",this,null,x,null,a)}return y[a]},wt.jA=function(a){if(0>a&&bn(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(mo,"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 va?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 va(y)),this},wt.By=function(a,y){return(a=this.Eb(a))&&km(a,new va(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 Tt(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 jl(a){var y=a.allBindings;if(y===null)a.data!==null&&Qt("Template cannot have .data be non-null: "+a),a.allBindings=y=new un;else if(y._isFrozen)return;var x=new un;Sv(a,!1),a.qm(a,function(lt,ut){ut.th();var gt=ut.localBindings;if(gt!==null)for(Dc(ut,!1),gt=gt.iterator;gt.next();){var yt=gt.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 un),xt.srcBindings.add(yt))),y.add(yt)}if(ut instanceof wn&&ut.type===wn.Table){if(0<ut.rowCount){for(lt=ut.rowDefs,gt=lt.length,yt=0;yt<gt;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,gt=0;gt<lt;gt++)if(yt=ut[gt],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 un),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):_n('Warning: unable to find GraphObject named "'+tt+'" for Binding: '+b.toString())),z instanceof va?(tt=Oi(z.panel),b.Ai=tt===void 0?-1:tt,z.panel.bindingId=b.Ai):z instanceof fe?(tt=Oi(z),b.Ai=tt===void 0?-1:tt,z.bindingId=b.Ai):Qt("Unknown type of binding target: "+z)}y.freeze(),a instanceof Ti&&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&&jl(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 gr&&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),ul(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 qn&&(y.Te=!0),y.Te&&y instanceof qn&&(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(jl(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=oa(y,a)}else return"";if(a===void 0)return"";if(typeof a=="string")return a;Qt("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,_n('No item template Panel found for category "'+y+'" on '+a),_n(" Using default item template."),a=new wn,y=new To,y.bind(new sa("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 Nu(a,y){y.name=a,tu.add(a,y)}Ue.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&&bn(a,">= 0",wn,"padding"),a=new dr(a)):(0>a.left&&bn(a.left,">= 0",wn,"padding:value.left"),0>a.right&&bn(a.right,">= 0",wn,"padding:value.right"),0>a.top&&bn(a.top,">= 0",wn,"padding:value.top"),0>a.bottom&&bn(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:ca},set:function(a){typeof a=="number"&&(a=new dr(a));var y=this.defaultSeparatorPadding;y.D(a)||(a=a.J(),this.T===null&&(this.T=new Ll),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 vo)&&(a instanceof vo&&a.freeze(),this.T===null&&(this.T=new Ll),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 Ll),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)||Qt("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 Ll),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 vo)&&(a instanceof vo&&a.freeze(),this.T===null&&(this.T=new Ll),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 Ll),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)||Qt("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 Ll),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 Ll),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||Qt("Invalid Panel.gridCellSize: "+a),this.jn=a.J();var x=this.diagram;x!==null&&this===x.grid&&Mu(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()||Qt("Invalid Panel.gridOrigin: "+a),this.kn=a.J();var x=this.diagram;x!==null&&this===x.grid&&Mu(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),Ua(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),Ua(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 Ll),this.T.Pc}},rowCount:{get:function(){return this.T===null?0:this.rowDefs.length}},colDefs:{get:function(){return this.T===null&&(this.T=new Ll),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 Ll),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 Ll),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)&&Qt("Panel.topIndex must be greater than zero and a real number, not: "+a),this.T===null&&(this.T=new Ll),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)&&Qt("Panel.leftIndex must be greater than zero and a real number, not: "+a),this.T===null&&(this.T=new Ll),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 Ti&&!(this instanceof Qr);jl(this),this.ub=a;var E=this.diagram;E!==null&&(x?(x=E.partManager,this instanceof kn?(y!==null&&x.bf.remove(y),a!==null&&x.bf.add(a,this)):this instanceof Ti&&(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 Ti||a.isPanelMain)&&Qt("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(););yr(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&&(yr(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 nr&&(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))}}}),Ue.Object.defineProperties(wn,{Position:{get:function(){return tu.I("Position")}},Horizontal:{get:function(){return tu.I("Horizontal")}},Vertical:{get:function(){return tu.I("Vertical")}},Spot:{get:function(){return tu.I("Spot")}},Auto:{get:function(){return tu.I("Auto")}},Table:{get:function(){return tu.I("Table")}},Viewbox:{get:function(){return tu.I("Viewbox")}},TableRow:{get:function(){return tu.I("TableRow")}},TableColumn:{get:function(){return tu.I("TableColumn")}},Link:{get:function(){return tu.I("Link")}},Grid:{get:function(){return tu.I("Grid")}},Graduated:{get:function(){return tu.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,tu=new be;wn.className="Panel",wn.definePanelLayout=Nu,Nu("Position",new gm),Nu("Vertical",new mm),Nu("Auto",new ym),Nu("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 Ll(){this.Pc=[],this.Oc=[],this.j=this.ob=Nm,this.hb=this.Hb=0,this.Qp=ca,this.Ha=1,this.V=this.ia=null,this.F=1,this.nb=this.o=this.u=null}Ll.prototype.copy=function(a){for(var y=new Ll,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},Ll.className="TablePanelSettings";function va(a){Gi(this),this.Me=null,this.uq=!0,this.Za=0,this.Hc=NaN,this.jj=0,this.hj=1/0,this.Jb=xa,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))}va.prototype.copy=function(){var a=new va;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=Nn(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=Nn(y.separatorDashArray)),a.background=y.background,a.coversSeparators=y.coversSeparators,a.be=y.be}wt=va.prototype,wt.qb=function(a){a.classType===va&&(this.sizing=a)},wt.toString=function(){return"RowColumnDefinition "+(this.isRow?"(Row ":"(Column ")+this.index+") #"+Oi(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(pr,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 sa(a,y,x,E):b=a,b.xd=this,a=this.panel,a!==null&&(y=a.ih(),y!==null&&c1(y)&&Qt("Cannot add a Binding to a RowColumnDefinition that is already frozen: "+b+" on "+a)),this.be===null&&(this.be=new un),this.be.add(b),this},Ue.Object.defineProperties(va.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&&bn(a,">= 0",va,"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&&bn(a,">= 0",va,"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))&&bn(a,">= 0",va,"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&&bn(a,">= 0",va,"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 dr(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 vo&&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)||Qt("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 vo&&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}}}),va.prototype.computeEffectiveSpacing=va.prototype.Wc,va.prototype.computeEffectiveSpacingTop=va.prototype.Io;var Cv=new Ae(va,"Default",0),$g=new Ae(va,"None",1),Nm=new Ae(va,"ProportionalExtra",2);va.className="RowColumnDefinition",va.Default=Cv,va.None=$g,va.ProportionalExtra=Nm;function gr(a,y){fe.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)}Ee(gr,fe),gr.prototype.cloneProtected=function(a){fe.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=Nn(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=gr.prototype,wt.th=function(){fe.prototype.th.call(this),this.Na!==null&&(this.Na.nc=!0)},wt.qb=function(a){a===ln||a===Mi||a===jr||a===rr?this.geometryStretch=a:fe.prototype.qb.call(this,a)},wt.toString=function(){return"Shape("+(this.figure!=="None"?this.figure:this.toArrow!=="None"?this.toArrow:this.fromArrow)+")#"+Oi(this)};function Of(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,gt,yt,xt,Ct,bt=0,Wt=Jn(),Zt=2;Zt<b;Zt+=2)lt=x[Zt],ut=x[Zt+1],gt=lt-rt,rt=ut-ot,gt===0&&(gt=.001),yt=rt/gt,xt=Math.atan2(rt,gt),Ct=Math.sqrt(gt*gt+rt*rt),Wt.push([gt,xt,yt,Ct]),bt+=Ct,rt=lt,ot=ut;rt=x[0],ot=x[1],gt=E.measuredBounds.width,E instanceof gr&&(gt-=E.strokeWidth),1>gt&&(gt=1),b=x=gt,lt=tt/2,ut=lt!==0,Zt=0,Ct=Wt[Zt],gt=Ct[0],xt=Ct[1],yt=Ct[2],Ct=Ct[3];for(var $t=0;.1<=bt;){if($t===0&&(ut?(b=x,b-=lt,bt-=lt,ut=!1):b=x,b===0&&(b=1)),b>bt){ii(Wt);return}b>Ct?($t=b-Ct,b=Ct):$t=0;var ne=Math.sqrt(b*b/(1+yt*yt));if(0>gt&&(ne=-ne),rt+=ne,ot+=yt*ne,a.translate(rt,ot),a.rotate(xt),a.translate(-(tt/2),-(z/2)),$t===0&&E.hh(a,y),a.translate(tt/2,z/2),a.rotate(-xt),a.translate(-rt,-ot),bt-=b,Ct-=b,$t!==0){if(Zt++,Zt===Wt.length){ii(Wt);return}Ct=Wt[Zt],gt=Ct[0],xt=Ct[1],yt=Ct[2],Ct=Ct[3],b=$t}}ii(Wt)}}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&&ta(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 gr&&rt.adornedPart.Pb()===rt.adornedObject?rt.adornedObject.strokeWidth:0),ot===0&&(x=null),x!==null&&ot!==0&&(ta(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===ce.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===ce.u){var lt=b.startX;ot=b.startY;var ut=b.endX,gt=b.endY;b=Math.min(lt,ut);var yt=Math.min(ot,gt);lt=Math.abs(ut-lt),ot=Math.abs(gt-ot),a.beginPath(),a.rect(b,yt,lt,ot),E!==null&&a.ng(E),x!==null&&(rt&&z&&Wu(a),a.jk(),rt&&z&&uh(a)),a.Se()}else if(b.type===ce.F)lt=b.startX,ot=b.startY,ut=b.endX,gt=b.endY,b=Math.abs(ut-lt)/2,yt=Math.abs(gt-ot)/2,lt=Math.min(lt,ut)+b,ot=Math.min(ot,gt)+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&&Wu(a),a.jk(),rt&&z&&uh(a)),a.Se();else if(b.type===ce.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,gt=ut.length;for(var xt=null,Ct=0;Ct<gt;Ct++){var bt=ut[Ct];switch(bt.type){case ir:a.moveTo(bt.endX,bt.endY);break;case Ui:a.lineTo(bt.endX,bt.endY);break;case kr:a.bezierCurveTo(bt.point1X,bt.point1Y,bt.point2X,bt.point2Y,bt.endX,bt.endY);break;case Er:a.quadraticCurveTo(bt.point1X,bt.point1Y,bt.endX,bt.endY);break;case Tr:if(bt.radiusX===bt.radiusY){var Wt=Math.PI/180;a.arc(bt.point1X,bt.point1Y,bt.radiusX,bt.startAngle*Wt,(bt.startAngle+bt.sweepAngle)*Wt,0>bt.sweepAngle,xt!==null?xt.endX:lt.startX,xt!==null?xt.endY:lt.startY)}else if(xt=to(bt,lt),Wt=xt.length,Wt===0)a.lineTo(bt.centerX,bt.centerY);else for(var Zt=0;Zt<Wt;Zt++){var $t=xt[Zt];Zt===0&&a.lineTo($t[0],$t[1]),a.bezierCurveTo($t[2],$t[3],$t[4],$t[5],$t[6],$t[7])}break;case eo:if(Zt=Wt=0,xt!==null&&xt.type===Tr){if(xt=to(xt,lt),$t=xt.length,$t===0){a.lineTo(bt.endX,bt.endY);break}xt=xt[$t-1]||null,xt!==null&&(Wt=xt[6],Zt=xt[7])}else Wt=xt!==null?xt.endX:lt.startX,Zt=xt!==null?xt.endY:lt.startY;if(xt=Hi(bt,lt,Wt,Zt),Wt=xt.length,Wt===0){a.lineTo(bt.endX,bt.endY);break}for(Zt=0;Zt<Wt;Zt++)$t=xt[Zt],a.bezierCurveTo($t[2],$t[3],$t[4],$t[5],$t[6],$t[7]);break;default:Qt("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&&Wu(a),a.jk(),ut&&rt&&uh(a))):(Wu(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=Jn(),z.type===ce.j)E.push(z.startX),E.push(z.startY),E.push(z.endX),E.push(z.endY),Of(a,y,E,x);else if(z.type===ce.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,gt=0;gt<ut;gt++){switch(Ct=lt[gt],Ct.type){case ir:Of(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 Ui:E.push(Ct.endX),E.push(Ct.endY),tt=Ct.endX,b=Ct.endY;break;case kr:_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 Er:_t.ep(tt,b,Ct.point1X,Ct.point1Y,Ct.endX,Ct.endY,.5,E),tt=Ct.endX,b=Ct.endY;break;case Tr:if(bt=to(Ct,rt),xt=bt.length,xt===0){E.push(Ct.centerX),E.push(Ct.centerY),tt=Ct.centerX,b=Ct.centerY;break}for(Wt=0;Wt<xt;Wt++)Zt=bt[Wt],_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 eo:if(bt=Hi(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(Wt=0;Wt<xt;Wt++)Zt=bt[Wt],_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:Qt("Segment not of valid type: "+Ct.type)}Ct.isClosed&&(E.push(ot),E.push(yt),Of(a,y,E,x))}Of(a,y,E,x)}else if(z.type===ce.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),Of(a,y,E,x);else if(z.type===ce.F){if(b=new Ir,b.startX=z.endX,b.startY=(z.startY+z.endY)/2,tt=new Vi(Tr),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=to(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];Of(a,y,E,x)}ii(E),a.restore(),a.Vc(!1)}}}},wt.kk=function(a,y,x){return!fe.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:fe.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 Tt),a instanceof yi){a.Mc()&&Qt("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 Oe);var y=this.naturalBounds,x=this.oe;y=Oe.allocAt(y.x,y.y,y.width,y.height);var E=this.strokeWidth;return y.Bc(E/2,E/2),E=Tt.allocAt(y.x,y.y).transform(x),a.h(E.x,E.y,0,0),E.h(y.right,y.y).transform(x),zr(a,E.x,E.y,0,0),E.h(y.right,y.bottom).transform(x),zr(a,E.x,E.y,0,0),E.h(y.x,y.bottom).transform(x),zr(a,E.x,E.y,0,0),Oe.free(y),Tt.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!==ce.j||y||(b+=2);var z=Oe.alloc();if(z.assign(E),z.Bc(b+2,b+2),!z.ca(a))return Oe.free(z),!1;if(E=b+1e-4,x.type===ce.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:(Oe.free(z),_t.Yb(x.startX,x.startY,x.endX,x.endY,b,a.x,a.y));if(x.type===ce.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 Oe.free(z),!1;z.Bc(E,E)}return this.stroke!==null&&z.Bc(b,b),a=z.ca(a),Oe.free(z),a}if(x.type===ce.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 Oe.free(z),!1;tt+=E,b+=E}return this.stroke!==null&&(tt+=E,b+=E),Oe.free(z),0>=tt||0>=b?!1:1>=x*x/(tt*tt)+y*y/(b*b)}if(x.type===ce.o)return Oe.free(z),this.fill===null?Pr(x,a.x,a.y,b):Fr(x,a,b,1<this.strokeWidth,y);Qt("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):Qt("Unsupported Figure: "+rt)}tt=ot.bounds}rt=tt.width,ot=tt.height,lt=tt.width;var ut=tt.height;switch(Ts(this,!0)){case ln:E=x=0;break;case Sn:lt=Math.max(a-z,0),ut=Math.max(y-z,0);break;case Bi:lt=Math.max(a-z,0),E=0;break;case _i:x=0,ut=Math.max(y-z,0)}isFinite(b.width)&&(lt=b.width),isFinite(b.height)&&(ut=b.height);var gt=this.maxSize,yt=this.minSize;switch(x=Math.max(x-z,yt.width),E=Math.max(E-z,yt.height),lt=Math.min(gt.width,lt),ut=Math.min(gt.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 ln:break;case Sn:rt=lt,ot=ut;break;case Mi:x=Math.min(lt/rt,ut/ot),isFinite(x)||(x=1),rt*=x,ot*=x;break;default:Qt(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=gr.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(gt.width,lt),ut=Math.min(gt.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,gt=tt*(z.m21*z.dy-z.m22*z.dx),yt=tt*(z.m12*z.dx-z.m11*z.dy);z=a*rt+y*lt+gt,tt=a*ot+y*ut+yt,rt=x*rt+E*lt+gt,ot=x*ot+E*ut+yt,gt=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===ce.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=gt,ut=0):(y=(lt.endY-lt.startY)/(lt.endX-lt.startX),ut=gt/Math.sqrt(1+y*y),E=ut*y),y=Jn(),a=new Tt,_t.Ve(lt.startX+E,lt.startY+ut,lt.endX+E,lt.endY+ut,z,tt,rt,ot,a)&&y.push(a),a=new Tt,_t.Ve(lt.startX-E,lt.startY-ut,lt.endX-E,lt.endY-ut,z,tt,rt,ot,a)&&y.push(a),a=new Tt,_t.Ve(lt.startX+E,lt.startY+ut,lt.startX-E,lt.startY-ut,z,tt,rt,ot,a)&&y.push(a),a=new Tt,_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 ii(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);ii(y)}else if(lt.type===ce.u)ut=_t.Ff(xt.x-gt,xt.y-gt,xt.x+xt.width+gt,xt.y+xt.height+gt,z,tt,rt,ot,b);else if(lt.type===ce.F){y=Oe.allocAt(xt.x,xt.y,xt.width,xt.height).Bc(gt,gt);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}gt=Math.sqrt(a*a*x*x+lt*lt-ot*ot),rt=(-(a*a*x*ot)+a*lt*gt)/(lt*lt+a*a*x*x)+E,a=(-(a*a*x*ot)-a*lt*gt)/(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}Oe.free(y)}else if(lt.type===ce.o){yt=Tt.alloc();var Ct=rt-z,bt=ot-tt,Wt=Ct*Ct+bt*bt,Zt=z,$t=tt;if(0<Wt&&xt.contains(Zt,$t)&&(yt.x=Zt,yt.y=$t,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,$t-=bt;xt.contains(Zt,$t);)Zt-=Ct,$t-=bt;for(b.x=rt,b.y=ot,bt=0;bt<lt.figures.count;bt++){var ne=lt.figures.s[bt],re=ne.isFilled?Zt:z,de=ne.isFilled?$t:tt,Fe=ne.segments;xt=ne.startX,Ct=ne.startY;for(var Wn=xt,mi=Ct,ui=0;ui<Fe.count;ui++){var Fn=Fe.s[ui],rn=Fn.type,er=Fn.endX,Ki=Fn.endY,no=!1;switch(rn){case ir:Wn=er,mi=Ki;break;case Ui:no=Am(xt,Ct,er,Ki,re,de,rt,ot,yt);break;case kr:no=_t.Eo(xt,Ct,Fn.point1X,Fn.point1Y,Fn.point2X,Fn.point2Y,er,Ki,re,de,rt,ot,.6,yt);break;case Er:no=_t.Eo(xt,Ct,xt+2/3*(Fn.point1X-xt),Ct+2/3*(Fn.point1Y-Ct),er+2/3*(Fn.point1X-er),Ki+2/3*(Fn.point1Y-Ki),er,Ki,re,de,rt,ot,.6,yt);break;case Tr:case eo:rn=Fn.type===Tr?to(Fn,ne):Hi(Fn,ne,xt,Ct);var No=rn.length;if(No===0){no=Am(xt,Ct,Fn.type===Tr?Fn.centerX:Fn.endX,Fn.type===Tr?Fn.centerY:Fn.endY,re,de,rt,ot,yt);break}for(Ki=null,er=0;er<No;er++){if(Ki=rn[er],er===0&&Am(xt,Ct,Ki[0],Ki[1],re,de,rt,ot,yt)){var ba=Bm(re,de,yt,Wt,b);ba<Wt&&(Wt=ba,ut=!0)}_t.Eo(Ki[0],Ki[1],Ki[2],Ki[3],Ki[4],Ki[5],Ki[6],Ki[7],re,de,rt,ot,.6,yt)&&(ba=Bm(re,de,yt,Wt,b),ba<Wt&&(Wt=ba,ut=!0))}er=Ki[6],Ki=Ki[7];break;default:Qt("Unknown Segment type: "+rn)}xt=er,Ct=Ki,no&&(no=Bm(re,de,yt,Wt,b),no<Wt&&(Wt=no,ut=!0)),Fn.isClosed&&(er=Wn,Ki=mi,Am(xt,Ct,er,Ki,re,de,rt,ot,yt)&&(Fn=Bm(re,de,yt,Wt,b),Fn<Wt&&(Wt=Fn,ut=!0)))}}z=x-a,tt=E-y,rt=Math.sqrt(z*z+tt*tt),rt!==0&&(z/=rt,tt/=rt),b.x-=z*gt,b.y-=tt*gt,Tt.free(yt)}else Qt("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=Tt.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)))),Tt.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=oe.alloc();x.set(y),x.Vj();var E=a.left,b=a.right,z=a.top;a=a.bottom;var tt=Tt.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 Tt.free(tt),!0;var rt=Tt.alloc(),ot=Tt.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)))),Tt.free(tt),oe.free(x),Tt.free(rt),Tt.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(Wt,Zt){for(var $t=Wt.length,ne=0;ne<$t;ne+=2)if(Zt.zd(Wt[ne],Wt[ne+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,Zn(a.x,a.y,rt,ot)<=b&&Zn(a.x,a.y,lt,ot)<=b&&Zn(a.x,a.y,rt,tt)<=b&&Zn(a.x,a.y,lt,tt)<=b)return!0}if(rt=y.startX,ot=y.startY,lt=y.endX,tt=y.endY,y.type===ce.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===ce.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===ce.F){y=a.x-(rt+lt)/2,z=a.y-(ot+tt)/2;var ut=Math.abs(lt-rt)/2,gt=Math.abs(tt-ot)/2;if(ut===0||gt===0)return Xn(a.x,a.y,rt,ot,lt,tt)<=b;if(x){if(a=_t.$y(ut,gt,y,z),a*a<=b)return!0}else return!(Zn(y,z,-ut,0)>=b||Zn(y,z,0,-gt)>=b||Zn(y,z,0,gt)>=b||Zn(y,z,ut,0)>=b)}else if(y.type===ce.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(gt=rt[lt],gt.type){case ir:case Ui:if(tt=gt.endX,ut=gt.endY,a.zd(tt,ut)>b)return!1;break;case kr:var yt=Jn();if(_t.Qe(tt,ut,gt.point1X,gt.point1Y,gt.point2X,gt.point2Y,gt.endX,gt.endY,.8,yt),tt=E(yt,a),ii(yt),tt||(tt=gt.endX,ut=gt.endY,a.zd(tt,ut)>b))return!1;break;case Er:if(yt=Jn(),_t.ep(tt,ut,gt.point1X,gt.point1Y,gt.endX,gt.endY,.8,yt),tt=E(yt,a),ii(yt),tt||(tt=gt.endX,ut=gt.endY,a.zd(tt,ut)>b))return!1;break;case Tr:case eo:yt=gt.type===Tr?to(gt,z):Hi(gt,z,tt,ut);var xt=yt.length;if(xt===0){if(tt=gt.type===Tr?gt.centerX:gt.endX,ut=gt.type===Tr?gt.centerY:gt.endY,a.zd(tt,ut)>b)return!1;break}gt=null;for(var Ct=Jn(),bt=0;bt<xt;bt++)if(gt=yt[bt],Ct.length=0,_t.Qe(gt[0],gt[1],gt[2],gt[3],gt[4],gt[5],gt[6],gt[7],.8,Ct),E(Ct,a))return ii(Ct),!1;ii(Ct),gt!==null&&(tt=gt[6],ut=gt[7]);break;default:Qt("Unknown Segment type: "+gt.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=Aa):a.fromArrow!=="None"&&(a.segmentIndex=0,a.alignmentFocus=new yi(1-Aa.x,Aa.y)))}gr.makeGeometry=function(a,y,x){if(a.toArrow!=="None")var E=Ku[a.toArrow];else a.fromArrow!=="None"?E=Ku[a.fromArrow]:(E=_t.Ze[a.figure],typeof E=="string"&&(E=_t.Ze[E]),E===void 0&&Qt("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=Ku[a];if(y===void 0){var x=a.toLowerCase();if(x==="none")return"None";if(y=Ku[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=ce.parse(_t.um[E],!1),Ku[E]=a,x!==E&&(Ku[x]=E),E}}return typeof y=="string"?y:y instanceof ce?a:null}Ue.Object.defineProperties(gr.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),Ua(this)&&(a=this.part,a!==null&&Ho(this,a,"geometryString"))}}},geometryString:{get:function(){return this.geometry===null?"":this.geometry.toString()},set:function(a){a=ce.parse(a);var y=a.normalize();this.geometry=a,this.position=a=Tt.allocAt(-y.x,-y.y),Tt.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 vo&&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 vo&&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 bn(a,"value >= 0",gr,"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"?bn(a,'"butt", "round", or "square"',gr,"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"?bn(a,'"miter", "bevel", or "round"',gr,"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)||Qt("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()])||Qt("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?Qt("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?Qt("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:xa},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:xa},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 Uu),this.fa.Tk=a;var x=this.diagram;x!==null&&this.panel===x.grid&&Mu(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 Uu),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 Uu),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 Uu),this.fa.o=a,this.v(),this.g("graduatedSkip",y,a))}}}),gr.prototype.intersectsRect=gr.prototype.Yc,gr.prototype.containedInRect=gr.prototype.fh,gr.prototype.getNearestIntersectionPoint=gr.prototype.rs,gr.prototype.getDocumentBounds=gr.prototype.mi,gr.prototype.getDocumentPoint=gr.prototype.ga;var Ku=new fi,Lv=new fi;gr.className="Shape",gr.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},gr.defineFigureGenerator=function(a,y){var x=a.toLowerCase(),E=_t.Ze;E[a]=y,E[x]=a},gr.getArrowheadGeometries=function(){var a=new be;for(E in _t.um)if(Ku[E]===void 0){var y=ce.parse(_t.um[E],!1);Ku[E]=y,y=E.toLowerCase(),y!==E&&(Ku[y]=E)}for(var x in Ku)if(x!==x.toLowerCase()){var E=Ku[x];E instanceof ce&&a.add(x,E)}return a.freeze(),a},gr.defineArrowheadGeometry=function(a,y){var x=null;typeof y=="string"?x=ce.parse(y,!1):x=y,y=a.toLowerCase(),y!=="none"&&a!==y||Qt("Shape.defineArrowheadGeometry name must not be empty or None or all-lower-case: "+a);var E=Ku;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=xa}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 To(a,y){return fe.call(this),_m||(Ds=Qo?new Rl(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}Ee(To,fe),To.prototype.cloneProtected=function(a){fe.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 Bu(a){a.da===null?a.da=new Tv:a.da.nc&&(a.da=a.da.copy())}wt=To.prototype,wt.th=function(){fe.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===To?this.wrap=a:fe.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(){fe.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;ta(this,a,this.xc,!0,!1,x,E),(ot||lt)&&ta(this,a,this.xc,!1,!1,x,E),E=0,x=!1;var ut=this.oe,gt=ut.dx-(tt*ut.m21+ut.dx);ut=ut.dy-(tt*ut.m22+ut.dy);var yt=y.scale;switch(8>(gt*gt+ut*ut)*yt*yt&&(x=!0),y.ib!==a&&(x=!1),y.ib instanceof Qs&&(x=!1),y.Gf("textGreeking")===!1&&(x=!1),y=this.spacingAbove,gt=this.spacingBelow,this.flip){case Kr: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+gt)*ut,z>yt&&(E=this.verticalAlignment,E=E.y*z-E.y*yt+E.offsetY),ut===1&&this.ze!==null)gt=this.Cb,gt>b&&(gt=b),this.Oj(this.ze,a,0,E+y,b,tt,gt,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+gt}switch(this.flip){case Kr: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 gt=0;if(rt)ot==="left"?gt=0:ot==="right"?gt=b-tt:ot==="center"&&(gt=(b-tt)/2),y.fillRect(x+gt,E+.25*z,tt,1);else{if(ot==="left"?gt=0:ot==="right"?gt=b:ot==="center"&&(gt=b/2),b=Tm!==null?Tm(this,z):.75*z,y.fillText(a,x+gt,E+b),a=z/20|0,a===0&&(a=1),ot==="right"?gt-=tt:ot==="center"&&(gt-=tt/2),lt){rt=Dm!==null?Dm(this,z):.8*z,ot=x+gt,lt=E+rt,b=x+gt+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 Qs&&y.ad.classList.add("gojs-td")}ut&&(ut=E+z-z/2.2|0,a%2!==0&&(ut+=.5),E=x+gt,z=ut,x=x+gt+tt,tt=ut,gt=a,y.beginPath(),y.lineWidth=gt,y.moveTo(E,z),y.lineTo(x,tt),y.stroke(),y.Se(),y instanceof Qs&&y.ad.classList.add("gojs-td"))}},wt.kk=function(a,y,x){if(!fe.prototype.kk.call(this,a,y,x))return!1;if(ta(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:fe.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;Ds!==null&&L1!==z&&(L1=Ds.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,eu(rt)),rt=lt+1}z=tt}else tt=z.indexOf(`
|
|
`,0),0<=tt&&(z=z.substr(0,tt)),z=eu(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);eu(lt)>y&&1<lt.length;)lt=lt.substr(0,lt.length-1);lt+=np,y=eu(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),lo(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=eu(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=If(a,tt),tt=tt.substr(z.length),y=If(a,tt),lt=eu(z+y);0<y.length&<<=x;)z+=y,tt=tt.substr(y.length),y=If(a,tt),lt=z+y,b&&(lt=lt.trim()),lt=eu(lt);for(b&&(y=y.trim()),z+=y,x=Math.max(1,x-ot);eu(z)>x&&1<z.length;)z=z.substr(0,z.length-1);a.l|=16777216,z+=np;var ut=eu(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=If(a,tt),tt=tt.substr(y.length);eu(y)>x;){var gt=1;for(lt=eu(y.substr(0,gt)),ut=0;lt<=x;)gt++,ut=lt,lt=eu(y.substr(0,gt));if(gt===1){var yt=lt;z=Math.max(z,lt)}else yt=ut,z=Math.max(z,ut);if(gt--,1>gt&&(gt=1),qg(a,y.substr(0,gt),yt),ot++,y=y.substr(gt),a.Gc+ot>a.maxLines)break}for(ut=If(a,tt),lt=eu(y+ut);0<ut.length&<<=x;)y+=ut,tt=tt.substr(ut.length),ut=If(a,tt),lt=y+ut,b&&(lt=lt.trim()),lt=eu(lt);if(b&&(y=y.trim()),y!==""&&(y[y.length-1]==="\xAD"&&(y=y.substring(0,y.length-1)+"\u2010"),ut.length===0?(gt=lt,z=Math.max(z,lt)):(gt=ut=eu(y),z=Math.max(z,ut)),qg(a,y,gt),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 If(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 eu(a){return Ds===null?8*a.length:Ds.measureText(a).width}function tp(a){if(a.df!==null)return a.df;var y=a.Ae;if(Ds===null){var x=16;return a.df=x}return Bv[y]!==void 0&&5e3>E1?x=Bv[y]:(x=1.3*Ds.measureText("M").width,Bv[y]=x,E1++),a.df=x}function S1(a){if(Ds===null)return 6;if(Im[a]!==void 0&&5e3>Av)var y=Im[a];else y=Ds.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=en.alloc();Mv(a,z,y,ot),b+=ot.height,en.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}Ue.Object.defineProperties(To.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"||(Bu(this),this.da.Or=a,this.N(),this.g("textAlign",y,a))}},flip:{get:function(){return this.da!==null?this.da.Xf:ln},set:function(a){var y=this.flip;y!==a&&(Bu(this),this.da.Xf=a,this.N(),this.g("flip",y,a))}},verticalAlignment:{get:function(){return this.da!==null?this.da.Yr:Kl},set:function(a){var y=this.verticalAlignment;y.D(a)||(a=a.J(),Bu(this),this.da.Yr=a,ys(this),this.g("verticalAlignment",y,a))}},naturalBounds:{get:function(){if(!this.dc.w()){var a=en.alloc();Mv(this,this.ec,999999,a);var y=a.width;en.free(a),a=x1(this,y);var x=this.desiredSize;isNaN(x.width)||(y=x.width),isNaN(x.height)||(a=x.height),lo(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&&(Bu(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&&(Bu(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 vo&&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&&(Bu(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&&(Bu(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 Uu),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 Uu),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 Uu),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 Uu),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 Uu),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&&(Bu(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&&(Bu(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&&(Bu(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&&(Bu(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&&(Bu(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&&bn(a,"> 0",To,"maxLines"),Bu(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 Ae(To,"None",0),P1=new Ae(To,"WrapFit",1),bv=new Ae(To,"WrapDesiredSize",2),w1=new Ae(To,"WrapBreakAll",3),Nv=new Ae(To,"OverflowClip",0),Om=new Ae(To,"OverflowEllipsis",1),ep=new Ae(To,"FormatTrim",0),C1=new Ae(To,"FormatNone",0),Sx=/[ \u200b\u00ad]/,Bv=new fi,E1=0,Im=new fi,Av=0,np="...",L1="",Ds=null,_m=!1;To.className="TextBlock";function Tv(){this.nc=!1,this.Hd=null,this.Xf=ln,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=Kl,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},To.getEllipsis=function(){return np},To.setEllipsis=function(a){np=a,Im=new fi,Av=0},To.getBaseline=function(){return Tm},To.setBaseline=function(a){Tm=a},To.getUnderline=function(){return Dm},To.setUnderline=function(a){Dm=a},To.isValidFont=function(a){if(_m||(Ds=Qo?new Rl(null).context:null,_m=!0),Ds===null)return!0;var y=Ds.font;if(a===y||a==="10px sans-serif")return!0;Ds.font="10px sans-serif",Ds.font=a;var x=Ds.font;if(x!=="10px sans-serif")return Ds.font=y,!0;Ds.font="19px serif";var E=Ds.font;return Ds.font=a,x=Ds.font,Ds.font=y,x!==E},To.FormatNone=C1,To.FormatTrim=ep,To.None=kv,To.OverflowClip=Nv,To.OverflowEllipsis=Om,To.WrapBreakAll=w1,To.WrapDesiredSize=bv,To.WrapFit=P1;function Uu(){this.Tk=1,this.u=0,this.j=1,this.o=this.F=null}Uu.prototype.copy=function(){var a=new Uu;return a.Tk=this.Tk,a.u=this.u,a.j=this.j,a.F=this.F,a.o=this.o,a},Uu.className="GradElementSettings";function Os(a,y){fe.call(this),this.Eg=null,this.qo="",this.Xg=bs,this.Nk=Sn,this.Zg=this.Hd=null,this.Mk=cr,this.Xf=ln,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 _f;Ee(Os,fe),Os.prototype.cloneProtected=function(a){fe.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},Os.prototype.qb=function(a){a===ln||a===Mi||a===jr?this.imageStretch=a:fe.prototype.qb.call(this,a)},Os.prototype.toString=function(){return"Picture("+this.source+")#"+Oi(this)};function Rf(a){a===void 0&&(a=""),a!==""?_f[a]&&(delete _f[a],Rm--):(_f=new fi,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()||(ma(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=Jn();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);ii(z)}}y.Bg.clear()}},y.addEventListener("load",y.Fq),y.addEventListener("error",y.Yp),y.qy=!0)}Os.prototype.hA=function(){if(this.source!==""){Rf(this.source);var a=this.source;this.source="",this.source=a}},Os.prototype.redraw=function(){this.N(),this.Uc=!0},Os.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 Qs;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 gt=ot,yt=rt,xt=this.Nk,Ct=this.Mk;switch(xt){case ln:if(this.sourceRect.w())break;gt>=E.width&&(z=z+Ct.offsetX+(gt*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,gt),rt=Math.min(E.height,yt);break;case Sn:gt=E.width,yt=E.height;break;case Mi:case jr:xt===Mi?(xt=Math.min(E.height/yt,E.width/gt),gt*=xt,yt*=xt):xt===jr&&(xt=Math.max(E.height/yt,E.width/gt),gt*=xt,yt*=xt,gt>=E.width&&(z=(z+Ct.offsetX+(gt*Ct.x-E.width*Ct.x)/gt)*ot),yt>=E.height&&(tt=(tt+Ct.offsetY+(yt*Ct.y-E.height*Ct.y)/yt)*rt),ot*=1/(gt/E.width),rt*=1/(yt/E.height),gt=E.width,yt=E.height)}xt=this.Df()*y.scale;var bt=gt*xt*yt*xt,Wt=ot*rt/bt,Zt=x.__goCache;xt=null;var $t=xx;if(!b){if(x.sq&&Zt!==void 0&&4<bt&&Wt>$t*$t)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<Wt;ut++)xt=b[ut];if(!y.Xm){if(this.vl===null)if(this.Eg===null)this.vl=!1;else{b=new Rl(null).context;try{b.drawImage(this.Eg,0,0)}catch(ne){this.en=!1}try{b.getImageData(0,0,1,1).data[3]&&(this.vl=!1),this.vl=!1}catch(ne){this.vl=!0}}if(this.vl)return}}switch(b=gt<E.width?Ct.offsetX+(E.width*Ct.x-gt*Ct.x):0,Ct=yt<E.height?Ct.offsetY+(E.height*Ct.y-yt*Ct.y):0,this.flip){case Kr:a.translate(Math.min(E.width,gt),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,gt),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,gt),Math.min(E.height,yt)),a instanceof Qs&&(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,gt),Math.min(E.height,yt)])}catch(ne){this.en=!1}a.restore()}else try{a.drawImage(x,z,tt,ot,rt,b,Ct,Math.min(E.width,gt),Math.min(E.height,yt)),a instanceof Qs&&(this.bt=[z,tt,ot,rt,b,Ct,Math.min(E.width,gt),Math.min(E.height,yt)])}catch(ne){this.en=!1}switch(this.flip){case Kr:a.scale(-1,1),a.translate(-Math.min(E.width,gt),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,gt),-Math.min(E.height,yt))}}}}},Os.prototype.Wl=function(a,y,x,E){var b=this.desiredSize,z=Ts(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===Bi?(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===_i?(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)),lo(this.dc,a,y),this.Ge(0,0,a,y)},Os.prototype.eh=function(a,y,x,E){ds(this,a,y,x,E)},Ue.Object.defineProperties(Os.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||Qt("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 vn),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()||(ma(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=_f;if(Qo){var E=null;if(x[a]!==void 0)E=x[a];else if(a!==""){30<Rm&&(Rf(),x=_f),E=Tn("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}}}),Os.prototype.redraw=Os.prototype.redraw,Os.prototype.reloadSource=Os.prototype.hA;var Rm=0,xx=4;Os.className="Picture",_f=new fi,Os.clearCache=Rf;function M1(){this.gi=null}function k1(a,y,x,E,b){a.gi===null&&(a.gi=[]);var z=new Rl(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 jf(){this.os=new ce,this.mc=null}jf.prototype.reset=function(a){a!==null?(a.ka(),this.os=a,a.figures.clear()):this.os=new ce,this.mc=null};function zf(a,y,x,E,b,z){a.mc=new Ir,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()}jf.prototype.moveTo=function(a,y,x){x===void 0&&(x=!1);var E=new Vi(ir);E.endX=a,E.endY=y,x&&E.close(),this.mc.segments.add(E)},jf.prototype.lineTo=function(a,y,x){x===void 0&&(x=!1);var E=new Vi(Ui);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 Vi(kr);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 Vi(Er);tt.point1X=y,tt.point1Y=x,tt.endX=E,tt.endY=b,z&&tt.close(),a.mc.segments.add(tt)}jf.prototype.arcTo=function(a,y,x,E,b,z,tt){z===void 0&&(z=0),tt===void 0&&(tt=!1);var rt=new Vi(Tr);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 Vi(eo,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 jf,y.reset(a),y)}var zm=null;jf.className="StreamGeometryContext";function ss(a,y){var x=a.toLowerCase(),E=_t.Ze;E[a]=y,E[x]=a}ss("Rectangle",function(a,y,x){a="r"+y+","+x;var E=_t.Mf[a];return E!==void 0||(E=new ce(ce.u),E.endX=y,E.endY=x,_t.Nf<_t.vm&&(_t.Mf[a]=E,_t.Nf++)),E}),ss("Square",function(a,y,x){a="s"+y+","+x;var E=_t.Mf[a];return E!==void 0||(E=new ce(ce.u),E.endX=y,E.endY=x,E.defaultStretch=Mi,_t.Nf<_t.vm&&(_t.Mf[a]=E,_t.Nf++)),E}),ss("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 ce().add(new Ir(a,0,!0).add(new Vi(Ui,y-a,0)).add(new Vi(kr,y,a,y-z,0,y,z)).add(new Vi(Ui,y,x-a)).add(new Vi(kr,y-a,x,y,x-z,y-z,x)).add(new Vi(Ui,a,x)).add(new Vi(kr,0,x-a,z,x,0,x-z)).add(new Vi(Ui,0,a)).add(new Vi(kr,a,0,0,z,z,0).close())),1<z&&(b.spot1=new yi(0,0,z,z),b.spot2=new yi(1,1,-z,-z)),_t.Nf<_t.vm&&(_t.Mf[E]=b,_t.Nf++),b}),ss("Border","RoundedRectangle"),ss("Ellipse",function(a,y,x){a="e"+y+","+x;var E=_t.Mf[a];return E!==void 0||(E=new ce(ce.F),E.endX=y,E.endY=x,E.spot1=Bl,E.spot2=ga,_t.Nf<_t.vm&&(_t.Mf[a]=E,_t.Nf++)),E}),ss("Circle",function(a,y,x){a="c"+y+","+x;var E=_t.Mf[a];return E!==void 0||(E=new ce(ce.F),E.endX=y,E.endY=x,E.spot1=Bl,E.spot2=ga,E.defaultStretch=Mi,_t.Nf<_t.vm&&(_t.Mf[a]=E,_t.Nf++)),E}),ss("TriangleRight",function(a,y,x){return new ce().add(new Ir(0,0).add(new Vi(Ui,y,.5*x)).add(new Vi(Ui,0,x).close())).pm(0,.25,.5,.75)}),ss("TriangleDown",function(a,y,x){return new ce().add(new Ir(0,0).add(new Vi(Ui,y,0)).add(new Vi(Ui,.5*y,x).close())).pm(.25,0,.75,.5)}),ss("TriangleLeft",function(a,y,x){return new ce().add(new Ir(y,x).add(new Vi(Ui,0,.5*x)).add(new Vi(Ui,y,0).close())).pm(.5,.25,1,.75)}),ss("TriangleUp",function(a,y,x){return new ce().add(new Ir(y,x).add(new Vi(Ui,0,x)).add(new Vi(Ui,.5*y,0).close())).pm(.25,.5,.75,1)}),ss("Triangle","TriangleUp"),ss("Diamond",function(a,y,x){return new ce().add(new Ir(.5*y,0).add(new Vi(Ui,0,.5*x)).add(new Vi(Ui,.5*y,x)).add(new Vi(Ui,y,.5*x).close())).pm(.25,.25,.75,.75)}),ss("LineH",function(a,y,x){return a=new ce(ce.j),a.startX=0,a.startY=x/2,a.endX=y,a.endY=x/2,a}),ss("LineV",function(a,y,x){return a=new ce(ce.j),a.startX=y/2,a.startY=0,a.endX=y/2,a.endY=x,a}),ss("None","Rectangle"),ss("BarH","Rectangle"),ss("BarV","Rectangle"),ss("MinusLine","LineH"),ss("PlusLine",function(a,y,x){return new ce().add(new Ir(0,x/2,!1).add(new Vi(Ui,y,x/2)).add(new Vi(ir,y/2,0)).add(new Vi(Ui,y/2,x)))}),ss("XLine",function(a,y,x){return new ce().add(new Ir(0,x,!1).add(new Vi(Ui,y,0)).add(new Vi(ir,0,0)).add(new Vi(Ui,y,x)))}),ss("LineRight",function(a,y,x){return new ce().add(new Ir(.25*y,0,!1).add(new Vi(Ui,.75*y,.5*x)).add(new Vi(Ui,.25*y,x)))}),ss("LineDown",function(a,y,x){return new ce().add(new Ir(0,.25*x,!1).add(new Vi(Ui,.5*y,.75*x)).add(new Vi(Ui,y,.25*x)))}),ss("LineLeft",function(a,y,x){return new ce().add(new Ir(.75*y,0,!1).add(new Vi(Ui,.25*y,.5*x)).add(new Vi(Ui,.75*y,x)))}),ss("LineUp",function(a,y,x){return new ce().add(new Ir(0,.75*x,!1).add(new Vi(Ui,.5*y,.25*x)).add(new Vi(Ui,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=po,this.ir=null,this.jr="",this.lr=xa,this.Gq="",this.Hq=_r,this.Pq=ei,this.Kq=Ni,this.Up=null,this.Cq=127,this.zr=Li,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 Ti(a,y){a===void 0||a instanceof wa||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 Tt(NaN,NaN).freeze(),this.nf=null,this.Ao=NaN,this.vw=-1,this.py=new Oe,this.Rh=null,this.ag=NaN,y&&Object.assign(this,y)}Ee(Ti,wn),Ti.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=Ti.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=hi(this.constructor)+"#"+Oi(this);return this.data!==null&&(a+="("+Ii(this.data)+")"),a};function Is(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===ao&&y==="elements"?b instanceof wn?$d(b,function(ot){sy(rt.partManager,ot),Wd(rt,ot)}):ld(rt,b):a===mo&&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)}},Ti.prototype.updateRelationshipsFromData=function(){var a;this.data!==null&&((a=this.diagram)===null||a===void 0||a.partManager.updateRelationshipsFromData(this))},Ti.prototype.Pj=function(a){var y=this.Qf;return y===null?null:y.I(a)},Ti.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)))}}},Ti.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)}},Ti.prototype.Ej=function(){var a=this.Qf;if(a!==null){var y=Jn();for(a=a.iterator;a.next();)y.push(a.key);a=y.length;for(var x=0;x<a;x++)this.Jf(y[x]);ii(y)}},Ti.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 nr?a.groupSelectionAdornmentTemplate:a.nodeSelectionAdornmentTemplate),!(x instanceof Qr))break t;jl(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()}},Ti.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=Oe.alloc().assign(x);x.ka(),x.x=y.x,x.y=y.y,x.freeze(),a.Xl(E,x),Oe.free(E),_v(a,!1)}}Ti.prototype.Ge=function(a,y,x,E){var b=this.uc;b.h(a,y,x,E),this.Lb===null&&(this.Lb=new oe);var z=this.Lb;z.reset(),this.no(z,a,y,x,E),this.Lb=z,z.ws()||z.pp(b)},Ti.prototype.no=function(a,y,x,E,b){if(this.Ca!==1&&a.scale(this.Ca),this.Kb!==0){var z=cr;this.locationSpot.sb()&&(z=this.locationSpot);var tt=Tt.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),Tt.free(tt)}},Ti.prototype.move=function(a,y){y===!0?this.location=a:this.position=a},Ti.prototype.moveTo=function(a,y,x){a=Tt.allocAt(a,y),this.move(a,x),Tt.free(a)},Ti.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())},Ti.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())},Ti.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 Tt),x=x.Mc()?cr: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}Ti.prototype.mi=function(a){return a===void 0&&(a=new Oe),a.assign(this.actualBounds)},Ti.prototype.Va=function(){this.measure(1/0,1/0),this.arrange()};function A1(a){var y=Tt.alloc(),x=a.locationObject,E=x.naturalBounds,b=x instanceof gr?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}Ti.prototype.arrange=function(){if(Ss(this)===!1)B1(this);else{Hu(this,!1);var a=this.Ib,y=Oe.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),Oe.free(y),_v(this,!1)}},wt=Ti.prototype,wt.Xl=function(a,y){var x=this.diagram;if(x!==null){var E=!1;if(x.Zi===!1&&a.w()){var b=Oe.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),Oe.free(b)}!(this.G&65536)&&a.D(y)||_1(this,E,x),x.N(),!a.w()&&!y.w()||hr(a,y)||(this instanceof qn&&!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 Tt(E.x+(a.x-y),E.y+(a.y-x)),this.g("location",E,this.ke.copy())),cd(this)===!1&&Ss(this)===!1&&(Zm(this),B1(this)),!0};function T1(a,y,x,E,b){y===null||a instanceof Qr||(y=y.animationManager,y.zb&&df(y,a,new Tt(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)||Ss(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,Tt.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||df(x,a,new Tt(z,tt),y),E||y.x===z&&y.y===tt||a.g("position",new Tt(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 qn&&kh(x,a),a.layer.isTemporary||y||x.Ya(),y=a.Ib;var E=x.viewportBounds;E.w()?fd(a)?(wo(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,_n('Should not change the class of the Part when changing category from "'+x+'" to "'+E+'"'),_n(" Old class: "+hi(a.constructor)+", new class: "+hi(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 qn&&(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 qn&&(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)}Ti.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},Ti.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},Ti.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},Ti.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},Ti.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},Ti.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},Ti.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},Ti.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},Ti.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=Ti.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&&!Ss(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 qn&&this.labeledLink!==null&&ys(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 qn&&(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 qn&&(x=y.labeledLink,x!==null)?R1(a,x):y}wt.Td=function(a){return a instanceof nr?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 qn&&(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 nr&&Gm(y,!0),y instanceof qn){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 qn&&(a=y.labeledLink,a!==null&&(y=a)),y=y.containingGroup}for(y=this;y!==null;)y instanceof nr&&Gm(y,!1),y instanceof qn&&(a=y.labeledLink,a!==null&&(y=a)),y=y.containingGroup;return x},Ti.prototype.canLayout=function(){if(!this.isLayoutPositioned||!this.isVisible())return!1;var a=this.layer;return!(a!==null&&a.isTemporary||this instanceof qn&&this.isLinkLabel)},Ti.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 qn&&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 qn){if(x&&y instanceof nr)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 kn)for(y=y.labelNodes;y.next();)gd(a,y.value,x,E,b,z)}}Ue.Object.defineProperties(Ti.prototype,{key:{get:function(){var a=this.diagram;if(a!==null)return a.model.wa(this.data)}},adornments:{get:function(){return this.Qf===null?Lr: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(mo,"parts",y,this,null,E,!0),E=a.oi(99999999,this,!0),y.visible!==a.visible&&this.Zb(a.visible),0<=E&&x.cb(ao,"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&&(Is(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&&gf(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:ei},set:function(a){var y=this.minLocation;y.D(a)||(a=a.J(),Is(this),this.P.Pq=a,this.g("minLocation",y,a))}},maxLocation:{get:function(){return this.P!==null?this.P.Kq:Ni},set:function(a){var y=this.maxLocation;y.D(a)||(a=a.J(),Is(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&&(Is(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(),Is(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,Ss(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&&(jl(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&&(jl(x),x=x.copy(),x===null||x instanceof kn||(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&&(Is(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&&(Is(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&&(Is(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 kn?(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&&(Is(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&&(Is(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&&(Is(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:po},set:function(a){var y=this.resizeCellSize;y.D(a)||(a=a.J(),Is(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&&(Is(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&&(Is(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:xa},set:function(a){var y=this.rotationSpot;y.D(a)||(a=a.J(),Is(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&&Qt("Cannot make a Group a member of itself: "+this.toString()),Qt("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 nr&&x!==null&&x.ai.remove(this),this.Ah=a,a!==null?Wv(a,this):this instanceof nr&&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 nr){for(x=new vn,gd(x,this,!0,0,!0),x=x.iterator;x.next();)if(E=x.value,E instanceof qn)for(E=E.linksConnected;E.next();)Zf(E.value)}if(this instanceof qn){for(x=this.linksConnected;x.next();)Zf(x.value);x=this.labeledLink,x!==null&&Zf(x)}this.g("containingGroup",y,a),a!==null&&(y=a.layer,y!==null&&gf(y,-1,a))}}else Qt("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&&(Is(this),this.P.Kp=a,this.g("containingGroupChanged",y,a))}},isTopLevel:{get:function(){return!(this.containingGroup!==null||this instanceof qn&&this.labeledLink!==null)}},layoutConditions:{get:function(){return this.P!==null?this.P.Cq:127},set:function(a){var y=this.layoutConditions;y!==a&&(Is(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&&(Is(this),this.P.Up=a,this.g("dragComputation",y,a))}},shadowOffset:{get:function(){return this.P!==null?this.P.zr:Li},set:function(a){var y=this.shadowOffset;y.D(a)||(a=a.J(),Is(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&&(Is(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&&(Is(this),this.P.Vg=a,this.N(),this.g("shadowBlur",y,a))}}}),Ti.prototype.invalidateLayout=Ti.prototype.C,Ti.prototype.findCommonContainingGroup=Ti.prototype.px,Ti.prototype.isMemberOf=Ti.prototype.Td,Ti.prototype.findTopLevelPart=Ti.prototype.sz,Ti.prototype.findSubGraphLevel=Ti.prototype.oz,Ti.prototype.ensureBounds=Ti.prototype.Va,Ti.prototype.getDocumentBounds=Ti.prototype.mi,Ti.prototype.findObject=Ti.prototype.fb,Ti.prototype.moveTo=Ti.prototype.moveTo,Ti.prototype.invalidateAdornments=Ti.prototype.Wb,Ti.prototype.clearAdornments=Ti.prototype.Ej,Ti.prototype.removeAdornment=Ti.prototype.Jf,Ti.prototype.addAdornment=Ti.prototype.bh,Ti.prototype.findAdornment=Ti.prototype.Pj,Ti.prototype.updateTargetBindings=Ti.prototype.La;var z1=!1;Ti.className="Part",Ti.LayoutNone=0,Ti.LayoutAdded=1,Ti.LayoutRemoved=2,Ti.LayoutShown=4,Ti.LayoutHidden=8,Ti.LayoutNodeSized=16,Ti.LayoutGroupLayout=32,Ti.LayoutNodeReplaced=64,Ti.LayoutStandard=127,Ti.LayoutAll=16777215;function Qr(a,y){a===void 0||a instanceof wa||typeof a=="string"?Ti.call(this,a):(Ti.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)}Ee(Qr,Ti),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 kn&&y instanceof gr){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 gr&&(b.ua=a)}}},Qr.prototype.si=function(){var a=this.ue;return a===null?!0:(a=a.part,a===null||!Ss(a))},Qr.prototype.Zc=function(){return!1},Qr.prototype.gk=function(a,y,x,E,b,z,tt){if(a===ao&&y==="elements"){if(b instanceof Ps)this.$a===null&&(this.$a=b);else if(b instanceof wn){var rt=b.Nl(function(ot){return ot instanceof Ps});rt instanceof Ps&&this.$a===null&&(this.$a=rt)}}else a===mo&&y==="elements"&&this.$a!==null&&(E===this.$a?this.$a=null:E instanceof wn&&this.$a.rg(E)&&(this.$a=null));Ti.prototype.gk.call(this,a,y,x,E,b,z,tt)},Qr.prototype.updateAdornments=function(){},Qr.prototype.Lj=function(){},Ue.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=ia,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 qn(a,y){a===void 0||a instanceof wa||typeof a=="string"?Ti.call(this,a):(Ti.call(this),a&&(y=a)),this.U=13,this.Ba=null,this.jb=new un,this.wc=this.af=this.Yk=null,this.ci=!1,y&&Object.assign(this,y)}Ee(qn,Ti),qn.prototype.cloneProtected=function(a){Ti.prototype.cloneProtected.call(this,a),a.U=this.U,this.Ba!==null&&(a.Ba=this.Ba.nc?this.Ba:this.Ba.copy())},wt=qn.prototype,wt.Af=function(a){Ti.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(){Ti.prototype.th.call(this),this.Ba!==null&&(this.Ba.nc=!0)};function Z1(a,y){y!==null&&(a.af===null&&(a.af=new vn),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===ao&&y==="elements"?this.wc=null:a===mo&&y==="elements"&&(this.wc=null),Ti.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)||($s(x.fromPort),$s(x.toPort),x.bb())}};function H1(a,y){for(a=a.linksConnected;a.next();){var x=a.value;(x.fromPort===y||x.toPort===y)&&($s(x.fromPort),$s(x.toPort),x.bb())}}function $s(a){if(a!==null){var y=a.Zn;y!==null&&y.Sl(),a=a.part,y=a.containingGroup,y===null||a.isVisible()||$s(y.port)}}wt.si=function(){return!0},qn.prototype.getAvoidableRect=function(a){return a.set(this.actualBounds),a.Co(this.avoidableMargin),a},qn.prototype.findVisibleNode=function(){for(var a=this;a!==null&&!a.isVisible();)a=a.containingGroup;return a},qn.prototype.isVisible=function(){if(!Ti.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===pa){if(a=a?this.Oo():this.Po(),0<a.count&&a.all(function(E){return!E.isTreeExpanded}))return!1}else if(y===Ff&&(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},qn.prototype.Zb=function(a){Ti.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)}},qn.prototype.qx=function(){var a=new vn,y=new vn;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)})}}qn.prototype.findLinksConnected=function(a){if(a===void 0&&(a=null),a===null)return this.jb.iterator;var y=new Zr(this.jb),x=this;return y.predicate=function(E){return E.fromNode===x&&E.fromPortId===a||E.toNode===x&&E.toPortId===a},y},wt=qn.prototype,wt.Mo=function(a){a===void 0&&(a=null);var y=new Zr(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 Zr(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 vn,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 vn,y.add(x),y.add(b)):x=b)}return y!==null?y.iterator:x!==null?new Dr(x):Lr},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 vn,y.add(x),y.add(b)):x=b)}return y!==null?y.iterator:x!==null?new Dr(x):Lr},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 vn,y.add(x),y.add(b)):x=b)}return y!==null?y.iterator:x!==null?new Dr(x):Lr},wt.jz=function(a,y,x){y===void 0&&(y=null),x===void 0&&(x=null);var E=new Zr(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 Zr(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){$s(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){$s(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}}}qn.prototype.updateRelationshipsFromData=function(){var a=this.diagram;a!==null&&a.partManager.updateRelationshipsFromData(this)},wt=qn.prototype,wt.Vo=function(a){Ti.prototype.Vo.call(this,a),a||(ip(this),a=this.Yk,a!==null&&q1(a,this))},wt.Wo=function(a){Ti.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,Ti.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=Jn()),x.push(E);if(x!==null){for(a=0;a<x.length;a++)y.remove(x[a]);ii(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 qn)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 vn;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 Zr(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 un,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 un,y.add(x),y.add(a)):x=a);return y!==null?y.iterator:x!==null?new Dr(x):Lr},wt.wz=function(a){a===void 0&&(a=1/0);var y=new vn;return gd(y,this,!1,a,!0),y},qn.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 vn;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 gt=x?lt.Oo():lt.Po();ot.uv=a,gt.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}qn.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 vn;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 gt=x?ut.Oo():ut.Po();lt.vv=a,gt.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}Ue.Object.defineProperties(qn.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:ia},set:function(a){typeof a=="number"&&(a=new dr(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),ys(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))}}}),qn.prototype.expandTree=qn.prototype.expandTree,qn.prototype.collapseTree=qn.prototype.collapseTree,qn.prototype.findTreeParts=qn.prototype.wz,qn.prototype.findTreeChildrenNodes=qn.prototype.Ou,qn.prototype.findTreeChildrenLinks=qn.prototype.Qo,qn.prototype.findTreeLevel=qn.prototype.uz,qn.prototype.findTreeParentChain=qn.prototype.vz,qn.prototype.findTreeParentNode=qn.prototype.pg,qn.prototype.findTreeParentLink=qn.prototype.kh,qn.prototype.findCommonTreeParent=qn.prototype.gz,qn.prototype.findTreeRoot=qn.prototype.xz,qn.prototype.isInTreeOf=qn.prototype.Nz,qn.prototype.findPort=qn.prototype.ns,qn.prototype.findLinksTo=qn.prototype.kz,qn.prototype.findLinksBetween=qn.prototype.jz,qn.prototype.findNodesInto=qn.prototype.Oo,qn.prototype.findNodesOutOf=qn.prototype.Po,qn.prototype.findNodesConnected=qn.prototype.Mu,qn.prototype.findLinksInto=qn.prototype.Sd,qn.prototype.findLinksOutOf=qn.prototype.Mo,qn.prototype.findExternalTreeLinksConnected=qn.prototype.qx,qn.prototype.invalidateConnectedLinks=qn.prototype.Bd,qn.prototype.invalidateLinkBundle=qn.prototype.Lz;var Ex=new Ae(qn,"SpreadingNone",10),Vm=new Ae(qn,"SpreadingEvenly",11),Hv=new Ae(qn,"SpreadingPacked",12);qn.className="Node",qn.SpreadingNone=Ex,qn.SpreadingEvenly=Vm,qn.SpreadingPacked=Hv;function nr(a,y){a===void 0||a instanceof wa||typeof a=="string"?qn.call(this,a):(qn.call(this),a&&(y=a)),this.U|=4608,this.Gn=new vn,this.$a=null,this.Sc=new Ko,this.Sc.group=this,this.gl=new vn,this.tb=this.$p=null,y&&Object.assign(this,y)}Ee(nr,qn),nr.prototype.cloneProtected=function(a){qn.prototype.cloneProtected.call(this,a),this.U=this.U&-32769;var y=a.Nl(function(x){return x instanceof Ps});y instanceof Ps?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=nr.prototype,wt.Af=function(a){qn.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 qn)x.Bd(y);else if(x instanceof kn)for(x=x.labelNodes;x.next();)x.value.Bd(y)}},wt.gk=function(a,y,x,E,b,z,tt){if(a===ao&&y==="elements"){if(b instanceof Ps)this.$a===null?this.$a=b:this.$a!==b&&Qt("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 Ps});rt instanceof Ps&&(this.$a===null?this.$a=rt:this.$a!==rt&&Qt("Cannot insert a second Placeholder into the visual tree of a Group."))}}else a===mo&&y==="elements"&&this.$a!==null&&(E===this.$a?this.$a=null:E instanceof wn&&this.$a.rg(E)&&(this.$a=null));qn.prototype.gk.call(this,a,y,x,E,b,z,tt)},wt.Xl=function(a,y){qn.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 Oe),a.mi(this.tb),a instanceof gr&&this.tb.Bc(-a.strokeWidth,-a.strokeWidth))},wt.eh=function(a,y,x,E){this.nf=this.$a,qn.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 kn||y.Va()}),qn.prototype.Va.call(this)},wt.si=function(){if(!qn.prototype.si.call(this))return!1;for(var a=this.memberParts;a.next();){var y=a.value;if(y instanceof qn){if(y.isVisible()&&Ss(y))return!1}else if(y instanceof kn&&y.isVisible()&&Ss(y)&&y.fromNode!==this&&y.toNode!==this)return!1}return!0};function Wv(a,y){if(a.Gn.add(y)){y instanceof nr&&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 kn&&!a.computesBoundsIncludingLinks||(y=a.$a,y===null&&(y=a),y.v())}function Vv(a,y){if(a.Gn.remove(y)){y instanceof nr&&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 kn&&!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)}qn.prototype.Lj.call(this)},nr.prototype.canAddMembers=function(a){var y=this.diagram;if(y===null)return!1;for(y=y.commandHandler,a=We(a).iterator;a.next();)if(!y.isValidMember(this,a.value))return!1;return!0},nr.prototype.addMembers=function(a,y){var x=this.diagram;if(x===null)return!1;x=x.commandHandler;var E=!0;for(a=We(a).iterator;a.next();){var b=a.value;!y||x.isValidMember(this,b)?b.containingGroup=this:E=!1}return E},nr.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=nr.prototype,wt.Bd=function(a){var y=(this.U&65536)!==0;if(qn.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()?($s(x.fromPort),$s(x.toPort),x.bb()):(E=x.toNode,E!==null&&E!==this&&E.Td(this)&&!E.isVisible()&&($s(x.fromPort),$s(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 vn,E=y.iterator;E.next();){var b=E.value;if(b instanceof qn)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 vn,x=a.iterator;x.next();){var E=x.value;if(E instanceof qn)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 vn;return a(this,y),y},wt.Rj=function(){var a=new vn;return gd(a,this,!0,0,!0),a.remove(this),a},wt.Zb=function(a){qn.prototype.Zb.call(this,a);for(var y=this.memberParts;y.next();)y.value.Zb(a)},nr.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 nr&&z.isSubGraphExpanded&&(z.wasSubGraphExpanded=z.isSubGraphExpanded,Q1(z,y,x,E)),z instanceof qn)z.Bd(y),x.Aj(z,E);else if(z instanceof kn)for(z=z.labelNodes;z.next();)z.value.Bd(y)}a.isSubGraphExpanded=!1}nr.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 nr&&z.wasSubGraphExpanded&&(z.wasSubGraphExpanded=!1,$1(z,y,x,E)),z instanceof qn)z.Bd(y),x.Cj(z,E);else if(z instanceof kn)for(z=z.labelNodes;z.next();)z.value.Bd(y)}a.isSubGraphExpanded=!0}nr.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=Tt.alloc(),qn.prototype.move.call(this,a,y),a=new vn,y=this.Rj().iterator;y.next();)b=y.value,b instanceof kn&&(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 qn&&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 kn&&(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());Tt.free(z)}},Ue.Object.defineProperties(nr.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&&Qt("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)}}}),nr.prototype.expandSubGraph=nr.prototype.expandSubGraph,nr.prototype.collapseSubGraph=nr.prototype.collapseSubGraph,nr.prototype.findSubGraphParts=nr.prototype.Rj,nr.prototype.findContainingGroupChain=nr.prototype.hz,nr.prototype.findExternalNodesConnected=nr.prototype.iz,nr.prototype.findExternalLinksConnected=nr.prototype.Lu,nr.prototype.ensureBounds=nr.prototype.Va,nr.className="Group";function Ps(a){fe.call(this),this.yb=ca,this.ko=new Oe(NaN,NaN,NaN,NaN),a&&Object.assign(this,a)}Ee(Ps,fe),Ps.prototype.cloneProtected=function(a){fe.prototype.cloneProtected.call(this,a),a.yb=this.yb.J(),a.ko=this.ko.copy()},Ps.prototype.gh=function(a){if(this.background===null&&this.areaBackground===null)return!1;var y=this.naturalBounds;return Or(0,0,y.width,y.height,a.x,a.y)},Ps.prototype.Wl=function(){var a=this.part;if(a!==null&&(a instanceof nr||a instanceof Qr)||Qt("Placeholder is not inside a Group or Adornment."),a instanceof nr){var y=this.computeBorder(this.ko),x=this.minSize,E=this.dc;for(lo(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=Tt.alloc(),x.xi(y,a.locationSpot),x.D(a.location)||(a.location=x),Tt.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 gr&&(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,Tt.alloc()),a.location=rt,Tt.free(rt)),isNaN(lt)||isNaN(tt)?(a=z.ga(_r,Tt.alloc()),lt=Oe.allocAt(a.x,a.y,0,0),lt.Ye(z.ga(io,a)),lt.Ye(z.ga(co,a)),lt.Ye(z.ga(da,a)),lo(y,lt.width+E||0,lt.height+b||0),this.Ge(-x.left,-x.top,y.width,y.height),Tt.free(a),Oe.free(lt)):(lo(y,lt+E||0,tt+b||0),this.Ge(-x.left,-x.top,y.width,y.height))}},Ps.prototype.eh=function(a,y,x,E){this.actualBounds.h(a,y,x,E)},Ps.prototype.computeBorder=function(a){var y=this.part,x=y.diagram,E=x===null||!x.animationManager.isAnimating;if(x!==null&&y instanceof nr&&!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=Oe.alloc(),b=this.computeMemberBounds(x);var z=this.yb;return y instanceof nr&&!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)),Oe.free(x),E&&y instanceof nr&&y.computesBoundsIncludingLocation&&y.location.w()&&a.Ye(y.location),a},Ps.prototype.computeMemberBounds=function(a){if(!(this.part instanceof nr))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 kn&&(!y.computesBoundsIncludingLinks||ul(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},Ue.Object.defineProperties(Ps.prototype,{padding:{get:function(){return this.yb},set:function(a){typeof a=="number"&&(a=new dr(a));var y=this.yb;y.D(a)||(this.yb=a=a.J(),this.g("padding",y,a),this.v())}}}),Ps.className="Placeholder";function kn(a){Ti.call(this,wn.Link),this.Qa=8,this.ef=null,this.ff="",this.uf=this.gn=null,this.vf="",this.uo=null,this.qk=ws,this.Om=0,this.Qm=ws,this.Rm=NaN,this.qj=Jv,this.po=.5,this.wd=null,this.Nb=new un().freeze(),this.Tg=this.Mg=null,this.ml=new Oe,this.ua=new ce,this.u=this.o=this.Sf=this.Wf=null,this.su=new Tt,this.cq=this.Mw=this.Lw=null,this.vt=NaN,this.ba=null,this.j=[],a&&Object.assign(this,a)}Ee(kn,Ti),kn.prototype.cloneProtected=function(a){Ti.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=kn.prototype,wt.Af=function(a){Ti.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&&$s(y),a=a.toPort,a!==null&&$s(a)},wt.qb=function(a){a.classType===kn?(a.value&2)===2?this.routing=a:a===dl||a===Rh||a===Hf?this.curve=a:a===ap||a===Qm||a===$m?this.adjusting=a:a!==Jv&&a!==ws&&Qt("Unknown Link enum value for a Link property: "+a):Ti.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),Ss(a)||cd(a))return!1}return a=this.toNode,!(a!==null&&(y=a.findVisibleNode(),y!==null&&(a=y),Ss(a)||cd(a)))},wt.zv=function(){return!1},wt.Av=function(){},wt.Zc=function(){return!1},kn.prototype.computeAngle=function(a,y,x){return kn.computeAngle(y,x)},kn.computeAngle=function(a,y){switch(a){default:case ws: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 Zf(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=kn.prototype,wt.oh=function(){var a=this.containingGroup;a!==null&&this.fromNode!==a&&this.toNode!==a&&a.computesBoundsIncludingLinks&&Ti.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 vn),a.wd.add(y),a.v()}wt.Vo=function(a){if(Ti.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(Ti.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))},kn.prototype.updateRelationshipsFromData=function(){if(this.data!==null){var a=this.diagram;a!==null&&a.partManager.updateRelationshipsFromData(this)}},kn.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?Ti.prototype.move.call(this,a,!1):(a=Tt.allocAt(x.x+E,x.y+b),Ti.prototype.move.call(this,a,!1),Tt.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)},kn.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},kn.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},kn.prototype.computeMidPoint=function(a){var y=this.pointsCount;if(y===0)return a.assign(di),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()===dl))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()===dl){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},kn.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()===dl))return this.ua.wx(.5);if(this.computeCurve()===dl&&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=kn.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 Tt(y,x))},wt.Kz=function(a,y){this.Nb.Gb(a,y)},wt.m=function(a,y,x){this.Nb.Gb(a,new Tt(y,x))},wt.ne=function(a){this.Nb.add(a)},wt.yf=function(a,y){this.Nb.add(new Tt(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 un,z=a.Nb.iterator;z.next();){var tt=z.value;b.add(new Tt(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),ys(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&&ff(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 gt=ot[ut];tt=Math.min(gt.x,tt),rt=Math.min(gt.y,rt),gt.freeze()}if(y.freeze(),lt===z){for(z=0;z<lt;z++)if(ut=b[z],gt=ot[z],ut.x-x!==gt.x-tt||ut.y-E!==gt.y-rt){this.qc();break}}else this.qc();this.Mg=null,x=this.diagram,x!==null&&x.animationManager.zb&&ff(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()}}},kn.prototype.computePoints=function(){if(this.diagram===null)return!1;var a=this.fromNode,y=null;if(a===null?(zc||(zc=new qn,zc.desiredSize=Qi,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 qn,Zc.desiredSize=Qi,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=Gf(tt),ot=Gf(x),lt=y===b&&y!==null,ut=this.isOrthogonal,gt=this.curve===dl;this.Wf=lt&&!ut?gt=!0:!1;var yt=this.computeAdjusting()===ws||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(),gt){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(),gt=ut=0;var xt=z.x+rt/3,Ct=z.y+ot/3,bt=xt,Wt=Ct;_t.B(ot,0)?Wt=0<rt?Wt-lt:Wt+lt:(ut=-rt/ot,gt=Math.sqrt(lt*lt/(ut*ut+1)),0>lt&&(gt=-gt),bt=(0>ot?-1:1)*gt+xt,Wt=ut*(bt-xt)+Ct),xt=z.x+2*rt/3,Ct=z.y+2*ot/3;var Zt=xt,$t=Ct;_t.B(ot,0)?$t=0<rt?$t-lt:$t+lt:(Zt=(0>ot?-1:1)*gt+xt,$t=ut*(Zt-xt)+Ct),this.Fj(),this.ne(z),this.yf(bt,Wt),this.yf(Zt,$t),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=Oe.alloc(),y.mi(rt),ot=rt.ca(b),yt.mi(rt),lt=rt.ca(E),(ot||lt)&&(tt=y.ga(Ym(tt),new Tt),this.dd(0,this.getLinkPointFromPoint(a,y,tt,b,!0,tt)),x=yt.ga(Ym(x),new Tt),this.dd(1,this.getLinkPointFromPoint(z,yt,x,E,!1,x))),Oe.free(rt))}else{gt=this.isAvoiding,yt&&(ut&>||lt)&&this.Fj();var ne=lt?this.computeCurviness():0;gt=this.getLinkPoint(a,y,tt,!0,ut,E,b),xt=bt=Ct=0,(ut||!rt||lt)&&(Wt=this.computeEndSegmentLength(a,y,tt,!0),xt=this.getLinkDirection(a,y,gt,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>ne&&(xt-=180)),0>xt?xt+=360:360<=xt&&(xt-=360),lt&&(Wt+=Math.abs(ne)*(ut?1:2)),xt===0?Ct=Wt:xt===90?bt=Wt:xt===180?Ct=-Wt:xt===270?bt=-Wt:(Ct=Wt*Math.cos(xt*Math.PI/180),bt=Wt*Math.sin(xt*Math.PI/180)),tt.Mc()&<&&(Wt=y.ga(cr,Tt.alloc()),Zt=Tt.allocAt(Wt.x+1e3*Ct,Wt.y+1e3*bt),this.getLinkPointFromPoint(a,y,Wt,Zt,!0,gt),Tt.free(Wt),Tt.free(Zt))),Wt=this.getLinkPoint(E,b,x,!1,ut,a,y);var re=$t=Zt=0;if(ut||!ot||lt){var de=this.computeEndSegmentLength(E,b,x,!1);re=this.getLinkDirection(E,b,Wt,x,!1,ut,a,y),lt&&(ot||tt.D(x)||!ut&&tt.x+x.x===1&&tt.y+x.y===1)&&(re+=ut?0:30,0>ne&&(re+=180)),0>re?re+=360:360<=re&&(re-=360),lt&&(de+=Math.abs(ne)*(ut?1:2)),re===0?Zt=de:re===90?$t=de:re===180?Zt=-de:re===270?$t=-de:(Zt=de*Math.cos(re*Math.PI/180),$t=de*Math.sin(re*Math.PI/180)),x.Mc()&<&&(x=b.ga(cr,Tt.alloc()),tt=Tt.allocAt(x.x+1e3*Zt,x.y+1e3*$t),this.getLinkPointFromPoint(E,b,x,tt,!1,Wt),Tt.free(x),Tt.free(tt))}x=gt,(ut||!rt||lt)&&(x=new Tt(gt.x+Ct,gt.y+bt)),tt=Wt,(ut||!ot||lt)&&(tt=new Tt(Wt.x+Zt,Wt.y+$t)),!yt&&!ut&&rt&&3<z&&this.adjustPoints(0,gt,z-2,tt)?this.dd(z-1,Wt):!yt&&!ut&&ot&&3<z&&this.adjustPoints(1,x,z-1,Wt)?this.dd(0,gt):!yt&&(ut?6<=z:4<z)&&this.adjustPoints(1,x,z-2,tt)?(this.dd(0,gt),this.dd(z-1,Wt)):(this.Fj(),this.ne(gt),(ut||!rt||lt)&&this.ne(x),ut&&this.addOrthoPoints(x,xt,tt,re,a,E),(ut||!ot||lt)&&this.ne(tt),this.ne(Wt))}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}kn.prototype.getLinkPointFromPoint=function(a,y,x,E,b,z){if(z===void 0&&(z=new Tt),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),gt=b*(a.m12*a.dx-a.m11*a.dy);b=E.x*tt+E.y*ot+ut,E=E.x*rt+E.y*lt+gt,tt=x.x*tt+x.y*ot+ut,x=x.x*rt+x.y*lt+gt}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)}kn.prototype.getLinkPoint=function(a,y,x,E,b,z,tt,rt){if(rt===void 0&&(rt=new Tt),x.sb()&&!Gf(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=Tt.alloc(),lt=Tt.alloc();var ut=new Oe(y.ga(_r,ot),y.ga(io,lt)),gt=this.computeSpot(!E,tt);a=this.getLinkPoint(z,tt,gt,!E,b,a,y,lt),(x.Hf(ns)||x.Hf(Jo))&&a.y>=ut.y&&a.y<=ut.y+ut.height?rt.y=a.y:(x.Hf(Sa)||x.Hf(ps))&&a.x>=ut.x&&a.x<=ut.x+ut.width&&(rt.x=a.x),Tt.free(ot),Tt.free(lt)}}return rt}}return x=y.ga(Ym(x),Tt.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=Tt.alloc(),tt=tt.ga(Ym(ot),z),b&&(tt=Kv(x,tt)),Tt.free(z)),this.getLinkPointFromPoint(a,y,x,tt,E,rt),Tt.free(x),rt},kn.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(cr,Tt.alloc()),this.pointsCount>(z?6:2)?(rt=b?this.i(1):this.i(this.pointsCount-2),rt=z?Kv(ot,rt.copy()):x):(x=Tt.alloc(),rt=rt.ga(cr,x),Tt.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,Tt.free(ot),ot=x}return E.Mc()&&tt.Td(a)&&(ot+=180,360<=ot&&(ot-=360)),Gf(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},kn.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)},kn.prototype.computeSpot=function(a,y){return y===void 0&&(y=null),a?(a=y||this.fromPort,a===null?a=cr:(y=this.fromSpot,y.Xb()&&(y=a.fromSpot),a=y===xa?ar:y)):(a=y||this.toPort,a===null?a=cr:(y=this.toSpot,y.Xb()&&(y=a.toSpot),a=y===xa?ar:y)),a};function Gf(a){return a===ar||a.x===.5&&a.y===.5}function Ym(a){return a.x===.5&&a.y===.5?a:cr}kn.prototype.computeOtherPoint=function(a,y){return this.computeAdjusting()!==ws&&4<this.pointsCount?this.computeMidPoint(new Tt):(a=y.Zn,a=a!==null?sS(a,this):null,a!==null?a.Zo:y.ga(cr))},kn.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},kn.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=oe.alloc(),tt.reset()),tt.multiply(this.transform),this.fh(a,tt))return mv(this,y,x,b),z===void 0&&oe.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 gt=ut.actualBounds,yt=this.naturalBounds;if(!(gt.x>yt.width||gt.y>yt.height||0>gt.x+gt.width||0>gt.y+gt.height)){if(gt=oe.alloc(),gt.set(tt),ut instanceof wn)rt=ut.Cf(a,y,x,E,b,gt);else if(this.path===ut){if(ut instanceof gr)if(rt=a,yt=E,ut.pickable===!1)rt=!1;else if(gt.multiply(ut.transform),yt)t:{var xt=rt,Ct=gt;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 Wt=Tt.alloc(),Zt=Tt.alloc(),$t=Tt.alloc(),ne=oe.alloc();ne.set(Ct),ne.bv(ut.transform),ne.Vj(),Zt.x=yt,Zt.y=bt,Zt.transform(ne),Wt.x=rt,Wt.y=bt,Wt.transform(ne),Ct=!1,tc(ut,Wt,Zt,$t)?Ct=!0:(Wt.x=yt,Wt.y=xt,Wt.transform(ne),tc(ut,Wt,Zt,$t)?Ct=!0:(Zt.x=rt,Zt.y=xt,Zt.transform(ne),tc(ut,Wt,Zt,$t)?Ct=!0:(Wt.x=rt,Wt.y=bt,Wt.transform(ne),tc(ut,Wt,Zt,$t)&&(Ct=!0)))),oe.free(ne),Tt.free(Wt),Tt.free(Zt),Tt.free($t),rt=Ct}}else rt=ut.fh(rt,gt)}else rt=ka(ut,a,E,gt);rt&&(yt=ut,y!==null&&(yt=y(ut)),yt&&(x===null||x(yt))&&b.add(yt)),oe.free(gt)}}}return z===void 0&&oe.free(tt),rt||this.background!==null||this.areaBackground!==null}return z===void 0&&oe.free(tt),!1},kn.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?dl:this.curve},kn.prototype.computeCorner=function(){if(this.curve===dl)return 0;var a=this.corner;return(isNaN(a)||0>a)&&(a=10),a},kn.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},kn.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(cr).ab(x.ga(cr))/180*Math.PI,a=Math.max(a,Math.abs(Math.sin(y)*tt)+Math.abs(Math.cos(y)*b)+1)),this.curve===dl&&(a*=1.333)}}return a},kn.prototype.arrangeBundledLinks=function(a,y){if(y)for(y=0;y<a.length;y++){var x=a[y];x.computeAdjusting()===ws&&x.bb()}},kn.prototype.computeCurviness=function(){var a=this.curviness;if(isNaN(a)){a=nS;var y=this.Sf;if(y!==null){for(var x=Jn(),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),ii(x)}}return a},kn.prototype.computeThickness=function(){if(!this.isVisible())return 0;var a=this.path;return a!==null?Math.max(a.strokeWidth,1):1},kn.prototype.hasCurviness=function(){return!isNaN(this.curviness)||this.Sf!==null},kn.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 gt=y.y;rt=E.x-tt;var yt=E.y-gt;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),gt+y*Math.sin(rt)));this.dd(x,E)}}return!0;case $m:if(z=this.i(a),gt=this.i(x),!z.Xa(y)||!gt.Xa(E)){b=z.x,z=z.y,tt=gt.x,gt=gt.y,lt=(tt-b)*(tt-b)+(gt-z)*(gt-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,Wt=y.y,Zt=.5;lt!==0&&(Zt=((b-bt)*(b-tt)+(z-Wt)*(z-gt))/lt);var $t=b+Zt*(tt-b),ne=z+Zt*(gt-z);y=Math.sqrt((bt-$t)*(bt-$t)+(Wt-ne)*(Wt-ne)),Wt<Ct*(bt-$t)+ne&&(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,gt=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,gt,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}},kn.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=Tt.alloc(),ut=Tt.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 gt=x;if(this.isAvoiding){var yt=this.diagram;if(yt===null||b===z||this.layer.isTemporary||!wf(yt)||rt.ca(gt)&&!z.Td(b)||ot.ca(a)&&!b.Td(z))y=!1;else{var xt=Cf(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,gt.x),Math.min(ut.y,gt.y),Math.abs(ut.x-gt.x),Math.abs(ut.y-gt.y)))y=!1;else{b=a,z=gt;var Ct=x=null;if(yt.isVirtualized){yt=xt.bounds.copy(),yt.Bc(-xt.Ho,-xt.Go);var bt=Tt.alloc();Wf(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,gt.x,gt.y,bt)&&(x=a=bt.copy(),y=bt.ab(gt))),Wf(xt,gt.x,gt.y)||(_t.Ff(yt.x,yt.y,yt.x+yt.width,yt.y+yt.height,gt.x,gt.y,ut.x,ut.y,bt)?(Ct=gt=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=gt=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=gt=bt.copy(),E=a.ab(bt))),Tt.free(bt)}rt=rt.copy().ed(ot),rt.Bc(xt.Ho*xt.Os,xt.Go*xt.Os),oS(xt,a,y,gt,E,rt,!0),ot=Yu(xt,gt.x,gt.y),!xt.abort&&ot>=Vf&&(rS(xt),rt.Bc(xt.Ho*xt.Hx,xt.Go*xt.Ix),oS(xt,a,y,gt,E,rt,!1),ot=Yu(xt,gt.x,gt.y)),!xt.abort&&ot<Vf&&Yu(xt,gt.x,gt.y)!==jh?(Yv(this,xt,gt.x,gt.y,E,!0,tt),rt=this.i(2),4>this.pointsCount?(y===0||y===180?(rt.x=a.x,rt.y=gt.y):(rt.x=gt.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())),Tt.free(lt),Tt.free(ut)}},kn.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||!wf(a.diagram))return!1;var y=a.points.s,x=y.length;if(4>x)return!1;a=Cf(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=Yu(y,x,E),ut=x,gt=E;for(b===0?ut+=rt:b===90?gt+=ot:b===180?ut-=rt:gt-=ot,b!==tt&<>ic&&Yu(y,ut,gt)!==lt-1&&(Yu(y,x-rt,E)===lt-1?(b=180,ut=x-rt,gt=E):Yu(y,x+rt,E)===lt-1?(b=0,ut=x+rt,gt=E):Yu(y,x,E-ot)===lt-1?(b=270,ut=x,gt=E-ot):Yu(y,x,E+ot)===lt-1&&(b=90,ut=x,gt=E+ot));lt>ic&&Yu(y,ut,gt)===lt-1;)x=ut,E=gt,b===0?ut+=rt:b===90?gt+=ot:b===180?ut-=rt:gt-=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),Yu(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),Yu(y,tt,ut)===lt-1&&Yv(a,y,tt,ut,z,!1,z))),a.yf(x,E)}kn.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},kn.prototype.qc=function(){this.lk=!1,this.v()},kn.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 gr&&(b.ua=this.ua)}}},kn.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===dl&&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=ce.o,rt=N1(a),this.computeShortLength(!0)!==0&&(b=Rc(this,b,!0,z)),zf(rt,b.x,b.y,!1),tt===dl&&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=Tt.allocAt(E,ot),x=Tt.alloc(),x.assign(this.i(1)),z=Tt.allocAt(E,ot),b=Tt.allocAt(E,ot),tt=this.i(0);for(var lt,ut=this.smoothness/3,gt=1;gt<this.pointsCount-1;gt++){lt=this.i(gt);var yt=tt,xt=lt,Ct=this.i(Xv(this,lt,gt,!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 Wt=yt.x;yt=yt.y;var Zt=xt.x;xt=xt.y;var $t=Ct.x;Ct=Ct.y;var ne=bt*Xm(Wt,yt,Zt,xt);bt*=Xm(Zt,xt,$t,Ct),_t.$(yt,xt)&&_t.$(Zt,$t)&&(Zt>Wt?Ct>xt?(z.x=Zt-ne,z.y=xt-ne,b.x=Zt+bt,b.y=xt+bt):(z.x=Zt-ne,z.y=xt+ne,b.x=Zt+bt,b.y=xt-bt):Ct>xt?(z.x=Zt+ne,z.y=xt-ne,b.x=Zt-bt,b.y=xt+bt):(z.x=Zt+ne,z.y=xt+ne,b.x=Zt-bt,b.y=xt-bt)),_t.$(Wt,Zt)&&_t.$(xt,Ct)&&(xt>yt?($t>Zt?(z.x=Zt-ne,z.y=xt-ne,b.x=Zt+bt):(z.x=Zt+ne,z.y=xt-ne,b.x=Zt-bt),b.y=xt+bt):($t>Zt?(z.x=Zt-ne,z.y=xt+ne,b.x=Zt+bt):(z.x=Zt+ne,z.y=xt+ne,b.x=Zt-bt),b.y=xt-bt)),(_t.$(Wt,Zt)&&_t.$(Zt,$t)||_t.$(yt,xt)&&_t.$(xt,Ct))&&(Wt=.5*(Wt+$t),yt=.5*(yt+Ct),z.x=Wt,z.y=yt,b.x=Wt,b.y=yt),(gt===1||gt===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,Dn)),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),Tt.free(y),Tt.free(x),Tt.free(z),Tt.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,Dn)),Dh(rt,z.x-E,z.y-ot,b.x-E,b.y-ot,tt.x-E,tt.y-ot);else{for(z=Tt.alloc(),z.assign(this.i(0)),b=Tt.alloc(),b.assign(z),tt=this.computeCorner(),gt=1,lt=0;gt<y;){if(gt=Xv(this,z,gt,1<gt),ut=this.i(gt),gt>=y-1){if(!z.D(ut))this.computeShortLength(!1)!==0&&(ut=Rc(this,ut.copy(),!1,Dn)),jc(this,rt,-E,-ot,z,ut,x);else if(lt===0)for(gt=1;gt<y;)b.assign(z),ut=this.i(gt++),jc(this,rt,-E,-ot,z,ut,x),z.assign(ut);break}if(lt=Xv(this,ut,gt+1,gt<y-3),gt=-E,Wt=-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=ne=Math.min(Ct,Math.abs(Zt.y-yt.y)/2),_t.B(Ct,0))jc(this,rt,gt,Wt,z,yt,bt),z.assign(yt);else{var re=yt.x,de=yt.y;xt=re,$t=de,yt.x>z.x?re=yt.x-Ct:re=yt.x+Ct,Zt.y>yt.y?$t=yt.y+ne:$t=yt.y-ne,Zt=Tt.allocAt(re,de),jc(this,rt,gt,Wt,z,Zt,bt),Tt.free(Zt),jm(rt,yt.x+gt,yt.y+Wt,xt+gt,$t+Wt),z.h(xt,$t)}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=ne=Math.min(Ct,Math.abs(Zt.x-yt.x)/2),_t.B(ne,0)?(jc(this,rt,gt,Wt,z,yt,bt),z.assign(yt)):(re=yt.x,de=yt.y,xt=re,$t=de,yt.y>z.y?de=yt.y-Ct:de=yt.y+Ct,Zt.x>yt.x?xt=yt.x+ne:xt=yt.x-ne,Zt=Tt.allocAt(re,de),jc(this,rt,gt,Wt,z,Zt,bt),Tt.free(Zt),jm(rt,yt.x+gt,yt.y+Wt,xt+gt,$t+Wt),z.h(xt,$t))):(jc(this,rt,gt,Wt,z,yt,bt),z.assign(yt));b.assign(ut),gt=lt}Tt.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=ce.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}kn.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 gt=Math.max(b.x,Math.min(ot[ut++]-rt,z.x-tt));y.lineTo(gt+x,z.y+E);for(var yt=gt+x,xt=Math.min(gt+tt,z.x);ut<lt&&(gt=ot[ut],gt<xt+tt);)ut++,xt=Math.min(gt+rt,z.x);gt=z.y-tt+E,xt+=x;var Ct=z.y+E;a.curve===Rh?zf(y,xt,Ct,!1):Dh(y,yt,gt,xt,gt,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,gt=Math.max(ut-tt,z.x);0<=lt&&(ut=ot[lt],ut>gt-tt);)lt--,gt=Math.max(ut-rt,z.x);ut=z.y-tt+E,gt+=x,xt=z.y+E,a.curve===Rh?zf(y,gt,xt,!1):Dh(y,yt,ut,gt,ut,gt,xt)}else if(_t.B(b.x,z.x))if(b.y<z.y)for(ut=0;ut<lt;){for(gt=Math.max(b.y,Math.min(ot[ut++]-rt,z.y-tt)),y.lineTo(z.x+x,gt+E),yt=gt+E,gt=Math.min(gt+tt,z.y);ut<lt&&(xt=ot[ut],xt<gt+tt);)ut++,gt=Math.min(xt+rt,z.y);xt=z.x-tt+x,Ct=z.x+x,gt+=E,a.curve===Rh?zf(y,Ct,gt,!1):Dh(y,xt,yt,xt,gt,Ct,gt)}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&&(gt=ot[lt],gt>ut-tt);)lt--,ut=Math.max(gt-rt,z.y);gt=z.x-tt+x,xt=z.x+x,ut+=E,a.curve===Rh?zf(y,xt,ut,!1):Dh(y,gt,yt,gt,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 kn){if(ot===a)return 0<E.length&&E.sort(function(ut,gt){return ut-gt}),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,gt){return ut-gt}),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=Tt.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 gt=a.y,yt=y.x,xt=y.y,Ct=tt.x;tt=tt.y;var bt=lt.x,Wt=lt.y;if(_t.B(ut,yt)){if(!_t.B(gt,xt)&&_t.B(tt,Wt)&&Math.min(gt,xt)<tt&&Math.max(gt,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(gt,xt)&&_t.B(Ct,bt)&&Math.min(ut,yt)<Ct&&Math.max(ut,yt)>Ct&&Math.min(tt,Wt)<gt&&Math.max(tt,Wt)>gt&&!_t.B(tt,Wt)){rt.x=Ct,rt.y=gt,ut=!0;break t}rt.x=0,rt.y=0,ut=!1}ut&&(b?x.push(rt.x):x.push(rt.y)),tt=lt}Tt.free(rt)}function nc(a){return a=a.curve,a===Hf||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()))}kn.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 kn&&(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 kn&&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())}}kn.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},kn.prototype.isVisible=function(){if(!Ti.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},kn.prototype.Zb=function(a){if(Ti.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)},kn.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&&(vi(y.links,a),y.Sl()))}kn.prototype.ph=function(){return!0},Ue.Object.defineProperties(kn.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),Zf(this)}}},fromPortId:{get:function(){return this.ff},set:function(a){var y=this.ff;if(y!==a){var x=this.fromPort;x!==null&&$s(x),op(this),this.ff=a;var E=this.fromPort;E!==null&&$s(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),Zf(this)}}},toPortId:{get:function(){return this.vf},set:function(a){var y=this.vf;if(y!==a){var x=this.toPort;x!==null&&$s(x),op(this),this.vf=a;var E=this.toPort;E!==null&&$s(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:xa},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&&$s(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&&bn(a,">= 0",kn,"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:xa},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&&$s(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&&bn(a,">= 0",kn,"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?Lr: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 gr?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()===dl&&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 Tt)}},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 un,E=0;E<a.length/2;E++)b=new Tt(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(!ze(z)||typeof z.x!="number"||isNaN(z.x)||typeof z.y!="number"||isNaN(z.y)){E=!1;break}}if(E)for(x=new un,E=0;E<a.length;E++)b=a[E],x.add(new Tt(b.x,b.y).freeze())}}else if(a instanceof un)for(x=a.copy(),a=x.iterator;a.next();)a.value.freeze();else Qt("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&&ff(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||!Gf(this.computeSpot(!0))?1:0}},lastPickIndex:{get:function(){var a=this.pointsCount;return a===0?0:2>=a?a-1:this.isOrthogonal||!Gf(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===Hf||a===Rh||a===Hf),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)}}}),kn.prototype.invalidateOtherJumpOvers=kn.prototype.Xo,kn.prototype.findClosestSegment=kn.prototype.ez,kn.prototype.updateRoute=kn.prototype.vg,kn.prototype.invalidateRoute=kn.prototype.bb,kn.prototype.rollbackRoute=kn.prototype.rv,kn.prototype.commitRoute=kn.prototype.zf,kn.prototype.startRoute=kn.prototype.uh,kn.prototype.clearPoints=kn.prototype.Fj,kn.prototype.removePoint=kn.prototype.pv,kn.prototype.addPointAt=kn.prototype.yf,kn.prototype.addPoint=kn.prototype.ne,kn.prototype.insertPointAt=kn.prototype.m,kn.prototype.insertPoint=kn.prototype.Kz,kn.prototype.setPointAt=kn.prototype.L,kn.prototype.setPoint=kn.prototype.dd,kn.prototype.getPoint=kn.prototype.i,kn.prototype.getOtherPort=kn.prototype.Cz,kn.prototype.getOtherNode=kn.prototype.To;var zc=null,Zc=null,Jv=new Ae(kn,"Normal",1),Mx=new Ae(kn,"Orthogonal",2),kx=new Ae(kn,"AvoidsNodes",6),eS=new Ae(kn,"AvoidsNodesStraight",7),ws=new Ae(kn,"None",0),dl=new Ae(kn,"Bezier",9),Rh=new Ae(kn,"JumpGap",10),Hf=new Ae(kn,"JumpOver",11),ap=new Ae(kn,"End",17),Qm=new Ae(kn,"Scale",18),$m=new Ae(kn,"Stretch",19),sp=new Ae(kn,"OrientAlong",21),lp=new Ae(kn,"OrientPlus90",22),up=new Ae(kn,"OrientMinus90",23),Qv=new Ae(kn,"OrientOpposite",24),qm=new Ae(kn,"OrientUpright",25),hp=new Ae(kn,"OrientPlus90Upright",26),dp=new Ae(kn,"OrientMinus90Upright",27),t0=new Ae(kn,"OrientUpright45",28),nS=16,iS=14,cp=8;kn.className="Link",kn.Normal=Jv,kn.Orthogonal=Mx,kn.AvoidsNodes=kx,kn.AvoidsNodesStraight=eS,kn.None=ws,kn.Bezier=dl,kn.JumpGap=Rh,kn.JumpOver=Hf,kn.End=ap,kn.Scale=Qm,kn.Stretch=$m,kn.OrientAlong=sp,kn.OrientPlus90=lp,kn.OrientMinus90=up,kn.OrientOpposite=Qv,kn.OrientUpright=qm,kn.OrientPlus90Upright=hp,kn.OrientMinus90Upright=dp,kn.OrientUpright45=t0,kn.EndSegmentStep=8,kn.CurvinessStart=nS,kn.SpacingMin=iS,kn.OrthoShortCut=cp;function e0(a,y,x,E){Gi(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){Gi(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 Wf(a,y,x){return a.Nd<=y&&y<=a.En&&a.Od<=x&&x<=a.Fn}function Yu(a,y,x){return Wf(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 Xu(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,gt=a.ac[lt][ut];if(gt>=ic&><Vf)for(b?ut+=E:lt+=E,gt+=1;z<=lt&<<=tt&&rt<=ut&&ut<=ot&&!(gt>=a.ac[lt][ut]);)a.ac[lt][ut]=gt,gt+=1,b?ut+=E:lt+=E;if(lt=b?ut:lt,b)if(0<E)for(x+=E;x<lt;x+=E)Xu(a,y,x,1,!b,z,tt,rt,ot),Xu(a,y,x,-1,!b,z,tt,rt,ot);else for(x+=E;x>lt;x+=E)Xu(a,y,x,1,!b,z,tt,rt,ot),Xu(a,y,x,-1,!b,z,tt,rt,ot);else if(0<E)for(y+=E;y<lt;y+=E)Xu(a,y,x,1,!b,z,tt,rt,ot),Xu(a,y,x,-1,!b,z,tt,rt,ot);else for(y+=E;y>lt;y+=E)Xu(a,y,x,1,!b,z,tt,rt,ot),Xu(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=Vf;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(Wf(a,rt,ot)){rt-=a.Nd,rt/=a.rc,ot-=a.Od,ot/=a.sc;var lt=E.x,ut=E.y;if(Wf(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 gt=z.x;E=z.y,y=z.x+z.width;var yt=z.y+z.height;gt-=a.Nd,gt/=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,gt|0)),y=Math.min(a.di,Math.max(0,y|0)),gt=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,gt,yt),n0(a,rt,ot,1,!x,z,y,gt,yt),n0(a,rt,ot,-1,!x,z,y,gt,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,gt,yt),i0(a,lt,ut,1,!(b===90||b===270),z,y,gt,yt),i0(a,lt,ut,-1,!(b===90||b===270),z,y,gt,yt)):i0(a,lt,ut,xt,x,lt,ut,lt,ut),x=Jn(),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 Xu(a,rt,ot,1,!1,z,y,gt,yt),Xu(a,rt,ot,-1,!1,z,y,gt,yt),Xu(a,rt,ot,1,!0,z,y,gt,yt),Xu(a,rt,ot,-1,!0,z,y,gt,yt);ii(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,gt=lt;if(E===0)if(ut<b)ut++;else break;else if(E===90)if(gt<z)gt++;else break;else if(E===180)if(ut>b)ut--;else break;else if(gt>z)gt--;else break;var yt=rt[ut][gt];if(yt===0||yt===qv)break;ot=ut,lt=gt}for(;;){if(ut=E,gt=ot,yt=lt,E===0?yt<z?(ut=90,yt++):yt>z&&(ut=270,yt--):E===90?gt<b?(ut=0,gt++):gt>b&&(ut=180,gt--):E===180?yt<z?(ut=90,yt++):yt>z&&(ut=270,yt--):gt<b?(ut=0,gt++):gt>b&&(ut=180,gt--),gt=rt[gt][yt],ut!==E&>!==0&>!==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++}}}Ue.Object.defineProperties(fp.prototype,{bounds:{get:function(){return new Oe(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,Vf=999999,$v=Vf+1,qv=Vf+2;fp.className="PositionArray";function Gc(){Gi(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 nr?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,Tt.alloc()),ot=a.port.ga(io,Tt.alloc());for(b=Oe.allocAt(rt.x,rt.y,0,0),b.Ye(ot),Tt.free(rt),Tt.free(ot),rt=Tt.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),gt=lt.computeSpot(ut,a.port);if(gt.$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),gt=bx(b,gt,yt,lt.isOrthogonal),gt===0?(gt=4,180<yt&&(yt-=360)):gt===90?(gt=8,270<yt&&(yt-=360)):gt===180?gt=2:(gt=1,90>yt&&(yt+=360)),xt=a.pe[z],xt===void 0?(xt=new ty(lt,yt,gt),a.pe[z]=xt):(xt.link=lt,xt.angle=yt,xt.Nc=gt),xt.hv.set(ut),z++}}}}for(Tt.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,gt=a.port,E=a.node.portSpreading,rt=Tt.alloc(),ot=Tt.alloc(),tt=Tt.alloc(),lt=Tt.alloc(),gt.ga(_r,rt),gt.ga(co,ot),gt.ga(io,tt),gt.ga(da,lt),xt=yt=ut=gt=0,E===Hv)for(var Ct=0;Ct<z.length;Ct++){var bt=z[Ct];if(bt!==null){var Wt=bt.link.computeThickness();switch(bt.Nc){case 8:yt+=Wt;break;case 2:xt+=Wt;break;case 1:gt+=Wt;break;default:case 4:ut+=Wt}}}var Zt=Ct=0,$t=1,ne=bt=0;for(Wt=0;Wt<z.length;Wt++){var re=z[Wt];if(re!==null){if(Ct!==re.Nc){switch(Ct=re.Nc,Ct){case 8:var de=tt;Zt=lt;break;case 2:de=lt,Zt=rt;break;case 1:de=rt,Zt=ot;break;default:case 4:de=ot,Zt=tt}switch(bt=Zt.x-de.x,ne=Zt.y-de.y,Ct){case 8:yt>Math.abs(bt)?($t=Math.abs(bt)/yt,yt=Math.abs(bt)):$t=1;break;case 2:xt>Math.abs(ne)?($t=Math.abs(ne)/xt,xt=Math.abs(ne)):$t=1;break;case 1:gt>Math.abs(bt)?($t=Math.abs(bt)/gt,gt=Math.abs(bt)):$t=1;break;default:case 4:ut>Math.abs(ne)?($t=Math.abs(ne)/ut,ut=Math.abs(ne)):$t=1}Zt=0}var Fe=re.Zo;if(E===Hv){switch(re=re.link.computeThickness(),re*=$t,Fe.set(de),Ct){case 8:Fe.x=de.x+bt/2+yt/2-Zt-re/2;break;case 2:Fe.y=de.y+ne/2+xt/2-Zt-re/2;break;case 1:Fe.x=de.x+bt/2-gt/2+Zt+re/2;break;default:case 4:Fe.y=de.y+ne/2-ut/2+Zt+re/2}Zt+=re}else{var Wn=.5;E===Vm&&(Wn=(re.Uo+1)/(re.Gl+1)),Fe.x=de.x+bt*Wn,Fe.y=de.y+ne*Wn}}}for(Tt.free(rt),Tt.free(ot),Tt.free(tt),Tt.free(lt),de=a.pe,z=0;z<de.length;z++)E=de[z],E!==null&&(E.Ju=a.computeEndSegmentLength(E));a.ap=x,Oe.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 Tt,this.Gl=this.Uo=0,this.Zo=new Tt,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){Gi(this),this.o=this.H=null,this.Gh=this.sn=!0,this.yn=!1,this.Am=new Tt(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=hi(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 Do(this)},Ko.prototype.makeNetwork=function(a){var y=this.createNetwork();return a instanceof Ne?(y.lg(a.nodes,!0),y.lg(a.links,!0)):a instanceof nr?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 vn;a instanceof Ne?(pd(this,y,a.nodes,!0,this.rh,!0,!1,!0),pd(this,y,a.parts,!0,this.rh,!0,!1,!0)):a instanceof nr?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 nr&&(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 kn)&&(gp(rt),this.rh(rt))){var ot=rt.measuredBounds,lt=ot.width;ot=ot.height,rt.moveTo(x,E),rt instanceof nr&&(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 nr&&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 qn?ot.isLinkLabel||(ot instanceof nr&&ot.layout===null?pd(a,y,ot.memberParts,!1,b,z,tt,rt):(gp(ot),y.add(ot))):tt&&ot instanceof kn?y.add(ot):!rt||!ot.Zc()||ot instanceof qn||(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 Oe),x(a,this,y)):y?(y.set(a.actualBounds),y):a.actualBounds},Ko.prototype.ex=function(a){var y=new vn;return a instanceof Ne?(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 nr?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},Ue.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 Do(a){Gi(this),this.Sc=a,this.wf=new vn,this.ye=new vn,this.Es=new be,this.zs=new be}Do.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 vn,this.ye=new vn,this.Es=new be,this.zs=new be},Do.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},Do.prototype.createVertex=function(){return new Ca(this)},Do.prototype.createEdge=function(){return new qs(this)},Do.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 qn)return!tt.isLinkLabel;if(tt instanceof kn){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 qn&&(!y||E.isTopLevel)&&E.canLayout()&&x(E)){if(E instanceof nr&&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 kn&&(!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))}}},Do.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=Do.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=Jn(),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]);ii(a)},Do.prototype.deleteArtificialVertexes=function(){for(var a=Jn(),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=Jn(),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]);ii(a),ii(y)};function Nx(a){for(var y=Jn(),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]);ii(y)}Do.prototype.Zx=function(a){a===void 0&&(a=!0),a&&(this.deleteArtificialVertexes(),Nx(this),this.Ko()),a=new un;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))}}Do.prototype.dz=function(){for(var a=new vn,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},Ue.Object.defineProperties(Do.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}}}),Do.prototype.findAllParts=Do.prototype.dz,Do.prototype.splitIntoSubNetworks=Do.prototype.Zx,Do.prototype.deleteSelfEdges=Do.prototype.Ko,Do.prototype.reverseEdge=Do.prototype.gm,Do.prototype.linkVertexes=Do.prototype.Zj,Do.prototype.findEdge=Do.prototype.Lo,Do.prototype.deleteLink=Do.prototype.Yy,Do.prototype.deleteEdge=Do.prototype.Mj,Do.prototype.addLink=Do.prototype.Dy,Do.prototype.addEdge=Do.prototype.Bo,Do.prototype.findVertex=Do.prototype.ki,Do.prototype.deleteNode=Do.prototype.Zy,Do.prototype.deleteVertex=Do.prototype.Iu,Do.prototype.addNode=Do.prototype.Bl,Do.prototype.addVertex=Do.prototype.dh,Do.prototype.addParts=Do.prototype.lg,Do.className="LayoutNetwork";function Ca(a){Gi(this),this.ob=a,this.j=new Oe(0,0,10,10).freeze(),this.o=new Tt(5,5).freeze(),this.Sh=this.ub=null,this.tg=new un,this.mg=new un}Ca.prototype.clear=function(){this.Sh=this.ub=null,this.tg=new un,this.mg=new un},Ca.prototype.toString=function(a){a===void 0&&(a=0);var y="LayoutVertex#"+Oi(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},Ca.prototype.commit=function(){var a=this.ub;if(a!==null){var y=this.bounds,x=a.bounds;ze(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 nr)){x=Oe.alloc(),a.Va();var E=this.network.layout.ni(a,x),b=a.locationObject.ga(cr);if(E.w()&&b.w()){a.moveTo(y.x+this.focusX-(b.x-E.x),y.y+this.focusY-(b.y-E.y)),Oe.free(x);return}Oe.free(x)}a.moveTo(y.x,y.y)}},Ca.prototype.Cl=function(a){a!==null&&(this.tg.contains(a)||this.tg.add(a))},Ca.prototype.Kl=function(a){a!==null&&this.tg.remove(a)},Ca.prototype.zl=function(a){a!==null&&(this.mg.contains(a)||this.mg.add(a))},Ca.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}Ue.Object.defineProperties(Ca.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=Oe.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),Oe.free(x),!(a instanceof nr)&&(a=a.locationObject.ga(cr),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 vn,y=this.sourceEdges;y.next();)a.add(y.value.fromVertex);return a.iterator}},destinationVertexes:{get:function(){for(var a=new vn,y=this.destinationEdges;y.next();)a.add(y.value.toVertex);return a.iterator}},vertexes:{get:function(){for(var a=new vn,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 un,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}}}),Ca.prototype.deleteDestinationEdge=Ca.prototype.Jl,Ca.prototype.addDestinationEdge=Ca.prototype.zl,Ca.prototype.deleteSourceEdge=Ca.prototype.Kl,Ca.prototype.addSourceEdge=Ca.prototype.Cl,Ca.className="LayoutVertex",Ca.standardComparer=ry,Ca.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 qs(a){Gi(this),this.nb=a,this.qd=this.kd=this.$k=this.ub=null}qs.prototype.clear=function(){this.qd=this.kd=this.$k=this.ub=null},qs.prototype.toString=function(a){a===void 0&&(a=0);var y="LayoutEdge#"+Oi(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},qs.prototype.gm=function(){var a=this.kd;this.kd=this.qd,this.qd=a},qs.prototype.commit=function(){},qs.prototype.Ax=function(a){return this.qd===a?this.kd:this.kd===a?this.qd:null},Ue.Object.defineProperties(qs.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)}}}),qs.prototype.getOtherVertex=qs.prototype.Ax,qs.className="LayoutEdge";function Va(a){Ko.call(this),this.isViewportSized=!0,this.yo=this.zo=NaN,this.yg=new en(NaN,NaN).freeze(),this.tf=new en(10,10).freeze(),this.Jb=pp,this.Rb=o0,this.nd=mp,this.hd=uS,a&&Object.assign(this,a)}Ee(Va,Ko),Va.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},Va.prototype.qb=function(a){a.classType===Va?a===mp||a===s0||a===oy||a===a0?this.sorting=a:a===o0||a===gu?this.arrangement=a:a===pp||a===r0?this.alignment=a:Qt("Unknown enum value: "+a):Ko.prototype.qb.call(this,a)},Va.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 nr)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=Oe.alloc(),ut=Math.max(this.cellSize.width,1);if(!isFinite(ut))for(var gt=ut=0;gt<b.length;gt++){var yt=this.ni(b[gt],lt);ut=Math.max(ut,yt.width)}if(ut=Math.max(ut+rt,1),gt=Math.max(this.cellSize.height,1),!isFinite(gt))for(yt=gt=0;yt<b.length;yt++){var xt=this.ni(b[yt],lt);gt=Math.max(gt,xt.height)}gt=Math.max(gt+ot,1),yt=this.arrangement;for(var Ct=xt=this.arrangementOrigin.x,bt=this.arrangementOrigin.y,Wt=0,Zt=0,$t=0;$t<b.length;$t++){var ne=b[$t],re=this.ni(ne,lt),de=Math.ceil((re.width+rt)/ut)*ut,Fe=Math.ceil((re.height+ot)/gt)*gt;switch(yt){case gu:var Wn=Math.abs(Ct-re.width);break;default:Wn=Ct+re.width}switch((0<z&&Wt>z-1||0<tt&&0<Wt&&Wn-xt>tt)&&(E.push(new Oe(0,bt,tt+rt,Zt)),Wt=0,Ct=xt,bt+=Zt,Zt=0),Zt=Math.max(Zt,Fe),yt){case gu:re=-re.width;break;default:re=0}switch(ne.moveTo(Ct+re,bt),yt){case gu:Ct-=de;break;default:Ct+=de}Wt++}E.push(new Oe(0,bt,tt+rt,Zt)),Oe.free(lt);break;case pp:for(ot=tt,ut=z,gt=y,yt=x,tt=Oe.alloc(),xt=Math.max(this.cellSize.width,1),z=bt=lt=0,rt=Tt.alloc(),Ct=0;Ct<b.length;Ct++)Zt=b[Ct],Wt=this.ni(Zt,tt),Zt=Oh(Zt,Zt.locationObject,Zt.locationSpot,rt),lt=Math.max(lt,Zt.x),bt=Math.max(bt,Wt.width-Zt.x),z=Math.max(z,Zt.y);switch(Ct=this.arrangement,Ct){case gu:lt+=gt;break;default:bt+=gt}xt=isFinite(xt)?Math.max(xt+gt,1):Math.max(lt+bt,1);var mi=Zt=this.arrangementOrigin.x;for($t=this.arrangementOrigin.y,bt=0,ot>=lt&&(ot-=lt),lt=ne=0,de=Math.max(this.cellSize.height,1),re=z=0,Fe=!0,Wt=Tt.alloc(),Wn=0;Wn<b.length;Wn++){var ui=b[Wn],Fn=this.ni(ui,tt),rn=Oh(ui,ui.locationObject,ui.locationSpot,rt);if(0<bt)switch(Ct){case gu:mi=(mi-Zt-(Fn.width-rn.x))/xt,mi=_t.$(Math.round(mi),mi)?Math.round(mi):Math.floor(mi),mi=mi*xt+Zt;break;default:mi=(mi-Zt+rn.x)/xt,mi=_t.$(Math.round(mi),mi)?Math.round(mi):Math.ceil(mi),mi=mi*xt+Zt}else switch(Ct){case gu:ne=mi+rn.x+Fn.width;break;default:ne=mi-rn.x}switch(Ct){case gu:var er=-(mi+rn.x)+ne;break;default:er=mi+Fn.width-rn.x-ne}if(0<ut&&bt>ut-1||0<ot&&0<bt&&er>ot){for(E.push(new Oe(0,Fe?$t-z:$t,ot+gt,re+z+yt)),mi=0;mi<bt&&Wn!==bt;mi++){er=b[Wn-bt+mi];var Ki=Oh(er,er.locationObject,er.locationSpot,Wt);er.moveTo(er.position.x,er.position.y+z-Ki.y)}re+=yt,$t=Fe?$t+re:$t+(re+z),bt=re=z=0,mi=Zt,Fe=!1}switch(mi===Zt&&(lt=Ct===gu?Math.max(lt,Fn.width-rn.x):Math.min(lt,-rn.x)),z=Math.max(z,rn.y),re=Math.max(re,Fn.height-rn.y),isFinite(de)&&(re=Math.max(re,Math.max(Fn.height,de)-rn.y)),Fe?ui.moveTo(mi-rn.x,$t-rn.y):ui.moveTo(mi-rn.x,$t),Ct){case gu:mi-=rn.x+gt;break;default:mi+=Fn.width-rn.x+gt}bt++}if(E.push(new Oe(0,$t,ot+gt,(Fe?re:re+z)+yt)),b.length!==bt)for(ot=0;ot<bt;ot++)ut=b[b.length-bt+ot],gt=Oh(ut,ut.locationObject,ut.locationSpot,rt),ut.moveTo(ut.position.x,ut.position.y+z-gt.y);if(Tt.free(rt),Tt.free(Wt),Ct===gu)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);Oe.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===gu?this.commitLayers(E,new Tt(b+y/2-(z+b),tt-x/2)):this.commitLayers(E,new Tt(b-y/2,tt-x/2)),a!==null&&a.eb("Layout"),this.isValidLayout=!0}},Va.prototype.commitLayers=function(){};function uS(a,y){return a=a.text,y=y.text,a<y?-1:a>y?1:0}Ue.Object.defineProperties(Va.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!==gu||(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 Ae(Va,"Position",0),pp=new Ae(Va,"Location",1),o0=new Ae(Va,"LeftToRight",2),gu=new Ae(Va,"RightToLeft",3),oy=new Ae(Va,"Forward",4),a0=new Ae(Va,"Reverse",5),mp=new Ae(Va,"Ascending",6),s0=new Ae(Va,"Descending",7);Va.className="GridLayout",Va.standardComparer=uS,Va.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},Va.Position=r0,Va.Location=pp,Va.LeftToRight=o0,Va.RightToLeft=gu,Va.Forward=oy,Va.Reverse=a0,Va.Ascending=mp,Va.Descending=s0;function So(){this.On=new vn,this.Dn=new vn,this.Pa=new vn,this.cf=new be,this.bf=new be,this.aj=new be,this.H=null,this.tp=!1}wt=So.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 qn){if(this.On.add(a),a instanceof nr){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 kn?this.Dn.add(a):a instanceof Qr||this.Pa.add(a);y=a.data,y===null||a instanceof Qr||(a instanceof kn?this.bf.add(y,a):this.cf.add(y,a))},wt.pc=function(a){if(a.Ej(),a instanceof qn){if(this.On.remove(a),a instanceof nr){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 kn?this.Dn.remove(a):a instanceof Qr||this.Pa.remove(a);y=a.data,y===null||a instanceof Qr||(a instanceof kn?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 nr)&&Qt('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 nr||Qt('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 kn||Qt('Invalid link template in Diagram.linkTemplateMap: template for "'+E+'" must be a Link, not a normal Node or simple Part: '+x);for(y=Jn(),x=a.selection.iterator;x.next();)(E=x.value.data)&&y.push(E);for(x=Jn(),a=a.highlighteds.iterator;a.next();)(E=a.value.data)&&x.push(E);for(a=Jn(),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]);ii(y),ii(x),ii(a)}},So.prototype.addAllModeledParts=function(){this.addModeledParts(this.diagram.model.nodeDataArray)},So.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&&xf(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&&(jl(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)}}So.prototype.insertLink=function(){return null},So.prototype.resolveReferencesForData=function(){},So.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,_n('No Group template found for category "'+x+'"'),_n(" Using default group template")),y=a.ly))):(y=a.nodeTemplateMap.I(x),y===null&&(y=a.nodeTemplateMap.I(""),y===null&&(fS||(fS=!0,_n('No Node template found for category "'+x+'"'),_n(" Using default node template")),y=a.ny))),y}So.prototype.getLinkCategoryForData=function(){return""},So.prototype.setLinkCategoryForData=function(){},So.prototype.setFromNodeForLink=function(){},So.prototype.setToNodeForLink=function(){},So.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,_n('No Link template found for category "'+a+'"'),_n(" Using default link template")),x=y.my)),x},So.prototype.removeAllModeledParts=function(){this.Gs(this.diagram.model.nodeDataArray)},So.prototype.Gs=function(a){var y=this;a.forEach(function(x){y.ip(x)})},So.prototype.ip=function(a){a=this.Lc(a),a!==null&&(Ng(this.diagram,a,!1),this.unresolveReferencesForPart(a))},So.prototype.unresolveReferencesForPart=function(){},So.prototype.removeDataForLink=function(){},So.prototype.findPartForKey=function(a){return a==null?null:(a=this.H.model.hc(a),a!==null?this.cf.I(a):null)},So.prototype.Vb=function(a){return a==null||(a=this.H.model.hc(a),a===null)?null:(a=this.cf.I(a),a instanceof qn?a:null)},So.prototype.findLinkForKey=function(){return null},wt=So.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 qn?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 vn;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(ze(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 vn;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(ze(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(hn(z)){if(!hn(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(ze(y)&&ze(x)){if(!ay(a,y,x))return!1}else if(y!==x)return!1;return!0}So.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===pr){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===ao){var tt=a.newValue;E==="nodeDataArray"&&ze(tt)&&hS(this,tt),y.isModified=!0}else if(x===mo){var rt=a.oldValue;E==="nodeDataArray"&&ze(rt)&&this.ip(rt),y.isModified=!0}else x===Xi&&(E==="SourceChanged"?a.object!==null?this.updateDataBindings(a.object,a.propertyName):(this.rp(),this.updateAllTargetBindings()):E==="ModelDisplaced"&&this.Wd());else if(x===pr){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===ao||x===mo){var ut=a.change===ao,gt=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,gt,!0);else if(!(0>gt)){var bt=gt+Qg(Ct);Ct.pc(bt,!0),xv(Ct,bt,gt)}}y.isModified=!0}}finally{y.aa=!0}}}}},So.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)},So.prototype.rp=function(){for(var a=this.H.model,y=new vn,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()},So.prototype.refreshDataBoundLinks=function(){},So.prototype.updateRelationshipsFromData=function(){},So.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=Jn()),x.push(tt))}if(x!==null)break}if(x!==null){for(E=0;E<x.length;E++)x[E].La(y);ii(x)}}a===this.diagram.model.modelData&&this.updateAllTargetBindings(y)}};function sy(a,y){var x=y.Hh;if(hn(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(hn(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}}}}So.prototype.Kj=function(a,y,x){x===void 0&&(x=!1);var E=new be;if(hn(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 vn;for(var z=new be,tt=E.iterator;tt.next();){var rt=tt.value;if(rt instanceof kn)a||rt.fromNode!==null&&rt.toNode!==null||b.add(rt);else if(rt instanceof qn&&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(gt){gt.key.data!==null&&ut.add(gt.key.data,gt.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 Ti))return null;if(z.isSelected=!1,z.isHighlighted=!1,E.add(y,z),y instanceof qn){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 nr&&z instanceof nr)for(y=y.memberParts;y.next();)tt=l0(a,y.value,x,E,b),tt instanceof kn||tt===null||(tt.containingGroup=z)}else if(y instanceof kn&&z instanceof kn)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 qn&&(tt.labeledLink=z);return z}So.prototype.copyPartData=function(a,y){var x=null,E=a.data;if(E!==null&&y!==null){var b=y.model;a instanceof kn||(E=b.copyNodeData(E),ze(E)&&(b.xf(E),x=y.Lc(E)))}else jl(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 kn||(b=y.copyNodeData(E)),ze(b)&&(x.data=b)));return x},Ue.Object.defineProperties(So.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}}}),So.prototype.updateAllRelationshipsFromData=So.prototype.rp,So.prototype.findLinksByExample=So.prototype.ls,So.prototype.findNodesByExample=So.prototype.ms,So.prototype.findLinkForData=So.prototype.Kc,So.prototype.findNodeForData=So.prototype.ii,So.prototype.findPartForData=So.prototype.Lc,So.prototype.findNodeForKey=So.prototype.Vb,So.prototype.removeModeledPart=So.prototype.ip,So.prototype.removeModeledParts=So.prototype.Gs,So.prototype.rebuildParts=So.prototype.Wd;var fS=!1,gS=!1,pS=!1;So.className="PartManager";function Da(a){So.apply(this,arguments)}Ee(Da,So),Da.prototype.addAllModeledParts=function(){var a=this.diagram.model;this.addModeledParts(a.nodeDataArray),mS(this,a.linkDataArray)},Da.prototype.addModeledParts=function(a){for(So.prototype.addModeledParts.call(this,a,!1),a=this.links.iterator;a.next();)Zf(a.value);xf(this.diagram,!1)};function mS(a,y){y.forEach(function(x){vS(a,x)}),xf(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){jl(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=cl(x,y,!0),z!==void 0&&(z=a.Vb(z),z instanceof qn&&(b.fromNode=z)),z=c0(x,y,!1),z!==""&&(b.toPortId=z),z=cl(x,y,!1),z!==void 0&&(z=a.Vb(z),z instanceof qn&&(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}}}}Da.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)})}Da.prototype.getLinkCategoryForData=function(a){return this.diagram.model.ps(a)},Da.prototype.setLinkCategoryForData=function(a,y){return this.diagram.model.lp(a,y)},Da.prototype.setFromNodeForLink=function(a,y){var x=this.diagram.model;x.wv(a.data,x.wa(y!==null?y.data:null))},Da.prototype.setToNodeForLink=function(a,y){var x=this.diagram.model;x.Bv(a.data,x.wa(y!==null?y.data:null))},Da.prototype.removeDataForLink=function(a){this.diagram.model.bm(a.data)},Da.prototype.findPartForKey=function(a){var y=So.prototype.findPartForKey.call(this,a);return y===null&&(a=this.diagram.model.jh(a),a!==null)?this.bf.I(a):y},Da.prototype.findLinkForKey=function(a){return a==null?null:(a=this.diagram.model.jh(a),a!==null?this.bf.I(a):null)},Da.prototype.doModelChanged=function(a){var y=this;if(So.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===pr){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 gt=this.Kc(a.object);if(gt!==null){var yt=a.newValue;typeof yt=="string"&&(gt.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 nr?xt.containingGroup=bt:xt.containingGroup=null}else xt.containingGroup=null}}else if(b==="linkLabelKeys"){var Wt=this.Kc(a.object);if(Wt!==null){var Zt=a.oldValue,$t=a.newValue;Array.isArray(Zt)&&Zt.forEach(function(rn){0<=$t.indexOf(rn)||(rn=y.Vb(rn),rn!==null&&(rn.labeledLink=null))}),Array.isArray($t)&&$t.forEach(function(rn){rn=y.Vb(rn),rn!==null&&(rn.labeledLink=Wt)})}}else if(b==="linkCategory"){var ne=this.Kc(a.object),re=a.newValue;ne!==null&&typeof re=="string"&&(ne.category=re)}else b==="linkDataArray"&&(yS(this,a.oldValue),mS(this,a.newValue));x.isModified=!0}else if(E===ao){var de=a.newValue;if(b==="linkDataArray"&&typeof de=="object"&&de!==null)vS(this,de);else if(b==="linkLabelKeys"&&vd(de)){var Fe=this.Kc(a.object),Wn=this.Vb(de);Fe!==null&&Wn!==null&&(Wn.labeledLink=Fe)}x.isModified=!0}else if(E===mo){var mi=a.oldValue;if(b==="linkDataArray"&&typeof mi=="object"&&mi!==null)this.ip(mi);else if(b==="linkLabelKeys"&&vd(mi)){var ui=this.Vb(mi);ui!==null&&(ui.labeledLink=null)}x.isModified=!0}}else if(E===pr){var Fn=a.propertyName;a.object!==x.model||Fn!=="linkFromKeyProperty"&&Fn!=="linkToKeyProperty"&&Fn!=="linkFromPortIdProperty"&&Fn!=="linkToPortIdProperty"&&Fn!=="linkLabelKeysProperty"&&Fn!=="nodeIsGroupProperty"&&Fn!=="nodeGroupKeyProperty"&&Fn!=="linkCategoryProperty"||x.undoManager.isUndoingRedoing||this.Wd(),x.isModified=!0}}finally{x.aa=!0}}}}},Da.prototype.refreshDataBoundLinks=function(){var a=this,y=this.diagram.model,x=new vn,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)})},Da.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 kn){var b=cl(E,y,!0);if(b=x.Vb(b),a.fromNode=b,b=cl(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 vn().addAll(y);var tt=new vn;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 nr)&&(a.containingGroup=y)}}},Da.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 nr&&y.lh(tt)===x&&(tt=this.Lc(tt),tt!==null&&(tt.containingGroup=b)):(z.link=this.Kc(tt),z.link!==null&&b instanceof qn&&(cl(y,tt,!0)===x&&(z.link.fromNode=b),cl(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}}mu(y,x)}a=y.lh(a),a!==void 0&&(a=this.Vb(a),a instanceof nr&&(b.containingGroup=a))}},Da.prototype.unresolveReferencesForPart=function(a){var y=this.diagram.model;if(a instanceof qn){var x=y.wa(a.data);if(x!==void 0){for(var E=a.linksConnected;E.next();)pu(y,x,E.value.data);if(a.isLinkLabel&&(E=a.labeledLink,E!==null&&pu(y,x,E.data)),a instanceof nr)for(a=a.memberParts;a.next();)E=a.value.data,y.lb(E)&&pu(y,x,E)}}},Da.prototype.copyPartData=function(a,y){var x=So.prototype.copyPartData.call(this,a,y);if(a instanceof kn)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},Da.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 kn){if(jl(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 qn&&(jl(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&&Uf(z,E,z.wa(a.data),!0),Yf(z,E,rt,!0),x!==null&&Uf(z,E,z.wa(x.data),!1),Yf(z,E,y,!1),z.fi(E),a=tt.archetypeLabelNodeData,a===null||a instanceof qn||(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},Da.prototype.findLinkForKey=Da.prototype.findLinkForKey,Da.prototype.findPartForKey=Da.prototype.findPartForKey,Da.prototype.removeAllModeledParts=Da.prototype.removeAllModeledParts,Da.prototype.addModeledParts=Da.prototype.addModeledParts,Da.prototype.addAllModeledParts=Da.prototype.addAllModeledParts,Da.className="GraphLinksPartManager";function Fl(){So.apply(this,arguments),this.Sg=null}Ee(Fl,So);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||!ki(E,b,z,null,!0))&&(y=a.getLinkCategoryForData(x.data),E=a.findLinkTemplateForCategory(y),E!==null&&(jl(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}}}Fl.prototype.getLinkCategoryForData=function(a){return this.diagram.model.ss(a)},Fl.prototype.setLinkCategoryForData=function(a,y){this.diagram.model.Ms(a,y)},Fl.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}},Fl.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))},Fl.prototype.removeDataForLink=function(a){this.diagram.model.qe(a.data,void 0)},Fl.prototype.findLinkForKey=function(a){return a==null?null:(a=this.diagram.model.hc(a),a!==null?this.bf.I(a):null)},Fl.prototype.doModelChanged=function(a){if(So.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===pr){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===pr){var gt=a.propertyName;a.object===y.model&>==="nodeParentKeyProperty"&&(y.undoManager.isUndoingRedoing||this.Wd()),y.isModified=!0}}finally{y.aa=!0}}}}},Fl.prototype.updateRelationshipsFromData=function(a){var y=a.data;if(y!==null){var x=a.diagram;if(x!==null){var E=x.model;a instanceof qn&&(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)))}}},Fl.prototype.updateDataBindings=function(a,y){So.prototype.updateDataBindings.call(this,a,y),typeof y=="string"&&this.Lc(a)!==null&&(a=this.Kc(a),a!==null&&a.La(y))},Fl.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 qn&&y.mh(z)===x&&u0(this,b,this.ii(z))}mu(y,x)}a=y.mh(a),a!==void 0&&b instanceof qn&&(a=this.Vb(a),u0(this,a,b))}},Fl.prototype.unresolveReferencesForPart=function(a){var y=this.diagram.model;if(a instanceof qn){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(mo,"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)&&pu(y,x,b)}},Fl.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},Fl.prototype.findLinkForKey=Fl.prototype.findLinkForKey,Fl.className="TreePartManager";function bi(a,y){this.kl=new vn,this.il=new vn,this.Wv=`,
|
|
"insertedNodeKeys": `,this.jy=`,
|
|
"modifiedNodeData": `,this.Yv=`,
|
|
"removedNodeKeys": `,this.vh=null,Gi(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 un,this.Wg=!1,this.o=null,this.undoManager=new Ji,a!==void 0&&(hn(a)?this.nodeDataArray=a:y=a),y&&(Object.assign(this,y),a=y.Changed)&&(delete this.Changed,this.Pe(a))}bi.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},bi.prototype.copy=function(){var a=new this.constructor;return this.cloneProtected(a),a},bi.prototype.clear=function(){this.Tc=[],this.kb.clear(),this.Vf.clear(),this.undoManager.clear()},bi.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},bi.prototype.xA=function(a){a.change!==Xi&&Qt("Model.toIncrementalData argument is not a Transaction ChangedEvent:"+a.toString());var y=a.object;return a.isTransactionFinished&&y instanceof Ro?(xS(this,y),a=this.Qv(y,a.propertyName==="FinishedUndo"),this.vh=null,a):null},bi.prototype.Qv=function(a,y){var x=this,E=!1,b=new vn,z=new vn,tt=new vn,rt=this.vh;a.changes.each(function(gt){gt.model===x&&(gt.modelChange==="nodeDataArray"?gt.change===ao?b.add(gt.newValue):gt.change===mo&&tt.add(gt.oldValue):x.lb(gt.object)?z.add(gt.object):gt.change!==pr||x.modelData!==gt.object&>.propertyName!=="modelData"?gt.object!==null&&(rt&&rt.contains(gt.object)?rt.get(gt.object).each(function(yt){x.lb(yt)&&z.add(yt)}):gt.object instanceof bi||x.ri()&&x.Jc(gt.object)||PS(x,gt.object).each(function(yt){z.add(yt)})):E=!0)});var ot=this.il;ot.clear(),b.each(function(gt){ot.add(x.wa(gt)),y||z.add(gt)});var lt=this.kl;lt.clear(),tt.each(function(gt){lt.add(x.wa(gt)),y&&z.add(gt)}),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},bi.prototype.cloneDeep=function(a){return Kf(this,a,!0)};function Kf(a,y,x,E,b,z){function tt(gt,yt){rt?(gt.__gohashid===void 0&&z.push(gt),E.set(gt,yt)):(gt=ko++,E.set(gt,yt),b.set(gt,y))}if(!ze(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(Kf(a,y[ut],!1,E,b,z))}else if(y instanceof Tt||y instanceof en||y instanceof Oe||y instanceof dr||y instanceof yi)ot=y.copy(),tt(y,ot);else{if(y instanceof vo||y instanceof ce||y instanceof Ae)return y;if(y instanceof un)ot=new un().addAll(Kf(a,y.Fa(),!1,E,b,z)),tt(y,ot);else if(y instanceof vn)ot=new vn().addAll(Kf(a,y.Fa(),!1,E,b,z)),tt(y,ot);else if(y instanceof be)ot=new be().addAll(Kf(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]=Kf(a,y[ut],!1,E,b,z))}return x&&z.forEach(function(gt){delete gt.__gohashid}),ot}wt=bi.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,ze(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,hn(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 vn,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===pr?(b=b.object.panel)&&(z=b.data)&&x(z,b):(z===ao||z===mo)&&(b=b.object,(z=b.itemArray)&&x(z,b))}}),a.vh=E)}function PS(a,y){for(var x=new vn,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(ze(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 vn,z=new vn,tt=new vn,rt=this.vh;a.changes.each(function(ut){ut.model===x&&(ut.modelChange==="nodeDataArray"?ut.change===ao?b.add(ut.newValue):ut.change===mo&&tt.add(ut.oldValue):x.lb(ut.object)?z.add(ut.object):ut.change!==pr||x.modelData!==ut.object&&ut.propertyName!=="modelData"?ut.object!==null&&(rt&&rt.contains(ut.object)?rt.get(ut.object).each(function(gt){x.lb(gt)&&z.add(gt)}):ut.object instanceof bi||x.ri()&&x.Jc(ut.object)||PS(x,ut.object).each(function(gt){z.add(gt)})):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)&&Qt("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!==Xi&&Qt("Model.toIncrementalJson argument is not a Transaction ChangedEvent:"+a.toString());var x=a.object;return a.isTransactionFinished&&x instanceof Ro?(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=$e.JSON.parse(a)}catch(E){}else typeof a=="object"?y=a:Qt("Unable to modify a Model from: "+a);var x=y.incremental;typeof x!="number"&&Qt("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)},bi.constructGraphLinksModel=function(){return new bi},wt=bi.prototype,wt.dm=function(a){if(hn(a))for(var y=a.length,x=0;x<y;x++){var E=a[x];if(ze(E)){var b=x;E=this.dm(E),Array.isArray(a)?a[b]=E:Qt("Cannot replace an object in an HTMLCollection or NodeList at "+b)}}else if(ze(a)){for(y in a)if(x=a[y],ze(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 un,E=0;E<x.length/2;E++)b.add(new Tt(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()):hn(a)?md(this,a):ze(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 Ri;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 Cs(a){return isNaN(a)?"NaN":a===1/0?"9e9999":a===-1/0?"-9e9999":a}function uy(a,y){var x=y;if(x instanceof Tt)y={class:"go.Point",x:Cs(x.x),y:Cs(x.y)};else if(x instanceof en)y={class:"go.Size",width:Cs(x.width),height:Cs(x.height)};else if(x instanceof Oe)y={class:"go.Rect",x:Cs(x.x),y:Cs(x.y),width:Cs(x.width),height:Cs(x.height)};else if(x instanceof dr)y={class:"go.Margin",top:Cs(x.top),right:Cs(x.right),bottom:Cs(x.bottom),left:Cs(x.left)};else if(x instanceof yi)x.sb()?y={class:"go.Spot",x:Cs(x.x),y:Cs(x.y),offsetX:Cs(x.offsetX),offsetY:Cs(x.offsetY)}:y={class:"go.Spot",enum:x.toString()};else if(x instanceof vo){if(y={class:"go.Brush",type:x.type.name},x.type===Ah?y.color=x.color:(x.type===dh||x.type===El)&&(y.start=x.start,y.end=x.end,x.type===El&&(x.startRadius!==0&&(y.startRadius=Cs(x.startRadius)),isNaN(x.endRadius)||(y.endRadius=Cs(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 ce?(y={class:"go.Geometry",type:x.type.name},x.startX!==0&&(y.startX=Cs(x.startX)),x.startY!==0&&(y.startY=Cs(x.startY)),x.endX!==0&&(y.endX=Cs(x.endX)),x.endY!==0&&(y.endY=Cs(x.endY)),x.spot1.D(_r)||(y.spot1=x.spot1),x.spot2.D(io)||(y.spot2=x.spot2),x.type===ce.o&&(y.path=ce.ia(x))):x instanceof Ae&&(y={class:"go.EnumValue",classType:yp(a,x.classType),name:x.name});E="{",x=!0;for(var b in y){var z=oa(y,b);if(!wS(b,z))if(x?x=!1:E+=",",E+=a.quote(b)+":",b==="points"&&z instanceof un){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 Es(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 Tt(Es(a.x),Es(a.y));else if(y==="Size")x=new en(Es(a.width),Es(a.height));else if(y==="Rect")x=new Oe(Es(a.x),Es(a.y),Es(a.width),Es(a.height));else if(y==="Margin")x=new dr(Es(a.top),Es(a.right),Es(a.bottom),Es(a.left));else if(y==="Spot")typeof a.enum=="string"?x=Co(a.enum):x=new yi(Es(a.x),Es(a.y),Es(a.offsetX),Es(a.offsetY));else if(y==="Brush"){if(x=new vo,x.type=ri(vo,a.type),typeof a.color=="string"&&(x.color=a.color),a.start instanceof yi&&(x.start=a.start),a.end instanceof yi&&(x.end=a.end),typeof a.startRadius=="number"&&(x.startRadius=Es(a.startRadius)),typeof a.endRadius=="number"&&(x.endRadius=Es(a.endRadius)),a=a.colorStops,ze(a))for(var E in a)x.addColorStop(parseFloat(E),a[E])}else y==="Geometry"?(x=null,typeof a.path=="string"?x=ce.parse(a.path):x=new ce,x.type=ri(ce,a.type),typeof a.startX=="number"&&(x.startX=Es(a.startX)),typeof a.startY=="number"&&(x.startY=Es(a.startY)),typeof a.endX=="number"&&(x.endX=Es(a.endX)),typeof a.endY=="number"&&(x.endY=Es(a.endY)),a.spot1 instanceof yi&&(x.spot1=a.spot1),a.spot2 instanceof yi&&(x.spot2=a.spot2)):y==="EnumValue"&&(E=a.classType,E.indexOf("go.")===0&&(E=E.substr(3)),E=dy(E),typeof E=="function"&&(x=ri(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){ya(this,"",a,y,x,E,b,z,tt)},wt.g=function(a,y,x,E,b){ya(this,"",pr,a,this,y,x,E,b)},wt.Fs=function(a,y,x,E,b,z){ya(this,"",pr,y,a,x,E,b,z)};function ya(a,y,x,E,b,z,tt,rt,ot){rt===void 0&&(rt=null),ot===void 0&&(ot=null);var lt=new Fi;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)}bi.prototype.changeState=function(a,y){if(a!==null&&a.model===this)if(a.change===pr){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===ao?(x=a.newParam,a.modelChange==="nodeDataArray"?(a=a.newValue,ze(a)&&typeof x=="number"&&(E=this.wa(a),y?(this.Tc[x]===a&&vi(this.Tc,x),E!==void 0&&this.kb.remove(E)):(this.Tc[x]!==a&&In(this.Tc,x,a),E!==void 0&&this.kb.add(E,a)))):a.modelChange===""?((E=a.object)&&!hn(E)&&a.propertyName&&(E=oa(a.object,a.propertyName)),hn(E)&&typeof x=="number"&&(a=a.newValue,y?vi(E,x):In(E,x,a))):Qt("unknown ChangedEvent.Insert modelChange: "+a.toString())):a.change===mo?(x=a.oldParam,a.modelChange==="nodeDataArray"?(a=a.oldValue,ze(a)&&typeof x=="number"&&(E=this.wa(a),y?(this.Tc[x]!==a&&In(this.Tc,x,a),E!==void 0&&this.kb.add(E,a)):(this.Tc[x]===a&&vi(this.Tc,x),E!==void 0&&this.kb.remove(E)))):a.modelChange===""?((E=a.object)&&!hn(E)&&a.propertyName&&(E=oa(a.object,a.propertyName)),hn(E)&&typeof x=="number"&&(a=a.oldValue,y?In(E,x,a):vi(E,x))):Qt("unknown ChangedEvent.Remove modelChange: "+a.toString())):a.change!==Xi&&Qt("unknown ChangedEvent: "+a.toString())},bi.prototype.Ea=function(a){return this.undoManager.Ea(a)},bi.prototype.eb=function(a){return this.undoManager.eb(a)},bi.prototype.Kf=function(){return this.undoManager.Kf()},bi.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=bi.prototype,wt.La=function(a,y){y===void 0&&(y=""),ya(this,"SourceChanged",Xi,y,a,null,null)},wt.wa=function(a){if(a!==null){var y=this.Th;if(y!==""&&(y=oa(a,y),y!==void 0)){if(vd(y))return y;Qt("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=oa(a,x);E!==y&&this.hc(y)===null&&(Vo(a,x,y),E!==void 0&&this.kb.remove(E),this.kb.add(y,a),ya(this,"nodeKey",pr,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&&Qt("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&&(Wr(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&&Qt("Model.makeNodeDataKeyUnique failed on "+y+". Data not added to Model."),a.kb.add(E,y),E=null,x&&(E=a.Tc.length,In(a.Tc,E,y)),ya(a,"nodeDataArray",ao,"nodeDataArray",a,null,y,null,E),a.fm(y),a.em(y))}wt.Fy=function(a){if(hn(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;vi(a.Tc,E)}ya(a,"nodeDataArray",mo,"nodeDataArray",a,y,null,E,null),a.qp(y)}wt.nA=function(a){if(hn(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&&hn(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 vn&&this.Vf.add(y,a))},wt.Lv=function(){},wt.fm=function(){},wt.em=function(){},wt.qp=function(){};function pu(a,y,x){if(y!==void 0){var E=a.Vf.I(y);E===null&&(E=new vn,a.Vf.add(y,E)),E.add(x)}}function mu(a,y,x){if(y!==void 0){var E=a.Vf.I(y);E instanceof vn&&(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 vn?a:null)}wt.Qy=function(a){a===void 0?this.Vf.clear():this.Vf.remove(a)},bi.prototype.copyNodeData=function(a){if(a===null)return null;var y=this.Bk;return a=y!==null?y(a,this):d0(this,a,!0),ze(a)&&Gi(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 Gi(E),E}if(x&&ze(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=oa(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 bi||z instanceof Ji||z instanceof Ro||z instanceof Fi||(z=d0(a,z,!1)),Vo(x,E,z)}return Gi(x),x}return y instanceof Tt||y instanceof en||y instanceof Oe||y instanceof yi||y instanceof dr?y.copy():y}bi.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 fe&&(LS=!0,_n('Model.setDataProperty is modifying a GraphObject, "'+a.toString()+'"'),_n(" Is that really your intent?"));var E=oa(a,y);E!==x&&(Vo(a,y,x),this.Fs(a,y,E,x))},wt=bi.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),In(a,y,x),ya(this,"",ao,"",a,null,x,null,y)},wt.ov=function(a,y){y===void 0&&(y=-1),a===this.Tc&&Qt("Model.removeArrayItem should not be called on the Model.nodeDataArray"),y===-1&&(y=a.length-1);var x=a[y];vi(a,y),ya(this,"",mo,"",a,x,null,y,null)},wt.Ro=function(a){if(a===null)return"";var y=this.lj;if(y===""||(y=oa(a,y),y===void 0))return"";if(typeof y=="string")return y;Qt("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=oa(a,x);E===void 0&&(E=""),E!==y&&(Vo(a,x,y),ya(this,"nodeCategory",pr,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 bi}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 nu[a]?nu[a]:$e.go!==void 0&&$e.go[a]?$e.go[a]:null}function oa(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){}}Ue.Object.defineProperties(bi.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===""&&Qt("Model.nodeKeyProperty may not be the empty string"),0<this.kb.count&&Qt("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];ze(b)||Qt("Model.nodeDataArray must only contain Objects, not: "+b),Wr(b)}for(this.Tc=a,E=new un,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(ya(this,"nodeDataArray",pr,"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"}}}),bi.prototype.setCategoryForNodeData=bi.prototype.jm,bi.prototype.getCategoryForNodeData=bi.prototype.Ro,bi.prototype.removeArrayItem=bi.prototype.ov,bi.prototype.insertArrayItem=bi.prototype.ts,bi.prototype.addArrayItem=bi.prototype.Ay,bi.prototype.assignAllDataProperties=bi.prototype.Do,bi.prototype.set=bi.prototype.set,bi.prototype.clearUnresolvedReferences=bi.prototype.Qy,bi.prototype.mergeNodeDataArray=bi.prototype.$z,bi.prototype.removeNodeDataCollection=bi.prototype.nA,bi.prototype.removeNodeData=bi.prototype.cm,bi.prototype.addNodeDataCollection=bi.prototype.Fy,bi.prototype.addNodeData=bi.prototype.xf,bi.prototype.makeNodeDataKeyUnique=bi.prototype.$u,bi.prototype.findNodeDataForKey=bi.prototype.hc,bi.prototype.containsNodeData=bi.prototype.lb,bi.prototype.setKeyForNodeData=bi.prototype.km,bi.prototype.getKeyForNodeData=bi.prototype.wa,bi.prototype.updateTargetBindings=bi.prototype.La,bi.prototype.commit=bi.prototype.commit,bi.prototype.rollbackTransaction=bi.prototype.Kf,bi.prototype.commitTransaction=bi.prototype.eb,bi.prototype.startTransaction=bi.prototype.Ea,bi.prototype.raiseDataChanged=bi.prototype.Fs,bi.prototype.raiseChanged=bi.prototype.g,bi.prototype.raiseChangedEvent=bi.prototype.cb,bi.prototype.removeChangedListener=bi.prototype.ik,bi.prototype.addChangedListener=bi.prototype.Pe,bi.prototype.writeJsonValue=bi.prototype.sm,bi.prototype.replaceJsonObjects=bi.prototype.dm,bi.prototype.applyIncrementalJSON=bi.prototype.Ky,bi.prototype.applyIncrementalJson=bi.prototype.Zw,bi.prototype.toJSON=bi.prototype.toJSON,bi.prototype.toJson=bi.prototype.np,bi.prototype.toIncrementalJSON=bi.prototype.yA,bi.prototype.toIncrementalJson=bi.prototype.$x,bi.prototype.toIncrementalData=bi.prototype.xA,bi.prototype.clear=bi.prototype.clear;var LS=!1,nu={};bi.className="Model",bi.fromJSON=bi.fromJson=function(a,y){y===void 0&&(y=null);var x=null;if(typeof a=="string")try{x=$e.JSON.parse(a)}catch(z){}else typeof a=="object"?x=a:Qt("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=$e[E])),typeof b=="function"&&(a=new b)}catch(z){}a===null||a instanceof bi?y=a:Qt("Unable to construct a Model of declared class: "+x.class)}return y===null&&(y=bi.constructGraphLinksModel()),y.gp(x),y.kv(x),y},bi.safePropertyValue=oa,bi.safePropertySet=Vo,nu.Brush=vo,nu.ChangedEvent=Fi,nu.Geometry=ce,nu.Margin=dr,nu.Panel=wn,nu.Point=Tt,nu.Rect=Oe,nu.Size=en,nu.Spot=yi,nu.Transaction=Ro,nu.UndoManager=Ji;function sa(a,y,x,E){Gi(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 vn}sa.prototype.copy=function(){var a=new sa;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=sa.prototype,wt.qb=function(a){a.classType===sa&&(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==="")_n("Binding error: target property is the empty string: "+this.toString());else{var z=y;if(E!==""&&(z=oa(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=oa(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 gt=z(tt,y,ot);ot!==null?ot.setDataProperty(y,x,gt):Vo(y,x,gt)}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)}}}},Ue.Object.defineProperties(sa.prototype,{Ai:{get:function(){return this.j},set:function(a){this._isFrozen&&me(this),this.j=a}},targetProperty:{get:function(){return this.xl},set:function(a){this._isFrozen&&me(this),this.xl=a}},sourceName:{get:function(){return this.Cr},set:function(a){this._isFrozen&&me(this),this.Cr=a,a!==null&&(this.wn=!1)}},isToModel:{get:function(){return this.wn},set:function(a){this._isFrozen&&me(this),this.wn=a}},sourceProperty:{get:function(){return this.sl},set:function(a){this._isFrozen&&me(this),this.sl=a}},converter:{get:function(){return this.Im},set:function(a){this._isFrozen&&me(this),this.Im=a}},backConverter:{get:function(){return this.wk},set:function(a){this._isFrozen&&me(this),this.wk=a}},mode:{get:function(){return this.el},set:function(a){this._isFrozen&&me(this),this.el=a}}}),sa.prototype.updateSource=sa.prototype.sp,sa.prototype.updateTarget=sa.prototype.Mv,sa.prototype.ofModel=sa.prototype.dA,sa.prototype.ofObject=sa.prototype.cp,sa.prototype.makeTwoWay=sa.prototype.Kx;var Ax="Binding",MS=new Ae(sa,"OneWay",1),Sp=new Ae(sa,"TwoWay",2);sa.className="Binding",sa.parseEnum=function(a,y){return function(x){return x=ri(a,x),x===null?y:x}},sa.toString=Ii,sa.OneWay=MS,sa.TwoWay=Sp;function Hr(a,y,x){bi.call(this),this.Vv=`,
|
|
"insertedLinkKeys": `,this.iy=`,
|
|
"modifiedLinkData": `,this.Xv=`,
|
|
"removedLinkKeys": `,this.md=[],this.$f=new vn,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&&(hn(a)?this.nodeDataArray=a:x=a),x&&(Object.assign(this,x),a=x.Changed)&&(delete this.Changed,this.Pe(a))}Ee(Hr,bi),Hr.constructGraphLinksModel=bi.constructGraphLinksModel,Hr.prototype.cloneProtected=function(a){bi.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=Hr.prototype,wt.clear=function(){bi.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+=" "+cl(this,b,!0)+"-->"+cl(this,b,!1)}return y},wt.Qv=function(a,y){this.linkKeyProperty===""&&Qt("GraphLinksModel.linkKeyProperty must not be an empty string for .toIncrementalData() to succeed.");var x=bi.prototype.Qv.call(this,a,y),E=this,b=new vn,z=new vn,tt=new vn,rt=this.vh;a.changes.each(function(ut){ut.model===E&&(ut.modelChange==="linkDataArray"?ut.change===ao?b.add(ut.newValue):ut.change===mo&&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(gt){E.Jc(gt)&&z.add(gt)}):ut.object instanceof bi||E.lb(ut.object)||kS(E,ut.object).each(function(gt){z.add(gt)})))});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=bi.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){bi.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=bi.prototype.Rv.call(this),y=`,
|
|
"linkDataArray": `+md(this,this.linkDataArray,!0);return a+y},wt.kv=function(a){bi.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 vn,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===""&&Qt("GraphLinksModel.linkKeyProperty must not be an empty string for .toIncrementalJson() to succeed.");var x=bi.prototype.Pv.call(this,a,y),E=this,b=new vn,z=new vn,tt=new vn,rt=this.vh;a.changes.each(function(ut){ut.model===E&&(ut.modelChange==="linkDataArray"?ut.change===ao?b.add(ut.newValue):ut.change===mo&&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(gt){E.Jc(gt)&&z.add(gt)}):ut.object instanceof bi||E.lb(ut.object)||kS(E,ut.object).each(function(gt){z.add(gt)})))});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)&&Qt("applyIncrementalJson cannot change Model properties"),bi.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)},Hr.prototype.changeState=function(a,y){if(a!==null&&a.model===this){if(a.change===pr){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===ao){if(x=a.newParam,a.modelChange==="linkDataArray"){a=a.newValue,ze(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===mo){if(x=a.oldParam,a.modelChange==="linkDataArray"){a=a.oldValue,ze(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}}bi.prototype.changeState.call(this,a,y)}},wt=Hr.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 cl(this,a,!0)},wt.wv=function(a,y){Uf(this,a,y,!0)},wt.Bx=function(a){return cl(this,a,!1)},wt.Bv=function(a,y){Uf(this,a,y,!1)};function cl(a,y,x){if(y!==null&&(a=x?a.lf:a.mf,a!==""&&(a=oa(y,a),a!==void 0))){if(vd(a))return a;Qt((x?"FromKey":"ToKey")+" value for link data "+y+" is not a number or a string: "+a)}}function Uf(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=oa(y,b);z!==x&&(mu(a,z,y),Vo(y,b,x),a.hc(x)===null&&pu(a,x,y),ya(a,E?"linkFromKey":"linkToKey",pr,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){Yf(this,a,y,!0)},wt.Cx=function(a){return c0(this,a,!1)},wt.Cv=function(a,y){Yf(this,a,y,!1)};function c0(a,y,x){return y===null||(a=x?a.ej:a.fj,a==="")?"":(y=oa(y,a),y===void 0?"":y)}function Yf(a,y,x,E){if(y!==null){var b=E?a.ej:a.fj;if(b!=="")if(a.Jc(y)){var z=oa(y,b);z===void 0&&(z=""),z!==x&&(Vo(y,b,x),ya(a,E?"linkFromPortId":"linkToPortId",pr,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=oa(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=oa(a,x);if(E===void 0&&(E=f0),E!==y){if(Array.isArray(E))for(var b=E.length,z=0;z<b;z++)mu(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&&pu(this,tt,a)}ya(this,"linkLabelKeys",pr,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=oa(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&&pu(this,y,a),ya(this,"linkLabelKeys",ao,x,a,null,y,null,b)))}else Qt(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=oa(a,x);if(Array.isArray(E)){var b=E.indexOf(y);0>b||(E.splice(b,1),this.Jc(a)&&(mu(this,y,a),ya(this,"linkLabelKeys",mo,x,a,y,null,b,null)))}else E!==void 0&&Qt(x+" property is not an Array; cannot removeLabelKeyforLinkData: "+a)}}},wt.Ac=function(a){if(a!==null){var y=this.Jh;if(y!==""&&(y=oa(a,y),y!==void 0)){if(vd(y))return y;Qt("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=oa(a,x);E!==y&&this.jh(y)===null&&(Vo(a,x,y),E!==void 0&&this.wb.remove(E),this.wb.add(y,a),ya(this,"linkKey",pr,x,a,E,y),typeof x=="string"&&this.La(a,x))}else Vo(a,x,y)}},wt.jh=function(a){return a===null&&Qt("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&&(Wr(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&&Qt("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)),ya(a,"linkDataArray",ao,"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(ya(a,"linkDataArray",mo,"linkDataArray",a,y,null,E,null),x=cl(a,y,!0),mu(a,x,y),x=cl(a,y,!1),mu(a,x,y),E=a.Ef(y),Array.isArray(E))for(var b=E.length,z=0;z<b;z++)x=E[z],mu(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===""&&Qt("GraphLinksModel.linkKeyProperty must not be an empty string for .mergeLinkDataArray() to succeed."),a!==this.linkDataArray&&hn(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=cl(a,y,!0);x=a.Vl(x),a.hc(x)===null&&pu(a,x,y),x=cl(a,y,!1),x=a.Vl(x),a.hc(x)===null&&pu(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&&pu(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),ze(a)&&(Gi(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:!!oa(a,y)},wt.lh=function(a){if(a!==null){var y=this.Je;if(y!==""&&(y=oa(a,y),y!==void 0)){if(vd(y))return y;Qt("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=oa(a,x);E!==y&&(mu(this,E,a),Vo(a,x,y),this.hc(y)===null&&pu(this,y,a),ya(this,"nodeGroupKey",pr,x,a,E,y),typeof x=="string"&&this.La(a,x))}else Vo(a,x,y)}},Hr.prototype.copyNodeData=function(a){return a===null?null:(a=bi.prototype.copyNodeData.call(this,a),this.Ij||this.Je===""||oa(a,this.Je)===void 0||Vo(a,this.Je,void 0),a)},Hr.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){Uf(this,a,x,!0);return}if(y===this.linkToKeyProperty){Uf(this,a,x,!1);return}if(y===this.linkFromPortIdProperty){Yf(this,a,x,!0);return}if(y===this.linkToPortIdProperty){Yf(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=oa(a,y);E!==x&&(Vo(a,y,x),this.Fs(a,y,E,x))},wt=Hr.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&&oa(a,b)===y[b]||E&&b===this.linkKeyProperty||this.setDataProperty(a,b,y[b])}},wt.jp=function(a,y){bi.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(cl(this,E,!0)===b){var tt=this.lf;Vo(E,tt,z),ya(this,"linkFromKey",pr,tt,E,b,z),typeof tt=="string"&&this.La(E,tt)}if(cl(this,E,!1)===b&&(tt=this.mf,Vo(E,tt,z),ya(this,"linkToKey",pr,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,ya(this,"linkLabelKeys",ao,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),ya(this,"nodeGroupKey",pr,E,a,y,x),typeof E=="string"&&this.La(a,E)}},wt.Lv=function(){bi.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){bi.prototype.fm.call(this,a),a=this.wa(a);var y=vp(this,a);if(y!==null){var x=Jn();for(y=y.iterator;y.next();){var E=y.value;if(this.lb(E)){if(this.lh(E)===a){var b=this.Je;ya(this,"nodeGroupKey",pr,b,E,a,a),typeof b=="string"&&this.La(E,b),x.push(E)}}else if(cl(this,E,!0)===a&&(b=this.lf,ya(this,"linkFromKey",pr,b,E,a,a),typeof b=="string"&&this.La(E,b),x.push(E)),cl(this,E,!1)===a&&(b=this.mf,ya(this,"linkToKey",pr,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&&(ya(this,"linkLabelKeys",ao,tt,E,a,a,rt,rt),x.push(E))}for(y=0;y<x.length;y++)mu(this,a,x[y]);ii(x)}},wt.em=function(a){bi.prototype.em.call(this,a);var y=this.lh(a);this.hc(y)===null&&pu(this,y,a)},wt.qp=function(a){bi.prototype.qp.call(this,a);var y=this.lh(a);mu(this,y,a)},wt.ps=function(a){if(a===null)return"";var y=this.dj;if(y===""||(y=oa(a,y),y===void 0))return"";if(typeof y=="string")return y;Qt("getCategoryForLinkData found a non-string category for "+a+": "+y)},Hr.prototype.getLinkCategoryForData=function(a){return this.ps(a)},Hr.prototype.lp=function(a,y){if(a!==null){var x=this.dj;if(x!=="")if(this.Jc(a)){var E=oa(a,x);E===void 0&&(E=""),E!==y&&(Vo(a,x,y),ya(this,"linkCategory",pr,x,a,E,y),typeof x=="string"&&this.La(a,x))}else Vo(a,x,y)}},Hr.prototype.setLinkCategoryForData=function(a,y){this.lp(a,y)},wt=Hr.prototype,wt.lm=function(a,y){bi.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},Ue.Object.defineProperties(Hr.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];ze(b)||Qt("GraphLinksModel.linkDataArray must only contain Objects, not: "+b),Wr(b)}if(this.md=a,this.linkKeyProperty!==""){for(E=new un,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 vn,b=0;b<x;b++)E.add(a[b]);for(this.$f=E,ya(this,"linkDataArray",pr,"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"}}}),Hr.prototype.setCategoryForLinkData=Hr.prototype.lp,Hr.prototype.getCategoryForLinkData=Hr.prototype.ps,Hr.prototype.assignAllDataProperties=Hr.prototype.Do,Hr.prototype.setGroupKeyForNodeData=Hr.prototype.mp,Hr.prototype.getGroupKeyForNodeData=Hr.prototype.lh,Hr.prototype.isGroupForNodeData=Hr.prototype.Yu,Hr.prototype.copyLinkData=Hr.prototype.Jo,Hr.prototype.mergeLinkDataArray=Hr.prototype.Zz,Hr.prototype.removeLinkDataCollection=Hr.prototype.lA,Hr.prototype.removeLinkData=Hr.prototype.bm,Hr.prototype.addLinkDataCollection=Hr.prototype.Ey,Hr.prototype.addLinkData=Hr.prototype.fi,Hr.prototype.containsLinkData=Hr.prototype.Jc,Hr.prototype.makeLinkDataKeyUnique=Hr.prototype.Bs,Hr.prototype.findLinkDataForKey=Hr.prototype.jh,Hr.prototype.setKeyForLinkData=Hr.prototype.Ks,Hr.prototype.getKeyForLinkData=Hr.prototype.Ac,Hr.prototype.removeLabelKeyForLinkData=Hr.prototype.Qx,Hr.prototype.addLabelKeyForLinkData=Hr.prototype.Bu,Hr.prototype.setLabelKeysForLinkData=Hr.prototype.Ls,Hr.prototype.getLabelKeysForLinkData=Hr.prototype.Ef,Hr.prototype.setToPortIdForLinkData=Hr.prototype.Cv,Hr.prototype.getToPortIdForLinkData=Hr.prototype.Cx,Hr.prototype.setFromPortIdForLinkData=Hr.prototype.xv,Hr.prototype.getFromPortIdForLinkData=Hr.prototype.zx,Hr.prototype.setToKeyForLinkData=Hr.prototype.Bv,Hr.prototype.getToKeyForLinkData=Hr.prototype.Bx,Hr.prototype.setFromKeyForLinkData=Hr.prototype.wv,Hr.prototype.getFromKeyForLinkData=Hr.prototype.yx,Hr.prototype.clear=Hr.prototype.clear;var f0=Object.freeze([]);Hr.className="GraphLinksModel",nu.GraphLinksModel=Hr,bi.constructGraphLinksModel=bi.constructGraphLinksModel=function(){return new Hr},bi.initDiagramModel=hy=function(){return new Hr};function Ls(a,y){bi.call(this),this.Ke="parent",this.Nm=!1,this.nj="parentLinkCategory",a!==void 0&&(hn(a)?this.nodeDataArray=a:y=a),y&&(Object.assign(this,y),a=y.Changed)&&(delete this.Changed,this.Pe(a))}Ee(Ls,bi),Ls.constructGraphLinksModel=bi.constructGraphLinksModel,Ls.prototype.cloneProtected=function(a){bi.prototype.cloneProtected.call(this,a),a.Ke=this.Ke,a.Nm=this.Nm,a.nj=this.nj},wt=Ls.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=bi.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){bi.prototype.gp.call(this,a),a.nodeParentKeyProperty&&(this.nodeParentKeyProperty=a.nodeParentKeyProperty)},wt.fp=function(a){a.nodeParentKeyProperty!==void 0&&a.nodeParentKeyProperty!==this.nodeParentKeyProperty&&Qt("applyIncrementalJson cannot change Model properties"),bi.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=oa(a,y),y!==void 0)){if(vd(y))return y;Qt("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=oa(a,x);E!==y&&(mu(this,E,a),Vo(a,x,y),this.hc(y)===null&&pu(this,y,a),ya(this,"nodeParentKey",pr,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=oa(a,y),y===void 0)?"":typeof y=="string"?y:(Qt("getParentLinkCategoryForNodeData found a non-string category for "+a+": "+y),"")},Ls.prototype.getLinkCategoryForData=function(a){return this.ss(a)},Ls.prototype.Ms=function(a,y){if(a!==null){var x=this.nj;if(x!=="")if(this.lb(a)){var E=oa(a,x);E===void 0&&(E=""),E!==y&&(Vo(a,x,y),ya(this,"parentLinkCategory",pr,x,a,E,y),typeof x=="string"&&this.La(a,x))}else Vo(a,x,y)}},Ls.prototype.setLinkCategoryForData=function(a,y){this.Ms(a,y)},Ls.prototype.copyNodeData=function(a){return a===null?null:(a=bi.prototype.copyNodeData.call(this,a),this.Jj||this.Ke===""||oa(a,this.Ke)===void 0||Vo(a,this.Ke,void 0),a)},Ls.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=oa(a,y);E!==x&&(Vo(a,y,x),this.Fs(a,y,E,x))},wt=Ls.prototype,wt.jp=function(a,y){bi.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),ya(this,"nodeParentKey",pr,E,a,y,x),typeof E=="string"&&this.La(a,E)}},wt.fm=function(a){bi.prototype.fm.call(this,a),a=this.wa(a);var y=vp(this,a);if(y!==null){var x=Jn();for(y=y.iterator;y.next();){var E=y.value;if(this.lb(E)&&this.mh(E)===a){var b=this.Ke;ya(this,"nodeParentKey",pr,b,E,a,a),typeof b=="string"&&this.La(E,b),x.push(E)}}for(y=0;y<x.length;y++)mu(this,a,x[y]);ii(x)}},wt.em=function(a){bi.prototype.em.call(this,a);var y=this.mh(a);y=this.Vl(y),this.hc(y)===null&&pu(this,y,a)},wt.qp=function(a){bi.prototype.qp.call(this,a);var y=this.mh(a);mu(this,y,a)},wt.lm=function(a,y){bi.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},Ue.Object.defineProperties(Ls.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"}}}),Ls.prototype.setParentLinkCategoryForNodeData=Ls.prototype.Ms,Ls.prototype.getParentLinkCategoryForNodeData=Ls.prototype.ss,Ls.prototype.setParentKeyForNodeData=Ls.prototype.qe,Ls.prototype.getParentKeyForNodeData=Ls.prototype.mh,Ls.className="TreeModel",nu.TreeModel=Ls;function Xo(a){Ko.call(this),this.lw=this.Zm=this.lc=0,this.Wp=360,this.kw=iu,this.Ti=0,this.Zv=new Tt,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=iu,this.K=Fs,this.nd=Jf,this.hd=ry,this.tf=6,this.Nn=x0,a&&Object.assign(this,a)}Ee(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===Jf?this.sorting=a:a===rc||a===Xf||a===Fs||a===Sd?this.direction=a:a===zh||a===yd||a===iu||a===ru?this.arrangement=a:(a===Hc||a===x0)&&(this.nodeDiameterFormula=a):Ko.prototype.qb.call(this,a)},Xo.prototype.createNetwork=function(){return new Qf(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 un;y.addAll(a.iterator),a=new un;var x=new un,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 gt=this.startAngle;isFinite(gt)||(gt=0);var yt=this.sweepAngle;if((!isFinite(yt)||360<yt||1>yt)&&(yt=360),y=this.spacing,isFinite(y)||(y=NaN),rt===ru&&ot===Hc?rt=iu:rt===ru&&ot!==Hc&&(rt=this.arrangement),(this.direction===rc||this.direction===Xf)&&this.sorting!==Jf){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===ru&&a.reverse(),E=new un,E.addAll(a),E.addAll(x)):(this.arrangement===ru&&x.reverse(),E=new un,E.addAll(x),E.addAll(a))}ot=E.length;for(var xt=z=b=0;xt<E.length;xt++){var Ct=gt+yt*z*(this.direction===Fs?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===ru){if(isNaN(y)&&(y=6),rt!==iu&&rt!==ru){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,gt*Math.PI/180,yt*Math.PI/180)}else lt=g0(this,b+(360<=yt?ot:ot-1)*(rt!==ru?y:1.6*y),ut,gt*Math.PI/180,yt*Math.PI/180);z=lt*ut}else if(z=lt*ut,xt=fy(this,lt,z,gt*Math.PI/180,yt*Math.PI/180),isNaN(y))(rt===iu||rt===ru)&&(y=(xt-b)/(360<=yt?ot:ot-1));else if(rt===iu||rt===ru)xt=(xt-b)/(360<=yt?ot:ot-1),xt<y?(lt=g0(this,b+y*(360<=yt?ot:ot-1),ut,gt*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,gt*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=gt,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,gt=this.Ti,yt=this.me,ot=this.Jp,this.direction!==rc&&this.direction!==Xf||E!==ru)if(this.direction===rc||this.direction===Xf){switch(tt=0,E){case yd:tt=180*p0(this,rt,yt,lt,ot)/Math.PI;break;case iu: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,gt+(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 iu:Pp(this,a,lt,Sd);break;case zh:xp(this,a,ut/2,lt,Sd)}switch(E){case yd:wp(this,x,lt+tt,Fs);break;case iu:Pp(this,x,lt+tt,Fs);break;case zh:xp(this,x,ut/2,lt+tt,Fs)}}else{switch(E){case yd:wp(this,x,lt,Sd);break;case iu:Pp(this,x,lt,Sd);break;case zh:xp(this,x,ut/2,lt,Sd)}switch(E){case yd:wp(this,a,lt+tt,Fs);break;case iu:Pp(this,a,lt+tt,Fs);break;case zh:xp(this,a,ut/2,lt+tt,Fs)}}}else switch(E){case yd:wp(this,y,lt,this.direction);break;case iu:Pp(this,y,lt,this.direction);break;case zh:xp(this,y,ut,lt,this.direction);break;case ru:AS(this,y,ut,lt,this.direction)}else AS(this,y,ut,lt-ut/2,Fs)}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===Fs?ot*x/(360<=z?rt:rt-1):-(ot*x)/rt),ut=y.M(ot),gt=tt*Math.tan(lt)/a;gt=Math.sqrt((tt*tt+a*a*gt*gt)/(1+gt*gt)),ut.centerX=gt*Math.cos(lt),ut.centerY=gt*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),gt=z*Math.sin(x);lt.centerX=b*Math.cos(x),lt.centerY=gt,lt.actualAngle=180*x/Math.PI,isNaN(lt.diameter)&&xd(lt,0),isNaN(ut.diameter)&&xd(ut,0),lt=p0(a,b,z,E===Fs?x:-x,(lt.diameter+ut.diameter)/2+tt),x+=E===Fs?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===Fs?x:-x,tt),x+=E===Fs?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===Fs?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=Tt.alloc();for(var gt=0;gt<ut.length&&(ut[gt].centerX=ot,ut[gt].centerY=lt,!(gt>=ut.length-1));gt++)OS(a,ot,lt,ut,gt,b,z)||IS(a,ot,lt,ut,gt,b,z),ot=z.x,lt=z.y;if(Tt.free(z),a.mj++,!(23<a.mj)){ot=ut[0].centerX,lt=ut[0].centerY,z=ut[ut.length-1].centerX,gt=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-gt)-((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(gt)?0<z!=lt>gt:0<gt!=ot<z,(ot=b===Fs?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=Tt.alloc(),gt=y.Fa(),yt=0;yt<gt.length&&(gt[yt].centerX=ot,gt[yt].centerY=lt,!(yt>=gt.length-1));yt++)OS(a,ot,lt,gt,yt,b,ut)||IS(a,ot,lt,gt,yt,b,ut),ot=ut.x,lt=ut.y;if(Tt.free(ut),a.mj++,!(23<a.mj)){if(ot=Math.atan2(lt,ot),ot=b===Fs?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<gt.length;ot++)tt.mk[ot]=gt[ot].bounds.x,tt.tm[ot]=gt[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===Fs)){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===Fs)){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 Tt(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 Jf:return this.ak(Tx(a));default:Qt("Invalid sorting type.")}return a};function Tx(a){for(var y=[],x=0;x<a.length;x++)y.push(0);x=new un;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 un;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 gt=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],Wt=y[lt],Zt=0,$t=0;$t<tt.length;$t++){var ne=z[tt[$t]],re=z[rt[$t]];if(ne<re){var de=ne;ne=re}else de=re;if(de<bt&&bt<=ne)for(re=0;re<Wt.length;re++){var Fe=Wt[re];0>x.indexOf(Fe)||de<z[Fe]&&z[Fe]<ne||de===z[Fe]||ne===z[Fe]||Zt++}else for(re=0;re<Wt.length;re++)Fe=Wt[re],0>x.indexOf(Fe)||de<z[Fe]&&z[Fe]<ne&&de!==z[Fe]&&ne!==z[Fe]&&Zt++}for(Wt=Zt,$t=Zt=0;$t<y[lt].length;$t++)de=x.indexOf(y[lt][$t]),0<=de&&(de=Math.abs(bt-(de>=bt?de+1:de)),Zt+=de<x.length+1-de?de:x.length+1-de);for($t=0;$t<tt.length;$t++)de=z[tt[$t]],ne=z[rt[$t]],de>=bt&&de++,ne>=bt&&ne++,de>ne&&(re=ne,ne=de,de=re),ne-de<(x.length+2)/2==(de<bt&&bt<=ne)&&Zt++;(Wt<ut||Wt===ut&&Zt<gt)&&(ut=Wt,gt=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++)gt=y[lt][ut],0<=x.indexOf(gt)&&(tt.push(lt),rt.push(gt))}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=gt=0;yt<y[lt].length;yt++)xt=x.indexOf(y[lt][yt]),0>xt||xt===ut||(Ct=xt>ut?xt-ut:ut-xt,gt+=xt<ut!=Ct>tt-Ct?1:-1);x.splice(0>gt?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},Ue.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!==ru&&a!==iu&&a!==yd&&a!==zh||(this.Rb=a,this.C())}},direction:{get:function(){return this.K},set:function(a){this.K===a||a!==Fs&&a!==Sd&&a!==rc&&a!==Xf||(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!==Jf||(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 iu=new Ae(Xo,"ConstantSpacing",0),yd=new Ae(Xo,"ConstantDistance",1),zh=new Ae(Xo,"ConstantAngle",2),ru=new Ae(Xo,"Packed",3),Fs=new Ae(Xo,"Clockwise",4),Sd=new Ae(Xo,"Counterclockwise",5),rc=new Ae(Xo,"BidirectionalLeft",6),Xf=new Ae(Xo,"BidirectionalRight",7),m0=new Ae(Xo,"Forwards",8),v0=new Ae(Xo,"Reverse",9),y0=new Ae(Xo,"Ascending",10),S0=new Ae(Xo,"Descending",11),Jf=new Ae(Xo,"Optimized",12),x0=new Ae(Xo,"Pythagorean",13),Hc=new Ae(Xo,"Circular",14);Xo.className="CircularLayout",Xo.ConstantSpacing=iu,Xo.ConstantDistance=yd,Xo.ConstantAngle=zh,Xo.Packed=ru,Xo.Clockwise=Fs,Xo.Counterclockwise=Sd,Xo.BidirectionalLeft=rc,Xo.BidirectionalRight=Xf,Xo.Forwards=m0,Xo.Reverse=v0,Xo.Ascending=y0,Xo.Descending=S0,Xo.Optimized=Jf,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 Qf(a){Do.call(this,a)}Ee(Qf,Do),Qf.prototype.createVertex=function(){return new Ep(this)},Qf.prototype.createEdge=function(){return new P0(this)},Qf.className="CircularNetwork";function Ep(a){Ca.call(this,a),this.u=this.Si=NaN}Ee(Ep,Ca);function xd(a,y){var x=a.network;if(x===null)return NaN;if(x=x.layout,x===null)return NaN;if(x.arrangement===ru)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}Ue.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){qs.call(this,a)}Ee(P0,qs),P0.className="CircularEdge";function es(a){Ko.call(this),this.ah=null,this.An=0,this.$d=new en(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)}Ee(es,Ko),es.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},es.prototype.createNetwork=function(){return new Wc(this)},es.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=Jn(),ut=0;ut<rt+y.vertexes.count+2;ut++)lt[ut]=null;rt=0,tt.reset();for(var gt=Oe.alloc();tt.next();)if(ut=tt.value,this.computeBounds(ut,gt),ot)ot=!1,b=gt.x+gt.width/2,z=gt.y+gt.height/2,lt[0]=new Tt(gt.x+gt.width+E.width,gt.y),lt[1]=new Tt(gt.x,gt.y+gt.height+E.height),rt=2;else{var yt=RS(lt,rt,b,z,gt.width,gt.height,E),xt=lt[yt],Ct=new Tt(xt.x+gt.width+E.width,xt.y),bt=new Tt(xt.x,xt.y+gt.height+E.height);for(yt+1<rt&<.splice(yt+1,0,null),lt[yt]=Ct,lt[yt+1]=bt,rt++,yt=xt.x-gt.x,xt=xt.y-gt.y,ut=ut.vertexes.iterator;ut.next();)Ct=ut.value,Ct.centerX+=yt,Ct.centerY+=xt}for(Oe.free(gt),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 Tt(yt.x+yt.width+E.width,yt.y),lt[1]=new Tt(yt.x,yt.y+yt.height+E.height),rt=2):(ot=RS(lt,rt,b,z,yt.width,yt.height,E),gt=lt[ot],xt=new Tt(gt.x+yt.width+E.width,gt.y),yt=new Tt(gt.x,gt.y+yt.height+E.height),ot+1<rt&<.splice(ot+1,0,null),lt[ot]=xt,lt[ot+1]=yt,rt++,tt.centerX=gt.x+tt.width/2,tt.centerY=gt.y+tt.height/2);for(ii(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},es.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},es.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 un),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 un,b.Hj=rt),rt.add(tt),b.Vd--,b.sh+=tt.sh):tt.network===E&&(rt=tt.Hj,rt===null&&(rt=new un,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 gt=ot.M(ut),yt=null;for(z=gt.edges.iterator;z.next();){var xt=z.value;if(xt.Ax(gt)===b){yt=xt;break}}yt!==null&&(lt+=yt.length,rt+=gt.width*gt.height)}z=b.centerX,ot=b.centerY,ut=b.width,gt=b.height,yt=b.focus,xt=ut*gt,1>xt&&(xt=1),rt=_t.sqrt((rt+xt+lt*lt*4/(tt*tt))/xt),tt=(rt-1)*ut/2,rt=(rt-1)*gt/2,b.bounds=new Oe(z-yt.x-tt,ot-yt.y-rt,ut+2*tt,gt+2*rt),b.focus=new Tt(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 Oe(E.centerX-z,E.centerY-tt,b.Ss,b.Qs),E.focus=new Tt(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 gt=ut.value;1>=gt.Vd?ot++:(rt=!0,lt++,tt+=Math.atan2(y.centerY-gt.centerY,y.centerX-gt.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,gt=ot.edges.iterator;gt.next();){ut=gt.value;break}gt=ot.width;var yt=ot.height;gt=_t.sqrt(gt*gt+yt*yt)/2,ut=z+ut.length+gt,gt=tt+(y*(rt/2>>1)+lt)*(rt%2===0?1:-1),ot.centerX=E+ut*Math.cos(gt),ot.centerY=b+ut*Math.sin(gt),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],gt=ut.x-x,yt=ut.y-E;if(gt=gt*gt+yt*yt,gt<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=gt}}return ot}es.prototype.Cu=function(){if(this.comments)for(var a=this.network.vertexes.iterator;a.next();)this.addComments(a.value)},es.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,Wt){return bt===null||Wt===null||bt===Wt?0:bt.centerX-Wt.centerX}):y.sort(function(bt,Wt){return bt===null||Wt===null||bt===Wt?0:bt.centerY-Wt.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 gt=z+1;gt<y.length;gt++){var yt=y[gt];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,gt=z.focus,ot=ut.x+gt.x,ut=ut.y+gt.y,gt=jS(x,z),1>gt?(gt=a.randomNumberGenerator,gt===null&&(a.randomNumberGenerator=gt=new w0),rt=gt.random(),gt=gt.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))*gt):(rt=rt.stiffness*(gt-rt.length),E=(ot-E)/gt*rt,lt=(ut-tt)/gt*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}es.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},es.prototype.moveFixedVertex=function(){},es.prototype.commitLayout=function(){this.yv(),this.commitNodes(),this.isRouting&&this.commitLinks()},es.prototype.yv=function(){if(this.setsPortSpots)for(var a=this.network.edges.iterator;a.next();){var y=a.value.link;y!==null&&(y.fromSpot=xa,y.toSpot=xa)}},es.prototype.commitNodes=function(){var a=0,y=0;if(this.arrangesToOrigin){var x=Oe.alloc();this.computeBounds(this.network,x),y=this.arrangementOrigin,a=y.x-x.x,y=y.y-x.y,Oe.free(x)}x=Oe.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()}Oe.free(x)},es.prototype.commitLinks=function(){for(var a=this.network.edges.iterator;a.next();)a.value.commit()},es.prototype.springStiffness=function(a){return a=a.stiffness,isNaN(a)?this.Hk:a},es.prototype.springLength=function(a){return a=a.length,isNaN(a)?this.Gk:a},es.prototype.electricalCharge=function(a){return a=a.charge,isNaN(a)?this.Ek:a},es.prototype.electricalFieldX=function(){return 0},es.prototype.electricalFieldY=function(){return 0},es.prototype.gravitationalMass=function(a){return a=a.mass,isNaN(a)?this.Fk:a},es.prototype.gravitationalFieldX=function(){return 0},es.prototype.gravitationalFieldY=function(){return 0},es.prototype.isFixed=function(a){return a.isFixed},Ue.Object.defineProperties(es.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"&&Qt('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())}}}),es.className="ForceDirectedLayout";function ZS(){this.Tv=this.Sv=this.Qs=this.Ss=this.Rs=0}ZS.className="ForceDirectedSubnet";function Wc(a){Do.call(this,a)}Ee(Wc,Do),Wc.prototype.createVertex=function(){return new Lp(this)},Wc.prototype.createEdge=function(){return new Fp(this)},Wc.className="ForceDirectedNetwork";function Lp(a){Ca.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}Ee(Lp,Ca),Ue.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){qs.call(this,a),this.j=this.o=NaN}Ee(Fp,qs),Ue.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 xo(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 Tt,this.He=[],this.He.length=100,this.xw=this.ve=0,a&&Object.assign(this,a)}Ee(xo,Ko),xo.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},xo.prototype.qb=function(a){a.classType===xo?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:Qt("Unknown enum value: "+a):Ko.prototype.qb.call(this,a)},xo.prototype.createNetwork=function(){return new qf(this)},xo.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 gt=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=gt;var xt=yt;gt=ot,yt=rt,ot=lt,rt=xt}var Ct=b.focus;lt=z.focus;var bt=E.rev?z.bounds:b.bounds;xt=Tt.alloc(),ut!==gt?bt.w()&>.isVisible()?gt.actualBounds.w()?(Oh(gt,yt,cr,xt),xt.x+=gt.actualBounds.x-bt.x,xt.y+=gt.actualBounds.y-bt.y):(Oh(gt,yt,cr,xt),xt.w()||xt.assign(Ct)):xt.assign(Ct):bt.w()?(Oh(gt,yt,cr,xt),xt.w()||xt.assign(Ct)):xt.assign(Ct),gt=E.rev?b.bounds:z.bounds,ut=Tt.alloc(),tt!==ot?gt.w()&&ot.isVisible()?ot.actualBounds.w()?(Oh(ot,rt,cr,ut),ut.x+=ot.actualBounds.x-gt.x,ut.y+=ot.actualBounds.y-gt.y):(Oh(ot,rt,cr,ut),ut.w()||ut.assign(lt)):ut.assign(lt):gt.w()?(Oh(ot,rt,cr,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),Tt.free(xt),Tt.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,gt=0,bt=E.link,bt!==null){var Wt=bt.fromPort,Zt=bt.toPort;if(Wt!==null&&Zt!==null){var $t=bt.fromNode;if(yt=bt.toNode,$t!==null&&yt!==null){var ne=F0(this,!0),re=F0(this,!1),de=this.setsPortSpots?ne:bt.computeSpot(!0,Wt);Ct=this.setsPortSpots?re:bt.computeSpot(!1,Zt);var Fe=bt.isOrthogonal;de.$c()&&de.Hf(re)&&Ct.$c()&&Ct.Hf(ne)?gt=0:(ne=bt.getLinkPoint($t,Wt,de,!0,Fe,yt,Zt,Tt.alloc()),re=bt.getLinkDirection($t,Wt,ne,de,!0,Fe,yt,Zt),Tt.free(ne),de.ys()||re!==JS(this,E,!0)?this.setsPortSpots&&$t!==null&&$t.ports.count===1&&E.rev&&(gt+=1):gt+=1,de=bt.getLinkPoint(yt,Zt,Ct,!1,Fe,$t,Wt,Tt.alloc()),bt=bt.getLinkDirection(yt,Zt,de,Ct,!1,Fe,$t,Wt),Tt.free(de),Ct.ys()||bt!==JS(this,E,!1)?this.setsPortSpots&&yt!==null&&yt.ports.count===1&&E.rev&&(gt+=2):gt+=2)}}}if(yt=gt,gt=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,gt&&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=!gt,gt&&(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},xo.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}xo.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},xo.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 _s(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 Ml(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 gt=E[ut];gt.near===lt&>.Dj===lt.Dj||rt++}else for(ut=tt-1;ut>ot;ut--)gt=E[ut],gt.near===lt&>.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(gt=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,Wt=Ct.portToPos;Ct=Ct.portFromPos,ut<Wt&&(gt>bt||gt===bt&&xt>Ct)&&rt++,Wt<ut&&(bt>gt||bt===gt&&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(gt=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,Wt=Ct.portToPos,Ct=Ct.portFromPos,xt<Ct&&(gt>bt||gt===bt&&ut>Wt)&&rt++,Ct<xt&&(bt>gt||bt===gt&&Wt>ut)&&rt++)}for(z[tt*b+tt]=rt,ot=tt+1;ot<b;ot++){var Zt=0,$t=0;if(0<=x){rt=E[tt].sourceEdgesArrayAccess;var ne=E[ot].sourceEdgesArrayAccess;for(lt=0;lt<rt.length;lt++)if(xt=rt[lt],xt.valid&&xt.fromVertex.layer!==y)for(gt=xt.fromVertex.index,xt=xt.portFromPos,yt=0;yt<ne.length;yt++)Ct=ne[yt],Ct.valid&&Ct.fromVertex.layer!==y&&(bt=Ct.fromVertex.index,Ct=Ct.portFromPos,(gt<bt||gt===bt&&xt<Ct)&&$t++,(bt<gt||bt===gt&&Ct<xt)&&Zt++)}if(0>=x){for(rt=E[tt].destinationEdgesArrayAccess,ne=E[ot].destinationEdgesArrayAccess,lt=0;lt<rt.length;lt++)if(xt=rt[lt],xt.valid&&xt.toVertex.layer!==y)for(gt=xt.toVertex.index,ut=xt.portToPos,yt=0;yt<ne.length;yt++)Ct=ne[yt],Ct.valid&&Ct.toVertex.layer!==y&&(bt=Ct.toVertex.index,Wt=Ct.portToPos,(gt<bt||gt===bt&&ut<Wt)&&$t++,(bt<gt||bt===gt&&Wt<ut)&&Zt++)}z[tt*b+ot]=Zt,z[ot*b+tt]=$t}}return wd(a,y,E),z}xo.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 gt=lt[ut];if(gt.valid&>.toVertex.layer!==b){var yt=gt.fromVertex.column+gt.portFromColOffset,xt=gt.toVertex.column+gt.portToColOffset;rt+=(Math.abs(yt-xt)+1)*gy(gt)}}}wd(E,b,z),y+=rt}return y}xo.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,gt=0,yt=rt.near;if(yt!==null&&yt.layer===rt.layer&&(ut+=yt.column-1,gt++),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,gt++)}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,gt++);z[tt]=gt===0?-1:ut/gt}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,gt=[],yt=rt.near;if(yt!==null&&yt.layer===rt.layer&&(gt[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&&(gt[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&&(gt[ut]=yt.column+rt.portToColOffset,ut++);ut===0?z[tt]=-1:(gt.sort(function(Ct,bt){return Ct-bt}),lt=ut>>1,z[tt]=ut&1?gt[lt]:gt[lt-1]+gt[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)}}xo.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++}xo.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,gt=!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:gt=!0;(ot===null||ut<rt)&&!gt&&(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,gt=yt.length,xt=0;xt<gt;xt++)Ct=yt[xt].fromVertex,lt+=1,Ct.component!==1?E+=1:ut=!0;for(yt=tt.destinationEdgesArrayAccess,gt=yt.length,xt=0;xt<gt;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}xo.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))}xo.prototype.reduceCrossings=function(){var a=this.countCrossings(),y=_s(this),x,E;for(x=0;x<this.bj;x++){for(E=0;E<=this.Ia;E++)E0(this,E,1),zl(this,E,1);var b=this.countCrossings();for(b<a&&(a=b,y=_s(this)),E=this.Ia;0<=E;E--)E0(this,E,-1),zl(this,E,-1);b=this.countCrossings(),b<a&&(a=b,y=_s(this))}for(Ml(this,y),x=0;x<this.bj;x++){for(E=0;E<=this.Ia;E++)E0(this,E,0),zl(this,E,0);for(b=this.countCrossings(),b<a&&(a=b,y=_s(this)),E=this.Ia;0<=E;E--)E0(this,E,0),zl(this,E,0);b=this.countCrossings(),b<a&&(a=b,y=_s(this))}Ml(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=zl(this,E,-1)||z;for(b=this.countCrossings(),b>=a?Ml(this,y):(a=b,y=_s(this)),z=!0;z;)for(z=!1,E=x;E>=tt;E--)z=zl(this,E,1)||z;for(b=this.countCrossings(),b>=a?Ml(this,y):(a=b,y=_s(this)),z=!0;z;)for(z=!1,E=tt;E<=x;E++)z=zl(this,E,1)||z;for(b>=a?Ml(this,y):(a=b,y=_s(this)),z=!0;z;)for(z=!1,E=tt;E<=x;E++)z=zl(this,E,-1)||z;for(b>=a?Ml(this,y):(a=b,y=_s(this)),z=!0;z;)for(z=!1,E=x;E>=tt;E--)z=zl(this,E,0)||z;for(b>=a?Ml(this,y):(a=b,y=_s(this)),z=!0;z;)for(z=!1,E=tt;E<=x;E++)z=zl(this,E,0)||z;b>=a?Ml(this,y):(a=b,y=_s(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=zl(this,E,-1)||z;for(b=this.countCrossings(),b>=a?Ml(this,y):(a=b,y=_s(this)),z=!0;z;)for(z=!1,E=x;E>=tt;E--)z=zl(this,E,1)||z;for(b=this.countCrossings(),b>=a?Ml(this,y):(a=b,y=_s(this)),z=!0;z;)for(z=!1,E=tt;E<=x;E++)z=zl(this,E,1)||z;for(b>=a?Ml(this,y):(a=b,y=_s(this)),z=!0;z;)for(z=!1,E=tt;E<=x;E++)z=zl(this,E,-1)||z;for(b>=a?Ml(this,y):(a=b,y=_s(this)),z=!0;z;)for(z=!1,E=x;E>=tt;E--)z=zl(this,E,0)||z;for(b>=a?Ml(this,y):(a=b,y=_s(this)),z=!0;z;)for(z=!1,E=tt;E<=x;E++)z=zl(this,E,0)||z;b>=a?Ml(this,y):(a=b,y=_s(this))}}Ml(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 zl(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],gt=x[E[z+1].index*b+E[z].index],yt=0,xt=0,Ct=E[z].column,bt=E[z+1].column,Wt=a.nodeMinColumnSpace(E[z],!0),Zt=a.nodeMinColumnSpace(E[z],!1),$t=a.nodeMinColumnSpace(E[z+1],!0),ne=a.nodeMinColumnSpace(E[z+1],!1);Wt=Ct-Wt+$t,Zt=bt-Zt+ne;var re=E[z].sourceEdges.iterator;for(re.reset();re.next();)if($t=re.value,ne=$t.fromVertex,$t.valid&&ne.layer===y){for($t=0;E[$t]!==ne;)$t++;$t<z&&(yt+=2*(z-$t),xt+=2*(z+1-$t)),$t===z+1&&(yt+=1),$t>z+1&&(yt+=4*($t-z),xt+=4*($t-(z+1)))}for(re=E[z].destinationEdges.iterator,re.reset();re.next();)if($t=re.value,ne=$t.toVertex,$t.valid&&ne.layer===y){for($t=0;E[$t]!==ne;)$t++;$t===z+1&&(xt+=1)}for(re=E[z+1].sourceEdges.iterator,re.reset();re.next();)if($t=re.value,ne=$t.fromVertex,$t.valid&&ne.layer===y){for($t=0;E[$t]!==ne;)$t++;$t<z&&(yt+=2*(z+1-$t),xt+=2*(z-$t)),$t===z&&(xt+=1),$t>z+1&&(yt+=4*($t-(z+1)),xt+=4*($t-z))}for(re=E[z+1].destinationEdges.iterator,re.reset();re.next();)if($t=re.value,ne=$t.toVertex,$t.valid&&ne.layer===y){for($t=0;E[$t]!==ne;)$t++;$t===z&&(yt+=1)}$t=ne=0,re=tt[E[z].index];var de=rt[E[z].index],Fe=tt[E[z+1].index],Wn=rt[E[z+1].index];re!==-1&&(ne+=Math.abs(re-Ct),$t+=Math.abs(re-Zt)),de!==-1&&(ne+=Math.abs(de-Ct),$t+=Math.abs(de-Zt)),Fe!==-1&&(ne+=Math.abs(Fe-bt),$t+=Math.abs(Fe-Wt)),Wn!==-1&&(ne+=Math.abs(Wn-bt),$t+=Math.abs(Wn-Wt)),(xt<yt-.5||xt===yt&><ut-.5||xt===yt&>===ut&&$t<ne-.5)&&(lt=ot=!0,E[z].column=Zt,E[z+1].column=Wt,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}xo.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=$f(this,y,1)||x;for(y=this.Md-1;0<=y;y--)x=$f(this,y,-1)||x;x=$f(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=$f(this,this.Md,0)||x,y=this.Md+1;y<=this.Ia;y++)x=$f(this,y,0)||x;for(y=this.Md-1;0<=y;y--)x=$f(this,y,0)||x}}else Hx(this)};function $f(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,gt=a.nodeMinColumnSpace(b[E],!0),yt=a.nodeMinColumnSpace(b[E],!1),xt=0;0>E-1||ut-b[E-1].column-1>gt+a.nodeMinColumnSpace(b[E-1],!1)?xt=ut-1:xt=ut,gt=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 Wt=b[E].sourceEdges.iterator;Wt.next();){var Zt=Wt.value,$t=Zt.fromVertex;if(Zt.valid&&$t.layer!==y){var ne=gy(Zt),re=Zt.portFromColOffset;Zt=Zt.portToColOffset,$t=$t.column,yt+=(Math.abs(ut+Zt-($t+re))+1)*ne,Ct+=(Math.abs(xt+Zt-($t+re))+1)*ne,bt+=(Math.abs(gt+Zt-($t+re))+1)*ne}}if(0<=x)for(Wt=b[E].destinationEdges.iterator;Wt.next();)Zt=Wt.value,$t=Zt.toVertex,Zt.valid&&$t.layer!==y&&(ne=gy(Zt),re=Zt.portFromColOffset,Zt=Zt.portToColOffset,$t=$t.column,yt+=(Math.abs(ut+re-($t+Zt))+1)*ne,Ct+=(Math.abs(xt+re-($t+Zt))+1)*ne,bt+=(Math.abs(gt+re-($t+Zt))+1)*ne);Zt=re=ne=0,Wt=tt[b[E].index],$t=rt[b[E].index],Wt!==-1&&(ne+=Math.abs(Wt-ut),re+=Math.abs(Wt-xt),Zt+=Math.abs(Wt-gt)),$t!==-1&&(ne+=Math.abs($t-ut),re+=Math.abs($t-xt),Zt+=Math.abs($t-gt)),Ct<yt||Ct===yt&&re<ne?(lt=ot=!0,b[E].column=xt):(bt<yt||bt===yt&&Zt<ne)&&(lt=ot=!0,b[E].column=gt)}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 gt=E[x+1].column;gt-rt===lt+a.nodeMinColumnSpace(E[x+1],!0)?ut=rt-1:ut=rt}else x===b-1?(gt=E[x-1].column,ut=rt-gt===ot+a.nodeMinColumnSpace(E[x-1],!1)?rt+1:rt):(gt=E[x-1].column,ot=gt+a.nodeMinColumnSpace(E[x-1],!1)+ot+1,gt=E[x+1].column,lt=gt-a.nodeMinColumnSpace(E[x+1],!0)-lt-1,ut=(ot+lt)/2|0);else x===0&&x===b-1?ut=tt[x]:x===0?(gt=E[x+1].column,lt=gt-a.nodeMinColumnSpace(E[x+1],!0)-lt-1,ut=Math.min(tt[x],lt)):x===b-1?(gt=E[x-1].column,ot=gt+a.nodeMinColumnSpace(E[x-1],!1)+ot+1,ut=Math.max(tt[x],ot)):(gt=E[x-1].column,ot=gt+a.nodeMinColumnSpace(E[x-1],!1)+ot+1,gt=E[x+1].column,lt=gt-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=_s(a),z=C0(a);for(E=z+1;z<E;){E=z,tx(a,x,1);var tt=C0(a);tt>z?Ml(a,b):tt<z&&(z=tt,b=_s(a))}}if(0>y)for(x=a.Ra;0<=x;x--)for(b=_s(a),z=C0(a),E=z+1;z<E;)E=z,tx(a,x,-1),tt=C0(a),tt>z?Ml(a,b):tt<z&&(z=tt,b=_s(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=Jn(),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 vn,Wx(y,x);var z=null,tt=null,rt=null,ot=null,lt=(a.ve&1)!==0,ut=(a.ve&2)!==0,gt=(a.ve&4)!==0,yt=(a.ve&8)!==0;for(lt&&(a.verticalAlignment(y,x,!0),z=L0(a,y,!0,!1)),y.reverse(),gt&&(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)),ii(y),a.u(z,tt,rt,ot),a.network.vertexes.each(function(xt){var Ct=Jn();lt&&Ct.push(z.get(xt)),ut&&Ct.push(tt.get(xt)),gt&&Ct.push(rt.get(xt)),yt&&Ct.push(ot.get(xt)),Ct.sort(function(Wt,Zt){return Wt-Zt});var bt=Ct.length;bt=(Ct[Math.floor((bt-1)/2)]+Ct[Math.ceil((bt-1)/2)])/2,ii(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 gt=ut;if(ot===rt.length-1||gt){for(ut=tt.length-1,gt&&(ut=Fy(lt)[0].index);z<=ot;){if(lt=rt[z],!lt.bo){gt=[];for(var yt=Hn(lt.sourceEdgesArrayAccess),xt=yt.next();!xt.done;xt=yt.next())xt=xt.value,xt.valid&>.push(xt);lt.bo=gt}for(lt=Hn(lt.bo),gt=lt.next();!gt.done;gt=lt.next())gt=gt.value,yt=gt.fromVertex.index,(yt<b||yt>ut)&&y.add(gt);z++}b=ut}}}xo.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(gt,yt){return gt.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 gt=ut.align,yt=tt?ut.width:ut.height,xt=tt?gt.width:gt.height;if(x){var Ct=B0(ut,gt),bt=Ct.portFromPos,Wt=Ct.portToPos;Ct.link!==null&&(ut.node&&ut.node!==Ct.link.fromNode&&(bt=tt?ut.focusX:ut.focusY),gt.node&>.node!==Ct.link.toNode&&(Wt=tt?gt.focusX:gt.focusY))}else Ct=B0(gt,ut),bt=Ct.portToPos,Wt=Ct.portFromPos,Ct.link!==null&&(ut.node&&ut.node!==Ct.link.toNode&&(bt=tt?ut.focusX:ut.focusY),gt.node&>.node!==Ct.link.fromNode&&(Wt=tt?gt.focusX:gt.focusY));yt=E?ut.qg+(yt-bt)-(xt-Wt):ut.qg+bt-Wt,gt.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&&Qt("Could not determine previous vertex in layer"),y[x][a-1]}xo.prototype.u=function(a){for(var y=[],x=0;x<arguments.length;++x)y[x]=arguments[x];x=-1;for(var E=Jn(),b=Jn(),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)));ii(E),ii(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}xo.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?Xa:Ga:a.K===90?y?Ga:Xa:a.K===180?y?Ja:Aa:y?Aa:Ja}xo.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 Tt(x&&E?0:z,x&&!E?0:y),a.reset();a.next();)x=a.value,x.x+=z,x.y+=y,x.commit()},xo.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 Oe(0,0,x,Math.abs(this.Ta[0]))):y.push(new Oe(0,this.Ta[E-1],x,Math.abs(this.Ta[E-1]-this.Ta[E]))):this.K===90?E===0?y.push(new Oe(0,this.Ta[0],x,Math.abs(this.Ta[0]-a))):y.push(new Oe(0,this.Ta[E],x,Math.abs(this.Ta[E-1]-this.Ta[E]))):this.K===180?E===0?y.push(new Oe(0,0,Math.abs(this.Ta[0]),x)):y.push(new Oe(this.Ta[E-1],0,Math.abs(this.Ta[E-1]-this.Ta[E]),x)):E===0?y.push(new Oe(this.Ta[0],0,Math.abs(this.Ta[0]-a),x)):y.push(new Oe(this.Ta[E],0,Math.abs(this.Ta[E-1]-this.Ta[E]),x));this.commitLayers(y,this.Rf)},xo.prototype.commitLayers=function(){},xo.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,gt=x.toVertex;if(x.valid)y.curve===dl&&y.pointsCount===4&&(ut.column===gt.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(cr),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(cr),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===gt.layer)y.zf();else{var yt=!1,xt=!1,Ct=this.ie,bt=y.firstPickIndex+1;if(y.isOrthogonal){xt=!0;var Wt=y.pointsCount;4<Wt&&y.points.removeRange(2,Wt-3)}else if(y.curve===dl)yt=!0,Wt=y.pointsCount,4<Wt&&y.points.removeRange(2,Wt-3),Wt===4&&(bt=2);else{Wt=y.pointsCount;var Zt=lt===ar,$t=ot===ar;2<Wt&&Zt&&$t?y.points.removeRange(1,Wt-2):3<Wt&&Zt&&!$t?y.points.removeRange(1,Wt-3):3<Wt&&!Zt&&$t?y.points.removeRange(2,Wt-2):4<Wt&&!Zt&&!$t&&y.points.removeRange(2,Wt-3)}if(x.rev){for(;gt!==null&&ut!==gt;){var ne=Wt=null;for(Zt=gt.sourceEdges.iterator;Zt.next()&&($t=Zt.value,$t.link!==x.link||(Wt=$t.fromVertex,ne=$t.toVertex,Wt.node!==null)););if(Wt===null)break;if(Wt!==ut){Zt=y.i(bt-1).x,$t=y.i(bt-1).y;var re=Wt.centerX,de=Wt.centerY;if(xt)this.K===180||this.K===0?bt===y.firstPickIndex+1?(y.m(bt++,Zt,$t),y.m(bt++,Zt,de)):(ne!==null?ne.centerY:$t)!==de&&(ne=this.Ta[Wt.layer-1]+this.Rf.x,y.m(bt++,ne,$t),y.m(bt++,ne,de)):bt===y.firstPickIndex+1?(y.m(bt++,Zt,$t),y.m(bt++,re,$t)):(ne!==null?ne.centerX:Zt)!==re&&(ne=this.Ta[Wt.layer-1]+this.Rf.y,y.m(bt++,Zt,ne),y.m(bt++,re,ne));else if(bt===y.firstPickIndex+1){ne=Math.max(10,this.he[gt.layer]);var Fe=Math.max(10,this.Ld[gt.layer]);if(yt)this.K===180?re<=gt.bounds.x?(gt=gt.bounds.x,y.m(bt++,gt-ne,de),y.m(bt++,gt,de),y.m(bt++,gt+Fe,de)):(y.m(bt++,re-ne,de),y.m(bt++,re,de),y.m(bt++,re+Fe,de)):this.K===90?de>=gt.bounds.bottom?(gt=gt.bounds.y+gt.bounds.height,y.m(bt++,re,gt+Fe),y.m(bt++,re,gt),y.m(bt++,re,gt-ne)):(y.m(bt++,re,de+Fe),y.m(bt++,re,de),y.m(bt++,re,de-ne)):this.K===270?de<=gt.bounds.y?(gt=gt.bounds.y,y.m(bt++,re,gt-ne),y.m(bt++,re,gt),y.m(bt++,re,gt+Fe)):(y.m(bt++,re,de-ne),y.m(bt++,re,de),y.m(bt++,re,de+Fe)):this.K===0&&(re>=gt.bounds.right?(gt=gt.bounds.x+gt.bounds.width,y.m(bt++,gt+Fe,de),y.m(bt++,gt,de),y.m(bt++,gt-ne,de)):(y.m(bt++,re+Fe,de),y.m(bt++,re,de),y.m(bt++,re-ne,de)));else{y.m(bt++,Zt,$t);var Wn=0;this.K===180||this.K===0?((this.K===180?re>=gt.bounds.right:re<=gt.bounds.x)&&(Wn=(this.K===0?-ne:Fe)/2),y.m(bt++,Zt+Wn,de)):((this.K===270?de>=gt.bounds.bottom:de<=gt.bounds.y)&&(Wn=(this.K===90?-ne:Fe)/2),y.m(bt++,re,$t+Wn)),y.m(bt++,re,de)}}else ne=Math.max(10,this.he[Wt.layer]),Fe=Math.max(10,this.Ld[Wt.layer]),yt?this.K===180?(y.m(bt++,re-ne-Ct,de),y.m(bt++,Math.min(re-ne+Ct/2,re),de),y.m(bt++,re,de),y.m(bt++,re,de),y.m(bt++,Math.max(re+Fe-Ct/2,re),de),y.m(bt++,re+Fe+Ct,de)):this.K===90?(y.m(bt++,re,de+Fe+Ct),y.m(bt++,re,Math.max(de+Fe-Ct/2,de)),y.m(bt++,re,de),y.m(bt++,re,de),y.m(bt++,re,Math.min(de-ne+Ct/2,de)),y.m(bt++,re,de-ne-Ct)):this.K===270?(y.m(bt++,re,de-ne-Ct),y.m(bt++,re,Math.min(de-ne+Ct/2,de)),y.m(bt++,re,de),y.m(bt++,re,de),y.m(bt++,re,Math.max(de+Fe-Ct/2,de)),y.m(bt++,re,de+Fe+Ct)):(y.m(bt++,re+Fe+Ct,de),y.m(bt++,Math.max(re+Fe-Ct/2,re),de),y.m(bt++,re,de),y.m(bt++,re,de),y.m(bt++,Math.min(re-ne+Ct/2,re),de),y.m(bt++,re-ne-Ct,de)):y.m(bt++,re,de)}gt=Wt}(rt===null||lt!==ar||xt)&&(Zt=y.i(bt-1).x,$t=y.i(bt-1).y,re=y.i(bt).x,de=y.i(bt).y,xt?(Ct=this.Ld[ut.layer],this.K===180||this.K===0?(xt=$t,xt>=ut.bounds.y&&xt<=ut.bounds.bottom&&(this.K===180?re>=ut.bounds.x:re<=ut.bounds.right)&&(gt=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++,gt,$t),y.m(bt++,gt,xt)),y.m(bt++,re,xt)):(xt=Zt,xt>=ut.bounds.x&&xt<=ut.bounds.right&&(this.K===270?de>=ut.bounds.y:de<=ut.bounds.bottom)&&(gt=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,gt),y.m(bt++,xt,gt)),y.m(bt++,xt,de)),y.m(bt++,re,de)):yt?(ne=Math.max(10,this.he[ut.layer]),Fe=Math.max(10,this.Ld[ut.layer]),this.K===180&&re>=ut.bounds.x?(gt=ut.bounds.x+ut.bounds.width,y.L(bt-2,gt,$t),y.L(bt-1,gt+Fe,$t)):this.K===90&&de<=ut.bounds.bottom?(gt=ut.bounds.y,y.L(bt-2,Zt,gt),y.L(bt-1,Zt,gt-ne)):this.K===270&&de>=ut.bounds.y?(gt=ut.bounds.y+ut.bounds.height,y.L(bt-2,Zt,gt),y.L(bt-1,Zt,gt+Fe)):this.K===0&&re<=ut.bounds.right&&(gt=ut.bounds.x,y.L(bt-2,gt,$t),y.L(bt-1,gt-ne,$t))):(ne=Math.max(10,this.he[ut.layer]),Fe=Math.max(10,this.Ld[ut.layer]),xt=0,this.K===180||this.K===0?((this.K===180?re<=ut.bounds.x:re>=ut.bounds.right)&&(xt=(this.K===0?Fe:-ne)/2),y.m(bt++,re+xt,$t)):((this.K===270?de<=ut.bounds.y:de>=ut.bounds.bottom)&&(xt=(this.K===90?Fe:-ne)/2),y.m(bt++,Zt,de+xt)),y.m(bt++,re,de)))}else{for(;ut!==null&&ut!==gt;){for(ne=Wt=null,ut=ut.destinationEdges.iterator;ut.next()&&(Zt=ut.value,Zt.link!==x.link||(Wt=Zt.toVertex,ne=Zt.fromVertex,ne.node!==null&&(ne=null),Wt.node!==null)););if(Wt===null)break;Wt!==gt&&(Zt=y.i(bt-1).x,$t=y.i(bt-1).y,re=Wt.centerX,de=Wt.centerY,xt?this.K===180||this.K===0?(ne!==null?ne.centerY:$t)!==de&&(ne=this.Ta[Wt.layer]+this.Rf.x,bt===y.firstPickIndex+1&&(ne=this.K===0?Math.max(ne,Zt):Math.min(ne,Zt)),y.m(bt++,ne,$t),y.m(bt++,ne,de)):(ne!==null?ne.centerX:Zt)!==re&&(ne=this.Ta[Wt.layer]+this.Rf.y,bt===y.firstPickIndex+1&&(ne=this.K===90?Math.max(ne,$t):Math.min(ne,$t)),y.m(bt++,Zt,ne),y.m(bt++,re,ne)):(ne=Math.max(10,this.he[Wt.layer]),Fe=Math.max(10,this.Ld[Wt.layer]),yt?this.K===180?(y.m(bt++,re+Fe+Ct,de),y.m(bt++,Math.max(re+Fe-Ct/2,re),de),y.m(bt++,re,de),y.m(bt++,re,de),y.m(bt++,Math.min(re-ne+Ct/2,re),de),y.m(bt++,re-ne-Ct,de)):this.K===90?(y.m(bt++,re,de-ne-Ct),y.m(bt++,re,Math.min(de-ne+Ct/2,de)),y.m(bt++,re,de),y.m(bt++,re,de),y.m(bt++,re,Math.max(de+Fe-Ct/2,de)),y.m(bt++,re,de+Fe+Ct)):this.K===270?(y.m(bt++,re,de+Fe+Ct),y.m(bt++,re,Math.max(de+Fe-Ct/2,de)),y.m(bt++,re,de),y.m(bt++,re,de),y.m(bt++,re,Math.min(de-ne+Ct/2,de)),y.m(bt++,re,de-ne-Ct)):(y.m(bt++,re-ne-Ct,de),y.m(bt++,Math.min(re-ne+Ct/2,re),de),y.m(bt++,re,de),y.m(bt++,re,de),y.m(bt++,Math.max(re+Fe-Ct/2,re),de),y.m(bt++,re+Fe+Ct,de)):this.K===180?(y.m(bt++,re+Fe,de),y.m(bt++,re-ne,de)):this.K===90?(y.m(bt++,re,de-ne),y.m(bt++,re,de+Fe)):this.K===270?(y.m(bt++,re,de+Fe),y.m(bt++,re,de-ne)):(y.m(bt++,re-ne,de),y.m(bt++,re+Fe,de)))),ut=Wt}xt&&(Zt=y.i(bt-1).x,$t=y.i(bt-1).y,re=y.i(bt).x,de=y.i(bt).y,this.K===180||this.K===0?$t!==de&&(ne=this.K===0?Math.min(Math.max((re+Zt)/2,this.Ta[gt.layer]+this.Rf.x),re):Math.max(Math.min((re+Zt)/2,this.Ta[gt.layer]+this.Rf.x),re),y.m(bt++,ne,$t),y.m(bt++,ne,de)):Zt!==re&&(ne=this.K===90?Math.min(Math.max((de+$t)/2,this.Ta[gt.layer]+this.Rf.y),de):Math.max(Math.min((de+$t)/2,this.Ta[gt.layer]+this.Rf.y),de),y.m(bt++,Zt,ne),y.m(bt++,re,ne)))}E!==null&&yt&&4<=y.pointsCount&&(tt!==null&&(tt=lt===ar?y.getLinkPointFromPoint(b,tt,tt.ga(cr),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(cr),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()},xo.prototype.avoidOrthogonalOverlaps=function(){if(!(0>=this.linkSpacing)){for(var a=new un,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 gt=1;for(rt=x[z].first,ot=z;ot<b;ot++)lt=x[ot],lt.first!==rt&&(gt++,rt=lt.first);for(ot=!0,lt=gt,ut<gt?(ot=!1,lt=ut,rt=x[z].jc,this.zi(x,this.Js,z,z+tt)):rt=x[z].first,ut=0,gt=z;gt<b;gt++){var yt=x[gt];(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),gt=1,rt=x[z].first,ot=z;ot<b;ot++)lt=x[ot],lt.first!==rt&&(gt++,rt=lt.first);for(ot=!0,lt=gt,ut<gt?(ot=!1,lt=ut,rt=x[z].jc,this.zi(x,this.Js,z,z+tt)):rt=x[z].first,ut=0,gt=z;gt<b;gt++)yt=x[gt],(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=xo.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)&&Qt("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}Ue.Object.defineProperties(xo.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()):Qt("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 Ae(xo,"CycleDepthFirst",0),Sy=new Ae(xo,"CycleGreedy",1),kp=new Ae(xo,"CycleFromLayers",2),k0=new Ae(xo,"LayerOptimalLinkLength",0),xy=new Ae(xo,"LayerLongestPathSink",1),Py=new Ae(xo,"LayerLongestPathSource",2),b0=new Ae(xo,"InitDepthFirstOut",0),wy=new Ae(xo,"InitDepthFirstIn",1),Cy=new Ae(xo,"InitNaive",2),Ey=new Ae(xo,"AggressiveNone",0),N0=new Ae(xo,"AggressiveLess",1),Ly=new Ae(xo,"AggressiveMore",2),Ux=8;xo.className="LayeredDigraphLayout",xo.CycleDepthFirst=M0,xo.CycleGreedy=Sy,xo.CycleFromLayers=kp,xo.LayerOptimalLinkLength=k0,xo.LayerLongestPathSink=xy,xo.LayerLongestPathSource=Py,xo.InitDepthFirstOut=b0,xo.InitDepthFirstIn=wy,xo.InitNaive=Cy,xo.AggressiveNone=Ey,xo.AggressiveLess=N0,xo.AggressiveMore=Ly,xo.PackNone=0,xo.PackExpand=1,xo.PackStraighten=2,xo.PackMedian=4,xo.PackAll=15,xo.AlignNone=0,xo.AlignUpperLeft=1,xo.AlignUpperRight=2,xo.AlignLowerLeft=4,xo.AlignLowerRight=8,xo.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 qf(a){Do.call(this,a)}Ee(qf,Do),qf.prototype.createVertex=function(){return new kl(this)},qf.prototype.createEdge=function(){return new bp(this)},qf.className="LayeredDigraphNetwork";function kl(a){Ca.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}Ee(kl,Ca);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;Qt("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}kl.prototype.Cl=function(a){Ca.prototype.Cl.call(this,a),this.bo=this.co=null},kl.prototype.Kl=function(a){Ca.prototype.Kl.call(this,a),this.bo=this.co=null},kl.prototype.zl=function(a){Ca.prototype.zl.call(this,a),this.$n=this.ao=null},kl.prototype.Jl=function(a){Ca.prototype.Jl.call(this,a),this.$n=this.ao=null},Ue.Object.defineProperties(kl.prototype,{layer:{get:function(){return this.Ig},set:function(a){this.Ig!==a&&(this.Ig=a)}},column:{get:function(){return this.Ag},set:function(a){this.Ag!==a&&(this.Ag=a)}},index:{get:function(){return this.Za},set:function(a){this.Za!==a&&(this.Za=a)}},component:{get:function(){return this.u},set:function(a){this.u!==a&&(this.u=a)}},near:{get:function(){return this.F},set:function(a){this.F!==a&&(this.F=a)}}}),kl.prototype.deleteDestinationEdge=kl.prototype.Jl,kl.prototype.addDestinationEdge=kl.prototype.zl,kl.prototype.deleteSourceEdge=kl.prototype.Kl,kl.prototype.addSourceEdge=kl.prototype.Cl,kl.className="LayeredDigraphVertex";function bp(a){qs.call(this,a),this.j=this.ia=this.Ha=!1,this.V=this.u=NaN,this.F=this.o=0}Ee(bp,qs),Ue.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 Ar(a){Ko.call(this),this.Ub=new vn,this.Wn=O0,this.ud=Ju,this.vo=_0,this.Bq=_y,this.$v=[],this.td=!0,this.Rb=R0,this.$d=new en(10,10).freeze();var y=new Yc(this);this.W=new Zl(y),this.Y=new Zl(y),this.ru=[],a&&Object.assign(this,a)}Ee(Ar,Ko),Ar.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)},Ar.prototype.qb=function(a){a.classType===Ar?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:Qt("Unknown enum value: "+a):Ko.prototype.qb.call(this,a)},Ar.prototype.createNetwork=function(){return new Yc(this)},Ar.prototype.makeNetwork=function(a){function y(E){if(E instanceof qn)return!E.isLinkLabel&&E.category!=="Comment";if(E instanceof kn){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 Ne?(x.lg(a.nodes,!0,y),x.lg(a.links,!0,y)):a instanceof nr?x.lg(a.memberParts,!1,y):x.lg(a.iterator,!1,y),x},Ar.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 Ne&&(y=a),this.path===O0&&y!==null?this.ud=y.isTreePathToChildren?Ju:Kc:this.ud=this.path===O0?Ju: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 vn,y=this.Ub.iterator;y.next();){var x=y.value;x instanceof qn?(x=this.network.ki(x),x!==null&&a.add(x)):x instanceof Zl&&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 Zl&&ax(this,y);for(a=this.Ub.iterator;a.next();)y=a.value,y instanceof Zl&&sx(this,y);for(a=this.Ub.iterator;a.next();)y=a.value,y instanceof Zl&&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 Zl&&this.layoutTree(y);this.arrangeTrees(),this.updateParts()}this.network=null,this.Ub=new vn,this.isValidLayout=!0};function Xx(a){var y=new vn;for(a=a.iterator;a.next();){var x=a.value;x.initialized||y.add(x)}return y}Ar.prototype.findRoots=function(){for(var a=this.network.vertexes,y=a.iterator;y.next();){var x=y.value;switch(this.ud){case Ju:x.sourceEdges.count===0&&this.Ub.add(x);break;case Kc:x.destinationEdges.count===0&&this.Ub.add(x);break;default:Qt("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 Ju: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:Qt("Unhandled path value "+a.ud.toString())}}return E}function My(a,y){if(y!==null){switch(a.ud){case Ju:if(0<y.destinationEdges.count){for(var x=new un,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 un,E=y.sourceVertexes;E.next();)b=E.value,ox(a,y,b)&&x.add(b);0<x.count&&(y.children=x.Fa())}break;default:Qt("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}Ar.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===qu&&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}}Ar.prototype.initializeTreeVertexValues=function(a){if(a.copyInheritedPropertiesFrom(Jx(this,a)),a.parent!==null&&a.parent.alignment===qu){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])}}Ar.prototype.assignTreeVertexValues=function(){};function lx(a,y){if(y!==null){y.alignment!==qu&&a.sortTreeVertexChildren(y),y=y.children;for(var x=y.length,E=0;E<x;E++)lx(a,y[E])}}Ar.prototype.sortTreeVertexChildren=function(a){switch(a.sorting){case tg: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:Qt("Unhandled sorting value "+a.sorting.toString())}},Ar.prototype.Cu=function(){if(this.comments)for(var a=this.network.vertexes.iterator;a.next();)this.addComments(a.value)},Ar.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=Oe.allocAt(0,0,a.bounds.width+z,a.bounds.height+tt),a.bounds=b,Oe.free(b))};function Ed(a){return a===Zh||a===qu||a===Gh||a===gh}function Np(a){return a===Zh||a===qu}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}Ar.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,gt=Tt.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(gt.h(a.bounds.x-a.commentMargin-Ct.width,a.bounds.y+ot),xt.move(gt),xt=xt.Sd();xt.next();){var bt=xt.value;bt.fromSpot=Ja,bt.toSpot=Aa}else for(gt.h(a.bounds.x+2*a.focus.x-a.commentMargin,a.bounds.y+ot),xt.move(gt),xt=xt.Sd();xt.next();)bt=xt.value,bt.fromSpot=Aa,bt.toSpot=Ja;else if(0<=a.commentMargin)for(gt.h(a.bounds.x+2*a.focus.x+a.commentMargin,a.bounds.y+ot),xt.move(gt),xt=xt.Sd();xt.next();)bt=xt.value,bt.fromSpot=Aa,bt.toSpot=Ja;else for(gt.h(a.bounds.x+a.commentMargin-Ct.width,a.bounds.y+ot),xt.move(gt),xt=xt.Sd();xt.next();)bt=xt.value,bt.fromSpot=Ja,bt.toSpot=Aa;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(gt.h(a.bounds.x+ot,a.bounds.y-a.commentMargin-Ct.height),xt.move(gt),xt=xt.Sd();xt.next();)bt=xt.value,bt.fromSpot=Xa,bt.toSpot=Ga;else for(gt.h(a.bounds.x+ot,a.bounds.y+2*a.focus.y-a.commentMargin),xt.move(gt),xt=xt.Sd();xt.next();)bt=xt.value,bt.fromSpot=Ga,bt.toSpot=Xa;else if(0<=a.commentMargin)for(gt.h(a.bounds.x+ot,a.bounds.y+2*a.focus.y+a.commentMargin),xt.move(gt),xt=xt.Sd();xt.next();)bt=xt.value,bt.fromSpot=Ga,bt.toSpot=Xa;else for(gt.h(a.bounds.x+ot,a.bounds.y+a.commentMargin-Ct.height),xt.move(gt),xt=xt.Sd();xt.next();)bt=xt.value,bt.fromSpot=Xa,bt.toSpot=Ga;ot=0<=a.commentSpacing?ot+(Ct.width+a.commentSpacing):ot+(a.commentSpacing-Ct.width)}}if(Tt.free(gt),y=ot-a.commentSpacing-(E?y.height:y.width),this.ud===Ju)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)}},Ar.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===qu)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=ou(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===Qu;var lt=ot===$u,ut=Ed(ot),gt=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 Wt=a.height,Zt=0,$t=0,ne=0,re=null,de=null,Fe=0,Wn=0,mi=0,ui=0,Fn=0,rn=0,er=0,Ki=0;if(ut&&!Np(ot)&&135<b&&tt.reverse(),Np(ot))if(1<rt)for(var no=0;no<rt;no++)no%2===0&&no!==rt-1&&(Ki=Math.max(Ki,y?tt[no].Da.width:tt[no].Da.height));else rt===1&&(Ki=y?tt[0].Da.width:tt[0].Da.height);if(ut){switch(ot){case Zh:$t=135>b?hx(this,a,tt,Ki,Zt,$t):dx(this,a,tt,Ki,Zt,$t),Ki=$t.x,Zt=$t.width,$t=$t.height;break;case Gh:for(re=0;re<rt;re++)de=tt[re],gt=de.Da,ne=rn===0?0:Ct,y?(de.S.h(z-gt.width,ui+ne),Zt=Math.max(Zt,gt.width),$t=Math.max($t,ui+ne+gt.height),ui+=ne+gt.height):(de.S.h(mi+ne,z-gt.height),Zt=Math.max(Zt,mi+ne+gt.width),$t=Math.max($t,gt.height),mi+=ne+gt.width),rn++;break;case gh:for(re=0;re<rt;re++)de=tt[re],z=de.Da,gt=rn===0?0:Ct,y?(de.S.h(yt/2+a.focus.x,ui+gt),Zt=Math.max(Zt,z.width),$t=Math.max($t,ui+gt+z.height),ui+=gt+z.height):(de.S.h(mi+gt,yt/2+a.focus.y),Zt=Math.max(Zt,mi+gt+z.width),$t=Math.max($t,z.height),mi+=gt+z.width),rn++}re=Hs(this,2),de=Hs(this,2),y?(re[0].h(0,0),re[1].h(0,$t),de[0].h(Zt,0)):(re[0].h(0,0),re[1].h(Zt,0),de[0].h(0,$t)),de[1].h(Zt,$t)}else for(no=0;no<rt;no++){var No=tt[no],ba=No.Da;if(y){0<gt&&0<rn&&mi+yt+ba.width>gt&&(mi<z&&oc(a,ot,z-mi,0,er,no-1),Fn++,rn=0,er=no,ne=$t,mi=0,ui=135<b?-$t-Ct:$t+Ct),T0(this,No,0,ui);var Oa=0;if(rn===0)re=No.Yo,de=No.kp,Fe=ba.width,Wn=ba.height,(re===null||de===null||b!==ou(No))&&(re=Hs(this,2),de=Hs(this,2),re[0].h(0,0),re[1].h(0,Wn),de[0].h(Fe,0),de[1].h(Fe,Wn));else{var cs=Jn();Wn=cx(this,a,No,re,de,Fe,Wn,cs),Oa=Wn.x,re=cs[0],de=cs[1],Fe=Wn.width,Wn=Wn.height,ii(cs),mi<ba.width&&0>Oa&&(Vc(a,-Oa,0,er,no-1),D0(re,-Oa,0),D0(de,-Oa,0),Oa=0)}No.S.h(Oa,ui),Zt=Math.max(Zt,Fe),$t=Math.max($t,ne+(Fn===0?0:Ct)+ba.height),mi=Fe}else 0<gt&&0<rn&&ui+yt+ba.height>gt&&(ui<z&&oc(a,ot,0,z-ui,er,no-1),Fn++,rn=0,er=no,ne=Zt,ui=0,mi=135<b?-Zt-Ct:Zt+Ct),T0(this,No,mi,0),Oa=0,rn===0?(re=No.Yo,de=No.kp,Fe=ba.width,Wn=ba.height,(re===null||de===null||b!==ou(No))&&(re=Hs(this,2),de=Hs(this,2),re[0].h(0,0),re[1].h(Fe,0),de[0].h(0,Wn),de[1].h(Fe,Wn))):(cs=Jn(),Wn=cx(this,a,No,re,de,Fe,Wn,cs),Oa=Wn.x,re=cs[0],de=cs[1],Fe=Wn.width,Wn=Wn.height,ii(cs),ui<ba.height&&0>Oa&&(Vc(a,0,-Oa,er,no-1),D0(re,0,-Oa),D0(de,0,-Oa),Oa=0)),No.S.h(mi,Oa),$t=Math.max($t,Wn),Zt=Math.max(Zt,ne+(Fn===0?0:Ct)+ba.width),ui=Wn;rn++}switch(0<Fn&&(y?($t+=Math.max(0,x),mi<Zt&&oc(a,ot,Zt-mi,0,er,rt-1),0<bt&&(lt||Vc(a,bt,0,0,rt-1),Zt+=bt)):(Zt+=Math.max(0,x),ui<$t&&oc(a,ot,0,$t-ui,er,rt-1),0<bt&&(lt||Vc(a,0,bt,0,rt-1),$t+=bt))),bt=lt=0,ot){case eg:y?lt+=Zt/2-a.focus.x-xt/2:bt+=$t/2-a.focus.y-xt/2;break;case Uc:0<Fn?y?lt+=Zt/2-a.focus.x-xt/2:bt+=$t/2-a.focus.y-xt/2:y?(Ki=tt[0].S.x+tt[0].la.x,lt+=Ki+(tt[rt-1].S.x+tt[rt-1].la.x+2*tt[rt-1].focus.x-Ki)/2-a.focus.x-xt/2):(Ki=tt[0].S.y+tt[0].la.y,bt+=Ki+(tt[rt-1].S.y+tt[rt-1].la.y+2*tt[rt-1].focus.y-Ki)/2-a.focus.y-xt/2);break;case Qu:y?(lt-=xt,Zt+=xt):(bt-=xt,$t+=xt);break;case $u:y?(lt+=Zt-a.width+xt,Zt+=xt):(bt+=$t-a.height+xt,$t+=xt);break;case Zh:y?1<rt?lt+=Ki+yt/2-a.focus.x:lt+=tt[0].focus.x-a.focus.x+tt[0].la.x:1<rt?bt+=Ki+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+=$t+yt/2-a.focus.y;break;case gh:break;default:$t=this.customAlignment(a,lt,bt,Zt,$t),lt=$t[0],bt=$t[1],Zt=$t[2],$t=$t[3]}for(xt=0;xt<rt;xt++)Ki=tt[xt],y?Ki.S.h(Ki.S.x+Ki.la.x-lt,Ki.S.y+(135<b?(ut?-$t:-Ki.Da.height)+Ki.la.y-x:Wt+x+Ki.la.y)):Ki.S.h(Ki.S.x+(135<b?(ut?-Zt:-Ki.Da.width)+Ki.la.x-x:E+x+Ki.la.x),Ki.S.y+Ki.la.y-bt);if(rt=tt=0,ut?y?(Zt=by(a,Zt,lt),0>lt&&(lt=0),135<b&&(bt+=$t+x),$t+=Wt+x,ot===gh&&(tt+=yt/2+a.focus.x),rt+=Wt+x):(135<b&&(lt+=Zt+x),Zt+=E+x,$t=Ny(a,$t,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+=$t+x),$t=Math.max(Math.max($t,Wt),$t+Wt+x),rt+=Wt+x):(135<b&&(lt+=Zt+x),Zt=Math.max(Math.max(Zt,E),Zt+E+x),a.comments===null?Wt>$t&&($t=By(ot,0,Wt-$t),tt=$t.x,rt=$t.y,$t=Wt,bt=0):$t=Ny(a,$t,bt),0>bt&&(rt-=bt,bt=0),tt+=E+x),0<Fn)b=Hs(this,4),Fn=Hs(this,4),y?(b[2].h(0,Wt+x),b[3].h(b[2].x,$t),Fn[2].h(Zt,b[2].y),Fn[3].h(Fn[2].x,b[3].y)):(b[2].h(E+x,0),b[3].h(Zt,b[2].y),Fn[2].h(b[2].x,$t),Fn[3].h(b[3].x,Fn[2].y));else{for(b=Hs(this,re.length+2),Fn=Hs(this,de.length+2),ot=0;ot<re.length;ot++)ut=re[ot],b[ot+2].h(ut.x+tt,ut.y+rt);for(ot=0;ot<de.length;ot++)ut=de[ot],Fn[ot+2].h(ut.x+tt,ut.y+rt)}y?(b[0].h(lt,0),b[1].h(b[0].x,Wt),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])),Fn[0].h(lt+E,0),Fn[1].h(Fn[0].x,Wt),Fn[2].y<Fn[1].y&&(Fn[2].x<Fn[0].x?Fn[2].assign(Fn[1]):Fn[1].assign(Fn[2])),Fn[3].y<Fn[2].y&&(Fn[3].x<Fn[0].x?Fn[3].assign(Fn[2]):Fn[2].assign(Fn[3])),b[2].y-=x/2,Fn[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])),Fn[0].h(0,bt+Wt),Fn[1].h(E,Fn[0].y),Fn[2].x<Fn[1].x&&(Fn[2].y<Fn[0].y?Fn[2].assign(Fn[1]):Fn[1].assign(Fn[2])),Fn[3].x<Fn[2].x&&(Fn[3].y<Fn[0].y?Fn[3].assign(Fn[2]):Fn[2].assign(Fn[3])),b[2].x-=x/2,Fn[2].x-=x/2),vu(this,re),vu(this,de),a.Yo=b,a.kp=Fn,a.la.h(lt,bt),a.Da.h(Zt,$t)}break;default:Qt("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=ou(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===Qu,gt=lt===$u;rt=Ed(lt);var yt=Math.max(0,y.breadthLimit);ot=a.computeLayerSpacing(y);var xt=y.nodeSpacing,Ct=a.computeNodeIndent(y),bt=ut||gt?0:Ct/2,Wt=y.rowSpacing,Zt=0;(ut||gt||y.hm||y.im&&y.maxGenerationCount===1)&&(Zt=Math.max(0,y.rowIndent)),ut=y.width;var $t=y.height,ne=0,re=0,de=0,Fe=0,Wn=0,mi=0,ui=0,Fn=0,rn=0,er=0;if(rt&&!Np(lt)&&135<E&&b.reverse(),Np(lt))if(1<tt)for(var Ki=0;Ki<tt;Ki++){var no=b[Ki],No=no.Da;Ki%2===0&&Ki!==tt-1?rn=Math.max(rn,(x?No.width:No.height)+a.computeBusNodeSpacing(no)-xt):Ki%2!==0&&(er=Math.max(er,(x?No.width:No.height)+a.computeBusNodeSpacing(no)-xt))}else tt===1&&(rn=x?b[0].Da.width:b[0].Da.height);if(rt)switch(lt){case Zh:case qu:re=135>E?hx(a,y,b,rn,ne,re):dx(a,y,b,rn,ne,re),rn=re.x,ne=re.width,re=re.height;break;case Gh:for(yt=0;yt<tt;yt++)bt=b[yt],de=bt.Da,er=ui===0?0:Wt,x?(bt.S.h(z-de.width,Wn+er),ne=Math.max(ne,de.width),re=Math.max(re,Wn+er+de.height),Wn+=er+de.height):(bt.S.h(Fe+er,z-de.height),ne=Math.max(ne,Fe+er+de.width),re=Math.max(re,de.height),Fe+=er+de.width),ui++;break;case gh:for(z=0;z<tt;z++)yt=b[z],bt=yt.Da,de=ui===0?0:Wt,x?(yt.S.h(xt/2+y.focus.x,Wn+de),ne=Math.max(ne,bt.width),re=Math.max(re,Wn+de+bt.height),Wn+=de+bt.height):(yt.S.h(Fe+de,xt/2+y.focus.y),ne=Math.max(ne,Fe+de+bt.width),re=Math.max(re,bt.height),Fe+=de+bt.width),ui++}else for(er=0;er<tt;er++)Ki=b[er],no=Ki.Da,x?(0<yt&&0<ui&&Fe+xt+no.width>yt&&(Fe<z&&oc(y,lt,z-Fe,0,Fn,er-1),mi++,ui=0,Fn=er,de=re,Fe=0,Wn=135<E?-re-Wt:re+Wt),No=ui===0?bt:xt,T0(a,Ki,0,Wn),Ki.S.h(Fe+No,Wn),ne=Math.max(ne,Fe+No+no.width),re=Math.max(re,de+(mi===0?0:Wt)+no.height),Fe+=No+no.width):(0<yt&&0<ui&&Wn+xt+no.height>yt&&(Wn<z&&oc(y,lt,0,z-Wn,Fn,er-1),mi++,ui=0,Fn=er,de=ne,Wn=0,Fe=135<E?-ne-Wt:ne+Wt),No=ui===0?bt:xt,T0(a,Ki,Fe,0),Ki.S.h(Fe,Wn+No),re=Math.max(re,Wn+No+no.height),ne=Math.max(ne,de+(mi===0?0:Wt)+no.width),Wn+=No+no.height),ui++;switch(0<mi&&(x?(re+=Math.max(0,ot),Fe<ne&&oc(y,lt,ne-Fe,0,Fn,tt-1),0<Zt&&(gt||Vc(y,Zt,0,0,tt-1),ne+=Zt)):(ne+=Math.max(0,ot),Wn<re&&oc(y,lt,0,re-Wn,Fn,tt-1),0<Zt&&(gt||Vc(y,0,Zt,0,tt-1),re+=Zt))),Zt=gt=0,lt){case eg:x?gt+=ne/2-y.focus.x-Ct/2:Zt+=re/2-y.focus.y-Ct/2;break;case Uc:0<mi?x?gt+=ne/2-y.focus.x-Ct/2:Zt+=re/2-y.focus.y-Ct/2:x?(a=b[0].S.x+b[0].la.x,gt+=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 Qu:x?(gt-=Ct,ne+=Ct):(Zt-=Ct,re+=Ct);break;case $u:x?(gt+=ne-y.width+Ct,ne+=Ct):(Zt+=re-y.height+Ct,re+=Ct);break;case Zh:case qu:x?1<tt?gt+=rn+xt/2-y.focus.x:gt+=b[0].focus.x-y.focus.x+b[0].la.x:1<tt?Zt+=rn+xt/2-y.focus.y:Zt+=b[0].focus.y-y.focus.y+b[0].la.y;break;case Gh:x?gt+=ne+xt/2-y.focus.x:Zt+=re+xt/2-y.focus.y;break;case gh:break;default:a=a.customAlignment(y,gt,Zt,ne,re),gt=a[0],Zt=a[1],ne=a[2],re=a[3]}for(a=0;a<tt;a++)Ct=b[a],x?Ct.S.h(Ct.S.x+Ct.la.x-gt,Ct.S.y+(135<E?(rt?-re:-Ct.Da.height)+Ct.la.y-ot:$t+ot+Ct.la.y)):Ct.S.h(Ct.S.x+(135<E?(rt?-ne:-Ct.Da.width)+Ct.la.x-ot:ut+ot+Ct.la.x),Ct.S.y+Ct.la.y-Zt);x?(ne=by(y,ne,gt),0>gt&&(gt=0),135<E&&(Zt+=re+ot),re=Math.max(Math.max(re,$t),re+$t+ot)):(135<E&&(gt+=ne+ot),ne=Math.max(Math.max(ne,ut),ne+ut+ot),re=Ny(y,re,Zt),0>Zt&&(Zt=0)),y.la.h(gt,Zt),y.Da.h(ne,re)}}Ar.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 Oe(E,0,b,z);if(tt===1)return y=x[0],b=y.Da.width,z=y.Da.height,new Oe(E,0,b,z);for(var rt=y.nodeSpacing,ot=y.rowSpacing,lt=ou(y)===90,ut=0,gt=0,yt=0,xt=0;xt<tt;xt++)if(!(xt%2!==0||1<tt&&xt===tt-1)){var Ct=x[xt],bt=Ct.Da,Wt=ut===0?0:ot;if(lt){var Zt=a.computeBusNodeSpacing(Ct)-rt;Ct.S.h(E-(bt.width+Zt),yt+Wt),b=Math.max(b,bt.width+Zt),z=Math.max(z,yt+Wt+bt.height),yt+=Wt+bt.height}else Zt=a.computeBusNodeSpacing(Ct)-rt,Ct.S.h(gt+Wt,E-(bt.height+Zt)),z=Math.max(z,bt.height+Zt),b=Math.max(b,gt+Wt+bt.width),gt+=Wt+bt.width;ut++}for(ut=0,Ct=gt,xt=yt,lt?(gt=E+rt,yt=0):(gt=0,yt=E+rt),bt=0;bt<tt;bt++)if(bt%2!==0){Wt=x[bt],Zt=Wt.Da;var $t=ut===0?0:ot;if(lt){var ne=a.computeBusNodeSpacing(Wt)-rt;Wt.S.h(gt+ne,yt+$t),b=Math.max(b,gt+Zt.width+ne),z=Math.max(z,yt+$t+Zt.height),yt+=$t+Zt.height}else ne=a.computeBusNodeSpacing(Wt)-rt,Wt.S.h(gt+$t,yt+ne),b=Math.max(b,gt+$t+Zt.width),z=Math.max(z,yt+Zt.height+ne),gt+=$t+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(gt))),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,gt)+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 Oe(E,0,b,z)}function dx(a,y,x,E,b,z){var tt=x.length;if(tt===0)return new Oe(E,0,b,z);if(tt===1)return x=x[0],b=x.Da.width,z=x.Da.height,new Oe(E,0,b,z);for(var rt=y.nodeSpacing,ot=y.rowSpacing,lt=ou(y)===270,ut=0,gt=0,yt=0,xt=0;xt<tt;xt++)if(!(xt%2!==0||1<tt&&xt===tt-1)){var Ct=x[xt],bt=Ct.Da,Wt=ut===0?0:ot;if(lt){var Zt=a.computeBusNodeSpacing(Ct)-rt;yt-=Wt+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,gt-=Wt+bt.width,Ct.S.h(gt,E-(bt.height+Zt)),z=Math.max(z,bt.height+Zt),b=Math.max(b,Math.abs(gt));ut++}for(ut=0,Ct=gt,xt=yt,lt?(gt=E+rt,yt=0):(gt=0,yt=E+rt),bt=0;bt<tt;bt++)if(bt%2!==0){Wt=x[bt],Zt=Wt.Da;var $t=ut===0?0:ot;if(lt){var ne=a.computeBusNodeSpacing(Wt)-rt;yt-=$t+Zt.height,Wt.S.h(gt+ne,yt),b=Math.max(b,gt+Zt.width+ne),z=Math.max(z,Math.abs(yt))}else ne=a.computeBusNodeSpacing(Wt)-rt,gt-=$t+Zt.width,Wt.S.h(gt,yt+ne),z=Math.max(z,yt+Zt.height+ne),b=Math.max(b,Math.abs(gt));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(gt))),lt?(ot.S.h(E+rt/2-ot.focus.x-ot.la.x,-z-ut.height-a),gt=E+rt/2-ot.focus.x-ot.la.x,b=Math.max(b,gt+ut.width),0>gt&&(b-=gt),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,gt))+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 Oe(E,0,b,z)}Ar.prototype.computeBusNodeSpacing=function(a){return a.parent===null?0:a.parent.nodeSpacing},Ar.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 eg:return x+a.width>y&&(y=x+a.width),0>x&&(y-=x),y;case Qu:return a.width>y?a.width:y;case $u:return 2*a.focus.x>y?a.width:y+a.width-2*a.focus.x;case Zh:case qu: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 eg:return x+a.height>y&&(y=x+a.height),0>x&&(y-=x),y;case Qu:return a.height>y?a.height:y;case $u:return 2*a.focus.y>y?a.height:y+a.height-2*a.focus.y;case Zh:case qu: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 eg:y/=2,x/=2;break;case Uc:y/=2,x/=2;break;case Qu:x=y=0;break;case $u:break;default:Qt("Unhandled alignment value "+a.toString())}return new Tt(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 Ju: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:Qt("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=ou(y),lt=ot===90||ot===270,ut=y.nodeSpacing;y=E;var gt=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!==ou(x))&&(xt=Hs(a,2),Ct=Hs(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,!(gt===null||2>gt.length||xt===null||2>xt.length))for(b=x=0;x<gt.length&&b<xt.length;){z=gt[x];var Wt=xt[b];ot=Wt.x,lt=Wt.y,ot+=E;var Zt=z;x+1<gt.length&&(Zt=gt[x+1]);var $t=Wt;Wt=$t.x,$t=$t.y,b+1<xt.length&&($t=xt[b+1],Wt=$t.x,$t=$t.y,Wt+=E);var ne=yt;z.y===lt?ne=ot-z.x:z.y>lt&&z.y<$t?ne=ot+(z.y-lt)/($t-lt)*(Wt-ot)-z.x:lt>z.y&<<Zt.y&&(ne=ot-(z.x+(lt-z.y)/(Zt.y-z.y)*(Zt.x-z.x))),ne<yt&&(yt=ne),Zt.y<=z.y?x++:$t<=lt?b++:(Zt.y<=$t&&x++,$t<=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=Hs(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=Hs(a,E),ot=0;ot<E;ot++)x[ot].assign(ut[ot]);vu(a,ut),E=x}if(z=Ct,ot=yt,gt===null||2>gt.length||z===null||2>z.length)b=null;else{for(ut=Hs(a,gt.length+z.length),b=lt=x=0;x<gt.length&>[x].y<z[0].y;)Zt=gt[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<gt.length&>[x].y<=z;)x++;for(;x<gt.length&>[x].y>z;)ot=gt[x++],ut[b++].h(ot.x,ot.y);for(z=Hs(a,b),x=0;x<b;x++)z[x].assign(ut[x]);vu(a,ut),b=z}return z=Math.max(0,yt)+tt.width,tt=bt,vu(a,y),vu(a,xt),vu(a,gt),vu(a,Ct),rt[0]=E,rt[1]=b,new Oe(yt,0,z,tt)}if(E=9999999,!(gt===null||2>gt.length||xt===null||2>xt.length))for(b=x=0;x<gt.length&&b<xt.length;)z=gt[x],Wt=xt[b],ot=Wt.x,lt=Wt.y,lt+=yt,Zt=z,x+1<gt.length&&(Zt=gt[x+1]),$t=Wt,Wt=$t.x,$t=$t.y,b+1<xt.length&&($t=xt[b+1],Wt=$t.x,$t=$t.y,$t+=yt),ne=E,z.x===ot?ne=lt-z.y:z.x>ot&&z.x<Wt?ne=lt+(z.x-ot)/(Wt-ot)*($t-lt)-z.y:ot>z.x&&ot<Zt.x&&(ne=lt-(z.y+(ot-z.x)/(Zt.x-z.x)*(Zt.y-z.y))),ne<E&&(E=ne),Zt.x<=z.x?x++:Wt<=ot?b++:(Zt.x<=Wt&&x++,Wt<=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=Hs(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=Hs(a,E),ot=0;ot<E;ot++)x[ot].assign(ut[ot]);vu(a,ut),E=x}if(z=Ct,ot=yt,gt===null||2>gt.length||z===null||2>z.length)b=null;else{for(ut=Hs(a,gt.length+z.length),b=lt=x=0;x<gt.length&>[x].x<z[0].x;)Zt=gt[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<gt.length&>[x].x<=z;)x++;for(;x<gt.length&>[x].x>z;)ot=gt[x++],ut[b++].h(ot.x,ot.y);for(z=Hs(a,b),x=0;x<b;x++)z[x].assign(ut[x]);vu(a,ut),b=z}return z=bt,tt=Math.max(0,yt)+tt.height,vu(a,y),vu(a,xt),vu(a,gt),vu(a,Ct),rt[0]=E,rt[1]=b,new Oe(yt,0,z,tt)}function Hs(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 Tt;return a}function vu(a,y){var x=y.length,E=a.ru[x];E===void 0&&(E=[],a.ru[x]=E),E.push(y)}Ar.prototype.arrangeTrees=function(){if(this.Rb===j0)for(var a=this.Ub.iterator;a.next();){var y=a.value;if(y instanceof Zl){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 Zl&&a.push(x);switch(this.sorting){case tg:break;case Bp:a.reverse();break;case Ap:a.sort(this.comparer);break;case Tp:a.sort(this.comparer),a.reverse();break;default:Qt("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:Qt("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)}}}Ar.prototype.commitLayout=function(){this.yv(),this.commitNodes(),this.Gu(),this.isRouting&&this.commitLinks()},Ar.prototype.commitNodes=function(){for(var a=this.network.vertexes.iterator;a.next();)a.value.commit();for(a.reset();a.next();)this.layoutComments(a.value)},Ar.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 Tt(-this.nodeSpacing/2,-this.layerSpacing/2)):(x.Bc(this.layerSpacing,this.nodeSpacing/2),E=new Tt(-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 Oe(0,z,x,rt))):this.angle===90?(b.push(new Oe(0,z,x,rt)),z+=rt):this.angle===180?(z-=rt,b.push(new Oe(z,0,rt,x))):(b.push(new Oe(z,0,rt,x)),z+=rt)}this.commitLayers(b,E)}},Ar.prototype.commitLayers=function(){},Ar.prototype.commitLinks=function(){for(var a=this.network.edges.iterator;a.next();)a.value.commit()},Ar.prototype.yv=function(){for(var a=this.Ub.iterator;a.next();){var y=a.value;y instanceof Zl&&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])}}Ar.prototype.setPortSpots=function(a){var y=a.alignment;if(Ed(y)){var x=this.ud===Ju,E=ou(a);switch(E){case 0:var b=Aa;break;case 90:b=Ga;break;case 180:b=Ja;break;default:b=Xa}var z=a.children,tt=z.length;switch(y){case Zh:case qu: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?Ja:Xa;if(tt===1||y===tt-1&&tt%2===1)switch(E){case 0:ot=Ja;break;case 90:ot=Xa;break;case 180:ot=Aa;break;default:ot=Ga}else y%2===0&&(ot=E===90||E===270?Aa: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?Aa: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?Ja:Xa,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=ou(a),this.ud===Ju){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=Aa;break;case 90:E.fromSpot=Ga;break;case 180:E.fromSpot=Ja;break;default:E.fromSpot=Xa}else E.fromSpot=a.portSpot;if(a.setsChildPortSpot)if(a.childPortSpot.Xb())switch(x){case 0:E.toSpot=Ja;break;case 90:E.toSpot=Xa;break;case 180:E.toSpot=Aa;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=Aa;break;case 90:E.toSpot=Ga;break;case 180:E.toSpot=Ja;break;default:E.toSpot=Xa}else E.toSpot=a.portSpot;if(a.setsChildPortSpot)if(a.childPortSpot.Xb())switch(x){case 0:E.fromSpot=Ja;break;case 90:E.fromSpot=Xa;break;case 180:E.fromSpot=Aa;break;default:E.fromSpot=Ga}else E.fromSpot=a.childPortSpot}};function ou(a){return a=a.angle,45>=a?0:135>=a?90:225>=a?180:315>=a?270:0}Ar.prototype.computeLayerSpacing=function(a){var y=ou(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},Ar.prototype.computeNodeIndent=function(a){var y=ou(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)},Ue.Object.defineProperties(Ar.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!==tg&&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()):Qt("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!==tg&&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 Ae(Ar,"PathDefault",-1),Ju=new Ae(Ar,"PathDestination",0),Kc=new Ae(Ar,"PathSource",1),tg=new Ae(Ar,"SortingForwards",10),Bp=new Ae(Ar,"SortingReverse",11),Ap=new Ae(Ar,"SortingAscending",12),Tp=new Ae(Ar,"SortingDescending",13),eg=new Ae(Ar,"AlignmentCenterSubtrees",20),Uc=new Ae(Ar,"AlignmentCenterChildren",21),Qu=new Ae(Ar,"AlignmentStart",22),$u=new Ae(Ar,"AlignmentEnd",23),Zh=new Ae(Ar,"AlignmentBus",24),qu=new Ae(Ar,"AlignmentBusBranching",25),Gh=new Ae(Ar,"AlignmentTopLeftBus",26),gh=new Ae(Ar,"AlignmentBottomRightBus",27),I0=new Ae(Ar,"CompactionNone",30),Dp=new Ae(Ar,"CompactionBlock",31),_0=new Ae(Ar,"StyleLayered",40),Ty=new Ae(Ar,"StyleLastParents",41),Dy=new Ae(Ar,"StyleAlternating",42),Oy=new Ae(Ar,"StyleRootOnly",43),R0=new Ae(Ar,"ArrangementVertical",50),Iy=new Ae(Ar,"ArrangementHorizontal",51),j0=new Ae(Ar,"ArrangementFixedRoots",52),_y=new Ae(Ar,"LayerIndividual",60),Ry=new Ae(Ar,"LayerSiblings",61),z0=new Ae(Ar,"LayerUniform",62);Ar.className="TreeLayout",Ar.PathDefault=O0,Ar.PathDestination=Ju,Ar.PathSource=Kc,Ar.SortingForwards=tg,Ar.SortingReverse=Bp,Ar.SortingAscending=Ap,Ar.SortingDescending=Tp,Ar.AlignmentCenterSubtrees=eg,Ar.AlignmentCenterChildren=Uc,Ar.AlignmentStart=Qu,Ar.AlignmentEnd=$u,Ar.AlignmentBus=Zh,Ar.AlignmentBusBranching=qu,Ar.AlignmentTopLeftBus=Gh,Ar.AlignmentBottomRightBus=gh,Ar.CompactionNone=I0,Ar.CompactionBlock=Dp,Ar.StyleLayered=_0,Ar.StyleLastParents=Ty,Ar.StyleAlternating=Dy,Ar.StyleRootOnly=Oy,Ar.ArrangementVertical=R0,Ar.ArrangementHorizontal=Iy,Ar.ArrangementFixedRoots=j0,Ar.LayerIndividual=_y,Ar.LayerSiblings=Ry,Ar.LayerUniform=z0;function Yc(a){Do.call(this,a)}Ee(Yc,Do),Yc.prototype.createVertex=function(){return new Zl(this)},Yc.prototype.createEdge=function(){return new ng(this)},Yc.className="TreeNetwork";function Zl(a){Ca.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 Tt(0,0),this.Da=new en(0,0),this.la=new Tt(0,0),this.im=this.hm=this.qA=!1,this.kp=this.Yo=null,this.nd=tg,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=xa,this.wr=!0,this.Dp=xa}Ee(Zl,Ca),Zl.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)},Ue.Object.defineProperties(Zl.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)}}}),Zl.className="TreeVertex";function ng(a){qs.call(this,a),this.$t=new Tt(0,0)}Ee(ng,qs),ng.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 Ju:x=this.fromVertex,E=this.toVertex;break;case Kc:x=this.toVertex,E=this.fromVertex;break;default:Qt("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=ou(x),tt=y.computeLayerSpacing(x),rt=x.rowSpacing;a.vg();var ot=a.curve===dl,lt=a.isOrthogonal,ut;if(a.uh(),lt||ot){for(ut=2;4<a.pointsCount;)a.pv(2);var gt=a.i(1),yt=a.i(2)}else{for(ut=1;3<a.pointsCount;)a.pv(1);gt=a.i(0),yt=a.i(a.pointsCount-1)}var xt=a.i(a.pointsCount-1);z===0?(x.alignment===$u?(z=E.bottom+b.y,b.y===0&>.y>xt.y+x.rowIndent&&(z=Math.min(z,Math.max(gt.y,z-y.computeNodeIndent(x))))):x.alignment===Qu?(z=E.top+b.y,b.y===0&>.y<xt.y-x.rowIndent&&(z=Math.max(z,Math.min(gt.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,gt.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,gt.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===$u?(z=E.right+b.x,b.x===0&>.x>xt.x+x.rowIndent&&(z=Math.min(z,Math.max(gt.x,z-y.computeNodeIndent(x))))):x.alignment===Qu?(z=E.left+b.x,b.x===0&>.x<xt.x-x.rowIndent&&(z=Math.max(z,Math.min(gt.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,gt.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,gt.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===$u?(z=E.bottom+b.y,b.y===0&>.y>xt.y+x.rowIndent&&(z=Math.min(z,Math.max(gt.y,z-y.computeNodeIndent(x))))):x.alignment===Qu?(z=E.top+b.y,b.y===0&>.y<xt.y-x.rowIndent&&(z=Math.max(z,Math.min(gt.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,gt.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,gt.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===$u?(z=E.right+b.x,b.x===0&>.x>xt.x+x.rowIndent&&(z=Math.min(z,Math.max(gt.x,z-y.computeNodeIndent(x))))):x.alignment===Qu?(z=E.left+b.x,b.x===0&>.x<xt.x-x.rowIndent&&(z=Math.max(z,Math.min(gt.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,gt.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,gt.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))):Qt("Invalid angle "+z),a.zf()}else b=E,a=this.link,E=this.network.layout,y=ou(x),y!==ou(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===dl,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()))}}},Ue.Object.defineProperties(ng.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)}}}),ng.className="TreeEdge",Br.prototype.initializeStandardTools=function(){this.gb("Action",new Dl,this.mouseDownTools),this.gb("Relinking",new Ra,this.mouseDownTools),this.gb("LinkReshaping",new qi,this.mouseDownTools),this.gb("Rotating",new Ea,this.mouseDownTools),this.gb("Resizing",new Ma,this.mouseDownTools),this.gb("Linking",new jo,this.mouseMoveTools),this.gb("Dragging",new Oo,this.mouseMoveTools),this.gb("DragSelecting",new yl,this.mouseMoveTools),this.gb("Panning",new $a,this.mouseMoveTools),this.gb("ContextMenu",new vs,this.mouseUpTools),this.gb("TextEditing",new Go,this.mouseUpTools),this.gb("ClickCreating",new wh,this.mouseUpTools),this.gb("ClickSelecting",new Xl,this.mouseUpTools)},Nu("Horizontal",new pm),Nu("Spot",new vm),Nu("Table",new Sm),Nu("Viewbox",new wm),Nu("TableRow",new xm),Nu("TableColumn",new Pm),Nu("Graduated",new Jg),Nu("Grid",new Xg),Lf.add("GraphLinksModel",Da),Lf.add("TreeModel",Fl);var Z0=$e.go,jy={get licenseKey(){return Ne.licenseKey},set licenseKey(a){Ne.licenseKey=a},get version(){return Ne.version},Group:nr,EnumValue:Ae,List:un,Set:vn,Map:be,Point:Tt,Size:en,Rect:Oe,Margin:dr,Spot:yi,Geometry:ce,PathFigure:Ir,PathSegment:Vi,InputEvent:zi,DiagramEvent:Nr,ChangedEvent:Fi,Model:bi,GraphLinksModel:Hr,TreeModel:Ls,Binding:sa,Transaction:Ro,UndoManager:Ji,CommandHandler:Ht,Tool:wr,DraggingTool:Oo,DraggingInfo:lh,DraggingOptions:at,LinkingBaseTool:mr,LinkingTool:jo,RelinkingTool:Ra,LinkReshapingTool:qi,ResizingTool:Ma,RotatingTool:Ea,ClickSelectingTool:Xl,ActionTool:Dl,ClickCreatingTool:wh,HTMLInfo:Lu,ContextMenuTool:vs,DragSelectingTool:yl,PanningTool:$a,TextEditingTool:Go,ToolManager:Br,Animation:qa,AnimationManager:Js,AnimationTrigger:Ql,Layer:ja,Diagram:Ne,Palette:ct,Overview:mt,Brush:vo,GraphObject:fe,Panel:wn,RowColumnDefinition:va,Shape:gr,TextBlock:To,Picture:Os,Part:Ti,Adornment:Qr,Node:qn,Link:kn,Placeholder:Ps,Layout:Ko,LayoutNetwork:Do,LayoutVertex:Ca,LayoutEdge:qs,GridLayout:Va,PanelLayout:wa,CircularLayout:Xo,CircularNetwork:Qf,CircularVertex:Ep,CircularEdge:P0,ForceDirectedLayout:es,ForceDirectedNetwork:Wc,ForceDirectedVertex:Lp,ForceDirectedEdge:Fp,LayeredDigraphLayout:xo,LayeredDigraphNetwork:qf,LayeredDigraphVertex:kl,LayeredDigraphEdge:bp,TreeLayout:Ar,TreeNetwork:Yc,TreeVertex:Zl,TreeEdge:ng};typeof Z0=="object"&&Z0.version&&_n("WARNING: a `go` object on the root object is already defined. "+("Debug"in Z0?"debug ":"")+"version: "+Z0.version+", replaced with version: "+jy.version),Ne.prototype.go=jy,$e.go=jy,typeof Mn.exports=="object"&&(Mn.exports=typeof kt.g!="undefined"?kt.g.go:self.go)}();var ft=typeof kt.g!="undefined"?kt.g.go:self.go;const Kt=typeof kt.g!="undefined"?kt.g.go:self.go,le=Kt.Group,we=Kt.EnumValue,ue=Kt.List,Dt=Kt.Set,ee=Kt.Map,pe=Kt.Point,Jt=Kt.Size,jt=Kt.Rect,De=Kt.Margin,ae=Kt.Spot,Le=Kt.Geometry,Bt=Kt.PathFigure,nt=Kt.PathSegment,et=Kt.InputEvent,ht=Kt.DiagramEvent,st=Kt.ChangedEvent,pt=Kt.Model,vt=Kt.GraphLinksModel,St=Kt.TreeModel,Et=Kt.Binding,At=Kt.Transaction,It=Kt.UndoManager,qt=Kt.CommandHandler,Ut=Kt.Tool,Gt=Kt.DraggingTool,ge=Kt.DraggingInfo,ie=Kt.LinkingBaseTool,Te=Kt.LinkingTool,ve=Kt.RelinkingTool,ye=Kt.LinkReshapingTool,Ye=Kt.ResizingTool,Ze=Kt.RotatingTool,qe=Kt.ClickSelectingTool,pn=Kt.ActionTool,te=Kt.ClickCreatingTool,Xt=Kt.HTMLInfo,Qe=Kt.ContextMenuTool,On=Kt.DragSelectingTool,En=Kt.PanningTool,Ie=Kt.TextEditingTool,on=Kt.ToolManager,cn=Kt.Animation,Vn=Kt.AnimationManager,Me=Kt.AnimationTrigger,he=Kt.Layer,Ce=Kt.Diagram,Yn=Kt.Palette,Si=Kt.Overview,Rt=Kt.Brush,Ft=Kt.GraphObject,Pt=Kt.Panel,Nt=Kt.RowColumnDefinition,zt=Kt.Shape,Mt=Kt.TextBlock,Yt=Kt.TextBlockMetrics,He=Kt.Picture,_e=Kt.Part,Xe=Kt.Adornment,xe=Kt.Node,Pe=Kt.Link,ke=Kt.Placeholder,Ve=Kt.Layout,tn=Kt.LayoutNetwork,dn=Kt.LayoutVertex,fn=Kt.LayoutEdge,ni=Kt.GridLayout,Ge=Kt.PanelLayout,Ke=Kt.CircularLayout,nn=Kt.CircularNetwork,Qn=Kt.CircularVertex,gn=Kt.CircularEdge,an=Kt.ForceDirectedLayout,zn=Kt.ForceDirectedNetwork,gi=Kt.ForceDirectedVertex,ti=Kt.ForceDirectedEdge,wi=Kt.LayeredDigraphLayout,Wi=Kt.LayeredDigraphNetwork,Cn=Kt.LayeredDigraphVertex,Pn=Kt.LayeredDigraphEdge,Bn=Kt.TreeLayout,si=Kt.TreeNetwork,Ei=Kt.TreeVertex,ci=Kt.TreeEdge,Zi=Kt.version},24334:function(Mn,Rn,kt){var ft,Kt;(function(le,we){Mn.exports=we(le)})(typeof self!="undefined"?self:typeof window!="undefined"?window:typeof kt.g!="undefined"?kt.g:this,function(le){"use strict";le=le||{};var we=le.Base64,ue="2.6.4",Dt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ee=function(ve){for(var ye={},Ye=0,Ze=ve.length;Ye<Ze;Ye++)ye[ve.charAt(Ye)]=Ye;return ye}(Dt),pe=String.fromCharCode,Jt=function(ve){if(ve.length<2){var ye=ve.charCodeAt(0);return ye<128?ve:ye<2048?pe(192|ye>>>6)+pe(128|ye&63):pe(224|ye>>>12&15)+pe(128|ye>>>6&63)+pe(128|ye&63)}else{var ye=65536+(ve.charCodeAt(0)-55296)*1024+(ve.charCodeAt(1)-56320);return pe(240|ye>>>18&7)+pe(128|ye>>>12&63)+pe(128|ye>>>6&63)+pe(128|ye&63)}},jt=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,De=function(ve){return ve.replace(jt,Jt)},ae=function(ve){var ye=[0,2,1][ve.length%3],Ye=ve.charCodeAt(0)<<16|(ve.length>1?ve.charCodeAt(1):0)<<8|(ve.length>2?ve.charCodeAt(2):0),Ze=[Dt.charAt(Ye>>>18),Dt.charAt(Ye>>>12&63),ye>=2?"=":Dt.charAt(Ye>>>6&63),ye>=1?"=":Dt.charAt(Ye&63)];return Ze.join("")},Le=le.btoa&&typeof le.btoa=="function"?function(ve){return le.btoa(ve)}:function(ve){if(ve.match(/[^\x00-\xFF]/))throw new RangeError("The string contains invalid characters.");return ve.replace(/[\s\S]{1,3}/g,ae)},Bt=function(ve){return Le(De(String(ve)))},nt=function(ve){return ve.replace(/[+\/]/g,function(ye){return ye=="+"?"-":"_"}).replace(/=/g,"")},et=function(ve,ye){return ye?nt(Bt(ve)):Bt(ve)},ht=function(ve){return et(ve,!0)},st;le.Uint8Array&&(st=function(ve,ye){for(var Ye="",Ze=0,qe=ve.length;Ze<qe;Ze+=3){var pn=ve[Ze],te=ve[Ze+1],Xt=ve[Ze+2],Qe=pn<<16|te<<8|Xt;Ye+=Dt.charAt(Qe>>>18)+Dt.charAt(Qe>>>12&63)+(typeof te!="undefined"?Dt.charAt(Qe>>>6&63):"=")+(typeof Xt!="undefined"?Dt.charAt(Qe&63):"=")}return ye?nt(Ye):Ye});var pt=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,vt=function(ve){switch(ve.length){case 4:var ye=(7&ve.charCodeAt(0))<<18|(63&ve.charCodeAt(1))<<12|(63&ve.charCodeAt(2))<<6|63&ve.charCodeAt(3),Ye=ye-65536;return pe((Ye>>>10)+55296)+pe((Ye&1023)+56320);case 3:return pe((15&ve.charCodeAt(0))<<12|(63&ve.charCodeAt(1))<<6|63&ve.charCodeAt(2));default:return pe((31&ve.charCodeAt(0))<<6|63&ve.charCodeAt(1))}},St=function(ve){return ve.replace(pt,vt)},Et=function(ve){var ye=ve.length,Ye=ye%4,Ze=(ye>0?ee[ve.charAt(0)]<<18:0)|(ye>1?ee[ve.charAt(1)]<<12:0)|(ye>2?ee[ve.charAt(2)]<<6:0)|(ye>3?ee[ve.charAt(3)]:0),qe=[pe(Ze>>>16),pe(Ze>>>8&255),pe(Ze&255)];return qe.length-=[0,0,2,1][Ye],qe.join("")},At=le.atob&&typeof le.atob=="function"?function(ve){return le.atob(ve)}:function(ve){return ve.replace(/\S{1,4}/g,Et)},It=function(ve){return At(String(ve).replace(/[^A-Za-z0-9\+\/]/g,""))},qt=function(ve){return St(At(ve))},Ut=function(ve){return String(ve).replace(/[-_]/g,function(ye){return ye=="-"?"+":"/"}).replace(/[^A-Za-z0-9\+\/]/g,"")},Gt=function(ve){return qt(Ut(ve))},ge;le.Uint8Array&&(ge=function(ve){return Uint8Array.from(It(Ut(ve)),function(ye){return ye.charCodeAt(0)})});var ie=function(){var ve=le.Base64;return le.Base64=we,ve};if(le.Base64={VERSION:ue,atob:It,btoa:Le,fromBase64:Gt,toBase64:et,utob:De,encode:et,encodeURI:ht,btou:St,decode:Gt,noConflict:ie,fromUint8Array:st,toUint8Array:ge},typeof Object.defineProperty=="function"){var Te=function(ve){return{value:ve,enumerable:!1,writable:!0,configurable:!0}};le.Base64.extendString=function(){Object.defineProperty(String.prototype,"fromBase64",Te(function(){return Gt(this)})),Object.defineProperty(String.prototype,"toBase64",Te(function(ve){return et(this,ve)})),Object.defineProperty(String.prototype,"toBase64URI",Te(function(){return et(this,!0)}))}}return le.Meteor&&(Base64=le.Base64),Mn.exports?Mn.exports.Base64=le.Base64:(ft=[],Kt=function(){return le.Base64}.apply(Rn,ft),Kt!==void 0&&(Mn.exports=Kt)),{Base64:le.Base64}})},2859:function(Mn,Rn,kt){"use strict";kt.d(Rn,{hP:function(){return Si}});var ft=function(Rt,Ft){return(ft=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,Ft)};function Kt(Rt,Ft){function Pt(){this.constructor=Rt}ft(Rt,Ft),Rt.prototype=Ft===null?Object.create(Ft):(Pt.prototype=Ft.prototype,new Pt)}function le(Rt,Ft,Pt,Nt){return new(Pt||(Pt=Promise))(function(zt,Mt){function Yt(Xe){try{_e(Nt.next(Xe))}catch(xe){Mt(xe)}}function He(Xe){try{_e(Nt.throw(Xe))}catch(xe){Mt(xe)}}function _e(Xe){var xe;Xe.done?zt(Xe.value):(xe=Xe.value,xe instanceof Pt?xe:new Pt(function(Pe){Pe(xe)})).then(Yt,He)}_e((Nt=Nt.apply(Rt,Ft||[])).next())})}function we(Rt,Ft){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:He(0),throw:He(1),return:He(2)},typeof Symbol=="function"&&(Mt[Symbol.iterator]=function(){return this}),Mt;function He(_e){return function(Xe){return function(xe){if(Pt)throw new TypeError("Generator is already executing.");for(;Yt;)try{if(Pt=1,Nt&&(zt=2&xe[0]?Nt.return:xe[0]?Nt.throw||((zt=Nt.return)&&zt.call(Nt),0):Nt.next)&&!(zt=zt.call(Nt,xe[1])).done)return zt;switch(Nt=0,zt&&(xe=[2&xe[0],zt.value]),xe[0]){case 0:case 1:zt=xe;break;case 4:return Yt.label++,{value:xe[1],done:!1};case 5:Yt.label++,Nt=xe[1],xe=[0];continue;case 7:xe=Yt.ops.pop(),Yt.trys.pop();continue;default:if(zt=Yt.trys,!((zt=zt.length>0&&zt[zt.length-1])||xe[0]!==6&&xe[0]!==2)){Yt=0;continue}if(xe[0]===3&&(!zt||xe[1]>zt[0]&&xe[1]<zt[3])){Yt.label=xe[1];break}if(xe[0]===6&&Yt.label<zt[1]){Yt.label=zt[1],zt=xe;break}if(zt&&Yt.label<zt[2]){Yt.label=zt[2],Yt.ops.push(xe);break}zt[2]&&Yt.ops.pop(),Yt.trys.pop();continue}xe=Ft.call(Rt,Yt)}catch(Pe){xe=[6,Pe],Nt=0}finally{Pt=zt=0}if(5&xe[0])throw xe[1];return{value:xe[0]?xe[1]:void 0,done:!0}}([_e,Xe])}}}function ue(){for(var Rt=0,Ft=0,Pt=arguments.length;Ft<Pt;Ft++)Rt+=arguments[Ft].length;var Nt=Array(Rt),zt=0;for(Ft=0;Ft<Pt;Ft++)for(var Mt=arguments[Ft],Yt=0,He=Mt.length;Yt<He;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(Ft,Pt){for(var Nt=0,zt=Pt;Nt<zt.length;Nt++){var Mt=zt[Nt],Yt=Mt[0],He=Mt[1];Ft.setAttribute(Yt,He)}},Rt.createRect=function(Ft,Pt,Nt){var zt=document.createElementNS("http://www.w3.org/2000/svg","rect");return zt.setAttribute("width",Ft.toString()),zt.setAttribute("height",Pt.toString()),Nt&&Rt.setAttributes(zt,Nt),zt},Rt.createLine=function(Ft,Pt,Nt,zt,Mt){var Yt=document.createElementNS("http://www.w3.org/2000/svg","line");return Yt.setAttribute("x1",Ft.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(Ft,Pt){var Nt=document.createElementNS("http://www.w3.org/2000/svg","polygon");return Nt.setAttribute("points",Ft),Pt&&Rt.setAttributes(Nt,Pt),Nt},Rt.createCircle=function(Ft,Pt){var Nt=document.createElementNS("http://www.w3.org/2000/svg","circle");return Nt.setAttribute("cx",(Ft/2).toString()),Nt.setAttribute("cy",(Ft/2).toString()),Nt.setAttribute("r",Ft.toString()),Pt&&Rt.setAttributes(Nt,Pt),Nt},Rt.createEllipse=function(Ft,Pt,Nt){var zt=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return zt.setAttribute("cx",(Ft/2).toString()),zt.setAttribute("cy",(Pt/2).toString()),zt.setAttribute("rx",(Ft/2).toString()),zt.setAttribute("ry",(Pt/2).toString()),Nt&&Rt.setAttributes(zt,Nt),zt},Rt.createGroup=function(Ft){var Pt=document.createElementNS("http://www.w3.org/2000/svg","g");return Ft&&Rt.setAttributes(Pt,Ft),Pt},Rt.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},Rt.createMarker=function(Ft,Pt,Nt,zt,Mt,Yt,He){var _e=document.createElementNS("http://www.w3.org/2000/svg","marker");return Rt.setAttributes(_e,[["id",Ft],["orient",Pt],["markerWidth",Nt.toString()],["markerHeight",zt.toString()],["refX",Mt.toString()],["refY",Yt.toString()]]),_e.appendChild(He),_e},Rt.createText=function(Ft){var Pt=document.createElementNS("http://www.w3.org/2000/svg","text");return Pt.setAttribute("x","0"),Pt.setAttribute("y","0"),Ft&&Rt.setAttributes(Pt,Ft),Pt},Rt.createTSpan=function(Ft,Pt){var Nt=document.createElementNS("http://www.w3.org/2000/svg","tspan");return Nt.textContent=Ft,Pt&&Rt.setAttributes(Nt,Pt),Nt},Rt.createImage=function(Ft){var Pt=document.createElementNS("http://www.w3.org/2000/svg","image");return Ft&&Rt.setAttributes(Pt,Ft),Pt},Rt.createPoint=function(Ft,Pt){var Nt=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return Nt.x=Ft,Nt.y=Pt,Nt},Rt.createPath=function(Ft,Pt){var Nt=document.createElementNS("http://www.w3.org/2000/svg","path");return Nt.setAttribute("d",Ft),Pt&&Rt.setAttributes(Nt,Pt),Nt},Rt}(),ee=function(){function Rt(){}return Rt.addKey=function(Ft){Rt.key=Ft},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}(),pe=function(){function Rt(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return Rt.prototype.rasterize=function(Ft,Pt,Nt){var zt=this;return new Promise(function(Mt){var Yt=Nt!==void 0?Nt:document.createElement("canvas");Ft===null&&(zt.markersOnly=!0,zt.naturalSize=!1);var He=document.createElementNS("http://www.w3.org/2000/svg","svg");He.setAttribute("xmlns","http://www.w3.org/2000/svg"),He.setAttribute("width",Pt.width.baseVal.valueAsString),He.setAttribute("height",Pt.height.baseVal.valueAsString),He.setAttribute("viewBox","0 0 "+Pt.viewBox.baseVal.width.toString()+" "+Pt.viewBox.baseVal.height.toString()),He.innerHTML=Pt.innerHTML,zt.naturalSize===!0?(He.width.baseVal.value=Ft.naturalWidth,He.height.baseVal.value=Ft.naturalHeight):zt.width!==void 0&&zt.height!==void 0&&(He.width.baseVal.value=zt.width,He.height.baseVal.value=zt.height),Yt.width=He.width.baseVal.value,Yt.height=He.height.baseVal.value;var _e=He.outerHTML,Xe=Yt.getContext("2d");zt.markersOnly!==!0&&Xe.drawImage(Ft,0,0,Yt.width,Yt.height);var xe=window.URL,Pe=new Image(Yt.width,Yt.height);Pe.setAttribute("crossOrigin","anonymous");var ke=new Blob([_e],{type:"image/svg+xml"}),Ve=xe.createObjectURL(ke);Pe.onload=function(){Xe.drawImage(Pe,0,0),xe.revokeObjectURL(Ve);var tn=Yt.toDataURL(zt.imageType,zt.imageQuality);Mt(tn)},Pe.src=Ve})},Rt}(),Jt=function(){},jt=function(){function Rt(Ft){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+Ft+"_"}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(Ft){return this.styleSheet===void 0&&this.addStyleSheet(),Ft.name=""+this.classNamePrefix+Ft.localName,this.classes.push(Ft),this.styleSheet.sheet.insertRule("."+Ft.name+" {"+Ft.style+"}",this.styleSheet.sheet.cssRules.length),Ft},Rt.prototype.addRule=function(Ft){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(Ft),this.styleSheet.sheet.insertRule(Ft.selector+" {"+Ft.style+"}",this.styleSheet.sheet.cssRules.length)},Rt.prototype.addStyleSheet=function(){var Ft;this.styleSheet=document.createElement("style"),((Ft=this.styleSheetRoot)!==null&&Ft!==void 0?Ft:document.head).appendChild(this.styleSheet),this.addRule(new De("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new De("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
|
|
from {
|
|
opacity: 0;
|
|
}
|
|
to {
|
|
opacity: 1;
|
|
}
|
|
`)),this.addRule(new De("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
|
|
from {
|
|
opacity: 1;
|
|
}
|
|
to {
|
|
opacity: 0;
|
|
}
|
|
`)),this.addClass(new ae("fade_in",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
|
|
`)),this.addClass(new ae("fade_out",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
|
|
`))},Rt.prototype.removeStyleSheet=function(){var Ft;this.styleSheet&&(((Ft=this.styleSheetRoot)!==null&&Ft!==void 0?Ft:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},Rt}(),De=function(Rt,Ft){this.selector=Rt,this.style=Ft},ae=function(Rt,Ft){this.localName=Rt,this.style=Ft},Le=function(){function Rt(Ft,Pt,Nt,zt,Mt){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=Ft,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(Ft){var Pt=this;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=Ft,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(Ft){this.buttonClickListeners.push(Ft)},Rt.prototype.removeButtonClickListener=function(Ft){this.buttonClickListeners.indexOf(Ft)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(Ft),1)},Rt.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},Rt.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var Ft=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<Ft||Pt===Ft&&this.markerButtons.length-1===Ft?this.markerButtonBlock.appendChild(this.markerButtons[Pt]):(Pt===Ft&&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 Ft=this;this.buttons.forEach(function(Pt){Pt.className=Pt.className.replace(Ft.uiStyleSettings.toolbarButtonStyleColorsClassName?Ft.uiStyleSettings.toolbarButtonStyleColorsClassName:Ft.toolbarButtonStyleColorsClass.name,"").trim(),Pt.className=Pt.className.replace(Ft.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?Ft.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:Ft.toolbarActiveButtonStyleColorsClass.name,"").trim(),Pt.className+=" "+(Ft.uiStyleSettings.toolbarButtonStyleColorsClassName?Ft.uiStyleSettings.toolbarButtonStyleColorsClassName:Ft.toolbarButtonStyleColorsClass.name)})},Rt.prototype.addActionButton=function(Ft,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}Ft.appendChild(Mt),this.buttons.push(Mt)},Rt.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new ae("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 ae("toolbar_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
|
|
`)),this.toolbarBlockStyleClass=this.styles.addClass(new ae("toolbar-block",`
|
|
display: inline-block;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new ae("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 ae("toolbar-overflow-block_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
`));var Ft=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new ae("toolbar_button",`
|
|
display: inline-block;
|
|
width: `+(this.uiStyleSettings.toolbarHeight-2*Ft)+`px;
|
|
height: `+(this.uiStyleSettings.toolbarHeight-2*Ft)+`px;
|
|
padding: `+Ft+`px;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new ae("toolbar_button_colors",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new ae("toolbar_active_button",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`)),this.styles.addRule(new De("."+this.toolbarButtonStyleClass.name+" svg",`
|
|
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
|
|
`)),this.styles.addRule(new De("."+this.toolbarButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`))},Rt.prototype.markerToolbarButtonClicked=function(Ft,Pt){this.setActiveButton(Ft),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(Nt){return Nt("marker",Pt)}),this.markerButtonOverflowBlock.style.display="none"},Rt.prototype.actionToolbarButtonClicked=function(Ft,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(Ft){this.resetButtonStyles(),Ft.className=Ft.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),Ft.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},Rt.prototype.setActiveMarkerButton=function(Ft){var Pt=this.markerButtons.find(function(Nt){return Nt.getAttribute("data-type-name")===Ft});Pt&&this.setActiveButton(Pt)},Rt.prototype.setCurrentMarker=function(Ft){var Pt=this;this.currentMarker=Ft,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(Ft,Pt,Nt,zt){this.panels=[],this.panelButtons=[],this.markerjsContainer=Ft,this.displayMode=Pt,this.uiStyleSettings=Nt,this.styles=zt,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return Rt.prototype.addStyles=function(){var Ft;this.toolboxStyleClass=this.styles.addClass(new ae("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 ae("toolbox_colors",`
|
|
color: `+this.uiStyleSettings.toolboxColor+`;
|
|
`));var Pt=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new ae("toolbox-button-row",`
|
|
display: flex;
|
|
cursor: default;
|
|
box-sizing: content-box;
|
|
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new ae("toolbox-button-row_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new ae("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 ae("toolbox-panel-row_colors",`
|
|
background-color: `+((Ft=this.uiStyleSettings.toolboxBackgroundColor)!==null&&Ft!==void 0?Ft:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
|
|
`)),this.toolboxButtonStyleClass=this.styles.addClass(new ae("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 ae("toolbox-button_colors",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new ae("toolbox-active-button_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.styles.addRule(new De("."+this.toolboxButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`)),this.styles.addRule(new De("."+this.toolboxButtonStyleClass.name+" svg",`
|
|
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
|
|
`))},Rt.prototype.show=function(Ft){var Pt;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=Ft,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(Ft){var Pt,Nt,zt=this;this.panels=Ft,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 He=document.createElement("div");He.className=zt.toolboxButtonStyleClass.name+" "+((Yt=zt.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&Yt!==void 0?Yt:zt.toolboxButtonStyleColorsClass.name),He.innerHTML=Mt.icon,He.title=Mt.title,He.addEventListener("click",function(){zt.panelButtonClick(Mt)}),zt.panelButtons.push(He),zt.buttonRow.appendChild(He)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},Rt.prototype.panelButtonClick=function(Ft){var Pt=this,Nt=-1;if(Ft!==this.activePanel){Nt=this.panels.indexOf(Ft),this.panelRow.innerHTML="";var zt=Ft.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=Ft}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 He,_e;Mt.className=Pt.toolboxButtonStyleClass.name+" "+(Yt===Nt?""+((He=Pt.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&He!==void 0?He:Pt.toolboxActiveButtonStyleColorsClass.name):""+((_e=Pt.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&_e!==void 0?_e:Pt.toolboxButtonStyleColorsClass.name))})},Rt}(),nt=function(Rt,Ft){this.title=Rt,this.icon=Ft},et=function(Rt){function Ft(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 Kt(Ft,Rt),Ft.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},Ft.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 He=document.createElement("div");return He.style.display="inline-block",He.style.width=Mt-2+"px",He.style.height=Mt-2+"px",He.style.backgroundColor=Pt,He.style.borderRadius=Mt/2+"px",Pt==="transparent"&&(He.style.fill=this.uiStyleSettings.toolboxAccentColor,He.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(He),Yt},Ft.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)},Ft}(nt),ht=function(){function Rt(Ft,Pt,Nt){this._state="new",this._isSelected=!1,this._container=Ft,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(Ft){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(Ft,Pt){},Rt.prototype.dblClick=function(Ft,Pt){},Rt.prototype.manipulate=function(Ft){},Rt.prototype.pointerUp=function(Ft){this.stateChanged()},Rt.prototype.dispose=function(){},Rt.prototype.addMarkerVisualToContainer=function(Ft){this.container.childNodes.length>0?this.container.insertBefore(Ft,this.container.childNodes[0]):this.container.appendChild(Ft)},Rt.prototype.getState=function(){return{typeName:Rt.typeName,state:this.state,notes:this.notes}},Rt.prototype.restoreState=function(Ft){this._state=Ft.state,this.notes=Ft.notes},Rt.prototype.scale=function(Ft,Pt){},Rt.prototype.colorChanged=function(Ft){this.onColorChanged&&this.onColorChanged(Ft),this.stateChanged()},Rt.prototype.fillColorChanged=function(Ft){this.onFillColorChanged&&this.onFillColorChanged(Ft),this.stateChanged()},Rt.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var Ft=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),Ft.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(Ft)&&this.onStateChanged(this)}},Rt.typeName="MarkerBase",Rt}(),st=function(){function Rt(){this.findGripByVisual=this.findGripByVisual.bind(this)}return Rt.prototype.findGripByVisual=function(Ft){return this.topLeft.ownsTarget(Ft)?this.topLeft:this.topCenter.ownsTarget(Ft)?this.topCenter:this.topRight.ownsTarget(Ft)?this.topRight:this.centerLeft.ownsTarget(Ft)?this.centerLeft:this.centerRight.ownsTarget(Ft)?this.centerRight:this.bottomLeft.ownsTarget(Ft)?this.bottomLeft:this.bottomCenter.ownsTarget(Ft)?this.bottomCenter:this.bottomRight.ownsTarget(Ft)?this.bottomRight:void 0},Rt}(),pt=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(Ft){return Ft===this.visual||Ft===this.visual.childNodes[0]||Ft===this.visual.childNodes[1]},Rt}(),vt=function(){function Rt(){}return Rt.toITransformMatrix=function(Ft){return{a:Ft.a,b:Ft.b,c:Ft.c,d:Ft.d,e:Ft.e,f:Ft.f}},Rt.toSVGMatrix=function(Ft,Pt){return Ft.a=Pt.a,Ft.b=Pt.b,Ft.c=Pt.c,Ft.d=Pt.d,Ft.e=Pt.e,Ft.f=Pt.f,Ft},Rt}(),St=function(Rt){function Ft(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 Kt(Ft,Rt),Object.defineProperty(Ft.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(Ft.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(Ft.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}),Ft.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))},Ft.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"},Ft.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)},Ft.prototype.moveVisual=function(Pt){this.visual.style.transform="translate("+Pt.x+"px, "+Pt.y+"px)"},Ft.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)},Ft.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()},Ft.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},Ft.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()}},Ft.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)},Ft.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}},Ft.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}},Ft.prototype.select=function(){Rt.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},Ft.prototype.deselect=function(){Rt.prototype.deselect.call(this),this.controlBox.style.display="none"},Ft.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"},Ft.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()},Ft.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()},Ft.prototype.createGrip=function(){var Pt=new pt;return Pt.visual.transform.baseVal.appendItem(Dt.createTransform()),this.controlBox.appendChild(Pt.visual),Pt},Ft.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,He=this.height+this.CB_DISTANCE-Pt/2,_e=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,_e,zt),this.positionGrip(this.controlGrips.centerLeft.visual,Nt,Yt),this.positionGrip(this.controlGrips.centerRight.visual,_e,Yt),this.positionGrip(this.controlGrips.bottomLeft.visual,Nt,He),this.positionGrip(this.controlGrips.bottomCenter.visual,Mt,He),this.positionGrip(this.controlGrips.bottomRight.visual,_e,He),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,Mt,zt-3*this.CB_DISTANCE)},Ft.prototype.positionGrip=function(Pt,Nt,zt){var Mt=Pt.transform.baseVal.getItem(0);Mt.setTranslate(Nt,zt),Pt.transform.baseVal.replaceItem(Mt,0)},Ft.prototype.hideControlBox=function(){this.controlBox.style.display="none"},Ft.prototype.showControlBox=function(){this.controlBox.style.display=""},Ft.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))},Ft.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))},Ft.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()},Ft}(ht),Et=function(Rt){function Ft(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 Kt(Ft,Rt),Ft.prototype.ownsTarget=function(Pt){return!(!Rt.prototype.ownsTarget.call(this,Pt)&&Pt!==this.visual)},Ft.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)},Ft.prototype.pointerDown=function(Pt,Nt){Rt.prototype.pointerDown.call(this,Pt,Nt),this.state==="new"&&(this.createVisual(),this.moveVisual(Pt),this._state="creating")},Ft.prototype.manipulate=function(Pt){Rt.prototype.manipulate.call(this,Pt)},Ft.prototype.resize=function(Pt){Rt.prototype.resize.call(this,Pt),this.setSize()},Ft.prototype.setSize=function(){Rt.prototype.setSize.call(this),Dt.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},Ft.prototype.pointerUp=function(Pt){Rt.prototype.pointerUp.call(this,Pt),this.setSize()},Ft.prototype.setStrokeColor=function(Pt){this.strokeColor=Pt,this.visual&&Dt.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(Pt),this.stateChanged()},Ft.prototype.setFillColor=function(Pt){this.fillColor=Pt,this.visual&&Dt.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},Ft.prototype.setStrokeWidth=function(Pt){this.strokeWidth=Pt,this.visual&&Dt.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},Ft.prototype.setStrokeDasharray=function(Pt){this.strokeDasharray=Pt,this.visual&&Dt.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},Ft.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))},Ft.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()},Ft.prototype.scale=function(Pt,Nt){Rt.prototype.scale.call(this,Pt,Nt),this.setSize()},Ft.title="Rectangle marker",Ft}(St),At=function(Rt){function Ft(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 Kt(Ft,Rt),Ft.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 He=document.createElement("div");He.style.minHeight="20px",He.style.flexGrow="2",He.style.display="flex",He.style.alignItems="center";var _e=document.createElement("hr");_e.style.minWidth="20px",_e.style.border="0px",_e.style.borderTop=zt+"px solid "+Pt.uiStyleSettings.toolboxColor,_e.style.flexGrow="2",He.appendChild(_e),Mt.appendChild(He),Pt.widthBoxes.push(Mt)}),Nt},Ft.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)},Ft}(nt),It=function(Rt){function Ft(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 Kt(Ft,Rt),Ft.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 He=`<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=He,Mt.appendChild(Yt),Pt.styleBoxes.push(Mt)}),Nt},Ft.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)},Ft}(nt),qt=function(Rt){function Ft(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 At("Line width",zt.defaultStrokeWidths,zt.defaultStrokeWidth),Mt.strokeWidthPanel.onWidthChanged=Mt.setStrokeWidth,Mt.strokeStylePanel=new It("Line style",zt.defaultStrokeDasharrays,zt.defaultStrokeDasharray),Mt.strokeStylePanel.onStyleChanged=Mt.setStrokeDasharray,Mt}return Kt(Ft,Rt),Object.defineProperty(Ft.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),Ft.prototype.getState=function(){var Pt=Rt.prototype.getState.call(this);return Pt.typeName=Ft.typeName,Pt},Ft.typeName="FrameMarker",Ft.title="Frame marker",Ft.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4m14 11H6V8h12v9z"/></svg>',Ft}(Et),Ut=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"},Gt=function(Rt){function Ft(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 Kt(Ft,Rt),Ft.prototype.ownsTarget=function(Pt){return!!Rt.prototype.ownsTarget.call(this,Pt)||!(!this.grip1.ownsTarget(Pt)&&!this.grip2.ownsTarget(Pt))},Ft.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")},Ft.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)},Ft.prototype.adjustVisual=function(){},Ft.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)},Ft.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()},Ft.prototype.select=function(){Rt.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},Ft.prototype.deselect=function(){Rt.prototype.deselect.call(this),this.controlBox.style.display="none"},Ft.prototype.setupControlBox=function(){this.controlBox=Dt.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},Ft.prototype.adjustControlBox=function(){this.positionGrips()},Ft.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},Ft.prototype.createGrip=function(){var Pt=new pt;return Pt.visual.transform.baseVal.appendItem(Dt.createTransform()),this.controlBox.appendChild(Pt.visual),Pt},Ft.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)},Ft.prototype.positionGrip=function(Pt,Nt,zt){var Mt=Pt.transform.baseVal.getItem(0);Mt.setTranslate(Nt,zt),Pt.transform.baseVal.replaceItem(Mt,0)},Ft.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},Rt.prototype.getState.call(this))},Ft.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},Ft.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()},Ft}(ht),ge=function(Rt){function Ft(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 At("Line width",zt.defaultStrokeWidths,zt.defaultStrokeWidth),Mt.strokeWidthPanel.onWidthChanged=Mt.setStrokeWidth,Mt.strokeStylePanel=new It("Line style",zt.defaultStrokeDasharrays,zt.defaultStrokeDasharray),Mt.strokeStylePanel.onStyleChanged=Mt.setStrokeDasharray,Mt}return Kt(Ft,Rt),Ft.prototype.ownsTarget=function(Pt){return!(!Rt.prototype.ownsTarget.call(this,Pt)&&Pt!==this.visual&&Pt!==this.selectorLine&&Pt!==this.visibleLine)},Ft.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)},Ft.prototype.pointerDown=function(Pt,Nt){Rt.prototype.pointerDown.call(this,Pt,Nt),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},Ft.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()]]))},Ft.prototype.setStrokeColor=function(Pt){this.strokeColor=Pt,this.adjustVisual(),this.colorChanged(Pt)},Ft.prototype.setStrokeWidth=function(Pt){this.strokeWidth=Pt,this.adjustVisual()},Ft.prototype.setStrokeDasharray=function(Pt){this.strokeDasharray=Pt,this.adjustVisual(),this.stateChanged()},Object.defineProperty(Ft.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),Ft.prototype.getState=function(){var Pt=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},Rt.prototype.getState.call(this));return Pt.typeName=Ft.typeName,Pt},Ft.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()},Ft.typeName="LineMarker",Ft.title="Line marker",Ft.icon='<svg viewBox="0 0 24 24"><path d="M19 13H5v-2h14v2z"/></svg>',Ft}(Gt),ie=function(Rt){function Ft(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 Kt(Ft,Rt),Ft.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 He=document.createElement("div");He.style.whiteSpace="nowrap",He.style.overflow="hidden",He.style.textOverflow="ellipsis",He.innerHTML="The quick brown fox jumps over the lazy dog",Yt.appendChild(He),Mt.appendChild(Yt),Pt.fontBoxes.push(Mt)}),Nt},Ft.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)},Ft}(nt),Te=function(Rt){function Ft(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 Kt(Ft,Rt),Ft.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},Ft.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()},Ft.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")},Ft.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)}},Ft.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},Ft.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}},Ft.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))},Ft.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)},Ft.prototype.resize=function(Pt){Rt.prototype.resize.call(this,Pt),this.isMoved=!0,this.setSize(),this.sizeText()},Ft.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()]]))},Ft.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},Ft.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")},Ft.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"}},Ft.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()},Ft.prototype.select=function(){Rt.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},Ft.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),Rt.prototype.deselect.call(this)},Ft.prototype.dblClick=function(Pt,Nt){Rt.prototype.dblClick.call(this,Pt,Nt),this.showTextEditor()},Ft.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)},Ft.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()},Ft.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},Ft.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(Ft.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),Ft.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=Ft.typeName,Pt},Ft.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()},Ft.prototype.scale=function(Pt,Nt){Rt.prototype.scale.call(this,Pt,Nt),this.setSize(),this.sizeText(),this.positionTextEditor()},Ft.typeName="TextMarker",Ft.title="Text marker",Ft.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>',Ft}(St),ve=function(Rt){function Ft(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 At("Line width",zt.defaultStrokeWidths,zt.defaultStrokeWidth),Mt.lineWidthPanel.onWidthChanged=Mt.setLineWidth,Mt}return Kt(Ft,Rt),Ft.prototype.ownsTarget=function(Pt){return!(!Rt.prototype.ownsTarget.call(this,Pt)&&Pt!==this.visual&&Pt!==this.drawingImage)},Ft.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)},Ft.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)},Ft.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)},Ft.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()]])},Ft.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)},Ft.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)},Ft.prototype.select=function(){this.state==="creating"&&this.finishCreation(),Rt.prototype.select.call(this)},Ft.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),Rt.prototype.deselect.call(this)},Ft.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],He=Nt[3],_e=!1,Xe=0;Xe<this.canvasElement.height;Xe++)for(var xe=0;xe<this.canvasElement.width;xe++)Pt.data[Xe*this.canvasElement.width*4+4*xe+3]>0&&(_e=!0,Xe<Mt&&(Mt=Xe),xe<zt&&(zt=xe),Xe>He&&(He=Xe),xe>Yt&&(Yt=xe));if(_e){this.left=zt/this.pixelRatio,this.top=Mt/this.pixelRatio,this.width=(Yt-zt)/this.pixelRatio,this.height=(He-Mt)/this.pixelRatio;var Pe=document.createElement("canvas");Pe.width=Yt-zt,Pe.height=He-Mt,Pe.getContext("2d").putImageData(this.canvasContext.getImageData(zt,Mt,Yt-zt,He-Mt),0,0),this.drawingImgUrl=Pe.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},Ft.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})},Ft.prototype.setColor=function(Pt){this.color=Pt,this.colorChanged(Pt)},Ft.prototype.setLineWidth=function(Pt){this.lineWidth=Pt},Object.defineProperty(Ft.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),Ft.prototype.getState=function(){var Pt=Object.assign({drawingImgUrl:this.drawingImgUrl},Rt.prototype.getState.call(this));return Pt.typeName=Ft.typeName,Pt},Ft.prototype.restoreState=function(Pt){this.createVisual(),Rt.prototype.restoreState.call(this,Pt),this.drawingImgUrl=Pt.drawingImgUrl,this.setDrawingImage()},Ft.prototype.scale=function(Pt,Nt){Rt.prototype.scale.call(this,Pt,Nt),this.setDrawingImage()},Ft.typeName="FreehandMarker",Ft.title="Freehand marker",Ft.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>',Ft}(St),ye=function(Rt){function Ft(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 Kt(Ft,Rt),Ft.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(He){var _e="both";switch(He){case 0:_e="both";break;case 1:_e="start";break;case 2:_e="end";break;case 3:_e="none"}var Xe=document.createElement("div");if(Xe.style.display="flex",Xe.style.flexGrow="2",Xe.style.alignItems="center",Xe.style.justifyContent="space-between",Xe.style.padding="5px",Xe.style.borderWidth="2px",Xe.style.borderStyle="solid",Xe.style.borderColor=_e===Mt.currentType?Mt.uiStyleSettings.toolboxAccentColor:"transparent",Xe.addEventListener("click",function(){Pt.setCurrentType(_e,Xe)}),Nt.appendChild(Xe),_e==="both"||_e==="start"){var xe=document.createElement("div");xe.style.display="flex",xe.style.alignItems="center",xe.style.minHeight="20px",xe.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>`,xe.style.marginLeft="5px",Xe.appendChild(xe)}var Pe=document.createElement("div");Pe.style.display="flex",Pe.style.alignItems="center",Pe.style.minHeight="20px",Pe.style.flexGrow="2";var ke=document.createElement("hr");if(ke.style.minWidth="20px",ke.style.border="0px",ke.style.borderTop="3px solid "+(Mt.uiStyleSettings!==void 0?Mt.uiStyleSettings.toolboxColor:"#eeeeee"),ke.style.flexGrow="2",Pe.appendChild(ke),Xe.appendChild(Pe),_e==="both"||_e==="end"){var Ve=document.createElement("div");Ve.style.display="flex",Ve.style.alignItems="center",Ve.style.minHeight="20px",Ve.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>`,Ve.style.marginRight="5px",Xe.appendChild(Ve)}Mt.typeBoxes.push(Xe)},Mt=this,Yt=0;Yt<4;Yt++)zt(Yt);return Nt},Ft.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)},Ft}(nt),Ye=function(Rt){function Ft(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 ye("Arrow type","end"),Mt.arrowTypePanel.onArrowTypeChanged=Mt.setArrowType,Mt}return Kt(Ft,Rt),Ft.prototype.ownsTarget=function(Pt){return!(!Rt.prototype.ownsTarget.call(this,Pt)&&Pt!==this.arrow1&&Pt!==this.arrow2)},Ft.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)},Ft.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)},Ft.prototype.pointerDown=function(Pt,Nt){Rt.prototype.pointerDown.call(this,Pt,Nt),this.state==="creating"&&this.createTips()},Ft.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)}},Ft.prototype.setArrowType=function(Pt){this.arrowType=Pt,this.adjustVisual(),this.stateChanged()},Object.defineProperty(Ft.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),Ft.prototype.getState=function(){var Pt=Object.assign({arrowType:this.arrowType},Rt.prototype.getState.call(this));return Pt.typeName=Ft.typeName,Pt},Ft.prototype.restoreState=function(Pt){Rt.prototype.restoreState.call(this,Pt);var Nt=Pt;this.arrowType=Nt.arrowType,this.createTips(),this.adjustVisual()},Ft.typeName="ArrowMarker",Ft.title="Arrow marker",Ft.icon='<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 7 15.59V9H5v10h10v-2H8.41L19 6.41z"/></svg>',Ft}(ge),Ze=function(Rt){function Ft(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 Kt(Ft,Rt),Object.defineProperty(Ft.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),Ft.prototype.getState=function(){var Pt=Rt.prototype.getState.call(this);return Pt.typeName=Ft.typeName,Pt},Ft.typeName="CoverMarker",Ft.title="Cover marker",Ft.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4z"/></svg>',Ft}(Et),qe=function(Rt){function Ft(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 Kt(Ft,Rt),Ft.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},Ft.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)},Ft}(nt),pn=function(Rt){function Ft(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 qe("Opacity",zt.defaultOpacitySteps,Mt.opacity),Mt.opacityPanel.onOpacityChanged=Mt.setOpacity,Mt}return Kt(Ft,Rt),Ft.prototype.setOpacity=function(Pt){this.opacity=Pt,this.visual&&Dt.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(Ft.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),Ft.prototype.getState=function(){var Pt=Rt.prototype.getState.call(this);return Pt.typeName=Ft.typeName,Pt},Ft.typeName="HighlightMarker",Ft.title="Highlight marker",Ft.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>',Ft}(Ze),te='<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>',Xt='<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>',Qe=function(Rt){function Ft(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,te),Mt.colorPanel.onColorChanged=Mt.setColor,Mt.bgColorPanel=new et("Fill color",zt.defaultColorSet,Mt.bgColor,Xt),Mt.bgColorPanel.onColorChanged=Mt.setBgColor,Mt.fontFamilyPanel=new ie("Font",zt.defaultFontFamilies,zt.defaultFontFamily),Mt.fontFamilyPanel.onFontChanged=Mt.setFont,Mt.tipGrip=new pt,Mt.tipGrip.visual.transform.baseVal.appendItem(Dt.createTransform()),Mt.controlBox.appendChild(Mt.tipGrip.visual),Mt}return Kt(Ft,Rt),Ft.prototype.ownsTarget=function(Pt){return Rt.prototype.ownsTarget.call(this,Pt)||this.tipGrip.ownsTarget(Pt)||this.tip===Pt},Ft.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)},Ft.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)},Ft.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()}},Ft.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)},Ft.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)},Ft.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},Ft.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})},Ft.prototype.resize=function(Pt){Rt.prototype.resize.call(this,Pt),this.positionTip()},Ft.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(Ft.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.bgColorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),Ft.prototype.select=function(){this.positionTip(),Rt.prototype.select.call(this)},Ft.prototype.getState=function(){var Pt=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},Rt.prototype.getState.call(this));return Pt.typeName=Ft.typeName,Pt},Ft.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()},Ft.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()},Ft.typeName="CalloutMarker",Ft.title="Callout marker",Ft.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>',Ft}(Te),On=function(Rt){function Ft(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",ue(zt.defaultColorSet,["transparent"]),zt.defaultColor),Mt.strokePanel.onColorChanged=Mt.setStrokeColor,Mt.fillPanel=new et("Fill color",ue(zt.defaultColorSet,["transparent"]),Mt.fillColor,Xt),Mt.fillPanel.onColorChanged=Mt.setFillColor,Mt.strokeWidthPanel=new At("Line width",zt.defaultStrokeWidths,zt.defaultStrokeWidth),Mt.strokeWidthPanel.onWidthChanged=Mt.setStrokeWidth,Mt.strokeStylePanel=new It("Line style",zt.defaultStrokeDasharrays,zt.defaultStrokeDasharray),Mt.strokeStylePanel.onStyleChanged=Mt.setStrokeDasharray,Mt.opacityPanel=new qe("Opacity",zt.defaultOpacitySteps,Mt.opacity),Mt.opacityPanel.onOpacityChanged=Mt.setOpacity,Mt}return Kt(Ft,Rt),Ft.prototype.ownsTarget=function(Pt){return!(!Rt.prototype.ownsTarget.call(this,Pt)&&Pt!==this.visual)},Ft.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)},Ft.prototype.pointerDown=function(Pt,Nt){Rt.prototype.pointerDown.call(this,Pt,Nt),this.state==="new"&&(this.createVisual(),this.moveVisual(Pt),this._state="creating")},Ft.prototype.manipulate=function(Pt){Rt.prototype.manipulate.call(this,Pt)},Ft.prototype.resize=function(Pt){Rt.prototype.resize.call(this,Pt),this.setSize()},Ft.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()]])},Ft.prototype.pointerUp=function(Pt){Rt.prototype.pointerUp.call(this,Pt),this.setSize()},Ft.prototype.setStrokeColor=function(Pt){this.strokeColor=Pt,this.visual&&Dt.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(Pt),this.stateChanged()},Ft.prototype.setFillColor=function(Pt){this.fillColor=Pt,this.visual&&Dt.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(Pt),this.stateChanged()},Ft.prototype.setStrokeWidth=function(Pt){this.strokeWidth=Pt,this.visual&&Dt.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},Ft.prototype.setStrokeDasharray=function(Pt){this.strokeDasharray=Pt,this.visual&&Dt.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},Ft.prototype.setOpacity=function(Pt){this.opacity=Pt,this.visual&&Dt.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(Ft.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),Ft.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=Ft.typeName,Pt},Ft.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()},Ft.prototype.scale=function(Pt,Nt){Rt.prototype.scale.call(this,Pt,Nt),this.setSize()},Ft.typeName="EllipseMarker",Ft.title="Ellipse marker",Ft.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>',Ft}(St),En=function(Rt){function Ft(Pt,Nt,zt){return Rt.call(this,Pt,Nt,zt)||this}return Kt(Ft,Rt),Object.defineProperty(Ft.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),Ft.prototype.ownsTarget=function(Pt){return!(!Rt.prototype.ownsTarget.call(this,Pt)&&Pt!==this.tip1&&Pt!==this.tip2)},Ft.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)},Ft.prototype.pointerDown=function(Pt,Nt){Rt.prototype.pointerDown.call(this,Pt,Nt),this.state==="creating"&&this.createTips()},Ft.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(Ft.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),Ft.prototype.getState=function(){var Pt=Rt.prototype.getState.call(this);return Pt.typeName=Ft.typeName,Pt},Ft.prototype.restoreState=function(Pt){Rt.prototype.restoreState.call(this,Pt),this.createTips(),this.adjustVisual()},Ft.typeName="MeasurementMarker",Ft.title="Measurement marker",Ft.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>',Ft}(ge),Ie=function(Rt){function Ft(Pt,Nt,zt){var Mt=Rt.call(this,Pt,Nt,zt)||this;return Mt.strokePanel.colors=zt.defaultColorSet,Mt.fillColor="transparent",Mt}return Kt(Ft,Rt),Object.defineProperty(Ft.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),Ft.prototype.getState=function(){var Pt=Rt.prototype.getState.call(this);return Pt.typeName=Ft.typeName,Pt},Ft.typeName="EllipseFrameMarker",Ft.title="Ellipse frame marker",Ft.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>',Ft}(On),on=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(Ft){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(Ft)||(this.undoStack.push(Ft),JSON.stringify(this.lastRedoStep)!==JSON.stringify(Ft)&&this.redoStack.splice(0,this.redoStack.length))},Rt.prototype.replaceLastUndoStep=function(Ft){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=Ft)},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 Ft=this.undoStack.pop();return Ft!==void 0&&this.redoStack.push(Ft),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}(),cn=function(Rt){function Ft(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 At("Line width",zt.defaultStrokeWidths,zt.defaultStrokeWidth),Mt.strokeWidthPanel.onWidthChanged=Mt.setStrokeWidth,Mt.strokeStylePanel=new It("Line style",zt.defaultStrokeDasharrays,zt.defaultStrokeDasharray),Mt.strokeStylePanel.onStyleChanged=Mt.setStrokeDasharray,Mt}return Kt(Ft,Rt),Ft.prototype.ownsTarget=function(Pt){return!(!Rt.prototype.ownsTarget.call(this,Pt)&&Pt!==this.visual&&Pt!==this.selectorCurve&&Pt!==this.visibleCurve&&!this.curveGrip.ownsTarget(Pt))},Ft.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},Ft.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)},Ft.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")},Ft.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()]]))},Ft.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)},Ft.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,Rt.prototype.addControlGrips.call(this)},Ft.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()))},Ft.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)},Ft.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)},Ft.prototype.setStrokeColor=function(Pt){this.strokeColor=Pt,this.adjustVisual(),this.colorChanged(Pt)},Ft.prototype.setStrokeWidth=function(Pt){this.strokeWidth=Pt,this.adjustVisual()},Ft.prototype.setStrokeDasharray=function(Pt){this.strokeDasharray=Pt,this.adjustVisual()},Ft.prototype.scale=function(Pt,Nt){this.curveX=this.curveX*Pt,this.curveY=this.curveY*Nt,Rt.prototype.scale.call(this,Pt,Nt)},Object.defineProperty(Ft.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),Ft.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=Ft.typeName,Pt},Ft.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()},Ft.typeName="CurveMarker",Ft.title="Curve marker",Ft.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>',Ft}(Gt),Vn=function(Rt){function Ft(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",ue(zt.defaultColorSet,["transparent"]),Mt.strokeColor),Mt.strokePanel.onColorChanged=Mt.setStrokeColor,Mt.fillPanel=new et("Fill color",ue(zt.defaultColorSet,["transparent"]),Mt.fillColor,Xt),Mt.fillPanel.onColorChanged=Mt.setFillColor,Mt.strokeWidthPanel=new At("Line width",zt.defaultStrokeWidths,zt.defaultStrokeWidth),Mt.strokeWidthPanel.onWidthChanged=Mt.setStrokeWidth,Mt.strokeStylePanel=new It("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,te),Mt.textColorPanel.onColorChanged=Mt.setTextColor,Mt}return Kt(Ft,Rt),Ft.prototype.ownsTarget=function(Pt){return!(!Rt.prototype.ownsTarget.call(this,Pt)&&Pt!==this.visual&&Pt!==this.frame&&Pt!==this.captionBg&&Pt!==this.captionElement)},Ft.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()},Ft.prototype.setCaptionText=function(Pt){this.captionText=Pt,this.captionElement.textContent=this.captionText,this.sizeCaption()},Ft.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")},Ft.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)},Ft.prototype.resize=function(Pt){Rt.prototype.resize.call(this,Pt),this.setSize()},Ft.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')"]])},Ft.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()},Ft.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"))},Ft.prototype.finishTextEditing=function(Pt){this.setCaptionText(Pt.trim()),this.overlayContainer.innerHTML="",this.stateChanged()},Ft.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()},Ft.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()},Ft.prototype.setSize=function(){Rt.prototype.setSize.call(this),Dt.setAttributes(this.frame,[["width",this.width.toString()],["height",this.height.toString()]]),this.sizeCaption()},Ft.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},Ft.prototype.dblClick=function(Pt,Nt){Rt.prototype.dblClick.call(this,Pt,Nt),this.showTextEditor()},Ft.prototype.setStrokeColor=function(Pt){this.strokeColor=Pt,this.frame&&Dt.setAttributes(this.frame,[["stroke",this.strokeColor]]),this.colorChanged(Pt),this.stateChanged()},Ft.prototype.setFillColor=function(Pt){this.fillColor=Pt,this.captionBg&&Dt.setAttributes(this.captionBg,[["fill",this.fillColor]]),this.fillColorChanged(Pt),this.stateChanged()},Ft.prototype.setStrokeWidth=function(Pt){this.strokeWidth=Pt,this.frame&&Dt.setAttributes(this.frame,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},Ft.prototype.setStrokeDasharray=function(Pt){this.strokeDasharray=Pt,this.frame&&Dt.setAttributes(this.frame,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},Object.defineProperty(Ft.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.fontFamilyPanel,this.textColorPanel]},enumerable:!1,configurable:!0}),Ft.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},Ft.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()},Ft.prototype.scale=function(Pt,Nt){Rt.prototype.scale.call(this,Pt,Nt),this.setSize()},Ft.typeName="CaptionFrameMarker",Ft.title="Caption frame marker",Ft.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>',Ft}(St),Me=function(){function Rt(Ft,Pt){Pt===void 0&&(Pt=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=Ft,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}(),he=function(Rt){function Ft(Pt,Nt,zt){var Mt=Rt.call(this,Pt,!1)||this;return Mt.dataUrl=Nt,Mt.state=zt,Mt}return Kt(Ft,Rt),Ft}(Me),Ce=function(Rt){function Ft(Pt,Nt,zt){zt===void 0&&(zt=!1);var Mt=Rt.call(this,Pt,zt)||this;return Mt.marker=Nt,Mt}return Kt(Ft,Rt),Ft}(Me),Yn=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(Ft,Pt){this[Ft].push(Pt)},Rt.prototype.removeEventListener=function(Ft,Pt){var Nt=this[Ft].indexOf(Pt);Nt>-1&&this[Ft].splice(Nt,1)},Rt}(),Si=function(){function Rt(Ft){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new Ut,this._isOpen=!1,this.undoRedoManager=new on,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 Yn,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=Rt.instanceCounter++,this.styles=new jt(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=Ft,this.targetRoot=document.body,this.width=Ft.clientWidth,this.height=Ft.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[qt,ve,Ye,Te,Ie,On,pn,Qe,En,Ze,ge,cn,Vn]},enumerable:!1,configurable:!0}),Object.defineProperty(Rt.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[qt,ve,Ye,Te,On,pn,Qe]},enumerable:!1,configurable:!0}),Object.defineProperty(Rt.prototype,"BASIC_MARKER_TYPES",{get:function(){return[qt,ve,Ye,Te,pn]},enumerable:!1,configurable:!0}),Object.defineProperty(Rt.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(Ft){var Pt=this;this._availableMarkerTypes.splice(0),Ft.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(Ft){this._zoomLevel=Ft,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(),ee.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},Rt.prototype.show=function(){var Ft=this;this.styles.styleSheetRoot===void 0&&Jt.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=Jt.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(Pt){return Pt(new Me(Ft))})},Rt.prototype.render=function(){return le(this,void 0,void 0,function(){var Ft;return we(this,function(Pt){switch(Pt.label){case 0:return this.setCurrentMarker(),(Ft=new pe).naturalSize=this.renderAtNaturalSize,Ft.imageType=this.renderImageType,Ft.imageQuality=this.renderImageQuality,Ft.markersOnly=this.renderMarkersOnly,Ft.width=this.renderWidth,Ft.height=this.renderHeight,[4,Ft.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return Pt.sent(),[4,Ft.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,Pt.sent()]}})})},Rt.prototype.close=function(Ft){var Pt=this;if(Ft===void 0&&(Ft=!1),this.isOpen){var Nt=!1;Ft||this.eventListeners.beforeclose.forEach(function(zt){var Mt=new Me(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 Me(Pt))}),this.detachEvents(),this._isOpen=!1)}},Rt.prototype.addMarkersToToolbar=function(){for(var Ft,Pt=[],Nt=0;Nt<arguments.length;Nt++)Pt[Nt]=arguments[Nt];(Ft=this._availableMarkerTypes).push.apply(Ft,Pt)},Rt.prototype.addRenderEventListener=function(Ft){this.addEventListener("render",function(Pt){Ft(Pt.dataUrl,Pt.state)})},Rt.prototype.removeRenderEventListener=function(Ft){},Rt.prototype.addCloseEventListener=function(Ft){this.addEventListener("close",function(){Ft()})},Rt.prototype.removeCloseEventListener=function(Ft){},Rt.prototype.setupResizeObserver=function(){var Ft=this;this.settings.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){Ft.resize(Ft.target.clientWidth,Ft.target.clientHeight)}),this.targetObserver.observe(this.target)):this.settings.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){return Ft.onPopupTargetResize()}),this.targetObserver.observe(this.editorCanvas)),window.addEventListener("resize",this.setWindowHeight))},Rt.prototype.onPopupTargetResize=function(){var Ft=1*this.target.clientWidth/this.target.clientHeight,Pt=this.editorCanvas.clientWidth/Ft>this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*Ft:this.editorCanvas.clientWidth,Nt=Pt<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/Ft;this.resize(Pt,Nt)},Rt.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},Rt.prototype.resize=function(Ft,Pt){this._isResizing=!0;var Nt=Ft/this.imageWidth,zt=Pt/this.imageHeight;this.imageWidth=Math.round(Ft),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(Ft,Pt){var Nt,zt=this;this._currentMarker&&this._currentMarker instanceof Te?this._currentMarker.scale(Ft,Pt):(Nt=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function(Mt){Mt!==zt._currentMarker&&Mt.scale(Ft,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 Ft=this.editingTarget.getBoundingClientRect(),Pt=this.editorCanvas.getBoundingClientRect();this.left=Ft.left-Pt.left,this.top=Ft.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 Ft,Pt=[],Nt=0;Nt<arguments.length;Nt++)Pt[Nt]=arguments[Nt];this.defs=Dt.createDefs(),this.addDefsToImage(),(Ft=this.defs).append.apply(Ft,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 Ft=document.createElement("a");Ft.href="https://markerjs.com/",Ft.target="_blank",Ft.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>',Ft.title="Powered by marker.js",Ft.style.display="grid",Ft.style.alignItems="center",Ft.style.justifyItems="center",Ft.style.padding="3px",Ft.style.width="20px",Ft.style.height="20px",this.logoUI.appendChild(Ft),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 Ft=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=Ft+"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 Le(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(Ft){this.markerImage.removeChild(Ft.container),this.markers.indexOf(Ft)>-1&&this.markers.splice(this.markers.indexOf(Ft),1),Ft.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(Ft,Pt){if(Ft==="marker"&&Pt!==void 0)this.createNewMarker(Pt);else if(Ft==="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 Ft=this;if(this._currentMarker!==void 0){var Pt=!1;if(this.eventListeners.markerbeforedelete.forEach(function(zt){var Mt=new Ce(Ft,Ft._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 Ce(Ft,Nt))})}}},Rt.prototype.clear=function(){var Ft=this,Pt=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(Yt){var He=new Ce(Ft,void 0,!0);Yt(He),He.defaultPrevented&&(Pt=!0)}),!Pt)){this.setCurrentMarker();for(var Nt=function(Yt){var He=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(_e){return _e(new Ce(Ft,He))})},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 Ft;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=(Ft=this._currentMarker.notes)!==null&&Ft!==void 0?Ft:"",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 Ft=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 Me(Ft))})}else this.undoRedoManager.replaceLastUndoStep(Pt),this.eventListeners.statechange.forEach(function(Mt){return Mt(new Me(Ft))})}},Rt.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},Rt.prototype.undoStep=function(){var Ft=this,Pt=this.undoRedoManager.undo();Pt!==void 0&&(this.restoreState(Pt),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(Nt){return Nt(new Me(Ft))}))},Rt.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},Rt.prototype.redoStep=function(){var Ft=this,Pt=this.undoRedoManager.redo();Pt!==void 0&&(this.restoreState(Pt),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(Nt){return Nt(new Me(Ft))}))},Rt.prototype.stepZoom=function(){var Ft=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=Ft<this.zoomSteps.length-1?this.zoomSteps[Ft+1]:this.zoomSteps[0]},Rt.prototype.panTo=function(Ft){this.contentDiv.scrollBy({left:this.prevPanPoint.x-Ft.x,top:this.prevPanPoint.y-Ft.y}),this.prevPanPoint=Ft},Rt.prototype.startRenderAndClose=function(){return le(this,void 0,void 0,function(){var Ft,Pt,Nt=this;return we(this,function(zt){switch(zt.label){case 0:return[4,this.render()];case 1:return Ft=zt.sent(),Pt=this.getState(),this.eventListeners.render.forEach(function(Mt){return Mt(new he(Nt,Ft,Pt))}),this.close(!0),[2]}})})},Rt.prototype.getState=function(Ft){Ft===!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(Ft){var Pt=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);Ft.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)}}),Ft.width&&Ft.height&&(Ft.width!==this.imageWidth||Ft.height!==this.imageHeight)&&this.scaleMarkers(this.imageWidth/Ft.width,this.imageHeight/Ft.height),this.eventListeners.restorestate.forEach(function(Nt){return Nt(new Me(Pt))})},Rt.prototype.addNewMarker=function(Ft){var Pt=Dt.createGroup();return this.markerImage.appendChild(Pt),new Ft(Pt,this.overlayContainer,this.settings)},Rt.prototype.createNewMarker=function(Ft){var Pt,Nt=this;(Pt=typeof Ft=="string"?this._availableMarkerTypes.find(function(zt){return zt.typeName===Ft}):Ft)&&(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 Ce(Nt,Nt._currentMarker))}))},Rt.prototype.markerCreated=function(Ft){var Pt=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(Ft),this.setCurrentMarker(Ft),Ft instanceof ve&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(ve):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(Nt){return Nt(new Ce(Pt,Pt._currentMarker))})},Rt.prototype.colorChanged=function(Ft){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=Ft,this.settings.defaultStrokeColor=Ft)},Rt.prototype.fillColorChanged=function(Ft){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=Ft)},Rt.prototype.markerStateChanged=function(Ft){var Pt=this;this.eventListeners.markerchange.forEach(function(Nt){return Nt(new Ce(Pt,Ft))})},Rt.prototype.setCurrentMarker=function(Ft){var Pt=this;this._currentMarker!==Ft&&this._currentMarker!==void 0&&(this._currentMarker.deselect(),this.toolbar.setCurrentMarker(),this.toolbox.setPanelButtons([]),this._isResizing||this.eventListeners.markerdeselect.forEach(function(Nt){return Nt(new Ce(Pt,Pt._currentMarker))})),this._currentMarker=Ft,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 Ce(Pt,Pt._currentMarker))}))},Rt.prototype.onPointerDown=function(Ft){if(this._isFocused||this.focus(),this.touchPoints++,this.touchPoints===1||Ft.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(Ft.target)});Pt!==void 0?(this.setCurrentMarker(Pt),this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(Ft.clientX,Ft.clientY),Ft.target)):(this.setCurrentMarker(),this.isDragging=!0,this.prevPanPoint={x:Ft.clientX,y:Ft.clientY})}}else this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(Ft.clientX,Ft.clientY))},Rt.prototype.onDblClick=function(Ft){if(this._isFocused||this.focus(),this.mode==="select"){var Pt=this.markers.find(function(Nt){return Nt.ownsTarget(Ft.target)});Pt!==void 0&&Pt!==this._currentMarker&&this.setCurrentMarker(Pt),this._currentMarker!==void 0?this._currentMarker.dblClick(this.clientToLocalCoordinates(Ft.clientX,Ft.clientY),Ft.target):this.setCurrentMarker()}},Rt.prototype.onPointerMove=function(Ft){this.touchPoints!==1&&Ft.pointerType==="touch"||(this._currentMarker!==void 0||this.isDragging)&&(this._currentMarker!==void 0&&this._currentMarker.state==="edit"||Ft.preventDefault(),this._currentMarker!==void 0?this._currentMarker.manipulate(this.clientToLocalCoordinates(Ft.clientX,Ft.clientY)):this.zoomLevel>1&&this.panTo({x:Ft.clientX,y:Ft.clientY}))},Rt.prototype.onPointerUp=function(Ft){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(Ft.clientX,Ft.clientY)),this.isDragging=!1,this.addUndoStep()},Rt.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},Rt.prototype.onKeyUp=function(Ft){this._currentMarker===void 0||this.notesArea!==void 0||Ft.key!=="Delete"&&Ft.key!=="Backspace"||this.deleteSelectedMarker()},Rt.prototype.clientToLocalCoordinates=function(Ft,Pt){var Nt=this.markerImage.getBoundingClientRect();return{x:(Ft-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 Ft=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=Ft+"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(Ft){ee.addKey(Ft)},Rt.prototype.addEventListener=function(Ft,Pt){this.eventListeners.addEventListener(Ft,Pt)},Rt.prototype.removeEventListener=function(Ft,Pt){this.eventListeners.removeEventListener(Ft,Pt)},Rt.prototype.renderState=function(Ft){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(Ft),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(Rt.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),Rt.prototype.focus=function(){var Ft=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 Me(Ft))}))},Rt.prototype.blur=function(){var Ft=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(Pt){return Pt(new Me(Ft))}))},Rt.instanceCounter=0,Rt}()},63727:function(Mn,Rn,kt){"use strict";kt.d(Rn,{s:function(){return xe},default:function(){return ni}});var ft=kt(14809),Kt=kt(20439),le=kt(95190),we=kt(50298),ue=kt(62646),Dt=kt(37463),ee=kt(6551),pe=kt(6089),Jt=kt(18929),jt=kt(59301),De=jt.createContext({}),ae=De,Le=kt(93664),Bt=kt(4635),nt="__rc_cascader_search_mark__",et=function(Ke,nn,Qn){var gn=Qn.label,an=gn===void 0?"":gn;return nn.some(function(zn){return String(zn[an]).toLowerCase().includes(Ke.toLowerCase())})},ht=function(Ke,nn,Qn,gn){return nn.map(function(an){return an[gn.label]}).join(" / ")},st=function(Ke,nn,Qn,gn,an,zn){var gi=an.filter,ti=gi===void 0?et:gi,wi=an.render,Wi=wi===void 0?ht:wi,Cn=an.limit,Pn=Cn===void 0?50:Cn,Bn=an.sort;return jt.useMemo(function(){var si=[];if(!Ke)return[];function Ei(ci,Zi){var wt=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;ci.forEach(function(Je){if(!(!Bn&&Pn!==!1&&Pn>0&&si.length>=Pn)){var Hn=[].concat((0,le.Z)(Zi),[Je]),Ln=Je[Qn.children],jn=wt||Je.disabled;if((!Ln||Ln.length===0||zn)&&ti(Ke,Hn,{label:Qn.label})){var li;si.push((0,Kt.Z)((0,Kt.Z)({},Je),{},(li={disabled:jn},(0,Bt.Z)(li,Qn.label,Wi(Ke,Hn,gn,Qn)),(0,Bt.Z)(li,nt,Hn),(0,Bt.Z)(li,Qn.children,void 0),li)))}Ln&&Ei(Je[Qn.children],Hn,jn)}})}return Ei(nn,[]),Bn&&si.sort(function(ci,Zi){return Bn(ci[nt],Zi[nt],Ke,Qn)}),Pn!==!1&&Pn>0?si.slice(0,Pn):si},[Ke,nn,Qn,gn,Wi,zn,ti,Bn,Pn])},pt=st,vt="__RC_CASCADER_SPLIT__",St="SHOW_PARENT",Et="SHOW_CHILD";function At(Ge){return Ge.join(vt)}function It(Ge){return Ge.map(At)}function qt(Ge){return Ge.split(vt)}function Ut(Ge){var Ke=Ge||{},nn=Ke.label,Qn=Ke.value,gn=Ke.children,an=Qn||"value";return{label:nn||"label",value:an,key:an,children:gn||"children"}}function Gt(Ge,Ke){var nn,Qn;return(nn=Ge.isLeaf)!==null&&nn!==void 0?nn:!((Qn=Ge[Ke.children])!==null&&Qn!==void 0&&Qn.length)}function ge(Ge){var Ke=Ge.parentElement;if(Ke){var nn=Ge.offsetTop-Ke.offsetTop;nn-Ke.scrollTop<0?Ke.scrollTo({top:nn}):nn+Ge.offsetHeight-Ke.scrollTop>Ke.offsetHeight&&Ke.scrollTo({top:nn+Ge.offsetHeight-Ke.offsetHeight})}}function ie(Ge,Ke){return Ge.map(function(nn){var Qn;return(Qn=nn[nt])===null||Qn===void 0?void 0:Qn.map(function(gn){return gn[Ke.value]})})}function Te(Ge){return Array.isArray(Ge)&&Array.isArray(Ge[0])}function ve(Ge){return Ge?Te(Ge)?Ge:(Ge.length===0?[]:[Ge]).map(function(Ke){return Array.isArray(Ke)?Ke:[Ke]}):[]}function ye(Ge,Ke,nn){var Qn=new Set(Ge),gn=Ke();return Ge.filter(function(an){var zn=gn[an],gi=zn?zn.parent:null,ti=zn?zn.children:null;return zn&&zn.node.disabled?!0:nn===Et?!(ti&&ti.some(function(wi){return wi.key&&Qn.has(wi.key)})):!(gi&&!gi.node.disabled&&Qn.has(gi.key))})}function Ye(Ge,Ke,nn){for(var Qn=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,gn=Ke,an=[],zn=function(){var wi,Wi,Cn,Pn=Ge[gi],Bn=(wi=gn)===null||wi===void 0?void 0:wi.findIndex(function(Ei){var ci=Ei[nn.value];return Qn?String(ci)===String(Pn):ci===Pn}),si=Bn!==-1?(Wi=gn)===null||Wi===void 0?void 0:Wi[Bn]:null;an.push({value:(Cn=si==null?void 0:si[nn.value])!==null&&Cn!==void 0?Cn:Pn,index:Bn,option:si}),gn=si==null?void 0:si[nn.children]},gi=0;gi<Ge.length;gi+=1)zn();return an}var Ze=function(Ge,Ke,nn,Qn,gn){return jt.useMemo(function(){var an=gn||function(zn){var gi=Qn?zn.slice(-1):zn,ti=" / ";return gi.every(function(wi){return["string","number"].includes((0,Le.Z)(wi))})?gi.join(ti):gi.reduce(function(wi,Wi,Cn){var Pn=jt.isValidElement(Wi)?jt.cloneElement(Wi,{key:Cn}):Wi;return Cn===0?[Pn]:[].concat((0,le.Z)(wi),[ti,Pn])},[])};return Ge.map(function(zn){var gi,ti=Ye(zn,Ke,nn),wi=an(ti.map(function(Cn){var Pn,Bn=Cn.option,si=Cn.value;return(Pn=Bn==null?void 0:Bn[nn.label])!==null&&Pn!==void 0?Pn:si}),ti.map(function(Cn){var Pn=Cn.option;return Pn})),Wi=At(zn);return{label:wi,value:Wi,key:Wi,valueCells:zn,disabled:(gi=ti[ti.length-1])===null||gi===void 0||(gi=gi.option)===null||gi===void 0?void 0:gi.disabled}})},[Ge,Ke,nn,gn,Qn])};function qe(Ge,Ke){return jt.useCallback(function(nn){var Qn=[],gn=[];return nn.forEach(function(an){var zn=Ye(an,Ge,Ke);zn.every(function(gi){return gi.option})?gn.push(an):Qn.push(an)}),[gn,Qn]},[Ge,Ke])}var pn=kt(34061),te=function(Ge,Ke){var nn=jt.useRef({options:[],info:{keyEntities:{},pathKeyEntities:{}}}),Qn=jt.useCallback(function(){return nn.current.options!==Ge&&(nn.current.options=Ge,nn.current.info=(0,pn.I8)(Ge,{fieldNames:Ke,initWrapper:function(an){return(0,Kt.Z)((0,Kt.Z)({},an),{},{pathKeyEntities:{}})},processEntity:function(an,zn){var gi=an.nodes.map(function(ti){return ti[Ke.value]}).join(vt);zn.pathKeyEntities[gi]=an,an.key=gi}})),nn.current.info.pathKeyEntities},[Ke,Ge]);return Qn};function Xt(Ge,Ke){var nn=jt.useMemo(function(){return Ke||[]},[Ke]),Qn=te(nn,Ge),gn=jt.useCallback(function(an){var zn=Qn();return an.map(function(gi){var ti=zn[gi].nodes;return ti.map(function(wi){return wi[Ge.value]})})},[Qn,Ge]);return[nn,Qn,gn]}var Qe=kt(48736);function On(Ge){return jt.useMemo(function(){if(!Ge)return[!1,{}];var Ke={matchInputWidth:!0,limit:50};return Ge&&(0,Le.Z)(Ge)==="object"&&(Ke=(0,Kt.Z)((0,Kt.Z)({},Ke),Ge)),Ke.limit<=0&&(Ke.limit=!1),[!0,Ke]},[Ge])}var En=kt(34643);function Ie(Ge,Ke,nn,Qn,gn,an,zn,gi){return function(ti){if(!Ge)Ke(ti);else{var wi=At(ti),Wi=It(nn),Cn=It(Qn),Pn=Wi.includes(wi),Bn=gn.some(function(jn){return At(jn)===wi}),si=nn,Ei=gn;if(Bn&&!Pn)Ei=gn.filter(function(jn){return At(jn)!==wi});else{var ci=Pn?Wi.filter(function(jn){return jn!==wi}):[].concat((0,le.Z)(Wi),[wi]),Zi=an(),wt;if(Pn){var Je=(0,En.S)(ci,{checked:!1,halfCheckedKeys:Cn},Zi);wt=Je.checkedKeys}else{var Hn=(0,En.S)(ci,!0,Zi);wt=Hn.checkedKeys}var Ln=ye(wt,an,gi);si=zn(Ln)}Ke([].concat((0,le.Z)(Ei),(0,le.Z)(si)))}}}function on(Ge,Ke,nn,Qn,gn){return jt.useMemo(function(){var an=gn(Ke),zn=(0,we.Z)(an,2),gi=zn[0],ti=zn[1];if(!Ge||!Ke.length)return[gi,[],ti];var wi=It(gi),Wi=nn(),Cn=(0,En.S)(wi,!0,Wi),Pn=Cn.checkedKeys,Bn=Cn.halfCheckedKeys;return[Qn(Pn),Qn(Bn),ti]},[Ge,Ke,nn,Qn,gn])}var cn=kt(92310),Vn=kt.n(cn),Me=jt.memo(function(Ge){var Ke=Ge.children;return Ke},function(Ge,Ke){return!Ke.open}),he=Me;function Ce(Ge){var Ke,nn=Ge.prefixCls,Qn=Ge.checked,gn=Ge.halfChecked,an=Ge.disabled,zn=Ge.onClick,gi=Ge.disableCheckbox,ti=jt.useContext(ae),wi=ti.checkable,Wi=typeof wi!="boolean"?wi:null;return jt.createElement("span",{className:Vn()("".concat(nn),(Ke={},(0,Bt.Z)(Ke,"".concat(nn,"-checked"),Qn),(0,Bt.Z)(Ke,"".concat(nn,"-indeterminate"),!Qn&&gn),(0,Bt.Z)(Ke,"".concat(nn,"-disabled"),an||gi),Ke)),onClick:zn},Wi)}var Yn="__cascader_fix_label__";function Si(Ge){var Ke=Ge.prefixCls,nn=Ge.multiple,Qn=Ge.options,gn=Ge.activeValue,an=Ge.prevValuePath,zn=Ge.onToggleOpen,gi=Ge.onSelect,ti=Ge.onActive,wi=Ge.checkedSet,Wi=Ge.halfCheckedSet,Cn=Ge.loadingKeys,Pn=Ge.isSelectable,Bn=Ge.disabled,si="".concat(Ke,"-menu"),Ei="".concat(Ke,"-menu-item"),ci=jt.useContext(ae),Zi=ci.fieldNames,wt=ci.changeOnSelect,Je=ci.expandTrigger,Hn=ci.expandIcon,Ln=ci.loadingIcon,jn=ci.dropdownMenuColumnStyle,li=ci.optionRender,Ci=Je==="hover",Yi=function(Ee){return Bn||Ee},Be=jt.useMemo(function(){return Qn.map(function(Se){var Ee,Ue=Se.disabled,xi=Se.disableCheckbox,Kn=Se[nt],Pi=(Ee=Se[Yn])!==null&&Ee!==void 0?Ee:Se[Zi.label],$e=Se[Zi.value],Gn=Gt(Se,Zi),Ai=Kn?Kn.map(function(bn){return bn[Zi.value]}):[].concat((0,le.Z)(an),[$e]),ji=At(Ai),Tn=Cn.includes(ji),Qt=wi.has(ji),me=Wi.has(ji);return{disabled:Ue,label:Pi,value:$e,isLeaf:Gn,isLoading:Tn,checked:Qt,halfChecked:me,option:Se,disableCheckbox:xi,fullPath:Ai,fullPathKey:ji}})},[Qn,wi,Zi,Wi,Cn,an]);return jt.createElement("ul",{className:si,role:"menu"},Be.map(function(Se){var Ee,Ue=Se.disabled,xi=Se.label,Kn=Se.value,Pi=Se.isLeaf,$e=Se.isLoading,Gn=Se.checked,Ai=Se.halfChecked,ji=Se.option,Tn=Se.fullPath,Qt=Se.fullPathKey,me=Se.disableCheckbox,bn=function(){if(!Yi(Ue)){var Nn=(0,le.Z)(Tn);Ci&&Pi&&Nn.pop(),ti(Nn)}},_n=function(){Pn(ji)&&!Yi(Ue)&&gi(Tn,Pi)},ze;return typeof ji.title=="string"?ze=ji.title:typeof xi=="string"&&(ze=xi),jt.createElement("li",{key:Qt,className:Vn()(Ei,(Ee={},(0,Bt.Z)(Ee,"".concat(Ei,"-expand"),!Pi),(0,Bt.Z)(Ee,"".concat(Ei,"-active"),gn===Kn||gn===Qt),(0,Bt.Z)(Ee,"".concat(Ei,"-disabled"),Yi(Ue)),(0,Bt.Z)(Ee,"".concat(Ei,"-loading"),$e),Ee)),style:jn,role:"menuitemcheckbox",title:ze,"aria-checked":Gn,"data-path-key":Qt,onClick:function(){bn(),!me&&(!nn||Pi)&&_n()},onDoubleClick:function(){wt&&zn(!1)},onMouseEnter:function(){Ci&&bn()},onMouseDown:function(Nn){Nn.preventDefault()}},nn&&jt.createElement(Ce,{prefixCls:"".concat(Ke,"-checkbox"),checked:Gn,halfChecked:Ai,disabled:Yi(Ue)||me,disableCheckbox:me,onClick:function(Nn){me||(Nn.stopPropagation(),_n())}}),jt.createElement("div",{className:"".concat(Ei,"-content")},li?li(ji):xi),!$e&&Hn&&!Pi&&jt.createElement("div",{className:"".concat(Ei,"-expand-icon")},Hn),$e&&Ln&&jt.createElement("div",{className:"".concat(Ei,"-loading-icon")},Ln))}))}var Rt=function(Ke,nn){var Qn=jt.useContext(ae),gn=Qn.values,an=gn[0],zn=jt.useState([]),gi=(0,we.Z)(zn,2),ti=gi[0],wi=gi[1];return jt.useEffect(function(){Ke||wi(an||[])},[nn,an]),[ti,wi]},Ft=Rt,Pt=kt(10228),Nt=function(Ge,Ke,nn,Qn,gn,an,zn){var gi=zn.direction,ti=zn.searchValue,wi=zn.toggleOpen,Wi=zn.open,Cn=gi==="rtl",Pn=jt.useMemo(function(){for(var jn=-1,li=Ke,Ci=[],Yi=[],Be=Qn.length,Se=ie(Ke,nn),Ee=function($e){var Gn=li.findIndex(function(Ai,ji){return(Se[ji]?At(Se[ji]):Ai[nn.value])===Qn[$e]});if(Gn===-1)return 1;jn=Gn,Ci.push(jn),Yi.push(Qn[$e]),li=li[jn][nn.children]},Ue=0;Ue<Be&&li&&!Ee(Ue);Ue+=1);for(var xi=Ke,Kn=0;Kn<Ci.length-1;Kn+=1)xi=xi[Ci[Kn]][nn.children];return[Yi,jn,xi,Se]},[Qn,nn,Ke]),Bn=(0,we.Z)(Pn,4),si=Bn[0],Ei=Bn[1],ci=Bn[2],Zi=Bn[3],wt=function(li){gn(li)},Je=function(li){var Ci=ci.length,Yi=Ei;Yi===-1&&li<0&&(Yi=Ci);for(var Be=0;Be<Ci;Be+=1){Yi=(Yi+li+Ci)%Ci;var Se=ci[Yi];if(Se&&!Se.disabled){var Ee=si.slice(0,-1).concat(Zi[Yi]?At(Zi[Yi]):Se[nn.value]);wt(Ee);return}}},Hn=function(){if(si.length>1){var li=si.slice(0,-1);wt(li)}else wi(!1)},Ln=function(){var li,Ci=((li=ci[Ei])===null||li===void 0?void 0:li[nn.children])||[],Yi=Ci.find(function(Se){return!Se.disabled});if(Yi){var Be=[].concat((0,le.Z)(si),[Yi[nn.value]]);wt(Be)}};jt.useImperativeHandle(Ge,function(){return{onKeyDown:function(li){var Ci=li.which;switch(Ci){case Pt.Z.UP:case Pt.Z.DOWN:{var Yi=0;Ci===Pt.Z.UP?Yi=-1:Ci===Pt.Z.DOWN&&(Yi=1),Yi!==0&&Je(Yi);break}case Pt.Z.LEFT:{if(ti)break;Cn?Ln():Hn();break}case Pt.Z.RIGHT:{if(ti)break;Cn?Hn():Ln();break}case Pt.Z.BACKSPACE:{ti||Hn();break}case Pt.Z.ENTER:{if(si.length){var Be=ci[Ei],Se=(Be==null?void 0:Be[nt])||[];Se.length?an(Se.map(function(Ee){return Ee[nn.value]}),Se[Se.length-1]):an(si,ci[Ei])}break}case Pt.Z.ESC:wi(!1),Wi&&li.stopPropagation()}},onKeyUp:function(){}}})},zt=jt.forwardRef(function(Ge,Ke){var nn,Qn,gn,an=Ge.prefixCls,zn=Ge.multiple,gi=Ge.searchValue,ti=Ge.toggleOpen,wi=Ge.notFoundContent,Wi=Ge.direction,Cn=Ge.open,Pn=Ge.disabled,Bn=jt.useRef(null),si=Wi==="rtl",Ei=jt.useContext(ae),ci=Ei.options,Zi=Ei.values,wt=Ei.halfValues,Je=Ei.fieldNames,Hn=Ei.changeOnSelect,Ln=Ei.onSelect,jn=Ei.searchOptions,li=Ei.dropdownPrefixCls,Ci=Ei.loadData,Yi=Ei.expandTrigger,Be=li||an,Se=jt.useState([]),Ee=(0,we.Z)(Se,2),Ue=Ee[0],xi=Ee[1],Kn=function(Ii){if(!(!Ci||gi)){var Di=Ye(Ii,ci,Je),mn=Di.map(function(Mr){var Xr=Mr.option;return Xr}),oi=mn[mn.length-1];if(oi&&!Gt(oi,Je)){var fr=At(Ii);xi(function(Mr){return[].concat((0,le.Z)(Mr),[fr])}),Ci(mn)}}};jt.useEffect(function(){Ue.length&&Ue.forEach(function(hi){var Ii=qt(hi),Di=Ye(Ii,ci,Je,!0).map(function(oi){var fr=oi.option;return fr}),mn=Di[Di.length-1];(!mn||mn[Je.children]||Gt(mn,Je))&&xi(function(oi){return oi.filter(function(fr){return fr!==hi})})})},[ci,Ue,Je]);var Pi=jt.useMemo(function(){return new Set(It(Zi))},[Zi]),$e=jt.useMemo(function(){return new Set(It(wt))},[wt]),Gn=Ft(zn,Cn),Ai=(0,we.Z)(Gn,2),ji=Ai[0],Tn=Ai[1],Qt=function(Ii){Tn(Ii),Kn(Ii)},me=function(Ii){if(Pn)return!1;var Di=Ii.disabled,mn=Gt(Ii,Je);return!Di&&(mn||Hn||zn)},bn=function(Ii,Di){var mn=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;Ln(Ii),!zn&&(Di||Hn&&(Yi==="hover"||mn))&&ti(!1)},_n=jt.useMemo(function(){return gi?jn:ci},[gi,jn,ci]),ze=jt.useMemo(function(){for(var hi=[{options:_n}],Ii=_n,Di=ie(Ii,Je),mn=function(){var Mr=ji[oi],Xr=Ii.find(function(ri,Ri){return(Di[Ri]?At(Di[Ri]):ri[Je.value])===Mr}),Ae=Xr==null?void 0:Xr[Je.children];if(!(Ae!=null&&Ae.length))return 1;Ii=Ae,hi.push({options:Ae})},oi=0;oi<ji.length&&!mn();oi+=1);return hi},[_n,ji,Je]),hn=function(Ii,Di){me(Di)&&bn(Ii,Gt(Di,Je),!0)};Nt(Ke,_n,Je,ji,Qt,hn,{direction:Wi,searchValue:gi,toggleOpen:ti,open:Cn}),jt.useEffect(function(){if(!gi)for(var hi=0;hi<ji.length;hi+=1){var Ii,Di=ji.slice(0,hi+1),mn=At(Di),oi=(Ii=Bn.current)===null||Ii===void 0?void 0:Ii.querySelector('li[data-path-key="'.concat(mn.replace(/\\{0,2}"/g,'\\"'),'"]'));oi&&ge(oi)}},[ji,gi]);var Nn=!((nn=ze[0])!==null&&nn!==void 0&&(nn=nn.options)!==null&&nn!==void 0&&nn.length),In=[(Qn={},(0,Bt.Z)(Qn,Je.value,"__EMPTY__"),(0,Bt.Z)(Qn,Yn,wi),(0,Bt.Z)(Qn,"disabled",!0),Qn)],vi=(0,Kt.Z)((0,Kt.Z)({},Ge),{},{multiple:!Nn&&zn,onSelect:bn,onActive:Qt,onToggleOpen:ti,checkedSet:Pi,halfCheckedSet:$e,loadingKeys:Ue,isSelectable:me}),Jn=Nn?[{options:In}]:ze,ii=Jn.map(function(hi,Ii){var Di=ji.slice(0,Ii),mn=ji[Ii];return jt.createElement(Si,(0,ft.Z)({key:Ii},vi,{prefixCls:Be,options:hi.options,prevValuePath:Di,activeValue:mn}))});return jt.createElement(he,{open:Cn},jt.createElement("div",{className:Vn()("".concat(Be,"-menus"),(gn={},(0,Bt.Z)(gn,"".concat(Be,"-menu-empty"),Nn),(0,Bt.Z)(gn,"".concat(Be,"-rtl"),si),gn)),ref:Bn},ii))}),Mt=zt,Yt=jt.forwardRef(function(Ge,Ke){var nn=(0,Dt.lk)();return jt.createElement(Mt,(0,ft.Z)({},Ge,nn,{ref:Ke}))}),He=Yt,_e=kt(70425);function Xe(){}function xe(Ge){var Ke,nn=Ge,Qn=nn.prefixCls,gn=Qn===void 0?"rc-cascader":Qn,an=nn.style,zn=nn.className,gi=nn.options,ti=nn.checkable,wi=nn.defaultValue,Wi=nn.value,Cn=nn.fieldNames,Pn=nn.changeOnSelect,Bn=nn.onChange,si=nn.showCheckedStrategy,Ei=nn.loadData,ci=nn.expandTrigger,Zi=nn.expandIcon,wt=Zi===void 0?">":Zi,Je=nn.loadingIcon,Hn=nn.direction,Ln=nn.notFoundContent,jn=Ln===void 0?"Not Found":Ln,li=nn.disabled,Ci=!!ti,Yi=(0,_e.C8)(wi,{value:Wi,postState:ve}),Be=(0,we.Z)(Yi,2),Se=Be[0],Ee=Be[1],Ue=jt.useMemo(function(){return Ut(Cn)},[JSON.stringify(Cn)]),xi=Xt(Ue,gi),Kn=(0,we.Z)(xi,3),Pi=Kn[0],$e=Kn[1],Gn=Kn[2],Ai=qe(Pi,Ue),ji=on(Ci,Se,$e,Gn,Ai),Tn=(0,we.Z)(ji,3),Qt=Tn[0],me=Tn[1],bn=Tn[2],_n=(0,_e.zX)(function(Jn){if(Ee(Jn),Bn){var ii=ve(Jn),hi=ii.map(function(mn){return Ye(mn,Pi,Ue).map(function(oi){return oi.option})}),Ii=Ci?ii:ii[0],Di=Ci?hi:hi[0];Bn(Ii,Di)}}),ze=Ie(Ci,_n,Qt,me,bn,$e,Gn,si),hn=(0,_e.zX)(function(Jn){ze(Jn)}),Nn=jt.useMemo(function(){return{options:Pi,fieldNames:Ue,values:Qt,halfValues:me,changeOnSelect:Pn,onSelect:hn,checkable:ti,searchOptions:[],dropdownPrefixCls:void 0,loadData:Ei,expandTrigger:ci,expandIcon:wt,loadingIcon:Je,dropdownMenuColumnStyle:void 0}},[Pi,Ue,Qt,me,Pn,hn,ti,Ei,ci,wt,Je]),In="".concat(gn,"-panel"),vi=!Pi.length;return jt.createElement(ae.Provider,{value:Nn},jt.createElement("div",{className:Vn()(In,(Ke={},(0,Bt.Z)(Ke,"".concat(In,"-rtl"),Hn==="rtl"),(0,Bt.Z)(Ke,"".concat(In,"-empty"),vi),Ke),zn),style:an},vi?jn:jt.createElement(Mt,{prefixCls:gn,searchValue:"",multiple:Ci,toggleOpen:Xe,open:!0,direction:Hn,disabled:li})))}function Pe(Ge){var Ke=Ge.onPopupVisibleChange,nn=Ge.popupVisible,Qn=Ge.popupClassName,gn=Ge.popupPlacement;warning(!Ke,"`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(gn===void 0,"`popupPlacement` is deprecated. Please use `placement` instead.")}function ke(Ge,Ke){if(Ge){var nn=function Qn(gn){for(var an=0;an<gn.length;an++){var zn=gn[an];if(zn[Ke==null?void 0:Ke.value]===null)return warning(!1,"`value` in Cascader options should not be `null`."),!0;if(Array.isArray(zn[Ke==null?void 0:Ke.children])&&Qn(zn[Ke==null?void 0:Ke.children]))return!0}};nn(Ge)}}var Ve=null,tn=["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"],dn=jt.forwardRef(function(Ge,Ke){var nn=Ge.id,Qn=Ge.prefixCls,gn=Qn===void 0?"rc-cascader":Qn,an=Ge.fieldNames,zn=Ge.defaultValue,gi=Ge.value,ti=Ge.changeOnSelect,wi=Ge.onChange,Wi=Ge.displayRender,Cn=Ge.checkable,Pn=Ge.autoClearSearchValue,Bn=Pn===void 0?!0:Pn,si=Ge.searchValue,Ei=Ge.onSearch,ci=Ge.showSearch,Zi=Ge.expandTrigger,wt=Ge.options,Je=Ge.dropdownPrefixCls,Hn=Ge.loadData,Ln=Ge.popupVisible,jn=Ge.open,li=Ge.popupClassName,Ci=Ge.dropdownClassName,Yi=Ge.dropdownMenuColumnStyle,Be=Ge.dropdownStyle,Se=Ge.popupPlacement,Ee=Ge.placement,Ue=Ge.onDropdownVisibleChange,xi=Ge.onPopupVisibleChange,Kn=Ge.expandIcon,Pi=Kn===void 0?">":Kn,$e=Ge.loadingIcon,Gn=Ge.children,Ai=Ge.dropdownMatchSelectWidth,ji=Ai===void 0?!1:Ai,Tn=Ge.showCheckedStrategy,Qt=Tn===void 0?St:Tn,me=Ge.optionRender,bn=(0,ue.Z)(Ge,tn),_n=(0,ee.ZP)(nn),ze=!!Cn,hn=(0,Jt.Z)(zn,{value:gi,postState:ve}),Nn=(0,we.Z)(hn,2),In=Nn[0],vi=Nn[1],Jn=jt.useMemo(function(){return Ut(an)},[JSON.stringify(an)]),ii=Xt(Jn,wt),hi=(0,we.Z)(ii,3),Ii=hi[0],Di=hi[1],mn=hi[2],oi=(0,Jt.Z)("",{value:si,postState:function(Ni){return Ni||""}}),fr=(0,we.Z)(oi,2),Mr=fr[0],Xr=fr[1],Ae=function(Ni,Li){Xr(Ni),Li.source!=="blur"&&Ei&&Ei(Ni)},ri=On(ci),Ri=(0,we.Z)(ri,2),fi=Ri[0],br=Ri[1],ur=pt(Mr,Ii,Jn,Je||gn,br,ti||ze),Lr=qe(Ii,Jn),Dr=on(ze,In,Di,mn,Lr),Zr=(0,we.Z)(Dr,3),Jr=Zr[0],un=Zr[1],yo=Zr[2],vn=jt.useMemo(function(){var ei=It(Jr),Ni=ye(ei,Di,Qt);return[].concat((0,le.Z)(yo),(0,le.Z)(mn(Ni)))},[Jr,Di,mn,yo,Qt]),Gi=Ze(vn,Ii,Jn,ze,Wi),Wr=(0,pe.Z)(function(ei){if(vi(ei),wi){var Ni=ve(ei),Li=Ni.map(function(Un){return Ye(Un,Ii,Jn).map(function($n){return $n.option})}),di=ze?Ni:Ni[0],yn=ze?Li:Li[0];wi(di,yn)}}),Oi=Ie(ze,Wr,Jr,un,yo,Di,mn,Qt),ko=(0,pe.Z)(function(ei){(!ze||Bn)&&Xr(""),Oi(ei)}),Ur=function(Ni,Li){if(Li.type==="clear"){Wr([]);return}var di=Li.values[0],yn=di.valueCells;ko(yn)},Cr=jn!==void 0?jn:Ln,Lo=Ci||li,je=Ee||Se,xn=function(Ni){Ue==null||Ue(Ni),xi==null||xi(Ni)},be=jt.useMemo(function(){return{options:Ii,fieldNames:Jn,values:Jr,halfValues:un,changeOnSelect:ti,onSelect:ko,checkable:Cn,searchOptions:ur,dropdownPrefixCls:Je,loadData:Hn,expandTrigger:Zi,expandIcon:Pi,loadingIcon:$e,dropdownMenuColumnStyle:Yi,optionRender:me}},[Ii,Jn,Jr,un,ti,ko,Cn,ur,Je,Hn,Zi,Pi,$e,Yi,me]),Tt=!(Mr?ur:Ii).length,Dn=Mr&&br.matchInputWidth||Tt?{}:{minWidth:"auto"};return jt.createElement(ae.Provider,{value:be},jt.createElement(Dt.Ac,(0,ft.Z)({},bn,{ref:Ke,id:_n,prefixCls:gn,autoClearSearchValue:Bn,dropdownMatchSelectWidth:ji,dropdownStyle:(0,Kt.Z)((0,Kt.Z)({},Dn),Be),displayValues:Gi,onDisplayValuesChange:Ur,mode:ze?"multiple":void 0,searchValue:Mr,onSearch:Ae,showSearch:fi,OptionList:He,emptyOptions:Tt,open:Cr,dropdownClassName:Lo,placement:je,onDropdownVisibleChange:xn,getRawInputElement:function(){return Gn}})))});dn.SHOW_PARENT=St,dn.SHOW_CHILD=Et,dn.Panel=xe;var fn=dn,ni=fn},98535:function(Mn,Rn,kt){"use strict";kt.r(Rn),kt.d(Rn,{Panel:function(){return ve},default:function(){return Te}});var ft=kt(14809),Kt=kt(95190),le=kt(50298),we=kt(93664),ue=kt(92310),Dt=kt.n(ue),ee=kt(18929),pe=kt(48736),Jt=kt(59301),jt=kt(62646),De=kt(11592),ae=kt(20439),Le=kt(4635),Bt=kt(77900),nt=kt(10228),et=Jt.forwardRef(function(ye,Ye){var Ze=ye.prefixCls,qe=ye.forceRender,pn=ye.className,te=ye.style,Xt=ye.children,Qe=ye.isActive,On=ye.role,En=ye.classNames,Ie=ye.styles,on=Jt.useState(Qe||qe),cn=(0,le.Z)(on,2),Vn=cn[0],Me=cn[1];return Jt.useEffect(function(){(qe||Qe)&&Me(!0)},[qe,Qe]),Vn?Jt.createElement("div",{ref:Ye,className:Dt()("".concat(Ze,"-content"),(0,Le.Z)((0,Le.Z)({},"".concat(Ze,"-content-active"),Qe),"".concat(Ze,"-content-inactive"),!Qe),pn),style:te,role:On},Jt.createElement("div",{className:Dt()("".concat(Ze,"-content-box"),En==null?void 0:En.body),style:Ie==null?void 0:Ie.body},Xt)):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"],pt=Jt.forwardRef(function(ye,Ye){var Ze=ye.showArrow,qe=Ze===void 0?!0:Ze,pn=ye.headerClass,te=ye.isActive,Xt=ye.onItemClick,Qe=ye.forceRender,On=ye.className,En=ye.classNames,Ie=En===void 0?{}:En,on=ye.styles,cn=on===void 0?{}:on,Vn=ye.prefixCls,Me=ye.collapsible,he=ye.accordion,Ce=ye.panelKey,Yn=ye.extra,Si=ye.header,Rt=ye.expandIcon,Ft=ye.openMotion,Pt=ye.destroyInactivePanel,Nt=ye.children,zt=(0,jt.Z)(ye,st),Mt=Me==="disabled",Yt=Yn!=null&&typeof Yn!="boolean",He=(0,Le.Z)((0,Le.Z)((0,Le.Z)({onClick:function(){Xt==null||Xt(Ce)},onKeyDown:function(tn){(tn.key==="Enter"||tn.keyCode===nt.Z.ENTER||tn.which===nt.Z.ENTER)&&(Xt==null||Xt(Ce))},role:he?"tab":"button"},"aria-expanded",te),"aria-disabled",Mt),"tabIndex",Mt?-1:0),_e=typeof Rt=="function"?Rt(ye):Jt.createElement("i",{className:"arrow"}),Xe=_e&&Jt.createElement("div",(0,ft.Z)({className:"".concat(Vn,"-expand-icon")},["header","icon"].includes(Me)?He:{}),_e),xe=Dt()("".concat(Vn,"-item"),(0,Le.Z)((0,Le.Z)({},"".concat(Vn,"-item-active"),te),"".concat(Vn,"-item-disabled"),Mt),On),Pe=Dt()(pn,"".concat(Vn,"-header"),(0,Le.Z)({},"".concat(Vn,"-collapsible-").concat(Me),!!Me),Ie.header),ke=(0,ae.Z)({className:Pe,style:cn.header},["header","icon"].includes(Me)?{}:He);return Jt.createElement("div",(0,ft.Z)({},zt,{ref:Ye,className:xe}),Jt.createElement("div",ke,qe&&Xe,Jt.createElement("span",(0,ft.Z)({className:"".concat(Vn,"-header-text")},Me==="header"?He:{}),Si),Yt&&Jt.createElement("div",{className:"".concat(Vn,"-extra")},Yn)),Jt.createElement(Bt.default,(0,ft.Z)({visible:te,leavedClassName:"".concat(Vn,"-content-hidden")},Ft,{forceRender:Qe,removeOnLeave:Pt}),function(Ve,tn){var dn=Ve.className,fn=Ve.style;return Jt.createElement(ht,{ref:tn,prefixCls:Vn,className:dn,classNames:Ie,style:fn,styles:cn,isActive:te,forceRender:Qe,role:he?"tabpanel":void 0},Nt)}))}),vt=pt,St=["children","label","key","collapsible","onItemClick","destroyInactivePanel"],Et=function(Ye,Ze){var qe=Ze.prefixCls,pn=Ze.accordion,te=Ze.collapsible,Xt=Ze.destroyInactivePanel,Qe=Ze.onItemClick,On=Ze.activeKey,En=Ze.openMotion,Ie=Ze.expandIcon;return Ye.map(function(on,cn){var Vn=on.children,Me=on.label,he=on.key,Ce=on.collapsible,Yn=on.onItemClick,Si=on.destroyInactivePanel,Rt=(0,jt.Z)(on,St),Ft=String(he!=null?he:cn),Pt=Ce!=null?Ce:te,Nt=Si!=null?Si:Xt,zt=function(He){Pt!=="disabled"&&(Qe(He),Yn==null||Yn(He))},Mt=!1;return pn?Mt=On[0]===Ft:Mt=On.indexOf(Ft)>-1,Jt.createElement(vt,(0,ft.Z)({},Rt,{prefixCls:qe,key:Ft,panelKey:Ft,isActive:Mt,accordion:pn,openMotion:En,expandIcon:Ie,header:Me,collapsible:Pt,onItemClick:zt,destroyInactivePanel:Nt}),Vn)})},At=function(Ye,Ze,qe){if(!Ye)return null;var pn=qe.prefixCls,te=qe.accordion,Xt=qe.collapsible,Qe=qe.destroyInactivePanel,On=qe.onItemClick,En=qe.activeKey,Ie=qe.openMotion,on=qe.expandIcon,cn=Ye.key||String(Ze),Vn=Ye.props,Me=Vn.header,he=Vn.headerClass,Ce=Vn.destroyInactivePanel,Yn=Vn.collapsible,Si=Vn.onItemClick,Rt=!1;te?Rt=En[0]===cn:Rt=En.indexOf(cn)>-1;var Ft=Yn!=null?Yn:Xt,Pt=function(Mt){Ft!=="disabled"&&(On(Mt),Si==null||Si(Mt))},Nt={key:cn,panelKey:cn,header:Me,headerClass:he,isActive:Rt,prefixCls:pn,destroyInactivePanel:Ce!=null?Ce:Qe,openMotion:Ie,accordion:te,children:Ye.props.children,onItemClick:Pt,expandIcon:on,collapsible:Ft};return typeof Ye.type=="string"?Ye:(Object.keys(Nt).forEach(function(zt){typeof Nt[zt]=="undefined"&&delete Nt[zt]}),Jt.cloneElement(Ye,Nt))};function It(ye,Ye,Ze){return Array.isArray(ye)?Et(ye,Ze):(0,De.Z)(Ye).map(function(qe,pn){return At(qe,pn,Ze)})}var qt=It,Ut=kt(26112);function Gt(ye){var Ye=ye;if(!Array.isArray(Ye)){var Ze=(0,we.Z)(Ye);Ye=Ze==="number"||Ze==="string"?[Ye]:[]}return Ye.map(function(qe){return String(qe)})}var ge=Jt.forwardRef(function(ye,Ye){var Ze=ye.prefixCls,qe=Ze===void 0?"rc-collapse":Ze,pn=ye.destroyInactivePanel,te=pn===void 0?!1:pn,Xt=ye.style,Qe=ye.accordion,On=ye.className,En=ye.children,Ie=ye.collapsible,on=ye.openMotion,cn=ye.expandIcon,Vn=ye.activeKey,Me=ye.defaultActiveKey,he=ye.onChange,Ce=ye.items,Yn=Dt()(qe,On),Si=(0,ee.Z)([],{value:Vn,onChange:function(Yt){return he==null?void 0:he(Yt)},defaultValue:Me,postState:Gt}),Rt=(0,le.Z)(Si,2),Ft=Rt[0],Pt=Rt[1],Nt=function(Yt){return Pt(function(){if(Qe)return Ft[0]===Yt?[]:[Yt];var He=Ft.indexOf(Yt),_e=He>-1;return _e?Ft.filter(function(Xe){return Xe!==Yt}):[].concat((0,Kt.Z)(Ft),[Yt])})};(0,pe.ZP)(!En,"[rc-collapse] `children` will be removed in next major version. Please use `items` instead.");var zt=qt(Ce,En,{prefixCls:qe,accordion:Qe,openMotion:on,expandIcon:cn,collapsible:Ie,destroyInactivePanel:te,onItemClick:Nt,activeKey:Ft});return Jt.createElement("div",(0,ft.Z)({ref:Ye,className:Yn,style:Xt,role:Qe?"tablist":void 0},(0,Ut.Z)(ye,{aria:!0,data:!0})),zt)}),ie=Object.assign(ge,{Panel:vt}),Te=ie,ve=ie.Panel},23425:function(Mn,Rn,kt){"use strict";kt.d(Rn,{Z:function(){return It}});var ft=kt(4635),Kt=kt(14809),le=kt(93664),we=kt(20439),ue=kt(50298),Dt=kt(92310),ee=kt.n(Dt),pe=kt(18929),Jt=kt(10228),jt=kt(26112),De=kt(48736),ae=kt(59301),Le=kt(17119),Bt=[10,20,50,100],nt=function(Ut){var Gt=Ut.pageSizeOptions,ge=Gt===void 0?Bt:Gt,ie=Ut.locale,Te=Ut.changeSize,ve=Ut.pageSize,ye=Ut.goButton,Ye=Ut.quickGo,Ze=Ut.rootPrefixCls,qe=Ut.disabled,pn=Ut.buildOptionText,te=Ut.showSizeChanger,Xt=Ut.sizeChangerRender,Qe=ae.useState(""),On=(0,ue.Z)(Qe,2),En=On[0],Ie=On[1],on=function(){return!En||Number.isNaN(En)?void 0:Number(En)},cn=typeof pn=="function"?pn:function(Pt){return"".concat(Pt," ").concat(ie.items_per_page)},Vn=function(Nt){Ie(Nt.target.value)},Me=function(Nt){ye||En===""||(Ie(""),!(Nt.relatedTarget&&(Nt.relatedTarget.className.indexOf("".concat(Ze,"-item-link"))>=0||Nt.relatedTarget.className.indexOf("".concat(Ze,"-item"))>=0))&&(Ye==null||Ye(on())))},he=function(Nt){En!==""&&(Nt.keyCode===Jt.Z.ENTER||Nt.type==="click")&&(Ie(""),Ye==null||Ye(on()))},Ce=function(){return ge.some(function(Nt){return Nt.toString()===ve.toString()})?ge:ge.concat([ve]).sort(function(Nt,zt){var Mt=Number.isNaN(Number(Nt))?0:Number(Nt),Yt=Number.isNaN(Number(zt))?0:Number(zt);return Mt-Yt})},Yn="".concat(Ze,"-options");if(!te&&!Ye)return null;var Si=null,Rt=null,Ft=null;return te&&Xt&&(Si=Xt({disabled:qe,size:ve,onSizeChange:function(Nt){Te==null||Te(Number(Nt))},"aria-label":ie.page_size,className:"".concat(Yn,"-size-changer"),options:Ce().map(function(Pt){return{label:cn(Pt),value:Pt}})})),Ye&&(ye&&(Ft=typeof ye=="boolean"?ae.createElement("button",{type:"button",onClick:he,onKeyUp:he,disabled:qe,className:"".concat(Yn,"-quick-jumper-button")},ie.jump_to_confirm):ae.createElement("span",{onClick:he,onKeyUp:he},ye)),Rt=ae.createElement("div",{className:"".concat(Yn,"-quick-jumper")},ie.jump_to,ae.createElement("input",{disabled:qe,type:"text",value:En,onChange:Vn,onKeyUp:he,onBlur:Me,"aria-label":ie.page}),ie.page,Ft)),ae.createElement("li",{className:Yn},Si,Rt)},et=nt,ht=function(Ut){var Gt=Ut.rootPrefixCls,ge=Ut.page,ie=Ut.active,Te=Ut.className,ve=Ut.showTitle,ye=Ut.onClick,Ye=Ut.onKeyPress,Ze=Ut.itemRender,qe="".concat(Gt,"-item"),pn=ee()(qe,"".concat(qe,"-").concat(ge),(0,ft.Z)((0,ft.Z)({},"".concat(qe,"-active"),ie),"".concat(qe,"-disabled"),!ge),Te),te=function(){ye(ge)},Xt=function(En){Ye(En,ye,ge)},Qe=Ze(ge,"page",ae.createElement("a",{rel:"nofollow"},ge));return Qe?ae.createElement("li",{title:ve?String(ge):null,className:pn,onClick:te,onKeyDown:Xt,tabIndex:0},Qe):null},st=ht,pt=function(Ut,Gt,ge){return ge};function vt(){}function St(qt){var Ut=Number(qt);return typeof Ut=="number"&&!Number.isNaN(Ut)&&isFinite(Ut)&&Math.floor(Ut)===Ut}function Et(qt,Ut,Gt){var ge=typeof qt=="undefined"?Ut:qt;return Math.floor((Gt-1)/ge)+1}var At=function(Ut){var Gt=Ut.prefixCls,ge=Gt===void 0?"rc-pagination":Gt,ie=Ut.selectPrefixCls,Te=ie===void 0?"rc-select":ie,ve=Ut.className,ye=Ut.current,Ye=Ut.defaultCurrent,Ze=Ye===void 0?1:Ye,qe=Ut.total,pn=qe===void 0?0:qe,te=Ut.pageSize,Xt=Ut.defaultPageSize,Qe=Xt===void 0?10:Xt,On=Ut.onChange,En=On===void 0?vt:On,Ie=Ut.hideOnSinglePage,on=Ut.align,cn=Ut.showPrevNextJumpers,Vn=cn===void 0?!0:cn,Me=Ut.showQuickJumper,he=Ut.showLessItems,Ce=Ut.showTitle,Yn=Ce===void 0?!0:Ce,Si=Ut.onShowSizeChange,Rt=Si===void 0?vt:Si,Ft=Ut.locale,Pt=Ft===void 0?Le.Z:Ft,Nt=Ut.style,zt=Ut.totalBoundaryShowSizeChanger,Mt=zt===void 0?50:zt,Yt=Ut.disabled,He=Ut.simple,_e=Ut.showTotal,Xe=Ut.showSizeChanger,xe=Xe===void 0?pn>Mt:Xe,Pe=Ut.sizeChangerRender,ke=Ut.pageSizeOptions,Ve=Ut.itemRender,tn=Ve===void 0?pt:Ve,dn=Ut.jumpPrevIcon,fn=Ut.jumpNextIcon,ni=Ut.prevIcon,Ge=Ut.nextIcon,Ke=ae.useRef(null),nn=(0,pe.Z)(10,{value:te,defaultValue:Qe}),Qn=(0,ue.Z)(nn,2),gn=Qn[0],an=Qn[1],zn=(0,pe.Z)(1,{value:ye,defaultValue:Ze,postState:function(Wr){return Math.max(1,Math.min(Wr,Et(void 0,gn,pn)))}}),gi=(0,ue.Z)(zn,2),ti=gi[0],wi=gi[1],Wi=ae.useState(ti),Cn=(0,ue.Z)(Wi,2),Pn=Cn[0],Bn=Cn[1];(0,ae.useEffect)(function(){Bn(ti)},[ti]);var si=En!==vt,Ei="current"in Ut,ci=Math.max(1,ti-(he?3:5)),Zi=Math.min(Et(void 0,gn,pn),ti+(he?3:5));function wt(Gi,Wr){var Oi=Gi||ae.createElement("button",{type:"button","aria-label":Wr,className:"".concat(ge,"-item-link")});return typeof Gi=="function"&&(Oi=ae.createElement(Gi,(0,we.Z)({},Ut))),Oi}function Je(Gi){var Wr=Gi.target.value,Oi=Et(void 0,gn,pn),ko;return Wr===""?ko=Wr:Number.isNaN(Number(Wr))?ko=Pn:Wr>=Oi?ko=Oi:ko=Number(Wr),ko}function Hn(Gi){return St(Gi)&&Gi!==ti&&St(pn)&&pn>0}var Ln=pn>gn?Me:!1;function jn(Gi){(Gi.keyCode===Jt.Z.UP||Gi.keyCode===Jt.Z.DOWN)&&Gi.preventDefault()}function li(Gi){var Wr=Je(Gi);switch(Wr!==Pn&&Bn(Wr),Gi.keyCode){case Jt.Z.ENTER:Be(Wr);break;case Jt.Z.UP:Be(Wr-1);break;case Jt.Z.DOWN:Be(Wr+1);break;default:break}}function Ci(Gi){Be(Je(Gi))}function Yi(Gi){var Wr=Et(Gi,gn,pn),Oi=ti>Wr&&Wr!==0?Wr:ti;an(Gi),Bn(Oi),Rt==null||Rt(ti,Gi),wi(Oi),En==null||En(Oi,Gi)}function Be(Gi){if(Hn(Gi)&&!Yt){var Wr=Et(void 0,gn,pn),Oi=Gi;return Gi>Wr?Oi=Wr:Gi<1&&(Oi=1),Oi!==Pn&&Bn(Oi),wi(Oi),En==null||En(Oi,gn),Oi}return ti}var Se=ti>1,Ee=ti<Et(void 0,gn,pn);function Ue(){Se&&Be(ti-1)}function xi(){Ee&&Be(ti+1)}function Kn(){Be(ci)}function Pi(){Be(Zi)}function $e(Gi,Wr){if(Gi.key==="Enter"||Gi.charCode===Jt.Z.ENTER||Gi.keyCode===Jt.Z.ENTER){for(var Oi=arguments.length,ko=new Array(Oi>2?Oi-2:0),Ur=2;Ur<Oi;Ur++)ko[Ur-2]=arguments[Ur];Wr.apply(void 0,ko)}}function Gn(Gi){$e(Gi,Ue)}function Ai(Gi){$e(Gi,xi)}function ji(Gi){$e(Gi,Kn)}function Tn(Gi){$e(Gi,Pi)}function Qt(Gi){var Wr=tn(Gi,"prev",wt(ni,"prev page"));return ae.isValidElement(Wr)?ae.cloneElement(Wr,{disabled:!Se}):Wr}function me(Gi){var Wr=tn(Gi,"next",wt(Ge,"next page"));return ae.isValidElement(Wr)?ae.cloneElement(Wr,{disabled:!Ee}):Wr}function bn(Gi){(Gi.type==="click"||Gi.keyCode===Jt.Z.ENTER)&&Be(Pn)}var _n=null,ze=(0,jt.Z)(Ut,{aria:!0,data:!0}),hn=_e&&ae.createElement("li",{className:"".concat(ge,"-total-text")},_e(pn,[pn===0?0:(ti-1)*gn+1,ti*gn>pn?pn:ti*gn])),Nn=null,In=Et(void 0,gn,pn);if(Ie&&pn<=gn)return null;var vi=[],Jn={rootPrefixCls:ge,onClick:Be,onKeyPress:$e,showTitle:Yn,itemRender:tn,page:-1},ii=ti-1>0?ti-1:0,hi=ti+1<In?ti+1:In,Ii=Me&&Me.goButton,Di=(0,le.Z)(He)==="object"?He.readOnly:!He,mn=Ii,oi=null;He&&(Ii&&(typeof Ii=="boolean"?mn=ae.createElement("button",{type:"button",onClick:bn,onKeyUp:bn},Pt.jump_to_confirm):mn=ae.createElement("span",{onClick:bn,onKeyUp:bn},Ii),mn=ae.createElement("li",{title:Yn?"".concat(Pt.jump_to).concat(ti,"/").concat(In):null,className:"".concat(ge,"-simple-pager")},mn)),oi=ae.createElement("li",{title:Yn?"".concat(ti,"/").concat(In):null,className:"".concat(ge,"-simple-pager")},Di?Pn:ae.createElement("input",{type:"text","aria-label":Pt.jump_to,value:Pn,disabled:Yt,onKeyDown:jn,onKeyUp:li,onChange:li,onBlur:Ci,size:3}),ae.createElement("span",{className:"".concat(ge,"-slash")},"/"),In));var fr=he?1:2;if(In<=3+fr*2){In||vi.push(ae.createElement(st,(0,Kt.Z)({},Jn,{key:"noPager",page:1,className:"".concat(ge,"-item-disabled")})));for(var Mr=1;Mr<=In;Mr+=1)vi.push(ae.createElement(st,(0,Kt.Z)({},Jn,{key:Mr,page:Mr,active:ti===Mr})))}else{var Xr=he?Pt.prev_3:Pt.prev_5,Ae=he?Pt.next_3:Pt.next_5,ri=tn(ci,"jump-prev",wt(dn,"prev page")),Ri=tn(Zi,"jump-next",wt(fn,"next page"));Vn&&(_n=ri?ae.createElement("li",{title:Yn?Xr:null,key:"prev",onClick:Kn,tabIndex:0,onKeyDown:ji,className:ee()("".concat(ge,"-jump-prev"),(0,ft.Z)({},"".concat(ge,"-jump-prev-custom-icon"),!!dn))},ri):null,Nn=Ri?ae.createElement("li",{title:Yn?Ae:null,key:"next",onClick:Pi,tabIndex:0,onKeyDown:Tn,className:ee()("".concat(ge,"-jump-next"),(0,ft.Z)({},"".concat(ge,"-jump-next-custom-icon"),!!fn))},Ri):null);var fi=Math.max(1,ti-fr),br=Math.min(ti+fr,In);ti-1<=fr&&(br=1+fr*2),In-ti<=fr&&(fi=In-fr*2);for(var ur=fi;ur<=br;ur+=1)vi.push(ae.createElement(st,(0,Kt.Z)({},Jn,{key:ur,page:ur,active:ti===ur})));if(ti-1>=fr*2&&ti!==3&&(vi[0]=ae.cloneElement(vi[0],{className:ee()("".concat(ge,"-item-after-jump-prev"),vi[0].props.className)}),vi.unshift(_n)),In-ti>=fr*2&&ti!==In-2){var Lr=vi[vi.length-1];vi[vi.length-1]=ae.cloneElement(Lr,{className:ee()("".concat(ge,"-item-before-jump-next"),Lr.props.className)}),vi.push(Nn)}fi!==1&&vi.unshift(ae.createElement(st,(0,Kt.Z)({},Jn,{key:1,page:1}))),br!==In&&vi.push(ae.createElement(st,(0,Kt.Z)({},Jn,{key:In,page:In})))}var Dr=Qt(ii);if(Dr){var Zr=!Se||!In;Dr=ae.createElement("li",{title:Yn?Pt.prev_page:null,onClick:Ue,tabIndex:Zr?null:0,onKeyDown:Gn,className:ee()("".concat(ge,"-prev"),(0,ft.Z)({},"".concat(ge,"-disabled"),Zr)),"aria-disabled":Zr},Dr)}var Jr=me(hi);if(Jr){var un,yo;He?(un=!Ee,yo=Se?0:null):(un=!Ee||!In,yo=un?null:0),Jr=ae.createElement("li",{title:Yn?Pt.next_page:null,onClick:xi,tabIndex:yo,onKeyDown:Ai,className:ee()("".concat(ge,"-next"),(0,ft.Z)({},"".concat(ge,"-disabled"),un)),"aria-disabled":un},Jr)}var vn=ee()(ge,ve,(0,ft.Z)((0,ft.Z)((0,ft.Z)((0,ft.Z)((0,ft.Z)({},"".concat(ge,"-start"),on==="start"),"".concat(ge,"-center"),on==="center"),"".concat(ge,"-end"),on==="end"),"".concat(ge,"-simple"),He),"".concat(ge,"-disabled"),Yt));return ae.createElement("ul",(0,Kt.Z)({className:vn,style:Nt,ref:Ke},ze),hn,Dr,He?oi:vi,Jr,ae.createElement(et,{locale:Pt,rootPrefixCls:ge,disabled:Yt,selectPrefixCls:Te,changeSize:Yi,pageSize:gn,pageSizeOptions:ke,quickGo:Ln?Be:null,goButton:mn,showSizeChanger:xe,sizeChangerRender:Pe}))},It=At},738:function(Mn,Rn,kt){"use strict";kt.d(Rn,{Z:function(){return vt}});var ft=kt(14809),Kt=kt(4635),le=kt(50298),we=kt(62646),ue=kt(92310),Dt=kt.n(ue),ee=kt(18929),pe=kt(10228),Jt=kt(26112),jt=kt(59301);function De(St,Et){var At=St.disabled,It=St.prefixCls,qt=St.character,Ut=St.characterRender,Gt=St.index,ge=St.count,ie=St.value,Te=St.allowHalf,ve=St.focused,ye=St.onHover,Ye=St.onClick,Ze=function(Ie){ye(Ie,Gt)},qe=function(Ie){Ye(Ie,Gt)},pn=function(Ie){Ie.keyCode===pe.Z.ENTER&&Ye(Ie,Gt)},te=Gt+1,Xt=new Set([It]);ie===0&&Gt===0&&ve?Xt.add("".concat(It,"-focused")):Te&&ie+.5>=te&&ie<te?(Xt.add("".concat(It,"-half")),Xt.add("".concat(It,"-active")),ve&&Xt.add("".concat(It,"-focused"))):(te<=ie?Xt.add("".concat(It,"-full")):Xt.add("".concat(It,"-zero")),te===ie&&ve&&Xt.add("".concat(It,"-focused")));var Qe=typeof qt=="function"?qt(St):qt,On=jt.createElement("li",{className:Dt()(Array.from(Xt)),ref:Et},jt.createElement("div",{onClick:At?null:qe,onKeyDown:At?null:pn,onMouseMove:At?null:Ze,role:"radio","aria-checked":ie>Gt?"true":"false","aria-posinset":Gt+1,"aria-setsize":ge,tabIndex:At?-1:0},jt.createElement("div",{className:"".concat(It,"-first")},Qe),jt.createElement("div",{className:"".concat(It,"-second")},Qe)));return Ut&&(On=Ut(On,St)),On}var ae=jt.forwardRef(De);function Le(){var St=jt.useRef({});function Et(It){return St.current[It]}function At(It){return function(qt){St.current[It]=qt}}return[Et,At]}function Bt(St){var Et=St.pageXOffset,At="scrollLeft";if(typeof Et!="number"){var It=St.document;Et=It.documentElement[At],typeof Et!="number"&&(Et=It.body[At])}return Et}function nt(St){var Et,At,It=St.ownerDocument,qt=It.body,Ut=It&&It.documentElement,Gt=St.getBoundingClientRect();return Et=Gt.left,At=Gt.top,Et-=Ut.clientLeft||qt.clientLeft||0,At-=Ut.clientTop||qt.clientTop||0,{left:Et,top:At}}function et(St){var Et=nt(St),At=St.ownerDocument,It=At.defaultView||At.parentWindow;return Et.left+=Bt(It),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 At=St.prefixCls,It=At===void 0?"rc-rate":At,qt=St.className,Ut=St.defaultValue,Gt=St.value,ge=St.count,ie=ge===void 0?5:ge,Te=St.allowHalf,ve=Te===void 0?!1:Te,ye=St.allowClear,Ye=ye===void 0?!0:ye,Ze=St.keyboard,qe=Ze===void 0?!0:Ze,pn=St.character,te=pn===void 0?"\u2605":pn,Xt=St.characterRender,Qe=St.disabled,On=St.direction,En=On===void 0?"ltr":On,Ie=St.tabIndex,on=Ie===void 0?0:Ie,cn=St.autoFocus,Vn=St.onHoverChange,Me=St.onChange,he=St.onFocus,Ce=St.onBlur,Yn=St.onKeyDown,Si=St.onMouseLeave,Rt=(0,we.Z)(St,ht),Ft=Le(),Pt=(0,le.Z)(Ft,2),Nt=Pt[0],zt=Pt[1],Mt=jt.useRef(null),Yt=function(){if(!Qe){var ci;(ci=Mt.current)===null||ci===void 0||ci.focus()}};jt.useImperativeHandle(Et,function(){return{focus:Yt,blur:function(){if(!Qe){var ci;(ci=Mt.current)===null||ci===void 0||ci.blur()}}}});var He=(0,ee.Z)(Ut||0,{value:Gt}),_e=(0,le.Z)(He,2),Xe=_e[0],xe=_e[1],Pe=(0,ee.Z)(null),ke=(0,le.Z)(Pe,2),Ve=ke[0],tn=ke[1],dn=function(ci,Zi){var wt=En==="rtl",Je=ci+1;if(ve){var Hn=Nt(ci),Ln=et(Hn),jn=Hn.clientWidth;(wt&&Zi-Ln>jn/2||!wt&&Zi-Ln<jn/2)&&(Je-=.5)}return Je},fn=function(ci){xe(ci),Me==null||Me(ci)},ni=jt.useState(!1),Ge=(0,le.Z)(ni,2),Ke=Ge[0],nn=Ge[1],Qn=function(){nn(!0),he==null||he()},gn=function(){nn(!1),Ce==null||Ce()},an=jt.useState(null),zn=(0,le.Z)(an,2),gi=zn[0],ti=zn[1],wi=function(ci,Zi){var wt=dn(Zi,ci.pageX);wt!==Ve&&(ti(wt),tn(null)),Vn==null||Vn(wt)},Wi=function(ci){Qe||(ti(null),tn(null),Vn==null||Vn(void 0)),ci&&(Si==null||Si(ci))},Cn=function(ci,Zi){var wt=dn(Zi,ci.pageX),Je=!1;Ye&&(Je=wt===Xe),Wi(),fn(Je?0:wt),tn(Je?wt:null)},Pn=function(ci){var Zi=ci.keyCode,wt=En==="rtl",Je=ve?.5:1;qe&&(Zi===pe.Z.RIGHT&&Xe<ie&&!wt?(fn(Xe+Je),ci.preventDefault()):Zi===pe.Z.LEFT&&Xe>0&&!wt||Zi===pe.Z.RIGHT&&Xe>0&&wt?(fn(Xe-Je),ci.preventDefault()):Zi===pe.Z.LEFT&&Xe<ie&&wt&&(fn(Xe+Je),ci.preventDefault())),Yn==null||Yn(ci)};jt.useEffect(function(){cn&&!Qe&&Yt()},[]);var Bn=new Array(ie).fill(0).map(function(Ei,ci){return jt.createElement(ae,{ref:zt(ci),index:ci,count:ie,disabled:Qe,prefixCls:"".concat(It,"-star"),allowHalf:ve,value:gi===null?Xe:gi,onClick:Cn,onHover:wi,key:Ei||ci,character:te,characterRender:Xt,focused:Ke})}),si=Dt()(It,qt,(0,Kt.Z)((0,Kt.Z)({},"".concat(It,"-disabled"),Qe),"".concat(It,"-rtl"),En==="rtl"));return jt.createElement("ul",(0,ft.Z)({className:si,onMouseLeave:Wi,tabIndex:Qe?-1:on,onFocus:Qe?null:Qn,onBlur:Qe?null:gn,onKeyDown:Qe?null:Pn,ref:Mt},(0,Jt.Z)(Rt,{aria:!0,data:!0,attr:!0})),Bn)}var pt=jt.forwardRef(st),vt=pt},6551:function(Mn,Rn,kt){"use strict";kt.d(Rn,{ZP:function(){return ee}});var ft=kt(50298),Kt=kt(59301),le=kt(47273),we=0,ue=(0,le.Z)();function Dt(){var pe;return ue?(pe=we,we+=1):pe="TEST_OR_SSR",pe}function ee(pe){var Jt=Kt.useState(),jt=(0,ft.Z)(Jt,2),De=jt[0],ae=jt[1];return Kt.useEffect(function(){ae("rc_select_".concat(Dt()))},[]),pe||De}},37463:function(Mn,Rn,kt){"use strict";kt.d(Rn,{Ac:function(){return nn},Xo:function(){return gn},Wx:function(){return zn},ZP:function(){return Tn},lk:function(){return vt}});var ft=kt(14809),Kt=kt(95190),le=kt(4635),we=kt(20439),ue=kt(50298),Dt=kt(62646),ee=kt(93664),pe=kt(18929),Jt=kt(48736),jt=kt(59301),De=kt(92310),ae=kt.n(De),Le=kt(34280),Bt=kt(49658),nt=kt(8654),et=function(me){var bn=me.className,_n=me.customizeIcon,ze=me.customizeIconProps,hn=me.children,Nn=me.onMouseDown,In=me.onClick,vi=typeof _n=="function"?_n(ze):_n;return jt.createElement("span",{className:bn,onMouseDown:function(ii){ii.preventDefault(),Nn==null||Nn(ii)},style:{userSelect:"none",WebkitUserSelect:"none"},unselectable:"on",onClick:In,"aria-hidden":!0},vi!==void 0?vi:jt.createElement("span",{className:ae()(bn.split(/\s+/).map(function(Jn){return"".concat(Jn,"-icon")}))},hn))},ht=et,st=function(me,bn,_n,ze,hn){var Nn=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!1,In=arguments.length>6?arguments[6]:void 0,vi=arguments.length>7?arguments[7]:void 0,Jn=jt.useMemo(function(){if((0,ee.Z)(ze)==="object")return ze.clearIcon;if(hn)return hn},[ze,hn]),ii=jt.useMemo(function(){return!!(!Nn&&ze&&(_n.length||In)&&!(vi==="combobox"&&In===""))},[ze,Nn,_n.length,In,vi]);return{allowClear:ii,clearIcon:jt.createElement(ht,{className:"".concat(me,"-clear"),onMouseDown:bn,customizeIcon:Jn},"\xD7")}},pt=jt.createContext(null);function vt(){return jt.useContext(pt)}function St(){var Qt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:10,me=jt.useState(!1),bn=(0,ue.Z)(me,2),_n=bn[0],ze=bn[1],hn=jt.useRef(null),Nn=function(){window.clearTimeout(hn.current)};jt.useEffect(function(){return Nn},[]);var In=function(Jn,ii){Nn(),hn.current=window.setTimeout(function(){ze(Jn),ii&&ii()},Qt)};return[_n,In,Nn]}function Et(){var Qt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:250,me=jt.useRef(null),bn=jt.useRef(null);jt.useEffect(function(){return function(){window.clearTimeout(bn.current)}},[]);function _n(ze){(ze||me.current===null)&&(me.current=ze),window.clearTimeout(bn.current),bn.current=window.setTimeout(function(){me.current=null},Qt)}return[function(){return me.current},_n]}function At(Qt,me,bn,_n){var ze=jt.useRef(null);ze.current={open:me,triggerOpen:bn,customizedTrigger:_n},jt.useEffect(function(){function hn(Nn){var In;if(!((In=ze.current)!==null&&In!==void 0&&In.customizedTrigger)){var vi=Nn.target;vi.shadowRoot&&Nn.composed&&(vi=Nn.composedPath()[0]||vi),ze.current.open&&Qt().filter(function(Jn){return Jn}).every(function(Jn){return!Jn.contains(vi)&&Jn!==vi})&&ze.current.triggerOpen(!1)}}return window.addEventListener("mousedown",hn),function(){return window.removeEventListener("mousedown",hn)}},[])}var It=kt(10228);function qt(Qt){return Qt&&![It.Z.ESC,It.Z.SHIFT,It.Z.BACKSPACE,It.Z.TAB,It.Z.WIN_KEY,It.Z.ALT,It.Z.META,It.Z.WIN_KEY_RIGHT,It.Z.CTRL,It.Z.SEMICOLON,It.Z.EQUALS,It.Z.CAPS_LOCK,It.Z.CONTEXT_MENU,It.Z.F1,It.Z.F2,It.Z.F3,It.Z.F4,It.Z.F5,It.Z.F6,It.Z.F7,It.Z.F8,It.Z.F9,It.Z.F10,It.Z.F11,It.Z.F12].includes(Qt)}var Ut=kt(26112),Gt=kt(11780);function ge(Qt,me,bn){var _n=(0,we.Z)((0,we.Z)({},Qt),bn?me:{});return Object.keys(me).forEach(function(ze){var hn=me[ze];typeof hn=="function"&&(_n[ze]=function(){for(var Nn,In=arguments.length,vi=new Array(In),Jn=0;Jn<In;Jn++)vi[Jn]=arguments[Jn];return hn.apply(void 0,vi),(Nn=Qt[ze])===null||Nn===void 0?void 0:Nn.call.apply(Nn,[Qt].concat(vi))})}),_n}var ie=ge,Te=["prefixCls","id","inputElement","autoFocus","autoComplete","editable","activeDescendantId","value","open","attrs"],ve=function(me,bn){var _n=me.prefixCls,ze=me.id,hn=me.inputElement,Nn=me.autoFocus,In=me.autoComplete,vi=me.editable,Jn=me.activeDescendantId,ii=me.value,hi=me.open,Ii=me.attrs,Di=(0,Dt.Z)(me,Te),mn=hn||jt.createElement("input",null),oi=mn,fr=oi.ref,Mr=oi.props;return(0,Jt.Kp)(!("maxLength"in mn.props),"Passing 'maxLength' to input element directly may not work because input in BaseSelect is controlled."),mn=jt.cloneElement(mn,(0,we.Z)((0,we.Z)((0,we.Z)({type:"search"},ie(Di,Mr,!0)),{},{id:ze,ref:(0,nt.sQ)(bn,fr),autoComplete:In||"off",autoFocus:Nn,className:ae()("".concat(_n,"-selection-search-input"),Mr==null?void 0:Mr.className),role:"combobox","aria-expanded":hi||!1,"aria-haspopup":"listbox","aria-owns":"".concat(ze,"_list"),"aria-autocomplete":"list","aria-controls":"".concat(ze,"_list"),"aria-activedescendant":hi?Jn:void 0},Ii),{},{value:vi?ii:"",readOnly:!vi,unselectable:vi?null:"on",style:(0,we.Z)((0,we.Z)({},Mr.style),{},{opacity:vi?null:0})})),mn},ye=jt.forwardRef(ve),Ye=ye;function Ze(Qt){return Array.isArray(Qt)?Qt:Qt!==void 0?[Qt]:[]}var qe=typeof window!="undefined"&&window.document&&window.document.documentElement,pn=qe;function te(Qt){return Qt!=null}function Xt(Qt){return!Qt&&Qt!==0}function Qe(Qt){return["string","number"].includes((0,ee.Z)(Qt))}function On(Qt){var me=void 0;return Qt&&(Qe(Qt.title)?me=Qt.title.toString():Qe(Qt.label)&&(me=Qt.label.toString())),me}function En(Qt,me){pn?jt.useLayoutEffect(Qt,me):jt.useEffect(Qt,me)}function Ie(Qt){var me;return(me=Qt.key)!==null&&me!==void 0?me:Qt.value}var on=function(me){me.preventDefault(),me.stopPropagation()},cn=function(me){var bn=me.id,_n=me.prefixCls,ze=me.values,hn=me.open,Nn=me.searchValue,In=me.autoClearSearchValue,vi=me.inputRef,Jn=me.placeholder,ii=me.disabled,hi=me.mode,Ii=me.showSearch,Di=me.autoFocus,mn=me.autoComplete,oi=me.activeDescendantId,fr=me.tabIndex,Mr=me.removeIcon,Xr=me.maxTagCount,Ae=me.maxTagTextLength,ri=me.maxTagPlaceholder,Ri=ri===void 0?function($n){return"+ ".concat($n.length," ...")}:ri,fi=me.tagRender,br=me.onToggleOpen,ur=me.onRemove,Lr=me.onInputChange,Dr=me.onInputPaste,Zr=me.onInputKeyDown,Jr=me.onInputMouseDown,un=me.onInputCompositionStart,yo=me.onInputCompositionEnd,vn=me.onInputBlur,Gi=jt.useRef(null),Wr=(0,jt.useState)(0),Oi=(0,ue.Z)(Wr,2),ko=Oi[0],Ur=Oi[1],Cr=(0,jt.useState)(!1),Lo=(0,ue.Z)(Cr,2),je=Lo[0],xn=Lo[1],be="".concat(_n,"-selection"),Tt=hn||hi==="multiple"&&In===!1||hi==="tags"?Nn:"",Dn=hi==="tags"||hi==="multiple"&&In===!1||Ii&&(hn||je);En(function(){Ur(Gi.current.scrollWidth)},[Tt]);var ei=function(An,Xn,Zn,ai,pi){return jt.createElement("span",{title:On(An),className:ae()("".concat(be,"-item"),(0,le.Z)({},"".concat(be,"-item-disabled"),Zn))},jt.createElement("span",{className:"".concat(be,"-item-content")},Xn),ai&&jt.createElement(ht,{className:"".concat(be,"-item-remove"),onMouseDown:on,onClick:pi,customizeIcon:Mr},"\xD7"))},Ni=function(An,Xn,Zn,ai,pi,en){var Qi=function(Vr){on(Vr),br(!hn)};return jt.createElement("span",{onMouseDown:Qi},fi({label:Xn,value:An,disabled:Zn,closable:ai,onClose:pi,isMaxTag:!!en}))},Li=function(An){var Xn=An.disabled,Zn=An.label,ai=An.value,pi=!ii&&!Xn,en=Zn;if(typeof Ae=="number"&&(typeof Zn=="string"||typeof Zn=="number")){var Qi=String(en);Qi.length>Ae&&(en="".concat(Qi.slice(0,Ae),"..."))}var tr=function(or){or&&or.stopPropagation(),ur(An)};return typeof fi=="function"?Ni(ai,en,Xn,pi,tr):ei(An,en,Xn,pi,tr)},di=function(An){if(!ze.length)return null;var Xn=typeof Ri=="function"?Ri(An):Ri;return typeof fi=="function"?Ni(void 0,Xn,!1,!1,void 0,!0):ei({title:Xn},Xn,!1)},yn=jt.createElement("div",{className:"".concat(be,"-search"),style:{width:ko},onFocus:function(){xn(!0)},onBlur:function(){xn(!1)}},jt.createElement(Ye,{ref:vi,open:hn,prefixCls:_n,id:bn,inputElement:null,disabled:ii,autoFocus:Di,autoComplete:mn,editable:Dn,activeDescendantId:oi,value:Tt,onKeyDown:Zr,onMouseDown:Jr,onChange:Lr,onPaste:Dr,onCompositionStart:un,onCompositionEnd:yo,onBlur:vn,tabIndex:fr,attrs:(0,Ut.Z)(me,!0)}),jt.createElement("span",{ref:Gi,className:"".concat(be,"-search-mirror"),"aria-hidden":!0},Tt,"\xA0")),Un=jt.createElement(Gt.Z,{prefixCls:"".concat(be,"-overflow"),data:ze,renderItem:Li,renderRest:di,suffix:yn,itemKey:Ie,maxCount:Xr});return jt.createElement("span",{className:"".concat(be,"-wrap")},Un,!ze.length&&!Tt&&jt.createElement("span",{className:"".concat(be,"-placeholder")},Jn))},Vn=cn,Me=function(me){var bn=me.inputElement,_n=me.prefixCls,ze=me.id,hn=me.inputRef,Nn=me.disabled,In=me.autoFocus,vi=me.autoComplete,Jn=me.activeDescendantId,ii=me.mode,hi=me.open,Ii=me.values,Di=me.placeholder,mn=me.tabIndex,oi=me.showSearch,fr=me.searchValue,Mr=me.activeValue,Xr=me.maxLength,Ae=me.onInputKeyDown,ri=me.onInputMouseDown,Ri=me.onInputChange,fi=me.onInputPaste,br=me.onInputCompositionStart,ur=me.onInputCompositionEnd,Lr=me.onInputBlur,Dr=me.title,Zr=jt.useState(!1),Jr=(0,ue.Z)(Zr,2),un=Jr[0],yo=Jr[1],vn=ii==="combobox",Gi=vn||oi,Wr=Ii[0],Oi=fr||"";vn&&Mr&&!un&&(Oi=Mr),jt.useEffect(function(){vn&&yo(!1)},[vn,Mr]);var ko=ii!=="combobox"&&!hi&&!oi?!1:!!Oi,Ur=Dr===void 0?On(Wr):Dr,Cr=jt.useMemo(function(){return Wr?null:jt.createElement("span",{className:"".concat(_n,"-selection-placeholder"),style:ko?{visibility:"hidden"}:void 0},Di)},[Wr,ko,Di,_n]);return jt.createElement("span",{className:"".concat(_n,"-selection-wrap")},jt.createElement("span",{className:"".concat(_n,"-selection-search")},jt.createElement(Ye,{ref:hn,prefixCls:_n,id:ze,open:hi,inputElement:bn,disabled:Nn,autoFocus:In,autoComplete:vi,editable:Gi,activeDescendantId:Jn,value:Oi,onKeyDown:Ae,onMouseDown:ri,onChange:function(je){yo(!0),Ri(je)},onPaste:fi,onCompositionStart:br,onCompositionEnd:ur,onBlur:Lr,tabIndex:mn,attrs:(0,Ut.Z)(me,!0),maxLength:vn?Xr:void 0})),!vn&&Wr?jt.createElement("span",{className:"".concat(_n,"-selection-item"),title:Ur,style:ko?{visibility:"hidden"}:void 0},Wr.label):null,Cr)},he=Me,Ce=function(me,bn){var _n=(0,jt.useRef)(null),ze=(0,jt.useRef)(!1),hn=me.prefixCls,Nn=me.open,In=me.mode,vi=me.showSearch,Jn=me.tokenWithEnter,ii=me.disabled,hi=me.prefix,Ii=me.autoClearSearchValue,Di=me.onSearch,mn=me.onSearchSubmit,oi=me.onToggleOpen,fr=me.onInputKeyDown,Mr=me.onInputBlur,Xr=me.domRef;jt.useImperativeHandle(bn,function(){return{focus:function(Ur){_n.current.focus(Ur)},blur:function(){_n.current.blur()}}});var Ae=Et(0),ri=(0,ue.Z)(Ae,2),Ri=ri[0],fi=ri[1],br=function(Ur){var Cr=Ur.which,Lo=_n.current instanceof HTMLTextAreaElement;!Lo&&Nn&&(Cr===It.Z.UP||Cr===It.Z.DOWN)&&Ur.preventDefault(),fr&&fr(Ur),Cr===It.Z.ENTER&&In==="tags"&&!ze.current&&!Nn&&(mn==null||mn(Ur.target.value)),!(Lo&&!Nn&&~[It.Z.UP,It.Z.DOWN,It.Z.LEFT,It.Z.RIGHT].indexOf(Cr))&&qt(Cr)&&oi(!0)},ur=function(){fi(!0)},Lr=(0,jt.useRef)(null),Dr=function(Ur){Di(Ur,!0,ze.current)!==!1&&oi(!0)},Zr=function(){ze.current=!0},Jr=function(Ur){ze.current=!1,In!=="combobox"&&Dr(Ur.target.value)},un=function(Ur){var Cr=Ur.target.value;if(Jn&&Lr.current&&/[\r\n]/.test(Lr.current)){var Lo=Lr.current.replace(/[\r\n]+$/,"").replace(/\r\n/g," ").replace(/[\r\n]/g," ");Cr=Cr.replace(Lo,Lr.current)}Lr.current=null,Dr(Cr)},yo=function(Ur){var Cr=Ur.clipboardData,Lo=Cr==null?void 0:Cr.getData("text");Lr.current=Lo||""},vn=function(Ur){var Cr=Ur.target;if(Cr!==_n.current){var Lo=document.body.style.msTouchAction!==void 0;Lo?setTimeout(function(){_n.current.focus()}):_n.current.focus()}},Gi=function(Ur){var Cr=Ri();Ur.target!==_n.current&&!Cr&&!(In==="combobox"&&ii)&&Ur.preventDefault(),(In!=="combobox"&&(!vi||!Cr)||!Nn)&&(Nn&&Ii!==!1&&Di("",!0,!1),oi())},Wr={inputRef:_n,onInputKeyDown:br,onInputMouseDown:ur,onInputChange:un,onInputPaste:yo,onInputCompositionStart:Zr,onInputCompositionEnd:Jr,onInputBlur:Mr},Oi=In==="multiple"||In==="tags"?jt.createElement(Vn,(0,ft.Z)({},me,Wr)):jt.createElement(he,(0,ft.Z)({},me,Wr));return jt.createElement("div",{ref:Xr,className:"".concat(hn,"-selector"),onClick:vn,onMouseDown:Gi},hi&&jt.createElement("div",{className:"".concat(hn,"-prefix")},hi),Oi)},Yn=jt.forwardRef(Ce),Si=Yn,Rt=kt(65966),Ft=["prefixCls","disabled","visible","children","popupElement","animation","transitionName","dropdownStyle","dropdownClassName","direction","placement","builtinPlacements","dropdownMatchSelectWidth","dropdownRender","dropdownAlign","getPopupContainer","empty","getTriggerDOMNode","onPopupVisibleChange","onPopupMouseEnter"],Pt=function(me){var bn=me===!0?0:1;return{bottomLeft:{points:["tl","bl"],offset:[0,4],overflow:{adjustX:bn,adjustY:1},htmlRegion:"scroll"},bottomRight:{points:["tr","br"],offset:[0,4],overflow:{adjustX:bn,adjustY:1},htmlRegion:"scroll"},topLeft:{points:["bl","tl"],offset:[0,-4],overflow:{adjustX:bn,adjustY:1},htmlRegion:"scroll"},topRight:{points:["br","tr"],offset:[0,-4],overflow:{adjustX:bn,adjustY:1},htmlRegion:"scroll"}}},Nt=function(me,bn){var _n=me.prefixCls,ze=me.disabled,hn=me.visible,Nn=me.children,In=me.popupElement,vi=me.animation,Jn=me.transitionName,ii=me.dropdownStyle,hi=me.dropdownClassName,Ii=me.direction,Di=Ii===void 0?"ltr":Ii,mn=me.placement,oi=me.builtinPlacements,fr=me.dropdownMatchSelectWidth,Mr=me.dropdownRender,Xr=me.dropdownAlign,Ae=me.getPopupContainer,ri=me.empty,Ri=me.getTriggerDOMNode,fi=me.onPopupVisibleChange,br=me.onPopupMouseEnter,ur=(0,Dt.Z)(me,Ft),Lr="".concat(_n,"-dropdown"),Dr=In;Mr&&(Dr=Mr(In));var Zr=jt.useMemo(function(){return oi||Pt(fr)},[oi,fr]),Jr=vi?"".concat(Lr,"-").concat(vi):Jn,un=typeof fr=="number",yo=jt.useMemo(function(){return un?null:fr===!1?"minWidth":"width"},[fr,un]),vn=ii;un&&(vn=(0,we.Z)((0,we.Z)({},vn),{},{width:fr}));var Gi=jt.useRef(null);return jt.useImperativeHandle(bn,function(){return{getPopupElement:function(){var Oi;return(Oi=Gi.current)===null||Oi===void 0?void 0:Oi.popupElement}}}),jt.createElement(Rt.Z,(0,ft.Z)({},ur,{showAction:fi?["click"]:[],hideAction:fi?["click"]:[],popupPlacement:mn||(Di==="rtl"?"bottomRight":"bottomLeft"),builtinPlacements:Zr,prefixCls:Lr,popupTransitionName:Jr,popup:jt.createElement("div",{onMouseEnter:br},Dr),ref:Gi,stretch:yo,popupAlign:Xr,popupVisible:hn,getPopupContainer:Ae,popupClassName:ae()(hi,(0,le.Z)({},"".concat(Lr,"-empty"),ri)),popupStyle:vn,getTriggerDOMNode:Ri,onPopupVisibleChange:fi}),Nn)},zt=jt.forwardRef(Nt),Mt=zt,Yt=kt(21696);function He(Qt,me){var bn=Qt.key,_n;return"value"in Qt&&(_n=Qt.value),bn!=null?bn:_n!==void 0?_n:"rc-index-key-".concat(me)}function _e(Qt){return typeof Qt!="undefined"&&!Number.isNaN(Qt)}function Xe(Qt,me){var bn=Qt||{},_n=bn.label,ze=bn.value,hn=bn.options,Nn=bn.groupLabel,In=_n||(me?"children":"label");return{label:In,value:ze||"value",options:hn||"options",groupLabel:Nn||In}}function xe(Qt){var me=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},bn=me.fieldNames,_n=me.childrenAsData,ze=[],hn=Xe(bn,!1),Nn=hn.label,In=hn.value,vi=hn.options,Jn=hn.groupLabel;function ii(hi,Ii){Array.isArray(hi)&&hi.forEach(function(Di){if(Ii||!(vi in Di)){var mn=Di[In];ze.push({key:He(Di,ze.length),groupOption:Ii,data:Di,label:Di[Nn],value:mn})}else{var oi=Di[Jn];oi===void 0&&_n&&(oi=Di.label),ze.push({key:He(Di,ze.length),group:!0,data:Di,label:oi}),ii(Di[vi],!0)}})}return ii(Qt,!1),ze}function Pe(Qt){var me=(0,we.Z)({},Qt);return"props"in me||Object.defineProperty(me,"props",{get:function(){return(0,Jt.ZP)(!1,"Return type is option instead of Option instance. Please read value directly instead of reading from `props`."),me}}),me}var ke=function(me,bn,_n){if(!bn||!bn.length)return null;var ze=!1,hn=function In(vi,Jn){var ii=(0,Yt.Z)(Jn),hi=ii[0],Ii=ii.slice(1);if(!hi)return[vi];var Di=vi.split(hi);return ze=ze||Di.length>1,Di.reduce(function(mn,oi){return[].concat((0,Kt.Z)(mn),(0,Kt.Z)(In(oi,Ii)))},[]).filter(Boolean)},Nn=hn(me,bn);return ze?typeof _n!="undefined"?Nn.slice(0,_n):Nn:null},Ve=jt.createContext(null),tn=Ve;function dn(Qt){var me=Qt.visible,bn=Qt.values;if(!me)return null;var _n=50;return jt.createElement("span",{"aria-live":"polite",style:{width:0,height:0,position:"absolute",overflow:"hidden",opacity:0}},"".concat(bn.slice(0,_n).map(function(ze){var hn=ze.label,Nn=ze.value;return["number","string"].includes((0,ee.Z)(hn))?hn:Nn}).join(", ")),bn.length>_n?", ...":null)}var fn=["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"],Ge=function(me){return me==="tags"||me==="multiple"},Ke=jt.forwardRef(function(Qt,me){var bn,_n=Qt.id,ze=Qt.prefixCls,hn=Qt.className,Nn=Qt.showSearch,In=Qt.tagRender,vi=Qt.direction,Jn=Qt.omitDomProps,ii=Qt.displayValues,hi=Qt.onDisplayValuesChange,Ii=Qt.emptyOptions,Di=Qt.notFoundContent,mn=Di===void 0?"Not Found":Di,oi=Qt.onClear,fr=Qt.mode,Mr=Qt.disabled,Xr=Qt.loading,Ae=Qt.getInputElement,ri=Qt.getRawInputElement,Ri=Qt.open,fi=Qt.defaultOpen,br=Qt.onDropdownVisibleChange,ur=Qt.activeValue,Lr=Qt.onActiveValueChange,Dr=Qt.activeDescendantId,Zr=Qt.searchValue,Jr=Qt.autoClearSearchValue,un=Qt.onSearch,yo=Qt.onSearchSplit,vn=Qt.tokenSeparators,Gi=Qt.allowClear,Wr=Qt.prefix,Oi=Qt.suffixIcon,ko=Qt.clearIcon,Ur=Qt.OptionList,Cr=Qt.animation,Lo=Qt.transitionName,je=Qt.dropdownStyle,xn=Qt.dropdownClassName,be=Qt.dropdownMatchSelectWidth,Tt=Qt.dropdownRender,Dn=Qt.dropdownAlign,ei=Qt.placement,Ni=Qt.builtinPlacements,Li=Qt.getPopupContainer,di=Qt.showAction,yn=di===void 0?[]:di,Un=Qt.onFocus,$n=Qt.onBlur,An=Qt.onKeyUp,Xn=Qt.onKeyDown,Zn=Qt.onMouseDown,ai=(0,Dt.Z)(Qt,fn),pi=Ge(fr),en=(Nn!==void 0?Nn:pi)||fr==="combobox",Qi=(0,we.Z)({},ai);ni.forEach(function(Co){delete Qi[Co]}),Jn==null||Jn.forEach(function(Co){delete Qi[Co]});var tr=jt.useState(!1),Vr=(0,ue.Z)(tr,2),or=Vr[0],so=Vr[1];jt.useEffect(function(){so((0,Bt.Z)())},[]);var qr=jt.useRef(null),po=jt.useRef(null),ro=jt.useRef(null),Po=jt.useRef(null),Bo=jt.useRef(null),Oe=jt.useRef(!1),lo=St(),Gr=(0,ue.Z)(lo,3),Sr=Gr[0],hr=Gr[1],oo=Gr[2];jt.useImperativeHandle(me,function(){var Co,Ao;return{focus:(Co=Po.current)===null||Co===void 0?void 0:Co.focus,blur:(Ao=Po.current)===null||Ao===void 0?void 0:Ao.blur,scrollTo:function(oe){var Re;return(Re=Bo.current)===null||Re===void 0?void 0:Re.scrollTo(oe)},nativeElement:qr.current||po.current}});var Fo=jt.useMemo(function(){var Co;if(fr!=="combobox")return Zr;var Ao=(Co=ii[0])===null||Co===void 0?void 0:Co.value;return typeof Ao=="string"||typeof Ao=="number"?String(Ao):""},[Zr,fr,ii]),wo=fr==="combobox"&&typeof Ae=="function"&&Ae()||null,zr=typeof ri=="function"&&ri(),Or=(0,nt.x1)(po,zr==null||(bn=zr.props)===null||bn===void 0?void 0:bn.ref),ha=jt.useState(!1),Ia=(0,ue.Z)(ha,2),bs=Ia[0],Ba=Ia[1];(0,Le.Z)(function(){Ba(!0)},[]);var dr=(0,pe.Z)(!1,{defaultValue:fi,value:Ri}),$o=(0,ue.Z)(dr,2),qo=$o[0],ca=$o[1],ia=bs?qo:!1,fa=!mn&&Ii;(Mr||fa&&ia&&fr==="combobox")&&(ia=!1);var yi=fa?!1:ia,ar=jt.useCallback(function(Co){var Ao=Co!==void 0?Co:!ia;Mr||(ca(Ao),ia!==Ao&&(br==null||br(Ao)))},[Mr,ia,ca,br]),_r=jt.useMemo(function(){return(vn||[]).some(function(Co){return[`
|
|
`,`\r
|
|
`].includes(Co)})},[vn]),$r=jt.useContext(tn)||{},co=$r.maxCount,zo=$r.rawValues,cr=function(Ao,Ta,oe){if(!(pi&&_e(co)&&(zo==null?void 0:zo.size)>=co)){var Re=!0,_t=Ao;Lr==null||Lr(null);var ce=ke(Ao,vn,_e(co)?co-zo.size:void 0),Rr=oe?null:ce;return fr!=="combobox"&&Rr&&(_t="",yo==null||yo(Rr),ar(!1),Re=!1),un&&Fo!==_t&&un(_t,{source:Ta?"typing":"effect"}),Re}},Ya=function(Ao){!Ao||!Ao.trim()||un(Ao,{source:"submit"})};jt.useEffect(function(){!ia&&!pi&&fr!=="combobox"&&cr("",!1,!1)},[ia]),jt.useEffect(function(){qo&&Mr&&ca(!1),Mr&&!Oe.current&&hr(!1)},[Mr]);var da=Et(),Yo=(0,ue.Z)(da,2),io=Yo[0],Sa=Yo[1],ns=jt.useRef(!1),Jo=function(Ao){var Ta=io(),oe=Ao.key,Re=oe==="Enter";if(Re&&(fr!=="combobox"&&Ao.preventDefault(),ia||ar(!0)),Sa(!!Fo),oe==="Backspace"&&!Ta&&pi&&!Fo&&ii.length){for(var _t=(0,Kt.Z)(ii),ce=null,Rr=_t.length-1;Rr>=0;Rr-=1){var vr=_t[Rr];if(!vr.disabled){_t.splice(Rr,1),ce=vr;break}}ce&&hi(_t,{type:"remove",values:[ce]})}for(var Fr=arguments.length,sr=new Array(Fr>1?Fr-1:0),Pr=1;Pr<Fr;Pr++)sr[Pr-1]=arguments[Pr];if(ia&&(!Re||!ns.current)){var fo;Re&&(ns.current=!0),(fo=Bo.current)===null||fo===void 0||fo.onKeyDown.apply(fo,[Ao].concat(sr))}Xn==null||Xn.apply(void 0,[Ao].concat(sr))},ps=function(Ao){for(var Ta=arguments.length,oe=new Array(Ta>1?Ta-1:0),Re=1;Re<Ta;Re++)oe[Re-1]=arguments[Re];if(ia){var _t;(_t=Bo.current)===null||_t===void 0||_t.onKeyUp.apply(_t,[Ao].concat(oe))}Ao.key==="Enter"&&(ns.current=!1),An==null||An.apply(void 0,[Ao].concat(oe))},ms=function(Ao){var Ta=ii.filter(function(oe){return oe!==Ao});hi(Ta,{type:"remove",values:[Ao]})},Rs=function(){ns.current=!1},La=jt.useRef(!1),Iu=function(){hr(!0),Mr||(Un&&!La.current&&Un.apply(void 0,arguments),yn.includes("focus")&&ar(!0)),La.current=!0},Cu=function(){Oe.current=!0,hr(!1,function(){La.current=!1,Oe.current=!1,ar(!1)}),!Mr&&(Fo&&(fr==="tags"?un(Fo,{source:"submit"}):fr==="multiple"&&un("",{source:"blur"})),$n&&$n.apply(void 0,arguments))},js=[];jt.useEffect(function(){return function(){js.forEach(function(Co){return clearTimeout(Co)}),js.splice(0,js.length)}},[]);var Nl=function(Ao){var Ta,oe=Ao.target,Re=(Ta=ro.current)===null||Ta===void 0?void 0:Ta.getPopupElement();if(Re&&Re.contains(oe)){var _t=setTimeout(function(){var Fr=js.indexOf(_t);if(Fr!==-1&&js.splice(Fr,1),oo(),!or&&!Re.contains(document.activeElement)){var sr;(sr=Po.current)===null||sr===void 0||sr.focus()}});js.push(_t)}for(var ce=arguments.length,Rr=new Array(ce>1?ce-1:0),vr=1;vr<ce;vr++)Rr[vr-1]=arguments[vr];Zn==null||Zn.apply(void 0,[Ao].concat(Rr))},zs=jt.useState({}),Vl=(0,ue.Z)(zs,2),lu=Vl[1];function Eu(){lu({})}var xa;zr&&(xa=function(Ao){ar(Ao)}),At(function(){var Co;return[qr.current,(Co=ro.current)===null||Co===void 0?void 0:Co.getPopupElement()]},yi,ar,!!zr);var rl=jt.useMemo(function(){return(0,we.Z)((0,we.Z)({},Qt),{},{notFoundContent:mn,open:ia,triggerOpen:yi,id:_n,showSearch:en,multiple:pi,toggleOpen:ar})},[Qt,mn,yi,ia,_n,en,pi,ar]),_u=!!Oi||Xr,Kl;_u&&(Kl=jt.createElement(ht,{className:ae()("".concat(ze,"-arrow"),(0,le.Z)({},"".concat(ze,"-arrow-loading"),Xr)),customizeIcon:Oi,customizeIconProps:{loading:Xr,searchValue:Fo,open:ia,focused:Sr,showSearch:en}}));var uu=function(){var Ao;oi==null||oi(),(Ao=Po.current)===null||Ao===void 0||Ao.focus(),hi([],{type:"clear",values:ii}),cr("",!1,!1)},Xa=st(ze,uu,ii,Gi,ko,Mr,Fo,fr),Ja=Xa.allowClear,Aa=Xa.clearIcon,Ga=jt.createElement(Ur,{ref:Bo}),Bl=ae()(ze,hn,(0,le.Z)((0,le.Z)((0,le.Z)((0,le.Z)((0,le.Z)((0,le.Z)((0,le.Z)((0,le.Z)((0,le.Z)((0,le.Z)({},"".concat(ze,"-focused"),Sr),"".concat(ze,"-multiple"),pi),"".concat(ze,"-single"),!pi),"".concat(ze,"-allow-clear"),Gi),"".concat(ze,"-show-arrow"),_u),"".concat(ze,"-disabled"),Mr),"".concat(ze,"-loading"),Xr),"".concat(ze,"-open"),ia),"".concat(ze,"-customize-input"),wo),"".concat(ze,"-show-search"),en)),ga=jt.createElement(Mt,{ref:ro,disabled:Mr,prefixCls:ze,visible:yi,popupElement:Ga,animation:Cr,transitionName:Lo,dropdownStyle:je,dropdownClassName:xn,direction:vi,dropdownMatchSelectWidth:be,dropdownRender:Tt,dropdownAlign:Dn,placement:ei,builtinPlacements:Ni,getPopupContainer:Li,empty:Ii,getTriggerDOMNode:function(Ao){return po.current||Ao},onPopupVisibleChange:xa,onPopupMouseEnter:Eu},zr?jt.cloneElement(zr,{ref:Or}):jt.createElement(Si,(0,ft.Z)({},Qt,{domRef:po,prefixCls:ze,inputElement:wo,ref:Po,id:_n,prefix:Wr,showSearch:en,autoClearSearchValue:Jr,mode:fr,activeDescendantId:Dr,tagRender:In,values:ii,open:ia,onToggleOpen:ar,activeValue:ur,searchValue:Fo,onSearch:cr,onSearchSubmit:Ya,onRemove:ms,tokenWithEnter:_r,onInputBlur:Rs}))),_o;return zr?_o=ga:_o=jt.createElement("div",(0,ft.Z)({className:Bl},Qi,{ref:qr,onMouseDown:Nl,onKeyDown:Jo,onKeyUp:ps,onFocus:Iu,onBlur:Cu}),jt.createElement(dn,{visible:Sr&&!ia,values:ii}),ga,Kl,Ja&&Aa),jt.createElement(pt.Provider,{value:rl},_o)}),nn=Ke,Qn=function(){return null};Qn.isSelectOptGroup=!0;var gn=Qn,an=function(){return null};an.isSelectOption=!0;var zn=an,gi=kt(80547),ti=kt(2738),wi=kt(6790);function Wi(){return/(mac\sos|macintosh)/i.test(navigator.appVersion)}var Cn=["disabled","title","children","style","className"];function Pn(Qt){return typeof Qt=="string"||typeof Qt=="number"}var Bn=function(me,bn){var _n=vt(),ze=_n.prefixCls,hn=_n.id,Nn=_n.open,In=_n.multiple,vi=_n.mode,Jn=_n.searchValue,ii=_n.toggleOpen,hi=_n.notFoundContent,Ii=_n.onPopupScroll,Di=jt.useContext(tn),mn=Di.maxCount,oi=Di.flattenOptions,fr=Di.onActiveValue,Mr=Di.defaultActiveFirstOption,Xr=Di.onSelect,Ae=Di.menuItemSelectedIcon,ri=Di.rawValues,Ri=Di.fieldNames,fi=Di.virtual,br=Di.direction,ur=Di.listHeight,Lr=Di.listItemHeight,Dr=Di.optionRender,Zr="".concat(ze,"-item"),Jr=(0,gi.Z)(function(){return oi},[Nn,oi],function(di,yn){return yn[0]&&di[1]!==yn[1]}),un=jt.useRef(null),yo=jt.useMemo(function(){return In&&_e(mn)&&(ri==null?void 0:ri.size)>=mn},[In,mn,ri==null?void 0:ri.size]),vn=function(yn){yn.preventDefault()},Gi=function(yn){var Un;(Un=un.current)===null||Un===void 0||Un.scrollTo(typeof yn=="number"?{index:yn}:yn)},Wr=jt.useCallback(function(di){return vi==="combobox"?!1:ri.has(di)},[vi,(0,Kt.Z)(ri).toString(),ri.size]),Oi=function(yn){for(var Un=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,$n=Jr.length,An=0;An<$n;An+=1){var Xn=(yn+An*Un+$n)%$n,Zn=Jr[Xn]||{},ai=Zn.group,pi=Zn.data;if(!ai&&!(pi!=null&&pi.disabled)&&(Wr(pi.value)||!yo))return Xn}return-1},ko=jt.useState(function(){return Oi(0)}),Ur=(0,ue.Z)(ko,2),Cr=Ur[0],Lo=Ur[1],je=function(yn){var Un=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;Lo(yn);var $n={source:Un?"keyboard":"mouse"},An=Jr[yn];if(!An){fr(null,-1,$n);return}fr(An.value,yn,$n)};(0,jt.useEffect)(function(){je(Mr!==!1?Oi(0):-1)},[Jr.length,Jn]);var xn=jt.useCallback(function(di){return vi==="combobox"?String(di).toLowerCase()===Jn.toLowerCase():ri.has(di)},[vi,Jn,(0,Kt.Z)(ri).toString(),ri.size]);(0,jt.useEffect)(function(){var di=setTimeout(function(){if(!In&&Nn&&ri.size===1){var Un=Array.from(ri)[0],$n=Jr.findIndex(function(An){var Xn=An.data;return Jn?String(Xn.value).startsWith(Jn):Xn.value===Un});$n!==-1&&(je($n),Gi($n))}});if(Nn){var yn;(yn=un.current)===null||yn===void 0||yn.scrollTo(void 0)}return function(){return clearTimeout(di)}},[Nn,Jn]);var be=function(yn){yn!==void 0&&Xr(yn,{selected:!ri.has(yn)}),In||ii(!1)};if(jt.useImperativeHandle(bn,function(){return{onKeyDown:function(yn){var Un=yn.which,$n=yn.ctrlKey;switch(Un){case It.Z.N:case It.Z.P:case It.Z.UP:case It.Z.DOWN:{var An=0;if(Un===It.Z.UP?An=-1:Un===It.Z.DOWN?An=1:Wi()&&$n&&(Un===It.Z.N?An=1:Un===It.Z.P&&(An=-1)),An!==0){var Xn=Oi(Cr+An,An);Gi(Xn),je(Xn,!0)}break}case It.Z.TAB:case It.Z.ENTER:{var Zn,ai=Jr[Cr];ai&&!(ai!=null&&(Zn=ai.data)!==null&&Zn!==void 0&&Zn.disabled)&&!yo?be(ai.value):be(void 0),Nn&&yn.preventDefault();break}case It.Z.ESC:ii(!1),Nn&&yn.stopPropagation()}},onKeyUp:function(){},scrollTo:function(yn){Gi(yn)}}}),Jr.length===0)return jt.createElement("div",{role:"listbox",id:"".concat(hn,"_list"),className:"".concat(Zr,"-empty"),onMouseDown:vn},hi);var Tt=Object.keys(Ri).map(function(di){return Ri[di]}),Dn=function(yn){return yn.label};function ei(di,yn){var Un=di.group;return{role:Un?"presentation":"option",id:"".concat(hn,"_list_").concat(yn)}}var Ni=function(yn){var Un=Jr[yn];if(!Un)return null;var $n=Un.data||{},An=$n.value,Xn=Un.group,Zn=(0,Ut.Z)($n,!0),ai=Dn(Un);return Un?jt.createElement("div",(0,ft.Z)({"aria-label":typeof ai=="string"&&!Xn?ai:null},Zn,{key:yn},ei(Un,yn),{"aria-selected":xn(An)}),An):null},Li={role:"listbox",id:"".concat(hn,"_list")};return jt.createElement(jt.Fragment,null,fi&&jt.createElement("div",(0,ft.Z)({},Li,{style:{height:0,width:0,overflow:"hidden"}}),Ni(Cr-1),Ni(Cr),Ni(Cr+1)),jt.createElement(wi.Z,{itemKey:"key",ref:un,data:Jr,height:ur,itemHeight:Lr,fullHeight:!1,onMouseDown:vn,onScroll:Ii,virtual:fi,direction:br,innerProps:fi?null:Li},function(di,yn){var Un=di.group,$n=di.groupOption,An=di.data,Xn=di.label,Zn=di.value,ai=An.key;if(Un){var pi,en=(pi=An.title)!==null&&pi!==void 0?pi:Pn(Xn)?Xn.toString():void 0;return jt.createElement("div",{className:ae()(Zr,"".concat(Zr,"-group"),An.className),title:en},Xn!==void 0?Xn:ai)}var Qi=An.disabled,tr=An.title,Vr=An.children,or=An.style,so=An.className,qr=(0,Dt.Z)(An,Cn),po=(0,ti.Z)(qr,Tt),ro=Wr(Zn),Po=Qi||!ro&&yo,Bo="".concat(Zr,"-option"),Oe=ae()(Zr,Bo,so,(0,le.Z)((0,le.Z)((0,le.Z)((0,le.Z)({},"".concat(Bo,"-grouped"),$n),"".concat(Bo,"-active"),Cr===yn&&!Po),"".concat(Bo,"-disabled"),Po),"".concat(Bo,"-selected"),ro)),lo=Dn(di),Gr=!Ae||typeof Ae=="function"||ro,Sr=typeof lo=="number"?lo:lo||Zn,hr=Pn(Sr)?Sr.toString():void 0;return tr!==void 0&&(hr=tr),jt.createElement("div",(0,ft.Z)({},(0,Ut.Z)(po),fi?{}:ei(di,yn),{"aria-selected":xn(Zn),className:Oe,title:hr,onMouseMove:function(){Cr===yn||Po||je(yn)},onClick:function(){Po||be(Zn)},style:or}),jt.createElement("div",{className:"".concat(Bo,"-content")},typeof Dr=="function"?Dr(di,{index:yn}):Sr),jt.isValidElement(Ae)||ro,Gr&&jt.createElement(ht,{className:"".concat(Zr,"-option-state"),customizeIcon:Ae,customizeIconProps:{value:Zn,disabled:Po,isSelected:ro}},ro?"\u2713":null))}))},si=jt.forwardRef(Bn),Ei=si,ci=function(Qt,me){var bn=jt.useRef({values:new Map,options:new Map}),_n=jt.useMemo(function(){var hn=bn.current,Nn=hn.values,In=hn.options,vi=Qt.map(function(hi){if(hi.label===void 0){var Ii;return(0,we.Z)((0,we.Z)({},hi),{},{label:(Ii=Nn.get(hi.value))===null||Ii===void 0?void 0:Ii.label})}return hi}),Jn=new Map,ii=new Map;return vi.forEach(function(hi){Jn.set(hi.value,hi),ii.set(hi.value,me.get(hi.value)||In.get(hi.value))}),bn.current.values=Jn,bn.current.options=ii,vi},[Qt,me]),ze=jt.useCallback(function(hn){return me.get(hn)||bn.current.options.get(hn)},[me]);return[_n,ze]};function Zi(Qt,me){return Ze(Qt).join("").toUpperCase().includes(me)}var wt=function(Qt,me,bn,_n,ze){return jt.useMemo(function(){if(!bn||_n===!1)return Qt;var hn=me.options,Nn=me.label,In=me.value,vi=[],Jn=typeof _n=="function",ii=bn.toUpperCase(),hi=Jn?_n:function(Di,mn){return ze?Zi(mn[ze],ii):mn[hn]?Zi(mn[Nn!=="children"?Nn:"label"],ii):Zi(mn[In],ii)},Ii=Jn?function(Di){return Pe(Di)}:function(Di){return Di};return Qt.forEach(function(Di){if(Di[hn]){var mn=hi(bn,Ii(Di));if(mn)vi.push(Di);else{var oi=Di[hn].filter(function(fr){return hi(bn,Ii(fr))});oi.length&&vi.push((0,we.Z)((0,we.Z)({},Di),{},(0,le.Z)({},hn,oi)))}return}hi(bn,Ii(Di))&&vi.push(Di)}),vi},[Qt,_n,ze,bn,me])},Je=kt(6551),Hn=kt(11592),Ln=["children","value"],jn=["children"];function li(Qt){var me=Qt,bn=me.key,_n=me.props,ze=_n.children,hn=_n.value,Nn=(0,Dt.Z)(_n,Ln);return(0,we.Z)({key:bn,value:hn!==void 0?hn:bn,children:ze},Nn)}function Ci(Qt){var me=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return(0,Hn.Z)(Qt).map(function(bn,_n){if(!jt.isValidElement(bn)||!bn.type)return null;var ze=bn,hn=ze.type.isSelectOptGroup,Nn=ze.key,In=ze.props,vi=In.children,Jn=(0,Dt.Z)(In,jn);return me||!hn?li(bn):(0,we.Z)((0,we.Z)({key:"__RC_SELECT_GRP__".concat(Nn===null?_n:Nn,"__"),label:Nn},Jn),{},{options:Ci(vi)})}).filter(function(bn){return bn})}var Yi=function(me,bn,_n,ze,hn){return jt.useMemo(function(){var Nn=me,In=!me;In&&(Nn=Ci(bn));var vi=new Map,Jn=new Map,ii=function(Di,mn,oi){oi&&typeof oi=="string"&&Di.set(mn[oi],mn)},hi=function Ii(Di){for(var mn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,oi=0;oi<Di.length;oi+=1){var fr=Di[oi];!fr[_n.options]||mn?(vi.set(fr[_n.value],fr),ii(Jn,fr,_n.label),ii(Jn,fr,ze),ii(Jn,fr,hn)):Ii(fr[_n.options],!0)}};return hi(Nn),{options:Nn,valueOptions:vi,labelOptions:Jn}},[me,bn,_n,ze,hn])},Be=Yi;function Se(Qt){var me=jt.useRef();me.current=Qt;var bn=jt.useCallback(function(){return me.current.apply(me,arguments)},[]);return bn}function Ee(Qt){var me=Qt.mode,bn=Qt.options,_n=Qt.children,ze=Qt.backfill,hn=Qt.allowClear,Nn=Qt.placeholder,In=Qt.getInputElement,vi=Qt.showSearch,Jn=Qt.onSearch,ii=Qt.defaultOpen,hi=Qt.autoFocus,Ii=Qt.labelInValue,Di=Qt.value,mn=Qt.inputValue,oi=Qt.optionLabelProp,fr=isMultiple(me),Mr=vi!==void 0?vi:fr||me==="combobox",Xr=bn||convertChildrenToData(_n);if(warning(me!=="tags"||Xr.every(function(fi){return!fi.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),me==="tags"||me==="combobox"){var Ae=Xr.some(function(fi){return fi.options?fi.options.some(function(br){return typeof("value"in br?br.value:br.key)=="number"}):typeof("value"in fi?fi.value:fi.key)=="number"});warning(!Ae,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(warning(me!=="combobox"||!oi,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),warning(me==="combobox"||!ze,"`backfill` only works with `combobox` mode."),warning(me==="combobox"||!In,"`getInputElement` only work with `combobox` mode."),noteOnce(me!=="combobox"||!In||!hn||!Nn,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),Jn&&!Mr&&me!=="combobox"&&me!=="tags"&&warning(!1,"`onSearch` should work with `showSearch` instead of use alone."),noteOnce(!ii||hi,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),Di!=null){var ri=toArray(Di);warning(!Ii||ri.every(function(fi){return _typeof(fi)==="object"&&("key"in fi||"value"in fi)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),warning(!fr||Array.isArray(Di),"`value` should be array when `mode` is `multiple` or `tags`")}if(_n){var Ri=null;toNodeArray(_n).some(function(fi){if(!React.isValidElement(fi)||!fi.type)return!1;var br=fi,ur=br.type;if(ur.isSelectOption)return!1;if(ur.isSelectOptGroup){var Lr=toNodeArray(fi.props.children).every(function(Dr){return!React.isValidElement(Dr)||!fi.type||Dr.type.isSelectOption?!0:(Ri=Dr.type,!1)});return!Lr}return Ri=ur,!0}),Ri&&warning(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(Ri.displayName||Ri.name||Ri,"`.")),warning(mn===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}function Ue(Qt,me){if(Qt){var bn=function _n(ze){for(var hn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Nn=0;Nn<ze.length;Nn++){var In=ze[Nn];if(In[me==null?void 0:me.value]===null)return warning(!1,"`value` in Select options should not be `null`."),!0;if(!hn&&Array.isArray(In[me==null?void 0:me.options])&&_n(In[me==null?void 0:me.options],!0))break}};bn(Qt)}}var xi=null,Kn=["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"],Pi=["inputValue"];function $e(Qt){return!Qt||(0,ee.Z)(Qt)!=="object"}var Gn=jt.forwardRef(function(Qt,me){var bn=Qt.id,_n=Qt.mode,ze=Qt.prefixCls,hn=ze===void 0?"rc-select":ze,Nn=Qt.backfill,In=Qt.fieldNames,vi=Qt.inputValue,Jn=Qt.searchValue,ii=Qt.onSearch,hi=Qt.autoClearSearchValue,Ii=hi===void 0?!0:hi,Di=Qt.onSelect,mn=Qt.onDeselect,oi=Qt.dropdownMatchSelectWidth,fr=oi===void 0?!0:oi,Mr=Qt.filterOption,Xr=Qt.filterSort,Ae=Qt.optionFilterProp,ri=Qt.optionLabelProp,Ri=Qt.options,fi=Qt.optionRender,br=Qt.children,ur=Qt.defaultActiveFirstOption,Lr=Qt.menuItemSelectedIcon,Dr=Qt.virtual,Zr=Qt.direction,Jr=Qt.listHeight,un=Jr===void 0?200:Jr,yo=Qt.listItemHeight,vn=yo===void 0?20:yo,Gi=Qt.labelRender,Wr=Qt.value,Oi=Qt.defaultValue,ko=Qt.labelInValue,Ur=Qt.onChange,Cr=Qt.maxCount,Lo=(0,Dt.Z)(Qt,Kn),je=(0,Je.ZP)(bn),xn=Ge(_n),be=!!(!Ri&&br),Tt=jt.useMemo(function(){return Mr===void 0&&_n==="combobox"?!1:Mr},[Mr,_n]),Dn=jt.useMemo(function(){return Xe(In,be)},[JSON.stringify(In),be]),ei=(0,pe.Z)("",{value:Jn!==void 0?Jn:vi,postState:function(_r){return _r||""}}),Ni=(0,ue.Z)(ei,2),Li=Ni[0],di=Ni[1],yn=Be(Ri,br,Dn,Ae,ri),Un=yn.valueOptions,$n=yn.labelOptions,An=yn.options,Xn=jt.useCallback(function(ar){var _r=Ze(ar);return _r.map(function($r){var co,zo,cr,Ya,da;if($e($r))co=$r;else{var Yo;cr=$r.key,zo=$r.label,co=(Yo=$r.value)!==null&&Yo!==void 0?Yo:cr}var io=Un.get(co);if(io){var Sa;if(zo===void 0&&(zo=io==null?void 0:io[ri||Dn.label]),cr===void 0&&(cr=(Sa=io==null?void 0:io.key)!==null&&Sa!==void 0?Sa:co),Ya=io==null?void 0:io.disabled,da=io==null?void 0:io.title,0)var ns}return{label:zo,value:co,key:cr,disabled:Ya,title:da}})},[Dn,ri,Un]),Zn=(0,pe.Z)(Oi,{value:Wr}),ai=(0,ue.Z)(Zn,2),pi=ai[0],en=ai[1],Qi=jt.useMemo(function(){var ar,_r=xn&&pi===null?[]:pi,$r=Xn(_r);return _n==="combobox"&&Xt((ar=$r[0])===null||ar===void 0?void 0:ar.value)?[]:$r},[pi,Xn,_n,xn]),tr=ci(Qi,Un),Vr=(0,ue.Z)(tr,2),or=Vr[0],so=Vr[1],qr=jt.useMemo(function(){if(!_n&&or.length===1){var ar=or[0];if(ar.value===null&&(ar.label===null||ar.label===void 0))return[]}return or.map(function(_r){var $r;return(0,we.Z)((0,we.Z)({},_r),{},{label:($r=typeof Gi=="function"?Gi(_r):_r.label)!==null&&$r!==void 0?$r:_r.value})})},[_n,or,Gi]),po=jt.useMemo(function(){return new Set(or.map(function(ar){return ar.value}))},[or]);jt.useEffect(function(){if(_n==="combobox"){var ar,_r=(ar=or[0])===null||ar===void 0?void 0:ar.value;di(te(_r)?String(_r):"")}},[or]);var ro=Se(function(ar,_r){var $r=_r!=null?_r:ar;return(0,le.Z)((0,le.Z)({},Dn.value,ar),Dn.label,$r)}),Po=jt.useMemo(function(){if(_n!=="tags")return An;var ar=(0,Kt.Z)(An),_r=function(co){return Un.has(co)};return(0,Kt.Z)(or).sort(function($r,co){return $r.value<co.value?-1:1}).forEach(function($r){var co=$r.value;_r(co)||ar.push(ro(co,$r.label))}),ar},[ro,An,Un,or,_n]),Bo=wt(Po,Dn,Li,Tt,Ae),Oe=jt.useMemo(function(){return _n!=="tags"||!Li||Bo.some(function(ar){return ar[Ae||"value"]===Li})||Bo.some(function(ar){return ar[Dn.value]===Li})?Bo:[ro(Li)].concat((0,Kt.Z)(Bo))},[ro,Ae,_n,Bo,Li,Dn]),lo=function ar(_r){var $r=(0,Kt.Z)(_r).sort(function(co,zo){return Xr(co,zo,{searchValue:Li})});return $r.map(function(co){return Array.isArray(co.options)?(0,we.Z)((0,we.Z)({},co),{},{options:co.options.length>0?ar(co.options):co.options}):co})},Gr=jt.useMemo(function(){return Xr?lo(Oe):Oe},[Oe,Xr,Li]),Sr=jt.useMemo(function(){return xe(Gr,{fieldNames:Dn,childrenAsData:be})},[Gr,Dn,be]),hr=function(_r){var $r=Xn(_r);if(en($r),Ur&&($r.length!==or.length||$r.some(function(cr,Ya){var da;return((da=or[Ya])===null||da===void 0?void 0:da.value)!==(cr==null?void 0:cr.value)}))){var co=ko?$r:$r.map(function(cr){return cr.value}),zo=$r.map(function(cr){return Pe(so(cr.value))});Ur(xn?co:co[0],xn?zo:zo[0])}},oo=jt.useState(null),Fo=(0,ue.Z)(oo,2),wo=Fo[0],zr=Fo[1],Or=jt.useState(0),ha=(0,ue.Z)(Or,2),Ia=ha[0],bs=ha[1],Ba=ur!==void 0?ur:_n!=="combobox",dr=jt.useCallback(function(ar,_r){var $r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},co=$r.source,zo=co===void 0?"keyboard":co;bs(_r),Nn&&_n==="combobox"&&ar!==null&&zo==="keyboard"&&zr(String(ar))},[Nn,_n]),$o=function(_r,$r,co){var zo=function(){var ms,Rs=so(_r);return[ko?{label:Rs==null?void 0:Rs[Dn.label],value:_r,key:(ms=Rs==null?void 0:Rs.key)!==null&&ms!==void 0?ms:_r}:_r,Pe(Rs)]};if($r&&Di){var cr=zo(),Ya=(0,ue.Z)(cr,2),da=Ya[0],Yo=Ya[1];Di(da,Yo)}else if(!$r&&mn&&co!=="clear"){var io=zo(),Sa=(0,ue.Z)(io,2),ns=Sa[0],Jo=Sa[1];mn(ns,Jo)}},qo=Se(function(ar,_r){var $r,co=xn?_r.selected:!0;co?$r=xn?[].concat((0,Kt.Z)(or),[ar]):[ar]:$r=or.filter(function(zo){return zo.value!==ar}),hr($r),$o(ar,co),_n==="combobox"?zr(""):(!Ge||Ii)&&(di(""),zr(""))}),ca=function(_r,$r){hr(_r);var co=$r.type,zo=$r.values;(co==="remove"||co==="clear")&&zo.forEach(function(cr){$o(cr.value,!1,co)})},ia=function(_r,$r){if(di(_r),zr(null),$r.source==="submit"){var co=(_r||"").trim();if(co){var zo=Array.from(new Set([].concat((0,Kt.Z)(po),[co])));hr(zo),$o(co,!0),di("")}return}$r.source!=="blur"&&(_n==="combobox"&&hr(_r),ii==null||ii(_r))},fa=function(_r){var $r=_r;_n!=="tags"&&($r=_r.map(function(zo){var cr=$n.get(zo);return cr==null?void 0:cr.value}).filter(function(zo){return zo!==void 0}));var co=Array.from(new Set([].concat((0,Kt.Z)(po),(0,Kt.Z)($r))));hr(co),co.forEach(function(zo){$o(zo,!0)})},yi=jt.useMemo(function(){var ar=Dr!==!1&&fr!==!1;return(0,we.Z)((0,we.Z)({},yn),{},{flattenOptions:Sr,onActiveValue:dr,defaultActiveFirstOption:Ba,onSelect:qo,menuItemSelectedIcon:Lr,rawValues:po,fieldNames:Dn,virtual:ar,direction:Zr,listHeight:un,listItemHeight:vn,childrenAsData:be,maxCount:Cr,optionRender:fi})},[Cr,yn,Sr,dr,Ba,qo,Lr,po,Dn,Dr,fr,Zr,un,vn,be,fi]);return jt.createElement(tn.Provider,{value:yi},jt.createElement(nn,(0,ft.Z)({},Lo,{id:je,prefixCls:hn,ref:me,omitDomProps:Pi,mode:_n,displayValues:qr,onDisplayValuesChange:ca,direction:Zr,searchValue:Li,onSearch:ia,autoClearSearchValue:Ii,onSearchSplit:fa,dropdownMatchSelectWidth:fr,OptionList:Ei,emptyOptions:!Sr.length,activeValue:wo,activeDescendantId:"".concat(je,"_list_").concat(Ia)})))}),Ai=Gn;Ai.Option=zn,Ai.OptGroup=gn;var ji=Ai,Tn=ji},63158:function(Mn,Rn,kt){"use strict";var ft=kt(14809),Kt=kt(4635),le=kt(50298),we=kt(62646),ue=kt(59301),Dt=kt(92310),ee=kt.n(Dt),pe=kt(18929),Jt=kt(10228),jt=["prefixCls","className","checked","defaultChecked","disabled","loadingIcon","checkedChildren","unCheckedChildren","onClick","onChange","onKeyDown"],De=ue.forwardRef(function(ae,Le){var Bt,nt=ae.prefixCls,et=nt===void 0?"rc-switch":nt,ht=ae.className,st=ae.checked,pt=ae.defaultChecked,vt=ae.disabled,St=ae.loadingIcon,Et=ae.checkedChildren,At=ae.unCheckedChildren,It=ae.onClick,qt=ae.onChange,Ut=ae.onKeyDown,Gt=(0,we.Z)(ae,jt),ge=(0,pe.Z)(!1,{value:st,defaultValue:pt}),ie=(0,le.Z)(ge,2),Te=ie[0],ve=ie[1];function ye(pn,te){var Xt=Te;return vt||(Xt=pn,ve(Xt),qt==null||qt(Xt,te)),Xt}function Ye(pn){pn.which===Jt.Z.LEFT?ye(!1,pn):pn.which===Jt.Z.RIGHT&&ye(!0,pn),Ut==null||Ut(pn)}function Ze(pn){var te=ye(!Te,pn);It==null||It(te,pn)}var qe=ee()(et,ht,(Bt={},(0,Kt.Z)(Bt,"".concat(et,"-checked"),Te),(0,Kt.Z)(Bt,"".concat(et,"-disabled"),vt),Bt));return ue.createElement("button",(0,ft.Z)({},Gt,{type:"button",role:"switch","aria-checked":Te,disabled:vt,className:qe,ref:Le,onKeyDown:Ye,onClick:Ze}),St,ue.createElement("span",{className:"".concat(et,"-inner")},ue.createElement("span",{className:"".concat(et,"-inner-checked")},Et),ue.createElement("span",{className:"".concat(et,"-inner-unchecked")},At)))});De.displayName="Switch",Rn.Z=De},86351:function(Mn,Rn,kt){"use strict";kt.d(Rn,{R:function(){return Kt},w:function(){return ft}});var ft={},Kt="rc-table-internal-hook"},97347:function(Mn,Rn,kt){"use strict";kt.d(Rn,{L:function(){return et},Z:function(){return St}});var ft=kt(50298),Kt=kt(4635),le=kt(95190),we=kt(93664),ue=kt(20439),Dt=kt(62646),ee=kt(11592),pe=kt(48736),Jt=kt(59301),jt=kt(86351),De=kt(54451);function ae(Et){var At=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";return typeof At=="number"?At:At.endsWith("%")?Et*parseFloat(At)/100:null}function Le(Et,At,It){return Jt.useMemo(function(){if(At&&At>0){var qt=0,Ut=0;Et.forEach(function(Ze){var qe=ae(At,Ze.width);qe?qt+=qe:Ut+=1});var Gt=Math.max(At,It),ge=Math.max(Gt-qt,Ut),ie=Ut,Te=ge/Ut,ve=0,ye=Et.map(function(Ze){var qe=(0,ue.Z)({},Ze),pn=ae(At,qe.width);if(pn)qe.width=pn;else{var te=Math.floor(Te);qe.width=ie===1?ge:te,ge-=te,ie-=1}return ve+=qe.width,qe});if(ve<Gt){var Ye=Gt/ve;ge=Gt,ye.forEach(function(Ze,qe){var pn=Math.floor(Ze.width*Ye);Ze.width=qe===ye.length-1?ge:pn,ge-=pn})}return[ye,Math.max(ve,Gt)]}return[Et,At]},[Et,At,It])}var Bt=["children"],nt=["fixed"];function et(Et){return(0,ee.Z)(Et).filter(function(At){return Jt.isValidElement(At)}).map(function(At){var It=At.key,qt=At.props,Ut=qt.children,Gt=(0,Dt.Z)(qt,Bt),ge=(0,ue.Z)({key:It},Gt);return Ut&&(ge.children=et(Ut)),ge})}function ht(Et){return Et.filter(function(At){return At&&(0,we.Z)(At)==="object"&&!At.hidden}).map(function(At){var It=At.children;return It&&It.length>0?(0,ue.Z)((0,ue.Z)({},At),{},{children:ht(It)}):At})}function st(Et){var At=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"key";return Et.filter(function(It){return It&&(0,we.Z)(It)==="object"}).reduce(function(It,qt,Ut){var Gt=qt.fixed,ge=Gt===!0?"left":Gt,ie="".concat(At,"-").concat(Ut),Te=qt.children;return Te&&Te.length>0?[].concat((0,le.Z)(It),(0,le.Z)(st(Te,ie).map(function(ve){return(0,ue.Z)({fixed:ge},ve)}))):[].concat((0,le.Z)(It),[(0,ue.Z)((0,ue.Z)({key:ie},qt),{},{fixed:ge})])},[])}function pt(Et){return Et.map(function(At){var It=At.fixed,qt=(0,Dt.Z)(At,nt),Ut=It;return It==="left"?Ut="right":It==="right"&&(Ut="left"),(0,ue.Z)({fixed:Ut},qt)})}function vt(Et,At){var It=Et.prefixCls,qt=Et.columns,Ut=Et.children,Gt=Et.expandable,ge=Et.expandedKeys,ie=Et.columnTitle,Te=Et.getRowKey,ve=Et.onTriggerExpand,ye=Et.expandIcon,Ye=Et.rowExpandable,Ze=Et.expandIconColumnIndex,qe=Et.direction,pn=Et.expandRowByClick,te=Et.columnWidth,Xt=Et.fixed,Qe=Et.scrollWidth,On=Et.clientWidth,En=Jt.useMemo(function(){var Si=qt||et(Ut)||[];return ht(Si.slice())},[qt,Ut]),Ie=Jt.useMemo(function(){if(Gt){var Si=En.slice();if(!Si.includes(jt.w)){var Rt=Ze||0;Rt>=0&&(Rt||Xt==="left"||!Xt)&&Si.splice(Rt,0,jt.w),Xt==="right"&&Si.splice(En.length,0,jt.w)}var Ft=Si.indexOf(jt.w);Si=Si.filter(function(Mt,Yt){return Mt!==jt.w||Yt===Ft});var Pt=En[Ft],Nt;Xt?Nt=Xt:Nt=Pt?Pt.fixed:null;var zt=(0,Kt.Z)((0,Kt.Z)((0,Kt.Z)((0,Kt.Z)((0,Kt.Z)((0,Kt.Z)({},De.v,{className:"".concat(It,"-expand-icon-col"),columnType:"EXPAND_COLUMN"}),"title",ie),"fixed",Nt),"className","".concat(It,"-row-expand-icon-cell")),"width",te),"render",function(Yt,He,_e){var Xe=Te(He,_e),xe=ge.has(Xe),Pe=Ye?Ye(He):!0,ke=ye({prefixCls:It,expanded:xe,expandable:Pe,record:He,onExpand:ve});return pn?Jt.createElement("span",{onClick:function(tn){return tn.stopPropagation()}},ke):ke});return Si.map(function(Mt){return Mt===jt.w?zt:Mt})}return En.filter(function(Mt){return Mt!==jt.w})},[Gt,En,Te,ge,ye,qe]),on=Jt.useMemo(function(){var Si=Ie;return At&&(Si=At(Si)),Si.length||(Si=[{render:function(){return null}}]),Si},[At,Ie,qe]),cn=Jt.useMemo(function(){return qe==="rtl"?pt(st(on)):st(on)},[on,qe,Qe]),Vn=Jt.useMemo(function(){for(var Si=-1,Rt=cn.length-1;Rt>=0;Rt-=1){var Ft=cn[Rt].fixed;if(Ft==="left"||Ft===!0){Si=Rt;break}}if(Si>=0)for(var Pt=0;Pt<=Si;Pt+=1){var Nt=cn[Pt].fixed;if(Nt!=="left"&&Nt!==!0)return!0}var zt=cn.findIndex(function(He){var _e=He.fixed;return _e==="right"});if(zt>=0)for(var Mt=zt;Mt<cn.length;Mt+=1){var Yt=cn[Mt].fixed;if(Yt!=="right")return!0}return!1},[cn]),Me=Le(cn,Qe,On),he=(0,ft.Z)(Me,2),Ce=he[0],Yn=he[1];return[on,Ce,Yn,Vn]}var St=vt},4030:function(Mn,Rn,kt){"use strict";kt.d(Rn,{w2:function(){return ft.w},vP:function(){return Pn.v},RQ:function(){return ft.R},ER:function(){return Xe},Q$:function(){return Mr},TN:function(){return Ur}});var ft=kt(86351),Kt=kt(50298),le=kt(6089),we=kt(34280),ue=kt(13697),Dt=kt(59301),ee=kt(4676);function pe(je){var xn=Dt.createContext(void 0),be=function(Dn){var ei=Dn.value,Ni=Dn.children,Li=Dt.useRef(ei);Li.current=ei;var di=Dt.useState(function(){return{getValue:function(){return Li.current},listeners:new Set}}),yn=(0,Kt.Z)(di,1),Un=yn[0];return(0,we.Z)(function(){(0,ee.unstable_batchedUpdates)(function(){Un.listeners.forEach(function($n){$n(ei)})})},[ei]),Dt.createElement(xn.Provider,{value:Un},Ni)};return{Context:xn,Provider:be,defaultValue:je}}function Jt(je,xn){var be=(0,le.Z)(typeof xn=="function"?xn:function($n){if(xn===void 0)return $n;if(!Array.isArray(xn))return $n[xn];var An={};return xn.forEach(function(Xn){An[Xn]=$n[Xn]}),An}),Tt=Dt.useContext(je==null?void 0:je.Context),Dn=Tt||{},ei=Dn.listeners,Ni=Dn.getValue,Li=Dt.useRef();Li.current=be(Tt?Ni():je==null?void 0:je.defaultValue);var di=Dt.useState({}),yn=(0,Kt.Z)(di,2),Un=yn[1];return(0,we.Z)(function(){if(!Tt)return;function $n(An){var Xn=be(An);(0,ue.Z)(Li.current,Xn,!0)||Un({})}return ei.add($n),function(){ei.delete($n)}},[Tt]),Li.current}var jt=kt(14809),De=kt(8654);function ae(){var je=Dt.createContext(null);function xn(){return Dt.useContext(je)}function be(Dn,ei){var Ni=(0,De.Yr)(Dn),Li=function(yn,Un){var $n=Ni?{ref:Un}:{},An=Dt.useRef(0),Xn=Dt.useRef(yn),Zn=xn();return Zn!==null?Dt.createElement(Dn,(0,jt.Z)({},yn,$n)):((!ei||ei(Xn.current,yn))&&(An.current+=1),Xn.current=yn,Dt.createElement(je.Provider,{value:An.current},Dt.createElement(Dn,(0,jt.Z)({},yn,$n))))};return Ni?Dt.forwardRef(Li):Li}function Tt(Dn,ei){var Ni=(0,De.Yr)(Dn),Li=function(yn,Un){var $n=Ni?{ref:Un}:{};return xn(),Dt.createElement(Dn,(0,jt.Z)({},yn,$n))};return Ni?Dt.memo(Dt.forwardRef(Li),ei):Dt.memo(Li,ei)}return{makeImmutable:be,responseImmutable:Tt,useImmutableMark:xn}}var Le=ae(),Bt=Le.makeImmutable,nt=Le.responseImmutable,et=Le.useImmutableMark,ht=ae(),st=ht.makeImmutable,pt=ht.responseImmutable,vt=ht.useImmutableMark,St=pe(),Et=St;function At(je,xn){var be=React.useRef(0);be.current+=1;var Tt=React.useRef(je),Dn=[];Object.keys(je||{}).map(function(Ni){var Li;(je==null?void 0:je[Ni])!==((Li=Tt.current)===null||Li===void 0?void 0:Li[Ni])&&Dn.push(Ni)}),Tt.current=je;var ei=React.useRef([]);return Dn.length&&(ei.current=Dn),React.useDebugValue(be.current),React.useDebugValue(ei.current.join(", ")),xn&&console.log("".concat(xn,":"),be.current,ei.current),be.current}var It=null,qt=null,Ut=kt(93664),Gt=kt(20439),ge=kt(4635),ie=kt(92310),Te=kt.n(ie),ve=kt(80547),ye=kt(97938),Ye=kt(48736),Ze=Dt.createContext({renderWithProps:!1}),qe=Ze,pn="RC_TABLE_KEY";function te(je){return je==null?[]:Array.isArray(je)?je:[je]}function Xt(je){var xn=[],be={};return je.forEach(function(Tt){for(var Dn=Tt||{},ei=Dn.key,Ni=Dn.dataIndex,Li=ei||te(Ni).join("-")||pn;be[Li];)Li="".concat(Li,"_next");be[Li]=!0,xn.push(Li)}),xn}function Qe(je){return je!=null}function On(je){return typeof je=="number"&&!Number.isNaN(je)}function En(je){return je&&(0,Ut.Z)(je)==="object"&&!Array.isArray(je)&&!Dt.isValidElement(je)}function Ie(je,xn,be,Tt,Dn,ei){var Ni=Dt.useContext(qe),Li=vt(),di=(0,ve.Z)(function(){if(Qe(Tt))return[Tt];var yn=xn==null||xn===""?[]:Array.isArray(xn)?xn:[xn],Un=(0,ye.Z)(je,yn),$n=Un,An=void 0;if(Dn){var Xn=Dn(Un,je,be);En(Xn)?($n=Xn.children,An=Xn.props,Ni.renderWithProps=!0):$n=Xn}return[$n,An]},[Li,je,Tt,xn,Dn,be],function(yn,Un){if(ei){var $n=(0,Kt.Z)(yn,2),An=$n[1],Xn=(0,Kt.Z)(Un,2),Zn=Xn[1];return ei(Zn,An)}return Ni.renderWithProps?!0:!(0,ue.Z)(yn,Un,!0)});return di}function on(je,xn,be,Tt){var Dn=je+xn-1;return je<=Tt&&Dn>=be}function cn(je,xn){return Jt(Et,function(be){var Tt=on(je,xn||1,be.hoverStartRow,be.hoverEndRow);return[Tt,be.onHover]})}var Vn=kt(70425),Me=function(xn){var be=xn.ellipsis,Tt=xn.rowType,Dn=xn.children,ei,Ni=be===!0?{showTitle:!0}:be;return Ni&&(Ni.showTitle||Tt==="header")&&(typeof Dn=="string"||typeof Dn=="number"?ei=Dn.toString():Dt.isValidElement(Dn)&&typeof Dn.props.children=="string"&&(ei=Dn.props.children)),ei};function he(je){var xn,be,Tt,Dn,ei,Ni,Li,di,yn=je.component,Un=je.children,$n=je.ellipsis,An=je.scope,Xn=je.prefixCls,Zn=je.className,ai=je.align,pi=je.record,en=je.render,Qi=je.dataIndex,tr=je.renderIndex,Vr=je.shouldCellUpdate,or=je.index,so=je.rowType,qr=je.colSpan,po=je.rowSpan,ro=je.fixLeft,Po=je.fixRight,Bo=je.firstFixLeft,Oe=je.lastFixLeft,lo=je.firstFixRight,Gr=je.lastFixRight,Sr=je.appendNode,hr=je.additionalProps,oo=hr===void 0?{}:hr,Fo=je.isSticky,wo="".concat(Xn,"-cell"),zr=Jt(Et,["supportSticky","allColumnsFixedLeft","rowHoverable"]),Or=zr.supportSticky,ha=zr.allColumnsFixedLeft,Ia=zr.rowHoverable,bs=Ie(pi,Qi,tr,Un,en,Vr),Ba=(0,Kt.Z)(bs,2),dr=Ba[0],$o=Ba[1],qo={},ca=typeof ro=="number"&&Or,ia=typeof Po=="number"&⩔ca&&(qo.position="sticky",qo.left=ro),ia&&(qo.position="sticky",qo.right=Po);var fa=(xn=(be=(Tt=$o==null?void 0:$o.colSpan)!==null&&Tt!==void 0?Tt:oo.colSpan)!==null&&be!==void 0?be:qr)!==null&&xn!==void 0?xn:1,yi=(Dn=(ei=(Ni=$o==null?void 0:$o.rowSpan)!==null&&Ni!==void 0?Ni:oo.rowSpan)!==null&&ei!==void 0?ei:po)!==null&&Dn!==void 0?Dn:1,ar=cn(or,yi),_r=(0,Kt.Z)(ar,2),$r=_r[0],co=_r[1],zo=(0,Vn.zX)(function(ns){var Jo;pi&&co(or,or+yi-1),oo==null||(Jo=oo.onMouseEnter)===null||Jo===void 0||Jo.call(oo,ns)}),cr=(0,Vn.zX)(function(ns){var Jo;pi&&co(-1,-1),oo==null||(Jo=oo.onMouseLeave)===null||Jo===void 0||Jo.call(oo,ns)});if(fa===0||yi===0)return null;var Ya=(Li=oo.title)!==null&&Li!==void 0?Li:Me({rowType:so,ellipsis:$n,children:dr}),da=Te()(wo,Zn,(di={},(0,ge.Z)((0,ge.Z)((0,ge.Z)((0,ge.Z)((0,ge.Z)((0,ge.Z)((0,ge.Z)((0,ge.Z)((0,ge.Z)((0,ge.Z)(di,"".concat(wo,"-fix-left"),ca&&Or),"".concat(wo,"-fix-left-first"),Bo&&Or),"".concat(wo,"-fix-left-last"),Oe&&Or),"".concat(wo,"-fix-left-all"),Oe&&ha&&Or),"".concat(wo,"-fix-right"),ia&&Or),"".concat(wo,"-fix-right-first"),lo&&Or),"".concat(wo,"-fix-right-last"),Gr&&Or),"".concat(wo,"-ellipsis"),$n),"".concat(wo,"-with-append"),Sr),"".concat(wo,"-fix-sticky"),(ca||ia)&&Fo&&Or),(0,ge.Z)(di,"".concat(wo,"-row-hover"),!$o&&$r)),oo.className,$o==null?void 0:$o.className),Yo={};ai&&(Yo.textAlign=ai);var io=(0,Gt.Z)((0,Gt.Z)((0,Gt.Z)((0,Gt.Z)({},$o==null?void 0:$o.style),qo),Yo),oo.style),Sa=dr;return(0,Ut.Z)(Sa)==="object"&&!Array.isArray(Sa)&&!Dt.isValidElement(Sa)&&(Sa=null),$n&&(Oe||lo)&&(Sa=Dt.createElement("span",{className:"".concat(wo,"-content")},Sa)),Dt.createElement(yn,(0,jt.Z)({},$o,oo,{className:da,style:io,title:Ya,scope:An,onMouseEnter:Ia?zo:void 0,onMouseLeave:Ia?cr:void 0,colSpan:fa!==1?fa:null,rowSpan:yi!==1?yi:null}),Sr,Sa)}var Ce=Dt.memo(he);function Yn(je,xn,be,Tt,Dn){var ei=be[je]||{},Ni=be[xn]||{},Li,di;ei.fixed==="left"?Li=Tt.left[Dn==="rtl"?xn:je]:Ni.fixed==="right"&&(di=Tt.right[Dn==="rtl"?je:xn]);var yn=!1,Un=!1,$n=!1,An=!1,Xn=be[xn+1],Zn=be[je-1],ai=Xn&&!Xn.fixed||Zn&&!Zn.fixed||be.every(function(Vr){return Vr.fixed==="left"});if(Dn==="rtl"){if(Li!==void 0){var pi=Zn&&Zn.fixed==="left";An=!pi&&ai}else if(di!==void 0){var en=Xn&&Xn.fixed==="right";$n=!en&&ai}}else if(Li!==void 0){var Qi=Xn&&Xn.fixed==="left";yn=!Qi&&ai}else if(di!==void 0){var tr=Zn&&Zn.fixed==="right";Un=!tr&&ai}return{fixLeft:Li,fixRight:di,lastFixLeft:yn,firstFixRight:Un,lastFixRight:$n,firstFixLeft:An,isSticky:Tt.isSticky}}var Si=Dt.createContext({}),Rt=Si;function Ft(je){var xn=je.className,be=je.index,Tt=je.children,Dn=je.colSpan,ei=Dn===void 0?1:Dn,Ni=je.rowSpan,Li=je.align,di=Jt(Et,["prefixCls","direction"]),yn=di.prefixCls,Un=di.direction,$n=Dt.useContext(Rt),An=$n.scrollColumnIndex,Xn=$n.stickyOffsets,Zn=$n.flattenColumns,ai=be+ei-1,pi=ai+1===An?ei+1:ei,en=Yn(be,be+pi-1,Zn,Xn,Un);return Dt.createElement(Ce,(0,jt.Z)({className:xn,index:be,component:"td",prefixCls:yn,record:null,dataIndex:null,align:Li,colSpan:pi,rowSpan:Ni,render:function(){return Tt}},en))}var Pt=kt(62646),Nt=["children"];function zt(je){var xn=je.children,be=(0,Pt.Z)(je,Nt);return Dt.createElement("tr",be,xn)}function Mt(je){var xn=je.children;return xn}Mt.Row=zt,Mt.Cell=Ft;var Yt=Mt;function He(je){var xn=je.children,be=je.stickyOffsets,Tt=je.flattenColumns,Dn=Jt(Et,"prefixCls"),ei=Tt.length-1,Ni=Tt[ei],Li=Dt.useMemo(function(){return{stickyOffsets:be,flattenColumns:Tt,scrollColumnIndex:Ni!=null&&Ni.scrollbar?ei:null}},[Ni,Tt,ei,be]);return Dt.createElement(Rt.Provider,{value:Li},Dt.createElement("tfoot",{className:"".concat(Dn,"-summary")},xn))}var _e=pt(He),Xe=Yt,xe=kt(29301),Pe=kt(24514),ke=kt(75152),Ve=kt(26112);function tn(je,xn,be,Tt,Dn,ei,Ni){je.push({record:xn,indent:be,index:Ni});var Li=ei(xn),di=Dn==null?void 0:Dn.has(Li);if(xn&&Array.isArray(xn[Tt])&&di)for(var yn=0;yn<xn[Tt].length;yn+=1)tn(je,xn[Tt][yn],be+1,Tt,Dn,ei,yn)}function dn(je,xn,be,Tt){var Dn=Dt.useMemo(function(){if(be!=null&&be.size){for(var ei=[],Ni=0;Ni<(je==null?void 0:je.length);Ni+=1){var Li=je[Ni];tn(ei,Li,0,xn,be,Tt,Ni)}return ei}return je==null?void 0:je.map(function(di,yn){return{record:di,indent:0,index:yn}})},[je,xn,be,Tt]);return Dn}function fn(je,xn,be,Tt){var Dn=Jt(Et,["prefixCls","fixedInfoList","flattenColumns","expandableType","expandRowByClick","onTriggerExpand","rowClassName","expandedRowClassName","indentSize","expandIcon","expandedRowRender","expandIconColumnIndex","expandedKeys","childrenColumnName","rowExpandable","onRow"]),ei=Dn.flattenColumns,Ni=Dn.expandableType,Li=Dn.expandedKeys,di=Dn.childrenColumnName,yn=Dn.onTriggerExpand,Un=Dn.rowExpandable,$n=Dn.onRow,An=Dn.expandRowByClick,Xn=Dn.rowClassName,Zn=Ni==="nest",ai=Ni==="row"&&(!Un||Un(je)),pi=ai||Zn,en=Li&&Li.has(xn),Qi=di&&je&&je[di],tr=(0,Vn.zX)(yn),Vr=$n==null?void 0:$n(je,be),or=Vr==null?void 0:Vr.onClick,so=function(Po){An&&pi&&yn(je,Po);for(var Bo=arguments.length,Oe=new Array(Bo>1?Bo-1:0),lo=1;lo<Bo;lo++)Oe[lo-1]=arguments[lo];or==null||or.apply(void 0,[Po].concat(Oe))},qr;typeof Xn=="string"?qr=Xn:typeof Xn=="function"&&(qr=Xn(je,be,Tt));var po=Xt(ei);return(0,Gt.Z)((0,Gt.Z)({},Dn),{},{columnsKey:po,nestExpandable:Zn,expanded:en,hasNestChildren:Qi,record:je,onTriggerExpand:tr,rowSupportExpand:ai,expandable:pi,rowProps:(0,Gt.Z)((0,Gt.Z)({},Vr),{},{className:Te()(qr,Vr==null?void 0:Vr.className),onClick:so})})}function ni(je){var xn=je.prefixCls,be=je.children,Tt=je.component,Dn=je.cellComponent,ei=je.className,Ni=je.expanded,Li=je.colSpan,di=je.isEmpty,yn=Jt(Et,["scrollbarSize","fixHeader","fixColumn","componentWidth","horizonScroll"]),Un=yn.scrollbarSize,$n=yn.fixHeader,An=yn.fixColumn,Xn=yn.componentWidth,Zn=yn.horizonScroll,ai=be;return(di?Zn&&Xn:An)&&(ai=Dt.createElement("div",{style:{width:Xn-($n&&!di?Un:0),position:"sticky",left:0,overflow:"hidden"},className:"".concat(xn,"-expanded-row-fixed")},ai)),Dt.createElement(Tt,{className:ei,style:{display:Ni?null:"none"}},Dt.createElement(Ce,{component:Dn,prefixCls:xn,colSpan:Li},ai))}var Ge=ni;function Ke(je){var xn=je.prefixCls,be=je.record,Tt=je.onExpand,Dn=je.expanded,ei=je.expandable,Ni="".concat(xn,"-row-expand-icon");if(!ei)return Dt.createElement("span",{className:Te()(Ni,"".concat(xn,"-row-spaced"))});var Li=function(yn){Tt(be,yn),yn.stopPropagation()};return Dt.createElement("span",{className:Te()(Ni,(0,ge.Z)((0,ge.Z)({},"".concat(xn,"-row-expanded"),Dn),"".concat(xn,"-row-collapsed"),!Dn)),onClick:Li})}function nn(je,xn,be){var Tt=[];function Dn(ei){(ei||[]).forEach(function(Ni,Li){Tt.push(xn(Ni,Li)),Dn(Ni[be])})}return Dn(je),Tt}function Qn(je,xn,be,Tt){return typeof je=="string"?je:typeof je=="function"?je(xn,be,Tt):""}function gn(je,xn,be,Tt,Dn){var ei=je.record,Ni=je.prefixCls,Li=je.columnsKey,di=je.fixedInfoList,yn=je.expandIconColumnIndex,Un=je.nestExpandable,$n=je.indentSize,An=je.expandIcon,Xn=je.expanded,Zn=je.hasNestChildren,ai=je.onTriggerExpand,pi=Li[be],en=di[be],Qi;be===(yn||0)&&Un&&(Qi=Dt.createElement(Dt.Fragment,null,Dt.createElement("span",{style:{paddingLeft:"".concat($n*Tt,"px")},className:"".concat(Ni,"-row-indent indent-level-").concat(Tt)}),An({prefixCls:Ni,expanded:Xn,expandable:Zn,record:ei,onExpand:ai})));var tr;return xn.onCell&&(tr=xn.onCell(ei,Dn)),{key:pi,fixedInfo:en,appendCellNode:Qi,additionalCellProps:tr||{}}}function an(je){var xn=je.className,be=je.style,Tt=je.record,Dn=je.index,ei=je.renderIndex,Ni=je.rowKey,Li=je.indent,di=Li===void 0?0:Li,yn=je.rowComponent,Un=je.cellComponent,$n=je.scopeCellComponent,An=fn(Tt,Ni,Dn,di),Xn=An.prefixCls,Zn=An.flattenColumns,ai=An.expandedRowClassName,pi=An.expandedRowRender,en=An.rowProps,Qi=An.expanded,tr=An.rowSupportExpand,Vr=Dt.useRef(!1);Vr.current||(Vr.current=Qi);var or=Qn(ai,Tt,Dn,di),so=Dt.createElement(yn,(0,jt.Z)({},en,{"data-row-key":Ni,className:Te()(xn,"".concat(Xn,"-row"),"".concat(Xn,"-row-level-").concat(di),en==null?void 0:en.className,(0,ge.Z)({},or,di>=1)),style:(0,Gt.Z)((0,Gt.Z)({},be),en==null?void 0:en.style)}),Zn.map(function(ro,Po){var Bo=ro.render,Oe=ro.dataIndex,lo=ro.className,Gr=gn(An,ro,Po,di,Dn),Sr=Gr.key,hr=Gr.fixedInfo,oo=Gr.appendCellNode,Fo=Gr.additionalCellProps;return Dt.createElement(Ce,(0,jt.Z)({className:lo,ellipsis:ro.ellipsis,align:ro.align,scope:ro.rowScope,component:ro.rowScope?$n:Un,prefixCls:Xn,key:Sr,record:Tt,index:Dn,renderIndex:ei,dataIndex:Oe,render:Bo,shouldCellUpdate:ro.shouldCellUpdate},hr,{appendNode:oo,additionalProps:Fo}))})),qr;if(tr&&(Vr.current||Qi)){var po=pi(Tt,Dn,di+1,Qi);qr=Dt.createElement(Ge,{expanded:Qi,className:Te()("".concat(Xn,"-expanded-row"),"".concat(Xn,"-expanded-row-level-").concat(di+1),or),prefixCls:Xn,component:yn,cellComponent:Un,colSpan:Zn.length,isEmpty:!1},po)}return Dt.createElement(Dt.Fragment,null,so,qr)}var zn=pt(an);function gi(je){var xn=je.columnKey,be=je.onColumnResize,Tt=Dt.useRef();return(0,we.Z)(function(){Tt.current&&be(xn,Tt.current.offsetWidth)},[]),Dt.createElement(xe.Z,{data:xn},Dt.createElement("td",{ref:Tt,style:{padding:0,border:0,height:0}},Dt.createElement("div",{style:{height:0,overflow:"hidden"}},"\xA0")))}var ti=kt(29194);function wi(je){var xn=je.prefixCls,be=je.columnsKey,Tt=je.onColumnResize,Dn=Dt.useRef(null);return Dt.createElement("tr",{"aria-hidden":"true",className:"".concat(xn,"-measure-row"),style:{height:0,fontSize:0},ref:Dn},Dt.createElement(xe.Z.Collection,{onBatchResize:function(Ni){(0,ti.Z)(Dn.current)&&Ni.forEach(function(Li){var di=Li.data,yn=Li.size;Tt(di,yn.offsetWidth)})}},be.map(function(ei){return Dt.createElement(gi,{key:ei,columnKey:ei,onColumnResize:Tt})})))}function Wi(je){var xn=je.data,be=je.measureColumnWidth,Tt=Jt(Et,["prefixCls","getComponent","onColumnResize","flattenColumns","getRowKey","expandedKeys","childrenColumnName","emptyNode"]),Dn=Tt.prefixCls,ei=Tt.getComponent,Ni=Tt.onColumnResize,Li=Tt.flattenColumns,di=Tt.getRowKey,yn=Tt.expandedKeys,Un=Tt.childrenColumnName,$n=Tt.emptyNode,An=dn(xn,Un,yn,di),Xn=Dt.useRef({renderWithProps:!1}),Zn=ei(["body","wrapper"],"tbody"),ai=ei(["body","row"],"tr"),pi=ei(["body","cell"],"td"),en=ei(["body","cell"],"th"),Qi;xn.length?Qi=An.map(function(Vr,or){var so=Vr.record,qr=Vr.indent,po=Vr.index,ro=di(so,or);return Dt.createElement(zn,{key:ro,rowKey:ro,record:so,index:or,renderIndex:po,rowComponent:ai,cellComponent:pi,scopeCellComponent:en,indent:qr})}):Qi=Dt.createElement(Ge,{expanded:!0,className:"".concat(Dn,"-placeholder"),prefixCls:Dn,component:ai,cellComponent:pi,colSpan:Li.length,isEmpty:!0},$n);var tr=Xt(Li);return Dt.createElement(qe.Provider,{value:Xn.current},Dt.createElement(Zn,{className:"".concat(Dn,"-tbody")},be&&Dt.createElement(wi,{prefixCls:Dn,columnsKey:tr,onColumnResize:Ni}),Qi))}var Cn=pt(Wi),Pn=kt(54451),Bn=["columnType"];function si(je){for(var xn=je.colWidths,be=je.columns,Tt=je.columCount,Dn=Jt(Et,["tableLayout"]),ei=Dn.tableLayout,Ni=[],Li=Tt||be.length,di=!1,yn=Li-1;yn>=0;yn-=1){var Un=xn[yn],$n=be&&be[yn],An=void 0,Xn=void 0;if($n&&(An=$n[Pn.v],ei==="auto"&&(Xn=$n.minWidth)),Un||Xn||An||di){var Zn=An||{},ai=Zn.columnType,pi=(0,Pt.Z)(Zn,Bn);Ni.unshift(Dt.createElement("col",(0,jt.Z)({key:yn,style:{width:Un,minWidth:Xn}},pi))),di=!0}}return Dt.createElement("colgroup",null,Ni)}var Ei=si,ci=kt(95190),Zi=["className","noData","columns","flattenColumns","colWidths","columCount","stickyOffsets","direction","fixHeader","stickyTopOffset","stickyBottomOffset","stickyClassName","onScroll","maxContentScroll","children"];function wt(je,xn){return(0,Dt.useMemo)(function(){for(var be=[],Tt=0;Tt<xn;Tt+=1){var Dn=je[Tt];if(Dn!==void 0)be[Tt]=Dn;else return null}return be},[je.join("_"),xn])}var Je=Dt.forwardRef(function(je,xn){var be=je.className,Tt=je.noData,Dn=je.columns,ei=je.flattenColumns,Ni=je.colWidths,Li=je.columCount,di=je.stickyOffsets,yn=je.direction,Un=je.fixHeader,$n=je.stickyTopOffset,An=je.stickyBottomOffset,Xn=je.stickyClassName,Zn=je.onScroll,ai=je.maxContentScroll,pi=je.children,en=(0,Pt.Z)(je,Zi),Qi=Jt(Et,["prefixCls","scrollbarSize","isSticky","getComponent"]),tr=Qi.prefixCls,Vr=Qi.scrollbarSize,or=Qi.isSticky,so=Qi.getComponent,qr=so(["header","table"],"table"),po=or&&!Un?0:Vr,ro=Dt.useRef(null),Po=Dt.useCallback(function(Fo){(0,De.mH)(xn,Fo),(0,De.mH)(ro,Fo)},[]);Dt.useEffect(function(){var Fo;function wo(zr){var Or=zr,ha=Or.currentTarget,Ia=Or.deltaX;Ia&&(Zn({currentTarget:ha,scrollLeft:ha.scrollLeft+Ia}),zr.preventDefault())}return(Fo=ro.current)===null||Fo===void 0||Fo.addEventListener("wheel",wo,{passive:!1}),function(){var zr;(zr=ro.current)===null||zr===void 0||zr.removeEventListener("wheel",wo)}},[]);var Bo=Dt.useMemo(function(){return ei.every(function(Fo){return Fo.width})},[ei]),Oe=ei[ei.length-1],lo={fixed:Oe?Oe.fixed:null,scrollbar:!0,onHeaderCell:function(){return{className:"".concat(tr,"-cell-scrollbar")}}},Gr=(0,Dt.useMemo)(function(){return po?[].concat((0,ci.Z)(Dn),[lo]):Dn},[po,Dn]),Sr=(0,Dt.useMemo)(function(){return po?[].concat((0,ci.Z)(ei),[lo]):ei},[po,ei]),hr=(0,Dt.useMemo)(function(){var Fo=di.right,wo=di.left;return(0,Gt.Z)((0,Gt.Z)({},di),{},{left:yn==="rtl"?[].concat((0,ci.Z)(wo.map(function(zr){return zr+po})),[0]):wo,right:yn==="rtl"?Fo:[].concat((0,ci.Z)(Fo.map(function(zr){return zr+po})),[0]),isSticky:or})},[po,di,or]),oo=wt(Ni,Li);return Dt.createElement("div",{style:(0,Gt.Z)({overflow:"hidden"},or?{top:$n,bottom:An}:{}),ref:Po,className:Te()(be,(0,ge.Z)({},Xn,!!Xn))},Dt.createElement(qr,{style:{tableLayout:"fixed",visibility:Tt||oo?null:"hidden"}},(!Tt||!ai||Bo)&&Dt.createElement(Ei,{colWidths:oo?[].concat((0,ci.Z)(oo),[po]):[],columCount:Li+1,columns:Sr}),pi((0,Gt.Z)((0,Gt.Z)({},en),{},{stickyOffsets:hr,columns:Gr,flattenColumns:Sr}))))}),Hn=Dt.memo(Je),Ln=function(xn){var be=xn.cells,Tt=xn.stickyOffsets,Dn=xn.flattenColumns,ei=xn.rowComponent,Ni=xn.cellComponent,Li=xn.onHeaderRow,di=xn.index,yn=Jt(Et,["prefixCls","direction"]),Un=yn.prefixCls,$n=yn.direction,An;Li&&(An=Li(be.map(function(Zn){return Zn.column}),di));var Xn=Xt(be.map(function(Zn){return Zn.column}));return Dt.createElement(ei,An,be.map(function(Zn,ai){var pi=Zn.column,en=Yn(Zn.colStart,Zn.colEnd,Dn,Tt,$n),Qi;return pi&&pi.onHeaderCell&&(Qi=Zn.column.onHeaderCell(pi)),Dt.createElement(Ce,(0,jt.Z)({},Zn,{scope:pi.title?Zn.colSpan>1?"colgroup":"col":null,ellipsis:pi.ellipsis,align:pi.align,component:Ni,prefixCls:Un,key:Xn[ai]},en,{additionalProps:Qi,rowType:"header"}))}))},jn=Ln;function li(je){var xn=[];function be(Ni,Li){var di=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;xn[di]=xn[di]||[];var yn=Li,Un=Ni.filter(Boolean).map(function($n){var An={key:$n.key,className:$n.className||"",children:$n.title,column:$n,colStart:yn},Xn=1,Zn=$n.children;return Zn&&Zn.length>0&&(Xn=be(Zn,yn,di+1).reduce(function(ai,pi){return ai+pi},0),An.hasSubColumns=!0),"colSpan"in $n&&(Xn=$n.colSpan),"rowSpan"in $n&&(An.rowSpan=$n.rowSpan),An.colSpan=Xn,An.colEnd=An.colStart+Xn-1,xn[di].push(An),yn+=Xn,Xn});return Un}be(je,0);for(var Tt=xn.length,Dn=function(Li){xn[Li].forEach(function(di){!("rowSpan"in di)&&!di.hasSubColumns&&(di.rowSpan=Tt-Li)})},ei=0;ei<Tt;ei+=1)Dn(ei);return xn}var Ci=function(xn){var be=xn.stickyOffsets,Tt=xn.columns,Dn=xn.flattenColumns,ei=xn.onHeaderRow,Ni=Jt(Et,["prefixCls","getComponent"]),Li=Ni.prefixCls,di=Ni.getComponent,yn=Dt.useMemo(function(){return li(Tt)},[Tt]),Un=di(["header","wrapper"],"thead"),$n=di(["header","row"],"tr"),An=di(["header","cell"],"th");return Dt.createElement(Un,{className:"".concat(Li,"-thead")},yn.map(function(Xn,Zn){var ai=Dt.createElement(jn,{key:Zn,flattenColumns:Dn,cells:Xn,stickyOffsets:be,rowComponent:$n,cellComponent:An,onHeaderRow:ei,index:Zn});return ai}))},Yi=pt(Ci),Be=kt(97347);function Se(je,xn,be){var Tt=(0,Pn.g)(je),Dn=Tt.expandIcon,ei=Tt.expandedRowKeys,Ni=Tt.defaultExpandedRowKeys,Li=Tt.defaultExpandAllRows,di=Tt.expandedRowRender,yn=Tt.onExpand,Un=Tt.onExpandedRowsChange,$n=Tt.childrenColumnName,An=Dn||Ke,Xn=$n||"children",Zn=Dt.useMemo(function(){return di?"row":je.expandable&&je.internalHooks===ft.R&&je.expandable.__PARENT_RENDER_ICON__||xn.some(function(or){return or&&(0,Ut.Z)(or)==="object"&&or[Xn]})?"nest":!1},[!!di,xn]),ai=Dt.useState(function(){return Ni||(Li?nn(xn,be,Xn):[])}),pi=(0,Kt.Z)(ai,2),en=pi[0],Qi=pi[1],tr=Dt.useMemo(function(){return new Set(ei||en||[])},[ei,en]),Vr=Dt.useCallback(function(or){var so=be(or,xn.indexOf(or)),qr,po=tr.has(so);po?(tr.delete(so),qr=(0,ci.Z)(tr)):qr=[].concat((0,ci.Z)(tr),[so]),Qi(qr),yn&&yn(!po,or),Un&&Un(qr)},[be,tr,xn,yn,Un]);return[Tt,Zn,tr,An,Xn,Vr]}function Ee(je,xn,be){var Tt=je.map(function(Dn,ei){return Yn(ei,ei,je,xn,be)});return(0,ve.Z)(function(){return Tt},[Tt],function(Dn,ei){return!(0,ue.Z)(Dn,ei)})}function Ue(je){var xn=(0,Dt.useRef)(je),be=(0,Dt.useState)({}),Tt=(0,Kt.Z)(be,2),Dn=Tt[1],ei=(0,Dt.useRef)(null),Ni=(0,Dt.useRef)([]);function Li(di){Ni.current.push(di);var yn=Promise.resolve();ei.current=yn,yn.then(function(){if(ei.current===yn){var Un=Ni.current,$n=xn.current;Ni.current=[],Un.forEach(function(An){xn.current=An(xn.current)}),ei.current=null,$n!==xn.current&&Dn({})}})}return(0,Dt.useEffect)(function(){return function(){ei.current=null}},[]),[xn.current,Li]}function xi(je){var xn=(0,Dt.useRef)(je||null),be=(0,Dt.useRef)();function Tt(){window.clearTimeout(be.current)}function Dn(Ni){xn.current=Ni,Tt(),be.current=window.setTimeout(function(){xn.current=null,be.current=void 0},100)}function ei(){return xn.current}return(0,Dt.useEffect)(function(){return Tt},[]),[Dn,ei]}function Kn(){var je=Dt.useState(-1),xn=(0,Kt.Z)(je,2),be=xn[0],Tt=xn[1],Dn=Dt.useState(-1),ei=(0,Kt.Z)(Dn,2),Ni=ei[0],Li=ei[1],di=Dt.useCallback(function(yn,Un){Tt(yn),Li(Un)},[]);return[be,Ni,di]}var Pi=kt(47273),$e=(0,Pi.Z)()?window:null;function Gn(je,xn){var be=(0,Ut.Z)(je)==="object"?je:{},Tt=be.offsetHeader,Dn=Tt===void 0?0:Tt,ei=be.offsetSummary,Ni=ei===void 0?0:ei,Li=be.offsetScroll,di=Li===void 0?0:Li,yn=be.getContainer,Un=yn===void 0?function(){return $e}:yn,$n=Un()||$e,An=!!je;return Dt.useMemo(function(){return{isSticky:An,stickyClassName:An?"".concat(xn,"-sticky-holder"):"",offsetHeader:Dn,offsetSummary:Ni,offsetScroll:di,container:$n}},[An,di,Dn,Ni,xn,$n])}function Ai(je,xn,be){var Tt=(0,Dt.useMemo)(function(){var Dn=xn.length,ei=function(yn,Un,$n){for(var An=[],Xn=0,Zn=yn;Zn!==Un;Zn+=$n)An.push(Xn),xn[Zn].fixed&&(Xn+=je[Zn]||0);return An},Ni=ei(0,Dn,1),Li=ei(Dn-1,-1,-1).reverse();return be==="rtl"?{left:Li,right:Ni}:{left:Ni,right:Li}},[je,xn,be]);return Tt}var ji=Ai;function Tn(je){var xn=je.className,be=je.children;return Dt.createElement("div",{className:xn},be)}var Qt=Tn,me=kt(8224),bn=kt(16089),_n=kt(76846);function ze(je){var xn=(0,_n.bn)(je),be=xn.getBoundingClientRect(),Tt=document.documentElement;return{left:be.left+(window.pageXOffset||Tt.scrollLeft)-(Tt.clientLeft||document.body.clientLeft||0),top:be.top+(window.pageYOffset||Tt.scrollTop)-(Tt.clientTop||document.body.clientTop||0)}}var hn=function(xn,be){var Tt,Dn,ei=xn.scrollBodyRef,Ni=xn.onScroll,Li=xn.offsetScroll,di=xn.container,yn=xn.direction,Un=Jt(Et,"prefixCls"),$n=((Tt=ei.current)===null||Tt===void 0?void 0:Tt.scrollWidth)||0,An=((Dn=ei.current)===null||Dn===void 0?void 0:Dn.clientWidth)||0,Xn=$n&&An*(An/$n),Zn=Dt.useRef(),ai=Ue({scrollLeft:0,isHiddenScrollBar:!0}),pi=(0,Kt.Z)(ai,2),en=pi[0],Qi=pi[1],tr=Dt.useRef({delta:0,x:0}),Vr=Dt.useState(!1),or=(0,Kt.Z)(Vr,2),so=or[0],qr=or[1],po=Dt.useRef(null);Dt.useEffect(function(){return function(){bn.Z.cancel(po.current)}},[]);var ro=function(){qr(!1)},Po=function(Sr){Sr.persist(),tr.current.delta=Sr.pageX-en.scrollLeft,tr.current.x=0,qr(!0),Sr.preventDefault()},Bo=function(Sr){var hr,oo=Sr||((hr=window)===null||hr===void 0?void 0:hr.event),Fo=oo.buttons;if(!so||Fo===0){so&&qr(!1);return}var wo=tr.current.x+Sr.pageX-tr.current.x-tr.current.delta,zr=yn==="rtl";wo=Math.max(zr?Xn-An:0,Math.min(zr?0:An-Xn,wo));var Or=!zr||Math.abs(wo)+Math.abs(Xn)<An;Or&&(Ni({scrollLeft:wo/An*($n+2)}),tr.current.x=Sr.pageX)},Oe=function(){bn.Z.cancel(po.current),po.current=(0,bn.Z)(function(){if(ei.current){var Sr=ze(ei.current).top,hr=Sr+ei.current.offsetHeight,oo=di===window?document.documentElement.scrollTop+window.innerHeight:ze(di).top+di.clientHeight;hr-(0,ke.Z)()<=oo||Sr>=oo-Li?Qi(function(Fo){return(0,Gt.Z)((0,Gt.Z)({},Fo),{},{isHiddenScrollBar:!0})}):Qi(function(Fo){return(0,Gt.Z)((0,Gt.Z)({},Fo),{},{isHiddenScrollBar:!1})})}})},lo=function(Sr){Qi(function(hr){return(0,Gt.Z)((0,Gt.Z)({},hr),{},{scrollLeft:Sr/$n*An||0})})};return Dt.useImperativeHandle(be,function(){return{setScrollLeft:lo,checkScrollBarVisible:Oe}}),Dt.useEffect(function(){var Gr=(0,me.Z)(document.body,"mouseup",ro,!1),Sr=(0,me.Z)(document.body,"mousemove",Bo,!1);return Oe(),function(){Gr.remove(),Sr.remove()}},[Xn,so]),Dt.useEffect(function(){if(ei.current){for(var Gr=[],Sr=(0,_n.bn)(ei.current);Sr;)Gr.push(Sr),Sr=Sr.parentElement;return Gr.forEach(function(hr){return hr.addEventListener("scroll",Oe,!1)}),window.addEventListener("resize",Oe,!1),window.addEventListener("scroll",Oe,!1),di.addEventListener("scroll",Oe,!1),function(){Gr.forEach(function(hr){return hr.removeEventListener("scroll",Oe)}),window.removeEventListener("resize",Oe),window.removeEventListener("scroll",Oe),di.removeEventListener("scroll",Oe)}}},[di]),Dt.useEffect(function(){en.isHiddenScrollBar||Qi(function(Gr){var Sr=ei.current;return Sr?(0,Gt.Z)((0,Gt.Z)({},Gr),{},{scrollLeft:Sr.scrollLeft/Sr.scrollWidth*Sr.clientWidth}):Gr})},[en.isHiddenScrollBar]),$n<=An||!Xn||en.isHiddenScrollBar?null:Dt.createElement("div",{style:{height:(0,ke.Z)(),width:An,bottom:Li},className:"".concat(Un,"-sticky-scroll")},Dt.createElement("div",{onMouseDown:Po,ref:Zn,className:Te()("".concat(Un,"-sticky-scroll-bar"),(0,ge.Z)({},"".concat(Un,"-sticky-scroll-bar-active"),so)),style:{width:"".concat(Xn,"px"),transform:"translate3d(".concat(en.scrollLeft,"px, 0, 0)")}}))},Nn=Dt.forwardRef(hn);function In(je){return null}var vi=In;function Jn(je){return null}var ii=Jn,hi="rc-table",Ii=[],Di={};function mn(){return"No Data"}function oi(je,xn){var be=(0,Gt.Z)({rowKey:"key",prefixCls:hi,emptyText:mn},je),Tt=be.prefixCls,Dn=be.className,ei=be.rowClassName,Ni=be.style,Li=be.data,di=be.rowKey,yn=be.scroll,Un=be.tableLayout,$n=be.direction,An=be.title,Xn=be.footer,Zn=be.summary,ai=be.caption,pi=be.id,en=be.showHeader,Qi=be.components,tr=be.emptyText,Vr=be.onRow,or=be.onHeaderRow,so=be.onScroll,qr=be.internalHooks,po=be.transformColumns,ro=be.internalRefs,Po=be.tailor,Bo=be.getContainerWidth,Oe=be.sticky,lo=be.rowHoverable,Gr=lo===void 0?!0:lo,Sr=Li||Ii,hr=!!Sr.length,oo=qr===ft.R,Fo=Dt.useCallback(function(bo,Wo){return(0,ye.Z)(Qi,bo)||Wo},[Qi]),wo=Dt.useMemo(function(){return typeof di=="function"?di:function(bo){var Wo=bo&&bo[di];return Wo}},[di]),zr=Fo(["body"]),Or=Kn(),ha=(0,Kt.Z)(Or,3),Ia=ha[0],bs=ha[1],Ba=ha[2],dr=Se(be,Sr,wo),$o=(0,Kt.Z)(dr,6),qo=$o[0],ca=$o[1],ia=$o[2],fa=$o[3],yi=$o[4],ar=$o[5],_r=yn==null?void 0:yn.x,$r=Dt.useState(0),co=(0,Kt.Z)($r,2),zo=co[0],cr=co[1],Ya=(0,Be.Z)((0,Gt.Z)((0,Gt.Z)((0,Gt.Z)({},be),qo),{},{expandable:!!qo.expandedRowRender,columnTitle:qo.columnTitle,expandedKeys:ia,getRowKey:wo,onTriggerExpand:ar,expandIcon:fa,expandIconColumnIndex:qo.expandIconColumnIndex,direction:$n,scrollWidth:oo&&Po&&typeof _r=="number"?_r:null,clientWidth:zo}),oo?po:null),da=(0,Kt.Z)(Ya,4),Yo=da[0],io=da[1],Sa=da[2],ns=da[3],Jo=Sa!=null?Sa:_r,ps=Dt.useMemo(function(){return{columns:Yo,flattenColumns:io}},[Yo,io]),ms=Dt.useRef(),Rs=Dt.useRef(),La=Dt.useRef(),Iu=Dt.useRef();Dt.useImperativeHandle(xn,function(){return{nativeElement:ms.current,scrollTo:function(Wo){var Pa;if(La.current instanceof HTMLElement){var is=Wo.index,Qa=Wo.top,pl=Wo.key;if(On(Qa)){var Yl;(Yl=La.current)===null||Yl===void 0||Yl.scrollTo({top:Qa})}else{var du,al=pl!=null?pl:wo(Sr[is]);(du=La.current.querySelector('[data-row-key="'.concat(al,'"]')))===null||du===void 0||du.scrollIntoView()}}else(Pa=La.current)!==null&&Pa!==void 0&&Pa.scrollTo&&La.current.scrollTo(Wo)}}});var Cu=Dt.useRef(),js=Dt.useState(!1),Nl=(0,Kt.Z)(js,2),zs=Nl[0],Vl=Nl[1],lu=Dt.useState(!1),Eu=(0,Kt.Z)(lu,2),xa=Eu[0],rl=Eu[1],_u=Dt.useState(new Map),Kl=(0,Kt.Z)(_u,2),uu=Kl[0],Xa=Kl[1],Ja=Xt(io),Aa=Ja.map(function(bo){return uu.get(bo)}),Ga=Dt.useMemo(function(){return Aa},[Aa.join("_")]),Bl=ji(Ga,io,$n),ga=yn&&Qe(yn.y),_o=yn&&Qe(Jo)||!!qo.fixed,Co=_o&&io.some(function(bo){var Wo=bo.fixed;return Wo}),Ao=Dt.useRef(),Ta=Gn(Oe,Tt),oe=Ta.isSticky,Re=Ta.offsetHeader,_t=Ta.offsetSummary,ce=Ta.offsetScroll,Rr=Ta.stickyClassName,vr=Ta.container,Fr=Dt.useMemo(function(){return Zn==null?void 0:Zn(Sr)},[Zn,Sr]),sr=(ga||oe)&&Dt.isValidElement(Fr)&&Fr.type===Yt&&Fr.props.fixed,Pr,fo,Yr;ga&&(fo={overflowY:hr?"scroll":"auto",maxHeight:yn.y}),_o&&(Pr={overflowX:"auto"},ga||(fo={overflowY:"hidden"}),Yr={width:Jo===!0?"auto":Jo,minWidth:"100%"});var Ir=Dt.useCallback(function(bo,Wo){Xa(function(Pa){if(Pa.get(bo)!==Wo){var is=new Map(Pa);return is.set(bo,Wo),is}return Pa})},[]),Vi=xi(null),to=(0,Kt.Z)(Vi,2),Hi=to[0],ir=to[1];function Ui(bo,Wo){Wo&&(typeof Wo=="function"?Wo(bo):Wo.scrollLeft!==bo&&(Wo.scrollLeft=bo,Wo.scrollLeft!==bo&&setTimeout(function(){Wo.scrollLeft=bo},0)))}var kr=(0,le.Z)(function(bo){var Wo=bo.currentTarget,Pa=bo.scrollLeft,is=$n==="rtl",Qa=typeof Pa=="number"?Pa:Wo.scrollLeft,pl=Wo||Di;if(!ir()||ir()===pl){var Yl;Hi(pl),Ui(Qa,Rs.current),Ui(Qa,La.current),Ui(Qa,Cu.current),Ui(Qa,(Yl=Ao.current)===null||Yl===void 0?void 0:Yl.setScrollLeft)}var du=Wo||Rs.current;if(du){var al=oo&&Po&&typeof Jo=="number"?Jo:du.scrollWidth,ml=du.clientWidth;if(al===ml){Vl(!1),rl(!1);return}is?(Vl(-Qa<al-ml),rl(-Qa>0)):(Vl(Qa>0),rl(Qa<al-ml))}}),Er=(0,le.Z)(function(bo){kr(bo),so==null||so(bo)}),Tr=function(){if(_o&&La.current){var Wo;kr({currentTarget:(0,_n.bn)(La.current),scrollLeft:(Wo=La.current)===null||Wo===void 0?void 0:Wo.scrollLeft})}else Vl(!1),rl(!1)},eo=function(Wo){var Pa,is=Wo.width;(Pa=Ao.current)===null||Pa===void 0||Pa.checkScrollBarVisible();var Qa=ms.current?ms.current.offsetWidth:is;oo&&Bo&&ms.current&&(Qa=Bo(ms.current,Qa)||Qa),Qa!==zo&&(Tr(),cr(Qa))},zi=Dt.useRef(!1);Dt.useEffect(function(){zi.current&&Tr()},[_o,Li,Yo.length]),Dt.useEffect(function(){zi.current=!0},[]);var Nr=Dt.useState(0),Fi=(0,Kt.Z)(Nr,2),Xi=Fi[0],pr=Fi[1],ao=Dt.useState(!0),mo=(0,Kt.Z)(ao,2),Ro=mo[0],Ji=mo[1];(0,we.Z)(function(){(!Po||!oo)&&(La.current instanceof Element?pr((0,ke.o)(La.current).width):pr((0,ke.o)(Iu.current).width)),Ji((0,Pe.G)("position","sticky"))},[]),Dt.useEffect(function(){oo&&ro&&(ro.body.current=La.current)});var _a=Dt.useCallback(function(bo){return Dt.createElement(Dt.Fragment,null,Dt.createElement(Yi,bo),sr==="top"&&Dt.createElement(_e,bo,Fr))},[sr,Fr]),wr=Dt.useCallback(function(bo){return Dt.createElement(_e,bo,Fr)},[Fr]),uo=Fo(["table"],"table"),Br=Dt.useMemo(function(){return Un||(Co?Jo==="max-content"?"auto":"fixed":ga||oe||io.some(function(bo){var Wo=bo.ellipsis;return Wo})?"fixed":"auto")},[ga,Co,io,Un,oe]),ea,Zo={colWidths:Ga,columCount:io.length,stickyOffsets:Bl,onHeaderRow:or,fixHeader:ga,scroll:yn},Fa=Dt.useMemo(function(){return hr?null:typeof tr=="function"?tr():tr},[hr,tr]),Al=Dt.createElement(Cn,{data:Sr,measureColumnWidth:ga||_o||oe}),hu=Dt.createElement(Ei,{colWidths:io.map(function(bo){var Wo=bo.width;return Wo}),columns:io}),Ys=ai!=null?Dt.createElement("caption",{className:"".concat(Tt,"-caption")},ai):void 0,Tl=(0,Ve.Z)(be,{data:!0}),Oo=(0,Ve.Z)(be,{aria:!0});if(ga||oe){var Ns;typeof zr=="function"?(Ns=zr(Sr,{scrollbarSize:Xi,ref:La,onScroll:kr}),Zo.colWidths=io.map(function(bo,Wo){var Pa=bo.width,is=Wo===io.length-1?Pa-Xi:Pa;return typeof is=="number"&&!Number.isNaN(is)?is:0})):Ns=Dt.createElement("div",{style:(0,Gt.Z)((0,Gt.Z)({},Pr),fo),onScroll:Er,ref:La,className:Te()("".concat(Tt,"-body"))},Dt.createElement(uo,(0,jt.Z)({style:(0,Gt.Z)((0,Gt.Z)({},Yr),{},{tableLayout:Br})},Oo),Ys,hu,Al,!sr&&Fr&&Dt.createElement(_e,{stickyOffsets:Bl,flattenColumns:io},Fr)));var gl=(0,Gt.Z)((0,Gt.Z)((0,Gt.Z)({noData:!Sr.length,maxContentScroll:_o&&Jo==="max-content"},Zo),ps),{},{direction:$n,stickyClassName:Rr,onScroll:kr});ea=Dt.createElement(Dt.Fragment,null,en!==!1&&Dt.createElement(Hn,(0,jt.Z)({},gl,{stickyTopOffset:Re,className:"".concat(Tt,"-header"),ref:Rs}),_a),Ns,sr&&sr!=="top"&&Dt.createElement(Hn,(0,jt.Z)({},gl,{stickyBottomOffset:_t,className:"".concat(Tt,"-summary"),ref:Cu}),wr),oe&&La.current&&La.current instanceof Element&&Dt.createElement(Nn,{ref:Ao,offsetScroll:ce,scrollBodyRef:La,onScroll:kr,container:vr,direction:$n}))}else ea=Dt.createElement("div",{style:(0,Gt.Z)((0,Gt.Z)({},Pr),fo),className:Te()("".concat(Tt,"-content")),onScroll:kr,ref:La},Dt.createElement(uo,(0,jt.Z)({style:(0,Gt.Z)((0,Gt.Z)({},Yr),{},{tableLayout:Br})},Oo),Ys,hu,en!==!1&&Dt.createElement(Yi,(0,jt.Z)({},Zo,ps)),Al,Fr&&Dt.createElement(_e,{stickyOffsets:Bl,flattenColumns:io},Fr)));var ol=Dt.createElement("div",(0,jt.Z)({className:Te()(Tt,Dn,(0,ge.Z)((0,ge.Z)((0,ge.Z)((0,ge.Z)((0,ge.Z)((0,ge.Z)((0,ge.Z)((0,ge.Z)((0,ge.Z)((0,ge.Z)({},"".concat(Tt,"-rtl"),$n==="rtl"),"".concat(Tt,"-ping-left"),zs),"".concat(Tt,"-ping-right"),xa),"".concat(Tt,"-layout-fixed"),Un==="fixed"),"".concat(Tt,"-fixed-header"),ga),"".concat(Tt,"-fixed-column"),Co),"".concat(Tt,"-fixed-column-gapped"),Co&&ns),"".concat(Tt,"-scroll-horizontal"),_o),"".concat(Tt,"-has-fix-left"),io[0]&&io[0].fixed),"".concat(Tt,"-has-fix-right"),io[io.length-1]&&io[io.length-1].fixed==="right")),style:Ni,id:pi,ref:ms},Tl),An&&Dt.createElement(Qt,{className:"".concat(Tt,"-title")},An(Sr)),Dt.createElement("div",{ref:Iu,className:"".concat(Tt,"-container")},ea),Xn&&Dt.createElement(Qt,{className:"".concat(Tt,"-footer")},Xn(Sr)));_o&&(ol=Dt.createElement(xe.Z,{onResize:eo},ol));var Ph=Ee(io,Bl,$n),Ul=Dt.useMemo(function(){return{scrollX:Jo,prefixCls:Tt,getComponent:Fo,scrollbarSize:Xi,direction:$n,fixedInfoList:Ph,isSticky:oe,supportSticky:Ro,componentWidth:zo,fixHeader:ga,fixColumn:Co,horizonScroll:_o,tableLayout:Br,rowClassName:ei,expandedRowClassName:qo.expandedRowClassName,expandIcon:fa,expandableType:ca,expandRowByClick:qo.expandRowByClick,expandedRowRender:qo.expandedRowRender,onTriggerExpand:ar,expandIconColumnIndex:qo.expandIconColumnIndex,indentSize:qo.indentSize,allColumnsFixedLeft:io.every(function(bo){return bo.fixed==="left"}),emptyNode:Fa,columns:Yo,flattenColumns:io,onColumnResize:Ir,hoverStartRow:Ia,hoverEndRow:bs,onHover:Ba,rowExpandable:qo.rowExpandable,onRow:Vr,getRowKey:wo,expandedKeys:ia,childrenColumnName:yi,rowHoverable:Gr}},[Jo,Tt,Fo,Xi,$n,Ph,oe,Ro,zo,ga,Co,_o,Br,ei,qo.expandedRowClassName,fa,ca,qo.expandRowByClick,qo.expandedRowRender,ar,qo.expandIconColumnIndex,qo.indentSize,Fa,Yo,io,Ir,Ia,bs,Ba,qo.rowExpandable,Vr,wo,ia,yi,Gr]);return Dt.createElement(Et.Provider,{value:Ul},ol)}var fr=Dt.forwardRef(oi);function Mr(je){return st(fr,je)}var Xr=Mr();Xr.EXPAND_COLUMN=ft.w,Xr.INTERNAL_HOOKS=ft.R,Xr.Column=vi,Xr.ColumnGroup=ii,Xr.Summary=Xe;var Ae=Xr,ri=kt(6790),Ri=pe(null),fi=pe(null);function br(je,xn,be){var Tt=xn||1;return be[je+Tt]-(be[je]||0)}function ur(je){var xn=je.rowInfo,be=je.column,Tt=je.colIndex,Dn=je.indent,ei=je.index,Ni=je.component,Li=je.renderIndex,di=je.record,yn=je.style,Un=je.className,$n=je.inverse,An=je.getHeight,Xn=be.render,Zn=be.dataIndex,ai=be.className,pi=be.width,en=Jt(fi,["columnsOffset"]),Qi=en.columnsOffset,tr=gn(xn,be,Tt,Dn,ei),Vr=tr.key,or=tr.fixedInfo,so=tr.appendCellNode,qr=tr.additionalCellProps,po=qr.style,ro=qr.colSpan,Po=ro===void 0?1:ro,Bo=qr.rowSpan,Oe=Bo===void 0?1:Bo,lo=Tt-1,Gr=br(lo,Po,Qi),Sr=Po>1?pi-Gr:0,hr=(0,Gt.Z)((0,Gt.Z)((0,Gt.Z)({},po),yn),{},{flex:"0 0 ".concat(Gr,"px"),width:"".concat(Gr,"px"),marginRight:Sr,pointerEvents:"auto"}),oo=Dt.useMemo(function(){return $n?Oe<=1:Po===0||Oe===0||Oe>1},[Oe,Po,$n]);oo?hr.visibility="hidden":$n&&(hr.height=An==null?void 0:An(Oe));var Fo=oo?function(){return null}:Xn,wo={};return(Oe===0||Po===0)&&(wo.rowSpan=1,wo.colSpan=1),Dt.createElement(Ce,(0,jt.Z)({className:Te()(ai,Un),ellipsis:be.ellipsis,align:be.align,scope:be.rowScope,component:Ni,prefixCls:xn.prefixCls,key:Vr,record:di,index:ei,renderIndex:Li,dataIndex:Zn,render:Fo,shouldCellUpdate:be.shouldCellUpdate},or,{appendNode:so,additionalProps:(0,Gt.Z)((0,Gt.Z)({},qr),{},{style:hr},wo)}))}var Lr=ur,Dr=["data","index","className","rowKey","style","extra","getHeight"],Zr=Dt.forwardRef(function(je,xn){var be=je.data,Tt=je.index,Dn=je.className,ei=je.rowKey,Ni=je.style,Li=je.extra,di=je.getHeight,yn=(0,Pt.Z)(je,Dr),Un=be.record,$n=be.indent,An=be.index,Xn=Jt(Et,["prefixCls","flattenColumns","fixColumn","componentWidth","scrollX"]),Zn=Xn.scrollX,ai=Xn.flattenColumns,pi=Xn.prefixCls,en=Xn.fixColumn,Qi=Xn.componentWidth,tr=Jt(Ri,["getComponent"]),Vr=tr.getComponent,or=fn(Un,ei,Tt,$n),so=Vr(["body","row"],"div"),qr=Vr(["body","cell"],"div"),po=or.rowSupportExpand,ro=or.expanded,Po=or.rowProps,Bo=or.expandedRowRender,Oe=or.expandedRowClassName,lo;if(po&&ro){var Gr=Bo(Un,Tt,$n+1,ro),Sr=Qn(Oe,Un,Tt,$n),hr={};en&&(hr={style:(0,ge.Z)({},"--virtual-width","".concat(Qi,"px"))});var oo="".concat(pi,"-expanded-row-cell");lo=Dt.createElement(so,{className:Te()("".concat(pi,"-expanded-row"),"".concat(pi,"-expanded-row-level-").concat($n+1),Sr)},Dt.createElement(Ce,{component:qr,prefixCls:pi,className:Te()(oo,(0,ge.Z)({},"".concat(oo,"-fixed"),en)),additionalProps:hr},Gr))}var Fo=(0,Gt.Z)((0,Gt.Z)({},Ni),{},{width:Zn});Li&&(Fo.position="absolute",Fo.pointerEvents="none");var wo=Dt.createElement(so,(0,jt.Z)({},Po,yn,{"data-row-key":ei,ref:po?null:xn,className:Te()(Dn,"".concat(pi,"-row"),Po==null?void 0:Po.className,(0,ge.Z)({},"".concat(pi,"-row-extra"),Li)),style:(0,Gt.Z)((0,Gt.Z)({},Fo),Po==null?void 0:Po.style)}),ai.map(function(zr,Or){return Dt.createElement(Lr,{key:Or,component:qr,rowInfo:or,column:zr,colIndex:Or,indent:$n,index:Tt,renderIndex:An,record:Un,inverse:Li,getHeight:di})}));return po?Dt.createElement("div",{ref:xn},wo,lo):wo}),Jr=pt(Zr),un=Jr,yo=Dt.forwardRef(function(je,xn){var be=je.data,Tt=je.onScroll,Dn=Jt(Et,["flattenColumns","onColumnResize","getRowKey","prefixCls","expandedKeys","childrenColumnName","scrollX","direction"]),ei=Dn.flattenColumns,Ni=Dn.onColumnResize,Li=Dn.getRowKey,di=Dn.expandedKeys,yn=Dn.prefixCls,Un=Dn.childrenColumnName,$n=Dn.scrollX,An=Dn.direction,Xn=Jt(Ri),Zn=Xn.sticky,ai=Xn.scrollY,pi=Xn.listItemHeight,en=Xn.getComponent,Qi=Xn.onScroll,tr=Dt.useRef(),Vr=dn(be,Un,di,Li),or=Dt.useMemo(function(){var lo=0;return ei.map(function(Gr){var Sr=Gr.width,hr=Gr.key;return lo+=Sr,[hr,Sr,lo]})},[ei]),so=Dt.useMemo(function(){return or.map(function(lo){return lo[2]})},[or]);Dt.useEffect(function(){or.forEach(function(lo){var Gr=(0,Kt.Z)(lo,2),Sr=Gr[0],hr=Gr[1];Ni(Sr,hr)})},[or]),Dt.useImperativeHandle(xn,function(){var lo,Gr={scrollTo:function(hr){var oo;(oo=tr.current)===null||oo===void 0||oo.scrollTo(hr)},nativeElement:(lo=tr.current)===null||lo===void 0?void 0:lo.nativeElement};return Object.defineProperty(Gr,"scrollLeft",{get:function(){var hr;return((hr=tr.current)===null||hr===void 0?void 0:hr.getScrollInfo().x)||0},set:function(hr){var oo;(oo=tr.current)===null||oo===void 0||oo.scrollTo({left:hr})}}),Gr});var qr=function(Gr,Sr){var hr,oo=(hr=Vr[Sr])===null||hr===void 0?void 0:hr.record,Fo=Gr.onCell;if(Fo){var wo,zr=Fo(oo,Sr);return(wo=zr==null?void 0:zr.rowSpan)!==null&&wo!==void 0?wo:1}return 1},po=function(Gr){var Sr=Gr.start,hr=Gr.end,oo=Gr.getSize,Fo=Gr.offsetY;if(hr<0)return null;for(var wo=ei.filter(function(fa){return qr(fa,Sr)===0}),zr=Sr,Or=function(yi){if(wo=wo.filter(function(ar){return qr(ar,yi)===0}),!wo.length)return zr=yi,1},ha=Sr;ha>=0&&!Or(ha);ha-=1);for(var Ia=ei.filter(function(fa){return qr(fa,hr)!==1}),bs=hr,Ba=function(yi){if(Ia=Ia.filter(function(ar){return qr(ar,yi)!==1}),!Ia.length)return bs=Math.max(yi-1,hr),1},dr=hr;dr<Vr.length&&!Ba(dr);dr+=1);for(var $o=[],qo=function(yi){var ar=Vr[yi];if(!ar)return 1;ei.some(function(_r){return qr(_r,yi)>1})&&$o.push(yi)},ca=zr;ca<=bs;ca+=1)qo(ca);var ia=$o.map(function(fa){var yi=Vr[fa],ar=Li(yi.record,fa),_r=function(zo){var cr=fa+zo-1,Ya=Li(Vr[cr].record,cr),da=oo(ar,Ya);return da.bottom-da.top},$r=oo(ar);return Dt.createElement(un,{key:fa,data:yi,rowKey:ar,index:fa,style:{top:-Fo+$r.top},extra:!0,getHeight:_r})});return ia},ro=Dt.useMemo(function(){return{columnsOffset:so}},[so]),Po="".concat(yn,"-tbody"),Bo=en(["body","wrapper"]),Oe={};return Zn&&(Oe.position="sticky",Oe.bottom=0,(0,Ut.Z)(Zn)==="object"&&Zn.offsetScroll&&(Oe.bottom=Zn.offsetScroll)),Dt.createElement(fi.Provider,{value:ro},Dt.createElement(ri.Z,{fullHeight:!1,ref:tr,prefixCls:"".concat(Po,"-virtual"),styles:{horizontalScrollBar:Oe},className:Po,height:ai,itemHeight:pi||24,data:Vr,itemKey:function(Gr){return Li(Gr.record)},component:Bo,scrollWidth:$n,direction:An,onVirtualScroll:function(Gr){var Sr,hr=Gr.x;Tt({currentTarget:(Sr=tr.current)===null||Sr===void 0?void 0:Sr.nativeElement,scrollLeft:hr})},onScroll:Qi,extraRender:po},function(lo,Gr,Sr){var hr=Li(lo.record,Gr);return Dt.createElement(un,{data:lo,rowKey:hr,index:Gr,style:Sr.style})}))}),vn=pt(yo),Gi=vn,Wr=function(xn,be){var Tt=be.ref,Dn=be.onScroll;return Dt.createElement(Gi,{ref:Tt,data:xn,onScroll:Dn})};function Oi(je,xn){var be=je.data,Tt=je.columns,Dn=je.scroll,ei=je.sticky,Ni=je.prefixCls,Li=Ni===void 0?hi:Ni,di=je.className,yn=je.listItemHeight,Un=je.components,$n=je.onScroll,An=Dn||{},Xn=An.x,Zn=An.y;typeof Xn!="number"&&(Xn=1),typeof Zn!="number"&&(Zn=500);var ai=(0,Vn.zX)(function(Qi,tr){return(0,ye.Z)(Un,Qi)||tr}),pi=(0,Vn.zX)($n),en=Dt.useMemo(function(){return{sticky:ei,scrollY:Zn,listItemHeight:yn,getComponent:ai,onScroll:pi}},[ei,Zn,yn,ai,pi]);return Dt.createElement(Ri.Provider,{value:en},Dt.createElement(Ae,(0,jt.Z)({},je,{className:Te()(di,"".concat(Li,"-virtual")),scroll:(0,Gt.Z)((0,Gt.Z)({},Dn),{},{x:Xn}),components:(0,Gt.Z)((0,Gt.Z)({},Un),{},{body:be!=null&&be.length?Wr:void 0}),columns:Tt,internalHooks:ft.R,tailor:!0,ref:xn})))}var ko=Dt.forwardRef(Oi);function Ur(je){return st(ko,je)}var Cr=Ur(),Lo=null},54451:function(Mn,Rn,kt){"use strict";kt.d(Rn,{g:function(){return Dt},v:function(){return ue}});var ft=kt(20439),Kt=kt(62646),le=kt(48736),we=["expandable"],ue="RC_TABLE_INTERNAL_COL_DEFINE";function Dt(ee){var pe=ee.expandable,Jt=(0,Kt.Z)(ee,we),jt;return"expandable"in ee?jt=(0,ft.Z)((0,ft.Z)({},Jt),pe):jt=Jt,jt.showExpandColumn===!1&&(jt.expandIconColumnIndex=-1),jt}},22711:function(Mn,Rn,kt){"use strict";kt.r(Rn),kt.d(Rn,{ResizableTextArea:function(){return ie},default:function(){return Ye}});var ft=kt(14809),Kt=kt(4635),le=kt(20439),we=kt(95190),ue=kt(50298),Dt=kt(62646),ee=kt(92310),pe=kt.n(ee),Jt=kt(36901),jt=kt(66003),De=kt(30292),ae=kt(18929),Le=kt(59301),Bt=kt(93664),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;
|
|
`,pt=["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(Ze){var qe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,pn=Ze.getAttribute("id")||Ze.getAttribute("data-reactid")||Ze.getAttribute("name");if(qe&&vt[pn])return vt[pn];var te=window.getComputedStyle(Ze),Xt=te.getPropertyValue("box-sizing")||te.getPropertyValue("-moz-box-sizing")||te.getPropertyValue("-webkit-box-sizing"),Qe=parseFloat(te.getPropertyValue("padding-bottom"))+parseFloat(te.getPropertyValue("padding-top")),On=parseFloat(te.getPropertyValue("border-bottom-width"))+parseFloat(te.getPropertyValue("border-top-width")),En=pt.map(function(on){return"".concat(on,":").concat(te.getPropertyValue(on))}).join(";"),Ie={sizingStyle:En,paddingSize:Qe,borderSize:On,boxSizing:Xt};return qe&&pn&&(vt[pn]=Ie),Ie}function At(Ze){var qe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,pn=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,te=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)),Ze.getAttribute("wrap")?St.setAttribute("wrap",Ze.getAttribute("wrap")):St.removeAttribute("wrap");var Xt=Et(Ze,qe),Qe=Xt.paddingSize,On=Xt.borderSize,En=Xt.boxSizing,Ie=Xt.sizingStyle;St.setAttribute("style","".concat(Ie,";").concat(st)),St.value=Ze.value||Ze.placeholder||"";var on=void 0,cn=void 0,Vn,Me=St.scrollHeight;if(En==="border-box"?Me+=On:En==="content-box"&&(Me-=Qe),pn!==null||te!==null){St.value=" ";var he=St.scrollHeight-Qe;pn!==null&&(on=he*pn,En==="border-box"&&(on=on+Qe+On),Me=Math.max(on,Me)),te!==null&&(cn=he*te,En==="border-box"&&(cn=cn+Qe+On),Vn=Me>cn?"":"hidden",Me=Math.min(cn,Me))}var Ce={height:Me,overflowY:Vn,resize:"none"};return on&&(Ce.minHeight=on),cn&&(Ce.maxHeight=cn),Ce}var It=["prefixCls","defaultValue","value","autoSize","onResize","className","style","disabled","onChange","onInternalAutoSize"],qt=0,Ut=1,Gt=2,ge=Le.forwardRef(function(Ze,qe){var pn=Ze,te=pn.prefixCls,Xt=pn.defaultValue,Qe=pn.value,On=pn.autoSize,En=pn.onResize,Ie=pn.className,on=pn.style,cn=pn.disabled,Vn=pn.onChange,Me=pn.onInternalAutoSize,he=(0,Dt.Z)(pn,It),Ce=(0,ae.Z)(Xt,{value:Qe,postState:function(zn){return zn!=null?zn:""}}),Yn=(0,ue.Z)(Ce,2),Si=Yn[0],Rt=Yn[1],Ft=function(zn){Rt(zn.target.value),Vn==null||Vn(zn)},Pt=Le.useRef();Le.useImperativeHandle(qe,function(){return{textArea:Pt.current}});var Nt=Le.useMemo(function(){return On&&(0,Bt.Z)(On)==="object"?[On.minRows,On.maxRows]:[]},[On]),zt=(0,ue.Z)(Nt,2),Mt=zt[0],Yt=zt[1],He=!!On,_e=function(){try{if(document.activeElement===Pt.current){var zn=Pt.current,gi=zn.selectionStart,ti=zn.selectionEnd,wi=zn.scrollTop;Pt.current.setSelectionRange(gi,ti),Pt.current.scrollTop=wi}}catch(Wi){}},Xe=Le.useState(Gt),xe=(0,ue.Z)(Xe,2),Pe=xe[0],ke=xe[1],Ve=Le.useState(),tn=(0,ue.Z)(Ve,2),dn=tn[0],fn=tn[1],ni=function(){ke(qt)};(0,et.Z)(function(){He&&ni()},[Qe,Mt,Yt,He]),(0,et.Z)(function(){if(Pe===qt)ke(Ut);else if(Pe===Ut){var an=At(Pt.current,!1,Mt,Yt);ke(Gt),fn(an)}else _e()},[Pe]);var Ge=Le.useRef(),Ke=function(){ht.Z.cancel(Ge.current)},nn=function(zn){Pe===Gt&&(En==null||En(zn),On&&(Ke(),Ge.current=(0,ht.Z)(function(){ni()})))};Le.useEffect(function(){return Ke},[]);var Qn=He?dn:null,gn=(0,le.Z)((0,le.Z)({},on),Qn);return(Pe===qt||Pe===Ut)&&(gn.overflowY="hidden",gn.overflowX="hidden"),Le.createElement(nt.Z,{onResize:nn,disabled:!(On||En)},Le.createElement("textarea",(0,ft.Z)({},he,{ref:Pt,style:gn,className:pe()(te,Ie,(0,Kt.Z)({},"".concat(te,"-disabled"),cn)),disabled:cn,value:Si,onChange:Ft})))}),ie=ge,Te=["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"],ve=Le.forwardRef(function(Ze,qe){var pn,te=Ze.defaultValue,Xt=Ze.value,Qe=Ze.onFocus,On=Ze.onBlur,En=Ze.onChange,Ie=Ze.allowClear,on=Ze.maxLength,cn=Ze.onCompositionStart,Vn=Ze.onCompositionEnd,Me=Ze.suffix,he=Ze.prefixCls,Ce=he===void 0?"rc-textarea":he,Yn=Ze.showCount,Si=Ze.count,Rt=Ze.className,Ft=Ze.style,Pt=Ze.disabled,Nt=Ze.hidden,zt=Ze.classNames,Mt=Ze.styles,Yt=Ze.onResize,He=Ze.onClear,_e=Ze.onPressEnter,Xe=Ze.readOnly,xe=Ze.autoSize,Pe=Ze.onKeyDown,ke=(0,Dt.Z)(Ze,Te),Ve=(0,ae.Z)(te,{value:Xt,defaultValue:te}),tn=(0,ue.Z)(Ve,2),dn=tn[0],fn=tn[1],ni=dn==null?"":String(dn),Ge=Le.useState(!1),Ke=(0,ue.Z)(Ge,2),nn=Ke[0],Qn=Ke[1],gn=Le.useRef(!1),an=Le.useState(null),zn=(0,ue.Z)(an,2),gi=zn[0],ti=zn[1],wi=(0,Le.useRef)(null),Wi=(0,Le.useRef)(null),Cn=function(){var Ai;return(Ai=Wi.current)===null||Ai===void 0?void 0:Ai.textArea},Pn=function(){Cn().focus()};(0,Le.useImperativeHandle)(qe,function(){var Gn;return{resizableTextArea:Wi.current,focus:Pn,blur:function(){Cn().blur()},nativeElement:((Gn=wi.current)===null||Gn===void 0?void 0:Gn.nativeElement)||Cn()}}),(0,Le.useEffect)(function(){Qn(function(Gn){return!Pt&&Gn})},[Pt]);var Bn=Le.useState(null),si=(0,ue.Z)(Bn,2),Ei=si[0],ci=si[1];Le.useEffect(function(){if(Ei){var Gn;(Gn=Cn()).setSelectionRange.apply(Gn,(0,we.Z)(Ei))}},[Ei]);var Zi=(0,jt.Z)(Si,Yn),wt=(pn=Zi.max)!==null&&pn!==void 0?pn:on,Je=Number(wt)>0,Hn=Zi.strategy(ni),Ln=!!wt&&Hn>wt,jn=function(Ai,ji){var Tn=ji;!gn.current&&Zi.exceedFormatter&&Zi.max&&Zi.strategy(ji)>Zi.max&&(Tn=Zi.exceedFormatter(ji,{max:Zi.max}),ji!==Tn&&ci([Cn().selectionStart||0,Cn().selectionEnd||0])),fn(Tn),(0,De.rJ)(Ai.currentTarget,Ai,En,Tn)},li=function(Ai){gn.current=!0,cn==null||cn(Ai)},Ci=function(Ai){gn.current=!1,jn(Ai,Ai.currentTarget.value),Vn==null||Vn(Ai)},Yi=function(Ai){jn(Ai,Ai.target.value)},Be=function(Ai){Ai.key==="Enter"&&_e&&_e(Ai),Pe==null||Pe(Ai)},Se=function(Ai){Qn(!0),Qe==null||Qe(Ai)},Ee=function(Ai){Qn(!1),On==null||On(Ai)},Ue=function(Ai){fn(""),Pn(),(0,De.rJ)(Cn(),Ai,En)},xi=Me,Kn;Zi.show&&(Zi.showFormatter?Kn=Zi.showFormatter({value:ni,count:Hn,maxLength:wt}):Kn="".concat(Hn).concat(Je?" / ".concat(wt):""),xi=Le.createElement(Le.Fragment,null,xi,Le.createElement("span",{className:pe()("".concat(Ce,"-data-count"),zt==null?void 0:zt.count),style:Mt==null?void 0:Mt.count},Kn)));var Pi=function(Ai){var ji;Yt==null||Yt(Ai),(ji=Cn())!==null&&ji!==void 0&&ji.style.height&&ti(!0)},$e=!xe&&!Yn&&!Ie;return Le.createElement(Jt.BaseInput,{ref:wi,value:ni,allowClear:Ie,handleReset:Ue,suffix:xi,prefixCls:Ce,classNames:(0,le.Z)((0,le.Z)({},zt),{},{affixWrapper:pe()(zt==null?void 0:zt.affixWrapper,(0,Kt.Z)((0,Kt.Z)({},"".concat(Ce,"-show-count"),Yn),"".concat(Ce,"-textarea-allow-clear"),Ie))}),disabled:Pt,focused:nn,className:pe()(Rt,Ln&&"".concat(Ce,"-out-of-range")),style:(0,le.Z)((0,le.Z)({},Ft),gi&&!$e?{height:"auto"}:{}),dataAttrs:{affixWrapper:{"data-count":typeof Kn=="string"?Kn:void 0}},hidden:Nt,readOnly:Xe,onClear:He},Le.createElement(ie,(0,ft.Z)({},ke,{autoSize:xe,maxLength:on,onKeyDown:Be,onChange:Yi,onFocus:Se,onBlur:Ee,onCompositionStart:li,onCompositionEnd:Ci,className:pe()(zt==null?void 0:zt.textarea),style:(0,le.Z)((0,le.Z)({},Mt==null?void 0:Mt.textarea),{},{resize:Ft==null?void 0:Ft.resize}),disabled:Pt,prefixCls:Ce,onResize:Pi,ref:Wi,readOnly:Xe})))}),ye=ve,Ye=ye},639:function(Mn,Rn,kt){"use strict";kt.d(Rn,{Z:function(){return vt}});var ft=kt(14809),Kt=kt(4635),le=kt(20439),we=kt(50298),ue=kt(62646),Dt=kt(59301),ee=kt(92310),pe=kt.n(ee),Jt=kt(26112),jt=kt(30699),De=function(Et){for(var At=Et.prefixCls,It=Et.level,qt=Et.isStart,Ut=Et.isEnd,Gt="".concat(At,"-indent-unit"),ge=[],ie=0;ie<It;ie+=1)ge.push(Dt.createElement("span",{key:ie,className:pe()(Gt,(0,Kt.Z)((0,Kt.Z)({},"".concat(Gt,"-start"),qt[ie]),"".concat(Gt,"-end"),Ut[ie]))}));return Dt.createElement("span",{"aria-hidden":"true",className:"".concat(At,"-indent")},ge)},ae=Dt.memo(De),Le=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="---",pt=function(Et){var At,It,qt,Ut=Et.eventKey,Gt=Et.className,ge=Et.style,ie=Et.dragOver,Te=Et.dragOverGapTop,ve=Et.dragOverGapBottom,ye=Et.isLeaf,Ye=Et.isStart,Ze=Et.isEnd,qe=Et.expanded,pn=Et.selected,te=Et.checked,Xt=Et.halfChecked,Qe=Et.loading,On=Et.domRef,En=Et.active,Ie=Et.data,on=Et.onMouseMove,cn=Et.selectable,Vn=(0,ue.Z)(Et,nt),Me=Dt.useContext(jt.k),he=Dt.useContext(jt.y),Ce=Dt.useRef(null),Yn=Dt.useState(!1),Si=(0,we.Z)(Yn,2),Rt=Si[0],Ft=Si[1],Pt=!!(Me.disabled||Et.disabled||(At=he.nodeDisabled)!==null&&At!==void 0&&At.call(he,Ie)),Nt=Dt.useMemo(function(){return!Me.checkable||Et.checkable===!1?!1:Me.checkable},[Me.checkable,Et.checkable]),zt=function(Hn){Pt||Me.onNodeSelect(Hn,(0,Bt.F)(Et))},Mt=function(Hn){Pt||!Nt||Et.disableCheckbox||Me.onNodeCheck(Hn,(0,Bt.F)(Et),!te)},Yt=Dt.useMemo(function(){return typeof cn=="boolean"?cn:Me.selectable},[cn,Me.selectable]),He=function(Hn){Me.onNodeClick(Hn,(0,Bt.F)(Et)),Yt?zt(Hn):Mt(Hn)},_e=function(Hn){Me.onNodeDoubleClick(Hn,(0,Bt.F)(Et))},Xe=function(Hn){Me.onNodeMouseEnter(Hn,(0,Bt.F)(Et))},xe=function(Hn){Me.onNodeMouseLeave(Hn,(0,Bt.F)(Et))},Pe=function(Hn){Me.onNodeContextMenu(Hn,(0,Bt.F)(Et))},ke=Dt.useMemo(function(){return!!(Me.draggable&&(!Me.draggable.nodeDraggable||Me.draggable.nodeDraggable(Ie)))},[Me.draggable,Ie]),Ve=function(Hn){Hn.stopPropagation(),Ft(!0),Me.onNodeDragStart(Hn,Et);try{Hn.dataTransfer.setData("text/plain","")}catch(Ln){}},tn=function(Hn){Hn.preventDefault(),Hn.stopPropagation(),Me.onNodeDragEnter(Hn,Et)},dn=function(Hn){Hn.preventDefault(),Hn.stopPropagation(),Me.onNodeDragOver(Hn,Et)},fn=function(Hn){Hn.stopPropagation(),Me.onNodeDragLeave(Hn,Et)},ni=function(Hn){Hn.stopPropagation(),Ft(!1),Me.onNodeDragEnd(Hn,Et)},Ge=function(Hn){Hn.preventDefault(),Hn.stopPropagation(),Ft(!1),Me.onNodeDrop(Hn,Et)},Ke=function(Hn){Qe||Me.onNodeExpand(Hn,(0,Bt.F)(Et))},nn=Dt.useMemo(function(){var Je=(0,Le.Z)(Me.keyEntities,Ut)||{},Hn=Je.children;return!!(Hn||[]).length},[Me.keyEntities,Ut]),Qn=Dt.useMemo(function(){return ye===!1?!1:ye||!Me.loadData&&!nn||Me.loadData&&Et.loaded&&!nn},[ye,Me.loadData,nn,Et.loaded]);Dt.useEffect(function(){Qe||typeof Me.loadData=="function"&&qe&&!Qn&&!Et.loaded&&Me.onNodeLoad((0,Bt.F)(Et))},[Qe,Me.loadData,Me.onNodeLoad,qe,Qn,Et]);var gn=Dt.useMemo(function(){var Je;return(Je=Me.draggable)!==null&&Je!==void 0&&Je.icon?Dt.createElement("span",{className:"".concat(Me.prefixCls,"-draggable-icon")},Me.draggable.icon):null},[Me.draggable]),an=function(Hn){var Ln=Et.switcherIcon||Me.switcherIcon;return typeof Ln=="function"?Ln((0,le.Z)((0,le.Z)({},Et),{},{isLeaf:Hn})):Ln},zn=function(){if(Qn){var Hn=an(!0);return Hn!==!1?Dt.createElement("span",{className:pe()("".concat(Me.prefixCls,"-switcher"),"".concat(Me.prefixCls,"-switcher-noop"))},Hn):null}var Ln=an(!1);return Ln!==!1?Dt.createElement("span",{onClick:Ke,className:pe()("".concat(Me.prefixCls,"-switcher"),"".concat(Me.prefixCls,"-switcher_").concat(qe?et:ht))},Ln):null},gi=Dt.useMemo(function(){if(!Nt)return null;var Je=typeof Nt!="boolean"?Nt:null;return Dt.createElement("span",{className:pe()("".concat(Me.prefixCls,"-checkbox"),(0,Kt.Z)((0,Kt.Z)((0,Kt.Z)({},"".concat(Me.prefixCls,"-checkbox-checked"),te),"".concat(Me.prefixCls,"-checkbox-indeterminate"),!te&&Xt),"".concat(Me.prefixCls,"-checkbox-disabled"),Pt||Et.disableCheckbox)),onClick:Mt,role:"checkbox","aria-checked":Xt?"mixed":te,"aria-disabled":Pt||Et.disableCheckbox,"aria-label":"Select ".concat(typeof Et.title=="string"?Et.title:"tree node")},Je)},[Nt,te,Xt,Pt,Et.disableCheckbox,Et.title]),ti=Dt.useMemo(function(){return Qn?null:qe?et:ht},[Qn,qe]),wi=Dt.useMemo(function(){return Dt.createElement("span",{className:pe()("".concat(Me.prefixCls,"-iconEle"),"".concat(Me.prefixCls,"-icon__").concat(ti||"docu"),(0,Kt.Z)({},"".concat(Me.prefixCls,"-icon_loading"),Qe))})},[Me.prefixCls,ti,Qe]),Wi=Dt.useMemo(function(){var Je=!!Me.draggable,Hn=!Et.disabled&&Je&&Me.dragOverNodeKey===Ut;return Hn?Me.dropIndicatorRender({dropPosition:Me.dropPosition,dropLevelOffset:Me.dropLevelOffset,indent:Me.indent,prefixCls:Me.prefixCls,direction:Me.direction}):null},[Me.dropPosition,Me.dropLevelOffset,Me.indent,Me.prefixCls,Me.direction,Me.draggable,Me.dragOverNodeKey,Me.dropIndicatorRender]),Cn=Dt.useMemo(function(){var Je=Et.title,Hn=Je===void 0?st:Je,Ln="".concat(Me.prefixCls,"-node-content-wrapper"),jn;if(Me.showIcon){var li=Et.icon||Me.icon;jn=li?Dt.createElement("span",{className:pe()("".concat(Me.prefixCls,"-iconEle"),"".concat(Me.prefixCls,"-icon__customize"))},typeof li=="function"?li(Et):li):wi}else Me.loadData&&Qe&&(jn=wi);var Ci;return typeof Hn=="function"?Ci=Hn(Ie):Me.titleRender?Ci=Me.titleRender(Ie):Ci=Hn,Dt.createElement("span",{ref:Ce,title:typeof Hn=="string"?Hn:"",className:pe()(Ln,"".concat(Ln,"-").concat(ti||"normal"),(0,Kt.Z)({},"".concat(Me.prefixCls,"-node-selected"),!Pt&&(pn||Rt))),onMouseEnter:Xe,onMouseLeave:xe,onContextMenu:Pe,onClick:He,onDoubleClick:_e},jn,Dt.createElement("span",{className:"".concat(Me.prefixCls,"-title")},Ci),Wi)},[Me.prefixCls,Me.showIcon,Et,Me.icon,wi,Me.titleRender,Ie,ti,Xe,xe,Pe,He,_e]),Pn=(0,Jt.Z)(Vn,{aria:!0,data:!0}),Bn=(0,Le.Z)(Me.keyEntities,Ut)||{},si=Bn.level,Ei=Ze[Ze.length-1],ci=!Pt&&ke,Zi=Me.draggingNodeKey===Ut,wt=cn!==void 0?{"aria-selected":!!cn}:void 0;return Dt.createElement("div",(0,ft.Z)({ref:On,role:"treeitem","aria-expanded":ye?void 0:qe,className:pe()(Gt,"".concat(Me.prefixCls,"-treenode"),(qt={},(0,Kt.Z)((0,Kt.Z)((0,Kt.Z)((0,Kt.Z)((0,Kt.Z)((0,Kt.Z)((0,Kt.Z)((0,Kt.Z)((0,Kt.Z)((0,Kt.Z)(qt,"".concat(Me.prefixCls,"-treenode-disabled"),Pt),"".concat(Me.prefixCls,"-treenode-switcher-").concat(qe?"open":"close"),!ye),"".concat(Me.prefixCls,"-treenode-checkbox-checked"),te),"".concat(Me.prefixCls,"-treenode-checkbox-indeterminate"),Xt),"".concat(Me.prefixCls,"-treenode-selected"),pn),"".concat(Me.prefixCls,"-treenode-loading"),Qe),"".concat(Me.prefixCls,"-treenode-active"),En),"".concat(Me.prefixCls,"-treenode-leaf-last"),Ei),"".concat(Me.prefixCls,"-treenode-draggable"),ke),"dragging",Zi),(0,Kt.Z)((0,Kt.Z)((0,Kt.Z)((0,Kt.Z)((0,Kt.Z)((0,Kt.Z)((0,Kt.Z)(qt,"drop-target",Me.dropTargetKey===Ut),"drop-container",Me.dropContainerKey===Ut),"drag-over",!Pt&&ie),"drag-over-gap-top",!Pt&&Te),"drag-over-gap-bottom",!Pt&&ve),"filter-node",(It=Me.filterTreeNode)===null||It===void 0?void 0:It.call(Me,(0,Bt.F)(Et))),"".concat(Me.prefixCls,"-treenode-leaf"),Qn))),style:ge,draggable:ci,onDragStart:ci?Ve:void 0,onDragEnter:ke?tn:void 0,onDragOver:ke?dn:void 0,onDragLeave:ke?fn:void 0,onDrop:ke?Ge:void 0,onDragEnd:ke?ni:void 0,onMouseMove:on},wt,Pn),Dt.createElement(ae,{prefixCls:Me.prefixCls,level:si,isStart:Ye,isEnd:Ze}),gn,zn(),gi,Cn)};pt.isTreeNode=1;var vt=pt},30699:function(Mn,Rn,kt){"use strict";kt.d(Rn,{k:function(){return Kt},y:function(){return le}});var ft=kt(59301),Kt=ft.createContext(null),le=ft.createContext({})},29530:function(Mn,Rn,kt){"use strict";kt.d(Rn,{OF:function(){return Ut.Z},y6:function(){return ht.y},ZP:function(){return Pt}});var ft=kt(14809),Kt=kt(93664),le=kt(20439),we=kt(95190),ue=kt(99153),Dt=kt(84851),ee=kt(13028),pe=kt(19257),Jt=kt(93046),jt=kt(4635),De=kt(92310),ae=kt.n(De),Le=kt(10228),Bt=kt(26112),nt=kt(48736),et=kt(59301),ht=kt(30699),st=function(zt){var Mt=zt.dropPosition,Yt=zt.dropLevelOffset,He=zt.indent,_e={pointerEvents:"none",position:"absolute",right:0,backgroundColor:"red",height:2};switch(Mt){case-1:_e.top=0,_e.left=-Yt*He;break;case 1:_e.bottom=0,_e.left=-Yt*He;break;case 0:_e.bottom=0,_e.left=He;break}return et.createElement("div",{style:_e})},pt=st;function vt(Nt){if(Nt==null)throw new TypeError("Cannot destructure "+Nt)}var St=kt(50298),Et=kt(62646),At=kt(34280),It=kt(6790),qt=kt(77900),Ut=kt(639);function Gt(Nt,zt){var Mt=et.useState(!1),Yt=(0,St.Z)(Mt,2),He=Yt[0],_e=Yt[1];(0,At.Z)(function(){if(He)return Nt(),function(){zt()}},[He]),(0,At.Z)(function(){return _e(!0),function(){_e(!1)}},[])}var ge=Gt,ie=kt(34061),Te=["className","style","motion","motionNodes","motionType","onMotionStart","onMotionEnd","active","treeNodeRequiredProps"],ve=et.forwardRef(function(Nt,zt){var Mt=Nt.className,Yt=Nt.style,He=Nt.motion,_e=Nt.motionNodes,Xe=Nt.motionType,xe=Nt.onMotionStart,Pe=Nt.onMotionEnd,ke=Nt.active,Ve=Nt.treeNodeRequiredProps,tn=(0,Et.Z)(Nt,Te),dn=et.useState(!0),fn=(0,St.Z)(dn,2),ni=fn[0],Ge=fn[1],Ke=et.useContext(ht.k),nn=Ke.prefixCls,Qn=_e&&Xe!=="hide";(0,At.Z)(function(){_e&&Qn!==ni&&Ge(Qn)},[_e]);var gn=function(){_e&&xe()},an=et.useRef(!1),zn=function(){_e&&!an.current&&(an.current=!0,Pe())};ge(gn,zn);var gi=function(wi){Qn===wi&&zn()};return _e?et.createElement(qt.default,(0,ft.Z)({ref:zt,visible:ni},He,{motionAppear:Xe==="show",onVisibleChanged:gi}),function(ti,wi){var Wi=ti.className,Cn=ti.style;return et.createElement("div",{ref:wi,className:ae()("".concat(nn,"-treenode-motion"),Wi),style:Cn},_e.map(function(Pn){var Bn=Object.assign({},(vt(Pn.data),Pn.data)),si=Pn.title,Ei=Pn.key,ci=Pn.isStart,Zi=Pn.isEnd;delete Bn.children;var wt=(0,ie.H8)(Ei,Ve);return et.createElement(Ut.Z,(0,ft.Z)({},Bn,wt,{title:si,active:ke,data:Pn.data,key:Ei,isStart:ci,isEnd:Zi}))}))}):et.createElement(Ut.Z,(0,ft.Z)({domRef:zt,className:Mt,style:Yt},tn,{active:ke}))}),ye=ve;function Ye(){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 He(_e,Xe){var xe=new Map;_e.forEach(function(ke){xe.set(ke,!0)});var Pe=Xe.filter(function(ke){return!xe.has(ke)});return Pe.length===1?Pe[0]:null}return Mt<Yt?{add:!0,key:He(Nt,zt)}:{add:!1,key:He(zt,Nt)}}function Ze(Nt,zt,Mt){var Yt=Nt.findIndex(function(xe){return xe.key===Mt}),He=Nt[Yt+1],_e=zt.findIndex(function(xe){return xe.key===Mt});if(He){var Xe=zt.findIndex(function(xe){return xe.key===He.key});return zt.slice(_e+1,Xe)}return zt.slice(_e+1)}var qe=["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"],pn={width:0,height:0,display:"flex",overflow:"hidden",opacity:0,border:0,padding:0,margin:0},te=function(){},Xt="RC_TREE_MOTION_".concat(Math.random()),Qe={key:Xt},On={key:Xt,level:0,index:0,pos:"0",node:Qe,nodes:[Qe]},En={parent:null,children:[],pos:On.pos,data:Qe,title:null,key:Xt,isStart:[],isEnd:[]};function Ie(Nt,zt,Mt,Yt){return zt===!1||!Mt?Nt:Nt.slice(0,Math.ceil(Mt/Yt)+1)}function on(Nt){var zt=Nt.key,Mt=Nt.pos;return(0,ie.km)(zt,Mt)}function cn(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,He=Nt.selectable,_e=Nt.checkable,Xe=Nt.expandedKeys,xe=Nt.selectedKeys,Pe=Nt.checkedKeys,ke=Nt.loadedKeys,Ve=Nt.loadingKeys,tn=Nt.halfCheckedKeys,dn=Nt.keyEntities,fn=Nt.disabled,ni=Nt.dragging,Ge=Nt.dragOverNodeKey,Ke=Nt.dropPosition,nn=Nt.motion,Qn=Nt.height,gn=Nt.itemHeight,an=Nt.virtual,zn=Nt.scrollWidth,gi=Nt.focusable,ti=Nt.activeItem,wi=Nt.focused,Wi=Nt.tabIndex,Cn=Nt.onKeyDown,Pn=Nt.onFocus,Bn=Nt.onBlur,si=Nt.onActiveChange,Ei=Nt.onListChangeStart,ci=Nt.onListChangeEnd,Zi=(0,Et.Z)(Nt,qe),wt=et.useRef(null),Je=et.useRef(null);et.useImperativeHandle(zt,function(){return{scrollTo:function(In){wt.current.scrollTo(In)},getIndentWidth:function(){return Je.current.offsetWidth}}});var Hn=et.useState(Xe),Ln=(0,St.Z)(Hn,2),jn=Ln[0],li=Ln[1],Ci=et.useState(Yt),Yi=(0,St.Z)(Ci,2),Be=Yi[0],Se=Yi[1],Ee=et.useState(Yt),Ue=(0,St.Z)(Ee,2),xi=Ue[0],Kn=Ue[1],Pi=et.useState([]),$e=(0,St.Z)(Pi,2),Gn=$e[0],Ai=$e[1],ji=et.useState(null),Tn=(0,St.Z)(ji,2),Qt=Tn[0],me=Tn[1],bn=et.useRef(Yt);bn.current=Yt;function _n(){var Nn=bn.current;Se(Nn),Kn(Nn),Ai([]),me(null),ci()}(0,At.Z)(function(){li(Xe);var Nn=Ye(jn,Xe);if(Nn.key!==null)if(Nn.add){var In=Be.findIndex(function(Di){var mn=Di.key;return mn===Nn.key}),vi=Ie(Ze(Be,Yt,Nn.key),an,Qn,gn),Jn=Be.slice();Jn.splice(In+1,0,En),Kn(Jn),Ai(vi),me("show")}else{var ii=Yt.findIndex(function(Di){var mn=Di.key;return mn===Nn.key}),hi=Ie(Ze(Yt,Be,Nn.key),an,Qn,gn),Ii=Yt.slice();Ii.splice(ii+1,0,En),Kn(Ii),Ai(hi),me("hide")}else Be!==Yt&&(Se(Yt),Kn(Yt))},[Xe,Yt]),et.useEffect(function(){ni||_n()},[ni]);var ze=nn?xi:Yt,hn={expandedKeys:Xe,selectedKeys:xe,loadedKeys:ke,loadingKeys:Ve,checkedKeys:Pe,halfCheckedKeys:tn,dragOverNodeKey:Ge,dropPosition:Ke,keyEntities:dn};return et.createElement(et.Fragment,null,wi&&ti&&et.createElement("span",{style:pn,"aria-live":"assertive"},cn(ti)),et.createElement("div",null,et.createElement("input",{style:pn,disabled:gi===!1||fn,tabIndex:gi!==!1?Wi:null,onKeyDown:Cn,onFocus:Pn,onBlur:Bn,value:"",onChange:te,"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:Je,className:"".concat(Mt,"-indent-unit")}))),et.createElement(It.Z,(0,ft.Z)({},Zi,{data:ze,itemKey:on,height:Qn,fullHeight:!1,virtual:an,itemHeight:gn,scrollWidth:zn,prefixCls:"".concat(Mt,"-list"),ref:wt,role:"tree",onVisibleChange:function(In){In.every(function(vi){return on(vi)!==Xt})&&_n()}}),function(Nn){var In=Nn.pos,vi=Object.assign({},(vt(Nn.data),Nn.data)),Jn=Nn.title,ii=Nn.key,hi=Nn.isStart,Ii=Nn.isEnd,Di=(0,ie.km)(ii,In);delete vi.key,delete vi.children;var mn=(0,ie.H8)(Di,hn);return et.createElement(ye,(0,ft.Z)({},vi,mn,{title:Jn,active:!!ti&&ii===ti.key,pos:In,data:Nn.data,isStart:hi,isEnd:Ii,motion:nn,motionNodes:ii===Xt?Gn:null,motionType:Qt,onMotionStart:Ei,onMotionEnd:_n,treeNodeRequiredProps:hn,onMouseMove:function(){si(null)}}))}))}),Me=Vn,he=kt(82661),Ce=kt(34643),Yn=kt(65065),Si=10,Rt=function(Nt){(0,pe.Z)(Mt,Nt);var zt=(0,Jt.Z)(Mt);function Mt(){var Yt;(0,ue.Z)(this,Mt);for(var He=arguments.length,_e=new Array(He),Xe=0;Xe<He;Xe++)_e[Xe]=arguments[Xe];return Yt=zt.call.apply(zt,[this].concat(_e)),(0,jt.Z)((0,ee.Z)(Yt),"destroyed",!1),(0,jt.Z)((0,ee.Z)(Yt),"delayedDragEnterLogic",void 0),(0,jt.Z)((0,ee.Z)(Yt),"loadingRetryTimes",{}),(0,jt.Z)((0,ee.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,ee.Z)(Yt),"dragStartMousePosition",null),(0,jt.Z)((0,ee.Z)(Yt),"dragNodeProps",null),(0,jt.Z)((0,ee.Z)(Yt),"currentMouseOverDroppableNodeKey",null),(0,jt.Z)((0,ee.Z)(Yt),"listRef",et.createRef()),(0,jt.Z)((0,ee.Z)(Yt),"onNodeDragStart",function(xe,Pe){var ke=Yt.state,Ve=ke.expandedKeys,tn=ke.keyEntities,dn=Yt.props.onDragStart,fn=Pe.eventKey;Yt.dragNodeProps=Pe,Yt.dragStartMousePosition={x:xe.clientX,y:xe.clientY};var ni=(0,he._5)(Ve,fn);Yt.setState({draggingNodeKey:fn,dragChildrenKeys:(0,he.wA)(fn,tn),indent:Yt.listRef.current.getIndentWidth()}),Yt.setExpandedKeys(ni),window.addEventListener("dragend",Yt.onWindowDragEnd),dn==null||dn({event:xe,node:(0,ie.F)(Pe)})}),(0,jt.Z)((0,ee.Z)(Yt),"onNodeDragEnter",function(xe,Pe){var ke=Yt.state,Ve=ke.expandedKeys,tn=ke.keyEntities,dn=ke.dragChildrenKeys,fn=ke.flattenNodes,ni=ke.indent,Ge=Yt.props,Ke=Ge.onDragEnter,nn=Ge.onExpand,Qn=Ge.allowDrop,gn=Ge.direction,an=Pe.pos,zn=Pe.eventKey;if(Yt.currentMouseOverDroppableNodeKey!==zn&&(Yt.currentMouseOverDroppableNodeKey=zn),!Yt.dragNodeProps){Yt.resetDragState();return}var gi=(0,he.OM)(xe,Yt.dragNodeProps,Pe,ni,Yt.dragStartMousePosition,Qn,fn,tn,Ve,gn),ti=gi.dropPosition,wi=gi.dropLevelOffset,Wi=gi.dropTargetKey,Cn=gi.dropContainerKey,Pn=gi.dropTargetPos,Bn=gi.dropAllowed,si=gi.dragOverNodeKey;if(dn.includes(Wi)||!Bn){Yt.resetDragState();return}if(Yt.delayedDragEnterLogic||(Yt.delayedDragEnterLogic={}),Object.keys(Yt.delayedDragEnterLogic).forEach(function(Ei){clearTimeout(Yt.delayedDragEnterLogic[Ei])}),Yt.dragNodeProps.eventKey!==Pe.eventKey&&(xe.persist(),Yt.delayedDragEnterLogic[an]=window.setTimeout(function(){if(Yt.state.draggingNodeKey!==null){var Ei=(0,we.Z)(Ve),ci=(0,Yn.Z)(tn,Pe.eventKey);ci&&(ci.children||[]).length&&(Ei=(0,he.L0)(Ve,Pe.eventKey)),Yt.props.hasOwnProperty("expandedKeys")||Yt.setExpandedKeys(Ei),nn==null||nn(Ei,{node:(0,ie.F)(Pe),expanded:!0,nativeEvent:xe.nativeEvent})}},800)),Yt.dragNodeProps.eventKey===Wi&&wi===0){Yt.resetDragState();return}Yt.setState({dragOverNodeKey:si,dropPosition:ti,dropLevelOffset:wi,dropTargetKey:Wi,dropContainerKey:Cn,dropTargetPos:Pn,dropAllowed:Bn}),Ke==null||Ke({event:xe,node:(0,ie.F)(Pe),expandedKeys:Ve})}),(0,jt.Z)((0,ee.Z)(Yt),"onNodeDragOver",function(xe,Pe){var ke=Yt.state,Ve=ke.dragChildrenKeys,tn=ke.flattenNodes,dn=ke.keyEntities,fn=ke.expandedKeys,ni=ke.indent,Ge=Yt.props,Ke=Ge.onDragOver,nn=Ge.allowDrop,Qn=Ge.direction;if(Yt.dragNodeProps){var gn=(0,he.OM)(xe,Yt.dragNodeProps,Pe,ni,Yt.dragStartMousePosition,nn,tn,dn,fn,Qn),an=gn.dropPosition,zn=gn.dropLevelOffset,gi=gn.dropTargetKey,ti=gn.dropContainerKey,wi=gn.dropTargetPos,Wi=gn.dropAllowed,Cn=gn.dragOverNodeKey;Ve.includes(gi)||!Wi||(Yt.dragNodeProps.eventKey===gi&&zn===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():an===Yt.state.dropPosition&&zn===Yt.state.dropLevelOffset&&gi===Yt.state.dropTargetKey&&ti===Yt.state.dropContainerKey&&wi===Yt.state.dropTargetPos&&Wi===Yt.state.dropAllowed&&Cn===Yt.state.dragOverNodeKey||Yt.setState({dropPosition:an,dropLevelOffset:zn,dropTargetKey:gi,dropContainerKey:ti,dropTargetPos:wi,dropAllowed:Wi,dragOverNodeKey:Cn}),Ke==null||Ke({event:xe,node:(0,ie.F)(Pe)}))}}),(0,jt.Z)((0,ee.Z)(Yt),"onNodeDragLeave",function(xe,Pe){Yt.currentMouseOverDroppableNodeKey===Pe.eventKey&&!xe.currentTarget.contains(xe.relatedTarget)&&(Yt.resetDragState(),Yt.currentMouseOverDroppableNodeKey=null);var ke=Yt.props.onDragLeave;ke==null||ke({event:xe,node:(0,ie.F)(Pe)})}),(0,jt.Z)((0,ee.Z)(Yt),"onWindowDragEnd",function(xe){Yt.onNodeDragEnd(xe,null,!0),window.removeEventListener("dragend",Yt.onWindowDragEnd)}),(0,jt.Z)((0,ee.Z)(Yt),"onNodeDragEnd",function(xe,Pe){var ke=Yt.props.onDragEnd;Yt.setState({dragOverNodeKey:null}),Yt.cleanDragState(),ke==null||ke({event:xe,node:(0,ie.F)(Pe)}),Yt.dragNodeProps=null,window.removeEventListener("dragend",Yt.onWindowDragEnd)}),(0,jt.Z)((0,ee.Z)(Yt),"onNodeDrop",function(xe,Pe){var ke,Ve=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,tn=Yt.state,dn=tn.dragChildrenKeys,fn=tn.dropPosition,ni=tn.dropTargetKey,Ge=tn.dropTargetPos,Ke=tn.dropAllowed;if(Ke){var nn=Yt.props.onDrop;if(Yt.setState({dragOverNodeKey:null}),Yt.cleanDragState(),ni!==null){var Qn=(0,le.Z)((0,le.Z)({},(0,ie.H8)(ni,Yt.getTreeNodeRequiredProps())),{},{active:((ke=Yt.getActiveItem())===null||ke===void 0?void 0:ke.key)===ni,data:(0,Yn.Z)(Yt.state.keyEntities,ni).node}),gn=dn.includes(ni);(0,nt.ZP)(!gn,"Can not drop to dragNode's children node. This is a bug of rc-tree. Please report an issue.");var an=(0,he.yx)(Ge),zn={event:xe,node:(0,ie.F)(Qn),dragNode:Yt.dragNodeProps?(0,ie.F)(Yt.dragNodeProps):null,dragNodesKeys:[Yt.dragNodeProps.eventKey].concat(dn),dropToGap:fn!==0,dropPosition:fn+Number(an[an.length-1])};Ve||nn==null||nn(zn),Yt.dragNodeProps=null}}}),(0,jt.Z)((0,ee.Z)(Yt),"cleanDragState",function(){var xe=Yt.state.draggingNodeKey;xe!==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,ee.Z)(Yt),"triggerExpandActionExpand",function(xe,Pe){var ke=Yt.state,Ve=ke.expandedKeys,tn=ke.flattenNodes,dn=Pe.expanded,fn=Pe.key,ni=Pe.isLeaf;if(!(ni||xe.shiftKey||xe.metaKey||xe.ctrlKey)){var Ge=tn.filter(function(nn){return nn.key===fn})[0],Ke=(0,ie.F)((0,le.Z)((0,le.Z)({},(0,ie.H8)(fn,Yt.getTreeNodeRequiredProps())),{},{data:Ge.data}));Yt.setExpandedKeys(dn?(0,he._5)(Ve,fn):(0,he.L0)(Ve,fn)),Yt.onNodeExpand(xe,Ke)}}),(0,jt.Z)((0,ee.Z)(Yt),"onNodeClick",function(xe,Pe){var ke=Yt.props,Ve=ke.onClick,tn=ke.expandAction;tn==="click"&&Yt.triggerExpandActionExpand(xe,Pe),Ve==null||Ve(xe,Pe)}),(0,jt.Z)((0,ee.Z)(Yt),"onNodeDoubleClick",function(xe,Pe){var ke=Yt.props,Ve=ke.onDoubleClick,tn=ke.expandAction;tn==="doubleClick"&&Yt.triggerExpandActionExpand(xe,Pe),Ve==null||Ve(xe,Pe)}),(0,jt.Z)((0,ee.Z)(Yt),"onNodeSelect",function(xe,Pe){var ke=Yt.state.selectedKeys,Ve=Yt.state,tn=Ve.keyEntities,dn=Ve.fieldNames,fn=Yt.props,ni=fn.onSelect,Ge=fn.multiple,Ke=Pe.selected,nn=Pe[dn.key],Qn=!Ke;Qn?Ge?ke=(0,he.L0)(ke,nn):ke=[nn]:ke=(0,he._5)(ke,nn);var gn=ke.map(function(an){var zn=(0,Yn.Z)(tn,an);return zn?zn.node:null}).filter(Boolean);Yt.setUncontrolledState({selectedKeys:ke}),ni==null||ni(ke,{event:"select",selected:Qn,node:Pe,selectedNodes:gn,nativeEvent:xe.nativeEvent})}),(0,jt.Z)((0,ee.Z)(Yt),"onNodeCheck",function(xe,Pe,ke){var Ve=Yt.state,tn=Ve.keyEntities,dn=Ve.checkedKeys,fn=Ve.halfCheckedKeys,ni=Yt.props,Ge=ni.checkStrictly,Ke=ni.onCheck,nn=Pe.key,Qn,gn={event:"check",node:Pe,checked:ke,nativeEvent:xe.nativeEvent};if(Ge){var an=ke?(0,he.L0)(dn,nn):(0,he._5)(dn,nn),zn=(0,he._5)(fn,nn);Qn={checked:an,halfChecked:zn},gn.checkedNodes=an.map(function(Pn){return(0,Yn.Z)(tn,Pn)}).filter(Boolean).map(function(Pn){return Pn.node}),Yt.setUncontrolledState({checkedKeys:an})}else{var gi=(0,Ce.S)([].concat((0,we.Z)(dn),[nn]),!0,tn),ti=gi.checkedKeys,wi=gi.halfCheckedKeys;if(!ke){var Wi=new Set(ti);Wi.delete(nn);var Cn=(0,Ce.S)(Array.from(Wi),{checked:!1,halfCheckedKeys:wi},tn);ti=Cn.checkedKeys,wi=Cn.halfCheckedKeys}Qn=ti,gn.checkedNodes=[],gn.checkedNodesPositions=[],gn.halfCheckedKeys=wi,ti.forEach(function(Pn){var Bn=(0,Yn.Z)(tn,Pn);if(Bn){var si=Bn.node,Ei=Bn.pos;gn.checkedNodes.push(si),gn.checkedNodesPositions.push({node:si,pos:Ei})}}),Yt.setUncontrolledState({checkedKeys:ti},!1,{halfCheckedKeys:wi})}Ke==null||Ke(Qn,gn)}),(0,jt.Z)((0,ee.Z)(Yt),"onNodeLoad",function(xe){var Pe,ke=xe.key,Ve=Yt.state.keyEntities,tn=(0,Yn.Z)(Ve,ke);if(!(tn!=null&&(Pe=tn.children)!==null&&Pe!==void 0&&Pe.length)){var dn=new Promise(function(fn,ni){Yt.setState(function(Ge){var Ke=Ge.loadedKeys,nn=Ke===void 0?[]:Ke,Qn=Ge.loadingKeys,gn=Qn===void 0?[]:Qn,an=Yt.props,zn=an.loadData,gi=an.onLoad;if(!zn||nn.includes(ke)||gn.includes(ke))return null;var ti=zn(xe);return ti.then(function(){var wi=Yt.state.loadedKeys,Wi=(0,he.L0)(wi,ke);gi==null||gi(Wi,{event:"load",node:xe}),Yt.setUncontrolledState({loadedKeys:Wi}),Yt.setState(function(Cn){return{loadingKeys:(0,he._5)(Cn.loadingKeys,ke)}}),fn()}).catch(function(wi){if(Yt.setState(function(Cn){return{loadingKeys:(0,he._5)(Cn.loadingKeys,ke)}}),Yt.loadingRetryTimes[ke]=(Yt.loadingRetryTimes[ke]||0)+1,Yt.loadingRetryTimes[ke]>=Si){var Wi=Yt.state.loadedKeys;(0,nt.ZP)(!1,"Retry for `loadData` many times but still failed. No more retry."),Yt.setUncontrolledState({loadedKeys:(0,he.L0)(Wi,ke)}),fn()}ni(wi)}),{loadingKeys:(0,he.L0)(gn,ke)}})});return dn.catch(function(){}),dn}}),(0,jt.Z)((0,ee.Z)(Yt),"onNodeMouseEnter",function(xe,Pe){var ke=Yt.props.onMouseEnter;ke==null||ke({event:xe,node:Pe})}),(0,jt.Z)((0,ee.Z)(Yt),"onNodeMouseLeave",function(xe,Pe){var ke=Yt.props.onMouseLeave;ke==null||ke({event:xe,node:Pe})}),(0,jt.Z)((0,ee.Z)(Yt),"onNodeContextMenu",function(xe,Pe){var ke=Yt.props.onRightClick;ke&&(xe.preventDefault(),ke({event:xe,node:Pe}))}),(0,jt.Z)((0,ee.Z)(Yt),"onFocus",function(){var xe=Yt.props.onFocus;Yt.setState({focused:!0});for(var Pe=arguments.length,ke=new Array(Pe),Ve=0;Ve<Pe;Ve++)ke[Ve]=arguments[Ve];xe==null||xe.apply(void 0,ke)}),(0,jt.Z)((0,ee.Z)(Yt),"onBlur",function(){var xe=Yt.props.onBlur;Yt.setState({focused:!1}),Yt.onActiveChange(null);for(var Pe=arguments.length,ke=new Array(Pe),Ve=0;Ve<Pe;Ve++)ke[Ve]=arguments[Ve];xe==null||xe.apply(void 0,ke)}),(0,jt.Z)((0,ee.Z)(Yt),"getTreeNodeRequiredProps",function(){var xe=Yt.state,Pe=xe.expandedKeys,ke=xe.selectedKeys,Ve=xe.loadedKeys,tn=xe.loadingKeys,dn=xe.checkedKeys,fn=xe.halfCheckedKeys,ni=xe.dragOverNodeKey,Ge=xe.dropPosition,Ke=xe.keyEntities;return{expandedKeys:Pe||[],selectedKeys:ke||[],loadedKeys:Ve||[],loadingKeys:tn||[],checkedKeys:dn||[],halfCheckedKeys:fn||[],dragOverNodeKey:ni,dropPosition:Ge,keyEntities:Ke}}),(0,jt.Z)((0,ee.Z)(Yt),"setExpandedKeys",function(xe){var Pe=Yt.state,ke=Pe.treeData,Ve=Pe.fieldNames,tn=(0,ie.oH)(ke,xe,Ve);Yt.setUncontrolledState({expandedKeys:xe,flattenNodes:tn},!0)}),(0,jt.Z)((0,ee.Z)(Yt),"onNodeExpand",function(xe,Pe){var ke=Yt.state.expandedKeys,Ve=Yt.state,tn=Ve.listChanging,dn=Ve.fieldNames,fn=Yt.props,ni=fn.onExpand,Ge=fn.loadData,Ke=Pe.expanded,nn=Pe[dn.key];if(!tn){var Qn=ke.includes(nn),gn=!Ke;if((0,nt.ZP)(Ke&&Qn||!Ke&&!Qn,"Expand state not sync with index check"),ke=gn?(0,he.L0)(ke,nn):(0,he._5)(ke,nn),Yt.setExpandedKeys(ke),ni==null||ni(ke,{node:Pe,expanded:gn,nativeEvent:xe.nativeEvent}),gn&&Ge){var an=Yt.onNodeLoad(Pe);an&&an.then(function(){var zn=(0,ie.oH)(Yt.state.treeData,ke,dn);Yt.setUncontrolledState({flattenNodes:zn})}).catch(function(){var zn=Yt.state.expandedKeys,gi=(0,he._5)(zn,nn);Yt.setExpandedKeys(gi)})}}}),(0,jt.Z)((0,ee.Z)(Yt),"onListChangeStart",function(){Yt.setUncontrolledState({listChanging:!0})}),(0,jt.Z)((0,ee.Z)(Yt),"onListChangeEnd",function(){setTimeout(function(){Yt.setUncontrolledState({listChanging:!1})})}),(0,jt.Z)((0,ee.Z)(Yt),"onActiveChange",function(xe){var Pe=Yt.state.activeKey,ke=Yt.props,Ve=ke.onActiveChange,tn=ke.itemScrollOffset,dn=tn===void 0?0:tn;Pe!==xe&&(Yt.setState({activeKey:xe}),xe!==null&&Yt.scrollTo({key:xe,offset:dn}),Ve==null||Ve(xe))}),(0,jt.Z)((0,ee.Z)(Yt),"getActiveItem",function(){var xe=Yt.state,Pe=xe.activeKey,ke=xe.flattenNodes;return Pe===null?null:ke.find(function(Ve){var tn=Ve.key;return tn===Pe})||null}),(0,jt.Z)((0,ee.Z)(Yt),"offsetActiveKey",function(xe){var Pe=Yt.state,ke=Pe.flattenNodes,Ve=Pe.activeKey,tn=ke.findIndex(function(ni){var Ge=ni.key;return Ge===Ve});tn===-1&&xe<0&&(tn=ke.length),tn=(tn+xe+ke.length)%ke.length;var dn=ke[tn];if(dn){var fn=dn.key;Yt.onActiveChange(fn)}else Yt.onActiveChange(null)}),(0,jt.Z)((0,ee.Z)(Yt),"onKeyDown",function(xe){var Pe=Yt.state,ke=Pe.activeKey,Ve=Pe.expandedKeys,tn=Pe.checkedKeys,dn=Pe.fieldNames,fn=Yt.props,ni=fn.onKeyDown,Ge=fn.checkable,Ke=fn.selectable;switch(xe.which){case Le.Z.UP:{Yt.offsetActiveKey(-1),xe.preventDefault();break}case Le.Z.DOWN:{Yt.offsetActiveKey(1),xe.preventDefault();break}}var nn=Yt.getActiveItem();if(nn&&nn.data){var Qn=Yt.getTreeNodeRequiredProps(),gn=nn.data.isLeaf===!1||!!(nn.data[dn.children]||[]).length,an=(0,ie.F)((0,le.Z)((0,le.Z)({},(0,ie.H8)(ke,Qn)),{},{data:nn.data,active:!0}));switch(xe.which){case Le.Z.LEFT:{gn&&Ve.includes(ke)?Yt.onNodeExpand({},an):nn.parent&&Yt.onActiveChange(nn.parent.key),xe.preventDefault();break}case Le.Z.RIGHT:{gn&&!Ve.includes(ke)?Yt.onNodeExpand({},an):nn.children&&nn.children.length&&Yt.onActiveChange(nn.children[0].key),xe.preventDefault();break}case Le.Z.ENTER:case Le.Z.SPACE:{Ge&&!an.disabled&&an.checkable!==!1&&!an.disableCheckbox?Yt.onNodeCheck({},an,!tn.includes(ke)):!Ge&&Ke&&!an.disabled&&an.selectable!==!1&&Yt.onNodeSelect({},an);break}}}ni==null||ni(xe)}),(0,jt.Z)((0,ee.Z)(Yt),"setUncontrolledState",function(xe){var Pe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,ke=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;if(!Yt.destroyed){var Ve=!1,tn=!0,dn={};Object.keys(xe).forEach(function(fn){if(Yt.props.hasOwnProperty(fn)){tn=!1;return}Ve=!0,dn[fn]=xe[fn]}),Ve&&(!Pe||tn)&&Yt.setState((0,le.Z)((0,le.Z)({},dn),ke))}}),(0,jt.Z)((0,ee.Z)(Yt),"scrollTo",function(xe){Yt.listRef.current.scrollTo(xe)}),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 He=this.props,_e=He.activeKey,Xe=He.itemScrollOffset,xe=Xe===void 0?0:Xe;_e!==void 0&&_e!==this.state.activeKey&&(this.setState({activeKey:_e}),_e!==null&&this.scrollTo({key:_e,offset:xe}))}},{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 He=this.state,_e=He.focused,Xe=He.flattenNodes,xe=He.keyEntities,Pe=He.draggingNodeKey,ke=He.activeKey,Ve=He.dropLevelOffset,tn=He.dropContainerKey,dn=He.dropTargetKey,fn=He.dropPosition,ni=He.dragOverNodeKey,Ge=He.indent,Ke=this.props,nn=Ke.prefixCls,Qn=Ke.className,gn=Ke.style,an=Ke.showLine,zn=Ke.focusable,gi=Ke.tabIndex,ti=gi===void 0?0:gi,wi=Ke.selectable,Wi=Ke.showIcon,Cn=Ke.icon,Pn=Ke.switcherIcon,Bn=Ke.draggable,si=Ke.checkable,Ei=Ke.checkStrictly,ci=Ke.disabled,Zi=Ke.motion,wt=Ke.loadData,Je=Ke.filterTreeNode,Hn=Ke.height,Ln=Ke.itemHeight,jn=Ke.scrollWidth,li=Ke.virtual,Ci=Ke.titleRender,Yi=Ke.dropIndicatorRender,Be=Ke.onContextMenu,Se=Ke.onScroll,Ee=Ke.direction,Ue=Ke.rootClassName,xi=Ke.rootStyle,Kn=(0,Bt.Z)(this.props,{aria:!0,data:!0}),Pi;Bn&&((0,Kt.Z)(Bn)==="object"?Pi=Bn:typeof Bn=="function"?Pi={nodeDraggable:Bn}:Pi={});var $e={prefixCls:nn,selectable:wi,showIcon:Wi,icon:Cn,switcherIcon:Pn,draggable:Pi,draggingNodeKey:Pe,checkable:si,checkStrictly:Ei,disabled:ci,keyEntities:xe,dropLevelOffset:Ve,dropContainerKey:tn,dropTargetKey:dn,dropPosition:fn,dragOverNodeKey:ni,indent:Ge,direction:Ee,dropIndicatorRender:Yi,loadData:wt,filterTreeNode:Je,titleRender:Ci,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:$e},et.createElement("div",{className:ae()(nn,Qn,Ue,(0,jt.Z)((0,jt.Z)((0,jt.Z)({},"".concat(nn,"-show-line"),an),"".concat(nn,"-focused"),_e),"".concat(nn,"-active-focused"),ke!==null)),style:xi},et.createElement(Me,(0,ft.Z)({ref:this.listRef,prefixCls:nn,style:gn,data:Xe,disabled:ci,selectable:wi,checkable:!!si,motion:Zi,dragging:Pe!==null,height:Hn,itemHeight:Ln,virtual:li,focusable:zn,focused:_e,tabIndex:ti,activeItem:this.getActiveItem(),onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:this.onKeyDown,onActiveChange:this.onActiveChange,onListChangeStart:this.onListChangeStart,onListChangeEnd:this.onListChangeEnd,onContextMenu:Be,onScroll:Se,scrollWidth:jn},this.getTreeNodeRequiredProps(),Kn))))}}],[{key:"getDerivedStateFromProps",value:function(He,_e){var Xe=_e.prevProps,xe={prevProps:He};function Pe(ti){return!Xe&&He.hasOwnProperty(ti)||Xe&&Xe[ti]!==He[ti]}var ke,Ve=_e.fieldNames;if(Pe("fieldNames")&&(Ve=(0,ie.w$)(He.fieldNames),xe.fieldNames=Ve),Pe("treeData")?ke=He.treeData:Pe("children")&&((0,nt.ZP)(!1,"`children` of Tree is deprecated. Please use `treeData` instead."),ke=(0,ie.zn)(He.children)),ke){xe.treeData=ke;var tn=(0,ie.I8)(ke,{fieldNames:Ve});xe.keyEntities=(0,le.Z)((0,jt.Z)({},Xt,On),tn.keyEntities)}var dn=xe.keyEntities||_e.keyEntities;if(Pe("expandedKeys")||Xe&&Pe("autoExpandParent"))xe.expandedKeys=He.autoExpandParent||!Xe&&He.defaultExpandParent?(0,he.r7)(He.expandedKeys,dn):He.expandedKeys;else if(!Xe&&He.defaultExpandAll){var fn=(0,le.Z)({},dn);delete fn[Xt];var ni=[];Object.keys(fn).forEach(function(ti){var wi=fn[ti];wi.children&&wi.children.length&&ni.push(wi.key)}),xe.expandedKeys=ni}else!Xe&&He.defaultExpandedKeys&&(xe.expandedKeys=He.autoExpandParent||He.defaultExpandParent?(0,he.r7)(He.defaultExpandedKeys,dn):He.defaultExpandedKeys);if(xe.expandedKeys||delete xe.expandedKeys,ke||xe.expandedKeys){var Ge=(0,ie.oH)(ke||_e.treeData,xe.expandedKeys||_e.expandedKeys,Ve);xe.flattenNodes=Ge}if(He.selectable&&(Pe("selectedKeys")?xe.selectedKeys=(0,he.BT)(He.selectedKeys,He):!Xe&&He.defaultSelectedKeys&&(xe.selectedKeys=(0,he.BT)(He.defaultSelectedKeys,He))),He.checkable){var Ke;if(Pe("checkedKeys")?Ke=(0,he.E6)(He.checkedKeys)||{}:!Xe&&He.defaultCheckedKeys?Ke=(0,he.E6)(He.defaultCheckedKeys)||{}:ke&&(Ke=(0,he.E6)(He.checkedKeys)||{checkedKeys:_e.checkedKeys,halfCheckedKeys:_e.halfCheckedKeys}),Ke){var nn=Ke,Qn=nn.checkedKeys,gn=Qn===void 0?[]:Qn,an=nn.halfCheckedKeys,zn=an===void 0?[]:an;if(!He.checkStrictly){var gi=(0,Ce.S)(gn,!0,dn);gn=gi.checkedKeys,zn=gi.halfCheckedKeys}xe.checkedKeys=gn,xe.halfCheckedKeys=zn}}return Pe("loadedKeys")&&(xe.loadedKeys=He.loadedKeys),xe}}]),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:pt,allowDrop:function(){return!0},expandAction:!1}),(0,jt.Z)(Rt,"TreeNode",Ut.Z);var Ft=Rt,Pt=Ft},82661:function(Mn,Rn,kt){"use strict";kt.d(Rn,{BT:function(){return et},E6:function(){return pt},L0:function(){return jt},OM:function(){return nt},_5:function(){return Jt},r7:function(){return vt},wA:function(){return ae},yx:function(){return De}});var ft=kt(95190),Kt=kt(93664),le=kt(48736),we=kt(59301),ue=kt(639),Dt=kt(65065),ee=kt(34061),pe=null;function Jt(St,Et){if(!St)return[];var At=St.slice(),It=At.indexOf(Et);return It>=0&&At.splice(It,1),At}function jt(St,Et){var At=(St||[]).slice();return At.indexOf(Et)===-1&&At.push(Et),At}function De(St){return St.split("-")}function ae(St,Et){var At=[],It=(0,Dt.Z)(Et,St);function qt(){var Ut=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];Ut.forEach(function(Gt){var ge=Gt.key,ie=Gt.children;At.push(ge),qt(ie)})}return qt(It.children),At}function Le(St){if(St.parent){var Et=De(St.pos);return Number(Et[Et.length-1])===St.parent.children.length-1}return!1}function Bt(St){var Et=De(St.pos);return Number(Et[Et.length-1])===0}function nt(St,Et,At,It,qt,Ut,Gt,ge,ie,Te){var ve,ye=St.clientX,Ye=St.clientY,Ze=St.target.getBoundingClientRect(),qe=Ze.top,pn=Ze.height,te=(Te==="rtl"?-1:1)*(((qt==null?void 0:qt.x)||0)-ye),Xt=(te-12)/It,Qe=ie.filter(function(Pt){var Nt;return(Nt=ge[Pt])===null||Nt===void 0||(Nt=Nt.children)===null||Nt===void 0?void 0:Nt.length}),On=(0,Dt.Z)(ge,At.eventKey);if(Ye<qe+pn/2){var En=Gt.findIndex(function(Pt){return Pt.key===On.key}),Ie=En<=0?0:En-1,on=Gt[Ie].key;On=(0,Dt.Z)(ge,on)}var cn=On.key,Vn=On,Me=On.key,he=0,Ce=0;if(!Qe.includes(cn))for(var Yn=0;Yn<Xt&&Le(On);Yn+=1)On=On.parent,Ce+=1;var Si=Et.data,Rt=On.node,Ft=!0;return Bt(On)&&On.level===0&&Ye<qe+pn/2&&Ut({dragNode:Si,dropNode:Rt,dropPosition:-1})&&On.key===At.eventKey?he=-1:(Vn.children||[]).length&&Qe.includes(Me)?Ut({dragNode:Si,dropNode:Rt,dropPosition:0})?he=0:Ft=!1:Ce===0?Xt>-1.5?Ut({dragNode:Si,dropNode:Rt,dropPosition:1})?he=1:Ft=!1:Ut({dragNode:Si,dropNode:Rt,dropPosition:0})?he=0:Ut({dragNode:Si,dropNode:Rt,dropPosition:1})?he=1:Ft=!1:Ut({dragNode:Si,dropNode:Rt,dropPosition:1})?he=1:Ft=!1,{dropPosition:he,dropLevelOffset:Ce,dropTargetKey:On.key,dropTargetPos:On.pos,dragOverNodeKey:Me,dropContainerKey:he===0?null:((ve=On.parent)===null||ve===void 0?void 0:ve.key)||null,dropAllowed:Ft}}function et(St,Et){if(St){var At=Et.multiple;return At?St.slice():St.length?[St[0]]:St}}var ht=function(Et){return Et};function st(St,Et){if(!St)return[];var At=Et||{},It=At.processProps,qt=It===void 0?ht:It,Ut=Array.isArray(St)?St:[St];return Ut.map(function(Gt){var ge=Gt.children,ie=_objectWithoutProperties(Gt,pe),Te=st(ge,Et);return React.createElement(TreeNode,_extends({key:ie.key},qt(ie)),Te)})}function pt(St){if(!St)return null;var Et;if(Array.isArray(St))Et={checkedKeys:St,halfCheckedKeys:void 0};else if((0,Kt.Z)(St)==="object")Et={checkedKeys:St.checked||void 0,halfCheckedKeys:St.halfChecked||void 0};else return(0,le.ZP)(!1,"`checkedKeys` is not an array or an object"),null;return Et}function vt(St,Et){var At=new Set;function It(qt){if(!At.has(qt)){var Ut=(0,Dt.Z)(Et,qt);if(Ut){At.add(qt);var Gt=Ut.parent,ge=Ut.node;ge.disabled||Gt&&It(Gt.key)}}}return(St||[]).forEach(function(qt){It(qt)}),(0,ft.Z)(At)}},34643:function(Mn,Rn,kt){"use strict";kt.d(Rn,{S:function(){return ee}});var ft=kt(48736),Kt=kt(65065);function le(pe,Jt){var jt=new Set;return pe.forEach(function(De){Jt.has(De)||jt.add(De)}),jt}function we(pe){var Jt=pe||{},jt=Jt.disabled,De=Jt.disableCheckbox,ae=Jt.checkable;return!!(jt||De)||ae===!1}function ue(pe,Jt,jt,De){for(var ae=new Set(pe),Le=new Set,Bt=0;Bt<=jt;Bt+=1){var nt=Jt.get(Bt)||new Set;nt.forEach(function(pt){var vt=pt.key,St=pt.node,Et=pt.children,At=Et===void 0?[]:Et;ae.has(vt)&&!De(St)&&At.filter(function(It){return!De(It.node)}).forEach(function(It){ae.add(It.key)})})}for(var et=new Set,ht=jt;ht>=0;ht-=1){var st=Jt.get(ht)||new Set;st.forEach(function(pt){var vt=pt.parent,St=pt.node;if(!(De(St)||!pt.parent||et.has(pt.parent.key))){if(De(pt.parent.node)){et.add(vt.key);return}var Et=!0,At=!1;(vt.children||[]).filter(function(It){return!De(It.node)}).forEach(function(It){var qt=It.key,Ut=ae.has(qt);Et&&!Ut&&(Et=!1),!At&&(Ut||Le.has(qt))&&(At=!0)}),Et&&ae.add(vt.key),At&&Le.add(vt.key),et.add(vt.key)}})}return{checkedKeys:Array.from(ae),halfCheckedKeys:Array.from(le(Le,ae))}}function Dt(pe,Jt,jt,De,ae){for(var Le=new Set(pe),Bt=new Set(Jt),nt=0;nt<=De;nt+=1){var et=jt.get(nt)||new Set;et.forEach(function(vt){var St=vt.key,Et=vt.node,At=vt.children,It=At===void 0?[]:At;!Le.has(St)&&!Bt.has(St)&&!ae(Et)&&It.filter(function(qt){return!ae(qt.node)}).forEach(function(qt){Le.delete(qt.key)})})}Bt=new Set;for(var ht=new Set,st=De;st>=0;st-=1){var pt=jt.get(st)||new Set;pt.forEach(function(vt){var St=vt.parent,Et=vt.node;if(!(ae(Et)||!vt.parent||ht.has(vt.parent.key))){if(ae(vt.parent.node)){ht.add(St.key);return}var At=!0,It=!1;(St.children||[]).filter(function(qt){return!ae(qt.node)}).forEach(function(qt){var Ut=qt.key,Gt=Le.has(Ut);At&&!Gt&&(At=!1),!It&&(Gt||Bt.has(Ut))&&(It=!0)}),At||Le.delete(St.key),It&&Bt.add(St.key),ht.add(St.key)}})}return{checkedKeys:Array.from(Le),halfCheckedKeys:Array.from(le(Bt,Le))}}function ee(pe,Jt,jt,De){var ae=[],Le;De?Le=De:Le=we;var Bt=new Set(pe.filter(function(st){var pt=!!(0,Kt.Z)(jt,st);return pt||ae.push(st),pt})),nt=new Map,et=0;Object.keys(jt).forEach(function(st){var pt=jt[st],vt=pt.level,St=nt.get(vt);St||(St=new Set,nt.set(vt,St)),St.add(pt),et=Math.max(et,vt)}),(0,ft.ZP)(!ae.length,"Tree missing follow keys: ".concat(ae.slice(0,100).map(function(st){return"'".concat(st,"'")}).join(", ")));var ht;return Jt===!0?ht=ue(Bt,nt,et,Le):ht=Dt(Bt,Jt.halfCheckedKeys,nt,et,Le),ht}},65065:function(Mn,Rn,kt){"use strict";kt.d(Rn,{Z:function(){return ft}});function ft(Kt,le){return Kt[le]}},34061:function(Mn,Rn,kt){"use strict";kt.d(Rn,{F:function(){return vt},H8:function(){return pt},I8:function(){return st},km:function(){return ae},oH:function(){return et},w$:function(){return Le},zn:function(){return nt}});var ft=kt(93664),Kt=kt(95190),le=kt(20439),we=kt(62646),ue=kt(11592),Dt=kt(2738),ee=kt(48736),pe=kt(65065),Jt=["children"];function jt(St,Et){return"".concat(St,"-").concat(Et)}function De(St){return St&&St.type&&St.type.isTreeNode}function ae(St,Et){return St!=null?St:Et}function Le(St){var Et=St||{},At=Et.title,It=Et._title,qt=Et.key,Ut=Et.children,Gt=At||"title";return{title:Gt,_title:It||[Gt],key:qt||"key",children:Ut||"children"}}function Bt(St,Et){var At=new Map;function It(qt){var Ut=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";(qt||[]).forEach(function(Gt){var ge=Gt[Et.key],ie=Gt[Et.children];warning(ge!=null,"Tree node must have a certain key: [".concat(Ut).concat(ge,"]"));var Te=String(ge);warning(!At.has(Te)||ge===null||ge===void 0,"Same 'key' exist in the Tree: ".concat(Te)),At.set(Te,!0),It(ie,"".concat(Ut).concat(Te," > "))})}It(St)}function nt(St){function Et(At){var It=(0,ue.Z)(At);return It.map(function(qt){if(!De(qt))return(0,ee.ZP)(!qt,"Tree/TreeNode can only accept TreeNode as children."),null;var Ut=qt.key,Gt=qt.props,ge=Gt.children,ie=(0,we.Z)(Gt,Jt),Te=(0,le.Z)({key:Ut},ie),ve=Et(ge);return ve.length&&(Te.children=ve),Te}).filter(function(qt){return qt})}return Et(St)}function et(St,Et,At){var It=Le(At),qt=It._title,Ut=It.key,Gt=It.children,ge=new Set(Et===!0?[]:Et),ie=[];function Te(ve){var ye=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return ve.map(function(Ye,Ze){for(var qe=jt(ye?ye.pos:"0",Ze),pn=ae(Ye[Ut],qe),te,Xt=0;Xt<qt.length;Xt+=1){var Qe=qt[Xt];if(Ye[Qe]!==void 0){te=Ye[Qe];break}}var On=Object.assign((0,Dt.Z)(Ye,[].concat((0,Kt.Z)(qt),[Ut,Gt])),{title:te,key:pn,parent:ye,pos:qe,children:null,data:Ye,isStart:[].concat((0,Kt.Z)(ye?ye.isStart:[]),[Ze===0]),isEnd:[].concat((0,Kt.Z)(ye?ye.isEnd:[]),[Ze===ve.length-1])});return ie.push(On),Et===!0||ge.has(pn)?On.children=Te(Ye[Gt]||[],On):On.children=[],On})}return Te(St),ie}function ht(St,Et,At){var It={};(0,ft.Z)(At)==="object"?It=At:It={externalGetKey:At},It=It||{};var qt=It,Ut=qt.childrenPropName,Gt=qt.externalGetKey,ge=qt.fieldNames,ie=Le(ge),Te=ie.key,ve=ie.children,ye=Ut||ve,Ye;Gt?typeof Gt=="string"?Ye=function(pn){return pn[Gt]}:typeof Gt=="function"&&(Ye=function(pn){return Gt(pn)}):Ye=function(pn,te){return ae(pn[Te],te)};function Ze(qe,pn,te,Xt){var Qe=qe?qe[ye]:St,On=qe?jt(te.pos,pn):"0",En=qe?[].concat((0,Kt.Z)(Xt),[qe]):[];if(qe){var Ie=Ye(qe,On),on={node:qe,index:pn,pos:On,key:Ie,parentPos:te.node?te.pos:null,level:te.level+1,nodes:En};Et(on)}Qe&&Qe.forEach(function(cn,Vn){Ze(cn,Vn,{node:qe,pos:On,level:te?te.level+1:-1},En)})}Ze(null)}function st(St){var Et=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},At=Et.initWrapper,It=Et.processEntity,qt=Et.onProcessFinished,Ut=Et.externalGetKey,Gt=Et.childrenPropName,ge=Et.fieldNames,ie=arguments.length>2?arguments[2]:void 0,Te=Ut||ie,ve={},ye={},Ye={posEntities:ve,keyEntities:ye};return At&&(Ye=At(Ye)||Ye),ht(St,function(Ze){var qe=Ze.node,pn=Ze.index,te=Ze.pos,Xt=Ze.key,Qe=Ze.parentPos,On=Ze.level,En=Ze.nodes,Ie={node:qe,nodes:En,index:pn,key:Xt,pos:te,level:On},on=ae(Xt,te);ve[te]=Ie,ye[on]=Ie,Ie.parent=ve[Qe],Ie.parent&&(Ie.parent.children=Ie.parent.children||[],Ie.parent.children.push(Ie)),It&&It(Ie,Ye)},{externalGetKey:Te,childrenPropName:Gt,fieldNames:ge}),qt&&qt(Ye),Ye}function pt(St,Et){var At=Et.expandedKeys,It=Et.selectedKeys,qt=Et.loadedKeys,Ut=Et.loadingKeys,Gt=Et.checkedKeys,ge=Et.halfCheckedKeys,ie=Et.dragOverNodeKey,Te=Et.dropPosition,ve=Et.keyEntities,ye=(0,pe.Z)(ve,St),Ye={eventKey:St,expanded:At.indexOf(St)!==-1,selected:It.indexOf(St)!==-1,loaded:qt.indexOf(St)!==-1,loading:Ut.indexOf(St)!==-1,checked:Gt.indexOf(St)!==-1,halfChecked:ge.indexOf(St)!==-1,pos:String(ye?ye.pos:""),dragOver:ie===St&&Te===0,dragOverGapTop:ie===St&&Te===-1,dragOverGapBottom:ie===St&&Te===1};return Ye}function vt(St){var Et=St.data,At=St.expanded,It=St.selected,qt=St.checked,Ut=St.loaded,Gt=St.loading,ge=St.halfChecked,ie=St.dragOver,Te=St.dragOverGapTop,ve=St.dragOverGapBottom,ye=St.pos,Ye=St.active,Ze=St.eventKey,qe=(0,le.Z)((0,le.Z)({},Et),{},{expanded:At,selected:It,checked:qt,loaded:Ut,loading:Gt,halfChecked:ge,dragOver:ie,dragOverGapTop:Te,dragOverGapBottom:ve,pos:ye,active:Ye,key:Ze});return"props"in qe||Object.defineProperty(qe,"props",{get:function(){return(0,ee.ZP)(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),St}}),qe}},8224:function(Mn,Rn,kt){"use strict";kt.d(Rn,{Z:function(){return Kt}});var ft=kt(4676);function Kt(le,we,ue,Dt){var ee=ft.unstable_batchedUpdates?function(Jt){ft.unstable_batchedUpdates(ue,Jt)}:ue;return le!=null&&le.addEventListener&&le.addEventListener(we,ee,Dt),{remove:function(){le!=null&&le.removeEventListener&&le.removeEventListener(we,ee,Dt)}}}},24514:function(Mn,Rn,kt){"use strict";kt.d(Rn,{G:function(){return we}});var ft=kt(47273),Kt=function(Dt){if((0,ft.Z)()&&window.document.documentElement){var ee=Array.isArray(Dt)?Dt:[Dt],pe=window.document.documentElement;return ee.some(function(Jt){return Jt in pe.style})}return!1},le=function(Dt,ee){if(!Kt(Dt))return!1;var pe=document.createElement("div"),Jt=pe.style[Dt];return pe.style[Dt]=ee,pe.style[Dt]!==Jt};function we(ue,Dt){return!Array.isArray(ue)&&Dt!==void 0?le(ue,Dt):Kt(ue)}},6790:function(Mn,Rn,kt){"use strict";kt.d(Rn,{Z:function(){return Si}});var ft=kt(14809),Kt=kt(93664),le=kt(20439),we=kt(4635),ue=kt(50298),Dt=kt(62646),ee=kt(92310),pe=kt.n(ee),Jt=kt(29301),jt=kt(70425),De=kt(34280),ae=kt(59301),Le=kt(4676),Bt=ae.forwardRef(function(Rt,Ft){var Pt=Rt.height,Nt=Rt.offsetY,zt=Rt.offsetX,Mt=Rt.children,Yt=Rt.prefixCls,He=Rt.onInnerResize,_e=Rt.innerProps,Xe=Rt.rtl,xe=Rt.extra,Pe={},ke={display:"flex",flexDirection:"column"};return Nt!==void 0&&(Pe={height:Pt,position:"relative",overflow:"hidden"},ke=(0,le.Z)((0,le.Z)({},ke),{},(0,we.Z)((0,we.Z)((0,we.Z)((0,we.Z)((0,we.Z)({transform:"translateY(".concat(Nt,"px)")},Xe?"marginRight":"marginLeft",-zt),"position","absolute"),"left",0),"right",0),"top",0))),ae.createElement("div",{style:Pe},ae.createElement(Jt.Z,{onResize:function(tn){var dn=tn.offsetHeight;dn&&He&&He()}},ae.createElement("div",(0,ft.Z)({style:ke,className:pe()((0,we.Z)({},"".concat(Yt,"-holder-inner"),Yt)),ref:Ft},_e),Mt,xe)))});Bt.displayName="Filler";var nt=Bt;function et(Rt){var Ft=Rt.children,Pt=Rt.setRef,Nt=ae.useCallback(function(zt){Pt(zt)},[]);return ae.cloneElement(Ft,{ref:Nt})}function ht(Rt,Ft,Pt,Nt,zt,Mt,Yt,He){var _e=He.getKey;return Rt.slice(Ft,Pt+1).map(function(Xe,xe){var Pe=Ft+xe,ke=Yt(Xe,Pe,{style:{width:Nt},offsetX:zt}),Ve=_e(Xe);return ae.createElement(et,{key:Ve,setRef:function(dn){return Mt(Xe,dn)}},ke)})}function st(Rt,Ft,Pt,Nt){var zt=Pt-Rt,Mt=Ft-Pt,Yt=Math.min(zt,Mt)*2;if(Nt<=Yt){var He=Math.floor(Nt/2);return Nt%2?Pt+He+1:Pt-He}return zt>Mt?Pt-(Nt-Mt):Pt+(Nt-zt)}function pt(Rt,Ft,Pt){var Nt=Rt.length,zt=Ft.length,Mt,Yt;if(Nt===0&&zt===0)return null;Nt<zt?(Mt=Rt,Yt=Ft):(Mt=Ft,Yt=Rt);var He={__EMPTY_ITEM__:!0};function _e(tn){return tn!==void 0?Pt(tn):He}for(var Xe=null,xe=Math.abs(Nt-zt)!==1,Pe=0;Pe<Yt.length;Pe+=1){var ke=_e(Mt[Pe]),Ve=_e(Yt[Pe]);if(ke!==Ve){Xe=Pe,xe=xe||ke!==_e(Yt[Pe+1]);break}}return Xe===null?null:{index:Xe,multiple:xe}}function vt(Rt,Ft,Pt){var Nt=ae.useState(Rt),zt=(0,ue.Z)(Nt,2),Mt=zt[0],Yt=zt[1],He=ae.useState(null),_e=(0,ue.Z)(He,2),Xe=_e[0],xe=_e[1];return ae.useEffect(function(){var Pe=pt(Mt||[],Rt||[],Ft);(Pe==null?void 0:Pe.index)!==void 0&&(Pt==null||Pt(Pe.index),xe(Rt[Pe.index])),Yt(Rt)},[Rt]),[Xe]}var St=kt(16089),Et=(typeof navigator=="undefined"?"undefined":(0,Kt.Z)(navigator))==="object"&&/Firefox/i.test(navigator.userAgent),At=Et,It=function(Rt,Ft,Pt,Nt){var zt=(0,ae.useRef)(!1),Mt=(0,ae.useRef)(null);function Yt(){clearTimeout(Mt.current),zt.current=!0,Mt.current=setTimeout(function(){zt.current=!1},50)}var He=(0,ae.useRef)({top:Rt,bottom:Ft,left:Pt,right:Nt});return He.current.top=Rt,He.current.bottom=Ft,He.current.left=Pt,He.current.right=Nt,function(_e,Xe){var xe=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,Pe=_e?Xe<0&&He.current.left||Xe>0&&He.current.right:Xe<0&&He.current.top||Xe>0&&He.current.bottom;return xe&&Pe?(clearTimeout(Mt.current),zt.current=!1):(!Pe||zt.current)&&Yt(),!zt.current&&Pe}};function qt(Rt,Ft,Pt,Nt,zt,Mt,Yt){var He=(0,ae.useRef)(0),_e=(0,ae.useRef)(null),Xe=(0,ae.useRef)(null),xe=(0,ae.useRef)(!1),Pe=It(Ft,Pt,Nt,zt);function ke(Ge,Ke){if(St.Z.cancel(_e.current),!Pe(!1,Ke)){var nn=Ge;if(!nn._virtualHandled)nn._virtualHandled=!0;else return;He.current+=Ke,Xe.current=Ke,At||nn.preventDefault(),_e.current=(0,St.Z)(function(){var Qn=xe.current?10:1;Yt(He.current*Qn,!1),He.current=0})}}function Ve(Ge,Ke){Yt(Ke,!0),At||Ge.preventDefault()}var tn=(0,ae.useRef)(null),dn=(0,ae.useRef)(null);function fn(Ge){if(Rt){St.Z.cancel(dn.current),dn.current=(0,St.Z)(function(){tn.current=null},2);var Ke=Ge.deltaX,nn=Ge.deltaY,Qn=Ge.shiftKey,gn=Ke,an=nn;(tn.current==="sx"||!tn.current&&Qn&&nn&&!Ke)&&(gn=nn,an=0,tn.current="sx");var zn=Math.abs(gn),gi=Math.abs(an);tn.current===null&&(tn.current=Mt&&zn>gi?"x":"y"),tn.current==="y"?ke(Ge,an):Ve(Ge,gn)}}function ni(Ge){Rt&&(xe.current=Ge.detail===Xe.current)}return[fn,ni]}function Ut(Rt,Ft,Pt,Nt){var zt=ae.useMemo(function(){return[new Map,[]]},[Rt,Pt.id,Nt]),Mt=(0,ue.Z)(zt,2),Yt=Mt[0],He=Mt[1],_e=function(xe){var Pe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:xe,ke=Yt.get(xe),Ve=Yt.get(Pe);if(ke===void 0||Ve===void 0)for(var tn=Rt.length,dn=He.length;dn<tn;dn+=1){var fn,ni=Rt[dn],Ge=Ft(ni);Yt.set(Ge,dn);var Ke=(fn=Pt.get(Ge))!==null&&fn!==void 0?fn:Nt;if(He[dn]=(He[dn-1]||0)+Ke,Ge===xe&&(ke=dn),Ge===Pe&&(Ve=dn),ke!==void 0&&Ve!==void 0)break}return{top:He[ke-1]||0,bottom:He[Ve]}};return _e}var Gt=kt(99153),ge=kt(84851),ie=function(){function Rt(){(0,Gt.Z)(this,Rt),(0,we.Z)(this,"maps",void 0),(0,we.Z)(this,"id",0),(0,we.Z)(this,"diffRecords",new Map),this.maps=Object.create(null)}return(0,ge.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}(),Te=ie;function ve(Rt){var Ft=parseFloat(Rt);return isNaN(Ft)?0:Ft}function ye(Rt,Ft,Pt){var Nt=ae.useState(0),zt=(0,ue.Z)(Nt,2),Mt=zt[0],Yt=zt[1],He=(0,ae.useRef)(new Map),_e=(0,ae.useRef)(new Te),Xe=(0,ae.useRef)(0);function xe(){Xe.current+=1}function Pe(){var Ve=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;xe();var tn=function(){var ni=!1;He.current.forEach(function(Ge,Ke){if(Ge&&Ge.offsetParent){var nn=Ge.offsetHeight,Qn=getComputedStyle(Ge),gn=Qn.marginTop,an=Qn.marginBottom,zn=ve(gn),gi=ve(an),ti=nn+zn+gi;_e.current.get(Ke)!==ti&&(_e.current.set(Ke,ti),ni=!0)}}),ni&&Yt(function(Ge){return Ge+1})};if(Ve)tn();else{Xe.current+=1;var dn=Xe.current;Promise.resolve().then(function(){dn===Xe.current&&tn()})}}function ke(Ve,tn){var dn=Rt(Ve),fn=He.current.get(dn);tn?(He.current.set(dn,tn),Pe()):He.current.delete(dn),!fn!=!tn&&(tn?Ft==null||Ft(Ve):Pt==null||Pt(Ve))}return(0,ae.useEffect)(function(){return xe},[]),[ke,Pe,_e.current,Mt]}var Ye=14/15;function Ze(Rt,Ft,Pt){var Nt=(0,ae.useRef)(!1),zt=(0,ae.useRef)(0),Mt=(0,ae.useRef)(0),Yt=(0,ae.useRef)(null),He=(0,ae.useRef)(null),_e,Xe=function(Ve){if(Nt.current){var tn=Math.ceil(Ve.touches[0].pageX),dn=Math.ceil(Ve.touches[0].pageY),fn=zt.current-tn,ni=Mt.current-dn,Ge=Math.abs(fn)>Math.abs(ni);Ge?zt.current=tn:Mt.current=dn;var Ke=Pt(Ge,Ge?fn:ni,!1,Ve);Ke&&Ve.preventDefault(),clearInterval(He.current),Ke&&(He.current=setInterval(function(){Ge?fn*=Ye:ni*=Ye;var nn=Math.floor(Ge?fn:ni);(!Pt(Ge,nn,!0)||Math.abs(nn)<=.1)&&clearInterval(He.current)},16))}},xe=function(){Nt.current=!1,_e()},Pe=function(Ve){_e(),Ve.touches.length===1&&!Nt.current&&(Nt.current=!0,zt.current=Math.ceil(Ve.touches[0].pageX),Mt.current=Math.ceil(Ve.touches[0].pageY),Yt.current=Ve.target,Yt.current.addEventListener("touchmove",Xe,{passive:!1}),Yt.current.addEventListener("touchend",xe,{passive:!0}))};_e=function(){Yt.current&&(Yt.current.removeEventListener("touchmove",Xe),Yt.current.removeEventListener("touchend",xe))},(0,De.Z)(function(){return Rt&&Ft.current.addEventListener("touchstart",Pe,{passive:!0}),function(){var ke;(ke=Ft.current)===null||ke===void 0||ke.removeEventListener("touchstart",Pe),_e(),clearInterval(He.current)}},[Rt])}function qe(Rt){return Math.floor(Math.pow(Rt,.5))}function pn(Rt,Ft){var Pt="touches"in Rt?Rt.touches[0]:Rt;return Pt[Ft?"pageX":"pageY"]-window[Ft?"scrollX":"scrollY"]}function te(Rt,Ft,Pt){ae.useEffect(function(){var Nt=Ft.current;if(Rt&&Nt){var zt=!1,Mt,Yt,He=function(){St.Z.cancel(Mt)},_e=function ke(){He(),Mt=(0,St.Z)(function(){Pt(Yt),ke()})},Xe=function(Ve){if(!(Ve.target.draggable||Ve.button!==0)){var tn=Ve;tn._virtualHandled||(tn._virtualHandled=!0,zt=!0)}},xe=function(){zt=!1,He()},Pe=function(Ve){if(zt){var tn=pn(Ve,!1),dn=Nt.getBoundingClientRect(),fn=dn.top,ni=dn.bottom;if(tn<=fn){var Ge=fn-tn;Yt=-qe(Ge),_e()}else if(tn>=ni){var Ke=tn-ni;Yt=qe(Ke),_e()}else He()}};return Nt.addEventListener("mousedown",Xe),Nt.ownerDocument.addEventListener("mouseup",xe),Nt.ownerDocument.addEventListener("mousemove",Pe),function(){Nt.removeEventListener("mousedown",Xe),Nt.ownerDocument.removeEventListener("mouseup",xe),Nt.ownerDocument.removeEventListener("mousemove",Pe),He()}}},[Rt])}var Xt=10;function Qe(Rt,Ft,Pt,Nt,zt,Mt,Yt,He){var _e=ae.useRef(),Xe=ae.useState(null),xe=(0,ue.Z)(Xe,2),Pe=xe[0],ke=xe[1];return(0,De.Z)(function(){if(Pe&&Pe.times<Xt){if(!Rt.current){ke(function(Zi){return(0,le.Z)({},Zi)});return}Mt();var Ve=Pe.targetAlign,tn=Pe.originAlign,dn=Pe.index,fn=Pe.offset,ni=Rt.current.clientHeight,Ge=!1,Ke=Ve,nn=null;if(ni){for(var Qn=Ve||tn,gn=0,an=0,zn=0,gi=Math.min(Ft.length-1,dn),ti=0;ti<=gi;ti+=1){var wi=zt(Ft[ti]);an=gn;var Wi=Pt.get(wi);zn=an+(Wi===void 0?Nt:Wi),gn=zn}for(var Cn=Qn==="top"?fn:ni-fn,Pn=gi;Pn>=0;Pn-=1){var Bn=zt(Ft[Pn]),si=Pt.get(Bn);if(si===void 0){Ge=!0;break}if(Cn-=si,Cn<=0)break}switch(Qn){case"top":nn=an-fn;break;case"bottom":nn=zn-ni+fn;break;default:{var Ei=Rt.current.scrollTop,ci=Ei+ni;an<Ei?Ke="top":zn>ci&&(Ke="bottom")}}nn!==null&&Yt(nn),nn!==Pe.lastTop&&(Ge=!0)}Ge&&ke((0,le.Z)((0,le.Z)({},Pe),{},{times:Pe.times+1,targetAlign:Ke,lastTop:nn}))}},[Pe,Rt.current]),function(Ve){if(Ve==null){He();return}if(St.Z.cancel(_e.current),typeof Ve=="number")Yt(Ve);else if(Ve&&(0,Kt.Z)(Ve)==="object"){var tn,dn=Ve.align;"index"in Ve?tn=Ve.index:tn=Ft.findIndex(function(Ge){return zt(Ge)===Ve.key});var fn=Ve.offset,ni=fn===void 0?0:fn;ke({times:0,index:tn,offset:ni,originAlign:dn})}}}var On=ae.forwardRef(function(Rt,Ft){var Pt=Rt.prefixCls,Nt=Rt.rtl,zt=Rt.scrollOffset,Mt=Rt.scrollRange,Yt=Rt.onStartMove,He=Rt.onStopMove,_e=Rt.onScroll,Xe=Rt.horizontal,xe=Rt.spinSize,Pe=Rt.containerSize,ke=Rt.style,Ve=Rt.thumbStyle,tn=Rt.showScrollBar,dn=ae.useState(!1),fn=(0,ue.Z)(dn,2),ni=fn[0],Ge=fn[1],Ke=ae.useState(null),nn=(0,ue.Z)(Ke,2),Qn=nn[0],gn=nn[1],an=ae.useState(null),zn=(0,ue.Z)(an,2),gi=zn[0],ti=zn[1],wi=!Nt,Wi=ae.useRef(),Cn=ae.useRef(),Pn=ae.useState(tn),Bn=(0,ue.Z)(Pn,2),si=Bn[0],Ei=Bn[1],ci=ae.useRef(),Zi=function(){tn===!0||tn===!1||(clearTimeout(ci.current),Ei(!0),ci.current=setTimeout(function(){Ei(!1)},3e3))},wt=Mt-Pe||0,Je=Pe-xe||0,Hn=ae.useMemo(function(){if(zt===0||wt===0)return 0;var Ue=zt/wt;return Ue*Je},[zt,wt,Je]),Ln=function(xi){xi.stopPropagation(),xi.preventDefault()},jn=ae.useRef({top:Hn,dragging:ni,pageY:Qn,startTop:gi});jn.current={top:Hn,dragging:ni,pageY:Qn,startTop:gi};var li=function(xi){Ge(!0),gn(pn(xi,Xe)),ti(jn.current.top),Yt(),xi.stopPropagation(),xi.preventDefault()};ae.useEffect(function(){var Ue=function($e){$e.preventDefault()},xi=Wi.current,Kn=Cn.current;return xi.addEventListener("touchstart",Ue,{passive:!1}),Kn.addEventListener("touchstart",li,{passive:!1}),function(){xi.removeEventListener("touchstart",Ue),Kn.removeEventListener("touchstart",li)}},[]);var Ci=ae.useRef();Ci.current=wt;var Yi=ae.useRef();Yi.current=Je,ae.useEffect(function(){if(ni){var Ue,xi=function($e){var Gn=jn.current,Ai=Gn.dragging,ji=Gn.pageY,Tn=Gn.startTop;St.Z.cancel(Ue);var Qt=Wi.current.getBoundingClientRect(),me=Pe/(Xe?Qt.width:Qt.height);if(Ai){var bn=(pn($e,Xe)-ji)*me,_n=Tn;!wi&&Xe?_n-=bn:_n+=bn;var ze=Ci.current,hn=Yi.current,Nn=hn?_n/hn:0,In=Math.ceil(Nn*ze);In=Math.max(In,0),In=Math.min(In,ze),Ue=(0,St.Z)(function(){_e(In,Xe)})}},Kn=function(){Ge(!1),He()};return window.addEventListener("mousemove",xi,{passive:!0}),window.addEventListener("touchmove",xi,{passive:!0}),window.addEventListener("mouseup",Kn,{passive:!0}),window.addEventListener("touchend",Kn,{passive:!0}),function(){window.removeEventListener("mousemove",xi),window.removeEventListener("touchmove",xi),window.removeEventListener("mouseup",Kn),window.removeEventListener("touchend",Kn),St.Z.cancel(Ue)}}},[ni]),ae.useEffect(function(){return Zi(),function(){clearTimeout(ci.current)}},[zt]),ae.useImperativeHandle(Ft,function(){return{delayHidden:Zi}});var Be="".concat(Pt,"-scrollbar"),Se={position:"absolute",visibility:si?null:"hidden"},Ee={position:"absolute",borderRadius:99,background:"var(--rc-virtual-list-scrollbar-bg, rgba(0, 0, 0, 0.5))",cursor:"pointer",userSelect:"none"};return Xe?(Object.assign(Se,{height:8,left:0,right:0,bottom:0}),Object.assign(Ee,(0,we.Z)({height:"100%",width:xe},wi?"left":"right",Hn))):(Object.assign(Se,(0,we.Z)({width:8,top:0,bottom:0},wi?"right":"left",0)),Object.assign(Ee,{width:"100%",height:xe,top:Hn})),ae.createElement("div",{ref:Wi,className:pe()(Be,(0,we.Z)((0,we.Z)((0,we.Z)({},"".concat(Be,"-horizontal"),Xe),"".concat(Be,"-vertical"),!Xe),"".concat(Be,"-visible"),si)),style:(0,le.Z)((0,le.Z)({},Se),ke),onMouseDown:Ln,onMouseMove:Zi},ae.createElement("div",{ref:Cn,className:pe()("".concat(Be,"-thumb"),(0,we.Z)({},"".concat(Be,"-thumb-moving"),ni)),style:(0,le.Z)((0,le.Z)({},Ee),Ve),onMouseDown:li}))}),En=On,Ie=20;function on(){var Rt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,Ft=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,Pt=Rt/Ft*Rt;return isNaN(Pt)&&(Pt=0),Pt=Math.max(Pt,Ie),Math.floor(Pt)}var cn=["prefixCls","className","height","itemHeight","fullHeight","style","data","children","itemKey","virtual","direction","scrollWidth","component","onScroll","onVirtualScroll","onVisibleChange","innerProps","extraRender","styles","showScrollBar"],Vn=[],Me={overflowY:"auto",overflowAnchor:"none"};function he(Rt,Ft){var Pt=Rt.prefixCls,Nt=Pt===void 0?"rc-virtual-list":Pt,zt=Rt.className,Mt=Rt.height,Yt=Rt.itemHeight,He=Rt.fullHeight,_e=He===void 0?!0:He,Xe=Rt.style,xe=Rt.data,Pe=Rt.children,ke=Rt.itemKey,Ve=Rt.virtual,tn=Rt.direction,dn=Rt.scrollWidth,fn=Rt.component,ni=fn===void 0?"div":fn,Ge=Rt.onScroll,Ke=Rt.onVirtualScroll,nn=Rt.onVisibleChange,Qn=Rt.innerProps,gn=Rt.extraRender,an=Rt.styles,zn=Rt.showScrollBar,gi=zn===void 0?"optional":zn,ti=(0,Dt.Z)(Rt,cn),wi=ae.useCallback(function(yn){return typeof ke=="function"?ke(yn):yn==null?void 0:yn[ke]},[ke]),Wi=ye(wi,null,null),Cn=(0,ue.Z)(Wi,4),Pn=Cn[0],Bn=Cn[1],si=Cn[2],Ei=Cn[3],ci=!!(Ve!==!1&&Mt&&Yt),Zi=ae.useMemo(function(){return Object.values(si.maps).reduce(function(yn,Un){return yn+Un},0)},[si.id,si.maps]),wt=ci&&xe&&(Math.max(Yt*xe.length,Zi)>Mt||!!dn),Je=tn==="rtl",Hn=pe()(Nt,(0,we.Z)({},"".concat(Nt,"-rtl"),Je),zt),Ln=xe||Vn,jn=(0,ae.useRef)(),li=(0,ae.useRef)(),Ci=(0,ae.useRef)(),Yi=(0,ae.useState)(0),Be=(0,ue.Z)(Yi,2),Se=Be[0],Ee=Be[1],Ue=(0,ae.useState)(0),xi=(0,ue.Z)(Ue,2),Kn=xi[0],Pi=xi[1],$e=(0,ae.useState)(!1),Gn=(0,ue.Z)($e,2),Ai=Gn[0],ji=Gn[1],Tn=function(){ji(!0)},Qt=function(){ji(!1)},me={getKey:wi};function bn(yn){Ee(function(Un){var $n;typeof yn=="function"?$n=yn(Un):$n=yn;var An=ur($n);return jn.current.scrollTop=An,An})}var _n=(0,ae.useRef)({start:0,end:Ln.length}),ze=(0,ae.useRef)(),hn=vt(Ln,wi),Nn=(0,ue.Z)(hn,1),In=Nn[0];ze.current=In;var vi=ae.useMemo(function(){if(!ci)return{scrollHeight:void 0,start:0,end:Ln.length-1,offset:void 0};if(!wt){var yn;return{scrollHeight:((yn=li.current)===null||yn===void 0?void 0:yn.offsetHeight)||0,start:0,end:Ln.length-1,offset:void 0}}for(var Un=0,$n,An,Xn,Zn=Ln.length,ai=0;ai<Zn;ai+=1){var pi=Ln[ai],en=wi(pi),Qi=si.get(en),tr=Un+(Qi===void 0?Yt:Qi);tr>=Se&&$n===void 0&&($n=ai,An=Un),tr>Se+Mt&&Xn===void 0&&(Xn=ai),Un=tr}return $n===void 0&&($n=0,An=0,Xn=Math.ceil(Mt/Yt)),Xn===void 0&&(Xn=Ln.length-1),Xn=Math.min(Xn+1,Ln.length-1),{scrollHeight:Un,start:$n,end:Xn,offset:An}},[wt,ci,Se,Ln,Ei,Mt]),Jn=vi.scrollHeight,ii=vi.start,hi=vi.end,Ii=vi.offset;_n.current.start=ii,_n.current.end=hi,ae.useLayoutEffect(function(){var yn=si.getRecord();if(yn.size===1){var Un=Array.from(yn.keys())[0],$n=yn.get(Un),An=Ln[ii];if(An&&$n===void 0){var Xn=wi(An);if(Xn===Un){var Zn=si.get(Un),ai=Zn-Yt;bn(function(pi){return pi+ai})}}}si.resetRecord()},[Jn]);var Di=ae.useState({width:0,height:Mt}),mn=(0,ue.Z)(Di,2),oi=mn[0],fr=mn[1],Mr=function(Un){fr({width:Un.offsetWidth,height:Un.offsetHeight})},Xr=(0,ae.useRef)(),Ae=(0,ae.useRef)(),ri=ae.useMemo(function(){return on(oi.width,dn)},[oi.width,dn]),Ri=ae.useMemo(function(){return on(oi.height,Jn)},[oi.height,Jn]),fi=Jn-Mt,br=(0,ae.useRef)(fi);br.current=fi;function ur(yn){var Un=yn;return Number.isNaN(br.current)||(Un=Math.min(Un,br.current)),Un=Math.max(Un,0),Un}var Lr=Se<=0,Dr=Se>=fi,Zr=Kn<=0,Jr=Kn>=dn,un=It(Lr,Dr,Zr,Jr),yo=function(){return{x:Je?-Kn:Kn,y:Se}},vn=(0,ae.useRef)(yo()),Gi=(0,jt.zX)(function(yn){if(Ke){var Un=(0,le.Z)((0,le.Z)({},yo()),yn);(vn.current.x!==Un.x||vn.current.y!==Un.y)&&(Ke(Un),vn.current=Un)}});function Wr(yn,Un){var $n=yn;Un?((0,Le.flushSync)(function(){Pi($n)}),Gi()):bn($n)}function Oi(yn){var Un=yn.currentTarget.scrollTop;Un!==Se&&bn(Un),Ge==null||Ge(yn),Gi()}var ko=function(Un){var $n=Un,An=dn?dn-oi.width:0;return $n=Math.max($n,0),$n=Math.min($n,An),$n},Ur=(0,jt.zX)(function(yn,Un){Un?((0,Le.flushSync)(function(){Pi(function($n){var An=$n+(Je?-yn:yn);return ko(An)})}),Gi()):bn(function($n){var An=$n+yn;return An})}),Cr=qt(ci,Lr,Dr,Zr,Jr,!!dn,Ur),Lo=(0,ue.Z)(Cr,2),je=Lo[0],xn=Lo[1];Ze(ci,jn,function(yn,Un,$n,An){var Xn=An;return un(yn,Un,$n)?!1:!Xn||!Xn._virtualHandled?(Xn&&(Xn._virtualHandled=!0),je({preventDefault:function(){},deltaX:yn?Un:0,deltaY:yn?0:Un}),!0):!1}),te(wt,jn,function(yn){bn(function(Un){return Un+yn})}),(0,De.Z)(function(){function yn($n){var An=Lr&&$n.detail<0,Xn=Dr&&$n.detail>0;ci&&!An&&!Xn&&$n.preventDefault()}var Un=jn.current;return Un.addEventListener("wheel",je,{passive:!1}),Un.addEventListener("DOMMouseScroll",xn,{passive:!0}),Un.addEventListener("MozMousePixelScroll",yn,{passive:!1}),function(){Un.removeEventListener("wheel",je),Un.removeEventListener("DOMMouseScroll",xn),Un.removeEventListener("MozMousePixelScroll",yn)}},[ci,Lr,Dr]),(0,De.Z)(function(){if(dn){var yn=ko(Kn);Pi(yn),Gi({x:yn})}},[oi.width,dn]);var be=function(){var Un,$n;(Un=Xr.current)===null||Un===void 0||Un.delayHidden(),($n=Ae.current)===null||$n===void 0||$n.delayHidden()},Tt=Qe(jn,Ln,si,Yt,wi,function(){return Bn(!0)},bn,be);ae.useImperativeHandle(Ft,function(){return{nativeElement:Ci.current,getScrollInfo:yo,scrollTo:function(Un){function $n(An){return An&&(0,Kt.Z)(An)==="object"&&("left"in An||"top"in An)}$n(Un)?(Un.left!==void 0&&Pi(ko(Un.left)),Tt(Un.top)):Tt(Un)}}}),(0,De.Z)(function(){if(nn){var yn=Ln.slice(ii,hi+1);nn(yn,Ln)}},[ii,hi,Ln]);var Dn=Ut(Ln,wi,si,Yt),ei=gn==null?void 0:gn({start:ii,end:hi,virtual:wt,offsetX:Kn,offsetY:Ii,rtl:Je,getSize:Dn}),Ni=ht(Ln,ii,hi,dn,Kn,Pn,Pe,me),Li=null;Mt&&(Li=(0,le.Z)((0,we.Z)({},_e?"height":"maxHeight",Mt),Me),ci&&(Li.overflowY="hidden",dn&&(Li.overflowX="hidden"),Ai&&(Li.pointerEvents="none")));var di={};return Je&&(di.dir="rtl"),ae.createElement("div",(0,ft.Z)({ref:Ci,style:(0,le.Z)((0,le.Z)({},Xe),{},{position:"relative"}),className:Hn},di,ti),ae.createElement(Jt.Z,{onResize:Mr},ae.createElement(ni,{className:"".concat(Nt,"-holder"),style:Li,ref:jn,onScroll:Oi,onMouseEnter:be},ae.createElement(nt,{prefixCls:Nt,height:Jn,offsetX:Kn,offsetY:Ii,scrollWidth:dn,onInnerResize:Bn,ref:li,innerProps:Qn,rtl:Je,extra:ei},Ni))),wt&&Jn>Mt&&ae.createElement(En,{ref:Xr,prefixCls:Nt,scrollOffset:Se,scrollRange:Jn,rtl:Je,onScroll:Wr,onStartMove:Tn,onStopMove:Qt,spinSize:Ri,containerSize:oi.height,style:an==null?void 0:an.verticalScrollBar,thumbStyle:an==null?void 0:an.verticalScrollBarThumb,showScrollBar:gi}),wt&&dn>oi.width&&ae.createElement(En,{ref:Ae,prefixCls:Nt,scrollOffset:Kn,scrollRange:dn,rtl:Je,onScroll:Wr,onStartMove:Tn,onStopMove:Qt,spinSize:ri,containerSize:oi.width,horizontal:!0,style:an==null?void 0:an.horizontalScrollBar,thumbStyle:an==null?void 0:an.horizontalScrollBarThumb,showScrollBar:gi}))}var Ce=ae.forwardRef(he);Ce.displayName="List";var Yn=Ce,Si=Yn},32637:function(Mn,Rn,kt){"use strict";Mn.exports=kt.p+"static/AssistantCode3.a8740efb.jpeg"},93314:function(Mn){"use strict";Mn.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(Mn){"use strict";Mn.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(Mn){"use strict";Mn.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(Mn){"use strict";Mn.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(Mn,Rn,kt){"use strict";kt.d(Rn,{Z:function(){return pe}});const ft=Jt=>typeof Jt=="object"&&Jt!=null&&Jt.nodeType===1,Kt=(Jt,jt)=>(!jt||Jt!=="hidden")&&Jt!=="visible"&&Jt!=="clip",le=(Jt,jt)=>{if(Jt.clientHeight<Jt.scrollHeight||Jt.clientWidth<Jt.scrollWidth){const De=getComputedStyle(Jt,null);return Kt(De.overflowY,jt)||Kt(De.overflowX,jt)||(ae=>{const Le=(Bt=>{if(!Bt.ownerDocument||!Bt.ownerDocument.defaultView)return null;try{return Bt.ownerDocument.defaultView.frameElement}catch(nt){return null}})(ae);return!!Le&&(Le.clientHeight<ae.scrollHeight||Le.clientWidth<ae.scrollWidth)})(Jt)}return!1},we=(Jt,jt,De,ae,Le,Bt,nt,et)=>Bt<Jt&&nt>jt||Bt>Jt&&nt<jt?0:Bt<=Jt&&et<=De||nt>=jt&&et>=De?Bt-Jt-ae:nt>jt&&et<De||Bt<Jt&&et>De?nt-jt+Le:0,ue=Jt=>{const jt=Jt.parentElement;return jt==null?Jt.getRootNode().host||null:jt},Dt=(Jt,jt)=>{var De,ae,Le,Bt;if(typeof document=="undefined")return[];const{scrollMode:nt,block:et,inline:ht,boundary:st,skipOverflowHiddenElements:pt}=jt,vt=typeof st=="function"?st:En=>En!==st;if(!ft(Jt))throw new TypeError("Invalid target");const St=document.scrollingElement||document.documentElement,Et=[];let At=Jt;for(;ft(At)&&vt(At);){if(At=ue(At),At===St){Et.push(At);break}At!=null&&At===document.body&&le(At)&&!le(document.documentElement)||At!=null&&le(At,pt)&&Et.push(At)}const It=(ae=(De=window.visualViewport)==null?void 0:De.width)!=null?ae:innerWidth,qt=(Bt=(Le=window.visualViewport)==null?void 0:Le.height)!=null?Bt:innerHeight,{scrollX:Ut,scrollY:Gt}=window,{height:ge,width:ie,top:Te,right:ve,bottom:ye,left:Ye}=Jt.getBoundingClientRect(),{top:Ze,right:qe,bottom:pn,left:te}=(En=>{const Ie=window.getComputedStyle(En);return{top:parseFloat(Ie.scrollMarginTop)||0,right:parseFloat(Ie.scrollMarginRight)||0,bottom:parseFloat(Ie.scrollMarginBottom)||0,left:parseFloat(Ie.scrollMarginLeft)||0}})(Jt);let Xt=et==="start"||et==="nearest"?Te-Ze:et==="end"?ye+pn:Te+ge/2-Ze+pn,Qe=ht==="center"?Ye+ie/2-te+qe:ht==="end"?ve+qe:Ye-te;const On=[];for(let En=0;En<Et.length;En++){const Ie=Et[En],{height:on,width:cn,top:Vn,right:Me,bottom:he,left:Ce}=Ie.getBoundingClientRect();if(nt==="if-needed"&&Te>=0&&Ye>=0&&ye<=qt&&ve<=It&&(Ie===St&&!le(Ie)||Te>=Vn&&ye<=he&&Ye>=Ce&&ve<=Me))return On;const Yn=getComputedStyle(Ie),Si=parseInt(Yn.borderLeftWidth,10),Rt=parseInt(Yn.borderTopWidth,10),Ft=parseInt(Yn.borderRightWidth,10),Pt=parseInt(Yn.borderBottomWidth,10);let Nt=0,zt=0;const Mt="offsetWidth"in Ie?Ie.offsetWidth-Ie.clientWidth-Si-Ft:0,Yt="offsetHeight"in Ie?Ie.offsetHeight-Ie.clientHeight-Rt-Pt:0,He="offsetWidth"in Ie?Ie.offsetWidth===0?0:cn/Ie.offsetWidth:0,_e="offsetHeight"in Ie?Ie.offsetHeight===0?0:on/Ie.offsetHeight:0;if(St===Ie)Nt=et==="start"?Xt:et==="end"?Xt-qt:et==="nearest"?we(Gt,Gt+qt,qt,Rt,Pt,Gt+Xt,Gt+Xt+ge,ge):Xt-qt/2,zt=ht==="start"?Qe:ht==="center"?Qe-It/2:ht==="end"?Qe-It:we(Ut,Ut+It,It,Si,Ft,Ut+Qe,Ut+Qe+ie,ie),Nt=Math.max(0,Nt+Gt),zt=Math.max(0,zt+Ut);else{Nt=et==="start"?Xt-Vn-Rt:et==="end"?Xt-he+Pt+Yt:et==="nearest"?we(Vn,he,on,Rt,Pt+Yt,Xt,Xt+ge,ge):Xt-(Vn+on/2)+Yt/2,zt=ht==="start"?Qe-Ce-Si:ht==="center"?Qe-(Ce+cn/2)+Mt/2:ht==="end"?Qe-Me+Ft+Mt:we(Ce,Me,cn,Si,Ft+Mt,Qe,Qe+ie,ie);const{scrollLeft:Xe,scrollTop:xe}=Ie;Nt=_e===0?0:Math.max(0,Math.min(xe+Nt/_e,Ie.scrollHeight-on/_e+Yt)),zt=He===0?0:Math.max(0,Math.min(Xe+zt/He,Ie.scrollWidth-cn/He+Mt)),Xt+=xe-Nt,Qe+=Xe-zt}On.push({el:Ie,top:Nt,left:zt})}return On},ee=Jt=>Jt===!1?{block:"end",inline:"nearest"}:(jt=>jt===Object(jt)&&Object.keys(jt).length!==0)(Jt)?Jt:{block:"start",inline:"nearest"};function pe(Jt,jt){if(!Jt.isConnected||!(Le=>{let Bt=Le;for(;Bt&&Bt.parentNode;){if(Bt.parentNode===document)return!0;Bt=Bt.parentNode instanceof ShadowRoot?Bt.parentNode.host:Bt.parentNode}return!1})(Jt))return;const De=(Le=>{const Bt=window.getComputedStyle(Le);return{top:parseFloat(Bt.scrollMarginTop)||0,right:parseFloat(Bt.scrollMarginRight)||0,bottom:parseFloat(Bt.scrollMarginBottom)||0,left:parseFloat(Bt.scrollMarginLeft)||0}})(Jt);if((Le=>typeof Le=="object"&&typeof Le.behavior=="function")(jt))return jt.behavior(Dt(Jt,jt));const ae=typeof jt=="boolean"||jt==null?void 0:jt.behavior;for(const{el:Le,top:Bt,left:nt}of Dt(Jt,ee(jt))){const et=Bt-De.top+De.bottom,ht=nt-De.left+De.right;Le.scroll({top:et,left:ht,behavior:ae})}}}}]);
|