@armyc2.c5isr.renderer/mil-sym-ts
Version:
MIL-STD-2525 D/E symbol rendering TypeScript library
1 lines • 7.18 MB
JavaScript
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.C5Ren=t():e.C5Ren=t()}(global,(()=>(()=>{"use strict";var e={92:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SVGInfo=void 0,t.SVGInfo=class{_ID;_Bbox;_SVG;constructor(e,t,i){this._ID=e,this._Bbox=t,this._SVG=i}getID(){return this._ID}getBbox(){return this._Bbox}getSVG(){return this._SVG}toString(){return this._ID+"\n"+this._Bbox.toString()+"\n"+this._SVG}}},106:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.RendererException=void 0;class i extends Error{constructor(e,t){super(e)}}t.RendererException=i},151:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Point=void 0;const o=i(9441);class s{x=0;y=0;constructor(...e){switch(e.length){case 0:this.setLocation(0,0);break;case 2:{const[t,i]=e;this.setLocation(t,i);break}default:throw Error("Invalid number of arguments")}}getX(){return this.x}getY(){return this.y}setLocation(e,t){this.x=Math.trunc(e),this.y=Math.trunc(t)}getShapeType(){return"POINT"}shift(e,t){this.x+=e,this.y+=t}toStringFormatted(){return"{x:"+this.x+", y:"+this.y+"}"}clone(){return new s(this.x,this.y)}toPoint2D(){return new o.Point2D(this.x,this.y)}setPath(e){let t=this.x,i=this.y;e.moveTo(t,i),e.lineTo(t+1,i),e.lineTo(t+1,i+1),e.lineTo(t,i+1),e.closePath()}stroke(e){e.beginPath(),this.setPath(e),e.stroke()}fill(e){e.beginPath(),this.setPath(e),e.fill()}}t.Point=s},269:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SettingsChangedEvent=void 0,t.SettingsChangedEvent=class{static EventType_CacheSizeChanged="CACHE_CHANGED";static EventType_CacheToggled="CACHE_TOGGLED";static EventType_FontChanged="FONT_CHANGED";_EventType;constructor(e){null!=e&&""!==e&&(this._EventType=e)}getEventType(){return this._EventType}}},498:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.clsUtility=void 0;const o=i(8624),s=i(8087),n=i(151),r=i(9441),l=i(3170),d=i(1207),a=i(7389),c=i(5772),h=i(8101),g=i(2937),k=i(8113),y=i(7300),f=i(106),x=i(8678);class w{static _className="clsUtility";static Hatch_ForwardDiagonal=2;static Hatch_BackwardDiagonal=3;static Hatch_Vertical=4;static Hatch_Horizontal=5;static Hatch_Cross=8;static addHatchFills(e,t){try{if(null==t||0===t.length)return;let i,o=e.get_LineType(),n=e.get_FillStyle(),r=0,l=0,d=0,a=1.5+(e.get_LineThickness()/2-1.5)*e.get_patternScale(),c=e.get_LineColor(),y=Math.trunc(10*a);if(!1===x.clsUtility.isClosedPolygon(o)&&!1===x.clsUtility.IsChange1Area(o))switch(o){case h.TacticalLines.BBS_AREA:case h.TacticalLines.BBS_LINE:case h.TacticalLines.BBS_RECTANGLE:break;default:return}switch(o){case h.TacticalLines.NFA:case h.TacticalLines.NFA_CIRCULAR:case h.TacticalLines.NFA_RECTANGULAR:case h.TacticalLines.LAA:n=w.Hatch_BackwardDiagonal;break;case h.TacticalLines.BIO:case h.TacticalLines.NUC:case h.TacticalLines.CHEM:case h.TacticalLines.RAD:n=w.Hatch_BackwardDiagonal,c=k.Color.yellow,a=3+(e.get_LineThickness()-3)*e.get_patternScale();break;case h.TacticalLines.WFZ:n=w.Hatch_BackwardDiagonal,e.get_LineColor()===k.Color.BLACK&&(c=k.Color.GRAY),y=Math.trunc(y/2);break;case h.TacticalLines.OBSAREA:for(r=0;r<t.length;r++){let e=t[r];null!=e.getLineColor()&&0===e.getLineColor().toRGB()&&t.splice(r,1)}n=w.Hatch_BackwardDiagonal,y=Math.trunc(1.25*y);break;default:if(n<=0)return}let f=t.length;for(r=0;r<f;r++)if(i=t[r],l=i.getFillStyle(),l===n){d=r;break}f=t.length;for(let r=0;r<f;r++){let l;if(o===h.TacticalLines.RANGE_FAN||o===h.TacticalLines.RANGE_FAN_SECTOR||o===h.TacticalLines.RADAR_SEARCH?(l=t[r],i=t[r],n=i.getFillStyle()):l=t[d],!(n<w.Hatch_ForwardDiagonal)){if(e.get_UseHatchFill()){let e=g.PatternFillRenderer.MakeHatchPatternFill(n,y,a,c);l.setPatternFillImage(e)}else if(n!==w.Hatch_Cross){let i=w.buildHatchArea(e,l,n,y);i.setStroke(new s.BasicStroke(a)),i.setLineColor(c),t.push(i)}else{let i=w.buildHatchArea(e,l,w.Hatch_BackwardDiagonal,y),o=w.buildHatchArea(e,l,w.Hatch_ForwardDiagonal,y);i.setStroke(new s.BasicStroke(a)),i.setLineColor(c),t.push(i),o.setStroke(new s.BasicStroke(a)),o.setLineColor(c),t.push(o)}if(o!==h.TacticalLines.RANGE_FAN&&o!==h.TacticalLines.RANGE_FAN_SECTOR&&o!==h.TacticalLines.RADAR_SEARCH)break}}}catch(e){if(!(e instanceof Error))throw e;y.ErrorLogger.LogException(w._className,"addHatchFills",new f.RendererException("Failed inside addHatchFills",e))}}static buildHatchArea(e,t,i,s){let n;try{let r;n=new c.Shape2(c.Shape2.SHAPE_TYPE_POLYLINE);let l=t.getBounds(),h=l.getX(),g=l.getY(),k=l.getWidth(),y=l.getHeight();if(k>y?y=k:k=y,e.get_UseHatchFill())return n.setFillStyle(i),n.setShape(d.lineutility.createStrokedShape(t.getShape())),n;k*=2,y*=2;let f,x,p=0,m=0,u=0,F=new Array,S=new Array;if(i===w.Hatch_BackwardDiagonal){for(p=Math.trunc(k/s),m=Math.trunc(y/s),u=0;u<m;u++)f=new a.POINT2(h,g+s*u),F.push(f);for(u=0;u<p;u++)x=new a.POINT2(h+s*u,g),S.push(x);for(n.moveTo(new a.POINT2(h-s/2,g-s/2)),n.lineTo(new a.POINT2(h,g)),u=0;u<m;u++)u%2==0?(n.lineTo(F[u]),n.lineTo(S[u])):(n.lineTo(S[u]),n.lineTo(F[u]));n.lineTo(new a.POINT2(h+k+s/2,g+y+s/2)),n.lineTo(new a.POINT2(h+k+s,g+y+s/2)),n.lineTo(new a.POINT2(h+k+s,g-s/2)),n.lineTo(new a.POINT2(h-s/2,g-s/2))}if(i===w.Hatch_ForwardDiagonal){for(p=Math.trunc(k/s),m=Math.trunc(y/s),k/=2,u=0;u<m;u++)f=new a.POINT2(h+k,g+s*u),F.push(f);for(u=0;u<p;u++)x=new a.POINT2(h+k-s*u,g),S.push(x);for(n.moveTo(new a.POINT2(h+k+s/2,g-s/2)),n.lineTo(new a.POINT2(h,g)),u=0;u<m;u++)u%2==0?(n.lineTo(F[u]),n.lineTo(S[u])):(n.lineTo(S[u]),n.lineTo(F[u]));n.lineTo(new a.POINT2(h-s/2,g+y+s/2)),n.lineTo(new a.POINT2(h-s,g+y+s/2)),n.lineTo(new a.POINT2(h-s,g-s/2)),n.lineTo(new a.POINT2(h+k+s/2,g-s/2))}if(i===w.Hatch_Vertical){for(p=Math.trunc(k/(s/2)),m=Math.trunc(y/(s/2)),u=0;u<p;u++)u%2==0?(f=new a.POINT2(h+s/2*u,g),F.push(f),f=new a.POINT2(h+s/2*u,g+y),F.push(f)):(f=new a.POINT2(h+s/2*u,g+y),F.push(f),f=new a.POINT2(h+s/2*u,g),F.push(f));for(n.moveTo(new a.POINT2(h-s/2,g-s/2)),n.lineTo(new a.POINT2(h,g)),u=0;u<m-1;u++)n.lineTo(F[u]);n.lineTo(new a.POINT2(h+k+s/2,g+y+s/2)),n.lineTo(new a.POINT2(h+k+s,g+y+s/2)),n.lineTo(new a.POINT2(h+k+s,g-s/2)),n.lineTo(new a.POINT2(h-s/2,g-s/2))}if(i===w.Hatch_Horizontal){for(p=Math.trunc(k/(s/2)),m=Math.trunc(y/(s/2)),u=0;u<m;u++)u%2==0?(x=new a.POINT2(h,g+s/2*u),S.push(x),x=new a.POINT2(h+k,g+s/2*u),S.push(x)):(x=new a.POINT2(h+k,g+s/2*u),S.push(x),x=new a.POINT2(h,g+s/2*u),S.push(x));for(n.moveTo(new a.POINT2(h-s/2,g-s/2)),n.lineTo(new a.POINT2(h,g)),u=0;u<m-1;u++)n.lineTo(S[u]);n.lineTo(new a.POINT2(h-s/2,g+y+s/2)),n.lineTo(new a.POINT2(h-s,g+y+s/2)),n.lineTo(new a.POINT2(h-s,g-s/2)),n.lineTo(new a.POINT2(h+k+s/2,g-s/2))}let _=new o.Area(t.getShape());r=new o.Area(n.getShape()),r.intersect(_),n.setShape(r)}catch(e){if(!(e instanceof Error))throw e;y.ErrorLogger.LogException(w._className,"buildHatchArea",new f.RendererException("Failed inside buildHatchArea",e))}return n}static POINT2ToPoint(e){let t=new n.Point;return t.x=e.x,t.y=e.y,t}static PointToPOINT2(e){return new a.POINT2(e.x,e.y)}static POINT2ToPoint2D(e){return new r.Point2D(e.x,e.y)}static Points2DToPOINT2(e){let t,i=new Array,o=e.length;for(let s=0;s<o;s++)t=new a.POINT2(e[s].getX(),e[s].getY()),i.push(t);return i}static Point2DToPOINT2(e){return new a.POINT2(e.getX(),e.getY())}static addModifiersBeforeClipping(e){let t=!1,i=e.get_LineType();switch(i){case h.TacticalLines.TORPEDO:case h.TacticalLines.OPTICAL:case h.TacticalLines.ELECTRO:case h.TacticalLines.BEARING_EW:case h.TacticalLines.ACOUSTIC:case h.TacticalLines.ACOUSTIC_AMB:case h.TacticalLines.BEARING:case h.TacticalLines.BEARING_J:case h.TacticalLines.BEARING_RDF:case h.TacticalLines.MSR:case h.TacticalLines.MSR_ONEWAY:case h.TacticalLines.MSR_TWOWAY:case h.TacticalLines.MSR_ALT:case h.TacticalLines.ASR:case h.TacticalLines.ASR_ONEWAY:case h.TacticalLines.ASR_TWOWAY:case h.TacticalLines.ASR_ALT:case h.TacticalLines.ROUTE:case h.TacticalLines.ROUTE_ONEWAY:case h.TacticalLines.ROUTE_ALT:case h.TacticalLines.HCONVOY:case h.TacticalLines.CONVOY:case h.TacticalLines.MFP:case h.TacticalLines.RFL:case h.TacticalLines.NFL:case h.TacticalLines.CFL:case h.TacticalLines.TRIP:case h.TacticalLines.FSCL:case h.TacticalLines.BCL_REVD:case h.TacticalLines.BCL:case h.TacticalLines.ICL:case h.TacticalLines.IFF_OFF:case h.TacticalLines.IFF_ON:case h.TacticalLines.GENERIC_LINE:case h.TacticalLines.FPF:case h.TacticalLines.LINTGT:case h.TacticalLines.LINTGTS:case h.TacticalLines.MSDZ:case h.TacticalLines.GAP:case h.TacticalLines.IL:case h.TacticalLines.DIRATKAIR:case h.TacticalLines.PDF:case h.TacticalLines.AC:case h.TacticalLines.SAAFR:case h.TacticalLines.LLTR:case h.TacticalLines.SC:case h.TacticalLines.MRR:case h.TacticalLines.SL:case h.TacticalLines.TC:case h.TacticalLines.BOUNDARY:case h.TacticalLines.WDRAWUP:case h.TacticalLines.WITHDRAW:case h.TacticalLines.RETIRE:case h.TacticalLines.FPOL:case h.TacticalLines.RPOL:case h.TacticalLines.RIP:case h.TacticalLines.DELAY:case h.TacticalLines.CATK:case h.TacticalLines.CATKBYFIRE:case h.TacticalLines.SCREEN:case h.TacticalLines.COVER:case h.TacticalLines.GUARD:case h.TacticalLines.FLOT:case h.TacticalLines.LC:case h.TacticalLines.PL:case h.TacticalLines.FEBA:case h.TacticalLines.LL:case h.TacticalLines.EWL:case h.TacticalLines.FCL:case h.TacticalLines.HOLD:case h.TacticalLines.BRDGHD:case h.TacticalLines.HOLD_GE:case h.TacticalLines.BRDGHD_GE:case h.TacticalLines.LOA:case h.TacticalLines.LOD:case h.TacticalLines.LDLC:case h.TacticalLines.PLD:case h.TacticalLines.RELEASE:case h.TacticalLines.HOL:case h.TacticalLines.BHL:t=!0}return!0===x.clsUtility.isClosedPolygon(i)&&(t=!0),t}static FilterPoints(e){try{let t=e.get_LineType(),i=0;switch(t){case h.TacticalLines.ATDITCH:case h.TacticalLines.ATDITCHC:case h.TacticalLines.ATDITCHM:case h.TacticalLines.FLOT:case h.TacticalLines.FORT_REVD:case h.TacticalLines.FORT:case h.TacticalLines.FORTL:case h.TacticalLines.STRONG:i=25;break;case h.TacticalLines.LC:case h.TacticalLines.OBSAREA:case h.TacticalLines.OBSFAREA:case h.TacticalLines.ENCIRCLE:case h.TacticalLines.ZONE:case h.TacticalLines.LINE:case h.TacticalLines.ATWALL:case h.TacticalLines.UNSP:case h.TacticalLines.SFENCE:case h.TacticalLines.DFENCE:case h.TacticalLines.DOUBLEA:case h.TacticalLines.LWFENCE:case h.TacticalLines.HWFENCE:case h.TacticalLines.SINGLEC:case h.TacticalLines.DOUBLEC:case h.TacticalLines.TRIPLE:i=35;break;case h.TacticalLines.UCF:case h.TacticalLines.CF:case h.TacticalLines.CFG:case h.TacticalLines.CFY:case h.TacticalLines.SF:case h.TacticalLines.USF:case h.TacticalLines.OCCLUDED:case h.TacticalLines.UOF:case h.TacticalLines.SFG:case h.TacticalLines.SFY:case h.TacticalLines.WFY:case h.TacticalLines.WFG:case h.TacticalLines.OFY:i=60;break;case h.TacticalLines.WF:case h.TacticalLines.UWF:i=40;break;case h.TacticalLines.RIDGE:case h.TacticalLines.ICE_EDGE_RADAR:case h.TacticalLines.ICE_OPENINGS_FROZEN:case h.TacticalLines.CRACKS_SPECIFIC_LOCATION:i=35;break;default:return}let o=0,s=0,n=new Array,r=new Array;n.push(e.Pixels[0]),r.push(e.LatLongs[0]);let l,a,c=e.Pixels[0],g=!1,k=e.Pixels.length;for(o=1;o<k;o++)l=e.Pixels[o],a=e.LatLongs[o],-1!==l.style?(s=d.lineutility.CalcDistanceDouble(c,l),t===h.TacticalLines.LC?s>i?(c=l,n.push(l),r.push(a),g=!0):o===e.Pixels.length-1&&(n[n.length-1]=l,r[r.length-1]=a):(s>i||o===e.Pixels.length-1)&&(c=l,n.push(l),r.push(a),g=!0)):(c=l,n.push(l),r.push(a),g=!0,l.style=0);!0===g&&(e.Pixels=n,e.LatLongs=r)}catch(e){if(!(e instanceof Error))throw e;y.ErrorLogger.LogException("clsUtility","FilterPoints",new f.RendererException("Failed inside FilterPoints",e))}}static PixelsToLatLong(e,t){let i,o,s=0,n=new Array,r=e.length;for(s=0;s<r;s++)i=e[s],o=w.PointPixelsToLatLong(i,t),n.push(o);return n}static LatLongToPixels(e,t){let i,o,s=0,n=new Array,r=e.length;for(s=0;s<r;s++)i=e[s],o=w.PointLatLongToPixels(i,t),n.push(o);return n}static PointLatLongToPixels(e,t){let i=new a.POINT2,o=w.POINT2ToPoint2D(e);return o=t.GeoToPixels(o),i=w.Point2DToPOINT2(o),i.style=e.style,i}static FilterAXADPoints(e,t){try{switch(e.get_LineType()){case h.TacticalLines.CATK:case h.TacticalLines.CATKBYFIRE:case h.TacticalLines.AIRAOA:case h.TacticalLines.AAAAA:case h.TacticalLines.SPT:case h.TacticalLines.MAIN:break;default:return}let i,o,s=0,n=new Array,l=new Array,c=e.Pixels[0],g=e.Pixels[1],k=new r.Point2D(g.x,g.y),y=t.PixelsToGeo(k),f=new a.POINT2(y.getX(),y.getY()),x=e.Pixels[e.Pixels.length-1],w=d.lineutility.PointRelativeToLine(c,g,c,x),p=d.lineutility.CalcDistanceDouble(w,x);p+=5;let m=d.lineutility.CalcDistanceDouble(c,g),u=!1;p>m?(n.push(c),k=new r.Point2D(c.x,c.y),y=t.PixelsToGeo(k),f=new a.POINT2(y.getX(),y.getY()),l.push(f),g=d.lineutility.ExtendAlongLineDouble(c,g,p),n.push(g),k=new r.Point2D(g.x,g.y),y=t.PixelsToGeo(k),f=new a.POINT2(y.getX(),y.getY()),l.push(f)):(u=!0,n=e.Pixels,l=e.LatLongs);let F=e.Pixels.length;if(!1===u){for(s=2;s<F-1;s++)if(i=e.Pixels[s],o=e.LatLongs[s],u)n.push(i),l.push(o);else{if(m=d.lineutility.CalcDistanceDouble(c,i),p>m)continue;n.push(i),l.push(o),u=!0}n.push(x),k=new r.Point2D(x.x,x.y),y=t.PixelsToGeo(k),f=new a.POINT2(y.getX(),y.getY()),l.push(f)}let S,_,L=n[1],T=0;for(e.Pixels=new Array,e.LatLongs=new Array,s=0;s<2;s++)e.Pixels.push(n[s]),e.LatLongs.push(l[s]);for(F=n.length,s=2;s<F-1;s++)S=n[s],_=l[s],T=d.lineutility.CalcDistanceDouble(S,L),T>5&&(L=S,e.Pixels.push(S),e.LatLongs.push(_));e.Pixels.push(n[n.length-1]),e.LatLongs.push(l[l.length-1])}catch(e){if(!(e instanceof Error))throw e;y.ErrorLogger.LogException("clsUtility","FilterAXADPoints",new f.RendererException("Failed inside FilterAXADPoints",e))}}static RemoveDuplicatePoints(e){try{switch(e.get_LineType()){case h.TacticalLines.SC:case h.TacticalLines.MRR:case h.TacticalLines.SL:case h.TacticalLines.TC:case h.TacticalLines.LLTR:case h.TacticalLines.AC:case h.TacticalLines.SAAFR:break;default:if(x.clsUtility.isAutoshape(e))return}switch(e.get_LineType()){case h.TacticalLines.CATK:case h.TacticalLines.AIRAOA:case h.TacticalLines.AAAAA:case h.TacticalLines.SPT:case h.TacticalLines.MAIN:case h.TacticalLines.CATKBYFIRE:return;case h.TacticalLines.BOUNDARY:case h.TacticalLines.MSR:case h.TacticalLines.ASR:case h.TacticalLines.ROUTE:{let t=e.get_H();if(null!=t&&t.length>0&&t.split(",").length>1)return;break}}let t,i,o=e.get_LineType();if(x.clsUtility.IsChange1Area(o))return;let s=x.clsUtility.isClosedPolygon(e.get_LineType()),n=2;s&&(n=3);for(let o=1;o<e.Pixels.length;o++)i=new a.POINT2(e.Pixels[o-1]),t=new a.POINT2(e.Pixels[o]),Math.abs(t.x-i.x)<.5&&Math.abs(t.y-i.y)<.5&&e.Pixels.length>n&&(e.Pixels.splice(o,1),e.LatLongs.splice(o,1),o=1)}catch(e){if(!(e instanceof Error))throw e;y.ErrorLogger.LogException("clsUtility","RemoveDuplicatePoints",new f.RendererException("Failed inside RemoveDuplicatePoints",e))}}static PointPixelsToLatLong(e,t){let i=new a.POINT2;try{let o=new r.Point2D(e.x,e.y),s=t.PixelsToGeo(o);i=w.Point2DToPOINT2(s),i.style=e.style}catch(e){if(!(e instanceof Error))throw e;y.ErrorLogger.LogException("clsUtility","PointPixelsToLatLong",new f.RendererException("Could not convert point to geo",e))}return i}static getMBR(e){let t;try{let i,o=0,s=e[0].getX(),n=s,r=e[0].getY(),d=r,a=e.length;for(o=0;o<a;o++)i=e[o],i.getX()<n&&(n=i.getX()),i.getX()>s&&(s=i.getX()),i.getY()<=d&&(d=i.getY()),i.getY()>r&&(r=i.getY());t=new l.Rectangle2D(n,d,s-n,r-d)}catch(e){if(!(e instanceof Error))throw e;y.ErrorLogger.LogException(w._className,"AddBoundaryPointsForLines",new f.RendererException("Failed inside AddBoundaryPointsForLines",e))}return t}static GetMBR(e,t,i,o,s){try{let n=e[0].getPoints()[0];t.x=n.x,t.y=n.y,i.x=n.x,i.y=n.y,s.x=n.x,s.y=n.y,o.x=n.x,o.y=n.y;for(let n of e){let e=n.getPoints();for(let n=0;n<e.length;n++){let r=e[n].x,l=e[n].y;r<s.x&&(s.x=r,t.x=r),r>o.x&&(o.x=r,i.x=r),l>s.y&&(s.y=l,o.y=l),l<t.y&&(t.y=l,i.y=l)}}}catch(e){if(!(e instanceof Error))throw e;y.ErrorLogger.LogException(w._className,"GetMBR",new f.RendererException("Failed inside GetMBR",e))}}}t.clsUtility=w},628:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Font=void 0;class i{static PLAIN=0;static BOLD=1;static ITALIC=2;_size=10;_text="";_type=0;constructor(e,t,i){this._text=e,this._type=t,this._size=i}getSize(){return this._size}getName(){return this._text}getType(){return this._type}isBold(){return this._type===i.BOLD}getTypeString(){let e;switch(this._type){case i.BOLD:e="bold";break;case i.ITALIC:e="italic";break;default:e="normal"}return e}static getTypeString(e){let t;return t=e===i.BOLD?"bold":"normal",t}static getTypeInt(e){let t=i.PLAIN;switch(e){case"bold":t=i.BOLD;break;case"italic":t=i.ITALIC;break;default:t=i.PLAIN}return t}toString(){return this.getTypeString()+" "+this._size+"px "+this._text}}t.Font=i},680:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.MSInfo=void 0;const o=i(3247),s=i(2051),n=i(2421);class r{_Version=0;_Name;_Path;_SymbolSet;_SymbolSetInt=0;_EntityCode;_Geometry="point";_Modifiers;_MinPointCount=0;_MaxPointCount=0;_DrawRule=0;constructor(...e){switch(e.length){case 7:{const[t,i,s,l,d,a,c]=e;this._Version=t,this._SymbolSetInt=parseInt(i),this._SymbolSet=r.parseSymbolSetName(i,this._Version),null!=d&&""!==d&&(this._Name=d,this._Path=this._SymbolSet+" / "+s+" / "+l+" / "),null!=l&&""!==l&&(null==this._Name&&(this._Name=l),null==this._Path&&(this._Path=this._SymbolSet+" / "+s+" / ")),null!=s&&""!==s&&(null==this._Name&&(this._Name=s),null==this._Path&&(this._Path=this._SymbolSet+" / ")),null!=a&&6===a.length&&(this._EntityCode=a),this._Geometry="point","000000"!==a&&this._SymbolSetInt!==n.SymbolID.SymbolSet_ControlMeasure&&this._SymbolSetInt!==n.SymbolID.SymbolSet_Atmospheric&&this._SymbolSetInt!==n.SymbolID.SymbolSet_Oceanographic&&this._SymbolSetInt!==n.SymbolID.SymbolSet_MeteorologicalSpace&&(this._DrawRule=o.DrawRules.POINT2,this._MinPointCount=1,this._MaxPointCount=1),this._Modifiers=c;break}case 9:{const[t,i,o,s,n,l,d,a,c]=e;this._Version=t,this._SymbolSetInt=parseInt(i),this._SymbolSet=r.parseSymbolSetName(i,this._Version),null!=n&&""!==n&&(this._Name=n,this._Path=this._SymbolSet+" / "+o+" / "+s+" / "),null!=s&&""!==s&&(null==this._Name&&(this._Name=s),null==this._Path&&(this._Path=this._SymbolSet+" / "+o+" / ")),null!=o&&""!==o&&(null==this._Name&&(this._Name=o),null==this._Path&&(this._Path=this._SymbolSet+" / ")),null!=l&&6===l.length&&(this._EntityCode=l),this._Geometry=d,this._DrawRule=this.parseDrawRule(a);let h=[0,0];"25"===i?h=r.getMinMaxPointsFromDrawRule(this._DrawRule,t):"45"!==i&&"46"!==i||(h=r.getMinMaxPointsFromMODrawRule(this._DrawRule)),this._MinPointCount=h[0],this._MaxPointCount=h[1],this._Modifiers=c;break}default:throw Error("Invalid number of arguments")}}parseDrawRule(e){let t=0;switch(e.toLowerCase()){case"area1":t=o.DrawRules.AREA1;break;case"area2":t=o.DrawRules.AREA2;break;case"area3":t=o.DrawRules.AREA3;break;case"area4":t=o.DrawRules.AREA4;break;case"area5":t=o.DrawRules.AREA5;break;case"area6":t=o.DrawRules.AREA6;break;case"area7":t=o.DrawRules.AREA7;break;case"area8":t=o.DrawRules.AREA8;break;case"area9":t=o.DrawRules.AREA9;break;case"area10":t=o.DrawRules.AREA10;break;case"area11":t=o.DrawRules.AREA11;break;case"area12":t=o.DrawRules.AREA12;break;case"area13":t=o.DrawRules.AREA13;break;case"area14":t=o.DrawRules.AREA14;break;case"area15":t=o.DrawRules.AREA15;break;case"area16":t=o.DrawRules.AREA16;break;case"area17":t=o.DrawRules.AREA17;break;case"area18":t=o.DrawRules.AREA18;break;case"area19":t=o.DrawRules.AREA19;break;case"area20":t=o.DrawRules.AREA20;break;case"area21":t=o.DrawRules.AREA21;break;case"area22":t=o.DrawRules.AREA22;break;case"area23":t=o.DrawRules.AREA23;break;case"area24":t=o.DrawRules.AREA24;break;case"area25":t=o.DrawRules.AREA25;break;case"area26":t=o.DrawRules.AREA26;break;case"point1":t=o.DrawRules.POINT1;break;case"point2":t=o.DrawRules.POINT2;break;case"point3":t=o.DrawRules.POINT3;break;case"point4":t=o.DrawRules.POINT4;break;case"point5":t=o.DrawRules.POINT5;break;case"point6":t=o.DrawRules.POINT6;break;case"point7":t=o.DrawRules.POINT7;break;case"point8":t=o.DrawRules.POINT8;break;case"point9":t=o.DrawRules.POINT9;break;case"point10":t=o.DrawRules.POINT10;break;case"point11":t=o.DrawRules.POINT11;break;case"point12":t=o.DrawRules.POINT12;break;case"point13":t=o.DrawRules.POINT13;break;case"point14":t=o.DrawRules.POINT14;break;case"point15":t=o.DrawRules.POINT15;break;case"point16":t=o.DrawRules.POINT16;break;case"point17":t=o.DrawRules.POINT17;break;case"point18":t=o.DrawRules.POINT18;break;case"line1":t=o.DrawRules.LINE1;break;case"line2":t=o.DrawRules.LINE2;break;case"line3":t=o.DrawRules.LINE3;break;case"line4":t=o.DrawRules.LINE4;break;case"line5":t=o.DrawRules.LINE5;break;case"line6":t=o.DrawRules.LINE6;break;case"line7":t=o.DrawRules.LINE7;break;case"line8":t=o.DrawRules.LINE8;break;case"line9":t=o.DrawRules.LINE9;break;case"line10":t=o.DrawRules.LINE10;break;case"line11":t=o.DrawRules.LINE11;break;case"line12":t=o.DrawRules.LINE12;break;case"line13":t=o.DrawRules.LINE13;break;case"line14":t=o.DrawRules.LINE14;break;case"line16":t=o.DrawRules.LINE16;break;case"line17":t=o.DrawRules.LINE17;break;case"line18":t=o.DrawRules.LINE18;break;case"line19":t=o.DrawRules.LINE19;break;case"line20":t=o.DrawRules.LINE20;break;case"line21":t=o.DrawRules.LINE21;break;case"line22":t=o.DrawRules.LINE22;break;case"line23":t=o.DrawRules.LINE23;break;case"line24":t=o.DrawRules.LINE24;break;case"line25":t=o.DrawRules.LINE25;break;case"line26":t=o.DrawRules.LINE26;break;case"line27":t=o.DrawRules.LINE27;break;case"line28":t=o.DrawRules.LINE28;break;case"line29":t=o.DrawRules.LINE29;break;case"corridor1":t=o.DrawRules.CORRIDOR1;break;case"axis1":t=o.DrawRules.AXIS1;break;case"axis2":t=o.DrawRules.AXIS2;break;case"polyline1":t=o.DrawRules.POLYLINE1;break;case"ellipse1":t=o.DrawRules.ELLIPSE1;break;case"rectangular1":t=o.DrawRules.RECTANGULAR1;break;case"rectangular2":t=o.DrawRules.RECTANGULAR2;break;case"rectangular3":t=o.DrawRules.RECTANGULAR3;break;case"circular1":t=o.DrawRules.CIRCULAR1;break;case"circular2":t=o.DrawRules.CIRCULAR2;break;case"arc1":t=o.DrawRules.ARC1;break;default:t=o.DrawRules.DONOTDRAW}return t}static parseSymbolSetName(...e){switch(e.length){case 1:{const[t]=e;return r.parseSymbolSetName(t.substring(4,6),n.SymbolID.getVersion(t))}case 2:{const[t,i]=e;let o;switch(t){case"01":o="Air";break;case"02":o="Air Missile";break;case"05":o="Space";break;case"06":o="Space Missile";break;case"10":o="Land Unit";break;case"11":o="Land Civilian Unit-Org";break;case"15":o="Land Equipment";break;case"20":o="Land Installations";break;case"25":o="Control Measure";break;case"27":o="Dismounted Individuals";break;case"30":o="Sea Surface";break;case"35":o="Sea Subsurface";break;case"36":o="Mine Warfare";break;case"40":o="Activities";break;case"45":o="Atmospheric";break;case"46":o="Oceanographic";break;case"47":o="Meteorological Space";break;case"50":o=i<n.SymbolID.Version_2525E?"Space SIGINT":"SIGINT";break;case"51":o="Air SIGINT";break;case"52":o="Land SIGINT";break;case"53":o="Sea Surface SIGINT";break;case"54":o="Sea Subsurface SIGINT";break;case"60":o="Cyberspace";break;default:o="UNKNOWN"}return o}default:throw Error("Invalid number of arguments")}}static getMinMaxPointsFromDrawRule(e,t){let i=[1,1];switch(e){case o.DrawRules.AREA1:case o.DrawRules.AREA2:case o.DrawRules.AREA3:case o.DrawRules.AREA4:case o.DrawRules.AREA9:case o.DrawRules.AREA20:case o.DrawRules.AREA23:i[0]=3,i[1]=Number.MAX_VALUE;break;case o.DrawRules.AREA5:case o.DrawRules.AREA7:case o.DrawRules.AREA11:case o.DrawRules.AREA12:case o.DrawRules.AREA17:case o.DrawRules.AREA21:case o.DrawRules.AREA24:case o.DrawRules.AREA25:case o.DrawRules.POINT12:case o.DrawRules.LINE3:case o.DrawRules.LINE6:case o.DrawRules.LINE10:case o.DrawRules.LINE12:case o.DrawRules.LINE17:case o.DrawRules.LINE22:case o.DrawRules.LINE23:case o.DrawRules.LINE24:case o.DrawRules.LINE29:case o.DrawRules.POLYLINE1:i[0]=3,i[1]=3;break;case o.DrawRules.AREA6:case o.DrawRules.AREA13:case o.DrawRules.AREA15:case o.DrawRules.AREA16:case o.DrawRules.AREA19:case o.DrawRules.LINE4:case o.DrawRules.LINE5:case o.DrawRules.LINE9:case o.DrawRules.LINE14:case o.DrawRules.LINE18:case o.DrawRules.LINE19:case o.DrawRules.LINE20:case o.DrawRules.LINE25:case o.DrawRules.LINE28:case o.DrawRules.RECTANGULAR1:case o.DrawRules.RECTANGULAR3:i[0]=2,i[1]=2;break;case o.DrawRules.AREA8:case o.DrawRules.AREA18:case o.DrawRules.LINE11:case o.DrawRules.LINE16:i[0]=4,i[1]=4;break;case o.DrawRules.AREA10:i[0]=3,i[1]=6;break;case o.DrawRules.AREA14:i[0]=3,t==n.SymbolID.Version_2525D?i[1]=4:i[1]=3;break;case o.DrawRules.LINE1:case o.DrawRules.LINE2:case o.DrawRules.LINE7:case o.DrawRules.LINE13:case o.DrawRules.LINE21:case o.DrawRules.CORRIDOR1:i[0]=2,i[1]=Number.MAX_VALUE;break;case o.DrawRules.AREA26:i[0]=6,i[1]=Number.MAX_VALUE;break;case o.DrawRules.LINE8:i[0]=2,i[1]=300;break;case o.DrawRules.LINE26:case o.DrawRules.LINE27:t>=n.SymbolID.Version_2525E?i[0]=4:i[0]=3,i[1]=4;break;case o.DrawRules.AXIS1:case o.DrawRules.AXIS2:i[0]=3,i[1]=50;break;case 0:i[0]=0,i[1]=0;case o.DrawRules.AREA22:case o.DrawRules.POINT17:case o.DrawRules.POINT18:case o.DrawRules.ELLIPSE1:case o.DrawRules.RECTANGULAR2:}return i}static getMinMaxPointsFromMODrawRule(e){let t=[1,1];switch(e){case s.MODrawRules.AREA1:case s.MODrawRules.AREA2:case s.MODrawRules.LINE5:t[0]=3,t[1]=Number.MAX_VALUE;break;case s.MODrawRules.POINT5:case s.MODrawRules.LINE1:case s.MODrawRules.LINE2:case s.MODrawRules.LINE3:case s.MODrawRules.LINE4:case s.MODrawRules.LINE6:case s.MODrawRules.LINE7:case s.MODrawRules.LINE8:t[0]=2,t[1]=Number.MAX_VALUE;break;case 0:t[0]=0,t[1]=0}return t}getVersion(){return this._Version}getName(){return this._Name}getPath(){return this._Path}getGeometry(){return this._Geometry}getDrawRule(){return this._DrawRule}getSymbolSet(){return this._SymbolSetInt}getEntityCode(){return Number.parseInt(this._EntityCode)}getBasicSymbolID(){return this._SymbolSetInt<10?"0"+this._SymbolSetInt+this._EntityCode:""+this._SymbolSetInt+this._EntityCode}getMinPointCount(){return this._MinPointCount}getMaxPointCount(){return this._MaxPointCount}getModifiers(){return this._Modifiers}}t.MSInfo=r},921:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.clsClipQuad=void 0;const o=i(1207),s=i(7389),n=i(5772),r=i(8101),l=i(3515),d=i(7300),a=i(106),c=i(8678),h=i(1024),g=i(8977),k=i(9441),y=i(6967),f=i(9485);class x{static _className="clsClipQuad";static AddBoundaryPointsForLines(e,t){let i=0;try{let n=e[0],r=e[e.length-1],l=new s.POINT2(n.getX(),n.getY()),d=new s.POINT2(r.getX(),r.getY()),a=new k.Point2D,c=new y.Polygon,h=0,g=Number.MAX_VALUE,f=0,x=new s.POINT2,w=!1,p=!1;for(h=0;h<t.length;h++)c.addPoint(t[h].getX(),t[h].getY());let m=0,u=0,F=0;for(h=0;h<t.length-1;h++)m+=t[h].getX(),u+=t[h].getY(),F++;t[0].getX()===t[h].getX()&&t[0].getY()===t[h].getY()||(m+=t[h].getX(),u+=t[h].getY(),F++);let S,_=m/F,L=u/F,T=new s.POINT2(_,L);if(!1===c.contains(n)){for(h=0;h<t.length;h++)x.x=t[h].getX(),x.y=t[h].getY(),f=o.lineutility.CalcDistanceDouble(l,x),f<g&&(g=f,a.setLocation(x.x,x.y));S=new s.POINT2(a.getX(),a.getY()),S=o.lineutility.ExtendAlongLineDouble(S,T,2),a.setLocation(S.x,S.y),e.splice(0,0,a),w=!0}if(a=new k.Point2D,g=Number.MAX_VALUE,!1===c.contains(r)){for(h=0;h<t.length;h++)x.x=t[h].getX(),x.y=t[h].getY(),f=o.lineutility.CalcDistanceDouble(d,x),f<g&&(g=f,a.setLocation(x.x,x.y));S=new s.POINT2(a.getX(),a.getY()),S=o.lineutility.ExtendAlongLineDouble(S,T,2),a.setLocation(S.x,S.y),e.push(a),p=!0}!1===w&&!1===p?i=0:!0===w&&!1===p?i=1:!1===w&&!0===p?i=2:!0===w&&!0===p&&(i=3)}catch(e){if(!(e instanceof Error))throw e;d.ErrorLogger.LogException(x._className,"AddBoundaryPointsForLines",new a.RendererException("Failed inside AddBoundaryPointsForLines",e))}return i}static CalcTrueIntersectDouble(e,t,i,o,s,n,r,l){let c=new k.Point2D(r,l);try{let d=0,a=0;if(0===s&&0===n)return c;if(0===s&&1===n)return c.setLocation(r,i*r+o),c;if(1===s&&0===n)return c.setLocation(l,e*l+t),c;if(e!==i)return d=(o-t)/(e-i),a=e*d+t,c.setLocation(d,a),c}catch(e){if(!(e instanceof Error))throw e;d.ErrorLogger.LogException(x._className,"CalcTrueIntersectDouble",new a.RendererException("Failed inside CalcTrueIntersectDouble",e))}return c}static intersectPoint2(e,t,i){let o;try{let s=i.getP1(),n=i.getP2();Math.abs(t.getX()-e.getX())<1&&t.setLocation(t.getX()+1,t.getY());let r=(n.getY()-s.getY())/(n.getX()-s.getX()),l=(t.getY()-e.getY())/(t.getX()-e.getX()),d=n.getY()-r*n.getX(),a=t.getY()-l*t.getX();o=x.CalcTrueIntersectDouble(r,d,l,a,1,1,0,0)}catch(e){if(!(e instanceof Error))throw e;d.ErrorLogger.LogException(x._className,"intersectPoint2",new a.RendererException("Failed inside intersectPoint2",e))}return o}static clipSide(e,t,i,s){let n;try{let r,l,d,a,c,h,g,y,w=new k.Point2D(s[i].getX(),s[i].getY()),p=new k.Point2D(s[i+1].getX(),s[i+1].getY()),m=0,u=0,F=0,S=0,_=0,L=0,T=0,M=-1,A=-1,C=-1;for(n=new Array,0===i?r=new k.Point2D(s[i+2].getX(),s[i+2].getY()):i>1?r=new k.Point2D(s[i-2].getX(),s[i-2].getY()):1===i&&(r=new k.Point2D(s[0].getX(),s[0].getY())),Math.abs(p.getX()-w.getX())<1&&p.setLocation(p.getX()+1,p.getY()),Math.abs(p.getY()-w.getY())<1&&p.setLocation(p.getX(),p.getY()+1),T=0;T<t.length;T++)if(c=t[T],h=0===T?t[t.length-1]:t[T-1],m=(p.getY()-w.getY())/(p.getX()-w.getX()),u=-1/m,F=p.getY()-m*p.getX(),S=h.getY()-u*h.getX(),_=c.getY()-u*c.getX(),L=r.getY()-u*r.getX(),d=x.CalcTrueIntersectDouble(m,F,u,S,1,1,0,0),a=x.CalcTrueIntersectDouble(m,F,u,_,1,1,0,0),l=x.CalcTrueIntersectDouble(m,F,u,L,1,1,0,0),M=o.lineutility.GetQuadrantDouble(r.getX(),r.getY(),l.getX(),l.getY()),A=o.lineutility.GetQuadrantDouble(h.getX(),h.getY(),d.getX(),d.getY()),C=o.lineutility.GetQuadrantDouble(c.getX(),c.getY(),a.getX(),a.getY()),A===M&&C===M)n.push(c);else if(A===M&&C!==M)y=new f.Line2D(w,p),g=x.intersectPoint2(h,c,y),null!=g&&n.push(g),e.set_WasClipped(!0);else if(A!==M&&C===M)y=new f.Line2D(w,p),g=x.intersectPoint2(h,c,y),null!=g&&n.push(g),n.push(c),e.set_WasClipped(!0);else if(A!==M&&C!==M)continue}catch(e){if(!(e instanceof Error))throw e;d.ErrorLogger.LogException(x._className,"clipSide",new a.RendererException("Failed inside clipSide",e))}return n}static addAbatisFill(e,t){try{if(null==e.Pixels||e.Pixels.length<2||null==e.get_FillColor()||e.get_FillColor().getAlpha()<2||null==t)return;let i,o,s=0,d=e.Pixels.length;switch(e.get_LineType()){case r.TacticalLines.MSDZ:{let t=0,o=0,r=0;if(i=new n.Shape2(n.Shape2.SHAPE_TYPE_POLYLINE),i.setFillColor(e.get_FillColor()),null!=e.Pixels&&e.Pixels.length>=300){t=Math.abs(e.Pixels[0].x-e.Pixels[50].x),o=Math.abs(e.Pixels[100].x-e.Pixels[150].x),r=Math.abs(e.Pixels[200].x-e.Pixels[250].x);let n=-1,l=-1;for(t>=o&&t>=r?(n=0,l=99):o>=t&&o>=r?(n=100,l=199):(n=200,l=299),i.moveTo(e.Pixels[n]),s=n;s<=l;s++)i.lineTo(e.Pixels[s])}break}case r.TacticalLines.ABATIS:if(i=new n.Shape2(n.Shape2.SHAPE_TYPE_POLYLINE),i.setFillColor(e.get_FillColor()),o=new l.TGLight,o.set_LineType(r.TacticalLines.GENERAL),o.Pixels=new Array,null!=e.Pixels&&e.Pixels.length>2)for(o.Pixels.push(e.Pixels[d-3]),o.Pixels.push(e.Pixels[d-2]),o.Pixels.push(e.Pixels[d-1]),o.Pixels.push(e.Pixels[d-3]),i.moveTo(o.Pixels[0]),s=1;s<o.Pixels.length;s++)i.lineTo(o.Pixels[s]);break;default:return}null!=t&&t.splice(0,0,i)}catch(e){if(!(e instanceof Error))throw e;d.ErrorLogger.LogException(x._className,"addAbatisFill",new a.RendererException("Failed inside addAbatisFill",e))}}static LinesWithFill(e,t){let i;try{if(null==e.get_FillColor()||e.get_FillColor().getAlpha()<=1||null==e.Pixels||0===e.Pixels.length)return i;switch(e.get_LineType()){case r.TacticalLines.ABATIS:case r.TacticalLines.SPT:case r.TacticalLines.MAIN:case r.TacticalLines.AAAAA:case r.TacticalLines.AIRAOA:case r.TacticalLines.CATK:case r.TacticalLines.CATKBYFIRE:case r.TacticalLines.CORDONSEARCH:case r.TacticalLines.CORDONKNOCK:case r.TacticalLines.SECURE:case r.TacticalLines.OCCUPY:case r.TacticalLines.RETAIN:case r.TacticalLines.ISOLATE:case r.TacticalLines.CONVOY:case r.TacticalLines.HCONVOY:return i;case r.TacticalLines.PAA_RECTANGULAR:case r.TacticalLines.RECTANGULAR_TARGET:return null;case r.TacticalLines.OBSFAREA:case r.TacticalLines.OBSAREA:case r.TacticalLines.STRONG:case r.TacticalLines.ZONE:case r.TacticalLines.FORT_REVD:case r.TacticalLines.FORT:case r.TacticalLines.ENCIRCLE:case r.TacticalLines.ATDITCHC:case r.TacticalLines.ATDITCHM:return x.fillDMA(e,t)}if(!1===c.clsUtility.LinesWithFill(e.get_LineType()))return i;let o;i=new Array;let s=new l.TGLight;if(s.set_LineType(r.TacticalLines.GENERAL),s.Pixels=new Array,s.Pixels.push(...e.Pixels),x.closeAreaTG(s),null!=t&&x.ClipPolygon(s,t),null==s.Pixels||0===s.Pixels.length)return null;let d=0;for(o=new n.Shape2(n.Shape2.SHAPE_TYPE_POLYLINE),o.setFillColor(e.get_FillColor()),o.moveTo(s.Pixels[0]),d=1;d<s.Pixels.length;d++)o.lineTo(s.Pixels[d]);if(!(null!=e.get_FillColor()||e.get_FillColor().getAlpha()>1))return null;i.push(o)}catch(e){if(!(e instanceof Error))throw e;d.ErrorLogger.LogException(x._className,"LinesWithFill",new a.RendererException("Failed inside LinesWithFill",e))}return i}static closeAreaTG(e){try{if(null==e.Pixels||0===e.Pixels.length)return;let t=e.Pixels[0],i=e.Pixels[e.Pixels.length-1];t.x===i.x&&t.y===i.y||e.Pixels.push(t)}catch(e){if(!(e instanceof Error))throw e;d.ErrorLogger.LogException(x._className,"closeAreaTG",new a.RendererException("Failed inside closeAreaTG",e))}}static fillDMA(e,t){let i=new Array;try{switch(e.get_LineType()){case r.TacticalLines.OBSFAREA:case r.TacticalLines.OBSAREA:case r.TacticalLines.STRONG:case r.TacticalLines.ZONE:case r.TacticalLines.FORT_REVD:case r.TacticalLines.FORT:case r.TacticalLines.ENCIRCLE:case r.TacticalLines.ATDITCHC:case r.TacticalLines.ATDITCHM:break;default:return i}let o,s=0,d=new l.TGLight;d.set_LineType(r.TacticalLines.GENERAL),d.Pixels=new Array;let a=0;for(a=e.Pixels.length,s=0;s<a;s++)d.Pixels.push(e.Pixels[s]);if(x.closeAreaTG(d),null!=t&&x.ClipPolygon(d,t),null==d.Pixels||0===d.Pixels.length)return i;for(o=new n.Shape2(n.Shape2.SHAPE_TYPE_POLYLINE),o.setFillColor(e.get_FillColor()),o.moveTo(d.Pixels[0]),s=1;s<d.Pixels.length;s++)o.lineTo(d.Pixels[s]);i.push(o)}catch(e){if(!(e instanceof Error))throw e;d.ErrorLogger.LogException(x._className,"fillDMA",new a.RendererException("Failed inside fillDMA",e))}return i}static ClipPolygon(e,t){let i=new Array;try{let o=c.clsUtility.isClosedPolygon(e.get_LineType());t=g.clsUtilityGE.expandPolygon(t,20);let s=h.clsUtilityCPOF.POINT2toPoint2D(e.Pixels),n=0,r=new Map;for(n=0;n<s.length;n++)r.set(n.toString(),s[n]);let l=t[0],d=t[t.length-1];l.getX()===d.getX()&&l.getY()===d.getY()||t.push(l);let a=0;for(o?s.splice(s.length-1,1):a=x.AddBoundaryPointsForLines(s,t),n=0;n<t.length-1;n++)i=0===n?x.clipSide(e,s,n,t):x.clipSide(e,i,n,t);if(o)i.length>0&&i.push(i[0]);else switch(a){case 0:break;case 1:i.length>0&&i.splice(0,1),i.length>0&&i.splice(0,1);break;case 2:i.length>0&&i.splice(i.length-1,1),i.length>0&&i.splice(i.length-1,1);break;case 3:i.length>0&&i.splice(0,1),i.length>0&&i.splice(0,1),i.length>0&&i.splice(i.length-1,1),i.length>0&&i.splice(i.length-1,1)}!0===o?i.length>2?e.Pixels=h.clsUtilityCPOF.Point2DtoPOINT2Mapped(i,r):e.Pixels=new Array:i.length>1?e.Pixels=h.clsUtilityCPOF.Point2DtoPOINT2Mapped(i,r):e.Pixels=new Array}catch(e){if(!(e instanceof Error))throw e;d.ErrorLogger.LogException(x._className,"ClipPolygon",new a.RendererException("Failed inside ClipPolygon",e))}return i}}t.clsClipQuad=x},960:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.mdlGeodesic=void 0;const o=i(3170),s=i(7389),n=i(8712),r=i(7300),l=i(106);class d{static _className="mdlGeodesic";static sm_a=6378137;static DegToRad(e){return e/180*Math.PI}static RadToDeg(e){return e/Math.PI*180}static GetAzimuth(e,t){let i=0;try{let o=d.DegToRad(e.y),s=d.DegToRad(e.x),n=d.DegToRad(t.y),r=d.DegToRad(t.x),l=Math.sin(r-s);l*=Math.cos(n);let a=Math.cos(o);a*=Math.sin(n);let c=Math.sin(o);c*=Math.cos(n),c*=Math.cos(r-s),a-=c,i=Math.atan2(l,a),i=d.RadToDeg(i)}catch(e){if(!(e instanceof Error))throw e;r.ErrorLogger.LogException(d._className,"GetAzimuth",new l.RendererException("Failed inside GetAzimuth",e))}return i}static geodesic_distance(e,t,i,o){let s=0;try{null!=i&&null!=o&&(i.value=new Array(1),o.value=new Array(1),i.value[0]=d.GetAzimuth(e,t),o.value[0]=d.GetAzimuth(t,e));let n=d.DegToRad(t.y-e.y),r=d.DegToRad(t.x-e.x),l=0,a=0,c=0,h=0,g=0,k=0,y=0;l=Math.sin(n/2),a=d.DegToRad(e.y),c=d.DegToRad(t.y),h=Math.sin(r/2),g=Math.cos(a),k=Math.cos(c);let f=l*l+g*k*h*h;s=Math.sqrt(f),y=Math.sqrt(1-f),s=2*Math.atan2(s,y)}catch(e){if(!(e instanceof Error))throw e;r.ErrorLogger.LogException(d._className,"geodesic_distance",new l.RendererException("Failed inside geodesic_distance",e))}return d.sm_a*s}static geodesic_coordinate(e,t,i){let o;try{let n=0,r=0,l=0,a=0,c=0,h=0,g=0,k=0,y=0,f=0,x=0,w=0,p=0;n=d.DegToRad(e.y),r=Math.cos(n),l=d.DegToRad(i),a=Math.sin(n),c=Math.cos(t/d.sm_a),h=Math.sin(t/d.sm_a),g=Math.cos(l);let m=d.RadToDeg(Math.asin(a*c+r*h*g));k=Math.sin(l),y=Math.sin(k),f=Math.cos(n),x=d.DegToRad(m),w=Math.sin(x),p=Math.atan2(k*h*r,c-a*w);let u=e.x+d.RadToDeg(p);o=new s.POINT2(u,m)}catch(e){if(!(e instanceof Error))throw e;r.ErrorLogger.LogException(d._className,"geodesic_coordinate",new l.RendererException("Failed inside geodesic_coordinate",e))}return o}static GetGeodesicArc(e){let t=new Array;try{if(null==e)return null;if(e.length<3)return null;let i,o=new s.POINT2(e[0]),r=new s.POINT2(e[1]),l=new s.POINT2(e[2]),a=new n.ref,c=0,h=0,g=new n.ref,k=new n.ref;h=d.geodesic_distance(o,r,g,k);let y=k.value[0];c=d.geodesic_distance(o,l,a,k),Math.abs(k.value[0]-y)<=1&&(g.value[0]<360&&(g.value[0]+=360),a.value[0]=g.value[0]+360);let f=new n.ref,x=0;for(a.value[0]<0&&(a.value[0]=360+a.value[0]),g.value[0]<0&&(g.value[0]=360+g.value[0]),a.value[0]<g.value[0]&&(a.value[0]=a.value[0]+360),f.value=new Array(1),x=0;x<=100;x++)f.value[0]=g.value[0]+x/100*(a.value[0]-g.value[0]),i=d.geodesic_coordinate(o,h,f.value[0]),t.push(i);Math.abs(k.value[0]-y)>1&&t.push(o),g.value[0]<a.value[0]?t.push(r):t.push(l)}catch(e){if(!(e instanceof Error))throw e;r.ErrorLogger.LogException(d._className,"GetGeodesicArc",new l.RendererException("Failed inside GetGeodesicArc",e))}return t}static GetGeodesicArc2(e,t){let i=!1;try{let o=new s.POINT2(e[0]),r=new s.POINT2(e[1]),l=new s.POINT2(e[2]),a=new n.ref,c=0,h=new n.ref,g=new n.ref;c=d.geodesic_distance(o,r,h,g);let k=g.value[0];d.geodesic_distance(o,l,a,g),Math.abs(g.value[0]-k)<=1&&(h.value[0]<360&&(h.value[0]+=360),a.value[0]=h.value[0]+360,i=!0);let y=new n.ref;y.value=new Array(1);let f=0,x=new s.POINT2;for(a.value[0]<0&&(a.value[0]=360+a.value[0]),h.value[0]<0&&(h.value[0]=360+h.value[0]),a.value[0]<h.value[0]&&(a.value[0]=a.value[0]+360),f=0;f<=100;f++)y.value[0]=h.value[0]+f/100*(a.value[0]-h.value[0]),x=d.geodesic_coordinate(o,c,y.value[0]),t.push(x)}catch(e){if(!(e instanceof Error))throw e;r.ErrorLogger.LogException(d._className,"GetGeodesicArc2",new l.RendererException("Failed inside GetGeodesicArc2",e))}return i}static IntersectLines(e,t,i,o){let n;try{let r=d.DegToRad(e.y),l=d.DegToRad(e.x),a=d.DegToRad(i.y),c=d.DegToRad(i.x),h=d.DegToRad(t),g=d.DegToRad(o),k=a-r,y=c-l,f=2*Math.asin(Math.sqrt(Math.sin(k/2)*Math.sin(k/2)+Math.cos(r)*Math.cos(a)*Math.sin(y/2)*Math.sin(y/2)));if(0===f)return null;let x=Math.acos((Math.sin(a)-Math.sin(r)*Math.cos(f))/(Math.sin(f)*Math.cos(r)));Number.isNaN(x)&&(x=0);let w=Math.acos((Math.sin(r)-Math.sin(a)*Math.cos(f))/(Math.sin(f)*Math.cos(a))),p=0,m=0;Math.sin(c-l)>0?(p=x,m=2*Math.PI-w):(p=2*Math.PI-x,m=w);let u=(h-p+Math.PI)%(2*Math.PI)-Math.PI,F=(m-g+Math.PI)%(2*Math.PI)-Math.PI;if(0===Math.sin(u)&&0===Math.sin(F))return null;if(Math.sin(u)*Math.sin(F)<0)return null;let S=Math.acos(-Math.cos(u)*Math.cos(F)+Math.sin(u)*Math.sin(F)*Math.cos(f)),_=Math.atan2(Math.sin(f)*Math.sin(u)*Math.sin(F),Math.cos(F)+Math.cos(u)*Math.cos(S)),L=Math.asin(Math.sin(r)*Math.cos(_)+Math.cos(r)*Math.sin(_)*Math.cos(h)),T=l+Math.atan2(Math.sin(h)*Math.sin(_)*Math.cos(r),Math.cos(_)-Math.sin(r)*Math.sin(L));T=(T+Math.PI)%(2*Math.PI)-Math.PI,n=new s.POINT2(d.RadToDeg(T),d.RadToDeg(L))}catch(e){if(!(e instanceof Error))throw e;r.ErrorLogger.LogException(d._className,"IntersectLines",new l.RendererException("Failed inside IntersectLines",e))}return n}static normalize_points(e){let t;try{if(null==e||0===e.length)return t;let i,o=0,s=e[0].x,n=s,r=!1,l=e.length;for(o=1;o<l;o++)i=e[o],i.x<s&&(s=i.x),i.x>n&&(n=i.x);if(n-s>180&&(r=!0),!r)return e;for(t=new Array,l=e.length,o=0;o<l;o++)i=e[o],i.x<0&&(i.x+=360),t.push(i)}catch(e){if(!(e instanceof Error))throw e;r.ErrorLogger.LogException(d._className,"normalize_pts",new l.RendererException("Failed inside normalize_pts",e))}return t}static geodesic_mbr(e){let t;try{if(null==e||0===e.length)return null;let i,n=d.normalize_points(e),r=n[0].x,l=r,a=n[0].y,c=a,h=0,g=n.length;for(h=1;h<g;h++)i=n[h],i.x<r&&(r=i.x),i.x>l&&(l=i.x),i.y>a&&(a=i.y),i.y<c&&(c=i.y);let k=new s.POINT2(r,a),y=new s.POINT2(l,a),f=new s.POINT2(l,c),x=d.geodesic_distance(k,y,null,null),w=d.geodesic_distance(y,f,null,null);t=new o.Rectangle2D(r,a,x,w)}catch(e){if(!(e instanceof Error))throw e;r.ErrorLogger.LogException(d._className,"geodesic_mbr",new l.RendererException("Failed inside geodesic_mbr",e))}return t}static geodesic_center(e){let t;try{if(null==e||0===e.length)return null;let i=d.geodesic_mbr(e),o=i.getWidth()/2,n=i.getHeight()/2,r=new s.POINT2(i.x,i.y),l=d.geodesic_coordinate(r,o,90);t=d.geodesic_coordinate(l,n,180)}catch(e){if(!(e instanceof Error))throw e;r.ErrorLogger.LogException(d._className,"geodesic_center",new l.RendererException("Failed inside geodesic_center",e))}return t}static geoRotatePoint(e,t,i){try{let o=d.GetAzimuth(e,t),s=d.geodesic_distance(e,t,null,null);return d.geodesic_coordinate(e,s,o+i)}catch(e){if(!(e instanceof Error))throw e;r.ErrorLogger.LogException(d._className,"geoRotatePoint",new l.RendererException("Failed inside geoRotatePoint",e))}return null}static getGeoEllipse(e,t,i,o){let n;try{let r;n=new Array(37);let l,a,c=0,h=0,g=0;for(let k=1;k<37;k++)c=10*k*Math.PI/180,h=t*Math.cos(c),g=i*Math.sin(c),l=d.geodesic_coordinate(e,h,90),a=d.geodesic_coordinate(e,g,0),r=new s.POINT2(l.x,a.y),n[k-1]=d.geoRotatePoint(e,r,-o);n[36]=new s.POINT2(n[0])}catch(e){if(!(e instanceof Error))throw e;r.ErrorLogger.LogException(d._className,"GetGeoEllipse",new l.RendererException("GetGeoEllipse",e))}return n}}t.mdlGeodesic=d},979:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.clsRenderer=void 0;const o=i(8087),s=i(628),n=i(7142),r=i(9441),l=i(7940),d=i(3170),a=i(8262),c=i(4571),h=i(1207),g=i(7389),k=i(5772),y=i(8101),f=i(8678),x=i(960),w=i(2493),p=i(3515),m=i(8113),u=i(4513),F=i(3247),S=i(7300),_=i(8003),L=i(6932),T=i(3874),M=i(106),A=i(3254),C=i(2421),E=i(2466),H=i(4546),G=i(921),I=i(8965),R=i(498),V=i(1024),W=i(8977);class P{static _className="clsRenderer";static setClientCoords(e,t){try{let i,o,s=new Array,n=0,r=e.getCoordinates(),l=r.length;for(n=0;n<l;n++)i=r[n],o=R.clsUtility.Point2DToPOINT2(i),s.push(o);t.set_LatLongs(s)}catch(t){if(!(t instanceof Error))throw t;S.ErrorLogger.LogException("clsRenderer","setClientCoords",new M.RendererException("Failed to set geo points or pixels for "+e.getSymbolID(),t))}}static getClientCoords(e){let t;try{let i,o,s=0;t=new Array;let n=e.LatLongs.length;for(s=0;s<n;s++)o=e.LatLongs[s],i=new r.Point2D(o.x,o.y),t.push(i)}catch(t){if(!(t instanceof Error))throw t;S.ErrorLogger.LogException("clsRenderer","getClientCoords",new M.RendererException("Failed to set geo points or pixels for "+e.get_SymbolId(),t))}return t}static createTGLightFromMilStdSymbolBasicShape(e,t,i){let o=new p.TGLight;try{let n=e.getUseLineInterpolation();o.set_UseLineInterpolation(n),o.set_LineType(i),o.get_Status(),o.set_VisibleModifiers(!0),P.setClientCoords(e,o),o.Pixels=R.clsUtility.LatLongToPixels(o.LatLongs,t);let l=A.RendererSettings.getInstance(),d=l.getMPLabelFontType(),a=l.getMPLabelFontName(),c=l.getMPLabelFontSize(),k=new s.Font(a,d,c);if(o.set_Font(k),o.set_FillColor(e.getFillColor()),o.set_LineColor(e.getLineColor()),o.set_LineThickness(e.getLineWidth()),o.set_TexturePaint(e.getFillStyle()),o.set_Fillstyle(e.getPatternFillType()),o.set_patternScale(e.getPatternScale()),o.setIconSize(e.getUnitSize()),o.set_KeepUnitRatio(e.getKeepUnitRatio()),o.set_FontBackColor(m.Color.WHITE),o.set_TextColor(e.getTextColor()),null!=e.getModifier(L.Modifiers.W_DTG_1)&&o.set_DTG(e.getModifier(L.Modifiers.W_DTG_1)),null!=e.getModifier(L.Modifiers.W1_DTG_2)&&o.set_DTG1(e.getModifier(L.Modifiers.W1_DTG_2)),null!=e.getModifier(L.Modifiers.H_ADDITIONAL_INFO_1)&&o.set_H(e.getModifier(L.Modifiers.H_ADDITIONAL_INFO_1)),null!=e.getModifier(L.Modifiers.H1_ADDITIONAL_INFO_2)&&o.set_H1(e.getModifier(L.Modifiers.H1_ADDITIONAL_INFO_2)),null!=e.getModifier(L.Modifiers.H2_ADDITIONAL_INFO_3)&&o.set_H2(e.getModifier(L.Modifiers.H2_ADDITIONAL_INFO_3)),null!=e.getModifier(L.Modifiers.T_UNIQUE_DESIGNATION_1)&&o.set_Name(e.getModifier(L.Modifiers.T_UNIQUE_DESIGNATION_1)),null!=e.getModifier(L.Modifiers.T1_UNIQUE_DESIGNATION_2)&&o.set_T1(e.getModifier(L.Modifiers.T1_UNIQUE_DESIGNATION_2)),null!=e.getModifier(L.Modifiers.V_EQUIP_TYPE)&&o.set_V(e.getModifier(L.Modifiers.V_EQUIP_TYPE)),null!=e.getModifier(L.Modifiers.AS_COUNTRY)&&o.set_AS(e.getModifier(L.Modifiers.AS_COUNTRY)),null!=e.getModifier(L.Modifiers.AP_TARGET_NUMBER)&&o.set_AP(e.getModifier(L.Modifiers.AP_TARGET_NUMBER)),null!=e.getModifier(L.Modifiers.Y_LOCATION)&&o.set_Location(e.getModifier(L.Modifiers.Y_LOCATION)),null!=e.getModifier(L.Modifiers.N_HOSTILE)&&o.set_N(e.getModifier(L.Modifiers.N_HOSTILE)),o.set_UseDashArray(e.getUseDashArray()),o.set_UseHatchFill(e.getUseFillPattern()),o.set_HideOptionalLabels(e.getHideOptionalLabels()),f.clsUtility.isClosedPolygon(i)&&(f.clsUtility.ClosePolygon(o.Pixels),f.clsUtility.ClosePolygon(o.LatLongs)),i==y.TacticalLines.BS_ELLIPSE){let i=e.getModifiers_AM_AN_X(L.Modifiers.AM_DISTANCE),s=e.getModifiers_AM_AN_X(L.Modifiers.AN_AZIMUTH),n=0,l=0;if(1==i.length?(n=i[0],i.push(n),i.push(0)):2==i.length&&(n=i[0],l=i[1],i[1]=n,i.push(l)),null==s&&(s=[]),s.length<1&&s.push(0),null!=i&&i.length>=2&&null!=s&&s.length>=1){let e=new g.POINT2(0,0);e.x=s[0];let n=o.Pixels[0],l=x.mdlGeodesic.geodesic_coordinate(o.LatLongs[0],i[0],90),d=x.mdlGeodesic.geodesic_coordinate(o.LatLongs[0],i[1],0),a=new r.Point2D(l.x,l.y),c=new r.Point2D(d.x,d.y);a=t.GeoToPixels(a),c=t.GeoToPixels(c),l=new g.POINT2(a.getX(),a.getY()),d=new g.POINT2(c.getX(),c.getY()),o.Pixels=[],o.Pixels.push(n),o.Pixels.push(l),o.Pixels.push(d),o.Pixels.push(e)}if(null!=i&&i.length>2){let e=i[2],s=x.mdlGeodesic.geodesic_coordinate(o.LatLongs[0],e,45),n=new r.Point2D(o.LatLongs[0].x,o.LatLongs[0].y),l=new r.Point2D(s.x,s.y);n=t.GeoToPixels(n),l=t.GeoToPixels(l),s=new g.POINT2(n.getX(),n.getY());let d=new g.POINT2(l.getX(),l.getY());e=h.lineutility.CalcDistanceDouble(s,d),o.Pixels[0].style=Math.trunc(e)}}let w=0;if(i==y.TacticalLines.BBS_RECTANGLE||i==y.TacticalLines.BS_BBOX){let e=o.LatLongs[0].y,s=o.LatLongs[0].y,n=o.LatLongs[0].x,r=o.LatLongs[0].x;for(w=1;w<o.LatLongs.length;w++)o.LatLongs[w].x<n&&(n=o.LatLongs[w].x),o.LatLongs[w].x>r&&(r=o.LatLongs[w].x),o.LatLongs[w].y<e&&(e=o.LatLongs[w].y),o.LatLongs[w].y>s&&(s=o.LatLongs[w].y);o.LatLongs=[],o.LatLongs.push(new g.POINT2(n,s)),o.LatLongs.push(new g.POINT2(r,s)),o.LatLongs.push(new g.POINT2(r,e)),o.LatLongs.push(new g.POINT2(n,e)),i==y.TacticalLines.BS_BBOX&&o.LatLongs.push(new g.POINT2(n,s)),o.Pixels=R.clsUtility.LatLongToPixels(o.LatLongs,t)}switch(i){case y.TacticalLines.BBS_AREA:case y.TacticalLines.BBS_LINE:case y.TacticalLines.BBS_RECTANGLE:let i,s,n=null,l=0,d=e.getModifiers_AM_AN_X(L.Modifiers.AM_DISTANCE);if(null!=d&&d.length>0&&(n=d[0].toString(),o.set_H2(n)),null!=n&&0!==n.length)for(w=0;w<o.LatLongs.length;w++)if(o.LatLongs.length>w)if(isNaN(parseFloat(n)))o.Pixels[w].style=0;else{if(0==w){l=parseFloat(n),i=new g.POINT2(o.LatLongs[0]),s=x.mdlGeodesic.geodesic_coordinate(i,l,45);let e=new r.Point2D(i.x,i.y),d=new r.Point2D(s.x,s.y);e=t.GeoToPixels(e),d=t.GeoToPixels(d),i.x=e.getX(),i.y=e.getY(),s.x=d.getX(),s.y=d.getY(),l=h.lineutility.CalcDistanceDouble(i,s)}o.Pixels[w].style=Math.round(l)}}if(i==y.TacticalLines.PBS_ELLIPSE){let t=e.getModifiers_AM_AN_X(L.Modifiers.AM_DISTANCE),i=e.getModifiers_AM_AN_X(L.Modifiers.AN_AZIMUTH);if(null!=t&&t.length>1){let e=t[0].toString();o.set_AM(e);let i=t[1].toString();o.set_AM1(i)}if(null!=i&&i.length>0){let e=i[0].toString();o.set_AN(e)}}switch(i){case y.TacticalLines.BBS_AREA:case y.TacticalLines.BBS_LINE:case y.TacticalLines.BBS_POINT:case y.TacticalLines.BBS_RECTANGLE:null==o.get_FillColor()&&o.set_FillColor(m.Color.LIGHT_GRAY)}switch(i){case y.TacticalLines.PBS_CIRCLE:case y.TacticalLines.BBS_POINT:let t=e.getModifiers_AM_AN_X(L.Modifiers.AM_DISTANCE);if(null!=t&&t.length>0){let e=String(t[0]);o.set_AM(e)}else if(i==y.TacticalLines.BBS_POINT&&o.LatLongs.length>1){let e=x.mdlGeodesic.geodesic_distance(o.LatLongs[0],o.LatLongs[1],null,null),t=String(e);o.set_T1(t)}}if(i==y.TacticalLines.PBS_RECTANGLE||i==y.TacticalLines.PBS_SQUARE){let t=e.getModifiers_AM_AN_X(L.Modifiers.AM_DISTANCE),s=e.getModifiers_AM_AN_X(L.Modifiers.AN_AZIMUTH);if(i==y.TacticalLines.PBS_SQUARE){let e=t[0],i=0;1==t.length?(t.push(e),t.push(i)):2==t.length?(i=t[1],t[1]=e,t.push(i)):t.length>2&&(t[1]=e)}if(i==y.TacticalLines.PBS_SQUARE){let e=t[0];1==t.length?t.push(e):t.length>=2&&(t[1]=e)}if(null==s&&(s=[]),0===s.length&&s.push(0),null!=t&&t.length>1){let e=String(t[0]),i=String(t[1]);o.set_AM(e),o.set_AM1(i);let n=String(s[0]);o.set_AN(n)}}}catch(e){if(!(e instanceof Error))throw e;S.ErrorLogger.LogException("clsRenderer","createTGLightFromBasicMilStdSymbol",new M.RendererException("Failed to build multipoint TG for "+i,e))}return o}static createMilStdSymboFromTGLight(e,t){let i;try{let o=e.get_SymbolId(),n=f.clsUtility.GetLinetypeFromString(o);e.get_Status(),e.Pixels=R.clsUtility.LatLongToPixels(e.LatLongs,t),f.clsUtility.isClosedPolygo