1&&void 0!==arguments[1]?arguments[1]:D.compare;t(this,e),this.queue=n,this.tree=new c(r),this.segments=[]}return n(e,[{key:"process",value:function(t){var e=t.segment,n=[];if(t.consumedBy)return t.isLeft?this.queue.remove(t.otherSE):this.tree.remove(e),n;var r=t.isLeft?this.tree.insert(e):this.tree.find(e);if(!r)throw new Error("Unable to find segment #".concat(e.id," ")+"[".concat(e.leftSE.point.x,", ").concat(e.leftSE.point.y,"] -> ")+"[".concat(e.rightSE.point.x,", ").concat(e.rightSE.point.y,"] ")+"in SweepLine tree. Please submit a bug report.");for(var i=r,o=r,s=void 0,a=void 0;void 0===s;)null===(i=this.tree.prev(i))?s=null:void 0===i.key.consumedBy&&(s=i.key);for(;void 0===a;)null===(o=this.tree.next(o))?a=null:void 0===o.key.consumedBy&&(a=o.key);if(t.isLeft){var u=null;if(s){var l=s.getIntersection(e);if(null!==l&&(e.isAnEndpoint(l)||(u=l),!s.isAnEndpoint(l)))for(var c=this._splitSafely(s,l),h=0,p=c.length;h0?(this.tree.remove(e),n.push(t)):(this.segments.push(e),e.prev=s)}else{if(s&&a){var E=s.getIntersection(a);if(null!==E){if(!s.isAnEndpoint(E))for(var w=this._splitSafely(s,E),S=0,C=w.length;SX)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big). Please file a bug report.");for(var b=new V(d),E=d.size,w=d.pop();w;){var C=w.key;if(d.size===E){var I=C.segment;throw new Error("Unable to pop() ".concat(C.isLeft?"left":"right"," SweepEvent ")+"[".concat(C.point.x,", ").concat(C.point.y,"] from segment #").concat(I.id," ")+"[".concat(I.leftSE.point.x,", ").concat(I.leftSE.point.y,"] -> ")+"[".concat(I.rightSE.point.x,", ").concat(I.rightSE.point.y,"] from queue. ")+"Please file a bug report.")}if(d.size>X)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big). Please file a bug report.");if(b.segments.length>Y)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments). Please file a bug report.");for(var O=b.process(C),P=0,R=O.length;P1?e-1:0),r=1;r1?e-1:0),r=1;r1?e-1:0),r=1;r1?e-1:0),r=1;ri;){if(o-i>600){var a=o-i+1,u=r-i+1,l=Math.log(a),c=.5*Math.exp(2*l/3),h=.5*Math.sqrt(l*c*(a-c)/a)*(u-a/2<0?-1:1);t(n,r,Math.max(i,Math.floor(r-u*c/a+h)),Math.min(o,Math.floor(r+(a-u)*c/a+h)),s)}var p=n[r],f=i,d=o;for(e(n,i,r),s(n[o],p)>0&&e(n,i,o);f0;)d--}0===s(n[i],p)?e(n,i,d):e(n,++d,o),d<=r&&(i=d+1),r<=d&&(o=d-1)}}(t,r,i||0,o||t.length-1,s||n)}function e(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function n(t,e){return te?1:0}var r=function(t){void 0===t&&(t=9),this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function i(t,e,n){if(!n)return e.indexOf(t);for(var r=0;r=t.minX&&e.maxY>=t.minY}function d(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function g(e,n,r,i,o){for(var s=[n,r];s.length;)if(!((r=s.pop())-(n=s.pop())<=i)){var a=n+Math.ceil((r-n)/i/2)*i;t(e,a,n,r,o),s.push(n,a,a,r)}}return r.prototype.all=function(){return this._all(this.data,[])},r.prototype.search=function(t){var e=this.data,n=[];if(!f(t,e))return n;for(var r=this.toBBox,i=[];e;){for(var o=0;o=0&&i[e].children.length>this._maxEntries;)this._split(i,e),e--;this._adjustParentBBoxes(r,i,e)},r.prototype._split=function(t,e){var n=t[e],r=n.children.length,i=this._minEntries;this._chooseSplitAxis(n,i,r);var s=this._chooseSplitIndex(n,i,r),a=d(n.children.splice(s,n.children.length-s));a.height=n.height,a.leaf=n.leaf,o(n,this.toBBox),o(a,this.toBBox),e?t[e-1].children.push(a):this._splitRoot(n,a)},r.prototype._splitRoot=function(t,e){this.data=d([t,e]),this.data.height=t.height+1,this.data.leaf=!1,o(this.data,this.toBBox)},r.prototype._chooseSplitIndex=function(t,e,n){for(var r,i,o,a,u,l,h,p=1/0,f=1/0,d=e;d<=n-e;d++){var g=s(t,0,d,this.toBBox),y=s(t,d,n,this.toBBox),v=(i=g,o=y,a=void 0,u=void 0,l=void 0,h=void 0,a=Math.max(i.minX,o.minX),u=Math.max(i.minY,o.minY),l=Math.min(i.maxX,o.maxX),h=Math.min(i.maxY,o.maxY),Math.max(0,l-a)*Math.max(0,h-u)),_=c(g)+c(y);v=e;f--){var d=t.children[f];a(u,t.leaf?i(d):d),l+=h(u)}return l},r.prototype._adjustParentBBoxes=function(t,e,n){for(var r=n;r>=0;r--)a(e[r],t)},r.prototype._condense=function(t){for(var e=t.length-1,n=void 0;e>=0;e--)0===t[e].children.length?e>0?(n=t[e-1].children).splice(n.indexOf(t[e]),1):this.clear():o(t[e],this.toBBox)},r}()},4463:function(t,e,n){"use strict";var r=n(2791),i=n(5296);function o(t){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+t,n=1;ne}return!1}(e,n,i,r)&&(n=null),r||null===i?function(t){return!!h.call(d,t)||!h.call(f,t)&&(p.test(t)?d[t]=!0:(f[t]=!0,!1))}(e)&&(null===n?t.removeAttribute(e):t.setAttribute(e,""+n)):i.mustUseProperty?t[i.propertyName]=null===n?3!==i.type&&"":n:(e=i.attributeName,r=i.attributeNamespace,null===n?t.removeAttribute(e):(n=3===(i=i.type)||4===i&&!0===n?"":""+n,r?t.setAttributeNS(r,e,n):t.setAttribute(e,n))))}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach((function(t){var e=t.replace(v,_);y[e]=new g(e,1,!1,t,null,!1,!1)})),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach((function(t){var e=t.replace(v,_);y[e]=new g(e,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)})),["xml:base","xml:lang","xml:space"].forEach((function(t){var e=t.replace(v,_);y[e]=new g(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)})),["tabIndex","crossOrigin"].forEach((function(t){y[t]=new g(t,1,!1,t.toLowerCase(),null,!1,!1)})),y.xlinkHref=new g("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach((function(t){y[t]=new g(t,1,!1,t.toLowerCase(),null,!0,!0)}));var x=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,b=Symbol.for("react.element"),E=Symbol.for("react.portal"),w=Symbol.for("react.fragment"),S=Symbol.for("react.strict_mode"),C=Symbol.for("react.profiler"),I=Symbol.for("react.provider"),O=Symbol.for("react.context"),P=Symbol.for("react.forward_ref"),R=Symbol.for("react.suspense"),T=Symbol.for("react.suspense_list"),N=Symbol.for("react.memo"),L=Symbol.for("react.lazy");Symbol.for("react.scope"),Symbol.for("react.debug_trace_mode");var M=Symbol.for("react.offscreen");Symbol.for("react.legacy_hidden"),Symbol.for("react.cache"),Symbol.for("react.tracing_marker");var A=Symbol.iterator;function k(t){return null===t||"object"!==typeof t?null:"function"===typeof(t=A&&t[A]||t["@@iterator"])?t:null}var D,F=Object.assign;function j(t){if(void 0===D)try{throw Error()}catch(n){var e=n.stack.trim().match(/\n( *(at )?)/);D=e&&e[1]||""}return"\n"+D+t}var z=!1;function G(t,e){if(!t||z)return"";z=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(e)if(e=function(){throw Error()},Object.defineProperty(e.prototype,"props",{set:function(){throw Error()}}),"object"===typeof Reflect&&Reflect.construct){try{Reflect.construct(e,[])}catch(l){var r=l}Reflect.construct(t,[],e)}else{try{e.call()}catch(l){r=l}t.call(e.prototype)}else{try{throw Error()}catch(l){r=l}t()}}catch(l){if(l&&r&&"string"===typeof l.stack){for(var i=l.stack.split("\n"),o=r.stack.split("\n"),s=i.length-1,a=o.length-1;1<=s&&0<=a&&i[s]!==o[a];)a--;for(;1<=s&&0<=a;s--,a--)if(i[s]!==o[a]){if(1!==s||1!==a)do{if(s--,0>--a||i[s]!==o[a]){var u="\n"+i[s].replace(" at new "," at ");return t.displayName&&u.includes("")&&(u=u.replace("",t.displayName)),u}}while(1<=s&&0<=a);break}}}finally{z=!1,Error.prepareStackTrace=n}return(t=t?t.displayName||t.name:"")?j(t):""}function B(t){switch(t.tag){case 5:return j(t.type);case 16:return j("Lazy");case 13:return j("Suspense");case 19:return j("SuspenseList");case 0:case 2:case 15:return t=G(t.type,!1);case 11:return t=G(t.type.render,!1);case 1:return t=G(t.type,!0);default:return""}}function U(t){if(null==t)return null;if("function"===typeof t)return t.displayName||t.name||null;if("string"===typeof t)return t;switch(t){case w:return"Fragment";case E:return"Portal";case C:return"Profiler";case S:return"StrictMode";case R:return"Suspense";case T:return"SuspenseList"}if("object"===typeof t)switch(t.$$typeof){case O:return(t.displayName||"Context")+".Consumer";case I:return(t._context.displayName||"Context")+".Provider";case P:var e=t.render;return(t=t.displayName)||(t=""!==(t=e.displayName||e.name||"")?"ForwardRef("+t+")":"ForwardRef"),t;case N:return null!==(e=t.displayName||null)?e:U(t.type)||"Memo";case L:e=t._payload,t=t._init;try{return U(t(e))}catch(n){}}return null}function V(t){var e=t.type;switch(t.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=(t=e.render).displayName||t.name||"",e.displayName||(""!==t?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return U(e);case 8:return e===S?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if("function"===typeof e)return e.displayName||e.name||null;if("string"===typeof e)return e}return null}function X(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":case"object":return t;default:return""}}function Y(t){var e=t.type;return(t=t.nodeName)&&"input"===t.toLowerCase()&&("checkbox"===e||"radio"===e)}function q(t){t._valueTracker||(t._valueTracker=function(t){var e=Y(t)?"checked":"value",n=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),r=""+t[e];if(!t.hasOwnProperty(e)&&"undefined"!==typeof n&&"function"===typeof n.get&&"function"===typeof n.set){var i=n.get,o=n.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return i.call(this)},set:function(t){r=""+t,o.call(this,t)}}),Object.defineProperty(t,e,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(t){r=""+t},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}(t))}function W(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),r="";return t&&(r=Y(t)?t.checked?"true":"false":t.value),(t=r)!==n&&(e.setValue(t),!0)}function H(t){if("undefined"===typeof(t=t||("undefined"!==typeof document?document:void 0)))return null;try{return t.activeElement||t.body}catch(e){return t.body}}function K(t,e){var n=e.checked;return F({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=n?n:t._wrapperState.initialChecked})}function Z(t,e){var n=null==e.defaultValue?"":e.defaultValue,r=null!=e.checked?e.checked:e.defaultChecked;n=X(null!=e.value?e.value:n),t._wrapperState={initialChecked:r,initialValue:n,controlled:"checkbox"===e.type||"radio"===e.type?null!=e.checked:null!=e.value}}function $(t,e){null!=(e=e.checked)&&m(t,"checked",e,!1)}function J(t,e){$(t,e);var n=X(e.value),r=e.type;if(null!=n)"number"===r?(0===n&&""===t.value||t.value!=n)&&(t.value=""+n):t.value!==""+n&&(t.value=""+n);else if("submit"===r||"reset"===r)return void t.removeAttribute("value");e.hasOwnProperty("value")?tt(t,e.type,n):e.hasOwnProperty("defaultValue")&&tt(t,e.type,X(e.defaultValue)),null==e.checked&&null!=e.defaultChecked&&(t.defaultChecked=!!e.defaultChecked)}function Q(t,e,n){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var r=e.type;if(!("submit"!==r&&"reset"!==r||void 0!==e.value&&null!==e.value))return;e=""+t._wrapperState.initialValue,n||e===t.value||(t.value=e),t.defaultValue=e}""!==(n=t.name)&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,""!==n&&(t.name=n)}function tt(t,e,n){"number"===e&&H(t.ownerDocument)===t||(null==n?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+n&&(t.defaultValue=""+n))}var et=Array.isArray;function nt(t,e,n,r){if(t=t.options,e){e={};for(var i=0;i"+e.valueOf().toString()+"",e=lt.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}},"undefined"!==typeof MSApp&&MSApp.execUnsafeLocalFunction?function(t,e,n,r){MSApp.execUnsafeLocalFunction((function(){return ct(t,e)}))}:ct);function pt(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&3===n.nodeType)return void(n.nodeValue=e)}t.textContent=e}var ft={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},dt=["Webkit","ms","Moz","O"];function gt(t,e,n){return null==e||"boolean"===typeof e||""===e?"":n||"number"!==typeof e||0===e||ft.hasOwnProperty(t)&&ft[t]?(""+e).trim():e+"px"}function yt(t,e){for(var n in t=t.style,e)if(e.hasOwnProperty(n)){var r=0===n.indexOf("--"),i=gt(n,e[n],r);"float"===n&&(n="cssFloat"),r?t.setProperty(n,i):t[n]=i}}Object.keys(ft).forEach((function(t){dt.forEach((function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),ft[e]=ft[t]}))}));var vt=F({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function _t(t,e){if(e){if(vt[t]&&(null!=e.children||null!=e.dangerouslySetInnerHTML))throw Error(o(137,t));if(null!=e.dangerouslySetInnerHTML){if(null!=e.children)throw Error(o(60));if("object"!==typeof e.dangerouslySetInnerHTML||!("__html"in e.dangerouslySetInnerHTML))throw Error(o(61))}if(null!=e.style&&"object"!==typeof e.style)throw Error(o(62))}}function mt(t,e){if(-1===t.indexOf("-"))return"string"===typeof e.is;switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var xt=null;function bt(t){return(t=t.target||t.srcElement||window).correspondingUseElement&&(t=t.correspondingUseElement),3===t.nodeType?t.parentNode:t}var Et=null,wt=null,St=null;function Ct(t){if(t=mi(t)){if("function"!==typeof Et)throw Error(o(280));var e=t.stateNode;e&&(e=bi(e),Et(t.stateNode,t.type,e))}}function It(t){wt?St?St.push(t):St=[t]:wt=t}function Ot(){if(wt){var t=wt,e=St;if(St=wt=null,Ct(t),e)for(t=0;t>>=0,0===t?32:31-(ae(t)/ue|0)|0},ae=Math.log,ue=Math.LN2;var le=64,ce=4194304;function he(t){switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return 4194240&t;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return 130023424&t;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function pe(t,e){var n=t.pendingLanes;if(0===n)return 0;var r=0,i=t.suspendedLanes,o=t.pingedLanes,s=268435455&n;if(0!==s){var a=s&~i;0!==a?r=he(a):0!==(o&=s)&&(r=he(o))}else 0!==(s=n&~i)?r=he(s):0!==o&&(r=he(o));if(0===r)return 0;if(0!==e&&e!==r&&0===(e&i)&&((i=r&-r)>=(o=e&-e)||16===i&&0!==(4194240&o)))return e;if(0!==(4&r)&&(r|=16&n),0!==(e=t.entangledLanes))for(t=t.entanglements,e&=r;0n;n++)e.push(t);return e}function ve(t,e,n){t.pendingLanes|=e,536870912!==e&&(t.suspendedLanes=0,t.pingedLanes=0),(t=t.eventTimes)[e=31-se(e)]=n}function _e(t,e){var n=t.entangledLanes|=e;for(t=t.entanglements;n;){var r=31-se(n),i=1<=kn),jn=String.fromCharCode(32),zn=!1;function Gn(t,e){switch(t){case"keyup":return-1!==Mn.indexOf(e.keyCode);case"keydown":return 229!==e.keyCode;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Bn(t){return"object"===typeof(t=t.detail)&&"data"in t?t.data:null}var Un=!1;var Vn={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Xn(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return"input"===e?!!Vn[t.type]:"textarea"===e}function Yn(t,e,n,r){It(r),0<(e=qr(e,"onChange")).length&&(n=new cn("onChange","change",null,n,r),t.push({event:n,listeners:e}))}var qn=null,Wn=null;function Hn(t){jr(t,0)}function Kn(t){if(W(xi(t)))return t}function Zn(t,e){if("change"===t)return e}var $n=!1;if(c){var Jn;if(c){var Qn="oninput"in document;if(!Qn){var tr=document.createElement("div");tr.setAttribute("oninput","return;"),Qn="function"===typeof tr.oninput}Jn=Qn}else Jn=!1;$n=Jn&&(!document.documentMode||9=e)return{node:r,offset:e-t};t=n}t:{for(;r;){if(r.nextSibling){r=r.nextSibling;break t}r=r.parentNode}r=void 0}r=lr(r)}}function hr(t,e){return!(!t||!e)&&(t===e||(!t||3!==t.nodeType)&&(e&&3===e.nodeType?hr(t,e.parentNode):"contains"in t?t.contains(e):!!t.compareDocumentPosition&&!!(16&t.compareDocumentPosition(e))))}function pr(){for(var t=window,e=H();e instanceof t.HTMLIFrameElement;){try{var n="string"===typeof e.contentWindow.location.href}catch(r){n=!1}if(!n)break;e=H((t=e.contentWindow).document)}return e}function fr(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&("input"===e&&("text"===t.type||"search"===t.type||"tel"===t.type||"url"===t.type||"password"===t.type)||"textarea"===e||"true"===t.contentEditable)}function dr(t){var e=pr(),n=t.focusedElem,r=t.selectionRange;if(e!==n&&n&&n.ownerDocument&&hr(n.ownerDocument.documentElement,n)){if(null!==r&&fr(n))if(e=r.start,void 0===(t=r.end)&&(t=e),"selectionStart"in n)n.selectionStart=e,n.selectionEnd=Math.min(t,n.value.length);else if((t=(e=n.ownerDocument||document)&&e.defaultView||window).getSelection){t=t.getSelection();var i=n.textContent.length,o=Math.min(r.start,i);r=void 0===r.end?o:Math.min(r.end,i),!t.extend&&o>r&&(i=r,r=o,o=i),i=cr(n,o);var s=cr(n,r);i&&s&&(1!==t.rangeCount||t.anchorNode!==i.node||t.anchorOffset!==i.offset||t.focusNode!==s.node||t.focusOffset!==s.offset)&&((e=e.createRange()).setStart(i.node,i.offset),t.removeAllRanges(),o>r?(t.addRange(e),t.extend(s.node,s.offset)):(e.setEnd(s.node,s.offset),t.addRange(e)))}for(e=[],t=n;t=t.parentNode;)1===t.nodeType&&e.push({element:t,left:t.scrollLeft,top:t.scrollTop});for("function"===typeof n.focus&&n.focus(),n=0;n=document.documentMode,yr=null,vr=null,_r=null,mr=!1;function xr(t,e,n){var r=n.window===n?n.document:9===n.nodeType?n:n.ownerDocument;mr||null==yr||yr!==H(r)||("selectionStart"in(r=yr)&&fr(r)?r={start:r.selectionStart,end:r.selectionEnd}:r={anchorNode:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset},_r&&ur(_r,r)||(_r=r,0<(r=qr(vr,"onSelect")).length&&(e=new cn("onSelect","select",null,e,n),t.push({event:e,listeners:r}),e.target=yr)))}function br(t,e){var n={};return n[t.toLowerCase()]=e.toLowerCase(),n["Webkit"+t]="webkit"+e,n["Moz"+t]="moz"+e,n}var Er={animationend:br("Animation","AnimationEnd"),animationiteration:br("Animation","AnimationIteration"),animationstart:br("Animation","AnimationStart"),transitionend:br("Transition","TransitionEnd")},wr={},Sr={};function Cr(t){if(wr[t])return wr[t];if(!Er[t])return t;var e,n=Er[t];for(e in n)if(n.hasOwnProperty(e)&&e in Sr)return wr[t]=n[e];return t}c&&(Sr=document.createElement("div").style,"AnimationEvent"in window||(delete Er.animationend.animation,delete Er.animationiteration.animation,delete Er.animationstart.animation),"TransitionEvent"in window||delete Er.transitionend.transition);var Ir=Cr("animationend"),Or=Cr("animationiteration"),Pr=Cr("animationstart"),Rr=Cr("transitionend"),Tr=new Map,Nr="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Lr(t,e){Tr.set(t,e),u(e,[t])}for(var Mr=0;Mrwi||(t.current=Ei[wi],Ei[wi]=null,wi--)}function Ii(t,e){wi++,Ei[wi]=t.current,t.current=e}var Oi={},Pi=Si(Oi),Ri=Si(!1),Ti=Oi;function Ni(t,e){var n=t.type.contextTypes;if(!n)return Oi;var r=t.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===e)return r.__reactInternalMemoizedMaskedChildContext;var i,o={};for(i in n)o[i]=e[i];return r&&((t=t.stateNode).__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=o),o}function Li(t){return null!==(t=t.childContextTypes)&&void 0!==t}function Mi(){Ci(Ri),Ci(Pi)}function Ai(t,e,n){if(Pi.current!==Oi)throw Error(o(168));Ii(Pi,e),Ii(Ri,n)}function ki(t,e,n){var r=t.stateNode;if(e=e.childContextTypes,"function"!==typeof r.getChildContext)return n;for(var i in r=r.getChildContext())if(!(i in e))throw Error(o(108,V(t)||"Unknown",i));return F({},n,r)}function Di(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||Oi,Ti=Pi.current,Ii(Pi,t),Ii(Ri,Ri.current),!0}function Fi(t,e,n){var r=t.stateNode;if(!r)throw Error(o(169));n?(t=ki(t,e,Ti),r.__reactInternalMemoizedMergedChildContext=t,Ci(Ri),Ci(Pi),Ii(Pi,t)):Ci(Ri),Ii(Ri,n)}var ji=null,zi=!1,Gi=!1;function Bi(t){null===ji?ji=[t]:ji.push(t)}function Ui(){if(!Gi&&null!==ji){Gi=!0;var t=0,e=me;try{var n=ji;for(me=1;t>=s,i-=s,Zi=1<<32-se(e)+i|n<g?(y=h,h=null):y=h.sibling;var v=f(i,h,a[g],u);if(null===v){null===h&&(h=y);break}t&&h&&null===v.alternate&&e(i,h),o=s(v,o,g),null===c?l=v:c.sibling=v,c=v,h=y}if(g===a.length)return n(i,h),io&&Ji(i,g),l;if(null===h){for(;gy?(v=g,g=null):v=g.sibling;var m=f(i,g,_.value,l);if(null===m){null===g&&(g=v);break}t&&g&&null===m.alternate&&e(i,g),a=s(m,a,y),null===h?c=m:h.sibling=m,h=m,g=v}if(_.done)return n(i,g),io&&Ji(i,y),c;if(null===g){for(;!_.done;y++,_=u.next())null!==(_=p(i,_.value,l))&&(a=s(_,a,y),null===h?c=_:h.sibling=_,h=_);return io&&Ji(i,y),c}for(g=r(i,g);!_.done;y++,_=u.next())null!==(_=d(g,i,y,_.value,l))&&(t&&null!==_.alternate&&g.delete(null===_.key?y:_.key),a=s(_,a,y),null===h?c=_:h.sibling=_,h=_);return t&&g.forEach((function(t){return e(i,t)})),io&&Ji(i,y),c}return function t(r,o,s,u){if("object"===typeof s&&null!==s&&s.type===w&&null===s.key&&(s=s.props.children),"object"===typeof s&&null!==s){switch(s.$$typeof){case b:t:{for(var l=s.key,c=o;null!==c;){if(c.key===l){if((l=s.type)===w){if(7===c.tag){n(r,c.sibling),(o=i(c,s.props.children)).return=r,r=o;break t}}else if(c.elementType===l||"object"===typeof l&&null!==l&&l.$$typeof===L&&Ko(l)===c.type){n(r,c.sibling),(o=i(c,s.props)).ref=Wo(r,c,s),o.return=r,r=o;break t}n(r,c);break}e(r,c),c=c.sibling}s.type===w?((o=Dl(s.props.children,r.mode,u,s.key)).return=r,r=o):((u=kl(s.type,s.key,s.props,null,r.mode,u)).ref=Wo(r,o,s),u.return=r,r=u)}return a(r);case E:t:{for(c=s.key;null!==o;){if(o.key===c){if(4===o.tag&&o.stateNode.containerInfo===s.containerInfo&&o.stateNode.implementation===s.implementation){n(r,o.sibling),(o=i(o,s.children||[])).return=r,r=o;break t}n(r,o);break}e(r,o),o=o.sibling}(o=zl(s,r.mode,u)).return=r,r=o}return a(r);case L:return t(r,o,(c=s._init)(s._payload),u)}if(et(s))return g(r,o,s,u);if(k(s))return y(r,o,s,u);Ho(r,s)}return"string"===typeof s&&""!==s||"number"===typeof s?(s=""+s,null!==o&&6===o.tag?(n(r,o.sibling),(o=i(o,s)).return=r,r=o):(n(r,o),(o=jl(s,r.mode,u)).return=r,r=o),a(r)):n(r,o)}}var $o=Zo(!0),Jo=Zo(!1),Qo={},ts=Si(Qo),es=Si(Qo),ns=Si(Qo);function rs(t){if(t===Qo)throw Error(o(174));return t}function is(t,e){switch(Ii(ns,e),Ii(es,t),Ii(ts,Qo),t=e.nodeType){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:ut(null,"");break;default:e=ut(e=(t=8===t?e.parentNode:e).namespaceURI||null,t=t.tagName)}Ci(ts),Ii(ts,e)}function os(){Ci(ts),Ci(es),Ci(ns)}function ss(t){rs(ns.current);var e=rs(ts.current),n=ut(e,t.type);e!==n&&(Ii(es,t),Ii(ts,n))}function as(t){es.current===t&&(Ci(ts),Ci(es))}var us=Si(0);function ls(t){for(var e=t;null!==e;){if(13===e.tag){var n=e.memoizedState;if(null!==n&&(null===(n=n.dehydrated)||"$?"===n.data||"$!"===n.data))return e}else if(19===e.tag&&void 0!==e.memoizedProps.revealOrder){if(0!==(128&e.flags))return e}else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break;for(;null===e.sibling;){if(null===e.return||e.return===t)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var cs=[];function hs(){for(var t=0;tn?n:4,t(!0);var r=fs.transition;fs.transition={};try{t(!1),e()}finally{me=n,fs.transition=r}}function ta(){return Os().memoizedState}function ea(t,e,n){var r=nl(t);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},ra(t))ia(e,n);else if(null!==(n=Ro(t,e,n,r))){rl(n,t,r,el()),oa(n,e,r)}}function na(t,e,n){var r=nl(t),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(ra(t))ia(e,i);else{var o=t.alternate;if(0===t.lanes&&(null===o||0===o.lanes)&&null!==(o=e.lastRenderedReducer))try{var s=e.lastRenderedState,a=o(s,n);if(i.hasEagerState=!0,i.eagerState=a,ar(a,s)){var u=e.interleaved;return null===u?(i.next=i,Po(e)):(i.next=u.next,u.next=i),void(e.interleaved=i)}}catch(l){}null!==(n=Ro(t,e,i,r))&&(rl(n,t,r,i=el()),oa(n,e,r))}}function ra(t){var e=t.alternate;return t===gs||null!==e&&e===gs}function ia(t,e){ms=_s=!0;var n=t.pending;null===n?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function oa(t,e,n){if(0!==(4194240&n)){var r=e.lanes;n|=r&=t.pendingLanes,e.lanes=n,_e(t,n)}}var sa={readContext:Io,useCallback:Es,useContext:Es,useEffect:Es,useImperativeHandle:Es,useInsertionEffect:Es,useLayoutEffect:Es,useMemo:Es,useReducer:Es,useRef:Es,useState:Es,useDebugValue:Es,useDeferredValue:Es,useTransition:Es,useMutableSource:Es,useSyncExternalStore:Es,useId:Es,unstable_isNewReconciler:!1},aa={readContext:Io,useCallback:function(t,e){return Is().memoizedState=[t,void 0===e?null:e],t},useContext:Io,useEffect:Vs,useImperativeHandle:function(t,e,n){return n=null!==n&&void 0!==n?n.concat([t]):null,Bs(4194308,4,Ws.bind(null,e,t),n)},useLayoutEffect:function(t,e){return Bs(4194308,4,t,e)},useInsertionEffect:function(t,e){return Bs(4,2,t,e)},useMemo:function(t,e){var n=Is();return e=void 0===e?null:e,t=t(),n.memoizedState=[t,e],t},useReducer:function(t,e,n){var r=Is();return e=void 0!==n?n(e):e,r.memoizedState=r.baseState=e,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:e},r.queue=t,t=t.dispatch=ea.bind(null,gs,t),[r.memoizedState,t]},useRef:function(t){return t={current:t},Is().memoizedState=t},useState:js,useDebugValue:Ks,useDeferredValue:function(t){return Is().memoizedState=t},useTransition:function(){var t=js(!1),e=t[0];return t=Qs.bind(null,t[1]),Is().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,n){var r=gs,i=Is();if(io){if(void 0===n)throw Error(o(407));n=n()}else{if(n=e(),null===Tu)throw Error(o(349));0!==(30&ds)||Ms(r,e,n)}i.memoizedState=n;var s={value:n,getSnapshot:e};return i.queue=s,Vs(ks.bind(null,r,s,t),[t]),r.flags|=2048,zs(9,As.bind(null,r,s,n,e),void 0,null),n},useId:function(){var t=Is(),e=Tu.identifierPrefix;if(io){var n=$i;e=":"+e+"R"+(n=(Zi&~(1<<32-se(Zi)-1)).toString(32)+n),0<(n=xs++)&&(e+="H"+n.toString(32)),e+=":"}else e=":"+e+"r"+(n=bs++).toString(32)+":";return t.memoizedState=e},unstable_isNewReconciler:!1},ua={readContext:Io,useCallback:Zs,useContext:Io,useEffect:Xs,useImperativeHandle:Hs,useInsertionEffect:Ys,useLayoutEffect:qs,useMemo:$s,useReducer:Rs,useRef:Gs,useState:function(){return Rs(Ps)},useDebugValue:Ks,useDeferredValue:function(t){return Js(Os(),ys.memoizedState,t)},useTransition:function(){return[Rs(Ps)[0],Os().memoizedState]},useMutableSource:Ns,useSyncExternalStore:Ls,useId:ta,unstable_isNewReconciler:!1},la={readContext:Io,useCallback:Zs,useContext:Io,useEffect:Xs,useImperativeHandle:Hs,useInsertionEffect:Ys,useLayoutEffect:qs,useMemo:$s,useReducer:Ts,useRef:Gs,useState:function(){return Ts(Ps)},useDebugValue:Ks,useDeferredValue:function(t){var e=Os();return null===ys?e.memoizedState=t:Js(e,ys.memoizedState,t)},useTransition:function(){return[Ts(Ps)[0],Os().memoizedState]},useMutableSource:Ns,useSyncExternalStore:Ls,useId:ta,unstable_isNewReconciler:!1};function ca(t,e){try{var n="",r=e;do{n+=B(r),r=r.return}while(r);var i=n}catch(o){i="\nError generating stack: "+o.message+"\n"+o.stack}return{value:t,source:e,stack:i,digest:null}}function ha(t,e,n){return{value:t,source:null,stack:null!=n?n:null,digest:null!=e?e:null}}function pa(t,e){try{console.error(e.value)}catch(n){setTimeout((function(){throw n}))}}var fa="function"===typeof WeakMap?WeakMap:Map;function da(t,e,n){(n=Ao(-1,n)).tag=3,n.payload={element:null};var r=e.value;return n.callback=function(){Yu||(Yu=!0,qu=r),pa(0,e)},n}function ga(t,e,n){(n=Ao(-1,n)).tag=3;var r=t.type.getDerivedStateFromError;if("function"===typeof r){var i=e.value;n.payload=function(){return r(i)},n.callback=function(){pa(0,e)}}var o=t.stateNode;return null!==o&&"function"===typeof o.componentDidCatch&&(n.callback=function(){pa(0,e),"function"!==typeof r&&(null===Wu?Wu=new Set([this]):Wu.add(this));var t=e.stack;this.componentDidCatch(e.value,{componentStack:null!==t?t:""})}),n}function ya(t,e,n){var r=t.pingCache;if(null===r){r=t.pingCache=new fa;var i=new Set;r.set(e,i)}else void 0===(i=r.get(e))&&(i=new Set,r.set(e,i));i.has(n)||(i.add(n),t=Il.bind(null,t,e,n),e.then(t,t))}function va(t){do{var e;if((e=13===t.tag)&&(e=null===(e=t.memoizedState)||null!==e.dehydrated),e)return t;t=t.return}while(null!==t);return null}function _a(t,e,n,r,i){return 0===(1&t.mode)?(t===e?t.flags|=65536:(t.flags|=128,n.flags|=131072,n.flags&=-52805,1===n.tag&&(null===n.alternate?n.tag=17:((e=Ao(-1,1)).tag=2,ko(n,e,1))),n.lanes|=1),t):(t.flags|=65536,t.lanes=i,t)}var ma=x.ReactCurrentOwner,xa=!1;function ba(t,e,n,r){e.child=null===t?Jo(e,null,n,r):$o(e,t.child,n,r)}function Ea(t,e,n,r,i){n=n.render;var o=e.ref;return Co(e,i),r=Ss(t,e,n,r,o,i),n=Cs(),null===t||xa?(io&&n&&to(e),e.flags|=1,ba(t,e,r,i),e.child):(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~i,Ya(t,e,i))}function wa(t,e,n,r,i){if(null===t){var o=n.type;return"function"!==typeof o||Ml(o)||void 0!==o.defaultProps||null!==n.compare||void 0!==n.defaultProps?((t=kl(n.type,null,r,e,e.mode,i)).ref=e.ref,t.return=e,e.child=t):(e.tag=15,e.type=o,Sa(t,e,o,r,i))}if(o=t.child,0===(t.lanes&i)){var s=o.memoizedProps;if((n=null!==(n=n.compare)?n:ur)(s,r)&&t.ref===e.ref)return Ya(t,e,i)}return e.flags|=1,(t=Al(o,r)).ref=e.ref,t.return=e,e.child=t}function Sa(t,e,n,r,i){if(null!==t){var o=t.memoizedProps;if(ur(o,r)&&t.ref===e.ref){if(xa=!1,e.pendingProps=r=o,0===(t.lanes&i))return e.lanes=t.lanes,Ya(t,e,i);0!==(131072&t.flags)&&(xa=!0)}}return Oa(t,e,n,r,i)}function Ca(t,e,n){var r=e.pendingProps,i=r.children,o=null!==t?t.memoizedState:null;if("hidden"===r.mode)if(0===(1&e.mode))e.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ii(Au,Mu),Mu|=n;else{if(0===(1073741824&n))return t=null!==o?o.baseLanes|n:n,e.lanes=e.childLanes=1073741824,e.memoizedState={baseLanes:t,cachePool:null,transitions:null},e.updateQueue=null,Ii(Au,Mu),Mu|=t,null;e.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=null!==o?o.baseLanes:n,Ii(Au,Mu),Mu|=r}else null!==o?(r=o.baseLanes|n,e.memoizedState=null):r=n,Ii(Au,Mu),Mu|=r;return ba(t,e,i,n),e.child}function Ia(t,e){var n=e.ref;(null===t&&null!==n||null!==t&&t.ref!==n)&&(e.flags|=512,e.flags|=2097152)}function Oa(t,e,n,r,i){var o=Li(n)?Ti:Pi.current;return o=Ni(e,o),Co(e,i),n=Ss(t,e,n,r,o,i),r=Cs(),null===t||xa?(io&&r&&to(e),e.flags|=1,ba(t,e,n,i),e.child):(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~i,Ya(t,e,i))}function Pa(t,e,n,r,i){if(Li(n)){var o=!0;Di(e)}else o=!1;if(Co(e,i),null===e.stateNode)Xa(t,e),Xo(e,n,r),qo(e,n,r,i),r=!0;else if(null===t){var s=e.stateNode,a=e.memoizedProps;s.props=a;var u=s.context,l=n.contextType;"object"===typeof l&&null!==l?l=Io(l):l=Ni(e,l=Li(n)?Ti:Pi.current);var c=n.getDerivedStateFromProps,h="function"===typeof c||"function"===typeof s.getSnapshotBeforeUpdate;h||"function"!==typeof s.UNSAFE_componentWillReceiveProps&&"function"!==typeof s.componentWillReceiveProps||(a!==r||u!==l)&&Yo(e,s,r,l),No=!1;var p=e.memoizedState;s.state=p,jo(e,r,s,i),u=e.memoizedState,a!==r||p!==u||Ri.current||No?("function"===typeof c&&(Bo(e,n,c,r),u=e.memoizedState),(a=No||Vo(e,n,a,r,p,u,l))?(h||"function"!==typeof s.UNSAFE_componentWillMount&&"function"!==typeof s.componentWillMount||("function"===typeof s.componentWillMount&&s.componentWillMount(),"function"===typeof s.UNSAFE_componentWillMount&&s.UNSAFE_componentWillMount()),"function"===typeof s.componentDidMount&&(e.flags|=4194308)):("function"===typeof s.componentDidMount&&(e.flags|=4194308),e.memoizedProps=r,e.memoizedState=u),s.props=r,s.state=u,s.context=l,r=a):("function"===typeof s.componentDidMount&&(e.flags|=4194308),r=!1)}else{s=e.stateNode,Mo(t,e),a=e.memoizedProps,l=e.type===e.elementType?a:vo(e.type,a),s.props=l,h=e.pendingProps,p=s.context,"object"===typeof(u=n.contextType)&&null!==u?u=Io(u):u=Ni(e,u=Li(n)?Ti:Pi.current);var f=n.getDerivedStateFromProps;(c="function"===typeof f||"function"===typeof s.getSnapshotBeforeUpdate)||"function"!==typeof s.UNSAFE_componentWillReceiveProps&&"function"!==typeof s.componentWillReceiveProps||(a!==h||p!==u)&&Yo(e,s,r,u),No=!1,p=e.memoizedState,s.state=p,jo(e,r,s,i);var d=e.memoizedState;a!==h||p!==d||Ri.current||No?("function"===typeof f&&(Bo(e,n,f,r),d=e.memoizedState),(l=No||Vo(e,n,l,r,p,d,u)||!1)?(c||"function"!==typeof s.UNSAFE_componentWillUpdate&&"function"!==typeof s.componentWillUpdate||("function"===typeof s.componentWillUpdate&&s.componentWillUpdate(r,d,u),"function"===typeof s.UNSAFE_componentWillUpdate&&s.UNSAFE_componentWillUpdate(r,d,u)),"function"===typeof s.componentDidUpdate&&(e.flags|=4),"function"===typeof s.getSnapshotBeforeUpdate&&(e.flags|=1024)):("function"!==typeof s.componentDidUpdate||a===t.memoizedProps&&p===t.memoizedState||(e.flags|=4),"function"!==typeof s.getSnapshotBeforeUpdate||a===t.memoizedProps&&p===t.memoizedState||(e.flags|=1024),e.memoizedProps=r,e.memoizedState=d),s.props=r,s.state=d,s.context=u,r=l):("function"!==typeof s.componentDidUpdate||a===t.memoizedProps&&p===t.memoizedState||(e.flags|=4),"function"!==typeof s.getSnapshotBeforeUpdate||a===t.memoizedProps&&p===t.memoizedState||(e.flags|=1024),r=!1)}return Ra(t,e,n,r,o,i)}function Ra(t,e,n,r,i,o){Ia(t,e);var s=0!==(128&e.flags);if(!r&&!s)return i&&Fi(e,n,!1),Ya(t,e,o);r=e.stateNode,ma.current=e;var a=s&&"function"!==typeof n.getDerivedStateFromError?null:r.render();return e.flags|=1,null!==t&&s?(e.child=$o(e,t.child,null,o),e.child=$o(e,null,a,o)):ba(t,e,a,o),e.memoizedState=r.state,i&&Fi(e,n,!0),e.child}function Ta(t){var e=t.stateNode;e.pendingContext?Ai(0,e.pendingContext,e.pendingContext!==e.context):e.context&&Ai(0,e.context,!1),is(t,e.containerInfo)}function Na(t,e,n,r,i){return fo(),go(i),e.flags|=256,ba(t,e,n,r),e.child}var La,Ma,Aa,ka,Da={dehydrated:null,treeContext:null,retryLane:0};function Fa(t){return{baseLanes:t,cachePool:null,transitions:null}}function ja(t,e,n){var r,i=e.pendingProps,s=us.current,a=!1,u=0!==(128&e.flags);if((r=u)||(r=(null===t||null!==t.memoizedState)&&0!==(2&s)),r?(a=!0,e.flags&=-129):null!==t&&null===t.memoizedState||(s|=1),Ii(us,1&s),null===t)return lo(e),null!==(t=e.memoizedState)&&null!==(t=t.dehydrated)?(0===(1&e.mode)?e.lanes=1:"$!"===t.data?e.lanes=8:e.lanes=1073741824,null):(u=i.children,t=i.fallback,a?(i=e.mode,a=e.child,u={mode:"hidden",children:u},0===(1&i)&&null!==a?(a.childLanes=0,a.pendingProps=u):a=Fl(u,i,0,null),t=Dl(t,i,n,null),a.return=e,t.return=e,a.sibling=t,e.child=a,e.child.memoizedState=Fa(n),e.memoizedState=Da,t):za(e,u));if(null!==(s=t.memoizedState)&&null!==(r=s.dehydrated))return function(t,e,n,r,i,s,a){if(n)return 256&e.flags?(e.flags&=-257,Ga(t,e,a,r=ha(Error(o(422))))):null!==e.memoizedState?(e.child=t.child,e.flags|=128,null):(s=r.fallback,i=e.mode,r=Fl({mode:"visible",children:r.children},i,0,null),(s=Dl(s,i,a,null)).flags|=2,r.return=e,s.return=e,r.sibling=s,e.child=r,0!==(1&e.mode)&&$o(e,t.child,null,a),e.child.memoizedState=Fa(a),e.memoizedState=Da,s);if(0===(1&e.mode))return Ga(t,e,a,null);if("$!"===i.data){if(r=i.nextSibling&&i.nextSibling.dataset)var u=r.dgst;return r=u,Ga(t,e,a,r=ha(s=Error(o(419)),r,void 0))}if(u=0!==(a&t.childLanes),xa||u){if(null!==(r=Tu)){switch(a&-a){case 4:i=2;break;case 16:i=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:i=32;break;case 536870912:i=268435456;break;default:i=0}0!==(i=0!==(i&(r.suspendedLanes|a))?0:i)&&i!==s.retryLane&&(s.retryLane=i,To(t,i),rl(r,t,i,-1))}return yl(),Ga(t,e,a,r=ha(Error(o(421))))}return"$?"===i.data?(e.flags|=128,e.child=t.child,e=Pl.bind(null,t),i._reactRetry=e,null):(t=s.treeContext,ro=li(i.nextSibling),no=e,io=!0,oo=null,null!==t&&(Wi[Hi++]=Zi,Wi[Hi++]=$i,Wi[Hi++]=Ki,Zi=t.id,$i=t.overflow,Ki=e),e=za(e,r.children),e.flags|=4096,e)}(t,e,u,i,r,s,n);if(a){a=i.fallback,u=e.mode,r=(s=t.child).sibling;var l={mode:"hidden",children:i.children};return 0===(1&u)&&e.child!==s?((i=e.child).childLanes=0,i.pendingProps=l,e.deletions=null):(i=Al(s,l)).subtreeFlags=14680064&s.subtreeFlags,null!==r?a=Al(r,a):(a=Dl(a,u,n,null)).flags|=2,a.return=e,i.return=e,i.sibling=a,e.child=i,i=a,a=e.child,u=null===(u=t.child.memoizedState)?Fa(n):{baseLanes:u.baseLanes|n,cachePool:null,transitions:u.transitions},a.memoizedState=u,a.childLanes=t.childLanes&~n,e.memoizedState=Da,i}return t=(a=t.child).sibling,i=Al(a,{mode:"visible",children:i.children}),0===(1&e.mode)&&(i.lanes=n),i.return=e,i.sibling=null,null!==t&&(null===(n=e.deletions)?(e.deletions=[t],e.flags|=16):n.push(t)),e.child=i,e.memoizedState=null,i}function za(t,e){return(e=Fl({mode:"visible",children:e},t.mode,0,null)).return=t,t.child=e}function Ga(t,e,n,r){return null!==r&&go(r),$o(e,t.child,null,n),(t=za(e,e.pendingProps.children)).flags|=2,e.memoizedState=null,t}function Ba(t,e,n){t.lanes|=e;var r=t.alternate;null!==r&&(r.lanes|=e),So(t.return,e,n)}function Ua(t,e,n,r,i){var o=t.memoizedState;null===o?t.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(o.isBackwards=e,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i)}function Va(t,e,n){var r=e.pendingProps,i=r.revealOrder,o=r.tail;if(ba(t,e,r.children,n),0!==(2&(r=us.current)))r=1&r|2,e.flags|=128;else{if(null!==t&&0!==(128&t.flags))t:for(t=e.child;null!==t;){if(13===t.tag)null!==t.memoizedState&&Ba(t,n,e);else if(19===t.tag)Ba(t,n,e);else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break t;for(;null===t.sibling;){if(null===t.return||t.return===e)break t;t=t.return}t.sibling.return=t.return,t=t.sibling}r&=1}if(Ii(us,r),0===(1&e.mode))e.memoizedState=null;else switch(i){case"forwards":for(n=e.child,i=null;null!==n;)null!==(t=n.alternate)&&null===ls(t)&&(i=n),n=n.sibling;null===(n=i)?(i=e.child,e.child=null):(i=n.sibling,n.sibling=null),Ua(e,!1,i,n,o);break;case"backwards":for(n=null,i=e.child,e.child=null;null!==i;){if(null!==(t=i.alternate)&&null===ls(t)){e.child=i;break}t=i.sibling,i.sibling=n,n=i,i=t}Ua(e,!0,n,null,o);break;case"together":Ua(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function Xa(t,e){0===(1&e.mode)&&null!==t&&(t.alternate=null,e.alternate=null,e.flags|=2)}function Ya(t,e,n){if(null!==t&&(e.dependencies=t.dependencies),Fu|=e.lanes,0===(n&e.childLanes))return null;if(null!==t&&e.child!==t.child)throw Error(o(153));if(null!==e.child){for(n=Al(t=e.child,t.pendingProps),e.child=n,n.return=e;null!==t.sibling;)t=t.sibling,(n=n.sibling=Al(t,t.pendingProps)).return=e;n.sibling=null}return e.child}function qa(t,e){if(!io)switch(t.tailMode){case"hidden":e=t.tail;for(var n=null;null!==e;)null!==e.alternate&&(n=e),e=e.sibling;null===n?t.tail=null:n.sibling=null;break;case"collapsed":n=t.tail;for(var r=null;null!==n;)null!==n.alternate&&(r=n),n=n.sibling;null===r?e||null===t.tail?t.tail=null:t.tail.sibling=null:r.sibling=null}}function Wa(t){var e=null!==t.alternate&&t.alternate.child===t.child,n=0,r=0;if(e)for(var i=t.child;null!==i;)n|=i.lanes|i.childLanes,r|=14680064&i.subtreeFlags,r|=14680064&i.flags,i.return=t,i=i.sibling;else for(i=t.child;null!==i;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=t,i=i.sibling;return t.subtreeFlags|=r,t.childLanes=n,e}function Ha(t,e,n){var r=e.pendingProps;switch(eo(e),e.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Wa(e),null;case 1:case 17:return Li(e.type)&&Mi(),Wa(e),null;case 3:return r=e.stateNode,os(),Ci(Ri),Ci(Pi),hs(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),null!==t&&null!==t.child||(ho(e)?e.flags|=4:null===t||t.memoizedState.isDehydrated&&0===(256&e.flags)||(e.flags|=1024,null!==oo&&(al(oo),oo=null))),Ma(t,e),Wa(e),null;case 5:as(e);var i=rs(ns.current);if(n=e.type,null!==t&&null!=e.stateNode)Aa(t,e,n,r,i),t.ref!==e.ref&&(e.flags|=512,e.flags|=2097152);else{if(!r){if(null===e.stateNode)throw Error(o(166));return Wa(e),null}if(t=rs(ts.current),ho(e)){r=e.stateNode,n=e.type;var s=e.memoizedProps;switch(r[pi]=e,r[fi]=s,t=0!==(1&e.mode),n){case"dialog":zr("cancel",r),zr("close",r);break;case"iframe":case"object":case"embed":zr("load",r);break;case"video":case"audio":for(i=0;i<\/script>",t=t.removeChild(t.firstChild)):"string"===typeof r.is?t=u.createElement(n,{is:r.is}):(t=u.createElement(n),"select"===n&&(u=t,r.multiple?u.multiple=!0:r.size&&(u.size=r.size))):t=u.createElementNS(t,n),t[pi]=e,t[fi]=r,La(t,e,!1,!1),e.stateNode=t;t:{switch(u=mt(n,r),n){case"dialog":zr("cancel",t),zr("close",t),i=r;break;case"iframe":case"object":case"embed":zr("load",t),i=r;break;case"video":case"audio":for(i=0;iVu&&(e.flags|=128,r=!0,qa(s,!1),e.lanes=4194304)}else{if(!r)if(null!==(t=ls(u))){if(e.flags|=128,r=!0,null!==(n=t.updateQueue)&&(e.updateQueue=n,e.flags|=4),qa(s,!0),null===s.tail&&"hidden"===s.tailMode&&!u.alternate&&!io)return Wa(e),null}else 2*$t()-s.renderingStartTime>Vu&&1073741824!==n&&(e.flags|=128,r=!0,qa(s,!1),e.lanes=4194304);s.isBackwards?(u.sibling=e.child,e.child=u):(null!==(n=s.last)?n.sibling=u:e.child=u,s.last=u)}return null!==s.tail?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=$t(),e.sibling=null,n=us.current,Ii(us,r?1&n|2:1&n),e):(Wa(e),null);case 22:case 23:return pl(),r=null!==e.memoizedState,null!==t&&null!==t.memoizedState!==r&&(e.flags|=8192),r&&0!==(1&e.mode)?0!==(1073741824&Mu)&&(Wa(e),6&e.subtreeFlags&&(e.flags|=8192)):Wa(e),null;case 24:case 25:return null}throw Error(o(156,e.tag))}function Ka(t,e){switch(eo(e),e.tag){case 1:return Li(e.type)&&Mi(),65536&(t=e.flags)?(e.flags=-65537&t|128,e):null;case 3:return os(),Ci(Ri),Ci(Pi),hs(),0!==(65536&(t=e.flags))&&0===(128&t)?(e.flags=-65537&t|128,e):null;case 5:return as(e),null;case 13:if(Ci(us),null!==(t=e.memoizedState)&&null!==t.dehydrated){if(null===e.alternate)throw Error(o(340));fo()}return 65536&(t=e.flags)?(e.flags=-65537&t|128,e):null;case 19:return Ci(us),null;case 4:return os(),null;case 10:return wo(e.type._context),null;case 22:case 23:return pl(),null;default:return null}}La=function(t,e){for(var n=e.child;null!==n;){if(5===n.tag||6===n.tag)t.appendChild(n.stateNode);else if(4!==n.tag&&null!==n.child){n.child.return=n,n=n.child;continue}if(n===e)break;for(;null===n.sibling;){if(null===n.return||n.return===e)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},Ma=function(){},Aa=function(t,e,n,r){var i=t.memoizedProps;if(i!==r){t=e.stateNode,rs(ts.current);var o,s=null;switch(n){case"input":i=K(t,i),r=K(t,r),s=[];break;case"select":i=F({},i,{value:void 0}),r=F({},r,{value:void 0}),s=[];break;case"textarea":i=rt(t,i),r=rt(t,r),s=[];break;default:"function"!==typeof i.onClick&&"function"===typeof r.onClick&&(t.onclick=Qr)}for(c in _t(n,r),n=null,i)if(!r.hasOwnProperty(c)&&i.hasOwnProperty(c)&&null!=i[c])if("style"===c){var u=i[c];for(o in u)u.hasOwnProperty(o)&&(n||(n={}),n[o]="")}else"dangerouslySetInnerHTML"!==c&&"children"!==c&&"suppressContentEditableWarning"!==c&&"suppressHydrationWarning"!==c&&"autoFocus"!==c&&(a.hasOwnProperty(c)?s||(s=[]):(s=s||[]).push(c,null));for(c in r){var l=r[c];if(u=null!=i?i[c]:void 0,r.hasOwnProperty(c)&&l!==u&&(null!=l||null!=u))if("style"===c)if(u){for(o in u)!u.hasOwnProperty(o)||l&&l.hasOwnProperty(o)||(n||(n={}),n[o]="");for(o in l)l.hasOwnProperty(o)&&u[o]!==l[o]&&(n||(n={}),n[o]=l[o])}else n||(s||(s=[]),s.push(c,n)),n=l;else"dangerouslySetInnerHTML"===c?(l=l?l.__html:void 0,u=u?u.__html:void 0,null!=l&&u!==l&&(s=s||[]).push(c,l)):"children"===c?"string"!==typeof l&&"number"!==typeof l||(s=s||[]).push(c,""+l):"suppressContentEditableWarning"!==c&&"suppressHydrationWarning"!==c&&(a.hasOwnProperty(c)?(null!=l&&"onScroll"===c&&zr("scroll",t),s||u===l||(s=[])):(s=s||[]).push(c,l))}n&&(s=s||[]).push("style",n);var c=s;(e.updateQueue=c)&&(e.flags|=4)}},ka=function(t,e,n,r){n!==r&&(e.flags|=4)};var Za=!1,$a=!1,Ja="function"===typeof WeakSet?WeakSet:Set,Qa=null;function tu(t,e){var n=t.ref;if(null!==n)if("function"===typeof n)try{n(null)}catch(r){Cl(t,e,r)}else n.current=null}function eu(t,e,n){try{n()}catch(r){Cl(t,e,r)}}var nu=!1;function ru(t,e,n){var r=e.updateQueue;if(null!==(r=null!==r?r.lastEffect:null)){var i=r=r.next;do{if((i.tag&t)===t){var o=i.destroy;i.destroy=void 0,void 0!==o&&eu(e,n,o)}i=i.next}while(i!==r)}}function iu(t,e){if(null!==(e=null!==(e=e.updateQueue)?e.lastEffect:null)){var n=e=e.next;do{if((n.tag&t)===t){var r=n.create;n.destroy=r()}n=n.next}while(n!==e)}}function ou(t){var e=t.ref;if(null!==e){var n=t.stateNode;t.tag,t=n,"function"===typeof e?e(t):e.current=t}}function su(t){var e=t.alternate;null!==e&&(t.alternate=null,su(e)),t.child=null,t.deletions=null,t.sibling=null,5===t.tag&&(null!==(e=t.stateNode)&&(delete e[pi],delete e[fi],delete e[gi],delete e[yi],delete e[vi])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function au(t){return 5===t.tag||3===t.tag||4===t.tag}function uu(t){t:for(;;){for(;null===t.sibling;){if(null===t.return||au(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;5!==t.tag&&6!==t.tag&&18!==t.tag;){if(2&t.flags)continue t;if(null===t.child||4===t.tag)continue t;t.child.return=t,t=t.child}if(!(2&t.flags))return t.stateNode}}function lu(t,e,n){var r=t.tag;if(5===r||6===r)t=t.stateNode,e?8===n.nodeType?n.parentNode.insertBefore(t,e):n.insertBefore(t,e):(8===n.nodeType?(e=n.parentNode).insertBefore(t,n):(e=n).appendChild(t),null!==(n=n._reactRootContainer)&&void 0!==n||null!==e.onclick||(e.onclick=Qr));else if(4!==r&&null!==(t=t.child))for(lu(t,e,n),t=t.sibling;null!==t;)lu(t,e,n),t=t.sibling}function cu(t,e,n){var r=t.tag;if(5===r||6===r)t=t.stateNode,e?n.insertBefore(t,e):n.appendChild(t);else if(4!==r&&null!==(t=t.child))for(cu(t,e,n),t=t.sibling;null!==t;)cu(t,e,n),t=t.sibling}var hu=null,pu=!1;function fu(t,e,n){for(n=n.child;null!==n;)du(t,e,n),n=n.sibling}function du(t,e,n){if(oe&&"function"===typeof oe.onCommitFiberUnmount)try{oe.onCommitFiberUnmount(ie,n)}catch(a){}switch(n.tag){case 5:$a||tu(n,e);case 6:var r=hu,i=pu;hu=null,fu(t,e,n),pu=i,null!==(hu=r)&&(pu?(t=hu,n=n.stateNode,8===t.nodeType?t.parentNode.removeChild(n):t.removeChild(n)):hu.removeChild(n.stateNode));break;case 18:null!==hu&&(pu?(t=hu,n=n.stateNode,8===t.nodeType?ui(t.parentNode,n):1===t.nodeType&&ui(t,n),Ue(t)):ui(hu,n.stateNode));break;case 4:r=hu,i=pu,hu=n.stateNode.containerInfo,pu=!0,fu(t,e,n),hu=r,pu=i;break;case 0:case 11:case 14:case 15:if(!$a&&(null!==(r=n.updateQueue)&&null!==(r=r.lastEffect))){i=r=r.next;do{var o=i,s=o.destroy;o=o.tag,void 0!==s&&(0!==(2&o)||0!==(4&o))&&eu(n,e,s),i=i.next}while(i!==r)}fu(t,e,n);break;case 1:if(!$a&&(tu(n,e),"function"===typeof(r=n.stateNode).componentWillUnmount))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){Cl(n,e,a)}fu(t,e,n);break;case 21:fu(t,e,n);break;case 22:1&n.mode?($a=(r=$a)||null!==n.memoizedState,fu(t,e,n),$a=r):fu(t,e,n);break;default:fu(t,e,n)}}function gu(t){var e=t.updateQueue;if(null!==e){t.updateQueue=null;var n=t.stateNode;null===n&&(n=t.stateNode=new Ja),e.forEach((function(e){var r=Rl.bind(null,t,e);n.has(e)||(n.add(e),e.then(r,r))}))}}function yu(t,e){var n=e.deletions;if(null!==n)for(var r=0;ri&&(i=a),r&=~s}if(r=i,10<(r=(120>(r=$t()-r)?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Cu(r/1960))-r)){t.timeoutHandle=ri(El.bind(null,t,Bu,Xu),r);break}El(t,Bu,Xu);break;default:throw Error(o(329))}}}return il(t,$t()),t.callbackNode===n?ol.bind(null,t):null}function sl(t,e){var n=Gu;return t.current.memoizedState.isDehydrated&&(fl(t,e).flags|=256),2!==(t=vl(t,e))&&(e=Bu,Bu=n,null!==e&&al(e)),t}function al(t){null===Bu?Bu=t:Bu.push.apply(Bu,t)}function ul(t,e){for(e&=~zu,e&=~ju,t.suspendedLanes|=e,t.pingedLanes&=~e,t=t.expirationTimes;0t?16:t,null===Ku)var r=!1;else{if(t=Ku,Ku=null,Zu=0,0!==(6&Ru))throw Error(o(331));var i=Ru;for(Ru|=4,Qa=t.current;null!==Qa;){var s=Qa,a=s.child;if(0!==(16&Qa.flags)){var u=s.deletions;if(null!==u){for(var l=0;l$t()-Uu?fl(t,0):zu|=n),il(t,e)}function Ol(t,e){0===e&&(0===(1&t.mode)?e=1:(e=ce,0===(130023424&(ce<<=1))&&(ce=4194304)));var n=el();null!==(t=To(t,e))&&(ve(t,e,n),il(t,n))}function Pl(t){var e=t.memoizedState,n=0;null!==e&&(n=e.retryLane),Ol(t,n)}function Rl(t,e){var n=0;switch(t.tag){case 13:var r=t.stateNode,i=t.memoizedState;null!==i&&(n=i.retryLane);break;case 19:r=t.stateNode;break;default:throw Error(o(314))}null!==r&&r.delete(e),Ol(t,n)}function Tl(t,e){return Wt(t,e)}function Nl(t,e,n,r){this.tag=t,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ll(t,e,n,r){return new Nl(t,e,n,r)}function Ml(t){return!(!(t=t.prototype)||!t.isReactComponent)}function Al(t,e){var n=t.alternate;return null===n?((n=Ll(t.tag,e,t.key,t.mode)).elementType=t.elementType,n.type=t.type,n.stateNode=t.stateNode,n.alternate=t,t.alternate=n):(n.pendingProps=e,n.type=t.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=14680064&t.flags,n.childLanes=t.childLanes,n.lanes=t.lanes,n.child=t.child,n.memoizedProps=t.memoizedProps,n.memoizedState=t.memoizedState,n.updateQueue=t.updateQueue,e=t.dependencies,n.dependencies=null===e?null:{lanes:e.lanes,firstContext:e.firstContext},n.sibling=t.sibling,n.index=t.index,n.ref=t.ref,n}function kl(t,e,n,r,i,s){var a=2;if(r=t,"function"===typeof t)Ml(t)&&(a=1);else if("string"===typeof t)a=5;else t:switch(t){case w:return Dl(n.children,i,s,e);case S:a=8,i|=8;break;case C:return(t=Ll(12,n,e,2|i)).elementType=C,t.lanes=s,t;case R:return(t=Ll(13,n,e,i)).elementType=R,t.lanes=s,t;case T:return(t=Ll(19,n,e,i)).elementType=T,t.lanes=s,t;case M:return Fl(n,i,s,e);default:if("object"===typeof t&&null!==t)switch(t.$$typeof){case I:a=10;break t;case O:a=9;break t;case P:a=11;break t;case N:a=14;break t;case L:a=16,r=null;break t}throw Error(o(130,null==t?t:typeof t,""))}return(e=Ll(a,n,e,i)).elementType=t,e.type=r,e.lanes=s,e}function Dl(t,e,n,r){return(t=Ll(7,t,r,e)).lanes=n,t}function Fl(t,e,n,r){return(t=Ll(22,t,r,e)).elementType=M,t.lanes=n,t.stateNode={isHidden:!1},t}function jl(t,e,n){return(t=Ll(6,t,null,e)).lanes=n,t}function zl(t,e,n){return(e=Ll(4,null!==t.children?t.children:[],t.key,e)).lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function Gl(t,e,n,r,i){this.tag=e,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=ye(0),this.expirationTimes=ye(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ye(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function Bl(t,e,n,r,i,o,s,a,u){return t=new Gl(t,e,n,a,u),1===e?(e=1,!0===o&&(e|=8)):e=0,o=Ll(3,null,null,e),t.current=o,o.stateNode=t,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Lo(o),t}function Ul(t){if(!t)return Oi;t:{if(Ut(t=t._reactInternals)!==t||1!==t.tag)throw Error(o(170));var e=t;do{switch(e.tag){case 3:e=e.stateNode.context;break t;case 1:if(Li(e.type)){e=e.stateNode.__reactInternalMemoizedMergedChildContext;break t}}e=e.return}while(null!==e);throw Error(o(171))}if(1===t.tag){var n=t.type;if(Li(n))return ki(t,n,e)}return e}function Vl(t,e,n,r,i,o,s,a,u){return(t=Bl(n,r,!0,t,0,o,0,a,u)).context=Ul(null),n=t.current,(o=Ao(r=el(),i=nl(n))).callback=void 0!==e&&null!==e?e:null,ko(n,o,i),t.current.lanes=i,ve(t,i,r),il(t,r),t}function Xl(t,e,n,r){var i=e.current,o=el(),s=nl(i);return n=Ul(n),null===e.context?e.context=n:e.pendingContext=n,(e=Ao(o,s)).payload={element:t},null!==(r=void 0===r?null:r)&&(e.callback=r),null!==(t=ko(i,e,s))&&(rl(t,i,s,o),Do(t,i,s)),s}function Yl(t){return(t=t.current).child?(t.child.tag,t.child.stateNode):null}function ql(t,e){if(null!==(t=t.memoizedState)&&null!==t.dehydrated){var n=t.retryLane;t.retryLane=0!==n&&n=0||(i[n]=t[n]);return i}function o(t,e){return o=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},o(t,e)}function s(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,o(t,e)}function a(t,e){return t.replace(new RegExp("(^|\\s)"+e+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}n.r(e),n.d(e,{CSSTransition:function(){return w},ReplaceTransition:function(){return M},SwitchTransition:function(){return G},Transition:function(){return x},TransitionGroup:function(){return R},config:function(){return c}});var u=n(2791),l=n(4164),c={disabled:!1},h=u.createContext(null),p=function(t){return t.scrollTop},f="unmounted",d="exited",g="entering",y="entered",v="exiting",_=function(t){function e(e,n){var r;r=t.call(this,e,n)||this;var i,o=n&&!n.isMounting?e.enter:e.appear;return r.appearStatus=null,e.in?o?(i=d,r.appearStatus=g):i=y:i=e.unmountOnExit||e.mountOnEnter?f:d,r.state={status:i},r.nextCallback=null,r}s(e,t),e.getDerivedStateFromProps=function(t,e){return t.in&&e.status===f?{status:d}:null};var n=e.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(t){var e=null;if(t!==this.props){var n=this.state.status;this.props.in?n!==g&&n!==y&&(e=g):n!==g&&n!==y||(e=v)}this.updateStatus(!1,e)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var t,e,n,r=this.props.timeout;return t=e=n=r,null!=r&&"number"!==typeof r&&(t=r.exit,e=r.enter,n=void 0!==r.appear?r.appear:e),{exit:t,enter:e,appear:n}},n.updateStatus=function(t,e){if(void 0===t&&(t=!1),null!==e)if(this.cancelNextCallback(),e===g){if(this.props.unmountOnExit||this.props.mountOnEnter){var n=this.props.nodeRef?this.props.nodeRef.current:l.findDOMNode(this);n&&p(n)}this.performEnter(t)}else this.performExit();else this.props.unmountOnExit&&this.state.status===d&&this.setState({status:f})},n.performEnter=function(t){var e=this,n=this.props.enter,r=this.context?this.context.isMounting:t,i=this.props.nodeRef?[r]:[l.findDOMNode(this),r],o=i[0],s=i[1],a=this.getTimeouts(),u=r?a.appear:a.enter;!t&&!n||c.disabled?this.safeSetState({status:y},(function(){e.props.onEntered(o)})):(this.props.onEnter(o,s),this.safeSetState({status:g},(function(){e.props.onEntering(o,s),e.onTransitionEnd(u,(function(){e.safeSetState({status:y},(function(){e.props.onEntered(o,s)}))}))})))},n.performExit=function(){var t=this,e=this.props.exit,n=this.getTimeouts(),r=this.props.nodeRef?void 0:l.findDOMNode(this);e&&!c.disabled?(this.props.onExit(r),this.safeSetState({status:v},(function(){t.props.onExiting(r),t.onTransitionEnd(n.exit,(function(){t.safeSetState({status:d},(function(){t.props.onExited(r)}))}))}))):this.safeSetState({status:d},(function(){t.props.onExited(r)}))},n.cancelNextCallback=function(){null!==this.nextCallback&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(t,e){e=this.setNextCallback(e),this.setState(t,e)},n.setNextCallback=function(t){var e=this,n=!0;return this.nextCallback=function(r){n&&(n=!1,e.nextCallback=null,t(r))},this.nextCallback.cancel=function(){n=!1},this.nextCallback},n.onTransitionEnd=function(t,e){this.setNextCallback(e);var n=this.props.nodeRef?this.props.nodeRef.current:l.findDOMNode(this),r=null==t&&!this.props.addEndListener;if(n&&!r){if(this.props.addEndListener){var i=this.props.nodeRef?[this.nextCallback]:[n,this.nextCallback],o=i[0],s=i[1];this.props.addEndListener(o,s)}null!=t&&setTimeout(this.nextCallback,t)}else setTimeout(this.nextCallback,0)},n.render=function(){var t=this.state.status;if(t===f)return null;var e=this.props,n=e.children,r=(e.in,e.mountOnEnter,e.unmountOnExit,e.appear,e.enter,e.exit,e.timeout,e.addEndListener,e.onEnter,e.onEntering,e.onEntered,e.onExit,e.onExiting,e.onExited,e.nodeRef,i(e,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]));return u.createElement(h.Provider,{value:null},"function"===typeof n?n(t,r):u.cloneElement(u.Children.only(n),r))},e}(u.Component);function m(){}_.contextType=h,_.propTypes={},_.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:m,onEntering:m,onEntered:m,onExit:m,onExiting:m,onExited:m},_.UNMOUNTED=f,_.EXITED=d,_.ENTERING=g,_.ENTERED=y,_.EXITING=v;var x=_,b=function(t,e){return t&&e&&e.split(" ").forEach((function(e){return r=e,void((n=t).classList?n.classList.remove(r):"string"===typeof n.className?n.className=a(n.className,r):n.setAttribute("class",a(n.className&&n.className.baseVal||"",r)));var n,r}))},E=function(t){function e(){for(var e,n=arguments.length,r=new Array(n),i=0;il==c>-l?(o=l,l=e[++h]):(o=c,c=r[++p]);var f=0;if(hl==c>-l?(a=o-((s=l+o)-l),l=e[++h]):(a=o-((s=c+o)-c),c=r[++p]),o=s,0!==a&&(i[f++]=a);hl==c>-l?(a=o-((s=o+l)-(u=s-o))+(l-u),l=e[++h]):(a=o-((s=o+c)-(u=s-o))+(c-u),c=r[++p]),o=s,0!==a&&(i[f++]=a);for(;h0!=_>0)return m;var x=Math.abs(v+_);return Math.abs(m)>=o*x?m:-function(t,i,o,f,d,g,y){var v,_,m,x,b,E,w,S,C,I,O,P,R,T,N,L,M,A,k=t-d,D=o-d,F=i-g,j=f-g;b=(N=(S=k-(w=(E=e*k)-(E-k)))*(I=j-(C=(E=e*j)-(E-j)))-((T=k*j)-w*C-S*C-w*I))-(O=N-(M=(S=F-(w=(E=e*F)-(E-F)))*(I=D-(C=(E=e*D)-(E-D)))-((L=F*D)-w*C-S*C-w*I))),u[0]=N-(O+b)+(b-M),b=(R=T-((P=T+O)-(b=P-T))+(O-b))-(O=R-L),u[1]=R-(O+b)+(b-L),b=(A=P+O)-P,u[2]=P-(A-b)+(O-b),u[3]=A;var z=function(t,e){for(var n=e[0],r=1;r=G||-z>=G)return z;if(v=t-(k+(b=t-k))+(b-d),m=o-(D+(b=o-D))+(b-d),_=i-(F+(b=i-F))+(b-g),x=f-(j+(b=f-j))+(b-g),0===v&&0===_&&0===m&&0===x)return z;if(G=a*y+n*Math.abs(z),(z+=k*x+j*v-(F*m+D*_))>=G||-z>=G)return z;b=(N=(S=v-(w=(E=e*v)-(E-v)))*(I=j-(C=(E=e*j)-(E-j)))-((T=v*j)-w*C-S*C-w*I))-(O=N-(M=(S=_-(w=(E=e*_)-(E-_)))*(I=D-(C=(E=e*D)-(E-D)))-((L=_*D)-w*C-S*C-w*I))),p[0]=N-(O+b)+(b-M),b=(R=T-((P=T+O)-(b=P-T))+(O-b))-(O=R-L),p[1]=R-(O+b)+(b-L),b=(A=P+O)-P,p[2]=P-(A-b)+(O-b),p[3]=A;var B=r(4,u,4,p,l);b=(N=(S=k-(w=(E=e*k)-(E-k)))*(I=x-(C=(E=e*x)-(E-x)))-((T=k*x)-w*C-S*C-w*I))-(O=N-(M=(S=F-(w=(E=e*F)-(E-F)))*(I=m-(C=(E=e*m)-(E-m)))-((L=F*m)-w*C-S*C-w*I))),p[0]=N-(O+b)+(b-M),b=(R=T-((P=T+O)-(b=P-T))+(O-b))-(O=R-L),p[1]=R-(O+b)+(b-L),b=(A=P+O)-P,p[2]=P-(A-b)+(O-b),p[3]=A;var U=r(B,l,4,p,c);b=(N=(S=v-(w=(E=e*v)-(E-v)))*(I=x-(C=(E=e*x)-(E-x)))-((T=v*x)-w*C-S*C-w*I))-(O=N-(M=(S=_-(w=(E=e*_)-(E-_)))*(I=m-(C=(E=e*m)-(E-m)))-((L=_*m)-w*C-S*C-w*I))),p[0]=N-(O+b)+(b-M),b=(R=T-((P=T+O)-(b=P-T))+(O-b))-(O=R-L),p[1]=R-(O+b)+(b-L),b=(A=P+O)-P,p[2]=P-(A-b)+(O-b),p[3]=A;var V=r(U,c,4,p,h);return h[V-1]}(t,i,f,d,g,y,x)},t.orient2dfast=function(t,e,n,r,i,o){return(e-o)*(n-i)-(t-i)*(r-o)},Object.defineProperty(t,"__esModule",{value:!0})}(e)},6813:function(t,e){"use strict";function n(t,e){var n=t.length;t.push(e);t:for(;0>>1,i=t[r];if(!(0>>1;ro(u,n))lo(c,u)?(t[r]=c,t[l]=n,r=l):(t[r]=u,t[a]=n,r=a);else{if(!(lo(c,n)))break t;t[r]=c,t[l]=n,r=l}}}return e}function o(t,e){var n=t.sortIndex-e.sortIndex;return 0!==n?n:t.id-e.id}if("object"===typeof performance&&"function"===typeof performance.now){var s=performance;e.unstable_now=function(){return s.now()}}else{var a=Date,u=a.now();e.unstable_now=function(){return a.now()-u}}var l=[],c=[],h=1,p=null,f=3,d=!1,g=!1,y=!1,v="function"===typeof setTimeout?setTimeout:null,_="function"===typeof clearTimeout?clearTimeout:null,m="undefined"!==typeof setImmediate?setImmediate:null;function x(t){for(var e=r(c);null!==e;){if(null===e.callback)i(c);else{if(!(e.startTime<=t))break;i(c),e.sortIndex=e.expirationTime,n(l,e)}e=r(c)}}function b(t){if(y=!1,x(t),!g)if(null!==r(l))g=!0,M(E);else{var e=r(c);null!==e&&A(b,e.startTime-t)}}function E(t,n){g=!1,y&&(y=!1,_(I),I=-1),d=!0;var o=f;try{for(x(n),p=r(l);null!==p&&(!(p.expirationTime>n)||t&&!R());){var s=p.callback;if("function"===typeof s){p.callback=null,f=p.priorityLevel;var a=s(p.expirationTime<=n);n=e.unstable_now(),"function"===typeof a?p.callback=a:p===r(l)&&i(l),x(n)}else i(l);p=r(l)}if(null!==p)var u=!0;else{var h=r(c);null!==h&&A(b,h.startTime-n),u=!1}return u}finally{p=null,f=o,d=!1}}"undefined"!==typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);var w,S=!1,C=null,I=-1,O=5,P=-1;function R(){return!(e.unstable_now()-Pt||125s?(t.sortIndex=o,n(c,t),null===r(l)&&t===r(c)&&(y?(_(I),I=-1):y=!0,A(b,o-s))):(t.sortIndex=a,n(l,t),g||d||(g=!0,M(E))),t},e.unstable_shouldYield=R,e.unstable_wrapCallback=function(t){var e=f;return function(){var n=f;f=e;try{return t.apply(this,arguments)}finally{f=n}}}},5296:function(t,e,n){"use strict";t.exports=n(6813)},1848:function(t){"use strict";t.exports={eudist:function(t,e,n){for(var r=t.length,i=0,o=0;o0;r.length0;){var a=t[Math.floor(Math.random()*o)],u=s?a.join("_"):""+a;n[u]||(n[u]=!0,r.push(a))}if(r.length0,u=t[Math.floor(Math.random()*s)];a&&u.join("_");for(r.push(u);r.length0,v=[];if(n)i="kmrand"==n?s(t,e):"kmpp"==n?a(t,e):n;else for(var _={};i.length0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s;if((0,r.Z)(this,t),this.data=e,this.length=this.data.length,this.compare=n,this.length>0)for(var i=(this.length>>1)-1;i>=0;i--)this._down(i)}return(0,i.Z)(t,[{key:"push",value:function(t){this.data.push(t),this.length++,this._up(this.length-1)}},{key:"pop",value:function(){if(0!==this.length){var t=this.data[0],e=this.data.pop();return this.length--,this.length>0&&(this.data[0]=e,this._down(0)),t}}},{key:"peek",value:function(){return this.data[0]}},{key:"_up",value:function(t){for(var e=this.data,n=this.compare,r=e[t];t>0;){var i=t-1>>1,o=e[i];if(n(r,o)>=0)break;e[t]=o,t=i}e[t]=r}},{key:"_down",value:function(t){for(var e=this.data,n=this.compare,r=this.length>>1,i=e[t];t=0)break;e[t]=s,t=o}e[t]=i}}]),t}();function s(t,e){return te?1:0}},4035:function(t,e){!function(t){"use strict";function e(){}function n(t){this.message=t||""}function r(t){this.message=t||""}function i(t){this.message=t||""}function o(){}function s(t){return null===t?At:t.color}function a(t){return null===t?null:t.parent}function u(t,e){null!==t&&(t.color=e)}function l(t){return null===t?null:t.left}function c(t){return null===t?null:t.right}function h(){this.root_=null,this.size_=0}function p(){}function f(){this.array_=[],arguments[0]instanceof xt&&this.addAll(arguments[0])}function d(){}function g(t){this.message=t||""}function y(){this.array_=[]}"fill"in Array.prototype||Object.defineProperty(Array.prototype,"fill",{configurable:!0,value:function(t){if(void 0===this||null===this)throw new TypeError(this+" is not an object");var e=Object(this),n=Math.max(Math.min(e.length,9007199254740991),0)||0,r=1 in arguments&&parseInt(Number(arguments[1]),10)||0;r=r<0?Math.max(n+r,0):Math.min(r,n);var i=2 in arguments&&void 0!==arguments[2]?parseInt(Number(arguments[2]),10)||0:n;for(i=i<0?Math.max(n+arguments[2],0):Math.min(i,n);re.x?1:this.ye.y?1:0},S.prototype.clone=function(){},S.prototype.copy=function(){return new S(this)},S.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},S.prototype.distance3D=function(t){var e=this.x-t.x,n=this.y-t.y,r=this.z-t.z;return Math.sqrt(e*e+n*n+r*r)},S.prototype.distance=function(t){var e=this.x-t.x,n=this.y-t.y;return Math.sqrt(e*e+n*n)},S.prototype.hashCode=function(){var t=17;return 37*(t=37*t+S.hashCode(this.x))+S.hashCode(this.y)},S.prototype.setCoordinate=function(t){this.x=t.x,this.y=t.y,this.z=t.z},S.prototype.interfaces_=function(){return[b,E,e]},S.prototype.getClass=function(){return S},S.hashCode=function(){if(1===arguments.length){var t=arguments[0],e=m.doubleToLongBits(t);return Math.trunc((e^e)>>>32)}},C.DimensionalComparator.get=function(){return I},C.serialVersionUID.get=function(){return 0x5cbf2c235c7e5800},C.NULL_ORDINATE.get=function(){return m.NaN},C.X.get=function(){return 0},C.Y.get=function(){return 1},C.Z.get=function(){return 2},Object.defineProperties(S,C);var I=function(t){if(this._dimensionsToTest=2,0===arguments.length);else if(1===arguments.length){var e=arguments[0];if(2!==e&&3!==e)throw new _("only 2 or 3 dimensions may be specified");this._dimensionsToTest=e}};I.prototype.compare=function(t,e){var n=t,r=e,i=I.compare(n.x,r.x);if(0!==i)return i;var o=I.compare(n.y,r.y);return 0!==o?o:this._dimensionsToTest<=2?0:I.compare(n.z,r.z)},I.prototype.interfaces_=function(){return[w]},I.prototype.getClass=function(){return I},I.compare=function(t,e){return te?1:m.isNaN(t)?m.isNaN(e)?0:-1:m.isNaN(e)?1:0};var O=function(){};O.prototype.create=function(){},O.prototype.interfaces_=function(){return[]},O.prototype.getClass=function(){return O};var P=function(){},R={INTERIOR:{configurable:!0},BOUNDARY:{configurable:!0},EXTERIOR:{configurable:!0},NONE:{configurable:!0}};P.prototype.interfaces_=function(){return[]},P.prototype.getClass=function(){return P},P.toLocationSymbol=function(t){switch(t){case P.EXTERIOR:return"e";case P.BOUNDARY:return"b";case P.INTERIOR:return"i";case P.NONE:return"-"}throw new _("Unknown location value: "+t)},R.INTERIOR.get=function(){return 0},R.BOUNDARY.get=function(){return 1},R.EXTERIOR.get=function(){return 2},R.NONE.get=function(){return-1},Object.defineProperties(P,R);var T=function(t,e){return t.interfaces_&&t.interfaces_().indexOf(e)>-1},N=function(){},L={LOG_10:{configurable:!0}};N.prototype.interfaces_=function(){return[]},N.prototype.getClass=function(){return N},N.log10=function(t){var e=Math.log(t);return m.isInfinite(e)||m.isNaN(e)?e:e/N.LOG_10},N.min=function(t,e,n,r){var i=t;return en?n:t}if(Number.isInteger(arguments[2])&&Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var r=arguments[0],i=arguments[1],o=arguments[2];return ro?o:r}},N.wrap=function(t,e){return t<0?e- -t%e:t%e},N.max=function(){if(3===arguments.length){var t=arguments[1],e=arguments[2],n=arguments[0];return t>n&&(n=t),e>n&&(n=e),n}if(4===arguments.length){var r=arguments[1],i=arguments[2],o=arguments[3],s=arguments[0];return r>s&&(s=r),i>s&&(s=i),o>s&&(s=o),s}},N.average=function(t,e){return(t+e)/2},L.LOG_10.get=function(){return Math.log(10)},Object.defineProperties(N,L);var M=function(t){this.str=t};M.prototype.append=function(t){this.str+=t},M.prototype.setCharAt=function(t,e){this.str=this.str.substr(0,t)+e+this.str.substr(t+1)},M.prototype.toString=function(t){return this.str};var A=function(t){this.value=t};A.prototype.intValue=function(){return this.value},A.prototype.compareTo=function(t){return this.valuet?1:0},A.isNaN=function(t){return Number.isNaN(t)};var k=function(){};k.isWhitespace=function(t){return t<=32&&t>=0||127===t},k.toUpperCase=function(t){return t.toUpperCase()};var D=function t(){if(this._hi=0,this._lo=0,0===arguments.length)this.init(0);else if(1===arguments.length)if("number"==typeof arguments[0]){var e=arguments[0];this.init(e)}else if(arguments[0]instanceof t){var n=arguments[0];this.init(n)}else"string"==typeof arguments[0]&&t.call(this,t.parse(arguments[0]));else if(2===arguments.length){var r=arguments[0],i=arguments[1];this.init(r,i)}},F={PI:{configurable:!0},TWO_PI:{configurable:!0},PI_2:{configurable:!0},E:{configurable:!0},NaN:{configurable:!0},EPS:{configurable:!0},SPLIT:{configurable:!0},MAX_PRINT_DIGITS:{configurable:!0},TEN:{configurable:!0},ONE:{configurable:!0},SCI_NOT_EXPONENT_CHAR:{configurable:!0},SCI_NOT_ZERO:{configurable:!0}};D.prototype.le=function(t){return(this._hi9?(c=!0,h="9"):h="0"+l,s.append(h),n=n.subtract(D.valueOf(l)).multiply(D.TEN),c&&n.selfAdd(D.TEN);var p=!0,f=D.magnitude(n._hi);if(f<0&&Math.abs(f)>=a-u&&(p=!1),!p)break}return e[0]=r,s.toString()},D.prototype.sqr=function(){return this.multiply(this)},D.prototype.doubleValue=function(){return this._hi+this._lo},D.prototype.subtract=function(){if(arguments[0]instanceof D){var t=arguments[0];return this.add(t.negate())}if("number"==typeof arguments[0]){var e=arguments[0];return this.add(-e)}},D.prototype.equals=function(){if(1===arguments.length){var t=arguments[0];return this._hi===t._hi&&this._lo===t._lo}},D.prototype.isZero=function(){return 0===this._hi&&0===this._lo},D.prototype.selfSubtract=function(){if(arguments[0]instanceof D){var t=arguments[0];return this.isNaN()?this:this.selfAdd(-t._hi,-t._lo)}if("number"==typeof arguments[0]){var e=arguments[0];return this.isNaN()?this:this.selfAdd(-e,0)}},D.prototype.getSpecialNumberString=function(){return this.isZero()?"0.0":this.isNaN()?"NaN ":null},D.prototype.min=function(t){return this.le(t)?this:t},D.prototype.selfDivide=function(){if(1===arguments.length){if(arguments[0]instanceof D){var t=arguments[0];return this.selfDivide(t._hi,t._lo)}if("number"==typeof arguments[0]){var e=arguments[0];return this.selfDivide(e,0)}}else if(2===arguments.length){var n=arguments[0],r=arguments[1],i=null,o=null,s=null,a=null,u=null,l=null,c=null,h=null;return u=this._hi/n,h=(i=(l=D.SPLIT*u)-(i=l-u))*(s=(h=D.SPLIT*n)-(s=h-n))-(c=u*n)+i*(a=n-s)+(o=u-i)*s+o*a,h=u+(l=(this._hi-c-h+this._lo-u*r)/n),this._hi=h,this._lo=u-h+l,this}},D.prototype.dump=function(){return"DD<"+this._hi+", "+this._lo+">"},D.prototype.divide=function(){if(arguments[0]instanceof D){var t=arguments[0],e=null,n=null,r=null,i=null,o=null,s=null,a=null,u=null;return n=(o=this._hi/t._hi)-(e=(s=D.SPLIT*o)-(e=s-o)),u=e*(r=(u=D.SPLIT*t._hi)-(r=u-t._hi))-(a=o*t._hi)+e*(i=t._hi-r)+n*r+n*i,s=(this._hi-a-u+this._lo-o*t._lo)/t._hi,new D(u=o+s,o-u+s)}if("number"==typeof arguments[0]){var l=arguments[0];return m.isNaN(l)?D.createNaN():D.copy(this).selfDivide(l,0)}},D.prototype.ge=function(t){return(this._hi>t._hi||this._hi===t._hi)&&this._lo>=t._lo},D.prototype.pow=function(t){if(0===t)return D.valueOf(1);var e=new D(this),n=D.valueOf(1),r=Math.abs(t);if(r>1)for(;r>0;)r%2==1&&n.selfMultiply(e),(r/=2)>0&&(e=e.sqr());else n=e;return t<0?n.reciprocal():n},D.prototype.ceil=function(){if(this.isNaN())return D.NaN;var t=Math.ceil(this._hi),e=0;return t===this._hi&&(e=Math.ceil(this._lo)),new D(t,e)},D.prototype.compareTo=function(t){var e=t;return this._hie._hi?1:this._loe._lo?1:0},D.prototype.rint=function(){return this.isNaN()?this:this.add(.5).floor()},D.prototype.setValue=function(){if(arguments[0]instanceof D){var t=arguments[0];return this.init(t),this}if("number"==typeof arguments[0]){var e=arguments[0];return this.init(e),this}},D.prototype.max=function(t){return this.ge(t)?this:t},D.prototype.sqrt=function(){if(this.isZero())return D.valueOf(0);if(this.isNegative())return D.NaN;var t=1/Math.sqrt(this._hi),e=this._hi*t,n=D.valueOf(e),r=this.subtract(n.sqr())._hi*(.5*t);return n.add(r)},D.prototype.selfAdd=function(){if(1===arguments.length){if(arguments[0]instanceof D){var t=arguments[0];return this.selfAdd(t._hi,t._lo)}if("number"==typeof arguments[0]){var e=arguments[0],n=null,r=null,i=null,o=null,s=null,a=null;return o=(i=this._hi+e)-(s=i-this._hi),r=(a=(o=e-s+(this._hi-o))+this._lo)+(i-(n=i+a)),this._hi=n+r,this._lo=r+(n-this._hi),this}}else if(2===arguments.length){var u=arguments[0],l=arguments[1],c=null,h=null,p=null,f=null,d=null,g=null,y=null;f=this._hi+u,h=this._lo+l,d=f-(g=f-this._hi),p=h-(y=h-this._lo);var v=(c=f+(g=(d=u-g+(this._hi-d))+h))+(g=(p=l-y+(this._lo-p))+(g+(f-c))),_=g+(c-v);return this._hi=v,this._lo=_,this}},D.prototype.selfMultiply=function(){if(1===arguments.length){if(arguments[0]instanceof D){var t=arguments[0];return this.selfMultiply(t._hi,t._lo)}if("number"==typeof arguments[0]){var e=arguments[0];return this.selfMultiply(e,0)}}else if(2===arguments.length){var n=arguments[0],r=arguments[1],i=null,o=null,s=null,a=null,u=null,l=null;i=(u=D.SPLIT*this._hi)-this._hi,l=D.SPLIT*n,i=u-i,o=this._hi-i,s=l-n;var c=(u=this._hi*n)+(l=i*(s=l-s)-u+i*(a=n-s)+o*s+o*a+(this._hi*r+this._lo*n)),h=l+(i=u-c);return this._hi=c,this._lo=h,this}},D.prototype.selfSqr=function(){return this.selfMultiply(this)},D.prototype.floor=function(){if(this.isNaN())return D.NaN;var t=Math.floor(this._hi),e=0;return t===this._hi&&(e=Math.floor(this._lo)),new D(t,e)},D.prototype.negate=function(){return this.isNaN()?this:new D(-this._hi,-this._lo)},D.prototype.clone=function(){},D.prototype.multiply=function(){if(arguments[0]instanceof D){var t=arguments[0];return t.isNaN()?D.createNaN():D.copy(this).selfMultiply(t)}if("number"==typeof arguments[0]){var e=arguments[0];return m.isNaN(e)?D.createNaN():D.copy(this).selfMultiply(e,0)}},D.prototype.isNaN=function(){return m.isNaN(this._hi)},D.prototype.intValue=function(){return Math.trunc(this._hi)},D.prototype.toString=function(){var t=D.magnitude(this._hi);return t>=-3&&t<=20?this.toStandardNotation():this.toSciNotation()},D.prototype.toStandardNotation=function(){var t=this.getSpecialNumberString();if(null!==t)return t;var e=new Array(1).fill(null),n=this.extractSignificantDigits(!0,e),r=e[0]+1,i=n;if("."===n.charAt(0))i="0"+n;else if(r<0)i="0."+D.stringOfChar("0",-r)+n;else if(-1===n.indexOf(".")){var o=r-n.length;i=n+D.stringOfChar("0",o)+".0"}return this.isNegative()?"-"+i:i},D.prototype.reciprocal=function(){var t=null,e=null,n=null,r=null,i=null,o=null,s=null,a=null;e=(i=1/this._hi)-(t=(o=D.SPLIT*i)-(t=o-i)),n=(a=D.SPLIT*this._hi)-this._hi;var u=i+(o=(1-(s=i*this._hi)-(a=t*(n=a-n)-s+t*(r=this._hi-n)+e*n+e*r)-i*this._lo)/this._hi);return new D(u,i-u+o)},D.prototype.toSciNotation=function(){if(this.isZero())return D.SCI_NOT_ZERO;var t=this.getSpecialNumberString();if(null!==t)return t;var e=new Array(1).fill(null),n=this.extractSignificantDigits(!1,e),r=D.SCI_NOT_EXPONENT_CHAR+e[0];if("0"===n.charAt(0))throw new Error("Found leading zero: "+n);var i="";n.length>1&&(i=n.substring(1));var o=n.charAt(0)+"."+i;return this.isNegative()?"-"+o+r:o+r},D.prototype.abs=function(){return this.isNaN()?D.NaN:this.isNegative()?this.negate():new D(this)},D.prototype.isPositive=function(){return(this._hi>0||0===this._hi)&&this._lo>0},D.prototype.lt=function(t){return(this._hit._hi||this._hi===t._hi)&&this._lo>t._lo},D.prototype.isNegative=function(){return(this._hi<0||0===this._hi)&&this._lo<0},D.prototype.trunc=function(){return this.isNaN()?D.NaN:this.isPositive()?this.floor():this.ceil()},D.prototype.signum=function(){return this._hi>0?1:this._hi<0?-1:this._lo>0?1:this._lo<0?-1:0},D.prototype.interfaces_=function(){return[e,b,E]},D.prototype.getClass=function(){return D},D.sqr=function(t){return D.valueOf(t).selfMultiply(t)},D.valueOf=function(){if("string"==typeof arguments[0]){var t=arguments[0];return D.parse(t)}if("number"==typeof arguments[0])return new D(arguments[0])},D.sqrt=function(t){return D.valueOf(t).sqrt()},D.parse=function(t){for(var e=0,n=t.length;k.isWhitespace(t.charAt(e));)e++;var r=!1;if(e=n);){var l=t.charAt(e);if(e++,k.isDigit(l)){var c=l-"0";o.selfMultiply(D.TEN),o.selfAdd(c),s++}else{if("."!==l){if("e"===l||"E"===l){var h=t.substring(e);try{u=A.parseInt(h)}catch(e){throw e instanceof Error?new Error("Invalid exponent "+h+" in string "+t):e}break}throw new Error("Unexpected character '"+l+"' at position "+e+" in string "+t)}a=s}}var p=o,f=s-a-u;if(0===f)p=o;else if(f>0){var d=D.TEN.pow(f);p=o.divide(d)}else if(f<0){var g=D.TEN.pow(-f);p=o.multiply(g)}return r?p.negate():p},D.createNaN=function(){return new D(m.NaN,m.NaN)},D.copy=function(t){return new D(t)},D.magnitude=function(t){var e=Math.abs(t),n=Math.log(e)/Math.log(10),r=Math.trunc(Math.floor(n));return 10*Math.pow(10,r)<=e&&(r+=1),r},D.stringOfChar=function(t,e){for(var n=new M,r=0;r0){if(o<=0)return j.signum(s);r=i+o}else{if(!(i<0))return j.signum(s);if(o>=0)return j.signum(s);r=-i-o}var a=j.DP_SAFE_EPSILON*r;return s>=a||-s>=a?j.signum(s):2},j.signum=function(t){return t>0?1:t<0?-1:0},z.DP_SAFE_EPSILON.get=function(){return 1e-15},Object.defineProperties(j,z);var G=function(){},B={X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0},M:{configurable:!0}};B.X.get=function(){return 0},B.Y.get=function(){return 1},B.Z.get=function(){return 2},B.M.get=function(){return 3},G.prototype.setOrdinate=function(t,e,n){},G.prototype.size=function(){},G.prototype.getOrdinate=function(t,e){},G.prototype.getCoordinate=function(){},G.prototype.getCoordinateCopy=function(t){},G.prototype.getDimension=function(){},G.prototype.getX=function(t){},G.prototype.clone=function(){},G.prototype.expandEnvelope=function(t){},G.prototype.copy=function(){},G.prototype.getY=function(t){},G.prototype.toCoordinateArray=function(){},G.prototype.interfaces_=function(){return[E]},G.prototype.getClass=function(){return G},Object.defineProperties(G,B);var U=function(){},V=function(t){function e(){t.call(this,"Projective point not representable on the Cartesian plane.")}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(U),X=function(){};X.arraycopy=function(t,e,n,r,i){for(var o=0,s=e;st._minx?this._minx:t._minx,n=this._miny>t._miny?this._miny:t._miny,r=this._maxx=this._minx&&e.getMaxX()<=this._maxx&&e.getMinY()>=this._miny&&e.getMaxY()<=this._maxy}}else if(2===arguments.length){var n=arguments[0],r=arguments[1];return!this.isNull()&&n>=this._minx&&n<=this._maxx&&r>=this._miny&&r<=this._maxy}},q.prototype.intersects=function(){if(1===arguments.length){if(arguments[0]instanceof q){var t=arguments[0];return!this.isNull()&&!t.isNull()&&!(t._minx>this._maxx||t._maxxthis._maxy||t._maxythis._maxx||nthis._maxy||rthis._maxx&&(this._maxx=e._maxx),e._minythis._maxy&&(this._maxy=e._maxy))}}else if(2===arguments.length){var n=arguments[0],r=arguments[1];this.isNull()?(this._minx=n,this._maxx=n,this._miny=r,this._maxy=r):(nthis._maxx&&(this._maxx=n),rthis._maxy&&(this._maxy=r))}},q.prototype.minExtent=function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return te._minx?1:this._minye._miny?1:this._maxxe._maxx?1:this._maxye._maxy?1:0},q.prototype.translate=function(t,e){if(this.isNull())return null;this.init(this.getMinX()+t,this.getMaxX()+t,this.getMinY()+e,this.getMaxY()+e)},q.prototype.toString=function(){return"Env["+this._minx+" : "+this._maxx+", "+this._miny+" : "+this._maxy+"]"},q.prototype.setToNull=function(){this._minx=0,this._maxx=-1,this._miny=0,this._maxy=-1},q.prototype.getHeight=function(){return this.isNull()?0:this._maxy-this._miny},q.prototype.maxExtent=function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return t>e?t:e},q.prototype.expandBy=function(){if(1===arguments.length){var t=arguments[0];this.expandBy(t,t)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];if(this.isNull())return null;this._minx-=e,this._maxx+=e,this._miny-=n,this._maxy+=n,(this._minx>this._maxx||this._miny>this._maxy)&&this.setToNull()}},q.prototype.contains=function(){if(1===arguments.length){if(arguments[0]instanceof q){var t=arguments[0];return this.covers(t)}if(arguments[0]instanceof S){var e=arguments[0];return this.covers(e)}}else if(2===arguments.length){var n=arguments[0],r=arguments[1];return this.covers(n,r)}},q.prototype.centre=function(){return this.isNull()?null:new S((this.getMinX()+this.getMaxX())/2,(this.getMinY()+this.getMaxY())/2)},q.prototype.init=function(){if(0===arguments.length)this.setToNull();else if(1===arguments.length){if(arguments[0]instanceof S){var t=arguments[0];this.init(t.x,t.x,t.y,t.y)}else if(arguments[0]instanceof q){var e=arguments[0];this._minx=e._minx,this._maxx=e._maxx,this._miny=e._miny,this._maxy=e._maxy}}else if(2===arguments.length){var n=arguments[0],r=arguments[1];this.init(n.x,r.x,n.y,r.y)}else if(4===arguments.length){var i=arguments[0],o=arguments[1],s=arguments[2],a=arguments[3];it._maxx&&(e=this._minx-t._maxx);var n=0;return this._maxyt._maxy&&(n=this._miny-t._maxy),0===e?n:0===n?e:Math.sqrt(e*e+n*n)},q.prototype.hashCode=function(){var t=17;return 37*(t=37*(t=37*(t=37*t+S.hashCode(this._minx))+S.hashCode(this._maxx))+S.hashCode(this._miny))+S.hashCode(this._maxy)},q.prototype.interfaces_=function(){return[b,e]},q.prototype.getClass=function(){return q},q.intersects=function(){if(3===arguments.length){var t=arguments[0],e=arguments[1],n=arguments[2];return n.x>=(t.xe.x?t.x:e.x)&&n.y>=(t.ye.y?t.y:e.y)}if(4===arguments.length){var r=arguments[0],i=arguments[1],o=arguments[2],s=arguments[3],a=Math.min(o.x,s.x),u=Math.max(o.x,s.x),l=Math.min(r.x,i.x),c=Math.max(r.x,i.x);return!(l>u)&&!(cu)&&!(cthis.getEdgeDistance(t,1)?(this._intLineIndex[t][0]=0,this._intLineIndex[t][1]=1):(this._intLineIndex[t][0]=1,this._intLineIndex[t][1]=0)}},nt.prototype.isProper=function(){return this.hasIntersection()&&this._isProper},nt.prototype.setPrecisionModel=function(t){this._precisionModel=t},nt.prototype.isInteriorIntersection=function(){if(0===arguments.length)return!!this.isInteriorIntersection(0)||!!this.isInteriorIntersection(1);if(1===arguments.length){for(var t=arguments[0],e=0;ei?r:i;else{var s=Math.abs(t.x-e.x),a=Math.abs(t.y-e.y);0!==(o=r>i?s:a)||t.equals(e)||(o=Math.max(s,a))}return et.isTrue(!(0===o&&!t.equals(e)),"Bad distance calculation"),o},nt.nonRobustComputeEdgeDistance=function(t,e,n){var r=t.x-e.x,i=t.y-e.y,o=Math.sqrt(r*r+i*i);return et.isTrue(!(0===o&&!t.equals(e)),"Invalid distance calculation"),o},rt.DONT_INTERSECT.get=function(){return 0},rt.DO_INTERSECT.get=function(){return 1},rt.COLLINEAR.get=function(){return 2},rt.NO_INTERSECTION.get=function(){return 0},rt.POINT_INTERSECTION.get=function(){return 1},rt.COLLINEAR_INTERSECTION.get=function(){return 2},Object.defineProperties(nt,rt);var it=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.isInSegmentEnvelopes=function(t){var e=new q(this._inputLines[0][0],this._inputLines[0][1]),n=new q(this._inputLines[1][0],this._inputLines[1][1]);return e.contains(t)&&n.contains(t)},e.prototype.computeIntersection=function(){if(3!==arguments.length)return t.prototype.computeIntersection.apply(this,arguments);var e=arguments[0],n=arguments[1],r=arguments[2];if(this._isProper=!1,q.intersects(n,r,e)&&0===at.orientationIndex(n,r,e)&&0===at.orientationIndex(r,n,e))return this._isProper=!0,(e.equals(n)||e.equals(r))&&(this._isProper=!1),this._result=t.POINT_INTERSECTION,null;this._result=t.NO_INTERSECTION},e.prototype.normalizeToMinimum=function(t,e,n,r,i){i.x=this.smallestInAbsValue(t.x,e.x,n.x,r.x),i.y=this.smallestInAbsValue(t.y,e.y,n.y,r.y),t.x-=i.x,t.y-=i.y,e.x-=i.x,e.y-=i.y,n.x-=i.x,n.y-=i.y,r.x-=i.x,r.y-=i.y},e.prototype.safeHCoordinateIntersection=function(t,n,r,i){var o=null;try{o=Y.intersection(t,n,r,i)}catch(s){if(!(s instanceof V))throw s;o=e.nearestEndpoint(t,n,r,i)}return o},e.prototype.intersection=function(t,n,r,i){var o=this.intersectionWithNormalization(t,n,r,i);return this.isInSegmentEnvelopes(o)||(o=new S(e.nearestEndpoint(t,n,r,i))),null!==this._precisionModel&&this._precisionModel.makePrecise(o),o},e.prototype.smallestInAbsValue=function(t,e,n,r){var i=t,o=Math.abs(i);return Math.abs(e)1e-4&&X.out.println("Distance = "+i.distance(o))},e.prototype.intersectionWithNormalization=function(t,e,n,r){var i=new S(t),o=new S(e),s=new S(n),a=new S(r),u=new S;this.normalizeToEnvCentre(i,o,s,a,u);var l=this.safeHCoordinateIntersection(i,o,s,a);return l.x+=u.x,l.y+=u.y,l},e.prototype.computeCollinearIntersection=function(e,n,r,i){var o=q.intersects(e,n,r),s=q.intersects(e,n,i),a=q.intersects(r,i,e),u=q.intersects(r,i,n);return o&&s?(this._intPt[0]=r,this._intPt[1]=i,t.COLLINEAR_INTERSECTION):a&&u?(this._intPt[0]=e,this._intPt[1]=n,t.COLLINEAR_INTERSECTION):o&&a?(this._intPt[0]=r,this._intPt[1]=e,!r.equals(e)||s||u?t.COLLINEAR_INTERSECTION:t.POINT_INTERSECTION):o&&u?(this._intPt[0]=r,this._intPt[1]=n,!r.equals(n)||s||a?t.COLLINEAR_INTERSECTION:t.POINT_INTERSECTION):s&&a?(this._intPt[0]=i,this._intPt[1]=e,!i.equals(e)||o||u?t.COLLINEAR_INTERSECTION:t.POINT_INTERSECTION):s&&u?(this._intPt[0]=i,this._intPt[1]=n,!i.equals(n)||o||a?t.COLLINEAR_INTERSECTION:t.POINT_INTERSECTION):t.NO_INTERSECTION},e.prototype.normalizeToEnvCentre=function(t,e,n,r,i){var o=t.xe.x?t.x:e.x,u=t.y>e.y?t.y:e.y,l=n.xr.x?n.x:r.x,p=n.y>r.y?n.y:r.y,f=((o>l?o:l)+(ac?s:c)+(u0&&s>0||o<0&&s<0)return t.NO_INTERSECTION;var a=at.orientationIndex(r,i,e),u=at.orientationIndex(r,i,n);return a>0&&u>0||a<0&&u<0?t.NO_INTERSECTION:0===o&&0===s&&0===a&&0===u?this.computeCollinearIntersection(e,n,r,i):(0===o||0===s||0===a||0===u?(this._isProper=!1,e.equals2D(r)||e.equals2D(i)?this._intPt[0]=e:n.equals2D(r)||n.equals2D(i)?this._intPt[0]=n:0===o?this._intPt[0]=new S(r):0===s?this._intPt[0]=new S(i):0===a?this._intPt[0]=new S(e):0===u&&(this._intPt[0]=new S(n))):(this._isProper=!0,this._intPt[0]=this.intersection(e,n,r,i)),t.POINT_INTERSECTION)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.nearestEndpoint=function(t,e,n,r){var i=t,o=at.distancePointLine(t,n,r),s=at.distancePointLine(e,n,r);return s0?n>0?-i:i:n>0?i:-i;if(0===e||0===n)return r>0?t>0?i:-i:t>0?-i:i;if(e>0?r>0?e<=r||(i=-i,o=t,t=n,n=o,o=e,e=r,r=o):e<=-r?(i=-i,n=-n,r=-r):(o=t,t=-n,n=o,o=e,e=-r,r=o):r>0?-e<=r?(i=-i,t=-t,e=-e):(o=-t,t=n,n=o,o=-e,e=r,r=o):e>=r?(t=-t,e=-e,n=-n,r=-r):(i=-i,o=-t,t=-n,n=o,o=-e,e=-r,r=o),t>0){if(!(n>0))return i;if(!(t<=n))return i}else{if(n>0)return-i;if(!(t>=n))return-i;i=-i,t=-t,n=-n}for(;;){if((r-=(s=Math.floor(n/t))*e)<0)return-i;if(r>e)return i;if(t>(n-=s*t)+n){if(er+r)return-i;n=t-n,r=e-r,i=-i}if(0===r)return 0===n?0:-i;if(0===n)return i;if((e-=(s=Math.floor(t/n))*r)<0)return i;if(e>r)return-i;if(n>(t-=s*n)+t){if(re+e)return i;t=n-t,e=r-e,i=-i}if(0===e)return 0===t?0:i;if(0===t)return-i}};var st=function(){this._p=null,this._crossingCount=0,this._isPointOnSegment=!1;var t=arguments[0];this._p=t};st.prototype.countSegment=function(t,e){if(t.xr&&(n=e.x,r=t.x),this._p.x>=n&&this._p.x<=r&&(this._isPointOnSegment=!0),null}if(t.y>this._p.y&&e.y<=this._p.y||e.y>this._p.y&&t.y<=this._p.y){var i=t.x-this._p.x,o=t.y-this._p.y,s=e.x-this._p.x,a=e.y-this._p.y,u=ot.signOfDet2x2(i,o,s,a);if(0===u)return this._isPointOnSegment=!0,null;a0&&this._crossingCount++}},st.prototype.isPointInPolygon=function(){return this.getLocation()!==P.EXTERIOR},st.prototype.getLocation=function(){return this._isPointOnSegment?P.BOUNDARY:this._crossingCount%2==1?P.INTERIOR:P.EXTERIOR},st.prototype.isOnSegment=function(){return this._isPointOnSegment},st.prototype.interfaces_=function(){return[]},st.prototype.getClass=function(){return st},st.locatePointInRing=function(){if(arguments[0]instanceof S&&T(arguments[1],G)){for(var t=arguments[1],e=new st(arguments[0]),n=new S,r=new S,i=1;i1||a<0||a>1)&&(i=!0)}}else i=!0;return i?N.min(at.distancePointLine(t,n,r),at.distancePointLine(e,n,r),at.distancePointLine(n,t,e),at.distancePointLine(r,t,e)):0},at.isPointInRing=function(t,e){return at.locatePointInRing(t,e)!==P.EXTERIOR},at.computeLength=function(t){var e=t.size();if(e<=1)return 0;var n=0,r=new S;t.getCoordinate(0,r);for(var i=r.x,o=r.y,s=1;sn.y&&(n=o,r=i)}var s=r;do{(s-=1)<0&&(s=e)}while(t[s].equals2D(n)&&s!==r);var a=r;do{a=(a+1)%e}while(t[a].equals2D(n)&&a!==r);var u=t[s],l=t[a];if(u.equals2D(n)||l.equals2D(n)||u.equals2D(l))return!1;var c=at.computeOrientation(u,n,l);return 0===c?u.x>l.x:c>0},at.locatePointInRing=function(t,e){return st.locatePointInRing(t,e)},at.distancePointLinePerpendicular=function(t,e,n){var r=(n.x-e.x)*(n.x-e.x)+(n.y-e.y)*(n.y-e.y),i=((e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y))/r;return Math.abs(i)*Math.sqrt(r)},at.computeOrientation=function(t,e,n){return at.orientationIndex(t,e,n)},at.distancePointLine=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];if(0===e.length)throw new _("Line array must contain at least one vertex");for(var n=t.distance(e[0]),r=0;r=1)return o.distance(a);var c=((s.y-o.y)*(a.x-s.x)-(s.x-o.x)*(a.y-s.y))/u;return Math.abs(c)*Math.sqrt(u)}},at.isOnLine=function(t,e){for(var n=new it,r=1;r0},vt.prototype.interfaces_=function(){return[dt]},vt.prototype.getClass=function(){return vt};var _t=function(){};_t.prototype.isInBoundary=function(t){return t>1},_t.prototype.interfaces_=function(){return[dt]},_t.prototype.getClass=function(){return _t};var mt=function(){};mt.prototype.isInBoundary=function(t){return 1===t},mt.prototype.interfaces_=function(){return[dt]},mt.prototype.getClass=function(){return mt};var xt=function(){};xt.prototype.add=function(){},xt.prototype.addAll=function(){},xt.prototype.isEmpty=function(){},xt.prototype.iterator=function(){},xt.prototype.size=function(){},xt.prototype.toArray=function(){},xt.prototype.remove=function(){},(n.prototype=new Error).name="IndexOutOfBoundsException";var bt=function(){};bt.prototype.hasNext=function(){},bt.prototype.next=function(){},bt.prototype.remove=function(){};var Et=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(){},e.prototype.set=function(){},e.prototype.isEmpty=function(){},e}(xt);(r.prototype=new Error).name="NoSuchElementException";var wt=function(t){function e(){t.call(this),this.array_=[],arguments[0]instanceof xt&&this.addAll(arguments[0])}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.ensureCapacity=function(){},e.prototype.interfaces_=function(){return[t,xt]},e.prototype.add=function(t){return 1===arguments.length?this.array_.push(t):this.array_.splice(arguments[0],arguments[1]),!0},e.prototype.clear=function(){this.array_=[]},e.prototype.addAll=function(t){for(var e=t.iterator();e.hasNext();)this.add(e.next());return!0},e.prototype.set=function(t,e){var n=this.array_[t];return this.array_[t]=e,n},e.prototype.iterator=function(){return new St(this)},e.prototype.get=function(t){if(t<0||t>=this.size())throw new n;return this.array_[t]},e.prototype.isEmpty=function(){return 0===this.array_.length},e.prototype.size=function(){return this.array_.length},e.prototype.toArray=function(){for(var t=[],e=0,n=this.array_.length;e=1&&this.get(this.size()-1).equals2D(i))return null;t.prototype.add.call(this,i)}else if(arguments[0]instanceof Object&&"boolean"==typeof arguments[1]){var o=arguments[0],s=arguments[1];return this.add(o,s),!0}}else if(3===arguments.length){if("boolean"==typeof arguments[2]&&arguments[0]instanceof Array&&"boolean"==typeof arguments[1]){var a=arguments[0],u=arguments[1];if(arguments[2])for(var l=0;l=0;c--)this.add(a[c],u);return!0}if("boolean"==typeof arguments[2]&&Number.isInteger(arguments[0])&&arguments[1]instanceof S){var h=arguments[0],p=arguments[1];if(!arguments[2]){var f=this.size();if(f>0){if(h>0&&this.get(h-1).equals2D(p))return null;if(hv&&(_=-1);for(var m=y;m!==v;m+=_)this.add(d[m],g);return!0}},e.prototype.closeRing=function(){this.size()>0&&this.add(new S(this.get(0)),!1)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},Object.defineProperties(e,n),e}(wt),It=function(){},Ot={ForwardComparator:{configurable:!0},BidirectionalComparator:{configurable:!0},coordArrayType:{configurable:!0}};Ot.ForwardComparator.get=function(){return Pt},Ot.BidirectionalComparator.get=function(){return Rt},Ot.coordArrayType.get=function(){return new Array(0).fill(null)},It.prototype.interfaces_=function(){return[]},It.prototype.getClass=function(){return It},It.isRing=function(t){return!(t.length<4)&&!!t[0].equals2D(t[t.length-1])},It.ptNotInList=function(t,e){for(var n=0;n=t?e:[]},It.indexOf=function(t,e){for(var n=0;n0)&&(e=t[n]);return e},It.extract=function(t,e,n){e=N.clamp(e,0,t.length);var r=(n=N.clamp(n,-1,t.length))-e+1;n<0&&(r=0),e>=t.length&&(r=0),nr.length)return 1;if(0===n.length)return 0;var i=It.compare(n,r);return It.isEqualReversed(n,r)?0:i},Rt.prototype.OLDcompare=function(t,e){var n=t,r=e;if(n.lengthr.length)return 1;if(0===n.length)return 0;for(var i=It.increasingDirection(n),o=It.increasingDirection(r),s=i>0?0:n.length-1,a=o>0?0:n.length-1,u=0;u0))return e.value;e=e.right}}return null},h.prototype.put=function(t,e){if(null===this.root_)return this.root_={key:t,value:e,left:null,right:null,parent:null,color:At,getValue:function(){return this.value},getKey:function(){return this.key}},this.size_=1,null;var n,r,i=this.root_;do{if(n=i,(r=t.compareTo(i.key))<0)i=i.left;else{if(!(r>0)){var o=i.value;return i.value=e,o}i=i.right}}while(null!==i);var s={key:t,left:null,right:null,value:e,parent:n,color:At,getValue:function(){return this.value},getKey:function(){return this.key}};return r<0?n.left=s:n.right=s,this.fixAfterInsertion(s),this.size_++,null},h.prototype.fixAfterInsertion=function(t){for(t.color=1;null!=t&&t!==this.root_&&1===t.parent.color;)if(a(t)===l(a(a(t)))){var e=c(a(a(t)));1===s(e)?(u(a(t),At),u(e,At),u(a(a(t)),1),t=a(a(t))):(t===c(a(t))&&(t=a(t),this.rotateLeft(t)),u(a(t),At),u(a(a(t)),1),this.rotateRight(a(a(t))))}else{var n=l(a(a(t)));1===s(n)?(u(a(t),At),u(n,At),u(a(a(t)),1),t=a(a(t))):(t===l(a(t))&&(t=a(t),this.rotateRight(t)),u(a(t),At),u(a(a(t)),1),this.rotateLeft(a(a(t))))}this.root_.color=At},h.prototype.values=function(){var t=new wt,e=this.getFirstEntry();if(null!==e)for(t.add(e.value);null!==(e=h.successor(e));)t.add(e.value);return t},h.prototype.entrySet=function(){var t=new Lt,e=this.getFirstEntry();if(null!==e)for(t.add(e);null!==(e=h.successor(e));)t.add(e);return t},h.prototype.rotateLeft=function(t){if(null!=t){var e=t.right;t.right=e.left,null!=e.left&&(e.left.parent=t),e.parent=t.parent,null===t.parent?this.root_=e:t.parent.left===t?t.parent.left=e:t.parent.right=e,e.left=t,t.parent=e}},h.prototype.rotateRight=function(t){if(null!=t){var e=t.left;t.left=e.right,null!=e.right&&(e.right.parent=t),e.parent=t.parent,null===t.parent?this.root_=e:t.parent.right===t?t.parent.right=e:t.parent.left=e,e.right=t,t.parent=e}},h.prototype.getFirstEntry=function(){var t=this.root_;if(null!=t)for(;null!=t.left;)t=t.left;return t},h.successor=function(t){if(null===t)return null;if(null!==t.right){for(var e=t.right;null!==e.left;)e=e.left;return e}for(var n=t.parent,r=t;null!==n&&r===n.right;)r=n,n=n.parent;return n},h.prototype.size=function(){return this.size_};var kt=function(){};kt.prototype.interfaces_=function(){return[]},kt.prototype.getClass=function(){return kt},p.prototype=new o,(f.prototype=new p).contains=function(t){for(var e=0,n=this.array_.length;e=0;){var s=i.substring(0,o);r.add(s),o=(i=i.substring(o+n)).indexOf(e)}i.length>0&&r.add(i);for(var a=new Array(r.size()).fill(null),u=0;u0)for(var o=i;o0&&r.append(" ");for(var o=0;o0&&r.append(","),r.append(qt.toString(t.getOrdinate(i,o)))}return r.append(")"),r.toString()}},Ht.ensureValidRing=function(t,e){var n=e.size();return 0===n?e:n<=3?Ht.createClosedRing(t,e,4):e.getOrdinate(0,G.X)===e.getOrdinate(n-1,G.X)&&e.getOrdinate(0,G.Y)===e.getOrdinate(n-1,G.Y)?e:Ht.createClosedRing(t,e,n+1)},Ht.createClosedRing=function(t,e,n){var r=t.create(n,e.getDimension()),i=e.size();Ht.copy(e,0,r,0,i);for(var o=i;o0&&Ht.reverse(this._points),null}},e.prototype.getCoordinate=function(){return this.isEmpty()?null:this._points.getCoordinate(0)},e.prototype.getBoundaryDimension=function(){return this.isClosed()?jt.FALSE:0},e.prototype.isClosed=function(){return!this.isEmpty()&&this.getCoordinateN(0).equals2D(this.getCoordinateN(this.getNumPoints()-1))},e.prototype.getEndPoint=function(){return this.isEmpty()?null:this.getPointN(this.getNumPoints()-1)},e.prototype.getDimension=function(){return 1},e.prototype.getLength=function(){return at.computeLength(this._points)},e.prototype.getNumPoints=function(){return this._points.size()},e.prototype.reverse=function(){var t=this._points.copy();return Ht.reverse(t),this.getFactory().createLineString(t)},e.prototype.compareToSameClass=function(){if(1===arguments.length){for(var t=arguments[0],e=0,n=0;e= 2)");this._points=t},e.prototype.isCoordinate=function(t){for(var e=0;e=1&&this.getCoordinateSequence().size()= 4)")},e.prototype.getGeometryType=function(){return"LinearRing"},e.prototype.copy=function(){return new e(this._points.copy(),this._factory)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},n.MINIMUM_VALID_SIZE.get=function(){return 4},n.serialVersionUID.get=function(){return-0x3b229e262367a600},Object.defineProperties(e,n),e}(Kt),ne=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={serialVersionUID:{configurable:!0}};return e.prototype.getSortIndex=function(){return ct.SORTINDEX_MULTIPOLYGON},e.prototype.equalsExact=function(){if(2===arguments.length){var e=arguments[0],n=arguments[1];return!!this.isEquivalentClass(e)&&t.prototype.equalsExact.call(this,e,n)}return t.prototype.equalsExact.apply(this,arguments)},e.prototype.getBoundaryDimension=function(){return 1},e.prototype.getDimension=function(){return 2},e.prototype.reverse=function(){for(var t=this._geometries.length,e=new Array(t).fill(null),n=0;n0?e.createPoint(n[0]):e.createPoint():t},se.prototype.interfaces_=function(){return[re.GeometryEditorOperation]},se.prototype.getClass=function(){return se};var ae=function(){};ae.prototype.edit=function(t,e){return t instanceof ee?e.createLinearRing(this.edit(t.getCoordinateSequence(),t)):t instanceof Kt?e.createLineString(this.edit(t.getCoordinateSequence(),t)):t instanceof $t?e.createPoint(this.edit(t.getCoordinateSequence(),t)):t},ae.prototype.interfaces_=function(){return[re.GeometryEditorOperation]},ae.prototype.getClass=function(){return ae};var ue=function(){if(this._dimension=3,this._coordinates=null,1===arguments.length){if(arguments[0]instanceof Array)this._coordinates=arguments[0],this._dimension=3;else if(Number.isInteger(arguments[0])){var t=arguments[0];this._coordinates=new Array(t).fill(null);for(var e=0;e0){var t=new M(17*this._coordinates.length);t.append("("),t.append(this._coordinates[0]);for(var e=1;e3&&(e=3),e<2?new ue(t):new ue(t,e)}},ce.prototype.interfaces_=function(){return[O,e]},ce.prototype.getClass=function(){return ce},ce.instance=function(){return ce.instanceObject},he.serialVersionUID.get=function(){return-0x38e49fa6cf6f2e00},he.instanceObject.get=function(){return new ce},Object.defineProperties(ce,he);var pe=function(t){function e(){t.call(this),this.map_=new Map}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t){return this.map_.get(t)||null},e.prototype.put=function(t,e){return this.map_.set(t,e),e},e.prototype.values=function(){for(var t=new wt,e=this.map_.values(),n=e.next();!n.done;)t.add(n.value),n=e.next();return t},e.prototype.entrySet=function(){var t=new Lt;return this.map_.entries().forEach((function(e){return t.add(e)})),t},e.prototype.size=function(){return this.map_.size()},e}(Tt),fe=function t(){if(this._modelType=null,this._scale=null,0===arguments.length)this._modelType=t.FLOATING;else if(1===arguments.length)if(arguments[0]instanceof ge){var e=arguments[0];this._modelType=e,e===t.FIXED&&this.setScale(1)}else if("number"==typeof arguments[0]){var n=arguments[0];this._modelType=t.FIXED,this.setScale(n)}else if(arguments[0]instanceof t){var r=arguments[0];this._modelType=r._modelType,this._scale=r._scale}},de={serialVersionUID:{configurable:!0},maximumPreciseValue:{configurable:!0}};fe.prototype.equals=function(t){if(!(t instanceof fe))return!1;var e=t;return this._modelType===e._modelType&&this._scale===e._scale},fe.prototype.compareTo=function(t){var e=t,n=this.getMaximumSignificantDigits(),r=e.getMaximumSignificantDigits();return new A(n).compareTo(new A(r))},fe.prototype.getScale=function(){return this._scale},fe.prototype.isFloating=function(){return this._modelType===fe.FLOATING||this._modelType===fe.FLOATING_SINGLE},fe.prototype.getType=function(){return this._modelType},fe.prototype.toString=function(){var t="UNKNOWN";return this._modelType===fe.FLOATING?t="Floating":this._modelType===fe.FLOATING_SINGLE?t="Floating-Single":this._modelType===fe.FIXED&&(t="Fixed (Scale="+this.getScale()+")"),t},fe.prototype.makePrecise=function(){if("number"==typeof arguments[0]){var t=arguments[0];return m.isNaN(t)||this._modelType===fe.FLOATING_SINGLE?t:this._modelType===fe.FIXED?Math.round(t*this._scale)/this._scale:t}if(arguments[0]instanceof S){var e=arguments[0];if(this._modelType===fe.FLOATING)return null;e.x=this.makePrecise(e.x),e.y=this.makePrecise(e.y)}},fe.prototype.getMaximumSignificantDigits=function(){var t=16;return this._modelType===fe.FLOATING?t=16:this._modelType===fe.FLOATING_SINGLE?t=6:this._modelType===fe.FIXED&&(t=1+Math.trunc(Math.ceil(Math.log(this.getScale())/Math.log(10)))),t},fe.prototype.setScale=function(t){this._scale=Math.abs(t)},fe.prototype.interfaces_=function(){return[e,b]},fe.prototype.getClass=function(){return fe},fe.mostPrecise=function(t,e){return t.compareTo(e)>=0?t:e},de.serialVersionUID.get=function(){return 0x6bee6404e9a25c00},de.maximumPreciseValue.get=function(){return 9007199254740992},Object.defineProperties(fe,de);var ge=function t(e){this._name=e||null,t.nameToTypeMap.put(e,this)},ye={serialVersionUID:{configurable:!0},nameToTypeMap:{configurable:!0}};ge.prototype.readResolve=function(){return ge.nameToTypeMap.get(this._name)},ge.prototype.toString=function(){return this._name},ge.prototype.interfaces_=function(){return[e]},ge.prototype.getClass=function(){return ge},ye.serialVersionUID.get=function(){return-552860263173159e4},ye.nameToTypeMap.get=function(){return new pe},Object.defineProperties(ge,ye),fe.Type=ge,fe.FIXED=new ge("FIXED"),fe.FLOATING=new ge("FLOATING"),fe.FLOATING_SINGLE=new ge("FLOATING SINGLE");var ve=function t(){this._precisionModel=new fe,this._SRID=0,this._coordinateSequenceFactory=t.getDefaultCoordinateSequenceFactory(),0===arguments.length||(1===arguments.length?T(arguments[0],O)?this._coordinateSequenceFactory=arguments[0]:arguments[0]instanceof fe&&(this._precisionModel=arguments[0]):2===arguments.length?(this._precisionModel=arguments[0],this._SRID=arguments[1]):3===arguments.length&&(this._precisionModel=arguments[0],this._SRID=arguments[1],this._coordinateSequenceFactory=arguments[2]))},_e={serialVersionUID:{configurable:!0}};ve.prototype.toGeometry=function(t){return t.isNull()?this.createPoint(null):t.getMinX()===t.getMaxX()&&t.getMinY()===t.getMaxY()?this.createPoint(new S(t.getMinX(),t.getMinY())):t.getMinX()===t.getMaxX()||t.getMinY()===t.getMaxY()?this.createLineString([new S(t.getMinX(),t.getMinY()),new S(t.getMaxX(),t.getMaxY())]):this.createPolygon(this.createLinearRing([new S(t.getMinX(),t.getMinY()),new S(t.getMinX(),t.getMaxY()),new S(t.getMaxX(),t.getMaxY()),new S(t.getMaxX(),t.getMinY()),new S(t.getMinX(),t.getMinY())]),null)},ve.prototype.createLineString=function(t){return t?t instanceof Array?new Kt(this.getCoordinateSequenceFactory().create(t),this):T(t,G)?new Kt(t,this):void 0:new Kt(this.getCoordinateSequenceFactory().create([]),this)},ve.prototype.createMultiLineString=function(){return 0===arguments.length?new Vt(null,this):1===arguments.length?new Vt(arguments[0],this):void 0},ve.prototype.buildGeometry=function(t){for(var e=null,n=!1,r=!1,i=t.iterator();i.hasNext();){var o=i.next(),s=o.getClass();null===e&&(e=s),s!==e&&(n=!0),o.isGeometryCollectionOrDerived()&&(r=!0)}if(null===e)return this.createGeometryCollection();if(n||r)return this.createGeometryCollection(ve.toGeometryArray(t));var a=t.iterator().next();if(t.size()>1){if(a instanceof Qt)return this.createMultiPolygon(ve.toPolygonArray(t));if(a instanceof Kt)return this.createMultiLineString(ve.toLineStringArray(t));if(a instanceof $t)return this.createMultiPoint(ve.toPointArray(t));et.shouldNeverReachHere("Unhandled class: "+a.getClass().getName())}return a},ve.prototype.createMultiPointFromCoords=function(t){return this.createMultiPoint(null!==t?this.getCoordinateSequenceFactory().create(t):null)},ve.prototype.createPoint=function(){if(0===arguments.length)return this.createPoint(this.getCoordinateSequenceFactory().create([]));if(1===arguments.length){if(arguments[0]instanceof S){var t=arguments[0];return this.createPoint(null!==t?this.getCoordinateSequenceFactory().create([t]):null)}if(T(arguments[0],G))return new $t(arguments[0],this)}},ve.prototype.getCoordinateSequenceFactory=function(){return this._coordinateSequenceFactory},ve.prototype.createPolygon=function(){if(0===arguments.length)return new Qt(null,null,this);if(1===arguments.length){if(T(arguments[0],G)){var t=arguments[0];return this.createPolygon(this.createLinearRing(t))}if(arguments[0]instanceof Array){var e=arguments[0];return this.createPolygon(this.createLinearRing(e))}if(arguments[0]instanceof ee){var n=arguments[0];return this.createPolygon(n,null)}}else if(2===arguments.length)return new Qt(arguments[0],arguments[1],this)},ve.prototype.getSRID=function(){return this._SRID},ve.prototype.createGeometryCollection=function(){return 0===arguments.length?new Ut(null,this):1===arguments.length?new Ut(arguments[0],this):void 0},ve.prototype.createGeometry=function(t){return new re(this).edit(t,{edit:function(){if(2===arguments.length){var t=arguments[0];return this._coordinateSequenceFactory.create(t)}}})},ve.prototype.getPrecisionModel=function(){return this._precisionModel},ve.prototype.createLinearRing=function(){if(0===arguments.length)return this.createLinearRing(this.getCoordinateSequenceFactory().create([]));if(1===arguments.length){if(arguments[0]instanceof Array){var t=arguments[0];return this.createLinearRing(null!==t?this.getCoordinateSequenceFactory().create(t):null)}if(T(arguments[0],G))return new ee(arguments[0],this)}},ve.prototype.createMultiPolygon=function(){return 0===arguments.length?new ne(null,this):1===arguments.length?new ne(arguments[0],this):void 0},ve.prototype.createMultiPoint=function(){if(0===arguments.length)return new te(null,this);if(1===arguments.length){if(arguments[0]instanceof Array)return new te(arguments[0],this);if(arguments[0]instanceof Array){var t=arguments[0];return this.createMultiPoint(null!==t?this.getCoordinateSequenceFactory().create(t):null)}if(T(arguments[0],G)){var e=arguments[0];if(null===e)return this.createMultiPoint(new Array(0).fill(null));for(var n=new Array(e.size()).fill(null),r=0;r=this.size())throw new Error;return this.array_[t]},y.prototype.push=function(t){return this.array_.push(t),t},y.prototype.pop=function(t){if(0===this.array_.length)throw new g;return this.array_.pop()},y.prototype.peek=function(){if(0===this.array_.length)throw new g;return this.array_[this.array_.length-1]},y.prototype.empty=function(){return 0===this.array_.length},y.prototype.isEmpty=function(){return this.empty()},y.prototype.search=function(t){return this.array_.indexOf(t)},y.prototype.size=function(){return this.array_.length},y.prototype.toArray=function(){for(var t=[],e=0,n=this.array_.length;e0&&this._minIndexthis._minCoord.y&&n.y>this._minCoord.y&&r===at.CLOCKWISE)&&(i=!0),i&&(this._minIndex=this._minIndex-1)},Oe.prototype.getRightmostSideOfSegment=function(t,e){var n=t.getEdge().getCoordinates();if(e<0||e+1>=n.length)return-1;if(n[e].y===n[e+1].y)return-1;var r=Ce.LEFT;return n[e].ythis._minCoord.x)&&(this._minDe=t,this._minIndex=n,this._minCoord=e[n])},Oe.prototype.findRightmostEdgeAtNode=function(){var t=this._minDe.getNode().getEdges();this._minDe=t.getRightmostEdge(),this._minDe.isForward()||(this._minDe=this._minDe.getSym(),this._minIndex=this._minDe.getEdge().getCoordinates().length-1)},Oe.prototype.findEdge=function(t){for(var e=t.iterator();e.hasNext();){var n=e.next();n.isForward()&&this.checkForRightmostCoordinate(n)}et.isTrue(0!==this._minIndex||this._minCoord.equals(this._minDe.getCoordinate()),"inconsistency in rightmost processing"),0===this._minIndex?this.findRightmostEdgeAtNode():this.findRightmostEdgeAtVertex(),this._orientedDe=this._minDe,this.getRightmostSide(this._minDe,this._minIndex)===Ce.LEFT&&(this._orientedDe=this._minDe.getSym())},Oe.prototype.interfaces_=function(){return[]},Oe.prototype.getClass=function(){return Oe};var Pe=function(t){function e(n,r){t.call(this,e.msgWithCoord(n,r)),this.pt=r?new S(r):null,this.name="TopologyException"}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getCoordinate=function(){return this.pt},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.msgWithCoord=function(t,e){return e?t:t+" [ "+e+" ]"},e}(Q),Re=function(){this.array_=[]};Re.prototype.addLast=function(t){this.array_.push(t)},Re.prototype.removeFirst=function(){return this.array_.shift()},Re.prototype.isEmpty=function(){return 0===this.array_.length};var Te=function(){this._finder=null,this._dirEdgeList=new wt,this._nodes=new wt,this._rightMostCoord=null,this._env=null,this._finder=new Oe};Te.prototype.clearVisitedEdges=function(){for(var t=this._dirEdgeList.iterator();t.hasNext();)t.next().setVisited(!1)},Te.prototype.getRightmostCoordinate=function(){return this._rightMostCoord},Te.prototype.computeNodeDepth=function(t){for(var e=null,n=t.getEdges().iterator();n.hasNext();){var r=n.next();if(r.isVisited()||r.getSym().isVisited()){e=r;break}}if(null===e)throw new Pe("unable to find edge to compute depths at "+t.getCoordinate());t.getEdges().computeDepths(e);for(var i=t.getEdges().iterator();i.hasNext();){var o=i.next();o.setVisited(!0),this.copySymDepths(o)}},Te.prototype.computeDepth=function(t){this.clearVisitedEdges();var e=this._finder.getEdge();e.setEdgeDepths(Ce.RIGHT,t),this.copySymDepths(e),this.computeDepths(e)},Te.prototype.create=function(t){this.addReachable(t),this._finder.findEdge(this._dirEdgeList),this._rightMostCoord=this._finder.getCoordinate()},Te.prototype.findResultEdges=function(){for(var t=this._dirEdgeList.iterator();t.hasNext();){var e=t.next();e.getDepth(Ce.RIGHT)>=1&&e.getDepth(Ce.LEFT)<=0&&!e.isInteriorAreaEdge()&&e.setInResult(!0)}},Te.prototype.computeDepths=function(t){var e=new Lt,n=new Re,r=t.getNode();for(n.addLast(r),e.add(r),t.setVisited(!0);!n.isEmpty();){var i=n.removeFirst();e.add(i),this.computeNodeDepth(i);for(var o=i.getEdges().iterator();o.hasNext();){var s=o.next().getSym();if(!s.isVisited()){var a=s.getNode();e.contains(a)||(n.addLast(a),e.add(a))}}}},Te.prototype.compareTo=function(t){var e=t;return this._rightMostCoord.xe._rightMostCoord.x?1:0},Te.prototype.getEnvelope=function(){if(null===this._env){for(var t=new q,e=this._dirEdgeList.iterator();e.hasNext();)for(var n=e.next().getEdge().getCoordinates(),r=0;rthis.location.length){var e=new Array(3).fill(null);e[Ce.ON]=this.location[Ce.ON],e[Ce.LEFT]=P.NONE,e[Ce.RIGHT]=P.NONE,this.location=e}for(var n=0;n1&&t.append(P.toLocationSymbol(this.location[Ce.LEFT])),t.append(P.toLocationSymbol(this.location[Ce.ON])),this.location.length>1&&t.append(P.toLocationSymbol(this.location[Ce.RIGHT])),t.toString()},Ne.prototype.setLocations=function(t,e,n){this.location[Ce.ON]=t,this.location[Ce.LEFT]=e,this.location[Ce.RIGHT]=n},Ne.prototype.get=function(t){return t1},Ne.prototype.isAnyNull=function(){for(var t=0;tthis._maxNodeDegree&&(this._maxNodeDegree=e),t=this.getNext(t)}while(t!==this._startDe);this._maxNodeDegree*=2},Me.prototype.addPoints=function(t,e,n){var r=t.getCoordinates();if(e){var i=1;n&&(i=0);for(var o=i;o=0;a--)this._pts.add(r[a])}},Me.prototype.isHole=function(){return this._isHole},Me.prototype.setInResult=function(){var t=this._startDe;do{t.getEdge().setInResult(!0),t=t.getNext()}while(t!==this._startDe)},Me.prototype.containsPoint=function(t){var e=this.getLinearRing();if(!e.getEnvelopeInternal().contains(t))return!1;if(!at.isPointInRing(t,e.getCoordinates()))return!1;for(var n=this._holes.iterator();n.hasNext();)if(n.next().containsPoint(t))return!1;return!0},Me.prototype.addHole=function(t){this._holes.add(t)},Me.prototype.isShell=function(){return null===this._shell},Me.prototype.getLabel=function(){return this._label},Me.prototype.getEdges=function(){return this._edges},Me.prototype.getMaxNodeDegree=function(){return this._maxNodeDegree<0&&this.computeMaxNodeDegree(),this._maxNodeDegree},Me.prototype.getShell=function(){return this._shell},Me.prototype.mergeLabel=function(){if(1===arguments.length){var t=arguments[0];this.mergeLabel(t,0),this.mergeLabel(t,1)}else if(2===arguments.length){var e=arguments[1],n=arguments[0].getLocation(e,Ce.RIGHT);if(n===P.NONE)return null;if(this._label.getLocation(e)===P.NONE)return this._label.setLocation(e,n),null}},Me.prototype.setShell=function(t){this._shell=t,null!==t&&t.addHole(this)},Me.prototype.toPolygon=function(t){for(var e=new Array(this._holes.size()).fill(null),n=0;n=2,"found partial label"),this.computeIM(t)},De.prototype.isInResult=function(){return this._isInResult},De.prototype.isVisited=function(){return this._isVisited},De.prototype.interfaces_=function(){return[]},De.prototype.getClass=function(){return De};var Fe=function(t){function e(){t.call(this),this._coord=null,this._edges=null;var e=arguments[0],n=arguments[1];this._coord=e,this._edges=n,this._label=new Le(0,P.NONE)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.isIncidentEdgeInResult=function(){for(var t=this.getEdges().getEdges().iterator();t.hasNext();)if(t.next().getEdge().isInResult())return!0;return!1},e.prototype.isIsolated=function(){return 1===this._label.getGeometryCount()},e.prototype.getCoordinate=function(){return this._coord},e.prototype.print=function(t){t.println("node "+this._coord+" lbl: "+this._label)},e.prototype.computeIM=function(t){},e.prototype.computeMergedLocation=function(t,e){var n=P.NONE;if(n=this._label.getLocation(e),!t.isNull(e)){var r=t.getLocation(e);n!==P.BOUNDARY&&(n=r)}return n},e.prototype.setLabel=function(){if(2!==arguments.length)return t.prototype.setLabel.apply(this,arguments);var e=arguments[0],n=arguments[1];null===this._label?this._label=new Le(e,n):this._label.setLocation(e,n)},e.prototype.getEdges=function(){return this._edges},e.prototype.mergeLabel=function(){if(arguments[0]instanceof e){var t=arguments[0];this.mergeLabel(t._label)}else if(arguments[0]instanceof Le)for(var n=arguments[0],r=0;r<2;r++){var i=this.computeMergedLocation(n,r);this._label.getLocation(r)===P.NONE&&this._label.setLocation(r,i)}},e.prototype.add=function(t){this._edges.insert(t),t.setNode(this)},e.prototype.setLabelBoundary=function(t){if(null===this._label)return null;var e=P.NONE;null!==this._label&&(e=this._label.getLocation(t));var n=null;switch(e){case P.BOUNDARY:n=P.INTERIOR;break;case P.INTERIOR:default:n=P.BOUNDARY}this._label.setLocation(t,n)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(De),je=function(){this.nodeMap=new h,this.nodeFact=null;var t=arguments[0];this.nodeFact=t};je.prototype.find=function(t){return this.nodeMap.get(t)},je.prototype.addNode=function(){if(arguments[0]instanceof S){var t=arguments[0],e=this.nodeMap.get(t);return null===e&&(e=this.nodeFact.createNode(t),this.nodeMap.put(t,e)),e}if(arguments[0]instanceof Fe){var n=arguments[0],r=this.nodeMap.get(n.getCoordinate());return null===r?(this.nodeMap.put(n.getCoordinate(),n),n):(r.mergeLabel(n),r)}},je.prototype.print=function(t){for(var e=this.iterator();e.hasNext();)e.next().print(t)},je.prototype.iterator=function(){return this.nodeMap.values().iterator()},je.prototype.values=function(){return this.nodeMap.values()},je.prototype.getBoundaryNodes=function(t){for(var e=new wt,n=this.iterator();n.hasNext();){var r=n.next();r.getLabel().getLocation(t)===P.BOUNDARY&&e.add(r)}return e},je.prototype.add=function(t){var e=t.getCoordinate();this.addNode(e).add(t)},je.prototype.interfaces_=function(){return[]},je.prototype.getClass=function(){return je};var ze=function(){},Ge={NE:{configurable:!0},NW:{configurable:!0},SW:{configurable:!0},SE:{configurable:!0}};ze.prototype.interfaces_=function(){return[]},ze.prototype.getClass=function(){return ze},ze.isNorthern=function(t){return t===ze.NE||t===ze.NW},ze.isOpposite=function(t,e){return t!==e&&2===(t-e+4)%4},ze.commonHalfPlane=function(t,e){if(t===e)return t;if(2===(t-e+4)%4)return-1;var n=te?t:e)?3:n},ze.isInHalfPlane=function(t,e){return e===ze.SE?t===ze.SE||t===ze.SW:t===e||t===e+1},ze.quadrant=function(){if("number"==typeof arguments[0]&&"number"==typeof arguments[1]){var t=arguments[0],e=arguments[1];if(0===t&&0===e)throw new _("Cannot compute the quadrant for point ( "+t+", "+e+" )");return t>=0?e>=0?ze.NE:ze.SE:e>=0?ze.NW:ze.SW}if(arguments[0]instanceof S&&arguments[1]instanceof S){var n=arguments[0],r=arguments[1];if(r.x===n.x&&r.y===n.y)throw new _("Cannot compute the quadrant for two identical points "+n);return r.x>=n.x?r.y>=n.y?ze.NE:ze.SE:r.y>=n.y?ze.NW:ze.SW}},Ge.NE.get=function(){return 0},Ge.NW.get=function(){return 1},Ge.SW.get=function(){return 2},Ge.SE.get=function(){return 3},Object.defineProperties(ze,Ge);var Be=function(){if(this._edge=null,this._label=null,this._node=null,this._p0=null,this._p1=null,this._dx=null,this._dy=null,this._quadrant=null,1===arguments.length){var t=arguments[0];this._edge=t}else if(3===arguments.length){var e=arguments[0],n=arguments[1],r=arguments[2];this._edge=e,this.init(n,r),this._label=null}else if(4===arguments.length){var i=arguments[0],o=arguments[1],s=arguments[2],a=arguments[3];this._edge=i,this.init(o,s),this._label=a}};Be.prototype.compareDirection=function(t){return this._dx===t._dx&&this._dy===t._dy?0:this._quadrant>t._quadrant?1:this._quadrant2){o.linkDirectedEdgesForMinimalEdgeRings();var s=o.buildMinimalRings(),a=this.findShell(s);null!==a?(this.placePolygonHoles(a,s),e.add(a)):n.addAll(s)}else r.add(o)}return r},Ye.prototype.containsPoint=function(t){for(var e=this._shellList.iterator();e.hasNext();)if(e.next().containsPoint(t))return!0;return!1},Ye.prototype.buildMaximalEdgeRings=function(t){for(var e=new wt,n=t.iterator();n.hasNext();){var r=n.next();if(r.isInResult()&&r.getLabel().isArea()&&null===r.getEdgeRing()){var i=new ke(r,this._geometryFactory);e.add(i),i.setInResult()}}return e},Ye.prototype.placePolygonHoles=function(t,e){for(var n=e.iterator();n.hasNext();){var r=n.next();r.isHole()&&r.setShell(t)}},Ye.prototype.getPolygons=function(){return this.computePolygons(this._shellList)},Ye.prototype.findEdgeRingContaining=function(t,e){for(var n=t.getLinearRing(),r=n.getEnvelopeInternal(),i=n.getCoordinateN(0),o=null,s=null,a=e.iterator();a.hasNext();){var u=a.next(),l=u.getLinearRing(),c=l.getEnvelopeInternal();null!==o&&(s=o.getLinearRing().getEnvelopeInternal());var h=!1;c.contains(r)&&at.isPointInRing(i,l.getCoordinates())&&(h=!0),h&&(null===o||s.contains(c))&&(o=u)}return o},Ye.prototype.findShell=function(t){for(var e=0,n=null,r=t.iterator();r.hasNext();){var i=r.next();i.isHole()||(n=i,e++)}return et.isTrue(e<=1,"found two shells in MinimalEdgeRing list"),n},Ye.prototype.add=function(){if(1===arguments.length){var t=arguments[0];this.add(t.getEdgeEnds(),t.getNodes())}else if(2===arguments.length){var e=arguments[0],n=arguments[1];Xe.linkResultDirectedEdges(n);var r=this.buildMaximalEdgeRings(e),i=new wt,o=this.buildMinimalEdgeRings(r,this._shellList,i);this.sortShellsAndHoles(o,this._shellList,i),this.placeFreeHoles(this._shellList,i)}},Ye.prototype.interfaces_=function(){return[]},Ye.prototype.getClass=function(){return Ye};var qe=function(){};qe.prototype.getBounds=function(){},qe.prototype.interfaces_=function(){return[]},qe.prototype.getClass=function(){return qe};var We=function(){this._bounds=null,this._item=null;var t=arguments[0],e=arguments[1];this._bounds=t,this._item=e};We.prototype.getItem=function(){return this._item},We.prototype.getBounds=function(){return this._bounds},We.prototype.interfaces_=function(){return[qe,e]},We.prototype.getClass=function(){return We};var He=function(){this._size=null,this._items=null,this._size=0,this._items=new wt,this._items.add(null)};He.prototype.poll=function(){if(this.isEmpty())return null;var t=this._items.get(1);return this._items.set(1,this._items.get(this._size)),this._size-=1,this.reorder(1),t},He.prototype.size=function(){return this._size},He.prototype.reorder=function(t){for(var e=null,n=this._items.get(t);2*t<=this._size&&((e=2*t)!==this._size&&this._items.get(e+1).compareTo(this._items.get(e))<0&&e++,this._items.get(e).compareTo(n)<0);t=e)this._items.set(t,this._items.get(e));this._items.set(t,n)},He.prototype.clear=function(){this._size=0,this._items.clear()},He.prototype.isEmpty=function(){return 0===this._size},He.prototype.add=function(t){this._items.add(null),this._size+=1;var e=this._size;for(this._items.set(0,t);t.compareTo(this._items.get(Math.trunc(e/2)))<0;e/=2)this._items.set(e,this._items.get(Math.trunc(e/2)));this._items.set(e,t)},He.prototype.interfaces_=function(){return[]},He.prototype.getClass=function(){return He};var Ke=function(){};Ke.prototype.visitItem=function(t){},Ke.prototype.interfaces_=function(){return[]},Ke.prototype.getClass=function(){return Ke};var Ze=function(){};Ze.prototype.insert=function(t,e){},Ze.prototype.remove=function(t,e){},Ze.prototype.query=function(){},Ze.prototype.interfaces_=function(){return[]},Ze.prototype.getClass=function(){return Ze};var $e=function(){if(this._childBoundables=new wt,this._bounds=null,this._level=null,0===arguments.length);else if(1===arguments.length){var t=arguments[0];this._level=t}},Je={serialVersionUID:{configurable:!0}};$e.prototype.getLevel=function(){return this._level},$e.prototype.size=function(){return this._childBoundables.size()},$e.prototype.getChildBoundables=function(){return this._childBoundables},$e.prototype.addChildBoundable=function(t){et.isTrue(null===this._bounds),this._childBoundables.add(t)},$e.prototype.isEmpty=function(){return this._childBoundables.isEmpty()},$e.prototype.getBounds=function(){return null===this._bounds&&(this._bounds=this.computeBounds()),this._bounds},$e.prototype.interfaces_=function(){return[qe,e]},$e.prototype.getClass=function(){return $e},Je.serialVersionUID.get=function(){return 0x5a1e55ec41369800},Object.defineProperties($e,Je);var Qe=function(){};Qe.reverseOrder=function(){return{compare:function(t,e){return e.compareTo(t)}}},Qe.min=function(t){return Qe.sort(t),t.get(0)},Qe.sort=function(t,e){var n=t.toArray();e?Ft.sort(n,e):Ft.sort(n);for(var r=t.iterator(),i=0,o=n.length;itn.area(this._boundable2)?(this.expand(this._boundable1,this._boundable2,t,e),null):(this.expand(this._boundable2,this._boundable1,t,e),null);if(n)return this.expand(this._boundable1,this._boundable2,t,e),null;if(r)return this.expand(this._boundable2,this._boundable1,t,e),null;throw new _("neither boundable is composite")},tn.prototype.isLeaves=function(){return!(tn.isComposite(this._boundable1)||tn.isComposite(this._boundable2))},tn.prototype.compareTo=function(t){var e=t;return this._distancee._distance?1:0},tn.prototype.expand=function(t,e,n,r){for(var i=t.getChildBoundables().iterator();i.hasNext();){var o=i.next(),s=new tn(o,e,this._itemDistance);s.getDistance()1,"Node capacity must be greater than 1"),this._nodeCapacity=n}},nn={IntersectsOp:{configurable:!0},serialVersionUID:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};en.prototype.getNodeCapacity=function(){return this._nodeCapacity},en.prototype.lastNode=function(t){return t.get(t.size()-1)},en.prototype.size=function(){if(0===arguments.length)return this.isEmpty()?0:(this.build(),this.size(this._root));if(1===arguments.length){for(var t=0,e=arguments[0].getChildBoundables().iterator();e.hasNext();){var n=e.next();n instanceof $e?t+=this.size(n):n instanceof We&&(t+=1)}return t}},en.prototype.removeItem=function(t,e){for(var n=null,r=t.getChildBoundables().iterator();r.hasNext();){var i=r.next();i instanceof We&&i.getItem()===e&&(n=i)}return null!==n&&(t.getChildBoundables().remove(n),!0)},en.prototype.itemsTree=function(){if(0===arguments.length){this.build();var t=this.itemsTree(this._root);return null===t?new wt:t}if(1===arguments.length){for(var e=arguments[0],n=new wt,r=e.getChildBoundables().iterator();r.hasNext();){var i=r.next();if(i instanceof $e){var o=this.itemsTree(i);null!==o&&n.add(o)}else i instanceof We?n.add(i.getItem()):et.shouldNeverReachHere()}return n.size()<=0?null:n}},en.prototype.insert=function(t,e){et.isTrue(!this._built,"Cannot insert items into an STR packed R-tree after it has been built."),this._itemBoundables.add(new We(t,e))},en.prototype.boundablesAtLevel=function(){if(1===arguments.length){var t=arguments[0],e=new wt;return this.boundablesAtLevel(t,this._root,e),e}if(3===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2];if(et.isTrue(n>-2),r.getLevel()===n)return i.add(r),null;for(var o=r.getChildBoundables().iterator();o.hasNext();){var s=o.next();s instanceof $e?this.boundablesAtLevel(n,s,i):(et.isTrue(s instanceof We),-1===n&&i.add(s))}return null}},en.prototype.query=function(){if(1===arguments.length){var t=arguments[0];this.build();var e=new wt;return this.isEmpty()||this.getIntersectsOp().intersects(this._root.getBounds(),t)&&this.query(t,this._root,e),e}if(2===arguments.length){var n=arguments[0],r=arguments[1];if(this.build(),this.isEmpty())return null;this.getIntersectsOp().intersects(this._root.getBounds(),n)&&this.query(n,this._root,r)}else if(3===arguments.length)if(T(arguments[2],Ke)&&arguments[0]instanceof Object&&arguments[1]instanceof $e)for(var i=arguments[0],o=arguments[2],s=arguments[1].getChildBoundables(),a=0;at&&(t=r)}}return t+1}},en.prototype.createParentBoundables=function(t,e){et.isTrue(!t.isEmpty());var n=new wt;n.add(this.createNode(e));var r=new wt(t);Qe.sort(r,this.getComparator());for(var i=r.iterator();i.hasNext();){var o=i.next();this.lastNode(n).getChildBoundables().size()===this.getNodeCapacity()&&n.add(this.createNode(e)),this.lastNode(n).addChildBoundable(o)}return n},en.prototype.isEmpty=function(){return this._built?this._root.isEmpty():this._itemBoundables.isEmpty()},en.prototype.interfaces_=function(){return[e]},en.prototype.getClass=function(){return en},en.compareDoubles=function(t,e){return t>e?1:t0);for(var n=new wt,r=0;r0;){var h=c.poll(),p=h.getDistance();if(p>=u)break;h.isLeaves()?(u=p,l=h):h.expandToQueue(c,u)}return[l.getBoundable(0).getItem(),l.getBoundable(1).getItem()]}}else if(3===arguments.length){var f=arguments[2],d=new We(arguments[0],arguments[1]),g=new tn(this.getRoot(),d,f);return this.nearestNeighbour(g)[0]}},n.prototype.interfaces_=function(){return[Ze,e]},n.prototype.getClass=function(){return n},n.centreX=function(t){return n.avg(t.getMinX(),t.getMaxX())},n.avg=function(t,e){return(t+e)/2},n.centreY=function(t){return n.avg(t.getMinY(),t.getMaxY())},r.STRtreeNode.get=function(){return an},r.serialVersionUID.get=function(){return 0x39920f7d5f261e0},r.xComparator.get=function(){return{interfaces_:function(){return[w]},compare:function(e,r){return t.compareDoubles(n.centreX(e.getBounds()),n.centreX(r.getBounds()))}}},r.yComparator.get=function(){return{interfaces_:function(){return[w]},compare:function(e,r){return t.compareDoubles(n.centreY(e.getBounds()),n.centreY(r.getBounds()))}}},r.intersectsOp.get=function(){return{interfaces_:function(){return[t.IntersectsOp]},intersects:function(t,e){return t.intersects(e)}}},r.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(n,r),n}(en),an=function(t){function e(){var e=arguments[0];t.call(this,e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.computeBounds=function(){for(var t=null,e=this.getChildBoundables().iterator();e.hasNext();){var n=e.next();null===t?t=new q(n.getBounds()):t.expandToInclude(n.getBounds())}return t},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}($e),un=function(){};un.prototype.interfaces_=function(){return[]},un.prototype.getClass=function(){return un},un.relativeSign=function(t,e){return te?1:0},un.compare=function(t,e,n){if(e.equals2D(n))return 0;var r=un.relativeSign(e.x,n.x),i=un.relativeSign(e.y,n.y);switch(t){case 0:return un.compareValue(r,i);case 1:return un.compareValue(i,r);case 2:return un.compareValue(i,-r);case 3:return un.compareValue(-r,i);case 4:return un.compareValue(-r,-i);case 5:return un.compareValue(-i,-r);case 6:return un.compareValue(-i,r);case 7:return un.compareValue(r,-i)}return et.shouldNeverReachHere("invalid octant value"),0},un.compareValue=function(t,e){return t<0?-1:t>0?1:e<0?-1:e>0?1:0};var ln=function(){this._segString=null,this.coord=null,this.segmentIndex=null,this._segmentOctant=null,this._isInterior=null;var t=arguments[0],e=arguments[1],n=arguments[2],r=arguments[3];this._segString=t,this.coord=new S(e),this.segmentIndex=n,this._segmentOctant=r,this._isInterior=!e.equals2D(t.getCoordinate(n))};ln.prototype.getCoordinate=function(){return this.coord},ln.prototype.print=function(t){t.print(this.coord),t.print(" seg # = "+this.segmentIndex)},ln.prototype.compareTo=function(t){var e=t;return this.segmentIndexe.segmentIndex?1:this.coord.equals2D(e.coord)?0:un.compare(this._segmentOctant,this.coord,e.coord)},ln.prototype.isEndPoint=function(t){return 0===this.segmentIndex&&!this._isInterior||this.segmentIndex===t},ln.prototype.isInterior=function(){return this._isInterior},ln.prototype.interfaces_=function(){return[b]},ln.prototype.getClass=function(){return ln};var cn=function(){this._nodeMap=new h,this._edge=null;var t=arguments[0];this._edge=t};cn.prototype.getSplitCoordinates=function(){var t=new Ct;this.addEndpoints();for(var e=this.iterator(),n=e.next();e.hasNext();){var r=e.next();this.addEdgeCoordinates(n,r,t),n=r}return t.toCoordinateArray()},cn.prototype.addCollapsedNodes=function(){var t=new wt;this.findCollapsesFromInsertedNodes(t),this.findCollapsesFromExistingVertices(t);for(var e=t.iterator();e.hasNext();){var n=e.next().intValue();this.add(this._edge.getCoordinate(n),n)}},cn.prototype.print=function(t){t.println("Intersections:");for(var e=this.iterator();e.hasNext();)e.next().print(t)},cn.prototype.findCollapsesFromExistingVertices=function(t){for(var e=0;e=0?e>=0?n>=r?0:1:n>=r?7:6:e>=0?n>=r?3:2:n>=r?4:5}if(arguments[0]instanceof S&&arguments[1]instanceof S){var i=arguments[0],o=arguments[1],s=o.x-i.x,a=o.y-i.y;if(0===s&&0===a)throw new _("Cannot compute the octant for two identical points "+i);return hn.octant(s,a)}};var pn=function(){};pn.prototype.getCoordinates=function(){},pn.prototype.size=function(){},pn.prototype.getCoordinate=function(t){},pn.prototype.isClosed=function(){},pn.prototype.setData=function(t){},pn.prototype.getData=function(){},pn.prototype.interfaces_=function(){return[]},pn.prototype.getClass=function(){return pn};var fn=function(){};fn.prototype.addIntersection=function(t,e){},fn.prototype.interfaces_=function(){return[pn]},fn.prototype.getClass=function(){return fn};var dn=function(){this._nodeList=new cn(this),this._pts=null,this._data=null;var t=arguments[0],e=arguments[1];this._pts=t,this._data=e};dn.prototype.getCoordinates=function(){return this._pts},dn.prototype.size=function(){return this._pts.length},dn.prototype.getCoordinate=function(t){return this._pts[t]},dn.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},dn.prototype.getSegmentOctant=function(t){return t===this._pts.length-1?-1:this.safeOctant(this.getCoordinate(t),this.getCoordinate(t+1))},dn.prototype.setData=function(t){this._data=t},dn.prototype.safeOctant=function(t,e){return t.equals2D(e)?0:hn.octant(t,e)},dn.prototype.getData=function(){return this._data},dn.prototype.addIntersection=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];this.addIntersectionNode(t,e)}else if(4===arguments.length){var n=arguments[1],r=arguments[3],i=new S(arguments[0].getIntersection(r));this.addIntersection(i,n)}},dn.prototype.toString=function(){return J.toLineString(new ue(this._pts))},dn.prototype.getNodeList=function(){return this._nodeList},dn.prototype.addIntersectionNode=function(t,e){var n=e,r=n+1;if(r=0&&n>=0||e<=0&&n<=0?Math.max(e,n):0}if(arguments[0]instanceof S){var r=arguments[0];return at.orientationIndex(this.p0,this.p1,r)}},gn.prototype.toGeometry=function(t){return t.createLineString([this.p0,this.p1])},gn.prototype.isVertical=function(){return this.p0.x===this.p1.x},gn.prototype.equals=function(t){if(!(t instanceof gn))return!1;var e=t;return this.p0.equals(e.p0)&&this.p1.equals(e.p1)},gn.prototype.intersection=function(t){var e=new it;return e.computeIntersection(this.p0,this.p1,t.p0,t.p1),e.hasIntersection()?e.getIntersection(0):null},gn.prototype.project=function(){if(arguments[0]instanceof S){var t=arguments[0];if(t.equals(this.p0)||t.equals(this.p1))return new S(t);var e=this.projectionFactor(t),n=new S;return n.x=this.p0.x+e*(this.p1.x-this.p0.x),n.y=this.p0.y+e*(this.p1.y-this.p0.y),n}if(arguments[0]instanceof gn){var r=arguments[0],i=this.projectionFactor(r.p0),o=this.projectionFactor(r.p1);if(i>=1&&o>=1)return null;if(i<=0&&o<=0)return null;var s=this.project(r.p0);i<0&&(s=this.p0),i>1&&(s=this.p1);var a=this.project(r.p1);return o<0&&(a=this.p0),o>1&&(a=this.p1),new gn(s,a)}},gn.prototype.normalize=function(){this.p1.compareTo(this.p0)<0&&this.reverse()},gn.prototype.angle=function(){return Math.atan2(this.p1.y-this.p0.y,this.p1.x-this.p0.x)},gn.prototype.getCoordinate=function(t){return 0===t?this.p0:this.p1},gn.prototype.distancePerpendicular=function(t){return at.distancePointLinePerpendicular(t,this.p0,this.p1)},gn.prototype.minY=function(){return Math.min(this.p0.y,this.p1.y)},gn.prototype.midPoint=function(){return gn.midPoint(this.p0,this.p1)},gn.prototype.projectionFactor=function(t){if(t.equals(this.p0))return 0;if(t.equals(this.p1))return 1;var e=this.p1.x-this.p0.x,n=this.p1.y-this.p0.y,r=e*e+n*n;return r<=0?m.NaN:((t.x-this.p0.x)*e+(t.y-this.p0.y)*n)/r},gn.prototype.closestPoints=function(t){var e=this.intersection(t);if(null!==e)return[e,e];var n=new Array(2).fill(null),r=m.MAX_VALUE,i=null,o=this.closestPoint(t.p0);r=o.distance(t.p0),n[0]=o,n[1]=t.p0;var s=this.closestPoint(t.p1);(i=s.distance(t.p1))0&&e<1?this.project(t):this.p0.distance(t)1||m.isNaN(e))&&(e=1),e},gn.prototype.toString=function(){return"LINESTRING( "+this.p0.x+" "+this.p0.y+", "+this.p1.x+" "+this.p1.y+")"},gn.prototype.isHorizontal=function(){return this.p0.y===this.p1.y},gn.prototype.distance=function(){if(arguments[0]instanceof gn){var t=arguments[0];return at.distanceLineLine(this.p0,this.p1,t.p0,t.p1)}if(arguments[0]instanceof S){var e=arguments[0];return at.distancePointLine(e,this.p0,this.p1)}},gn.prototype.pointAlong=function(t){var e=new S;return e.x=this.p0.x+t*(this.p1.x-this.p0.x),e.y=this.p0.y+t*(this.p1.y-this.p0.y),e},gn.prototype.hashCode=function(){var t=m.doubleToLongBits(this.p0.x);t^=31*m.doubleToLongBits(this.p0.y);var e=Math.trunc(t)^Math.trunc(t>>32),n=m.doubleToLongBits(this.p1.x);return n^=31*m.doubleToLongBits(this.p1.y),e^Math.trunc(n)^Math.trunc(n>>32)},gn.prototype.interfaces_=function(){return[b,e]},gn.prototype.getClass=function(){return gn},gn.midPoint=function(t,e){return new S((t.x+e.x)/2,(t.y+e.y)/2)},yn.serialVersionUID.get=function(){return 0x2d2172135f411c00},Object.defineProperties(gn,yn);var vn=function(){this.tempEnv1=new q,this.tempEnv2=new q,this._overlapSeg1=new gn,this._overlapSeg2=new gn};vn.prototype.overlap=function(){if(2===arguments.length);else if(4===arguments.length){var t=arguments[1],e=arguments[2],n=arguments[3];arguments[0].getLineSegment(t,this._overlapSeg1),e.getLineSegment(n,this._overlapSeg2),this.overlap(this._overlapSeg1,this._overlapSeg2)}},vn.prototype.interfaces_=function(){return[]},vn.prototype.getClass=function(){return vn};var _n=function(){this._pts=null,this._start=null,this._end=null,this._env=null,this._context=null,this._id=null;var t=arguments[0],e=arguments[1],n=arguments[2],r=arguments[3];this._pts=t,this._start=e,this._end=n,this._context=r};_n.prototype.getLineSegment=function(t,e){e.p0=this._pts[t],e.p1=this._pts[t+1]},_n.prototype.computeSelect=function(t,e,n,r){var i=this._pts[e],o=this._pts[n];if(r.tempEnv1.init(i,o),n-e==1)return r.select(this,e),null;if(!t.intersects(r.tempEnv1))return null;var s=Math.trunc((e+n)/2);e=t.length-1)return t.length-1;for(var r=ze.quadrant(t[n],t[n+1]),i=e+1;in.getId()&&(n.computeOverlaps(i,t),this._nOverlaps++),this._segInt.isDone())return null}},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},n.SegmentOverlapAction.get=function(){return wn},Object.defineProperties(e,n),e}(bn),wn=function(t){function e(){t.call(this),this._si=null;var e=arguments[0];this._si=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.overlap=function(){if(4!==arguments.length)return t.prototype.overlap.apply(this,arguments);var e=arguments[1],n=arguments[2],r=arguments[3],i=arguments[0].getContext(),o=n.getContext();this._si.processIntersections(i,e,o,r)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(vn),Sn=function t(){if(this._quadrantSegments=t.DEFAULT_QUADRANT_SEGMENTS,this._endCapStyle=t.CAP_ROUND,this._joinStyle=t.JOIN_ROUND,this._mitreLimit=t.DEFAULT_MITRE_LIMIT,this._isSingleSided=!1,this._simplifyFactor=t.DEFAULT_SIMPLIFY_FACTOR,0===arguments.length);else if(1===arguments.length){var e=arguments[0];this.setQuadrantSegments(e)}else if(2===arguments.length){var n=arguments[0],r=arguments[1];this.setQuadrantSegments(n),this.setEndCapStyle(r)}else if(4===arguments.length){var i=arguments[0],o=arguments[1],s=arguments[2],a=arguments[3];this.setQuadrantSegments(i),this.setEndCapStyle(o),this.setJoinStyle(s),this.setMitreLimit(a)}},Cn={CAP_ROUND:{configurable:!0},CAP_FLAT:{configurable:!0},CAP_SQUARE:{configurable:!0},JOIN_ROUND:{configurable:!0},JOIN_MITRE:{configurable:!0},JOIN_BEVEL:{configurable:!0},DEFAULT_QUADRANT_SEGMENTS:{configurable:!0},DEFAULT_MITRE_LIMIT:{configurable:!0},DEFAULT_SIMPLIFY_FACTOR:{configurable:!0}};Sn.prototype.getEndCapStyle=function(){return this._endCapStyle},Sn.prototype.isSingleSided=function(){return this._isSingleSided},Sn.prototype.setQuadrantSegments=function(t){this._quadrantSegments=t,0===this._quadrantSegments&&(this._joinStyle=Sn.JOIN_BEVEL),this._quadrantSegments<0&&(this._joinStyle=Sn.JOIN_MITRE,this._mitreLimit=Math.abs(this._quadrantSegments)),t<=0&&(this._quadrantSegments=1),this._joinStyle!==Sn.JOIN_ROUND&&(this._quadrantSegments=Sn.DEFAULT_QUADRANT_SEGMENTS)},Sn.prototype.getJoinStyle=function(){return this._joinStyle},Sn.prototype.setJoinStyle=function(t){this._joinStyle=t},Sn.prototype.setSimplifyFactor=function(t){this._simplifyFactor=t<0?0:t},Sn.prototype.getSimplifyFactor=function(){return this._simplifyFactor},Sn.prototype.getQuadrantSegments=function(){return this._quadrantSegments},Sn.prototype.setEndCapStyle=function(t){this._endCapStyle=t},Sn.prototype.getMitreLimit=function(){return this._mitreLimit},Sn.prototype.setMitreLimit=function(t){this._mitreLimit=t},Sn.prototype.setSingleSided=function(t){this._isSingleSided=t},Sn.prototype.interfaces_=function(){return[]},Sn.prototype.getClass=function(){return Sn},Sn.bufferDistanceError=function(t){var e=Math.PI/2/t;return 1-Math.cos(e/2)},Cn.CAP_ROUND.get=function(){return 1},Cn.CAP_FLAT.get=function(){return 2},Cn.CAP_SQUARE.get=function(){return 3},Cn.JOIN_ROUND.get=function(){return 1},Cn.JOIN_MITRE.get=function(){return 2},Cn.JOIN_BEVEL.get=function(){return 3},Cn.DEFAULT_QUADRANT_SEGMENTS.get=function(){return 8},Cn.DEFAULT_MITRE_LIMIT.get=function(){return 5},Cn.DEFAULT_SIMPLIFY_FACTOR.get=function(){return.01},Object.defineProperties(Sn,Cn);var In=function(t){this._distanceTol=null,this._isDeleted=null,this._angleOrientation=at.COUNTERCLOCKWISE,this._inputLine=t||null},On={INIT:{configurable:!0},DELETE:{configurable:!0},KEEP:{configurable:!0},NUM_PTS_TO_CHECK:{configurable:!0}};In.prototype.isDeletable=function(t,e,n,r){var i=this._inputLine[t],o=this._inputLine[e],s=this._inputLine[n];return!!this.isConcave(i,o,s)&&!!this.isShallow(i,o,s,r)&&this.isShallowSampled(i,o,t,n,r)},In.prototype.deleteShallowConcavities=function(){for(var t=1,e=this.findNextNonDeletedIndex(t),n=this.findNextNonDeletedIndex(e),r=!1;n=0;r--)this.addPt(t[r])},Pn.prototype.isRedundant=function(t){if(this._ptList.size()<1)return!1;var e=this._ptList.get(this._ptList.size()-1);return t.distance(e)Math.PI;)t-=Tn.PI_TIMES_2;for(;t<=-Math.PI;)t+=Tn.PI_TIMES_2;return t},Tn.angle=function(){if(1===arguments.length){var t=arguments[0];return Math.atan2(t.y,t.x)}if(2===arguments.length){var e=arguments[0],n=arguments[1],r=n.x-e.x,i=n.y-e.y;return Math.atan2(i,r)}},Tn.isAcute=function(t,e,n){var r=t.x-e.x,i=t.y-e.y;return r*(n.x-e.x)+i*(n.y-e.y)>0},Tn.isObtuse=function(t,e,n){var r=t.x-e.x,i=t.y-e.y;return r*(n.x-e.x)+i*(n.y-e.y)<0},Tn.interiorAngle=function(t,e,n){var r=Tn.angle(e,t),i=Tn.angle(e,n);return Math.abs(i-r)},Tn.normalizePositive=function(t){if(t<0){for(;t<0;)t+=Tn.PI_TIMES_2;t>=Tn.PI_TIMES_2&&(t=0)}else{for(;t>=Tn.PI_TIMES_2;)t-=Tn.PI_TIMES_2;t<0&&(t=0)}return t},Tn.angleBetween=function(t,e,n){var r=Tn.angle(e,t),i=Tn.angle(e,n);return Tn.diff(r,i)},Tn.diff=function(t,e){var n=null;return(n=tMath.PI&&(n=2*Math.PI-n),n},Tn.toRadians=function(t){return t*Math.PI/180},Tn.getTurn=function(t,e){var n=Math.sin(e-t);return n>0?Tn.COUNTERCLOCKWISE:n<0?Tn.CLOCKWISE:Tn.NONE},Tn.angleBetweenOriented=function(t,e,n){var r=Tn.angle(e,t),i=Tn.angle(e,n)-r;return i<=-Math.PI?i+Tn.PI_TIMES_2:i>Math.PI?i-Tn.PI_TIMES_2:i},Nn.PI_TIMES_2.get=function(){return 2*Math.PI},Nn.PI_OVER_2.get=function(){return Math.PI/2},Nn.PI_OVER_4.get=function(){return Math.PI/4},Nn.COUNTERCLOCKWISE.get=function(){return at.COUNTERCLOCKWISE},Nn.CLOCKWISE.get=function(){return at.CLOCKWISE},Nn.NONE.get=function(){return at.COLLINEAR},Object.defineProperties(Tn,Nn);var Ln=function t(){this._maxCurveSegmentError=0,this._filletAngleQuantum=null,this._closingSegLengthFactor=1,this._segList=null,this._distance=0,this._precisionModel=null,this._bufParams=null,this._li=null,this._s0=null,this._s1=null,this._s2=null,this._seg0=new gn,this._seg1=new gn,this._offset0=new gn,this._offset1=new gn,this._side=0,this._hasNarrowConcaveAngle=!1;var e=arguments[0],n=arguments[1],r=arguments[2];this._precisionModel=e,this._bufParams=n,this._li=new it,this._filletAngleQuantum=Math.PI/2/n.getQuadrantSegments(),n.getQuadrantSegments()>=8&&n.getJoinStyle()===Sn.JOIN_ROUND&&(this._closingSegLengthFactor=t.MAX_CLOSING_SEG_LEN_FACTOR),this.init(r)},Mn={OFFSET_SEGMENT_SEPARATION_FACTOR:{configurable:!0},INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR:{configurable:!0},CURVE_VERTEX_SNAP_DISTANCE_FACTOR:{configurable:!0},MAX_CLOSING_SEG_LEN_FACTOR:{configurable:!0}};Ln.prototype.addNextSegment=function(t,e){if(this._s0=this._s1,this._s1=this._s2,this._s2=t,this._seg0.setCoordinates(this._s0,this._s1),this.computeOffsetSegment(this._seg0,this._side,this._distance,this._offset0),this._seg1.setCoordinates(this._s1,this._s2),this.computeOffsetSegment(this._seg1,this._side,this._distance,this._offset1),this._s1.equals(this._s2))return null;var n=at.computeOrientation(this._s0,this._s1,this._s2),r=n===at.CLOCKWISE&&this._side===Ce.LEFT||n===at.COUNTERCLOCKWISE&&this._side===Ce.RIGHT;0===n?this.addCollinear(e):r?this.addOutsideTurn(n,e):this.addInsideTurn(n,e)},Ln.prototype.addLineEndCap=function(t,e){var n=new gn(t,e),r=new gn;this.computeOffsetSegment(n,Ce.LEFT,this._distance,r);var i=new gn;this.computeOffsetSegment(n,Ce.RIGHT,this._distance,i);var o=e.x-t.x,s=e.y-t.y,a=Math.atan2(s,o);switch(this._bufParams.getEndCapStyle()){case Sn.CAP_ROUND:this._segList.addPt(r.p1),this.addFilletArc(e,a+Math.PI/2,a-Math.PI/2,at.CLOCKWISE,this._distance),this._segList.addPt(i.p1);break;case Sn.CAP_FLAT:this._segList.addPt(r.p1),this._segList.addPt(i.p1);break;case Sn.CAP_SQUARE:var u=new S;u.x=Math.abs(this._distance)*Math.cos(a),u.y=Math.abs(this._distance)*Math.sin(a);var l=new S(r.p1.x+u.x,r.p1.y+u.y),c=new S(i.p1.x+u.x,i.p1.y+u.y);this._segList.addPt(l),this._segList.addPt(c)}},Ln.prototype.getCoordinates=function(){return this._segList.getCoordinates()},Ln.prototype.addMitreJoin=function(t,e,n,r){var i=!0,o=null;try{o=Y.intersection(e.p0,e.p1,n.p0,n.p1),(r<=0?1:o.distance(t)/Math.abs(r))>this._bufParams.getMitreLimit()&&(i=!1)}catch(t){if(!(t instanceof V))throw t;o=new S(0,0),i=!1}i?this._segList.addPt(o):this.addLimitedMitreJoin(e,n,r,this._bufParams.getMitreLimit())},Ln.prototype.addFilletCorner=function(t,e,n,r,i){var o=e.x-t.x,s=e.y-t.y,a=Math.atan2(s,o),u=n.x-t.x,l=n.y-t.y,c=Math.atan2(l,u);r===at.CLOCKWISE?a<=c&&(a+=2*Math.PI):a>=c&&(a-=2*Math.PI),this._segList.addPt(e),this.addFilletArc(t,a,c,r,i),this._segList.addPt(n)},Ln.prototype.addOutsideTurn=function(t,e){if(this._offset0.p1.distance(this._offset1.p0)0){var n=new S((this._closingSegLengthFactor*this._offset0.p1.x+this._s1.x)/(this._closingSegLengthFactor+1),(this._closingSegLengthFactor*this._offset0.p1.y+this._s1.y)/(this._closingSegLengthFactor+1));this._segList.addPt(n);var r=new S((this._closingSegLengthFactor*this._offset1.p0.x+this._s1.x)/(this._closingSegLengthFactor+1),(this._closingSegLengthFactor*this._offset1.p0.y+this._s1.y)/(this._closingSegLengthFactor+1));this._segList.addPt(r)}else this._segList.addPt(this._s1);this._segList.addPt(this._offset1.p0)}},Ln.prototype.createCircle=function(t){var e=new S(t.x+this._distance,t.y);this._segList.addPt(e),this.addFilletArc(t,0,2*Math.PI,-1,this._distance),this._segList.closeRing()},Ln.prototype.addBevelJoin=function(t,e){this._segList.addPt(t.p1),this._segList.addPt(e.p0)},Ln.prototype.init=function(t){this._distance=t,this._maxCurveSegmentError=t*(1-Math.cos(this._filletAngleQuantum/2)),this._segList=new Pn,this._segList.setPrecisionModel(this._precisionModel),this._segList.setMinimumVertexDistance(t*Ln.CURVE_VERTEX_SNAP_DISTANCE_FACTOR)},Ln.prototype.addCollinear=function(t){this._li.computeIntersection(this._s0,this._s1,this._s1,this._s2),this._li.getIntersectionNum()>=2&&(this._bufParams.getJoinStyle()===Sn.JOIN_BEVEL||this._bufParams.getJoinStyle()===Sn.JOIN_MITRE?(t&&this._segList.addPt(this._offset0.p1),this._segList.addPt(this._offset1.p0)):this.addFilletCorner(this._s1,this._offset0.p1,this._offset1.p0,at.CLOCKWISE,this._distance))},Ln.prototype.closeRing=function(){this._segList.closeRing()},Ln.prototype.hasNarrowConcaveAngle=function(){return this._hasNarrowConcaveAngle},Ln.prototype.interfaces_=function(){return[]},Ln.prototype.getClass=function(){return Ln},Mn.OFFSET_SEGMENT_SEPARATION_FACTOR.get=function(){return.001},Mn.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return.001},Mn.CURVE_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return 1e-6},Mn.MAX_CLOSING_SEG_LEN_FACTOR.get=function(){return 80},Object.defineProperties(Ln,Mn);var An=function(){this._distance=0,this._precisionModel=null,this._bufParams=null;var t=arguments[0],e=arguments[1];this._precisionModel=t,this._bufParams=e};An.prototype.getOffsetCurve=function(t,e){if(this._distance=e,0===e)return null;var n=e<0,r=Math.abs(e),i=this.getSegGen(r);t.length<=1?this.computePointCurve(t[0],i):this.computeOffsetCurve(t,n,i);var o=i.getCoordinates();return n&&It.reverse(o),o},An.prototype.computeSingleSidedBufferCurve=function(t,e,n){var r=this.simplifyTolerance(this._distance);if(e){n.addSegments(t,!0);var i=In.simplify(t,-r),o=i.length-1;n.initSideSegments(i[o],i[o-1],Ce.LEFT),n.addFirstSegment();for(var s=o-2;s>=0;s--)n.addNextSegment(i[s],!0)}else{n.addSegments(t,!1);var a=In.simplify(t,r),u=a.length-1;n.initSideSegments(a[0],a[1],Ce.LEFT),n.addFirstSegment();for(var l=2;l<=u;l++)n.addNextSegment(a[l],!0)}n.addLastSegment(),n.closeRing()},An.prototype.computeRingBufferCurve=function(t,e,n){var r=this.simplifyTolerance(this._distance);e===Ce.RIGHT&&(r=-r);var i=In.simplify(t,r),o=i.length-1;n.initSideSegments(i[o-1],i[0],e);for(var s=1;s<=o;s++){var a=1!==s;n.addNextSegment(i[s],a)}n.closeRing()},An.prototype.computeLineBufferCurve=function(t,e){var n=this.simplifyTolerance(this._distance),r=In.simplify(t,n),i=r.length-1;e.initSideSegments(r[0],r[1],Ce.LEFT);for(var o=2;o<=i;o++)e.addNextSegment(r[o],!0);e.addLastSegment(),e.addLineEndCap(r[i-1],r[i]);var s=In.simplify(t,-n),a=s.length-1;e.initSideSegments(s[a],s[a-1],Ce.LEFT);for(var u=a-2;u>=0;u--)e.addNextSegment(s[u],!0);e.addLastSegment(),e.addLineEndCap(s[1],s[0]),e.closeRing()},An.prototype.computePointCurve=function(t,e){switch(this._bufParams.getEndCapStyle()){case Sn.CAP_ROUND:e.createCircle(t);break;case Sn.CAP_SQUARE:e.createSquare(t)}},An.prototype.getLineCurve=function(t,e){if(this._distance=e,e<0&&!this._bufParams.isSingleSided())return null;if(0===e)return null;var n=Math.abs(e),r=this.getSegGen(n);if(t.length<=1)this.computePointCurve(t[0],r);else if(this._bufParams.isSingleSided()){var i=e<0;this.computeSingleSidedBufferCurve(t,i,r)}else this.computeLineBufferCurve(t,r);return r.getCoordinates()},An.prototype.getBufferParameters=function(){return this._bufParams},An.prototype.simplifyTolerance=function(t){return t*this._bufParams.getSimplifyFactor()},An.prototype.getRingCurve=function(t,e,n){if(this._distance=n,t.length<=2)return this.getLineCurve(t,n);if(0===n)return An.copyCoordinates(t);var r=this.getSegGen(n);return this.computeRingBufferCurve(t,e,r),r.getCoordinates()},An.prototype.computeOffsetCurve=function(t,e,n){var r=this.simplifyTolerance(this._distance);if(e){var i=In.simplify(t,-r),o=i.length-1;n.initSideSegments(i[o],i[o-1],Ce.LEFT),n.addFirstSegment();for(var s=o-2;s>=0;s--)n.addNextSegment(i[s],!0)}else{var a=In.simplify(t,r),u=a.length-1;n.initSideSegments(a[0],a[1],Ce.LEFT),n.addFirstSegment();for(var l=2;l<=u;l++)n.addNextSegment(a[l],!0)}n.addLastSegment()},An.prototype.getSegGen=function(t){return new Ln(this._precisionModel,this._bufParams,t)},An.prototype.interfaces_=function(){return[]},An.prototype.getClass=function(){return An},An.copyCoordinates=function(t){for(var e=new Array(t.length).fill(null),n=0;ni.getMaxY()||this.findStabbedSegments(t,r.getDirectedEdges(),e)}return e}if(3===arguments.length)if(T(arguments[2],Et)&&arguments[0]instanceof S&&arguments[1]instanceof Ue){for(var o=arguments[0],s=arguments[1],a=arguments[2],u=s.getEdge().getCoordinates(),l=0;lthis._seg.p1.y&&this._seg.reverse(),!(Math.max(this._seg.p0.x,this._seg.p1.x)this._seg.p1.y||at.computeOrientation(this._seg.p0,this._seg.p1,o)===at.RIGHT)){var c=s.getDepth(Ce.LEFT);this._seg.p0.equals(u[l])||(c=s.getDepth(Ce.RIGHT));var h=new Fn(this._seg,c);a.add(h)}}else if(T(arguments[2],Et)&&arguments[0]instanceof S&&T(arguments[1],Et))for(var p=arguments[0],f=arguments[2],d=arguments[1].iterator();d.hasNext();){var g=d.next();g.isForward()&&this.findStabbedSegments(p,g,f)}},kn.prototype.getDepth=function(t){var e=this.findStabbedSegments(t);return 0===e.size()?0:Qe.min(e)._leftDepth},kn.prototype.interfaces_=function(){return[]},kn.prototype.getClass=function(){return kn},Dn.DepthSegment.get=function(){return Fn},Object.defineProperties(kn,Dn);var Fn=function(){this._upwardSeg=null,this._leftDepth=null;var t=arguments[0],e=arguments[1];this._upwardSeg=new gn(t),this._leftDepth=e};Fn.prototype.compareTo=function(t){var e=t;if(this._upwardSeg.minX()>=e._upwardSeg.maxX())return 1;if(this._upwardSeg.maxX()<=e._upwardSeg.minX())return-1;var n=this._upwardSeg.orientationIndex(e._upwardSeg);return 0!==n||0!=(n=-1*e._upwardSeg.orientationIndex(this._upwardSeg))?n:this._upwardSeg.compareTo(e._upwardSeg)},Fn.prototype.compareX=function(t,e){var n=t.p0.compareTo(e.p0);return 0!==n?n:t.p1.compareTo(e.p1)},Fn.prototype.toString=function(){return this._upwardSeg.toString()},Fn.prototype.interfaces_=function(){return[b]},Fn.prototype.getClass=function(){return Fn};var jn=function(t,e,n){this.p0=t||null,this.p1=e||null,this.p2=n||null};jn.prototype.area=function(){return jn.area(this.p0,this.p1,this.p2)},jn.prototype.signedArea=function(){return jn.signedArea(this.p0,this.p1,this.p2)},jn.prototype.interpolateZ=function(t){if(null===t)throw new _("Supplied point is null.");return jn.interpolateZ(t,this.p0,this.p1,this.p2)},jn.prototype.longestSideLength=function(){return jn.longestSideLength(this.p0,this.p1,this.p2)},jn.prototype.isAcute=function(){return jn.isAcute(this.p0,this.p1,this.p2)},jn.prototype.circumcentre=function(){return jn.circumcentre(this.p0,this.p1,this.p2)},jn.prototype.area3D=function(){return jn.area3D(this.p0,this.p1,this.p2)},jn.prototype.centroid=function(){return jn.centroid(this.p0,this.p1,this.p2)},jn.prototype.inCentre=function(){return jn.inCentre(this.p0,this.p1,this.p2)},jn.prototype.interfaces_=function(){return[]},jn.prototype.getClass=function(){return jn},jn.area=function(t,e,n){return Math.abs(((n.x-t.x)*(e.y-t.y)-(e.x-t.x)*(n.y-t.y))/2)},jn.signedArea=function(t,e,n){return((n.x-t.x)*(e.y-t.y)-(e.x-t.x)*(n.y-t.y))/2},jn.det=function(t,e,n,r){return t*r-e*n},jn.interpolateZ=function(t,e,n,r){var i=e.x,o=e.y,s=n.x-i,a=r.x-i,u=n.y-o,l=r.y-o,c=s*l-a*u,h=t.x-i,p=t.y-o,f=(l*h-a*p)/c,d=(-u*h+s*p)/c;return e.z+f*(n.z-e.z)+d*(r.z-e.z)},jn.longestSideLength=function(t,e,n){var r=t.distance(e),i=e.distance(n),o=n.distance(t),s=r;return i>s&&(s=i),o>s&&(s=o),s},jn.isAcute=function(t,e,n){return!!Tn.isAcute(t,e,n)&&!!Tn.isAcute(e,n,t)&&!!Tn.isAcute(n,t,e)},jn.circumcentre=function(t,e,n){var r=n.x,i=n.y,o=t.x-r,s=t.y-i,a=e.x-r,u=e.y-i,l=2*jn.det(o,s,a,u),c=jn.det(s,o*o+s*s,u,a*a+u*u),h=jn.det(o,o*o+s*s,a,a*a+u*u);return new S(r-c/l,i+h/l)},jn.perpendicularBisector=function(t,e){var n=e.x-t.x,r=e.y-t.y,i=new Y(t.x+n/2,t.y+r/2,1),o=new Y(t.x-r+n/2,t.y+n+r/2,1);return new Y(i,o)},jn.angleBisector=function(t,e,n){var r=e.distance(t),i=r/(r+e.distance(n)),o=n.x-t.x,s=n.y-t.y;return new S(t.x+i*o,t.y+i*s)},jn.area3D=function(t,e,n){var r=e.x-t.x,i=e.y-t.y,o=e.z-t.z,s=n.x-t.x,a=n.y-t.y,u=n.z-t.z,l=i*u-o*a,c=o*s-r*u,h=r*a-i*s,p=l*l+c*c+h*h;return Math.sqrt(p)/2},jn.centroid=function(t,e,n){var r=(t.x+e.x+n.x)/3,i=(t.y+e.y+n.y)/3;return new S(r,i)},jn.inCentre=function(t,e,n){var r=e.distance(n),i=t.distance(n),o=t.distance(e),s=r+i+o,a=(r*t.x+i*e.x+o*n.x)/s,u=(r*t.y+i*e.y+o*n.y)/s;return new S(a,u)};var zn=function(){this._inputGeom=null,this._distance=null,this._curveBuilder=null,this._curveList=new wt;var t=arguments[0],e=arguments[1],n=arguments[2];this._inputGeom=t,this._distance=e,this._curveBuilder=n};zn.prototype.addPoint=function(t){if(this._distance<=0)return null;var e=t.getCoordinates(),n=this._curveBuilder.getLineCurve(e,this._distance);this.addCurve(n,P.EXTERIOR,P.INTERIOR)},zn.prototype.addPolygon=function(t){var e=this._distance,n=Ce.LEFT;this._distance<0&&(e=-this._distance,n=Ce.RIGHT);var r=t.getExteriorRing(),i=It.removeRepeatedPoints(r.getCoordinates());if(this._distance<0&&this.isErodedCompletely(r,this._distance))return null;if(this._distance<=0&&i.length<3)return null;this.addPolygonRing(i,e,n,P.EXTERIOR,P.INTERIOR);for(var o=0;o0&&this.isErodedCompletely(s,-this._distance)||this.addPolygonRing(a,e,Ce.opposite(n),P.INTERIOR,P.EXTERIOR)}},zn.prototype.isTriangleErodedCompletely=function(t,e){var n=new jn(t[0],t[1],t[2]),r=n.inCentre();return at.distancePointLine(r,n.p0,n.p1)=ee.MINIMUM_VALID_SIZE&&at.isCCW(t)&&(o=i,s=r,n=Ce.opposite(n));var a=this._curveBuilder.getRingCurve(t,n,e);this.addCurve(a,o,s)},zn.prototype.add=function(t){if(t.isEmpty())return null;t instanceof Qt?this.addPolygon(t):t instanceof Kt?this.addLineString(t):t instanceof $t?this.addPoint(t):(t instanceof te||t instanceof Vt||t instanceof ne||t instanceof Ut)&&this.addCollection(t)},zn.prototype.isErodedCompletely=function(t,e){var n=t.getCoordinates();if(n.length<4)return e<0;if(4===n.length)return this.isTriangleErodedCompletely(n,e);var r=t.getEnvelopeInternal(),i=Math.min(r.getHeight(),r.getWidth());return e<0&&2*Math.abs(e)>i},zn.prototype.addCollection=function(t){for(var e=0;e=this._max)throw new r;var t=this._parent.getGeometryN(this._index++);return t instanceof Ut?(this._subcollectionIterator=new Bn(t),this._subcollectionIterator.next()):t},Bn.prototype.remove=function(){throw new Error(this.getClass().getName())},Bn.prototype.hasNext=function(){if(this._atStart)return!0;if(null!==this._subcollectionIterator){if(this._subcollectionIterator.hasNext())return!0;this._subcollectionIterator=null}return!(this._index>=this._max)},Bn.prototype.interfaces_=function(){return[bt]},Bn.prototype.getClass=function(){return Bn},Bn.isAtomic=function(t){return!(t instanceof Ut)};var Un=function(){this._geom=null;var t=arguments[0];this._geom=t};Un.prototype.locate=function(t){return Un.locate(t,this._geom)},Un.prototype.interfaces_=function(){return[Gn]},Un.prototype.getClass=function(){return Un},Un.isPointInRing=function(t,e){return!!e.getEnvelopeInternal().intersects(t)&&at.isPointInRing(t,e.getCoordinates())},Un.containsPointInPolygon=function(t,e){if(e.isEmpty())return!1;var n=e.getExteriorRing();if(!Un.isPointInRing(t,n))return!1;for(var r=0;r=0;n--){var r=this._edgeList.get(n),i=r.getSym();null===e&&(e=i),null!==t&&i.setNext(t),t=r}e.setNext(t)},e.prototype.computeDepths=function(){if(1===arguments.length){var t=arguments[0],e=this.findIndex(t),n=t.getDepth(Ce.LEFT),r=t.getDepth(Ce.RIGHT),i=this.computeDepths(e+1,this._edgeList.size(),n);if(this.computeDepths(0,e,i)!==r)throw new Pe("depth mismatch at "+t.getCoordinate())}else if(3===arguments.length){for(var o=arguments[1],s=arguments[2],a=arguments[0];a=0;i--){var o=this._resultAreaEdgeList.get(i),s=o.getSym();switch(null===e&&o.getEdgeRing()===t&&(e=o),r){case this._SCANNING_FOR_INCOMING:if(s.getEdgeRing()!==t)continue;n=s,r=this._LINKING_TO_OUTGOING;break;case this._LINKING_TO_OUTGOING:if(o.getEdgeRing()!==t)continue;n.setNextMin(o),r=this._SCANNING_FOR_INCOMING}}r===this._LINKING_TO_OUTGOING&&(et.isTrue(null!==e,"found null for first outgoing dirEdge"),et.isTrue(e.getEdgeRing()===t,"unable to link last incoming dirEdge"),n.setNextMin(e))},e.prototype.getOutgoingDegree=function(){if(0===arguments.length){for(var t=0,e=this.iterator();e.hasNext();)e.next().isInResult()&&t++;return t}if(1===arguments.length){for(var n=arguments[0],r=0,i=this.iterator();i.hasNext();)i.next().getEdgeRing()===n&&r++;return r}},e.prototype.getLabel=function(){return this._label},e.prototype.findCoveredLineEdges=function(){for(var t=P.NONE,e=this.iterator();e.hasNext();){var n=e.next(),r=n.getSym();if(!n.isLineEdge()){if(n.isInResult()){t=P.INTERIOR;break}if(r.isInResult()){t=P.EXTERIOR;break}}}if(t===P.NONE)return null;for(var i=t,o=this.iterator();o.hasNext();){var s=o.next(),a=s.getSym();s.isLineEdge()?s.getEdge().setCovered(i===P.INTERIOR):(s.isInResult()&&(i=P.EXTERIOR),a.isInResult()&&(i=P.INTERIOR))}},e.prototype.computeLabelling=function(e){t.prototype.computeLabelling.call(this,e),this._label=new Le(P.NONE);for(var n=this.iterator();n.hasNext();)for(var r=n.next().getEdge().getLabel(),i=0;i<2;i++){var o=r.getLocation(i);o!==P.INTERIOR&&o!==P.BOUNDARY||this._label.setLocation(i,P.INTERIOR)}},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Vn),Yn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createNode=function(t){return new Fe(t,new Xn)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Ve),qn=function t(){this._pts=null,this._orientation=null;var e=arguments[0];this._pts=e,this._orientation=t.orientation(e)};qn.prototype.compareTo=function(t){var e=t;return qn.compareOriented(this._pts,this._orientation,e._pts,e._orientation)},qn.prototype.interfaces_=function(){return[b]},qn.prototype.getClass=function(){return qn},qn.orientation=function(t){return 1===It.increasingDirection(t)},qn.compareOriented=function(t,e,n,r){for(var i=e?1:-1,o=r?1:-1,s=e?t.length:-1,a=r?n.length:-1,u=e?0:t.length-1,l=r?0:n.length-1;;){var c=t[u].compareTo(n[l]);if(0!==c)return c;var h=(u+=i)===s,p=(l+=o)===a;if(h&&!p)return-1;if(!h&&p)return 1;if(h&&p)return 0}};var Wn=function(){this._edges=new wt,this._ocaMap=new h};Wn.prototype.print=function(t){t.print("MULTILINESTRING ( ");for(var e=0;e0&&t.print(","),t.print("(");for(var r=n.getCoordinates(),i=0;i0&&t.print(","),t.print(r[i].x+" "+r[i].y);t.println(")")}t.print(") ")},Wn.prototype.addAll=function(t){for(var e=t.iterator();e.hasNext();)this.add(e.next())},Wn.prototype.findEdgeIndex=function(t){for(var e=0;e0||!e.coord.equals2D(r);i||n--;var o=new Array(n).fill(null),s=0;o[s++]=new S(t.coord);for(var a=t.segmentIndex+1;a<=e.segmentIndex;a++)o[s++]=this.edge.pts[a];return i&&(o[s]=e.coord),new nr(o,new Le(this.edge._label))},$n.prototype.add=function(t,e,n){var r=new Zn(t,e,n),i=this._nodeMap.get(r);return null!==i?i:(this._nodeMap.put(r,r),r)},$n.prototype.isIntersection=function(t){for(var e=this.iterator();e.hasNext();)if(e.next().coord.equals(t))return!0;return!1},$n.prototype.interfaces_=function(){return[]},$n.prototype.getClass=function(){return $n};var Jn=function(){};Jn.prototype.getChainStartIndices=function(t){var e=0,n=new wt;n.add(new A(e));do{var r=this.findChainEnd(t,e);n.add(new A(r)),e=r}while(en?e:n},Qn.prototype.getMinX=function(t){var e=this.pts[this.startIndex[t]].x,n=this.pts[this.startIndex[t+1]].x;return ee&&(r=1),this._depth[t][n]=r}}},tr.prototype.getDelta=function(t){return this._depth[t][Ce.RIGHT]-this._depth[t][Ce.LEFT]},tr.prototype.getLocation=function(t,e){return this._depth[t][e]<=0?P.EXTERIOR:P.INTERIOR},tr.prototype.toString=function(){return"A: "+this._depth[0][1]+","+this._depth[0][2]+" B: "+this._depth[1][1]+","+this._depth[1][2]},tr.prototype.add=function(){if(1===arguments.length)for(var t=arguments[0],e=0;e<2;e++)for(var n=1;n<3;n++){var r=t.getLocation(e,n);r!==P.EXTERIOR&&r!==P.INTERIOR||(this.isNull(e,n)?this._depth[e][n]=tr.depthAtLocation(r):this._depth[e][n]+=tr.depthAtLocation(r))}else if(3===arguments.length){var i=arguments[0],o=arguments[1];arguments[2]===P.INTERIOR&&this._depth[i][o]++}},tr.prototype.interfaces_=function(){return[]},tr.prototype.getClass=function(){return tr},tr.depthAtLocation=function(t){return t===P.EXTERIOR?0:t===P.INTERIOR?1:tr.NULL_VALUE},er.NULL_VALUE.get=function(){return-1},Object.defineProperties(tr,er);var nr=function(t){function e(){if(t.call(this),this.pts=null,this._env=null,this.eiList=new $n(this),this._name=null,this._mce=null,this._isIsolated=!0,this._depth=new tr,this._depthDelta=0,1===arguments.length){var n=arguments[0];e.call(this,n,null)}else if(2===arguments.length){var r=arguments[0],i=arguments[1];this.pts=r,this._label=i}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDepth=function(){return this._depth},e.prototype.getCollapsedEdge=function(){var t=new Array(2).fill(null);return t[0]=this.pts[0],t[1]=this.pts[1],new e(t,Le.toLineLabel(this._label))},e.prototype.isIsolated=function(){return this._isIsolated},e.prototype.getCoordinates=function(){return this.pts},e.prototype.setIsolated=function(t){this._isIsolated=t},e.prototype.setName=function(t){this._name=t},e.prototype.equals=function(t){if(!(t instanceof e))return!1;var n=t;if(this.pts.length!==n.pts.length)return!1;for(var r=!0,i=!0,o=this.pts.length,s=0;s0?this.pts[0]:null;if(1===arguments.length){var t=arguments[0];return this.pts[t]}},e.prototype.print=function(t){t.print("edge "+this._name+": "),t.print("LINESTRING (");for(var e=0;e