@brownnrl/geomlib 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/bundle.js CHANGED
@@ -1,2 +1,2 @@
1
- var geomlib;(()=>{"use strict";var t={1454(t,n){function e(){var t=s(Math.random(),Math.random(),1);return"rgb(".concat(t.r,",").concat(t.g,",").concat(t.b,")")}function o(t){var n=i(t);if(null==n)return t;var e=.7,o=Math.ceil(1/(1-e)),r=0===n.r?o:Math.min(Math.floor(n.r/e),255),s=0===n.g?o:Math.min(Math.floor(n.g/e),255),u=0===n.b?o:Math.min(Math.floor(n.b/e),255);return r<o&&(r=o),s<o&&(s=o),u<o&&(u=o),"rgb(".concat(r,",").concat(s,",").concat(u,")")}function r(t){var n=i(t);if(null==n)return t;var e=Math.floor(.7*n.r),o=Math.floor(.7*n.g),r=Math.floor(.7*n.b);return"rgb(".concat(e,",").concat(o,",").concat(r,")")}function i(t){if(null==t)return null;var e=t.match(/^rgb\((\d+),(\d+),(\d+)\)$/);if(e)return{r:parseInt(e[1]),g:parseInt(e[2]),b:parseInt(e[3])};if(t in n.colors)return i(n.colors[t]);var o=t.replace(/^#/,"");if(/^[0-9a-fA-F]{6}$/.test(o)){var r=parseInt(o,16);return{r:r>>16&255,g:r>>8&255,b:255&r}}var u=t.split(",");if(3===u.length){var c=parseInt(u[0])/360,l=parseInt(u[1])/100,a=parseInt(u[2])/100;if(!isNaN(c)&&!isNaN(l)&&!isNaN(a))return s(c,l,a)}return null}function s(t,n,e){var o,r,i,s=Math.floor(6*t),u=6*t-s,c=e*(1-n),l=e*(1-u*n),a=e*(1-(1-u)*n);switch(s%6){case 0:o=e,r=a,i=c;break;case 1:o=l,r=e,i=c;break;case 2:o=c,r=e,i=a;break;case 3:o=c,r=l,i=e;break;case 4:o=a,r=c,i=e;break;case 5:o=e,r=c,i=l}return{r:Math.round(255*o),g:Math.round(255*r),b:Math.round(255*i)}}Object.defineProperty(n,"__esModule",{value:!0}),n.colors=void 0,n.parseColor=function(t,i,u){if(0===t)return null;if(null==t)return i;var c=String(t);if("none"===c||"0"===c||""===c)return null;if("random"===c)return e();if("background"===c)return u;if("brighter"===c)return o(u);if("darker"===c)return r(u);if(c in n.colors)return n.colors[c];var l=c.replace(/^#/,"");if(/^[0-9a-fA-F]+$/.test(l)){var a=parseInt(l,16);if(!isNaN(a)){var h=a>>8&255,p=255&a;return"rgb(".concat(a>>16&255,",").concat(h,",").concat(p,")")}}var f=c.split(",");if(3===f.length){var _=parseInt(f[0])/360,y=parseInt(f[1])/100;if(p=parseInt(f[2])/100,!isNaN(_)&&!isNaN(y)&&!isNaN(p)){var d=s(_,y,p);return"rgb(".concat(d.r,",").concat(d.g,",").concat(d.b,")")}}return null},n.randomColor=e,n.brighter=o,n.darker=r,n.lighten=function(t){return o(t)},n.darken=function(t){return r(t)},n.colors={black:"rgb(0,0,0)",blue:"rgb(0,0,255)",cyan:"rgb(0,255,255)",darkGray:"rgb(64,64,64)",gray:"rgb(128,128,128)",green:"rgb(0,255,0)",lightGray:"rgb(192,192,192)",magenta:"rgb(255,0,255)",orange:"rgb(255,200,0)",pink:"rgb(255,175,175)",red:"rgb(255,0,0)",white:"rgb(255,255,255)",yellow:"rgb(255,255,0)"}},8041(t,n,e){var o=this&&this.__spreadArray||function(t,n,e){if(e||2===arguments.length)for(var o,r=0,i=n.length;r<i;r++)!o&&r in n||(o||(o=Array.prototype.slice.call(n,0,r)),o[r]=n[r]);return t.concat(o||Array.prototype.slice.call(n))};Object.defineProperty(n,"__esModule",{value:!0}),n.Slate=void 0;var r=e(6055),i=e(6401),s=e(7658),u=e(6091),c=e(2145),l=function(){function t(n){var e=this;if(this._htmlCanvas=null,this.inTest=!1,this._itsNumSlate=-1,t.numSlate+=1,this._itsNumSlate=t.numSlate,this._elements=[],this._elementsForUpdate=[],null==n)throw new TypeError("canvas cannot be null or undefined.");this._canvas=n;var s=new i.FixedPoint({x:0,y:0,z:0});s.name="screen_origin";var u=new i.FixedPoint({x:1,y:0,z:0});u.name="screen_x";var c=new i.FixedPoint({x:0,y:1,z:0});c.name="screen_y";var l=new r.PlaneElement({A:s,B:u,C:c});l.name="screen",l.nameColor=null,l.isScreen=!0,this._screen=l,this._pick=null;for(var a=0,h=[s,u,c,l];a<h.length;a++){var p=h[a];p.nameColor=null,p.vertexColor=null,p.vertexHighlightColor=null,p.faceColor=null,p.faceHighlightColor=null,this._elements.push(p)}this._elementsForUpdate=o([],this._elements,!0);var f=this,_=this._canvas;if(this._htmlCanvas=_,null!=this._htmlCanvas.addEventListener){this._htmlCanvas.addEventListener("mousedown",(function(t){var n=e._getCanvasPosition(t.clientX,t.clientY),o=n[0],r=n[1];f._onMouseDown(o,r)})),this._htmlCanvas.addEventListener("mouseup",(function(t){var n=e._getCanvasPosition(t.clientX,t.clientY),o=n[0],r=n[1];f._onMouseUp(o,r)})),this._htmlCanvas.addEventListener("mousemove",(function(t){var n=e._getCanvasPosition(t.clientX,t.clientY),o=n[0],r=n[1];f._onMouseDrag(o,r)}));for(var y=function(t,n){d._htmlCanvas.addEventListener(t,(function(t){var e=f._getTouchPos(t),o=new MouseEvent(n,{clientX:e[0],clientY:e[1]});f._htmlCanvas.dispatchEvent(o)}))},d=this,v=0,g=[["touchend","mouseup"],["touchstart","mousedown"],["touchmove","mousemove"]];v<g.length;v++){var P=g[v];y(P[0],P[1])}for(var C=0,m=["touchstart","touchmove","touchend"];C<m.length;C++){var w=m[C];document.body.addEventListener(w,(function(t){t.target==f._htmlCanvas&&t.preventDefault()}),!1)}}}return t.prototype._getTouchPos=function(t){if(null!=this._htmlCanvas){var n=this._htmlCanvas.getBoundingClientRect();return[t.touches[0].clientX-n.left,t.touches[0].clientY-n.top]}},t.prototype._getCanvasPosition=function(t,n){var e=this._htmlCanvas.getBoundingClientRect();return[t-e.left,n-e.top]},t.prototype._onMouseDown=function(t,n){this._pick=null,this.movePick(t,n)},t.prototype._onMouseUp=function(t,n){null!=this._pick&&(this.movePick(t,n),this._pick=null)},t.prototype._onMouseDrag=function(t,n){null!=this._pick&&this.movePick(t,n)},Object.defineProperty(t.prototype,"elements",{get:function(){return this._elements},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"elementsForUpdate",{get:function(){return this._elementsForUpdate},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"bgcolor",{get:function(){return this._bgcolor},set:function(t){this._bgcolor=t},enumerable:!1,configurable:!0}),t.prototype.lookupElement=function(t){for(var n=0,e=this._elements;n<e.length;n++){var o=e[n];if(o.name==t)return o}return null},t.prototype.convertParams=function(t){for(var n=[],e=[],o=[],r=0,i=t;r<i.length;r++){var s=i[r];switch(typeof s){case"string":var l=this.lookupElement(s);if(null==l)throw new TypeError("Element with name ".concat(s," not found."));l instanceof u.PointElement?n.push(l):l instanceof c.LineElement?(n.push(l.A),n.push(l.B)):e.push(l);break;case"number":o.push(s);break;default:throw new TypeError("Expecting only named elements (strings) or numbers.")}}return{P:n,E:e,N:o}},t.prototype.findConstruction=function(t,n){for(var e=0,o=s.constructions;e<o.length;e++){var r=o[e];if(r.validateSignature(t,n))return r}return null},t.prototype.createElement=function(t,n,e){var o=this.convertParams(n),r=this.findConstruction(t,o);if(null==r){var i=(0,s.getConstructionName)(t);throw null==e&&(e=""),new TypeError('Construction not found for "'.concat(e,'" ').concat(i," with params P=[").concat(o.P,"] E=[").concat(o.E,"] N=[").concat(o.N,"]"))}var u=r.construct(this._screen,o.P,o.E,o.N),c=u[0],l=u[1];-1!==this._elements.indexOf(l)&&(l.preexists=!0),null!=e&&(l.name=e);for(var a=0,h=c;a<h.length;a++){var p=h[a];-1==this._elementsForUpdate.indexOf(p)&&this._elementsForUpdate.push(p),-1==this._elements.indexOf(p)&&this._elements.push(p)}return-1==this._elements.indexOf(l)&&this._elements.push(l),l},t.prototype.reset=function(){for(var t=0,n=this._elements;t<n.length;t++)n[t].reset();this.update()},t.prototype.update=function(){for(var t=0,n=this._elementsForUpdate;t<n.length;t++)n[t].update();this.drawElements()},t.prototype.drawElements=function(){if(!this.inTest){var t=this._canvas.width,n=this._canvas.height,e=this._canvas.getContext("2d");e.clearRect(0,0,t,n),e.fillStyle=this._bgcolor,e.fillRect(0,0,t,n);for(var o=0,r=this._elements;o<r.length;o++)r[o].drawFace(this._canvas);for(var i=0,s=this._elements;i<s.length;i++)s[i].drawEdge(this._canvas);for(var u=0,c=this._elements;u<c.length;u++)c[u].drawVertex(this._canvas);for(var l=0,a=this._elements;l<a.length;l++)a[l].drawName(this._canvas)}},t.prototype.updateCoordinates=function(t){for(++t;t<this._elements.length;t++)this._elements[t].defined()||this._elements[t].reset(),this._elements[t].update();this.drawElements()},t.prototype.translateCoordinates=function(t,n){for(var e=0;e<this._elements.length;e++){var o=this._elements[e];o.preexists||o.translate(t,n)}this.update()},t.prototype.closestVisiblePoint=function(t,n,e){void 0===e&&(e=30);var o=function(t,n){return(t.x-n.x)*(t.x-n.x)+(t.y-n.y)*(t.y-n.y)},r=t.filter((function(t){return t instanceof u.PointElement})).map((function(t){return t})).filter((function(t){return null!=t.vertexColor})).sort((function(t,e){var r=o(t,n),i=o(e,n);return r<i?-1:i<r?1:0}));if(0==r.length)return null;var i=r[0];return Math.sqrt(o(i,n))>e?null:i},t.prototype._getPick=function(t,n){if(null!=this._pick)return this._pick;var e=new u.PointElement({x:t,y:n}),o=this.closestVisiblePoint(this._elements,e);return null!=o?(this._pick=o,this._pick):void 0},t.prototype.setPivot=function(t){var n=t.split(","),e=n[0].trim(),o=this.lookupElement(e);if(null!=o&&o instanceof u.PointElement){var i=o;if(n.length>1){var s=n[1].trim(),c=this.lookupElement(s);if(null==c||!(c instanceof r.PlaneElement))return;c.pivot=i}else i._AP=this._screen,this._screen.pivot=i}},t.prototype.movePick=function(t,n){if(null!=this._getPick(t,n)){var e=this._elements.indexOf(this._pick),o=this._canvas.width;t<0?t=0:t>o&&(t=o);var r=this._canvas.height;if(n<0?n=0:n>r&&(n=r),!(Math.abs(t-this._pick.x)+Math.abs(n-this._pick.y)<1)){if(this._pick.draggable){if(!this._pick.drag(t,n))return;this.updateCoordinates(e)}else if(null!=this._pick.AP&&null!=this._pick.AP.pivot&&this._pick.AP.pivot!=this._pick)this.rotateCoordinates(t,n);else{var i=t-this._pick.x,s=n-this._pick.y;this.translateCoordinates(i,s)}this.drawElements()}}},t.prototype.rotateCoordinates=function(t,n){for(var e=this._pick,o=e.AP.pivot,r=u.PointElement.difference(e,o),i=t-o.x,s=n-o.y,c=e.AP.S,l=e.AP.T,a=u.PointElement.dot(r,c),h=u.PointElement.dot(r,l),p=c.x*l.y-c.y*l.x,f=(i*l.y-s*l.x)/p,_=(s*c.x-i*c.y)/p,y=(f*a+_*h)/(p=a*a+h*h),d=(_*a-f*h)/p,v=0,g=this._elements;v<g.length;v++){var P=g[v];P.preexists||P.rotate(o,y,d)}this.update()},t.numSlate=0,t}();n.Slate=l},3267(t,n){Object.defineProperty(n,"__esModule",{value:!0}),n.createControls=function(t,n,e){n.parentElement&&new o(t,n,e).init()};var e=20,o=function(){function t(t,n,e){this._maximized=!1,this._savedStyles=null,this._slate=t,this._canvas=n,this._config=e}return t.prototype.init=function(){this._wrapper=this.createWrapper(),this.createButtons(),this.addKeyboardShortcuts()},t.prototype.createWrapper=function(){var t=this,n=document.createElement("div");return n.style.position="relative",n.style.display="inline-block",this._canvas.parentElement.insertBefore(n,this._canvas),n.appendChild(this._canvas),this._canvas.setAttribute("tabindex","0"),this._canvas.style.outline="none",this._canvas.addEventListener("focus",(function(){t._canvas.style.outline="2px solid rgba(66,133,244,0.5)"})),this._canvas.addEventListener("blur",(function(){t._canvas.style.outline="none"})),n},t.prototype.createButtons=function(){for(var t=this,n=[{draw:r,action:function(){return t.onReset()},title:"Reset (r)"},{draw:i,action:function(){return t.onMaximize()},title:"Maximize (m)"},{draw:s,action:function(){return t.onNewWindow()},title:"New Window (u)"}],o=function(o){var r=document.createElement("button");r.style.position="absolute",r.style.top="8px",r.style.right=8+24*o+"px",r.style.width="20px",r.style.height="20px",r.style.padding="0",r.style.border="none",r.style.cursor="pointer",r.style.background="rgba(0,0,0,0.12)",r.style.borderRadius="3px",r.title=n[o].title,r.addEventListener("mouseenter",(function(){r.style.background="rgba(0,0,0,0.3)"})),r.addEventListener("mouseleave",(function(){r.style.background="rgba(0,0,0,0.12)"}));var i=document.createElement("canvas");i.width=e,i.height=e,i.style.display="block";var s=i.getContext("2d");n[o].draw(s,e),r.appendChild(i),r.addEventListener("click",(function(e){e.stopPropagation(),n[o].action(),t._canvas.focus()})),1===o&&(u._maxBtn=r,u._maxIconCanvas=i),u._wrapper.appendChild(r)},u=this,c=0;c<n.length;c++)o(c)},t.prototype.addKeyboardShortcuts=function(){var t=this;this._canvas.addEventListener("keydown",(function(n){switch(n.key){case"r":case"R":case" ":n.preventDefault(),t.onReset();break;case"u":case"U":case"Enter":n.preventDefault(),t.onNewWindow();break;case"m":case"M":n.preventDefault(),t.onMaximize()}}))},t.prototype.onReset=function(){this._slate.reset()},t.prototype.onMaximize=function(){this._maximized?this.minimize():this.maximize()},t.prototype.maximize=function(){this._savedStyles={wrapperPosition:this._wrapper.style.position,wrapperTop:this._wrapper.style.top,wrapperLeft:this._wrapper.style.left,wrapperWidth:this._wrapper.style.width,wrapperHeight:this._wrapper.style.height,wrapperZIndex:this._wrapper.style.zIndex,wrapperBackground:this._wrapper.style.background,canvasStyleWidth:this._canvas.style.width,canvasStyleHeight:this._canvas.style.height,canvasAttrWidth:this._canvas.width,canvasAttrHeight:this._canvas.height},this._wrapper.style.position="fixed",this._wrapper.style.top="0",this._wrapper.style.left="0",this._wrapper.style.width="100vw",this._wrapper.style.height="100vh",this._wrapper.style.zIndex="9999",this._wrapper.style.background="white",this._canvas.style.width="100%",this._canvas.style.height="100%",this.resizeAndRedraw(),this._maximized=!0,this.updateMaximizeIcon()},t.prototype.minimize=function(){this._savedStyles&&(this._wrapper.style.position=this._savedStyles.wrapperPosition,this._wrapper.style.top=this._savedStyles.wrapperTop,this._wrapper.style.left=this._savedStyles.wrapperLeft,this._wrapper.style.width=this._savedStyles.wrapperWidth,this._wrapper.style.height=this._savedStyles.wrapperHeight,this._wrapper.style.zIndex=this._savedStyles.wrapperZIndex,this._wrapper.style.background=this._savedStyles.wrapperBackground,this._canvas.style.width=this._savedStyles.canvasStyleWidth,this._canvas.style.height=this._savedStyles.canvasStyleHeight,this._canvas.width=this._savedStyles.canvasAttrWidth,this._canvas.height=this._savedStyles.canvasAttrHeight,this.resizeAndRedraw(),this._maximized=!1,this._savedStyles=null,this.updateMaximizeIcon())},t.prototype.resizeAndRedraw=function(){var t=this._canvas.clientWidth,n=this._canvas.clientHeight;this._canvas.width===t&&this._canvas.height===n||(this._canvas.width=t,this._canvas.height=n),this._slate.update()},t.prototype.updateMaximizeIcon=function(){var t=this._maxIconCanvas,n=this._maxBtn;if(t){var o=t.getContext("2d");o.clearRect(0,0,e,e),this._maximized?(function(t){var n=12;t.strokeStyle="rgba(0,0,0,0.7)",t.fillStyle="rgba(0,0,0,0.7)",t.lineWidth=1.5;var e=16,o=4,r=4+.55*n,i=9.4;t.beginPath(),t.moveTo(e,o),t.lineTo(r,i),t.stroke(),t.beginPath(),t.moveTo(r,i),t.lineTo(r+5,i),t.lineTo(r,i-5),t.closePath(),t.fill(),e=4,o=16,r=9.4,i=4+.55*n,t.beginPath(),t.moveTo(e,o),t.lineTo(r,i),t.stroke(),t.beginPath(),t.moveTo(r,i),t.lineTo(r-5,i),t.lineTo(r,i+5),t.closePath(),t.fill()}(o),n.title="Minimize (m)"):(i(o,e),n.title="Maximize (m)")}},t.prototype.onNewWindow=function(){for(var t=document.querySelectorAll("script[src]"),n="bundle.js",e=0;e<t.length;e++){var o=t[e].src;if(o.indexOf("bundle.js")>=0){n=o;break}}var r=Object.assign({},this._config,{canvasid:"canvasId"}),i=JSON.stringify(r),s=this._config.title||"Geometry",u="<!DOCTYPE html>\n<html><head><title>".concat(s,'</title></head>\n<body style="margin:0;padding:0;overflow:hidden;">\n<canvas id="canvasId" style="width:100vw;height:100vh;"></canvas>\n<script src="').concat(n,'"><\/script>\n<script>geomlib.init(').concat(i,");<\/script>\n</body></html>"),c=window.open("","_blank");c&&(c.document.write(u),c.document.close())},t}();function r(t,n){var e=n/2,o=n/2,r=.32*n;t.strokeStyle="rgba(0,0,0,0.7)",t.fillStyle="rgba(0,0,0,0.7)",t.lineWidth=1.5,t.beginPath(),t.arc(e,o,r,.5*-Math.PI,.75*Math.PI),t.stroke();var i=.75*Math.PI,s=e+r*Math.cos(i),u=o+r*Math.sin(i),c=i+.3*Math.PI,l=i+.9*Math.PI;t.beginPath(),t.moveTo(s,u),t.lineTo(s+4*Math.cos(c),u+4*Math.sin(c)),t.lineTo(s+4*Math.cos(l),u+4*Math.sin(l)),t.closePath(),t.fill()}function i(t,n){var e=n-8;t.strokeStyle="rgba(0,0,0,0.7)",t.fillStyle="rgba(0,0,0,0.7)",t.lineWidth=1.5;var o=4+.55*e,r=4+.45*e,i=4+e,s=4;t.beginPath(),t.moveTo(o,r),t.lineTo(i,s),t.stroke(),t.beginPath(),t.moveTo(i,s),t.lineTo(i-5,s),t.lineTo(i,s+5),t.closePath(),t.fill(),o=4+.45*e,r=4+.55*e,i=4,s=4+e,t.beginPath(),t.moveTo(o,r),t.lineTo(i,s),t.stroke(),t.beginPath(),t.moveTo(i,s),t.lineTo(i+5,s),t.lineTo(i,s-5),t.closePath(),t.fill()}function s(t,n){var e=n-8;t.strokeStyle="rgba(0,0,0,0.7)",t.fillStyle="rgba(0,0,0,0.7)",t.lineWidth=1.5;var o=4+.3*e,r=.65*e,i=.7*e;t.strokeRect(4,o,r,i);var s=4+.4*e,u=4+.6*e,c=4+e;t.beginPath(),t.moveTo(s,u),t.lineTo(c,4),t.stroke(),t.beginPath(),t.moveTo(c,4),t.lineTo(c-5,4),t.lineTo(c,9),t.closePath(),t.fill()}},7658(t,n,e){var o,r,i,s,u,c,l,a,h,p=this&&this.__spreadArray||function(t,n,e){if(e||2===arguments.length)for(var o,r=0,i=n.length;r<i;r++)!o&&r in n||(o||(o=Array.prototype.slice.call(n,0,r)),o[r]=n[r]);return t.concat(o||Array.prototype.slice.call(n))};Object.defineProperty(n,"__esModule",{value:!0}),n.constructions=n.Construction=n.E=n.PolyhedraConstructions=n.SphereConstructions=n.PlaneConstructions=n.SectorConstructions=n.PolygonConstructions=n.CircleConstructions=n.LineConstructions=n.PointConstructions=n.ConstructionTypes=void 0,n.getConstructionName=function(t){return t<100?"Point."+r[t]:100<t&&t<200?"Line."+i[t]:300<t&&t<400?"Polygon."+u[t]:400<t&&t<500?"Sector."+c[t]:500<t&&t<600?"Plane."+l[t]:600<t&&t<700?"Sphere."+a[t]:700<t&&t<800?"Polyhedra."+h[t]:"<Not Valid Construction>"},function(t){t[t.Integer=0]="Integer",t[t.PointElement=1]="PointElement",t[t.CircleElement=2]="CircleElement",t[t.PlaneElement=3]="PlaneElement",t[t.SphereElement=4]="SphereElement",t[t.PolygonElement=5]="PolygonElement",t[t.PolyhedronElement=6]="PolyhedronElement"}(o||(n.ConstructionTypes=o={})),function(t){t[t.free=1]="free",t[t.midpoint=2]="midpoint",t[t.intersection=3]="intersection",t[t.first=4]="first",t[t.last=5]="last",t[t.center=6]="center",t[t.lineSlider=7]="lineSlider",t[t.circleSlider=8]="circleSlider",t[t.circumcenter=9]="circumcenter",t[t.vertex=10]="vertex",t[t.foot=11]="foot",t[t.cutoff=12]="cutoff",t[t.extend=13]="extend",t[t.parallelogram=14]="parallelogram",t[t.similar=15]="similar",t[t.perpendicular=16]="perpendicular",t[t.proportion=17]="proportion",t[t.invert=18]="invert",t[t.meanProportional=19]="meanProportional",t[t.planeSlider=20]="planeSlider",t[t.sphereSlider=21]="sphereSlider",t[t.angleBisector=22]="angleBisector",t[t.angleDivider=23]="angleDivider",t[t.fixed=24]="fixed",t[t.lineSegmentSlider=25]="lineSegmentSlider",t[t.harmonic=26]="harmonic"}(r||(n.PointConstructions=r={})),function(t){t[t.connect=101]="connect",t[t.angleBisector=102]="angleBisector",t[t.angleDivider=103]="angleDivider",t[t.foot=104]="foot",t[t.chord=105]="chord",t[t.bichord=106]="bichord",t[t.perpendicular=107]="perpendicular",t[t.cutoff=108]="cutoff",t[t.extend=109]="extend",t[t.parallel=110]="parallel",t[t.similar=111]="similar",t[t.proportion=112]="proportion",t[t.meanProportional=113]="meanProportional"}(i||(n.LineConstructions=i={})),function(t){t[t.radius=201]="radius",t[t.circumcircle=202]="circumcircle",t[t.invert=203]="invert",t[t.intersection=204]="intersection"}(s||(n.CircleConstructions=s={})),function(t){t[t.square=301]="square",t[t.triangle=302]="triangle",t[t.quadrilateral=303]="quadrilateral",t[t.pentagon=304]="pentagon",t[t.hexagon=305]="hexagon",t[t.equilateralTriangle=306]="equilateralTriangle",t[t.parallelogram=307]="parallelogram",t[t.regularPolygon=308]="regularPolygon",t[t.starPolygon=309]="starPolygon",t[t.similar=310]="similar",t[t.application=311]="application",t[t.octagon=312]="octagon",t[t.face=313]="face"}(u||(n.PolygonConstructions=u={})),function(t){t[t.sector=401]="sector",t[t.arc=402]="arc"}(c||(n.SectorConstructions=c={})),function(t){t[t.threePoints=501]="threePoints",t[t.perpendicular=502]="perpendicular",t[t.parallel=503]="parallel",t[t.ambient=504]="ambient"}(l||(n.PlaneConstructions=l={})),function(t){t[t.radius=601]="radius"}(a||(n.SphereConstructions=a={})),function(t){t[t.tetrahedron=701]="tetrahedron",t[t.parallelepiped=702]="parallelepiped",t[t.prism=703]="prism",t[t.pyramid=704]="pyramid"}(h||(n.PolyhedraConstructions=h={})),n.E={Point:r,Line:i,Circle:s,Polygon:u,Sector:c,Plane:l,Sphere:a,Polyhedra:h};var f=function(){function t(){}return t.prototype.validateSignature=function(t,n){if(t!=this.constructionMethod)return!1;var e=this.signature;if(e.points!==n.P.length)return!1;if(e.elements!==n.E.length)return!1;if(e.integers!==n.N.length)return!1;if(e.elementTypes)for(var o=0;o<e.elementTypes.length;o++)if(!(n.E[o]instanceof e.elementTypes[o]))return!1;return!0},t}();n.Construction=f;var _=e(4461),y=e(7339),d=e(9275),v=e(4133),g=e(5755),P=e(5193),C=e(8649),m=e(1099);n.constructions=p(p(p(p(p(p(p(p([],_.pointConstructions,!0),y.lineConstructions,!0),d.circleConstructions,!0),g.sectorConstructions,!0),v.polygonConstructions,!0),P.planeConstructions,!0),C.sphereConstructions,!0),m.polyhedronConstructions,!0)},8020(t,n){var e;Object.defineProperty(n,"__esModule",{value:!0}),n.GeomElement=n.Align=void 0,function(t){t[t.CENTRAL=0]="CENTRAL",t[t.LEFT=1]="LEFT",t[t.RIGHT=2]="RIGHT",t[t.ABOVE=3]="ABOVE",t[t.BELOW=4]="BELOW"}(e||(n.Align=e={}));var o=function(){function t(){this.preexists=!1,this._nameColor=null,this._vertexColor=null,this._edgeColor=null,this._faceColor=null,this._nameHighlightColor="#FF0000",this._vertexHighlightColor="#FFFFFF",this._edgeHighlightColor="#FFFFFF",this._faceHighlightColor="#00FFFF",this._shouldHighlight=!1,this._pixelTolerance=50}return t.setFont=function(n,e){t._font="italic ".concat(e,"px ").concat(n)},t.prototype._getTextMetrics=function(t,n){var e=t.measureText(n);return[e.width,null!=e.actualBoundingBoxAscent?e.actualBoundingBoxAscent+e.actualBoundingBoxDescent:16]},t.prototype.drawString=function(n,o,r,i){var s=r.getContext("2d");if(null!=this._nameColor){s.font=t._font,s.fillStyle=this._nameColor;var u=this._getTextMetrics(s,this._name),c=u[0],l=u[1];switch(i||this._align){case e.LEFT:return n=n-c-6,o=o+l/2-4,void s.fillText(this._name,n,o);case e.RIGHT:return n+=2,o+=l/2-4,void s.fillText(this._name,n,o);case e.ABOVE:return n-=c/2,o+=-l/2+4,void s.fillText(this._name,n,o);case e.BELOW:return n-=c/2,o+=l/2+6,void s.fillText(this._name,n,o)}var a=r.width,h=r.height,p=(n-a/2)*h,f=(o-h/2)*a;f>p?f>=-p?(n-=c/2,o+=l/2+6,s.fillText(this._name,n,o)):(n=n-c-6,o+=l/2-4,s.fillText(this._name,n,o)):f>=-p?(n+=2,o+=l/2-4,s.fillText(this._name,n,o)):(n-=c/2,o+=-l/2+4,s.fillText(this._name,n,o))}},Object.defineProperty(t.prototype,"name",{get:function(){return this._name},set:function(t){this._name=t},enumerable:!1,configurable:!0}),t.prototype.reset=function(){this.update()},t.prototype.defined=function(){return!1},t.prototype.drag=function(t,n){return!1},Object.defineProperty(t.prototype,"nameColor",{get:function(){return this._nameColor},set:function(t){this._nameColor=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"edgeColor",{get:function(){return this._edgeColor},set:function(t){this._edgeColor=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"faceColor",{get:function(){return this._faceColor},set:function(t){this._faceColor=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"nameHighlightColor",{get:function(){return this._nameHighlightColor},set:function(t){this._nameHighlightColor=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"vertexHighlightColor",{get:function(){return this._vertexHighlightColor},set:function(t){this._vertexHighlightColor=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"edgeHighlightColor",{get:function(){return this._edgeHighlightColor},set:function(t){this._edgeHighlightColor=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"faceHighlightColor",{get:function(){return this._faceHighlightColor},set:function(t){this._faceHighlightColor=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"draggable",{get:function(){return this._draggable},set:function(t){this._draggable=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dimension",{get:function(){return this._dimension},set:function(t){this._dimension=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"align",{get:function(){return this._align},set:function(t){this._align=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"shouldHighlight",{get:function(){return this._shouldHighlight},set:function(t){this._shouldHighlight=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"vertexColor",{get:function(){return this._vertexColor},set:function(t){this._vertexColor=t},enumerable:!1,configurable:!0}),t._font="italic 18px Times New Roman",t}();n.GeomElement=o},9275(t,n,e){var o,r=this&&this.__extends||(o=function(t,n){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},o(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function e(){this.constructor=t}o(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)});Object.defineProperty(n,"__esModule",{value:!0}),n.circleConstructions=n.SphereIntersectionConstruction=n.InvertCircleConstruction=n.CircleRadius3PointConstruction=n.CircleRadiusCenterConstruction=void 0;var i=e(7658),s=e(1313),u=e(4021),c=e(8157),l=e(6055),a=e(2295),h=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.CircleConstructions.radius,n.signature={points:2,elements:0,integers:0},n}return r(n,t),n.prototype.validateSignature=function(t,n){return t===this.constructionMethod&&2===n.P.length&&0===n.N.length&&(0===n.E.length||1===n.E.length&&n.E[0]instanceof l.PlaneElement)},n.prototype.construct=function(t,n,e,o){var r=e.length>0?e[0]:t,i=new s.CircleElement({C:n[0],B:n[1],AP:r});return[[i],i]},n}(i.Construction);n.CircleRadiusCenterConstruction=h;var p=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.CircleConstructions.radius,n.signature={points:3,elements:0,integers:0},n}return r(n,t),n.prototype.validateSignature=function(t,n){return t===this.constructionMethod&&3===n.P.length&&0===n.N.length&&(0===n.E.length||1===n.E.length&&n.E[0]instanceof l.PlaneElement)},n.prototype.construct=function(t,n,e,o){var r=e.length>0?e[0]:t,i=new s.CircleElement({C:n[0],A:n[1],B:n[2],AP:r});return[[i],i]},n}(i.Construction);n.CircleRadius3PointConstruction=p;var f=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.CircleConstructions.invert,n.signature={points:0,elements:2,integers:0,elementTypes:[s.CircleElement,s.CircleElement]},n}return r(n,t),n.prototype.construct=function(t,n,e,o){var r=new u.InvertCircleElement(e[0],e[1]);return[[r],r]},n}(i.Construction);n.InvertCircleConstruction=f;var _=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.CircleConstructions.intersection,n.signature={points:0,elements:2,integers:0,elementTypes:[a.SphereElement,a.SphereElement]},n}return r(n,t),n.prototype.construct=function(t,n,e,o){var r=new c.SphereIntersectionElement(e[0],e[1]);return[[r],r]},n}(i.Construction);n.SphereIntersectionConstruction=_,n.circleConstructions=[new p,new h,new f,new _]},1313(t,n,e){var o,r=this&&this.__extends||(o=function(t,n){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},o(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function e(){this.constructor=t}o(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)});Object.defineProperty(n,"__esModule",{value:!0}),n.CircleElement=void 0;var i=e(8020),s=function(t){function n(n){var e=t.call(this)||this;return e.dimension=2,null==n||(e.Center=n.C,e.A=null!=n.A?n.A:e.Center,e.B=n.B,e.AP=n.AP),e}return r(n,t),Object.defineProperty(n.prototype,"radius",{get:function(){return this.A.distance(this.B)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"radius2",{get:function(){return this.A.distance2(this.B)},enumerable:!1,configurable:!0}),n.prototype.defined=function(){return!0},n.prototype._drawCircle=function(t){t.beginPath();var n=this.radius2,e=Math.sqrt(n),o=this.AP.S.z*this.AP.S.z+this.AP.T.z*this.AP.T.z;if(Math.abs(o)<.01)t.ellipse(this.Center.x,this.Center.y,e,e,0,0,2*Math.PI);else{var r=e/Math.sqrt(o),i=r*this.AP.T.z,s=-r*this.AP.S.z,u=i*this.AP.S.x+s*this.AP.T.x,c=i*this.AP.S.y+s*this.AP.T.y,l=o<1?Math.sqrt(1-o):0,a=-l*c,h=l*u,p=Math.sqrt(u*u+c*c),f=Math.sqrt(a*a+h*h);if(f<.5)return t.moveTo(this.Center.x-u,this.Center.y-c),void t.lineTo(this.Center.x+u,this.Center.y+c);var _=Math.atan2(c,u);t.ellipse(this.Center.x,this.Center.y,p,f,_,0,2*Math.PI)}},n.prototype.drawEdge=function(t){if(null!=this.edgeColor&&this.defined()){var n=t.getContext("2d");n.strokeStyle=this.edgeColor,this._drawCircle(n),n.stroke()}},n.prototype.drawFace=function(t){if(null!=this.faceColor&&this.defined()){var n=t.getContext("2d");n.fillStyle=this.faceColor,this._drawCircle(n),n.fill()}},n.prototype.drawName=function(t){if(null!=this.nameColor&&null!=this.name){var n=t.getContext("2d");n.strokeStyle=this.nameColor,n.font=i.GeomElement._font;var e=this._getTextMetrics(n,this.name),o=e[0],r=e[1];n.fillText(this._name,this.Center.x-o/2,this.Center.y-r/2)}},n.prototype.drawVertex=function(t){},n.prototype.rotate=function(t,n,e){},n.prototype.translate=function(t,n){},n.prototype.update=function(){},n}(i.GeomElement);n.CircleElement=s},2218(t,n,e){var o,r=this&&this.__extends||(o=function(t,n){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},o(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function e(){this.constructor=t}o(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)});Object.defineProperty(n,"__esModule",{value:!0}),n.CircumcircleElement=void 0;var i=e(6091),s=function(t){function n(n,e,o,r){var s=t.call(this)||this;return s.dimension=2,s.B=n,s.C=e,s.D=o,s.AP=r,s.Center=new i.PointElement({AP:r}),s.A=s.Center,s}return r(n,t),n.prototype.update=function(){this.Center.toCircumcenter(this.B,this.C,this.D)},n.prototype.translate=function(t,n){this.Center.translate(t,n)},n.prototype.rotate=function(t,n,e){this.Center.rotate(t,n,e)},n}(e(1313).CircleElement);n.CircumcircleElement=s},4021(t,n,e){var o,r=this&&this.__extends||(o=function(t,n){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},o(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function e(){this.constructor=t}o(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)});Object.defineProperty(n,"__esModule",{value:!0}),n.InvertCircleElement=void 0;var i=e(1313),s=e(6091),u=function(t){function n(n,e){var o=t.call(this)||this;return o.dimension=2,o._C=n,o._D=e,o.AP=n.AP,o.Center=new s.PointElement({AP:o.AP}),o.A=o.Center,o.B=new s.PointElement({AP:o.AP}),o}return r(n,t),n.prototype.update=function(){var t=this._C.Center.distance2(this._D.Center),n=this._C.radius2,e=this._D.radius2/(t-n);this.Center.to(this._C.Center).minus(this._D.Center).times(e).plus(this._D.Center),e=1+Math.sqrt(n/t),this.B.to(this.Center).minus(this._D.Center).times(e).plus(this._D.Center)},n.prototype.translate=function(t,n){this.Center.translate(t,n),this.B.translate(t,n)},n.prototype.rotate=function(t,n,e){this.Center.rotate(t,n,e),this.B.rotate(t,n,e)},n}(i.CircleElement);n.InvertCircleElement=u},8157(t,n,e){var o,r=this&&this.__extends||(o=function(t,n){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},o(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function e(){this.constructor=t}o(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)});Object.defineProperty(n,"__esModule",{value:!0}),n.SphereIntersectionElement=void 0;var i=e(1313),s=e(6091),u=e(103),c=function(t){function n(n,e){var o=t.call(this)||this;return o.dimension=2,o._S=n,o._T=e,o.Center=o.A=new s.PointElement,o.B=new s.PointElement,o.AP=new u.PerpendicularPlane({A:o.Center,E:e.Center}),o.Center._AP=o.AP,o}return r(n,t),n.prototype.update=function(){var t=this._T.Center.distance2(this._S.Center),n=this._T.radius2(),e=.5+(n-this._S.radius2())/(2*t);this.Center.to(this._S.Center).minus(this._T.Center).times(e).plus(this._T.Center);var o=Math.sqrt(n-this.Center.distance2(this._T.Center));this.B.to(this.Center),this.B.z+=o,this.AP.update()},n.prototype.translate=function(t,n){this.Center.translate(t,n),this.B.translate(t,n),this.AP.translate(t,n)},n.prototype.rotate=function(t,n,e){this.Center.rotate(t,n,e),this.B.rotate(t,n,e),this.AP.rotate(t,n,e)},n}(i.CircleElement);n.SphereIntersectionElement=c},5002(t,n,e){var o,r=this&&this.__extends||(o=function(t,n){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},o(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function e(){this.constructor=t}o(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)});Object.defineProperty(n,"__esModule",{value:!0}),n.Bichord=void 0;var i=e(2145),s=e(6091),u=function(t){function n(n){var e=t.call(this)||this;return e.dimension=1,null==n||(e._A=new s.PointElement,e._B=new s.PointElement,e.C=n.C,e.D=n.D,e._A._AP=e.C.AP,e._B._AP=e.C.AP),e}return r(n,t),n.prototype.translate=function(t,n){this._A.translate(t,n),this._B.translate(t,n)},n.prototype.rotate=function(t,n,e){this._A.rotate(t,n,e),this._B.rotate(t,n,e)},n.prototype.update=function(){var t=this.C.radius,n=this.D.radius,e=this.C.Center.distance(this.D.Center);if(e>t+n){var o=NaN;return this.A.x=o,this.A.y=o,this.A.z=o,this.B.x=o,this.B.y=o,void(this.B.z=o)}var r=(e*e+t*t-n*n)/(2*e*t),i=Math.sqrt(1-r*r);this.A.to(this.D.Center).toCircle(this.C),this.B.to(this.A),this.A.rotate(this.C.Center,r,i,this.C.AP),this.B.rotate(this.C.Center,r,-i,this.C.AP)},n}(i.LineElement);n.Bichord=u},1549(t,n,e){var o,r=this&&this.__extends||(o=function(t,n){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},o(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function e(){this.constructor=t}o(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)});Object.defineProperty(n,"__esModule",{value:!0}),n.Chord=void 0;var i=e(2145),s=e(6091),u=function(t){function n(n){var e=t.call(this)||this;return e.dimension=1,null==n||(e.C=n.C,e.D=n.D,e.E=n.E,e._A=new s.PointElement({AP:e.C.AP}),e._B=new s.PointElement({AP:e.C.AP})),e}return r(n,t),n.prototype.translate=function(t,n){this._A.translate(t,n),this._B.translate(t,n)},n.prototype.rotate=function(t,n,e){this._A.rotate(t,n,e),this._B.rotate(t,n,e)},n.prototype.update=function(){this._B.to(this.C.Center).toLine(this.D,this.E,!1);var t=this.C.Center.distance2(this._B),n=this.C.radius2;if(t>n){var e=NaN;return this._A.x=e,this._A.y=e,this._A.z=e,this._B.x=e,this._B.y=e,void(this._B.z=e)}var o=Math.sqrt(n-t),r=o/this.D.distance(this._B);r<1e10?this._A.to(this.D).minus(this._B).times(r).plus(this._B):(r=o/this.E.distance(this._B),this._A.to(this.E).minus(this._B).times(r).plus(this._B)),this._B.times(2).minus(this._A)},n}(i.LineElement);n.Chord=u},7339(t,n,e){var o,r=this&&this.__extends||(o=function(t,n){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},o(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function e(){this.constructor=t}o(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)});Object.defineProperty(n,"__esModule",{value:!0}),n.lineConstructions=n.MeanProportionalLineConstruction=n.ProportionLineConstruction=n.SimilarLineConstruction=n.LineParallelConstruction=n.LineExtendConstruction=n.LineCutoffConstruction=n.LinePerpendicular5Construction=n.LinePerpendicular4Construction=n.LinePerpendicular3Construction=n.LinePerpendicular2Construction=n.LinePerpendicular1Construction=n.BichordConstruction=n.ChordConstruction=n.PlaneFootLineConstruction=n.LineFootConstruction=n.AngleDividerLineConstruction=n.AngleBisectorLineConstruction=n.LineConnectConstruction=void 0;var i=e(7658),s=e(4461),u=e(1313),c=e(6055),l=e(2090),a=e(6921),h=e(3703),p=e(2145),f=e(5002),_=e(1549),y=e(5014),d=e(9535),v=e(9237),g=e(3219),P=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.LineConstructions.connect,n.signature={points:2,elements:0,integers:0},n}return r(n,t),n.prototype.construct=function(t,n,e,o){var r=new p.LineElement({A:n[0],B:n[1]});return[[r],r]},n}(i.Construction);n.LineConnectConstruction=P;var C=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.LineConstructions.angleBisector,n.signature={points:3,elements:0,integers:0},n}return r(n,t),n.prototype.validateSignature=function(t,n){return t===this.constructionMethod&&3===n.P.length&&0===n.N.length&&(0===n.E.length||1===n.E.length&&n.E[0]instanceof c.PlaneElement)},n.prototype.construct=function(t,n,e,o){var r=e.length>0?e[0]:t,i=new v.AngleDividerElement(n[0],n[1],n[2],r,2),s=new p.LineElement({A:n[1],B:i});return[[i,s],s]},n}(i.Construction);n.AngleBisectorLineConstruction=C;var m=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.LineConstructions.angleDivider,n.signature={points:3,elements:0,integers:1},n}return r(n,t),n.prototype.validateSignature=function(t,n){return t===this.constructionMethod&&3===n.P.length&&1===n.N.length&&(0===n.E.length||1===n.E.length&&n.E[0]instanceof c.PlaneElement)},n.prototype.construct=function(t,n,e,o){var r=e.length>0?e[0]:t,i=new v.AngleDividerElement(n[0],n[1],n[2],r,o[0]),s=new p.LineElement({A:n[1],B:i});return[[i,s],s]},n}(i.Construction);n.AngleDividerLineConstruction=m;var w=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.LineConstructions.foot,n.signature={points:3,elements:0,integers:0},n}return r(n,t),n.prototype.construct=function(t,n,e,o){var r=new a.Foot(n[0],n[1],n[2]),i=new p.LineElement({A:n[0],B:r});return[[r,i],i]},n}(i.Construction);n.LineFootConstruction=w;var x=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.LineConstructions.foot,n.signature={points:1,elements:1,integers:0,elementTypes:[c.PlaneElement]},n}return r(n,t),n.prototype.construct=function(t,n,e,o){var r=new h.PlaneFootElement(n[0],e[0]),i=new p.LineElement({A:n[0],B:r});return[[r,i],i]},n}(i.Construction);n.PlaneFootLineConstruction=x;var E=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.LineConstructions.chord,n.signature={points:2,elements:1,integers:0,elementTypes:[u.CircleElement]},n}return r(n,t),n.prototype.construct=function(t,n,e,o){var r=new _.Chord({D:n[0],E:n[1],C:e[0]});return[[r],r]},n}(i.Construction);n.ChordConstruction=E;var b=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.LineConstructions.bichord,n.signature={points:0,elements:2,integers:0,elementTypes:[u.CircleElement,u.CircleElement]},n}return r(n,t),n.prototype.construct=function(t,n,e,o){var r=new f.Bichord({C:e[0],D:e[1]});return[[r],r]},n}(i.Construction);function A(t){return[t[0],t[0][0]]}n.BichordConstruction=b;var S=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.LineConstructions.perpendicular,n}return r(n,t),n.prototype.construct=function(n,e,o,r){return A(t.prototype.construct.call(this,n,e,o,r))},n}(s.PointPerpendicular1Construction);n.LinePerpendicular1Construction=S;var O=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.LineConstructions.perpendicular,n}return r(n,t),n.prototype.construct=function(n,e,o,r){return A(t.prototype.construct.call(this,n,e,o,r))},n}(s.PointPerpendicular2Construction);n.LinePerpendicular2Construction=O;var M=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.LineConstructions.perpendicular,n}return r(n,t),n.prototype.construct=function(n,e,o,r){return A(t.prototype.construct.call(this,n,e,o,r))},n}(s.PointPerpendicular3Construction);n.LinePerpendicular3Construction=M;var T=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.LineConstructions.perpendicular,n}return r(n,t),n.prototype.construct=function(n,e,o,r){return A(t.prototype.construct.call(this,n,e,o,r))},n}(s.PointPerpendicular4Construction);n.LinePerpendicular4Construction=T;var j=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.LineConstructions.perpendicular,n}return r(n,t),n.prototype.construct=function(n,e,o,r){return A(t.prototype.construct.call(this,n,e,o,r))},n}(s.PointPerpendicular5Construction);n.LinePerpendicular5Construction=j;var B=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.LineConstructions.cutoff,n.signature={points:4,elements:0,integers:0},n}return r(n,t),n.prototype.construct=function(t,n,e,o){var r=new l.Layoff(n[0],n[0],n[1],n[2],n[3]),i=new p.LineElement({A:n[0],B:r});return[[r,i],i]},n}(i.Construction);n.LineCutoffConstruction=B;var z=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.LineConstructions.extend,n.signature={points:4,elements:0,integers:0},n}return r(n,t),n.prototype.construct=function(t,n,e,o){var r=new l.Layoff(n[1],n[0],n[1],n[2],n[3]),i=new p.LineElement({A:n[1],B:r});return[[r,i],i]},n}(i.Construction);n.LineExtendConstruction=z;var L=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.LineConstructions.parallel,n.signature={points:3,elements:0,integers:0},n}return r(n,t),n.prototype.construct=function(t,n,e,o){var r=new l.Layoff(n[0],n[1],n[2],n[1],n[2]),i=new p.LineElement({A:n[0],B:r});return[[r,i],i]},n}(i.Construction);n.LineParallelConstruction=L;var V=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.LineConstructions.similar,n.signature={points:5,elements:0,integers:0},n}return r(n,t),n.prototype.validateSignature=function(t,n){return t===this.constructionMethod&&5===n.P.length&&0===n.N.length&&(0===n.E.length||2===n.E.length)},n.prototype.construct=function(t,n,e,o){var r=e.length>0?e[0]:t,i=e.length>1?e[1]:t,s=new y.SimilarElement(n[0],n[1],r,n[2],n[3],n[4],i),u=new p.LineElement({A:n[0],B:s});return[[s,u],u]},n}(i.Construction);n.SimilarLineConstruction=V;var k=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.LineConstructions.proportion,n.signature={points:8,elements:0,integers:0},n}return r(n,t),n.prototype.construct=function(t,n,e,o){var r=new d.ProportionElement(n[0],n[1],n[2],n[3],n[4],n[5],n[6],n[7]),i=new p.LineElement({A:n[6],B:r});return[[r,i],i]},n}(i.Construction);n.ProportionLineConstruction=k;var F=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.LineConstructions.meanProportional,n.signature={points:6,elements:0,integers:0},n}return r(n,t),n.prototype.construct=function(t,n,e,o){var r=new g.MeanProportionalElement(n[0],n[1],n[2],n[3],n[4],n[5]),i=new p.LineElement({A:n[4],B:r});return[[r,i],i]},n}(i.Construction);n.MeanProportionalLineConstruction=F,n.lineConstructions=[new P,new z,new S,new O,new M,new T,new j,new b,new E,new L,new B,new x,new w,new V,new k,new C,new m,new F]},2145(t,n,e){var o,r=this&&this.__extends||(o=function(t,n){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},o(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function e(){this.constructor=t}o(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)});Object.defineProperty(n,"__esModule",{value:!0}),n.LineElement=void 0;var i=function(t){function n(n){var e=t.call(this)||this;return e.dimension=1,e._A=n&&n.A||null,e._B=n&&n.B||null,e}return r(n,t),Object.defineProperty(n.prototype,"A",{get:function(){return this._A},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"B",{get:function(){return this._B},enumerable:!1,configurable:!0}),n.prototype.drawEdge=function(t,n){if(null==n&&(n=this.shouldHighlight?this.edgeHighlightColor:this.edgeColor),null!=n){var e=t.getContext("2d");e.fillStyle=n,e.beginPath(),e.moveTo(this._A.x,this._A.y),e.lineTo(this._B.x,this._B.y),e.stroke()}},n.prototype.drawFace=function(t){},n.prototype.drawName=function(t){},n.prototype.drawVertex=function(t){},n.prototype.rotate=function(t,n,e){},n.prototype.translate=function(t,n){},n.prototype.update=function(){},n}(e(8020).GeomElement);n.LineElement=i},6279(t,n,e){var o,r=this&&this.__extends||(o=function(t,n){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},o(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function e(){this.constructor=t}o(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)});Object.defineProperty(n,"__esModule",{value:!0}),n.Perpendicular=void 0;var i=e(6091),s=function(t){function n(n){var e=t.call(this)||this;return e.dimension=1,null==n||(e._P=n.P,e._A=new i.PointElement({AP:n.P}),e._B=new i.PointElement({AP:n.P}),e._C=n.C,e._D=n.D,e._E=n.E,e._F=n.F),e}return r(n,t),n.prototype.rotate=function(t,n,e){this.A.rotate(t,n,e),this.B.rotate(t,n,e)},n.prototype.translate=function(t,n){this.A.translate(t,n),this.B.translate(t,n)},n.prototype.update=function(){this._A.to(this._C).toPlane(this._P),this._B.to(this._D).minus(this._A);var t=i.PointElement.dot(this.B,this._P.S),n=i.PointElement.dot(this.B,this._P.T),e=Math.sqrt(this._E.distance2(this._F)/(t*t+n*n));t=-t/e,n/=e,this._B.x=n*this._P.S.x+t*this._P.T.x+this._A.x,this._B.y=n*this._P.S.y+t*this._P.T.y+this._A.y,this._B.z=n*this._P.S.z+t*this._P.T.z+this._A.z},n}(e(2145).LineElement);n.Perpendicular=s},3375(t,n,e){var o,r=this&&this.__extends||(o=function(t,n){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},o(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function e(){this.constructor=t}o(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)});Object.defineProperty(n,"__esModule",{value:!0}),n.PlanePerpendicularLine=void 0;var i=e(6091),s=function(t){function n(n){var e=t.call(this)||this;return e.dimension=1,null==n||(e._A=new i.PointElement({AP:n.P}),e._B=new i.PointElement,e._C=n.C,e._D=n.D,e._E=n.E,e._P=n.P),e}return r(n,t),n.prototype.rotate=function(t,n,e){this.A.rotate(t,n,e),this.B.rotate(t,n,e)},n.prototype.translate=function(t,n){this.A.translate(t,n),this.B.translate(t,n)},n.prototype.update=function(){this._A.to(this._C).toPlane(this._P),this._B.toCross(this._P.S,this._P.T),this._B.times(this._D.distance(this._E)).plus(this._A)},n}(e(2145).LineElement);n.PlanePerpendicularLine=s},9362(t,n,e){var o,r=this&&this.__extends||(o=function(t,n){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},o(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function e(){this.constructor=t}o(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)});Object.defineProperty(n,"__esModule",{value:!0}),n.ParallelPlane=void 0;var i=e(6055),s=e(6091),u=function(t){function n(n,e){var o=t.call(this)||this;return o.dimension=2,o._P=n,o.A=e,o.B=new s.PointElement,o.C=new s.PointElement,o.S=n.S,o.T=n.T,o.U=n.U,o}return r(n,t),n.prototype.translate=function(t,n){this.B.translate(t,n),this.C.translate(t,n)},n.prototype.rotate=function(t,n,e){this.B.rotate(t,n,e),this.C.rotate(t,n,e)},n.prototype.update=function(){this.B.to(this._P.B).minus(this._P.A).plus(this.A),this.C.to(this._P.C).minus(this._P.A).plus(this.A)},n}(i.PlaneElement);n.ParallelPlane=u},103(t,n,e){var o,r=this&&this.__extends||(o=function(t,n){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},o(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function e(){this.constructor=t}o(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)});Object.defineProperty(n,"__esModule",{value:!0}),n.PerpendicularPlane=void 0;var i=e(6091),s=function(t){function n(n){var e=t.call(this)||this;return e.A=n.A,e.E=n.E,e.B=new i.PointElement({AP:e}),e.C=new i.PointElement({AP:e}),e.S=new i.PointElement,e.T=new i.PointElement,e}return r(n,t),n.prototype.translate=function(t,n){this.B.translate(t,n),this.C.translate(t,n)},n.prototype.rotate=function(n,e,o){this.B.rotate(n,e,o),this.C.rotate(n,e,o),t.prototype.update.call(this)},n.prototype.update=function(){this.U=i.PointElement.difference(this.E,this.A);var t=this.U.length();this.U.times(1/t);var n=Math.sqrt(this.U.x*this.U.x+this.U.y*this.U.y);n>=1e-6?(this.S.x=-this.U.y/n,this.S.y=this.U.x/n,this.T.toCross(this.U,this.S)):(this.S.x=1,this.S.y=0,this.S.z=0,this.T.x=0,this.T.y=1,this.T.z=0),this.B.to(this.S).times(t).plus(this.A),this.C.to(this.T).times(t).plus(this.A)},n}(e(6055).PlaneElement);n.PerpendicularPlane=s},5193(t,n,e){var o,r=this&&this.__extends||(o=function(t,n){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},o(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function e(){this.constructor=t}o(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)});Object.defineProperty(n,"__esModule",{value:!0}),n.planeConstructions=n.AmbientPlaneCircleConstruction=n.AmbientPlanePointConstruction=n.PlaneParallelConstruction=n.PerpendicularPlaneConstruction=n.Plane3PointsConstruction=void 0;var i=e(7658),s=e(1313),u=e(6055),c=e(103),l=e(9362),a=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.PlaneConstructions.threePoints,n.signature={points:3,elements:0,integers:0},n}return r(n,t),n.prototype.construct=function(t,n,e,o){var r=new u.PlaneElement({A:n[0],B:n[1],C:n[2]});return[[r],r]},n}(i.Construction);n.Plane3PointsConstruction=a;var h=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.PlaneConstructions.perpendicular,n.signature={points:2,elements:0,integers:0},n}return r(n,t),n.prototype.construct=function(t,n,e,o){var r=new c.PerpendicularPlane({A:n[0],E:n[1]});return[[r],r]},n}(i.Construction);n.PerpendicularPlaneConstruction=h;var p=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.PlaneConstructions.parallel,n.signature={points:1,elements:1,integers:0,elementTypes:[u.PlaneElement]},n}return r(n,t),n.prototype.construct=function(t,n,e,o){var r=new l.ParallelPlane(e[0],n[0]);return[[r],r]},n}(i.Construction);n.PlaneParallelConstruction=p;var f=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.PlaneConstructions.ambient,n.signature={points:1,elements:0,integers:0},n}return r(n,t),n.prototype.construct=function(t,n,e,o){return[[n[0]._AP],n[0]._AP]},n}(i.Construction);n.AmbientPlanePointConstruction=f;var _=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.PlaneConstructions.ambient,n.signature={points:0,elements:1,integers:0,elementTypes:[s.CircleElement]},n}return r(n,t),n.prototype.construct=function(t,n,e,o){var r=e[0];return[[r.AP],r.AP]},n}(i.Construction);n.AmbientPlaneCircleConstruction=_,n.planeConstructions=[new a,new h,new p,new f,new _]},6055(t,n,e){var o,r=this&&this.__extends||(o=function(t,n){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},o(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function e(){this.constructor=t}o(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)});Object.defineProperty(n,"__esModule",{value:!0}),n.PlaneElement=void 0;var i=e(8020),s=e(6091),u=function(t){function n(n){var e=t.call(this)||this;return e.dimension=2,e.isScreen=!1,null!=n&&(e.A=n.A,e.B=n.B,e.C=n.C,e.S=new s.PointElement,e.T=new s.PointElement,e.U=new s.PointElement),e}return r(n,t),n.prototype.defined=function(){return null!=this.A&&null!=this.B&&null!=this.C},n.prototype.drawEdge=function(t){if(null!=this.edgeColor&&this.defined()){var n=t.getContext("2d");n.save(),n.strokeStyle=this.edgeColor;var e=this.B.x+this.C.x-this.A.x,o=this.B.y+this.C.y-this.A.y;n.beginPath(),n.moveTo(this.A.x,this.A.y),n.lineTo(this.B.x,this.B.y),n.lineTo(e,o),n.lineTo(this.C.x,this.C.y),n.closePath(),n.stroke(),n.restore()}},n.prototype.drawFace=function(t){if(null!=this.faceColor&&this.defined()){var n=t.getContext("2d");n.save(),n.fillStyle=this.faceColor;var e=this.B.x+this.C.x-this.A.x,o=this.B.y+this.C.y-this.A.y;n.beginPath(),n.moveTo(this.A.x,this.A.y),n.lineTo(this.B.x,this.B.y),n.lineTo(e,o),n.lineTo(this.C.x,this.C.y),n.closePath(),n.fill(),n.restore()}},n.prototype.drawName=function(t){if(null!=this.nameColor&&null!=this.name&&this.defined()){var n=Math.round((this.B.x+this.C.x)/2),e=Math.round((this.B.y+this.C.y)/2);this.drawString(n,e,t)}},n.prototype.drawVertex=function(t){if(null!=this.vertexColor&&this.defined()){var n=t.getContext("2d"),e=this.B.x+this.C.x-this.A.x,o=this.B.y+this.C.y-this.A.y;n.beginPath(),n.fillStyle=this.vertexColor,n.arc(e,o,2,0,2*Math.PI,!1),n.fill()}},n.prototype.rotate=function(t,n,e){this.update()},n.prototype.translate=function(t,n){},n.prototype.update=function(){!this.isScreen||0==this.A.z&&0==this.B.z&&0==this.C.z||(this.isScreen=!1),this.S.to(this.B).minus(this.A),this.T.to(this.C).minus(this.A),this.S.times(1/this.S.length());var t=s.PointElement.dot(this.T,this.S);this.T.x-=t*this.S.x,this.T.y-=t*this.S.y,this.T.z-=t*this.S.z,this.T.times(1/this.T.length()),this.U.toCross(this.S,this.T)},n}(i.GeomElement);n.PlaneElement=u},9237(t,n,e){var o,r=this&&this.__extends||(o=function(t,n){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},o(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function e(){this.constructor=t}o(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)});Object.defineProperty(n,"__esModule",{value:!0}),n.AngleDividerElement=void 0;var i=function(t){function n(n,e,o,r,i){var s=t.call(this)||this;return s.dimension=0,s._A=e,s._B=n,s._C=o,s._AP=r,s._n=i,s}return r(n,t),n.prototype.update=function(){var t=this._A.angle(this._B,this._C,this._AP)/this._n,n=Math.cos(t),e=Math.sin(t);this._AP.isScreen?(this._x=this._A.x+n*(this._B.x-this._A.x)-e*(this._B.y-this._A.y),this._y=this._A.y+e*(this._B.x-this._A.x)+n*(this._B.y-this._A.y),this._z=0):this.to(this._B).rotate(this._A,n,e,this._AP),this.toIntersection(this,this._A,this._B,this._C,this._AP)},n}(e(6091).PointElement);n.AngleDividerElement=i},788(t,n,e){var o,r=this&&this.__extends||(o=function(t,n){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},o(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function e(){this.constructor=t}o(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)});Object.defineProperty(n,"__esModule",{value:!0}),n.CircleSlider=void 0;var i=e(6091),s=function(t){function n(n,e,o,r){var s=t.call(this)||this;return s._newP=new i.PointElement,s.dimension=0,s.draggable=!0,s._C=n,s._x=e,s._initx=e,s._y=o,s._inity=o,s._z=r,s._initz=r,s}return r(n,t),n.prototype.reset=function(){this._x=this._initx,this._y=this._inity,this._z=this._initz,this.toCircle(this._C)},n.prototype.update=function(){this.toCircle(this._C)},n.prototype.drag=function(t,n){return this._x=t,this._y=n,this.defined()||(this._z=this._initz),this._newP.to(this).uptoPlane(this._C.AP),this._newP.defined()||this._newP.to(this).toPlane(this._C.AP),this._newP.toSphere(this._C.Center,this._C.radius),!((this._newP.x-this.x)*(this._newP.x-this.x)+(this._newP.y-this.y)*(this._newP.y-this.y)<.5||(this.to(this._newP),0))},n}(i.PointElement);n.CircleSlider=s},6401(t,n,e){var o,r=this&&this.__extends||(o=function(t,n){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},o(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function e(){this.constructor=t}o(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)});Object.defineProperty(n,"__esModule",{value:!0}),n.FixedPoint=void 0;var i=function(t){function n(n){var e=t.call(this,n)||this;return e._initx=e._x,e._inity=e._y,e._initz=e._z,e}return r(n,t),n.prototype.reset=function(){this._x=this._initx,this._y=this._inity,this._z=this._initz},n}(e(6091).PointElement);n.FixedPoint=i},6921(t,n,e){var o,r=this&&this.__extends||(o=function(t,n){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},o(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function e(){this.constructor=t}o(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)});Object.defineProperty(n,"__esModule",{value:!0}),n.Foot=void 0;var i=function(t){function n(n,e,o){var r=t.call(this)||this;return r.dimension=0,r._A=n,r._B=e,r._C=o,r._B.AP==r._C.AP&&(r._AP=r._B.AP),r}return r(n,t),n.prototype.update=function(){this.to(this._A).toLine(this._B,this._C,!1)},n}(e(6091).PointElement);n.Foot=i},7876(t,n,e){var o,r=this&&this.__extends||(o=function(t,n){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},o(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function e(){this.constructor=t}o(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)});Object.defineProperty(n,"__esModule",{value:!0}),n.HarmonicElement=void 0;var i=e(6091),s=function(t){function n(n,e,o){var r=t.call(this)||this;return r.dimension=0,r._B=n,r._C=e,r._D=o,r._E=new i.PointElement,r._F=new i.PointElement,r._M=new i.PointElement,r}return r(n,t),n.prototype.update=function(){if(0===this._B.z&&0===this._C.z&&0===this._D.z){var t=this._B.x-this._C.x,n=this._B.y-this._C.y,e=this._B.x-this._D.x,o=this._B.y-this._D.y,r=this._C.x*e-this._C.y*o,s=this._C.x*o+this._C.y*e,u=this._D.x*t-this._D.y*n,c=this._D.x*n+this._D.y*t,l=(e+t)*(e+t)+(o+n)*(o+n),a=(r+u)*(e+t)+(s+c)*(o+n),h=-(r+u)*(o+n)+(s+c)*(e+t);this._x=a/l,this._y=h/l}else{this._M.to(this._C).plus(this._D).times(.5),this._F.to(this._C).minus(this._M),this._E.to(this._B).minus(this._M);var p=1/this._E.length2(),f=this._F.length2();this.to(this._F).times(2*i.PointElement.dot(this._E,this._F)).minus(this._E.times(f)).times(p).plus(this._M)}},n}(i.PointElement);n.HarmonicElement=s},7832(t,n,e){var o,r=this&&this.__extends||(o=function(t,n){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},o(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function e(){this.constructor=t}o(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)});Object.defineProperty(n,"__esModule",{value:!0}),n.Intersection=void 0;var i=function(t){function n(n,e,o,r,i){var s=t.call(this,{AP:i})||this;return s.dimension=0,s.A=n,s.B=e,s.C=o,s.D=r,s}return r(n,t),n.prototype.update=function(){this.toIntersection(this.A,this.B,this.C,this.D,this.AP)},n}(e(6091).PointElement);n.Intersection=i},6015(t,n,e){var o,r=this&&this.__extends||(o=function(t,n){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},o(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function e(){this.constructor=t}o(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)});Object.defineProperty(n,"__esModule",{value:!0}),n.InvertPointElement=void 0;var i=function(t){function n(n,e){var o=t.call(this)||this;return o.dimension=0,o._A=n,o._C=e,o._AP=e.AP,o}return r(n,t),n.prototype.update=function(){this.toInvertPoint(this._A,this._C)},n}(e(6091).PointElement);n.InvertPointElement=i},2090(t,n,e){var o,r=this&&this.__extends||(o=function(t,n){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},o(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function e(){this.constructor=t}o(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)});Object.defineProperty(n,"__esModule",{value:!0}),n.Layoff=void 0;var i=function(t){function n(n,e,o,r,i){var s=t.call(this)||this;return s.dimension=0,s._A=n,s._C=e,s._D=o,s._E=r,s._F=i,n.AP==e.AP&&n.AP==o.AP&&(s._AP=n.AP),s}return r(n,t),n.prototype.update=function(){var t=this._E.distance(this._F)/this._C.distance(this._D);this.to(this._D).minus(this._C),this.times(t).plus(this._A)},n}(e(6091).PointElement);n.Layoff=i},4610(t,n,e){var o,r=this&&this.__extends||(o=function(t,n){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},o(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function e(){this.constructor=t}o(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)});Object.defineProperty(n,"__esModule",{value:!0}),n.LineSlider=void 0;var i=function(t){function n(n,e,o,r,i,s){var u=t.call(this)||this;return u.dimension=0,u.draggable=!0,u._A=n,u._B=e,u._x=o,u._initx=o,u._y=r,u._inity=r,u._z=i,u._initz=i,u._segment=s,u._A.AP==u._B.AP&&(u._AP=u._A.AP),u}return r(n,t),n.prototype.reset=function(){this._x=this._initx,this._y=this._inity,this._z=this._initz,this.toLine(this._A,this._B,this._segment)},n.prototype.update=function(){this.toLine(this._A,this._B,this._segment)},n.prototype.drag=function(t,n){t-=this._A.x,n-=this._A.y;var e=this._B.x-this._A.x,o=this._B.y-this._A.y,r=(t*e+n*o)/(e*e+o*o);return this._segment&&(r<0?r=0:r>1&&(r=1)),t=this._A.x+e*r,n=this._A.y+o*r,!((t-this._x)*(t-this._x)+(t-this._y)*(t-this._y)<.5||(this._x=t,this._y=n,this._z=this._A.z+(this._B.z-this._A.z)*r,0))},n}(e(6091).PointElement);n.LineSlider=i},3219(t,n,e){var o,r=this&&this.__extends||(o=function(t,n){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},o(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function e(){this.constructor=t}o(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)});Object.defineProperty(n,"__esModule",{value:!0}),n.MeanProportionalElement=void 0;var i=function(t){function n(n,e,o,r,i,s){var u=t.call(this)||this;return u.dimension=0,u._S0=n,u._S1=e,u._T0=o,u._T1=r,u._U0=i,u._U1=s,i._AP===s._AP&&(u._AP=i._AP),u}return r(n,t),n.prototype.update=function(){var t=Math.sqrt(this._S0.distance2(this._S1)*this._T0.distance2(this._T1));t=Math.sqrt(t/this._U0.distance2(this._U1)),this.to(this._U1).minus(this._U0),this.times(t).plus(this._U0)},n}(e(6091).PointElement);n.MeanProportionalElement=i},489(t,n,e){var o,r=this&&this.__extends||(o=function(t,n){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},o(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function e(){this.constructor=t}o(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)});Object.defineProperty(n,"__esModule",{value:!0}),n.Midpoint=void 0;var i=function(t){function n(n,e){var o=t.call(this)||this;return o.dimension=0,o._A=n,o._B=e,o._A.AP==o._B.AP&&(o._AP=o._A.AP),o}return r(n,t),n.prototype.update=function(){this._x=(this._A.x+this._B.x)/2,this._y=(this._A.y+this._B.y)/2,this._z=(this._A.z+this._B.z)/2},n}(e(6091).PointElement);n.Midpoint=i},3703(t,n,e){var o,r=this&&this.__extends||(o=function(t,n){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},o(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function e(){this.constructor=t}o(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)});Object.defineProperty(n,"__esModule",{value:!0}),n.PlaneFootElement=void 0;var i=function(t){function n(n,e){var o=t.call(this)||this;return o.dimension=0,o._A=n,o._AP=e,o}return r(n,t),n.prototype.update=function(){this.to(this._A).toPlane(this._AP)},n}(e(6091).PointElement);n.PlaneFootElement=i},2930(t,n,e){var o,r=this&&this.__extends||(o=function(t,n){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},o(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function e(){this.constructor=t}o(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)});Object.defineProperty(n,"__esModule",{value:!0}),n.PlaneIntersection=void 0;var i=function(t){function n(n,e,o){var r=t.call(this)||this;return r.dimension=0,r._A=e,r._B=o,r._AP=n,r}return r(n,t),n.prototype.update=function(){this.toIntersectionPL(this._AP,this._A,this._B)},n}(e(6091).PointElement);n.PlaneIntersection=i},4994(t,n,e){var o,r=this&&this.__extends||(o=function(t,n){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},o(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function e(){this.constructor=t}o(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)});Object.defineProperty(n,"__esModule",{value:!0}),n.PlaneSlider=void 0;var i=e(6091),s=function(t){function n(n,e,o,r){var s=t.call(this)||this;return s._newP=new i.PointElement,s.dimension=0,s.draggable=!0,s._AP=n,s._x=s._initx=e,s._y=s._inity=o,s._z=s._initz=r,s}return r(n,t),n.prototype.update=function(){this.toPlane(this._AP)},n.prototype.reset=function(){this._x=this._initx,this._y=this._inity,this._z=this._initz,this.toPlane(this._AP)},n.prototype.drag=function(t,n){return this._x=t,this._y=n,this.defined()||(this._z=this._initz),this._newP.to(this).uptoPlane(this._AP),this._newP.defined()?this.to(this._newP):this.toPlane(this._AP),!0},n}(i.PointElement);n.PlaneSlider=s},4461(t,n,e){var o,r=this&&this.__extends||(o=function(t,n){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},o(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function e(){this.constructor=t}o(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)});Object.defineProperty(n,"__esModule",{value:!0}),n.pointConstructions=n.VertexConstruction=n.HarmonicPointConstruction=n.LineSliderSegmentConstruction=n.FixedPointConstruction=n.AngleDividerPointConstruction=n.AngleBisectorPointConstruction=n.SphereSliderConstruction=n.PlaneSliderConstruction=n.MeanProportionalPointConstruction=n.InvertPointConstruction=n.ProportionPointConstruction=n.PointPerpendicular5Construction=n.PointPerpendicular4Construction=n.PointPerpendicular3Construction=n.PointPerpendicular2Construction=n.PointPerpendicular1Construction=n.PointPerpendicularConstruction=n.SimilarPointConstruction=n.ParallelogramConstruction=n.ExtendConstruction=n.CutoffConstruction=n.LayoffConstruction=n.PlaneFootPointConstruction=n.FootPointConstruction=n.CircumcenterConstruction=n.CircumcircleConstruction=n.CircleSliderConstruction=n.LineSliderConstruction=n.SphereCenterConstruction=n.CircleCenterConstruction=n.LastPointConstruction=n.FirstPointConstruction=n.PlaneIntersectionConstruction=n.IntersectionConstruction=n.MidPointConstruction=n.FreePointConstruction=void 0;var i=e(7658),s=e(1313),u=e(2218),c=e(6055),l=e(6401),a=e(4994),h=e(489),p=e(7832),f=e(2930),_=e(4610),y=e(2090),d=e(6921),v=e(3703),g=e(788),P=e(5014),C=e(9535),m=e(9237),w=e(3219),x=e(7876),E=e(6015),b=e(5089),A=e(6279),S=e(3375),O=e(2295),M=e(7091),T=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.PointConstructions.free,n.signature={points:0,elements:0,integers:2},n}return r(n,t),n.prototype.construct=function(t,n,e,o){var r=new a.PlaneSlider(t,o[0],o[1],0);return[[r],r]},n}(i.Construction);n.FreePointConstruction=T;var j=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.PointConstructions.midpoint,n.signature={points:2,elements:0,integers:0},n}return r(n,t),n.prototype.construct=function(t,n,e,o){var r=new h.Midpoint(n[0],n[1]);return[[r],r]},n}(i.Construction);n.MidPointConstruction=j;var B=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.PointConstructions.intersection,n.signature={points:4,elements:0,integers:0},n}return r(n,t),n.prototype.validateSignature=function(t,n){return t===this.constructionMethod&&4===n.P.length&&0===n.N.length&&(0===n.E.length||1===n.E.length&&n.E[0]instanceof c.PlaneElement)},n.prototype.construct=function(t,n,e,o){var r=e.length>0?e[0]:t,i=new p.Intersection(n[0],n[1],n[2],n[3],r);return[[i],i]},n}(i.Construction);n.IntersectionConstruction=B;var z=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.PointConstructions.intersection,n.signature={points:2,elements:1,integers:0,elementTypes:[c.PlaneElement]},n}return r(n,t),n.prototype.construct=function(t,n,e,o){var r=new f.PlaneIntersection(e[0],n[0],n[1]);return[[r],r]},n}(i.Construction);n.PlaneIntersectionConstruction=z;var L=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.PointConstructions.first,n.signature={points:2,elements:0,integers:0},n}return r(n,t),n.prototype.construct=function(t,n,e,o){return[[],n[0]]},n}(i.Construction);n.FirstPointConstruction=L;var V=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.PointConstructions.last,n.signature={points:2,elements:0,integers:0},n}return r(n,t),n.prototype.construct=function(t,n,e,o){return[[],n[1]]},n}(i.Construction);n.LastPointConstruction=V;var k=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.PointConstructions.center,n.signature={points:0,elements:1,integers:0,elementTypes:[s.CircleElement]},n}return r(n,t),n.prototype.construct=function(t,n,e,o){return[[],e[0].Center]},n}(i.Construction);n.CircleCenterConstruction=k;var F=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.PointConstructions.center,n.signature={points:0,elements:1,integers:0,elementTypes:[O.SphereElement]},n}return r(n,t),n.prototype.construct=function(t,n,e,o){return[[],e[0].Center]},n}(i.Construction);n.SphereCenterConstruction=F;var N=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.PointConstructions.lineSlider,n.signature={points:2,elements:0,integers:2},n}return r(n,t),n.prototype.validateSignature=function(t,n){return t===this.constructionMethod&&2===n.P.length&&0===n.E.length&&(2===n.N.length||3===n.N.length)},n.prototype.construct=function(t,n,e,o){var r=this.createSlider(n[0],n[1],o[0],o[1],o.length>2?o[2]:0);return[[r],r]},n.prototype.createSlider=function(t,n,e,o,r){return new _.LineSlider(t,n,e,o,r,!1)},n}(i.Construction);n.LineSliderConstruction=N;var D=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.PointConstructions.circleSlider,n.signature={points:0,elements:1,integers:2,elementTypes:[s.CircleElement]},n}return r(n,t),n.prototype.validateSignature=function(t,n){return t===this.constructionMethod&&0===n.P.length&&1===n.E.length&&(2===n.N.length||3===n.N.length)&&n.E[0]instanceof s.CircleElement},n.prototype.construct=function(t,n,e,o){var r=new g.CircleSlider(e[0],o[0],o[1],o.length>2?o[2]:0);return[[r],r]},n}(i.Construction);n.CircleSliderConstruction=D;var I=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.CircleConstructions.circumcircle,n.signature={points:3,elements:0,integers:0},n}return r(n,t),n.prototype.validateSignature=function(t,n){return t===this.constructionMethod&&3===n.P.length&&0===n.N.length&&(0===n.E.length||1===n.E.length&&n.E[0]instanceof c.PlaneElement)},n.prototype.construct=function(t,n,e,o){var r=e.length>0?e[0]:t,i=new u.CircumcircleElement(n[0],n[1],n[2],r);return[[i],i]},n}(i.Construction);n.CircumcircleConstruction=I;var H=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.PointConstructions.circumcenter,n}return r(n,t),n.prototype.construct=function(n,e,o,r){var i=t.prototype.construct.call(this,n,e,o,r),s=i[1];return i[0].push(s.Center),[i[0],s.Center]},n}(I);n.CircumcenterConstruction=H;var R=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.PointConstructions.foot,n.signature={points:3,elements:0,integers:0},n}return r(n,t),n.prototype.construct=function(t,n,e,o){var r=new d.Foot(n[0],n[1],n[2]);return[[r],r]},n}(i.Construction);n.FootPointConstruction=R;var U=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.PointConstructions.foot,n.signature={points:1,elements:1,integers:0,elementTypes:[c.PlaneElement]},n}return r(n,t),n.prototype.construct=function(t,n,e,o){var r=new v.PlaneFootElement(n[0],e[0]);return[[r],r]},n}(i.Construction);n.PlaneFootPointConstruction=U;var q=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.signature={points:4,elements:0,integers:0},n}return r(n,t),n.prototype.construct=function(t,n,e,o){var r=this._createLayoff(n);return[[r],r]},n}(i.Construction);n.LayoffConstruction=q;var W=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.PointConstructions.cutoff,n}return r(n,t),n.prototype._createLayoff=function(t){return new y.Layoff(t[0],t[0],t[1],t[2],t[3])},n}(q);n.CutoffConstruction=W;var G=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.PointConstructions.extend,n}return r(n,t),n.prototype._createLayoff=function(t){return new y.Layoff(t[1],t[0],t[1],t[2],t[3])},n}(q);n.ExtendConstruction=G;var Y=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.PointConstructions.parallelogram,n.signature={points:3,elements:0,integers:0},n}return r(n,t),n.prototype.construct=function(t,n,e,o){var r=new y.Layoff(n[0],n[1],n[2],n[1],n[2]);return[[r],r]},n}(i.Construction);n.ParallelogramConstruction=Y;var X=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.PointConstructions.similar,n.signature={points:5,elements:0,integers:0},n}return r(n,t),n.prototype.validateSignature=function(t,n){return t===this.constructionMethod&&5===n.P.length&&0===n.N.length&&(0===n.E.length||2===n.E.length)},n.prototype.construct=function(t,n,e,o){var r=e.length>0?e[0]:t,i=e.length>1?e[1]:t,s=new P.SimilarElement(n[0],n[1],r,n[2],n[3],n[4],i);return[[s],s]},n}(i.Construction);n.SimilarPointConstruction=X;var Q=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.PointConstructions.perpendicular,n}return r(n,t),n}(i.Construction);n.PointPerpendicularConstruction=Q;var $=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.signature={points:2,elements:0,integers:0},n}return r(n,t),n.prototype.construct=function(t,n,e,o){var r=new A.Perpendicular({C:n[0],D:n[1],P:t,E:n[0],F:n[1]});return[[r],r.B]},n}(Q);n.PointPerpendicular1Construction=$;var K=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.signature={points:2,elements:1,integers:0,elementTypes:[c.PlaneElement]},n}return r(n,t),n.prototype.construct=function(t,n,e,o){var r=new A.Perpendicular({C:n[0],D:n[1],P:e[0],E:n[0],F:n[1]});return[[r],r.B]},n}(Q);n.PointPerpendicular2Construction=K;var Z=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.signature={points:4,elements:0,integers:0},n}return r(n,t),n.prototype.construct=function(t,n,e,o){var r=new A.Perpendicular({C:n[0],D:n[1],P:t,E:n[2],F:n[3]});return[[r],r.B]},n}(Q);n.PointPerpendicular3Construction=Z;var J=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.signature={points:4,elements:1,integers:0,elementTypes:[c.PlaneElement]},n}return r(n,t),n.prototype.construct=function(t,n,e,o){var r=new A.Perpendicular({C:n[0],D:n[1],P:e[0],E:n[2],F:n[3]});return[[r],r.B]},n}(Q);n.PointPerpendicular4Construction=J;var tt=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.signature={points:3,elements:1,integers:0,elementTypes:[c.PlaneElement]},n}return r(n,t),n.prototype.construct=function(t,n,e,o){var r=new S.PlanePerpendicularLine({C:n[0],P:e[0],D:n[1],E:n[2]});return[[r],r.B]},n}(Q);n.PointPerpendicular5Construction=tt;var nt=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.PointConstructions.proportion,n.signature={points:8,elements:0,integers:0},n}return r(n,t),n.prototype.construct=function(t,n,e,o){var r=new C.ProportionElement(n[0],n[1],n[2],n[3],n[4],n[5],n[6],n[7]);return[[r],r]},n}(i.Construction);n.ProportionPointConstruction=nt;var et=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.PointConstructions.invert,n.signature={points:1,elements:1,integers:0,elementTypes:[s.CircleElement]},n}return r(n,t),n.prototype.construct=function(t,n,e,o){var r=new E.InvertPointElement(n[0],e[0]);return[[r],r]},n}(i.Construction);n.InvertPointConstruction=et;var ot=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.PointConstructions.meanProportional,n.signature={points:6,elements:0,integers:0},n}return r(n,t),n.prototype.construct=function(t,n,e,o){var r=new w.MeanProportionalElement(n[0],n[1],n[2],n[3],n[4],n[5]);return[[r],r]},n}(i.Construction);n.MeanProportionalPointConstruction=ot;var rt=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.PointConstructions.planeSlider,n.signature={points:0,elements:1,integers:3,elementTypes:[c.PlaneElement]},n}return r(n,t),n.prototype.construct=function(t,n,e,o){var r=new a.PlaneSlider(e[0],o[0],o[1],o[2]);return[[r],r]},n}(i.Construction);n.PlaneSliderConstruction=rt;var it=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.PointConstructions.sphereSlider,n.signature={points:0,elements:1,integers:3,elementTypes:[O.SphereElement]},n}return r(n,t),n.prototype.construct=function(t,n,e,o){var r=new b.SphereSliderElement(e[0],o[0],o[1],o[2]);return[[r],r]},n}(i.Construction);n.SphereSliderConstruction=it;var st=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.PointConstructions.angleBisector,n.signature={points:3,elements:0,integers:0},n}return r(n,t),n.prototype.validateSignature=function(t,n){return t===this.constructionMethod&&3===n.P.length&&0===n.N.length&&(0===n.E.length||1===n.E.length&&n.E[0]instanceof c.PlaneElement)},n.prototype.construct=function(t,n,e,o){var r=e.length>0?e[0]:t,i=new m.AngleDividerElement(n[0],n[1],n[2],r,2);return[[i],i]},n}(i.Construction);n.AngleBisectorPointConstruction=st;var ut=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.PointConstructions.angleDivider,n.signature={points:3,elements:0,integers:1},n}return r(n,t),n.prototype.validateSignature=function(t,n){return t===this.constructionMethod&&3===n.P.length&&1===n.N.length&&(0===n.E.length||1===n.E.length&&n.E[0]instanceof c.PlaneElement)},n.prototype.construct=function(t,n,e,o){var r=e.length>0?e[0]:t,i=new m.AngleDividerElement(n[0],n[1],n[2],r,o[0]);return[[i],i]},n}(i.Construction);n.AngleDividerPointConstruction=ut;var ct=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.PointConstructions.fixed,n.signature={points:0,elements:0,integers:2},n}return r(n,t),n.prototype.validateSignature=function(t,n){return t===this.constructionMethod&&0===n.P.length&&0===n.E.length&&(2===n.N.length||3===n.N.length)},n.prototype.construct=function(t,n,e,o){var r=new l.FixedPoint({x:o[0],y:o[1],z:o.length>2?o[2]:0});return[[r],r]},n}(i.Construction);n.FixedPointConstruction=ct;var lt=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.PointConstructions.lineSegmentSlider,n}return r(n,t),n.prototype.createSlider=function(t,n,e,o,r){return new _.LineSlider(t,n,e,o,r,!0)},n}(N);n.LineSliderSegmentConstruction=lt;var at=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.PointConstructions.harmonic,n.signature={points:3,elements:0,integers:0},n}return r(n,t),n.prototype.construct=function(t,n,e,o){var r=new x.HarmonicElement(n[0],n[1],n[2]);return[[r],r]},n}(i.Construction);n.HarmonicPointConstruction=at;var ht=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.PointConstructions.vertex,n.signature={points:0,elements:1,integers:1,elementTypes:[M.PolygonElement]},n}return r(n,t),n.prototype.construct=function(t,n,e,o){var r=e[0].V[o[0]-1];return[[r],r]},n}(i.Construction);n.VertexConstruction=ht,n.pointConstructions=[new T,new ct,new L,new V,new k,new H,new j,new B,new R,new U,new G,new W,new Y,new X,new nt,new st,new ut,new ot,new rt,new it,new at,new et,new z,new F,new I,new N,new lt,new D,new $,new K,new Z,new J,new tt,new ht]},6091(t,n,e){var o,r=this&&this.__extends||(o=function(t,n){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},o(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function e(){this.constructor=t}o(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)});Object.defineProperty(n,"__esModule",{value:!0}),n.PointElement=void 0;var i=function(t){function n(n){var e=t.call(this)||this;return e.dimension=0,e._x=n&&n.x||0,e._y=n&&n.y||0,e._z=n&&n.z||0,e._AP=n&&n.AP||null,e}return r(n,t),Object.defineProperty(n.prototype,"x",{get:function(){return this._x},set:function(t){this._x=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"y",{get:function(){return this._y},set:function(t){this._y=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"z",{get:function(){return this._z},set:function(t){this._z=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"AP",{get:function(){return this._AP},set:function(t){this._AP=t},enumerable:!1,configurable:!0}),n.prototype.defined=function(){return!isNaN(this._x)&&!isNaN(this._y)&&!isNaN(this._z)&&null!=this._x&&null!=this._y&&null!=this._z},n.prototype.to=function(t){return this._x=t._x,this._y=t._y,this._z=t._z,this},n.prototype.plus=function(t){return this._x+=t._x,this._y+=t._y,this._z+=t._z,this},n.prototype.minus=function(t){return this._x-=t._x,this._y-=t._y,this._z-=t._z,this},n.prototype.times=function(t){return this._x*=t,this._y*=t,this._z*=t,this},n.difference=function(t,e){return new n({x:t.x-e.x,y:t.y-e.y,z:t.z-e.z,AP:null})},n.product=function(t,e){return new n({x:t*e.x,y:t*e.y,z:t*e.z,AP:null})},n.dot=function(t,n){return t.x*n.x+t.y*n.y+t.z*n.z},n.prototype.length2=function(){return this._x*this._x+this._y*this._y+this._z*this._z},n.prototype.length=function(){return Math.sqrt(this.length2())},n.prototype.distance2=function(t){return(this._x-t.x)*(this._x-t.x)+(this._y-t.y)*(this._y-t.y)+(this._z-t.z)*(this._z-t.z)},n.prototype.distance=function(t){return Math.sqrt(this.distance2(t))},n.prototype.toCross=function(t,n){return this._x=t.y*n.z-t.z*n.y,this._y=t.z*n.x-t.x*n.z,this._z=t.x*n.y-t.y*n.x,this},n.cross=function(t,e){return new n({x:t.y*e.z-t.z*e.y,y:t.z*e.x-t.x*e.z,z:t.x*e.y-t.y*e.x,AP:null})},n.triple=function(t,n,e){return t.x*(n.y*e.z-n.z*e.y)+n.x*(e.y*t.z-e.z*t.y)+e.x*(t.y*n.z-t.z*n.y)},n.prototype.toLine=function(t,e,o){var r=n.difference(e,t);this.minus(t);var i=n.dot(r,this)/r.length2();return o&&(i<0?i=0:i>1&&(i=1)),r.times(i),this.to(r).plus(t)},n.prototype.toPlane=function(t){if(t.isScreen)this._z=0;else{this.minus(t.A);var e=n.dot(this,t.S),o=n.dot(this,t.T);this.to(t.S).times(e).plus(n.product(o,t.T)).plus(t.A)}return this},n.prototype.uptoPlane=function(t){if(t.isScreen)this._z=0;else{this.minus(t.A);var e=t.S.x*t.T.y-t.S.y*t.T.x,o=(this.x*t.T.y-this.y*t.T.x)/e,r=(this.y*t.S.x-this.x*t.S.y)/e;this.to(t.S).times(o).plus(n.product(r,t.T)).plus(t.A)}return this},n.prototype.toCircumcenter=function(t,e,o){if(0==t.z&&0==e.z&&0==o.z){var r=((t.x-e.x)*(t.x+e.x)+(t.y-e.y)*(t.y+e.y))/2,i=((e.x-o.x)*(e.x+o.x)+(e.y-o.y)*(e.y+o.y))/2,s=(t.x-e.x)*(e.y-o.y)-(e.x-o.x)*(t.y-e.y);this._x=(r*(e.y-o.y)-i*(t.y-e.y))/s,this._y=(i*(t.x-e.x)-r*(e.x-o.x))/s,this._z=0}else{var u=n.difference(e,t),c=n.difference(o,t),l=n.dot(u,c),a=u.length2(),h=c.length2(),p=h*(a-l)/(s=2*(a*h-l*l)),f=a*(h-l)/s;this.to(t).plus(u.times(p)).plus(c.times(f))}return this},n.prototype.toCircle=function(t){if(t.AP.isScreen){var n=t.radius/this.distance(t.Center);this._x=t.Center.x+n*(this._x-t.Center.x),this._y=t.Center.y+n*(this._y-t.Center.y),this._z=0}else this.toPlane(t.AP),this.toSphere(t.Center,t.radius);return this},n.prototype.toSphere=function(t,n){var e=n/this.distance(t);return this._x=t.x+e*(this._x-t.x),this._y=t.y+e*(this._y-t.y),this._z=t.z+e*(this._z-t.z),this},n.area=function(t,e,o){var r=n.difference(e,t),i=n.difference(o,t);return this.cross(r,i).length()/2},n.prototype.angle=function(t,n,e){var o=t.x-this._x,r=n.x-this._x,i=t.y-this._y,s=n.y-this._y;if(e.isScreen)return Math.atan2(o*s-i*r,o*r+i*s);var u=t.z-this._z,c=n.z-this._z,l=o*e.S.x+i*e.S.y+u*e.S.z,a=o*e.T.x+i*e.T.y+u*e.T.z,h=r*e.S.x+s*e.S.y+c*e.S.z,p=r*e.T.x+s*e.T.y+c*e.T.z;return Math.atan2(l*p-a*h,l*h+a*p)},n.prototype.toIntersection=function(t,e,o,r,i){if(i.isScreen){var s=t.x*e.y-t.y*e.x,u=o.x*r.y-o.y*r.x,c=(e.y-t.y)*(o.x-r.x)-(t.x-e.x)*(r.y-o.y);this._x=(s*(o.x-r.x)-u*(t.x-e.x))/c,this._y=(u*(e.y-t.y)-s*(r.y-o.y))/c}else{var l=n.difference(t,i.A),a=n.difference(e,i.A),h=n.difference(o,i.A),p=n.difference(r,i.A),f=n.dot(l,i.S),_=n.dot(l,i.T),y=n.dot(a,i.S),d=n.dot(a,i.T),v=n.dot(h,i.S),g=n.dot(h,i.T),P=n.dot(p,i.S),C=n.dot(p,i.T),m=((s=f*d-_*y)*(v-P)-(u=v*C-g*P)*(f-y))/(c=(d-_)*(v-P)-(f-y)*(C-g)),w=(u*(d-_)-s*(C-g))/c;this.to(i.S).times(m).plus(n.product(w,i.T)).plus(i.A)}return this},n.prototype.toIntersectionPL=function(t,e,o){this.to(o).minus(e);var r=n.difference(e,t.A),i=-n.triple(t.S,t.T,r)/n.triple(t.S,t.T,this);return this.times(i).plus(e)},n.prototype.toInvertPoint=function(t,n){var e=n.radius2/t.distance2(n.Center);return this.to(t).minus(n.Center).times(e).plus(n.Center)},n.prototype.toSimilar=function(t,e,o,r,i,s,u){var c=r.angle(i,s,u),l=Math.cos(c),a=Math.sin(c),h=r.distance(s)/r.distance(i);if(o.isScreen)this._x=e.x,this._y=e.y,this.rotate(t,l,a,o),this._x=t.x+h*(this._x-t.x),this._y=t.y+h*(this._y-t.y),this._z=0;else{var p=n.difference(e,t),f=n.dot(p,o.S),_=n.dot(p,o.T),y=h*(l*f-a*_),d=h*(a*f+l*_);this._x=y*o.S.x+d*o.T.x+t.x,this._y=y*o.S.y+d*o.T.y+t.y,this._z=y*o.S.z+d*o.T.z+t.z}return this},n.prototype.rotate=function(t,e,o,r){if(null==r&&(r=t._AP),this!=t)if(r.isScreen){var i=this.x-t.x,s=this.y-t.y;this._x=t.x+e*i-o*s,this._y=t.y+o*i+e*s}else{this.minus(t);var u=r.S,c=r.T,l=r.U,a=n.dot(this,u),h=n.dot(this,c),p=n.dot(this,l),f=e*a-o*h,_=o*a+e*h;this._x=t.x+f*u.x+_*c.x+p*l.x,this._y=t.y+f*u.y+_*c.y+p*l.y,this._z=t.z+f*u.z+_*c.z+p*l.z}},n.prototype.drawName=function(t){null!=this.nameColor&&null!=this.name&&this.defined()&&this.drawString(Math.round(this.x),Math.round(this.y),t)},n.prototype.drawVertex=function(t,n){var e=t.getContext("2d");null==n&&(n=this.shouldHighlight?this.vertexHighlightColor:this.vertexColor),null!=n&&(e.beginPath(),e.fillStyle=n,e.arc(this._x,this._y,2,0,2*Math.PI,!1),e.fill())},n.prototype.translate=function(t,n){this._x+=t,this._y+=n},n.prototype.update=function(){},n.prototype.drawEdge=function(t){},n.prototype.drawFace=function(t){},n}(e(8020).GeomElement);n.PointElement=i},9535(t,n,e){var o,r=this&&this.__extends||(o=function(t,n){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},o(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function e(){this.constructor=t}o(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)});Object.defineProperty(n,"__esModule",{value:!0}),n.ProportionElement=void 0;var i=function(t){function n(n,e,o,r,i,s,u,c){var l=t.call(this)||this;return l.dimension=0,l._S0=n,l._S1=e,l._T0=o,l._T1=r,l._U0=i,l._U1=s,l._V0=u,l._V1=c,u._AP===c._AP&&(l._AP=u._AP),l}return r(n,t),n.prototype.update=function(){var t=this._T0.distance2(this._T1)*this._U0.distance2(this._U1)/(this._S0.distance2(this._S1)*this._V0.distance2(this._V1));t=Math.sqrt(t),this.to(this._V1).minus(this._V0),this.times(t).plus(this._V0)},n}(e(6091).PointElement);n.ProportionElement=i},5014(t,n,e){var o,r=this&&this.__extends||(o=function(t,n){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},o(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function e(){this.constructor=t}o(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)});Object.defineProperty(n,"__esModule",{value:!0}),n.SimilarElement=void 0;var i=function(t){function n(n,e,o,r,i,s,u){var c=t.call(this)||this;return c.dimension=0,c._parentA=n,c._parentB=e,c._AP=o,c._D=r,c._E=i,c._F=s,c._Q=u,c}return r(n,t),n.prototype.update=function(){this.toSimilar(this._parentA,this._parentB,this._AP,this._D,this._E,this._F,this._Q)},n}(e(6091).PointElement);n.SimilarElement=i},5089(t,n,e){var o,r=this&&this.__extends||(o=function(t,n){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},o(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function e(){this.constructor=t}o(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)});Object.defineProperty(n,"__esModule",{value:!0}),n.SphereSliderElement=void 0;var i=function(t){function n(n,e,o,r){var i=t.call(this)||this;return i.dimension=0,i.draggable=!0,i._S=n,i._x=i._initx=e,i._y=i._inity=o,i._z=i._initz=r,i}return r(n,t),n.prototype.reset=function(){this._x=this._initx,this._y=this._inity,this._z=this._initz,this.toSphere(this._S.Center,this._S.radius())},n.prototype.update=function(){this.toSphere(this._S.Center,this._S.radius())},n.prototype.drag=function(t,n){var e=(this._S.Center.x-t)*(this._S.Center.x-t)+(this._S.Center.y-n)*(this._S.Center.y-n),o=this._S.radius2();if(e<=o)this._x=t,this._y=n,this._z>this._S.Center.z?this._z=this._S.Center.z+Math.sqrt(o-e):this._z=this._S.Center.z-Math.sqrt(o-e);else{t-=this._S.Center.x,n-=this._S.Center.y;var r=Math.sqrt((t*t+n*n)/o);if(t=t/r+this._S.Center.x,n=n/r+this._S.Center.y,(t-this._x)*(t-this._x)+(n-this._y)*(n-this._y)<.5)return!1;this._x=t,this._y=n,this._z=this._S.Center.z}return!0},n}(e(6091).PointElement);n.SphereSliderElement=i},2563(t,n,e){var o,r=this&&this.__extends||(o=function(t,n){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},o(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function e(){this.constructor=t}o(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)});Object.defineProperty(n,"__esModule",{value:!0}),n.ApplicationElement=void 0;var i=e(7091),s=e(6091),u=function(t){function n(n,e,o,r){var i=t.call(this)||this;return i.dimension=2,i._P=n,i._C=r,i.V=new Array(4),i.V[0]=e,i.V[1]=o,i.V[2]=new s.PointElement,i.V[3]=new s.PointElement,e._AP===o._AP&&e._AP===r._AP&&(i.V[2]._AP=e._AP,i.V[3]._AP=e._AP),i}return r(n,t),n.prototype.translate=function(t,n){this.V[2].translate(t,n),this.V[3].translate(t,n)},n.prototype.rotate=function(t,n,e){this.V[2].rotate(t,n,e),this.V[3].rotate(t,n,e)},n.prototype.update=function(){var t=this._P.area()/(2*s.PointElement.area(this.V[0],this.V[1],this._C));t=Math.abs(t),this.V[3].x=this.V[0].x+t*(this._C.x-this.V[0].x),this.V[3].y=this.V[0].y+t*(this._C.y-this.V[0].y),this.V[3].z=this.V[0].z+t*(this._C.z-this.V[0].z),this.V[2].x=this.V[1].x+this.V[3].x-this.V[0].x,this.V[2].y=this.V[1].y+this.V[3].y-this.V[0].y,this.V[2].z=this.V[1].z+this.V[3].z-this.V[0].z},n}(i.PolygonElement);n.ApplicationElement=u},4133(t,n,e){var o,r=this&&this.__extends||(o=function(t,n){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},o(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function e(){this.constructor=t}o(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)});Object.defineProperty(n,"__esModule",{value:!0}),n.polygonConstructions=n.FacePolygonConstruction=n.OctagonPolygonConstruction=n.ApplicationPolygonConstruction=n.SimilarPolygonConstruction=n.StarPolygonConstruction=n.RegularPolygonConstruction=n.ParallelogramPolygonConstruction=n.EquilateralTriangleConstruction=n.HexagonPolygonConstruction=n.PentagonPolygonConstruction=n.QuadrilateralPolygonConstruction=n.TrianglePolygonConstruction=n.SquarePolygonConstruction=n.PolyConstruction=void 0;var i=e(7658),s=e(6055),u=e(2090),c=e(5014),l=e(7091),a=e(1943),h=e(2563),p=e(3857),f=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return r(n,t),n.prototype.construct=function(t,n,e,o){var r=new l.PolygonElement(n);return[[r],r]},n}(i.Construction);n.PolyConstruction=f;var _=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.PolygonConstructions.square,n.signature={points:2,elements:0,integers:0},n}return r(n,t),n.prototype.validateSignature=function(t,n){return t===this.constructionMethod&&2===n.P.length&&0===n.N.length&&(0===n.E.length||1===n.E.length&&n.E[0]instanceof s.PlaneElement)},n.prototype.construct=function(t,n,e,o){var r=e.length>0?e[0]:t,i=new a.RegularPolygonElement(n[0],n[1],r,4);return[[i],i]},n}(i.Construction);n.SquarePolygonConstruction=_;var y=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.PolygonConstructions.triangle,n.signature={points:3,elements:0,integers:0},n}return r(n,t),n}(f);n.TrianglePolygonConstruction=y;var d=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.PolygonConstructions.quadrilateral,n.signature={points:4,elements:0,integers:0},n}return r(n,t),n}(f);n.QuadrilateralPolygonConstruction=d;var v=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.PolygonConstructions.pentagon,n.signature={points:5,elements:0,integers:0},n}return r(n,t),n}(f);n.PentagonPolygonConstruction=v;var g=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.PolygonConstructions.hexagon,n.signature={points:6,elements:0,integers:0},n}return r(n,t),n}(f);n.HexagonPolygonConstruction=g;var P=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.PolygonConstructions.equilateralTriangle,n.signature={points:2,elements:0,integers:0},n}return r(n,t),n.prototype.validateSignature=function(t,n){return t===this.constructionMethod&&2===n.P.length&&0===n.N.length&&(0===n.E.length||1===n.E.length&&n.E[0]instanceof s.PlaneElement)},n.prototype.construct=function(t,n,e,o){var r=e.length>0?e[0]:t,i=new a.RegularPolygonElement(n[0],n[1],r,3);return[[i],i]},n}(i.Construction);n.EquilateralTriangleConstruction=P;var C=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.PolygonConstructions.parallelogram,n.signature={points:3,elements:0,integers:0},n}return r(n,t),n.prototype.construct=function(t,n,e,o){var r=new u.Layoff(n[0],n[1],n[2],n[1],n[2]),i=new l.PolygonElement([n[0],n[1],n[2],r]);return[[r,i],i]},n}(i.Construction);n.ParallelogramPolygonConstruction=C;var m=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.PolygonConstructions.regularPolygon,n.signature={points:2,elements:0,integers:1},n}return r(n,t),n.prototype.validateSignature=function(t,n){return t===this.constructionMethod&&2===n.P.length&&1===n.N.length&&(0===n.E.length||1===n.E.length&&n.E[0]instanceof s.PlaneElement)},n.prototype.construct=function(t,n,e,o){var r=e.length>0?e[0]:t,i=new a.RegularPolygonElement(n[0],n[1],r,o[0]);return[[i],i]},n}(i.Construction);n.RegularPolygonConstruction=m;var w=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.PolygonConstructions.starPolygon,n.signature={points:2,elements:0,integers:2},n}return r(n,t),n.prototype.construct=function(t,n,e,o){var r=new a.RegularPolygonElement(n[0],n[1],t,o[0],o[1]);return[[r],r]},n}(i.Construction);n.StarPolygonConstruction=w;var x=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.PolygonConstructions.similar,n.signature={points:5,elements:0,integers:0},n}return r(n,t),n.prototype.validateSignature=function(t,n){return t===this.constructionMethod&&5===n.P.length&&0===n.N.length&&(0===n.E.length||2===n.E.length)},n.prototype.construct=function(t,n,e,o){var r=e.length>0?e[0]:t,i=e.length>1?e[1]:t,s=new c.SimilarElement(n[0],n[1],r,n[2],n[3],n[4],i),u=new l.PolygonElement([n[0],n[1],s]);return[[s,u],u]},n}(i.Construction);n.SimilarPolygonConstruction=x;var E=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.PolygonConstructions.application,n.signature={points:3,elements:1,integers:0,elementTypes:[l.PolygonElement]},n}return r(n,t),n.prototype.construct=function(t,n,e,o){var r=new h.ApplicationElement(e[0],n[0],n[1],n[2]);return[[r],r]},n}(i.Construction);n.ApplicationPolygonConstruction=E;var b=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.PolygonConstructions.octagon,n.signature={points:8,elements:0,integers:0},n}return r(n,t),n}(f);n.OctagonPolygonConstruction=b;var A=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.PolygonConstructions.face,n.signature={points:0,elements:1,integers:1,elementTypes:[p.PolyhedronElement]},n}return r(n,t),n.prototype.construct=function(t,n,e,o){var r=e[0].P[o[0]-1];return[[r],r]},n}(i.Construction);n.FacePolygonConstruction=A,n.polygonConstructions=[new y,new w,new m,new _,new P,new C,new d,new b,new v,new g,new x,new E,new A]},7091(t,n,e){var o,r=this&&this.__extends||(o=function(t,n){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},o(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function e(){this.constructor=t}o(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)});Object.defineProperty(n,"__esModule",{value:!0}),n.PolygonElement=void 0;var i=e(6091),s=function(t){function n(n){var e=t.call(this)||this;return e.dimension=2,null==n?(e.V=[],e):(e.V=n,e)}return r(n,t),n.prototype.area=function(){for(var t=0,n=0;n<this.V.length-2;++n)t+=i.PointElement.area(this.V[0],this.V[n+1],this.V[n+2]);return t},n.prototype.drawEdge=function(t,n){if(null==n&&(n=this.shouldHighlight?this.edgeHighlightColor:this.edgeColor),null!=n&&!(this.V.length<=1)){var e=t.getContext("2d");e.beginPath(),e.strokeStyle=n;var o=this.V[0],r=this.V.slice(1);e.moveTo(o.x,o.y);for(var i=0,s=r;i<s.length;i++){var u=s[i];e.lineTo(u.x,u.y),e.stroke()}this.V.length>2&&(e.lineTo(o.x,o.y),e.stroke())}},n.prototype.defined=function(){if(0==this.V.length)return!1;for(var t=0,n=this.V;t<n.length;t++)if(!n[t].defined())return!1;return!0},n.prototype.drawFace=function(t){if(null!=this.faceColor&&this.defined()&&this.V.length>2){var n=t.getContext("2d");n.beginPath(),n.fillStyle=this.faceColor;var e=this.V[0],o=this.V.slice(1);n.moveTo(e.x,e.y);for(var r=0,i=o;r<i.length;r++){var s=i[r];n.lineTo(s.x,s.y)}n.closePath(),n.fill()}},n.prototype.drawName=function(t){if(null!=this.nameColor&&null!=this.name&&this.defined()){for(var n=0,e=0,o=0,r=this.V;o<r.length;o++){var i=r[o];n+=i.x,e+=i.y}var s=this.V.length;n/=s,e/=s;var u=t.getContext("2d"),c=this._getTextMetrics(u,this._name),l=c[0],a=c[1];u.beginPath(),u.fillStyle=this.nameColor,u.fillText(this._name,n-l/2,e+a/4)}},n.prototype.drawVertex=function(t){if(null!=this.vertexColor&&this.defined())for(var n=0,e=this.V;n<e.length;n++)e[n].drawVertex(t,this.vertexColor)},n.prototype.rotate=function(t,n,e){},n.prototype.translate=function(t,n){},n.prototype.update=function(){},n}(e(8020).GeomElement);n.PolygonElement=s},1943(t,n,e){var o,r=this&&this.__extends||(o=function(t,n){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},o(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function e(){this.constructor=t}o(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)});Object.defineProperty(n,"__esModule",{value:!0}),n.RegularPolygonElement=void 0;var i=e(7091),s=e(6091),u=function(t){function n(n,e,o,r,i){void 0===i&&(i=1);var u=t.call(this)||this;u._P=o;var c=Math.PI*i*(r-2)/r;u._cos=Math.cos(c),u._sin=Math.sin(c),u.V=new Array(r),u.V[0]=n,u.V[1]=e;for(var l=2;l<r;l++)u.V[l]=new s.PointElement({AP:o});return u}return r(n,t),n.prototype.update=function(){for(var t=2;t<this.V.length;t++)this.V[t].to(this.V[t-2]),this.V[t].rotate(this.V[t-1],this._cos,this._sin,this._P)},n.prototype.translate=function(t,n){for(var e=2;e<this.V.length;e++)this.V[e].translate(t,n)},n.prototype.rotate=function(t,n,e){for(var o=2;o<this.V.length;o++)this.V[o].rotate(t,n,e,this._P)},n}(i.PolygonElement);n.RegularPolygonElement=u},1099(t,n,e){var o,r=this&&this.__extends||(o=function(t,n){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},o(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function e(){this.constructor=t}o(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)});Object.defineProperty(n,"__esModule",{value:!0}),n.polyhedronConstructions=n.PyramidConstruction=n.PrismConstruction=n.ParallelepipedConstruction=n.TetrahedronConstruction=void 0;var i=e(7658),s=e(2090),u=e(7091),c=e(2383),l=e(444),a=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.PolyhedraConstructions.tetrahedron,n.signature={points:4,elements:0,integers:0},n}return r(n,t),n.prototype.construct=function(t,n,e,o){var r=new u.PolygonElement([n[0],n[1],n[2]]),i=new c.PyramidElement(r,n[3]);return[[r,i],i]},n}(i.Construction);n.TetrahedronConstruction=a;var h=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.PolyhedraConstructions.parallelepiped,n.signature={points:4,elements:0,integers:0},n}return r(n,t),n.prototype.construct=function(t,n,e,o){var r=new s.Layoff(n[1],n[0],n[2],n[0],n[2]),i=new u.PolygonElement([n[1],n[0],n[2],r]),c=new l.PrismElement(i,n[0],n[3]);return[[r,i,c],c]},n}(i.Construction);n.ParallelepipedConstruction=h;var p=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.PolyhedraConstructions.prism,n.signature={points:2,elements:1,integers:0,elementTypes:[u.PolygonElement]},n}return r(n,t),n.prototype.construct=function(t,n,e,o){var r=new l.PrismElement(e[0],n[0],n[1]);return[[r],r]},n}(i.Construction);n.PrismConstruction=p;var f=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.PolyhedraConstructions.pyramid,n.signature={points:1,elements:1,integers:0,elementTypes:[u.PolygonElement]},n}return r(n,t),n.prototype.construct=function(t,n,e,o){var r=new c.PyramidElement(e[0],n[0]);return[[r],r]},n}(i.Construction);n.PyramidConstruction=f,n.polyhedronConstructions=[new a,new h,new p,new f]},3857(t,n,e){var o,r=this&&this.__extends||(o=function(t,n){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},o(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function e(){this.constructor=t}o(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)});Object.defineProperty(n,"__esModule",{value:!0}),n.PolyhedronElement=void 0;var i=function(t){function n(){var n=t.call(this)||this;return n.dimension=2,n.P=[],n}return r(n,t),n.prototype.defined=function(){for(var t=0;t<this.P.length;++t)if(!this.P[t].defined())return!1;return!0},n.prototype.drawName=function(t){if(null!=this.nameColor&&null!=this.name&&this.defined()){for(var n=0,e=0,o=0,r=0;r<this.P.length;++r)for(var i=0;i<this.P[r].V.length;++i)n+=this.P[r].V[i].x,e+=this.P[r].V[i].y,++o;n/=o,e/=o,this.drawString(Math.round(n),Math.round(e),t)}},n.prototype.drawVertex=function(t){if(null!=this.vertexColor&&this.defined())for(var n=0;n<this.P.length;++n)for(var e=0;e<this.P[n].V.length;++e)this.P[n].V[e].drawVertex(t,this.vertexColor)},n.prototype.drawEdge=function(t){if(null!=this.edgeColor&&this.defined()){var n=t.getContext("2d");n.strokeStyle=this.edgeColor;for(var e=0;e<this.P.length;++e)for(var o=0;o<this.P[e].V.length;++o){var r=this.P[e].V[o],i=this.P[e].V[(o+1)%this.P[e].V.length];n.beginPath(),n.moveTo(r.x,r.y),n.lineTo(i.x,i.y),n.stroke()}}},n.prototype.drawFace=function(t){if(null!=this.faceColor&&this.defined())for(var n=0;n<this.P.length;++n){var e=this.P[n].faceColor;this.P[n].faceColor=this.faceColor,this.P[n].drawFace(t),this.P[n].faceColor=e}},n.prototype.update=function(){},n.prototype.translate=function(t,n){},n.prototype.rotate=function(t,n,e){},n}(e(8020).GeomElement);n.PolyhedronElement=i},444(t,n,e){var o,r=this&&this.__extends||(o=function(t,n){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},o(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function e(){this.constructor=t}o(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)});Object.defineProperty(n,"__esModule",{value:!0}),n.PrismElement=void 0;var i=e(3857),s=e(7091),u=e(6091),c=function(t){function n(n,e,o){var r=t.call(this)||this;r.dimension=2,r._C=e,r._D=o;var i=n.V.length,c=2+i;r.P=new Array(c),r.P[0]=n;for(var l=new Array(i),a=0;a<i;++a)l[a]=new u.PointElement,l[a].to(n.V[a]).plus(o).minus(e);r.P[1]=new s.PolygonElement(l);for(var h=2;h<c;++h)r.P[h]=new s.PolygonElement([n.V[h-2],n.V[(h-1)%i],r.P[1].V[(h-1)%i],r.P[1].V[h-2]]);return r}return r(n,t),n.prototype.translate=function(t,n){for(var e=0;e<this.P[1].V.length;++e)this.P[1].V[e].translate(t,n)},n.prototype.rotate=function(t,n,e){for(var o=0;o<this.P[1].V.length;++o)this.P[1].V[o].rotate(t,n,e)},n.prototype.update=function(){for(var t=0;t<this.P[1].V.length;++t)this.P[1].V[t].to(this.P[0].V[t]).plus(this._D).minus(this._C)},n}(i.PolyhedronElement);n.PrismElement=c},2383(t,n,e){var o,r=this&&this.__extends||(o=function(t,n){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},o(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function e(){this.constructor=t}o(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)});Object.defineProperty(n,"__esModule",{value:!0}),n.PyramidElement=void 0;var i=e(3857),s=e(7091),u=function(t){function n(n,e){var o=t.call(this)||this;o.dimension=2;var r=1+n.V.length;o.P=new Array(r),o.P[0]=n;for(var i=1;i<r;++i)o.P[i]=new s.PolygonElement([e,n.V[i-1],n.V[i%n.V.length]]);return o}return r(n,t),n}(i.PolyhedronElement);n.PyramidElement=u},5483(t,n,e){var o,r=this&&this.__extends||(o=function(t,n){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},o(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function e(){this.constructor=t}o(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)});Object.defineProperty(n,"__esModule",{value:!0}),n.ArcElement=void 0;var i=e(1025),s=e(6091),u=function(t){function n(n,e,o,r){var i=t.call(this)||this;return i.dimension=2,i._Center=new s.PointElement,i._A=n,i._M=e,i._B=o,i._P=r,i}return r(n,t),n.prototype.update=function(){this._P.update(),this._Center.toCircumcenter(this._A,this._M,this._B)},n.prototype.translate=function(t,n){this._Center.translate(t,n)},n.prototype.rotate=function(t,n,e){this._Center.rotate(t,n,e)},n}(i.SectorElement);n.ArcElement=u},5755(t,n,e){var o,r=this&&this.__extends||(o=function(t,n){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},o(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function e(){this.constructor=t}o(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)});Object.defineProperty(n,"__esModule",{value:!0}),n.sectorConstructions=n.ArcConstruction=n.SectorConstruction=void 0;var i=e(7658),s=e(6055),u=e(1025),c=e(5483),l=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.SectorConstructions.sector,n.signature={points:3,elements:0,integers:0},n}return r(n,t),n.prototype.validateSignature=function(t,n){return t===this.constructionMethod&&3===n.P.length&&0===n.N.length&&(0===n.E.length||1===n.E.length&&n.E[0]instanceof s.PlaneElement)},n.prototype.construct=function(t,n,e,o){var r=e.length>0?e[0]:t,i=new u.SectorElement({O:n[0],A:n[1],B:n[2],P:r});return[[i],i]},n}(i.Construction);n.SectorConstruction=l;var a=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.SectorConstructions.arc,n.signature={points:3,elements:0,integers:0},n}return r(n,t),n.prototype.validateSignature=function(t,n){return t===this.constructionMethod&&3===n.P.length&&0===n.N.length&&(0===n.E.length||1===n.E.length&&n.E[0]instanceof s.PlaneElement)},n.prototype.construct=function(t,n,e,o){var r=e.length>0?e[0]:t,i=new c.ArcElement(n[0],n[1],n[2],r);return[[i],i]},n}(i.Construction);n.ArcConstruction=a,n.sectorConstructions=[new l,new a]},1025(t,n,e){var o,r=this&&this.__extends||(o=function(t,n){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},o(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function e(){this.constructor=t}o(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)});Object.defineProperty(n,"__esModule",{value:!0}),n.SectorElement=void 0;var i=function(t){function n(n){var e=t.call(this)||this;return e._angle=null,e.dimension=2,null!=n&&(e._Center=n.O,e._A=n.A,e._B=n.B,e._P=n.P),e}return r(n,t),n.prototype.radius=function(){return this._Center.distance(this._A)},n.prototype.defined=function(){return this._A.defined()&&this._B.defined()&&this._Center.defined()},n.prototype._updateThroughPoint=function(){0!=this.radius()&&(this._angle=Math.atan2(this._B.y-this._A.y,this._B.x-this._A.x)-Math.atan2(this._Center.y-this._A.y,this._Center.x-this._A.x),this._Center.x,Math.cos(this._angle/2),this._Center.y,Math.sin(this._angle/2))},n.prototype.drawEdge=function(t){if(null!=this.edgeColor&&this.defined()){var n=t.getContext("2d");n.strokeStyle=this.edgeColor,n.beginPath();var e=this.radius(),o=Math.atan2(this._A.y-this._Center.y,this._A.x-this._Center.x),r=o+this._Center.angle(this._A,this._B,this._P);n.arc(this._Center.x,this._Center.y,e,o,r,!0),n.stroke()}},n.prototype.drawFace=function(t){if(null!=this.faceColor&&this.defined()){var n=t.getContext("2d");n.fillStyle=this.faceColor,n.beginPath();var e=this.radius(),o=Math.atan2(this._A.y-this._Center.y,this._A.x-this._Center.x),r=this._Center.angle(this._A,this._B,this._P),i=o+r;n.arc(this._Center.x,this._Center.y,e,o,i,!0),n.moveTo(this._Center.x,this._Center.y),r<=180?(n.lineTo(this._A.x,this._A.y),n.lineTo(this._B.x,this._B.y)):(n.lineTo(this._B.x,this._B.y),n.lineTo(this._A.x,this._A.y)),n.lineTo(this._Center.x,this._Center.y),n.fill()}},n.prototype.drawName=function(t){},n.prototype.drawVertex=function(t){},n.prototype.rotate=function(t,n,e){},n.prototype.translate=function(t,n){},n.prototype.update=function(){this._updateThroughPoint()},n}(e(8020).GeomElement);n.SectorElement=i},8649(t,n,e){var o,r=this&&this.__extends||(o=function(t,n){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},o(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function e(){this.constructor=t}o(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)});Object.defineProperty(n,"__esModule",{value:!0}),n.sphereConstructions=n.SphereRadius3PointConstruction=n.SphereRadiusConstruction=void 0;var i=e(7658),s=e(2295),u=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.SphereConstructions.radius,n.signature={points:2,elements:0,integers:0},n}return r(n,t),n.prototype.construct=function(t,n,e,o){var r=new s.SphereElement({Center:n[0],B:n[1]});return[[r],r]},n}(i.Construction);n.SphereRadiusConstruction=u;var c=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.SphereConstructions.radius,n.signature={points:3,elements:0,integers:0},n}return r(n,t),n.prototype.construct=function(t,n,e,o){var r=new s.SphereElement({Center:n[0],A:n[1],B:n[2]});return[[r],r]},n}(i.Construction);n.SphereRadius3PointConstruction=c,n.sphereConstructions=[new c,new u]},2295(t,n,e){var o,r=this&&this.__extends||(o=function(t,n){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},o(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function e(){this.constructor=t}o(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)});Object.defineProperty(n,"__esModule",{value:!0}),n.SphereElement=void 0;var i=e(8020),s=e(6091),u=function(t){function n(n){var e=t.call(this)||this;return e.dimension=2,e._Center=n&&n.Center||new s.PointElement,e._A=n&&n.A||e._Center,e._B=n&&n.B||new s.PointElement,e}return r(n,t),Object.defineProperty(n.prototype,"Center",{get:function(){return this._Center},enumerable:!1,configurable:!0}),n.prototype.drawName=function(t){null!=this.nameColor&&null!=this.name&&this.defined()&&this.drawString(Math.round(this._Center.x),Math.round(this._Center.y),t,i.Align.CENTRAL)},n.prototype.defined=function(){return!0},n.prototype.drawEdge=function(t){if(null!=this.edgeColor&&this.defined()){var n=t.getContext("2d");n.save(),n.strokeStyle=this.edgeColor;var e=this.radius();n.beginPath(),n.ellipse(this._Center.x,this._Center.y,e,e,0,0,2*Math.PI),n.stroke(),n.restore()}},n.prototype.drawFace=function(t){if(null!=this.faceColor&&this.defined()){var n=t.getContext("2d");n.save(),n.fillStyle=this.faceColor;var e=this.radius();n.beginPath(),n.ellipse(this._Center.x,this._Center.y,e,e,0,0,2*Math.PI),n.fill(),n.restore()}},n.prototype.radius=function(){return this._A.distance(this._B)},n.prototype.radius2=function(){return this._A.distance2(this._B)},n.prototype.drawVertex=function(){},n.prototype.update=function(){},n.prototype.translate=function(t,n){},n.prototype.rotate=function(t,n,e,o){},n}(i.GeomElement);n.SphereElement=u},8156(t,n,e){Object.defineProperty(n,"__esModule",{value:!0}),n.slates=n.E=n.Align=void 0,n.parseParam=h,n.init=function(t){var e=null!=t.align?t.align:o.Align.CENTRAL,r=t.canvasid;null==r&&(r="canvasid");var a=document.getElementById(r);!function(t){var n=t.clientWidth,e=t.clientHeight;t.width==n&&t.height==e||(t.width=n,t.height=e)}(a);var p=new s.Slate(a);n.slates.push(p);var f=null!=t.font?t.font:"Times New Roman",_=null!=t.fontsize?t.fontsize:18;o.GeomElement.setFont(f,_),p.bgcolor=(0,c.parseColor)(t.background,"#ffffff","#ffffff");for(var y=0,d=t.elements;y<d.length;y++){var v=d[y],g="string"==typeof v?h(v):v,P=p.createElement(g.construction,g.params,g.name);P.align=e;var C=P instanceof i.PointElement?"black":null;P.nameColor=(0,c.parseColor)(g.nameColor,C,p.bgcolor);var m=P.draggable?P instanceof u.PlaneSlider?"red":"orange":"black";P.vertexColor=(0,c.parseColor)(g.vertexColor,m,p.bgcolor),P.edgeColor=(0,c.parseColor)(g.edgeColor,"black",p.bgcolor);var w=(0,c.lighten)(p.bgcolor),x=2==P.dimension?w:null;P.faceColor=(0,c.parseColor)(g.faceColor,x,p.bgcolor)}null!=t.pivot&&p.setPivot(t.pivot),p.update(),p.updateCoordinates(0),a&&a.parentElement&&(0,l.createControls)(p,a,t)};var o=e(8020);Object.defineProperty(n,"Align",{enumerable:!0,get:function(){return o.Align}});var r=e(7658);Object.defineProperty(n,"E",{enumerable:!0,get:function(){return r.E}});var i=e(6091),s=e(8041),u=e(4994),c=e(1454),l=e(3267);n.slates=[];var a={point:"Point",line:"Line",circle:"Circle",polygon:"Polygon",sector:"Sector",plane:"Plane",sphere:"Sphere",polyhedron:"Polyhedra"};function h(t){var n=t.split(";");if(n.length<4)throw new Error("parseParam: expected at least 4 semicolon-separated fields, got ".concat(n.length,': "').concat(t,'"'));var e=n[0],o=n[1],i=n[2],s=n[3],u=a[o];if(null==u)throw new Error('parseParam: unknown element type "'.concat(o,'" in "').concat(t,'"'));var c=r.E[u]["3points"===i?"threePoints":i];if(null==c)throw new Error('parseParam: unknown construction "'.concat(o,";").concat(i,'" in "').concat(t,'"'));var l={name:e,construction:c,params:s.split(",").map((function(t){var n=Number(t);return""===t||isNaN(n)?t:n}))};return n.length>4&&void 0!==n[4]&&(l.nameColor=n[4]),n.length>5&&void 0!==n[5]&&(l.vertexColor=n[5]),n.length>6&&void 0!==n[6]&&(l.edgeColor=n[6]),n.length>7&&void 0!==n[7]&&(l.faceColor=n[7]),l}}},n={},e=function e(o){var r=n[o];if(void 0!==r)return r.exports;var i=n[o]={exports:{}};return t[o].call(i.exports,i,i.exports,e),i.exports}(8156);geomlib=e})();
1
+ var geomlib;(()=>{"use strict";var t={1454(t,n){function e(){var t=s(Math.random(),Math.random(),1);return"rgb(".concat(t.r,",").concat(t.g,",").concat(t.b,")")}function o(t){var n=i(t);if(null==n)return t;var e=.7,o=Math.ceil(1/(1-e)),r=0===n.r?o:Math.min(Math.floor(n.r/e),255),s=0===n.g?o:Math.min(Math.floor(n.g/e),255),u=0===n.b?o:Math.min(Math.floor(n.b/e),255);return r<o&&(r=o),s<o&&(s=o),u<o&&(u=o),"rgb(".concat(r,",").concat(s,",").concat(u,")")}function r(t){var n=i(t);if(null==n)return t;var e=Math.floor(.7*n.r),o=Math.floor(.7*n.g),r=Math.floor(.7*n.b);return"rgb(".concat(e,",").concat(o,",").concat(r,")")}function i(t){if(null==t)return null;var e=t.match(/^rgb\((\d+),(\d+),(\d+)\)$/);if(e)return{r:parseInt(e[1]),g:parseInt(e[2]),b:parseInt(e[3])};if(t in n.colors)return i(n.colors[t]);var o=t.replace(/^#/,"");if(/^[0-9a-fA-F]{6}$/.test(o)){var r=parseInt(o,16);return{r:r>>16&255,g:r>>8&255,b:255&r}}var u=t.split(",");if(3===u.length){var c=parseInt(u[0])/360,l=parseInt(u[1])/100,a=parseInt(u[2])/100;if(!isNaN(c)&&!isNaN(l)&&!isNaN(a))return s(c,l,a)}return null}function s(t,n,e){var o,r,i,s=Math.floor(6*t),u=6*t-s,c=e*(1-n),l=e*(1-u*n),a=e*(1-(1-u)*n);switch(s%6){case 0:o=e,r=a,i=c;break;case 1:o=l,r=e,i=c;break;case 2:o=c,r=e,i=a;break;case 3:o=c,r=l,i=e;break;case 4:o=a,r=c,i=e;break;case 5:o=e,r=c,i=l}return{r:Math.round(255*o),g:Math.round(255*r),b:Math.round(255*i)}}Object.defineProperty(n,"__esModule",{value:!0}),n.colors=void 0,n.parseColor=function(t,i,u){if(0===t)return null;if(null==t)return i;var c=String(t);if("none"===c||"0"===c||""===c)return null;if("random"===c)return e();if("background"===c)return u;if("brighter"===c)return o(u);if("darker"===c)return r(u);if(c in n.colors)return n.colors[c];var l=c.replace(/^#/,"");if(/^[0-9a-fA-F]+$/.test(l)){var a=parseInt(l,16);if(!isNaN(a)){var h=a>>8&255,p=255&a;return"rgb(".concat(a>>16&255,",").concat(h,",").concat(p,")")}}var f=c.split(",");if(3===f.length){var _=parseInt(f[0])/360,y=parseInt(f[1])/100;if(p=parseInt(f[2])/100,!isNaN(_)&&!isNaN(y)&&!isNaN(p)){var d=s(_,y,p);return"rgb(".concat(d.r,",").concat(d.g,",").concat(d.b,")")}}return null},n.randomColor=e,n.brighter=o,n.darker=r,n.lighten=function(t){return o(t)},n.darken=function(t){return r(t)},n.colors={black:"rgb(0,0,0)",blue:"rgb(0,0,255)",cyan:"rgb(0,255,255)",darkGray:"rgb(64,64,64)",gray:"rgb(128,128,128)",green:"rgb(0,255,0)",lightGray:"rgb(192,192,192)",magenta:"rgb(255,0,255)",orange:"rgb(255,200,0)",pink:"rgb(255,175,175)",red:"rgb(255,0,0)",white:"rgb(255,255,255)",yellow:"rgb(255,255,0)"}},8041(t,n,e){var o=this&&this.__spreadArray||function(t,n,e){if(e||2===arguments.length)for(var o,r=0,i=n.length;r<i;r++)!o&&r in n||(o||(o=Array.prototype.slice.call(n,0,r)),o[r]=n[r]);return t.concat(o||Array.prototype.slice.call(n))};Object.defineProperty(n,"__esModule",{value:!0}),n.Slate=void 0;var r=e(6055),i=e(6401),s=e(7658),u=e(6091),c=e(2145),l=function(){function t(n){var e=this;if(this._htmlCanvas=null,this.inTest=!1,this._itsNumSlate=-1,t.numSlate+=1,this._itsNumSlate=t.numSlate,this._elements=[],this._elementsForUpdate=[],null==n)throw new TypeError("canvas cannot be null or undefined.");this._canvas=n;var s=new i.FixedPoint({x:0,y:0,z:0});s.name="screen_origin";var u=new i.FixedPoint({x:1,y:0,z:0});u.name="screen_x";var c=new i.FixedPoint({x:0,y:1,z:0});c.name="screen_y";var l=new r.PlaneElement({A:s,B:u,C:c});l.name="screen",l.nameColor=null,l.isScreen=!0,this._screen=l,this._pick=null;for(var a=0,h=[s,u,c,l];a<h.length;a++){var p=h[a];p.nameColor=null,p.vertexColor=null,p.vertexHighlightColor=null,p.faceColor=null,p.faceHighlightColor=null,this._elements.push(p)}this._elementsForUpdate=o([],this._elements,!0);var f=this,_=this._canvas;if(this._htmlCanvas=_,null!=this._htmlCanvas.addEventListener){this._htmlCanvas.addEventListener("mousedown",(function(t){var n=e._getCanvasPosition(t.clientX,t.clientY),o=n[0],r=n[1];f._onMouseDown(o,r)})),this._htmlCanvas.addEventListener("mouseup",(function(t){var n=e._getCanvasPosition(t.clientX,t.clientY),o=n[0],r=n[1];f._onMouseUp(o,r)})),this._htmlCanvas.addEventListener("mousemove",(function(t){var n=e._getCanvasPosition(t.clientX,t.clientY),o=n[0],r=n[1];f._onMouseDrag(o,r)}));for(var y=function(t,n){d._htmlCanvas.addEventListener(t,(function(t){var e=f._getTouchPos(t),o=new MouseEvent(n,{clientX:e[0],clientY:e[1]});f._htmlCanvas.dispatchEvent(o)}))},d=this,v=0,g=[["touchend","mouseup"],["touchstart","mousedown"],["touchmove","mousemove"]];v<g.length;v++){var P=g[v];y(P[0],P[1])}for(var C=0,m=["touchstart","touchmove","touchend"];C<m.length;C++){var w=m[C];document.body.addEventListener(w,(function(t){t.target==f._htmlCanvas&&t.preventDefault()}),!1)}}}return t.prototype._getTouchPos=function(t){if(null!=this._htmlCanvas){var n=this._htmlCanvas.getBoundingClientRect();return[t.touches[0].clientX-n.left,t.touches[0].clientY-n.top]}},t.prototype._getCanvasPosition=function(t,n){var e=this._htmlCanvas.getBoundingClientRect();return[t-e.left,n-e.top]},t.prototype._onMouseDown=function(t,n){this._pick=null,this.movePick(t,n)},t.prototype._onMouseUp=function(t,n){null!=this._pick&&(this.movePick(t,n),this._pick=null)},t.prototype._onMouseDrag=function(t,n){null!=this._pick&&this.movePick(t,n)},Object.defineProperty(t.prototype,"elements",{get:function(){return this._elements},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"elementsForUpdate",{get:function(){return this._elementsForUpdate},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"bgcolor",{get:function(){return this._bgcolor},set:function(t){this._bgcolor=t},enumerable:!1,configurable:!0}),t.prototype.lookupElement=function(t){for(var n=0,e=this._elements;n<e.length;n++){var o=e[n];if(o.name==t)return o}return null},t.prototype.convertParams=function(t){for(var n=[],e=[],o=[],r=0,i=t;r<i.length;r++){var s=i[r];switch(typeof s){case"string":var l=this.lookupElement(s);if(null==l)throw new TypeError("Element with name ".concat(s," not found."));l instanceof u.PointElement?n.push(l):l instanceof c.LineElement?(n.push(l.A),n.push(l.B)):e.push(l);break;case"number":o.push(s);break;default:throw new TypeError("Expecting only named elements (strings) or numbers.")}}return{P:n,E:e,N:o}},t.prototype.findConstruction=function(t,n){for(var e=0,o=s.constructions;e<o.length;e++){var r=o[e];if(r.validateSignature(t,n))return r}return null},t.prototype.createElement=function(t,n,e){var o=this.convertParams(n),r=this.findConstruction(t,o);if(null==r){var i=(0,s.getConstructionName)(t);throw null==e&&(e=""),new TypeError('Construction not found for "'.concat(e,'" ').concat(i," with params P=[").concat(o.P,"] E=[").concat(o.E,"] N=[").concat(o.N,"]"))}var u=r.construct(this._screen,o.P,o.E,o.N),c=u[0],l=u[1];-1!==this._elements.indexOf(l)&&(l.preexists=!0),null!=e&&(l.name=e);for(var a=0,h=c;a<h.length;a++){var p=h[a];-1==this._elementsForUpdate.indexOf(p)&&this._elementsForUpdate.push(p),-1==this._elements.indexOf(p)&&this._elements.push(p)}return-1==this._elements.indexOf(l)&&this._elements.push(l),l},t.prototype.reset=function(){for(var t=0,n=this._elements;t<n.length;t++)n[t].reset();this.update()},t.prototype.update=function(){for(var t=0,n=this._elementsForUpdate;t<n.length;t++)n[t].update();this.drawElements()},t.prototype.drawElements=function(){if(!this.inTest){var t=this._canvas.width,n=this._canvas.height,e=this._canvas.getContext("2d");e.clearRect(0,0,t,n),e.fillStyle=this._bgcolor,e.fillRect(0,0,t,n);for(var o=0,r=this._elements;o<r.length;o++)r[o].drawFace(this._canvas);for(var i=0,s=this._elements;i<s.length;i++)s[i].drawEdge(this._canvas);for(var u=0,c=this._elements;u<c.length;u++)c[u].drawVertex(this._canvas);for(var l=0,a=this._elements;l<a.length;l++)a[l].drawName(this._canvas)}},t.prototype.updateCoordinates=function(t){for(++t;t<this._elements.length;t++)this._elements[t].defined()||this._elements[t].reset(),this._elements[t].update();this.drawElements()},t.prototype.translateCoordinates=function(t,n){for(var e=0;e<this._elements.length;e++){var o=this._elements[e];o.preexists||o.translate(t,n)}this.update()},t.prototype.closestVisiblePoint=function(t,n,e){void 0===e&&(e=30);var o=function(t,n){return(t.x-n.x)*(t.x-n.x)+(t.y-n.y)*(t.y-n.y)},r=t.filter((function(t){return t instanceof u.PointElement})).map((function(t){return t})).filter((function(t){return null!=t.vertexColor})).sort((function(t,e){var r=o(t,n),i=o(e,n);return r<i?-1:i<r?1:0}));if(0==r.length)return null;var i=r[0];return Math.sqrt(o(i,n))>e?null:i},t.prototype._getPick=function(t,n){if(null!=this._pick)return this._pick;var e=new u.PointElement({x:t,y:n}),o=this.closestVisiblePoint(this._elements,e);return null!=o?(this._pick=o,this._pick):void 0},t.prototype.setPivot=function(t){var n=t.split(","),e=n[0].trim(),o=this.lookupElement(e);if(null!=o&&o instanceof u.PointElement){var i=o;if(n.length>1){var s=n[1].trim(),c=this.lookupElement(s);if(null==c||!(c instanceof r.PlaneElement))return;c.pivot=i}else i._AP=this._screen,this._screen.pivot=i}},t.prototype.movePick=function(t,n){if(null!=this._getPick(t,n)){var e=this._elements.indexOf(this._pick),o=this._canvas.width;t<0?t=0:t>o&&(t=o);var r=this._canvas.height;if(n<0?n=0:n>r&&(n=r),!(Math.abs(t-this._pick.x)+Math.abs(n-this._pick.y)<1)){if(this._pick.draggable){if(!this._pick.drag(t,n))return;this.updateCoordinates(e)}else if(null!=this._pick.AP&&null!=this._pick.AP.pivot&&this._pick.AP.pivot!=this._pick)this.rotateCoordinates(t,n);else{var i=t-this._pick.x,s=n-this._pick.y;this.translateCoordinates(i,s)}this.drawElements()}}},t.prototype.rotateCoordinates=function(t,n){for(var e=this._pick,o=e.AP.pivot,r=u.PointElement.difference(e,o),i=t-o.x,s=n-o.y,c=e.AP.S,l=e.AP.T,a=u.PointElement.dot(r,c),h=u.PointElement.dot(r,l),p=c.x*l.y-c.y*l.x,f=(i*l.y-s*l.x)/p,_=(s*c.x-i*c.y)/p,y=(f*a+_*h)/(p=a*a+h*h),d=(_*a-f*h)/p,v=0,g=this._elements;v<g.length;v++){var P=g[v];P.preexists||P.rotate(o,y,d)}this.update()},t.numSlate=0,t}();n.Slate=l},3267(t,n){Object.defineProperty(n,"__esModule",{value:!0}),n.createControls=function(t,n,e){n.parentElement&&new o(t,n,e).init()};var e=20,o=function(){function t(t,n,e){this._maximized=!1,this._savedStyles=null,this._slate=t,this._canvas=n,this._config=e}return t.prototype.init=function(){this._wrapper=this.createWrapper(),this.createButtons(),this.addKeyboardShortcuts()},t.prototype.createWrapper=function(){var t=this,n=document.createElement("div");return n.style.position="relative",n.style.display="inline-block",this._canvas.parentElement.insertBefore(n,this._canvas),n.appendChild(this._canvas),this._canvas.setAttribute("tabindex","0"),this._canvas.style.outline="none",this._canvas.addEventListener("focus",(function(){t._canvas.style.outline="2px solid rgba(66,133,244,0.5)"})),this._canvas.addEventListener("blur",(function(){t._canvas.style.outline="none"})),n},t.prototype.createButtons=function(){for(var t=this,n=[{draw:r,action:function(){return t.onReset()},title:"Reset (r)"},{draw:i,action:function(){return t.onMaximize()},title:"Maximize (m)"},{draw:s,action:function(){return t.onNewWindow()},title:"New Window (u)"}],o=function(o){var r=document.createElement("button");r.style.position="absolute",r.style.top="8px",r.style.right=8+24*o+"px",r.style.width="20px",r.style.height="20px",r.style.padding="0",r.style.border="none",r.style.cursor="pointer",r.style.background="rgba(0,0,0,0.12)",r.style.borderRadius="3px",r.title=n[o].title,r.addEventListener("mouseenter",(function(){r.style.background="rgba(0,0,0,0.3)"})),r.addEventListener("mouseleave",(function(){r.style.background="rgba(0,0,0,0.12)"}));var i=document.createElement("canvas");i.width=e,i.height=e,i.style.display="block";var s=i.getContext("2d");n[o].draw(s,e),r.appendChild(i),r.addEventListener("click",(function(e){e.stopPropagation(),n[o].action(),t._canvas.focus()})),1===o&&(u._maxBtn=r,u._maxIconCanvas=i),u._wrapper.appendChild(r)},u=this,c=0;c<n.length;c++)o(c)},t.prototype.addKeyboardShortcuts=function(){var t=this;this._canvas.addEventListener("keydown",(function(n){switch(n.key){case"r":case"R":case" ":n.preventDefault(),t.onReset();break;case"u":case"U":case"Enter":n.preventDefault(),t.onNewWindow();break;case"m":case"M":n.preventDefault(),t.onMaximize()}}))},t.prototype.onReset=function(){this._slate.reset()},t.prototype.onMaximize=function(){this._maximized?this.minimize():this.maximize()},t.prototype.maximize=function(){this._savedStyles={wrapperPosition:this._wrapper.style.position,wrapperTop:this._wrapper.style.top,wrapperLeft:this._wrapper.style.left,wrapperWidth:this._wrapper.style.width,wrapperHeight:this._wrapper.style.height,wrapperZIndex:this._wrapper.style.zIndex,wrapperBackground:this._wrapper.style.background,canvasStyleWidth:this._canvas.style.width,canvasStyleHeight:this._canvas.style.height,canvasAttrWidth:this._canvas.width,canvasAttrHeight:this._canvas.height},this._wrapper.style.position="fixed",this._wrapper.style.top="0",this._wrapper.style.left="0",this._wrapper.style.width="100vw",this._wrapper.style.height="100vh",this._wrapper.style.zIndex="9999",this._wrapper.style.background="white",this._canvas.style.width="100%",this._canvas.style.height="100%",this.resizeAndRedraw(),this._maximized=!0,this.updateMaximizeIcon()},t.prototype.minimize=function(){this._savedStyles&&(this._wrapper.style.position=this._savedStyles.wrapperPosition,this._wrapper.style.top=this._savedStyles.wrapperTop,this._wrapper.style.left=this._savedStyles.wrapperLeft,this._wrapper.style.width=this._savedStyles.wrapperWidth,this._wrapper.style.height=this._savedStyles.wrapperHeight,this._wrapper.style.zIndex=this._savedStyles.wrapperZIndex,this._wrapper.style.background=this._savedStyles.wrapperBackground,this._canvas.style.width=this._savedStyles.canvasStyleWidth,this._canvas.style.height=this._savedStyles.canvasStyleHeight,this._canvas.width=this._savedStyles.canvasAttrWidth,this._canvas.height=this._savedStyles.canvasAttrHeight,this.resizeAndRedraw(),this._maximized=!1,this._savedStyles=null,this.updateMaximizeIcon())},t.prototype.resizeAndRedraw=function(){var t=this._canvas.clientWidth,n=this._canvas.clientHeight;this._canvas.width===t&&this._canvas.height===n||(this._canvas.width=t,this._canvas.height=n),this._slate.update()},t.prototype.updateMaximizeIcon=function(){var t=this._maxIconCanvas,n=this._maxBtn;if(t){var o=t.getContext("2d");o.clearRect(0,0,e,e),this._maximized?(function(t){var n=12;t.strokeStyle="rgba(0,0,0,0.7)",t.fillStyle="rgba(0,0,0,0.7)",t.lineWidth=1.5;var e=16,o=4,r=4+.55*n,i=9.4;t.beginPath(),t.moveTo(e,o),t.lineTo(r,i),t.stroke(),t.beginPath(),t.moveTo(r,i),t.lineTo(r+5,i),t.lineTo(r,i-5),t.closePath(),t.fill(),e=4,o=16,r=9.4,i=4+.55*n,t.beginPath(),t.moveTo(e,o),t.lineTo(r,i),t.stroke(),t.beginPath(),t.moveTo(r,i),t.lineTo(r-5,i),t.lineTo(r,i+5),t.closePath(),t.fill()}(o),n.title="Minimize (m)"):(i(o,e),n.title="Maximize (m)")}},t.prototype.onNewWindow=function(){for(var t=document.querySelectorAll("script[src]"),n="bundle.js",e=0;e<t.length;e++){var o=t[e].src;if(o.indexOf("bundle.js")>=0){n=o;break}}var r=Object.assign({},this._config,{canvasid:"canvasId"}),i=JSON.stringify(r),s=this._config.title||"Geometry",u="<!DOCTYPE html>\n<html><head><title>".concat(s,'</title></head>\n<body style="margin:0;padding:0;overflow:hidden;">\n<canvas id="canvasId" style="width:100vw;height:100vh;"></canvas>\n<script src="').concat(n,'"><\/script>\n<script>geomlib.init(').concat(i,");<\/script>\n</body></html>"),c=window.open("","_blank");c&&(c.document.write(u),c.document.close())},t}();function r(t,n){var e=n/2,o=n/2,r=.32*n;t.strokeStyle="rgba(0,0,0,0.7)",t.fillStyle="rgba(0,0,0,0.7)",t.lineWidth=1.5,t.beginPath(),t.arc(e,o,r,.5*-Math.PI,.75*Math.PI),t.stroke();var i=.75*Math.PI,s=e+r*Math.cos(i),u=o+r*Math.sin(i),c=i+.3*Math.PI,l=i+.9*Math.PI;t.beginPath(),t.moveTo(s,u),t.lineTo(s+4*Math.cos(c),u+4*Math.sin(c)),t.lineTo(s+4*Math.cos(l),u+4*Math.sin(l)),t.closePath(),t.fill()}function i(t,n){var e=n-8;t.strokeStyle="rgba(0,0,0,0.7)",t.fillStyle="rgba(0,0,0,0.7)",t.lineWidth=1.5;var o=4+.55*e,r=4+.45*e,i=4+e,s=4;t.beginPath(),t.moveTo(o,r),t.lineTo(i,s),t.stroke(),t.beginPath(),t.moveTo(i,s),t.lineTo(i-5,s),t.lineTo(i,s+5),t.closePath(),t.fill(),o=4+.45*e,r=4+.55*e,i=4,s=4+e,t.beginPath(),t.moveTo(o,r),t.lineTo(i,s),t.stroke(),t.beginPath(),t.moveTo(i,s),t.lineTo(i+5,s),t.lineTo(i,s-5),t.closePath(),t.fill()}function s(t,n){var e=n-8;t.strokeStyle="rgba(0,0,0,0.7)",t.fillStyle="rgba(0,0,0,0.7)",t.lineWidth=1.5;var o=4+.3*e,r=.65*e,i=.7*e;t.strokeRect(4,o,r,i);var s=4+.4*e,u=4+.6*e,c=4+e;t.beginPath(),t.moveTo(s,u),t.lineTo(c,4),t.stroke(),t.beginPath(),t.moveTo(c,4),t.lineTo(c-5,4),t.lineTo(c,9),t.closePath(),t.fill()}},7658(t,n,e){var o,r,i,s,u,c,l,a,h,p=this&&this.__spreadArray||function(t,n,e){if(e||2===arguments.length)for(var o,r=0,i=n.length;r<i;r++)!o&&r in n||(o||(o=Array.prototype.slice.call(n,0,r)),o[r]=n[r]);return t.concat(o||Array.prototype.slice.call(n))};Object.defineProperty(n,"__esModule",{value:!0}),n.constructions=n.Construction=n.E=n.PolyhedraConstructions=n.SphereConstructions=n.PlaneConstructions=n.SectorConstructions=n.PolygonConstructions=n.CircleConstructions=n.LineConstructions=n.PointConstructions=n.ConstructionTypes=void 0,n.getConstructionName=function(t){return t<100?"Point."+r[t]:100<t&&t<200?"Line."+i[t]:300<t&&t<400?"Polygon."+u[t]:400<t&&t<500?"Sector."+c[t]:500<t&&t<600?"Plane."+l[t]:600<t&&t<700?"Sphere."+a[t]:700<t&&t<800?"Polyhedra."+h[t]:"<Not Valid Construction>"},function(t){t[t.Integer=0]="Integer",t[t.PointElement=1]="PointElement",t[t.CircleElement=2]="CircleElement",t[t.PlaneElement=3]="PlaneElement",t[t.SphereElement=4]="SphereElement",t[t.PolygonElement=5]="PolygonElement",t[t.PolyhedronElement=6]="PolyhedronElement"}(o||(n.ConstructionTypes=o={})),function(t){t[t.free=1]="free",t[t.midpoint=2]="midpoint",t[t.intersection=3]="intersection",t[t.first=4]="first",t[t.last=5]="last",t[t.center=6]="center",t[t.lineSlider=7]="lineSlider",t[t.circleSlider=8]="circleSlider",t[t.circumcenter=9]="circumcenter",t[t.vertex=10]="vertex",t[t.foot=11]="foot",t[t.cutoff=12]="cutoff",t[t.extend=13]="extend",t[t.parallelogram=14]="parallelogram",t[t.similar=15]="similar",t[t.perpendicular=16]="perpendicular",t[t.proportion=17]="proportion",t[t.invert=18]="invert",t[t.meanProportional=19]="meanProportional",t[t.planeSlider=20]="planeSlider",t[t.sphereSlider=21]="sphereSlider",t[t.angleBisector=22]="angleBisector",t[t.angleDivider=23]="angleDivider",t[t.fixed=24]="fixed",t[t.lineSegmentSlider=25]="lineSegmentSlider",t[t.harmonic=26]="harmonic"}(r||(n.PointConstructions=r={})),function(t){t[t.connect=101]="connect",t[t.angleBisector=102]="angleBisector",t[t.angleDivider=103]="angleDivider",t[t.foot=104]="foot",t[t.chord=105]="chord",t[t.bichord=106]="bichord",t[t.perpendicular=107]="perpendicular",t[t.cutoff=108]="cutoff",t[t.extend=109]="extend",t[t.parallel=110]="parallel",t[t.similar=111]="similar",t[t.proportion=112]="proportion",t[t.meanProportional=113]="meanProportional"}(i||(n.LineConstructions=i={})),function(t){t[t.radius=201]="radius",t[t.circumcircle=202]="circumcircle",t[t.invert=203]="invert",t[t.intersection=204]="intersection"}(s||(n.CircleConstructions=s={})),function(t){t[t.square=301]="square",t[t.triangle=302]="triangle",t[t.quadrilateral=303]="quadrilateral",t[t.pentagon=304]="pentagon",t[t.hexagon=305]="hexagon",t[t.equilateralTriangle=306]="equilateralTriangle",t[t.parallelogram=307]="parallelogram",t[t.regularPolygon=308]="regularPolygon",t[t.starPolygon=309]="starPolygon",t[t.similar=310]="similar",t[t.application=311]="application",t[t.octagon=312]="octagon",t[t.face=313]="face"}(u||(n.PolygonConstructions=u={})),function(t){t[t.sector=401]="sector",t[t.arc=402]="arc"}(c||(n.SectorConstructions=c={})),function(t){t[t.threePoints=501]="threePoints",t[t.perpendicular=502]="perpendicular",t[t.parallel=503]="parallel",t[t.ambient=504]="ambient"}(l||(n.PlaneConstructions=l={})),function(t){t[t.radius=601]="radius"}(a||(n.SphereConstructions=a={})),function(t){t[t.tetrahedron=701]="tetrahedron",t[t.parallelepiped=702]="parallelepiped",t[t.prism=703]="prism",t[t.pyramid=704]="pyramid"}(h||(n.PolyhedraConstructions=h={})),n.E={Point:r,Line:i,Circle:s,Polygon:u,Sector:c,Plane:l,Sphere:a,Polyhedra:h};var f=function(){function t(){}return t.prototype.validateSignature=function(t,n){if(t!=this.constructionMethod)return!1;var e=this.signature;if(e.points!==n.P.length)return!1;if(e.elements!==n.E.length)return!1;if(e.integers!==n.N.length)return!1;if(e.elementTypes)for(var o=0;o<e.elementTypes.length;o++)if(!(n.E[o]instanceof e.elementTypes[o]))return!1;return!0},t}();n.Construction=f;var _=e(4461),y=e(7339),d=e(9275),v=e(4133),g=e(5755),P=e(5193),C=e(8649),m=e(1099);n.constructions=p(p(p(p(p(p(p(p([],_.pointConstructions,!0),y.lineConstructions,!0),d.circleConstructions,!0),g.sectorConstructions,!0),v.polygonConstructions,!0),P.planeConstructions,!0),C.sphereConstructions,!0),m.polyhedronConstructions,!0)},8020(t,n){var e;Object.defineProperty(n,"__esModule",{value:!0}),n.GeomElement=n.Align=void 0,function(t){t[t.CENTRAL=0]="CENTRAL",t[t.LEFT=1]="LEFT",t[t.RIGHT=2]="RIGHT",t[t.ABOVE=3]="ABOVE",t[t.BELOW=4]="BELOW"}(e||(n.Align=e={}));var o=function(){function t(){this.preexists=!1,this._nameColor=null,this._vertexColor=null,this._edgeColor=null,this._faceColor=null,this._nameHighlightColor="#FF0000",this._vertexHighlightColor="#FFFFFF",this._edgeHighlightColor="#FFFFFF",this._faceHighlightColor="#00FFFF",this._shouldHighlight=!1,this._pixelTolerance=50}return t.setFont=function(n,e){t._font="italic ".concat(e,"px ").concat(n)},t.prototype._getTextMetrics=function(t,n){var e=t.measureText(n);return[e.width,null!=e.actualBoundingBoxAscent?e.actualBoundingBoxAscent+e.actualBoundingBoxDescent:16]},t.prototype.drawString=function(n,o,r,i){var s=r.getContext("2d");if(null!=this._nameColor){s.font=t._font,s.fillStyle=this._nameColor;var u=this._getTextMetrics(s,this._name),c=u[0],l=u[1];switch(i||this._align){case e.LEFT:return n=n-c-6,o=o+l/2-4,void s.fillText(this._name,n,o);case e.RIGHT:return n+=2,o+=l/2-4,void s.fillText(this._name,n,o);case e.ABOVE:return n-=c/2,o+=-l/2+4,void s.fillText(this._name,n,o);case e.BELOW:return n-=c/2,o+=l/2+6,void s.fillText(this._name,n,o)}var a=r.width,h=r.height,p=(n-a/2)*h,f=(o-h/2)*a;f>p?f>=-p?(n-=c/2,o+=l/2+6,s.fillText(this._name,n,o)):(n=n-c-6,o+=l/2-4,s.fillText(this._name,n,o)):f>=-p?(n+=2,o+=l/2-4,s.fillText(this._name,n,o)):(n-=c/2,o+=-l/2+4,s.fillText(this._name,n,o))}},Object.defineProperty(t.prototype,"name",{get:function(){return this._name},set:function(t){this._name=t},enumerable:!1,configurable:!0}),t.prototype.reset=function(){this.update()},t.prototype.defined=function(){return!1},t.prototype.drag=function(t,n){return!1},Object.defineProperty(t.prototype,"nameColor",{get:function(){return this._nameColor},set:function(t){this._nameColor=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"edgeColor",{get:function(){return this._edgeColor},set:function(t){this._edgeColor=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"faceColor",{get:function(){return this._faceColor},set:function(t){this._faceColor=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"nameHighlightColor",{get:function(){return this._nameHighlightColor},set:function(t){this._nameHighlightColor=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"vertexHighlightColor",{get:function(){return this._vertexHighlightColor},set:function(t){this._vertexHighlightColor=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"edgeHighlightColor",{get:function(){return this._edgeHighlightColor},set:function(t){this._edgeHighlightColor=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"faceHighlightColor",{get:function(){return this._faceHighlightColor},set:function(t){this._faceHighlightColor=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"draggable",{get:function(){return this._draggable},set:function(t){this._draggable=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dimension",{get:function(){return this._dimension},set:function(t){this._dimension=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"align",{get:function(){return this._align},set:function(t){this._align=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"shouldHighlight",{get:function(){return this._shouldHighlight},set:function(t){this._shouldHighlight=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"vertexColor",{get:function(){return this._vertexColor},set:function(t){this._vertexColor=t},enumerable:!1,configurable:!0}),t._font="italic 18px Times New Roman",t}();n.GeomElement=o},9275(t,n,e){var o,r=this&&this.__extends||(o=function(t,n){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},o(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function e(){this.constructor=t}o(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)});Object.defineProperty(n,"__esModule",{value:!0}),n.circleConstructions=n.SphereIntersectionConstruction=n.InvertCircleConstruction=n.CircleRadius3PointConstruction=n.CircleRadiusCenterConstruction=void 0;var i=e(7658),s=e(1313),u=e(4021),c=e(8157),l=e(6055),a=e(2295),h=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.CircleConstructions.radius,n.signature={points:2,elements:0,integers:0},n}return r(n,t),n.prototype.validateSignature=function(t,n){return t===this.constructionMethod&&2===n.P.length&&0===n.N.length&&(0===n.E.length||1===n.E.length&&n.E[0]instanceof l.PlaneElement)},n.prototype.construct=function(t,n,e,o){var r=e.length>0?e[0]:t,i=new s.CircleElement({C:n[0],B:n[1],AP:r});return[[i],i]},n}(i.Construction);n.CircleRadiusCenterConstruction=h;var p=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.CircleConstructions.radius,n.signature={points:3,elements:0,integers:0},n}return r(n,t),n.prototype.validateSignature=function(t,n){return t===this.constructionMethod&&3===n.P.length&&0===n.N.length&&(0===n.E.length||1===n.E.length&&n.E[0]instanceof l.PlaneElement)},n.prototype.construct=function(t,n,e,o){var r=e.length>0?e[0]:t,i=new s.CircleElement({C:n[0],A:n[1],B:n[2],AP:r});return[[i],i]},n}(i.Construction);n.CircleRadius3PointConstruction=p;var f=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.CircleConstructions.invert,n.signature={points:0,elements:2,integers:0,elementTypes:[s.CircleElement,s.CircleElement]},n}return r(n,t),n.prototype.construct=function(t,n,e,o){var r=new u.InvertCircleElement(e[0],e[1]);return[[r],r]},n}(i.Construction);n.InvertCircleConstruction=f;var _=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.CircleConstructions.intersection,n.signature={points:0,elements:2,integers:0,elementTypes:[a.SphereElement,a.SphereElement]},n}return r(n,t),n.prototype.construct=function(t,n,e,o){var r=new c.SphereIntersectionElement(e[0],e[1]);return[[r],r]},n}(i.Construction);n.SphereIntersectionConstruction=_,n.circleConstructions=[new p,new h,new f,new _]},1313(t,n,e){var o,r=this&&this.__extends||(o=function(t,n){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},o(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function e(){this.constructor=t}o(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)});Object.defineProperty(n,"__esModule",{value:!0}),n.CircleElement=void 0;var i=e(8020),s=function(t){function n(n){var e=t.call(this)||this;return e.dimension=2,null==n||(e.Center=n.C,e.A=null!=n.A?n.A:e.Center,e.B=n.B,e.AP=n.AP),e}return r(n,t),Object.defineProperty(n.prototype,"radius",{get:function(){return this.A.distance(this.B)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"radius2",{get:function(){return this.A.distance2(this.B)},enumerable:!1,configurable:!0}),n.prototype.defined=function(){return!0},n.prototype._drawCircle=function(t){t.beginPath();var n=this.radius2,e=Math.sqrt(n),o=this.AP.S.z*this.AP.S.z+this.AP.T.z*this.AP.T.z;if(Math.abs(o)<.01)t.ellipse(this.Center.x,this.Center.y,e,e,0,0,2*Math.PI);else{var r=e/Math.sqrt(o),i=r*this.AP.T.z,s=-r*this.AP.S.z,u=i*this.AP.S.x+s*this.AP.T.x,c=i*this.AP.S.y+s*this.AP.T.y,l=o<1?Math.sqrt(1-o):0,a=-l*c,h=l*u,p=Math.sqrt(u*u+c*c),f=Math.sqrt(a*a+h*h);if(f<.5)return t.moveTo(this.Center.x-u,this.Center.y-c),void t.lineTo(this.Center.x+u,this.Center.y+c);var _=Math.atan2(c,u);t.ellipse(this.Center.x,this.Center.y,p,f,_,0,2*Math.PI)}},n.prototype.drawEdge=function(t){if(null!=this.edgeColor&&this.defined()){var n=t.getContext("2d");n.strokeStyle=this.edgeColor,this._drawCircle(n),n.stroke()}},n.prototype.drawFace=function(t){if(null!=this.faceColor&&this.defined()){var n=t.getContext("2d");n.fillStyle=this.faceColor,this._drawCircle(n),n.fill()}},n.prototype.drawName=function(t){if(null!=this.nameColor&&null!=this.name){var n=t.getContext("2d");n.strokeStyle=this.nameColor,n.font=i.GeomElement._font;var e=this._getTextMetrics(n,this.name),o=e[0],r=e[1];n.fillText(this._name,this.Center.x-o/2,this.Center.y-r/2)}},n.prototype.drawVertex=function(t){},n.prototype.rotate=function(t,n,e){},n.prototype.translate=function(t,n){},n.prototype.update=function(){},n}(i.GeomElement);n.CircleElement=s},2218(t,n,e){var o,r=this&&this.__extends||(o=function(t,n){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},o(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function e(){this.constructor=t}o(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)});Object.defineProperty(n,"__esModule",{value:!0}),n.CircumcircleElement=void 0;var i=e(6091),s=function(t){function n(n,e,o,r){var s=t.call(this)||this;return s.dimension=2,s.B=n,s.C=e,s.D=o,s.AP=r,s.Center=new i.PointElement({AP:r}),s.A=s.Center,s}return r(n,t),n.prototype.update=function(){this.Center.toCircumcenter(this.B,this.C,this.D)},n.prototype.translate=function(t,n){this.Center.translate(t,n)},n.prototype.rotate=function(t,n,e){this.Center.rotate(t,n,e)},n}(e(1313).CircleElement);n.CircumcircleElement=s},4021(t,n,e){var o,r=this&&this.__extends||(o=function(t,n){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},o(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function e(){this.constructor=t}o(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)});Object.defineProperty(n,"__esModule",{value:!0}),n.InvertCircleElement=void 0;var i=e(1313),s=e(6091),u=function(t){function n(n,e){var o=t.call(this)||this;return o.dimension=2,o._C=n,o._D=e,o.AP=n.AP,o.Center=new s.PointElement({AP:o.AP}),o.A=o.Center,o.B=new s.PointElement({AP:o.AP}),o}return r(n,t),n.prototype.update=function(){var t=this._C.Center.distance2(this._D.Center),n=this._C.radius2,e=this._D.radius2/(t-n);this.Center.to(this._C.Center).minus(this._D.Center).times(e).plus(this._D.Center),e=1+Math.sqrt(n/t),this.B.to(this.Center).minus(this._D.Center).times(e).plus(this._D.Center)},n.prototype.translate=function(t,n){this.Center.translate(t,n),this.B.translate(t,n)},n.prototype.rotate=function(t,n,e){this.Center.rotate(t,n,e),this.B.rotate(t,n,e)},n}(i.CircleElement);n.InvertCircleElement=u},8157(t,n,e){var o,r=this&&this.__extends||(o=function(t,n){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},o(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function e(){this.constructor=t}o(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)});Object.defineProperty(n,"__esModule",{value:!0}),n.SphereIntersectionElement=void 0;var i=e(1313),s=e(6091),u=e(103),c=function(t){function n(n,e){var o=t.call(this)||this;return o.dimension=2,o._S=n,o._T=e,o.Center=o.A=new s.PointElement,o.B=new s.PointElement,o.AP=new u.PerpendicularPlane({A:o.Center,E:e.Center}),o.Center._AP=o.AP,o}return r(n,t),n.prototype.update=function(){var t=this._T.Center.distance2(this._S.Center),n=this._T.radius2(),e=.5+(n-this._S.radius2())/(2*t);this.Center.to(this._S.Center).minus(this._T.Center).times(e).plus(this._T.Center);var o=Math.sqrt(n-this.Center.distance2(this._T.Center));this.B.to(this.Center),this.B.z+=o,this.AP.update()},n.prototype.translate=function(t,n){this.Center.translate(t,n),this.B.translate(t,n),this.AP.translate(t,n)},n.prototype.rotate=function(t,n,e){this.Center.rotate(t,n,e),this.B.rotate(t,n,e),this.AP.rotate(t,n,e)},n}(i.CircleElement);n.SphereIntersectionElement=c},5002(t,n,e){var o,r=this&&this.__extends||(o=function(t,n){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},o(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function e(){this.constructor=t}o(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)});Object.defineProperty(n,"__esModule",{value:!0}),n.Bichord=void 0;var i=e(2145),s=e(6091),u=function(t){function n(n){var e=t.call(this)||this;return e.dimension=1,null==n||(e._A=new s.PointElement,e._B=new s.PointElement,e.C=n.C,e.D=n.D,e._A._AP=e.C.AP,e._B._AP=e.C.AP),e}return r(n,t),n.prototype.translate=function(t,n){this._A.translate(t,n),this._B.translate(t,n)},n.prototype.rotate=function(t,n,e){this._A.rotate(t,n,e),this._B.rotate(t,n,e)},n.prototype.update=function(){var t=this.C.radius,n=this.D.radius,e=this.C.Center.distance(this.D.Center);if(e>t+n){var o=NaN;return this.A.x=o,this.A.y=o,this.A.z=o,this.B.x=o,this.B.y=o,void(this.B.z=o)}var r=(e*e+t*t-n*n)/(2*e*t),i=Math.sqrt(1-r*r);this.A.to(this.D.Center).toCircle(this.C),this.B.to(this.A),this.A.rotate(this.C.Center,r,i,this.C.AP),this.B.rotate(this.C.Center,r,-i,this.C.AP)},n}(i.LineElement);n.Bichord=u},1549(t,n,e){var o,r=this&&this.__extends||(o=function(t,n){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},o(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function e(){this.constructor=t}o(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)});Object.defineProperty(n,"__esModule",{value:!0}),n.Chord=void 0;var i=e(2145),s=e(6091),u=function(t){function n(n){var e=t.call(this)||this;return e.dimension=1,null==n||(e.C=n.C,e.D=n.D,e.E=n.E,e._A=new s.PointElement({AP:e.C.AP}),e._B=new s.PointElement({AP:e.C.AP})),e}return r(n,t),n.prototype.translate=function(t,n){this._A.translate(t,n),this._B.translate(t,n)},n.prototype.rotate=function(t,n,e){this._A.rotate(t,n,e),this._B.rotate(t,n,e)},n.prototype.update=function(){this._B.to(this.C.Center).toLine(this.D,this.E,!1);var t=this.C.Center.distance2(this._B),n=this.C.radius2;if(t>n){var e=NaN;return this._A.x=e,this._A.y=e,this._A.z=e,this._B.x=e,this._B.y=e,void(this._B.z=e)}var o=Math.sqrt(n-t),r=o/this.D.distance(this._B);r<1e10?this._A.to(this.D).minus(this._B).times(r).plus(this._B):(r=o/this.E.distance(this._B),this._A.to(this.E).minus(this._B).times(r).plus(this._B)),this._B.times(2).minus(this._A)},n}(i.LineElement);n.Chord=u},7339(t,n,e){var o,r=this&&this.__extends||(o=function(t,n){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},o(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function e(){this.constructor=t}o(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)});Object.defineProperty(n,"__esModule",{value:!0}),n.lineConstructions=n.MeanProportionalLineConstruction=n.ProportionLineConstruction=n.SimilarLineConstruction=n.LineParallelConstruction=n.LineExtendConstruction=n.LineCutoffConstruction=n.LinePerpendicular5Construction=n.LinePerpendicular4Construction=n.LinePerpendicular3Construction=n.LinePerpendicular2Construction=n.LinePerpendicular1Construction=n.BichordConstruction=n.ChordConstruction=n.PlaneFootLineConstruction=n.LineFootConstruction=n.AngleDividerLineConstruction=n.AngleBisectorLineConstruction=n.LineConnectConstruction=void 0;var i=e(7658),s=e(4461),u=e(1313),c=e(6055),l=e(2090),a=e(6921),h=e(3703),p=e(2145),f=e(5002),_=e(1549),y=e(5014),d=e(9535),v=e(9237),g=e(3219),P=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.LineConstructions.connect,n.signature={points:2,elements:0,integers:0},n}return r(n,t),n.prototype.construct=function(t,n,e,o){var r=new p.LineElement({A:n[0],B:n[1]});return[[r],r]},n}(i.Construction);n.LineConnectConstruction=P;var C=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.LineConstructions.angleBisector,n.signature={points:3,elements:0,integers:0},n}return r(n,t),n.prototype.validateSignature=function(t,n){return t===this.constructionMethod&&3===n.P.length&&0===n.N.length&&(0===n.E.length||1===n.E.length&&n.E[0]instanceof c.PlaneElement)},n.prototype.construct=function(t,n,e,o){var r=e.length>0?e[0]:t,i=new v.AngleDividerElement(n[0],n[1],n[2],r,2),s=new p.LineElement({A:n[1],B:i});return[[i,s],s]},n}(i.Construction);n.AngleBisectorLineConstruction=C;var m=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.LineConstructions.angleDivider,n.signature={points:3,elements:0,integers:1},n}return r(n,t),n.prototype.validateSignature=function(t,n){return t===this.constructionMethod&&3===n.P.length&&1===n.N.length&&(0===n.E.length||1===n.E.length&&n.E[0]instanceof c.PlaneElement)},n.prototype.construct=function(t,n,e,o){var r=e.length>0?e[0]:t,i=new v.AngleDividerElement(n[0],n[1],n[2],r,o[0]),s=new p.LineElement({A:n[1],B:i});return[[i,s],s]},n}(i.Construction);n.AngleDividerLineConstruction=m;var w=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.LineConstructions.foot,n.signature={points:3,elements:0,integers:0},n}return r(n,t),n.prototype.construct=function(t,n,e,o){var r=new a.Foot(n[0],n[1],n[2]),i=new p.LineElement({A:n[0],B:r});return[[r,i],i]},n}(i.Construction);n.LineFootConstruction=w;var x=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.LineConstructions.foot,n.signature={points:1,elements:1,integers:0,elementTypes:[c.PlaneElement]},n}return r(n,t),n.prototype.construct=function(t,n,e,o){var r=new h.PlaneFootElement(n[0],e[0]),i=new p.LineElement({A:n[0],B:r});return[[r,i],i]},n}(i.Construction);n.PlaneFootLineConstruction=x;var E=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.LineConstructions.chord,n.signature={points:2,elements:1,integers:0,elementTypes:[u.CircleElement]},n}return r(n,t),n.prototype.construct=function(t,n,e,o){var r=new _.Chord({D:n[0],E:n[1],C:e[0]});return[[r],r]},n}(i.Construction);n.ChordConstruction=E;var b=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.LineConstructions.bichord,n.signature={points:0,elements:2,integers:0,elementTypes:[u.CircleElement,u.CircleElement]},n}return r(n,t),n.prototype.construct=function(t,n,e,o){var r=new f.Bichord({C:e[0],D:e[1]});return[[r],r]},n}(i.Construction);function A(t){return[t[0],t[0][0]]}n.BichordConstruction=b;var S=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.LineConstructions.perpendicular,n}return r(n,t),n.prototype.construct=function(n,e,o,r){return A(t.prototype.construct.call(this,n,e,o,r))},n}(s.PointPerpendicular1Construction);n.LinePerpendicular1Construction=S;var O=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.LineConstructions.perpendicular,n}return r(n,t),n.prototype.construct=function(n,e,o,r){return A(t.prototype.construct.call(this,n,e,o,r))},n}(s.PointPerpendicular2Construction);n.LinePerpendicular2Construction=O;var M=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.LineConstructions.perpendicular,n}return r(n,t),n.prototype.construct=function(n,e,o,r){return A(t.prototype.construct.call(this,n,e,o,r))},n}(s.PointPerpendicular3Construction);n.LinePerpendicular3Construction=M;var T=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.LineConstructions.perpendicular,n}return r(n,t),n.prototype.construct=function(n,e,o,r){return A(t.prototype.construct.call(this,n,e,o,r))},n}(s.PointPerpendicular4Construction);n.LinePerpendicular4Construction=T;var j=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.LineConstructions.perpendicular,n}return r(n,t),n.prototype.construct=function(n,e,o,r){return A(t.prototype.construct.call(this,n,e,o,r))},n}(s.PointPerpendicular5Construction);n.LinePerpendicular5Construction=j;var B=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.LineConstructions.cutoff,n.signature={points:4,elements:0,integers:0},n}return r(n,t),n.prototype.construct=function(t,n,e,o){var r=new l.Layoff(n[0],n[0],n[1],n[2],n[3]),i=new p.LineElement({A:n[0],B:r});return[[r,i],i]},n}(i.Construction);n.LineCutoffConstruction=B;var z=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.LineConstructions.extend,n.signature={points:4,elements:0,integers:0},n}return r(n,t),n.prototype.construct=function(t,n,e,o){var r=new l.Layoff(n[1],n[0],n[1],n[2],n[3]),i=new p.LineElement({A:n[1],B:r});return[[r,i],i]},n}(i.Construction);n.LineExtendConstruction=z;var L=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.LineConstructions.parallel,n.signature={points:3,elements:0,integers:0},n}return r(n,t),n.prototype.construct=function(t,n,e,o){var r=new l.Layoff(n[0],n[1],n[2],n[1],n[2]),i=new p.LineElement({A:n[0],B:r});return[[r,i],i]},n}(i.Construction);n.LineParallelConstruction=L;var V=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.LineConstructions.similar,n.signature={points:5,elements:0,integers:0},n}return r(n,t),n.prototype.validateSignature=function(t,n){return t===this.constructionMethod&&5===n.P.length&&0===n.N.length&&(0===n.E.length||2===n.E.length)},n.prototype.construct=function(t,n,e,o){var r=e.length>0?e[0]:t,i=e.length>1?e[1]:t,s=new y.SimilarElement(n[0],n[1],r,n[2],n[3],n[4],i),u=new p.LineElement({A:n[0],B:s});return[[s,u],u]},n}(i.Construction);n.SimilarLineConstruction=V;var k=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.LineConstructions.proportion,n.signature={points:8,elements:0,integers:0},n}return r(n,t),n.prototype.construct=function(t,n,e,o){var r=new d.ProportionElement(n[0],n[1],n[2],n[3],n[4],n[5],n[6],n[7]),i=new p.LineElement({A:n[6],B:r});return[[r,i],i]},n}(i.Construction);n.ProportionLineConstruction=k;var F=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.LineConstructions.meanProportional,n.signature={points:6,elements:0,integers:0},n}return r(n,t),n.prototype.construct=function(t,n,e,o){var r=new g.MeanProportionalElement(n[0],n[1],n[2],n[3],n[4],n[5]),i=new p.LineElement({A:n[4],B:r});return[[r,i],i]},n}(i.Construction);n.MeanProportionalLineConstruction=F,n.lineConstructions=[new P,new z,new S,new O,new M,new T,new j,new b,new E,new L,new B,new x,new w,new V,new k,new C,new m,new F]},2145(t,n,e){var o,r=this&&this.__extends||(o=function(t,n){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},o(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function e(){this.constructor=t}o(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)});Object.defineProperty(n,"__esModule",{value:!0}),n.LineElement=void 0;var i=function(t){function n(n){var e=t.call(this)||this;return e.dimension=1,e._A=n&&n.A||null,e._B=n&&n.B||null,e}return r(n,t),Object.defineProperty(n.prototype,"A",{get:function(){return this._A},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"B",{get:function(){return this._B},enumerable:!1,configurable:!0}),n.prototype.drawEdge=function(t,n){if(null==n&&(n=this.shouldHighlight?this.edgeHighlightColor:this.edgeColor),null!=n){var e=t.getContext("2d");e.fillStyle=n,e.beginPath(),e.moveTo(this._A.x,this._A.y),e.lineTo(this._B.x,this._B.y),e.stroke()}},n.prototype.drawFace=function(t){},n.prototype.drawName=function(t){if(null!=this.nameColor&&null!=this.name&&null!=this._A&&this._A.defined()&&null!=this._B&&this._B.defined()){var n=Math.round((this._A.x+this._B.x)/2),e=Math.round((this._A.y+this._B.y)/2);this.drawString(n,e,t)}},n.prototype.drawVertex=function(t){},n.prototype.rotate=function(t,n,e){},n.prototype.translate=function(t,n){},n.prototype.update=function(){},n}(e(8020).GeomElement);n.LineElement=i},6279(t,n,e){var o,r=this&&this.__extends||(o=function(t,n){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},o(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function e(){this.constructor=t}o(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)});Object.defineProperty(n,"__esModule",{value:!0}),n.Perpendicular=void 0;var i=e(6091),s=function(t){function n(n){var e=t.call(this)||this;return e.dimension=1,null==n||(e._P=n.P,e._A=new i.PointElement({AP:n.P}),e._B=new i.PointElement({AP:n.P}),e._C=n.C,e._D=n.D,e._E=n.E,e._F=n.F),e}return r(n,t),n.prototype.rotate=function(t,n,e){this.A.rotate(t,n,e),this.B.rotate(t,n,e)},n.prototype.translate=function(t,n){this.A.translate(t,n),this.B.translate(t,n)},n.prototype.update=function(){this._A.to(this._C).toPlane(this._P),this._B.to(this._D).minus(this._A);var t=i.PointElement.dot(this.B,this._P.S),n=i.PointElement.dot(this.B,this._P.T),e=Math.sqrt(this._E.distance2(this._F)/(t*t+n*n));t=-t/e,n/=e,this._B.x=n*this._P.S.x+t*this._P.T.x+this._A.x,this._B.y=n*this._P.S.y+t*this._P.T.y+this._A.y,this._B.z=n*this._P.S.z+t*this._P.T.z+this._A.z},n}(e(2145).LineElement);n.Perpendicular=s},3375(t,n,e){var o,r=this&&this.__extends||(o=function(t,n){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},o(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function e(){this.constructor=t}o(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)});Object.defineProperty(n,"__esModule",{value:!0}),n.PlanePerpendicularLine=void 0;var i=e(6091),s=function(t){function n(n){var e=t.call(this)||this;return e.dimension=1,null==n||(e._A=new i.PointElement({AP:n.P}),e._B=new i.PointElement,e._C=n.C,e._D=n.D,e._E=n.E,e._P=n.P),e}return r(n,t),n.prototype.rotate=function(t,n,e){this.A.rotate(t,n,e),this.B.rotate(t,n,e)},n.prototype.translate=function(t,n){this.A.translate(t,n),this.B.translate(t,n)},n.prototype.update=function(){this._A.to(this._C).toPlane(this._P),this._B.toCross(this._P.S,this._P.T),this._B.times(this._D.distance(this._E)).plus(this._A)},n}(e(2145).LineElement);n.PlanePerpendicularLine=s},9362(t,n,e){var o,r=this&&this.__extends||(o=function(t,n){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},o(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function e(){this.constructor=t}o(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)});Object.defineProperty(n,"__esModule",{value:!0}),n.ParallelPlane=void 0;var i=e(6055),s=e(6091),u=function(t){function n(n,e){var o=t.call(this)||this;return o.dimension=2,o._P=n,o.A=e,o.B=new s.PointElement,o.C=new s.PointElement,o.S=n.S,o.T=n.T,o.U=n.U,o}return r(n,t),n.prototype.translate=function(t,n){this.B.translate(t,n),this.C.translate(t,n)},n.prototype.rotate=function(t,n,e){this.B.rotate(t,n,e),this.C.rotate(t,n,e)},n.prototype.update=function(){this.B.to(this._P.B).minus(this._P.A).plus(this.A),this.C.to(this._P.C).minus(this._P.A).plus(this.A)},n}(i.PlaneElement);n.ParallelPlane=u},103(t,n,e){var o,r=this&&this.__extends||(o=function(t,n){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},o(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function e(){this.constructor=t}o(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)});Object.defineProperty(n,"__esModule",{value:!0}),n.PerpendicularPlane=void 0;var i=e(6091),s=function(t){function n(n){var e=t.call(this)||this;return e.A=n.A,e.E=n.E,e.B=new i.PointElement({AP:e}),e.C=new i.PointElement({AP:e}),e.S=new i.PointElement,e.T=new i.PointElement,e}return r(n,t),n.prototype.translate=function(t,n){this.B.translate(t,n),this.C.translate(t,n)},n.prototype.rotate=function(n,e,o){this.B.rotate(n,e,o),this.C.rotate(n,e,o),t.prototype.update.call(this)},n.prototype.update=function(){this.U=i.PointElement.difference(this.E,this.A);var t=this.U.length();this.U.times(1/t);var n=Math.sqrt(this.U.x*this.U.x+this.U.y*this.U.y);n>=1e-6?(this.S.x=-this.U.y/n,this.S.y=this.U.x/n,this.T.toCross(this.U,this.S)):(this.S.x=1,this.S.y=0,this.S.z=0,this.T.x=0,this.T.y=1,this.T.z=0),this.B.to(this.S).times(t).plus(this.A),this.C.to(this.T).times(t).plus(this.A)},n}(e(6055).PlaneElement);n.PerpendicularPlane=s},5193(t,n,e){var o,r=this&&this.__extends||(o=function(t,n){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},o(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function e(){this.constructor=t}o(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)});Object.defineProperty(n,"__esModule",{value:!0}),n.planeConstructions=n.AmbientPlaneCircleConstruction=n.AmbientPlanePointConstruction=n.PlaneParallelConstruction=n.PerpendicularPlaneConstruction=n.Plane3PointsConstruction=void 0;var i=e(7658),s=e(1313),u=e(6055),c=e(103),l=e(9362),a=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.PlaneConstructions.threePoints,n.signature={points:3,elements:0,integers:0},n}return r(n,t),n.prototype.construct=function(t,n,e,o){var r=new u.PlaneElement({A:n[0],B:n[1],C:n[2]});return[[r],r]},n}(i.Construction);n.Plane3PointsConstruction=a;var h=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.PlaneConstructions.perpendicular,n.signature={points:2,elements:0,integers:0},n}return r(n,t),n.prototype.construct=function(t,n,e,o){var r=new c.PerpendicularPlane({A:n[0],E:n[1]});return[[r],r]},n}(i.Construction);n.PerpendicularPlaneConstruction=h;var p=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.PlaneConstructions.parallel,n.signature={points:1,elements:1,integers:0,elementTypes:[u.PlaneElement]},n}return r(n,t),n.prototype.construct=function(t,n,e,o){var r=new l.ParallelPlane(e[0],n[0]);return[[r],r]},n}(i.Construction);n.PlaneParallelConstruction=p;var f=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.PlaneConstructions.ambient,n.signature={points:1,elements:0,integers:0},n}return r(n,t),n.prototype.construct=function(t,n,e,o){return[[n[0]._AP],n[0]._AP]},n}(i.Construction);n.AmbientPlanePointConstruction=f;var _=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.PlaneConstructions.ambient,n.signature={points:0,elements:1,integers:0,elementTypes:[s.CircleElement]},n}return r(n,t),n.prototype.construct=function(t,n,e,o){var r=e[0];return[[r.AP],r.AP]},n}(i.Construction);n.AmbientPlaneCircleConstruction=_,n.planeConstructions=[new a,new h,new p,new f,new _]},6055(t,n,e){var o,r=this&&this.__extends||(o=function(t,n){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},o(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function e(){this.constructor=t}o(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)});Object.defineProperty(n,"__esModule",{value:!0}),n.PlaneElement=void 0;var i=e(8020),s=e(6091),u=function(t){function n(n){var e=t.call(this)||this;return e.dimension=2,e.isScreen=!1,null!=n&&(e.A=n.A,e.B=n.B,e.C=n.C,e.S=new s.PointElement,e.T=new s.PointElement,e.U=new s.PointElement),e}return r(n,t),n.prototype.defined=function(){return null!=this.A&&null!=this.B&&null!=this.C},n.prototype.drawEdge=function(t){if(null!=this.edgeColor&&this.defined()){var n=t.getContext("2d");n.save(),n.strokeStyle=this.edgeColor;var e=this.B.x+this.C.x-this.A.x,o=this.B.y+this.C.y-this.A.y;n.beginPath(),n.moveTo(this.A.x,this.A.y),n.lineTo(this.B.x,this.B.y),n.lineTo(e,o),n.lineTo(this.C.x,this.C.y),n.closePath(),n.stroke(),n.restore()}},n.prototype.drawFace=function(t){if(null!=this.faceColor&&this.defined()){var n=t.getContext("2d");n.save(),n.fillStyle=this.faceColor;var e=this.B.x+this.C.x-this.A.x,o=this.B.y+this.C.y-this.A.y;n.beginPath(),n.moveTo(this.A.x,this.A.y),n.lineTo(this.B.x,this.B.y),n.lineTo(e,o),n.lineTo(this.C.x,this.C.y),n.closePath(),n.fill(),n.restore()}},n.prototype.drawName=function(t){if(null!=this.nameColor&&null!=this.name&&this.defined()){var n=Math.round((this.B.x+this.C.x)/2),e=Math.round((this.B.y+this.C.y)/2);this.drawString(n,e,t)}},n.prototype.drawVertex=function(t){if(null!=this.vertexColor&&this.defined()){var n=t.getContext("2d"),e=this.B.x+this.C.x-this.A.x,o=this.B.y+this.C.y-this.A.y;n.beginPath(),n.fillStyle=this.vertexColor,n.arc(e,o,2,0,2*Math.PI,!1),n.fill()}},n.prototype.rotate=function(t,n,e){this.update()},n.prototype.translate=function(t,n){},n.prototype.update=function(){!this.isScreen||0==this.A.z&&0==this.B.z&&0==this.C.z||(this.isScreen=!1),this.S.to(this.B).minus(this.A),this.T.to(this.C).minus(this.A),this.S.times(1/this.S.length());var t=s.PointElement.dot(this.T,this.S);this.T.x-=t*this.S.x,this.T.y-=t*this.S.y,this.T.z-=t*this.S.z,this.T.times(1/this.T.length()),this.U.toCross(this.S,this.T)},n}(i.GeomElement);n.PlaneElement=u},9237(t,n,e){var o,r=this&&this.__extends||(o=function(t,n){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},o(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function e(){this.constructor=t}o(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)});Object.defineProperty(n,"__esModule",{value:!0}),n.AngleDividerElement=void 0;var i=function(t){function n(n,e,o,r,i){var s=t.call(this)||this;return s.dimension=0,s._A=e,s._B=n,s._C=o,s._AP=r,s._n=i,s}return r(n,t),n.prototype.update=function(){var t=this._A.angle(this._B,this._C,this._AP)/this._n,n=Math.cos(t),e=Math.sin(t);this._AP.isScreen?(this._x=this._A.x+n*(this._B.x-this._A.x)-e*(this._B.y-this._A.y),this._y=this._A.y+e*(this._B.x-this._A.x)+n*(this._B.y-this._A.y),this._z=0):this.to(this._B).rotate(this._A,n,e,this._AP),this.toIntersection(this,this._A,this._B,this._C,this._AP)},n}(e(6091).PointElement);n.AngleDividerElement=i},788(t,n,e){var o,r=this&&this.__extends||(o=function(t,n){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},o(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function e(){this.constructor=t}o(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)});Object.defineProperty(n,"__esModule",{value:!0}),n.CircleSlider=void 0;var i=e(6091),s=function(t){function n(n,e,o,r){var s=t.call(this)||this;return s._newP=new i.PointElement,s.dimension=0,s.draggable=!0,s._C=n,s._x=e,s._initx=e,s._y=o,s._inity=o,s._z=r,s._initz=r,s}return r(n,t),n.prototype.reset=function(){this._x=this._initx,this._y=this._inity,this._z=this._initz,this.toCircle(this._C)},n.prototype.update=function(){this.toCircle(this._C)},n.prototype.drag=function(t,n){return this._x=t,this._y=n,this.defined()||(this._z=this._initz),this._newP.to(this).uptoPlane(this._C.AP),this._newP.defined()||this._newP.to(this).toPlane(this._C.AP),this._newP.toSphere(this._C.Center,this._C.radius),!((this._newP.x-this.x)*(this._newP.x-this.x)+(this._newP.y-this.y)*(this._newP.y-this.y)<.5||(this.to(this._newP),0))},n}(i.PointElement);n.CircleSlider=s},6401(t,n,e){var o,r=this&&this.__extends||(o=function(t,n){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},o(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function e(){this.constructor=t}o(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)});Object.defineProperty(n,"__esModule",{value:!0}),n.FixedPoint=void 0;var i=function(t){function n(n){var e=t.call(this,n)||this;return e._initx=e._x,e._inity=e._y,e._initz=e._z,e}return r(n,t),n.prototype.reset=function(){this._x=this._initx,this._y=this._inity,this._z=this._initz},n}(e(6091).PointElement);n.FixedPoint=i},6921(t,n,e){var o,r=this&&this.__extends||(o=function(t,n){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},o(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function e(){this.constructor=t}o(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)});Object.defineProperty(n,"__esModule",{value:!0}),n.Foot=void 0;var i=function(t){function n(n,e,o){var r=t.call(this)||this;return r.dimension=0,r._A=n,r._B=e,r._C=o,r._B.AP==r._C.AP&&(r._AP=r._B.AP),r}return r(n,t),n.prototype.update=function(){this.to(this._A).toLine(this._B,this._C,!1)},n}(e(6091).PointElement);n.Foot=i},7876(t,n,e){var o,r=this&&this.__extends||(o=function(t,n){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},o(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function e(){this.constructor=t}o(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)});Object.defineProperty(n,"__esModule",{value:!0}),n.HarmonicElement=void 0;var i=e(6091),s=function(t){function n(n,e,o){var r=t.call(this)||this;return r.dimension=0,r._B=n,r._C=e,r._D=o,r._E=new i.PointElement,r._F=new i.PointElement,r._M=new i.PointElement,r}return r(n,t),n.prototype.update=function(){if(0===this._B.z&&0===this._C.z&&0===this._D.z){var t=this._B.x-this._C.x,n=this._B.y-this._C.y,e=this._B.x-this._D.x,o=this._B.y-this._D.y,r=this._C.x*e-this._C.y*o,s=this._C.x*o+this._C.y*e,u=this._D.x*t-this._D.y*n,c=this._D.x*n+this._D.y*t,l=(e+t)*(e+t)+(o+n)*(o+n),a=(r+u)*(e+t)+(s+c)*(o+n),h=-(r+u)*(o+n)+(s+c)*(e+t);this._x=a/l,this._y=h/l}else{this._M.to(this._C).plus(this._D).times(.5),this._F.to(this._C).minus(this._M),this._E.to(this._B).minus(this._M);var p=1/this._E.length2(),f=this._F.length2();this.to(this._F).times(2*i.PointElement.dot(this._E,this._F)).minus(this._E.times(f)).times(p).plus(this._M)}},n}(i.PointElement);n.HarmonicElement=s},7832(t,n,e){var o,r=this&&this.__extends||(o=function(t,n){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},o(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function e(){this.constructor=t}o(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)});Object.defineProperty(n,"__esModule",{value:!0}),n.Intersection=void 0;var i=function(t){function n(n,e,o,r,i){var s=t.call(this,{AP:i})||this;return s.dimension=0,s.A=n,s.B=e,s.C=o,s.D=r,s}return r(n,t),n.prototype.update=function(){this.toIntersection(this.A,this.B,this.C,this.D,this.AP)},n}(e(6091).PointElement);n.Intersection=i},6015(t,n,e){var o,r=this&&this.__extends||(o=function(t,n){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},o(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function e(){this.constructor=t}o(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)});Object.defineProperty(n,"__esModule",{value:!0}),n.InvertPointElement=void 0;var i=function(t){function n(n,e){var o=t.call(this)||this;return o.dimension=0,o._A=n,o._C=e,o._AP=e.AP,o}return r(n,t),n.prototype.update=function(){this.toInvertPoint(this._A,this._C)},n}(e(6091).PointElement);n.InvertPointElement=i},2090(t,n,e){var o,r=this&&this.__extends||(o=function(t,n){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},o(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function e(){this.constructor=t}o(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)});Object.defineProperty(n,"__esModule",{value:!0}),n.Layoff=void 0;var i=function(t){function n(n,e,o,r,i){var s=t.call(this)||this;return s.dimension=0,s._A=n,s._C=e,s._D=o,s._E=r,s._F=i,n.AP==e.AP&&n.AP==o.AP&&(s._AP=n.AP),s}return r(n,t),n.prototype.update=function(){var t=this._E.distance(this._F)/this._C.distance(this._D);this.to(this._D).minus(this._C),this.times(t).plus(this._A)},n}(e(6091).PointElement);n.Layoff=i},4610(t,n,e){var o,r=this&&this.__extends||(o=function(t,n){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},o(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function e(){this.constructor=t}o(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)});Object.defineProperty(n,"__esModule",{value:!0}),n.LineSlider=void 0;var i=function(t){function n(n,e,o,r,i,s){var u=t.call(this)||this;return u.dimension=0,u.draggable=!0,u._A=n,u._B=e,u._x=o,u._initx=o,u._y=r,u._inity=r,u._z=i,u._initz=i,u._segment=s,u._A.AP==u._B.AP&&(u._AP=u._A.AP),u}return r(n,t),n.prototype.reset=function(){this._x=this._initx,this._y=this._inity,this._z=this._initz,this.toLine(this._A,this._B,this._segment)},n.prototype.update=function(){this.toLine(this._A,this._B,this._segment)},n.prototype.drag=function(t,n){t-=this._A.x,n-=this._A.y;var e=this._B.x-this._A.x,o=this._B.y-this._A.y,r=(t*e+n*o)/(e*e+o*o);return this._segment&&(r<0?r=0:r>1&&(r=1)),t=this._A.x+e*r,n=this._A.y+o*r,!((t-this._x)*(t-this._x)+(t-this._y)*(t-this._y)<.5||(this._x=t,this._y=n,this._z=this._A.z+(this._B.z-this._A.z)*r,0))},n}(e(6091).PointElement);n.LineSlider=i},3219(t,n,e){var o,r=this&&this.__extends||(o=function(t,n){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},o(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function e(){this.constructor=t}o(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)});Object.defineProperty(n,"__esModule",{value:!0}),n.MeanProportionalElement=void 0;var i=function(t){function n(n,e,o,r,i,s){var u=t.call(this)||this;return u.dimension=0,u._S0=n,u._S1=e,u._T0=o,u._T1=r,u._U0=i,u._U1=s,i._AP===s._AP&&(u._AP=i._AP),u}return r(n,t),n.prototype.update=function(){var t=Math.sqrt(this._S0.distance2(this._S1)*this._T0.distance2(this._T1));t=Math.sqrt(t/this._U0.distance2(this._U1)),this.to(this._U1).minus(this._U0),this.times(t).plus(this._U0)},n}(e(6091).PointElement);n.MeanProportionalElement=i},489(t,n,e){var o,r=this&&this.__extends||(o=function(t,n){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},o(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function e(){this.constructor=t}o(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)});Object.defineProperty(n,"__esModule",{value:!0}),n.Midpoint=void 0;var i=function(t){function n(n,e){var o=t.call(this)||this;return o.dimension=0,o._A=n,o._B=e,o._A.AP==o._B.AP&&(o._AP=o._A.AP),o}return r(n,t),n.prototype.update=function(){this._x=(this._A.x+this._B.x)/2,this._y=(this._A.y+this._B.y)/2,this._z=(this._A.z+this._B.z)/2},n}(e(6091).PointElement);n.Midpoint=i},3703(t,n,e){var o,r=this&&this.__extends||(o=function(t,n){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},o(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function e(){this.constructor=t}o(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)});Object.defineProperty(n,"__esModule",{value:!0}),n.PlaneFootElement=void 0;var i=function(t){function n(n,e){var o=t.call(this)||this;return o.dimension=0,o._A=n,o._AP=e,o}return r(n,t),n.prototype.update=function(){this.to(this._A).toPlane(this._AP)},n}(e(6091).PointElement);n.PlaneFootElement=i},2930(t,n,e){var o,r=this&&this.__extends||(o=function(t,n){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},o(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function e(){this.constructor=t}o(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)});Object.defineProperty(n,"__esModule",{value:!0}),n.PlaneIntersection=void 0;var i=function(t){function n(n,e,o){var r=t.call(this)||this;return r.dimension=0,r._A=e,r._B=o,r._AP=n,r}return r(n,t),n.prototype.update=function(){this.toIntersectionPL(this._AP,this._A,this._B)},n}(e(6091).PointElement);n.PlaneIntersection=i},4994(t,n,e){var o,r=this&&this.__extends||(o=function(t,n){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},o(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function e(){this.constructor=t}o(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)});Object.defineProperty(n,"__esModule",{value:!0}),n.PlaneSlider=void 0;var i=e(6091),s=function(t){function n(n,e,o,r){var s=t.call(this)||this;return s._newP=new i.PointElement,s.dimension=0,s.draggable=!0,s._AP=n,s._x=s._initx=e,s._y=s._inity=o,s._z=s._initz=r,s}return r(n,t),n.prototype.update=function(){this.toPlane(this._AP)},n.prototype.reset=function(){this._x=this._initx,this._y=this._inity,this._z=this._initz,this.toPlane(this._AP)},n.prototype.drag=function(t,n){return this._x=t,this._y=n,this.defined()||(this._z=this._initz),this._newP.to(this).uptoPlane(this._AP),this._newP.defined()?this.to(this._newP):this.toPlane(this._AP),!0},n}(i.PointElement);n.PlaneSlider=s},4461(t,n,e){var o,r=this&&this.__extends||(o=function(t,n){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},o(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function e(){this.constructor=t}o(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)});Object.defineProperty(n,"__esModule",{value:!0}),n.pointConstructions=n.VertexConstruction=n.HarmonicPointConstruction=n.LineSliderSegmentConstruction=n.FixedPointConstruction=n.AngleDividerPointConstruction=n.AngleBisectorPointConstruction=n.SphereSliderConstruction=n.PlaneSliderConstruction=n.MeanProportionalPointConstruction=n.InvertPointConstruction=n.ProportionPointConstruction=n.PointPerpendicular5Construction=n.PointPerpendicular4Construction=n.PointPerpendicular3Construction=n.PointPerpendicular2Construction=n.PointPerpendicular1Construction=n.PointPerpendicularConstruction=n.SimilarPointConstruction=n.ParallelogramConstruction=n.ExtendConstruction=n.CutoffConstruction=n.LayoffConstruction=n.PlaneFootPointConstruction=n.FootPointConstruction=n.CircumcenterConstruction=n.CircumcircleConstruction=n.CircleSliderConstruction=n.LineSliderConstruction=n.SphereCenterConstruction=n.CircleCenterConstruction=n.LastPointConstruction=n.FirstPointConstruction=n.PlaneIntersectionConstruction=n.IntersectionConstruction=n.MidPointConstruction=n.FreePointConstruction=void 0;var i=e(7658),s=e(1313),u=e(2218),c=e(6055),l=e(6401),a=e(4994),h=e(489),p=e(7832),f=e(2930),_=e(4610),y=e(2090),d=e(6921),v=e(3703),g=e(788),P=e(5014),C=e(9535),m=e(9237),w=e(3219),x=e(7876),E=e(6015),b=e(5089),A=e(6279),S=e(3375),O=e(2295),M=e(7091),T=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.PointConstructions.free,n.signature={points:0,elements:0,integers:2},n}return r(n,t),n.prototype.construct=function(t,n,e,o){var r=new a.PlaneSlider(t,o[0],o[1],0);return[[r],r]},n}(i.Construction);n.FreePointConstruction=T;var j=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.PointConstructions.midpoint,n.signature={points:2,elements:0,integers:0},n}return r(n,t),n.prototype.construct=function(t,n,e,o){var r=new h.Midpoint(n[0],n[1]);return[[r],r]},n}(i.Construction);n.MidPointConstruction=j;var B=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.PointConstructions.intersection,n.signature={points:4,elements:0,integers:0},n}return r(n,t),n.prototype.validateSignature=function(t,n){return t===this.constructionMethod&&4===n.P.length&&0===n.N.length&&(0===n.E.length||1===n.E.length&&n.E[0]instanceof c.PlaneElement)},n.prototype.construct=function(t,n,e,o){var r=e.length>0?e[0]:t,i=new p.Intersection(n[0],n[1],n[2],n[3],r);return[[i],i]},n}(i.Construction);n.IntersectionConstruction=B;var z=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.PointConstructions.intersection,n.signature={points:2,elements:1,integers:0,elementTypes:[c.PlaneElement]},n}return r(n,t),n.prototype.construct=function(t,n,e,o){var r=new f.PlaneIntersection(e[0],n[0],n[1]);return[[r],r]},n}(i.Construction);n.PlaneIntersectionConstruction=z;var L=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.PointConstructions.first,n.signature={points:2,elements:0,integers:0},n}return r(n,t),n.prototype.construct=function(t,n,e,o){return[[],n[0]]},n}(i.Construction);n.FirstPointConstruction=L;var V=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.PointConstructions.last,n.signature={points:2,elements:0,integers:0},n}return r(n,t),n.prototype.construct=function(t,n,e,o){return[[],n[1]]},n}(i.Construction);n.LastPointConstruction=V;var k=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.PointConstructions.center,n.signature={points:0,elements:1,integers:0,elementTypes:[s.CircleElement]},n}return r(n,t),n.prototype.construct=function(t,n,e,o){return[[],e[0].Center]},n}(i.Construction);n.CircleCenterConstruction=k;var F=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.PointConstructions.center,n.signature={points:0,elements:1,integers:0,elementTypes:[O.SphereElement]},n}return r(n,t),n.prototype.construct=function(t,n,e,o){return[[],e[0].Center]},n}(i.Construction);n.SphereCenterConstruction=F;var N=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.PointConstructions.lineSlider,n.signature={points:2,elements:0,integers:2},n}return r(n,t),n.prototype.validateSignature=function(t,n){return t===this.constructionMethod&&2===n.P.length&&0===n.E.length&&(2===n.N.length||3===n.N.length)},n.prototype.construct=function(t,n,e,o){var r=this.createSlider(n[0],n[1],o[0],o[1],o.length>2?o[2]:0);return[[r],r]},n.prototype.createSlider=function(t,n,e,o,r){return new _.LineSlider(t,n,e,o,r,!1)},n}(i.Construction);n.LineSliderConstruction=N;var D=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.PointConstructions.circleSlider,n.signature={points:0,elements:1,integers:2,elementTypes:[s.CircleElement]},n}return r(n,t),n.prototype.validateSignature=function(t,n){return t===this.constructionMethod&&0===n.P.length&&1===n.E.length&&(2===n.N.length||3===n.N.length)&&n.E[0]instanceof s.CircleElement},n.prototype.construct=function(t,n,e,o){var r=new g.CircleSlider(e[0],o[0],o[1],o.length>2?o[2]:0);return[[r],r]},n}(i.Construction);n.CircleSliderConstruction=D;var I=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.CircleConstructions.circumcircle,n.signature={points:3,elements:0,integers:0},n}return r(n,t),n.prototype.validateSignature=function(t,n){return t===this.constructionMethod&&3===n.P.length&&0===n.N.length&&(0===n.E.length||1===n.E.length&&n.E[0]instanceof c.PlaneElement)},n.prototype.construct=function(t,n,e,o){var r=e.length>0?e[0]:t,i=new u.CircumcircleElement(n[0],n[1],n[2],r);return[[i],i]},n}(i.Construction);n.CircumcircleConstruction=I;var H=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.PointConstructions.circumcenter,n}return r(n,t),n.prototype.construct=function(n,e,o,r){var i=t.prototype.construct.call(this,n,e,o,r),s=i[1];return i[0].push(s.Center),[i[0],s.Center]},n}(I);n.CircumcenterConstruction=H;var R=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.PointConstructions.foot,n.signature={points:3,elements:0,integers:0},n}return r(n,t),n.prototype.construct=function(t,n,e,o){var r=new d.Foot(n[0],n[1],n[2]);return[[r],r]},n}(i.Construction);n.FootPointConstruction=R;var U=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.PointConstructions.foot,n.signature={points:1,elements:1,integers:0,elementTypes:[c.PlaneElement]},n}return r(n,t),n.prototype.construct=function(t,n,e,o){var r=new v.PlaneFootElement(n[0],e[0]);return[[r],r]},n}(i.Construction);n.PlaneFootPointConstruction=U;var q=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.signature={points:4,elements:0,integers:0},n}return r(n,t),n.prototype.construct=function(t,n,e,o){var r=this._createLayoff(n);return[[r],r]},n}(i.Construction);n.LayoffConstruction=q;var W=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.PointConstructions.cutoff,n}return r(n,t),n.prototype._createLayoff=function(t){return new y.Layoff(t[0],t[0],t[1],t[2],t[3])},n}(q);n.CutoffConstruction=W;var G=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.PointConstructions.extend,n}return r(n,t),n.prototype._createLayoff=function(t){return new y.Layoff(t[1],t[0],t[1],t[2],t[3])},n}(q);n.ExtendConstruction=G;var Y=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.PointConstructions.parallelogram,n.signature={points:3,elements:0,integers:0},n}return r(n,t),n.prototype.construct=function(t,n,e,o){var r=new y.Layoff(n[0],n[1],n[2],n[1],n[2]);return[[r],r]},n}(i.Construction);n.ParallelogramConstruction=Y;var X=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.PointConstructions.similar,n.signature={points:5,elements:0,integers:0},n}return r(n,t),n.prototype.validateSignature=function(t,n){return t===this.constructionMethod&&5===n.P.length&&0===n.N.length&&(0===n.E.length||2===n.E.length)},n.prototype.construct=function(t,n,e,o){var r=e.length>0?e[0]:t,i=e.length>1?e[1]:t,s=new P.SimilarElement(n[0],n[1],r,n[2],n[3],n[4],i);return[[s],s]},n}(i.Construction);n.SimilarPointConstruction=X;var Q=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.PointConstructions.perpendicular,n}return r(n,t),n}(i.Construction);n.PointPerpendicularConstruction=Q;var $=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.signature={points:2,elements:0,integers:0},n}return r(n,t),n.prototype.construct=function(t,n,e,o){var r=new A.Perpendicular({C:n[0],D:n[1],P:t,E:n[0],F:n[1]});return[[r],r.B]},n}(Q);n.PointPerpendicular1Construction=$;var K=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.signature={points:2,elements:1,integers:0,elementTypes:[c.PlaneElement]},n}return r(n,t),n.prototype.construct=function(t,n,e,o){var r=new A.Perpendicular({C:n[0],D:n[1],P:e[0],E:n[0],F:n[1]});return[[r],r.B]},n}(Q);n.PointPerpendicular2Construction=K;var Z=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.signature={points:4,elements:0,integers:0},n}return r(n,t),n.prototype.construct=function(t,n,e,o){var r=new A.Perpendicular({C:n[0],D:n[1],P:t,E:n[2],F:n[3]});return[[r],r.B]},n}(Q);n.PointPerpendicular3Construction=Z;var J=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.signature={points:4,elements:1,integers:0,elementTypes:[c.PlaneElement]},n}return r(n,t),n.prototype.construct=function(t,n,e,o){var r=new A.Perpendicular({C:n[0],D:n[1],P:e[0],E:n[2],F:n[3]});return[[r],r.B]},n}(Q);n.PointPerpendicular4Construction=J;var tt=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.signature={points:3,elements:1,integers:0,elementTypes:[c.PlaneElement]},n}return r(n,t),n.prototype.construct=function(t,n,e,o){var r=new S.PlanePerpendicularLine({C:n[0],P:e[0],D:n[1],E:n[2]});return[[r],r.B]},n}(Q);n.PointPerpendicular5Construction=tt;var nt=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.PointConstructions.proportion,n.signature={points:8,elements:0,integers:0},n}return r(n,t),n.prototype.construct=function(t,n,e,o){var r=new C.ProportionElement(n[0],n[1],n[2],n[3],n[4],n[5],n[6],n[7]);return[[r],r]},n}(i.Construction);n.ProportionPointConstruction=nt;var et=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.PointConstructions.invert,n.signature={points:1,elements:1,integers:0,elementTypes:[s.CircleElement]},n}return r(n,t),n.prototype.construct=function(t,n,e,o){var r=new E.InvertPointElement(n[0],e[0]);return[[r],r]},n}(i.Construction);n.InvertPointConstruction=et;var ot=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.PointConstructions.meanProportional,n.signature={points:6,elements:0,integers:0},n}return r(n,t),n.prototype.construct=function(t,n,e,o){var r=new w.MeanProportionalElement(n[0],n[1],n[2],n[3],n[4],n[5]);return[[r],r]},n}(i.Construction);n.MeanProportionalPointConstruction=ot;var rt=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.PointConstructions.planeSlider,n.signature={points:0,elements:1,integers:3,elementTypes:[c.PlaneElement]},n}return r(n,t),n.prototype.construct=function(t,n,e,o){var r=new a.PlaneSlider(e[0],o[0],o[1],o[2]);return[[r],r]},n}(i.Construction);n.PlaneSliderConstruction=rt;var it=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.PointConstructions.sphereSlider,n.signature={points:0,elements:1,integers:3,elementTypes:[O.SphereElement]},n}return r(n,t),n.prototype.construct=function(t,n,e,o){var r=new b.SphereSliderElement(e[0],o[0],o[1],o[2]);return[[r],r]},n}(i.Construction);n.SphereSliderConstruction=it;var st=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.PointConstructions.angleBisector,n.signature={points:3,elements:0,integers:0},n}return r(n,t),n.prototype.validateSignature=function(t,n){return t===this.constructionMethod&&3===n.P.length&&0===n.N.length&&(0===n.E.length||1===n.E.length&&n.E[0]instanceof c.PlaneElement)},n.prototype.construct=function(t,n,e,o){var r=e.length>0?e[0]:t,i=new m.AngleDividerElement(n[0],n[1],n[2],r,2);return[[i],i]},n}(i.Construction);n.AngleBisectorPointConstruction=st;var ut=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.PointConstructions.angleDivider,n.signature={points:3,elements:0,integers:1},n}return r(n,t),n.prototype.validateSignature=function(t,n){return t===this.constructionMethod&&3===n.P.length&&1===n.N.length&&(0===n.E.length||1===n.E.length&&n.E[0]instanceof c.PlaneElement)},n.prototype.construct=function(t,n,e,o){var r=e.length>0?e[0]:t,i=new m.AngleDividerElement(n[0],n[1],n[2],r,o[0]);return[[i],i]},n}(i.Construction);n.AngleDividerPointConstruction=ut;var ct=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.PointConstructions.fixed,n.signature={points:0,elements:0,integers:2},n}return r(n,t),n.prototype.validateSignature=function(t,n){return t===this.constructionMethod&&0===n.P.length&&0===n.E.length&&(2===n.N.length||3===n.N.length)},n.prototype.construct=function(t,n,e,o){var r=new l.FixedPoint({x:o[0],y:o[1],z:o.length>2?o[2]:0});return[[r],r]},n}(i.Construction);n.FixedPointConstruction=ct;var lt=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.PointConstructions.lineSegmentSlider,n}return r(n,t),n.prototype.createSlider=function(t,n,e,o,r){return new _.LineSlider(t,n,e,o,r,!0)},n}(N);n.LineSliderSegmentConstruction=lt;var at=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.PointConstructions.harmonic,n.signature={points:3,elements:0,integers:0},n}return r(n,t),n.prototype.construct=function(t,n,e,o){var r=new x.HarmonicElement(n[0],n[1],n[2]);return[[r],r]},n}(i.Construction);n.HarmonicPointConstruction=at;var ht=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.PointConstructions.vertex,n.signature={points:0,elements:1,integers:1,elementTypes:[M.PolygonElement]},n}return r(n,t),n.prototype.construct=function(t,n,e,o){var r=e[0].V[o[0]-1];return[[r],r]},n}(i.Construction);n.VertexConstruction=ht,n.pointConstructions=[new T,new ct,new L,new V,new k,new H,new j,new B,new R,new U,new G,new W,new Y,new X,new nt,new st,new ut,new ot,new rt,new it,new at,new et,new z,new F,new I,new N,new lt,new D,new $,new K,new Z,new J,new tt,new ht]},6091(t,n,e){var o,r=this&&this.__extends||(o=function(t,n){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},o(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function e(){this.constructor=t}o(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)});Object.defineProperty(n,"__esModule",{value:!0}),n.PointElement=void 0;var i=function(t){function n(n){var e=t.call(this)||this;return e.dimension=0,e._x=n&&n.x||0,e._y=n&&n.y||0,e._z=n&&n.z||0,e._AP=n&&n.AP||null,e}return r(n,t),Object.defineProperty(n.prototype,"x",{get:function(){return this._x},set:function(t){this._x=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"y",{get:function(){return this._y},set:function(t){this._y=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"z",{get:function(){return this._z},set:function(t){this._z=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"AP",{get:function(){return this._AP},set:function(t){this._AP=t},enumerable:!1,configurable:!0}),n.prototype.defined=function(){return!isNaN(this._x)&&!isNaN(this._y)&&!isNaN(this._z)&&null!=this._x&&null!=this._y&&null!=this._z},n.prototype.to=function(t){return this._x=t._x,this._y=t._y,this._z=t._z,this},n.prototype.plus=function(t){return this._x+=t._x,this._y+=t._y,this._z+=t._z,this},n.prototype.minus=function(t){return this._x-=t._x,this._y-=t._y,this._z-=t._z,this},n.prototype.times=function(t){return this._x*=t,this._y*=t,this._z*=t,this},n.difference=function(t,e){return new n({x:t.x-e.x,y:t.y-e.y,z:t.z-e.z,AP:null})},n.product=function(t,e){return new n({x:t*e.x,y:t*e.y,z:t*e.z,AP:null})},n.dot=function(t,n){return t.x*n.x+t.y*n.y+t.z*n.z},n.prototype.length2=function(){return this._x*this._x+this._y*this._y+this._z*this._z},n.prototype.length=function(){return Math.sqrt(this.length2())},n.prototype.distance2=function(t){return(this._x-t.x)*(this._x-t.x)+(this._y-t.y)*(this._y-t.y)+(this._z-t.z)*(this._z-t.z)},n.prototype.distance=function(t){return Math.sqrt(this.distance2(t))},n.prototype.toCross=function(t,n){return this._x=t.y*n.z-t.z*n.y,this._y=t.z*n.x-t.x*n.z,this._z=t.x*n.y-t.y*n.x,this},n.cross=function(t,e){return new n({x:t.y*e.z-t.z*e.y,y:t.z*e.x-t.x*e.z,z:t.x*e.y-t.y*e.x,AP:null})},n.triple=function(t,n,e){return t.x*(n.y*e.z-n.z*e.y)+n.x*(e.y*t.z-e.z*t.y)+e.x*(t.y*n.z-t.z*n.y)},n.prototype.toLine=function(t,e,o){var r=n.difference(e,t);this.minus(t);var i=n.dot(r,this)/r.length2();return o&&(i<0?i=0:i>1&&(i=1)),r.times(i),this.to(r).plus(t)},n.prototype.toPlane=function(t){if(t.isScreen)this._z=0;else{this.minus(t.A);var e=n.dot(this,t.S),o=n.dot(this,t.T);this.to(t.S).times(e).plus(n.product(o,t.T)).plus(t.A)}return this},n.prototype.uptoPlane=function(t){if(t.isScreen)this._z=0;else{this.minus(t.A);var e=t.S.x*t.T.y-t.S.y*t.T.x,o=(this.x*t.T.y-this.y*t.T.x)/e,r=(this.y*t.S.x-this.x*t.S.y)/e;this.to(t.S).times(o).plus(n.product(r,t.T)).plus(t.A)}return this},n.prototype.toCircumcenter=function(t,e,o){if(0==t.z&&0==e.z&&0==o.z){var r=((t.x-e.x)*(t.x+e.x)+(t.y-e.y)*(t.y+e.y))/2,i=((e.x-o.x)*(e.x+o.x)+(e.y-o.y)*(e.y+o.y))/2,s=(t.x-e.x)*(e.y-o.y)-(e.x-o.x)*(t.y-e.y);this._x=(r*(e.y-o.y)-i*(t.y-e.y))/s,this._y=(i*(t.x-e.x)-r*(e.x-o.x))/s,this._z=0}else{var u=n.difference(e,t),c=n.difference(o,t),l=n.dot(u,c),a=u.length2(),h=c.length2(),p=h*(a-l)/(s=2*(a*h-l*l)),f=a*(h-l)/s;this.to(t).plus(u.times(p)).plus(c.times(f))}return this},n.prototype.toCircle=function(t){if(t.AP.isScreen){var n=t.radius/this.distance(t.Center);this._x=t.Center.x+n*(this._x-t.Center.x),this._y=t.Center.y+n*(this._y-t.Center.y),this._z=0}else this.toPlane(t.AP),this.toSphere(t.Center,t.radius);return this},n.prototype.toSphere=function(t,n){var e=n/this.distance(t);return this._x=t.x+e*(this._x-t.x),this._y=t.y+e*(this._y-t.y),this._z=t.z+e*(this._z-t.z),this},n.area=function(t,e,o){var r=n.difference(e,t),i=n.difference(o,t);return this.cross(r,i).length()/2},n.prototype.angle=function(t,n,e){var o=t.x-this._x,r=n.x-this._x,i=t.y-this._y,s=n.y-this._y;if(e.isScreen)return Math.atan2(o*s-i*r,o*r+i*s);var u=t.z-this._z,c=n.z-this._z,l=o*e.S.x+i*e.S.y+u*e.S.z,a=o*e.T.x+i*e.T.y+u*e.T.z,h=r*e.S.x+s*e.S.y+c*e.S.z,p=r*e.T.x+s*e.T.y+c*e.T.z;return Math.atan2(l*p-a*h,l*h+a*p)},n.prototype.toIntersection=function(t,e,o,r,i){if(i.isScreen){var s=t.x*e.y-t.y*e.x,u=o.x*r.y-o.y*r.x,c=(e.y-t.y)*(o.x-r.x)-(t.x-e.x)*(r.y-o.y);this._x=(s*(o.x-r.x)-u*(t.x-e.x))/c,this._y=(u*(e.y-t.y)-s*(r.y-o.y))/c}else{var l=n.difference(t,i.A),a=n.difference(e,i.A),h=n.difference(o,i.A),p=n.difference(r,i.A),f=n.dot(l,i.S),_=n.dot(l,i.T),y=n.dot(a,i.S),d=n.dot(a,i.T),v=n.dot(h,i.S),g=n.dot(h,i.T),P=n.dot(p,i.S),C=n.dot(p,i.T),m=((s=f*d-_*y)*(v-P)-(u=v*C-g*P)*(f-y))/(c=(d-_)*(v-P)-(f-y)*(C-g)),w=(u*(d-_)-s*(C-g))/c;this.to(i.S).times(m).plus(n.product(w,i.T)).plus(i.A)}return this},n.prototype.toIntersectionPL=function(t,e,o){this.to(o).minus(e);var r=n.difference(e,t.A),i=-n.triple(t.S,t.T,r)/n.triple(t.S,t.T,this);return this.times(i).plus(e)},n.prototype.toInvertPoint=function(t,n){var e=n.radius2/t.distance2(n.Center);return this.to(t).minus(n.Center).times(e).plus(n.Center)},n.prototype.toSimilar=function(t,e,o,r,i,s,u){var c=r.angle(i,s,u),l=Math.cos(c),a=Math.sin(c),h=r.distance(s)/r.distance(i);if(o.isScreen)this._x=e.x,this._y=e.y,this.rotate(t,l,a,o),this._x=t.x+h*(this._x-t.x),this._y=t.y+h*(this._y-t.y),this._z=0;else{var p=n.difference(e,t),f=n.dot(p,o.S),_=n.dot(p,o.T),y=h*(l*f-a*_),d=h*(a*f+l*_);this._x=y*o.S.x+d*o.T.x+t.x,this._y=y*o.S.y+d*o.T.y+t.y,this._z=y*o.S.z+d*o.T.z+t.z}return this},n.prototype.rotate=function(t,e,o,r){if(null==r&&(r=t._AP),this!=t)if(r.isScreen){var i=this.x-t.x,s=this.y-t.y;this._x=t.x+e*i-o*s,this._y=t.y+o*i+e*s}else{this.minus(t);var u=r.S,c=r.T,l=r.U,a=n.dot(this,u),h=n.dot(this,c),p=n.dot(this,l),f=e*a-o*h,_=o*a+e*h;this._x=t.x+f*u.x+_*c.x+p*l.x,this._y=t.y+f*u.y+_*c.y+p*l.y,this._z=t.z+f*u.z+_*c.z+p*l.z}},n.prototype.drawName=function(t){null!=this.nameColor&&null!=this.name&&this.defined()&&this.drawString(Math.round(this.x),Math.round(this.y),t)},n.prototype.drawVertex=function(t,n){var e=t.getContext("2d");null==n&&(n=this.shouldHighlight?this.vertexHighlightColor:this.vertexColor),null!=n&&(e.beginPath(),e.fillStyle=n,e.arc(this._x,this._y,2,0,2*Math.PI,!1),e.fill())},n.prototype.translate=function(t,n){this._x+=t,this._y+=n},n.prototype.update=function(){},n.prototype.drawEdge=function(t){},n.prototype.drawFace=function(t){},n}(e(8020).GeomElement);n.PointElement=i},9535(t,n,e){var o,r=this&&this.__extends||(o=function(t,n){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},o(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function e(){this.constructor=t}o(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)});Object.defineProperty(n,"__esModule",{value:!0}),n.ProportionElement=void 0;var i=function(t){function n(n,e,o,r,i,s,u,c){var l=t.call(this)||this;return l.dimension=0,l._S0=n,l._S1=e,l._T0=o,l._T1=r,l._U0=i,l._U1=s,l._V0=u,l._V1=c,u._AP===c._AP&&(l._AP=u._AP),l}return r(n,t),n.prototype.update=function(){var t=this._T0.distance2(this._T1)*this._U0.distance2(this._U1)/(this._S0.distance2(this._S1)*this._V0.distance2(this._V1));t=Math.sqrt(t),this.to(this._V1).minus(this._V0),this.times(t).plus(this._V0)},n}(e(6091).PointElement);n.ProportionElement=i},5014(t,n,e){var o,r=this&&this.__extends||(o=function(t,n){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},o(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function e(){this.constructor=t}o(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)});Object.defineProperty(n,"__esModule",{value:!0}),n.SimilarElement=void 0;var i=function(t){function n(n,e,o,r,i,s,u){var c=t.call(this)||this;return c.dimension=0,c._parentA=n,c._parentB=e,c._AP=o,c._D=r,c._E=i,c._F=s,c._Q=u,c}return r(n,t),n.prototype.update=function(){this.toSimilar(this._parentA,this._parentB,this._AP,this._D,this._E,this._F,this._Q)},n}(e(6091).PointElement);n.SimilarElement=i},5089(t,n,e){var o,r=this&&this.__extends||(o=function(t,n){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},o(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function e(){this.constructor=t}o(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)});Object.defineProperty(n,"__esModule",{value:!0}),n.SphereSliderElement=void 0;var i=function(t){function n(n,e,o,r){var i=t.call(this)||this;return i.dimension=0,i.draggable=!0,i._S=n,i._x=i._initx=e,i._y=i._inity=o,i._z=i._initz=r,i}return r(n,t),n.prototype.reset=function(){this._x=this._initx,this._y=this._inity,this._z=this._initz,this.toSphere(this._S.Center,this._S.radius())},n.prototype.update=function(){this.toSphere(this._S.Center,this._S.radius())},n.prototype.drag=function(t,n){var e=(this._S.Center.x-t)*(this._S.Center.x-t)+(this._S.Center.y-n)*(this._S.Center.y-n),o=this._S.radius2();if(e<=o)this._x=t,this._y=n,this._z>this._S.Center.z?this._z=this._S.Center.z+Math.sqrt(o-e):this._z=this._S.Center.z-Math.sqrt(o-e);else{t-=this._S.Center.x,n-=this._S.Center.y;var r=Math.sqrt((t*t+n*n)/o);if(t=t/r+this._S.Center.x,n=n/r+this._S.Center.y,(t-this._x)*(t-this._x)+(n-this._y)*(n-this._y)<.5)return!1;this._x=t,this._y=n,this._z=this._S.Center.z}return!0},n}(e(6091).PointElement);n.SphereSliderElement=i},2563(t,n,e){var o,r=this&&this.__extends||(o=function(t,n){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},o(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function e(){this.constructor=t}o(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)});Object.defineProperty(n,"__esModule",{value:!0}),n.ApplicationElement=void 0;var i=e(7091),s=e(6091),u=function(t){function n(n,e,o,r){var i=t.call(this)||this;return i.dimension=2,i._P=n,i._C=r,i.V=new Array(4),i.V[0]=e,i.V[1]=o,i.V[2]=new s.PointElement,i.V[3]=new s.PointElement,e._AP===o._AP&&e._AP===r._AP&&(i.V[2]._AP=e._AP,i.V[3]._AP=e._AP),i}return r(n,t),n.prototype.translate=function(t,n){this.V[2].translate(t,n),this.V[3].translate(t,n)},n.prototype.rotate=function(t,n,e){this.V[2].rotate(t,n,e),this.V[3].rotate(t,n,e)},n.prototype.update=function(){var t=this._P.area()/(2*s.PointElement.area(this.V[0],this.V[1],this._C));t=Math.abs(t),this.V[3].x=this.V[0].x+t*(this._C.x-this.V[0].x),this.V[3].y=this.V[0].y+t*(this._C.y-this.V[0].y),this.V[3].z=this.V[0].z+t*(this._C.z-this.V[0].z),this.V[2].x=this.V[1].x+this.V[3].x-this.V[0].x,this.V[2].y=this.V[1].y+this.V[3].y-this.V[0].y,this.V[2].z=this.V[1].z+this.V[3].z-this.V[0].z},n}(i.PolygonElement);n.ApplicationElement=u},4133(t,n,e){var o,r=this&&this.__extends||(o=function(t,n){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},o(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function e(){this.constructor=t}o(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)});Object.defineProperty(n,"__esModule",{value:!0}),n.polygonConstructions=n.FacePolygonConstruction=n.OctagonPolygonConstruction=n.ApplicationPolygonConstruction=n.SimilarPolygonConstruction=n.StarPolygonConstruction=n.RegularPolygonConstruction=n.ParallelogramPolygonConstruction=n.EquilateralTriangleConstruction=n.HexagonPolygonConstruction=n.PentagonPolygonConstruction=n.QuadrilateralPolygonConstruction=n.TrianglePolygonConstruction=n.SquarePolygonConstruction=n.PolyConstruction=void 0;var i=e(7658),s=e(6055),u=e(2090),c=e(5014),l=e(7091),a=e(1943),h=e(2563),p=e(3857),f=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return r(n,t),n.prototype.construct=function(t,n,e,o){var r=new l.PolygonElement(n);return[[r],r]},n}(i.Construction);n.PolyConstruction=f;var _=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.PolygonConstructions.square,n.signature={points:2,elements:0,integers:0},n}return r(n,t),n.prototype.validateSignature=function(t,n){return t===this.constructionMethod&&2===n.P.length&&0===n.N.length&&(0===n.E.length||1===n.E.length&&n.E[0]instanceof s.PlaneElement)},n.prototype.construct=function(t,n,e,o){var r=e.length>0?e[0]:t,i=new a.RegularPolygonElement(n[0],n[1],r,4);return[[i],i]},n}(i.Construction);n.SquarePolygonConstruction=_;var y=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.PolygonConstructions.triangle,n.signature={points:3,elements:0,integers:0},n}return r(n,t),n}(f);n.TrianglePolygonConstruction=y;var d=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.PolygonConstructions.quadrilateral,n.signature={points:4,elements:0,integers:0},n}return r(n,t),n}(f);n.QuadrilateralPolygonConstruction=d;var v=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.PolygonConstructions.pentagon,n.signature={points:5,elements:0,integers:0},n}return r(n,t),n}(f);n.PentagonPolygonConstruction=v;var g=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.PolygonConstructions.hexagon,n.signature={points:6,elements:0,integers:0},n}return r(n,t),n}(f);n.HexagonPolygonConstruction=g;var P=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.PolygonConstructions.equilateralTriangle,n.signature={points:2,elements:0,integers:0},n}return r(n,t),n.prototype.validateSignature=function(t,n){return t===this.constructionMethod&&2===n.P.length&&0===n.N.length&&(0===n.E.length||1===n.E.length&&n.E[0]instanceof s.PlaneElement)},n.prototype.construct=function(t,n,e,o){var r=e.length>0?e[0]:t,i=new a.RegularPolygonElement(n[0],n[1],r,3);return[[i],i]},n}(i.Construction);n.EquilateralTriangleConstruction=P;var C=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.PolygonConstructions.parallelogram,n.signature={points:3,elements:0,integers:0},n}return r(n,t),n.prototype.construct=function(t,n,e,o){var r=new u.Layoff(n[0],n[1],n[2],n[1],n[2]),i=new l.PolygonElement([n[0],n[1],n[2],r]);return[[r,i],i]},n}(i.Construction);n.ParallelogramPolygonConstruction=C;var m=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.PolygonConstructions.regularPolygon,n.signature={points:2,elements:0,integers:1},n}return r(n,t),n.prototype.validateSignature=function(t,n){return t===this.constructionMethod&&2===n.P.length&&1===n.N.length&&(0===n.E.length||1===n.E.length&&n.E[0]instanceof s.PlaneElement)},n.prototype.construct=function(t,n,e,o){var r=e.length>0?e[0]:t,i=new a.RegularPolygonElement(n[0],n[1],r,o[0]);return[[i],i]},n}(i.Construction);n.RegularPolygonConstruction=m;var w=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.PolygonConstructions.starPolygon,n.signature={points:2,elements:0,integers:2},n}return r(n,t),n.prototype.construct=function(t,n,e,o){var r=new a.RegularPolygonElement(n[0],n[1],t,o[0],o[1]);return[[r],r]},n}(i.Construction);n.StarPolygonConstruction=w;var x=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.PolygonConstructions.similar,n.signature={points:5,elements:0,integers:0},n}return r(n,t),n.prototype.validateSignature=function(t,n){return t===this.constructionMethod&&5===n.P.length&&0===n.N.length&&(0===n.E.length||2===n.E.length)},n.prototype.construct=function(t,n,e,o){var r=e.length>0?e[0]:t,i=e.length>1?e[1]:t,s=new c.SimilarElement(n[0],n[1],r,n[2],n[3],n[4],i),u=new l.PolygonElement([n[0],n[1],s]);return[[s,u],u]},n}(i.Construction);n.SimilarPolygonConstruction=x;var E=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.PolygonConstructions.application,n.signature={points:3,elements:1,integers:0,elementTypes:[l.PolygonElement]},n}return r(n,t),n.prototype.construct=function(t,n,e,o){var r=new h.ApplicationElement(e[0],n[0],n[1],n[2]);return[[r],r]},n}(i.Construction);n.ApplicationPolygonConstruction=E;var b=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.PolygonConstructions.octagon,n.signature={points:8,elements:0,integers:0},n}return r(n,t),n}(f);n.OctagonPolygonConstruction=b;var A=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.PolygonConstructions.face,n.signature={points:0,elements:1,integers:1,elementTypes:[p.PolyhedronElement]},n}return r(n,t),n.prototype.construct=function(t,n,e,o){var r=e[0].P[o[0]-1];return[[r],r]},n}(i.Construction);n.FacePolygonConstruction=A,n.polygonConstructions=[new y,new w,new m,new _,new P,new C,new d,new b,new v,new g,new x,new E,new A]},7091(t,n,e){var o,r=this&&this.__extends||(o=function(t,n){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},o(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function e(){this.constructor=t}o(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)});Object.defineProperty(n,"__esModule",{value:!0}),n.PolygonElement=void 0;var i=e(6091),s=function(t){function n(n){var e=t.call(this)||this;return e.dimension=2,null==n?(e.V=[],e):(e.V=n,e)}return r(n,t),n.prototype.area=function(){for(var t=0,n=0;n<this.V.length-2;++n)t+=i.PointElement.area(this.V[0],this.V[n+1],this.V[n+2]);return t},n.prototype.drawEdge=function(t,n){if(null==n&&(n=this.shouldHighlight?this.edgeHighlightColor:this.edgeColor),null!=n&&!(this.V.length<=1)){var e=t.getContext("2d");e.beginPath(),e.strokeStyle=n;var o=this.V[0],r=this.V.slice(1);e.moveTo(o.x,o.y);for(var i=0,s=r;i<s.length;i++){var u=s[i];e.lineTo(u.x,u.y),e.stroke()}this.V.length>2&&(e.lineTo(o.x,o.y),e.stroke())}},n.prototype.defined=function(){if(0==this.V.length)return!1;for(var t=0,n=this.V;t<n.length;t++)if(!n[t].defined())return!1;return!0},n.prototype.drawFace=function(t){if(null!=this.faceColor&&this.defined()&&this.V.length>2){var n=t.getContext("2d");n.beginPath(),n.fillStyle=this.faceColor;var e=this.V[0],o=this.V.slice(1);n.moveTo(e.x,e.y);for(var r=0,i=o;r<i.length;r++){var s=i[r];n.lineTo(s.x,s.y)}n.closePath(),n.fill()}},n.prototype.drawName=function(t){if(null!=this.nameColor&&null!=this.name&&this.defined()){for(var n=0,e=0,o=0,r=this.V;o<r.length;o++){var i=r[o];n+=i.x,e+=i.y}var s=this.V.length;n/=s,e/=s;var u=t.getContext("2d"),c=this._getTextMetrics(u,this._name),l=c[0],a=c[1];u.beginPath(),u.fillStyle=this.nameColor,u.fillText(this._name,n-l/2,e+a/4)}},n.prototype.drawVertex=function(t){if(null!=this.vertexColor&&this.defined())for(var n=0,e=this.V;n<e.length;n++)e[n].drawVertex(t,this.vertexColor)},n.prototype.rotate=function(t,n,e){},n.prototype.translate=function(t,n){},n.prototype.update=function(){},n}(e(8020).GeomElement);n.PolygonElement=s},1943(t,n,e){var o,r=this&&this.__extends||(o=function(t,n){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},o(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function e(){this.constructor=t}o(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)});Object.defineProperty(n,"__esModule",{value:!0}),n.RegularPolygonElement=void 0;var i=e(7091),s=e(6091),u=function(t){function n(n,e,o,r,i){void 0===i&&(i=1);var u=t.call(this)||this;u._P=o;var c=Math.PI*i*(r-2)/r;u._cos=Math.cos(c),u._sin=Math.sin(c),u.V=new Array(r),u.V[0]=n,u.V[1]=e;for(var l=2;l<r;l++)u.V[l]=new s.PointElement({AP:o});return u}return r(n,t),n.prototype.update=function(){for(var t=2;t<this.V.length;t++)this.V[t].to(this.V[t-2]),this.V[t].rotate(this.V[t-1],this._cos,this._sin,this._P)},n.prototype.translate=function(t,n){for(var e=2;e<this.V.length;e++)this.V[e].translate(t,n)},n.prototype.rotate=function(t,n,e){for(var o=2;o<this.V.length;o++)this.V[o].rotate(t,n,e,this._P)},n}(i.PolygonElement);n.RegularPolygonElement=u},1099(t,n,e){var o,r=this&&this.__extends||(o=function(t,n){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},o(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function e(){this.constructor=t}o(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)});Object.defineProperty(n,"__esModule",{value:!0}),n.polyhedronConstructions=n.PyramidConstruction=n.PrismConstruction=n.ParallelepipedConstruction=n.TetrahedronConstruction=void 0;var i=e(7658),s=e(2090),u=e(7091),c=e(2383),l=e(444),a=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.PolyhedraConstructions.tetrahedron,n.signature={points:4,elements:0,integers:0},n}return r(n,t),n.prototype.construct=function(t,n,e,o){var r=new u.PolygonElement([n[0],n[1],n[2]]),i=new c.PyramidElement(r,n[3]);return[[r,i],i]},n}(i.Construction);n.TetrahedronConstruction=a;var h=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.PolyhedraConstructions.parallelepiped,n.signature={points:4,elements:0,integers:0},n}return r(n,t),n.prototype.construct=function(t,n,e,o){var r=new s.Layoff(n[1],n[0],n[2],n[0],n[2]),i=new u.PolygonElement([n[1],n[0],n[2],r]),c=new l.PrismElement(i,n[0],n[3]);return[[r,i,c],c]},n}(i.Construction);n.ParallelepipedConstruction=h;var p=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.PolyhedraConstructions.prism,n.signature={points:2,elements:1,integers:0,elementTypes:[u.PolygonElement]},n}return r(n,t),n.prototype.construct=function(t,n,e,o){var r=new l.PrismElement(e[0],n[0],n[1]);return[[r],r]},n}(i.Construction);n.PrismConstruction=p;var f=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.PolyhedraConstructions.pyramid,n.signature={points:1,elements:1,integers:0,elementTypes:[u.PolygonElement]},n}return r(n,t),n.prototype.construct=function(t,n,e,o){var r=new c.PyramidElement(e[0],n[0]);return[[r],r]},n}(i.Construction);n.PyramidConstruction=f,n.polyhedronConstructions=[new a,new h,new p,new f]},3857(t,n,e){var o,r=this&&this.__extends||(o=function(t,n){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},o(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function e(){this.constructor=t}o(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)});Object.defineProperty(n,"__esModule",{value:!0}),n.PolyhedronElement=void 0;var i=function(t){function n(){var n=t.call(this)||this;return n.dimension=2,n.P=[],n}return r(n,t),n.prototype.defined=function(){for(var t=0;t<this.P.length;++t)if(!this.P[t].defined())return!1;return!0},n.prototype.drawName=function(t){if(null!=this.nameColor&&null!=this.name&&this.defined()){for(var n=0,e=0,o=0,r=0;r<this.P.length;++r)for(var i=0;i<this.P[r].V.length;++i)n+=this.P[r].V[i].x,e+=this.P[r].V[i].y,++o;n/=o,e/=o,this.drawString(Math.round(n),Math.round(e),t)}},n.prototype.drawVertex=function(t){if(null!=this.vertexColor&&this.defined())for(var n=0;n<this.P.length;++n)for(var e=0;e<this.P[n].V.length;++e)this.P[n].V[e].drawVertex(t,this.vertexColor)},n.prototype.drawEdge=function(t){if(null!=this.edgeColor&&this.defined()){var n=t.getContext("2d");n.strokeStyle=this.edgeColor;for(var e=0;e<this.P.length;++e)for(var o=0;o<this.P[e].V.length;++o){var r=this.P[e].V[o],i=this.P[e].V[(o+1)%this.P[e].V.length];n.beginPath(),n.moveTo(r.x,r.y),n.lineTo(i.x,i.y),n.stroke()}}},n.prototype.drawFace=function(t){if(null!=this.faceColor&&this.defined())for(var n=0;n<this.P.length;++n){var e=this.P[n].faceColor;this.P[n].faceColor=this.faceColor,this.P[n].drawFace(t),this.P[n].faceColor=e}},n.prototype.update=function(){},n.prototype.translate=function(t,n){},n.prototype.rotate=function(t,n,e){},n}(e(8020).GeomElement);n.PolyhedronElement=i},444(t,n,e){var o,r=this&&this.__extends||(o=function(t,n){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},o(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function e(){this.constructor=t}o(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)});Object.defineProperty(n,"__esModule",{value:!0}),n.PrismElement=void 0;var i=e(3857),s=e(7091),u=e(6091),c=function(t){function n(n,e,o){var r=t.call(this)||this;r.dimension=2,r._C=e,r._D=o;var i=n.V.length,c=2+i;r.P=new Array(c),r.P[0]=n;for(var l=new Array(i),a=0;a<i;++a)l[a]=new u.PointElement,l[a].to(n.V[a]).plus(o).minus(e);r.P[1]=new s.PolygonElement(l);for(var h=2;h<c;++h)r.P[h]=new s.PolygonElement([n.V[h-2],n.V[(h-1)%i],r.P[1].V[(h-1)%i],r.P[1].V[h-2]]);return r}return r(n,t),n.prototype.translate=function(t,n){for(var e=0;e<this.P[1].V.length;++e)this.P[1].V[e].translate(t,n)},n.prototype.rotate=function(t,n,e){for(var o=0;o<this.P[1].V.length;++o)this.P[1].V[o].rotate(t,n,e)},n.prototype.update=function(){for(var t=0;t<this.P[1].V.length;++t)this.P[1].V[t].to(this.P[0].V[t]).plus(this._D).minus(this._C)},n}(i.PolyhedronElement);n.PrismElement=c},2383(t,n,e){var o,r=this&&this.__extends||(o=function(t,n){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},o(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function e(){this.constructor=t}o(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)});Object.defineProperty(n,"__esModule",{value:!0}),n.PyramidElement=void 0;var i=e(3857),s=e(7091),u=function(t){function n(n,e){var o=t.call(this)||this;o.dimension=2;var r=1+n.V.length;o.P=new Array(r),o.P[0]=n;for(var i=1;i<r;++i)o.P[i]=new s.PolygonElement([e,n.V[i-1],n.V[i%n.V.length]]);return o}return r(n,t),n}(i.PolyhedronElement);n.PyramidElement=u},5483(t,n,e){var o,r=this&&this.__extends||(o=function(t,n){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},o(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function e(){this.constructor=t}o(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)});Object.defineProperty(n,"__esModule",{value:!0}),n.ArcElement=void 0;var i=e(1025),s=e(6091),u=function(t){function n(n,e,o,r){var i=t.call(this)||this;return i.dimension=2,i._Center=new s.PointElement,i._A=n,i._M=e,i._B=o,i._P=r,i}return r(n,t),n.prototype.update=function(){this._P.update(),this._Center.toCircumcenter(this._A,this._M,this._B)},n.prototype.translate=function(t,n){this._Center.translate(t,n)},n.prototype.rotate=function(t,n,e){this._Center.rotate(t,n,e)},n}(i.SectorElement);n.ArcElement=u},5755(t,n,e){var o,r=this&&this.__extends||(o=function(t,n){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},o(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function e(){this.constructor=t}o(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)});Object.defineProperty(n,"__esModule",{value:!0}),n.sectorConstructions=n.ArcConstruction=n.SectorConstruction=void 0;var i=e(7658),s=e(6055),u=e(1025),c=e(5483),l=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.SectorConstructions.sector,n.signature={points:3,elements:0,integers:0},n}return r(n,t),n.prototype.validateSignature=function(t,n){return t===this.constructionMethod&&3===n.P.length&&0===n.N.length&&(0===n.E.length||1===n.E.length&&n.E[0]instanceof s.PlaneElement)},n.prototype.construct=function(t,n,e,o){var r=e.length>0?e[0]:t,i=new u.SectorElement({O:n[0],A:n[1],B:n[2],P:r});return[[i],i]},n}(i.Construction);n.SectorConstruction=l;var a=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.SectorConstructions.arc,n.signature={points:3,elements:0,integers:0},n}return r(n,t),n.prototype.validateSignature=function(t,n){return t===this.constructionMethod&&3===n.P.length&&0===n.N.length&&(0===n.E.length||1===n.E.length&&n.E[0]instanceof s.PlaneElement)},n.prototype.construct=function(t,n,e,o){var r=e.length>0?e[0]:t,i=new c.ArcElement(n[0],n[1],n[2],r);return[[i],i]},n}(i.Construction);n.ArcConstruction=a,n.sectorConstructions=[new l,new a]},1025(t,n,e){var o,r=this&&this.__extends||(o=function(t,n){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},o(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function e(){this.constructor=t}o(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)});Object.defineProperty(n,"__esModule",{value:!0}),n.SectorElement=void 0;var i=function(t){function n(n){var e=t.call(this)||this;return e._angle=null,e.dimension=2,null!=n&&(e._Center=n.O,e._A=n.A,e._B=n.B,e._P=n.P),e}return r(n,t),n.prototype.radius=function(){return this._Center.distance(this._A)},n.prototype.defined=function(){return this._A.defined()&&this._B.defined()&&this._Center.defined()},n.prototype._updateThroughPoint=function(){0!=this.radius()&&(this._angle=Math.atan2(this._B.y-this._A.y,this._B.x-this._A.x)-Math.atan2(this._Center.y-this._A.y,this._Center.x-this._A.x),this._Center.x,Math.cos(this._angle/2),this._Center.y,Math.sin(this._angle/2))},n.prototype.drawEdge=function(t){if(null!=this.edgeColor&&this.defined()){var n=t.getContext("2d");n.strokeStyle=this.edgeColor,n.beginPath();var e=this.radius(),o=Math.atan2(this._A.y-this._Center.y,this._A.x-this._Center.x),r=o+this._Center.angle(this._A,this._B,this._P);n.arc(this._Center.x,this._Center.y,e,o,r,!0),n.stroke()}},n.prototype.drawFace=function(t){if(null!=this.faceColor&&this.defined()){var n=t.getContext("2d");n.fillStyle=this.faceColor,n.beginPath();var e=this.radius(),o=Math.atan2(this._A.y-this._Center.y,this._A.x-this._Center.x),r=this._Center.angle(this._A,this._B,this._P),i=o+r;n.arc(this._Center.x,this._Center.y,e,o,i,!0),n.moveTo(this._Center.x,this._Center.y),r<=180?(n.lineTo(this._A.x,this._A.y),n.lineTo(this._B.x,this._B.y)):(n.lineTo(this._B.x,this._B.y),n.lineTo(this._A.x,this._A.y)),n.lineTo(this._Center.x,this._Center.y),n.fill()}},n.prototype.drawName=function(t){},n.prototype.drawVertex=function(t){},n.prototype.rotate=function(t,n,e){},n.prototype.translate=function(t,n){},n.prototype.update=function(){this._updateThroughPoint()},n}(e(8020).GeomElement);n.SectorElement=i},8649(t,n,e){var o,r=this&&this.__extends||(o=function(t,n){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},o(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function e(){this.constructor=t}o(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)});Object.defineProperty(n,"__esModule",{value:!0}),n.sphereConstructions=n.SphereRadius3PointConstruction=n.SphereRadiusConstruction=void 0;var i=e(7658),s=e(2295),u=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.SphereConstructions.radius,n.signature={points:2,elements:0,integers:0},n}return r(n,t),n.prototype.construct=function(t,n,e,o){var r=new s.SphereElement({Center:n[0],B:n[1]});return[[r],r]},n}(i.Construction);n.SphereRadiusConstruction=u;var c=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.constructionMethod=i.SphereConstructions.radius,n.signature={points:3,elements:0,integers:0},n}return r(n,t),n.prototype.construct=function(t,n,e,o){var r=new s.SphereElement({Center:n[0],A:n[1],B:n[2]});return[[r],r]},n}(i.Construction);n.SphereRadius3PointConstruction=c,n.sphereConstructions=[new c,new u]},2295(t,n,e){var o,r=this&&this.__extends||(o=function(t,n){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},o(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function e(){this.constructor=t}o(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)});Object.defineProperty(n,"__esModule",{value:!0}),n.SphereElement=void 0;var i=e(8020),s=e(6091),u=function(t){function n(n){var e=t.call(this)||this;return e.dimension=2,e._Center=n&&n.Center||new s.PointElement,e._A=n&&n.A||e._Center,e._B=n&&n.B||new s.PointElement,e}return r(n,t),Object.defineProperty(n.prototype,"Center",{get:function(){return this._Center},enumerable:!1,configurable:!0}),n.prototype.drawName=function(t){null!=this.nameColor&&null!=this.name&&this.defined()&&this.drawString(Math.round(this._Center.x),Math.round(this._Center.y),t,i.Align.CENTRAL)},n.prototype.defined=function(){return!0},n.prototype.drawEdge=function(t){if(null!=this.edgeColor&&this.defined()){var n=t.getContext("2d");n.save(),n.strokeStyle=this.edgeColor;var e=this.radius();n.beginPath(),n.ellipse(this._Center.x,this._Center.y,e,e,0,0,2*Math.PI),n.stroke(),n.restore()}},n.prototype.drawFace=function(t){if(null!=this.faceColor&&this.defined()){var n=t.getContext("2d");n.save(),n.fillStyle=this.faceColor;var e=this.radius();n.beginPath(),n.ellipse(this._Center.x,this._Center.y,e,e,0,0,2*Math.PI),n.fill(),n.restore()}},n.prototype.radius=function(){return this._A.distance(this._B)},n.prototype.radius2=function(){return this._A.distance2(this._B)},n.prototype.drawVertex=function(){},n.prototype.update=function(){},n.prototype.translate=function(t,n){},n.prototype.rotate=function(t,n,e,o){},n}(i.GeomElement);n.SphereElement=u},8156(t,n,e){Object.defineProperty(n,"__esModule",{value:!0}),n.slates=n.E=n.Align=void 0,n.parseParam=h,n.init=function(t){var e=null!=t.align?t.align:o.Align.CENTRAL,r=t.canvasid;null==r&&(r="canvasid");var a=document.getElementById(r);!function(t){var n=t.clientWidth,e=t.clientHeight;t.width==n&&t.height==e||(t.width=n,t.height=e)}(a);var p=new s.Slate(a);n.slates.push(p);var f=null!=t.font?t.font:"Times New Roman",_=null!=t.fontsize?t.fontsize:18;o.GeomElement.setFont(f,_),p.bgcolor=(0,c.parseColor)(t.background,"#ffffff","#ffffff");for(var y=0,d=t.elements;y<d.length;y++){var v=d[y],g="string"==typeof v?h(v):v,P=p.createElement(g.construction,g.params,g.name);P.align=e;var C=P instanceof i.PointElement?"black":null;P.nameColor=(0,c.parseColor)(g.nameColor,C,p.bgcolor);var m=P.draggable?P instanceof u.PlaneSlider?"red":"orange":"black";P.vertexColor=(0,c.parseColor)(g.vertexColor,m,p.bgcolor),P.edgeColor=(0,c.parseColor)(g.edgeColor,"black",p.bgcolor);var w=(0,c.lighten)(p.bgcolor),x=2==P.dimension?w:null;P.faceColor=(0,c.parseColor)(g.faceColor,x,p.bgcolor)}null!=t.pivot&&p.setPivot(t.pivot),p.update(),p.updateCoordinates(0),a&&a.parentElement&&(0,l.createControls)(p,a,t)};var o=e(8020);Object.defineProperty(n,"Align",{enumerable:!0,get:function(){return o.Align}});var r=e(7658);Object.defineProperty(n,"E",{enumerable:!0,get:function(){return r.E}});var i=e(6091),s=e(8041),u=e(4994),c=e(1454),l=e(3267);n.slates=[];var a={point:"Point",line:"Line",circle:"Circle",polygon:"Polygon",sector:"Sector",plane:"Plane",sphere:"Sphere",polyhedron:"Polyhedra"};function h(t){var n=t.split(";");if(n.length<4)throw new Error("parseParam: expected at least 4 semicolon-separated fields, got ".concat(n.length,': "').concat(t,'"'));var e=n[0],o=n[1],i=n[2],s=n[3],u=a[o];if(null==u)throw new Error('parseParam: unknown element type "'.concat(o,'" in "').concat(t,'"'));var c=r.E[u]["3points"===i?"threePoints":i];if(null==c)throw new Error('parseParam: unknown construction "'.concat(o,";").concat(i,'" in "').concat(t,'"'));var l={name:e,construction:c,params:s.split(",").map((function(t){var n=Number(t);return""===t||isNaN(n)?t:n}))};return n.length>4&&void 0!==n[4]&&(l.nameColor=n[4]),n.length>5&&void 0!==n[5]&&(l.vertexColor=n[5]),n.length>6&&void 0!==n[6]&&(l.edgeColor=n[6]),n.length>7&&void 0!==n[7]&&(l.faceColor=n[7]),l}}},n={},e=function e(o){var r=n[o];if(void 0!==r)return r.exports;var i=n[o]={exports:{}};return t[o].call(i.exports,i,i.exports,e),i.exports}(8156);geomlib=e})();
2
2
  //# sourceMappingURL=bundle.js.map