From e5d4bc1fa5dd9ab789a3b72bc798b678f9e84022 Mon Sep 17 00:00:00 2001 From: Edgar Montes <jedgar1mx@gmail.com> Date: Fri, 11 Oct 2024 12:38:37 -0400 Subject: [PATCH] Adding East Canfield to the CDBG sewer repair program. --- build/assets/js/main.js | 2 +- build/assets/js/main.js.map | 2 +- build/assets/js/runtime.js | 2 +- build/assets/js/vendors.sentry-internal.js | 2 +- build/assets/js/vendors.sentry.js | 2 +- build/assets/js/vendors.terraformer-arcgis-parser.js | 2 +- build/assets/js/vendors.terraformer.js | 2 +- build/assets/js/vendors.turf.js | 2 +- src/components/Display.js | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/build/assets/js/main.js b/build/assets/js/main.js index 9e60aa7..e5ffd3c 100644 --- a/build/assets/js/main.js +++ b/build/assets/js/main.js @@ -1,2 +1,2 @@ -!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},t=(new Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="483cfd92-0be5-4657-9f6d-fe7647bf04cb",e._sentryDebugIdIdentifier="sentry-dbid-483cfd92-0be5-4657-9f6d-fe7647bf04cb")}catch(e){}}();var _global="undefined"!==typeof window?window:"undefined"!==typeof global?global:"undefined"!==typeof self?self:{};_global.SENTRY_RELEASE={id:"b15ccfdbc7e26696234f56eb8df3a6b3a27a7fd6"},(self.webpackChunklocal_services_lookup=self.webpackChunklocal_services_lookup||[]).push([[179],{2789:(e,t,a)=>{class r extends HTMLElement{static get observedAttributes(){return["form","parcelStatus","user"]}constructor(){super(),this.form=null,this.parcelStatus="Invalid",this.user=null,this.styles=document.createElement("style"),this.styles.textContent="\n @import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@100;700&display=swap')\n #geocoder {width: 100%}\n input {width: calc(100% - 2em); padding: 1em; border:.1em solid #e6e6e6; font-size: 1em;}\n ";const e=this.attachShadow({mode:"open"});e.appendChild(this.styles);const t=document.createElement("article");t.id="geocoder";let a=document.createElement("form"),r=document.createElement("label");r.style.fontFamily="Montserrat, sans-serif",r.style.fontWeight="bold";let n=document.createElement("input"),i=(document.createElement("ul"),document.createElement("datalist")),s=document.createElement("i");a.addEventListener("submit",(e=>{this.submit(e,this)})),s.className="fas fa-map-marker-alt";const o=document.getElementsByTagName("my-home-info");r.innerText="Property Address:";try{o[0].getAttribute("data-geocoder-label")&&""!=o[0].getAttribute("data-geocoder-label")&&(r.innerText=o[0].getAttribute("data-geocoder-label"))}catch(l){}r.setAttribute("for","geocoder-input"),n.type="text",n.setAttribute("list","addresses-list"),n.placeholder="Enter address",n.setAttribute("id","geocoder-input"),n.setAttribute("autocomplete","off"),n.addEventListener("keyup",(e=>{this.inputChange(e,this)})),i.setAttribute("id","addresses-list"),a.appendChild(r),a.appendChild(n),a.appendChild(s),a.appendChild(i),this.form=a,t.appendChild(a),e.appendChild(t)}supplementGeocoder(e,t,a){const r=document.getElementsByTagName("my-home-info");let n=e.split(",");n=n[0],n=n.split(" ");let i="",s=n.length;n.forEach((function(e,t){i+=e,t<s&&t+1!==s&&(i+="+")}));let o=`https://opengis.detroitmi.gov/opengis/rest/services/BaseUnits/BaseUnitGeocoder/GeocodeServer/findAddressCandidates?Address=&Address2=&Address3=&Neighborhood=&City=&Subregion=&Region=&Postal=&PostalExt=&CountryCode=&SingleLine=${i}&outFields=*&maxLocations=&matchOutOfRange=true&langCode=&locationType=&sourceCountry=&category=&location=&distance=&searchExtent=&outSR=&magicKey=&f=json`;try{fetch(o).then((e=>e.json())).then((function(n){if("suggestions"===a)n.candidates.forEach((e=>{let a=document.createElement("option");""===e.attributes.parcel_id?(a.value=e.address,a.setAttribute("data-parsel","no-parcel")):(a.value=`${e.address} RECOMMENDED`,a.setAttribute("data-parsel",e.attributes.parcel_id)),a.onclick=e=>{t.selectSuggestion(e,t)},t.form.childNodes[3].appendChild(a)}));else if(n.candidates.length){let a=`https://services2.arcgis.com/qvkbeam7Wirps6zC/arcgis/rest/services/City_of_Detroit_Boundary/FeatureServer/0/query?where=&objectIds=&time=&geometry=${n.candidates[0].location.x}%2C+${n.candidates[0].location.y}&geometryType=esriGeometryPoint&inSR=4326&spatialRel=esriSpatialRelIntersects&resultType=none&distance=0.0&units=esriSRUnit_Meter&returnGeodetic=false&outFields=4326&returnGeometry=true&returnCentroid=false&multipatchOption=xyFootprint&maxAllowableOffset=&geometryPrecision=&outSR=&datumTransformation=&applyVCSProjection=false&returnIdsOnly=false&returnUniqueIdsOnly=false&returnCountOnly=false&returnExtentOnly=false&returnDistinctValues=false&orderByFields=&groupByFieldsForStatistics=&outStatistics=&having=&resultOffset=&resultRecordCount=&returnZ=false&returnM=false&returnExceededLimitFeatures=true&quantizationParameters=&sqlFormat=none&f=geojson&token=`;try{fetch(a).then((e=>e.json())).then((function(a){if(a.features.length){let a,i=null;n.candidates.forEach((e=>{""!==e.attributes.parcel_id&&t.checkParcelValid(e.attributes.parcel_id)&&(i=e)})),a=null==i?n.candidates[0].location:null,null===i?(t.parcelStatus="Invalid",t.needGeocode(e,t,a),t.clearSuggestions(t),r[0].setAttribute("data-parcel-id",JSON.stringify(n.candidates[0]))):(t.parcelStatus="Valid",t.needGeocode(e,t,a),t.clearSuggestions(t),r[0].setAttribute("data-parcel-id",JSON.stringify(i)))}else t.parcelStatus="Invalid",t.needGeocode(e,t,location),t.clearSuggestions(t),r[0].setAttribute("data-app-state","error")}))}catch(i){t.parcelStatus="Invalid",t.needGeocode(e,t,location),t.clearSuggestions(t),r[0].setAttribute("data-app-state","error")}}else t.parcelStatus="Invalid",t.needGeocode(e,t,location),t.clearSuggestions(t),r[0].setAttribute("data-app-state","error")}))}catch(l){t.parcelStatus="Invalid",t.needGeocode(e,t,location),t.clearSuggestions(t),r[0].setAttribute("data-app-state","error")}}selectSuggestion(e,t){let a=null;a="SPAN"===e.target.tagName?e.target.parentNode:e.target,"no-parcel"===a.attributes[0].value?(t.clearSuggestions(t),t.supplementGeocoder(a.innerText,t,"submit")):t.supplementGeocoder(a.innerText,t,"submit")}inputChange(e,t){switch(e.key){case"Enter":""!=e.target.value&&void 0!=e.target.value&&t.supplementGeocoder(e.target.value,t,"submit");break;case"ArrowDown":case"ArrowUp":case"ArrowRight":case"ArrowLeft":break;case void 0:""!=e.target.value&&void 0!=e.target.value&&t.supplementGeocoder(e.target.value,t,"submit");break;default:t.clearSuggestions(t),t.supplementGeocoder(e.target.value,t,"suggestions")}}clearSuggestions(e){for(;e.form.childNodes[3].firstChild;)e.form.childNodes[3].removeChild(e.form.childNodes[3].firstChild)}needGeocode(e,t,a){fetch("https://us-central1-local-services-loopkup.cloudfunctions.net/getToken").then((e=>e.json())).then((function(r){let n=e.split(" RECOMMENDED")[0],i=[{attributes:{valid_parcel_status:t.parcelStatus,user_input:n},geometry:{x:0,y:0}}];null!=a&&(i[0].geometry.x=a.x,i[0].geometry.y=a.y);let s=new Request(`https://services2.arcgis.com/qvkbeam7Wirps6zC/ArcGIS/rest/services/addressvalidator/FeatureServer/0/addFeatures?token=${r.access_token}&features=${encodeURIComponent(JSON.stringify(i))}&f=json`,{method:"POST",body:"",headers:new Headers,mode:"cors",cache:"default"});fetch(s).then((e=>{}))}))}checkParcelValid(e){return/\d/.test(e)}submit(e,t){e.preventDefault(),t.supplementGeocoder(e.target[0].value,t,"submit")}}class n extends HTMLElement{constructor(){super();this.attachShadow({mode:"open"});this.navToolsStyle=document.createElement("style"),this.navToolsStyle.textContent="\n #nav-tools-wrapper { display: flex; flex-direction: column;}\n button.clear { font-size: 1.25em; width: 2.5em; height: 2.5em; background-color: #FEB70D; cursor: pointer; border: none; }\n button.nav { width: 3.75em; height: 3.75em; border: none; cursor: pointer;background: #fff; }\n button.nav:hover { background-color: #e6e6e6; transition: all 500ms cubic-bezier(.64,.09,.08,1); }\n button.nav.active { background-color: #9fd5b3; }\n button.nav img { width: 100%; }\n ",this.loadNavTools(this)}clearDisplay(e){const t=e.shadowRoot;for(;t.firstChild;)t.removeChild(t.firstChild)}loadNavTools(e){const t=document.getElementsByTagName("my-home-info"),a=t[0].getAttribute("data-app-state"),r=t[0].getAttribute("data-app-mode"),n=t[0].getAttribute("data-inital-sets"),i=t[0].getAttribute("data-initial-map-available"),s=e.shadowRoot;s.appendChild(e.navToolsStyle);const o=document.createElement("section");o.id="nav-tools-wrapper",o.setAttribute("role","navigation"),o.setAttribute("aria-label","Data Navigation");const l=document.createElement("cod-button");if(l.addEventListener("click",(e=>{"my-home-info"==t[0].getAttribute("data-app-mode")?(t[0].setAttribute("data-app-state","welcome-screen"),t[0].setAttribute("data-active-sets","assessors-data,neighborhood,recycling,rental-data,rental-cert,demo-status,blight-data,permit-data,DWSDBackupProtection")):(t[0].setAttribute("data-app-state","active-screen"),t[0].setAttribute("data-active-sets",n)),"true"==i?t[0].setAttribute("data-map-available","true"):t[0].setAttribute("data-map-available","false"),t[0].setAttribute("data-parcel-id","none"),t[0].setAttribute("data-api-stored-datasets","{}"),t[0].setAttribute("data-api-active-datasets","none"),t[0].setAttribute("data-active-section","property")})),l.setAttribute("data-primary",!0),l.setAttribute("data-label","x"),l.setAttribute("data-size","lg"),l.setAttribute("data-hover",!1),l.setAttribute("data-extra-classes","fw-bold"),l.setAttribute("data-background-color","warning"),l.setAttribute("data-img",""),l.setAttribute("data-img-alt",""),l.setAttribute("data-shape","square"),l.setAttribute("data-icon",""),o.appendChild(l),"my-home-info"==r&&"error"!=a){const e=document.createElement("cod-button");e.setAttribute("data-label",""),e.setAttribute("data-size","lg"),e.setAttribute("data-img","https://detroitmi.gov/sites/detroitmi.localhost/files/2023-01/home.png"),e.setAttribute("data-img-alt","about this property"),e.setAttribute("data-shape","square"),e.setAttribute("data-nav-value","about this property"),e.setAttribute("data-icon",""),"about this property"==t[0].getAttribute("data-active-section")?(e.setAttribute("data-background-color","success"),e.setAttribute("data-primary",!0)):(e.setAttribute("data-background-color","secondary"),e.setAttribute("data-primary",!1),e.addEventListener("click",(e=>{if("none"!=t[0].getAttribute("data-api-active-datasets")){let e=JSON.parse(t[0].getAttribute("data-api-stored-datasets")),a=JSON.parse(t[0].getAttribute("data-api-active-datasets"));for(const t in a)t in e||(e[t]=a[t]);t[0].setAttribute("data-api-stored-datasets",JSON.stringify(e))}t[0].setAttribute("data-api-active-datasets","none"),t[0].setAttribute("data-active-sets","assessors-data,neighborhood,recycling,rental-data,rental-cert,demo-status,blight-data,permit-data,DWSDBackupProtection"),t[0].setAttribute("data-map-available","false"),t[0].setAttribute("data-active-section","about this property"),t[0].setAttribute("data-app-state","loading-screen")}))),o.appendChild(e);const a=document.createElement("cod-button");a.setAttribute("data-label",""),a.setAttribute("data-size","lg"),a.setAttribute("data-img","https://detroitmi.gov/sites/detroitmi.localhost/files/2023-01/government.png"),a.setAttribute("data-img-alt","government officials"),a.setAttribute("data-shape","square"),a.setAttribute("data-nav-value","government officials"),a.setAttribute("data-icon",""),"government officials"==t[0].getAttribute("data-active-section")?(a.setAttribute("data-background-color","success"),a.setAttribute("data-primary",!0)):(a.setAttribute("data-background-color","secondary"),a.setAttribute("data-primary",!1),a.addEventListener("click",(e=>{if("none"!=t[0].getAttribute("data-api-active-datasets")){let e=JSON.parse(t[0].getAttribute("data-api-stored-datasets")),a=JSON.parse(t[0].getAttribute("data-api-active-datasets"));for(const t in a)t in e||(e[t]=a[t]);t[0].setAttribute("data-api-stored-datasets",JSON.stringify(e))}t[0].setAttribute("data-api-active-datasets","none"),t[0].setAttribute("data-active-sets","council,council-members,bop-members,district-managers,business-liaison,district-inspectors,npo"),t[0].setAttribute("data-map-available","false"),t[0].setAttribute("data-active-section","government officials"),t[0].setAttribute("data-app-state","loading-screen")}))),o.appendChild(a);const r=document.createElement("cod-button");r.setAttribute("data-label",""),r.setAttribute("data-size","lg"),r.setAttribute("data-img","https://detroitmi.gov/sites/detroitmi.localhost/files/2023-01/zone.png"),r.setAttribute("data-img-alt","special areas and zones"),r.setAttribute("data-shape","square"),r.setAttribute("data-nav-value","special areas and zones"),r.setAttribute("data-icon",""),"special areas and zones"==t[0].getAttribute("data-active-section")?(r.setAttribute("data-background-color","success"),r.setAttribute("data-primary",!0)):(r.setAttribute("data-background-color","secondary"),r.setAttribute("data-primary",!1),r.addEventListener("click",(e=>{if("none"!=t[0].getAttribute("data-api-active-datasets")){let e=JSON.parse(t[0].getAttribute("data-api-stored-datasets")),a=JSON.parse(t[0].getAttribute("data-api-active-datasets"));for(const t in a)t in e||(e[t]=a[t]);t[0].setAttribute("data-api-stored-datasets",JSON.stringify(e))}t[0].setAttribute("data-api-active-datasets","none"),t[0].setAttribute("data-active-sets","nez,nrsa,historicDistrict"),t[0].setAttribute("data-map-available","false"),t[0].setAttribute("data-active-section","special areas and zones"),t[0].setAttribute("data-app-state","loading-screen")}))),o.appendChild(r);const n=document.createElement("cod-button");n.setAttribute("data-label",""),n.setAttribute("data-size","lg"),n.setAttribute("data-img","https://detroitmi.gov/sites/detroitmi.localhost/files/2023-01/nearby.png"),n.setAttribute("data-img-alt","things nearby"),n.setAttribute("data-shape","square"),n.setAttribute("data-nav-value","things nearby"),n.setAttribute("data-icon",""),"things nearby"==t[0].getAttribute("data-active-section")?(n.setAttribute("data-background-color","success"),n.setAttribute("data-primary",!0)):(n.setAttribute("data-background-color","secondary"),n.setAttribute("data-primary",!1),n.addEventListener("click",(e=>{if("none"!=t[0].getAttribute("data-api-active-datasets")){let e=JSON.parse(t[0].getAttribute("data-api-stored-datasets")),a=JSON.parse(t[0].getAttribute("data-api-active-datasets"));for(const t in a)t in e||(e[t]=a[t]);t[0].setAttribute("data-api-stored-datasets",JSON.stringify(e))}t[0].setAttribute("data-api-active-datasets","none"),t[0].setAttribute("data-active-sets","schools,demos-data,stabilization-data,improve-det"),t[0].setAttribute("data-active-section","things nearby"),t[0].setAttribute("data-map-available","true"),t[0].setAttribute("data-app-state","loading-screen")}))),o.appendChild(n);const i=document.createElement("cod-button");i.setAttribute("data-label",""),i.setAttribute("data-size","lg"),i.setAttribute("data-img","https://detroitmi.gov/sites/detroitmi.localhost/files/2023-01/print.png"),i.setAttribute("data-img-alt","print"),i.setAttribute("data-shape","square"),i.setAttribute("data-nav-value","print"),i.setAttribute("data-icon",""),"print"==t[0].getAttribute("data-active-section")?(i.setAttribute("data-background-color","success"),i.setAttribute("data-primary",!0)):(i.setAttribute("data-background-color","secondary"),i.setAttribute("data-primary",!1),i.addEventListener("click",(e=>{e.target.getAttribute("data-nav-value")&&t[0].setAttribute("data-app-state","print")}))),o.appendChild(i)}s.appendChild(o)}}customElements.define("app-geocoder",r),customElements.define("app-nav-tools",n);class i extends HTMLElement{static get observedAttributes(){return["data-display-type","data-pagination"]}constructor(){super();this.attachShadow({mode:"open"});this.neighborhoodImage=document.createElement("img"),this.neighborhoodImage.src="https://detroitmi.gov/sites/detroitmi.localhost/files/2023-01/neighborhood.png",this.neighborhoodImage.setAttribute("alt",""),this.welcomeStyle=document.createElement("style"),this.welcomeStyle.textContent="\n @import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@100;700&display=swap')\n #display-wrapper { display: flex; padding: 1em; flex-wrap: wrap; font-family: 'Montserrat', sans-serif;}\n #display-wrapper #welcome-img-wrapper { display: flex; }\n #display-wrapper #welcome-img-wrapper img { height: 10em; margin: auto }\n #display-wrapper p { text-align: center; font-family: 'Montserrat', sans-serif;}\n #display-wrapper button { padding: 1em 3em; background-color: #004445; color: #fff; border: none; cursor: pointer; margin: auto; width: 100%;}\n p.display-title { font-weight: bold; font-size: 1.25em; }\n app-geocoder { width: 100%}\n .btn-group { display:flex; width: 100%; }\n @media all and (min-width: 551px) {\n #display-wrapper{ display: flex; }\n #display-wrapper #welcome-img-wrapper img { width: 15em; height: auto; }\n #display-wrapper article { flex: 1; padding: 1em; }\n }\n ",this.resultsStyle=document.createElement("style"),this.resultsStyle.textContent="\n .results-container{ display: flex; }\n #data-results { background-color: #e6e6e6; padding: 1em; height: 40em; overflow-y: auto; }\n .data-title { font-weight: bold; border-left: solid .2em #FEB70D; padding: .5em; margin: 0 0 1em 0; font-family: 'Montserrat', sans-serif;}\n .result-address {background-color: #fff; border: solid 0.1em #e6e6e6; padding: 1.04em 0.6em; font-family: 'Montserrat', sans-serif;}\n .data-block-title { padding: .5em; background-color: #FEB70D; margin: 0; font-weight: bold; font-family: 'Montserrat', sans-serif; display: flex;}\n .data-block-title span { flex: 1; margin: auto; }\n .data-block-content { padding: .5em; margin-bottom: .5em; background-color: #fff; }\n .data-block-content p { margin: 0; font-family: 'Montserrat', sans-serif;}\n .data-block-content hr { border-top: 1px dotted;}\n .dataset-results {flex: 1;}\n .critical-text { color: #CF3234; }\n .error-result { padding: 1em; }\n .data-block-title button { background-color: #fff; border: none; padding: 0.25em 0.5em; box-shadow: 1px 1px 3px 0px rgb(0 0 0 / 75%);}\n .data-block-title button img { height: 1em; }\n @media all and (min-width: 551px) {\n #data-results { height: auto; }\n #data-blocks { column-count: 2; }\n #data-blocks .data-block { -webkit-column-break-inside: avoid; page-break-inside: avoid; break-inside: avoid; }\n }\n\n @media all and (min-width: 1024px) {\n #data-results { height: auto; }\n #data-blocks { column-count: 3; }\n #data-blocks .data-block { -webkit-column-break-inside: avoid; page-break-inside: avoid; break-inside: avoid; }\n }\n ",this.loadDisplay(this)}attributeChangedCallback(e,t,a){"results"==a&&this.clearDisplay(this),"data-pagination"==e&&this.clearDisplay(this),this.loadDisplay(this)}clearDisplay(e){const t=e.shadowRoot;for(;t.firstChild;)t.removeChild(t.firstChild)}formatDate(e){const t=new Date(e);return`${["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][t.getMonth()]} ${t.getDate()}, ${t.getFullYear()}`}buildCouncil(e){let t=window.location.hostname,a={title:"Council District",content:null};return a.content=`\n <p><strong>District Number:</strong> ${e.data.district}</p>\n <p><strong>Council Member:</strong> <a href="http://${t}${e.data.url}" target="_blank">${e.data.name}</a></p>\n <p><strong>Council Member Phone:</strong> ${e.data.phone}</p>\n `,a}buildBOP(e){let t=window.location.hostname,a={title:"Police Commissioner",content:null};return a.content=`\n <p><strong>Commissioner:</strong> <a href="http://${t}${e.data.url}" target="_blank">${e.data.name}</a></p>\n <p><strong>Commissioner's Phone:</strong> ${e.data.phone}</p>\n <p><strong>Commissioner's Email:</strong> ${e.data.email}</p>\n `,a}buildDistrictManagers(e){let t={title:"District Managers",content:null};return e&&0!=Object.keys(e.data).length&&e.data.constructor===Object&&"Not found."!==e.data.detail?t.content=`\n <p><strong>District Manager:</strong> <a href="${e.data.manager.url}" target="_blank">${e.data.manager.name}</a></p>\n <p><strong>Manager Phone:</strong> ${e.data.manager.phone}</p>\n <p><strong>Deputy Manager:</strong> <a href="${e.data.deputy.url}" target="_blank">${e.data.deputy.name}</a></p>\n <p><strong>Deputy Manager Phone:</strong> ${e.data.deputy.phone}</p>\n `:t.content="\n <p>No data found</p>\n ",t}buildBusinessLiaison(e){let t={title:"Business Liaison",content:null};return e&&0!=Object.keys(e.data).length&&e.data.constructor===Object&&"Not found."!==e.data.detail?t.content=`\n <p><strong>Liaison:</strong> ${e.data.name}</p>\n <p><strong>Liaison Phone:</strong> ${e.data.email}</p>\n `:t.content="\n <p>No data found</p>\n ",t}buildInspector(e){let t={title:"Enforcement Inspector",content:null};return e&&0!=Object.keys(e.data).length&&e.data.constructor===Object&&"Not found."!==e.data.detail?t.content=`\n <p><strong>Inspector:</strong> ${e.data.name}</p>\n <p><strong>Inspector Phone:</strong> ${e.data.phone}</p>\n `:t.content="\n <p>No data found</p>\n ",t}buildNeighborhood(e){let t={title:"Neighborhood",content:null};return e&&0!=Object.keys(e.data).length&&e.data.constructor===Object&&"Not found."!==e.data.detail?t.content=`\n <p><strong>Neighborhood name:</strong> ${e.data.attributes.neighborhood_name}</p>\n `:t.content="\n <p>No neighborhood found</p>\n ",t}buildDWSDBackupProtection(e){let t=["Aviation Sub","Barton-McFarland","Chadsey Condon","Cornerstone Village","East English Village","Morningside","Jefferson Chalmers","Warrendale","Victoria Park","Moross-Morang","Garden View"],a={title:"DWSD Basement Backup Protection Program",content:null};return e&&e.data.attributes.neighborhood_name&&t.includes(e.data.attributes.neighborhood_name)?a.content=`\n <p>This property qualifies for the DWSD Basement Backup Protection Program.</p>\n <br>\n <a href="https://app.smartsheet.com/b/form/509cb1e905a74948bce7b0135da53277?Property%20Street%20Address=${e.data.address}&Property%20City=Detroit&Property%20Zip%20Code=${e.data.attributes.Postal}&Neighborhood=${e.data.attributes.neighborhood_name}" target="_blank"><cod-button data-label="Apply Now" data-background-color="primary" data-size="xsmall" data-icon="" data-primary="true" data-img-alt=""></cod-button></a>\n `:a.content='\n <p>This property doesn\'t qualify for the Basement Backup Protection Program. To learn more please <a href="https://detroitmi.gov/departments/water-and-sewerage-department/dwsd-resources/basement-flooding-protection">visit our page.</a></p>\n ',a}buildHRDFlooding(e){console.log(e.data.attributes.neighborhood_name);let t=["Cornerstone Village","Morningside","Chandler Park","Fox Creek","Riverbend","Morningside","West End","Midwest","Chadsey Condon","Claytown","North Corktown","Michigan-Martin","Aviation Sub","Garden View","Plymouth-I96","Plymouth-Hubbell","Paveway","We Care Community","Fiskhorn","Joy-Schaefer","Warrendale","Warren Ave Community","Barton-McFarland"],a={title:"CDBG-DR Private Sewer Repair Program",content:null};return e&&e.data.attributes.neighborhood_name&&t.includes(e.data.attributes.neighborhood_name)?a.content='\n <p>This property qualifies for the CDBG-DR Private Sewer Repair Program.</p>\n <br>\n <cod-button data-label="Apply Now" data-background-color="primary" data-size="xsmall" data-icon="" data-primary="true" data-img-alt="" data-link="https://app.smartsheet.com/b/form/3dab24dc95bf469b8ac4c27669536507"></cod-button>\n ':a.content='\n <p>This property doesn\u2019t qualify for the CDBG-DR Private Sewer Repair Program. To learn more please <a href="https://detroitmi.gov/departments/housing-and-revitalization-department/disaster-recovery">visit our page.</a></p>\n ',a}buildHistoricDistrict(e,t){let a={title:"NEZ Homestead Zone",content:null};return 0!=Object.keys(e.data).length&&e.data.constructor===Object&&e.data.features.length>0?a.content=`\n <p><strong>NAME:</strong> ${e.data.features[0].attributes.Name}</p>\n <p><strong>DESIGNATED ON:</strong> ${t.formatDate(e.data.features[0].attributes.Year_Enacted).format("MMM DD, YYYY")}</p>\n `:a.content="\n <p>This property is not in a historic district.</p>\n ",a}buildNEZ(e){let t={title:"NEZ Homestead Zone",content:null};return 0!=Object.keys(e.data).length&&e.data.constructor===Object&&e.data.features.length>0?t.content=`\n <p><strong>Name:</strong> ${e.data.features[0].attributes.RNNAME}</p>\n <p><strong>ID:</strong> ${e.data.features[0].attributes.RID}</p>\n <p class="noprint"><a href="https://data.detroitmi.gov/datasets/proposed-nez-homestead-2021/explore" target="_blank">View Map</a></p>\n `:t.content='\n <p>This property is not on a NEZ Homestead zone.</p>\n <p class="noprint"><a href="https://data.detroitmi.gov/datasets/nez-h-districts/explore" target="_blank">View Map</a></p>\n ',t}buildNRSA(e){let t={title:"Neighborhood Revitalization Strategy Areas (NRSA)",content:null};return 0!=Object.keys(e.data).length&&e.data.constructor===Object&&e.data.features.length>0?t.content=`\n <p><strong>Name:</strong> ${e.data.features[0].attributes.Name}</p>\n `:t.content="\n <p>This property is not on a NRSA.</p>\n ",t}buildNPO(e){let t={title:"Police",content:null};return e&&e.data.features.length?t.content=`\n <p><strong>PRECINCT</strong></p>\n <p><strong>Number:</strong> ${e.data.features[0].attributes.precinct}</p>\n <p><strong>Address:</strong> ${e.data.features[0].attributes.precinct_location}</p>\n <br>\n <p><strong>NEIGHBORHOOD POLICE OFFICER (NPO)</strong></p>\n <p><strong>Name:</strong> ${e.data.features[0].attributes.officer_name}</p>\n <p><strong>Phone:</strong> ${e.data.features[0].attributes.npo_cell_phone}</p>\n <p><strong>Email:</strong> ${e.data.features[0].attributes.npo_email}</p>\n `:t.content="<p>No police info found</p>",t}checkRecyclingStatus(e){try{if(e.next_pickups["yard waste"]){let t=null,a=null;return e.details.forEach((e=>{"start-date"==e.type&&"yard waste"==e.service&&(t=null!=e.normalDay?e.normalDay:e.newDay),"end-date"==e.type&&"yard waste"==e.service&&(a=null!=e.normalDay?e.normalDay:e.newDay)})),!!moment(e.next_pickups["yard waste"].next_pickup).isBetween(t,a)}return!1}catch(t){return!1}}buildRecycling(e,t){let a={title:"Trash & Recycling",content:null};if(e&&0!=Object.keys(e.data).length&&e.data.constructor===Object){let r={name:null,url:null,phone:null};"GFL"===e.data.next_pickups.trash.contractor?(r.name="GFL",r.url="http://gflusa.com/residential/detroit/",r.phone="(844) 464-3587"):"WM"===e.data.next_pickups.trash.contractor?(r.name="WM",r.url="http://www.advanceddisposal.com/mi/detroit/detroit-residential-collection",r.phone="(844) 233-8764"):"Priority Waste"===e.data.next_pickups.trash.contractor&&(r.name="Priority Waste",r.url="https://www.prioritywaste.com/cities-we-serve/detroit/",r.phone="(855) 927-835"),a.content=`\n <p><strong>Provider:</strong> <a href="${r.url}" target="_blank">${r.name}</a> ${r.phone}</p>\n <p><strong>Next Trash:</strong> ${t.formatDate(e.data.next_pickups.trash.next_pickup)}</p>\n <p><strong>Next Recycling:</strong> ${t.formatDate(e.data.next_pickups.recycling.next_pickup)}</p>\n <p><strong>Next Bulk:</strong> ${t.formatDate(e.data.next_pickups.bulk.next_pickup)}</p>\n ${t.checkRecyclingStatus(e.data)?tempHTML+=`<p><strong>Next Yard:</strong> ${t.formatDate(e.data.next_pickups["yard waste"].next_pickup)}</p>`:""}\n `}else a.content="<p>No data found</p>";return a}buildAssessors(e){let t={title:"Assessor's Data",content:null};if(e&&0!=Object.keys(e.data).length&&e.data.constructor===Object&&"Not found."!==e.data.detail){let a={year:null,value:null,floor:null,buildingClass:null};t.content=`\n <p><strong>Owner's address:</strong> ${e.data.ownerstreetaddr}</p>\n <p><strong>Owner's city:</strong> ${e.data.ownercity}</p>\n <p><strong>Owner's state:</strong> ${e.data.ownerstate}</p>\n <p><strong>Owner's zip:</strong> ${e.data.ownerzip}</p>\n `,0===e.data.resb_bldgclass?(a.year=e.data.cib_yearbuilt,a.value=e.data.cib_value,a.floor=e.data.cib_yearbuilt,a.buildingClass=e.data.cib_yearbuilt):(a.year=e.data.resb_yearbuilt,a.value=e.data.resb_value,a.floor=e.data.resb_floorarea,a.buildingClass=e.data.resb_bldgclass),t.content+=`\n <p><strong>Parcel number:</strong> ${e.data.pnum}</p>\n <p><strong>Year build:</strong> ${a.year}</p>\n <p><strong>Calculated value:</strong> $${a.value.toLocaleString()}</p>\n <p><strong>Floor area:</strong> ${a.floor.toLocaleString()} SQFT</p>\n <p><strong>Building class:</strong> ${a.buildingClass}</p>\n `}else t.content="<p>No data found</p>";return t}buildRental(e,t){let a=document.getElementsByTagName("my-home-info"),r=JSON.parse(a[0].getAttribute("data-api-active-datasets")),n={title:"Rental Enforcement Status",content:null};return e&&e.data.features.length||r["rental-cert-data"]&&r["rental-cert-data"].data.features.length?n.content=`\n <p><strong>Registered:</strong> ${e.data.features.length?`${t.formatDate(e.data.features[0].attributes.date_status)}`:"Not registered"}</p>\n <p><strong>Certified:</strong> ${r["rental-cert-data"].data.features.length?`${t.formatDate(r["rental-cert-data"].data.features[0].attributes.issued_date)}`:"Not certified"}</p>\n `:n.content="\n <p><strong>Registered:</strong> Not registered</p>\n <p><strong>Certified:</strong> Not certified</p>\n ",n}buildFireEscrow(e){let t="";return e&&e.data.features.length?t+='\n <article class="info-section">\n <span>FIRE ESCROW</span>\n <div>\n <p><strong>STATUS:</strong> Fire Escrow found</p>\n <p><a href="https://detroitmi.gov/taxonomy/term/8501"><button>Start Process</button></a></p>\n </div>\n </article>':t+='\n <article class="info-section">\n <span>FIRE ESCROW</span>\n <div>\n <p><strong>STATUS:</strong> Fire Escrow not found</p>\n </div>\n </article>',t}buildBlight(e,t){let a={title:"Blight Tickets",content:null};return e&&e.data.features.length?a.content=`\n <p><strong>Ticket ID:</strong> ${e.attributes.ticket_number}</p>\n <p><strong>Fine Amount:</strong> $${e.attributes.fine_amount}</p>\n <p><strong>Agency name:</strong> ${e.attributes.agency_name}</p>\n <p><strong>Disposition:</strong> ${e.attributes.disposition}</p>\n <p><strong>Description:</strong> ${e.attributes.violation_description}</p>\n <p><strong>Hearing Date:</strong> ${t.formatDate(e.attributes.hearing_date)}</p>\n <p><strong>Hearing Time:</strong> ${e.attributes.hearing_time}</p>\n `:a.content="<p>No blight tickets found</p>",a}buildSchools(e,t){let a={title:"Schools",content:null};return e&&e.data.features.length?e.data.features.forEach((function(e,t){0==t?a.content=`\n <p><strong>Name:</strong> ${e.properties.EntityOfficialName}</p>\n <p><strong>EntityActualGrades:</strong> ${e.properties.EntityActualGrades}</p>\n <p><strong>Type:</strong> ${e.properties.EntityTypeName}</p>\n <p><strong>Address:</strong> ${e.properties.EntityPhysicalStreet}</p>\n <hr>\n `:a.content+=`\n <p><strong>Name:</strong> ${e.properties.EntityOfficialName}</p>\n <p><strong>EntityActualGrades:</strong> ${e.properties.EntityActualGrades}</p>\n <p><strong>Type:</strong> ${e.properties.EntityTypeName}</p>\n <p><strong>Address:</strong> ${e.properties.EntityPhysicalStreet}</p>\n <hr>\n `})):a.content="<p>No schools nearby.</p>",a}buildPermit(e,t){let a={title:"Building Permits",content:null};return e&&e.data.features.length?a.content=`\n <p><strong>PERMIT NUMBER:</strong> ${e.attributes.record_id}</p>\n <p><strong>PERMIT TYPE:</strong> ${e.attributes.permit_type}</p>\n <p><strong>PERMIT BUILDING TYPE:</strong> ${e.attributes.permit_type}</p>\n <p><strong>PERMIT STATUS:</strong> ${e.attributes.status}</p>\n <p><strong>PERMIT ISSUED:</strong> ${t.formatDate(e.attributes.issued_date)}</p>\n <p><strong>PERMIT DESCRIPTION:</strong> ${e.attributes.description_of_work}</p>\n `:a.content="<p>No building permits found</p>",a}buildDemoStatus(e,t){let a=document.getElementsByTagName("my-home-info"),r=JSON.parse(a[0].getAttribute("data-parcel-id")).address.replace(" ","%2520");r=r.replace(",","%252C");let n={title:"Demolition Status",content:null};return e&&e.data.features.length?n.content=`\n <p class="critical-text"><strong>WARNIG!</strong></p>\n <p>THIS PROPERTY IS SCHEDULED FOR DEMOLITION</p> \n ${null==e.data.features[0].attributes.demolish_by_date?"<p><strong>Date to be determined</strong></p>":`<p><strong>${t.formatDate(e.attributes.demolish_by_date)}</stron></p>`}\n <br>\n <p><a href="https://detroitmi.maps.arcgis.com/apps/instant/nearby/index.html?appid=41ba8dd946d842b9ba632ecc0a5d2556&sliderDistance=1&find=${r}" target="_blank"><cod-button data-label="Expand your demo search" data-background-color="primary" data-icon="" data-size="xsmall" data-primary="true" data-img-alt=""></cod-button></a></p>\n `:n.content=`\n <p>This property is not on the upcoming demolitions list</p>\n <br>\n <p><a href="https://detroitmi.maps.arcgis.com/apps/instant/nearby/index.html?appid=41ba8dd946d842b9ba632ecc0a5d2556&sliderDistance=1&find=${r}" target="_blank"><cod-button data-label="Expand your demo search" data-background-color="primary" data-icon="" data-size="xsmall" data-primary="true" data-img-alt=""></cod-button></a></p>`,n}buildDemosNear(e,t){let a={title:"Demolitions Nearby",content:null};return e&&e.data.features.length?e.data.features.forEach((function(e,r){0==r?a.content=`\n <p><strong>Address:</strong> ${e.properties.address}</p>\n <p><strong>Commercial:</strong> ${e.properties.commercial_building}</p>\n <p><strong>Price:</strong> $${parseInt(e.properties.price).toLocaleString()}</p>\n <p><strong>Parcel:</strong> ${e.properties.parcel_id}</p>\n <p><strong>Contractor:</strong> ${e.properties.contractor_name}</p>\n <p><strong>Council District:</strong> ${e.properties.council_district}</p>\n <p><strong>Neighborhood:</strong> ${e.properties.neighborhood}</p>\n ${void 0==e.properties.demolish_by_date||null==e.properties.demolish_by_date?"<p><p><strong>Expected Date:</strong> Date to be determined</p>":`<p><strong>Expected Date:</strong>${t.formatDate(e.properties.demolish_by_date)}</strong></p>`}\n <hr>\n `:a.content+=`\n <p><strong>Address:</strong> ${e.properties.address}</p>\n <p><strong>Commercial:</strong> ${e.properties.commercial_building}</p>\n <p><strong>Price:</strong> $${parseInt(e.properties.price).toLocaleString()}</p>\n <p><strong>Parcel:</strong> ${e.properties.parcel_id}</p>\n <p><strong>Contractor:</strong> ${e.properties.contractor_name}</p>\n <p><strong>Council District:</strong> ${e.properties.council_district}</p>\n <p><strong>Neighborhood:</strong> ${e.properties.neighborhood}</p>\n ${void 0==e.properties.demolish_by_date||null==e.properties.demolish_by_date?"<p><p><strong>Expected Date:</strong> Date to be determined</p>":`<p><strong>Expected Date:</strong>${t.formatDate(e.properties.demolish_by_date)}</strong></p>`}\n <hr>\n `})):a.content="<p>No demolitions are happening nearby.</p>",a}buildStabilizationsNear(e,t){let a={title:"Stabilizations Nearby",content:null};return e&&e.data.features.length?e.data.features.forEach((function(e,t){0==t?a.content=`\n <p><strong>Address:</strong> ${e.properties.address}</p>\n <p><strong>Parcel:</strong> ${e.properties.parcel_id}</p>\n <p><strong>Council District:</strong> ${e.properties.council_district}</p>\n <p><strong>Neighborhood:</strong> ${e.properties.neighborhood}</p>\n <p><strong>Status:</strong> ${e.properties.rehab_status}</p>\n <hr>\n `:a.content+=`\n <p><strong>Address:</strong> ${e.properties.address}</p>\n <p><strong>Parcel:</strong> ${e.properties.parcel_id}</p>\n <p><strong>Council District:</strong> ${e.properties.council_district}</p>\n <p><strong>Neighborhood:</strong> ${e.properties.neighborhood}</p>\n <p><strong>Status:</strong> ${e.properties.rehab_status}</p>\n <hr>\n `})):a.content="<p>No stabilizations are happening nearby.</p>",a}buildImproveDet(e,t){let a={title:"Improve Detroit Issues Nearby",content:null};return e&&e.data.features.length?e.data.features.forEach((function(e,r){0==r?a.content=`\n <p><strong>ID:</strong> <a href="${e.properties.Web_Url}" target="_blank">${e.properties.ID}</a></p>\n <p><strong>Type:</strong> ${e.properties.Request_Type_Title}</p>\n <p><strong>Status:</strong> ${e.properties.Status}</p>\n <p><strong>Reported on:</strong> ${t.formatDate(e.properties.Created_At)}</p>\n <hr>\n `:a.content+=`\n <p><strong>ID:</strong> <a href="${e.properties.Web_Url}" target="_blank">${e.properties.ID}</a></p>\n <p><strong>Type:</strong> ${e.properties.Request_Type_Title}</p>\n <p><strong>Status:</strong> ${e.properties.Status}</p>\n <p><strong>Reported on:</strong> ${t.formatDate(e.properties.Created_At)}</p>\n <hr>\n `})):a.content="<p>No active issues nearby.</p>",a}selectDataBlockType(e,t){switch(t.id){case"council-members":try{return e.buildCouncil(t)}catch(a){return""}break;case"bop-members":try{return e.buildBOP(t)}catch(a){return""}break;case"district-managers":try{return e.buildDistrictManagers(t)}catch(a){return""}break;case"business-liaison":try{return e.buildBusinessLiaison(t)}catch(a){return""}break;case"district-inspectors":try{return e.buildInspector(t)}catch(a){return""}break;case"neighborhood":try{return e.buildNeighborhood(t)}catch(a){return""}break;case"nez":try{return e.buildNEZ(t)}catch(a){return""}break;case"nrsa":try{return e.buildNRSA(t)}catch(a){return""}break;case"assessors-data":try{return e.buildAssessors(t)}catch(a){return""}break;case"permit-data":try{return e.buildPermit(t,e)}catch(a){return""}break;case"rental-data":try{return e.buildRental(t,e)}catch(a){return""}break;case"blight-data":try{return e.buildBlight(t,e)}catch(a){return""}break;case"demos-data":try{return e.buildDemosNear(t,e)}catch(a){return""}break;case"stabilization-data":try{return e.buildStabilizationsNear(t,e)}catch(a){return""}break;case"demo-status":try{return e.buildDemoStatus(t)}catch(a){return""}break;case"npo":try{return e.buildNPO(t)}catch(a){return""}break;case"improve-det":try{return e.buildImproveDet(t,e)}catch(a){return""}break;case"schools":try{return e.buildSchools(t,e)}catch(a){return""}break;case"recycling":try{return e.buildRecycling(t,e)}catch(a){return""}break;case"historicDistrict":try{return e.buildHistoricDistrict(t)}catch(a){return""}break;case"fireEscrow":try{return e.buildFireEscrow(t)}catch(a){return""}break;case"DWSDBackupProtection":try{return e.buildDWSDBackupProtection(t)}catch(a){return""}break;case"HRDFlooding":try{return e.buildHRDFlooding(t)}catch(a){return""}break;default:return""}}setDatasetPagination(e,t){if(e.hasAttribute("data-pagination")){let a=JSON.parse(e.getAttribute("data-pagination"));if(a[t.id]){let e={start:a[t.id].start};return t.data.features.length<=a[t.id].end+3?(e.end=t.data.features.length,e.more=!1):(e.end=a[t.id].end+3,e.more=!0),e}{let e={start:0,end:3,more:!0};return t.data.features?t.data.features.length<=3&&(e.end=t.data.features.length,e.more=!1):(e.start=null,e.more=!1),e}}{let e={start:0,end:3,more:!0};return t.data.features?t.data.features.length<=3&&(e.end=t.data.features.length,e.more=!1):(e.start=null,e.more=!1),e}}printInfo(e){let t=e.buildDataSection(e),a=window.open("","","height=500, width=500");a.document.write("<html>"),a.document.write("<head><style>@media print {.noprint { visibility: hidden;} p.data-block-title{border-bottom: 1px solid;} .data-block-title button { display: none; } body { column-count: 2;} .data-block { -webkit-column-break-inside: avoid; page-break-inside: avoid; break-inside: avoid; } }</style></head>"),a.document.write("<body >"),a.document.write(t.children[1].innerHTML),a.document.write("</body>"),a.document.close(),a.print()}buildDataBlock(e,t){const a=document.getElementsByTagName("my-home-info"),r=a[0].getAttribute("data-map-available"),n=document.createElement("article");n.className="data-block";let i=e.setDatasetPagination(e,t),s=JSON.parse(JSON.stringify(t));null!==i.start&&(s.data.features=t.data.features.slice(i.start,i.end));let o=e.selectDataBlockType(e,s);if(void 0==o||null==o.content)return null;{const s=document.createElement("p");s.className="data-block-title";const l=document.createElement("article");if(l.className="data-block-content",l.innerHTML=o.content,"true"==r){const e=document.createElement("span");e.innerText=o.title;const r=document.createElement("cod-button");r.setAttribute("data-map-active-data",t.id),r.setAttribute("data-label","View Map"),r.setAttribute("data-size","xsmall"),r.setAttribute("data-icon",""),r.setAttribute("data-img","https://detroitmi.gov/sites/detroitmi.localhost/files/2023-02/map.png"),r.setAttribute("data-img-alt","map"),r.setAttribute("data-shape",""),r.setAttribute("data-hover",!1),r.setAttribute("data-extra-classes","fw-bold"),r.setAttribute("data-background-color","light"),r.setAttribute("data-primary",!0),r.addEventListener("click",(e=>{e.target.getAttribute("data-map-active-data")&&(a[0].setAttribute("data-map-active-data",e.target.getAttribute("data-map-active-data")),a[0].setAttribute("data-app-state","map"))})),s.appendChild(e),s.appendChild(r)}else s.innerText=o.title;if(n.appendChild(s),n.appendChild(l),i.more){let a=document.createElement("cod-button");a.setAttribute("data-pagination-id",t.id),a.setAttribute("data-pagination",JSON.stringify(i)),a.setAttribute("data-label","Load More +"),a.setAttribute("data-size","xsmall"),a.setAttribute("data-icon",""),a.setAttribute("data-img",""),a.setAttribute("data-img-alt",""),a.setAttribute("data-shape",""),a.setAttribute("data-hover",!1),a.setAttribute("data-extra-classes","fw-bold"),a.setAttribute("data-background-color","primary"),a.setAttribute("data-primary",!1),a.addEventListener("click",(t=>{if(t.target.getAttribute("data-pagination")){let a=document.createElement("cod-spinner");a.setAttribute("data-type","border"),a.setAttribute("data-background-color","primary"),a.setAttribute("data-size","sm");let r=e.getAttribute("data-pagination");r=null===r?{}:JSON.parse(r),r[`${t.target.getAttribute("data-pagination-id")}`]=JSON.parse(t.target.getAttribute("data-pagination")),e.setAttribute("data-pagination",JSON.stringify(r)),t.target.parentElement.appendChild(a),t.target.remove()}})),l.appendChild(a)}return n}}buildDataSection(e){const t=document.getElementsByTagName("my-home-info"),a=t[0].getAttribute("data-app-mode"),r=document.createElement("section");if(r.id="data-results","my-home-info"==a){const e=document.createElement("p");e.className="data-title",e.innerText=t[0].getAttribute("data-active-section").toUpperCase(),r.appendChild(e)}const n=document.createElement("div");n.id="data-blocks",r.appendChild(n);const i=JSON.parse(t[0].getAttribute("data-api-active-datasets"));for(const s in i)Object.hasOwnProperty.call(i,s)&&null!=e.buildDataBlock(e,i[s])&&n.appendChild(e.buildDataBlock(e,i[s]));return r}loadDisplay(e){const t=e.shadowRoot,a=document.createElement("section"),r=document.createElement("app-geocoder"),n=document.createElement("app-nav-tools"),i=document.getElementsByTagName("my-home-info");switch(n.printInfo=e.printInfo,a.id="display-wrapper",this.getAttribute("data-display-type")){case"welcome":t.appendChild(e.welcomeStyle);const s=document.createElement("div");s.id="welcome-img-wrapper",s.appendChild(this.neighborhoodImage),a.appendChild(s);const o=document.createElement("article");a.appendChild(o);const l=document.createElement("p");l.setAttribute("aria-label","title"),l.innerText="It\u2019s all here. All in one place.",l.className="display-title",o.appendChild(l);const d=document.createElement("p");d.innerText="Enter your home address to find out your city councilmember and neighborhood district manager, along with local information about trash/recycling, your neighborhood police officer, city issues reported in your neighborhood, and more.",o.appendChild(d),o.appendChild(r),t.appendChild(a);break;case"active":t.appendChild(e.welcomeStyle),a.appendChild(r),t.appendChild(a);break;case"loading":const c=document.createElement("cod-loader");c.setAttribute("data-color","color-3"),a.appendChild(c),t.appendChild(a);break;case"results":let u=JSON.parse(i[0].getAttribute("data-parcel-id"));t.appendChild(e.resultsStyle);let p=document.createElement("section");p.className="results-container",p.appendChild(n);let m=document.createElement("article");m.className="dataset-results";let g=document.createElement("article");g.className="result-address",g.innerText=u.address,m.appendChild(g);let b=e.buildDataSection(e);m.appendChild(b),p.appendChild(m),a.appendChild(p),t.appendChild(a);break;case"error":let h=document.createElement("section");t.appendChild(e.resultsStyle),h.className="results-container",h.appendChild(n);let f=document.createElement("article");f.className="error-result",f.innerHTML='\n <svg xmlns="http://www.w3.org/2000/svg" width="100" height="70" viewBox="0 0 100 68">\n <g id="large">\n <path fill="none" stroke="#F44" d="M55.8 38.5l6.2-1.2c0-1.8-.1-3.5-.4-5.3l-6.3-.2c-.5-2-1.2-4-2.1-6l4.8-4c-.9-1.6-1.9-3-3-4.4l-5.6 3c-1.3-1.6-3-3-4.7-4.1l2-6A30 30 0 0 0 42 8l-3.3 5.4c-2-.7-4.2-1-6.2-1.2L31.3 6c-1.8 0-3.5.1-5.3.4l-.2 6.3c-2 .5-4 1.2-6 2.1l-4-4.8c-1.6.9-3 1.9-4.4 3l3 5.6c-1.6 1.3-3 3-4.1 4.7l-6-2A32.5 32.5 0 0 0 2 26l5.4 3.3c-.7 2-1 4.2-1.2 6.2L0 36.7c0 1.8.1 3.5.4 5.3l6.3.2c.5 2 1.2 4 2.1 6l-4.8 4c.9 1.6 1.9 3 3 4.4l5.6-3c1.4 1.6 3 3 4.7 4.1l-2 6A30.5 30.5 0 0 0 20 66l3.4-5.4c2 .7 4 1 6.1 1.2l1.2 6.2c1.8 0 3.5-.1 5.3-.4l.2-6.3c2-.5 4-1.2 6-2.1l4 4.8c1.6-.9 3-1.9 4.4-3l-3-5.6c1.6-1.3 3-3 4.1-4.7l6 2A32 32 0 0 0 60 48l-5.4-3.3c.7-2 1-4.2 1.2-6.2zm-13.5 4a12.5 12.5 0 1 1-22.6-11 12.5 12.5 0 0 1 22.6 11z"/>\n <animateTransform attributeName="transform" begin="0s" dur="3s" from="0 31 37" repeatCount="indefinite" to="360 31 37" type="rotate"/>\n </g>\n <g id="small">\n <path fill="none" stroke="#F44" d="M93 19.3l6-3c-.4-1.6-1-3.2-1.7-4.8L90.8 13c-.9-1.4-2-2.7-3.4-3.8l2.1-6.3A21.8 21.8 0 0 0 85 .7l-3.6 5.5c-1.7-.4-3.4-.5-5.1-.3l-3-5.9c-1.6.4-3.2 1-4.7 1.7L70 8c-1.5 1-2.8 2-3.9 3.5L60 9.4a20.6 20.6 0 0 0-2.2 4.6l5.5 3.6a15 15 0 0 0-.3 5.1l-5.9 3c.4 1.6 1 3.2 1.7 4.7L65 29c1 1.5 2.1 2.8 3.5 3.9l-2.1 6.3a21 21 0 0 0 4.5 2.2l3.6-5.6c1.7.4 3.5.5 5.2.3l2.9 5.9c1.6-.4 3.2-1 4.8-1.7L86 34c1.4-1 2.7-2.1 3.8-3.5l6.3 2.1a21.5 21.5 0 0 0 2.2-4.5l-5.6-3.6c.4-1.7.5-3.5.3-5.1zM84.5 24a7 7 0 1 1-12.8-6.2 7 7 0 0 1 12.8 6.2z"/>\n <animateTransform attributeName="transform" begin="0s" dur="2s" from="0 78 21" repeatCount="indefinite" to="-360 78 21" type="rotate"/>\n </g>\n </svg>\n <h3>No Information found on this address. Please close and try again.</h3>\n ',h.appendChild(f),a.appendChild(h),t.appendChild(a);break;case"print":let y=JSON.parse(i[0].getAttribute("data-parcel-id"));t.appendChild(e.resultsStyle);let _=document.createElement("section");_.className="results-container",_.appendChild(n);let v=document.createElement("article");v.className="dataset-results";let A=document.createElement("article");A.className="result-address",A.innerText=y.address,v.appendChild(A);let S=e.buildDataSection(e);v.appendChild(S),_.appendChild(v),a.appendChild(_),t.appendChild(a),e.printInfo(e)}}}const s=a(530),o=a(7055);class l extends HTMLElement{static get observedAttributes(){return["data-loader-state","data-parcel-id"]}constructor(){super();const e=this.attachShadow({mode:"open"}),t=document.createElement("section");t.id="loader-wrapper",e.appendChild(t)}attributeChangedCallback(e,t,a){this.shadowRoot;if("data-loader-state"===e)this.clearLoader(this),this.loadLoader(this)}getDataSets(e){const t=document.getElementsByTagName("my-home-info"),a=t[0].getAttribute("data-active-sets").split(","),r=JSON.parse(t[0].getAttribute("data-parcel-id"));let n=[],i=new Promise(((e,t)=>{if("CONDO BUILDING"!=r.attributes.parcel_id){let t="https://apis.detroitmi.gov/assessments/parcel/"+r.attributes.parcel_id+"/";return fetch(t).then((e=>e.json())).then((function(t){e({id:"assessors-data",data:t})})).catch((e=>{}))}e({id:"assessors-data",data:null})})),l=new Promise(((e,t)=>{e({id:"neighborhood",data:r})})),d=new Promise(((e,t)=>e({id:"council",data:r}))),c=new Promise(((e,t)=>fetch("/rest/bop?_format=json").then((e=>e.json())).then((function(t){e({id:"bop-members",data:t})})).catch((e=>{})))),u=new Promise(((e,t)=>fetch("/rest/district-managers?_format=json").then((e=>e.json())).then((function(t){e({id:"district-managers",data:t})})).catch((e=>{})))),p=new Promise(((e,t)=>fetch("/rest/district-inspectors?_format=json").then((e=>e.json())).then((function(t){e({id:"district-inspectors",data:t})})).catch((e=>{})))),m=new Promise(((e,t)=>fetch("/rest/council-members?_format=json").then((e=>e.json())).then((function(t){e({id:"council-members",data:t})})).catch((e=>{})))),g=(new Promise(((e,t)=>{e({id:"DWSDBackupProtection",data:r})})),new Promise(((e,t)=>{e({id:"HRDFlooding",data:r})}))),b=new Promise(((e,t)=>{let a=`https://services2.arcgis.com/qvkbeam7Wirps6zC/arcgis/rest/services/NRSA_2020/FeatureServer/0/query?where=&objectIds=&time=&geometry=${r.location.x}%2C${r.location.y}&geometryType=esriGeometryPoint&inSR=4326&spatialRel=esriSpatialRelIntersects&resultType=none&distance=0.0&units=esriSRUnit_Meter&returnGeodetic=false&outFields=*&returnGeometry=true&returnCentroid=false&featureEncoding=esriDefault&multipatchOption=xyFootprint&maxAllowableOffset=&geometryPrecision=&outSR=&datumTransformation=&applyVCSProjection=false&returnIdsOnly=false&returnUniqueIdsOnly=false&returnCountOnly=false&returnExtentOnly=false&returnQueryGeometry=false&returnDistinctValues=false&cacheHint=false&orderByFields=&groupByFieldsForStatistics=&outStatistics=&having=&resultOffset=&resultRecordCount=&returnZ=false&returnM=false&returnExceededLimitFeatures=true&quantizationParameters=&sqlFormat=none&f=json&token=`;return fetch(a).then((e=>e.json())).then((function(t){e({id:"nrsa",data:t})})).catch((e=>{}))})),h=new Promise(((e,t)=>{let a=`https://services2.arcgis.com/qvkbeam7Wirps6zC/ArcGIS/rest/services/NEZHOMESTEAD2021/FeatureServer/0/query?where=&objectIds=&time=&geometry=${r.location.x}%2C${r.location.y}&geometryType=esriGeometryPoint&inSR=4326&spatialRel=esriSpatialRelIntersects&resultType=none&distance=0.0&units=esriSRUnit_Meter&returnGeodetic=false&outFields=*&returnGeometry=true&returnCentroid=false&featureEncoding=esriDefault&multipatchOption=xyFootprint&maxAllowableOffset=&geometryPrecision=&outSR=&datumTransformation=&applyVCSProjection=false&returnIdsOnly=false&returnUniqueIdsOnly=false&returnCountOnly=false&returnExtentOnly=false&returnQueryGeometry=false&returnDistinctValues=false&cacheHint=false&orderByFields=&groupByFieldsForStatistics=&outStatistics=&having=&resultOffset=&resultRecordCount=&returnZ=false&returnM=false&returnExceededLimitFeatures=true&quantizationParameters=&sqlFormat=none&f=json&token=`;return fetch(a).then((e=>e.json())).then((function(t){e({id:"nez",data:t})})).catch((e=>{}))})),f=new Promise(((e,t)=>{let a=`https://services2.arcgis.com/qvkbeam7Wirps6zC/ArcGIS/rest/services/BuildingPermits/FeatureServer/0/query?where=parcel_id+%3D+%27${r.attributes.parcel_id}%27&objectIds=&time=&geometry=&geometryType=esriGeometryEnvelope&inSR=&spatialRel=esriSpatialRelIntersects&resultType=none&distance=0.0&units=esriSRUnit_Meter&returnGeodetic=false&outFields=*&returnGeometry=true&featureEncoding=esriDefault&multipatchOption=xyFootprint&maxAllowableOffset=&geometryPrecision=&outSR=&datumTransformation=&applyVCSProjection=false&returnIdsOnly=false&returnUniqueIdsOnly=false&returnCountOnly=false&returnExtentOnly=false&returnQueryGeometry=false&returnDistinctValues=false&cacheHint=false&orderByFields=&groupByFieldsForStatistics=&outStatistics=&having=&resultOffset=&resultRecordCount=3&returnZ=false&returnM=false&returnExceededLimitFeatures=true&quantizationParameters=&sqlFormat=none&f=json`;return fetch(a).then((e=>e.json())).then((function(t){e({id:"permit-data",data:t})})).catch((e=>{}))})),y=new Promise(((e,t)=>{let a;return a="CONDO BUILDING"!=r.attributes.parcel_id?`https://services2.arcgis.com/qvkbeam7Wirps6zC/ArcGIS/rest/services/RentalStatuses/FeatureServer/0/query?where=parcel_id+%3D+%27${r.attributes.parcel_id}%27&objectIds=&time=&geometry=&geometryType=esriGeometryEnvelope&inSR=&spatialRel=esriSpatialRelIntersects&resultType=none&distance=0.0&units=esriSRUnit_Meter&returnGeodetic=false&outFields=*&returnGeometry=true&featureEncoding=esriDefault&multipatchOption=xyFootprint&maxAllowableOffset=&geometryPrecision=&outSR=&datumTransformation=&applyVCSProjection=false&returnIdsOnly=false&returnUniqueIdsOnly=false&returnCountOnly=false&returnExtentOnly=false&returnQueryGeometry=false&returnDistinctValues=false&cacheHint=false&orderByFields=&groupByFieldsForStatistics=&outStatistics=&having=&resultOffset=&resultRecordCount=&returnZ=false&returnM=false&returnExceededLimitFeatures=true&quantizationParameters=&sqlFormat=none&f=json`:`https://services2.arcgis.com/qvkbeam7Wirps6zC/ArcGIS/rest/services/RentalStatuses/FeatureServer/0/query?where=&objectIds=&time=&geometry=${r.location.x}%2C+${r.location.y}&geometryType=esriGeometryPoint&inSR=4326&spatialRel=esriSpatialRelIndexIntersects&distance=&units=esriSRUnit_Foot&relationParam=&outFields=*&returnGeometry=true&maxAllowableOffset=&geometryPrecision=&outSR=&gdbVersion=&returnDistinctValues=false&returnIdsOnly=false&returnCountOnly=false&returnExtentOnly=false&orderByFields=&groupByFieldsForStatistics=&outStatistics=&returnZ=false&returnM=false&multipatchOption=&resultOffset=&resultRecordCount=&f=json`,fetch(a).then((e=>e.json())).then((function(t){e({id:"rental-data",data:t})})).catch((e=>{}))})),_=new Promise(((e,t)=>{let a;return a="CONDO BUILDING"!=r.attributes.parcel_id?`https://services2.arcgis.com/qvkbeam7Wirps6zC/ArcGIS/rest/services/active_cofc/FeatureServer/0/query?where=parcel_id%3D%27${r.attributes.parcel_id}%27&objectIds=&time=&geometry=&geometryType=esriGeometryEnvelope&inSR=&spatialRel=esriSpatialRelIntersects&resultType=none&distance=0.0&units=esriSRUnit_Meter&returnGeodetic=false&outFields=*&returnGeometry=true&featureEncoding=esriDefault&multipatchOption=xyFootprint&maxAllowableOffset=&geometryPrecision=&outSR=&datumTransformation=&applyVCSProjection=false&returnIdsOnly=false&returnUniqueIdsOnly=false&returnCountOnly=false&returnExtentOnly=false&returnQueryGeometry=false&returnDistinctValues=false&cacheHint=false&orderByFields=&groupByFieldsForStatistics=&outStatistics=&having=&resultOffset=&resultRecordCount=1&returnZ=false&returnM=false&returnExceededLimitFeatures=true&quantizationParameters=&sqlFormat=none&f=json`:`https://services2.arcgis.com/qvkbeam7Wirps6zC/ArcGIS/rest/services/active_cofc/FeatureServer/0/query?where=&objectIds=&time=&geometry=${r.location.x}%2C+${r.location.y}&geometryType=esriGeometryPoint&inSR=4326&spatialRel=esriSpatialRelIndexIntersects&distance=&units=esriSRUnit_Foot&relationParam=&outFields=*&returnGeometry=true&maxAllowableOffset=&geometryPrecision=&outSR=&gdbVersion=&returnDistinctValues=false&returnIdsOnly=false&returnCountOnly=false&returnExtentOnly=false&orderByFields=&groupByFieldsForStatistics=&outStatistics=&returnZ=false&returnM=false&multipatchOption=&resultOffset=&resultRecordCount=&f=json`,fetch(a).then((e=>e.json())).then((function(t){e({id:"rental-cert-data",data:t})})).catch((e=>{}))})),v=new Promise(((e,t)=>{let a=`https://services2.arcgis.com/qvkbeam7Wirps6zC/arcgis/rest/services/Blight_Violations_(DAH)/FeatureServer/0/query?where=parcelno%3D%27${r.attributes.parcel_id}%27&objectIds=&time=&geometry=&geometryType=esriGeometryEnvelope&inSR=&spatialRel=esriSpatialRelIntersects&resultType=none&distance=0.0&units=esriSRUnit_Meter&returnGeodetic=false&outFields=*&returnGeometry=true&featureEncoding=esriDefault&multipatchOption=xyFootprint&maxAllowableOffset=&geometryPrecision=&outSR=&datumTransformation=&applyVCSProjection=false&returnIdsOnly=false&returnUniqueIdsOnly=false&returnCountOnly=false&returnExtentOnly=false&returnQueryGeometry=false&returnDistinctValues=false&cacheHint=false&orderByFields=violation_date&groupByFieldsForStatistics=&outStatistics=&having=&resultOffset=&resultRecordCount=2&returnZ=false&returnM=false&returnExceededLimitFeatures=true&quantizationParameters=&sqlFormat=none&f=json&token=`;return fetch(a).then((e=>e.json())).then((function(t){e({id:"blight-data",data:t})})).catch((e=>{}))})),A=new Promise(((e,t)=>{let a=`https://services2.arcgis.com/qvkbeam7Wirps6zC/arcgis/rest/services/Property_Sales/FeatureServer/0/query?where=PARCEL_NO%3D%27${r.attributes.parcel_id}%27&objectIds=&time=&geometry=&geometryType=esriGeometryEnvelope&inSR=&spatialRel=esriSpatialRelIntersects&resultType=none&distance=0.0&units=esriSRUnit_Meter&returnGeodetic=false&outFields=*&returnGeometry=true&featureEncoding=esriDefault&multipatchOption=xyFootprint&maxAllowableOffset=&geometryPrecision=&outSR=4326&datumTransformation=&applyVCSProjection=false&returnIdsOnly=false&returnUniqueIdsOnly=false&returnCountOnly=false&returnExtentOnly=false&returnQueryGeometry=false&returnDistinctValues=false&cacheHint=false&orderByFields=SALE_DATE&groupByFieldsForStatistics=&outStatistics=&having=&resultOffset=&resultRecordCount=2&returnZ=false&returnM=false&returnExceededLimitFeatures=true&quantizationParameters=&sqlFormat=none&f=json&token=`;return fetch(a).then((e=>e.json())).then((function(t){e({id:"sales-data",data:t})})).catch((e=>{}))})),S=new Promise(((t,a)=>{let n=s.point([r.location.x,r.location.y]),i=s.buffer(n,2,{units:"miles"}),l=s.simplify(i.geometry,{tolerance:.005,highQuality:!1}),d=o.convert(l),c=`https://services2.arcgis.com/qvkbeam7Wirps6zC/arcgis/rest/services/Demolitions_under_Contract/FeatureServer/0/query?where=&objectIds=&time=&geometry=${encodeURI(JSON.stringify(d))}&geometryType=esriGeometryPolygon&inSR=&spatialRel=esriSpatialRelIntersects&relationParam=&outFields=*&returnGeometry=true&returnTrueCurves=false&maxAllowableOffset=&geometryPrecision=&outSR=4326&returnIdsOnly=false&returnCountOnly=false&orderByFields=&groupByFieldsForStatistics=&outStatistics=&returnZ=false&returnM=false&gdbVersion=&returnDistinctValues=false&resultOffset=&resultRecordCount=&f=geojson`;return fetch(c).then((e=>e.json())).then((function(a){a.features.sort(e.sortFeaturesByDistanceTo(n)),t({id:"demos-data",data:a})})).catch((e=>{}))})),C=new Promise(((t,a)=>{let n=s.point([r.location.x,r.location.y]),i=s.buffer(n,2,{units:"miles"}),l=s.simplify(i.geometry,{tolerance:.005,highQuality:!1}),d=o.convert(l),c=`https://services2.arcgis.com/qvkbeam7Wirps6zC/arcgis/rest/services/Contracted_Stabilizations/FeatureServer/0/query?where=&objectIds=&time=&geometry=${encodeURI(JSON.stringify(d))}&geometryType=esriGeometryPolygon&inSR=&spatialRel=esriSpatialRelIntersects&relationParam=&outFields=*&returnGeometry=true&returnTrueCurves=false&maxAllowableOffset=&geometryPrecision=&outSR=4326&returnIdsOnly=false&returnCountOnly=false&orderByFields=&groupByFieldsForStatistics=&outStatistics=&returnZ=false&returnM=false&gdbVersion=&returnDistinctValues=false&resultOffset=&resultRecordCount=3&f=geojson`;return fetch(c).then((e=>e.json())).then((function(a){a.features.sort(e.sortFeaturesByDistanceTo(n)),t({id:"stabilization-data",data:a})})).catch((e=>{}))})),k=new Promise(((e,t)=>{let a=`https://services2.arcgis.com/qvkbeam7Wirps6zC/arcgis/rest/services/Demolitions_under_Contract/FeatureServer/0/query?where=parcel_id+%3D+%27${r.attributes.parcel_id}%27&objectIds=&time=&geometry=&geometryType=esriGeometryPolygon&inSR=&spatialRel=esriSpatialRelIntersects&resultType=none&distance=0.0&units=esriSRUnit_Meter&returnGeodetic=false&outFields=*&returnGeometry=true&featureEncoding=esriDefault&multipatchOption=xyFootprint&maxAllowableOffset=&geometryPrecision=&outSR=4326&datumTransformation=&applyVCSProjection=false&returnIdsOnly=false&returnUniqueIdsOnly=false&returnCountOnly=false&returnExtentOnly=false&returnQueryGeometry=false&returnDistinctValues=false&cacheHint=false&orderByFields=demolish_by_date&groupByFieldsForStatistics=&outStatistics=&having=&resultOffset=&resultRecordCount=1&returnZ=false&returnM=false&returnExceededLimitFeatures=true&quantizationParameters=&sqlFormat=none&f=json&token=`;return fetch(a).then((e=>e.json())).then((function(t){e({id:"demo-status",data:t})})).catch((e=>{}))})),D=new Promise(((t,a)=>{let n=s.point([r.location.x,r.location.y]),i=s.buffer(n,2,{units:"miles"}),l=s.simplify(i.geometry,{tolerance:.005,highQuality:!1}),d=o.convert(l),c=`https://services2.arcgis.com/qvkbeam7Wirps6zC/ArcGIS/rest/services/2018_2019_Schools_(EEM)/FeatureServer/0/query?where=&objectIds=&time=&geometry=${encodeURI(JSON.stringify(d))}&geometryType=esriGeometryPolygon&inSR=&spatialRel=esriSpatialRelIntersects&relationParam=&outFields=*&returnGeometry=true&returnTrueCurves=false&maxAllowableOffset=&geometryPrecision=&outSR=4326&returnIdsOnly=false&returnCountOnly=false&orderByFields=&groupByFieldsForStatistics=&outStatistics=&returnZ=false&returnM=false&gdbVersion=&returnDistinctValues=false&resultOffset=&resultRecordCount=&f=geojson`;return fetch(c).then((e=>e.json())).then((function(a){a.features.sort(e.sortFeaturesByDistanceTo(n)),t({id:"schools",data:a})})).catch((e=>{}))})),E=new Promise(((e,t)=>{let a=`https://services2.arcgis.com/qvkbeam7Wirps6zC/ArcGIS/rest/services/Neighborhood_Police_Officers/FeatureServer/0/query?where=&objectIds=&time=&geometry=${r.location.x}%2C${r.location.y}&geometryType=esriGeometryPoint&inSR=4326&spatialRel=esriSpatialRelIntersects&resultType=none&distance=1&units=esriSRUnit_Meter&returnGeodetic=false&outFields=*&returnGeometry=true&returnCentroid=false&multipatchOption=xyFootprint&maxAllowableOffset=&geometryPrecision=&outSR=4326&datumTransformation=&applyVCSProjection=false&returnIdsOnly=false&returnCountOnly=false&returnExtentOnly=false&returnDistinctValues=false&orderByFields=&groupByFieldsForStatistics=&outStatistics=&having=&resultOffset=&resultRecordCount=&returnZ=false&returnM=false&returnExceededLimitFeatures=true&quantizationParameters=&sqlFormat=none&f=json&token=`;return fetch(a).then((e=>e.json())).then((function(t){e({id:"npo",data:t})})).catch((e=>{}))})),w=new Promise(((e,t)=>{let a=s.point([r.location.x,r.location.y]),n=s.buffer(a,500,{units:"meters"}),i=s.simplify(n.geometry,{tolerance:.005,highQuality:!1}),l=o.convert(i),d=`https://services2.arcgis.com/qvkbeam7Wirps6zC/ArcGIS/rest/services/Improve_Detroit_Issues_Test/FeatureServer/0/query?where=status+%3C%3E+%27Closed%27+and+status+%3C%3E+%27Archived%27&objectIds=&time=&geometry=${encodeURI(JSON.stringify(l))}&geometryType=esriGeometryPolygon&inSR=&spatialRel=esriSpatialRelIntersects&relationParam=&outFields=*&returnGeometry=true&returnTrueCurves=false&maxAllowableOffset=&geometryPrecision=&outSR=4326&returnIdsOnly=false&returnCountOnly=false&orderByFields=&groupByFieldsForStatistics=&outStatistics=&returnZ=false&returnM=false&gdbVersion=&returnDistinctValues=false&resultOffset=&resultRecordCount=&f=geojson`;return fetch(d).then((e=>e.json())).then((function(t){e({id:"improve-det",data:t})})).catch((e=>{}))})),O=new Promise(((e,t)=>{let a="https://services2.arcgis.com/qvkbeam7Wirps6zC/arcgis/rest/services/WasteCollectionAreas/FeatureServer/0/query?where=&text=&objectIds=&time=&geometry="+r.location.x+"%2C+"+r.location.y+"&geometryType=esriGeometryPoint&inSR=4326&spatialRel=esriSpatialRelWithin&relationParam=&outFields=*&returnGeometry=true&returnTrueCurves=false&maxAllowableOffset=&geometryPrecision=&outSR=&returnIdsOnly=false&returnCountOnly=false&orderByFields=&groupByFieldsForStatistics=&outStatistics=&returnZ=false&returnM=false&gdbVersion=&returnDistinctValues=false&resultOffset=&resultRecordCount=&f=json";fetch(a).then((e=>e.json())).then((function(t){let a=new Date,r=a.getMonth()+1,n=a.getFullYear(),i=`https://apis.detroitmi.gov/waste_schedule/details/${t.features[0].attributes.FID}/year/${n}/month/${r}/`;return fetch(i).then((e=>e.json())).then((function(t){e({id:"recycling",data:t})}))})).catch((e=>{}))})),R=new Promise(((e,t)=>{let a="https://services2.arcgis.com/qvkbeam7Wirps6zC/ArcGIS/rest/services/Detroit_Local_Historic_Districts/FeatureServer/0/query?where=&text=&objectIds=&time=&geometry="+r.location.x+"%2C+"+r.location.y+"&geometryType=esriGeometryPoint&inSR=4326&spatialRel=esriSpatialRelWithin&relationParam=&outFields=*&returnGeometry=true&returnTrueCurves=false&maxAllowableOffset=&geometryPrecision=&outSR=&returnIdsOnly=false&returnCountOnly=false&orderByFields=&groupByFieldsForStatistics=&outStatistics=&returnZ=false&returnM=false&gdbVersion=&returnDistinctValues=false&resultOffset=&resultRecordCount=&f=json";fetch(a).then((e=>e.json())).then((function(t){e({id:"historicDistrict",data:t})})).catch((e=>{}))})),x=new Promise(((e,t)=>{let a=`https://services2.arcgis.com/qvkbeam7Wirps6zC/arcgis/rest/services/fie_properties_final/FeatureServer/0/query?where=parcel_id%3D%27${r.attributes.parcel_id}%27&objectIds=&time=&geometry=&geometryType=esriGeometryEnvelope&inSR=&spatialRel=esriSpatialRelIntersects&resultType=none&distance=0.0&units=esriSRUnit_Meter&returnGeodetic=false&outFields=*&returnHiddenFields=false&returnGeometry=true&returnCentroid=false&featureEncoding=esriDefault&multipatchOption=xyFootprint&maxAllowableOffset=&geometryPrecision=&outSR=&datumTransformation=&applyVCSProjection=false&returnIdsOnly=false&returnUniqueIdsOnly=false&returnCountOnly=false&returnExtentOnly=false&returnQueryGeometry=false&returnDistinctValues=false&cacheHint=false&orderByFields=&groupByFieldsForStatistics=&outStatistics=&having=&resultOffset=&resultRecordCount=&returnZ=false&returnM=false&returnExceededLimitFeatures=true&quantizationParameters=&sqlFormat=none&f=json&token=`;return fetch(a).then((e=>e.json())).then((function(t){e({id:"fireEscrow",data:t})})).catch((e=>{}))}));return a.forEach((e=>{switch(e){case"council":n.push(d);break;case"neighborhood":n.push(l);break;case"assessors-data":null!=r.attributes.parcel_id&&""!=r.attributes.parcel_id&&("CONDO BUILDING"==r.attributes.parcel_id||n.push(i));break;case"permit-data":null!=r.attributes.parcel_id&&""!=r.attributes.parcel_id&&n.push(f);break;case"blight-data":null!=r.attributes.parcel_id&&""!=r.attributes.parcel_id&&n.push(v);break;case"salesHistoryData":null!=r.attributes.parcel_id&&""!=r.attributes.parcel_id&&n.push(A);break;case"fireEscrow":null!=r.attributes.parcel_id&&""!=r.attributes.parcel_id&&n.push(x);break;case"nez":n.push(h);break;case"nrsa":n.push(b);break;case"npo":n.push(E);break;case"improve-det":n.push(w);break;case"recycling":n.push(O);break;case"rental-data":null!=r.attributes.parcel_id&&""!=r.attributes.parcel_id&&n.push(y);break;case"rental-cert":n.push(_);break;case"demo-status":null!=r.attributes.parcel_id&&""!=r.attributes.parcel_id&&n.push(k);break;case"demos-data":n.push(S);break;case"stabilization-data":n.push(C);break;case"schools":n.push(D);break;case"historicDistrict":n.push(R);break;case"district-managers":n.push(u);break;case"district-inspectors":n.push(p);break;case"council-members":n.push(m);break;case"bop-members":n.push(c);break;case"HRDFlooding":n.push(g)}})),n}buildCouncilData(e){let t={council:{district:`District ${e.council.data.attributes.council_district}`,districtURL:null,name:null,url:null,phone:null},bop:{district:`District ${e.council.data.attributes.council_district}`,url:null,name:null,url:null,phone:null,email:null},dmanager:{name:null,url:`/departments/department-of-neighborhoods/district-${e.council.data.attributes.council_district}#block-views-block-contacts-special-block-1`,phone:null},ddmanager:{name:null,url:`/departments/department-of-neighborhoods/district-${e.council.data.attributes.council_district}#block-views-block-contacts-special-block-1`,phone:null},bliaision:{name:null,email:null},enforcement:{name:null,phone:null}};switch(e.council.data.attributes.council_district.toString()){case"1":t.council.districtURL="/taxonomy/term/1276",e["council-members"].data.forEach((e=>{"1276"==e.tid&&(t.council.name=e.field_organization_head_name,t.council.url="/taxonomy/term/1276",t.council.phone=e.field_phone)})),e["bop-members"].data.forEach((e=>{if(e.field_responsibilities.includes("District 1")){t.bop.name=e.title,t.bop.url="/taxonomy/term/4331";let a=e.field_telephone.replace(/ /g,"-");a=a.replace(/[()]/g,""),t.bop.phone=`<a href="tel:${a}">${e.field_telephone}</a>`,t.bop.email=e.field_email_address}})),e["district-managers"].data.forEach((e=>{e.field_contact_position.includes("District 1 Manager")&&(t.dmanager.name=e.title,t.dmanager.phone=e.field_telephone),e.field_contact_position.includes("District 1 Deputy Manager")&&(t.ddmanager.name=e.title,t.ddmanager.phone=e.field_telephone),e.field_contact_position.includes("District 1 Business Liaison")&&(t.bliaision.name=e.title,t.bliaision.email=e.field_email_address)})),e["district-inspectors"].data.forEach((e=>{e.field_responsibilities.includes("District 1")&&(t.enforcement.name=e.title,t.enforcement.phone=e.field_telephone)}));break;case"2":t.council.districtURL="/taxonomy/term/1476",e["council-members"].data.forEach((e=>{"1476"==e.tid&&(t.council.name=e.field_organization_head_name,t.council.url="/taxonomy/term/1476",t.council.phone=e.field_phone)})),e["bop-members"].data.forEach((e=>{if(e.field_responsibilities.includes("District 2")){t.bop.name=e.title,t.bop.url="/taxonomy/term/4336";let a=e.field_telephone.replace(/ /g,"-");a=a.replace(/[()]/g,""),t.bop.phone=`<a href="tel:${a}">${e.field_telephone}</a>`,t.bop.email=e.field_email_address}})),e["district-managers"].data.forEach((e=>{e.field_contact_position.includes("District 2 Manager")&&(t.dmanager.name=e.title,t.dmanager.phone=e.field_telephone),e.field_contact_position.includes("District 2 Deputy Manager")&&(t.ddmanager.name=e.title,t.ddmanager.phone=e.field_telephone),e.field_contact_position.includes("District 2 Business Liaison")&&(t.bliaision.name=e.title,t.bliaision.email=e.field_email_address)})),e["district-inspectors"].data.forEach((e=>{e.field_responsibilities.includes("District 2")&&(t.enforcement.name=e.title,t.enforcement.phone=e.field_telephone)}));break;case"3":t.council.districtURL="/taxonomy/term/1481",e["council-members"].data.forEach((e=>{"1481"==e.tid&&(t.council.name=e.field_organization_head_name,t.council.url="/taxonomy/term/1481",t.council.phone=e.field_phone)})),e["bop-members"].data.forEach((e=>{if(e.field_responsibilities.includes("District 3")){t.bop.name=e.title,t.bop.url="/taxonomy/term/4341";let a=e.field_telephone.replace(/ /g,"-");a=a.replace(/[()]/g,""),t.bop.phone=`<a href="tel:${a}">${e.field_telephone}</a>`,t.bop.email=e.field_email_address}})),e["district-managers"].data.forEach((e=>{e.field_contact_position.includes("District 3 Manager")&&(t.dmanager.name=e.title,t.dmanager.phone=e.field_telephone),e.field_contact_position.includes("District 3 Deputy Manager")&&(t.ddmanager.name=e.title,t.ddmanager.phone=e.field_telephone),e.field_contact_position.includes("District 3 Business Liaison")&&(t.bliaision.name=e.title,t.bliaision.email=e.field_email_address)})),e["district-inspectors"].data.forEach((e=>{e.field_responsibilities.includes("District 3")&&(t.enforcement.name=e.title,t.enforcement.phone=e.field_telephone)}));break;case"4":t.council.districtURL="/taxonomy/term/1486",e["council-members"].data.forEach((e=>{"1486"==e.tid&&(t.council.name=e.field_organization_head_name,t.council.url="/taxonomy/term/1486",t.council.phone=e.field_phone)})),e["bop-members"].data.forEach((e=>{if(e.field_responsibilities.includes("District 4")){t.bop.name=e.title,t.bop.url="/taxonomy/term/4346";let a=e.field_telephone.replace(/ /g,"-");a=a.replace(/[()]/g,""),t.bop.phone=`<a href="tel:${a}">${e.field_telephone}</a>`,t.bop.email=e.field_email_address}})),e["district-managers"].data.forEach((e=>{e.field_contact_position.includes("District 4 Manager")&&(t.dmanager.name=e.title,t.dmanager.phone=e.field_telephone),e.field_contact_position.includes("District 4 Deputy Manager")&&(t.ddmanager.name=e.title,t.ddmanager.phone=e.field_telephone),e.field_contact_position.includes("District 4 Business Liaison")&&(t.bliaision.name=e.title,t.bliaision.email=e.field_email_address)})),e["district-inspectors"].data.forEach((e=>{e.field_responsibilities.includes("District 4")&&(t.enforcement.name=e.title,t.enforcement.phone=e.field_telephone)}));break;case"5":t.council.districtURL="/taxonomy/term/1346",e["council-members"].data.forEach((e=>{"1346"==e.tid&&(t.council.name=e.field_organization_head_name,t.council.url="/taxonomy/term/1346",t.council.phone=e.field_phone)})),e["bop-members"].data.forEach((e=>{if(e.field_responsibilities.includes("District 5")){t.bop.name=e.title,t.bop.url="/taxonomy/term/4351";let a=e.field_telephone.replace(/ /g,"-");a=a.replace(/[()]/g,""),t.bop.phone=`<a href="tel:${a}">${e.field_telephone}</a>`,t.bop.email=e.field_email_address}})),e["district-managers"].data.forEach((e=>{e.field_contact_position.includes("District 5 Manager")&&(t.dmanager.name=e.title,t.dmanager.phone=e.field_telephone),e.field_contact_position.includes("District 5 Deputy Manager")&&(t.ddmanager.name=e.title,t.ddmanager.phone=e.field_telephone),e.field_contact_position.includes("District 5 Business Liaison")&&(t.bliaision.name=e.title,t.bliaision.email=e.field_email_address)})),e["district-inspectors"].data.forEach((e=>{e.field_responsibilities.includes("District 5")&&(t.enforcement.name=e.title,t.enforcement.phone=e.field_telephone)}));break;case"6":t.council.districtURL="/taxonomy/term/1491",e["council-members"].data.forEach((e=>{if("1491"==e.tid){let a=e.field_phone.replace("Office: ","");a=a.replace(/ /g,"-"),a=a.replace(/[()]/g,""),t.council.name=e.field_organization_head_name,t.council.url="/taxonomy/term/1491",t.council.phone=`<a href="tel:${a}">${e.field_phone}</a>`}})),e["bop-members"].data.forEach((e=>{if(e.field_responsibilities.includes("District 6")){t.bop.name=e.title,t.bop.url="/taxonomy/term/4321";let a=e.field_telephone.replace(/ /g,"-");a=a.replace(/[()]/g,""),t.bop.phone=`<a href="tel:${a}">${e.field_telephone}</a>`,t.bop.email=e.field_email_address}})),e["district-managers"].data.forEach((e=>{if(e.field_contact_position.includes("District 6 Manager")){let a=e.field_telephone.replace(/ /g,"-");a=a.replace(/[()]/g,""),t.dmanager.name=e.title,t.dmanager.phone=`<a href="tel:${a}">${e.field_telephone}</a>`}if(e.field_contact_position.includes("District 6 Deputy Manager")){let a=e.field_telephone.replace(/ /g,"-");a=a.replace(/[()]/g,""),t.ddmanager.name=e.title,t.ddmanager.phone=`<a href="tel:${a}">${e.field_telephone}</a>`}e.field_contact_position.includes("District 6 Business Liaison")&&(t.bliaision.name=e.title,t.bliaision.email=e.field_email_address)})),e["district-inspectors"].data.forEach((e=>{if(e.field_responsibilities.includes("District 6")){let a=e.field_telephone.replace(/ /g,"-");a=a.replace(/[()]/g,""),t.enforcement.name=e.title,t.enforcement.phone=`<a href="tel:${a}">${e.field_telephone}</a>`}}));break;case"7":t.council.districtURL="/taxonomy/term/1511",e["council-members"].data.forEach((e=>{"1511"==e.tid&&(t.council.name=e.field_organization_head_name,t.council.url="/taxonomy/term/1511",t.council.phone=e.field_phone)})),e["bop-members"].data.forEach((e=>{if(e.field_responsibilities.includes("District 7")){t.bop.name=e.title,t.bop.url="/taxonomy/term/4356";let a=e.field_telephone.replace(/ /g,"-");a=a.replace(/[()]/g,""),t.bop.phone=`<a href="tel:${a}">${e.field_telephone}</a>`,t.bop.email=e.field_email_address}})),e["district-managers"].data.forEach((e=>{e.field_contact_position.includes("District 7 Manager")&&(t.dmanager.name=e.title,t.dmanager.phone=e.field_telephone),e.field_contact_position.includes("District 7 Deputy Manager")&&(t.ddmanager.name=e.title,t.ddmanager.phone=e.field_telephone),e.field_contact_position.includes("District 7 Business Liaison")&&(t.bliaision.name=e.title,t.bliaision.email=e.field_email_address)})),e["district-inspectors"].data.forEach((e=>{e.field_responsibilities.includes("District 7")&&(t.enforcement.name=e.title,t.enforcement.phone=e.field_telephone)}))}return t}sortFeaturesByDistanceTo(e){return function(t,a){var r={units:"radians"};return s.distance(e,t,r)-s.distance(e,a,r)}}getData(e){const t=document.getElementsByTagName("my-home-info"),a=t[0].getAttribute("data-active-sets").split(","),r=(JSON.parse(t[0].getAttribute("data-parcel-id")),JSON.parse(t[0].getAttribute("data-api-stored-datasets")));let n=!1;for(let i in r)a.includes(i)&&(n=!0);if(n){let e={};a.forEach((t=>{e[t]=r[t]})),t[0].setAttribute("data-api-active-datasets",JSON.stringify(e)),t[0].setAttribute("data-app-state","results")}else{let r=e.getDataSets(e);Promise.all(r).then((r=>{let n={};for(let e in r)null!=r[e]?n[r[e].id]=r[e]:initialLoadChecker=!1;if(a.includes("council")){let t=e.buildCouncilData(n);n["council-members"]={id:"council-members",data:t.council},n["bop-members"]={id:"bop-members",data:t.bop};let a={manager:t.dmanager,deputy:t.ddmanager};n["district-managers"]={id:"district-managers",data:a},n["business-liaison"]={id:"business-liaison",data:t.bliaision},n["district-inspectors"]={id:"district-inspectors",data:t.enforcement}}if(a.includes("DWSDBackupProtection"))try{n.DWSDBackupProtection||(n.DWSDBackupProtection={id:"DWSDBackupProtection",data:n.neighborhood.data})}catch(i){}t[0].setAttribute("data-api-active-datasets",JSON.stringify(n)),t[0].setAttribute("data-app-state","results")})).catch((e=>{}))}}clearLoader(e){const t=e.shadowRoot;for(;t.firstChild;)t.removeChild(t.firstChild)}loadLoader(e){const t=e.shadowRoot,a=document.createElement("section");switch(a.id="loader-wrapper",e.getAttribute("data-loader-state")){case"active":e.getData(e);const r=document.createElement("p");r.innerText="Loading DATA",a.appendChild(r),t.appendChild(a);break;case"finished":const n=document.createElement("p");n.innerText="Data loaded",a.appendChild(n),t.appendChild(a)}}}customElements.define("app-display",i),customElements.define("app-data-loader",l);class d extends HTMLElement{static get observedAttributes(){return["data-app-state","data-parcel-id","data-map-state"]}constructor(){super();const e=this.attachShadow({mode:"open"});let t=document.getElementsByTagName("my-home-info")[0].getAttribute("data-app-state");const a=document.createElement("section");a.id="app-wrapper";const r=document.createElement("app-display");"active-screen"==t?r.setAttribute("data-display-type","active"):r.setAttribute("data-display-type","welcome"),a.appendChild(r),e.appendChild(a)}attributeChangedCallback(e,t,a){this.shadowRoot;const r=document.getElementsByTagName("my-home-info")[0].getAttribute("data-app-mode");switch(e){case"data-app-state":null!=t&&(this.clearApp(this),this.loadApp(this));break;case"data-parcel-id":"none"!=a?this.setAttribute("data-app-state","loading-screen"):"my-home-info"==r&&this.setAttribute("data-app-state","welcome-screen");break;case"data-map-state":break;default:console.log("not catched")}}clearApp(e){const t=e.shadowRoot;for(;t.firstChild;)t.removeChild(t.firstChild)}loadApp(e){const t=e.shadowRoot,a=document.createElement("div");a.id="app-wrapper";const r=document.createElement("app-display"),n=document.createElement("app-data-loader");switch(e.getAttribute("data-app-state")){case"welcome-screen":r.setAttribute("data-display-type","welcome"),a.appendChild(r);break;case"active-screen":r.setAttribute("data-display-type","active"),a.appendChild(r);break;case"loading-screen":r.setAttribute("data-display-type","loading"),n.setAttribute("data-loader-state","active"),a.appendChild(r);break;case"results":r.setAttribute("data-display-type","results"),a.appendChild(r);break;case"map":const e=document.createElement("cod-map");e.id="cod-map";let t=JSON.parse(this.getAttribute("data-api-active-datasets")),i=this.getAttribute("data-map-active-data");const s={id:"mapData",layers:[{name:"data-points",type:"circle",radius:6,color:"#004445",active:!0,sort:10,source:"data-points"}],source:t[i].data};let o;switch(i){case"schools":o={schools:[{type:"field-value",label:"Name:",value:"EntityOfficialName"}]};break;case"demos-data":o={"demos-data":[{type:"field-value",label:"Address:",value:"address"}]};break;case"stabilization-data":o={"stabilization-data":[{type:"field-value",label:"Address:",value:"address"}]};break;case"improve-det":o={"improve-det":[{type:"field-value",label:"Address:",value:"Address"},{type:"field-value",label:"Type:",value:"Request_Type_Title"}]}}e.setAttribute("data-parent-component","my-home-info"),e.setAttribute("data-map-mode","my-home-info"),e.setAttribute("data-map-active-data",this.getAttribute("data-map-active-data")),e.setAttribute("data-popup-structure",JSON.stringify(o)),e.setAttribute("data-map-data",JSON.stringify(s)),e.setAttribute("data-location",this.getAttribute("data-parcel-id")),e.setAttribute("data-map-state","init"),a.appendChild(e);break;case"error":r.setAttribute("data-display-type","error"),a.appendChild(r);break;case"print":r.setAttribute("data-display-type","print"),a.appendChild(r)}null==t.firstChild&&t.appendChild(a)}}var c=a(2181),u=a(9766),p=a(6869);customElements.define("my-home-info",d),c.S1({dsn:"https://536fad340d72a07ee08fe3df749b982e@o4505717305704448.ingest.sentry.io/4505720878792704",release:"local-services-lookup@2.0.9",integrations:[new u.gE,new p.U],tracesSampleRate:1,tracePropagationTargets:["localhost",/^https:\/\/detroitmi\.gov/],replaysSessionSampleRate:.1,replaysOnErrorSampleRate:1})}},e=>{e.O(0,[315,152,47,600,489],(()=>{return t=2789,e(e.s=t);var t}));e.O()}]); +!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},t=(new Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="b81c2fc2-7d54-4b00-ac58-5d8accb648b5",e._sentryDebugIdIdentifier="sentry-dbid-b81c2fc2-7d54-4b00-ac58-5d8accb648b5")}catch(e){}}();var _global="undefined"!==typeof window?window:"undefined"!==typeof global?global:"undefined"!==typeof self?self:{};_global.SENTRY_RELEASE={id:"a2b8e2612b2ee50152f1f5ccf84a620164236ffa"},(self.webpackChunklocal_services_lookup=self.webpackChunklocal_services_lookup||[]).push([[179],{2789:(e,t,a)=>{class r extends HTMLElement{static get observedAttributes(){return["form","parcelStatus","user"]}constructor(){super(),this.form=null,this.parcelStatus="Invalid",this.user=null,this.styles=document.createElement("style"),this.styles.textContent="\n @import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@100;700&display=swap')\n #geocoder {width: 100%}\n input {width: calc(100% - 2em); padding: 1em; border:.1em solid #e6e6e6; font-size: 1em;}\n ";const e=this.attachShadow({mode:"open"});e.appendChild(this.styles);const t=document.createElement("article");t.id="geocoder";let a=document.createElement("form"),r=document.createElement("label");r.style.fontFamily="Montserrat, sans-serif",r.style.fontWeight="bold";let n=document.createElement("input"),i=(document.createElement("ul"),document.createElement("datalist")),s=document.createElement("i");a.addEventListener("submit",(e=>{this.submit(e,this)})),s.className="fas fa-map-marker-alt";const o=document.getElementsByTagName("my-home-info");r.innerText="Property Address:";try{o[0].getAttribute("data-geocoder-label")&&""!=o[0].getAttribute("data-geocoder-label")&&(r.innerText=o[0].getAttribute("data-geocoder-label"))}catch(l){}r.setAttribute("for","geocoder-input"),n.type="text",n.setAttribute("list","addresses-list"),n.placeholder="Enter address",n.setAttribute("id","geocoder-input"),n.setAttribute("autocomplete","off"),n.addEventListener("keyup",(e=>{this.inputChange(e,this)})),i.setAttribute("id","addresses-list"),a.appendChild(r),a.appendChild(n),a.appendChild(s),a.appendChild(i),this.form=a,t.appendChild(a),e.appendChild(t)}supplementGeocoder(e,t,a){const r=document.getElementsByTagName("my-home-info");let n=e.split(",");n=n[0],n=n.split(" ");let i="",s=n.length;n.forEach((function(e,t){i+=e,t<s&&t+1!==s&&(i+="+")}));let o=`https://opengis.detroitmi.gov/opengis/rest/services/BaseUnits/BaseUnitGeocoder/GeocodeServer/findAddressCandidates?Address=&Address2=&Address3=&Neighborhood=&City=&Subregion=&Region=&Postal=&PostalExt=&CountryCode=&SingleLine=${i}&outFields=*&maxLocations=&matchOutOfRange=true&langCode=&locationType=&sourceCountry=&category=&location=&distance=&searchExtent=&outSR=&magicKey=&f=json`;try{fetch(o).then((e=>e.json())).then((function(n){if("suggestions"===a)n.candidates.forEach((e=>{let a=document.createElement("option");""===e.attributes.parcel_id?(a.value=e.address,a.setAttribute("data-parsel","no-parcel")):(a.value=`${e.address} RECOMMENDED`,a.setAttribute("data-parsel",e.attributes.parcel_id)),a.onclick=e=>{t.selectSuggestion(e,t)},t.form.childNodes[3].appendChild(a)}));else if(n.candidates.length){let a=`https://services2.arcgis.com/qvkbeam7Wirps6zC/arcgis/rest/services/City_of_Detroit_Boundary/FeatureServer/0/query?where=&objectIds=&time=&geometry=${n.candidates[0].location.x}%2C+${n.candidates[0].location.y}&geometryType=esriGeometryPoint&inSR=4326&spatialRel=esriSpatialRelIntersects&resultType=none&distance=0.0&units=esriSRUnit_Meter&returnGeodetic=false&outFields=4326&returnGeometry=true&returnCentroid=false&multipatchOption=xyFootprint&maxAllowableOffset=&geometryPrecision=&outSR=&datumTransformation=&applyVCSProjection=false&returnIdsOnly=false&returnUniqueIdsOnly=false&returnCountOnly=false&returnExtentOnly=false&returnDistinctValues=false&orderByFields=&groupByFieldsForStatistics=&outStatistics=&having=&resultOffset=&resultRecordCount=&returnZ=false&returnM=false&returnExceededLimitFeatures=true&quantizationParameters=&sqlFormat=none&f=geojson&token=`;try{fetch(a).then((e=>e.json())).then((function(a){if(a.features.length){let a,i=null;n.candidates.forEach((e=>{""!==e.attributes.parcel_id&&t.checkParcelValid(e.attributes.parcel_id)&&(i=e)})),a=null==i?n.candidates[0].location:null,null===i?(t.parcelStatus="Invalid",t.needGeocode(e,t,a),t.clearSuggestions(t),r[0].setAttribute("data-parcel-id",JSON.stringify(n.candidates[0]))):(t.parcelStatus="Valid",t.needGeocode(e,t,a),t.clearSuggestions(t),r[0].setAttribute("data-parcel-id",JSON.stringify(i)))}else t.parcelStatus="Invalid",t.needGeocode(e,t,location),t.clearSuggestions(t),r[0].setAttribute("data-app-state","error")}))}catch(i){t.parcelStatus="Invalid",t.needGeocode(e,t,location),t.clearSuggestions(t),r[0].setAttribute("data-app-state","error")}}else t.parcelStatus="Invalid",t.needGeocode(e,t,location),t.clearSuggestions(t),r[0].setAttribute("data-app-state","error")}))}catch(l){t.parcelStatus="Invalid",t.needGeocode(e,t,location),t.clearSuggestions(t),r[0].setAttribute("data-app-state","error")}}selectSuggestion(e,t){let a=null;a="SPAN"===e.target.tagName?e.target.parentNode:e.target,"no-parcel"===a.attributes[0].value?(t.clearSuggestions(t),t.supplementGeocoder(a.innerText,t,"submit")):t.supplementGeocoder(a.innerText,t,"submit")}inputChange(e,t){switch(e.key){case"Enter":""!=e.target.value&&void 0!=e.target.value&&t.supplementGeocoder(e.target.value,t,"submit");break;case"ArrowDown":case"ArrowUp":case"ArrowRight":case"ArrowLeft":break;case void 0:""!=e.target.value&&void 0!=e.target.value&&t.supplementGeocoder(e.target.value,t,"submit");break;default:t.clearSuggestions(t),t.supplementGeocoder(e.target.value,t,"suggestions")}}clearSuggestions(e){for(;e.form.childNodes[3].firstChild;)e.form.childNodes[3].removeChild(e.form.childNodes[3].firstChild)}needGeocode(e,t,a){fetch("https://us-central1-local-services-loopkup.cloudfunctions.net/getToken").then((e=>e.json())).then((function(r){let n=e.split(" RECOMMENDED")[0],i=[{attributes:{valid_parcel_status:t.parcelStatus,user_input:n},geometry:{x:0,y:0}}];null!=a&&(i[0].geometry.x=a.x,i[0].geometry.y=a.y);let s=new Request(`https://services2.arcgis.com/qvkbeam7Wirps6zC/ArcGIS/rest/services/addressvalidator/FeatureServer/0/addFeatures?token=${r.access_token}&features=${encodeURIComponent(JSON.stringify(i))}&f=json`,{method:"POST",body:"",headers:new Headers,mode:"cors",cache:"default"});fetch(s).then((e=>{}))}))}checkParcelValid(e){return/\d/.test(e)}submit(e,t){e.preventDefault(),t.supplementGeocoder(e.target[0].value,t,"submit")}}class n extends HTMLElement{constructor(){super();this.attachShadow({mode:"open"});this.navToolsStyle=document.createElement("style"),this.navToolsStyle.textContent="\n #nav-tools-wrapper { display: flex; flex-direction: column;}\n button.clear { font-size: 1.25em; width: 2.5em; height: 2.5em; background-color: #FEB70D; cursor: pointer; border: none; }\n button.nav { width: 3.75em; height: 3.75em; border: none; cursor: pointer;background: #fff; }\n button.nav:hover { background-color: #e6e6e6; transition: all 500ms cubic-bezier(.64,.09,.08,1); }\n button.nav.active { background-color: #9fd5b3; }\n button.nav img { width: 100%; }\n ",this.loadNavTools(this)}clearDisplay(e){const t=e.shadowRoot;for(;t.firstChild;)t.removeChild(t.firstChild)}loadNavTools(e){const t=document.getElementsByTagName("my-home-info"),a=t[0].getAttribute("data-app-state"),r=t[0].getAttribute("data-app-mode"),n=t[0].getAttribute("data-inital-sets"),i=t[0].getAttribute("data-initial-map-available"),s=e.shadowRoot;s.appendChild(e.navToolsStyle);const o=document.createElement("section");o.id="nav-tools-wrapper",o.setAttribute("role","navigation"),o.setAttribute("aria-label","Data Navigation");const l=document.createElement("cod-button");if(l.addEventListener("click",(e=>{"my-home-info"==t[0].getAttribute("data-app-mode")?(t[0].setAttribute("data-app-state","welcome-screen"),t[0].setAttribute("data-active-sets","assessors-data,neighborhood,recycling,rental-data,rental-cert,demo-status,blight-data,permit-data,DWSDBackupProtection")):(t[0].setAttribute("data-app-state","active-screen"),t[0].setAttribute("data-active-sets",n)),"true"==i?t[0].setAttribute("data-map-available","true"):t[0].setAttribute("data-map-available","false"),t[0].setAttribute("data-parcel-id","none"),t[0].setAttribute("data-api-stored-datasets","{}"),t[0].setAttribute("data-api-active-datasets","none"),t[0].setAttribute("data-active-section","property")})),l.setAttribute("data-primary",!0),l.setAttribute("data-label","x"),l.setAttribute("data-size","lg"),l.setAttribute("data-hover",!1),l.setAttribute("data-extra-classes","fw-bold"),l.setAttribute("data-background-color","warning"),l.setAttribute("data-img",""),l.setAttribute("data-img-alt",""),l.setAttribute("data-shape","square"),l.setAttribute("data-icon",""),o.appendChild(l),"my-home-info"==r&&"error"!=a){const e=document.createElement("cod-button");e.setAttribute("data-label",""),e.setAttribute("data-size","lg"),e.setAttribute("data-img","https://detroitmi.gov/sites/detroitmi.localhost/files/2023-01/home.png"),e.setAttribute("data-img-alt","about this property"),e.setAttribute("data-shape","square"),e.setAttribute("data-nav-value","about this property"),e.setAttribute("data-icon",""),"about this property"==t[0].getAttribute("data-active-section")?(e.setAttribute("data-background-color","success"),e.setAttribute("data-primary",!0)):(e.setAttribute("data-background-color","secondary"),e.setAttribute("data-primary",!1),e.addEventListener("click",(e=>{if("none"!=t[0].getAttribute("data-api-active-datasets")){let e=JSON.parse(t[0].getAttribute("data-api-stored-datasets")),a=JSON.parse(t[0].getAttribute("data-api-active-datasets"));for(const t in a)t in e||(e[t]=a[t]);t[0].setAttribute("data-api-stored-datasets",JSON.stringify(e))}t[0].setAttribute("data-api-active-datasets","none"),t[0].setAttribute("data-active-sets","assessors-data,neighborhood,recycling,rental-data,rental-cert,demo-status,blight-data,permit-data,DWSDBackupProtection"),t[0].setAttribute("data-map-available","false"),t[0].setAttribute("data-active-section","about this property"),t[0].setAttribute("data-app-state","loading-screen")}))),o.appendChild(e);const a=document.createElement("cod-button");a.setAttribute("data-label",""),a.setAttribute("data-size","lg"),a.setAttribute("data-img","https://detroitmi.gov/sites/detroitmi.localhost/files/2023-01/government.png"),a.setAttribute("data-img-alt","government officials"),a.setAttribute("data-shape","square"),a.setAttribute("data-nav-value","government officials"),a.setAttribute("data-icon",""),"government officials"==t[0].getAttribute("data-active-section")?(a.setAttribute("data-background-color","success"),a.setAttribute("data-primary",!0)):(a.setAttribute("data-background-color","secondary"),a.setAttribute("data-primary",!1),a.addEventListener("click",(e=>{if("none"!=t[0].getAttribute("data-api-active-datasets")){let e=JSON.parse(t[0].getAttribute("data-api-stored-datasets")),a=JSON.parse(t[0].getAttribute("data-api-active-datasets"));for(const t in a)t in e||(e[t]=a[t]);t[0].setAttribute("data-api-stored-datasets",JSON.stringify(e))}t[0].setAttribute("data-api-active-datasets","none"),t[0].setAttribute("data-active-sets","council,council-members,bop-members,district-managers,business-liaison,district-inspectors,npo"),t[0].setAttribute("data-map-available","false"),t[0].setAttribute("data-active-section","government officials"),t[0].setAttribute("data-app-state","loading-screen")}))),o.appendChild(a);const r=document.createElement("cod-button");r.setAttribute("data-label",""),r.setAttribute("data-size","lg"),r.setAttribute("data-img","https://detroitmi.gov/sites/detroitmi.localhost/files/2023-01/zone.png"),r.setAttribute("data-img-alt","special areas and zones"),r.setAttribute("data-shape","square"),r.setAttribute("data-nav-value","special areas and zones"),r.setAttribute("data-icon",""),"special areas and zones"==t[0].getAttribute("data-active-section")?(r.setAttribute("data-background-color","success"),r.setAttribute("data-primary",!0)):(r.setAttribute("data-background-color","secondary"),r.setAttribute("data-primary",!1),r.addEventListener("click",(e=>{if("none"!=t[0].getAttribute("data-api-active-datasets")){let e=JSON.parse(t[0].getAttribute("data-api-stored-datasets")),a=JSON.parse(t[0].getAttribute("data-api-active-datasets"));for(const t in a)t in e||(e[t]=a[t]);t[0].setAttribute("data-api-stored-datasets",JSON.stringify(e))}t[0].setAttribute("data-api-active-datasets","none"),t[0].setAttribute("data-active-sets","nez,nrsa,historicDistrict"),t[0].setAttribute("data-map-available","false"),t[0].setAttribute("data-active-section","special areas and zones"),t[0].setAttribute("data-app-state","loading-screen")}))),o.appendChild(r);const n=document.createElement("cod-button");n.setAttribute("data-label",""),n.setAttribute("data-size","lg"),n.setAttribute("data-img","https://detroitmi.gov/sites/detroitmi.localhost/files/2023-01/nearby.png"),n.setAttribute("data-img-alt","things nearby"),n.setAttribute("data-shape","square"),n.setAttribute("data-nav-value","things nearby"),n.setAttribute("data-icon",""),"things nearby"==t[0].getAttribute("data-active-section")?(n.setAttribute("data-background-color","success"),n.setAttribute("data-primary",!0)):(n.setAttribute("data-background-color","secondary"),n.setAttribute("data-primary",!1),n.addEventListener("click",(e=>{if("none"!=t[0].getAttribute("data-api-active-datasets")){let e=JSON.parse(t[0].getAttribute("data-api-stored-datasets")),a=JSON.parse(t[0].getAttribute("data-api-active-datasets"));for(const t in a)t in e||(e[t]=a[t]);t[0].setAttribute("data-api-stored-datasets",JSON.stringify(e))}t[0].setAttribute("data-api-active-datasets","none"),t[0].setAttribute("data-active-sets","schools,demos-data,stabilization-data,improve-det"),t[0].setAttribute("data-active-section","things nearby"),t[0].setAttribute("data-map-available","true"),t[0].setAttribute("data-app-state","loading-screen")}))),o.appendChild(n);const i=document.createElement("cod-button");i.setAttribute("data-label",""),i.setAttribute("data-size","lg"),i.setAttribute("data-img","https://detroitmi.gov/sites/detroitmi.localhost/files/2023-01/print.png"),i.setAttribute("data-img-alt","print"),i.setAttribute("data-shape","square"),i.setAttribute("data-nav-value","print"),i.setAttribute("data-icon",""),"print"==t[0].getAttribute("data-active-section")?(i.setAttribute("data-background-color","success"),i.setAttribute("data-primary",!0)):(i.setAttribute("data-background-color","secondary"),i.setAttribute("data-primary",!1),i.addEventListener("click",(e=>{e.target.getAttribute("data-nav-value")&&t[0].setAttribute("data-app-state","print")}))),o.appendChild(i)}s.appendChild(o)}}customElements.define("app-geocoder",r),customElements.define("app-nav-tools",n);class i extends HTMLElement{static get observedAttributes(){return["data-display-type","data-pagination"]}constructor(){super();this.attachShadow({mode:"open"});this.neighborhoodImage=document.createElement("img"),this.neighborhoodImage.src="https://detroitmi.gov/sites/detroitmi.localhost/files/2023-01/neighborhood.png",this.neighborhoodImage.setAttribute("alt",""),this.welcomeStyle=document.createElement("style"),this.welcomeStyle.textContent="\n @import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@100;700&display=swap')\n #display-wrapper { display: flex; padding: 1em; flex-wrap: wrap; font-family: 'Montserrat', sans-serif;}\n #display-wrapper #welcome-img-wrapper { display: flex; }\n #display-wrapper #welcome-img-wrapper img { height: 10em; margin: auto }\n #display-wrapper p { text-align: center; font-family: 'Montserrat', sans-serif;}\n #display-wrapper button { padding: 1em 3em; background-color: #004445; color: #fff; border: none; cursor: pointer; margin: auto; width: 100%;}\n p.display-title { font-weight: bold; font-size: 1.25em; }\n app-geocoder { width: 100%}\n .btn-group { display:flex; width: 100%; }\n @media all and (min-width: 551px) {\n #display-wrapper{ display: flex; }\n #display-wrapper #welcome-img-wrapper img { width: 15em; height: auto; }\n #display-wrapper article { flex: 1; padding: 1em; }\n }\n ",this.resultsStyle=document.createElement("style"),this.resultsStyle.textContent="\n .results-container{ display: flex; }\n #data-results { background-color: #e6e6e6; padding: 1em; height: 40em; overflow-y: auto; }\n .data-title { font-weight: bold; border-left: solid .2em #FEB70D; padding: .5em; margin: 0 0 1em 0; font-family: 'Montserrat', sans-serif;}\n .result-address {background-color: #fff; border: solid 0.1em #e6e6e6; padding: 1.04em 0.6em; font-family: 'Montserrat', sans-serif;}\n .data-block-title { padding: .5em; background-color: #FEB70D; margin: 0; font-weight: bold; font-family: 'Montserrat', sans-serif; display: flex;}\n .data-block-title span { flex: 1; margin: auto; }\n .data-block-content { padding: .5em; margin-bottom: .5em; background-color: #fff; }\n .data-block-content p { margin: 0; font-family: 'Montserrat', sans-serif;}\n .data-block-content hr { border-top: 1px dotted;}\n .dataset-results {flex: 1;}\n .critical-text { color: #CF3234; }\n .error-result { padding: 1em; }\n .data-block-title button { background-color: #fff; border: none; padding: 0.25em 0.5em; box-shadow: 1px 1px 3px 0px rgb(0 0 0 / 75%);}\n .data-block-title button img { height: 1em; }\n @media all and (min-width: 551px) {\n #data-results { height: auto; }\n #data-blocks { column-count: 2; }\n #data-blocks .data-block { -webkit-column-break-inside: avoid; page-break-inside: avoid; break-inside: avoid; }\n }\n\n @media all and (min-width: 1024px) {\n #data-results { height: auto; }\n #data-blocks { column-count: 3; }\n #data-blocks .data-block { -webkit-column-break-inside: avoid; page-break-inside: avoid; break-inside: avoid; }\n }\n ",this.loadDisplay(this)}attributeChangedCallback(e,t,a){"results"==a&&this.clearDisplay(this),"data-pagination"==e&&this.clearDisplay(this),this.loadDisplay(this)}clearDisplay(e){const t=e.shadowRoot;for(;t.firstChild;)t.removeChild(t.firstChild)}formatDate(e){const t=new Date(e);return`${["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][t.getMonth()]} ${t.getDate()}, ${t.getFullYear()}`}buildCouncil(e){let t=window.location.hostname,a={title:"Council District",content:null};return a.content=`\n <p><strong>District Number:</strong> ${e.data.district}</p>\n <p><strong>Council Member:</strong> <a href="http://${t}${e.data.url}" target="_blank">${e.data.name}</a></p>\n <p><strong>Council Member Phone:</strong> ${e.data.phone}</p>\n `,a}buildBOP(e){let t=window.location.hostname,a={title:"Police Commissioner",content:null};return a.content=`\n <p><strong>Commissioner:</strong> <a href="http://${t}${e.data.url}" target="_blank">${e.data.name}</a></p>\n <p><strong>Commissioner's Phone:</strong> ${e.data.phone}</p>\n <p><strong>Commissioner's Email:</strong> ${e.data.email}</p>\n `,a}buildDistrictManagers(e){let t={title:"District Managers",content:null};return e&&0!=Object.keys(e.data).length&&e.data.constructor===Object&&"Not found."!==e.data.detail?t.content=`\n <p><strong>District Manager:</strong> <a href="${e.data.manager.url}" target="_blank">${e.data.manager.name}</a></p>\n <p><strong>Manager Phone:</strong> ${e.data.manager.phone}</p>\n <p><strong>Deputy Manager:</strong> <a href="${e.data.deputy.url}" target="_blank">${e.data.deputy.name}</a></p>\n <p><strong>Deputy Manager Phone:</strong> ${e.data.deputy.phone}</p>\n `:t.content="\n <p>No data found</p>\n ",t}buildBusinessLiaison(e){let t={title:"Business Liaison",content:null};return e&&0!=Object.keys(e.data).length&&e.data.constructor===Object&&"Not found."!==e.data.detail?t.content=`\n <p><strong>Liaison:</strong> ${e.data.name}</p>\n <p><strong>Liaison Phone:</strong> ${e.data.email}</p>\n `:t.content="\n <p>No data found</p>\n ",t}buildInspector(e){let t={title:"Enforcement Inspector",content:null};return e&&0!=Object.keys(e.data).length&&e.data.constructor===Object&&"Not found."!==e.data.detail?t.content=`\n <p><strong>Inspector:</strong> ${e.data.name}</p>\n <p><strong>Inspector Phone:</strong> ${e.data.phone}</p>\n `:t.content="\n <p>No data found</p>\n ",t}buildNeighborhood(e){let t={title:"Neighborhood",content:null};return e&&0!=Object.keys(e.data).length&&e.data.constructor===Object&&"Not found."!==e.data.detail?t.content=`\n <p><strong>Neighborhood name:</strong> ${e.data.attributes.neighborhood_name}</p>\n `:t.content="\n <p>No neighborhood found</p>\n ",t}buildDWSDBackupProtection(e){let t=["Aviation Sub","Barton-McFarland","Chadsey Condon","Cornerstone Village","East English Village","Morningside","Jefferson Chalmers","Warrendale","Victoria Park","Moross-Morang","Garden View"],a={title:"DWSD Basement Backup Protection Program",content:null};return e&&e.data.attributes.neighborhood_name&&t.includes(e.data.attributes.neighborhood_name)?a.content=`\n <p>This property qualifies for the DWSD Basement Backup Protection Program.</p>\n <br>\n <a href="https://app.smartsheet.com/b/form/509cb1e905a74948bce7b0135da53277?Property%20Street%20Address=${e.data.address}&Property%20City=Detroit&Property%20Zip%20Code=${e.data.attributes.Postal}&Neighborhood=${e.data.attributes.neighborhood_name}" target="_blank"><cod-button data-label="Apply Now" data-background-color="primary" data-size="xsmall" data-icon="" data-primary="true" data-img-alt=""></cod-button></a>\n `:a.content='\n <p>This property doesn\'t qualify for the Basement Backup Protection Program. To learn more please <a href="https://detroitmi.gov/departments/water-and-sewerage-department/dwsd-resources/basement-flooding-protection">visit our page.</a></p>\n ',a}buildHRDFlooding(e){console.log(e.data.attributes.neighborhood_name);let t=["Cornerstone Village","Morningside","Chandler Park","Fox Creek","Riverbend","Morningside","West End","Midwest","Chadsey Condon","Claytown","North Corktown","Michigan-Martin","Aviation Sub","Garden View","Plymouth-I96","Plymouth-Hubbell","Paveway","We Care Community","Fiskhorn","Joy-Schaefer","Warrendale","Warren Ave Community","Barton-McFarland","East Canfield"],a={title:"CDBG-DR Private Sewer Repair Program",content:null};return e&&e.data.attributes.neighborhood_name&&t.includes(e.data.attributes.neighborhood_name)?a.content='\n <p>This property qualifies for the CDBG-DR Private Sewer Repair Program.</p>\n <br>\n <cod-button data-label="Apply Now" data-background-color="primary" data-size="xsmall" data-icon="" data-primary="true" data-img-alt="" data-link="https://app.smartsheet.com/b/form/3dab24dc95bf469b8ac4c27669536507"></cod-button>\n ':a.content='\n <p>This property doesn\u2019t qualify for the CDBG-DR Private Sewer Repair Program. To learn more please <a href="https://detroitmi.gov/departments/housing-and-revitalization-department/disaster-recovery">visit our page.</a></p>\n ',a}buildHistoricDistrict(e,t){let a={title:"NEZ Homestead Zone",content:null};return 0!=Object.keys(e.data).length&&e.data.constructor===Object&&e.data.features.length>0?a.content=`\n <p><strong>NAME:</strong> ${e.data.features[0].attributes.Name}</p>\n <p><strong>DESIGNATED ON:</strong> ${t.formatDate(e.data.features[0].attributes.Year_Enacted).format("MMM DD, YYYY")}</p>\n `:a.content="\n <p>This property is not in a historic district.</p>\n ",a}buildNEZ(e){let t={title:"NEZ Homestead Zone",content:null};return 0!=Object.keys(e.data).length&&e.data.constructor===Object&&e.data.features.length>0?t.content=`\n <p><strong>Name:</strong> ${e.data.features[0].attributes.RNNAME}</p>\n <p><strong>ID:</strong> ${e.data.features[0].attributes.RID}</p>\n <p class="noprint"><a href="https://data.detroitmi.gov/datasets/proposed-nez-homestead-2021/explore" target="_blank">View Map</a></p>\n `:t.content='\n <p>This property is not on a NEZ Homestead zone.</p>\n <p class="noprint"><a href="https://data.detroitmi.gov/datasets/nez-h-districts/explore" target="_blank">View Map</a></p>\n ',t}buildNRSA(e){let t={title:"Neighborhood Revitalization Strategy Areas (NRSA)",content:null};return 0!=Object.keys(e.data).length&&e.data.constructor===Object&&e.data.features.length>0?t.content=`\n <p><strong>Name:</strong> ${e.data.features[0].attributes.Name}</p>\n `:t.content="\n <p>This property is not on a NRSA.</p>\n ",t}buildNPO(e){let t={title:"Police",content:null};return e&&e.data.features.length?t.content=`\n <p><strong>PRECINCT</strong></p>\n <p><strong>Number:</strong> ${e.data.features[0].attributes.precinct}</p>\n <p><strong>Address:</strong> ${e.data.features[0].attributes.precinct_location}</p>\n <br>\n <p><strong>NEIGHBORHOOD POLICE OFFICER (NPO)</strong></p>\n <p><strong>Name:</strong> ${e.data.features[0].attributes.officer_name}</p>\n <p><strong>Phone:</strong> ${e.data.features[0].attributes.npo_cell_phone}</p>\n <p><strong>Email:</strong> ${e.data.features[0].attributes.npo_email}</p>\n `:t.content="<p>No police info found</p>",t}checkRecyclingStatus(e){try{if(e.next_pickups["yard waste"]){let t=null,a=null;return e.details.forEach((e=>{"start-date"==e.type&&"yard waste"==e.service&&(t=null!=e.normalDay?e.normalDay:e.newDay),"end-date"==e.type&&"yard waste"==e.service&&(a=null!=e.normalDay?e.normalDay:e.newDay)})),!!moment(e.next_pickups["yard waste"].next_pickup).isBetween(t,a)}return!1}catch(t){return!1}}buildRecycling(e,t){let a={title:"Trash & Recycling",content:null};if(e&&0!=Object.keys(e.data).length&&e.data.constructor===Object){let r={name:null,url:null,phone:null};"GFL"===e.data.next_pickups.trash.contractor?(r.name="GFL",r.url="http://gflusa.com/residential/detroit/",r.phone="(844) 464-3587"):"WM"===e.data.next_pickups.trash.contractor?(r.name="WM",r.url="http://www.advanceddisposal.com/mi/detroit/detroit-residential-collection",r.phone="(844) 233-8764"):"Priority Waste"===e.data.next_pickups.trash.contractor&&(r.name="Priority Waste",r.url="https://www.prioritywaste.com/cities-we-serve/detroit/",r.phone="(855) 927-835"),a.content=`\n <p><strong>Provider:</strong> <a href="${r.url}" target="_blank">${r.name}</a> ${r.phone}</p>\n <p><strong>Next Trash:</strong> ${t.formatDate(e.data.next_pickups.trash.next_pickup)}</p>\n <p><strong>Next Recycling:</strong> ${t.formatDate(e.data.next_pickups.recycling.next_pickup)}</p>\n <p><strong>Next Bulk:</strong> ${t.formatDate(e.data.next_pickups.bulk.next_pickup)}</p>\n ${t.checkRecyclingStatus(e.data)?tempHTML+=`<p><strong>Next Yard:</strong> ${t.formatDate(e.data.next_pickups["yard waste"].next_pickup)}</p>`:""}\n `}else a.content="<p>No data found</p>";return a}buildAssessors(e){let t={title:"Assessor's Data",content:null};if(e&&0!=Object.keys(e.data).length&&e.data.constructor===Object&&"Not found."!==e.data.detail){let a={year:null,value:null,floor:null,buildingClass:null};t.content=`\n <p><strong>Owner's address:</strong> ${e.data.ownerstreetaddr}</p>\n <p><strong>Owner's city:</strong> ${e.data.ownercity}</p>\n <p><strong>Owner's state:</strong> ${e.data.ownerstate}</p>\n <p><strong>Owner's zip:</strong> ${e.data.ownerzip}</p>\n `,0===e.data.resb_bldgclass?(a.year=e.data.cib_yearbuilt,a.value=e.data.cib_value,a.floor=e.data.cib_yearbuilt,a.buildingClass=e.data.cib_yearbuilt):(a.year=e.data.resb_yearbuilt,a.value=e.data.resb_value,a.floor=e.data.resb_floorarea,a.buildingClass=e.data.resb_bldgclass),t.content+=`\n <p><strong>Parcel number:</strong> ${e.data.pnum}</p>\n <p><strong>Year build:</strong> ${a.year}</p>\n <p><strong>Calculated value:</strong> $${a.value.toLocaleString()}</p>\n <p><strong>Floor area:</strong> ${a.floor.toLocaleString()} SQFT</p>\n <p><strong>Building class:</strong> ${a.buildingClass}</p>\n `}else t.content="<p>No data found</p>";return t}buildRental(e,t){let a=document.getElementsByTagName("my-home-info"),r=JSON.parse(a[0].getAttribute("data-api-active-datasets")),n={title:"Rental Enforcement Status",content:null};return e&&e.data.features.length||r["rental-cert-data"]&&r["rental-cert-data"].data.features.length?n.content=`\n <p><strong>Registered:</strong> ${e.data.features.length?`${t.formatDate(e.data.features[0].attributes.date_status)}`:"Not registered"}</p>\n <p><strong>Certified:</strong> ${r["rental-cert-data"].data.features.length?`${t.formatDate(r["rental-cert-data"].data.features[0].attributes.issued_date)}`:"Not certified"}</p>\n `:n.content="\n <p><strong>Registered:</strong> Not registered</p>\n <p><strong>Certified:</strong> Not certified</p>\n ",n}buildFireEscrow(e){let t="";return e&&e.data.features.length?t+='\n <article class="info-section">\n <span>FIRE ESCROW</span>\n <div>\n <p><strong>STATUS:</strong> Fire Escrow found</p>\n <p><a href="https://detroitmi.gov/taxonomy/term/8501"><button>Start Process</button></a></p>\n </div>\n </article>':t+='\n <article class="info-section">\n <span>FIRE ESCROW</span>\n <div>\n <p><strong>STATUS:</strong> Fire Escrow not found</p>\n </div>\n </article>',t}buildBlight(e,t){let a={title:"Blight Tickets",content:null};return e&&e.data.features.length?a.content=`\n <p><strong>Ticket ID:</strong> ${e.attributes.ticket_number}</p>\n <p><strong>Fine Amount:</strong> $${e.attributes.fine_amount}</p>\n <p><strong>Agency name:</strong> ${e.attributes.agency_name}</p>\n <p><strong>Disposition:</strong> ${e.attributes.disposition}</p>\n <p><strong>Description:</strong> ${e.attributes.violation_description}</p>\n <p><strong>Hearing Date:</strong> ${t.formatDate(e.attributes.hearing_date)}</p>\n <p><strong>Hearing Time:</strong> ${e.attributes.hearing_time}</p>\n `:a.content="<p>No blight tickets found</p>",a}buildSchools(e,t){let a={title:"Schools",content:null};return e&&e.data.features.length?e.data.features.forEach((function(e,t){0==t?a.content=`\n <p><strong>Name:</strong> ${e.properties.EntityOfficialName}</p>\n <p><strong>EntityActualGrades:</strong> ${e.properties.EntityActualGrades}</p>\n <p><strong>Type:</strong> ${e.properties.EntityTypeName}</p>\n <p><strong>Address:</strong> ${e.properties.EntityPhysicalStreet}</p>\n <hr>\n `:a.content+=`\n <p><strong>Name:</strong> ${e.properties.EntityOfficialName}</p>\n <p><strong>EntityActualGrades:</strong> ${e.properties.EntityActualGrades}</p>\n <p><strong>Type:</strong> ${e.properties.EntityTypeName}</p>\n <p><strong>Address:</strong> ${e.properties.EntityPhysicalStreet}</p>\n <hr>\n `})):a.content="<p>No schools nearby.</p>",a}buildPermit(e,t){let a={title:"Building Permits",content:null};return e&&e.data.features.length?a.content=`\n <p><strong>PERMIT NUMBER:</strong> ${e.attributes.record_id}</p>\n <p><strong>PERMIT TYPE:</strong> ${e.attributes.permit_type}</p>\n <p><strong>PERMIT BUILDING TYPE:</strong> ${e.attributes.permit_type}</p>\n <p><strong>PERMIT STATUS:</strong> ${e.attributes.status}</p>\n <p><strong>PERMIT ISSUED:</strong> ${t.formatDate(e.attributes.issued_date)}</p>\n <p><strong>PERMIT DESCRIPTION:</strong> ${e.attributes.description_of_work}</p>\n `:a.content="<p>No building permits found</p>",a}buildDemoStatus(e,t){let a=document.getElementsByTagName("my-home-info"),r=JSON.parse(a[0].getAttribute("data-parcel-id")).address.replace(" ","%2520");r=r.replace(",","%252C");let n={title:"Demolition Status",content:null};return e&&e.data.features.length?n.content=`\n <p class="critical-text"><strong>WARNIG!</strong></p>\n <p>THIS PROPERTY IS SCHEDULED FOR DEMOLITION</p> \n ${null==e.data.features[0].attributes.demolish_by_date?"<p><strong>Date to be determined</strong></p>":`<p><strong>${t.formatDate(e.attributes.demolish_by_date)}</stron></p>`}\n <br>\n <p><a href="https://detroitmi.maps.arcgis.com/apps/instant/nearby/index.html?appid=41ba8dd946d842b9ba632ecc0a5d2556&sliderDistance=1&find=${r}" target="_blank"><cod-button data-label="Expand your demo search" data-background-color="primary" data-icon="" data-size="xsmall" data-primary="true" data-img-alt=""></cod-button></a></p>\n `:n.content=`\n <p>This property is not on the upcoming demolitions list</p>\n <br>\n <p><a href="https://detroitmi.maps.arcgis.com/apps/instant/nearby/index.html?appid=41ba8dd946d842b9ba632ecc0a5d2556&sliderDistance=1&find=${r}" target="_blank"><cod-button data-label="Expand your demo search" data-background-color="primary" data-icon="" data-size="xsmall" data-primary="true" data-img-alt=""></cod-button></a></p>`,n}buildDemosNear(e,t){let a={title:"Demolitions Nearby",content:null};return e&&e.data.features.length?e.data.features.forEach((function(e,r){0==r?a.content=`\n <p><strong>Address:</strong> ${e.properties.address}</p>\n <p><strong>Commercial:</strong> ${e.properties.commercial_building}</p>\n <p><strong>Price:</strong> $${parseInt(e.properties.price).toLocaleString()}</p>\n <p><strong>Parcel:</strong> ${e.properties.parcel_id}</p>\n <p><strong>Contractor:</strong> ${e.properties.contractor_name}</p>\n <p><strong>Council District:</strong> ${e.properties.council_district}</p>\n <p><strong>Neighborhood:</strong> ${e.properties.neighborhood}</p>\n ${void 0==e.properties.demolish_by_date||null==e.properties.demolish_by_date?"<p><p><strong>Expected Date:</strong> Date to be determined</p>":`<p><strong>Expected Date:</strong>${t.formatDate(e.properties.demolish_by_date)}</strong></p>`}\n <hr>\n `:a.content+=`\n <p><strong>Address:</strong> ${e.properties.address}</p>\n <p><strong>Commercial:</strong> ${e.properties.commercial_building}</p>\n <p><strong>Price:</strong> $${parseInt(e.properties.price).toLocaleString()}</p>\n <p><strong>Parcel:</strong> ${e.properties.parcel_id}</p>\n <p><strong>Contractor:</strong> ${e.properties.contractor_name}</p>\n <p><strong>Council District:</strong> ${e.properties.council_district}</p>\n <p><strong>Neighborhood:</strong> ${e.properties.neighborhood}</p>\n ${void 0==e.properties.demolish_by_date||null==e.properties.demolish_by_date?"<p><p><strong>Expected Date:</strong> Date to be determined</p>":`<p><strong>Expected Date:</strong>${t.formatDate(e.properties.demolish_by_date)}</strong></p>`}\n <hr>\n `})):a.content="<p>No demolitions are happening nearby.</p>",a}buildStabilizationsNear(e,t){let a={title:"Stabilizations Nearby",content:null};return e&&e.data.features.length?e.data.features.forEach((function(e,t){0==t?a.content=`\n <p><strong>Address:</strong> ${e.properties.address}</p>\n <p><strong>Parcel:</strong> ${e.properties.parcel_id}</p>\n <p><strong>Council District:</strong> ${e.properties.council_district}</p>\n <p><strong>Neighborhood:</strong> ${e.properties.neighborhood}</p>\n <p><strong>Status:</strong> ${e.properties.rehab_status}</p>\n <hr>\n `:a.content+=`\n <p><strong>Address:</strong> ${e.properties.address}</p>\n <p><strong>Parcel:</strong> ${e.properties.parcel_id}</p>\n <p><strong>Council District:</strong> ${e.properties.council_district}</p>\n <p><strong>Neighborhood:</strong> ${e.properties.neighborhood}</p>\n <p><strong>Status:</strong> ${e.properties.rehab_status}</p>\n <hr>\n `})):a.content="<p>No stabilizations are happening nearby.</p>",a}buildImproveDet(e,t){let a={title:"Improve Detroit Issues Nearby",content:null};return e&&e.data.features.length?e.data.features.forEach((function(e,r){0==r?a.content=`\n <p><strong>ID:</strong> <a href="${e.properties.Web_Url}" target="_blank">${e.properties.ID}</a></p>\n <p><strong>Type:</strong> ${e.properties.Request_Type_Title}</p>\n <p><strong>Status:</strong> ${e.properties.Status}</p>\n <p><strong>Reported on:</strong> ${t.formatDate(e.properties.Created_At)}</p>\n <hr>\n `:a.content+=`\n <p><strong>ID:</strong> <a href="${e.properties.Web_Url}" target="_blank">${e.properties.ID}</a></p>\n <p><strong>Type:</strong> ${e.properties.Request_Type_Title}</p>\n <p><strong>Status:</strong> ${e.properties.Status}</p>\n <p><strong>Reported on:</strong> ${t.formatDate(e.properties.Created_At)}</p>\n <hr>\n `})):a.content="<p>No active issues nearby.</p>",a}selectDataBlockType(e,t){switch(t.id){case"council-members":try{return e.buildCouncil(t)}catch(a){return""}break;case"bop-members":try{return e.buildBOP(t)}catch(a){return""}break;case"district-managers":try{return e.buildDistrictManagers(t)}catch(a){return""}break;case"business-liaison":try{return e.buildBusinessLiaison(t)}catch(a){return""}break;case"district-inspectors":try{return e.buildInspector(t)}catch(a){return""}break;case"neighborhood":try{return e.buildNeighborhood(t)}catch(a){return""}break;case"nez":try{return e.buildNEZ(t)}catch(a){return""}break;case"nrsa":try{return e.buildNRSA(t)}catch(a){return""}break;case"assessors-data":try{return e.buildAssessors(t)}catch(a){return""}break;case"permit-data":try{return e.buildPermit(t,e)}catch(a){return""}break;case"rental-data":try{return e.buildRental(t,e)}catch(a){return""}break;case"blight-data":try{return e.buildBlight(t,e)}catch(a){return""}break;case"demos-data":try{return e.buildDemosNear(t,e)}catch(a){return""}break;case"stabilization-data":try{return e.buildStabilizationsNear(t,e)}catch(a){return""}break;case"demo-status":try{return e.buildDemoStatus(t)}catch(a){return""}break;case"npo":try{return e.buildNPO(t)}catch(a){return""}break;case"improve-det":try{return e.buildImproveDet(t,e)}catch(a){return""}break;case"schools":try{return e.buildSchools(t,e)}catch(a){return""}break;case"recycling":try{return e.buildRecycling(t,e)}catch(a){return""}break;case"historicDistrict":try{return e.buildHistoricDistrict(t)}catch(a){return""}break;case"fireEscrow":try{return e.buildFireEscrow(t)}catch(a){return""}break;case"DWSDBackupProtection":try{return e.buildDWSDBackupProtection(t)}catch(a){return""}break;case"HRDFlooding":try{return e.buildHRDFlooding(t)}catch(a){return""}break;default:return""}}setDatasetPagination(e,t){if(e.hasAttribute("data-pagination")){let a=JSON.parse(e.getAttribute("data-pagination"));if(a[t.id]){let e={start:a[t.id].start};return t.data.features.length<=a[t.id].end+3?(e.end=t.data.features.length,e.more=!1):(e.end=a[t.id].end+3,e.more=!0),e}{let e={start:0,end:3,more:!0};return t.data.features?t.data.features.length<=3&&(e.end=t.data.features.length,e.more=!1):(e.start=null,e.more=!1),e}}{let e={start:0,end:3,more:!0};return t.data.features?t.data.features.length<=3&&(e.end=t.data.features.length,e.more=!1):(e.start=null,e.more=!1),e}}printInfo(e){let t=e.buildDataSection(e),a=window.open("","","height=500, width=500");a.document.write("<html>"),a.document.write("<head><style>@media print {.noprint { visibility: hidden;} p.data-block-title{border-bottom: 1px solid;} .data-block-title button { display: none; } body { column-count: 2;} .data-block { -webkit-column-break-inside: avoid; page-break-inside: avoid; break-inside: avoid; } }</style></head>"),a.document.write("<body >"),a.document.write(t.children[1].innerHTML),a.document.write("</body>"),a.document.close(),a.print()}buildDataBlock(e,t){const a=document.getElementsByTagName("my-home-info"),r=a[0].getAttribute("data-map-available"),n=document.createElement("article");n.className="data-block";let i=e.setDatasetPagination(e,t),s=JSON.parse(JSON.stringify(t));null!==i.start&&(s.data.features=t.data.features.slice(i.start,i.end));let o=e.selectDataBlockType(e,s);if(void 0==o||null==o.content)return null;{const s=document.createElement("p");s.className="data-block-title";const l=document.createElement("article");if(l.className="data-block-content",l.innerHTML=o.content,"true"==r){const e=document.createElement("span");e.innerText=o.title;const r=document.createElement("cod-button");r.setAttribute("data-map-active-data",t.id),r.setAttribute("data-label","View Map"),r.setAttribute("data-size","xsmall"),r.setAttribute("data-icon",""),r.setAttribute("data-img","https://detroitmi.gov/sites/detroitmi.localhost/files/2023-02/map.png"),r.setAttribute("data-img-alt","map"),r.setAttribute("data-shape",""),r.setAttribute("data-hover",!1),r.setAttribute("data-extra-classes","fw-bold"),r.setAttribute("data-background-color","light"),r.setAttribute("data-primary",!0),r.addEventListener("click",(e=>{e.target.getAttribute("data-map-active-data")&&(a[0].setAttribute("data-map-active-data",e.target.getAttribute("data-map-active-data")),a[0].setAttribute("data-app-state","map"))})),s.appendChild(e),s.appendChild(r)}else s.innerText=o.title;if(n.appendChild(s),n.appendChild(l),i.more){let a=document.createElement("cod-button");a.setAttribute("data-pagination-id",t.id),a.setAttribute("data-pagination",JSON.stringify(i)),a.setAttribute("data-label","Load More +"),a.setAttribute("data-size","xsmall"),a.setAttribute("data-icon",""),a.setAttribute("data-img",""),a.setAttribute("data-img-alt",""),a.setAttribute("data-shape",""),a.setAttribute("data-hover",!1),a.setAttribute("data-extra-classes","fw-bold"),a.setAttribute("data-background-color","primary"),a.setAttribute("data-primary",!1),a.addEventListener("click",(t=>{if(t.target.getAttribute("data-pagination")){let a=document.createElement("cod-spinner");a.setAttribute("data-type","border"),a.setAttribute("data-background-color","primary"),a.setAttribute("data-size","sm");let r=e.getAttribute("data-pagination");r=null===r?{}:JSON.parse(r),r[`${t.target.getAttribute("data-pagination-id")}`]=JSON.parse(t.target.getAttribute("data-pagination")),e.setAttribute("data-pagination",JSON.stringify(r)),t.target.parentElement.appendChild(a),t.target.remove()}})),l.appendChild(a)}return n}}buildDataSection(e){const t=document.getElementsByTagName("my-home-info"),a=t[0].getAttribute("data-app-mode"),r=document.createElement("section");if(r.id="data-results","my-home-info"==a){const e=document.createElement("p");e.className="data-title",e.innerText=t[0].getAttribute("data-active-section").toUpperCase(),r.appendChild(e)}const n=document.createElement("div");n.id="data-blocks",r.appendChild(n);const i=JSON.parse(t[0].getAttribute("data-api-active-datasets"));for(const s in i)Object.hasOwnProperty.call(i,s)&&null!=e.buildDataBlock(e,i[s])&&n.appendChild(e.buildDataBlock(e,i[s]));return r}loadDisplay(e){const t=e.shadowRoot,a=document.createElement("section"),r=document.createElement("app-geocoder"),n=document.createElement("app-nav-tools"),i=document.getElementsByTagName("my-home-info");switch(n.printInfo=e.printInfo,a.id="display-wrapper",this.getAttribute("data-display-type")){case"welcome":t.appendChild(e.welcomeStyle);const s=document.createElement("div");s.id="welcome-img-wrapper",s.appendChild(this.neighborhoodImage),a.appendChild(s);const o=document.createElement("article");a.appendChild(o);const l=document.createElement("p");l.setAttribute("aria-label","title"),l.innerText="It\u2019s all here. All in one place.",l.className="display-title",o.appendChild(l);const d=document.createElement("p");d.innerText="Enter your home address to find out your city councilmember and neighborhood district manager, along with local information about trash/recycling, your neighborhood police officer, city issues reported in your neighborhood, and more.",o.appendChild(d),o.appendChild(r),t.appendChild(a);break;case"active":t.appendChild(e.welcomeStyle),a.appendChild(r),t.appendChild(a);break;case"loading":const c=document.createElement("cod-loader");c.setAttribute("data-color","color-3"),a.appendChild(c),t.appendChild(a);break;case"results":let u=JSON.parse(i[0].getAttribute("data-parcel-id"));t.appendChild(e.resultsStyle);let p=document.createElement("section");p.className="results-container",p.appendChild(n);let m=document.createElement("article");m.className="dataset-results";let g=document.createElement("article");g.className="result-address",g.innerText=u.address,m.appendChild(g);let b=e.buildDataSection(e);m.appendChild(b),p.appendChild(m),a.appendChild(p),t.appendChild(a);break;case"error":let h=document.createElement("section");t.appendChild(e.resultsStyle),h.className="results-container",h.appendChild(n);let f=document.createElement("article");f.className="error-result",f.innerHTML='\n <svg xmlns="http://www.w3.org/2000/svg" width="100" height="70" viewBox="0 0 100 68">\n <g id="large">\n <path fill="none" stroke="#F44" d="M55.8 38.5l6.2-1.2c0-1.8-.1-3.5-.4-5.3l-6.3-.2c-.5-2-1.2-4-2.1-6l4.8-4c-.9-1.6-1.9-3-3-4.4l-5.6 3c-1.3-1.6-3-3-4.7-4.1l2-6A30 30 0 0 0 42 8l-3.3 5.4c-2-.7-4.2-1-6.2-1.2L31.3 6c-1.8 0-3.5.1-5.3.4l-.2 6.3c-2 .5-4 1.2-6 2.1l-4-4.8c-1.6.9-3 1.9-4.4 3l3 5.6c-1.6 1.3-3 3-4.1 4.7l-6-2A32.5 32.5 0 0 0 2 26l5.4 3.3c-.7 2-1 4.2-1.2 6.2L0 36.7c0 1.8.1 3.5.4 5.3l6.3.2c.5 2 1.2 4 2.1 6l-4.8 4c.9 1.6 1.9 3 3 4.4l5.6-3c1.4 1.6 3 3 4.7 4.1l-2 6A30.5 30.5 0 0 0 20 66l3.4-5.4c2 .7 4 1 6.1 1.2l1.2 6.2c1.8 0 3.5-.1 5.3-.4l.2-6.3c2-.5 4-1.2 6-2.1l4 4.8c1.6-.9 3-1.9 4.4-3l-3-5.6c1.6-1.3 3-3 4.1-4.7l6 2A32 32 0 0 0 60 48l-5.4-3.3c.7-2 1-4.2 1.2-6.2zm-13.5 4a12.5 12.5 0 1 1-22.6-11 12.5 12.5 0 0 1 22.6 11z"/>\n <animateTransform attributeName="transform" begin="0s" dur="3s" from="0 31 37" repeatCount="indefinite" to="360 31 37" type="rotate"/>\n </g>\n <g id="small">\n <path fill="none" stroke="#F44" d="M93 19.3l6-3c-.4-1.6-1-3.2-1.7-4.8L90.8 13c-.9-1.4-2-2.7-3.4-3.8l2.1-6.3A21.8 21.8 0 0 0 85 .7l-3.6 5.5c-1.7-.4-3.4-.5-5.1-.3l-3-5.9c-1.6.4-3.2 1-4.7 1.7L70 8c-1.5 1-2.8 2-3.9 3.5L60 9.4a20.6 20.6 0 0 0-2.2 4.6l5.5 3.6a15 15 0 0 0-.3 5.1l-5.9 3c.4 1.6 1 3.2 1.7 4.7L65 29c1 1.5 2.1 2.8 3.5 3.9l-2.1 6.3a21 21 0 0 0 4.5 2.2l3.6-5.6c1.7.4 3.5.5 5.2.3l2.9 5.9c1.6-.4 3.2-1 4.8-1.7L86 34c1.4-1 2.7-2.1 3.8-3.5l6.3 2.1a21.5 21.5 0 0 0 2.2-4.5l-5.6-3.6c.4-1.7.5-3.5.3-5.1zM84.5 24a7 7 0 1 1-12.8-6.2 7 7 0 0 1 12.8 6.2z"/>\n <animateTransform attributeName="transform" begin="0s" dur="2s" from="0 78 21" repeatCount="indefinite" to="-360 78 21" type="rotate"/>\n </g>\n </svg>\n <h3>No Information found on this address. Please close and try again.</h3>\n ',h.appendChild(f),a.appendChild(h),t.appendChild(a);break;case"print":let y=JSON.parse(i[0].getAttribute("data-parcel-id"));t.appendChild(e.resultsStyle);let _=document.createElement("section");_.className="results-container",_.appendChild(n);let v=document.createElement("article");v.className="dataset-results";let A=document.createElement("article");A.className="result-address",A.innerText=y.address,v.appendChild(A);let S=e.buildDataSection(e);v.appendChild(S),_.appendChild(v),a.appendChild(_),t.appendChild(a),e.printInfo(e)}}}const s=a(530),o=a(7055);class l extends HTMLElement{static get observedAttributes(){return["data-loader-state","data-parcel-id"]}constructor(){super();const e=this.attachShadow({mode:"open"}),t=document.createElement("section");t.id="loader-wrapper",e.appendChild(t)}attributeChangedCallback(e,t,a){this.shadowRoot;if("data-loader-state"===e)this.clearLoader(this),this.loadLoader(this)}getDataSets(e){const t=document.getElementsByTagName("my-home-info"),a=t[0].getAttribute("data-active-sets").split(","),r=JSON.parse(t[0].getAttribute("data-parcel-id"));let n=[],i=new Promise(((e,t)=>{if("CONDO BUILDING"!=r.attributes.parcel_id){let t="https://apis.detroitmi.gov/assessments/parcel/"+r.attributes.parcel_id+"/";return fetch(t).then((e=>e.json())).then((function(t){e({id:"assessors-data",data:t})})).catch((e=>{}))}e({id:"assessors-data",data:null})})),l=new Promise(((e,t)=>{e({id:"neighborhood",data:r})})),d=new Promise(((e,t)=>e({id:"council",data:r}))),c=new Promise(((e,t)=>fetch("/rest/bop?_format=json").then((e=>e.json())).then((function(t){e({id:"bop-members",data:t})})).catch((e=>{})))),u=new Promise(((e,t)=>fetch("/rest/district-managers?_format=json").then((e=>e.json())).then((function(t){e({id:"district-managers",data:t})})).catch((e=>{})))),p=new Promise(((e,t)=>fetch("/rest/district-inspectors?_format=json").then((e=>e.json())).then((function(t){e({id:"district-inspectors",data:t})})).catch((e=>{})))),m=new Promise(((e,t)=>fetch("/rest/council-members?_format=json").then((e=>e.json())).then((function(t){e({id:"council-members",data:t})})).catch((e=>{})))),g=(new Promise(((e,t)=>{e({id:"DWSDBackupProtection",data:r})})),new Promise(((e,t)=>{e({id:"HRDFlooding",data:r})}))),b=new Promise(((e,t)=>{let a=`https://services2.arcgis.com/qvkbeam7Wirps6zC/arcgis/rest/services/NRSA_2020/FeatureServer/0/query?where=&objectIds=&time=&geometry=${r.location.x}%2C${r.location.y}&geometryType=esriGeometryPoint&inSR=4326&spatialRel=esriSpatialRelIntersects&resultType=none&distance=0.0&units=esriSRUnit_Meter&returnGeodetic=false&outFields=*&returnGeometry=true&returnCentroid=false&featureEncoding=esriDefault&multipatchOption=xyFootprint&maxAllowableOffset=&geometryPrecision=&outSR=&datumTransformation=&applyVCSProjection=false&returnIdsOnly=false&returnUniqueIdsOnly=false&returnCountOnly=false&returnExtentOnly=false&returnQueryGeometry=false&returnDistinctValues=false&cacheHint=false&orderByFields=&groupByFieldsForStatistics=&outStatistics=&having=&resultOffset=&resultRecordCount=&returnZ=false&returnM=false&returnExceededLimitFeatures=true&quantizationParameters=&sqlFormat=none&f=json&token=`;return fetch(a).then((e=>e.json())).then((function(t){e({id:"nrsa",data:t})})).catch((e=>{}))})),h=new Promise(((e,t)=>{let a=`https://services2.arcgis.com/qvkbeam7Wirps6zC/ArcGIS/rest/services/NEZHOMESTEAD2021/FeatureServer/0/query?where=&objectIds=&time=&geometry=${r.location.x}%2C${r.location.y}&geometryType=esriGeometryPoint&inSR=4326&spatialRel=esriSpatialRelIntersects&resultType=none&distance=0.0&units=esriSRUnit_Meter&returnGeodetic=false&outFields=*&returnGeometry=true&returnCentroid=false&featureEncoding=esriDefault&multipatchOption=xyFootprint&maxAllowableOffset=&geometryPrecision=&outSR=&datumTransformation=&applyVCSProjection=false&returnIdsOnly=false&returnUniqueIdsOnly=false&returnCountOnly=false&returnExtentOnly=false&returnQueryGeometry=false&returnDistinctValues=false&cacheHint=false&orderByFields=&groupByFieldsForStatistics=&outStatistics=&having=&resultOffset=&resultRecordCount=&returnZ=false&returnM=false&returnExceededLimitFeatures=true&quantizationParameters=&sqlFormat=none&f=json&token=`;return fetch(a).then((e=>e.json())).then((function(t){e({id:"nez",data:t})})).catch((e=>{}))})),f=new Promise(((e,t)=>{let a=`https://services2.arcgis.com/qvkbeam7Wirps6zC/ArcGIS/rest/services/BuildingPermits/FeatureServer/0/query?where=parcel_id+%3D+%27${r.attributes.parcel_id}%27&objectIds=&time=&geometry=&geometryType=esriGeometryEnvelope&inSR=&spatialRel=esriSpatialRelIntersects&resultType=none&distance=0.0&units=esriSRUnit_Meter&returnGeodetic=false&outFields=*&returnGeometry=true&featureEncoding=esriDefault&multipatchOption=xyFootprint&maxAllowableOffset=&geometryPrecision=&outSR=&datumTransformation=&applyVCSProjection=false&returnIdsOnly=false&returnUniqueIdsOnly=false&returnCountOnly=false&returnExtentOnly=false&returnQueryGeometry=false&returnDistinctValues=false&cacheHint=false&orderByFields=&groupByFieldsForStatistics=&outStatistics=&having=&resultOffset=&resultRecordCount=3&returnZ=false&returnM=false&returnExceededLimitFeatures=true&quantizationParameters=&sqlFormat=none&f=json`;return fetch(a).then((e=>e.json())).then((function(t){e({id:"permit-data",data:t})})).catch((e=>{}))})),y=new Promise(((e,t)=>{let a;return a="CONDO BUILDING"!=r.attributes.parcel_id?`https://services2.arcgis.com/qvkbeam7Wirps6zC/ArcGIS/rest/services/RentalStatuses/FeatureServer/0/query?where=parcel_id+%3D+%27${r.attributes.parcel_id}%27&objectIds=&time=&geometry=&geometryType=esriGeometryEnvelope&inSR=&spatialRel=esriSpatialRelIntersects&resultType=none&distance=0.0&units=esriSRUnit_Meter&returnGeodetic=false&outFields=*&returnGeometry=true&featureEncoding=esriDefault&multipatchOption=xyFootprint&maxAllowableOffset=&geometryPrecision=&outSR=&datumTransformation=&applyVCSProjection=false&returnIdsOnly=false&returnUniqueIdsOnly=false&returnCountOnly=false&returnExtentOnly=false&returnQueryGeometry=false&returnDistinctValues=false&cacheHint=false&orderByFields=&groupByFieldsForStatistics=&outStatistics=&having=&resultOffset=&resultRecordCount=&returnZ=false&returnM=false&returnExceededLimitFeatures=true&quantizationParameters=&sqlFormat=none&f=json`:`https://services2.arcgis.com/qvkbeam7Wirps6zC/ArcGIS/rest/services/RentalStatuses/FeatureServer/0/query?where=&objectIds=&time=&geometry=${r.location.x}%2C+${r.location.y}&geometryType=esriGeometryPoint&inSR=4326&spatialRel=esriSpatialRelIndexIntersects&distance=&units=esriSRUnit_Foot&relationParam=&outFields=*&returnGeometry=true&maxAllowableOffset=&geometryPrecision=&outSR=&gdbVersion=&returnDistinctValues=false&returnIdsOnly=false&returnCountOnly=false&returnExtentOnly=false&orderByFields=&groupByFieldsForStatistics=&outStatistics=&returnZ=false&returnM=false&multipatchOption=&resultOffset=&resultRecordCount=&f=json`,fetch(a).then((e=>e.json())).then((function(t){e({id:"rental-data",data:t})})).catch((e=>{}))})),_=new Promise(((e,t)=>{let a;return a="CONDO BUILDING"!=r.attributes.parcel_id?`https://services2.arcgis.com/qvkbeam7Wirps6zC/ArcGIS/rest/services/active_cofc/FeatureServer/0/query?where=parcel_id%3D%27${r.attributes.parcel_id}%27&objectIds=&time=&geometry=&geometryType=esriGeometryEnvelope&inSR=&spatialRel=esriSpatialRelIntersects&resultType=none&distance=0.0&units=esriSRUnit_Meter&returnGeodetic=false&outFields=*&returnGeometry=true&featureEncoding=esriDefault&multipatchOption=xyFootprint&maxAllowableOffset=&geometryPrecision=&outSR=&datumTransformation=&applyVCSProjection=false&returnIdsOnly=false&returnUniqueIdsOnly=false&returnCountOnly=false&returnExtentOnly=false&returnQueryGeometry=false&returnDistinctValues=false&cacheHint=false&orderByFields=&groupByFieldsForStatistics=&outStatistics=&having=&resultOffset=&resultRecordCount=1&returnZ=false&returnM=false&returnExceededLimitFeatures=true&quantizationParameters=&sqlFormat=none&f=json`:`https://services2.arcgis.com/qvkbeam7Wirps6zC/ArcGIS/rest/services/active_cofc/FeatureServer/0/query?where=&objectIds=&time=&geometry=${r.location.x}%2C+${r.location.y}&geometryType=esriGeometryPoint&inSR=4326&spatialRel=esriSpatialRelIndexIntersects&distance=&units=esriSRUnit_Foot&relationParam=&outFields=*&returnGeometry=true&maxAllowableOffset=&geometryPrecision=&outSR=&gdbVersion=&returnDistinctValues=false&returnIdsOnly=false&returnCountOnly=false&returnExtentOnly=false&orderByFields=&groupByFieldsForStatistics=&outStatistics=&returnZ=false&returnM=false&multipatchOption=&resultOffset=&resultRecordCount=&f=json`,fetch(a).then((e=>e.json())).then((function(t){e({id:"rental-cert-data",data:t})})).catch((e=>{}))})),v=new Promise(((e,t)=>{let a=`https://services2.arcgis.com/qvkbeam7Wirps6zC/arcgis/rest/services/Blight_Violations_(DAH)/FeatureServer/0/query?where=parcelno%3D%27${r.attributes.parcel_id}%27&objectIds=&time=&geometry=&geometryType=esriGeometryEnvelope&inSR=&spatialRel=esriSpatialRelIntersects&resultType=none&distance=0.0&units=esriSRUnit_Meter&returnGeodetic=false&outFields=*&returnGeometry=true&featureEncoding=esriDefault&multipatchOption=xyFootprint&maxAllowableOffset=&geometryPrecision=&outSR=&datumTransformation=&applyVCSProjection=false&returnIdsOnly=false&returnUniqueIdsOnly=false&returnCountOnly=false&returnExtentOnly=false&returnQueryGeometry=false&returnDistinctValues=false&cacheHint=false&orderByFields=violation_date&groupByFieldsForStatistics=&outStatistics=&having=&resultOffset=&resultRecordCount=2&returnZ=false&returnM=false&returnExceededLimitFeatures=true&quantizationParameters=&sqlFormat=none&f=json&token=`;return fetch(a).then((e=>e.json())).then((function(t){e({id:"blight-data",data:t})})).catch((e=>{}))})),A=new Promise(((e,t)=>{let a=`https://services2.arcgis.com/qvkbeam7Wirps6zC/arcgis/rest/services/Property_Sales/FeatureServer/0/query?where=PARCEL_NO%3D%27${r.attributes.parcel_id}%27&objectIds=&time=&geometry=&geometryType=esriGeometryEnvelope&inSR=&spatialRel=esriSpatialRelIntersects&resultType=none&distance=0.0&units=esriSRUnit_Meter&returnGeodetic=false&outFields=*&returnGeometry=true&featureEncoding=esriDefault&multipatchOption=xyFootprint&maxAllowableOffset=&geometryPrecision=&outSR=4326&datumTransformation=&applyVCSProjection=false&returnIdsOnly=false&returnUniqueIdsOnly=false&returnCountOnly=false&returnExtentOnly=false&returnQueryGeometry=false&returnDistinctValues=false&cacheHint=false&orderByFields=SALE_DATE&groupByFieldsForStatistics=&outStatistics=&having=&resultOffset=&resultRecordCount=2&returnZ=false&returnM=false&returnExceededLimitFeatures=true&quantizationParameters=&sqlFormat=none&f=json&token=`;return fetch(a).then((e=>e.json())).then((function(t){e({id:"sales-data",data:t})})).catch((e=>{}))})),S=new Promise(((t,a)=>{let n=s.point([r.location.x,r.location.y]),i=s.buffer(n,2,{units:"miles"}),l=s.simplify(i.geometry,{tolerance:.005,highQuality:!1}),d=o.convert(l),c=`https://services2.arcgis.com/qvkbeam7Wirps6zC/arcgis/rest/services/Demolitions_under_Contract/FeatureServer/0/query?where=&objectIds=&time=&geometry=${encodeURI(JSON.stringify(d))}&geometryType=esriGeometryPolygon&inSR=&spatialRel=esriSpatialRelIntersects&relationParam=&outFields=*&returnGeometry=true&returnTrueCurves=false&maxAllowableOffset=&geometryPrecision=&outSR=4326&returnIdsOnly=false&returnCountOnly=false&orderByFields=&groupByFieldsForStatistics=&outStatistics=&returnZ=false&returnM=false&gdbVersion=&returnDistinctValues=false&resultOffset=&resultRecordCount=&f=geojson`;return fetch(c).then((e=>e.json())).then((function(a){a.features.sort(e.sortFeaturesByDistanceTo(n)),t({id:"demos-data",data:a})})).catch((e=>{}))})),C=new Promise(((t,a)=>{let n=s.point([r.location.x,r.location.y]),i=s.buffer(n,2,{units:"miles"}),l=s.simplify(i.geometry,{tolerance:.005,highQuality:!1}),d=o.convert(l),c=`https://services2.arcgis.com/qvkbeam7Wirps6zC/arcgis/rest/services/Contracted_Stabilizations/FeatureServer/0/query?where=&objectIds=&time=&geometry=${encodeURI(JSON.stringify(d))}&geometryType=esriGeometryPolygon&inSR=&spatialRel=esriSpatialRelIntersects&relationParam=&outFields=*&returnGeometry=true&returnTrueCurves=false&maxAllowableOffset=&geometryPrecision=&outSR=4326&returnIdsOnly=false&returnCountOnly=false&orderByFields=&groupByFieldsForStatistics=&outStatistics=&returnZ=false&returnM=false&gdbVersion=&returnDistinctValues=false&resultOffset=&resultRecordCount=3&f=geojson`;return fetch(c).then((e=>e.json())).then((function(a){a.features.sort(e.sortFeaturesByDistanceTo(n)),t({id:"stabilization-data",data:a})})).catch((e=>{}))})),k=new Promise(((e,t)=>{let a=`https://services2.arcgis.com/qvkbeam7Wirps6zC/arcgis/rest/services/Demolitions_under_Contract/FeatureServer/0/query?where=parcel_id+%3D+%27${r.attributes.parcel_id}%27&objectIds=&time=&geometry=&geometryType=esriGeometryPolygon&inSR=&spatialRel=esriSpatialRelIntersects&resultType=none&distance=0.0&units=esriSRUnit_Meter&returnGeodetic=false&outFields=*&returnGeometry=true&featureEncoding=esriDefault&multipatchOption=xyFootprint&maxAllowableOffset=&geometryPrecision=&outSR=4326&datumTransformation=&applyVCSProjection=false&returnIdsOnly=false&returnUniqueIdsOnly=false&returnCountOnly=false&returnExtentOnly=false&returnQueryGeometry=false&returnDistinctValues=false&cacheHint=false&orderByFields=demolish_by_date&groupByFieldsForStatistics=&outStatistics=&having=&resultOffset=&resultRecordCount=1&returnZ=false&returnM=false&returnExceededLimitFeatures=true&quantizationParameters=&sqlFormat=none&f=json&token=`;return fetch(a).then((e=>e.json())).then((function(t){e({id:"demo-status",data:t})})).catch((e=>{}))})),D=new Promise(((t,a)=>{let n=s.point([r.location.x,r.location.y]),i=s.buffer(n,2,{units:"miles"}),l=s.simplify(i.geometry,{tolerance:.005,highQuality:!1}),d=o.convert(l),c=`https://services2.arcgis.com/qvkbeam7Wirps6zC/ArcGIS/rest/services/2018_2019_Schools_(EEM)/FeatureServer/0/query?where=&objectIds=&time=&geometry=${encodeURI(JSON.stringify(d))}&geometryType=esriGeometryPolygon&inSR=&spatialRel=esriSpatialRelIntersects&relationParam=&outFields=*&returnGeometry=true&returnTrueCurves=false&maxAllowableOffset=&geometryPrecision=&outSR=4326&returnIdsOnly=false&returnCountOnly=false&orderByFields=&groupByFieldsForStatistics=&outStatistics=&returnZ=false&returnM=false&gdbVersion=&returnDistinctValues=false&resultOffset=&resultRecordCount=&f=geojson`;return fetch(c).then((e=>e.json())).then((function(a){a.features.sort(e.sortFeaturesByDistanceTo(n)),t({id:"schools",data:a})})).catch((e=>{}))})),E=new Promise(((e,t)=>{let a=`https://services2.arcgis.com/qvkbeam7Wirps6zC/ArcGIS/rest/services/Neighborhood_Police_Officers/FeatureServer/0/query?where=&objectIds=&time=&geometry=${r.location.x}%2C${r.location.y}&geometryType=esriGeometryPoint&inSR=4326&spatialRel=esriSpatialRelIntersects&resultType=none&distance=1&units=esriSRUnit_Meter&returnGeodetic=false&outFields=*&returnGeometry=true&returnCentroid=false&multipatchOption=xyFootprint&maxAllowableOffset=&geometryPrecision=&outSR=4326&datumTransformation=&applyVCSProjection=false&returnIdsOnly=false&returnCountOnly=false&returnExtentOnly=false&returnDistinctValues=false&orderByFields=&groupByFieldsForStatistics=&outStatistics=&having=&resultOffset=&resultRecordCount=&returnZ=false&returnM=false&returnExceededLimitFeatures=true&quantizationParameters=&sqlFormat=none&f=json&token=`;return fetch(a).then((e=>e.json())).then((function(t){e({id:"npo",data:t})})).catch((e=>{}))})),w=new Promise(((e,t)=>{let a=s.point([r.location.x,r.location.y]),n=s.buffer(a,500,{units:"meters"}),i=s.simplify(n.geometry,{tolerance:.005,highQuality:!1}),l=o.convert(i),d=`https://services2.arcgis.com/qvkbeam7Wirps6zC/ArcGIS/rest/services/Improve_Detroit_Issues_Test/FeatureServer/0/query?where=status+%3C%3E+%27Closed%27+and+status+%3C%3E+%27Archived%27&objectIds=&time=&geometry=${encodeURI(JSON.stringify(l))}&geometryType=esriGeometryPolygon&inSR=&spatialRel=esriSpatialRelIntersects&relationParam=&outFields=*&returnGeometry=true&returnTrueCurves=false&maxAllowableOffset=&geometryPrecision=&outSR=4326&returnIdsOnly=false&returnCountOnly=false&orderByFields=&groupByFieldsForStatistics=&outStatistics=&returnZ=false&returnM=false&gdbVersion=&returnDistinctValues=false&resultOffset=&resultRecordCount=&f=geojson`;return fetch(d).then((e=>e.json())).then((function(t){e({id:"improve-det",data:t})})).catch((e=>{}))})),O=new Promise(((e,t)=>{let a="https://services2.arcgis.com/qvkbeam7Wirps6zC/arcgis/rest/services/WasteCollectionAreas/FeatureServer/0/query?where=&text=&objectIds=&time=&geometry="+r.location.x+"%2C+"+r.location.y+"&geometryType=esriGeometryPoint&inSR=4326&spatialRel=esriSpatialRelWithin&relationParam=&outFields=*&returnGeometry=true&returnTrueCurves=false&maxAllowableOffset=&geometryPrecision=&outSR=&returnIdsOnly=false&returnCountOnly=false&orderByFields=&groupByFieldsForStatistics=&outStatistics=&returnZ=false&returnM=false&gdbVersion=&returnDistinctValues=false&resultOffset=&resultRecordCount=&f=json";fetch(a).then((e=>e.json())).then((function(t){let a=new Date,r=a.getMonth()+1,n=a.getFullYear(),i=`https://apis.detroitmi.gov/waste_schedule/details/${t.features[0].attributes.FID}/year/${n}/month/${r}/`;return fetch(i).then((e=>e.json())).then((function(t){e({id:"recycling",data:t})}))})).catch((e=>{}))})),R=new Promise(((e,t)=>{let a="https://services2.arcgis.com/qvkbeam7Wirps6zC/ArcGIS/rest/services/Detroit_Local_Historic_Districts/FeatureServer/0/query?where=&text=&objectIds=&time=&geometry="+r.location.x+"%2C+"+r.location.y+"&geometryType=esriGeometryPoint&inSR=4326&spatialRel=esriSpatialRelWithin&relationParam=&outFields=*&returnGeometry=true&returnTrueCurves=false&maxAllowableOffset=&geometryPrecision=&outSR=&returnIdsOnly=false&returnCountOnly=false&orderByFields=&groupByFieldsForStatistics=&outStatistics=&returnZ=false&returnM=false&gdbVersion=&returnDistinctValues=false&resultOffset=&resultRecordCount=&f=json";fetch(a).then((e=>e.json())).then((function(t){e({id:"historicDistrict",data:t})})).catch((e=>{}))})),x=new Promise(((e,t)=>{let a=`https://services2.arcgis.com/qvkbeam7Wirps6zC/arcgis/rest/services/fie_properties_final/FeatureServer/0/query?where=parcel_id%3D%27${r.attributes.parcel_id}%27&objectIds=&time=&geometry=&geometryType=esriGeometryEnvelope&inSR=&spatialRel=esriSpatialRelIntersects&resultType=none&distance=0.0&units=esriSRUnit_Meter&returnGeodetic=false&outFields=*&returnHiddenFields=false&returnGeometry=true&returnCentroid=false&featureEncoding=esriDefault&multipatchOption=xyFootprint&maxAllowableOffset=&geometryPrecision=&outSR=&datumTransformation=&applyVCSProjection=false&returnIdsOnly=false&returnUniqueIdsOnly=false&returnCountOnly=false&returnExtentOnly=false&returnQueryGeometry=false&returnDistinctValues=false&cacheHint=false&orderByFields=&groupByFieldsForStatistics=&outStatistics=&having=&resultOffset=&resultRecordCount=&returnZ=false&returnM=false&returnExceededLimitFeatures=true&quantizationParameters=&sqlFormat=none&f=json&token=`;return fetch(a).then((e=>e.json())).then((function(t){e({id:"fireEscrow",data:t})})).catch((e=>{}))}));return a.forEach((e=>{switch(e){case"council":n.push(d);break;case"neighborhood":n.push(l);break;case"assessors-data":null!=r.attributes.parcel_id&&""!=r.attributes.parcel_id&&("CONDO BUILDING"==r.attributes.parcel_id||n.push(i));break;case"permit-data":null!=r.attributes.parcel_id&&""!=r.attributes.parcel_id&&n.push(f);break;case"blight-data":null!=r.attributes.parcel_id&&""!=r.attributes.parcel_id&&n.push(v);break;case"salesHistoryData":null!=r.attributes.parcel_id&&""!=r.attributes.parcel_id&&n.push(A);break;case"fireEscrow":null!=r.attributes.parcel_id&&""!=r.attributes.parcel_id&&n.push(x);break;case"nez":n.push(h);break;case"nrsa":n.push(b);break;case"npo":n.push(E);break;case"improve-det":n.push(w);break;case"recycling":n.push(O);break;case"rental-data":null!=r.attributes.parcel_id&&""!=r.attributes.parcel_id&&n.push(y);break;case"rental-cert":n.push(_);break;case"demo-status":null!=r.attributes.parcel_id&&""!=r.attributes.parcel_id&&n.push(k);break;case"demos-data":n.push(S);break;case"stabilization-data":n.push(C);break;case"schools":n.push(D);break;case"historicDistrict":n.push(R);break;case"district-managers":n.push(u);break;case"district-inspectors":n.push(p);break;case"council-members":n.push(m);break;case"bop-members":n.push(c);break;case"HRDFlooding":n.push(g)}})),n}buildCouncilData(e){let t={council:{district:`District ${e.council.data.attributes.council_district}`,districtURL:null,name:null,url:null,phone:null},bop:{district:`District ${e.council.data.attributes.council_district}`,url:null,name:null,url:null,phone:null,email:null},dmanager:{name:null,url:`/departments/department-of-neighborhoods/district-${e.council.data.attributes.council_district}#block-views-block-contacts-special-block-1`,phone:null},ddmanager:{name:null,url:`/departments/department-of-neighborhoods/district-${e.council.data.attributes.council_district}#block-views-block-contacts-special-block-1`,phone:null},bliaision:{name:null,email:null},enforcement:{name:null,phone:null}};switch(e.council.data.attributes.council_district.toString()){case"1":t.council.districtURL="/taxonomy/term/1276",e["council-members"].data.forEach((e=>{"1276"==e.tid&&(t.council.name=e.field_organization_head_name,t.council.url="/taxonomy/term/1276",t.council.phone=e.field_phone)})),e["bop-members"].data.forEach((e=>{if(e.field_responsibilities.includes("District 1")){t.bop.name=e.title,t.bop.url="/taxonomy/term/4331";let a=e.field_telephone.replace(/ /g,"-");a=a.replace(/[()]/g,""),t.bop.phone=`<a href="tel:${a}">${e.field_telephone}</a>`,t.bop.email=e.field_email_address}})),e["district-managers"].data.forEach((e=>{e.field_contact_position.includes("District 1 Manager")&&(t.dmanager.name=e.title,t.dmanager.phone=e.field_telephone),e.field_contact_position.includes("District 1 Deputy Manager")&&(t.ddmanager.name=e.title,t.ddmanager.phone=e.field_telephone),e.field_contact_position.includes("District 1 Business Liaison")&&(t.bliaision.name=e.title,t.bliaision.email=e.field_email_address)})),e["district-inspectors"].data.forEach((e=>{e.field_responsibilities.includes("District 1")&&(t.enforcement.name=e.title,t.enforcement.phone=e.field_telephone)}));break;case"2":t.council.districtURL="/taxonomy/term/1476",e["council-members"].data.forEach((e=>{"1476"==e.tid&&(t.council.name=e.field_organization_head_name,t.council.url="/taxonomy/term/1476",t.council.phone=e.field_phone)})),e["bop-members"].data.forEach((e=>{if(e.field_responsibilities.includes("District 2")){t.bop.name=e.title,t.bop.url="/taxonomy/term/4336";let a=e.field_telephone.replace(/ /g,"-");a=a.replace(/[()]/g,""),t.bop.phone=`<a href="tel:${a}">${e.field_telephone}</a>`,t.bop.email=e.field_email_address}})),e["district-managers"].data.forEach((e=>{e.field_contact_position.includes("District 2 Manager")&&(t.dmanager.name=e.title,t.dmanager.phone=e.field_telephone),e.field_contact_position.includes("District 2 Deputy Manager")&&(t.ddmanager.name=e.title,t.ddmanager.phone=e.field_telephone),e.field_contact_position.includes("District 2 Business Liaison")&&(t.bliaision.name=e.title,t.bliaision.email=e.field_email_address)})),e["district-inspectors"].data.forEach((e=>{e.field_responsibilities.includes("District 2")&&(t.enforcement.name=e.title,t.enforcement.phone=e.field_telephone)}));break;case"3":t.council.districtURL="/taxonomy/term/1481",e["council-members"].data.forEach((e=>{"1481"==e.tid&&(t.council.name=e.field_organization_head_name,t.council.url="/taxonomy/term/1481",t.council.phone=e.field_phone)})),e["bop-members"].data.forEach((e=>{if(e.field_responsibilities.includes("District 3")){t.bop.name=e.title,t.bop.url="/taxonomy/term/4341";let a=e.field_telephone.replace(/ /g,"-");a=a.replace(/[()]/g,""),t.bop.phone=`<a href="tel:${a}">${e.field_telephone}</a>`,t.bop.email=e.field_email_address}})),e["district-managers"].data.forEach((e=>{e.field_contact_position.includes("District 3 Manager")&&(t.dmanager.name=e.title,t.dmanager.phone=e.field_telephone),e.field_contact_position.includes("District 3 Deputy Manager")&&(t.ddmanager.name=e.title,t.ddmanager.phone=e.field_telephone),e.field_contact_position.includes("District 3 Business Liaison")&&(t.bliaision.name=e.title,t.bliaision.email=e.field_email_address)})),e["district-inspectors"].data.forEach((e=>{e.field_responsibilities.includes("District 3")&&(t.enforcement.name=e.title,t.enforcement.phone=e.field_telephone)}));break;case"4":t.council.districtURL="/taxonomy/term/1486",e["council-members"].data.forEach((e=>{"1486"==e.tid&&(t.council.name=e.field_organization_head_name,t.council.url="/taxonomy/term/1486",t.council.phone=e.field_phone)})),e["bop-members"].data.forEach((e=>{if(e.field_responsibilities.includes("District 4")){t.bop.name=e.title,t.bop.url="/taxonomy/term/4346";let a=e.field_telephone.replace(/ /g,"-");a=a.replace(/[()]/g,""),t.bop.phone=`<a href="tel:${a}">${e.field_telephone}</a>`,t.bop.email=e.field_email_address}})),e["district-managers"].data.forEach((e=>{e.field_contact_position.includes("District 4 Manager")&&(t.dmanager.name=e.title,t.dmanager.phone=e.field_telephone),e.field_contact_position.includes("District 4 Deputy Manager")&&(t.ddmanager.name=e.title,t.ddmanager.phone=e.field_telephone),e.field_contact_position.includes("District 4 Business Liaison")&&(t.bliaision.name=e.title,t.bliaision.email=e.field_email_address)})),e["district-inspectors"].data.forEach((e=>{e.field_responsibilities.includes("District 4")&&(t.enforcement.name=e.title,t.enforcement.phone=e.field_telephone)}));break;case"5":t.council.districtURL="/taxonomy/term/1346",e["council-members"].data.forEach((e=>{"1346"==e.tid&&(t.council.name=e.field_organization_head_name,t.council.url="/taxonomy/term/1346",t.council.phone=e.field_phone)})),e["bop-members"].data.forEach((e=>{if(e.field_responsibilities.includes("District 5")){t.bop.name=e.title,t.bop.url="/taxonomy/term/4351";let a=e.field_telephone.replace(/ /g,"-");a=a.replace(/[()]/g,""),t.bop.phone=`<a href="tel:${a}">${e.field_telephone}</a>`,t.bop.email=e.field_email_address}})),e["district-managers"].data.forEach((e=>{e.field_contact_position.includes("District 5 Manager")&&(t.dmanager.name=e.title,t.dmanager.phone=e.field_telephone),e.field_contact_position.includes("District 5 Deputy Manager")&&(t.ddmanager.name=e.title,t.ddmanager.phone=e.field_telephone),e.field_contact_position.includes("District 5 Business Liaison")&&(t.bliaision.name=e.title,t.bliaision.email=e.field_email_address)})),e["district-inspectors"].data.forEach((e=>{e.field_responsibilities.includes("District 5")&&(t.enforcement.name=e.title,t.enforcement.phone=e.field_telephone)}));break;case"6":t.council.districtURL="/taxonomy/term/1491",e["council-members"].data.forEach((e=>{if("1491"==e.tid){let a=e.field_phone.replace("Office: ","");a=a.replace(/ /g,"-"),a=a.replace(/[()]/g,""),t.council.name=e.field_organization_head_name,t.council.url="/taxonomy/term/1491",t.council.phone=`<a href="tel:${a}">${e.field_phone}</a>`}})),e["bop-members"].data.forEach((e=>{if(e.field_responsibilities.includes("District 6")){t.bop.name=e.title,t.bop.url="/taxonomy/term/4321";let a=e.field_telephone.replace(/ /g,"-");a=a.replace(/[()]/g,""),t.bop.phone=`<a href="tel:${a}">${e.field_telephone}</a>`,t.bop.email=e.field_email_address}})),e["district-managers"].data.forEach((e=>{if(e.field_contact_position.includes("District 6 Manager")){let a=e.field_telephone.replace(/ /g,"-");a=a.replace(/[()]/g,""),t.dmanager.name=e.title,t.dmanager.phone=`<a href="tel:${a}">${e.field_telephone}</a>`}if(e.field_contact_position.includes("District 6 Deputy Manager")){let a=e.field_telephone.replace(/ /g,"-");a=a.replace(/[()]/g,""),t.ddmanager.name=e.title,t.ddmanager.phone=`<a href="tel:${a}">${e.field_telephone}</a>`}e.field_contact_position.includes("District 6 Business Liaison")&&(t.bliaision.name=e.title,t.bliaision.email=e.field_email_address)})),e["district-inspectors"].data.forEach((e=>{if(e.field_responsibilities.includes("District 6")){let a=e.field_telephone.replace(/ /g,"-");a=a.replace(/[()]/g,""),t.enforcement.name=e.title,t.enforcement.phone=`<a href="tel:${a}">${e.field_telephone}</a>`}}));break;case"7":t.council.districtURL="/taxonomy/term/1511",e["council-members"].data.forEach((e=>{"1511"==e.tid&&(t.council.name=e.field_organization_head_name,t.council.url="/taxonomy/term/1511",t.council.phone=e.field_phone)})),e["bop-members"].data.forEach((e=>{if(e.field_responsibilities.includes("District 7")){t.bop.name=e.title,t.bop.url="/taxonomy/term/4356";let a=e.field_telephone.replace(/ /g,"-");a=a.replace(/[()]/g,""),t.bop.phone=`<a href="tel:${a}">${e.field_telephone}</a>`,t.bop.email=e.field_email_address}})),e["district-managers"].data.forEach((e=>{e.field_contact_position.includes("District 7 Manager")&&(t.dmanager.name=e.title,t.dmanager.phone=e.field_telephone),e.field_contact_position.includes("District 7 Deputy Manager")&&(t.ddmanager.name=e.title,t.ddmanager.phone=e.field_telephone),e.field_contact_position.includes("District 7 Business Liaison")&&(t.bliaision.name=e.title,t.bliaision.email=e.field_email_address)})),e["district-inspectors"].data.forEach((e=>{e.field_responsibilities.includes("District 7")&&(t.enforcement.name=e.title,t.enforcement.phone=e.field_telephone)}))}return t}sortFeaturesByDistanceTo(e){return function(t,a){var r={units:"radians"};return s.distance(e,t,r)-s.distance(e,a,r)}}getData(e){const t=document.getElementsByTagName("my-home-info"),a=t[0].getAttribute("data-active-sets").split(","),r=(JSON.parse(t[0].getAttribute("data-parcel-id")),JSON.parse(t[0].getAttribute("data-api-stored-datasets")));let n=!1;for(let i in r)a.includes(i)&&(n=!0);if(n){let e={};a.forEach((t=>{e[t]=r[t]})),t[0].setAttribute("data-api-active-datasets",JSON.stringify(e)),t[0].setAttribute("data-app-state","results")}else{let r=e.getDataSets(e);Promise.all(r).then((r=>{let n={};for(let e in r)null!=r[e]?n[r[e].id]=r[e]:initialLoadChecker=!1;if(a.includes("council")){let t=e.buildCouncilData(n);n["council-members"]={id:"council-members",data:t.council},n["bop-members"]={id:"bop-members",data:t.bop};let a={manager:t.dmanager,deputy:t.ddmanager};n["district-managers"]={id:"district-managers",data:a},n["business-liaison"]={id:"business-liaison",data:t.bliaision},n["district-inspectors"]={id:"district-inspectors",data:t.enforcement}}if(a.includes("DWSDBackupProtection"))try{n.DWSDBackupProtection||(n.DWSDBackupProtection={id:"DWSDBackupProtection",data:n.neighborhood.data})}catch(i){}t[0].setAttribute("data-api-active-datasets",JSON.stringify(n)),t[0].setAttribute("data-app-state","results")})).catch((e=>{}))}}clearLoader(e){const t=e.shadowRoot;for(;t.firstChild;)t.removeChild(t.firstChild)}loadLoader(e){const t=e.shadowRoot,a=document.createElement("section");switch(a.id="loader-wrapper",e.getAttribute("data-loader-state")){case"active":e.getData(e);const r=document.createElement("p");r.innerText="Loading DATA",a.appendChild(r),t.appendChild(a);break;case"finished":const n=document.createElement("p");n.innerText="Data loaded",a.appendChild(n),t.appendChild(a)}}}customElements.define("app-display",i),customElements.define("app-data-loader",l);class d extends HTMLElement{static get observedAttributes(){return["data-app-state","data-parcel-id","data-map-state"]}constructor(){super();const e=this.attachShadow({mode:"open"});let t=document.getElementsByTagName("my-home-info")[0].getAttribute("data-app-state");const a=document.createElement("section");a.id="app-wrapper";const r=document.createElement("app-display");"active-screen"==t?r.setAttribute("data-display-type","active"):r.setAttribute("data-display-type","welcome"),a.appendChild(r),e.appendChild(a)}attributeChangedCallback(e,t,a){this.shadowRoot;const r=document.getElementsByTagName("my-home-info")[0].getAttribute("data-app-mode");switch(e){case"data-app-state":null!=t&&(this.clearApp(this),this.loadApp(this));break;case"data-parcel-id":"none"!=a?this.setAttribute("data-app-state","loading-screen"):"my-home-info"==r&&this.setAttribute("data-app-state","welcome-screen");break;case"data-map-state":break;default:console.log("not catched")}}clearApp(e){const t=e.shadowRoot;for(;t.firstChild;)t.removeChild(t.firstChild)}loadApp(e){const t=e.shadowRoot,a=document.createElement("div");a.id="app-wrapper";const r=document.createElement("app-display"),n=document.createElement("app-data-loader");switch(e.getAttribute("data-app-state")){case"welcome-screen":r.setAttribute("data-display-type","welcome"),a.appendChild(r);break;case"active-screen":r.setAttribute("data-display-type","active"),a.appendChild(r);break;case"loading-screen":r.setAttribute("data-display-type","loading"),n.setAttribute("data-loader-state","active"),a.appendChild(r);break;case"results":r.setAttribute("data-display-type","results"),a.appendChild(r);break;case"map":const e=document.createElement("cod-map");e.id="cod-map";let t=JSON.parse(this.getAttribute("data-api-active-datasets")),i=this.getAttribute("data-map-active-data");const s={id:"mapData",layers:[{name:"data-points",type:"circle",radius:6,color:"#004445",active:!0,sort:10,source:"data-points"}],source:t[i].data};let o;switch(i){case"schools":o={schools:[{type:"field-value",label:"Name:",value:"EntityOfficialName"}]};break;case"demos-data":o={"demos-data":[{type:"field-value",label:"Address:",value:"address"}]};break;case"stabilization-data":o={"stabilization-data":[{type:"field-value",label:"Address:",value:"address"}]};break;case"improve-det":o={"improve-det":[{type:"field-value",label:"Address:",value:"Address"},{type:"field-value",label:"Type:",value:"Request_Type_Title"}]}}e.setAttribute("data-parent-component","my-home-info"),e.setAttribute("data-map-mode","my-home-info"),e.setAttribute("data-map-active-data",this.getAttribute("data-map-active-data")),e.setAttribute("data-popup-structure",JSON.stringify(o)),e.setAttribute("data-map-data",JSON.stringify(s)),e.setAttribute("data-location",this.getAttribute("data-parcel-id")),e.setAttribute("data-map-state","init"),a.appendChild(e);break;case"error":r.setAttribute("data-display-type","error"),a.appendChild(r);break;case"print":r.setAttribute("data-display-type","print"),a.appendChild(r)}null==t.firstChild&&t.appendChild(a)}}var c=a(2181),u=a(9766),p=a(6869);customElements.define("my-home-info",d),c.S1({dsn:"https://536fad340d72a07ee08fe3df749b982e@o4505717305704448.ingest.sentry.io/4505720878792704",release:"local-services-lookup@2.0.9",integrations:[new u.gE,new p.U],tracesSampleRate:1,tracePropagationTargets:["localhost",/^https:\/\/detroitmi\.gov/],replaysSessionSampleRate:.1,replaysOnErrorSampleRate:1})}},e=>{e.O(0,[315,152,47,600,489],(()=>{return t=2789,e(e.s=t);var t}));e.O()}]); //# sourceMappingURL=main.js.map \ No newline at end of file diff --git a/build/assets/js/main.js.map b/build/assets/js/main.js.map index f55b71c..0b5ffcb 100644 --- a/build/assets/js/main.js.map +++ b/build/assets/js/main.js.map @@ -1 +1 @@ -{"version":3,"file":"assets/js/main.js","mappings":"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","sources":["webpack://local-services-lookup/./src/components/Geocoder.js","webpack://local-services-lookup/./src/components/NavigationTools.js","webpack://local-services-lookup/./src/components/Display.js","webpack://local-services-lookup/./src/components/DataLoader.js","webpack://local-services-lookup/./src/components/MyHomeInfo.js","webpack://local-services-lookup/./src/index.js"],"sourcesContent":["'use strict';\nexport default class Geocoder extends HTMLElement {\n\n static get observedAttributes() {\n return ['form', 'parcelStatus', 'user'];\n }\n\n constructor() {\n // Always call super first in constructor\n super();\n\n // Set Attributes\n this.form = null;\n this.parcelStatus = 'Invalid';\n this.user = null;\n this.styles = document.createElement('style');\n this.styles.textContent = `\n @import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@100;700&display=swap')\n #geocoder {width: 100%}\n input {width: calc(100% - 2em); padding: 1em; border:.1em solid #e6e6e6; font-size: 1em;}\n `;\n\n // Create a shadow root\n const shadow = this.attachShadow({ mode: 'open' });\n\n // Create geocoder section\n shadow.appendChild(this.styles);\n const geocoderWraper = document.createElement('article');\n geocoderWraper.id = 'geocoder';\n let form = document.createElement('form');\n let label = document.createElement('label');\n label.style.fontFamily = 'Montserrat, sans-serif';\n label.style.fontWeight = 'bold';\n let input = document.createElement('input');\n let suggestions = document.createElement('ul');\n let list = document.createElement('datalist');\n let icon = document.createElement('i');\n form.addEventListener('submit', (ev) => {\n this.submit(ev, this);\n });\n icon.className = 'fas fa-map-marker-alt';\n // Get label text\n const app = document.getElementsByTagName('my-home-info');\n label.innerText = \"Property Address:\";\n try {\n if (app[0].getAttribute('data-geocoder-label')){\n if(app[0].getAttribute('data-geocoder-label') != ''){\n label.innerText = app[0].getAttribute('data-geocoder-label');\n }\n }\n } catch (error) {\n \n }\n label.setAttribute(\"for\", \"geocoder-input\");\n input.type = 'text';\n input.setAttribute('list', 'addresses-list');\n input.placeholder = 'Enter address';\n input.setAttribute('id', 'geocoder-input');\n input.setAttribute('autocomplete', 'off');\n input.addEventListener('keyup', (ev) => {\n this.inputChange(ev, this);\n });\n list.setAttribute('id', 'addresses-list');\n\n\n form.appendChild(label);\n form.appendChild(input);\n form.appendChild(icon);\n // form.appendChild(suggestions);\n form.appendChild(list);\n this.form = form;\n geocoderWraper.appendChild(form);\n shadow.appendChild(geocoderWraper);\n }\n\n supplementGeocoder(address, geocoder, type) {\n const app = document.getElementsByTagName('my-home-info');\n let tempAddr = address.split(\",\");\n tempAddr = tempAddr[0];\n tempAddr = tempAddr.split(\" \");\n let newTempAddr = '';\n let size = tempAddr.length;\n tempAddr.forEach(function (item, index) {\n newTempAddr += item;\n ((index < size) && (index + 1) !== size) ? newTempAddr += '+' : 0;\n });\n let url = `https://opengis.detroitmi.gov/opengis/rest/services/BaseUnits/BaseUnitGeocoder/GeocodeServer/findAddressCandidates?Address=&Address2=&Address3=&Neighborhood=&City=&Subregion=&Region=&Postal=&PostalExt=&CountryCode=&SingleLine=${newTempAddr}&outFields=*&maxLocations=&matchOutOfRange=true&langCode=&locationType=&sourceCountry=&category=&location=&distance=&searchExtent=&outSR=&magicKey=&f=json`;\n\n try {\n fetch(url)\n .then((resp) => resp.json()) // Transform the data into json\n .then(function (data) {\n // console.log(data);\n if (type === 'suggestions') {\n data.candidates.forEach((item) => {\n let sugg = document.createElement('option');\n if (item.attributes.parcel_id === '') {\n sugg.value = item.address;\n sugg.setAttribute('data-parsel', 'no-parcel');\n } else {\n sugg.value = `${item.address} RECOMMENDED`;\n sugg.setAttribute('data-parsel', item.attributes.parcel_id);\n }\n\n sugg.onclick = (ev) => {\n geocoder.selectSuggestion(ev, geocoder);\n }\n geocoder.form.childNodes[3].appendChild(sugg);\n });\n } else {\n if (data.candidates.length) {\n let url = `https://services2.arcgis.com/qvkbeam7Wirps6zC/arcgis/rest/services/City_of_Detroit_Boundary/FeatureServer/0/query?where=&objectIds=&time=&geometry=${data.candidates[0].location.x}%2C+${data.candidates[0].location.y}&geometryType=esriGeometryPoint&inSR=4326&spatialRel=esriSpatialRelIntersects&resultType=none&distance=0.0&units=esriSRUnit_Meter&returnGeodetic=false&outFields=4326&returnGeometry=true&returnCentroid=false&multipatchOption=xyFootprint&maxAllowableOffset=&geometryPrecision=&outSR=&datumTransformation=&applyVCSProjection=false&returnIdsOnly=false&returnUniqueIdsOnly=false&returnCountOnly=false&returnExtentOnly=false&returnDistinctValues=false&orderByFields=&groupByFieldsForStatistics=&outStatistics=&having=&resultOffset=&resultRecordCount=&returnZ=false&returnM=false&returnExceededLimitFeatures=true&quantizationParameters=&sqlFormat=none&f=geojson&token=`;\n try {\n fetch(url)\n .then((resp) => resp.json()) // Transform the data into json\n .then(function (city) {\n if (city.features.length) {\n let parcel = null;\n let location;\n data.candidates.forEach((item) => {\n if (item.attributes.parcel_id !== '') {\n if (geocoder.checkParcelValid(item.attributes.parcel_id)) {\n parcel = item;\n }\n }\n });\n (parcel == null) ? location = data.candidates[0].location : location = null;\n if (parcel === null) {\n geocoder.parcelStatus = 'Invalid';\n geocoder.needGeocode(address, geocoder, location);\n geocoder.clearSuggestions(geocoder);\n app[0].setAttribute('data-parcel-id', JSON.stringify(data.candidates[0]));\n // geocoder.controller.panel.loaderToggle(true);\n // geocoder.controller.panel.clearPanel();\n // geocoder.controller.dataManager.buildData(data.candidates[0], geocoder.controller);\n } else {\n geocoder.parcelStatus = 'Valid';\n geocoder.needGeocode(address, geocoder, location);\n geocoder.clearSuggestions(geocoder);\n app[0].setAttribute('data-parcel-id', JSON.stringify(parcel));\n // geocoder.controller.panel.loaderToggle(true);\n // geocoder.controller.panel.clearPanel();\n // geocoder.controller.dataManager.buildData(parcel, geocoder.controller);\n }\n } else {\n geocoder.parcelStatus = 'Invalid';\n geocoder.needGeocode(address, geocoder, location);\n geocoder.clearSuggestions(geocoder);\n app[0].setAttribute('data-app-state', 'error');\n }\n });\n } catch (error) {\n geocoder.parcelStatus = 'Invalid';\n geocoder.needGeocode(address, geocoder, location);\n geocoder.clearSuggestions(geocoder);\n app[0].setAttribute('data-app-state', 'error');\n }\n } else {\n geocoder.parcelStatus = 'Invalid';\n geocoder.needGeocode(address, geocoder, location);\n geocoder.clearSuggestions(geocoder);\n app[0].setAttribute('data-app-state', 'error');\n }\n }\n });\n } catch (error) {\n geocoder.parcelStatus = 'Invalid';\n geocoder.needGeocode(address, geocoder, location);\n geocoder.clearSuggestions(geocoder);\n app[0].setAttribute('data-app-state', 'error');\n }\n }\n\n selectSuggestion(ev, geocoder) {\n let selection = null;\n if (ev.target.tagName === 'SPAN') {\n selection = ev.target.parentNode;\n } else {\n selection = ev.target;\n }\n if (selection.attributes[0].value === 'no-parcel') {\n geocoder.clearSuggestions(geocoder);\n geocoder.supplementGeocoder(selection.innerText, geocoder, 'submit');\n } else {\n geocoder.supplementGeocoder(selection.innerText, geocoder, 'submit');\n }\n }\n\n inputChange(ev, geocoder) {\n switch (ev.key) {\n case 'Enter':\n (ev.target.value != '' && ev.target.value != undefined) ? geocoder.supplementGeocoder(ev.target.value, geocoder, 'submit') : 0;\n break;\n\n case 'ArrowDown':\n\n break;\n\n case 'ArrowUp':\n\n break;\n\n case 'ArrowRight':\n\n break;\n\n case 'ArrowLeft':\n\n break;\n\n case undefined:\n (ev.target.value != '' && ev.target.value != undefined) ? geocoder.supplementGeocoder(ev.target.value, geocoder, 'submit') : 0;\n break;\n\n default:\n geocoder.clearSuggestions(geocoder);\n geocoder.supplementGeocoder(ev.target.value, geocoder, 'suggestions');\n break;\n }\n }\n\n clearSuggestions(geocoder) {\n while (geocoder.form.childNodes[3].firstChild) {\n geocoder.form.childNodes[3].removeChild(geocoder.form.childNodes[3].firstChild);\n }\n }\n\n needGeocode(address, geocoder, location) {\n fetch('https://us-central1-local-services-loopkup.cloudfunctions.net/getToken')\n .then((resp) => resp.json()) // Transform the data into json\n .then(function (data) {\n let cleanAddress = address.split(' RECOMMENDED')[0];\n let params = [\n {\n \"attributes\": {\n \"valid_parcel_status\": geocoder.parcelStatus,\n \"user_input\": cleanAddress\n },\n \"geometry\": {\n \"x\": 0,\n \"y\": 0\n }\n }\n ];\n if (location != null) {\n params[0].geometry.x = location.x;\n params[0].geometry.y = location.y;\n }\n let request = new Request(`https://services2.arcgis.com/qvkbeam7Wirps6zC/ArcGIS/rest/services/addressvalidator/FeatureServer/0/addFeatures?token=${data.access_token}&features=${encodeURIComponent(JSON.stringify(params))}&f=json`, {\n method: 'POST',\n body: '',\n headers: new Headers(),\n mode: 'cors',\n cache: 'default'\n });\n fetch(request)\n .then((res) => {\n // console.log(res);\n });\n });\n }\n\n checkParcelValid(parcel){\n return /\\d/.test(parcel);\n }\n\n submit(ev, geocoder) {\n ev.preventDefault();\n geocoder.supplementGeocoder(ev.target['0'].value, geocoder, 'submit');\n }\n}","export default class NavigationTools extends HTMLElement {\n\n constructor() {\n // Always call super first in constructor\n super();\n\n // Create a shadow root\n const shadow = this.attachShadow({ mode: 'open' });\n\n // Creating display styles\n this.navToolsStyle = document.createElement('style');\n this.navToolsStyle.textContent = `\n #nav-tools-wrapper { display: flex; flex-direction: column;}\n button.clear { font-size: 1.25em; width: 2.5em; height: 2.5em; background-color: #FEB70D; cursor: pointer; border: none; }\n button.nav { width: 3.75em; height: 3.75em; border: none; cursor: pointer;background: #fff; }\n button.nav:hover { background-color: #e6e6e6; transition: all 500ms cubic-bezier(.64,.09,.08,1); }\n button.nav.active { background-color: #9fd5b3; }\n button.nav img { width: 100%; }\n `;\n\n // Start loading display content\n this.loadNavTools(this);\n }\n\n clearDisplay(display) {\n const shadow = display.shadowRoot;\n while (shadow.firstChild) {\n shadow.removeChild(shadow.firstChild);\n }\n }\n\n loadNavTools(navTools) {\n const app = document.getElementsByTagName('my-home-info');\n const appStatus = app[0].getAttribute('data-app-state');\n const appMode = app[0].getAttribute('data-app-mode');\n const initialSets = app[0].getAttribute('data-inital-sets');\n const initalMapStatus = app[0].getAttribute('data-initial-map-available');\n const shadow = navTools.shadowRoot;\n shadow.appendChild(navTools.navToolsStyle);\n const navToolsWrapper = document.createElement('section');\n navToolsWrapper.id = 'nav-tools-wrapper';\n navToolsWrapper.setAttribute('role', 'navigation');\n navToolsWrapper.setAttribute('aria-label', 'Data Navigation');\n const clearResultsBtn = document.createElement('cod-button');\n clearResultsBtn.addEventListener('click', (ev) => {\n if (app[0].getAttribute('data-app-mode') == 'my-home-info') {\n app[0].setAttribute('data-app-state', 'welcome-screen');\n app[0].setAttribute('data-active-sets', 'assessors-data,neighborhood,recycling,rental-data,rental-cert,demo-status,blight-data,permit-data,DWSDBackupProtection');\n } else {\n app[0].setAttribute('data-app-state', 'active-screen');\n app[0].setAttribute('data-active-sets', initialSets);\n }\n if(initalMapStatus == 'true'){\n app[0].setAttribute('data-map-available', 'true');\n }else{\n app[0].setAttribute('data-map-available', 'false');\n }\n app[0].setAttribute('data-parcel-id', 'none');\n app[0].setAttribute('data-api-stored-datasets', '{}');\n app[0].setAttribute('data-api-active-datasets', 'none');\n app[0].setAttribute('data-active-section', 'property');\n });\n clearResultsBtn.setAttribute('data-primary', true);\n clearResultsBtn.setAttribute('data-label', 'x');\n clearResultsBtn.setAttribute('data-size', 'lg');\n clearResultsBtn.setAttribute('data-hover', false);\n clearResultsBtn.setAttribute('data-extra-classes', 'fw-bold');\n clearResultsBtn.setAttribute('data-background-color', 'warning');\n clearResultsBtn.setAttribute('data-img', '');\n clearResultsBtn.setAttribute('data-img-alt', '');\n clearResultsBtn.setAttribute('data-shape', 'square');\n clearResultsBtn.setAttribute('data-icon', '');\n navToolsWrapper.appendChild(clearResultsBtn);\n\n if (appMode == 'my-home-info' && appStatus != 'error') {\n const propertyDataBtn = document.createElement('cod-button');\n propertyDataBtn.setAttribute('data-label', '');\n propertyDataBtn.setAttribute('data-size', 'lg');\n propertyDataBtn.setAttribute('data-img', 'https://detroitmi.gov/sites/detroitmi.localhost/files/2023-01/home.png');\n propertyDataBtn.setAttribute('data-img-alt', 'about this property');\n propertyDataBtn.setAttribute('data-shape', 'square');\n propertyDataBtn.setAttribute('data-nav-value', 'about this property');\n propertyDataBtn.setAttribute('data-icon', '');\n if (app[0].getAttribute('data-active-section') == 'about this property') {\n propertyDataBtn.setAttribute('data-background-color', 'success');\n propertyDataBtn.setAttribute('data-primary', true);\n } else {\n propertyDataBtn.setAttribute('data-background-color', 'secondary');\n propertyDataBtn.setAttribute('data-primary', false);\n propertyDataBtn.addEventListener('click', (ev) => {\n if (app[0].getAttribute('data-api-active-datasets') != 'none') {\n let storedData = JSON.parse(app[0].getAttribute('data-api-stored-datasets'));\n let activeData = JSON.parse(app[0].getAttribute('data-api-active-datasets'));\n for (const key in activeData) {\n if (!(key in storedData)) {\n storedData[key] = activeData[key];\n }\n }\n app[0].setAttribute('data-api-stored-datasets', JSON.stringify(storedData));\n }\n app[0].setAttribute('data-api-active-datasets', 'none');\n app[0].setAttribute('data-active-sets', 'assessors-data,neighborhood,recycling,rental-data,rental-cert,demo-status,blight-data,permit-data,DWSDBackupProtection');\n app[0].setAttribute('data-map-available', 'false');\n app[0].setAttribute('data-active-section', 'about this property');\n app[0].setAttribute('data-app-state', 'loading-screen');\n })\n }\n navToolsWrapper.appendChild(propertyDataBtn);\n\n const govDataBtn = document.createElement('cod-button');\n govDataBtn.setAttribute('data-label', '');\n govDataBtn.setAttribute('data-size', 'lg');\n govDataBtn.setAttribute('data-img', 'https://detroitmi.gov/sites/detroitmi.localhost/files/2023-01/government.png');\n govDataBtn.setAttribute('data-img-alt', 'government officials');\n govDataBtn.setAttribute('data-shape', 'square');\n govDataBtn.setAttribute('data-nav-value', 'government officials');\n govDataBtn.setAttribute('data-icon', '');\n if (app[0].getAttribute('data-active-section') == 'government officials') {\n govDataBtn.setAttribute('data-background-color', 'success');\n govDataBtn.setAttribute('data-primary', true);\n } else {\n govDataBtn.setAttribute('data-background-color', 'secondary');\n govDataBtn.setAttribute('data-primary', false);\n govDataBtn.addEventListener('click', (ev) => {\n if (app[0].getAttribute('data-api-active-datasets') != 'none') {\n let storedData = JSON.parse(app[0].getAttribute('data-api-stored-datasets'));\n let activeData = JSON.parse(app[0].getAttribute('data-api-active-datasets'));\n for (const key in activeData) {\n if (!(key in storedData)) {\n storedData[key] = activeData[key];\n }\n }\n app[0].setAttribute('data-api-stored-datasets', JSON.stringify(storedData));\n }\n app[0].setAttribute('data-api-active-datasets', 'none');\n app[0].setAttribute('data-active-sets', 'council,council-members,bop-members,district-managers,business-liaison,district-inspectors,npo');\n app[0].setAttribute('data-map-available', 'false');\n app[0].setAttribute('data-active-section', 'government officials');\n app[0].setAttribute('data-app-state', 'loading-screen');\n });\n }\n navToolsWrapper.appendChild(govDataBtn);\n\n const zoneDataBtn = document.createElement('cod-button');\n zoneDataBtn.setAttribute('data-label', '');\n zoneDataBtn.setAttribute('data-size', 'lg');\n zoneDataBtn.setAttribute('data-img', 'https://detroitmi.gov/sites/detroitmi.localhost/files/2023-01/zone.png');\n zoneDataBtn.setAttribute('data-img-alt', 'special areas and zones');\n zoneDataBtn.setAttribute('data-shape', 'square');\n zoneDataBtn.setAttribute('data-nav-value', 'special areas and zones');\n zoneDataBtn.setAttribute('data-icon', '');\n if (app[0].getAttribute('data-active-section') == 'special areas and zones') {\n zoneDataBtn.setAttribute('data-background-color', 'success');\n zoneDataBtn.setAttribute('data-primary', true);\n } else {\n zoneDataBtn.setAttribute('data-background-color', 'secondary');\n zoneDataBtn.setAttribute('data-primary', false);\n zoneDataBtn.addEventListener('click', (ev) => {\n if (app[0].getAttribute('data-api-active-datasets') != 'none') {\n let storedData = JSON.parse(app[0].getAttribute('data-api-stored-datasets'));\n let activeData = JSON.parse(app[0].getAttribute('data-api-active-datasets'));\n for (const key in activeData) {\n if (!(key in storedData)) {\n storedData[key] = activeData[key];\n }\n }\n app[0].setAttribute('data-api-stored-datasets', JSON.stringify(storedData));\n }\n app[0].setAttribute('data-api-active-datasets', 'none');\n app[0].setAttribute('data-active-sets', 'nez,nrsa,historicDistrict');\n app[0].setAttribute('data-map-available', 'false');\n app[0].setAttribute('data-active-section', 'special areas and zones');\n app[0].setAttribute('data-app-state', 'loading-screen');\n });\n }\n navToolsWrapper.appendChild(zoneDataBtn);\n\n const nearDataBtn = document.createElement('cod-button');\n nearDataBtn.setAttribute('data-label', '');\n nearDataBtn.setAttribute('data-size', 'lg');\n nearDataBtn.setAttribute('data-img', 'https://detroitmi.gov/sites/detroitmi.localhost/files/2023-01/nearby.png');\n nearDataBtn.setAttribute('data-img-alt', 'things nearby');\n nearDataBtn.setAttribute('data-shape', 'square');\n nearDataBtn.setAttribute('data-nav-value', 'things nearby');\n nearDataBtn.setAttribute('data-icon', '');\n if (app[0].getAttribute('data-active-section') == 'things nearby') {\n nearDataBtn.setAttribute('data-background-color', 'success');\n nearDataBtn.setAttribute('data-primary', true);\n } else {\n nearDataBtn.setAttribute('data-background-color', 'secondary');\n nearDataBtn.setAttribute('data-primary', false);\n nearDataBtn.addEventListener('click', (ev) => {\n if (app[0].getAttribute('data-api-active-datasets') != 'none') {\n let storedData = JSON.parse(app[0].getAttribute('data-api-stored-datasets'));\n let activeData = JSON.parse(app[0].getAttribute('data-api-active-datasets'));\n for (const key in activeData) {\n if (!(key in storedData)) {\n storedData[key] = activeData[key];\n }\n }\n app[0].setAttribute('data-api-stored-datasets', JSON.stringify(storedData));\n }\n app[0].setAttribute('data-api-active-datasets', 'none');\n app[0].setAttribute('data-active-sets', 'schools,demos-data,stabilization-data,improve-det');\n app[0].setAttribute('data-active-section', 'things nearby');\n app[0].setAttribute('data-map-available', 'true');\n app[0].setAttribute('data-app-state', 'loading-screen');\n });\n }\n navToolsWrapper.appendChild(nearDataBtn);\n\n const printBtn = document.createElement('cod-button');\n printBtn.setAttribute('data-label', '');\n printBtn.setAttribute('data-size', 'lg');\n printBtn.setAttribute('data-img', 'https://detroitmi.gov/sites/detroitmi.localhost/files/2023-01/print.png');\n printBtn.setAttribute('data-img-alt', 'print');\n printBtn.setAttribute('data-shape', 'square');\n printBtn.setAttribute('data-nav-value', 'print');\n printBtn.setAttribute('data-icon', '');\n if (app[0].getAttribute('data-active-section') == 'print') {\n printBtn.setAttribute('data-background-color', 'success');\n printBtn.setAttribute('data-primary', true);\n } else {\n printBtn.setAttribute('data-background-color', 'secondary');\n printBtn.setAttribute('data-primary', false);\n printBtn.addEventListener('click', (ev) => {\n if(ev.target.getAttribute('data-nav-value')){\n app[0].setAttribute('data-app-state', 'print');\n }\n });\n }\n navToolsWrapper.appendChild(printBtn);\n }\n\n shadow.appendChild(navToolsWrapper);\n }\n\n}\n","'use strict';\nimport Geocoder from './Geocoder';\nimport NavigationTools from './NavigationTools';\ncustomElements.define('app-geocoder', Geocoder);\ncustomElements.define('app-nav-tools', NavigationTools);\nexport default class Display extends HTMLElement {\n static get observedAttributes() {\n return ['data-display-type', 'data-pagination'];\n }\n\n constructor() {\n // Always call super first in constructor\n super();\n\n // Create a shadow root\n const shadow = this.attachShadow({ mode: 'open' });\n\n // Creating images\n this.neighborhoodImage = document.createElement('img');\n this.neighborhoodImage.src = 'https://detroitmi.gov/sites/detroitmi.localhost/files/2023-01/neighborhood.png'; //neighborhoodImage;\n this.neighborhoodImage.setAttribute('alt', '');\n\n // Creating display styles\n this.welcomeStyle = document.createElement('style');\n this.welcomeStyle.textContent = `\n @import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@100;700&display=swap')\n #display-wrapper { display: flex; padding: 1em; flex-wrap: wrap; font-family: 'Montserrat', sans-serif;}\n #display-wrapper #welcome-img-wrapper { display: flex; }\n #display-wrapper #welcome-img-wrapper img { height: 10em; margin: auto }\n #display-wrapper p { text-align: center; font-family: 'Montserrat', sans-serif;}\n #display-wrapper button { padding: 1em 3em; background-color: #004445; color: #fff; border: none; cursor: pointer; margin: auto; width: 100%;}\n p.display-title { font-weight: bold; font-size: 1.25em; }\n app-geocoder { width: 100%}\n .btn-group { display:flex; width: 100%; }\n @media all and (min-width: 551px) {\n #display-wrapper{ display: flex; }\n #display-wrapper #welcome-img-wrapper img { width: 15em; height: auto; }\n #display-wrapper article { flex: 1; padding: 1em; }\n }\n `;\n\n this.resultsStyle = document.createElement('style');\n this.resultsStyle.textContent = `\n .results-container{ display: flex; }\n #data-results { background-color: #e6e6e6; padding: 1em; height: 40em; overflow-y: auto; }\n .data-title { font-weight: bold; border-left: solid .2em #FEB70D; padding: .5em; margin: 0 0 1em 0; font-family: 'Montserrat', sans-serif;}\n .result-address {background-color: #fff; border: solid 0.1em #e6e6e6; padding: 1.04em 0.6em; font-family: 'Montserrat', sans-serif;}\n .data-block-title { padding: .5em; background-color: #FEB70D; margin: 0; font-weight: bold; font-family: 'Montserrat', sans-serif; display: flex;}\n .data-block-title span { flex: 1; margin: auto; }\n .data-block-content { padding: .5em; margin-bottom: .5em; background-color: #fff; }\n .data-block-content p { margin: 0; font-family: 'Montserrat', sans-serif;}\n .data-block-content hr { border-top: 1px dotted;}\n .dataset-results {flex: 1;}\n .critical-text { color: #CF3234; }\n .error-result { padding: 1em; }\n .data-block-title button { background-color: #fff; border: none; padding: 0.25em 0.5em; box-shadow: 1px 1px 3px 0px rgb(0 0 0 / 75%);}\n .data-block-title button img { height: 1em; }\n @media all and (min-width: 551px) {\n #data-results { height: auto; }\n #data-blocks { column-count: 2; }\n #data-blocks .data-block { -webkit-column-break-inside: avoid; page-break-inside: avoid; break-inside: avoid; }\n }\n\n @media all and (min-width: 1024px) {\n #data-results { height: auto; }\n #data-blocks { column-count: 3; }\n #data-blocks .data-block { -webkit-column-break-inside: avoid; page-break-inside: avoid; break-inside: avoid; }\n }\n `;\n\n // Start loading display content\n this.loadDisplay(this);\n }\n\n attributeChangedCallback(name, oldValue, newValue) {\n // console.log(`Display - attribute: ${name}, old: ${oldValue}, new: ${newValue}`);\n if (newValue == 'results') {\n this.clearDisplay(this);\n }\n if (name == 'data-pagination'){\n this.clearDisplay(this);\n }\n this.loadDisplay(this);\n }\n\n clearDisplay(display) {\n const shadow = display.shadowRoot;\n while (shadow.firstChild) {\n shadow.removeChild(shadow.firstChild);\n }\n }\n\n formatDate(value) {\n const month = [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"];\n const tempDate = new Date(value);\n return `${month[tempDate.getMonth()]} ${tempDate.getDate()}, ${tempDate.getFullYear()}`;\n }\n\n buildCouncil(value) {\n let siteURL = window.location.hostname;\n let dataParsing = { title: \"Council District\", content: null };\n dataParsing.content = `\n <p><strong>District Number:</strong> ${value.data.district}</p>\n <p><strong>Council Member:</strong> <a href=\"http://${siteURL}${value.data.url}\" target=\"_blank\">${value.data.name}</a></p>\n <p><strong>Council Member Phone:</strong> ${value.data.phone}</p>\n `;\n return dataParsing;\n }\n\n buildBOP(value) {\n let siteURL = window.location.hostname;\n let dataParsing = { title: \"Police Commissioner\", content: null };\n dataParsing.content = `\n <p><strong>Commissioner:</strong> <a href=\"http://${siteURL}${value.data.url}\" target=\"_blank\">${value.data.name}</a></p>\n <p><strong>Commissioner's Phone:</strong> ${value.data.phone}</p>\n <p><strong>Commissioner's Email:</strong> ${value.data.email}</p>\n `;\n return dataParsing;\n }\n\n buildDistrictManagers(value) {\n let dataParsing = { title: \"District Managers\", content: null };\n if (value && Object.keys(value.data).length != 0 && value.data.constructor === Object && value.data.detail !== \"Not found.\") {\n dataParsing.content = `\n <p><strong>District Manager:</strong> <a href=\"${value.data.manager.url}\" target=\"_blank\">${value.data.manager.name}</a></p>\n <p><strong>Manager Phone:</strong> ${value.data.manager.phone}</p>\n <p><strong>Deputy Manager:</strong> <a href=\"${value.data.deputy.url}\" target=\"_blank\">${value.data.deputy.name}</a></p>\n <p><strong>Deputy Manager Phone:</strong> ${value.data.deputy.phone}</p>\n `;\n } else {\n dataParsing.content = `\n <p>No data found</p>\n `;\n }\n return dataParsing;\n }\n\n buildBusinessLiaison(value) {\n let dataParsing = { title: \"Business Liaison\", content: null };\n if (value && Object.keys(value.data).length != 0 && value.data.constructor === Object && value.data.detail !== \"Not found.\") {\n dataParsing.content = `\n <p><strong>Liaison:</strong> ${value.data.name}</p>\n <p><strong>Liaison Phone:</strong> ${value.data.email}</p>\n `;\n } else {\n dataParsing.content = `\n <p>No data found</p>\n `;\n }\n return dataParsing;\n }\n\n buildInspector(value) {\n let dataParsing = { title: \"Enforcement Inspector\", content: null };\n if (value && Object.keys(value.data).length != 0 && value.data.constructor === Object && value.data.detail !== \"Not found.\") {\n dataParsing.content = `\n <p><strong>Inspector:</strong> ${value.data.name}</p>\n <p><strong>Inspector Phone:</strong> ${value.data.phone}</p>\n `;\n } else {\n dataParsing.content = `\n <p>No data found</p>\n `;\n }\n return dataParsing;\n }\n\n buildNeighborhood(value) {\n let dataParsing = { title: \"Neighborhood\", content: null };\n if (value && Object.keys(value.data).length != 0 && value.data.constructor === Object && value.data.detail !== \"Not found.\") {\n dataParsing.content = `\n <p><strong>Neighborhood name:</strong> ${value.data.attributes.neighborhood_name}</p>\n `;\n } else {\n dataParsing.content = `\n <p>No neighborhood found</p>\n `;\n }\n return dataParsing;\n }\n\n buildDWSDBackupProtection(values) {\n let validNeighborhoods = ['Aviation Sub', 'Barton-McFarland', 'Chadsey Condon', 'Cornerstone Village', 'East English Village', 'Morningside', 'Jefferson Chalmers', 'Warrendale', 'Victoria Park', 'Moross-Morang', 'Garden View'];\n let dataParsing = { title: \"DWSD Basement Backup Protection Program\", content: null };\n if (values && values.data.attributes.neighborhood_name) {\n if (validNeighborhoods.includes(values.data.attributes.neighborhood_name)) {\n dataParsing.content = `\n <p>This property qualifies for the DWSD Basement Backup Protection Program.</p>\n <br>\n <a href=\"https://app.smartsheet.com/b/form/509cb1e905a74948bce7b0135da53277?Property%20Street%20Address=${values.data.address}&Property%20City=Detroit&Property%20Zip%20Code=${values.data.attributes.Postal}&Neighborhood=${values.data.attributes.neighborhood_name}\" target=\"_blank\"><cod-button data-label=\"Apply Now\" data-background-color=\"primary\" data-size=\"xsmall\" data-icon=\"\" data-primary=\"true\" data-img-alt=\"\"></cod-button></a>\n `;\n }else{\n dataParsing.content = `\n <p>This property doesn't qualify for the Basement Backup Protection Program. To learn more please <a href=\"https://detroitmi.gov/departments/water-and-sewerage-department/dwsd-resources/basement-flooding-protection\">visit our page.</a></p>\n `;\n }\n } else {\n dataParsing.content = `\n <p>This property doesn't qualify for the Basement Backup Protection Program. To learn more please <a href=\"https://detroitmi.gov/departments/water-and-sewerage-department/dwsd-resources/basement-flooding-protection\">visit our page.</a></p>\n `;\n }\n return dataParsing;\n }\n\n buildHRDFlooding(values) {\n console.log(values.data.attributes.neighborhood_name);\n let validNeighborhoods = ['Cornerstone Village', 'Morningside', 'Chandler Park', 'Fox Creek', 'Riverbend', 'Morningside', 'West End', 'Midwest', 'Chadsey Condon', 'Claytown', 'North Corktown', 'Michigan-Martin', 'Aviation Sub', 'Garden View', 'Plymouth-I96', 'Plymouth-Hubbell', 'Paveway', 'We Care Community', 'Fiskhorn', 'Joy-Schaefer', 'Warrendale', 'Warren Ave Community', 'Barton-McFarland'];\n let dataParsing = { title: \"CDBG-DR Private Sewer Repair Program\", content: null };\n if (values && values.data.attributes.neighborhood_name) {\n if (validNeighborhoods.includes(values.data.attributes.neighborhood_name)) {\n dataParsing.content = `\n <p>This property qualifies for the CDBG-DR Private Sewer Repair Program.</p>\n <br>\n <cod-button data-label=\"Apply Now\" data-background-color=\"primary\" data-size=\"xsmall\" data-icon=\"\" data-primary=\"true\" data-img-alt=\"\" data-link=\"https://app.smartsheet.com/b/form/3dab24dc95bf469b8ac4c27669536507\"></cod-button>\n `;\n }else{\n dataParsing.content = `\n <p>This property doesn’t qualify for the CDBG-DR Private Sewer Repair Program. To learn more please <a href=\"https://detroitmi.gov/departments/housing-and-revitalization-department/disaster-recovery\">visit our page.</a></p>\n `;\n }\n } else {\n dataParsing.content = `\n <p>This property doesn’t qualify for the CDBG-DR Private Sewer Repair Program. To learn more please <a href=\"https://detroitmi.gov/departments/housing-and-revitalization-department/disaster-recovery\">visit our page.</a></p>\n `;\n }\n return dataParsing;\n }\n\n buildHistoricDistrict(value, display) {\n let dataParsing = { title: \"NEZ Homestead Zone\", content: null };\n if (Object.keys(value.data).length != 0 && value.data.constructor === Object && value.data.features.length > 0) {\n dataParsing.content = `\n <p><strong>NAME:</strong> ${value.data.features[0].attributes.Name}</p>\n <p><strong>DESIGNATED ON:</strong> ${display.formatDate(value.data.features[0].attributes.Year_Enacted).format('MMM DD, YYYY')}</p>\n `;\n } else {\n dataParsing.content = `\n <p>This property is not in a historic district.</p>\n `;\n }\n return dataParsing;\n }\n\n buildNEZ(nez) {\n let dataParsing = { title: \"NEZ Homestead Zone\", content: null };\n if (Object.keys(nez.data).length != 0 && nez.data.constructor === Object && nez.data.features.length > 0) {\n dataParsing.content = `\n <p><strong>Name:</strong> ${nez.data.features[0].attributes.RNNAME}</p>\n <p><strong>ID:</strong> ${nez.data.features[0].attributes.RID}</p>\n <p class=\"noprint\"><a href=\"https://data.detroitmi.gov/datasets/proposed-nez-homestead-2021/explore\" target=\"_blank\">View Map</a></p>\n `;\n } else {\n dataParsing.content = `\n <p>This property is not on a NEZ Homestead zone.</p>\n <p class=\"noprint\"><a href=\"https://data.detroitmi.gov/datasets/nez-h-districts/explore\" target=\"_blank\">View Map</a></p>\n `;\n }\n return dataParsing;\n }\n\n buildNRSA(value) {\n let dataParsing = { title: \"Neighborhood Revitalization Strategy Areas (NRSA)\", content: null };\n if (Object.keys(value.data).length != 0 && value.data.constructor === Object && value.data.features.length > 0) {\n dataParsing.content = `\n <p><strong>Name:</strong> ${value.data.features[0].attributes.Name}</p>\n `;\n } else {\n dataParsing.content = `\n <p>This property is not on a NRSA.</p>\n `;\n }\n return dataParsing;\n }\n\n buildNPO(value) {\n let dataParsing = { title: \"Police\", content: null };\n if (value && value.data.features.length) {\n dataParsing.content = `\n <p><strong>PRECINCT</strong></p>\n <p><strong>Number:</strong> ${value.data.features[0].attributes.precinct}</p>\n <p><strong>Address:</strong> ${value.data.features[0].attributes.precinct_location}</p>\n <br>\n <p><strong>NEIGHBORHOOD POLICE OFFICER (NPO)</strong></p>\n <p><strong>Name:</strong> ${value.data.features[0].attributes.officer_name}</p>\n <p><strong>Phone:</strong> ${value.data.features[0].attributes.npo_cell_phone}</p>\n <p><strong>Email:</strong> ${value.data.features[0].attributes.npo_email}</p>\n `;\n } else {\n dataParsing.content = `<p>No police info found</p>`;\n }\n return dataParsing;\n }\n\n checkRecyclingStatus(data) {\n try {\n if (data.next_pickups['yard waste']) {\n let yardStart = null;\n let yardEnd = null;\n data.details.forEach((item) => {\n if (item.type == 'start-date' && item.service == 'yard waste') {\n if (item.normalDay != null) {\n yardStart = item.normalDay;\n } else {\n yardStart = item.newDay;\n }\n }\n if (item.type == 'end-date' && item.service == 'yard waste') {\n if (item.normalDay != null) {\n yardEnd = item.normalDay;\n } else {\n yardEnd = item.newDay;\n }\n }\n });\n if (moment(data.next_pickups['yard waste'].next_pickup).isBetween(yardStart, yardEnd)) {\n return true;\n } else {\n return false;\n }\n } else {\n return false;\n }\n } catch (error) {\n return false;\n }\n }\n\n buildRecycling(value, display) {\n let dataParsing = { title: \"Trash & Recycling\", content: null };\n if (value && Object.keys(value.data).length != 0 && value.data.constructor === Object) {\n let contractorInfo = {\n name: null,\n url: null,\n phone: null\n };\n if (value.data.next_pickups.trash.contractor === 'GFL') {\n contractorInfo.name = 'GFL';\n contractorInfo.url = 'http://gflusa.com/residential/detroit/';\n contractorInfo.phone = '(844) 464-3587';\n } else if (value.data.next_pickups.trash.contractor === 'WM') {\n contractorInfo.name = 'WM';\n contractorInfo.url = 'http://www.advanceddisposal.com/mi/detroit/detroit-residential-collection';\n contractorInfo.phone = '(844) 233-8764';\n } else if (value.data.next_pickups.trash.contractor === 'Priority Waste') {\n contractorInfo.name = 'Priority Waste';\n contractorInfo.url = 'https://www.prioritywaste.com/cities-we-serve/detroit/';\n contractorInfo.phone = '(855) 927-835';\n }\n dataParsing.content = `\n <p><strong>Provider:</strong> <a href=\"${contractorInfo.url}\" target=\"_blank\">${contractorInfo.name}</a> ${contractorInfo.phone}</p>\n <p><strong>Next Trash:</strong> ${display.formatDate(value.data.next_pickups.trash.next_pickup)}</p>\n <p><strong>Next Recycling:</strong> ${display.formatDate(value.data.next_pickups.recycling.next_pickup)}</p>\n <p><strong>Next Bulk:</strong> ${display.formatDate(value.data.next_pickups.bulk.next_pickup)}</p>\n ${(display.checkRecyclingStatus(value.data)) ? tempHTML += `<p><strong>Next Yard:</strong> ${display.formatDate(value.data.next_pickups['yard waste'].next_pickup)}</p>` : ``}\n `;\n } else {\n dataParsing.content = `<p>No data found</p>`;\n }\n return dataParsing;\n }\n\n buildAssessors(value) {\n let dataParsing = { title: \"Assessor's Data\", content: null };\n if (value && Object.keys(value.data).length != 0 && value.data.constructor === Object && value.data.detail !== \"Not found.\") {\n let property = {\n year: null,\n value: null,\n floor: null,\n buildingClass: null\n }\n dataParsing.content = `\n <p><strong>Owner's address:</strong> ${value.data.ownerstreetaddr}</p>\n <p><strong>Owner's city:</strong> ${value.data.ownercity}</p>\n <p><strong>Owner's state:</strong> ${value.data.ownerstate}</p>\n <p><strong>Owner's zip:</strong> ${value.data.ownerzip}</p>\n `;\n if (value.data.resb_bldgclass === 0) {\n property.year = value.data.cib_yearbuilt;\n property.value = value.data.cib_value;\n property.floor = value.data.cib_yearbuilt;\n property.buildingClass = value.data.cib_yearbuilt;\n } else {\n property.year = value.data.resb_yearbuilt;\n property.value = value.data.resb_value;\n property.floor = value.data.resb_floorarea;\n property.buildingClass = value.data.resb_bldgclass;\n }\n dataParsing.content += `\n <p><strong>Parcel number:</strong> ${value.data.pnum}</p>\n <p><strong>Year build:</strong> ${property.year}</p>\n <p><strong>Calculated value:</strong> $${property.value.toLocaleString()}</p>\n <p><strong>Floor area:</strong> ${property.floor.toLocaleString()} SQFT</p>\n <p><strong>Building class:</strong> ${property.buildingClass}</p>\n `;\n } else {\n dataParsing.content = `<p>No data found</p>`;\n }\n return dataParsing;\n }\n\n buildRental(value, display) {\n let app = document.getElementsByTagName('my-home-info');\n let apiDataSets = JSON.parse(app[0].getAttribute('data-api-active-datasets'));\n let dataParsing = { title: \"Rental Enforcement Status\", content: null };\n if ((value && value.data.features.length) || (apiDataSets['rental-cert-data'] && apiDataSets['rental-cert-data'].data.features.length)) {\n dataParsing.content = `\n <p><strong>Registered:</strong> ${value.data.features.length ? `${display.formatDate(value.data.features[0].attributes.date_status)}` : `Not registered`}</p>\n <p><strong>Certified:</strong> ${apiDataSets['rental-cert-data'].data.features.length ? `${display.formatDate(apiDataSets['rental-cert-data'].data.features[0].attributes.issued_date)}` : `Not certified`}</p>\n `;\n } else {\n dataParsing.content = `\n <p><strong>Registered:</strong> Not registered</p>\n <p><strong>Certified:</strong> Not certified</p>\n `;\n }\n return dataParsing;\n }\n\n buildFireEscrow(value) {\n let tempHTML = '';\n if (value && value.data.features.length) {\n tempHTML += `\n <article class=\"info-section\">\n <span>FIRE ESCROW</span>\n <div>\n <p><strong>STATUS:</strong> Fire Escrow found</p>\n <p><a href=\"https://detroitmi.gov/taxonomy/term/8501\"><button>Start Process</button></a></p>\n </div>\n </article>`;\n } else {\n tempHTML += `\n <article class=\"info-section\">\n <span>FIRE ESCROW</span>\n <div>\n <p><strong>STATUS:</strong> Fire Escrow not found</p>\n </div>\n </article>`;\n }\n return tempHTML;\n }\n\n buildBlight(value, display) {\n let dataParsing = { title: \"Blight Tickets\", content: null };\n if (value && value.data.features.length) {\n dataParsing.content = `\n <p><strong>Ticket ID:</strong> ${value.attributes.ticket_number}</p>\n <p><strong>Fine Amount:</strong> $${value.attributes.fine_amount}</p>\n <p><strong>Agency name:</strong> ${value.attributes.agency_name}</p>\n <p><strong>Disposition:</strong> ${value.attributes.disposition}</p>\n <p><strong>Description:</strong> ${value.attributes.violation_description}</p>\n <p><strong>Hearing Date:</strong> ${display.formatDate(value.attributes.hearing_date)}</p>\n <p><strong>Hearing Time:</strong> ${value.attributes.hearing_time}</p>\n `;\n } else {\n dataParsing.content = `<p>No blight tickets found</p>`;\n }\n return dataParsing;\n }\n\n buildSchools(value, display) {\n let dataParsing = { title: \"Schools\", content: null };\n if (value && value.data.features.length) {\n value.data.features.forEach(function (value, index) {\n if (index == 0) {\n dataParsing.content = `\n <p><strong>Name:</strong> ${value.properties.EntityOfficialName}</p>\n <p><strong>EntityActualGrades:</strong> ${value.properties.EntityActualGrades}</p>\n <p><strong>Type:</strong> ${value.properties.EntityTypeName}</p>\n <p><strong>Address:</strong> ${value.properties.EntityPhysicalStreet}</p>\n <hr>\n `;\n } else {\n dataParsing.content += `\n <p><strong>Name:</strong> ${value.properties.EntityOfficialName}</p>\n <p><strong>EntityActualGrades:</strong> ${value.properties.EntityActualGrades}</p>\n <p><strong>Type:</strong> ${value.properties.EntityTypeName}</p>\n <p><strong>Address:</strong> ${value.properties.EntityPhysicalStreet}</p>\n <hr>\n `;\n }\n });\n } else {\n dataParsing.content = `<p>No schools nearby.</p>`;\n }\n return dataParsing;\n }\n\n buildPermit(value, display) {\n let dataParsing = { title: \"Building Permits\", content: null };\n if (value && value.data.features.length) {\n dataParsing.content = `\n <p><strong>PERMIT NUMBER:</strong> ${value.attributes.record_id}</p>\n <p><strong>PERMIT TYPE:</strong> ${value.attributes.permit_type}</p>\n <p><strong>PERMIT BUILDING TYPE:</strong> ${value.attributes.permit_type}</p>\n <p><strong>PERMIT STATUS:</strong> ${value.attributes.status}</p>\n <p><strong>PERMIT ISSUED:</strong> ${display.formatDate(value.attributes.issued_date)}</p>\n <p><strong>PERMIT DESCRIPTION:</strong> ${value.attributes.description_of_work}</p>\n `;\n } else {\n dataParsing.content = `<p>No building permits found</p>`;\n }\n return dataParsing;\n }\n\n buildDemoStatus(value, display) {\n let app = document.getElementsByTagName('my-home-info');\n let parcelData = JSON.parse(app[0].getAttribute('data-parcel-id'));\n let tempAddress = parcelData.address.replace(' ', '%2520');\n tempAddress = tempAddress.replace(',', '%252C');\n let dataParsing = { title: \"Demolition Status\", content: null };\n if (value && value.data.features.length) {\n dataParsing.content = `\n <p class=\"critical-text\"><strong>WARNIG!</strong></p>\n <p>THIS PROPERTY IS SCHEDULED FOR DEMOLITION</p> \n ${(value.data.features[0].attributes.demolish_by_date == null) ? `<p><strong>Date to be determined</strong></p>` : `<p><strong>${display.formatDate(value.attributes.demolish_by_date)}</stron></p>`}\n <br>\n <p><a href=\"https://detroitmi.maps.arcgis.com/apps/instant/nearby/index.html?appid=41ba8dd946d842b9ba632ecc0a5d2556&sliderDistance=1&find=${tempAddress}\" target=\"_blank\"><cod-button data-label=\"Expand your demo search\" data-background-color=\"primary\" data-icon=\"\" data-size=\"xsmall\" data-primary=\"true\" data-img-alt=\"\"></cod-button></a></p>\n `;\n } else {\n dataParsing.content = `\n <p>This property is not on the upcoming demolitions list</p>\n <br>\n <p><a href=\"https://detroitmi.maps.arcgis.com/apps/instant/nearby/index.html?appid=41ba8dd946d842b9ba632ecc0a5d2556&sliderDistance=1&find=${tempAddress}\" target=\"_blank\"><cod-button data-label=\"Expand your demo search\" data-background-color=\"primary\" data-icon=\"\" data-size=\"xsmall\" data-primary=\"true\" data-img-alt=\"\"></cod-button></a></p>`;\n }\n return dataParsing;\n }\n\n buildDemosNear(value, display) {\n let dataParsing = { title: \"Demolitions Nearby\", content: null };\n if (value && value.data.features.length) {\n value.data.features.forEach(function (value, index) {\n if (index == 0) {\n dataParsing.content = `\n <p><strong>Address:</strong> ${value.properties.address}</p>\n <p><strong>Commercial:</strong> ${value.properties.commercial_building}</p>\n <p><strong>Price:</strong> $${parseInt(value.properties.price).toLocaleString()}</p>\n <p><strong>Parcel:</strong> ${value.properties.parcel_id}</p>\n <p><strong>Contractor:</strong> ${value.properties.contractor_name}</p>\n <p><strong>Council District:</strong> ${value.properties.council_district}</p>\n <p><strong>Neighborhood:</strong> ${value.properties.neighborhood}</p>\n ${(value.properties.demolish_by_date == undefined || value.properties.demolish_by_date == null) ? `<p><p><strong>Expected Date:</strong> Date to be determined</p>` : `<p><strong>Expected Date:</strong>${display.formatDate(value.properties.demolish_by_date)}</strong></p>`}\n <hr>\n `;\n } else {\n dataParsing.content += `\n <p><strong>Address:</strong> ${value.properties.address}</p>\n <p><strong>Commercial:</strong> ${value.properties.commercial_building}</p>\n <p><strong>Price:</strong> $${parseInt(value.properties.price).toLocaleString()}</p>\n <p><strong>Parcel:</strong> ${value.properties.parcel_id}</p>\n <p><strong>Contractor:</strong> ${value.properties.contractor_name}</p>\n <p><strong>Council District:</strong> ${value.properties.council_district}</p>\n <p><strong>Neighborhood:</strong> ${value.properties.neighborhood}</p>\n ${(value.properties.demolish_by_date == undefined || value.properties.demolish_by_date == null) ? `<p><p><strong>Expected Date:</strong> Date to be determined</p>` : `<p><strong>Expected Date:</strong>${display.formatDate(value.properties.demolish_by_date)}</strong></p>`}\n <hr>\n `;\n }\n });\n\n } else {\n dataParsing.content = `<p>No demolitions are happening nearby.</p>`;\n }\n return dataParsing;\n }\n\n buildStabilizationsNear(value, display) {\n let dataParsing = { title: \"Stabilizations Nearby\", content: null };\n if (value && value.data.features.length) {\n value.data.features.forEach(function (value, index) {\n\n if (index == 0) {\n dataParsing.content = `\n <p><strong>Address:</strong> ${value.properties.address}</p>\n <p><strong>Parcel:</strong> ${value.properties.parcel_id}</p>\n <p><strong>Council District:</strong> ${value.properties.council_district}</p>\n <p><strong>Neighborhood:</strong> ${value.properties.neighborhood}</p>\n <p><strong>Status:</strong> ${value.properties.rehab_status}</p>\n <hr>\n `;\n } else {\n dataParsing.content += `\n <p><strong>Address:</strong> ${value.properties.address}</p>\n <p><strong>Parcel:</strong> ${value.properties.parcel_id}</p>\n <p><strong>Council District:</strong> ${value.properties.council_district}</p>\n <p><strong>Neighborhood:</strong> ${value.properties.neighborhood}</p>\n <p><strong>Status:</strong> ${value.properties.rehab_status}</p>\n <hr>\n `;\n }\n });\n\n } else {\n dataParsing.content = `<p>No stabilizations are happening nearby.</p>`;\n }\n return dataParsing;\n }\n\n buildImproveDet(value, display) {\n let dataParsing = { title: \"Improve Detroit Issues Nearby\", content: null };\n if (value && value.data.features.length) {\n value.data.features.forEach(function (value, index) {\n if (index == 0) {\n dataParsing.content = `\n <p><strong>ID:</strong> <a href=\"${value.properties.Web_Url}\" target=\"_blank\">${value.properties.ID}</a></p>\n <p><strong>Type:</strong> ${value.properties.Request_Type_Title}</p>\n <p><strong>Status:</strong> ${value.properties.Status}</p>\n <p><strong>Reported on:</strong> ${display.formatDate(value.properties.Created_At)}</p>\n <hr>\n `;\n } else {\n dataParsing.content += `\n <p><strong>ID:</strong> <a href=\"${value.properties.Web_Url}\" target=\"_blank\">${value.properties.ID}</a></p>\n <p><strong>Type:</strong> ${value.properties.Request_Type_Title}</p>\n <p><strong>Status:</strong> ${value.properties.Status}</p>\n <p><strong>Reported on:</strong> ${display.formatDate(value.properties.Created_At)}</p>\n <hr>\n `;\n }\n });\n\n } else {\n dataParsing.content = `<p>No active issues nearby.</p>`;\n }\n return dataParsing;\n }\n\n selectDataBlockType(display, value) {\n switch (value.id) {\n case 'council-members':\n try {\n return display.buildCouncil(value);\n } catch (error) {\n // console.log(error);\n return '';\n }\n break;\n\n case 'bop-members':\n try {\n return display.buildBOP(value);\n } catch (error) {\n // console.log(error);\n return '';\n }\n break;\n\n case 'district-managers':\n try {\n return display.buildDistrictManagers(value);\n } catch (error) {\n // console.log(error);\n return '';\n }\n break;\n\n case 'business-liaison':\n try {\n return display.buildBusinessLiaison(value);\n } catch (error) {\n // console.log(error);\n return '';\n }\n break;\n\n case 'district-inspectors':\n try {\n return display.buildInspector(value);\n } catch (error) {\n // console.log(error);\n return '';\n }\n break;\n\n case 'neighborhood':\n try {\n return display.buildNeighborhood(value);\n } catch (error) {\n // console.log(error);\n return '';\n }\n break;\n\n case 'nez':\n try {\n return display.buildNEZ(value);\n } catch (error) {\n // console.log(error);\n return '';\n }\n break;\n\n case 'nrsa':\n try {\n return display.buildNRSA(value);\n } catch (error) {\n // console.log(error);\n return '';\n }\n break;\n\n case 'assessors-data':\n try {\n return display.buildAssessors(value);\n } catch (error) {\n // console.log(error);\n return '';\n }\n break;\n\n case 'permit-data':\n try {\n return display.buildPermit(value, display);\n } catch (error) {\n // console.log(error);\n return '';\n }\n break;\n\n case 'rental-data':\n try {\n return display.buildRental(value, display);\n } catch (error) {\n // console.log(error);\n return '';\n }\n break;\n\n case 'blight-data':\n try {\n return display.buildBlight(value, display);\n } catch (error) {\n // console.log(error);\n return '';\n }\n break;\n\n case 'demos-data':\n try {\n return display.buildDemosNear(value, display);\n } catch (error) {\n // console.log(error);\n return '';\n }\n break;\n\n case 'stabilization-data':\n try {\n return display.buildStabilizationsNear(value, display);\n } catch (error) {\n // console.log(error);\n return '';\n }\n break;\n\n case 'demo-status':\n try {\n return display.buildDemoStatus(value);\n } catch (error) {\n // console.log(error);\n return '';\n }\n break;\n\n case 'npo':\n try {\n return display.buildNPO(value);\n } catch (error) {\n // console.log(error);\n return '';\n }\n break;\n\n case 'improve-det':\n try {\n return display.buildImproveDet(value, display);\n } catch (error) {\n // console.log(error);\n return '';\n }\n break;\n\n case 'schools':\n try {\n return display.buildSchools(value, display);\n } catch (error) {\n // console.log(error);\n return '';\n }\n break;\n\n case 'recycling':\n try {\n return display.buildRecycling(value, display);\n } catch (error) {\n // console.log(error);\n return '';\n }\n break;\n\n case 'historicDistrict':\n try {\n return display.buildHistoricDistrict(value);\n } catch (error) {\n // console.log(error);\n return '';\n }\n break;\n\n case 'fireEscrow':\n try {\n return display.buildFireEscrow(value);\n } catch (error) {\n // console.log(error);\n return '';\n }\n break;\n\n case 'DWSDBackupProtection':\n try {\n return display.buildDWSDBackupProtection(value);\n } catch (error) {\n return '';\n }\n break;\n\n case 'HRDFlooding':\n try {\n return display.buildHRDFlooding(value);\n } catch (error) {\n return '';\n }\n break;\n\n default:\n return '';\n break;\n }\n }\n\n setDatasetPagination(display, dataset){\n if(display.hasAttribute('data-pagination')){\n let paginations = JSON.parse(display.getAttribute('data-pagination'));\n if(paginations[dataset.id]){\n let paginationObj = {start: paginations[dataset.id].start};\n if(dataset.data.features.length <= (paginations[dataset.id].end + 3)){\n paginationObj.end = dataset.data.features.length;\n paginationObj.more = false;\n }else{\n paginationObj.end = paginations[dataset.id].end + 3;\n paginationObj.more = true;\n }\n return paginationObj;\n }else{\n let paginationObj = {start: 0, end: 3, more: true};\n if(dataset.data.features){\n if(dataset.data.features.length <= 3){\n paginationObj.end = dataset.data.features.length;\n paginationObj.more = false;\n }\n }else{\n paginationObj.start = null;\n paginationObj.more = false;\n }\n return paginationObj;\n }\n }else{\n let paginationObj = {start: 0, end: 3, more: true};\n if(dataset.data.features){\n if(dataset.data.features.length <= 3){\n paginationObj.end = dataset.data.features.length;\n paginationObj.more = false;\n }\n }else{\n paginationObj.start = null;\n paginationObj.more = false;\n }\n return paginationObj;\n }\n }\n\n printInfo(display) {\n let divContents = display.buildDataSection(display);\n let a = window.open('', '', 'height=500, width=500');\n a.document.write('<html>');\n a.document.write('<head><style>@media print {.noprint { visibility: hidden;} p.data-block-title{border-bottom: 1px solid;} .data-block-title button { display: none; } body { column-count: 2;} .data-block { -webkit-column-break-inside: avoid; page-break-inside: avoid; break-inside: avoid; } }</style></head>');\n a.document.write('<body >');\n a.document.write(divContents.children[1].innerHTML);\n a.document.write('</body>');\n a.document.close();\n a.print();\n }\n\n buildDataBlock(display, dataSet) {\n const app = document.getElementsByTagName('my-home-info');\n const mapAvailable = app[0].getAttribute('data-map-available');\n const dataBlock = document.createElement('article');\n dataBlock.className = 'data-block';\n let pagination = display.setDatasetPagination(display, dataSet);\n let splitDataset = JSON.parse(JSON.stringify(dataSet));\n if(pagination.start !== null){\n splitDataset.data.features = dataSet.data.features.slice(pagination.start, pagination.end);\n }\n let datasetValues = display.selectDataBlockType(display, splitDataset);\n if (datasetValues == undefined || datasetValues.content == null) {\n return null;\n } else {\n const dataBlockTitle = document.createElement('p');\n dataBlockTitle.className = 'data-block-title';\n const dataBlockContent = document.createElement('article');\n dataBlockContent.className = 'data-block-content';\n dataBlockContent.innerHTML = datasetValues.content;\n if (mapAvailable == 'true') {\n const text = document.createElement('span');\n text.innerText = datasetValues.title;\n const mapButton = document.createElement('cod-button');\n mapButton.setAttribute('data-map-active-data', dataSet.id);\n mapButton.setAttribute('data-label', 'View Map');\n mapButton.setAttribute('data-size', 'xsmall');\n mapButton.setAttribute('data-icon', '');\n mapButton.setAttribute('data-img', 'https://detroitmi.gov/sites/detroitmi.localhost/files/2023-02/map.png');\n mapButton.setAttribute('data-img-alt', 'map');\n mapButton.setAttribute('data-shape', '');\n mapButton.setAttribute('data-hover', false);\n mapButton.setAttribute('data-extra-classes', 'fw-bold');\n mapButton.setAttribute('data-background-color', 'light');\n mapButton.setAttribute('data-primary', true);\n mapButton.addEventListener('click', (ev) => {\n if(ev.target.getAttribute('data-map-active-data')){\n app[0].setAttribute('data-map-active-data', ev.target.getAttribute('data-map-active-data'));\n app[0].setAttribute('data-app-state', 'map');\n }\n });\n dataBlockTitle.appendChild(text);\n dataBlockTitle.appendChild(mapButton);\n } else {\n dataBlockTitle.innerText = datasetValues.title;\n }\n dataBlock.appendChild(dataBlockTitle);\n dataBlock.appendChild(dataBlockContent);\n if(pagination.more){\n let loadMoreBtn = document.createElement('cod-button');\n loadMoreBtn.setAttribute('data-pagination-id', dataSet.id);\n loadMoreBtn.setAttribute('data-pagination', JSON.stringify(pagination));\n loadMoreBtn.setAttribute('data-label', 'Load More +');\n loadMoreBtn.setAttribute('data-size', 'xsmall');\n loadMoreBtn.setAttribute('data-icon', '');\n loadMoreBtn.setAttribute('data-img', '');\n loadMoreBtn.setAttribute('data-img-alt', '');\n loadMoreBtn.setAttribute('data-shape', '');\n loadMoreBtn.setAttribute('data-hover', false);\n loadMoreBtn.setAttribute('data-extra-classes', 'fw-bold');\n loadMoreBtn.setAttribute('data-background-color', 'primary');\n loadMoreBtn.setAttribute('data-primary', false);\n loadMoreBtn.addEventListener('click', (ev) => {\n if(ev.target.getAttribute('data-pagination')){\n let loadMoreSpinner = document.createElement('cod-spinner');\n loadMoreSpinner.setAttribute('data-type', 'border');\n loadMoreSpinner.setAttribute('data-background-color', 'primary');\n loadMoreSpinner.setAttribute('data-size', 'sm');\n let paginations = display.getAttribute('data-pagination');\n if(paginations === null){\n paginations = {};\n }else{\n paginations = JSON.parse(paginations);\n }\n paginations[`${ev.target.getAttribute('data-pagination-id')}`] = JSON.parse(ev.target.getAttribute('data-pagination'));\n display.setAttribute('data-pagination', JSON.stringify(paginations));\n ev.target.parentElement.appendChild(loadMoreSpinner);\n ev.target.remove();\n }\n });\n dataBlockContent.appendChild(loadMoreBtn);\n }\n return dataBlock;\n }\n }\n\n buildDataSection(display) {\n const app = document.getElementsByTagName('my-home-info');\n const appMode = app[0].getAttribute('data-app-mode');\n const results = document.createElement('section');\n results.id = 'data-results';\n if (appMode == 'my-home-info') {\n const sectionTitle = document.createElement('p');\n sectionTitle.className = 'data-title';\n sectionTitle.innerText = app[0].getAttribute('data-active-section').toUpperCase();\n results.appendChild(sectionTitle);\n }\n const dataBlocks = document.createElement('div');\n dataBlocks.id = 'data-blocks';\n results.appendChild(dataBlocks);\n\n const apiDataSets = JSON.parse(app[0].getAttribute('data-api-active-datasets'));\n for (const dataSet in apiDataSets) {\n if (Object.hasOwnProperty.call(apiDataSets, dataSet)) {\n if (display.buildDataBlock(display, apiDataSets[dataSet]) != null) {\n dataBlocks.appendChild(display.buildDataBlock(display, apiDataSets[dataSet]));\n }\n }\n }\n return results;\n }\n\n loadDisplay(display) {\n const shadow = display.shadowRoot;\n const displayWrapper = document.createElement('section');\n const geocoder = document.createElement('app-geocoder');\n const navTools = document.createElement('app-nav-tools');\n const app = document.getElementsByTagName('my-home-info');\n navTools.printInfo = display.printInfo;\n displayWrapper.id = 'display-wrapper';\n switch (this.getAttribute('data-display-type')) {\n case 'welcome':\n shadow.appendChild(display.welcomeStyle);\n const imageWrapper = document.createElement('div');\n imageWrapper.id = 'welcome-img-wrapper';\n imageWrapper.appendChild(this.neighborhoodImage);\n displayWrapper.appendChild(imageWrapper);\n const textWrapperWelcome = document.createElement('article');\n displayWrapper.appendChild(textWrapperWelcome);\n const titleWelcome = document.createElement('p');\n titleWelcome.setAttribute('aria-label', 'title');\n titleWelcome.innerText = 'It’s all here. All in one place.';\n titleWelcome.className = 'display-title';\n textWrapperWelcome.appendChild(titleWelcome)\n const textWelcome = document.createElement('p');\n textWelcome.innerText = 'Enter your home address to find out your city councilmember and neighborhood district manager, along with local information about trash/recycling, your neighborhood police officer, city issues reported in your neighborhood, and more.';\n textWrapperWelcome.appendChild(textWelcome);\n textWrapperWelcome.appendChild(geocoder);\n shadow.appendChild(displayWrapper);\n break;\n\n case 'active':\n shadow.appendChild(display.welcomeStyle);\n displayWrapper.appendChild(geocoder);\n shadow.appendChild(displayWrapper);\n break;\n\n case 'loading':\n const loader = document.createElement('cod-loader');\n loader.setAttribute('data-color', 'color-3');\n displayWrapper.appendChild(loader);\n shadow.appendChild(displayWrapper);\n break;\n\n case 'results':\n let parcelData = JSON.parse(app[0].getAttribute('data-parcel-id'));\n shadow.appendChild(display.resultsStyle);\n let resultsContainer = document.createElement('section');\n resultsContainer.className = 'results-container';\n resultsContainer.appendChild(navTools);\n let dataSetResults = document.createElement('article');\n dataSetResults.className = 'dataset-results';\n let addressBox = document.createElement('article');\n addressBox.className = 'result-address';\n addressBox.innerText = parcelData.address;\n dataSetResults.appendChild(addressBox);\n let results = display.buildDataSection(display);\n dataSetResults.appendChild(results);\n resultsContainer.appendChild(dataSetResults);\n displayWrapper.appendChild(resultsContainer);\n shadow.appendChild(displayWrapper);\n break;\n\n case 'error':\n let errorContainer = document.createElement('section');\n shadow.appendChild(display.resultsStyle);\n errorContainer.className = 'results-container';\n errorContainer.appendChild(navTools);\n let errorBox = document.createElement('article');\n errorBox.className = 'error-result';\n errorBox.innerHTML = `\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"100\" height=\"70\" viewBox=\"0 0 100 68\">\n <g id=\"large\">\n <path fill=\"none\" stroke=\"#F44\" d=\"M55.8 38.5l6.2-1.2c0-1.8-.1-3.5-.4-5.3l-6.3-.2c-.5-2-1.2-4-2.1-6l4.8-4c-.9-1.6-1.9-3-3-4.4l-5.6 3c-1.3-1.6-3-3-4.7-4.1l2-6A30 30 0 0 0 42 8l-3.3 5.4c-2-.7-4.2-1-6.2-1.2L31.3 6c-1.8 0-3.5.1-5.3.4l-.2 6.3c-2 .5-4 1.2-6 2.1l-4-4.8c-1.6.9-3 1.9-4.4 3l3 5.6c-1.6 1.3-3 3-4.1 4.7l-6-2A32.5 32.5 0 0 0 2 26l5.4 3.3c-.7 2-1 4.2-1.2 6.2L0 36.7c0 1.8.1 3.5.4 5.3l6.3.2c.5 2 1.2 4 2.1 6l-4.8 4c.9 1.6 1.9 3 3 4.4l5.6-3c1.4 1.6 3 3 4.7 4.1l-2 6A30.5 30.5 0 0 0 20 66l3.4-5.4c2 .7 4 1 6.1 1.2l1.2 6.2c1.8 0 3.5-.1 5.3-.4l.2-6.3c2-.5 4-1.2 6-2.1l4 4.8c1.6-.9 3-1.9 4.4-3l-3-5.6c1.6-1.3 3-3 4.1-4.7l6 2A32 32 0 0 0 60 48l-5.4-3.3c.7-2 1-4.2 1.2-6.2zm-13.5 4a12.5 12.5 0 1 1-22.6-11 12.5 12.5 0 0 1 22.6 11z\"/>\n <animateTransform attributeName=\"transform\" begin=\"0s\" dur=\"3s\" from=\"0 31 37\" repeatCount=\"indefinite\" to=\"360 31 37\" type=\"rotate\"/>\n </g>\n <g id=\"small\">\n <path fill=\"none\" stroke=\"#F44\" d=\"M93 19.3l6-3c-.4-1.6-1-3.2-1.7-4.8L90.8 13c-.9-1.4-2-2.7-3.4-3.8l2.1-6.3A21.8 21.8 0 0 0 85 .7l-3.6 5.5c-1.7-.4-3.4-.5-5.1-.3l-3-5.9c-1.6.4-3.2 1-4.7 1.7L70 8c-1.5 1-2.8 2-3.9 3.5L60 9.4a20.6 20.6 0 0 0-2.2 4.6l5.5 3.6a15 15 0 0 0-.3 5.1l-5.9 3c.4 1.6 1 3.2 1.7 4.7L65 29c1 1.5 2.1 2.8 3.5 3.9l-2.1 6.3a21 21 0 0 0 4.5 2.2l3.6-5.6c1.7.4 3.5.5 5.2.3l2.9 5.9c1.6-.4 3.2-1 4.8-1.7L86 34c1.4-1 2.7-2.1 3.8-3.5l6.3 2.1a21.5 21.5 0 0 0 2.2-4.5l-5.6-3.6c.4-1.7.5-3.5.3-5.1zM84.5 24a7 7 0 1 1-12.8-6.2 7 7 0 0 1 12.8 6.2z\"/>\n <animateTransform attributeName=\"transform\" begin=\"0s\" dur=\"2s\" from=\"0 78 21\" repeatCount=\"indefinite\" to=\"-360 78 21\" type=\"rotate\"/>\n </g>\n </svg>\n <h3>No Information found on this address. Please close and try again.</h3>\n `;\n errorContainer.appendChild(errorBox);\n displayWrapper.appendChild(errorContainer);\n shadow.appendChild(displayWrapper);\n break;\n\n case 'print':\n let printParcelData = JSON.parse(app[0].getAttribute('data-parcel-id'));\n shadow.appendChild(display.resultsStyle);\n let printResultsContainer = document.createElement('section');\n printResultsContainer.className = 'results-container';\n printResultsContainer.appendChild(navTools);\n let printDataSetResults = document.createElement('article');\n printDataSetResults.className = 'dataset-results';\n let printAddressBox = document.createElement('article');\n printAddressBox.className = 'result-address';\n printAddressBox.innerText = printParcelData.address;\n printDataSetResults.appendChild(printAddressBox);\n let printResults = display.buildDataSection(display);\n printDataSetResults.appendChild(printResults);\n printResultsContainer.appendChild(printDataSetResults);\n displayWrapper.appendChild(printResultsContainer);\n shadow.appendChild(displayWrapper);\n display.printInfo(display);\n break;\n\n default:\n break;\n }\n }\n\n}\n","'use strict';\r\nconst turf = require('@turf/turf');\r\nconst arcGIS = require('terraformer-arcgis-parser');\r\n\r\nexport default class DataLoader extends HTMLElement {\r\n static get observedAttributes() {\r\n return ['data-loader-state', 'data-parcel-id'];\r\n }\r\n\r\n constructor() {\r\n // Always call super first in constructor\r\n super();\r\n\r\n // Create a shadow root\r\n const shadow = this.attachShadow({ mode: 'open' });\r\n\r\n // Create result section\r\n const loaderWrapper = document.createElement('section');\r\n loaderWrapper.id = 'loader-wrapper';\r\n shadow.appendChild(loaderWrapper);\r\n }\r\n\r\n attributeChangedCallback(name, oldValue, newValue) {\r\n const shadow = this.shadowRoot;\r\n // console.log(`Loader - attribute: ${name}, old: ${oldValue}, new: ${newValue}`);\r\n switch (name) {\r\n case 'data-loader-state':\r\n this.clearLoader(this);\r\n this.loadLoader(this);\r\n break;\r\n\r\n default:\r\n break;\r\n }\r\n }\r\n\r\n getDataSets(loader) {\r\n const app = document.getElementsByTagName('my-home-info');\r\n const dataSets = app[0].getAttribute('data-active-sets').split(',');\r\n const parcelData = JSON.parse(app[0].getAttribute('data-parcel-id'));\r\n let dataList = [];\r\n\r\n let assessorsData = new Promise((resolve, reject) => {\r\n if (parcelData.attributes.parcel_id == 'CONDO BUILDING') {\r\n resolve({ \"id\": \"assessors-data\", \"data\": null });\r\n } else {\r\n let url = \"https://apis.detroitmi.gov/assessments/parcel/\" + parcelData.attributes.parcel_id + \"/\";\r\n return fetch(url)\r\n .then((resp) => resp.json()) // Transform the data into json\r\n .then(function (data) {\r\n resolve({ \"id\": \"assessors-data\", \"data\": data });\r\n }).catch(err => {\r\n // console.log(err);\r\n });\r\n }\r\n });\r\n\r\n let neighborhoods = new Promise((resolve, reject) => {\r\n resolve({ \"id\": \"neighborhood\", \"data\": parcelData });\r\n });\r\n\r\n let council = new Promise((resolve, reject) => {\r\n return resolve({ \"id\": \"council\", \"data\": parcelData });\r\n });\r\n let bopMembers = new Promise((resolve, reject) => {\r\n let url = \"/rest/bop?_format=json\";\r\n return fetch(url)\r\n .then((resp) => resp.json()) // Transform the data into json\r\n .then(function (data) {\r\n resolve({ \"id\": \"bop-members\", \"data\": data });\r\n }).catch(err => {\r\n // console.log(err);\r\n });\r\n });\r\n let districtManagers = new Promise((resolve, reject) => {\r\n let url = \"/rest/district-managers?_format=json\";\r\n return fetch(url)\r\n .then((resp) => resp.json()) // Transform the data into json\r\n .then(function (data) {\r\n resolve({ \"id\": \"district-managers\", \"data\": data });\r\n }).catch(err => {\r\n // console.log(err);\r\n });\r\n });\r\n let districtInspectors = new Promise((resolve, reject) => {\r\n let url = \"/rest/district-inspectors?_format=json\";\r\n return fetch(url)\r\n .then((resp) => resp.json()) // Transform the data into json\r\n .then(function (data) {\r\n resolve({ \"id\": \"district-inspectors\", \"data\": data });\r\n }).catch(err => {\r\n // console.log(err);\r\n });\r\n });\r\n let councilMembers = new Promise((resolve, reject) => {\r\n let url = \"/rest/council-members?_format=json\";\r\n return fetch(url)\r\n .then((resp) => resp.json()) // Transform the data into json\r\n .then(function (data) {\r\n resolve({ \"id\": \"council-members\", \"data\": data });\r\n }).catch(err => {\r\n // console.log(err);\r\n });\r\n });\r\n let DWSDBackupProtection = new Promise((resolve, reject) => {\r\n resolve({ \"id\": \"DWSDBackupProtection\", \"data\": parcelData });\r\n });\r\n let HRDFlooding = new Promise((resolve, reject) => {\r\n resolve({ \"id\": \"HRDFlooding\", \"data\": parcelData });\r\n });\r\n let nrsa = new Promise((resolve, reject) => {\r\n let url = `https://services2.arcgis.com/qvkbeam7Wirps6zC/arcgis/rest/services/NRSA_2020/FeatureServer/0/query?where=&objectIds=&time=&geometry=${parcelData.location.x}%2C${parcelData.location.y}&geometryType=esriGeometryPoint&inSR=4326&spatialRel=esriSpatialRelIntersects&resultType=none&distance=0.0&units=esriSRUnit_Meter&returnGeodetic=false&outFields=*&returnGeometry=true&returnCentroid=false&featureEncoding=esriDefault&multipatchOption=xyFootprint&maxAllowableOffset=&geometryPrecision=&outSR=&datumTransformation=&applyVCSProjection=false&returnIdsOnly=false&returnUniqueIdsOnly=false&returnCountOnly=false&returnExtentOnly=false&returnQueryGeometry=false&returnDistinctValues=false&cacheHint=false&orderByFields=&groupByFieldsForStatistics=&outStatistics=&having=&resultOffset=&resultRecordCount=&returnZ=false&returnM=false&returnExceededLimitFeatures=true&quantizationParameters=&sqlFormat=none&f=json&token=`\r\n return fetch(url)\r\n .then((resp) => resp.json()) // Transform the data into json\r\n .then(function (data) {\r\n resolve({ \"id\": \"nrsa\", \"data\": data });\r\n }).catch(err => {\r\n // console.log(err);\r\n });\r\n });\r\n let nezHomestead = new Promise((resolve, reject) => {\r\n let url = `https://services2.arcgis.com/qvkbeam7Wirps6zC/ArcGIS/rest/services/NEZHOMESTEAD2021/FeatureServer/0/query?where=&objectIds=&time=&geometry=${parcelData.location.x}%2C${parcelData.location.y}&geometryType=esriGeometryPoint&inSR=4326&spatialRel=esriSpatialRelIntersects&resultType=none&distance=0.0&units=esriSRUnit_Meter&returnGeodetic=false&outFields=*&returnGeometry=true&returnCentroid=false&featureEncoding=esriDefault&multipatchOption=xyFootprint&maxAllowableOffset=&geometryPrecision=&outSR=&datumTransformation=&applyVCSProjection=false&returnIdsOnly=false&returnUniqueIdsOnly=false&returnCountOnly=false&returnExtentOnly=false&returnQueryGeometry=false&returnDistinctValues=false&cacheHint=false&orderByFields=&groupByFieldsForStatistics=&outStatistics=&having=&resultOffset=&resultRecordCount=&returnZ=false&returnM=false&returnExceededLimitFeatures=true&quantizationParameters=&sqlFormat=none&f=json&token=`\r\n return fetch(url)\r\n .then((resp) => resp.json()) // Transform the data into json\r\n .then(function (data) {\r\n resolve({ \"id\": \"nez\", \"data\": data });\r\n }).catch(err => {\r\n // console.log(err);\r\n });\r\n });\r\n let permitData = new Promise((resolve, reject) => {\r\n let url = `https://services2.arcgis.com/qvkbeam7Wirps6zC/ArcGIS/rest/services/BuildingPermits/FeatureServer/0/query?where=parcel_id+%3D+%27${parcelData.attributes.parcel_id}%27&objectIds=&time=&geometry=&geometryType=esriGeometryEnvelope&inSR=&spatialRel=esriSpatialRelIntersects&resultType=none&distance=0.0&units=esriSRUnit_Meter&returnGeodetic=false&outFields=*&returnGeometry=true&featureEncoding=esriDefault&multipatchOption=xyFootprint&maxAllowableOffset=&geometryPrecision=&outSR=&datumTransformation=&applyVCSProjection=false&returnIdsOnly=false&returnUniqueIdsOnly=false&returnCountOnly=false&returnExtentOnly=false&returnQueryGeometry=false&returnDistinctValues=false&cacheHint=false&orderByFields=&groupByFieldsForStatistics=&outStatistics=&having=&resultOffset=&resultRecordCount=3&returnZ=false&returnM=false&returnExceededLimitFeatures=true&quantizationParameters=&sqlFormat=none&f=json`;\r\n return fetch(url)\r\n .then((resp) => resp.json()) // Transform the data into json\r\n .then(function (data) {\r\n resolve({ \"id\": \"permit-data\", \"data\": data });\r\n }).catch(err => {\r\n // console.log(err);\r\n });\r\n });\r\n let rentalData = new Promise((resolve, reject) => {\r\n let url;\r\n if (parcelData.attributes.parcel_id != 'CONDO BUILDING') {\r\n url = `https://services2.arcgis.com/qvkbeam7Wirps6zC/ArcGIS/rest/services/RentalStatuses/FeatureServer/0/query?where=parcel_id+%3D+%27${parcelData.attributes.parcel_id}%27&objectIds=&time=&geometry=&geometryType=esriGeometryEnvelope&inSR=&spatialRel=esriSpatialRelIntersects&resultType=none&distance=0.0&units=esriSRUnit_Meter&returnGeodetic=false&outFields=*&returnGeometry=true&featureEncoding=esriDefault&multipatchOption=xyFootprint&maxAllowableOffset=&geometryPrecision=&outSR=&datumTransformation=&applyVCSProjection=false&returnIdsOnly=false&returnUniqueIdsOnly=false&returnCountOnly=false&returnExtentOnly=false&returnQueryGeometry=false&returnDistinctValues=false&cacheHint=false&orderByFields=&groupByFieldsForStatistics=&outStatistics=&having=&resultOffset=&resultRecordCount=&returnZ=false&returnM=false&returnExceededLimitFeatures=true&quantizationParameters=&sqlFormat=none&f=json`;\r\n } else {\r\n url = `https://services2.arcgis.com/qvkbeam7Wirps6zC/ArcGIS/rest/services/RentalStatuses/FeatureServer/0/query?where=&objectIds=&time=&geometry=${parcelData.location.x}%2C+${parcelData.location.y}&geometryType=esriGeometryPoint&inSR=4326&spatialRel=esriSpatialRelIndexIntersects&distance=&units=esriSRUnit_Foot&relationParam=&outFields=*&returnGeometry=true&maxAllowableOffset=&geometryPrecision=&outSR=&gdbVersion=&returnDistinctValues=false&returnIdsOnly=false&returnCountOnly=false&returnExtentOnly=false&orderByFields=&groupByFieldsForStatistics=&outStatistics=&returnZ=false&returnM=false&multipatchOption=&resultOffset=&resultRecordCount=&f=json`;\r\n }\r\n return fetch(url)\r\n .then((resp) => resp.json()) // Transform the data into json\r\n .then(function (data) {\r\n resolve({ \"id\": \"rental-data\", \"data\": data });\r\n }).catch(err => {\r\n // console.log(err);\r\n });\r\n });\r\n let rentalCertData = new Promise((resolve, reject) => {\r\n let url;\r\n if (parcelData.attributes.parcel_id != 'CONDO BUILDING') {\r\n url = `https://services2.arcgis.com/qvkbeam7Wirps6zC/ArcGIS/rest/services/active_cofc/FeatureServer/0/query?where=parcel_id%3D%27${parcelData.attributes.parcel_id}%27&objectIds=&time=&geometry=&geometryType=esriGeometryEnvelope&inSR=&spatialRel=esriSpatialRelIntersects&resultType=none&distance=0.0&units=esriSRUnit_Meter&returnGeodetic=false&outFields=*&returnGeometry=true&featureEncoding=esriDefault&multipatchOption=xyFootprint&maxAllowableOffset=&geometryPrecision=&outSR=&datumTransformation=&applyVCSProjection=false&returnIdsOnly=false&returnUniqueIdsOnly=false&returnCountOnly=false&returnExtentOnly=false&returnQueryGeometry=false&returnDistinctValues=false&cacheHint=false&orderByFields=&groupByFieldsForStatistics=&outStatistics=&having=&resultOffset=&resultRecordCount=1&returnZ=false&returnM=false&returnExceededLimitFeatures=true&quantizationParameters=&sqlFormat=none&f=json`;\r\n } else {\r\n url = `https://services2.arcgis.com/qvkbeam7Wirps6zC/ArcGIS/rest/services/active_cofc/FeatureServer/0/query?where=&objectIds=&time=&geometry=${parcelData.location.x}%2C+${parcelData.location.y}&geometryType=esriGeometryPoint&inSR=4326&spatialRel=esriSpatialRelIndexIntersects&distance=&units=esriSRUnit_Foot&relationParam=&outFields=*&returnGeometry=true&maxAllowableOffset=&geometryPrecision=&outSR=&gdbVersion=&returnDistinctValues=false&returnIdsOnly=false&returnCountOnly=false&returnExtentOnly=false&orderByFields=&groupByFieldsForStatistics=&outStatistics=&returnZ=false&returnM=false&multipatchOption=&resultOffset=&resultRecordCount=&f=json`;\r\n }\r\n return fetch(url)\r\n .then((resp) => resp.json()) // Transform the data into json\r\n .then(function (data) {\r\n resolve({ \"id\": \"rental-cert-data\", \"data\": data });\r\n }).catch(err => {\r\n // console.log(err);\r\n });\r\n });\r\n let blightData = new Promise((resolve, reject) => {\r\n let url = `https://services2.arcgis.com/qvkbeam7Wirps6zC/arcgis/rest/services/Blight_Violations_(DAH)/FeatureServer/0/query?where=parcelno%3D%27${parcelData.attributes.parcel_id}%27&objectIds=&time=&geometry=&geometryType=esriGeometryEnvelope&inSR=&spatialRel=esriSpatialRelIntersects&resultType=none&distance=0.0&units=esriSRUnit_Meter&returnGeodetic=false&outFields=*&returnGeometry=true&featureEncoding=esriDefault&multipatchOption=xyFootprint&maxAllowableOffset=&geometryPrecision=&outSR=&datumTransformation=&applyVCSProjection=false&returnIdsOnly=false&returnUniqueIdsOnly=false&returnCountOnly=false&returnExtentOnly=false&returnQueryGeometry=false&returnDistinctValues=false&cacheHint=false&orderByFields=violation_date&groupByFieldsForStatistics=&outStatistics=&having=&resultOffset=&resultRecordCount=2&returnZ=false&returnM=false&returnExceededLimitFeatures=true&quantizationParameters=&sqlFormat=none&f=json&token=`;\r\n return fetch(url)\r\n .then((resp) => resp.json()) // Transform the data into json\r\n .then(function (data) {\r\n resolve({ \"id\": \"blight-data\", \"data\": data });\r\n }).catch(err => {\r\n // console.log(err);\r\n });\r\n });\r\n let salesHistoryData = new Promise((resolve, reject) => {\r\n let url = `https://services2.arcgis.com/qvkbeam7Wirps6zC/arcgis/rest/services/Property_Sales/FeatureServer/0/query?where=PARCEL_NO%3D%27${parcelData.attributes.parcel_id}%27&objectIds=&time=&geometry=&geometryType=esriGeometryEnvelope&inSR=&spatialRel=esriSpatialRelIntersects&resultType=none&distance=0.0&units=esriSRUnit_Meter&returnGeodetic=false&outFields=*&returnGeometry=true&featureEncoding=esriDefault&multipatchOption=xyFootprint&maxAllowableOffset=&geometryPrecision=&outSR=4326&datumTransformation=&applyVCSProjection=false&returnIdsOnly=false&returnUniqueIdsOnly=false&returnCountOnly=false&returnExtentOnly=false&returnQueryGeometry=false&returnDistinctValues=false&cacheHint=false&orderByFields=SALE_DATE&groupByFieldsForStatistics=&outStatistics=&having=&resultOffset=&resultRecordCount=2&returnZ=false&returnM=false&returnExceededLimitFeatures=true&quantizationParameters=&sqlFormat=none&f=json&token=`;\r\n return fetch(url)\r\n .then((resp) => resp.json()) // Transform the data into json\r\n .then(function (data) {\r\n resolve({ \"id\": \"sales-data\", \"data\": data });\r\n }).catch(err => {\r\n // console.log(err);\r\n });\r\n });\r\n let demosData = new Promise((resolve, reject) => {\r\n let point = turf.point([parcelData.location.x, parcelData.location.y]);\r\n let buffer = turf.buffer(point, 2, { units: 'miles' });\r\n let simplePolygon = turf.simplify(buffer.geometry, { tolerance: 0.005, highQuality: false });\r\n let arcsimplePolygon = arcGIS.convert(simplePolygon);\r\n let url = `https://services2.arcgis.com/qvkbeam7Wirps6zC/arcgis/rest/services/Demolitions_under_Contract/FeatureServer/0/query?where=&objectIds=&time=&geometry=${encodeURI(JSON.stringify(arcsimplePolygon))}&geometryType=esriGeometryPolygon&inSR=&spatialRel=esriSpatialRelIntersects&relationParam=&outFields=*&returnGeometry=true&returnTrueCurves=false&maxAllowableOffset=&geometryPrecision=&outSR=4326&returnIdsOnly=false&returnCountOnly=false&orderByFields=&groupByFieldsForStatistics=&outStatistics=&returnZ=false&returnM=false&gdbVersion=&returnDistinctValues=false&resultOffset=&resultRecordCount=&f=geojson`;\r\n return fetch(url)\r\n .then((resp) => resp.json()) // Transform the data into json\r\n .then(function (data) {\r\n data.features.sort(loader.sortFeaturesByDistanceTo(point));\r\n resolve({ \"id\": \"demos-data\", \"data\": data });\r\n }).catch(err => {\r\n // console.log(err);\r\n });\r\n });\r\n let stabilizationData = new Promise((resolve, reject) => {\r\n let point = turf.point([parcelData.location.x, parcelData.location.y]);\r\n let buffer = turf.buffer(point, 2, { units: 'miles' });\r\n let simplePolygon = turf.simplify(buffer.geometry, { tolerance: 0.005, highQuality: false });\r\n let arcsimplePolygon = arcGIS.convert(simplePolygon);\r\n let url = `https://services2.arcgis.com/qvkbeam7Wirps6zC/arcgis/rest/services/Contracted_Stabilizations/FeatureServer/0/query?where=&objectIds=&time=&geometry=${encodeURI(JSON.stringify(arcsimplePolygon))}&geometryType=esriGeometryPolygon&inSR=&spatialRel=esriSpatialRelIntersects&relationParam=&outFields=*&returnGeometry=true&returnTrueCurves=false&maxAllowableOffset=&geometryPrecision=&outSR=4326&returnIdsOnly=false&returnCountOnly=false&orderByFields=&groupByFieldsForStatistics=&outStatistics=&returnZ=false&returnM=false&gdbVersion=&returnDistinctValues=false&resultOffset=&resultRecordCount=3&f=geojson`;\r\n return fetch(url)\r\n .then((resp) => resp.json()) // Transform the data into json\r\n .then(function (data) {\r\n data.features.sort(loader.sortFeaturesByDistanceTo(point));\r\n resolve({ \"id\": \"stabilization-data\", \"data\": data });\r\n }).catch(err => {\r\n // console.log(err);\r\n });\r\n });\r\n let demoStatus = new Promise((resolve, reject) => {\r\n let url = `https://services2.arcgis.com/qvkbeam7Wirps6zC/arcgis/rest/services/Demolitions_under_Contract/FeatureServer/0/query?where=parcel_id+%3D+%27${parcelData.attributes.parcel_id}%27&objectIds=&time=&geometry=&geometryType=esriGeometryPolygon&inSR=&spatialRel=esriSpatialRelIntersects&resultType=none&distance=0.0&units=esriSRUnit_Meter&returnGeodetic=false&outFields=*&returnGeometry=true&featureEncoding=esriDefault&multipatchOption=xyFootprint&maxAllowableOffset=&geometryPrecision=&outSR=4326&datumTransformation=&applyVCSProjection=false&returnIdsOnly=false&returnUniqueIdsOnly=false&returnCountOnly=false&returnExtentOnly=false&returnQueryGeometry=false&returnDistinctValues=false&cacheHint=false&orderByFields=demolish_by_date&groupByFieldsForStatistics=&outStatistics=&having=&resultOffset=&resultRecordCount=1&returnZ=false&returnM=false&returnExceededLimitFeatures=true&quantizationParameters=&sqlFormat=none&f=json&token=`;\r\n return fetch(url)\r\n .then((resp) => resp.json()) // Transform the data into json\r\n .then(function (data) {\r\n resolve({ \"id\": \"demo-status\", \"data\": data });\r\n }).catch(err => {\r\n // console.log(err);\r\n });\r\n });\r\n let schools = new Promise((resolve, reject) => {\r\n let point = turf.point([parcelData.location.x, parcelData.location.y]);\r\n let buffer = turf.buffer(point, 2, { units: 'miles' });\r\n let simplePolygon = turf.simplify(buffer.geometry, { tolerance: 0.005, highQuality: false });\r\n let arcsimplePolygon = arcGIS.convert(simplePolygon);\r\n let url = `https://services2.arcgis.com/qvkbeam7Wirps6zC/ArcGIS/rest/services/2018_2019_Schools_(EEM)/FeatureServer/0/query?where=&objectIds=&time=&geometry=${encodeURI(JSON.stringify(arcsimplePolygon))}&geometryType=esriGeometryPolygon&inSR=&spatialRel=esriSpatialRelIntersects&relationParam=&outFields=*&returnGeometry=true&returnTrueCurves=false&maxAllowableOffset=&geometryPrecision=&outSR=4326&returnIdsOnly=false&returnCountOnly=false&orderByFields=&groupByFieldsForStatistics=&outStatistics=&returnZ=false&returnM=false&gdbVersion=&returnDistinctValues=false&resultOffset=&resultRecordCount=&f=geojson`;\r\n return fetch(url)\r\n .then((resp) => resp.json()) // Transform the data into json\r\n .then(function (data) {\r\n data.features.sort(loader.sortFeaturesByDistanceTo(point));\r\n resolve({ \"id\": \"schools\", \"data\": data });\r\n }).catch(err => {\r\n // console.log(err);\r\n });\r\n });\r\n let npo = new Promise((resolve, reject) => {\r\n let url = `https://services2.arcgis.com/qvkbeam7Wirps6zC/ArcGIS/rest/services/Neighborhood_Police_Officers/FeatureServer/0/query?where=&objectIds=&time=&geometry=${parcelData.location.x}%2C${parcelData.location.y}&geometryType=esriGeometryPoint&inSR=4326&spatialRel=esriSpatialRelIntersects&resultType=none&distance=1&units=esriSRUnit_Meter&returnGeodetic=false&outFields=*&returnGeometry=true&returnCentroid=false&multipatchOption=xyFootprint&maxAllowableOffset=&geometryPrecision=&outSR=4326&datumTransformation=&applyVCSProjection=false&returnIdsOnly=false&returnCountOnly=false&returnExtentOnly=false&returnDistinctValues=false&orderByFields=&groupByFieldsForStatistics=&outStatistics=&having=&resultOffset=&resultRecordCount=&returnZ=false&returnM=false&returnExceededLimitFeatures=true&quantizationParameters=&sqlFormat=none&f=json&token=`;\r\n return fetch(url)\r\n .then((resp) => resp.json()) // Transform the data into json\r\n .then(function (data) {\r\n resolve({ \"id\": \"npo\", \"data\": data });\r\n }).catch(err => {\r\n // console.log(err);\r\n });\r\n });\r\n let improveDet = new Promise((resolve, reject) => {\r\n let point = turf.point([parcelData.location.x, parcelData.location.y]);\r\n let buffer = turf.buffer(point, 500, { units: 'meters' });\r\n let simplePolygon = turf.simplify(buffer.geometry, { tolerance: 0.005, highQuality: false });\r\n let arcsimplePolygon = arcGIS.convert(simplePolygon);\r\n let url = `https://services2.arcgis.com/qvkbeam7Wirps6zC/ArcGIS/rest/services/Improve_Detroit_Issues_Test/FeatureServer/0/query?where=status+%3C%3E+%27Closed%27+and+status+%3C%3E+%27Archived%27&objectIds=&time=&geometry=${encodeURI(JSON.stringify(arcsimplePolygon))}&geometryType=esriGeometryPolygon&inSR=&spatialRel=esriSpatialRelIntersects&relationParam=&outFields=*&returnGeometry=true&returnTrueCurves=false&maxAllowableOffset=&geometryPrecision=&outSR=4326&returnIdsOnly=false&returnCountOnly=false&orderByFields=&groupByFieldsForStatistics=&outStatistics=&returnZ=false&returnM=false&gdbVersion=&returnDistinctValues=false&resultOffset=&resultRecordCount=&f=geojson`;\r\n return fetch(url)\r\n .then((resp) => resp.json()) // Transform the data into json\r\n .then(function (data) {\r\n resolve({ \"id\": \"improve-det\", \"data\": data });\r\n }).catch(err => {\r\n // console.log(err);\r\n });\r\n });\r\n let recycling = new Promise((resolve, reject) => {\r\n let url = \"https://services2.arcgis.com/qvkbeam7Wirps6zC/arcgis/rest/services/WasteCollectionAreas/FeatureServer/0/query?where=&text=&objectIds=&time=&geometry=\" + parcelData.location.x + \"%2C+\" + parcelData.location.y + \"&geometryType=esriGeometryPoint&inSR=4326&spatialRel=esriSpatialRelWithin&relationParam=&outFields=*&returnGeometry=true&returnTrueCurves=false&maxAllowableOffset=&geometryPrecision=&outSR=&returnIdsOnly=false&returnCountOnly=false&orderByFields=&groupByFieldsForStatistics=&outStatistics=&returnZ=false&returnM=false&gdbVersion=&returnDistinctValues=false&resultOffset=&resultRecordCount=&f=json\";\r\n fetch(url)\r\n .then((resp) => resp.json()) // Transform the data into json\r\n .then(function (data) {\r\n let today = new Date();\r\n let todaysMonth = today.getMonth() + 1;\r\n let todaysYear = today.getFullYear();\r\n let url = `https://apis.detroitmi.gov/waste_schedule/details/${data.features[0].attributes.FID}/year/${todaysYear}/month/${todaysMonth}/`;\r\n return fetch(url)\r\n .then((resp) => resp.json()) // Transform the data into json\r\n .then(function (data) {\r\n resolve({ \"id\": \"recycling\", \"data\": data });\r\n });\r\n }).catch(err => {\r\n // console.log(err);\r\n });\r\n });\r\n let historicDistrict = new Promise((resolve, reject) => {\r\n let url = \"https://services2.arcgis.com/qvkbeam7Wirps6zC/ArcGIS/rest/services/Detroit_Local_Historic_Districts/FeatureServer/0/query?where=&text=&objectIds=&time=&geometry=\" + parcelData.location.x + \"%2C+\" + parcelData.location.y + \"&geometryType=esriGeometryPoint&inSR=4326&spatialRel=esriSpatialRelWithin&relationParam=&outFields=*&returnGeometry=true&returnTrueCurves=false&maxAllowableOffset=&geometryPrecision=&outSR=&returnIdsOnly=false&returnCountOnly=false&orderByFields=&groupByFieldsForStatistics=&outStatistics=&returnZ=false&returnM=false&gdbVersion=&returnDistinctValues=false&resultOffset=&resultRecordCount=&f=json\";\r\n fetch(url)\r\n .then((resp) => resp.json()) // Transform the data into json\r\n .then(function (data) {\r\n resolve({ \"id\": \"historicDistrict\", \"data\": data });\r\n }).catch(err => {\r\n // console.log(err);\r\n });\r\n });\r\n let fireEscrow = new Promise((resolve, reject) => {\r\n let url = `https://services2.arcgis.com/qvkbeam7Wirps6zC/arcgis/rest/services/fie_properties_final/FeatureServer/0/query?where=parcel_id%3D%27${parcelData.attributes.parcel_id}%27&objectIds=&time=&geometry=&geometryType=esriGeometryEnvelope&inSR=&spatialRel=esriSpatialRelIntersects&resultType=none&distance=0.0&units=esriSRUnit_Meter&returnGeodetic=false&outFields=*&returnHiddenFields=false&returnGeometry=true&returnCentroid=false&featureEncoding=esriDefault&multipatchOption=xyFootprint&maxAllowableOffset=&geometryPrecision=&outSR=&datumTransformation=&applyVCSProjection=false&returnIdsOnly=false&returnUniqueIdsOnly=false&returnCountOnly=false&returnExtentOnly=false&returnQueryGeometry=false&returnDistinctValues=false&cacheHint=false&orderByFields=&groupByFieldsForStatistics=&outStatistics=&having=&resultOffset=&resultRecordCount=&returnZ=false&returnM=false&returnExceededLimitFeatures=true&quantizationParameters=&sqlFormat=none&f=json&token=`;\r\n return fetch(url)\r\n .then((resp) => resp.json()) // Transform the data into json\r\n .then(function (data) {\r\n resolve({ \"id\": \"fireEscrow\", \"data\": data });\r\n }).catch(err => {\r\n // console.log(err);\r\n });\r\n });\r\n dataSets.forEach(f => {\r\n switch (f) {\r\n case 'council':\r\n dataList.push(council);\r\n break;\r\n\r\n case 'neighborhood':\r\n dataList.push(neighborhoods);\r\n break;\r\n\r\n case 'assessors-data':\r\n if (parcelData.attributes.parcel_id != null && parcelData.attributes.parcel_id != '') {\r\n if (parcelData.attributes.parcel_id == 'CONDO BUILDING') {\r\n } else {\r\n dataList.push(assessorsData);\r\n }\r\n }\r\n break;\r\n\r\n case 'permit-data':\r\n if (parcelData.attributes.parcel_id != null && parcelData.attributes.parcel_id != '') {\r\n dataList.push(permitData);\r\n }\r\n break;\r\n\r\n case 'blight-data':\r\n if (parcelData.attributes.parcel_id != null && parcelData.attributes.parcel_id != '') {\r\n dataList.push(blightData);\r\n }\r\n break;\r\n\r\n case 'salesHistoryData':\r\n if (parcelData.attributes.parcel_id != null && parcelData.attributes.parcel_id != '') {\r\n dataList.push(salesHistoryData);\r\n }\r\n break;\r\n\r\n case 'fireEscrow':\r\n if (parcelData.attributes.parcel_id != null && parcelData.attributes.parcel_id != '') {\r\n dataList.push(fireEscrow);\r\n }\r\n break;\r\n\r\n case 'nez':\r\n dataList.push(nezHomestead);\r\n break;\r\n\r\n case 'nrsa':\r\n dataList.push(nrsa);\r\n break;\r\n\r\n case 'npo':\r\n dataList.push(npo);\r\n break;\r\n\r\n case 'improve-det':\r\n dataList.push(improveDet);\r\n break;\r\n\r\n case 'recycling':\r\n dataList.push(recycling);\r\n break;\r\n\r\n case 'rental-data':\r\n if (parcelData.attributes.parcel_id != null && parcelData.attributes.parcel_id != '') {\r\n dataList.push(rentalData);\r\n }\r\n break;\r\n\r\n case 'rental-cert':\r\n dataList.push(rentalCertData);\r\n break;\r\n\r\n case 'demo-status':\r\n if (parcelData.attributes.parcel_id != null && parcelData.attributes.parcel_id != '') {\r\n dataList.push(demoStatus);\r\n }\r\n break;\r\n\r\n case 'demos-data':\r\n dataList.push(demosData);\r\n break;\r\n\r\n case 'stabilization-data':\r\n dataList.push(stabilizationData);\r\n break;\r\n\r\n case 'schools':\r\n dataList.push(schools);\r\n break;\r\n\r\n case 'historicDistrict':\r\n dataList.push(historicDistrict);\r\n break;\r\n\r\n case 'district-managers':\r\n dataList.push(districtManagers);\r\n break;\r\n\r\n case 'district-inspectors':\r\n dataList.push(districtInspectors);\r\n break;\r\n\r\n case 'council-members':\r\n dataList.push(councilMembers);\r\n break;\r\n\r\n case 'bop-members':\r\n dataList.push(bopMembers);\r\n break;\r\n\r\n case 'HRDFlooding':\r\n dataList.push(HRDFlooding);\r\n break;\r\n\r\n default:\r\n break;\r\n }\r\n });\r\n return dataList;\r\n }\r\n\r\n buildCouncilData(data) {\r\n let councilData = {\r\n council: {\r\n district: `District ${data.council.data.attributes.council_district}`,\r\n districtURL: null,\r\n name: null,\r\n url: null,\r\n phone: null\r\n },\r\n bop: {\r\n district: `District ${data.council.data.attributes.council_district}`,\r\n url: null,\r\n name: null,\r\n url: null,\r\n phone: null,\r\n email: null\r\n },\r\n dmanager: {\r\n name: null,\r\n url: `/departments/department-of-neighborhoods/district-${data.council.data.attributes.council_district}#block-views-block-contacts-special-block-1`,\r\n phone: null\r\n },\r\n ddmanager: {\r\n name: null,\r\n url: `/departments/department-of-neighborhoods/district-${data.council.data.attributes.council_district}#block-views-block-contacts-special-block-1`,\r\n phone: null\r\n },\r\n bliaision: {\r\n name: null,\r\n email: null\r\n },\r\n enforcement: {\r\n name: null,\r\n phone: null\r\n }\r\n };\r\n switch (data.council.data.attributes.council_district.toString()) {\r\n case \"1\":\r\n councilData.council.districtURL = `/taxonomy/term/1276`;\r\n data['council-members'].data.forEach((item) => {\r\n if (item.tid == '1276') {\r\n councilData.council.name = item.field_organization_head_name;\r\n councilData.council.url = `/taxonomy/term/1276`;\r\n councilData.council.phone = item.field_phone;\r\n }\r\n });\r\n data['bop-members'].data.forEach((item) => {\r\n if (item.field_responsibilities.includes('District 1')) {\r\n councilData.bop.name = item.title;\r\n councilData.bop.url = `/taxonomy/term/4331`;\r\n let cleanPhone = item.field_telephone.replace(/ /g, '-');\r\n cleanPhone = cleanPhone.replace(/[()]/g, '');\r\n councilData.bop.phone = `<a href=\"tel:${cleanPhone}\">${item.field_telephone}</a>`;\r\n councilData.bop.email = item.field_email_address;\r\n }\r\n });\r\n data['district-managers'].data.forEach((item) => {\r\n if (item.field_contact_position.includes('District 1 Manager')) {\r\n councilData.dmanager.name = item.title;\r\n councilData.dmanager.phone = item.field_telephone;\r\n }\r\n if (item.field_contact_position.includes('District 1 Deputy Manager')) {\r\n councilData.ddmanager.name = item.title;\r\n councilData.ddmanager.phone = item.field_telephone;\r\n }\r\n if (item.field_contact_position.includes('District 1 Business Liaison')) {\r\n councilData.bliaision.name = item.title;\r\n councilData.bliaision.email = item.field_email_address;\r\n }\r\n });\r\n data['district-inspectors'].data.forEach((item) => {\r\n if (item.field_responsibilities.includes('District 1')) {\r\n councilData.enforcement.name = item.title;\r\n councilData.enforcement.phone = item.field_telephone;\r\n }\r\n });\r\n break;\r\n\r\n case \"2\":\r\n councilData.council.districtURL = `/taxonomy/term/1476`;\r\n data['council-members'].data.forEach((item) => {\r\n if (item.tid == '1476') {\r\n councilData.council.name = item.field_organization_head_name;\r\n councilData.council.url = `/taxonomy/term/1476`;\r\n councilData.council.phone = item.field_phone;\r\n }\r\n });\r\n data['bop-members'].data.forEach((item) => {\r\n if (item.field_responsibilities.includes('District 2')) {\r\n councilData.bop.name = item.title;\r\n councilData.bop.url = `/taxonomy/term/4336`;\r\n let cleanPhone = item.field_telephone.replace(/ /g, '-');\r\n cleanPhone = cleanPhone.replace(/[()]/g, '');\r\n councilData.bop.phone = `<a href=\"tel:${cleanPhone}\">${item.field_telephone}</a>`;\r\n councilData.bop.email = item.field_email_address;\r\n }\r\n });\r\n data['district-managers'].data.forEach((item) => {\r\n if (item.field_contact_position.includes('District 2 Manager')) {\r\n councilData.dmanager.name = item.title;\r\n councilData.dmanager.phone = item.field_telephone;\r\n }\r\n if (item.field_contact_position.includes('District 2 Deputy Manager')) {\r\n councilData.ddmanager.name = item.title;\r\n councilData.ddmanager.phone = item.field_telephone;\r\n }\r\n if (item.field_contact_position.includes('District 2 Business Liaison')) {\r\n councilData.bliaision.name = item.title;\r\n councilData.bliaision.email = item.field_email_address;\r\n }\r\n });\r\n data['district-inspectors'].data.forEach((item) => {\r\n if (item.field_responsibilities.includes('District 2')) {\r\n councilData.enforcement.name = item.title;\r\n councilData.enforcement.phone = item.field_telephone;\r\n }\r\n });\r\n break;\r\n\r\n case \"3\":\r\n councilData.council.districtURL = `/taxonomy/term/1481`;\r\n data['council-members'].data.forEach((item) => {\r\n if (item.tid == '1481') {\r\n councilData.council.name = item.field_organization_head_name;\r\n councilData.council.url = `/taxonomy/term/1481`;\r\n councilData.council.phone = item.field_phone;\r\n }\r\n });\r\n data['bop-members'].data.forEach((item) => {\r\n if (item.field_responsibilities.includes('District 3')) {\r\n councilData.bop.name = item.title;\r\n councilData.bop.url = `/taxonomy/term/4341`;\r\n let cleanPhone = item.field_telephone.replace(/ /g, '-');\r\n cleanPhone = cleanPhone.replace(/[()]/g, '');\r\n councilData.bop.phone = `<a href=\"tel:${cleanPhone}\">${item.field_telephone}</a>`;\r\n councilData.bop.email = item.field_email_address;\r\n }\r\n });\r\n data['district-managers'].data.forEach((item) => {\r\n if (item.field_contact_position.includes('District 3 Manager')) {\r\n councilData.dmanager.name = item.title;\r\n councilData.dmanager.phone = item.field_telephone;\r\n }\r\n if (item.field_contact_position.includes('District 3 Deputy Manager')) {\r\n councilData.ddmanager.name = item.title;\r\n councilData.ddmanager.phone = item.field_telephone;\r\n }\r\n if (item.field_contact_position.includes('District 3 Business Liaison')) {\r\n councilData.bliaision.name = item.title;\r\n councilData.bliaision.email = item.field_email_address;\r\n }\r\n });\r\n data['district-inspectors'].data.forEach((item) => {\r\n if (item.field_responsibilities.includes('District 3')) {\r\n councilData.enforcement.name = item.title;\r\n councilData.enforcement.phone = item.field_telephone;\r\n }\r\n });\r\n break;\r\n\r\n case \"4\":\r\n councilData.council.districtURL = `/taxonomy/term/1486`;\r\n data['council-members'].data.forEach((item) => {\r\n if (item.tid == '1486') {\r\n councilData.council.name = item.field_organization_head_name;\r\n councilData.council.url = `/taxonomy/term/1486`;\r\n councilData.council.phone = item.field_phone;\r\n }\r\n });\r\n data['bop-members'].data.forEach((item) => {\r\n if (item.field_responsibilities.includes('District 4')) {\r\n councilData.bop.name = item.title;\r\n councilData.bop.url = `/taxonomy/term/4346`;\r\n let cleanPhone = item.field_telephone.replace(/ /g, '-');\r\n cleanPhone = cleanPhone.replace(/[()]/g, '');\r\n councilData.bop.phone = `<a href=\"tel:${cleanPhone}\">${item.field_telephone}</a>`;\r\n councilData.bop.email = item.field_email_address;\r\n }\r\n });\r\n data['district-managers'].data.forEach((item) => {\r\n if (item.field_contact_position.includes('District 4 Manager')) {\r\n councilData.dmanager.name = item.title;\r\n councilData.dmanager.phone = item.field_telephone;\r\n }\r\n if (item.field_contact_position.includes('District 4 Deputy Manager')) {\r\n councilData.ddmanager.name = item.title;\r\n councilData.ddmanager.phone = item.field_telephone;\r\n }\r\n if (item.field_contact_position.includes('District 4 Business Liaison')) {\r\n councilData.bliaision.name = item.title;\r\n councilData.bliaision.email = item.field_email_address;\r\n }\r\n });\r\n data['district-inspectors'].data.forEach((item) => {\r\n if (item.field_responsibilities.includes('District 4')) {\r\n councilData.enforcement.name = item.title;\r\n councilData.enforcement.phone = item.field_telephone;\r\n }\r\n });\r\n break;\r\n\r\n case \"5\":\r\n councilData.council.districtURL = `/taxonomy/term/1346`;\r\n data['council-members'].data.forEach((item) => {\r\n if (item.tid == '1346') {\r\n councilData.council.name = item.field_organization_head_name;\r\n councilData.council.url = `/taxonomy/term/1346`;\r\n councilData.council.phone = item.field_phone;\r\n }\r\n });\r\n data['bop-members'].data.forEach((item) => {\r\n if (item.field_responsibilities.includes('District 5')) {\r\n councilData.bop.name = item.title;\r\n councilData.bop.url = `/taxonomy/term/4351`;\r\n let cleanPhone = item.field_telephone.replace(/ /g, '-');\r\n cleanPhone = cleanPhone.replace(/[()]/g, '');\r\n councilData.bop.phone = `<a href=\"tel:${cleanPhone}\">${item.field_telephone}</a>`;\r\n councilData.bop.email = item.field_email_address;\r\n }\r\n });\r\n data['district-managers'].data.forEach((item) => {\r\n if (item.field_contact_position.includes('District 5 Manager')) {\r\n councilData.dmanager.name = item.title;\r\n councilData.dmanager.phone = item.field_telephone;\r\n }\r\n if (item.field_contact_position.includes('District 5 Deputy Manager')) {\r\n councilData.ddmanager.name = item.title;\r\n councilData.ddmanager.phone = item.field_telephone;\r\n }\r\n if (item.field_contact_position.includes('District 5 Business Liaison')) {\r\n councilData.bliaision.name = item.title;\r\n councilData.bliaision.email = item.field_email_address;\r\n }\r\n });\r\n data['district-inspectors'].data.forEach((item) => {\r\n if (item.field_responsibilities.includes('District 5')) {\r\n councilData.enforcement.name = item.title;\r\n councilData.enforcement.phone = item.field_telephone;\r\n }\r\n });\r\n break;\r\n\r\n case \"6\":\r\n councilData.council.districtURL = `/taxonomy/term/1491`;\r\n data['council-members'].data.forEach((item) => {\r\n if (item.tid == '1491') {\r\n let cleanPhone = item.field_phone.replace('Office: ', '');\r\n cleanPhone = cleanPhone.replace(/ /g, '-');\r\n cleanPhone = cleanPhone.replace(/[()]/g, '');\r\n councilData.council.name = item.field_organization_head_name;\r\n councilData.council.url = `/taxonomy/term/1491`;\r\n councilData.council.phone = `<a href=\"tel:${cleanPhone}\">${item.field_phone}</a>`;\r\n }\r\n });\r\n data['bop-members'].data.forEach((item) => {\r\n if (item.field_responsibilities.includes('District 6')) {\r\n councilData.bop.name = item.title;\r\n councilData.bop.url = `/taxonomy/term/4321`;\r\n let cleanPhone = item.field_telephone.replace(/ /g, '-');\r\n cleanPhone = cleanPhone.replace(/[()]/g, '');\r\n councilData.bop.phone = `<a href=\"tel:${cleanPhone}\">${item.field_telephone}</a>`;\r\n councilData.bop.email = item.field_email_address;\r\n }\r\n });\r\n data['district-managers'].data.forEach((item) => {\r\n if (item.field_contact_position.includes('District 6 Manager')) {\r\n let cleanPhone = item.field_telephone.replace(/ /g, '-');\r\n cleanPhone = cleanPhone.replace(/[()]/g, '');\r\n councilData.dmanager.name = item.title;\r\n councilData.dmanager.phone = `<a href=\"tel:${cleanPhone}\">${item.field_telephone}</a>`;\r\n }\r\n if (item.field_contact_position.includes('District 6 Deputy Manager')) {\r\n let cleanPhone = item.field_telephone.replace(/ /g, '-');\r\n cleanPhone = cleanPhone.replace(/[()]/g, '');\r\n councilData.ddmanager.name = item.title;\r\n councilData.ddmanager.phone = `<a href=\"tel:${cleanPhone}\">${item.field_telephone}</a>`;\r\n }\r\n if (item.field_contact_position.includes('District 6 Business Liaison')) {\r\n councilData.bliaision.name = item.title;\r\n councilData.bliaision.email = item.field_email_address;\r\n }\r\n });\r\n data['district-inspectors'].data.forEach((item) => {\r\n if (item.field_responsibilities.includes('District 6')) {\r\n let cleanPhone = item.field_telephone.replace(/ /g, '-');\r\n cleanPhone = cleanPhone.replace(/[()]/g, '');\r\n councilData.enforcement.name = item.title;\r\n councilData.enforcement.phone = `<a href=\"tel:${cleanPhone}\">${item.field_telephone}</a>`;\r\n }\r\n });\r\n break;\r\n\r\n case \"7\":\r\n councilData.council.districtURL = `/taxonomy/term/1511`;\r\n data['council-members'].data.forEach((item) => {\r\n if (item.tid == '1511') {\r\n councilData.council.name = item.field_organization_head_name;\r\n councilData.council.url = `/taxonomy/term/1511`;\r\n councilData.council.phone = item.field_phone;\r\n }\r\n });\r\n data['bop-members'].data.forEach((item) => {\r\n if (item.field_responsibilities.includes('District 7')) {\r\n councilData.bop.name = item.title;\r\n councilData.bop.url = `/taxonomy/term/4356`;\r\n let cleanPhone = item.field_telephone.replace(/ /g, '-');\r\n cleanPhone = cleanPhone.replace(/[()]/g, '');\r\n councilData.bop.phone = `<a href=\"tel:${cleanPhone}\">${item.field_telephone}</a>`;\r\n councilData.bop.email = item.field_email_address;\r\n }\r\n });\r\n data['district-managers'].data.forEach((item) => {\r\n if (item.field_contact_position.includes('District 7 Manager')) {\r\n councilData.dmanager.name = item.title;\r\n councilData.dmanager.phone = item.field_telephone;\r\n }\r\n if (item.field_contact_position.includes('District 7 Deputy Manager')) {\r\n councilData.ddmanager.name = item.title;\r\n councilData.ddmanager.phone = item.field_telephone;\r\n }\r\n if (item.field_contact_position.includes('District 7 Business Liaison')) {\r\n councilData.bliaision.name = item.title;\r\n councilData.bliaision.email = item.field_email_address;\r\n }\r\n });\r\n data['district-inspectors'].data.forEach((item) => {\r\n if (item.field_responsibilities.includes('District 7')) {\r\n councilData.enforcement.name = item.title;\r\n councilData.enforcement.phone = item.field_telephone;\r\n }\r\n });\r\n break;\r\n\r\n default:\r\n // console.log('not inside city');\r\n break;\r\n }\r\n return councilData;\r\n }\r\n\r\n sortFeaturesByDistanceTo(target){\r\n return function(a, b) {\r\n var options = {units: 'radians'}; // using radians to forgo conversion to another unit\r\n return turf.distance(target, a, options) - turf.distance(target, b, options);\r\n }\r\n }\r\n\r\n getData(loader) {\r\n const app = document.getElementsByTagName('my-home-info');\r\n const activeDataSets = app[0].getAttribute('data-active-sets').split(',');\r\n const parcelData = JSON.parse(app[0].getAttribute('data-parcel-id'));\r\n const storedData = JSON.parse(app[0].getAttribute('data-api-stored-datasets'));\r\n let dataAlreadyLoaded = false;\r\n for (let key in storedData) {\r\n if (activeDataSets.includes(key)) {\r\n dataAlreadyLoaded = true;\r\n }\r\n }\r\n if (dataAlreadyLoaded) {\r\n let dataSets = {};\r\n activeDataSets.forEach(data => {\r\n dataSets[data] = storedData[data];\r\n });\r\n app[0].setAttribute('data-api-active-datasets', JSON.stringify(dataSets));\r\n app[0].setAttribute('data-app-state', 'results');\r\n } else {\r\n let dataList = loader.getDataSets(loader);\r\n Promise.all(dataList).then(values => {\r\n // console.log(values);\r\n let dataSets = {};\r\n for (let key in values) {\r\n if (values[key] != null) {\r\n dataSets[values[key].id] = values[key];\r\n } else {\r\n initialLoadChecker = false;\r\n }\r\n }\r\n if (activeDataSets.includes('council')) {\r\n let councilData = loader.buildCouncilData(dataSets);\r\n dataSets['council-members'] = { id: 'council-members', data: councilData.council };\r\n dataSets['bop-members'] = { id: 'bop-members', data: councilData.bop };\r\n let dManagers = { manager: councilData.dmanager, deputy: councilData.ddmanager }\r\n dataSets['district-managers'] = { id: 'district-managers', data: dManagers };\r\n dataSets['business-liaison'] = { id: 'business-liaison', data: councilData.bliaision };\r\n dataSets['district-inspectors'] = { id: 'district-inspectors', data: councilData.enforcement };\r\n }\r\n if (activeDataSets.includes('DWSDBackupProtection')) {\r\n try {\r\n if (!dataSets.DWSDBackupProtection) {\r\n dataSets.DWSDBackupProtection = { id: 'DWSDBackupProtection', data: dataSets['neighborhood'].data };\r\n }\r\n } catch (error) {\r\n // console.log(error);\r\n }\r\n }\r\n app[0].setAttribute('data-api-active-datasets', JSON.stringify(dataSets));\r\n app[0].setAttribute('data-app-state', 'results');\r\n }).catch(reason => {\r\n // console.log(reason);\r\n });\r\n }\r\n }\r\n\r\n clearLoader(loader) {\r\n const shadow = loader.shadowRoot;\r\n while (shadow.firstChild) {\r\n shadow.removeChild(shadow.firstChild);\r\n }\r\n }\r\n\r\n loadLoader(loader) {\r\n const shadow = loader.shadowRoot;\r\n const loaderWrapper = document.createElement('section');\r\n loaderWrapper.id = 'loader-wrapper';\r\n switch (loader.getAttribute('data-loader-state')) {\r\n case 'active':\r\n loader.getData(loader);\r\n const textWelcome = document.createElement('p');\r\n textWelcome.innerText = 'Loading DATA';\r\n loaderWrapper.appendChild(textWelcome);\r\n shadow.appendChild(loaderWrapper);\r\n break;\r\n\r\n case 'finished':\r\n const text = document.createElement('p');\r\n text.innerText = 'Data loaded';\r\n loaderWrapper.appendChild(text);\r\n shadow.appendChild(loaderWrapper);\r\n break;\r\n\r\n default:\r\n\r\n break;\r\n }\r\n }\r\n}\r\n","'use strict';\nimport Display from './Display';\nimport DataLoader from './DataLoader';\n// import Map from './Map';\ncustomElements.define('app-display', Display);\ncustomElements.define('app-data-loader', DataLoader);\n// customElements.define('app-map', Map);\n\nexport default class MyHomeInfo extends HTMLElement {\n static get observedAttributes() {\n return ['data-app-state', 'data-parcel-id', 'data-map-state'];\n }\n\n constructor() {\n // Always call super first in constructor\n super();\n\n // Create a shadow root\n const shadow = this.attachShadow({ mode: 'open' });\n\n // Create result section\n const app = document.getElementsByTagName('my-home-info');\n let tempState = app[0].getAttribute('data-app-state');\n\n const appWrapper = document.createElement('section');\n appWrapper.id = 'app-wrapper';\n const display = document.createElement('app-display');\n if(tempState == 'active-screen'){\n display.setAttribute('data-display-type', 'active');\n }else{\n display.setAttribute('data-display-type', 'welcome');\n }\n appWrapper.appendChild(display);\n shadow.appendChild(appWrapper);\n }\n\n attributeChangedCallback(name, oldValue, newValue) {\n const shadow = this.shadowRoot;\n const app = document.getElementsByTagName('my-home-info');\n const appMode = app[0].getAttribute('data-app-mode');\n // console.log(`App - attribute: ${name}, old: ${oldValue}, new: ${newValue}`);\n switch (name) {\n case 'data-app-state':\n if (oldValue != null) {\n this.clearApp(this);\n this.loadApp(this);\n }\n break;\n\n case 'data-parcel-id':\n if (newValue != 'none') {\n this.setAttribute('data-app-state', 'loading-screen');\n } else {\n if(appMode == 'my-home-info'){\n this.setAttribute('data-app-state', 'welcome-screen');\n }\n }\n break;\n \n case 'data-map-state':\n break;\n\n default:\n console.log('not catched');\n break;\n }\n }\n\n clearApp(app) {\n const shadow = app.shadowRoot;\n while (shadow.firstChild) {\n shadow.removeChild(shadow.firstChild);\n }\n }\n\n loadApp(app) {\n const shadow = app.shadowRoot;\n const appWrapper = document.createElement('div');\n appWrapper.id = 'app-wrapper';\n const display = document.createElement('app-display');\n const dataLoader = document.createElement('app-data-loader');\n switch (app.getAttribute('data-app-state')) {\n case 'welcome-screen':\n display.setAttribute('data-display-type', 'welcome');\n appWrapper.appendChild(display);\n break;\n\n case 'active-screen':\n display.setAttribute('data-display-type', 'active');\n appWrapper.appendChild(display);\n break;\n\n case 'loading-screen':\n display.setAttribute('data-display-type', 'loading');\n dataLoader.setAttribute('data-loader-state', 'active');\n appWrapper.appendChild(display);\n break;\n\n case 'results':\n display.setAttribute('data-display-type', 'results');\n appWrapper.appendChild(display);\n break;\n\n case 'map':\n const map = document.createElement('cod-map');\n map.id='cod-map';\n let apiData = JSON.parse(this.getAttribute('data-api-active-datasets'));\n let mapData = this.getAttribute('data-map-active-data');\n const layerData = {\"id\":\"mapData\",\"layers\":[{\"name\":\"data-points\",\"type\":\"circle\",\"radius\":6,\"color\":\"#004445\",\"active\":true,\"sort\":10,\"source\":\"data-points\"}],\"source\": apiData[mapData].data};\n let layerStructure;\n switch (mapData) {\n case 'schools':\n layerStructure = {\"schools\":[{\"type\":\"field-value\",\"label\":\"Name:\",\"value\":\"EntityOfficialName\"}]};\n break;\n\n case 'demos-data':\n layerStructure = {\"demos-data\":[{\"type\":\"field-value\",\"label\":\"Address:\",\"value\":\"address\"}]};\n break;\n\n case 'stabilization-data':\n layerStructure = {\"stabilization-data\":[{\"type\":\"field-value\",\"label\":\"Address:\",\"value\":\"address\"}]};\n break;\n\n case 'improve-det':\n layerStructure = {\"improve-det\":[{\"type\":\"field-value\",\"label\":\"Address:\",\"value\":\"Address\"},{\"type\":\"field-value\",\"label\":\"Type:\",\"value\":\"Request_Type_Title\"}]};\n break;\n \n default:\n break;\n };\n map.setAttribute('data-parent-component', 'my-home-info');\n map.setAttribute('data-map-mode', 'my-home-info');\n map.setAttribute('data-map-active-data', this.getAttribute('data-map-active-data'));\n map.setAttribute('data-popup-structure', JSON.stringify(layerStructure));\n map.setAttribute('data-map-data', JSON.stringify(layerData));\n map.setAttribute('data-location', this.getAttribute('data-parcel-id'));\n map.setAttribute('data-map-state', 'init');\n appWrapper.appendChild(map);\n break;\n\n case 'error':\n display.setAttribute('data-display-type', 'error');\n appWrapper.appendChild(display);\n break;\n\n case 'print':\n display.setAttribute('data-display-type', 'print');\n appWrapper.appendChild(display);\n break;\n\n default:\n break;\n }\n if (shadow.firstChild == null) {\n shadow.appendChild(appWrapper);\n }\n }\n}\n","import MyHomeInfo from './components/MyHomeInfo';\ncustomElements.define('my-home-info', MyHomeInfo);\n\nimport * as Sentry from \"@sentry/browser\";\n\nSentry.init({\n dsn: \"https://536fad340d72a07ee08fe3df749b982e@o4505717305704448.ingest.sentry.io/4505720878792704\",\n\n // Alternatively, use `process.env.npm_package_version` for a dynamic release version\n // if your build tool supports it.\n release: \"local-services-lookup@2.0.9\",\n integrations: [new Sentry.BrowserTracing(), new Sentry.Replay()],\n\n // Set tracesSampleRate to 1.0 to capture 100%\n // of transactions for performance monitoring.\n // We recommend adjusting this value in production\n tracesSampleRate: 1.0,\n\n // Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled\n tracePropagationTargets: [\"localhost\", /^https:\\/\\/detroitmi\\.gov/],\n\n // Capture Replay for 10% of all sessions,\n // plus for 100% of sessions with an error\n replaysSessionSampleRate: 0.1,\n replaysOnErrorSampleRate: 1.0,\n});"],"names":["Geocoder","HTMLElement","observedAttributes","constructor","super","this","form","parcelStatus","user","styles","document","createElement","textContent","shadow","attachShadow","mode","appendChild","geocoderWraper","id","label","style","fontFamily","fontWeight","input","list","icon","addEventListener","ev","submit","className","app","getElementsByTagName","innerText","getAttribute","error","setAttribute","type","placeholder","inputChange","supplementGeocoder","address","geocoder","tempAddr","split","newTempAddr","size","length","forEach","item","index","url","fetch","then","resp","json","data","candidates","sugg","attributes","parcel_id","value","onclick","selectSuggestion","childNodes","location","x","y","city","features","parcel","checkParcelValid","needGeocode","clearSuggestions","JSON","stringify","selection","target","tagName","parentNode","key","undefined","firstChild","removeChild","cleanAddress","params","geometry","request","Request","access_token","encodeURIComponent","method","body","headers","Headers","cache","res","test","preventDefault","NavigationTools","navToolsStyle","loadNavTools","clearDisplay","display","shadowRoot","navTools","appStatus","appMode","initialSets","initalMapStatus","navToolsWrapper","clearResultsBtn","propertyDataBtn","storedData","parse","activeData","govDataBtn","zoneDataBtn","nearDataBtn","printBtn","customElements","define","Display","neighborhoodImage","src","welcomeStyle","resultsStyle","loadDisplay","attributeChangedCallback","name","oldValue","newValue","formatDate","tempDate","Date","getMonth","getDate","getFullYear","buildCouncil","siteURL","window","hostname","dataParsing","title","content","district","phone","buildBOP","email","buildDistrictManagers","Object","keys","detail","manager","deputy","buildBusinessLiaison","buildInspector","buildNeighborhood","neighborhood_name","buildDWSDBackupProtection","values","validNeighborhoods","includes","Postal","buildHRDFlooding","console","log","buildHistoricDistrict","Name","Year_Enacted","format","buildNEZ","nez","RNNAME","RID","buildNRSA","buildNPO","precinct","precinct_location","officer_name","npo_cell_phone","npo_email","checkRecyclingStatus","next_pickups","yardStart","yardEnd","details","service","normalDay","newDay","moment","next_pickup","isBetween","buildRecycling","contractorInfo","trash","contractor","recycling","bulk","tempHTML","buildAssessors","property","year","floor","buildingClass","ownerstreetaddr","ownercity","ownerstate","ownerzip","resb_bldgclass","cib_yearbuilt","cib_value","resb_yearbuilt","resb_value","resb_floorarea","pnum","toLocaleString","buildRental","apiDataSets","date_status","issued_date","buildFireEscrow","buildBlight","ticket_number","fine_amount","agency_name","disposition","violation_description","hearing_date","hearing_time","buildSchools","properties","EntityOfficialName","EntityActualGrades","EntityTypeName","EntityPhysicalStreet","buildPermit","record_id","permit_type","status","description_of_work","buildDemoStatus","tempAddress","replace","demolish_by_date","buildDemosNear","commercial_building","parseInt","price","contractor_name","council_district","neighborhood","buildStabilizationsNear","rehab_status","buildImproveDet","Web_Url","ID","Request_Type_Title","Status","Created_At","selectDataBlockType","setDatasetPagination","dataset","hasAttribute","paginations","paginationObj","start","end","more","printInfo","divContents","buildDataSection","a","open","write","children","innerHTML","close","print","buildDataBlock","dataSet","mapAvailable","dataBlock","pagination","splitDataset","slice","datasetValues","dataBlockTitle","dataBlockContent","text","mapButton","loadMoreBtn","loadMoreSpinner","parentElement","remove","results","sectionTitle","toUpperCase","dataBlocks","hasOwnProperty","call","displayWrapper","imageWrapper","textWrapperWelcome","titleWelcome","textWelcome","loader","parcelData","resultsContainer","dataSetResults","addressBox","errorContainer","errorBox","printParcelData","printResultsContainer","printDataSetResults","printAddressBox","printResults","turf","require","arcGIS","DataLoader","loaderWrapper","clearLoader","loadLoader","getDataSets","dataSets","dataList","assessorsData","Promise","resolve","reject","catch","err","neighborhoods","council","bopMembers","districtManagers","districtInspectors","councilMembers","HRDFlooding","nrsa","nezHomestead","permitData","rentalData","rentalCertData","blightData","salesHistoryData","demosData","point","buffer","units","simplePolygon","simplify","tolerance","highQuality","arcsimplePolygon","convert","encodeURI","sort","sortFeaturesByDistanceTo","stabilizationData","demoStatus","schools","npo","improveDet","today","todaysMonth","todaysYear","FID","historicDistrict","fireEscrow","f","push","buildCouncilData","councilData","districtURL","bop","dmanager","ddmanager","bliaision","enforcement","toString","tid","field_organization_head_name","field_phone","field_responsibilities","cleanPhone","field_telephone","field_email_address","field_contact_position","b","options","distance","getData","activeDataSets","dataAlreadyLoaded","all","initialLoadChecker","dManagers","DWSDBackupProtection","reason","MyHomeInfo","tempState","appWrapper","clearApp","loadApp","dataLoader","map","apiData","mapData","layerData","layerStructure","Sentry","dsn","release","integrations","tracesSampleRate","tracePropagationTargets","replaysSessionSampleRate","replaysOnErrorSampleRate"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"assets/js/main.js","mappings":"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","sources":["webpack://local-services-lookup/./src/components/Geocoder.js","webpack://local-services-lookup/./src/components/NavigationTools.js","webpack://local-services-lookup/./src/components/Display.js","webpack://local-services-lookup/./src/components/DataLoader.js","webpack://local-services-lookup/./src/components/MyHomeInfo.js","webpack://local-services-lookup/./src/index.js"],"sourcesContent":["'use strict';\nexport default class Geocoder extends HTMLElement {\n\n static get observedAttributes() {\n return ['form', 'parcelStatus', 'user'];\n }\n\n constructor() {\n // Always call super first in constructor\n super();\n\n // Set Attributes\n this.form = null;\n this.parcelStatus = 'Invalid';\n this.user = null;\n this.styles = document.createElement('style');\n this.styles.textContent = `\n @import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@100;700&display=swap')\n #geocoder {width: 100%}\n input {width: calc(100% - 2em); padding: 1em; border:.1em solid #e6e6e6; font-size: 1em;}\n `;\n\n // Create a shadow root\n const shadow = this.attachShadow({ mode: 'open' });\n\n // Create geocoder section\n shadow.appendChild(this.styles);\n const geocoderWraper = document.createElement('article');\n geocoderWraper.id = 'geocoder';\n let form = document.createElement('form');\n let label = document.createElement('label');\n label.style.fontFamily = 'Montserrat, sans-serif';\n label.style.fontWeight = 'bold';\n let input = document.createElement('input');\n let suggestions = document.createElement('ul');\n let list = document.createElement('datalist');\n let icon = document.createElement('i');\n form.addEventListener('submit', (ev) => {\n this.submit(ev, this);\n });\n icon.className = 'fas fa-map-marker-alt';\n // Get label text\n const app = document.getElementsByTagName('my-home-info');\n label.innerText = \"Property Address:\";\n try {\n if (app[0].getAttribute('data-geocoder-label')){\n if(app[0].getAttribute('data-geocoder-label') != ''){\n label.innerText = app[0].getAttribute('data-geocoder-label');\n }\n }\n } catch (error) {\n \n }\n label.setAttribute(\"for\", \"geocoder-input\");\n input.type = 'text';\n input.setAttribute('list', 'addresses-list');\n input.placeholder = 'Enter address';\n input.setAttribute('id', 'geocoder-input');\n input.setAttribute('autocomplete', 'off');\n input.addEventListener('keyup', (ev) => {\n this.inputChange(ev, this);\n });\n list.setAttribute('id', 'addresses-list');\n\n\n form.appendChild(label);\n form.appendChild(input);\n form.appendChild(icon);\n // form.appendChild(suggestions);\n form.appendChild(list);\n this.form = form;\n geocoderWraper.appendChild(form);\n shadow.appendChild(geocoderWraper);\n }\n\n supplementGeocoder(address, geocoder, type) {\n const app = document.getElementsByTagName('my-home-info');\n let tempAddr = address.split(\",\");\n tempAddr = tempAddr[0];\n tempAddr = tempAddr.split(\" \");\n let newTempAddr = '';\n let size = tempAddr.length;\n tempAddr.forEach(function (item, index) {\n newTempAddr += item;\n ((index < size) && (index + 1) !== size) ? newTempAddr += '+' : 0;\n });\n let url = `https://opengis.detroitmi.gov/opengis/rest/services/BaseUnits/BaseUnitGeocoder/GeocodeServer/findAddressCandidates?Address=&Address2=&Address3=&Neighborhood=&City=&Subregion=&Region=&Postal=&PostalExt=&CountryCode=&SingleLine=${newTempAddr}&outFields=*&maxLocations=&matchOutOfRange=true&langCode=&locationType=&sourceCountry=&category=&location=&distance=&searchExtent=&outSR=&magicKey=&f=json`;\n\n try {\n fetch(url)\n .then((resp) => resp.json()) // Transform the data into json\n .then(function (data) {\n // console.log(data);\n if (type === 'suggestions') {\n data.candidates.forEach((item) => {\n let sugg = document.createElement('option');\n if (item.attributes.parcel_id === '') {\n sugg.value = item.address;\n sugg.setAttribute('data-parsel', 'no-parcel');\n } else {\n sugg.value = `${item.address} RECOMMENDED`;\n sugg.setAttribute('data-parsel', item.attributes.parcel_id);\n }\n\n sugg.onclick = (ev) => {\n geocoder.selectSuggestion(ev, geocoder);\n }\n geocoder.form.childNodes[3].appendChild(sugg);\n });\n } else {\n if (data.candidates.length) {\n let url = `https://services2.arcgis.com/qvkbeam7Wirps6zC/arcgis/rest/services/City_of_Detroit_Boundary/FeatureServer/0/query?where=&objectIds=&time=&geometry=${data.candidates[0].location.x}%2C+${data.candidates[0].location.y}&geometryType=esriGeometryPoint&inSR=4326&spatialRel=esriSpatialRelIntersects&resultType=none&distance=0.0&units=esriSRUnit_Meter&returnGeodetic=false&outFields=4326&returnGeometry=true&returnCentroid=false&multipatchOption=xyFootprint&maxAllowableOffset=&geometryPrecision=&outSR=&datumTransformation=&applyVCSProjection=false&returnIdsOnly=false&returnUniqueIdsOnly=false&returnCountOnly=false&returnExtentOnly=false&returnDistinctValues=false&orderByFields=&groupByFieldsForStatistics=&outStatistics=&having=&resultOffset=&resultRecordCount=&returnZ=false&returnM=false&returnExceededLimitFeatures=true&quantizationParameters=&sqlFormat=none&f=geojson&token=`;\n try {\n fetch(url)\n .then((resp) => resp.json()) // Transform the data into json\n .then(function (city) {\n if (city.features.length) {\n let parcel = null;\n let location;\n data.candidates.forEach((item) => {\n if (item.attributes.parcel_id !== '') {\n if (geocoder.checkParcelValid(item.attributes.parcel_id)) {\n parcel = item;\n }\n }\n });\n (parcel == null) ? location = data.candidates[0].location : location = null;\n if (parcel === null) {\n geocoder.parcelStatus = 'Invalid';\n geocoder.needGeocode(address, geocoder, location);\n geocoder.clearSuggestions(geocoder);\n app[0].setAttribute('data-parcel-id', JSON.stringify(data.candidates[0]));\n // geocoder.controller.panel.loaderToggle(true);\n // geocoder.controller.panel.clearPanel();\n // geocoder.controller.dataManager.buildData(data.candidates[0], geocoder.controller);\n } else {\n geocoder.parcelStatus = 'Valid';\n geocoder.needGeocode(address, geocoder, location);\n geocoder.clearSuggestions(geocoder);\n app[0].setAttribute('data-parcel-id', JSON.stringify(parcel));\n // geocoder.controller.panel.loaderToggle(true);\n // geocoder.controller.panel.clearPanel();\n // geocoder.controller.dataManager.buildData(parcel, geocoder.controller);\n }\n } else {\n geocoder.parcelStatus = 'Invalid';\n geocoder.needGeocode(address, geocoder, location);\n geocoder.clearSuggestions(geocoder);\n app[0].setAttribute('data-app-state', 'error');\n }\n });\n } catch (error) {\n geocoder.parcelStatus = 'Invalid';\n geocoder.needGeocode(address, geocoder, location);\n geocoder.clearSuggestions(geocoder);\n app[0].setAttribute('data-app-state', 'error');\n }\n } else {\n geocoder.parcelStatus = 'Invalid';\n geocoder.needGeocode(address, geocoder, location);\n geocoder.clearSuggestions(geocoder);\n app[0].setAttribute('data-app-state', 'error');\n }\n }\n });\n } catch (error) {\n geocoder.parcelStatus = 'Invalid';\n geocoder.needGeocode(address, geocoder, location);\n geocoder.clearSuggestions(geocoder);\n app[0].setAttribute('data-app-state', 'error');\n }\n }\n\n selectSuggestion(ev, geocoder) {\n let selection = null;\n if (ev.target.tagName === 'SPAN') {\n selection = ev.target.parentNode;\n } else {\n selection = ev.target;\n }\n if (selection.attributes[0].value === 'no-parcel') {\n geocoder.clearSuggestions(geocoder);\n geocoder.supplementGeocoder(selection.innerText, geocoder, 'submit');\n } else {\n geocoder.supplementGeocoder(selection.innerText, geocoder, 'submit');\n }\n }\n\n inputChange(ev, geocoder) {\n switch (ev.key) {\n case 'Enter':\n (ev.target.value != '' && ev.target.value != undefined) ? geocoder.supplementGeocoder(ev.target.value, geocoder, 'submit') : 0;\n break;\n\n case 'ArrowDown':\n\n break;\n\n case 'ArrowUp':\n\n break;\n\n case 'ArrowRight':\n\n break;\n\n case 'ArrowLeft':\n\n break;\n\n case undefined:\n (ev.target.value != '' && ev.target.value != undefined) ? geocoder.supplementGeocoder(ev.target.value, geocoder, 'submit') : 0;\n break;\n\n default:\n geocoder.clearSuggestions(geocoder);\n geocoder.supplementGeocoder(ev.target.value, geocoder, 'suggestions');\n break;\n }\n }\n\n clearSuggestions(geocoder) {\n while (geocoder.form.childNodes[3].firstChild) {\n geocoder.form.childNodes[3].removeChild(geocoder.form.childNodes[3].firstChild);\n }\n }\n\n needGeocode(address, geocoder, location) {\n fetch('https://us-central1-local-services-loopkup.cloudfunctions.net/getToken')\n .then((resp) => resp.json()) // Transform the data into json\n .then(function (data) {\n let cleanAddress = address.split(' RECOMMENDED')[0];\n let params = [\n {\n \"attributes\": {\n \"valid_parcel_status\": geocoder.parcelStatus,\n \"user_input\": cleanAddress\n },\n \"geometry\": {\n \"x\": 0,\n \"y\": 0\n }\n }\n ];\n if (location != null) {\n params[0].geometry.x = location.x;\n params[0].geometry.y = location.y;\n }\n let request = new Request(`https://services2.arcgis.com/qvkbeam7Wirps6zC/ArcGIS/rest/services/addressvalidator/FeatureServer/0/addFeatures?token=${data.access_token}&features=${encodeURIComponent(JSON.stringify(params))}&f=json`, {\n method: 'POST',\n body: '',\n headers: new Headers(),\n mode: 'cors',\n cache: 'default'\n });\n fetch(request)\n .then((res) => {\n // console.log(res);\n });\n });\n }\n\n checkParcelValid(parcel){\n return /\\d/.test(parcel);\n }\n\n submit(ev, geocoder) {\n ev.preventDefault();\n geocoder.supplementGeocoder(ev.target['0'].value, geocoder, 'submit');\n }\n}","export default class NavigationTools extends HTMLElement {\n\n constructor() {\n // Always call super first in constructor\n super();\n\n // Create a shadow root\n const shadow = this.attachShadow({ mode: 'open' });\n\n // Creating display styles\n this.navToolsStyle = document.createElement('style');\n this.navToolsStyle.textContent = `\n #nav-tools-wrapper { display: flex; flex-direction: column;}\n button.clear { font-size: 1.25em; width: 2.5em; height: 2.5em; background-color: #FEB70D; cursor: pointer; border: none; }\n button.nav { width: 3.75em; height: 3.75em; border: none; cursor: pointer;background: #fff; }\n button.nav:hover { background-color: #e6e6e6; transition: all 500ms cubic-bezier(.64,.09,.08,1); }\n button.nav.active { background-color: #9fd5b3; }\n button.nav img { width: 100%; }\n `;\n\n // Start loading display content\n this.loadNavTools(this);\n }\n\n clearDisplay(display) {\n const shadow = display.shadowRoot;\n while (shadow.firstChild) {\n shadow.removeChild(shadow.firstChild);\n }\n }\n\n loadNavTools(navTools) {\n const app = document.getElementsByTagName('my-home-info');\n const appStatus = app[0].getAttribute('data-app-state');\n const appMode = app[0].getAttribute('data-app-mode');\n const initialSets = app[0].getAttribute('data-inital-sets');\n const initalMapStatus = app[0].getAttribute('data-initial-map-available');\n const shadow = navTools.shadowRoot;\n shadow.appendChild(navTools.navToolsStyle);\n const navToolsWrapper = document.createElement('section');\n navToolsWrapper.id = 'nav-tools-wrapper';\n navToolsWrapper.setAttribute('role', 'navigation');\n navToolsWrapper.setAttribute('aria-label', 'Data Navigation');\n const clearResultsBtn = document.createElement('cod-button');\n clearResultsBtn.addEventListener('click', (ev) => {\n if (app[0].getAttribute('data-app-mode') == 'my-home-info') {\n app[0].setAttribute('data-app-state', 'welcome-screen');\n app[0].setAttribute('data-active-sets', 'assessors-data,neighborhood,recycling,rental-data,rental-cert,demo-status,blight-data,permit-data,DWSDBackupProtection');\n } else {\n app[0].setAttribute('data-app-state', 'active-screen');\n app[0].setAttribute('data-active-sets', initialSets);\n }\n if(initalMapStatus == 'true'){\n app[0].setAttribute('data-map-available', 'true');\n }else{\n app[0].setAttribute('data-map-available', 'false');\n }\n app[0].setAttribute('data-parcel-id', 'none');\n app[0].setAttribute('data-api-stored-datasets', '{}');\n app[0].setAttribute('data-api-active-datasets', 'none');\n app[0].setAttribute('data-active-section', 'property');\n });\n clearResultsBtn.setAttribute('data-primary', true);\n clearResultsBtn.setAttribute('data-label', 'x');\n clearResultsBtn.setAttribute('data-size', 'lg');\n clearResultsBtn.setAttribute('data-hover', false);\n clearResultsBtn.setAttribute('data-extra-classes', 'fw-bold');\n clearResultsBtn.setAttribute('data-background-color', 'warning');\n clearResultsBtn.setAttribute('data-img', '');\n clearResultsBtn.setAttribute('data-img-alt', '');\n clearResultsBtn.setAttribute('data-shape', 'square');\n clearResultsBtn.setAttribute('data-icon', '');\n navToolsWrapper.appendChild(clearResultsBtn);\n\n if (appMode == 'my-home-info' && appStatus != 'error') {\n const propertyDataBtn = document.createElement('cod-button');\n propertyDataBtn.setAttribute('data-label', '');\n propertyDataBtn.setAttribute('data-size', 'lg');\n propertyDataBtn.setAttribute('data-img', 'https://detroitmi.gov/sites/detroitmi.localhost/files/2023-01/home.png');\n propertyDataBtn.setAttribute('data-img-alt', 'about this property');\n propertyDataBtn.setAttribute('data-shape', 'square');\n propertyDataBtn.setAttribute('data-nav-value', 'about this property');\n propertyDataBtn.setAttribute('data-icon', '');\n if (app[0].getAttribute('data-active-section') == 'about this property') {\n propertyDataBtn.setAttribute('data-background-color', 'success');\n propertyDataBtn.setAttribute('data-primary', true);\n } else {\n propertyDataBtn.setAttribute('data-background-color', 'secondary');\n propertyDataBtn.setAttribute('data-primary', false);\n propertyDataBtn.addEventListener('click', (ev) => {\n if (app[0].getAttribute('data-api-active-datasets') != 'none') {\n let storedData = JSON.parse(app[0].getAttribute('data-api-stored-datasets'));\n let activeData = JSON.parse(app[0].getAttribute('data-api-active-datasets'));\n for (const key in activeData) {\n if (!(key in storedData)) {\n storedData[key] = activeData[key];\n }\n }\n app[0].setAttribute('data-api-stored-datasets', JSON.stringify(storedData));\n }\n app[0].setAttribute('data-api-active-datasets', 'none');\n app[0].setAttribute('data-active-sets', 'assessors-data,neighborhood,recycling,rental-data,rental-cert,demo-status,blight-data,permit-data,DWSDBackupProtection');\n app[0].setAttribute('data-map-available', 'false');\n app[0].setAttribute('data-active-section', 'about this property');\n app[0].setAttribute('data-app-state', 'loading-screen');\n })\n }\n navToolsWrapper.appendChild(propertyDataBtn);\n\n const govDataBtn = document.createElement('cod-button');\n govDataBtn.setAttribute('data-label', '');\n govDataBtn.setAttribute('data-size', 'lg');\n govDataBtn.setAttribute('data-img', 'https://detroitmi.gov/sites/detroitmi.localhost/files/2023-01/government.png');\n govDataBtn.setAttribute('data-img-alt', 'government officials');\n govDataBtn.setAttribute('data-shape', 'square');\n govDataBtn.setAttribute('data-nav-value', 'government officials');\n govDataBtn.setAttribute('data-icon', '');\n if (app[0].getAttribute('data-active-section') == 'government officials') {\n govDataBtn.setAttribute('data-background-color', 'success');\n govDataBtn.setAttribute('data-primary', true);\n } else {\n govDataBtn.setAttribute('data-background-color', 'secondary');\n govDataBtn.setAttribute('data-primary', false);\n govDataBtn.addEventListener('click', (ev) => {\n if (app[0].getAttribute('data-api-active-datasets') != 'none') {\n let storedData = JSON.parse(app[0].getAttribute('data-api-stored-datasets'));\n let activeData = JSON.parse(app[0].getAttribute('data-api-active-datasets'));\n for (const key in activeData) {\n if (!(key in storedData)) {\n storedData[key] = activeData[key];\n }\n }\n app[0].setAttribute('data-api-stored-datasets', JSON.stringify(storedData));\n }\n app[0].setAttribute('data-api-active-datasets', 'none');\n app[0].setAttribute('data-active-sets', 'council,council-members,bop-members,district-managers,business-liaison,district-inspectors,npo');\n app[0].setAttribute('data-map-available', 'false');\n app[0].setAttribute('data-active-section', 'government officials');\n app[0].setAttribute('data-app-state', 'loading-screen');\n });\n }\n navToolsWrapper.appendChild(govDataBtn);\n\n const zoneDataBtn = document.createElement('cod-button');\n zoneDataBtn.setAttribute('data-label', '');\n zoneDataBtn.setAttribute('data-size', 'lg');\n zoneDataBtn.setAttribute('data-img', 'https://detroitmi.gov/sites/detroitmi.localhost/files/2023-01/zone.png');\n zoneDataBtn.setAttribute('data-img-alt', 'special areas and zones');\n zoneDataBtn.setAttribute('data-shape', 'square');\n zoneDataBtn.setAttribute('data-nav-value', 'special areas and zones');\n zoneDataBtn.setAttribute('data-icon', '');\n if (app[0].getAttribute('data-active-section') == 'special areas and zones') {\n zoneDataBtn.setAttribute('data-background-color', 'success');\n zoneDataBtn.setAttribute('data-primary', true);\n } else {\n zoneDataBtn.setAttribute('data-background-color', 'secondary');\n zoneDataBtn.setAttribute('data-primary', false);\n zoneDataBtn.addEventListener('click', (ev) => {\n if (app[0].getAttribute('data-api-active-datasets') != 'none') {\n let storedData = JSON.parse(app[0].getAttribute('data-api-stored-datasets'));\n let activeData = JSON.parse(app[0].getAttribute('data-api-active-datasets'));\n for (const key in activeData) {\n if (!(key in storedData)) {\n storedData[key] = activeData[key];\n }\n }\n app[0].setAttribute('data-api-stored-datasets', JSON.stringify(storedData));\n }\n app[0].setAttribute('data-api-active-datasets', 'none');\n app[0].setAttribute('data-active-sets', 'nez,nrsa,historicDistrict');\n app[0].setAttribute('data-map-available', 'false');\n app[0].setAttribute('data-active-section', 'special areas and zones');\n app[0].setAttribute('data-app-state', 'loading-screen');\n });\n }\n navToolsWrapper.appendChild(zoneDataBtn);\n\n const nearDataBtn = document.createElement('cod-button');\n nearDataBtn.setAttribute('data-label', '');\n nearDataBtn.setAttribute('data-size', 'lg');\n nearDataBtn.setAttribute('data-img', 'https://detroitmi.gov/sites/detroitmi.localhost/files/2023-01/nearby.png');\n nearDataBtn.setAttribute('data-img-alt', 'things nearby');\n nearDataBtn.setAttribute('data-shape', 'square');\n nearDataBtn.setAttribute('data-nav-value', 'things nearby');\n nearDataBtn.setAttribute('data-icon', '');\n if (app[0].getAttribute('data-active-section') == 'things nearby') {\n nearDataBtn.setAttribute('data-background-color', 'success');\n nearDataBtn.setAttribute('data-primary', true);\n } else {\n nearDataBtn.setAttribute('data-background-color', 'secondary');\n nearDataBtn.setAttribute('data-primary', false);\n nearDataBtn.addEventListener('click', (ev) => {\n if (app[0].getAttribute('data-api-active-datasets') != 'none') {\n let storedData = JSON.parse(app[0].getAttribute('data-api-stored-datasets'));\n let activeData = JSON.parse(app[0].getAttribute('data-api-active-datasets'));\n for (const key in activeData) {\n if (!(key in storedData)) {\n storedData[key] = activeData[key];\n }\n }\n app[0].setAttribute('data-api-stored-datasets', JSON.stringify(storedData));\n }\n app[0].setAttribute('data-api-active-datasets', 'none');\n app[0].setAttribute('data-active-sets', 'schools,demos-data,stabilization-data,improve-det');\n app[0].setAttribute('data-active-section', 'things nearby');\n app[0].setAttribute('data-map-available', 'true');\n app[0].setAttribute('data-app-state', 'loading-screen');\n });\n }\n navToolsWrapper.appendChild(nearDataBtn);\n\n const printBtn = document.createElement('cod-button');\n printBtn.setAttribute('data-label', '');\n printBtn.setAttribute('data-size', 'lg');\n printBtn.setAttribute('data-img', 'https://detroitmi.gov/sites/detroitmi.localhost/files/2023-01/print.png');\n printBtn.setAttribute('data-img-alt', 'print');\n printBtn.setAttribute('data-shape', 'square');\n printBtn.setAttribute('data-nav-value', 'print');\n printBtn.setAttribute('data-icon', '');\n if (app[0].getAttribute('data-active-section') == 'print') {\n printBtn.setAttribute('data-background-color', 'success');\n printBtn.setAttribute('data-primary', true);\n } else {\n printBtn.setAttribute('data-background-color', 'secondary');\n printBtn.setAttribute('data-primary', false);\n printBtn.addEventListener('click', (ev) => {\n if(ev.target.getAttribute('data-nav-value')){\n app[0].setAttribute('data-app-state', 'print');\n }\n });\n }\n navToolsWrapper.appendChild(printBtn);\n }\n\n shadow.appendChild(navToolsWrapper);\n }\n\n}\n","'use strict';\nimport Geocoder from './Geocoder';\nimport NavigationTools from './NavigationTools';\ncustomElements.define('app-geocoder', Geocoder);\ncustomElements.define('app-nav-tools', NavigationTools);\nexport default class Display extends HTMLElement {\n static get observedAttributes() {\n return ['data-display-type', 'data-pagination'];\n }\n\n constructor() {\n // Always call super first in constructor\n super();\n\n // Create a shadow root\n const shadow = this.attachShadow({ mode: 'open' });\n\n // Creating images\n this.neighborhoodImage = document.createElement('img');\n this.neighborhoodImage.src = 'https://detroitmi.gov/sites/detroitmi.localhost/files/2023-01/neighborhood.png'; //neighborhoodImage;\n this.neighborhoodImage.setAttribute('alt', '');\n\n // Creating display styles\n this.welcomeStyle = document.createElement('style');\n this.welcomeStyle.textContent = `\n @import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@100;700&display=swap')\n #display-wrapper { display: flex; padding: 1em; flex-wrap: wrap; font-family: 'Montserrat', sans-serif;}\n #display-wrapper #welcome-img-wrapper { display: flex; }\n #display-wrapper #welcome-img-wrapper img { height: 10em; margin: auto }\n #display-wrapper p { text-align: center; font-family: 'Montserrat', sans-serif;}\n #display-wrapper button { padding: 1em 3em; background-color: #004445; color: #fff; border: none; cursor: pointer; margin: auto; width: 100%;}\n p.display-title { font-weight: bold; font-size: 1.25em; }\n app-geocoder { width: 100%}\n .btn-group { display:flex; width: 100%; }\n @media all and (min-width: 551px) {\n #display-wrapper{ display: flex; }\n #display-wrapper #welcome-img-wrapper img { width: 15em; height: auto; }\n #display-wrapper article { flex: 1; padding: 1em; }\n }\n `;\n\n this.resultsStyle = document.createElement('style');\n this.resultsStyle.textContent = `\n .results-container{ display: flex; }\n #data-results { background-color: #e6e6e6; padding: 1em; height: 40em; overflow-y: auto; }\n .data-title { font-weight: bold; border-left: solid .2em #FEB70D; padding: .5em; margin: 0 0 1em 0; font-family: 'Montserrat', sans-serif;}\n .result-address {background-color: #fff; border: solid 0.1em #e6e6e6; padding: 1.04em 0.6em; font-family: 'Montserrat', sans-serif;}\n .data-block-title { padding: .5em; background-color: #FEB70D; margin: 0; font-weight: bold; font-family: 'Montserrat', sans-serif; display: flex;}\n .data-block-title span { flex: 1; margin: auto; }\n .data-block-content { padding: .5em; margin-bottom: .5em; background-color: #fff; }\n .data-block-content p { margin: 0; font-family: 'Montserrat', sans-serif;}\n .data-block-content hr { border-top: 1px dotted;}\n .dataset-results {flex: 1;}\n .critical-text { color: #CF3234; }\n .error-result { padding: 1em; }\n .data-block-title button { background-color: #fff; border: none; padding: 0.25em 0.5em; box-shadow: 1px 1px 3px 0px rgb(0 0 0 / 75%);}\n .data-block-title button img { height: 1em; }\n @media all and (min-width: 551px) {\n #data-results { height: auto; }\n #data-blocks { column-count: 2; }\n #data-blocks .data-block { -webkit-column-break-inside: avoid; page-break-inside: avoid; break-inside: avoid; }\n }\n\n @media all and (min-width: 1024px) {\n #data-results { height: auto; }\n #data-blocks { column-count: 3; }\n #data-blocks .data-block { -webkit-column-break-inside: avoid; page-break-inside: avoid; break-inside: avoid; }\n }\n `;\n\n // Start loading display content\n this.loadDisplay(this);\n }\n\n attributeChangedCallback(name, oldValue, newValue) {\n // console.log(`Display - attribute: ${name}, old: ${oldValue}, new: ${newValue}`);\n if (newValue == 'results') {\n this.clearDisplay(this);\n }\n if (name == 'data-pagination'){\n this.clearDisplay(this);\n }\n this.loadDisplay(this);\n }\n\n clearDisplay(display) {\n const shadow = display.shadowRoot;\n while (shadow.firstChild) {\n shadow.removeChild(shadow.firstChild);\n }\n }\n\n formatDate(value) {\n const month = [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"];\n const tempDate = new Date(value);\n return `${month[tempDate.getMonth()]} ${tempDate.getDate()}, ${tempDate.getFullYear()}`;\n }\n\n buildCouncil(value) {\n let siteURL = window.location.hostname;\n let dataParsing = { title: \"Council District\", content: null };\n dataParsing.content = `\n <p><strong>District Number:</strong> ${value.data.district}</p>\n <p><strong>Council Member:</strong> <a href=\"http://${siteURL}${value.data.url}\" target=\"_blank\">${value.data.name}</a></p>\n <p><strong>Council Member Phone:</strong> ${value.data.phone}</p>\n `;\n return dataParsing;\n }\n\n buildBOP(value) {\n let siteURL = window.location.hostname;\n let dataParsing = { title: \"Police Commissioner\", content: null };\n dataParsing.content = `\n <p><strong>Commissioner:</strong> <a href=\"http://${siteURL}${value.data.url}\" target=\"_blank\">${value.data.name}</a></p>\n <p><strong>Commissioner's Phone:</strong> ${value.data.phone}</p>\n <p><strong>Commissioner's Email:</strong> ${value.data.email}</p>\n `;\n return dataParsing;\n }\n\n buildDistrictManagers(value) {\n let dataParsing = { title: \"District Managers\", content: null };\n if (value && Object.keys(value.data).length != 0 && value.data.constructor === Object && value.data.detail !== \"Not found.\") {\n dataParsing.content = `\n <p><strong>District Manager:</strong> <a href=\"${value.data.manager.url}\" target=\"_blank\">${value.data.manager.name}</a></p>\n <p><strong>Manager Phone:</strong> ${value.data.manager.phone}</p>\n <p><strong>Deputy Manager:</strong> <a href=\"${value.data.deputy.url}\" target=\"_blank\">${value.data.deputy.name}</a></p>\n <p><strong>Deputy Manager Phone:</strong> ${value.data.deputy.phone}</p>\n `;\n } else {\n dataParsing.content = `\n <p>No data found</p>\n `;\n }\n return dataParsing;\n }\n\n buildBusinessLiaison(value) {\n let dataParsing = { title: \"Business Liaison\", content: null };\n if (value && Object.keys(value.data).length != 0 && value.data.constructor === Object && value.data.detail !== \"Not found.\") {\n dataParsing.content = `\n <p><strong>Liaison:</strong> ${value.data.name}</p>\n <p><strong>Liaison Phone:</strong> ${value.data.email}</p>\n `;\n } else {\n dataParsing.content = `\n <p>No data found</p>\n `;\n }\n return dataParsing;\n }\n\n buildInspector(value) {\n let dataParsing = { title: \"Enforcement Inspector\", content: null };\n if (value && Object.keys(value.data).length != 0 && value.data.constructor === Object && value.data.detail !== \"Not found.\") {\n dataParsing.content = `\n <p><strong>Inspector:</strong> ${value.data.name}</p>\n <p><strong>Inspector Phone:</strong> ${value.data.phone}</p>\n `;\n } else {\n dataParsing.content = `\n <p>No data found</p>\n `;\n }\n return dataParsing;\n }\n\n buildNeighborhood(value) {\n let dataParsing = { title: \"Neighborhood\", content: null };\n if (value && Object.keys(value.data).length != 0 && value.data.constructor === Object && value.data.detail !== \"Not found.\") {\n dataParsing.content = `\n <p><strong>Neighborhood name:</strong> ${value.data.attributes.neighborhood_name}</p>\n `;\n } else {\n dataParsing.content = `\n <p>No neighborhood found</p>\n `;\n }\n return dataParsing;\n }\n\n buildDWSDBackupProtection(values) {\n let validNeighborhoods = ['Aviation Sub', 'Barton-McFarland', 'Chadsey Condon', 'Cornerstone Village', 'East English Village', 'Morningside', 'Jefferson Chalmers', 'Warrendale', 'Victoria Park', 'Moross-Morang', 'Garden View'];\n let dataParsing = { title: \"DWSD Basement Backup Protection Program\", content: null };\n if (values && values.data.attributes.neighborhood_name) {\n if (validNeighborhoods.includes(values.data.attributes.neighborhood_name)) {\n dataParsing.content = `\n <p>This property qualifies for the DWSD Basement Backup Protection Program.</p>\n <br>\n <a href=\"https://app.smartsheet.com/b/form/509cb1e905a74948bce7b0135da53277?Property%20Street%20Address=${values.data.address}&Property%20City=Detroit&Property%20Zip%20Code=${values.data.attributes.Postal}&Neighborhood=${values.data.attributes.neighborhood_name}\" target=\"_blank\"><cod-button data-label=\"Apply Now\" data-background-color=\"primary\" data-size=\"xsmall\" data-icon=\"\" data-primary=\"true\" data-img-alt=\"\"></cod-button></a>\n `;\n }else{\n dataParsing.content = `\n <p>This property doesn't qualify for the Basement Backup Protection Program. To learn more please <a href=\"https://detroitmi.gov/departments/water-and-sewerage-department/dwsd-resources/basement-flooding-protection\">visit our page.</a></p>\n `;\n }\n } else {\n dataParsing.content = `\n <p>This property doesn't qualify for the Basement Backup Protection Program. To learn more please <a href=\"https://detroitmi.gov/departments/water-and-sewerage-department/dwsd-resources/basement-flooding-protection\">visit our page.</a></p>\n `;\n }\n return dataParsing;\n }\n\n buildHRDFlooding(values) {\n console.log(values.data.attributes.neighborhood_name);\n let validNeighborhoods = ['Cornerstone Village', 'Morningside', 'Chandler Park', 'Fox Creek', 'Riverbend', 'Morningside', 'West End', 'Midwest', 'Chadsey Condon', 'Claytown', 'North Corktown', 'Michigan-Martin', 'Aviation Sub', 'Garden View', 'Plymouth-I96', 'Plymouth-Hubbell', 'Paveway', 'We Care Community', 'Fiskhorn', 'Joy-Schaefer', 'Warrendale', 'Warren Ave Community', 'Barton-McFarland', 'East Canfield'];\n let dataParsing = { title: \"CDBG-DR Private Sewer Repair Program\", content: null };\n if (values && values.data.attributes.neighborhood_name) {\n if (validNeighborhoods.includes(values.data.attributes.neighborhood_name)) {\n dataParsing.content = `\n <p>This property qualifies for the CDBG-DR Private Sewer Repair Program.</p>\n <br>\n <cod-button data-label=\"Apply Now\" data-background-color=\"primary\" data-size=\"xsmall\" data-icon=\"\" data-primary=\"true\" data-img-alt=\"\" data-link=\"https://app.smartsheet.com/b/form/3dab24dc95bf469b8ac4c27669536507\"></cod-button>\n `;\n }else{\n dataParsing.content = `\n <p>This property doesn’t qualify for the CDBG-DR Private Sewer Repair Program. To learn more please <a href=\"https://detroitmi.gov/departments/housing-and-revitalization-department/disaster-recovery\">visit our page.</a></p>\n `;\n }\n } else {\n dataParsing.content = `\n <p>This property doesn’t qualify for the CDBG-DR Private Sewer Repair Program. To learn more please <a href=\"https://detroitmi.gov/departments/housing-and-revitalization-department/disaster-recovery\">visit our page.</a></p>\n `;\n }\n return dataParsing;\n }\n\n buildHistoricDistrict(value, display) {\n let dataParsing = { title: \"NEZ Homestead Zone\", content: null };\n if (Object.keys(value.data).length != 0 && value.data.constructor === Object && value.data.features.length > 0) {\n dataParsing.content = `\n <p><strong>NAME:</strong> ${value.data.features[0].attributes.Name}</p>\n <p><strong>DESIGNATED ON:</strong> ${display.formatDate(value.data.features[0].attributes.Year_Enacted).format('MMM DD, YYYY')}</p>\n `;\n } else {\n dataParsing.content = `\n <p>This property is not in a historic district.</p>\n `;\n }\n return dataParsing;\n }\n\n buildNEZ(nez) {\n let dataParsing = { title: \"NEZ Homestead Zone\", content: null };\n if (Object.keys(nez.data).length != 0 && nez.data.constructor === Object && nez.data.features.length > 0) {\n dataParsing.content = `\n <p><strong>Name:</strong> ${nez.data.features[0].attributes.RNNAME}</p>\n <p><strong>ID:</strong> ${nez.data.features[0].attributes.RID}</p>\n <p class=\"noprint\"><a href=\"https://data.detroitmi.gov/datasets/proposed-nez-homestead-2021/explore\" target=\"_blank\">View Map</a></p>\n `;\n } else {\n dataParsing.content = `\n <p>This property is not on a NEZ Homestead zone.</p>\n <p class=\"noprint\"><a href=\"https://data.detroitmi.gov/datasets/nez-h-districts/explore\" target=\"_blank\">View Map</a></p>\n `;\n }\n return dataParsing;\n }\n\n buildNRSA(value) {\n let dataParsing = { title: \"Neighborhood Revitalization Strategy Areas (NRSA)\", content: null };\n if (Object.keys(value.data).length != 0 && value.data.constructor === Object && value.data.features.length > 0) {\n dataParsing.content = `\n <p><strong>Name:</strong> ${value.data.features[0].attributes.Name}</p>\n `;\n } else {\n dataParsing.content = `\n <p>This property is not on a NRSA.</p>\n `;\n }\n return dataParsing;\n }\n\n buildNPO(value) {\n let dataParsing = { title: \"Police\", content: null };\n if (value && value.data.features.length) {\n dataParsing.content = `\n <p><strong>PRECINCT</strong></p>\n <p><strong>Number:</strong> ${value.data.features[0].attributes.precinct}</p>\n <p><strong>Address:</strong> ${value.data.features[0].attributes.precinct_location}</p>\n <br>\n <p><strong>NEIGHBORHOOD POLICE OFFICER (NPO)</strong></p>\n <p><strong>Name:</strong> ${value.data.features[0].attributes.officer_name}</p>\n <p><strong>Phone:</strong> ${value.data.features[0].attributes.npo_cell_phone}</p>\n <p><strong>Email:</strong> ${value.data.features[0].attributes.npo_email}</p>\n `;\n } else {\n dataParsing.content = `<p>No police info found</p>`;\n }\n return dataParsing;\n }\n\n checkRecyclingStatus(data) {\n try {\n if (data.next_pickups['yard waste']) {\n let yardStart = null;\n let yardEnd = null;\n data.details.forEach((item) => {\n if (item.type == 'start-date' && item.service == 'yard waste') {\n if (item.normalDay != null) {\n yardStart = item.normalDay;\n } else {\n yardStart = item.newDay;\n }\n }\n if (item.type == 'end-date' && item.service == 'yard waste') {\n if (item.normalDay != null) {\n yardEnd = item.normalDay;\n } else {\n yardEnd = item.newDay;\n }\n }\n });\n if (moment(data.next_pickups['yard waste'].next_pickup).isBetween(yardStart, yardEnd)) {\n return true;\n } else {\n return false;\n }\n } else {\n return false;\n }\n } catch (error) {\n return false;\n }\n }\n\n buildRecycling(value, display) {\n let dataParsing = { title: \"Trash & Recycling\", content: null };\n if (value && Object.keys(value.data).length != 0 && value.data.constructor === Object) {\n let contractorInfo = {\n name: null,\n url: null,\n phone: null\n };\n if (value.data.next_pickups.trash.contractor === 'GFL') {\n contractorInfo.name = 'GFL';\n contractorInfo.url = 'http://gflusa.com/residential/detroit/';\n contractorInfo.phone = '(844) 464-3587';\n } else if (value.data.next_pickups.trash.contractor === 'WM') {\n contractorInfo.name = 'WM';\n contractorInfo.url = 'http://www.advanceddisposal.com/mi/detroit/detroit-residential-collection';\n contractorInfo.phone = '(844) 233-8764';\n } else if (value.data.next_pickups.trash.contractor === 'Priority Waste') {\n contractorInfo.name = 'Priority Waste';\n contractorInfo.url = 'https://www.prioritywaste.com/cities-we-serve/detroit/';\n contractorInfo.phone = '(855) 927-835';\n }\n dataParsing.content = `\n <p><strong>Provider:</strong> <a href=\"${contractorInfo.url}\" target=\"_blank\">${contractorInfo.name}</a> ${contractorInfo.phone}</p>\n <p><strong>Next Trash:</strong> ${display.formatDate(value.data.next_pickups.trash.next_pickup)}</p>\n <p><strong>Next Recycling:</strong> ${display.formatDate(value.data.next_pickups.recycling.next_pickup)}</p>\n <p><strong>Next Bulk:</strong> ${display.formatDate(value.data.next_pickups.bulk.next_pickup)}</p>\n ${(display.checkRecyclingStatus(value.data)) ? tempHTML += `<p><strong>Next Yard:</strong> ${display.formatDate(value.data.next_pickups['yard waste'].next_pickup)}</p>` : ``}\n `;\n } else {\n dataParsing.content = `<p>No data found</p>`;\n }\n return dataParsing;\n }\n\n buildAssessors(value) {\n let dataParsing = { title: \"Assessor's Data\", content: null };\n if (value && Object.keys(value.data).length != 0 && value.data.constructor === Object && value.data.detail !== \"Not found.\") {\n let property = {\n year: null,\n value: null,\n floor: null,\n buildingClass: null\n }\n dataParsing.content = `\n <p><strong>Owner's address:</strong> ${value.data.ownerstreetaddr}</p>\n <p><strong>Owner's city:</strong> ${value.data.ownercity}</p>\n <p><strong>Owner's state:</strong> ${value.data.ownerstate}</p>\n <p><strong>Owner's zip:</strong> ${value.data.ownerzip}</p>\n `;\n if (value.data.resb_bldgclass === 0) {\n property.year = value.data.cib_yearbuilt;\n property.value = value.data.cib_value;\n property.floor = value.data.cib_yearbuilt;\n property.buildingClass = value.data.cib_yearbuilt;\n } else {\n property.year = value.data.resb_yearbuilt;\n property.value = value.data.resb_value;\n property.floor = value.data.resb_floorarea;\n property.buildingClass = value.data.resb_bldgclass;\n }\n dataParsing.content += `\n <p><strong>Parcel number:</strong> ${value.data.pnum}</p>\n <p><strong>Year build:</strong> ${property.year}</p>\n <p><strong>Calculated value:</strong> $${property.value.toLocaleString()}</p>\n <p><strong>Floor area:</strong> ${property.floor.toLocaleString()} SQFT</p>\n <p><strong>Building class:</strong> ${property.buildingClass}</p>\n `;\n } else {\n dataParsing.content = `<p>No data found</p>`;\n }\n return dataParsing;\n }\n\n buildRental(value, display) {\n let app = document.getElementsByTagName('my-home-info');\n let apiDataSets = JSON.parse(app[0].getAttribute('data-api-active-datasets'));\n let dataParsing = { title: \"Rental Enforcement Status\", content: null };\n if ((value && value.data.features.length) || (apiDataSets['rental-cert-data'] && apiDataSets['rental-cert-data'].data.features.length)) {\n dataParsing.content = `\n <p><strong>Registered:</strong> ${value.data.features.length ? `${display.formatDate(value.data.features[0].attributes.date_status)}` : `Not registered`}</p>\n <p><strong>Certified:</strong> ${apiDataSets['rental-cert-data'].data.features.length ? `${display.formatDate(apiDataSets['rental-cert-data'].data.features[0].attributes.issued_date)}` : `Not certified`}</p>\n `;\n } else {\n dataParsing.content = `\n <p><strong>Registered:</strong> Not registered</p>\n <p><strong>Certified:</strong> Not certified</p>\n `;\n }\n return dataParsing;\n }\n\n buildFireEscrow(value) {\n let tempHTML = '';\n if (value && value.data.features.length) {\n tempHTML += `\n <article class=\"info-section\">\n <span>FIRE ESCROW</span>\n <div>\n <p><strong>STATUS:</strong> Fire Escrow found</p>\n <p><a href=\"https://detroitmi.gov/taxonomy/term/8501\"><button>Start Process</button></a></p>\n </div>\n </article>`;\n } else {\n tempHTML += `\n <article class=\"info-section\">\n <span>FIRE ESCROW</span>\n <div>\n <p><strong>STATUS:</strong> Fire Escrow not found</p>\n </div>\n </article>`;\n }\n return tempHTML;\n }\n\n buildBlight(value, display) {\n let dataParsing = { title: \"Blight Tickets\", content: null };\n if (value && value.data.features.length) {\n dataParsing.content = `\n <p><strong>Ticket ID:</strong> ${value.attributes.ticket_number}</p>\n <p><strong>Fine Amount:</strong> $${value.attributes.fine_amount}</p>\n <p><strong>Agency name:</strong> ${value.attributes.agency_name}</p>\n <p><strong>Disposition:</strong> ${value.attributes.disposition}</p>\n <p><strong>Description:</strong> ${value.attributes.violation_description}</p>\n <p><strong>Hearing Date:</strong> ${display.formatDate(value.attributes.hearing_date)}</p>\n <p><strong>Hearing Time:</strong> ${value.attributes.hearing_time}</p>\n `;\n } else {\n dataParsing.content = `<p>No blight tickets found</p>`;\n }\n return dataParsing;\n }\n\n buildSchools(value, display) {\n let dataParsing = { title: \"Schools\", content: null };\n if (value && value.data.features.length) {\n value.data.features.forEach(function (value, index) {\n if (index == 0) {\n dataParsing.content = `\n <p><strong>Name:</strong> ${value.properties.EntityOfficialName}</p>\n <p><strong>EntityActualGrades:</strong> ${value.properties.EntityActualGrades}</p>\n <p><strong>Type:</strong> ${value.properties.EntityTypeName}</p>\n <p><strong>Address:</strong> ${value.properties.EntityPhysicalStreet}</p>\n <hr>\n `;\n } else {\n dataParsing.content += `\n <p><strong>Name:</strong> ${value.properties.EntityOfficialName}</p>\n <p><strong>EntityActualGrades:</strong> ${value.properties.EntityActualGrades}</p>\n <p><strong>Type:</strong> ${value.properties.EntityTypeName}</p>\n <p><strong>Address:</strong> ${value.properties.EntityPhysicalStreet}</p>\n <hr>\n `;\n }\n });\n } else {\n dataParsing.content = `<p>No schools nearby.</p>`;\n }\n return dataParsing;\n }\n\n buildPermit(value, display) {\n let dataParsing = { title: \"Building Permits\", content: null };\n if (value && value.data.features.length) {\n dataParsing.content = `\n <p><strong>PERMIT NUMBER:</strong> ${value.attributes.record_id}</p>\n <p><strong>PERMIT TYPE:</strong> ${value.attributes.permit_type}</p>\n <p><strong>PERMIT BUILDING TYPE:</strong> ${value.attributes.permit_type}</p>\n <p><strong>PERMIT STATUS:</strong> ${value.attributes.status}</p>\n <p><strong>PERMIT ISSUED:</strong> ${display.formatDate(value.attributes.issued_date)}</p>\n <p><strong>PERMIT DESCRIPTION:</strong> ${value.attributes.description_of_work}</p>\n `;\n } else {\n dataParsing.content = `<p>No building permits found</p>`;\n }\n return dataParsing;\n }\n\n buildDemoStatus(value, display) {\n let app = document.getElementsByTagName('my-home-info');\n let parcelData = JSON.parse(app[0].getAttribute('data-parcel-id'));\n let tempAddress = parcelData.address.replace(' ', '%2520');\n tempAddress = tempAddress.replace(',', '%252C');\n let dataParsing = { title: \"Demolition Status\", content: null };\n if (value && value.data.features.length) {\n dataParsing.content = `\n <p class=\"critical-text\"><strong>WARNIG!</strong></p>\n <p>THIS PROPERTY IS SCHEDULED FOR DEMOLITION</p> \n ${(value.data.features[0].attributes.demolish_by_date == null) ? `<p><strong>Date to be determined</strong></p>` : `<p><strong>${display.formatDate(value.attributes.demolish_by_date)}</stron></p>`}\n <br>\n <p><a href=\"https://detroitmi.maps.arcgis.com/apps/instant/nearby/index.html?appid=41ba8dd946d842b9ba632ecc0a5d2556&sliderDistance=1&find=${tempAddress}\" target=\"_blank\"><cod-button data-label=\"Expand your demo search\" data-background-color=\"primary\" data-icon=\"\" data-size=\"xsmall\" data-primary=\"true\" data-img-alt=\"\"></cod-button></a></p>\n `;\n } else {\n dataParsing.content = `\n <p>This property is not on the upcoming demolitions list</p>\n <br>\n <p><a href=\"https://detroitmi.maps.arcgis.com/apps/instant/nearby/index.html?appid=41ba8dd946d842b9ba632ecc0a5d2556&sliderDistance=1&find=${tempAddress}\" target=\"_blank\"><cod-button data-label=\"Expand your demo search\" data-background-color=\"primary\" data-icon=\"\" data-size=\"xsmall\" data-primary=\"true\" data-img-alt=\"\"></cod-button></a></p>`;\n }\n return dataParsing;\n }\n\n buildDemosNear(value, display) {\n let dataParsing = { title: \"Demolitions Nearby\", content: null };\n if (value && value.data.features.length) {\n value.data.features.forEach(function (value, index) {\n if (index == 0) {\n dataParsing.content = `\n <p><strong>Address:</strong> ${value.properties.address}</p>\n <p><strong>Commercial:</strong> ${value.properties.commercial_building}</p>\n <p><strong>Price:</strong> $${parseInt(value.properties.price).toLocaleString()}</p>\n <p><strong>Parcel:</strong> ${value.properties.parcel_id}</p>\n <p><strong>Contractor:</strong> ${value.properties.contractor_name}</p>\n <p><strong>Council District:</strong> ${value.properties.council_district}</p>\n <p><strong>Neighborhood:</strong> ${value.properties.neighborhood}</p>\n ${(value.properties.demolish_by_date == undefined || value.properties.demolish_by_date == null) ? `<p><p><strong>Expected Date:</strong> Date to be determined</p>` : `<p><strong>Expected Date:</strong>${display.formatDate(value.properties.demolish_by_date)}</strong></p>`}\n <hr>\n `;\n } else {\n dataParsing.content += `\n <p><strong>Address:</strong> ${value.properties.address}</p>\n <p><strong>Commercial:</strong> ${value.properties.commercial_building}</p>\n <p><strong>Price:</strong> $${parseInt(value.properties.price).toLocaleString()}</p>\n <p><strong>Parcel:</strong> ${value.properties.parcel_id}</p>\n <p><strong>Contractor:</strong> ${value.properties.contractor_name}</p>\n <p><strong>Council District:</strong> ${value.properties.council_district}</p>\n <p><strong>Neighborhood:</strong> ${value.properties.neighborhood}</p>\n ${(value.properties.demolish_by_date == undefined || value.properties.demolish_by_date == null) ? `<p><p><strong>Expected Date:</strong> Date to be determined</p>` : `<p><strong>Expected Date:</strong>${display.formatDate(value.properties.demolish_by_date)}</strong></p>`}\n <hr>\n `;\n }\n });\n\n } else {\n dataParsing.content = `<p>No demolitions are happening nearby.</p>`;\n }\n return dataParsing;\n }\n\n buildStabilizationsNear(value, display) {\n let dataParsing = { title: \"Stabilizations Nearby\", content: null };\n if (value && value.data.features.length) {\n value.data.features.forEach(function (value, index) {\n\n if (index == 0) {\n dataParsing.content = `\n <p><strong>Address:</strong> ${value.properties.address}</p>\n <p><strong>Parcel:</strong> ${value.properties.parcel_id}</p>\n <p><strong>Council District:</strong> ${value.properties.council_district}</p>\n <p><strong>Neighborhood:</strong> ${value.properties.neighborhood}</p>\n <p><strong>Status:</strong> ${value.properties.rehab_status}</p>\n <hr>\n `;\n } else {\n dataParsing.content += `\n <p><strong>Address:</strong> ${value.properties.address}</p>\n <p><strong>Parcel:</strong> ${value.properties.parcel_id}</p>\n <p><strong>Council District:</strong> ${value.properties.council_district}</p>\n <p><strong>Neighborhood:</strong> ${value.properties.neighborhood}</p>\n <p><strong>Status:</strong> ${value.properties.rehab_status}</p>\n <hr>\n `;\n }\n });\n\n } else {\n dataParsing.content = `<p>No stabilizations are happening nearby.</p>`;\n }\n return dataParsing;\n }\n\n buildImproveDet(value, display) {\n let dataParsing = { title: \"Improve Detroit Issues Nearby\", content: null };\n if (value && value.data.features.length) {\n value.data.features.forEach(function (value, index) {\n if (index == 0) {\n dataParsing.content = `\n <p><strong>ID:</strong> <a href=\"${value.properties.Web_Url}\" target=\"_blank\">${value.properties.ID}</a></p>\n <p><strong>Type:</strong> ${value.properties.Request_Type_Title}</p>\n <p><strong>Status:</strong> ${value.properties.Status}</p>\n <p><strong>Reported on:</strong> ${display.formatDate(value.properties.Created_At)}</p>\n <hr>\n `;\n } else {\n dataParsing.content += `\n <p><strong>ID:</strong> <a href=\"${value.properties.Web_Url}\" target=\"_blank\">${value.properties.ID}</a></p>\n <p><strong>Type:</strong> ${value.properties.Request_Type_Title}</p>\n <p><strong>Status:</strong> ${value.properties.Status}</p>\n <p><strong>Reported on:</strong> ${display.formatDate(value.properties.Created_At)}</p>\n <hr>\n `;\n }\n });\n\n } else {\n dataParsing.content = `<p>No active issues nearby.</p>`;\n }\n return dataParsing;\n }\n\n selectDataBlockType(display, value) {\n switch (value.id) {\n case 'council-members':\n try {\n return display.buildCouncil(value);\n } catch (error) {\n // console.log(error);\n return '';\n }\n break;\n\n case 'bop-members':\n try {\n return display.buildBOP(value);\n } catch (error) {\n // console.log(error);\n return '';\n }\n break;\n\n case 'district-managers':\n try {\n return display.buildDistrictManagers(value);\n } catch (error) {\n // console.log(error);\n return '';\n }\n break;\n\n case 'business-liaison':\n try {\n return display.buildBusinessLiaison(value);\n } catch (error) {\n // console.log(error);\n return '';\n }\n break;\n\n case 'district-inspectors':\n try {\n return display.buildInspector(value);\n } catch (error) {\n // console.log(error);\n return '';\n }\n break;\n\n case 'neighborhood':\n try {\n return display.buildNeighborhood(value);\n } catch (error) {\n // console.log(error);\n return '';\n }\n break;\n\n case 'nez':\n try {\n return display.buildNEZ(value);\n } catch (error) {\n // console.log(error);\n return '';\n }\n break;\n\n case 'nrsa':\n try {\n return display.buildNRSA(value);\n } catch (error) {\n // console.log(error);\n return '';\n }\n break;\n\n case 'assessors-data':\n try {\n return display.buildAssessors(value);\n } catch (error) {\n // console.log(error);\n return '';\n }\n break;\n\n case 'permit-data':\n try {\n return display.buildPermit(value, display);\n } catch (error) {\n // console.log(error);\n return '';\n }\n break;\n\n case 'rental-data':\n try {\n return display.buildRental(value, display);\n } catch (error) {\n // console.log(error);\n return '';\n }\n break;\n\n case 'blight-data':\n try {\n return display.buildBlight(value, display);\n } catch (error) {\n // console.log(error);\n return '';\n }\n break;\n\n case 'demos-data':\n try {\n return display.buildDemosNear(value, display);\n } catch (error) {\n // console.log(error);\n return '';\n }\n break;\n\n case 'stabilization-data':\n try {\n return display.buildStabilizationsNear(value, display);\n } catch (error) {\n // console.log(error);\n return '';\n }\n break;\n\n case 'demo-status':\n try {\n return display.buildDemoStatus(value);\n } catch (error) {\n // console.log(error);\n return '';\n }\n break;\n\n case 'npo':\n try {\n return display.buildNPO(value);\n } catch (error) {\n // console.log(error);\n return '';\n }\n break;\n\n case 'improve-det':\n try {\n return display.buildImproveDet(value, display);\n } catch (error) {\n // console.log(error);\n return '';\n }\n break;\n\n case 'schools':\n try {\n return display.buildSchools(value, display);\n } catch (error) {\n // console.log(error);\n return '';\n }\n break;\n\n case 'recycling':\n try {\n return display.buildRecycling(value, display);\n } catch (error) {\n // console.log(error);\n return '';\n }\n break;\n\n case 'historicDistrict':\n try {\n return display.buildHistoricDistrict(value);\n } catch (error) {\n // console.log(error);\n return '';\n }\n break;\n\n case 'fireEscrow':\n try {\n return display.buildFireEscrow(value);\n } catch (error) {\n // console.log(error);\n return '';\n }\n break;\n\n case 'DWSDBackupProtection':\n try {\n return display.buildDWSDBackupProtection(value);\n } catch (error) {\n return '';\n }\n break;\n\n case 'HRDFlooding':\n try {\n return display.buildHRDFlooding(value);\n } catch (error) {\n return '';\n }\n break;\n\n default:\n return '';\n break;\n }\n }\n\n setDatasetPagination(display, dataset){\n if(display.hasAttribute('data-pagination')){\n let paginations = JSON.parse(display.getAttribute('data-pagination'));\n if(paginations[dataset.id]){\n let paginationObj = {start: paginations[dataset.id].start};\n if(dataset.data.features.length <= (paginations[dataset.id].end + 3)){\n paginationObj.end = dataset.data.features.length;\n paginationObj.more = false;\n }else{\n paginationObj.end = paginations[dataset.id].end + 3;\n paginationObj.more = true;\n }\n return paginationObj;\n }else{\n let paginationObj = {start: 0, end: 3, more: true};\n if(dataset.data.features){\n if(dataset.data.features.length <= 3){\n paginationObj.end = dataset.data.features.length;\n paginationObj.more = false;\n }\n }else{\n paginationObj.start = null;\n paginationObj.more = false;\n }\n return paginationObj;\n }\n }else{\n let paginationObj = {start: 0, end: 3, more: true};\n if(dataset.data.features){\n if(dataset.data.features.length <= 3){\n paginationObj.end = dataset.data.features.length;\n paginationObj.more = false;\n }\n }else{\n paginationObj.start = null;\n paginationObj.more = false;\n }\n return paginationObj;\n }\n }\n\n printInfo(display) {\n let divContents = display.buildDataSection(display);\n let a = window.open('', '', 'height=500, width=500');\n a.document.write('<html>');\n a.document.write('<head><style>@media print {.noprint { visibility: hidden;} p.data-block-title{border-bottom: 1px solid;} .data-block-title button { display: none; } body { column-count: 2;} .data-block { -webkit-column-break-inside: avoid; page-break-inside: avoid; break-inside: avoid; } }</style></head>');\n a.document.write('<body >');\n a.document.write(divContents.children[1].innerHTML);\n a.document.write('</body>');\n a.document.close();\n a.print();\n }\n\n buildDataBlock(display, dataSet) {\n const app = document.getElementsByTagName('my-home-info');\n const mapAvailable = app[0].getAttribute('data-map-available');\n const dataBlock = document.createElement('article');\n dataBlock.className = 'data-block';\n let pagination = display.setDatasetPagination(display, dataSet);\n let splitDataset = JSON.parse(JSON.stringify(dataSet));\n if(pagination.start !== null){\n splitDataset.data.features = dataSet.data.features.slice(pagination.start, pagination.end);\n }\n let datasetValues = display.selectDataBlockType(display, splitDataset);\n if (datasetValues == undefined || datasetValues.content == null) {\n return null;\n } else {\n const dataBlockTitle = document.createElement('p');\n dataBlockTitle.className = 'data-block-title';\n const dataBlockContent = document.createElement('article');\n dataBlockContent.className = 'data-block-content';\n dataBlockContent.innerHTML = datasetValues.content;\n if (mapAvailable == 'true') {\n const text = document.createElement('span');\n text.innerText = datasetValues.title;\n const mapButton = document.createElement('cod-button');\n mapButton.setAttribute('data-map-active-data', dataSet.id);\n mapButton.setAttribute('data-label', 'View Map');\n mapButton.setAttribute('data-size', 'xsmall');\n mapButton.setAttribute('data-icon', '');\n mapButton.setAttribute('data-img', 'https://detroitmi.gov/sites/detroitmi.localhost/files/2023-02/map.png');\n mapButton.setAttribute('data-img-alt', 'map');\n mapButton.setAttribute('data-shape', '');\n mapButton.setAttribute('data-hover', false);\n mapButton.setAttribute('data-extra-classes', 'fw-bold');\n mapButton.setAttribute('data-background-color', 'light');\n mapButton.setAttribute('data-primary', true);\n mapButton.addEventListener('click', (ev) => {\n if(ev.target.getAttribute('data-map-active-data')){\n app[0].setAttribute('data-map-active-data', ev.target.getAttribute('data-map-active-data'));\n app[0].setAttribute('data-app-state', 'map');\n }\n });\n dataBlockTitle.appendChild(text);\n dataBlockTitle.appendChild(mapButton);\n } else {\n dataBlockTitle.innerText = datasetValues.title;\n }\n dataBlock.appendChild(dataBlockTitle);\n dataBlock.appendChild(dataBlockContent);\n if(pagination.more){\n let loadMoreBtn = document.createElement('cod-button');\n loadMoreBtn.setAttribute('data-pagination-id', dataSet.id);\n loadMoreBtn.setAttribute('data-pagination', JSON.stringify(pagination));\n loadMoreBtn.setAttribute('data-label', 'Load More +');\n loadMoreBtn.setAttribute('data-size', 'xsmall');\n loadMoreBtn.setAttribute('data-icon', '');\n loadMoreBtn.setAttribute('data-img', '');\n loadMoreBtn.setAttribute('data-img-alt', '');\n loadMoreBtn.setAttribute('data-shape', '');\n loadMoreBtn.setAttribute('data-hover', false);\n loadMoreBtn.setAttribute('data-extra-classes', 'fw-bold');\n loadMoreBtn.setAttribute('data-background-color', 'primary');\n loadMoreBtn.setAttribute('data-primary', false);\n loadMoreBtn.addEventListener('click', (ev) => {\n if(ev.target.getAttribute('data-pagination')){\n let loadMoreSpinner = document.createElement('cod-spinner');\n loadMoreSpinner.setAttribute('data-type', 'border');\n loadMoreSpinner.setAttribute('data-background-color', 'primary');\n loadMoreSpinner.setAttribute('data-size', 'sm');\n let paginations = display.getAttribute('data-pagination');\n if(paginations === null){\n paginations = {};\n }else{\n paginations = JSON.parse(paginations);\n }\n paginations[`${ev.target.getAttribute('data-pagination-id')}`] = JSON.parse(ev.target.getAttribute('data-pagination'));\n display.setAttribute('data-pagination', JSON.stringify(paginations));\n ev.target.parentElement.appendChild(loadMoreSpinner);\n ev.target.remove();\n }\n });\n dataBlockContent.appendChild(loadMoreBtn);\n }\n return dataBlock;\n }\n }\n\n buildDataSection(display) {\n const app = document.getElementsByTagName('my-home-info');\n const appMode = app[0].getAttribute('data-app-mode');\n const results = document.createElement('section');\n results.id = 'data-results';\n if (appMode == 'my-home-info') {\n const sectionTitle = document.createElement('p');\n sectionTitle.className = 'data-title';\n sectionTitle.innerText = app[0].getAttribute('data-active-section').toUpperCase();\n results.appendChild(sectionTitle);\n }\n const dataBlocks = document.createElement('div');\n dataBlocks.id = 'data-blocks';\n results.appendChild(dataBlocks);\n\n const apiDataSets = JSON.parse(app[0].getAttribute('data-api-active-datasets'));\n for (const dataSet in apiDataSets) {\n if (Object.hasOwnProperty.call(apiDataSets, dataSet)) {\n if (display.buildDataBlock(display, apiDataSets[dataSet]) != null) {\n dataBlocks.appendChild(display.buildDataBlock(display, apiDataSets[dataSet]));\n }\n }\n }\n return results;\n }\n\n loadDisplay(display) {\n const shadow = display.shadowRoot;\n const displayWrapper = document.createElement('section');\n const geocoder = document.createElement('app-geocoder');\n const navTools = document.createElement('app-nav-tools');\n const app = document.getElementsByTagName('my-home-info');\n navTools.printInfo = display.printInfo;\n displayWrapper.id = 'display-wrapper';\n switch (this.getAttribute('data-display-type')) {\n case 'welcome':\n shadow.appendChild(display.welcomeStyle);\n const imageWrapper = document.createElement('div');\n imageWrapper.id = 'welcome-img-wrapper';\n imageWrapper.appendChild(this.neighborhoodImage);\n displayWrapper.appendChild(imageWrapper);\n const textWrapperWelcome = document.createElement('article');\n displayWrapper.appendChild(textWrapperWelcome);\n const titleWelcome = document.createElement('p');\n titleWelcome.setAttribute('aria-label', 'title');\n titleWelcome.innerText = 'It’s all here. All in one place.';\n titleWelcome.className = 'display-title';\n textWrapperWelcome.appendChild(titleWelcome)\n const textWelcome = document.createElement('p');\n textWelcome.innerText = 'Enter your home address to find out your city councilmember and neighborhood district manager, along with local information about trash/recycling, your neighborhood police officer, city issues reported in your neighborhood, and more.';\n textWrapperWelcome.appendChild(textWelcome);\n textWrapperWelcome.appendChild(geocoder);\n shadow.appendChild(displayWrapper);\n break;\n\n case 'active':\n shadow.appendChild(display.welcomeStyle);\n displayWrapper.appendChild(geocoder);\n shadow.appendChild(displayWrapper);\n break;\n\n case 'loading':\n const loader = document.createElement('cod-loader');\n loader.setAttribute('data-color', 'color-3');\n displayWrapper.appendChild(loader);\n shadow.appendChild(displayWrapper);\n break;\n\n case 'results':\n let parcelData = JSON.parse(app[0].getAttribute('data-parcel-id'));\n shadow.appendChild(display.resultsStyle);\n let resultsContainer = document.createElement('section');\n resultsContainer.className = 'results-container';\n resultsContainer.appendChild(navTools);\n let dataSetResults = document.createElement('article');\n dataSetResults.className = 'dataset-results';\n let addressBox = document.createElement('article');\n addressBox.className = 'result-address';\n addressBox.innerText = parcelData.address;\n dataSetResults.appendChild(addressBox);\n let results = display.buildDataSection(display);\n dataSetResults.appendChild(results);\n resultsContainer.appendChild(dataSetResults);\n displayWrapper.appendChild(resultsContainer);\n shadow.appendChild(displayWrapper);\n break;\n\n case 'error':\n let errorContainer = document.createElement('section');\n shadow.appendChild(display.resultsStyle);\n errorContainer.className = 'results-container';\n errorContainer.appendChild(navTools);\n let errorBox = document.createElement('article');\n errorBox.className = 'error-result';\n errorBox.innerHTML = `\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"100\" height=\"70\" viewBox=\"0 0 100 68\">\n <g id=\"large\">\n <path fill=\"none\" stroke=\"#F44\" d=\"M55.8 38.5l6.2-1.2c0-1.8-.1-3.5-.4-5.3l-6.3-.2c-.5-2-1.2-4-2.1-6l4.8-4c-.9-1.6-1.9-3-3-4.4l-5.6 3c-1.3-1.6-3-3-4.7-4.1l2-6A30 30 0 0 0 42 8l-3.3 5.4c-2-.7-4.2-1-6.2-1.2L31.3 6c-1.8 0-3.5.1-5.3.4l-.2 6.3c-2 .5-4 1.2-6 2.1l-4-4.8c-1.6.9-3 1.9-4.4 3l3 5.6c-1.6 1.3-3 3-4.1 4.7l-6-2A32.5 32.5 0 0 0 2 26l5.4 3.3c-.7 2-1 4.2-1.2 6.2L0 36.7c0 1.8.1 3.5.4 5.3l6.3.2c.5 2 1.2 4 2.1 6l-4.8 4c.9 1.6 1.9 3 3 4.4l5.6-3c1.4 1.6 3 3 4.7 4.1l-2 6A30.5 30.5 0 0 0 20 66l3.4-5.4c2 .7 4 1 6.1 1.2l1.2 6.2c1.8 0 3.5-.1 5.3-.4l.2-6.3c2-.5 4-1.2 6-2.1l4 4.8c1.6-.9 3-1.9 4.4-3l-3-5.6c1.6-1.3 3-3 4.1-4.7l6 2A32 32 0 0 0 60 48l-5.4-3.3c.7-2 1-4.2 1.2-6.2zm-13.5 4a12.5 12.5 0 1 1-22.6-11 12.5 12.5 0 0 1 22.6 11z\"/>\n <animateTransform attributeName=\"transform\" begin=\"0s\" dur=\"3s\" from=\"0 31 37\" repeatCount=\"indefinite\" to=\"360 31 37\" type=\"rotate\"/>\n </g>\n <g id=\"small\">\n <path fill=\"none\" stroke=\"#F44\" d=\"M93 19.3l6-3c-.4-1.6-1-3.2-1.7-4.8L90.8 13c-.9-1.4-2-2.7-3.4-3.8l2.1-6.3A21.8 21.8 0 0 0 85 .7l-3.6 5.5c-1.7-.4-3.4-.5-5.1-.3l-3-5.9c-1.6.4-3.2 1-4.7 1.7L70 8c-1.5 1-2.8 2-3.9 3.5L60 9.4a20.6 20.6 0 0 0-2.2 4.6l5.5 3.6a15 15 0 0 0-.3 5.1l-5.9 3c.4 1.6 1 3.2 1.7 4.7L65 29c1 1.5 2.1 2.8 3.5 3.9l-2.1 6.3a21 21 0 0 0 4.5 2.2l3.6-5.6c1.7.4 3.5.5 5.2.3l2.9 5.9c1.6-.4 3.2-1 4.8-1.7L86 34c1.4-1 2.7-2.1 3.8-3.5l6.3 2.1a21.5 21.5 0 0 0 2.2-4.5l-5.6-3.6c.4-1.7.5-3.5.3-5.1zM84.5 24a7 7 0 1 1-12.8-6.2 7 7 0 0 1 12.8 6.2z\"/>\n <animateTransform attributeName=\"transform\" begin=\"0s\" dur=\"2s\" from=\"0 78 21\" repeatCount=\"indefinite\" to=\"-360 78 21\" type=\"rotate\"/>\n </g>\n </svg>\n <h3>No Information found on this address. Please close and try again.</h3>\n `;\n errorContainer.appendChild(errorBox);\n displayWrapper.appendChild(errorContainer);\n shadow.appendChild(displayWrapper);\n break;\n\n case 'print':\n let printParcelData = JSON.parse(app[0].getAttribute('data-parcel-id'));\n shadow.appendChild(display.resultsStyle);\n let printResultsContainer = document.createElement('section');\n printResultsContainer.className = 'results-container';\n printResultsContainer.appendChild(navTools);\n let printDataSetResults = document.createElement('article');\n printDataSetResults.className = 'dataset-results';\n let printAddressBox = document.createElement('article');\n printAddressBox.className = 'result-address';\n printAddressBox.innerText = printParcelData.address;\n printDataSetResults.appendChild(printAddressBox);\n let printResults = display.buildDataSection(display);\n printDataSetResults.appendChild(printResults);\n printResultsContainer.appendChild(printDataSetResults);\n displayWrapper.appendChild(printResultsContainer);\n shadow.appendChild(displayWrapper);\n display.printInfo(display);\n break;\n\n default:\n break;\n }\n }\n\n}\n","'use strict';\r\nconst turf = require('@turf/turf');\r\nconst arcGIS = require('terraformer-arcgis-parser');\r\n\r\nexport default class DataLoader extends HTMLElement {\r\n static get observedAttributes() {\r\n return ['data-loader-state', 'data-parcel-id'];\r\n }\r\n\r\n constructor() {\r\n // Always call super first in constructor\r\n super();\r\n\r\n // Create a shadow root\r\n const shadow = this.attachShadow({ mode: 'open' });\r\n\r\n // Create result section\r\n const loaderWrapper = document.createElement('section');\r\n loaderWrapper.id = 'loader-wrapper';\r\n shadow.appendChild(loaderWrapper);\r\n }\r\n\r\n attributeChangedCallback(name, oldValue, newValue) {\r\n const shadow = this.shadowRoot;\r\n // console.log(`Loader - attribute: ${name}, old: ${oldValue}, new: ${newValue}`);\r\n switch (name) {\r\n case 'data-loader-state':\r\n this.clearLoader(this);\r\n this.loadLoader(this);\r\n break;\r\n\r\n default:\r\n break;\r\n }\r\n }\r\n\r\n getDataSets(loader) {\r\n const app = document.getElementsByTagName('my-home-info');\r\n const dataSets = app[0].getAttribute('data-active-sets').split(',');\r\n const parcelData = JSON.parse(app[0].getAttribute('data-parcel-id'));\r\n let dataList = [];\r\n\r\n let assessorsData = new Promise((resolve, reject) => {\r\n if (parcelData.attributes.parcel_id == 'CONDO BUILDING') {\r\n resolve({ \"id\": \"assessors-data\", \"data\": null });\r\n } else {\r\n let url = \"https://apis.detroitmi.gov/assessments/parcel/\" + parcelData.attributes.parcel_id + \"/\";\r\n return fetch(url)\r\n .then((resp) => resp.json()) // Transform the data into json\r\n .then(function (data) {\r\n resolve({ \"id\": \"assessors-data\", \"data\": data });\r\n }).catch(err => {\r\n // console.log(err);\r\n });\r\n }\r\n });\r\n\r\n let neighborhoods = new Promise((resolve, reject) => {\r\n resolve({ \"id\": \"neighborhood\", \"data\": parcelData });\r\n });\r\n\r\n let council = new Promise((resolve, reject) => {\r\n return resolve({ \"id\": \"council\", \"data\": parcelData });\r\n });\r\n let bopMembers = new Promise((resolve, reject) => {\r\n let url = \"/rest/bop?_format=json\";\r\n return fetch(url)\r\n .then((resp) => resp.json()) // Transform the data into json\r\n .then(function (data) {\r\n resolve({ \"id\": \"bop-members\", \"data\": data });\r\n }).catch(err => {\r\n // console.log(err);\r\n });\r\n });\r\n let districtManagers = new Promise((resolve, reject) => {\r\n let url = \"/rest/district-managers?_format=json\";\r\n return fetch(url)\r\n .then((resp) => resp.json()) // Transform the data into json\r\n .then(function (data) {\r\n resolve({ \"id\": \"district-managers\", \"data\": data });\r\n }).catch(err => {\r\n // console.log(err);\r\n });\r\n });\r\n let districtInspectors = new Promise((resolve, reject) => {\r\n let url = \"/rest/district-inspectors?_format=json\";\r\n return fetch(url)\r\n .then((resp) => resp.json()) // Transform the data into json\r\n .then(function (data) {\r\n resolve({ \"id\": \"district-inspectors\", \"data\": data });\r\n }).catch(err => {\r\n // console.log(err);\r\n });\r\n });\r\n let councilMembers = new Promise((resolve, reject) => {\r\n let url = \"/rest/council-members?_format=json\";\r\n return fetch(url)\r\n .then((resp) => resp.json()) // Transform the data into json\r\n .then(function (data) {\r\n resolve({ \"id\": \"council-members\", \"data\": data });\r\n }).catch(err => {\r\n // console.log(err);\r\n });\r\n });\r\n let DWSDBackupProtection = new Promise((resolve, reject) => {\r\n resolve({ \"id\": \"DWSDBackupProtection\", \"data\": parcelData });\r\n });\r\n let HRDFlooding = new Promise((resolve, reject) => {\r\n resolve({ \"id\": \"HRDFlooding\", \"data\": parcelData });\r\n });\r\n let nrsa = new Promise((resolve, reject) => {\r\n let url = `https://services2.arcgis.com/qvkbeam7Wirps6zC/arcgis/rest/services/NRSA_2020/FeatureServer/0/query?where=&objectIds=&time=&geometry=${parcelData.location.x}%2C${parcelData.location.y}&geometryType=esriGeometryPoint&inSR=4326&spatialRel=esriSpatialRelIntersects&resultType=none&distance=0.0&units=esriSRUnit_Meter&returnGeodetic=false&outFields=*&returnGeometry=true&returnCentroid=false&featureEncoding=esriDefault&multipatchOption=xyFootprint&maxAllowableOffset=&geometryPrecision=&outSR=&datumTransformation=&applyVCSProjection=false&returnIdsOnly=false&returnUniqueIdsOnly=false&returnCountOnly=false&returnExtentOnly=false&returnQueryGeometry=false&returnDistinctValues=false&cacheHint=false&orderByFields=&groupByFieldsForStatistics=&outStatistics=&having=&resultOffset=&resultRecordCount=&returnZ=false&returnM=false&returnExceededLimitFeatures=true&quantizationParameters=&sqlFormat=none&f=json&token=`\r\n return fetch(url)\r\n .then((resp) => resp.json()) // Transform the data into json\r\n .then(function (data) {\r\n resolve({ \"id\": \"nrsa\", \"data\": data });\r\n }).catch(err => {\r\n // console.log(err);\r\n });\r\n });\r\n let nezHomestead = new Promise((resolve, reject) => {\r\n let url = `https://services2.arcgis.com/qvkbeam7Wirps6zC/ArcGIS/rest/services/NEZHOMESTEAD2021/FeatureServer/0/query?where=&objectIds=&time=&geometry=${parcelData.location.x}%2C${parcelData.location.y}&geometryType=esriGeometryPoint&inSR=4326&spatialRel=esriSpatialRelIntersects&resultType=none&distance=0.0&units=esriSRUnit_Meter&returnGeodetic=false&outFields=*&returnGeometry=true&returnCentroid=false&featureEncoding=esriDefault&multipatchOption=xyFootprint&maxAllowableOffset=&geometryPrecision=&outSR=&datumTransformation=&applyVCSProjection=false&returnIdsOnly=false&returnUniqueIdsOnly=false&returnCountOnly=false&returnExtentOnly=false&returnQueryGeometry=false&returnDistinctValues=false&cacheHint=false&orderByFields=&groupByFieldsForStatistics=&outStatistics=&having=&resultOffset=&resultRecordCount=&returnZ=false&returnM=false&returnExceededLimitFeatures=true&quantizationParameters=&sqlFormat=none&f=json&token=`\r\n return fetch(url)\r\n .then((resp) => resp.json()) // Transform the data into json\r\n .then(function (data) {\r\n resolve({ \"id\": \"nez\", \"data\": data });\r\n }).catch(err => {\r\n // console.log(err);\r\n });\r\n });\r\n let permitData = new Promise((resolve, reject) => {\r\n let url = `https://services2.arcgis.com/qvkbeam7Wirps6zC/ArcGIS/rest/services/BuildingPermits/FeatureServer/0/query?where=parcel_id+%3D+%27${parcelData.attributes.parcel_id}%27&objectIds=&time=&geometry=&geometryType=esriGeometryEnvelope&inSR=&spatialRel=esriSpatialRelIntersects&resultType=none&distance=0.0&units=esriSRUnit_Meter&returnGeodetic=false&outFields=*&returnGeometry=true&featureEncoding=esriDefault&multipatchOption=xyFootprint&maxAllowableOffset=&geometryPrecision=&outSR=&datumTransformation=&applyVCSProjection=false&returnIdsOnly=false&returnUniqueIdsOnly=false&returnCountOnly=false&returnExtentOnly=false&returnQueryGeometry=false&returnDistinctValues=false&cacheHint=false&orderByFields=&groupByFieldsForStatistics=&outStatistics=&having=&resultOffset=&resultRecordCount=3&returnZ=false&returnM=false&returnExceededLimitFeatures=true&quantizationParameters=&sqlFormat=none&f=json`;\r\n return fetch(url)\r\n .then((resp) => resp.json()) // Transform the data into json\r\n .then(function (data) {\r\n resolve({ \"id\": \"permit-data\", \"data\": data });\r\n }).catch(err => {\r\n // console.log(err);\r\n });\r\n });\r\n let rentalData = new Promise((resolve, reject) => {\r\n let url;\r\n if (parcelData.attributes.parcel_id != 'CONDO BUILDING') {\r\n url = `https://services2.arcgis.com/qvkbeam7Wirps6zC/ArcGIS/rest/services/RentalStatuses/FeatureServer/0/query?where=parcel_id+%3D+%27${parcelData.attributes.parcel_id}%27&objectIds=&time=&geometry=&geometryType=esriGeometryEnvelope&inSR=&spatialRel=esriSpatialRelIntersects&resultType=none&distance=0.0&units=esriSRUnit_Meter&returnGeodetic=false&outFields=*&returnGeometry=true&featureEncoding=esriDefault&multipatchOption=xyFootprint&maxAllowableOffset=&geometryPrecision=&outSR=&datumTransformation=&applyVCSProjection=false&returnIdsOnly=false&returnUniqueIdsOnly=false&returnCountOnly=false&returnExtentOnly=false&returnQueryGeometry=false&returnDistinctValues=false&cacheHint=false&orderByFields=&groupByFieldsForStatistics=&outStatistics=&having=&resultOffset=&resultRecordCount=&returnZ=false&returnM=false&returnExceededLimitFeatures=true&quantizationParameters=&sqlFormat=none&f=json`;\r\n } else {\r\n url = `https://services2.arcgis.com/qvkbeam7Wirps6zC/ArcGIS/rest/services/RentalStatuses/FeatureServer/0/query?where=&objectIds=&time=&geometry=${parcelData.location.x}%2C+${parcelData.location.y}&geometryType=esriGeometryPoint&inSR=4326&spatialRel=esriSpatialRelIndexIntersects&distance=&units=esriSRUnit_Foot&relationParam=&outFields=*&returnGeometry=true&maxAllowableOffset=&geometryPrecision=&outSR=&gdbVersion=&returnDistinctValues=false&returnIdsOnly=false&returnCountOnly=false&returnExtentOnly=false&orderByFields=&groupByFieldsForStatistics=&outStatistics=&returnZ=false&returnM=false&multipatchOption=&resultOffset=&resultRecordCount=&f=json`;\r\n }\r\n return fetch(url)\r\n .then((resp) => resp.json()) // Transform the data into json\r\n .then(function (data) {\r\n resolve({ \"id\": \"rental-data\", \"data\": data });\r\n }).catch(err => {\r\n // console.log(err);\r\n });\r\n });\r\n let rentalCertData = new Promise((resolve, reject) => {\r\n let url;\r\n if (parcelData.attributes.parcel_id != 'CONDO BUILDING') {\r\n url = `https://services2.arcgis.com/qvkbeam7Wirps6zC/ArcGIS/rest/services/active_cofc/FeatureServer/0/query?where=parcel_id%3D%27${parcelData.attributes.parcel_id}%27&objectIds=&time=&geometry=&geometryType=esriGeometryEnvelope&inSR=&spatialRel=esriSpatialRelIntersects&resultType=none&distance=0.0&units=esriSRUnit_Meter&returnGeodetic=false&outFields=*&returnGeometry=true&featureEncoding=esriDefault&multipatchOption=xyFootprint&maxAllowableOffset=&geometryPrecision=&outSR=&datumTransformation=&applyVCSProjection=false&returnIdsOnly=false&returnUniqueIdsOnly=false&returnCountOnly=false&returnExtentOnly=false&returnQueryGeometry=false&returnDistinctValues=false&cacheHint=false&orderByFields=&groupByFieldsForStatistics=&outStatistics=&having=&resultOffset=&resultRecordCount=1&returnZ=false&returnM=false&returnExceededLimitFeatures=true&quantizationParameters=&sqlFormat=none&f=json`;\r\n } else {\r\n url = `https://services2.arcgis.com/qvkbeam7Wirps6zC/ArcGIS/rest/services/active_cofc/FeatureServer/0/query?where=&objectIds=&time=&geometry=${parcelData.location.x}%2C+${parcelData.location.y}&geometryType=esriGeometryPoint&inSR=4326&spatialRel=esriSpatialRelIndexIntersects&distance=&units=esriSRUnit_Foot&relationParam=&outFields=*&returnGeometry=true&maxAllowableOffset=&geometryPrecision=&outSR=&gdbVersion=&returnDistinctValues=false&returnIdsOnly=false&returnCountOnly=false&returnExtentOnly=false&orderByFields=&groupByFieldsForStatistics=&outStatistics=&returnZ=false&returnM=false&multipatchOption=&resultOffset=&resultRecordCount=&f=json`;\r\n }\r\n return fetch(url)\r\n .then((resp) => resp.json()) // Transform the data into json\r\n .then(function (data) {\r\n resolve({ \"id\": \"rental-cert-data\", \"data\": data });\r\n }).catch(err => {\r\n // console.log(err);\r\n });\r\n });\r\n let blightData = new Promise((resolve, reject) => {\r\n let url = `https://services2.arcgis.com/qvkbeam7Wirps6zC/arcgis/rest/services/Blight_Violations_(DAH)/FeatureServer/0/query?where=parcelno%3D%27${parcelData.attributes.parcel_id}%27&objectIds=&time=&geometry=&geometryType=esriGeometryEnvelope&inSR=&spatialRel=esriSpatialRelIntersects&resultType=none&distance=0.0&units=esriSRUnit_Meter&returnGeodetic=false&outFields=*&returnGeometry=true&featureEncoding=esriDefault&multipatchOption=xyFootprint&maxAllowableOffset=&geometryPrecision=&outSR=&datumTransformation=&applyVCSProjection=false&returnIdsOnly=false&returnUniqueIdsOnly=false&returnCountOnly=false&returnExtentOnly=false&returnQueryGeometry=false&returnDistinctValues=false&cacheHint=false&orderByFields=violation_date&groupByFieldsForStatistics=&outStatistics=&having=&resultOffset=&resultRecordCount=2&returnZ=false&returnM=false&returnExceededLimitFeatures=true&quantizationParameters=&sqlFormat=none&f=json&token=`;\r\n return fetch(url)\r\n .then((resp) => resp.json()) // Transform the data into json\r\n .then(function (data) {\r\n resolve({ \"id\": \"blight-data\", \"data\": data });\r\n }).catch(err => {\r\n // console.log(err);\r\n });\r\n });\r\n let salesHistoryData = new Promise((resolve, reject) => {\r\n let url = `https://services2.arcgis.com/qvkbeam7Wirps6zC/arcgis/rest/services/Property_Sales/FeatureServer/0/query?where=PARCEL_NO%3D%27${parcelData.attributes.parcel_id}%27&objectIds=&time=&geometry=&geometryType=esriGeometryEnvelope&inSR=&spatialRel=esriSpatialRelIntersects&resultType=none&distance=0.0&units=esriSRUnit_Meter&returnGeodetic=false&outFields=*&returnGeometry=true&featureEncoding=esriDefault&multipatchOption=xyFootprint&maxAllowableOffset=&geometryPrecision=&outSR=4326&datumTransformation=&applyVCSProjection=false&returnIdsOnly=false&returnUniqueIdsOnly=false&returnCountOnly=false&returnExtentOnly=false&returnQueryGeometry=false&returnDistinctValues=false&cacheHint=false&orderByFields=SALE_DATE&groupByFieldsForStatistics=&outStatistics=&having=&resultOffset=&resultRecordCount=2&returnZ=false&returnM=false&returnExceededLimitFeatures=true&quantizationParameters=&sqlFormat=none&f=json&token=`;\r\n return fetch(url)\r\n .then((resp) => resp.json()) // Transform the data into json\r\n .then(function (data) {\r\n resolve({ \"id\": \"sales-data\", \"data\": data });\r\n }).catch(err => {\r\n // console.log(err);\r\n });\r\n });\r\n let demosData = new Promise((resolve, reject) => {\r\n let point = turf.point([parcelData.location.x, parcelData.location.y]);\r\n let buffer = turf.buffer(point, 2, { units: 'miles' });\r\n let simplePolygon = turf.simplify(buffer.geometry, { tolerance: 0.005, highQuality: false });\r\n let arcsimplePolygon = arcGIS.convert(simplePolygon);\r\n let url = `https://services2.arcgis.com/qvkbeam7Wirps6zC/arcgis/rest/services/Demolitions_under_Contract/FeatureServer/0/query?where=&objectIds=&time=&geometry=${encodeURI(JSON.stringify(arcsimplePolygon))}&geometryType=esriGeometryPolygon&inSR=&spatialRel=esriSpatialRelIntersects&relationParam=&outFields=*&returnGeometry=true&returnTrueCurves=false&maxAllowableOffset=&geometryPrecision=&outSR=4326&returnIdsOnly=false&returnCountOnly=false&orderByFields=&groupByFieldsForStatistics=&outStatistics=&returnZ=false&returnM=false&gdbVersion=&returnDistinctValues=false&resultOffset=&resultRecordCount=&f=geojson`;\r\n return fetch(url)\r\n .then((resp) => resp.json()) // Transform the data into json\r\n .then(function (data) {\r\n data.features.sort(loader.sortFeaturesByDistanceTo(point));\r\n resolve({ \"id\": \"demos-data\", \"data\": data });\r\n }).catch(err => {\r\n // console.log(err);\r\n });\r\n });\r\n let stabilizationData = new Promise((resolve, reject) => {\r\n let point = turf.point([parcelData.location.x, parcelData.location.y]);\r\n let buffer = turf.buffer(point, 2, { units: 'miles' });\r\n let simplePolygon = turf.simplify(buffer.geometry, { tolerance: 0.005, highQuality: false });\r\n let arcsimplePolygon = arcGIS.convert(simplePolygon);\r\n let url = `https://services2.arcgis.com/qvkbeam7Wirps6zC/arcgis/rest/services/Contracted_Stabilizations/FeatureServer/0/query?where=&objectIds=&time=&geometry=${encodeURI(JSON.stringify(arcsimplePolygon))}&geometryType=esriGeometryPolygon&inSR=&spatialRel=esriSpatialRelIntersects&relationParam=&outFields=*&returnGeometry=true&returnTrueCurves=false&maxAllowableOffset=&geometryPrecision=&outSR=4326&returnIdsOnly=false&returnCountOnly=false&orderByFields=&groupByFieldsForStatistics=&outStatistics=&returnZ=false&returnM=false&gdbVersion=&returnDistinctValues=false&resultOffset=&resultRecordCount=3&f=geojson`;\r\n return fetch(url)\r\n .then((resp) => resp.json()) // Transform the data into json\r\n .then(function (data) {\r\n data.features.sort(loader.sortFeaturesByDistanceTo(point));\r\n resolve({ \"id\": \"stabilization-data\", \"data\": data });\r\n }).catch(err => {\r\n // console.log(err);\r\n });\r\n });\r\n let demoStatus = new Promise((resolve, reject) => {\r\n let url = `https://services2.arcgis.com/qvkbeam7Wirps6zC/arcgis/rest/services/Demolitions_under_Contract/FeatureServer/0/query?where=parcel_id+%3D+%27${parcelData.attributes.parcel_id}%27&objectIds=&time=&geometry=&geometryType=esriGeometryPolygon&inSR=&spatialRel=esriSpatialRelIntersects&resultType=none&distance=0.0&units=esriSRUnit_Meter&returnGeodetic=false&outFields=*&returnGeometry=true&featureEncoding=esriDefault&multipatchOption=xyFootprint&maxAllowableOffset=&geometryPrecision=&outSR=4326&datumTransformation=&applyVCSProjection=false&returnIdsOnly=false&returnUniqueIdsOnly=false&returnCountOnly=false&returnExtentOnly=false&returnQueryGeometry=false&returnDistinctValues=false&cacheHint=false&orderByFields=demolish_by_date&groupByFieldsForStatistics=&outStatistics=&having=&resultOffset=&resultRecordCount=1&returnZ=false&returnM=false&returnExceededLimitFeatures=true&quantizationParameters=&sqlFormat=none&f=json&token=`;\r\n return fetch(url)\r\n .then((resp) => resp.json()) // Transform the data into json\r\n .then(function (data) {\r\n resolve({ \"id\": \"demo-status\", \"data\": data });\r\n }).catch(err => {\r\n // console.log(err);\r\n });\r\n });\r\n let schools = new Promise((resolve, reject) => {\r\n let point = turf.point([parcelData.location.x, parcelData.location.y]);\r\n let buffer = turf.buffer(point, 2, { units: 'miles' });\r\n let simplePolygon = turf.simplify(buffer.geometry, { tolerance: 0.005, highQuality: false });\r\n let arcsimplePolygon = arcGIS.convert(simplePolygon);\r\n let url = `https://services2.arcgis.com/qvkbeam7Wirps6zC/ArcGIS/rest/services/2018_2019_Schools_(EEM)/FeatureServer/0/query?where=&objectIds=&time=&geometry=${encodeURI(JSON.stringify(arcsimplePolygon))}&geometryType=esriGeometryPolygon&inSR=&spatialRel=esriSpatialRelIntersects&relationParam=&outFields=*&returnGeometry=true&returnTrueCurves=false&maxAllowableOffset=&geometryPrecision=&outSR=4326&returnIdsOnly=false&returnCountOnly=false&orderByFields=&groupByFieldsForStatistics=&outStatistics=&returnZ=false&returnM=false&gdbVersion=&returnDistinctValues=false&resultOffset=&resultRecordCount=&f=geojson`;\r\n return fetch(url)\r\n .then((resp) => resp.json()) // Transform the data into json\r\n .then(function (data) {\r\n data.features.sort(loader.sortFeaturesByDistanceTo(point));\r\n resolve({ \"id\": \"schools\", \"data\": data });\r\n }).catch(err => {\r\n // console.log(err);\r\n });\r\n });\r\n let npo = new Promise((resolve, reject) => {\r\n let url = `https://services2.arcgis.com/qvkbeam7Wirps6zC/ArcGIS/rest/services/Neighborhood_Police_Officers/FeatureServer/0/query?where=&objectIds=&time=&geometry=${parcelData.location.x}%2C${parcelData.location.y}&geometryType=esriGeometryPoint&inSR=4326&spatialRel=esriSpatialRelIntersects&resultType=none&distance=1&units=esriSRUnit_Meter&returnGeodetic=false&outFields=*&returnGeometry=true&returnCentroid=false&multipatchOption=xyFootprint&maxAllowableOffset=&geometryPrecision=&outSR=4326&datumTransformation=&applyVCSProjection=false&returnIdsOnly=false&returnCountOnly=false&returnExtentOnly=false&returnDistinctValues=false&orderByFields=&groupByFieldsForStatistics=&outStatistics=&having=&resultOffset=&resultRecordCount=&returnZ=false&returnM=false&returnExceededLimitFeatures=true&quantizationParameters=&sqlFormat=none&f=json&token=`;\r\n return fetch(url)\r\n .then((resp) => resp.json()) // Transform the data into json\r\n .then(function (data) {\r\n resolve({ \"id\": \"npo\", \"data\": data });\r\n }).catch(err => {\r\n // console.log(err);\r\n });\r\n });\r\n let improveDet = new Promise((resolve, reject) => {\r\n let point = turf.point([parcelData.location.x, parcelData.location.y]);\r\n let buffer = turf.buffer(point, 500, { units: 'meters' });\r\n let simplePolygon = turf.simplify(buffer.geometry, { tolerance: 0.005, highQuality: false });\r\n let arcsimplePolygon = arcGIS.convert(simplePolygon);\r\n let url = `https://services2.arcgis.com/qvkbeam7Wirps6zC/ArcGIS/rest/services/Improve_Detroit_Issues_Test/FeatureServer/0/query?where=status+%3C%3E+%27Closed%27+and+status+%3C%3E+%27Archived%27&objectIds=&time=&geometry=${encodeURI(JSON.stringify(arcsimplePolygon))}&geometryType=esriGeometryPolygon&inSR=&spatialRel=esriSpatialRelIntersects&relationParam=&outFields=*&returnGeometry=true&returnTrueCurves=false&maxAllowableOffset=&geometryPrecision=&outSR=4326&returnIdsOnly=false&returnCountOnly=false&orderByFields=&groupByFieldsForStatistics=&outStatistics=&returnZ=false&returnM=false&gdbVersion=&returnDistinctValues=false&resultOffset=&resultRecordCount=&f=geojson`;\r\n return fetch(url)\r\n .then((resp) => resp.json()) // Transform the data into json\r\n .then(function (data) {\r\n resolve({ \"id\": \"improve-det\", \"data\": data });\r\n }).catch(err => {\r\n // console.log(err);\r\n });\r\n });\r\n let recycling = new Promise((resolve, reject) => {\r\n let url = \"https://services2.arcgis.com/qvkbeam7Wirps6zC/arcgis/rest/services/WasteCollectionAreas/FeatureServer/0/query?where=&text=&objectIds=&time=&geometry=\" + parcelData.location.x + \"%2C+\" + parcelData.location.y + \"&geometryType=esriGeometryPoint&inSR=4326&spatialRel=esriSpatialRelWithin&relationParam=&outFields=*&returnGeometry=true&returnTrueCurves=false&maxAllowableOffset=&geometryPrecision=&outSR=&returnIdsOnly=false&returnCountOnly=false&orderByFields=&groupByFieldsForStatistics=&outStatistics=&returnZ=false&returnM=false&gdbVersion=&returnDistinctValues=false&resultOffset=&resultRecordCount=&f=json\";\r\n fetch(url)\r\n .then((resp) => resp.json()) // Transform the data into json\r\n .then(function (data) {\r\n let today = new Date();\r\n let todaysMonth = today.getMonth() + 1;\r\n let todaysYear = today.getFullYear();\r\n let url = `https://apis.detroitmi.gov/waste_schedule/details/${data.features[0].attributes.FID}/year/${todaysYear}/month/${todaysMonth}/`;\r\n return fetch(url)\r\n .then((resp) => resp.json()) // Transform the data into json\r\n .then(function (data) {\r\n resolve({ \"id\": \"recycling\", \"data\": data });\r\n });\r\n }).catch(err => {\r\n // console.log(err);\r\n });\r\n });\r\n let historicDistrict = new Promise((resolve, reject) => {\r\n let url = \"https://services2.arcgis.com/qvkbeam7Wirps6zC/ArcGIS/rest/services/Detroit_Local_Historic_Districts/FeatureServer/0/query?where=&text=&objectIds=&time=&geometry=\" + parcelData.location.x + \"%2C+\" + parcelData.location.y + \"&geometryType=esriGeometryPoint&inSR=4326&spatialRel=esriSpatialRelWithin&relationParam=&outFields=*&returnGeometry=true&returnTrueCurves=false&maxAllowableOffset=&geometryPrecision=&outSR=&returnIdsOnly=false&returnCountOnly=false&orderByFields=&groupByFieldsForStatistics=&outStatistics=&returnZ=false&returnM=false&gdbVersion=&returnDistinctValues=false&resultOffset=&resultRecordCount=&f=json\";\r\n fetch(url)\r\n .then((resp) => resp.json()) // Transform the data into json\r\n .then(function (data) {\r\n resolve({ \"id\": \"historicDistrict\", \"data\": data });\r\n }).catch(err => {\r\n // console.log(err);\r\n });\r\n });\r\n let fireEscrow = new Promise((resolve, reject) => {\r\n let url = `https://services2.arcgis.com/qvkbeam7Wirps6zC/arcgis/rest/services/fie_properties_final/FeatureServer/0/query?where=parcel_id%3D%27${parcelData.attributes.parcel_id}%27&objectIds=&time=&geometry=&geometryType=esriGeometryEnvelope&inSR=&spatialRel=esriSpatialRelIntersects&resultType=none&distance=0.0&units=esriSRUnit_Meter&returnGeodetic=false&outFields=*&returnHiddenFields=false&returnGeometry=true&returnCentroid=false&featureEncoding=esriDefault&multipatchOption=xyFootprint&maxAllowableOffset=&geometryPrecision=&outSR=&datumTransformation=&applyVCSProjection=false&returnIdsOnly=false&returnUniqueIdsOnly=false&returnCountOnly=false&returnExtentOnly=false&returnQueryGeometry=false&returnDistinctValues=false&cacheHint=false&orderByFields=&groupByFieldsForStatistics=&outStatistics=&having=&resultOffset=&resultRecordCount=&returnZ=false&returnM=false&returnExceededLimitFeatures=true&quantizationParameters=&sqlFormat=none&f=json&token=`;\r\n return fetch(url)\r\n .then((resp) => resp.json()) // Transform the data into json\r\n .then(function (data) {\r\n resolve({ \"id\": \"fireEscrow\", \"data\": data });\r\n }).catch(err => {\r\n // console.log(err);\r\n });\r\n });\r\n dataSets.forEach(f => {\r\n switch (f) {\r\n case 'council':\r\n dataList.push(council);\r\n break;\r\n\r\n case 'neighborhood':\r\n dataList.push(neighborhoods);\r\n break;\r\n\r\n case 'assessors-data':\r\n if (parcelData.attributes.parcel_id != null && parcelData.attributes.parcel_id != '') {\r\n if (parcelData.attributes.parcel_id == 'CONDO BUILDING') {\r\n } else {\r\n dataList.push(assessorsData);\r\n }\r\n }\r\n break;\r\n\r\n case 'permit-data':\r\n if (parcelData.attributes.parcel_id != null && parcelData.attributes.parcel_id != '') {\r\n dataList.push(permitData);\r\n }\r\n break;\r\n\r\n case 'blight-data':\r\n if (parcelData.attributes.parcel_id != null && parcelData.attributes.parcel_id != '') {\r\n dataList.push(blightData);\r\n }\r\n break;\r\n\r\n case 'salesHistoryData':\r\n if (parcelData.attributes.parcel_id != null && parcelData.attributes.parcel_id != '') {\r\n dataList.push(salesHistoryData);\r\n }\r\n break;\r\n\r\n case 'fireEscrow':\r\n if (parcelData.attributes.parcel_id != null && parcelData.attributes.parcel_id != '') {\r\n dataList.push(fireEscrow);\r\n }\r\n break;\r\n\r\n case 'nez':\r\n dataList.push(nezHomestead);\r\n break;\r\n\r\n case 'nrsa':\r\n dataList.push(nrsa);\r\n break;\r\n\r\n case 'npo':\r\n dataList.push(npo);\r\n break;\r\n\r\n case 'improve-det':\r\n dataList.push(improveDet);\r\n break;\r\n\r\n case 'recycling':\r\n dataList.push(recycling);\r\n break;\r\n\r\n case 'rental-data':\r\n if (parcelData.attributes.parcel_id != null && parcelData.attributes.parcel_id != '') {\r\n dataList.push(rentalData);\r\n }\r\n break;\r\n\r\n case 'rental-cert':\r\n dataList.push(rentalCertData);\r\n break;\r\n\r\n case 'demo-status':\r\n if (parcelData.attributes.parcel_id != null && parcelData.attributes.parcel_id != '') {\r\n dataList.push(demoStatus);\r\n }\r\n break;\r\n\r\n case 'demos-data':\r\n dataList.push(demosData);\r\n break;\r\n\r\n case 'stabilization-data':\r\n dataList.push(stabilizationData);\r\n break;\r\n\r\n case 'schools':\r\n dataList.push(schools);\r\n break;\r\n\r\n case 'historicDistrict':\r\n dataList.push(historicDistrict);\r\n break;\r\n\r\n case 'district-managers':\r\n dataList.push(districtManagers);\r\n break;\r\n\r\n case 'district-inspectors':\r\n dataList.push(districtInspectors);\r\n break;\r\n\r\n case 'council-members':\r\n dataList.push(councilMembers);\r\n break;\r\n\r\n case 'bop-members':\r\n dataList.push(bopMembers);\r\n break;\r\n\r\n case 'HRDFlooding':\r\n dataList.push(HRDFlooding);\r\n break;\r\n\r\n default:\r\n break;\r\n }\r\n });\r\n return dataList;\r\n }\r\n\r\n buildCouncilData(data) {\r\n let councilData = {\r\n council: {\r\n district: `District ${data.council.data.attributes.council_district}`,\r\n districtURL: null,\r\n name: null,\r\n url: null,\r\n phone: null\r\n },\r\n bop: {\r\n district: `District ${data.council.data.attributes.council_district}`,\r\n url: null,\r\n name: null,\r\n url: null,\r\n phone: null,\r\n email: null\r\n },\r\n dmanager: {\r\n name: null,\r\n url: `/departments/department-of-neighborhoods/district-${data.council.data.attributes.council_district}#block-views-block-contacts-special-block-1`,\r\n phone: null\r\n },\r\n ddmanager: {\r\n name: null,\r\n url: `/departments/department-of-neighborhoods/district-${data.council.data.attributes.council_district}#block-views-block-contacts-special-block-1`,\r\n phone: null\r\n },\r\n bliaision: {\r\n name: null,\r\n email: null\r\n },\r\n enforcement: {\r\n name: null,\r\n phone: null\r\n }\r\n };\r\n switch (data.council.data.attributes.council_district.toString()) {\r\n case \"1\":\r\n councilData.council.districtURL = `/taxonomy/term/1276`;\r\n data['council-members'].data.forEach((item) => {\r\n if (item.tid == '1276') {\r\n councilData.council.name = item.field_organization_head_name;\r\n councilData.council.url = `/taxonomy/term/1276`;\r\n councilData.council.phone = item.field_phone;\r\n }\r\n });\r\n data['bop-members'].data.forEach((item) => {\r\n if (item.field_responsibilities.includes('District 1')) {\r\n councilData.bop.name = item.title;\r\n councilData.bop.url = `/taxonomy/term/4331`;\r\n let cleanPhone = item.field_telephone.replace(/ /g, '-');\r\n cleanPhone = cleanPhone.replace(/[()]/g, '');\r\n councilData.bop.phone = `<a href=\"tel:${cleanPhone}\">${item.field_telephone}</a>`;\r\n councilData.bop.email = item.field_email_address;\r\n }\r\n });\r\n data['district-managers'].data.forEach((item) => {\r\n if (item.field_contact_position.includes('District 1 Manager')) {\r\n councilData.dmanager.name = item.title;\r\n councilData.dmanager.phone = item.field_telephone;\r\n }\r\n if (item.field_contact_position.includes('District 1 Deputy Manager')) {\r\n councilData.ddmanager.name = item.title;\r\n councilData.ddmanager.phone = item.field_telephone;\r\n }\r\n if (item.field_contact_position.includes('District 1 Business Liaison')) {\r\n councilData.bliaision.name = item.title;\r\n councilData.bliaision.email = item.field_email_address;\r\n }\r\n });\r\n data['district-inspectors'].data.forEach((item) => {\r\n if (item.field_responsibilities.includes('District 1')) {\r\n councilData.enforcement.name = item.title;\r\n councilData.enforcement.phone = item.field_telephone;\r\n }\r\n });\r\n break;\r\n\r\n case \"2\":\r\n councilData.council.districtURL = `/taxonomy/term/1476`;\r\n data['council-members'].data.forEach((item) => {\r\n if (item.tid == '1476') {\r\n councilData.council.name = item.field_organization_head_name;\r\n councilData.council.url = `/taxonomy/term/1476`;\r\n councilData.council.phone = item.field_phone;\r\n }\r\n });\r\n data['bop-members'].data.forEach((item) => {\r\n if (item.field_responsibilities.includes('District 2')) {\r\n councilData.bop.name = item.title;\r\n councilData.bop.url = `/taxonomy/term/4336`;\r\n let cleanPhone = item.field_telephone.replace(/ /g, '-');\r\n cleanPhone = cleanPhone.replace(/[()]/g, '');\r\n councilData.bop.phone = `<a href=\"tel:${cleanPhone}\">${item.field_telephone}</a>`;\r\n councilData.bop.email = item.field_email_address;\r\n }\r\n });\r\n data['district-managers'].data.forEach((item) => {\r\n if (item.field_contact_position.includes('District 2 Manager')) {\r\n councilData.dmanager.name = item.title;\r\n councilData.dmanager.phone = item.field_telephone;\r\n }\r\n if (item.field_contact_position.includes('District 2 Deputy Manager')) {\r\n councilData.ddmanager.name = item.title;\r\n councilData.ddmanager.phone = item.field_telephone;\r\n }\r\n if (item.field_contact_position.includes('District 2 Business Liaison')) {\r\n councilData.bliaision.name = item.title;\r\n councilData.bliaision.email = item.field_email_address;\r\n }\r\n });\r\n data['district-inspectors'].data.forEach((item) => {\r\n if (item.field_responsibilities.includes('District 2')) {\r\n councilData.enforcement.name = item.title;\r\n councilData.enforcement.phone = item.field_telephone;\r\n }\r\n });\r\n break;\r\n\r\n case \"3\":\r\n councilData.council.districtURL = `/taxonomy/term/1481`;\r\n data['council-members'].data.forEach((item) => {\r\n if (item.tid == '1481') {\r\n councilData.council.name = item.field_organization_head_name;\r\n councilData.council.url = `/taxonomy/term/1481`;\r\n councilData.council.phone = item.field_phone;\r\n }\r\n });\r\n data['bop-members'].data.forEach((item) => {\r\n if (item.field_responsibilities.includes('District 3')) {\r\n councilData.bop.name = item.title;\r\n councilData.bop.url = `/taxonomy/term/4341`;\r\n let cleanPhone = item.field_telephone.replace(/ /g, '-');\r\n cleanPhone = cleanPhone.replace(/[()]/g, '');\r\n councilData.bop.phone = `<a href=\"tel:${cleanPhone}\">${item.field_telephone}</a>`;\r\n councilData.bop.email = item.field_email_address;\r\n }\r\n });\r\n data['district-managers'].data.forEach((item) => {\r\n if (item.field_contact_position.includes('District 3 Manager')) {\r\n councilData.dmanager.name = item.title;\r\n councilData.dmanager.phone = item.field_telephone;\r\n }\r\n if (item.field_contact_position.includes('District 3 Deputy Manager')) {\r\n councilData.ddmanager.name = item.title;\r\n councilData.ddmanager.phone = item.field_telephone;\r\n }\r\n if (item.field_contact_position.includes('District 3 Business Liaison')) {\r\n councilData.bliaision.name = item.title;\r\n councilData.bliaision.email = item.field_email_address;\r\n }\r\n });\r\n data['district-inspectors'].data.forEach((item) => {\r\n if (item.field_responsibilities.includes('District 3')) {\r\n councilData.enforcement.name = item.title;\r\n councilData.enforcement.phone = item.field_telephone;\r\n }\r\n });\r\n break;\r\n\r\n case \"4\":\r\n councilData.council.districtURL = `/taxonomy/term/1486`;\r\n data['council-members'].data.forEach((item) => {\r\n if (item.tid == '1486') {\r\n councilData.council.name = item.field_organization_head_name;\r\n councilData.council.url = `/taxonomy/term/1486`;\r\n councilData.council.phone = item.field_phone;\r\n }\r\n });\r\n data['bop-members'].data.forEach((item) => {\r\n if (item.field_responsibilities.includes('District 4')) {\r\n councilData.bop.name = item.title;\r\n councilData.bop.url = `/taxonomy/term/4346`;\r\n let cleanPhone = item.field_telephone.replace(/ /g, '-');\r\n cleanPhone = cleanPhone.replace(/[()]/g, '');\r\n councilData.bop.phone = `<a href=\"tel:${cleanPhone}\">${item.field_telephone}</a>`;\r\n councilData.bop.email = item.field_email_address;\r\n }\r\n });\r\n data['district-managers'].data.forEach((item) => {\r\n if (item.field_contact_position.includes('District 4 Manager')) {\r\n councilData.dmanager.name = item.title;\r\n councilData.dmanager.phone = item.field_telephone;\r\n }\r\n if (item.field_contact_position.includes('District 4 Deputy Manager')) {\r\n councilData.ddmanager.name = item.title;\r\n councilData.ddmanager.phone = item.field_telephone;\r\n }\r\n if (item.field_contact_position.includes('District 4 Business Liaison')) {\r\n councilData.bliaision.name = item.title;\r\n councilData.bliaision.email = item.field_email_address;\r\n }\r\n });\r\n data['district-inspectors'].data.forEach((item) => {\r\n if (item.field_responsibilities.includes('District 4')) {\r\n councilData.enforcement.name = item.title;\r\n councilData.enforcement.phone = item.field_telephone;\r\n }\r\n });\r\n break;\r\n\r\n case \"5\":\r\n councilData.council.districtURL = `/taxonomy/term/1346`;\r\n data['council-members'].data.forEach((item) => {\r\n if (item.tid == '1346') {\r\n councilData.council.name = item.field_organization_head_name;\r\n councilData.council.url = `/taxonomy/term/1346`;\r\n councilData.council.phone = item.field_phone;\r\n }\r\n });\r\n data['bop-members'].data.forEach((item) => {\r\n if (item.field_responsibilities.includes('District 5')) {\r\n councilData.bop.name = item.title;\r\n councilData.bop.url = `/taxonomy/term/4351`;\r\n let cleanPhone = item.field_telephone.replace(/ /g, '-');\r\n cleanPhone = cleanPhone.replace(/[()]/g, '');\r\n councilData.bop.phone = `<a href=\"tel:${cleanPhone}\">${item.field_telephone}</a>`;\r\n councilData.bop.email = item.field_email_address;\r\n }\r\n });\r\n data['district-managers'].data.forEach((item) => {\r\n if (item.field_contact_position.includes('District 5 Manager')) {\r\n councilData.dmanager.name = item.title;\r\n councilData.dmanager.phone = item.field_telephone;\r\n }\r\n if (item.field_contact_position.includes('District 5 Deputy Manager')) {\r\n councilData.ddmanager.name = item.title;\r\n councilData.ddmanager.phone = item.field_telephone;\r\n }\r\n if (item.field_contact_position.includes('District 5 Business Liaison')) {\r\n councilData.bliaision.name = item.title;\r\n councilData.bliaision.email = item.field_email_address;\r\n }\r\n });\r\n data['district-inspectors'].data.forEach((item) => {\r\n if (item.field_responsibilities.includes('District 5')) {\r\n councilData.enforcement.name = item.title;\r\n councilData.enforcement.phone = item.field_telephone;\r\n }\r\n });\r\n break;\r\n\r\n case \"6\":\r\n councilData.council.districtURL = `/taxonomy/term/1491`;\r\n data['council-members'].data.forEach((item) => {\r\n if (item.tid == '1491') {\r\n let cleanPhone = item.field_phone.replace('Office: ', '');\r\n cleanPhone = cleanPhone.replace(/ /g, '-');\r\n cleanPhone = cleanPhone.replace(/[()]/g, '');\r\n councilData.council.name = item.field_organization_head_name;\r\n councilData.council.url = `/taxonomy/term/1491`;\r\n councilData.council.phone = `<a href=\"tel:${cleanPhone}\">${item.field_phone}</a>`;\r\n }\r\n });\r\n data['bop-members'].data.forEach((item) => {\r\n if (item.field_responsibilities.includes('District 6')) {\r\n councilData.bop.name = item.title;\r\n councilData.bop.url = `/taxonomy/term/4321`;\r\n let cleanPhone = item.field_telephone.replace(/ /g, '-');\r\n cleanPhone = cleanPhone.replace(/[()]/g, '');\r\n councilData.bop.phone = `<a href=\"tel:${cleanPhone}\">${item.field_telephone}</a>`;\r\n councilData.bop.email = item.field_email_address;\r\n }\r\n });\r\n data['district-managers'].data.forEach((item) => {\r\n if (item.field_contact_position.includes('District 6 Manager')) {\r\n let cleanPhone = item.field_telephone.replace(/ /g, '-');\r\n cleanPhone = cleanPhone.replace(/[()]/g, '');\r\n councilData.dmanager.name = item.title;\r\n councilData.dmanager.phone = `<a href=\"tel:${cleanPhone}\">${item.field_telephone}</a>`;\r\n }\r\n if (item.field_contact_position.includes('District 6 Deputy Manager')) {\r\n let cleanPhone = item.field_telephone.replace(/ /g, '-');\r\n cleanPhone = cleanPhone.replace(/[()]/g, '');\r\n councilData.ddmanager.name = item.title;\r\n councilData.ddmanager.phone = `<a href=\"tel:${cleanPhone}\">${item.field_telephone}</a>`;\r\n }\r\n if (item.field_contact_position.includes('District 6 Business Liaison')) {\r\n councilData.bliaision.name = item.title;\r\n councilData.bliaision.email = item.field_email_address;\r\n }\r\n });\r\n data['district-inspectors'].data.forEach((item) => {\r\n if (item.field_responsibilities.includes('District 6')) {\r\n let cleanPhone = item.field_telephone.replace(/ /g, '-');\r\n cleanPhone = cleanPhone.replace(/[()]/g, '');\r\n councilData.enforcement.name = item.title;\r\n councilData.enforcement.phone = `<a href=\"tel:${cleanPhone}\">${item.field_telephone}</a>`;\r\n }\r\n });\r\n break;\r\n\r\n case \"7\":\r\n councilData.council.districtURL = `/taxonomy/term/1511`;\r\n data['council-members'].data.forEach((item) => {\r\n if (item.tid == '1511') {\r\n councilData.council.name = item.field_organization_head_name;\r\n councilData.council.url = `/taxonomy/term/1511`;\r\n councilData.council.phone = item.field_phone;\r\n }\r\n });\r\n data['bop-members'].data.forEach((item) => {\r\n if (item.field_responsibilities.includes('District 7')) {\r\n councilData.bop.name = item.title;\r\n councilData.bop.url = `/taxonomy/term/4356`;\r\n let cleanPhone = item.field_telephone.replace(/ /g, '-');\r\n cleanPhone = cleanPhone.replace(/[()]/g, '');\r\n councilData.bop.phone = `<a href=\"tel:${cleanPhone}\">${item.field_telephone}</a>`;\r\n councilData.bop.email = item.field_email_address;\r\n }\r\n });\r\n data['district-managers'].data.forEach((item) => {\r\n if (item.field_contact_position.includes('District 7 Manager')) {\r\n councilData.dmanager.name = item.title;\r\n councilData.dmanager.phone = item.field_telephone;\r\n }\r\n if (item.field_contact_position.includes('District 7 Deputy Manager')) {\r\n councilData.ddmanager.name = item.title;\r\n councilData.ddmanager.phone = item.field_telephone;\r\n }\r\n if (item.field_contact_position.includes('District 7 Business Liaison')) {\r\n councilData.bliaision.name = item.title;\r\n councilData.bliaision.email = item.field_email_address;\r\n }\r\n });\r\n data['district-inspectors'].data.forEach((item) => {\r\n if (item.field_responsibilities.includes('District 7')) {\r\n councilData.enforcement.name = item.title;\r\n councilData.enforcement.phone = item.field_telephone;\r\n }\r\n });\r\n break;\r\n\r\n default:\r\n // console.log('not inside city');\r\n break;\r\n }\r\n return councilData;\r\n }\r\n\r\n sortFeaturesByDistanceTo(target){\r\n return function(a, b) {\r\n var options = {units: 'radians'}; // using radians to forgo conversion to another unit\r\n return turf.distance(target, a, options) - turf.distance(target, b, options);\r\n }\r\n }\r\n\r\n getData(loader) {\r\n const app = document.getElementsByTagName('my-home-info');\r\n const activeDataSets = app[0].getAttribute('data-active-sets').split(',');\r\n const parcelData = JSON.parse(app[0].getAttribute('data-parcel-id'));\r\n const storedData = JSON.parse(app[0].getAttribute('data-api-stored-datasets'));\r\n let dataAlreadyLoaded = false;\r\n for (let key in storedData) {\r\n if (activeDataSets.includes(key)) {\r\n dataAlreadyLoaded = true;\r\n }\r\n }\r\n if (dataAlreadyLoaded) {\r\n let dataSets = {};\r\n activeDataSets.forEach(data => {\r\n dataSets[data] = storedData[data];\r\n });\r\n app[0].setAttribute('data-api-active-datasets', JSON.stringify(dataSets));\r\n app[0].setAttribute('data-app-state', 'results');\r\n } else {\r\n let dataList = loader.getDataSets(loader);\r\n Promise.all(dataList).then(values => {\r\n // console.log(values);\r\n let dataSets = {};\r\n for (let key in values) {\r\n if (values[key] != null) {\r\n dataSets[values[key].id] = values[key];\r\n } else {\r\n initialLoadChecker = false;\r\n }\r\n }\r\n if (activeDataSets.includes('council')) {\r\n let councilData = loader.buildCouncilData(dataSets);\r\n dataSets['council-members'] = { id: 'council-members', data: councilData.council };\r\n dataSets['bop-members'] = { id: 'bop-members', data: councilData.bop };\r\n let dManagers = { manager: councilData.dmanager, deputy: councilData.ddmanager }\r\n dataSets['district-managers'] = { id: 'district-managers', data: dManagers };\r\n dataSets['business-liaison'] = { id: 'business-liaison', data: councilData.bliaision };\r\n dataSets['district-inspectors'] = { id: 'district-inspectors', data: councilData.enforcement };\r\n }\r\n if (activeDataSets.includes('DWSDBackupProtection')) {\r\n try {\r\n if (!dataSets.DWSDBackupProtection) {\r\n dataSets.DWSDBackupProtection = { id: 'DWSDBackupProtection', data: dataSets['neighborhood'].data };\r\n }\r\n } catch (error) {\r\n // console.log(error);\r\n }\r\n }\r\n app[0].setAttribute('data-api-active-datasets', JSON.stringify(dataSets));\r\n app[0].setAttribute('data-app-state', 'results');\r\n }).catch(reason => {\r\n // console.log(reason);\r\n });\r\n }\r\n }\r\n\r\n clearLoader(loader) {\r\n const shadow = loader.shadowRoot;\r\n while (shadow.firstChild) {\r\n shadow.removeChild(shadow.firstChild);\r\n }\r\n }\r\n\r\n loadLoader(loader) {\r\n const shadow = loader.shadowRoot;\r\n const loaderWrapper = document.createElement('section');\r\n loaderWrapper.id = 'loader-wrapper';\r\n switch (loader.getAttribute('data-loader-state')) {\r\n case 'active':\r\n loader.getData(loader);\r\n const textWelcome = document.createElement('p');\r\n textWelcome.innerText = 'Loading DATA';\r\n loaderWrapper.appendChild(textWelcome);\r\n shadow.appendChild(loaderWrapper);\r\n break;\r\n\r\n case 'finished':\r\n const text = document.createElement('p');\r\n text.innerText = 'Data loaded';\r\n loaderWrapper.appendChild(text);\r\n shadow.appendChild(loaderWrapper);\r\n break;\r\n\r\n default:\r\n\r\n break;\r\n }\r\n }\r\n}\r\n","'use strict';\nimport Display from './Display';\nimport DataLoader from './DataLoader';\n// import Map from './Map';\ncustomElements.define('app-display', Display);\ncustomElements.define('app-data-loader', DataLoader);\n// customElements.define('app-map', Map);\n\nexport default class MyHomeInfo extends HTMLElement {\n static get observedAttributes() {\n return ['data-app-state', 'data-parcel-id', 'data-map-state'];\n }\n\n constructor() {\n // Always call super first in constructor\n super();\n\n // Create a shadow root\n const shadow = this.attachShadow({ mode: 'open' });\n\n // Create result section\n const app = document.getElementsByTagName('my-home-info');\n let tempState = app[0].getAttribute('data-app-state');\n\n const appWrapper = document.createElement('section');\n appWrapper.id = 'app-wrapper';\n const display = document.createElement('app-display');\n if(tempState == 'active-screen'){\n display.setAttribute('data-display-type', 'active');\n }else{\n display.setAttribute('data-display-type', 'welcome');\n }\n appWrapper.appendChild(display);\n shadow.appendChild(appWrapper);\n }\n\n attributeChangedCallback(name, oldValue, newValue) {\n const shadow = this.shadowRoot;\n const app = document.getElementsByTagName('my-home-info');\n const appMode = app[0].getAttribute('data-app-mode');\n // console.log(`App - attribute: ${name}, old: ${oldValue}, new: ${newValue}`);\n switch (name) {\n case 'data-app-state':\n if (oldValue != null) {\n this.clearApp(this);\n this.loadApp(this);\n }\n break;\n\n case 'data-parcel-id':\n if (newValue != 'none') {\n this.setAttribute('data-app-state', 'loading-screen');\n } else {\n if(appMode == 'my-home-info'){\n this.setAttribute('data-app-state', 'welcome-screen');\n }\n }\n break;\n \n case 'data-map-state':\n break;\n\n default:\n console.log('not catched');\n break;\n }\n }\n\n clearApp(app) {\n const shadow = app.shadowRoot;\n while (shadow.firstChild) {\n shadow.removeChild(shadow.firstChild);\n }\n }\n\n loadApp(app) {\n const shadow = app.shadowRoot;\n const appWrapper = document.createElement('div');\n appWrapper.id = 'app-wrapper';\n const display = document.createElement('app-display');\n const dataLoader = document.createElement('app-data-loader');\n switch (app.getAttribute('data-app-state')) {\n case 'welcome-screen':\n display.setAttribute('data-display-type', 'welcome');\n appWrapper.appendChild(display);\n break;\n\n case 'active-screen':\n display.setAttribute('data-display-type', 'active');\n appWrapper.appendChild(display);\n break;\n\n case 'loading-screen':\n display.setAttribute('data-display-type', 'loading');\n dataLoader.setAttribute('data-loader-state', 'active');\n appWrapper.appendChild(display);\n break;\n\n case 'results':\n display.setAttribute('data-display-type', 'results');\n appWrapper.appendChild(display);\n break;\n\n case 'map':\n const map = document.createElement('cod-map');\n map.id='cod-map';\n let apiData = JSON.parse(this.getAttribute('data-api-active-datasets'));\n let mapData = this.getAttribute('data-map-active-data');\n const layerData = {\"id\":\"mapData\",\"layers\":[{\"name\":\"data-points\",\"type\":\"circle\",\"radius\":6,\"color\":\"#004445\",\"active\":true,\"sort\":10,\"source\":\"data-points\"}],\"source\": apiData[mapData].data};\n let layerStructure;\n switch (mapData) {\n case 'schools':\n layerStructure = {\"schools\":[{\"type\":\"field-value\",\"label\":\"Name:\",\"value\":\"EntityOfficialName\"}]};\n break;\n\n case 'demos-data':\n layerStructure = {\"demos-data\":[{\"type\":\"field-value\",\"label\":\"Address:\",\"value\":\"address\"}]};\n break;\n\n case 'stabilization-data':\n layerStructure = {\"stabilization-data\":[{\"type\":\"field-value\",\"label\":\"Address:\",\"value\":\"address\"}]};\n break;\n\n case 'improve-det':\n layerStructure = {\"improve-det\":[{\"type\":\"field-value\",\"label\":\"Address:\",\"value\":\"Address\"},{\"type\":\"field-value\",\"label\":\"Type:\",\"value\":\"Request_Type_Title\"}]};\n break;\n \n default:\n break;\n };\n map.setAttribute('data-parent-component', 'my-home-info');\n map.setAttribute('data-map-mode', 'my-home-info');\n map.setAttribute('data-map-active-data', this.getAttribute('data-map-active-data'));\n map.setAttribute('data-popup-structure', JSON.stringify(layerStructure));\n map.setAttribute('data-map-data', JSON.stringify(layerData));\n map.setAttribute('data-location', this.getAttribute('data-parcel-id'));\n map.setAttribute('data-map-state', 'init');\n appWrapper.appendChild(map);\n break;\n\n case 'error':\n display.setAttribute('data-display-type', 'error');\n appWrapper.appendChild(display);\n break;\n\n case 'print':\n display.setAttribute('data-display-type', 'print');\n appWrapper.appendChild(display);\n break;\n\n default:\n break;\n }\n if (shadow.firstChild == null) {\n shadow.appendChild(appWrapper);\n }\n }\n}\n","import MyHomeInfo from './components/MyHomeInfo';\ncustomElements.define('my-home-info', MyHomeInfo);\n\nimport * as Sentry from \"@sentry/browser\";\n\nSentry.init({\n dsn: \"https://536fad340d72a07ee08fe3df749b982e@o4505717305704448.ingest.sentry.io/4505720878792704\",\n\n // Alternatively, use `process.env.npm_package_version` for a dynamic release version\n // if your build tool supports it.\n release: \"local-services-lookup@2.0.9\",\n integrations: [new Sentry.BrowserTracing(), new Sentry.Replay()],\n\n // Set tracesSampleRate to 1.0 to capture 100%\n // of transactions for performance monitoring.\n // We recommend adjusting this value in production\n tracesSampleRate: 1.0,\n\n // Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled\n tracePropagationTargets: [\"localhost\", /^https:\\/\\/detroitmi\\.gov/],\n\n // Capture Replay for 10% of all sessions,\n // plus for 100% of sessions with an error\n replaysSessionSampleRate: 0.1,\n replaysOnErrorSampleRate: 1.0,\n});"],"names":["Geocoder","HTMLElement","observedAttributes","constructor","super","this","form","parcelStatus","user","styles","document","createElement","textContent","shadow","attachShadow","mode","appendChild","geocoderWraper","id","label","style","fontFamily","fontWeight","input","list","icon","addEventListener","ev","submit","className","app","getElementsByTagName","innerText","getAttribute","error","setAttribute","type","placeholder","inputChange","supplementGeocoder","address","geocoder","tempAddr","split","newTempAddr","size","length","forEach","item","index","url","fetch","then","resp","json","data","candidates","sugg","attributes","parcel_id","value","onclick","selectSuggestion","childNodes","location","x","y","city","features","parcel","checkParcelValid","needGeocode","clearSuggestions","JSON","stringify","selection","target","tagName","parentNode","key","undefined","firstChild","removeChild","cleanAddress","params","geometry","request","Request","access_token","encodeURIComponent","method","body","headers","Headers","cache","res","test","preventDefault","NavigationTools","navToolsStyle","loadNavTools","clearDisplay","display","shadowRoot","navTools","appStatus","appMode","initialSets","initalMapStatus","navToolsWrapper","clearResultsBtn","propertyDataBtn","storedData","parse","activeData","govDataBtn","zoneDataBtn","nearDataBtn","printBtn","customElements","define","Display","neighborhoodImage","src","welcomeStyle","resultsStyle","loadDisplay","attributeChangedCallback","name","oldValue","newValue","formatDate","tempDate","Date","getMonth","getDate","getFullYear","buildCouncil","siteURL","window","hostname","dataParsing","title","content","district","phone","buildBOP","email","buildDistrictManagers","Object","keys","detail","manager","deputy","buildBusinessLiaison","buildInspector","buildNeighborhood","neighborhood_name","buildDWSDBackupProtection","values","validNeighborhoods","includes","Postal","buildHRDFlooding","console","log","buildHistoricDistrict","Name","Year_Enacted","format","buildNEZ","nez","RNNAME","RID","buildNRSA","buildNPO","precinct","precinct_location","officer_name","npo_cell_phone","npo_email","checkRecyclingStatus","next_pickups","yardStart","yardEnd","details","service","normalDay","newDay","moment","next_pickup","isBetween","buildRecycling","contractorInfo","trash","contractor","recycling","bulk","tempHTML","buildAssessors","property","year","floor","buildingClass","ownerstreetaddr","ownercity","ownerstate","ownerzip","resb_bldgclass","cib_yearbuilt","cib_value","resb_yearbuilt","resb_value","resb_floorarea","pnum","toLocaleString","buildRental","apiDataSets","date_status","issued_date","buildFireEscrow","buildBlight","ticket_number","fine_amount","agency_name","disposition","violation_description","hearing_date","hearing_time","buildSchools","properties","EntityOfficialName","EntityActualGrades","EntityTypeName","EntityPhysicalStreet","buildPermit","record_id","permit_type","status","description_of_work","buildDemoStatus","tempAddress","replace","demolish_by_date","buildDemosNear","commercial_building","parseInt","price","contractor_name","council_district","neighborhood","buildStabilizationsNear","rehab_status","buildImproveDet","Web_Url","ID","Request_Type_Title","Status","Created_At","selectDataBlockType","setDatasetPagination","dataset","hasAttribute","paginations","paginationObj","start","end","more","printInfo","divContents","buildDataSection","a","open","write","children","innerHTML","close","print","buildDataBlock","dataSet","mapAvailable","dataBlock","pagination","splitDataset","slice","datasetValues","dataBlockTitle","dataBlockContent","text","mapButton","loadMoreBtn","loadMoreSpinner","parentElement","remove","results","sectionTitle","toUpperCase","dataBlocks","hasOwnProperty","call","displayWrapper","imageWrapper","textWrapperWelcome","titleWelcome","textWelcome","loader","parcelData","resultsContainer","dataSetResults","addressBox","errorContainer","errorBox","printParcelData","printResultsContainer","printDataSetResults","printAddressBox","printResults","turf","require","arcGIS","DataLoader","loaderWrapper","clearLoader","loadLoader","getDataSets","dataSets","dataList","assessorsData","Promise","resolve","reject","catch","err","neighborhoods","council","bopMembers","districtManagers","districtInspectors","councilMembers","HRDFlooding","nrsa","nezHomestead","permitData","rentalData","rentalCertData","blightData","salesHistoryData","demosData","point","buffer","units","simplePolygon","simplify","tolerance","highQuality","arcsimplePolygon","convert","encodeURI","sort","sortFeaturesByDistanceTo","stabilizationData","demoStatus","schools","npo","improveDet","today","todaysMonth","todaysYear","FID","historicDistrict","fireEscrow","f","push","buildCouncilData","councilData","districtURL","bop","dmanager","ddmanager","bliaision","enforcement","toString","tid","field_organization_head_name","field_phone","field_responsibilities","cleanPhone","field_telephone","field_email_address","field_contact_position","b","options","distance","getData","activeDataSets","dataAlreadyLoaded","all","initialLoadChecker","dManagers","DWSDBackupProtection","reason","MyHomeInfo","tempState","appWrapper","clearApp","loadApp","dataLoader","map","apiData","mapData","layerData","layerStructure","Sentry","dsn","release","integrations","tracesSampleRate","tracePropagationTargets","replaysSessionSampleRate","replaysOnErrorSampleRate"],"sourceRoot":""} \ No newline at end of file diff --git a/build/assets/js/runtime.js b/build/assets/js/runtime.js index 140dc08..abf61a0 100644 --- a/build/assets/js/runtime.js +++ b/build/assets/js/runtime.js @@ -1,2 +1,2 @@ -!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},r=(new Error).stack;r&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[r]="64842054-f964-4812-8a92-ff82b6dff260",e._sentryDebugIdIdentifier="sentry-dbid-64842054-f964-4812-8a92-ff82b6dff260")}catch(e){}}();var _global="undefined"!==typeof window?window:"undefined"!==typeof global?global:"undefined"!==typeof self?self:{};_global.SENTRY_RELEASE={id:"b15ccfdbc7e26696234f56eb8df3a6b3a27a7fd6"},(()=>{"use strict";var e,r={},o={};function n(e){var t=o[e];if(void 0!==t)return t.exports;var f=o[e]={id:e,loaded:!1,exports:{}};return r[e].call(f.exports,f,f.exports,n),f.loaded=!0,f.exports}n.m=r,e=[],n.O=(r,o,t,f)=>{if(!o){var d=1/0;for(s=0;s<e.length;s++){o=e[s][0],t=e[s][1],f=e[s][2];for(var i=!0,l=0;l<o.length;l++)(!1&f||d>=f)&&Object.keys(n.O).every((e=>n.O[e](o[l])))?o.splice(l--,1):(i=!1,f<d&&(d=f));if(i){e.splice(s--,1);var a=t();void 0!==a&&(r=a)}}return r}f=f||0;for(var s=e.length;s>0&&e[s-1][2]>f;s--)e[s]=e[s-1];e[s]=[o,t,f]},n.d=(e,r)=>{for(var o in r)n.o(r,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:r[o]})},n.g=function(){if("object"===typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"===typeof window)return window}}(),n.hmd=e=>((e=Object.create(e)).children||(e.children=[]),Object.defineProperty(e,"exports",{enumerable:!0,set:()=>{throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+e.id)}}),e),n.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),(()=>{var e={666:0};n.O.j=r=>0===e[r];var r=(r,o)=>{var t,f,d=o[0],i=o[1],l=o[2],a=0;if(d.some((r=>0!==e[r]))){for(t in i)n.o(i,t)&&(n.m[t]=i[t]);if(l)var s=l(n)}for(r&&r(o);a<d.length;a++)f=d[a],n.o(e,f)&&e[f]&&e[f][0](),e[f]=0;return n.O(s)},o=self.webpackChunklocal_services_lookup=self.webpackChunklocal_services_lookup||[];o.forEach(r.bind(null,0)),o.push=r.bind(null,o.push.bind(o))})()})(); +!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},r=(new Error).stack;r&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[r]="64842054-f964-4812-8a92-ff82b6dff260",e._sentryDebugIdIdentifier="sentry-dbid-64842054-f964-4812-8a92-ff82b6dff260")}catch(e){}}();var _global="undefined"!==typeof window?window:"undefined"!==typeof global?global:"undefined"!==typeof self?self:{};_global.SENTRY_RELEASE={id:"a2b8e2612b2ee50152f1f5ccf84a620164236ffa"},(()=>{"use strict";var e,r={},o={};function n(e){var t=o[e];if(void 0!==t)return t.exports;var f=o[e]={id:e,loaded:!1,exports:{}};return r[e].call(f.exports,f,f.exports,n),f.loaded=!0,f.exports}n.m=r,e=[],n.O=(r,o,t,f)=>{if(!o){var i=1/0;for(s=0;s<e.length;s++){o=e[s][0],t=e[s][1],f=e[s][2];for(var l=!0,d=0;d<o.length;d++)(!1&f||i>=f)&&Object.keys(n.O).every((e=>n.O[e](o[d])))?o.splice(d--,1):(l=!1,f<i&&(i=f));if(l){e.splice(s--,1);var a=t();void 0!==a&&(r=a)}}return r}f=f||0;for(var s=e.length;s>0&&e[s-1][2]>f;s--)e[s]=e[s-1];e[s]=[o,t,f]},n.d=(e,r)=>{for(var o in r)n.o(r,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:r[o]})},n.g=function(){if("object"===typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"===typeof window)return window}}(),n.hmd=e=>((e=Object.create(e)).children||(e.children=[]),Object.defineProperty(e,"exports",{enumerable:!0,set:()=>{throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+e.id)}}),e),n.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),(()=>{var e={666:0};n.O.j=r=>0===e[r];var r=(r,o)=>{var t,f,i=o[0],l=o[1],d=o[2],a=0;if(i.some((r=>0!==e[r]))){for(t in l)n.o(l,t)&&(n.m[t]=l[t]);if(d)var s=d(n)}for(r&&r(o);a<i.length;a++)f=i[a],n.o(e,f)&&e[f]&&e[f][0](),e[f]=0;return n.O(s)},o=self.webpackChunklocal_services_lookup=self.webpackChunklocal_services_lookup||[];o.forEach(r.bind(null,0)),o.push=r.bind(null,o.push.bind(o))})()})(); //# sourceMappingURL=runtime.js.map \ No newline at end of file diff --git a/build/assets/js/vendors.sentry-internal.js b/build/assets/js/vendors.sentry-internal.js index f0f40c1..8901d96 100644 --- a/build/assets/js/vendors.sentry-internal.js +++ b/build/assets/js/vendors.sentry-internal.js @@ -1,2 +1,2 @@ -!function(){try{var t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},e=(new Error).stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="d32caf6b-6d81-49dc-af3e-c8ab5f320308",t._sentryDebugIdIdentifier="sentry-dbid-d32caf6b-6d81-49dc-af3e-c8ab5f320308")}catch(t){}}();var _global="undefined"!==typeof window?window:"undefined"!==typeof global?global:"undefined"!==typeof self?self:{};_global.SENTRY_RELEASE={id:"b15ccfdbc7e26696234f56eb8df3a6b3a27a7fd6"},(self.webpackChunklocal_services_lookup=self.webpackChunklocal_services_lookup||[]).push([[152],{9766:(t,e,n)=>{n.d(e,{gE:()=>z});var r=n(5544),a=n(2931),i=n(9791),o=n(2343),s=n(7638),c=n(8464),u=n(7513),d=n(3821);var p=n(1170),l=n(5363),g=n(5029);function m(t){return"number"===typeof t&&isFinite(t)}function f(t,{startTimestamp:e,...n}){return e&&t.startTimestamp>e&&(t.startTimestamp=e),t.startChild({startTimestamp:e,...n})}const h=2147483647;function T(t){return t/1e3}function v(){return d.WINDOW&&d.WINDOW.addEventListener&&d.WINDOW.performance}let _,b,y=0,k={};function S(){const t=v();if(t&&p.Z1){t.mark&&d.WINDOW.performance.mark("sentry-tracing-init");const e=(0,l.to)((({metric:t})=>{const e=t.entries.pop();if(!e)return;const n=T(p.Z1),r=T(e.startTime);u.X&&o.kg.log("[Measurements] Adding FID"),k.fid={value:t.value,unit:"millisecond"},k["mark.fid"]={value:n+r,unit:"second"}})),n=(0,l.PR)((({metric:t})=>{const e=t.entries.pop();e&&(u.X&&o.kg.log("[Measurements] Adding CLS"),k.cls={value:t.value,unit:""},b=e)})),r=(0,l.$A)((({metric:t})=>{const e=t.entries.pop();e&&(u.X&&o.kg.log("[Measurements] Adding LCP"),k.lcp={value:t.value,unit:"millisecond"},_=e)}));return()=>{e(),n(),r()}}return()=>{}}function I(t){const e=v();if(!e||!d.WINDOW.performance.getEntries||!p.Z1)return;u.X&&o.kg.log("[Tracing] Adding & adjusting spans using Performance API");const n=T(p.Z1),r=e.getEntries();let a,i;if(r.slice(y).forEach((e=>{const r=T(e.startTime),s=T(e.duration);if(!("navigation"===t.op&&n+r<t.startTimestamp))switch(e.entryType){case"navigation":!function(t,e,n){["unloadEvent","redirect","domContentLoadedEvent","loadEvent","connect"].forEach((r=>{W(t,e,r,n)})),W(t,e,"secureConnection",n,"TLS/SSL","connectEnd"),W(t,e,"fetch",n,"cache","domainLookupStart"),W(t,e,"domainLookup",n,"DNS"),function(t,e,n){f(t,{op:"browser",origin:"auto.browser.browser.metrics",description:"request",startTimestamp:n+T(e.requestStart),endTimestamp:n+T(e.responseEnd)}),f(t,{op:"browser",origin:"auto.browser.browser.metrics",description:"response",startTimestamp:n+T(e.responseStart),endTimestamp:n+T(e.responseEnd)})}(t,e,n)}(t,e,n),a=n+T(e.responseStart),i=n+T(e.requestStart);break;case"mark":case"paint":case"measure":{!function(t,e,n,r,a){const i=a+n,o=i+r;f(t,{description:e.name,endTimestamp:o,op:e.entryType,origin:"auto.resource.browser.metrics",startTimestamp:i})}(t,e,r,s,n);const a=(0,g.Y)(),i=e.startTime<a.firstHiddenTime;"first-paint"===e.name&&i&&(u.X&&o.kg.log("[Measurements] Adding FP"),k.fp={value:e.startTime,unit:"millisecond"}),"first-contentful-paint"===e.name&&i&&(u.X&&o.kg.log("[Measurements] Adding FCP"),k.fcp={value:e.startTime,unit:"millisecond"});break}case"resource":{const a=e.name.replace(d.WINDOW.location.origin,"");!function(t,e,n,r,a,i){if("xmlhttprequest"===e.initiatorType||"fetch"===e.initiatorType)return;const o={};w(o,e,"transferSize","http.response_transfer_size"),w(o,e,"encodedBodySize","http.response_content_length"),w(o,e,"decodedBodySize","http.decoded_response_content_length"),"renderBlockingStatus"in e&&(o["resource.render_blocking_status"]=e.renderBlockingStatus);const s=i+r,c=s+a;f(t,{description:n,endTimestamp:c,op:e.initiatorType?`resource.${e.initiatorType}`:"resource.other",origin:"auto.resource.browser.metrics",startTimestamp:s,data:o})}(t,e,a,r,s,n);break}}})),y=Math.max(r.length-1,0),function(t){const e=d.WINDOW.navigator;if(!e)return;const n=e.connection;n&&(n.effectiveType&&t.setTag("effectiveConnectionType",n.effectiveType),n.type&&t.setTag("connectionType",n.type),m(n.rtt)&&(k["connection.rtt"]={value:n.rtt,unit:"millisecond"}));m(e.deviceMemory)&&t.setTag("deviceMemory",`${e.deviceMemory} GB`);m(e.hardwareConcurrency)&&t.setTag("hardwareConcurrency",String(e.hardwareConcurrency))}(t),"pageload"===t.op){"number"===typeof a&&(u.X&&o.kg.log("[Measurements] Adding TTFB"),k.ttfb={value:1e3*(a-t.startTimestamp),unit:"millisecond"},"number"===typeof i&&i<=a&&(k["ttfb.requestTime"]={value:1e3*(a-i),unit:"millisecond"})),["fcp","fp","lcp"].forEach((e=>{if(!k[e]||n>=t.startTimestamp)return;const r=k[e].value,a=n+T(r),i=Math.abs(1e3*(a-t.startTimestamp)),s=i-r;u.X&&o.kg.log(`[Measurements] Normalized ${e} from ${r} to ${i} (${s})`),k[e].value=i}));const e=k["mark.fid"];e&&k.fid&&(f(t,{description:"first input delay",endTimestamp:e.value+T(k.fid.value),op:"ui.action",origin:"auto.ui.browser.metrics",startTimestamp:e.value}),delete k["mark.fid"]),"fcp"in k||delete k.cls,Object.keys(k).forEach((e=>{t.setMeasurement(e,k[e].value,k[e].unit)})),function(t){_&&(u.X&&o.kg.log("[Measurements] Adding LCP Data"),_.element&&t.setTag("lcp.element",(0,c.Rt)(_.element)),_.id&&t.setTag("lcp.id",_.id),_.url&&t.setTag("lcp.url",_.url.trim().slice(0,200)),t.setTag("lcp.size",_.size));b&&b.sources&&(u.X&&o.kg.log("[Measurements] Adding CLS Data"),b.sources.forEach(((e,n)=>t.setTag(`cls.source.${n+1}`,(0,c.Rt)(e.node)))))}(t)}_=void 0,b=void 0,k={}}function W(t,e,n,r,a,i){const o=i?e[i]:e[`${n}End`],s=e[`${n}Start`];s&&o&&f(t,{op:"browser",origin:"auto.browser.browser.metrics",description:a||n,startTimestamp:r+T(s),endTimestamp:r+T(o)})}function w(t,e,n,r){const a=e[n];null!=a&&a<h&&(t[r]=a)}var D=n(7522),E=n(5659),C=n(454),O=n(1394),N=n(5322),R=n(7321),L=n(9181),P=n(7597);function x(t,e,n,r,a="auto.http.browser"){if(!(0,D.z)()||!t.fetchData)return;const i=e(t.fetchData.url);if(t.endTimestamp&&i){const e=t.fetchData.__span;if(!e)return;const n=r[e];if(n){if(t.response){n.setHttpStatus(t.response.status);const e=t.response&&t.response.headers&&t.response.headers.get("content-length");if(e){const t=parseInt(e);t>0&&n.setData("http.response_content_length",t)}}else t.error&&n.setStatus("internal_error");n.finish(),delete r[e]}return}const o=(0,E.Gd)(),c=o.getScope(),u=o.getClient(),d=c.getSpan(),{method:p,url:l}=t.fetchData,g=i&&d?d.startChild({data:{url:l,type:"fetch","http.method":p},description:`${p} ${l}`,op:"http.client",origin:a}):void 0;if(g&&(t.fetchData.__span=g.spanId,r[g.spanId]=g),n(t.fetchData.url)&&u){const e=t.args[0];t.args[1]=t.args[1]||{};const n=t.args[1];n.headers=function(t,e,n,r,a){const i=a||n.getSpan(),o=i&&i.transaction,{traceId:c,sampled:u,dsc:d}=n.getPropagationContext(),p=i?i.toTraceparent():(0,s.$p)(c,void 0,u),l=o?o.getDynamicSamplingContext():d||(0,C._)(c,e,n),g=(0,L.IQ)(l),m="undefined"!==typeof Request&&(0,P.V9)(t,Request)?t.headers:r.headers;if(m){if("undefined"!==typeof Headers&&(0,P.V9)(m,Headers)){const t=new Headers(m);return t.append("sentry-trace",p),g&&t.append(L.bU,g),t}if(Array.isArray(m)){const t=[...m,["sentry-trace",p]];return g&&t.push([L.bU,g]),t}{const t="baggage"in m?m.baggage:void 0,e=[];return Array.isArray(t)?e.push(...t):t&&e.push(t),g&&e.push(g),{...m,"sentry-trace":p,baggage:e.length>0?e.join(","):void 0}}}return{"sentry-trace":p,baggage:g}}(e,u,c,n,g)}return g}const $=["localhost",/^\/(?!\/)/],H={traceFetch:!0,traceXHR:!0,enableHTTPTimings:!0,tracingOrigins:$,tracePropagationTargets:$};function X(t){const{traceFetch:e,traceXHR:n,tracePropagationTargets:r,tracingOrigins:a,shouldCreateSpanForRequest:i,enableHTTPTimings:o}={traceFetch:H.traceFetch,traceXHR:H.traceXHR,...t},c="function"===typeof i?i:t=>!0,u=t=>function(t,e){return(0,R.U0)(t,e||$)}(t,r||a),d={};e&&(0,O.U)((t=>{const e=x(t,c,u,d);o&&e&&q(e)})),n&&(0,N.UK)((t=>{const e=function(t,e,n,r){const a=t.xhr,i=a&&a[N.xU];if(!(0,D.z)()||!a||a.__sentry_own_request__||!i)return;const o=e(i.url);if(t.endTimestamp&&o){const t=a.__sentry_xhr_span_id__;if(!t)return;const e=r[t];return void(e&&void 0!==i.status_code&&(e.setHttpStatus(i.status_code),e.finish(),delete r[t]))}const c=(0,E.Gd)(),u=c.getScope(),d=u.getSpan(),p=o&&d?d.startChild({data:{type:"xhr","http.method":i.method,url:i.url},description:`${i.method} ${i.url}`,op:"http.client",origin:"auto.http.browser"}):void 0;p&&(a.__sentry_xhr_span_id__=p.spanId,r[a.__sentry_xhr_span_id__]=p);if(a.setRequestHeader&&n(i.url))if(p){const t=p&&p.transaction,e=t&&t.getDynamicSamplingContext(),n=(0,L.IQ)(e);M(a,p.toTraceparent(),n)}else{const t=c.getClient(),{traceId:e,sampled:n,dsc:r}=u.getPropagationContext(),i=(0,s.$p)(e,void 0,n),o=r||(t?(0,C._)(e,t,u):void 0);M(a,i,(0,L.IQ)(o))}return p}(t,c,u,d);o&&e&&q(e)}))}function q(t){const e=t.data.url;if(!e)return;const n=(0,l._j)("resource",(({entries:r})=>{r.forEach((r=>{if(function(t){return"resource"===t.entryType&&"initiatorType"in t&&"string"===typeof t.nextHopProtocol&&("fetch"===t.initiatorType||"xmlhttprequest"===t.initiatorType)}(r)&&r.name.endsWith(e)){(function(t){const{name:e,version:n}=function(t){let e="unknown",n="unknown",r="";for(const a of t){if("/"===a){[e,n]=t.split("/");break}if(!isNaN(Number(a))){e="h"===r?"http":r,n=t.split(r)[1];break}r+=a}r===t&&(e=r);return{name:e,version:n}}(t.nextHopProtocol),r=[];if(r.push(["network.protocol.version",n],["network.protocol.name",e]),!p.Z1)return r;return[...r,["http.request.redirect_start",A(t.redirectStart)],["http.request.fetch_start",A(t.fetchStart)],["http.request.domain_lookup_start",A(t.domainLookupStart)],["http.request.domain_lookup_end",A(t.domainLookupEnd)],["http.request.connect_start",A(t.connectStart)],["http.request.secure_connection_start",A(t.secureConnectionStart)],["http.request.connection_end",A(t.connectEnd)],["http.request.request_start",A(t.requestStart)],["http.request.response_start",A(t.responseStart)],["http.request.response_end",A(t.responseEnd)]]})(r).forEach((e=>t.setData(...e))),setTimeout(n)}}))}))}function A(t=0){return((p.Z1||performance.timeOrigin)+t)/1e3}function M(t,e,n){try{t.setRequestHeader("sentry-trace",e),n&&t.setRequestHeader(L.bU,n)}catch(r){}}var F=n(734);const B={...r.AT,markBackgroundTransactions:!0,routingInstrumentation:function(t,e=!0,n=!0){if(!d.WINDOW||!d.WINDOW.location)return void(u.X&&o.kg.warn("Could not initialize routing instrumentation due to invalid location"));let r,a=d.WINDOW.location.href;e&&(r=t({name:d.WINDOW.location.pathname,startTimestamp:p.Z1?p.Z1/1e3:void 0,op:"pageload",origin:"auto.pageload.browser",metadata:{source:"url"}})),n&&(0,F.a)((({to:e,from:n})=>{void 0===n&&a&&-1!==a.indexOf(e)?a=void 0:n!==e&&(a=void 0,r&&(u.X&&o.kg.log(`[Tracing] Finishing current transaction with op: ${r.op}`),r.finish()),r=t({name:d.WINDOW.location.pathname,op:"navigation",origin:"auto.navigation.browser",metadata:{source:"url"}}))}))},startTransactionOnLocationChange:!0,startTransactionOnPageLoad:!0,enableLongTask:!0,_experiments:{},...H};class z{constructor(t){this.name="BrowserTracing",this._hasSetTracePropagationTargets=!1,(0,a.T)(),u.X&&(this._hasSetTracePropagationTargets=!(!t||!t.tracePropagationTargets&&!t.tracingOrigins)),this.options={...B,...t},void 0!==this.options._experiments.enableLongTask&&(this.options.enableLongTask=this.options._experiments.enableLongTask),t&&!t.tracePropagationTargets&&t.tracingOrigins&&(this.options.tracePropagationTargets=t.tracingOrigins),this._collectWebVitals=S(),this.options.enableLongTask&&(0,l._j)("longtask",(({entries:t})=>{for(const e of t){const t=(0,i.x1)();if(!t)return;const n=T(p.Z1+e.startTime),r=T(e.duration);t.startChild({description:"Main UI thread blocked",op:"ui.long-task",origin:"auto.ui.browser.metrics",startTimestamp:n,endTimestamp:n+r})}})),this.options._experiments.enableInteractions&&(0,l._j)("event",(({entries:t})=>{for(const e of t){const t=(0,i.x1)();if(!t)return;if("click"===e.name){const n=T(p.Z1+e.startTime),r=T(e.duration);t.startChild({description:(0,c.Rt)(e.target),op:`ui.interaction.${e.name}`,origin:"auto.ui.browser.metrics",startTimestamp:n,endTimestamp:n+r})}}}))}setupOnce(t,e){this._getCurrentHub=e;const n=e().getClient(),r=n&&n.getOptions(),{routingInstrumentation:a,startTransactionOnLocationChange:s,startTransactionOnPageLoad:c,markBackgroundTransactions:p,traceFetch:l,traceXHR:g,shouldCreateSpanForRequest:m,enableHTTPTimings:f,_experiments:h}=this.options,T=r&&r.tracePropagationTargets,v=T||this.options.tracePropagationTargets;u.X&&this._hasSetTracePropagationTargets&&T&&o.kg.warn("[Tracing] The `tracePropagationTargets` option was set in the BrowserTracing integration and top level `Sentry.init`. The top level `Sentry.init` value is being used."),a((t=>{const n=this._createRouteTransaction(t);return this.options._experiments.onStartRouteTransaction&&this.options._experiments.onStartRouteTransaction(n,t,e),n}),c,s),p&&(d.WINDOW&&d.WINDOW.document?d.WINDOW.document.addEventListener("visibilitychange",(()=>{const t=(0,i.x1)();if(d.WINDOW.document.hidden&&t){const e="cancelled";u.X&&o.kg.log(`[Tracing] Transaction: ${e} -> since tab moved to the background, op: ${t.op}`),t.status||t.setStatus(e),t.setTag("visibilitychange","document.hidden"),t.finish()}})):u.X&&o.kg.warn("[Tracing] Could not set up background tab detection due to lack of global document")),h.enableInteractions&&this._registerInteractionListener(),X({traceFetch:l,traceXHR:g,tracePropagationTargets:v,shouldCreateSpanForRequest:m,enableHTTPTimings:f})}_createRouteTransaction(t){if(!this._getCurrentHub)return void(u.X&&o.kg.warn(`[Tracing] Did not create ${t.op} transaction because _getCurrentHub is invalid.`));const e=this._getCurrentHub(),{beforeNavigate:n,idleTimeout:r,finalTimeout:i,heartbeatInterval:c}=this.options,p="pageload"===t.op,l=p?U("sentry-trace"):"",g=p?U("baggage"):"",{traceparentData:m,dynamicSamplingContext:f,propagationContext:h}=(0,s.KA)(l,g),T={...t,...m,metadata:{...t.metadata,dynamicSamplingContext:m&&!f?{}:f},trimEnd:!0},v="function"===typeof n?n(T):T,_=void 0===v?{...T,sampled:!1}:v;_.metadata=_.name!==T.name?{..._.metadata,source:"custom"}:_.metadata,this._latestRouteName=_.name,this._latestRouteSource=_.metadata&&_.metadata.source,!1===_.sampled&&u.X&&o.kg.log(`[Tracing] Will not send ${_.op} transaction because of beforeNavigate.`),u.X&&o.kg.log(`[Tracing] Starting ${_.op} transaction on scope`);const{location:b}=d.WINDOW,y=(0,a.l)(e,_,r,i,!0,{location:b},c),k=e.getScope();return p&&m?k.setPropagationContext(h):k.setPropagationContext({traceId:y.traceId,spanId:y.spanId,parentSpanId:y.parentSpanId,sampled:y.sampled}),y.registerBeforeFinishCallback((t=>{this._collectWebVitals(),I(t)})),y}_registerInteractionListener(){let t;const e=()=>{const{idleTimeout:e,finalTimeout:n,heartbeatInterval:r}=this.options,s="ui.action.click",c=(0,i.x1)();if(c&&c.op&&["navigation","pageload"].includes(c.op))return void(u.X&&o.kg.warn(`[Tracing] Did not create ${s} transaction because a pageload or navigation transaction is in progress.`));if(t&&(t.setFinishReason("interactionInterrupted"),t.finish(),t=void 0),!this._getCurrentHub)return void(u.X&&o.kg.warn(`[Tracing] Did not create ${s} transaction because _getCurrentHub is invalid.`));if(!this._latestRouteName)return void(u.X&&o.kg.warn(`[Tracing] Did not create ${s} transaction because _latestRouteName is missing.`));const p=this._getCurrentHub(),{location:l}=d.WINDOW,g={name:this._latestRouteName,op:s,trimEnd:!0,metadata:{source:this._latestRouteSource||"url"}};t=(0,a.l)(p,g,e,n,!0,{location:l},r)};["click"].forEach((t=>{addEventListener(t,e,{once:!1,capture:!0})}))}}function U(t){const e=(0,c.qT)(`meta[name=${t}]`);return e?e.getAttribute("content"):void 0}},5363:(t,e,n)=>{n.d(e,{PR:()=>S,to:()=>W,$A:()=>I,_j:()=>w});var r=n(2343),a=n(360),i=n(7513);const o=(t,e,n)=>{let r,a;return i=>{e.value>=0&&(i||n)&&(a=e.value-(r||0),(a||void 0===r)&&(r=e.value,e.delta=a,t(e)))}};var s=n(3821);const c=()=>s.WINDOW.__WEB_VITALS_POLYFILL__?s.WINDOW.performance&&(performance.getEntriesByType&&performance.getEntriesByType("navigation")[0]||(()=>{const t=s.WINDOW.performance.timing,e=s.WINDOW.performance.navigation.type,n={entryType:"navigation",startTime:0,type:2==e?"back_forward":1===e?"reload":"navigate"};for(const r in t)"navigationStart"!==r&&"toJSON"!==r&&(n[r]=Math.max(t[r]-t.navigationStart,0));return n})()):s.WINDOW.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0],u=()=>{const t=c();return t&&t.activationStart||0},d=(t,e)=>{const n=c();let r="navigate";return n&&(r=s.WINDOW.document.prerendering||u()>0?"prerender":n.type.replace(/_/g,"-")),{name:t,value:"undefined"===typeof e?-1:e,rating:"good",delta:0,entries:[],id:`v3-${Date.now()}-${Math.floor(8999999999999*Math.random())+1e12}`,navigationType:r}},p=(t,e,n)=>{try{if(PerformanceObserver.supportedEntryTypes.includes(t)){const r=new PerformanceObserver((t=>{e(t.getEntries())}));return r.observe(Object.assign({type:t,buffered:!0},n||{})),r}}catch(r){}};var l=n(188);const g=t=>{const e=d("CLS",0);let n,r=0,a=[];const i=t=>{t.forEach((t=>{if(!t.hadRecentInput){const i=a[0],o=a[a.length-1];r&&0!==a.length&&t.startTime-o.startTime<1e3&&t.startTime-i.startTime<5e3?(r+=t.value,a.push(t)):(r=t.value,a=[t]),r>e.value&&(e.value=r,e.entries=a,n&&n())}}))},s=p("layout-shift",i);if(s){n=o(t,e);const r=()=>{i(s.takeRecords()),n(!0)};return(0,l.u)(r),r}};var m=n(5029);const f=t=>{const e=(0,m.Y)(),n=d("FID");let r;const a=t=>{t.startTime<e.firstHiddenTime&&(n.value=t.processingStart-t.startTime,n.entries.push(t),r(!0))},i=t=>{t.forEach(a)},s=p("first-input",i);r=o(t,n),s&&(0,l.u)((()=>{i(s.takeRecords()),s.disconnect()}),!0)},h={},T=t=>{const e=(0,m.Y)(),n=d("LCP");let r;const a=t=>{const a=t[t.length-1];if(a){const t=Math.max(a.startTime-u(),0);t<e.firstHiddenTime&&(n.value=t,n.entries=[a],r())}},i=p("largest-contentful-paint",a);if(i){r=o(t,n);const e=()=>{h[n.id]||(a(i.takeRecords()),i.disconnect(),h[n.id]=!0,r(!0))};return["keydown","click"].forEach((t=>{addEventListener(t,e,{once:!0,capture:!0})})),(0,l.u)(e,!0),e}},v={},_={};let b,y,k;function S(t){return N("cls",t,E,b)}function I(t){return N("lcp",t,O,k)}function W(t){return N("fid",t,C,y)}function w(t,e){return R(t,e),_[t]||(!function(t){const e={};"event"===t&&(e.durationThreshold=0);p(t,(e=>{D(t,{entries:e})}),e)}(t),_[t]=!0),L(t,e)}function D(t,e){const n=v[t];if(n&&n.length)for(const s of n)try{s(e)}catch(o){i.X&&r.kg.error(`Error while triggering instrumentation handler.\nType: ${t}\nName: ${(0,a.$P)(s)}\nError:`,o)}}function E(){g((t=>{D("cls",{metric:t}),b=t}))}function C(){f((t=>{D("fid",{metric:t}),y=t}))}function O(){T((t=>{D("lcp",{metric:t}),k=t}))}function N(t,e,n,r){return R(t,e),_[t]||(n(),_[t]=!0),r&&e({metric:r}),L(t,e)}function R(t,e){v[t]=v[t]||[],v[t].push(e)}function L(t,e){return()=>{const n=v[t];if(!n)return;const r=n.indexOf(e);-1!==r&&n.splice(r,1)}}},3821:(t,e,n)=>{n.d(e,{WINDOW:()=>r});const r=n(1235).n2},5029:(t,e,n)=>{n.d(e,{Y:()=>o});var r=n(3821),a=n(188);let i=-1;const o=()=>(i<0&&(i="hidden"!==r.WINDOW.document.visibilityState||r.WINDOW.document.prerendering?1/0:0,(0,a.u)((({timeStamp:t})=>{i=t}),!0)),{get firstHiddenTime(){return i}})},188:(t,e,n)=>{n.d(e,{u:()=>a});var r=n(3821);const a=(t,e)=>{const n=a=>{"pagehide"!==a.type&&"hidden"!==r.WINDOW.document.visibilityState||(t(a),e&&(removeEventListener("visibilitychange",n,!0),removeEventListener("pagehide",n,!0)))};addEventListener("visibilitychange",n,!0),addEventListener("pagehide",n,!0)}},7513:(t,e,n)=>{n.d(e,{X:()=>r});const r="undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__}}]); +!function(){try{var t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},e=(new Error).stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="d32caf6b-6d81-49dc-af3e-c8ab5f320308",t._sentryDebugIdIdentifier="sentry-dbid-d32caf6b-6d81-49dc-af3e-c8ab5f320308")}catch(t){}}();var _global="undefined"!==typeof window?window:"undefined"!==typeof global?global:"undefined"!==typeof self?self:{};_global.SENTRY_RELEASE={id:"a2b8e2612b2ee50152f1f5ccf84a620164236ffa"},(self.webpackChunklocal_services_lookup=self.webpackChunklocal_services_lookup||[]).push([[152],{9766:(t,e,n)=>{n.d(e,{gE:()=>z});var r=n(5544),a=n(2931),i=n(9791),o=n(2343),s=n(7638),c=n(8464),u=n(7513),d=n(3821);var p=n(1170),l=n(5363),g=n(5029);function m(t){return"number"===typeof t&&isFinite(t)}function f(t,{startTimestamp:e,...n}){return e&&t.startTimestamp>e&&(t.startTimestamp=e),t.startChild({startTimestamp:e,...n})}const h=2147483647;function T(t){return t/1e3}function v(){return d.WINDOW&&d.WINDOW.addEventListener&&d.WINDOW.performance}let _,b,y=0,k={};function S(){const t=v();if(t&&p.Z1){t.mark&&d.WINDOW.performance.mark("sentry-tracing-init");const e=(0,l.to)((({metric:t})=>{const e=t.entries.pop();if(!e)return;const n=T(p.Z1),r=T(e.startTime);u.X&&o.kg.log("[Measurements] Adding FID"),k.fid={value:t.value,unit:"millisecond"},k["mark.fid"]={value:n+r,unit:"second"}})),n=(0,l.PR)((({metric:t})=>{const e=t.entries.pop();e&&(u.X&&o.kg.log("[Measurements] Adding CLS"),k.cls={value:t.value,unit:""},b=e)})),r=(0,l.$A)((({metric:t})=>{const e=t.entries.pop();e&&(u.X&&o.kg.log("[Measurements] Adding LCP"),k.lcp={value:t.value,unit:"millisecond"},_=e)}));return()=>{e(),n(),r()}}return()=>{}}function I(t){const e=v();if(!e||!d.WINDOW.performance.getEntries||!p.Z1)return;u.X&&o.kg.log("[Tracing] Adding & adjusting spans using Performance API");const n=T(p.Z1),r=e.getEntries();let a,i;if(r.slice(y).forEach((e=>{const r=T(e.startTime),s=T(e.duration);if(!("navigation"===t.op&&n+r<t.startTimestamp))switch(e.entryType){case"navigation":!function(t,e,n){["unloadEvent","redirect","domContentLoadedEvent","loadEvent","connect"].forEach((r=>{W(t,e,r,n)})),W(t,e,"secureConnection",n,"TLS/SSL","connectEnd"),W(t,e,"fetch",n,"cache","domainLookupStart"),W(t,e,"domainLookup",n,"DNS"),function(t,e,n){f(t,{op:"browser",origin:"auto.browser.browser.metrics",description:"request",startTimestamp:n+T(e.requestStart),endTimestamp:n+T(e.responseEnd)}),f(t,{op:"browser",origin:"auto.browser.browser.metrics",description:"response",startTimestamp:n+T(e.responseStart),endTimestamp:n+T(e.responseEnd)})}(t,e,n)}(t,e,n),a=n+T(e.responseStart),i=n+T(e.requestStart);break;case"mark":case"paint":case"measure":{!function(t,e,n,r,a){const i=a+n,o=i+r;f(t,{description:e.name,endTimestamp:o,op:e.entryType,origin:"auto.resource.browser.metrics",startTimestamp:i})}(t,e,r,s,n);const a=(0,g.Y)(),i=e.startTime<a.firstHiddenTime;"first-paint"===e.name&&i&&(u.X&&o.kg.log("[Measurements] Adding FP"),k.fp={value:e.startTime,unit:"millisecond"}),"first-contentful-paint"===e.name&&i&&(u.X&&o.kg.log("[Measurements] Adding FCP"),k.fcp={value:e.startTime,unit:"millisecond"});break}case"resource":{const a=e.name.replace(d.WINDOW.location.origin,"");!function(t,e,n,r,a,i){if("xmlhttprequest"===e.initiatorType||"fetch"===e.initiatorType)return;const o={};w(o,e,"transferSize","http.response_transfer_size"),w(o,e,"encodedBodySize","http.response_content_length"),w(o,e,"decodedBodySize","http.decoded_response_content_length"),"renderBlockingStatus"in e&&(o["resource.render_blocking_status"]=e.renderBlockingStatus);const s=i+r,c=s+a;f(t,{description:n,endTimestamp:c,op:e.initiatorType?`resource.${e.initiatorType}`:"resource.other",origin:"auto.resource.browser.metrics",startTimestamp:s,data:o})}(t,e,a,r,s,n);break}}})),y=Math.max(r.length-1,0),function(t){const e=d.WINDOW.navigator;if(!e)return;const n=e.connection;n&&(n.effectiveType&&t.setTag("effectiveConnectionType",n.effectiveType),n.type&&t.setTag("connectionType",n.type),m(n.rtt)&&(k["connection.rtt"]={value:n.rtt,unit:"millisecond"}));m(e.deviceMemory)&&t.setTag("deviceMemory",`${e.deviceMemory} GB`);m(e.hardwareConcurrency)&&t.setTag("hardwareConcurrency",String(e.hardwareConcurrency))}(t),"pageload"===t.op){"number"===typeof a&&(u.X&&o.kg.log("[Measurements] Adding TTFB"),k.ttfb={value:1e3*(a-t.startTimestamp),unit:"millisecond"},"number"===typeof i&&i<=a&&(k["ttfb.requestTime"]={value:1e3*(a-i),unit:"millisecond"})),["fcp","fp","lcp"].forEach((e=>{if(!k[e]||n>=t.startTimestamp)return;const r=k[e].value,a=n+T(r),i=Math.abs(1e3*(a-t.startTimestamp)),s=i-r;u.X&&o.kg.log(`[Measurements] Normalized ${e} from ${r} to ${i} (${s})`),k[e].value=i}));const e=k["mark.fid"];e&&k.fid&&(f(t,{description:"first input delay",endTimestamp:e.value+T(k.fid.value),op:"ui.action",origin:"auto.ui.browser.metrics",startTimestamp:e.value}),delete k["mark.fid"]),"fcp"in k||delete k.cls,Object.keys(k).forEach((e=>{t.setMeasurement(e,k[e].value,k[e].unit)})),function(t){_&&(u.X&&o.kg.log("[Measurements] Adding LCP Data"),_.element&&t.setTag("lcp.element",(0,c.Rt)(_.element)),_.id&&t.setTag("lcp.id",_.id),_.url&&t.setTag("lcp.url",_.url.trim().slice(0,200)),t.setTag("lcp.size",_.size));b&&b.sources&&(u.X&&o.kg.log("[Measurements] Adding CLS Data"),b.sources.forEach(((e,n)=>t.setTag(`cls.source.${n+1}`,(0,c.Rt)(e.node)))))}(t)}_=void 0,b=void 0,k={}}function W(t,e,n,r,a,i){const o=i?e[i]:e[`${n}End`],s=e[`${n}Start`];s&&o&&f(t,{op:"browser",origin:"auto.browser.browser.metrics",description:a||n,startTimestamp:r+T(s),endTimestamp:r+T(o)})}function w(t,e,n,r){const a=e[n];null!=a&&a<h&&(t[r]=a)}var D=n(7522),E=n(5659),C=n(454),O=n(1394),N=n(5322),R=n(7321),L=n(9181),P=n(7597);function x(t,e,n,r,a="auto.http.browser"){if(!(0,D.z)()||!t.fetchData)return;const i=e(t.fetchData.url);if(t.endTimestamp&&i){const e=t.fetchData.__span;if(!e)return;const n=r[e];if(n){if(t.response){n.setHttpStatus(t.response.status);const e=t.response&&t.response.headers&&t.response.headers.get("content-length");if(e){const t=parseInt(e);t>0&&n.setData("http.response_content_length",t)}}else t.error&&n.setStatus("internal_error");n.finish(),delete r[e]}return}const o=(0,E.Gd)(),c=o.getScope(),u=o.getClient(),d=c.getSpan(),{method:p,url:l}=t.fetchData,g=i&&d?d.startChild({data:{url:l,type:"fetch","http.method":p},description:`${p} ${l}`,op:"http.client",origin:a}):void 0;if(g&&(t.fetchData.__span=g.spanId,r[g.spanId]=g),n(t.fetchData.url)&&u){const e=t.args[0];t.args[1]=t.args[1]||{};const n=t.args[1];n.headers=function(t,e,n,r,a){const i=a||n.getSpan(),o=i&&i.transaction,{traceId:c,sampled:u,dsc:d}=n.getPropagationContext(),p=i?i.toTraceparent():(0,s.$p)(c,void 0,u),l=o?o.getDynamicSamplingContext():d||(0,C._)(c,e,n),g=(0,L.IQ)(l),m="undefined"!==typeof Request&&(0,P.V9)(t,Request)?t.headers:r.headers;if(m){if("undefined"!==typeof Headers&&(0,P.V9)(m,Headers)){const t=new Headers(m);return t.append("sentry-trace",p),g&&t.append(L.bU,g),t}if(Array.isArray(m)){const t=[...m,["sentry-trace",p]];return g&&t.push([L.bU,g]),t}{const t="baggage"in m?m.baggage:void 0,e=[];return Array.isArray(t)?e.push(...t):t&&e.push(t),g&&e.push(g),{...m,"sentry-trace":p,baggage:e.length>0?e.join(","):void 0}}}return{"sentry-trace":p,baggage:g}}(e,u,c,n,g)}return g}const $=["localhost",/^\/(?!\/)/],H={traceFetch:!0,traceXHR:!0,enableHTTPTimings:!0,tracingOrigins:$,tracePropagationTargets:$};function X(t){const{traceFetch:e,traceXHR:n,tracePropagationTargets:r,tracingOrigins:a,shouldCreateSpanForRequest:i,enableHTTPTimings:o}={traceFetch:H.traceFetch,traceXHR:H.traceXHR,...t},c="function"===typeof i?i:t=>!0,u=t=>function(t,e){return(0,R.U0)(t,e||$)}(t,r||a),d={};e&&(0,O.U)((t=>{const e=x(t,c,u,d);o&&e&&q(e)})),n&&(0,N.UK)((t=>{const e=function(t,e,n,r){const a=t.xhr,i=a&&a[N.xU];if(!(0,D.z)()||!a||a.__sentry_own_request__||!i)return;const o=e(i.url);if(t.endTimestamp&&o){const t=a.__sentry_xhr_span_id__;if(!t)return;const e=r[t];return void(e&&void 0!==i.status_code&&(e.setHttpStatus(i.status_code),e.finish(),delete r[t]))}const c=(0,E.Gd)(),u=c.getScope(),d=u.getSpan(),p=o&&d?d.startChild({data:{type:"xhr","http.method":i.method,url:i.url},description:`${i.method} ${i.url}`,op:"http.client",origin:"auto.http.browser"}):void 0;p&&(a.__sentry_xhr_span_id__=p.spanId,r[a.__sentry_xhr_span_id__]=p);if(a.setRequestHeader&&n(i.url))if(p){const t=p&&p.transaction,e=t&&t.getDynamicSamplingContext(),n=(0,L.IQ)(e);M(a,p.toTraceparent(),n)}else{const t=c.getClient(),{traceId:e,sampled:n,dsc:r}=u.getPropagationContext(),i=(0,s.$p)(e,void 0,n),o=r||(t?(0,C._)(e,t,u):void 0);M(a,i,(0,L.IQ)(o))}return p}(t,c,u,d);o&&e&&q(e)}))}function q(t){const e=t.data.url;if(!e)return;const n=(0,l._j)("resource",(({entries:r})=>{r.forEach((r=>{if(function(t){return"resource"===t.entryType&&"initiatorType"in t&&"string"===typeof t.nextHopProtocol&&("fetch"===t.initiatorType||"xmlhttprequest"===t.initiatorType)}(r)&&r.name.endsWith(e)){(function(t){const{name:e,version:n}=function(t){let e="unknown",n="unknown",r="";for(const a of t){if("/"===a){[e,n]=t.split("/");break}if(!isNaN(Number(a))){e="h"===r?"http":r,n=t.split(r)[1];break}r+=a}r===t&&(e=r);return{name:e,version:n}}(t.nextHopProtocol),r=[];if(r.push(["network.protocol.version",n],["network.protocol.name",e]),!p.Z1)return r;return[...r,["http.request.redirect_start",A(t.redirectStart)],["http.request.fetch_start",A(t.fetchStart)],["http.request.domain_lookup_start",A(t.domainLookupStart)],["http.request.domain_lookup_end",A(t.domainLookupEnd)],["http.request.connect_start",A(t.connectStart)],["http.request.secure_connection_start",A(t.secureConnectionStart)],["http.request.connection_end",A(t.connectEnd)],["http.request.request_start",A(t.requestStart)],["http.request.response_start",A(t.responseStart)],["http.request.response_end",A(t.responseEnd)]]})(r).forEach((e=>t.setData(...e))),setTimeout(n)}}))}))}function A(t=0){return((p.Z1||performance.timeOrigin)+t)/1e3}function M(t,e,n){try{t.setRequestHeader("sentry-trace",e),n&&t.setRequestHeader(L.bU,n)}catch(r){}}var F=n(734);const B={...r.AT,markBackgroundTransactions:!0,routingInstrumentation:function(t,e=!0,n=!0){if(!d.WINDOW||!d.WINDOW.location)return void(u.X&&o.kg.warn("Could not initialize routing instrumentation due to invalid location"));let r,a=d.WINDOW.location.href;e&&(r=t({name:d.WINDOW.location.pathname,startTimestamp:p.Z1?p.Z1/1e3:void 0,op:"pageload",origin:"auto.pageload.browser",metadata:{source:"url"}})),n&&(0,F.a)((({to:e,from:n})=>{void 0===n&&a&&-1!==a.indexOf(e)?a=void 0:n!==e&&(a=void 0,r&&(u.X&&o.kg.log(`[Tracing] Finishing current transaction with op: ${r.op}`),r.finish()),r=t({name:d.WINDOW.location.pathname,op:"navigation",origin:"auto.navigation.browser",metadata:{source:"url"}}))}))},startTransactionOnLocationChange:!0,startTransactionOnPageLoad:!0,enableLongTask:!0,_experiments:{},...H};class z{constructor(t){this.name="BrowserTracing",this._hasSetTracePropagationTargets=!1,(0,a.T)(),u.X&&(this._hasSetTracePropagationTargets=!(!t||!t.tracePropagationTargets&&!t.tracingOrigins)),this.options={...B,...t},void 0!==this.options._experiments.enableLongTask&&(this.options.enableLongTask=this.options._experiments.enableLongTask),t&&!t.tracePropagationTargets&&t.tracingOrigins&&(this.options.tracePropagationTargets=t.tracingOrigins),this._collectWebVitals=S(),this.options.enableLongTask&&(0,l._j)("longtask",(({entries:t})=>{for(const e of t){const t=(0,i.x1)();if(!t)return;const n=T(p.Z1+e.startTime),r=T(e.duration);t.startChild({description:"Main UI thread blocked",op:"ui.long-task",origin:"auto.ui.browser.metrics",startTimestamp:n,endTimestamp:n+r})}})),this.options._experiments.enableInteractions&&(0,l._j)("event",(({entries:t})=>{for(const e of t){const t=(0,i.x1)();if(!t)return;if("click"===e.name){const n=T(p.Z1+e.startTime),r=T(e.duration);t.startChild({description:(0,c.Rt)(e.target),op:`ui.interaction.${e.name}`,origin:"auto.ui.browser.metrics",startTimestamp:n,endTimestamp:n+r})}}}))}setupOnce(t,e){this._getCurrentHub=e;const n=e().getClient(),r=n&&n.getOptions(),{routingInstrumentation:a,startTransactionOnLocationChange:s,startTransactionOnPageLoad:c,markBackgroundTransactions:p,traceFetch:l,traceXHR:g,shouldCreateSpanForRequest:m,enableHTTPTimings:f,_experiments:h}=this.options,T=r&&r.tracePropagationTargets,v=T||this.options.tracePropagationTargets;u.X&&this._hasSetTracePropagationTargets&&T&&o.kg.warn("[Tracing] The `tracePropagationTargets` option was set in the BrowserTracing integration and top level `Sentry.init`. The top level `Sentry.init` value is being used."),a((t=>{const n=this._createRouteTransaction(t);return this.options._experiments.onStartRouteTransaction&&this.options._experiments.onStartRouteTransaction(n,t,e),n}),c,s),p&&(d.WINDOW&&d.WINDOW.document?d.WINDOW.document.addEventListener("visibilitychange",(()=>{const t=(0,i.x1)();if(d.WINDOW.document.hidden&&t){const e="cancelled";u.X&&o.kg.log(`[Tracing] Transaction: ${e} -> since tab moved to the background, op: ${t.op}`),t.status||t.setStatus(e),t.setTag("visibilitychange","document.hidden"),t.finish()}})):u.X&&o.kg.warn("[Tracing] Could not set up background tab detection due to lack of global document")),h.enableInteractions&&this._registerInteractionListener(),X({traceFetch:l,traceXHR:g,tracePropagationTargets:v,shouldCreateSpanForRequest:m,enableHTTPTimings:f})}_createRouteTransaction(t){if(!this._getCurrentHub)return void(u.X&&o.kg.warn(`[Tracing] Did not create ${t.op} transaction because _getCurrentHub is invalid.`));const e=this._getCurrentHub(),{beforeNavigate:n,idleTimeout:r,finalTimeout:i,heartbeatInterval:c}=this.options,p="pageload"===t.op,l=p?U("sentry-trace"):"",g=p?U("baggage"):"",{traceparentData:m,dynamicSamplingContext:f,propagationContext:h}=(0,s.KA)(l,g),T={...t,...m,metadata:{...t.metadata,dynamicSamplingContext:m&&!f?{}:f},trimEnd:!0},v="function"===typeof n?n(T):T,_=void 0===v?{...T,sampled:!1}:v;_.metadata=_.name!==T.name?{..._.metadata,source:"custom"}:_.metadata,this._latestRouteName=_.name,this._latestRouteSource=_.metadata&&_.metadata.source,!1===_.sampled&&u.X&&o.kg.log(`[Tracing] Will not send ${_.op} transaction because of beforeNavigate.`),u.X&&o.kg.log(`[Tracing] Starting ${_.op} transaction on scope`);const{location:b}=d.WINDOW,y=(0,a.l)(e,_,r,i,!0,{location:b},c),k=e.getScope();return p&&m?k.setPropagationContext(h):k.setPropagationContext({traceId:y.traceId,spanId:y.spanId,parentSpanId:y.parentSpanId,sampled:y.sampled}),y.registerBeforeFinishCallback((t=>{this._collectWebVitals(),I(t)})),y}_registerInteractionListener(){let t;const e=()=>{const{idleTimeout:e,finalTimeout:n,heartbeatInterval:r}=this.options,s="ui.action.click",c=(0,i.x1)();if(c&&c.op&&["navigation","pageload"].includes(c.op))return void(u.X&&o.kg.warn(`[Tracing] Did not create ${s} transaction because a pageload or navigation transaction is in progress.`));if(t&&(t.setFinishReason("interactionInterrupted"),t.finish(),t=void 0),!this._getCurrentHub)return void(u.X&&o.kg.warn(`[Tracing] Did not create ${s} transaction because _getCurrentHub is invalid.`));if(!this._latestRouteName)return void(u.X&&o.kg.warn(`[Tracing] Did not create ${s} transaction because _latestRouteName is missing.`));const p=this._getCurrentHub(),{location:l}=d.WINDOW,g={name:this._latestRouteName,op:s,trimEnd:!0,metadata:{source:this._latestRouteSource||"url"}};t=(0,a.l)(p,g,e,n,!0,{location:l},r)};["click"].forEach((t=>{addEventListener(t,e,{once:!1,capture:!0})}))}}function U(t){const e=(0,c.qT)(`meta[name=${t}]`);return e?e.getAttribute("content"):void 0}},5363:(t,e,n)=>{n.d(e,{PR:()=>S,to:()=>W,$A:()=>I,_j:()=>w});var r=n(2343),a=n(360),i=n(7513);const o=(t,e,n)=>{let r,a;return i=>{e.value>=0&&(i||n)&&(a=e.value-(r||0),(a||void 0===r)&&(r=e.value,e.delta=a,t(e)))}};var s=n(3821);const c=()=>s.WINDOW.__WEB_VITALS_POLYFILL__?s.WINDOW.performance&&(performance.getEntriesByType&&performance.getEntriesByType("navigation")[0]||(()=>{const t=s.WINDOW.performance.timing,e=s.WINDOW.performance.navigation.type,n={entryType:"navigation",startTime:0,type:2==e?"back_forward":1===e?"reload":"navigate"};for(const r in t)"navigationStart"!==r&&"toJSON"!==r&&(n[r]=Math.max(t[r]-t.navigationStart,0));return n})()):s.WINDOW.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0],u=()=>{const t=c();return t&&t.activationStart||0},d=(t,e)=>{const n=c();let r="navigate";return n&&(r=s.WINDOW.document.prerendering||u()>0?"prerender":n.type.replace(/_/g,"-")),{name:t,value:"undefined"===typeof e?-1:e,rating:"good",delta:0,entries:[],id:`v3-${Date.now()}-${Math.floor(8999999999999*Math.random())+1e12}`,navigationType:r}},p=(t,e,n)=>{try{if(PerformanceObserver.supportedEntryTypes.includes(t)){const r=new PerformanceObserver((t=>{e(t.getEntries())}));return r.observe(Object.assign({type:t,buffered:!0},n||{})),r}}catch(r){}};var l=n(188);const g=t=>{const e=d("CLS",0);let n,r=0,a=[];const i=t=>{t.forEach((t=>{if(!t.hadRecentInput){const i=a[0],o=a[a.length-1];r&&0!==a.length&&t.startTime-o.startTime<1e3&&t.startTime-i.startTime<5e3?(r+=t.value,a.push(t)):(r=t.value,a=[t]),r>e.value&&(e.value=r,e.entries=a,n&&n())}}))},s=p("layout-shift",i);if(s){n=o(t,e);const r=()=>{i(s.takeRecords()),n(!0)};return(0,l.u)(r),r}};var m=n(5029);const f=t=>{const e=(0,m.Y)(),n=d("FID");let r;const a=t=>{t.startTime<e.firstHiddenTime&&(n.value=t.processingStart-t.startTime,n.entries.push(t),r(!0))},i=t=>{t.forEach(a)},s=p("first-input",i);r=o(t,n),s&&(0,l.u)((()=>{i(s.takeRecords()),s.disconnect()}),!0)},h={},T=t=>{const e=(0,m.Y)(),n=d("LCP");let r;const a=t=>{const a=t[t.length-1];if(a){const t=Math.max(a.startTime-u(),0);t<e.firstHiddenTime&&(n.value=t,n.entries=[a],r())}},i=p("largest-contentful-paint",a);if(i){r=o(t,n);const e=()=>{h[n.id]||(a(i.takeRecords()),i.disconnect(),h[n.id]=!0,r(!0))};return["keydown","click"].forEach((t=>{addEventListener(t,e,{once:!0,capture:!0})})),(0,l.u)(e,!0),e}},v={},_={};let b,y,k;function S(t){return N("cls",t,E,b)}function I(t){return N("lcp",t,O,k)}function W(t){return N("fid",t,C,y)}function w(t,e){return R(t,e),_[t]||(!function(t){const e={};"event"===t&&(e.durationThreshold=0);p(t,(e=>{D(t,{entries:e})}),e)}(t),_[t]=!0),L(t,e)}function D(t,e){const n=v[t];if(n&&n.length)for(const s of n)try{s(e)}catch(o){i.X&&r.kg.error(`Error while triggering instrumentation handler.\nType: ${t}\nName: ${(0,a.$P)(s)}\nError:`,o)}}function E(){g((t=>{D("cls",{metric:t}),b=t}))}function C(){f((t=>{D("fid",{metric:t}),y=t}))}function O(){T((t=>{D("lcp",{metric:t}),k=t}))}function N(t,e,n,r){return R(t,e),_[t]||(n(),_[t]=!0),r&&e({metric:r}),L(t,e)}function R(t,e){v[t]=v[t]||[],v[t].push(e)}function L(t,e){return()=>{const n=v[t];if(!n)return;const r=n.indexOf(e);-1!==r&&n.splice(r,1)}}},3821:(t,e,n)=>{n.d(e,{WINDOW:()=>r});const r=n(1235).n2},5029:(t,e,n)=>{n.d(e,{Y:()=>o});var r=n(3821),a=n(188);let i=-1;const o=()=>(i<0&&(i="hidden"!==r.WINDOW.document.visibilityState||r.WINDOW.document.prerendering?1/0:0,(0,a.u)((({timeStamp:t})=>{i=t}),!0)),{get firstHiddenTime(){return i}})},188:(t,e,n)=>{n.d(e,{u:()=>a});var r=n(3821);const a=(t,e)=>{const n=a=>{"pagehide"!==a.type&&"hidden"!==r.WINDOW.document.visibilityState||(t(a),e&&(removeEventListener("visibilitychange",n,!0),removeEventListener("pagehide",n,!0)))};addEventListener("visibilitychange",n,!0),addEventListener("pagehide",n,!0)}},7513:(t,e,n)=>{n.d(e,{X:()=>r});const r="undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__}}]); //# sourceMappingURL=vendors.sentry-internal.js.map \ No newline at end of file diff --git a/build/assets/js/vendors.sentry.js b/build/assets/js/vendors.sentry.js index f1e46ca..14f6360 100644 --- a/build/assets/js/vendors.sentry.js +++ b/build/assets/js/vendors.sentry.js @@ -1,2 +1,2 @@ -!function(){try{var t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},e=(new Error).stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="fd04302d-e9db-4c19-854f-2fef3ef1859a",t._sentryDebugIdIdentifier="sentry-dbid-fd04302d-e9db-4c19-854f-2fef3ef1859a")}catch(t){}}();var _global="undefined"!==typeof window?window:"undefined"!==typeof global?global:"undefined"!==typeof self?self:{};_global.SENTRY_RELEASE={id:"b15ccfdbc7e26696234f56eb8df3a6b3a27a7fd6"},(self.webpackChunklocal_services_lookup=self.webpackChunklocal_services_lookup||[]).push([[315],{2181:(t,e,n)=>{n.d(e,{S1:()=>Vt});var r=n(2343),s=n(2844),i=n(7321),o=n(1703);const a=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/],c=[/^.*\/healthcheck$/,/^.*\/healthy$/,/^.*\/live$/,/^.*\/ready$/,/^.*\/heartbeat$/,/^.*\/health$/,/^.*\/healthz$/];class l{static __initStatic(){this.id="InboundFilters"}constructor(t={}){this.name=l.id,this._options=t}setupOnce(t,e){}processEvent(t,e,n){const l=n.getOptions(),d=function(t={},e={}){return{allowUrls:[...t.allowUrls||[],...e.allowUrls||[]],denyUrls:[...t.denyUrls||[],...e.denyUrls||[]],ignoreErrors:[...t.ignoreErrors||[],...e.ignoreErrors||[],...t.disableErrorDefaults?[]:a],ignoreTransactions:[...t.ignoreTransactions||[],...e.ignoreTransactions||[],...t.disableTransactionDefaults?[]:c],ignoreInternal:void 0===t.ignoreInternal||t.ignoreInternal}}(this._options,l);return function(t,e){if(e.ignoreInternal&&function(t){try{return"SentryError"===t.exception.values[0].type}catch(e){}return!1}(t))return o.X&&r.kg.warn(`Event dropped due to being internal Sentry Error.\nEvent: ${(0,s.jH)(t)}`),!0;if(function(t,e){if(t.type||!e||!e.length)return!1;return function(t){const e=[];t.message&&e.push(t.message);let n;try{n=t.exception.values[t.exception.values.length-1]}catch(i){}n&&n.value&&(e.push(n.value),n.type&&e.push(`${n.type}: ${n.value}`));o.X&&0===e.length&&r.kg.error(`Could not extract message for event ${(0,s.jH)(t)}`);return e}(t).some((t=>(0,i.U0)(t,e)))}(t,e.ignoreErrors))return o.X&&r.kg.warn(`Event dropped due to being matched by \`ignoreErrors\` option.\nEvent: ${(0,s.jH)(t)}`),!0;if(function(t,e){if("transaction"!==t.type||!e||!e.length)return!1;const n=t.transaction;return!!n&&(0,i.U0)(n,e)}(t,e.ignoreTransactions))return o.X&&r.kg.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.\nEvent: ${(0,s.jH)(t)}`),!0;if(function(t,e){if(!e||!e.length)return!1;const n=u(t);return!!n&&(0,i.U0)(n,e)}(t,e.denyUrls))return o.X&&r.kg.warn(`Event dropped due to being matched by \`denyUrls\` option.\nEvent: ${(0,s.jH)(t)}.\nUrl: ${u(t)}`),!0;if(!function(t,e){if(!e||!e.length)return!0;const n=u(t);return!n||(0,i.U0)(n,e)}(t,e.allowUrls))return o.X&&r.kg.warn(`Event dropped due to not being matched by \`allowUrls\` option.\nEvent: ${(0,s.jH)(t)}.\nUrl: ${u(t)}`),!0;return!1}(t,d)?null:t}}function u(t){try{let n;try{n=t.exception.values[0].stacktrace.frames}catch(e){}return n?function(t=[]){for(let e=t.length-1;e>=0;e--){const n=t[e];if(n&&"<anonymous>"!==n.filename&&"[native code]"!==n.filename)return n.filename||null}return null}(n):null}catch(n){return o.X&&r.kg.error(`Cannot extract url for event ${(0,s.jH)(t)}`),null}}l.__initStatic();var d=n(535);let h;class p{static __initStatic(){this.id="FunctionToString"}constructor(){this.name=p.id}setupOnce(){h=Function.prototype.toString;try{Function.prototype.toString=function(...t){const e=(0,d.HK)(this)||this;return h.apply(e,t)}}catch(t){}}}p.__initStatic();var m=n(2967),f=n(5659);var g=n(360),y=n(8823),_=n(734),v=n(7893),S=n(105),k=n(8518),b=n(8725),w=n(1170);var E=n(292);const x="undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__;var T=n(7597),I=n(8007),C=n(6893);function R(t,e){const n=O(t,e),r={type:e&&e.name,value:A(e)};return n.length&&(r.stacktrace={frames:n}),void 0===r.type&&""===r.value&&(r.value="Unrecoverable error caught"),r}function M(t,e){return{exception:{values:[R(t,e)]}}}function O(t,e){const n=e.stacktrace||e.stack||"",r=function(t){if(t){if("number"===typeof t.framesToPop)return t.framesToPop;if(D.test(t.message))return 1}return 0}(e);try{return t(n,r)}catch(s){}return[]}const D=/Minified React error #\d+;/i;function A(t){const e=t&&t.message;return e?e.error&&"string"===typeof e.error.message?e.error.message:e:"No error message"}function N(t,e,n,r,i){let o;if((0,T.VW)(e)&&e.error){return M(t,e.error)}if((0,T.TX)(e)||(0,T.fm)(e)){const i=e;if("stack"in e)o=M(t,e);else{const e=i.name||((0,T.TX)(i)?"DOMError":"DOMException"),a=i.message?`${e}: ${i.message}`:e;o=L(t,a,n,r),(0,s.Db)(o,a)}return"code"in i&&(o.tags={...o.tags,"DOMException.code":`${i.code}`}),o}if((0,T.VZ)(e))return M(t,e);if((0,T.PO)(e)||(0,T.cO)(e)){return o=function(t,e,n,r){const s=(0,f.Gd)().getClient(),i=s&&s.getOptions().normalizeDepth,o={exception:{values:[{type:(0,T.cO)(e)?e.constructor.name:r?"UnhandledRejection":"Error",value:$(e,{isUnhandledRejection:r})}]},extra:{__serialized__:(0,I.Qy)(e,i)}};if(n){const e=O(t,n);e.length&&(o.exception.values[0].stacktrace={frames:e})}return o}(t,e,n,i),(0,s.EG)(o,{synthetic:!0}),o}return o=L(t,e,n,r),(0,s.Db)(o,`${e}`,void 0),(0,s.EG)(o,{synthetic:!0}),o}function L(t,e,n,r){const s={message:e};if(r&&n){const r=O(t,n);r.length&&(s.exception={values:[{value:e,stacktrace:{frames:r}}]})}return s}function $(t,{isUnhandledRejection:e}){const n=(0,d.zf)(t),r=e?"promise rejection":"exception";if((0,T.VW)(t))return`Event \`ErrorEvent\` captured as ${r} with message \`${t.message}\``;if((0,T.cO)(t)){return`Event \`${function(t){try{const e=Object.getPrototypeOf(t);return e?e.constructor.name:void 0}catch(e){}}(t)}\` (type=${t.type}) captured as ${r}`}return`Object captured as ${r} with keys: ${n}`}var P=n(4487),F=n(1235);const j=F.n2;let U=0;function B(){return U>0}function H(t,e={},n){if("function"!==typeof t)return t;try{const e=t.__sentry_wrapped__;if(e)return e;if((0,d.HK)(t))return t}catch(i){return t}const r=function(){const r=Array.prototype.slice.call(arguments);try{n&&"function"===typeof n&&n.apply(this,arguments);const s=r.map((t=>H(t,e)));return t.apply(this,s)}catch(i){throw U++,setTimeout((()=>{U--})),(0,P.$e)((t=>{t.addEventProcessor((t=>(e.mechanism&&((0,s.Db)(t,void 0,void 0),(0,s.EG)(t,e.mechanism)),t.extra={...t.extra,arguments:r},t))),(0,P.Tb)(i)})),i}};try{for(const e in t)Object.prototype.hasOwnProperty.call(t,e)&&(r[e]=t[e])}catch(o){}(0,d.$Q)(r,t),(0,d.xp)(t,"__sentry_wrapped__",r);try{Object.getOwnPropertyDescriptor(r,"name").configurable&&Object.defineProperty(r,"name",{get:()=>t.name})}catch(o){}return r}class z extends v.W{constructor(t){const e=j.SENTRY_SDK_SOURCE||(0,k.S)();t._metadata=t._metadata||{},t._metadata.sdk=t._metadata.sdk||{name:"sentry.javascript.browser",packages:[{name:`${e}:@sentry/browser`,version:S.J}],version:S.J},super(t),t.sendClientReports&&j.document&&j.document.addEventListener("visibilitychange",(()=>{"hidden"===j.document.visibilityState&&this._flushOutcomes()}))}eventFromException(t,e){return function(t,e,n,r){const i=N(t,e,n&&n.syntheticException||void 0,r);return(0,s.EG)(i),i.level="error",n&&n.event_id&&(i.event_id=n.event_id),(0,C.WD)(i)}(this._options.stackParser,t,e,this._options.attachStacktrace)}eventFromMessage(t,e="info",n){return function(t,e,n="info",r,s){const i=L(t,e,r&&r.syntheticException||void 0,s);return i.level=n,r&&r.event_id&&(i.event_id=r.event_id),(0,C.WD)(i)}(this._options.stackParser,t,e,n,this._options.attachStacktrace)}captureUserFeedback(t){if(!this._isEnabled())return void(x&&r.kg.warn("SDK not enabled, will not capture user feedback."));const e=function(t,{metadata:e,tunnel:n,dsn:r}){const s={event_id:t.event_id,sent_at:(new Date).toISOString(),...e&&e.sdk&&{sdk:{name:e.sdk.name,version:e.sdk.version}},...!!n&&!!r&&{dsn:(0,E.RA)(r)}},i=function(t){return[{type:"user_report"},t]}(t);return(0,b.Jd)(s,[i])}(t,{metadata:this.getSdkMetadata(),dsn:this.getDsn(),tunnel:this.getOptions().tunnel});this._sendEnvelope(e)}_prepareEvent(t,e,n){return t.platform=t.platform||"javascript",super._prepareEvent(t,e,n)}_flushOutcomes(){const t=this._clearOutcomes();if(0===t.length)return void(x&&r.kg.log("No outcomes to send"));if(!this._dsn)return void(x&&r.kg.log("No dsn provided, will not send outcomes"));x&&r.kg.log("Sending outcomes:",t);const e=function(t,e,n){const r=[{type:"client_report"},{timestamp:n||(0,w.yW)(),discarded_events:t}];return(0,b.Jd)(e?{dsn:e}:{},[r])}(t,this._options.tunnel&&(0,E.RA)(this._dsn));this._sendEnvelope(e)}}var W=n(1674),q=n(7373),X=n(8464);class G{static __initStatic(){this.id="GlobalHandlers"}constructor(t){this.name=G.id,this._options={onerror:!0,onunhandledrejection:!0,...t},this._installFunc={onerror:K,onunhandledrejection:J}}setupOnce(){Error.stackTraceLimit=50;const t=this._options;for(const n in t){const s=this._installFunc[n];s&&t[n]&&(e=n,x&&r.kg.log(`Global Handler attached: ${e}`),s(),this._installFunc[n]=void 0)}var e}}function K(){(0,W.V)((t=>{const[e,n,r]=V();if(!e.getIntegration(G))return;const{msg:s,url:i,line:o,column:a,error:c}=t;if(B())return;const l=void 0===c&&(0,T.HD)(s)?function(t,e,n,r){const s=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;let i=(0,T.VW)(t)?t.message:t,o="Error";const a=i.match(s);a&&(o=a[1],i=a[2]);const c={exception:{values:[{type:o,value:i}]}};return Y(c,e,n,r)}(s,i,o,a):Y(N(n,c||s,void 0,r,!1),i,o,a);l.level="error",e.captureEvent(l,{originalException:c,mechanism:{handled:!1,type:"onerror"}})}))}function J(){(0,q.h)((t=>{const[e,n,r]=V();if(!e.getIntegration(G))return;if(B())return!0;const s=function(t){if((0,T.pt)(t))return t;const e=t;try{if("reason"in e)return e.reason;if("detail"in e&&"reason"in e.detail)return e.detail.reason}catch(n){}return t}(t),i=(0,T.pt)(s)?{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(s)}`}]}}:N(n,s,void 0,r,!0);i.level="error",e.captureEvent(i,{originalException:s,mechanism:{handled:!1,type:"onunhandledrejection"}})}))}function Y(t,e,n,r){const s=t.exception=t.exception||{},i=s.values=s.values||[],o=i[0]=i[0]||{},a=o.stacktrace=o.stacktrace||{},c=a.frames=a.frames||[],l=isNaN(parseInt(r,10))?void 0:r,u=isNaN(parseInt(n,10))?void 0:n,d=(0,T.HD)(e)&&e.length>0?e:(0,X.l4)();return 0===c.length&&c.push({colno:l,filename:d,function:"?",in_app:!0,lineno:u}),t}function V(){const t=(0,f.Gd)(),e=t.getClient(),n=e&&e.getOptions()||{stackParser:()=>[],attachStacktrace:!1};return[t,n.stackParser,n.attachStacktrace]}G.__initStatic();const Q=["EventTarget","Window","Node","ApplicationCache","AudioTrackList","BroadcastChannel","ChannelMergerNode","CryptoOperation","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","KeyOperation","MediaController","MessagePort","ModalWindow","Notification","SVGElementInstance","Screen","SharedWorker","TextTrack","TextTrackCue","TextTrackList","WebSocket","WebSocketWorker","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"];class Z{static __initStatic(){this.id="TryCatch"}constructor(t){this.name=Z.id,this._options={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,...t}}setupOnce(){this._options.setTimeout&&(0,d.hl)(j,"setTimeout",tt),this._options.setInterval&&(0,d.hl)(j,"setInterval",tt),this._options.requestAnimationFrame&&(0,d.hl)(j,"requestAnimationFrame",et),this._options.XMLHttpRequest&&"XMLHttpRequest"in j&&(0,d.hl)(XMLHttpRequest.prototype,"send",nt);const t=this._options.eventTarget;if(t){(Array.isArray(t)?t:Q).forEach(rt)}}}function tt(t){return function(...e){const n=e[0];return e[0]=H(n,{mechanism:{data:{function:(0,g.$P)(t)},handled:!1,type:"instrument"}}),t.apply(this,e)}}function et(t){return function(e){return t.apply(this,[H(e,{mechanism:{data:{function:"requestAnimationFrame",handler:(0,g.$P)(t)},handled:!1,type:"instrument"}})])}}function nt(t){return function(...e){const n=this;return["onload","onerror","onprogress","onreadystatechange"].forEach((t=>{t in n&&"function"===typeof n[t]&&(0,d.hl)(n,t,(function(e){const n={mechanism:{data:{function:t,handler:(0,g.$P)(e)},handled:!1,type:"instrument"}},r=(0,d.HK)(e);return r&&(n.mechanism.data.handler=(0,g.$P)(r)),H(e,n)}))})),t.apply(this,e)}}function rt(t){const e=j,n=e[t]&&e[t].prototype;n&&n.hasOwnProperty&&n.hasOwnProperty("addEventListener")&&((0,d.hl)(n,"addEventListener",(function(e){return function(n,r,s){try{"function"===typeof r.handleEvent&&(r.handleEvent=H(r.handleEvent,{mechanism:{data:{function:"handleEvent",handler:(0,g.$P)(r),target:t},handled:!1,type:"instrument"}}))}catch(i){}return e.apply(this,[n,H(r,{mechanism:{data:{function:"addEventListener",handler:(0,g.$P)(r),target:t},handled:!1,type:"instrument"}}),s])}})),(0,d.hl)(n,"removeEventListener",(function(t){return function(e,n,r){const s=n;try{const n=s&&s.__sentry_wrapped__;n&&t.call(this,e,n,r)}catch(i){}return t.call(this,e,s,r)}})))}Z.__initStatic();var st=n(9729);function it(){"console"in F.n2&&r.RU.forEach((function(t){t in F.n2.console&&(0,d.hl)(F.n2.console,t,(function(e){return r.LD[t]=e,function(...e){const n={args:e,level:t};(0,st.rK)("console",n);const s=r.LD[t];s&&s.apply(F.n2.console,e)}}))}))}var ot=n(5316),at=n(5322),ct=n(1394);const lt=["fatal","error","warning","log","info","debug"];function ut(t){return"warn"===t?"warning":lt.includes(t)?t:"log"}function dt(t){if(!t)return{};const e=t.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!e)return{};const n=e[6]||"",r=e[8]||"";return{host:e[4],path:e[5],protocol:e[2],search:n,hash:r,relative:e[5]+n+r}}const ht=1024;class pt{static __initStatic(){this.id="Breadcrumbs"}constructor(t){this.name=pt.id,this.options={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...t}}setupOnce(){if(this.options.console&&function(t){const e="console";(0,st.Hj)(e,t),(0,st.D2)(e,it)}(ft),this.options.dom&&(0,ot.O)(function(t){function e(e){let n,s="object"===typeof t?t.serializeAttribute:void 0,i="object"===typeof t&&"number"===typeof t.maxStringLength?t.maxStringLength:void 0;i&&i>ht&&(x&&r.kg.warn(`\`dom.maxStringLength\` cannot exceed 1024, but a value of ${i} was configured. Sentry will use 1024 instead.`),i=ht),"string"===typeof s&&(s=[s]);try{const t=e.event;n=function(t){return!!t&&!!t.target}(t)?(0,X.Rt)(t.target,{keyAttrs:s,maxStringLength:i}):(0,X.Rt)(t,{keyAttrs:s,maxStringLength:i})}catch(o){n="<unknown>"}0!==n.length&&(0,f.Gd)().addBreadcrumb({category:`ui.${e.name}`,message:n},{event:e.event,name:e.name,global:e.global})}return e}(this.options.dom)),this.options.xhr&&(0,at.UK)(gt),this.options.fetch&&(0,ct.U)(yt),this.options.history&&(0,_.a)(_t),this.options.sentry){const t=(0,P.s3)();t&&t.on&&t.on("beforeSendEvent",mt)}}}function mt(t){(0,f.Gd)().addBreadcrumb({category:"sentry."+("transaction"===t.type?"transaction":"event"),event_id:t.event_id,level:t.level,message:(0,s.jH)(t)},{event:t})}function ft(t){const e={category:"console",data:{arguments:t.args,logger:"console"},level:ut(t.level),message:(0,i.nK)(t.args," ")};if("assert"===t.level){if(!1!==t.args[0])return;e.message=`Assertion failed: ${(0,i.nK)(t.args.slice(1)," ")||"console.assert"}`,e.data.arguments=t.args.slice(1)}(0,f.Gd)().addBreadcrumb(e,{input:t.args,level:t.level})}function gt(t){const{startTimestamp:e,endTimestamp:n}=t,r=t.xhr[at.xU];if(!e||!n||!r)return;const{method:s,url:i,status_code:o,body:a}=r,c={method:s,url:i,status_code:o},l={xhr:t.xhr,input:a,startTimestamp:e,endTimestamp:n};(0,f.Gd)().addBreadcrumb({category:"xhr",data:c,type:"http"},l)}function yt(t){const{startTimestamp:e,endTimestamp:n}=t;if(n&&(!t.fetchData.url.match(/sentry_key/)||"POST"!==t.fetchData.method))if(t.error){const r=t.fetchData,s={data:t.error,input:t.args,startTimestamp:e,endTimestamp:n};(0,f.Gd)().addBreadcrumb({category:"fetch",data:r,level:"error",type:"http"},s)}else{const r=t.response,s={...t.fetchData,status_code:r&&r.status},i={input:t.args,response:r,startTimestamp:e,endTimestamp:n};(0,f.Gd)().addBreadcrumb({category:"fetch",data:s,type:"http"},i)}}function _t(t){let e=t.from,n=t.to;const r=dt(j.location.href);let s=e?dt(e):void 0;const i=dt(n);s&&s.path||(s=r),r.protocol===i.protocol&&r.host===i.host&&(n=i.relative),r.protocol===s.protocol&&r.host===s.host&&(e=s.relative),(0,f.Gd)().addBreadcrumb({category:"navigation",data:{from:e,to:n}})}function vt(t,e,n=250,r,s,o,a){if(!o.exception||!o.exception.values||!a||!(0,T.V9)(a.originalException,Error))return;const c=o.exception.values.length>0?o.exception.values[o.exception.values.length-1]:void 0;var l,u;c&&(o.exception.values=(l=St(t,e,s,a.originalException,r,o.exception.values,c,0),u=n,l.map((t=>(t.value&&(t.value=(0,i.$G)(t.value,u)),t)))))}function St(t,e,n,r,s,i,o,a){if(i.length>=n+1)return i;let c=[...i];if((0,T.V9)(r[s],Error)){kt(o,a);const i=t(e,r[s]),l=c.length;bt(i,s,l,a),c=St(t,e,n,r[s],s,[i,...c],i,l)}return Array.isArray(r.errors)&&r.errors.forEach(((r,i)=>{if((0,T.V9)(r,Error)){kt(o,a);const l=t(e,r),u=c.length;bt(l,`errors[${i}]`,u,a),c=St(t,e,n,r,s,[l,...c],l,u)}})),c}function kt(t,e){t.mechanism=t.mechanism||{type:"generic",handled:!0},t.mechanism={...t.mechanism,is_exception_group:!0,exception_id:e}}function bt(t,e,n,r){t.mechanism=t.mechanism||{type:"generic",handled:!0},t.mechanism={...t.mechanism,type:"chained",source:e,exception_id:n,parent_id:r}}pt.__initStatic();class wt{static __initStatic(){this.id="LinkedErrors"}constructor(t={}){this.name=wt.id,this._key=t.key||"cause",this._limit=t.limit||5}setupOnce(){}preprocessEvent(t,e,n){const r=n.getOptions();vt(R,r.stackParser,r.maxValueLength,this._key,this._limit,t,e)}}wt.__initStatic();class Et{static __initStatic(){this.id="HttpContext"}constructor(){this.name=Et.id}setupOnce(){}preprocessEvent(t){if(!j.navigator&&!j.location&&!j.document)return;const e=t.request&&t.request.url||j.location&&j.location.href,{referrer:n}=j.document||{},{userAgent:r}=j.navigator||{},s={...t.request&&t.request.headers,...n&&{Referer:n},...r&&{"User-Agent":r}},i={...t.request,...e&&{url:e},headers:s};t.request=i}}Et.__initStatic();class xt{static __initStatic(){this.id="Dedupe"}constructor(){this.name=xt.id}setupOnce(t,e){}processEvent(t){if(t.type)return t;try{if(function(t,e){if(!e)return!1;if(function(t,e){const n=t.message,r=e.message;if(!n&&!r)return!1;if(n&&!r||!n&&r)return!1;if(n!==r)return!1;if(!It(t,e))return!1;if(!Tt(t,e))return!1;return!0}(t,e))return!0;if(function(t,e){const n=Ct(e),r=Ct(t);if(!n||!r)return!1;if(n.type!==r.type||n.value!==r.value)return!1;if(!It(t,e))return!1;if(!Tt(t,e))return!1;return!0}(t,e))return!0;return!1}(t,this._previousEvent))return x&&r.kg.warn("Event dropped due to being a duplicate of previously captured event."),null}catch(e){}return this._previousEvent=t}}function Tt(t,e){let n=Rt(t),r=Rt(e);if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;if(r.length!==n.length)return!1;for(let s=0;s<r.length;s++){const t=r[s],e=n[s];if(t.filename!==e.filename||t.lineno!==e.lineno||t.colno!==e.colno||t.function!==e.function)return!1}return!0}function It(t,e){let n=t.fingerprint,r=e.fingerprint;if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;try{return!(n.join("")!==r.join(""))}catch(s){return!1}}function Ct(t){return t.exception&&t.exception.values&&t.exception.values[0]}function Rt(t){const e=t.exception;if(e)try{return e.values[0].stacktrace.frames}catch(n){return}}xt.__initStatic();const Mt="?";function Ot(t,e,n,r){const s={filename:t,function:e,in_app:!0};return void 0!==n&&(s.lineno=n),void 0!==r&&(s.colno=r),s}const Dt=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,At=/\((\S*)(?::(\d+))(?::(\d+))\)/,Nt=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Lt=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,$t=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:[-a-z]+):.*?):(\d+)(?::(\d+))?\)?\s*$/i,Pt=[[30,t=>{const e=Dt.exec(t);if(e){if(e[2]&&0===e[2].indexOf("eval")){const t=At.exec(e[2]);t&&(e[2]=t[1],e[3]=t[2],e[4]=t[3])}const[t,n]=jt(e[1]||Mt,e[2]);return Ot(n,t,e[3]?+e[3]:void 0,e[4]?+e[4]:void 0)}}],[50,t=>{const e=Nt.exec(t);if(e){if(e[3]&&e[3].indexOf(" > eval")>-1){const t=Lt.exec(e[3]);t&&(e[1]=e[1]||"eval",e[3]=t[1],e[4]=t[2],e[5]="")}let t=e[3],n=e[1]||Mt;return[n,t]=jt(n,t),Ot(t,n,e[4]?+e[4]:void 0,e[5]?+e[5]:void 0)}}],[40,t=>{const e=$t.exec(t);return e?Ot(e[2],e[1]||Mt,+e[3],e[4]?+e[4]:void 0):void 0}]],Ft=(0,g.pE)(...Pt),jt=(t,e)=>{const n=-1!==t.indexOf("safari-extension"),r=-1!==t.indexOf("safari-web-extension");return n||r?[-1!==t.indexOf("@")?t.split("@")[0]:Mt,n?`safari-extension:${e}`:`safari-web-extension:${e}`]:[t,e]};var Ut=n(409);function Bt(t){const e=[];function n(t){return e.splice(e.indexOf(t),1)[0]}return{$:e,add:function(r){if(!(void 0===t||e.length<t))return(0,C.$2)(new Ut.b("Not adding Promise because buffer limit was reached."));const s=r();return-1===e.indexOf(s)&&e.push(s),s.then((()=>n(s))).then(null,(()=>n(s).then(null,(()=>{})))),s},drain:function(t){return new C.cW(((n,r)=>{let s=e.length;if(!s)return n(!0);const i=setTimeout((()=>{t&&t>0&&n(!1)}),t);e.forEach((t=>{(0,C.WD)(t).then((()=>{--s||(clearTimeout(i),n(!0))}),r)}))}))}}}var Ht=n(228);const zt=30;function Wt(t,e,n=Bt(t.bufferSize||zt)){let s={};function i(i){const a=[];if((0,b.gv)(i,((e,n)=>{const r=(0,b.mL)(n);if((0,Ht.Q)(s,r)){const s=qt(e,n);t.recordDroppedEvent("ratelimit_backoff",r,s)}else a.push(e)})),0===a.length)return(0,C.WD)();const c=(0,b.Jd)(i[0],a),l=e=>{(0,b.gv)(c,((n,r)=>{const s=qt(n,r);t.recordDroppedEvent(e,(0,b.mL)(r),s)}))};return n.add((()=>e({body:(0,b.V$)(c,t.textEncoder)}).then((t=>(void 0!==t.statusCode&&(t.statusCode<200||t.statusCode>=300)&&o.X&&r.kg.warn(`Sentry responded with status code ${t.statusCode} to sent event.`),s=(0,Ht.WG)(s,t),t)),(t=>{throw l("network_error"),t})))).then((t=>t),(t=>{if(t instanceof Ut.b)return o.X&&r.kg.error("Skipped sending event because buffer is full."),l("queue_overflow"),(0,C.WD)();throw t}))}return i.__sentry__baseTransport__=!0,{send:i,flush:t=>n.drain(t)}}function qt(t,e){if("event"===e||"transaction"===e)return Array.isArray(t)?t[1]:void 0}let Xt;function Gt(t,e=function(){if(Xt)return Xt;if((0,y.Du)(j.fetch))return Xt=j.fetch.bind(j);const t=j.document;let e=j.fetch;if(t&&"function"===typeof t.createElement)try{const n=t.createElement("iframe");n.hidden=!0,t.head.appendChild(n);const r=n.contentWindow;r&&r.fetch&&(e=r.fetch),t.head.removeChild(n)}catch(n){x&&r.kg.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",n)}return Xt=e.bind(j)}()){let n=0,s=0;return Wt(t,(function(r){const i=r.body.length;n+=i,s++;const o={body:r.body,method:"POST",referrerPolicy:"origin",headers:t.headers,keepalive:n<=6e4&&s<15,...t.fetchOptions};try{return e(t.url,o).then((t=>(n-=i,s--,{statusCode:t.status,headers:{"x-sentry-rate-limits":t.headers.get("X-Sentry-Rate-Limits"),"retry-after":t.headers.get("Retry-After")}})))}catch(a){return Xt=void 0,n-=i,s--,(0,C.$2)(a)}}))}const Kt=4;function Jt(t){return Wt(t,(function(e){return new C.cW(((n,r)=>{const s=new XMLHttpRequest;s.onerror=r,s.onreadystatechange=()=>{s.readyState===Kt&&n({statusCode:s.status,headers:{"x-sentry-rate-limits":s.getResponseHeader("X-Sentry-Rate-Limits"),"retry-after":s.getResponseHeader("Retry-After")}})},s.open("POST",t.url);for(const e in t.headers)Object.prototype.hasOwnProperty.call(t.headers,e)&&s.setRequestHeader(e,t.headers[e]);s.send(e.body)}))}))}const Yt=[new l,new p,new Z,new pt,new G,new wt,new xt,new Et];function Vt(t={}){void 0===t.defaultIntegrations&&(t.defaultIntegrations=Yt),void 0===t.release&&("string"===typeof __SENTRY_RELEASE__&&(t.release=__SENTRY_RELEASE__),j.SENTRY_RELEASE&&j.SENTRY_RELEASE.id&&(t.release=j.SENTRY_RELEASE.id)),void 0===t.autoSessionTracking&&(t.autoSessionTracking=!0),void 0===t.sendClientReports&&(t.sendClientReports=!0);const e={...t,stackParser:(0,g.Sq)(t.stackParser||Ft),integrations:(0,m.m8)(t),transport:t.transport||((0,y.Ak)()?Gt:Jt)};!function(t,e){!0===e.debug&&(o.X?r.kg.enable():(0,r.Cf)((()=>{console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.")})));const n=(0,f.Gd)();n.getScope().update(e.initialScope);const s=new t(e);n.bindClient(s)}(z,e),t.autoSessionTracking&&function(){if("undefined"===typeof j.document)return void(x&&r.kg.warn("Session tracking in non-browser environment with @sentry/browser is not supported."));const t=(0,f.Gd)();if(!t.captureSession)return;Qt(t),(0,_.a)((({from:t,to:e})=>{void 0!==t&&t!==e&&Qt((0,f.Gd)())}))}()}function Qt(t){t.startSession({ignoreDuration:!0}),t.captureSession()}},7893:(t,e,n)=>{n.d(e,{W:()=>k,Q:()=>E});var r=n(292),s=n(2343),i=n(2844),o=n(7597),a=n(6893),c=n(8725),l=n(409),u=n(535);const d="7";function h(t){const e=t.protocol?`${t.protocol}:`:"",n=t.port?`:${t.port}`:"";return`${e}//${t.host}${n}${t.path?`/${t.path}`:""}/api/`}function p(t,e={}){const n="string"===typeof e?e:e.tunnel,r="string"!==typeof e&&e._metadata?e._metadata.sdk:void 0;return n||`${function(t){return`${h(t)}${t.projectId}/envelope/`}(t)}?${function(t,e){return(0,u._j)({sentry_key:t.publicKey,sentry_version:d,...e&&{sentry_client:`${e.name}/${e.version}`}})}(t,r)}`}var m=n(1703);var f=n(5659),g=n(2967),y=n(9015),_=n(454),v=n(8942);const S="Not capturing exception because it's already been captured.";class k{constructor(t){if(this._options=t,this._integrations={},this._integrationsInitialized=!1,this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],t.dsn?this._dsn=(0,r.vK)(t.dsn):m.X&&s.kg.warn("No DSN provided, client will not send events."),this._dsn){const e=p(this._dsn,t);this._transport=t.transport({recordDroppedEvent:this.recordDroppedEvent.bind(this),...t.transportOptions,url:e})}}captureException(t,e,n){if((0,i.YO)(t))return void(m.X&&s.kg.log(S));let r=e&&e.event_id;return this._process(this.eventFromException(t,e).then((t=>this._captureEvent(t,e,n))).then((t=>{r=t}))),r}captureMessage(t,e,n,r){let s=n&&n.event_id;const i=(0,o.pt)(t)?this.eventFromMessage(String(t),e,n):this.eventFromException(t,n);return this._process(i.then((t=>this._captureEvent(t,n,r))).then((t=>{s=t}))),s}captureEvent(t,e,n){if(e&&e.originalException&&(0,i.YO)(e.originalException))return void(m.X&&s.kg.log(S));let r=e&&e.event_id;return this._process(this._captureEvent(t,e,n).then((t=>{r=t}))),r}captureSession(t){"string"!==typeof t.release?m.X&&s.kg.warn("Discarded session because of missing or non-string release"):(this.sendSession(t),(0,y.CT)(t,{init:!1}))}getDsn(){return this._dsn}getOptions(){return this._options}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}flush(t){const e=this._transport;return e?this._isClientDoneProcessing(t).then((n=>e.flush(t).then((t=>n&&t)))):(0,a.WD)(!0)}close(t){return this.flush(t).then((t=>(this.getOptions().enabled=!1,t)))}getEventProcessors(){return this._eventProcessors}addEventProcessor(t){this._eventProcessors.push(t)}setupIntegrations(t){(t&&!this._integrationsInitialized||this._isEnabled()&&!this._integrationsInitialized)&&(this._integrations=(0,g.q4)(this,this._options.integrations),this._integrationsInitialized=!0)}getIntegrationById(t){return this._integrations[t]}getIntegration(t){try{return this._integrations[t.id]||null}catch(e){return m.X&&s.kg.warn(`Cannot retrieve integration ${t.id} from the current Client`),null}}addIntegration(t){(0,g.m7)(this,t,this._integrations)}sendEvent(t,e={}){this.emit("beforeSendEvent",t,e);let n=function(t,e,n,r){const s=(0,c.HY)(n),i=t.type&&"replay_event"!==t.type?t.type:"event";!function(t,e){e&&(t.sdk=t.sdk||{},t.sdk.name=t.sdk.name||e.name,t.sdk.version=t.sdk.version||e.version,t.sdk.integrations=[...t.sdk.integrations||[],...e.integrations||[]],t.sdk.packages=[...t.sdk.packages||[],...e.packages||[]])}(t,n&&n.sdk);const o=(0,c.Cd)(t,s,r,e);delete t.sdkProcessingMetadata;const a=[{type:i},t];return(0,c.Jd)(o,[a])}(t,this._dsn,this._options._metadata,this._options.tunnel);for(const s of e.attachments||[])n=(0,c.BO)(n,(0,c.zQ)(s,this._options.transportOptions&&this._options.transportOptions.textEncoder));const r=this._sendEnvelope(n);r&&r.then((e=>this.emit("afterSendEvent",t,e)),null)}sendSession(t){const e=function(t,e,n,s){const i=(0,c.HY)(n),o={sent_at:(new Date).toISOString(),...i&&{sdk:i},...!!s&&e&&{dsn:(0,r.RA)(e)}},a="aggregates"in t?[{type:"sessions"},t]:[{type:"session"},t.toJSON()];return(0,c.Jd)(o,[a])}(t,this._dsn,this._options._metadata,this._options.tunnel);this._sendEnvelope(e)}recordDroppedEvent(t,e,n){if(this._options.sendClientReports){const n=`${t}:${e}`;m.X&&s.kg.log(`Adding outcome: "${n}"`),this._outcomes[n]=this._outcomes[n]+1||1}}on(t,e){this._hooks[t]||(this._hooks[t]=[]),this._hooks[t].push(e)}emit(t,...e){this._hooks[t]&&this._hooks[t].forEach((t=>t(...e)))}_updateSessionFromEvent(t,e){let n=!1,r=!1;const s=e.exception&&e.exception.values;if(s){r=!0;for(const t of s){const e=t.mechanism;if(e&&!1===e.handled){n=!0;break}}}const i="ok"===t.status;(i&&0===t.errors||i&&n)&&((0,y.CT)(t,{...n&&{status:"crashed"},errors:t.errors||Number(r||n)}),this.captureSession(t))}_isClientDoneProcessing(t){return new a.cW((e=>{let n=0;const r=setInterval((()=>{0==this._numProcessing?(clearInterval(r),e(!0)):(n+=1,t&&n>=t&&(clearInterval(r),e(!1)))}),1)}))}_isEnabled(){return!1!==this.getOptions().enabled&&void 0!==this._transport}_prepareEvent(t,e,n){const r=this.getOptions(),s=Object.keys(this._integrations);return!e.integrations&&s.length>0&&(e.integrations=s),this.emit("preprocessEvent",t,e),(0,v.R)(r,t,e,n,this).then((t=>{if(null===t)return t;const{propagationContext:e}=t.sdkProcessingMetadata||{};if(!(t.contexts&&t.contexts.trace)&&e){const{traceId:r,spanId:s,parentSpanId:i,dsc:o}=e;t.contexts={trace:{trace_id:r,span_id:s,parent_span_id:i},...t.contexts};const a=o||(0,_._)(r,this,n);t.sdkProcessingMetadata={dynamicSamplingContext:a,...t.sdkProcessingMetadata}}return t}))}_captureEvent(t,e={},n){return this._processEvent(t,e,n).then((t=>t.event_id),(t=>{if(m.X){const e=t;"log"===e.logLevel?s.kg.log(e.message):s.kg.warn(e)}}))}_processEvent(t,e,n){const r=this.getOptions(),{sampleRate:s}=r,i=w(t),c=b(t),u=t.type||"error",d=`before send for type \`${u}\``;if(c&&"number"===typeof s&&Math.random()>s)return this.recordDroppedEvent("sample_rate","error",t),(0,a.$2)(new l.b(`Discarding event because it's not included in the random sample (sampling rate = ${s})`,"log"));const h="replay_event"===u?"replay":u;return this._prepareEvent(t,e,n).then((n=>{if(null===n)throw this.recordDroppedEvent("event_processor",h,t),new l.b("An event processor returned `null`, will not send event.","log");if(e.data&&!0===e.data.__sentry__)return n;const s=function(t,e,n){const{beforeSend:r,beforeSendTransaction:s}=t;if(b(e)&&r)return r(e,n);if(w(e)&&s)return s(e,n);return e}(r,n,e);return function(t,e){const n=`${e} must return \`null\` or a valid event.`;if((0,o.J8)(t))return t.then((t=>{if(!(0,o.PO)(t)&&null!==t)throw new l.b(n);return t}),(t=>{throw new l.b(`${e} rejected with ${t}`)}));if(!(0,o.PO)(t)&&null!==t)throw new l.b(n);return t}(s,d)})).then((r=>{if(null===r)throw this.recordDroppedEvent("before_send",h,t),new l.b(`${d} returned \`null\`, will not send event.`,"log");const s=n&&n.getSession();!i&&s&&this._updateSessionFromEvent(s,r);const o=r.transaction_info;if(i&&o&&r.transaction!==t.transaction){const t="custom";r.transaction_info={...o,source:t}}return this.sendEvent(r,e),r})).then(null,(t=>{if(t instanceof l.b)throw t;throw this.captureException(t,{data:{__sentry__:!0},originalException:t}),new l.b(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.\nReason: ${t}`)}))}_process(t){this._numProcessing++,t.then((t=>(this._numProcessing--,t)),(t=>(this._numProcessing--,t)))}_sendEnvelope(t){if(this.emit("beforeEnvelope",t),this._isEnabled()&&this._transport)return this._transport.send(t).then(null,(t=>{m.X&&s.kg.error("Error while sending event:",t)}));m.X&&s.kg.error("Transport disabled")}_clearOutcomes(){const t=this._outcomes;return this._outcomes={},Object.keys(t).map((e=>{const[n,r]=e.split(":");return{reason:n,category:r,quantity:t[e]}}))}}function b(t){return void 0===t.type}function w(t){return"transaction"===t.type}function E(t){const e=(0,f.Gd)().getClient();e&&e.addEventProcessor&&e.addEventProcessor(t)}},1131:(t,e,n)=>{n.d(e,{J:()=>r});const r="production"},1703:(t,e,n)=>{n.d(e,{X:()=>r});const r="undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__},1195:(t,e,n)=>{n.d(e,{RP:()=>u,cc:()=>l,fH:()=>c});var r=n(1235),s=n(6893),i=n(2343),o=n(7597),a=n(1703);function c(){return(0,r.YO)("globalEventProcessors",(()=>[]))}function l(t){c().push(t)}function u(t,e,n,r=0){return new s.cW(((s,c)=>{const l=t[r];if(null===e||"function"!==typeof l)s(e);else{const d=l({...e},n);a.X&&l.id&&null===d&&i.kg.log(`Event processor "${l.id}" dropped event`),(0,o.J8)(d)?d.then((e=>u(t,e,n,r+1).then(s))).then(null,c):u(t,d,n,r+1).then(s).then(null,c)}}))}},4487:(t,e,n)=>{n.d(e,{$e:()=>a,Tb:()=>i,s3:()=>c,v:()=>o});var r=n(5659),s=n(8942);function i(t,e){return(0,r.Gd)().captureException(t,(0,s.U0)(e))}function o(t,e){(0,r.Gd)().setContext(t,e)}function a(t){(0,r.Gd)().withScope(t)}function c(){return(0,r.Gd)().getClient()}},5659:(t,e,n)=>{n.d(e,{Gd:()=>y,cu:()=>f});var r=n(2844),s=n(1170),i=n(2343),o=n(1235),a=n(1131),c=n(1703),l=n(350),u=n(9015),d=n(105);const h=parseFloat(d.J),p=100;class m{constructor(t,e=new l.s,n=h){this._version=n,this._stack=[{scope:e}],t&&this.bindClient(t)}isOlderThan(t){return this._version<t}bindClient(t){this.getStackTop().client=t,t&&t.setupIntegrations&&t.setupIntegrations()}pushScope(){const t=l.s.clone(this.getScope());return this.getStack().push({client:this.getClient(),scope:t}),t}popScope(){return!(this.getStack().length<=1)&&!!this.getStack().pop()}withScope(t){const e=this.pushScope();try{t(e)}finally{this.popScope()}}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getStack(){return this._stack}getStackTop(){return this._stack[this._stack.length-1]}captureException(t,e){const n=this._lastEventId=e&&e.event_id?e.event_id:(0,r.DM)(),s=new Error("Sentry syntheticException");return this._withClient(((r,i)=>{r.captureException(t,{originalException:t,syntheticException:s,...e,event_id:n},i)})),n}captureMessage(t,e,n){const s=this._lastEventId=n&&n.event_id?n.event_id:(0,r.DM)(),i=new Error(t);return this._withClient(((r,o)=>{r.captureMessage(t,e,{originalException:t,syntheticException:i,...n,event_id:s},o)})),s}captureEvent(t,e){const n=e&&e.event_id?e.event_id:(0,r.DM)();return t.type||(this._lastEventId=n),this._withClient(((r,s)=>{r.captureEvent(t,{...e,event_id:n},s)})),n}lastEventId(){return this._lastEventId}addBreadcrumb(t,e){const{scope:n,client:r}=this.getStackTop();if(!r)return;const{beforeBreadcrumb:o=null,maxBreadcrumbs:a=p}=r.getOptions&&r.getOptions()||{};if(a<=0)return;const c={timestamp:(0,s.yW)(),...t},l=o?(0,i.Cf)((()=>o(c,e))):c;null!==l&&(r.emit&&r.emit("beforeAddBreadcrumb",l,e),n.addBreadcrumb(l,a))}setUser(t){this.getScope().setUser(t)}setTags(t){this.getScope().setTags(t)}setExtras(t){this.getScope().setExtras(t)}setTag(t,e){this.getScope().setTag(t,e)}setExtra(t,e){this.getScope().setExtra(t,e)}setContext(t,e){this.getScope().setContext(t,e)}configureScope(t){const{scope:e,client:n}=this.getStackTop();n&&t(e)}run(t){const e=g(this);try{t(this)}finally{g(e)}}getIntegration(t){const e=this.getClient();if(!e)return null;try{return e.getIntegration(t)}catch(n){return c.X&&i.kg.warn(`Cannot retrieve integration ${t.id} from the current Hub`),null}}startTransaction(t,e){const n=this._callExtensionMethod("startTransaction",t,e);if(c.X&&!n){this.getClient()?i.kg.warn("Tracing extension 'startTransaction' has not been added. Call 'addTracingExtensions' before calling 'init':\nSentry.addTracingExtensions();\nSentry.init({...});\n"):i.kg.warn("Tracing extension 'startTransaction' is missing. You should 'init' the SDK before calling 'startTransaction'")}return n}traceHeaders(){return this._callExtensionMethod("traceHeaders")}captureSession(t=!1){if(t)return this.endSession();this._sendSessionUpdate()}endSession(){const t=this.getStackTop().scope,e=t.getSession();e&&(0,u.RJ)(e),this._sendSessionUpdate(),t.setSession()}startSession(t){const{scope:e,client:n}=this.getStackTop(),{release:r,environment:s=a.J}=n&&n.getOptions()||{},{userAgent:i}=o.n2.navigator||{},c=(0,u.Hv)({release:r,environment:s,user:e.getUser(),...i&&{userAgent:i},...t}),l=e.getSession&&e.getSession();return l&&"ok"===l.status&&(0,u.CT)(l,{status:"exited"}),this.endSession(),e.setSession(c),c}shouldSendDefaultPii(){const t=this.getClient(),e=t&&t.getOptions();return Boolean(e&&e.sendDefaultPii)}_sendSessionUpdate(){const{scope:t,client:e}=this.getStackTop(),n=t.getSession();n&&e&&e.captureSession&&e.captureSession(n)}_withClient(t){const{scope:e,client:n}=this.getStackTop();n&&t(n,e)}_callExtensionMethod(t,...e){const n=f().__SENTRY__;if(n&&n.extensions&&"function"===typeof n.extensions[t])return n.extensions[t].apply(this,e);c.X&&i.kg.warn(`Extension method ${t} couldn't be found, doing nothing.`)}}function f(){return o.n2.__SENTRY__=o.n2.__SENTRY__||{extensions:{},hub:void 0},o.n2}function g(t){const e=f(),n=S(e);return k(e,t),n}function y(){const t=f();if(t.__SENTRY__&&t.__SENTRY__.acs){const e=t.__SENTRY__.acs.getCurrentHub();if(e)return e}return _(t)}function _(t=f()){return v(t)&&!S(t).isOlderThan(h)||k(t,new m),S(t)}function v(t){return!!(t&&t.__SENTRY__&&t.__SENTRY__.hub)}function S(t){return(0,o.YO)("hub",(()=>new m),t)}function k(t,e){if(!t)return!1;return(t.__SENTRY__=t.__SENTRY__||{}).hub=e,!0}},2967:(t,e,n)=>{n.d(e,{m7:()=>d,m8:()=>l,q4:()=>u});var r=n(2844),s=n(2343),i=n(1703),o=n(1195),a=n(5659);const c=[];function l(t){const e=t.defaultIntegrations||[],n=t.integrations;let s;e.forEach((t=>{t.isDefaultInstance=!0})),s=Array.isArray(n)?[...e,...n]:"function"===typeof n?(0,r.lE)(n(e)):e;const i=function(t){const e={};return t.forEach((t=>{const{name:n}=t,r=e[n];r&&!r.isDefaultInstance&&t.isDefaultInstance||(e[n]=t)})),Object.keys(e).map((t=>e[t]))}(s),o=function(t,e){for(let n=0;n<t.length;n++)if(!0===e(t[n]))return n;return-1}(i,(t=>"Debug"===t.name));if(-1!==o){const[t]=i.splice(o,1);i.push(t)}return i}function u(t,e){const n={};return e.forEach((e=>{e&&d(t,e,n)})),n}function d(t,e,n){if(n[e.name]=e,-1===c.indexOf(e.name)&&(e.setupOnce(o.cc,a.Gd),c.push(e.name)),e.setup&&"function"===typeof e.setup&&e.setup(t),t.on&&"function"===typeof e.preprocessEvent){const n=e.preprocessEvent.bind(e);t.on("preprocessEvent",((e,r)=>n(e,r,t)))}if(t.addEventProcessor&&"function"===typeof e.processEvent){const n=e.processEvent.bind(e),r=Object.assign(((e,r)=>n(e,r,t)),{id:e.name});t.addEventProcessor(r)}i.X&&s.kg.log(`Integration installed: ${e.name}`)}},350:(t,e,n)=>{n.d(e,{s:()=>c});var r=n(7597),s=n(1170),i=n(2844),o=n(1195),a=n(9015);class c{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext=l()}static clone(t){const e=new c;return t&&(e._breadcrumbs=[...t._breadcrumbs],e._tags={...t._tags},e._extra={...t._extra},e._contexts={...t._contexts},e._user=t._user,e._level=t._level,e._span=t._span,e._session=t._session,e._transactionName=t._transactionName,e._fingerprint=t._fingerprint,e._eventProcessors=[...t._eventProcessors],e._requestSession=t._requestSession,e._attachments=[...t._attachments],e._sdkProcessingMetadata={...t._sdkProcessingMetadata},e._propagationContext={...t._propagationContext}),e}addScopeListener(t){this._scopeListeners.push(t)}addEventProcessor(t){return this._eventProcessors.push(t),this}setUser(t){return this._user=t||{},this._session&&(0,a.CT)(this._session,{user:t}),this._notifyScopeListeners(),this}getUser(){return this._user}getRequestSession(){return this._requestSession}setRequestSession(t){return this._requestSession=t,this}setTags(t){return this._tags={...this._tags,...t},this._notifyScopeListeners(),this}setTag(t,e){return this._tags={...this._tags,[t]:e},this._notifyScopeListeners(),this}setExtras(t){return this._extra={...this._extra,...t},this._notifyScopeListeners(),this}setExtra(t,e){return this._extra={...this._extra,[t]:e},this._notifyScopeListeners(),this}setFingerprint(t){return this._fingerprint=t,this._notifyScopeListeners(),this}setLevel(t){return this._level=t,this._notifyScopeListeners(),this}setTransactionName(t){return this._transactionName=t,this._notifyScopeListeners(),this}setContext(t,e){return null===e?delete this._contexts[t]:this._contexts[t]=e,this._notifyScopeListeners(),this}setSpan(t){return this._span=t,this._notifyScopeListeners(),this}getSpan(){return this._span}getTransaction(){const t=this.getSpan();return t&&t.transaction}setSession(t){return t?this._session=t:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(t){if(!t)return this;if("function"===typeof t){const e=t(this);return e instanceof c?e:this}return t instanceof c?(this._tags={...this._tags,...t._tags},this._extra={...this._extra,...t._extra},this._contexts={...this._contexts,...t._contexts},t._user&&Object.keys(t._user).length&&(this._user=t._user),t._level&&(this._level=t._level),t._fingerprint&&(this._fingerprint=t._fingerprint),t._requestSession&&(this._requestSession=t._requestSession),t._propagationContext&&(this._propagationContext=t._propagationContext)):(0,r.PO)(t)&&(this._tags={...this._tags,...t.tags},this._extra={...this._extra,...t.extra},this._contexts={...this._contexts,...t.contexts},t.user&&(this._user=t.user),t.level&&(this._level=t.level),t.fingerprint&&(this._fingerprint=t.fingerprint),t.requestSession&&(this._requestSession=t.requestSession),t.propagationContext&&(this._propagationContext=t.propagationContext)),this}clear(){return this._breadcrumbs=[],this._tags={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._requestSession=void 0,this._span=void 0,this._session=void 0,this._notifyScopeListeners(),this._attachments=[],this._propagationContext=l(),this}addBreadcrumb(t,e){const n="number"===typeof e?e:100;if(n<=0)return this;const r={timestamp:(0,s.yW)(),...t},i=this._breadcrumbs;return i.push(r),this._breadcrumbs=i.length>n?i.slice(-n):i,this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(t){return this._attachments.push(t),this}getAttachments(){return this._attachments}clearAttachments(){return this._attachments=[],this}applyToEvent(t,e={},n){if(this._extra&&Object.keys(this._extra).length&&(t.extra={...this._extra,...t.extra}),this._tags&&Object.keys(this._tags).length&&(t.tags={...this._tags,...t.tags}),this._user&&Object.keys(this._user).length&&(t.user={...this._user,...t.user}),this._contexts&&Object.keys(this._contexts).length&&(t.contexts={...this._contexts,...t.contexts}),this._level&&(t.level=this._level),this._transactionName&&(t.transaction=this._transactionName),this._span){t.contexts={trace:this._span.getTraceContext(),...t.contexts};const e=this._span.transaction;if(e){t.sdkProcessingMetadata={dynamicSamplingContext:e.getDynamicSamplingContext(),...t.sdkProcessingMetadata};const n=e.name;n&&(t.tags={transaction:n,...t.tags})}}this._applyFingerprint(t);const r=this._getBreadcrumbs(),s=[...t.breadcrumbs||[],...r];return t.breadcrumbs=s.length>0?s:void 0,t.sdkProcessingMetadata={...t.sdkProcessingMetadata,...this._sdkProcessingMetadata,propagationContext:this._propagationContext},(0,o.RP)([...n||[],...(0,o.fH)(),...this._eventProcessors],t,e)}setSDKProcessingMetadata(t){return this._sdkProcessingMetadata={...this._sdkProcessingMetadata,...t},this}setPropagationContext(t){return this._propagationContext=t,this}getPropagationContext(){return this._propagationContext}_getBreadcrumbs(){return this._breadcrumbs}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach((t=>{t(this)})),this._notifyingListeners=!1)}_applyFingerprint(t){t.fingerprint=t.fingerprint?(0,i.lE)(t.fingerprint):[],this._fingerprint&&(t.fingerprint=t.fingerprint.concat(this._fingerprint)),t.fingerprint&&!t.fingerprint.length&&delete t.fingerprint}}function l(){return{traceId:(0,i.DM)(),spanId:(0,i.DM)().substring(16)}}},9015:(t,e,n)=>{n.d(e,{CT:()=>a,Hv:()=>o,RJ:()=>c});var r=n(1170),s=n(2844),i=n(535);function o(t){const e=(0,r.ph)(),n={sid:(0,s.DM)(),init:!0,timestamp:e,started:e,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>function(t){return(0,i.Jr)({sid:`${t.sid}`,init:t.init,started:new Date(1e3*t.started).toISOString(),timestamp:new Date(1e3*t.timestamp).toISOString(),status:t.status,errors:t.errors,did:"number"===typeof t.did||"string"===typeof t.did?`${t.did}`:void 0,duration:t.duration,abnormal_mechanism:t.abnormal_mechanism,attrs:{release:t.release,environment:t.environment,ip_address:t.ipAddress,user_agent:t.userAgent}})}(n)};return t&&a(n,t),n}function a(t,e={}){if(e.user&&(!t.ipAddress&&e.user.ip_address&&(t.ipAddress=e.user.ip_address),t.did||e.did||(t.did=e.user.id||e.user.email||e.user.username)),t.timestamp=e.timestamp||(0,r.ph)(),e.abnormal_mechanism&&(t.abnormal_mechanism=e.abnormal_mechanism),e.ignoreDuration&&(t.ignoreDuration=e.ignoreDuration),e.sid&&(t.sid=32===e.sid.length?e.sid:(0,s.DM)()),void 0!==e.init&&(t.init=e.init),!t.did&&e.did&&(t.did=`${e.did}`),"number"===typeof e.started&&(t.started=e.started),t.ignoreDuration)t.duration=void 0;else if("number"===typeof e.duration)t.duration=e.duration;else{const e=t.timestamp-t.started;t.duration=e>=0?e:0}e.release&&(t.release=e.release),e.environment&&(t.environment=e.environment),!t.ipAddress&&e.ipAddress&&(t.ipAddress=e.ipAddress),!t.userAgent&&e.userAgent&&(t.userAgent=e.userAgent),"number"===typeof e.errors&&(t.errors=e.errors),e.status&&(t.status=e.status)}function c(t,e){let n={};e?n={status:e}:"ok"===t.status&&(n={status:"exited"}),a(t,n)}},454:(t,e,n)=>{n.d(e,{_:()=>i});var r=n(535),s=n(1131);function i(t,e,n){const i=e.getOptions(),{publicKey:o}=e.getDsn()||{},{segment:a}=n&&n.getUser()||{},c=(0,r.Jr)({environment:i.environment||s.J,release:i.release,user_segment:a,public_key:o,trace_id:t});return e.emit&&e.emit("createDsc",c),c}},2931:(t,e,n)=>{n.d(e,{T:()=>v,l:()=>_});var r=n(2343),s=n(1703),i=n(5659),o=n(1674),a=n(7373),c=n(9791);let l=!1;function u(){const t=(0,c.x1)();if(t){const e="internal_error";s.X&&r.kg.log(`[Tracing] Transaction: ${e} -> Global error occured`),t.setStatus(e)}}u.tag="sentry_tracingErrorCallback";var d=n(5544),h=n(7597),p=n(7522);function m(t,e,n){if(!(0,p.z)(e))return t.sampled=!1,t;if(void 0!==t.sampled)return t.setMetadata({sampleRate:Number(t.sampled)}),t;let i;return"function"===typeof e.tracesSampler?(i=e.tracesSampler(n),t.setMetadata({sampleRate:Number(i)})):void 0!==n.parentSampled?i=n.parentSampled:"undefined"!==typeof e.tracesSampleRate?(i=e.tracesSampleRate,t.setMetadata({sampleRate:Number(i)})):(i=1,t.setMetadata({sampleRate:i})),function(t){if((0,h.i2)(t)||"number"!==typeof t&&"boolean"!==typeof t)return s.X&&r.kg.warn(`[Tracing] Given sample rate is invalid. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(t)} of type ${JSON.stringify(typeof t)}.`),!1;if(t<0||t>1)return s.X&&r.kg.warn(`[Tracing] Given sample rate is invalid. Sample rate must be between 0 and 1. Got ${t}.`),!1;return!0}(i)?i?(t.sampled=Math.random()<i,t.sampled?(s.X&&r.kg.log(`[Tracing] starting ${t.op} transaction - ${t.name}`),t):(s.X&&r.kg.log(`[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number(i)})`),t)):(s.X&&r.kg.log("[Tracing] Discarding transaction because "+("function"===typeof e.tracesSampler?"tracesSampler returned 0 or false":"a negative sampling decision was inherited or tracesSampleRate is set to 0")),t.sampled=!1,t):(s.X&&r.kg.warn("[Tracing] Discarding transaction because of invalid sample rate."),t.sampled=!1,t)}var f=n(8069);function g(){const t=this.getScope().getSpan();return t?{"sentry-trace":t.toTraceparent()}:{}}function y(t,e){const n=this.getClient(),i=n&&n.getOptions()||{},o=i.instrumenter||"sentry",a=t.instrumenter||"sentry";o!==a&&(s.X&&r.kg.error(`A transaction was started with instrumenter=\`${a}\`, but the SDK is configured with the \`${o}\` instrumenter.\nThe transaction will not be sampled. Please use the ${o} instrumentation to start transactions.`),t.sampled=!1);let c=new f.Y(t,this);return c=m(c,i,{parentSampled:t.parentSampled,transactionContext:t,...e}),c.sampled&&c.initSpanRecorder(i._experiments&&i._experiments.maxSpans),n&&n.emit&&n.emit("startTransaction",c),c}function _(t,e,n,r,s,i,o){const a=t.getClient(),c=a&&a.getOptions()||{};let l=new d.io(e,t,n,r,o,s);return l=m(l,c,{parentSampled:e.parentSampled,transactionContext:e,...i}),l.sampled&&l.initSpanRecorder(c._experiments&&c._experiments.maxSpans),a&&a.emit&&a.emit("startTransaction",l),l}function v(){const t=(0,i.cu)();t.__SENTRY__&&(t.__SENTRY__.extensions=t.__SENTRY__.extensions||{},t.__SENTRY__.extensions.startTransaction||(t.__SENTRY__.extensions.startTransaction=y),t.__SENTRY__.extensions.traceHeaders||(t.__SENTRY__.extensions.traceHeaders=g),l||(l=!0,(0,o.V)(u),(0,a.h)(u)))}},5544:(t,e,n)=>{n.d(e,{AT:()=>c,io:()=>d});var r=n(1170),s=n(2343),i=n(1703),o=n(8903),a=n(8069);const c={idleTimeout:1e3,finalTimeout:3e4,heartbeatInterval:5e3},l=["heartbeatFailed","idleTimeout","documentHidden","finalTimeout","externalFinish","cancelled"];class u extends o.gB{constructor(t,e,n,r){super(r),this._pushActivity=t,this._popActivity=e,this.transactionSpanId=n}add(t){t.spanId!==this.transactionSpanId&&(t.finish=e=>{t.endTimestamp="number"===typeof e?e:(0,r.ph)(),this._popActivity(t.spanId)},void 0===t.endTimestamp&&this._pushActivity(t.spanId)),super.add(t)}}class d extends a.Y{constructor(t,e,n=c.idleTimeout,r=c.finalTimeout,o=c.heartbeatInterval,a=!1){super(t,e),this._idleHub=e,this._idleTimeout=n,this._finalTimeout=r,this._heartbeatInterval=o,this._onScope=a,this.activities={},this._heartbeatCounter=0,this._finished=!1,this._idleTimeoutCanceledPermanently=!1,this._beforeFinishCallbacks=[],this._finishReason=l[4],a&&(i.X&&s.kg.log(`Setting idle transaction on scope. Span ID: ${this.spanId}`),e.configureScope((t=>t.setSpan(this)))),this._restartIdleTimeout(),setTimeout((()=>{this._finished||(this.setStatus("deadline_exceeded"),this._finishReason=l[3],this.finish())}),this._finalTimeout)}finish(t=(0,r.ph)()){if(this._finished=!0,this.activities={},"ui.action.click"===this.op&&this.setTag("finishReason",this._finishReason),this.spanRecorder){i.X&&s.kg.log("[Tracing] finishing IdleTransaction",new Date(1e3*t).toISOString(),this.op);for(const e of this._beforeFinishCallbacks)e(this,t);this.spanRecorder.spans=this.spanRecorder.spans.filter((e=>{if(e.spanId===this.spanId)return!0;e.endTimestamp||(e.endTimestamp=t,e.setStatus("cancelled"),i.X&&s.kg.log("[Tracing] cancelling span since transaction ended early",JSON.stringify(e,void 0,2)));const n=e.startTimestamp<t,r=(this._finalTimeout+this._idleTimeout)/1e3,o=e.endTimestamp-this.startTimestamp<r;if(i.X){const t=JSON.stringify(e,void 0,2);n?o||s.kg.log("[Tracing] discarding Span since it finished after Transaction final timeout",t):s.kg.log("[Tracing] discarding Span since it happened after Transaction was finished",t)}return n&&o})),i.X&&s.kg.log("[Tracing] flushing IdleTransaction")}else i.X&&s.kg.log("[Tracing] No active IdleTransaction");if(this._onScope){const t=this._idleHub.getScope();t.getTransaction()===this&&t.setSpan(void 0)}return super.finish(t)}registerBeforeFinishCallback(t){this._beforeFinishCallbacks.push(t)}initSpanRecorder(t){if(!this.spanRecorder){const e=t=>{this._finished||this._pushActivity(t)},n=t=>{this._finished||this._popActivity(t)};this.spanRecorder=new u(e,n,this.spanId,t),i.X&&s.kg.log("Starting heartbeat"),this._pingHeartbeat()}this.spanRecorder.add(this)}cancelIdleTimeout(t,{restartOnChildSpanChange:e}={restartOnChildSpanChange:!0}){this._idleTimeoutCanceledPermanently=!1===e,this._idleTimeoutID&&(clearTimeout(this._idleTimeoutID),this._idleTimeoutID=void 0,0===Object.keys(this.activities).length&&this._idleTimeoutCanceledPermanently&&(this._finishReason=l[5],this.finish(t)))}setFinishReason(t){this._finishReason=t}_restartIdleTimeout(t){this.cancelIdleTimeout(),this._idleTimeoutID=setTimeout((()=>{this._finished||0!==Object.keys(this.activities).length||(this._finishReason=l[1],this.finish(t))}),this._idleTimeout)}_pushActivity(t){this.cancelIdleTimeout(void 0,{restartOnChildSpanChange:!this._idleTimeoutCanceledPermanently}),i.X&&s.kg.log(`[Tracing] pushActivity: ${t}`),this.activities[t]=!0,i.X&&s.kg.log("[Tracing] new activities count",Object.keys(this.activities).length)}_popActivity(t){if(this.activities[t]&&(i.X&&s.kg.log(`[Tracing] popActivity ${t}`),delete this.activities[t],i.X&&s.kg.log("[Tracing] new activities count",Object.keys(this.activities).length)),0===Object.keys(this.activities).length){const t=(0,r.ph)();this._idleTimeoutCanceledPermanently?(this._finishReason=l[5],this.finish(t)):this._restartIdleTimeout(t+this._idleTimeout/1e3)}}_beat(){if(this._finished)return;const t=Object.keys(this.activities).join("");t===this._prevHeartbeatString?this._heartbeatCounter++:this._heartbeatCounter=1,this._prevHeartbeatString=t,this._heartbeatCounter>=3?(i.X&&s.kg.log("[Tracing] Transaction finished because of no change for 3 heart beats"),this.setStatus("deadline_exceeded"),this._finishReason=l[0],this.finish()):this._pingHeartbeat()}_pingHeartbeat(){i.X&&s.kg.log(`pinging Heartbeat -> current counter: ${this._heartbeatCounter}`),setTimeout((()=>{this._beat()}),this._heartbeatInterval)}}},8903:(t,e,n)=>{n.d(e,{Dr:()=>u,gB:()=>l});var r=n(2844),s=n(1170),i=n(2343),o=n(7638),a=n(535),c=n(1703);class l{constructor(t=1e3){this._maxlen=t,this.spans=[]}add(t){this.spans.length>this._maxlen?t.spanRecorder=void 0:this.spans.push(t)}}class u{constructor(t={}){this.traceId=t.traceId||(0,r.DM)(),this.spanId=t.spanId||(0,r.DM)().substring(16),this.startTimestamp=t.startTimestamp||(0,s.ph)(),this.tags=t.tags||{},this.data=t.data||{},this.instrumenter=t.instrumenter||"sentry",this.origin=t.origin||"manual",t.parentSpanId&&(this.parentSpanId=t.parentSpanId),"sampled"in t&&(this.sampled=t.sampled),t.op&&(this.op=t.op),t.description&&(this.description=t.description),t.name&&(this.description=t.name),t.status&&(this.status=t.status),t.endTimestamp&&(this.endTimestamp=t.endTimestamp)}get name(){return this.description||""}set name(t){this.setName(t)}startChild(t){const e=new u({...t,parentSpanId:this.spanId,sampled:this.sampled,traceId:this.traceId});if(e.spanRecorder=this.spanRecorder,e.spanRecorder&&e.spanRecorder.add(e),e.transaction=this.transaction,c.X&&e.transaction){const n=`[Tracing] Starting '${t&&t.op||"< unknown op >"}' span on transaction '${e.transaction.name||"< unknown name >"}' (${e.transaction.spanId}).`;e.transaction.metadata.spanMetadata[e.spanId]={logMessage:n},i.kg.log(n)}return e}setTag(t,e){return this.tags={...this.tags,[t]:e},this}setData(t,e){return this.data={...this.data,[t]:e},this}setStatus(t){return this.status=t,this}setHttpStatus(t){this.setTag("http.status_code",String(t)),this.setData("http.response.status_code",t);const e=function(t){if(t<400&&t>=100)return"ok";if(t>=400&&t<500)switch(t){case 401:return"unauthenticated";case 403:return"permission_denied";case 404:return"not_found";case 409:return"already_exists";case 413:return"failed_precondition";case 429:return"resource_exhausted";default:return"invalid_argument"}if(t>=500&&t<600)switch(t){case 501:return"unimplemented";case 503:return"unavailable";case 504:return"deadline_exceeded";default:return"internal_error"}return"unknown_error"}(t);return"unknown_error"!==e&&this.setStatus(e),this}setName(t){this.description=t}isSuccess(){return"ok"===this.status}finish(t){if(c.X&&this.transaction&&this.transaction.spanId!==this.spanId){const{logMessage:t}=this.transaction.metadata.spanMetadata[this.spanId];t&&i.kg.log(t.replace("Starting","Finishing"))}this.endTimestamp="number"===typeof t?t:(0,s.ph)()}toTraceparent(){return(0,o.$p)(this.traceId,this.spanId,this.sampled)}toContext(){return(0,a.Jr)({data:this.data,description:this.description,endTimestamp:this.endTimestamp,op:this.op,parentSpanId:this.parentSpanId,sampled:this.sampled,spanId:this.spanId,startTimestamp:this.startTimestamp,status:this.status,tags:this.tags,traceId:this.traceId})}updateWithContext(t){return this.data=t.data||{},this.description=t.description,this.endTimestamp=t.endTimestamp,this.op=t.op,this.parentSpanId=t.parentSpanId,this.sampled=t.sampled,this.spanId=t.spanId||this.spanId,this.startTimestamp=t.startTimestamp||this.startTimestamp,this.status=t.status,this.tags=t.tags||{},this.traceId=t.traceId||this.traceId,this}getTraceContext(){return(0,a.Jr)({data:Object.keys(this.data).length>0?this.data:void 0,description:this.description,op:this.op,parent_span_id:this.parentSpanId,span_id:this.spanId,status:this.status,tags:Object.keys(this.tags).length>0?this.tags:void 0,trace_id:this.traceId,origin:this.origin})}toJSON(){return(0,a.Jr)({data:Object.keys(this.data).length>0?this.data:void 0,description:this.description,op:this.op,parent_span_id:this.parentSpanId,span_id:this.spanId,start_timestamp:this.startTimestamp,status:this.status,tags:Object.keys(this.tags).length>0?this.tags:void 0,timestamp:this.endTimestamp,trace_id:this.traceId,origin:this.origin})}}},8069:(t,e,n)=>{n.d(e,{Y:()=>l});var r=n(535),s=n(2343),i=n(1703),o=n(5659),a=n(454),c=n(8903);class l extends c.Dr{constructor(t,e){super(t),delete this.description,this._measurements={},this._contexts={},this._hub=e||(0,o.Gd)(),this._name=t.name||"",this.metadata={source:"custom",...t.metadata,spanMetadata:{}},this._trimEnd=t.trimEnd,this.transaction=this;const n=this.metadata.dynamicSamplingContext;n&&(this._frozenDynamicSamplingContext={...n})}get name(){return this._name}set name(t){this.setName(t)}setName(t,e="custom"){this._name=t,this.metadata.source=e}initSpanRecorder(t=1e3){this.spanRecorder||(this.spanRecorder=new c.gB(t)),this.spanRecorder.add(this)}setContext(t,e){null===e?delete this._contexts[t]:this._contexts[t]=e}setMeasurement(t,e,n=""){this._measurements[t]={value:e,unit:n}}setMetadata(t){this.metadata={...this.metadata,...t}}finish(t){const e=this._finishTransaction(t);if(e)return this._hub.captureEvent(e)}toContext(){const t=super.toContext();return(0,r.Jr)({...t,name:this.name,trimEnd:this._trimEnd})}updateWithContext(t){return super.updateWithContext(t),this.name=t.name||"",this._trimEnd=t.trimEnd,this}getDynamicSamplingContext(){if(this._frozenDynamicSamplingContext)return this._frozenDynamicSamplingContext;const t=this._hub||(0,o.Gd)(),e=t.getClient();if(!e)return{};const n=t.getScope(),r=(0,a._)(this.traceId,e,n),s=this.metadata.sampleRate;void 0!==s&&(r.sample_rate=`${s}`);const i=this.metadata.source;return i&&"url"!==i&&(r.transaction=this.name),void 0!==this.sampled&&(r.sampled=String(this.sampled)),r}setHub(t){this._hub=t}_finishTransaction(t){if(void 0!==this.endTimestamp)return;this.name||(i.X&&s.kg.warn("Transaction has no name, falling back to `<unlabeled transaction>`."),this.name="<unlabeled transaction>"),super.finish(t);const e=this._hub.getClient();if(e&&e.emit&&e.emit("finishTransaction",this),!0!==this.sampled)return i.X&&s.kg.log("[Tracing] Discarding transaction because its trace was not chosen to be sampled."),void(e&&e.recordDroppedEvent("sample_rate","transaction"));const n=this.spanRecorder?this.spanRecorder.spans.filter((t=>t!==this&&t.endTimestamp)):[];this._trimEnd&&n.length>0&&(this.endTimestamp=n.reduce(((t,e)=>t.endTimestamp&&e.endTimestamp?t.endTimestamp>e.endTimestamp?t:e:t)).endTimestamp);const r=this.metadata,o={contexts:{...this._contexts,trace:this.getTraceContext()},spans:n,start_timestamp:this.startTimestamp,tags:this.tags,timestamp:this.endTimestamp,transaction:this.name,type:"transaction",sdkProcessingMetadata:{...r,dynamicSamplingContext:this.getDynamicSamplingContext()},...r.source&&{transaction_info:{source:r.source}}};return Object.keys(this._measurements).length>0&&(i.X&&s.kg.log("[Measurements] Adding measurements to transaction",JSON.stringify(this._measurements,void 0,2)),o.measurements=this._measurements),i.X&&s.kg.log(`[Tracing] Finishing ${this.op} transaction: ${this.name}.`),o}}},9791:(t,e,n)=>{n.d(e,{x1:()=>s});var r=n(5659);function s(t){return(t||(0,r.Gd)()).getScope().getTransaction()}},7522:(t,e,n)=>{n.d(e,{z:()=>s});var r=n(4487);function s(t){if("boolean"===typeof __SENTRY_TRACING__&&!__SENTRY_TRACING__)return!1;const e=(0,r.s3)(),n=t||e&&e.getOptions();return!!n&&(n.enableTracing||"tracesSampleRate"in n||"tracesSampler"in n)}},8942:(t,e,n)=>{n.d(e,{R:()=>h,U0:()=>m});var r=n(2844),s=n(1170),i=n(6893),o=n(7321),a=n(1235),c=n(8007),l=n(1131),u=n(1195),d=n(350);function h(t,e,n,h,m){const{normalizeDepth:f=3,normalizeMaxBreadth:g=1e3}=t,y={...e,event_id:e.event_id||n.event_id||(0,r.DM)(),timestamp:e.timestamp||(0,s.yW)()},_=n.integrations||t.integrations.map((t=>t.name));!function(t,e){const{environment:n,release:r,dist:s,maxValueLength:i=250}=e;"environment"in t||(t.environment="environment"in e?n:l.J);void 0===t.release&&void 0!==r&&(t.release=r);void 0===t.dist&&void 0!==s&&(t.dist=s);t.message&&(t.message=(0,o.$G)(t.message,i));const a=t.exception&&t.exception.values&&t.exception.values[0];a&&a.value&&(a.value=(0,o.$G)(a.value,i));const c=t.request;c&&c.url&&(c.url=(0,o.$G)(c.url,i))}(y,t),function(t,e){e.length>0&&(t.sdk=t.sdk||{},t.sdk.integrations=[...t.sdk.integrations||[],...e])}(y,_),void 0===e.type&&function(t,e){const n=a.n2._sentryDebugIds;if(!n)return;let r;const s=p.get(e);s?r=s:(r=new Map,p.set(e,r));const i=Object.keys(n).reduce(((t,s)=>{let i;const o=r.get(s);o?i=o:(i=e(s),r.set(s,i));for(let e=i.length-1;e>=0;e--){const r=i[e];if(r.filename){t[r.filename]=n[s];break}}return t}),{});try{t.exception.values.forEach((t=>{t.stacktrace.frames.forEach((t=>{t.filename&&(t.debug_id=i[t.filename])}))}))}catch(o){}}(y,t.stackParser);let v=h;n.captureContext&&(v=d.s.clone(v).update(n.captureContext)),n.mechanism&&(0,r.EG)(y,n.mechanism);let S=(0,i.WD)(y);const k=m&&m.getEventProcessors?m.getEventProcessors():[];if(v){if(v.getAttachments){const t=[...n.attachments||[],...v.getAttachments()];t.length&&(n.attachments=t)}S=v.applyToEvent(y,n,k)}else S=(0,u.RP)([...k,...(0,u.fH)()],y,n);return S.then((t=>(t&&function(t){const e={};try{t.exception.values.forEach((t=>{t.stacktrace.frames.forEach((t=>{t.debug_id&&(t.abs_path?e[t.abs_path]=t.debug_id:t.filename&&(e[t.filename]=t.debug_id),delete t.debug_id)}))}))}catch(r){}if(0===Object.keys(e).length)return;t.debug_meta=t.debug_meta||{},t.debug_meta.images=t.debug_meta.images||[];const n=t.debug_meta.images;Object.keys(e).forEach((t=>{n.push({type:"sourcemap",code_file:t,debug_id:e[t]})}))}(t),"number"===typeof f&&f>0?function(t,e,n){if(!t)return null;const r={...t,...t.breadcrumbs&&{breadcrumbs:t.breadcrumbs.map((t=>({...t,...t.data&&{data:(0,c.Fv)(t.data,e,n)}})))},...t.user&&{user:(0,c.Fv)(t.user,e,n)},...t.contexts&&{contexts:(0,c.Fv)(t.contexts,e,n)},...t.extra&&{extra:(0,c.Fv)(t.extra,e,n)}};t.contexts&&t.contexts.trace&&r.contexts&&(r.contexts.trace=t.contexts.trace,t.contexts.trace.data&&(r.contexts.trace.data=(0,c.Fv)(t.contexts.trace.data,e,n)));t.spans&&(r.spans=t.spans.map((t=>(t.data&&(t.data=(0,c.Fv)(t.data,e,n)),t))));return r}(t,f,g):t)))}const p=new WeakMap;function m(t){if(t)return function(t){return t instanceof d.s||"function"===typeof t}(t)||function(t){return Object.keys(t).some((t=>f.includes(t)))}(t)?{captureContext:t}:t}const f=["user","level","extra","contexts","tags","fingerprint","requestSession","propagationContext"]},105:(t,e,n)=>{n.d(e,{J:()=>r});const r="7.86.0"},6869:(t,e,n)=>{n.d(e,{U:()=>hr});var r=n(5659),s=n(4487);function i(t,e){const n=e.getClient(),r=n&&n.getDsn(),s=n&&n.getOptions().tunnel;return function(t,e){return!!e&&t.includes(e.host)}(t,r)||function(t,e){if(!e)return!1;return o(t)===o(e)}(t,s)}function o(t){return"/"===t[t.length-1]?t.slice(0,-1):t}var a=n(7893),c=n(8942),l=n(1235),u=n(8007),d=n(535),h=n(8464),p=n(1170),m=n(2343),f=n(2844),g=n(5322),y=n(7321),_=n(1394),v=n(5316),S=n(734),k=n(8725),b=n(228),w=n(1422);function E(){return"undefined"!==typeof window&&(!(0,w.KV)()||void 0!==l.n2.process&&"renderer"===l.n2.process.type)}var x=n(5363);const T=l.n2,I="sentryReplaySession",C="replay_event",R="Unable to send Replay",M=15e4,O=5e3,D=2e7,A=36e5;var N;function L(t){const e=null===t||void 0===t?void 0:t.host;return Boolean((null===e||void 0===e?void 0:e.shadowRoot)===t)}function $(t){return"[object ShadowRoot]"===Object.prototype.toString.call(t)}function P(t){try{const n=t.rules||t.cssRules;return n?((e=Array.from(n,F).join("")).includes(" background-clip: text;")&&!e.includes(" -webkit-background-clip: text;")&&(e=e.replace(" background-clip: text;"," -webkit-background-clip: text; background-clip: text;")),e):null}catch(n){return null}var e}function F(t){let e;if(function(t){return"styleSheet"in t}(t))try{e=P(t.styleSheet)||function(t){const{cssText:e}=t;if(e.split('"').length<3)return e;const n=["@import",`url(${JSON.stringify(t.href)})`];return""===t.layerName?n.push("layer"):t.layerName&&n.push(`layer(${t.layerName})`),t.supportsText&&n.push(`supports(${t.supportsText})`),t.media.length&&n.push(t.media.mediaText),n.join(" ")+";"}(t)}catch(n){}else if(function(t){return"selectorText"in t}(t)&&t.selectorText.includes(":"))return function(t){const e=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return t.replace(e,"$1\\$2")}(t.cssText);return e||t.cssText}!function(t){t[t.Document=0]="Document",t[t.DocumentType=1]="DocumentType",t[t.Element=2]="Element",t[t.Text=3]="Text",t[t.CDATA=4]="CDATA",t[t.Comment=5]="Comment"}(N||(N={}));class j{constructor(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}getId(t){var e;if(!t)return-1;const n=null===(e=this.getMeta(t))||void 0===e?void 0:e.id;return null!==n&&void 0!==n?n:-1}getNode(t){return this.idNodeMap.get(t)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(t){return this.nodeMetaMap.get(t)||null}removeNodeFromMap(t){const e=this.getId(t);this.idNodeMap.delete(e),t.childNodes&&t.childNodes.forEach((t=>this.removeNodeFromMap(t)))}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,e){const n=e.id;this.idNodeMap.set(n,t),this.nodeMetaMap.set(t,e)}replace(t,e){const n=this.getNode(t);if(n){const t=this.nodeMetaMap.get(n);t&&this.nodeMetaMap.set(e,t)}this.idNodeMap.set(t,e)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function U({maskInputOptions:t,tagName:e,type:n}){return"OPTION"===e&&(e="SELECT"),Boolean(t[e.toLowerCase()]||n&&t[n]||"password"===n||"INPUT"===e&&!n&&t.text)}function B({isMasked:t,element:e,value:n,maskInputFn:r}){let s=n||"";return t?(r&&(s=r(s,e)),"*".repeat(s.length)):s}function H(t){return t.toLowerCase()}function z(t){return t.toUpperCase()}const W="__rrweb_original__";function q(t){const e=t.type;return t.hasAttribute("data-rr-is-password")?"password":e?H(e):null}function X(t,e,n){return"INPUT"!==e||"radio"!==n&&"checkbox"!==n?t.value:t.getAttribute("value")||""}let G=1;const K=new RegExp("[^a-z0-9-_:]"),J=-2;function Y(){return G++}let V,Q;const Z=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,tt=/^(?:[a-z+]+:)?\/\//i,et=/^www\..*/i,nt=/^(data:)([^,]*),(.*)/i;function rt(t,e){return(t||"").replace(Z,((t,n,r,s,i,o)=>{const a=r||i||o,c=n||s||"";if(!a)return t;if(tt.test(a)||et.test(a))return`url(${c}${a}${c})`;if(nt.test(a))return`url(${c}${a}${c})`;if("/"===a[0])return`url(${c}${function(t){let e="";return e=t.indexOf("//")>-1?t.split("/").slice(0,3).join("/"):t.split("/")[0],e=e.split("?")[0],e}(e)+a}${c})`;const l=e.split("/"),u=a.split("/");l.pop();for(const e of u)"."!==e&&(".."===e?l.pop():l.push(e));return`url(${c}${l.join("/")}${c})`}))}const st=/^[^ \t\n\r\u000c]+/,it=/^[, \t\n\r\u000c]+/;function ot(t,e){if(!e||""===e.trim())return e;const n=t.createElement("a");return n.href=e,n.href}function at(t){return Boolean("svg"===t.tagName||t.ownerSVGElement)}function ct(){const t=document.createElement("a");return t.href="",t.href}function lt(t,e,n,r,s,i){return r?"src"===n||"href"===n&&("use"!==e||"#"!==r[0])||"xlink:href"===n&&"#"!==r[0]?ot(t,r):"background"!==n||"table"!==e&&"td"!==e&&"th"!==e?"srcset"===n?function(t,e){if(""===e.trim())return e;let n=0;function r(t){let r;const s=t.exec(e.substring(n));return s?(r=s[0],n+=r.length,r):""}const s=[];for(;r(it),!(n>=e.length);){let i=r(st);if(","===i.slice(-1))i=ot(t,i.substring(0,i.length-1)),s.push(i);else{let r="";i=ot(t,i);let o=!1;for(;;){const t=e.charAt(n);if(""===t){s.push((i+r).trim());break}if(o)")"===t&&(o=!1);else{if(","===t){n+=1,s.push((i+r).trim());break}"("===t&&(o=!0)}r+=t,n+=1}}}return s.join(", ")}(t,r):"style"===n?rt(r,ct()):"object"===e&&"data"===n?ot(t,r):"function"===typeof i?i(n,r,s):r:ot(t,r):r}function ut(t,e,n){return("video"===t||"audio"===t)&&"autoplay"===e}function dt(t,e,n=1/0,r=0){return t?t.nodeType!==t.ELEMENT_NODE||r>n?-1:e(t)?r:dt(t.parentNode,e,n,r+1):-1}function ht(t,e){return n=>{const r=n;if(null===r)return!1;if(t)if("string"===typeof t){if(r.matches(`.${t}`))return!0}else if(function(t,e){for(let n=t.classList.length;n--;){const r=t.classList[n];if(e.test(r))return!0}return!1}(r,t))return!0;return!(!e||!r.matches(e))}}function pt(t,e,n,r,s,i){try{const o=t.nodeType===t.ELEMENT_NODE?t:t.parentElement;if(null===o)return!1;let a=-1,c=-1;if(i){if(c=dt(o,ht(r,s)),c<0)return!0;a=dt(o,ht(e,n),c>=0?c:1/0)}else{if(a=dt(o,ht(e,n)),a<0)return!1;c=dt(o,ht(r,s),a>=0?a:1/0)}return a>=0?!(c>=0)||a<=c:!(c>=0)&&!!i}catch(o){}return!!i}function mt(t,e){const{doc:n,mirror:r,blockClass:s,blockSelector:i,unblockSelector:o,maskAllText:a,maskAttributeFn:c,maskTextClass:l,unmaskTextClass:u,maskTextSelector:d,unmaskTextSelector:h,inlineStylesheet:p,maskInputOptions:m={},maskTextFn:f,maskInputFn:g,dataURLOptions:y={},inlineImages:_,recordCanvas:v,keepIframeSrcFn:S,newlyAddedElement:k=!1}=e,b=function(t,e){if(!e.hasNode(t))return;const n=e.getId(t);return 1===n?void 0:n}(n,r);switch(t.nodeType){case t.DOCUMENT_NODE:return"CSS1Compat"!==t.compatMode?{type:N.Document,childNodes:[],compatMode:t.compatMode}:{type:N.Document,childNodes:[]};case t.DOCUMENT_TYPE_NODE:return{type:N.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:b};case t.ELEMENT_NODE:return function(t,e){const{doc:n,blockClass:r,blockSelector:s,unblockSelector:i,inlineStylesheet:o,maskInputOptions:a={},maskAttributeFn:c,maskInputFn:l,dataURLOptions:u={},inlineImages:d,recordCanvas:h,keepIframeSrcFn:p,newlyAddedElement:m=!1,rootId:f,maskAllText:g,maskTextClass:y,unmaskTextClass:_,maskTextSelector:v,unmaskTextSelector:S}=e,k=function(t,e,n,r){try{if(r&&t.matches(r))return!1;if("string"===typeof e){if(t.classList.contains(e))return!0}else for(let n=t.classList.length;n--;){const r=t.classList[n];if(e.test(r))return!0}if(n)return t.matches(n)}catch(s){}return!1}(t,r,s,i),b=function(t){if(t instanceof HTMLFormElement)return"form";const e=H(t.tagName);return K.test(e)?"div":e}(t);let w={};const E=t.attributes.length;for(let I=0;I<E;I++){const e=t.attributes[I];ut(b,e.name,e.value)||(w[e.name]=lt(n,b,H(e.name),e.value,t,c))}if("link"===b&&o){const e=Array.from(n.styleSheets).find((e=>e.href===t.href));let r=null;e&&(r=P(e)),r&&(delete w.rel,delete w.href,w._cssText=rt(r,e.href))}if("style"===b&&t.sheet&&!(t.innerText||t.textContent||"").trim().length){const e=P(t.sheet);e&&(w._cssText=rt(e,ct()))}if("input"===b||"textarea"===b||"select"===b||"option"===b){const e=t,n=q(e),r=X(e,z(b),n),s=e.checked;if("submit"!==n&&"button"!==n&&r){const t=pt(e,y,v,_,S,U({type:n,tagName:z(b),maskInputOptions:a}));w.value=B({isMasked:t,element:e,value:r,maskInputFn:l})}s&&(w.checked=s)}"option"===b&&(t.selected&&!a.select?w.selected=!0:delete w.selected);if("canvas"===b&&h)if("2d"===t.__context)(function(t){const e=t.getContext("2d");if(!e)return!0;for(let n=0;n<t.width;n+=50)for(let r=0;r<t.height;r+=50){const s=e.getImageData,i=W in s?s[W]:s;if(new Uint32Array(i.call(e,n,r,Math.min(50,t.width-n),Math.min(50,t.height-r)).data.buffer).some((t=>0!==t)))return!1}return!0})(t)||(w.rr_dataURL=t.toDataURL(u.type,u.quality));else if(!("__context"in t)){const e=t.toDataURL(u.type,u.quality),n=document.createElement("canvas");n.width=t.width,n.height=t.height;e!==n.toDataURL(u.type,u.quality)&&(w.rr_dataURL=e)}if("img"===b&&d){V||(V=n.createElement("canvas"),Q=V.getContext("2d"));const e=t,r=e.crossOrigin;e.crossOrigin="anonymous";const s=()=>{e.removeEventListener("load",s);try{V.width=e.naturalWidth,V.height=e.naturalHeight,Q.drawImage(e,0,0),w.rr_dataURL=V.toDataURL(u.type,u.quality)}catch(t){console.warn(`Cannot inline img src=${e.currentSrc}! Error: ${t}`)}r?w.crossOrigin=r:e.removeAttribute("crossorigin")};e.complete&&0!==e.naturalWidth?s():e.addEventListener("load",s)}"audio"!==b&&"video"!==b||(w.rr_mediaState=t.paused?"paused":"played",w.rr_mediaCurrentTime=t.currentTime);m||(t.scrollLeft&&(w.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(w.rr_scrollTop=t.scrollTop));if(k){const{width:e,height:n}=t.getBoundingClientRect();w={class:w.class,rr_width:`${e}px`,rr_height:`${n}px`}}"iframe"!==b||p(w.src)||(t.contentDocument||(w.rr_src=w.src),delete w.src);let x;try{customElements.get(b)&&(x=!0)}catch(T){}return{type:N.Element,tagName:b,attributes:w,childNodes:[],isSVG:at(t)||void 0,needBlock:k,rootId:f,isCustom:x}}(t,{doc:n,blockClass:s,blockSelector:i,unblockSelector:o,inlineStylesheet:p,maskAttributeFn:c,maskInputOptions:m,maskInputFn:g,dataURLOptions:y,inlineImages:_,recordCanvas:v,keepIframeSrcFn:S,newlyAddedElement:k,rootId:b,maskAllText:a,maskTextClass:l,unmaskTextClass:u,maskTextSelector:d,unmaskTextSelector:h});case t.TEXT_NODE:return function(t,e){var n;const{maskAllText:r,maskTextClass:s,unmaskTextClass:i,maskTextSelector:o,unmaskTextSelector:a,maskTextFn:c,maskInputOptions:l,maskInputFn:u,rootId:d}=e,h=t.parentNode&&t.parentNode.tagName;let p=t.textContent;const m="STYLE"===h||void 0,f="SCRIPT"===h||void 0,g="TEXTAREA"===h||void 0;if(m&&p){try{t.nextSibling||t.previousSibling||(null===(n=t.parentNode.sheet)||void 0===n?void 0:n.cssRules)&&(p=P(t.parentNode.sheet))}catch(_){console.warn(`Cannot get CSS styles from text's parentNode. Error: ${_}`,t)}p=rt(p,ct())}f&&(p="SCRIPT_PLACEHOLDER");const y=pt(t,s,o,i,a,r);m||f||g||!p||!y||(p=c?c(p):p.replace(/[\S]/g,"*"));g&&p&&(l.textarea||y)&&(p=u?u(p,t.parentNode):p.replace(/[\S]/g,"*"));if("OPTION"===h&&p){p=B({isMasked:pt(t,s,o,i,a,U({type:null,tagName:h,maskInputOptions:l})),element:t,value:p,maskInputFn:u})}return{type:N.Text,textContent:p||"",isStyle:m,rootId:d}}(t,{maskAllText:a,maskTextClass:l,unmaskTextClass:u,maskTextSelector:d,unmaskTextSelector:h,maskTextFn:f,maskInputOptions:m,maskInputFn:g,rootId:b});case t.CDATA_SECTION_NODE:return{type:N.CDATA,textContent:"",rootId:b};case t.COMMENT_NODE:return{type:N.Comment,textContent:t.textContent||"",rootId:b};default:return!1}}function ft(t){return void 0===t||null===t?"":t.toLowerCase()}function gt(t,e){const{doc:n,mirror:r,blockClass:s,blockSelector:i,unblockSelector:o,maskAllText:a,maskTextClass:c,unmaskTextClass:l,maskTextSelector:u,unmaskTextSelector:d,skipChild:h=!1,inlineStylesheet:p=!0,maskInputOptions:m={},maskAttributeFn:f,maskTextFn:g,maskInputFn:y,slimDOMOptions:_,dataURLOptions:v={},inlineImages:S=!1,recordCanvas:k=!1,onSerialize:b,onIframeLoad:w,iframeLoadTimeout:E=5e3,onStylesheetLoad:x,stylesheetLoadTimeout:T=5e3,keepIframeSrcFn:I=(()=>!1),newlyAddedElement:C=!1}=e;let{preserveWhiteSpace:R=!0}=e;const M=mt(t,{doc:n,mirror:r,blockClass:s,blockSelector:i,maskAllText:a,unblockSelector:o,maskTextClass:c,unmaskTextClass:l,maskTextSelector:u,unmaskTextSelector:d,inlineStylesheet:p,maskInputOptions:m,maskAttributeFn:f,maskTextFn:g,maskInputFn:y,dataURLOptions:v,inlineImages:S,recordCanvas:k,keepIframeSrcFn:I,newlyAddedElement:C});if(!M)return console.warn(t,"not serialized"),null;let O;O=r.hasNode(t)?r.getId(t):!function(t,e){if(e.comment&&t.type===N.Comment)return!0;if(t.type===N.Element){if(e.script&&("script"===t.tagName||"link"===t.tagName&&("preload"===t.attributes.rel||"modulepreload"===t.attributes.rel)&&"script"===t.attributes.as||"link"===t.tagName&&"prefetch"===t.attributes.rel&&"string"===typeof t.attributes.href&&t.attributes.href.endsWith(".js")))return!0;if(e.headFavicon&&("link"===t.tagName&&"shortcut icon"===t.attributes.rel||"meta"===t.tagName&&(ft(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===ft(t.attributes.name)||"icon"===ft(t.attributes.rel)||"apple-touch-icon"===ft(t.attributes.rel)||"shortcut icon"===ft(t.attributes.rel))))return!0;if("meta"===t.tagName){if(e.headMetaDescKeywords&&ft(t.attributes.name).match(/^description|keywords$/))return!0;if(e.headMetaSocial&&(ft(t.attributes.property).match(/^(og|twitter|fb):/)||ft(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===ft(t.attributes.name)))return!0;if(e.headMetaRobots&&("robots"===ft(t.attributes.name)||"googlebot"===ft(t.attributes.name)||"bingbot"===ft(t.attributes.name)))return!0;if(e.headMetaHttpEquiv&&void 0!==t.attributes["http-equiv"])return!0;if(e.headMetaAuthorship&&("author"===ft(t.attributes.name)||"generator"===ft(t.attributes.name)||"framework"===ft(t.attributes.name)||"publisher"===ft(t.attributes.name)||"progid"===ft(t.attributes.name)||ft(t.attributes.property).match(/^article:/)||ft(t.attributes.property).match(/^product:/)))return!0;if(e.headMetaVerification&&("google-site-verification"===ft(t.attributes.name)||"yandex-verification"===ft(t.attributes.name)||"csrf-token"===ft(t.attributes.name)||"p:domain_verify"===ft(t.attributes.name)||"verify-v1"===ft(t.attributes.name)||"verification"===ft(t.attributes.name)||"shopify-checkout-api-token"===ft(t.attributes.name)))return!0}}return!1}(M,_)&&(R||M.type!==N.Text||M.isStyle||M.textContent.replace(/^\s+|\s+$/gm,"").length)?Y():J;const D=Object.assign(M,{id:O});if(r.add(t,D),O===J)return null;b&&b(t);let A=!h;if(D.type===N.Element){A=A&&!D.needBlock,delete D.needBlock;const e=t.shadowRoot;e&&$(e)&&(D.isShadowHost=!0)}if((D.type===N.Document||D.type===N.Element)&&A){_.headWhitespace&&D.type===N.Element&&"head"===D.tagName&&(R=!1);const e={doc:n,mirror:r,blockClass:s,blockSelector:i,maskAllText:a,unblockSelector:o,maskTextClass:c,unmaskTextClass:l,maskTextSelector:u,unmaskTextSelector:d,skipChild:h,inlineStylesheet:p,maskInputOptions:m,maskAttributeFn:f,maskTextFn:g,maskInputFn:y,slimDOMOptions:_,dataURLOptions:v,inlineImages:S,recordCanvas:k,preserveWhiteSpace:R,onSerialize:b,onIframeLoad:w,iframeLoadTimeout:E,onStylesheetLoad:x,stylesheetLoadTimeout:T,keepIframeSrcFn:I};for(const n of Array.from(t.childNodes)){const t=gt(n,e);t&&D.childNodes.push(t)}if(function(t){return t.nodeType===t.ELEMENT_NODE}(t)&&t.shadowRoot)for(const n of Array.from(t.shadowRoot.childNodes)){const r=gt(n,e);r&&($(t.shadowRoot)&&(r.isShadow=!0),D.childNodes.push(r))}}return t.parentNode&&L(t.parentNode)&&$(t.parentNode)&&(D.isShadow=!0),D.type===N.Element&&"iframe"===D.tagName&&function(t,e,n){const r=t.contentWindow;if(!r)return;let s,i=!1;try{s=r.document.readyState}catch(a){return}if("complete"!==s){const r=setTimeout((()=>{i||(e(),i=!0)}),n);return void t.addEventListener("load",(()=>{clearTimeout(r),i=!0,e()}))}const o="about:blank";if(r.location.href!==o||t.src===o||""===t.src)return setTimeout(e,0),t.addEventListener("load",e);t.addEventListener("load",e)}(t,(()=>{const e=t.contentDocument;if(e&&w){const n=gt(e,{doc:e,mirror:r,blockClass:s,blockSelector:i,unblockSelector:o,maskAllText:a,maskTextClass:c,unmaskTextClass:l,maskTextSelector:u,unmaskTextSelector:d,skipChild:!1,inlineStylesheet:p,maskInputOptions:m,maskAttributeFn:f,maskTextFn:g,maskInputFn:y,slimDOMOptions:_,dataURLOptions:v,inlineImages:S,recordCanvas:k,preserveWhiteSpace:R,onSerialize:b,onIframeLoad:w,iframeLoadTimeout:E,onStylesheetLoad:x,stylesheetLoadTimeout:T,keepIframeSrcFn:I});n&&w(t,n)}}),E),D.type===N.Element&&"link"===D.tagName&&"stylesheet"===D.attributes.rel&&function(t,e,n){let r,s=!1;try{r=t.sheet}catch(o){return}if(r)return;const i=setTimeout((()=>{s||(e(),s=!0)}),n);t.addEventListener("load",(()=>{clearTimeout(i),s=!0,e()}))}(t,(()=>{if(x){const e=gt(t,{doc:n,mirror:r,blockClass:s,blockSelector:i,unblockSelector:o,maskAllText:a,maskTextClass:c,unmaskTextClass:l,maskTextSelector:u,unmaskTextSelector:d,skipChild:!1,inlineStylesheet:p,maskInputOptions:m,maskAttributeFn:f,maskTextFn:g,maskInputFn:y,slimDOMOptions:_,dataURLOptions:v,inlineImages:S,recordCanvas:k,preserveWhiteSpace:R,onSerialize:b,onIframeLoad:w,iframeLoadTimeout:E,onStylesheetLoad:x,stylesheetLoadTimeout:T,keepIframeSrcFn:I});e&&x(t,e)}}),T),D}function yt(t,e,n=document){const r={capture:!0,passive:!0};return n.addEventListener(t,e,r),()=>n.removeEventListener(t,e,r)}const _t="Please stop import mirror directly. Instead of that,\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\r\nor you can use record.mirror to access the mirror instance during recording.";let vt={map:{},getId:()=>(console.error(_t),-1),getNode:()=>(console.error(_t),null),removeNodeFromMap(){console.error(_t)},has:()=>(console.error(_t),!1),reset(){console.error(_t)}};function St(t,e,n={}){let r=null,s=0;return function(...i){const o=Date.now();s||!1!==n.leading||(s=o);const a=e-(o-s),c=this;a<=0||a>e?(r&&(clearTimeout(r),r=null),s=o,t.apply(c,i)):r||!1===n.trailing||(r=setTimeout((()=>{s=!1===n.leading?0:Date.now(),r=null,t.apply(c,i)}),a))}}function kt(t,e,n,r,s=window){const i=s.Object.getOwnPropertyDescriptor(t,e);return s.Object.defineProperty(t,e,r?n:{set(t){setTimeout((()=>{n.set.call(this,t)}),0),i&&i.set&&i.set.call(this,t)}}),()=>kt(t,e,i||{},!0)}function bt(t,e,n){try{if(!(e in t))return()=>{};const r=t[e],s=n(r);return"function"===typeof s&&(s.prototype=s.prototype||{},Object.defineProperties(s,{__rrweb_original__:{enumerable:!1,value:r}})),t[e]=s,()=>{t[e]=r}}catch(r){return()=>{}}}"undefined"!==typeof window&&window.Proxy&&window.Reflect&&(vt=new Proxy(vt,{get:(t,e,n)=>("map"===e&&console.error(_t),Reflect.get(t,e,n))}));let wt=Date.now;function Et(t){var e,n,r,s,i,o;const a=t.document;return{left:a.scrollingElement?a.scrollingElement.scrollLeft:void 0!==t.pageXOffset?t.pageXOffset:(null===a||void 0===a?void 0:a.documentElement.scrollLeft)||(null===(n=null===(e=null===a||void 0===a?void 0:a.body)||void 0===e?void 0:e.parentElement)||void 0===n?void 0:n.scrollLeft)||(null===(r=null===a||void 0===a?void 0:a.body)||void 0===r?void 0:r.scrollLeft)||0,top:a.scrollingElement?a.scrollingElement.scrollTop:void 0!==t.pageYOffset?t.pageYOffset:(null===a||void 0===a?void 0:a.documentElement.scrollTop)||(null===(i=null===(s=null===a||void 0===a?void 0:a.body)||void 0===s?void 0:s.parentElement)||void 0===i?void 0:i.scrollTop)||(null===(o=null===a||void 0===a?void 0:a.body)||void 0===o?void 0:o.scrollTop)||0}}function xt(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Tt(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function It(t,e,n,r,s){if(!t)return!1;const i=t.nodeType===t.ELEMENT_NODE?t:t.parentElement;if(!i)return!1;const o=ht(e,n);if(!s){const t=r&&i.matches(r);return o(i)&&!t}const a=dt(i,o);let c=-1;return!(a<0)&&(r&&(c=dt(i,ht(null,r))),a>-1&&c<0||a<c)}function Ct(t,e){return e.getId(t)===J}function Rt(t,e){if(L(t))return!1;const n=e.getId(t);return!e.has(n)||(!t.parentNode||t.parentNode.nodeType!==t.DOCUMENT_NODE)&&(!t.parentNode||Rt(t.parentNode,e))}function Mt(t){return Boolean(t.changedTouches)}function Ot(t,e){return Boolean("IFRAME"===t.nodeName&&e.getMeta(t))}function Dt(t,e){return Boolean("LINK"===t.nodeName&&t.nodeType===t.ELEMENT_NODE&&t.getAttribute&&"stylesheet"===t.getAttribute("rel")&&e.getMeta(t))}function At(t){return Boolean(null===t||void 0===t?void 0:t.shadowRoot)}/[1-9][0-9]{12}/.test(Date.now().toString())||(wt=()=>(new Date).getTime());class Nt{constructor(){this.id=1,this.styleIDMap=new WeakMap,this.idStyleMap=new Map}getId(t){var e;return null!==(e=this.styleIDMap.get(t))&&void 0!==e?e:-1}has(t){return this.styleIDMap.has(t)}add(t,e){if(this.has(t))return this.getId(t);let n;return n=void 0===e?this.id++:e,this.styleIDMap.set(t,n),this.idStyleMap.set(n,t),n}getStyle(t){return this.idStyleMap.get(t)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}function Lt(t){var e,n;let r=null;return(null===(n=null===(e=t.getRootNode)||void 0===e?void 0:e.call(t))||void 0===n?void 0:n.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&t.getRootNode().host&&(r=t.getRootNode().host),r}function $t(t){const e=t.ownerDocument;if(!e)return!1;const n=function(t){let e,n=t;for(;e=Lt(n);)n=e;return n}(t);return e.contains(n)}function Pt(t){const e=t.ownerDocument;return!!e&&(e.contains(t)||$t(t))}var Ft=(t=>(t[t.DomContentLoaded=0]="DomContentLoaded",t[t.Load=1]="Load",t[t.FullSnapshot=2]="FullSnapshot",t[t.IncrementalSnapshot=3]="IncrementalSnapshot",t[t.Meta=4]="Meta",t[t.Custom=5]="Custom",t[t.Plugin=6]="Plugin",t))(Ft||{}),jt=(t=>(t[t.Mutation=0]="Mutation",t[t.MouseMove=1]="MouseMove",t[t.MouseInteraction=2]="MouseInteraction",t[t.Scroll=3]="Scroll",t[t.ViewportResize=4]="ViewportResize",t[t.Input=5]="Input",t[t.TouchMove=6]="TouchMove",t[t.MediaInteraction=7]="MediaInteraction",t[t.StyleSheetRule=8]="StyleSheetRule",t[t.CanvasMutation=9]="CanvasMutation",t[t.Font=10]="Font",t[t.Log=11]="Log",t[t.Drag=12]="Drag",t[t.StyleDeclaration=13]="StyleDeclaration",t[t.Selection=14]="Selection",t[t.AdoptedStyleSheet=15]="AdoptedStyleSheet",t[t.CustomElement=16]="CustomElement",t))(jt||{}),Ut=(t=>(t[t.MouseUp=0]="MouseUp",t[t.MouseDown=1]="MouseDown",t[t.Click=2]="Click",t[t.ContextMenu=3]="ContextMenu",t[t.DblClick=4]="DblClick",t[t.Focus=5]="Focus",t[t.Blur=6]="Blur",t[t.TouchStart=7]="TouchStart",t[t.TouchMove_Departed=8]="TouchMove_Departed",t[t.TouchEnd=9]="TouchEnd",t[t.TouchCancel=10]="TouchCancel",t))(Ut||{}),Bt=(t=>(t[t.Mouse=0]="Mouse",t[t.Pen=1]="Pen",t[t.Touch=2]="Touch",t))(Bt||{});function Ht(t){return"__ln"in t}class zt{constructor(){this.length=0,this.head=null,this.tail=null}get(t){if(t>=this.length)throw new Error("Position outside of list range");let e=this.head;for(let n=0;n<t;n++)e=(null===e||void 0===e?void 0:e.next)||null;return e}addNode(t){const e={value:t,previous:null,next:null};if(t.__ln=e,t.previousSibling&&Ht(t.previousSibling)){const n=t.previousSibling.__ln.next;e.next=n,e.previous=t.previousSibling.__ln,t.previousSibling.__ln.next=e,n&&(n.previous=e)}else if(t.nextSibling&&Ht(t.nextSibling)&&t.nextSibling.__ln.previous){const n=t.nextSibling.__ln.previous;e.previous=n,e.next=t.nextSibling.__ln,t.nextSibling.__ln.previous=e,n&&(n.next=e)}else this.head&&(this.head.previous=e),e.next=this.head,this.head=e;null===e.next&&(this.tail=e),this.length++}removeNode(t){const e=t.__ln;this.head&&(e.previous?(e.previous.next=e.next,e.next?e.next.previous=e.previous:this.tail=e.previous):(this.head=e.next,this.head?this.head.previous=null:this.tail=null),t.__ln&&delete t.__ln,this.length--)}}const Wt=(t,e)=>`${t}@${e}`;class qt{constructor(){this.frozen=!1,this.locked=!1,this.texts=[],this.attributes=[],this.removes=[],this.mapRemoves=[],this.movedMap={},this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.processMutations=t=>{t.forEach(this.processMutation),this.emit()},this.emit=()=>{if(this.frozen||this.locked)return;const t=[],e=new Set,n=new zt,r=t=>{let e=t,n=J;for(;n===J;)e=e&&e.nextSibling,n=e&&this.mirror.getId(e);return n},s=s=>{if(!s.parentNode||!Pt(s))return;const i=L(s.parentNode)?this.mirror.getId(Lt(s)):this.mirror.getId(s.parentNode),o=r(s);if(-1===i||-1===o)return n.addNode(s);const a=gt(s,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskAllText:this.maskAllText,unblockSelector:this.unblockSelector,maskTextClass:this.maskTextClass,unmaskTextClass:this.unmaskTextClass,maskTextSelector:this.maskTextSelector,unmaskTextSelector:this.unmaskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskAttributeFn:this.maskAttributeFn,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:t=>{Ot(t,this.mirror)&&this.iframeManager.addIframe(t),Dt(t,this.mirror)&&this.stylesheetManager.trackLinkElement(t),At(s)&&this.shadowDomManager.addShadowRoot(s.shadowRoot,this.doc)},onIframeLoad:(t,e)=>{this.iframeManager.attachIframe(t,e),this.shadowDomManager.observeAttachShadow(t)},onStylesheetLoad:(t,e)=>{this.stylesheetManager.attachLinkElement(t,e)}});a&&(t.push({parentId:i,nextId:o,node:a}),e.add(a.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const a of this.movedSet)Gt(this.removes,a,this.mirror)&&!this.movedSet.has(a.parentNode)||s(a);for(const a of this.addedSet)Jt(this.droppedSet,a)||Gt(this.removes,a,this.mirror)?Jt(this.movedSet,a)?s(a):this.droppedSet.add(a):s(a);let i=null;for(;n.length;){let t=null;if(i){const e=this.mirror.getId(i.value.parentNode),n=r(i.value);-1!==e&&-1!==n&&(t=i)}if(!t){let e=n.tail;for(;e;){const n=e;if(e=e.previous,n){const e=this.mirror.getId(n.value.parentNode);if(-1===r(n.value))continue;if(-1!==e){t=n;break}{const e=n.value;if(e.parentNode&&e.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const r=e.parentNode.host;if(-1!==this.mirror.getId(r)){t=n;break}}}}}}if(!t){for(;n.head;)n.removeNode(n.head.value);break}i=t.previous,n.removeNode(t.value),s(t.value)}const o={texts:this.texts.map((t=>({id:this.mirror.getId(t.node),value:t.value}))).filter((t=>!e.has(t.id))).filter((t=>this.mirror.has(t.id))),attributes:this.attributes.map((t=>{const{attributes:e}=t;if("string"===typeof e.style){const n=JSON.stringify(t.styleDiff),r=JSON.stringify(t._unchangedStyles);n.length<e.style.length&&(n+r).split("var(").length===e.style.split("var(").length&&(e.style=t.styleDiff)}return{id:this.mirror.getId(t.node),attributes:e}})).filter((t=>!e.has(t.id))).filter((t=>this.mirror.has(t.id))),removes:this.removes,adds:t};(o.texts.length||o.attributes.length||o.removes.length||o.adds.length)&&(this.texts=[],this.attributes=[],this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.movedMap={},this.mutationCb(o))},this.processMutation=t=>{if(Ct(t.target,this.mirror))return;let e;try{e=document.implementation.createHTMLDocument()}catch(n){e=this.doc}switch(t.type){case"characterData":{const e=t.target.textContent;It(t.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)||e===t.oldValue||this.texts.push({value:pt(t.target,this.maskTextClass,this.maskTextSelector,this.unmaskTextClass,this.unmaskTextSelector,this.maskAllText)&&e?this.maskTextFn?this.maskTextFn(e):e.replace(/[\S]/g,"*"):e,node:t.target});break}case"attributes":{const n=t.target;let r=t.attributeName,s=t.target.getAttribute(r);if("value"===r){const e=q(n),r=n.tagName;s=X(n,r,e);const i=U({maskInputOptions:this.maskInputOptions,tagName:r,type:e});s=B({isMasked:pt(t.target,this.maskTextClass,this.maskTextSelector,this.unmaskTextClass,this.unmaskTextSelector,i),element:n,value:s,maskInputFn:this.maskInputFn})}if(It(t.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)||s===t.oldValue)return;let i=this.attributes.find((e=>e.node===t.target));if("IFRAME"===n.tagName&&"src"===r&&!this.keepIframeSrcFn(s)){if(n.contentDocument)return;r="rr_src"}if(i||(i={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(i)),"type"===r&&"INPUT"===n.tagName&&"password"===(t.oldValue||"").toLowerCase()&&n.setAttribute("data-rr-is-password","true"),!ut(n.tagName,r)&&(i.attributes[r]=lt(this.doc,H(n.tagName),H(r),s,n,this.maskAttributeFn),"style"===r)){const r=e.createElement("span");t.oldValue&&r.setAttribute("style",t.oldValue);for(const t of Array.from(n.style)){const e=n.style.getPropertyValue(t),s=n.style.getPropertyPriority(t);e!==r.style.getPropertyValue(t)||s!==r.style.getPropertyPriority(t)?i.styleDiff[t]=""===s?e:[e,s]:i._unchangedStyles[t]=[e,s]}for(const t of Array.from(r.style))""===n.style.getPropertyValue(t)&&(i.styleDiff[t]=!1)}break}case"childList":if(It(t.target,this.blockClass,this.blockSelector,this.unblockSelector,!0))return;t.addedNodes.forEach((e=>this.genAdds(e,t.target))),t.removedNodes.forEach((e=>{const n=this.mirror.getId(e),r=L(t.target)?this.mirror.getId(t.target.host):this.mirror.getId(t.target);It(t.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)||Ct(e,this.mirror)||!function(t,e){return-1!==e.getId(t)}(e,this.mirror)||(this.addedSet.has(e)?(Xt(this.addedSet,e),this.droppedSet.add(e)):this.addedSet.has(t.target)&&-1===n||Rt(t.target,this.mirror)||(this.movedSet.has(e)&&this.movedMap[Wt(n,r)]?Xt(this.movedSet,e):this.removes.push({parentId:r,id:n,isShadow:!(!L(t.target)||!$(t.target))||void 0})),this.mapRemoves.push(e))}))}},this.genAdds=(t,e)=>{if(!this.processedNodeManager.inOtherBuffer(t,this)&&!this.addedSet.has(t)&&!this.movedSet.has(t)){if(this.mirror.hasNode(t)){if(Ct(t,this.mirror))return;this.movedSet.add(t);let n=null;e&&this.mirror.hasNode(e)&&(n=this.mirror.getId(e)),n&&-1!==n&&(this.movedMap[Wt(this.mirror.getId(t),n)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);It(t,this.blockClass,this.blockSelector,this.unblockSelector,!1)||(t.childNodes.forEach((t=>this.genAdds(t))),At(t)&&t.shadowRoot.childNodes.forEach((e=>{this.processedNodeManager.add(e,this),this.genAdds(e,t)})))}}}init(t){["mutationCb","blockClass","blockSelector","unblockSelector","maskAllText","maskTextClass","unmaskTextClass","maskTextSelector","unmaskTextSelector","inlineStylesheet","maskInputOptions","maskAttributeFn","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach((e=>{this[e]=t[e]}))}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}}function Xt(t,e){t.delete(e),e.childNodes.forEach((e=>Xt(t,e)))}function Gt(t,e,n){return 0!==t.length&&Kt(t,e,n)}function Kt(t,e,n){const{parentNode:r}=e;if(!r)return!1;const s=n.getId(r);return!!t.some((t=>t.id===s))||Kt(t,r,n)}function Jt(t,e){return 0!==t.size&&Yt(t,e)}function Yt(t,e){const{parentNode:n}=e;return!!n&&(!!t.has(n)||Yt(t,n))}let Vt;function Qt(t){Vt=t}function Zt(){Vt=void 0}const te=t=>{if(!Vt)return t;return(...e)=>{try{return t(...e)}catch(n){if(Vt&&!0===Vt(n))return()=>{};throw n}}},ee=[];function ne(t){try{if("composedPath"in t){const e=t.composedPath();if(e.length)return e[0]}else if("path"in t&&t.path.length)return t.path[0]}catch(e){}return t&&t.target}function re(t,e){var n,r;const s=new qt;ee.push(s),s.init(t);let i=window.MutationObserver||window.__rrMutationObserver;const o=null===(r=null===(n=null===window||void 0===window?void 0:window.Zone)||void 0===n?void 0:n.__symbol__)||void 0===r?void 0:r.call(n,"MutationObserver");o&&window[o]&&(i=window[o]);const a=new i(te((e=>{t.onMutation&&!1===t.onMutation(e)||s.processMutations.bind(s)(e)})));return a.observe(e,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),a}function se({mouseInteractionCb:t,doc:e,mirror:n,blockClass:r,blockSelector:s,unblockSelector:i,sampling:o}){if(!1===o.mouseInteraction)return()=>{};const a=!0===o.mouseInteraction||void 0===o.mouseInteraction?{}:o.mouseInteraction,c=[];let l=null;return Object.keys(Ut).filter((t=>Number.isNaN(Number(t))&&!t.endsWith("_Departed")&&!1!==a[t])).forEach((o=>{let a=H(o);const u=(e=>o=>{const a=ne(o);if(It(a,r,s,i,!0))return;let c=null,u=e;if("pointerType"in o){switch(o.pointerType){case"mouse":c=Bt.Mouse;break;case"touch":c=Bt.Touch;break;case"pen":c=Bt.Pen}c===Bt.Touch?Ut[e]===Ut.MouseDown?u="TouchStart":Ut[e]===Ut.MouseUp&&(u="TouchEnd"):Bt.Pen}else Mt(o)&&(c=Bt.Touch);null!==c?(l=c,(u.startsWith("Touch")&&c===Bt.Touch||u.startsWith("Mouse")&&c===Bt.Mouse)&&(c=null)):Ut[e]===Ut.Click&&(c=l,l=null);const d=Mt(o)?o.changedTouches[0]:o;if(!d)return;const h=n.getId(a),{clientX:p,clientY:m}=d;te(t)(Object.assign({type:Ut[u],id:h,x:p,y:m},null!==c&&{pointerType:c}))})(o);if(window.PointerEvent)switch(Ut[o]){case Ut.MouseDown:case Ut.MouseUp:a=a.replace("mouse","pointer");break;case Ut.TouchStart:case Ut.TouchEnd:return}c.push(yt(a,u,e))})),te((()=>{c.forEach((t=>t()))}))}function ie({scrollCb:t,doc:e,mirror:n,blockClass:r,blockSelector:s,unblockSelector:i,sampling:o}){return yt("scroll",te(St(te((o=>{const a=ne(o);if(!a||It(a,r,s,i,!0))return;const c=n.getId(a);if(a===e&&e.defaultView){const n=Et(e.defaultView);t({id:c,x:n.left,y:n.top})}else t({id:c,x:a.scrollLeft,y:a.scrollTop})})),o.scroll||100)),e)}const oe=["INPUT","TEXTAREA","SELECT"],ae=new WeakMap;function ce({inputCb:t,doc:e,mirror:n,blockClass:r,blockSelector:s,unblockSelector:i,ignoreClass:o,ignoreSelector:a,maskInputOptions:c,maskInputFn:l,sampling:u,userTriggeredOnInput:d,maskTextClass:h,unmaskTextClass:p,maskTextSelector:m,unmaskTextSelector:f}){function g(t){let n=ne(t);const u=t.isTrusted,g=n&&z(n.tagName);if("OPTION"===g&&(n=n.parentElement),!n||!g||oe.indexOf(g)<0||It(n,r,s,i,!0))return;const _=n;if(_.classList.contains(o)||a&&_.matches(a))return;const v=q(n);let S=X(_,g,v),k=!1;const b=U({maskInputOptions:c,tagName:g,type:v}),w=pt(n,h,m,p,f,b);"radio"!==v&&"checkbox"!==v||(k=n.checked),S=B({isMasked:w,element:n,value:S,maskInputFn:l}),y(n,d?{text:S,isChecked:k,userTriggered:u}:{text:S,isChecked:k});const E=n.name;"radio"===v&&E&&k&&e.querySelectorAll(`input[type="radio"][name="${E}"]`).forEach((t=>{if(t!==n){const e=B({isMasked:w,element:t,value:X(t,g,v),maskInputFn:l});y(t,d?{text:e,isChecked:!k,userTriggered:!1}:{text:e,isChecked:!k})}}))}function y(e,r){const s=ae.get(e);if(!s||s.text!==r.text||s.isChecked!==r.isChecked){ae.set(e,r);const s=n.getId(e);te(t)(Object.assign(Object.assign({},r),{id:s}))}}const _=("last"===u.input?["change"]:["input","change"]).map((t=>yt(t,te(g),e))),v=e.defaultView;if(!v)return()=>{_.forEach((t=>t()))};const S=v.Object.getOwnPropertyDescriptor(v.HTMLInputElement.prototype,"value"),k=[[v.HTMLInputElement.prototype,"value"],[v.HTMLInputElement.prototype,"checked"],[v.HTMLSelectElement.prototype,"value"],[v.HTMLTextAreaElement.prototype,"value"],[v.HTMLSelectElement.prototype,"selectedIndex"],[v.HTMLOptionElement.prototype,"selected"]];return S&&S.set&&_.push(...k.map((t=>kt(t[0],t[1],{set(){te(g)({target:this,isTrusted:!1})}},!1,v)))),te((()=>{_.forEach((t=>t()))}))}function le(t){return function(t,e){if(pe("CSSGroupingRule")&&t.parentRule instanceof CSSGroupingRule||pe("CSSMediaRule")&&t.parentRule instanceof CSSMediaRule||pe("CSSSupportsRule")&&t.parentRule instanceof CSSSupportsRule||pe("CSSConditionRule")&&t.parentRule instanceof CSSConditionRule){const n=Array.from(t.parentRule.cssRules).indexOf(t);e.unshift(n)}else if(t.parentStyleSheet){const n=Array.from(t.parentStyleSheet.cssRules).indexOf(t);e.unshift(n)}return e}(t,[])}function ue(t,e,n){let r,s;return t?(t.ownerNode?r=e.getId(t.ownerNode):s=n.getId(t),{styleId:s,id:r}):{}}function de({mirror:t,stylesheetManager:e},n){var r,s,i;let o=null;o="#document"===n.nodeName?t.getId(n):t.getId(n.host);const a="#document"===n.nodeName?null===(r=n.defaultView)||void 0===r?void 0:r.Document:null===(i=null===(s=n.ownerDocument)||void 0===s?void 0:s.defaultView)||void 0===i?void 0:i.ShadowRoot,c=(null===a||void 0===a?void 0:a.prototype)?Object.getOwnPropertyDescriptor(null===a||void 0===a?void 0:a.prototype,"adoptedStyleSheets"):void 0;return null!==o&&-1!==o&&a&&c?(Object.defineProperty(n,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get(){var t;return null===(t=c.get)||void 0===t?void 0:t.call(this)},set(t){var n;const r=null===(n=c.set)||void 0===n?void 0:n.call(this,t);if(null!==o&&-1!==o)try{e.adoptStyleSheets(t,o)}catch(s){}return r}}),te((()=>{Object.defineProperty(n,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get:c.get,set:c.set})}))):()=>{}}function he(t,e={}){const n=t.doc.defaultView;if(!n)return()=>{};const r=re(t,t.doc),s=function({mousemoveCb:t,sampling:e,doc:n,mirror:r}){if(!1===e.mousemove)return()=>{};const s="number"===typeof e.mousemove?e.mousemove:50,i="number"===typeof e.mousemoveCallback?e.mousemoveCallback:500;let o,a=[];const c=St(te((e=>{const n=Date.now()-o;t(a.map((t=>(t.timeOffset-=n,t))),e),a=[],o=null})),i),l=te(St(te((t=>{const e=ne(t),{clientX:n,clientY:s}=Mt(t)?t.changedTouches[0]:t;o||(o=wt()),a.push({x:n,y:s,id:r.getId(e),timeOffset:wt()-o}),c("undefined"!==typeof DragEvent&&t instanceof DragEvent?jt.Drag:t instanceof MouseEvent?jt.MouseMove:jt.TouchMove)})),s,{trailing:!1})),u=[yt("mousemove",l,n),yt("touchmove",l,n),yt("drag",l,n)];return te((()=>{u.forEach((t=>t()))}))}(t),i=se(t),o=ie(t),a=function({viewportResizeCb:t},{win:e}){let n=-1,r=-1;return yt("resize",te(St(te((()=>{const e=xt(),s=Tt();n===e&&r===s||(t({width:Number(s),height:Number(e)}),n=e,r=s)})),200)),e)}(t,{win:n}),c=ce(t),l=function({mediaInteractionCb:t,blockClass:e,blockSelector:n,unblockSelector:r,mirror:s,sampling:i,doc:o}){const a=te((o=>St(te((i=>{const a=ne(i);if(!a||It(a,e,n,r,!0))return;const{currentTime:c,volume:l,muted:u,playbackRate:d}=a;t({type:o,id:s.getId(a),currentTime:c,volume:l,muted:u,playbackRate:d})})),i.media||500))),c=[yt("play",a(0),o),yt("pause",a(1),o),yt("seeked",a(2),o),yt("volumechange",a(3),o),yt("ratechange",a(4),o)];return te((()=>{c.forEach((t=>t()))}))}(t),u=function({styleSheetRuleCb:t,mirror:e,stylesheetManager:n},{win:r}){if(!r.CSSStyleSheet||!r.CSSStyleSheet.prototype)return()=>{};const s=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=new Proxy(s,{apply:te(((r,s,i)=>{const[o,a]=i,{id:c,styleId:l}=ue(s,e,n.styleMirror);return(c&&-1!==c||l&&-1!==l)&&t({id:c,styleId:l,adds:[{rule:o,index:a}]}),r.apply(s,i)}))});const i=r.CSSStyleSheet.prototype.deleteRule;let o,a;r.CSSStyleSheet.prototype.deleteRule=new Proxy(i,{apply:te(((r,s,i)=>{const[o]=i,{id:a,styleId:c}=ue(s,e,n.styleMirror);return(a&&-1!==a||c&&-1!==c)&&t({id:a,styleId:c,removes:[{index:o}]}),r.apply(s,i)}))}),r.CSSStyleSheet.prototype.replace&&(o=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=new Proxy(o,{apply:te(((r,s,i)=>{const[o]=i,{id:a,styleId:c}=ue(s,e,n.styleMirror);return(a&&-1!==a||c&&-1!==c)&&t({id:a,styleId:c,replace:o}),r.apply(s,i)}))})),r.CSSStyleSheet.prototype.replaceSync&&(a=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=new Proxy(a,{apply:te(((r,s,i)=>{const[o]=i,{id:a,styleId:c}=ue(s,e,n.styleMirror);return(a&&-1!==a||c&&-1!==c)&&t({id:a,styleId:c,replaceSync:o}),r.apply(s,i)}))}));const c={};me("CSSGroupingRule")?c.CSSGroupingRule=r.CSSGroupingRule:(me("CSSMediaRule")&&(c.CSSMediaRule=r.CSSMediaRule),me("CSSConditionRule")&&(c.CSSConditionRule=r.CSSConditionRule),me("CSSSupportsRule")&&(c.CSSSupportsRule=r.CSSSupportsRule));const l={};return Object.entries(c).forEach((([r,s])=>{l[r]={insertRule:s.prototype.insertRule,deleteRule:s.prototype.deleteRule},s.prototype.insertRule=new Proxy(l[r].insertRule,{apply:te(((r,s,i)=>{const[o,a]=i,{id:c,styleId:l}=ue(s.parentStyleSheet,e,n.styleMirror);return(c&&-1!==c||l&&-1!==l)&&t({id:c,styleId:l,adds:[{rule:o,index:[...le(s),a||0]}]}),r.apply(s,i)}))}),s.prototype.deleteRule=new Proxy(l[r].deleteRule,{apply:te(((r,s,i)=>{const[o]=i,{id:a,styleId:c}=ue(s.parentStyleSheet,e,n.styleMirror);return(a&&-1!==a||c&&-1!==c)&&t({id:a,styleId:c,removes:[{index:[...le(s),o]}]}),r.apply(s,i)}))})})),te((()=>{r.CSSStyleSheet.prototype.insertRule=s,r.CSSStyleSheet.prototype.deleteRule=i,o&&(r.CSSStyleSheet.prototype.replace=o),a&&(r.CSSStyleSheet.prototype.replaceSync=a),Object.entries(c).forEach((([t,e])=>{e.prototype.insertRule=l[t].insertRule,e.prototype.deleteRule=l[t].deleteRule}))}))}(t,{win:n}),d=de(t,t.doc),h=function({styleDeclarationCb:t,mirror:e,ignoreCSSAttributes:n,stylesheetManager:r},{win:s}){const i=s.CSSStyleDeclaration.prototype.setProperty;s.CSSStyleDeclaration.prototype.setProperty=new Proxy(i,{apply:te(((s,o,a)=>{var c;const[l,u,d]=a;if(n.has(l))return i.apply(o,[l,u,d]);const{id:h,styleId:p}=ue(null===(c=o.parentRule)||void 0===c?void 0:c.parentStyleSheet,e,r.styleMirror);return(h&&-1!==h||p&&-1!==p)&&t({id:h,styleId:p,set:{property:l,value:u,priority:d},index:le(o.parentRule)}),s.apply(o,a)}))});const o=s.CSSStyleDeclaration.prototype.removeProperty;return s.CSSStyleDeclaration.prototype.removeProperty=new Proxy(o,{apply:te(((s,i,a)=>{var c;const[l]=a;if(n.has(l))return o.apply(i,[l]);const{id:u,styleId:d}=ue(null===(c=i.parentRule)||void 0===c?void 0:c.parentStyleSheet,e,r.styleMirror);return(u&&-1!==u||d&&-1!==d)&&t({id:u,styleId:d,remove:{property:l},index:le(i.parentRule)}),s.apply(i,a)}))}),te((()=>{s.CSSStyleDeclaration.prototype.setProperty=i,s.CSSStyleDeclaration.prototype.removeProperty=o}))}(t,{win:n}),p=t.collectFonts?function({fontCb:t,doc:e}){const n=e.defaultView;if(!n)return()=>{};const r=[],s=new WeakMap,i=n.FontFace;n.FontFace=function(t,e,n){const r=new i(t,e,n);return s.set(r,{family:t,buffer:"string"!==typeof e,descriptors:n,fontSource:"string"===typeof e?e:JSON.stringify(Array.from(new Uint8Array(e)))}),r};const o=bt(e.fonts,"add",(function(e){return function(n){return setTimeout(te((()=>{const e=s.get(n);e&&(t(e),s.delete(n))})),0),e.apply(this,[n])}}));return r.push((()=>{n.FontFace=i})),r.push(o),te((()=>{r.forEach((t=>t()))}))}(t):()=>{},m=function(t){const{doc:e,mirror:n,blockClass:r,blockSelector:s,unblockSelector:i,selectionCb:o}=t;let a=!0;const c=te((()=>{const t=e.getSelection();if(!t||a&&(null===t||void 0===t?void 0:t.isCollapsed))return;a=t.isCollapsed||!1;const c=[],l=t.rangeCount||0;for(let e=0;e<l;e++){const o=t.getRangeAt(e),{startContainer:a,startOffset:l,endContainer:u,endOffset:d}=o;It(a,r,s,i,!0)||It(u,r,s,i,!0)||c.push({start:n.getId(a),startOffset:l,end:n.getId(u),endOffset:d})}o({ranges:c})}));return c(),yt("selectionchange",c)}(t),f=function({doc:t,customElementCb:e}){const n=t.defaultView;return n&&n.customElements?bt(n.customElements,"define",(function(t){return function(n,r,s){try{e({define:{name:n}})}catch(i){}return t.apply(this,[n,r,s])}})):()=>{}}(t);return te((()=>{ee.forEach((t=>t.reset())),r.disconnect(),s(),i(),o(),a(),c(),l(),u(),d(),h(),p(),m(),f()}))}function pe(t){return"undefined"!==typeof window[t]}function me(t){return Boolean("undefined"!==typeof window[t]&&window[t].prototype&&"insertRule"in window[t].prototype&&"deleteRule"in window[t].prototype)}class fe{constructor(t){this.generateIdFn=t,this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap}getId(t,e,n,r){const s=n||this.getIdToRemoteIdMap(t),i=r||this.getRemoteIdToIdMap(t);let o=s.get(e);return o||(o=this.generateIdFn(),s.set(e,o),i.set(o,e)),o}getIds(t,e){const n=this.getIdToRemoteIdMap(t),r=this.getRemoteIdToIdMap(t);return e.map((e=>this.getId(t,e,n,r)))}getRemoteId(t,e,n){const r=n||this.getRemoteIdToIdMap(t);if("number"!==typeof e)return e;const s=r.get(e);return s||-1}getRemoteIds(t,e){const n=this.getRemoteIdToIdMap(t);return e.map((e=>this.getRemoteId(t,e,n)))}reset(t){if(!t)return this.iframeIdToRemoteIdMap=new WeakMap,void(this.iframeRemoteIdToIdMap=new WeakMap);this.iframeIdToRemoteIdMap.delete(t),this.iframeRemoteIdToIdMap.delete(t)}getIdToRemoteIdMap(t){let e=this.iframeIdToRemoteIdMap.get(t);return e||(e=new Map,this.iframeIdToRemoteIdMap.set(t,e)),e}getRemoteIdToIdMap(t){let e=this.iframeRemoteIdToIdMap.get(t);return e||(e=new Map,this.iframeRemoteIdToIdMap.set(t,e)),e}}class ge{constructor(){this.crossOriginIframeMirror=new fe(Y),this.crossOriginIframeRootIdMap=new WeakMap}addIframe(){}addLoadListener(){}attachIframe(){}}class ye{constructor(t){this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new fe(Y),this.crossOriginIframeRootIdMap=new WeakMap,this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new fe(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=t.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(t){this.iframes.set(t,!0),t.contentWindow&&this.crossOriginIframeMap.set(t.contentWindow,t)}addLoadListener(t){this.loadListener=t}attachIframe(t,e){var n;this.mutationCb({adds:[{parentId:this.mirror.getId(t),nextId:null,node:e}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),null===(n=this.loadListener)||void 0===n||n.call(this,t),t.contentDocument&&t.contentDocument.adoptedStyleSheets&&t.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(t.contentDocument.adoptedStyleSheets,this.mirror.getId(t.contentDocument))}handleMessage(t){const e=t;if("rrweb"!==e.data.type||e.origin!==e.data.origin)return;if(!t.source)return;const n=this.crossOriginIframeMap.get(t.source);if(!n)return;const r=this.transformCrossOriginEvent(n,e.data.event);r&&this.wrappedEmit(r,e.data.isCheckout)}transformCrossOriginEvent(t,e){var n;switch(e.type){case Ft.FullSnapshot:{this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(e.data.node,t);const n=e.data.node.id;return this.crossOriginIframeRootIdMap.set(t,n),this.patchRootIdOnNode(e.data.node,n),{timestamp:e.timestamp,type:Ft.IncrementalSnapshot,data:{source:jt.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:e.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case Ft.Meta:case Ft.Load:case Ft.DomContentLoaded:return!1;case Ft.Plugin:return e;case Ft.Custom:return this.replaceIds(e.data.payload,t,["id","parentId","previousId","nextId"]),e;case Ft.IncrementalSnapshot:switch(e.data.source){case jt.Mutation:return e.data.adds.forEach((e=>{this.replaceIds(e,t,["parentId","nextId","previousId"]),this.replaceIdOnNode(e.node,t);const n=this.crossOriginIframeRootIdMap.get(t);n&&this.patchRootIdOnNode(e.node,n)})),e.data.removes.forEach((e=>{this.replaceIds(e,t,["parentId","id"])})),e.data.attributes.forEach((e=>{this.replaceIds(e,t,["id"])})),e.data.texts.forEach((e=>{this.replaceIds(e,t,["id"])})),e;case jt.Drag:case jt.TouchMove:case jt.MouseMove:return e.data.positions.forEach((e=>{this.replaceIds(e,t,["id"])})),e;case jt.ViewportResize:return!1;case jt.MediaInteraction:case jt.MouseInteraction:case jt.Scroll:case jt.CanvasMutation:case jt.Input:return this.replaceIds(e.data,t,["id"]),e;case jt.StyleSheetRule:case jt.StyleDeclaration:return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleId"]),e;case jt.Font:return e;case jt.Selection:return e.data.ranges.forEach((e=>{this.replaceIds(e,t,["start","end"])})),e;case jt.AdoptedStyleSheet:return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleIds"]),null===(n=e.data.styles)||void 0===n||n.forEach((e=>{this.replaceStyleIds(e,t,["styleId"])})),e}}return!1}replace(t,e,n,r){for(const s of r)(Array.isArray(e[s])||"number"===typeof e[s])&&(Array.isArray(e[s])?e[s]=t.getIds(n,e[s]):e[s]=t.getId(n,e[s]));return e}replaceIds(t,e,n){return this.replace(this.crossOriginIframeMirror,t,e,n)}replaceStyleIds(t,e,n){return this.replace(this.crossOriginIframeStyleMirror,t,e,n)}replaceIdOnNode(t,e){this.replaceIds(t,e,["id","rootId"]),"childNodes"in t&&t.childNodes.forEach((t=>{this.replaceIdOnNode(t,e)}))}patchRootIdOnNode(t,e){t.type===N.Document||t.rootId||(t.rootId=e),"childNodes"in t&&t.childNodes.forEach((t=>{this.patchRootIdOnNode(t,e)}))}}class _e{init(){}addShadowRoot(){}observeAttachShadow(){}reset(){}}class ve{constructor(t){this.shadowDoms=new WeakSet,this.restoreHandlers=[],this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(t,e){if(!$(t))return;if(this.shadowDoms.has(t))return;this.shadowDoms.add(t);const n=re(Object.assign(Object.assign({},this.bypassOptions),{doc:e,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t);this.restoreHandlers.push((()=>n.disconnect())),this.restoreHandlers.push(ie(Object.assign(Object.assign({},this.bypassOptions),{scrollCb:this.scrollCb,doc:t,mirror:this.mirror}))),setTimeout((()=>{t.adoptedStyleSheets&&t.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(t.adoptedStyleSheets,this.mirror.getId(t.host)),this.restoreHandlers.push(de({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},t))}),0)}observeAttachShadow(t){t.contentWindow&&t.contentDocument&&this.patchAttachShadow(t.contentWindow.Element,t.contentDocument)}patchAttachShadow(t,e){const n=this;this.restoreHandlers.push(bt(t.prototype,"attachShadow",(function(t){return function(r){const s=t.call(this,r);return this.shadowRoot&&Pt(this)&&n.addShadowRoot(this.shadowRoot,e),s}})))}reset(){this.restoreHandlers.forEach((t=>{try{t()}catch(e){}})),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}class Se{reset(){}freeze(){}unfreeze(){}lock(){}unlock(){}}class ke{constructor(t){this.trackedLinkElements=new WeakSet,this.styleMirror=new Nt,this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb}attachLinkElement(t,e){"_cssText"in e.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:e.id,attributes:e.attributes}]}),this.trackLinkElement(t)}trackLinkElement(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t))}adoptStyleSheets(t,e){if(0===t.length)return;const n={id:e,styleIds:[]},r=[];for(const s of t){let t;this.styleMirror.has(s)?t=this.styleMirror.getId(s):(t=this.styleMirror.add(s),r.push({styleId:t,rules:Array.from(s.rules||CSSRule,((t,e)=>({rule:F(t),index:e})))})),n.styleIds.push(t)}r.length>0&&(n.styles=r),this.adoptedStyleSheetCb(n)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(t){}}class be{constructor(){this.nodeMap=new WeakMap,this.loop=!0,this.periodicallyClear()}periodicallyClear(){requestAnimationFrame((()=>{this.clear(),this.loop&&this.periodicallyClear()}))}inOtherBuffer(t,e){const n=this.nodeMap.get(t);return n&&Array.from(n).some((t=>t!==e))}add(t,e){this.nodeMap.set(t,(this.nodeMap.get(t)||new Set).add(e))}clear(){this.nodeMap=new WeakMap}destroy(){this.loop=!1}}function we(t){const e=t;return e.timestamp=wt(),e}let Ee;const xe=new j;function Te(t={}){const{emit:e,checkoutEveryNms:n,checkoutEveryNth:r,blockClass:s="rr-block",blockSelector:i=null,unblockSelector:o=null,ignoreClass:a="rr-ignore",ignoreSelector:c=null,maskAllText:l=!1,maskTextClass:u="rr-mask",unmaskTextClass:d=null,maskTextSelector:h=null,unmaskTextSelector:p=null,inlineStylesheet:m=!0,maskAllInputs:f,maskInputOptions:g,slimDOMOptions:y,maskAttributeFn:_,maskInputFn:v,maskTextFn:S,packFn:k,sampling:b={},dataURLOptions:w={},mousemoveWait:E,recordCanvas:x=!1,recordCrossOriginIframes:T=!1,recordAfter:I=("DOMContentLoaded"===t.recordAfter?t.recordAfter:"load"),userTriggeredOnInput:C=!1,collectFonts:R=!1,inlineImages:M=!1,keepIframeSrcFn:O=(()=>!1),ignoreCSSAttributes:D=new Set([]),errorHandler:A,onMutation:N,getCanvasManager:L}=t;Qt(A);const $=!T||window.parent===window;let P=!1;if(!$)try{window.parent.document&&(P=!1)}catch(tt){P=!0}if($&&!e)throw new Error("emit function is required");void 0!==E&&void 0===b.mousemove&&(b.mousemove=E),xe.reset();const F=!0===f?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,radio:!0,checkbox:!0}:void 0!==g?g:{},U=!0===y||"all"===y?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===y,headMetaDescKeywords:"all"===y}:y||{};let B;!function(t=window){"NodeList"in t&&!t.NodeList.prototype.forEach&&(t.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in t&&!t.DOMTokenList.prototype.forEach&&(t.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=(...t)=>{let e=t[0];if(!(0 in t))throw new TypeError("1 argument is required");do{if(this===e)return!0}while(e=e&&e.parentNode);return!1})}();let H=0;const z=t=>(k&&!P&&(t=k(t)),t),W=(t,s)=>{var i;if(!(null===(i=ee[0])||void 0===i?void 0:i.isFrozen())||t.type===Ft.FullSnapshot||t.type===Ft.IncrementalSnapshot&&t.data.source===jt.Mutation||ee.forEach((t=>t.unfreeze())),$)null===e||void 0===e||e(z(t),s);else if(P){const e={type:"rrweb",event:z(t),origin:window.location.origin,isCheckout:s};window.parent.postMessage(e,"*")}if(t.type===Ft.FullSnapshot)B=t,H=0;else if(t.type===Ft.IncrementalSnapshot){if(t.data.source===jt.Mutation&&t.data.isAttachIframe)return;H++;const e=r&&H>=r,s=n&&t.timestamp-B.timestamp>n;(e||s)&&Z(!0)}},q=t=>{W(we({type:Ft.IncrementalSnapshot,data:Object.assign({source:jt.Mutation},t)}))},X=t=>W(we({type:Ft.IncrementalSnapshot,data:Object.assign({source:jt.Scroll},t)})),G=t=>W(we({type:Ft.IncrementalSnapshot,data:Object.assign({source:jt.CanvasMutation},t)})),K=new ke({mutationCb:q,adoptedStyleSheetCb:t=>W(we({type:Ft.IncrementalSnapshot,data:Object.assign({source:jt.AdoptedStyleSheet},t)}))}),J="boolean"===typeof __RRWEB_EXCLUDE_IFRAME__&&__RRWEB_EXCLUDE_IFRAME__?new ge:new ye({mirror:xe,mutationCb:q,stylesheetManager:K,recordCrossOriginIframes:T,wrappedEmit:W}),Y=new be,V=L?L({recordCanvas:x,blockClass:s,blockSelector:i,unblockSelector:o,sampling:b.canvas,dataURLOptions:w}):new Se,Q="boolean"===typeof __RRWEB_EXCLUDE_SHADOW_DOM__&&__RRWEB_EXCLUDE_SHADOW_DOM__?new _e:new ve({mutationCb:q,scrollCb:X,bypassOptions:{onMutation:N,blockClass:s,blockSelector:i,unblockSelector:o,maskAllText:l,maskTextClass:u,unmaskTextClass:d,maskTextSelector:h,unmaskTextSelector:p,inlineStylesheet:m,maskInputOptions:F,dataURLOptions:w,maskAttributeFn:_,maskTextFn:S,maskInputFn:v,recordCanvas:x,inlineImages:M,sampling:b,slimDOMOptions:U,iframeManager:J,stylesheetManager:K,canvasManager:V,keepIframeSrcFn:O,processedNodeManager:Y},mirror:xe}),Z=(t=!1)=>{W(we({type:Ft.Meta,data:{href:window.location.href,width:Tt(),height:xt()}}),t),K.reset(),Q.init(),ee.forEach((t=>t.lock()));const e=function(t,e){const{mirror:n=new j,blockClass:r="rr-block",blockSelector:s=null,unblockSelector:i=null,maskAllText:o=!1,maskTextClass:a="rr-mask",unmaskTextClass:c=null,maskTextSelector:l=null,unmaskTextSelector:u=null,inlineStylesheet:d=!0,inlineImages:h=!1,recordCanvas:p=!1,maskAllInputs:m=!1,maskAttributeFn:f,maskTextFn:g,maskInputFn:y,slimDOM:_=!1,dataURLOptions:v,preserveWhiteSpace:S,onSerialize:k,onIframeLoad:b,iframeLoadTimeout:w,onStylesheetLoad:E,stylesheetLoadTimeout:x,keepIframeSrcFn:T=(()=>!1)}=e||{};return gt(t,{doc:t,mirror:n,blockClass:r,blockSelector:s,unblockSelector:i,maskAllText:o,maskTextClass:a,unmaskTextClass:c,maskTextSelector:l,unmaskTextSelector:u,skipChild:!1,inlineStylesheet:d,maskInputOptions:!0===m?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0}:!1===m?{}:m,maskAttributeFn:f,maskTextFn:g,maskInputFn:y,slimDOMOptions:!0===_||"all"===_?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===_,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===_?{}:_,dataURLOptions:v,inlineImages:h,recordCanvas:p,preserveWhiteSpace:S,onSerialize:k,onIframeLoad:b,iframeLoadTimeout:w,onStylesheetLoad:E,stylesheetLoadTimeout:x,keepIframeSrcFn:T,newlyAddedElement:!1})}(document,{mirror:xe,blockClass:s,blockSelector:i,unblockSelector:o,maskAllText:l,maskTextClass:u,unmaskTextClass:d,maskTextSelector:h,unmaskTextSelector:p,inlineStylesheet:m,maskAllInputs:F,maskAttributeFn:_,maskInputFn:v,maskTextFn:S,slimDOM:U,dataURLOptions:w,recordCanvas:x,inlineImages:M,onSerialize:t=>{Ot(t,xe)&&J.addIframe(t),Dt(t,xe)&&K.trackLinkElement(t),At(t)&&Q.addShadowRoot(t.shadowRoot,document)},onIframeLoad:(t,e)=>{J.attachIframe(t,e),Q.observeAttachShadow(t)},onStylesheetLoad:(t,e)=>{K.attachLinkElement(t,e)},keepIframeSrcFn:O});if(!e)return console.warn("Failed to snapshot the document");W(we({type:Ft.FullSnapshot,data:{node:e,initialOffset:Et(window)}}),t),ee.forEach((t=>t.unlock())),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&K.adoptStyleSheets(document.adoptedStyleSheets,xe.getId(document))};Ee=Z;try{const t=[],e=t=>te(he)({onMutation:N,mutationCb:q,mousemoveCb:(t,e)=>W(we({type:Ft.IncrementalSnapshot,data:{source:e,positions:t}})),mouseInteractionCb:t=>W(we({type:Ft.IncrementalSnapshot,data:Object.assign({source:jt.MouseInteraction},t)})),scrollCb:X,viewportResizeCb:t=>W(we({type:Ft.IncrementalSnapshot,data:Object.assign({source:jt.ViewportResize},t)})),inputCb:t=>W(we({type:Ft.IncrementalSnapshot,data:Object.assign({source:jt.Input},t)})),mediaInteractionCb:t=>W(we({type:Ft.IncrementalSnapshot,data:Object.assign({source:jt.MediaInteraction},t)})),styleSheetRuleCb:t=>W(we({type:Ft.IncrementalSnapshot,data:Object.assign({source:jt.StyleSheetRule},t)})),styleDeclarationCb:t=>W(we({type:Ft.IncrementalSnapshot,data:Object.assign({source:jt.StyleDeclaration},t)})),canvasMutationCb:G,fontCb:t=>W(we({type:Ft.IncrementalSnapshot,data:Object.assign({source:jt.Font},t)})),selectionCb:t=>{W(we({type:Ft.IncrementalSnapshot,data:Object.assign({source:jt.Selection},t)}))},customElementCb:t=>{W(we({type:Ft.IncrementalSnapshot,data:Object.assign({source:jt.CustomElement},t)}))},blockClass:s,ignoreClass:a,ignoreSelector:c,maskAllText:l,maskTextClass:u,unmaskTextClass:d,maskTextSelector:h,unmaskTextSelector:p,maskInputOptions:F,inlineStylesheet:m,sampling:b,recordCanvas:x,inlineImages:M,userTriggeredOnInput:C,collectFonts:R,doc:t,maskAttributeFn:_,maskInputFn:v,maskTextFn:S,keepIframeSrcFn:O,blockSelector:i,unblockSelector:o,slimDOMOptions:U,dataURLOptions:w,mirror:xe,iframeManager:J,stylesheetManager:K,shadowDomManager:Q,processedNodeManager:Y,canvasManager:V,ignoreCSSAttributes:D,plugins:[]},{});J.addLoadListener((n=>{try{t.push(e(n.contentDocument))}catch(r){console.warn(r)}}));const n=()=>{Z(),t.push(e(document))};return"interactive"===document.readyState||"complete"===document.readyState?n():(t.push(yt("DOMContentLoaded",(()=>{W(we({type:Ft.DomContentLoaded,data:{}})),"DOMContentLoaded"===I&&n()}))),t.push(yt("load",(()=>{W(we({type:Ft.Load,data:{}})),"load"===I&&n()}),window))),()=>{t.forEach((t=>t())),Y.destroy(),Ee=void 0,Zt()}}catch(et){console.warn(et)}}Te.mirror=xe,Te.takeFullSnapshot=function(t){if(!Ee)throw new Error("please take full snapshot after start recording");Ee(t)};const Ie=3;function Ce(t){return t>9999999999?t:1e3*t}function Re(t){return t>9999999999?t/1e3:t}function Me(t,e){"sentry.transaction"!==e.category&&(["ui.click","ui.input"].includes(e.category)?t.triggerUserActivity():t.checkAndHandleExpiredSession(),t.addUpdate((()=>(t.throttledAddEvent({type:Ft.Custom,timestamp:1e3*(e.timestamp||0),data:{tag:"breadcrumb",payload:(0,u.Fv)(e,10,1e3)}}),"console"===e.category))))}const Oe="button,a";function De(t){return t.closest(Oe)||t}function Ae(t){const e=Ne(t);return e&&e instanceof Element?De(e):e}function Ne(t){return function(t){return"object"===typeof t&&!!t&&"target"in t}(t)?t.target:t}let Le;function $e(t){return Le||(Le=[],(0,d.hl)(T,"open",(function(t){return function(...e){if(Le)try{Le.forEach((t=>t()))}catch(n){}return t.apply(T,e)}}))),Le.push(t),()=>{const e=Le?Le.indexOf(t):-1;e>-1&&Le.splice(e,1)}}class Pe{constructor(t,e,n=Me){this._lastMutation=0,this._lastScroll=0,this._clicks=[],this._timeout=e.timeout/1e3,this._threshold=e.threshold/1e3,this._scollTimeout=e.scrollTimeout/1e3,this._replay=t,this._ignoreSelector=e.ignoreSelector,this._addBreadcrumbEvent=n}addListeners(){const t=$e((()=>{this._lastMutation=je()}));this._teardown=()=>{t(),this._clicks=[],this._lastMutation=0,this._lastScroll=0}}removeListeners(){this._teardown&&this._teardown(),this._checkClickTimeout&&clearTimeout(this._checkClickTimeout)}handleClick(t,e){if(function(t,e){if(!Fe.includes(t.tagName))return!0;if("INPUT"===t.tagName&&!["submit","button"].includes(t.getAttribute("type")||""))return!0;if("A"===t.tagName&&(t.hasAttribute("download")||t.hasAttribute("target")&&"_self"!==t.getAttribute("target")))return!0;if(e&&t.matches(e))return!0;return!1}(e,this._ignoreSelector)||!function(t){return!(!t.data||"number"!==typeof t.data.nodeId||!t.timestamp)}(t))return;const n={timestamp:Re(t.timestamp),clickBreadcrumb:t,clickCount:0,node:e};this._clicks.some((t=>t.node===n.node&&Math.abs(t.timestamp-n.timestamp)<1))||(this._clicks.push(n),1===this._clicks.length&&this._scheduleCheckClicks())}registerMutation(t=Date.now()){this._lastMutation=Re(t)}registerScroll(t=Date.now()){this._lastScroll=Re(t)}registerClick(t){const e=De(t);this._handleMultiClick(e)}_handleMultiClick(t){this._getClicks(t).forEach((t=>{t.clickCount++}))}_getClicks(t){return this._clicks.filter((e=>e.node===t))}_checkClicks(){const t=[],e=je();this._clicks.forEach((n=>{!n.mutationAfter&&this._lastMutation&&(n.mutationAfter=n.timestamp<=this._lastMutation?this._lastMutation-n.timestamp:void 0),!n.scrollAfter&&this._lastScroll&&(n.scrollAfter=n.timestamp<=this._lastScroll?this._lastScroll-n.timestamp:void 0),n.timestamp+this._timeout<=e&&t.push(n)}));for(const n of t){const t=this._clicks.indexOf(n);t>-1&&(this._generateBreadcrumbs(n),this._clicks.splice(t,1))}this._clicks.length&&this._scheduleCheckClicks()}_generateBreadcrumbs(t){const e=this._replay,n=t.scrollAfter&&t.scrollAfter<=this._scollTimeout,r=t.mutationAfter&&t.mutationAfter<=this._threshold,s=!n&&!r,{clickCount:i,clickBreadcrumb:o}=t;if(s){const n=1e3*Math.min(t.mutationAfter||this._timeout,this._timeout),r=n<1e3*this._timeout?"mutation":"timeout",s={type:"default",message:o.message,timestamp:o.timestamp,category:"ui.slowClickDetected",data:{...o.data,url:T.location.href,route:e.getCurrentRoute(),timeAfterClickMs:n,endReason:r,clickCount:i||1}};this._addBreadcrumbEvent(e,s)}else if(i>1){const t={type:"default",message:o.message,timestamp:o.timestamp,category:"ui.multiClick",data:{...o.data,url:T.location.href,route:e.getCurrentRoute(),clickCount:i,metric:!0}};this._addBreadcrumbEvent(e,t)}}_scheduleCheckClicks(){this._checkClickTimeout&&clearTimeout(this._checkClickTimeout),this._checkClickTimeout=setTimeout((()=>this._checkClicks()),1e3)}}const Fe=["A","BUTTON","INPUT"];function je(){return Date.now()/1e3}function Ue(t,e){try{if(!function(t){return t.type===Ie}(e))return;const{source:n}=e.data;if(n===jt.Mutation&&t.registerMutation(e.timestamp),n===jt.Scroll&&t.registerScroll(e.timestamp),function(t){return t.data.source===jt.MouseInteraction}(e)){const{type:n,id:r}=e.data,s=Te.mirror.getNode(r);s instanceof HTMLElement&&n===Ut.Click&&t.registerClick(s)}}catch(n){}}function Be(t){return{timestamp:Date.now()/1e3,type:"default",...t}}var He;!function(t){t[t.Document=0]="Document",t[t.DocumentType=1]="DocumentType",t[t.Element=2]="Element",t[t.Text=3]="Text",t[t.CDATA=4]="CDATA",t[t.Comment=5]="Comment"}(He||(He={}));const ze=new Set(["id","class","aria-label","role","name","alt","title","data-test-id","data-testid","disabled","aria-disabled"]);function We(t){const e={};for(const n in t)if(ze.has(n)){let r=n;"data-testid"!==n&&"data-test-id"!==n||(r="testId"),e[r]=t[n]}return e}const qe=t=>e=>{if(!t.isEnabled())return;const n=function(t){const{target:e,message:n}=function(t){const e="click"===t.name;let n,r=null;try{r=e?Ae(t.event):Ne(t.event),n=(0,h.Rt)(r,{maxStringLength:200})||"<unknown>"}catch(s){n="<unknown>"}return{target:r,message:n}}(t);return Be({category:`ui.${t.name}`,...Xe(e,n)})}(e);if(!n)return;const r="click"===e.name,s=r?e.event:void 0;!(r&&t.clickDetector&&s&&s.target)||s.altKey||s.metaKey||s.ctrlKey||s.shiftKey||function(t,e,n){t.handleClick(e,n)}(t.clickDetector,n,Ae(e.event)),Me(t,n)};function Xe(t,e){const n=Te.mirror.getId(t),r=n&&Te.mirror.getNode(n),s=r&&Te.mirror.getMeta(r),i=s&&function(t){return t.type===He.Element}(s)?s:null;return{message:e,data:i?{nodeId:n,node:{id:n,tagName:i.tagName,textContent:Array.from(i.childNodes).map((t=>t.type===He.Text&&t.textContent)).filter(Boolean).map((t=>t.trim())).join(""),attributes:We(i.attributes)}}:{}}}function Ge(t,e){if(!t.isEnabled())return;t.updateUserActivity();const n=function(t){const{metaKey:e,shiftKey:n,ctrlKey:r,altKey:s,key:i,target:o}=t;if(!o||function(t){return"INPUT"===t.tagName||"TEXTAREA"===t.tagName||t.isContentEditable}(o)||!i)return null;const a=e||r||s,c=1===i.length;if(!a&&c)return null;const l=(0,h.Rt)(o,{maxStringLength:200})||"<unknown>",u=Xe(o,l);return Be({category:"ui.keyDown",message:l,data:{...u.data,metaKey:e,shiftKey:n,ctrlKey:r,altKey:s,key:i}})}(e);n&&Me(t,n)}const Ke={resource:function(t){const{entryType:e,initiatorType:n,name:r,responseEnd:s,startTime:i,decodedBodySize:o,encodedBodySize:a,responseStatus:c,transferSize:l}=t;if(["fetch","xmlhttprequest"].includes(n))return null;return{type:`${e}.${n}`,start:Ye(i),end:Ye(s),name:r,data:{size:l,statusCode:c,decodedBodySize:o,encodedBodySize:a}}},paint:function(t){const{duration:e,entryType:n,name:r,startTime:s}=t,i=Ye(s);return{type:n,name:r,start:i,end:i+e,data:void 0}},navigation:function(t){const{entryType:e,name:n,decodedBodySize:r,duration:s,domComplete:i,encodedBodySize:o,domContentLoadedEventStart:a,domContentLoadedEventEnd:c,domInteractive:l,loadEventStart:u,loadEventEnd:d,redirectCount:h,startTime:p,transferSize:m,type:f}=t;if(0===s)return null;return{type:`${e}.${f}`,start:Ye(p),end:Ye(i),name:n,data:{size:m,decodedBodySize:r,encodedBodySize:o,duration:s,domInteractive:l,domContentLoadedEventStart:a,domContentLoadedEventEnd:c,loadEventStart:u,loadEventEnd:d,domComplete:i,redirectCount:h}}}};function Je(t){return Ke[t.entryType]?Ke[t.entryType](t):null}function Ye(t){return((p.Z1||T.performance.timeOrigin)+t)/1e3}function Ve(t){function e(e){t.performanceEntries.includes(e)||t.performanceEntries.push(e)}function n({entries:t}){t.forEach(e)}const r=[];return["navigation","paint","resource"].forEach((t=>{r.push((0,x._j)(t,n))})),r.push((0,x.$A)((({metric:e})=>{t.replayPerformanceEntries.push(function(t){const e=t.entries,n=e[e.length-1],r=n?n.element:void 0,s=t.value,i=Ye(s);return{type:"largest-contentful-paint",name:"largest-contentful-paint",start:i,end:i,data:{value:s,size:s,nodeId:r?Te.mirror.getId(r):void 0}}}(e))}))),()=>{r.forEach((t=>t()))}}const Qe="undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__,Ze='var t=Uint8Array,n=Uint16Array,r=Int32Array,e=new t([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),i=new t([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),a=new t([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),s=function(t,e){for(var i=new n(31),a=0;a<31;++a)i[a]=e+=1<<t[a-1];var s=new r(i[30]);for(a=1;a<30;++a)for(var o=i[a];o<i[a+1];++o)s[o]=o-i[a]<<5|a;return{b:i,r:s}},o=s(e,2),f=o.b,h=o.r;f[28]=258,h[258]=28;for(var l=s(i,0).r,u=new n(32768),c=0;c<32768;++c){var v=(43690&c)>>1|(21845&c)<<1;v=(61680&(v=(52428&v)>>2|(13107&v)<<2))>>4|(3855&v)<<4,u[c]=((65280&v)>>8|(255&v)<<8)>>1}var d=function(t,r,e){for(var i=t.length,a=0,s=new n(r);a<i;++a)t[a]&&++s[t[a]-1];var o,f=new n(r);for(a=1;a<r;++a)f[a]=f[a-1]+s[a-1]<<1;if(e){o=new n(1<<r);var h=15-r;for(a=0;a<i;++a)if(t[a])for(var l=a<<4|t[a],c=r-t[a],v=f[t[a]-1]++<<c,d=v|(1<<c)-1;v<=d;++v)o[u[v]>>h]=l}else for(o=new n(i),a=0;a<i;++a)t[a]&&(o[a]=u[f[t[a]-1]++]>>15-t[a]);return o},g=new t(288);for(c=0;c<144;++c)g[c]=8;for(c=144;c<256;++c)g[c]=9;for(c=256;c<280;++c)g[c]=7;for(c=280;c<288;++c)g[c]=8;var w=new t(32);for(c=0;c<32;++c)w[c]=5;var p=d(g,9,0),y=d(w,5,0),m=function(t){return(t+7)/8|0},b=function(n,r,e){return(null==r||r<0)&&(r=0),(null==e||e>n.length)&&(e=n.length),new t(n.subarray(r,e))},M=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],E=function(t,n,r){var e=new Error(n||M[t]);if(e.code=t,Error.captureStackTrace&&Error.captureStackTrace(e,E),!r)throw e;return e},z=function(t,n,r){r<<=7&n;var e=n/8|0;t[e]|=r,t[e+1]|=r>>8},A=function(t,n,r){r<<=7&n;var e=n/8|0;t[e]|=r,t[e+1]|=r>>8,t[e+2]|=r>>16},_=function(r,e){for(var i=[],a=0;a<r.length;++a)r[a]&&i.push({s:a,f:r[a]});var s=i.length,o=i.slice();if(!s)return{t:F,l:0};if(1==s){var f=new t(i[0].s+1);return f[i[0].s]=1,{t:f,l:1}}i.sort((function(t,n){return t.f-n.f})),i.push({s:-1,f:25001});var h=i[0],l=i[1],u=0,c=1,v=2;for(i[0]={s:-1,f:h.f+l.f,l:h,r:l};c!=s-1;)h=i[i[u].f<i[v].f?u++:v++],l=i[u!=c&&i[u].f<i[v].f?u++:v++],i[c++]={s:-1,f:h.f+l.f,l:h,r:l};var d=o[0].s;for(a=1;a<s;++a)o[a].s>d&&(d=o[a].s);var g=new n(d+1),w=x(i[c-1],g,0);if(w>e){a=0;var p=0,y=w-e,m=1<<y;for(o.sort((function(t,n){return g[n.s]-g[t.s]||t.f-n.f}));a<s;++a){var b=o[a].s;if(!(g[b]>e))break;p+=m-(1<<w-g[b]),g[b]=e}for(p>>=y;p>0;){var M=o[a].s;g[M]<e?p-=1<<e-g[M]++-1:++a}for(;a>=0&&p;--a){var E=o[a].s;g[E]==e&&(--g[E],++p)}w=e}return{t:new t(g),l:w}},x=function(t,n,r){return-1==t.s?Math.max(x(t.l,n,r+1),x(t.r,n,r+1)):n[t.s]=r},D=function(t){for(var r=t.length;r&&!t[--r];);for(var e=new n(++r),i=0,a=t[0],s=1,o=function(t){e[i++]=t},f=1;f<=r;++f)if(t[f]==a&&f!=r)++s;else{if(!a&&s>2){for(;s>138;s-=138)o(32754);s>2&&(o(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(o(a),--s;s>6;s-=6)o(8304);s>2&&(o(s-3<<5|8208),s=0)}for(;s--;)o(a);s=1,a=t[f]}return{c:e.subarray(0,i),n:r}},T=function(t,n){for(var r=0,e=0;e<n.length;++e)r+=t[e]*n[e];return r},k=function(t,n,r){var e=r.length,i=m(n+2);t[i]=255&e,t[i+1]=e>>8,t[i+2]=255^t[i],t[i+3]=255^t[i+1];for(var a=0;a<e;++a)t[i+a+4]=r[a];return 8*(i+4+e)},C=function(t,r,s,o,f,h,l,u,c,v,m){z(r,m++,s),++f[256];for(var b=_(f,15),M=b.t,E=b.l,x=_(h,15),C=x.t,U=x.l,F=D(M),I=F.c,S=F.n,L=D(C),O=L.c,j=L.n,q=new n(19),B=0;B<I.length;++B)++q[31&I[B]];for(B=0;B<O.length;++B)++q[31&O[B]];for(var G=_(q,7),H=G.t,J=G.l,K=19;K>4&&!H[a[K-1]];--K);var N,P,Q,R,V=v+5<<3,W=T(f,g)+T(h,w)+l,X=T(f,M)+T(h,C)+l+14+3*K+T(q,H)+2*q[16]+3*q[17]+7*q[18];if(c>=0&&V<=W&&V<=X)return k(r,m,t.subarray(c,c+v));if(z(r,m,1+(X<W)),m+=2,X<W){N=d(M,E,0),P=M,Q=d(C,U,0),R=C;var Y=d(H,J,0);z(r,m,S-257),z(r,m+5,j-1),z(r,m+10,K-4),m+=14;for(B=0;B<K;++B)z(r,m+3*B,H[a[B]]);m+=3*K;for(var Z=[I,O],$=0;$<2;++$){var tt=Z[$];for(B=0;B<tt.length;++B){var nt=31&tt[B];z(r,m,Y[nt]),m+=H[nt],nt>15&&(z(r,m,tt[B]>>5&127),m+=tt[B]>>12)}}}else N=p,P=g,Q=y,R=w;for(B=0;B<u;++B){var rt=o[B];if(rt>255){A(r,m,N[(nt=rt>>18&31)+257]),m+=P[nt+257],nt>7&&(z(r,m,rt>>23&31),m+=e[nt]);var et=31&rt;A(r,m,Q[et]),m+=R[et],et>3&&(A(r,m,rt>>5&8191),m+=i[et])}else A(r,m,N[rt]),m+=P[rt]}return A(r,m,N[256]),m+P[256]},U=new r([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),F=new t(0),I=function(){for(var t=new Int32Array(256),n=0;n<256;++n){for(var r=n,e=9;--e;)r=(1&r&&-306674912)^r>>>1;t[n]=r}return t}(),S=function(){var t=1,n=0;return{p:function(r){for(var e=t,i=n,a=0|r.length,s=0;s!=a;){for(var o=Math.min(s+2655,a);s<o;++s)i+=e+=r[s];e=(65535&e)+15*(e>>16),i=(65535&i)+15*(i>>16)}t=e,n=i},d:function(){return(255&(t%=65521))<<24|(65280&t)<<8|(255&(n%=65521))<<8|n>>8}}},L=function(a,s,o,f,u){if(!u&&(u={l:1},s.dictionary)){var c=s.dictionary.subarray(-32768),v=new t(c.length+a.length);v.set(c),v.set(a,c.length),a=v,u.w=c.length}return function(a,s,o,f,u,c){var v=c.z||a.length,d=new t(f+v+5*(1+Math.ceil(v/7e3))+u),g=d.subarray(f,d.length-u),w=c.l,p=7&(c.r||0);if(s){p&&(g[0]=c.r>>3);for(var y=U[s-1],M=y>>13,E=8191&y,z=(1<<o)-1,A=c.p||new n(32768),_=c.h||new n(z+1),x=Math.ceil(o/3),D=2*x,T=function(t){return(a[t]^a[t+1]<<x^a[t+2]<<D)&z},F=new r(25e3),I=new n(288),S=new n(32),L=0,O=0,j=c.i||0,q=0,B=c.w||0,G=0;j+2<v;++j){var H=T(j),J=32767&j,K=_[H];if(A[J]=K,_[H]=J,B<=j){var N=v-j;if((L>7e3||q>24576)&&(N>423||!w)){p=C(a,g,0,F,I,S,O,q,G,j-G,p),q=L=O=0,G=j;for(var P=0;P<286;++P)I[P]=0;for(P=0;P<30;++P)S[P]=0}var Q=2,R=0,V=E,W=J-K&32767;if(N>2&&H==T(j-W))for(var X=Math.min(M,N)-1,Y=Math.min(32767,j),Z=Math.min(258,N);W<=Y&&--V&&J!=K;){if(a[j+Q]==a[j+Q-W]){for(var $=0;$<Z&&a[j+$]==a[j+$-W];++$);if($>Q){if(Q=$,R=W,$>X)break;var tt=Math.min(W,$-2),nt=0;for(P=0;P<tt;++P){var rt=j-W+P&32767,et=rt-A[rt]&32767;et>nt&&(nt=et,K=rt)}}}W+=(J=K)-(K=A[J])&32767}if(R){F[q++]=268435456|h[Q]<<18|l[R];var it=31&h[Q],at=31&l[R];O+=e[it]+i[at],++I[257+it],++S[at],B=j+Q,++L}else F[q++]=a[j],++I[a[j]]}}for(j=Math.max(j,B);j<v;++j)F[q++]=a[j],++I[a[j]];p=C(a,g,w,F,I,S,O,q,G,j-G,p),w||(c.r=7&p|g[p/8|0]<<3,p-=7,c.h=_,c.p=A,c.i=j,c.w=B)}else{for(j=c.w||0;j<v+w;j+=65535){var st=j+65535;st>=v&&(g[p/8|0]=w,st=v),p=k(g,p+1,a.subarray(j,st))}c.i=v}return b(d,0,f+m(p)+u)}(a,null==s.level?6:s.level,null==s.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(a.length)))):12+s.mem,o,f,u)},O=function(t,n,r){for(;r;++n)t[n]=r,r>>>=8},j=function(){function n(n,r){if("function"==typeof n&&(r=n,n={}),this.ondata=r,this.o=n||{},this.s={l:0,i:32768,w:32768,z:32768},this.b=new t(98304),this.o.dictionary){var e=this.o.dictionary.subarray(-32768);this.b.set(e,32768-e.length),this.s.i=32768-e.length}}return n.prototype.p=function(t,n){this.ondata(L(t,this.o,0,0,this.s),n)},n.prototype.push=function(n,r){this.ondata||E(5),this.s.l&&E(4);var e=n.length+this.s.z;if(e>this.b.length){if(e>2*this.b.length-32768){var i=new t(-32768&e);i.set(this.b.subarray(0,this.s.z)),this.b=i}var a=this.b.length-this.s.z;a&&(this.b.set(n.subarray(0,a),this.s.z),this.s.z=this.b.length,this.p(this.b,!1)),this.b.set(this.b.subarray(-32768)),this.b.set(n.subarray(a),32768),this.s.z=n.length-a+32768,this.s.i=32766,this.s.w=32768}else this.b.set(n,this.s.z),this.s.z+=n.length;this.s.l=1&r,(this.s.z>this.s.w+8191||r)&&(this.p(this.b,r||!1),this.s.w=this.s.i,this.s.i-=2)},n}();function q(t,n){n||(n={});var r=function(){var t=-1;return{p:function(n){for(var r=t,e=0;e<n.length;++e)r=I[255&r^n[e]]^r>>>8;t=r},d:function(){return~t}}}(),e=t.length;r.p(t);var i,a=L(t,n,10+((i=n).filename?i.filename.length+1:0),8),s=a.length;return function(t,n){var r=n.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=n.level<2?4:9==n.level?2:0,t[9]=3,0!=n.mtime&&O(t,4,Math.floor(new Date(n.mtime||Date.now())/1e3)),r){t[3]=8;for(var e=0;e<=r.length;++e)t[e+10]=r.charCodeAt(e)}}(a,n),O(a,s-8,r.d()),O(a,s-4,e),a}var B=function(){function t(t,n){this.c=S(),this.v=1,j.call(this,t,n)}return t.prototype.push=function(t,n){this.c.p(t),j.prototype.push.call(this,t,n)},t.prototype.p=function(t,n){var r=L(t,this.o,this.v&&(this.o.dictionary?6:2),n&&4,this.s);this.v&&(function(t,n){var r=n.level,e=0==r?0:r<6?1:9==r?3:2;if(t[0]=120,t[1]=e<<6|(n.dictionary&&32),t[1]|=31-(t[0]<<8|t[1])%31,n.dictionary){var i=S();i.p(n.dictionary),O(t,2,i.d())}}(r,this.o),this.v=0),n&&O(r,r.length-4,this.c.d()),this.ondata(r,n)},t}(),G="undefined"!=typeof TextEncoder&&new TextEncoder,H="undefined"!=typeof TextDecoder&&new TextDecoder;try{H.decode(F,{stream:!0})}catch(t){}var J=function(){function t(t){this.ondata=t}return t.prototype.push=function(t,n){this.ondata||E(5),this.d&&E(4),this.ondata(K(t),this.d=n||!1)},t}();function K(n,r){if(r){for(var e=new t(n.length),i=0;i<n.length;++i)e[i]=n.charCodeAt(i);return e}if(G)return G.encode(n);var a=n.length,s=new t(n.length+(n.length>>1)),o=0,f=function(t){s[o++]=t};for(i=0;i<a;++i){if(o+5>s.length){var h=new t(o+8+(a-i<<1));h.set(s),s=h}var l=n.charCodeAt(i);l<128||r?f(l):l<2048?(f(192|l>>6),f(128|63&l)):l>55295&&l<57344?(f(240|(l=65536+(1047552&l)|1023&n.charCodeAt(++i))>>18),f(128|l>>12&63),f(128|l>>6&63),f(128|63&l)):(f(224|l>>12),f(128|l>>6&63),f(128|63&l))}return b(s,0,o)}const N=new class{constructor(){this._init()}clear(){this._init()}addEvent(t){if(!t)throw new Error("Adding invalid event");const n=this._hasEvents?",":"";this.stream.push(n+t),this._hasEvents=!0}finish(){this.stream.push("]",!0);const t=function(t){let n=0;for(let r=0,e=t.length;r<e;r++)n+=t[r].length;const r=new Uint8Array(n);for(let n=0,e=0,i=t.length;n<i;n++){const i=t[n];r.set(i,e),e+=i.length}return r}(this._deflatedData);return this._init(),t}_init(){this._hasEvents=!1,this._deflatedData=[],this.deflate=new B,this.deflate.ondata=(t,n)=>{this._deflatedData.push(t)},this.stream=new J(((t,n)=>{this.deflate.push(t,n)})),this.stream.push("[")}},P={clear:()=>{N.clear()},addEvent:t=>N.addEvent(t),finish:()=>N.finish(),compress:t=>function(t){return q(K(t))}(t)};addEventListener("message",(function(t){const n=t.data.method,r=t.data.id,e=t.data.arg;if(n in P&&"function"==typeof P[n])try{const t=P[n](e);postMessage({id:r,method:n,success:!0,response:t})}catch(t){postMessage({id:r,method:n,success:!1,response:t.message}),console.error(t)}})),postMessage({id:void 0,method:"init",success:!0,response:void 0});';function tn(t,e){Qe&&(m.kg.info(t),e&&nn(t))}function en(t,e){Qe&&(m.kg.info(t),e&&setTimeout((()=>{nn(t)}),0))}function nn(t){(0,r.Gd)().addBreadcrumb({category:"console",data:{logger:"replay"},level:"info",message:t},{level:"info"})}class rn extends Error{constructor(){super("Event buffer exceeded maximum size of 20000000.")}}class sn{constructor(){this.events=[],this._totalSize=0,this.hasCheckout=!1}get hasEvents(){return this.events.length>0}get type(){return"sync"}destroy(){this.events=[]}async addEvent(t){const e=JSON.stringify(t).length;if(this._totalSize+=e,this._totalSize>D)throw new rn;this.events.push(t)}finish(){return new Promise((t=>{const e=this.events;this.clear(),t(JSON.stringify(e))}))}clear(){this.events=[],this._totalSize=0,this.hasCheckout=!1}getEarliestTimestamp(){const t=this.events.map((t=>t.timestamp)).sort()[0];return t?Ce(t):null}}class on{constructor(t){this._worker=t,this._id=0}ensureReady(){return this._ensureReadyPromise||(this._ensureReadyPromise=new Promise(((t,e)=>{this._worker.addEventListener("message",(({data:n})=>{n.success?t():e()}),{once:!0}),this._worker.addEventListener("error",(t=>{e(t)}),{once:!0})}))),this._ensureReadyPromise}destroy(){tn("[Replay] Destroying compression worker"),this._worker.terminate()}postMessage(t,e){const n=this._getAndIncrementId();return new Promise(((r,s)=>{const i=({data:e})=>{const o=e;if(o.method===t&&o.id===n){if(this._worker.removeEventListener("message",i),!o.success)return Qe&&m.kg.error("[Replay]",o.response),void s(new Error("Error in compression worker"));r(o.response)}};this._worker.addEventListener("message",i),this._worker.postMessage({id:n,method:t,arg:e})}))}_getAndIncrementId(){return this._id++}}class an{constructor(t){this._worker=new on(t),this._earliestTimestamp=null,this._totalSize=0,this.hasCheckout=!1}get hasEvents(){return!!this._earliestTimestamp}get type(){return"worker"}ensureReady(){return this._worker.ensureReady()}destroy(){this._worker.destroy()}addEvent(t){const e=Ce(t.timestamp);(!this._earliestTimestamp||e<this._earliestTimestamp)&&(this._earliestTimestamp=e);const n=JSON.stringify(t);return this._totalSize+=n.length,this._totalSize>D?Promise.reject(new rn):this._sendEventToWorker(n)}finish(){return this._finishRequest()}clear(){this._earliestTimestamp=null,this._totalSize=0,this.hasCheckout=!1,this._worker.postMessage("clear")}getEarliestTimestamp(){return this._earliestTimestamp}_sendEventToWorker(t){return this._worker.postMessage("addEvent",t)}async _finishRequest(){const t=await this._worker.postMessage("finish");return this._earliestTimestamp=null,this._totalSize=0,t}}class cn{constructor(t){this._fallback=new sn,this._compression=new an(t),this._used=this._fallback,this._ensureWorkerIsLoadedPromise=this._ensureWorkerIsLoaded()}get type(){return this._used.type}get hasEvents(){return this._used.hasEvents}get hasCheckout(){return this._used.hasCheckout}set hasCheckout(t){this._used.hasCheckout=t}destroy(){this._fallback.destroy(),this._compression.destroy()}clear(){return this._used.clear()}getEarliestTimestamp(){return this._used.getEarliestTimestamp()}addEvent(t){return this._used.addEvent(t)}async finish(){return await this.ensureWorkerIsLoaded(),this._used.finish()}ensureWorkerIsLoaded(){return this._ensureWorkerIsLoadedPromise}async _ensureWorkerIsLoaded(){try{await this._compression.ensureReady()}catch(t){return void tn("[Replay] Failed to load the compression worker, falling back to simple buffer")}await this._switchToCompressionWorker()}async _switchToCompressionWorker(){const{events:t,hasCheckout:e}=this._fallback,n=[];for(const s of t)n.push(this._compression.addEvent(s));this._compression.hasCheckout=e,this._used=this._compression;try{await Promise.all(n)}catch(r){Qe&&m.kg.warn("[Replay] Failed to add events when switching buffers.",r)}}}function ln({useCompression:t,workerUrl:e}){if(t&&window.Worker){const t=function(t){try{const e=t||function(){if("undefined"===typeof __SENTRY_EXCLUDE_REPLAY_WORKER__||!__SENTRY_EXCLUDE_REPLAY_WORKER__)return function(){const t=new Blob([Ze]);return URL.createObjectURL(t)}();return""}();if(!e)return;tn("[Replay] Using compression worker"+(t?` from ${t}`:""));const n=new Worker(e);return new cn(n)}catch(e){tn("[Replay] Failed to create compression worker")}}(e);if(t)return t}return tn("[Replay] Using simple buffer"),new sn}function un(){try{return"sessionStorage"in T&&!!T.sessionStorage}catch(t){return!1}}function dn(t){!function(){if(!un())return;try{T.sessionStorage.removeItem(I)}catch(t){}}(),t.session=void 0}function hn(t){return void 0!==t&&Math.random()<t}function pn(t){const e=Date.now();return{id:t.id||(0,f.DM)(),started:t.started||e,lastActivity:t.lastActivity||e,segmentId:t.segmentId||0,sampled:t.sampled,previousSessionId:t.previousSessionId}}function mn(t){if(un())try{T.sessionStorage.setItem(I,JSON.stringify(t))}catch(e){}}function fn({sessionSampleRate:t,allowBuffering:e,stickySession:n=!1},{previousSessionId:r}={}){const s=function(t,e){return hn(t)?"session":!!e&&"buffer"}(t,e),i=pn({sampled:s,previousSessionId:r});return n&&mn(i),i}function gn(t,e,n=+new Date){return null===t||void 0===e||e<0||0!==e&&t+e<=n}function yn(t,{maxReplayDuration:e,sessionIdleExpire:n,targetTime:r=Date.now()}){return gn(t.started,e,r)||gn(t.lastActivity,n,r)}function _n(t,{sessionIdleExpire:e,maxReplayDuration:n}){return!!yn(t,{sessionIdleExpire:e,maxReplayDuration:n})&&("buffer"!==t.sampled||0!==t.segmentId)}function vn({traceInternals:t,sessionIdleExpire:e,maxReplayDuration:n,previousSessionId:r},s){const i=s.stickySession&&function(t){if(!un())return null;try{const e=T.sessionStorage.getItem(I);if(!e)return null;const n=JSON.parse(e);return en("[Replay] Loading existing session",t),pn(n)}catch(e){return null}}(t);return i?_n(i,{sessionIdleExpire:e,maxReplayDuration:n})?(en("[Replay] Session in sessionStorage is expired, creating new one..."),fn(s,{previousSessionId:i.id})):i:(en("[Replay] Creating new session",t),fn(s,{previousSessionId:r}))}function Sn(t,e,n){return!!bn(t,e)&&(kn(t,e,n),!0)}async function kn(t,e,n){if(!t.eventBuffer)return null;try{n&&"buffer"===t.recordingMode&&t.eventBuffer.clear(),n&&(t.eventBuffer.hasCheckout=!0);const r=function(t,e){try{if("function"===typeof e&&function(t){return t.type===Ft.Custom}(t))return e(t)}catch(n){return Qe&&m.kg.error("[Replay] An error occured in the `beforeAddRecordingEvent` callback, skipping the event...",n),null}return t}(e,t.getOptions().beforeAddRecordingEvent);if(!r)return;return await t.eventBuffer.addEvent(r)}catch(r){const e=r&&r instanceof rn?"addEventSizeExceeded":"addEvent";Qe&&m.kg.error(r),await t.stop({reason:e});const n=(0,s.s3)();n&&n.recordDroppedEvent("internal_sdk_error","replay")}}function bn(t,e){if(!t.eventBuffer||t.isPaused()||!t.isEnabled())return!1;const n=Ce(e.timestamp);return!(n+t.timeouts.sessionIdlePause<Date.now())&&(!(n>t.getContext().initialTimestamp+t.getOptions().maxReplayDuration)||(tn(`[Replay] Skipping event with timestamp ${n} because it is after maxReplayDuration`,t.getOptions()._experiments.traceInternals),!1))}function wn(t){return!t.type}function En(t){return"transaction"===t.type}function xn(t){return"feedback"===t.type}function Tn(t){const e=function(){const t=(0,s.s3)();if(!t)return!1;const e=t.getTransport();if(!e)return!1;return e.send.__sentry__baseTransport__||!1}();return(n,r)=>{if(!t.isEnabled()||!wn(n)&&!En(n))return;const s=r&&r.statusCode;e&&(!s||s<200||s>=300)||(En(n)?function(t,e){const n=t.getContext();e.contexts&&e.contexts.trace&&e.contexts.trace.trace_id&&n.traceIds.size<100&&n.traceIds.add(e.contexts.trace.trace_id)}(t,n):function(t,e){const n=t.getContext();e.event_id&&n.errorIds.size<100&&n.errorIds.add(e.event_id);if("buffer"!==t.recordingMode||!e.tags||!e.tags.replayId)return;const{beforeErrorSampling:r}=t.getOptions();if("function"===typeof r&&!r(e))return;setTimeout((()=>{t.sendBufferedReplayOrFlush()}))}(t,n))}}function In(t,e=!1){const n=e?Tn(t):void 0;return Object.assign(((e,r)=>{if(!t.isEnabled())return e;if(function(t){return"replay_event"===t.type}(e))return delete e.breadcrumbs,e;if(!wn(e)&&!En(e)&&!xn(e))return e;if(!t.checkAndHandleExpiredSession())return e;if(xn(e))return t.flush(),e.contexts.feedback.replay_id=t.getSessionId(),function(t,e){t.triggerUserActivity(),t.addUpdate((()=>!e.timestamp||(t.throttledAddEvent({type:Ft.Custom,timestamp:1e3*e.timestamp,data:{timestamp:e.timestamp,tag:"breadcrumb",payload:{category:"sentry.feedback",data:{feedbackId:e.event_id}}}}),!1)))}(t,e),e;if(function(t,e){return!(t.type||!t.exception||!t.exception.values||!t.exception.values.length)&&!(!e.originalException||!e.originalException.__rrweb__)}(e,r)&&!t.getOptions()._experiments.captureExceptions)return Qe&&m.kg.log("[Replay] Ignoring error from rrweb internals",e),null;const s=function(t,e){return"buffer"===t.recordingMode&&e.message!==R&&!(!e.exception||e.type)&&hn(t.getOptions().errorSampleRate)}(t,e);return(s||"session"===t.recordingMode)&&(e.tags={...e.tags,replayId:t.getSessionId()}),n&&n(e,{statusCode:200}),e}),{id:"Replay"})}function Cn(t,e){return e.map((({type:e,start:n,end:r,name:s,data:i})=>{const o=t.throttledAddEvent({type:Ft.Custom,timestamp:n,data:{tag:"performanceSpan",payload:{op:e,description:s,startTimestamp:n,endTimestamp:r,data:i}}});return"string"===typeof o?Promise.resolve(null):o}))}function Rn(t){return e=>{if(!t.isEnabled())return;const n=function(t){const{from:e,to:n}=t,r=Date.now()/1e3;return{type:"navigation.push",start:r,end:r,name:n,data:{previous:e}}}(e);null!==n&&(t.getContext().urls.push(n.name),t.triggerUserActivity(),t.addUpdate((()=>(Cn(t,[n]),!1))))}}function Mn(t,e){t.isEnabled()&&null!==e&&(function(t,e){return(!Qe||!t.getOptions()._experiments.traceInternals)&&i(e,(0,r.Gd)())}(t,e.name)||t.addUpdate((()=>(Cn(t,[e]),!0))))}function On(t){return e=>{if(!t.isEnabled())return;const n=function(t){const{startTimestamp:e,endTimestamp:n,xhr:r}=t,s=r[g.xU];if(!e||!n||!s)return null;const{method:i,url:o,status_code:a}=s;return void 0===o?null:{type:"resource.xhr",name:o,start:e/1e3,end:n/1e3,data:{method:i,statusCode:a}}}(e);Mn(t,n)}}function Dn(t,e){if(t)try{if("string"===typeof t)return e.encode(t).length;if(t instanceof URLSearchParams)return e.encode(t.toString()).length;if(t instanceof FormData){const n=Un(t);return e.encode(n).length}if(t instanceof Blob)return t.size;if(t instanceof ArrayBuffer)return t.byteLength}catch(n){}}function An(t){if(!t)return;const e=parseInt(t,10);return isNaN(e)?void 0:e}function Nn(t){try{if("string"===typeof t)return[t];if(t instanceof URLSearchParams)return[t.toString()];if(t instanceof FormData)return[Un(t)];if(!t)return[void 0]}catch(e){return Qe&&m.kg.warn("[Replay] Failed to serialize body",t),[void 0,"BODY_PARSE_ERROR"]}return Qe&&m.kg.info("[Replay] Skipping network body because of body type",t),[void 0,"UNPARSEABLE_BODY_TYPE"]}function Ln(t,e){if(!t)return{headers:{},size:void 0,_meta:{warnings:[e]}};const n={...t._meta},r=n.warnings||[];return n.warnings=[...r,e],t._meta=n,t}function $n(t,e){if(!e)return null;const{startTimestamp:n,endTimestamp:r,url:s,method:i,statusCode:o,request:a,response:c}=e;return{type:t,start:n/1e3,end:r/1e3,name:s,data:(0,d.Jr)({method:i,statusCode:o,request:a,response:c})}}function Pn(t){return{headers:{},size:t,_meta:{warnings:["URL_SKIPPED"]}}}function Fn(t,e,n){if(!e&&0===Object.keys(t).length)return;if(!e)return{headers:t};if(!n)return{headers:t,size:e};const r={headers:t,size:e},{body:s,warnings:i}=function(t){if(!t||"string"!==typeof t)return{body:t};const e=t.length>M,n=function(t){const e=t[0],n=t[t.length-1];return"["===e&&"]"===n||"{"===e&&"}"===n}(t);if(e){const e=t.slice(0,M);return n?{body:e,warnings:["MAYBE_JSON_TRUNCATED"]}:{body:`${e}\u2026`,warnings:["TEXT_TRUNCATED"]}}if(n)try{return{body:JSON.parse(t)}}catch(r){}return{body:t}}(n);return r.body=s,i&&i.length>0&&(r._meta={warnings:i}),r}function jn(t,e){return Object.keys(t).reduce(((n,r)=>{const s=r.toLowerCase();return e.includes(s)&&t[r]&&(n[s]=t[r]),n}),{})}function Un(t){return new URLSearchParams(t).toString()}function Bn(t,e){const n=function(t,e=T.document.baseURI){if(t.startsWith("http://")||t.startsWith("https://")||t.startsWith(T.location.origin))return t;const n=new URL(t,e);if(n.origin!==new URL(e).origin)return t;const r=n.href;if(!t.endsWith("/")&&r.endsWith("/"))return r.slice(0,-1);return r}(t);return(0,y.U0)(n,e)}async function Hn(t,e,n){try{const r=await async function(t,e,n){const r=Date.now(),{startTimestamp:s=r,endTimestamp:i=r}=e,{url:o,method:a,status_code:c=0,request_body_size:l,response_body_size:u}=t.data,d=Bn(o,n.networkDetailAllowUrls)&&!Bn(o,n.networkDetailDenyUrls),h=d?function({networkCaptureBodies:t,networkRequestHeaders:e},n,r){const s=n?function(t,e){if(1===t.length&&"string"!==typeof t[0])return qn(t[0],e);if(2===t.length)return qn(t[1],e);return{}}(n,e):{};if(!t)return Fn(s,r,void 0);const i=zn(n),[o,a]=Nn(i),c=Fn(s,r,o);if(a)return Ln(c,a);return c}(n,e.input,l):Pn(l),p=await async function(t,{networkCaptureBodies:e,textEncoder:n,networkResponseHeaders:r},s,i){if(!t&&void 0!==i)return Pn(i);const o=s?Wn(s.headers,r):{};if(!s||!e&&void 0!==i)return Fn(o,i,void 0);const[a,c]=await async function(t){const e=function(t){try{return t.clone()}catch(e){Qe&&m.kg.warn("[Replay] Failed to clone response body",e)}}(t);if(!e)return[void 0,"BODY_PARSE_ERROR"];try{const t=await function(t){return new Promise(((e,n)=>{const r=setTimeout((()=>n(new Error("Timeout while trying to read response body"))),500);(async function(t){return await t.text()})(t).then((t=>e(t)),(t=>n(t))).finally((()=>clearTimeout(r)))}))}(e);return[t]}catch(n){return Qe&&m.kg.warn("[Replay] Failed to get text body from response",n),[void 0,"BODY_PARSE_ERROR"]}}(s),l=function(t,{networkCaptureBodies:e,textEncoder:n,responseBodySize:r,captureDetails:s,headers:i}){try{const o=t&&t.length&&void 0===r?Dn(t,n):r;return s?Fn(i,o,e?t:void 0):Pn(o)}catch(o){return Qe&&m.kg.warn("[Replay] Failed to serialize response body",o),Fn(i,r,void 0)}}(a,{networkCaptureBodies:e,textEncoder:n,responseBodySize:i,captureDetails:t,headers:o});if(c)return Ln(l,c);return l}(d,n,e.response,u);return{startTimestamp:s,endTimestamp:i,url:o,method:a,statusCode:c,request:h,response:p}}(t,e,n),s=$n("resource.fetch",r);Mn(n.replay,s)}catch(r){Qe&&m.kg.error("[Replay] Failed to capture fetch breadcrumb",r)}}function zn(t=[]){if(2===t.length&&"object"===typeof t[1])return t[1].body}function Wn(t,e){const n={};return e.forEach((e=>{t.get(e)&&(n[e]=t.get(e))})),n}function qn(t,e){if(!t)return{};const n=t.headers;return n?n instanceof Headers?Wn(n,e):Array.isArray(n)?{}:jn(n,e):{}}async function Xn(t,e,n){try{const r=function(t,e,n){const r=Date.now(),{startTimestamp:s=r,endTimestamp:i=r,input:o,xhr:a}=e,{url:c,method:l,status_code:u=0,request_body_size:d,response_body_size:h}=t.data;if(!c)return null;if(!a||!Bn(c,n.networkDetailAllowUrls)||Bn(c,n.networkDetailDenyUrls)){return{startTimestamp:s,endTimestamp:i,url:c,method:l,statusCode:u,request:Pn(d),response:Pn(h)}}const p=a[g.xU],f=p?jn(p.request_headers,n.networkRequestHeaders):{},y=jn(function(t){const e=t.getAllResponseHeaders();if(!e)return{};return e.split("\r\n").reduce(((t,e)=>{const[n,r]=e.split(": ");return t[n.toLowerCase()]=r,t}),{})}(a),n.networkResponseHeaders),[_,v]=n.networkCaptureBodies?Nn(o):[void 0],[S,k]=n.networkCaptureBodies?function(t){const e=[];try{return[t.responseText]}catch(n){e.push(n)}try{return function(t,e){try{if("string"===typeof t)return[t];if(t instanceof Document)return[t.body.outerHTML];if("json"===e&&t&&"object"===typeof t)return[JSON.stringify(t)];if(!t)return[void 0]}catch(n){return Qe&&m.kg.warn("[Replay] Failed to serialize body",t),[void 0,"BODY_PARSE_ERROR"]}return Qe&&m.kg.info("[Replay] Skipping network body because of body type",t),[void 0,"UNPARSEABLE_BODY_TYPE"]}(t.response,t.responseType)}catch(n){e.push(n)}return Qe&&m.kg.warn("[Replay] Failed to get xhr response body",...e),[void 0]}(a):[void 0],b=Fn(f,d,_),w=Fn(y,h,S);return{startTimestamp:s,endTimestamp:i,url:c,method:l,statusCode:u,request:v?Ln(b,v):b,response:k?Ln(w,k):w}}(t,e,n),s=$n("resource.xhr",r);Mn(n.replay,s)}catch(r){Qe&&m.kg.error("[Replay] Failed to capture xhr breadcrumb",r)}}function Gn(t,e,n){const{xhr:r,input:s}=e;if(!r)return;const i=Dn(s,n.textEncoder),o=r.getResponseHeader("content-length")?An(r.getResponseHeader("content-length")):function(t,e,n){try{return Dn("json"===e&&t&&"object"===typeof t?JSON.stringify(t):t,n)}catch(r){return}}(r.response,r.responseType,n.textEncoder);void 0!==i&&(t.data.request_body_size=i),void 0!==o&&(t.data.response_body_size=o)}function Kn(t){const e=(0,s.s3)();try{const n=new TextEncoder,{networkDetailAllowUrls:r,networkDetailDenyUrls:s,networkCaptureBodies:i,networkRequestHeaders:o,networkResponseHeaders:a}=t.getOptions(),c={replay:t,textEncoder:n,networkDetailAllowUrls:r,networkDetailDenyUrls:s,networkCaptureBodies:i,networkRequestHeaders:o,networkResponseHeaders:a};e&&e.on?e.on("beforeAddBreadcrumb",((t,e)=>function(t,e,n){if(!e.data)return;try{(function(t){return"xhr"===t.category})(e)&&function(t){return t&&t.xhr}(n)&&(Gn(e,n,t),Xn(e,n,t)),function(t){return"fetch"===t.category}(e)&&function(t){return t&&t.response}(n)&&(!function(t,e,n){const{input:r,response:s}=e,i=Dn(r?zn(r):void 0,n.textEncoder),o=s?An(s.headers.get("content-length")):void 0;void 0!==i&&(t.data.request_body_size=i),void 0!==o&&(t.data.response_body_size=o)}(e,n,t),Hn(e,n,t))}catch(r){Qe&&m.kg.warn("Error when enriching network breadcrumb")}}(c,t,e))):((0,_.U)(function(t){return e=>{if(!t.isEnabled())return;const n=function(t){const{startTimestamp:e,endTimestamp:n,fetchData:r,response:s}=t;if(!n)return null;const{method:i,url:o}=r;return{type:"resource.fetch",start:e/1e3,end:n/1e3,name:o,data:{method:i,statusCode:s?s.status:void 0}}}(e);Mn(t,n)}}(t)),(0,g.UK)(On(t)))}catch(n){}}let Jn=null;const Yn=t=>e=>{if(!t.isEnabled())return;const n=function(t){const e=t.getLastBreadcrumb&&t.getLastBreadcrumb();if(Jn===e||!e)return null;if(Jn=e,!function(t){return!!t.category}(e)||["fetch","xhr","sentry.event","sentry.transaction"].includes(e.category)||e.category.startsWith("ui."))return null;if("console"===e.category)return function(t){const e=t.data&&t.data.arguments;if(!Array.isArray(e)||0===e.length)return Be(t);let n=!1;const r=e.map((t=>{if(!t)return t;if("string"===typeof t)return t.length>O?(n=!0,`${t.slice(0,O)}\u2026`):t;if("object"===typeof t)try{const e=(0,u.Fv)(t,7);return JSON.stringify(e).length>O?(n=!0,`${JSON.stringify(e,null,2).slice(0,O)}\u2026`):e}catch(e){}return t}));return Be({...t,data:{...t.data,arguments:r,...n?{_meta:{warnings:["CONSOLE_ARG_TRUNCATED"]}}:{}}})}(e);return Be(e)}(e);n&&Me(t,n)};function Vn(t){return!(!t||!t.on)}function Qn(t){const{jsHeapSizeLimit:e,totalJSHeapSize:n,usedJSHeapSize:r}=t,s=Date.now()/1e3;return{type:"memory",name:"memory",start:s,end:s,data:{memory:{jsHeapSizeLimit:e,totalJSHeapSize:n,usedJSHeapSize:r}}}}function Zn(t){let e=!1;return(n,r)=>{if(!t.checkAndHandleExpiredSession())return void(Qe&&m.kg.warn("[Replay] Received replay event after session expired."));const s=r||!e;e=!0,t.clickDetector&&Ue(t.clickDetector,n),t.addUpdate((()=>{if("buffer"===t.recordingMode&&s&&t.setInitialState(),!Sn(t,n,s))return!0;if(!s)return!1;if(function(t,e){if(!e||!t.session||0!==t.session.segmentId)return;Sn(t,function(t){const e=t.getOptions();return{type:Ft.Custom,timestamp:Date.now(),data:{tag:"options",payload:{sessionSampleRate:e.sessionSampleRate,errorSampleRate:e.errorSampleRate,useCompressionOption:e.useCompression,blockAllMedia:e.blockAllMedia,maskAllText:e.maskAllText,maskAllInputs:e.maskAllInputs,useCompression:!!t.eventBuffer&&"worker"===t.eventBuffer.type,networkDetailHasUrls:e.networkDetailAllowUrls.length>0,networkCaptureBodies:e.networkCaptureBodies,networkRequestHasHeaders:e.networkRequestHeaders.length>0,networkResponseHasHeaders:e.networkResponseHeaders.length>0}}}}(t),!1)}(t,s),t.session&&t.session.previousSessionId)return!0;if("buffer"===t.recordingMode&&t.session&&t.eventBuffer){const e=t.eventBuffer.getEarliestTimestamp();e&&(tn(`[Replay] Updating session start time to earliest event in buffer to ${new Date(e)}`,t.getOptions()._experiments.traceInternals),t.session.started=e,t.getOptions().stickySession&&mn(t.session))}return"session"===t.recordingMode&&t.flush(),!0}))}}function tr(t,e,n,r){return(0,k.Jd)((0,k.Cd)(t,(0,k.HY)(t),r,n),[[{type:"replay_event"},t],[{type:"replay_recording",length:"string"===typeof e?(new TextEncoder).encode(e).length:e.length},e]])}async function er({recordingData:t,replayId:e,segmentId:n,eventContext:s,timestamp:i,session:o}){const a=function({recordingData:t,headers:e}){let n;const r=`${JSON.stringify(e)}\n`;if("string"===typeof t)n=`${r}${t}`;else{const e=(new TextEncoder).encode(r);n=new Uint8Array(e.length+t.length),n.set(e),n.set(t,e.length)}return n}({recordingData:t,headers:{segment_id:n}}),{urls:l,errorIds:u,traceIds:d,initialTimestamp:h}=s,p=(0,r.Gd)(),m=p.getClient(),f=p.getScope(),g=m&&m.getTransport(),y=m&&m.getDsn();if(!m||!g||!y||!o.sampled)return;const _={type:C,replay_start_timestamp:h/1e3,timestamp:i/1e3,error_ids:u,trace_ids:d,urls:l,replay_id:e,segment_id:n,replay_type:o.sampled},v=await async function({client:t,scope:e,replayId:n,event:r}){const s={event_id:n,integrations:"object"!==typeof t._integrations||null===t._integrations||Array.isArray(t._integrations)?void 0:Object.keys(t._integrations)};t.emit&&t.emit("preprocessEvent",r,s);const i=await(0,c.R)(t.getOptions(),r,s,e,t);if(!i)return null;i.platform=i.platform||"javascript";const o=t.getSdkMetadata&&t.getSdkMetadata(),{name:a,version:l}=o&&o.sdk||{};return i.sdk={...i.sdk,name:a||"sentry.javascript.unknown",version:l||"0.0.0"},i}({scope:f,client:m,replayId:e,event:_});if(!v)return m.recordDroppedEvent("event_processor","replay",_),void tn("An event processor returned `null`, will not send event.");delete v.sdkProcessingMetadata;const S=tr(v,a,y,m.getOptions().tunnel);let k;try{k=await g.send(S)}catch(E){const t=new Error(R);try{t.cause=E}catch(x){}throw t}if(!k)return k;if("number"===typeof k.statusCode&&(k.statusCode<200||k.statusCode>=300))throw new nr(k.statusCode);const w=(0,b.WG)({},k);if((0,b.Q)(w,"replay"))throw new rr(w);return k}class nr extends Error{constructor(t){super(`Transport returned status code ${t}`)}}class rr extends Error{constructor(t){super("Rate limit hit"),this.rateLimits=t}}async function sr(t,e={count:0,interval:5e3}){const{recordingData:n,options:r}=t;if(n.length)try{return await er(t),!0}catch(i){if(i instanceof nr||i instanceof rr)throw i;if((0,s.v)("Replays",{_retryCount:e.count}),Qe&&r._experiments&&r._experiments.captureExceptions&&(0,s.Tb)(i),e.count>=3){const t=new Error(`${R} - max retries exceeded`);try{t.cause=i}catch(o){}throw t}return e.interval*=++e.count,new Promise(((n,r)=>{setTimeout((async()=>{try{await sr(t,e),n(!0)}catch(i){r(i)}}),e.interval)}))}}const ir="__THROTTLED";function or(t,e,n){const r=new Map;let s=!1;return(...i)=>{const o=Math.floor(Date.now()/1e3);if((t=>{const e=t-n;r.forEach(((t,n)=>{n<e&&r.delete(n)}))})(o),[...r.values()].reduce(((t,e)=>t+e),0)>=e){const t=s;return s=!0,t?"__SKIPPED":ir}s=!1;const a=r.get(o)||0;return r.set(o,a+1),t(...i)}}class ar{constructor({options:t,recordingOptions:e}){ar.prototype.__init.call(this),ar.prototype.__init2.call(this),ar.prototype.__init3.call(this),ar.prototype.__init4.call(this),ar.prototype.__init5.call(this),ar.prototype.__init6.call(this),this.eventBuffer=null,this.performanceEntries=[],this.replayPerformanceEntries=[],this.recordingMode="session",this.timeouts={sessionIdlePause:3e5,sessionIdleExpire:9e5},this._lastActivity=Date.now(),this._isEnabled=!1,this._isPaused=!1,this._hasInitializedCoreListeners=!1,this._context={errorIds:new Set,traceIds:new Set,urls:[],initialTimestamp:Date.now(),initialUrl:""},this._recordingOptions=e,this._options=t,this._debouncedFlush=function(t,e,n){let r,s,i;const o=n&&n.maxWait?Math.max(n.maxWait,e):0;function a(){return c(),r=t(),r}function c(){void 0!==s&&clearTimeout(s),void 0!==i&&clearTimeout(i),s=i=void 0}function l(){return s&&clearTimeout(s),s=setTimeout(a,e),o&&void 0===i&&(i=setTimeout(a,o)),r}return l.cancel=c,l.flush=function(){return void 0!==s||void 0!==i?a():r},l}((()=>this._flush()),this._options.flushMinDelay,{maxWait:this._options.flushMaxDelay}),this._throttledAddEvent=or(((t,e)=>function(t,e,n){return bn(t,e)?kn(t,e,n):Promise.resolve(null)}(this,t,e)),300,5);const{slowClickTimeout:n,slowClickIgnoreSelectors:r}=this.getOptions(),s=n?{threshold:Math.min(3e3,n),timeout:n,scrollTimeout:300,ignoreSelector:r?r.join(","):""}:void 0;s&&(this.clickDetector=new Pe(this,s))}getContext(){return this._context}isEnabled(){return this._isEnabled}isPaused(){return this._isPaused}getOptions(){return this._options}initializeSampling(t){const{errorSampleRate:e,sessionSampleRate:n}=this._options;e<=0&&n<=0||(this._initializeSessionForSampling(t),this.session?!1!==this.session.sampled&&(this.recordingMode="buffer"===this.session.sampled&&0===this.session.segmentId?"buffer":"session",en(`[Replay] Starting replay in ${this.recordingMode} mode`,this._options._experiments.traceInternals),this._initializeRecording()):this._handleException(new Error("Unable to initialize and create session")))}start(){if(this._isEnabled&&"session"===this.recordingMode)throw new Error("Replay recording is already in progress");if(this._isEnabled&&"buffer"===this.recordingMode)throw new Error("Replay buffering is in progress, call `flush()` to save the replay");en("[Replay] Starting replay in session mode",this._options._experiments.traceInternals);const t=vn({maxReplayDuration:this._options.maxReplayDuration,sessionIdleExpire:this.timeouts.sessionIdleExpire,traceInternals:this._options._experiments.traceInternals},{stickySession:this._options.stickySession,sessionSampleRate:1,allowBuffering:!1});this.session=t,this._initializeRecording()}startBuffering(){if(this._isEnabled)throw new Error("Replay recording is already in progress");en("[Replay] Starting replay in buffer mode",this._options._experiments.traceInternals);const t=vn({sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration,traceInternals:this._options._experiments.traceInternals},{stickySession:this._options.stickySession,sessionSampleRate:0,allowBuffering:!0});this.session=t,this.recordingMode="buffer",this._initializeRecording()}startRecording(){try{this._stopRecording=Te({...this._recordingOptions,..."buffer"===this.recordingMode&&{checkoutEveryNms:6e4},emit:Zn(this),onMutation:this._onMutationHandler})}catch(t){this._handleException(t)}}stopRecording(){try{return this._stopRecording&&(this._stopRecording(),this._stopRecording=void 0),!0}catch(t){return this._handleException(t),!1}}async stop({forceFlush:t=!1,reason:e}={}){if(this._isEnabled){this._isEnabled=!1;try{tn("[Replay] Stopping Replay"+(e?` triggered by ${e}`:""),this._options._experiments.traceInternals),this._removeListeners(),this.stopRecording(),this._debouncedFlush.cancel(),t&&await this._flush({force:!0}),this.eventBuffer&&this.eventBuffer.destroy(),this.eventBuffer=null,dn(this)}catch(n){this._handleException(n)}}}pause(){this._isPaused||(this._isPaused=!0,this.stopRecording(),tn("[Replay] Pausing replay",this._options._experiments.traceInternals))}resume(){this._isPaused&&this._checkSession()&&(this._isPaused=!1,this.startRecording(),tn("[Replay] Resuming replay",this._options._experiments.traceInternals))}async sendBufferedReplayOrFlush({continueRecording:t=!0}={}){if("session"===this.recordingMode)return this.flushImmediate();const e=Date.now();tn("[Replay] Converting buffer to session",this._options._experiments.traceInternals),await this.flushImmediate();const n=this.stopRecording();t&&n&&"session"!==this.recordingMode&&(this.recordingMode="session",this.session&&(this._updateUserActivity(e),this._updateSessionActivity(e),this._maybeSaveSession()),this.startRecording())}addUpdate(t){const e=t();"buffer"!==this.recordingMode&&!0!==e&&this._debouncedFlush()}triggerUserActivity(){if(this._updateUserActivity(),this._stopRecording)this.checkAndHandleExpiredSession(),this._updateSessionActivity();else{if(!this._checkSession())return;this.resume()}}updateUserActivity(){this._updateUserActivity(),this._updateSessionActivity()}conditionalFlush(){return"buffer"===this.recordingMode?Promise.resolve():this.flushImmediate()}flush(){return this._debouncedFlush()}flushImmediate(){return this._debouncedFlush(),this._debouncedFlush.flush()}cancelFlush(){this._debouncedFlush.cancel()}getSessionId(){return this.session&&this.session.id}checkAndHandleExpiredSession(){if(!(this._lastActivity&&gn(this._lastActivity,this.timeouts.sessionIdlePause)&&this.session&&"session"===this.session.sampled))return!!this._checkSession();this.pause()}setInitialState(){const t=`${T.location.pathname}${T.location.hash}${T.location.search}`,e=`${T.location.origin}${t}`;this.performanceEntries=[],this.replayPerformanceEntries=[],this._clearContext(),this._context.initialUrl=e,this._context.initialTimestamp=Date.now(),this._context.urls.push(e)}throttledAddEvent(t,e){const n=this._throttledAddEvent(t,e);if(n===ir){const t=Be({category:"replay.throttled"});this.addUpdate((()=>!Sn(this,{type:5,timestamp:t.timestamp||0,data:{tag:"breadcrumb",payload:t,metric:!0}})))}return n}getCurrentRoute(){const t=this.lastTransaction||(0,r.Gd)().getScope().getTransaction();if(t&&["route","custom"].includes(t.metadata.source))return t.name}_initializeRecording(){this.setInitialState(),this._updateSessionActivity(),this.eventBuffer=ln({useCompression:this._options.useCompression,workerUrl:this._options.workerUrl}),this._removeListeners(),this._addListeners(),this._isEnabled=!0,this._isPaused=!1,this.startRecording()}_handleException(t){Qe&&m.kg.error("[Replay]",t),Qe&&this._options._experiments&&this._options._experiments.captureExceptions&&(0,s.Tb)(t)}_initializeSessionForSampling(t){const e=this._options.errorSampleRate>0,n=vn({sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration,traceInternals:this._options._experiments.traceInternals,previousSessionId:t},{stickySession:this._options.stickySession,sessionSampleRate:this._options.sessionSampleRate,allowBuffering:e});this.session=n}_checkSession(){if(!this.session)return!1;const t=this.session;return!_n(t,{sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration})||(this._refreshSession(t),!1)}async _refreshSession(t){this._isEnabled&&(await this.stop({reason:"refresh session"}),this.initializeSampling(t.id))}_addListeners(){try{T.document.addEventListener("visibilitychange",this._handleVisibilityChange),T.addEventListener("blur",this._handleWindowBlur),T.addEventListener("focus",this._handleWindowFocus),T.addEventListener("keydown",this._handleKeyboardEvent),this.clickDetector&&this.clickDetector.addListeners(),this._hasInitializedCoreListeners||(!function(t){const e=(0,r.Gd)().getScope(),n=(0,s.s3)();e.addScopeListener(Yn(t)),(0,v.O)(qe(t)),(0,S.a)(Rn(t)),Kn(t);const i=In(t,!Vn(n));n&&n.addEventProcessor?n.addEventProcessor(i):(0,a.Q)(i),Vn(n)&&(n.on("afterSendEvent",Tn(t)),n.on("createDsc",(e=>{const n=t.getSessionId();n&&t.isEnabled()&&"session"===t.recordingMode&&t.checkAndHandleExpiredSession()&&(e.replay_id=n)})),n.on("startTransaction",(e=>{t.lastTransaction=e})),n.on("finishTransaction",(e=>{t.lastTransaction=e})),n.on("beforeSendFeedback",((e,n)=>{const r=t.getSessionId();n&&n.includeReplay&&t.isEnabled()&&r&&(t.flush(),e.contexts&&e.contexts.feedback&&(e.contexts.feedback.replay_id=r))})))}(this),this._hasInitializedCoreListeners=!0)}catch(t){this._handleException(t)}this._performanceCleanupCallback=Ve(this)}_removeListeners(){try{T.document.removeEventListener("visibilitychange",this._handleVisibilityChange),T.removeEventListener("blur",this._handleWindowBlur),T.removeEventListener("focus",this._handleWindowFocus),T.removeEventListener("keydown",this._handleKeyboardEvent),this.clickDetector&&this.clickDetector.removeListeners(),this._performanceCleanupCallback&&this._performanceCleanupCallback()}catch(t){this._handleException(t)}}__init(){this._handleVisibilityChange=()=>{"visible"===T.document.visibilityState?this._doChangeToForegroundTasks():this._doChangeToBackgroundTasks()}}__init2(){this._handleWindowBlur=()=>{const t=Be({category:"ui.blur"});this._doChangeToBackgroundTasks(t)}}__init3(){this._handleWindowFocus=()=>{const t=Be({category:"ui.focus"});this._doChangeToForegroundTasks(t)}}__init4(){this._handleKeyboardEvent=t=>{Ge(this,t)}}_doChangeToBackgroundTasks(t){if(!this.session)return;yn(this.session,{maxReplayDuration:this._options.maxReplayDuration,sessionIdleExpire:this.timeouts.sessionIdleExpire})||(t&&this._createCustomBreadcrumb(t),this.conditionalFlush())}_doChangeToForegroundTasks(t){if(!this.session)return;this.checkAndHandleExpiredSession()?t&&this._createCustomBreadcrumb(t):tn("[Replay] Document has become active, but session has expired")}_updateUserActivity(t=Date.now()){this._lastActivity=t}_updateSessionActivity(t=Date.now()){this.session&&(this.session.lastActivity=t,this._maybeSaveSession())}_createCustomBreadcrumb(t){this.addUpdate((()=>{this.throttledAddEvent({type:Ft.Custom,timestamp:t.timestamp||0,data:{tag:"breadcrumb",payload:t}})}))}_addPerformanceEntries(){const t=(e=this.performanceEntries,e.map(Je).filter(Boolean)).concat(this.replayPerformanceEntries);var e;return this.performanceEntries=[],this.replayPerformanceEntries=[],Promise.all(Cn(this,t))}_clearContext(){this._context.errorIds.clear(),this._context.traceIds.clear(),this._context.urls=[]}_updateInitialTimestampFromEventBuffer(){const{session:t,eventBuffer:e}=this;if(!t||!e)return;if(t.segmentId)return;const n=e.getEarliestTimestamp();n&&n<this._context.initialTimestamp&&(this._context.initialTimestamp=n)}_popEventContext(){const t={initialTimestamp:this._context.initialTimestamp,initialUrl:this._context.initialUrl,errorIds:Array.from(this._context.errorIds),traceIds:Array.from(this._context.traceIds),urls:this._context.urls};return this._clearContext(),t}async _runFlush(){const t=this.getSessionId();if(this.session&&this.eventBuffer&&t){if(await this._addPerformanceEntries(),this.eventBuffer&&this.eventBuffer.hasEvents&&(await async function(t){try{return Promise.all(Cn(t,[Qn(T.performance.memory)]))}catch(e){return[]}}(this),this.eventBuffer&&t===this.getSessionId()))try{this._updateInitialTimestampFromEventBuffer();const e=Date.now();if(e-this._context.initialTimestamp>this._options.maxReplayDuration+3e4)throw new Error("Session is too long, not sending replay");const n=this._popEventContext(),r=this.session.segmentId++;this._maybeSaveSession();const s=await this.eventBuffer.finish();await sr({replayId:t,recordingData:s,segmentId:r,eventContext:n,session:this.session,options:this.getOptions(),timestamp:e})}catch(e){this._handleException(e),this.stop({reason:"sendReplay"});const t=(0,s.s3)();t&&t.recordDroppedEvent("send_error","replay")}}else Qe&&m.kg.error("[Replay] No session or eventBuffer found to flush.")}__init5(){this._flush=async({force:t=!1}={})=>{if(!this._isEnabled&&!t)return;if(!this.checkAndHandleExpiredSession())return void(Qe&&m.kg.error("[Replay] Attempting to finish replay event after session expired."));if(!this.session)return;const e=this.session.started,n=Date.now()-e;this._debouncedFlush.cancel();const r=n<this._options.minReplayDuration,s=n>this._options.maxReplayDuration+5e3;if(r||s)return tn(`[Replay] Session duration (${Math.floor(n/1e3)}s) is too ${r?"short":"long"}, not sending replay.`,this._options._experiments.traceInternals),void(r&&this._debouncedFlush());const i=this.eventBuffer;if(i&&0===this.session.segmentId&&!i.hasCheckout&&tn("[Replay] Flushing initial segment without checkout.",this._options._experiments.traceInternals),!this._flushLock)return this._flushLock=this._runFlush(),await this._flushLock,void(this._flushLock=void 0);try{await this._flushLock}catch(o){Qe&&m.kg.error(o)}finally{this._debouncedFlush()}}}_maybeSaveSession(){this.session&&this._options.stickySession&&mn(this.session)}__init6(){this._onMutationHandler=t=>{const e=t.length,n=this._options.mutationLimit,r=n&&e>n;if(e>this._options.mutationBreadcrumbLimit||r){const t=Be({category:"replay.mutations",data:{count:e,limit:r}});this._createCustomBreadcrumb(t)}return!r||(this.stop({reason:"mutationLimit",forceFlush:"session"===this.recordingMode}),!1)}}}function cr(t,e,n,r){const s=[...t,..."string"===typeof r?r.split(","):[],...e];return"undefined"!==typeof n&&("string"===typeof n&&s.push(`.${n}`),(0,m.Cf)((()=>{console.warn("[Replay] You are using a deprecated configuration item for privacy. Read the documentation on how to use the new privacy configuration.")}))),s.join(",")}const lr='img,image,svg,video,object,picture,embed,map,audio,link[rel="icon"],link[rel="apple-touch-icon"]',ur=["content-length","content-type","accept"];let dr=!1;class hr{static __initStatic(){this.id="Replay"}constructor({flushMinDelay:t=5e3,flushMaxDelay:e=5500,minReplayDuration:n=4999,maxReplayDuration:r=36e5,stickySession:s=!0,useCompression:i=!0,workerUrl:o,_experiments:a={},sessionSampleRate:c,errorSampleRate:l,maskAllText:u=!0,maskAllInputs:d=!0,blockAllMedia:h=!0,mutationBreadcrumbLimit:p=750,mutationLimit:m=1e4,slowClickTimeout:f=7e3,slowClickIgnoreSelectors:g=[],networkDetailAllowUrls:y=[],networkDetailDenyUrls:_=[],networkCaptureBodies:v=!0,networkRequestHeaders:S=[],networkResponseHeaders:k=[],mask:b=[],maskAttributes:w=["title","placeholder"],unmask:x=[],block:T=[],unblock:I=[],ignore:C=[],maskFn:R,beforeAddRecordingEvent:M,beforeErrorSampling:O,blockClass:D,blockSelector:N,maskInputOptions:L,maskTextClass:$,maskTextSelector:P,ignoreClass:F}={}){this.name=hr.id;const j=function({mask:t,unmask:e,block:n,unblock:r,ignore:s,blockClass:i,blockSelector:o,maskTextClass:a,maskTextSelector:c,ignoreClass:l}){const u={maskTextSelector:cr(t,[".sentry-mask","[data-sentry-mask]"],a,c),unmaskTextSelector:cr(e,[".sentry-unmask","[data-sentry-unmask]"]),blockSelector:cr(n,[".sentry-block","[data-sentry-block]",'base[href="/"]'],i,o),unblockSelector:cr(r,[".sentry-unblock","[data-sentry-unblock]"]),ignoreSelector:cr(s,[".sentry-ignore","[data-sentry-ignore]",'input[type="file"]'],l)};return i instanceof RegExp&&(u.blockClass=i),a instanceof RegExp&&(u.maskTextClass=a),u}({mask:b,unmask:x,block:T,unblock:I,ignore:C,blockClass:D,blockSelector:N,maskTextClass:$,maskTextSelector:P,ignoreClass:F});if(this._recordingOptions={maskAllInputs:d,maskAllText:u,maskInputOptions:{...L||{},password:!0},maskTextFn:R,maskInputFn:R,maskAttributeFn:(t,e,n)=>function({el:t,key:e,maskAttributes:n,maskAllText:r,privacyOptions:s,value:i}){return r?s.unmaskTextSelector&&t.matches(s.unmaskTextSelector)?i:n.includes(e)||"value"===e&&"INPUT"===t.tagName&&["submit","button"].includes(t.getAttribute("type")||"")?i.replace(/[\S]/g,"*"):i:i}({maskAttributes:w,maskAllText:u,privacyOptions:j,key:t,value:e,el:n}),...j,slimDOMOptions:"all",inlineStylesheet:!0,inlineImages:!1,collectFonts:!0,errorHandler:t=>{try{t.__rrweb__=!0}catch(e){}}},this._initialOptions={flushMinDelay:t,flushMaxDelay:e,minReplayDuration:Math.min(n,15e3),maxReplayDuration:Math.min(r,A),stickySession:s,sessionSampleRate:c,errorSampleRate:l,useCompression:i,workerUrl:o,blockAllMedia:h,maskAllInputs:d,maskAllText:u,mutationBreadcrumbLimit:p,mutationLimit:m,slowClickTimeout:f,slowClickIgnoreSelectors:g,networkDetailAllowUrls:y,networkDetailDenyUrls:_,networkCaptureBodies:v,networkRequestHeaders:pr(S),networkResponseHeaders:pr(k),beforeAddRecordingEvent:M,beforeErrorSampling:O,_experiments:a},"number"===typeof c&&(console.warn(`[Replay] You are passing \`sessionSampleRate\` to the Replay integration.\nThis option is deprecated and will be removed soon.\nInstead, configure \`replaysSessionSampleRate\` directly in the SDK init options, e.g.:\nSentry.init({ replaysSessionSampleRate: ${c} })`),this._initialOptions.sessionSampleRate=c),"number"===typeof l&&(console.warn(`[Replay] You are passing \`errorSampleRate\` to the Replay integration.\nThis option is deprecated and will be removed soon.\nInstead, configure \`replaysOnErrorSampleRate\` directly in the SDK init options, e.g.:\nSentry.init({ replaysOnErrorSampleRate: ${l} })`),this._initialOptions.errorSampleRate=l),this._initialOptions.blockAllMedia&&(this._recordingOptions.blockSelector=this._recordingOptions.blockSelector?`${this._recordingOptions.blockSelector},${lr}`:lr),this._isInitialized&&E())throw new Error("Multiple Sentry Session Replay instances are not supported");this._isInitialized=!0}get _isInitialized(){return dr}set _isInitialized(t){dr=t}setupOnce(){E()&&(this._setup(),setTimeout((()=>this._initialize())))}start(){this._replay&&this._replay.start()}startBuffering(){this._replay&&this._replay.startBuffering()}stop(){return this._replay?this._replay.stop({forceFlush:"session"===this._replay.recordingMode}):Promise.resolve()}flush(t){return this._replay&&this._replay.isEnabled()?this._replay.sendBufferedReplayOrFlush(t):Promise.resolve()}getReplayId(){if(this._replay&&this._replay.isEnabled())return this._replay.getSessionId()}_initialize(){this._replay&&this._replay.initializeSampling()}_setup(){const t=function(t){const e=(0,s.s3)(),n=e&&e.getOptions(),r={sessionSampleRate:0,errorSampleRate:0,...(0,d.Jr)(t)};if(!n)return(0,m.Cf)((()=>{console.warn("SDK client is not available.")})),r;null==t.sessionSampleRate&&null==t.errorSampleRate&&null==n.replaysSessionSampleRate&&null==n.replaysOnErrorSampleRate&&(0,m.Cf)((()=>{console.warn("Replay is disabled because neither `replaysSessionSampleRate` nor `replaysOnErrorSampleRate` are set.")}));"number"===typeof n.replaysSessionSampleRate&&(r.sessionSampleRate=n.replaysSessionSampleRate);"number"===typeof n.replaysOnErrorSampleRate&&(r.errorSampleRate=n.replaysOnErrorSampleRate);return r}(this._initialOptions);this._replay=new ar({options:t,recordingOptions:this._recordingOptions})}}function pr(t){return[...ur,...t.map((t=>t.toLowerCase()))]}hr.__initStatic()},9181:(t,e,n)=>{n.d(e,{EN:()=>u,IQ:()=>d,bU:()=>o});var r=n(3897),s=n(7597),i=n(2343);const o="baggage",a="sentry-",c=/^sentry-/,l=8192;function u(t){if(!(0,s.HD)(t)&&!Array.isArray(t))return;let e={};if(Array.isArray(t))e=t.reduce(((t,e)=>({...t,...h(e)})),{});else{if(!t)return;e=h(t)}const n=Object.entries(e).reduce(((t,[e,n])=>{if(e.match(c)){t[e.slice(a.length)]=n}return t}),{});return Object.keys(n).length>0?n:void 0}function d(t){if(!t)return;return function(t){if(0===Object.keys(t).length)return;return Object.entries(t).reduce(((t,[e,n],s)=>{const o=`${encodeURIComponent(e)}=${encodeURIComponent(n)}`,a=0===s?o:`${t},${o}`;return a.length>l?(r.X&&i.kg.warn(`Not adding key: ${e} with val: ${n} to baggage header due to exceeding baggage size limits.`),t):a}),"")}(Object.entries(t).reduce(((t,[e,n])=>(n&&(t[`${a}${e}`]=n),t)),{}))}function h(t){return t.split(",").map((t=>t.split("=").map((t=>decodeURIComponent(t.trim()))))).reduce(((t,[e,n])=>(t[e]=n,t)),{})}},8464:(t,e,n)=>{n.d(e,{Rt:()=>o,l4:()=>c,qT:()=>l});var r=n(7597);const s=(0,n(1235).Rf)(),i=80;function o(t,e={}){if(!t)return"<unknown>";try{let n=t;const r=5,s=[];let o=0,c=0;const l=" > ",u=l.length;let d;const h=Array.isArray(e)?e:e.keyAttrs,p=!Array.isArray(e)&&e.maxStringLength||i;for(;n&&o++<r&&(d=a(n,h),!("html"===d||o>1&&c+s.length*u+d.length>=p));)s.push(d),c+=d.length,n=n.parentNode;return s.reverse().join(l)}catch(n){return"<unknown>"}}function a(t,e){const n=t,s=[];let i,o,a,c,l;if(!n||!n.tagName)return"";s.push(n.tagName.toLowerCase());const u=e&&e.length?e.filter((t=>n.getAttribute(t))).map((t=>[t,n.getAttribute(t)])):null;if(u&&u.length)u.forEach((t=>{s.push(`[${t[0]}="${t[1]}"]`)}));else if(n.id&&s.push(`#${n.id}`),i=n.className,i&&(0,r.HD)(i))for(o=i.split(/\s+/),l=0;l<o.length;l++)s.push(`.${o[l]}`);const d=["aria-label","type","name","title","alt"];for(l=0;l<d.length;l++)a=d[l],c=n.getAttribute(a),c&&s.push(`[${a}="${c}"]`);return s.join("")}function c(){try{return s.document.location.href}catch(t){return""}}function l(t){return s.document&&s.document.querySelector?s.document.querySelector(t):null}},3897:(t,e,n)=>{n.d(e,{X:()=>r});const r="undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__},292:(t,e,n)=>{n.d(e,{RA:()=>o,vK:()=>c});var r=n(3897),s=n(2343);const i=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/;function o(t,e=!1){const{host:n,path:r,pass:s,port:i,projectId:o,protocol:a,publicKey:c}=t;return`${a}://${c}${e&&s?`:${s}`:""}@${n}${i?`:${i}`:""}/${r?`${r}/`:r}${o}`}function a(t){return{protocol:t.protocol,publicKey:t.publicKey||"",pass:t.pass||"",host:t.host,port:t.port||"",path:t.path||"",projectId:t.projectId}}function c(t){const e="string"===typeof t?function(t){const e=i.exec(t);if(!e)return void(0,s.Cf)((()=>{console.error(`Invalid Sentry Dsn: ${t}`)}));const[n,r,o="",c,l="",u]=e.slice(1);let d="",h=u;const p=h.split("/");if(p.length>1&&(d=p.slice(0,-1).join("/"),h=p.pop()),h){const t=h.match(/^\d+/);t&&(h=t[0])}return a({host:c,pass:o,path:d,projectId:h,port:l,protocol:n,publicKey:r})}(t):a(t);if(e&&function(t){if(!r.X)return!0;const{port:e,projectId:n,protocol:i}=t;return!["protocol","publicKey","host","projectId"].find((e=>!t[e]&&(s.kg.error(`Invalid Sentry Dsn: ${e} missing`),!0)))&&(n.match(/^\d+$/)?function(t){return"http"===t||"https"===t}(i)?!e||!isNaN(parseInt(e,10))||(s.kg.error(`Invalid Sentry Dsn: Invalid port ${e}`),!1):(s.kg.error(`Invalid Sentry Dsn: Invalid protocol ${i}`),!1):(s.kg.error(`Invalid Sentry Dsn: Invalid projectId ${n}`),!1))}(e))return e}},8518:(t,e,n)=>{function r(){return"undefined"!==typeof __SENTRY_BROWSER_BUNDLE__&&!!__SENTRY_BROWSER_BUNDLE__}function s(){return"npm"}n.d(e,{S:()=>s,n:()=>r})},8725:(t,e,n)=>{n.d(e,{BO:()=>a,Cd:()=>f,HY:()=>m,Jd:()=>o,V$:()=>u,gv:()=>c,mL:()=>p,zQ:()=>d});var r=n(292),s=n(8007),i=n(535);function o(t,e=[]){return[t,e]}function a(t,e){const[n,r]=t;return[n,[...r,e]]}function c(t,e){const n=t[1];for(const r of n){if(e(r,r[0].type))return!0}return!1}function l(t,e){return(e||new TextEncoder).encode(t)}function u(t,e){const[n,r]=t;let i=JSON.stringify(n);function o(t){"string"===typeof i?i="string"===typeof t?i+t:[l(i,e),t]:i.push("string"===typeof t?l(t,e):t)}for(const c of r){const[t,e]=c;if(o(`\n${JSON.stringify(t)}\n`),"string"===typeof e||e instanceof Uint8Array)o(e);else{let t;try{t=JSON.stringify(e)}catch(a){t=JSON.stringify((0,s.Fv)(e))}o(t)}}return"string"===typeof i?i:function(t){const e=t.reduce(((t,e)=>t+e.length),0),n=new Uint8Array(e);let r=0;for(const s of t)n.set(s,r),r+=s.length;return n}(i)}function d(t,e){const n="string"===typeof t.data?l(t.data,e):t.data;return[(0,i.Jr)({type:"attachment",length:n.length,filename:t.filename,content_type:t.contentType,attachment_type:t.attachmentType}),n]}const h={session:"session",sessions:"session",attachment:"attachment",transaction:"transaction",event:"error",client_report:"internal",user_report:"default",profile:"profile",replay_event:"replay",replay_recording:"replay",check_in:"monitor",feedback:"feedback",statsd:"unknown"};function p(t){return h[t]}function m(t){if(!t||!t.sdk)return;const{name:e,version:n}=t.sdk;return{name:e,version:n}}function f(t,e,n,s){const o=t.sdkProcessingMetadata&&t.sdkProcessingMetadata.dynamicSamplingContext;return{event_id:t.event_id,sent_at:(new Date).toISOString(),...e&&{sdk:e},...!!n&&s&&{dsn:(0,r.RA)(s)},...o&&{trace:(0,i.Jr)({...o})}}}},409:(t,e,n)=>{n.d(e,{b:()=>r});class r extends Error{constructor(t,e="warn"){super(t),this.message=t,this.name=new.target.prototype.constructor.name,Object.setPrototypeOf(this,new.target.prototype),this.logLevel=e}}},9729:(t,e,n)=>{n.d(e,{D2:()=>l,Hj:()=>c,rK:()=>u});var r=n(3897),s=n(2343),i=n(360);const o={},a={};function c(t,e){o[t]=o[t]||[],o[t].push(e)}function l(t,e){a[t]||(e(),a[t]=!0)}function u(t,e){const n=t&&o[t];if(n)for(const o of n)try{o(e)}catch(a){r.X&&s.kg.error(`Error while triggering instrumentation handler.\nType: ${t}\nName: ${(0,i.$P)(o)}\nError:`,a)}}},5316:(t,e,n)=>{n.d(e,{O:()=>h});var r=n(2844),s=n(535),i=n(1235),o=n(9729);const a=i.n2,c=1e3;let l,u,d;function h(t){(0,o.Hj)("dom",t),(0,o.D2)("dom",p)}function p(){if(!a.document)return;const t=o.rK.bind(null,"dom"),e=m(t,!0);a.document.addEventListener("click",e,!1),a.document.addEventListener("keypress",e,!1),["EventTarget","Node"].forEach((e=>{const n=a[e]&&a[e].prototype;n&&n.hasOwnProperty&&n.hasOwnProperty("addEventListener")&&((0,s.hl)(n,"addEventListener",(function(e){return function(n,r,s){if("click"===n||"keypress"==n)try{const r=this,i=r.__sentry_instrumentation_handlers__=r.__sentry_instrumentation_handlers__||{},o=i[n]=i[n]||{refCount:0};if(!o.handler){const r=m(t);o.handler=r,e.call(this,n,r,s)}o.refCount++}catch(i){}return e.call(this,n,r,s)}})),(0,s.hl)(n,"removeEventListener",(function(t){return function(e,n,r){if("click"===e||"keypress"==e)try{const n=this,s=n.__sentry_instrumentation_handlers__||{},i=s[e];i&&(i.refCount--,i.refCount<=0&&(t.call(this,e,i.handler,r),i.handler=void 0,delete s[e]),0===Object.keys(s).length&&delete n.__sentry_instrumentation_handlers__)}catch(s){}return t.call(this,e,n,r)}})))}))}function m(t,e=!1){return n=>{if(!n||n._sentryCaptured)return;const i=function(t){try{return t.target}catch(e){return null}}(n);if(function(t,e){return"keypress"===t&&(!e||!e.tagName||"INPUT"!==e.tagName&&"TEXTAREA"!==e.tagName&&!e.isContentEditable)}(n.type,i))return;(0,s.xp)(n,"_sentryCaptured",!0),i&&!i._sentryId&&(0,s.xp)(i,"_sentryId",(0,r.DM)());const o="keypress"===n.type?"input":n.type;if(!function(t){if(t.type!==u)return!1;try{if(!t.target||t.target._sentryId!==d)return!1}catch(e){}return!0}(n)){t({event:n,name:o,global:e}),u=n.type,d=i?i._sentryId:void 0}clearTimeout(l),l=a.setTimeout((()=>{d=void 0,u=void 0}),c)}}},1394:(t,e,n)=>{n.d(e,{U:()=>a});var r=n(535),s=n(8823),i=n(1235),o=n(9729);function a(t){const e="fetch";(0,o.Hj)(e,t),(0,o.D2)(e,c)}function c(){(0,s.t$)()&&(0,r.hl)(i.n2,"fetch",(function(t){return function(...e){const{method:n,url:r}=function(t){if(0===t.length)return{method:"GET",url:""};if(2===t.length){const[e,n]=t;return{url:u(e),method:l(n,"method")?String(n.method).toUpperCase():"GET"}}const e=t[0];return{url:u(e),method:l(e,"method")?String(e.method).toUpperCase():"GET"}}(e),s={args:e,fetchData:{method:n,url:r},startTimestamp:Date.now()};return(0,o.rK)("fetch",{...s}),t.apply(i.n2,e).then((t=>{const e={...s,endTimestamp:Date.now(),response:t};return(0,o.rK)("fetch",e),t}),(t=>{const e={...s,endTimestamp:Date.now(),error:t};throw(0,o.rK)("fetch",e),t}))}}))}function l(t,e){return!!t&&"object"===typeof t&&!!t[e]}function u(t){return"string"===typeof t?t:t?l(t,"url")?t.url:t.toString?t.toString():"":""}},1674:(t,e,n)=>{n.d(e,{V:()=>o});var r=n(1235),s=n(9729);let i=null;function o(t){const e="error";(0,s.Hj)(e,t),(0,s.D2)(e,a)}function a(){i=r.n2.onerror,r.n2.onerror=function(t,e,n,r,o){const a={column:r,error:o,line:n,msg:t,url:e};return(0,s.rK)("error",a),!(!i||i.__SENTRY_LOADER__)&&i.apply(this,arguments)},r.n2.onerror.__SENTRY_INSTRUMENTED__=!0}},7373:(t,e,n)=>{n.d(e,{h:()=>o});var r=n(1235),s=n(9729);let i=null;function o(t){const e="unhandledrejection";(0,s.Hj)(e,t),(0,s.D2)(e,a)}function a(){i=r.n2.onunhandledrejection,r.n2.onunhandledrejection=function(t){const e=t;return(0,s.rK)("unhandledrejection",e),!(i&&!i.__SENTRY_LOADER__)||i.apply(this,arguments)},r.n2.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}},734:(t,e,n)=>{n.d(e,{a:()=>l});var r=n(535),s=n(1235);const i=(0,s.Rf)();var o=n(9729);const a=s.n2;let c;function l(t){const e="history";(0,o.Hj)(e,t),(0,o.D2)(e,u)}function u(){if(!function(){const t=i.chrome,e=t&&t.app&&t.app.runtime,n="history"in i&&!!i.history.pushState&&!!i.history.replaceState;return!e&&n}())return;const t=a.onpopstate;function e(t){return function(...e){const n=e.length>2?e[2]:void 0;if(n){const t=c,e=String(n);c=e;const r={from:t,to:e};(0,o.rK)("history",r)}return t.apply(this,e)}}a.onpopstate=function(...e){const n=a.location.href,r=c;c=n;const s={from:r,to:n};if((0,o.rK)("history",s),t)try{return t.apply(this,e)}catch(i){}},(0,r.hl)(a.history,"pushState",e),(0,r.hl)(a.history,"replaceState",e)}},5322:(t,e,n)=>{n.d(e,{UK:()=>l,xU:()=>c});var r=n(7597),s=n(535),i=n(1235),o=n(9729);const a=i.n2,c="__sentry_xhr_v3__";function l(t){(0,o.Hj)("xhr",t),(0,o.D2)("xhr",u)}function u(){if(!a.XMLHttpRequest)return;const t=XMLHttpRequest.prototype;(0,s.hl)(t,"open",(function(t){return function(...e){const n=Date.now(),i=(0,r.HD)(e[0])?e[0].toUpperCase():void 0,a=function(t){if((0,r.HD)(t))return t;try{return t.toString()}catch(e){}return}(e[1]);if(!i||!a)return t.apply(this,e);this[c]={method:i,url:a,request_headers:{}},"POST"===i&&a.match(/sentry_key/)&&(this.__sentry_own_request__=!0);const l=()=>{const t=this[c];if(t&&4===this.readyState){try{t.status_code=this.status}catch(e){}const r={args:[i,a],endTimestamp:Date.now(),startTimestamp:n,xhr:this};(0,o.rK)("xhr",r)}};return"onreadystatechange"in this&&"function"===typeof this.onreadystatechange?(0,s.hl)(this,"onreadystatechange",(function(t){return function(...e){return l(),t.apply(this,e)}})):this.addEventListener("readystatechange",l),(0,s.hl)(this,"setRequestHeader",(function(t){return function(...e){const[n,s]=e,i=this[c];return i&&(0,r.HD)(n)&&(0,r.HD)(s)&&(i.request_headers[n.toLowerCase()]=s),t.apply(this,e)}})),t.apply(this,e)}})),(0,s.hl)(t,"send",(function(t){return function(...e){const n=this[c];if(!n)return t.apply(this,e);void 0!==e[0]&&(n.body=e[0]);const r={args:[n.method,n.url],startTimestamp:Date.now(),xhr:this};return(0,o.rK)("xhr",r),t.apply(this,e)}}))}},7597:(t,e,n)=>{n.d(e,{Cy:()=>g,HD:()=>l,J8:()=>f,Kj:()=>m,PO:()=>d,TX:()=>a,V9:()=>_,VW:()=>o,VZ:()=>s,cO:()=>h,fm:()=>c,i2:()=>y,kK:()=>p,pt:()=>u,y1:()=>v});const r=Object.prototype.toString;function s(t){switch(r.call(t)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return _(t,Error)}}function i(t,e){return r.call(t)===`[object ${e}]`}function o(t){return i(t,"ErrorEvent")}function a(t){return i(t,"DOMError")}function c(t){return i(t,"DOMException")}function l(t){return i(t,"String")}function u(t){return null===t||"object"!==typeof t&&"function"!==typeof t}function d(t){return i(t,"Object")}function h(t){return"undefined"!==typeof Event&&_(t,Event)}function p(t){return"undefined"!==typeof Element&&_(t,Element)}function m(t){return i(t,"RegExp")}function f(t){return Boolean(t&&t.then&&"function"===typeof t.then)}function g(t){return d(t)&&"nativeEvent"in t&&"preventDefault"in t&&"stopPropagation"in t}function y(t){return"number"===typeof t&&t!==t}function _(t,e){try{return t instanceof e}catch(n){return!1}}function v(t){return!("object"!==typeof t||null===t||!t.__isVue&&!t._isVue)}},2343:(t,e,n)=>{n.d(e,{Cf:()=>a,LD:()=>o,RU:()=>i,kg:()=>c});var r=n(3897),s=n(1235);const i=["debug","info","warn","error","log","assert","trace"],o={};function a(t){if(!("console"in s.n2))return t();const e=s.n2.console,n={},r=Object.keys(o);r.forEach((t=>{const r=o[t];n[t]=e[t],e[t]=r}));try{return t()}finally{r.forEach((t=>{e[t]=n[t]}))}}const c=function(){let t=!1;const e={enable:()=>{t=!0},disable:()=>{t=!1},isEnabled:()=>t};return r.X?i.forEach((n=>{e[n]=(...e)=>{t&&a((()=>{s.n2.console[n](`Sentry Logger [${n}]:`,...e)}))}})):i.forEach((t=>{e[t]=()=>{}})),e}()},2844:(t,e,n)=>{n.d(e,{DM:()=>i,Db:()=>c,EG:()=>l,YO:()=>u,jH:()=>a,lE:()=>d});var r=n(535),s=n(1235);function i(){const t=s.n2,e=t.crypto||t.msCrypto;let n=()=>16*Math.random();try{if(e&&e.randomUUID)return e.randomUUID().replace(/-/g,"");e&&e.getRandomValues&&(n=()=>e.getRandomValues(new Uint8Array(1))[0])}catch(r){}return([1e7]+1e3+4e3+8e3+1e11).replace(/[018]/g,(t=>(t^(15&n())>>t/4).toString(16)))}function o(t){return t.exception&&t.exception.values?t.exception.values[0]:void 0}function a(t){const{message:e,event_id:n}=t;if(e)return e;const r=o(t);return r?r.type&&r.value?`${r.type}: ${r.value}`:r.type||r.value||n||"<unknown>":n||"<unknown>"}function c(t,e,n){const r=t.exception=t.exception||{},s=r.values=r.values||[],i=s[0]=s[0]||{};i.value||(i.value=e||""),i.type||(i.type=n||"Error")}function l(t,e){const n=o(t);if(!n)return;const r=n.mechanism;if(n.mechanism={type:"generic",handled:!0,...r,...e},e&&"data"in e){const t={...r&&r.data,...e.data};n.mechanism.data=t}}function u(t){if(t&&t.__sentry_captured__)return!0;try{(0,r.xp)(t,"__sentry_captured__",!0)}catch(e){}return!1}function d(t){return Array.isArray(t)?t:[t]}},1422:(t,e,n)=>{n.d(e,{KV:()=>s,l$:()=>i});var r=n(8518);function s(){return!(0,r.n)()&&"[object process]"===Object.prototype.toString.call("undefined"!==typeof process?process:0)}function i(t,e){return t.require(e)}t=n.hmd(t)},8007:(t,e,n)=>{n.d(e,{Fv:()=>o,Qy:()=>a});var r=n(7597);var s=n(535),i=n(360);function o(t,e=100,n=1/0){try{return c("",t,e,n)}catch(r){return{ERROR:`**non-serializable** (${r})`}}}function a(t,e=3,n=102400){const r=o(t,e);return s=r,function(t){return~-encodeURI(t).split(/%..|./).length}(JSON.stringify(s))>n?a(t,e-1,n):r;var s}function c(t,e,o=1/0,a=1/0,l=function(){const t="function"===typeof WeakSet,e=t?new WeakSet:[];return[function(n){if(t)return!!e.has(n)||(e.add(n),!1);for(let t=0;t<e.length;t++)if(e[t]===n)return!0;return e.push(n),!1},function(n){if(t)e.delete(n);else for(let t=0;t<e.length;t++)if(e[t]===n){e.splice(t,1);break}}]}()){const[u,d]=l;if(null==e||["number","boolean","string"].includes(typeof e)&&!(0,r.i2)(e))return e;const h=function(t,e){try{if("domain"===t&&e&&"object"===typeof e&&e._events)return"[Domain]";if("domainEmitter"===t)return"[DomainEmitter]";if("undefined"!==typeof n.g&&e===n.g)return"[Global]";if("undefined"!==typeof window&&e===window)return"[Window]";if("undefined"!==typeof document&&e===document)return"[Document]";if((0,r.y1)(e))return"[VueViewModel]";if((0,r.Cy)(e))return"[SyntheticEvent]";if("number"===typeof e&&e!==e)return"[NaN]";if("function"===typeof e)return`[Function: ${(0,i.$P)(e)}]`;if("symbol"===typeof e)return`[${String(e)}]`;if("bigint"===typeof e)return`[BigInt: ${String(e)}]`;const s=function(t){const e=Object.getPrototypeOf(t);return e?e.constructor.name:"null prototype"}(e);return/^HTML(\w*)Element$/.test(s)?`[HTMLElement: ${s}]`:`[object ${s}]`}catch(s){return`**non-serializable** (${s})`}}(t,e);if(!h.startsWith("[object "))return h;if(e.__sentry_skip_normalization__)return e;const p="number"===typeof e.__sentry_override_normalization_depth__?e.__sentry_override_normalization_depth__:o;if(0===p)return h.replace("object ","");if(u(e))return"[Circular ~]";const m=e;if(m&&"function"===typeof m.toJSON)try{return c("",m.toJSON(),p-1,a,l)}catch(_){}const f=Array.isArray(e)?[]:{};let g=0;const y=(0,s.Sh)(e);for(const n in y){if(!Object.prototype.hasOwnProperty.call(y,n))continue;if(g>=a){f[n]="[MaxProperties ~]";break}const t=y[n];f[n]=c(n,t,p-1,a,l),g++}return d(e),f}},535:(t,e,n)=>{n.d(e,{$Q:()=>u,HK:()=>d,Jr:()=>y,Sh:()=>p,_j:()=>h,hl:()=>c,xp:()=>l,zf:()=>g});var r=n(8464),s=n(3897),i=n(7597),o=n(2343),a=n(7321);function c(t,e,n){if(!(e in t))return;const r=t[e],s=n(r);"function"===typeof s&&u(s,r),t[e]=s}function l(t,e,n){try{Object.defineProperty(t,e,{value:n,writable:!0,configurable:!0})}catch(r){s.X&&o.kg.log(`Failed to add non-enumerable property "${e}" to object`,t)}}function u(t,e){try{const n=e.prototype||{};t.prototype=e.prototype=n,l(t,"__sentry_original__",e)}catch(n){}}function d(t){return t.__sentry_original__}function h(t){return Object.keys(t).map((e=>`${encodeURIComponent(e)}=${encodeURIComponent(t[e])}`)).join("&")}function p(t){if((0,i.VZ)(t))return{message:t.message,name:t.name,stack:t.stack,...f(t)};if((0,i.cO)(t)){const e={type:t.type,target:m(t.target),currentTarget:m(t.currentTarget),...f(t)};return"undefined"!==typeof CustomEvent&&(0,i.V9)(t,CustomEvent)&&(e.detail=t.detail),e}return t}function m(t){try{return(0,i.kK)(t)?(0,r.Rt)(t):Object.prototype.toString.call(t)}catch(e){return"<unknown>"}}function f(t){if("object"===typeof t&&null!==t){const e={};for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}return{}}function g(t,e=40){const n=Object.keys(p(t));if(n.sort(),!n.length)return"[object has no keys]";if(n[0].length>=e)return(0,a.$G)(n[0],e);for(let r=n.length;r>0;r--){const t=n.slice(0,r).join(", ");if(!(t.length>e))return r===n.length?t:(0,a.$G)(t,e)}return""}function y(t){return _(t,new Map)}function _(t,e){if((0,i.PO)(t)){const n=e.get(t);if(void 0!==n)return n;const r={};e.set(t,r);for(const s of Object.keys(t))"undefined"!==typeof t[s]&&(r[s]=_(t[s],e));return r}if(Array.isArray(t)){const n=e.get(t);if(void 0!==n)return n;const r=[];return e.set(t,r),t.forEach((t=>{r.push(_(t,e))})),r}return t}},228:(t,e,n)=>{n.d(e,{Q:()=>s,WG:()=>i});const r=6e4;function s(t,e,n=Date.now()){return function(t,e){return t[e]||t.all||0}(t,e)>n}function i(t,{statusCode:e,headers:n},s=Date.now()){const i={...t},o=n&&n["x-sentry-rate-limits"],a=n&&n["retry-after"];if(o)for(const r of o.trim().split(",")){const[t,e]=r.split(":",2),n=parseInt(t,10),o=1e3*(isNaN(n)?60:n);if(e)for(const r of e.split(";"))i[r]=s+o;else i.all=s+o}else a?i.all=s+function(t,e=Date.now()){const n=parseInt(`${t}`,10);if(!isNaN(n))return 1e3*n;const s=Date.parse(`${t}`);return isNaN(s)?r:s-e}(a,s):429===e&&(i.all=s+6e4);return i}},360:(t,e,n)=>{n.d(e,{$P:()=>l,Sq:()=>a,pE:()=>o});const r=50,s=/\(error: (.*)\)/,i=/captureMessage|captureException/;function o(...t){const e=t.sort(((t,e)=>t[0]-e[0])).map((t=>t[1]));return(t,n=0)=>{const o=[],a=t.split("\n");for(let i=n;i<a.length;i++){const t=a[i];if(t.length>1024)continue;const n=s.test(t)?t.replace(s,"$1"):t;if(!n.match(/\S*Error: /)){for(const t of e){const e=t(n);if(e){o.push(e);break}}if(o.length>=r)break}}return function(t){if(!t.length)return[];const e=Array.from(t);/sentryWrapped/.test(e[e.length-1].function||"")&&e.pop();e.reverse(),i.test(e[e.length-1].function||"")&&(e.pop(),i.test(e[e.length-1].function||"")&&e.pop());return e.slice(0,r).map((t=>({...t,filename:t.filename||e[e.length-1].filename,function:t.function||"?"})))}(o)}}function a(t){return Array.isArray(t)?o(...t):t}const c="<anonymous>";function l(t){try{return t&&"function"===typeof t&&t.name||c}catch(e){return c}}},7321:(t,e,n)=>{n.d(e,{$G:()=>s,U0:()=>o,nK:()=>i});var r=n(7597);function s(t,e=0){return"string"!==typeof t||0===e||t.length<=e?t:`${t.slice(0,e)}...`}function i(t,e){if(!Array.isArray(t))return"";const n=[];for(let i=0;i<t.length;i++){const e=t[i];try{(0,r.y1)(e)?n.push("[VueViewModel]"):n.push(String(e))}catch(s){n.push("[value cannot be serialized]")}}return n.join(e)}function o(t,e=[],n=!1){return e.some((e=>function(t,e,n=!1){return!!(0,r.HD)(t)&&((0,r.Kj)(e)?e.test(t):!!(0,r.HD)(e)&&(n?t===e:t.includes(e)))}(t,e,n)))}},8823:(t,e,n)=>{n.d(e,{Ak:()=>o,Du:()=>a,t$:()=>c});var r=n(3897),s=n(2343);const i=(0,n(1235).Rf)();function o(){if(!("fetch"in i))return!1;try{return new Headers,new Request("http://www.example.com"),new Response,!0}catch(t){return!1}}function a(t){return t&&/^function fetch\(\)\s+\{\s+\[native code\]\s+\}$/.test(t.toString())}function c(){if("string"===typeof EdgeRuntime)return!0;if(!o())return!1;if(a(i.fetch))return!0;let t=!1;const e=i.document;if(e&&"function"===typeof e.createElement)try{const n=e.createElement("iframe");n.hidden=!0,e.head.appendChild(n),n.contentWindow&&n.contentWindow.fetch&&(t=a(n.contentWindow.fetch)),e.head.removeChild(n)}catch(n){r.X&&s.kg.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",n)}return t}},6893:(t,e,n)=>{n.d(e,{$2:()=>o,WD:()=>i,cW:()=>a});var r,s=n(7597);function i(t){return new a((e=>{e(t)}))}function o(t){return new a(((e,n)=>{n(t)}))}!function(t){t[t.PENDING=0]="PENDING";t[t.RESOLVED=1]="RESOLVED";t[t.REJECTED=2]="REJECTED"}(r||(r={}));class a{constructor(t){a.prototype.__init.call(this),a.prototype.__init2.call(this),a.prototype.__init3.call(this),a.prototype.__init4.call(this),this._state=r.PENDING,this._handlers=[];try{t(this._resolve,this._reject)}catch(e){this._reject(e)}}then(t,e){return new a(((n,r)=>{this._handlers.push([!1,e=>{if(t)try{n(t(e))}catch(s){r(s)}else n(e)},t=>{if(e)try{n(e(t))}catch(s){r(s)}else r(t)}]),this._executeHandlers()}))}catch(t){return this.then((t=>t),t)}finally(t){return new a(((e,n)=>{let r,s;return this.then((e=>{s=!1,r=e,t&&t()}),(e=>{s=!0,r=e,t&&t()})).then((()=>{s?n(r):e(r)}))}))}__init(){this._resolve=t=>{this._setResult(r.RESOLVED,t)}}__init2(){this._reject=t=>{this._setResult(r.REJECTED,t)}}__init3(){this._setResult=(t,e)=>{this._state===r.PENDING&&((0,s.J8)(e)?e.then(this._resolve,this._reject):(this._state=t,this._value=e,this._executeHandlers()))}}__init4(){this._executeHandlers=()=>{if(this._state===r.PENDING)return;const t=this._handlers.slice();this._handlers=[],t.forEach((t=>{t[0]||(this._state===r.RESOLVED&&t[1](this._value),this._state===r.REJECTED&&t[2](this._value),t[0]=!0)}))}}}},1170:(t,e,n)=>{n.d(e,{Z1:()=>h,ph:()=>u,yW:()=>l});var r=n(1422),s=n(1235);t=n.hmd(t);const i=(0,s.Rf)(),o={nowSeconds:()=>Date.now()/1e3};const a=(0,r.KV)()?function(){try{return(0,r.l$)(t,"perf_hooks").performance}catch(e){return}}():function(){const{performance:t}=i;if(!t||!t.now)return;return{now:()=>t.now(),timeOrigin:Date.now()-t.now()}}(),c=void 0===a?o:{nowSeconds:()=>(a.timeOrigin+a.now())/1e3},l=o.nowSeconds.bind(o),u=c.nowSeconds.bind(c);let d;const h=(()=>{const{performance:t}=i;if(!t||!t.now)return void(d="none");const e=36e5,n=t.now(),r=Date.now(),s=t.timeOrigin?Math.abs(t.timeOrigin+n-r):e,o=s<e,a=t.timing&&t.timing.navigationStart,c="number"===typeof a?Math.abs(a+n-r):e;return o||c<e?s<=c?(d="timeOrigin",t.timeOrigin):(d="navigationStart",a):(d="dateNow",r)})()},7638:(t,e,n)=>{n.d(e,{$p:()=>a,KA:()=>o});var r=n(9181),s=n(2844);const i=new RegExp("^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$");function o(t,e){const n=function(t){if(!t)return;const e=t.match(i);if(!e)return;let n;return"1"===e[3]?n=!0:"0"===e[3]&&(n=!1),{traceId:e[1],parentSampled:n,parentSpanId:e[2]}}(t),o=(0,r.EN)(e),{traceId:a,parentSpanId:c,parentSampled:l}=n||{},u={traceId:a||(0,s.DM)(),spanId:(0,s.DM)().substring(16),sampled:l};return c&&(u.parentSpanId=c),o&&(u.dsc=o),{traceparentData:n,dynamicSamplingContext:o,propagationContext:u}}function a(t=(0,s.DM)(),e=(0,s.DM)().substring(16),n){let r="";return void 0!==n&&(r=n?"-1":"-0"),`${t}-${e}${r}`}},1235:(t,e,n)=>{function r(t){return t&&t.Math==Math?t:void 0}n.d(e,{Rf:()=>i,YO:()=>o,n2:()=>s});const s="object"==typeof globalThis&&r(globalThis)||"object"==typeof window&&r(window)||"object"==typeof self&&r(self)||"object"==typeof n.g&&r(n.g)||function(){return this}()||{};function i(){return s}function o(t,e,n){const r=n||s,i=r.__SENTRY__=r.__SENTRY__||{};return i[t]||(i[t]=e())}}}]); +!function(){try{var t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},e=(new Error).stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="fd04302d-e9db-4c19-854f-2fef3ef1859a",t._sentryDebugIdIdentifier="sentry-dbid-fd04302d-e9db-4c19-854f-2fef3ef1859a")}catch(t){}}();var _global="undefined"!==typeof window?window:"undefined"!==typeof global?global:"undefined"!==typeof self?self:{};_global.SENTRY_RELEASE={id:"a2b8e2612b2ee50152f1f5ccf84a620164236ffa"},(self.webpackChunklocal_services_lookup=self.webpackChunklocal_services_lookup||[]).push([[315],{2181:(t,e,n)=>{n.d(e,{S1:()=>Vt});var r=n(2343),s=n(2844),i=n(7321),o=n(1703);const a=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/],c=[/^.*\/healthcheck$/,/^.*\/healthy$/,/^.*\/live$/,/^.*\/ready$/,/^.*\/heartbeat$/,/^.*\/health$/,/^.*\/healthz$/];class l{static __initStatic(){this.id="InboundFilters"}constructor(t={}){this.name=l.id,this._options=t}setupOnce(t,e){}processEvent(t,e,n){const l=n.getOptions(),d=function(t={},e={}){return{allowUrls:[...t.allowUrls||[],...e.allowUrls||[]],denyUrls:[...t.denyUrls||[],...e.denyUrls||[]],ignoreErrors:[...t.ignoreErrors||[],...e.ignoreErrors||[],...t.disableErrorDefaults?[]:a],ignoreTransactions:[...t.ignoreTransactions||[],...e.ignoreTransactions||[],...t.disableTransactionDefaults?[]:c],ignoreInternal:void 0===t.ignoreInternal||t.ignoreInternal}}(this._options,l);return function(t,e){if(e.ignoreInternal&&function(t){try{return"SentryError"===t.exception.values[0].type}catch(e){}return!1}(t))return o.X&&r.kg.warn(`Event dropped due to being internal Sentry Error.\nEvent: ${(0,s.jH)(t)}`),!0;if(function(t,e){if(t.type||!e||!e.length)return!1;return function(t){const e=[];t.message&&e.push(t.message);let n;try{n=t.exception.values[t.exception.values.length-1]}catch(i){}n&&n.value&&(e.push(n.value),n.type&&e.push(`${n.type}: ${n.value}`));o.X&&0===e.length&&r.kg.error(`Could not extract message for event ${(0,s.jH)(t)}`);return e}(t).some((t=>(0,i.U0)(t,e)))}(t,e.ignoreErrors))return o.X&&r.kg.warn(`Event dropped due to being matched by \`ignoreErrors\` option.\nEvent: ${(0,s.jH)(t)}`),!0;if(function(t,e){if("transaction"!==t.type||!e||!e.length)return!1;const n=t.transaction;return!!n&&(0,i.U0)(n,e)}(t,e.ignoreTransactions))return o.X&&r.kg.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.\nEvent: ${(0,s.jH)(t)}`),!0;if(function(t,e){if(!e||!e.length)return!1;const n=u(t);return!!n&&(0,i.U0)(n,e)}(t,e.denyUrls))return o.X&&r.kg.warn(`Event dropped due to being matched by \`denyUrls\` option.\nEvent: ${(0,s.jH)(t)}.\nUrl: ${u(t)}`),!0;if(!function(t,e){if(!e||!e.length)return!0;const n=u(t);return!n||(0,i.U0)(n,e)}(t,e.allowUrls))return o.X&&r.kg.warn(`Event dropped due to not being matched by \`allowUrls\` option.\nEvent: ${(0,s.jH)(t)}.\nUrl: ${u(t)}`),!0;return!1}(t,d)?null:t}}function u(t){try{let n;try{n=t.exception.values[0].stacktrace.frames}catch(e){}return n?function(t=[]){for(let e=t.length-1;e>=0;e--){const n=t[e];if(n&&"<anonymous>"!==n.filename&&"[native code]"!==n.filename)return n.filename||null}return null}(n):null}catch(n){return o.X&&r.kg.error(`Cannot extract url for event ${(0,s.jH)(t)}`),null}}l.__initStatic();var d=n(535);let h;class p{static __initStatic(){this.id="FunctionToString"}constructor(){this.name=p.id}setupOnce(){h=Function.prototype.toString;try{Function.prototype.toString=function(...t){const e=(0,d.HK)(this)||this;return h.apply(e,t)}}catch(t){}}}p.__initStatic();var m=n(2967),f=n(5659);var g=n(360),y=n(8823),_=n(734),v=n(7893),S=n(105),k=n(8518),b=n(8725),w=n(1170);var E=n(292);const x="undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__;var T=n(7597),I=n(8007),C=n(6893);function R(t,e){const n=O(t,e),r={type:e&&e.name,value:A(e)};return n.length&&(r.stacktrace={frames:n}),void 0===r.type&&""===r.value&&(r.value="Unrecoverable error caught"),r}function M(t,e){return{exception:{values:[R(t,e)]}}}function O(t,e){const n=e.stacktrace||e.stack||"",r=function(t){if(t){if("number"===typeof t.framesToPop)return t.framesToPop;if(D.test(t.message))return 1}return 0}(e);try{return t(n,r)}catch(s){}return[]}const D=/Minified React error #\d+;/i;function A(t){const e=t&&t.message;return e?e.error&&"string"===typeof e.error.message?e.error.message:e:"No error message"}function N(t,e,n,r,i){let o;if((0,T.VW)(e)&&e.error){return M(t,e.error)}if((0,T.TX)(e)||(0,T.fm)(e)){const i=e;if("stack"in e)o=M(t,e);else{const e=i.name||((0,T.TX)(i)?"DOMError":"DOMException"),a=i.message?`${e}: ${i.message}`:e;o=L(t,a,n,r),(0,s.Db)(o,a)}return"code"in i&&(o.tags={...o.tags,"DOMException.code":`${i.code}`}),o}if((0,T.VZ)(e))return M(t,e);if((0,T.PO)(e)||(0,T.cO)(e)){return o=function(t,e,n,r){const s=(0,f.Gd)().getClient(),i=s&&s.getOptions().normalizeDepth,o={exception:{values:[{type:(0,T.cO)(e)?e.constructor.name:r?"UnhandledRejection":"Error",value:$(e,{isUnhandledRejection:r})}]},extra:{__serialized__:(0,I.Qy)(e,i)}};if(n){const e=O(t,n);e.length&&(o.exception.values[0].stacktrace={frames:e})}return o}(t,e,n,i),(0,s.EG)(o,{synthetic:!0}),o}return o=L(t,e,n,r),(0,s.Db)(o,`${e}`,void 0),(0,s.EG)(o,{synthetic:!0}),o}function L(t,e,n,r){const s={message:e};if(r&&n){const r=O(t,n);r.length&&(s.exception={values:[{value:e,stacktrace:{frames:r}}]})}return s}function $(t,{isUnhandledRejection:e}){const n=(0,d.zf)(t),r=e?"promise rejection":"exception";if((0,T.VW)(t))return`Event \`ErrorEvent\` captured as ${r} with message \`${t.message}\``;if((0,T.cO)(t)){return`Event \`${function(t){try{const e=Object.getPrototypeOf(t);return e?e.constructor.name:void 0}catch(e){}}(t)}\` (type=${t.type}) captured as ${r}`}return`Object captured as ${r} with keys: ${n}`}var P=n(4487),F=n(1235);const j=F.n2;let U=0;function B(){return U>0}function H(t,e={},n){if("function"!==typeof t)return t;try{const e=t.__sentry_wrapped__;if(e)return e;if((0,d.HK)(t))return t}catch(i){return t}const r=function(){const r=Array.prototype.slice.call(arguments);try{n&&"function"===typeof n&&n.apply(this,arguments);const s=r.map((t=>H(t,e)));return t.apply(this,s)}catch(i){throw U++,setTimeout((()=>{U--})),(0,P.$e)((t=>{t.addEventProcessor((t=>(e.mechanism&&((0,s.Db)(t,void 0,void 0),(0,s.EG)(t,e.mechanism)),t.extra={...t.extra,arguments:r},t))),(0,P.Tb)(i)})),i}};try{for(const e in t)Object.prototype.hasOwnProperty.call(t,e)&&(r[e]=t[e])}catch(o){}(0,d.$Q)(r,t),(0,d.xp)(t,"__sentry_wrapped__",r);try{Object.getOwnPropertyDescriptor(r,"name").configurable&&Object.defineProperty(r,"name",{get:()=>t.name})}catch(o){}return r}class z extends v.W{constructor(t){const e=j.SENTRY_SDK_SOURCE||(0,k.S)();t._metadata=t._metadata||{},t._metadata.sdk=t._metadata.sdk||{name:"sentry.javascript.browser",packages:[{name:`${e}:@sentry/browser`,version:S.J}],version:S.J},super(t),t.sendClientReports&&j.document&&j.document.addEventListener("visibilitychange",(()=>{"hidden"===j.document.visibilityState&&this._flushOutcomes()}))}eventFromException(t,e){return function(t,e,n,r){const i=N(t,e,n&&n.syntheticException||void 0,r);return(0,s.EG)(i),i.level="error",n&&n.event_id&&(i.event_id=n.event_id),(0,C.WD)(i)}(this._options.stackParser,t,e,this._options.attachStacktrace)}eventFromMessage(t,e="info",n){return function(t,e,n="info",r,s){const i=L(t,e,r&&r.syntheticException||void 0,s);return i.level=n,r&&r.event_id&&(i.event_id=r.event_id),(0,C.WD)(i)}(this._options.stackParser,t,e,n,this._options.attachStacktrace)}captureUserFeedback(t){if(!this._isEnabled())return void(x&&r.kg.warn("SDK not enabled, will not capture user feedback."));const e=function(t,{metadata:e,tunnel:n,dsn:r}){const s={event_id:t.event_id,sent_at:(new Date).toISOString(),...e&&e.sdk&&{sdk:{name:e.sdk.name,version:e.sdk.version}},...!!n&&!!r&&{dsn:(0,E.RA)(r)}},i=function(t){return[{type:"user_report"},t]}(t);return(0,b.Jd)(s,[i])}(t,{metadata:this.getSdkMetadata(),dsn:this.getDsn(),tunnel:this.getOptions().tunnel});this._sendEnvelope(e)}_prepareEvent(t,e,n){return t.platform=t.platform||"javascript",super._prepareEvent(t,e,n)}_flushOutcomes(){const t=this._clearOutcomes();if(0===t.length)return void(x&&r.kg.log("No outcomes to send"));if(!this._dsn)return void(x&&r.kg.log("No dsn provided, will not send outcomes"));x&&r.kg.log("Sending outcomes:",t);const e=function(t,e,n){const r=[{type:"client_report"},{timestamp:n||(0,w.yW)(),discarded_events:t}];return(0,b.Jd)(e?{dsn:e}:{},[r])}(t,this._options.tunnel&&(0,E.RA)(this._dsn));this._sendEnvelope(e)}}var W=n(1674),q=n(7373),X=n(8464);class G{static __initStatic(){this.id="GlobalHandlers"}constructor(t){this.name=G.id,this._options={onerror:!0,onunhandledrejection:!0,...t},this._installFunc={onerror:K,onunhandledrejection:J}}setupOnce(){Error.stackTraceLimit=50;const t=this._options;for(const n in t){const s=this._installFunc[n];s&&t[n]&&(e=n,x&&r.kg.log(`Global Handler attached: ${e}`),s(),this._installFunc[n]=void 0)}var e}}function K(){(0,W.V)((t=>{const[e,n,r]=V();if(!e.getIntegration(G))return;const{msg:s,url:i,line:o,column:a,error:c}=t;if(B())return;const l=void 0===c&&(0,T.HD)(s)?function(t,e,n,r){const s=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;let i=(0,T.VW)(t)?t.message:t,o="Error";const a=i.match(s);a&&(o=a[1],i=a[2]);const c={exception:{values:[{type:o,value:i}]}};return Y(c,e,n,r)}(s,i,o,a):Y(N(n,c||s,void 0,r,!1),i,o,a);l.level="error",e.captureEvent(l,{originalException:c,mechanism:{handled:!1,type:"onerror"}})}))}function J(){(0,q.h)((t=>{const[e,n,r]=V();if(!e.getIntegration(G))return;if(B())return!0;const s=function(t){if((0,T.pt)(t))return t;const e=t;try{if("reason"in e)return e.reason;if("detail"in e&&"reason"in e.detail)return e.detail.reason}catch(n){}return t}(t),i=(0,T.pt)(s)?{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(s)}`}]}}:N(n,s,void 0,r,!0);i.level="error",e.captureEvent(i,{originalException:s,mechanism:{handled:!1,type:"onunhandledrejection"}})}))}function Y(t,e,n,r){const s=t.exception=t.exception||{},i=s.values=s.values||[],o=i[0]=i[0]||{},a=o.stacktrace=o.stacktrace||{},c=a.frames=a.frames||[],l=isNaN(parseInt(r,10))?void 0:r,u=isNaN(parseInt(n,10))?void 0:n,d=(0,T.HD)(e)&&e.length>0?e:(0,X.l4)();return 0===c.length&&c.push({colno:l,filename:d,function:"?",in_app:!0,lineno:u}),t}function V(){const t=(0,f.Gd)(),e=t.getClient(),n=e&&e.getOptions()||{stackParser:()=>[],attachStacktrace:!1};return[t,n.stackParser,n.attachStacktrace]}G.__initStatic();const Q=["EventTarget","Window","Node","ApplicationCache","AudioTrackList","BroadcastChannel","ChannelMergerNode","CryptoOperation","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","KeyOperation","MediaController","MessagePort","ModalWindow","Notification","SVGElementInstance","Screen","SharedWorker","TextTrack","TextTrackCue","TextTrackList","WebSocket","WebSocketWorker","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"];class Z{static __initStatic(){this.id="TryCatch"}constructor(t){this.name=Z.id,this._options={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,...t}}setupOnce(){this._options.setTimeout&&(0,d.hl)(j,"setTimeout",tt),this._options.setInterval&&(0,d.hl)(j,"setInterval",tt),this._options.requestAnimationFrame&&(0,d.hl)(j,"requestAnimationFrame",et),this._options.XMLHttpRequest&&"XMLHttpRequest"in j&&(0,d.hl)(XMLHttpRequest.prototype,"send",nt);const t=this._options.eventTarget;if(t){(Array.isArray(t)?t:Q).forEach(rt)}}}function tt(t){return function(...e){const n=e[0];return e[0]=H(n,{mechanism:{data:{function:(0,g.$P)(t)},handled:!1,type:"instrument"}}),t.apply(this,e)}}function et(t){return function(e){return t.apply(this,[H(e,{mechanism:{data:{function:"requestAnimationFrame",handler:(0,g.$P)(t)},handled:!1,type:"instrument"}})])}}function nt(t){return function(...e){const n=this;return["onload","onerror","onprogress","onreadystatechange"].forEach((t=>{t in n&&"function"===typeof n[t]&&(0,d.hl)(n,t,(function(e){const n={mechanism:{data:{function:t,handler:(0,g.$P)(e)},handled:!1,type:"instrument"}},r=(0,d.HK)(e);return r&&(n.mechanism.data.handler=(0,g.$P)(r)),H(e,n)}))})),t.apply(this,e)}}function rt(t){const e=j,n=e[t]&&e[t].prototype;n&&n.hasOwnProperty&&n.hasOwnProperty("addEventListener")&&((0,d.hl)(n,"addEventListener",(function(e){return function(n,r,s){try{"function"===typeof r.handleEvent&&(r.handleEvent=H(r.handleEvent,{mechanism:{data:{function:"handleEvent",handler:(0,g.$P)(r),target:t},handled:!1,type:"instrument"}}))}catch(i){}return e.apply(this,[n,H(r,{mechanism:{data:{function:"addEventListener",handler:(0,g.$P)(r),target:t},handled:!1,type:"instrument"}}),s])}})),(0,d.hl)(n,"removeEventListener",(function(t){return function(e,n,r){const s=n;try{const n=s&&s.__sentry_wrapped__;n&&t.call(this,e,n,r)}catch(i){}return t.call(this,e,s,r)}})))}Z.__initStatic();var st=n(9729);function it(){"console"in F.n2&&r.RU.forEach((function(t){t in F.n2.console&&(0,d.hl)(F.n2.console,t,(function(e){return r.LD[t]=e,function(...e){const n={args:e,level:t};(0,st.rK)("console",n);const s=r.LD[t];s&&s.apply(F.n2.console,e)}}))}))}var ot=n(5316),at=n(5322),ct=n(1394);const lt=["fatal","error","warning","log","info","debug"];function ut(t){return"warn"===t?"warning":lt.includes(t)?t:"log"}function dt(t){if(!t)return{};const e=t.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!e)return{};const n=e[6]||"",r=e[8]||"";return{host:e[4],path:e[5],protocol:e[2],search:n,hash:r,relative:e[5]+n+r}}const ht=1024;class pt{static __initStatic(){this.id="Breadcrumbs"}constructor(t){this.name=pt.id,this.options={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...t}}setupOnce(){if(this.options.console&&function(t){const e="console";(0,st.Hj)(e,t),(0,st.D2)(e,it)}(ft),this.options.dom&&(0,ot.O)(function(t){function e(e){let n,s="object"===typeof t?t.serializeAttribute:void 0,i="object"===typeof t&&"number"===typeof t.maxStringLength?t.maxStringLength:void 0;i&&i>ht&&(x&&r.kg.warn(`\`dom.maxStringLength\` cannot exceed 1024, but a value of ${i} was configured. Sentry will use 1024 instead.`),i=ht),"string"===typeof s&&(s=[s]);try{const t=e.event;n=function(t){return!!t&&!!t.target}(t)?(0,X.Rt)(t.target,{keyAttrs:s,maxStringLength:i}):(0,X.Rt)(t,{keyAttrs:s,maxStringLength:i})}catch(o){n="<unknown>"}0!==n.length&&(0,f.Gd)().addBreadcrumb({category:`ui.${e.name}`,message:n},{event:e.event,name:e.name,global:e.global})}return e}(this.options.dom)),this.options.xhr&&(0,at.UK)(gt),this.options.fetch&&(0,ct.U)(yt),this.options.history&&(0,_.a)(_t),this.options.sentry){const t=(0,P.s3)();t&&t.on&&t.on("beforeSendEvent",mt)}}}function mt(t){(0,f.Gd)().addBreadcrumb({category:"sentry."+("transaction"===t.type?"transaction":"event"),event_id:t.event_id,level:t.level,message:(0,s.jH)(t)},{event:t})}function ft(t){const e={category:"console",data:{arguments:t.args,logger:"console"},level:ut(t.level),message:(0,i.nK)(t.args," ")};if("assert"===t.level){if(!1!==t.args[0])return;e.message=`Assertion failed: ${(0,i.nK)(t.args.slice(1)," ")||"console.assert"}`,e.data.arguments=t.args.slice(1)}(0,f.Gd)().addBreadcrumb(e,{input:t.args,level:t.level})}function gt(t){const{startTimestamp:e,endTimestamp:n}=t,r=t.xhr[at.xU];if(!e||!n||!r)return;const{method:s,url:i,status_code:o,body:a}=r,c={method:s,url:i,status_code:o},l={xhr:t.xhr,input:a,startTimestamp:e,endTimestamp:n};(0,f.Gd)().addBreadcrumb({category:"xhr",data:c,type:"http"},l)}function yt(t){const{startTimestamp:e,endTimestamp:n}=t;if(n&&(!t.fetchData.url.match(/sentry_key/)||"POST"!==t.fetchData.method))if(t.error){const r=t.fetchData,s={data:t.error,input:t.args,startTimestamp:e,endTimestamp:n};(0,f.Gd)().addBreadcrumb({category:"fetch",data:r,level:"error",type:"http"},s)}else{const r=t.response,s={...t.fetchData,status_code:r&&r.status},i={input:t.args,response:r,startTimestamp:e,endTimestamp:n};(0,f.Gd)().addBreadcrumb({category:"fetch",data:s,type:"http"},i)}}function _t(t){let e=t.from,n=t.to;const r=dt(j.location.href);let s=e?dt(e):void 0;const i=dt(n);s&&s.path||(s=r),r.protocol===i.protocol&&r.host===i.host&&(n=i.relative),r.protocol===s.protocol&&r.host===s.host&&(e=s.relative),(0,f.Gd)().addBreadcrumb({category:"navigation",data:{from:e,to:n}})}function vt(t,e,n=250,r,s,o,a){if(!o.exception||!o.exception.values||!a||!(0,T.V9)(a.originalException,Error))return;const c=o.exception.values.length>0?o.exception.values[o.exception.values.length-1]:void 0;var l,u;c&&(o.exception.values=(l=St(t,e,s,a.originalException,r,o.exception.values,c,0),u=n,l.map((t=>(t.value&&(t.value=(0,i.$G)(t.value,u)),t)))))}function St(t,e,n,r,s,i,o,a){if(i.length>=n+1)return i;let c=[...i];if((0,T.V9)(r[s],Error)){kt(o,a);const i=t(e,r[s]),l=c.length;bt(i,s,l,a),c=St(t,e,n,r[s],s,[i,...c],i,l)}return Array.isArray(r.errors)&&r.errors.forEach(((r,i)=>{if((0,T.V9)(r,Error)){kt(o,a);const l=t(e,r),u=c.length;bt(l,`errors[${i}]`,u,a),c=St(t,e,n,r,s,[l,...c],l,u)}})),c}function kt(t,e){t.mechanism=t.mechanism||{type:"generic",handled:!0},t.mechanism={...t.mechanism,is_exception_group:!0,exception_id:e}}function bt(t,e,n,r){t.mechanism=t.mechanism||{type:"generic",handled:!0},t.mechanism={...t.mechanism,type:"chained",source:e,exception_id:n,parent_id:r}}pt.__initStatic();class wt{static __initStatic(){this.id="LinkedErrors"}constructor(t={}){this.name=wt.id,this._key=t.key||"cause",this._limit=t.limit||5}setupOnce(){}preprocessEvent(t,e,n){const r=n.getOptions();vt(R,r.stackParser,r.maxValueLength,this._key,this._limit,t,e)}}wt.__initStatic();class Et{static __initStatic(){this.id="HttpContext"}constructor(){this.name=Et.id}setupOnce(){}preprocessEvent(t){if(!j.navigator&&!j.location&&!j.document)return;const e=t.request&&t.request.url||j.location&&j.location.href,{referrer:n}=j.document||{},{userAgent:r}=j.navigator||{},s={...t.request&&t.request.headers,...n&&{Referer:n},...r&&{"User-Agent":r}},i={...t.request,...e&&{url:e},headers:s};t.request=i}}Et.__initStatic();class xt{static __initStatic(){this.id="Dedupe"}constructor(){this.name=xt.id}setupOnce(t,e){}processEvent(t){if(t.type)return t;try{if(function(t,e){if(!e)return!1;if(function(t,e){const n=t.message,r=e.message;if(!n&&!r)return!1;if(n&&!r||!n&&r)return!1;if(n!==r)return!1;if(!It(t,e))return!1;if(!Tt(t,e))return!1;return!0}(t,e))return!0;if(function(t,e){const n=Ct(e),r=Ct(t);if(!n||!r)return!1;if(n.type!==r.type||n.value!==r.value)return!1;if(!It(t,e))return!1;if(!Tt(t,e))return!1;return!0}(t,e))return!0;return!1}(t,this._previousEvent))return x&&r.kg.warn("Event dropped due to being a duplicate of previously captured event."),null}catch(e){}return this._previousEvent=t}}function Tt(t,e){let n=Rt(t),r=Rt(e);if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;if(r.length!==n.length)return!1;for(let s=0;s<r.length;s++){const t=r[s],e=n[s];if(t.filename!==e.filename||t.lineno!==e.lineno||t.colno!==e.colno||t.function!==e.function)return!1}return!0}function It(t,e){let n=t.fingerprint,r=e.fingerprint;if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;try{return!(n.join("")!==r.join(""))}catch(s){return!1}}function Ct(t){return t.exception&&t.exception.values&&t.exception.values[0]}function Rt(t){const e=t.exception;if(e)try{return e.values[0].stacktrace.frames}catch(n){return}}xt.__initStatic();const Mt="?";function Ot(t,e,n,r){const s={filename:t,function:e,in_app:!0};return void 0!==n&&(s.lineno=n),void 0!==r&&(s.colno=r),s}const Dt=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,At=/\((\S*)(?::(\d+))(?::(\d+))\)/,Nt=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Lt=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,$t=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:[-a-z]+):.*?):(\d+)(?::(\d+))?\)?\s*$/i,Pt=[[30,t=>{const e=Dt.exec(t);if(e){if(e[2]&&0===e[2].indexOf("eval")){const t=At.exec(e[2]);t&&(e[2]=t[1],e[3]=t[2],e[4]=t[3])}const[t,n]=jt(e[1]||Mt,e[2]);return Ot(n,t,e[3]?+e[3]:void 0,e[4]?+e[4]:void 0)}}],[50,t=>{const e=Nt.exec(t);if(e){if(e[3]&&e[3].indexOf(" > eval")>-1){const t=Lt.exec(e[3]);t&&(e[1]=e[1]||"eval",e[3]=t[1],e[4]=t[2],e[5]="")}let t=e[3],n=e[1]||Mt;return[n,t]=jt(n,t),Ot(t,n,e[4]?+e[4]:void 0,e[5]?+e[5]:void 0)}}],[40,t=>{const e=$t.exec(t);return e?Ot(e[2],e[1]||Mt,+e[3],e[4]?+e[4]:void 0):void 0}]],Ft=(0,g.pE)(...Pt),jt=(t,e)=>{const n=-1!==t.indexOf("safari-extension"),r=-1!==t.indexOf("safari-web-extension");return n||r?[-1!==t.indexOf("@")?t.split("@")[0]:Mt,n?`safari-extension:${e}`:`safari-web-extension:${e}`]:[t,e]};var Ut=n(409);function Bt(t){const e=[];function n(t){return e.splice(e.indexOf(t),1)[0]}return{$:e,add:function(r){if(!(void 0===t||e.length<t))return(0,C.$2)(new Ut.b("Not adding Promise because buffer limit was reached."));const s=r();return-1===e.indexOf(s)&&e.push(s),s.then((()=>n(s))).then(null,(()=>n(s).then(null,(()=>{})))),s},drain:function(t){return new C.cW(((n,r)=>{let s=e.length;if(!s)return n(!0);const i=setTimeout((()=>{t&&t>0&&n(!1)}),t);e.forEach((t=>{(0,C.WD)(t).then((()=>{--s||(clearTimeout(i),n(!0))}),r)}))}))}}}var Ht=n(228);const zt=30;function Wt(t,e,n=Bt(t.bufferSize||zt)){let s={};function i(i){const a=[];if((0,b.gv)(i,((e,n)=>{const r=(0,b.mL)(n);if((0,Ht.Q)(s,r)){const s=qt(e,n);t.recordDroppedEvent("ratelimit_backoff",r,s)}else a.push(e)})),0===a.length)return(0,C.WD)();const c=(0,b.Jd)(i[0],a),l=e=>{(0,b.gv)(c,((n,r)=>{const s=qt(n,r);t.recordDroppedEvent(e,(0,b.mL)(r),s)}))};return n.add((()=>e({body:(0,b.V$)(c,t.textEncoder)}).then((t=>(void 0!==t.statusCode&&(t.statusCode<200||t.statusCode>=300)&&o.X&&r.kg.warn(`Sentry responded with status code ${t.statusCode} to sent event.`),s=(0,Ht.WG)(s,t),t)),(t=>{throw l("network_error"),t})))).then((t=>t),(t=>{if(t instanceof Ut.b)return o.X&&r.kg.error("Skipped sending event because buffer is full."),l("queue_overflow"),(0,C.WD)();throw t}))}return i.__sentry__baseTransport__=!0,{send:i,flush:t=>n.drain(t)}}function qt(t,e){if("event"===e||"transaction"===e)return Array.isArray(t)?t[1]:void 0}let Xt;function Gt(t,e=function(){if(Xt)return Xt;if((0,y.Du)(j.fetch))return Xt=j.fetch.bind(j);const t=j.document;let e=j.fetch;if(t&&"function"===typeof t.createElement)try{const n=t.createElement("iframe");n.hidden=!0,t.head.appendChild(n);const r=n.contentWindow;r&&r.fetch&&(e=r.fetch),t.head.removeChild(n)}catch(n){x&&r.kg.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",n)}return Xt=e.bind(j)}()){let n=0,s=0;return Wt(t,(function(r){const i=r.body.length;n+=i,s++;const o={body:r.body,method:"POST",referrerPolicy:"origin",headers:t.headers,keepalive:n<=6e4&&s<15,...t.fetchOptions};try{return e(t.url,o).then((t=>(n-=i,s--,{statusCode:t.status,headers:{"x-sentry-rate-limits":t.headers.get("X-Sentry-Rate-Limits"),"retry-after":t.headers.get("Retry-After")}})))}catch(a){return Xt=void 0,n-=i,s--,(0,C.$2)(a)}}))}const Kt=4;function Jt(t){return Wt(t,(function(e){return new C.cW(((n,r)=>{const s=new XMLHttpRequest;s.onerror=r,s.onreadystatechange=()=>{s.readyState===Kt&&n({statusCode:s.status,headers:{"x-sentry-rate-limits":s.getResponseHeader("X-Sentry-Rate-Limits"),"retry-after":s.getResponseHeader("Retry-After")}})},s.open("POST",t.url);for(const e in t.headers)Object.prototype.hasOwnProperty.call(t.headers,e)&&s.setRequestHeader(e,t.headers[e]);s.send(e.body)}))}))}const Yt=[new l,new p,new Z,new pt,new G,new wt,new xt,new Et];function Vt(t={}){void 0===t.defaultIntegrations&&(t.defaultIntegrations=Yt),void 0===t.release&&("string"===typeof __SENTRY_RELEASE__&&(t.release=__SENTRY_RELEASE__),j.SENTRY_RELEASE&&j.SENTRY_RELEASE.id&&(t.release=j.SENTRY_RELEASE.id)),void 0===t.autoSessionTracking&&(t.autoSessionTracking=!0),void 0===t.sendClientReports&&(t.sendClientReports=!0);const e={...t,stackParser:(0,g.Sq)(t.stackParser||Ft),integrations:(0,m.m8)(t),transport:t.transport||((0,y.Ak)()?Gt:Jt)};!function(t,e){!0===e.debug&&(o.X?r.kg.enable():(0,r.Cf)((()=>{console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.")})));const n=(0,f.Gd)();n.getScope().update(e.initialScope);const s=new t(e);n.bindClient(s)}(z,e),t.autoSessionTracking&&function(){if("undefined"===typeof j.document)return void(x&&r.kg.warn("Session tracking in non-browser environment with @sentry/browser is not supported."));const t=(0,f.Gd)();if(!t.captureSession)return;Qt(t),(0,_.a)((({from:t,to:e})=>{void 0!==t&&t!==e&&Qt((0,f.Gd)())}))}()}function Qt(t){t.startSession({ignoreDuration:!0}),t.captureSession()}},7893:(t,e,n)=>{n.d(e,{W:()=>k,Q:()=>E});var r=n(292),s=n(2343),i=n(2844),o=n(7597),a=n(6893),c=n(8725),l=n(409),u=n(535);const d="7";function h(t){const e=t.protocol?`${t.protocol}:`:"",n=t.port?`:${t.port}`:"";return`${e}//${t.host}${n}${t.path?`/${t.path}`:""}/api/`}function p(t,e={}){const n="string"===typeof e?e:e.tunnel,r="string"!==typeof e&&e._metadata?e._metadata.sdk:void 0;return n||`${function(t){return`${h(t)}${t.projectId}/envelope/`}(t)}?${function(t,e){return(0,u._j)({sentry_key:t.publicKey,sentry_version:d,...e&&{sentry_client:`${e.name}/${e.version}`}})}(t,r)}`}var m=n(1703);var f=n(5659),g=n(2967),y=n(9015),_=n(454),v=n(8942);const S="Not capturing exception because it's already been captured.";class k{constructor(t){if(this._options=t,this._integrations={},this._integrationsInitialized=!1,this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],t.dsn?this._dsn=(0,r.vK)(t.dsn):m.X&&s.kg.warn("No DSN provided, client will not send events."),this._dsn){const e=p(this._dsn,t);this._transport=t.transport({recordDroppedEvent:this.recordDroppedEvent.bind(this),...t.transportOptions,url:e})}}captureException(t,e,n){if((0,i.YO)(t))return void(m.X&&s.kg.log(S));let r=e&&e.event_id;return this._process(this.eventFromException(t,e).then((t=>this._captureEvent(t,e,n))).then((t=>{r=t}))),r}captureMessage(t,e,n,r){let s=n&&n.event_id;const i=(0,o.pt)(t)?this.eventFromMessage(String(t),e,n):this.eventFromException(t,n);return this._process(i.then((t=>this._captureEvent(t,n,r))).then((t=>{s=t}))),s}captureEvent(t,e,n){if(e&&e.originalException&&(0,i.YO)(e.originalException))return void(m.X&&s.kg.log(S));let r=e&&e.event_id;return this._process(this._captureEvent(t,e,n).then((t=>{r=t}))),r}captureSession(t){"string"!==typeof t.release?m.X&&s.kg.warn("Discarded session because of missing or non-string release"):(this.sendSession(t),(0,y.CT)(t,{init:!1}))}getDsn(){return this._dsn}getOptions(){return this._options}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}flush(t){const e=this._transport;return e?this._isClientDoneProcessing(t).then((n=>e.flush(t).then((t=>n&&t)))):(0,a.WD)(!0)}close(t){return this.flush(t).then((t=>(this.getOptions().enabled=!1,t)))}getEventProcessors(){return this._eventProcessors}addEventProcessor(t){this._eventProcessors.push(t)}setupIntegrations(t){(t&&!this._integrationsInitialized||this._isEnabled()&&!this._integrationsInitialized)&&(this._integrations=(0,g.q4)(this,this._options.integrations),this._integrationsInitialized=!0)}getIntegrationById(t){return this._integrations[t]}getIntegration(t){try{return this._integrations[t.id]||null}catch(e){return m.X&&s.kg.warn(`Cannot retrieve integration ${t.id} from the current Client`),null}}addIntegration(t){(0,g.m7)(this,t,this._integrations)}sendEvent(t,e={}){this.emit("beforeSendEvent",t,e);let n=function(t,e,n,r){const s=(0,c.HY)(n),i=t.type&&"replay_event"!==t.type?t.type:"event";!function(t,e){e&&(t.sdk=t.sdk||{},t.sdk.name=t.sdk.name||e.name,t.sdk.version=t.sdk.version||e.version,t.sdk.integrations=[...t.sdk.integrations||[],...e.integrations||[]],t.sdk.packages=[...t.sdk.packages||[],...e.packages||[]])}(t,n&&n.sdk);const o=(0,c.Cd)(t,s,r,e);delete t.sdkProcessingMetadata;const a=[{type:i},t];return(0,c.Jd)(o,[a])}(t,this._dsn,this._options._metadata,this._options.tunnel);for(const s of e.attachments||[])n=(0,c.BO)(n,(0,c.zQ)(s,this._options.transportOptions&&this._options.transportOptions.textEncoder));const r=this._sendEnvelope(n);r&&r.then((e=>this.emit("afterSendEvent",t,e)),null)}sendSession(t){const e=function(t,e,n,s){const i=(0,c.HY)(n),o={sent_at:(new Date).toISOString(),...i&&{sdk:i},...!!s&&e&&{dsn:(0,r.RA)(e)}},a="aggregates"in t?[{type:"sessions"},t]:[{type:"session"},t.toJSON()];return(0,c.Jd)(o,[a])}(t,this._dsn,this._options._metadata,this._options.tunnel);this._sendEnvelope(e)}recordDroppedEvent(t,e,n){if(this._options.sendClientReports){const n=`${t}:${e}`;m.X&&s.kg.log(`Adding outcome: "${n}"`),this._outcomes[n]=this._outcomes[n]+1||1}}on(t,e){this._hooks[t]||(this._hooks[t]=[]),this._hooks[t].push(e)}emit(t,...e){this._hooks[t]&&this._hooks[t].forEach((t=>t(...e)))}_updateSessionFromEvent(t,e){let n=!1,r=!1;const s=e.exception&&e.exception.values;if(s){r=!0;for(const t of s){const e=t.mechanism;if(e&&!1===e.handled){n=!0;break}}}const i="ok"===t.status;(i&&0===t.errors||i&&n)&&((0,y.CT)(t,{...n&&{status:"crashed"},errors:t.errors||Number(r||n)}),this.captureSession(t))}_isClientDoneProcessing(t){return new a.cW((e=>{let n=0;const r=setInterval((()=>{0==this._numProcessing?(clearInterval(r),e(!0)):(n+=1,t&&n>=t&&(clearInterval(r),e(!1)))}),1)}))}_isEnabled(){return!1!==this.getOptions().enabled&&void 0!==this._transport}_prepareEvent(t,e,n){const r=this.getOptions(),s=Object.keys(this._integrations);return!e.integrations&&s.length>0&&(e.integrations=s),this.emit("preprocessEvent",t,e),(0,v.R)(r,t,e,n,this).then((t=>{if(null===t)return t;const{propagationContext:e}=t.sdkProcessingMetadata||{};if(!(t.contexts&&t.contexts.trace)&&e){const{traceId:r,spanId:s,parentSpanId:i,dsc:o}=e;t.contexts={trace:{trace_id:r,span_id:s,parent_span_id:i},...t.contexts};const a=o||(0,_._)(r,this,n);t.sdkProcessingMetadata={dynamicSamplingContext:a,...t.sdkProcessingMetadata}}return t}))}_captureEvent(t,e={},n){return this._processEvent(t,e,n).then((t=>t.event_id),(t=>{if(m.X){const e=t;"log"===e.logLevel?s.kg.log(e.message):s.kg.warn(e)}}))}_processEvent(t,e,n){const r=this.getOptions(),{sampleRate:s}=r,i=w(t),c=b(t),u=t.type||"error",d=`before send for type \`${u}\``;if(c&&"number"===typeof s&&Math.random()>s)return this.recordDroppedEvent("sample_rate","error",t),(0,a.$2)(new l.b(`Discarding event because it's not included in the random sample (sampling rate = ${s})`,"log"));const h="replay_event"===u?"replay":u;return this._prepareEvent(t,e,n).then((n=>{if(null===n)throw this.recordDroppedEvent("event_processor",h,t),new l.b("An event processor returned `null`, will not send event.","log");if(e.data&&!0===e.data.__sentry__)return n;const s=function(t,e,n){const{beforeSend:r,beforeSendTransaction:s}=t;if(b(e)&&r)return r(e,n);if(w(e)&&s)return s(e,n);return e}(r,n,e);return function(t,e){const n=`${e} must return \`null\` or a valid event.`;if((0,o.J8)(t))return t.then((t=>{if(!(0,o.PO)(t)&&null!==t)throw new l.b(n);return t}),(t=>{throw new l.b(`${e} rejected with ${t}`)}));if(!(0,o.PO)(t)&&null!==t)throw new l.b(n);return t}(s,d)})).then((r=>{if(null===r)throw this.recordDroppedEvent("before_send",h,t),new l.b(`${d} returned \`null\`, will not send event.`,"log");const s=n&&n.getSession();!i&&s&&this._updateSessionFromEvent(s,r);const o=r.transaction_info;if(i&&o&&r.transaction!==t.transaction){const t="custom";r.transaction_info={...o,source:t}}return this.sendEvent(r,e),r})).then(null,(t=>{if(t instanceof l.b)throw t;throw this.captureException(t,{data:{__sentry__:!0},originalException:t}),new l.b(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.\nReason: ${t}`)}))}_process(t){this._numProcessing++,t.then((t=>(this._numProcessing--,t)),(t=>(this._numProcessing--,t)))}_sendEnvelope(t){if(this.emit("beforeEnvelope",t),this._isEnabled()&&this._transport)return this._transport.send(t).then(null,(t=>{m.X&&s.kg.error("Error while sending event:",t)}));m.X&&s.kg.error("Transport disabled")}_clearOutcomes(){const t=this._outcomes;return this._outcomes={},Object.keys(t).map((e=>{const[n,r]=e.split(":");return{reason:n,category:r,quantity:t[e]}}))}}function b(t){return void 0===t.type}function w(t){return"transaction"===t.type}function E(t){const e=(0,f.Gd)().getClient();e&&e.addEventProcessor&&e.addEventProcessor(t)}},1131:(t,e,n)=>{n.d(e,{J:()=>r});const r="production"},1703:(t,e,n)=>{n.d(e,{X:()=>r});const r="undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__},1195:(t,e,n)=>{n.d(e,{RP:()=>u,cc:()=>l,fH:()=>c});var r=n(1235),s=n(6893),i=n(2343),o=n(7597),a=n(1703);function c(){return(0,r.YO)("globalEventProcessors",(()=>[]))}function l(t){c().push(t)}function u(t,e,n,r=0){return new s.cW(((s,c)=>{const l=t[r];if(null===e||"function"!==typeof l)s(e);else{const d=l({...e},n);a.X&&l.id&&null===d&&i.kg.log(`Event processor "${l.id}" dropped event`),(0,o.J8)(d)?d.then((e=>u(t,e,n,r+1).then(s))).then(null,c):u(t,d,n,r+1).then(s).then(null,c)}}))}},4487:(t,e,n)=>{n.d(e,{$e:()=>a,Tb:()=>i,s3:()=>c,v:()=>o});var r=n(5659),s=n(8942);function i(t,e){return(0,r.Gd)().captureException(t,(0,s.U0)(e))}function o(t,e){(0,r.Gd)().setContext(t,e)}function a(t){(0,r.Gd)().withScope(t)}function c(){return(0,r.Gd)().getClient()}},5659:(t,e,n)=>{n.d(e,{Gd:()=>y,cu:()=>f});var r=n(2844),s=n(1170),i=n(2343),o=n(1235),a=n(1131),c=n(1703),l=n(350),u=n(9015),d=n(105);const h=parseFloat(d.J),p=100;class m{constructor(t,e=new l.s,n=h){this._version=n,this._stack=[{scope:e}],t&&this.bindClient(t)}isOlderThan(t){return this._version<t}bindClient(t){this.getStackTop().client=t,t&&t.setupIntegrations&&t.setupIntegrations()}pushScope(){const t=l.s.clone(this.getScope());return this.getStack().push({client:this.getClient(),scope:t}),t}popScope(){return!(this.getStack().length<=1)&&!!this.getStack().pop()}withScope(t){const e=this.pushScope();try{t(e)}finally{this.popScope()}}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getStack(){return this._stack}getStackTop(){return this._stack[this._stack.length-1]}captureException(t,e){const n=this._lastEventId=e&&e.event_id?e.event_id:(0,r.DM)(),s=new Error("Sentry syntheticException");return this._withClient(((r,i)=>{r.captureException(t,{originalException:t,syntheticException:s,...e,event_id:n},i)})),n}captureMessage(t,e,n){const s=this._lastEventId=n&&n.event_id?n.event_id:(0,r.DM)(),i=new Error(t);return this._withClient(((r,o)=>{r.captureMessage(t,e,{originalException:t,syntheticException:i,...n,event_id:s},o)})),s}captureEvent(t,e){const n=e&&e.event_id?e.event_id:(0,r.DM)();return t.type||(this._lastEventId=n),this._withClient(((r,s)=>{r.captureEvent(t,{...e,event_id:n},s)})),n}lastEventId(){return this._lastEventId}addBreadcrumb(t,e){const{scope:n,client:r}=this.getStackTop();if(!r)return;const{beforeBreadcrumb:o=null,maxBreadcrumbs:a=p}=r.getOptions&&r.getOptions()||{};if(a<=0)return;const c={timestamp:(0,s.yW)(),...t},l=o?(0,i.Cf)((()=>o(c,e))):c;null!==l&&(r.emit&&r.emit("beforeAddBreadcrumb",l,e),n.addBreadcrumb(l,a))}setUser(t){this.getScope().setUser(t)}setTags(t){this.getScope().setTags(t)}setExtras(t){this.getScope().setExtras(t)}setTag(t,e){this.getScope().setTag(t,e)}setExtra(t,e){this.getScope().setExtra(t,e)}setContext(t,e){this.getScope().setContext(t,e)}configureScope(t){const{scope:e,client:n}=this.getStackTop();n&&t(e)}run(t){const e=g(this);try{t(this)}finally{g(e)}}getIntegration(t){const e=this.getClient();if(!e)return null;try{return e.getIntegration(t)}catch(n){return c.X&&i.kg.warn(`Cannot retrieve integration ${t.id} from the current Hub`),null}}startTransaction(t,e){const n=this._callExtensionMethod("startTransaction",t,e);if(c.X&&!n){this.getClient()?i.kg.warn("Tracing extension 'startTransaction' has not been added. Call 'addTracingExtensions' before calling 'init':\nSentry.addTracingExtensions();\nSentry.init({...});\n"):i.kg.warn("Tracing extension 'startTransaction' is missing. You should 'init' the SDK before calling 'startTransaction'")}return n}traceHeaders(){return this._callExtensionMethod("traceHeaders")}captureSession(t=!1){if(t)return this.endSession();this._sendSessionUpdate()}endSession(){const t=this.getStackTop().scope,e=t.getSession();e&&(0,u.RJ)(e),this._sendSessionUpdate(),t.setSession()}startSession(t){const{scope:e,client:n}=this.getStackTop(),{release:r,environment:s=a.J}=n&&n.getOptions()||{},{userAgent:i}=o.n2.navigator||{},c=(0,u.Hv)({release:r,environment:s,user:e.getUser(),...i&&{userAgent:i},...t}),l=e.getSession&&e.getSession();return l&&"ok"===l.status&&(0,u.CT)(l,{status:"exited"}),this.endSession(),e.setSession(c),c}shouldSendDefaultPii(){const t=this.getClient(),e=t&&t.getOptions();return Boolean(e&&e.sendDefaultPii)}_sendSessionUpdate(){const{scope:t,client:e}=this.getStackTop(),n=t.getSession();n&&e&&e.captureSession&&e.captureSession(n)}_withClient(t){const{scope:e,client:n}=this.getStackTop();n&&t(n,e)}_callExtensionMethod(t,...e){const n=f().__SENTRY__;if(n&&n.extensions&&"function"===typeof n.extensions[t])return n.extensions[t].apply(this,e);c.X&&i.kg.warn(`Extension method ${t} couldn't be found, doing nothing.`)}}function f(){return o.n2.__SENTRY__=o.n2.__SENTRY__||{extensions:{},hub:void 0},o.n2}function g(t){const e=f(),n=S(e);return k(e,t),n}function y(){const t=f();if(t.__SENTRY__&&t.__SENTRY__.acs){const e=t.__SENTRY__.acs.getCurrentHub();if(e)return e}return _(t)}function _(t=f()){return v(t)&&!S(t).isOlderThan(h)||k(t,new m),S(t)}function v(t){return!!(t&&t.__SENTRY__&&t.__SENTRY__.hub)}function S(t){return(0,o.YO)("hub",(()=>new m),t)}function k(t,e){if(!t)return!1;return(t.__SENTRY__=t.__SENTRY__||{}).hub=e,!0}},2967:(t,e,n)=>{n.d(e,{m7:()=>d,m8:()=>l,q4:()=>u});var r=n(2844),s=n(2343),i=n(1703),o=n(1195),a=n(5659);const c=[];function l(t){const e=t.defaultIntegrations||[],n=t.integrations;let s;e.forEach((t=>{t.isDefaultInstance=!0})),s=Array.isArray(n)?[...e,...n]:"function"===typeof n?(0,r.lE)(n(e)):e;const i=function(t){const e={};return t.forEach((t=>{const{name:n}=t,r=e[n];r&&!r.isDefaultInstance&&t.isDefaultInstance||(e[n]=t)})),Object.keys(e).map((t=>e[t]))}(s),o=function(t,e){for(let n=0;n<t.length;n++)if(!0===e(t[n]))return n;return-1}(i,(t=>"Debug"===t.name));if(-1!==o){const[t]=i.splice(o,1);i.push(t)}return i}function u(t,e){const n={};return e.forEach((e=>{e&&d(t,e,n)})),n}function d(t,e,n){if(n[e.name]=e,-1===c.indexOf(e.name)&&(e.setupOnce(o.cc,a.Gd),c.push(e.name)),e.setup&&"function"===typeof e.setup&&e.setup(t),t.on&&"function"===typeof e.preprocessEvent){const n=e.preprocessEvent.bind(e);t.on("preprocessEvent",((e,r)=>n(e,r,t)))}if(t.addEventProcessor&&"function"===typeof e.processEvent){const n=e.processEvent.bind(e),r=Object.assign(((e,r)=>n(e,r,t)),{id:e.name});t.addEventProcessor(r)}i.X&&s.kg.log(`Integration installed: ${e.name}`)}},350:(t,e,n)=>{n.d(e,{s:()=>c});var r=n(7597),s=n(1170),i=n(2844),o=n(1195),a=n(9015);class c{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext=l()}static clone(t){const e=new c;return t&&(e._breadcrumbs=[...t._breadcrumbs],e._tags={...t._tags},e._extra={...t._extra},e._contexts={...t._contexts},e._user=t._user,e._level=t._level,e._span=t._span,e._session=t._session,e._transactionName=t._transactionName,e._fingerprint=t._fingerprint,e._eventProcessors=[...t._eventProcessors],e._requestSession=t._requestSession,e._attachments=[...t._attachments],e._sdkProcessingMetadata={...t._sdkProcessingMetadata},e._propagationContext={...t._propagationContext}),e}addScopeListener(t){this._scopeListeners.push(t)}addEventProcessor(t){return this._eventProcessors.push(t),this}setUser(t){return this._user=t||{},this._session&&(0,a.CT)(this._session,{user:t}),this._notifyScopeListeners(),this}getUser(){return this._user}getRequestSession(){return this._requestSession}setRequestSession(t){return this._requestSession=t,this}setTags(t){return this._tags={...this._tags,...t},this._notifyScopeListeners(),this}setTag(t,e){return this._tags={...this._tags,[t]:e},this._notifyScopeListeners(),this}setExtras(t){return this._extra={...this._extra,...t},this._notifyScopeListeners(),this}setExtra(t,e){return this._extra={...this._extra,[t]:e},this._notifyScopeListeners(),this}setFingerprint(t){return this._fingerprint=t,this._notifyScopeListeners(),this}setLevel(t){return this._level=t,this._notifyScopeListeners(),this}setTransactionName(t){return this._transactionName=t,this._notifyScopeListeners(),this}setContext(t,e){return null===e?delete this._contexts[t]:this._contexts[t]=e,this._notifyScopeListeners(),this}setSpan(t){return this._span=t,this._notifyScopeListeners(),this}getSpan(){return this._span}getTransaction(){const t=this.getSpan();return t&&t.transaction}setSession(t){return t?this._session=t:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(t){if(!t)return this;if("function"===typeof t){const e=t(this);return e instanceof c?e:this}return t instanceof c?(this._tags={...this._tags,...t._tags},this._extra={...this._extra,...t._extra},this._contexts={...this._contexts,...t._contexts},t._user&&Object.keys(t._user).length&&(this._user=t._user),t._level&&(this._level=t._level),t._fingerprint&&(this._fingerprint=t._fingerprint),t._requestSession&&(this._requestSession=t._requestSession),t._propagationContext&&(this._propagationContext=t._propagationContext)):(0,r.PO)(t)&&(this._tags={...this._tags,...t.tags},this._extra={...this._extra,...t.extra},this._contexts={...this._contexts,...t.contexts},t.user&&(this._user=t.user),t.level&&(this._level=t.level),t.fingerprint&&(this._fingerprint=t.fingerprint),t.requestSession&&(this._requestSession=t.requestSession),t.propagationContext&&(this._propagationContext=t.propagationContext)),this}clear(){return this._breadcrumbs=[],this._tags={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._requestSession=void 0,this._span=void 0,this._session=void 0,this._notifyScopeListeners(),this._attachments=[],this._propagationContext=l(),this}addBreadcrumb(t,e){const n="number"===typeof e?e:100;if(n<=0)return this;const r={timestamp:(0,s.yW)(),...t},i=this._breadcrumbs;return i.push(r),this._breadcrumbs=i.length>n?i.slice(-n):i,this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(t){return this._attachments.push(t),this}getAttachments(){return this._attachments}clearAttachments(){return this._attachments=[],this}applyToEvent(t,e={},n){if(this._extra&&Object.keys(this._extra).length&&(t.extra={...this._extra,...t.extra}),this._tags&&Object.keys(this._tags).length&&(t.tags={...this._tags,...t.tags}),this._user&&Object.keys(this._user).length&&(t.user={...this._user,...t.user}),this._contexts&&Object.keys(this._contexts).length&&(t.contexts={...this._contexts,...t.contexts}),this._level&&(t.level=this._level),this._transactionName&&(t.transaction=this._transactionName),this._span){t.contexts={trace:this._span.getTraceContext(),...t.contexts};const e=this._span.transaction;if(e){t.sdkProcessingMetadata={dynamicSamplingContext:e.getDynamicSamplingContext(),...t.sdkProcessingMetadata};const n=e.name;n&&(t.tags={transaction:n,...t.tags})}}this._applyFingerprint(t);const r=this._getBreadcrumbs(),s=[...t.breadcrumbs||[],...r];return t.breadcrumbs=s.length>0?s:void 0,t.sdkProcessingMetadata={...t.sdkProcessingMetadata,...this._sdkProcessingMetadata,propagationContext:this._propagationContext},(0,o.RP)([...n||[],...(0,o.fH)(),...this._eventProcessors],t,e)}setSDKProcessingMetadata(t){return this._sdkProcessingMetadata={...this._sdkProcessingMetadata,...t},this}setPropagationContext(t){return this._propagationContext=t,this}getPropagationContext(){return this._propagationContext}_getBreadcrumbs(){return this._breadcrumbs}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach((t=>{t(this)})),this._notifyingListeners=!1)}_applyFingerprint(t){t.fingerprint=t.fingerprint?(0,i.lE)(t.fingerprint):[],this._fingerprint&&(t.fingerprint=t.fingerprint.concat(this._fingerprint)),t.fingerprint&&!t.fingerprint.length&&delete t.fingerprint}}function l(){return{traceId:(0,i.DM)(),spanId:(0,i.DM)().substring(16)}}},9015:(t,e,n)=>{n.d(e,{CT:()=>a,Hv:()=>o,RJ:()=>c});var r=n(1170),s=n(2844),i=n(535);function o(t){const e=(0,r.ph)(),n={sid:(0,s.DM)(),init:!0,timestamp:e,started:e,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>function(t){return(0,i.Jr)({sid:`${t.sid}`,init:t.init,started:new Date(1e3*t.started).toISOString(),timestamp:new Date(1e3*t.timestamp).toISOString(),status:t.status,errors:t.errors,did:"number"===typeof t.did||"string"===typeof t.did?`${t.did}`:void 0,duration:t.duration,abnormal_mechanism:t.abnormal_mechanism,attrs:{release:t.release,environment:t.environment,ip_address:t.ipAddress,user_agent:t.userAgent}})}(n)};return t&&a(n,t),n}function a(t,e={}){if(e.user&&(!t.ipAddress&&e.user.ip_address&&(t.ipAddress=e.user.ip_address),t.did||e.did||(t.did=e.user.id||e.user.email||e.user.username)),t.timestamp=e.timestamp||(0,r.ph)(),e.abnormal_mechanism&&(t.abnormal_mechanism=e.abnormal_mechanism),e.ignoreDuration&&(t.ignoreDuration=e.ignoreDuration),e.sid&&(t.sid=32===e.sid.length?e.sid:(0,s.DM)()),void 0!==e.init&&(t.init=e.init),!t.did&&e.did&&(t.did=`${e.did}`),"number"===typeof e.started&&(t.started=e.started),t.ignoreDuration)t.duration=void 0;else if("number"===typeof e.duration)t.duration=e.duration;else{const e=t.timestamp-t.started;t.duration=e>=0?e:0}e.release&&(t.release=e.release),e.environment&&(t.environment=e.environment),!t.ipAddress&&e.ipAddress&&(t.ipAddress=e.ipAddress),!t.userAgent&&e.userAgent&&(t.userAgent=e.userAgent),"number"===typeof e.errors&&(t.errors=e.errors),e.status&&(t.status=e.status)}function c(t,e){let n={};e?n={status:e}:"ok"===t.status&&(n={status:"exited"}),a(t,n)}},454:(t,e,n)=>{n.d(e,{_:()=>i});var r=n(535),s=n(1131);function i(t,e,n){const i=e.getOptions(),{publicKey:o}=e.getDsn()||{},{segment:a}=n&&n.getUser()||{},c=(0,r.Jr)({environment:i.environment||s.J,release:i.release,user_segment:a,public_key:o,trace_id:t});return e.emit&&e.emit("createDsc",c),c}},2931:(t,e,n)=>{n.d(e,{T:()=>v,l:()=>_});var r=n(2343),s=n(1703),i=n(5659),o=n(1674),a=n(7373),c=n(9791);let l=!1;function u(){const t=(0,c.x1)();if(t){const e="internal_error";s.X&&r.kg.log(`[Tracing] Transaction: ${e} -> Global error occured`),t.setStatus(e)}}u.tag="sentry_tracingErrorCallback";var d=n(5544),h=n(7597),p=n(7522);function m(t,e,n){if(!(0,p.z)(e))return t.sampled=!1,t;if(void 0!==t.sampled)return t.setMetadata({sampleRate:Number(t.sampled)}),t;let i;return"function"===typeof e.tracesSampler?(i=e.tracesSampler(n),t.setMetadata({sampleRate:Number(i)})):void 0!==n.parentSampled?i=n.parentSampled:"undefined"!==typeof e.tracesSampleRate?(i=e.tracesSampleRate,t.setMetadata({sampleRate:Number(i)})):(i=1,t.setMetadata({sampleRate:i})),function(t){if((0,h.i2)(t)||"number"!==typeof t&&"boolean"!==typeof t)return s.X&&r.kg.warn(`[Tracing] Given sample rate is invalid. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(t)} of type ${JSON.stringify(typeof t)}.`),!1;if(t<0||t>1)return s.X&&r.kg.warn(`[Tracing] Given sample rate is invalid. Sample rate must be between 0 and 1. Got ${t}.`),!1;return!0}(i)?i?(t.sampled=Math.random()<i,t.sampled?(s.X&&r.kg.log(`[Tracing] starting ${t.op} transaction - ${t.name}`),t):(s.X&&r.kg.log(`[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number(i)})`),t)):(s.X&&r.kg.log("[Tracing] Discarding transaction because "+("function"===typeof e.tracesSampler?"tracesSampler returned 0 or false":"a negative sampling decision was inherited or tracesSampleRate is set to 0")),t.sampled=!1,t):(s.X&&r.kg.warn("[Tracing] Discarding transaction because of invalid sample rate."),t.sampled=!1,t)}var f=n(8069);function g(){const t=this.getScope().getSpan();return t?{"sentry-trace":t.toTraceparent()}:{}}function y(t,e){const n=this.getClient(),i=n&&n.getOptions()||{},o=i.instrumenter||"sentry",a=t.instrumenter||"sentry";o!==a&&(s.X&&r.kg.error(`A transaction was started with instrumenter=\`${a}\`, but the SDK is configured with the \`${o}\` instrumenter.\nThe transaction will not be sampled. Please use the ${o} instrumentation to start transactions.`),t.sampled=!1);let c=new f.Y(t,this);return c=m(c,i,{parentSampled:t.parentSampled,transactionContext:t,...e}),c.sampled&&c.initSpanRecorder(i._experiments&&i._experiments.maxSpans),n&&n.emit&&n.emit("startTransaction",c),c}function _(t,e,n,r,s,i,o){const a=t.getClient(),c=a&&a.getOptions()||{};let l=new d.io(e,t,n,r,o,s);return l=m(l,c,{parentSampled:e.parentSampled,transactionContext:e,...i}),l.sampled&&l.initSpanRecorder(c._experiments&&c._experiments.maxSpans),a&&a.emit&&a.emit("startTransaction",l),l}function v(){const t=(0,i.cu)();t.__SENTRY__&&(t.__SENTRY__.extensions=t.__SENTRY__.extensions||{},t.__SENTRY__.extensions.startTransaction||(t.__SENTRY__.extensions.startTransaction=y),t.__SENTRY__.extensions.traceHeaders||(t.__SENTRY__.extensions.traceHeaders=g),l||(l=!0,(0,o.V)(u),(0,a.h)(u)))}},5544:(t,e,n)=>{n.d(e,{AT:()=>c,io:()=>d});var r=n(1170),s=n(2343),i=n(1703),o=n(8903),a=n(8069);const c={idleTimeout:1e3,finalTimeout:3e4,heartbeatInterval:5e3},l=["heartbeatFailed","idleTimeout","documentHidden","finalTimeout","externalFinish","cancelled"];class u extends o.gB{constructor(t,e,n,r){super(r),this._pushActivity=t,this._popActivity=e,this.transactionSpanId=n}add(t){t.spanId!==this.transactionSpanId&&(t.finish=e=>{t.endTimestamp="number"===typeof e?e:(0,r.ph)(),this._popActivity(t.spanId)},void 0===t.endTimestamp&&this._pushActivity(t.spanId)),super.add(t)}}class d extends a.Y{constructor(t,e,n=c.idleTimeout,r=c.finalTimeout,o=c.heartbeatInterval,a=!1){super(t,e),this._idleHub=e,this._idleTimeout=n,this._finalTimeout=r,this._heartbeatInterval=o,this._onScope=a,this.activities={},this._heartbeatCounter=0,this._finished=!1,this._idleTimeoutCanceledPermanently=!1,this._beforeFinishCallbacks=[],this._finishReason=l[4],a&&(i.X&&s.kg.log(`Setting idle transaction on scope. Span ID: ${this.spanId}`),e.configureScope((t=>t.setSpan(this)))),this._restartIdleTimeout(),setTimeout((()=>{this._finished||(this.setStatus("deadline_exceeded"),this._finishReason=l[3],this.finish())}),this._finalTimeout)}finish(t=(0,r.ph)()){if(this._finished=!0,this.activities={},"ui.action.click"===this.op&&this.setTag("finishReason",this._finishReason),this.spanRecorder){i.X&&s.kg.log("[Tracing] finishing IdleTransaction",new Date(1e3*t).toISOString(),this.op);for(const e of this._beforeFinishCallbacks)e(this,t);this.spanRecorder.spans=this.spanRecorder.spans.filter((e=>{if(e.spanId===this.spanId)return!0;e.endTimestamp||(e.endTimestamp=t,e.setStatus("cancelled"),i.X&&s.kg.log("[Tracing] cancelling span since transaction ended early",JSON.stringify(e,void 0,2)));const n=e.startTimestamp<t,r=(this._finalTimeout+this._idleTimeout)/1e3,o=e.endTimestamp-this.startTimestamp<r;if(i.X){const t=JSON.stringify(e,void 0,2);n?o||s.kg.log("[Tracing] discarding Span since it finished after Transaction final timeout",t):s.kg.log("[Tracing] discarding Span since it happened after Transaction was finished",t)}return n&&o})),i.X&&s.kg.log("[Tracing] flushing IdleTransaction")}else i.X&&s.kg.log("[Tracing] No active IdleTransaction");if(this._onScope){const t=this._idleHub.getScope();t.getTransaction()===this&&t.setSpan(void 0)}return super.finish(t)}registerBeforeFinishCallback(t){this._beforeFinishCallbacks.push(t)}initSpanRecorder(t){if(!this.spanRecorder){const e=t=>{this._finished||this._pushActivity(t)},n=t=>{this._finished||this._popActivity(t)};this.spanRecorder=new u(e,n,this.spanId,t),i.X&&s.kg.log("Starting heartbeat"),this._pingHeartbeat()}this.spanRecorder.add(this)}cancelIdleTimeout(t,{restartOnChildSpanChange:e}={restartOnChildSpanChange:!0}){this._idleTimeoutCanceledPermanently=!1===e,this._idleTimeoutID&&(clearTimeout(this._idleTimeoutID),this._idleTimeoutID=void 0,0===Object.keys(this.activities).length&&this._idleTimeoutCanceledPermanently&&(this._finishReason=l[5],this.finish(t)))}setFinishReason(t){this._finishReason=t}_restartIdleTimeout(t){this.cancelIdleTimeout(),this._idleTimeoutID=setTimeout((()=>{this._finished||0!==Object.keys(this.activities).length||(this._finishReason=l[1],this.finish(t))}),this._idleTimeout)}_pushActivity(t){this.cancelIdleTimeout(void 0,{restartOnChildSpanChange:!this._idleTimeoutCanceledPermanently}),i.X&&s.kg.log(`[Tracing] pushActivity: ${t}`),this.activities[t]=!0,i.X&&s.kg.log("[Tracing] new activities count",Object.keys(this.activities).length)}_popActivity(t){if(this.activities[t]&&(i.X&&s.kg.log(`[Tracing] popActivity ${t}`),delete this.activities[t],i.X&&s.kg.log("[Tracing] new activities count",Object.keys(this.activities).length)),0===Object.keys(this.activities).length){const t=(0,r.ph)();this._idleTimeoutCanceledPermanently?(this._finishReason=l[5],this.finish(t)):this._restartIdleTimeout(t+this._idleTimeout/1e3)}}_beat(){if(this._finished)return;const t=Object.keys(this.activities).join("");t===this._prevHeartbeatString?this._heartbeatCounter++:this._heartbeatCounter=1,this._prevHeartbeatString=t,this._heartbeatCounter>=3?(i.X&&s.kg.log("[Tracing] Transaction finished because of no change for 3 heart beats"),this.setStatus("deadline_exceeded"),this._finishReason=l[0],this.finish()):this._pingHeartbeat()}_pingHeartbeat(){i.X&&s.kg.log(`pinging Heartbeat -> current counter: ${this._heartbeatCounter}`),setTimeout((()=>{this._beat()}),this._heartbeatInterval)}}},8903:(t,e,n)=>{n.d(e,{Dr:()=>u,gB:()=>l});var r=n(2844),s=n(1170),i=n(2343),o=n(7638),a=n(535),c=n(1703);class l{constructor(t=1e3){this._maxlen=t,this.spans=[]}add(t){this.spans.length>this._maxlen?t.spanRecorder=void 0:this.spans.push(t)}}class u{constructor(t={}){this.traceId=t.traceId||(0,r.DM)(),this.spanId=t.spanId||(0,r.DM)().substring(16),this.startTimestamp=t.startTimestamp||(0,s.ph)(),this.tags=t.tags||{},this.data=t.data||{},this.instrumenter=t.instrumenter||"sentry",this.origin=t.origin||"manual",t.parentSpanId&&(this.parentSpanId=t.parentSpanId),"sampled"in t&&(this.sampled=t.sampled),t.op&&(this.op=t.op),t.description&&(this.description=t.description),t.name&&(this.description=t.name),t.status&&(this.status=t.status),t.endTimestamp&&(this.endTimestamp=t.endTimestamp)}get name(){return this.description||""}set name(t){this.setName(t)}startChild(t){const e=new u({...t,parentSpanId:this.spanId,sampled:this.sampled,traceId:this.traceId});if(e.spanRecorder=this.spanRecorder,e.spanRecorder&&e.spanRecorder.add(e),e.transaction=this.transaction,c.X&&e.transaction){const n=`[Tracing] Starting '${t&&t.op||"< unknown op >"}' span on transaction '${e.transaction.name||"< unknown name >"}' (${e.transaction.spanId}).`;e.transaction.metadata.spanMetadata[e.spanId]={logMessage:n},i.kg.log(n)}return e}setTag(t,e){return this.tags={...this.tags,[t]:e},this}setData(t,e){return this.data={...this.data,[t]:e},this}setStatus(t){return this.status=t,this}setHttpStatus(t){this.setTag("http.status_code",String(t)),this.setData("http.response.status_code",t);const e=function(t){if(t<400&&t>=100)return"ok";if(t>=400&&t<500)switch(t){case 401:return"unauthenticated";case 403:return"permission_denied";case 404:return"not_found";case 409:return"already_exists";case 413:return"failed_precondition";case 429:return"resource_exhausted";default:return"invalid_argument"}if(t>=500&&t<600)switch(t){case 501:return"unimplemented";case 503:return"unavailable";case 504:return"deadline_exceeded";default:return"internal_error"}return"unknown_error"}(t);return"unknown_error"!==e&&this.setStatus(e),this}setName(t){this.description=t}isSuccess(){return"ok"===this.status}finish(t){if(c.X&&this.transaction&&this.transaction.spanId!==this.spanId){const{logMessage:t}=this.transaction.metadata.spanMetadata[this.spanId];t&&i.kg.log(t.replace("Starting","Finishing"))}this.endTimestamp="number"===typeof t?t:(0,s.ph)()}toTraceparent(){return(0,o.$p)(this.traceId,this.spanId,this.sampled)}toContext(){return(0,a.Jr)({data:this.data,description:this.description,endTimestamp:this.endTimestamp,op:this.op,parentSpanId:this.parentSpanId,sampled:this.sampled,spanId:this.spanId,startTimestamp:this.startTimestamp,status:this.status,tags:this.tags,traceId:this.traceId})}updateWithContext(t){return this.data=t.data||{},this.description=t.description,this.endTimestamp=t.endTimestamp,this.op=t.op,this.parentSpanId=t.parentSpanId,this.sampled=t.sampled,this.spanId=t.spanId||this.spanId,this.startTimestamp=t.startTimestamp||this.startTimestamp,this.status=t.status,this.tags=t.tags||{},this.traceId=t.traceId||this.traceId,this}getTraceContext(){return(0,a.Jr)({data:Object.keys(this.data).length>0?this.data:void 0,description:this.description,op:this.op,parent_span_id:this.parentSpanId,span_id:this.spanId,status:this.status,tags:Object.keys(this.tags).length>0?this.tags:void 0,trace_id:this.traceId,origin:this.origin})}toJSON(){return(0,a.Jr)({data:Object.keys(this.data).length>0?this.data:void 0,description:this.description,op:this.op,parent_span_id:this.parentSpanId,span_id:this.spanId,start_timestamp:this.startTimestamp,status:this.status,tags:Object.keys(this.tags).length>0?this.tags:void 0,timestamp:this.endTimestamp,trace_id:this.traceId,origin:this.origin})}}},8069:(t,e,n)=>{n.d(e,{Y:()=>l});var r=n(535),s=n(2343),i=n(1703),o=n(5659),a=n(454),c=n(8903);class l extends c.Dr{constructor(t,e){super(t),delete this.description,this._measurements={},this._contexts={},this._hub=e||(0,o.Gd)(),this._name=t.name||"",this.metadata={source:"custom",...t.metadata,spanMetadata:{}},this._trimEnd=t.trimEnd,this.transaction=this;const n=this.metadata.dynamicSamplingContext;n&&(this._frozenDynamicSamplingContext={...n})}get name(){return this._name}set name(t){this.setName(t)}setName(t,e="custom"){this._name=t,this.metadata.source=e}initSpanRecorder(t=1e3){this.spanRecorder||(this.spanRecorder=new c.gB(t)),this.spanRecorder.add(this)}setContext(t,e){null===e?delete this._contexts[t]:this._contexts[t]=e}setMeasurement(t,e,n=""){this._measurements[t]={value:e,unit:n}}setMetadata(t){this.metadata={...this.metadata,...t}}finish(t){const e=this._finishTransaction(t);if(e)return this._hub.captureEvent(e)}toContext(){const t=super.toContext();return(0,r.Jr)({...t,name:this.name,trimEnd:this._trimEnd})}updateWithContext(t){return super.updateWithContext(t),this.name=t.name||"",this._trimEnd=t.trimEnd,this}getDynamicSamplingContext(){if(this._frozenDynamicSamplingContext)return this._frozenDynamicSamplingContext;const t=this._hub||(0,o.Gd)(),e=t.getClient();if(!e)return{};const n=t.getScope(),r=(0,a._)(this.traceId,e,n),s=this.metadata.sampleRate;void 0!==s&&(r.sample_rate=`${s}`);const i=this.metadata.source;return i&&"url"!==i&&(r.transaction=this.name),void 0!==this.sampled&&(r.sampled=String(this.sampled)),r}setHub(t){this._hub=t}_finishTransaction(t){if(void 0!==this.endTimestamp)return;this.name||(i.X&&s.kg.warn("Transaction has no name, falling back to `<unlabeled transaction>`."),this.name="<unlabeled transaction>"),super.finish(t);const e=this._hub.getClient();if(e&&e.emit&&e.emit("finishTransaction",this),!0!==this.sampled)return i.X&&s.kg.log("[Tracing] Discarding transaction because its trace was not chosen to be sampled."),void(e&&e.recordDroppedEvent("sample_rate","transaction"));const n=this.spanRecorder?this.spanRecorder.spans.filter((t=>t!==this&&t.endTimestamp)):[];this._trimEnd&&n.length>0&&(this.endTimestamp=n.reduce(((t,e)=>t.endTimestamp&&e.endTimestamp?t.endTimestamp>e.endTimestamp?t:e:t)).endTimestamp);const r=this.metadata,o={contexts:{...this._contexts,trace:this.getTraceContext()},spans:n,start_timestamp:this.startTimestamp,tags:this.tags,timestamp:this.endTimestamp,transaction:this.name,type:"transaction",sdkProcessingMetadata:{...r,dynamicSamplingContext:this.getDynamicSamplingContext()},...r.source&&{transaction_info:{source:r.source}}};return Object.keys(this._measurements).length>0&&(i.X&&s.kg.log("[Measurements] Adding measurements to transaction",JSON.stringify(this._measurements,void 0,2)),o.measurements=this._measurements),i.X&&s.kg.log(`[Tracing] Finishing ${this.op} transaction: ${this.name}.`),o}}},9791:(t,e,n)=>{n.d(e,{x1:()=>s});var r=n(5659);function s(t){return(t||(0,r.Gd)()).getScope().getTransaction()}},7522:(t,e,n)=>{n.d(e,{z:()=>s});var r=n(4487);function s(t){if("boolean"===typeof __SENTRY_TRACING__&&!__SENTRY_TRACING__)return!1;const e=(0,r.s3)(),n=t||e&&e.getOptions();return!!n&&(n.enableTracing||"tracesSampleRate"in n||"tracesSampler"in n)}},8942:(t,e,n)=>{n.d(e,{R:()=>h,U0:()=>m});var r=n(2844),s=n(1170),i=n(6893),o=n(7321),a=n(1235),c=n(8007),l=n(1131),u=n(1195),d=n(350);function h(t,e,n,h,m){const{normalizeDepth:f=3,normalizeMaxBreadth:g=1e3}=t,y={...e,event_id:e.event_id||n.event_id||(0,r.DM)(),timestamp:e.timestamp||(0,s.yW)()},_=n.integrations||t.integrations.map((t=>t.name));!function(t,e){const{environment:n,release:r,dist:s,maxValueLength:i=250}=e;"environment"in t||(t.environment="environment"in e?n:l.J);void 0===t.release&&void 0!==r&&(t.release=r);void 0===t.dist&&void 0!==s&&(t.dist=s);t.message&&(t.message=(0,o.$G)(t.message,i));const a=t.exception&&t.exception.values&&t.exception.values[0];a&&a.value&&(a.value=(0,o.$G)(a.value,i));const c=t.request;c&&c.url&&(c.url=(0,o.$G)(c.url,i))}(y,t),function(t,e){e.length>0&&(t.sdk=t.sdk||{},t.sdk.integrations=[...t.sdk.integrations||[],...e])}(y,_),void 0===e.type&&function(t,e){const n=a.n2._sentryDebugIds;if(!n)return;let r;const s=p.get(e);s?r=s:(r=new Map,p.set(e,r));const i=Object.keys(n).reduce(((t,s)=>{let i;const o=r.get(s);o?i=o:(i=e(s),r.set(s,i));for(let e=i.length-1;e>=0;e--){const r=i[e];if(r.filename){t[r.filename]=n[s];break}}return t}),{});try{t.exception.values.forEach((t=>{t.stacktrace.frames.forEach((t=>{t.filename&&(t.debug_id=i[t.filename])}))}))}catch(o){}}(y,t.stackParser);let v=h;n.captureContext&&(v=d.s.clone(v).update(n.captureContext)),n.mechanism&&(0,r.EG)(y,n.mechanism);let S=(0,i.WD)(y);const k=m&&m.getEventProcessors?m.getEventProcessors():[];if(v){if(v.getAttachments){const t=[...n.attachments||[],...v.getAttachments()];t.length&&(n.attachments=t)}S=v.applyToEvent(y,n,k)}else S=(0,u.RP)([...k,...(0,u.fH)()],y,n);return S.then((t=>(t&&function(t){const e={};try{t.exception.values.forEach((t=>{t.stacktrace.frames.forEach((t=>{t.debug_id&&(t.abs_path?e[t.abs_path]=t.debug_id:t.filename&&(e[t.filename]=t.debug_id),delete t.debug_id)}))}))}catch(r){}if(0===Object.keys(e).length)return;t.debug_meta=t.debug_meta||{},t.debug_meta.images=t.debug_meta.images||[];const n=t.debug_meta.images;Object.keys(e).forEach((t=>{n.push({type:"sourcemap",code_file:t,debug_id:e[t]})}))}(t),"number"===typeof f&&f>0?function(t,e,n){if(!t)return null;const r={...t,...t.breadcrumbs&&{breadcrumbs:t.breadcrumbs.map((t=>({...t,...t.data&&{data:(0,c.Fv)(t.data,e,n)}})))},...t.user&&{user:(0,c.Fv)(t.user,e,n)},...t.contexts&&{contexts:(0,c.Fv)(t.contexts,e,n)},...t.extra&&{extra:(0,c.Fv)(t.extra,e,n)}};t.contexts&&t.contexts.trace&&r.contexts&&(r.contexts.trace=t.contexts.trace,t.contexts.trace.data&&(r.contexts.trace.data=(0,c.Fv)(t.contexts.trace.data,e,n)));t.spans&&(r.spans=t.spans.map((t=>(t.data&&(t.data=(0,c.Fv)(t.data,e,n)),t))));return r}(t,f,g):t)))}const p=new WeakMap;function m(t){if(t)return function(t){return t instanceof d.s||"function"===typeof t}(t)||function(t){return Object.keys(t).some((t=>f.includes(t)))}(t)?{captureContext:t}:t}const f=["user","level","extra","contexts","tags","fingerprint","requestSession","propagationContext"]},105:(t,e,n)=>{n.d(e,{J:()=>r});const r="7.86.0"},6869:(t,e,n)=>{n.d(e,{U:()=>hr});var r=n(5659),s=n(4487);function i(t,e){const n=e.getClient(),r=n&&n.getDsn(),s=n&&n.getOptions().tunnel;return function(t,e){return!!e&&t.includes(e.host)}(t,r)||function(t,e){if(!e)return!1;return o(t)===o(e)}(t,s)}function o(t){return"/"===t[t.length-1]?t.slice(0,-1):t}var a=n(7893),c=n(8942),l=n(1235),u=n(8007),d=n(535),h=n(8464),p=n(1170),m=n(2343),f=n(2844),g=n(5322),y=n(7321),_=n(1394),v=n(5316),S=n(734),k=n(8725),b=n(228),w=n(1422);function E(){return"undefined"!==typeof window&&(!(0,w.KV)()||void 0!==l.n2.process&&"renderer"===l.n2.process.type)}var x=n(5363);const T=l.n2,I="sentryReplaySession",C="replay_event",R="Unable to send Replay",M=15e4,O=5e3,D=2e7,A=36e5;var N;function L(t){const e=null===t||void 0===t?void 0:t.host;return Boolean((null===e||void 0===e?void 0:e.shadowRoot)===t)}function $(t){return"[object ShadowRoot]"===Object.prototype.toString.call(t)}function P(t){try{const n=t.rules||t.cssRules;return n?((e=Array.from(n,F).join("")).includes(" background-clip: text;")&&!e.includes(" -webkit-background-clip: text;")&&(e=e.replace(" background-clip: text;"," -webkit-background-clip: text; background-clip: text;")),e):null}catch(n){return null}var e}function F(t){let e;if(function(t){return"styleSheet"in t}(t))try{e=P(t.styleSheet)||function(t){const{cssText:e}=t;if(e.split('"').length<3)return e;const n=["@import",`url(${JSON.stringify(t.href)})`];return""===t.layerName?n.push("layer"):t.layerName&&n.push(`layer(${t.layerName})`),t.supportsText&&n.push(`supports(${t.supportsText})`),t.media.length&&n.push(t.media.mediaText),n.join(" ")+";"}(t)}catch(n){}else if(function(t){return"selectorText"in t}(t)&&t.selectorText.includes(":"))return function(t){const e=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return t.replace(e,"$1\\$2")}(t.cssText);return e||t.cssText}!function(t){t[t.Document=0]="Document",t[t.DocumentType=1]="DocumentType",t[t.Element=2]="Element",t[t.Text=3]="Text",t[t.CDATA=4]="CDATA",t[t.Comment=5]="Comment"}(N||(N={}));class j{constructor(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}getId(t){var e;if(!t)return-1;const n=null===(e=this.getMeta(t))||void 0===e?void 0:e.id;return null!==n&&void 0!==n?n:-1}getNode(t){return this.idNodeMap.get(t)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(t){return this.nodeMetaMap.get(t)||null}removeNodeFromMap(t){const e=this.getId(t);this.idNodeMap.delete(e),t.childNodes&&t.childNodes.forEach((t=>this.removeNodeFromMap(t)))}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,e){const n=e.id;this.idNodeMap.set(n,t),this.nodeMetaMap.set(t,e)}replace(t,e){const n=this.getNode(t);if(n){const t=this.nodeMetaMap.get(n);t&&this.nodeMetaMap.set(e,t)}this.idNodeMap.set(t,e)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function U({maskInputOptions:t,tagName:e,type:n}){return"OPTION"===e&&(e="SELECT"),Boolean(t[e.toLowerCase()]||n&&t[n]||"password"===n||"INPUT"===e&&!n&&t.text)}function B({isMasked:t,element:e,value:n,maskInputFn:r}){let s=n||"";return t?(r&&(s=r(s,e)),"*".repeat(s.length)):s}function H(t){return t.toLowerCase()}function z(t){return t.toUpperCase()}const W="__rrweb_original__";function q(t){const e=t.type;return t.hasAttribute("data-rr-is-password")?"password":e?H(e):null}function X(t,e,n){return"INPUT"!==e||"radio"!==n&&"checkbox"!==n?t.value:t.getAttribute("value")||""}let G=1;const K=new RegExp("[^a-z0-9-_:]"),J=-2;function Y(){return G++}let V,Q;const Z=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,tt=/^(?:[a-z+]+:)?\/\//i,et=/^www\..*/i,nt=/^(data:)([^,]*),(.*)/i;function rt(t,e){return(t||"").replace(Z,((t,n,r,s,i,o)=>{const a=r||i||o,c=n||s||"";if(!a)return t;if(tt.test(a)||et.test(a))return`url(${c}${a}${c})`;if(nt.test(a))return`url(${c}${a}${c})`;if("/"===a[0])return`url(${c}${function(t){let e="";return e=t.indexOf("//")>-1?t.split("/").slice(0,3).join("/"):t.split("/")[0],e=e.split("?")[0],e}(e)+a}${c})`;const l=e.split("/"),u=a.split("/");l.pop();for(const e of u)"."!==e&&(".."===e?l.pop():l.push(e));return`url(${c}${l.join("/")}${c})`}))}const st=/^[^ \t\n\r\u000c]+/,it=/^[, \t\n\r\u000c]+/;function ot(t,e){if(!e||""===e.trim())return e;const n=t.createElement("a");return n.href=e,n.href}function at(t){return Boolean("svg"===t.tagName||t.ownerSVGElement)}function ct(){const t=document.createElement("a");return t.href="",t.href}function lt(t,e,n,r,s,i){return r?"src"===n||"href"===n&&("use"!==e||"#"!==r[0])||"xlink:href"===n&&"#"!==r[0]?ot(t,r):"background"!==n||"table"!==e&&"td"!==e&&"th"!==e?"srcset"===n?function(t,e){if(""===e.trim())return e;let n=0;function r(t){let r;const s=t.exec(e.substring(n));return s?(r=s[0],n+=r.length,r):""}const s=[];for(;r(it),!(n>=e.length);){let i=r(st);if(","===i.slice(-1))i=ot(t,i.substring(0,i.length-1)),s.push(i);else{let r="";i=ot(t,i);let o=!1;for(;;){const t=e.charAt(n);if(""===t){s.push((i+r).trim());break}if(o)")"===t&&(o=!1);else{if(","===t){n+=1,s.push((i+r).trim());break}"("===t&&(o=!0)}r+=t,n+=1}}}return s.join(", ")}(t,r):"style"===n?rt(r,ct()):"object"===e&&"data"===n?ot(t,r):"function"===typeof i?i(n,r,s):r:ot(t,r):r}function ut(t,e,n){return("video"===t||"audio"===t)&&"autoplay"===e}function dt(t,e,n=1/0,r=0){return t?t.nodeType!==t.ELEMENT_NODE||r>n?-1:e(t)?r:dt(t.parentNode,e,n,r+1):-1}function ht(t,e){return n=>{const r=n;if(null===r)return!1;if(t)if("string"===typeof t){if(r.matches(`.${t}`))return!0}else if(function(t,e){for(let n=t.classList.length;n--;){const r=t.classList[n];if(e.test(r))return!0}return!1}(r,t))return!0;return!(!e||!r.matches(e))}}function pt(t,e,n,r,s,i){try{const o=t.nodeType===t.ELEMENT_NODE?t:t.parentElement;if(null===o)return!1;let a=-1,c=-1;if(i){if(c=dt(o,ht(r,s)),c<0)return!0;a=dt(o,ht(e,n),c>=0?c:1/0)}else{if(a=dt(o,ht(e,n)),a<0)return!1;c=dt(o,ht(r,s),a>=0?a:1/0)}return a>=0?!(c>=0)||a<=c:!(c>=0)&&!!i}catch(o){}return!!i}function mt(t,e){const{doc:n,mirror:r,blockClass:s,blockSelector:i,unblockSelector:o,maskAllText:a,maskAttributeFn:c,maskTextClass:l,unmaskTextClass:u,maskTextSelector:d,unmaskTextSelector:h,inlineStylesheet:p,maskInputOptions:m={},maskTextFn:f,maskInputFn:g,dataURLOptions:y={},inlineImages:_,recordCanvas:v,keepIframeSrcFn:S,newlyAddedElement:k=!1}=e,b=function(t,e){if(!e.hasNode(t))return;const n=e.getId(t);return 1===n?void 0:n}(n,r);switch(t.nodeType){case t.DOCUMENT_NODE:return"CSS1Compat"!==t.compatMode?{type:N.Document,childNodes:[],compatMode:t.compatMode}:{type:N.Document,childNodes:[]};case t.DOCUMENT_TYPE_NODE:return{type:N.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:b};case t.ELEMENT_NODE:return function(t,e){const{doc:n,blockClass:r,blockSelector:s,unblockSelector:i,inlineStylesheet:o,maskInputOptions:a={},maskAttributeFn:c,maskInputFn:l,dataURLOptions:u={},inlineImages:d,recordCanvas:h,keepIframeSrcFn:p,newlyAddedElement:m=!1,rootId:f,maskAllText:g,maskTextClass:y,unmaskTextClass:_,maskTextSelector:v,unmaskTextSelector:S}=e,k=function(t,e,n,r){try{if(r&&t.matches(r))return!1;if("string"===typeof e){if(t.classList.contains(e))return!0}else for(let n=t.classList.length;n--;){const r=t.classList[n];if(e.test(r))return!0}if(n)return t.matches(n)}catch(s){}return!1}(t,r,s,i),b=function(t){if(t instanceof HTMLFormElement)return"form";const e=H(t.tagName);return K.test(e)?"div":e}(t);let w={};const E=t.attributes.length;for(let I=0;I<E;I++){const e=t.attributes[I];ut(b,e.name,e.value)||(w[e.name]=lt(n,b,H(e.name),e.value,t,c))}if("link"===b&&o){const e=Array.from(n.styleSheets).find((e=>e.href===t.href));let r=null;e&&(r=P(e)),r&&(delete w.rel,delete w.href,w._cssText=rt(r,e.href))}if("style"===b&&t.sheet&&!(t.innerText||t.textContent||"").trim().length){const e=P(t.sheet);e&&(w._cssText=rt(e,ct()))}if("input"===b||"textarea"===b||"select"===b||"option"===b){const e=t,n=q(e),r=X(e,z(b),n),s=e.checked;if("submit"!==n&&"button"!==n&&r){const t=pt(e,y,v,_,S,U({type:n,tagName:z(b),maskInputOptions:a}));w.value=B({isMasked:t,element:e,value:r,maskInputFn:l})}s&&(w.checked=s)}"option"===b&&(t.selected&&!a.select?w.selected=!0:delete w.selected);if("canvas"===b&&h)if("2d"===t.__context)(function(t){const e=t.getContext("2d");if(!e)return!0;for(let n=0;n<t.width;n+=50)for(let r=0;r<t.height;r+=50){const s=e.getImageData,i=W in s?s[W]:s;if(new Uint32Array(i.call(e,n,r,Math.min(50,t.width-n),Math.min(50,t.height-r)).data.buffer).some((t=>0!==t)))return!1}return!0})(t)||(w.rr_dataURL=t.toDataURL(u.type,u.quality));else if(!("__context"in t)){const e=t.toDataURL(u.type,u.quality),n=document.createElement("canvas");n.width=t.width,n.height=t.height;e!==n.toDataURL(u.type,u.quality)&&(w.rr_dataURL=e)}if("img"===b&&d){V||(V=n.createElement("canvas"),Q=V.getContext("2d"));const e=t,r=e.crossOrigin;e.crossOrigin="anonymous";const s=()=>{e.removeEventListener("load",s);try{V.width=e.naturalWidth,V.height=e.naturalHeight,Q.drawImage(e,0,0),w.rr_dataURL=V.toDataURL(u.type,u.quality)}catch(t){console.warn(`Cannot inline img src=${e.currentSrc}! Error: ${t}`)}r?w.crossOrigin=r:e.removeAttribute("crossorigin")};e.complete&&0!==e.naturalWidth?s():e.addEventListener("load",s)}"audio"!==b&&"video"!==b||(w.rr_mediaState=t.paused?"paused":"played",w.rr_mediaCurrentTime=t.currentTime);m||(t.scrollLeft&&(w.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(w.rr_scrollTop=t.scrollTop));if(k){const{width:e,height:n}=t.getBoundingClientRect();w={class:w.class,rr_width:`${e}px`,rr_height:`${n}px`}}"iframe"!==b||p(w.src)||(t.contentDocument||(w.rr_src=w.src),delete w.src);let x;try{customElements.get(b)&&(x=!0)}catch(T){}return{type:N.Element,tagName:b,attributes:w,childNodes:[],isSVG:at(t)||void 0,needBlock:k,rootId:f,isCustom:x}}(t,{doc:n,blockClass:s,blockSelector:i,unblockSelector:o,inlineStylesheet:p,maskAttributeFn:c,maskInputOptions:m,maskInputFn:g,dataURLOptions:y,inlineImages:_,recordCanvas:v,keepIframeSrcFn:S,newlyAddedElement:k,rootId:b,maskAllText:a,maskTextClass:l,unmaskTextClass:u,maskTextSelector:d,unmaskTextSelector:h});case t.TEXT_NODE:return function(t,e){var n;const{maskAllText:r,maskTextClass:s,unmaskTextClass:i,maskTextSelector:o,unmaskTextSelector:a,maskTextFn:c,maskInputOptions:l,maskInputFn:u,rootId:d}=e,h=t.parentNode&&t.parentNode.tagName;let p=t.textContent;const m="STYLE"===h||void 0,f="SCRIPT"===h||void 0,g="TEXTAREA"===h||void 0;if(m&&p){try{t.nextSibling||t.previousSibling||(null===(n=t.parentNode.sheet)||void 0===n?void 0:n.cssRules)&&(p=P(t.parentNode.sheet))}catch(_){console.warn(`Cannot get CSS styles from text's parentNode. Error: ${_}`,t)}p=rt(p,ct())}f&&(p="SCRIPT_PLACEHOLDER");const y=pt(t,s,o,i,a,r);m||f||g||!p||!y||(p=c?c(p):p.replace(/[\S]/g,"*"));g&&p&&(l.textarea||y)&&(p=u?u(p,t.parentNode):p.replace(/[\S]/g,"*"));if("OPTION"===h&&p){p=B({isMasked:pt(t,s,o,i,a,U({type:null,tagName:h,maskInputOptions:l})),element:t,value:p,maskInputFn:u})}return{type:N.Text,textContent:p||"",isStyle:m,rootId:d}}(t,{maskAllText:a,maskTextClass:l,unmaskTextClass:u,maskTextSelector:d,unmaskTextSelector:h,maskTextFn:f,maskInputOptions:m,maskInputFn:g,rootId:b});case t.CDATA_SECTION_NODE:return{type:N.CDATA,textContent:"",rootId:b};case t.COMMENT_NODE:return{type:N.Comment,textContent:t.textContent||"",rootId:b};default:return!1}}function ft(t){return void 0===t||null===t?"":t.toLowerCase()}function gt(t,e){const{doc:n,mirror:r,blockClass:s,blockSelector:i,unblockSelector:o,maskAllText:a,maskTextClass:c,unmaskTextClass:l,maskTextSelector:u,unmaskTextSelector:d,skipChild:h=!1,inlineStylesheet:p=!0,maskInputOptions:m={},maskAttributeFn:f,maskTextFn:g,maskInputFn:y,slimDOMOptions:_,dataURLOptions:v={},inlineImages:S=!1,recordCanvas:k=!1,onSerialize:b,onIframeLoad:w,iframeLoadTimeout:E=5e3,onStylesheetLoad:x,stylesheetLoadTimeout:T=5e3,keepIframeSrcFn:I=(()=>!1),newlyAddedElement:C=!1}=e;let{preserveWhiteSpace:R=!0}=e;const M=mt(t,{doc:n,mirror:r,blockClass:s,blockSelector:i,maskAllText:a,unblockSelector:o,maskTextClass:c,unmaskTextClass:l,maskTextSelector:u,unmaskTextSelector:d,inlineStylesheet:p,maskInputOptions:m,maskAttributeFn:f,maskTextFn:g,maskInputFn:y,dataURLOptions:v,inlineImages:S,recordCanvas:k,keepIframeSrcFn:I,newlyAddedElement:C});if(!M)return console.warn(t,"not serialized"),null;let O;O=r.hasNode(t)?r.getId(t):!function(t,e){if(e.comment&&t.type===N.Comment)return!0;if(t.type===N.Element){if(e.script&&("script"===t.tagName||"link"===t.tagName&&("preload"===t.attributes.rel||"modulepreload"===t.attributes.rel)&&"script"===t.attributes.as||"link"===t.tagName&&"prefetch"===t.attributes.rel&&"string"===typeof t.attributes.href&&t.attributes.href.endsWith(".js")))return!0;if(e.headFavicon&&("link"===t.tagName&&"shortcut icon"===t.attributes.rel||"meta"===t.tagName&&(ft(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===ft(t.attributes.name)||"icon"===ft(t.attributes.rel)||"apple-touch-icon"===ft(t.attributes.rel)||"shortcut icon"===ft(t.attributes.rel))))return!0;if("meta"===t.tagName){if(e.headMetaDescKeywords&&ft(t.attributes.name).match(/^description|keywords$/))return!0;if(e.headMetaSocial&&(ft(t.attributes.property).match(/^(og|twitter|fb):/)||ft(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===ft(t.attributes.name)))return!0;if(e.headMetaRobots&&("robots"===ft(t.attributes.name)||"googlebot"===ft(t.attributes.name)||"bingbot"===ft(t.attributes.name)))return!0;if(e.headMetaHttpEquiv&&void 0!==t.attributes["http-equiv"])return!0;if(e.headMetaAuthorship&&("author"===ft(t.attributes.name)||"generator"===ft(t.attributes.name)||"framework"===ft(t.attributes.name)||"publisher"===ft(t.attributes.name)||"progid"===ft(t.attributes.name)||ft(t.attributes.property).match(/^article:/)||ft(t.attributes.property).match(/^product:/)))return!0;if(e.headMetaVerification&&("google-site-verification"===ft(t.attributes.name)||"yandex-verification"===ft(t.attributes.name)||"csrf-token"===ft(t.attributes.name)||"p:domain_verify"===ft(t.attributes.name)||"verify-v1"===ft(t.attributes.name)||"verification"===ft(t.attributes.name)||"shopify-checkout-api-token"===ft(t.attributes.name)))return!0}}return!1}(M,_)&&(R||M.type!==N.Text||M.isStyle||M.textContent.replace(/^\s+|\s+$/gm,"").length)?Y():J;const D=Object.assign(M,{id:O});if(r.add(t,D),O===J)return null;b&&b(t);let A=!h;if(D.type===N.Element){A=A&&!D.needBlock,delete D.needBlock;const e=t.shadowRoot;e&&$(e)&&(D.isShadowHost=!0)}if((D.type===N.Document||D.type===N.Element)&&A){_.headWhitespace&&D.type===N.Element&&"head"===D.tagName&&(R=!1);const e={doc:n,mirror:r,blockClass:s,blockSelector:i,maskAllText:a,unblockSelector:o,maskTextClass:c,unmaskTextClass:l,maskTextSelector:u,unmaskTextSelector:d,skipChild:h,inlineStylesheet:p,maskInputOptions:m,maskAttributeFn:f,maskTextFn:g,maskInputFn:y,slimDOMOptions:_,dataURLOptions:v,inlineImages:S,recordCanvas:k,preserveWhiteSpace:R,onSerialize:b,onIframeLoad:w,iframeLoadTimeout:E,onStylesheetLoad:x,stylesheetLoadTimeout:T,keepIframeSrcFn:I};for(const n of Array.from(t.childNodes)){const t=gt(n,e);t&&D.childNodes.push(t)}if(function(t){return t.nodeType===t.ELEMENT_NODE}(t)&&t.shadowRoot)for(const n of Array.from(t.shadowRoot.childNodes)){const r=gt(n,e);r&&($(t.shadowRoot)&&(r.isShadow=!0),D.childNodes.push(r))}}return t.parentNode&&L(t.parentNode)&&$(t.parentNode)&&(D.isShadow=!0),D.type===N.Element&&"iframe"===D.tagName&&function(t,e,n){const r=t.contentWindow;if(!r)return;let s,i=!1;try{s=r.document.readyState}catch(a){return}if("complete"!==s){const r=setTimeout((()=>{i||(e(),i=!0)}),n);return void t.addEventListener("load",(()=>{clearTimeout(r),i=!0,e()}))}const o="about:blank";if(r.location.href!==o||t.src===o||""===t.src)return setTimeout(e,0),t.addEventListener("load",e);t.addEventListener("load",e)}(t,(()=>{const e=t.contentDocument;if(e&&w){const n=gt(e,{doc:e,mirror:r,blockClass:s,blockSelector:i,unblockSelector:o,maskAllText:a,maskTextClass:c,unmaskTextClass:l,maskTextSelector:u,unmaskTextSelector:d,skipChild:!1,inlineStylesheet:p,maskInputOptions:m,maskAttributeFn:f,maskTextFn:g,maskInputFn:y,slimDOMOptions:_,dataURLOptions:v,inlineImages:S,recordCanvas:k,preserveWhiteSpace:R,onSerialize:b,onIframeLoad:w,iframeLoadTimeout:E,onStylesheetLoad:x,stylesheetLoadTimeout:T,keepIframeSrcFn:I});n&&w(t,n)}}),E),D.type===N.Element&&"link"===D.tagName&&"stylesheet"===D.attributes.rel&&function(t,e,n){let r,s=!1;try{r=t.sheet}catch(o){return}if(r)return;const i=setTimeout((()=>{s||(e(),s=!0)}),n);t.addEventListener("load",(()=>{clearTimeout(i),s=!0,e()}))}(t,(()=>{if(x){const e=gt(t,{doc:n,mirror:r,blockClass:s,blockSelector:i,unblockSelector:o,maskAllText:a,maskTextClass:c,unmaskTextClass:l,maskTextSelector:u,unmaskTextSelector:d,skipChild:!1,inlineStylesheet:p,maskInputOptions:m,maskAttributeFn:f,maskTextFn:g,maskInputFn:y,slimDOMOptions:_,dataURLOptions:v,inlineImages:S,recordCanvas:k,preserveWhiteSpace:R,onSerialize:b,onIframeLoad:w,iframeLoadTimeout:E,onStylesheetLoad:x,stylesheetLoadTimeout:T,keepIframeSrcFn:I});e&&x(t,e)}}),T),D}function yt(t,e,n=document){const r={capture:!0,passive:!0};return n.addEventListener(t,e,r),()=>n.removeEventListener(t,e,r)}const _t="Please stop import mirror directly. Instead of that,\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\r\nor you can use record.mirror to access the mirror instance during recording.";let vt={map:{},getId:()=>(console.error(_t),-1),getNode:()=>(console.error(_t),null),removeNodeFromMap(){console.error(_t)},has:()=>(console.error(_t),!1),reset(){console.error(_t)}};function St(t,e,n={}){let r=null,s=0;return function(...i){const o=Date.now();s||!1!==n.leading||(s=o);const a=e-(o-s),c=this;a<=0||a>e?(r&&(clearTimeout(r),r=null),s=o,t.apply(c,i)):r||!1===n.trailing||(r=setTimeout((()=>{s=!1===n.leading?0:Date.now(),r=null,t.apply(c,i)}),a))}}function kt(t,e,n,r,s=window){const i=s.Object.getOwnPropertyDescriptor(t,e);return s.Object.defineProperty(t,e,r?n:{set(t){setTimeout((()=>{n.set.call(this,t)}),0),i&&i.set&&i.set.call(this,t)}}),()=>kt(t,e,i||{},!0)}function bt(t,e,n){try{if(!(e in t))return()=>{};const r=t[e],s=n(r);return"function"===typeof s&&(s.prototype=s.prototype||{},Object.defineProperties(s,{__rrweb_original__:{enumerable:!1,value:r}})),t[e]=s,()=>{t[e]=r}}catch(r){return()=>{}}}"undefined"!==typeof window&&window.Proxy&&window.Reflect&&(vt=new Proxy(vt,{get:(t,e,n)=>("map"===e&&console.error(_t),Reflect.get(t,e,n))}));let wt=Date.now;function Et(t){var e,n,r,s,i,o;const a=t.document;return{left:a.scrollingElement?a.scrollingElement.scrollLeft:void 0!==t.pageXOffset?t.pageXOffset:(null===a||void 0===a?void 0:a.documentElement.scrollLeft)||(null===(n=null===(e=null===a||void 0===a?void 0:a.body)||void 0===e?void 0:e.parentElement)||void 0===n?void 0:n.scrollLeft)||(null===(r=null===a||void 0===a?void 0:a.body)||void 0===r?void 0:r.scrollLeft)||0,top:a.scrollingElement?a.scrollingElement.scrollTop:void 0!==t.pageYOffset?t.pageYOffset:(null===a||void 0===a?void 0:a.documentElement.scrollTop)||(null===(i=null===(s=null===a||void 0===a?void 0:a.body)||void 0===s?void 0:s.parentElement)||void 0===i?void 0:i.scrollTop)||(null===(o=null===a||void 0===a?void 0:a.body)||void 0===o?void 0:o.scrollTop)||0}}function xt(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Tt(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function It(t,e,n,r,s){if(!t)return!1;const i=t.nodeType===t.ELEMENT_NODE?t:t.parentElement;if(!i)return!1;const o=ht(e,n);if(!s){const t=r&&i.matches(r);return o(i)&&!t}const a=dt(i,o);let c=-1;return!(a<0)&&(r&&(c=dt(i,ht(null,r))),a>-1&&c<0||a<c)}function Ct(t,e){return e.getId(t)===J}function Rt(t,e){if(L(t))return!1;const n=e.getId(t);return!e.has(n)||(!t.parentNode||t.parentNode.nodeType!==t.DOCUMENT_NODE)&&(!t.parentNode||Rt(t.parentNode,e))}function Mt(t){return Boolean(t.changedTouches)}function Ot(t,e){return Boolean("IFRAME"===t.nodeName&&e.getMeta(t))}function Dt(t,e){return Boolean("LINK"===t.nodeName&&t.nodeType===t.ELEMENT_NODE&&t.getAttribute&&"stylesheet"===t.getAttribute("rel")&&e.getMeta(t))}function At(t){return Boolean(null===t||void 0===t?void 0:t.shadowRoot)}/[1-9][0-9]{12}/.test(Date.now().toString())||(wt=()=>(new Date).getTime());class Nt{constructor(){this.id=1,this.styleIDMap=new WeakMap,this.idStyleMap=new Map}getId(t){var e;return null!==(e=this.styleIDMap.get(t))&&void 0!==e?e:-1}has(t){return this.styleIDMap.has(t)}add(t,e){if(this.has(t))return this.getId(t);let n;return n=void 0===e?this.id++:e,this.styleIDMap.set(t,n),this.idStyleMap.set(n,t),n}getStyle(t){return this.idStyleMap.get(t)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}function Lt(t){var e,n;let r=null;return(null===(n=null===(e=t.getRootNode)||void 0===e?void 0:e.call(t))||void 0===n?void 0:n.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&t.getRootNode().host&&(r=t.getRootNode().host),r}function $t(t){const e=t.ownerDocument;if(!e)return!1;const n=function(t){let e,n=t;for(;e=Lt(n);)n=e;return n}(t);return e.contains(n)}function Pt(t){const e=t.ownerDocument;return!!e&&(e.contains(t)||$t(t))}var Ft=(t=>(t[t.DomContentLoaded=0]="DomContentLoaded",t[t.Load=1]="Load",t[t.FullSnapshot=2]="FullSnapshot",t[t.IncrementalSnapshot=3]="IncrementalSnapshot",t[t.Meta=4]="Meta",t[t.Custom=5]="Custom",t[t.Plugin=6]="Plugin",t))(Ft||{}),jt=(t=>(t[t.Mutation=0]="Mutation",t[t.MouseMove=1]="MouseMove",t[t.MouseInteraction=2]="MouseInteraction",t[t.Scroll=3]="Scroll",t[t.ViewportResize=4]="ViewportResize",t[t.Input=5]="Input",t[t.TouchMove=6]="TouchMove",t[t.MediaInteraction=7]="MediaInteraction",t[t.StyleSheetRule=8]="StyleSheetRule",t[t.CanvasMutation=9]="CanvasMutation",t[t.Font=10]="Font",t[t.Log=11]="Log",t[t.Drag=12]="Drag",t[t.StyleDeclaration=13]="StyleDeclaration",t[t.Selection=14]="Selection",t[t.AdoptedStyleSheet=15]="AdoptedStyleSheet",t[t.CustomElement=16]="CustomElement",t))(jt||{}),Ut=(t=>(t[t.MouseUp=0]="MouseUp",t[t.MouseDown=1]="MouseDown",t[t.Click=2]="Click",t[t.ContextMenu=3]="ContextMenu",t[t.DblClick=4]="DblClick",t[t.Focus=5]="Focus",t[t.Blur=6]="Blur",t[t.TouchStart=7]="TouchStart",t[t.TouchMove_Departed=8]="TouchMove_Departed",t[t.TouchEnd=9]="TouchEnd",t[t.TouchCancel=10]="TouchCancel",t))(Ut||{}),Bt=(t=>(t[t.Mouse=0]="Mouse",t[t.Pen=1]="Pen",t[t.Touch=2]="Touch",t))(Bt||{});function Ht(t){return"__ln"in t}class zt{constructor(){this.length=0,this.head=null,this.tail=null}get(t){if(t>=this.length)throw new Error("Position outside of list range");let e=this.head;for(let n=0;n<t;n++)e=(null===e||void 0===e?void 0:e.next)||null;return e}addNode(t){const e={value:t,previous:null,next:null};if(t.__ln=e,t.previousSibling&&Ht(t.previousSibling)){const n=t.previousSibling.__ln.next;e.next=n,e.previous=t.previousSibling.__ln,t.previousSibling.__ln.next=e,n&&(n.previous=e)}else if(t.nextSibling&&Ht(t.nextSibling)&&t.nextSibling.__ln.previous){const n=t.nextSibling.__ln.previous;e.previous=n,e.next=t.nextSibling.__ln,t.nextSibling.__ln.previous=e,n&&(n.next=e)}else this.head&&(this.head.previous=e),e.next=this.head,this.head=e;null===e.next&&(this.tail=e),this.length++}removeNode(t){const e=t.__ln;this.head&&(e.previous?(e.previous.next=e.next,e.next?e.next.previous=e.previous:this.tail=e.previous):(this.head=e.next,this.head?this.head.previous=null:this.tail=null),t.__ln&&delete t.__ln,this.length--)}}const Wt=(t,e)=>`${t}@${e}`;class qt{constructor(){this.frozen=!1,this.locked=!1,this.texts=[],this.attributes=[],this.removes=[],this.mapRemoves=[],this.movedMap={},this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.processMutations=t=>{t.forEach(this.processMutation),this.emit()},this.emit=()=>{if(this.frozen||this.locked)return;const t=[],e=new Set,n=new zt,r=t=>{let e=t,n=J;for(;n===J;)e=e&&e.nextSibling,n=e&&this.mirror.getId(e);return n},s=s=>{if(!s.parentNode||!Pt(s))return;const i=L(s.parentNode)?this.mirror.getId(Lt(s)):this.mirror.getId(s.parentNode),o=r(s);if(-1===i||-1===o)return n.addNode(s);const a=gt(s,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskAllText:this.maskAllText,unblockSelector:this.unblockSelector,maskTextClass:this.maskTextClass,unmaskTextClass:this.unmaskTextClass,maskTextSelector:this.maskTextSelector,unmaskTextSelector:this.unmaskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskAttributeFn:this.maskAttributeFn,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:t=>{Ot(t,this.mirror)&&this.iframeManager.addIframe(t),Dt(t,this.mirror)&&this.stylesheetManager.trackLinkElement(t),At(s)&&this.shadowDomManager.addShadowRoot(s.shadowRoot,this.doc)},onIframeLoad:(t,e)=>{this.iframeManager.attachIframe(t,e),this.shadowDomManager.observeAttachShadow(t)},onStylesheetLoad:(t,e)=>{this.stylesheetManager.attachLinkElement(t,e)}});a&&(t.push({parentId:i,nextId:o,node:a}),e.add(a.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const a of this.movedSet)Gt(this.removes,a,this.mirror)&&!this.movedSet.has(a.parentNode)||s(a);for(const a of this.addedSet)Jt(this.droppedSet,a)||Gt(this.removes,a,this.mirror)?Jt(this.movedSet,a)?s(a):this.droppedSet.add(a):s(a);let i=null;for(;n.length;){let t=null;if(i){const e=this.mirror.getId(i.value.parentNode),n=r(i.value);-1!==e&&-1!==n&&(t=i)}if(!t){let e=n.tail;for(;e;){const n=e;if(e=e.previous,n){const e=this.mirror.getId(n.value.parentNode);if(-1===r(n.value))continue;if(-1!==e){t=n;break}{const e=n.value;if(e.parentNode&&e.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const r=e.parentNode.host;if(-1!==this.mirror.getId(r)){t=n;break}}}}}}if(!t){for(;n.head;)n.removeNode(n.head.value);break}i=t.previous,n.removeNode(t.value),s(t.value)}const o={texts:this.texts.map((t=>({id:this.mirror.getId(t.node),value:t.value}))).filter((t=>!e.has(t.id))).filter((t=>this.mirror.has(t.id))),attributes:this.attributes.map((t=>{const{attributes:e}=t;if("string"===typeof e.style){const n=JSON.stringify(t.styleDiff),r=JSON.stringify(t._unchangedStyles);n.length<e.style.length&&(n+r).split("var(").length===e.style.split("var(").length&&(e.style=t.styleDiff)}return{id:this.mirror.getId(t.node),attributes:e}})).filter((t=>!e.has(t.id))).filter((t=>this.mirror.has(t.id))),removes:this.removes,adds:t};(o.texts.length||o.attributes.length||o.removes.length||o.adds.length)&&(this.texts=[],this.attributes=[],this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.movedMap={},this.mutationCb(o))},this.processMutation=t=>{if(Ct(t.target,this.mirror))return;let e;try{e=document.implementation.createHTMLDocument()}catch(n){e=this.doc}switch(t.type){case"characterData":{const e=t.target.textContent;It(t.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)||e===t.oldValue||this.texts.push({value:pt(t.target,this.maskTextClass,this.maskTextSelector,this.unmaskTextClass,this.unmaskTextSelector,this.maskAllText)&&e?this.maskTextFn?this.maskTextFn(e):e.replace(/[\S]/g,"*"):e,node:t.target});break}case"attributes":{const n=t.target;let r=t.attributeName,s=t.target.getAttribute(r);if("value"===r){const e=q(n),r=n.tagName;s=X(n,r,e);const i=U({maskInputOptions:this.maskInputOptions,tagName:r,type:e});s=B({isMasked:pt(t.target,this.maskTextClass,this.maskTextSelector,this.unmaskTextClass,this.unmaskTextSelector,i),element:n,value:s,maskInputFn:this.maskInputFn})}if(It(t.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)||s===t.oldValue)return;let i=this.attributes.find((e=>e.node===t.target));if("IFRAME"===n.tagName&&"src"===r&&!this.keepIframeSrcFn(s)){if(n.contentDocument)return;r="rr_src"}if(i||(i={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(i)),"type"===r&&"INPUT"===n.tagName&&"password"===(t.oldValue||"").toLowerCase()&&n.setAttribute("data-rr-is-password","true"),!ut(n.tagName,r)&&(i.attributes[r]=lt(this.doc,H(n.tagName),H(r),s,n,this.maskAttributeFn),"style"===r)){const r=e.createElement("span");t.oldValue&&r.setAttribute("style",t.oldValue);for(const t of Array.from(n.style)){const e=n.style.getPropertyValue(t),s=n.style.getPropertyPriority(t);e!==r.style.getPropertyValue(t)||s!==r.style.getPropertyPriority(t)?i.styleDiff[t]=""===s?e:[e,s]:i._unchangedStyles[t]=[e,s]}for(const t of Array.from(r.style))""===n.style.getPropertyValue(t)&&(i.styleDiff[t]=!1)}break}case"childList":if(It(t.target,this.blockClass,this.blockSelector,this.unblockSelector,!0))return;t.addedNodes.forEach((e=>this.genAdds(e,t.target))),t.removedNodes.forEach((e=>{const n=this.mirror.getId(e),r=L(t.target)?this.mirror.getId(t.target.host):this.mirror.getId(t.target);It(t.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)||Ct(e,this.mirror)||!function(t,e){return-1!==e.getId(t)}(e,this.mirror)||(this.addedSet.has(e)?(Xt(this.addedSet,e),this.droppedSet.add(e)):this.addedSet.has(t.target)&&-1===n||Rt(t.target,this.mirror)||(this.movedSet.has(e)&&this.movedMap[Wt(n,r)]?Xt(this.movedSet,e):this.removes.push({parentId:r,id:n,isShadow:!(!L(t.target)||!$(t.target))||void 0})),this.mapRemoves.push(e))}))}},this.genAdds=(t,e)=>{if(!this.processedNodeManager.inOtherBuffer(t,this)&&!this.addedSet.has(t)&&!this.movedSet.has(t)){if(this.mirror.hasNode(t)){if(Ct(t,this.mirror))return;this.movedSet.add(t);let n=null;e&&this.mirror.hasNode(e)&&(n=this.mirror.getId(e)),n&&-1!==n&&(this.movedMap[Wt(this.mirror.getId(t),n)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);It(t,this.blockClass,this.blockSelector,this.unblockSelector,!1)||(t.childNodes.forEach((t=>this.genAdds(t))),At(t)&&t.shadowRoot.childNodes.forEach((e=>{this.processedNodeManager.add(e,this),this.genAdds(e,t)})))}}}init(t){["mutationCb","blockClass","blockSelector","unblockSelector","maskAllText","maskTextClass","unmaskTextClass","maskTextSelector","unmaskTextSelector","inlineStylesheet","maskInputOptions","maskAttributeFn","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach((e=>{this[e]=t[e]}))}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}}function Xt(t,e){t.delete(e),e.childNodes.forEach((e=>Xt(t,e)))}function Gt(t,e,n){return 0!==t.length&&Kt(t,e,n)}function Kt(t,e,n){const{parentNode:r}=e;if(!r)return!1;const s=n.getId(r);return!!t.some((t=>t.id===s))||Kt(t,r,n)}function Jt(t,e){return 0!==t.size&&Yt(t,e)}function Yt(t,e){const{parentNode:n}=e;return!!n&&(!!t.has(n)||Yt(t,n))}let Vt;function Qt(t){Vt=t}function Zt(){Vt=void 0}const te=t=>{if(!Vt)return t;return(...e)=>{try{return t(...e)}catch(n){if(Vt&&!0===Vt(n))return()=>{};throw n}}},ee=[];function ne(t){try{if("composedPath"in t){const e=t.composedPath();if(e.length)return e[0]}else if("path"in t&&t.path.length)return t.path[0]}catch(e){}return t&&t.target}function re(t,e){var n,r;const s=new qt;ee.push(s),s.init(t);let i=window.MutationObserver||window.__rrMutationObserver;const o=null===(r=null===(n=null===window||void 0===window?void 0:window.Zone)||void 0===n?void 0:n.__symbol__)||void 0===r?void 0:r.call(n,"MutationObserver");o&&window[o]&&(i=window[o]);const a=new i(te((e=>{t.onMutation&&!1===t.onMutation(e)||s.processMutations.bind(s)(e)})));return a.observe(e,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),a}function se({mouseInteractionCb:t,doc:e,mirror:n,blockClass:r,blockSelector:s,unblockSelector:i,sampling:o}){if(!1===o.mouseInteraction)return()=>{};const a=!0===o.mouseInteraction||void 0===o.mouseInteraction?{}:o.mouseInteraction,c=[];let l=null;return Object.keys(Ut).filter((t=>Number.isNaN(Number(t))&&!t.endsWith("_Departed")&&!1!==a[t])).forEach((o=>{let a=H(o);const u=(e=>o=>{const a=ne(o);if(It(a,r,s,i,!0))return;let c=null,u=e;if("pointerType"in o){switch(o.pointerType){case"mouse":c=Bt.Mouse;break;case"touch":c=Bt.Touch;break;case"pen":c=Bt.Pen}c===Bt.Touch?Ut[e]===Ut.MouseDown?u="TouchStart":Ut[e]===Ut.MouseUp&&(u="TouchEnd"):Bt.Pen}else Mt(o)&&(c=Bt.Touch);null!==c?(l=c,(u.startsWith("Touch")&&c===Bt.Touch||u.startsWith("Mouse")&&c===Bt.Mouse)&&(c=null)):Ut[e]===Ut.Click&&(c=l,l=null);const d=Mt(o)?o.changedTouches[0]:o;if(!d)return;const h=n.getId(a),{clientX:p,clientY:m}=d;te(t)(Object.assign({type:Ut[u],id:h,x:p,y:m},null!==c&&{pointerType:c}))})(o);if(window.PointerEvent)switch(Ut[o]){case Ut.MouseDown:case Ut.MouseUp:a=a.replace("mouse","pointer");break;case Ut.TouchStart:case Ut.TouchEnd:return}c.push(yt(a,u,e))})),te((()=>{c.forEach((t=>t()))}))}function ie({scrollCb:t,doc:e,mirror:n,blockClass:r,blockSelector:s,unblockSelector:i,sampling:o}){return yt("scroll",te(St(te((o=>{const a=ne(o);if(!a||It(a,r,s,i,!0))return;const c=n.getId(a);if(a===e&&e.defaultView){const n=Et(e.defaultView);t({id:c,x:n.left,y:n.top})}else t({id:c,x:a.scrollLeft,y:a.scrollTop})})),o.scroll||100)),e)}const oe=["INPUT","TEXTAREA","SELECT"],ae=new WeakMap;function ce({inputCb:t,doc:e,mirror:n,blockClass:r,blockSelector:s,unblockSelector:i,ignoreClass:o,ignoreSelector:a,maskInputOptions:c,maskInputFn:l,sampling:u,userTriggeredOnInput:d,maskTextClass:h,unmaskTextClass:p,maskTextSelector:m,unmaskTextSelector:f}){function g(t){let n=ne(t);const u=t.isTrusted,g=n&&z(n.tagName);if("OPTION"===g&&(n=n.parentElement),!n||!g||oe.indexOf(g)<0||It(n,r,s,i,!0))return;const _=n;if(_.classList.contains(o)||a&&_.matches(a))return;const v=q(n);let S=X(_,g,v),k=!1;const b=U({maskInputOptions:c,tagName:g,type:v}),w=pt(n,h,m,p,f,b);"radio"!==v&&"checkbox"!==v||(k=n.checked),S=B({isMasked:w,element:n,value:S,maskInputFn:l}),y(n,d?{text:S,isChecked:k,userTriggered:u}:{text:S,isChecked:k});const E=n.name;"radio"===v&&E&&k&&e.querySelectorAll(`input[type="radio"][name="${E}"]`).forEach((t=>{if(t!==n){const e=B({isMasked:w,element:t,value:X(t,g,v),maskInputFn:l});y(t,d?{text:e,isChecked:!k,userTriggered:!1}:{text:e,isChecked:!k})}}))}function y(e,r){const s=ae.get(e);if(!s||s.text!==r.text||s.isChecked!==r.isChecked){ae.set(e,r);const s=n.getId(e);te(t)(Object.assign(Object.assign({},r),{id:s}))}}const _=("last"===u.input?["change"]:["input","change"]).map((t=>yt(t,te(g),e))),v=e.defaultView;if(!v)return()=>{_.forEach((t=>t()))};const S=v.Object.getOwnPropertyDescriptor(v.HTMLInputElement.prototype,"value"),k=[[v.HTMLInputElement.prototype,"value"],[v.HTMLInputElement.prototype,"checked"],[v.HTMLSelectElement.prototype,"value"],[v.HTMLTextAreaElement.prototype,"value"],[v.HTMLSelectElement.prototype,"selectedIndex"],[v.HTMLOptionElement.prototype,"selected"]];return S&&S.set&&_.push(...k.map((t=>kt(t[0],t[1],{set(){te(g)({target:this,isTrusted:!1})}},!1,v)))),te((()=>{_.forEach((t=>t()))}))}function le(t){return function(t,e){if(pe("CSSGroupingRule")&&t.parentRule instanceof CSSGroupingRule||pe("CSSMediaRule")&&t.parentRule instanceof CSSMediaRule||pe("CSSSupportsRule")&&t.parentRule instanceof CSSSupportsRule||pe("CSSConditionRule")&&t.parentRule instanceof CSSConditionRule){const n=Array.from(t.parentRule.cssRules).indexOf(t);e.unshift(n)}else if(t.parentStyleSheet){const n=Array.from(t.parentStyleSheet.cssRules).indexOf(t);e.unshift(n)}return e}(t,[])}function ue(t,e,n){let r,s;return t?(t.ownerNode?r=e.getId(t.ownerNode):s=n.getId(t),{styleId:s,id:r}):{}}function de({mirror:t,stylesheetManager:e},n){var r,s,i;let o=null;o="#document"===n.nodeName?t.getId(n):t.getId(n.host);const a="#document"===n.nodeName?null===(r=n.defaultView)||void 0===r?void 0:r.Document:null===(i=null===(s=n.ownerDocument)||void 0===s?void 0:s.defaultView)||void 0===i?void 0:i.ShadowRoot,c=(null===a||void 0===a?void 0:a.prototype)?Object.getOwnPropertyDescriptor(null===a||void 0===a?void 0:a.prototype,"adoptedStyleSheets"):void 0;return null!==o&&-1!==o&&a&&c?(Object.defineProperty(n,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get(){var t;return null===(t=c.get)||void 0===t?void 0:t.call(this)},set(t){var n;const r=null===(n=c.set)||void 0===n?void 0:n.call(this,t);if(null!==o&&-1!==o)try{e.adoptStyleSheets(t,o)}catch(s){}return r}}),te((()=>{Object.defineProperty(n,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get:c.get,set:c.set})}))):()=>{}}function he(t,e={}){const n=t.doc.defaultView;if(!n)return()=>{};const r=re(t,t.doc),s=function({mousemoveCb:t,sampling:e,doc:n,mirror:r}){if(!1===e.mousemove)return()=>{};const s="number"===typeof e.mousemove?e.mousemove:50,i="number"===typeof e.mousemoveCallback?e.mousemoveCallback:500;let o,a=[];const c=St(te((e=>{const n=Date.now()-o;t(a.map((t=>(t.timeOffset-=n,t))),e),a=[],o=null})),i),l=te(St(te((t=>{const e=ne(t),{clientX:n,clientY:s}=Mt(t)?t.changedTouches[0]:t;o||(o=wt()),a.push({x:n,y:s,id:r.getId(e),timeOffset:wt()-o}),c("undefined"!==typeof DragEvent&&t instanceof DragEvent?jt.Drag:t instanceof MouseEvent?jt.MouseMove:jt.TouchMove)})),s,{trailing:!1})),u=[yt("mousemove",l,n),yt("touchmove",l,n),yt("drag",l,n)];return te((()=>{u.forEach((t=>t()))}))}(t),i=se(t),o=ie(t),a=function({viewportResizeCb:t},{win:e}){let n=-1,r=-1;return yt("resize",te(St(te((()=>{const e=xt(),s=Tt();n===e&&r===s||(t({width:Number(s),height:Number(e)}),n=e,r=s)})),200)),e)}(t,{win:n}),c=ce(t),l=function({mediaInteractionCb:t,blockClass:e,blockSelector:n,unblockSelector:r,mirror:s,sampling:i,doc:o}){const a=te((o=>St(te((i=>{const a=ne(i);if(!a||It(a,e,n,r,!0))return;const{currentTime:c,volume:l,muted:u,playbackRate:d}=a;t({type:o,id:s.getId(a),currentTime:c,volume:l,muted:u,playbackRate:d})})),i.media||500))),c=[yt("play",a(0),o),yt("pause",a(1),o),yt("seeked",a(2),o),yt("volumechange",a(3),o),yt("ratechange",a(4),o)];return te((()=>{c.forEach((t=>t()))}))}(t),u=function({styleSheetRuleCb:t,mirror:e,stylesheetManager:n},{win:r}){if(!r.CSSStyleSheet||!r.CSSStyleSheet.prototype)return()=>{};const s=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=new Proxy(s,{apply:te(((r,s,i)=>{const[o,a]=i,{id:c,styleId:l}=ue(s,e,n.styleMirror);return(c&&-1!==c||l&&-1!==l)&&t({id:c,styleId:l,adds:[{rule:o,index:a}]}),r.apply(s,i)}))});const i=r.CSSStyleSheet.prototype.deleteRule;let o,a;r.CSSStyleSheet.prototype.deleteRule=new Proxy(i,{apply:te(((r,s,i)=>{const[o]=i,{id:a,styleId:c}=ue(s,e,n.styleMirror);return(a&&-1!==a||c&&-1!==c)&&t({id:a,styleId:c,removes:[{index:o}]}),r.apply(s,i)}))}),r.CSSStyleSheet.prototype.replace&&(o=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=new Proxy(o,{apply:te(((r,s,i)=>{const[o]=i,{id:a,styleId:c}=ue(s,e,n.styleMirror);return(a&&-1!==a||c&&-1!==c)&&t({id:a,styleId:c,replace:o}),r.apply(s,i)}))})),r.CSSStyleSheet.prototype.replaceSync&&(a=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=new Proxy(a,{apply:te(((r,s,i)=>{const[o]=i,{id:a,styleId:c}=ue(s,e,n.styleMirror);return(a&&-1!==a||c&&-1!==c)&&t({id:a,styleId:c,replaceSync:o}),r.apply(s,i)}))}));const c={};me("CSSGroupingRule")?c.CSSGroupingRule=r.CSSGroupingRule:(me("CSSMediaRule")&&(c.CSSMediaRule=r.CSSMediaRule),me("CSSConditionRule")&&(c.CSSConditionRule=r.CSSConditionRule),me("CSSSupportsRule")&&(c.CSSSupportsRule=r.CSSSupportsRule));const l={};return Object.entries(c).forEach((([r,s])=>{l[r]={insertRule:s.prototype.insertRule,deleteRule:s.prototype.deleteRule},s.prototype.insertRule=new Proxy(l[r].insertRule,{apply:te(((r,s,i)=>{const[o,a]=i,{id:c,styleId:l}=ue(s.parentStyleSheet,e,n.styleMirror);return(c&&-1!==c||l&&-1!==l)&&t({id:c,styleId:l,adds:[{rule:o,index:[...le(s),a||0]}]}),r.apply(s,i)}))}),s.prototype.deleteRule=new Proxy(l[r].deleteRule,{apply:te(((r,s,i)=>{const[o]=i,{id:a,styleId:c}=ue(s.parentStyleSheet,e,n.styleMirror);return(a&&-1!==a||c&&-1!==c)&&t({id:a,styleId:c,removes:[{index:[...le(s),o]}]}),r.apply(s,i)}))})})),te((()=>{r.CSSStyleSheet.prototype.insertRule=s,r.CSSStyleSheet.prototype.deleteRule=i,o&&(r.CSSStyleSheet.prototype.replace=o),a&&(r.CSSStyleSheet.prototype.replaceSync=a),Object.entries(c).forEach((([t,e])=>{e.prototype.insertRule=l[t].insertRule,e.prototype.deleteRule=l[t].deleteRule}))}))}(t,{win:n}),d=de(t,t.doc),h=function({styleDeclarationCb:t,mirror:e,ignoreCSSAttributes:n,stylesheetManager:r},{win:s}){const i=s.CSSStyleDeclaration.prototype.setProperty;s.CSSStyleDeclaration.prototype.setProperty=new Proxy(i,{apply:te(((s,o,a)=>{var c;const[l,u,d]=a;if(n.has(l))return i.apply(o,[l,u,d]);const{id:h,styleId:p}=ue(null===(c=o.parentRule)||void 0===c?void 0:c.parentStyleSheet,e,r.styleMirror);return(h&&-1!==h||p&&-1!==p)&&t({id:h,styleId:p,set:{property:l,value:u,priority:d},index:le(o.parentRule)}),s.apply(o,a)}))});const o=s.CSSStyleDeclaration.prototype.removeProperty;return s.CSSStyleDeclaration.prototype.removeProperty=new Proxy(o,{apply:te(((s,i,a)=>{var c;const[l]=a;if(n.has(l))return o.apply(i,[l]);const{id:u,styleId:d}=ue(null===(c=i.parentRule)||void 0===c?void 0:c.parentStyleSheet,e,r.styleMirror);return(u&&-1!==u||d&&-1!==d)&&t({id:u,styleId:d,remove:{property:l},index:le(i.parentRule)}),s.apply(i,a)}))}),te((()=>{s.CSSStyleDeclaration.prototype.setProperty=i,s.CSSStyleDeclaration.prototype.removeProperty=o}))}(t,{win:n}),p=t.collectFonts?function({fontCb:t,doc:e}){const n=e.defaultView;if(!n)return()=>{};const r=[],s=new WeakMap,i=n.FontFace;n.FontFace=function(t,e,n){const r=new i(t,e,n);return s.set(r,{family:t,buffer:"string"!==typeof e,descriptors:n,fontSource:"string"===typeof e?e:JSON.stringify(Array.from(new Uint8Array(e)))}),r};const o=bt(e.fonts,"add",(function(e){return function(n){return setTimeout(te((()=>{const e=s.get(n);e&&(t(e),s.delete(n))})),0),e.apply(this,[n])}}));return r.push((()=>{n.FontFace=i})),r.push(o),te((()=>{r.forEach((t=>t()))}))}(t):()=>{},m=function(t){const{doc:e,mirror:n,blockClass:r,blockSelector:s,unblockSelector:i,selectionCb:o}=t;let a=!0;const c=te((()=>{const t=e.getSelection();if(!t||a&&(null===t||void 0===t?void 0:t.isCollapsed))return;a=t.isCollapsed||!1;const c=[],l=t.rangeCount||0;for(let e=0;e<l;e++){const o=t.getRangeAt(e),{startContainer:a,startOffset:l,endContainer:u,endOffset:d}=o;It(a,r,s,i,!0)||It(u,r,s,i,!0)||c.push({start:n.getId(a),startOffset:l,end:n.getId(u),endOffset:d})}o({ranges:c})}));return c(),yt("selectionchange",c)}(t),f=function({doc:t,customElementCb:e}){const n=t.defaultView;return n&&n.customElements?bt(n.customElements,"define",(function(t){return function(n,r,s){try{e({define:{name:n}})}catch(i){}return t.apply(this,[n,r,s])}})):()=>{}}(t);return te((()=>{ee.forEach((t=>t.reset())),r.disconnect(),s(),i(),o(),a(),c(),l(),u(),d(),h(),p(),m(),f()}))}function pe(t){return"undefined"!==typeof window[t]}function me(t){return Boolean("undefined"!==typeof window[t]&&window[t].prototype&&"insertRule"in window[t].prototype&&"deleteRule"in window[t].prototype)}class fe{constructor(t){this.generateIdFn=t,this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap}getId(t,e,n,r){const s=n||this.getIdToRemoteIdMap(t),i=r||this.getRemoteIdToIdMap(t);let o=s.get(e);return o||(o=this.generateIdFn(),s.set(e,o),i.set(o,e)),o}getIds(t,e){const n=this.getIdToRemoteIdMap(t),r=this.getRemoteIdToIdMap(t);return e.map((e=>this.getId(t,e,n,r)))}getRemoteId(t,e,n){const r=n||this.getRemoteIdToIdMap(t);if("number"!==typeof e)return e;const s=r.get(e);return s||-1}getRemoteIds(t,e){const n=this.getRemoteIdToIdMap(t);return e.map((e=>this.getRemoteId(t,e,n)))}reset(t){if(!t)return this.iframeIdToRemoteIdMap=new WeakMap,void(this.iframeRemoteIdToIdMap=new WeakMap);this.iframeIdToRemoteIdMap.delete(t),this.iframeRemoteIdToIdMap.delete(t)}getIdToRemoteIdMap(t){let e=this.iframeIdToRemoteIdMap.get(t);return e||(e=new Map,this.iframeIdToRemoteIdMap.set(t,e)),e}getRemoteIdToIdMap(t){let e=this.iframeRemoteIdToIdMap.get(t);return e||(e=new Map,this.iframeRemoteIdToIdMap.set(t,e)),e}}class ge{constructor(){this.crossOriginIframeMirror=new fe(Y),this.crossOriginIframeRootIdMap=new WeakMap}addIframe(){}addLoadListener(){}attachIframe(){}}class ye{constructor(t){this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new fe(Y),this.crossOriginIframeRootIdMap=new WeakMap,this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new fe(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=t.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(t){this.iframes.set(t,!0),t.contentWindow&&this.crossOriginIframeMap.set(t.contentWindow,t)}addLoadListener(t){this.loadListener=t}attachIframe(t,e){var n;this.mutationCb({adds:[{parentId:this.mirror.getId(t),nextId:null,node:e}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),null===(n=this.loadListener)||void 0===n||n.call(this,t),t.contentDocument&&t.contentDocument.adoptedStyleSheets&&t.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(t.contentDocument.adoptedStyleSheets,this.mirror.getId(t.contentDocument))}handleMessage(t){const e=t;if("rrweb"!==e.data.type||e.origin!==e.data.origin)return;if(!t.source)return;const n=this.crossOriginIframeMap.get(t.source);if(!n)return;const r=this.transformCrossOriginEvent(n,e.data.event);r&&this.wrappedEmit(r,e.data.isCheckout)}transformCrossOriginEvent(t,e){var n;switch(e.type){case Ft.FullSnapshot:{this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(e.data.node,t);const n=e.data.node.id;return this.crossOriginIframeRootIdMap.set(t,n),this.patchRootIdOnNode(e.data.node,n),{timestamp:e.timestamp,type:Ft.IncrementalSnapshot,data:{source:jt.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:e.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case Ft.Meta:case Ft.Load:case Ft.DomContentLoaded:return!1;case Ft.Plugin:return e;case Ft.Custom:return this.replaceIds(e.data.payload,t,["id","parentId","previousId","nextId"]),e;case Ft.IncrementalSnapshot:switch(e.data.source){case jt.Mutation:return e.data.adds.forEach((e=>{this.replaceIds(e,t,["parentId","nextId","previousId"]),this.replaceIdOnNode(e.node,t);const n=this.crossOriginIframeRootIdMap.get(t);n&&this.patchRootIdOnNode(e.node,n)})),e.data.removes.forEach((e=>{this.replaceIds(e,t,["parentId","id"])})),e.data.attributes.forEach((e=>{this.replaceIds(e,t,["id"])})),e.data.texts.forEach((e=>{this.replaceIds(e,t,["id"])})),e;case jt.Drag:case jt.TouchMove:case jt.MouseMove:return e.data.positions.forEach((e=>{this.replaceIds(e,t,["id"])})),e;case jt.ViewportResize:return!1;case jt.MediaInteraction:case jt.MouseInteraction:case jt.Scroll:case jt.CanvasMutation:case jt.Input:return this.replaceIds(e.data,t,["id"]),e;case jt.StyleSheetRule:case jt.StyleDeclaration:return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleId"]),e;case jt.Font:return e;case jt.Selection:return e.data.ranges.forEach((e=>{this.replaceIds(e,t,["start","end"])})),e;case jt.AdoptedStyleSheet:return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleIds"]),null===(n=e.data.styles)||void 0===n||n.forEach((e=>{this.replaceStyleIds(e,t,["styleId"])})),e}}return!1}replace(t,e,n,r){for(const s of r)(Array.isArray(e[s])||"number"===typeof e[s])&&(Array.isArray(e[s])?e[s]=t.getIds(n,e[s]):e[s]=t.getId(n,e[s]));return e}replaceIds(t,e,n){return this.replace(this.crossOriginIframeMirror,t,e,n)}replaceStyleIds(t,e,n){return this.replace(this.crossOriginIframeStyleMirror,t,e,n)}replaceIdOnNode(t,e){this.replaceIds(t,e,["id","rootId"]),"childNodes"in t&&t.childNodes.forEach((t=>{this.replaceIdOnNode(t,e)}))}patchRootIdOnNode(t,e){t.type===N.Document||t.rootId||(t.rootId=e),"childNodes"in t&&t.childNodes.forEach((t=>{this.patchRootIdOnNode(t,e)}))}}class _e{init(){}addShadowRoot(){}observeAttachShadow(){}reset(){}}class ve{constructor(t){this.shadowDoms=new WeakSet,this.restoreHandlers=[],this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(t,e){if(!$(t))return;if(this.shadowDoms.has(t))return;this.shadowDoms.add(t);const n=re(Object.assign(Object.assign({},this.bypassOptions),{doc:e,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t);this.restoreHandlers.push((()=>n.disconnect())),this.restoreHandlers.push(ie(Object.assign(Object.assign({},this.bypassOptions),{scrollCb:this.scrollCb,doc:t,mirror:this.mirror}))),setTimeout((()=>{t.adoptedStyleSheets&&t.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(t.adoptedStyleSheets,this.mirror.getId(t.host)),this.restoreHandlers.push(de({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},t))}),0)}observeAttachShadow(t){t.contentWindow&&t.contentDocument&&this.patchAttachShadow(t.contentWindow.Element,t.contentDocument)}patchAttachShadow(t,e){const n=this;this.restoreHandlers.push(bt(t.prototype,"attachShadow",(function(t){return function(r){const s=t.call(this,r);return this.shadowRoot&&Pt(this)&&n.addShadowRoot(this.shadowRoot,e),s}})))}reset(){this.restoreHandlers.forEach((t=>{try{t()}catch(e){}})),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}class Se{reset(){}freeze(){}unfreeze(){}lock(){}unlock(){}}class ke{constructor(t){this.trackedLinkElements=new WeakSet,this.styleMirror=new Nt,this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb}attachLinkElement(t,e){"_cssText"in e.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:e.id,attributes:e.attributes}]}),this.trackLinkElement(t)}trackLinkElement(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t))}adoptStyleSheets(t,e){if(0===t.length)return;const n={id:e,styleIds:[]},r=[];for(const s of t){let t;this.styleMirror.has(s)?t=this.styleMirror.getId(s):(t=this.styleMirror.add(s),r.push({styleId:t,rules:Array.from(s.rules||CSSRule,((t,e)=>({rule:F(t),index:e})))})),n.styleIds.push(t)}r.length>0&&(n.styles=r),this.adoptedStyleSheetCb(n)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(t){}}class be{constructor(){this.nodeMap=new WeakMap,this.loop=!0,this.periodicallyClear()}periodicallyClear(){requestAnimationFrame((()=>{this.clear(),this.loop&&this.periodicallyClear()}))}inOtherBuffer(t,e){const n=this.nodeMap.get(t);return n&&Array.from(n).some((t=>t!==e))}add(t,e){this.nodeMap.set(t,(this.nodeMap.get(t)||new Set).add(e))}clear(){this.nodeMap=new WeakMap}destroy(){this.loop=!1}}function we(t){const e=t;return e.timestamp=wt(),e}let Ee;const xe=new j;function Te(t={}){const{emit:e,checkoutEveryNms:n,checkoutEveryNth:r,blockClass:s="rr-block",blockSelector:i=null,unblockSelector:o=null,ignoreClass:a="rr-ignore",ignoreSelector:c=null,maskAllText:l=!1,maskTextClass:u="rr-mask",unmaskTextClass:d=null,maskTextSelector:h=null,unmaskTextSelector:p=null,inlineStylesheet:m=!0,maskAllInputs:f,maskInputOptions:g,slimDOMOptions:y,maskAttributeFn:_,maskInputFn:v,maskTextFn:S,packFn:k,sampling:b={},dataURLOptions:w={},mousemoveWait:E,recordCanvas:x=!1,recordCrossOriginIframes:T=!1,recordAfter:I=("DOMContentLoaded"===t.recordAfter?t.recordAfter:"load"),userTriggeredOnInput:C=!1,collectFonts:R=!1,inlineImages:M=!1,keepIframeSrcFn:O=(()=>!1),ignoreCSSAttributes:D=new Set([]),errorHandler:A,onMutation:N,getCanvasManager:L}=t;Qt(A);const $=!T||window.parent===window;let P=!1;if(!$)try{window.parent.document&&(P=!1)}catch(tt){P=!0}if($&&!e)throw new Error("emit function is required");void 0!==E&&void 0===b.mousemove&&(b.mousemove=E),xe.reset();const F=!0===f?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,radio:!0,checkbox:!0}:void 0!==g?g:{},U=!0===y||"all"===y?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===y,headMetaDescKeywords:"all"===y}:y||{};let B;!function(t=window){"NodeList"in t&&!t.NodeList.prototype.forEach&&(t.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in t&&!t.DOMTokenList.prototype.forEach&&(t.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=(...t)=>{let e=t[0];if(!(0 in t))throw new TypeError("1 argument is required");do{if(this===e)return!0}while(e=e&&e.parentNode);return!1})}();let H=0;const z=t=>(k&&!P&&(t=k(t)),t),W=(t,s)=>{var i;if(!(null===(i=ee[0])||void 0===i?void 0:i.isFrozen())||t.type===Ft.FullSnapshot||t.type===Ft.IncrementalSnapshot&&t.data.source===jt.Mutation||ee.forEach((t=>t.unfreeze())),$)null===e||void 0===e||e(z(t),s);else if(P){const e={type:"rrweb",event:z(t),origin:window.location.origin,isCheckout:s};window.parent.postMessage(e,"*")}if(t.type===Ft.FullSnapshot)B=t,H=0;else if(t.type===Ft.IncrementalSnapshot){if(t.data.source===jt.Mutation&&t.data.isAttachIframe)return;H++;const e=r&&H>=r,s=n&&t.timestamp-B.timestamp>n;(e||s)&&Z(!0)}},q=t=>{W(we({type:Ft.IncrementalSnapshot,data:Object.assign({source:jt.Mutation},t)}))},X=t=>W(we({type:Ft.IncrementalSnapshot,data:Object.assign({source:jt.Scroll},t)})),G=t=>W(we({type:Ft.IncrementalSnapshot,data:Object.assign({source:jt.CanvasMutation},t)})),K=new ke({mutationCb:q,adoptedStyleSheetCb:t=>W(we({type:Ft.IncrementalSnapshot,data:Object.assign({source:jt.AdoptedStyleSheet},t)}))}),J="boolean"===typeof __RRWEB_EXCLUDE_IFRAME__&&__RRWEB_EXCLUDE_IFRAME__?new ge:new ye({mirror:xe,mutationCb:q,stylesheetManager:K,recordCrossOriginIframes:T,wrappedEmit:W}),Y=new be,V=L?L({recordCanvas:x,blockClass:s,blockSelector:i,unblockSelector:o,sampling:b.canvas,dataURLOptions:w}):new Se,Q="boolean"===typeof __RRWEB_EXCLUDE_SHADOW_DOM__&&__RRWEB_EXCLUDE_SHADOW_DOM__?new _e:new ve({mutationCb:q,scrollCb:X,bypassOptions:{onMutation:N,blockClass:s,blockSelector:i,unblockSelector:o,maskAllText:l,maskTextClass:u,unmaskTextClass:d,maskTextSelector:h,unmaskTextSelector:p,inlineStylesheet:m,maskInputOptions:F,dataURLOptions:w,maskAttributeFn:_,maskTextFn:S,maskInputFn:v,recordCanvas:x,inlineImages:M,sampling:b,slimDOMOptions:U,iframeManager:J,stylesheetManager:K,canvasManager:V,keepIframeSrcFn:O,processedNodeManager:Y},mirror:xe}),Z=(t=!1)=>{W(we({type:Ft.Meta,data:{href:window.location.href,width:Tt(),height:xt()}}),t),K.reset(),Q.init(),ee.forEach((t=>t.lock()));const e=function(t,e){const{mirror:n=new j,blockClass:r="rr-block",blockSelector:s=null,unblockSelector:i=null,maskAllText:o=!1,maskTextClass:a="rr-mask",unmaskTextClass:c=null,maskTextSelector:l=null,unmaskTextSelector:u=null,inlineStylesheet:d=!0,inlineImages:h=!1,recordCanvas:p=!1,maskAllInputs:m=!1,maskAttributeFn:f,maskTextFn:g,maskInputFn:y,slimDOM:_=!1,dataURLOptions:v,preserveWhiteSpace:S,onSerialize:k,onIframeLoad:b,iframeLoadTimeout:w,onStylesheetLoad:E,stylesheetLoadTimeout:x,keepIframeSrcFn:T=(()=>!1)}=e||{};return gt(t,{doc:t,mirror:n,blockClass:r,blockSelector:s,unblockSelector:i,maskAllText:o,maskTextClass:a,unmaskTextClass:c,maskTextSelector:l,unmaskTextSelector:u,skipChild:!1,inlineStylesheet:d,maskInputOptions:!0===m?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0}:!1===m?{}:m,maskAttributeFn:f,maskTextFn:g,maskInputFn:y,slimDOMOptions:!0===_||"all"===_?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===_,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===_?{}:_,dataURLOptions:v,inlineImages:h,recordCanvas:p,preserveWhiteSpace:S,onSerialize:k,onIframeLoad:b,iframeLoadTimeout:w,onStylesheetLoad:E,stylesheetLoadTimeout:x,keepIframeSrcFn:T,newlyAddedElement:!1})}(document,{mirror:xe,blockClass:s,blockSelector:i,unblockSelector:o,maskAllText:l,maskTextClass:u,unmaskTextClass:d,maskTextSelector:h,unmaskTextSelector:p,inlineStylesheet:m,maskAllInputs:F,maskAttributeFn:_,maskInputFn:v,maskTextFn:S,slimDOM:U,dataURLOptions:w,recordCanvas:x,inlineImages:M,onSerialize:t=>{Ot(t,xe)&&J.addIframe(t),Dt(t,xe)&&K.trackLinkElement(t),At(t)&&Q.addShadowRoot(t.shadowRoot,document)},onIframeLoad:(t,e)=>{J.attachIframe(t,e),Q.observeAttachShadow(t)},onStylesheetLoad:(t,e)=>{K.attachLinkElement(t,e)},keepIframeSrcFn:O});if(!e)return console.warn("Failed to snapshot the document");W(we({type:Ft.FullSnapshot,data:{node:e,initialOffset:Et(window)}}),t),ee.forEach((t=>t.unlock())),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&K.adoptStyleSheets(document.adoptedStyleSheets,xe.getId(document))};Ee=Z;try{const t=[],e=t=>te(he)({onMutation:N,mutationCb:q,mousemoveCb:(t,e)=>W(we({type:Ft.IncrementalSnapshot,data:{source:e,positions:t}})),mouseInteractionCb:t=>W(we({type:Ft.IncrementalSnapshot,data:Object.assign({source:jt.MouseInteraction},t)})),scrollCb:X,viewportResizeCb:t=>W(we({type:Ft.IncrementalSnapshot,data:Object.assign({source:jt.ViewportResize},t)})),inputCb:t=>W(we({type:Ft.IncrementalSnapshot,data:Object.assign({source:jt.Input},t)})),mediaInteractionCb:t=>W(we({type:Ft.IncrementalSnapshot,data:Object.assign({source:jt.MediaInteraction},t)})),styleSheetRuleCb:t=>W(we({type:Ft.IncrementalSnapshot,data:Object.assign({source:jt.StyleSheetRule},t)})),styleDeclarationCb:t=>W(we({type:Ft.IncrementalSnapshot,data:Object.assign({source:jt.StyleDeclaration},t)})),canvasMutationCb:G,fontCb:t=>W(we({type:Ft.IncrementalSnapshot,data:Object.assign({source:jt.Font},t)})),selectionCb:t=>{W(we({type:Ft.IncrementalSnapshot,data:Object.assign({source:jt.Selection},t)}))},customElementCb:t=>{W(we({type:Ft.IncrementalSnapshot,data:Object.assign({source:jt.CustomElement},t)}))},blockClass:s,ignoreClass:a,ignoreSelector:c,maskAllText:l,maskTextClass:u,unmaskTextClass:d,maskTextSelector:h,unmaskTextSelector:p,maskInputOptions:F,inlineStylesheet:m,sampling:b,recordCanvas:x,inlineImages:M,userTriggeredOnInput:C,collectFonts:R,doc:t,maskAttributeFn:_,maskInputFn:v,maskTextFn:S,keepIframeSrcFn:O,blockSelector:i,unblockSelector:o,slimDOMOptions:U,dataURLOptions:w,mirror:xe,iframeManager:J,stylesheetManager:K,shadowDomManager:Q,processedNodeManager:Y,canvasManager:V,ignoreCSSAttributes:D,plugins:[]},{});J.addLoadListener((n=>{try{t.push(e(n.contentDocument))}catch(r){console.warn(r)}}));const n=()=>{Z(),t.push(e(document))};return"interactive"===document.readyState||"complete"===document.readyState?n():(t.push(yt("DOMContentLoaded",(()=>{W(we({type:Ft.DomContentLoaded,data:{}})),"DOMContentLoaded"===I&&n()}))),t.push(yt("load",(()=>{W(we({type:Ft.Load,data:{}})),"load"===I&&n()}),window))),()=>{t.forEach((t=>t())),Y.destroy(),Ee=void 0,Zt()}}catch(et){console.warn(et)}}Te.mirror=xe,Te.takeFullSnapshot=function(t){if(!Ee)throw new Error("please take full snapshot after start recording");Ee(t)};const Ie=3;function Ce(t){return t>9999999999?t:1e3*t}function Re(t){return t>9999999999?t/1e3:t}function Me(t,e){"sentry.transaction"!==e.category&&(["ui.click","ui.input"].includes(e.category)?t.triggerUserActivity():t.checkAndHandleExpiredSession(),t.addUpdate((()=>(t.throttledAddEvent({type:Ft.Custom,timestamp:1e3*(e.timestamp||0),data:{tag:"breadcrumb",payload:(0,u.Fv)(e,10,1e3)}}),"console"===e.category))))}const Oe="button,a";function De(t){return t.closest(Oe)||t}function Ae(t){const e=Ne(t);return e&&e instanceof Element?De(e):e}function Ne(t){return function(t){return"object"===typeof t&&!!t&&"target"in t}(t)?t.target:t}let Le;function $e(t){return Le||(Le=[],(0,d.hl)(T,"open",(function(t){return function(...e){if(Le)try{Le.forEach((t=>t()))}catch(n){}return t.apply(T,e)}}))),Le.push(t),()=>{const e=Le?Le.indexOf(t):-1;e>-1&&Le.splice(e,1)}}class Pe{constructor(t,e,n=Me){this._lastMutation=0,this._lastScroll=0,this._clicks=[],this._timeout=e.timeout/1e3,this._threshold=e.threshold/1e3,this._scollTimeout=e.scrollTimeout/1e3,this._replay=t,this._ignoreSelector=e.ignoreSelector,this._addBreadcrumbEvent=n}addListeners(){const t=$e((()=>{this._lastMutation=je()}));this._teardown=()=>{t(),this._clicks=[],this._lastMutation=0,this._lastScroll=0}}removeListeners(){this._teardown&&this._teardown(),this._checkClickTimeout&&clearTimeout(this._checkClickTimeout)}handleClick(t,e){if(function(t,e){if(!Fe.includes(t.tagName))return!0;if("INPUT"===t.tagName&&!["submit","button"].includes(t.getAttribute("type")||""))return!0;if("A"===t.tagName&&(t.hasAttribute("download")||t.hasAttribute("target")&&"_self"!==t.getAttribute("target")))return!0;if(e&&t.matches(e))return!0;return!1}(e,this._ignoreSelector)||!function(t){return!(!t.data||"number"!==typeof t.data.nodeId||!t.timestamp)}(t))return;const n={timestamp:Re(t.timestamp),clickBreadcrumb:t,clickCount:0,node:e};this._clicks.some((t=>t.node===n.node&&Math.abs(t.timestamp-n.timestamp)<1))||(this._clicks.push(n),1===this._clicks.length&&this._scheduleCheckClicks())}registerMutation(t=Date.now()){this._lastMutation=Re(t)}registerScroll(t=Date.now()){this._lastScroll=Re(t)}registerClick(t){const e=De(t);this._handleMultiClick(e)}_handleMultiClick(t){this._getClicks(t).forEach((t=>{t.clickCount++}))}_getClicks(t){return this._clicks.filter((e=>e.node===t))}_checkClicks(){const t=[],e=je();this._clicks.forEach((n=>{!n.mutationAfter&&this._lastMutation&&(n.mutationAfter=n.timestamp<=this._lastMutation?this._lastMutation-n.timestamp:void 0),!n.scrollAfter&&this._lastScroll&&(n.scrollAfter=n.timestamp<=this._lastScroll?this._lastScroll-n.timestamp:void 0),n.timestamp+this._timeout<=e&&t.push(n)}));for(const n of t){const t=this._clicks.indexOf(n);t>-1&&(this._generateBreadcrumbs(n),this._clicks.splice(t,1))}this._clicks.length&&this._scheduleCheckClicks()}_generateBreadcrumbs(t){const e=this._replay,n=t.scrollAfter&&t.scrollAfter<=this._scollTimeout,r=t.mutationAfter&&t.mutationAfter<=this._threshold,s=!n&&!r,{clickCount:i,clickBreadcrumb:o}=t;if(s){const n=1e3*Math.min(t.mutationAfter||this._timeout,this._timeout),r=n<1e3*this._timeout?"mutation":"timeout",s={type:"default",message:o.message,timestamp:o.timestamp,category:"ui.slowClickDetected",data:{...o.data,url:T.location.href,route:e.getCurrentRoute(),timeAfterClickMs:n,endReason:r,clickCount:i||1}};this._addBreadcrumbEvent(e,s)}else if(i>1){const t={type:"default",message:o.message,timestamp:o.timestamp,category:"ui.multiClick",data:{...o.data,url:T.location.href,route:e.getCurrentRoute(),clickCount:i,metric:!0}};this._addBreadcrumbEvent(e,t)}}_scheduleCheckClicks(){this._checkClickTimeout&&clearTimeout(this._checkClickTimeout),this._checkClickTimeout=setTimeout((()=>this._checkClicks()),1e3)}}const Fe=["A","BUTTON","INPUT"];function je(){return Date.now()/1e3}function Ue(t,e){try{if(!function(t){return t.type===Ie}(e))return;const{source:n}=e.data;if(n===jt.Mutation&&t.registerMutation(e.timestamp),n===jt.Scroll&&t.registerScroll(e.timestamp),function(t){return t.data.source===jt.MouseInteraction}(e)){const{type:n,id:r}=e.data,s=Te.mirror.getNode(r);s instanceof HTMLElement&&n===Ut.Click&&t.registerClick(s)}}catch(n){}}function Be(t){return{timestamp:Date.now()/1e3,type:"default",...t}}var He;!function(t){t[t.Document=0]="Document",t[t.DocumentType=1]="DocumentType",t[t.Element=2]="Element",t[t.Text=3]="Text",t[t.CDATA=4]="CDATA",t[t.Comment=5]="Comment"}(He||(He={}));const ze=new Set(["id","class","aria-label","role","name","alt","title","data-test-id","data-testid","disabled","aria-disabled"]);function We(t){const e={};for(const n in t)if(ze.has(n)){let r=n;"data-testid"!==n&&"data-test-id"!==n||(r="testId"),e[r]=t[n]}return e}const qe=t=>e=>{if(!t.isEnabled())return;const n=function(t){const{target:e,message:n}=function(t){const e="click"===t.name;let n,r=null;try{r=e?Ae(t.event):Ne(t.event),n=(0,h.Rt)(r,{maxStringLength:200})||"<unknown>"}catch(s){n="<unknown>"}return{target:r,message:n}}(t);return Be({category:`ui.${t.name}`,...Xe(e,n)})}(e);if(!n)return;const r="click"===e.name,s=r?e.event:void 0;!(r&&t.clickDetector&&s&&s.target)||s.altKey||s.metaKey||s.ctrlKey||s.shiftKey||function(t,e,n){t.handleClick(e,n)}(t.clickDetector,n,Ae(e.event)),Me(t,n)};function Xe(t,e){const n=Te.mirror.getId(t),r=n&&Te.mirror.getNode(n),s=r&&Te.mirror.getMeta(r),i=s&&function(t){return t.type===He.Element}(s)?s:null;return{message:e,data:i?{nodeId:n,node:{id:n,tagName:i.tagName,textContent:Array.from(i.childNodes).map((t=>t.type===He.Text&&t.textContent)).filter(Boolean).map((t=>t.trim())).join(""),attributes:We(i.attributes)}}:{}}}function Ge(t,e){if(!t.isEnabled())return;t.updateUserActivity();const n=function(t){const{metaKey:e,shiftKey:n,ctrlKey:r,altKey:s,key:i,target:o}=t;if(!o||function(t){return"INPUT"===t.tagName||"TEXTAREA"===t.tagName||t.isContentEditable}(o)||!i)return null;const a=e||r||s,c=1===i.length;if(!a&&c)return null;const l=(0,h.Rt)(o,{maxStringLength:200})||"<unknown>",u=Xe(o,l);return Be({category:"ui.keyDown",message:l,data:{...u.data,metaKey:e,shiftKey:n,ctrlKey:r,altKey:s,key:i}})}(e);n&&Me(t,n)}const Ke={resource:function(t){const{entryType:e,initiatorType:n,name:r,responseEnd:s,startTime:i,decodedBodySize:o,encodedBodySize:a,responseStatus:c,transferSize:l}=t;if(["fetch","xmlhttprequest"].includes(n))return null;return{type:`${e}.${n}`,start:Ye(i),end:Ye(s),name:r,data:{size:l,statusCode:c,decodedBodySize:o,encodedBodySize:a}}},paint:function(t){const{duration:e,entryType:n,name:r,startTime:s}=t,i=Ye(s);return{type:n,name:r,start:i,end:i+e,data:void 0}},navigation:function(t){const{entryType:e,name:n,decodedBodySize:r,duration:s,domComplete:i,encodedBodySize:o,domContentLoadedEventStart:a,domContentLoadedEventEnd:c,domInteractive:l,loadEventStart:u,loadEventEnd:d,redirectCount:h,startTime:p,transferSize:m,type:f}=t;if(0===s)return null;return{type:`${e}.${f}`,start:Ye(p),end:Ye(i),name:n,data:{size:m,decodedBodySize:r,encodedBodySize:o,duration:s,domInteractive:l,domContentLoadedEventStart:a,domContentLoadedEventEnd:c,loadEventStart:u,loadEventEnd:d,domComplete:i,redirectCount:h}}}};function Je(t){return Ke[t.entryType]?Ke[t.entryType](t):null}function Ye(t){return((p.Z1||T.performance.timeOrigin)+t)/1e3}function Ve(t){function e(e){t.performanceEntries.includes(e)||t.performanceEntries.push(e)}function n({entries:t}){t.forEach(e)}const r=[];return["navigation","paint","resource"].forEach((t=>{r.push((0,x._j)(t,n))})),r.push((0,x.$A)((({metric:e})=>{t.replayPerformanceEntries.push(function(t){const e=t.entries,n=e[e.length-1],r=n?n.element:void 0,s=t.value,i=Ye(s);return{type:"largest-contentful-paint",name:"largest-contentful-paint",start:i,end:i,data:{value:s,size:s,nodeId:r?Te.mirror.getId(r):void 0}}}(e))}))),()=>{r.forEach((t=>t()))}}const Qe="undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__,Ze='var t=Uint8Array,n=Uint16Array,r=Int32Array,e=new t([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),i=new t([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),a=new t([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),s=function(t,e){for(var i=new n(31),a=0;a<31;++a)i[a]=e+=1<<t[a-1];var s=new r(i[30]);for(a=1;a<30;++a)for(var o=i[a];o<i[a+1];++o)s[o]=o-i[a]<<5|a;return{b:i,r:s}},o=s(e,2),f=o.b,h=o.r;f[28]=258,h[258]=28;for(var l=s(i,0).r,u=new n(32768),c=0;c<32768;++c){var v=(43690&c)>>1|(21845&c)<<1;v=(61680&(v=(52428&v)>>2|(13107&v)<<2))>>4|(3855&v)<<4,u[c]=((65280&v)>>8|(255&v)<<8)>>1}var d=function(t,r,e){for(var i=t.length,a=0,s=new n(r);a<i;++a)t[a]&&++s[t[a]-1];var o,f=new n(r);for(a=1;a<r;++a)f[a]=f[a-1]+s[a-1]<<1;if(e){o=new n(1<<r);var h=15-r;for(a=0;a<i;++a)if(t[a])for(var l=a<<4|t[a],c=r-t[a],v=f[t[a]-1]++<<c,d=v|(1<<c)-1;v<=d;++v)o[u[v]>>h]=l}else for(o=new n(i),a=0;a<i;++a)t[a]&&(o[a]=u[f[t[a]-1]++]>>15-t[a]);return o},g=new t(288);for(c=0;c<144;++c)g[c]=8;for(c=144;c<256;++c)g[c]=9;for(c=256;c<280;++c)g[c]=7;for(c=280;c<288;++c)g[c]=8;var w=new t(32);for(c=0;c<32;++c)w[c]=5;var p=d(g,9,0),y=d(w,5,0),m=function(t){return(t+7)/8|0},b=function(n,r,e){return(null==r||r<0)&&(r=0),(null==e||e>n.length)&&(e=n.length),new t(n.subarray(r,e))},M=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],E=function(t,n,r){var e=new Error(n||M[t]);if(e.code=t,Error.captureStackTrace&&Error.captureStackTrace(e,E),!r)throw e;return e},z=function(t,n,r){r<<=7&n;var e=n/8|0;t[e]|=r,t[e+1]|=r>>8},A=function(t,n,r){r<<=7&n;var e=n/8|0;t[e]|=r,t[e+1]|=r>>8,t[e+2]|=r>>16},_=function(r,e){for(var i=[],a=0;a<r.length;++a)r[a]&&i.push({s:a,f:r[a]});var s=i.length,o=i.slice();if(!s)return{t:F,l:0};if(1==s){var f=new t(i[0].s+1);return f[i[0].s]=1,{t:f,l:1}}i.sort((function(t,n){return t.f-n.f})),i.push({s:-1,f:25001});var h=i[0],l=i[1],u=0,c=1,v=2;for(i[0]={s:-1,f:h.f+l.f,l:h,r:l};c!=s-1;)h=i[i[u].f<i[v].f?u++:v++],l=i[u!=c&&i[u].f<i[v].f?u++:v++],i[c++]={s:-1,f:h.f+l.f,l:h,r:l};var d=o[0].s;for(a=1;a<s;++a)o[a].s>d&&(d=o[a].s);var g=new n(d+1),w=x(i[c-1],g,0);if(w>e){a=0;var p=0,y=w-e,m=1<<y;for(o.sort((function(t,n){return g[n.s]-g[t.s]||t.f-n.f}));a<s;++a){var b=o[a].s;if(!(g[b]>e))break;p+=m-(1<<w-g[b]),g[b]=e}for(p>>=y;p>0;){var M=o[a].s;g[M]<e?p-=1<<e-g[M]++-1:++a}for(;a>=0&&p;--a){var E=o[a].s;g[E]==e&&(--g[E],++p)}w=e}return{t:new t(g),l:w}},x=function(t,n,r){return-1==t.s?Math.max(x(t.l,n,r+1),x(t.r,n,r+1)):n[t.s]=r},D=function(t){for(var r=t.length;r&&!t[--r];);for(var e=new n(++r),i=0,a=t[0],s=1,o=function(t){e[i++]=t},f=1;f<=r;++f)if(t[f]==a&&f!=r)++s;else{if(!a&&s>2){for(;s>138;s-=138)o(32754);s>2&&(o(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(o(a),--s;s>6;s-=6)o(8304);s>2&&(o(s-3<<5|8208),s=0)}for(;s--;)o(a);s=1,a=t[f]}return{c:e.subarray(0,i),n:r}},T=function(t,n){for(var r=0,e=0;e<n.length;++e)r+=t[e]*n[e];return r},k=function(t,n,r){var e=r.length,i=m(n+2);t[i]=255&e,t[i+1]=e>>8,t[i+2]=255^t[i],t[i+3]=255^t[i+1];for(var a=0;a<e;++a)t[i+a+4]=r[a];return 8*(i+4+e)},C=function(t,r,s,o,f,h,l,u,c,v,m){z(r,m++,s),++f[256];for(var b=_(f,15),M=b.t,E=b.l,x=_(h,15),C=x.t,U=x.l,F=D(M),I=F.c,S=F.n,L=D(C),O=L.c,j=L.n,q=new n(19),B=0;B<I.length;++B)++q[31&I[B]];for(B=0;B<O.length;++B)++q[31&O[B]];for(var G=_(q,7),H=G.t,J=G.l,K=19;K>4&&!H[a[K-1]];--K);var N,P,Q,R,V=v+5<<3,W=T(f,g)+T(h,w)+l,X=T(f,M)+T(h,C)+l+14+3*K+T(q,H)+2*q[16]+3*q[17]+7*q[18];if(c>=0&&V<=W&&V<=X)return k(r,m,t.subarray(c,c+v));if(z(r,m,1+(X<W)),m+=2,X<W){N=d(M,E,0),P=M,Q=d(C,U,0),R=C;var Y=d(H,J,0);z(r,m,S-257),z(r,m+5,j-1),z(r,m+10,K-4),m+=14;for(B=0;B<K;++B)z(r,m+3*B,H[a[B]]);m+=3*K;for(var Z=[I,O],$=0;$<2;++$){var tt=Z[$];for(B=0;B<tt.length;++B){var nt=31&tt[B];z(r,m,Y[nt]),m+=H[nt],nt>15&&(z(r,m,tt[B]>>5&127),m+=tt[B]>>12)}}}else N=p,P=g,Q=y,R=w;for(B=0;B<u;++B){var rt=o[B];if(rt>255){A(r,m,N[(nt=rt>>18&31)+257]),m+=P[nt+257],nt>7&&(z(r,m,rt>>23&31),m+=e[nt]);var et=31&rt;A(r,m,Q[et]),m+=R[et],et>3&&(A(r,m,rt>>5&8191),m+=i[et])}else A(r,m,N[rt]),m+=P[rt]}return A(r,m,N[256]),m+P[256]},U=new r([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),F=new t(0),I=function(){for(var t=new Int32Array(256),n=0;n<256;++n){for(var r=n,e=9;--e;)r=(1&r&&-306674912)^r>>>1;t[n]=r}return t}(),S=function(){var t=1,n=0;return{p:function(r){for(var e=t,i=n,a=0|r.length,s=0;s!=a;){for(var o=Math.min(s+2655,a);s<o;++s)i+=e+=r[s];e=(65535&e)+15*(e>>16),i=(65535&i)+15*(i>>16)}t=e,n=i},d:function(){return(255&(t%=65521))<<24|(65280&t)<<8|(255&(n%=65521))<<8|n>>8}}},L=function(a,s,o,f,u){if(!u&&(u={l:1},s.dictionary)){var c=s.dictionary.subarray(-32768),v=new t(c.length+a.length);v.set(c),v.set(a,c.length),a=v,u.w=c.length}return function(a,s,o,f,u,c){var v=c.z||a.length,d=new t(f+v+5*(1+Math.ceil(v/7e3))+u),g=d.subarray(f,d.length-u),w=c.l,p=7&(c.r||0);if(s){p&&(g[0]=c.r>>3);for(var y=U[s-1],M=y>>13,E=8191&y,z=(1<<o)-1,A=c.p||new n(32768),_=c.h||new n(z+1),x=Math.ceil(o/3),D=2*x,T=function(t){return(a[t]^a[t+1]<<x^a[t+2]<<D)&z},F=new r(25e3),I=new n(288),S=new n(32),L=0,O=0,j=c.i||0,q=0,B=c.w||0,G=0;j+2<v;++j){var H=T(j),J=32767&j,K=_[H];if(A[J]=K,_[H]=J,B<=j){var N=v-j;if((L>7e3||q>24576)&&(N>423||!w)){p=C(a,g,0,F,I,S,O,q,G,j-G,p),q=L=O=0,G=j;for(var P=0;P<286;++P)I[P]=0;for(P=0;P<30;++P)S[P]=0}var Q=2,R=0,V=E,W=J-K&32767;if(N>2&&H==T(j-W))for(var X=Math.min(M,N)-1,Y=Math.min(32767,j),Z=Math.min(258,N);W<=Y&&--V&&J!=K;){if(a[j+Q]==a[j+Q-W]){for(var $=0;$<Z&&a[j+$]==a[j+$-W];++$);if($>Q){if(Q=$,R=W,$>X)break;var tt=Math.min(W,$-2),nt=0;for(P=0;P<tt;++P){var rt=j-W+P&32767,et=rt-A[rt]&32767;et>nt&&(nt=et,K=rt)}}}W+=(J=K)-(K=A[J])&32767}if(R){F[q++]=268435456|h[Q]<<18|l[R];var it=31&h[Q],at=31&l[R];O+=e[it]+i[at],++I[257+it],++S[at],B=j+Q,++L}else F[q++]=a[j],++I[a[j]]}}for(j=Math.max(j,B);j<v;++j)F[q++]=a[j],++I[a[j]];p=C(a,g,w,F,I,S,O,q,G,j-G,p),w||(c.r=7&p|g[p/8|0]<<3,p-=7,c.h=_,c.p=A,c.i=j,c.w=B)}else{for(j=c.w||0;j<v+w;j+=65535){var st=j+65535;st>=v&&(g[p/8|0]=w,st=v),p=k(g,p+1,a.subarray(j,st))}c.i=v}return b(d,0,f+m(p)+u)}(a,null==s.level?6:s.level,null==s.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(a.length)))):12+s.mem,o,f,u)},O=function(t,n,r){for(;r;++n)t[n]=r,r>>>=8},j=function(){function n(n,r){if("function"==typeof n&&(r=n,n={}),this.ondata=r,this.o=n||{},this.s={l:0,i:32768,w:32768,z:32768},this.b=new t(98304),this.o.dictionary){var e=this.o.dictionary.subarray(-32768);this.b.set(e,32768-e.length),this.s.i=32768-e.length}}return n.prototype.p=function(t,n){this.ondata(L(t,this.o,0,0,this.s),n)},n.prototype.push=function(n,r){this.ondata||E(5),this.s.l&&E(4);var e=n.length+this.s.z;if(e>this.b.length){if(e>2*this.b.length-32768){var i=new t(-32768&e);i.set(this.b.subarray(0,this.s.z)),this.b=i}var a=this.b.length-this.s.z;a&&(this.b.set(n.subarray(0,a),this.s.z),this.s.z=this.b.length,this.p(this.b,!1)),this.b.set(this.b.subarray(-32768)),this.b.set(n.subarray(a),32768),this.s.z=n.length-a+32768,this.s.i=32766,this.s.w=32768}else this.b.set(n,this.s.z),this.s.z+=n.length;this.s.l=1&r,(this.s.z>this.s.w+8191||r)&&(this.p(this.b,r||!1),this.s.w=this.s.i,this.s.i-=2)},n}();function q(t,n){n||(n={});var r=function(){var t=-1;return{p:function(n){for(var r=t,e=0;e<n.length;++e)r=I[255&r^n[e]]^r>>>8;t=r},d:function(){return~t}}}(),e=t.length;r.p(t);var i,a=L(t,n,10+((i=n).filename?i.filename.length+1:0),8),s=a.length;return function(t,n){var r=n.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=n.level<2?4:9==n.level?2:0,t[9]=3,0!=n.mtime&&O(t,4,Math.floor(new Date(n.mtime||Date.now())/1e3)),r){t[3]=8;for(var e=0;e<=r.length;++e)t[e+10]=r.charCodeAt(e)}}(a,n),O(a,s-8,r.d()),O(a,s-4,e),a}var B=function(){function t(t,n){this.c=S(),this.v=1,j.call(this,t,n)}return t.prototype.push=function(t,n){this.c.p(t),j.prototype.push.call(this,t,n)},t.prototype.p=function(t,n){var r=L(t,this.o,this.v&&(this.o.dictionary?6:2),n&&4,this.s);this.v&&(function(t,n){var r=n.level,e=0==r?0:r<6?1:9==r?3:2;if(t[0]=120,t[1]=e<<6|(n.dictionary&&32),t[1]|=31-(t[0]<<8|t[1])%31,n.dictionary){var i=S();i.p(n.dictionary),O(t,2,i.d())}}(r,this.o),this.v=0),n&&O(r,r.length-4,this.c.d()),this.ondata(r,n)},t}(),G="undefined"!=typeof TextEncoder&&new TextEncoder,H="undefined"!=typeof TextDecoder&&new TextDecoder;try{H.decode(F,{stream:!0})}catch(t){}var J=function(){function t(t){this.ondata=t}return t.prototype.push=function(t,n){this.ondata||E(5),this.d&&E(4),this.ondata(K(t),this.d=n||!1)},t}();function K(n,r){if(r){for(var e=new t(n.length),i=0;i<n.length;++i)e[i]=n.charCodeAt(i);return e}if(G)return G.encode(n);var a=n.length,s=new t(n.length+(n.length>>1)),o=0,f=function(t){s[o++]=t};for(i=0;i<a;++i){if(o+5>s.length){var h=new t(o+8+(a-i<<1));h.set(s),s=h}var l=n.charCodeAt(i);l<128||r?f(l):l<2048?(f(192|l>>6),f(128|63&l)):l>55295&&l<57344?(f(240|(l=65536+(1047552&l)|1023&n.charCodeAt(++i))>>18),f(128|l>>12&63),f(128|l>>6&63),f(128|63&l)):(f(224|l>>12),f(128|l>>6&63),f(128|63&l))}return b(s,0,o)}const N=new class{constructor(){this._init()}clear(){this._init()}addEvent(t){if(!t)throw new Error("Adding invalid event");const n=this._hasEvents?",":"";this.stream.push(n+t),this._hasEvents=!0}finish(){this.stream.push("]",!0);const t=function(t){let n=0;for(let r=0,e=t.length;r<e;r++)n+=t[r].length;const r=new Uint8Array(n);for(let n=0,e=0,i=t.length;n<i;n++){const i=t[n];r.set(i,e),e+=i.length}return r}(this._deflatedData);return this._init(),t}_init(){this._hasEvents=!1,this._deflatedData=[],this.deflate=new B,this.deflate.ondata=(t,n)=>{this._deflatedData.push(t)},this.stream=new J(((t,n)=>{this.deflate.push(t,n)})),this.stream.push("[")}},P={clear:()=>{N.clear()},addEvent:t=>N.addEvent(t),finish:()=>N.finish(),compress:t=>function(t){return q(K(t))}(t)};addEventListener("message",(function(t){const n=t.data.method,r=t.data.id,e=t.data.arg;if(n in P&&"function"==typeof P[n])try{const t=P[n](e);postMessage({id:r,method:n,success:!0,response:t})}catch(t){postMessage({id:r,method:n,success:!1,response:t.message}),console.error(t)}})),postMessage({id:void 0,method:"init",success:!0,response:void 0});';function tn(t,e){Qe&&(m.kg.info(t),e&&nn(t))}function en(t,e){Qe&&(m.kg.info(t),e&&setTimeout((()=>{nn(t)}),0))}function nn(t){(0,r.Gd)().addBreadcrumb({category:"console",data:{logger:"replay"},level:"info",message:t},{level:"info"})}class rn extends Error{constructor(){super("Event buffer exceeded maximum size of 20000000.")}}class sn{constructor(){this.events=[],this._totalSize=0,this.hasCheckout=!1}get hasEvents(){return this.events.length>0}get type(){return"sync"}destroy(){this.events=[]}async addEvent(t){const e=JSON.stringify(t).length;if(this._totalSize+=e,this._totalSize>D)throw new rn;this.events.push(t)}finish(){return new Promise((t=>{const e=this.events;this.clear(),t(JSON.stringify(e))}))}clear(){this.events=[],this._totalSize=0,this.hasCheckout=!1}getEarliestTimestamp(){const t=this.events.map((t=>t.timestamp)).sort()[0];return t?Ce(t):null}}class on{constructor(t){this._worker=t,this._id=0}ensureReady(){return this._ensureReadyPromise||(this._ensureReadyPromise=new Promise(((t,e)=>{this._worker.addEventListener("message",(({data:n})=>{n.success?t():e()}),{once:!0}),this._worker.addEventListener("error",(t=>{e(t)}),{once:!0})}))),this._ensureReadyPromise}destroy(){tn("[Replay] Destroying compression worker"),this._worker.terminate()}postMessage(t,e){const n=this._getAndIncrementId();return new Promise(((r,s)=>{const i=({data:e})=>{const o=e;if(o.method===t&&o.id===n){if(this._worker.removeEventListener("message",i),!o.success)return Qe&&m.kg.error("[Replay]",o.response),void s(new Error("Error in compression worker"));r(o.response)}};this._worker.addEventListener("message",i),this._worker.postMessage({id:n,method:t,arg:e})}))}_getAndIncrementId(){return this._id++}}class an{constructor(t){this._worker=new on(t),this._earliestTimestamp=null,this._totalSize=0,this.hasCheckout=!1}get hasEvents(){return!!this._earliestTimestamp}get type(){return"worker"}ensureReady(){return this._worker.ensureReady()}destroy(){this._worker.destroy()}addEvent(t){const e=Ce(t.timestamp);(!this._earliestTimestamp||e<this._earliestTimestamp)&&(this._earliestTimestamp=e);const n=JSON.stringify(t);return this._totalSize+=n.length,this._totalSize>D?Promise.reject(new rn):this._sendEventToWorker(n)}finish(){return this._finishRequest()}clear(){this._earliestTimestamp=null,this._totalSize=0,this.hasCheckout=!1,this._worker.postMessage("clear")}getEarliestTimestamp(){return this._earliestTimestamp}_sendEventToWorker(t){return this._worker.postMessage("addEvent",t)}async _finishRequest(){const t=await this._worker.postMessage("finish");return this._earliestTimestamp=null,this._totalSize=0,t}}class cn{constructor(t){this._fallback=new sn,this._compression=new an(t),this._used=this._fallback,this._ensureWorkerIsLoadedPromise=this._ensureWorkerIsLoaded()}get type(){return this._used.type}get hasEvents(){return this._used.hasEvents}get hasCheckout(){return this._used.hasCheckout}set hasCheckout(t){this._used.hasCheckout=t}destroy(){this._fallback.destroy(),this._compression.destroy()}clear(){return this._used.clear()}getEarliestTimestamp(){return this._used.getEarliestTimestamp()}addEvent(t){return this._used.addEvent(t)}async finish(){return await this.ensureWorkerIsLoaded(),this._used.finish()}ensureWorkerIsLoaded(){return this._ensureWorkerIsLoadedPromise}async _ensureWorkerIsLoaded(){try{await this._compression.ensureReady()}catch(t){return void tn("[Replay] Failed to load the compression worker, falling back to simple buffer")}await this._switchToCompressionWorker()}async _switchToCompressionWorker(){const{events:t,hasCheckout:e}=this._fallback,n=[];for(const s of t)n.push(this._compression.addEvent(s));this._compression.hasCheckout=e,this._used=this._compression;try{await Promise.all(n)}catch(r){Qe&&m.kg.warn("[Replay] Failed to add events when switching buffers.",r)}}}function ln({useCompression:t,workerUrl:e}){if(t&&window.Worker){const t=function(t){try{const e=t||function(){if("undefined"===typeof __SENTRY_EXCLUDE_REPLAY_WORKER__||!__SENTRY_EXCLUDE_REPLAY_WORKER__)return function(){const t=new Blob([Ze]);return URL.createObjectURL(t)}();return""}();if(!e)return;tn("[Replay] Using compression worker"+(t?` from ${t}`:""));const n=new Worker(e);return new cn(n)}catch(e){tn("[Replay] Failed to create compression worker")}}(e);if(t)return t}return tn("[Replay] Using simple buffer"),new sn}function un(){try{return"sessionStorage"in T&&!!T.sessionStorage}catch(t){return!1}}function dn(t){!function(){if(!un())return;try{T.sessionStorage.removeItem(I)}catch(t){}}(),t.session=void 0}function hn(t){return void 0!==t&&Math.random()<t}function pn(t){const e=Date.now();return{id:t.id||(0,f.DM)(),started:t.started||e,lastActivity:t.lastActivity||e,segmentId:t.segmentId||0,sampled:t.sampled,previousSessionId:t.previousSessionId}}function mn(t){if(un())try{T.sessionStorage.setItem(I,JSON.stringify(t))}catch(e){}}function fn({sessionSampleRate:t,allowBuffering:e,stickySession:n=!1},{previousSessionId:r}={}){const s=function(t,e){return hn(t)?"session":!!e&&"buffer"}(t,e),i=pn({sampled:s,previousSessionId:r});return n&&mn(i),i}function gn(t,e,n=+new Date){return null===t||void 0===e||e<0||0!==e&&t+e<=n}function yn(t,{maxReplayDuration:e,sessionIdleExpire:n,targetTime:r=Date.now()}){return gn(t.started,e,r)||gn(t.lastActivity,n,r)}function _n(t,{sessionIdleExpire:e,maxReplayDuration:n}){return!!yn(t,{sessionIdleExpire:e,maxReplayDuration:n})&&("buffer"!==t.sampled||0!==t.segmentId)}function vn({traceInternals:t,sessionIdleExpire:e,maxReplayDuration:n,previousSessionId:r},s){const i=s.stickySession&&function(t){if(!un())return null;try{const e=T.sessionStorage.getItem(I);if(!e)return null;const n=JSON.parse(e);return en("[Replay] Loading existing session",t),pn(n)}catch(e){return null}}(t);return i?_n(i,{sessionIdleExpire:e,maxReplayDuration:n})?(en("[Replay] Session in sessionStorage is expired, creating new one..."),fn(s,{previousSessionId:i.id})):i:(en("[Replay] Creating new session",t),fn(s,{previousSessionId:r}))}function Sn(t,e,n){return!!bn(t,e)&&(kn(t,e,n),!0)}async function kn(t,e,n){if(!t.eventBuffer)return null;try{n&&"buffer"===t.recordingMode&&t.eventBuffer.clear(),n&&(t.eventBuffer.hasCheckout=!0);const r=function(t,e){try{if("function"===typeof e&&function(t){return t.type===Ft.Custom}(t))return e(t)}catch(n){return Qe&&m.kg.error("[Replay] An error occured in the `beforeAddRecordingEvent` callback, skipping the event...",n),null}return t}(e,t.getOptions().beforeAddRecordingEvent);if(!r)return;return await t.eventBuffer.addEvent(r)}catch(r){const e=r&&r instanceof rn?"addEventSizeExceeded":"addEvent";Qe&&m.kg.error(r),await t.stop({reason:e});const n=(0,s.s3)();n&&n.recordDroppedEvent("internal_sdk_error","replay")}}function bn(t,e){if(!t.eventBuffer||t.isPaused()||!t.isEnabled())return!1;const n=Ce(e.timestamp);return!(n+t.timeouts.sessionIdlePause<Date.now())&&(!(n>t.getContext().initialTimestamp+t.getOptions().maxReplayDuration)||(tn(`[Replay] Skipping event with timestamp ${n} because it is after maxReplayDuration`,t.getOptions()._experiments.traceInternals),!1))}function wn(t){return!t.type}function En(t){return"transaction"===t.type}function xn(t){return"feedback"===t.type}function Tn(t){const e=function(){const t=(0,s.s3)();if(!t)return!1;const e=t.getTransport();if(!e)return!1;return e.send.__sentry__baseTransport__||!1}();return(n,r)=>{if(!t.isEnabled()||!wn(n)&&!En(n))return;const s=r&&r.statusCode;e&&(!s||s<200||s>=300)||(En(n)?function(t,e){const n=t.getContext();e.contexts&&e.contexts.trace&&e.contexts.trace.trace_id&&n.traceIds.size<100&&n.traceIds.add(e.contexts.trace.trace_id)}(t,n):function(t,e){const n=t.getContext();e.event_id&&n.errorIds.size<100&&n.errorIds.add(e.event_id);if("buffer"!==t.recordingMode||!e.tags||!e.tags.replayId)return;const{beforeErrorSampling:r}=t.getOptions();if("function"===typeof r&&!r(e))return;setTimeout((()=>{t.sendBufferedReplayOrFlush()}))}(t,n))}}function In(t,e=!1){const n=e?Tn(t):void 0;return Object.assign(((e,r)=>{if(!t.isEnabled())return e;if(function(t){return"replay_event"===t.type}(e))return delete e.breadcrumbs,e;if(!wn(e)&&!En(e)&&!xn(e))return e;if(!t.checkAndHandleExpiredSession())return e;if(xn(e))return t.flush(),e.contexts.feedback.replay_id=t.getSessionId(),function(t,e){t.triggerUserActivity(),t.addUpdate((()=>!e.timestamp||(t.throttledAddEvent({type:Ft.Custom,timestamp:1e3*e.timestamp,data:{timestamp:e.timestamp,tag:"breadcrumb",payload:{category:"sentry.feedback",data:{feedbackId:e.event_id}}}}),!1)))}(t,e),e;if(function(t,e){return!(t.type||!t.exception||!t.exception.values||!t.exception.values.length)&&!(!e.originalException||!e.originalException.__rrweb__)}(e,r)&&!t.getOptions()._experiments.captureExceptions)return Qe&&m.kg.log("[Replay] Ignoring error from rrweb internals",e),null;const s=function(t,e){return"buffer"===t.recordingMode&&e.message!==R&&!(!e.exception||e.type)&&hn(t.getOptions().errorSampleRate)}(t,e);return(s||"session"===t.recordingMode)&&(e.tags={...e.tags,replayId:t.getSessionId()}),n&&n(e,{statusCode:200}),e}),{id:"Replay"})}function Cn(t,e){return e.map((({type:e,start:n,end:r,name:s,data:i})=>{const o=t.throttledAddEvent({type:Ft.Custom,timestamp:n,data:{tag:"performanceSpan",payload:{op:e,description:s,startTimestamp:n,endTimestamp:r,data:i}}});return"string"===typeof o?Promise.resolve(null):o}))}function Rn(t){return e=>{if(!t.isEnabled())return;const n=function(t){const{from:e,to:n}=t,r=Date.now()/1e3;return{type:"navigation.push",start:r,end:r,name:n,data:{previous:e}}}(e);null!==n&&(t.getContext().urls.push(n.name),t.triggerUserActivity(),t.addUpdate((()=>(Cn(t,[n]),!1))))}}function Mn(t,e){t.isEnabled()&&null!==e&&(function(t,e){return(!Qe||!t.getOptions()._experiments.traceInternals)&&i(e,(0,r.Gd)())}(t,e.name)||t.addUpdate((()=>(Cn(t,[e]),!0))))}function On(t){return e=>{if(!t.isEnabled())return;const n=function(t){const{startTimestamp:e,endTimestamp:n,xhr:r}=t,s=r[g.xU];if(!e||!n||!s)return null;const{method:i,url:o,status_code:a}=s;return void 0===o?null:{type:"resource.xhr",name:o,start:e/1e3,end:n/1e3,data:{method:i,statusCode:a}}}(e);Mn(t,n)}}function Dn(t,e){if(t)try{if("string"===typeof t)return e.encode(t).length;if(t instanceof URLSearchParams)return e.encode(t.toString()).length;if(t instanceof FormData){const n=Un(t);return e.encode(n).length}if(t instanceof Blob)return t.size;if(t instanceof ArrayBuffer)return t.byteLength}catch(n){}}function An(t){if(!t)return;const e=parseInt(t,10);return isNaN(e)?void 0:e}function Nn(t){try{if("string"===typeof t)return[t];if(t instanceof URLSearchParams)return[t.toString()];if(t instanceof FormData)return[Un(t)];if(!t)return[void 0]}catch(e){return Qe&&m.kg.warn("[Replay] Failed to serialize body",t),[void 0,"BODY_PARSE_ERROR"]}return Qe&&m.kg.info("[Replay] Skipping network body because of body type",t),[void 0,"UNPARSEABLE_BODY_TYPE"]}function Ln(t,e){if(!t)return{headers:{},size:void 0,_meta:{warnings:[e]}};const n={...t._meta},r=n.warnings||[];return n.warnings=[...r,e],t._meta=n,t}function $n(t,e){if(!e)return null;const{startTimestamp:n,endTimestamp:r,url:s,method:i,statusCode:o,request:a,response:c}=e;return{type:t,start:n/1e3,end:r/1e3,name:s,data:(0,d.Jr)({method:i,statusCode:o,request:a,response:c})}}function Pn(t){return{headers:{},size:t,_meta:{warnings:["URL_SKIPPED"]}}}function Fn(t,e,n){if(!e&&0===Object.keys(t).length)return;if(!e)return{headers:t};if(!n)return{headers:t,size:e};const r={headers:t,size:e},{body:s,warnings:i}=function(t){if(!t||"string"!==typeof t)return{body:t};const e=t.length>M,n=function(t){const e=t[0],n=t[t.length-1];return"["===e&&"]"===n||"{"===e&&"}"===n}(t);if(e){const e=t.slice(0,M);return n?{body:e,warnings:["MAYBE_JSON_TRUNCATED"]}:{body:`${e}\u2026`,warnings:["TEXT_TRUNCATED"]}}if(n)try{return{body:JSON.parse(t)}}catch(r){}return{body:t}}(n);return r.body=s,i&&i.length>0&&(r._meta={warnings:i}),r}function jn(t,e){return Object.keys(t).reduce(((n,r)=>{const s=r.toLowerCase();return e.includes(s)&&t[r]&&(n[s]=t[r]),n}),{})}function Un(t){return new URLSearchParams(t).toString()}function Bn(t,e){const n=function(t,e=T.document.baseURI){if(t.startsWith("http://")||t.startsWith("https://")||t.startsWith(T.location.origin))return t;const n=new URL(t,e);if(n.origin!==new URL(e).origin)return t;const r=n.href;if(!t.endsWith("/")&&r.endsWith("/"))return r.slice(0,-1);return r}(t);return(0,y.U0)(n,e)}async function Hn(t,e,n){try{const r=await async function(t,e,n){const r=Date.now(),{startTimestamp:s=r,endTimestamp:i=r}=e,{url:o,method:a,status_code:c=0,request_body_size:l,response_body_size:u}=t.data,d=Bn(o,n.networkDetailAllowUrls)&&!Bn(o,n.networkDetailDenyUrls),h=d?function({networkCaptureBodies:t,networkRequestHeaders:e},n,r){const s=n?function(t,e){if(1===t.length&&"string"!==typeof t[0])return qn(t[0],e);if(2===t.length)return qn(t[1],e);return{}}(n,e):{};if(!t)return Fn(s,r,void 0);const i=zn(n),[o,a]=Nn(i),c=Fn(s,r,o);if(a)return Ln(c,a);return c}(n,e.input,l):Pn(l),p=await async function(t,{networkCaptureBodies:e,textEncoder:n,networkResponseHeaders:r},s,i){if(!t&&void 0!==i)return Pn(i);const o=s?Wn(s.headers,r):{};if(!s||!e&&void 0!==i)return Fn(o,i,void 0);const[a,c]=await async function(t){const e=function(t){try{return t.clone()}catch(e){Qe&&m.kg.warn("[Replay] Failed to clone response body",e)}}(t);if(!e)return[void 0,"BODY_PARSE_ERROR"];try{const t=await function(t){return new Promise(((e,n)=>{const r=setTimeout((()=>n(new Error("Timeout while trying to read response body"))),500);(async function(t){return await t.text()})(t).then((t=>e(t)),(t=>n(t))).finally((()=>clearTimeout(r)))}))}(e);return[t]}catch(n){return Qe&&m.kg.warn("[Replay] Failed to get text body from response",n),[void 0,"BODY_PARSE_ERROR"]}}(s),l=function(t,{networkCaptureBodies:e,textEncoder:n,responseBodySize:r,captureDetails:s,headers:i}){try{const o=t&&t.length&&void 0===r?Dn(t,n):r;return s?Fn(i,o,e?t:void 0):Pn(o)}catch(o){return Qe&&m.kg.warn("[Replay] Failed to serialize response body",o),Fn(i,r,void 0)}}(a,{networkCaptureBodies:e,textEncoder:n,responseBodySize:i,captureDetails:t,headers:o});if(c)return Ln(l,c);return l}(d,n,e.response,u);return{startTimestamp:s,endTimestamp:i,url:o,method:a,statusCode:c,request:h,response:p}}(t,e,n),s=$n("resource.fetch",r);Mn(n.replay,s)}catch(r){Qe&&m.kg.error("[Replay] Failed to capture fetch breadcrumb",r)}}function zn(t=[]){if(2===t.length&&"object"===typeof t[1])return t[1].body}function Wn(t,e){const n={};return e.forEach((e=>{t.get(e)&&(n[e]=t.get(e))})),n}function qn(t,e){if(!t)return{};const n=t.headers;return n?n instanceof Headers?Wn(n,e):Array.isArray(n)?{}:jn(n,e):{}}async function Xn(t,e,n){try{const r=function(t,e,n){const r=Date.now(),{startTimestamp:s=r,endTimestamp:i=r,input:o,xhr:a}=e,{url:c,method:l,status_code:u=0,request_body_size:d,response_body_size:h}=t.data;if(!c)return null;if(!a||!Bn(c,n.networkDetailAllowUrls)||Bn(c,n.networkDetailDenyUrls)){return{startTimestamp:s,endTimestamp:i,url:c,method:l,statusCode:u,request:Pn(d),response:Pn(h)}}const p=a[g.xU],f=p?jn(p.request_headers,n.networkRequestHeaders):{},y=jn(function(t){const e=t.getAllResponseHeaders();if(!e)return{};return e.split("\r\n").reduce(((t,e)=>{const[n,r]=e.split(": ");return t[n.toLowerCase()]=r,t}),{})}(a),n.networkResponseHeaders),[_,v]=n.networkCaptureBodies?Nn(o):[void 0],[S,k]=n.networkCaptureBodies?function(t){const e=[];try{return[t.responseText]}catch(n){e.push(n)}try{return function(t,e){try{if("string"===typeof t)return[t];if(t instanceof Document)return[t.body.outerHTML];if("json"===e&&t&&"object"===typeof t)return[JSON.stringify(t)];if(!t)return[void 0]}catch(n){return Qe&&m.kg.warn("[Replay] Failed to serialize body",t),[void 0,"BODY_PARSE_ERROR"]}return Qe&&m.kg.info("[Replay] Skipping network body because of body type",t),[void 0,"UNPARSEABLE_BODY_TYPE"]}(t.response,t.responseType)}catch(n){e.push(n)}return Qe&&m.kg.warn("[Replay] Failed to get xhr response body",...e),[void 0]}(a):[void 0],b=Fn(f,d,_),w=Fn(y,h,S);return{startTimestamp:s,endTimestamp:i,url:c,method:l,statusCode:u,request:v?Ln(b,v):b,response:k?Ln(w,k):w}}(t,e,n),s=$n("resource.xhr",r);Mn(n.replay,s)}catch(r){Qe&&m.kg.error("[Replay] Failed to capture xhr breadcrumb",r)}}function Gn(t,e,n){const{xhr:r,input:s}=e;if(!r)return;const i=Dn(s,n.textEncoder),o=r.getResponseHeader("content-length")?An(r.getResponseHeader("content-length")):function(t,e,n){try{return Dn("json"===e&&t&&"object"===typeof t?JSON.stringify(t):t,n)}catch(r){return}}(r.response,r.responseType,n.textEncoder);void 0!==i&&(t.data.request_body_size=i),void 0!==o&&(t.data.response_body_size=o)}function Kn(t){const e=(0,s.s3)();try{const n=new TextEncoder,{networkDetailAllowUrls:r,networkDetailDenyUrls:s,networkCaptureBodies:i,networkRequestHeaders:o,networkResponseHeaders:a}=t.getOptions(),c={replay:t,textEncoder:n,networkDetailAllowUrls:r,networkDetailDenyUrls:s,networkCaptureBodies:i,networkRequestHeaders:o,networkResponseHeaders:a};e&&e.on?e.on("beforeAddBreadcrumb",((t,e)=>function(t,e,n){if(!e.data)return;try{(function(t){return"xhr"===t.category})(e)&&function(t){return t&&t.xhr}(n)&&(Gn(e,n,t),Xn(e,n,t)),function(t){return"fetch"===t.category}(e)&&function(t){return t&&t.response}(n)&&(!function(t,e,n){const{input:r,response:s}=e,i=Dn(r?zn(r):void 0,n.textEncoder),o=s?An(s.headers.get("content-length")):void 0;void 0!==i&&(t.data.request_body_size=i),void 0!==o&&(t.data.response_body_size=o)}(e,n,t),Hn(e,n,t))}catch(r){Qe&&m.kg.warn("Error when enriching network breadcrumb")}}(c,t,e))):((0,_.U)(function(t){return e=>{if(!t.isEnabled())return;const n=function(t){const{startTimestamp:e,endTimestamp:n,fetchData:r,response:s}=t;if(!n)return null;const{method:i,url:o}=r;return{type:"resource.fetch",start:e/1e3,end:n/1e3,name:o,data:{method:i,statusCode:s?s.status:void 0}}}(e);Mn(t,n)}}(t)),(0,g.UK)(On(t)))}catch(n){}}let Jn=null;const Yn=t=>e=>{if(!t.isEnabled())return;const n=function(t){const e=t.getLastBreadcrumb&&t.getLastBreadcrumb();if(Jn===e||!e)return null;if(Jn=e,!function(t){return!!t.category}(e)||["fetch","xhr","sentry.event","sentry.transaction"].includes(e.category)||e.category.startsWith("ui."))return null;if("console"===e.category)return function(t){const e=t.data&&t.data.arguments;if(!Array.isArray(e)||0===e.length)return Be(t);let n=!1;const r=e.map((t=>{if(!t)return t;if("string"===typeof t)return t.length>O?(n=!0,`${t.slice(0,O)}\u2026`):t;if("object"===typeof t)try{const e=(0,u.Fv)(t,7);return JSON.stringify(e).length>O?(n=!0,`${JSON.stringify(e,null,2).slice(0,O)}\u2026`):e}catch(e){}return t}));return Be({...t,data:{...t.data,arguments:r,...n?{_meta:{warnings:["CONSOLE_ARG_TRUNCATED"]}}:{}}})}(e);return Be(e)}(e);n&&Me(t,n)};function Vn(t){return!(!t||!t.on)}function Qn(t){const{jsHeapSizeLimit:e,totalJSHeapSize:n,usedJSHeapSize:r}=t,s=Date.now()/1e3;return{type:"memory",name:"memory",start:s,end:s,data:{memory:{jsHeapSizeLimit:e,totalJSHeapSize:n,usedJSHeapSize:r}}}}function Zn(t){let e=!1;return(n,r)=>{if(!t.checkAndHandleExpiredSession())return void(Qe&&m.kg.warn("[Replay] Received replay event after session expired."));const s=r||!e;e=!0,t.clickDetector&&Ue(t.clickDetector,n),t.addUpdate((()=>{if("buffer"===t.recordingMode&&s&&t.setInitialState(),!Sn(t,n,s))return!0;if(!s)return!1;if(function(t,e){if(!e||!t.session||0!==t.session.segmentId)return;Sn(t,function(t){const e=t.getOptions();return{type:Ft.Custom,timestamp:Date.now(),data:{tag:"options",payload:{sessionSampleRate:e.sessionSampleRate,errorSampleRate:e.errorSampleRate,useCompressionOption:e.useCompression,blockAllMedia:e.blockAllMedia,maskAllText:e.maskAllText,maskAllInputs:e.maskAllInputs,useCompression:!!t.eventBuffer&&"worker"===t.eventBuffer.type,networkDetailHasUrls:e.networkDetailAllowUrls.length>0,networkCaptureBodies:e.networkCaptureBodies,networkRequestHasHeaders:e.networkRequestHeaders.length>0,networkResponseHasHeaders:e.networkResponseHeaders.length>0}}}}(t),!1)}(t,s),t.session&&t.session.previousSessionId)return!0;if("buffer"===t.recordingMode&&t.session&&t.eventBuffer){const e=t.eventBuffer.getEarliestTimestamp();e&&(tn(`[Replay] Updating session start time to earliest event in buffer to ${new Date(e)}`,t.getOptions()._experiments.traceInternals),t.session.started=e,t.getOptions().stickySession&&mn(t.session))}return"session"===t.recordingMode&&t.flush(),!0}))}}function tr(t,e,n,r){return(0,k.Jd)((0,k.Cd)(t,(0,k.HY)(t),r,n),[[{type:"replay_event"},t],[{type:"replay_recording",length:"string"===typeof e?(new TextEncoder).encode(e).length:e.length},e]])}async function er({recordingData:t,replayId:e,segmentId:n,eventContext:s,timestamp:i,session:o}){const a=function({recordingData:t,headers:e}){let n;const r=`${JSON.stringify(e)}\n`;if("string"===typeof t)n=`${r}${t}`;else{const e=(new TextEncoder).encode(r);n=new Uint8Array(e.length+t.length),n.set(e),n.set(t,e.length)}return n}({recordingData:t,headers:{segment_id:n}}),{urls:l,errorIds:u,traceIds:d,initialTimestamp:h}=s,p=(0,r.Gd)(),m=p.getClient(),f=p.getScope(),g=m&&m.getTransport(),y=m&&m.getDsn();if(!m||!g||!y||!o.sampled)return;const _={type:C,replay_start_timestamp:h/1e3,timestamp:i/1e3,error_ids:u,trace_ids:d,urls:l,replay_id:e,segment_id:n,replay_type:o.sampled},v=await async function({client:t,scope:e,replayId:n,event:r}){const s={event_id:n,integrations:"object"!==typeof t._integrations||null===t._integrations||Array.isArray(t._integrations)?void 0:Object.keys(t._integrations)};t.emit&&t.emit("preprocessEvent",r,s);const i=await(0,c.R)(t.getOptions(),r,s,e,t);if(!i)return null;i.platform=i.platform||"javascript";const o=t.getSdkMetadata&&t.getSdkMetadata(),{name:a,version:l}=o&&o.sdk||{};return i.sdk={...i.sdk,name:a||"sentry.javascript.unknown",version:l||"0.0.0"},i}({scope:f,client:m,replayId:e,event:_});if(!v)return m.recordDroppedEvent("event_processor","replay",_),void tn("An event processor returned `null`, will not send event.");delete v.sdkProcessingMetadata;const S=tr(v,a,y,m.getOptions().tunnel);let k;try{k=await g.send(S)}catch(E){const t=new Error(R);try{t.cause=E}catch(x){}throw t}if(!k)return k;if("number"===typeof k.statusCode&&(k.statusCode<200||k.statusCode>=300))throw new nr(k.statusCode);const w=(0,b.WG)({},k);if((0,b.Q)(w,"replay"))throw new rr(w);return k}class nr extends Error{constructor(t){super(`Transport returned status code ${t}`)}}class rr extends Error{constructor(t){super("Rate limit hit"),this.rateLimits=t}}async function sr(t,e={count:0,interval:5e3}){const{recordingData:n,options:r}=t;if(n.length)try{return await er(t),!0}catch(i){if(i instanceof nr||i instanceof rr)throw i;if((0,s.v)("Replays",{_retryCount:e.count}),Qe&&r._experiments&&r._experiments.captureExceptions&&(0,s.Tb)(i),e.count>=3){const t=new Error(`${R} - max retries exceeded`);try{t.cause=i}catch(o){}throw t}return e.interval*=++e.count,new Promise(((n,r)=>{setTimeout((async()=>{try{await sr(t,e),n(!0)}catch(i){r(i)}}),e.interval)}))}}const ir="__THROTTLED";function or(t,e,n){const r=new Map;let s=!1;return(...i)=>{const o=Math.floor(Date.now()/1e3);if((t=>{const e=t-n;r.forEach(((t,n)=>{n<e&&r.delete(n)}))})(o),[...r.values()].reduce(((t,e)=>t+e),0)>=e){const t=s;return s=!0,t?"__SKIPPED":ir}s=!1;const a=r.get(o)||0;return r.set(o,a+1),t(...i)}}class ar{constructor({options:t,recordingOptions:e}){ar.prototype.__init.call(this),ar.prototype.__init2.call(this),ar.prototype.__init3.call(this),ar.prototype.__init4.call(this),ar.prototype.__init5.call(this),ar.prototype.__init6.call(this),this.eventBuffer=null,this.performanceEntries=[],this.replayPerformanceEntries=[],this.recordingMode="session",this.timeouts={sessionIdlePause:3e5,sessionIdleExpire:9e5},this._lastActivity=Date.now(),this._isEnabled=!1,this._isPaused=!1,this._hasInitializedCoreListeners=!1,this._context={errorIds:new Set,traceIds:new Set,urls:[],initialTimestamp:Date.now(),initialUrl:""},this._recordingOptions=e,this._options=t,this._debouncedFlush=function(t,e,n){let r,s,i;const o=n&&n.maxWait?Math.max(n.maxWait,e):0;function a(){return c(),r=t(),r}function c(){void 0!==s&&clearTimeout(s),void 0!==i&&clearTimeout(i),s=i=void 0}function l(){return s&&clearTimeout(s),s=setTimeout(a,e),o&&void 0===i&&(i=setTimeout(a,o)),r}return l.cancel=c,l.flush=function(){return void 0!==s||void 0!==i?a():r},l}((()=>this._flush()),this._options.flushMinDelay,{maxWait:this._options.flushMaxDelay}),this._throttledAddEvent=or(((t,e)=>function(t,e,n){return bn(t,e)?kn(t,e,n):Promise.resolve(null)}(this,t,e)),300,5);const{slowClickTimeout:n,slowClickIgnoreSelectors:r}=this.getOptions(),s=n?{threshold:Math.min(3e3,n),timeout:n,scrollTimeout:300,ignoreSelector:r?r.join(","):""}:void 0;s&&(this.clickDetector=new Pe(this,s))}getContext(){return this._context}isEnabled(){return this._isEnabled}isPaused(){return this._isPaused}getOptions(){return this._options}initializeSampling(t){const{errorSampleRate:e,sessionSampleRate:n}=this._options;e<=0&&n<=0||(this._initializeSessionForSampling(t),this.session?!1!==this.session.sampled&&(this.recordingMode="buffer"===this.session.sampled&&0===this.session.segmentId?"buffer":"session",en(`[Replay] Starting replay in ${this.recordingMode} mode`,this._options._experiments.traceInternals),this._initializeRecording()):this._handleException(new Error("Unable to initialize and create session")))}start(){if(this._isEnabled&&"session"===this.recordingMode)throw new Error("Replay recording is already in progress");if(this._isEnabled&&"buffer"===this.recordingMode)throw new Error("Replay buffering is in progress, call `flush()` to save the replay");en("[Replay] Starting replay in session mode",this._options._experiments.traceInternals);const t=vn({maxReplayDuration:this._options.maxReplayDuration,sessionIdleExpire:this.timeouts.sessionIdleExpire,traceInternals:this._options._experiments.traceInternals},{stickySession:this._options.stickySession,sessionSampleRate:1,allowBuffering:!1});this.session=t,this._initializeRecording()}startBuffering(){if(this._isEnabled)throw new Error("Replay recording is already in progress");en("[Replay] Starting replay in buffer mode",this._options._experiments.traceInternals);const t=vn({sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration,traceInternals:this._options._experiments.traceInternals},{stickySession:this._options.stickySession,sessionSampleRate:0,allowBuffering:!0});this.session=t,this.recordingMode="buffer",this._initializeRecording()}startRecording(){try{this._stopRecording=Te({...this._recordingOptions,..."buffer"===this.recordingMode&&{checkoutEveryNms:6e4},emit:Zn(this),onMutation:this._onMutationHandler})}catch(t){this._handleException(t)}}stopRecording(){try{return this._stopRecording&&(this._stopRecording(),this._stopRecording=void 0),!0}catch(t){return this._handleException(t),!1}}async stop({forceFlush:t=!1,reason:e}={}){if(this._isEnabled){this._isEnabled=!1;try{tn("[Replay] Stopping Replay"+(e?` triggered by ${e}`:""),this._options._experiments.traceInternals),this._removeListeners(),this.stopRecording(),this._debouncedFlush.cancel(),t&&await this._flush({force:!0}),this.eventBuffer&&this.eventBuffer.destroy(),this.eventBuffer=null,dn(this)}catch(n){this._handleException(n)}}}pause(){this._isPaused||(this._isPaused=!0,this.stopRecording(),tn("[Replay] Pausing replay",this._options._experiments.traceInternals))}resume(){this._isPaused&&this._checkSession()&&(this._isPaused=!1,this.startRecording(),tn("[Replay] Resuming replay",this._options._experiments.traceInternals))}async sendBufferedReplayOrFlush({continueRecording:t=!0}={}){if("session"===this.recordingMode)return this.flushImmediate();const e=Date.now();tn("[Replay] Converting buffer to session",this._options._experiments.traceInternals),await this.flushImmediate();const n=this.stopRecording();t&&n&&"session"!==this.recordingMode&&(this.recordingMode="session",this.session&&(this._updateUserActivity(e),this._updateSessionActivity(e),this._maybeSaveSession()),this.startRecording())}addUpdate(t){const e=t();"buffer"!==this.recordingMode&&!0!==e&&this._debouncedFlush()}triggerUserActivity(){if(this._updateUserActivity(),this._stopRecording)this.checkAndHandleExpiredSession(),this._updateSessionActivity();else{if(!this._checkSession())return;this.resume()}}updateUserActivity(){this._updateUserActivity(),this._updateSessionActivity()}conditionalFlush(){return"buffer"===this.recordingMode?Promise.resolve():this.flushImmediate()}flush(){return this._debouncedFlush()}flushImmediate(){return this._debouncedFlush(),this._debouncedFlush.flush()}cancelFlush(){this._debouncedFlush.cancel()}getSessionId(){return this.session&&this.session.id}checkAndHandleExpiredSession(){if(!(this._lastActivity&&gn(this._lastActivity,this.timeouts.sessionIdlePause)&&this.session&&"session"===this.session.sampled))return!!this._checkSession();this.pause()}setInitialState(){const t=`${T.location.pathname}${T.location.hash}${T.location.search}`,e=`${T.location.origin}${t}`;this.performanceEntries=[],this.replayPerformanceEntries=[],this._clearContext(),this._context.initialUrl=e,this._context.initialTimestamp=Date.now(),this._context.urls.push(e)}throttledAddEvent(t,e){const n=this._throttledAddEvent(t,e);if(n===ir){const t=Be({category:"replay.throttled"});this.addUpdate((()=>!Sn(this,{type:5,timestamp:t.timestamp||0,data:{tag:"breadcrumb",payload:t,metric:!0}})))}return n}getCurrentRoute(){const t=this.lastTransaction||(0,r.Gd)().getScope().getTransaction();if(t&&["route","custom"].includes(t.metadata.source))return t.name}_initializeRecording(){this.setInitialState(),this._updateSessionActivity(),this.eventBuffer=ln({useCompression:this._options.useCompression,workerUrl:this._options.workerUrl}),this._removeListeners(),this._addListeners(),this._isEnabled=!0,this._isPaused=!1,this.startRecording()}_handleException(t){Qe&&m.kg.error("[Replay]",t),Qe&&this._options._experiments&&this._options._experiments.captureExceptions&&(0,s.Tb)(t)}_initializeSessionForSampling(t){const e=this._options.errorSampleRate>0,n=vn({sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration,traceInternals:this._options._experiments.traceInternals,previousSessionId:t},{stickySession:this._options.stickySession,sessionSampleRate:this._options.sessionSampleRate,allowBuffering:e});this.session=n}_checkSession(){if(!this.session)return!1;const t=this.session;return!_n(t,{sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration})||(this._refreshSession(t),!1)}async _refreshSession(t){this._isEnabled&&(await this.stop({reason:"refresh session"}),this.initializeSampling(t.id))}_addListeners(){try{T.document.addEventListener("visibilitychange",this._handleVisibilityChange),T.addEventListener("blur",this._handleWindowBlur),T.addEventListener("focus",this._handleWindowFocus),T.addEventListener("keydown",this._handleKeyboardEvent),this.clickDetector&&this.clickDetector.addListeners(),this._hasInitializedCoreListeners||(!function(t){const e=(0,r.Gd)().getScope(),n=(0,s.s3)();e.addScopeListener(Yn(t)),(0,v.O)(qe(t)),(0,S.a)(Rn(t)),Kn(t);const i=In(t,!Vn(n));n&&n.addEventProcessor?n.addEventProcessor(i):(0,a.Q)(i),Vn(n)&&(n.on("afterSendEvent",Tn(t)),n.on("createDsc",(e=>{const n=t.getSessionId();n&&t.isEnabled()&&"session"===t.recordingMode&&t.checkAndHandleExpiredSession()&&(e.replay_id=n)})),n.on("startTransaction",(e=>{t.lastTransaction=e})),n.on("finishTransaction",(e=>{t.lastTransaction=e})),n.on("beforeSendFeedback",((e,n)=>{const r=t.getSessionId();n&&n.includeReplay&&t.isEnabled()&&r&&(t.flush(),e.contexts&&e.contexts.feedback&&(e.contexts.feedback.replay_id=r))})))}(this),this._hasInitializedCoreListeners=!0)}catch(t){this._handleException(t)}this._performanceCleanupCallback=Ve(this)}_removeListeners(){try{T.document.removeEventListener("visibilitychange",this._handleVisibilityChange),T.removeEventListener("blur",this._handleWindowBlur),T.removeEventListener("focus",this._handleWindowFocus),T.removeEventListener("keydown",this._handleKeyboardEvent),this.clickDetector&&this.clickDetector.removeListeners(),this._performanceCleanupCallback&&this._performanceCleanupCallback()}catch(t){this._handleException(t)}}__init(){this._handleVisibilityChange=()=>{"visible"===T.document.visibilityState?this._doChangeToForegroundTasks():this._doChangeToBackgroundTasks()}}__init2(){this._handleWindowBlur=()=>{const t=Be({category:"ui.blur"});this._doChangeToBackgroundTasks(t)}}__init3(){this._handleWindowFocus=()=>{const t=Be({category:"ui.focus"});this._doChangeToForegroundTasks(t)}}__init4(){this._handleKeyboardEvent=t=>{Ge(this,t)}}_doChangeToBackgroundTasks(t){if(!this.session)return;yn(this.session,{maxReplayDuration:this._options.maxReplayDuration,sessionIdleExpire:this.timeouts.sessionIdleExpire})||(t&&this._createCustomBreadcrumb(t),this.conditionalFlush())}_doChangeToForegroundTasks(t){if(!this.session)return;this.checkAndHandleExpiredSession()?t&&this._createCustomBreadcrumb(t):tn("[Replay] Document has become active, but session has expired")}_updateUserActivity(t=Date.now()){this._lastActivity=t}_updateSessionActivity(t=Date.now()){this.session&&(this.session.lastActivity=t,this._maybeSaveSession())}_createCustomBreadcrumb(t){this.addUpdate((()=>{this.throttledAddEvent({type:Ft.Custom,timestamp:t.timestamp||0,data:{tag:"breadcrumb",payload:t}})}))}_addPerformanceEntries(){const t=(e=this.performanceEntries,e.map(Je).filter(Boolean)).concat(this.replayPerformanceEntries);var e;return this.performanceEntries=[],this.replayPerformanceEntries=[],Promise.all(Cn(this,t))}_clearContext(){this._context.errorIds.clear(),this._context.traceIds.clear(),this._context.urls=[]}_updateInitialTimestampFromEventBuffer(){const{session:t,eventBuffer:e}=this;if(!t||!e)return;if(t.segmentId)return;const n=e.getEarliestTimestamp();n&&n<this._context.initialTimestamp&&(this._context.initialTimestamp=n)}_popEventContext(){const t={initialTimestamp:this._context.initialTimestamp,initialUrl:this._context.initialUrl,errorIds:Array.from(this._context.errorIds),traceIds:Array.from(this._context.traceIds),urls:this._context.urls};return this._clearContext(),t}async _runFlush(){const t=this.getSessionId();if(this.session&&this.eventBuffer&&t){if(await this._addPerformanceEntries(),this.eventBuffer&&this.eventBuffer.hasEvents&&(await async function(t){try{return Promise.all(Cn(t,[Qn(T.performance.memory)]))}catch(e){return[]}}(this),this.eventBuffer&&t===this.getSessionId()))try{this._updateInitialTimestampFromEventBuffer();const e=Date.now();if(e-this._context.initialTimestamp>this._options.maxReplayDuration+3e4)throw new Error("Session is too long, not sending replay");const n=this._popEventContext(),r=this.session.segmentId++;this._maybeSaveSession();const s=await this.eventBuffer.finish();await sr({replayId:t,recordingData:s,segmentId:r,eventContext:n,session:this.session,options:this.getOptions(),timestamp:e})}catch(e){this._handleException(e),this.stop({reason:"sendReplay"});const t=(0,s.s3)();t&&t.recordDroppedEvent("send_error","replay")}}else Qe&&m.kg.error("[Replay] No session or eventBuffer found to flush.")}__init5(){this._flush=async({force:t=!1}={})=>{if(!this._isEnabled&&!t)return;if(!this.checkAndHandleExpiredSession())return void(Qe&&m.kg.error("[Replay] Attempting to finish replay event after session expired."));if(!this.session)return;const e=this.session.started,n=Date.now()-e;this._debouncedFlush.cancel();const r=n<this._options.minReplayDuration,s=n>this._options.maxReplayDuration+5e3;if(r||s)return tn(`[Replay] Session duration (${Math.floor(n/1e3)}s) is too ${r?"short":"long"}, not sending replay.`,this._options._experiments.traceInternals),void(r&&this._debouncedFlush());const i=this.eventBuffer;if(i&&0===this.session.segmentId&&!i.hasCheckout&&tn("[Replay] Flushing initial segment without checkout.",this._options._experiments.traceInternals),!this._flushLock)return this._flushLock=this._runFlush(),await this._flushLock,void(this._flushLock=void 0);try{await this._flushLock}catch(o){Qe&&m.kg.error(o)}finally{this._debouncedFlush()}}}_maybeSaveSession(){this.session&&this._options.stickySession&&mn(this.session)}__init6(){this._onMutationHandler=t=>{const e=t.length,n=this._options.mutationLimit,r=n&&e>n;if(e>this._options.mutationBreadcrumbLimit||r){const t=Be({category:"replay.mutations",data:{count:e,limit:r}});this._createCustomBreadcrumb(t)}return!r||(this.stop({reason:"mutationLimit",forceFlush:"session"===this.recordingMode}),!1)}}}function cr(t,e,n,r){const s=[...t,..."string"===typeof r?r.split(","):[],...e];return"undefined"!==typeof n&&("string"===typeof n&&s.push(`.${n}`),(0,m.Cf)((()=>{console.warn("[Replay] You are using a deprecated configuration item for privacy. Read the documentation on how to use the new privacy configuration.")}))),s.join(",")}const lr='img,image,svg,video,object,picture,embed,map,audio,link[rel="icon"],link[rel="apple-touch-icon"]',ur=["content-length","content-type","accept"];let dr=!1;class hr{static __initStatic(){this.id="Replay"}constructor({flushMinDelay:t=5e3,flushMaxDelay:e=5500,minReplayDuration:n=4999,maxReplayDuration:r=36e5,stickySession:s=!0,useCompression:i=!0,workerUrl:o,_experiments:a={},sessionSampleRate:c,errorSampleRate:l,maskAllText:u=!0,maskAllInputs:d=!0,blockAllMedia:h=!0,mutationBreadcrumbLimit:p=750,mutationLimit:m=1e4,slowClickTimeout:f=7e3,slowClickIgnoreSelectors:g=[],networkDetailAllowUrls:y=[],networkDetailDenyUrls:_=[],networkCaptureBodies:v=!0,networkRequestHeaders:S=[],networkResponseHeaders:k=[],mask:b=[],maskAttributes:w=["title","placeholder"],unmask:x=[],block:T=[],unblock:I=[],ignore:C=[],maskFn:R,beforeAddRecordingEvent:M,beforeErrorSampling:O,blockClass:D,blockSelector:N,maskInputOptions:L,maskTextClass:$,maskTextSelector:P,ignoreClass:F}={}){this.name=hr.id;const j=function({mask:t,unmask:e,block:n,unblock:r,ignore:s,blockClass:i,blockSelector:o,maskTextClass:a,maskTextSelector:c,ignoreClass:l}){const u={maskTextSelector:cr(t,[".sentry-mask","[data-sentry-mask]"],a,c),unmaskTextSelector:cr(e,[".sentry-unmask","[data-sentry-unmask]"]),blockSelector:cr(n,[".sentry-block","[data-sentry-block]",'base[href="/"]'],i,o),unblockSelector:cr(r,[".sentry-unblock","[data-sentry-unblock]"]),ignoreSelector:cr(s,[".sentry-ignore","[data-sentry-ignore]",'input[type="file"]'],l)};return i instanceof RegExp&&(u.blockClass=i),a instanceof RegExp&&(u.maskTextClass=a),u}({mask:b,unmask:x,block:T,unblock:I,ignore:C,blockClass:D,blockSelector:N,maskTextClass:$,maskTextSelector:P,ignoreClass:F});if(this._recordingOptions={maskAllInputs:d,maskAllText:u,maskInputOptions:{...L||{},password:!0},maskTextFn:R,maskInputFn:R,maskAttributeFn:(t,e,n)=>function({el:t,key:e,maskAttributes:n,maskAllText:r,privacyOptions:s,value:i}){return r?s.unmaskTextSelector&&t.matches(s.unmaskTextSelector)?i:n.includes(e)||"value"===e&&"INPUT"===t.tagName&&["submit","button"].includes(t.getAttribute("type")||"")?i.replace(/[\S]/g,"*"):i:i}({maskAttributes:w,maskAllText:u,privacyOptions:j,key:t,value:e,el:n}),...j,slimDOMOptions:"all",inlineStylesheet:!0,inlineImages:!1,collectFonts:!0,errorHandler:t=>{try{t.__rrweb__=!0}catch(e){}}},this._initialOptions={flushMinDelay:t,flushMaxDelay:e,minReplayDuration:Math.min(n,15e3),maxReplayDuration:Math.min(r,A),stickySession:s,sessionSampleRate:c,errorSampleRate:l,useCompression:i,workerUrl:o,blockAllMedia:h,maskAllInputs:d,maskAllText:u,mutationBreadcrumbLimit:p,mutationLimit:m,slowClickTimeout:f,slowClickIgnoreSelectors:g,networkDetailAllowUrls:y,networkDetailDenyUrls:_,networkCaptureBodies:v,networkRequestHeaders:pr(S),networkResponseHeaders:pr(k),beforeAddRecordingEvent:M,beforeErrorSampling:O,_experiments:a},"number"===typeof c&&(console.warn(`[Replay] You are passing \`sessionSampleRate\` to the Replay integration.\nThis option is deprecated and will be removed soon.\nInstead, configure \`replaysSessionSampleRate\` directly in the SDK init options, e.g.:\nSentry.init({ replaysSessionSampleRate: ${c} })`),this._initialOptions.sessionSampleRate=c),"number"===typeof l&&(console.warn(`[Replay] You are passing \`errorSampleRate\` to the Replay integration.\nThis option is deprecated and will be removed soon.\nInstead, configure \`replaysOnErrorSampleRate\` directly in the SDK init options, e.g.:\nSentry.init({ replaysOnErrorSampleRate: ${l} })`),this._initialOptions.errorSampleRate=l),this._initialOptions.blockAllMedia&&(this._recordingOptions.blockSelector=this._recordingOptions.blockSelector?`${this._recordingOptions.blockSelector},${lr}`:lr),this._isInitialized&&E())throw new Error("Multiple Sentry Session Replay instances are not supported");this._isInitialized=!0}get _isInitialized(){return dr}set _isInitialized(t){dr=t}setupOnce(){E()&&(this._setup(),setTimeout((()=>this._initialize())))}start(){this._replay&&this._replay.start()}startBuffering(){this._replay&&this._replay.startBuffering()}stop(){return this._replay?this._replay.stop({forceFlush:"session"===this._replay.recordingMode}):Promise.resolve()}flush(t){return this._replay&&this._replay.isEnabled()?this._replay.sendBufferedReplayOrFlush(t):Promise.resolve()}getReplayId(){if(this._replay&&this._replay.isEnabled())return this._replay.getSessionId()}_initialize(){this._replay&&this._replay.initializeSampling()}_setup(){const t=function(t){const e=(0,s.s3)(),n=e&&e.getOptions(),r={sessionSampleRate:0,errorSampleRate:0,...(0,d.Jr)(t)};if(!n)return(0,m.Cf)((()=>{console.warn("SDK client is not available.")})),r;null==t.sessionSampleRate&&null==t.errorSampleRate&&null==n.replaysSessionSampleRate&&null==n.replaysOnErrorSampleRate&&(0,m.Cf)((()=>{console.warn("Replay is disabled because neither `replaysSessionSampleRate` nor `replaysOnErrorSampleRate` are set.")}));"number"===typeof n.replaysSessionSampleRate&&(r.sessionSampleRate=n.replaysSessionSampleRate);"number"===typeof n.replaysOnErrorSampleRate&&(r.errorSampleRate=n.replaysOnErrorSampleRate);return r}(this._initialOptions);this._replay=new ar({options:t,recordingOptions:this._recordingOptions})}}function pr(t){return[...ur,...t.map((t=>t.toLowerCase()))]}hr.__initStatic()},9181:(t,e,n)=>{n.d(e,{EN:()=>u,IQ:()=>d,bU:()=>o});var r=n(3897),s=n(7597),i=n(2343);const o="baggage",a="sentry-",c=/^sentry-/,l=8192;function u(t){if(!(0,s.HD)(t)&&!Array.isArray(t))return;let e={};if(Array.isArray(t))e=t.reduce(((t,e)=>({...t,...h(e)})),{});else{if(!t)return;e=h(t)}const n=Object.entries(e).reduce(((t,[e,n])=>{if(e.match(c)){t[e.slice(a.length)]=n}return t}),{});return Object.keys(n).length>0?n:void 0}function d(t){if(!t)return;return function(t){if(0===Object.keys(t).length)return;return Object.entries(t).reduce(((t,[e,n],s)=>{const o=`${encodeURIComponent(e)}=${encodeURIComponent(n)}`,a=0===s?o:`${t},${o}`;return a.length>l?(r.X&&i.kg.warn(`Not adding key: ${e} with val: ${n} to baggage header due to exceeding baggage size limits.`),t):a}),"")}(Object.entries(t).reduce(((t,[e,n])=>(n&&(t[`${a}${e}`]=n),t)),{}))}function h(t){return t.split(",").map((t=>t.split("=").map((t=>decodeURIComponent(t.trim()))))).reduce(((t,[e,n])=>(t[e]=n,t)),{})}},8464:(t,e,n)=>{n.d(e,{Rt:()=>o,l4:()=>c,qT:()=>l});var r=n(7597);const s=(0,n(1235).Rf)(),i=80;function o(t,e={}){if(!t)return"<unknown>";try{let n=t;const r=5,s=[];let o=0,c=0;const l=" > ",u=l.length;let d;const h=Array.isArray(e)?e:e.keyAttrs,p=!Array.isArray(e)&&e.maxStringLength||i;for(;n&&o++<r&&(d=a(n,h),!("html"===d||o>1&&c+s.length*u+d.length>=p));)s.push(d),c+=d.length,n=n.parentNode;return s.reverse().join(l)}catch(n){return"<unknown>"}}function a(t,e){const n=t,s=[];let i,o,a,c,l;if(!n||!n.tagName)return"";s.push(n.tagName.toLowerCase());const u=e&&e.length?e.filter((t=>n.getAttribute(t))).map((t=>[t,n.getAttribute(t)])):null;if(u&&u.length)u.forEach((t=>{s.push(`[${t[0]}="${t[1]}"]`)}));else if(n.id&&s.push(`#${n.id}`),i=n.className,i&&(0,r.HD)(i))for(o=i.split(/\s+/),l=0;l<o.length;l++)s.push(`.${o[l]}`);const d=["aria-label","type","name","title","alt"];for(l=0;l<d.length;l++)a=d[l],c=n.getAttribute(a),c&&s.push(`[${a}="${c}"]`);return s.join("")}function c(){try{return s.document.location.href}catch(t){return""}}function l(t){return s.document&&s.document.querySelector?s.document.querySelector(t):null}},3897:(t,e,n)=>{n.d(e,{X:()=>r});const r="undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__},292:(t,e,n)=>{n.d(e,{RA:()=>o,vK:()=>c});var r=n(3897),s=n(2343);const i=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/;function o(t,e=!1){const{host:n,path:r,pass:s,port:i,projectId:o,protocol:a,publicKey:c}=t;return`${a}://${c}${e&&s?`:${s}`:""}@${n}${i?`:${i}`:""}/${r?`${r}/`:r}${o}`}function a(t){return{protocol:t.protocol,publicKey:t.publicKey||"",pass:t.pass||"",host:t.host,port:t.port||"",path:t.path||"",projectId:t.projectId}}function c(t){const e="string"===typeof t?function(t){const e=i.exec(t);if(!e)return void(0,s.Cf)((()=>{console.error(`Invalid Sentry Dsn: ${t}`)}));const[n,r,o="",c,l="",u]=e.slice(1);let d="",h=u;const p=h.split("/");if(p.length>1&&(d=p.slice(0,-1).join("/"),h=p.pop()),h){const t=h.match(/^\d+/);t&&(h=t[0])}return a({host:c,pass:o,path:d,projectId:h,port:l,protocol:n,publicKey:r})}(t):a(t);if(e&&function(t){if(!r.X)return!0;const{port:e,projectId:n,protocol:i}=t;return!["protocol","publicKey","host","projectId"].find((e=>!t[e]&&(s.kg.error(`Invalid Sentry Dsn: ${e} missing`),!0)))&&(n.match(/^\d+$/)?function(t){return"http"===t||"https"===t}(i)?!e||!isNaN(parseInt(e,10))||(s.kg.error(`Invalid Sentry Dsn: Invalid port ${e}`),!1):(s.kg.error(`Invalid Sentry Dsn: Invalid protocol ${i}`),!1):(s.kg.error(`Invalid Sentry Dsn: Invalid projectId ${n}`),!1))}(e))return e}},8518:(t,e,n)=>{function r(){return"undefined"!==typeof __SENTRY_BROWSER_BUNDLE__&&!!__SENTRY_BROWSER_BUNDLE__}function s(){return"npm"}n.d(e,{S:()=>s,n:()=>r})},8725:(t,e,n)=>{n.d(e,{BO:()=>a,Cd:()=>f,HY:()=>m,Jd:()=>o,V$:()=>u,gv:()=>c,mL:()=>p,zQ:()=>d});var r=n(292),s=n(8007),i=n(535);function o(t,e=[]){return[t,e]}function a(t,e){const[n,r]=t;return[n,[...r,e]]}function c(t,e){const n=t[1];for(const r of n){if(e(r,r[0].type))return!0}return!1}function l(t,e){return(e||new TextEncoder).encode(t)}function u(t,e){const[n,r]=t;let i=JSON.stringify(n);function o(t){"string"===typeof i?i="string"===typeof t?i+t:[l(i,e),t]:i.push("string"===typeof t?l(t,e):t)}for(const c of r){const[t,e]=c;if(o(`\n${JSON.stringify(t)}\n`),"string"===typeof e||e instanceof Uint8Array)o(e);else{let t;try{t=JSON.stringify(e)}catch(a){t=JSON.stringify((0,s.Fv)(e))}o(t)}}return"string"===typeof i?i:function(t){const e=t.reduce(((t,e)=>t+e.length),0),n=new Uint8Array(e);let r=0;for(const s of t)n.set(s,r),r+=s.length;return n}(i)}function d(t,e){const n="string"===typeof t.data?l(t.data,e):t.data;return[(0,i.Jr)({type:"attachment",length:n.length,filename:t.filename,content_type:t.contentType,attachment_type:t.attachmentType}),n]}const h={session:"session",sessions:"session",attachment:"attachment",transaction:"transaction",event:"error",client_report:"internal",user_report:"default",profile:"profile",replay_event:"replay",replay_recording:"replay",check_in:"monitor",feedback:"feedback",statsd:"unknown"};function p(t){return h[t]}function m(t){if(!t||!t.sdk)return;const{name:e,version:n}=t.sdk;return{name:e,version:n}}function f(t,e,n,s){const o=t.sdkProcessingMetadata&&t.sdkProcessingMetadata.dynamicSamplingContext;return{event_id:t.event_id,sent_at:(new Date).toISOString(),...e&&{sdk:e},...!!n&&s&&{dsn:(0,r.RA)(s)},...o&&{trace:(0,i.Jr)({...o})}}}},409:(t,e,n)=>{n.d(e,{b:()=>r});class r extends Error{constructor(t,e="warn"){super(t),this.message=t,this.name=new.target.prototype.constructor.name,Object.setPrototypeOf(this,new.target.prototype),this.logLevel=e}}},9729:(t,e,n)=>{n.d(e,{D2:()=>l,Hj:()=>c,rK:()=>u});var r=n(3897),s=n(2343),i=n(360);const o={},a={};function c(t,e){o[t]=o[t]||[],o[t].push(e)}function l(t,e){a[t]||(e(),a[t]=!0)}function u(t,e){const n=t&&o[t];if(n)for(const o of n)try{o(e)}catch(a){r.X&&s.kg.error(`Error while triggering instrumentation handler.\nType: ${t}\nName: ${(0,i.$P)(o)}\nError:`,a)}}},5316:(t,e,n)=>{n.d(e,{O:()=>h});var r=n(2844),s=n(535),i=n(1235),o=n(9729);const a=i.n2,c=1e3;let l,u,d;function h(t){(0,o.Hj)("dom",t),(0,o.D2)("dom",p)}function p(){if(!a.document)return;const t=o.rK.bind(null,"dom"),e=m(t,!0);a.document.addEventListener("click",e,!1),a.document.addEventListener("keypress",e,!1),["EventTarget","Node"].forEach((e=>{const n=a[e]&&a[e].prototype;n&&n.hasOwnProperty&&n.hasOwnProperty("addEventListener")&&((0,s.hl)(n,"addEventListener",(function(e){return function(n,r,s){if("click"===n||"keypress"==n)try{const r=this,i=r.__sentry_instrumentation_handlers__=r.__sentry_instrumentation_handlers__||{},o=i[n]=i[n]||{refCount:0};if(!o.handler){const r=m(t);o.handler=r,e.call(this,n,r,s)}o.refCount++}catch(i){}return e.call(this,n,r,s)}})),(0,s.hl)(n,"removeEventListener",(function(t){return function(e,n,r){if("click"===e||"keypress"==e)try{const n=this,s=n.__sentry_instrumentation_handlers__||{},i=s[e];i&&(i.refCount--,i.refCount<=0&&(t.call(this,e,i.handler,r),i.handler=void 0,delete s[e]),0===Object.keys(s).length&&delete n.__sentry_instrumentation_handlers__)}catch(s){}return t.call(this,e,n,r)}})))}))}function m(t,e=!1){return n=>{if(!n||n._sentryCaptured)return;const i=function(t){try{return t.target}catch(e){return null}}(n);if(function(t,e){return"keypress"===t&&(!e||!e.tagName||"INPUT"!==e.tagName&&"TEXTAREA"!==e.tagName&&!e.isContentEditable)}(n.type,i))return;(0,s.xp)(n,"_sentryCaptured",!0),i&&!i._sentryId&&(0,s.xp)(i,"_sentryId",(0,r.DM)());const o="keypress"===n.type?"input":n.type;if(!function(t){if(t.type!==u)return!1;try{if(!t.target||t.target._sentryId!==d)return!1}catch(e){}return!0}(n)){t({event:n,name:o,global:e}),u=n.type,d=i?i._sentryId:void 0}clearTimeout(l),l=a.setTimeout((()=>{d=void 0,u=void 0}),c)}}},1394:(t,e,n)=>{n.d(e,{U:()=>a});var r=n(535),s=n(8823),i=n(1235),o=n(9729);function a(t){const e="fetch";(0,o.Hj)(e,t),(0,o.D2)(e,c)}function c(){(0,s.t$)()&&(0,r.hl)(i.n2,"fetch",(function(t){return function(...e){const{method:n,url:r}=function(t){if(0===t.length)return{method:"GET",url:""};if(2===t.length){const[e,n]=t;return{url:u(e),method:l(n,"method")?String(n.method).toUpperCase():"GET"}}const e=t[0];return{url:u(e),method:l(e,"method")?String(e.method).toUpperCase():"GET"}}(e),s={args:e,fetchData:{method:n,url:r},startTimestamp:Date.now()};return(0,o.rK)("fetch",{...s}),t.apply(i.n2,e).then((t=>{const e={...s,endTimestamp:Date.now(),response:t};return(0,o.rK)("fetch",e),t}),(t=>{const e={...s,endTimestamp:Date.now(),error:t};throw(0,o.rK)("fetch",e),t}))}}))}function l(t,e){return!!t&&"object"===typeof t&&!!t[e]}function u(t){return"string"===typeof t?t:t?l(t,"url")?t.url:t.toString?t.toString():"":""}},1674:(t,e,n)=>{n.d(e,{V:()=>o});var r=n(1235),s=n(9729);let i=null;function o(t){const e="error";(0,s.Hj)(e,t),(0,s.D2)(e,a)}function a(){i=r.n2.onerror,r.n2.onerror=function(t,e,n,r,o){const a={column:r,error:o,line:n,msg:t,url:e};return(0,s.rK)("error",a),!(!i||i.__SENTRY_LOADER__)&&i.apply(this,arguments)},r.n2.onerror.__SENTRY_INSTRUMENTED__=!0}},7373:(t,e,n)=>{n.d(e,{h:()=>o});var r=n(1235),s=n(9729);let i=null;function o(t){const e="unhandledrejection";(0,s.Hj)(e,t),(0,s.D2)(e,a)}function a(){i=r.n2.onunhandledrejection,r.n2.onunhandledrejection=function(t){const e=t;return(0,s.rK)("unhandledrejection",e),!(i&&!i.__SENTRY_LOADER__)||i.apply(this,arguments)},r.n2.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}},734:(t,e,n)=>{n.d(e,{a:()=>l});var r=n(535),s=n(1235);const i=(0,s.Rf)();var o=n(9729);const a=s.n2;let c;function l(t){const e="history";(0,o.Hj)(e,t),(0,o.D2)(e,u)}function u(){if(!function(){const t=i.chrome,e=t&&t.app&&t.app.runtime,n="history"in i&&!!i.history.pushState&&!!i.history.replaceState;return!e&&n}())return;const t=a.onpopstate;function e(t){return function(...e){const n=e.length>2?e[2]:void 0;if(n){const t=c,e=String(n);c=e;const r={from:t,to:e};(0,o.rK)("history",r)}return t.apply(this,e)}}a.onpopstate=function(...e){const n=a.location.href,r=c;c=n;const s={from:r,to:n};if((0,o.rK)("history",s),t)try{return t.apply(this,e)}catch(i){}},(0,r.hl)(a.history,"pushState",e),(0,r.hl)(a.history,"replaceState",e)}},5322:(t,e,n)=>{n.d(e,{UK:()=>l,xU:()=>c});var r=n(7597),s=n(535),i=n(1235),o=n(9729);const a=i.n2,c="__sentry_xhr_v3__";function l(t){(0,o.Hj)("xhr",t),(0,o.D2)("xhr",u)}function u(){if(!a.XMLHttpRequest)return;const t=XMLHttpRequest.prototype;(0,s.hl)(t,"open",(function(t){return function(...e){const n=Date.now(),i=(0,r.HD)(e[0])?e[0].toUpperCase():void 0,a=function(t){if((0,r.HD)(t))return t;try{return t.toString()}catch(e){}return}(e[1]);if(!i||!a)return t.apply(this,e);this[c]={method:i,url:a,request_headers:{}},"POST"===i&&a.match(/sentry_key/)&&(this.__sentry_own_request__=!0);const l=()=>{const t=this[c];if(t&&4===this.readyState){try{t.status_code=this.status}catch(e){}const r={args:[i,a],endTimestamp:Date.now(),startTimestamp:n,xhr:this};(0,o.rK)("xhr",r)}};return"onreadystatechange"in this&&"function"===typeof this.onreadystatechange?(0,s.hl)(this,"onreadystatechange",(function(t){return function(...e){return l(),t.apply(this,e)}})):this.addEventListener("readystatechange",l),(0,s.hl)(this,"setRequestHeader",(function(t){return function(...e){const[n,s]=e,i=this[c];return i&&(0,r.HD)(n)&&(0,r.HD)(s)&&(i.request_headers[n.toLowerCase()]=s),t.apply(this,e)}})),t.apply(this,e)}})),(0,s.hl)(t,"send",(function(t){return function(...e){const n=this[c];if(!n)return t.apply(this,e);void 0!==e[0]&&(n.body=e[0]);const r={args:[n.method,n.url],startTimestamp:Date.now(),xhr:this};return(0,o.rK)("xhr",r),t.apply(this,e)}}))}},7597:(t,e,n)=>{n.d(e,{Cy:()=>g,HD:()=>l,J8:()=>f,Kj:()=>m,PO:()=>d,TX:()=>a,V9:()=>_,VW:()=>o,VZ:()=>s,cO:()=>h,fm:()=>c,i2:()=>y,kK:()=>p,pt:()=>u,y1:()=>v});const r=Object.prototype.toString;function s(t){switch(r.call(t)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return _(t,Error)}}function i(t,e){return r.call(t)===`[object ${e}]`}function o(t){return i(t,"ErrorEvent")}function a(t){return i(t,"DOMError")}function c(t){return i(t,"DOMException")}function l(t){return i(t,"String")}function u(t){return null===t||"object"!==typeof t&&"function"!==typeof t}function d(t){return i(t,"Object")}function h(t){return"undefined"!==typeof Event&&_(t,Event)}function p(t){return"undefined"!==typeof Element&&_(t,Element)}function m(t){return i(t,"RegExp")}function f(t){return Boolean(t&&t.then&&"function"===typeof t.then)}function g(t){return d(t)&&"nativeEvent"in t&&"preventDefault"in t&&"stopPropagation"in t}function y(t){return"number"===typeof t&&t!==t}function _(t,e){try{return t instanceof e}catch(n){return!1}}function v(t){return!("object"!==typeof t||null===t||!t.__isVue&&!t._isVue)}},2343:(t,e,n)=>{n.d(e,{Cf:()=>a,LD:()=>o,RU:()=>i,kg:()=>c});var r=n(3897),s=n(1235);const i=["debug","info","warn","error","log","assert","trace"],o={};function a(t){if(!("console"in s.n2))return t();const e=s.n2.console,n={},r=Object.keys(o);r.forEach((t=>{const r=o[t];n[t]=e[t],e[t]=r}));try{return t()}finally{r.forEach((t=>{e[t]=n[t]}))}}const c=function(){let t=!1;const e={enable:()=>{t=!0},disable:()=>{t=!1},isEnabled:()=>t};return r.X?i.forEach((n=>{e[n]=(...e)=>{t&&a((()=>{s.n2.console[n](`Sentry Logger [${n}]:`,...e)}))}})):i.forEach((t=>{e[t]=()=>{}})),e}()},2844:(t,e,n)=>{n.d(e,{DM:()=>i,Db:()=>c,EG:()=>l,YO:()=>u,jH:()=>a,lE:()=>d});var r=n(535),s=n(1235);function i(){const t=s.n2,e=t.crypto||t.msCrypto;let n=()=>16*Math.random();try{if(e&&e.randomUUID)return e.randomUUID().replace(/-/g,"");e&&e.getRandomValues&&(n=()=>e.getRandomValues(new Uint8Array(1))[0])}catch(r){}return([1e7]+1e3+4e3+8e3+1e11).replace(/[018]/g,(t=>(t^(15&n())>>t/4).toString(16)))}function o(t){return t.exception&&t.exception.values?t.exception.values[0]:void 0}function a(t){const{message:e,event_id:n}=t;if(e)return e;const r=o(t);return r?r.type&&r.value?`${r.type}: ${r.value}`:r.type||r.value||n||"<unknown>":n||"<unknown>"}function c(t,e,n){const r=t.exception=t.exception||{},s=r.values=r.values||[],i=s[0]=s[0]||{};i.value||(i.value=e||""),i.type||(i.type=n||"Error")}function l(t,e){const n=o(t);if(!n)return;const r=n.mechanism;if(n.mechanism={type:"generic",handled:!0,...r,...e},e&&"data"in e){const t={...r&&r.data,...e.data};n.mechanism.data=t}}function u(t){if(t&&t.__sentry_captured__)return!0;try{(0,r.xp)(t,"__sentry_captured__",!0)}catch(e){}return!1}function d(t){return Array.isArray(t)?t:[t]}},1422:(t,e,n)=>{n.d(e,{KV:()=>s,l$:()=>i});var r=n(8518);function s(){return!(0,r.n)()&&"[object process]"===Object.prototype.toString.call("undefined"!==typeof process?process:0)}function i(t,e){return t.require(e)}t=n.hmd(t)},8007:(t,e,n)=>{n.d(e,{Fv:()=>o,Qy:()=>a});var r=n(7597);var s=n(535),i=n(360);function o(t,e=100,n=1/0){try{return c("",t,e,n)}catch(r){return{ERROR:`**non-serializable** (${r})`}}}function a(t,e=3,n=102400){const r=o(t,e);return s=r,function(t){return~-encodeURI(t).split(/%..|./).length}(JSON.stringify(s))>n?a(t,e-1,n):r;var s}function c(t,e,o=1/0,a=1/0,l=function(){const t="function"===typeof WeakSet,e=t?new WeakSet:[];return[function(n){if(t)return!!e.has(n)||(e.add(n),!1);for(let t=0;t<e.length;t++)if(e[t]===n)return!0;return e.push(n),!1},function(n){if(t)e.delete(n);else for(let t=0;t<e.length;t++)if(e[t]===n){e.splice(t,1);break}}]}()){const[u,d]=l;if(null==e||["number","boolean","string"].includes(typeof e)&&!(0,r.i2)(e))return e;const h=function(t,e){try{if("domain"===t&&e&&"object"===typeof e&&e._events)return"[Domain]";if("domainEmitter"===t)return"[DomainEmitter]";if("undefined"!==typeof n.g&&e===n.g)return"[Global]";if("undefined"!==typeof window&&e===window)return"[Window]";if("undefined"!==typeof document&&e===document)return"[Document]";if((0,r.y1)(e))return"[VueViewModel]";if((0,r.Cy)(e))return"[SyntheticEvent]";if("number"===typeof e&&e!==e)return"[NaN]";if("function"===typeof e)return`[Function: ${(0,i.$P)(e)}]`;if("symbol"===typeof e)return`[${String(e)}]`;if("bigint"===typeof e)return`[BigInt: ${String(e)}]`;const s=function(t){const e=Object.getPrototypeOf(t);return e?e.constructor.name:"null prototype"}(e);return/^HTML(\w*)Element$/.test(s)?`[HTMLElement: ${s}]`:`[object ${s}]`}catch(s){return`**non-serializable** (${s})`}}(t,e);if(!h.startsWith("[object "))return h;if(e.__sentry_skip_normalization__)return e;const p="number"===typeof e.__sentry_override_normalization_depth__?e.__sentry_override_normalization_depth__:o;if(0===p)return h.replace("object ","");if(u(e))return"[Circular ~]";const m=e;if(m&&"function"===typeof m.toJSON)try{return c("",m.toJSON(),p-1,a,l)}catch(_){}const f=Array.isArray(e)?[]:{};let g=0;const y=(0,s.Sh)(e);for(const n in y){if(!Object.prototype.hasOwnProperty.call(y,n))continue;if(g>=a){f[n]="[MaxProperties ~]";break}const t=y[n];f[n]=c(n,t,p-1,a,l),g++}return d(e),f}},535:(t,e,n)=>{n.d(e,{$Q:()=>u,HK:()=>d,Jr:()=>y,Sh:()=>p,_j:()=>h,hl:()=>c,xp:()=>l,zf:()=>g});var r=n(8464),s=n(3897),i=n(7597),o=n(2343),a=n(7321);function c(t,e,n){if(!(e in t))return;const r=t[e],s=n(r);"function"===typeof s&&u(s,r),t[e]=s}function l(t,e,n){try{Object.defineProperty(t,e,{value:n,writable:!0,configurable:!0})}catch(r){s.X&&o.kg.log(`Failed to add non-enumerable property "${e}" to object`,t)}}function u(t,e){try{const n=e.prototype||{};t.prototype=e.prototype=n,l(t,"__sentry_original__",e)}catch(n){}}function d(t){return t.__sentry_original__}function h(t){return Object.keys(t).map((e=>`${encodeURIComponent(e)}=${encodeURIComponent(t[e])}`)).join("&")}function p(t){if((0,i.VZ)(t))return{message:t.message,name:t.name,stack:t.stack,...f(t)};if((0,i.cO)(t)){const e={type:t.type,target:m(t.target),currentTarget:m(t.currentTarget),...f(t)};return"undefined"!==typeof CustomEvent&&(0,i.V9)(t,CustomEvent)&&(e.detail=t.detail),e}return t}function m(t){try{return(0,i.kK)(t)?(0,r.Rt)(t):Object.prototype.toString.call(t)}catch(e){return"<unknown>"}}function f(t){if("object"===typeof t&&null!==t){const e={};for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}return{}}function g(t,e=40){const n=Object.keys(p(t));if(n.sort(),!n.length)return"[object has no keys]";if(n[0].length>=e)return(0,a.$G)(n[0],e);for(let r=n.length;r>0;r--){const t=n.slice(0,r).join(", ");if(!(t.length>e))return r===n.length?t:(0,a.$G)(t,e)}return""}function y(t){return _(t,new Map)}function _(t,e){if((0,i.PO)(t)){const n=e.get(t);if(void 0!==n)return n;const r={};e.set(t,r);for(const s of Object.keys(t))"undefined"!==typeof t[s]&&(r[s]=_(t[s],e));return r}if(Array.isArray(t)){const n=e.get(t);if(void 0!==n)return n;const r=[];return e.set(t,r),t.forEach((t=>{r.push(_(t,e))})),r}return t}},228:(t,e,n)=>{n.d(e,{Q:()=>s,WG:()=>i});const r=6e4;function s(t,e,n=Date.now()){return function(t,e){return t[e]||t.all||0}(t,e)>n}function i(t,{statusCode:e,headers:n},s=Date.now()){const i={...t},o=n&&n["x-sentry-rate-limits"],a=n&&n["retry-after"];if(o)for(const r of o.trim().split(",")){const[t,e]=r.split(":",2),n=parseInt(t,10),o=1e3*(isNaN(n)?60:n);if(e)for(const r of e.split(";"))i[r]=s+o;else i.all=s+o}else a?i.all=s+function(t,e=Date.now()){const n=parseInt(`${t}`,10);if(!isNaN(n))return 1e3*n;const s=Date.parse(`${t}`);return isNaN(s)?r:s-e}(a,s):429===e&&(i.all=s+6e4);return i}},360:(t,e,n)=>{n.d(e,{$P:()=>l,Sq:()=>a,pE:()=>o});const r=50,s=/\(error: (.*)\)/,i=/captureMessage|captureException/;function o(...t){const e=t.sort(((t,e)=>t[0]-e[0])).map((t=>t[1]));return(t,n=0)=>{const o=[],a=t.split("\n");for(let i=n;i<a.length;i++){const t=a[i];if(t.length>1024)continue;const n=s.test(t)?t.replace(s,"$1"):t;if(!n.match(/\S*Error: /)){for(const t of e){const e=t(n);if(e){o.push(e);break}}if(o.length>=r)break}}return function(t){if(!t.length)return[];const e=Array.from(t);/sentryWrapped/.test(e[e.length-1].function||"")&&e.pop();e.reverse(),i.test(e[e.length-1].function||"")&&(e.pop(),i.test(e[e.length-1].function||"")&&e.pop());return e.slice(0,r).map((t=>({...t,filename:t.filename||e[e.length-1].filename,function:t.function||"?"})))}(o)}}function a(t){return Array.isArray(t)?o(...t):t}const c="<anonymous>";function l(t){try{return t&&"function"===typeof t&&t.name||c}catch(e){return c}}},7321:(t,e,n)=>{n.d(e,{$G:()=>s,U0:()=>o,nK:()=>i});var r=n(7597);function s(t,e=0){return"string"!==typeof t||0===e||t.length<=e?t:`${t.slice(0,e)}...`}function i(t,e){if(!Array.isArray(t))return"";const n=[];for(let i=0;i<t.length;i++){const e=t[i];try{(0,r.y1)(e)?n.push("[VueViewModel]"):n.push(String(e))}catch(s){n.push("[value cannot be serialized]")}}return n.join(e)}function o(t,e=[],n=!1){return e.some((e=>function(t,e,n=!1){return!!(0,r.HD)(t)&&((0,r.Kj)(e)?e.test(t):!!(0,r.HD)(e)&&(n?t===e:t.includes(e)))}(t,e,n)))}},8823:(t,e,n)=>{n.d(e,{Ak:()=>o,Du:()=>a,t$:()=>c});var r=n(3897),s=n(2343);const i=(0,n(1235).Rf)();function o(){if(!("fetch"in i))return!1;try{return new Headers,new Request("http://www.example.com"),new Response,!0}catch(t){return!1}}function a(t){return t&&/^function fetch\(\)\s+\{\s+\[native code\]\s+\}$/.test(t.toString())}function c(){if("string"===typeof EdgeRuntime)return!0;if(!o())return!1;if(a(i.fetch))return!0;let t=!1;const e=i.document;if(e&&"function"===typeof e.createElement)try{const n=e.createElement("iframe");n.hidden=!0,e.head.appendChild(n),n.contentWindow&&n.contentWindow.fetch&&(t=a(n.contentWindow.fetch)),e.head.removeChild(n)}catch(n){r.X&&s.kg.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",n)}return t}},6893:(t,e,n)=>{n.d(e,{$2:()=>o,WD:()=>i,cW:()=>a});var r,s=n(7597);function i(t){return new a((e=>{e(t)}))}function o(t){return new a(((e,n)=>{n(t)}))}!function(t){t[t.PENDING=0]="PENDING";t[t.RESOLVED=1]="RESOLVED";t[t.REJECTED=2]="REJECTED"}(r||(r={}));class a{constructor(t){a.prototype.__init.call(this),a.prototype.__init2.call(this),a.prototype.__init3.call(this),a.prototype.__init4.call(this),this._state=r.PENDING,this._handlers=[];try{t(this._resolve,this._reject)}catch(e){this._reject(e)}}then(t,e){return new a(((n,r)=>{this._handlers.push([!1,e=>{if(t)try{n(t(e))}catch(s){r(s)}else n(e)},t=>{if(e)try{n(e(t))}catch(s){r(s)}else r(t)}]),this._executeHandlers()}))}catch(t){return this.then((t=>t),t)}finally(t){return new a(((e,n)=>{let r,s;return this.then((e=>{s=!1,r=e,t&&t()}),(e=>{s=!0,r=e,t&&t()})).then((()=>{s?n(r):e(r)}))}))}__init(){this._resolve=t=>{this._setResult(r.RESOLVED,t)}}__init2(){this._reject=t=>{this._setResult(r.REJECTED,t)}}__init3(){this._setResult=(t,e)=>{this._state===r.PENDING&&((0,s.J8)(e)?e.then(this._resolve,this._reject):(this._state=t,this._value=e,this._executeHandlers()))}}__init4(){this._executeHandlers=()=>{if(this._state===r.PENDING)return;const t=this._handlers.slice();this._handlers=[],t.forEach((t=>{t[0]||(this._state===r.RESOLVED&&t[1](this._value),this._state===r.REJECTED&&t[2](this._value),t[0]=!0)}))}}}},1170:(t,e,n)=>{n.d(e,{Z1:()=>h,ph:()=>u,yW:()=>l});var r=n(1422),s=n(1235);t=n.hmd(t);const i=(0,s.Rf)(),o={nowSeconds:()=>Date.now()/1e3};const a=(0,r.KV)()?function(){try{return(0,r.l$)(t,"perf_hooks").performance}catch(e){return}}():function(){const{performance:t}=i;if(!t||!t.now)return;return{now:()=>t.now(),timeOrigin:Date.now()-t.now()}}(),c=void 0===a?o:{nowSeconds:()=>(a.timeOrigin+a.now())/1e3},l=o.nowSeconds.bind(o),u=c.nowSeconds.bind(c);let d;const h=(()=>{const{performance:t}=i;if(!t||!t.now)return void(d="none");const e=36e5,n=t.now(),r=Date.now(),s=t.timeOrigin?Math.abs(t.timeOrigin+n-r):e,o=s<e,a=t.timing&&t.timing.navigationStart,c="number"===typeof a?Math.abs(a+n-r):e;return o||c<e?s<=c?(d="timeOrigin",t.timeOrigin):(d="navigationStart",a):(d="dateNow",r)})()},7638:(t,e,n)=>{n.d(e,{$p:()=>a,KA:()=>o});var r=n(9181),s=n(2844);const i=new RegExp("^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$");function o(t,e){const n=function(t){if(!t)return;const e=t.match(i);if(!e)return;let n;return"1"===e[3]?n=!0:"0"===e[3]&&(n=!1),{traceId:e[1],parentSampled:n,parentSpanId:e[2]}}(t),o=(0,r.EN)(e),{traceId:a,parentSpanId:c,parentSampled:l}=n||{},u={traceId:a||(0,s.DM)(),spanId:(0,s.DM)().substring(16),sampled:l};return c&&(u.parentSpanId=c),o&&(u.dsc=o),{traceparentData:n,dynamicSamplingContext:o,propagationContext:u}}function a(t=(0,s.DM)(),e=(0,s.DM)().substring(16),n){let r="";return void 0!==n&&(r=n?"-1":"-0"),`${t}-${e}${r}`}},1235:(t,e,n)=>{function r(t){return t&&t.Math==Math?t:void 0}n.d(e,{Rf:()=>i,YO:()=>o,n2:()=>s});const s="object"==typeof globalThis&&r(globalThis)||"object"==typeof window&&r(window)||"object"==typeof self&&r(self)||"object"==typeof n.g&&r(n.g)||function(){return this}()||{};function i(){return s}function o(t,e,n){const r=n||s,i=r.__SENTRY__=r.__SENTRY__||{};return i[t]||(i[t]=e())}}}]); //# sourceMappingURL=vendors.sentry.js.map \ No newline at end of file diff --git a/build/assets/js/vendors.terraformer-arcgis-parser.js b/build/assets/js/vendors.terraformer-arcgis-parser.js index 560b46f..7a35f14 100644 --- a/build/assets/js/vendors.terraformer-arcgis-parser.js +++ b/build/assets/js/vendors.terraformer-arcgis-parser.js @@ -1,2 +1,2 @@ -!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},r=(new Error).stack;r&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[r]="b7bb2098-f524-41a7-ac38-2f3d5f2d6fe9",e._sentryDebugIdIdentifier="sentry-dbid-b7bb2098-f524-41a7-ac38-2f3d5f2d6fe9")}catch(e){}}();var _global="undefined"!==typeof window?window:"undefined"!==typeof global?global:"undefined"!==typeof self?self:{};_global.SENTRY_RELEASE={id:"b15ccfdbc7e26696234f56eb8df3a6b3a27a7fd6"},(self.webpackChunklocal_services_lookup=self.webpackChunklocal_services_lookup||[]).push([[600],{7055:function(e,r,t){!function(r,o){if("object"===typeof e.exports&&(e.exports=o(t(2257))),"object"===typeof r.navigator){if(!r.Terraformer)throw new Error("Terraformer.ArcGIS requires the core Terraformer library. https://github.com/esri/Terraformer");r.Terraformer.ArcGIS=o(r.Terraformer)}}(this,(function(e){var r={};function t(e){var r,t,o,n,i=0,s=0,a=[];o=e.match(/((\+|\-)[^\+\-]+)/g),n=parseInt(o[0],32);for(var c=1;c<o.length;c+=2)i=r=parseInt(o[c],32)+i,s=t=parseInt(o[c+1],32)+s,a.push([r/n,t/n]);return a}function o(e){return function(e,r){for(var t=0;t<e.length;t++)if(e[t]!==r[t])return!1;return!0}(e[0],e[e.length-1])||e.push(e[0]),e}function n(e){var r={};for(var t in e)e.hasOwnProperty(t)&&(r[t]=e[t]);return r}function i(e){for(var r,t=0,o=0,n=e.length,i=e[o];o<n-1;o++)t+=((r=e[o+1])[0]-i[0])*(r[1]+i[1]),i=r;return t>=0}function s(e){var r=[],t=e.slice(0),n=o(t.shift().slice(0));if(n.length>=4){i(n)||n.reverse(),r.push(n);for(var s=0;s<t.length;s++){var a=o(t[s].slice(0));a.length>=4&&(i(a)&&a.reverse(),r.push(a))}}return r}function a(r,t){var o=e.Tools.arraysIntersectArrays(r,t),n=e.Tools.coordinatesContainPoint(r,t[0]);return!(o||!n)}function c(r,s){var f={};return(s=s||{}).idAttribute=s.idAttribute||void 0,!r.spatialReference||3857!==r.spatialReference.wkid&&102100!==r.spatialReference.wkid||(f.crs=e.MercatorCRS),"number"===typeof r.x&&"number"===typeof r.y&&(f.type="Point",f.coordinates=[r.x,r.y],(r.z||r.m)&&f.coordinates.push(r.z),r.m&&f.coordinates.push(r.m)),r.points&&(f.type="MultiPoint",f.coordinates=r.points.slice(0)),r.paths&&(1===r.paths.length?(f.type="LineString",f.coordinates=r.paths[0].slice(0)):(f.type="MultiLineString",f.coordinates=r.paths.slice(0))),r.rings&&(f=function(r){for(var t,n,s,c=[],f=[],u=0;u<r.length;u++){var l=o(r[u].slice(0));if(!(l.length<4))if(i(l)){var p=[l.slice().reverse()];c.push(p)}else f.push(l.slice().reverse())}for(var d=[];f.length;){s=f.pop();var y=!1;for(t=c.length-1;t>=0;t--)if(a(n=c[t][0],s)){c[t].push(s),y=!0;break}y||d.push(s)}for(;d.length;){s=d.pop();var g=!1;for(t=c.length-1;t>=0;t--)if(n=c[t][0],e.Tools.arraysIntersectArrays(n,s)){c[t].push(s),g=!0;break}g||c.push([s.reverse()])}return 1===c.length?{type:"Polygon",coordinates:c[0]}:{type:"MultiPolygon",coordinates:c}}(r.rings.slice(0))),"number"===typeof r.xmin&&"number"===typeof r.ymin&&"number"===typeof r.xmax&&"number"===typeof r.ymax&&(f.type="Polygon",f.coordinates=[[[r.xmax,r.ymax],[r.xmin,r.ymax],[r.xmin,r.ymin],[r.xmax,r.ymin],[r.xmax,r.ymax]]]),(r.compressedGeometry||r.geometry||r.attributes)&&(f.type="Feature",r.compressedGeometry&&(r.geometry={paths:[t(r.compressedGeometry)]}),f.geometry=r.geometry?c(r.geometry):null,f.properties=r.attributes?n(r.attributes):null,r.attributes&&(f.id=r.attributes[s.idAttribute]||r.attributes.OBJECTID||r.attributes.FID)),new e.Primitive(f)}function f(e,r){var t,o=(r=r||{}).idAttribute||"OBJECTID";t=r.sr?{wkid:r.sr}:e&&e.crs&&"urn:ogc:def:crs:OGC:1.3:CRS84"!=e.crs.properties.name?null:{wkid:4326};var i,a={};switch(e.type){case"Point":a.x=e.coordinates[0],a.y=e.coordinates[1],e.coordinates[2]&&(a.z=e.coordinates[2]),e.coordinates[3]&&(a.m=e.coordinates[3]),a.spatialReference=t;break;case"MultiPoint":a.points=e.coordinates.slice(0),a.spatialReference=t;break;case"LineString":a.paths=[e.coordinates.slice(0)],a.spatialReference=t;break;case"MultiLineString":a.paths=e.coordinates.slice(0),a.spatialReference=t;break;case"Polygon":a.rings=s(e.coordinates.slice(0)),a.spatialReference=t;break;case"MultiPolygon":a.rings=function(e){for(var r=[],t=0;t<e.length;t++)for(var o=s(e[t]),n=o.length-1;n>=0;n--){var i=o[n].slice(0);r.push(i)}return r}(e.coordinates.slice(0)),a.spatialReference=t;break;case"Feature":e.geometry&&(a.geometry=f(e.geometry,r)),a.attributes=e.properties?n(e.properties):{},e.id&&(a.attributes[o]=e.id);break;case"FeatureCollection":for(a=[],i=0;i<e.features.length;i++)a.push(f(e.features[i],r));break;case"GeometryCollection":for(a=[],i=0;i<e.geometries.length;i++)a.push(f(e.geometries[i],r))}return a}return r.parse=c,r.convert=f,r.toGeoJSON=c,r.fromGeoJSON=f,r.parseCompressedGeometry=function(r){return new e.LineString(t(r))},r}))}}]); +!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},r=(new Error).stack;r&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[r]="b7bb2098-f524-41a7-ac38-2f3d5f2d6fe9",e._sentryDebugIdIdentifier="sentry-dbid-b7bb2098-f524-41a7-ac38-2f3d5f2d6fe9")}catch(e){}}();var _global="undefined"!==typeof window?window:"undefined"!==typeof global?global:"undefined"!==typeof self?self:{};_global.SENTRY_RELEASE={id:"a2b8e2612b2ee50152f1f5ccf84a620164236ffa"},(self.webpackChunklocal_services_lookup=self.webpackChunklocal_services_lookup||[]).push([[600],{7055:function(e,r,t){!function(r,o){if("object"===typeof e.exports&&(e.exports=o(t(2257))),"object"===typeof r.navigator){if(!r.Terraformer)throw new Error("Terraformer.ArcGIS requires the core Terraformer library. https://github.com/esri/Terraformer");r.Terraformer.ArcGIS=o(r.Terraformer)}}(this,(function(e){var r={};function t(e){var r,t,o,n,i=0,s=0,a=[];o=e.match(/((\+|\-)[^\+\-]+)/g),n=parseInt(o[0],32);for(var c=1;c<o.length;c+=2)i=r=parseInt(o[c],32)+i,s=t=parseInt(o[c+1],32)+s,a.push([r/n,t/n]);return a}function o(e){return function(e,r){for(var t=0;t<e.length;t++)if(e[t]!==r[t])return!1;return!0}(e[0],e[e.length-1])||e.push(e[0]),e}function n(e){var r={};for(var t in e)e.hasOwnProperty(t)&&(r[t]=e[t]);return r}function i(e){for(var r,t=0,o=0,n=e.length,i=e[o];o<n-1;o++)t+=((r=e[o+1])[0]-i[0])*(r[1]+i[1]),i=r;return t>=0}function s(e){var r=[],t=e.slice(0),n=o(t.shift().slice(0));if(n.length>=4){i(n)||n.reverse(),r.push(n);for(var s=0;s<t.length;s++){var a=o(t[s].slice(0));a.length>=4&&(i(a)&&a.reverse(),r.push(a))}}return r}function a(r,t){var o=e.Tools.arraysIntersectArrays(r,t),n=e.Tools.coordinatesContainPoint(r,t[0]);return!(o||!n)}function c(r,s){var f={};return(s=s||{}).idAttribute=s.idAttribute||void 0,!r.spatialReference||3857!==r.spatialReference.wkid&&102100!==r.spatialReference.wkid||(f.crs=e.MercatorCRS),"number"===typeof r.x&&"number"===typeof r.y&&(f.type="Point",f.coordinates=[r.x,r.y],(r.z||r.m)&&f.coordinates.push(r.z),r.m&&f.coordinates.push(r.m)),r.points&&(f.type="MultiPoint",f.coordinates=r.points.slice(0)),r.paths&&(1===r.paths.length?(f.type="LineString",f.coordinates=r.paths[0].slice(0)):(f.type="MultiLineString",f.coordinates=r.paths.slice(0))),r.rings&&(f=function(r){for(var t,n,s,c=[],f=[],u=0;u<r.length;u++){var l=o(r[u].slice(0));if(!(l.length<4))if(i(l)){var p=[l.slice().reverse()];c.push(p)}else f.push(l.slice().reverse())}for(var d=[];f.length;){s=f.pop();var y=!1;for(t=c.length-1;t>=0;t--)if(a(n=c[t][0],s)){c[t].push(s),y=!0;break}y||d.push(s)}for(;d.length;){s=d.pop();var g=!1;for(t=c.length-1;t>=0;t--)if(n=c[t][0],e.Tools.arraysIntersectArrays(n,s)){c[t].push(s),g=!0;break}g||c.push([s.reverse()])}return 1===c.length?{type:"Polygon",coordinates:c[0]}:{type:"MultiPolygon",coordinates:c}}(r.rings.slice(0))),"number"===typeof r.xmin&&"number"===typeof r.ymin&&"number"===typeof r.xmax&&"number"===typeof r.ymax&&(f.type="Polygon",f.coordinates=[[[r.xmax,r.ymax],[r.xmin,r.ymax],[r.xmin,r.ymin],[r.xmax,r.ymin],[r.xmax,r.ymax]]]),(r.compressedGeometry||r.geometry||r.attributes)&&(f.type="Feature",r.compressedGeometry&&(r.geometry={paths:[t(r.compressedGeometry)]}),f.geometry=r.geometry?c(r.geometry):null,f.properties=r.attributes?n(r.attributes):null,r.attributes&&(f.id=r.attributes[s.idAttribute]||r.attributes.OBJECTID||r.attributes.FID)),new e.Primitive(f)}function f(e,r){var t,o=(r=r||{}).idAttribute||"OBJECTID";t=r.sr?{wkid:r.sr}:e&&e.crs&&"urn:ogc:def:crs:OGC:1.3:CRS84"!=e.crs.properties.name?null:{wkid:4326};var i,a={};switch(e.type){case"Point":a.x=e.coordinates[0],a.y=e.coordinates[1],e.coordinates[2]&&(a.z=e.coordinates[2]),e.coordinates[3]&&(a.m=e.coordinates[3]),a.spatialReference=t;break;case"MultiPoint":a.points=e.coordinates.slice(0),a.spatialReference=t;break;case"LineString":a.paths=[e.coordinates.slice(0)],a.spatialReference=t;break;case"MultiLineString":a.paths=e.coordinates.slice(0),a.spatialReference=t;break;case"Polygon":a.rings=s(e.coordinates.slice(0)),a.spatialReference=t;break;case"MultiPolygon":a.rings=function(e){for(var r=[],t=0;t<e.length;t++)for(var o=s(e[t]),n=o.length-1;n>=0;n--){var i=o[n].slice(0);r.push(i)}return r}(e.coordinates.slice(0)),a.spatialReference=t;break;case"Feature":e.geometry&&(a.geometry=f(e.geometry,r)),a.attributes=e.properties?n(e.properties):{},e.id&&(a.attributes[o]=e.id);break;case"FeatureCollection":for(a=[],i=0;i<e.features.length;i++)a.push(f(e.features[i],r));break;case"GeometryCollection":for(a=[],i=0;i<e.geometries.length;i++)a.push(f(e.geometries[i],r))}return a}return r.parse=c,r.convert=f,r.toGeoJSON=c,r.fromGeoJSON=f,r.parseCompressedGeometry=function(r){return new e.LineString(t(r))},r}))}}]); //# sourceMappingURL=vendors.terraformer-arcgis-parser.js.map \ No newline at end of file diff --git a/build/assets/js/vendors.terraformer.js b/build/assets/js/vendors.terraformer.js index 169baf4..85fb9c8 100644 --- a/build/assets/js/vendors.terraformer.js +++ b/build/assets/js/vendors.terraformer.js @@ -1,2 +1,2 @@ -!function(){try{var t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},e=(new Error).stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="94ee767d-38f0-427a-8d93-c729ccab19ce",t._sentryDebugIdIdentifier="sentry-dbid-94ee767d-38f0-427a-8d93-c729ccab19ce")}catch(t){}}();var _global="undefined"!==typeof window?window:"undefined"!==typeof global?global:"undefined"!==typeof self?self:{};_global.SENTRY_RELEASE={id:"b15ccfdbc7e26696234f56eb8df3a6b3a27a7fd6"},(self.webpackChunklocal_services_lookup=self.webpackChunklocal_services_lookup||[]).push([[47],{2257:function(t,e){var r,o;r=this,o=function(){"use strict";var t={},e=6378137,r=57.29577951308232,o=.017453292519943,n={type:"link",properties:{href:"http://spatialreference.org/ref/sr-org/6928/ogcwkt/",type:"ogcwkt"}};function i(t){return"[object Array]"===Object.prototype.toString.call(t)}function s(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);return t}function a(t){if(t.type)switch(t.type){case"Point":return[t.coordinates[0],t.coordinates[1],t.coordinates[0],t.coordinates[1]];case"MultiPoint":case"LineString":return u(t.coordinates);case"MultiLineString":case"Polygon":return c(t.coordinates);case"MultiPolygon":return function(t){for(var e=null,r=null,o=null,n=null,i=0;i<t.length;i++)for(var s=t[i],a=0;a<s.length;a++)for(var c=s[a],u=0;u<c.length;u++){var l=c[u],h=l[0],p=l[1];(null===e||h<e)&&(e=h),(null===r||h>r)&&(r=h),(null===o||p<o)&&(o=p),(null===n||p>n)&&(n=p)}return[e,o,r,n]}(t.coordinates);case"Feature":return t.geometry?a(t.geometry):null;case"FeatureCollection":return function(t){for(var e,r=[],o=t.features.length-1;o>=0;o--)e=a(t.features[o].geometry),r.push([e[0],e[1]]),r.push([e[2],e[3]]);return u(r)}(t);case"GeometryCollection":return function(t){for(var e,r=[],o=t.geometries.length-1;o>=0;o--)e=a(t.geometries[o]),r.push([e[0],e[1]]),r.push([e[2],e[3]]);return u(r)}(t);default:throw new Error("Unknown type: "+t.type)}return null}function c(t){for(var e=null,r=null,o=null,n=null,i=0;i<t.length;i++)for(var s=t[i],a=0;a<s.length;a++){var c=s[a],u=c[0],l=c[1];(null===e||u<e)&&(e=u),(null===r||u>r)&&(r=u),(null===o||l<o)&&(o=l),(null===n||l>n)&&(n=l)}return[e,o,r,n]}function u(t){for(var e=null,r=null,o=null,n=null,i=0;i<t.length;i++){var s=t[i],a=s[0],c=s[1];(null===e||a<e)&&(e=a),(null===r||a>r)&&(r=a),(null===o||c<o)&&(o=c),(null===n||c>n)&&(n=c)}return[e,o,r,n]}function l(t){var e=a(t);return{x:e[0],y:e[1],w:Math.abs(e[0]-e[2]),h:Math.abs(e[1]-e[3])}}function h(t){return t*r}function p(t){return t*o}function f(t,e){for(var r=0;r<t.length;r++)"number"===typeof t[r][0]&&(t[r]=e(t[r])),"object"===typeof t[r]&&(t[r]=f(t[r],e));return t}function y(t){var r=t[0],o=t[1];return[h(r/e)-360*Math.floor((h(r/e)+180)/360),h(Math.PI/2-2*Math.atan(Math.exp(-1*o/e)))]}function d(t){var r=t[0],o=Math.max(Math.min(t[1],89.99999),-89.99999);return[p(r)*e,e/2*Math.log((1+Math.sin(p(o)))/(1-Math.sin(p(o))))]}function g(t,e,r){if("Point"===t.type)t.coordinates=e(t.coordinates);else if("Feature"===t.type)t.geometry=g(t.geometry,e,!0);else if("FeatureCollection"===t.type)for(var o=0;o<t.features.length;o++)t.features[o]=g(t.features[o],e,!0);else if("GeometryCollection"===t.type)for(var i=0;i<t.geometries.length;i++)t.geometries[i]=g(t.geometries[i],e,!0);else t.coordinates=f(t.coordinates,e);return r||e===d&&(t.crs=n),e===y&&delete t.crs,t}function v(t){return g(t,d)}function w(t){return g(t,y)}function P(t,e){return t[0]>e[0]?-1:t[0]<e[0]?1:t[1]>e[1]?-1:t[1]<e[1]?1:0}function m(t,e,r){return(o=(e[0]-t[0])*(r[1]-t[1])-(r[0]-t[0])*(e[1]-t[1]))<(n=0)?-1:o>n?1:0;var o,n}function M(t,e){var r=e[0]-t[0],o=e[1]-t[1];return r*r+o*o}function T(t,e){var r=e;for(var o in t){var n=m(e,r,t[o]);(-1===n||0===n&&M(e,t[o])>M(e,r))&&(r=t[o])}return r}function b(t){if(0===t.length)return[];if(1===t.length)return t;for(var e=[t.sort(P)[0]],r=0;r<e.length;r++){var o=T(t,e[r]);o!==e[0]&&e.push(o)}return e}function S(t,e){for(var r=!1,o=-1,n=t.length,i=n-1;++o<n;i=o)(t[o][1]<=e[1]&&e[1]<t[i][1]||t[i][1]<=e[1]&&e[1]<t[o][1])&&e[0]<(t[i][0]-t[o][0])*(e[1]-t[o][1])/(t[i][1]-t[o][1])+t[o][0]&&(r=!r);return r}function C(t,e){if(t&&t.length){if(1===t.length)return S(t[0],e);if(S(t[0],e)){for(var r=1;r<t.length;r++)if(S(t[r],e))return!1;return!0}return!1}return!1}function L(t,e,r,o){var n=(o[0]-r[0])*(t[1]-r[1])-(o[1]-r[1])*(t[0]-r[0]),i=(e[0]-t[0])*(t[1]-r[1])-(e[1]-t[1])*(t[0]-r[0]),s=(o[1]-r[1])*(e[0]-t[0])-(o[0]-r[0])*(e[1]-t[1]);if(0!==s){var a=n/s,c=i/s;if(0<=a&&a<=1&&0<=c&&c<=1)return!0}return!1}function F(t){return!isNaN(parseFloat(t))&&isFinite(t)}function x(t,e){if(F(t[0][0])){if(F(e[0][0])){for(var r=0;r<t.length-1;r++)for(var o=0;o<e.length-1;o++)if(L(t[r],t[r+1],e[o],e[o+1]))return!0}else for(var n=0;n<e.length;n++)if(x(t,e[n]))return!0}else for(var i=0;i<t.length;i++)if(x(t[i],e))return!0;return!1}function E(t){for(var e=[],r=0;r<t.length;r++){var o=t[r].slice();!1===k(o[0],o[o.length-1])&&o.push(o[0]),e.push(o)}return e}function k(t,e){for(var r=0;r<t.length;r++)if(t[r]!==e[r])return!1;return!0}function G(t,e){if(t.length!==e.length)return!1;for(var r=t.slice().sort(P),o=e.slice().sort(P),n=0;n<r.length;n++){if(r[n].length!==o[n].length)return!1;for(var i=0;i<r.length;i++)if(r[n][i]!==o[n][i])return!1}return!0}var _=["length"];function I(t){if(t)switch(t.type){case"Point":return new O(t);case"MultiPoint":return new V(t);case"LineString":return new N(t);case"MultiLineString":return new j(t);case"Polygon":return new A(t);case"MultiPolygon":return new H(t);case"Feature":return new D(t);case"FeatureCollection":return new R(t);case"GeometryCollection":return new J(t);default:throw new Error("Unknown type: "+t.type)}}function O(t){var e=Array.prototype.slice.call(arguments);if(t&&"Point"===t.type&&t.coordinates)s(this,t);else if(t&&i(t))this.coordinates=t;else{if(!(e.length>=2))throw"Terraformer: invalid input for Terraformer.Point";this.coordinates=e}this.type="Point"}function V(t){if(t&&"MultiPoint"===t.type&&t.coordinates)s(this,t);else{if(!i(t))throw"Terraformer: invalid input for Terraformer.MultiPoint";this.coordinates=t}this.type="MultiPoint"}function N(t){if(t&&"LineString"===t.type&&t.coordinates)s(this,t);else{if(!i(t))throw"Terraformer: invalid input for Terraformer.LineString";this.coordinates=t}this.type="LineString"}function j(t){if(t&&"MultiLineString"===t.type&&t.coordinates)s(this,t);else{if(!i(t))throw"Terraformer: invalid input for Terraformer.MultiLineString";this.coordinates=t}this.type="MultiLineString"}function A(t){if(t&&"Polygon"===t.type&&t.coordinates)s(this,t);else{if(!i(t))throw"Terraformer: invalid input for Terraformer.Polygon";this.coordinates=t}this.type="Polygon"}function H(t){if(t&&"MultiPolygon"===t.type&&t.coordinates)s(this,t);else{if(!i(t))throw"Terraformer: invalid input for Terraformer.MultiPolygon";this.coordinates=t}this.type="MultiPolygon"}function D(t){if(t&&"Feature"===t.type)s(this,t);else{if(!(t&&t.type&&t.coordinates))throw"Terraformer: invalid input for Terraformer.Feature";this.geometry=t}this.type="Feature"}function R(t){if(t&&"FeatureCollection"===t.type&&t.features)s(this,t);else{if(!i(t))throw"Terraformer: invalid input for Terraformer.FeatureCollection";this.features=t}this.type="FeatureCollection"}function J(t){if(t&&"GeometryCollection"===t.type&&t.geometries)s(this,t);else if(i(t))this.geometries=t;else{if(!t.coordinates||!t.type)throw"Terraformer: invalid input for Terraformer.GeometryCollection";this.type="GeometryCollection",this.geometries=[t]}this.type="GeometryCollection"}function U(t,e,r){for(var o=d(t),n=r||64,i={type:"Polygon",coordinates:[[]]},s=1;s<=n;s++){var a=s*(360/n)*Math.PI/180;i.coordinates[0].push([o[0]+e*Math.cos(a),o[1]+e*Math.sin(a)])}return i.coordinates=E(i.coordinates),w(i)}function q(t,e,r){var o=r||64,n=e||250;if(!t||t.length<2||!n||!o)throw new Error("Terraformer: missing parameter for Terraformer.Circle");s(this,new D({type:"Feature",geometry:U(t,n,o),properties:{radius:n,center:t,steps:o}}))}return I.prototype.toMercator=function(){return v(this)},I.prototype.toGeographic=function(){return w(this)},I.prototype.envelope=function(){return l(this)},I.prototype.bbox=function(){return a(this)},I.prototype.convexHull=function(){var t,e,r=[];if("Point"===this.type)return null;if("LineString"===this.type||"MultiPoint"===this.type){if(!(this.coordinates&&this.coordinates.length>=3))return null;r=this.coordinates}else if("Polygon"===this.type||"MultiLineString"===this.type){if(!(this.coordinates&&this.coordinates.length>0))return null;for(t=0;t<this.coordinates.length;t++)r=r.concat(this.coordinates[t]);if(r.length<3)return null}else if("MultiPolygon"===this.type){if(!(this.coordinates&&this.coordinates.length>0))return null;for(t=0;t<this.coordinates.length;t++)for(e=0;e<this.coordinates[t].length;e++)r=r.concat(this.coordinates[t][e]);if(r.length<3)return null}else if("Feature"===this.type)return new I(this.geometry).convexHull();return new A({type:"Polygon",coordinates:E([b(r)])})},I.prototype.toJSON=function(){var t={};for(var e in this)this.hasOwnProperty(e)&&-1===_.indexOf(e)&&(t[e]=this[e]);return t.bbox=a(this),t},I.prototype.contains=function(t){return new I(t).within(this)},I.prototype.within=function(t){var e,r,o;if("Feature"===t.type&&(t=t.geometry),"Point"===t.type&&"Point"===this.type)return k(this.coordinates,t.coordinates);if("MultiLineString"===t.type&&"Point"===this.type)for(e=0;e<t.coordinates.length;e++){var n={type:"LineString",coordinates:t.coordinates[e]};if(this.within(n))return!0}if(("LineString"===t.type||"MultiPoint"===t.type)&&"Point"===this.type)for(e=0;e<t.coordinates.length;e++){if(this.coordinates.length!==t.coordinates[e].length)return!1;if(k(this.coordinates,t.coordinates[e]))return!0}if("Polygon"===t.type){if("Polygon"===this.type){if(t.coordinates.length===this.coordinates.length)for(e=0;e<this.coordinates.length;e++)if(G(this.coordinates[e],t.coordinates[e]))return!0;return!(!this.coordinates.length||!C(t.coordinates,this.coordinates[0][0]))&&!x(E(this.coordinates),E(t.coordinates))}if("Point"===this.type)return C(t.coordinates,this.coordinates);if("LineString"===this.type||"MultiPoint"===this.type){if(!this.coordinates||0===this.coordinates.length)return!1;for(e=0;e<this.coordinates.length;e++)if(!1===C(t.coordinates,this.coordinates[e]))return!1;return!0}if("MultiLineString"===this.type){for(e=0;e<this.coordinates.length;e++)if(!1===new N(this.coordinates[e]).within(t))return o++,!1;return!0}if("MultiPolygon"===this.type){for(e=0;e<this.coordinates.length;e++)if(!1===new I({type:"Polygon",coordinates:this.coordinates[e]}).within(t))return!1;return!0}}if("MultiPolygon"===t.type){if("Point"===this.type){if(t.coordinates.length)for(e=0;e<t.coordinates.length;e++)if(C(t.coordinates[e],this.coordinates)&&!1===x([this.coordinates],t.coordinates))return!0;return!1}if("Polygon"===this.type){for(e=0;e<this.coordinates.length;e++)if(t.coordinates[e].length===this.coordinates.length)for(r=0;r<this.coordinates.length;r++)if(G(this.coordinates[r],t.coordinates[e][r]))return!0;if(!1===x(this.coordinates,t.coordinates)&&t.coordinates.length){for(e=0;e<t.coordinates.length;e++)o=!1!==C(t.coordinates[e],this.coordinates[0][0]);return o}}else if("LineString"===this.type||"MultiPoint"===this.type)for(e=0;e<t.coordinates.length;e++){var i={type:"Polygon",coordinates:t.coordinates[e]};return!!this.within(i)}else{if("MultiLineString"===this.type){for(e=0;e<this.coordinates.length;e++)if(!1===new N(this.coordinates[e]).within(t))return!1;return!0}if("MultiPolygon"===this.type){for(e=0;e<t.coordinates.length;e++){var s={type:"Polygon",coordinates:t.coordinates[e]};if(!1===this.within(s))return!1}return!0}}}return!1},I.prototype.intersects=function(t){"Feature"===t.type&&(t=t.geometry);var e=new I(t);return!(!this.within(t)&&!e.within(this))||("Point"!==this.type&&"MultiPoint"!==this.type&&"Point"!==t.type&&"MultiPoint"!==t.type?x(this.coordinates,t.coordinates):"Feature"===this.type?new I(this.geometry).intersects(t):(function(){var t=Array.prototype.slice.apply(arguments);void 0!==typeof console&&console.warn&&console.warn.apply(console,t)}("Type "+this.type+" to "+t.type+" intersection is not supported by intersects"),!1))},O.prototype=new I,O.prototype.constructor=O,V.prototype=new I,V.prototype.constructor=V,V.prototype.forEach=function(t){for(var e=0;e<this.coordinates.length;e++)t.apply(this,[this.coordinates[e],e,this.coordinates]);return this},V.prototype.addPoint=function(t){return this.coordinates.push(t),this},V.prototype.insertPoint=function(t,e){return this.coordinates.splice(e,0,t),this},V.prototype.removePoint=function(t){return"number"===typeof t?this.coordinates.splice(t,1):this.coordinates.splice(this.coordinates.indexOf(t),1),this},V.prototype.get=function(t){return new O(this.coordinates[t])},N.prototype=new I,N.prototype.constructor=N,N.prototype.addVertex=function(t){return this.coordinates.push(t),this},N.prototype.insertVertex=function(t,e){return this.coordinates.splice(e,0,t),this},N.prototype.removeVertex=function(t){return this.coordinates.splice(t,1),this},j.prototype=new I,j.prototype.constructor=j,j.prototype.forEach=function(t){for(var e=0;e<this.coordinates.length;e++)t.apply(this,[this.coordinates[e],e,this.coordinates])},j.prototype.get=function(t){return new N(this.coordinates[t])},A.prototype=new I,A.prototype.constructor=A,A.prototype.addVertex=function(t){return this.insertVertex(t,this.coordinates[0].length-1),this},A.prototype.insertVertex=function(t,e){return this.coordinates[0].splice(e,0,t),this},A.prototype.removeVertex=function(t){return this.coordinates[0].splice(t,1),this},A.prototype.close=function(){this.coordinates=E(this.coordinates)},A.prototype.hasHoles=function(){return this.coordinates.length>1},A.prototype.holes=function(){var t=[];if(this.hasHoles())for(var e=1;e<this.coordinates.length;e++)t.push(new A([this.coordinates[e]]));return t},H.prototype=new I,H.prototype.constructor=H,H.prototype.forEach=function(t){for(var e=0;e<this.coordinates.length;e++)t.apply(this,[this.coordinates[e],e,this.coordinates])},H.prototype.get=function(t){return new A(this.coordinates[t])},H.prototype.close=function(){var t=[];return this.forEach((function(e){t.push(E(e))})),this.coordinates=t,this},D.prototype=new I,D.prototype.constructor=D,R.prototype=new I,R.prototype.constructor=R,R.prototype.forEach=function(t){for(var e=0;e<this.features.length;e++)t.apply(this,[this.features[e],e,this.features])},R.prototype.get=function(t){var e;return this.forEach((function(r){r.id===t&&(e=r)})),new D(e)},J.prototype=new I,J.prototype.constructor=J,J.prototype.forEach=function(t){for(var e=0;e<this.geometries.length;e++)t.apply(this,[this.geometries[e],e,this.geometries])},J.prototype.get=function(t){return new I(this.geometries[t])},q.prototype=new I,q.prototype.constructor=q,q.prototype.recalculate=function(){return this.geometry=U(this.properties.center,this.properties.radius,this.properties.steps),this},q.prototype.center=function(t){return t&&(this.properties.center=t,this.recalculate()),this.properties.center},q.prototype.radius=function(t){return t&&(this.properties.radius=t,this.recalculate()),this.properties.radius},q.prototype.steps=function(t){return t&&(this.properties.steps=t,this.recalculate()),this.properties.steps},q.prototype.toJSON=function(){return I.prototype.toJSON.call(this)},t.Primitive=I,t.Point=O,t.MultiPoint=V,t.LineString=N,t.MultiLineString=j,t.Polygon=A,t.MultiPolygon=H,t.Feature=D,t.FeatureCollection=R,t.GeometryCollection=J,t.Circle=q,t.toMercator=v,t.toGeographic=w,t.Tools={},t.Tools.positionToMercator=d,t.Tools.positionToGeographic=y,t.Tools.applyConverter=g,t.Tools.toMercator=v,t.Tools.toGeographic=w,t.Tools.createCircle=U,t.Tools.calculateBounds=a,t.Tools.calculateEnvelope=l,t.Tools.coordinatesContainPoint=S,t.Tools.polygonContainsPoint=C,t.Tools.arraysIntersectArrays=x,t.Tools.coordinatesContainPoint=S,t.Tools.coordinatesEqual=G,t.Tools.convexHull=b,t.Tools.isConvex=function(t){for(var e,r=0;r<t.length-3;r++){var o=t[r],n=t[r+1],i=t[r+2],s=[n[0]-o[0],n[1]-o[1]],a=i[0]*s[1]-i[1]*s[0]+s[0]*o[1]-s[1]*o[0];if(0===r)e=a<0;else if(e&&a>0||!e&&a<0)return!1}return!0},t.MercatorCRS=n,t.GeographicCRS={type:"link",properties:{href:"http://spatialreference.org/ref/epsg/4326/ogcwkt/",type:"ogcwkt"}},t},"object"===typeof t.exports&&(t.exports=o()),"object"===typeof window&&(r.Terraformer=o())}}]); +!function(){try{var t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},e=(new Error).stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="94ee767d-38f0-427a-8d93-c729ccab19ce",t._sentryDebugIdIdentifier="sentry-dbid-94ee767d-38f0-427a-8d93-c729ccab19ce")}catch(t){}}();var _global="undefined"!==typeof window?window:"undefined"!==typeof global?global:"undefined"!==typeof self?self:{};_global.SENTRY_RELEASE={id:"a2b8e2612b2ee50152f1f5ccf84a620164236ffa"},(self.webpackChunklocal_services_lookup=self.webpackChunklocal_services_lookup||[]).push([[47],{2257:function(t,e){var r,o;r=this,o=function(){"use strict";var t={},e=6378137,r=57.29577951308232,o=.017453292519943,n={type:"link",properties:{href:"http://spatialreference.org/ref/sr-org/6928/ogcwkt/",type:"ogcwkt"}};function i(t){return"[object Array]"===Object.prototype.toString.call(t)}function s(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);return t}function a(t){if(t.type)switch(t.type){case"Point":return[t.coordinates[0],t.coordinates[1],t.coordinates[0],t.coordinates[1]];case"MultiPoint":case"LineString":return u(t.coordinates);case"MultiLineString":case"Polygon":return c(t.coordinates);case"MultiPolygon":return function(t){for(var e=null,r=null,o=null,n=null,i=0;i<t.length;i++)for(var s=t[i],a=0;a<s.length;a++)for(var c=s[a],u=0;u<c.length;u++){var l=c[u],h=l[0],p=l[1];(null===e||h<e)&&(e=h),(null===r||h>r)&&(r=h),(null===o||p<o)&&(o=p),(null===n||p>n)&&(n=p)}return[e,o,r,n]}(t.coordinates);case"Feature":return t.geometry?a(t.geometry):null;case"FeatureCollection":return function(t){for(var e,r=[],o=t.features.length-1;o>=0;o--)e=a(t.features[o].geometry),r.push([e[0],e[1]]),r.push([e[2],e[3]]);return u(r)}(t);case"GeometryCollection":return function(t){for(var e,r=[],o=t.geometries.length-1;o>=0;o--)e=a(t.geometries[o]),r.push([e[0],e[1]]),r.push([e[2],e[3]]);return u(r)}(t);default:throw new Error("Unknown type: "+t.type)}return null}function c(t){for(var e=null,r=null,o=null,n=null,i=0;i<t.length;i++)for(var s=t[i],a=0;a<s.length;a++){var c=s[a],u=c[0],l=c[1];(null===e||u<e)&&(e=u),(null===r||u>r)&&(r=u),(null===o||l<o)&&(o=l),(null===n||l>n)&&(n=l)}return[e,o,r,n]}function u(t){for(var e=null,r=null,o=null,n=null,i=0;i<t.length;i++){var s=t[i],a=s[0],c=s[1];(null===e||a<e)&&(e=a),(null===r||a>r)&&(r=a),(null===o||c<o)&&(o=c),(null===n||c>n)&&(n=c)}return[e,o,r,n]}function l(t){var e=a(t);return{x:e[0],y:e[1],w:Math.abs(e[0]-e[2]),h:Math.abs(e[1]-e[3])}}function h(t){return t*r}function p(t){return t*o}function f(t,e){for(var r=0;r<t.length;r++)"number"===typeof t[r][0]&&(t[r]=e(t[r])),"object"===typeof t[r]&&(t[r]=f(t[r],e));return t}function y(t){var r=t[0],o=t[1];return[h(r/e)-360*Math.floor((h(r/e)+180)/360),h(Math.PI/2-2*Math.atan(Math.exp(-1*o/e)))]}function d(t){var r=t[0],o=Math.max(Math.min(t[1],89.99999),-89.99999);return[p(r)*e,e/2*Math.log((1+Math.sin(p(o)))/(1-Math.sin(p(o))))]}function g(t,e,r){if("Point"===t.type)t.coordinates=e(t.coordinates);else if("Feature"===t.type)t.geometry=g(t.geometry,e,!0);else if("FeatureCollection"===t.type)for(var o=0;o<t.features.length;o++)t.features[o]=g(t.features[o],e,!0);else if("GeometryCollection"===t.type)for(var i=0;i<t.geometries.length;i++)t.geometries[i]=g(t.geometries[i],e,!0);else t.coordinates=f(t.coordinates,e);return r||e===d&&(t.crs=n),e===y&&delete t.crs,t}function v(t){return g(t,d)}function w(t){return g(t,y)}function P(t,e){return t[0]>e[0]?-1:t[0]<e[0]?1:t[1]>e[1]?-1:t[1]<e[1]?1:0}function m(t,e,r){return(o=(e[0]-t[0])*(r[1]-t[1])-(r[0]-t[0])*(e[1]-t[1]))<(n=0)?-1:o>n?1:0;var o,n}function M(t,e){var r=e[0]-t[0],o=e[1]-t[1];return r*r+o*o}function T(t,e){var r=e;for(var o in t){var n=m(e,r,t[o]);(-1===n||0===n&&M(e,t[o])>M(e,r))&&(r=t[o])}return r}function b(t){if(0===t.length)return[];if(1===t.length)return t;for(var e=[t.sort(P)[0]],r=0;r<e.length;r++){var o=T(t,e[r]);o!==e[0]&&e.push(o)}return e}function S(t,e){for(var r=!1,o=-1,n=t.length,i=n-1;++o<n;i=o)(t[o][1]<=e[1]&&e[1]<t[i][1]||t[i][1]<=e[1]&&e[1]<t[o][1])&&e[0]<(t[i][0]-t[o][0])*(e[1]-t[o][1])/(t[i][1]-t[o][1])+t[o][0]&&(r=!r);return r}function C(t,e){if(t&&t.length){if(1===t.length)return S(t[0],e);if(S(t[0],e)){for(var r=1;r<t.length;r++)if(S(t[r],e))return!1;return!0}return!1}return!1}function L(t,e,r,o){var n=(o[0]-r[0])*(t[1]-r[1])-(o[1]-r[1])*(t[0]-r[0]),i=(e[0]-t[0])*(t[1]-r[1])-(e[1]-t[1])*(t[0]-r[0]),s=(o[1]-r[1])*(e[0]-t[0])-(o[0]-r[0])*(e[1]-t[1]);if(0!==s){var a=n/s,c=i/s;if(0<=a&&a<=1&&0<=c&&c<=1)return!0}return!1}function F(t){return!isNaN(parseFloat(t))&&isFinite(t)}function x(t,e){if(F(t[0][0])){if(F(e[0][0])){for(var r=0;r<t.length-1;r++)for(var o=0;o<e.length-1;o++)if(L(t[r],t[r+1],e[o],e[o+1]))return!0}else for(var n=0;n<e.length;n++)if(x(t,e[n]))return!0}else for(var i=0;i<t.length;i++)if(x(t[i],e))return!0;return!1}function E(t){for(var e=[],r=0;r<t.length;r++){var o=t[r].slice();!1===k(o[0],o[o.length-1])&&o.push(o[0]),e.push(o)}return e}function k(t,e){for(var r=0;r<t.length;r++)if(t[r]!==e[r])return!1;return!0}function G(t,e){if(t.length!==e.length)return!1;for(var r=t.slice().sort(P),o=e.slice().sort(P),n=0;n<r.length;n++){if(r[n].length!==o[n].length)return!1;for(var i=0;i<r.length;i++)if(r[n][i]!==o[n][i])return!1}return!0}var _=["length"];function I(t){if(t)switch(t.type){case"Point":return new O(t);case"MultiPoint":return new V(t);case"LineString":return new N(t);case"MultiLineString":return new j(t);case"Polygon":return new A(t);case"MultiPolygon":return new H(t);case"Feature":return new D(t);case"FeatureCollection":return new R(t);case"GeometryCollection":return new J(t);default:throw new Error("Unknown type: "+t.type)}}function O(t){var e=Array.prototype.slice.call(arguments);if(t&&"Point"===t.type&&t.coordinates)s(this,t);else if(t&&i(t))this.coordinates=t;else{if(!(e.length>=2))throw"Terraformer: invalid input for Terraformer.Point";this.coordinates=e}this.type="Point"}function V(t){if(t&&"MultiPoint"===t.type&&t.coordinates)s(this,t);else{if(!i(t))throw"Terraformer: invalid input for Terraformer.MultiPoint";this.coordinates=t}this.type="MultiPoint"}function N(t){if(t&&"LineString"===t.type&&t.coordinates)s(this,t);else{if(!i(t))throw"Terraformer: invalid input for Terraformer.LineString";this.coordinates=t}this.type="LineString"}function j(t){if(t&&"MultiLineString"===t.type&&t.coordinates)s(this,t);else{if(!i(t))throw"Terraformer: invalid input for Terraformer.MultiLineString";this.coordinates=t}this.type="MultiLineString"}function A(t){if(t&&"Polygon"===t.type&&t.coordinates)s(this,t);else{if(!i(t))throw"Terraformer: invalid input for Terraformer.Polygon";this.coordinates=t}this.type="Polygon"}function H(t){if(t&&"MultiPolygon"===t.type&&t.coordinates)s(this,t);else{if(!i(t))throw"Terraformer: invalid input for Terraformer.MultiPolygon";this.coordinates=t}this.type="MultiPolygon"}function D(t){if(t&&"Feature"===t.type)s(this,t);else{if(!(t&&t.type&&t.coordinates))throw"Terraformer: invalid input for Terraformer.Feature";this.geometry=t}this.type="Feature"}function R(t){if(t&&"FeatureCollection"===t.type&&t.features)s(this,t);else{if(!i(t))throw"Terraformer: invalid input for Terraformer.FeatureCollection";this.features=t}this.type="FeatureCollection"}function J(t){if(t&&"GeometryCollection"===t.type&&t.geometries)s(this,t);else if(i(t))this.geometries=t;else{if(!t.coordinates||!t.type)throw"Terraformer: invalid input for Terraformer.GeometryCollection";this.type="GeometryCollection",this.geometries=[t]}this.type="GeometryCollection"}function U(t,e,r){for(var o=d(t),n=r||64,i={type:"Polygon",coordinates:[[]]},s=1;s<=n;s++){var a=s*(360/n)*Math.PI/180;i.coordinates[0].push([o[0]+e*Math.cos(a),o[1]+e*Math.sin(a)])}return i.coordinates=E(i.coordinates),w(i)}function q(t,e,r){var o=r||64,n=e||250;if(!t||t.length<2||!n||!o)throw new Error("Terraformer: missing parameter for Terraformer.Circle");s(this,new D({type:"Feature",geometry:U(t,n,o),properties:{radius:n,center:t,steps:o}}))}return I.prototype.toMercator=function(){return v(this)},I.prototype.toGeographic=function(){return w(this)},I.prototype.envelope=function(){return l(this)},I.prototype.bbox=function(){return a(this)},I.prototype.convexHull=function(){var t,e,r=[];if("Point"===this.type)return null;if("LineString"===this.type||"MultiPoint"===this.type){if(!(this.coordinates&&this.coordinates.length>=3))return null;r=this.coordinates}else if("Polygon"===this.type||"MultiLineString"===this.type){if(!(this.coordinates&&this.coordinates.length>0))return null;for(t=0;t<this.coordinates.length;t++)r=r.concat(this.coordinates[t]);if(r.length<3)return null}else if("MultiPolygon"===this.type){if(!(this.coordinates&&this.coordinates.length>0))return null;for(t=0;t<this.coordinates.length;t++)for(e=0;e<this.coordinates[t].length;e++)r=r.concat(this.coordinates[t][e]);if(r.length<3)return null}else if("Feature"===this.type)return new I(this.geometry).convexHull();return new A({type:"Polygon",coordinates:E([b(r)])})},I.prototype.toJSON=function(){var t={};for(var e in this)this.hasOwnProperty(e)&&-1===_.indexOf(e)&&(t[e]=this[e]);return t.bbox=a(this),t},I.prototype.contains=function(t){return new I(t).within(this)},I.prototype.within=function(t){var e,r,o;if("Feature"===t.type&&(t=t.geometry),"Point"===t.type&&"Point"===this.type)return k(this.coordinates,t.coordinates);if("MultiLineString"===t.type&&"Point"===this.type)for(e=0;e<t.coordinates.length;e++){var n={type:"LineString",coordinates:t.coordinates[e]};if(this.within(n))return!0}if(("LineString"===t.type||"MultiPoint"===t.type)&&"Point"===this.type)for(e=0;e<t.coordinates.length;e++){if(this.coordinates.length!==t.coordinates[e].length)return!1;if(k(this.coordinates,t.coordinates[e]))return!0}if("Polygon"===t.type){if("Polygon"===this.type){if(t.coordinates.length===this.coordinates.length)for(e=0;e<this.coordinates.length;e++)if(G(this.coordinates[e],t.coordinates[e]))return!0;return!(!this.coordinates.length||!C(t.coordinates,this.coordinates[0][0]))&&!x(E(this.coordinates),E(t.coordinates))}if("Point"===this.type)return C(t.coordinates,this.coordinates);if("LineString"===this.type||"MultiPoint"===this.type){if(!this.coordinates||0===this.coordinates.length)return!1;for(e=0;e<this.coordinates.length;e++)if(!1===C(t.coordinates,this.coordinates[e]))return!1;return!0}if("MultiLineString"===this.type){for(e=0;e<this.coordinates.length;e++)if(!1===new N(this.coordinates[e]).within(t))return o++,!1;return!0}if("MultiPolygon"===this.type){for(e=0;e<this.coordinates.length;e++)if(!1===new I({type:"Polygon",coordinates:this.coordinates[e]}).within(t))return!1;return!0}}if("MultiPolygon"===t.type){if("Point"===this.type){if(t.coordinates.length)for(e=0;e<t.coordinates.length;e++)if(C(t.coordinates[e],this.coordinates)&&!1===x([this.coordinates],t.coordinates))return!0;return!1}if("Polygon"===this.type){for(e=0;e<this.coordinates.length;e++)if(t.coordinates[e].length===this.coordinates.length)for(r=0;r<this.coordinates.length;r++)if(G(this.coordinates[r],t.coordinates[e][r]))return!0;if(!1===x(this.coordinates,t.coordinates)&&t.coordinates.length){for(e=0;e<t.coordinates.length;e++)o=!1!==C(t.coordinates[e],this.coordinates[0][0]);return o}}else if("LineString"===this.type||"MultiPoint"===this.type)for(e=0;e<t.coordinates.length;e++){var i={type:"Polygon",coordinates:t.coordinates[e]};return!!this.within(i)}else{if("MultiLineString"===this.type){for(e=0;e<this.coordinates.length;e++)if(!1===new N(this.coordinates[e]).within(t))return!1;return!0}if("MultiPolygon"===this.type){for(e=0;e<t.coordinates.length;e++){var s={type:"Polygon",coordinates:t.coordinates[e]};if(!1===this.within(s))return!1}return!0}}}return!1},I.prototype.intersects=function(t){"Feature"===t.type&&(t=t.geometry);var e=new I(t);return!(!this.within(t)&&!e.within(this))||("Point"!==this.type&&"MultiPoint"!==this.type&&"Point"!==t.type&&"MultiPoint"!==t.type?x(this.coordinates,t.coordinates):"Feature"===this.type?new I(this.geometry).intersects(t):(function(){var t=Array.prototype.slice.apply(arguments);void 0!==typeof console&&console.warn&&console.warn.apply(console,t)}("Type "+this.type+" to "+t.type+" intersection is not supported by intersects"),!1))},O.prototype=new I,O.prototype.constructor=O,V.prototype=new I,V.prototype.constructor=V,V.prototype.forEach=function(t){for(var e=0;e<this.coordinates.length;e++)t.apply(this,[this.coordinates[e],e,this.coordinates]);return this},V.prototype.addPoint=function(t){return this.coordinates.push(t),this},V.prototype.insertPoint=function(t,e){return this.coordinates.splice(e,0,t),this},V.prototype.removePoint=function(t){return"number"===typeof t?this.coordinates.splice(t,1):this.coordinates.splice(this.coordinates.indexOf(t),1),this},V.prototype.get=function(t){return new O(this.coordinates[t])},N.prototype=new I,N.prototype.constructor=N,N.prototype.addVertex=function(t){return this.coordinates.push(t),this},N.prototype.insertVertex=function(t,e){return this.coordinates.splice(e,0,t),this},N.prototype.removeVertex=function(t){return this.coordinates.splice(t,1),this},j.prototype=new I,j.prototype.constructor=j,j.prototype.forEach=function(t){for(var e=0;e<this.coordinates.length;e++)t.apply(this,[this.coordinates[e],e,this.coordinates])},j.prototype.get=function(t){return new N(this.coordinates[t])},A.prototype=new I,A.prototype.constructor=A,A.prototype.addVertex=function(t){return this.insertVertex(t,this.coordinates[0].length-1),this},A.prototype.insertVertex=function(t,e){return this.coordinates[0].splice(e,0,t),this},A.prototype.removeVertex=function(t){return this.coordinates[0].splice(t,1),this},A.prototype.close=function(){this.coordinates=E(this.coordinates)},A.prototype.hasHoles=function(){return this.coordinates.length>1},A.prototype.holes=function(){var t=[];if(this.hasHoles())for(var e=1;e<this.coordinates.length;e++)t.push(new A([this.coordinates[e]]));return t},H.prototype=new I,H.prototype.constructor=H,H.prototype.forEach=function(t){for(var e=0;e<this.coordinates.length;e++)t.apply(this,[this.coordinates[e],e,this.coordinates])},H.prototype.get=function(t){return new A(this.coordinates[t])},H.prototype.close=function(){var t=[];return this.forEach((function(e){t.push(E(e))})),this.coordinates=t,this},D.prototype=new I,D.prototype.constructor=D,R.prototype=new I,R.prototype.constructor=R,R.prototype.forEach=function(t){for(var e=0;e<this.features.length;e++)t.apply(this,[this.features[e],e,this.features])},R.prototype.get=function(t){var e;return this.forEach((function(r){r.id===t&&(e=r)})),new D(e)},J.prototype=new I,J.prototype.constructor=J,J.prototype.forEach=function(t){for(var e=0;e<this.geometries.length;e++)t.apply(this,[this.geometries[e],e,this.geometries])},J.prototype.get=function(t){return new I(this.geometries[t])},q.prototype=new I,q.prototype.constructor=q,q.prototype.recalculate=function(){return this.geometry=U(this.properties.center,this.properties.radius,this.properties.steps),this},q.prototype.center=function(t){return t&&(this.properties.center=t,this.recalculate()),this.properties.center},q.prototype.radius=function(t){return t&&(this.properties.radius=t,this.recalculate()),this.properties.radius},q.prototype.steps=function(t){return t&&(this.properties.steps=t,this.recalculate()),this.properties.steps},q.prototype.toJSON=function(){return I.prototype.toJSON.call(this)},t.Primitive=I,t.Point=O,t.MultiPoint=V,t.LineString=N,t.MultiLineString=j,t.Polygon=A,t.MultiPolygon=H,t.Feature=D,t.FeatureCollection=R,t.GeometryCollection=J,t.Circle=q,t.toMercator=v,t.toGeographic=w,t.Tools={},t.Tools.positionToMercator=d,t.Tools.positionToGeographic=y,t.Tools.applyConverter=g,t.Tools.toMercator=v,t.Tools.toGeographic=w,t.Tools.createCircle=U,t.Tools.calculateBounds=a,t.Tools.calculateEnvelope=l,t.Tools.coordinatesContainPoint=S,t.Tools.polygonContainsPoint=C,t.Tools.arraysIntersectArrays=x,t.Tools.coordinatesContainPoint=S,t.Tools.coordinatesEqual=G,t.Tools.convexHull=b,t.Tools.isConvex=function(t){for(var e,r=0;r<t.length-3;r++){var o=t[r],n=t[r+1],i=t[r+2],s=[n[0]-o[0],n[1]-o[1]],a=i[0]*s[1]-i[1]*s[0]+s[0]*o[1]-s[1]*o[0];if(0===r)e=a<0;else if(e&&a>0||!e&&a<0)return!1}return!0},t.MercatorCRS=n,t.GeographicCRS={type:"link",properties:{href:"http://spatialreference.org/ref/epsg/4326/ogcwkt/",type:"ogcwkt"}},t},"object"===typeof t.exports&&(t.exports=o()),"object"===typeof window&&(r.Terraformer=o())}}]); //# sourceMappingURL=vendors.terraformer.js.map \ No newline at end of file diff --git a/build/assets/js/vendors.turf.js b/build/assets/js/vendors.turf.js index c4ec431..8f7b3c4 100644 --- a/build/assets/js/vendors.turf.js +++ b/build/assets/js/vendors.turf.js @@ -1,2 +1,2 @@ -!function(){try{var t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},e=(new Error).stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="27cc663d-32d2-47a6-ab9b-2a4a4d0845d8",t._sentryDebugIdIdentifier="sentry-dbid-27cc663d-32d2-47a6-ab9b-2a4a4d0845d8")}catch(t){}}();var _global="undefined"!==typeof window?window:"undefined"!==typeof global?global:"undefined"!==typeof self?self:{};_global.SENTRY_RELEASE={id:"b15ccfdbc7e26696234f56eb8df3a6b3a27a7fd6"},(self.webpackChunklocal_services_lookup=self.webpackChunklocal_services_lookup||[]).push([[489],{530:function(t,e){!function(t){"use strict";function e(t,e,n){if(!I(n=n||{}))throw new Error("options is invalid");var r=n.bbox,i=n.id;if(void 0===t)throw new Error("geometry is required");if(e&&e.constructor!==Object)throw new Error("properties must be an Object");r&&N(r),i&&C(i);var o={type:"Feature"};return i&&(o.id=i),r&&(o.bbox=r),o.properties=e||{},o.geometry=t,o}function n(t,e,n){if(!I(n=n||{}))throw new Error("options is invalid");var i,s=n.bbox;if(!t)throw new Error("type is required");if(!e)throw new Error("coordinates is required");if(!Array.isArray(e))throw new Error("coordinates must be an Array");switch(s&&N(s),t){case"Point":i=r(e).geometry;break;case"LineString":i=a(e).geometry;break;case"Polygon":i=o(e).geometry;break;case"MultiPoint":i=l(e).geometry;break;case"MultiLineString":i=h(e).geometry;break;case"MultiPolygon":i=p(e).geometry;break;default:throw new Error(t+" is invalid")}return s&&(i.bbox=s),i}function r(t,n,r){if(!t)throw new Error("coordinates is required");if(!Array.isArray(t))throw new Error("coordinates must be an Array");if(t.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!b(t[0])||!b(t[1]))throw new Error("coordinates must contain numbers");return e({type:"Point",coordinates:t},n,r)}function i(t,e,n){if(!t)throw new Error("coordinates is required");if(!Array.isArray(t))throw new Error("coordinates must be an Array");return c(t.map((function(t){return r(t,e)})),n)}function o(t,n,r){if(!t)throw new Error("coordinates is required");for(var i=0;i<t.length;i++){var o=t[i];if(o.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var s=0;s<o[o.length-1].length;s++){if(0===i&&0===s&&!b(o[0][0])||!b(o[0][1]))throw new Error("coordinates must contain numbers");if(o[o.length-1][s]!==o[0][s])throw new Error("First and last Position are not equivalent.")}}return e({type:"Polygon",coordinates:t},n,r)}function s(t,e,n){if(!t)throw new Error("coordinates is required");if(!Array.isArray(t))throw new Error("coordinates must be an Array");return c(t.map((function(t){return o(t,e)})),n)}function a(t,n,r){if(!t)throw new Error("coordinates is required");if(t.length<2)throw new Error("coordinates must be an array of two or more positions");if(!b(t[0][1])||!b(t[0][1]))throw new Error("coordinates must contain numbers");return e({type:"LineString",coordinates:t},n,r)}function u(t,e,n){if(!t)throw new Error("coordinates is required");if(!Array.isArray(t))throw new Error("coordinates must be an Array");return c(t.map((function(t){return a(t,e)})),n)}function c(t,e){if(!I(e=e||{}))throw new Error("options is invalid");var n=e.bbox,r=e.id;if(!t)throw new Error("No features passed");if(!Array.isArray(t))throw new Error("features must be an Array");n&&N(n),r&&C(r);var i={type:"FeatureCollection"};return r&&(i.id=r),n&&(i.bbox=n),i.features=t,i}function h(t,n,r){if(!t)throw new Error("coordinates is required");return e({type:"MultiLineString",coordinates:t},n,r)}function l(t,n,r){if(!t)throw new Error("coordinates is required");return e({type:"MultiPoint",coordinates:t},n,r)}function p(t,n,r){if(!t)throw new Error("coordinates is required");return e({type:"MultiPolygon",coordinates:t},n,r)}function f(t,n,r){if(!t)throw new Error("geometries is required");if(!Array.isArray(t))throw new Error("geometries must be an Array");return e({type:"GeometryCollection",geometries:t},n,r)}function g(t,e){if(void 0===t||null===t||isNaN(t))throw new Error("num is required");if(e&&!(e>=0))throw new Error("precision must be a positive number");var n=Math.pow(10,e||0);return Math.round(t*n)/n}function d(t,e){if(void 0===t||null===t)throw new Error("radians is required");if(e&&"string"!=typeof e)throw new Error("units must be a string");var n=qo[e||"kilometers"];if(!n)throw new Error(e+" units is invalid");return t*n}function y(t,e){if(void 0===t||null===t)throw new Error("distance is required");if(e&&"string"!=typeof e)throw new Error("units must be a string");var n=qo[e||"kilometers"];if(!n)throw new Error(e+" units is invalid");return t/n}function _(t,e){return v(y(t,e))}function m(t){if(null===t||void 0===t)throw new Error("bearing is required");var e=t%360;return e<0&&(e+=360),e}function v(t){if(null===t||void 0===t)throw new Error("radians is required");return t%(2*Math.PI)*180/Math.PI}function x(t){if(null===t||void 0===t)throw new Error("degrees is required");return t%360*Math.PI/180}function E(t,e,n){if(null===t||void 0===t)throw new Error("length is required");if(!(t>=0))throw new Error("length must be a positive number");return d(y(t,e),n||"kilometers")}function w(t,e,n){if(null===t||void 0===t)throw new Error("area is required");if(!(t>=0))throw new Error("area must be a positive number");var r=Bo[e||"meters"];if(!r)throw new Error("invalid original units");var i=Bo[n||"kilometers"];if(!i)throw new Error("invalid final units");return t/r*i}function b(t){return!isNaN(t)&&null!==t&&!Array.isArray(t)}function I(t){return!!t&&t.constructor===Object}function N(t){if(!t)throw new Error("bbox is required");if(!Array.isArray(t))throw new Error("bbox must be an Array");if(4!==t.length&&6!==t.length)throw new Error("bbox must be an Array of 4 or 6 numbers");t.forEach((function(t){if(!b(t))throw new Error("bbox must only contain numbers")}))}function C(t){if(!t)throw new Error("id is required");if(-1===["string","number"].indexOf(typeof t))throw new Error("id must be a number or a string")}function S(t,e,n){if(null!==t)for(var r,i,o,s,a,u,c,h,l=0,p=0,f=t.type,g="FeatureCollection"===f,d="Feature"===f,y=g?t.features.length:1,_=0;_<y;_++){a=(h=!!(c=g?t.features[_].geometry:d?t.geometry:t)&&"GeometryCollection"===c.type)?c.geometries.length:1;for(var m=0;m<a;m++){var v=0,x=0;if(null!==(s=h?c.geometries[m]:c)){u=s.coordinates;var E=s.type;switch(l=!n||"Polygon"!==E&&"MultiPolygon"!==E?0:1,E){case null:break;case"Point":e(u,p,_,v,x),p++,v++;break;case"LineString":case"MultiPoint":for(r=0;r<u.length;r++)e(u[r],p,_,v,x),p++,"MultiPoint"===E&&v++;"LineString"===E&&v++;break;case"Polygon":case"MultiLineString":for(r=0;r<u.length;r++){for(i=0;i<u[r].length-l;i++)e(u[r][i],p,_,v,x),p++;"MultiLineString"===E&&v++,"Polygon"===E&&x++}"Polygon"===E&&v++;break;case"MultiPolygon":for(r=0;r<u.length;r++){for("MultiPolygon"===E&&(x=0),i=0;i<u[r].length;i++){for(o=0;o<u[r][i].length-l;o++)e(u[r][i][o],p,_,v,x),p++;x++}v++}break;case"GeometryCollection":for(r=0;r<s.geometries.length;r++)S(s.geometries[r],e,n);break;default:throw new Error("Unknown Geometry Type")}}}}}function M(t,e,n,r){var i=n;return S(t,(function(t,r,o,s,a){i=0===r&&void 0===n?t:e(i,t,r,o,s,a)}),r),i}function L(t,e){var n;switch(t.type){case"FeatureCollection":for(n=0;n<t.features.length;n++)e(t.features[n].properties,n);break;case"Feature":e(t.properties,0)}}function P(t,e,n){var r=n;return L(t,(function(t,i){r=0===i&&void 0===n?t:e(r,t,i)})),r}function O(t,e){if("Feature"===t.type)e(t,0);else if("FeatureCollection"===t.type)for(var n=0;n<t.features.length;n++)e(t.features[n],n)}function R(t,e,n){var r=n;return O(t,(function(t,i){r=0===i&&void 0===n?t:e(r,t,i)})),r}function T(t){var e=[];return S(t,(function(t){e.push(t)})),e}function A(t,e){var n,r,i,o,s,a,u,c,h,l,p=0,f="FeatureCollection"===t.type,g="Feature"===t.type,d=f?t.features.length:1;for(n=0;n<d;n++){for(a=f?t.features[n].geometry:g?t.geometry:t,c=f?t.features[n].properties:g?t.properties:{},h=f?t.features[n].bbox:g?t.bbox:void 0,l=f?t.features[n].id:g?t.id:void 0,s=(u=!!a&&"GeometryCollection"===a.type)?a.geometries.length:1,i=0;i<s;i++)if(null!==(o=u?a.geometries[i]:a))switch(o.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":e(o,p,c,h,l);break;case"GeometryCollection":for(r=0;r<o.geometries.length;r++)e(o.geometries[r],p,c,h,l);break;default:throw new Error("Unknown Geometry Type")}else e(null,p,c,h,l);p++}}function D(t,e,n){var r=n;return A(t,(function(t,i,o,s,a){r=0===i&&void 0===n?t:e(r,t,i,o,s,a)})),r}function F(t,n){A(t,(function(t,r,i,o,s){var a,u=null===t?null:t.type;switch(u){case null:case"Point":case"LineString":case"Polygon":return void n(e(t,i,{bbox:o,id:s}),r,0)}switch(u){case"MultiPoint":a="Point";break;case"MultiLineString":a="LineString";break;case"MultiPolygon":a="Polygon"}t.coordinates.forEach((function(t,o){n(e({type:a,coordinates:t},i),r,o)}))}))}function q(t,e,n){var r=n;return F(t,(function(t,i,o){r=0===i&&0===o&&void 0===n?t:e(r,t,i,o)})),r}function G(t,e){F(t,(function(t,n,r){var i=0;if(t.geometry){var o=t.geometry.type;"Point"!==o&&"MultiPoint"!==o&&M(t,(function(o,s,u,c,h,l){var p=a([o,s],t.properties);return e(p,n,r,l,i),i++,s}))}}))}function B(t,e,n){var r=n,i=!1;return G(t,(function(t,o,s,a,u){r=!1===i&&void 0===n?t:e(r,t,o,s,a,u),i=!0})),r}function k(t,e){if(!t)throw new Error("geojson is required");F(t,(function(t,n,r){if(null!==t.geometry){var i=t.geometry.type,o=t.geometry.coordinates;switch(i){case"LineString":e(t,n,r,0,0);break;case"Polygon":for(var s=0;s<o.length;s++)e(a(o[s],t.properties),n,r,s)}}}))}function z(t,e,n){var r=n;return k(t,(function(t,i,o,s){r=0===i&&void 0===n?t:e(r,t,i,o,s)})),r}function j(t){var e=[1/0,1/0,-1/0,-1/0];return S(t,(function(t){e[0]>t[0]&&(e[0]=t[0]),e[1]>t[1]&&(e[1]=t[1]),e[2]<t[0]&&(e[2]=t[0]),e[3]<t[1]&&(e[3]=t[1])})),e}function X(t){if(!t)throw new Error("obj is required");var e=U(t);if(e.length>1&&b(e[0])&&b(e[1]))return e;throw new Error("Coordinate is not a valid Point")}function U(t){if(!t)throw new Error("obj is required");var e;if(t.length?e=t:t.coordinates?e=t.coordinates:t.geometry&&t.geometry.coordinates&&(e=t.geometry.coordinates),e)return Y(e),e;throw new Error("No valid coordinates")}function Y(t){if(t.length>1&&b(t[0])&&b(t[1]))return!0;if(Array.isArray(t[0])&&t[0].length)return Y(t[0]);throw new Error("coordinates must only contain numbers")}function V(t,e,n){if(!e||!n)throw new Error("type and name required");if(!t||t.type!==e)throw new Error("Invalid input to "+n+": must be a "+e+", given "+t.type)}function H(t,e,n){if(!t)throw new Error("No feature passed");if(!n)throw new Error(".featureOf() requires a name");if(!t||"Feature"!==t.type||!t.geometry)throw new Error("Invalid input to "+n+", Feature with geometry required");if(!t.geometry||t.geometry.type!==e)throw new Error("Invalid input to "+n+": must be a "+e+", given "+t.geometry.type)}function W(t,e,n){if(!t)throw new Error("No featureCollection passed");if(!n)throw new Error(".collectionOf() requires a name");if(!t||"FeatureCollection"!==t.type)throw new Error("Invalid input to "+n+", FeatureCollection required");for(var r=0;r<t.features.length;r++){var i=t.features[r];if(!i||"Feature"!==i.type||!i.geometry)throw new Error("Invalid input to "+n+", Feature with geometry required");if(!i.geometry||i.geometry.type!==e)throw new Error("Invalid input to "+n+": must be a "+e+", given "+i.geometry.type)}}function J(t){if(!t)throw new Error("geojson is required");if(void 0!==t.geometry)return t.geometry;if(t.coordinates||t.geometries)return t;throw new Error("geojson must be a valid Feature or Geometry Object")}function Z(){throw new Error("invariant.getGeomType has been deprecated in v5.0 in favor of invariant.getType")}function K(t,e){if(!t)throw new Error((e||"geojson")+" is required");if(t.geometry&&t.geometry.type)return t.geometry.type;if(t.type)return t.type;throw new Error((e||"geojson")+" is invalid")}function Q(t,e,n){n=n||{};for(var r=Object.keys(Xo),i=0;i<r.length;i++){var o=r[i],s=n[o];s=void 0!==s&&null!==s?s:Xo[o],Uo[o]=s}Uo.verbose&&console.log("MarchingSquaresJS-isoContours: computing isocontour for "+e);var a=function(t){var e=[],n=0;return t.rows,t.cols,t.cells.forEach((function(r,i){r.forEach((function(r,o){if(void 0!==r&&!function(t){return 5===t.cval||10===t.cval}(r)&&!tt(r)){var s=function(t,e,n){var r,i,o,s=t.length,a=[],u=[0,0,1,1,0,0,0,0,-1,0,1,1,-1,0,-1,0],c=[0,-1,0,0,1,1,1,1,0,-1,0,0,0,-1,0,0],h=["none","bottom","right","right","top","top","top","top","left","bottom","right","right","left","bottom","left","none"],l=(t[e][n],t[e][n]),p=l.cval,f=nt(l,o=["none","left","bottom","left","right","none","bottom","left","top","top","none","top","right","right","bottom","none"][p]);a.push([n+f[0],e+f[1]]),f=nt(l,o=h[p]),a.push([n+f[0],e+f[1]]),et(l);for(var g=n+u[p],d=e+c[p],y=p;g>=0&&d>=0&&d<s&&(g!=n||d!=e)&&void 0!==(l=t[d][g]);){if(0===(p=l.cval)||15===p)return{path:a,info:"mergeable"};o=h[p],r=u[p],i=c[p],5!==p&&10!==p||(5===p?l.flipped?-1===c[y]?(o="left",r=-1,i=0):(o="right",r=1,i=0):-1===u[y]&&(o="bottom",r=0,i=-1):10===p&&(l.flipped?-1===u[y]?(o="top",r=0,i=1):(o="bottom",r=0,i=-1):1===c[y]&&(o="left",r=-1,i=0))),f=nt(l,o),a.push([g+f[0],d+f[1]]),et(l),g+=r,d+=i,y=p}return{path:a,info:"closed"}}(t.cells,i,o),a=!1;if("mergeable"===s.info)for(var u=s.path[s.path.length-1][0],c=s.path[s.path.length-1][1],h=n-1;h>=0;h--)if(Math.abs(e[h][0][0]-u)<=1e-7&&Math.abs(e[h][0][1]-c)<=1e-7){for(var l=s.path.length-2;l>=0;--l)e[h].unshift(s.path[l]);a=!0;break}a||(e[n++]=s.path)}}))})),e}(function(t,e){for(var n=t.length-1,r=t[0].length-1,i={rows:n,cols:r,cells:[]},o=0;o<n;++o){i.cells[o]=[];for(var s=0;s<r;++s){var a=0,u=t[o+1][s],c=t[o+1][s+1],h=t[o][s+1],l=t[o][s];if(!(isNaN(u)||isNaN(c)||isNaN(h)||isNaN(l))){a|=u>=e?8:0,a|=c>=e?4:0,a|=h>=e?2:0;var p,f,g,d,y=!1;if(5===(a|=l>=e?1:0)||10===a){var _=(u+c+h+l)/4;5===a&&_<e?(a=10,y=!0):10===a&&_<e&&(a=5,y=!0)}0!==a&&15!==a&&(p=f=g=d=.5,1===a?(g=1-$(e,u,l),f=1-$(e,h,l)):2===a?(f=$(e,l,h),d=1-$(e,c,h)):3===a?(g=1-$(e,u,l),d=1-$(e,c,h)):4===a?(p=$(e,u,c),d=$(e,h,c)):5===a?(p=$(e,u,c),d=$(e,h,c),f=1-$(e,h,l),g=1-$(e,u,l)):6===a?(f=$(e,l,h),p=$(e,u,c)):7===a?(g=1-$(e,u,l),p=$(e,u,c)):8===a?(g=$(e,l,u),p=1-$(e,c,u)):9===a?(f=1-$(e,h,l),p=1-$(e,c,u)):10===a?(p=1-$(e,c,u),d=1-$(e,c,h),f=$(e,l,h),g=$(e,l,u)):11===a?(p=1-$(e,c,u),d=1-$(e,c,h)):12===a?(g=$(e,l,u),d=$(e,h,c)):13===a?(f=1-$(e,h,l),d=$(e,h,c)):14===a?(g=$(e,l,u),f=$(e,l,h)):console.log("MarchingSquaresJS-isoContours: Illegal cval detected: "+a),i.cells[o][s]={cval:a,flipped:y,top:p,right:d,bottom:f,left:g})}}}return i}(t,e));return"function"==typeof Uo.successCallback&&Uo.successCallback(a),a}function $(t,e,n){return(t-e)/(n-e)}function tt(t){return 0===t.cval||15===t.cval}function et(t){tt(t)||5===t.cval||10===t.cval||(t.cval=15)}function nt(t,e){return"top"===e?[t.top,1]:"bottom"===e?[t.bottom,0]:"right"===e?[1,t.right]:"left"===e?[0,t.left]:void 0}function rt(t,e){if(!I(e=e||{}))throw new Error("options is invalid");var n=e.zProperty||"elevation",r=e.flip,i=e.flags;W(t,"Point","input must contain Points");for(var o=function(t,e){var n={};return O(t,(function(t){var e=U(t)[1];n[e]||(n[e]=[]),n[e].push(t)})),Object.keys(n).map((function(t){var e=n[t].sort((function(t,e){return U(t)[0]-U(e)[0]}));return e})).sort((function(t,n){return e?U(t[0])[1]-U(n[0])[1]:U(n[0])[1]-U(t[0])[1]}))}(t,r),s=[],a=0;a<o.length;a++){for(var u=o[a],c=[],h=0;h<u.length;h++){var l=u[h];l.properties[n]?c.push(l.properties[n]):c.push(0),!0===i&&(l.properties.matrixPosition=[a,h])}s.push(c)}return s}function it(t,e,n,r,i){for(n=n||0,r=r||t.length-1,i=i||function(t,e){return t<e?-1:t>e?1:0};r>n;){if(r-n>600){var o=r-n+1,s=e-n+1,a=Math.log(o),u=.5*Math.exp(2*a/3),c=.5*Math.sqrt(a*u*(o-u)/o)*(s-o/2<0?-1:1);it(t,e,Math.max(n,Math.floor(e-s*u/o+c)),Math.min(r,Math.floor(e+(o-s)*u/o+c)),i)}var h=t[e],l=n,p=r;for(ot(t,n,e),i(t[r],h)>0&&ot(t,n,r);l<p;){for(ot(t,l,p),l++,p--;i(t[l],h)<0;)l++;for(;i(t[p],h)>0;)p--}0===i(t[n],h)?ot(t,n,p):ot(t,++p,r),p<=e&&(n=p+1),e<=p&&(r=p-1)}}function ot(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function st(t,e){if(!(this instanceof st))return new st(t,e);this._maxEntries=Math.max(4,t||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),e&&this._initFormat(e),this.clear()}function at(t,e){ut(t,0,t.children.length,e,t)}function ut(t,e,n,r,i){i||(i=yt(null)),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(var o,s=e;s<n;s++)o=t.children[s],ct(i,t.leaf?r(o):o);return i}function ct(t,e){return t.minX=Math.min(t.minX,e.minX),t.minY=Math.min(t.minY,e.minY),t.maxX=Math.max(t.maxX,e.maxX),t.maxY=Math.max(t.maxY,e.maxY),t}function ht(t,e){return t.minX-e.minX}function lt(t,e){return t.minY-e.minY}function pt(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function ft(t){return t.maxX-t.minX+(t.maxY-t.minY)}function gt(t,e){return t.minX<=e.minX&&t.minY<=e.minY&&e.maxX<=t.maxX&&e.maxY<=t.maxY}function dt(t,e){return e.minX<=t.maxX&&e.minY<=t.maxY&&e.maxX>=t.minX&&e.maxY>=t.minY}function yt(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function _t(t,e,n,r,i){for(var o,s=[e,n];s.length;)(n=s.pop())-(e=s.pop())<=r||(o=e+Math.ceil((n-e)/r/2)*r,Yo(t,o,e,n,i),s.push(e,o,o,n))}function mt(t,e){return t(e={exports:{}},e.exports),e.exports}function vt(t,e){if(!(this instanceof vt))return new vt(t,e);if(this.data=t||[],this.length=this.data.length,this.compare=e||function(t,e){return t<e?-1:t>e?1:0},this.length>0)for(var n=(this.length>>1)-1;n>=0;n--)this._down(n)}function xt(t,e,n){e=Math.max(0,void 0===e?2:e),n=n||0;for(var r,i=function(t){for(var e=t[0],n=t[0],r=t[0],i=t[0],o=0;o<t.length;o++){var s=t[o];s[0]<e[0]&&(e=s),s[0]>r[0]&&(r=s),s[1]<n[1]&&(n=s),s[1]>i[1]&&(i=s)}var a=[e,n,r,i],u=a.slice();for(o=0;o<t.length;o++)is(t[o],a)||u.push(t[o]);var c=ts(u),h=[];for(o=0;o<c.length;o++)h.push(u[c[o]]);return h}(t),o=Vo(16,["[0]","[1]","[0]","[1]"]).load(t),s=[],a=0;a<i.length;a++){var u=i[a];o.remove(u),r=Nt(u,r),s.push(r)}var c=Vo(16);for(a=0;a<s.length;a++)c.insert(It(s[a]));for(var h=e*e,l=n*n;s.length;){var p=s.shift(),f=p.p,g=p.next.p,d=Ct(f,g);if(!(d<l)){var y=d/h;(u=function(t,e,n,r,i,o,s){for(var a=new ns(null,Et),u=t.data;u;){for(var c=0;c<u.children.length;c++){var h=u.children[c],l=u.leaf?St(h,n,r):function(t,e,n){if(wt(t,n)||wt(e,n))return 0;var r=Mt(t[0],t[1],e[0],e[1],n.minX,n.minY,n.maxX,n.minY);if(0===r)return 0;var i=Mt(t[0],t[1],e[0],e[1],n.minX,n.minY,n.minX,n.maxY);if(0===i)return 0;var o=Mt(t[0],t[1],e[0],e[1],n.maxX,n.minY,n.maxX,n.maxY);if(0===o)return 0;var s=Mt(t[0],t[1],e[0],e[1],n.minX,n.maxY,n.maxX,n.maxY);return 0===s?0:Math.min(r,i,o,s)}(n,r,h);l>o||a.push({node:h,dist:l})}for(;a.length&&!a.peek().node.children;){var p=a.pop(),f=p.node,g=St(f,e,n),d=St(f,r,i);if(p.dist<g&&p.dist<d&&bt(n,f,s)&&bt(r,f,s))return f}(u=a.pop())&&(u=u.node)}return null}(o,p.prev.p,f,g,p.next.next.p,y,c))&&Math.min(Ct(u,f),Ct(u,g))<=y&&(s.push(p),s.push(Nt(u,p)),o.remove(u),c.remove(p),c.insert(It(p)),c.insert(It(p.next)))}}p=r;var _=[];do{_.push(p.p),p=p.next}while(p!==r);return _.push(p.p),_}function Et(t,e){return t.dist-e.dist}function wt(t,e){return t[0]>=e.minX&&t[0]<=e.maxX&&t[1]>=e.minY&&t[1]<=e.maxY}function bt(t,e,n){for(var r=Math.min(t[0],e[0]),i=Math.min(t[1],e[1]),o=Math.max(t[0],e[0]),s=Math.max(t[1],e[1]),a=n.search({minX:r,minY:i,maxX:o,maxY:s}),u=0;u<a.length;u++)if(function(t,e,n,r){return t!==r&&e!==n&&os(t,e,n)>0!=os(t,e,r)>0&&os(n,r,t)>0!=os(n,r,e)>0}(a[u].p,a[u].next.p,t,e))return!1;return!0}function It(t){var e=t.p,n=t.next.p;return t.minX=Math.min(e[0],n[0]),t.minY=Math.min(e[1],n[1]),t.maxX=Math.max(e[0],n[0]),t.maxY=Math.max(e[1],n[1]),t}function Nt(t,e){var n={p:t,prev:null,next:null,minX:0,minY:0,maxX:0,maxY:0};return e?(n.next=e.next,n.prev=e,e.next.prev=n,e.next=n):(n.prev=n,n.next=n),n}function Ct(t,e){var n=t[0]-e[0],r=t[1]-e[1];return n*n+r*r}function St(t,e,n){var r=e[0],i=e[1],o=n[0]-r,s=n[1]-i;if(0!==o||0!==s){var a=((t[0]-r)*o+(t[1]-i)*s)/(o*o+s*s);a>1?(r=n[0],i=n[1]):a>0&&(r+=o*a,i+=s*a)}return(o=t[0]-r)*o+(s=t[1]-i)*s}function Mt(t,e,n,r,i,o,s,a){var u,c,h,l,p=n-t,f=r-e,g=s-i,d=a-o,y=t-i,_=e-o,m=p*p+f*f,v=p*g+f*d,x=g*g+d*d,E=p*y+f*_,w=g*y+d*_,b=m*x-v*v,I=b,N=b;0===b?(c=0,I=1,l=w,N=x):(l=m*w-v*E,(c=v*w-x*E)<0?(c=0,l=w,N=x):c>I&&(c=I,l=w+v,N=x)),l<0?(l=0,-E<0?c=0:-E>m?c=I:(c=-E,I=m)):l>N&&(l=N,-E+v<0?c=0:-E+v>m?c=I:(c=-E+v,I=m));var C=(1-(h=0===l?0:l/N))*i+h*s-((1-(u=0===c?0:c/I))*t+u*n),S=(1-h)*o+h*a-((1-u)*e+u*r);return C*C+S*S}function Lt(t,e){if(!I(e=e||{}))throw new Error("options is invalid");var n=e.concavity||1/0,r=[];if(S(t,(function(t){r.push([t[0],t[1]])})),!r.length)return null;var i=ss(r,n);return i.length>3?o([i]):null}function Pt(t,e,n){if("object"!=typeof(n=n||{}))throw new Error("options is invalid");var r=n.ignoreBoundary;if(!t)throw new Error("point is required");if(!e)throw new Error("polygon is required");var i=X(t),o=U(e),s=e.geometry?e.geometry.type:e.type,a=e.bbox;if(a&&!1===function(t,e){return e[0]<=t[0]&&e[1]<=t[1]&&e[2]>=t[0]&&e[3]>=t[1]}(i,a))return!1;"Polygon"===s&&(o=[o]);for(var u=0,c=!1;u<o.length&&!c;u++)if(Ot(i,o[u][0],r)){for(var h=!1,l=1;l<o[u].length&&!h;)Ot(i,o[u][l],!r)&&(h=!0),l++;h||(c=!0)}return c}function Ot(t,e,n){var r=!1;e[0][0]===e[e.length-1][0]&&e[0][1]===e[e.length-1][1]&&(e=e.slice(0,e.length-1));for(var i=0,o=e.length-1;i<e.length;o=i++){var s=e[i][0],a=e[i][1],u=e[o][0],c=e[o][1];if(t[1]*(s-u)+a*(u-t[0])+c*(t[0]-s)==0&&(s-t[0])*(u-t[0])<=0&&(a-t[1])*(c-t[1])<=0)return!n;a>t[1]!=c>t[1]&&t[0]<(u-s)*(t[1]-a)/(c-a)+s&&(r=!r)}return r}function Rt(t,e){var n=[];return A(e,(function(e){O(t,(function(t){Pt(t,e)&&n.push(t)}))})),c(n)}function Tt(t,e){if("FeatureCollection"!==t.type)throw new Error("points must be a FeatureCollection");var n=!1;return c(function(t){if(t.length<3)return[];t.sort(Dt);for(var e,n,r,i,o,s,a=t.length-1,u=t[a].x,c=t[0].x,h=t[a].y,l=h;a--;)t[a].y<h&&(h=t[a].y),t[a].y>l&&(l=t[a].y);var p,f=c-u,g=l-h,d=f>g?f:g,y=.5*(c+u),_=.5*(l+h),m=[new At({x:y-20*d,y:_-d,__sentinel:!0},{x:y,y:_+20*d,__sentinel:!0},{x:y+20*d,y:_-d,__sentinel:!0})],v=[],x=[];for(a=t.length;a--;){for(x.length=0,p=m.length;p--;)(f=t[a].x-m[p].x)>0&&f*f>m[p].r?(v.push(m[p]),m.splice(p,1)):f*f+(g=t[a].y-m[p].y)*g>m[p].r||(x.push(m[p].a,m[p].b,m[p].b,m[p].c,m[p].c,m[p].a),m.splice(p,1));for(Ft(x),p=x.length;p;)n=x[--p],e=x[--p],r=t[a],i=n.x-e.x,o=n.y-e.y,s=2*(i*(r.y-n.y)-o*(r.x-n.x)),Math.abs(s)>1e-12&&m.push(new At(e,n,r))}for(Array.prototype.push.apply(v,m),a=v.length;a--;)(v[a].a.__sentinel||v[a].b.__sentinel||v[a].c.__sentinel)&&v.splice(a,1);return v}(t.features.map((function(t){var r={x:t.geometry.coordinates[0],y:t.geometry.coordinates[1]};return e?r.z=t.properties[e]:3===t.geometry.coordinates.length&&(n=!0,r.z=t.geometry.coordinates[2]),r}))).map((function(t){var e=[t.a.x,t.a.y],r=[t.b.x,t.b.y],i=[t.c.x,t.c.y],s={};return n?(e.push(t.a.z),r.push(t.b.z),i.push(t.c.z)):s={a:t.a.z,b:t.b.z,c:t.c.z},o([[e,r,i,e]],s)})))}function At(t,e,n){this.a=t,this.b=e,this.c=n;var r,i,o=e.x-t.x,s=e.y-t.y,a=n.x-t.x,u=n.y-t.y,c=o*(t.x+e.x)+s*(t.y+e.y),h=a*(t.x+n.x)+u*(t.y+n.y),l=2*(o*(n.y-e.y)-s*(n.x-e.x));this.x=(u*c-s*h)/l,this.y=(o*h-a*c)/l,r=this.x-t.x,i=this.y-t.y,this.r=r*r+i*i}function Dt(t,e){return e.x-t.x}function Ft(t){var e,n,r,i,o,s=t.length;t:for(;s;)for(n=t[--s],e=t[--s],r=s;r;)if(o=t[--r],i=t[--r],e===i&&n===o||e===o&&n===i){t.splice(s,2),t.splice(r,2),s-=2;continue t}}function qt(t,e,n){if(!I(n=n||{}))throw new Error("options is invalid");var r=n.units,i=X(t),o=X(e),s=x(o[1]-i[1]),a=x(o[0]-i[0]),u=x(i[1]),c=x(o[1]),h=Math.pow(Math.sin(s/2),2)+Math.pow(Math.sin(a/2),2)*Math.cos(u)*Math.cos(c);return d(2*Math.atan2(Math.sqrt(h),Math.sqrt(1-h)),r)}function Gt(t){if(!t)throw new Error("geojson is required");switch(t.type){case"Feature":return Bt(t);case"FeatureCollection":return function(t){var e={type:"FeatureCollection"};return Object.keys(t).forEach((function(n){switch(n){case"type":case"features":return;default:e[n]=t[n]}})),e.features=t.features.map((function(t){return Bt(t)})),e}(t);case"Point":case"LineString":case"Polygon":case"MultiPoint":case"MultiLineString":case"MultiPolygon":case"GeometryCollection":return zt(t);default:throw new Error("unknown GeoJSON type")}}function Bt(t){var e={type:"Feature"};return Object.keys(t).forEach((function(n){switch(n){case"type":case"properties":case"geometry":return;default:e[n]=t[n]}})),e.properties=kt(t.properties),e.geometry=zt(t.geometry),e}function kt(t){var e={};return t?(Object.keys(t).forEach((function(n){var r=t[n];"object"==typeof r?null===r?e[n]=null:r.length?e[n]=r.map((function(t){return t})):e[n]=kt(r):e[n]=r})),e):e}function zt(t){var e={type:t.type};return t.bbox&&(e.bbox=t.bbox),"GeometryCollection"===t.type?(e.geometries=t.geometries.map((function(t){return zt(t)})),e):(e.coordinates=jt(t.coordinates),e)}function jt(t){return"object"!=typeof t[0]?t.slice():t.map((function(t){return jt(t)}))}function Xt(t,e){function n(t,e){e.length&&e.pop();for(var n=c[t<0?~t:t],r=0,i=n.length;r<i;++r)e.push(u(n[r],r));t<0&&hs(e,i)}function r(t){return u(t)}function i(t){for(var e=[],r=0,i=t.length;r<i;++r)n(t[r],e);return e.length<2&&e.push(e[0]),e}function o(t){for(var e=i(t);e.length<4;)e.push(e[0]);return e}function s(t){return t.map(o)}function a(t){var e,n=t.type;switch(n){case"GeometryCollection":return{type:n,geometries:t.geometries.map(a)};case"Point":e=r(t.coordinates);break;case"MultiPoint":e=t.coordinates.map(r);break;case"LineString":e=i(t.arcs);break;case"MultiLineString":e=t.arcs.map(i);break;case"Polygon":e=s(t.arcs);break;case"MultiPolygon":e=t.arcs.map(s);break;default:return null}return{type:n,coordinates:e}}var u=cs(t.transform),c=t.arcs;return a(e)}function Ut(t,e){function n(t){switch(t.type){case"GeometryCollection":t.geometries.forEach(n);break;case"Polygon":r(t.arcs);break;case"MultiPolygon":t.arcs.forEach(r)}}function r(t){t.forEach((function(e){e.forEach((function(e){(o[e=e<0?~e:e]||(o[e]=[])).push(t)}))})),s.push(t)}function i(e){return function(t){for(var e,n=-1,r=t.length,i=t[r-1],o=0;++n<r;)e=i,i=t[n],o+=e[0]*i[1]-e[1]*i[0];return Math.abs(o)}(Xt(t,{type:"Polygon",arcs:[e]}).coordinates[0])}var o={},s=[],a=[];return e.forEach(n),s.forEach((function(t){if(!t._){var e=[],n=[t];for(t._=1,a.push(e);t=n.pop();)e.push(t),t.forEach((function(t){t.forEach((function(t){o[t<0?~t:t].forEach((function(t){t._||(t._=1,n.push(t))}))}))}))}})),s.forEach((function(t){delete t._})),{type:"MultiPolygon",arcs:a.map((function(e){var n,r=[];if(e.forEach((function(t){t.forEach((function(t){t.forEach((function(t){o[t<0?~t:t].length<2&&r.push(t)}))}))})),(n=(r=ls(t,r)).length)>1)for(var s,a,u=1,c=i(r[0]);u<n;++u)(s=i(r[u]))>c&&(a=r[0],r[0]=r[u],r[u]=a,c=s);return r}))}}function Yt(t,e,n){for(var r,i=e+(n---e>>1);e<i;++e,--n)r=t[e],t[e]=t[n],t[n]=r}function Vt(t){return null==t?{type:null}:("FeatureCollection"===t.type?function(t){var e={type:"GeometryCollection",geometries:t.features.map(Ht)};return null!=t.bbox&&(e.bbox=t.bbox),e}:"Feature"===t.type?Ht:Wt)(t)}function Ht(t){var e,n=Wt(t.geometry);for(e in null!=t.id&&(n.id=t.id),null!=t.bbox&&(n.bbox=t.bbox),t.properties){n.properties=t.properties;break}return n}function Wt(t){if(null==t)return{type:null};var e="GeometryCollection"===t.type?{type:"GeometryCollection",geometries:t.geometries.map(Wt)}:"Point"===t.type||"MultiPoint"===t.type?{type:t.type,coordinates:t.coordinates}:{type:t.type,arcs:t.coordinates};return null!=t.bbox&&(e.bbox=t.bbox),e}function Jt(t){var e,n=t[0],r=t[1];return r<n&&(e=n,n=r,r=e),n+31*r}function Zt(t,e){var n,r=t[0],i=t[1],o=e[0],s=e[1];return i<r&&(n=r,r=i,i=n),s<o&&(n=o,o=s,s=n),r===o&&i===s}function Kt(t,e){if(!I(e=e||{}))throw new Error("options is invalid");var n=e.mutate;if("FeatureCollection"!==K(t))throw new Error("geojson must be a FeatureCollection");if(!t.features.length)throw new Error("geojson is empty");!1!==n&&void 0!==n||(t=Gt(t));var r=[],i=z(t,(function(t,e){var n=function(t,e){var n,r=t.geometry.coordinates,i=e.geometry.coordinates,o=Qt(r[0]),s=Qt(r[r.length-1]),u=Qt(i[0]),c=Qt(i[i.length-1]);if(o===c)n=i.concat(r.slice(1));else if(u===s)n=r.concat(i.slice(1));else if(o===u)n=r.slice(1).reverse().concat(i);else{if(s!==c)return null;n=r.concat(i.reverse().slice(1))}return a(n)}(t,e);return n||(r.push(t),e)}));return i&&r.push(i),r.length?1===r.length?r[0]:h(r.map((function(t){return t.coordinates}))):null}function Qt(t){return t[0].toString()+","+t[1].toString()}function $t(t,e){if(!I(e=e||{}))throw new Error("options is invalid");var n=e.mutate;if("FeatureCollection"!==K(t))throw new Error("geojson must be a FeatureCollection");if(!t.features.length)throw new Error("geojson is empty");!1!==n&&void 0!==n||(t=Gt(t));var r=function(t){var e={};F(t,(function(t){e[t.geometry.type]=!0}));var n=Object.keys(e);return 1===n.length?n[0]:null}(t);if(!r)throw new Error("geojson must be homogenous");switch(r){case"LineString":return Kt(t,e);case"Polygon":return function(t,e){if(!I(e=e||{}))throw new Error("options is invalid");var n=e.mutate;if("FeatureCollection"!==K(t))throw new Error("geojson must be a FeatureCollection");if(!t.features.length)throw new Error("geojson is empty");!1!==n&&void 0!==n||(t=Gt(t));var r=[];F(t,(function(t){r.push(t.geometry)}));var i=ws({geoms:f(r).geometry});return ps(i,i.objects.geoms.geometries)}(t,e);default:throw new Error(r+" is not supported")}}function te(t,n){var r="object"==typeof n?n.mutate:n;if(!t)throw new Error("geojson is required");var i=K(t),o=[];switch(i){case"LineString":o=ee(t);break;case"MultiLineString":case"Polygon":U(t).forEach((function(t){o.push(ee(t))}));break;case"MultiPolygon":U(t).forEach((function(t){var e=[];t.forEach((function(t){e.push(ee(t))})),o.push(e)}));break;case"Point":return t;case"MultiPoint":var s={};U(t).forEach((function(t){var e=t.join("-");s.hasOwnProperty(e)||(o.push(t),s[e]=!0)}));break;default:throw new Error(i+" geometry not supported")}return t.coordinates?!0===r?(t.coordinates=o,t):{type:i,coordinates:o}:!0===r?(t.geometry.coordinates=o,t):e({type:i,coordinates:o},t.properties,t.bbox,t.id)}function ee(t){var e=U(t);if(2===e.length&&!function(t,e){return t[0]===e[0]&&t[1]===e[1]}(e[0],e[1]))return e;var n,r,i,o=[],s=e.length-1;o.push(e[0]);for(var a=1;a<s;a++)n=e[a-1],r=e[a],function(t,e,n){var r=n[0],i=n[1],o=t[0],s=t[1],a=e[0],u=e[1],c=a-o,h=u-s;return(r-o)*h-(i-s)*c==0&&(Math.abs(c)>=Math.abs(h)?c>0?o<=r&&r<=a:a<=r&&r<=o:h>0?s<=i&&i<=u:u<=i&&i<=s)}(n,i=e[a+1],r)||o.push(r);return o.push(i),o}function ne(t,e){var n=t.x-e.x,r=t.y-e.y;return n*n+r*r}function re(t,e,n){var r=e.x,i=e.y,o=n.x-r,s=n.y-i;if(0!==o||0!==s){var a=((t.x-r)*o+(t.y-i)*s)/(o*o+s*s);a>1?(r=n.x,i=n.y):a>0&&(r+=o*a,i+=s*a)}return(o=t.x-r)*o+(s=t.y-i)*s}function ie(t,e,n,r,i){for(var o,s=r,a=e+1;a<n;a++){var u=re(t[a],t[e],t[n]);u>s&&(o=a,s=u)}s>r&&(o-e>1&&ie(t,e,o,r,i),i.push(t[o]),n-o>1&&ie(t,o,n,r,i))}function oe(t,e,n){if(t.length<=2)return t;var r=void 0!==e?e*e:1;return t=n?t:function(t,e){for(var n,r=t[0],i=[r],o=1,s=t.length;o<s;o++)ne(n=t[o],r)>e&&(i.push(n),r=n);return r!==n&&i.push(n),i}(t,r),function(t,e){var n=t.length-1,r=[t[0]];return ie(t,0,n,e,r),r.push(t[n]),r}(t,r)}function se(t,e,n){return oe(t.map((function(t){return{x:t[0],y:t[1],z:t[2]}})),e,n).map((function(t){return t.z?[t.x,t.y,t.z]:[t.x,t.y]}))}function ae(t,e,n){return t.map((function(t){var r=t.map((function(t){return{x:t[0],y:t[1]}}));if(r.length<4)throw new Error("invalid polygon");for(var i=oe(r,e,n).map((function(t){return[t.x,t.y]}));!function(t){return!(t.length<3||3===t.length&&t[2][0]===t[0][0]&&t[2][1]===t[0][1])}(i);)i=oe(r,e-=.01*e,n).map((function(t){return[t.x,t.y]}));return i[i.length-1][0]===i[0][0]&&i[i.length-1][1]===i[0][1]||i.push(i[0]),i}))}function ue(t,e){if(!I(e=e||{}))throw new Error("options is invalid");var n=e.resolution||1e4,r=e.sharpness||.85;if(!t)throw new Error("line is required");if(!b(n))throw new Error("resolution must be an number");if(!b(r))throw new Error("sharpness must be an number");for(var i=[],o=new bs({points:J(t).coordinates.map((function(t){return{x:t[0],y:t[1]}})),duration:n,sharpness:r}),s=0;s<o.duration;s+=10){var u=o.pos(s);Math.floor(s/100)%2==0&&i.push([u.x,u.y])}return a(i,t.properties)}function ce(t){N(t);var e=Number(t[0]),n=Number(t[1]),r=Number(t[2]),i=Number(t[3]);if(6===t.length)throw new Error("@turf/bbox-polygon does not support BBox with 6 positions");var s=[e,n];return o([[s,[r,n],[r,i],[e,i],s]])}function he(t){return ce(j(t))}function le(t){var e=t[0],n=t[1],r=t[2],i=t[3];if(qt(t.slice(0,2),[r,n])>=qt(t.slice(0,2),[e,i])){var o=(n+i)/2;return[e,o-(r-e)/2,r,o+(r-e)/2]}var s=(e+r)/2;return[s-(i-n)/2,n,s+(i-n)/2,i]}function pe(t,e,n,i){if(!I(i=i||{}))throw new Error("options is invalid");var o=i.units,s=i.properties,a=X(t),u=x(a[0]),c=x(a[1]),h=x(n),l=y(e,o),p=Math.asin(Math.sin(c)*Math.cos(l)+Math.cos(c)*Math.sin(l)*Math.cos(h));return r([v(u+Math.atan2(Math.sin(h)*Math.sin(l)*Math.cos(c),Math.cos(l)-Math.sin(c)*Math.sin(p))),v(p)],s)}function fe(t,e,n){var r=(n=n||{}).steps||64,i=n.properties;if(!t)throw new Error("center is required");if(!e)throw new Error("radius is required");if("object"!=typeof n)throw new Error("options must be an object");if("number"!=typeof r)throw new Error("steps must be a number");r=r||64,i=i||t.properties||{};for(var s=[],a=0;a<r;a++)s.push(pe(t,e,-360*a/r,n).geometry.coordinates);return s.push(s[0]),o([s],i)}function ge(t,e,n){if(!I(n=n||{}))throw new Error("options is invalid");if(!0===n.final)return function(t,e){var n=ge(e,t);return(n+180)%360}(t,e);var r=X(t),i=X(e),o=x(r[0]),s=x(i[0]),a=x(r[1]),u=x(i[1]),c=Math.sin(s-o)*Math.cos(u),h=Math.cos(a)*Math.sin(u)-Math.sin(a)*Math.cos(u)*Math.cos(s-o);return v(Math.atan2(c,h))}function de(t,e){if(!I(e=e||{}))throw new Error("options is invalid");var n=e.properties;if(!t)throw new Error("geojson is required");var i=j(t);return r([(i[0]+i[2])/2,(i[1]+i[3])/2],n)}function ye(t,e){var n=0,i=0,o=0;return S(t,(function(t){n+=t[0],i+=t[1],o++}),!0),r([n/o,i/o],e)}function _e(t,e){switch(K(t)){case"Point":return t;case"Polygon":var n=[];S(t,(function(t){n.push(t)}));var i,o,s,a,u,c,h,l,p=ye(t,e),f=p.geometry.coordinates,g=0,d=0,y=0,_=n.map((function(t){return[t[0]-f[0],t[1]-f[1]]}));for(i=0;i<n.length-1;i++)a=(o=_[i])[0],c=o[1],u=(s=_[i+1])[0],y+=l=a*(h=s[1])-u*c,g+=(a+u)*l,d+=(c+h)*l;if(0===y)return p;var m=1/(.5*y*6);return r([f[0]+m*g,f[1]+m*d],e);default:var v=Lt(t);return v?_e(v,e):ye(t,e)}}function me(t){var e=[];return"FeatureCollection"===t.type?O(t,(function(t){S(t,(function(n){e.push(r(n,t.properties))}))})):S(t,(function(n){e.push(r(n,t.properties))})),c(e)}function ve(t,e,n){n=n||2;var r,i,o,s,a,u,c,h=e&&e.length,l=h?e[0]*n:t.length,p=xe(t,0,l,n,!0),f=[];if(!p)return f;if(h&&(p=function(t,e,n,r){var i,o,s,a=[];for(i=0,o=e.length;i<o;i++)(s=xe(t,e[i]*r,i<o-1?e[i+1]*r:t.length,r,!1))===s.next&&(s.steiner=!0),a.push(function(t){var e=t,n=t;do{e.x<n.x&&(n=e),e=e.next}while(e!==t);return n}(s));for(a.sort(be),i=0;i<a.length;i++)!function(t,e){if(e=function(t,e){var n,r=e,i=t.x,o=t.y,s=-1/0;do{if(o<=r.y&&o>=r.next.y&&r.next.y!==r.y){var a=r.x+(o-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(a<=i&&a>s){if(s=a,a===i){if(o===r.y)return r;if(o===r.next.y)return r.next}n=r.x<r.next.x?r:r.next}}r=r.next}while(r!==e);if(!n)return null;if(i===s)return n.prev;var u,c=n,h=n.x,l=n.y,p=1/0;for(r=n.next;r!==c;)i>=r.x&&r.x>=h&&i!==r.x&&Ne(o<l?i:s,o,h,l,o<l?s:i,o,r.x,r.y)&&((u=Math.abs(o-r.y)/(i-r.x))<p||u===p&&r.x>n.x)&&Le(r,t)&&(n=r,p=u),r=r.next;return n}(t,e)){var n=Pe(e,t);Ee(n,n.next)}}(a[i],n),n=Ee(n,n.next);return n}(t,e,p,n)),t.length>80*n){r=o=t[0],i=s=t[1];for(var g=n;g<l;g+=n)(a=t[g])<r&&(r=a),(u=t[g+1])<i&&(i=u),a>o&&(o=a),u>s&&(s=u);c=0!==(c=Math.max(o-r,s-i))?1/c:0}return we(p,f,n,r,i,c),f}function xe(t,e,n,r,i){var o,s;if(i===Ae(t,e,n,r)>0)for(o=e;o<n;o+=r)s=Oe(o,t[o],t[o+1],s);else for(o=n-r;o>=e;o-=r)s=Oe(o,t[o],t[o+1],s);return s&&Se(s,s.next)&&(Re(s),s=s.next),s}function Ee(t,e){if(!t)return t;e||(e=t);var n,r=t;do{if(n=!1,r.steiner||!Se(r,r.next)&&0!==Ce(r.prev,r,r.next))r=r.next;else{if(Re(r),(r=e=r.prev)===r.next)break;n=!0}}while(n||r!==e);return e}function we(t,e,n,r,i,o,s){if(t){!s&&o&&function(t,e,n,r){var i=t;do{null===i.z&&(i.z=Ie(i.x,i.y,e,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,function(t){var e,n,r,i,o,s,a,u,c=1;do{for(n=t,t=null,o=null,s=0;n;){for(s++,r=n,a=0,e=0;e<c&&(a++,r=r.nextZ);e++);for(u=c;a>0||u>0&&r;)0!==a&&(0===u||!r||n.z<=r.z)?(i=n,n=n.nextZ,a--):(i=r,r=r.nextZ,u--),o?o.nextZ=i:t=i,i.prevZ=o,o=i;n=r}o.nextZ=null,c*=2}while(s>1)}(i)}(t,r,i,o);for(var a,u,c=t;t.prev!==t.next;)if(a=t.prev,u=t.next,o?function(t,e,n,r){var i=t.prev,o=t,s=t.next;if(Ce(i,o,s)>=0)return!1;for(var a=i.x<o.x?i.x<s.x?i.x:s.x:o.x<s.x?o.x:s.x,u=i.y<o.y?i.y<s.y?i.y:s.y:o.y<s.y?o.y:s.y,c=i.x>o.x?i.x>s.x?i.x:s.x:o.x>s.x?o.x:s.x,h=i.y>o.y?i.y>s.y?i.y:s.y:o.y>s.y?o.y:s.y,l=Ie(a,u,e,n,r),p=Ie(c,h,e,n,r),f=t.nextZ;f&&f.z<=p;){if(f!==t.prev&&f!==t.next&&Ne(i.x,i.y,o.x,o.y,s.x,s.y,f.x,f.y)&&Ce(f.prev,f,f.next)>=0)return!1;f=f.nextZ}for(f=t.prevZ;f&&f.z>=l;){if(f!==t.prev&&f!==t.next&&Ne(i.x,i.y,o.x,o.y,s.x,s.y,f.x,f.y)&&Ce(f.prev,f,f.next)>=0)return!1;f=f.prevZ}return!0}(t,r,i,o):function(t){var e=t.prev,n=t,r=t.next;if(Ce(e,n,r)>=0)return!1;for(var i=t.next.next;i!==t.prev;){if(Ne(e.x,e.y,n.x,n.y,r.x,r.y,i.x,i.y)&&Ce(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}(t))e.push(a.i/n),e.push(t.i/n),e.push(u.i/n),Re(t),t=u.next,c=u.next;else if((t=u)===c){s?1===s?we(t=function(t,e,n){var r=t;do{var i=r.prev,o=r.next.next;!Se(i,o)&&Me(i,r,r.next,o)&&Le(i,o)&&Le(o,i)&&(e.push(i.i/n),e.push(r.i/n),e.push(o.i/n),Re(r),Re(r.next),r=t=o),r=r.next}while(r!==t);return r}(t,e,n),e,n,r,i,o,2):2===s&&function(t,e,n,r,i,o){var s=t;do{for(var a=s.next.next;a!==s.prev;){if(s.i!==a.i&&function(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var n=t;do{if(n.i!==t.i&&n.next.i!==t.i&&n.i!==e.i&&n.next.i!==e.i&&Me(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}(t,e)&&Le(t,e)&&Le(e,t)&&function(t,e){var n=t,r=!1,i=(t.x+e.x)/2,o=(t.y+e.y)/2;do{n.y>o!=n.next.y>o&&n.next.y!==n.y&&i<(n.next.x-n.x)*(o-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next}while(n!==t);return r}(t,e)}(s,a)){var u=Pe(s,a);return s=Ee(s,s.next),u=Ee(u,u.next),we(s,e,n,r,i,o),void we(u,e,n,r,i,o)}a=a.next}s=s.next}while(s!==t)}(t,e,n,r,i,o):we(Ee(t),e,n,r,i,o,1);break}}}function be(t,e){return t.x-e.x}function Ie(t,e,n,r,i){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-n)*i)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-r)*i)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function Ne(t,e,n,r,i,o,s,a){return(i-s)*(e-a)-(t-s)*(o-a)>=0&&(t-s)*(r-a)-(n-s)*(e-a)>=0&&(n-s)*(o-a)-(i-s)*(r-a)>=0}function Ce(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function Se(t,e){return t.x===e.x&&t.y===e.y}function Me(t,e,n,r){return!!(Se(t,e)&&Se(n,r)||Se(t,r)&&Se(n,e))||Ce(t,e,n)>0!=Ce(t,e,r)>0&&Ce(n,r,t)>0!=Ce(n,r,e)>0}function Le(t,e){return Ce(t.prev,t,t.next)<0?Ce(t,e,t.next)>=0&&Ce(t,t.prev,e)>=0:Ce(t,e,t.prev)<0||Ce(t,t.next,e)<0}function Pe(t,e){var n=new Te(t.i,t.x,t.y),r=new Te(e.i,e.x,e.y),i=t.next,o=e.prev;return t.next=e,e.prev=t,n.next=i,i.prev=n,r.next=n,n.prev=r,o.next=r,r.prev=o,r}function Oe(t,e,n,r){var i=new Te(t,e,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function Re(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function Te(t,e,n){this.i=t,this.x=e,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function Ae(t,e,n,r){for(var i=0,o=e,s=n-r;o<n;o+=r)i+=(t[s]-t[o])*(t[o+1]+t[s+1]),s=o;return i}function De(t){var e=function(t){for(var e=t[0][0].length,n={vertices:[],holes:[],dimensions:e},r=0,i=0;i<t.length;i++){for(var o=0;o<t[i].length;o++)for(var s=0;s<e;s++)n.vertices.push(t[i][o][s]);i>0&&(r+=t[i-1].length,n.holes.push(r))}return n}(t),n=Is(e.vertices,e.holes,2),r=[],i=[];n.forEach((function(t,r){var o=n[r];i.push([e.vertices[2*o],e.vertices[2*o+1]])}));for(var s=0;s<i.length;s+=3){var a=i.slice(s,s+3);a.push(i[s]),r.push(o([a]))}return r}function Fe(t,e){if(!t)throw new Error("targetPoint is required");if(!e)throw new Error("points is required");var n,r=1/0;return O(e,(function(e,i){var o=qt(t,e);o<r&&((n=Gt(e)).properties.featureIndex=i,n.properties.distanceToPoint=o,r=o)})),n}function qe(t,e,n,r,i){Ge(t,e,n||0,r||t.length-1,i||function(t,e){return t<e?-1:t>e?1:0})}function Ge(t,e,n,r,i){for(;r>n;){if(r-n>600){var o=r-n+1,s=e-n+1,a=Math.log(o),u=.5*Math.exp(2*a/3),c=.5*Math.sqrt(a*u*(o-u)/o)*(s-o/2<0?-1:1);Ge(t,e,Math.max(n,Math.floor(e-s*u/o+c)),Math.min(r,Math.floor(e+(o-s)*u/o+c)),i)}var h=t[e],l=n,p=r;for(Be(t,n,e),i(t[r],h)>0&&Be(t,n,r);l<p;){for(Be(t,l,p),l++,p--;i(t[l],h)<0;)l++;for(;i(t[p],h)>0;)p--}0===i(t[n],h)?Be(t,n,p):Be(t,++p,r),p<=e&&(n=p+1),e<=p&&(r=p-1)}}function Be(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function ke(t,e){if(!(this instanceof ke))return new ke(t,e);this._maxEntries=Math.max(4,t||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),e&&this._initFormat(e),this.clear()}function ze(t,e){je(t,0,t.children.length,e,t)}function je(t,e,n,r,i){i||(i=Ze(null)),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(var o,s=e;s<n;s++)o=t.children[s],Xe(i,t.leaf?r(o):o);return i}function Xe(t,e){return t.minX=Math.min(t.minX,e.minX),t.minY=Math.min(t.minY,e.minY),t.maxX=Math.max(t.maxX,e.maxX),t.maxY=Math.max(t.maxY,e.maxY),t}function Ue(t,e){return t.minX-e.minX}function Ye(t,e){return t.minY-e.minY}function Ve(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function He(t){return t.maxX-t.minX+(t.maxY-t.minY)}function We(t,e){return t.minX<=e.minX&&t.minY<=e.minY&&e.maxX<=t.maxX&&e.maxY<=t.maxY}function Je(t,e){return e.minX<=t.maxX&&e.minY<=t.maxY&&e.maxX>=t.minX&&e.maxY>=t.minY}function Ze(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function Ke(t,e,n,r,i){for(var o,s=[e,n];s.length;)(n=s.pop())-(e=s.pop())<=r||(qe(t,o=e+Math.ceil((n-e)/r/2)*r,e,n,i),s.push(e,o,o,n))}function Qe(t){var e=ke(t);return e.insert=function(t){if(Array.isArray(t)){var e=t;(t=$e(e)).bbox=e}else t.bbox=t.bbox?t.bbox:tn(t);return ke.prototype.insert.call(this,t)},e.load=function(t){var e=[];return Array.isArray(t)?t.forEach((function(t){var n=$e(t);n.bbox=t,e.push(n)})):O(t,(function(t){t.bbox=t.bbox?t.bbox:tn(t),e.push(t)})),ke.prototype.load.call(this,e)},e.remove=function(t){if(Array.isArray(t)){var e=t;(t=$e(e)).bbox=e}return ke.prototype.remove.call(this,t)},e.clear=function(){return ke.prototype.clear.call(this)},e.search=function(t){return{type:"FeatureCollection",features:ke.prototype.search.call(this,this.toBBox(t))}},e.collides=function(t){return ke.prototype.collides.call(this,this.toBBox(t))},e.all=function(){return{type:"FeatureCollection",features:ke.prototype.all.call(this)}},e.toJSON=function(){return ke.prototype.toJSON.call(this)},e.fromJSON=function(t){return ke.prototype.fromJSON.call(this,t)},e.toBBox=function(t){var e;return{minX:(e=t.bbox?t.bbox:Array.isArray(t)&&4===t.length?t:tn(t))[0],minY:e[1],maxX:e[2],maxY:e[3]}},e}function $e(t){var e=[t[0],t[1]],n=[t[0],t[3]],r=[t[2],t[3]];return{type:"Feature",bbox:t,properties:{},geometry:{type:"Polygon",coordinates:[[e,[t[2],t[1]],r,n,e]]}}}function tn(t){var e=[1/0,1/0,-1/0,-1/0];return S(t,(function(t){e[0]>t[0]&&(e[0]=t[0]),e[1]>t[1]&&(e[1]=t[1]),e[2]<t[0]&&(e[2]=t[0]),e[3]<t[1]&&(e[3]=t[1])})),e}function en(t){if(!t)throw new Error("geojson is required");var e=[];return F(t,(function(t){!function(t,e){var n=[],r=t.geometry;switch(r.type){case"Polygon":n=U(r);break;case"LineString":n=[U(r)]}n.forEach((function(n){var r=function(t,e){var n=[];return t.reduce((function(t,r){var i=a([t,r],e);return i.bbox=function(t,e){var n=t[0],r=t[1],i=e[0],o=e[1];return[n<i?n:i,r<o?r:o,n>i?n:i,r>o?r:o]}(t,r),n.push(i),r})),n}(n,t.properties);r.forEach((function(t){t.id=e.length,e.push(t)}))}))}(t,e)})),c(e)}function nn(t,n){var r={},i=[];if("LineString"===t.type&&(t=e(t)),"LineString"===n.type&&(n=e(n)),"Feature"===t.type&&"Feature"===n.type&&"LineString"===t.geometry.type&&"LineString"===n.geometry.type&&2===t.geometry.coordinates.length&&2===n.geometry.coordinates.length){var o=rn(t,n);return o&&i.push(o),c(i)}var s=Qe();return s.load(en(n)),O(en(t),(function(t){O(s.search(t),(function(e){var n=rn(t,e);if(n){var o=U(n).join(",");r[o]||(r[o]=!0,i.push(n))}}))})),c(i)}function rn(t,e){var n=U(t),i=U(e);if(2!==n.length)throw new Error("<intersects> line1 must only contain 2 coordinates");if(2!==i.length)throw new Error("<intersects> line2 must only contain 2 coordinates");var o=n[0][0],s=n[0][1],a=n[1][0],u=n[1][1],c=i[0][0],h=i[0][1],l=i[1][0],p=i[1][1],f=(p-h)*(a-o)-(l-c)*(u-s);if(0===f)return null;var g=((l-c)*(s-h)-(p-h)*(o-c))/f,d=((a-o)*(s-h)-(u-s)*(o-c))/f;return g>=0&&g<=1&&d>=0&&d<=1?r([o+g*(a-o),s+g*(u-s)]):null}function on(t,e,n){if(!I(n=n||{}))throw new Error("options is invalid");var i=t.geometry?t.geometry.type:t.type;if("LineString"!==i&&"MultiLineString"!==i)throw new Error("lines must be LineString or MultiLineString");var o=r([1/0,1/0],{dist:1/0}),s=0;return F(t,(function(t){for(var i=U(t),u=0;u<i.length-1;u++){var c=r(i[u]);c.properties.dist=qt(e,c,n);var h=r(i[u+1]);h.properties.dist=qt(e,h,n);var l=qt(c,h,n),p=Math.max(c.properties.dist,h.properties.dist),f=ge(c,h),g=pe(e,p,f+90,n),d=pe(e,p,f-90,n),y=nn(a([g.geometry.coordinates,d.geometry.coordinates]),a([c.geometry.coordinates,h.geometry.coordinates])),_=null;y.features.length>0&&((_=y.features[0]).properties.dist=qt(e,_,n),_.properties.location=s+qt(c,_,n)),c.properties.dist<o.properties.dist&&((o=c).properties.index=u,o.properties.location=s),h.properties.dist<o.properties.dist&&((o=h).properties.index=u+1,o.properties.location=s+l),_&&_.properties.dist<o.properties.dist&&((o=_).properties.index=u),s+=l}})),o}function sn(t,e,n){if(!I(n=n||{}))throw new Error("options is invalid");var r,i=n.final;if(!t)throw new Error("start point is required");if(!e)throw new Error("end point is required");return(r=i?an(X(e),X(t)):an(X(t),X(e)))>180?-(360-r):r}function an(t,e){var n=x(t[1]),r=x(e[1]),i=x(e[0]-t[0]);i>Math.PI&&(i-=2*Math.PI),i<-Math.PI&&(i+=2*Math.PI);var o=Math.log(Math.tan(r/2+Math.PI/4)/Math.tan(n/2+Math.PI/4));return(v(Math.atan2(i,o))+360)%360}function un(t,e,n){if(!I(n=n||{}))throw new Error("options is invalid");var r=n.units;if(!t)throw new Error("from point is required");if(!e)throw new Error("to point is required");var i=X(t),o=X(e);return o[0]+=o[0]-i[0]>180?-360:i[0]-o[0]>180?360:0,E(function(t,e,n){var r=n=void 0===n?Fo:Number(n),i=t[1]*Math.PI/180,o=e[1]*Math.PI/180,s=o-i,a=Math.abs(e[0]-t[0])*Math.PI/180;a>Math.PI&&(a-=2*Math.PI);var u=Math.log(Math.tan(o/2+Math.PI/4)/Math.tan(i/2+Math.PI/4)),c=Math.abs(u)>1e-11?s/u:Math.cos(i);return Math.sqrt(s*s+c*c*a*a)*r}(i,o),"meters",r)}function cn(t,e){return ln(t,"mercator",e)}function hn(t,e){return ln(t,"wgs84",e)}function ln(t,e,n){if(!I(n=n||{}))throw new Error("options is invalid");var r=n.mutate;if(!t)throw new Error("geojson is required");return Array.isArray(t)&&b(t[0])?t="mercator"===e?pn(t):fn(t):(!0!==r&&(t=Gt(t)),S(t,(function(t){var n="mercator"===e?pn(t):fn(t);t[0]=n[0],t[1]=n[1]}))),t}function pn(t){var e=Math.PI/180,n=20037508.342789244,r=[6378137*(Math.abs(t[0])<=180?t[0]:t[0]-360*function(t){return t<0?-1:t>0?1:0}(t[0]))*e,6378137*Math.log(Math.tan(.25*Math.PI+.5*t[1]*e))];return r[0]>n&&(r[0]=n),r[0]<-n&&(r[0]=-n),r[1]>n&&(r[1]=n),r[1]<-n&&(r[1]=-n),r}function fn(t){var e=180/Math.PI;return[t[0]*e/6378137,(.5*Math.PI-2*Math.atan(Math.exp(-t[1]/6378137)))*e]}function gn(t,n,i){if(!I(i=i||{}))throw new Error("options is invalid");if(!t)throw new Error("pt is required");if(Array.isArray(t)?t=r(t):"Point"===t.type?t=e(t):H(t,"Point","point"),!n)throw new Error("line is required");Array.isArray(n)?n=a(n):"LineString"===n.type?n=e(n):H(n,"LineString","line");var o=1/0,s=t.geometry.coordinates;return G(n,(function(t){var e=t.geometry.coordinates[0],n=t.geometry.coordinates[1],a=function(t,e,n,i){var o=i.mercator,s=!0!==o?qt(e,t,i):dn(e,t,i),a=m(!0!==o?ge(e,t):sn(e,t)),u=m(!0!==o?ge(e,n):sn(e,n)),c=Math.abs(a-u);if(c>90)return s;var h=(u+180)%360,l=m(!0!==o?ge(n,t):sn(n,t)),p=Math.abs(l-h);return p>180&&(p=Math.abs(p-360)),p>90?!0!==o?qt(t,n,i):dn(t,n,i):!0!==o?s*Math.sin(x(c)):function(t,e,n,i){var o=0;(Math.abs(t[0])>=180||Math.abs(e[0])>=180||Math.abs(n[0])>=180)&&(o=t[0]>0||e[0]>0||n[0]>0?-180:180);var s=r(n),a=hn(function(t,e,n){var r=t[0],i=t[1],o=e[0]-r,s=e[1]-i,a=((n[0]-r)*o+(n[1]-i)*s)/(o*o+s*s);return[r+a*o,i+a*s]}(cn([t[0]+o,t[1]]),cn([e[0]+o,e[1]]),cn([n[0]+o,n[1]])));return 0!==o&&(a[0]-=o),un(s,a,i)}(e,n,t,i)}(s,e,n,i);o>a&&(o=a)})),o}function dn(t,e,n){var r=n.units,i=0;Math.abs(t[0])>=180&&(i=t[0]>0?-180:180),Math.abs(e[0])>=180&&(i=e[0]>0?-180:180);var o=cn([t[0]+i,t[1]]),s=cn([e[0]+i,e[1]]),a=function(t){return t*t},u=a(o[0]-s[0])+a(o[1]-s[1]);return E(Math.sqrt(u),"meters",r)}function yn(t){for(var n=function(t){return"FeatureCollection"!==t.type?"Feature"!==t.type?c([e(t)]):c([t]):t}(t),i=de(n),o=!1,s=0;!o&&s<n.features.length;){var a,u=n.features[s].geometry,h=!1;if("Point"===u.type)i.geometry.coordinates[0]===u.coordinates[0]&&i.geometry.coordinates[1]===u.coordinates[1]&&(o=!0);else if("MultiPoint"===u.type){var l=!1;for(a=0;!l&&a<u.coordinates.length;)i.geometry.coordinates[0]===u.coordinates[a][0]&&i.geometry.coordinates[1]===u.coordinates[a][1]&&(o=!0,l=!0),a++}else if("LineString"===u.type)for(a=0;!h&&a<u.coordinates.length-1;)_n(i.geometry.coordinates[0],i.geometry.coordinates[1],u.coordinates[a][0],u.coordinates[a][1],u.coordinates[a+1][0],u.coordinates[a+1][1])&&(h=!0,o=!0),a++;else if("MultiLineString"===u.type)for(var p=0;p<u.coordinates.length;){h=!1,a=0;for(var f=u.coordinates[p];!h&&a<f.length-1;)_n(i.geometry.coordinates[0],i.geometry.coordinates[1],f[a][0],f[a][1],f[a+1][0],f[a+1][1])&&(h=!0,o=!0),a++;p++}else"Polygon"!==u.type&&"MultiPolygon"!==u.type||Pt(i,u)&&(o=!0);s++}if(o)return i;var g=c([]);for(s=0;s<n.features.length;s++)g.features=g.features.concat(me(n.features[s]).features);return r(Fe(i,g).geometry.coordinates)}function _n(t,e,n,r,i,o){return Math.sqrt((i-n)*(i-n)+(o-r)*(o-r))===Math.sqrt((t-n)*(t-n)+(e-r)*(e-r))+Math.sqrt((i-t)*(i-t)+(o-e)*(o-e))}function mn(t){return D(t,(function(t,e){return t+vn(e)}),0)}function vn(t){var e,n=0;switch(t.type){case"Polygon":return xn(t.coordinates);case"MultiPolygon":for(e=0;e<t.coordinates.length;e++)n+=xn(t.coordinates[e]);return n;case"Point":case"MultiPoint":case"LineString":case"MultiLineString":return 0;case"GeometryCollection":for(e=0;e<t.geometries.length;e++)n+=vn(t.geometries[e]);return n}}function xn(t){var e=0;if(t&&t.length>0){e+=Math.abs(En(t[0]));for(var n=1;n<t.length;n++)e-=Math.abs(En(t[n]))}return e}function En(t){var e,n,r,i,o,s,a=0,u=t.length;if(u>2){for(s=0;s<u;s++)s===u-2?(r=u-2,i=u-1,o=0):s===u-1?(r=u-1,i=0,o=1):(r=s,i=s+1,o=s+2),e=t[r],n=t[i],a+=(wn(t[o][0])-wn(e[0]))*Math.sin(wn(n[1]));a=a*Ss*Ss/2}return a}function wn(t){return t*Math.PI/180}function bn(t,e){if(!I(e=e||{}))throw new Error("options is invalid");if(!t)throw new Error("geojson is required");return B(t,(function(t,n){var r=n.geometry.coordinates;return t+qt(r[0],r[1],e)}),0)}function In(t,e,n,r){if(!I(r=r||{}))throw new Error("options is invalid");var i,o=[];if("Feature"===t.type)i=t.geometry.coordinates;else{if("LineString"!==t.type)throw new Error("input must be a LineString Feature or Geometry");i=t.coordinates}for(var s,u,c,h=0,l=0;l<i.length&&!(e>=h&&l===i.length-1);l++){if(h>e&&0===o.length){if(!(s=e-h))return o.push(i[l]),a(o);u=ge(i[l],i[l-1])-180,c=pe(i[l],s,u,r),o.push(c.geometry.coordinates)}if(h>=n)return(s=n-h)?(u=ge(i[l],i[l-1])-180,c=pe(i[l],s,u,r),o.push(c.geometry.coordinates),a(o)):(o.push(i[l]),a(o));if(h>=e&&o.push(i[l]),l===i.length-1)return a(o);h+=qt(i[l],i[l+1],r)}return a(i[i.length-1])}function Nn(t,e,n){var r=(n=n||{}).ignoreEndVertices;if(!I(n))throw new Error("invalid options");if(!t)throw new Error("pt is required");if(!e)throw new Error("line is required");for(var i=X(t),o=U(e),s=0;s<o.length-1;s++){var a=!1;if(r&&(0===s&&(a="start"),s===o.length-2&&(a="end"),0===s&&s+1===o.length-1&&(a="both")),function(t,e,n,r){var i=n[0],o=n[1],s=t[0],a=t[1],u=e[0],c=e[1],h=u-s,l=c-a;return(n[0]-s)*l-(n[1]-a)*h==0&&(r?"start"===r?Math.abs(h)>=Math.abs(l)?h>0?s<i&&i<=u:u<=i&&i<s:l>0?a<o&&o<=c:c<=o&&o<a:"end"===r?Math.abs(h)>=Math.abs(l)?h>0?s<=i&&i<u:u<i&&i<=s:l>0?a<=o&&o<c:c<o&&o<=a:"both"===r?Math.abs(h)>=Math.abs(l)?h>0?s<i&&i<u:u<i&&i<s:l>0?a<o&&o<c:c<o&&o<a:void 0:Math.abs(h)>=Math.abs(l)?h>0?s<=i&&i<=u:u<=i&&i<=s:l>0?a<=o&&o<=c:c<=o&&o<=a)}(o[s],o[s+1],i,a))return!0}return!1}function Cn(t,e){var n=K(t),r=K(e),i=J(t),o=J(e);switch(n){case"Point":switch(r){case"MultiPoint":return function(t,e){var n,r=!1;for(n=0;n<e.coordinates.length;n++)if(Mn(e.coordinates[n],t.coordinates)){r=!0;break}return r}(i,o);case"LineString":return Nn(i,o,{ignoreEndVertices:!0});case"Polygon":return Pt(i,o,{ignoreBoundary:!0});default:throw new Error("feature2 "+r+" geometry not supported")}case"MultiPoint":switch(r){case"MultiPoint":return function(t,e){for(var n=0;n<t.coordinates.length;n++){for(var r=!1,i=0;i<e.coordinates.length;i++)Mn(t.coordinates[n],e.coordinates[i])&&(r=!0);if(!r)return!1}return!0}(i,o);case"LineString":return function(t,e){for(var n=!1,r=0;r<t.coordinates.length;r++){if(!Nn(t.coordinates[r],e))return!1;n||(n=Nn(t.coordinates[r],e,{ignoreEndVertices:!0}))}return n}(i,o);case"Polygon":return function(t,e){for(var n=!0,r=0;r<t.coordinates.length;r++){var i=Pt(t.coordinates[1],e);if(!i){n=!1;break}i=Pt(t.coordinates[1],e,{ignoreBoundary:!0})}return n&&i}(i,o);default:throw new Error("feature2 "+r+" geometry not supported")}case"LineString":switch(r){case"LineString":return function(t,e){for(var n=0;n<t.coordinates.length;n++)if(!Nn(t.coordinates[n],e))return!1;return!0}(i,o);case"Polygon":return function(t,e){if(!Sn(j(e),j(t)))return!1;for(var n=!1,r=0;r<t.coordinates.length-1;r++){if(!Pt(t.coordinates[r],e))return!1;if(n||(n=Pt(t.coordinates[r],e,{ignoreBoundary:!0})),!n){var i=function(t,e){return[(t[0]+e[0])/2,(t[1]+e[1])/2]}(t.coordinates[r],t.coordinates[r+1]);n=Pt(i,e,{ignoreBoundary:!0})}}return n}(i,o);default:throw new Error("feature2 "+r+" geometry not supported")}case"Polygon":if("Polygon"===r)return function(t,e){var n=j(t);if(!Sn(j(e),n))return!1;for(var r=0;r<t.coordinates[0].length;r++)if(!Pt(t.coordinates[0][r],e))return!1;return!0}(i,o);throw new Error("feature2 "+r+" geometry not supported");default:throw new Error("feature1 "+n+" geometry not supported")}}function Sn(t,e){return!(t[0]>e[0])&&!(t[2]<e[2])&&!(t[1]>e[1])&&!(t[3]<e[3])}function Mn(t,e){return t[0]===e[0]&&t[1]===e[1]}function Ln(t,e,n){if(!I(n=n||{}))throw new Error("options is invalid");var i=n.mask,o=n.properties,s=[];if(null===e||void 0===e)throw new Error("cellSide is required");if(!b(e))throw new Error("cellSide is invalid");if(!t)throw new Error("bbox is required");if(!Array.isArray(t))throw new Error("bbox must be array");if(4!==t.length)throw new Error("bbox must contain 4 numbers");if(i&&-1===["Polygon","MultiPolygon"].indexOf(K(i)))throw new Error("options.mask must be a (Multi)Polygon");for(var a=t[0],u=t[1],h=t[2],l=t[3],p=e/qt([a,u],[h,u],n)*(h-a),f=e/qt([a,u],[a,l],n)*(l-u),g=h-a,d=l-u,y=Math.floor(g/p),_=(d-Math.floor(d/f)*f)/2,m=a+(g-y*p)/2;m<=h;){for(var v=u+_;v<=l;){var x=r([m,v],o);i?Cn(x,i)&&s.push(x):s.push(x),v+=f}m+=p}return c(s)}function Pn(t,e){if(!I(e=e||{}))throw new Error("options is invalid");var n=e.precision,r=e.coordinates,i=e.mutate;if(n=void 0===n||null===n||isNaN(n)?6:n,r=void 0===r||null===r||isNaN(r)?3:r,!t)throw new Error("<geojson> is required");if("number"!=typeof n)throw new Error("<precision> must be a number");if("number"!=typeof r)throw new Error("<coordinates> must be a number");!1!==i&&void 0!==i||(t=JSON.parse(JSON.stringify(t)));var o=Math.pow(10,n);return S(t,(function(t){!function(t,e,n){t.length>n&&t.splice(n,t.length);for(var r=0;r<t.length;r++)t[r]=Math.round(t[r]*e)/e}(t,o,r)})),t}function On(t,e){if(!t||!e)return!1;if(t.length!==e.length)return!1;for(var n=0,r=t.length;n<r;n++)if(t[n]instanceof Array&&e[n]instanceof Array){if(!On(t[n],e[n]))return!1}else if(t[n]!==e[n])return!1;return!0}function Rn(t,e){if(void 0===e&&(e=!0),3!=t.length)throw new Error("This function requires an array of three points [x,y]");return(t[1][0]-t[0][0])*(t[2][1]-t[0][1])-(t[1][1]-t[0][1])*(t[2][0]-t[0][0])>=0==e}function Tn(t,e){if(!t||!e)return!1;if(t.length!=e.length)return!1;for(var n=0,r=t.length;n<r;n++)if(t[n]instanceof Array&&e[n]instanceof Array){if(!Tn(t[n],e[n]))return!1}else if(t[n]!=e[n])return!1;return!0}function An(t,e){var n=[],r=Qe();return F(e,(function(e){if(n.forEach((function(t,e){t.id=e})),n.length){var i=r.search(e);if(i.features.length){var o=Fn(e,i);n=n.filter((function(t){return t.id!==o.id})),r.remove(o),O(Dn(o,e),(function(t){n.push(t),r.insert(t)}))}}else(n=Dn(t,e).features).forEach((function(t){t.bbox||(t.bbox=le(j(t)))})),r.load(c(n))})),c(n)}function Dn(t,e){var n=[],r=U(t)[0],i=U(t)[t.geometry.coordinates.length-1];if(qn(r,X(e))||qn(i,X(e)))return c([t]);var o=Qe(),s=en(t);o.load(s);var u=o.search(e);if(!u.features.length)return c([t]);var h=Fn(e,u),l=R(s,(function(t,r,i){var o=U(r)[1],s=X(e);return i===h.id?(t.push(s),n.push(a(t)),qn(s,o)?[s]:[s,o]):(t.push(o),t)}),[r]);return l.length>1&&n.push(a(l)),c(n)}function Fn(t,e){if(!e.features.length)throw new Error("lines must contain features");if(1===e.features.length)return e.features[0];var n,r=1/0;return O(e,(function(e){var i=on(e,t).properties.dist;i<r&&(n=e,r=i)})),n}function qn(t,e){return t[0]===e[0]&&t[1]===e[1]}function Gn(t,e,n,r,i){if(!I(i=i||{}))throw new Error("options is invalid");var o=i.steps,s=i.units;if(!t)throw new Error("center is required");if(!e)throw new Error("radius is required");if(void 0===n||null===n)throw new Error("bearing1 is required");if(void 0===r||null===r)throw new Error("bearing2 is required");if("object"!=typeof i)throw new Error("options must be an object");o=o||64;var u=Bn(n),c=Bn(r),h=t.properties;if(u===c)return a(fe(t,e,i).geometry.coordinates[0],h);for(var l=u,p=u<c?c:c+360,f=l,g=[],d=0;f<p;)g.push(pe(t,e,f,s).geometry.coordinates),f=l+360*++d/o;return f>p&&g.push(pe(t,e,p,s).geometry.coordinates),a(g,h)}function Bn(t){var e=t%360;return e<0&&(e+=360),e}function kn(t,e){if(!I(e=e||{}))throw new Error("options is invalid");var n=e.properties,r=K(t),i=U(t);if(n=n||t.properties||{},!i.length)throw new Error("polygon must contain coordinates");switch(r){case"Polygon":return zn(i,n);case"MultiPolygon":var o=[];return i.forEach((function(t){o.push(zn(t,n))})),c(o);default:throw new Error("geom "+r+" not supported")}}function zn(t,e){return t.length>1?h(t,e):a(t[0],e)}function jn(t,e){if(!I(e=e||{}))throw new Error("options is invalid");var n=e.properties,r=e.autoComplete,i=e.orderCoords;if(!t)throw new Error("lines is required");switch(r=void 0===r||r,i=void 0===i||i,K(t)){case"FeatureCollection":case"GeometryCollection":var o=[];return(t.features?t.features:t.geometries).forEach((function(t){o.push(U(Xn(t,{},r,i)))})),p(o,n)}return Xn(t,n,r,i)}function Xn(t,e,n,r){e=e||t.properties||{};var i=U(t),s=K(t);if(!i.length)throw new Error("line must contain coordinates");switch(s){case"LineString":return n&&(i=Un(i)),o([i],e);case"MultiLineString":var u=[],c=0;return i.forEach((function(t){if(n&&(t=Un(t)),r){var e=function(t){var e=t[0],n=t[1],r=t[2],i=t[3];return Math.abs(e-r)*Math.abs(n-i)}(j(a(t)));e>c?(u.unshift(t),c=e):u.push(t)}else u.push(t)})),o(u,e);default:throw new Error("geometry type "+s+" is not supported")}}function Un(t){var e=t[0],n=e[0],r=e[1],i=t[t.length-1],o=i[0],s=i[1];return n===o&&r===s||t.push(e),t}function Yn(t,e,n){var r,i,o,s,a,u=t.length,c=Hn(t[0],e),h=[];for(n||(n=[]),r=1;r<u;r++){for(i=t[r-1],s=a=Hn(o=t[r],e);;){if(!(c|s)){h.push(i),s!==a?(h.push(o),r<u-1&&(n.push(h),h=[])):r===u-1&&h.push(o);break}if(c&s)break;c?c=Hn(i=Vn(i,o,c,e),e):s=Hn(o=Vn(i,o,s,e),e)}c=a}return h.length&&n.push(h),n}function Vn(t,e,n,r){return 8&n?[t[0]+(e[0]-t[0])*(r[3]-t[1])/(e[1]-t[1]),r[3]]:4&n?[t[0]+(e[0]-t[0])*(r[1]-t[1])/(e[1]-t[1]),r[1]]:2&n?[r[2],t[1]+(e[1]-t[1])*(r[2]-t[0])/(e[0]-t[0])]:1&n?[r[0],t[1]+(e[1]-t[1])*(r[0]-t[0])/(e[0]-t[0])]:null}function Hn(t,e){var n=0;return t[0]<e[0]?n|=1:t[0]>e[2]&&(n|=2),t[1]<e[1]?n|=4:t[1]>e[3]&&(n|=8),n}function Wn(t,e){for(var n=[],r=0;r<t.length;r++){var i=Gs.polygon(t[r],e);i.length>0&&(i[0][0]===i[i.length-1][0]&&i[0][1]===i[i.length-1][1]||i.push(i[0]),i.length>=4&&n.push(i))}return n}function Jn(t){return"[object Arguments]"===Object.prototype.toString.call(t)}function Zn(t,e,n){return n||(n={}),t===e||(t instanceof Date&&e instanceof Date?t.getTime()===e.getTime():!t||!e||"object"!=typeof t&&"object"!=typeof e?(n.strict,t===e):function(t,e,n){var r,i;if(Kn(t)||Kn(e))return!1;if(t.prototype!==e.prototype)return!1;if(Jn(t))return!!Jn(e)&&Zn(t=Bs.call(t),e=Bs.call(e),n);if(Qn(t)){if(!Qn(e))return!1;if(t.length!==e.length)return!1;for(r=0;r<t.length;r++)if(t[r]!==e[r])return!1;return!0}try{var o=Object.keys(t),s=Object.keys(e)}catch(t){return!1}if(o.length!==s.length)return!1;for(o.sort(),s.sort(),r=o.length-1;r>=0;r--)if(o[r]!==s[r])return!1;for(r=o.length-1;r>=0;r--)if(!Zn(t[i=o[r]],e[i],n))return!1;return typeof t==typeof e}(t,e,n))}function Kn(t){return null===t||void 0===t}function Qn(t){return!(!t||"object"!=typeof t||"number"!=typeof t.length)&&"function"==typeof t.copy&&"function"==typeof t.slice&&!(t.length>0&&"number"!=typeof t[0])}function $n(t,e,n){if(!I(n=n||{}))throw new Error("options is invalid");var r,i=n.tolerance||0,o=[],s=Qe();return s.load(en(t)),G(e,(function(t){var e=!1;O(s.search(t),(function(n){if(!1===e){var o=U(t).sort(),s=U(n).sort();Zn(o,s)||(0===i?Nn(o[0],n)&&Nn(o[1],n):on(n,o[0]).properties.dist<=i&&on(n,o[1]).properties.dist<=i)?(e=!0,r=r?tr(r,t):t):(0===i?Nn(s[0],t)&&Nn(s[1],t):on(t,s[0]).properties.dist<=i&&on(t,s[1]).properties.dist<=i)&&(r=r?tr(r,n):n)}})),!1===e&&r&&(o.push(r),r=void 0)})),r&&o.push(r),c(o)}function tr(t,e){var n=U(e),r=U(t),i=r[0],o=r[r.length-1],s=t.geometry.coordinates;return Zn(n[0],i)?s.unshift(n[1]):Zn(n[0],o)?s.push(n[1]):Zn(n[1],i)?s.unshift(n[0]):Zn(n[1],o)&&s.push(n[0]),t}function er(t){var e=t%360;return e<0&&(e+=360),e}function nr(t,e,n,i){if(!I(i=i||{}))throw new Error("options is invalid");var o=i.units,s=i.properties;if(!t)throw new Error("origin is required");if(void 0===e||null===e)throw new Error("distance is required");if(void 0===n||null===n)throw new Error("bearing is required");if(!(e>=0))throw new Error("distance must be greater than 0");var a=E(e,o,"meters"),u=X(t),c=function(t,e,n,r){var i=e/(r=void 0===r?Fo:Number(r)),o=t[0]*Math.PI/180,s=x(t[1]),a=x(n),u=i*Math.cos(a),c=s+u;Math.abs(c)>Math.PI/2&&(c=c>0?Math.PI-c:-Math.PI-c);var h=Math.log(Math.tan(c/2+Math.PI/4)/Math.tan(s/2+Math.PI/4)),l=Math.abs(h)>1e-11?u/h:Math.cos(s);return[(180*(o+i*Math.sin(a)/l)/Math.PI+540)%360-180,180*c/Math.PI]}(u,a,n);return c[0]+=c[0]-u[0]>180?-360:u[0]-c[0]>180?360:0,r(c,s)}function rr(t,e,n,r,i,o){for(var s=0;s<t.length;s++){var a=t[s],u=t[s+1];s===t.length-1&&(u=t[0]),r=ir(a,u,e),n<=0&&r>0?function(t,e,n){return ir(t,e,n)<0}(e,a,i)||(i=a):n>0&&r<=0&&(function(t,e,n){return ir(t,e,n)>0}(e,a,o)||(o=a)),n=r}return[i,o]}function ir(t,e,n){return(e[0]-t[0])*(n[1]-t[1])-(n[0]-t[0])*(e[1]-t[1])}function or(t){if(!t)throw new Error("line is required");var e=t.geometry?t.geometry.type:t.type;if(!Array.isArray(t)&&"LineString"!==e)throw new Error("geometry must be a LineString");for(var n,r,i=U(t),o=0,s=1;s<i.length;)n=r||i[0],o+=((r=i[s])[0]-n[0])*(r[1]+n[1]),s++;return o>0}function sr(t,e){switch("Feature"===t.type?t.geometry.type:t.type){case"GeometryCollection":return A(t,(function(t){sr(t,e)})),t;case"LineString":return ar(U(t),e),t;case"Polygon":return ur(U(t),e),t;case"MultiLineString":return U(t).forEach((function(t){ar(t,e)})),t;case"MultiPolygon":return U(t).forEach((function(t){ur(t,e)})),t;case"Point":case"MultiPoint":return t}}function ar(t,e){or(t)===e&&t.reverse()}function ur(t,e){or(t[0])!==e&&t[0].reverse();for(var n=1;n<t.length;n++)or(t[n])===e&&t[n].reverse()}function cr(t,e){if(!I(e=e||{}))throw new Error("options is invalid");var n=e.zProperty||"elevation",r=e.flip,i=e.flags;W(t,"Point","input must contain Points");for(var o=function(t,e){var n={};return O(t,(function(t){var e=U(t)[1];n[e]||(n[e]=[]),n[e].push(t)})),Object.keys(n).map((function(t){var e=n[t].sort((function(t,e){return U(t)[0]-U(e)[0]}));return e})).sort((function(t,n){return e?U(t[0])[1]-U(n[0])[1]:U(n[0])[1]-U(t[0])[1]}))}(t,r),s=[],a=0;a<o.length;a++){for(var u=o[a],c=[],h=0;h<u.length;h++){var l=u[h];l.properties[n]?c.push(l.properties[n]):c.push(0),!0===i&&(l.properties.matrixPosition=[a,h])}s.push(c)}return s}function hr(t,e,n,r){r=r||{};for(var i=Object.keys(ks),o=0;o<i.length;o++){var s=i[o],a=r[s];a=void 0!==a&&null!==a?a:ks[s],zs[s]=a}zs.verbose&&console.log("MarchingSquaresJS-isoBands: computing isobands for ["+e+":"+(e+n)+"]");var u,c=function(t,e,n){for(var r=t.length-1,i=t[0].length-1,o={rows:r,cols:i,cells:[]},s=e+Math.abs(n),a=0;a<r;++a){o.cells[a]=[];for(var u=0;u<i;++u){var c=0,h=t[a+1][u],l=t[a+1][u+1],p=t[a][u+1],f=t[a][u];if(!(isNaN(h)||isNaN(l)||isNaN(p)||isNaN(f))){c|=h<e?0:h>s?128:64,c|=l<e?0:l>s?32:16,c|=p<e?0:p>s?8:4;var g=+(c|=f<e?0:f>s?2:1),d=0;if(17===c||18===c||33===c||34===c||38===c||68===c||72===c||98===c||102===c||132===c||136===c||137===c||152===c||153===c){var y=(h+l+p+f)/4;d=y>s?2:y<e?0:1,34===c?1===d?c=35:0===d&&(c=136):136===c?1===d?(c=35,d=4):0===d&&(c=34):17===c?1===d?(c=155,d=4):0===d&&(c=153):68===c?1===d?(c=103,d=4):0===d&&(c=102):153===c?1===d&&(c=155):102===c?1===d&&(c=103):152===c?d<2&&(c=156,d=1):137===c?d<2&&(c=139,d=1):98===c?d<2&&(c=99,d=1):38===c?d<2&&(c=39,d=1):18===c?d>0?(c=156,d=4):c=152:33===c?d>0?(c=139,d=4):c=137:72===c?d>0?(c=99,d=4):c=98:132===c&&(d>0?(c=39,d=4):c=38)}if(0!=c&&170!=c){var _,m,v,x,E,w,b,I;_=m=v=x=E=w=b=I=.5;var N=[];1===c?(v=1-lr(e,p,f),I=1-lr(e,h,f),N.push(Sa[c])):169===c?(v=lr(s,f,p),I=lr(s,f,h),N.push(Sa[c])):4===c?(w=1-lr(e,l,p),x=lr(e,f,p),N.push(Na[c])):166===c?(w=lr(s,p,l),x=1-lr(s,p,f),N.push(Na[c])):16===c?(E=lr(e,p,l),m=lr(e,h,l),N.push(Ia[c])):154===c?(E=1-lr(s,l,p),m=1-lr(s,l,h),N.push(Ia[c])):64===c?(b=lr(e,f,h),_=1-lr(e,l,h),N.push(La[c])):106===c?(b=1-lr(s,h,f),_=lr(s,h,l),N.push(La[c])):168===c?(x=lr(s,f,p),v=lr(e,f,p),I=lr(e,f,h),b=lr(s,f,h),N.push(Ca[c]),N.push(Sa[c])):2===c?(x=1-lr(e,p,f),v=1-lr(s,p,f),I=1-lr(s,h,f),b=1-lr(e,h,f),N.push(Ca[c]),N.push(Sa[c])):162===c?(E=lr(s,p,l),w=lr(e,p,l),x=1-lr(e,p,f),v=1-lr(s,p,f),N.push(Ca[c]),N.push(Sa[c])):8===c?(E=1-lr(e,l,p),w=1-lr(s,l,p),x=lr(s,f,p),v=lr(e,f,p),N.push(Ia[c]),N.push(Na[c])):138===c?(E=1-lr(e,l,p),w=1-lr(s,l,p),_=1-lr(s,l,h),m=1-lr(e,l,h),N.push(Ia[c]),N.push(Na[c])):32===c?(E=lr(s,p,l),w=lr(e,p,l),_=lr(e,h,l),m=lr(s,h,l),N.push(Ia[c]),N.push(Na[c])):42===c?(I=1-lr(s,h,f),b=1-lr(e,h,f),_=lr(e,h,l),m=lr(s,h,l),N.push(Ma[c]),N.push(La[c])):128===c&&(I=lr(e,f,h),b=lr(s,f,h),_=1-lr(s,l,h),m=1-lr(e,l,h),N.push(Ma[c]),N.push(La[c])),5===c?(w=1-lr(e,l,p),I=1-lr(e,h,f),N.push(Na[c])):165===c?(w=lr(s,p,l),I=lr(s,f,h),N.push(Na[c])):20===c?(x=lr(e,f,p),m=lr(e,h,l),N.push(Ca[c])):150===c?(x=1-lr(s,p,f),m=1-lr(s,l,h),N.push(Ca[c])):80===c?(E=lr(e,p,l),b=lr(e,f,h),N.push(Ia[c])):90===c?(E=1-lr(s,l,p),b=1-lr(s,h,f),N.push(Ia[c])):65===c?(v=1-lr(e,p,f),_=1-lr(e,l,h),N.push(Sa[c])):105===c?(v=lr(s,f,p),_=lr(s,h,l),N.push(Sa[c])):160===c?(E=lr(s,p,l),w=lr(e,p,l),I=lr(e,f,h),b=lr(s,f,h),N.push(Ia[c]),N.push(Na[c])):10===c?(E=1-lr(e,l,p),w=1-lr(s,l,p),I=1-lr(s,h,f),b=1-lr(e,h,f),N.push(Ia[c]),N.push(Na[c])):130===c?(x=1-lr(e,p,f),v=1-lr(s,p,f),_=1-lr(s,l,h),m=1-lr(e,l,h),N.push(Ca[c]),N.push(Sa[c])):40===c?(x=lr(s,f,p),v=lr(e,f,p),_=lr(e,h,l),m=lr(s,h,l),N.push(Ca[c]),N.push(Sa[c])):101===c?(w=lr(s,p,l),_=lr(s,h,l),N.push(Na[c])):69===c?(w=1-lr(e,l,p),_=1-lr(e,l,h),N.push(Na[c])):149===c?(I=lr(s,f,h),m=1-lr(s,l,h),N.push(Ma[c])):21===c?(I=1-lr(e,h,f),m=lr(e,h,l),N.push(Ma[c])):86===c?(x=1-lr(s,p,f),b=1-lr(s,h,f),N.push(Ca[c])):84===c?(x=lr(e,f,p),b=lr(e,f,h),N.push(Ca[c])):89===c?(E=1-lr(s,l,p),v=lr(s,f,p),N.push(Sa[c])):81===c?(E=lr(e,p,l),v=1-lr(e,p,f),N.push(Sa[c])):96===c?(E=lr(s,p,l),w=lr(e,p,l),b=lr(e,f,h),_=lr(s,h,l),N.push(Ia[c]),N.push(Na[c])):74===c?(E=1-lr(e,l,p),w=1-lr(s,l,p),b=1-lr(s,h,f),_=1-lr(e,l,h),N.push(Ia[c]),N.push(Na[c])):24===c?(E=1-lr(s,l,p),x=lr(s,f,p),v=lr(e,f,p),m=lr(e,h,l),N.push(Ia[c]),N.push(Sa[c])):146===c?(E=lr(e,p,l),x=1-lr(e,p,f),v=1-lr(s,p,f),m=1-lr(s,l,h),N.push(Ia[c]),N.push(Sa[c])):6===c?(w=1-lr(e,l,p),x=1-lr(s,p,f),I=1-lr(s,h,f),b=1-lr(e,h,f),N.push(Na[c]),N.push(Ca[c])):164===c?(w=lr(s,p,l),x=lr(e,f,p),I=lr(e,f,h),b=lr(s,f,h),N.push(Na[c]),N.push(Ca[c])):129===c?(v=1-lr(e,p,f),I=lr(s,f,h),_=1-lr(s,l,h),m=1-lr(e,l,h),N.push(Sa[c]),N.push(Ma[c])):41===c?(v=lr(s,f,p),I=1-lr(e,h,f),_=lr(e,h,l),m=lr(s,h,l),N.push(Sa[c]),N.push(Ma[c])):66===c?(x=1-lr(e,p,f),v=1-lr(s,p,f),b=1-lr(s,h,f),_=1-lr(e,l,h),N.push(Ca[c]),N.push(Sa[c])):104===c?(x=lr(s,f,p),v=lr(e,f,p),b=lr(e,f,h),_=lr(s,h,l),N.push(Sa[c]),N.push(Pa[c])):144===c?(E=lr(e,p,l),I=lr(e,f,h),b=lr(s,f,h),m=1-lr(s,l,h),N.push(Ia[c]),N.push(La[c])):26===c?(E=1-lr(s,l,p),I=1-lr(s,h,f),b=1-lr(e,h,f),m=lr(e,h,l),N.push(Ia[c]),N.push(La[c])):36===c?(w=lr(s,p,l),x=lr(e,f,p),_=lr(e,h,l),m=lr(s,h,l),N.push(Na[c]),N.push(Ca[c])):134===c?(w=1-lr(e,l,p),x=1-lr(s,p,f),_=1-lr(s,l,h),m=1-lr(e,l,h),N.push(Na[c]),N.push(Ca[c])):9===c?(E=1-lr(e,l,p),w=1-lr(s,l,p),v=lr(s,f,p),I=1-lr(e,h,f),N.push(Ia[c]),N.push(Na[c])):161===c?(E=lr(s,p,l),w=lr(e,p,l),v=1-lr(e,p,f),I=lr(s,f,h),N.push(Ia[c]),N.push(Na[c])):37===c?(w=lr(s,p,l),I=1-lr(e,h,f),_=lr(e,h,l),m=lr(s,h,l),N.push(Na[c]),N.push(Ma[c])):133===c?(w=1-lr(e,l,p),I=lr(s,f,h),_=1-lr(s,l,h),m=1-lr(e,l,h),N.push(Na[c]),N.push(Ma[c])):148===c?(x=lr(e,f,p),I=lr(e,f,h),b=lr(s,f,h),m=1-lr(s,l,h),N.push(Ca[c]),N.push(La[c])):22===c?(x=1-lr(s,p,f),I=1-lr(s,h,f),b=1-lr(e,h,f),m=lr(e,h,l),N.push(Ca[c]),N.push(La[c])):82===c?(E=lr(e,p,l),x=1-lr(e,p,f),v=1-lr(s,p,f),b=1-lr(s,h,f),N.push(Ia[c]),N.push(Sa[c])):88===c?(E=1-lr(s,l,p),x=lr(s,f,p),v=lr(e,f,p),b=lr(e,f,h),N.push(Ia[c]),N.push(Sa[c])):73===c?(E=1-lr(e,l,p),w=1-lr(s,l,p),v=lr(s,f,p),_=1-lr(e,l,h),N.push(Ia[c]),N.push(Na[c])):97===c?(E=lr(s,p,l),w=lr(e,p,l),v=1-lr(e,p,f),_=lr(s,h,l),N.push(Ia[c]),N.push(Na[c])):145===c?(E=lr(e,p,l),v=1-lr(e,p,f),I=lr(s,f,h),m=1-lr(s,l,h),N.push(Ia[c]),N.push(Ma[c])):25===c?(E=1-lr(s,l,p),v=lr(s,f,p),I=1-lr(e,h,f),m=lr(e,h,l),N.push(Ia[c]),N.push(Ma[c])):70===c?(w=1-lr(e,l,p),x=1-lr(s,p,f),b=1-lr(s,h,f),_=1-lr(e,l,h),N.push(Na[c]),N.push(Ca[c])):100===c?(w=lr(s,p,l),x=lr(e,f,p),b=lr(e,f,h),_=lr(s,h,l),N.push(Na[c]),N.push(Ca[c])):34===c?(0===d?(E=1-lr(e,l,p),w=1-lr(s,l,p),x=lr(s,f,p),v=lr(e,f,p),I=lr(e,f,h),b=lr(s,f,h),_=1-lr(s,l,h),m=1-lr(e,l,h)):(E=lr(s,p,l),w=lr(e,p,l),x=1-lr(e,p,f),v=1-lr(s,p,f),I=1-lr(s,h,f),b=1-lr(e,h,f),_=lr(e,h,l),m=lr(s,h,l)),N.push(Ia[c]),N.push(Na[c]),N.push(Ma[c]),N.push(La[c])):35===c?(4===d?(E=1-lr(e,l,p),w=1-lr(s,l,p),x=lr(s,f,p),v=lr(e,f,p),I=lr(e,f,h),b=lr(s,f,h),_=1-lr(s,l,h),m=1-lr(e,l,h)):(E=lr(s,p,l),w=lr(e,p,l),x=1-lr(e,p,f),v=1-lr(s,p,f),I=1-lr(s,h,f),b=1-lr(e,h,f),_=lr(e,h,l),m=lr(s,h,l)),N.push(Ia[c]),N.push(Na[c]),N.push(Sa[c]),N.push(La[c])):136===c?(0===d?(E=lr(s,p,l),w=lr(e,p,l),x=1-lr(e,p,f),v=1-lr(s,p,f),I=1-lr(s,h,f),b=1-lr(e,h,f),_=lr(e,h,l),m=lr(s,h,l)):(E=1-lr(e,l,p),w=1-lr(s,l,p),x=lr(s,f,p),v=lr(e,f,p),I=lr(e,f,h),b=lr(s,f,h),_=1-lr(s,l,h),m=1-lr(e,l,h)),N.push(Ia[c]),N.push(Na[c]),N.push(Ma[c]),N.push(La[c])):153===c?(0===d?(E=lr(e,p,l),v=1-lr(e,p,f),I=1-lr(e,h,f),m=lr(e,h,l)):(E=1-lr(s,l,p),v=lr(s,f,p),I=lr(s,f,h),m=1-lr(s,l,h)),N.push(Ia[c]),N.push(Sa[c])):102===c?(0===d?(w=1-lr(e,l,p),x=lr(e,f,p),b=lr(e,f,h),_=1-lr(e,l,h)):(w=lr(s,p,l),x=1-lr(s,p,f),b=1-lr(s,h,f),_=lr(s,h,l)),N.push(Na[c]),N.push(La[c])):155===c?(4===d?(E=lr(e,p,l),v=1-lr(e,p,f),I=1-lr(e,h,f),m=lr(e,h,l)):(E=1-lr(s,l,p),v=lr(s,f,p),I=lr(s,f,h),m=1-lr(s,l,h)),N.push(Ia[c]),N.push(Ma[c])):103===c?(4===d?(w=1-lr(e,l,p),x=lr(e,f,p),b=lr(e,f,h),_=1-lr(e,l,h)):(w=lr(s,p,l),x=1-lr(s,p,f),b=1-lr(s,h,f),_=lr(s,h,l)),N.push(Na[c]),N.push(Ca[c])):152===c?(0===d?(E=lr(e,p,l),x=1-lr(e,p,f),v=1-lr(s,p,f),I=1-lr(s,h,f),b=1-lr(e,h,f),m=lr(e,h,l)):(E=1-lr(s,l,p),x=lr(s,f,p),v=lr(e,f,p),I=lr(e,f,h),b=lr(s,f,h),m=1-lr(s,l,h)),N.push(Ia[c]),N.push(Ca[c]),N.push(Sa[c])):156===c?(4===d?(E=lr(e,p,l),x=1-lr(e,p,f),v=1-lr(s,p,f),I=1-lr(s,h,f),b=1-lr(e,h,f),m=lr(e,h,l)):(E=1-lr(s,l,p),x=lr(s,f,p),v=lr(e,f,p),I=lr(e,f,h),b=lr(s,f,h),m=1-lr(s,l,h)),N.push(Ia[c]),N.push(Sa[c]),N.push(La[c])):137===c?(0===d?(E=lr(s,p,l),w=lr(e,p,l),v=1-lr(e,p,f),I=1-lr(e,h,f),_=lr(e,h,l),m=lr(s,h,l)):(E=1-lr(e,l,p),w=1-lr(s,l,p),v=lr(s,f,p),I=lr(s,f,h),_=1-lr(s,l,h),m=1-lr(e,l,h)),N.push(Ia[c]),N.push(Na[c]),N.push(Sa[c])):139===c?(4===d?(E=lr(s,p,l),w=lr(e,p,l),v=1-lr(e,p,f),I=1-lr(e,h,f),_=lr(e,h,l),m=lr(s,h,l)):(E=1-lr(e,l,p),w=1-lr(s,l,p),v=lr(s,f,p),I=lr(s,f,h),_=1-lr(s,l,h),m=1-lr(e,l,h)),N.push(Ia[c]),N.push(Na[c]),N.push(Ma[c])):98===c?(0===d?(E=1-lr(e,l,p),w=1-lr(s,l,p),x=lr(s,f,p),v=lr(e,f,p),b=lr(e,f,h),_=1-lr(e,l,h)):(E=lr(s,p,l),w=lr(e,p,l),x=1-lr(e,p,f),v=1-lr(s,p,f),b=1-lr(s,h,f),_=lr(s,h,l)),N.push(Ia[c]),N.push(Na[c]),N.push(La[c])):99===c?(4===d?(E=1-lr(e,l,p),w=1-lr(s,l,p),x=lr(s,f,p),v=lr(e,f,p),b=lr(e,f,h),_=1-lr(e,l,h)):(E=lr(s,p,l),w=lr(e,p,l),x=1-lr(e,p,f),v=1-lr(s,p,f),b=1-lr(s,h,f),_=lr(s,h,l)),N.push(Ia[c]),N.push(Na[c]),N.push(Sa[c])):38===c?(0===d?(w=1-lr(e,l,p),x=lr(e,f,p),I=lr(e,f,h),b=lr(s,f,h),_=1-lr(s,l,h),m=1-lr(e,l,h)):(w=lr(s,p,l),x=1-lr(s,p,f),I=1-lr(s,h,f),b=1-lr(e,h,f),_=lr(e,h,l),m=lr(s,h,l)),N.push(Na[c]),N.push(Ma[c]),N.push(La[c])):39===c?(4===d?(w=1-lr(e,l,p),x=lr(e,f,p),I=lr(e,f,h),b=lr(s,f,h),_=1-lr(s,l,h),m=1-lr(e,l,h)):(w=lr(s,p,l),x=1-lr(s,p,f),I=1-lr(s,h,f),b=1-lr(e,h,f),_=lr(e,h,l),m=lr(s,h,l)),N.push(Na[c]),N.push(Ca[c]),N.push(La[c])):85===c&&(E=1,w=0,x=1,v=0,I=0,b=1,_=0,m=1),(_<0||_>1||m<0||m>1||E<0||E>1||x<0||x>1||I<0||I>1||b<0||b>1)&&console.log("MarchingSquaresJS-isoBands: "+c+" "+g+" "+h+","+l+","+p+","+f+" "+d+" "+_+" "+m+" "+E+" "+w+" "+x+" "+v+" "+I+" "+b),o.cells[a][u]={cval:c,cval_real:g,flipped:d,topleft:_,topright:m,righttop:E,rightbottom:w,bottomright:x,bottomleft:v,leftbottom:I,lefttop:b,edges:N}}}}}return o}(t,e,n);return zs.polygons?(zs.verbose&&console.log("MarchingSquaresJS-isoBands: returning single polygons for each grid cell"),u=function(t){var e=[],n=0;return t.cells.forEach((function(t,r){t.forEach((function(t,i){if(void 0!==t){var o=Ra[t.cval](t);"object"==typeof o&&pr(o)?"object"==typeof o[0]&&pr(o[0])?"object"==typeof o[0][0]&&pr(o[0][0])?o.forEach((function(t){t.forEach((function(t){t[0]+=i,t[1]+=r})),e[n++]=t})):(o.forEach((function(t){t[0]+=i,t[1]+=r})),e[n++]=o):console.log("MarchingSquaresJS-isoBands: bandcell polygon with malformed coordinates"):console.log("MarchingSquaresJS-isoBands: bandcell polygon with null coordinates")}}))})),e}(c)):(zs.verbose&&console.log("MarchingSquaresJS-isoBands: returning polygon paths for entire data grid"),u=function(t){for(var e=[],n=t.rows,r=t.cols,i=[],o=0;o<n;o++)for(var s=0;s<r;s++)if(void 0!==t.cells[o][s]&&t.cells[o][s].edges.length>0){var a=function(t){if(t.edges.length>0){var e=t.edges[t.edges.length-1],n=t.cval_real;switch(e){case 0:return n&Xs?{p:[1,t.righttop],x:-1,y:0,o:1}:{p:[t.topleft,1],x:0,y:-1,o:0};case 1:return n&Us?{p:[t.topleft,1],x:0,y:-1,o:0}:{p:[1,t.rightbottom],x:-1,y:0,o:0};case 2:return n&Us?{p:[t.bottomright,0],x:0,y:1,o:1}:{p:[t.topleft,1],x:0,y:-1,o:0};case 3:return n&Ys?{p:[t.topleft,1],x:0,y:-1,o:0}:{p:[t.bottomleft,0],x:0,y:1,o:0};case 4:return n&Xs?{p:[1,t.righttop],x:-1,y:0,o:1}:{p:[t.topright,1],x:0,y:-1,o:1};case 5:return n&Us?{p:[t.topright,1],x:0,y:-1,o:1}:{p:[1,t.rightbottom],x:-1,y:0,o:0};case 6:return n&Us?{p:[t.bottomright,0],x:0,y:1,o:1}:{p:[t.topright,1],x:0,y:-1,o:1};case 7:return n&Ys?{p:[t.topright,1],x:0,y:-1,o:1}:{p:[t.bottomleft,0],x:0,y:1,o:0};case 8:return n&Us?{p:[t.bottomright,0],x:0,y:1,o:1}:{p:[1,t.righttop],x:-1,y:0,o:1};case 9:return n&Ys?{p:[1,t.righttop],x:-1,y:0,o:1}:{p:[t.bottomleft,0],x:0,y:1,o:0};case 10:return n&Ys?{p:[0,t.leftbottom],x:1,y:0,o:0}:{p:[1,t.righttop],x:-1,y:0,o:1};case 11:return n&js?{p:[1,t.righttop],x:-1,y:0,o:1}:{p:[0,t.lefttop],x:1,y:0,o:1};case 12:return n&Us?{p:[t.bottomright,0],x:0,y:1,o:1}:{p:[1,t.rightbottom],x:-1,y:0,o:0};case 13:return n&Ys?{p:[1,t.rightbottom],x:-1,y:0,o:0}:{p:[t.bottomleft,0],x:0,y:1,o:0};case 14:return n&Ys?{p:[0,t.leftbottom],x:1,y:0,o:0}:{p:[1,t.rightbottom],x:-1,y:0,o:0};case 15:return n&js?{p:[1,t.rightbottom],x:-1,y:0,o:0}:{p:[0,t.lefttop],x:1,y:0,o:1};case 16:return n&Us?{p:[t.bottomright,0],x:0,y:1,o:1}:{p:[0,t.leftbottom],x:1,y:0,o:0};case 17:return n&js?{p:[t.bottomright,0],x:0,y:1,o:1}:{p:[0,t.lefttop],x:1,y:0,o:1};case 18:return n&Ys?{p:[0,t.leftbottom],x:1,y:0,o:0}:{p:[t.bottomleft,0],x:0,y:1,o:0};case 19:return n&js?{p:[t.bottomleft,0],x:0,y:1,o:0}:{p:[0,t.lefttop],x:1,y:0,o:1};case 20:return n&js?{p:[t.topleft,1],x:0,y:-1,o:0}:{p:[0,t.leftbottom],x:1,y:0,o:0};case 21:return n&Xs?{p:[0,t.leftbottom],x:1,y:0,o:0}:{p:[t.topright,1],x:0,y:-1,o:1};case 22:return n&js?{p:[t.topleft,1],x:0,y:-1,o:0}:{p:[0,t.lefttop],x:1,y:0,o:1};case 23:return n&Xs?{p:[0,t.lefttop],x:1,y:0,o:1}:{p:[t.topright,1],x:0,y:-1,o:1};default:console.log("MarchingSquaresJS-isoBands: edge index out of range!"),console.log(t)}}return null}(t.cells[o][s]),u=null,c=s,h=o;null!==a&&i.push([a.p[0]+c,a.p[1]+h]);do{if(null===(u=function(t,e,n,r){var i,o,s,a,u,c=t.cval;switch(e){case-1:0===r?(i=Na[c],s=ea[c],a=na[c],u=ra[c]):(i=Ia[c],s=Qs[c],a=$s[c],u=ta[c]);break;case 1:0===r?(i=Ma[c],s=fa[c],a=ga[c],u=da[c]):(i=La[c],s=ha[c],a=la[c],u=pa[c]);break;default:switch(n){case-1:0===r?(i=Pa[c],s=Vs[c],a=Hs[c],u=Ws[c]):(i=Oa[c],s=Js[c],a=Zs[c],u=Ks[c]);break;case 1:0===r?(i=Sa[c],s=ia[c],a=oa[c],u=sa[c]):(i=Ca[c],s=aa[c],a=ua[c],u=ca[c])}}if(o=t.edges.indexOf(i),void 0===t.edges[o])return null;switch(function(t,e){delete t.edges[e];for(var n=e+1;n<t.edges.length;n++)t.edges[n-1]=t.edges[n];t.edges.pop()}(t,o),c=t.cval_real,i){case 0:c&Xs?(e=t.topleft,n=1):(e=1,n=t.righttop);break;case 1:c&Us?(e=1,n=t.rightbottom):(e=t.topleft,n=1);break;case 2:c&Us?(e=t.topleft,n=1):(e=t.bottomright,n=0);break;case 3:c&Ys?(e=t.bottomleft,n=0):(e=t.topleft,n=1);break;case 4:c&Xs?(e=t.topright,n=1):(e=1,n=t.righttop);break;case 5:c&Us?(e=1,n=t.rightbottom):(e=t.topright,n=1);break;case 6:c&Us?(e=t.topright,n=1):(e=t.bottomright,n=0);break;case 7:c&Ys?(e=t.bottomleft,n=0):(e=t.topright,n=1);break;case 8:c&Us?(e=1,n=t.righttop):(e=t.bottomright,n=0);break;case 9:c&Ys?(e=t.bottomleft,n=0):(e=1,n=t.righttop);break;case 10:c&Ys?(e=1,n=t.righttop):(e=0,n=t.leftbottom);break;case 11:c&js?(e=0,n=t.lefttop):(e=1,n=t.righttop);break;case 12:c&Us?(e=1,n=t.rightbottom):(e=t.bottomright,n=0);break;case 13:c&Ys?(e=t.bottomleft,n=0):(e=1,n=t.rightbottom);break;case 14:c&Ys?(e=1,n=t.rightbottom):(e=0,n=t.leftbottom);break;case 15:c&js?(e=0,n=t.lefttop):(e=1,n=t.rightbottom);break;case 16:c&Us?(e=0,n=t.leftbottom):(e=t.bottomright,n=0);break;case 17:c&js?(e=0,n=t.lefttop):(e=t.bottomright,n=0);break;case 18:c&Ys?(e=t.bottomleft,n=0):(e=0,n=t.leftbottom);break;case 19:c&js?(e=0,n=t.lefttop):(e=t.bottomleft,n=0);break;case 20:c&js?(e=0,n=t.leftbottom):(e=t.topleft,n=1);break;case 21:c&Xs?(e=t.topright,n=1):(e=0,n=t.leftbottom);break;case 22:c&js?(e=0,n=t.lefttop):(e=t.topleft,n=1);break;case 23:c&Xs?(e=t.topright,n=1):(e=0,n=t.lefttop);break;default:return console.log("MarchingSquaresJS-isoBands: edge index out of range!"),console.log(t),null}return void 0!==e&&void 0!==n&&void 0!==s&&void 0!==a&&void 0!==u||(console.log("MarchingSquaresJS-isoBands: undefined value!"),console.log(t),console.log(e+" "+n+" "+s+" "+a+" "+u)),{p:[e,n],x:s,y:a,o:u}}(t.cells[h][c],a.x,a.y,a.o)))break;if(i.push([u.p[0]+c,u.p[1]+h]),c+=u.x,a=u,(h+=u.y)<0||h>=n||c<0||c>=r||void 0===t.cells[h][c]){var l=function(t,e,n,r,i,o){for(var s=t.cells[n][e],a=s.cval_real,u=e+r,c=n+i,h=[],l=!1;!l;){if(void 0===t.cells[c]||void 0===t.cells[c][u])if(c-=i,u-=r,a=(s=t.cells[c][u]).cval_real,-1===i)if(0===o)if(a&Ys)h.push([u,c]),r=-1,i=0,o=0;else{if(!(a&Us)){h.push([u+s.bottomright,c]),r=0,i=1,o=1,l=!0;break}h.push([u+1,c]),r=1,i=0,o=0}else{if(!(a&Ys)){if(a&Us){h.push([u+s.bottomright,c]),r=0,i=1,o=1,l=!0;break}h.push([u+s.bottomleft,c]),r=0,i=1,o=0,l=!0;break}h.push([u,c]),r=-1,i=0,o=0}else if(1===i)if(0===o){if(!(a&Xs)){if(a&js){h.push([u+s.topleft,c+1]),r=0,i=-1,o=0,l=!0;break}h.push([u+s.topright,c+1]),r=0,i=-1,o=1,l=!0;break}h.push([u+1,c+1]),r=1,i=0,o=1}else h.push([u+1,c+1]),r=1,i=0,o=1;else if(-1===r)if(0===o){if(!(a&js)){if(a&Ys){h.push([u,c+s.leftbottom]),r=1,i=0,o=0,l=!0;break}h.push([u,c+s.lefttop]),r=1,i=0,o=1,l=!0;break}h.push([u,c+1]),r=0,i=1,o=0}else{if(!(a&js)){console.log("MarchingSquaresJS-isoBands: wtf");break}h.push([u,c+1]),r=0,i=1,o=0}else{if(1!==r){console.log("MarchingSquaresJS-isoBands: we came from nowhere!");break}if(0===o){if(!(a&Us)){h.push([u+1,c+s.rightbottom]),r=-1,i=0,o=0,l=!0;break}h.push([u+1,c]),r=0,i=-1,o=1}else{if(!(a&Us)){if(a&Xs){h.push([u+1,c+s.righttop]),r=-1,i=0,o=1;break}h.push([u+1,c+s.rightbottom]),r=-1,i=0,o=0,l=!0;break}h.push([u+1,c]),r=0,i=-1,o=1}}else if(a=(s=t.cells[c][u]).cval_real,-1===r)if(0===o)if(void 0!==t.cells[c-1]&&void 0!==t.cells[c-1][u])r=0,i=-1,o=1;else{if(!(a&Ys)){h.push([u+s.bottomright,c]),r=0,i=1,o=1,l=!0;break}h.push([u,c])}else{if(!(a&js)){console.log("MarchingSquaresJS-isoBands: found entry from top at "+u+","+c);break}console.log("MarchingSquaresJS-isoBands: proceeding in x-direction!")}else if(1===r){if(0===o){console.log("MarchingSquaresJS-isoBands: wtf");break}if(void 0!==t.cells[c+1]&&void 0!==t.cells[c+1][u])r=0,i=1,o=0;else{if(!(a&Xs)){h.push([u+s.topleft,c+1]),r=0,i=-1,o=0,l=!0;break}h.push([u+1,c+1]),r=1,i=0,o=1}}else if(-1===i){if(1!==o){console.log("MarchingSquaresJS-isoBands: wtf");break}if(void 0!==t.cells[c][u+1])r=1,i=0,o=1;else{if(!(a&Us)){h.push([u+1,c+s.righttop]),r=-1,i=0,o=1,l=!0;break}h.push([u+1,c]),r=0,i=-1,o=1}}else{if(1!==i){console.log("MarchingSquaresJS-isoBands: where did we came from???");break}if(0!==o){console.log("MarchingSquaresJS-isoBands: wtf");break}if(void 0!==t.cells[c][u-1])r=-1,i=0,o=0;else{if(!(a&js)){h.push([u,c+s.leftbottom]),r=1,i=0,o=0,l=!0;break}h.push([u,c+1]),r=0,i=1,o=0}}if(c+=i,(u+=r)===e&&c===n)break}return{path:h,i:u,j:c,x:r,y:i,o}}(t,c-=u.x,h-=u.y,u.x,u.y,u.o);if(null===l)break;l.path.forEach((function(t){i.push(t)})),c=l.i,h=l.j,a=l}}while(void 0!==t.cells[h][c]&&t.cells[h][c].edges.length>0);e.push(i),i=[],t.cells[o][s].edges.length>0&&s--}return e}(c)),"function"==typeof zs.successCallback&&zs.successCallback(u),u}function lr(t,e,n){return(t-e)/(n-e)}function pr(t){return t.constructor.toString().indexOf("Array")>-1}function fr(t,e,n){if(!I(n=n||{}))throw new Error("options is invalid");var r=n.pivot,i=n.mutate;if(!t)throw new Error("geojson is required");if(void 0===e||null===e||isNaN(e))throw new Error("angle is required");return 0===e||(r||(r=ye(t)),!1!==i&&void 0!==i||(t=Gt(t)),S(t,(function(t){var n=sn(r,t)+e,i=un(r,t),o=U(nr(r,i,n));t[0]=o[0],t[1]=o[1]}))),t}function gr(t,e,n){if(!I(n=n||{}))throw new Error("options is invalid");var r=n.origin,i=n.mutate;if(!t)throw new Error("geojson required");if("number"!=typeof e||0===e)throw new Error("invalid factor");var o=Array.isArray(r)||"object"==typeof r;return!0!==i&&(t=Gt(t)),"FeatureCollection"!==t.type||o?dr(t,e,r):(O(t,(function(n,i){t.features[i]=dr(n,e,r)})),t)}function dr(t,e,n){var i="Point"===K(t);return n=function(t,e){if(void 0!==e&&null!==e||(e="centroid"),Array.isArray(e)||"object"==typeof e)return X(e);var n=t.bbox?t.bbox:j(t),i=n[0],o=n[1],s=n[2],a=n[3];switch(e){case"sw":case"southwest":case"westsouth":case"bottomleft":return r([i,o]);case"se":case"southeast":case"eastsouth":case"bottomright":return r([s,o]);case"nw":case"northwest":case"westnorth":case"topleft":return r([i,a]);case"ne":case"northeast":case"eastnorth":case"topright":return r([s,a]);case"center":return de(t);case void 0:case null:case"centroid":return ye(t);default:throw new Error("invalid origin")}}(t,n),1===e||i||S(t,(function(t){var r=un(n,t),i=sn(n,t),o=U(nr(n,r*e,i));t[0]=o[0],t[1]=o[1],3===t.length&&(t[2]*=e)})),t}function yr(t){var e=t[0],n=t[1];return[n[0]-e[0],n[1]-e[1]]}function _r(t,e){return t[0]*e[1]-e[0]*t[1]}function mr(t,e){return!function(t,e){return 0===_r(yr(t),yr(e))}(t,e)&&function(t,e){var n=t[0],r=yr(t),i=e[0],o=yr(e),s=_r(r,o);return function(t,e){return[t[0]+e[0],t[1]+e[1]]}(n,function(t,e){return[t*e[0],t*e[1]]}(_r(function(t,e){return[t[0]-e[0],t[1]-e[1]]}(i,n),o)/s,r))}(t,e)}function vr(t,e,n){var r=[],i=_(e,n),o=U(t),s=[];return o.forEach((function(t,e){if(e!==o.length-1){var n=function(t,e,n){var r=Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1])),i=t[0]+n*(e[1]-t[1])/r,o=e[0]+n*(e[1]-t[1])/r;return[[i,t[1]+n*(t[0]-e[0])/r],[o,e[1]+n*(t[0]-e[0])/r]]}(t,o[e+1],i);if(r.push(n),e>0){var a=r[e-1],u=mr(n,a);!1!==u&&(a[1]=u,n[0]=u),s.push(a[0]),e===o.length-2&&(s.push(n[0]),s.push(n[1]))}2===o.length&&(s.push(n[0]),s.push(n[1]))}})),a(s,t.properties)}function xr(t,e,n){var r=e[0]-t[0],i=e[1]-t[1],o=n[0]-e[0],s=n[1]-e[1];return Math.sign(r*s-o*i)}function Er(t,e){return e.geometry.coordinates[0].every((function(e){return Pt(r(e),t)}))}function wr(t,e){for(var n=0;n<t.coordinates.length-1;n++)if(function(t,e,n){var r=n[0]-t[0],i=n[1]-t[1],o=e[0]-t[0],s=e[1]-t[1];return r*s-i*o==0&&(Math.abs(o)>=Math.abs(s)?o>0?t[0]<=n[0]&&n[0]<=e[0]:e[0]<=n[0]&&n[0]<=t[0]:s>0?t[1]<=n[1]&&n[1]<=e[1]:e[1]<=n[1]&&n[1]<=t[1])}(t.coordinates[n],t.coordinates[n+1],e.coordinates))return!0;return!1}function br(t,e){return nn(e,kn(t)).features.length>0}function Ir(t,e){return!(t[0]>e[0])&&!(t[2]<e[2])&&!(t[1]>e[1])&&!(t[3]<e[3])}function Nr(t,e){return t[0]===e[0]&&t[1]===e[1]}function Cr(t,e){for(var n=!1,r=!1,i=t.coordinates.length,o=0;o<i&&!n&&!r;){for(var s=0;s<e.coordinates.length-1;s++){var a=!0;0!==s&&s!==e.coordinates.length-2||(a=!1),Lr(e.coordinates[s],e.coordinates[s+1],t.coordinates[o],a)?n=!0:r=!0}o++}return n&&r}function Sr(t,e){return nn(t,kn(e)).features.length>0}function Mr(t,e){for(var n=!1,i=!1,o=t.coordinates[0].length,s=0;s<o&&n&&i;)Pt(r(t.coordinates[0][s]),e)?n=!0:i=!0,s++;return i&&i}function Lr(t,e,n,r){var i=n[0]-t[0],o=n[1]-t[1],s=e[0]-t[0],a=e[1]-t[1];return 0==i*a-o*s&&(r?Math.abs(s)>=Math.abs(a)?s>0?t[0]<=n[0]&&n[0]<=e[0]:e[0]<=n[0]&&n[0]<=t[0]:a>0?t[1]<=n[1]&&n[1]<=e[1]:e[1]<=n[1]&&n[1]<=t[1]:Math.abs(s)>=Math.abs(a)?s>0?t[0]<n[0]&&n[0]<e[0]:e[0]<n[0]&&n[0]<t[0]:a>0?t[1]<n[1]&&n[1]<e[1]:e[1]<n[1]&&n[1]<t[1])}function Pr(t){return t.coordinates.map((function(e){return{type:t.type.replace("Multi",""),coordinates:e}}))}function Or(t,e){return t.hasOwnProperty("coordinates")?t.coordinates.length===e.coordinates.length:t.length===e.length}function Rr(t,e){return ka(t,e,{strict:!0})}function Tr(t,e){if(!t)throw new Error("feature1 is required");if(!e)throw new Error("feature2 is required");var n=K(t);if(n!==K(e))throw new Error("features must be of the same type");if("Point"===n)throw new Error("Point geometry not supported");if(new ja({precision:6}).compare(t,e))return!1;var r=0;switch(n){case"MultiPoint":var i=T(t),o=T(e);i.forEach((function(t){o.forEach((function(e){t[0]===e[0]&&t[1]===e[1]&&r++}))}));break;case"LineString":case"MultiLineString":G(t,(function(t){G(e,(function(e){$n(t,e).features.length&&r++}))}));break;case"Polygon":case"MultiPolygon":G(t,(function(t){G(e,(function(e){nn(t,e).features.length&&r++}))}))}return r>0}function Ar(t,e,n){n=n||[];for(var r=0;r<t;r++)n[r]=e;return n}function Dr(t,e){if(t.geometry&&t.geometry.type)return t.geometry.type;if(t.type)return t.type;throw new Error("Invalid GeoJSON object for "+e)}function Fr(t){for(var e=t,n=[];e.parent;)n.unshift(e),e=e.parent;return n}function qr(t,e){e=e||{},this.nodes=[],this.diagonal=!!e.diagonal,this.grid=[];for(var n=0;n<t.length;n++){this.grid[n]=[];for(var r=0,i=t[n];r<i.length;r++){var o=new Gr(n,r,i[r]);this.grid[n][r]=o,this.nodes.push(o)}}this.init()}function Gr(t,e,n){this.x=t,this.y=e,this.weight=n}function Br(t){this.content=[],this.scoreFunction=t}function kr(t){return t[0]}function zr(t){return t[1]}function jr(){this._=null}function Xr(t){t.U=t.C=t.L=t.R=t.P=t.N=null}function Ur(t,e){var n=e,r=e.R,i=n.U;i?i.L===n?i.L=r:i.R=r:t._=r,r.U=i,n.U=r,n.R=r.L,n.R&&(n.R.U=n),r.L=n}function Yr(t,e){var n=e,r=e.L,i=n.U;i?i.L===n?i.L=r:i.R=r:t._=r,r.U=i,n.U=r,n.L=r.R,n.L&&(n.L.U=n),r.R=n}function Vr(t){for(;t.L;)t=t.L;return t}function Hr(t,e,n,r){var i=[null,null],o=uu.push(i)-1;return i.left=t,i.right=e,n&&Jr(i,t,e,n),r&&Jr(i,e,t,r),su[t.index].halfedges.push(o),su[e.index].halfedges.push(o),i}function Wr(t,e,n){var r=[e,n];return r.left=t,r}function Jr(t,e,n,r){t[0]||t[1]?t.left===n?t[1]=r:t[0]=r:(t[0]=r,t.left=e,t.right=n)}function Zr(t,e,n,r,i){var o,s=t[0],a=t[1],u=s[0],c=s[1],h=0,l=1,p=a[0]-u,f=a[1]-c;if(o=e-u,p||!(o>0)){if(o/=p,p<0){if(o<h)return;o<l&&(l=o)}else if(p>0){if(o>l)return;o>h&&(h=o)}if(o=r-u,p||!(o<0)){if(o/=p,p<0){if(o>l)return;o>h&&(h=o)}else if(p>0){if(o<h)return;o<l&&(l=o)}if(o=n-c,f||!(o>0)){if(o/=f,f<0){if(o<h)return;o<l&&(l=o)}else if(f>0){if(o>l)return;o>h&&(h=o)}if(o=i-c,f||!(o<0)){if(o/=f,f<0){if(o>l)return;o>h&&(h=o)}else if(f>0){if(o<h)return;o<l&&(l=o)}return!(h>0||l<1)||(h>0&&(t[0]=[u+h*p,c+h*f]),l<1&&(t[1]=[u+l*p,c+l*f]),!0)}}}}}function Kr(t,e,n,r,i){var o=t[1];if(o)return!0;var s,a,u=t[0],c=t.left,h=t.right,l=c[0],p=c[1],f=h[0],g=h[1],d=(l+f)/2,y=(p+g)/2;if(g===p){if(d<e||d>=r)return;if(l>f){if(u){if(u[1]>=i)return}else u=[d,n];o=[d,i]}else{if(u){if(u[1]<n)return}else u=[d,i];o=[d,n]}}else if(a=y-(s=(l-f)/(g-p))*d,s<-1||s>1)if(l>f){if(u){if(u[1]>=i)return}else u=[(n-a)/s,n];o=[(i-a)/s,i]}else{if(u){if(u[1]<n)return}else u=[(i-a)/s,i];o=[(n-a)/s,n]}else if(p<g){if(u){if(u[0]>=r)return}else u=[e,s*e+a];o=[r,s*r+a]}else{if(u){if(u[0]<e)return}else u=[r,s*r+a];o=[e,s*e+a]}return t[0]=u,t[1]=o,!0}function Qr(t,e){var n=t.site,r=e.left,i=e.right;return n===i&&(i=r,r=n),i?Math.atan2(i[1]-r[1],i[0]-r[0]):(n===r?(r=e[1],i=e[0]):(r=e[0],i=e[1]),Math.atan2(r[0]-i[0],i[1]-r[1]))}function $r(t,e){return e[+(e.left!==t.site)]}function ti(t,e){return e[+(e.left===t.site)]}function ei(t){var e=t.P,n=t.N;if(e&&n){var r=e.site,i=t.site,o=n.site;if(r!==o){var s=i[0],a=i[1],u=r[0]-s,c=r[1]-a,h=o[0]-s,l=o[1]-a,p=2*(u*l-c*h);if(!(p>=-pu)){var f=u*u+c*c,g=h*h+l*l,d=(l*f-c*g)/p,y=(u*g-h*f)/p,_=cu.pop()||new function(){Xr(this),this.x=this.y=this.arc=this.site=this.cy=null};_.arc=t,_.site=i,_.x=d+s,_.y=(_.cy=y+a)+Math.sqrt(d*d+y*y),t.circle=_;for(var m=null,v=au._;v;)if(_.y<v.y||_.y===v.y&&_.x<=v.x){if(!v.L){m=v.P;break}v=v.L}else{if(!v.R){m=v;break}v=v.R}au.insert(m,_),m||(iu=_)}}}}function ni(t){var e=t.circle;e&&(e.P||(iu=e.N),au.remove(e),cu.push(e),Xr(e),t.circle=null)}function ri(t){var e=hu.pop()||new function(){Xr(this),this.edge=this.site=this.circle=null};return e.site=t,e}function ii(t){ni(t),ou.remove(t),hu.push(t),Xr(t)}function oi(t){var e=t.circle,n=e.x,r=e.cy,i=[n,r],o=t.P,s=t.N,a=[t];ii(t);for(var u=o;u.circle&&Math.abs(n-u.circle.x)<lu&&Math.abs(r-u.circle.cy)<lu;)o=u.P,a.unshift(u),ii(u),u=o;a.unshift(u),ni(u);for(var c=s;c.circle&&Math.abs(n-c.circle.x)<lu&&Math.abs(r-c.circle.cy)<lu;)s=c.N,a.push(c),ii(c),c=s;a.push(c),ni(c);var h,l=a.length;for(h=1;h<l;++h)c=a[h],u=a[h-1],Jr(c.edge,u.site,c.site,i);u=a[0],(c=a[l-1]).edge=Hr(u.site,c.site,null,i),ei(u),ei(c)}function si(t){for(var e,n,r,i,o=t[0],s=t[1],a=ou._;a;)if((r=ai(a,s)-o)>lu)a=a.L;else{if(!((i=o-function(t,e){var n=t.N;if(n)return ai(n,e);var r=t.site;return r[1]===e?r[0]:1/0}(a,s))>lu)){r>-lu?(e=a.P,n=a):i>-lu?(e=a,n=a.N):e=n=a;break}if(!a.R){e=a;break}a=a.R}!function(t){su[t.index]={site:t,halfedges:[]}}(t);var u=ri(t);if(ou.insert(e,u),e||n){if(e===n)return ni(e),n=ri(e.site),ou.insert(u,n),u.edge=n.edge=Hr(e.site,u.site),ei(e),void ei(n);if(n){ni(e),ni(n);var c=e.site,h=c[0],l=c[1],p=t[0]-h,f=t[1]-l,g=n.site,d=g[0]-h,y=g[1]-l,_=2*(p*y-f*d),m=p*p+f*f,v=d*d+y*y,x=[(y*m-f*v)/_+h,(p*v-d*m)/_+l];Jr(n.edge,c,g,x),u.edge=Hr(c,t,null,x),n.edge=Hr(t,g,null,x),ei(e),ei(n)}else u.edge=Hr(e.site,u.site)}}function ai(t,e){var n=t.site,r=n[0],i=n[1],o=i-e;if(!o)return r;var s=t.P;if(!s)return-1/0;var a=(n=s.site)[0],u=n[1],c=u-e;if(!c)return a;var h=a-r,l=1/o-1/c,p=h/c;return l?(-p+Math.sqrt(p*p-2*l*(h*h/(-2*c)-u+c/2+i-o/2)))/l+r:(r+a)/2}function ui(t,e,n){return(t[0]-n[0])*(e[1]-t[1])-(t[0]-e[0])*(n[1]-t[1])}function ci(t,e){return e[1]-t[1]||e[0]-t[0]}function hi(t,e){var n,r,i,o=t.sort(ci).pop();for(uu=[],su=new Array(t.length),ou=new jr,au=new jr;;)if(i=iu,o&&(!i||o[1]<i.y||o[1]===i.y&&o[0]<i.x))o[0]===n&&o[1]===r||(si(o),n=o[0],r=o[1]),o=t.pop();else{if(!i)break;oi(i.arc)}if(function(){for(var t,e,n,r,i=0,o=su.length;i<o;++i)if((t=su[i])&&(r=(e=t.halfedges).length)){var s=new Array(r),a=new Array(r);for(n=0;n<r;++n)s[n]=n,a[n]=Qr(t,uu[e[n]]);for(s.sort((function(t,e){return a[e]-a[t]})),n=0;n<r;++n)a[n]=e[s[n]];for(n=0;n<r;++n)e[n]=a[n]}}(),e){var s=+e[0][0],a=+e[0][1],u=+e[1][0],c=+e[1][1];!function(t,e,n,r){for(var i,o=uu.length;o--;)Kr(i=uu[o],t,e,n,r)&&Zr(i,t,e,n,r)&&(Math.abs(i[0][0]-i[1][0])>lu||Math.abs(i[0][1]-i[1][1])>lu)||delete uu[o]}(s,a,u,c),function(t,e,n,r){var i,o,s,a,u,c,h,l,p,f,g,d,y=su.length,_=!0;for(i=0;i<y;++i)if(o=su[i]){for(s=o.site,a=(u=o.halfedges).length;a--;)uu[u[a]]||u.splice(a,1);for(a=0,c=u.length;a<c;)g=(f=ti(o,uu[u[a]]))[0],d=f[1],l=(h=$r(o,uu[u[++a%c]]))[0],p=h[1],(Math.abs(g-l)>lu||Math.abs(d-p)>lu)&&(u.splice(a,0,uu.push(Wr(s,f,Math.abs(g-t)<lu&&r-d>lu?[t,Math.abs(l-t)<lu?p:r]:Math.abs(d-r)<lu&&n-g>lu?[Math.abs(p-r)<lu?l:n,r]:Math.abs(g-n)<lu&&d-e>lu?[n,Math.abs(l-n)<lu?p:e]:Math.abs(d-e)<lu&&g-t>lu?[Math.abs(p-e)<lu?l:t,e]:null))-1),++c);c&&(_=!1)}if(_){var m,v,x,E=1/0;for(i=0,_=null;i<y;++i)(o=su[i])&&(x=(m=(s=o.site)[0]-t)*m+(v=s[1]-e)*v)<E&&(E=x,_=o);if(_){var w=[t,e],b=[t,r],I=[n,r],N=[n,e];_.halfedges.push(uu.push(Wr(s=_.site,w,b))-1,uu.push(Wr(s,b,I))-1,uu.push(Wr(s,I,N))-1,uu.push(Wr(s,N,w))-1)}}for(i=0;i<y;++i)(o=su[i])&&(o.halfedges.length||delete su[i])}(s,a,u,c)}this.edges=uu,this.cells=su,ou=au=uu=su=null}function li(t){return(t=t.slice()).push(t[0]),o([t])}function pi(t,e,n,r){var i=(r=r||{}).steps||64,s=r.units||"kilometers",a=r.angle||0,u=r.pivot||t,c=r.properties||t.properties||{};if(!t)throw new Error("center is required");if(!e)throw new Error("xSemiAxis is required");if(!n)throw new Error("ySemiAxis is required");if(!I(r))throw new Error("options must be an object");if(!b(i))throw new Error("steps must be a number");if(!b(a))throw new Error("angle must be a number");var h=X(t);if("degrees"===s)var l=x(a);else e=nr(t,e,90,{units:s}),n=nr(t,n,0,{units:s}),e=X(e)[0]-h[0],n=X(n)[1]-h[1];for(var p=[],f=0;f<i;f+=1){var g=-360*f/i,d=e*n/Math.sqrt(Math.pow(n,2)+Math.pow(e,2)*Math.pow(fi(g),2)),y=e*n/Math.sqrt(Math.pow(e,2)+Math.pow(n,2)/Math.pow(fi(g),2));if(g<-90&&g>=-270&&(d=-d),g<-180&&g>=-360&&(y=-y),"degrees"===s){var _=d*Math.cos(l)+y*Math.sin(l),m=y*Math.cos(l)-d*Math.sin(l);d=_,y=m}p.push([d+h[0],y+h[1]])}return p.push(p[0]),"degrees"===s?o([p],c):fr(o([p],c),a,{pivot:u})}function fi(t){var e=t*Math.PI/180;return Math.tan(e)}function gi(t,e){if(!I(e=e||{}))throw new Error("options is invalid");var n=e.properties,i=e.weight;if(!t)throw new Error("geojson is required");var o=0,s=0,a=0;return A(t,(function(t,e,n){var r=n[i];if(!b(r=void 0===r||null===r?1:r))throw new Error("weight value must be a number for feature index "+e);(r=Number(r))>0&&S(t,(function(t){o+=t[0]*r,s+=t[1]*r,a+=r}))})),r([o/a,s/a],n)}function di(t,e,n,i){var o=n.properties.tolerance||.001,s=0,a=0,u=0,c=0;if(O(n,(function(e){var n=e.properties.weight,r=void 0===n||null===n?1:n;if(!b(r=Number(r)))throw new Error("weight value must be a number");if(r>0){c+=1;var i=r*qt(e,t);0===i&&(i=1);var o=r/i;s+=e.geometry.coordinates[0]*o,a+=e.geometry.coordinates[1]*o,u+=o}})),c<1)throw new Error("no features to measure");var h=s/u,l=a/u;return 1===c||0===i||Math.abs(h-e[0])<o&&Math.abs(l-e[1])<o?r([h,l],{medianCandidates:n.properties.medianCandidates}):(n.properties.medianCandidates.push([h,l]),di([h,l],t,n,i-1))}function yi(t,e){return{x:t[0]-e[0],y:t[1]-e[1]}}function _i(t){if(I(t)&&(t=t.bbox),t&&!Array.isArray(t))throw new Error("bbox is invalid");return t?function(t){return[Math.random()*(t[2]-t[0])+t[0],Math.random()*(t[3]-t[1])+t[1]]}(t):[360*Ei(),180*Ei()]}function mi(t,e){if(!I(e=e||{}))throw new Error("options is invalid");var n=e.bbox;void 0!==t&&null!==t||(t=1);for(var i=[],o=0;o<t;o++)i.push(r(_i(n)));return c(i)}function vi(t,e){if(!I(e=e||{}))throw new Error("options is invalid");var n=e.bbox,r=e.num_vertices,i=e.max_radial_length;void 0!==t&&null!==t||(t=1),b(r)||(r=10),b(i)||(i=10);for(var s=[],a=0;a<t;a++){var u=[],h=Array.apply(null,new Array(r+1)).map(Math.random);h.forEach((function(t,e,n){n[e]=e>0?t+n[e-1]:t})),h.forEach((function(t){t=2*t*Math.PI/h[h.length-1];var e=Math.random();u.push([e*i*Math.sin(t),e*i*Math.cos(t)])})),u[u.length-1]=u[0],u=u.map(function(t){return function(e){return[e[0]+t[0],e[1]+t[1]]}}(_i(n))),s.push(o([u]))}return c(s)}function xi(t,e){if(!I(e=e||{}))throw new Error("options is invalid");var n=e.bbox,r=e.num_vertices,i=e.max_length,o=e.max_rotation;void 0!==t&&null!==t||(t=1),(!b(r)||r<2)&&(r=10),b(i)||(i=1e-4),b(o)||(o=Math.PI/8);for(var s=[],u=0;u<t;u++){for(var h=[_i(n)],l=0;l<r-1;l++){var p=(0===l?2*Math.random()*Math.PI:Math.tan((h[l][1]-h[l-1][1])/(h[l][0]-h[l-1][0])))+(Math.random()-.5)*o*2,f=Math.random()*i;h.push([h[l][0]+f*Math.cos(p),h[l][1]+f*Math.sin(p)])}s.push(a(h))}return c(s)}function Ei(){return Math.random()-.5}function wi(t,e){if(!t)throw new Error("geojson is required");if("FeatureCollection"!==t.type)throw new Error("geojson must be a FeatureCollection");if(void 0===e||null===e)throw new Error("filter is required");var n=[];return O(t,(function(t){Ci(t.properties,e)&&n.push(t)})),c(n)}function bi(t,e,n){if(!t)throw new Error("geojson is required");if("FeatureCollection"!==t.type)throw new Error("geojson must be a FeatureCollection");if(void 0===e||null===e)throw new Error("property is required");for(var r=Ni(t,e),i=Object.keys(r),o=0;o<i.length;o++){for(var s=i[o],a=r[s],u=[],h=0;h<a.length;h++)u.push(t.features[a[h]]);n(c(u),s,o)}}function Ii(t,e,n,r){var i=r;return bi(t,e,(function(t,e,o){i=0===o&&void 0===r?t:n(i,t,e,o)})),i}function Ni(t,e){var n={};return O(t,(function(t,r){var i=t.properties||{};if(i.hasOwnProperty(e)){var o=i[e];n.hasOwnProperty(o)?n[o].push(r):n[o]=[r]}})),n}function Ci(t,e){if(void 0===t)return!1;var n=typeof e;if("number"===n||"string"===n)return t.hasOwnProperty(e);if(Array.isArray(e)){for(var r=0;r<e.length;r++)if(!Ci(t,e[r]))return!1;return!0}return Si(t,e)}function Si(t,e){for(var n=Object.keys(e),r=0;r<n.length;r++){var i=n[r];if(t[i]!==e[i])return!1}return!0}function Mi(t,e){if(!e)return{};if(!e.length)return{};for(var n={},r=0;r<e.length;r++){var i=e[r];t.hasOwnProperty(i)&&(n[i]=t[i])}return n}function Li(){}function Pi(t){this.message=t||""}function Oi(t){this.message=t||""}function Ri(){}function Ti(t){return null===t?Ac:t.color}function Ai(t){return null===t?null:t.parent}function Di(t,e){null!==t&&(t.color=e)}function Fi(t){return null===t?null:t.left}function qi(t){return null===t?null:t.right}function Gi(){this.root_=null,this.size_=0}function Bi(){}function ki(){this.array_=[],arguments[0]instanceof vc&&this.addAll(arguments[0])}function zi(){}function ji(t){this.message=t||""}function Xi(){this.array_=[]}function Ui(t){switch(t.type){case"Polygon":return mn(t)>1?t:null;case"MultiPolygon":var e=[];if(F(t,(function(t){mn(t)>1&&e.push(t.geometry.coordinates)})),e.length)return{type:"MultiPolygon",coordinates:e}}}function Yi(){this.reset()}function Vi(t,e,n){var r=t.s=e+n,i=r-e,o=r-i;t.t=e-o+(n-i)}function Hi(t){return t>1?kf:t<-1?-kf:Math.asin(t)}function Wi(){}function Ji(t,e){t&&eg.hasOwnProperty(t.type)&&eg[t.type](t,e)}function Zi(t,e,n){var r,i=-1,o=t.length-n;for(e.lineStart();++i<o;)r=t[i],e.point(r[0],r[1],r[2]);e.lineEnd()}function Ki(t,e){var n=-1,r=t.length;for(e.polygonStart();++n<r;)Zi(t[n],e,1);e.polygonEnd()}function Qi(t){return[Hf(t[1],t[0]),Hi(t[2])]}function $i(t){var e=t[0],n=t[1],r=Wf(n);return[r*Wf(e),r*Kf(e),Kf(n)]}function to(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function eo(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function no(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function ro(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function io(t){var e=Qf(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}function oo(t,e){return[t>Bf?t-jf:t<-Bf?t+jf:t,e]}function so(t,e,n){return(t%=jf)?e||n?rg(uo(t),co(e,n)):uo(t):e||n?co(e,n):oo}function ao(t){return function(e,n){return[(e+=t)>Bf?e-jf:e<-Bf?e+jf:e,n]}}function uo(t){var e=ao(t);return e.invert=ao(-t),e}function co(t,e){function n(t,e){var n=Wf(e),a=Wf(t)*n,u=Kf(t)*n,c=Kf(e),h=c*r+a*i;return[Hf(u*o-h*s,a*r-c*i),Hi(h*o+u*s)]}var r=Wf(t),i=Kf(t),o=Wf(e),s=Kf(e);return n.invert=function(t,e){var n=Wf(e),a=Wf(t)*n,u=Kf(t)*n,c=Kf(e),h=c*o-u*s;return[Hf(u*o+c*s,a*r+h*i),Hi(h*r-a*i)]},n}function ho(t,e){(e=$i(e))[0]-=t,io(e);var n=function(t){return t>1?0:t<-1?Bf:Math.acos(t)}(-e[1]);return((-e[2]<0?-n:n)+jf-Gf)%jf}function lo(t,e,n,r){this.x=t,this.z=e,this.o=n,this.e=r,this.v=!1,this.n=this.p=null}function po(t){if(e=t.length){for(var e,n,r=0,i=t[0];++r<e;)i.n=n=t[r],n.p=i,i=n;i.n=n=t[0],n.p=i}}function fo(t,e,n,r){function i(i,o){return t<=i&&i<=n&&e<=o&&o<=r}function o(i,o,a,c){var h=0,l=0;if(null==i||(h=s(i,a))!==(l=s(o,a))||u(i,o)<0^a>0)do{c.point(0===h||3===h?t:n,h>1?r:e)}while((h=(h+a+4)%4)!==l);else c.point(o[0],o[1])}function s(r,i){return Yf(r[0]-t)<Gf?i>0?0:3:Yf(r[0]-n)<Gf?i>0?2:1:Yf(r[1]-e)<Gf?i>0?1:0:i>0?3:2}function a(t,e){return u(t.x,e.x)}function u(t,e){var n=s(t,1),r=s(e,1);return n!==r?n-r:0===n?e[1]-t[1]:1===n?t[0]-e[0]:2===n?t[1]-e[1]:e[0]-t[0]}return function(s){function u(t,e){i(t,e)&&E.point(t,e)}function c(o,s){var a=i(o,s);if(l&&p.push([o,s]),v)f=o,g=s,d=a,v=!1,a&&(E.lineStart(),E.point(o,s));else if(a&&m)E.point(o,s);else{var u=[y=Math.max(pg,Math.min(lg,y)),_=Math.max(pg,Math.min(lg,_))],c=[o=Math.max(pg,Math.min(lg,o)),s=Math.max(pg,Math.min(lg,s))];sg(u,c,t,e,n,r)?(m||(E.lineStart(),E.point(u[0],u[1])),E.point(c[0],c[1]),a||E.lineEnd(),x=!1):a&&(E.lineStart(),E.point(o,s),x=!1)}y=o,_=s,m=a}var h,l,p,f,g,d,y,_,m,v,x,E=s,w=og(),b={point:u,lineStart:function(){b.point=c,l&&l.push(p=[]),v=!0,m=!1,y=_=NaN},lineEnd:function(){h&&(c(f,g),d&&m&&w.rejoin(),h.push(w.result())),b.point=u,m&&E.lineEnd()},polygonStart:function(){E=w,h=[],l=[],x=!0},polygonEnd:function(){var e=function(){for(var e=0,n=0,i=l.length;n<i;++n)for(var o,s,a=l[n],u=1,c=a.length,h=a[0],p=h[0],f=h[1];u<c;++u)o=p,s=f,p=(h=a[u])[0],f=h[1],s<=r?f>r&&(p-o)*(r-s)>(f-s)*(t-o)&&++e:f<=r&&(p-o)*(r-s)<(f-s)*(t-o)&&--e;return e}(),n=x&&e,i=(h=hg(h)).length;(n||i)&&(s.polygonStart(),n&&(s.lineStart(),o(null,null,1,s),s.lineEnd()),i&&ug(h,a,e,o,s),s.polygonEnd()),E=s,h=l=p=null}};return b}}function go(t){return t.length>1}function yo(t,e){return((t=t.x)[0]<0?t[1]-kf-Gf:kf-t[1])-((e=e.x)[0]<0?e[1]-kf-Gf:kf-e[1])}function _o(t){return function(e){var n=new mo;for(var r in t)n[r]=t[r];return n.stream=e,n}}function mo(){}function vo(t,e,n){var r=e[1][0]-e[0][0],i=e[1][1]-e[0][1],o=t.clipExtent&&t.clipExtent();t.scale(150).translate([0,0]),null!=o&&t.clipExtent(null),ng(n,t.stream(vg));var s=vg.result(),a=Math.min(r/(s[1][0]-s[0][0]),i/(s[1][1]-s[0][1])),u=+e[0][0]+(r-a*(s[1][0]+s[0][0]))/2,c=+e[0][1]+(i-a*(s[1][1]+s[0][1]))/2;return null!=o&&t.clipExtent(o),t.scale(150*a).translate([u,c])}function xo(t){return function(t){function e(t){return[(t=c(t[0]*Uf,t[1]*Uf))[0]*d+s,a-t[1]*d]}function n(t,e){return[(t=o(t,e))[0]*d+s,a-t[1]*d]}function r(){c=rg(u=so(x,E,w),o);var t=o(m,v);return s=y-t[0]*d,a=_+t[1]*d,i()}function i(){return f=g=null,e}var o,s,a,u,c,h,l,p,f,g,d=150,y=480,_=250,m=0,v=0,x=0,E=0,w=0,b=null,I=Eg,N=null,C=gg,S=.5,M=Ng(n,S);return e.stream=function(t){return f&&g===t?f:f=Cg(I(u,M(C(g=t))))},e.clipAngle=function(t){return arguments.length?(I=+t?wg(b=t*Uf,6*Uf):(b=null,Eg),i()):b*Xf},e.clipExtent=function(t){return arguments.length?(C=null==t?(N=h=l=p=null,gg):fo(N=+t[0][0],h=+t[0][1],l=+t[1][0],p=+t[1][1]),i()):null==N?null:[[N,h],[l,p]]},e.scale=function(t){return arguments.length?(d=+t,r()):d},e.translate=function(t){return arguments.length?(y=+t[0],_=+t[1],r()):[y,_]},e.center=function(t){return arguments.length?(m=t[0]%360*Uf,v=t[1]%360*Uf,r()):[m*Xf,v*Xf]},e.rotate=function(t){return arguments.length?(x=t[0]%360*Uf,E=t[1]%360*Uf,w=t.length>2?t[2]%360*Uf:0,r()):[x*Xf,E*Xf,w*Xf]},e.precision=function(t){return arguments.length?(M=Ng(n,S=t*t),i()):Qf(S)},e.fitExtent=function(t,n){return vo(e,t,n)},e.fitSize=function(t,n){return function(t,e,n){return vo(t,[[0,0],e],n)}(e,t,n)},function(){return o=t.apply(this,arguments),e.invert=o.invert&&function(t){return(t=c.invert((t[0]-s)/d,(a-t[1])/d))&&[t[0]*Xf,t[1]*Xf]},r()}}((function(){return t}))()}function Eo(t,e){return[t,Zf($f((kf+e)/2))]}function wo(t,e){return[Zf($f((kf+e)/2)),-t]}function bo(t,n,r,i){var o=t.properties||{},s="Feature"===t.type?t.geometry:t;if("GeometryCollection"===s.type){var a=[];return A(t,(function(t){var e=bo(t,n,r,i);e&&a.push(e)})),c(a)}var u,h=j(t),l=h[1]>50&&h[3]>50;u=l?{type:s.type,coordinates:No(s.coordinates,So(s))}:cn(s);var p,f=(new bh).read(u),g=d(y(n,r),"meters"),_=gp.bufferOp(f,g);if(!Io((_=(new Ih).write(_)).coordinates))return(p=l?{type:_.type,coordinates:Co(_.coordinates,So(s))}:hn(_)).geometry?p:e(p,o)}function Io(t){return Array.isArray(t[0])?Io(t[0]):isNaN(t[0])}function No(t,e){return"object"!=typeof t[0]?e(t):t.map((function(t){return No(t,e)}))}function Co(t,e){return"object"!=typeof t[0]?e.invert(t):t.map((function(t){return Co(t,e)}))}function So(t){var e=de(t).geometry.coordinates.reverse(),n=e.map((function(t){return-t}));return Sg().center(e).rotate(n).scale(Fo)}function Mo(){for(var t=new bh,e=t.read(JSON.stringify(arguments[0].geometry)),n=1;n<arguments.length;n++)e=Df.union(e,t.read(JSON.stringify(arguments[n].geometry)));return{type:"Feature",geometry:e=(new Ih).write(e),properties:arguments[0].properties}}function Lo(t,n){var r=J(t),i=J(n);if(te(Pn(i,{precision:4})).coordinates[0].length<4)return null;if(te(Pn(r,{precision:4})).coordinates[0].length<4)return null;var o=new bh,s=o.read(Pn(r)),a=o.read(Pn(i)),u=Cf.intersection(s,a);return u.isEmpty()?null:e((new Ih).write(u))}function Po(t,e){return function(t,e,n){var r,i;if(!Array.isArray(e))throw new Error("Get closest expects an array as second argument");return e.forEach((function(e,o){var s=n(e,t);s>=0&&(void 0===i||s<i)&&(i=s,r=o)})),r}(t,e,(function(t,e){return t-e}))}function Oo(t,e,n){if(!I(n=n||{}))throw new Error("options is invalid");var r=n.properties||{},i=n.triangles,s=n.mask;if(null===e||void 0===e)throw new Error("cellSide is required");if(!b(e))throw new Error("cellSide is invalid");if(!t)throw new Error("bbox is required");if(!Array.isArray(t))throw new Error("bbox must be array");if(4!==t.length)throw new Error("bbox must contain 4 numbers");if(s&&-1===["Polygon","MultiPolygon"].indexOf(K(s)))throw new Error("options.mask must be a (Multi)Polygon");var a=t[0],u=t[1],h=t[2],l=t[3],p=(u+l)/2,f=(a+h)/2,g=2*e/qt([a,p],[h,p],n)*(h-a),d=2*e/qt([f,u],[f,l],n)*(l-u),y=g/2,_=2*y,m=Math.sqrt(3)/2*d,v=h-a,x=l-u,E=.75*_,w=m,N=(v-_)/(_-y/2),C=Math.floor(N),S=(C*E-y/2-v)/2-y/2+E/2,M=Math.floor((x-m)/m),L=(x-M*m)/2,P=M*m-x>m/2;P&&(L-=m/4);for(var O=[],R=[],T=0;T<6;T++){var A=2*Math.PI/6*T;O.push(Math.cos(A)),R.push(Math.sin(A))}for(var D=[],F=0;F<=C;F++)for(var q=0;q<=M;q++){var G=F%2==1;if((0!==q||!G)&&(0!==q||!P)){var B=F*E+a-S,k=q*w+u+L;if(G&&(k-=m/2),!0===i)(function(t,e,n,r,i,s){for(var a=[],u=0;u<6;u++){var c=[];c.push(t),c.push([t[0]+e*i[u],t[1]+n*s[u]]),c.push([t[0]+e*i[(u+1)%6],t[1]+n*s[(u+1)%6]]),c.push(t),a.push(o([c],r))}return a})([B,k],g/2,d/2,r,O,R).forEach((function(t){s?Lo(s,t)&&D.push(t):D.push(t)}));else{var z=function(t,e,n,r,i,s){for(var a=[],u=0;u<6;u++){var c=t[0]+e*i[u],h=t[1]+n*s[u];a.push([c,h])}return a.push(a[0].slice()),o([a],r)}([B,k],g/2,d/2,r,O,R);s?Lo(s,z)&&D.push(z):D.push(z)}}}return c(D)}function Ro(t){if(t.features.length<=1)return t;var e=function(t){var e=Vo(),n=[];return F(t,(function(t,e){var r=j(t);n.push({minX:r[0],minY:r[1],maxX:r[2],maxY:r[3],geojson:t,index:e})})),e.load(n),e}(t),n=[],r={};return F(t,(function(t,i){if(r[i])return!0;for(e.remove({index:i},To),r[i]=!0;;){var o=j(t),s=e.search({minX:o[0],minY:o[1],maxX:o[2],maxY:o[3]});if(s.length>0){var a=s.map((function(t){return r[t.index]=!0,e.remove({index:t.index},To),t.geojson}));a.push(t),t=Mo.apply(this,a)}if(0===s.length)break}n.push(t)})),c(n)}function To(t,e){return t.index===e.index}function Ao(t,e,n){if(!I(n=n||{}))throw new Error("options is invalid");var r=n.properties,i=n.mask,s=[];if(null===e||void 0===e)throw new Error("cellSide is required");if(!b(e))throw new Error("cellSide is invalid");if(!t)throw new Error("bbox is required");if(!Array.isArray(t))throw new Error("bbox must be array");if(4!==t.length)throw new Error("bbox must contain 4 numbers");if(i&&-1===["Polygon","MultiPolygon"].indexOf(K(i)))throw new Error("options.mask must be a (Multi)Polygon");for(var a=t[0],u=t[1],h=t[2],l=t[3],p=e/qt([a,u],[h,u],n)*(h-a),f=e/qt([a,u],[a,l],n)*(l-u),g=h-a,d=l-u,y=Math.floor(g/p),_=Math.floor(d/f),m=(d-_*f)/2,v=a+(g-y*p)/2,x=0;x<y;x++){for(var E=u+m,w=0;w<_;w++){var N=o([[[v,E],[v,E+f],[v+p,E+f],[v+p,E],[v,E]]],r);i?Lo(i,N)&&s.push(N):s.push(N),E+=f}v+=p}return c(s)}function Do(t,e,n){if(!I(n=n||{}))throw new Error("options is invalid");var r=n.properties,i=n.mask,s=[];if(null===e||void 0===e)throw new Error("cellSide is required");if(!b(e))throw new Error("cellSide is invalid");if(!t)throw new Error("bbox is required");if(!Array.isArray(t))throw new Error("bbox must be array");if(4!==t.length)throw new Error("bbox must contain 4 numbers");if(i&&-1===["Polygon","MultiPolygon"].indexOf(K(i)))throw new Error("options.mask must be a (Multi)Polygon");for(var a=e/qt([t[0],t[1]],[t[2],t[1]],n)*(t[2]-t[0]),u=e/qt([t[0],t[1]],[t[0],t[3]],n)*(t[3]-t[1]),h=0,l=t[0];l<=t[2];){for(var p=0,f=t[1];f<=t[3];){var g=null,d=null;h%2==0&&p%2==0?(g=o([[[l,f],[l,f+u],[l+a,f],[l,f]]],r),d=o([[[l,f+u],[l+a,f+u],[l+a,f],[l,f+u]]],r)):h%2==0&&p%2==1?(g=o([[[l,f],[l+a,f+u],[l+a,f],[l,f]]],r),d=o([[[l,f],[l,f+u],[l+a,f+u],[l,f]]],r)):p%2==0&&h%2==1?(g=o([[[l,f],[l,f+u],[l+a,f+u],[l,f]]],r),d=o([[[l,f],[l+a,f+u],[l+a,f],[l,f]]],r)):p%2==1&&h%2==1&&(g=o([[[l,f],[l,f+u],[l+a,f],[l,f]]],r),d=o([[[l,f+u],[l+a,f+u],[l+a,f],[l,f+u]]],r)),i?(Lo(i,g)&&s.push(g),Lo(i,d)&&s.push(d)):(s.push(g),s.push(d)),f+=u,p++}h++,l+=a}return c(s)}var Fo=6371008.8,qo={meters:Fo,metres:Fo,millimeters:1e3*Fo,millimetres:1e3*Fo,centimeters:100*Fo,centimetres:100*Fo,kilometers:Fo/1e3,kilometres:Fo/1e3,miles:Fo/1609.344,nauticalmiles:Fo/1852,inches:39.37*Fo,yards:Fo/1.0936,feet:3.28084*Fo,radians:1,degrees:Fo/111325},Go={meters:1,metres:1,millimeters:1e3,millimetres:1e3,centimeters:100,centimetres:100,kilometers:.001,kilometres:.001,miles:1/1609.344,nauticalmiles:1/1852,inches:39.37,yards:1/1.0936,feet:3.28084,radians:1/Fo,degrees:1/111325},Bo={meters:1,metres:1,millimeters:1e6,millimetres:1e6,centimeters:1e4,centimetres:1e4,kilometers:1e-6,kilometres:1e-6,acres:247105e-9,miles:386e-9,yards:1.195990046,feet:10.763910417,inches:1550.003100006},ko=Object.freeze({earthRadius:Fo,factors:qo,unitsFactors:Go,areaFactors:Bo,feature:e,geometry:n,point:r,points:i,polygon:o,polygons:s,lineString:a,lineStrings:u,featureCollection:c,multiLineString:h,multiPoint:l,multiPolygon:p,geometryCollection:f,round:g,radiansToLength:d,lengthToRadians:y,lengthToDegrees:_,bearingToAzimuth:m,radiansToDegrees:v,degreesToRadians:x,convertLength:E,convertArea:w,isNumber:b,isObject:I,validateBBox:N,validateId:C,radians2degrees:function(){throw new Error("method has been renamed to `radiansToDegrees`")},degrees2radians:function(){throw new Error("method has been renamed to `degreesToRadians`")},distanceToDegrees:function(){throw new Error("method has been renamed to `lengthToDegrees`")},distanceToRadians:function(){throw new Error("method has been renamed to `lengthToRadians`")},radiansToDistance:function(){throw new Error("method has been renamed to `radiansToLength`")},bearingToAngle:function(){throw new Error("method has been renamed to `bearingToAzimuth`")},convertDistance:function(){throw new Error("method has been renamed to `convertLength`")}}),zo=Object.freeze({coordEach:S,coordReduce:M,propEach:L,propReduce:P,featureEach:O,featureReduce:R,coordAll:T,geomEach:A,geomReduce:D,flattenEach:F,flattenReduce:q,segmentEach:G,segmentReduce:B,lineEach:k,lineReduce:z}),jo=Object.freeze({getCoord:X,getCoords:U,containsNumber:Y,geojsonType:V,featureOf:H,collectionOf:W,getGeom:J,getGeomType:Z,getType:K}),Xo={successCallback:null,verbose:!1},Uo={},Yo=it,Vo=st;st.prototype={all:function(){return this._all(this.data,[])},search:function(t){var e=this.data,n=[],r=this.toBBox;if(!dt(t,e))return n;for(var i,o,s,a,u=[];e;){for(i=0,o=e.children.length;i<o;i++)s=e.children[i],dt(t,a=e.leaf?r(s):s)&&(e.leaf?n.push(s):gt(t,a)?this._all(s,n):u.push(s));e=u.pop()}return n},collides:function(t){var e=this.data,n=this.toBBox;if(!dt(t,e))return!1;for(var r,i,o,s,a=[];e;){for(r=0,i=e.children.length;r<i;r++)if(o=e.children[r],dt(t,s=e.leaf?n(o):o)){if(e.leaf||gt(t,s))return!0;a.push(o)}e=a.pop()}return!1},load:function(t){if(!t||!t.length)return this;if(t.length<this._minEntries){for(var e=0,n=t.length;e<n;e++)this.insert(t[e]);return this}var r=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===r.height)this._splitRoot(this.data,r);else{if(this.data.height<r.height){var i=this.data;this.data=r,r=i}this._insert(r,this.data.height-r.height-1,!0)}else this.data=r;return this},insert:function(t){return t&&this._insert(t,this.data.height-1),this},clear:function(){return this.data=yt([]),this},remove:function(t,e){if(!t)return this;for(var n,r,i,o,s=this.data,a=this.toBBox(t),u=[],c=[];s||u.length;){if(s||(s=u.pop(),r=u[u.length-1],n=c.pop(),o=!0),s.leaf&&-1!==(i=function(t,e,n){if(!n)return e.indexOf(t);for(var r=0;r<e.length;r++)if(n(t,e[r]))return r;return-1}(t,s.children,e)))return s.children.splice(i,1),u.push(s),this._condense(u),this;o||s.leaf||!gt(s,a)?r?(n++,s=r.children[n],o=!1):s=null:(u.push(s),c.push(n),n=0,r=s,s=s.children[0])}return this},toBBox:function(t){return t},compareMinX:ht,compareMinY:lt,toJSON:function(){return this.data},fromJSON:function(t){return this.data=t,this},_all:function(t,e){for(var n=[];t;)t.leaf?e.push.apply(e,t.children):n.push.apply(n,t.children),t=n.pop();return e},_build:function(t,e,n,r){var i,o=n-e+1,s=this._maxEntries;if(o<=s)return at(i=yt(t.slice(e,n+1)),this.toBBox),i;r||(r=Math.ceil(Math.log(o)/Math.log(s)),s=Math.ceil(o/Math.pow(s,r-1))),(i=yt([])).leaf=!1,i.height=r;var a,u,c,h,l=Math.ceil(o/s),p=l*Math.ceil(Math.sqrt(s));for(_t(t,e,n,p,this.compareMinX),a=e;a<=n;a+=p)for(_t(t,a,c=Math.min(a+p-1,n),l,this.compareMinY),u=a;u<=c;u+=l)h=Math.min(u+l-1,c),i.children.push(this._build(t,u,h,r-1));return at(i,this.toBBox),i},_chooseSubtree:function(t,e,n,r){for(var i,o,s,a,u,c,h,l;r.push(e),!e.leaf&&r.length-1!==n;){for(h=l=1/0,i=0,o=e.children.length;i<o;i++)u=pt(s=e.children[i]),(c=function(t,e){return(Math.max(e.maxX,t.maxX)-Math.min(e.minX,t.minX))*(Math.max(e.maxY,t.maxY)-Math.min(e.minY,t.minY))}(t,s)-u)<l?(l=c,h=u<h?u:h,a=s):c===l&&u<h&&(h=u,a=s);e=a||e.children[0]}return e},_insert:function(t,e,n){var r=this.toBBox,i=n?t:r(t),o=[],s=this._chooseSubtree(i,this.data,e,o);for(s.children.push(t),ct(s,i);e>=0&&o[e].children.length>this._maxEntries;)this._split(o,e),e--;this._adjustParentBBoxes(i,o,e)},_split:function(t,e){var n=t[e],r=n.children.length,i=this._minEntries;this._chooseSplitAxis(n,i,r);var o=this._chooseSplitIndex(n,i,r),s=yt(n.children.splice(o,n.children.length-o));s.height=n.height,s.leaf=n.leaf,at(n,this.toBBox),at(s,this.toBBox),e?t[e-1].children.push(s):this._splitRoot(n,s)},_splitRoot:function(t,e){this.data=yt([t,e]),this.data.height=t.height+1,this.data.leaf=!1,at(this.data,this.toBBox)},_chooseSplitIndex:function(t,e,n){var r,i,o,s,a,u,c,h;for(u=c=1/0,r=e;r<=n-e;r++)s=function(t,e){var n=Math.max(t.minX,e.minX),r=Math.max(t.minY,e.minY),i=Math.min(t.maxX,e.maxX),o=Math.min(t.maxY,e.maxY);return Math.max(0,i-n)*Math.max(0,o-r)}(i=ut(t,0,r,this.toBBox),o=ut(t,r,n,this.toBBox)),a=pt(i)+pt(o),s<u?(u=s,h=r,c=a<c?a:c):s===u&&a<c&&(c=a,h=r);return h},_chooseSplitAxis:function(t,e,n){var r=t.leaf?this.compareMinX:ht,i=t.leaf?this.compareMinY:lt;this._allDistMargin(t,e,n,r)<this._allDistMargin(t,e,n,i)&&t.children.sort(r)},_allDistMargin:function(t,e,n,r){t.children.sort(r);var i,o,s=this.toBBox,a=ut(t,0,e,s),u=ut(t,n-e,n,s),c=ft(a)+ft(u);for(i=e;i<n-e;i++)o=t.children[i],ct(a,t.leaf?s(o):o),c+=ft(a);for(i=n-e-1;i>=e;i--)o=t.children[i],ct(u,t.leaf?s(o):o),c+=ft(u);return c},_adjustParentBBoxes:function(t,e,n){for(var r=n;r>=0;r--)ct(e[r],t)},_condense:function(t){for(var e,n=t.length-1;n>=0;n--)0===t[n].children.length?n>0?(e=t[n-1].children).splice(e.indexOf(t[n]),1):this.clear():at(t[n],this.toBBox)},_initFormat:function(t){var e=["return a"," - b",";"];this.compareMinX=new Function("a","b",e.join(t[0])),this.compareMinY=new Function("a","b",e.join(t[1])),this.toBBox=new Function("a","return {minX: a"+t[0]+", minY: a"+t[1]+", maxX: a"+t[2]+", maxY: a"+t[3]+"};")}};var Ho=function(t,e,n){var r=t*e,i=Wo*t,o=i-(i-t),s=t-o,a=Wo*e,u=a-(a-e),c=e-u,h=s*c-(r-o*u-s*u-o*c);return n?(n[0]=h,n[1]=r,n):[h,r]},Wo=+(Math.pow(2,27)+1),Jo=function(t,e){var n=0|t.length,r=0|e.length;if(1===n&&1===r)return function(t,e){var n=t+e,r=n-t,i=t-(n-r)+(e-r);return i?[i,n]:[n]}(t[0],e[0]);var i,o,s=new Array(n+r),a=0,u=0,c=0,h=Math.abs,l=t[u],p=h(l),f=e[c],g=h(f);p<g?(o=l,(u+=1)<n&&(p=h(l=t[u]))):(o=f,(c+=1)<r&&(g=h(f=e[c]))),u<n&&p<g||c>=r?(i=l,(u+=1)<n&&(p=h(l=t[u]))):(i=f,(c+=1)<r&&(g=h(f=e[c])));for(var d,y,_=i+o,m=_-i,v=o-m,x=v,E=_;u<n&&c<r;)p<g?(i=l,(u+=1)<n&&(p=h(l=t[u]))):(i=f,(c+=1)<r&&(g=h(f=e[c]))),(v=(o=x)-(m=(_=i+o)-i))&&(s[a++]=v),x=E-((d=E+_)-(y=d-E))+(_-y),E=d;for(;u<n;)(v=(o=x)-(m=(_=(i=l)+o)-i))&&(s[a++]=v),x=E-((d=E+_)-(y=d-E))+(_-y),E=d,(u+=1)<n&&(l=t[u]);for(;c<r;)(v=(o=x)-(m=(_=(i=f)+o)-i))&&(s[a++]=v),x=E-((d=E+_)-(y=d-E))+(_-y),E=d,(c+=1)<r&&(f=e[c]);return x&&(s[a++]=x),E&&(s[a++]=E),a||(s[a++]=0),s.length=a,s},Zo=function(t,e,n){var r=t+e,i=r-t,o=e-i,s=t-(r-i);return n?(n[0]=s+o,n[1]=r,n):[s+o,r]},Ko=function(t,e){var n=t.length;if(1===n){var r=Ho(t[0],e);return r[0]?r:[r[1]]}var i=new Array(2*n),o=[.1,.1],s=[.1,.1],a=0;Ho(t[0],e,o),o[0]&&(i[a++]=o[0]);for(var u=1;u<n;++u){Ho(t[u],e,s);var c=o[1];Zo(c,s[0],o),o[0]&&(i[a++]=o[0]);var h=s[1],l=o[1],p=h+l,f=l-(p-h);o[1]=p,f&&(i[a++]=f)}return o[1]&&(i[a++]=o[1]),0===a&&(i[a++]=0),i.length=a,i},Qo=function(t,e){var n=0|t.length,r=0|e.length;if(1===n&&1===r)return function(t,e){var n=t+e,r=n-t,i=t-(n-r)+(e-r);return i?[i,n]:[n]}(t[0],-e[0]);var i,o,s=new Array(n+r),a=0,u=0,c=0,h=Math.abs,l=t[u],p=h(l),f=-e[c],g=h(f);p<g?(o=l,(u+=1)<n&&(p=h(l=t[u]))):(o=f,(c+=1)<r&&(g=h(f=-e[c]))),u<n&&p<g||c>=r?(i=l,(u+=1)<n&&(p=h(l=t[u]))):(i=f,(c+=1)<r&&(g=h(f=-e[c])));for(var d,y,_=i+o,m=_-i,v=o-m,x=v,E=_;u<n&&c<r;)p<g?(i=l,(u+=1)<n&&(p=h(l=t[u]))):(i=f,(c+=1)<r&&(g=h(f=-e[c]))),(v=(o=x)-(m=(_=i+o)-i))&&(s[a++]=v),x=E-((d=E+_)-(y=d-E))+(_-y),E=d;for(;u<n;)(v=(o=x)-(m=(_=(i=l)+o)-i))&&(s[a++]=v),x=E-((d=E+_)-(y=d-E))+(_-y),E=d,(u+=1)<n&&(l=t[u]);for(;c<r;)(v=(o=x)-(m=(_=(i=f)+o)-i))&&(s[a++]=v),x=E-((d=E+_)-(y=d-E))+(_-y),E=d,(c+=1)<r&&(f=-e[c]);return x&&(s[a++]=x),E&&(s[a++]=E),a||(s[a++]=0),s.length=a,s},$o=mt((function(t){function e(t,e){for(var n=new Array(t.length-1),r=1;r<t.length;++r)for(var i=n[r-1]=new Array(t.length-1),o=0,s=0;o<t.length;++o)o!==e&&(i[s++]=t[r][o]);return n}function n(t){return 1&t?"-":""}function r(t){if(1===t.length)return t[0];if(2===t.length)return["sum(",t[0],",",t[1],")"].join("");var e=t.length>>1;return["sum(",r(t.slice(0,e)),",",r(t.slice(e)),")"].join("")}function i(t){if(2===t.length)return[["sum(prod(",t[0][0],",",t[1][1],"),prod(-",t[0][1],",",t[1][0],"))"].join("")];for(var o=[],s=0;s<t.length;++s)o.push(["scale(",r(i(e(t,s))),",",n(s),t[0][s],")"].join(""));return o}function o(t){for(var n=[],o=[],s=function(t){for(var e=new Array(t),n=0;n<t;++n){e[n]=new Array(t);for(var r=0;r<t;++r)e[n][r]=["m",r,"[",t-n-1,"]"].join("")}return e}(t),a=[],u=0;u<t;++u)0==(1&u)?n.push.apply(n,i(e(s,u))):o.push.apply(o,i(e(s,u))),a.push("m"+u);var c=r(n),h=r(o),l="orientation"+t+"Exact",p=["function ",l,"(",a.join(),"){var p=",c,",n=",h,",d=sub(p,n);return d[d.length-1];};return ",l].join("");return new Function("sum","prod","scale","sub",p)(Jo,Ho,Ko,Qo)}var s=5,a=o(3),u=o(4),c=[function(){return 0},function(){return 0},function(t,e){return e[0]-t[0]},function(t,e,n){var r,i=(t[1]-n[1])*(e[0]-n[0]),o=(t[0]-n[0])*(e[1]-n[1]),s=i-o;if(i>0){if(o<=0)return s;r=i+o}else{if(!(i<0))return s;if(o>=0)return s;r=-(i+o)}var u=33306690738754716e-32*r;return s>=u||s<=-u?s:a(t,e,n)},function(t,e,n,r){var i=t[0]-r[0],o=e[0]-r[0],s=n[0]-r[0],a=t[1]-r[1],c=e[1]-r[1],h=n[1]-r[1],l=t[2]-r[2],p=e[2]-r[2],f=n[2]-r[2],g=o*h,d=s*c,y=s*a,_=i*h,m=i*c,v=o*a,x=l*(g-d)+p*(y-_)+f*(m-v),E=7771561172376103e-31*((Math.abs(g)+Math.abs(d))*Math.abs(l)+(Math.abs(y)+Math.abs(_))*Math.abs(p)+(Math.abs(m)+Math.abs(v))*Math.abs(f));return x>E||-x>E?x:u(t,e,n,r)}];!function(){for(;c.length<=s;)c.push(o(c.length));for(var e=[],n=["slow"],r=0;r<=s;++r)e.push("a"+r),n.push("o"+r);var i=["function getOrientation(",e.join(),"){switch(arguments.length){case 0:case 1:return 0;"];for(r=2;r<=s;++r)i.push("case ",r,":return o",r,"(",e.slice(0,r).join(),");");i.push("}var s=new Array(arguments.length);for(var i=0;i<arguments.length;++i){s[i]=arguments[i]};return slow(s);}return getOrientation"),n.push(i.join(""));var a=Function.apply(void 0,n);for(t.exports=a.apply(void 0,[function(t){var e=c[t.length];return e||(e=c[t.length]=o(t.length)),e.apply(void 0,t)}].concat(c)),r=0;r<=s;++r)t.exports[r]=c[r]}()})),ts=function(t){var e=t.length;if(e<3){for(var n=new Array(e),r=0;r<e;++r)n[r]=r;return 2===e&&t[0][0]===t[1][0]&&t[0][1]===t[1][1]?[0]:n}var i=new Array(e);for(r=0;r<e;++r)i[r]=r;i.sort((function(e,n){return t[e][0]-t[n][0]||t[e][1]-t[n][1]}));var o=[i[0],i[1]],s=[i[0],i[1]];for(r=2;r<e;++r){for(var a=i[r],u=t[a],c=o.length;c>1&&es(t[o[c-2]],t[o[c-1]],u)<=0;)c-=1,o.pop();for(o.push(a),c=s.length;c>1&&es(t[s[c-2]],t[s[c-1]],u)>=0;)c-=1,s.pop();s.push(a)}n=new Array(s.length+o.length-2);for(var h=0,l=(r=0,o.length);r<l;++r)n[h++]=o[r];for(var p=s.length-2;p>0;--p)n[h++]=s[p];return n},es=$o[3],ns=vt,rs=vt;vt.prototype={push:function(t){this.data.push(t),this.length++,this._up(this.length-1)},pop:function(){if(0!==this.length){var t=this.data[0];return this.length--,this.length>0&&(this.data[0]=this.data[this.length],this._down(0)),this.data.pop(),t}},peek:function(){return this.data[0]},_up: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},_down:function(t){for(var e=this.data,n=this.compare,r=this.length>>1,i=e[t];t<r;){var o=1+(t<<1),s=o+1,a=e[o];if(s<this.length&&n(e[s],a)<0&&(o=s,a=e[s]),n(a,i)>=0)break;e[t]=a,t=o}e[t]=i}},ns.default=rs;var is=function(t,e){for(var n=t[0],r=t[1],i=!1,o=0,s=e.length-1;o<e.length;s=o++){var a=e[o][0],u=e[o][1],c=e[s][0],h=e[s][1];u>r!=h>r&&n<(c-a)*(r-u)/(h-u)+a&&(i=!i)}return i},os=$o[3],ss=xt,as=xt;ss.default=as;var us=function(t){return t},cs=function(t){if(null==t)return us;var e,n,r=t.scale[0],i=t.scale[1],o=t.translate[0],s=t.translate[1];return function(t,a){a||(e=n=0);var u=2,c=t.length,h=new Array(c);for(h[0]=(e+=t[0])*r+o,h[1]=(n+=t[1])*i+s;u<c;)h[u]=t[u],++u;return h}},hs=function(t,e){for(var n,r=t.length,i=r-e;i<--r;)n=t[i],t[i++]=t[r],t[r]=n},ls=function(t,e){function n(t,e){for(var n in t){var i=t[n];delete e[i.start],delete i.start,delete i.end,i.forEach((function(t){r[t<0?~t:t]=1})),s.push(i)}}var r={},i={},o={},s=[],a=-1;return e.forEach((function(n,r){var i,o=t.arcs[n<0?~n:n];o.length<3&&!o[1][0]&&!o[1][1]&&(i=e[++a],e[a]=n,e[r]=i)})),e.forEach((function(e){var n,r,s=function(e){var n,r=t.arcs[e<0?~e:e],i=r[0];return t.transform?(n=[0,0],r.forEach((function(t){n[0]+=t[0],n[1]+=t[1]}))):n=r[r.length-1],e<0?[n,i]:[i,n]}(e),a=s[0],u=s[1];if(n=o[a])if(delete o[n.end],n.push(e),n.end=u,r=i[u]){delete i[r.start];var c=r===n?n:n.concat(r);i[c.start=n.start]=o[c.end=r.end]=c}else i[n.start]=o[n.end]=n;else if(n=i[u])if(delete i[n.start],n.unshift(e),n.start=a,r=o[a]){delete o[r.end];var h=r===n?n:r.concat(n);i[h.start=r.start]=o[h.end=n.end]=h}else i[n.start]=o[n.end]=n;else i[(n=[e]).start=a]=o[n.end=u]=n})),n(o,i),n(i,o),e.forEach((function(t){r[t<0?~t:t]||s.push([t])})),s},ps=function(t){return Xt(t,Ut.apply(this,arguments))},fs=function(t,e,n,r,i,o){3===arguments.length&&(r=o=Array,i=null);for(var s=new r(t=1<<Math.max(4,Math.ceil(Math.log(t)/Math.LN2))),a=new o(t),u=t-1,c=0;c<t;++c)s[c]=i;return{set:function(r,o){for(var c=e(r)&u,h=s[c],l=0;h!=i;){if(n(h,r))return a[c]=o;if(++l>=t)throw new Error("full hashmap");h=s[c=c+1&u]}return s[c]=r,a[c]=o,o},maybeSet:function(r,o){for(var c=e(r)&u,h=s[c],l=0;h!=i;){if(n(h,r))return a[c];if(++l>=t)throw new Error("full hashmap");h=s[c=c+1&u]}return s[c]=r,a[c]=o,o},get:function(r,o){for(var c=e(r)&u,h=s[c],l=0;h!=i;){if(n(h,r))return a[c];if(++l>=t)break;h=s[c=c+1&u]}return o},keys:function(){for(var t=[],e=0,n=s.length;e<n;++e){var r=s[e];r!=i&&t.push(r)}return t}}},gs=function(t,e){return t[0]===e[0]&&t[1]===e[1]},ds=new ArrayBuffer(16),ys=new Float64Array(ds),_s=new Uint32Array(ds),ms=function(t){ys[0]=t[0],ys[1]=t[1];var e=_s[0]^_s[1];return 2147483647&(e<<5^e>>7^_s[2]^_s[3])},vs=function(t){function e(t,e,n,r){if(p[n]!==t){p[n]=t;var i=f[n];if(i>=0){var o=g[n];i===e&&o===r||i===r&&o===e||(++y,d[n]=1)}else f[n]=e,g[n]=r}}function n(t){return ms(u[t])}function r(t,e){return gs(u[t],u[e])}var i,o,s,a,u=t.coordinates,c=t.lines,h=t.rings,l=function(){for(var t=fs(1.4*u.length,n,r,Int32Array,-1,Int32Array),e=new Int32Array(u.length),i=0,o=u.length;i<o;++i)e[i]=t.maybeSet(i,i);return e}(),p=new Int32Array(u.length),f=new Int32Array(u.length),g=new Int32Array(u.length),d=new Int8Array(u.length),y=0;for(i=0,o=u.length;i<o;++i)p[i]=f[i]=g[i]=-1;for(i=0,o=c.length;i<o;++i){var _=c[i],m=_[0],v=_[1];for(s=l[m],a=l[++m],++y,d[s]=1;++m<=v;)e(i,s,s=a,a=l[m]);++y,d[a]=1}for(i=0,o=u.length;i<o;++i)p[i]=-1;for(i=0,o=h.length;i<o;++i){var x=h[i],E=x[0]+1,w=x[1];for(e(i,l[w-1],s=l[E-1],a=l[E]);++E<=w;)e(i,s,s=a,a=l[E])}p=f=g=null;var b,I=function(t,e,n,r,i){3===arguments.length&&(r=Array,i=null);for(var o=new r(t=1<<Math.max(4,Math.ceil(Math.log(t)/Math.LN2))),s=t-1,a=0;a<t;++a)o[a]=i;return{add:function(r){for(var a=e(r)&s,u=o[a],c=0;u!=i;){if(n(u,r))return!0;if(++c>=t)throw new Error("full hashset");u=o[a=a+1&s]}return o[a]=r,!0},has:function(r){for(var a=e(r)&s,u=o[a],c=0;u!=i;){if(n(u,r))return!0;if(++c>=t)break;u=o[a=a+1&s]}return!1},values:function(){for(var t=[],e=0,n=o.length;e<n;++e){var r=o[e];r!=i&&t.push(r)}return t}}}(1.4*y,ms,gs);for(i=0,o=u.length;i<o;++i)d[b=l[i]]&&I.add(u[b]);return I},xs=function(t){var e,n,r,i=vs(t),o=t.coordinates,s=t.lines,a=t.rings;for(n=0,r=s.length;n<r;++n)for(var u=s[n],c=u[0],h=u[1];++c<h;)i.has(o[c])&&(e={0:c,1:u[1]},u[1]=c,u=u.next=e);for(n=0,r=a.length;n<r;++n)for(var l=a[n],p=l[0],f=p,g=l[1],d=i.has(o[p]);++f<g;)i.has(o[f])&&(d?(e={0:f,1:l[1]},l[1]=f,l=l.next=e):(function(t,e,n,r){Yt(t,e,n),Yt(t,e,e+r),Yt(t,e+r,n)}(o,p,g,g-f),o[g]=o[p],d=!0,f=p));return t},Es=function(t){function e(t){var e,n,r,i,o,s,a,u;if(r=f.get(e=c[t[0]]))for(a=0,u=r.length;a<u;++a)if(function(t,e){var n=t[0],r=e[0],i=t[1];if(n-i!=r-e[1])return!1;for(;n<=i;++n,++r)if(!gs(c[n],c[r]))return!1;return!0}(i=r[a],t))return t[0]=i[0],void(t[1]=i[1]);if(o=f.get(n=c[t[1]]))for(a=0,u=o.length;a<u;++a)if(function(t,e){var n=t[0],r=e[0],i=t[1],o=e[1];if(n-i!=r-o)return!1;for(;n<=i;++n,--o)if(!gs(c[n],c[o]))return!1;return!0}(s=o[a],t))return t[1]=s[0],void(t[0]=s[1]);r?r.push(t):f.set(e,[t]),o?o.push(t):f.set(n,[t]),g.push(t)}function n(t,e){var n=t[0],r=e[0],o=t[1]-n;if(o!==e[1]-r)return!1;for(var s=i(t),a=i(e),u=0;u<o;++u)if(!gs(c[n+(u+s)%o],c[r+(u+a)%o]))return!1;return!0}function r(t,e){var n=t[0],r=e[0],o=t[1],s=e[1],a=o-n;if(a!==s-r)return!1;for(var u=i(t),h=a-i(e),l=0;l<a;++l)if(!gs(c[n+(l+u)%a],c[s-(l+h)%a]))return!1;return!0}function i(t){for(var e=t[0],n=t[1],r=e,i=r,o=c[r];++r<n;){var s=c[r];(s[0]<o[0]||s[0]===o[0]&&s[1]<o[1])&&(i=r,o=s)}return i-e}var o,s,a,u,c=t.coordinates,h=t.lines,l=t.rings,p=h.length+l.length;for(delete t.lines,delete t.rings,a=0,u=h.length;a<u;++a)for(o=h[a];o=o.next;)++p;for(a=0,u=l.length;a<u;++a)for(s=l[a];s=s.next;)++p;var f=fs(2*p*1.4,ms,gs),g=t.arcs=[];for(a=0,u=h.length;a<u;++a){o=h[a];do{e(o)}while(o=o.next)}for(a=0,u=l.length;a<u;++a)if((s=l[a]).next)do{e(s)}while(s=s.next);else!function(t){var e,o,s,a,u;if(o=f.get(e=c[t[0]]))for(a=0,u=o.length;a<u;++a){if(n(s=o[a],t))return t[0]=s[0],void(t[1]=s[1]);if(r(s,t))return t[0]=s[1],void(t[1]=s[0])}if(o=f.get(e=c[t[0]+i(t)]))for(a=0,u=o.length;a<u;++a){if(n(s=o[a],t))return t[0]=s[0],void(t[1]=s[1]);if(r(s,t))return t[0]=s[1],void(t[1]=s[0])}o?o.push(t):f.set(e,[t]),g.push(t)}(s);return t},ws=function(t,e){function n(t){t&&h.hasOwnProperty(t.type)&&h[t.type](t)}function r(t){var e=[];do{var n=c.get(t);e.push(t[0]<t[1]?n:~n)}while(t=t.next);return e}function i(t){return t.map(r)}var o=function(t){function e(t){null!=t&&c.hasOwnProperty(t.type)&&c[t.type](t)}function n(t){var e=t[0],n=t[1];e<o&&(o=e),e>a&&(a=e),n<s&&(s=n),n>u&&(u=n)}function r(t){t.forEach(n)}function i(t){t.forEach(r)}var o=1/0,s=1/0,a=-1/0,u=-1/0,c={GeometryCollection:function(t){t.geometries.forEach(e)},Point:function(t){n(t.coordinates)},MultiPoint:function(t){t.coordinates.forEach(n)},LineString:function(t){r(t.arcs)},MultiLineString:function(t){t.arcs.forEach(r)},Polygon:function(t){t.arcs.forEach(r)},MultiPolygon:function(t){t.arcs.forEach(i)}};for(var h in t)e(t[h]);return a>=o&&u>=s?[o,s,a,u]:void 0}(t=function(t){var e,n={};for(e in t)n[e]=Vt(t[e]);return n}(t)),s=e>0&&o&&function(t,e,n){function r(t){return[Math.round((t[0]-c)*f),Math.round((t[1]-h)*g)]}function i(t,e){for(var n,r,i,o,s,a=-1,u=0,l=t.length,p=new Array(l);++a<l;)n=t[a],o=Math.round((n[0]-c)*f),s=Math.round((n[1]-h)*g),o===r&&s===i||(p[u++]=[r=o,i=s]);for(p.length=u;u<e;)u=p.push([p[0][0],p[0][1]]);return p}function o(t){return i(t,2)}function s(t){return i(t,4)}function a(t){return t.map(s)}function u(t){null!=t&&d.hasOwnProperty(t.type)&&d[t.type](t)}var c=e[0],h=e[1],l=e[2],p=e[3],f=l-c?(n-1)/(l-c):1,g=p-h?(n-1)/(p-h):1,d={GeometryCollection:function(t){t.geometries.forEach(u)},Point:function(t){t.coordinates=r(t.coordinates)},MultiPoint:function(t){t.coordinates=t.coordinates.map(r)},LineString:function(t){t.arcs=o(t.arcs)},MultiLineString:function(t){t.arcs=t.arcs.map(o)},Polygon:function(t){t.arcs=a(t.arcs)},MultiPolygon:function(t){t.arcs=t.arcs.map(a)}};for(var y in t)u(t[y]);return{scale:[1/f,1/g],translate:[c,h]}}(t,o,e),a=Es(xs(function(t){function e(t){t&&c.hasOwnProperty(t.type)&&c[t.type](t)}function n(t){for(var e=0,n=t.length;e<n;++e)u[++o]=t[e];var r={0:o-n+1,1:o};return s.push(r),r}function r(t){for(var e=0,n=t.length;e<n;++e)u[++o]=t[e];var r={0:o-n+1,1:o};return a.push(r),r}function i(t){return t.map(r)}var o=-1,s=[],a=[],u=[],c={GeometryCollection:function(t){t.geometries.forEach(e)},LineString:function(t){t.arcs=n(t.arcs)},MultiLineString:function(t){t.arcs=t.arcs.map(n)},Polygon:function(t){t.arcs=t.arcs.map(r)},MultiPolygon:function(t){t.arcs=t.arcs.map(i)}};for(var h in t)e(t[h]);return{type:"Topology",coordinates:u,lines:s,rings:a,objects:t}}(t))),u=a.coordinates,c=fs(1.4*a.arcs.length,Jt,Zt);t=a.objects,a.bbox=o,a.arcs=a.arcs.map((function(t,e){return c.set(t,e),u.slice(t[0],t[1]+1)})),delete a.coordinates,u=null;var h={GeometryCollection:function(t){t.geometries.forEach(n)},LineString:function(t){t.arcs=r(t.arcs)},MultiLineString:function(t){t.arcs=t.arcs.map(r)},Polygon:function(t){t.arcs=t.arcs.map(r)},MultiPolygon:function(t){t.arcs=t.arcs.map(i)}};for(var l in t)n(t[l]);return s&&(a.transform=s,a.arcs=function(t){for(var e=-1,n=t.length;++e<n;){for(var r,i,o=t[e],s=0,a=1,u=o.length,c=o[0],h=c[0],l=c[1];++s<u;)r=(c=o[s])[0],i=c[1],r===h&&i===l||(o[a++]=[r-h,i-l],h=r,l=i);1===a&&(o[a++]=[0,0]),o.length=a}return t}(a.arcs)),a},bs=function(t){this.points=t.points||[],this.duration=t.duration||1e4,this.sharpness=t.sharpness||.85,this.centers=[],this.controls=[],this.stepLength=t.stepLength||60,this.length=this.points.length,this.delay=0;for(var e=0;e<this.length;e++)this.points[e].z=this.points[e].z||0;for(e=0;e<this.length-1;e++){var n=this.points[e],r=this.points[e+1];this.centers.push({x:(n.x+r.x)/2,y:(n.y+r.y)/2,z:(n.z+r.z)/2})}for(this.controls.push([this.points[0],this.points[0]]),e=0;e<this.centers.length-1;e++){n=this.centers[e],r=this.centers[e+1];var i=this.points[e+1].x-(this.centers[e].x+this.centers[e+1].x)/2,o=this.points[e+1].y-(this.centers[e].y+this.centers[e+1].y)/2,s=this.points[e+1].z-(this.centers[e].y+this.centers[e+1].z)/2;this.controls.push([{x:(1-this.sharpness)*this.points[e+1].x+this.sharpness*(this.centers[e].x+i),y:(1-this.sharpness)*this.points[e+1].y+this.sharpness*(this.centers[e].y+o),z:(1-this.sharpness)*this.points[e+1].z+this.sharpness*(this.centers[e].z+s)},{x:(1-this.sharpness)*this.points[e+1].x+this.sharpness*(this.centers[e+1].x+i),y:(1-this.sharpness)*this.points[e+1].y+this.sharpness*(this.centers[e+1].y+o),z:(1-this.sharpness)*this.points[e+1].z+this.sharpness*(this.centers[e+1].z+s)}])}return this.controls.push([this.points[this.length-1],this.points[this.length-1]]),this.steps=this.cacheSteps(this.stepLength),this};bs.prototype.cacheSteps=function(t){var e=[],n=this.pos(0);e.push(0);for(var r=0;r<this.duration;r+=10){var i=this.pos(r);Math.sqrt((i.x-n.x)*(i.x-n.x)+(i.y-n.y)*(i.y-n.y)+(i.z-n.z)*(i.z-n.z))>t&&(e.push(r),n=i)}return e},bs.prototype.vector=function(t){var e=this.pos(t+10),n=this.pos(t-10);return{angle:180*Math.atan2(e.y-n.y,e.x-n.x)/3.14,speed:Math.sqrt((n.x-e.x)*(n.x-e.x)+(n.y-e.y)*(n.y-e.y)+(n.z-e.z)*(n.z-e.z))}},bs.prototype.pos=function(t){var e=t-this.delay;e<0&&(e=0),e>this.duration&&(e=this.duration-1);var n=e/this.duration;if(n>=1)return this.points[this.length-1];var r=Math.floor((this.points.length-1)*n);return function(t,e,n,r,i){var o=function(t){var e=t*t;return[e*t,3*e*(1-t),3*t*(1-t)*(1-t),(1-t)*(1-t)*(1-t)]}(t);return{x:i.x*o[0]+r.x*o[1]+n.x*o[2]+e.x*o[3],y:i.y*o[0]+r.y*o[1]+n.y*o[2]+e.y*o[3],z:i.z*o[0]+r.z*o[1]+n.z*o[2]+e.z*o[3]}}((this.length-1)*n-r,this.points[r],this.controls[r][1],this.controls[r+1][0],this.points[r+1])};var Is=ve,Ns=ve;ve.deviation=function(t,e,n,r){var i=e&&e.length,o=i?e[0]*n:t.length,s=Math.abs(Ae(t,0,o,n));if(i)for(var a=0,u=e.length;a<u;a++){var c=e[a]*n,h=a<u-1?e[a+1]*n:t.length;s-=Math.abs(Ae(t,c,h,n))}var l=0;for(a=0;a<r.length;a+=3){var p=r[a]*n,f=r[a+1]*n,g=r[a+2]*n;l+=Math.abs((t[p]-t[g])*(t[f+1]-t[p+1])-(t[p]-t[f])*(t[g+1]-t[p+1]))}return 0===s&&0===l?0:Math.abs((l-s)/s)},ve.flatten=function(t){for(var e=t[0][0].length,n={vertices:[],holes:[],dimensions:e},r=0,i=0;i<t.length;i++){for(var o=0;o<t[i].length;o++)for(var s=0;s<e;s++)n.vertices.push(t[i][o][s]);i>0&&(r+=t[i-1].length,n.holes.push(r))}return n},Is.default=Ns,ke.prototype={all:function(){return this._all(this.data,[])},search:function(t){var e=this.data,n=[],r=this.toBBox;if(!Je(t,e))return n;for(var i,o,s,a,u=[];e;){for(i=0,o=e.children.length;i<o;i++)s=e.children[i],Je(t,a=e.leaf?r(s):s)&&(e.leaf?n.push(s):We(t,a)?this._all(s,n):u.push(s));e=u.pop()}return n},collides:function(t){var e=this.data,n=this.toBBox;if(!Je(t,e))return!1;for(var r,i,o,s,a=[];e;){for(r=0,i=e.children.length;r<i;r++)if(o=e.children[r],Je(t,s=e.leaf?n(o):o)){if(e.leaf||We(t,s))return!0;a.push(o)}e=a.pop()}return!1},load:function(t){if(!t||!t.length)return this;if(t.length<this._minEntries){for(var e=0,n=t.length;e<n;e++)this.insert(t[e]);return this}var r=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===r.height)this._splitRoot(this.data,r);else{if(this.data.height<r.height){var i=this.data;this.data=r,r=i}this._insert(r,this.data.height-r.height-1,!0)}else this.data=r;return this},insert:function(t){return t&&this._insert(t,this.data.height-1),this},clear:function(){return this.data=Ze([]),this},remove:function(t,e){if(!t)return this;for(var n,r,i,o,s=this.data,a=this.toBBox(t),u=[],c=[];s||u.length;){if(s||(s=u.pop(),r=u[u.length-1],n=c.pop(),o=!0),s.leaf&&-1!==(i=function(t,e,n){if(!n)return e.indexOf(t);for(var r=0;r<e.length;r++)if(n(t,e[r]))return r;return-1}(t,s.children,e)))return s.children.splice(i,1),u.push(s),this._condense(u),this;o||s.leaf||!We(s,a)?r?(n++,s=r.children[n],o=!1):s=null:(u.push(s),c.push(n),n=0,r=s,s=s.children[0])}return this},toBBox:function(t){return t},compareMinX:Ue,compareMinY:Ye,toJSON:function(){return this.data},fromJSON:function(t){return this.data=t,this},_all:function(t,e){for(var n=[];t;)t.leaf?e.push.apply(e,t.children):n.push.apply(n,t.children),t=n.pop();return e},_build:function(t,e,n,r){var i,o=n-e+1,s=this._maxEntries;if(o<=s)return ze(i=Ze(t.slice(e,n+1)),this.toBBox),i;r||(r=Math.ceil(Math.log(o)/Math.log(s)),s=Math.ceil(o/Math.pow(s,r-1))),(i=Ze([])).leaf=!1,i.height=r;var a,u,c,h,l=Math.ceil(o/s),p=l*Math.ceil(Math.sqrt(s));for(Ke(t,e,n,p,this.compareMinX),a=e;a<=n;a+=p)for(Ke(t,a,c=Math.min(a+p-1,n),l,this.compareMinY),u=a;u<=c;u+=l)h=Math.min(u+l-1,c),i.children.push(this._build(t,u,h,r-1));return ze(i,this.toBBox),i},_chooseSubtree:function(t,e,n,r){for(var i,o,s,a,u,c,h,l;r.push(e),!e.leaf&&r.length-1!==n;){for(h=l=1/0,i=0,o=e.children.length;i<o;i++)u=Ve(s=e.children[i]),(c=function(t,e){return(Math.max(e.maxX,t.maxX)-Math.min(e.minX,t.minX))*(Math.max(e.maxY,t.maxY)-Math.min(e.minY,t.minY))}(t,s)-u)<l?(l=c,h=u<h?u:h,a=s):c===l&&u<h&&(h=u,a=s);e=a||e.children[0]}return e},_insert:function(t,e,n){var r=this.toBBox,i=n?t:r(t),o=[],s=this._chooseSubtree(i,this.data,e,o);for(s.children.push(t),Xe(s,i);e>=0&&o[e].children.length>this._maxEntries;)this._split(o,e),e--;this._adjustParentBBoxes(i,o,e)},_split:function(t,e){var n=t[e],r=n.children.length,i=this._minEntries;this._chooseSplitAxis(n,i,r);var o=this._chooseSplitIndex(n,i,r),s=Ze(n.children.splice(o,n.children.length-o));s.height=n.height,s.leaf=n.leaf,ze(n,this.toBBox),ze(s,this.toBBox),e?t[e-1].children.push(s):this._splitRoot(n,s)},_splitRoot:function(t,e){this.data=Ze([t,e]),this.data.height=t.height+1,this.data.leaf=!1,ze(this.data,this.toBBox)},_chooseSplitIndex:function(t,e,n){var r,i,o,s,a,u,c,h;for(u=c=1/0,r=e;r<=n-e;r++)s=function(t,e){var n=Math.max(t.minX,e.minX),r=Math.max(t.minY,e.minY),i=Math.min(t.maxX,e.maxX),o=Math.min(t.maxY,e.maxY);return Math.max(0,i-n)*Math.max(0,o-r)}(i=je(t,0,r,this.toBBox),o=je(t,r,n,this.toBBox)),a=Ve(i)+Ve(o),s<u?(u=s,h=r,c=a<c?a:c):s===u&&a<c&&(c=a,h=r);return h},_chooseSplitAxis:function(t,e,n){var r=t.leaf?this.compareMinX:Ue,i=t.leaf?this.compareMinY:Ye;this._allDistMargin(t,e,n,r)<this._allDistMargin(t,e,n,i)&&t.children.sort(r)},_allDistMargin:function(t,e,n,r){t.children.sort(r);var i,o,s=this.toBBox,a=je(t,0,e,s),u=je(t,n-e,n,s),c=He(a)+He(u);for(i=e;i<n-e;i++)o=t.children[i],Xe(a,t.leaf?s(o):o),c+=He(a);for(i=n-e-1;i>=e;i--)o=t.children[i],Xe(u,t.leaf?s(o):o),c+=He(u);return c},_adjustParentBBoxes:function(t,e,n){for(var r=n;r>=0;r--)Xe(e[r],t)},_condense:function(t){for(var e,n=t.length-1;n>=0;n--)0===t[n].children.length?n>0?(e=t[n-1].children).splice(e.indexOf(t[n]),1):this.clear():ze(t[n],this.toBBox)},_initFormat:function(t){var e=["return a"," - b",";"];this.compareMinX=new Function("a","b",e.join(t[0])),this.compareMinY=new Function("a","b",e.join(t[1])),this.toBBox=new Function("a","return {minX: a"+t[0]+", minY: a"+t[1]+", maxX: a"+t[2]+", maxY: a"+t[3]+"};")}};var Cs=Object.freeze({toMercator:cn,toWgs84:hn}),Ss=6378137,Ms=function(t,e,n){function r(t,n,r,i){var u,c,h=o[t][n],l=o[t][n+1],p=o[r][i],f=o[r][i+1],g=function(t,e,n,r){if(On(t,n)||On(t,r)||On(e,n)||On(r,n))return null;var i=t[0],o=t[1],s=e[0],a=e[1],u=n[0],c=n[1],h=r[0],l=r[1],p=(i-s)*(c-l)-(o-a)*(u-h);return 0===p?null:[((i*a-o*s)*(u-h)-(i-s)*(u*l-c*h))/p,((i*a-o*s)*(c-l)-(o-a)*(u*l-c*h))/p]}(h,l,p,f);if(null!==g&&(u=l[0]!==h[0]?(g[0]-h[0])/(l[0]-h[0]):(g[1]-h[1])/(l[1]-h[1]),c=f[0]!==p[0]?(g[0]-p[0])/(f[0]-p[0]):(g[1]-p[1])/(f[1]-p[1]),!(u>=1||u<=0||c>=1||c<=0))){var d=g,y=!a[d];y&&(a[d]=!0),e?s.push(e(g,t,n,h,l,u,r,i,p,f,c,y)):s.push(g)}}function i(t,e){var n,r,i,s,a=o[t][e],u=o[t][e+1];return a[0]<u[0]?(n=a[0],r=u[0]):(n=u[0],r=a[0]),a[1]<u[1]?(i=a[1],s=u[1]):(i=u[1],s=a[1]),{minX:n,minY:i,maxX:r,maxY:s,ring:t,edge:e}}if("Polygon"!==t.geometry.type)throw new Error("The input feature must be a Polygon");void 0===n&&(n=1);var o=t.geometry.coordinates,s=[],a={};if(n){for(var u=[],c=0;c<o.length;c++)for(var h=0;h<o[c].length-1;h++)u.push(i(c,h));var l=Vo();l.load(u)}for(var p=0;p<o.length;p++)for(var f=0;f<o[p].length-1;f++)if(n)l.search(i(p,f)).forEach((function(t){var e=t.ring,n=t.edge;r(p,f,e,n)}));else for(var g=0;g<o.length;g++)for(var d=0;d<o[g].length-1;d++)r(p,f,g,d);return e||(s={type:"Feature",geometry:{type:"MultiPoint",coordinates:s}}),s},Ls=function(t){function e(){for(var t=[],e=0;e<g.features.length;e++)-1==g.features[e].properties.parent&&t.push(e);if(t.length>1)for(e=0;e<t.length;e++){for(var n=-1,r=0;r<g.features.length;r++)t[e]!=r&&Pt(g.features[t[e]].geometry.coordinates[0][0],g.features[r],{ignoreBoundary:!0})&&mn(g.features[r])<1/0&&(n=r);g.features[t[e]].properties.parent=n}}function n(){for(var t=0;t<g.features.length;t++)if(-1==g.features[t].properties.parent){var e=g.features[t].properties.winding;g.features[t].properties.netWinding=e,r(t,e)}}function r(t,e){for(var n=0;n<g.features.length;n++)if(g.features[n].properties.parent==t){var i=e+g.features[n].properties.winding;g.features[n].properties.netWinding=i,r(n,i)}}if("Feature"!=t.type)throw new Error("The input must a geojson object of type Feature");if(void 0===t.geometry||null==t.geometry)throw new Error("The input must a geojson object with a non-empty geometry");if("Polygon"!=t.geometry.type)throw new Error("The input must be a geojson Polygon");for(var i=t.geometry.coordinates.length,s=[],a=0;a<i;a++){var u=t.geometry.coordinates[a];Tn(u[0],u[u.length-1])||u.push(u[0]),s.push.apply(s,u.slice(0,u.length-1))}if(!function(t){for(var e={},n=1,r=0,i=t.length;r<i;++r){if(e.hasOwnProperty(t[r])){n=0;break}e[t[r]]=1}return n}(s))throw new Error("The input polygon may not have duplicate vertices (except for the first and last vertex of each ring)");var h=s.length,l=Ms(t,(function(t,e,n,r,i,o,s,a,u,c,h,l){return[t,e,n,r,i,o,s,a,u,c,h,l]})),p=l.length;if(0==p){var f=[];for(a=0;a<i;a++)f.push(o([t.geometry.coordinates[a]],{parent:-1,winding:function(t){for(var e=0,n=0;n<t.length-1;n++)t[n][0]<t[e][0]&&(e=n);if(Rn([t[(e-1).modulo(t.length-1)],t[e],t[(e+1).modulo(t.length-1)]],!0))var r=1;else r=-1;return r}(t.geometry.coordinates[a])}));var g=c(f);return e(),n(),g}var d=[],y=[];for(a=0;a<i;a++){d.push([]);for(var _=0;_<t.geometry.coordinates[a].length-1;_++)d[a].push([new Ps(t.geometry.coordinates[a][(_+1).modulo(t.geometry.coordinates[a].length-1)],1,[a,_],[a,(_+1).modulo(t.geometry.coordinates[a].length-1)],void 0)]),y.push(new Os(t.geometry.coordinates[a][_],[a,(_-1).modulo(t.geometry.coordinates[a].length-1)],[a,_],void 0,void 0,!1,!0))}for(a=0;a<p;a++)d[l[a][1]][l[a][2]].push(new Ps(l[a][0],l[a][5],[l[a][1],l[a][2]],[l[a][6],l[a][7]],void 0)),l[a][11]&&y.push(new Os(l[a][0],[l[a][1],l[a][2]],[l[a][6],l[a][7]],void 0,void 0,!0,!0));var m=y.length;for(a=0;a<d.length;a++)for(_=0;_<d[a].length;_++)d[a][_].sort((function(t,e){return t.param<e.param?-1:1}));var v=[];for(a=0;a<m;a++)v.push({minX:y[a].coord[0],minY:y[a].coord[1],maxX:y[a].coord[0],maxY:y[a].coord[1],index:a});var x=Vo();for(x.load(v),a=0;a<d.length;a++)for(_=0;_<d[a].length;_++)for(var E=0;E<d[a][_].length;E++){b=E==d[a][_].length-1?d[a][(_+1).modulo(t.geometry.coordinates[a].length-1)][0].coord:d[a][_][E+1].coord;var w=x.search({minX:b[0],minY:b[1],maxX:b[0],maxY:b[1]})[0];d[a][_][E].nxtIsectAlongEdgeIn=w.index}for(a=0;a<d.length;a++)for(_=0;_<d[a].length;_++)for(E=0;E<d[a][_].length;E++){var b=d[a][_][E].coord,I=(w=x.search({minX:b[0],minY:b[1],maxX:b[0],maxY:b[1]})[0]).index;I<h?y[I].nxtIsectAlongRingAndEdge2=d[a][_][E].nxtIsectAlongEdgeIn:Tn(y[I].ringAndEdge1,d[a][_][E].ringAndEdgeIn)?y[I].nxtIsectAlongRingAndEdge1=d[a][_][E].nxtIsectAlongEdgeIn:y[I].nxtIsectAlongRingAndEdge2=d[a][_][E].nxtIsectAlongEdgeIn}var N=[];for(a=0,_=0;_<i;_++){var C=a;for(E=0;E<t.geometry.coordinates[_].length-1;E++)y[a].coord[0]<y[C].coord[0]&&(C=a),a++;var S=y[C].nxtIsectAlongRingAndEdge2;for(E=0;E<y.length;E++)if(y[E].nxtIsectAlongRingAndEdge1==C||y[E].nxtIsectAlongRingAndEdge2==C){var M=E;break}var L=Rn([y[M].coord,y[C].coord,y[S].coord],!0)?1:-1;N.push({isect:C,parent:-1,winding:L})}for(N.sort((function(t,e){return y[t.isect].coord>y[e.isect].coord?-1:1})),f=[];N.length>0;){var P=N.pop(),O=P.isect,R=P.parent,T=P.winding,A=f.length,D=[y[O].coord],F=O;if(y[O].ringAndEdge1Walkable)var q=y[O].ringAndEdge1,G=y[O].nxtIsectAlongRingAndEdge1;else q=y[O].ringAndEdge2,G=y[O].nxtIsectAlongRingAndEdge2;for(;!Tn(y[O].coord,y[G].coord);){D.push(y[G].coord);var B=void 0;for(a=0;a<N.length;a++)if(N[a].isect==G){B=a;break}if(void 0!=B&&N.splice(B,1),Tn(q,y[G].ringAndEdge1)){if(q=y[G].ringAndEdge2,y[G].ringAndEdge2Walkable=!1,y[G].ringAndEdge1Walkable){var k={isect:G};Rn([y[F].coord,y[G].coord,y[y[G].nxtIsectAlongRingAndEdge2].coord],1==T)?(k.parent=R,k.winding=-T):(k.parent=A,k.winding=T),N.push(k)}F=G,G=y[G].nxtIsectAlongRingAndEdge2}else q=y[G].ringAndEdge1,y[G].ringAndEdge1Walkable=!1,y[G].ringAndEdge2Walkable&&(k={isect:G},Rn([y[F].coord,y[G].coord,y[y[G].nxtIsectAlongRingAndEdge1].coord],1==T)?(k.parent=R,k.winding=-T):(k.parent=A,k.winding=T),N.push(k)),F=G,G=y[G].nxtIsectAlongRingAndEdge1}D.push(y[G].coord),f.push(o([D],{index:A,parent:R,winding:T,netWinding:void 0}))}return g=c(f),e(),n(),g},Ps=function(t,e,n,r,i){this.coord=t,this.param=e,this.ringAndEdgeIn=n,this.ringAndEdgeOut=r,this.nxtIsectAlongEdgeIn=i},Os=function(t,e,n,r,i,o,s){this.coord=t,this.ringAndEdge1=e,this.ringAndEdge2=n,this.nxtIsectAlongRingAndEdge1=r,this.nxtIsectAlongRingAndEdge2=i,this.ringAndEdge1Walkable=o,this.ringAndEdge2Walkable=s};Number.prototype.modulo=function(t){return(this%t+t)%t};var Rs=Math.PI/180,Ts=180/Math.PI,As=function(t,e){this.lon=t,this.lat=e,this.x=Rs*t,this.y=Rs*e};As.prototype.view=function(){return String(this.lon).slice(0,4)+","+String(this.lat).slice(0,4)},As.prototype.antipode=function(){var t=-1*this.lat,e=this.lon<0?180+this.lon:-1*(180-this.lon);return new As(e,t)};var Ds=function(){this.coords=[],this.length=0};Ds.prototype.move_to=function(t){this.length++,this.coords.push(t)};var Fs=function(t){this.properties=t||{},this.geometries=[]};Fs.prototype.json=function(){if(this.geometries.length<=0)return{geometry:{type:"LineString",coordinates:null},type:"Feature",properties:this.properties};if(1===this.geometries.length)return{geometry:{type:"LineString",coordinates:this.geometries[0].coords},type:"Feature",properties:this.properties};for(var t=[],e=0;e<this.geometries.length;e++)t.push(this.geometries[e].coords);return{geometry:{type:"MultiLineString",coordinates:t},type:"Feature",properties:this.properties}},Fs.prototype.wkt=function(){for(var t="",e="LINESTRING(",n=function(t){e+=t[0]+" "+t[1]+","},r=0;r<this.geometries.length;r++){if(0===this.geometries[r].coords.length)return"LINESTRING(empty)";this.geometries[r].coords.forEach(n),t+=e.substring(0,e.length-1)+")"}return t};var qs=function(t,e,n){if(!t||void 0===t.x||void 0===t.y)throw new Error("GreatCircle constructor expects two args: start and end objects with x and y properties");if(!e||void 0===e.x||void 0===e.y)throw new Error("GreatCircle constructor expects two args: start and end objects with x and y properties");this.start=new As(t.x,t.y),this.end=new As(e.x,e.y),this.properties=n||{};var r=this.start.x-this.end.x,i=this.start.y-this.end.y,o=Math.pow(Math.sin(i/2),2)+Math.cos(this.start.y)*Math.cos(this.end.y)*Math.pow(Math.sin(r/2),2);if(this.g=2*Math.asin(Math.sqrt(o)),this.g===Math.PI)throw new Error("it appears "+t.view()+" and "+e.view()+" are 'antipodal', e.g diametrically opposite, thus there is no single route but rather infinite");if(isNaN(this.g))throw new Error("could not calculate great circle between "+t+" and "+e)};qs.prototype.interpolate=function(t){var e=Math.sin((1-t)*this.g)/Math.sin(this.g),n=Math.sin(t*this.g)/Math.sin(this.g),r=e*Math.cos(this.start.y)*Math.cos(this.start.x)+n*Math.cos(this.end.y)*Math.cos(this.end.x),i=e*Math.cos(this.start.y)*Math.sin(this.start.x)+n*Math.cos(this.end.y)*Math.sin(this.end.x),o=e*Math.sin(this.start.y)+n*Math.sin(this.end.y),s=Ts*Math.atan2(o,Math.sqrt(Math.pow(r,2)+Math.pow(i,2)));return[Ts*Math.atan2(i,r),s]},qs.prototype.Arc=function(t,e){var n=[];if(!t||t<=2)n.push([this.start.lon,this.start.lat]),n.push([this.end.lon,this.end.lat]);else for(var r=1/(t-1),i=0;i<t;++i){var o=r*i,s=this.interpolate(o);n.push(s)}for(var a=!1,u=0,c=e&&e.offset?e.offset:10,h=180-c,l=-180+c,p=360-c,f=1;f<n.length;++f){var g=n[f-1][0],d=n[f][0],y=Math.abs(d-g);y>p&&(d>h&&g<l||g>h&&d<l)?a=!0:y>u&&(u=y)}var _=[];if(a&&u<c){var m=[];_.push(m);for(var v=0;v<n.length;++v){var x=parseFloat(n[v][0]);if(v>0&&Math.abs(x-n[v-1][0])>p){var E=parseFloat(n[v-1][0]),w=parseFloat(n[v-1][1]),b=parseFloat(n[v][0]),I=parseFloat(n[v][1]);if(E>-180&&E<l&&180===b&&v+1<n.length&&n[v-1][0]>-180&&n[v-1][0]<l){m.push([-180,n[v][1]]),v++,m.push([n[v][0],n[v][1]]);continue}if(E>h&&E<180&&-180===b&&v+1<n.length&&n[v-1][0]>h&&n[v-1][0]<180){m.push([180,n[v][1]]),v++,m.push([n[v][0],n[v][1]]);continue}if(E<l&&b>h){var N=E;E=b,b=N;var C=w;w=I,I=C}if(E>h&&b<l&&(b+=360),E<=180&&b>=180&&E<b){var S=(180-E)/(b-E),M=S*I+(1-S)*w;m.push([n[v-1][0]>h?180:-180,M]),(m=[]).push([n[v-1][0]>h?-180:180,M]),_.push(m)}else m=[],_.push(m);m.push([x,n[v][1]])}else m.push([n[v][0],n[v][1]])}}else{var L=[];_.push(L);for(var P=0;P<n.length;++P)L.push([n[P][0],n[P][1]])}for(var O=new Fs(this.properties),R=0;R<_.length;++R){var T=new Ds;O.geometries.push(T);for(var A=_[R],D=0;D<A.length;++D)T.move_to(A[D])}return O};var Gs=Yn;Yn.polyline=Yn,Yn.polygon=function(t,e){var n,r,i,o,s,a,u;for(r=1;r<=8;r*=2){for(n=[],o=!(Hn(i=t[t.length-1],e)&r),s=0;s<t.length;s++)(u=!(Hn(a=t[s],e)&r))!==o&&n.push(Vn(i,a,r,e)),u&&n.push(a),i=a,o=u;if(!(t=n).length)break}return n};var Bs=Array.prototype.slice,ks={successCallback:null,verbose:!1,polygons:!1},zs={},js=64,Xs=16,Us=4,Ys=1,Vs=[],Hs=[],Ws=[],Js=[],Zs=[],Ks=[],Qs=[],$s=[],ta=[],ea=[],na=[],ra=[],ia=[],oa=[],sa=[],aa=[],ua=[],ca=[],ha=[],la=[],pa=[],fa=[],ga=[],da=[];Qs[85]=ea[85]=-1,$s[85]=na[85]=0,ta[85]=ra[85]=1,ha[85]=fa[85]=1,la[85]=ga[85]=0,pa[85]=da[85]=1,Vs[85]=Js[85]=0,Hs[85]=Zs[85]=-1,Ws[85]=sa[85]=0,aa[85]=ia[85]=0,ua[85]=oa[85]=1,Ks[85]=ca[85]=1,fa[1]=fa[169]=0,ga[1]=ga[169]=-1,da[1]=da[169]=0,ia[1]=ia[169]=-1,oa[1]=oa[169]=0,sa[1]=sa[169]=0,ea[4]=ea[166]=0,na[4]=na[166]=-1,ra[4]=ra[166]=1,aa[4]=aa[166]=1,ua[4]=ua[166]=0,ca[4]=ca[166]=0,Qs[16]=Qs[154]=0,$s[16]=$s[154]=1,ta[16]=ta[154]=1,Js[16]=Js[154]=1,Zs[16]=Zs[154]=0,Ks[16]=Ks[154]=1,ha[64]=ha[106]=0,la[64]=la[106]=1,pa[64]=pa[106]=0,Vs[64]=Vs[106]=-1,Hs[64]=Hs[106]=0,Ws[64]=Ws[106]=1,ha[2]=ha[168]=0,la[2]=la[168]=-1,pa[2]=pa[168]=1,fa[2]=fa[168]=0,ga[2]=ga[168]=-1,da[2]=da[168]=0,ia[2]=ia[168]=-1,oa[2]=oa[168]=0,sa[2]=sa[168]=0,aa[2]=aa[168]=-1,ua[2]=ua[168]=0,ca[2]=ca[168]=1,Qs[8]=Qs[162]=0,$s[8]=$s[162]=-1,ta[8]=ta[162]=0,ea[8]=ea[162]=0,na[8]=na[162]=-1,ra[8]=ra[162]=1,ia[8]=ia[162]=1,oa[8]=oa[162]=0,sa[8]=sa[162]=1,aa[8]=aa[162]=1,ua[8]=ua[162]=0,ca[8]=ca[162]=0,Qs[32]=Qs[138]=0,$s[32]=$s[138]=1,ta[32]=ta[138]=1,ea[32]=ea[138]=0,na[32]=na[138]=1,ra[32]=ra[138]=0,Vs[32]=Vs[138]=1,Hs[32]=Hs[138]=0,Ws[32]=Ws[138]=0,Js[32]=Js[138]=1,Zs[32]=Zs[138]=0,Ks[32]=Ks[138]=1,fa[128]=fa[42]=0,ga[128]=ga[42]=1,da[128]=da[42]=1,ha[128]=ha[42]=0,la[128]=la[42]=1,pa[128]=pa[42]=0,Vs[128]=Vs[42]=-1,Hs[128]=Hs[42]=0,Ws[128]=Ws[42]=1,Js[128]=Js[42]=-1,Zs[128]=Zs[42]=0,Ks[128]=Ks[42]=0,ea[5]=ea[165]=-1,na[5]=na[165]=0,ra[5]=ra[165]=0,fa[5]=fa[165]=1,ga[5]=ga[165]=0,da[5]=da[165]=0,aa[20]=aa[150]=0,ua[20]=ua[150]=1,ca[20]=ca[150]=1,Js[20]=Js[150]=0,Zs[20]=Zs[150]=-1,Ks[20]=Ks[150]=1,Qs[80]=Qs[90]=-1,$s[80]=$s[90]=0,ta[80]=ta[90]=1,ha[80]=ha[90]=1,la[80]=la[90]=0,pa[80]=pa[90]=1,ia[65]=ia[105]=0,oa[65]=oa[105]=1,sa[65]=sa[105]=0,Vs[65]=Vs[105]=0,Hs[65]=Hs[105]=-1,Ws[65]=Ws[105]=0,Qs[160]=Qs[10]=-1,$s[160]=$s[10]=0,ta[160]=ta[10]=1,ea[160]=ea[10]=-1,na[160]=na[10]=0,ra[160]=ra[10]=0,fa[160]=fa[10]=1,ga[160]=ga[10]=0,da[160]=da[10]=0,ha[160]=ha[10]=1,la[160]=la[10]=0,pa[160]=pa[10]=1,aa[130]=aa[40]=0,ua[130]=ua[40]=1,ca[130]=ca[40]=1,ia[130]=ia[40]=0,oa[130]=oa[40]=1,sa[130]=sa[40]=0,Vs[130]=Vs[40]=0,Hs[130]=Hs[40]=-1,Ws[130]=Ws[40]=0,Js[130]=Js[40]=0,Zs[130]=Zs[40]=-1,Ks[130]=Ks[40]=1,ea[37]=ea[133]=0,na[37]=na[133]=1,ra[37]=ra[133]=1,fa[37]=fa[133]=0,ga[37]=ga[133]=1,da[37]=da[133]=0,Vs[37]=Vs[133]=-1,Hs[37]=Hs[133]=0,Ws[37]=Ws[133]=0,Js[37]=Js[133]=1,Zs[37]=Zs[133]=0,Ks[37]=Ks[133]=0,aa[148]=aa[22]=-1,ua[148]=ua[22]=0,ca[148]=ca[22]=0,fa[148]=fa[22]=0,ga[148]=ga[22]=-1,da[148]=da[22]=1,ha[148]=ha[22]=0,la[148]=la[22]=1,pa[148]=pa[22]=1,Js[148]=Js[22]=-1,Zs[148]=Zs[22]=0,Ks[148]=Ks[22]=1,Qs[82]=Qs[88]=0,$s[82]=$s[88]=-1,ta[82]=ta[88]=1,aa[82]=aa[88]=1,ua[82]=ua[88]=0,ca[82]=ca[88]=1,ia[82]=ia[88]=-1,oa[82]=oa[88]=0,sa[82]=sa[88]=1,ha[82]=ha[88]=0,la[82]=la[88]=-1,pa[82]=pa[88]=0,Qs[73]=Qs[97]=0,$s[73]=$s[97]=1,ta[73]=ta[97]=0,ea[73]=ea[97]=0,na[73]=na[97]=-1,ra[73]=ra[97]=0,ia[73]=ia[97]=1,oa[73]=oa[97]=0,sa[73]=sa[97]=0,Vs[73]=Vs[97]=1,Hs[73]=Hs[97]=0,Ws[73]=Ws[97]=1,Qs[145]=Qs[25]=0,$s[145]=$s[25]=-1,ta[145]=ta[25]=0,ia[145]=ia[25]=1,oa[145]=oa[25]=0,sa[145]=sa[25]=1,fa[145]=fa[25]=0,ga[145]=ga[25]=1,da[145]=da[25]=1,Js[145]=Js[25]=-1,Zs[145]=Zs[25]=0,Ks[145]=Ks[25]=0,ea[70]=ea[100]=0,na[70]=na[100]=1,ra[70]=ra[100]=0,aa[70]=aa[100]=-1,ua[70]=ua[100]=0,ca[70]=ca[100]=1,ha[70]=ha[100]=0,la[70]=la[100]=-1,pa[70]=pa[100]=1,Vs[70]=Vs[100]=1,Hs[70]=Hs[100]=0,Ws[70]=Ws[100]=0,ea[101]=ea[69]=0,na[101]=na[69]=1,ra[101]=ra[69]=0,Vs[101]=Vs[69]=1,Hs[101]=Hs[69]=0,Ws[101]=Ws[69]=0,fa[149]=fa[21]=0,ga[149]=ga[21]=1,da[149]=da[21]=1,Js[149]=Js[21]=-1,Zs[149]=Zs[21]=0,Ks[149]=Ks[21]=0,aa[86]=aa[84]=-1,ua[86]=ua[84]=0,ca[86]=ca[84]=1,ha[86]=ha[84]=0,la[86]=la[84]=-1,pa[86]=pa[84]=1,Qs[89]=Qs[81]=0,$s[89]=$s[81]=-1,ta[89]=ta[81]=0,ia[89]=ia[81]=1,oa[89]=oa[81]=0,sa[89]=sa[81]=1,Qs[96]=Qs[74]=0,$s[96]=$s[74]=1,ta[96]=ta[74]=0,ea[96]=ea[74]=-1,na[96]=na[74]=0,ra[96]=ra[74]=1,ha[96]=ha[74]=1,la[96]=la[74]=0,pa[96]=pa[74]=0,Vs[96]=Vs[74]=1,Hs[96]=Hs[74]=0,Ws[96]=Ws[74]=1,Qs[24]=Qs[146]=0,$s[24]=$s[146]=-1,ta[24]=ta[146]=1,aa[24]=aa[146]=1,ua[24]=ua[146]=0,ca[24]=ca[146]=1,ia[24]=ia[146]=0,oa[24]=oa[146]=1,sa[24]=sa[146]=1,Js[24]=Js[146]=0,Zs[24]=Zs[146]=-1,Ks[24]=Ks[146]=0,ea[6]=ea[164]=-1,na[6]=na[164]=0,ra[6]=ra[164]=1,aa[6]=aa[164]=-1,ua[6]=ua[164]=0,ca[6]=ca[164]=0,fa[6]=fa[164]=0,ga[6]=ga[164]=-1,da[6]=da[164]=1,ha[6]=ha[164]=1,la[6]=la[164]=0,pa[6]=pa[164]=0,ia[129]=ia[41]=0,oa[129]=oa[41]=1,sa[129]=sa[41]=1,fa[129]=fa[41]=0,ga[129]=ga[41]=1,da[129]=da[41]=0,Vs[129]=Vs[41]=-1,Hs[129]=Hs[41]=0,Ws[129]=Ws[41]=0,Js[129]=Js[41]=0,Zs[129]=Zs[41]=-1,Ks[129]=Ks[41]=0,aa[66]=aa[104]=0,ua[66]=ua[104]=1,ca[66]=ca[104]=0,ia[66]=ia[104]=-1,oa[66]=oa[104]=0,sa[66]=sa[104]=1,ha[66]=ha[104]=0,la[66]=la[104]=-1,pa[66]=pa[104]=0,Vs[66]=Vs[104]=0,Hs[66]=Hs[104]=-1,Ws[66]=Ws[104]=1,Qs[144]=Qs[26]=-1,$s[144]=$s[26]=0,ta[144]=ta[26]=0,fa[144]=fa[26]=1,ga[144]=ga[26]=0,da[144]=da[26]=1,ha[144]=ha[26]=0,la[144]=la[26]=1,pa[144]=pa[26]=1,Js[144]=Js[26]=-1,Zs[144]=Zs[26]=0,Ks[144]=Ks[26]=1,ea[36]=ea[134]=0,na[36]=na[134]=1,ra[36]=ra[134]=1,aa[36]=aa[134]=0,ua[36]=ua[134]=1,ca[36]=ca[134]=0,Vs[36]=Vs[134]=0,Hs[36]=Hs[134]=-1,Ws[36]=Ws[134]=1,Js[36]=Js[134]=1,Zs[36]=Zs[134]=0,Ks[36]=Ks[134]=0,Qs[9]=Qs[161]=-1,$s[9]=$s[161]=0,ta[9]=ta[161]=0,ea[9]=ea[161]=0,na[9]=na[161]=-1,ra[9]=ra[161]=0,ia[9]=ia[161]=1,oa[9]=oa[161]=0,sa[9]=sa[161]=0,fa[9]=fa[161]=1,ga[9]=ga[161]=0,da[9]=da[161]=1,Qs[136]=0,$s[136]=1,ta[136]=1,ea[136]=0,na[136]=1,ra[136]=0,aa[136]=-1,ua[136]=0,ca[136]=1,ia[136]=-1,oa[136]=0,sa[136]=0,fa[136]=0,ga[136]=-1,da[136]=0,ha[136]=0,la[136]=-1,pa[136]=1,Vs[136]=1,Hs[136]=0,Ws[136]=0,Js[136]=1,Zs[136]=0,Ks[136]=1,Qs[34]=0,$s[34]=-1,ta[34]=0,ea[34]=0,na[34]=-1,ra[34]=1,aa[34]=1,ua[34]=0,ca[34]=0,ia[34]=1,oa[34]=0,sa[34]=1,fa[34]=0,ga[34]=1,da[34]=1,ha[34]=0,la[34]=1,pa[34]=0,Vs[34]=-1,Hs[34]=0,Ws[34]=1,Js[34]=-1,Zs[34]=0,Ks[34]=0,Qs[35]=0,$s[35]=1,ta[35]=1,ea[35]=0,na[35]=-1,ra[35]=1,aa[35]=1,ua[35]=0,ca[35]=0,ia[35]=-1,oa[35]=0,sa[35]=0,fa[35]=0,ga[35]=-1,da[35]=0,ha[35]=0,la[35]=1,pa[35]=0,Vs[35]=-1,Hs[35]=0,Ws[35]=1,Js[35]=1,Zs[35]=0,Ks[35]=1,Qs[153]=0,$s[153]=1,ta[153]=1,ia[153]=-1,oa[153]=0,sa[153]=0,fa[153]=0,ga[153]=-1,da[153]=0,Js[153]=1,Zs[153]=0,Ks[153]=1,ea[102]=0,na[102]=-1,ra[102]=1,aa[102]=1,ua[102]=0,ca[102]=0,ha[102]=0,la[102]=1,pa[102]=0,Vs[102]=-1,Hs[102]=0,Ws[102]=1,Qs[155]=0,$s[155]=-1,ta[155]=0,ia[155]=1,oa[155]=0,sa[155]=1,fa[155]=0,ga[155]=1,da[155]=1,Js[155]=-1,Zs[155]=0,Ks[155]=0,ea[103]=0,na[103]=1,ra[103]=0,aa[103]=-1,ua[103]=0,ca[103]=1,ha[103]=0,la[103]=-1,pa[103]=1,Vs[103]=1,Hs[103]=0,Ws[103]=0,Qs[152]=0,$s[152]=1,ta[152]=1,aa[152]=-1,ua[152]=0,ca[152]=1,ia[152]=-1,oa[152]=0,sa[152]=0,fa[152]=0,ga[152]=-1,da[152]=0,ha[152]=0,la[152]=-1,pa[152]=1,Js[152]=1,Zs[152]=0,Ks[152]=1,Qs[156]=0,$s[156]=-1,ta[156]=1,aa[156]=1,ua[156]=0,ca[156]=1,ia[156]=-1,oa[156]=0,sa[156]=0,fa[156]=0,ga[156]=-1,da[156]=0,ha[156]=0,la[156]=1,pa[156]=1,Js[156]=-1,Zs[156]=0,Ks[156]=1,Qs[137]=0,$s[137]=1,ta[137]=1,ea[137]=0,na[137]=1,ra[137]=0,ia[137]=-1,oa[137]=0,sa[137]=0,fa[137]=0,ga[137]=-1,da[137]=0,Vs[137]=1,Hs[137]=0,Ws[137]=0,Js[137]=1,Zs[137]=0,Ks[137]=1,Qs[139]=0,$s[139]=1,ta[139]=1,ea[139]=0,na[139]=-1,ra[139]=0,ia[139]=1,oa[139]=0,sa[139]=0,fa[139]=0,ga[139]=1,da[139]=0,Vs[139]=-1,Hs[139]=0,Ws[139]=0,Js[139]=1,Zs[139]=0,Ks[139]=1,Qs[98]=0,$s[98]=-1,ta[98]=0,ea[98]=0,na[98]=-1,ra[98]=1,aa[98]=1,ua[98]=0,ca[98]=0,ia[98]=1,oa[98]=0,sa[98]=1,ha[98]=0,la[98]=1,pa[98]=0,Vs[98]=-1,Hs[98]=0,Ws[98]=1,Qs[99]=0,$s[99]=1,ta[99]=0,ea[99]=0,na[99]=-1,ra[99]=1,aa[99]=1,ua[99]=0,ca[99]=0,ia[99]=-1,oa[99]=0,sa[99]=1,ha[99]=0,la[99]=-1,pa[99]=0,Vs[99]=1,Hs[99]=0,Ws[99]=1,ea[38]=0,na[38]=-1,ra[38]=1,aa[38]=1,ua[38]=0,ca[38]=0,fa[38]=0,ga[38]=1,da[38]=1,ha[38]=0,la[38]=1,pa[38]=0,Vs[38]=-1,Hs[38]=0,Ws[38]=1,Js[38]=-1,Zs[38]=0,Ks[38]=0,ea[39]=0,na[39]=1,ra[39]=1,aa[39]=-1,ua[39]=0,ca[39]=0,fa[39]=0,ga[39]=-1,da[39]=1,ha[39]=0,la[39]=1,pa[39]=0,Vs[39]=-1,Hs[39]=0,Ws[39]=1,Js[39]=1,Zs[39]=0,Ks[39]=0;var ya=function(t){return[[t.bottomleft,0],[0,0],[0,t.leftbottom]]},_a=function(t){return[[1,t.rightbottom],[1,0],[t.bottomright,0]]},ma=function(t){return[[t.topright,1],[1,1],[1,t.righttop]]},va=function(t){return[[0,t.lefttop],[0,1],[t.topleft,1]]},xa=function(t){return[[t.bottomright,0],[t.bottomleft,0],[0,t.leftbottom],[0,t.lefttop]]},Ea=function(t){return[[t.bottomright,0],[t.bottomleft,0],[1,t.righttop],[1,t.rightbottom]]},wa=function(t){return[[1,t.righttop],[1,t.rightbottom],[t.topleft,1],[t.topright,1]]},ba=function(t){return[[0,t.leftbottom],[0,t.lefttop],[t.topleft,1],[t.topright,1]]},Ia=[],Na=[],Ca=[],Sa=[],Ma=[],La=[],Pa=[],Oa=[];Sa[1]=Ma[1]=18,Sa[169]=Ma[169]=18,Ca[4]=Na[4]=12,Ca[166]=Na[166]=12,Ia[16]=Oa[16]=4,Ia[154]=Oa[154]=4,La[64]=Pa[64]=22,La[106]=Pa[106]=22,Ca[2]=La[2]=17,Sa[2]=Ma[2]=18,Ca[168]=La[168]=17,Sa[168]=Ma[168]=18,Ia[8]=Sa[8]=9,Na[8]=Ca[8]=12,Ia[162]=Sa[162]=9,Na[162]=Ca[162]=12,Ia[32]=Oa[32]=4,Na[32]=Pa[32]=1,Ia[138]=Oa[138]=4,Na[138]=Pa[138]=1,Ma[128]=Oa[128]=21,La[128]=Pa[128]=22,Ma[42]=Oa[42]=21,La[42]=Pa[42]=22,Na[5]=Ma[5]=14,Na[165]=Ma[165]=14,Ca[20]=Oa[20]=6,Ca[150]=Oa[150]=6,Ia[80]=La[80]=11,Ia[90]=La[90]=11,Sa[65]=Pa[65]=3,Sa[105]=Pa[105]=3,Ia[160]=La[160]=11,Na[160]=Ma[160]=14,Ia[10]=La[10]=11,Na[10]=Ma[10]=14,Ca[130]=Oa[130]=6,Sa[130]=Pa[130]=3,Ca[40]=Oa[40]=6,Sa[40]=Pa[40]=3,Na[101]=Pa[101]=1,Na[69]=Pa[69]=1,Ma[149]=Oa[149]=21,Ma[21]=Oa[21]=21,Ca[86]=La[86]=17,Ca[84]=La[84]=17,Ia[89]=Sa[89]=9,Ia[81]=Sa[81]=9,Ia[96]=Pa[96]=0,Na[96]=La[96]=15,Ia[74]=Pa[74]=0,Na[74]=La[74]=15,Ia[24]=Ca[24]=8,Sa[24]=Oa[24]=7,Ia[146]=Ca[146]=8,Sa[146]=Oa[146]=7,Na[6]=La[6]=15,Ca[6]=Ma[6]=16,Na[164]=La[164]=15,Ca[164]=Ma[164]=16,Sa[129]=Oa[129]=7,Ma[129]=Pa[129]=20,Sa[41]=Oa[41]=7,Ma[41]=Pa[41]=20,Ca[66]=Pa[66]=2,Sa[66]=La[66]=19,Ca[104]=Pa[104]=2,Sa[104]=La[104]=19,Ia[144]=Ma[144]=10,La[144]=Oa[144]=23,Ia[26]=Ma[26]=10,La[26]=Oa[26]=23,Na[36]=Oa[36]=5,Ca[36]=Pa[36]=2,Na[134]=Oa[134]=5,Ca[134]=Pa[134]=2,Ia[9]=Ma[9]=10,Na[9]=Sa[9]=13,Ia[161]=Ma[161]=10,Na[161]=Sa[161]=13,Na[37]=Oa[37]=5,Ma[37]=Pa[37]=20,Na[133]=Oa[133]=5,Ma[133]=Pa[133]=20,Ca[148]=Ma[148]=16,La[148]=Oa[148]=23,Ca[22]=Ma[22]=16,La[22]=Oa[22]=23,Ia[82]=Ca[82]=8,Sa[82]=La[82]=19,Ia[88]=Ca[88]=8,Sa[88]=La[88]=19,Ia[73]=Pa[73]=0,Na[73]=Sa[73]=13,Ia[97]=Pa[97]=0,Na[97]=Sa[97]=13,Ia[145]=Sa[145]=9,Ma[145]=Oa[145]=21,Ia[25]=Sa[25]=9,Ma[25]=Oa[25]=21,Na[70]=Pa[70]=1,Ca[70]=La[70]=17,Na[100]=Pa[100]=1,Ca[100]=La[100]=17,Ia[34]=Sa[34]=9,Na[34]=Ca[34]=12,Ma[34]=Oa[34]=21,La[34]=Pa[34]=22,Ia[136]=Oa[136]=4,Na[136]=Pa[136]=1,Ca[136]=La[136]=17,Sa[136]=Ma[136]=18,Ia[35]=Oa[35]=4,Na[35]=Ca[35]=12,Sa[35]=Ma[35]=18,La[35]=Pa[35]=22,Ia[153]=Oa[153]=4,Sa[153]=Ma[153]=18,Na[102]=Ca[102]=12,La[102]=Pa[102]=22,Ia[155]=Sa[155]=9,Ma[155]=Oa[155]=23,Na[103]=Pa[103]=1,Ca[103]=La[103]=17,Ia[152]=Oa[152]=4,Ca[152]=La[152]=17,Sa[152]=Ma[152]=18,Ia[156]=Ca[156]=8,Sa[156]=Ma[156]=18,La[156]=Oa[156]=23,Ia[137]=Oa[137]=4,Na[137]=Pa[137]=1,Sa[137]=Ma[137]=18,Ia[139]=Oa[139]=4,Na[139]=Sa[139]=13,Ma[139]=Pa[139]=20,Ia[98]=Sa[98]=9,Na[98]=Ca[98]=12,La[98]=Pa[98]=22,Ia[99]=Pa[99]=0,Na[99]=Ca[99]=12,Sa[99]=La[99]=19,Na[38]=Ca[38]=12,Ma[38]=Oa[38]=21,La[38]=Pa[38]=22,Na[39]=Oa[39]=5,Ca[39]=Ma[39]=16,La[39]=Pa[39]=22;var Ra=[];Ra[1]=Ra[169]=ya,Ra[4]=Ra[166]=_a,Ra[16]=Ra[154]=ma,Ra[64]=Ra[106]=va,Ra[168]=Ra[2]=xa,Ra[162]=Ra[8]=Ea,Ra[138]=Ra[32]=wa,Ra[42]=Ra[128]=ba,Ra[5]=Ra[165]=function(t){return[[0,0],[0,t.leftbottom],[1,t.rightbottom],[1,0]]},Ra[20]=Ra[150]=function(t){return[[1,0],[t.bottomright,0],[t.topright,1],[1,1]]},Ra[80]=Ra[90]=function(t){return[[1,1],[1,t.righttop],[0,t.lefttop],[0,1]]},Ra[65]=Ra[105]=function(t){return[[t.bottomleft,0],[0,0],[0,1],[t.topleft,1]]},Ra[160]=Ra[10]=function(t){return[[1,t.righttop],[1,t.rightbottom],[0,t.leftbottom],[0,t.lefttop]]},Ra[130]=Ra[40]=function(t){return[[t.topleft,1],[t.topright,1],[t.bottomright,0],[t.bottomleft,0]]},Ra[85]=function(){return[[0,0],[0,1],[1,1],[1,0]]},Ra[101]=Ra[69]=function(t){return[[1,t.rightbottom],[1,0],[0,0],[0,1],[t.topleft,1]]},Ra[149]=Ra[21]=function(t){return[[t.topright,1],[1,1],[1,0],[0,0],[0,t.leftbottom]]},Ra[86]=Ra[84]=function(t){return[[1,0],[t.bottomright,0],[0,t.lefttop],[0,1],[1,1]]},Ra[89]=Ra[81]=function(t){return[[1,1],[1,t.righttop],[t.bottomleft,0],[0,0],[0,1]]},Ra[96]=Ra[74]=function(t){return[[1,t.righttop],[1,t.rightbottom],[0,t.lefttop],[0,1],[t.topleft,1]]},Ra[24]=Ra[146]=function(t){return[[1,1],[1,t.righttop],[t.bottomright,0],[t.bottomleft,0],[t.topright,1]]},Ra[6]=Ra[164]=function(t){return[[1,t.rightbottom],[1,0],[t.bottomright,0],[0,t.leftbottom],[0,t.lefttop]]},Ra[129]=Ra[41]=function(t){return[[t.topright,1],[t.bottomleft,0],[0,0],[0,t.leftbottom],[t.topleft,1]]},Ra[66]=Ra[104]=function(t){return[[t.bottomright,0],[t.bottomleft,0],[0,t.lefttop],[0,1],[t.topleft,1]]},Ra[144]=Ra[26]=function(t){return[[1,1],[1,t.righttop],[0,t.leftbottom],[0,t.lefttop],[t.topright,1]]},Ra[36]=Ra[134]=function(t){return[[1,t.rightbottom],[1,0],[t.bottomright,0],[t.topleft,1],[t.topright,1]]},Ra[9]=Ra[161]=function(t){return[[1,t.righttop],[1,t.rightbottom],[t.bottomleft,0],[0,0],[0,t.leftbottom]]},Ra[37]=Ra[133]=function(t){return[[1,t.rightbottom],[1,0],[0,0],[0,t.leftbottom],[t.topleft,1],[t.topright,1]]},Ra[148]=Ra[22]=function(t){return[[1,1],[1,0],[t.bottomright,0],[0,t.leftbottom],[0,t.lefttop],[t.topright,1]]},Ra[82]=Ra[88]=function(t){return[[1,1],[1,t.righttop],[t.bottomright,0],[t.bottomleft,0],[0,t.lefttop],[0,1]]},Ra[73]=Ra[97]=function(t){return[[1,t.righttop],[1,t.rightbottom],[t.bottomleft,0],[0,0],[0,1],[t.topleft,1]]},Ra[145]=Ra[25]=function(t){return[[1,1],[1,t.righttop],[t.bottomleft,0],[0,0],[0,t.leftbottom],[t.topright,1]]},Ra[70]=Ra[100]=function(t){return[[1,t.rightbottom],[1,0],[t.bottomright,0],[0,t.lefttop],[0,1],[t.topleft,1]]},Ra[34]=function(t){return[ba(t),Ea(t)]},Ra[35]=function(t){return[[1,t.righttop],[1,t.rightbottom],[t.bottomright,0],[t.bottomleft,0],[0,t.leftbottom],[0,t.lefttop],[t.topleft,1],[t.topright,1]]},Ra[136]=function(t){return[wa(t),xa(t)]},Ra[153]=function(t){return[ma(t),ya(t)]},Ra[102]=function(t){return[_a(t),va(t)]},Ra[155]=function(t){return[[1,1],[1,t.righttop],[t.bottomleft,0],[0,0],[0,t.leftbottom],[t.topright,1]]},Ra[103]=function(t){return[[1,t.rightbottom],[1,0],[t.bottomright,0],[0,t.lefttop],[0,1],[t.topleft,1]]},Ra[152]=function(t){return[ma(t),xa(t)]},Ra[156]=function(t){return[[1,1],[1,t.righttop],[t.bottomright,0],[t.bottomleft,0],[0,t.leftbottom],[0,t.lefttop],[t.topright,1]]},Ra[137]=function(t){return[wa(t),ya(t)]},Ra[139]=function(t){return[[1,t.righttop],[1,t.rightbottom],[t.bottomleft,0],[0,0],[0,t.leftbottom],[t.topleft,1],[t.topright,1]]},Ra[98]=function(t){return[Ea(t),va(t)]},Ra[99]=function(t){return[[1,t.righttop],[1,t.rightbottom],[t.bottomright,0],[t.bottomleft,0],[0,t.lefttop],[0,1],[t.topleft,1]]},Ra[38]=function(t){return[_a(t),ba(t)]},Ra[39]=function(t){return[[1,t.rightbottom],[1,0],[t.bottomright,0],[0,t.leftbottom],[0,t.lefttop],[t.topleft,1],[t.topright,1]]};var Ta=function t(e){this.id=t.buildId(e),this.coordinates=e,this.innerEdges=[],this.outerEdges=[],this.outerEdgesSorted=!1};Ta.buildId=function(t){return t.join(",")},Ta.prototype.removeInnerEdge=function(t){this.innerEdges=this.innerEdges.filter((function(e){return e.from.id!==t.from.id}))},Ta.prototype.removeOuterEdge=function(t){this.outerEdges=this.outerEdges.filter((function(e){return e.to.id!==t.to.id}))},Ta.prototype.addOuterEdge=function(t){this.outerEdges.push(t),this.outerEdgesSorted=!1},Ta.prototype.sortOuterEdges=function(){var t=this;this.outerEdgesSorted||(this.outerEdges.sort((function(e,n){var r=e.to,i=n.to;if(r.coordinates[0]-t.coordinates[0]>=0&&i.coordinates[0]-t.coordinates[0]<0)return 1;if(r.coordinates[0]-t.coordinates[0]<0&&i.coordinates[0]-t.coordinates[0]>=0)return-1;if(r.coordinates[0]-t.coordinates[0]==0&&i.coordinates[0]-t.coordinates[0]==0)return r.coordinates[1]-t.coordinates[1]>=0||i.coordinates[1]-t.coordinates[1]>=0?r.coordinates[1]-i.coordinates[1]:i.coordinates[1]-r.coordinates[1];var o=xr(t.coordinates,r.coordinates,i.coordinates);return o<0?1:o>0?-1:Math.pow(r.coordinates[0]-t.coordinates[0],2)+Math.pow(r.coordinates[1]-t.coordinates[1],2)-(Math.pow(i.coordinates[0]-t.coordinates[0],2)+Math.pow(i.coordinates[1]-t.coordinates[1],2))})),this.outerEdgesSorted=!0)},Ta.prototype.getOuterEdges=function(){return this.sortOuterEdges(),this.outerEdges},Ta.prototype.getOuterEdge=function(t){return this.sortOuterEdges(),this.outerEdges[t]},Ta.prototype.addInnerEdge=function(t){this.innerEdges.push(t)};var Aa=function(t,e){this.from=t,this.to=e,this.next=void 0,this.label=void 0,this.symetric=void 0,this.ring=void 0,this.from.addOuterEdge(this),this.to.addInnerEdge(this)};Aa.prototype.getSymetric=function(){return this.symetric||(this.symetric=new Aa(this.to,this.from),this.symetric.symetric=this),this.symetric},Aa.prototype.deleteEdge=function(){this.from.removeOuterEdge(this),this.to.removeInnerEdge(this)},Aa.prototype.isEqual=function(t){return this.from.id===t.from.id&&this.to.id===t.to.id},Aa.prototype.toString=function(){return"Edge { "+this.from.id+" -> "+this.to.id+" }"},Aa.prototype.toLineString=function(){return a([this.from.coordinates,this.to.coordinates])},Aa.prototype.compareTo=function(t){return xr(t.from.coordinates,t.to.coordinates,this.to.coordinates)};var Da=function(){this.edges=[],this.polygon=void 0,this.envelope=void 0},Fa={length:{configurable:!0}};Da.prototype.push=function(t){this[this.edges.length]=t,this.edges.push(t),this.polygon=this.envelope=void 0},Da.prototype.get=function(t){return this.edges[t]},Fa.length.get=function(){return this.edges.length},Da.prototype.forEach=function(t){this.edges.forEach(t)},Da.prototype.map=function(t){return this.edges.map(t)},Da.prototype.some=function(t){return this.edges.some(t)},Da.prototype.isValid=function(){return!0},Da.prototype.isHole=function(){var t=this,e=this.edges.reduce((function(e,n,r){return n.from.coordinates[1]>t.edges[e].from.coordinates[1]&&(e=r),e}),0),n=(0===e?this.length:e)-1,r=(e+1)%this.length,i=xr(this.edges[n].from.coordinates,this.edges[e].from.coordinates,this.edges[r].from.coordinates);return 0===i?this.edges[n].from.coordinates[0]>this.edges[r].from.coordinates[0]:i>0},Da.prototype.toMultiPoint=function(){return l(this.edges.map((function(t){return t.from.coordinates})))},Da.prototype.toPolygon=function(){if(this.polygon)return this.polygon;var t=this.edges.map((function(t){return t.from.coordinates}));return t.push(this.edges[0].from.coordinates),this.polygon=o([t])},Da.prototype.getEnvelope=function(){return this.envelope?this.envelope:this.envelope=he(this.toPolygon())},Da.findEdgeRingContaining=function(t,e){var n,i,o=t.getEnvelope();return e.forEach((function(e){var s=e.getEnvelope();if(i&&(n=i.getEnvelope()),!function(t,e){var n=t.geometry.coordinates.map((function(t){return t[0]})),r=t.geometry.coordinates.map((function(t){return t[1]})),i=e.geometry.coordinates.map((function(t){return t[0]})),o=e.geometry.coordinates.map((function(t){return t[1]}));return Math.max(null,n)===Math.max(null,i)&&Math.max(null,r)===Math.max(null,o)&&Math.min(null,n)===Math.min(null,i)&&Math.min(null,r)===Math.min(null,o)}(s,o)&&Er(s,o)){var a=t.map((function(t){return t.from.coordinates})).find((function(t){return!e.some((function(e){return function(t,e){return t[0]===e[0]&&t[1]===e[1]}(t,e.from.coordinates)}))}));a&&e.inside(r(a))&&(i&&!Er(n,s)||(i=e))}})),i},Da.prototype.inside=function(t){return Pt(t,this.toPolygon())},Object.defineProperties(Da.prototype,Fa);var qa=function(){this.edges=[],this.nodes={}};qa.fromGeoJson=function(t){!function(t){if(!t)throw new Error("No geojson passed");if("FeatureCollection"!==t.type&&"GeometryCollection"!==t.type&&"MultiLineString"!==t.type&&"LineString"!==t.type&&"Feature"!==t.type)throw new Error("Invalid input type '"+t.type+"'. Geojson must be FeatureCollection, GeometryCollection, LineString, MultiLineString or Feature")}(t);var e=new qa;return F(t,(function(t){H(t,"LineString","Graph::fromGeoJson"),M(t,(function(t,n){if(t){var r=e.getNode(t),i=e.getNode(n);e.addEdge(r,i)}return n}))})),e},qa.prototype.getNode=function(t){var e=Ta.buildId(t),n=this.nodes[e];return n||(n=this.nodes[e]=new Ta(t)),n},qa.prototype.addEdge=function(t,e){var n=new Aa(t,e),r=n.getSymetric();this.edges.push(n),this.edges.push(r)},qa.prototype.deleteDangles=function(){var t=this;Object.keys(this.nodes).map((function(e){return t.nodes[e]})).forEach((function(e){return t._removeIfDangle(e)}))},qa.prototype._removeIfDangle=function(t){var e=this;if(t.innerEdges.length<=1){var n=t.getOuterEdges().map((function(t){return t.to}));this.removeNode(t),n.forEach((function(t){return e._removeIfDangle(t)}))}},qa.prototype.deleteCutEdges=function(){var t=this;this._computeNextCWEdges(),this._findLabeledEdgeRings(),this.edges.forEach((function(e){e.label===e.symetric.label&&(t.removeEdge(e.symetric),t.removeEdge(e))}))},qa.prototype._computeNextCWEdges=function(t){var e=this;void 0===t?Object.keys(this.nodes).forEach((function(t){return e._computeNextCWEdges(e.nodes[t])})):t.getOuterEdges().forEach((function(e,n){t.getOuterEdge((0===n?t.getOuterEdges().length:n)-1).symetric.next=e}))},qa.prototype._computeNextCCWEdges=function(t,e){for(var n,r,i=t.getOuterEdges(),o=i.length-1;o>=0;--o){var s=i[o],a=s.symetric,u=void 0,c=void 0;s.label===e&&(u=s),a.label===e&&(c=a),u&&c&&(c&&(r=c),u&&(r&&(r.next=u,r=void 0),n||(n=u)))}r&&(r.next=n)},qa.prototype._findLabeledEdgeRings=function(){var t=[],e=0;return this.edges.forEach((function(n){if(!(n.label>=0)){t.push(n);var r=n;do{r.label=e,r=r.next}while(!n.isEqual(r));e++}})),t},qa.prototype.getEdgeRings=function(){var t=this;this._computeNextCWEdges(),this.edges.forEach((function(t){t.label=void 0})),this._findLabeledEdgeRings().forEach((function(e){t._findIntersectionNodes(e).forEach((function(n){t._computeNextCCWEdges(n,e.label)}))}));var e=[];return this.edges.forEach((function(n){n.ring||e.push(t._findEdgeRing(n))})),e},qa.prototype._findIntersectionNodes=function(t){var e=[],n=t,r=function(){var r=0;n.from.getOuterEdges().forEach((function(e){e.label===t.label&&++r})),r>1&&e.push(n.from),n=n.next};do{r()}while(!t.isEqual(n));return e},qa.prototype._findEdgeRing=function(t){var e=t,n=new Da;do{n.push(e),e.ring=n,e=e.next}while(!t.isEqual(e));return n},qa.prototype.removeNode=function(t){var e=this;t.getOuterEdges().forEach((function(t){return e.removeEdge(t)})),t.innerEdges.forEach((function(t){return e.removeEdge(t)})),delete this.nodes[t.id]},qa.prototype.removeEdge=function(t){this.edges=this.edges.filter((function(e){return!e.isEqual(t)})),t.deleteEdge()};var Ga=mt((function(t,e){function n(t){var e=[];for(var n in t)e.push(n);return e}(t.exports="function"==typeof Object.keys?Object.keys:n).shim=n})),Ba=(Ga.shim,mt((function(t,e){function n(t){return"[object Arguments]"==Object.prototype.toString.call(t)}function r(t){return t&&"object"==typeof t&&"number"==typeof t.length&&Object.prototype.hasOwnProperty.call(t,"callee")&&!Object.prototype.propertyIsEnumerable.call(t,"callee")||!1}var i="[object Arguments]"==function(){return Object.prototype.toString.call(arguments)}();(e=t.exports=i?n:r).supported=n,e.unsupported=r}))),ka=(Ba.supported,Ba.unsupported,mt((function(t){function e(t){return null===t||void 0===t}function n(t){return!(!t||"object"!=typeof t||"number"!=typeof t.length)&&"function"==typeof t.copy&&"function"==typeof t.slice&&!(t.length>0&&"number"!=typeof t[0])}var r=Array.prototype.slice,i=t.exports=function(t,o,s){return s||(s={}),t===o||(t instanceof Date&&o instanceof Date?t.getTime()===o.getTime():!t||!o||"object"!=typeof t&&"object"!=typeof o?s.strict?t===o:t==o:function(t,o,s){var a,u;if(e(t)||e(o))return!1;if(t.prototype!==o.prototype)return!1;if(Ba(t))return!!Ba(o)&&(t=r.call(t),o=r.call(o),i(t,o,s));if(n(t)){if(!n(o))return!1;if(t.length!==o.length)return!1;for(a=0;a<t.length;a++)if(t[a]!==o[a])return!1;return!0}try{var c=Ga(t),h=Ga(o)}catch(t){return!1}if(c.length!=h.length)return!1;for(c.sort(),h.sort(),a=c.length-1;a>=0;a--)if(c[a]!=h[a])return!1;for(a=c.length-1;a>=0;a--)if(u=c[a],!i(t[u],o[u],s))return!1;return typeof t==typeof o}(t,o,s))}}))),za=function(t){this.precision=t&&t.precision?t.precision:17,this.direction=!(!t||!t.direction)&&t.direction,this.pseudoNode=!(!t||!t.pseudoNode)&&t.pseudoNode,this.objectComparator=t&&t.objectComparator?t.objectComparator:Rr};za.prototype.compare=function(t,e){if(t.type!==e.type||!Or(t,e))return!1;switch(t.type){case"Point":return this.compareCoord(t.coordinates,e.coordinates);case"LineString":return this.compareLine(t.coordinates,e.coordinates,0,!1);case"Polygon":return this.comparePolygon(t,e);case"Feature":return this.compareFeature(t,e);default:if(0===t.type.indexOf("Multi")){var n=this,r=Pr(t),i=Pr(e);return r.every((function(t){return this.some((function(e){return n.compare(t,e)}))}),i)}}return!1},za.prototype.compareCoord=function(t,e){if(t.length!==e.length)return!1;for(var n=0;n<t.length;n++)if(t[n].toFixed(this.precision)!==e[n].toFixed(this.precision))return!1;return!0},za.prototype.compareLine=function(t,e,n,r){if(!Or(t,e))return!1;var i=this.pseudoNode?t:this.removePseudo(t),o=this.pseudoNode?e:this.removePseudo(e);if(!r||this.compareCoord(i[0],o[0])||(o=this.fixStartIndex(o,i))){var s=this.compareCoord(i[n],o[n]);return this.direction||s?this.comparePath(i,o):!!this.compareCoord(i[n],o[o.length-(1+n)])&&this.comparePath(i.slice().reverse(),o)}},za.prototype.fixStartIndex=function(t,e){for(var n,r=-1,i=0;i<t.length;i++)if(this.compareCoord(t[i],e[0])){r=i;break}return r>=0&&(n=[].concat(t.slice(r,t.length),t.slice(1,r+1))),n},za.prototype.comparePath=function(t,e){var n=this;return t.every((function(t,e){return n.compareCoord(t,this[e])}),e)},za.prototype.comparePolygon=function(t,e){if(this.compareLine(t.coordinates[0],e.coordinates[0],1,!0)){var n=t.coordinates.slice(1,t.coordinates.length),r=e.coordinates.slice(1,e.coordinates.length),i=this;return n.every((function(t){return this.some((function(e){return i.compareLine(t,e,1,!0)}))}),r)}return!1},za.prototype.compareFeature=function(t,e){return!(t.id!==e.id||!this.objectComparator(t.properties,e.properties)||!this.compareBBox(t,e))&&this.compare(t.geometry,e.geometry)},za.prototype.compareBBox=function(t,e){return!!(!t.bbox&&!e.bbox||t.bbox&&e.bbox&&this.compareCoord(t.bbox,e.bbox))},za.prototype.removePseudo=function(t){return t};var ja=za,Xa=mt((function(t){function e(t,e,n,r){this.dataset=[],this.epsilon=1,this.minPts=2,this.distance=this._euclideanDistance,this.clusters=[],this.noise=[],this._visited=[],this._assigned=[],this._datasetLength=0,this._init(t,e,n,r)}e.prototype.run=function(t,e,n,r){this._init(t,e,n,r);for(var i=0;i<this._datasetLength;i++)if(1!==this._visited[i]){this._visited[i]=1;var o=this._regionQuery(i);if(o.length<this.minPts)this.noise.push(i);else{var s=this.clusters.length;this.clusters.push([]),this._addToCluster(i,s),this._expandCluster(s,o)}}return this.clusters},e.prototype._init=function(t,e,n,r){if(t){if(!(t instanceof Array))throw Error("Dataset must be of type array, "+typeof t+" given");this.dataset=t,this.clusters=[],this.noise=[],this._datasetLength=t.length,this._visited=new Array(this._datasetLength),this._assigned=new Array(this._datasetLength)}e&&(this.epsilon=e),n&&(this.minPts=n),r&&(this.distance=r)},e.prototype._expandCluster=function(t,e){for(var n=0;n<e.length;n++){var r=e[n];if(1!==this._visited[r]){this._visited[r]=1;var i=this._regionQuery(r);i.length>=this.minPts&&(e=this._mergeArrays(e,i))}1!==this._assigned[r]&&this._addToCluster(r,t)}},e.prototype._addToCluster=function(t,e){this.clusters[e].push(t),this._assigned[t]=1},e.prototype._regionQuery=function(t){for(var e=[],n=0;n<this._datasetLength;n++)this.distance(this.dataset[t],this.dataset[n])<this.epsilon&&e.push(n);return e},e.prototype._mergeArrays=function(t,e){for(var n=e.length,r=0;r<n;r++){var i=e[r];t.indexOf(i)<0&&t.push(i)}return t},e.prototype._euclideanDistance=function(t,e){for(var n=0,r=Math.min(t.length,e.length);r--;)n+=(t[r]-e[r])*(t[r]-e[r]);return Math.sqrt(n)},t.exports&&(t.exports=e)})),Ua=mt((function(t){function e(t,e,n){this.k=3,this.dataset=[],this.assignments=[],this.centroids=[],this.init(t,e,n)}e.prototype.init=function(t,e,n){this.assignments=[],this.centroids=[],void 0!==t&&(this.dataset=t),void 0!==e&&(this.k=e),void 0!==n&&(this.distance=n)},e.prototype.run=function(t,e){this.init(t,e);for(var n=this.dataset.length,r=0;r<this.k;r++)this.centroids[r]=this.randomCentroid();for(var i=!0;i;){i=this.assign();for(var o=0;o<this.k;o++){for(var s=new Array(h),a=0,u=0;u<h;u++)s[u]=0;for(var c=0;c<n;c++){var h=this.dataset[c].length;if(o===this.assignments[c]){for(u=0;u<h;u++)s[u]+=this.dataset[c][u];a++}}if(a>0){for(u=0;u<h;u++)s[u]/=a;this.centroids[o]=s}else this.centroids[o]=this.randomCentroid(),i=!0}}return this.getClusters()},e.prototype.randomCentroid=function(){var t,e,n=this.dataset.length-1;do{e=Math.round(Math.random()*n),t=this.dataset[e]}while(this.centroids.indexOf(t)>=0);return t},e.prototype.assign=function(){for(var t,e=!1,n=this.dataset.length,r=0;r<n;r++)(t=this.argmin(this.dataset[r],this.centroids,this.distance))!=this.assignments[r]&&(this.assignments[r]=t,e=!0);return e},e.prototype.getClusters=function(){for(var t,e=new Array(this.k),n=0;n<this.assignments.length;n++)void 0===e[t=this.assignments[n]]&&(e[t]=[]),e[t].push(n);return e},e.prototype.argmin=function(t,e,n){for(var r,i=Number.MAX_VALUE,o=0,s=e.length,a=0;a<s;a++)(r=n(t,e[a]))<i&&(i=r,o=a);return o},e.prototype.distance=function(t,e){for(var n=0,r=Math.min(t.length,e.length);r--;){var i=t[r]-e[r];n+=i*i}return Math.sqrt(n)},t.exports&&(t.exports=e)})),Ya=mt((function(t){function e(t,e,n){this._queue=[],this._priorities=[],this._sorting="desc",this._init(t,e,n)}e.prototype.insert=function(t,e){for(var n=this._queue.length,r=n;r--;){var i=this._priorities[r];"desc"===this._sorting?e>i&&(n=r):e<i&&(n=r)}this._insertAt(t,e,n)},e.prototype.remove=function(t){for(var e=this._queue.length;e--;)if(t===this._queue[e]){this._queue.splice(e,1),this._priorities.splice(e,1);break}},e.prototype.forEach=function(t){this._queue.forEach(t)},e.prototype.getElements=function(){return this._queue},e.prototype.getElementPriority=function(t){return this._priorities[t]},e.prototype.getPriorities=function(){return this._priorities},e.prototype.getElementsWithPriorities=function(){for(var t=[],e=0,n=this._queue.length;e<n;e++)t.push([this._queue[e],this._priorities[e]]);return t},e.prototype._init=function(t,e,n){if(t&&e){if(this._queue=[],this._priorities=[],t.length!==e.length)throw new Error("Arrays must have the same length");for(var r=0;r<t.length;r++)this.insert(t[r],e[r])}n&&(this._sorting=n)},e.prototype._insertAt=function(t,e,n){this._queue.length===n?(this._queue.push(t),this._priorities.push(e)):(this._queue.splice(n,0,t),this._priorities.splice(n,0,e))},t.exports&&(t.exports=e)})),Va=mt((function(t){function e(t,e,n,r){this.epsilon=1,this.minPts=1,this.distance=this._euclideanDistance,this._reachability=[],this._processed=[],this._coreDistance=0,this._orderedList=[],this._init(t,e,n,r)}if(t.exports)var n=Ya;e.prototype.run=function(t,e,r,i){this._init(t,e,r,i);for(var o=0,s=this.dataset.length;o<s;o++)if(1!==this._processed[o]){this._processed[o]=1,this.clusters.push([o]);var a=this.clusters.length-1;this._orderedList.push(o);var u=new n(null,null,"asc"),c=this._regionQuery(o);void 0!==this._distanceToCore(o)&&(this._updateQueue(o,c,u),this._expandCluster(a,u))}return this.clusters},e.prototype.getReachabilityPlot=function(){for(var t=[],e=0,n=this._orderedList.length;e<n;e++){var r=this._orderedList[e],i=this._reachability[r];t.push([r,i])}return t},e.prototype._init=function(t,e,n,r){if(t){if(!(t instanceof Array))throw Error("Dataset must be of type array, "+typeof t+" given");this.dataset=t,this.clusters=[],this._reachability=new Array(this.dataset.length),this._processed=new Array(this.dataset.length),this._coreDistance=0,this._orderedList=[]}e&&(this.epsilon=e),n&&(this.minPts=n),r&&(this.distance=r)},e.prototype._updateQueue=function(t,e,n){var r=this;this._coreDistance=this._distanceToCore(t),e.forEach((function(e){if(void 0===r._processed[e]){var i=r.distance(r.dataset[t],r.dataset[e]),o=Math.max(r._coreDistance,i);void 0===r._reachability[e]?(r._reachability[e]=o,n.insert(e,o)):o<r._reachability[e]&&(r._reachability[e]=o,n.remove(e),n.insert(e,o))}}))},e.prototype._expandCluster=function(t,e){for(var n=e.getElements(),r=0,i=n.length;r<i;r++){var o=n[r];if(void 0===this._processed[o]){var s=this._regionQuery(o);this._processed[o]=1,this.clusters[t].push(o),this._orderedList.push(o),void 0!==this._distanceToCore(o)&&(this._updateQueue(o,s,e),this._expandCluster(t,e))}}},e.prototype._distanceToCore=function(t){for(var e=this.epsilon,n=0;n<e;n++)if(this._regionQuery(t,n).length>=this.minPts)return n},e.prototype._regionQuery=function(t,e){e=e||this.epsilon;for(var n=[],r=0,i=this.dataset.length;r<i;r++)this.distance(this.dataset[t],this.dataset[r])<e&&n.push(r);return n},e.prototype._euclideanDistance=function(t,e){for(var n=0,r=Math.min(t.length,e.length);r--;)n+=(t[r]-e[r])*(t[r]-e[r]);return Math.sqrt(n)},t.exports&&(t.exports=e)})),Ha=mt((function(t){t.exports&&(t.exports={DBSCAN:Xa,KMEANS:Ua,OPTICS:Va,PriorityQueue:Ya})})),Wa=(Ha.DBSCAN,Ha.KMEANS,Ha.OPTICS,Ha.PriorityQueue,function(t,e,n){for(var r=t.length,i=0,o=0;o<r;o++){var s=(t[o]||0)-(e[o]||0);i+=s*s}return n?Math.sqrt(i):i}),Ja=Wa,Za=function(t,e,n){var r=Math.abs(t-e);return n?r:r*r},Ka=Wa,Qa=function(t,e){for(var n={},r=[],i=e<<2,o=t.length,s=t[0].length>0;r.length<e&&i-- >0;){var a=t[Math.floor(Math.random()*o)],u=s?a.join("_"):""+a;n[u]||(n[u]=!0,r.push(a))}if(r.length<e)throw new Error("Error initializating clusters");return r},$a=function(t,e){var n=t[0].length?Ja:Za,r=[],i=t.length,o=t[0].length>0,s=t[Math.floor(Math.random()*i)];for(o&&s.join("_"),r.push(s);r.length<e;){for(var a=[],u=r.length,c=0,h=[],l=0;l<i;l++){for(var p=1/0,f=0;f<u;f++){var g=n(t[l],r[f]);g<=p&&(p=g)}a[l]=p}for(var d=0;d<i;d++)c+=a[d];for(var y=0;y<i;y++)h[y]={i:y,v:t[y],pr:a[y]/c,cs:0};h.sort((function(t,e){return t.pr-e.pr})),h[0].cs=h[0].pr;for(var _=1;_<i;_++)h[_].cs=h[_-1].cs+h[_].pr;for(var m=Math.random(),v=0;v<i-1&&h[v++].cs<m;);r.push(h[v-1].v)}return r},tu=1e4,eu=function(t,e,n,r){var i=[],o=[],s=[],a=[],u=!1,c=r||tu,h=t.length,l=t[0].length,p=l>0,f=[];if(n)i="kmrand"==n?Qa(t,e):"kmpp"==n?$a(t,e):n;else for(var g={};i.length<e;){var d=Math.floor(Math.random()*h);g[d]||(g[d]=!0,i.push(t[d]))}do{Ar(e,0,f);for(var y=0;y<h;y++){for(var _=1/0,m=0,v=0;v<e;v++)(a=p?Ka(t[y],i[v]):Math.abs(t[y]-i[v]))<=_&&(_=a,m=v);s[y]=m,f[m]++}for(var x=[],E=(o=[],0);E<e;E++)x[E]=p?Ar(l,0,x[E]):0,o[E]=i[E];if(p){for(var w=0;w<e;w++)i[w]=[];for(var b=0;b<h;b++)for(var I=x[s[b]],N=t[b],C=0;C<l;C++)I[C]+=N[C];u=!0;for(var S=0;S<e;S++){for(var M=i[S],L=x[S],P=o[S],O=f[S],R=0;R<l;R++)M[R]=L[R]/O||0;if(u)for(var T=0;T<l;T++)if(P[T]!=M[T]){u=!1;break}}}else{for(var A=0;A<h;A++)x[s[A]]+=t[A];for(var D=0;D<e;D++)i[D]=x[D]/f[D]||0;u=!0;for(var F=0;F<e;F++)if(o[F]!=i[F]){u=!1;break}}u=u||--c<=0}while(!u);return{it:tu-c,k:e,idxs:s,centroids:i}},nu={search:function(t,e,n,r){t.cleanDirty();var i=(r=r||{}).heuristic||nu.heuristics.manhattan,o=r.closest||!1,s=new Br((function(t){return t.f})),a=e;for(e.h=i(e,n),s.push(e);s.size()>0;){var u=s.pop();if(u===n)return Fr(u);u.closed=!0;for(var c=t.neighbors(u),h=0,l=c.length;h<l;++h){var p=c[h];if(!p.closed&&!p.isWall()){var f=u.g+p.getCost(u),g=p.visited;(!g||f<p.g)&&(p.visited=!0,p.parent=u,p.h=p.h||i(p,n),p.g=f,p.f=p.g+p.h,t.markDirty(p),o&&(p.h<a.h||p.h===a.h&&p.g<a.g)&&(a=p),g?s.rescoreElement(p):s.push(p))}}}return o?Fr(a):[]},heuristics:{manhattan:function(t,e){return Math.abs(e.x-t.x)+Math.abs(e.y-t.y)},diagonal:function(t,e){var n=Math.sqrt(2),r=Math.abs(e.x-t.x),i=Math.abs(e.y-t.y);return 1*(r+i)+(n-2)*Math.min(r,i)}},cleanNode:function(t){t.f=0,t.g=0,t.h=0,t.visited=!1,t.closed=!1,t.parent=null}};qr.prototype.init=function(){this.dirtyNodes=[];for(var t=0;t<this.nodes.length;t++)nu.cleanNode(this.nodes[t])},qr.prototype.cleanDirty=function(){for(var t=0;t<this.dirtyNodes.length;t++)nu.cleanNode(this.dirtyNodes[t]);this.dirtyNodes=[]},qr.prototype.markDirty=function(t){this.dirtyNodes.push(t)},qr.prototype.neighbors=function(t){var e=[],n=t.x,r=t.y,i=this.grid;return i[n-1]&&i[n-1][r]&&e.push(i[n-1][r]),i[n+1]&&i[n+1][r]&&e.push(i[n+1][r]),i[n]&&i[n][r-1]&&e.push(i[n][r-1]),i[n]&&i[n][r+1]&&e.push(i[n][r+1]),this.diagonal&&(i[n-1]&&i[n-1][r-1]&&e.push(i[n-1][r-1]),i[n+1]&&i[n+1][r-1]&&e.push(i[n+1][r-1]),i[n-1]&&i[n-1][r+1]&&e.push(i[n-1][r+1]),i[n+1]&&i[n+1][r+1]&&e.push(i[n+1][r+1])),e},qr.prototype.toString=function(){for(var t,e,n,r,i=[],o=this.grid,s=0,a=o.length;s<a;s++){for(t=[],n=0,r=(e=o[s]).length;n<r;n++)t.push(e[n].weight);i.push(t.join(" "))}return i.join("\n")},Gr.prototype.toString=function(){return"["+this.x+" "+this.y+"]"},Gr.prototype.getCost=function(t){return t&&t.x!==this.x&&t.y!==this.y?1.41421*this.weight:this.weight},Gr.prototype.isWall=function(){return 0===this.weight},Br.prototype={push:function(t){this.content.push(t),this.sinkDown(this.content.length-1)},pop:function(){var t=this.content[0],e=this.content.pop();return this.content.length>0&&(this.content[0]=e,this.bubbleUp(0)),t},remove:function(t){var e=this.content.indexOf(t),n=this.content.pop();e!==this.content.length-1&&(this.content[e]=n,this.scoreFunction(n)<this.scoreFunction(t)?this.sinkDown(e):this.bubbleUp(e))},size:function(){return this.content.length},rescoreElement:function(t){this.sinkDown(this.content.indexOf(t))},sinkDown:function(t){for(var e=this.content[t];t>0;){var n=(t+1>>1)-1,r=this.content[n];if(!(this.scoreFunction(e)<this.scoreFunction(r)))break;this.content[n]=e,this.content[t]=r,t=n}},bubbleUp:function(t){for(var e=this.content.length,n=this.content[t],r=this.scoreFunction(n);;){var i,o=t+1<<1,s=o-1,a=null;if(s<e){var u=this.content[s];(i=this.scoreFunction(u))<r&&(a=s)}if(o<e){var c=this.content[o];this.scoreFunction(c)<(null===a?r:i)&&(a=o)}if(null===a)break;this.content[t]=this.content[a],this.content[a]=n,t=a}}};var ru=function(t){return function(){return t}};jr.prototype={constructor:jr,insert:function(t,e){var n,r,i;if(t){if(e.P=t,e.N=t.N,t.N&&(t.N.P=e),t.N=e,t.R){for(t=t.R;t.L;)t=t.L;t.L=e}else t.R=e;n=t}else this._?(t=Vr(this._),e.P=null,e.N=t,t.P=t.L=e,n=t):(e.P=e.N=null,this._=e,n=null);for(e.L=e.R=null,e.U=n,e.C=!0,t=e;n&&n.C;)n===(r=n.U).L?(i=r.R)&&i.C?(n.C=i.C=!1,r.C=!0,t=r):(t===n.R&&(Ur(this,n),n=(t=n).U),n.C=!1,r.C=!0,Yr(this,r)):(i=r.L)&&i.C?(n.C=i.C=!1,r.C=!0,t=r):(t===n.L&&(Yr(this,n),n=(t=n).U),n.C=!1,r.C=!0,Ur(this,r)),n=t.U;this._.C=!1},remove:function(t){t.N&&(t.N.P=t.P),t.P&&(t.P.N=t.N),t.N=t.P=null;var e,n,r,i=t.U,o=t.L,s=t.R;if(n=o?s?Vr(s):o:s,i?i.L===t?i.L=n:i.R=n:this._=n,o&&s?(r=n.C,n.C=t.C,n.L=o,o.U=n,n!==s?(i=n.U,n.U=t.U,t=n.R,i.L=t,n.R=s,s.U=n):(n.U=i,i=n,t=n.R)):(r=t.C,t=n),t&&(t.U=i),!r)if(t&&t.C)t.C=!1;else{do{if(t===this._)break;if(t===i.L){if((e=i.R).C&&(e.C=!1,i.C=!0,Ur(this,i),e=i.R),e.L&&e.L.C||e.R&&e.R.C){e.R&&e.R.C||(e.L.C=!1,e.C=!0,Yr(this,e),e=i.R),e.C=i.C,i.C=e.R.C=!1,Ur(this,i),t=this._;break}}else if((e=i.L).C&&(e.C=!1,i.C=!0,Yr(this,i),e=i.L),e.L&&e.L.C||e.R&&e.R.C){e.L&&e.L.C||(e.R.C=!1,e.C=!0,Ur(this,e),e=i.L),e.C=i.C,i.C=e.L.C=!1,Yr(this,i),t=this._;break}e.C=!0,t=i,i=i.U}while(!t.C);t&&(t.C=!1)}}};var iu,ou,su,au,uu,cu=[],hu=[],lu=1e-6,pu=1e-12;hi.prototype={constructor:hi,polygons:function(){var t=this.edges;return this.cells.map((function(e){var n=e.halfedges.map((function(n){return $r(e,t[n])}));return n.data=e.site.data,n}))},triangles:function(){var t=[],e=this.edges;return this.cells.forEach((function(n,r){if(o=(i=n.halfedges).length)for(var i,o,s,a=n.site,u=-1,c=e[i[o-1]],h=c.left===a?c.right:c.left;++u<o;)s=h,h=(c=e[i[u]]).left===a?c.right:c.left,s&&h&&r<s.index&&r<h.index&&ui(a,s,h)<0&&t.push([a.data,s.data,h.data])})),t},links:function(){return this.edges.filter((function(t){return t.right})).map((function(t){return{source:t.left.data,target:t.right.data}}))},find:function(t,e,n){for(var r,i,o=this,s=o._found||0,a=o.cells.length;!(i=o.cells[s]);)if(++s>=a)return null;var u=t-i.site[0],c=e-i.site[1],h=u*u+c*c;do{i=o.cells[r=s],s=null,i.halfedges.forEach((function(n){var r=o.edges[n],a=r.left;if(a!==i.site&&a||(a=r.right)){var u=t-a[0],c=e-a[1],l=u*u+c*c;l<h&&(h=l,s=a.index)}}))}while(null!==s);return o._found=r,null==n||h<=n*n?i.site:null}};var fu=function(){function t(t){return new hi(t.map((function(r,i){var o=[Math.round(e(r,i,t)/lu)*lu,Math.round(n(r,i,t)/lu)*lu];return o.index=i,o.data=r,o})),r)}var e=kr,n=zr,r=null;return t.polygons=function(e){return t(e).polygons()},t.links=function(e){return t(e).links()},t.triangles=function(e){return t(e).triangles()},t.x=function(n){return arguments.length?(e="function"==typeof n?n:ru(+n),t):e},t.y=function(e){return arguments.length?(n="function"==typeof e?e:ru(+e),t):n},t.extent=function(e){return arguments.length?(r=null==e?null:[[+e[0][0],+e[0][1]],[+e[1][0],+e[1][1]]],t):r&&[[r[0][0],r[0][1]],[r[1][0],r[1][1]]]},t.size=function(e){return arguments.length?(r=null==e?null:[[0,0],[+e[0],+e[1]]],t):r&&[r[1][0]-r[0][0],r[1][1]-r[0][1]]},t},gu=Object.freeze({randomPosition:_i,randomPoint:mi,randomPolygon:vi,randomLineString:xi}),du=Object.freeze({getCluster:wi,clusterEach:bi,clusterReduce:Ii,createBins:Ni,applyFilter:Ci,propertiesContainsFilter:Si,filterProperties:Mi});"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);r<i;)e[r]=t,++r;return e},writable:!0}),Number.isFinite=Number.isFinite||function(t){return"number"==typeof t&&isFinite(t)},Number.isInteger=Number.isInteger||function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t},Number.parseFloat=Number.parseFloat||parseFloat,Number.isNaN=Number.isNaN||function(t){return t!=t},Math.trunc=Math.trunc||function(t){return t<0?Math.ceil(t):Math.floor(t)};var yu=function(){};yu.prototype.interfaces_=function(){return[]},yu.prototype.getClass=function(){return yu},yu.prototype.equalsWithTolerance=function(t,e,n){return Math.abs(t-e)<=n};var _u=function(){},mu=function(){},vu={MAX_VALUE:{configurable:!0}};mu.isNaN=function(t){return Number.isNaN(t)},mu.doubleToLongBits=function(t){return t},mu.longBitsToDouble=function(t){return t},mu.isInfinite=function(t){return!Number.isFinite(t)},vu.MAX_VALUE.get=function(){return Number.MAX_VALUE},Object.defineProperties(mu,vu);var xu=function(){},Eu=function(){},wu=function(){},bu=function t(){if(this.x=null,this.y=null,this.z=null,0===arguments.length)this.x=0,this.y=0,this.z=t.NULL_ORDINATE;else if(1===arguments.length){var e=arguments[0];this.x=e.x,this.y=e.y,this.z=e.z}else 2===arguments.length?(this.x=arguments[0],this.y=arguments[1],this.z=t.NULL_ORDINATE):3===arguments.length&&(this.x=arguments[0],this.y=arguments[1],this.z=arguments[2])},Iu={DimensionalComparator:{configurable:!0},serialVersionUID:{configurable:!0},NULL_ORDINATE:{configurable:!0},X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0}};bu.prototype.setOrdinate=function(t,e){switch(t){case bu.X:this.x=e;break;case bu.Y:this.y=e;break;case bu.Z:this.z=e;break;default:throw new _u("Invalid ordinate index: "+t)}},bu.prototype.equals2D=function(){if(1===arguments.length){var t=arguments[0];return this.x===t.x&&this.y===t.y}if(2===arguments.length){var e=arguments[0],n=arguments[1];return!!yu.equalsWithTolerance(this.x,e.x,n)&&!!yu.equalsWithTolerance(this.y,e.y,n)}},bu.prototype.getOrdinate=function(t){switch(t){case bu.X:return this.x;case bu.Y:return this.y;case bu.Z:return this.z}throw new _u("Invalid ordinate index: "+t)},bu.prototype.equals3D=function(t){return this.x===t.x&&this.y===t.y&&(this.z===t.z||mu.isNaN(this.z))&&mu.isNaN(t.z)},bu.prototype.equals=function(t){return t instanceof bu&&this.equals2D(t)},bu.prototype.equalInZ=function(t,e){return yu.equalsWithTolerance(this.z,t.z,e)},bu.prototype.compareTo=function(t){var e=t;return this.x<e.x?-1:this.x>e.x?1:this.y<e.y?-1:this.y>e.y?1:0},bu.prototype.clone=function(){},bu.prototype.copy=function(){return new bu(this)},bu.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},bu.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)},bu.prototype.distance=function(t){var e=this.x-t.x,n=this.y-t.y;return Math.sqrt(e*e+n*n)},bu.prototype.hashCode=function(){var t=17;return 37*(t=37*t+bu.hashCode(this.x))+bu.hashCode(this.y)},bu.prototype.setCoordinate=function(t){this.x=t.x,this.y=t.y,this.z=t.z},bu.prototype.interfaces_=function(){return[xu,Eu,Li]},bu.prototype.getClass=function(){return bu},bu.hashCode=function(){if(1===arguments.length){var t=arguments[0],e=mu.doubleToLongBits(t);return Math.trunc((e^e)>>>32)}},Iu.DimensionalComparator.get=function(){return Nu},Iu.serialVersionUID.get=function(){return 0x5cbf2c235c7e5800},Iu.NULL_ORDINATE.get=function(){return mu.NaN},Iu.X.get=function(){return 0},Iu.Y.get=function(){return 1},Iu.Z.get=function(){return 2},Object.defineProperties(bu,Iu);var Nu=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 _u("only 2 or 3 dimensions may be specified");this._dimensionsToTest=e}};Nu.prototype.compare=function(t,e){var n=t,r=e,i=Nu.compare(n.x,r.x);if(0!==i)return i;var o=Nu.compare(n.y,r.y);return 0!==o?o:this._dimensionsToTest<=2?0:Nu.compare(n.z,r.z)},Nu.prototype.interfaces_=function(){return[wu]},Nu.prototype.getClass=function(){return Nu},Nu.compare=function(t,e){return t<e?-1:t>e?1:mu.isNaN(t)?mu.isNaN(e)?0:-1:mu.isNaN(e)?1:0};var Cu=function(){};Cu.prototype.create=function(){},Cu.prototype.interfaces_=function(){return[]},Cu.prototype.getClass=function(){return Cu};var Su=function(){},Mu={INTERIOR:{configurable:!0},BOUNDARY:{configurable:!0},EXTERIOR:{configurable:!0},NONE:{configurable:!0}};Su.prototype.interfaces_=function(){return[]},Su.prototype.getClass=function(){return Su},Su.toLocationSymbol=function(t){switch(t){case Su.EXTERIOR:return"e";case Su.BOUNDARY:return"b";case Su.INTERIOR:return"i";case Su.NONE:return"-"}throw new _u("Unknown location value: "+t)},Mu.INTERIOR.get=function(){return 0},Mu.BOUNDARY.get=function(){return 1},Mu.EXTERIOR.get=function(){return 2},Mu.NONE.get=function(){return-1},Object.defineProperties(Su,Mu);var Lu=function(t,e){return t.interfaces_&&t.interfaces_().indexOf(e)>-1},Pu=function(){},Ou={LOG_10:{configurable:!0}};Pu.prototype.interfaces_=function(){return[]},Pu.prototype.getClass=function(){return Pu},Pu.log10=function(t){var e=Math.log(t);return mu.isInfinite(e)||mu.isNaN(e)?e:e/Pu.LOG_10},Pu.min=function(t,e,n,r){var i=t;return e<i&&(i=e),n<i&&(i=n),r<i&&(i=r),i},Pu.clamp=function(){if("number"==typeof arguments[2]&&"number"==typeof arguments[0]&&"number"==typeof arguments[1]){var t=arguments[0],e=arguments[1],n=arguments[2];return t<e?e:t>n?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 r<i?i:r>o?o:r}},Pu.wrap=function(t,e){return t<0?e- -t%e:t%e},Pu.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}},Pu.average=function(t,e){return(t+e)/2},Ou.LOG_10.get=function(){return Math.log(10)},Object.defineProperties(Pu,Ou);var Ru=function(t){this.str=t};Ru.prototype.append=function(t){this.str+=t},Ru.prototype.setCharAt=function(t,e){this.str=this.str.substr(0,t)+e+this.str.substr(t+1)},Ru.prototype.toString=function(t){return this.str};var Tu=function(t){this.value=t};Tu.prototype.intValue=function(){return this.value},Tu.prototype.compareTo=function(t){return this.value<t?-1:this.value>t?1:0},Tu.isNaN=function(t){return Number.isNaN(t)};var Au=function(){};Au.isWhitespace=function(t){return t<=32&&t>=0||127===t},Au.toUpperCase=function(t){return t.toUpperCase()};var Du=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)}},Fu={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}};Du.prototype.le=function(t){return(this._hi<t._hi||this._hi===t._hi)&&this._lo<=t._lo},Du.prototype.extractSignificantDigits=function(t,e){var n=this.abs(),r=Du.magnitude(n._hi),i=Du.TEN.pow(r);(n=n.divide(i)).gt(Du.TEN)?(n=n.divide(Du.TEN),r+=1):n.lt(Du.ONE)&&(n=n.multiply(Du.TEN),r-=1);for(var o=r+1,s=new Ru,a=Du.MAX_PRINT_DIGITS-1,u=0;u<=a;u++){t&&u===o&&s.append(".");var c=Math.trunc(n._hi);if(c<0)break;var h=!1,l=0;c>9?(h=!0,l="9"):l="0"+c,s.append(l),n=n.subtract(Du.valueOf(c)).multiply(Du.TEN),h&&n.selfAdd(Du.TEN);var p=!0,f=Du.magnitude(n._hi);if(f<0&&Math.abs(f)>=a-u&&(p=!1),!p)break}return e[0]=r,s.toString()},Du.prototype.sqr=function(){return this.multiply(this)},Du.prototype.doubleValue=function(){return this._hi+this._lo},Du.prototype.subtract=function(){if(arguments[0]instanceof Du){var t=arguments[0];return this.add(t.negate())}if("number"==typeof arguments[0]){var e=arguments[0];return this.add(-e)}},Du.prototype.equals=function(){if(1===arguments.length){var t=arguments[0];return this._hi===t._hi&&this._lo===t._lo}},Du.prototype.isZero=function(){return 0===this._hi&&0===this._lo},Du.prototype.selfSubtract=function(){if(arguments[0]instanceof Du){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)}},Du.prototype.getSpecialNumberString=function(){return this.isZero()?"0.0":this.isNaN()?"NaN ":null},Du.prototype.min=function(t){return this.le(t)?this:t},Du.prototype.selfDivide=function(){if(1===arguments.length){if(arguments[0]instanceof Du){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,c=null,h=null,l=null;return u=this._hi/n,l=(i=(c=Du.SPLIT*u)-(i=c-u))*(s=(l=Du.SPLIT*n)-(s=l-n))-(h=u*n)+i*(a=n-s)+(o=u-i)*s+o*a,l=u+(c=(this._hi-h-l+this._lo-u*r)/n),this._hi=l,this._lo=u-l+c,this}},Du.prototype.dump=function(){return"DD<"+this._hi+", "+this._lo+">"},Du.prototype.divide=function(){if(arguments[0]instanceof Du){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=Du.SPLIT*o)-(e=s-o)),u=e*(r=(u=Du.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 Du(u=o+s,o-u+s)}if("number"==typeof arguments[0]){var c=arguments[0];return mu.isNaN(c)?Du.createNaN():Du.copy(this).selfDivide(c,0)}},Du.prototype.ge=function(t){return(this._hi>t._hi||this._hi===t._hi)&&this._lo>=t._lo},Du.prototype.pow=function(t){if(0===t)return Du.valueOf(1);var e=new Du(this),n=Du.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},Du.prototype.ceil=function(){if(this.isNaN())return Du.NaN;var t=Math.ceil(this._hi),e=0;return t===this._hi&&(e=Math.ceil(this._lo)),new Du(t,e)},Du.prototype.compareTo=function(t){var e=t;return this._hi<e._hi?-1:this._hi>e._hi?1:this._lo<e._lo?-1:this._lo>e._lo?1:0},Du.prototype.rint=function(){return this.isNaN()?this:this.add(.5).floor()},Du.prototype.setValue=function(){if(arguments[0]instanceof Du){var t=arguments[0];return this.init(t),this}if("number"==typeof arguments[0]){var e=arguments[0];return this.init(e),this}},Du.prototype.max=function(t){return this.ge(t)?this:t},Du.prototype.sqrt=function(){if(this.isZero())return Du.valueOf(0);if(this.isNegative())return Du.NaN;var t=1/Math.sqrt(this._hi),e=this._hi*t,n=Du.valueOf(e),r=this.subtract(n.sqr())._hi*(.5*t);return n.add(r)},Du.prototype.selfAdd=function(){if(1===arguments.length){if(arguments[0]instanceof Du){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],c=arguments[1],h=null,l=null,p=null,f=null,g=null,d=null,y=null;f=this._hi+u,l=this._lo+c,g=f-(d=f-this._hi),p=l-(y=l-this._lo);var _=(h=f+(d=(g=u-d+(this._hi-g))+l))+(d=(p=c-y+(this._lo-p))+(d+(f-h))),m=d+(h-_);return this._hi=_,this._lo=m,this}},Du.prototype.selfMultiply=function(){if(1===arguments.length){if(arguments[0]instanceof Du){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,c=null;i=(u=Du.SPLIT*this._hi)-this._hi,c=Du.SPLIT*n,i=u-i,o=this._hi-i,s=c-n;var h=(u=this._hi*n)+(c=i*(s=c-s)-u+i*(a=n-s)+o*s+o*a+(this._hi*r+this._lo*n)),l=c+(i=u-h);return this._hi=h,this._lo=l,this}},Du.prototype.selfSqr=function(){return this.selfMultiply(this)},Du.prototype.floor=function(){if(this.isNaN())return Du.NaN;var t=Math.floor(this._hi),e=0;return t===this._hi&&(e=Math.floor(this._lo)),new Du(t,e)},Du.prototype.negate=function(){return this.isNaN()?this:new Du(-this._hi,-this._lo)},Du.prototype.clone=function(){},Du.prototype.multiply=function(){if(arguments[0]instanceof Du){var t=arguments[0];return t.isNaN()?Du.createNaN():Du.copy(this).selfMultiply(t)}if("number"==typeof arguments[0]){var e=arguments[0];return mu.isNaN(e)?Du.createNaN():Du.copy(this).selfMultiply(e,0)}},Du.prototype.isNaN=function(){return mu.isNaN(this._hi)},Du.prototype.intValue=function(){return Math.trunc(this._hi)},Du.prototype.toString=function(){var t=Du.magnitude(this._hi);return t>=-3&&t<=20?this.toStandardNotation():this.toSciNotation()},Du.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."+Du.stringOfChar("0",-r)+n;else if(-1===n.indexOf(".")){var o=r-n.length;i=n+Du.stringOfChar("0",o)+".0"}return this.isNegative()?"-"+i:i},Du.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=Du.SPLIT*i)-(t=o-i)),n=(a=Du.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 Du(u,i-u+o)},Du.prototype.toSciNotation=function(){if(this.isZero())return Du.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=Du.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},Du.prototype.abs=function(){return this.isNaN()?Du.NaN:this.isNegative()?this.negate():new Du(this)},Du.prototype.isPositive=function(){return(this._hi>0||0===this._hi)&&this._lo>0},Du.prototype.lt=function(t){return(this._hi<t._hi||this._hi===t._hi)&&this._lo<t._lo},Du.prototype.add=function(){if(arguments[0]instanceof Du){var t=arguments[0];return Du.copy(this).selfAdd(t)}if("number"==typeof arguments[0]){var e=arguments[0];return Du.copy(this).selfAdd(e)}},Du.prototype.init=function(){if(1===arguments.length){if("number"==typeof arguments[0]){var t=arguments[0];this._hi=t,this._lo=0}else if(arguments[0]instanceof Du){var e=arguments[0];this._hi=e._hi,this._lo=e._lo}}else if(2===arguments.length){var n=arguments[0],r=arguments[1];this._hi=n,this._lo=r}},Du.prototype.gt=function(t){return(this._hi>t._hi||this._hi===t._hi)&&this._lo>t._lo},Du.prototype.isNegative=function(){return(this._hi<0||0===this._hi)&&this._lo<0},Du.prototype.trunc=function(){return this.isNaN()?Du.NaN:this.isPositive()?this.floor():this.ceil()},Du.prototype.signum=function(){return this._hi>0?1:this._hi<0?-1:this._lo>0?1:this._lo<0?-1:0},Du.prototype.interfaces_=function(){return[Li,xu,Eu]},Du.prototype.getClass=function(){return Du},Du.sqr=function(t){return Du.valueOf(t).selfMultiply(t)},Du.valueOf=function(){if("string"==typeof arguments[0]){var t=arguments[0];return Du.parse(t)}if("number"==typeof arguments[0])return new Du(arguments[0])},Du.sqrt=function(t){return Du.valueOf(t).sqrt()},Du.parse=function(t){for(var e=0,n=t.length;Au.isWhitespace(t.charAt(e));)e++;var r=!1;if(e<n){var i=t.charAt(e);"-"!==i&&"+"!==i||(e++,"-"===i&&(r=!0))}for(var o=new Du,s=0,a=0,u=0;!(e>=n);){var c=t.charAt(e);if(e++,Au.isDigit(c)){var h=c-"0";o.selfMultiply(Du.TEN),o.selfAdd(h),s++}else{if("."!==c){if("e"===c||"E"===c){var l=t.substring(e);try{u=Tu.parseInt(l)}catch(e){throw e instanceof Error?new Error("Invalid exponent "+l+" in string "+t):e}break}throw new Error("Unexpected character '"+c+"' 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 g=Du.TEN.pow(f);p=o.divide(g)}else if(f<0){var d=Du.TEN.pow(-f);p=o.multiply(d)}return r?p.negate():p},Du.createNaN=function(){return new Du(mu.NaN,mu.NaN)},Du.copy=function(t){return new Du(t)},Du.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},Du.stringOfChar=function(t,e){for(var n=new Ru,r=0;r<e;r++)n.append(t);return n.toString()},Fu.PI.get=function(){return new Du(3.141592653589793,12246467991473532e-32)},Fu.TWO_PI.get=function(){return new Du(6.283185307179586,24492935982947064e-32)},Fu.PI_2.get=function(){return new Du(1.5707963267948966,6123233995736766e-32)},Fu.E.get=function(){return new Du(2.718281828459045,14456468917292502e-32)},Fu.NaN.get=function(){return new Du(mu.NaN,mu.NaN)},Fu.EPS.get=function(){return 123259516440783e-46},Fu.SPLIT.get=function(){return 134217729},Fu.MAX_PRINT_DIGITS.get=function(){return 32},Fu.TEN.get=function(){return Du.valueOf(10)},Fu.ONE.get=function(){return Du.valueOf(1)},Fu.SCI_NOT_EXPONENT_CHAR.get=function(){return"E"},Fu.SCI_NOT_ZERO.get=function(){return"0.0E0"},Object.defineProperties(Du,Fu);var qu=function(){},Gu={DP_SAFE_EPSILON:{configurable:!0}};qu.prototype.interfaces_=function(){return[]},qu.prototype.getClass=function(){return qu},qu.orientationIndex=function(t,e,n){var r=qu.orientationIndexFilter(t,e,n);if(r<=1)return r;var i=Du.valueOf(e.x).selfAdd(-t.x),o=Du.valueOf(e.y).selfAdd(-t.y),s=Du.valueOf(n.x).selfAdd(-e.x),a=Du.valueOf(n.y).selfAdd(-e.y);return i.selfMultiply(a).selfSubtract(o.selfMultiply(s)).signum()},qu.signOfDet2x2=function(t,e,n,r){return t.multiply(r).selfSubtract(e.multiply(n)).signum()},qu.intersection=function(t,e,n,r){var i=Du.valueOf(r.y).selfSubtract(n.y).selfMultiply(Du.valueOf(e.x).selfSubtract(t.x)),o=Du.valueOf(r.x).selfSubtract(n.x).selfMultiply(Du.valueOf(e.y).selfSubtract(t.y)),s=i.subtract(o),a=Du.valueOf(r.x).selfSubtract(n.x).selfMultiply(Du.valueOf(t.y).selfSubtract(n.y)),u=Du.valueOf(r.y).selfSubtract(n.y).selfMultiply(Du.valueOf(t.x).selfSubtract(n.x)),c=a.subtract(u).selfDivide(s).doubleValue(),h=Du.valueOf(t.x).selfAdd(Du.valueOf(e.x).selfSubtract(t.x).selfMultiply(c)).doubleValue(),l=Du.valueOf(e.x).selfSubtract(t.x).selfMultiply(Du.valueOf(t.y).selfSubtract(n.y)),p=Du.valueOf(e.y).selfSubtract(t.y).selfMultiply(Du.valueOf(t.x).selfSubtract(n.x)),f=l.subtract(p).selfDivide(s).doubleValue(),g=Du.valueOf(n.y).selfAdd(Du.valueOf(r.y).selfSubtract(n.y).selfMultiply(f)).doubleValue();return new bu(h,g)},qu.orientationIndexFilter=function(t,e,n){var r=null,i=(t.x-n.x)*(e.y-n.y),o=(t.y-n.y)*(e.x-n.x),s=i-o;if(i>0){if(o<=0)return qu.signum(s);r=i+o}else{if(!(i<0))return qu.signum(s);if(o>=0)return qu.signum(s);r=-i-o}var a=qu.DP_SAFE_EPSILON*r;return s>=a||-s>=a?qu.signum(s):2},qu.signum=function(t){return t>0?1:t<0?-1:0},Gu.DP_SAFE_EPSILON.get=function(){return 1e-15},Object.defineProperties(qu,Gu);var Bu=function(){},ku={X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0},M:{configurable:!0}};ku.X.get=function(){return 0},ku.Y.get=function(){return 1},ku.Z.get=function(){return 2},ku.M.get=function(){return 3},Bu.prototype.setOrdinate=function(t,e,n){},Bu.prototype.size=function(){},Bu.prototype.getOrdinate=function(t,e){},Bu.prototype.getCoordinate=function(){},Bu.prototype.getCoordinateCopy=function(t){},Bu.prototype.getDimension=function(){},Bu.prototype.getX=function(t){},Bu.prototype.clone=function(){},Bu.prototype.expandEnvelope=function(t){},Bu.prototype.copy=function(){},Bu.prototype.getY=function(t){},Bu.prototype.toCoordinateArray=function(){},Bu.prototype.interfaces_=function(){return[Eu]},Bu.prototype.getClass=function(){return Bu},Object.defineProperties(Bu,ku);var zu=function(){},ju=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}(zu),Xu=function(){};Xu.arraycopy=function(t,e,n,r,i){for(var o=0,s=e;s<e+i;s++)n[r+o]=t[s],o++},Xu.getProperty=function(t){return{"line.separator":"\n"}[t]};var Uu=function t(){if(this.x=null,this.y=null,this.w=null,0===arguments.length)this.x=0,this.y=0,this.w=1;else if(1===arguments.length){var e=arguments[0];this.x=e.x,this.y=e.y,this.w=1}else if(2===arguments.length){if("number"==typeof arguments[0]&&"number"==typeof arguments[1]){var n=arguments[0],r=arguments[1];this.x=n,this.y=r,this.w=1}else if(arguments[0]instanceof t&&arguments[1]instanceof t){var i=arguments[0],o=arguments[1];this.x=i.y*o.w-o.y*i.w,this.y=o.x*i.w-i.x*o.w,this.w=i.x*o.y-o.x*i.y}else if(arguments[0]instanceof bu&&arguments[1]instanceof bu){var s=arguments[0],a=arguments[1];this.x=s.y-a.y,this.y=a.x-s.x,this.w=s.x*a.y-a.x*s.y}}else if(3===arguments.length){var u=arguments[0],c=arguments[1],h=arguments[2];this.x=u,this.y=c,this.w=h}else if(4===arguments.length){var l=arguments[0],p=arguments[1],f=arguments[2],g=arguments[3],d=l.y-p.y,y=p.x-l.x,_=l.x*p.y-p.x*l.y,m=f.y-g.y,v=g.x-f.x,x=f.x*g.y-g.x*f.y;this.x=y*x-v*_,this.y=m*_-d*x,this.w=d*v-m*y}};Uu.prototype.getY=function(){var t=this.y/this.w;if(mu.isNaN(t)||mu.isInfinite(t))throw new ju;return t},Uu.prototype.getX=function(){var t=this.x/this.w;if(mu.isNaN(t)||mu.isInfinite(t))throw new ju;return t},Uu.prototype.getCoordinate=function(){var t=new bu;return t.x=this.getX(),t.y=this.getY(),t},Uu.prototype.interfaces_=function(){return[]},Uu.prototype.getClass=function(){return Uu},Uu.intersection=function(t,e,n,r){var i=t.y-e.y,o=e.x-t.x,s=t.x*e.y-e.x*t.y,a=n.y-r.y,u=r.x-n.x,c=n.x*r.y-r.x*n.y,h=i*u-a*o,l=(o*c-u*s)/h,p=(a*s-i*c)/h;if(mu.isNaN(l)||mu.isInfinite(l)||mu.isNaN(p)||mu.isInfinite(p))throw new ju;return new bu(l,p)};var Yu=function t(){if(this._minx=null,this._maxx=null,this._miny=null,this._maxy=null,0===arguments.length)this.init();else if(1===arguments.length){if(arguments[0]instanceof bu){var e=arguments[0];this.init(e.x,e.x,e.y,e.y)}else if(arguments[0]instanceof t){var n=arguments[0];this.init(n)}}else if(2===arguments.length){var r=arguments[0],i=arguments[1];this.init(r.x,i.x,r.y,i.y)}else if(4===arguments.length){var o=arguments[0],s=arguments[1],a=arguments[2],u=arguments[3];this.init(o,s,a,u)}},Vu={serialVersionUID:{configurable:!0}};Yu.prototype.getArea=function(){return this.getWidth()*this.getHeight()},Yu.prototype.equals=function(t){if(!(t instanceof Yu))return!1;var e=t;return this.isNull()?e.isNull():this._maxx===e.getMaxX()&&this._maxy===e.getMaxY()&&this._minx===e.getMinX()&&this._miny===e.getMinY()},Yu.prototype.intersection=function(t){if(this.isNull()||t.isNull()||!this.intersects(t))return new Yu;var e=this._minx>t._minx?this._minx:t._minx,n=this._miny>t._miny?this._miny:t._miny,r=this._maxx<t._maxx?this._maxx:t._maxx,i=this._maxy<t._maxy?this._maxy:t._maxy;return new Yu(e,r,n,i)},Yu.prototype.isNull=function(){return this._maxx<this._minx},Yu.prototype.getMaxX=function(){return this._maxx},Yu.prototype.covers=function(){if(1===arguments.length){if(arguments[0]instanceof bu){var t=arguments[0];return this.covers(t.x,t.y)}if(arguments[0]instanceof Yu){var e=arguments[0];return!this.isNull()&&!e.isNull()&&e.getMinX()>=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}},Yu.prototype.intersects=function(){if(1===arguments.length){if(arguments[0]instanceof Yu){var t=arguments[0];return!this.isNull()&&!t.isNull()&&!(t._minx>this._maxx||t._maxx<this._minx||t._miny>this._maxy||t._maxy<this._miny)}if(arguments[0]instanceof bu){var e=arguments[0];return this.intersects(e.x,e.y)}}else if(2===arguments.length){var n=arguments[0],r=arguments[1];return!this.isNull()&&!(n>this._maxx||n<this._minx||r>this._maxy||r<this._miny)}},Yu.prototype.getMinY=function(){return this._miny},Yu.prototype.getMinX=function(){return this._minx},Yu.prototype.expandToInclude=function(){if(1===arguments.length){if(arguments[0]instanceof bu){var t=arguments[0];this.expandToInclude(t.x,t.y)}else if(arguments[0]instanceof Yu){var e=arguments[0];if(e.isNull())return null;this.isNull()?(this._minx=e.getMinX(),this._maxx=e.getMaxX(),this._miny=e.getMinY(),this._maxy=e.getMaxY()):(e._minx<this._minx&&(this._minx=e._minx),e._maxx>this._maxx&&(this._maxx=e._maxx),e._miny<this._miny&&(this._miny=e._miny),e._maxy>this._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):(n<this._minx&&(this._minx=n),n>this._maxx&&(this._maxx=n),r<this._miny&&(this._miny=r),r>this._maxy&&(this._maxy=r))}},Yu.prototype.minExtent=function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return t<e?t:e},Yu.prototype.getWidth=function(){return this.isNull()?0:this._maxx-this._minx},Yu.prototype.compareTo=function(t){var e=t;return this.isNull()?e.isNull()?0:-1:e.isNull()?1:this._minx<e._minx?-1:this._minx>e._minx?1:this._miny<e._miny?-1:this._miny>e._miny?1:this._maxx<e._maxx?-1:this._maxx>e._maxx?1:this._maxy<e._maxy?-1:this._maxy>e._maxy?1:0},Yu.prototype.translate=function(t,e){if(this.isNull())return null;this.init(this.getMinX()+t,this.getMaxX()+t,this.getMinY()+e,this.getMaxY()+e)},Yu.prototype.toString=function(){return"Env["+this._minx+" : "+this._maxx+", "+this._miny+" : "+this._maxy+"]"},Yu.prototype.setToNull=function(){this._minx=0,this._maxx=-1,this._miny=0,this._maxy=-1},Yu.prototype.getHeight=function(){return this.isNull()?0:this._maxy-this._miny},Yu.prototype.maxExtent=function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return t>e?t:e},Yu.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()}},Yu.prototype.contains=function(){if(1===arguments.length){if(arguments[0]instanceof Yu){var t=arguments[0];return this.covers(t)}if(arguments[0]instanceof bu){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)}},Yu.prototype.centre=function(){return this.isNull()?null:new bu((this.getMinX()+this.getMaxX())/2,(this.getMinY()+this.getMaxY())/2)},Yu.prototype.init=function(){if(0===arguments.length)this.setToNull();else if(1===arguments.length){if(arguments[0]instanceof bu){var t=arguments[0];this.init(t.x,t.x,t.y,t.y)}else if(arguments[0]instanceof Yu){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];i<o?(this._minx=i,this._maxx=o):(this._minx=o,this._maxx=i),s<a?(this._miny=s,this._maxy=a):(this._miny=a,this._maxy=s)}},Yu.prototype.getMaxY=function(){return this._maxy},Yu.prototype.distance=function(t){if(this.intersects(t))return 0;var e=0;this._maxx<t._minx?e=t._minx-this._maxx:this._minx>t._maxx&&(e=this._minx-t._maxx);var n=0;return this._maxy<t._miny?n=t._miny-this._maxy:this._miny>t._maxy&&(n=this._miny-t._maxy),0===e?n:0===n?e:Math.sqrt(e*e+n*n)},Yu.prototype.hashCode=function(){var t=17;return 37*(t=37*(t=37*(t=37*t+bu.hashCode(this._minx))+bu.hashCode(this._maxx))+bu.hashCode(this._miny))+bu.hashCode(this._maxy)},Yu.prototype.interfaces_=function(){return[xu,Li]},Yu.prototype.getClass=function(){return Yu},Yu.intersects=function(){if(3===arguments.length){var t=arguments[0],e=arguments[1],n=arguments[2];return n.x>=(t.x<e.x?t.x:e.x)&&n.x<=(t.x>e.x?t.x:e.x)&&n.y>=(t.y<e.y?t.y:e.y)&&n.y<=(t.y>e.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),c=Math.min(r.x,i.x),h=Math.max(r.x,i.x);return!(c>u)&&!(h<a)&&(a=Math.min(o.y,s.y),u=Math.max(o.y,s.y),c=Math.min(r.y,i.y),h=Math.max(r.y,i.y),!(c>u)&&!(h<a))}},Vu.serialVersionUID.get=function(){return 0x51845cd552189800},Object.defineProperties(Yu,Vu);var Hu={typeStr:/^\s*(\w+)\s*\(\s*(.*)\s*\)\s*$/,emptyTypeStr:/^\s*(\w+)\s*EMPTY\s*$/,spaces:/\s+/,parenComma:/\)\s*,\s*\(/,doubleParenComma:/\)\s*\)\s*,\s*\(\s*\(/,trimParens:/^\s*\(?(.*?)\)?\s*$/},Wu=function(t){this.geometryFactory=t||new _h};Wu.prototype.read=function(t){var e,n,r;t=t.replace(/[\n\r]/g," ");var i=Hu.typeStr.exec(t);if(-1!==t.search("EMPTY")&&((i=Hu.emptyTypeStr.exec(t))[2]=void 0),i&&(n=i[1].toLowerCase(),r=i[2],Zu[n]&&(e=Zu[n].apply(this,[r]))),void 0===e)throw new Error("Could not parse WKT "+t);return e},Wu.prototype.write=function(t){return this.extractGeometry(t)},Wu.prototype.extractGeometry=function(t){var e=t.getGeometryType().toLowerCase();if(!Ju[e])return null;var n=e.toUpperCase();return t.isEmpty()?n+" EMPTY":n+"("+Ju[e].apply(this,[t])+")"};var Ju={coordinate:function(t){return t.x+" "+t.y},point:function(t){return Ju.coordinate.call(this,t._coordinates._coordinates[0])},multipoint:function(t){for(var e=[],n=0,r=t._geometries.length;n<r;++n)e.push("("+Ju.point.apply(this,[t._geometries[n]])+")");return e.join(",")},linestring:function(t){for(var e=[],n=0,r=t._points._coordinates.length;n<r;++n)e.push(Ju.coordinate.apply(this,[t._points._coordinates[n]]));return e.join(",")},linearring:function(t){for(var e=[],n=0,r=t._points._coordinates.length;n<r;++n)e.push(Ju.coordinate.apply(this,[t._points._coordinates[n]]));return e.join(",")},multilinestring:function(t){for(var e=[],n=0,r=t._geometries.length;n<r;++n)e.push("("+Ju.linestring.apply(this,[t._geometries[n]])+")");return e.join(",")},polygon:function(t){var e=[];e.push("("+Ju.linestring.apply(this,[t._shell])+")");for(var n=0,r=t._holes.length;n<r;++n)e.push("("+Ju.linestring.apply(this,[t._holes[n]])+")");return e.join(",")},multipolygon:function(t){for(var e=[],n=0,r=t._geometries.length;n<r;++n)e.push("("+Ju.polygon.apply(this,[t._geometries[n]])+")");return e.join(",")},geometrycollection:function(t){for(var e=[],n=0,r=t._geometries.length;n<r;++n)e.push(this.extractGeometry(t._geometries[n]));return e.join(",")}},Zu={point:function(t){if(void 0===t)return this.geometryFactory.createPoint();var e=t.trim().split(Hu.spaces);return this.geometryFactory.createPoint(new bu(Number.parseFloat(e[0]),Number.parseFloat(e[1])))},multipoint:function(t){if(void 0===t)return this.geometryFactory.createMultiPoint();for(var e,n=t.trim().split(","),r=[],i=0,o=n.length;i<o;++i)e=n[i].replace(Hu.trimParens,"$1"),r.push(Zu.point.apply(this,[e]));return this.geometryFactory.createMultiPoint(r)},linestring:function(t){if(void 0===t)return this.geometryFactory.createLineString();for(var e,n=t.trim().split(","),r=[],i=0,o=n.length;i<o;++i)e=n[i].trim().split(Hu.spaces),r.push(new bu(Number.parseFloat(e[0]),Number.parseFloat(e[1])));return this.geometryFactory.createLineString(r)},linearring:function(t){if(void 0===t)return this.geometryFactory.createLinearRing();for(var e,n=t.trim().split(","),r=[],i=0,o=n.length;i<o;++i)e=n[i].trim().split(Hu.spaces),r.push(new bu(Number.parseFloat(e[0]),Number.parseFloat(e[1])));return this.geometryFactory.createLinearRing(r)},multilinestring:function(t){if(void 0===t)return this.geometryFactory.createMultiLineString();for(var e,n=t.trim().split(Hu.parenComma),r=[],i=0,o=n.length;i<o;++i)e=n[i].replace(Hu.trimParens,"$1"),r.push(Zu.linestring.apply(this,[e]));return this.geometryFactory.createMultiLineString(r)},polygon:function(t){if(void 0===t)return this.geometryFactory.createPolygon();for(var e,n,r,i,o=t.trim().split(Hu.parenComma),s=[],a=0,u=o.length;a<u;++a)e=o[a].replace(Hu.trimParens,"$1"),n=Zu.linestring.apply(this,[e]),r=this.geometryFactory.createLinearRing(n._points),0===a?i=r:s.push(r);return this.geometryFactory.createPolygon(i,s)},multipolygon:function(t){if(void 0===t)return this.geometryFactory.createMultiPolygon();for(var e,n=t.trim().split(Hu.doubleParenComma),r=[],i=0,o=n.length;i<o;++i)e=n[i].replace(Hu.trimParens,"$1"),r.push(Zu.polygon.apply(this,[e]));return this.geometryFactory.createMultiPolygon(r)},geometrycollection:function(t){if(void 0===t)return this.geometryFactory.createGeometryCollection();for(var e=(t=t.replace(/,\s*([A-Za-z])/g,"|$1")).trim().split("|"),n=[],r=0,i=e.length;r<i;++r)n.push(this.read(e[r]));return this.geometryFactory.createGeometryCollection(n)}},Ku=function(t){this.parser=new Wu(t)};Ku.prototype.write=function(t){return this.parser.write(t)},Ku.toLineString=function(t,e){if(2!==arguments.length)throw new Error("Not implemented");return"LINESTRING ( "+t.x+" "+t.y+", "+e.x+" "+e.y+" )"};var Qu=function(t){function e(e){t.call(this,e),this.name="RuntimeException",this.message=e,this.stack=(new t).stack}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Error),$u=function(t){function e(){if(t.call(this),0===arguments.length)t.call(this);else if(1===arguments.length){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.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Qu),tc=function(){};tc.prototype.interfaces_=function(){return[]},tc.prototype.getClass=function(){return tc},tc.shouldNeverReachHere=function(){if(0===arguments.length)tc.shouldNeverReachHere(null);else if(1===arguments.length){var t=arguments[0];throw new $u("Should never reach here"+(null!==t?": "+t:""))}},tc.isTrue=function(){var t,e;if(1===arguments.length)t=arguments[0],tc.isTrue(t,null);else if(2===arguments.length&&(e=arguments[1],!(t=arguments[0])))throw null===e?new $u:new $u(e)},tc.equals=function(){var t,e,n;if(2===arguments.length)t=arguments[0],e=arguments[1],tc.equals(t,e,null);else if(3===arguments.length&&(t=arguments[0],n=arguments[2],!(e=arguments[1]).equals(t)))throw new $u("Expected "+t+" but encountered "+e+(null!==n?": "+n:""))};var ec=function(){this._result=null,this._inputLines=Array(2).fill().map((function(){return Array(2)})),this._intPt=new Array(2).fill(null),this._intLineIndex=null,this._isProper=null,this._pa=null,this._pb=null,this._precisionModel=null,this._intPt[0]=new bu,this._intPt[1]=new bu,this._pa=this._intPt[0],this._pb=this._intPt[1],this._result=0},nc={DONT_INTERSECT:{configurable:!0},DO_INTERSECT:{configurable:!0},COLLINEAR:{configurable:!0},NO_INTERSECTION:{configurable:!0},POINT_INTERSECTION:{configurable:!0},COLLINEAR_INTERSECTION:{configurable:!0}};ec.prototype.getIndexAlongSegment=function(t,e){return this.computeIntLineIndex(),this._intLineIndex[t][e]},ec.prototype.getTopologySummary=function(){var t=new Ru;return this.isEndPoint()&&t.append(" endpoint"),this._isProper&&t.append(" proper"),this.isCollinear()&&t.append(" collinear"),t.toString()},ec.prototype.computeIntersection=function(t,e,n,r){this._inputLines[0][0]=t,this._inputLines[0][1]=e,this._inputLines[1][0]=n,this._inputLines[1][1]=r,this._result=this.computeIntersect(t,e,n,r)},ec.prototype.getIntersectionNum=function(){return this._result},ec.prototype.computeIntLineIndex=function(){if(0===arguments.length)null===this._intLineIndex&&(this._intLineIndex=Array(2).fill().map((function(){return Array(2)})),this.computeIntLineIndex(0),this.computeIntLineIndex(1));else if(1===arguments.length){var t=arguments[0];this.getEdgeDistance(t,0)>this.getEdgeDistance(t,1)?(this._intLineIndex[t][0]=0,this._intLineIndex[t][1]=1):(this._intLineIndex[t][0]=1,this._intLineIndex[t][1]=0)}},ec.prototype.isProper=function(){return this.hasIntersection()&&this._isProper},ec.prototype.setPrecisionModel=function(t){this._precisionModel=t},ec.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;e<this._result;e++)if(!this._intPt[e].equals2D(this._inputLines[t][0])&&!this._intPt[e].equals2D(this._inputLines[t][1]))return!0;return!1}},ec.prototype.getIntersection=function(t){return this._intPt[t]},ec.prototype.isEndPoint=function(){return this.hasIntersection()&&!this._isProper},ec.prototype.hasIntersection=function(){return this._result!==ec.NO_INTERSECTION},ec.prototype.getEdgeDistance=function(t,e){return ec.computeEdgeDistance(this._intPt[e],this._inputLines[t][0],this._inputLines[t][1])},ec.prototype.isCollinear=function(){return this._result===ec.COLLINEAR_INTERSECTION},ec.prototype.toString=function(){return Ku.toLineString(this._inputLines[0][0],this._inputLines[0][1])+" - "+Ku.toLineString(this._inputLines[1][0],this._inputLines[1][1])+this.getTopologySummary()},ec.prototype.getEndpoint=function(t,e){return this._inputLines[t][e]},ec.prototype.isIntersection=function(t){for(var e=0;e<this._result;e++)if(this._intPt[e].equals2D(t))return!0;return!1},ec.prototype.getIntersectionAlongSegment=function(t,e){return this.computeIntLineIndex(),this._intPt[this._intLineIndex[t][e]]},ec.prototype.interfaces_=function(){return[]},ec.prototype.getClass=function(){return ec},ec.computeEdgeDistance=function(t,e,n){var r=Math.abs(n.x-e.x),i=Math.abs(n.y-e.y),o=-1;if(t.equals(e))o=0;else if(t.equals(n))o=r>i?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 tc.isTrue(!(0===o&&!t.equals(e)),"Bad distance calculation"),o},ec.nonRobustComputeEdgeDistance=function(t,e,n){var r=t.x-e.x,i=t.y-e.y,o=Math.sqrt(r*r+i*i);return tc.isTrue(!(0===o&&!t.equals(e)),"Invalid distance calculation"),o},nc.DONT_INTERSECT.get=function(){return 0},nc.DO_INTERSECT.get=function(){return 1},nc.COLLINEAR.get=function(){return 2},nc.NO_INTERSECTION.get=function(){return 0},nc.POINT_INTERSECTION.get=function(){return 1},nc.COLLINEAR_INTERSECTION.get=function(){return 2},Object.defineProperties(ec,nc);var rc=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 Yu(this._inputLines[0][0],this._inputLines[0][1]),n=new Yu(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,Yu.intersects(n,r,e)&&0===sc.orientationIndex(n,r,e)&&0===sc.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=Uu.intersection(t,n,r,i)}catch(s){if(!(s instanceof ju))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 bu(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)<o&&(i=e,o=Math.abs(e)),Math.abs(n)<o&&(i=n,o=Math.abs(n)),Math.abs(r)<o&&(i=r),i},e.prototype.checkDD=function(t,e,n,r,i){var o=qu.intersection(t,e,n,r),s=this.isInSegmentEnvelopes(o);Xu.out.println("DD in env = "+s+" --------------------- "+o),i.distance(o)>1e-4&&Xu.out.println("Distance = "+i.distance(o))},e.prototype.intersectionWithNormalization=function(t,e,n,r){var i=new bu(t),o=new bu(e),s=new bu(n),a=new bu(r),u=new bu;this.normalizeToEnvCentre(i,o,s,a,u);var c=this.safeHCoordinateIntersection(i,o,s,a);return c.x+=u.x,c.y+=u.y,c},e.prototype.computeCollinearIntersection=function(e,n,r,i){var o=Yu.intersects(e,n,r),s=Yu.intersects(e,n,i),a=Yu.intersects(r,i,e),u=Yu.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.x<e.x?t.x:e.x,s=t.y<e.y?t.y:e.y,a=t.x>e.x?t.x:e.x,u=t.y>e.y?t.y:e.y,c=n.x<r.x?n.x:r.x,h=n.y<r.y?n.y:r.y,l=n.x>r.x?n.x:r.x,p=n.y>r.y?n.y:r.y,f=((o>c?o:c)+(a<l?a:l))/2,g=((s>h?s:h)+(u<p?u:p))/2;i.x=f,i.y=g,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.computeIntersect=function(e,n,r,i){if(this._isProper=!1,!Yu.intersects(e,n,r,i))return t.NO_INTERSECTION;var o=sc.orientationIndex(e,n,r),s=sc.orientationIndex(e,n,i);if(o>0&&s>0||o<0&&s<0)return t.NO_INTERSECTION;var a=sc.orientationIndex(r,i,e),u=sc.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 bu(r):0===s?this._intPt[0]=new bu(i):0===a?this._intPt[0]=new bu(e):0===u&&(this._intPt[0]=new bu(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=sc.distancePointLine(t,n,r),s=sc.distancePointLine(e,n,r);return s<o&&(o=s,i=e),(s=sc.distancePointLine(n,t,e))<o&&(o=s,i=n),(s=sc.distancePointLine(r,t,e))<o&&(o=s,i=r),i},e}(ec),ic=function(){};ic.prototype.interfaces_=function(){return[]},ic.prototype.getClass=function(){return ic},ic.orientationIndex=function(t,e,n){var r=e.x-t.x,i=e.y-t.y,o=n.x-e.x,s=n.y-e.y;return ic.signOfDet2x2(r,i,o,s)},ic.signOfDet2x2=function(t,e,n,r){var i=null,o=null,s=null;if(i=1,0===t||0===r)return 0===e||0===n?0:e>0?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(e<r+r)return i}else{if(e>r+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(r<e+e)return-i}else{if(r>e+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 oc=function(){this._p=null,this._crossingCount=0,this._isPointOnSegment=!1;var t=arguments[0];this._p=t};oc.prototype.countSegment=function(t,e){if(t.x<this._p.x&&e.x<this._p.x)return null;if(this._p.x===e.x&&this._p.y===e.y)return this._isPointOnSegment=!0,null;if(t.y===this._p.y&&e.y===this._p.y){var n=t.x,r=e.x;return n>r&&(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=ic.signOfDet2x2(i,o,s,a);if(0===u)return this._isPointOnSegment=!0,null;a<o&&(u=-u),u>0&&this._crossingCount++}},oc.prototype.isPointInPolygon=function(){return this.getLocation()!==Su.EXTERIOR},oc.prototype.getLocation=function(){return this._isPointOnSegment?Su.BOUNDARY:this._crossingCount%2==1?Su.INTERIOR:Su.EXTERIOR},oc.prototype.isOnSegment=function(){return this._isPointOnSegment},oc.prototype.interfaces_=function(){return[]},oc.prototype.getClass=function(){return oc},oc.locatePointInRing=function(){if(arguments[0]instanceof bu&&Lu(arguments[1],Bu)){for(var t=arguments[1],e=new oc(arguments[0]),n=new bu,r=new bu,i=1;i<t.size();i++)if(t.getCoordinate(i,n),t.getCoordinate(i-1,r),e.countSegment(n,r),e.isOnSegment())return e.getLocation();return e.getLocation()}if(arguments[0]instanceof bu&&arguments[1]instanceof Array){for(var o=arguments[1],s=new oc(arguments[0]),a=1;a<o.length;a++){var u=o[a],c=o[a-1];if(s.countSegment(u,c),s.isOnSegment())return s.getLocation()}return s.getLocation()}};var sc=function(){},ac={CLOCKWISE:{configurable:!0},RIGHT:{configurable:!0},COUNTERCLOCKWISE:{configurable:!0},LEFT:{configurable:!0},COLLINEAR:{configurable:!0},STRAIGHT:{configurable:!0}};sc.prototype.interfaces_=function(){return[]},sc.prototype.getClass=function(){return sc},sc.orientationIndex=function(t,e,n){return qu.orientationIndex(t,e,n)},sc.signedArea=function(){if(arguments[0]instanceof Array){var t=arguments[0];if(t.length<3)return 0;for(var e=0,n=t[0].x,r=1;r<t.length-1;r++){var i=t[r].x-n,o=t[r+1].y;e+=i*(t[r-1].y-o)}return e/2}if(Lu(arguments[0],Bu)){var s=arguments[0],a=s.size();if(a<3)return 0;var u=new bu,c=new bu,h=new bu;s.getCoordinate(0,c),s.getCoordinate(1,h);var l=c.x;h.x-=l;for(var p=0,f=1;f<a-1;f++)u.y=c.y,c.x=h.x,c.y=h.y,s.getCoordinate(f+1,h),h.x-=l,p+=c.x*(u.y-h.y);return p/2}},sc.distanceLineLine=function(t,e,n,r){if(t.equals(e))return sc.distancePointLine(t,n,r);if(n.equals(r))return sc.distancePointLine(r,t,e);var i=!1;if(Yu.intersects(t,e,n,r)){var o=(e.x-t.x)*(r.y-n.y)-(e.y-t.y)*(r.x-n.x);if(0===o)i=!0;else{var s=(t.y-n.y)*(r.x-n.x)-(t.x-n.x)*(r.y-n.y),a=((t.y-n.y)*(e.x-t.x)-(t.x-n.x)*(e.y-t.y))/o,u=s/o;(u<0||u>1||a<0||a>1)&&(i=!0)}}else i=!0;return i?Pu.min(sc.distancePointLine(t,n,r),sc.distancePointLine(e,n,r),sc.distancePointLine(n,t,e),sc.distancePointLine(r,t,e)):0},sc.isPointInRing=function(t,e){return sc.locatePointInRing(t,e)!==Su.EXTERIOR},sc.computeLength=function(t){var e=t.size();if(e<=1)return 0;var n=0,r=new bu;t.getCoordinate(0,r);for(var i=r.x,o=r.y,s=1;s<e;s++){t.getCoordinate(s,r);var a=r.x,u=r.y,c=a-i,h=u-o;n+=Math.sqrt(c*c+h*h),i=a,o=u}return n},sc.isCCW=function(t){var e=t.length-1;if(e<3)throw new _u("Ring has fewer than 4 points, so orientation cannot be determined");for(var n=t[0],r=0,i=1;i<=e;i++){var o=t[i];o.y>n.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],c=t[a];if(u.equals2D(n)||c.equals2D(n)||u.equals2D(c))return!1;var h=sc.computeOrientation(u,n,c);return 0===h?u.x>c.x:h>0},sc.locatePointInRing=function(t,e){return oc.locatePointInRing(t,e)},sc.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)},sc.computeOrientation=function(t,e,n){return sc.orientationIndex(t,e,n)},sc.distancePointLine=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];if(0===e.length)throw new _u("Line array must contain at least one vertex");for(var n=t.distance(e[0]),r=0;r<e.length-1;r++){var i=sc.distancePointLine(t,e[r],e[r+1]);i<n&&(n=i)}return n}if(3===arguments.length){var o=arguments[0],s=arguments[1],a=arguments[2];if(s.x===a.x&&s.y===a.y)return o.distance(s);var u=(a.x-s.x)*(a.x-s.x)+(a.y-s.y)*(a.y-s.y),c=((o.x-s.x)*(a.x-s.x)+(o.y-s.y)*(a.y-s.y))/u;if(c<=0)return o.distance(s);if(c>=1)return o.distance(a);var h=((s.y-o.y)*(a.x-s.x)-(s.x-o.x)*(a.y-s.y))/u;return Math.abs(h)*Math.sqrt(u)}},sc.isOnLine=function(t,e){for(var n=new rc,r=1;r<e.length;r++){var i=e[r-1],o=e[r];if(n.computeIntersection(t,i,o),n.hasIntersection())return!0}return!1},ac.CLOCKWISE.get=function(){return-1},ac.RIGHT.get=function(){return sc.CLOCKWISE},ac.COUNTERCLOCKWISE.get=function(){return 1},ac.LEFT.get=function(){return sc.COUNTERCLOCKWISE},ac.COLLINEAR.get=function(){return 0},ac.STRAIGHT.get=function(){return sc.COLLINEAR},Object.defineProperties(sc,ac);var uc=function(){};uc.prototype.filter=function(t){},uc.prototype.interfaces_=function(){return[]},uc.prototype.getClass=function(){return uc};var cc=function(){var t=arguments[0];this._envelope=null,this._factory=null,this._SRID=null,this._userData=null,this._factory=t,this._SRID=t.getSRID()},hc={serialVersionUID:{configurable:!0},SORTINDEX_POINT:{configurable:!0},SORTINDEX_MULTIPOINT:{configurable:!0},SORTINDEX_LINESTRING:{configurable:!0},SORTINDEX_LINEARRING:{configurable:!0},SORTINDEX_MULTILINESTRING:{configurable:!0},SORTINDEX_POLYGON:{configurable:!0},SORTINDEX_MULTIPOLYGON:{configurable:!0},SORTINDEX_GEOMETRYCOLLECTION:{configurable:!0},geometryChangedFilter:{configurable:!0}};cc.prototype.isGeometryCollection=function(){return this.getSortIndex()===cc.SORTINDEX_GEOMETRYCOLLECTION},cc.prototype.getFactory=function(){return this._factory},cc.prototype.getGeometryN=function(t){return this},cc.prototype.getArea=function(){return 0},cc.prototype.isRectangle=function(){return!1},cc.prototype.equals=function(){if(arguments[0]instanceof cc){var t=arguments[0];return null!==t&&this.equalsTopo(t)}if(arguments[0]instanceof Object){var e=arguments[0];if(!(e instanceof cc))return!1;var n=e;return this.equalsExact(n)}},cc.prototype.equalsExact=function(t){return this===t||this.equalsExact(t,0)},cc.prototype.geometryChanged=function(){this.apply(cc.geometryChangedFilter)},cc.prototype.geometryChangedAction=function(){this._envelope=null},cc.prototype.equalsNorm=function(t){return null!==t&&this.norm().equalsExact(t.norm())},cc.prototype.getLength=function(){return 0},cc.prototype.getNumGeometries=function(){return 1},cc.prototype.compareTo=function(){if(1===arguments.length){var t=arguments[0],e=t;return this.getSortIndex()!==e.getSortIndex()?this.getSortIndex()-e.getSortIndex():this.isEmpty()&&e.isEmpty()?0:this.isEmpty()?-1:e.isEmpty()?1:this.compareToSameClass(t)}if(2===arguments.length){var n=arguments[0],r=arguments[1];return this.getSortIndex()!==n.getSortIndex()?this.getSortIndex()-n.getSortIndex():this.isEmpty()&&n.isEmpty()?0:this.isEmpty()?-1:n.isEmpty()?1:this.compareToSameClass(n,r)}},cc.prototype.getUserData=function(){return this._userData},cc.prototype.getSRID=function(){return this._SRID},cc.prototype.getEnvelope=function(){return this.getFactory().toGeometry(this.getEnvelopeInternal())},cc.prototype.checkNotGeometryCollection=function(t){if(t.getSortIndex()===cc.SORTINDEX_GEOMETRYCOLLECTION)throw new _u("This method does not support GeometryCollection arguments")},cc.prototype.equal=function(t,e,n){return 0===n?t.equals(e):t.distance(e)<=n},cc.prototype.norm=function(){var t=this.copy();return t.normalize(),t},cc.prototype.getPrecisionModel=function(){return this._factory.getPrecisionModel()},cc.prototype.getEnvelopeInternal=function(){return null===this._envelope&&(this._envelope=this.computeEnvelopeInternal()),new Yu(this._envelope)},cc.prototype.setSRID=function(t){this._SRID=t},cc.prototype.setUserData=function(t){this._userData=t},cc.prototype.compare=function(t,e){for(var n=t.iterator(),r=e.iterator();n.hasNext()&&r.hasNext();){var i=n.next(),o=r.next(),s=i.compareTo(o);if(0!==s)return s}return n.hasNext()?1:r.hasNext()?-1:0},cc.prototype.hashCode=function(){return this.getEnvelopeInternal().hashCode()},cc.prototype.isGeometryCollectionOrDerived=function(){return this.getSortIndex()===cc.SORTINDEX_GEOMETRYCOLLECTION||this.getSortIndex()===cc.SORTINDEX_MULTIPOINT||this.getSortIndex()===cc.SORTINDEX_MULTILINESTRING||this.getSortIndex()===cc.SORTINDEX_MULTIPOLYGON},cc.prototype.interfaces_=function(){return[Eu,xu,Li]},cc.prototype.getClass=function(){return cc},cc.hasNonEmptyElements=function(t){for(var e=0;e<t.length;e++)if(!t[e].isEmpty())return!0;return!1},cc.hasNullElements=function(t){for(var e=0;e<t.length;e++)if(null===t[e])return!0;return!1},hc.serialVersionUID.get=function(){return 0x799ea46522854c00},hc.SORTINDEX_POINT.get=function(){return 0},hc.SORTINDEX_MULTIPOINT.get=function(){return 1},hc.SORTINDEX_LINESTRING.get=function(){return 2},hc.SORTINDEX_LINEARRING.get=function(){return 3},hc.SORTINDEX_MULTILINESTRING.get=function(){return 4},hc.SORTINDEX_POLYGON.get=function(){return 5},hc.SORTINDEX_MULTIPOLYGON.get=function(){return 6},hc.SORTINDEX_GEOMETRYCOLLECTION.get=function(){return 7},hc.geometryChangedFilter.get=function(){return lc},Object.defineProperties(cc,hc);var lc=function(){};lc.interfaces_=function(){return[uc]},lc.filter=function(t){t.geometryChangedAction()};var pc=function(){};pc.prototype.filter=function(t){},pc.prototype.interfaces_=function(){return[]},pc.prototype.getClass=function(){return pc};var fc=function(){},gc={Mod2BoundaryNodeRule:{configurable:!0},EndPointBoundaryNodeRule:{configurable:!0},MultiValentEndPointBoundaryNodeRule:{configurable:!0},MonoValentEndPointBoundaryNodeRule:{configurable:!0},MOD2_BOUNDARY_RULE:{configurable:!0},ENDPOINT_BOUNDARY_RULE:{configurable:!0},MULTIVALENT_ENDPOINT_BOUNDARY_RULE:{configurable:!0},MONOVALENT_ENDPOINT_BOUNDARY_RULE:{configurable:!0},OGC_SFS_BOUNDARY_RULE:{configurable:!0}};fc.prototype.isInBoundary=function(t){},fc.prototype.interfaces_=function(){return[]},fc.prototype.getClass=function(){return fc},gc.Mod2BoundaryNodeRule.get=function(){return dc},gc.EndPointBoundaryNodeRule.get=function(){return yc},gc.MultiValentEndPointBoundaryNodeRule.get=function(){return _c},gc.MonoValentEndPointBoundaryNodeRule.get=function(){return mc},gc.MOD2_BOUNDARY_RULE.get=function(){return new dc},gc.ENDPOINT_BOUNDARY_RULE.get=function(){return new yc},gc.MULTIVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new _c},gc.MONOVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new mc},gc.OGC_SFS_BOUNDARY_RULE.get=function(){return fc.MOD2_BOUNDARY_RULE},Object.defineProperties(fc,gc);var dc=function(){};dc.prototype.isInBoundary=function(t){return t%2==1},dc.prototype.interfaces_=function(){return[fc]},dc.prototype.getClass=function(){return dc};var yc=function(){};yc.prototype.isInBoundary=function(t){return t>0},yc.prototype.interfaces_=function(){return[fc]},yc.prototype.getClass=function(){return yc};var _c=function(){};_c.prototype.isInBoundary=function(t){return t>1},_c.prototype.interfaces_=function(){return[fc]},_c.prototype.getClass=function(){return _c};var mc=function(){};mc.prototype.isInBoundary=function(t){return 1===t},mc.prototype.interfaces_=function(){return[fc]},mc.prototype.getClass=function(){return mc};var vc=function(){};vc.prototype.add=function(){},vc.prototype.addAll=function(){},vc.prototype.isEmpty=function(){},vc.prototype.iterator=function(){},vc.prototype.size=function(){},vc.prototype.toArray=function(){},vc.prototype.remove=function(){};var xc=function(t){function e(e){t.call(this),this.message=e||""}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={name:{configurable:!0}};return n.name.get=function(){return"IndexOutOfBoundsException"},Object.defineProperties(e,n),e}(Error),Ec=function(){};Ec.prototype.hasNext=function(){},Ec.prototype.next=function(){},Ec.prototype.remove=function(){};var wc=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}(vc);(Pi.prototype=new Error).name="NoSuchElementException";var bc=function(t){function e(){t.call(this),this.array_=[],arguments[0]instanceof vc&&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,vc]},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 Ic(this)},e.prototype.get=function(t){if(t<0||t>=this.size())throw new xc;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<n;e++)t.push(this.array_[e]);return t},e.prototype.remove=function(t){for(var e=!1,n=0,r=this.array_.length;n<r;n++)if(this.array_[n]===t){this.array_.splice(n,1),e=!0;break}return e},e}(wc),Ic=function(t){function e(e){t.call(this),this.arrayList_=e,this.position_=0}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.next=function(){if(this.position_===this.arrayList_.size())throw new Pi;return this.arrayList_.get(this.position_++)},e.prototype.hasNext=function(){return this.position_<this.arrayList_.size()},e.prototype.set=function(t){return this.arrayList_.set(this.position_-1,t)},e.prototype.remove=function(){this.arrayList_.remove(this.arrayList_.get(this.position_))},e}(Ec),Nc=function(t){function e(){if(t.call(this),0===arguments.length);else if(1===arguments.length){var e=arguments[0];this.ensureCapacity(e.length),this.add(e,!0)}else if(2===arguments.length){var n=arguments[0],r=arguments[1];this.ensureCapacity(n.length),this.add(n,r)}}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={coordArrayType:{configurable:!0}};return n.coordArrayType.get=function(){return new Array(0).fill(null)},e.prototype.getCoordinate=function(t){return this.get(t)},e.prototype.addAll=function(){if(2===arguments.length){for(var e=arguments[1],n=!1,r=arguments[0].iterator();r.hasNext();)this.add(r.next(),e),n=!0;return n}return t.prototype.addAll.apply(this,arguments)},e.prototype.clone=function(){for(var e=t.prototype.clone.call(this),n=0;n<this.size();n++)e.add(n,this.get(n).copy());return e},e.prototype.toCoordinateArray=function(){return this.toArray(e.coordArrayType)},e.prototype.add=function(){if(1===arguments.length){var e=arguments[0];t.prototype.add.call(this,e)}else if(2===arguments.length){if(arguments[0]instanceof Array&&"boolean"==typeof arguments[1]){var n=arguments[0],r=arguments[1];return this.add(n,r,!0),!0}if(arguments[0]instanceof bu&&"boolean"==typeof arguments[1]){var i=arguments[0];if(!arguments[1]&&this.size()>=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 c=0;c<a.length;c++)this.add(a[c],u);else for(var h=a.length-1;h>=0;h--)this.add(a[h],u);return!0}if("boolean"==typeof arguments[2]&&Number.isInteger(arguments[0])&&arguments[1]instanceof bu){var l=arguments[0],p=arguments[1];if(!arguments[2]){var f=this.size();if(f>0){if(l>0&&this.get(l-1).equals2D(p))return null;if(l<f&&this.get(l).equals2D(p))return null}}t.prototype.add.call(this,l,p)}}else if(4===arguments.length){var g=arguments[0],d=arguments[1],y=arguments[2],_=arguments[3],m=1;y>_&&(m=-1);for(var v=y;v!==_;v+=m)this.add(g[v],d);return!0}},e.prototype.closeRing=function(){this.size()>0&&this.add(new bu(this.get(0)),!1)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},Object.defineProperties(e,n),e}(bc),Cc=function(){},Sc={ForwardComparator:{configurable:!0},BidirectionalComparator:{configurable:!0},coordArrayType:{configurable:!0}};Sc.ForwardComparator.get=function(){return Mc},Sc.BidirectionalComparator.get=function(){return Lc},Sc.coordArrayType.get=function(){return new Array(0).fill(null)},Cc.prototype.interfaces_=function(){return[]},Cc.prototype.getClass=function(){return Cc},Cc.isRing=function(t){return!(t.length<4)&&!!t[0].equals2D(t[t.length-1])},Cc.ptNotInList=function(t,e){for(var n=0;n<t.length;n++){var r=t[n];if(Cc.indexOf(r,e)<0)return r}return null},Cc.scroll=function(t,e){var n=Cc.indexOf(e,t);if(n<0)return null;var r=new Array(t.length).fill(null);Xu.arraycopy(t,n,r,0,t.length-n),Xu.arraycopy(t,0,r,t.length-n,n),Xu.arraycopy(r,0,t,0,t.length)},Cc.equals=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];if(t===e)return!0;if(null===t||null===e)return!1;if(t.length!==e.length)return!1;for(var n=0;n<t.length;n++)if(!t[n].equals(e[n]))return!1;return!0}if(3===arguments.length){var r=arguments[0],i=arguments[1],o=arguments[2];if(r===i)return!0;if(null===r||null===i)return!1;if(r.length!==i.length)return!1;for(var s=0;s<r.length;s++)if(0!==o.compare(r[s],i[s]))return!1;return!0}},Cc.intersection=function(t,e){for(var n=new Nc,r=0;r<t.length;r++)e.intersects(t[r])&&n.add(t[r],!0);return n.toCoordinateArray()},Cc.hasRepeatedPoints=function(t){for(var e=1;e<t.length;e++)if(t[e-1].equals(t[e]))return!0;return!1},Cc.removeRepeatedPoints=function(t){return Cc.hasRepeatedPoints(t)?new Nc(t,!1).toCoordinateArray():t},Cc.reverse=function(t){for(var e=t.length-1,n=Math.trunc(e/2),r=0;r<=n;r++){var i=t[r];t[r]=t[e-r],t[e-r]=i}},Cc.removeNull=function(t){for(var e=0,n=0;n<t.length;n++)null!==t[n]&&e++;var r=new Array(e).fill(null);if(0===e)return r;for(var i=0,o=0;o<t.length;o++)null!==t[o]&&(r[i++]=t[o]);return r},Cc.copyDeep=function(){if(1===arguments.length){for(var t=arguments[0],e=new Array(t.length).fill(null),n=0;n<t.length;n++)e[n]=new bu(t[n]);return e}if(5===arguments.length)for(var r=arguments[0],i=arguments[1],o=arguments[2],s=arguments[3],a=arguments[4],u=0;u<a;u++)o[s+u]=new bu(r[i+u])},Cc.isEqualReversed=function(t,e){for(var n=0;n<t.length;n++){var r=t[n],i=e[t.length-n-1];if(0!==r.compareTo(i))return!1}return!0},Cc.envelope=function(t){for(var e=new Yu,n=0;n<t.length;n++)e.expandToInclude(t[n]);return e},Cc.toCoordinateArray=function(t){return t.toArray(Cc.coordArrayType)},Cc.atLeastNCoordinatesOrNothing=function(t,e){return e.length>=t?e:[]},Cc.indexOf=function(t,e){for(var n=0;n<e.length;n++)if(t.equals(e[n]))return n;return-1},Cc.increasingDirection=function(t){for(var e=0;e<Math.trunc(t.length/2);e++){var n=t.length-1-e,r=t[e].compareTo(t[n]);if(0!==r)return r}return 1},Cc.compare=function(t,e){for(var n=0;n<t.length&&n<e.length;){var r=t[n].compareTo(e[n]);if(0!==r)return r;n++}return n<e.length?-1:n<t.length?1:0},Cc.minCoordinate=function(t){for(var e=null,n=0;n<t.length;n++)(null===e||e.compareTo(t[n])>0)&&(e=t[n]);return e},Cc.extract=function(t,e,n){e=Pu.clamp(e,0,t.length);var r=(n=Pu.clamp(n,-1,t.length))-e+1;n<0&&(r=0),e>=t.length&&(r=0),n<e&&(r=0);var i=new Array(r).fill(null);if(0===r)return i;for(var o=0,s=e;s<=n;s++)i[o++]=t[s];return i},Object.defineProperties(Cc,Sc);var Mc=function(){};Mc.prototype.compare=function(t,e){return Cc.compare(t,e)},Mc.prototype.interfaces_=function(){return[wu]},Mc.prototype.getClass=function(){return Mc};var Lc=function(){};Lc.prototype.compare=function(t,e){var n=t,r=e;if(n.length<r.length)return-1;if(n.length>r.length)return 1;if(0===n.length)return 0;var i=Cc.compare(n,r);return Cc.isEqualReversed(n,r)?0:i},Lc.prototype.OLDcompare=function(t,e){var n=t,r=e;if(n.length<r.length)return-1;if(n.length>r.length)return 1;if(0===n.length)return 0;for(var i=Cc.increasingDirection(n),o=Cc.increasingDirection(r),s=i>0?0:n.length-1,a=o>0?0:n.length-1,u=0;u<n.length;u++){var c=n[s].compareTo(r[a]);if(0!==c)return c;s+=i,a+=o}return 0},Lc.prototype.interfaces_=function(){return[wu]},Lc.prototype.getClass=function(){return Lc};var Pc=function(){};Pc.prototype.get=function(){},Pc.prototype.put=function(){},Pc.prototype.size=function(){},Pc.prototype.values=function(){},Pc.prototype.entrySet=function(){};var Oc=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}(Pc);(Oi.prototype=new Error).name="OperationNotSupported",(Ri.prototype=new vc).contains=function(){};var Rc=function(t){function e(){t.call(this),this.array_=[],arguments[0]instanceof vc&&this.addAll(arguments[0])}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.contains=function(t){for(var e=0,n=this.array_.length;e<n;e++)if(this.array_[e]===t)return!0;return!1},e.prototype.add=function(t){return!this.contains(t)&&(this.array_.push(t),!0)},e.prototype.addAll=function(t){for(var e=t.iterator();e.hasNext();)this.add(e.next());return!0},e.prototype.remove=function(t){throw new Error},e.prototype.size=function(){return this.array_.length},e.prototype.isEmpty=function(){return 0===this.array_.length},e.prototype.toArray=function(){for(var t=[],e=0,n=this.array_.length;e<n;e++)t.push(this.array_[e]);return t},e.prototype.iterator=function(){return new Tc(this)},e}(Ri),Tc=function(t){function e(e){t.call(this),this.hashSet_=e,this.position_=0}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.next=function(){if(this.position_===this.hashSet_.size())throw new Pi;return this.hashSet_.array_[this.position_++]},e.prototype.hasNext=function(){return this.position_<this.hashSet_.size()},e.prototype.remove=function(){throw new Oi},e}(Ec),Ac=0;(Gi.prototype=new Oc).get=function(t){for(var e=this.root_;null!==e;){var n=t.compareTo(e.key);if(n<0)e=e.left;else{if(!(n>0))return e.value;e=e.right}}return null},Gi.prototype.put=function(t,e){if(null===this.root_)return this.root_={key:t,value:e,left:null,right:null,parent:null,color:Ac,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:Ac,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},Gi.prototype.fixAfterInsertion=function(t){for(t.color=1;null!=t&&t!==this.root_&&1===t.parent.color;)if(Ai(t)===Fi(Ai(Ai(t)))){var e=qi(Ai(Ai(t)));1===Ti(e)?(Di(Ai(t),Ac),Di(e,Ac),Di(Ai(Ai(t)),1),t=Ai(Ai(t))):(t===qi(Ai(t))&&(t=Ai(t),this.rotateLeft(t)),Di(Ai(t),Ac),Di(Ai(Ai(t)),1),this.rotateRight(Ai(Ai(t))))}else{var n=Fi(Ai(Ai(t)));1===Ti(n)?(Di(Ai(t),Ac),Di(n,Ac),Di(Ai(Ai(t)),1),t=Ai(Ai(t))):(t===Fi(Ai(t))&&(t=Ai(t),this.rotateRight(t)),Di(Ai(t),Ac),Di(Ai(Ai(t)),1),this.rotateLeft(Ai(Ai(t))))}this.root_.color=Ac},Gi.prototype.values=function(){var t=new bc,e=this.getFirstEntry();if(null!==e)for(t.add(e.value);null!==(e=Gi.successor(e));)t.add(e.value);return t},Gi.prototype.entrySet=function(){var t=new Rc,e=this.getFirstEntry();if(null!==e)for(t.add(e);null!==(e=Gi.successor(e));)t.add(e);return t},Gi.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}},Gi.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}},Gi.prototype.getFirstEntry=function(){var t=this.root_;if(null!=t)for(;null!=t.left;)t=t.left;return t},Gi.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},Gi.prototype.size=function(){return this.size_};var Dc=function(){};Dc.prototype.interfaces_=function(){return[]},Dc.prototype.getClass=function(){return Dc},Bi.prototype=new Ri,(ki.prototype=new Bi).contains=function(t){for(var e=0,n=this.array_.length;e<n;e++)if(0===this.array_[e].compareTo(t))return!0;return!1},ki.prototype.add=function(t){if(this.contains(t))return!1;for(var e=0,n=this.array_.length;e<n;e++)if(1===this.array_[e].compareTo(t))return this.array_.splice(e,0,t),!0;return this.array_.push(t),!0},ki.prototype.addAll=function(t){for(var e=t.iterator();e.hasNext();)this.add(e.next());return!0},ki.prototype.remove=function(t){throw new Oi},ki.prototype.size=function(){return this.array_.length},ki.prototype.isEmpty=function(){return 0===this.array_.length},ki.prototype.toArray=function(){for(var t=[],e=0,n=this.array_.length;e<n;e++)t.push(this.array_[e]);return t},ki.prototype.iterator=function(){return new Fc(this)};var Fc=function(t){this.treeSet_=t,this.position_=0};Fc.prototype.next=function(){if(this.position_===this.treeSet_.size())throw new Pi;return this.treeSet_.array_[this.position_++]},Fc.prototype.hasNext=function(){return this.position_<this.treeSet_.size()},Fc.prototype.remove=function(){throw new Oi};var qc=function(){};qc.sort=function(){var t,e,n,r,i=arguments[0];if(1===arguments.length)r=function(t,e){return t.compareTo(e)},i.sort(r);else if(2===arguments.length)n=arguments[1],r=function(t,e){return n.compare(t,e)},i.sort(r);else if(3===arguments.length){(e=i.slice(arguments[1],arguments[2])).sort();var o=i.slice(0,arguments[1]).concat(e,i.slice(arguments[2],i.length));for(i.splice(0,i.length),t=0;t<o.length;t++)i.push(o[t])}else if(4===arguments.length)for(e=i.slice(arguments[1],arguments[2]),n=arguments[3],r=function(t,e){return n.compare(t,e)},e.sort(r),o=i.slice(0,arguments[1]).concat(e,i.slice(arguments[2],i.length)),i.splice(0,i.length),t=0;t<o.length;t++)i.push(o[t])},qc.asList=function(t){for(var e=new bc,n=0,r=t.length;n<r;n++)e.add(t[n]);return e};var Gc=function(){},Bc={P:{configurable:!0},L:{configurable:!0},A:{configurable:!0},FALSE:{configurable:!0},TRUE:{configurable:!0},DONTCARE:{configurable:!0},SYM_FALSE:{configurable:!0},SYM_TRUE:{configurable:!0},SYM_DONTCARE:{configurable:!0},SYM_P:{configurable:!0},SYM_L:{configurable:!0},SYM_A:{configurable:!0}};Bc.P.get=function(){return 0},Bc.L.get=function(){return 1},Bc.A.get=function(){return 2},Bc.FALSE.get=function(){return-1},Bc.TRUE.get=function(){return-2},Bc.DONTCARE.get=function(){return-3},Bc.SYM_FALSE.get=function(){return"F"},Bc.SYM_TRUE.get=function(){return"T"},Bc.SYM_DONTCARE.get=function(){return"*"},Bc.SYM_P.get=function(){return"0"},Bc.SYM_L.get=function(){return"1"},Bc.SYM_A.get=function(){return"2"},Gc.prototype.interfaces_=function(){return[]},Gc.prototype.getClass=function(){return Gc},Gc.toDimensionSymbol=function(t){switch(t){case Gc.FALSE:return Gc.SYM_FALSE;case Gc.TRUE:return Gc.SYM_TRUE;case Gc.DONTCARE:return Gc.SYM_DONTCARE;case Gc.P:return Gc.SYM_P;case Gc.L:return Gc.SYM_L;case Gc.A:return Gc.SYM_A}throw new _u("Unknown dimension value: "+t)},Gc.toDimensionValue=function(t){switch(Au.toUpperCase(t)){case Gc.SYM_FALSE:return Gc.FALSE;case Gc.SYM_TRUE:return Gc.TRUE;case Gc.SYM_DONTCARE:return Gc.DONTCARE;case Gc.SYM_P:return Gc.P;case Gc.SYM_L:return Gc.L;case Gc.SYM_A:return Gc.A}throw new _u("Unknown dimension symbol: "+t)},Object.defineProperties(Gc,Bc);var kc=function(){};kc.prototype.filter=function(t){},kc.prototype.interfaces_=function(){return[]},kc.prototype.getClass=function(){return kc};var zc=function(){};zc.prototype.filter=function(t,e){},zc.prototype.isDone=function(){},zc.prototype.isGeometryChanged=function(){},zc.prototype.interfaces_=function(){return[]},zc.prototype.getClass=function(){return zc};var jc=function(t){function e(e,n){if(t.call(this,n),this._geometries=e||[],t.hasNullElements(this._geometries))throw new _u("geometries must not contain null elements")}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={serialVersionUID:{configurable:!0}};return e.prototype.computeEnvelopeInternal=function(){for(var t=new Yu,e=0;e<this._geometries.length;e++)t.expandToInclude(this._geometries[e].getEnvelopeInternal());return t},e.prototype.getGeometryN=function(t){return this._geometries[t]},e.prototype.getSortIndex=function(){return t.SORTINDEX_GEOMETRYCOLLECTION},e.prototype.getCoordinates=function(){for(var t=new Array(this.getNumPoints()).fill(null),e=-1,n=0;n<this._geometries.length;n++)for(var r=this._geometries[n].getCoordinates(),i=0;i<r.length;i++)t[++e]=r[i];return t},e.prototype.getArea=function(){for(var t=0,e=0;e<this._geometries.length;e++)t+=this._geometries[e].getArea();return t},e.prototype.equalsExact=function(){if(2===arguments.length){var e=arguments[0],n=arguments[1];if(!this.isEquivalentClass(e))return!1;var r=e;if(this._geometries.length!==r._geometries.length)return!1;for(var i=0;i<this._geometries.length;i++)if(!this._geometries[i].equalsExact(r._geometries[i],n))return!1;return!0}return t.prototype.equalsExact.apply(this,arguments)},e.prototype.normalize=function(){for(var t=0;t<this._geometries.length;t++)this._geometries[t].normalize();qc.sort(this._geometries)},e.prototype.getCoordinate=function(){return this.isEmpty()?null:this._geometries[0].getCoordinate()},e.prototype.getBoundaryDimension=function(){for(var t=Gc.FALSE,e=0;e<this._geometries.length;e++)t=Math.max(t,this._geometries[e].getBoundaryDimension());return t},e.prototype.getDimension=function(){for(var t=Gc.FALSE,e=0;e<this._geometries.length;e++)t=Math.max(t,this._geometries[e].getDimension());return t},e.prototype.getLength=function(){for(var t=0,e=0;e<this._geometries.length;e++)t+=this._geometries[e].getLength();return t},e.prototype.getNumPoints=function(){for(var t=0,e=0;e<this._geometries.length;e++)t+=this._geometries[e].getNumPoints();return t},e.prototype.getNumGeometries=function(){return this._geometries.length},e.prototype.reverse=function(){for(var t=this._geometries.length,e=new Array(t).fill(null),n=0;n<this._geometries.length;n++)e[n]=this._geometries[n].reverse();return this.getFactory().createGeometryCollection(e)},e.prototype.compareToSameClass=function(){if(1===arguments.length){var t=arguments[0],e=new ki(qc.asList(this._geometries)),n=new ki(qc.asList(t._geometries));return this.compare(e,n)}if(2===arguments.length){for(var r=arguments[1],i=arguments[0],o=this.getNumGeometries(),s=i.getNumGeometries(),a=0;a<o&&a<s;){var u=this.getGeometryN(a),c=i.getGeometryN(a),h=u.compareToSameClass(c,r);if(0!==h)return h;a++}return a<o?1:a<s?-1:0}},e.prototype.apply=function(){if(Lu(arguments[0],pc))for(var t=arguments[0],e=0;e<this._geometries.length;e++)this._geometries[e].apply(t);else if(Lu(arguments[0],zc)){var n=arguments[0];if(0===this._geometries.length)return null;for(var r=0;r<this._geometries.length&&(this._geometries[r].apply(n),!n.isDone());r++);n.isGeometryChanged()&&this.geometryChanged()}else if(Lu(arguments[0],kc)){var i=arguments[0];i.filter(this);for(var o=0;o<this._geometries.length;o++)this._geometries[o].apply(i)}else if(Lu(arguments[0],uc)){var s=arguments[0];s.filter(this);for(var a=0;a<this._geometries.length;a++)this._geometries[a].apply(s)}},e.prototype.getBoundary=function(){return this.checkNotGeometryCollection(this),tc.shouldNeverReachHere(),null},e.prototype.clone=function(){var e=t.prototype.clone.call(this);e._geometries=new Array(this._geometries.length).fill(null);for(var n=0;n<this._geometries.length;n++)e._geometries[n]=this._geometries[n].clone();return e},e.prototype.getGeometryType=function(){return"GeometryCollection"},e.prototype.copy=function(){for(var t=new Array(this._geometries.length).fill(null),n=0;n<t.length;n++)t[n]=this._geometries[n].copy();return new e(t,this._factory)},e.prototype.isEmpty=function(){for(var t=0;t<this._geometries.length;t++)if(!this._geometries[t].isEmpty())return!1;return!0},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return-0x4f07bcb1f857d800},Object.defineProperties(e,n),e}(cc),Xc=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 cc.SORTINDEX_MULTILINESTRING},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 this.isClosed()?Gc.FALSE:0},e.prototype.isClosed=function(){if(this.isEmpty())return!1;for(var t=0;t<this._geometries.length;t++)if(!this._geometries[t].isClosed())return!1;return!0},e.prototype.getDimension=function(){return 1},e.prototype.reverse=function(){for(var t=this._geometries.length,e=new Array(t).fill(null),n=0;n<this._geometries.length;n++)e[t-1-n]=this._geometries[n].reverse();return this.getFactory().createMultiLineString(e)},e.prototype.getBoundary=function(){return new Uc(this).getBoundary()},e.prototype.getGeometryType=function(){return"MultiLineString"},e.prototype.copy=function(){for(var t=new Array(this._geometries.length).fill(null),n=0;n<t.length;n++)t[n]=this._geometries[n].copy();return new e(t,this._factory)},e.prototype.interfaces_=function(){return[Dc]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return 0x7155d2ab4afa8000},Object.defineProperties(e,n),e}(jc),Uc=function(){if(this._geom=null,this._geomFact=null,this._bnRule=null,this._endpointMap=null,1===arguments.length){var t=arguments[0],e=fc.MOD2_BOUNDARY_RULE;this._geom=t,this._geomFact=t.getFactory(),this._bnRule=e}else if(2===arguments.length){var n=arguments[0],r=arguments[1];this._geom=n,this._geomFact=n.getFactory(),this._bnRule=r}};Uc.prototype.boundaryMultiLineString=function(t){if(this._geom.isEmpty())return this.getEmptyMultiPoint();var e=this.computeBoundaryCoordinates(t);return 1===e.length?this._geomFact.createPoint(e[0]):this._geomFact.createMultiPointFromCoords(e)},Uc.prototype.getBoundary=function(){return this._geom instanceof Jc?this.boundaryLineString(this._geom):this._geom instanceof Xc?this.boundaryMultiLineString(this._geom):this._geom.getBoundary()},Uc.prototype.boundaryLineString=function(t){return this._geom.isEmpty()?this.getEmptyMultiPoint():t.isClosed()?this._bnRule.isInBoundary(2)?t.getStartPoint():this._geomFact.createMultiPoint():this._geomFact.createMultiPoint([t.getStartPoint(),t.getEndPoint()])},Uc.prototype.getEmptyMultiPoint=function(){return this._geomFact.createMultiPoint()},Uc.prototype.computeBoundaryCoordinates=function(t){var e=new bc;this._endpointMap=new Gi;for(var n=0;n<t.getNumGeometries();n++){var r=t.getGeometryN(n);0!==r.getNumPoints()&&(this.addEndpoint(r.getCoordinateN(0)),this.addEndpoint(r.getCoordinateN(r.getNumPoints()-1)))}for(var i=this._endpointMap.entrySet().iterator();i.hasNext();){var o=i.next(),s=o.getValue().count;this._bnRule.isInBoundary(s)&&e.add(o.getKey())}return Cc.toCoordinateArray(e)},Uc.prototype.addEndpoint=function(t){var e=this._endpointMap.get(t);null===e&&(e=new Yc,this._endpointMap.put(t,e)),e.count++},Uc.prototype.interfaces_=function(){return[]},Uc.prototype.getClass=function(){return Uc},Uc.getBoundary=function(){return 1===arguments.length?new Uc(arguments[0]).getBoundary():2===arguments.length?new Uc(arguments[0],arguments[1]).getBoundary():void 0};var Yc=function(){this.count=null};Yc.prototype.interfaces_=function(){return[]},Yc.prototype.getClass=function(){return Yc};var Vc=function(){},Hc={NEWLINE:{configurable:!0},SIMPLE_ORDINATE_FORMAT:{configurable:!0}};Vc.prototype.interfaces_=function(){return[]},Vc.prototype.getClass=function(){return Vc},Vc.chars=function(t,e){for(var n=new Array(e).fill(null),r=0;r<e;r++)n[r]=t;return String(n)},Vc.getStackTrace=function(){if(1===arguments.length){var t=arguments[0],e=new function(){},n=new function(){}(e);return t.printStackTrace(n),e.toString()}if(2===arguments.length){for(var r=arguments[0],i=arguments[1],o="",s=new function(){}(new function(){}(Vc.getStackTrace(r))),a=0;a<i;a++)try{o+=s.readLine()+Vc.NEWLINE}catch(t){if(!(t instanceof zi))throw t;tc.shouldNeverReachHere()}return o}},Vc.split=function(t,e){for(var n=e.length,r=new bc,i=""+t,o=i.indexOf(e);o>=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;u<a.length;u++)a[u]=r.get(u);return a},Vc.toString=function(){if(1===arguments.length){var t=arguments[0];return Vc.SIMPLE_ORDINATE_FORMAT.format(t)}},Vc.spaces=function(t){return Vc.chars(" ",t)},Hc.NEWLINE.get=function(){return Xu.getProperty("line.separator")},Hc.SIMPLE_ORDINATE_FORMAT.get=function(){return new function(){}("0.#")},Object.defineProperties(Vc,Hc);var Wc=function(){};Wc.prototype.interfaces_=function(){return[]},Wc.prototype.getClass=function(){return Wc},Wc.copyCoord=function(t,e,n,r){for(var i=Math.min(t.getDimension(),n.getDimension()),o=0;o<i;o++)n.setOrdinate(r,o,t.getOrdinate(e,o))},Wc.isRing=function(t){var e=t.size();return 0===e||!(e<=3)&&t.getOrdinate(0,Bu.X)===t.getOrdinate(e-1,Bu.X)&&t.getOrdinate(0,Bu.Y)===t.getOrdinate(e-1,Bu.Y)},Wc.isEqual=function(t,e){var n=t.size();if(n!==e.size())return!1;for(var r=Math.min(t.getDimension(),e.getDimension()),i=0;i<n;i++)for(var o=0;o<r;o++){var s=t.getOrdinate(i,o),a=e.getOrdinate(i,o);if(t.getOrdinate(i,o)!==e.getOrdinate(i,o)&&(!mu.isNaN(s)||!mu.isNaN(a)))return!1}return!0},Wc.extend=function(t,e,n){var r=t.create(n,e.getDimension()),i=e.size();if(Wc.copy(e,0,r,0,i),i>0)for(var o=i;o<n;o++)Wc.copy(e,i-1,r,o,1);return r},Wc.reverse=function(t){for(var e=t.size()-1,n=Math.trunc(e/2),r=0;r<=n;r++)Wc.swap(t,r,e-r)},Wc.swap=function(t,e,n){if(e===n)return null;for(var r=0;r<t.getDimension();r++){var i=t.getOrdinate(e,r);t.setOrdinate(e,r,t.getOrdinate(n,r)),t.setOrdinate(n,r,i)}},Wc.copy=function(t,e,n,r,i){for(var o=0;o<i;o++)Wc.copyCoord(t,e+o,n,r+o)},Wc.toString=function(){if(1===arguments.length){var t=arguments[0],e=t.size();if(0===e)return"()";var n=t.getDimension(),r=new Ru;r.append("(");for(var i=0;i<e;i++){i>0&&r.append(" ");for(var o=0;o<n;o++)o>0&&r.append(","),r.append(Vc.toString(t.getOrdinate(i,o)))}return r.append(")"),r.toString()}},Wc.ensureValidRing=function(t,e){var n=e.size();return 0===n?e:n<=3?Wc.createClosedRing(t,e,4):e.getOrdinate(0,Bu.X)===e.getOrdinate(n-1,Bu.X)&&e.getOrdinate(0,Bu.Y)===e.getOrdinate(n-1,Bu.Y)?e:Wc.createClosedRing(t,e,n+1)},Wc.createClosedRing=function(t,e,n){var r=t.create(n,e.getDimension()),i=e.size();Wc.copy(e,0,r,0,i);for(var o=i;o<n;o++)Wc.copy(e,0,r,o,1);return r};var Jc=function(t){function e(e,n){t.call(this,n),this._points=null,this.init(e)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={serialVersionUID:{configurable:!0}};return e.prototype.computeEnvelopeInternal=function(){return this.isEmpty()?new Yu:this._points.expandEnvelope(new Yu)},e.prototype.isRing=function(){return this.isClosed()&&this.isSimple()},e.prototype.getSortIndex=function(){return t.SORTINDEX_LINESTRING},e.prototype.getCoordinates=function(){return this._points.toCoordinateArray()},e.prototype.equalsExact=function(){if(2===arguments.length){var e=arguments[0],n=arguments[1];if(!this.isEquivalentClass(e))return!1;var r=e;if(this._points.size()!==r._points.size())return!1;for(var i=0;i<this._points.size();i++)if(!this.equal(this._points.getCoordinate(i),r._points.getCoordinate(i),n))return!1;return!0}return t.prototype.equalsExact.apply(this,arguments)},e.prototype.normalize=function(){for(var t=0;t<Math.trunc(this._points.size()/2);t++){var e=this._points.size()-1-t;if(!this._points.getCoordinate(t).equals(this._points.getCoordinate(e)))return this._points.getCoordinate(t).compareTo(this._points.getCoordinate(e))>0&&Wc.reverse(this._points),null}},e.prototype.getCoordinate=function(){return this.isEmpty()?null:this._points.getCoordinate(0)},e.prototype.getBoundaryDimension=function(){return this.isClosed()?Gc.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 sc.computeLength(this._points)},e.prototype.getNumPoints=function(){return this._points.size()},e.prototype.reverse=function(){var t=this._points.copy();return Wc.reverse(t),this.getFactory().createLineString(t)},e.prototype.compareToSameClass=function(){if(1===arguments.length){for(var t=arguments[0],e=0,n=0;e<this._points.size()&&n<t._points.size();){var r=this._points.getCoordinate(e).compareTo(t._points.getCoordinate(n));if(0!==r)return r;e++,n++}return e<this._points.size()?1:n<t._points.size()?-1:0}if(2===arguments.length){var i=arguments[0];return arguments[1].compare(this._points,i._points)}},e.prototype.apply=function(){if(Lu(arguments[0],pc))for(var t=arguments[0],e=0;e<this._points.size();e++)t.filter(this._points.getCoordinate(e));else if(Lu(arguments[0],zc)){var n=arguments[0];if(0===this._points.size())return null;for(var r=0;r<this._points.size()&&(n.filter(this._points,r),!n.isDone());r++);n.isGeometryChanged()&&this.geometryChanged()}else(Lu(arguments[0],kc)||Lu(arguments[0],uc))&&arguments[0].filter(this)},e.prototype.getBoundary=function(){return new Uc(this).getBoundary()},e.prototype.isEquivalentClass=function(t){return t instanceof e},e.prototype.clone=function(){var e=t.prototype.clone.call(this);return e._points=this._points.clone(),e},e.prototype.getCoordinateN=function(t){return this._points.getCoordinate(t)},e.prototype.getGeometryType=function(){return"LineString"},e.prototype.copy=function(){return new e(this._points.copy(),this._factory)},e.prototype.getCoordinateSequence=function(){return this._points},e.prototype.isEmpty=function(){return 0===this._points.size()},e.prototype.init=function(t){if(null===t&&(t=this.getFactory().getCoordinateSequenceFactory().create([])),1===t.size())throw new _u("Invalid number of points in LineString (found "+t.size()+" - must be 0 or >= 2)");this._points=t},e.prototype.isCoordinate=function(t){for(var e=0;e<this._points.size();e++)if(this._points.getCoordinate(e).equals(t))return!0;return!1},e.prototype.getStartPoint=function(){return this.isEmpty()?null:this.getPointN(0)},e.prototype.getPointN=function(t){return this.getFactory().createPoint(this._points.getCoordinate(t))},e.prototype.interfaces_=function(){return[Dc]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return 0x2b2b51ba435c8e00},Object.defineProperties(e,n),e}(cc),Zc=function(){};Zc.prototype.interfaces_=function(){return[]},Zc.prototype.getClass=function(){return Zc};var Kc=function(t){function e(e,n){t.call(this,n),this._coordinates=e||null,this.init(this._coordinates)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={serialVersionUID:{configurable:!0}};return e.prototype.computeEnvelopeInternal=function(){if(this.isEmpty())return new Yu;var t=new Yu;return t.expandToInclude(this._coordinates.getX(0),this._coordinates.getY(0)),t},e.prototype.getSortIndex=function(){return t.SORTINDEX_POINT},e.prototype.getCoordinates=function(){return this.isEmpty()?[]:[this.getCoordinate()]},e.prototype.equalsExact=function(){if(2===arguments.length){var e=arguments[0],n=arguments[1];return!!this.isEquivalentClass(e)&&(!(!this.isEmpty()||!e.isEmpty())||this.isEmpty()===e.isEmpty()&&this.equal(e.getCoordinate(),this.getCoordinate(),n))}return t.prototype.equalsExact.apply(this,arguments)},e.prototype.normalize=function(){},e.prototype.getCoordinate=function(){return 0!==this._coordinates.size()?this._coordinates.getCoordinate(0):null},e.prototype.getBoundaryDimension=function(){return Gc.FALSE},e.prototype.getDimension=function(){return 0},e.prototype.getNumPoints=function(){return this.isEmpty()?0:1},e.prototype.reverse=function(){return this.copy()},e.prototype.getX=function(){if(null===this.getCoordinate())throw new Error("getX called on empty Point");return this.getCoordinate().x},e.prototype.compareToSameClass=function(){if(1===arguments.length){var t=arguments[0];return this.getCoordinate().compareTo(t.getCoordinate())}if(2===arguments.length){var e=arguments[0];return arguments[1].compare(this._coordinates,e._coordinates)}},e.prototype.apply=function(){if(Lu(arguments[0],pc)){var t=arguments[0];if(this.isEmpty())return null;t.filter(this.getCoordinate())}else if(Lu(arguments[0],zc)){var e=arguments[0];if(this.isEmpty())return null;e.filter(this._coordinates,0),e.isGeometryChanged()&&this.geometryChanged()}else(Lu(arguments[0],kc)||Lu(arguments[0],uc))&&arguments[0].filter(this)},e.prototype.getBoundary=function(){return this.getFactory().createGeometryCollection(null)},e.prototype.clone=function(){var e=t.prototype.clone.call(this);return e._coordinates=this._coordinates.clone(),e},e.prototype.getGeometryType=function(){return"Point"},e.prototype.copy=function(){return new e(this._coordinates.copy(),this._factory)},e.prototype.getCoordinateSequence=function(){return this._coordinates},e.prototype.getY=function(){if(null===this.getCoordinate())throw new Error("getY called on empty Point");return this.getCoordinate().y},e.prototype.isEmpty=function(){return 0===this._coordinates.size()},e.prototype.init=function(t){null===t&&(t=this.getFactory().getCoordinateSequenceFactory().create([])),tc.isTrue(t.size()<=1),this._coordinates=t},e.prototype.isSimple=function(){return!0},e.prototype.interfaces_=function(){return[Zc]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return 0x44077bad161cbc00},Object.defineProperties(e,n),e}(cc),Qc=function(){};Qc.prototype.interfaces_=function(){return[]},Qc.prototype.getClass=function(){return Qc};var $c=function(t){function e(e,n,r){if(t.call(this,r),this._shell=null,this._holes=null,null===e&&(e=this.getFactory().createLinearRing()),null===n&&(n=[]),t.hasNullElements(n))throw new _u("holes must not contain null elements");if(e.isEmpty()&&t.hasNonEmptyElements(n))throw new _u("shell is empty but holes are not");this._shell=e,this._holes=n}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={serialVersionUID:{configurable:!0}};return e.prototype.computeEnvelopeInternal=function(){return this._shell.getEnvelopeInternal()},e.prototype.getSortIndex=function(){return t.SORTINDEX_POLYGON},e.prototype.getCoordinates=function(){if(this.isEmpty())return[];for(var t=new Array(this.getNumPoints()).fill(null),e=-1,n=this._shell.getCoordinates(),r=0;r<n.length;r++)t[++e]=n[r];for(var i=0;i<this._holes.length;i++)for(var o=this._holes[i].getCoordinates(),s=0;s<o.length;s++)t[++e]=o[s];return t},e.prototype.getArea=function(){var t=0;t+=Math.abs(sc.signedArea(this._shell.getCoordinateSequence()));for(var e=0;e<this._holes.length;e++)t-=Math.abs(sc.signedArea(this._holes[e].getCoordinateSequence()));return t},e.prototype.isRectangle=function(){if(0!==this.getNumInteriorRing())return!1;if(null===this._shell)return!1;if(5!==this._shell.getNumPoints())return!1;for(var t=this._shell.getCoordinateSequence(),e=this.getEnvelopeInternal(),n=0;n<5;n++){var r=t.getX(n);if(r!==e.getMinX()&&r!==e.getMaxX())return!1;var i=t.getY(n);if(i!==e.getMinY()&&i!==e.getMaxY())return!1}for(var o=t.getX(0),s=t.getY(0),a=1;a<=4;a++){var u=t.getX(a),c=t.getY(a);if(u!==o===(c!==s))return!1;o=u,s=c}return!0},e.prototype.equalsExact=function(){if(2===arguments.length){var e=arguments[0],n=arguments[1];if(!this.isEquivalentClass(e))return!1;var r=e,i=this._shell,o=r._shell;if(!i.equalsExact(o,n))return!1;if(this._holes.length!==r._holes.length)return!1;for(var s=0;s<this._holes.length;s++)if(!this._holes[s].equalsExact(r._holes[s],n))return!1;return!0}return t.prototype.equalsExact.apply(this,arguments)},e.prototype.normalize=function(){if(0===arguments.length){this.normalize(this._shell,!0);for(var t=0;t<this._holes.length;t++)this.normalize(this._holes[t],!1);qc.sort(this._holes)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];if(e.isEmpty())return null;var r=new Array(e.getCoordinates().length-1).fill(null);Xu.arraycopy(e.getCoordinates(),0,r,0,r.length);var i=Cc.minCoordinate(e.getCoordinates());Cc.scroll(r,i),Xu.arraycopy(r,0,e.getCoordinates(),0,r.length),e.getCoordinates()[r.length]=r[0],sc.isCCW(e.getCoordinates())===n&&Cc.reverse(e.getCoordinates())}},e.prototype.getCoordinate=function(){return this._shell.getCoordinate()},e.prototype.getNumInteriorRing=function(){return this._holes.length},e.prototype.getBoundaryDimension=function(){return 1},e.prototype.getDimension=function(){return 2},e.prototype.getLength=function(){var t=0;t+=this._shell.getLength();for(var e=0;e<this._holes.length;e++)t+=this._holes[e].getLength();return t},e.prototype.getNumPoints=function(){for(var t=this._shell.getNumPoints(),e=0;e<this._holes.length;e++)t+=this._holes[e].getNumPoints();return t},e.prototype.reverse=function(){var t=this.copy();t._shell=this._shell.copy().reverse(),t._holes=new Array(this._holes.length).fill(null);for(var e=0;e<this._holes.length;e++)t._holes[e]=this._holes[e].copy().reverse();return t},e.prototype.convexHull=function(){return this.getExteriorRing().convexHull()},e.prototype.compareToSameClass=function(){if(1===arguments.length){var t=arguments[0],e=this._shell,n=t._shell;return e.compareToSameClass(n)}if(2===arguments.length){var r=arguments[1],i=arguments[0],o=this._shell,s=i._shell,a=o.compareToSameClass(s,r);if(0!==a)return a;for(var u=this.getNumInteriorRing(),c=i.getNumInteriorRing(),h=0;h<u&&h<c;){var l=this.getInteriorRingN(h),p=i.getInteriorRingN(h),f=l.compareToSameClass(p,r);if(0!==f)return f;h++}return h<u?1:h<c?-1:0}},e.prototype.apply=function(t){if(Lu(t,pc)){this._shell.apply(t);for(var e=0;e<this._holes.length;e++)this._holes[e].apply(t)}else if(Lu(t,zc)){if(this._shell.apply(t),!t.isDone())for(var n=0;n<this._holes.length&&(this._holes[n].apply(t),!t.isDone());n++);t.isGeometryChanged()&&this.geometryChanged()}else if(Lu(t,kc))t.filter(this);else if(Lu(t,uc)){t.filter(this),this._shell.apply(t);for(var r=0;r<this._holes.length;r++)this._holes[r].apply(t)}},e.prototype.getBoundary=function(){if(this.isEmpty())return this.getFactory().createMultiLineString();var t=new Array(this._holes.length+1).fill(null);t[0]=this._shell;for(var e=0;e<this._holes.length;e++)t[e+1]=this._holes[e];return t.length<=1?this.getFactory().createLinearRing(t[0].getCoordinateSequence()):this.getFactory().createMultiLineString(t)},e.prototype.clone=function(){var e=t.prototype.clone.call(this);e._shell=this._shell.clone(),e._holes=new Array(this._holes.length).fill(null);for(var n=0;n<this._holes.length;n++)e._holes[n]=this._holes[n].clone();return e},e.prototype.getGeometryType=function(){return"Polygon"},e.prototype.copy=function(){for(var t=this._shell.copy(),n=new Array(this._holes.length).fill(null),r=0;r<n.length;r++)n[r]=this._holes[r].copy();return new e(t,n,this._factory)},e.prototype.getExteriorRing=function(){return this._shell},e.prototype.isEmpty=function(){return this._shell.isEmpty()},e.prototype.getInteriorRingN=function(t){return this._holes[t]},e.prototype.interfaces_=function(){return[Qc]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return-0x307ffefd8dc97200},Object.defineProperties(e,n),e}(cc),th=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 cc.SORTINDEX_MULTIPOINT},e.prototype.isValid=function(){return!0},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.getCoordinate=function(){if(1===arguments.length){var e=arguments[0];return this._geometries[e].getCoordinate()}return t.prototype.getCoordinate.apply(this,arguments)},e.prototype.getBoundaryDimension=function(){return Gc.FALSE},e.prototype.getDimension=function(){return 0},e.prototype.getBoundary=function(){return this.getFactory().createGeometryCollection(null)},e.prototype.getGeometryType=function(){return"MultiPoint"},e.prototype.copy=function(){for(var t=new Array(this._geometries.length).fill(null),n=0;n<t.length;n++)t[n]=this._geometries[n].copy();return new e(t,this._factory)},e.prototype.interfaces_=function(){return[Zc]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return-0x6fb1ed4162e0fc00},Object.defineProperties(e,n),e}(jc),eh=function(t){function e(e,n){e instanceof bu&&n instanceof _h&&(e=n.getCoordinateSequenceFactory().create(e)),t.call(this,e,n),this.validateConstruction()}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={MINIMUM_VALID_SIZE:{configurable:!0},serialVersionUID:{configurable:!0}};return e.prototype.getSortIndex=function(){return cc.SORTINDEX_LINEARRING},e.prototype.getBoundaryDimension=function(){return Gc.FALSE},e.prototype.isClosed=function(){return!!this.isEmpty()||t.prototype.isClosed.call(this)},e.prototype.reverse=function(){var t=this._points.copy();return Wc.reverse(t),this.getFactory().createLinearRing(t)},e.prototype.validateConstruction=function(){if(!this.isEmpty()&&!t.prototype.isClosed.call(this))throw new _u("Points of LinearRing do not form a closed linestring");if(this.getCoordinateSequence().size()>=1&&this.getCoordinateSequence().size()<e.MINIMUM_VALID_SIZE)throw new _u("Invalid number of points in LinearRing (found "+this.getCoordinateSequence().size()+" - must be 0 or >= 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}(Jc),nh=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 cc.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;n<this._geometries.length;n++)e[n]=this._geometries[n].reverse();return this.getFactory().createMultiPolygon(e)},e.prototype.getBoundary=function(){if(this.isEmpty())return this.getFactory().createMultiLineString();for(var t=new bc,e=0;e<this._geometries.length;e++)for(var n=this._geometries[e].getBoundary(),r=0;r<n.getNumGeometries();r++)t.add(n.getGeometryN(r));var i=new Array(t.size()).fill(null);return this.getFactory().createMultiLineString(t.toArray(i))},e.prototype.getGeometryType=function(){return"MultiPolygon"},e.prototype.copy=function(){for(var t=new Array(this._geometries.length).fill(null),n=0;n<t.length;n++)t[n]=this._geometries[n].copy();return new e(t,this._factory)},e.prototype.interfaces_=function(){return[Qc]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return-0x7a5aa1369171980},Object.defineProperties(e,n),e}(jc),rh=function(t){this._factory=t||null,this._isUserDataCopied=!1},ih={NoOpGeometryOperation:{configurable:!0},CoordinateOperation:{configurable:!0},CoordinateSequenceOperation:{configurable:!0}};rh.prototype.setCopyUserData=function(t){this._isUserDataCopied=t},rh.prototype.edit=function(t,e){if(null===t)return null;var n=this.editInternal(t,e);return this._isUserDataCopied&&n.setUserData(t.getUserData()),n},rh.prototype.editInternal=function(t,e){return null===this._factory&&(this._factory=t.getFactory()),t instanceof jc?this.editGeometryCollection(t,e):t instanceof $c?this.editPolygon(t,e):t instanceof Kc||t instanceof Jc?e.edit(t,this._factory):(tc.shouldNeverReachHere("Unsupported Geometry class: "+t.getClass().getName()),null)},rh.prototype.editGeometryCollection=function(t,e){for(var n=e.edit(t,this._factory),r=new bc,i=0;i<n.getNumGeometries();i++){var o=this.edit(n.getGeometryN(i),e);null===o||o.isEmpty()||r.add(o)}return n.getClass()===th?this._factory.createMultiPoint(r.toArray([])):n.getClass()===Xc?this._factory.createMultiLineString(r.toArray([])):n.getClass()===nh?this._factory.createMultiPolygon(r.toArray([])):this._factory.createGeometryCollection(r.toArray([]))},rh.prototype.editPolygon=function(t,e){var n=e.edit(t,this._factory);if(null===n&&(n=this._factory.createPolygon(null)),n.isEmpty())return n;var r=this.edit(n.getExteriorRing(),e);if(null===r||r.isEmpty())return this._factory.createPolygon();for(var i=new bc,o=0;o<n.getNumInteriorRing();o++){var s=this.edit(n.getInteriorRingN(o),e);null===s||s.isEmpty()||i.add(s)}return this._factory.createPolygon(r,i.toArray([]))},rh.prototype.interfaces_=function(){return[]},rh.prototype.getClass=function(){return rh},rh.GeometryEditorOperation=function(){},ih.NoOpGeometryOperation.get=function(){return oh},ih.CoordinateOperation.get=function(){return sh},ih.CoordinateSequenceOperation.get=function(){return ah},Object.defineProperties(rh,ih);var oh=function(){};oh.prototype.edit=function(t,e){return t},oh.prototype.interfaces_=function(){return[rh.GeometryEditorOperation]},oh.prototype.getClass=function(){return oh};var sh=function(){};sh.prototype.edit=function(t,e){var n=this.editCoordinates(t.getCoordinates(),t);return null===n?t:t instanceof eh?e.createLinearRing(n):t instanceof Jc?e.createLineString(n):t instanceof Kc?n.length>0?e.createPoint(n[0]):e.createPoint():t},sh.prototype.interfaces_=function(){return[rh.GeometryEditorOperation]},sh.prototype.getClass=function(){return sh};var ah=function(){};ah.prototype.edit=function(t,e){return t instanceof eh?e.createLinearRing(this.edit(t.getCoordinateSequence(),t)):t instanceof Jc?e.createLineString(this.edit(t.getCoordinateSequence(),t)):t instanceof Kc?e.createPoint(this.edit(t.getCoordinateSequence(),t)):t},ah.prototype.interfaces_=function(){return[rh.GeometryEditorOperation]},ah.prototype.getClass=function(){return ah};var uh=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;e<t;e++)this._coordinates[e]=new bu}else if(Lu(arguments[0],Bu)){var n=arguments[0];if(null===n)return this._coordinates=new Array(0).fill(null),null;this._dimension=n.getDimension(),this._coordinates=new Array(n.size()).fill(null);for(var r=0;r<this._coordinates.length;r++)this._coordinates[r]=n.getCoordinateCopy(r)}}else if(2===arguments.length)if(arguments[0]instanceof Array&&Number.isInteger(arguments[1])){var i=arguments[0],o=arguments[1];this._coordinates=i,this._dimension=o,null===i&&(this._coordinates=new Array(0).fill(null))}else if(Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var s=arguments[0],a=arguments[1];this._coordinates=new Array(s).fill(null),this._dimension=a;for(var u=0;u<s;u++)this._coordinates[u]=new bu}},ch={serialVersionUID:{configurable:!0}};uh.prototype.setOrdinate=function(t,e,n){switch(e){case Bu.X:this._coordinates[t].x=n;break;case Bu.Y:this._coordinates[t].y=n;break;case Bu.Z:this._coordinates[t].z=n;break;default:throw new _u("invalid ordinateIndex")}},uh.prototype.size=function(){return this._coordinates.length},uh.prototype.getOrdinate=function(t,e){switch(e){case Bu.X:return this._coordinates[t].x;case Bu.Y:return this._coordinates[t].y;case Bu.Z:return this._coordinates[t].z}return mu.NaN},uh.prototype.getCoordinate=function(){if(1===arguments.length){var t=arguments[0];return this._coordinates[t]}if(2===arguments.length){var e=arguments[0],n=arguments[1];n.x=this._coordinates[e].x,n.y=this._coordinates[e].y,n.z=this._coordinates[e].z}},uh.prototype.getCoordinateCopy=function(t){return new bu(this._coordinates[t])},uh.prototype.getDimension=function(){return this._dimension},uh.prototype.getX=function(t){return this._coordinates[t].x},uh.prototype.clone=function(){for(var t=new Array(this.size()).fill(null),e=0;e<this._coordinates.length;e++)t[e]=this._coordinates[e].clone();return new uh(t,this._dimension)},uh.prototype.expandEnvelope=function(t){for(var e=0;e<this._coordinates.length;e++)t.expandToInclude(this._coordinates[e]);return t},uh.prototype.copy=function(){for(var t=new Array(this.size()).fill(null),e=0;e<this._coordinates.length;e++)t[e]=this._coordinates[e].copy();return new uh(t,this._dimension)},uh.prototype.toString=function(){if(this._coordinates.length>0){var t=new Ru(17*this._coordinates.length);t.append("("),t.append(this._coordinates[0]);for(var e=1;e<this._coordinates.length;e++)t.append(", "),t.append(this._coordinates[e]);return t.append(")"),t.toString()}return"()"},uh.prototype.getY=function(t){return this._coordinates[t].y},uh.prototype.toCoordinateArray=function(){return this._coordinates},uh.prototype.interfaces_=function(){return[Bu,Li]},uh.prototype.getClass=function(){return uh},ch.serialVersionUID.get=function(){return-0xcb44a778db18e00},Object.defineProperties(uh,ch);var hh=function(){},lh={serialVersionUID:{configurable:!0},instanceObject:{configurable:!0}};hh.prototype.readResolve=function(){return hh.instance()},hh.prototype.create=function(){if(1===arguments.length){if(arguments[0]instanceof Array)return new uh(arguments[0]);if(Lu(arguments[0],Bu))return new uh(arguments[0])}else if(2===arguments.length){var t=arguments[0],e=arguments[1];return e>3&&(e=3),e<2?new uh(t):new uh(t,e)}},hh.prototype.interfaces_=function(){return[Cu,Li]},hh.prototype.getClass=function(){return hh},hh.instance=function(){return hh.instanceObject},lh.serialVersionUID.get=function(){return-0x38e49fa6cf6f2e00},lh.instanceObject.get=function(){return new hh},Object.defineProperties(hh,lh);var ph=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 bc,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 Rc;return this.map_.entries().forEach((function(e){return t.add(e)})),t},e.prototype.size=function(){return this.map_.size()},e}(Pc),fh=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 dh){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}},gh={serialVersionUID:{configurable:!0},maximumPreciseValue:{configurable:!0}};fh.prototype.equals=function(t){if(!(t instanceof fh))return!1;var e=t;return this._modelType===e._modelType&&this._scale===e._scale},fh.prototype.compareTo=function(t){var e=t,n=this.getMaximumSignificantDigits(),r=e.getMaximumSignificantDigits();return new Tu(n).compareTo(new Tu(r))},fh.prototype.getScale=function(){return this._scale},fh.prototype.isFloating=function(){return this._modelType===fh.FLOATING||this._modelType===fh.FLOATING_SINGLE},fh.prototype.getType=function(){return this._modelType},fh.prototype.toString=function(){var t="UNKNOWN";return this._modelType===fh.FLOATING?t="Floating":this._modelType===fh.FLOATING_SINGLE?t="Floating-Single":this._modelType===fh.FIXED&&(t="Fixed (Scale="+this.getScale()+")"),t},fh.prototype.makePrecise=function(){if("number"==typeof arguments[0]){var t=arguments[0];return mu.isNaN(t)||this._modelType===fh.FLOATING_SINGLE?t:this._modelType===fh.FIXED?Math.round(t*this._scale)/this._scale:t}if(arguments[0]instanceof bu){var e=arguments[0];if(this._modelType===fh.FLOATING)return null;e.x=this.makePrecise(e.x),e.y=this.makePrecise(e.y)}},fh.prototype.getMaximumSignificantDigits=function(){var t=16;return this._modelType===fh.FLOATING?t=16:this._modelType===fh.FLOATING_SINGLE?t=6:this._modelType===fh.FIXED&&(t=1+Math.trunc(Math.ceil(Math.log(this.getScale())/Math.log(10)))),t},fh.prototype.setScale=function(t){this._scale=Math.abs(t)},fh.prototype.interfaces_=function(){return[Li,xu]},fh.prototype.getClass=function(){return fh},fh.mostPrecise=function(t,e){return t.compareTo(e)>=0?t:e},gh.serialVersionUID.get=function(){return 0x6bee6404e9a25c00},gh.maximumPreciseValue.get=function(){return 9007199254740992},Object.defineProperties(fh,gh);var dh=function t(e){this._name=e||null,t.nameToTypeMap.put(e,this)},yh={serialVersionUID:{configurable:!0},nameToTypeMap:{configurable:!0}};dh.prototype.readResolve=function(){return dh.nameToTypeMap.get(this._name)},dh.prototype.toString=function(){return this._name},dh.prototype.interfaces_=function(){return[Li]},dh.prototype.getClass=function(){return dh},yh.serialVersionUID.get=function(){return-552860263173159e4},yh.nameToTypeMap.get=function(){return new ph},Object.defineProperties(dh,yh),fh.Type=dh,fh.FIXED=new dh("FIXED"),fh.FLOATING=new dh("FLOATING"),fh.FLOATING_SINGLE=new dh("FLOATING SINGLE");var _h=function t(){this._precisionModel=new fh,this._SRID=0,this._coordinateSequenceFactory=t.getDefaultCoordinateSequenceFactory(),0===arguments.length||(1===arguments.length?Lu(arguments[0],Cu)?this._coordinateSequenceFactory=arguments[0]:arguments[0]instanceof fh&&(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]))},mh={serialVersionUID:{configurable:!0}};_h.prototype.toGeometry=function(t){return t.isNull()?this.createPoint(null):t.getMinX()===t.getMaxX()&&t.getMinY()===t.getMaxY()?this.createPoint(new bu(t.getMinX(),t.getMinY())):t.getMinX()===t.getMaxX()||t.getMinY()===t.getMaxY()?this.createLineString([new bu(t.getMinX(),t.getMinY()),new bu(t.getMaxX(),t.getMaxY())]):this.createPolygon(this.createLinearRing([new bu(t.getMinX(),t.getMinY()),new bu(t.getMinX(),t.getMaxY()),new bu(t.getMaxX(),t.getMaxY()),new bu(t.getMaxX(),t.getMinY()),new bu(t.getMinX(),t.getMinY())]),null)},_h.prototype.createLineString=function(t){return t?t instanceof Array?new Jc(this.getCoordinateSequenceFactory().create(t),this):Lu(t,Bu)?new Jc(t,this):void 0:new Jc(this.getCoordinateSequenceFactory().create([]),this)},_h.prototype.createMultiLineString=function(){return 0===arguments.length?new Xc(null,this):1===arguments.length?new Xc(arguments[0],this):void 0},_h.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(_h.toGeometryArray(t));var a=t.iterator().next();if(t.size()>1){if(a instanceof $c)return this.createMultiPolygon(_h.toPolygonArray(t));if(a instanceof Jc)return this.createMultiLineString(_h.toLineStringArray(t));if(a instanceof Kc)return this.createMultiPoint(_h.toPointArray(t));tc.shouldNeverReachHere("Unhandled class: "+a.getClass().getName())}return a},_h.prototype.createMultiPointFromCoords=function(t){return this.createMultiPoint(null!==t?this.getCoordinateSequenceFactory().create(t):null)},_h.prototype.createPoint=function(){if(0===arguments.length)return this.createPoint(this.getCoordinateSequenceFactory().create([]));if(1===arguments.length){if(arguments[0]instanceof bu){var t=arguments[0];return this.createPoint(null!==t?this.getCoordinateSequenceFactory().create([t]):null)}if(Lu(arguments[0],Bu))return new Kc(arguments[0],this)}},_h.prototype.getCoordinateSequenceFactory=function(){return this._coordinateSequenceFactory},_h.prototype.createPolygon=function(){if(0===arguments.length)return new $c(null,null,this);if(1===arguments.length){if(Lu(arguments[0],Bu)){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 eh){var n=arguments[0];return this.createPolygon(n,null)}}else if(2===arguments.length)return new $c(arguments[0],arguments[1],this)},_h.prototype.getSRID=function(){return this._SRID},_h.prototype.createGeometryCollection=function(){return 0===arguments.length?new jc(null,this):1===arguments.length?new jc(arguments[0],this):void 0},_h.prototype.createGeometry=function(t){return new rh(this).edit(t,{edit:function(){if(2===arguments.length){var t=arguments[0];return this._coordinateSequenceFactory.create(t)}}})},_h.prototype.getPrecisionModel=function(){return this._precisionModel},_h.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(Lu(arguments[0],Bu))return new eh(arguments[0],this)}},_h.prototype.createMultiPolygon=function(){return 0===arguments.length?new nh(null,this):1===arguments.length?new nh(arguments[0],this):void 0},_h.prototype.createMultiPoint=function(){if(0===arguments.length)return new th(null,this);if(1===arguments.length){if(arguments[0]instanceof Array)return new th(arguments[0],this);if(arguments[0]instanceof Array){var t=arguments[0];return this.createMultiPoint(null!==t?this.getCoordinateSequenceFactory().create(t):null)}if(Lu(arguments[0],Bu)){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<e.size();r++){var i=this.getCoordinateSequenceFactory().create(1,e.getDimension());Wc.copy(e,r,i,0,1),n[r]=this.createPoint(i)}return this.createMultiPoint(n)}}},_h.prototype.interfaces_=function(){return[Li]},_h.prototype.getClass=function(){return _h},_h.toMultiPolygonArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},_h.toGeometryArray=function(t){if(null===t)return null;var e=new Array(t.size()).fill(null);return t.toArray(e)},_h.getDefaultCoordinateSequenceFactory=function(){return hh.instance()},_h.toMultiLineStringArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},_h.toLineStringArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},_h.toMultiPointArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},_h.toLinearRingArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},_h.toPointArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},_h.toPolygonArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},_h.createPointFromInternalCoord=function(t,e){return e.getPrecisionModel().makePrecise(t),e.getFactory().createPoint(t)},mh.serialVersionUID.get=function(){return-0x5ea75f2051eeb400},Object.defineProperties(_h,mh);var vh=["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon"],xh=function(t){this.geometryFactory=t||new _h};xh.prototype.read=function(t){var e,n=(e="string"==typeof t?JSON.parse(t):t).type;if(!Eh[n])throw new Error("Unknown GeoJSON type: "+e.type);return-1!==vh.indexOf(n)?Eh[n].apply(this,[e.coordinates]):"GeometryCollection"===n?Eh[n].apply(this,[e.geometries]):Eh[n].apply(this,[e])},xh.prototype.write=function(t){var e=t.getGeometryType();if(!wh[e])throw new Error("Geometry is not supported");return wh[e].apply(this,[t])};var Eh={Feature:function(t){var e={};for(var n in t)e[n]=t[n];if(t.geometry){var r=t.geometry.type;if(!Eh[r])throw new Error("Unknown GeoJSON type: "+t.type);e.geometry=this.read(t.geometry)}return t.bbox&&(e.bbox=Eh.bbox.apply(this,[t.bbox])),e},FeatureCollection:function(t){var e={};if(t.features){e.features=[];for(var n=0;n<t.features.length;++n)e.features.push(this.read(t.features[n]))}return t.bbox&&(e.bbox=this.parse.bbox.apply(this,[t.bbox])),e},coordinates:function(t){for(var e=[],n=0;n<t.length;++n){var r=t[n];e.push(new bu(r[0],r[1]))}return e},bbox:function(t){return this.geometryFactory.createLinearRing([new bu(t[0],t[1]),new bu(t[2],t[1]),new bu(t[2],t[3]),new bu(t[0],t[3]),new bu(t[0],t[1])])},Point:function(t){var e=new bu(t[0],t[1]);return this.geometryFactory.createPoint(e)},MultiPoint:function(t){for(var e=[],n=0;n<t.length;++n)e.push(Eh.Point.apply(this,[t[n]]));return this.geometryFactory.createMultiPoint(e)},LineString:function(t){var e=Eh.coordinates.apply(this,[t]);return this.geometryFactory.createLineString(e)},MultiLineString:function(t){for(var e=[],n=0;n<t.length;++n)e.push(Eh.LineString.apply(this,[t[n]]));return this.geometryFactory.createMultiLineString(e)},Polygon:function(t){for(var e=Eh.coordinates.apply(this,[t[0]]),n=this.geometryFactory.createLinearRing(e),r=[],i=1;i<t.length;++i){var o=t[i],s=Eh.coordinates.apply(this,[o]),a=this.geometryFactory.createLinearRing(s);r.push(a)}return this.geometryFactory.createPolygon(n,r)},MultiPolygon:function(t){for(var e=[],n=0;n<t.length;++n){var r=t[n];e.push(Eh.Polygon.apply(this,[r]))}return this.geometryFactory.createMultiPolygon(e)},GeometryCollection:function(t){for(var e=[],n=0;n<t.length;++n){var r=t[n];e.push(this.read(r))}return this.geometryFactory.createGeometryCollection(e)}},wh={coordinate:function(t){return[t.x,t.y]},Point:function(t){return{type:"Point",coordinates:wh.coordinate.apply(this,[t.getCoordinate()])}},MultiPoint:function(t){for(var e=[],n=0;n<t._geometries.length;++n){var r=t._geometries[n],i=wh.Point.apply(this,[r]);e.push(i.coordinates)}return{type:"MultiPoint",coordinates:e}},LineString:function(t){for(var e=[],n=t.getCoordinates(),r=0;r<n.length;++r){var i=n[r];e.push(wh.coordinate.apply(this,[i]))}return{type:"LineString",coordinates:e}},MultiLineString:function(t){for(var e=[],n=0;n<t._geometries.length;++n){var r=t._geometries[n],i=wh.LineString.apply(this,[r]);e.push(i.coordinates)}return{type:"MultiLineString",coordinates:e}},Polygon:function(t){var e=[],n=wh.LineString.apply(this,[t._shell]);e.push(n.coordinates);for(var r=0;r<t._holes.length;++r){var i=t._holes[r],o=wh.LineString.apply(this,[i]);e.push(o.coordinates)}return{type:"Polygon",coordinates:e}},MultiPolygon:function(t){for(var e=[],n=0;n<t._geometries.length;++n){var r=t._geometries[n],i=wh.Polygon.apply(this,[r]);e.push(i.coordinates)}return{type:"MultiPolygon",coordinates:e}},GeometryCollection:function(t){for(var e=[],n=0;n<t._geometries.length;++n){var r=t._geometries[n],i=r.getGeometryType();e.push(wh[i].apply(this,[r]))}return{type:"GeometryCollection",geometries:e}}},bh=function(t){this.geometryFactory=t||new _h,this.precisionModel=this.geometryFactory.getPrecisionModel(),this.parser=new xh(this.geometryFactory)};bh.prototype.read=function(t){var e=this.parser.read(t);return this.precisionModel.getType()===fh.FIXED&&this.reducePrecision(e),e},bh.prototype.reducePrecision=function(t){var e,n;if(t.coordinate)this.precisionModel.makePrecise(t.coordinate);else if(t.points)for(e=0,n=t.points.length;e<n;e++)this.precisionModel.makePrecise(t.points[e]);else if(t.geometries)for(e=0,n=t.geometries.length;e<n;e++)this.reducePrecision(t.geometries[e])};var Ih=function(){this.parser=new xh(this.geometryFactory)};Ih.prototype.write=function(t){return this.parser.write(t)};var Nh=function(){},Ch={ON:{configurable:!0},LEFT:{configurable:!0},RIGHT:{configurable:!0}};Nh.prototype.interfaces_=function(){return[]},Nh.prototype.getClass=function(){return Nh},Nh.opposite=function(t){return t===Nh.LEFT?Nh.RIGHT:t===Nh.RIGHT?Nh.LEFT:t},Ch.ON.get=function(){return 0},Ch.LEFT.get=function(){return 1},Ch.RIGHT.get=function(){return 2},Object.defineProperties(Nh,Ch),(ji.prototype=new Error).name="EmptyStackException",(Xi.prototype=new wc).add=function(t){return this.array_.push(t),!0},Xi.prototype.get=function(t){if(t<0||t>=this.size())throw new Error;return this.array_[t]},Xi.prototype.push=function(t){return this.array_.push(t),t},Xi.prototype.pop=function(t){if(0===this.array_.length)throw new ji;return this.array_.pop()},Xi.prototype.peek=function(){if(0===this.array_.length)throw new ji;return this.array_[this.array_.length-1]},Xi.prototype.empty=function(){return 0===this.array_.length},Xi.prototype.isEmpty=function(){return this.empty()},Xi.prototype.search=function(t){return this.array_.indexOf(t)},Xi.prototype.size=function(){return this.array_.length},Xi.prototype.toArray=function(){for(var t=[],e=0,n=this.array_.length;e<n;e++)t.push(this.array_[e]);return t};var Sh=function(){this._minIndex=-1,this._minCoord=null,this._minDe=null,this._orientedDe=null};Sh.prototype.getCoordinate=function(){return this._minCoord},Sh.prototype.getRightmostSide=function(t,e){var n=this.getRightmostSideOfSegment(t,e);return n<0&&(n=this.getRightmostSideOfSegment(t,e-1)),n<0&&(this._minCoord=null,this.checkForRightmostCoordinate(t)),n},Sh.prototype.findRightmostEdgeAtVertex=function(){var t=this._minDe.getEdge().getCoordinates();tc.isTrue(this._minIndex>0&&this._minIndex<t.length,"rightmost point expected to be interior vertex of edge");var e=t[this._minIndex-1],n=t[this._minIndex+1],r=sc.computeOrientation(this._minCoord,n,e),i=!1;(e.y<this._minCoord.y&&n.y<this._minCoord.y&&r===sc.COUNTERCLOCKWISE||e.y>this._minCoord.y&&n.y>this._minCoord.y&&r===sc.CLOCKWISE)&&(i=!0),i&&(this._minIndex=this._minIndex-1)},Sh.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=Nh.LEFT;return n[e].y<n[e+1].y&&(r=Nh.RIGHT),r},Sh.prototype.getEdge=function(){return this._orientedDe},Sh.prototype.checkForRightmostCoordinate=function(t){for(var e=t.getEdge().getCoordinates(),n=0;n<e.length-1;n++)(null===this._minCoord||e[n].x>this._minCoord.x)&&(this._minDe=t,this._minIndex=n,this._minCoord=e[n])},Sh.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)},Sh.prototype.findEdge=function(t){for(var e=t.iterator();e.hasNext();){var n=e.next();n.isForward()&&this.checkForRightmostCoordinate(n)}tc.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)===Nh.LEFT&&(this._orientedDe=this._minDe.getSym())},Sh.prototype.interfaces_=function(){return[]},Sh.prototype.getClass=function(){return Sh};var Mh=function(t){function e(n,r){t.call(this,e.msgWithCoord(n,r)),this.pt=r?new bu(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}(Qu),Lh=function(){this.array_=[]};Lh.prototype.addLast=function(t){this.array_.push(t)},Lh.prototype.removeFirst=function(){return this.array_.shift()},Lh.prototype.isEmpty=function(){return 0===this.array_.length};var Ph=function(){this._finder=null,this._dirEdgeList=new bc,this._nodes=new bc,this._rightMostCoord=null,this._env=null,this._finder=new Sh};Ph.prototype.clearVisitedEdges=function(){for(var t=this._dirEdgeList.iterator();t.hasNext();)t.next().setVisited(!1)},Ph.prototype.getRightmostCoordinate=function(){return this._rightMostCoord},Ph.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 Mh("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)}},Ph.prototype.computeDepth=function(t){this.clearVisitedEdges();var e=this._finder.getEdge();e.setEdgeDepths(Nh.RIGHT,t),this.copySymDepths(e),this.computeDepths(e)},Ph.prototype.create=function(t){this.addReachable(t),this._finder.findEdge(this._dirEdgeList),this._rightMostCoord=this._finder.getCoordinate()},Ph.prototype.findResultEdges=function(){for(var t=this._dirEdgeList.iterator();t.hasNext();){var e=t.next();e.getDepth(Nh.RIGHT)>=1&&e.getDepth(Nh.LEFT)<=0&&!e.isInteriorAreaEdge()&&e.setInResult(!0)}},Ph.prototype.computeDepths=function(t){var e=new Rc,n=new Lh,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))}}}},Ph.prototype.compareTo=function(t){var e=t;return this._rightMostCoord.x<e._rightMostCoord.x?-1:this._rightMostCoord.x>e._rightMostCoord.x?1:0},Ph.prototype.getEnvelope=function(){if(null===this._env){for(var t=new Yu,e=this._dirEdgeList.iterator();e.hasNext();)for(var n=e.next().getEdge().getCoordinates(),r=0;r<n.length-1;r++)t.expandToInclude(n[r]);this._env=t}return this._env},Ph.prototype.addReachable=function(t){var e=new Xi;for(e.add(t);!e.empty();){var n=e.pop();this.add(n,e)}},Ph.prototype.copySymDepths=function(t){var e=t.getSym();e.setDepth(Nh.LEFT,t.getDepth(Nh.RIGHT)),e.setDepth(Nh.RIGHT,t.getDepth(Nh.LEFT))},Ph.prototype.add=function(t,e){t.setVisited(!0),this._nodes.add(t);for(var n=t.getEdges().iterator();n.hasNext();){var r=n.next();this._dirEdgeList.add(r);var i=r.getSym().getNode();i.isVisited()||e.push(i)}},Ph.prototype.getNodes=function(){return this._nodes},Ph.prototype.getDirectedEdges=function(){return this._dirEdgeList},Ph.prototype.interfaces_=function(){return[xu]},Ph.prototype.getClass=function(){return Ph};var Oh=function t(){if(this.location=null,1===arguments.length){if(arguments[0]instanceof Array){var e=arguments[0];this.init(e.length)}else if(Number.isInteger(arguments[0])){var n=arguments[0];this.init(1),this.location[Nh.ON]=n}else if(arguments[0]instanceof t){var r=arguments[0];if(this.init(r.location.length),null!==r)for(var i=0;i<this.location.length;i++)this.location[i]=r.location[i]}}else if(3===arguments.length){var o=arguments[0],s=arguments[1],a=arguments[2];this.init(3),this.location[Nh.ON]=o,this.location[Nh.LEFT]=s,this.location[Nh.RIGHT]=a}};Oh.prototype.setAllLocations=function(t){for(var e=0;e<this.location.length;e++)this.location[e]=t},Oh.prototype.isNull=function(){for(var t=0;t<this.location.length;t++)if(this.location[t]!==Su.NONE)return!1;return!0},Oh.prototype.setAllLocationsIfNull=function(t){for(var e=0;e<this.location.length;e++)this.location[e]===Su.NONE&&(this.location[e]=t)},Oh.prototype.isLine=function(){return 1===this.location.length},Oh.prototype.merge=function(t){if(t.location.length>this.location.length){var e=new Array(3).fill(null);e[Nh.ON]=this.location[Nh.ON],e[Nh.LEFT]=Su.NONE,e[Nh.RIGHT]=Su.NONE,this.location=e}for(var n=0;n<this.location.length;n++)this.location[n]===Su.NONE&&n<t.location.length&&(this.location[n]=t.location[n])},Oh.prototype.getLocations=function(){return this.location},Oh.prototype.flip=function(){if(this.location.length<=1)return null;var t=this.location[Nh.LEFT];this.location[Nh.LEFT]=this.location[Nh.RIGHT],this.location[Nh.RIGHT]=t},Oh.prototype.toString=function(){var t=new Ru;return this.location.length>1&&t.append(Su.toLocationSymbol(this.location[Nh.LEFT])),t.append(Su.toLocationSymbol(this.location[Nh.ON])),this.location.length>1&&t.append(Su.toLocationSymbol(this.location[Nh.RIGHT])),t.toString()},Oh.prototype.setLocations=function(t,e,n){this.location[Nh.ON]=t,this.location[Nh.LEFT]=e,this.location[Nh.RIGHT]=n},Oh.prototype.get=function(t){return t<this.location.length?this.location[t]:Su.NONE},Oh.prototype.isArea=function(){return this.location.length>1},Oh.prototype.isAnyNull=function(){for(var t=0;t<this.location.length;t++)if(this.location[t]===Su.NONE)return!0;return!1},Oh.prototype.setLocation=function(){if(1===arguments.length){var t=arguments[0];this.setLocation(Nh.ON,t)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this.location[e]=n}},Oh.prototype.init=function(t){this.location=new Array(t).fill(null),this.setAllLocations(Su.NONE)},Oh.prototype.isEqualOnSide=function(t,e){return this.location[e]===t.location[e]},Oh.prototype.allPositionsEqual=function(t){for(var e=0;e<this.location.length;e++)if(this.location[e]!==t)return!1;return!0},Oh.prototype.interfaces_=function(){return[]},Oh.prototype.getClass=function(){return Oh};var Rh=function t(){if(this.elt=new Array(2).fill(null),1===arguments.length){if(Number.isInteger(arguments[0])){var e=arguments[0];this.elt[0]=new Oh(e),this.elt[1]=new Oh(e)}else if(arguments[0]instanceof t){var n=arguments[0];this.elt[0]=new Oh(n.elt[0]),this.elt[1]=new Oh(n.elt[1])}}else if(2===arguments.length){var r=arguments[0],i=arguments[1];this.elt[0]=new Oh(Su.NONE),this.elt[1]=new Oh(Su.NONE),this.elt[r].setLocation(i)}else if(3===arguments.length){var o=arguments[0],s=arguments[1],a=arguments[2];this.elt[0]=new Oh(o,s,a),this.elt[1]=new Oh(o,s,a)}else if(4===arguments.length){var u=arguments[0],c=arguments[1],h=arguments[2],l=arguments[3];this.elt[0]=new Oh(Su.NONE,Su.NONE,Su.NONE),this.elt[1]=new Oh(Su.NONE,Su.NONE,Su.NONE),this.elt[u].setLocations(c,h,l)}};Rh.prototype.getGeometryCount=function(){var t=0;return this.elt[0].isNull()||t++,this.elt[1].isNull()||t++,t},Rh.prototype.setAllLocations=function(t,e){this.elt[t].setAllLocations(e)},Rh.prototype.isNull=function(t){return this.elt[t].isNull()},Rh.prototype.setAllLocationsIfNull=function(){if(1===arguments.length){var t=arguments[0];this.setAllLocationsIfNull(0,t),this.setAllLocationsIfNull(1,t)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this.elt[e].setAllLocationsIfNull(n)}},Rh.prototype.isLine=function(t){return this.elt[t].isLine()},Rh.prototype.merge=function(t){for(var e=0;e<2;e++)null===this.elt[e]&&null!==t.elt[e]?this.elt[e]=new Oh(t.elt[e]):this.elt[e].merge(t.elt[e])},Rh.prototype.flip=function(){this.elt[0].flip(),this.elt[1].flip()},Rh.prototype.getLocation=function(){if(1===arguments.length){var t=arguments[0];return this.elt[t].get(Nh.ON)}if(2===arguments.length){var e=arguments[0],n=arguments[1];return this.elt[e].get(n)}},Rh.prototype.toString=function(){var t=new Ru;return null!==this.elt[0]&&(t.append("A:"),t.append(this.elt[0].toString())),null!==this.elt[1]&&(t.append(" B:"),t.append(this.elt[1].toString())),t.toString()},Rh.prototype.isArea=function(){if(0===arguments.length)return this.elt[0].isArea()||this.elt[1].isArea();if(1===arguments.length){var t=arguments[0];return this.elt[t].isArea()}},Rh.prototype.isAnyNull=function(t){return this.elt[t].isAnyNull()},Rh.prototype.setLocation=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];this.elt[t].setLocation(Nh.ON,e)}else if(3===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2];this.elt[n].setLocation(r,i)}},Rh.prototype.isEqualOnSide=function(t,e){return this.elt[0].isEqualOnSide(t.elt[0],e)&&this.elt[1].isEqualOnSide(t.elt[1],e)},Rh.prototype.allPositionsEqual=function(t,e){return this.elt[t].allPositionsEqual(e)},Rh.prototype.toLine=function(t){this.elt[t].isArea()&&(this.elt[t]=new Oh(this.elt[t].location[0]))},Rh.prototype.interfaces_=function(){return[]},Rh.prototype.getClass=function(){return Rh},Rh.toLineLabel=function(t){for(var e=new Rh(Su.NONE),n=0;n<2;n++)e.setLocation(n,t.getLocation(n));return e};var Th=function(){this._startDe=null,this._maxNodeDegree=-1,this._edges=new bc,this._pts=new bc,this._label=new Rh(Su.NONE),this._ring=null,this._isHole=null,this._shell=null,this._holes=new bc,this._geometryFactory=null;var t=arguments[0],e=arguments[1];this._geometryFactory=e,this.computePoints(t),this.computeRing()};Th.prototype.computeRing=function(){if(null!==this._ring)return null;for(var t=new Array(this._pts.size()).fill(null),e=0;e<this._pts.size();e++)t[e]=this._pts.get(e);this._ring=this._geometryFactory.createLinearRing(t),this._isHole=sc.isCCW(this._ring.getCoordinates())},Th.prototype.isIsolated=function(){return 1===this._label.getGeometryCount()},Th.prototype.computePoints=function(t){this._startDe=t;var e=t,n=!0;do{if(null===e)throw new Mh("Found null DirectedEdge");if(e.getEdgeRing()===this)throw new Mh("Directed Edge visited twice during ring-building at "+e.getCoordinate());this._edges.add(e);var r=e.getLabel();tc.isTrue(r.isArea()),this.mergeLabel(r),this.addPoints(e.getEdge(),e.isForward(),n),n=!1,this.setEdgeRing(e,this),e=this.getNext(e)}while(e!==this._startDe)},Th.prototype.getLinearRing=function(){return this._ring},Th.prototype.getCoordinate=function(t){return this._pts.get(t)},Th.prototype.computeMaxNodeDegree=function(){this._maxNodeDegree=0;var t=this._startDe;do{var e=t.getNode().getEdges().getOutgoingDegree(this);e>this._maxNodeDegree&&(this._maxNodeDegree=e),t=this.getNext(t)}while(t!==this._startDe);this._maxNodeDegree*=2},Th.prototype.addPoints=function(t,e,n){var r=t.getCoordinates();if(e){var i=1;n&&(i=0);for(var o=i;o<r.length;o++)this._pts.add(r[o])}else{var s=r.length-2;n&&(s=r.length-1);for(var a=s;a>=0;a--)this._pts.add(r[a])}},Th.prototype.isHole=function(){return this._isHole},Th.prototype.setInResult=function(){var t=this._startDe;do{t.getEdge().setInResult(!0),t=t.getNext()}while(t!==this._startDe)},Th.prototype.containsPoint=function(t){var e=this.getLinearRing();if(!e.getEnvelopeInternal().contains(t))return!1;if(!sc.isPointInRing(t,e.getCoordinates()))return!1;for(var n=this._holes.iterator();n.hasNext();)if(n.next().containsPoint(t))return!1;return!0},Th.prototype.addHole=function(t){this._holes.add(t)},Th.prototype.isShell=function(){return null===this._shell},Th.prototype.getLabel=function(){return this._label},Th.prototype.getEdges=function(){return this._edges},Th.prototype.getMaxNodeDegree=function(){return this._maxNodeDegree<0&&this.computeMaxNodeDegree(),this._maxNodeDegree},Th.prototype.getShell=function(){return this._shell},Th.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,Nh.RIGHT);if(n===Su.NONE)return null;if(this._label.getLocation(e)===Su.NONE)return this._label.setLocation(e,n),null}},Th.prototype.setShell=function(t){this._shell=t,null!==t&&t.addHole(this)},Th.prototype.toPolygon=function(t){for(var e=new Array(this._holes.size()).fill(null),n=0;n<this._holes.size();n++)e[n]=this._holes.get(n).getLinearRing();return t.createPolygon(this.getLinearRing(),e)},Th.prototype.interfaces_=function(){return[]},Th.prototype.getClass=function(){return Th};var Ah=function(t){function e(){var e=arguments[0],n=arguments[1];t.call(this,e,n)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.setEdgeRing=function(t,e){t.setMinEdgeRing(e)},e.prototype.getNext=function(t){return t.getNextMin()},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Th),Dh=function(t){function e(){var e=arguments[0],n=arguments[1];t.call(this,e,n)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.buildMinimalRings=function(){var t=new bc,e=this._startDe;do{if(null===e.getMinEdgeRing()){var n=new Ah(e,this._geometryFactory);t.add(n)}e=e.getNext()}while(e!==this._startDe);return t},e.prototype.setEdgeRing=function(t,e){t.setEdgeRing(e)},e.prototype.linkDirectedEdgesForMinimalEdgeRings=function(){var t=this._startDe;do{t.getNode().getEdges().linkMinimalDirectedEdges(this),t=t.getNext()}while(t!==this._startDe)},e.prototype.getNext=function(t){return t.getNext()},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Th),Fh=function(){if(this._label=null,this._isInResult=!1,this._isCovered=!1,this._isCoveredSet=!1,this._isVisited=!1,0===arguments.length);else if(1===arguments.length){var t=arguments[0];this._label=t}};Fh.prototype.setVisited=function(t){this._isVisited=t},Fh.prototype.setInResult=function(t){this._isInResult=t},Fh.prototype.isCovered=function(){return this._isCovered},Fh.prototype.isCoveredSet=function(){return this._isCoveredSet},Fh.prototype.setLabel=function(t){this._label=t},Fh.prototype.getLabel=function(){return this._label},Fh.prototype.setCovered=function(t){this._isCovered=t,this._isCoveredSet=!0},Fh.prototype.updateIM=function(t){tc.isTrue(this._label.getGeometryCount()>=2,"found partial label"),this.computeIM(t)},Fh.prototype.isInResult=function(){return this._isInResult},Fh.prototype.isVisited=function(){return this._isVisited},Fh.prototype.interfaces_=function(){return[]},Fh.prototype.getClass=function(){return Fh};var qh=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 Rh(0,Su.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=Su.NONE;if(n=this._label.getLocation(e),!t.isNull(e)){var r=t.getLocation(e);n!==Su.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 Rh(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 Rh)for(var n=arguments[0],r=0;r<2;r++){var i=this.computeMergedLocation(n,r);this._label.getLocation(r)===Su.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=Su.NONE;null!==this._label&&(e=this._label.getLocation(t));var n=null;switch(e){case Su.BOUNDARY:n=Su.INTERIOR;break;case Su.INTERIOR:default:n=Su.BOUNDARY}this._label.setLocation(t,n)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Fh),Gh=function(){this.nodeMap=new Gi,this.nodeFact=null;var t=arguments[0];this.nodeFact=t};Gh.prototype.find=function(t){return this.nodeMap.get(t)},Gh.prototype.addNode=function(){if(arguments[0]instanceof bu){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 qh){var n=arguments[0],r=this.nodeMap.get(n.getCoordinate());return null===r?(this.nodeMap.put(n.getCoordinate(),n),n):(r.mergeLabel(n),r)}},Gh.prototype.print=function(t){for(var e=this.iterator();e.hasNext();)e.next().print(t)},Gh.prototype.iterator=function(){return this.nodeMap.values().iterator()},Gh.prototype.values=function(){return this.nodeMap.values()},Gh.prototype.getBoundaryNodes=function(t){for(var e=new bc,n=this.iterator();n.hasNext();){var r=n.next();r.getLabel().getLocation(t)===Su.BOUNDARY&&e.add(r)}return e},Gh.prototype.add=function(t){var e=t.getCoordinate();this.addNode(e).add(t)},Gh.prototype.interfaces_=function(){return[]},Gh.prototype.getClass=function(){return Gh};var Bh=function(){},kh={NE:{configurable:!0},NW:{configurable:!0},SW:{configurable:!0},SE:{configurable:!0}};Bh.prototype.interfaces_=function(){return[]},Bh.prototype.getClass=function(){return Bh},Bh.isNorthern=function(t){return t===Bh.NE||t===Bh.NW},Bh.isOpposite=function(t,e){return t!==e&&2===(t-e+4)%4},Bh.commonHalfPlane=function(t,e){if(t===e)return t;if(2===(t-e+4)%4)return-1;var n=t<e?t:e;return 0===n&&3===(t>e?t:e)?3:n},Bh.isInHalfPlane=function(t,e){return e===Bh.SE?t===Bh.SE||t===Bh.SW:t===e||t===e+1},Bh.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 _u("Cannot compute the quadrant for point ( "+t+", "+e+" )");return t>=0?e>=0?Bh.NE:Bh.SE:e>=0?Bh.NW:Bh.SW}if(arguments[0]instanceof bu&&arguments[1]instanceof bu){var n=arguments[0],r=arguments[1];if(r.x===n.x&&r.y===n.y)throw new _u("Cannot compute the quadrant for two identical points "+n);return r.x>=n.x?r.y>=n.y?Bh.NE:Bh.SE:r.y>=n.y?Bh.NW:Bh.SW}},kh.NE.get=function(){return 0},kh.NW.get=function(){return 1},kh.SW.get=function(){return 2},kh.SE.get=function(){return 3},Object.defineProperties(Bh,kh);var zh=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}};zh.prototype.compareDirection=function(t){return this._dx===t._dx&&this._dy===t._dy?0:this._quadrant>t._quadrant?1:this._quadrant<t._quadrant?-1:sc.computeOrientation(t._p0,t._p1,this._p1)},zh.prototype.getDy=function(){return this._dy},zh.prototype.getCoordinate=function(){return this._p0},zh.prototype.setNode=function(t){this._node=t},zh.prototype.print=function(t){var e=Math.atan2(this._dy,this._dx),n=this.getClass().getName(),r=n.lastIndexOf("."),i=n.substring(r+1);t.print(" "+i+": "+this._p0+" - "+this._p1+" "+this._quadrant+":"+e+" "+this._label)},zh.prototype.compareTo=function(t){var e=t;return this.compareDirection(e)},zh.prototype.getDirectedCoordinate=function(){return this._p1},zh.prototype.getDx=function(){return this._dx},zh.prototype.getLabel=function(){return this._label},zh.prototype.getEdge=function(){return this._edge},zh.prototype.getQuadrant=function(){return this._quadrant},zh.prototype.getNode=function(){return this._node},zh.prototype.toString=function(){var t=Math.atan2(this._dy,this._dx),e=this.getClass().getName(),n=e.lastIndexOf(".");return" "+e.substring(n+1)+": "+this._p0+" - "+this._p1+" "+this._quadrant+":"+t+" "+this._label},zh.prototype.computeLabel=function(t){},zh.prototype.init=function(t,e){this._p0=t,this._p1=e,this._dx=e.x-t.x,this._dy=e.y-t.y,this._quadrant=Bh.quadrant(this._dx,this._dy),tc.isTrue(!(0===this._dx&&0===this._dy),"EdgeEnd with identical endpoints found")},zh.prototype.interfaces_=function(){return[xu]},zh.prototype.getClass=function(){return zh};var jh=function(t){function e(){var e=arguments[0],n=arguments[1];if(t.call(this,e),this._isForward=null,this._isInResult=!1,this._isVisited=!1,this._sym=null,this._next=null,this._nextMin=null,this._edgeRing=null,this._minEdgeRing=null,this._depth=[0,-999,-999],this._isForward=n,n)this.init(e.getCoordinate(0),e.getCoordinate(1));else{var r=e.getNumPoints()-1;this.init(e.getCoordinate(r),e.getCoordinate(r-1))}this.computeDirectedLabel()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getNextMin=function(){return this._nextMin},e.prototype.getDepth=function(t){return this._depth[t]},e.prototype.setVisited=function(t){this._isVisited=t},e.prototype.computeDirectedLabel=function(){this._label=new Rh(this._edge.getLabel()),this._isForward||this._label.flip()},e.prototype.getNext=function(){return this._next},e.prototype.setDepth=function(t,e){if(-999!==this._depth[t]&&this._depth[t]!==e)throw new Mh("assigned depths do not match",this.getCoordinate());this._depth[t]=e},e.prototype.isInteriorAreaEdge=function(){for(var t=!0,e=0;e<2;e++)this._label.isArea(e)&&this._label.getLocation(e,Nh.LEFT)===Su.INTERIOR&&this._label.getLocation(e,Nh.RIGHT)===Su.INTERIOR||(t=!1);return t},e.prototype.setNextMin=function(t){this._nextMin=t},e.prototype.print=function(e){t.prototype.print.call(this,e),e.print(" "+this._depth[Nh.LEFT]+"/"+this._depth[Nh.RIGHT]),e.print(" ("+this.getDepthDelta()+")"),this._isInResult&&e.print(" inResult")},e.prototype.setMinEdgeRing=function(t){this._minEdgeRing=t},e.prototype.isLineEdge=function(){var t=this._label.isLine(0)||this._label.isLine(1),e=!this._label.isArea(0)||this._label.allPositionsEqual(0,Su.EXTERIOR),n=!this._label.isArea(1)||this._label.allPositionsEqual(1,Su.EXTERIOR);return t&&e&&n},e.prototype.setEdgeRing=function(t){this._edgeRing=t},e.prototype.getMinEdgeRing=function(){return this._minEdgeRing},e.prototype.getDepthDelta=function(){var t=this._edge.getDepthDelta();return this._isForward||(t=-t),t},e.prototype.setInResult=function(t){this._isInResult=t},e.prototype.getSym=function(){return this._sym},e.prototype.isForward=function(){return this._isForward},e.prototype.getEdge=function(){return this._edge},e.prototype.printEdge=function(t){this.print(t),t.print(" "),this._isForward?this._edge.print(t):this._edge.printReverse(t)},e.prototype.setSym=function(t){this._sym=t},e.prototype.setVisitedEdge=function(t){this.setVisited(t),this._sym.setVisited(t)},e.prototype.setEdgeDepths=function(t,e){var n=this.getEdge().getDepthDelta();this._isForward||(n=-n);var r=1;t===Nh.LEFT&&(r=-1);var i=Nh.opposite(t),o=e+n*r;this.setDepth(t,e),this.setDepth(i,o)},e.prototype.getEdgeRing=function(){return this._edgeRing},e.prototype.isInResult=function(){return this._isInResult},e.prototype.setNext=function(t){this._next=t},e.prototype.isVisited=function(){return this._isVisited},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.depthFactor=function(t,e){return t===Su.EXTERIOR&&e===Su.INTERIOR?1:t===Su.INTERIOR&&e===Su.EXTERIOR?-1:0},e}(zh),Xh=function(){};Xh.prototype.createNode=function(t){return new qh(t,null)},Xh.prototype.interfaces_=function(){return[]},Xh.prototype.getClass=function(){return Xh};var Uh=function(){if(this._edges=new bc,this._nodes=null,this._edgeEndList=new bc,0===arguments.length)this._nodes=new Gh(new Xh);else if(1===arguments.length){var t=arguments[0];this._nodes=new Gh(t)}};Uh.prototype.printEdges=function(t){t.println("Edges:");for(var e=0;e<this._edges.size();e++){t.println("edge "+e+":");var n=this._edges.get(e);n.print(t),n.eiList.print(t)}},Uh.prototype.find=function(t){return this._nodes.find(t)},Uh.prototype.addNode=function(){if(arguments[0]instanceof qh){var t=arguments[0];return this._nodes.addNode(t)}if(arguments[0]instanceof bu){var e=arguments[0];return this._nodes.addNode(e)}},Uh.prototype.getNodeIterator=function(){return this._nodes.iterator()},Uh.prototype.linkResultDirectedEdges=function(){for(var t=this._nodes.iterator();t.hasNext();)t.next().getEdges().linkResultDirectedEdges()},Uh.prototype.debugPrintln=function(t){Xu.out.println(t)},Uh.prototype.isBoundaryNode=function(t,e){var n=this._nodes.find(e);if(null===n)return!1;var r=n.getLabel();return null!==r&&r.getLocation(t)===Su.BOUNDARY},Uh.prototype.linkAllDirectedEdges=function(){for(var t=this._nodes.iterator();t.hasNext();)t.next().getEdges().linkAllDirectedEdges()},Uh.prototype.matchInSameDirection=function(t,e,n,r){return!!t.equals(n)&&sc.computeOrientation(t,e,r)===sc.COLLINEAR&&Bh.quadrant(t,e)===Bh.quadrant(n,r)},Uh.prototype.getEdgeEnds=function(){return this._edgeEndList},Uh.prototype.debugPrint=function(t){Xu.out.print(t)},Uh.prototype.getEdgeIterator=function(){return this._edges.iterator()},Uh.prototype.findEdgeInSameDirection=function(t,e){for(var n=0;n<this._edges.size();n++){var r=this._edges.get(n),i=r.getCoordinates();if(this.matchInSameDirection(t,e,i[0],i[1]))return r;if(this.matchInSameDirection(t,e,i[i.length-1],i[i.length-2]))return r}return null},Uh.prototype.insertEdge=function(t){this._edges.add(t)},Uh.prototype.findEdgeEnd=function(t){for(var e=this.getEdgeEnds().iterator();e.hasNext();){var n=e.next();if(n.getEdge()===t)return n}return null},Uh.prototype.addEdges=function(t){for(var e=t.iterator();e.hasNext();){var n=e.next();this._edges.add(n);var r=new jh(n,!0),i=new jh(n,!1);r.setSym(i),i.setSym(r),this.add(r),this.add(i)}},Uh.prototype.add=function(t){this._nodes.add(t),this._edgeEndList.add(t)},Uh.prototype.getNodes=function(){return this._nodes.values()},Uh.prototype.findEdge=function(t,e){for(var n=0;n<this._edges.size();n++){var r=this._edges.get(n),i=r.getCoordinates();if(t.equals(i[0])&&e.equals(i[1]))return r}return null},Uh.prototype.interfaces_=function(){return[]},Uh.prototype.getClass=function(){return Uh},Uh.linkResultDirectedEdges=function(t){for(var e=t.iterator();e.hasNext();)e.next().getEdges().linkResultDirectedEdges()};var Yh=function(){this._geometryFactory=null,this._shellList=new bc;var t=arguments[0];this._geometryFactory=t};Yh.prototype.sortShellsAndHoles=function(t,e,n){for(var r=t.iterator();r.hasNext();){var i=r.next();i.isHole()?n.add(i):e.add(i)}},Yh.prototype.computePolygons=function(t){for(var e=new bc,n=t.iterator();n.hasNext();){var r=n.next().toPolygon(this._geometryFactory);e.add(r)}return e},Yh.prototype.placeFreeHoles=function(t,e){for(var n=e.iterator();n.hasNext();){var r=n.next();if(null===r.getShell()){var i=this.findEdgeRingContaining(r,t);if(null===i)throw new Mh("unable to assign hole to a shell",r.getCoordinate(0));r.setShell(i)}}},Yh.prototype.buildMinimalEdgeRings=function(t,e,n){for(var r=new bc,i=t.iterator();i.hasNext();){var o=i.next();if(o.getMaxNodeDegree()>2){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},Yh.prototype.containsPoint=function(t){for(var e=this._shellList.iterator();e.hasNext();)if(e.next().containsPoint(t))return!0;return!1},Yh.prototype.buildMaximalEdgeRings=function(t){for(var e=new bc,n=t.iterator();n.hasNext();){var r=n.next();if(r.isInResult()&&r.getLabel().isArea()&&null===r.getEdgeRing()){var i=new Dh(r,this._geometryFactory);e.add(i),i.setInResult()}}return e},Yh.prototype.placePolygonHoles=function(t,e){for(var n=e.iterator();n.hasNext();){var r=n.next();r.isHole()&&r.setShell(t)}},Yh.prototype.getPolygons=function(){return this.computePolygons(this._shellList)},Yh.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(),c=u.getLinearRing(),h=c.getEnvelopeInternal();null!==o&&(s=o.getLinearRing().getEnvelopeInternal());var l=!1;h.contains(r)&&sc.isPointInRing(i,c.getCoordinates())&&(l=!0),l&&(null===o||s.contains(h))&&(o=u)}return o},Yh.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 tc.isTrue(e<=1,"found two shells in MinimalEdgeRing list"),n},Yh.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];Uh.linkResultDirectedEdges(n);var r=this.buildMaximalEdgeRings(e),i=new bc,o=this.buildMinimalEdgeRings(r,this._shellList,i);this.sortShellsAndHoles(o,this._shellList,i),this.placeFreeHoles(this._shellList,i)}},Yh.prototype.interfaces_=function(){return[]},Yh.prototype.getClass=function(){return Yh};var Vh=function(){};Vh.prototype.getBounds=function(){},Vh.prototype.interfaces_=function(){return[]},Vh.prototype.getClass=function(){return Vh};var Hh=function(){this._bounds=null,this._item=null;var t=arguments[0],e=arguments[1];this._bounds=t,this._item=e};Hh.prototype.getItem=function(){return this._item},Hh.prototype.getBounds=function(){return this._bounds},Hh.prototype.interfaces_=function(){return[Vh,Li]},Hh.prototype.getClass=function(){return Hh};var Wh=function(){this._size=null,this._items=null,this._size=0,this._items=new bc,this._items.add(null)};Wh.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},Wh.prototype.size=function(){return this._size},Wh.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)},Wh.prototype.clear=function(){this._size=0,this._items.clear()},Wh.prototype.isEmpty=function(){return 0===this._size},Wh.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)},Wh.prototype.interfaces_=function(){return[]},Wh.prototype.getClass=function(){return Wh};var Jh=function(){};Jh.prototype.visitItem=function(t){},Jh.prototype.interfaces_=function(){return[]},Jh.prototype.getClass=function(){return Jh};var Zh=function(){};Zh.prototype.insert=function(t,e){},Zh.prototype.remove=function(t,e){},Zh.prototype.query=function(){},Zh.prototype.interfaces_=function(){return[]},Zh.prototype.getClass=function(){return Zh};var Kh=function(){if(this._childBoundables=new bc,this._bounds=null,this._level=null,0===arguments.length);else if(1===arguments.length){var t=arguments[0];this._level=t}},Qh={serialVersionUID:{configurable:!0}};Kh.prototype.getLevel=function(){return this._level},Kh.prototype.size=function(){return this._childBoundables.size()},Kh.prototype.getChildBoundables=function(){return this._childBoundables},Kh.prototype.addChildBoundable=function(t){tc.isTrue(null===this._bounds),this._childBoundables.add(t)},Kh.prototype.isEmpty=function(){return this._childBoundables.isEmpty()},Kh.prototype.getBounds=function(){return null===this._bounds&&(this._bounds=this.computeBounds()),this._bounds},Kh.prototype.interfaces_=function(){return[Vh,Li]},Kh.prototype.getClass=function(){return Kh},Qh.serialVersionUID.get=function(){return 0x5a1e55ec41369800},Object.defineProperties(Kh,Qh);var $h=function(){};$h.reverseOrder=function(){return{compare:function(t,e){return e.compareTo(t)}}},$h.min=function(t){return $h.sort(t),t.get(0)},$h.sort=function(t,e){var n=t.toArray();e?qc.sort(n,e):qc.sort(n);for(var r=t.iterator(),i=0,o=n.length;i<o;i++)r.next(),r.set(n[i])},$h.singletonList=function(t){var e=new bc;return e.add(t),e};var tl=function(){this._boundable1=null,this._boundable2=null,this._distance=null,this._itemDistance=null;var t=arguments[0],e=arguments[1],n=arguments[2];this._boundable1=t,this._boundable2=e,this._itemDistance=n,this._distance=this.distance()};tl.prototype.expandToQueue=function(t,e){var n=tl.isComposite(this._boundable1),r=tl.isComposite(this._boundable2);if(n&&r)return tl.area(this._boundable1)>tl.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 _u("neither boundable is composite")},tl.prototype.isLeaves=function(){return!(tl.isComposite(this._boundable1)||tl.isComposite(this._boundable2))},tl.prototype.compareTo=function(t){var e=t;return this._distance<e._distance?-1:this._distance>e._distance?1:0},tl.prototype.expand=function(t,e,n,r){for(var i=t.getChildBoundables().iterator();i.hasNext();){var o=i.next(),s=new tl(o,e,this._itemDistance);s.getDistance()<r&&n.add(s)}},tl.prototype.getBoundable=function(t){return 0===t?this._boundable1:this._boundable2},tl.prototype.getDistance=function(){return this._distance},tl.prototype.distance=function(){return this.isLeaves()?this._itemDistance.distance(this._boundable1,this._boundable2):this._boundable1.getBounds().distance(this._boundable2.getBounds())},tl.prototype.interfaces_=function(){return[xu]},tl.prototype.getClass=function(){return tl},tl.area=function(t){return t.getBounds().getArea()},tl.isComposite=function(t){return t instanceof Kh};var el=function t(){if(this._root=null,this._built=!1,this._itemBoundables=new bc,this._nodeCapacity=null,0===arguments.length){var e=t.DEFAULT_NODE_CAPACITY;this._nodeCapacity=e}else if(1===arguments.length){var n=arguments[0];tc.isTrue(n>1,"Node capacity must be greater than 1"),this._nodeCapacity=n}},nl={IntersectsOp:{configurable:!0},serialVersionUID:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};el.prototype.getNodeCapacity=function(){return this._nodeCapacity},el.prototype.lastNode=function(t){return t.get(t.size()-1)},el.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 Kh?t+=this.size(n):n instanceof Hh&&(t+=1)}return t}},el.prototype.removeItem=function(t,e){for(var n=null,r=t.getChildBoundables().iterator();r.hasNext();){var i=r.next();i instanceof Hh&&i.getItem()===e&&(n=i)}return null!==n&&(t.getChildBoundables().remove(n),!0)},el.prototype.itemsTree=function(){if(0===arguments.length){this.build();var t=this.itemsTree(this._root);return null===t?new bc:t}if(1===arguments.length){for(var e=arguments[0],n=new bc,r=e.getChildBoundables().iterator();r.hasNext();){var i=r.next();if(i instanceof Kh){var o=this.itemsTree(i);null!==o&&n.add(o)}else i instanceof Hh?n.add(i.getItem()):tc.shouldNeverReachHere()}return n.size()<=0?null:n}},el.prototype.insert=function(t,e){tc.isTrue(!this._built,"Cannot insert items into an STR packed R-tree after it has been built."),this._itemBoundables.add(new Hh(t,e))},el.prototype.boundablesAtLevel=function(){if(1===arguments.length){var t=arguments[0],e=new bc;return this.boundablesAtLevel(t,this._root,e),e}if(3===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2];if(tc.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 Kh?this.boundablesAtLevel(n,s,i):(tc.isTrue(s instanceof Hh),-1===n&&i.add(s))}return null}},el.prototype.query=function(){if(1===arguments.length){var t=arguments[0];this.build();var e=new bc;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(Lu(arguments[2],Jh)&&arguments[0]instanceof Object&&arguments[1]instanceof Kh)for(var i=arguments[0],o=arguments[2],s=arguments[1].getChildBoundables(),a=0;a<s.size();a++){var u=s.get(a);this.getIntersectsOp().intersects(u.getBounds(),i)&&(u instanceof Kh?this.query(i,u,o):u instanceof Hh?o.visitItem(u.getItem()):tc.shouldNeverReachHere())}else if(Lu(arguments[2],wc)&&arguments[0]instanceof Object&&arguments[1]instanceof Kh)for(var c=arguments[0],h=arguments[2],l=arguments[1].getChildBoundables(),p=0;p<l.size();p++){var f=l.get(p);this.getIntersectsOp().intersects(f.getBounds(),c)&&(f instanceof Kh?this.query(c,f,h):f instanceof Hh?h.add(f.getItem()):tc.shouldNeverReachHere())}},el.prototype.build=function(){if(this._built)return null;this._root=this._itemBoundables.isEmpty()?this.createNode(0):this.createHigherLevels(this._itemBoundables,-1),this._itemBoundables=null,this._built=!0},el.prototype.getRoot=function(){return this.build(),this._root},el.prototype.remove=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];return this.build(),!!this.getIntersectsOp().intersects(this._root.getBounds(),t)&&this.remove(t,this._root,e)}if(3===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2],o=this.removeItem(r,i);if(o)return!0;for(var s=null,a=r.getChildBoundables().iterator();a.hasNext();){var u=a.next();if(this.getIntersectsOp().intersects(u.getBounds(),n)&&u instanceof Kh&&(o=this.remove(n,u,i))){s=u;break}}return null!==s&&s.getChildBoundables().isEmpty()&&r.getChildBoundables().remove(s),o}},el.prototype.createHigherLevels=function(t,e){tc.isTrue(!t.isEmpty());var n=this.createParentBoundables(t,e+1);return 1===n.size()?n.get(0):this.createHigherLevels(n,e+1)},el.prototype.depth=function(){if(0===arguments.length)return this.isEmpty()?0:(this.build(),this.depth(this._root));if(1===arguments.length){for(var t=0,e=arguments[0].getChildBoundables().iterator();e.hasNext();){var n=e.next();if(n instanceof Kh){var r=this.depth(n);r>t&&(t=r)}}return t+1}},el.prototype.createParentBoundables=function(t,e){tc.isTrue(!t.isEmpty());var n=new bc;n.add(this.createNode(e));var r=new bc(t);$h.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},el.prototype.isEmpty=function(){return this._built?this._root.isEmpty():this._itemBoundables.isEmpty()},el.prototype.interfaces_=function(){return[Li]},el.prototype.getClass=function(){return el},el.compareDoubles=function(t,e){return t>e?1:t<e?-1:0},nl.IntersectsOp.get=function(){return rl},nl.serialVersionUID.get=function(){return-0x35ef64c82d4c5400},nl.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(el,nl);var rl=function(){},il=function(){};il.prototype.distance=function(t,e){},il.prototype.interfaces_=function(){return[]},il.prototype.getClass=function(){return il};var ol=function(t){function e(n){n=n||e.DEFAULT_NODE_CAPACITY,t.call(this,n)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={STRtreeNode:{configurable:!0},serialVersionUID:{configurable:!0},xComparator:{configurable:!0},yComparator:{configurable:!0},intersectsOp:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};return e.prototype.createParentBoundablesFromVerticalSlices=function(t,e){tc.isTrue(t.length>0);for(var n=new bc,r=0;r<t.length;r++)n.addAll(this.createParentBoundablesFromVerticalSlice(t[r],e));return n},e.prototype.createNode=function(t){return new sl(t)},e.prototype.size=function(){return 0===arguments.length?t.prototype.size.call(this):t.prototype.size.apply(this,arguments)},e.prototype.insert=function(){if(2!==arguments.length)return t.prototype.insert.apply(this,arguments);var e=arguments[0],n=arguments[1];if(e.isNull())return null;t.prototype.insert.call(this,e,n)},e.prototype.getIntersectsOp=function(){return e.intersectsOp},e.prototype.verticalSlices=function(t,e){for(var n=Math.trunc(Math.ceil(t.size()/e)),r=new Array(e).fill(null),i=t.iterator(),o=0;o<e;o++){r[o]=new bc;for(var s=0;i.hasNext()&&s<n;){var a=i.next();r[o].add(a),s++}}return r},e.prototype.query=function(){if(1===arguments.length){var e=arguments[0];return t.prototype.query.call(this,e)}if(2===arguments.length){var n=arguments[0],r=arguments[1];t.prototype.query.call(this,n,r)}else if(3===arguments.length)if(Lu(arguments[2],Jh)&&arguments[0]instanceof Object&&arguments[1]instanceof Kh){var i=arguments[0],o=arguments[1],s=arguments[2];t.prototype.query.call(this,i,o,s)}else if(Lu(arguments[2],wc)&&arguments[0]instanceof Object&&arguments[1]instanceof Kh){var a=arguments[0],u=arguments[1],c=arguments[2];t.prototype.query.call(this,a,u,c)}},e.prototype.getComparator=function(){return e.yComparator},e.prototype.createParentBoundablesFromVerticalSlice=function(e,n){return t.prototype.createParentBoundables.call(this,e,n)},e.prototype.remove=function(){if(2===arguments.length){var e=arguments[0],n=arguments[1];return t.prototype.remove.call(this,e,n)}return t.prototype.remove.apply(this,arguments)},e.prototype.depth=function(){return 0===arguments.length?t.prototype.depth.call(this):t.prototype.depth.apply(this,arguments)},e.prototype.createParentBoundables=function(t,n){tc.isTrue(!t.isEmpty());var r=Math.trunc(Math.ceil(t.size()/this.getNodeCapacity())),i=new bc(t);$h.sort(i,e.xComparator);var o=this.verticalSlices(i,Math.trunc(Math.ceil(Math.sqrt(r))));return this.createParentBoundablesFromVerticalSlices(o,n)},e.prototype.nearestNeighbour=function(){if(1===arguments.length){if(Lu(arguments[0],il)){var t=arguments[0],n=new tl(this.getRoot(),this.getRoot(),t);return this.nearestNeighbour(n)}if(arguments[0]instanceof tl){var r=arguments[0];return this.nearestNeighbour(r,mu.POSITIVE_INFINITY)}}else if(2===arguments.length){if(arguments[0]instanceof e&&Lu(arguments[1],il)){var i=arguments[0],o=arguments[1],s=new tl(this.getRoot(),i.getRoot(),o);return this.nearestNeighbour(s)}if(arguments[0]instanceof tl&&"number"==typeof arguments[1]){var a=arguments[0],u=arguments[1],c=null,h=new Wh;for(h.add(a);!h.isEmpty()&&u>0;){var l=h.poll(),p=l.getDistance();if(p>=u)break;l.isLeaves()?(u=p,c=l):l.expandToQueue(h,u)}return[c.getBoundable(0).getItem(),c.getBoundable(1).getItem()]}}else if(3===arguments.length){var f=arguments[2],g=new Hh(arguments[0],arguments[1]),d=new tl(this.getRoot(),g,f);return this.nearestNeighbour(d)[0]}},e.prototype.interfaces_=function(){return[Zh,Li]},e.prototype.getClass=function(){return e},e.centreX=function(t){return e.avg(t.getMinX(),t.getMaxX())},e.avg=function(t,e){return(t+e)/2},e.centreY=function(t){return e.avg(t.getMinY(),t.getMaxY())},n.STRtreeNode.get=function(){return sl},n.serialVersionUID.get=function(){return 0x39920f7d5f261e0},n.xComparator.get=function(){return{interfaces_:function(){return[wu]},compare:function(n,r){return t.compareDoubles(e.centreX(n.getBounds()),e.centreX(r.getBounds()))}}},n.yComparator.get=function(){return{interfaces_:function(){return[wu]},compare:function(n,r){return t.compareDoubles(e.centreY(n.getBounds()),e.centreY(r.getBounds()))}}},n.intersectsOp.get=function(){return{interfaces_:function(){return[t.IntersectsOp]},intersects:function(t,e){return t.intersects(e)}}},n.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(e,n),e}(el),sl=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 Yu(n.getBounds()):t.expandToInclude(n.getBounds())}return t},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Kh),al=function(){};al.prototype.interfaces_=function(){return[]},al.prototype.getClass=function(){return al},al.relativeSign=function(t,e){return t<e?-1:t>e?1:0},al.compare=function(t,e,n){if(e.equals2D(n))return 0;var r=al.relativeSign(e.x,n.x),i=al.relativeSign(e.y,n.y);switch(t){case 0:return al.compareValue(r,i);case 1:return al.compareValue(i,r);case 2:return al.compareValue(i,-r);case 3:return al.compareValue(-r,i);case 4:return al.compareValue(-r,-i);case 5:return al.compareValue(-i,-r);case 6:return al.compareValue(-i,r);case 7:return al.compareValue(r,-i)}return tc.shouldNeverReachHere("invalid octant value"),0},al.compareValue=function(t,e){return t<0?-1:t>0?1:e<0?-1:e>0?1:0};var ul=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 bu(e),this.segmentIndex=n,this._segmentOctant=r,this._isInterior=!e.equals2D(t.getCoordinate(n))};ul.prototype.getCoordinate=function(){return this.coord},ul.prototype.print=function(t){t.print(this.coord),t.print(" seg # = "+this.segmentIndex)},ul.prototype.compareTo=function(t){var e=t;return this.segmentIndex<e.segmentIndex?-1:this.segmentIndex>e.segmentIndex?1:this.coord.equals2D(e.coord)?0:al.compare(this._segmentOctant,this.coord,e.coord)},ul.prototype.isEndPoint=function(t){return 0===this.segmentIndex&&!this._isInterior||this.segmentIndex===t},ul.prototype.isInterior=function(){return this._isInterior},ul.prototype.interfaces_=function(){return[xu]},ul.prototype.getClass=function(){return ul};var cl=function(){this._nodeMap=new Gi,this._edge=null;var t=arguments[0];this._edge=t};cl.prototype.getSplitCoordinates=function(){var t=new Nc;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()},cl.prototype.addCollapsedNodes=function(){var t=new bc;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)}},cl.prototype.print=function(t){t.println("Intersections:");for(var e=this.iterator();e.hasNext();)e.next().print(t)},cl.prototype.findCollapsesFromExistingVertices=function(t){for(var e=0;e<this._edge.size()-2;e++){var n=this._edge.getCoordinate(e),r=this._edge.getCoordinate(e+2);n.equals2D(r)&&t.add(new Tu(e+1))}},cl.prototype.addEdgeCoordinates=function(t,e,n){var r=this._edge.getCoordinate(e.segmentIndex),i=e.isInterior()||!e.coord.equals2D(r);n.add(new bu(t.coord),!1);for(var o=t.segmentIndex+1;o<=e.segmentIndex;o++)n.add(this._edge.getCoordinate(o));i&&n.add(new bu(e.coord))},cl.prototype.iterator=function(){return this._nodeMap.values().iterator()},cl.prototype.addSplitEdges=function(t){this.addEndpoints(),this.addCollapsedNodes();for(var e=this.iterator(),n=e.next();e.hasNext();){var r=e.next(),i=this.createSplitEdge(n,r);t.add(i),n=r}},cl.prototype.findCollapseIndex=function(t,e,n){if(!t.coord.equals2D(e.coord))return!1;var r=e.segmentIndex-t.segmentIndex;return e.isInterior()||r--,1===r&&(n[0]=t.segmentIndex+1,!0)},cl.prototype.findCollapsesFromInsertedNodes=function(t){for(var e=new Array(1).fill(null),n=this.iterator(),r=n.next();n.hasNext();){var i=n.next();this.findCollapseIndex(r,i,e)&&t.add(new Tu(e[0])),r=i}},cl.prototype.getEdge=function(){return this._edge},cl.prototype.addEndpoints=function(){var t=this._edge.size()-1;this.add(this._edge.getCoordinate(0),0),this.add(this._edge.getCoordinate(t),t)},cl.prototype.createSplitEdge=function(t,e){var n=e.segmentIndex-t.segmentIndex+2,r=this._edge.getCoordinate(e.segmentIndex),i=e.isInterior()||!e.coord.equals2D(r);i||n--;var o=new Array(n).fill(null),s=0;o[s++]=new bu(t.coord);for(var a=t.segmentIndex+1;a<=e.segmentIndex;a++)o[s++]=this._edge.getCoordinate(a);return i&&(o[s]=new bu(e.coord)),new fl(o,this._edge.getData())},cl.prototype.add=function(t,e){var n=new ul(this._edge,t,e,this._edge.getSegmentOctant(e)),r=this._nodeMap.get(n);return null!==r?(tc.isTrue(r.coord.equals2D(t),"Found equal nodes with different coordinates"),r):(this._nodeMap.put(n,n),n)},cl.prototype.checkSplitEdgesCorrectness=function(t){var e=this._edge.getCoordinates(),n=t.get(0).getCoordinate(0);if(!n.equals2D(e[0]))throw new Qu("bad split edge start point at "+n);var r=t.get(t.size()-1).getCoordinates(),i=r[r.length-1];if(!i.equals2D(e[e.length-1]))throw new Qu("bad split edge end point at "+i)},cl.prototype.interfaces_=function(){return[]},cl.prototype.getClass=function(){return cl};var hl=function(){};hl.prototype.interfaces_=function(){return[]},hl.prototype.getClass=function(){return hl},hl.octant=function(){if("number"==typeof arguments[0]&&"number"==typeof arguments[1]){var t=arguments[0],e=arguments[1];if(0===t&&0===e)throw new _u("Cannot compute the octant for point ( "+t+", "+e+" )");var n=Math.abs(t),r=Math.abs(e);return t>=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 bu&&arguments[1]instanceof bu){var i=arguments[0],o=arguments[1],s=o.x-i.x,a=o.y-i.y;if(0===s&&0===a)throw new _u("Cannot compute the octant for two identical points "+i);return hl.octant(s,a)}};var ll=function(){};ll.prototype.getCoordinates=function(){},ll.prototype.size=function(){},ll.prototype.getCoordinate=function(t){},ll.prototype.isClosed=function(){},ll.prototype.setData=function(t){},ll.prototype.getData=function(){},ll.prototype.interfaces_=function(){return[]},ll.prototype.getClass=function(){return ll};var pl=function(){};pl.prototype.addIntersection=function(t,e){},pl.prototype.interfaces_=function(){return[ll]},pl.prototype.getClass=function(){return pl};var fl=function(){this._nodeList=new cl(this),this._pts=null,this._data=null;var t=arguments[0],e=arguments[1];this._pts=t,this._data=e};fl.prototype.getCoordinates=function(){return this._pts},fl.prototype.size=function(){return this._pts.length},fl.prototype.getCoordinate=function(t){return this._pts[t]},fl.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},fl.prototype.getSegmentOctant=function(t){return t===this._pts.length-1?-1:this.safeOctant(this.getCoordinate(t),this.getCoordinate(t+1))},fl.prototype.setData=function(t){this._data=t},fl.prototype.safeOctant=function(t,e){return t.equals2D(e)?0:hl.octant(t,e)},fl.prototype.getData=function(){return this._data},fl.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 bu(arguments[0].getIntersection(r));this.addIntersection(i,n)}},fl.prototype.toString=function(){return Ku.toLineString(new uh(this._pts))},fl.prototype.getNodeList=function(){return this._nodeList},fl.prototype.addIntersectionNode=function(t,e){var n=e,r=n+1;if(r<this._pts.length){var i=this._pts[r];t.equals2D(i)&&(n=r)}return this._nodeList.add(t,n)},fl.prototype.addIntersections=function(t,e,n){for(var r=0;r<t.getIntersectionNum();r++)this.addIntersection(t,e,n,r)},fl.prototype.interfaces_=function(){return[pl]},fl.prototype.getClass=function(){return fl},fl.getNodedSubstrings=function(){if(1===arguments.length){var t=arguments[0],e=new bc;return fl.getNodedSubstrings(t,e),e}if(2===arguments.length)for(var n=arguments[1],r=arguments[0].iterator();r.hasNext();)r.next().getNodeList().addSplitEdges(n)};var gl=function(){if(this.p0=null,this.p1=null,0===arguments.length)this.p0=new bu,this.p1=new bu;else if(1===arguments.length){var t=arguments[0];this.p0=new bu(t.p0),this.p1=new bu(t.p1)}else if(2===arguments.length)this.p0=arguments[0],this.p1=arguments[1];else if(4===arguments.length){var e=arguments[0],n=arguments[1],r=arguments[2],i=arguments[3];this.p0=new bu(e,n),this.p1=new bu(r,i)}},dl={serialVersionUID:{configurable:!0}};gl.prototype.minX=function(){return Math.min(this.p0.x,this.p1.x)},gl.prototype.orientationIndex=function(){if(arguments[0]instanceof gl){var t=arguments[0],e=sc.orientationIndex(this.p0,this.p1,t.p0),n=sc.orientationIndex(this.p0,this.p1,t.p1);return e>=0&&n>=0||e<=0&&n<=0?Math.max(e,n):0}if(arguments[0]instanceof bu){var r=arguments[0];return sc.orientationIndex(this.p0,this.p1,r)}},gl.prototype.toGeometry=function(t){return t.createLineString([this.p0,this.p1])},gl.prototype.isVertical=function(){return this.p0.x===this.p1.x},gl.prototype.equals=function(t){if(!(t instanceof gl))return!1;var e=t;return this.p0.equals(e.p0)&&this.p1.equals(e.p1)},gl.prototype.intersection=function(t){var e=new rc;return e.computeIntersection(this.p0,this.p1,t.p0,t.p1),e.hasIntersection()?e.getIntersection(0):null},gl.prototype.project=function(){if(arguments[0]instanceof bu){var t=arguments[0];if(t.equals(this.p0)||t.equals(this.p1))return new bu(t);var e=this.projectionFactor(t),n=new bu;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 gl){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 gl(s,a)}},gl.prototype.normalize=function(){this.p1.compareTo(this.p0)<0&&this.reverse()},gl.prototype.angle=function(){return Math.atan2(this.p1.y-this.p0.y,this.p1.x-this.p0.x)},gl.prototype.getCoordinate=function(t){return 0===t?this.p0:this.p1},gl.prototype.distancePerpendicular=function(t){return sc.distancePointLinePerpendicular(t,this.p0,this.p1)},gl.prototype.minY=function(){return Math.min(this.p0.y,this.p1.y)},gl.prototype.midPoint=function(){return gl.midPoint(this.p0,this.p1)},gl.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?mu.NaN:((t.x-this.p0.x)*e+(t.y-this.p0.y)*n)/r},gl.prototype.closestPoints=function(t){var e=this.intersection(t);if(null!==e)return[e,e];var n=new Array(2).fill(null),r=mu.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))<r&&(r=i,n[0]=s,n[1]=t.p1);var a=t.closestPoint(this.p0);(i=a.distance(this.p0))<r&&(r=i,n[0]=this.p0,n[1]=a);var u=t.closestPoint(this.p1);return(i=u.distance(this.p1))<r&&(r=i,n[0]=this.p1,n[1]=u),n},gl.prototype.closestPoint=function(t){var e=this.projectionFactor(t);return e>0&&e<1?this.project(t):this.p0.distance(t)<this.p1.distance(t)?this.p0:this.p1},gl.prototype.maxX=function(){return Math.max(this.p0.x,this.p1.x)},gl.prototype.getLength=function(){return this.p0.distance(this.p1)},gl.prototype.compareTo=function(t){var e=t,n=this.p0.compareTo(e.p0);return 0!==n?n:this.p1.compareTo(e.p1)},gl.prototype.reverse=function(){var t=this.p0;this.p0=this.p1,this.p1=t},gl.prototype.equalsTopo=function(t){return this.p0.equals(t.p0)&&(this.p1.equals(t.p1)||this.p0.equals(t.p1))&&this.p1.equals(t.p0)},gl.prototype.lineIntersection=function(t){try{return Uu.intersection(this.p0,this.p1,t.p0,t.p1)}catch(t){if(!(t instanceof ju))throw t}return null},gl.prototype.maxY=function(){return Math.max(this.p0.y,this.p1.y)},gl.prototype.pointAlongOffset=function(t,e){var n=this.p0.x+t*(this.p1.x-this.p0.x),r=this.p0.y+t*(this.p1.y-this.p0.y),i=this.p1.x-this.p0.x,o=this.p1.y-this.p0.y,s=Math.sqrt(i*i+o*o),a=0,u=0;if(0!==e){if(s<=0)throw new Error("Cannot compute offset from zero-length line segment");a=e*i/s,u=e*o/s}return new bu(n-u,r+a)},gl.prototype.setCoordinates=function(){if(1===arguments.length){var t=arguments[0];this.setCoordinates(t.p0,t.p1)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this.p0.x=e.x,this.p0.y=e.y,this.p1.x=n.x,this.p1.y=n.y}},gl.prototype.segmentFraction=function(t){var e=this.projectionFactor(t);return e<0?e=0:(e>1||mu.isNaN(e))&&(e=1),e},gl.prototype.toString=function(){return"LINESTRING( "+this.p0.x+" "+this.p0.y+", "+this.p1.x+" "+this.p1.y+")"},gl.prototype.isHorizontal=function(){return this.p0.y===this.p1.y},gl.prototype.distance=function(){if(arguments[0]instanceof gl){var t=arguments[0];return sc.distanceLineLine(this.p0,this.p1,t.p0,t.p1)}if(arguments[0]instanceof bu){var e=arguments[0];return sc.distancePointLine(e,this.p0,this.p1)}},gl.prototype.pointAlong=function(t){var e=new bu;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},gl.prototype.hashCode=function(){var t=mu.doubleToLongBits(this.p0.x);t^=31*mu.doubleToLongBits(this.p0.y);var e=Math.trunc(t)^Math.trunc(t>>32),n=mu.doubleToLongBits(this.p1.x);return n^=31*mu.doubleToLongBits(this.p1.y),e^Math.trunc(n)^Math.trunc(n>>32)},gl.prototype.interfaces_=function(){return[xu,Li]},gl.prototype.getClass=function(){return gl},gl.midPoint=function(t,e){return new bu((t.x+e.x)/2,(t.y+e.y)/2)},dl.serialVersionUID.get=function(){return 0x2d2172135f411c00},Object.defineProperties(gl,dl);var yl=function(){this.tempEnv1=new Yu,this.tempEnv2=new Yu,this._overlapSeg1=new gl,this._overlapSeg2=new gl};yl.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)}},yl.prototype.interfaces_=function(){return[]},yl.prototype.getClass=function(){return yl};var _l=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};_l.prototype.getLineSegment=function(t,e){e.p0=this._pts[t],e.p1=this._pts[t+1]},_l.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<s&&this.computeSelect(t,e,s,r),s<n&&this.computeSelect(t,s,n,r)},_l.prototype.getCoordinates=function(){for(var t=new Array(this._end-this._start+1).fill(null),e=0,n=this._start;n<=this._end;n++)t[e++]=this._pts[n];return t},_l.prototype.computeOverlaps=function(t,e){this.computeOverlapsInternal(this._start,this._end,t,t._start,t._end,e)},_l.prototype.setId=function(t){this._id=t},_l.prototype.select=function(t,e){this.computeSelect(t,this._start,this._end,e)},_l.prototype.getEnvelope=function(){if(null===this._env){var t=this._pts[this._start],e=this._pts[this._end];this._env=new Yu(t,e)}return this._env},_l.prototype.getEndIndex=function(){return this._end},_l.prototype.getStartIndex=function(){return this._start},_l.prototype.getContext=function(){return this._context},_l.prototype.getId=function(){return this._id},_l.prototype.computeOverlapsInternal=function(t,e,n,r,i,o){var s=this._pts[t],a=this._pts[e],u=n._pts[r],c=n._pts[i];if(e-t==1&&i-r==1)return o.overlap(this,t,n,r),null;if(o.tempEnv1.init(s,a),o.tempEnv2.init(u,c),!o.tempEnv1.intersects(o.tempEnv2))return null;var h=Math.trunc((t+e)/2),l=Math.trunc((r+i)/2);t<h&&(r<l&&this.computeOverlapsInternal(t,h,n,r,l,o),l<i&&this.computeOverlapsInternal(t,h,n,l,i,o)),h<e&&(r<l&&this.computeOverlapsInternal(h,e,n,r,l,o),l<i&&this.computeOverlapsInternal(h,e,n,l,i,o))},_l.prototype.interfaces_=function(){return[]},_l.prototype.getClass=function(){return _l};var ml=function(){};ml.prototype.interfaces_=function(){return[]},ml.prototype.getClass=function(){return ml},ml.getChainStartIndices=function(t){var e=0,n=new bc;n.add(new Tu(e));do{var r=ml.findChainEnd(t,e);n.add(new Tu(r)),e=r}while(e<t.length-1);return ml.toIntArray(n)},ml.findChainEnd=function(t,e){for(var n=e;n<t.length-1&&t[n].equals2D(t[n+1]);)n++;if(n>=t.length-1)return t.length-1;for(var r=Bh.quadrant(t[n],t[n+1]),i=e+1;i<t.length&&(t[i-1].equals2D(t[i])||Bh.quadrant(t[i-1],t[i])===r);)i++;return i-1},ml.getChains=function(){if(1===arguments.length){var t=arguments[0];return ml.getChains(t,null)}if(2===arguments.length){for(var e=arguments[0],n=arguments[1],r=new bc,i=ml.getChainStartIndices(e),o=0;o<i.length-1;o++){var s=new _l(e,i[o],i[o+1],n);r.add(s)}return r}},ml.toIntArray=function(t){for(var e=new Array(t.size()).fill(null),n=0;n<e.length;n++)e[n]=t.get(n).intValue();return e};var vl=function(){};vl.prototype.computeNodes=function(t){},vl.prototype.getNodedSubstrings=function(){},vl.prototype.interfaces_=function(){return[]},vl.prototype.getClass=function(){return vl};var xl=function(){if(this._segInt=null,0===arguments.length);else if(1===arguments.length){var t=arguments[0];this.setSegmentIntersector(t)}};xl.prototype.setSegmentIntersector=function(t){this._segInt=t},xl.prototype.interfaces_=function(){return[vl]},xl.prototype.getClass=function(){return xl};var El=function(t){function e(e){e?t.call(this,e):t.call(this),this._monoChains=new bc,this._index=new ol,this._idCounter=0,this._nodedSegStrings=null,this._nOverlaps=0}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={SegmentOverlapAction:{configurable:!0}};return e.prototype.getMonotoneChains=function(){return this._monoChains},e.prototype.getNodedSubstrings=function(){return fl.getNodedSubstrings(this._nodedSegStrings)},e.prototype.getIndex=function(){return this._index},e.prototype.add=function(t){for(var e=ml.getChains(t.getCoordinates(),t).iterator();e.hasNext();){var n=e.next();n.setId(this._idCounter++),this._index.insert(n.getEnvelope(),n),this._monoChains.add(n)}},e.prototype.computeNodes=function(t){this._nodedSegStrings=t;for(var e=t.iterator();e.hasNext();)this.add(e.next());this.intersectChains()},e.prototype.intersectChains=function(){for(var t=new wl(this._segInt),e=this._monoChains.iterator();e.hasNext();)for(var n=e.next(),r=this._index.query(n.getEnvelope()).iterator();r.hasNext();){var i=r.next();if(i.getId()>n.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 wl},Object.defineProperties(e,n),e}(xl),wl=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}(yl),bl=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)}},Il={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}};bl.prototype.getEndCapStyle=function(){return this._endCapStyle},bl.prototype.isSingleSided=function(){return this._isSingleSided},bl.prototype.setQuadrantSegments=function(t){this._quadrantSegments=t,0===this._quadrantSegments&&(this._joinStyle=bl.JOIN_BEVEL),this._quadrantSegments<0&&(this._joinStyle=bl.JOIN_MITRE,this._mitreLimit=Math.abs(this._quadrantSegments)),t<=0&&(this._quadrantSegments=1),this._joinStyle!==bl.JOIN_ROUND&&(this._quadrantSegments=bl.DEFAULT_QUADRANT_SEGMENTS)},bl.prototype.getJoinStyle=function(){return this._joinStyle},bl.prototype.setJoinStyle=function(t){this._joinStyle=t},bl.prototype.setSimplifyFactor=function(t){this._simplifyFactor=t<0?0:t},bl.prototype.getSimplifyFactor=function(){return this._simplifyFactor},bl.prototype.getQuadrantSegments=function(){return this._quadrantSegments},bl.prototype.setEndCapStyle=function(t){this._endCapStyle=t},bl.prototype.getMitreLimit=function(){return this._mitreLimit},bl.prototype.setMitreLimit=function(t){this._mitreLimit=t},bl.prototype.setSingleSided=function(t){this._isSingleSided=t},bl.prototype.interfaces_=function(){return[]},bl.prototype.getClass=function(){return bl},bl.bufferDistanceError=function(t){var e=Math.PI/2/t;return 1-Math.cos(e/2)},Il.CAP_ROUND.get=function(){return 1},Il.CAP_FLAT.get=function(){return 2},Il.CAP_SQUARE.get=function(){return 3},Il.JOIN_ROUND.get=function(){return 1},Il.JOIN_MITRE.get=function(){return 2},Il.JOIN_BEVEL.get=function(){return 3},Il.DEFAULT_QUADRANT_SEGMENTS.get=function(){return 8},Il.DEFAULT_MITRE_LIMIT.get=function(){return 5},Il.DEFAULT_SIMPLIFY_FACTOR.get=function(){return.01},Object.defineProperties(bl,Il);var Nl=function(t){this._distanceTol=null,this._isDeleted=null,this._angleOrientation=sc.COUNTERCLOCKWISE,this._inputLine=t||null},Cl={INIT:{configurable:!0},DELETE:{configurable:!0},KEEP:{configurable:!0},NUM_PTS_TO_CHECK:{configurable:!0}};Nl.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)},Nl.prototype.deleteShallowConcavities=function(){for(var t=1,e=this.findNextNonDeletedIndex(t),n=this.findNextNonDeletedIndex(e),r=!1;n<this._inputLine.length;){var i=!1;this.isDeletable(t,e,n,this._distanceTol)&&(this._isDeleted[e]=Nl.DELETE,i=!0,r=!0),t=i?n:e,e=this.findNextNonDeletedIndex(t),n=this.findNextNonDeletedIndex(e)}return r},Nl.prototype.isShallowConcavity=function(t,e,n,r){return sc.computeOrientation(t,e,n)===this._angleOrientation&&sc.distancePointLine(e,t,n)<r},Nl.prototype.isShallowSampled=function(t,e,n,r,i){var o=Math.trunc((r-n)/Nl.NUM_PTS_TO_CHECK);o<=0&&(o=1);for(var s=n;s<r;s+=o)if(!this.isShallow(t,e,this._inputLine[s],i))return!1;return!0},Nl.prototype.isConcave=function(t,e,n){return sc.computeOrientation(t,e,n)===this._angleOrientation},Nl.prototype.simplify=function(t){this._distanceTol=Math.abs(t),t<0&&(this._angleOrientation=sc.CLOCKWISE),this._isDeleted=new Array(this._inputLine.length).fill(null);var e=!1;do{e=this.deleteShallowConcavities()}while(e);return this.collapseLine()},Nl.prototype.findNextNonDeletedIndex=function(t){for(var e=t+1;e<this._inputLine.length&&this._isDeleted[e]===Nl.DELETE;)e++;return e},Nl.prototype.isShallow=function(t,e,n,r){return sc.distancePointLine(e,t,n)<r},Nl.prototype.collapseLine=function(){for(var t=new Nc,e=0;e<this._inputLine.length;e++)this._isDeleted[e]!==Nl.DELETE&&t.add(this._inputLine[e]);return t.toCoordinateArray()},Nl.prototype.interfaces_=function(){return[]},Nl.prototype.getClass=function(){return Nl},Nl.simplify=function(t,e){return new Nl(t).simplify(e)},Cl.INIT.get=function(){return 0},Cl.DELETE.get=function(){return 1},Cl.KEEP.get=function(){return 1},Cl.NUM_PTS_TO_CHECK.get=function(){return 10},Object.defineProperties(Nl,Cl);var Sl=function(){this._ptList=null,this._precisionModel=null,this._minimimVertexDistance=0,this._ptList=new bc},Ml={COORDINATE_ARRAY_TYPE:{configurable:!0}};Sl.prototype.getCoordinates=function(){return this._ptList.toArray(Sl.COORDINATE_ARRAY_TYPE)},Sl.prototype.setPrecisionModel=function(t){this._precisionModel=t},Sl.prototype.addPt=function(t){var e=new bu(t);if(this._precisionModel.makePrecise(e),this.isRedundant(e))return null;this._ptList.add(e)},Sl.prototype.revere=function(){},Sl.prototype.addPts=function(t,e){if(e)for(var n=0;n<t.length;n++)this.addPt(t[n]);else for(var r=t.length-1;r>=0;r--)this.addPt(t[r])},Sl.prototype.isRedundant=function(t){if(this._ptList.size()<1)return!1;var e=this._ptList.get(this._ptList.size()-1);return t.distance(e)<this._minimimVertexDistance},Sl.prototype.toString=function(){return(new _h).createLineString(this.getCoordinates()).toString()},Sl.prototype.closeRing=function(){if(this._ptList.size()<1)return null;var t=new bu(this._ptList.get(0)),e=this._ptList.get(this._ptList.size()-1);if(t.equals(e))return null;this._ptList.add(t)},Sl.prototype.setMinimumVertexDistance=function(t){this._minimimVertexDistance=t},Sl.prototype.interfaces_=function(){return[]},Sl.prototype.getClass=function(){return Sl},Ml.COORDINATE_ARRAY_TYPE.get=function(){return new Array(0).fill(null)},Object.defineProperties(Sl,Ml);var Ll=function(){},Pl={PI_TIMES_2:{configurable:!0},PI_OVER_2:{configurable:!0},PI_OVER_4:{configurable:!0},COUNTERCLOCKWISE:{configurable:!0},CLOCKWISE:{configurable:!0},NONE:{configurable:!0}};Ll.prototype.interfaces_=function(){return[]},Ll.prototype.getClass=function(){return Ll},Ll.toDegrees=function(t){return 180*t/Math.PI},Ll.normalize=function(t){for(;t>Math.PI;)t-=Ll.PI_TIMES_2;for(;t<=-Math.PI;)t+=Ll.PI_TIMES_2;return t},Ll.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)}},Ll.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},Ll.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},Ll.interiorAngle=function(t,e,n){var r=Ll.angle(e,t),i=Ll.angle(e,n);return Math.abs(i-r)},Ll.normalizePositive=function(t){if(t<0){for(;t<0;)t+=Ll.PI_TIMES_2;t>=Ll.PI_TIMES_2&&(t=0)}else{for(;t>=Ll.PI_TIMES_2;)t-=Ll.PI_TIMES_2;t<0&&(t=0)}return t},Ll.angleBetween=function(t,e,n){var r=Ll.angle(e,t),i=Ll.angle(e,n);return Ll.diff(r,i)},Ll.diff=function(t,e){var n=null;return(n=t<e?e-t:t-e)>Math.PI&&(n=2*Math.PI-n),n},Ll.toRadians=function(t){return t*Math.PI/180},Ll.getTurn=function(t,e){var n=Math.sin(e-t);return n>0?Ll.COUNTERCLOCKWISE:n<0?Ll.CLOCKWISE:Ll.NONE},Ll.angleBetweenOriented=function(t,e,n){var r=Ll.angle(e,t),i=Ll.angle(e,n)-r;return i<=-Math.PI?i+Ll.PI_TIMES_2:i>Math.PI?i-Ll.PI_TIMES_2:i},Pl.PI_TIMES_2.get=function(){return 2*Math.PI},Pl.PI_OVER_2.get=function(){return Math.PI/2},Pl.PI_OVER_4.get=function(){return Math.PI/4},Pl.COUNTERCLOCKWISE.get=function(){return sc.COUNTERCLOCKWISE},Pl.CLOCKWISE.get=function(){return sc.CLOCKWISE},Pl.NONE.get=function(){return sc.COLLINEAR},Object.defineProperties(Ll,Pl);var Ol=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 gl,this._seg1=new gl,this._offset0=new gl,this._offset1=new gl,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 rc,this._filletAngleQuantum=Math.PI/2/n.getQuadrantSegments(),n.getQuadrantSegments()>=8&&n.getJoinStyle()===bl.JOIN_ROUND&&(this._closingSegLengthFactor=t.MAX_CLOSING_SEG_LEN_FACTOR),this.init(r)},Rl={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}};Ol.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=sc.computeOrientation(this._s0,this._s1,this._s2),r=n===sc.CLOCKWISE&&this._side===Nh.LEFT||n===sc.COUNTERCLOCKWISE&&this._side===Nh.RIGHT;0===n?this.addCollinear(e):r?this.addOutsideTurn(n,e):this.addInsideTurn(n,e)},Ol.prototype.addLineEndCap=function(t,e){var n=new gl(t,e),r=new gl;this.computeOffsetSegment(n,Nh.LEFT,this._distance,r);var i=new gl;this.computeOffsetSegment(n,Nh.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 bl.CAP_ROUND:this._segList.addPt(r.p1),this.addFilletArc(e,a+Math.PI/2,a-Math.PI/2,sc.CLOCKWISE,this._distance),this._segList.addPt(i.p1);break;case bl.CAP_FLAT:this._segList.addPt(r.p1),this._segList.addPt(i.p1);break;case bl.CAP_SQUARE:var u=new bu;u.x=Math.abs(this._distance)*Math.cos(a),u.y=Math.abs(this._distance)*Math.sin(a);var c=new bu(r.p1.x+u.x,r.p1.y+u.y),h=new bu(i.p1.x+u.x,i.p1.y+u.y);this._segList.addPt(c),this._segList.addPt(h)}},Ol.prototype.getCoordinates=function(){return this._segList.getCoordinates()},Ol.prototype.addMitreJoin=function(t,e,n,r){var i=!0,o=null;try{o=Uu.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 ju))throw t;o=new bu(0,0),i=!1}i?this._segList.addPt(o):this.addLimitedMitreJoin(e,n,r,this._bufParams.getMitreLimit())},Ol.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,c=n.y-t.y,h=Math.atan2(c,u);r===sc.CLOCKWISE?a<=h&&(a+=2*Math.PI):a>=h&&(a-=2*Math.PI),this._segList.addPt(e),this.addFilletArc(t,a,h,r,i),this._segList.addPt(n)},Ol.prototype.addOutsideTurn=function(t,e){if(this._offset0.p1.distance(this._offset1.p0)<this._distance*Ol.OFFSET_SEGMENT_SEPARATION_FACTOR)return this._segList.addPt(this._offset0.p1),null;this._bufParams.getJoinStyle()===bl.JOIN_MITRE?this.addMitreJoin(this._s1,this._offset0,this._offset1,this._distance):this._bufParams.getJoinStyle()===bl.JOIN_BEVEL?this.addBevelJoin(this._offset0,this._offset1):(e&&this._segList.addPt(this._offset0.p1),this.addFilletCorner(this._s1,this._offset0.p1,this._offset1.p0,t,this._distance),this._segList.addPt(this._offset1.p0))},Ol.prototype.createSquare=function(t){this._segList.addPt(new bu(t.x+this._distance,t.y+this._distance)),this._segList.addPt(new bu(t.x+this._distance,t.y-this._distance)),this._segList.addPt(new bu(t.x-this._distance,t.y-this._distance)),this._segList.addPt(new bu(t.x-this._distance,t.y+this._distance)),this._segList.closeRing()},Ol.prototype.addSegments=function(t,e){this._segList.addPts(t,e)},Ol.prototype.addFirstSegment=function(){this._segList.addPt(this._offset1.p0)},Ol.prototype.addLastSegment=function(){this._segList.addPt(this._offset1.p1)},Ol.prototype.initSideSegments=function(t,e,n){this._s1=t,this._s2=e,this._side=n,this._seg1.setCoordinates(t,e),this.computeOffsetSegment(this._seg1,n,this._distance,this._offset1)},Ol.prototype.addLimitedMitreJoin=function(t,e,n,r){var i=this._seg0.p1,o=Ll.angle(i,this._seg0.p0),s=Ll.angleBetweenOriented(this._seg0.p0,i,this._seg1.p1)/2,a=Ll.normalize(o+s),u=Ll.normalize(a+Math.PI),c=r*n,h=n-c*Math.abs(Math.sin(s)),l=i.x+c*Math.cos(u),p=i.y+c*Math.sin(u),f=new bu(l,p),g=new gl(i,f),d=g.pointAlongOffset(1,h),y=g.pointAlongOffset(1,-h);this._side===Nh.LEFT?(this._segList.addPt(d),this._segList.addPt(y)):(this._segList.addPt(y),this._segList.addPt(d))},Ol.prototype.computeOffsetSegment=function(t,e,n,r){var i=e===Nh.LEFT?1:-1,o=t.p1.x-t.p0.x,s=t.p1.y-t.p0.y,a=Math.sqrt(o*o+s*s),u=i*n*o/a,c=i*n*s/a;r.p0.x=t.p0.x-c,r.p0.y=t.p0.y+u,r.p1.x=t.p1.x-c,r.p1.y=t.p1.y+u},Ol.prototype.addFilletArc=function(t,e,n,r,i){var o=r===sc.CLOCKWISE?-1:1,s=Math.abs(e-n),a=Math.trunc(s/this._filletAngleQuantum+.5);if(a<1)return null;for(var u=s/a,c=0,h=new bu;c<s;){var l=e+o*c;h.x=t.x+i*Math.cos(l),h.y=t.y+i*Math.sin(l),this._segList.addPt(h),c+=u}},Ol.prototype.addInsideTurn=function(t,e){if(this._li.computeIntersection(this._offset0.p0,this._offset0.p1,this._offset1.p0,this._offset1.p1),this._li.hasIntersection())this._segList.addPt(this._li.getIntersection(0));else if(this._hasNarrowConcaveAngle=!0,this._offset0.p1.distance(this._offset1.p0)<this._distance*Ol.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR)this._segList.addPt(this._offset0.p1);else{if(this._segList.addPt(this._offset0.p1),this._closingSegLengthFactor>0){var n=new bu((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 bu((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)}},Ol.prototype.createCircle=function(t){var e=new bu(t.x+this._distance,t.y);this._segList.addPt(e),this.addFilletArc(t,0,2*Math.PI,-1,this._distance),this._segList.closeRing()},Ol.prototype.addBevelJoin=function(t,e){this._segList.addPt(t.p1),this._segList.addPt(e.p0)},Ol.prototype.init=function(t){this._distance=t,this._maxCurveSegmentError=t*(1-Math.cos(this._filletAngleQuantum/2)),this._segList=new Sl,this._segList.setPrecisionModel(this._precisionModel),this._segList.setMinimumVertexDistance(t*Ol.CURVE_VERTEX_SNAP_DISTANCE_FACTOR)},Ol.prototype.addCollinear=function(t){this._li.computeIntersection(this._s0,this._s1,this._s1,this._s2),this._li.getIntersectionNum()>=2&&(this._bufParams.getJoinStyle()===bl.JOIN_BEVEL||this._bufParams.getJoinStyle()===bl.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,sc.CLOCKWISE,this._distance))},Ol.prototype.closeRing=function(){this._segList.closeRing()},Ol.prototype.hasNarrowConcaveAngle=function(){return this._hasNarrowConcaveAngle},Ol.prototype.interfaces_=function(){return[]},Ol.prototype.getClass=function(){return Ol},Rl.OFFSET_SEGMENT_SEPARATION_FACTOR.get=function(){return.001},Rl.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return.001},Rl.CURVE_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return 1e-6},Rl.MAX_CLOSING_SEG_LEN_FACTOR.get=function(){return 80},Object.defineProperties(Ol,Rl);var Tl=function(){this._distance=0,this._precisionModel=null,this._bufParams=null;var t=arguments[0],e=arguments[1];this._precisionModel=t,this._bufParams=e};Tl.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&&Cc.reverse(o),o},Tl.prototype.computeSingleSidedBufferCurve=function(t,e,n){var r=this.simplifyTolerance(this._distance);if(e){n.addSegments(t,!0);var i=Nl.simplify(t,-r),o=i.length-1;n.initSideSegments(i[o],i[o-1],Nh.LEFT),n.addFirstSegment();for(var s=o-2;s>=0;s--)n.addNextSegment(i[s],!0)}else{n.addSegments(t,!1);var a=Nl.simplify(t,r),u=a.length-1;n.initSideSegments(a[0],a[1],Nh.LEFT),n.addFirstSegment();for(var c=2;c<=u;c++)n.addNextSegment(a[c],!0)}n.addLastSegment(),n.closeRing()},Tl.prototype.computeRingBufferCurve=function(t,e,n){var r=this.simplifyTolerance(this._distance);e===Nh.RIGHT&&(r=-r);var i=Nl.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()},Tl.prototype.computeLineBufferCurve=function(t,e){var n=this.simplifyTolerance(this._distance),r=Nl.simplify(t,n),i=r.length-1;e.initSideSegments(r[0],r[1],Nh.LEFT);for(var o=2;o<=i;o++)e.addNextSegment(r[o],!0);e.addLastSegment(),e.addLineEndCap(r[i-1],r[i]);var s=Nl.simplify(t,-n),a=s.length-1;e.initSideSegments(s[a],s[a-1],Nh.LEFT);for(var u=a-2;u>=0;u--)e.addNextSegment(s[u],!0);e.addLastSegment(),e.addLineEndCap(s[1],s[0]),e.closeRing()},Tl.prototype.computePointCurve=function(t,e){switch(this._bufParams.getEndCapStyle()){case bl.CAP_ROUND:e.createCircle(t);break;case bl.CAP_SQUARE:e.createSquare(t)}},Tl.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()},Tl.prototype.getBufferParameters=function(){return this._bufParams},Tl.prototype.simplifyTolerance=function(t){return t*this._bufParams.getSimplifyFactor()},Tl.prototype.getRingCurve=function(t,e,n){if(this._distance=n,t.length<=2)return this.getLineCurve(t,n);if(0===n)return Tl.copyCoordinates(t);var r=this.getSegGen(n);return this.computeRingBufferCurve(t,e,r),r.getCoordinates()},Tl.prototype.computeOffsetCurve=function(t,e,n){var r=this.simplifyTolerance(this._distance);if(e){var i=Nl.simplify(t,-r),o=i.length-1;n.initSideSegments(i[o],i[o-1],Nh.LEFT),n.addFirstSegment();for(var s=o-2;s>=0;s--)n.addNextSegment(i[s],!0)}else{var a=Nl.simplify(t,r),u=a.length-1;n.initSideSegments(a[0],a[1],Nh.LEFT),n.addFirstSegment();for(var c=2;c<=u;c++)n.addNextSegment(a[c],!0)}n.addLastSegment()},Tl.prototype.getSegGen=function(t){return new Ol(this._precisionModel,this._bufParams,t)},Tl.prototype.interfaces_=function(){return[]},Tl.prototype.getClass=function(){return Tl},Tl.copyCoordinates=function(t){for(var e=new Array(t.length).fill(null),n=0;n<e.length;n++)e[n]=new bu(t[n]);return e};var Al=function(){this._subgraphs=null,this._seg=new gl,this._cga=new sc;var t=arguments[0];this._subgraphs=t},Dl={DepthSegment:{configurable:!0}};Al.prototype.findStabbedSegments=function(){if(1===arguments.length){for(var t=arguments[0],e=new bc,n=this._subgraphs.iterator();n.hasNext();){var r=n.next(),i=r.getEnvelope();t.y<i.getMinY()||t.y>i.getMaxY()||this.findStabbedSegments(t,r.getDirectedEdges(),e)}return e}if(3===arguments.length)if(Lu(arguments[2],wc)&&arguments[0]instanceof bu&&arguments[1]instanceof jh){for(var o=arguments[0],s=arguments[1],a=arguments[2],u=s.getEdge().getCoordinates(),c=0;c<u.length-1;c++)if(this._seg.p0=u[c],this._seg.p1=u[c+1],this._seg.p0.y>this._seg.p1.y&&this._seg.reverse(),!(Math.max(this._seg.p0.x,this._seg.p1.x)<o.x)&&!(this._seg.isHorizontal()||o.y<this._seg.p0.y||o.y>this._seg.p1.y||sc.computeOrientation(this._seg.p0,this._seg.p1,o)===sc.RIGHT)){var h=s.getDepth(Nh.LEFT);this._seg.p0.equals(u[c])||(h=s.getDepth(Nh.RIGHT));var l=new Fl(this._seg,h);a.add(l)}}else if(Lu(arguments[2],wc)&&arguments[0]instanceof bu&&Lu(arguments[1],wc))for(var p=arguments[0],f=arguments[2],g=arguments[1].iterator();g.hasNext();){var d=g.next();d.isForward()&&this.findStabbedSegments(p,d,f)}},Al.prototype.getDepth=function(t){var e=this.findStabbedSegments(t);return 0===e.size()?0:$h.min(e)._leftDepth},Al.prototype.interfaces_=function(){return[]},Al.prototype.getClass=function(){return Al},Dl.DepthSegment.get=function(){return Fl},Object.defineProperties(Al,Dl);var Fl=function(){this._upwardSeg=null,this._leftDepth=null;var t=arguments[0],e=arguments[1];this._upwardSeg=new gl(t),this._leftDepth=e};Fl.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)},Fl.prototype.compareX=function(t,e){var n=t.p0.compareTo(e.p0);return 0!==n?n:t.p1.compareTo(e.p1)},Fl.prototype.toString=function(){return this._upwardSeg.toString()},Fl.prototype.interfaces_=function(){return[xu]},Fl.prototype.getClass=function(){return Fl};var ql=function(t,e,n){this.p0=t||null,this.p1=e||null,this.p2=n||null};ql.prototype.area=function(){return ql.area(this.p0,this.p1,this.p2)},ql.prototype.signedArea=function(){return ql.signedArea(this.p0,this.p1,this.p2)},ql.prototype.interpolateZ=function(t){if(null===t)throw new _u("Supplied point is null.");return ql.interpolateZ(t,this.p0,this.p1,this.p2)},ql.prototype.longestSideLength=function(){return ql.longestSideLength(this.p0,this.p1,this.p2)},ql.prototype.isAcute=function(){return ql.isAcute(this.p0,this.p1,this.p2)},ql.prototype.circumcentre=function(){return ql.circumcentre(this.p0,this.p1,this.p2)},ql.prototype.area3D=function(){return ql.area3D(this.p0,this.p1,this.p2)},ql.prototype.centroid=function(){return ql.centroid(this.p0,this.p1,this.p2)},ql.prototype.inCentre=function(){return ql.inCentre(this.p0,this.p1,this.p2)},ql.prototype.interfaces_=function(){return[]},ql.prototype.getClass=function(){return ql},ql.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)},ql.signedArea=function(t,e,n){return((n.x-t.x)*(e.y-t.y)-(e.x-t.x)*(n.y-t.y))/2},ql.det=function(t,e,n,r){return t*r-e*n},ql.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,c=r.y-o,h=s*c-a*u,l=t.x-i,p=t.y-o,f=(c*l-a*p)/h,g=(-u*l+s*p)/h;return e.z+f*(n.z-e.z)+g*(r.z-e.z)},ql.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},ql.isAcute=function(t,e,n){return!!Ll.isAcute(t,e,n)&&!!Ll.isAcute(e,n,t)&&!!Ll.isAcute(n,t,e)},ql.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,c=2*ql.det(o,s,a,u),h=ql.det(s,o*o+s*s,u,a*a+u*u),l=ql.det(o,o*o+s*s,a,a*a+u*u);return new bu(r-h/c,i+l/c)},ql.perpendicularBisector=function(t,e){var n=e.x-t.x,r=e.y-t.y,i=new Uu(t.x+n/2,t.y+r/2,1),o=new Uu(t.x-r+n/2,t.y+n+r/2,1);return new Uu(i,o)},ql.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 bu(t.x+i*o,t.y+i*s)},ql.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,c=i*u-o*a,h=o*s-r*u,l=r*a-i*s,p=c*c+h*h+l*l;return Math.sqrt(p)/2},ql.centroid=function(t,e,n){var r=(t.x+e.x+n.x)/3,i=(t.y+e.y+n.y)/3;return new bu(r,i)},ql.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 bu(a,u)};var Gl=function(){this._inputGeom=null,this._distance=null,this._curveBuilder=null,this._curveList=new bc;var t=arguments[0],e=arguments[1],n=arguments[2];this._inputGeom=t,this._distance=e,this._curveBuilder=n};Gl.prototype.addPoint=function(t){if(this._distance<=0)return null;var e=t.getCoordinates(),n=this._curveBuilder.getLineCurve(e,this._distance);this.addCurve(n,Su.EXTERIOR,Su.INTERIOR)},Gl.prototype.addPolygon=function(t){var e=this._distance,n=Nh.LEFT;this._distance<0&&(e=-this._distance,n=Nh.RIGHT);var r=t.getExteriorRing(),i=Cc.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,Su.EXTERIOR,Su.INTERIOR);for(var o=0;o<t.getNumInteriorRing();o++){var s=t.getInteriorRingN(o),a=Cc.removeRepeatedPoints(s.getCoordinates());this._distance>0&&this.isErodedCompletely(s,-this._distance)||this.addPolygonRing(a,e,Nh.opposite(n),Su.INTERIOR,Su.EXTERIOR)}},Gl.prototype.isTriangleErodedCompletely=function(t,e){var n=new ql(t[0],t[1],t[2]),r=n.inCentre();return sc.distancePointLine(r,n.p0,n.p1)<Math.abs(e)},Gl.prototype.addLineString=function(t){if(this._distance<=0&&!this._curveBuilder.getBufferParameters().isSingleSided())return null;var e=Cc.removeRepeatedPoints(t.getCoordinates()),n=this._curveBuilder.getLineCurve(e,this._distance);this.addCurve(n,Su.EXTERIOR,Su.INTERIOR)},Gl.prototype.addCurve=function(t,e,n){if(null===t||t.length<2)return null;var r=new fl(t,new Rh(0,Su.BOUNDARY,e,n));this._curveList.add(r)},Gl.prototype.getCurves=function(){return this.add(this._inputGeom),this._curveList},Gl.prototype.addPolygonRing=function(t,e,n,r,i){if(0===e&&t.length<eh.MINIMUM_VALID_SIZE)return null;var o=r,s=i;t.length>=eh.MINIMUM_VALID_SIZE&&sc.isCCW(t)&&(o=i,s=r,n=Nh.opposite(n));var a=this._curveBuilder.getRingCurve(t,n,e);this.addCurve(a,o,s)},Gl.prototype.add=function(t){if(t.isEmpty())return null;t instanceof $c?this.addPolygon(t):t instanceof Jc?this.addLineString(t):t instanceof Kc?this.addPoint(t):(t instanceof th||t instanceof Xc||t instanceof nh||t instanceof jc)&&this.addCollection(t)},Gl.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},Gl.prototype.addCollection=function(t){for(var e=0;e<t.getNumGeometries();e++){var n=t.getGeometryN(e);this.add(n)}},Gl.prototype.interfaces_=function(){return[]},Gl.prototype.getClass=function(){return Gl};var Bl=function(){};Bl.prototype.locate=function(t){},Bl.prototype.interfaces_=function(){return[]},Bl.prototype.getClass=function(){return Bl};var kl=function(){this._parent=null,this._atStart=null,this._max=null,this._index=null,this._subcollectionIterator=null;var t=arguments[0];this._parent=t,this._atStart=!0,this._index=0,this._max=t.getNumGeometries()};kl.prototype.next=function(){if(this._atStart)return this._atStart=!1,kl.isAtomic(this._parent)&&this._index++,this._parent;if(null!==this._subcollectionIterator){if(this._subcollectionIterator.hasNext())return this._subcollectionIterator.next();this._subcollectionIterator=null}if(this._index>=this._max)throw new Pi;var t=this._parent.getGeometryN(this._index++);return t instanceof jc?(this._subcollectionIterator=new kl(t),this._subcollectionIterator.next()):t},kl.prototype.remove=function(){throw new Error(this.getClass().getName())},kl.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)},kl.prototype.interfaces_=function(){return[Ec]},kl.prototype.getClass=function(){return kl},kl.isAtomic=function(t){return!(t instanceof jc)};var zl=function(){this._geom=null;var t=arguments[0];this._geom=t};zl.prototype.locate=function(t){return zl.locate(t,this._geom)},zl.prototype.interfaces_=function(){return[Bl]},zl.prototype.getClass=function(){return zl},zl.isPointInRing=function(t,e){return!!e.getEnvelopeInternal().intersects(t)&&sc.isPointInRing(t,e.getCoordinates())},zl.containsPointInPolygon=function(t,e){if(e.isEmpty())return!1;var n=e.getExteriorRing();if(!zl.isPointInRing(t,n))return!1;for(var r=0;r<e.getNumInteriorRing();r++){var i=e.getInteriorRingN(r);if(zl.isPointInRing(t,i))return!1}return!0},zl.containsPoint=function(t,e){if(e instanceof $c)return zl.containsPointInPolygon(t,e);if(e instanceof jc)for(var n=new kl(e);n.hasNext();){var r=n.next();if(r!==e&&zl.containsPoint(t,r))return!0}return!1},zl.locate=function(t,e){return e.isEmpty()?Su.EXTERIOR:zl.containsPoint(t,e)?Su.INTERIOR:Su.EXTERIOR};var jl=function(){this._edgeMap=new Gi,this._edgeList=null,this._ptInAreaLocation=[Su.NONE,Su.NONE]};jl.prototype.getNextCW=function(t){this.getEdges();var e=this._edgeList.indexOf(t),n=e-1;return 0===e&&(n=this._edgeList.size()-1),this._edgeList.get(n)},jl.prototype.propagateSideLabels=function(t){for(var e=Su.NONE,n=this.iterator();n.hasNext();){var r=n.next().getLabel();r.isArea(t)&&r.getLocation(t,Nh.LEFT)!==Su.NONE&&(e=r.getLocation(t,Nh.LEFT))}if(e===Su.NONE)return null;for(var i=e,o=this.iterator();o.hasNext();){var s=o.next(),a=s.getLabel();if(a.getLocation(t,Nh.ON)===Su.NONE&&a.setLocation(t,Nh.ON,i),a.isArea(t)){var u=a.getLocation(t,Nh.LEFT),c=a.getLocation(t,Nh.RIGHT);if(c!==Su.NONE){if(c!==i)throw new Mh("side location conflict",s.getCoordinate());u===Su.NONE&&tc.shouldNeverReachHere("found single null side (at "+s.getCoordinate()+")"),i=u}else tc.isTrue(a.getLocation(t,Nh.LEFT)===Su.NONE,"found single null side"),a.setLocation(t,Nh.RIGHT,i),a.setLocation(t,Nh.LEFT,i)}}},jl.prototype.getCoordinate=function(){var t=this.iterator();return t.hasNext()?t.next().getCoordinate():null},jl.prototype.print=function(t){Xu.out.println("EdgeEndStar: "+this.getCoordinate());for(var e=this.iterator();e.hasNext();)e.next().print(t)},jl.prototype.isAreaLabelsConsistent=function(t){return this.computeEdgeEndLabels(t.getBoundaryNodeRule()),this.checkAreaLabelsConsistent(0)},jl.prototype.checkAreaLabelsConsistent=function(t){var e=this.getEdges();if(e.size()<=0)return!0;var n=e.size()-1,r=e.get(n).getLabel().getLocation(t,Nh.LEFT);tc.isTrue(r!==Su.NONE,"Found unlabelled area edge");for(var i=r,o=this.iterator();o.hasNext();){var s=o.next().getLabel();tc.isTrue(s.isArea(t),"Found non-area edge");var a=s.getLocation(t,Nh.LEFT),u=s.getLocation(t,Nh.RIGHT);if(a===u)return!1;if(u!==i)return!1;i=a}return!0},jl.prototype.findIndex=function(t){this.iterator();for(var e=0;e<this._edgeList.size();e++)if(this._edgeList.get(e)===t)return e;return-1},jl.prototype.iterator=function(){return this.getEdges().iterator()},jl.prototype.getEdges=function(){return null===this._edgeList&&(this._edgeList=new bc(this._edgeMap.values())),this._edgeList},jl.prototype.getLocation=function(t,e,n){return this._ptInAreaLocation[t]===Su.NONE&&(this._ptInAreaLocation[t]=zl.locate(e,n[t].getGeometry())),this._ptInAreaLocation[t]},jl.prototype.toString=function(){var t=new Ru;t.append("EdgeEndStar: "+this.getCoordinate()),t.append("\n");for(var e=this.iterator();e.hasNext();){var n=e.next();t.append(n),t.append("\n")}return t.toString()},jl.prototype.computeEdgeEndLabels=function(t){for(var e=this.iterator();e.hasNext();)e.next().computeLabel(t)},jl.prototype.computeLabelling=function(t){this.computeEdgeEndLabels(t[0].getBoundaryNodeRule()),this.propagateSideLabels(0),this.propagateSideLabels(1);for(var e=[!1,!1],n=this.iterator();n.hasNext();)for(var r=n.next().getLabel(),i=0;i<2;i++)r.isLine(i)&&r.getLocation(i)===Su.BOUNDARY&&(e[i]=!0);for(var o=this.iterator();o.hasNext();)for(var s=o.next(),a=s.getLabel(),u=0;u<2;u++)if(a.isAnyNull(u)){var c=Su.NONE;if(e[u])c=Su.EXTERIOR;else{var h=s.getCoordinate();c=this.getLocation(u,h,t)}a.setAllLocationsIfNull(u,c)}},jl.prototype.getDegree=function(){return this._edgeMap.size()},jl.prototype.insertEdgeEnd=function(t,e){this._edgeMap.put(t,e),this._edgeList=null},jl.prototype.interfaces_=function(){return[]},jl.prototype.getClass=function(){return jl};var Xl=function(t){function e(){t.call(this),this._resultAreaEdgeList=null,this._label=null,this._SCANNING_FOR_INCOMING=1,this._LINKING_TO_OUTGOING=2}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.linkResultDirectedEdges=function(){this.getResultAreaEdges();for(var t=null,e=null,n=this._SCANNING_FOR_INCOMING,r=0;r<this._resultAreaEdgeList.size();r++){var i=this._resultAreaEdgeList.get(r),o=i.getSym();if(i.getLabel().isArea())switch(null===t&&i.isInResult()&&(t=i),n){case this._SCANNING_FOR_INCOMING:if(!o.isInResult())continue;e=o,n=this._LINKING_TO_OUTGOING;break;case this._LINKING_TO_OUTGOING:if(!i.isInResult())continue;e.setNext(i),n=this._SCANNING_FOR_INCOMING}}if(n===this._LINKING_TO_OUTGOING){if(null===t)throw new Mh("no outgoing dirEdge found",this.getCoordinate());tc.isTrue(t.isInResult(),"unable to link last incoming dirEdge"),e.setNext(t)}},e.prototype.insert=function(t){var e=t;this.insertEdgeEnd(e,e)},e.prototype.getRightmostEdge=function(){var t=this.getEdges(),e=t.size();if(e<1)return null;var n=t.get(0);if(1===e)return n;var r=t.get(e-1),i=n.getQuadrant(),o=r.getQuadrant();return Bh.isNorthern(i)&&Bh.isNorthern(o)?n:Bh.isNorthern(i)||Bh.isNorthern(o)?0!==n.getDy()?n:0!==r.getDy()?r:(tc.shouldNeverReachHere("found two horizontal edges incident on node"),null):r},e.prototype.print=function(t){Xu.out.println("DirectedEdgeStar: "+this.getCoordinate());for(var e=this.iterator();e.hasNext();){var n=e.next();t.print("out "),n.print(t),t.println(),t.print("in "),n.getSym().print(t),t.println()}},e.prototype.getResultAreaEdges=function(){if(null!==this._resultAreaEdgeList)return this._resultAreaEdgeList;this._resultAreaEdgeList=new bc;for(var t=this.iterator();t.hasNext();){var e=t.next();(e.isInResult()||e.getSym().isInResult())&&this._resultAreaEdgeList.add(e)}return this._resultAreaEdgeList},e.prototype.updateLabelling=function(t){for(var e=this.iterator();e.hasNext();){var n=e.next().getLabel();n.setAllLocationsIfNull(0,t.getLocation(0)),n.setAllLocationsIfNull(1,t.getLocation(1))}},e.prototype.linkAllDirectedEdges=function(){this.getEdges();for(var t=null,e=null,n=this._edgeList.size()-1;n>=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(Nh.LEFT),r=t.getDepth(Nh.RIGHT),i=this.computeDepths(e+1,this._edgeList.size(),n);if(this.computeDepths(0,e,i)!==r)throw new Mh("depth mismatch at "+t.getCoordinate())}else if(3===arguments.length){for(var o=arguments[1],s=arguments[2],a=arguments[0];a<o;a++){var u=this._edgeList.get(a);u.setEdgeDepths(Nh.RIGHT,s),s=u.getDepth(Nh.LEFT)}return s}},e.prototype.mergeSymLabels=function(){for(var t=this.iterator();t.hasNext();){var e=t.next();e.getLabel().merge(e.getSym().getLabel())}},e.prototype.linkMinimalDirectedEdges=function(t){for(var e=null,n=null,r=this._SCANNING_FOR_INCOMING,i=this._resultAreaEdgeList.size()-1;i>=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&&(tc.isTrue(null!==e,"found null for first outgoing dirEdge"),tc.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=Su.NONE,e=this.iterator();e.hasNext();){var n=e.next(),r=n.getSym();if(!n.isLineEdge()){if(n.isInResult()){t=Su.INTERIOR;break}if(r.isInResult()){t=Su.EXTERIOR;break}}}if(t===Su.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===Su.INTERIOR):(s.isInResult()&&(i=Su.EXTERIOR),a.isInResult()&&(i=Su.INTERIOR))}},e.prototype.computeLabelling=function(e){t.prototype.computeLabelling.call(this,e),this._label=new Rh(Su.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!==Su.INTERIOR&&o!==Su.BOUNDARY||this._label.setLocation(i,Su.INTERIOR)}},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(jl),Ul=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 qh(t,new Xl)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Xh),Yl=function t(){this._pts=null,this._orientation=null;var e=arguments[0];this._pts=e,this._orientation=t.orientation(e)};Yl.prototype.compareTo=function(t){var e=t;return Yl.compareOriented(this._pts,this._orientation,e._pts,e._orientation)},Yl.prototype.interfaces_=function(){return[xu]},Yl.prototype.getClass=function(){return Yl},Yl.orientation=function(t){return 1===Cc.increasingDirection(t)},Yl.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,c=r?0:n.length-1;;){var h=t[u].compareTo(n[c]);if(0!==h)return h;var l=(u+=i)===s,p=(c+=o)===a;if(l&&!p)return-1;if(!l&&p)return 1;if(l&&p)return 0}};var Vl=function(){this._edges=new bc,this._ocaMap=new Gi};Vl.prototype.print=function(t){t.print("MULTILINESTRING ( ");for(var e=0;e<this._edges.size();e++){var n=this._edges.get(e);e>0&&t.print(","),t.print("(");for(var r=n.getCoordinates(),i=0;i<r.length;i++)i>0&&t.print(","),t.print(r[i].x+" "+r[i].y);t.println(")")}t.print(") ")},Vl.prototype.addAll=function(t){for(var e=t.iterator();e.hasNext();)this.add(e.next())},Vl.prototype.findEdgeIndex=function(t){for(var e=0;e<this._edges.size();e++)if(this._edges.get(e).equals(t))return e;return-1},Vl.prototype.iterator=function(){return this._edges.iterator()},Vl.prototype.getEdges=function(){return this._edges},Vl.prototype.get=function(t){return this._edges.get(t)},Vl.prototype.findEqualEdge=function(t){var e=new Yl(t.getCoordinates());return this._ocaMap.get(e)},Vl.prototype.add=function(t){this._edges.add(t);var e=new Yl(t.getCoordinates());this._ocaMap.put(e,t)},Vl.prototype.interfaces_=function(){return[]},Vl.prototype.getClass=function(){return Vl};var Hl=function(){};Hl.prototype.processIntersections=function(t,e,n,r){},Hl.prototype.isDone=function(){},Hl.prototype.interfaces_=function(){return[]},Hl.prototype.getClass=function(){return Hl};var Wl=function(){this._hasIntersection=!1,this._hasProper=!1,this._hasProperInterior=!1,this._hasInterior=!1,this._properIntersectionPoint=null,this._li=null,this._isSelfIntersection=null,this.numIntersections=0,this.numInteriorIntersections=0,this.numProperIntersections=0,this.numTests=0;var t=arguments[0];this._li=t};Wl.prototype.isTrivialIntersection=function(t,e,n,r){if(t===n&&1===this._li.getIntersectionNum()){if(Wl.isAdjacentSegments(e,r))return!0;if(t.isClosed()){var i=t.size()-1;if(0===e&&r===i||0===r&&e===i)return!0}}return!1},Wl.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},Wl.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},Wl.prototype.getLineIntersector=function(){return this._li},Wl.prototype.hasProperIntersection=function(){return this._hasProper},Wl.prototype.processIntersections=function(t,e,n,r){if(t===n&&e===r)return null;this.numTests++;var i=t.getCoordinates()[e],o=t.getCoordinates()[e+1],s=n.getCoordinates()[r],a=n.getCoordinates()[r+1];this._li.computeIntersection(i,o,s,a),this._li.hasIntersection()&&(this.numIntersections++,this._li.isInteriorIntersection()&&(this.numInteriorIntersections++,this._hasInterior=!0),this.isTrivialIntersection(t,e,n,r)||(this._hasIntersection=!0,t.addIntersections(this._li,e,0),n.addIntersections(this._li,r,1),this._li.isProper()&&(this.numProperIntersections++,this._hasProper=!0,this._hasProperInterior=!0)))},Wl.prototype.hasIntersection=function(){return this._hasIntersection},Wl.prototype.isDone=function(){return!1},Wl.prototype.hasInteriorIntersection=function(){return this._hasInterior},Wl.prototype.interfaces_=function(){return[Hl]},Wl.prototype.getClass=function(){return Wl},Wl.isAdjacentSegments=function(t,e){return 1===Math.abs(t-e)};var Jl=function(){this.coord=null,this.segmentIndex=null,this.dist=null;var t=arguments[0],e=arguments[1],n=arguments[2];this.coord=new bu(t),this.segmentIndex=e,this.dist=n};Jl.prototype.getSegmentIndex=function(){return this.segmentIndex},Jl.prototype.getCoordinate=function(){return this.coord},Jl.prototype.print=function(t){t.print(this.coord),t.print(" seg # = "+this.segmentIndex),t.println(" dist = "+this.dist)},Jl.prototype.compareTo=function(t){var e=t;return this.compare(e.segmentIndex,e.dist)},Jl.prototype.isEndPoint=function(t){return 0===this.segmentIndex&&0===this.dist||this.segmentIndex===t},Jl.prototype.toString=function(){return this.coord+" seg # = "+this.segmentIndex+" dist = "+this.dist},Jl.prototype.getDistance=function(){return this.dist},Jl.prototype.compare=function(t,e){return this.segmentIndex<t?-1:this.segmentIndex>t?1:this.dist<e?-1:this.dist>e?1:0},Jl.prototype.interfaces_=function(){return[xu]},Jl.prototype.getClass=function(){return Jl};var Zl=function(){this._nodeMap=new Gi,this.edge=null;var t=arguments[0];this.edge=t};Zl.prototype.print=function(t){t.println("Intersections:");for(var e=this.iterator();e.hasNext();)e.next().print(t)},Zl.prototype.iterator=function(){return this._nodeMap.values().iterator()},Zl.prototype.addSplitEdges=function(t){this.addEndpoints();for(var e=this.iterator(),n=e.next();e.hasNext();){var r=e.next(),i=this.createSplitEdge(n,r);t.add(i),n=r}},Zl.prototype.addEndpoints=function(){var t=this.edge.pts.length-1;this.add(this.edge.pts[0],0,0),this.add(this.edge.pts[t],t,0)},Zl.prototype.createSplitEdge=function(t,e){var n=e.segmentIndex-t.segmentIndex+2,r=this.edge.pts[e.segmentIndex],i=e.dist>0||!e.coord.equals2D(r);i||n--;var o=new Array(n).fill(null),s=0;o[s++]=new bu(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 ep(o,new Rh(this.edge._label))},Zl.prototype.add=function(t,e,n){var r=new Jl(t,e,n),i=this._nodeMap.get(r);return null!==i?i:(this._nodeMap.put(r,r),r)},Zl.prototype.isIntersection=function(t){for(var e=this.iterator();e.hasNext();)if(e.next().coord.equals(t))return!0;return!1},Zl.prototype.interfaces_=function(){return[]},Zl.prototype.getClass=function(){return Zl};var Kl=function(){};Kl.prototype.getChainStartIndices=function(t){var e=0,n=new bc;n.add(new Tu(e));do{var r=this.findChainEnd(t,e);n.add(new Tu(r)),e=r}while(e<t.length-1);return Kl.toIntArray(n)},Kl.prototype.findChainEnd=function(t,e){for(var n=Bh.quadrant(t[e],t[e+1]),r=e+1;r<t.length&&Bh.quadrant(t[r-1],t[r])===n;)r++;return r-1},Kl.prototype.interfaces_=function(){return[]},Kl.prototype.getClass=function(){return Kl},Kl.toIntArray=function(t){for(var e=new Array(t.size()).fill(null),n=0;n<e.length;n++)e[n]=t.get(n).intValue();return e};var Ql=function(){this.e=null,this.pts=null,this.startIndex=null,this.env1=new Yu,this.env2=new Yu;var t=arguments[0];this.e=t,this.pts=t.getCoordinates();var e=new Kl;this.startIndex=e.getChainStartIndices(this.pts)};Ql.prototype.getCoordinates=function(){return this.pts},Ql.prototype.getMaxX=function(t){var e=this.pts[this.startIndex[t]].x,n=this.pts[this.startIndex[t+1]].x;return e>n?e:n},Ql.prototype.getMinX=function(t){var e=this.pts[this.startIndex[t]].x,n=this.pts[this.startIndex[t+1]].x;return e<n?e:n},Ql.prototype.computeIntersectsForChain=function(){if(4===arguments.length){var t=arguments[0],e=arguments[1],n=arguments[2],r=arguments[3];this.computeIntersectsForChain(this.startIndex[t],this.startIndex[t+1],e,e.startIndex[n],e.startIndex[n+1],r)}else if(6===arguments.length){var i=arguments[0],o=arguments[1],s=arguments[2],a=arguments[3],u=arguments[4],c=arguments[5],h=this.pts[i],l=this.pts[o],p=s.pts[a],f=s.pts[u];if(o-i==1&&u-a==1)return c.addIntersections(this.e,i,s.e,a),null;if(this.env1.init(h,l),this.env2.init(p,f),!this.env1.intersects(this.env2))return null;var g=Math.trunc((i+o)/2),d=Math.trunc((a+u)/2);i<g&&(a<d&&this.computeIntersectsForChain(i,g,s,a,d,c),d<u&&this.computeIntersectsForChain(i,g,s,d,u,c)),g<o&&(a<d&&this.computeIntersectsForChain(g,o,s,a,d,c),d<u&&this.computeIntersectsForChain(g,o,s,d,u,c))}},Ql.prototype.getStartIndexes=function(){return this.startIndex},Ql.prototype.computeIntersects=function(t,e){for(var n=0;n<this.startIndex.length-1;n++)for(var r=0;r<t.startIndex.length-1;r++)this.computeIntersectsForChain(n,t,r,e)},Ql.prototype.interfaces_=function(){return[]},Ql.prototype.getClass=function(){return Ql};var $l=function t(){this._depth=Array(2).fill().map((function(){return Array(3)}));for(var e=0;e<2;e++)for(var n=0;n<3;n++)this._depth[e][n]=t.NULL_VALUE},tp={NULL_VALUE:{configurable:!0}};$l.prototype.getDepth=function(t,e){return this._depth[t][e]},$l.prototype.setDepth=function(t,e,n){this._depth[t][e]=n},$l.prototype.isNull=function(){if(0===arguments.length){for(var t=0;t<2;t++)for(var e=0;e<3;e++)if(this._depth[t][e]!==$l.NULL_VALUE)return!1;return!0}if(1===arguments.length){var n=arguments[0];return this._depth[n][1]===$l.NULL_VALUE}if(2===arguments.length){var r=arguments[0],i=arguments[1];return this._depth[r][i]===$l.NULL_VALUE}},$l.prototype.normalize=function(){for(var t=0;t<2;t++)if(!this.isNull(t)){var e=this._depth[t][1];this._depth[t][2]<e&&(e=this._depth[t][2]),e<0&&(e=0);for(var n=1;n<3;n++){var r=0;this._depth[t][n]>e&&(r=1),this._depth[t][n]=r}}},$l.prototype.getDelta=function(t){return this._depth[t][Nh.RIGHT]-this._depth[t][Nh.LEFT]},$l.prototype.getLocation=function(t,e){return this._depth[t][e]<=0?Su.EXTERIOR:Su.INTERIOR},$l.prototype.toString=function(){return"A: "+this._depth[0][1]+","+this._depth[0][2]+" B: "+this._depth[1][1]+","+this._depth[1][2]},$l.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!==Su.EXTERIOR&&r!==Su.INTERIOR||(this.isNull(e,n)?this._depth[e][n]=$l.depthAtLocation(r):this._depth[e][n]+=$l.depthAtLocation(r))}else if(3===arguments.length){var i=arguments[0],o=arguments[1];arguments[2]===Su.INTERIOR&&this._depth[i][o]++}},$l.prototype.interfaces_=function(){return[]},$l.prototype.getClass=function(){return $l},$l.depthAtLocation=function(t){return t===Su.EXTERIOR?0:t===Su.INTERIOR?1:$l.NULL_VALUE},tp.NULL_VALUE.get=function(){return-1},Object.defineProperties($l,tp);var ep=function(t){function e(){if(t.call(this),this.pts=null,this._env=null,this.eiList=new Zl(this),this._name=null,this._mce=null,this._isIsolated=!0,this._depth=new $l,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,Rh.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;s<this.pts.length;s++)if(this.pts[s].equals2D(n.pts[s])||(r=!1),this.pts[s].equals2D(n.pts[--o])||(i=!1),!r&&!i)return!1;return!0},e.prototype.getCoordinate=function(){if(0===arguments.length)return this.pts.length>0?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<this.pts.length;e++)e>0&&t.print(","),t.print(this.pts[e].x+" "+this.pts[e].y);t.print(") "+this._label+" "+this._depthDelta)},e.prototype.computeIM=function(t){e.updateIM(this._label,t)},e.prototype.isCollapsed=function(){return!!this._label.isArea()&&3===this.pts.length&&!!this.pts[0].equals(this.pts[2])},e.prototype.isClosed=function(){return this.pts[0].equals(this.pts[this.pts.length-1])},e.prototype.getMaximumSegmentIndex=function(){return this.pts.length-1},e.prototype.getDepthDelta=function(){return this._depthDelta},e.prototype.getNumPoints=function(){return this.pts.length},e.prototype.printReverse=function(t){t.print("edge "+this._name+": ");for(var e=this.pts.length-1;e>=0;e--)t.print(this.pts[e]+" ");t.println("")},e.prototype.getMonotoneChainEdge=function(){return null===this._mce&&(this._mce=new Ql(this)),this._mce},e.prototype.getEnvelope=function(){if(null===this._env){this._env=new Yu;for(var t=0;t<this.pts.length;t++)this._env.expandToInclude(this.pts[t])}return this._env},e.prototype.addIntersection=function(t,e,n,r){var i=new bu(t.getIntersection(r)),o=e,s=t.getEdgeDistance(n,r),a=o+1;if(a<this.pts.length){var u=this.pts[a];i.equals2D(u)&&(o=a,s=0)}this.eiList.add(i,o,s)},e.prototype.toString=function(){var t=new Ru;t.append("edge "+this._name+": "),t.append("LINESTRING (");for(var e=0;e<this.pts.length;e++)e>0&&t.append(","),t.append(this.pts[e].x+" "+this.pts[e].y);return t.append(") "+this._label+" "+this._depthDelta),t.toString()},e.prototype.isPointwiseEqual=function(t){if(this.pts.length!==t.pts.length)return!1;for(var e=0;e<this.pts.length;e++)if(!this.pts[e].equals2D(t.pts[e]))return!1;return!0},e.prototype.setDepthDelta=function(t){this._depthDelta=t},e.prototype.getEdgeIntersectionList=function(){return this.eiList},e.prototype.addIntersections=function(t,e,n){for(var r=0;r<t.getIntersectionNum();r++)this.addIntersection(t,e,n,r)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.updateIM=function(){if(2!==arguments.length)return t.prototype.updateIM.apply(this,arguments);var e=arguments[0],n=arguments[1];n.setAtLeastIfValid(e.getLocation(0,Nh.ON),e.getLocation(1,Nh.ON),1),e.isArea()&&(n.setAtLeastIfValid(e.getLocation(0,Nh.LEFT),e.getLocation(1,Nh.LEFT),2),n.setAtLeastIfValid(e.getLocation(0,Nh.RIGHT),e.getLocation(1,Nh.RIGHT),2))},e}(Fh),np=function(t){this._workingPrecisionModel=null,this._workingNoder=null,this._geomFact=null,this._graph=null,this._edgeList=new Vl,this._bufParams=t||null};np.prototype.setWorkingPrecisionModel=function(t){this._workingPrecisionModel=t},np.prototype.insertUniqueEdge=function(t){var e=this._edgeList.findEqualEdge(t);if(null!==e){var n=e.getLabel(),r=t.getLabel();e.isPointwiseEqual(t)||(r=new Rh(t.getLabel())).flip(),n.merge(r);var i=np.depthDelta(r),o=e.getDepthDelta()+i;e.setDepthDelta(o)}else this._edgeList.add(t),t.setDepthDelta(np.depthDelta(t.getLabel()))},np.prototype.buildSubgraphs=function(t,e){for(var n=new bc,r=t.iterator();r.hasNext();){var i=r.next(),o=i.getRightmostCoordinate(),s=new Al(n).getDepth(o);i.computeDepth(s),i.findResultEdges(),n.add(i),e.add(i.getDirectedEdges(),i.getNodes())}},np.prototype.createSubgraphs=function(t){for(var e=new bc,n=t.getNodes().iterator();n.hasNext();){var r=n.next();if(!r.isVisited()){var i=new Ph;i.create(r),e.add(i)}}return $h.sort(e,$h.reverseOrder()),e},np.prototype.createEmptyResultGeometry=function(){return this._geomFact.createPolygon()},np.prototype.getNoder=function(t){if(null!==this._workingNoder)return this._workingNoder;var e=new El,n=new rc;return n.setPrecisionModel(t),e.setSegmentIntersector(new Wl(n)),e},np.prototype.buffer=function(t,e){var n=this._workingPrecisionModel;null===n&&(n=t.getPrecisionModel()),this._geomFact=t.getFactory();var r=new Tl(n,this._bufParams),i=new Gl(t,e,r).getCurves();if(i.size()<=0)return this.createEmptyResultGeometry();this.computeNodedEdges(i,n),this._graph=new Uh(new Ul),this._graph.addEdges(this._edgeList.getEdges());var o=this.createSubgraphs(this._graph),s=new Yh(this._geomFact);this.buildSubgraphs(o,s);var a=s.getPolygons();return a.size()<=0?this.createEmptyResultGeometry():this._geomFact.buildGeometry(a)},np.prototype.computeNodedEdges=function(t,e){var n=this.getNoder(e);n.computeNodes(t);for(var r=n.getNodedSubstrings().iterator();r.hasNext();){var i=r.next(),o=i.getCoordinates();if(2!==o.length||!o[0].equals2D(o[1])){var s=i.getData(),a=new ep(i.getCoordinates(),new Rh(s));this.insertUniqueEdge(a)}}},np.prototype.setNoder=function(t){this._workingNoder=t},np.prototype.interfaces_=function(){return[]},np.prototype.getClass=function(){return np},np.depthDelta=function(t){var e=t.getLocation(0,Nh.LEFT),n=t.getLocation(0,Nh.RIGHT);return e===Su.INTERIOR&&n===Su.EXTERIOR?1:e===Su.EXTERIOR&&n===Su.INTERIOR?-1:0},np.convertSegStrings=function(t){for(var e=new _h,n=new bc;t.hasNext();){var r=t.next(),i=e.createLineString(r.getCoordinates());n.add(i)}return e.buildGeometry(n)};var rp=function(){if(this._noder=null,this._scaleFactor=null,this._offsetX=null,this._offsetY=null,this._isScaled=!1,2===arguments.length){var t=arguments[0],e=arguments[1];this._noder=t,this._scaleFactor=e,this._offsetX=0,this._offsetY=0,this._isScaled=!this.isIntegerPrecision()}else if(4===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2],o=arguments[3];this._noder=n,this._scaleFactor=r,this._offsetX=i,this._offsetY=o,this._isScaled=!this.isIntegerPrecision()}};rp.prototype.rescale=function(){if(Lu(arguments[0],vc))for(var t=arguments[0].iterator();t.hasNext();){var e=t.next();this.rescale(e.getCoordinates())}else if(arguments[0]instanceof Array){for(var n=arguments[0],r=0;r<n.length;r++)n[r].x=n[r].x/this._scaleFactor+this._offsetX,n[r].y=n[r].y/this._scaleFactor+this._offsetY;2===n.length&&n[0].equals2D(n[1])&&Xu.out.println(n)}},rp.prototype.scale=function(){if(Lu(arguments[0],vc)){for(var t=arguments[0],e=new bc,n=t.iterator();n.hasNext();){var r=n.next();e.add(new fl(this.scale(r.getCoordinates()),r.getData()))}return e}if(arguments[0]instanceof Array){for(var i=arguments[0],o=new Array(i.length).fill(null),s=0;s<i.length;s++)o[s]=new bu(Math.round((i[s].x-this._offsetX)*this._scaleFactor),Math.round((i[s].y-this._offsetY)*this._scaleFactor),i[s].z);return Cc.removeRepeatedPoints(o)}},rp.prototype.isIntegerPrecision=function(){return 1===this._scaleFactor},rp.prototype.getNodedSubstrings=function(){var t=this._noder.getNodedSubstrings();return this._isScaled&&this.rescale(t),t},rp.prototype.computeNodes=function(t){var e=t;this._isScaled&&(e=this.scale(t)),this._noder.computeNodes(e)},rp.prototype.interfaces_=function(){return[vl]},rp.prototype.getClass=function(){return rp};var ip=function(){this._li=new rc,this._segStrings=null;var t=arguments[0];this._segStrings=t},op={fact:{configurable:!0}};ip.prototype.checkEndPtVertexIntersections=function(){if(0===arguments.length)for(var t=this._segStrings.iterator();t.hasNext();){var e=t.next().getCoordinates();this.checkEndPtVertexIntersections(e[0],this._segStrings),this.checkEndPtVertexIntersections(e[e.length-1],this._segStrings)}else if(2===arguments.length)for(var n=arguments[0],r=arguments[1].iterator();r.hasNext();)for(var i=r.next().getCoordinates(),o=1;o<i.length-1;o++)if(i[o].equals(n))throw new Qu("found endpt/interior pt intersection at index "+o+" :pt "+n)},ip.prototype.checkInteriorIntersections=function(){if(0===arguments.length)for(var t=this._segStrings.iterator();t.hasNext();)for(var e=t.next(),n=this._segStrings.iterator();n.hasNext();){var r=n.next();this.checkInteriorIntersections(e,r)}else if(2===arguments.length)for(var i=arguments[0],o=arguments[1],s=i.getCoordinates(),a=o.getCoordinates(),u=0;u<s.length-1;u++)for(var c=0;c<a.length-1;c++)this.checkInteriorIntersections(i,u,o,c);else if(4===arguments.length){var h=arguments[0],l=arguments[1],p=arguments[2],f=arguments[3];if(h===p&&l===f)return null;var g=h.getCoordinates()[l],d=h.getCoordinates()[l+1],y=p.getCoordinates()[f],_=p.getCoordinates()[f+1];if(this._li.computeIntersection(g,d,y,_),this._li.hasIntersection()&&(this._li.isProper()||this.hasInteriorIntersection(this._li,g,d)||this.hasInteriorIntersection(this._li,y,_)))throw new Qu("found non-noded intersection at "+g+"-"+d+" and "+y+"-"+_)}},ip.prototype.checkValid=function(){this.checkEndPtVertexIntersections(),this.checkInteriorIntersections(),this.checkCollapses()},ip.prototype.checkCollapses=function(){if(0===arguments.length)for(var t=this._segStrings.iterator();t.hasNext();){var e=t.next();this.checkCollapses(e)}else if(1===arguments.length)for(var n=arguments[0].getCoordinates(),r=0;r<n.length-2;r++)this.checkCollapse(n[r],n[r+1],n[r+2])},ip.prototype.hasInteriorIntersection=function(t,e,n){for(var r=0;r<t.getIntersectionNum();r++){var i=t.getIntersection(r);if(!i.equals(e)&&!i.equals(n))return!0}return!1},ip.prototype.checkCollapse=function(t,e,n){if(t.equals(n))throw new Qu("found non-noded collapse at "+ip.fact.createLineString([t,e,n]))},ip.prototype.interfaces_=function(){return[]},ip.prototype.getClass=function(){return ip},op.fact.get=function(){return new _h},Object.defineProperties(ip,op);var sp=function(){this._li=null,this._pt=null,this._originalPt=null,this._ptScaled=null,this._p0Scaled=null,this._p1Scaled=null,this._scaleFactor=null,this._minx=null,this._maxx=null,this._miny=null,this._maxy=null,this._corner=new Array(4).fill(null),this._safeEnv=null;var t=arguments[0],e=arguments[1],n=arguments[2];if(this._originalPt=t,this._pt=t,this._scaleFactor=e,this._li=n,e<=0)throw new _u("Scale factor must be non-zero");1!==e&&(this._pt=new bu(this.scale(t.x),this.scale(t.y)),this._p0Scaled=new bu,this._p1Scaled=new bu),this.initCorners(this._pt)},ap={SAFE_ENV_EXPANSION_FACTOR:{configurable:!0}};sp.prototype.intersectsScaled=function(t,e){var n=Math.min(t.x,e.x),r=Math.max(t.x,e.x),i=Math.min(t.y,e.y),o=Math.max(t.y,e.y),s=this._maxx<n||this._minx>r||this._maxy<i||this._miny>o;if(s)return!1;var a=this.intersectsToleranceSquare(t,e);return tc.isTrue(!(s&&a),"Found bad envelope test"),a},sp.prototype.initCorners=function(t){this._minx=t.x-.5,this._maxx=t.x+.5,this._miny=t.y-.5,this._maxy=t.y+.5,this._corner[0]=new bu(this._maxx,this._maxy),this._corner[1]=new bu(this._minx,this._maxy),this._corner[2]=new bu(this._minx,this._miny),this._corner[3]=new bu(this._maxx,this._miny)},sp.prototype.intersects=function(t,e){return 1===this._scaleFactor?this.intersectsScaled(t,e):(this.copyScaled(t,this._p0Scaled),this.copyScaled(e,this._p1Scaled),this.intersectsScaled(this._p0Scaled,this._p1Scaled))},sp.prototype.scale=function(t){return Math.round(t*this._scaleFactor)},sp.prototype.getCoordinate=function(){return this._originalPt},sp.prototype.copyScaled=function(t,e){e.x=this.scale(t.x),e.y=this.scale(t.y)},sp.prototype.getSafeEnvelope=function(){if(null===this._safeEnv){var t=sp.SAFE_ENV_EXPANSION_FACTOR/this._scaleFactor;this._safeEnv=new Yu(this._originalPt.x-t,this._originalPt.x+t,this._originalPt.y-t,this._originalPt.y+t)}return this._safeEnv},sp.prototype.intersectsPixelClosure=function(t,e){return this._li.computeIntersection(t,e,this._corner[0],this._corner[1]),!!this._li.hasIntersection()||(this._li.computeIntersection(t,e,this._corner[1],this._corner[2]),!!this._li.hasIntersection()||(this._li.computeIntersection(t,e,this._corner[2],this._corner[3]),!!this._li.hasIntersection()||(this._li.computeIntersection(t,e,this._corner[3],this._corner[0]),!!this._li.hasIntersection())))},sp.prototype.intersectsToleranceSquare=function(t,e){var n=!1,r=!1;return this._li.computeIntersection(t,e,this._corner[0],this._corner[1]),!!this._li.isProper()||(this._li.computeIntersection(t,e,this._corner[1],this._corner[2]),!!this._li.isProper()||(this._li.hasIntersection()&&(n=!0),this._li.computeIntersection(t,e,this._corner[2],this._corner[3]),!!this._li.isProper()||(this._li.hasIntersection()&&(r=!0),this._li.computeIntersection(t,e,this._corner[3],this._corner[0]),!!this._li.isProper()||!(!n||!r)||!!t.equals(this._pt)||!!e.equals(this._pt))))},sp.prototype.addSnappedNode=function(t,e){var n=t.getCoordinate(e),r=t.getCoordinate(e+1);return!!this.intersects(n,r)&&(t.addIntersection(this.getCoordinate(),e),!0)},sp.prototype.interfaces_=function(){return[]},sp.prototype.getClass=function(){return sp},ap.SAFE_ENV_EXPANSION_FACTOR.get=function(){return.75},Object.defineProperties(sp,ap);var up=function(){this.tempEnv1=new Yu,this.selectedSegment=new gl};up.prototype.select=function(){if(1===arguments.length);else if(2===arguments.length){var t=arguments[1];arguments[0].getLineSegment(t,this.selectedSegment),this.select(this.selectedSegment)}},up.prototype.interfaces_=function(){return[]},up.prototype.getClass=function(){return up};var cp=function(){this._index=null;var t=arguments[0];this._index=t},hp={HotPixelSnapAction:{configurable:!0}};cp.prototype.snap=function(){if(1===arguments.length){var t=arguments[0];return this.snap(t,null,-1)}if(3===arguments.length){var e=arguments[0],n=arguments[1],r=arguments[2],i=e.getSafeEnvelope(),o=new lp(e,n,r);return this._index.query(i,{interfaces_:function(){return[Jh]},visitItem:function(t){t.select(i,o)}}),o.isNodeAdded()}},cp.prototype.interfaces_=function(){return[]},cp.prototype.getClass=function(){return cp},hp.HotPixelSnapAction.get=function(){return lp},Object.defineProperties(cp,hp);var lp=function(t){function e(){t.call(this),this._hotPixel=null,this._parentEdge=null,this._hotPixelVertexIndex=null,this._isNodeAdded=!1;var e=arguments[0],n=arguments[1],r=arguments[2];this._hotPixel=e,this._parentEdge=n,this._hotPixelVertexIndex=r}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.isNodeAdded=function(){return this._isNodeAdded},e.prototype.select=function(){if(2!==arguments.length)return t.prototype.select.apply(this,arguments);var e=arguments[1],n=arguments[0].getContext();if(null!==this._parentEdge&&n===this._parentEdge&&e===this._hotPixelVertexIndex)return null;this._isNodeAdded=this._hotPixel.addSnappedNode(n,e)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(up),pp=function(){this._li=null,this._interiorIntersections=null;var t=arguments[0];this._li=t,this._interiorIntersections=new bc};pp.prototype.processIntersections=function(t,e,n,r){if(t===n&&e===r)return null;var i=t.getCoordinates()[e],o=t.getCoordinates()[e+1],s=n.getCoordinates()[r],a=n.getCoordinates()[r+1];if(this._li.computeIntersection(i,o,s,a),this._li.hasIntersection()&&this._li.isInteriorIntersection()){for(var u=0;u<this._li.getIntersectionNum();u++)this._interiorIntersections.add(this._li.getIntersection(u));t.addIntersections(this._li,e,0),n.addIntersections(this._li,r,1)}},pp.prototype.isDone=function(){return!1},pp.prototype.getInteriorIntersections=function(){return this._interiorIntersections},pp.prototype.interfaces_=function(){return[Hl]},pp.prototype.getClass=function(){return pp};var fp=function(){this._pm=null,this._li=null,this._scaleFactor=null,this._noder=null,this._pointSnapper=null,this._nodedSegStrings=null;var t=arguments[0];this._pm=t,this._li=new rc,this._li.setPrecisionModel(t),this._scaleFactor=t.getScale()};fp.prototype.checkCorrectness=function(t){var e=fl.getNodedSubstrings(t),n=new ip(e);try{n.checkValid()}catch(t){if(!(t instanceof zu))throw t;t.printStackTrace()}},fp.prototype.getNodedSubstrings=function(){return fl.getNodedSubstrings(this._nodedSegStrings)},fp.prototype.snapRound=function(t,e){var n=this.findInteriorIntersections(t,e);this.computeIntersectionSnaps(n),this.computeVertexSnaps(t)},fp.prototype.findInteriorIntersections=function(t,e){var n=new pp(e);return this._noder.setSegmentIntersector(n),this._noder.computeNodes(t),n.getInteriorIntersections()},fp.prototype.computeVertexSnaps=function(){if(Lu(arguments[0],vc))for(var t=arguments[0].iterator();t.hasNext();){var e=t.next();this.computeVertexSnaps(e)}else if(arguments[0]instanceof fl)for(var n=arguments[0],r=n.getCoordinates(),i=0;i<r.length;i++){var o=new sp(r[i],this._scaleFactor,this._li);this._pointSnapper.snap(o,n,i)&&n.addIntersection(r[i],i)}},fp.prototype.computeNodes=function(t){this._nodedSegStrings=t,this._noder=new El,this._pointSnapper=new cp(this._noder.getIndex()),this.snapRound(t,this._li)},fp.prototype.computeIntersectionSnaps=function(t){for(var e=t.iterator();e.hasNext();){var n=e.next(),r=new sp(n,this._scaleFactor,this._li);this._pointSnapper.snap(r)}},fp.prototype.interfaces_=function(){return[vl]},fp.prototype.getClass=function(){return fp};var gp=function(){if(this._argGeom=null,this._distance=null,this._bufParams=new bl,this._resultGeometry=null,this._saveException=null,1===arguments.length){var t=arguments[0];this._argGeom=t}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this._argGeom=e,this._bufParams=n}},dp={CAP_ROUND:{configurable:!0},CAP_BUTT:{configurable:!0},CAP_FLAT:{configurable:!0},CAP_SQUARE:{configurable:!0},MAX_PRECISION_DIGITS:{configurable:!0}};gp.prototype.bufferFixedPrecision=function(t){var e=new rp(new fp(new fh(1)),t.getScale()),n=new np(this._bufParams);n.setWorkingPrecisionModel(t),n.setNoder(e),this._resultGeometry=n.buffer(this._argGeom,this._distance)},gp.prototype.bufferReducedPrecision=function(){var t=this;if(0===arguments.length){for(var e=gp.MAX_PRECISION_DIGITS;e>=0;e--){try{t.bufferReducedPrecision(e)}catch(e){if(!(e instanceof Mh))throw e;t._saveException=e}if(null!==t._resultGeometry)return null}throw this._saveException}if(1===arguments.length){var n=arguments[0],r=gp.precisionScaleFactor(this._argGeom,this._distance,n),i=new fh(r);this.bufferFixedPrecision(i)}},gp.prototype.computeGeometry=function(){if(this.bufferOriginalPrecision(),null!==this._resultGeometry)return null;var t=this._argGeom.getFactory().getPrecisionModel();t.getType()===fh.FIXED?this.bufferFixedPrecision(t):this.bufferReducedPrecision()},gp.prototype.setQuadrantSegments=function(t){this._bufParams.setQuadrantSegments(t)},gp.prototype.bufferOriginalPrecision=function(){try{var t=new np(this._bufParams);this._resultGeometry=t.buffer(this._argGeom,this._distance)}catch(t){if(!(t instanceof Qu))throw t;this._saveException=t}},gp.prototype.getResultGeometry=function(t){return this._distance=t,this.computeGeometry(),this._resultGeometry},gp.prototype.setEndCapStyle=function(t){this._bufParams.setEndCapStyle(t)},gp.prototype.interfaces_=function(){return[]},gp.prototype.getClass=function(){return gp},gp.bufferOp=function(){if(2===arguments.length){var t=arguments[1];return new gp(arguments[0]).getResultGeometry(t)}if(3===arguments.length){if(Number.isInteger(arguments[2])&&arguments[0]instanceof cc&&"number"==typeof arguments[1]){var e=arguments[1],n=arguments[2],r=new gp(arguments[0]);return r.setQuadrantSegments(n),r.getResultGeometry(e)}if(arguments[2]instanceof bl&&arguments[0]instanceof cc&&"number"==typeof arguments[1]){var i=arguments[1];return new gp(arguments[0],arguments[2]).getResultGeometry(i)}}else if(4===arguments.length){var o=arguments[1],s=arguments[2],a=arguments[3],u=new gp(arguments[0]);return u.setQuadrantSegments(s),u.setEndCapStyle(a),u.getResultGeometry(o)}},gp.precisionScaleFactor=function(t,e,n){var r=t.getEnvelopeInternal(),i=Pu.max(Math.abs(r.getMaxX()),Math.abs(r.getMaxY()),Math.abs(r.getMinX()),Math.abs(r.getMinY()))+2*(e>0?e:0),o=n-Math.trunc(Math.log(i)/Math.log(10)+1);return Math.pow(10,o)},dp.CAP_ROUND.get=function(){return bl.CAP_ROUND},dp.CAP_BUTT.get=function(){return bl.CAP_FLAT},dp.CAP_FLAT.get=function(){return bl.CAP_FLAT},dp.CAP_SQUARE.get=function(){return bl.CAP_SQUARE},dp.MAX_PRECISION_DIGITS.get=function(){return 12},Object.defineProperties(gp,dp);var yp=function(){this._pt=[new bu,new bu],this._distance=mu.NaN,this._isNull=!0};yp.prototype.getCoordinates=function(){return this._pt},yp.prototype.getCoordinate=function(t){return this._pt[t]},yp.prototype.setMinimum=function(){if(1===arguments.length){var t=arguments[0];this.setMinimum(t._pt[0],t._pt[1])}else if(2===arguments.length){var e=arguments[0],n=arguments[1];if(this._isNull)return this.initialize(e,n),null;var r=e.distance(n);r<this._distance&&this.initialize(e,n,r)}},yp.prototype.initialize=function(){if(0===arguments.length)this._isNull=!0;else if(2===arguments.length){var t=arguments[0],e=arguments[1];this._pt[0].setCoordinate(t),this._pt[1].setCoordinate(e),this._distance=t.distance(e),this._isNull=!1}else if(3===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2];this._pt[0].setCoordinate(n),this._pt[1].setCoordinate(r),this._distance=i,this._isNull=!1}},yp.prototype.getDistance=function(){return this._distance},yp.prototype.setMaximum=function(){if(1===arguments.length){var t=arguments[0];this.setMaximum(t._pt[0],t._pt[1])}else if(2===arguments.length){var e=arguments[0],n=arguments[1];if(this._isNull)return this.initialize(e,n),null;var r=e.distance(n);r>this._distance&&this.initialize(e,n,r)}},yp.prototype.interfaces_=function(){return[]},yp.prototype.getClass=function(){return yp};var _p=function(){};_p.prototype.interfaces_=function(){return[]},_p.prototype.getClass=function(){return _p},_p.computeDistance=function(){if(arguments[2]instanceof yp&&arguments[0]instanceof Jc&&arguments[1]instanceof bu)for(var t=arguments[1],e=arguments[2],n=arguments[0].getCoordinates(),r=new gl,i=0;i<n.length-1;i++){r.setCoordinates(n[i],n[i+1]);var o=r.closestPoint(t);e.setMinimum(o,t)}else if(arguments[2]instanceof yp&&arguments[0]instanceof $c&&arguments[1]instanceof bu){var s=arguments[0],a=arguments[1],u=arguments[2];_p.computeDistance(s.getExteriorRing(),a,u);for(var c=0;c<s.getNumInteriorRing();c++)_p.computeDistance(s.getInteriorRingN(c),a,u)}else if(arguments[2]instanceof yp&&arguments[0]instanceof cc&&arguments[1]instanceof bu){var h=arguments[0],l=arguments[1],p=arguments[2];if(h instanceof Jc)_p.computeDistance(h,l,p);else if(h instanceof $c)_p.computeDistance(h,l,p);else if(h instanceof jc)for(var f=h,g=0;g<f.getNumGeometries();g++){var d=f.getGeometryN(g);_p.computeDistance(d,l,p)}else p.setMinimum(h.getCoordinate(),l)}else if(arguments[2]instanceof yp&&arguments[0]instanceof gl&&arguments[1]instanceof bu){var y=arguments[1],_=arguments[2],m=arguments[0].closestPoint(y);_.setMinimum(m,y)}};var mp=function(t){this._maxPtDist=new yp,this._inputGeom=t||null},vp={MaxPointDistanceFilter:{configurable:!0},MaxMidpointDistanceFilter:{configurable:!0}};mp.prototype.computeMaxMidpointDistance=function(t){var e=new Ep(this._inputGeom);t.apply(e),this._maxPtDist.setMaximum(e.getMaxPointDistance())},mp.prototype.computeMaxVertexDistance=function(t){var e=new xp(this._inputGeom);t.apply(e),this._maxPtDist.setMaximum(e.getMaxPointDistance())},mp.prototype.findDistance=function(t){return this.computeMaxVertexDistance(t),this.computeMaxMidpointDistance(t),this._maxPtDist.getDistance()},mp.prototype.getDistancePoints=function(){return this._maxPtDist},mp.prototype.interfaces_=function(){return[]},mp.prototype.getClass=function(){return mp},vp.MaxPointDistanceFilter.get=function(){return xp},vp.MaxMidpointDistanceFilter.get=function(){return Ep},Object.defineProperties(mp,vp);var xp=function(t){this._maxPtDist=new yp,this._minPtDist=new yp,this._geom=t||null};xp.prototype.filter=function(t){this._minPtDist.initialize(),_p.computeDistance(this._geom,t,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},xp.prototype.getMaxPointDistance=function(){return this._maxPtDist},xp.prototype.interfaces_=function(){return[pc]},xp.prototype.getClass=function(){return xp};var Ep=function(t){this._maxPtDist=new yp,this._minPtDist=new yp,this._geom=t||null};Ep.prototype.filter=function(t,e){if(0===e)return null;var n=t.getCoordinate(e-1),r=t.getCoordinate(e),i=new bu((n.x+r.x)/2,(n.y+r.y)/2);this._minPtDist.initialize(),_p.computeDistance(this._geom,i,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},Ep.prototype.isDone=function(){return!1},Ep.prototype.isGeometryChanged=function(){return!1},Ep.prototype.getMaxPointDistance=function(){return this._maxPtDist},Ep.prototype.interfaces_=function(){return[zc]},Ep.prototype.getClass=function(){return Ep};var wp=function(t){this._comps=t||null};wp.prototype.filter=function(t){t instanceof $c&&this._comps.add(t)},wp.prototype.interfaces_=function(){return[kc]},wp.prototype.getClass=function(){return wp},wp.getPolygons=function(){if(1===arguments.length){var t=arguments[0];return wp.getPolygons(t,new bc)}if(2===arguments.length){var e=arguments[0],n=arguments[1];return e instanceof $c?n.add(e):e instanceof jc&&e.apply(new wp(n)),n}};var bp=function(){if(this._lines=null,this._isForcedToLineString=!1,1===arguments.length){var t=arguments[0];this._lines=t}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this._lines=e,this._isForcedToLineString=n}};bp.prototype.filter=function(t){if(this._isForcedToLineString&&t instanceof eh){var e=t.getFactory().createLineString(t.getCoordinateSequence());return this._lines.add(e),null}t instanceof Jc&&this._lines.add(t)},bp.prototype.setForceToLineString=function(t){this._isForcedToLineString=t},bp.prototype.interfaces_=function(){return[uc]},bp.prototype.getClass=function(){return bp},bp.getGeometry=function(){if(1===arguments.length){var t=arguments[0];return t.getFactory().buildGeometry(bp.getLines(t))}if(2===arguments.length){var e=arguments[0],n=arguments[1];return e.getFactory().buildGeometry(bp.getLines(e,n))}},bp.getLines=function(){if(1===arguments.length){var t=arguments[0];return bp.getLines(t,!1)}if(2===arguments.length){if(Lu(arguments[0],vc)&&Lu(arguments[1],vc)){for(var e=arguments[1],n=arguments[0].iterator();n.hasNext();){var r=n.next();bp.getLines(r,e)}return e}if(arguments[0]instanceof cc&&"boolean"==typeof arguments[1]){var i=arguments[0],o=arguments[1],s=new bc;return i.apply(new bp(s,o)),s}if(arguments[0]instanceof cc&&Lu(arguments[1],vc)){var a=arguments[0],u=arguments[1];return a instanceof Jc?u.add(a):a.apply(new bp(u)),u}}else if(3===arguments.length){if("boolean"==typeof arguments[2]&&Lu(arguments[0],vc)&&Lu(arguments[1],vc)){for(var c=arguments[1],h=arguments[2],l=arguments[0].iterator();l.hasNext();){var p=l.next();bp.getLines(p,c,h)}return c}if("boolean"==typeof arguments[2]&&arguments[0]instanceof cc&&Lu(arguments[1],vc)){var f=arguments[1],g=arguments[2];return arguments[0].apply(new bp(f,g)),f}}};var Ip=function(){if(this._boundaryRule=fc.OGC_SFS_BOUNDARY_RULE,this._isIn=null,this._numBoundaries=null,0===arguments.length);else if(1===arguments.length){var t=arguments[0];if(null===t)throw new _u("Rule must be non-null");this._boundaryRule=t}};Ip.prototype.locateInternal=function(){if(arguments[0]instanceof bu&&arguments[1]instanceof $c){var t=arguments[0],e=arguments[1];if(e.isEmpty())return Su.EXTERIOR;var n=e.getExteriorRing(),r=this.locateInPolygonRing(t,n);if(r===Su.EXTERIOR)return Su.EXTERIOR;if(r===Su.BOUNDARY)return Su.BOUNDARY;for(var i=0;i<e.getNumInteriorRing();i++){var o=e.getInteriorRingN(i),s=this.locateInPolygonRing(t,o);if(s===Su.INTERIOR)return Su.EXTERIOR;if(s===Su.BOUNDARY)return Su.BOUNDARY}return Su.INTERIOR}if(arguments[0]instanceof bu&&arguments[1]instanceof Jc){var a=arguments[0],u=arguments[1];if(!u.getEnvelopeInternal().intersects(a))return Su.EXTERIOR;var c=u.getCoordinates();return u.isClosed()||!a.equals(c[0])&&!a.equals(c[c.length-1])?sc.isOnLine(a,c)?Su.INTERIOR:Su.EXTERIOR:Su.BOUNDARY}if(arguments[0]instanceof bu&&arguments[1]instanceof Kc){var h=arguments[0];return arguments[1].getCoordinate().equals2D(h)?Su.INTERIOR:Su.EXTERIOR}},Ip.prototype.locateInPolygonRing=function(t,e){return e.getEnvelopeInternal().intersects(t)?sc.locatePointInRing(t,e.getCoordinates()):Su.EXTERIOR},Ip.prototype.intersects=function(t,e){return this.locate(t,e)!==Su.EXTERIOR},Ip.prototype.updateLocationInfo=function(t){t===Su.INTERIOR&&(this._isIn=!0),t===Su.BOUNDARY&&this._numBoundaries++},Ip.prototype.computeLocation=function(t,e){if(e instanceof Kc&&this.updateLocationInfo(this.locateInternal(t,e)),e instanceof Jc)this.updateLocationInfo(this.locateInternal(t,e));else if(e instanceof $c)this.updateLocationInfo(this.locateInternal(t,e));else if(e instanceof Xc)for(var n=e,r=0;r<n.getNumGeometries();r++){var i=n.getGeometryN(r);this.updateLocationInfo(this.locateInternal(t,i))}else if(e instanceof nh)for(var o=e,s=0;s<o.getNumGeometries();s++){var a=o.getGeometryN(s);this.updateLocationInfo(this.locateInternal(t,a))}else if(e instanceof jc)for(var u=new kl(e);u.hasNext();){var c=u.next();c!==e&&this.computeLocation(t,c)}},Ip.prototype.locate=function(t,e){return e.isEmpty()?Su.EXTERIOR:e instanceof Jc||e instanceof $c?this.locateInternal(t,e):(this._isIn=!1,this._numBoundaries=0,this.computeLocation(t,e),this._boundaryRule.isInBoundary(this._numBoundaries)?Su.BOUNDARY:this._numBoundaries>0||this._isIn?Su.INTERIOR:Su.EXTERIOR)},Ip.prototype.interfaces_=function(){return[]},Ip.prototype.getClass=function(){return Ip};var Np=function t(){if(this._component=null,this._segIndex=null,this._pt=null,2===arguments.length)t.call(this,arguments[0],t.INSIDE_AREA,arguments[1]);else if(3===arguments.length){var e=arguments[0],n=arguments[1],r=arguments[2];this._component=e,this._segIndex=n,this._pt=r}},Cp={INSIDE_AREA:{configurable:!0}};Np.prototype.isInsideArea=function(){return this._segIndex===Np.INSIDE_AREA},Np.prototype.getCoordinate=function(){return this._pt},Np.prototype.getGeometryComponent=function(){return this._component},Np.prototype.getSegmentIndex=function(){return this._segIndex},Np.prototype.interfaces_=function(){return[]},Np.prototype.getClass=function(){return Np},Cp.INSIDE_AREA.get=function(){return-1},Object.defineProperties(Np,Cp);var Sp=function(t){this._pts=t||null};Sp.prototype.filter=function(t){t instanceof Kc&&this._pts.add(t)},Sp.prototype.interfaces_=function(){return[kc]},Sp.prototype.getClass=function(){return Sp},Sp.getPoints=function(){if(1===arguments.length){var t=arguments[0];return t instanceof Kc?$h.singletonList(t):Sp.getPoints(t,new bc)}if(2===arguments.length){var e=arguments[0],n=arguments[1];return e instanceof Kc?n.add(e):e instanceof jc&&e.apply(new Sp(n)),n}};var Mp=function(){this._locations=null;var t=arguments[0];this._locations=t};Mp.prototype.filter=function(t){(t instanceof Kc||t instanceof Jc||t instanceof $c)&&this._locations.add(new Np(t,0,t.getCoordinate()))},Mp.prototype.interfaces_=function(){return[kc]},Mp.prototype.getClass=function(){return Mp},Mp.getLocations=function(t){var e=new bc;return t.apply(new Mp(e)),e};var Lp=function(){if(this._geom=null,this._terminateDistance=0,this._ptLocator=new Ip,this._minDistanceLocation=null,this._minDistance=mu.MAX_VALUE,2===arguments.length){var t=arguments[0],e=arguments[1];this._geom=[t,e],this._terminateDistance=0}else if(3===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2];this._geom=new Array(2).fill(null),this._geom[0]=n,this._geom[1]=r,this._terminateDistance=i}};Lp.prototype.computeContainmentDistance=function(){if(0===arguments.length){var t=new Array(2).fill(null);if(this.computeContainmentDistance(0,t),this._minDistance<=this._terminateDistance)return null;this.computeContainmentDistance(1,t)}else if(2===arguments.length){var e=arguments[0],n=arguments[1],r=1-e,i=wp.getPolygons(this._geom[e]);if(i.size()>0){var o=Mp.getLocations(this._geom[r]);if(this.computeContainmentDistance(o,i,n),this._minDistance<=this._terminateDistance)return this._minDistanceLocation[r]=n[0],this._minDistanceLocation[e]=n[1],null}}else if(3===arguments.length)if(arguments[2]instanceof Array&&Lu(arguments[0],wc)&&Lu(arguments[1],wc)){for(var s=arguments[0],a=arguments[1],u=arguments[2],c=0;c<s.size();c++)for(var h=s.get(c),l=0;l<a.size();l++)if(this.computeContainmentDistance(h,a.get(l),u),this._minDistance<=this._terminateDistance)return null}else if(arguments[2]instanceof Array&&arguments[0]instanceof Np&&arguments[1]instanceof $c){var p=arguments[0],f=arguments[1],g=arguments[2],d=p.getCoordinate();if(Su.EXTERIOR!==this._ptLocator.locate(d,f))return this._minDistance=0,g[0]=p,g[1]=new Np(f,d),null}},Lp.prototype.computeMinDistanceLinesPoints=function(t,e,n){for(var r=0;r<t.size();r++)for(var i=t.get(r),o=0;o<e.size();o++){var s=e.get(o);if(this.computeMinDistance(i,s,n),this._minDistance<=this._terminateDistance)return null}},Lp.prototype.computeFacetDistance=function(){var t=new Array(2).fill(null),e=bp.getLines(this._geom[0]),n=bp.getLines(this._geom[1]),r=Sp.getPoints(this._geom[0]),i=Sp.getPoints(this._geom[1]);return this.computeMinDistanceLines(e,n,t),this.updateMinDistance(t,!1),this._minDistance<=this._terminateDistance?null:(t[0]=null,t[1]=null,this.computeMinDistanceLinesPoints(e,i,t),this.updateMinDistance(t,!1),this._minDistance<=this._terminateDistance?null:(t[0]=null,t[1]=null,this.computeMinDistanceLinesPoints(n,r,t),this.updateMinDistance(t,!0),this._minDistance<=this._terminateDistance?null:(t[0]=null,t[1]=null,this.computeMinDistancePoints(r,i,t),void this.updateMinDistance(t,!1))))},Lp.prototype.nearestLocations=function(){return this.computeMinDistance(),this._minDistanceLocation},Lp.prototype.updateMinDistance=function(t,e){if(null===t[0])return null;e?(this._minDistanceLocation[0]=t[1],this._minDistanceLocation[1]=t[0]):(this._minDistanceLocation[0]=t[0],this._minDistanceLocation[1]=t[1])},Lp.prototype.nearestPoints=function(){return this.computeMinDistance(),[this._minDistanceLocation[0].getCoordinate(),this._minDistanceLocation[1].getCoordinate()]},Lp.prototype.computeMinDistance=function(){if(0===arguments.length){if(null!==this._minDistanceLocation)return null;if(this._minDistanceLocation=new Array(2).fill(null),this.computeContainmentDistance(),this._minDistance<=this._terminateDistance)return null;this.computeFacetDistance()}else if(3===arguments.length)if(arguments[2]instanceof Array&&arguments[0]instanceof Jc&&arguments[1]instanceof Kc){var t=arguments[0],e=arguments[1],n=arguments[2];if(t.getEnvelopeInternal().distance(e.getEnvelopeInternal())>this._minDistance)return null;for(var r=t.getCoordinates(),i=e.getCoordinate(),o=0;o<r.length-1;o++){var s=sc.distancePointLine(i,r[o],r[o+1]);if(s<this._minDistance){this._minDistance=s;var a=new gl(r[o],r[o+1]).closestPoint(i);n[0]=new Np(t,o,a),n[1]=new Np(e,0,i)}if(this._minDistance<=this._terminateDistance)return null}}else if(arguments[2]instanceof Array&&arguments[0]instanceof Jc&&arguments[1]instanceof Jc){var u=arguments[0],c=arguments[1],h=arguments[2];if(u.getEnvelopeInternal().distance(c.getEnvelopeInternal())>this._minDistance)return null;for(var l=u.getCoordinates(),p=c.getCoordinates(),f=0;f<l.length-1;f++)for(var g=0;g<p.length-1;g++){var d=sc.distanceLineLine(l[f],l[f+1],p[g],p[g+1]);if(d<this._minDistance){this._minDistance=d;var y=new gl(l[f],l[f+1]),_=new gl(p[g],p[g+1]),m=y.closestPoints(_);h[0]=new Np(u,f,m[0]),h[1]=new Np(c,g,m[1])}if(this._minDistance<=this._terminateDistance)return null}}},Lp.prototype.computeMinDistancePoints=function(t,e,n){for(var r=0;r<t.size();r++)for(var i=t.get(r),o=0;o<e.size();o++){var s=e.get(o),a=i.getCoordinate().distance(s.getCoordinate());if(a<this._minDistance&&(this._minDistance=a,n[0]=new Np(i,0,i.getCoordinate()),n[1]=new Np(s,0,s.getCoordinate())),this._minDistance<=this._terminateDistance)return null}},Lp.prototype.distance=function(){if(null===this._geom[0]||null===this._geom[1])throw new _u("null geometries are not supported");return this._geom[0].isEmpty()||this._geom[1].isEmpty()?0:(this.computeMinDistance(),this._minDistance)},Lp.prototype.computeMinDistanceLines=function(t,e,n){for(var r=0;r<t.size();r++)for(var i=t.get(r),o=0;o<e.size();o++){var s=e.get(o);if(this.computeMinDistance(i,s,n),this._minDistance<=this._terminateDistance)return null}},Lp.prototype.interfaces_=function(){return[]},Lp.prototype.getClass=function(){return Lp},Lp.distance=function(t,e){return new Lp(t,e).distance()},Lp.isWithinDistance=function(t,e,n){return new Lp(t,e,n).distance()<=n},Lp.nearestPoints=function(t,e){return new Lp(t,e).nearestPoints()};var Pp=function(){this._pt=[new bu,new bu],this._distance=mu.NaN,this._isNull=!0};Pp.prototype.getCoordinates=function(){return this._pt},Pp.prototype.getCoordinate=function(t){return this._pt[t]},Pp.prototype.setMinimum=function(){if(1===arguments.length){var t=arguments[0];this.setMinimum(t._pt[0],t._pt[1])}else if(2===arguments.length){var e=arguments[0],n=arguments[1];if(this._isNull)return this.initialize(e,n),null;var r=e.distance(n);r<this._distance&&this.initialize(e,n,r)}},Pp.prototype.initialize=function(){if(0===arguments.length)this._isNull=!0;else if(2===arguments.length){var t=arguments[0],e=arguments[1];this._pt[0].setCoordinate(t),this._pt[1].setCoordinate(e),this._distance=t.distance(e),this._isNull=!1}else if(3===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2];this._pt[0].setCoordinate(n),this._pt[1].setCoordinate(r),this._distance=i,this._isNull=!1}},Pp.prototype.toString=function(){return Ku.toLineString(this._pt[0],this._pt[1])},Pp.prototype.getDistance=function(){return this._distance},Pp.prototype.setMaximum=function(){if(1===arguments.length){var t=arguments[0];this.setMaximum(t._pt[0],t._pt[1])}else if(2===arguments.length){var e=arguments[0],n=arguments[1];if(this._isNull)return this.initialize(e,n),null;var r=e.distance(n);r>this._distance&&this.initialize(e,n,r)}},Pp.prototype.interfaces_=function(){return[]},Pp.prototype.getClass=function(){return Pp};var Op=function(){};Op.prototype.interfaces_=function(){return[]},Op.prototype.getClass=function(){return Op},Op.computeDistance=function(){if(arguments[2]instanceof Pp&&arguments[0]instanceof Jc&&arguments[1]instanceof bu)for(var t=arguments[0],e=arguments[1],n=arguments[2],r=new gl,i=t.getCoordinates(),o=0;o<i.length-1;o++){r.setCoordinates(i[o],i[o+1]);var s=r.closestPoint(e);n.setMinimum(s,e)}else if(arguments[2]instanceof Pp&&arguments[0]instanceof $c&&arguments[1]instanceof bu){var a=arguments[0],u=arguments[1],c=arguments[2];Op.computeDistance(a.getExteriorRing(),u,c);for(var h=0;h<a.getNumInteriorRing();h++)Op.computeDistance(a.getInteriorRingN(h),u,c)}else if(arguments[2]instanceof Pp&&arguments[0]instanceof cc&&arguments[1]instanceof bu){var l=arguments[0],p=arguments[1],f=arguments[2];if(l instanceof Jc)Op.computeDistance(l,p,f);else if(l instanceof $c)Op.computeDistance(l,p,f);else if(l instanceof jc)for(var g=l,d=0;d<g.getNumGeometries();d++){var y=g.getGeometryN(d);Op.computeDistance(y,p,f)}else f.setMinimum(l.getCoordinate(),p)}else if(arguments[2]instanceof Pp&&arguments[0]instanceof gl&&arguments[1]instanceof bu){var _=arguments[1],m=arguments[2],v=arguments[0].closestPoint(_);m.setMinimum(v,_)}};var Rp=function(){this._g0=null,this._g1=null,this._ptDist=new Pp,this._densifyFrac=0;var t=arguments[0],e=arguments[1];this._g0=t,this._g1=e},Tp={MaxPointDistanceFilter:{configurable:!0},MaxDensifiedByFractionDistanceFilter:{configurable:!0}};Rp.prototype.getCoordinates=function(){return this._ptDist.getCoordinates()},Rp.prototype.setDensifyFraction=function(t){if(t>1||t<=0)throw new _u("Fraction is not in range (0.0 - 1.0]");this._densifyFrac=t},Rp.prototype.compute=function(t,e){this.computeOrientedDistance(t,e,this._ptDist),this.computeOrientedDistance(e,t,this._ptDist)},Rp.prototype.distance=function(){return this.compute(this._g0,this._g1),this._ptDist.getDistance()},Rp.prototype.computeOrientedDistance=function(t,e,n){var r=new Ap(e);if(t.apply(r),n.setMaximum(r.getMaxPointDistance()),this._densifyFrac>0){var i=new Dp(e,this._densifyFrac);t.apply(i),n.setMaximum(i.getMaxPointDistance())}},Rp.prototype.orientedDistance=function(){return this.computeOrientedDistance(this._g0,this._g1,this._ptDist),this._ptDist.getDistance()},Rp.prototype.interfaces_=function(){return[]},Rp.prototype.getClass=function(){return Rp},Rp.distance=function(){if(2===arguments.length)return new Rp(arguments[0],arguments[1]).distance();if(3===arguments.length){var t=arguments[2],e=new Rp(arguments[0],arguments[1]);return e.setDensifyFraction(t),e.distance()}},Tp.MaxPointDistanceFilter.get=function(){return Ap},Tp.MaxDensifiedByFractionDistanceFilter.get=function(){return Dp},Object.defineProperties(Rp,Tp);var Ap=function(){this._maxPtDist=new Pp,this._minPtDist=new Pp,this._euclideanDist=new Op,this._geom=null;var t=arguments[0];this._geom=t};Ap.prototype.filter=function(t){this._minPtDist.initialize(),Op.computeDistance(this._geom,t,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},Ap.prototype.getMaxPointDistance=function(){return this._maxPtDist},Ap.prototype.interfaces_=function(){return[pc]},Ap.prototype.getClass=function(){return Ap};var Dp=function(){this._maxPtDist=new Pp,this._minPtDist=new Pp,this._geom=null,this._numSubSegs=0;var t=arguments[0],e=arguments[1];this._geom=t,this._numSubSegs=Math.trunc(Math.round(1/e))};Dp.prototype.filter=function(t,e){if(0===e)return null;for(var n=t.getCoordinate(e-1),r=t.getCoordinate(e),i=(r.x-n.x)/this._numSubSegs,o=(r.y-n.y)/this._numSubSegs,s=0;s<this._numSubSegs;s++){var a=n.x+s*i,u=n.y+s*o,c=new bu(a,u);this._minPtDist.initialize(),Op.computeDistance(this._geom,c,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)}},Dp.prototype.isDone=function(){return!1},Dp.prototype.isGeometryChanged=function(){return!1},Dp.prototype.getMaxPointDistance=function(){return this._maxPtDist},Dp.prototype.interfaces_=function(){return[zc]},Dp.prototype.getClass=function(){return Dp};var Fp=function(t,e,n){this._minValidDistance=null,this._maxValidDistance=null,this._minDistanceFound=null,this._maxDistanceFound=null,this._isValid=!0,this._errMsg=null,this._errorLocation=null,this._errorIndicator=null,this._input=t||null,this._bufDistance=e||null,this._result=n||null},qp={VERBOSE:{configurable:!0},MAX_DISTANCE_DIFF_FRAC:{configurable:!0}};Fp.prototype.checkMaximumDistance=function(t,e,n){var r=new Rp(e,t);if(r.setDensifyFraction(.25),this._maxDistanceFound=r.orientedDistance(),this._maxDistanceFound>n){this._isValid=!1;var i=r.getCoordinates();this._errorLocation=i[1],this._errorIndicator=t.getFactory().createLineString(i),this._errMsg="Distance between buffer curve and input is too large ("+this._maxDistanceFound+" at "+Ku.toLineString(i[0],i[1])+")"}},Fp.prototype.isValid=function(){var t=Math.abs(this._bufDistance),e=Fp.MAX_DISTANCE_DIFF_FRAC*t;return this._minValidDistance=t-e,this._maxValidDistance=t+e,!(!this._input.isEmpty()&&!this._result.isEmpty())||(this._bufDistance>0?this.checkPositiveValid():this.checkNegativeValid(),Fp.VERBOSE&&Xu.out.println("Min Dist= "+this._minDistanceFound+" err= "+(1-this._minDistanceFound/this._bufDistance)+" Max Dist= "+this._maxDistanceFound+" err= "+(this._maxDistanceFound/this._bufDistance-1)),this._isValid)},Fp.prototype.checkNegativeValid=function(){if(!(this._input instanceof $c||this._input instanceof nh||this._input instanceof jc))return null;var t=this.getPolygonLines(this._input);if(this.checkMinimumDistance(t,this._result,this._minValidDistance),!this._isValid)return null;this.checkMaximumDistance(t,this._result,this._maxValidDistance)},Fp.prototype.getErrorIndicator=function(){return this._errorIndicator},Fp.prototype.checkMinimumDistance=function(t,e,n){var r=new Lp(t,e,n);if(this._minDistanceFound=r.distance(),this._minDistanceFound<n){this._isValid=!1;var i=r.nearestPoints();this._errorLocation=r.nearestPoints()[1],this._errorIndicator=t.getFactory().createLineString(i),this._errMsg="Distance between buffer curve and input is too small ("+this._minDistanceFound+" at "+Ku.toLineString(i[0],i[1])+" )"}},Fp.prototype.checkPositiveValid=function(){var t=this._result.getBoundary();if(this.checkMinimumDistance(this._input,t,this._minValidDistance),!this._isValid)return null;this.checkMaximumDistance(this._input,t,this._maxValidDistance)},Fp.prototype.getErrorLocation=function(){return this._errorLocation},Fp.prototype.getPolygonLines=function(t){for(var e=new bc,n=new bp(e),r=wp.getPolygons(t).iterator();r.hasNext();)r.next().apply(n);return t.getFactory().buildGeometry(e)},Fp.prototype.getErrorMessage=function(){return this._errMsg},Fp.prototype.interfaces_=function(){return[]},Fp.prototype.getClass=function(){return Fp},qp.VERBOSE.get=function(){return!1},qp.MAX_DISTANCE_DIFF_FRAC.get=function(){return.012},Object.defineProperties(Fp,qp);var Gp=function(t,e,n){this._isValid=!0,this._errorMsg=null,this._errorLocation=null,this._errorIndicator=null,this._input=t||null,this._distance=e||null,this._result=n||null},Bp={VERBOSE:{configurable:!0},MAX_ENV_DIFF_FRAC:{configurable:!0}};Gp.prototype.isValid=function(){return this.checkPolygonal(),this._isValid?(this.checkExpectedEmpty(),this._isValid?(this.checkEnvelope(),this._isValid?(this.checkArea(),this._isValid?(this.checkDistance(),this._isValid):this._isValid):this._isValid):this._isValid):this._isValid},Gp.prototype.checkEnvelope=function(){if(this._distance<0)return null;var t=this._distance*Gp.MAX_ENV_DIFF_FRAC;0===t&&(t=.001);var e=new Yu(this._input.getEnvelopeInternal());e.expandBy(this._distance);var n=new Yu(this._result.getEnvelopeInternal());n.expandBy(t),n.contains(e)||(this._isValid=!1,this._errorMsg="Buffer envelope is incorrect",this._errorIndicator=this._input.getFactory().toGeometry(n)),this.report("Envelope")},Gp.prototype.checkDistance=function(){var t=new Fp(this._input,this._distance,this._result);t.isValid()||(this._isValid=!1,this._errorMsg=t.getErrorMessage(),this._errorLocation=t.getErrorLocation(),this._errorIndicator=t.getErrorIndicator()),this.report("Distance")},Gp.prototype.checkArea=function(){var t=this._input.getArea(),e=this._result.getArea();this._distance>0&&t>e&&(this._isValid=!1,this._errorMsg="Area of positive buffer is smaller than input",this._errorIndicator=this._result),this._distance<0&&t<e&&(this._isValid=!1,this._errorMsg="Area of negative buffer is larger than input",this._errorIndicator=this._result),this.report("Area")},Gp.prototype.checkPolygonal=function(){this._result instanceof $c||this._result instanceof nh||(this._isValid=!1),this._errorMsg="Result is not polygonal",this._errorIndicator=this._result,this.report("Polygonal")},Gp.prototype.getErrorIndicator=function(){return this._errorIndicator},Gp.prototype.getErrorLocation=function(){return this._errorLocation},Gp.prototype.checkExpectedEmpty=function(){return this._input.getDimension()>=2||this._distance>0?null:(this._result.isEmpty()||(this._isValid=!1,this._errorMsg="Result is non-empty",this._errorIndicator=this._result),void this.report("ExpectedEmpty"))},Gp.prototype.report=function(t){if(!Gp.VERBOSE)return null;Xu.out.println("Check "+t+": "+(this._isValid?"passed":"FAILED"))},Gp.prototype.getErrorMessage=function(){return this._errorMsg},Gp.prototype.interfaces_=function(){return[]},Gp.prototype.getClass=function(){return Gp},Gp.isValidMsg=function(t,e,n){var r=new Gp(t,e,n);return r.isValid()?null:r.getErrorMessage()},Gp.isValid=function(t,e,n){return!!new Gp(t,e,n).isValid()},Bp.VERBOSE.get=function(){return!1},Bp.MAX_ENV_DIFF_FRAC.get=function(){return.012},Object.defineProperties(Gp,Bp);var kp=function(){this._pts=null,this._data=null;var t=arguments[0],e=arguments[1];this._pts=t,this._data=e};kp.prototype.getCoordinates=function(){return this._pts},kp.prototype.size=function(){return this._pts.length},kp.prototype.getCoordinate=function(t){return this._pts[t]},kp.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},kp.prototype.getSegmentOctant=function(t){return t===this._pts.length-1?-1:hl.octant(this.getCoordinate(t),this.getCoordinate(t+1))},kp.prototype.setData=function(t){this._data=t},kp.prototype.getData=function(){return this._data},kp.prototype.toString=function(){return Ku.toLineString(new uh(this._pts))},kp.prototype.interfaces_=function(){return[ll]},kp.prototype.getClass=function(){return kp};var zp=function(){this._findAllIntersections=!1,this._isCheckEndSegmentsOnly=!1,this._li=null,this._interiorIntersection=null,this._intSegments=null,this._intersections=new bc,this._intersectionCount=0,this._keepIntersections=!0;var t=arguments[0];this._li=t,this._interiorIntersection=null};zp.prototype.getInteriorIntersection=function(){return this._interiorIntersection},zp.prototype.setCheckEndSegmentsOnly=function(t){this._isCheckEndSegmentsOnly=t},zp.prototype.getIntersectionSegments=function(){return this._intSegments},zp.prototype.count=function(){return this._intersectionCount},zp.prototype.getIntersections=function(){return this._intersections},zp.prototype.setFindAllIntersections=function(t){this._findAllIntersections=t},zp.prototype.setKeepIntersections=function(t){this._keepIntersections=t},zp.prototype.processIntersections=function(t,e,n,r){if(!this._findAllIntersections&&this.hasIntersection())return null;if(t===n&&e===r)return null;if(this._isCheckEndSegmentsOnly&&!this.isEndSegment(t,e)&&!this.isEndSegment(n,r))return null;var i=t.getCoordinates()[e],o=t.getCoordinates()[e+1],s=n.getCoordinates()[r],a=n.getCoordinates()[r+1];this._li.computeIntersection(i,o,s,a),this._li.hasIntersection()&&this._li.isInteriorIntersection()&&(this._intSegments=new Array(4).fill(null),this._intSegments[0]=i,this._intSegments[1]=o,this._intSegments[2]=s,this._intSegments[3]=a,this._interiorIntersection=this._li.getIntersection(0),this._keepIntersections&&this._intersections.add(this._interiorIntersection),this._intersectionCount++)},zp.prototype.isEndSegment=function(t,e){return 0===e||e>=t.size()-2},zp.prototype.hasIntersection=function(){return null!==this._interiorIntersection},zp.prototype.isDone=function(){return!this._findAllIntersections&&null!==this._interiorIntersection},zp.prototype.interfaces_=function(){return[Hl]},zp.prototype.getClass=function(){return zp},zp.createAllIntersectionsFinder=function(t){var e=new zp(t);return e.setFindAllIntersections(!0),e},zp.createAnyIntersectionFinder=function(t){return new zp(t)},zp.createIntersectionCounter=function(t){var e=new zp(t);return e.setFindAllIntersections(!0),e.setKeepIntersections(!1),e};var jp=function(){this._li=new rc,this._segStrings=null,this._findAllIntersections=!1,this._segInt=null,this._isValid=!0;var t=arguments[0];this._segStrings=t};jp.prototype.execute=function(){if(null!==this._segInt)return null;this.checkInteriorIntersections()},jp.prototype.getIntersections=function(){return this._segInt.getIntersections()},jp.prototype.isValid=function(){return this.execute(),this._isValid},jp.prototype.setFindAllIntersections=function(t){this._findAllIntersections=t},jp.prototype.checkInteriorIntersections=function(){this._isValid=!0,this._segInt=new zp(this._li),this._segInt.setFindAllIntersections(this._findAllIntersections);var t=new El;if(t.setSegmentIntersector(this._segInt),t.computeNodes(this._segStrings),this._segInt.hasIntersection())return this._isValid=!1,null},jp.prototype.checkValid=function(){if(this.execute(),!this._isValid)throw new Mh(this.getErrorMessage(),this._segInt.getInteriorIntersection())},jp.prototype.getErrorMessage=function(){if(this._isValid)return"no intersections found";var t=this._segInt.getIntersectionSegments();return"found non-noded intersection between "+Ku.toLineString(t[0],t[1])+" and "+Ku.toLineString(t[2],t[3])},jp.prototype.interfaces_=function(){return[]},jp.prototype.getClass=function(){return jp},jp.computeIntersections=function(t){var e=new jp(t);return e.setFindAllIntersections(!0),e.isValid(),e.getIntersections()};var Xp=function t(){this._nv=null;var e=arguments[0];this._nv=new jp(t.toSegmentStrings(e))};Xp.prototype.checkValid=function(){this._nv.checkValid()},Xp.prototype.interfaces_=function(){return[]},Xp.prototype.getClass=function(){return Xp},Xp.toSegmentStrings=function(t){for(var e=new bc,n=t.iterator();n.hasNext();){var r=n.next();e.add(new kp(r.getCoordinates(),r))}return e},Xp.checkValid=function(t){new Xp(t).checkValid()};var Up=function(t){this._mapOp=t};Up.prototype.map=function(t){for(var e=new bc,n=0;n<t.getNumGeometries();n++){var r=this._mapOp.map(t.getGeometryN(n));r.isEmpty()||e.add(r)}return t.getFactory().createGeometryCollection(_h.toGeometryArray(e))},Up.prototype.interfaces_=function(){return[]},Up.prototype.getClass=function(){return Up},Up.map=function(t,e){return new Up(e).map(t)};var Yp=function(){this._op=null,this._geometryFactory=null,this._ptLocator=null,this._lineEdgesList=new bc,this._resultLineList=new bc;var t=arguments[0],e=arguments[1],n=arguments[2];this._op=t,this._geometryFactory=e,this._ptLocator=n};Yp.prototype.collectLines=function(t){for(var e=this._op.getGraph().getEdgeEnds().iterator();e.hasNext();){var n=e.next();this.collectLineEdge(n,t,this._lineEdgesList),this.collectBoundaryTouchEdge(n,t,this._lineEdgesList)}},Yp.prototype.labelIsolatedLine=function(t,e){var n=this._ptLocator.locate(t.getCoordinate(),this._op.getArgGeometry(e));t.getLabel().setLocation(e,n)},Yp.prototype.build=function(t){return this.findCoveredLineEdges(),this.collectLines(t),this.buildLines(t),this._resultLineList},Yp.prototype.collectLineEdge=function(t,e,n){var r=t.getLabel(),i=t.getEdge();t.isLineEdge()&&(t.isVisited()||!Cf.isResultOfOp(r,e)||i.isCovered()||(n.add(i),t.setVisitedEdge(!0)))},Yp.prototype.findCoveredLineEdges=function(){for(var t=this._op.getGraph().getNodes().iterator();t.hasNext();)t.next().getEdges().findCoveredLineEdges();for(var e=this._op.getGraph().getEdgeEnds().iterator();e.hasNext();){var n=e.next(),r=n.getEdge();if(n.isLineEdge()&&!r.isCoveredSet()){var i=this._op.isCoveredByA(n.getCoordinate());r.setCovered(i)}}},Yp.prototype.labelIsolatedLines=function(t){for(var e=t.iterator();e.hasNext();){var n=e.next(),r=n.getLabel();n.isIsolated()&&(r.isNull(0)?this.labelIsolatedLine(n,0):this.labelIsolatedLine(n,1))}},Yp.prototype.buildLines=function(t){for(var e=this._lineEdgesList.iterator();e.hasNext();){var n=e.next(),r=this._geometryFactory.createLineString(n.getCoordinates());this._resultLineList.add(r),n.setInResult(!0)}},Yp.prototype.collectBoundaryTouchEdge=function(t,e,n){var r=t.getLabel();return t.isLineEdge()||t.isVisited()||t.isInteriorAreaEdge()||t.getEdge().isInResult()?null:(tc.isTrue(!(t.isInResult()||t.getSym().isInResult())||!t.getEdge().isInResult()),void(Cf.isResultOfOp(r,e)&&e===Cf.INTERSECTION&&(n.add(t.getEdge()),t.setVisitedEdge(!0))))},Yp.prototype.interfaces_=function(){return[]},Yp.prototype.getClass=function(){return Yp};var Vp=function(){this._op=null,this._geometryFactory=null,this._resultPointList=new bc;var t=arguments[0],e=arguments[1];this._op=t,this._geometryFactory=e};Vp.prototype.filterCoveredNodeToPoint=function(t){var e=t.getCoordinate();if(!this._op.isCoveredByLA(e)){var n=this._geometryFactory.createPoint(e);this._resultPointList.add(n)}},Vp.prototype.extractNonCoveredResultNodes=function(t){for(var e=this._op.getGraph().getNodes().iterator();e.hasNext();){var n=e.next();if(!n.isInResult()&&!n.isIncidentEdgeInResult()&&(0===n.getEdges().getDegree()||t===Cf.INTERSECTION)){var r=n.getLabel();Cf.isResultOfOp(r,t)&&this.filterCoveredNodeToPoint(n)}}},Vp.prototype.build=function(t){return this.extractNonCoveredResultNodes(t),this._resultPointList},Vp.prototype.interfaces_=function(){return[]},Vp.prototype.getClass=function(){return Vp};var Hp=function(){this._inputGeom=null,this._factory=null,this._pruneEmptyGeometry=!0,this._preserveGeometryCollectionType=!0,this._preserveCollections=!1,this._preserveType=!1};Hp.prototype.transformPoint=function(t,e){return this._factory.createPoint(this.transformCoordinates(t.getCoordinateSequence(),t))},Hp.prototype.transformPolygon=function(t,e){var n=!0,r=this.transformLinearRing(t.getExteriorRing(),t);null!==r&&r instanceof eh&&!r.isEmpty()||(n=!1);for(var i=new bc,o=0;o<t.getNumInteriorRing();o++){var s=this.transformLinearRing(t.getInteriorRingN(o),t);null===s||s.isEmpty()||(s instanceof eh||(n=!1),i.add(s))}if(n)return this._factory.createPolygon(r,i.toArray([]));var a=new bc;return null!==r&&a.add(r),a.addAll(i),this._factory.buildGeometry(a)},Hp.prototype.createCoordinateSequence=function(t){return this._factory.getCoordinateSequenceFactory().create(t)},Hp.prototype.getInputGeometry=function(){return this._inputGeom},Hp.prototype.transformMultiLineString=function(t,e){for(var n=new bc,r=0;r<t.getNumGeometries();r++){var i=this.transformLineString(t.getGeometryN(r),t);null!==i&&(i.isEmpty()||n.add(i))}return this._factory.buildGeometry(n)},Hp.prototype.transformCoordinates=function(t,e){return this.copy(t)},Hp.prototype.transformLineString=function(t,e){return this._factory.createLineString(this.transformCoordinates(t.getCoordinateSequence(),t))},Hp.prototype.transformMultiPoint=function(t,e){for(var n=new bc,r=0;r<t.getNumGeometries();r++){var i=this.transformPoint(t.getGeometryN(r),t);null!==i&&(i.isEmpty()||n.add(i))}return this._factory.buildGeometry(n)},Hp.prototype.transformMultiPolygon=function(t,e){for(var n=new bc,r=0;r<t.getNumGeometries();r++){var i=this.transformPolygon(t.getGeometryN(r),t);null!==i&&(i.isEmpty()||n.add(i))}return this._factory.buildGeometry(n)},Hp.prototype.copy=function(t){return t.copy()},Hp.prototype.transformGeometryCollection=function(t,e){for(var n=new bc,r=0;r<t.getNumGeometries();r++){var i=this.transform(t.getGeometryN(r));null!==i&&(this._pruneEmptyGeometry&&i.isEmpty()||n.add(i))}return this._preserveGeometryCollectionType?this._factory.createGeometryCollection(_h.toGeometryArray(n)):this._factory.buildGeometry(n)},Hp.prototype.transform=function(t){if(this._inputGeom=t,this._factory=t.getFactory(),t instanceof Kc)return this.transformPoint(t,null);if(t instanceof th)return this.transformMultiPoint(t,null);if(t instanceof eh)return this.transformLinearRing(t,null);if(t instanceof Jc)return this.transformLineString(t,null);if(t instanceof Xc)return this.transformMultiLineString(t,null);if(t instanceof $c)return this.transformPolygon(t,null);if(t instanceof nh)return this.transformMultiPolygon(t,null);if(t instanceof jc)return this.transformGeometryCollection(t,null);throw new _u("Unknown Geometry subtype: "+t.getClass().getName())},Hp.prototype.transformLinearRing=function(t,e){var n=this.transformCoordinates(t.getCoordinateSequence(),t);if(null===n)return this._factory.createLinearRing(null);var r=n.size();return r>0&&r<4&&!this._preserveType?this._factory.createLineString(n):this._factory.createLinearRing(n)},Hp.prototype.interfaces_=function(){return[]},Hp.prototype.getClass=function(){return Hp};var Wp=function t(){if(this._snapTolerance=0,this._srcPts=null,this._seg=new gl,this._allowSnappingToSourceVertices=!1,this._isClosed=!1,arguments[0]instanceof Jc&&"number"==typeof arguments[1]){var e=arguments[1];t.call(this,arguments[0].getCoordinates(),e)}else if(arguments[0]instanceof Array&&"number"==typeof arguments[1]){var n=arguments[0],r=arguments[1];this._srcPts=n,this._isClosed=t.isClosed(n),this._snapTolerance=r}};Wp.prototype.snapVertices=function(t,e){for(var n=this._isClosed?t.size()-1:t.size(),r=0;r<n;r++){var i=t.get(r),o=this.findSnapForVertex(i,e);null!==o&&(t.set(r,new bu(o)),0===r&&this._isClosed&&t.set(t.size()-1,new bu(o)))}},Wp.prototype.findSnapForVertex=function(t,e){for(var n=0;n<e.length;n++){if(t.equals2D(e[n]))return null;if(t.distance(e[n])<this._snapTolerance)return e[n]}return null},Wp.prototype.snapTo=function(t){var e=new Nc(this._srcPts);return this.snapVertices(e,t),this.snapSegments(e,t),e.toCoordinateArray()},Wp.prototype.snapSegments=function(t,e){if(0===e.length)return null;var n=e.length;e[0].equals2D(e[e.length-1])&&(n=e.length-1);for(var r=0;r<n;r++){var i=e[r],o=this.findSegmentIndexToSnap(i,t);o>=0&&t.add(o+1,new bu(i),!1)}},Wp.prototype.findSegmentIndexToSnap=function(t,e){for(var n=mu.MAX_VALUE,r=-1,i=0;i<e.size()-1;i++){if(this._seg.p0=e.get(i),this._seg.p1=e.get(i+1),this._seg.p0.equals2D(t)||this._seg.p1.equals2D(t)){if(this._allowSnappingToSourceVertices)continue;return-1}var o=this._seg.distance(t);o<this._snapTolerance&&o<n&&(n=o,r=i)}return r},Wp.prototype.setAllowSnappingToSourceVertices=function(t){this._allowSnappingToSourceVertices=t},Wp.prototype.interfaces_=function(){return[]},Wp.prototype.getClass=function(){return Wp},Wp.isClosed=function(t){return!(t.length<=1)&&t[0].equals2D(t[t.length-1])};var Jp=function(t){this._srcGeom=t||null},Zp={SNAP_PRECISION_FACTOR:{configurable:!0}};Jp.prototype.snapTo=function(t,e){var n=this.extractTargetCoordinates(t);return new Kp(e,n).transform(this._srcGeom)},Jp.prototype.snapToSelf=function(t,e){var n=this.extractTargetCoordinates(this._srcGeom),r=new Kp(t,n,!0).transform(this._srcGeom),i=r;return e&&Lu(i,Qc)&&(i=r.buffer(0)),i},Jp.prototype.computeSnapTolerance=function(t){return this.computeMinimumSegmentLength(t)/10},Jp.prototype.extractTargetCoordinates=function(t){for(var e=new ki,n=t.getCoordinates(),r=0;r<n.length;r++)e.add(n[r]);return e.toArray(new Array(0).fill(null))},Jp.prototype.computeMinimumSegmentLength=function(t){for(var e=mu.MAX_VALUE,n=0;n<t.length-1;n++){var r=t[n].distance(t[n+1]);r<e&&(e=r)}return e},Jp.prototype.interfaces_=function(){return[]},Jp.prototype.getClass=function(){return Jp},Jp.snap=function(t,e,n){var r=new Array(2).fill(null),i=new Jp(t);r[0]=i.snapTo(e,n);var o=new Jp(e);return r[1]=o.snapTo(r[0],n),r},Jp.computeOverlaySnapTolerance=function(){if(1===arguments.length){var t=arguments[0],e=Jp.computeSizeBasedSnapTolerance(t),n=t.getPrecisionModel();if(n.getType()===fh.FIXED){var r=1/n.getScale()*2/1.415;r>e&&(e=r)}return e}if(2===arguments.length){var i=arguments[0],o=arguments[1];return Math.min(Jp.computeOverlaySnapTolerance(i),Jp.computeOverlaySnapTolerance(o))}},Jp.computeSizeBasedSnapTolerance=function(t){var e=t.getEnvelopeInternal();return Math.min(e.getHeight(),e.getWidth())*Jp.SNAP_PRECISION_FACTOR},Jp.snapToSelf=function(t,e,n){return new Jp(t).snapToSelf(e,n)},Zp.SNAP_PRECISION_FACTOR.get=function(){return 1e-9},Object.defineProperties(Jp,Zp);var Kp=function(t){function e(e,n,r){t.call(this),this._snapTolerance=e||null,this._snapPts=n||null,this._isSelfSnap=void 0!==r&&r}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.snapLine=function(t,e){var n=new Wp(t,this._snapTolerance);return n.setAllowSnappingToSourceVertices(this._isSelfSnap),n.snapTo(e)},e.prototype.transformCoordinates=function(t,e){var n=t.toCoordinateArray(),r=this.snapLine(n,this._snapPts);return this._factory.getCoordinateSequenceFactory().create(r)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Hp),Qp=function(){this._isFirst=!0,this._commonMantissaBitsCount=53,this._commonBits=0,this._commonSignExp=null};Qp.prototype.getCommon=function(){return mu.longBitsToDouble(this._commonBits)},Qp.prototype.add=function(t){var e=mu.doubleToLongBits(t);return this._isFirst?(this._commonBits=e,this._commonSignExp=Qp.signExpBits(this._commonBits),this._isFirst=!1,null):Qp.signExpBits(e)!==this._commonSignExp?(this._commonBits=0,null):(this._commonMantissaBitsCount=Qp.numCommonMostSigMantissaBits(this._commonBits,e),void(this._commonBits=Qp.zeroLowerBits(this._commonBits,64-(12+this._commonMantissaBitsCount))))},Qp.prototype.toString=function(){if(1===arguments.length){var t=arguments[0],e=mu.longBitsToDouble(t),n="0000000000000000000000000000000000000000000000000000000000000000"+mu.toBinaryString(t),r=n.substring(n.length-64);return r.substring(0,1)+" "+r.substring(1,12)+"(exp) "+r.substring(12)+" [ "+e+" ]"}},Qp.prototype.interfaces_=function(){return[]},Qp.prototype.getClass=function(){return Qp},Qp.getBit=function(t,e){return 0!=(t&1<<e)?1:0},Qp.signExpBits=function(t){return t>>52},Qp.zeroLowerBits=function(t,e){return t&~((1<<e)-1)},Qp.numCommonMostSigMantissaBits=function(t,e){for(var n=0,r=52;r>=0;r--){if(Qp.getBit(t,r)!==Qp.getBit(e,r))return n;n++}return 52};var $p=function(){this._commonCoord=null,this._ccFilter=new ef},tf={CommonCoordinateFilter:{configurable:!0},Translater:{configurable:!0}};$p.prototype.addCommonBits=function(t){var e=new nf(this._commonCoord);t.apply(e),t.geometryChanged()},$p.prototype.removeCommonBits=function(t){if(0===this._commonCoord.x&&0===this._commonCoord.y)return t;var e=new bu(this._commonCoord);e.x=-e.x,e.y=-e.y;var n=new nf(e);return t.apply(n),t.geometryChanged(),t},$p.prototype.getCommonCoordinate=function(){return this._commonCoord},$p.prototype.add=function(t){t.apply(this._ccFilter),this._commonCoord=this._ccFilter.getCommonCoordinate()},$p.prototype.interfaces_=function(){return[]},$p.prototype.getClass=function(){return $p},tf.CommonCoordinateFilter.get=function(){return ef},tf.Translater.get=function(){return nf},Object.defineProperties($p,tf);var ef=function(){this._commonBitsX=new Qp,this._commonBitsY=new Qp};ef.prototype.filter=function(t){this._commonBitsX.add(t.x),this._commonBitsY.add(t.y)},ef.prototype.getCommonCoordinate=function(){return new bu(this._commonBitsX.getCommon(),this._commonBitsY.getCommon())},ef.prototype.interfaces_=function(){return[pc]},ef.prototype.getClass=function(){return ef};var nf=function(){this.trans=null;var t=arguments[0];this.trans=t};nf.prototype.filter=function(t,e){var n=t.getOrdinate(e,0)+this.trans.x,r=t.getOrdinate(e,1)+this.trans.y;t.setOrdinate(e,0,n),t.setOrdinate(e,1,r)},nf.prototype.isDone=function(){return!1},nf.prototype.isGeometryChanged=function(){return!0},nf.prototype.interfaces_=function(){return[zc]},nf.prototype.getClass=function(){return nf};var rf=function(t,e){this._geom=new Array(2).fill(null),this._snapTolerance=null,this._cbr=null,this._geom[0]=t,this._geom[1]=e,this.computeSnapTolerance()};rf.prototype.selfSnap=function(t){return new Jp(t).snapTo(t,this._snapTolerance)},rf.prototype.removeCommonBits=function(t){this._cbr=new $p,this._cbr.add(t[0]),this._cbr.add(t[1]);var e=new Array(2).fill(null);return e[0]=this._cbr.removeCommonBits(t[0].copy()),e[1]=this._cbr.removeCommonBits(t[1].copy()),e},rf.prototype.prepareResult=function(t){return this._cbr.addCommonBits(t),t},rf.prototype.getResultGeometry=function(t){var e=this.snap(this._geom),n=Cf.overlayOp(e[0],e[1],t);return this.prepareResult(n)},rf.prototype.checkValid=function(t){t.isValid()||Xu.out.println("Snapped geometry is invalid")},rf.prototype.computeSnapTolerance=function(){this._snapTolerance=Jp.computeOverlaySnapTolerance(this._geom[0],this._geom[1])},rf.prototype.snap=function(t){var e=this.removeCommonBits(t);return Jp.snap(e[0],e[1],this._snapTolerance)},rf.prototype.interfaces_=function(){return[]},rf.prototype.getClass=function(){return rf},rf.overlayOp=function(t,e,n){return new rf(t,e).getResultGeometry(n)},rf.union=function(t,e){return rf.overlayOp(t,e,Cf.UNION)},rf.intersection=function(t,e){return rf.overlayOp(t,e,Cf.INTERSECTION)},rf.symDifference=function(t,e){return rf.overlayOp(t,e,Cf.SYMDIFFERENCE)},rf.difference=function(t,e){return rf.overlayOp(t,e,Cf.DIFFERENCE)};var of=function(t,e){this._geom=new Array(2).fill(null),this._geom[0]=t,this._geom[1]=e};of.prototype.getResultGeometry=function(t){var e=null,n=!1,r=null;try{e=Cf.overlayOp(this._geom[0],this._geom[1],t),n=!0}catch(t){if(!(t instanceof Qu))throw t;r=t}if(!n)try{e=rf.overlayOp(this._geom[0],this._geom[1],t)}catch(t){throw t instanceof Qu?r:t}return e},of.prototype.interfaces_=function(){return[]},of.prototype.getClass=function(){return of},of.overlayOp=function(t,e,n){return new of(t,e).getResultGeometry(n)},of.union=function(t,e){return of.overlayOp(t,e,Cf.UNION)},of.intersection=function(t,e){return of.overlayOp(t,e,Cf.INTERSECTION)},of.symDifference=function(t,e){return of.overlayOp(t,e,Cf.SYMDIFFERENCE)},of.difference=function(t,e){return of.overlayOp(t,e,Cf.DIFFERENCE)};var sf=function(){this.mce=null,this.chainIndex=null;var t=arguments[0],e=arguments[1];this.mce=t,this.chainIndex=e};sf.prototype.computeIntersections=function(t,e){this.mce.computeIntersectsForChain(this.chainIndex,t.mce,t.chainIndex,e)},sf.prototype.interfaces_=function(){return[]},sf.prototype.getClass=function(){return sf};var af=function t(){if(this._label=null,this._xValue=null,this._eventType=null,this._insertEvent=null,this._deleteEventIndex=null,this._obj=null,2===arguments.length){var e=arguments[0],n=arguments[1];this._eventType=t.DELETE,this._xValue=e,this._insertEvent=n}else if(3===arguments.length){var r=arguments[0],i=arguments[1],o=arguments[2];this._eventType=t.INSERT,this._label=r,this._xValue=i,this._obj=o}},uf={INSERT:{configurable:!0},DELETE:{configurable:!0}};af.prototype.isDelete=function(){return this._eventType===af.DELETE},af.prototype.setDeleteEventIndex=function(t){this._deleteEventIndex=t},af.prototype.getObject=function(){return this._obj},af.prototype.compareTo=function(t){var e=t;return this._xValue<e._xValue?-1:this._xValue>e._xValue?1:this._eventType<e._eventType?-1:this._eventType>e._eventType?1:0},af.prototype.getInsertEvent=function(){return this._insertEvent},af.prototype.isInsert=function(){return this._eventType===af.INSERT},af.prototype.isSameLabel=function(t){return null!==this._label&&this._label===t._label},af.prototype.getDeleteEventIndex=function(){return this._deleteEventIndex},af.prototype.interfaces_=function(){return[xu]},af.prototype.getClass=function(){return af},uf.INSERT.get=function(){return 1},uf.DELETE.get=function(){return 2},Object.defineProperties(af,uf);var cf=function(){};cf.prototype.interfaces_=function(){return[]},cf.prototype.getClass=function(){return cf};var hf=function(){this._hasIntersection=!1,this._hasProper=!1,this._hasProperInterior=!1,this._properIntersectionPoint=null,this._li=null,this._includeProper=null,this._recordIsolated=null,this._isSelfIntersection=null,this._numIntersections=0,this.numTests=0,this._bdyNodes=null,this._isDone=!1,this._isDoneWhenProperInt=!1;var t=arguments[0],e=arguments[1],n=arguments[2];this._li=t,this._includeProper=e,this._recordIsolated=n};hf.prototype.isTrivialIntersection=function(t,e,n,r){if(t===n&&1===this._li.getIntersectionNum()){if(hf.isAdjacentSegments(e,r))return!0;if(t.isClosed()){var i=t.getNumPoints()-1;if(0===e&&r===i||0===r&&e===i)return!0}}return!1},hf.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},hf.prototype.setIsDoneIfProperInt=function(t){this._isDoneWhenProperInt=t},hf.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},hf.prototype.isBoundaryPointInternal=function(t,e){for(var n=e.iterator();n.hasNext();){var r=n.next().getCoordinate();if(t.isIntersection(r))return!0}return!1},hf.prototype.hasProperIntersection=function(){return this._hasProper},hf.prototype.hasIntersection=function(){return this._hasIntersection},hf.prototype.isDone=function(){return this._isDone},hf.prototype.isBoundaryPoint=function(t,e){return null!==e&&(!!this.isBoundaryPointInternal(t,e[0])||!!this.isBoundaryPointInternal(t,e[1]))},hf.prototype.setBoundaryNodes=function(t,e){this._bdyNodes=new Array(2).fill(null),this._bdyNodes[0]=t,this._bdyNodes[1]=e},hf.prototype.addIntersections=function(t,e,n,r){if(t===n&&e===r)return null;this.numTests++;var i=t.getCoordinates()[e],o=t.getCoordinates()[e+1],s=n.getCoordinates()[r],a=n.getCoordinates()[r+1];this._li.computeIntersection(i,o,s,a),this._li.hasIntersection()&&(this._recordIsolated&&(t.setIsolated(!1),n.setIsolated(!1)),this._numIntersections++,this.isTrivialIntersection(t,e,n,r)||(this._hasIntersection=!0,!this._includeProper&&this._li.isProper()||(t.addIntersections(this._li,e,0),n.addIntersections(this._li,r,1)),this._li.isProper()&&(this._properIntersectionPoint=this._li.getIntersection(0).copy(),this._hasProper=!0,this._isDoneWhenProperInt&&(this._isDone=!0),this.isBoundaryPoint(this._li,this._bdyNodes)||(this._hasProperInterior=!0))))},hf.prototype.interfaces_=function(){return[]},hf.prototype.getClass=function(){return hf},hf.isAdjacentSegments=function(t,e){return 1===Math.abs(t-e)};var lf=function(t){function e(){t.call(this),this.events=new bc,this.nOverlaps=null}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.prepareEvents=function(){$h.sort(this.events);for(var t=0;t<this.events.size();t++){var e=this.events.get(t);e.isDelete()&&e.getInsertEvent().setDeleteEventIndex(t)}},e.prototype.computeIntersections=function(){if(1===arguments.length){var t=arguments[0];this.nOverlaps=0,this.prepareEvents();for(var e=0;e<this.events.size();e++){var n=this.events.get(e);if(n.isInsert()&&this.processOverlaps(e,n.getDeleteEventIndex(),n,t),t.isDone())break}}else if(3===arguments.length)if(arguments[2]instanceof hf&&Lu(arguments[0],wc)&&Lu(arguments[1],wc)){var r=arguments[0],i=arguments[1],o=arguments[2];this.addEdges(r,r),this.addEdges(i,i),this.computeIntersections(o)}else if("boolean"==typeof arguments[2]&&Lu(arguments[0],wc)&&arguments[1]instanceof hf){var s=arguments[0],a=arguments[1];arguments[2]?this.addEdges(s,null):this.addEdges(s),this.computeIntersections(a)}},e.prototype.addEdge=function(t,e){for(var n=t.getMonotoneChainEdge(),r=n.getStartIndexes(),i=0;i<r.length-1;i++){var o=new sf(n,i),s=new af(e,n.getMinX(i),o);this.events.add(s),this.events.add(new af(n.getMaxX(i),s))}},e.prototype.processOverlaps=function(t,e,n,r){for(var i=n.getObject(),o=t;o<e;o++){var s=this.events.get(o);if(s.isInsert()){var a=s.getObject();n.isSameLabel(s)||(i.computeIntersections(a,r),this.nOverlaps++)}}},e.prototype.addEdges=function(){if(1===arguments.length)for(var t=arguments[0].iterator();t.hasNext();){var e=t.next();this.addEdge(e,e)}else if(2===arguments.length)for(var n=arguments[1],r=arguments[0].iterator();r.hasNext();){var i=r.next();this.addEdge(i,n)}},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(cf),pf=function(){this._min=mu.POSITIVE_INFINITY,this._max=mu.NEGATIVE_INFINITY},ff={NodeComparator:{configurable:!0}};pf.prototype.getMin=function(){return this._min},pf.prototype.intersects=function(t,e){return!(this._min>e||this._max<t)},pf.prototype.getMax=function(){return this._max},pf.prototype.toString=function(){return Ku.toLineString(new bu(this._min,0),new bu(this._max,0))},pf.prototype.interfaces_=function(){return[]},pf.prototype.getClass=function(){return pf},ff.NodeComparator.get=function(){return gf},Object.defineProperties(pf,ff);var gf=function(){};gf.prototype.compare=function(t,e){var n=t,r=e,i=(n._min+n._max)/2,o=(r._min+r._max)/2;return i<o?-1:i>o?1:0},gf.prototype.interfaces_=function(){return[wu]},gf.prototype.getClass=function(){return gf};var df=function(t){function e(){t.call(this),this._item=null;var e=arguments[0],n=arguments[1],r=arguments[2];this._min=e,this._max=n,this._item=r}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.query=function(t,e,n){if(!this.intersects(t,e))return null;n.visitItem(this._item)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(pf),yf=function(t){function e(){t.call(this),this._node1=null,this._node2=null;var e=arguments[0],n=arguments[1];this._node1=e,this._node2=n,this.buildExtent(this._node1,this._node2)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.buildExtent=function(t,e){this._min=Math.min(t._min,e._min),this._max=Math.max(t._max,e._max)},e.prototype.query=function(t,e,n){if(!this.intersects(t,e))return null;null!==this._node1&&this._node1.query(t,e,n),null!==this._node2&&this._node2.query(t,e,n)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(pf),_f=function(){this._leaves=new bc,this._root=null,this._level=0};_f.prototype.buildTree=function(){$h.sort(this._leaves,new pf.NodeComparator);for(var t=this._leaves,e=null,n=new bc;;){if(this.buildLevel(t,n),1===n.size())return n.get(0);e=t,t=n,n=e}},_f.prototype.insert=function(t,e,n){if(null!==this._root)throw new Error("Index cannot be added to once it has been queried");this._leaves.add(new df(t,e,n))},_f.prototype.query=function(t,e,n){this.init(),this._root.query(t,e,n)},_f.prototype.buildRoot=function(){if(null!==this._root)return null;this._root=this.buildTree()},_f.prototype.printNode=function(t){Xu.out.println(Ku.toLineString(new bu(t._min,this._level),new bu(t._max,this._level)))},_f.prototype.init=function(){if(null!==this._root)return null;this.buildRoot()},_f.prototype.buildLevel=function(t,e){this._level++,e.clear();for(var n=0;n<t.size();n+=2){var r=t.get(n);if(null===(n+1<t.size()?t.get(n):null))e.add(r);else{var i=new yf(t.get(n),t.get(n+1));e.add(i)}}},_f.prototype.interfaces_=function(){return[]},_f.prototype.getClass=function(){return _f};var mf=function(){this._items=new bc};mf.prototype.visitItem=function(t){this._items.add(t)},mf.prototype.getItems=function(){return this._items},mf.prototype.interfaces_=function(){return[Jh]},mf.prototype.getClass=function(){return mf};var vf=function(){this._index=null;var t=arguments[0];if(!Lu(t,Qc))throw new _u("Argument must be Polygonal");this._index=new wf(t)},xf={SegmentVisitor:{configurable:!0},IntervalIndexedGeometry:{configurable:!0}};vf.prototype.locate=function(t){var e=new oc(t),n=new Ef(e);return this._index.query(t.y,t.y,n),e.getLocation()},vf.prototype.interfaces_=function(){return[Bl]},vf.prototype.getClass=function(){return vf},xf.SegmentVisitor.get=function(){return Ef},xf.IntervalIndexedGeometry.get=function(){return wf},Object.defineProperties(vf,xf);var Ef=function(){this._counter=null;var t=arguments[0];this._counter=t};Ef.prototype.visitItem=function(t){var e=t;this._counter.countSegment(e.getCoordinate(0),e.getCoordinate(1))},Ef.prototype.interfaces_=function(){return[Jh]},Ef.prototype.getClass=function(){return Ef};var wf=function(){this._index=new _f;var t=arguments[0];this.init(t)};wf.prototype.init=function(t){for(var e=bp.getLines(t).iterator();e.hasNext();){var n=e.next().getCoordinates();this.addLine(n)}},wf.prototype.addLine=function(t){for(var e=1;e<t.length;e++){var n=new gl(t[e-1],t[e]),r=Math.min(n.p0.y,n.p1.y),i=Math.max(n.p0.y,n.p1.y);this._index.insert(r,i,n)}},wf.prototype.query=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1],n=new mf;return this._index.query(t,e,n),n.getItems()}if(3===arguments.length){var r=arguments[0],i=arguments[1],o=arguments[2];this._index.query(r,i,o)}},wf.prototype.interfaces_=function(){return[]},wf.prototype.getClass=function(){return wf};var bf=function(t){function e(){if(t.call(this),this._parentGeom=null,this._lineEdgeMap=new ph,this._boundaryNodeRule=null,this._useBoundaryDeterminationRule=!0,this._argIndex=null,this._boundaryNodes=null,this._hasTooFewPoints=!1,this._invalidPoint=null,this._areaPtLocator=null,this._ptLocator=new Ip,2===arguments.length){var e=arguments[0],n=arguments[1],r=fc.OGC_SFS_BOUNDARY_RULE;this._argIndex=e,this._parentGeom=n,this._boundaryNodeRule=r,null!==n&&this.add(n)}else if(3===arguments.length){var i=arguments[0],o=arguments[1],s=arguments[2];this._argIndex=i,this._parentGeom=o,this._boundaryNodeRule=s,null!==o&&this.add(o)}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.insertBoundaryPoint=function(t,n){var r=this._nodes.addNode(n).getLabel(),i=1;Su.NONE,r.getLocation(t,Nh.ON)===Su.BOUNDARY&&i++;var o=e.determineBoundary(this._boundaryNodeRule,i);r.setLocation(t,o)},e.prototype.computeSelfNodes=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];return this.computeSelfNodes(t,e,!1)}if(3===arguments.length){var n=arguments[1],r=arguments[2],i=new hf(arguments[0],!0,!1);i.setIsDoneIfProperInt(r);var o=this.createEdgeSetIntersector(),s=this._parentGeom instanceof eh||this._parentGeom instanceof $c||this._parentGeom instanceof nh,a=n||!s;return o.computeIntersections(this._edges,i,a),this.addSelfIntersectionNodes(this._argIndex),i}},e.prototype.computeSplitEdges=function(t){for(var e=this._edges.iterator();e.hasNext();)e.next().eiList.addSplitEdges(t)},e.prototype.computeEdgeIntersections=function(t,e,n){var r=new hf(e,n,!0);return r.setBoundaryNodes(this.getBoundaryNodes(),t.getBoundaryNodes()),this.createEdgeSetIntersector().computeIntersections(this._edges,t._edges,r),r},e.prototype.getGeometry=function(){return this._parentGeom},e.prototype.getBoundaryNodeRule=function(){return this._boundaryNodeRule},e.prototype.hasTooFewPoints=function(){return this._hasTooFewPoints},e.prototype.addPoint=function(){if(arguments[0]instanceof Kc){var t=arguments[0].getCoordinate();this.insertPoint(this._argIndex,t,Su.INTERIOR)}else if(arguments[0]instanceof bu){var e=arguments[0];this.insertPoint(this._argIndex,e,Su.INTERIOR)}},e.prototype.addPolygon=function(t){this.addPolygonRing(t.getExteriorRing(),Su.EXTERIOR,Su.INTERIOR);for(var e=0;e<t.getNumInteriorRing();e++){var n=t.getInteriorRingN(e);this.addPolygonRing(n,Su.INTERIOR,Su.EXTERIOR)}},e.prototype.addEdge=function(t){this.insertEdge(t);var e=t.getCoordinates();this.insertPoint(this._argIndex,e[0],Su.BOUNDARY),this.insertPoint(this._argIndex,e[e.length-1],Su.BOUNDARY)},e.prototype.addLineString=function(t){var e=Cc.removeRepeatedPoints(t.getCoordinates());if(e.length<2)return this._hasTooFewPoints=!0,this._invalidPoint=e[0],null;var n=new ep(e,new Rh(this._argIndex,Su.INTERIOR));this._lineEdgeMap.put(t,n),this.insertEdge(n),tc.isTrue(e.length>=2,"found LineString with single point"),this.insertBoundaryPoint(this._argIndex,e[0]),this.insertBoundaryPoint(this._argIndex,e[e.length-1])},e.prototype.getInvalidPoint=function(){return this._invalidPoint},e.prototype.getBoundaryPoints=function(){for(var t=this.getBoundaryNodes(),e=new Array(t.size()).fill(null),n=0,r=t.iterator();r.hasNext();){var i=r.next();e[n++]=i.getCoordinate().copy()}return e},e.prototype.getBoundaryNodes=function(){return null===this._boundaryNodes&&(this._boundaryNodes=this._nodes.getBoundaryNodes(this._argIndex)),this._boundaryNodes},e.prototype.addSelfIntersectionNode=function(t,e,n){if(this.isBoundaryNode(t,e))return null;n===Su.BOUNDARY&&this._useBoundaryDeterminationRule?this.insertBoundaryPoint(t,e):this.insertPoint(t,e,n)},e.prototype.addPolygonRing=function(t,e,n){if(t.isEmpty())return null;var r=Cc.removeRepeatedPoints(t.getCoordinates());if(r.length<4)return this._hasTooFewPoints=!0,this._invalidPoint=r[0],null;var i=e,o=n;sc.isCCW(r)&&(i=n,o=e);var s=new ep(r,new Rh(this._argIndex,Su.BOUNDARY,i,o));this._lineEdgeMap.put(t,s),this.insertEdge(s),this.insertPoint(this._argIndex,r[0],Su.BOUNDARY)},e.prototype.insertPoint=function(t,e,n){var r=this._nodes.addNode(e),i=r.getLabel();null===i?r._label=new Rh(t,n):i.setLocation(t,n)},e.prototype.createEdgeSetIntersector=function(){return new lf},e.prototype.addSelfIntersectionNodes=function(t){for(var e=this._edges.iterator();e.hasNext();)for(var n=e.next(),r=n.getLabel().getLocation(t),i=n.eiList.iterator();i.hasNext();){var o=i.next();this.addSelfIntersectionNode(t,o.coord,r)}},e.prototype.add=function(){if(1!==arguments.length)return t.prototype.add.apply(this,arguments);var e=arguments[0];if(e.isEmpty())return null;if(e instanceof nh&&(this._useBoundaryDeterminationRule=!1),e instanceof $c)this.addPolygon(e);else if(e instanceof Jc)this.addLineString(e);else if(e instanceof Kc)this.addPoint(e);else if(e instanceof th)this.addCollection(e);else if(e instanceof Xc)this.addCollection(e);else if(e instanceof nh)this.addCollection(e);else{if(!(e instanceof jc))throw new Error(e.getClass().getName());this.addCollection(e)}},e.prototype.addCollection=function(t){for(var e=0;e<t.getNumGeometries();e++){var n=t.getGeometryN(e);this.add(n)}},e.prototype.locate=function(t){return Lu(this._parentGeom,Qc)&&this._parentGeom.getNumGeometries()>50?(null===this._areaPtLocator&&(this._areaPtLocator=new vf(this._parentGeom)),this._areaPtLocator.locate(t)):this._ptLocator.locate(t,this._parentGeom)},e.prototype.findEdge=function(){if(1===arguments.length){var e=arguments[0];return this._lineEdgeMap.get(e)}return t.prototype.findEdge.apply(this,arguments)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.determineBoundary=function(t,e){return t.isInBoundary(e)?Su.BOUNDARY:Su.INTERIOR},e}(Uh),If=function(){if(this._li=new rc,this._resultPrecisionModel=null,this._arg=null,1===arguments.length){var t=arguments[0];this.setComputationPrecision(t.getPrecisionModel()),this._arg=new Array(1).fill(null),this._arg[0]=new bf(0,t)}else if(2===arguments.length){var e=arguments[0],n=arguments[1],r=fc.OGC_SFS_BOUNDARY_RULE;e.getPrecisionModel().compareTo(n.getPrecisionModel())>=0?this.setComputationPrecision(e.getPrecisionModel()):this.setComputationPrecision(n.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new bf(0,e,r),this._arg[1]=new bf(1,n,r)}else if(3===arguments.length){var i=arguments[0],o=arguments[1],s=arguments[2];i.getPrecisionModel().compareTo(o.getPrecisionModel())>=0?this.setComputationPrecision(i.getPrecisionModel()):this.setComputationPrecision(o.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new bf(0,i,s),this._arg[1]=new bf(1,o,s)}};If.prototype.getArgGeometry=function(t){return this._arg[t].getGeometry()},If.prototype.setComputationPrecision=function(t){this._resultPrecisionModel=t,this._li.setPrecisionModel(this._resultPrecisionModel)},If.prototype.interfaces_=function(){return[]},If.prototype.getClass=function(){return If};var Nf=function(){};Nf.prototype.interfaces_=function(){return[]},Nf.prototype.getClass=function(){return Nf},Nf.map=function(){if(arguments[0]instanceof cc&&Lu(arguments[1],Nf.MapOp)){for(var t=arguments[0],e=arguments[1],n=new bc,r=0;r<t.getNumGeometries();r++){var i=e.map(t.getGeometryN(r));null!==i&&n.add(i)}return t.getFactory().buildGeometry(n)}if(Lu(arguments[0],vc)&&Lu(arguments[1],Nf.MapOp)){for(var o=arguments[0],s=arguments[1],a=new bc,u=o.iterator();u.hasNext();){var c=u.next(),h=s.map(c);null!==h&&a.add(h)}return a}},Nf.MapOp=function(){};var Cf=function(t){function e(){var e=arguments[0],n=arguments[1];t.call(this,e,n),this._ptLocator=new Ip,this._geomFact=null,this._resultGeom=null,this._graph=null,this._edgeList=new Vl,this._resultPolyList=new bc,this._resultLineList=new bc,this._resultPointList=new bc,this._graph=new Uh(new Ul),this._geomFact=e.getFactory()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.insertUniqueEdge=function(t){var e=this._edgeList.findEqualEdge(t);if(null!==e){var n=e.getLabel(),r=t.getLabel();e.isPointwiseEqual(t)||(r=new Rh(t.getLabel())).flip();var i=e.getDepth();i.isNull()&&i.add(n),i.add(r),n.merge(r)}else this._edgeList.add(t)},e.prototype.getGraph=function(){return this._graph},e.prototype.cancelDuplicateResultEdges=function(){for(var t=this._graph.getEdgeEnds().iterator();t.hasNext();){var e=t.next(),n=e.getSym();e.isInResult()&&n.isInResult()&&(e.setInResult(!1),n.setInResult(!1))}},e.prototype.isCoveredByLA=function(t){return!!this.isCovered(t,this._resultLineList)||!!this.isCovered(t,this._resultPolyList)},e.prototype.computeGeometry=function(t,n,r,i){var o=new bc;return o.addAll(t),o.addAll(n),o.addAll(r),o.isEmpty()?e.createEmptyResult(i,this._arg[0].getGeometry(),this._arg[1].getGeometry(),this._geomFact):this._geomFact.buildGeometry(o)},e.prototype.mergeSymLabels=function(){for(var t=this._graph.getNodes().iterator();t.hasNext();)t.next().getEdges().mergeSymLabels()},e.prototype.isCovered=function(t,e){for(var n=e.iterator();n.hasNext();){var r=n.next();if(this._ptLocator.locate(t,r)!==Su.EXTERIOR)return!0}return!1},e.prototype.replaceCollapsedEdges=function(){for(var t=new bc,e=this._edgeList.iterator();e.hasNext();){var n=e.next();n.isCollapsed()&&(e.remove(),t.add(n.getCollapsedEdge()))}this._edgeList.addAll(t)},e.prototype.updateNodeLabelling=function(){for(var t=this._graph.getNodes().iterator();t.hasNext();){var e=t.next(),n=e.getEdges().getLabel();e.getLabel().merge(n)}},e.prototype.getResultGeometry=function(t){return this.computeOverlay(t),this._resultGeom},e.prototype.insertUniqueEdges=function(t){for(var e=t.iterator();e.hasNext();){var n=e.next();this.insertUniqueEdge(n)}},e.prototype.computeOverlay=function(t){this.copyPoints(0),this.copyPoints(1),this._arg[0].computeSelfNodes(this._li,!1),this._arg[1].computeSelfNodes(this._li,!1),this._arg[0].computeEdgeIntersections(this._arg[1],this._li,!0);var e=new bc;this._arg[0].computeSplitEdges(e),this._arg[1].computeSplitEdges(e),this.insertUniqueEdges(e),this.computeLabelsFromDepths(),this.replaceCollapsedEdges(),Xp.checkValid(this._edgeList.getEdges()),this._graph.addEdges(this._edgeList.getEdges()),this.computeLabelling(),this.labelIncompleteNodes(),this.findResultAreaEdges(t),this.cancelDuplicateResultEdges();var n=new Yh(this._geomFact);n.add(this._graph),this._resultPolyList=n.getPolygons();var r=new Yp(this,this._geomFact,this._ptLocator);this._resultLineList=r.build(t);var i=new Vp(this,this._geomFact,this._ptLocator);this._resultPointList=i.build(t),this._resultGeom=this.computeGeometry(this._resultPointList,this._resultLineList,this._resultPolyList,t)},e.prototype.labelIncompleteNode=function(t,e){var n=this._ptLocator.locate(t.getCoordinate(),this._arg[e].getGeometry());t.getLabel().setLocation(e,n)},e.prototype.copyPoints=function(t){for(var e=this._arg[t].getNodeIterator();e.hasNext();){var n=e.next();this._graph.addNode(n.getCoordinate()).setLabel(t,n.getLabel().getLocation(t))}},e.prototype.findResultAreaEdges=function(t){for(var n=this._graph.getEdgeEnds().iterator();n.hasNext();){var r=n.next(),i=r.getLabel();i.isArea()&&!r.isInteriorAreaEdge()&&e.isResultOfOp(i.getLocation(0,Nh.RIGHT),i.getLocation(1,Nh.RIGHT),t)&&r.setInResult(!0)}},e.prototype.computeLabelsFromDepths=function(){for(var t=this._edgeList.iterator();t.hasNext();){var e=t.next(),n=e.getLabel(),r=e.getDepth();if(!r.isNull()){r.normalize();for(var i=0;i<2;i++)n.isNull(i)||!n.isArea()||r.isNull(i)||(0===r.getDelta(i)?n.toLine(i):(tc.isTrue(!r.isNull(i,Nh.LEFT),"depth of LEFT side has not been initialized"),n.setLocation(i,Nh.LEFT,r.getLocation(i,Nh.LEFT)),tc.isTrue(!r.isNull(i,Nh.RIGHT),"depth of RIGHT side has not been initialized"),n.setLocation(i,Nh.RIGHT,r.getLocation(i,Nh.RIGHT))))}}},e.prototype.computeLabelling=function(){for(var t=this._graph.getNodes().iterator();t.hasNext();)t.next().getEdges().computeLabelling(this._arg);this.mergeSymLabels(),this.updateNodeLabelling()},e.prototype.labelIncompleteNodes=function(){for(var t=this._graph.getNodes().iterator();t.hasNext();){var e=t.next(),n=e.getLabel();e.isIsolated()&&(n.isNull(0)?this.labelIncompleteNode(e,0):this.labelIncompleteNode(e,1)),e.getEdges().updateLabelling(n)}},e.prototype.isCoveredByA=function(t){return!!this.isCovered(t,this._resultPolyList)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(If);Cf.overlayOp=function(t,e,n){return new Cf(t,e).getResultGeometry(n)},Cf.intersection=function(t,e){if(t.isEmpty()||e.isEmpty())return Cf.createEmptyResult(Cf.INTERSECTION,t,e,t.getFactory());if(t.isGeometryCollection()){var n=e;return Up.map(t,{interfaces_:function(){return[Nf.MapOp]},map:function(t){return t.intersection(n)}})}return t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),of.overlayOp(t,e,Cf.INTERSECTION)},Cf.symDifference=function(t,e){if(t.isEmpty()||e.isEmpty()){if(t.isEmpty()&&e.isEmpty())return Cf.createEmptyResult(Cf.SYMDIFFERENCE,t,e,t.getFactory());if(t.isEmpty())return e.copy();if(e.isEmpty())return t.copy()}return t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),of.overlayOp(t,e,Cf.SYMDIFFERENCE)},Cf.resultDimension=function(t,e,n){var r=e.getDimension(),i=n.getDimension(),o=-1;switch(t){case Cf.INTERSECTION:o=Math.min(r,i);break;case Cf.UNION:o=Math.max(r,i);break;case Cf.DIFFERENCE:o=r;break;case Cf.SYMDIFFERENCE:o=Math.max(r,i)}return o},Cf.createEmptyResult=function(t,e,n,r){var i=null;switch(Cf.resultDimension(t,e,n)){case-1:i=r.createGeometryCollection(new Array(0).fill(null));break;case 0:i=r.createPoint();break;case 1:i=r.createLineString();break;case 2:i=r.createPolygon()}return i},Cf.difference=function(t,e){return t.isEmpty()?Cf.createEmptyResult(Cf.DIFFERENCE,t,e,t.getFactory()):e.isEmpty()?t.copy():(t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),of.overlayOp(t,e,Cf.DIFFERENCE))},Cf.isResultOfOp=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1],n=t.getLocation(0),r=t.getLocation(1);return Cf.isResultOfOp(n,r,e)}if(3===arguments.length){var i=arguments[0],o=arguments[1],s=arguments[2];switch(i===Su.BOUNDARY&&(i=Su.INTERIOR),o===Su.BOUNDARY&&(o=Su.INTERIOR),s){case Cf.INTERSECTION:return i===Su.INTERIOR&&o===Su.INTERIOR;case Cf.UNION:return i===Su.INTERIOR||o===Su.INTERIOR;case Cf.DIFFERENCE:return i===Su.INTERIOR&&o!==Su.INTERIOR;case Cf.SYMDIFFERENCE:return i===Su.INTERIOR&&o!==Su.INTERIOR||i!==Su.INTERIOR&&o===Su.INTERIOR}return!1}},Cf.INTERSECTION=1,Cf.UNION=2,Cf.DIFFERENCE=3,Cf.SYMDIFFERENCE=4;var Sf=function(){this._g=null,this._boundaryDistanceTolerance=null,this._linework=null,this._ptLocator=new Ip,this._seg=new gl;var t=arguments[0],e=arguments[1];this._g=t,this._boundaryDistanceTolerance=e,this._linework=this.extractLinework(t)};Sf.prototype.isWithinToleranceOfBoundary=function(t){for(var e=0;e<this._linework.getNumGeometries();e++)for(var n=this._linework.getGeometryN(e).getCoordinateSequence(),r=0;r<n.size()-1;r++)if(n.getCoordinate(r,this._seg.p0),n.getCoordinate(r+1,this._seg.p1),this._seg.distance(t)<=this._boundaryDistanceTolerance)return!0;return!1},Sf.prototype.getLocation=function(t){return this.isWithinToleranceOfBoundary(t)?Su.BOUNDARY:this._ptLocator.locate(t,this._g)},Sf.prototype.extractLinework=function(t){var e=new Mf;t.apply(e);var n=e.getLinework(),r=_h.toLineStringArray(n);return t.getFactory().createMultiLineString(r)},Sf.prototype.interfaces_=function(){return[]},Sf.prototype.getClass=function(){return Sf};var Mf=function(){this._linework=null,this._linework=new bc};Mf.prototype.getLinework=function(){return this._linework},Mf.prototype.filter=function(t){if(t instanceof $c){var e=t;this._linework.add(e.getExteriorRing());for(var n=0;n<e.getNumInteriorRing();n++)this._linework.add(e.getInteriorRingN(n))}},Mf.prototype.interfaces_=function(){return[kc]},Mf.prototype.getClass=function(){return Mf};var Lf=function(){this._g=null,this._doLeft=!0,this._doRight=!0;var t=arguments[0];this._g=t};Lf.prototype.extractPoints=function(t,e,n){for(var r=t.getCoordinates(),i=0;i<r.length-1;i++)this.computeOffsetPoints(r[i],r[i+1],e,n)},Lf.prototype.setSidesToGenerate=function(t,e){this._doLeft=t,this._doRight=e},Lf.prototype.getPoints=function(t){for(var e=new bc,n=bp.getLines(this._g).iterator();n.hasNext();){var r=n.next();this.extractPoints(r,t,e)}return e},Lf.prototype.computeOffsetPoints=function(t,e,n,r){var i=e.x-t.x,o=e.y-t.y,s=Math.sqrt(i*i+o*o),a=n*i/s,u=n*o/s,c=(e.x+t.x)/2,h=(e.y+t.y)/2;if(this._doLeft){var l=new bu(c-u,h+a);r.add(l)}if(this._doRight){var p=new bu(c+u,h-a);r.add(p)}},Lf.prototype.interfaces_=function(){return[]},Lf.prototype.getClass=function(){return Lf};var Pf=function t(){this._geom=null,this._locFinder=null,this._location=new Array(3).fill(null),this._invalidLocation=null,this._boundaryDistanceTolerance=t.TOLERANCE,this._testCoords=new bc;var e=arguments[0],n=arguments[1],r=arguments[2];this._boundaryDistanceTolerance=t.computeBoundaryDistanceTolerance(e,n),this._geom=[e,n,r],this._locFinder=[new Sf(this._geom[0],this._boundaryDistanceTolerance),new Sf(this._geom[1],this._boundaryDistanceTolerance),new Sf(this._geom[2],this._boundaryDistanceTolerance)]},Of={TOLERANCE:{configurable:!0}};Pf.prototype.reportResult=function(t,e,n){Xu.out.println("Overlay result invalid - A:"+Su.toLocationSymbol(e[0])+" B:"+Su.toLocationSymbol(e[1])+" expected:"+(n?"i":"e")+" actual:"+Su.toLocationSymbol(e[2]))},Pf.prototype.isValid=function(t){return this.addTestPts(this._geom[0]),this.addTestPts(this._geom[1]),this.checkValid(t)},Pf.prototype.checkValid=function(){if(1===arguments.length){for(var t=arguments[0],e=0;e<this._testCoords.size();e++){var n=this._testCoords.get(e);if(!this.checkValid(t,n))return this._invalidLocation=n,!1}return!0}if(2===arguments.length){var r=arguments[0],i=arguments[1];return this._location[0]=this._locFinder[0].getLocation(i),this._location[1]=this._locFinder[1].getLocation(i),this._location[2]=this._locFinder[2].getLocation(i),!!Pf.hasLocation(this._location,Su.BOUNDARY)||this.isValidResult(r,this._location)}},Pf.prototype.addTestPts=function(t){var e=new Lf(t);this._testCoords.addAll(e.getPoints(5*this._boundaryDistanceTolerance))},Pf.prototype.isValidResult=function(t,e){var n=Cf.isResultOfOp(e[0],e[1],t),r=!(n^e[2]===Su.INTERIOR);return r||this.reportResult(t,e,n),r},Pf.prototype.getInvalidLocation=function(){return this._invalidLocation},Pf.prototype.interfaces_=function(){return[]},Pf.prototype.getClass=function(){return Pf},Pf.hasLocation=function(t,e){for(var n=0;n<3;n++)if(t[n]===e)return!0;return!1},Pf.computeBoundaryDistanceTolerance=function(t,e){return Math.min(Jp.computeSizeBasedSnapTolerance(t),Jp.computeSizeBasedSnapTolerance(e))},Pf.isValid=function(t,e,n,r){return new Pf(t,e,r).isValid(n)},Of.TOLERANCE.get=function(){return 1e-6},Object.defineProperties(Pf,Of);var Rf=function t(e){this._geomFactory=null,this._skipEmpty=!1,this._inputGeoms=null,this._geomFactory=t.extractFactory(e),this._inputGeoms=e};Rf.prototype.extractElements=function(t,e){if(null===t)return null;for(var n=0;n<t.getNumGeometries();n++){var r=t.getGeometryN(n);this._skipEmpty&&r.isEmpty()||e.add(r)}},Rf.prototype.combine=function(){for(var t=new bc,e=this._inputGeoms.iterator();e.hasNext();){var n=e.next();this.extractElements(n,t)}return 0===t.size()?null!==this._geomFactory?this._geomFactory.createGeometryCollection(null):null:this._geomFactory.buildGeometry(t)},Rf.prototype.interfaces_=function(){return[]},Rf.prototype.getClass=function(){return Rf},Rf.combine=function(){if(1===arguments.length)return new Rf(arguments[0]).combine();if(2===arguments.length){var t=arguments[0],e=arguments[1];return new Rf(Rf.createList(t,e)).combine()}if(3===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2];return new Rf(Rf.createList(n,r,i)).combine()}},Rf.extractFactory=function(t){return t.isEmpty()?null:t.iterator().next().getFactory()},Rf.createList=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1],n=new bc;return n.add(t),n.add(e),n}if(3===arguments.length){var r=arguments[0],i=arguments[1],o=arguments[2],s=new bc;return s.add(r),s.add(i),s.add(o),s}};var Tf=function(){this._inputPolys=null,this._geomFactory=null;var t=arguments[0];this._inputPolys=t,null===this._inputPolys&&(this._inputPolys=new bc)},Af={STRTREE_NODE_CAPACITY:{configurable:!0}};Tf.prototype.reduceToGeometries=function(t){for(var e=new bc,n=t.iterator();n.hasNext();){var r=n.next(),i=null;Lu(r,wc)?i=this.unionTree(r):r instanceof cc&&(i=r),e.add(i)}return e},Tf.prototype.extractByEnvelope=function(t,e,n){for(var r=new bc,i=0;i<e.getNumGeometries();i++){var o=e.getGeometryN(i);o.getEnvelopeInternal().intersects(t)?r.add(o):n.add(o)}return this._geomFactory.buildGeometry(r)},Tf.prototype.unionOptimized=function(t,e){var n=t.getEnvelopeInternal(),r=e.getEnvelopeInternal();if(!n.intersects(r))return Rf.combine(t,e);if(t.getNumGeometries()<=1&&e.getNumGeometries()<=1)return this.unionActual(t,e);var i=n.intersection(r);return this.unionUsingEnvelopeIntersection(t,e,i)},Tf.prototype.union=function(){if(null===this._inputPolys)throw new Error("union() method cannot be called twice");if(this._inputPolys.isEmpty())return null;this._geomFactory=this._inputPolys.iterator().next().getFactory();for(var t=new ol(Tf.STRTREE_NODE_CAPACITY),e=this._inputPolys.iterator();e.hasNext();){var n=e.next();t.insert(n.getEnvelopeInternal(),n)}this._inputPolys=null;var r=t.itemsTree();return this.unionTree(r)},Tf.prototype.binaryUnion=function(){if(1===arguments.length){var t=arguments[0];return this.binaryUnion(t,0,t.size())}if(3===arguments.length){var e=arguments[0],n=arguments[1],r=arguments[2];if(r-n<=1){var i=Tf.getGeometry(e,n);return this.unionSafe(i,null)}if(r-n==2)return this.unionSafe(Tf.getGeometry(e,n),Tf.getGeometry(e,n+1));var o=Math.trunc((r+n)/2),s=this.binaryUnion(e,n,o),a=this.binaryUnion(e,o,r);return this.unionSafe(s,a)}},Tf.prototype.repeatedUnion=function(t){for(var e=null,n=t.iterator();n.hasNext();){var r=n.next();e=null===e?r.copy():e.union(r)}return e},Tf.prototype.unionSafe=function(t,e){return null===t&&null===e?null:null===t?e.copy():null===e?t.copy():this.unionOptimized(t,e)},Tf.prototype.unionActual=function(t,e){return Tf.restrictToPolygons(t.union(e))},Tf.prototype.unionTree=function(t){var e=this.reduceToGeometries(t);return this.binaryUnion(e)},Tf.prototype.unionUsingEnvelopeIntersection=function(t,e,n){var r=new bc,i=this.extractByEnvelope(n,t,r),o=this.extractByEnvelope(n,e,r),s=this.unionActual(i,o);return r.add(s),Rf.combine(r)},Tf.prototype.bufferUnion=function(){if(1===arguments.length){var t=arguments[0];return t.get(0).getFactory().buildGeometry(t).buffer(0)}if(2===arguments.length){var e=arguments[0],n=arguments[1];return e.getFactory().createGeometryCollection([e,n]).buffer(0)}},Tf.prototype.interfaces_=function(){return[]},Tf.prototype.getClass=function(){return Tf},Tf.restrictToPolygons=function(t){if(Lu(t,Qc))return t;var e=wp.getPolygons(t);return 1===e.size()?e.get(0):t.getFactory().createMultiPolygon(_h.toPolygonArray(e))},Tf.getGeometry=function(t,e){return e>=t.size()?null:t.get(e)},Tf.union=function(t){return new Tf(t).union()},Af.STRTREE_NODE_CAPACITY.get=function(){return 4},Object.defineProperties(Tf,Af);var Df=function(){};Df.prototype.interfaces_=function(){return[]},Df.prototype.getClass=function(){return Df},Df.union=function(t,e){if(t.isEmpty()||e.isEmpty()){if(t.isEmpty()&&e.isEmpty())return Cf.createEmptyResult(Cf.UNION,t,e,t.getFactory());if(t.isEmpty())return e.copy();if(e.isEmpty())return t.copy()}return t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),of.overlayOp(t,e,Cf.UNION)};var Ff=function(){return new Yi};Yi.prototype={constructor:Yi,reset:function(){this.s=this.t=0},add:function(t){Vi(qf,t,this.t),Vi(this,qf.s,this.s),this.s?this.t+=qf.t:this.s=qf.t},valueOf:function(){return this.s}};var qf=new Yi,Gf=1e-6,Bf=Math.PI,kf=Bf/2,zf=Bf/4,jf=2*Bf,Xf=180/Bf,Uf=Bf/180,Yf=Math.abs,Vf=Math.atan,Hf=Math.atan2,Wf=Math.cos,Jf=Math.exp,Zf=Math.log,Kf=Math.sin,Qf=Math.sqrt,$f=Math.tan,tg={Feature:function(t,e){Ji(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,i=n.length;++r<i;)Ji(n[r].geometry,e)}},eg={Sphere:function(t,e){e.sphere()},Point:function(t,e){t=t.coordinates,e.point(t[0],t[1],t[2])},MultiPoint:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)t=n[r],e.point(t[0],t[1],t[2])},LineString:function(t,e){Zi(t.coordinates,e,0)},MultiLineString:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)Zi(n[r],e,0)},Polygon:function(t,e){Ki(t.coordinates,e)},MultiPolygon:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)Ki(n[r],e)},GeometryCollection:function(t,e){for(var n=t.geometries,r=-1,i=n.length;++r<i;)Ji(n[r],e)}},ng=function(t,e){t&&tg.hasOwnProperty(t.type)?tg[t.type](t,e):Ji(t,e)},rg=(Ff(),Ff(),Ff(),function(t,e){function n(n,r){return n=t(n,r),e(n[0],n[1])}return t.invert&&e.invert&&(n.invert=function(n,r){return(n=e.invert(n,r))&&t.invert(n[0],n[1])}),n});oo.invert=oo;var ig=function(t){function e(e){return(e=t(e[0]*Uf,e[1]*Uf))[0]*=Xf,e[1]*=Xf,e}return t=so(t[0]*Uf,t[1]*Uf,t.length>2?t[2]*Uf:0),e.invert=function(e){return(e=t.invert(e[0]*Uf,e[1]*Uf))[0]*=Xf,e[1]*=Xf,e},e},og=function(){var t,e=[];return{point:function(e,n){t.push([e,n])},lineStart:function(){e.push(t=[])},lineEnd:Wi,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}},sg=function(t,e,n,r,i,o){var s,a=t[0],u=t[1],c=0,h=1,l=e[0]-a,p=e[1]-u;if(s=n-a,l||!(s>0)){if(s/=l,l<0){if(s<c)return;s<h&&(h=s)}else if(l>0){if(s>h)return;s>c&&(c=s)}if(s=i-a,l||!(s<0)){if(s/=l,l<0){if(s>h)return;s>c&&(c=s)}else if(l>0){if(s<c)return;s<h&&(h=s)}if(s=r-u,p||!(s>0)){if(s/=p,p<0){if(s<c)return;s<h&&(h=s)}else if(p>0){if(s>h)return;s>c&&(c=s)}if(s=o-u,p||!(s<0)){if(s/=p,p<0){if(s>h)return;s>c&&(c=s)}else if(p>0){if(s<c)return;s<h&&(h=s)}return c>0&&(t[0]=a+c*l,t[1]=u+c*p),h<1&&(e[0]=a+h*l,e[1]=u+h*p),!0}}}}},ag=function(t,e){return Yf(t[0]-e[0])<Gf&&Yf(t[1]-e[1])<Gf},ug=function(t,e,n,r,i){var o,s,a=[],u=[];if(t.forEach((function(t){if(!((e=t.length-1)<=0)){var e,n,r=t[0],s=t[e];if(ag(r,s)){for(i.lineStart(),o=0;o<e;++o)i.point((r=t[o])[0],r[1]);i.lineEnd()}else a.push(n=new lo(r,t,null,!0)),u.push(n.o=new lo(r,null,n,!1)),a.push(n=new lo(s,t,null,!1)),u.push(n.o=new lo(s,null,n,!0))}})),a.length){for(u.sort(e),po(a),po(u),o=0,s=u.length;o<s;++o)u[o].e=n=!n;for(var c,h,l=a[0];;){for(var p=l,f=!0;p.v;)if((p=p.n)===l)return;c=p.z,i.lineStart();do{if(p.v=p.o.v=!0,p.e){if(f)for(o=0,s=c.length;o<s;++o)i.point((h=c[o])[0],h[1]);else r(p.x,p.n.x,1,i);p=p.n}else{if(f)for(c=p.p.z,o=c.length-1;o>=0;--o)i.point((h=c[o])[0],h[1]);else r(p.x,p.p.x,-1,i);p=p.p}c=(p=p.o).z,f=!f}while(!p.v);i.lineEnd()}}},cg=function(t,e){return t<e?-1:t>e?1:t>=e?0:NaN},hg=(function(t){1===t.length&&(t=function(t){return function(e,n){return cg(t(e),n)}}(t))}(cg),function(t){for(var e,n,r,i=t.length,o=-1,s=0;++o<i;)s+=t[o].length;for(n=new Array(s);--i>=0;)for(e=(r=t[i]).length;--e>=0;)n[--s]=r[e];return n}),lg=1e9,pg=-lg,fg=Ff(),gg=(Ff(),function(t){return t}),dg=(Ff(),Ff(),1/0),yg=dg,_g=-dg,mg=_g,vg={point:function(t,e){t<dg&&(dg=t),t>_g&&(_g=t),e<yg&&(yg=e),e>mg&&(mg=e)},lineStart:Wi,lineEnd:Wi,polygonStart:Wi,polygonEnd:Wi,result:function(){var t=[[dg,yg],[_g,mg]];return _g=mg=-(yg=dg=1/0),t}},xg=(Ff(),function(t,e,n,r){return function(i,o){function s(e,n){var r=i(e,n);t(e=r[0],n=r[1])&&o.point(e,n)}function a(t,e){var n=i(t,e);y.point(n[0],n[1])}function u(){E.point=a,y.lineStart()}function c(){E.point=s,y.lineEnd()}function h(t,e){d.push([t,e]);var n=i(t,e);v.point(n[0],n[1])}function l(){v.lineStart(),d=[]}function p(){h(d[0][0],d[0][1]),v.lineEnd();var t,e,n,r,i=v.clean(),s=m.result(),a=s.length;if(d.pop(),f.push(d),d=null,a)if(1&i){if((e=(n=s[0]).length-1)>0){for(x||(o.polygonStart(),x=!0),o.lineStart(),t=0;t<e;++t)o.point((r=n[t])[0],r[1]);o.lineEnd()}}else a>1&&2&i&&s.push(s.pop().concat(s.shift())),g.push(s.filter(go))}var f,g,d,y=e(o),_=i.invert(r[0],r[1]),m=og(),v=e(m),x=!1,E={point:s,lineStart:u,lineEnd:c,polygonStart:function(){E.point=h,E.lineStart=l,E.lineEnd=p,g=[],f=[]},polygonEnd:function(){E.point=s,E.lineStart=u,E.lineEnd=c,g=hg(g);var t=function(t,e){var n=e[0],r=e[1],i=[Kf(n),-Wf(n),0],o=0,s=0;fg.reset();for(var a=0,u=t.length;a<u;++a)if(h=(c=t[a]).length)for(var c,h,l=c[h-1],p=l[0],f=l[1]/2+zf,g=Kf(f),d=Wf(f),y=0;y<h;++y,p=m,g=x,d=E,l=_){var _=c[y],m=_[0],v=_[1]/2+zf,x=Kf(v),E=Wf(v),w=m-p,b=w>=0?1:-1,I=b*w,N=I>Bf,C=g*x;if(fg.add(Hf(C*b*Kf(I),d*E+C*Wf(I))),o+=N?w+b*jf:w,N^p>=n^m>=n){var S=eo($i(l),$i(_));io(S);var M=eo(i,S);io(M);var L=(N^w>=0?-1:1)*Hi(M[2]);(r>L||r===L&&(S[0]||S[1]))&&(s+=N^w>=0?1:-1)}}return(o<-Gf||o<Gf&&fg<-Gf)^1&s}(f,_);g.length?(x||(o.polygonStart(),x=!0),ug(g,yo,t,n,o)):t&&(x||(o.polygonStart(),x=!0),o.lineStart(),n(null,null,1,o),o.lineEnd()),x&&(o.polygonEnd(),x=!1),g=f=null},sphere:function(){o.polygonStart(),o.lineStart(),n(null,null,1,o),o.lineEnd(),o.polygonEnd()}};return E}}),Eg=xg((function(){return!0}),(function(t){var e,n=NaN,r=NaN,i=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(o,s){var a=o>0?Bf:-Bf,u=Yf(o-n);Yf(u-Bf)<Gf?(t.point(n,r=(r+s)/2>0?kf:-kf),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(a,r),t.point(o,r),e=0):i!==a&&u>=Bf&&(Yf(n-i)<Gf&&(n-=i*Gf),Yf(o-a)<Gf&&(o-=a*Gf),r=function(t,e,n,r){var i,o,s=Kf(t-n);return Yf(s)>Gf?Vf((Kf(e)*(o=Wf(r))*Kf(n)-Kf(r)*(i=Wf(e))*Kf(t))/(i*o*s)):(e+r)/2}(n,r,o,s),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(a,r),e=0),t.point(n=o,r=s),i=a},lineEnd:function(){t.lineEnd(),n=r=NaN},clean:function(){return 2-e}}}),(function(t,e,n,r){var i;if(null==t)i=n*kf,r.point(-Bf,i),r.point(0,i),r.point(Bf,i),r.point(Bf,0),r.point(Bf,-i),r.point(0,-i),r.point(-Bf,-i),r.point(-Bf,0),r.point(-Bf,i);else if(Yf(t[0]-e[0])>Gf){var o=t[0]<e[0]?Bf:-Bf;i=n*o/2,r.point(-o,i),r.point(0,i),r.point(o,i)}else r.point(e[0],e[1])}),[-Bf,-kf]),wg=function(t,e){function n(t,e){return Wf(t)*Wf(e)>o}function r(t,e,n){var r=[1,0,0],i=eo($i(t),$i(e)),s=to(i,i),a=i[0],u=s-a*a;if(!u)return!n&&t;var c=o*s/u,h=-o*a/u,l=eo(r,i),p=ro(r,c);no(p,ro(i,h));var f=l,g=to(p,f),d=to(f,f),y=g*g-d*(to(p,p)-1);if(!(y<0)){var _=Qf(y),m=ro(f,(-g-_)/d);if(no(m,p),m=Qi(m),!n)return m;var v,x=t[0],E=e[0],w=t[1],b=e[1];E<x&&(v=x,x=E,E=v);var I=E-x,N=Yf(I-Bf)<Gf;if(!N&&b<w&&(v=w,w=b,b=v),N||I<Gf?N?w+b>0^m[1]<(Yf(m[0]-x)<Gf?w:b):w<=m[1]&&m[1]<=b:I>Bf^(x<=m[0]&&m[0]<=E)){var C=ro(f,(-g+_)/d);return no(C,p),[m,Qi(C)]}}}function i(e,n){var r=s?t:Bf-t,i=0;return e<-r?i|=1:e>r&&(i|=2),n<-r?i|=4:n>r&&(i|=8),i}var o=Wf(t),s=o>0,a=Yf(o)>Gf;return xg(n,(function(t){var e,o,u,c,h;return{lineStart:function(){c=u=!1,h=1},point:function(l,p){var f,g=[l,p],d=n(l,p),y=s?d?0:i(l,p):d?i(l+(l<0?Bf:-Bf),p):0;if(!e&&(c=u=d)&&t.lineStart(),d!==u&&(!(f=r(e,g))||ag(e,f)||ag(g,f))&&(g[0]+=Gf,g[1]+=Gf,d=n(g[0],g[1])),d!==u)h=0,d?(t.lineStart(),f=r(g,e),t.point(f[0],f[1])):(f=r(e,g),t.point(f[0],f[1]),t.lineEnd()),e=f;else if(a&&e&&s^d){var _;y&o||!(_=r(g,e,!0))||(h=0,s?(t.lineStart(),t.point(_[0][0],_[0][1]),t.point(_[1][0],_[1][1]),t.lineEnd()):(t.point(_[1][0],_[1][1]),t.lineEnd(),t.lineStart(),t.point(_[0][0],_[0][1])))}!d||e&&ag(e,g)||t.point(g[0],g[1]),e=g,u=d,o=y},lineEnd:function(){u&&t.lineEnd(),e=null},clean:function(){return h|(c&&u)<<1}}}),(function(n,r,i,o){!function(t,e,n,r,i,o){if(n){var s=Wf(e),a=Kf(e),u=r*n;null==i?(i=e+r*jf,o=e-u/2):(i=ho(s,i),o=ho(s,o),(r>0?i<o:i>o)&&(i+=r*jf));for(var c,h=i;r>0?h>o:h<o;h-=u)c=Qi([s,-a*Wf(h),-a*Kf(h)]),t.point(c[0],c[1])}}(o,t,e,i,n,r)}),s?[0,-t]:[-Bf,t-Bf])};mo.prototype={constructor:mo,point:function(t,e){this.stream.point(t,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var bg=16,Ig=Wf(30*Uf),Ng=function(t,e){return+e?function(t,e){function n(r,i,o,s,a,u,c,h,l,p,f,g,d,y){var _=c-r,m=h-i,v=_*_+m*m;if(v>4*e&&d--){var x=s+p,E=a+f,w=u+g,b=Qf(x*x+E*E+w*w),I=Hi(w/=b),N=Yf(Yf(w)-1)<Gf||Yf(o-l)<Gf?(o+l)/2:Hf(E,x),C=t(N,I),S=C[0],M=C[1],L=S-r,P=M-i,O=m*L-_*P;(O*O/v>e||Yf((_*L+m*P)/v-.5)>.3||s*p+a*f+u*g<Ig)&&(n(r,i,o,s,a,u,S,M,N,x/=b,E/=b,w,d,y),y.point(S,M),n(S,M,N,x,E,w,c,h,l,p,f,g,d,y))}}return function(e){function r(n,r){n=t(n,r),e.point(n[0],n[1])}function i(){_=NaN,w.point=o,e.lineStart()}function o(r,i){var o=$i([r,i]),s=t(r,i);n(_,m,y,v,x,E,_=s[0],m=s[1],y=r,v=o[0],x=o[1],E=o[2],bg,e),e.point(_,m)}function s(){w.point=r,e.lineEnd()}function a(){i(),w.point=u,w.lineEnd=c}function u(t,e){o(h=t,e),l=_,p=m,f=v,g=x,d=E,w.point=o}function c(){n(_,m,y,v,x,E,l,p,h,f,g,d,bg,e),w.lineEnd=s,s()}var h,l,p,f,g,d,y,_,m,v,x,E,w={point:r,lineStart:i,lineEnd:s,polygonStart:function(){e.polygonStart(),w.lineStart=a},polygonEnd:function(){e.polygonEnd(),w.lineStart=i}};return w}}(t,e):function(t){return _o({point:function(e,n){e=t(e,n),this.stream.point(e[0],e[1])}})}(t)},Cg=_o({point:function(t,e){this.stream.point(t*Uf,e*Uf)}});Eo.invert=function(t,e){return[t,2*Vf(Jf(e))-kf]},wo.invert=function(t,e){return[-e,2*Vf(Jf(t))-kf]};var Sg=function(){var t=function(t){function e(){var e=Bf*a(),s=o(ig(o.rotate()).invert([0,0]));return c(null==h?[[s[0]-e,s[1]-e],[s[0]+e,s[1]+e]]:t===Eo?[[Math.max(s[0]-e,h),n],[Math.min(s[0]+e,r),i]]:[[h,Math.max(s[1]-e,n)],[r,Math.min(s[1]+e,i)]])}var n,r,i,o=xo(t),s=o.center,a=o.scale,u=o.translate,c=o.clipExtent,h=null;return o.scale=function(t){return arguments.length?(a(t),e()):a()},o.translate=function(t){return arguments.length?(u(t),e()):u()},o.center=function(t){return arguments.length?(s(t),e()):s()},o.clipExtent=function(t){return arguments.length?(null==t?h=n=r=i=null:(h=+t[0][0],n=+t[0][1],r=+t[1][0],i=+t[1][1]),e()):null==h?null:[[h,n],[r,i]]},e()}(wo),e=t.center,n=t.rotate;return t.center=function(t){return arguments.length?e([-t[1],t[0]]):[(t=e())[1],-t[0]]},t.rotate=function(t){return arguments.length?n([t[0],t[1],t.length>2?t[2]+90:90]):[(t=n())[0],t[1],t[2]-90]},n([0,0,90]).scale(159.155)};t.projection=Cs,t.random=gu,t.clusters=du,t.helpers=ko,t.invariant=jo,t.meta=zo,t.isolines=function(t,e,n){if(!I(n=n||{}))throw new Error("options is invalid");var r=n.zProperty||"elevation",i=n.commonProperties||{},o=n.breaksProperties||[];if(W(t,"Point","Input must contain Points"),!e)throw new Error("breaks is required");if(!Array.isArray(e))throw new Error("breaks must be an Array");if(!I(i))throw new Error("commonProperties must be an Object");if(!Array.isArray(o))throw new Error("breaksProperties must be an Array");var s=rt(t,{zProperty:r,flip:!0});return c(function(t,e,n){var r=j(n),i=r[2]-r[0],o=r[3]-r[1],s=r[0],a=r[1],u=e[0].length-1,c=e.length-1,h=i/u,l=o/c,p=function(t){t[0]=t[0]*h+s,t[1]=t[1]*l+a};return t.forEach((function(t){S(t,p)})),t}(function(t,e,n,r,i){for(var o=[],s=1;s<e.length;s++){var a=+e[s],u=Object.assign({},r,i[s]);u[n]=a;var c=h(Q(t,a),u);o.push(c)}return o}(s,e,r,i,o),s,t))},t.convex=Lt,t.pointsWithinPolygon=Rt,t.concave=function(t,n){if(!I(n=n||{}))throw new Error("options is invalid");if(!t)throw new Error("points is required");var r=n.maxEdge||1/0;if(!b(r))throw new Error("maxEdge is invalid");var i=Tt(function(t){var e=[],n={};return O(t,(function(t){if(t.geometry){var r=t.geometry.coordinates.join("-");n.hasOwnProperty(r)||(e.push(t),n[r]=!0)}})),c(e)}(t));if(i.features=i.features.filter((function(t){var e=t.geometry.coordinates[0][0],i=t.geometry.coordinates[0][1],o=t.geometry.coordinates[0][2],s=qt(e,i,n),a=qt(i,o,n),u=qt(e,o,n);return s<=r&&a<=r&&u<=r})),i.features.length<1)return null;var o=$t(i,n);return 1===o.coordinates.length&&(o.coordinates=o.coordinates[0],o.type="Polygon"),e(o)},t.collect=function(t,e,n,r){var i=Vo(6),o=e.features.map((function(t){return{minX:t.geometry.coordinates[0],minY:t.geometry.coordinates[1],maxX:t.geometry.coordinates[0],maxY:t.geometry.coordinates[1],property:t.properties[n]}}));return i.load(o),t.features.forEach((function(t){t.properties||(t.properties={});var e=j(t),n=[];i.search({minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]}).forEach((function(e){Pt([e.minX,e.minY],t)&&n.push(e.property)})),t.properties[r]=n})),t},t.flip=function(t,e){if(!I(e=e||{}))throw new Error("options is invalid");var n=e.mutate;if(!t)throw new Error("geojson is required");return!1!==n&&void 0!==n||(t=Gt(t)),S(t,(function(t){var e=t[0],n=t[1];t[0]=n,t[1]=e})),t},t.simplify=function(t,e){if(!I(e=e||{}))throw new Error("options is invalid");var n=void 0!==e.tolerance?e.tolerance:1,r=e.highQuality||!1,i=e.mutate||!1;if(!t)throw new Error("geojson is required");if(n&&n<0)throw new Error("invalid tolerance");return!0!==i&&(t=Gt(t)),A(t,(function(t){!function(t,e,n){var r=t.type;if("Point"===r||"MultiPoint"===r)return t;te(t,!0);var i=t.coordinates;switch(r){case"LineString":t.coordinates=se(i,e,n);break;case"MultiLineString":t.coordinates=i.map((function(t){return se(t,e,n)}));break;case"Polygon":t.coordinates=ae(i,e,n);break;case"MultiPolygon":t.coordinates=i.map((function(t){return ae(t,e,n)}))}}(t,n,r)})),t},t.bezierSpline=ue,t.tag=function(t,e,n,r){return t=Gt(t),e=Gt(e),O(t,(function(t){t.properties||(t.properties={}),O(e,(function(e){void 0===t.properties[r]&&Pt(t,e)&&(t.properties[r]=e.properties[n])}))})),t},t.sample=function(t,e){if(!t)throw new Error("featurecollection is required");if(null===e||void 0===e)throw new Error("num is required");if("number"!=typeof e)throw new Error("num must be a number");return c(function(t,e){for(var n,r,i=t.slice(0),o=t.length,s=o-e;o-- >s;)n=i[r=Math.floor((o+1)*Math.random())],i[r]=i[o],i[o]=n;return i.slice(s)}(t.features,e))},t.envelope=he,t.square=le,t.circle=fe,t.midpoint=function(t,e){return pe(t,qt(t,e)/2,ge(t,e))},t.center=de,t.centerOfMass=_e,t.centroid=ye,t.combine=function(t){function n(t,e,n){n?r[e].coordinates=r[e].coordinates.concat(t.geometry.coordinates):r[e].coordinates.push(t.geometry.coordinates),r[e].properties.push(t.properties)}var r={MultiPoint:{coordinates:[],properties:[]},MultiLineString:{coordinates:[],properties:[]},MultiPolygon:{coordinates:[],properties:[]}},i=Object.keys(r).reduce((function(t,e){return t[e.replace("Multi","")]=e,t}),{});return O(t,(function(t){t.geometry&&(r[t.geometry.type]?n(t,t.geometry.type,!0):i[t.geometry.type]&&n(t,i[t.geometry.type],!1))})),c(Object.keys(r).filter((function(t){return r[t].coordinates.length})).sort().map((function(t){return e({type:t,coordinates:r[t].coordinates},{collectedProperties:r[t].properties})})))},t.distance=qt,t.explode=me,t.bbox=j,t.tesselate=function(t){if(!t.geometry||"Polygon"!==t.geometry.type&&"MultiPolygon"!==t.geometry.type)throw new Error("input must be a Polygon or MultiPolygon");var e={type:"FeatureCollection",features:[]};return"Polygon"===t.geometry.type?e.features=De(t.geometry.coordinates):t.geometry.coordinates.forEach((function(t){e.features=e.features.concat(De(t))})),e},t.bboxPolygon=ce,t.booleanPointInPolygon=Pt,t.nearestPoint=Fe,t.nearestPointOnLine=on,t.nearestPointToLine=function(t,e,n){if(!I(n=n||{}))throw new Error("options is invalid");var r=n.units,i=n.properties||{};if(!t)throw new Error("points is required");if(!(t=function(t){var e=[];switch(t.geometry?t.geometry.type:t.type){case"GeometryCollection":return A(t,(function(t){"Point"===t.type&&e.push({type:"Feature",properties:{},geometry:t})})),{type:"FeatureCollection",features:e};case"FeatureCollection":return t.features=t.features.filter((function(t){return"Point"===t.geometry.type})),t;default:throw new Error("points must be a Point Collection")}}(t)).features.length)throw new Error("points must contain features");if(!e)throw new Error("line is required");if("LineString"!==K(e))throw new Error("line must be a LineString");var o=1/0,s=null;return O(t,(function(t){var n=gn(t,e,{units:r});n<o&&(o=n,s=t)})),s&&(s.properties=Object.assign({dist:o},s.properties,i)),s},t.planepoint=function(t,e){var n=X(t),r=J(e).coordinates[0];if(r.length<4)throw new Error("OuterRing of a Polygon must have 4 or more Positions.");var i=e.properties||{},o=i.a,s=i.b,a=i.c,u=n[0],c=n[1],h=r[0][0],l=r[0][1],p=void 0!==o?o:r[0][2],f=r[1][0],g=r[1][1],d=void 0!==s?s:r[1][2],y=r[2][0],_=r[2][1],m=void 0!==a?a:r[2][2];return(m*(u-h)*(c-g)+p*(u-f)*(c-_)+d*(u-y)*(c-l)-d*(u-h)*(c-_)-m*(u-f)*(c-l)-p*(u-y)*(c-g))/((u-h)*(c-g)+(u-f)*(c-_)+(u-y)*(c-l)-(u-h)*(c-_)-(u-f)*(c-l)-(u-y)*(c-g))},t.tin=Tt,t.bearing=ge,t.destination=pe,t.kinks=function(t){var e,n,i={type:"FeatureCollection",features:[]};if("LineString"===(n="Feature"===t.type?t.geometry:t).type)e=[n.coordinates];else if("MultiLineString"===n.type)e=n.coordinates;else if("MultiPolygon"===n.type)e=[].concat.apply([],n.coordinates);else{if("Polygon"!==n.type)throw new Error("Input must be a LineString, MultiLineString, Polygon, or MultiPolygon Feature or Geometry");e=n.coordinates}return e.forEach((function(t){e.forEach((function(e){for(var n=0;n<t.length-1;n++)for(var o=n;o<e.length-1;o++){if(t===e){if(1===Math.abs(n-o))continue;if(0===n&&o===t.length-2&&t[n][0]===t[t.length-1][0]&&t[n][1]===t[t.length-1][1])continue}var s=function(t,e,n,r,i,o,s,a){var u,c,h,l,p={x:null,y:null,onLine1:!1,onLine2:!1};return 0==(u=(a-o)*(n-t)-(s-i)*(r-e))?null!==p.x&&null!==p.y&&p:(l=(n-t)*(c=e-o)-(r-e)*(h=t-i),c=((s-i)*c-(a-o)*h)/u,h=l/u,p.x=t+c*(n-t),p.y=e+c*(r-e),c>=0&&c<=1&&(p.onLine1=!0),h>=0&&h<=1&&(p.onLine2=!0),!(!p.onLine1||!p.onLine2)&&[p.x,p.y])}(t[n][0],t[n][1],t[n+1][0],t[n+1][1],e[o][0],e[o][1],e[o+1][0],e[o+1][1]);s&&i.features.push(r([s[0],s[1]]))}}))})),i},t.pointOnFeature=yn,t.area=mn,t.along=function(t,e,n){if(!I(n=n||{}))throw new Error("options is invalid");var i;if("Feature"===t.type)i=t.geometry.coordinates;else{if("LineString"!==t.type)throw new Error("input must be a LineString Feature or Geometry");i=t.coordinates}if(!b(e))throw new Error("distance must be a number");for(var o=0,s=0;s<i.length&&!(e>=o&&s===i.length-1);s++){if(o>=e){var a=e-o;if(a){var u=ge(i[s],i[s-1])-180;return pe(i[s],a,u,n)}return r(i[s])}o+=qt(i[s],i[s+1],n)}return r(i[i.length-1])},t.length=bn,t.lineSlice=function(t,e,n){var r=U(n);if("LineString"!==K(n))throw new Error("line must be a LineString");for(var i,o=on(n,t),s=on(n,e),u=[(i=o.properties.index<=s.properties.index?[o,s]:[s,o])[0].geometry.coordinates],c=i[0].properties.index+1;c<i[1].properties.index+1;c++)u.push(r[c]);return u.push(i[1].geometry.coordinates),a(u,n.properties)},t.lineSliceAlong=In,t.pointGrid=Ln,t.truncate=Pn,t.flatten=function(t){if(!t)throw new Error("geojson is required");var e=[];return F(t,(function(t){e.push(t)})),c(e)},t.lineIntersect=nn,t.lineChunk=function(t,e,n){if(!I(n=n||{}))throw new Error("options is invalid");var r=n.units,i=n.reverse;if(!t)throw new Error("geojson is required");if(e<=0)throw new Error("segmentLength must be greater than 0");var o=[];return F(t,(function(t){i&&(t.geometry.coordinates=t.geometry.coordinates.reverse()),function(t,e,n,r){var i=bn(t,{units:n});if(i<=e)return r(t);var o=i/e;Number.isInteger(o)||(o=Math.floor(o)+1);for(var s=0;s<o;s++)r(In(t,e*s,e*(s+1),{units:n}),s)}(t,e,r,(function(t){o.push(t)}))})),c(o)},t.unkinkPolygon=function(t){var e=[];return F(t,(function(t){"Polygon"===t.geometry.type&&O(Ls(t),(function(n){e.push(o(n.geometry.coordinates,t.properties))}))})),c(e)},t.greatCircle=function(t,e,n){if("object"!=typeof(n=n||{}))throw new Error("options is invalid");var r=n.properties,i=n.npoints,o=n.offset;return t=X(t),e=X(e),r=r||{},i=i||100,o=o||10,new qs({x:t[0],y:t[1]},{x:e[0],y:e[1]},r).Arc(i,{offset:o}).json()},t.lineSegment=en,t.lineSplit=function(t,e){if(!t)throw new Error("line is required");if(!e)throw new Error("splitter is required");var n=K(t),r=K(e);if("LineString"!==n)throw new Error("line must be LineString");if("FeatureCollection"===r)throw new Error("splitter cannot be a FeatureCollection");if("GeometryCollection"===r)throw new Error("splitter cannot be a GeometryCollection");var i=Pn(e,{precision:7});switch(r){case"Point":return Dn(t,i);case"MultiPoint":return An(t,i);case"LineString":case"MultiLineString":case"Polygon":case"MultiPolygon":return An(t,nn(t,i))}},t.lineArc=Gn,t.polygonToLine=kn,t.lineToPolygon=jn,t.bboxClip=function(t,e){var n=function(t){return t.geometry?t.geometry.type:t.type}(t),r=U(t),i=t.properties;switch(n){case"LineString":case"MultiLineString":var s=[];return"LineString"===n&&(r=[r]),r.forEach((function(t){Gs(t,e,s)})),1===s.length?a(s[0],i):h(s,i);case"Polygon":return o(Wn(r,e),i);case"MultiPolygon":return p(r.map((function(t){return Wn(t,e)})),i);default:throw new Error("geometry "+n+" not supported")}},t.lineOverlap=$n,t.sector=function(t,e,n,r,i){if(!I(i=i||{}))throw new Error("options is invalid");if(!t)throw new Error("center is required");if(void 0===n||null===n)throw new Error("bearing1 is required");if(void 0===r||null===r)throw new Error("bearing2 is required");if(!e)throw new Error("radius is required");if("object"!=typeof i)throw new Error("options must be an object");if(er(n)===er(r))return fe(t,e,i);var s=U(t),a=[[s]];return S(Gn(t,e,n,r,i),(function(t){a[0].push(t)})),a[0].push(s),o(a)},t.rhumbBearing=sn,t.rhumbDistance=un,t.rhumbDestination=nr,t.polygonTangents=function(t,e){var n,i,o,s=U(t),a=U(e);switch(K(e)){case"Polygon":n=a[0][0],i=a[0][0],o=ir(a[0][0],a[0][a[0].length-1],s);var u=rr(a[0],s,o,void 0,n,i);n=u[0],i=u[1];break;case"MultiPolygon":n=a[0][0][0],i=a[0][0][0],o=ir(a[0][0][0],a[0][0][a[0][0].length-1],s),a.forEach((function(t){var e=rr(t[0],s,o,void 0,n,i);n=e[0],i=e[1]}))}return c([r(n),r(i)])},t.rewind=function(t,e){if(!I(e=e||{}))throw new Error("options is invalid");var n=e.reverse||!1,r=e.mutate||!1;if(!t)throw new Error("<geojson> is required");if("boolean"!=typeof n)throw new Error("<reverse> must be a boolean");if("boolean"!=typeof r)throw new Error("<mutate> must be a boolean");!1===r&&(t=Gt(t));var i=[];switch(t.type){case"GeometryCollection":return A(t,(function(t){sr(t,n)})),t;case"FeatureCollection":return O(t,(function(t){O(sr(t,n),(function(t){i.push(t)}))})),c(i)}return sr(t,n)},t.isobands=function(t,e,n){if(!I(n=n||{}))throw new Error("options is invalid");var r=n.zProperty||"elevation",i=n.commonProperties||{},s=n.breaksProperties||[];if(W(t,"Point","Input must contain Points"),!e)throw new Error("breaks is required");if(!Array.isArray(e))throw new Error("breaks is not an Array");if(!I(i))throw new Error("commonProperties is not an Object");if(!Array.isArray(s))throw new Error("breaksProperties is not an Array");var a=cr(t,{zProperty:r,flip:!0}),u=function(t,e,n){for(var r=[],i=1;i<e.length;i++){var s=+e[i-1],a=+e[i],u=function(t){var e=[],n=[];t.forEach((function(t){var r=mn(o([t]));n.push(r),e.push({ring:t,area:r})})),n.sort((function(t,e){return e-t}));var r=[];return n.forEach((function(t){for(var n=0;n<e.length;n++)if(e[n].area===t){r.push(e[n].ring),e.splice(n,1);break}})),r}(hr(t,s,a-s)),c=function(t){for(var e=t.map((function(t){return{lrCoordinates:t,grouped:!1}})),n=[];!function(t){for(var e=0;e<t.length;e++)if(!1===t[e].grouped)return!1;return!0}(e);)for(var r=0;r<e.length;r++)if(!e[r].grouped){var i=[];i.push(e[r].lrCoordinates),e[r].grouped=!0;for(var s=o([e[r].lrCoordinates]),a=r+1;a<e.length;a++)e[a].grouped||function(t,e){for(var n=me(t),r=0;r<n.features.length;r++)if(!Pt(n.features[r],e))return!1;return!0}(o([e[a].lrCoordinates]),s)&&(i.push(e[a].lrCoordinates),e[a].grouped=!0);n.push(i)}return n}(u),h={};h.groupedRings=c,h[n]=s+"-"+a,r.push(h)}return r}(a,e,r);return c((u=function(t,e,n){var r=j(n),i=r[2]-r[0],o=r[3]-r[1],s=r[0],a=r[1],u=e[0].length-1,c=e.length-1,h=i/u,l=o/c,p=function(t){t[0]=t[0]*h+s,t[1]=t[1]*l+a};return t.forEach((function(t){t.groupedRings.forEach((function(t){t.forEach((function(t){t.forEach(p)}))}))})),t}(u,a,t)).map((function(t,e){if(s[e]&&!I(s[e]))throw new Error("Each mappedProperty is required to be an Object");var n=Object.assign({},i,s[e]);return n[r]=t[r],p(t.groupedRings,n)})))},t.transformRotate=fr,t.transformScale=gr,t.transformTranslate=function(t,e,n,r){if(!I(r=r||{}))throw new Error("options is invalid");var i=r.units,o=r.zTranslation,s=r.mutate;if(!t)throw new Error("geojson is required");if(void 0===e||null===e||isNaN(e))throw new Error("distance is required");if(o&&"number"!=typeof o&&isNaN(o))throw new Error("zTranslation is not a number");if(o=void 0!==o?o:0,0===e&&0===o)return t;if(void 0===n||null===n||isNaN(n))throw new Error("direction is required");return e<0&&(e=-e,n=-n),!1!==s&&void 0!==s||(t=Gt(t)),S(t,(function(t){var r=U(nr(t,e,n,{units:i}));t[0]=r[0],t[1]=r[1],o&&3===t.length&&(t[2]+=o)})),t},t.lineOffset=function(t,e,n){if(!I(n=n||{}))throw new Error("options is invalid");var r=n.units;if(!t)throw new Error("geojson is required");if(void 0===e||null===e||isNaN(e))throw new Error("distance is required");var i=K(t),o=t.properties;switch(i){case"LineString":return vr(t,e,r);case"MultiLineString":var s=[];return F(t,(function(t){s.push(vr(t,e,r).geometry.coordinates)})),h(s,o);default:throw new Error("geometry "+i+" is not supported")}},t.polygonize=function(t){var e=qa.fromGeoJson(t);e.deleteDangles(),e.deleteCutEdges();var n=[],r=[];return e.getEdgeRings().filter((function(t){return t.isValid()})).forEach((function(t){t.isHole()?n.push(t):r.push(t)})),n.forEach((function(t){Da.findEdgeRingContaining(t,r)&&r.push(t)})),c(r.map((function(t){return t.toPolygon()})))},t.booleanDisjoint=function(t,e){var n;return F(t,(function(t){F(e,(function(e){if(!1===n)return!1;n=function(t,e){switch(t.type){case"Point":switch(e.type){case"Point":return!function(t,e){return t[0]===e[0]&&t[1]===e[1]}(t.coordinates,e.coordinates);case"LineString":return!wr(e,t);case"Polygon":return!Pt(t,e)}break;case"LineString":switch(e.type){case"Point":return!wr(t,e);case"LineString":return!function(t,e){return nn(t,e).features.length>0}(t,e);case"Polygon":return!br(e,t)}break;case"Polygon":switch(e.type){case"Point":return!Pt(e,t);case"LineString":return!br(t,e);case"Polygon":return!function(t,e){for(var n=0;n<t.coordinates[0].length;n++)if(Pt(t.coordinates[0][n],e))return!0;for(var r=0;r<e.coordinates[0].length;r++)if(Pt(e.coordinates[0][r],t))return!0;return!1}(e,t)}}}(t.geometry,e.geometry)}))})),n},t.booleanContains=function(t,e){var n=K(t),r=K(e),i=J(t),o=J(e),s=U(t),a=U(e);switch(n){case"Point":if("Point"===r)return Nr(s,a);throw new Error("feature2 "+r+" geometry not supported");case"MultiPoint":switch(r){case"Point":return function(t,e){var n,r=!1;for(n=0;n<t.coordinates.length;n++)if(Nr(t.coordinates[n],e.coordinates)){r=!0;break}return r}(i,o);case"MultiPoint":return function(t,e){for(var n=0;n<e.coordinates.length;n++){for(var r=!1,i=0;i<t.coordinates.length;i++)if(Nr(e.coordinates[n],t.coordinates[i])){r=!0;break}if(!r)return!1}return!0}(i,o);default:throw new Error("feature2 "+r+" geometry not supported")}case"LineString":switch(r){case"Point":return Nn(o,i,{ignoreEndVertices:!0});case"LineString":return function(t,e){for(var n=!1,r=0;r<e.coordinates.length;r++)if(Nn({type:"Point",coordinates:e.coordinates[r]},t,{ignoreEndVertices:!0})&&(n=!0),!Nn({type:"Point",coordinates:e.coordinates[r]},t,{ignoreEndVertices:!1}))return!1;return n}(i,o);case"MultiPoint":return function(t,e){for(var n=!1,r=0;r<e.coordinates.length;r++)if(Nn(e.coordinates[r],t,{ignoreEndVertices:!0})&&(n=!0),!Nn(e.coordinates[r],t))return!1;return!!n}(i,o);default:throw new Error("feature2 "+r+" geometry not supported")}case"Polygon":switch(r){case"Point":return Pt(o,i,{ignoreBoundary:!0});case"LineString":return function(t,e){var n=!1,r=0;if(!Ir(j(t),j(e)))return!1;for(;r<e.coordinates.length-1;r++){var i=function(t,e){return[(t[0]+e[0])/2,(t[1]+e[1])/2]}(e.coordinates[r],e.coordinates[r+1]);if(Pt({type:"Point",coordinates:i},t,{ignoreBoundary:!0})){n=!0;break}}return n}(i,o);case"Polygon":return function(t,e){if(!Ir(j(t),j(e)))return!1;for(var n=0;n<e.coordinates[0].length;n++)if(!Pt(e.coordinates[0][n],t))return!1;return!0}(i,o);case"MultiPoint":return function(t,e){for(var n=0;n<e.coordinates.length;n++)if(!Pt(e.coordinates[n],t,{ignoreBoundary:!0}))return!1;return!0}(i,o);default:throw new Error("feature2 "+r+" geometry not supported")}default:throw new Error("feature1 "+n+" geometry not supported")}},t.booleanCrosses=function(t,e){var n=K(t),r=K(e),i=J(t),o=J(e);switch(n){case"MultiPoint":switch(r){case"LineString":return Cr(i,o);case"Polygon":return Mr(i,o);default:throw new Error("feature2 "+r+" geometry not supported")}case"LineString":switch(r){case"MultiPoint":return Cr(o,i);case"LineString":return function(t,e){if(nn(t,e).features.length>0)for(var n=0;n<t.coordinates.length-1;n++)for(var r=0;r<e.coordinates.length-1;r++){var i=!0;if(0!==r&&r!==e.coordinates.length-2||(i=!1),Lr(t.coordinates[n],t.coordinates[n+1],e.coordinates[r],i))return!0}return!1}(i,o);case"Polygon":return Sr(i,o);default:throw new Error("feature2 "+r+" geometry not supported")}case"Polygon":switch(r){case"MultiPoint":return Mr(o,i);case"LineString":return Sr(o,i);default:throw new Error("feature2 "+r+" geometry not supported")}default:throw new Error("feature1 "+n+" geometry not supported")}},t.booleanClockwise=or,t.booleanOverlap=Tr,t.booleanPointOnLine=Nn,t.booleanEqual=function(t,e){if(!t)throw new Error("feature1 is required");if(!e)throw new Error("feature2 is required");return K(t)===K(e)&&new ja({precision:6}).compare(te(t),te(e))},t.booleanWithin=Cn,t.clone=Gt,t.cleanCoords=te,t.clustersDbscan=function(t,e,n){if("object"!=typeof(n=n||{}))throw new Error("options is invalid");var r=n.minPoints,i=n.units;if(W(t,"Point","Input must contain Points"),null===e||void 0===e)throw new Error("maxDistance is required");if(!(Math.sign(e)>0))throw new Error("Invalid maxDistance");if(!(void 0===r||null===r||Math.sign(r)>0))throw new Error("Invalid minPoints");t=Gt(t),r=r||3;var o=new Ha.DBSCAN,s=-1;return o.run(T(t),E(e,i),r,qt).forEach((function(e){s++,e.forEach((function(e){var n=t.features[e];n.properties||(n.properties={}),n.properties.cluster=s,n.properties.dbscan="core"}))})),o.noise.forEach((function(e){var n=t.features[e];n.properties||(n.properties={}),n.properties.cluster?n.properties.dbscan="edge":n.properties.dbscan="noise"})),t},t.clustersKmeans=function(t,e){if("object"!=typeof(e=e||{}))throw new Error("options is invalid");var n=e.numberOfClusters,r=e.mutate;W(t,"Point","Input must contain Points");var i=t.features.length;(n=n||Math.round(Math.sqrt(i/2)))>i&&(n=i),!1!==r&&void 0!==r||(t=Gt(t));var o=T(t),s=o.slice(0,n),a=eu(o,n,s),u={};return a.centroids.forEach((function(t,e){u[e]=t})),O(t,(function(t,e){var n=a.idxs[e];t.properties.cluster=n,t.properties.centroid=u[n]})),t},t.pointToLineDistance=gn,t.booleanParallel=function(t,e){if(!t)throw new Error("line1 is required");if(!e)throw new Error("line2 is required");if("LineString"!==Dr(t,"line1"))throw new Error("line1 must be a LineString");if("LineString"!==Dr(e,"line2"))throw new Error("line2 must be a LineString");for(var n=en(te(t)).features,r=en(te(e)).features,i=0;i<n.length;i++){var o=n[i].geometry.coordinates;if(!r[i])break;if(!function(t,e){return m(sn(t[0],t[1]))===m(sn(e[0],e[1]))}(o,r[i].geometry.coordinates))return!1}return!0},t.shortestPath=function(t,n,i){if(!I(i=i||{}))throw new Error("options is invalid");var o=i.resolution,s=i.minDistance,u=i.obstacles||c([]);if(!t)throw new Error("start is required");if(!n)throw new Error("end is required");if(o&&!b(o)||o<=0)throw new Error("options.resolution must be a number, greater than 0");if(s)throw new Error("options.minDistance is not yet implemented");var h=X(t),l=X(n);switch(t=r(h),n=r(l),K(u)){case"FeatureCollection":if(0===u.features.length)return a([h,l]);break;case"Polygon":u=c([e(J(u))]);break;default:throw new Error("invalid obstacles")}var p=u;p.features.push(t),p.features.push(n);var f=j(gr(ce(j(p)),1.15));o||(o=qt([f[0],f[1]],[f[2],f[1]],i)/100),p.features.pop(),p.features.pop();for(var g=f[0],d=f[1],y=f[2],_=f[3],m=o/qt([g,d],[y,d],i)*(y-g),v=o/qt([g,d],[g,_],i)*(_-d),x=y-g,E=_-d,w=(x-Math.floor(x/m)*m)/2,N=[],C=[],S=[],M=[],L=1/0,P=1/0,O=_-(E-Math.floor(E/v)*v)/2,R=0;O>=d;){for(var T=[],A=[],D=g+w,F=0;D<=y;){var q=r([D,O]),G=function(t,e){for(var n=0;n<e.features.length;n++)if(Pt(t,e.features[n]))return!0;return!1}(q,u);T.push(G?0:1),A.push(D+"|"+O);var B=qt(q,t);!G&&B<L&&(L=B,S={x:F,y:R});var k=qt(q,n);!G&&k<P&&(P=k,M={x:F,y:R}),D+=m,F++}C.push(T),N.push(A),O-=v,R++}var z=new qr(C,{diagonal:!0}),U=z.grid[S.y][S.x],Y=z.grid[M.y][M.x],V=[h];return nu.search(z,U,Y).forEach((function(t){var e=N[t.x][t.y].split("|");V.push([+e[0],+e[1]])})),V.push(l),te(a(V))},t.voronoi=function(t,e){if(!I(e=e||{}))throw new Error("options is invalid");var n=e.bbox||[-180,-85,180,85];if(!t)throw new Error("points is required");if(!Array.isArray(n))throw new Error("bbox is invalid");return W(t,"Point","points"),c(fu().x((function(t){return t.geometry.coordinates[0]})).y((function(t){return t.geometry.coordinates[1]})).extent([[n[0],n[1]],[n[2],n[3]]]).polygons(t.features).map(li))},t.ellipse=pi,t.centerMean=gi,t.centerMedian=function(t,e){if(!I(e=e||{}))throw new Error("options is invalid");var n=e.counter||10;if(!b(n))throw new Error("counter must be a number");var r=e.weight,i=gi(t,{weight:e.weight}),o=c([]);return O(t,(function(t){o.features.push(ye(t,{weight:t.properties[r]}))})),o.properties={tolerance:e.tolerance,medianCandidates:[]},di(i.geometry.coordinates,[0,0],o,n)},t.standardDeviationalEllipse=function(t,e){if(!I(e=e||{}))throw new Error("options is invalid");var n=e.steps||64,r=e.weight,i=e.properties||{};if(!b(n))throw new Error("steps must be a number");if(!I(i))throw new Error("properties must be a number");var o=T(t).length,s=gi(t,{weight:r}),a=0,u=0,h=0;O(t,(function(t){var e=t.properties[r]||1,n=yi(U(t),U(s));a+=Math.pow(n.x,2)*e,u+=Math.pow(n.y,2)*e,h+=n.x*n.y*e}));var l=a-u,p=Math.sqrt(Math.pow(l,2)+4*Math.pow(h,2)),f=2*h,g=Math.atan((l+p)/f),d=180*g/Math.PI,y=0,_=0,m=0;O(t,(function(t){var e=t.properties[r]||1,n=yi(U(t),U(s));y+=Math.pow(n.x*Math.cos(g)-n.y*Math.sin(g),2)*e,_+=Math.pow(n.x*Math.sin(g)+n.y*Math.cos(g),2)*e,m+=e}));var v=Math.sqrt(2*y/m),x=Math.sqrt(2*_/m),E=pi(s,v,x,{units:"degrees",angle:d,steps:n,properties:i}),w=Rt(t,c([E])),N={meanCenterCoordinates:U(s),semiMajorAxis:v,semiMinorAxis:x,numberOfFeatures:o,angle:d,percentageWithinEllipse:100*T(w).length/o};return E.properties.standardDeviationalEllipse=N,E},t.difference=function(t,n){var r=J(t),i=J(n),o=t.properties||{};if(r=Ui(r),i=Ui(i),!r)return null;if(!i)return e(r,o);var s=new bh,a=s.read(r),u=s.read(i),c=Cf.difference(a,u);return c.isEmpty()?null:e((new Ih).write(c),o)},t.buffer=function(t,e,n){var r=(n=n||{}).units,i=n.steps||64;if(!t)throw new Error("geojson is required");if("object"!=typeof n)throw new Error("options must be an object");if("number"!=typeof i)throw new Error("steps must be an number");if(void 0===e)throw new Error("radius is required");if(i<=0)throw new Error("steps must be greater than 0");i=i||64,r=r||"kilometers";var o=[];switch(t.type){case"GeometryCollection":return A(t,(function(t){var n=bo(t,e,r,i);n&&o.push(n)})),c(o);case"FeatureCollection":return O(t,(function(t){var n=bo(t,e,r,i);n&&O(n,(function(t){t&&o.push(t)}))})),c(o)}return bo(t,e,r,i)},t.union=Mo,t.intersect=Lo,t.dissolve=function(t,e){if(!I(e=e||{}))throw new Error("options is invalid");var n=e.propertyName;W(t,"Polygon","dissolve");var r=Gt(t),i=r.features,o=[];i.forEach((function(t,e){t.properties.origIndexPosition=e}));var s=Qe();for(var u in s.load(r),i){var c=i[u],h=!1;if(s.search(c).features.forEach((function(t){c=i[u];var e=t.properties.origIndexPosition;if(o.length>0&&0!==e)if(e>o[o.length-1])e-=o.length;else{var r=Po(e,o);0!==r&&(e-=r)}if(e!==+u){var l=i[e];l&&c&&(void 0!==n&&l.properties[n]!==c.properties[n]||Tr(c,l)&&function(t,e){return nn(a(T(t)),a(T(e))).features.length>0}(c,l)&&(i[u]=Mo(c,l),o.push(t.properties.origIndexPosition),o.sort((function(t,e){return t-e})),s.remove(t),i.splice(e,1),c.properties.origIndexPosition=u,s.remove(c,(function(t,e){return t.properties.origIndexPosition===e.properties.origIndexPosition})),h=!0))}})),h){if(!c)continue;c.properties.origIndexPosition=u,s.insert(c),u--}}return i.forEach((function(t){delete t.properties.origIndexPosition,delete t.bbox})),r},t.hexGrid=Oo,t.mask=function(t,e){var n=function(t){return o(t&&t.geometry.coordinates||[[[180,90],[-180,90],[-180,-90],[180,-90],[180,90]]])}(e),r=function(t){var e=[],n=[];return F(t,(function(t){var r=t.geometry.coordinates,i=r[0],s=r.slice(1);e.push(o([i])),s.forEach((function(t){n.push(o([t]))}))})),[c(e),c(n)]}(t),i=r[0],s=r[1];return function(t,e,n){var r=[];return r.push(t.geometry.coordinates[0]),F(e,(function(t){r.push(t.geometry.coordinates[0])})),F(n,(function(t){r.push(t.geometry.coordinates[0])})),o(r)}(n,i=Ro(i),s=Ro(s))},t.squareGrid=Ao,t.triangleGrid=Do,t.interpolate=function(t,e,n){if("object"!=typeof(n=n||{}))throw new Error("options is invalid");var r=n.gridType,i=n.property,o=n.weight;if(!t)throw new Error("points is required");if(W(t,"Point","input must contain Points"),!e)throw new Error("cellSize is required");if(void 0!==o&&"number"!=typeof o)throw new Error("weight must be a number");i=i||"elevation",r=r||"square",o=o||1;var s,a=j(t);switch(r){case"point":case"points":s=Ln(a,e,n);break;case"square":case"squares":s=Ao(a,e,n);break;case"hex":case"hexes":s=Oo(a,e,n);break;case"triangle":case"triangles":s=Do(a,e,n);break;default:throw new Error("invalid gridType")}var u=[];return O(s,(function(e){var s=0,a=0;O(t,(function(t){var u,c=qt("point"===r?e:ye(e),t,n);if(void 0!==i&&(u=t.properties[i]),void 0===u&&(u=t.geometry.coordinates[2]),void 0===u)throw new Error("zValue is missing");0===c&&(s=u);var h=1/Math.pow(c,o);a+=h,s+=h*u}));var c=Gt(e);c.properties[i]=s/a,u.push(c)})),c(u)},t.pointOnSurface=yn,t.polygonToLineString=kn,t.lineStringToPolygon=jn,t.inside=Pt,t.within=Rt,t.bezier=ue,t.nearest=Fe,t.pointOnLine=on,t.lineDistance=bn,t.radians2degrees=v,t.degrees2radians=x,t.distanceToDegrees=_,t.distanceToRadians=y,t.radiansToDistance=d,t.bearingToAngle=m,t.convertDistance=E,t.toMercator=cn,t.toWgs84=hn,t.randomPosition=_i,t.randomPoint=mi,t.randomPolygon=vi,t.randomLineString=xi,t.getCluster=wi,t.clusterEach=bi,t.clusterReduce=Ii,t.createBins=Ni,t.applyFilter=Ci,t.propertiesContainsFilter=Si,t.filterProperties=Mi,t.earthRadius=Fo,t.factors=qo,t.unitsFactors=Go,t.areaFactors=Bo,t.feature=e,t.geometry=n,t.point=r,t.points=i,t.polygon=o,t.polygons=s,t.lineString=a,t.lineStrings=u,t.featureCollection=c,t.multiLineString=h,t.multiPoint=l,t.multiPolygon=p,t.geometryCollection=f,t.round=g,t.radiansToLength=d,t.lengthToRadians=y,t.lengthToDegrees=_,t.bearingToAzimuth=m,t.radiansToDegrees=v,t.degreesToRadians=x,t.convertLength=E,t.convertArea=w,t.isNumber=b,t.isObject=I,t.validateBBox=N,t.validateId=C,t.getCoord=X,t.getCoords=U,t.containsNumber=Y,t.geojsonType=V,t.featureOf=H,t.collectionOf=W,t.getGeom=J,t.getGeomType=Z,t.getType=K,t.coordEach=S,t.coordReduce=M,t.propEach=L,t.propReduce=P,t.featureEach=O,t.featureReduce=R,t.coordAll=T,t.geomEach=A,t.geomReduce=D,t.flattenEach=F,t.flattenReduce=q,t.segmentEach=G,t.segmentReduce=B,t.lineEach=k,t.lineReduce=z,Object.defineProperty(t,"__esModule",{value:!0})}(e)}}]); +!function(){try{var t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},e=(new Error).stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="27cc663d-32d2-47a6-ab9b-2a4a4d0845d8",t._sentryDebugIdIdentifier="sentry-dbid-27cc663d-32d2-47a6-ab9b-2a4a4d0845d8")}catch(t){}}();var _global="undefined"!==typeof window?window:"undefined"!==typeof global?global:"undefined"!==typeof self?self:{};_global.SENTRY_RELEASE={id:"a2b8e2612b2ee50152f1f5ccf84a620164236ffa"},(self.webpackChunklocal_services_lookup=self.webpackChunklocal_services_lookup||[]).push([[489],{530:function(t,e){!function(t){"use strict";function e(t,e,n){if(!I(n=n||{}))throw new Error("options is invalid");var r=n.bbox,i=n.id;if(void 0===t)throw new Error("geometry is required");if(e&&e.constructor!==Object)throw new Error("properties must be an Object");r&&N(r),i&&C(i);var o={type:"Feature"};return i&&(o.id=i),r&&(o.bbox=r),o.properties=e||{},o.geometry=t,o}function n(t,e,n){if(!I(n=n||{}))throw new Error("options is invalid");var i,s=n.bbox;if(!t)throw new Error("type is required");if(!e)throw new Error("coordinates is required");if(!Array.isArray(e))throw new Error("coordinates must be an Array");switch(s&&N(s),t){case"Point":i=r(e).geometry;break;case"LineString":i=a(e).geometry;break;case"Polygon":i=o(e).geometry;break;case"MultiPoint":i=l(e).geometry;break;case"MultiLineString":i=h(e).geometry;break;case"MultiPolygon":i=p(e).geometry;break;default:throw new Error(t+" is invalid")}return s&&(i.bbox=s),i}function r(t,n,r){if(!t)throw new Error("coordinates is required");if(!Array.isArray(t))throw new Error("coordinates must be an Array");if(t.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!b(t[0])||!b(t[1]))throw new Error("coordinates must contain numbers");return e({type:"Point",coordinates:t},n,r)}function i(t,e,n){if(!t)throw new Error("coordinates is required");if(!Array.isArray(t))throw new Error("coordinates must be an Array");return c(t.map((function(t){return r(t,e)})),n)}function o(t,n,r){if(!t)throw new Error("coordinates is required");for(var i=0;i<t.length;i++){var o=t[i];if(o.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var s=0;s<o[o.length-1].length;s++){if(0===i&&0===s&&!b(o[0][0])||!b(o[0][1]))throw new Error("coordinates must contain numbers");if(o[o.length-1][s]!==o[0][s])throw new Error("First and last Position are not equivalent.")}}return e({type:"Polygon",coordinates:t},n,r)}function s(t,e,n){if(!t)throw new Error("coordinates is required");if(!Array.isArray(t))throw new Error("coordinates must be an Array");return c(t.map((function(t){return o(t,e)})),n)}function a(t,n,r){if(!t)throw new Error("coordinates is required");if(t.length<2)throw new Error("coordinates must be an array of two or more positions");if(!b(t[0][1])||!b(t[0][1]))throw new Error("coordinates must contain numbers");return e({type:"LineString",coordinates:t},n,r)}function u(t,e,n){if(!t)throw new Error("coordinates is required");if(!Array.isArray(t))throw new Error("coordinates must be an Array");return c(t.map((function(t){return a(t,e)})),n)}function c(t,e){if(!I(e=e||{}))throw new Error("options is invalid");var n=e.bbox,r=e.id;if(!t)throw new Error("No features passed");if(!Array.isArray(t))throw new Error("features must be an Array");n&&N(n),r&&C(r);var i={type:"FeatureCollection"};return r&&(i.id=r),n&&(i.bbox=n),i.features=t,i}function h(t,n,r){if(!t)throw new Error("coordinates is required");return e({type:"MultiLineString",coordinates:t},n,r)}function l(t,n,r){if(!t)throw new Error("coordinates is required");return e({type:"MultiPoint",coordinates:t},n,r)}function p(t,n,r){if(!t)throw new Error("coordinates is required");return e({type:"MultiPolygon",coordinates:t},n,r)}function f(t,n,r){if(!t)throw new Error("geometries is required");if(!Array.isArray(t))throw new Error("geometries must be an Array");return e({type:"GeometryCollection",geometries:t},n,r)}function g(t,e){if(void 0===t||null===t||isNaN(t))throw new Error("num is required");if(e&&!(e>=0))throw new Error("precision must be a positive number");var n=Math.pow(10,e||0);return Math.round(t*n)/n}function d(t,e){if(void 0===t||null===t)throw new Error("radians is required");if(e&&"string"!=typeof e)throw new Error("units must be a string");var n=qo[e||"kilometers"];if(!n)throw new Error(e+" units is invalid");return t*n}function y(t,e){if(void 0===t||null===t)throw new Error("distance is required");if(e&&"string"!=typeof e)throw new Error("units must be a string");var n=qo[e||"kilometers"];if(!n)throw new Error(e+" units is invalid");return t/n}function _(t,e){return v(y(t,e))}function m(t){if(null===t||void 0===t)throw new Error("bearing is required");var e=t%360;return e<0&&(e+=360),e}function v(t){if(null===t||void 0===t)throw new Error("radians is required");return t%(2*Math.PI)*180/Math.PI}function x(t){if(null===t||void 0===t)throw new Error("degrees is required");return t%360*Math.PI/180}function E(t,e,n){if(null===t||void 0===t)throw new Error("length is required");if(!(t>=0))throw new Error("length must be a positive number");return d(y(t,e),n||"kilometers")}function w(t,e,n){if(null===t||void 0===t)throw new Error("area is required");if(!(t>=0))throw new Error("area must be a positive number");var r=Bo[e||"meters"];if(!r)throw new Error("invalid original units");var i=Bo[n||"kilometers"];if(!i)throw new Error("invalid final units");return t/r*i}function b(t){return!isNaN(t)&&null!==t&&!Array.isArray(t)}function I(t){return!!t&&t.constructor===Object}function N(t){if(!t)throw new Error("bbox is required");if(!Array.isArray(t))throw new Error("bbox must be an Array");if(4!==t.length&&6!==t.length)throw new Error("bbox must be an Array of 4 or 6 numbers");t.forEach((function(t){if(!b(t))throw new Error("bbox must only contain numbers")}))}function C(t){if(!t)throw new Error("id is required");if(-1===["string","number"].indexOf(typeof t))throw new Error("id must be a number or a string")}function S(t,e,n){if(null!==t)for(var r,i,o,s,a,u,c,h,l=0,p=0,f=t.type,g="FeatureCollection"===f,d="Feature"===f,y=g?t.features.length:1,_=0;_<y;_++){a=(h=!!(c=g?t.features[_].geometry:d?t.geometry:t)&&"GeometryCollection"===c.type)?c.geometries.length:1;for(var m=0;m<a;m++){var v=0,x=0;if(null!==(s=h?c.geometries[m]:c)){u=s.coordinates;var E=s.type;switch(l=!n||"Polygon"!==E&&"MultiPolygon"!==E?0:1,E){case null:break;case"Point":e(u,p,_,v,x),p++,v++;break;case"LineString":case"MultiPoint":for(r=0;r<u.length;r++)e(u[r],p,_,v,x),p++,"MultiPoint"===E&&v++;"LineString"===E&&v++;break;case"Polygon":case"MultiLineString":for(r=0;r<u.length;r++){for(i=0;i<u[r].length-l;i++)e(u[r][i],p,_,v,x),p++;"MultiLineString"===E&&v++,"Polygon"===E&&x++}"Polygon"===E&&v++;break;case"MultiPolygon":for(r=0;r<u.length;r++){for("MultiPolygon"===E&&(x=0),i=0;i<u[r].length;i++){for(o=0;o<u[r][i].length-l;o++)e(u[r][i][o],p,_,v,x),p++;x++}v++}break;case"GeometryCollection":for(r=0;r<s.geometries.length;r++)S(s.geometries[r],e,n);break;default:throw new Error("Unknown Geometry Type")}}}}}function M(t,e,n,r){var i=n;return S(t,(function(t,r,o,s,a){i=0===r&&void 0===n?t:e(i,t,r,o,s,a)}),r),i}function L(t,e){var n;switch(t.type){case"FeatureCollection":for(n=0;n<t.features.length;n++)e(t.features[n].properties,n);break;case"Feature":e(t.properties,0)}}function P(t,e,n){var r=n;return L(t,(function(t,i){r=0===i&&void 0===n?t:e(r,t,i)})),r}function O(t,e){if("Feature"===t.type)e(t,0);else if("FeatureCollection"===t.type)for(var n=0;n<t.features.length;n++)e(t.features[n],n)}function R(t,e,n){var r=n;return O(t,(function(t,i){r=0===i&&void 0===n?t:e(r,t,i)})),r}function T(t){var e=[];return S(t,(function(t){e.push(t)})),e}function A(t,e){var n,r,i,o,s,a,u,c,h,l,p=0,f="FeatureCollection"===t.type,g="Feature"===t.type,d=f?t.features.length:1;for(n=0;n<d;n++){for(a=f?t.features[n].geometry:g?t.geometry:t,c=f?t.features[n].properties:g?t.properties:{},h=f?t.features[n].bbox:g?t.bbox:void 0,l=f?t.features[n].id:g?t.id:void 0,s=(u=!!a&&"GeometryCollection"===a.type)?a.geometries.length:1,i=0;i<s;i++)if(null!==(o=u?a.geometries[i]:a))switch(o.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":e(o,p,c,h,l);break;case"GeometryCollection":for(r=0;r<o.geometries.length;r++)e(o.geometries[r],p,c,h,l);break;default:throw new Error("Unknown Geometry Type")}else e(null,p,c,h,l);p++}}function D(t,e,n){var r=n;return A(t,(function(t,i,o,s,a){r=0===i&&void 0===n?t:e(r,t,i,o,s,a)})),r}function F(t,n){A(t,(function(t,r,i,o,s){var a,u=null===t?null:t.type;switch(u){case null:case"Point":case"LineString":case"Polygon":return void n(e(t,i,{bbox:o,id:s}),r,0)}switch(u){case"MultiPoint":a="Point";break;case"MultiLineString":a="LineString";break;case"MultiPolygon":a="Polygon"}t.coordinates.forEach((function(t,o){n(e({type:a,coordinates:t},i),r,o)}))}))}function q(t,e,n){var r=n;return F(t,(function(t,i,o){r=0===i&&0===o&&void 0===n?t:e(r,t,i,o)})),r}function G(t,e){F(t,(function(t,n,r){var i=0;if(t.geometry){var o=t.geometry.type;"Point"!==o&&"MultiPoint"!==o&&M(t,(function(o,s,u,c,h,l){var p=a([o,s],t.properties);return e(p,n,r,l,i),i++,s}))}}))}function B(t,e,n){var r=n,i=!1;return G(t,(function(t,o,s,a,u){r=!1===i&&void 0===n?t:e(r,t,o,s,a,u),i=!0})),r}function k(t,e){if(!t)throw new Error("geojson is required");F(t,(function(t,n,r){if(null!==t.geometry){var i=t.geometry.type,o=t.geometry.coordinates;switch(i){case"LineString":e(t,n,r,0,0);break;case"Polygon":for(var s=0;s<o.length;s++)e(a(o[s],t.properties),n,r,s)}}}))}function z(t,e,n){var r=n;return k(t,(function(t,i,o,s){r=0===i&&void 0===n?t:e(r,t,i,o,s)})),r}function j(t){var e=[1/0,1/0,-1/0,-1/0];return S(t,(function(t){e[0]>t[0]&&(e[0]=t[0]),e[1]>t[1]&&(e[1]=t[1]),e[2]<t[0]&&(e[2]=t[0]),e[3]<t[1]&&(e[3]=t[1])})),e}function X(t){if(!t)throw new Error("obj is required");var e=U(t);if(e.length>1&&b(e[0])&&b(e[1]))return e;throw new Error("Coordinate is not a valid Point")}function U(t){if(!t)throw new Error("obj is required");var e;if(t.length?e=t:t.coordinates?e=t.coordinates:t.geometry&&t.geometry.coordinates&&(e=t.geometry.coordinates),e)return Y(e),e;throw new Error("No valid coordinates")}function Y(t){if(t.length>1&&b(t[0])&&b(t[1]))return!0;if(Array.isArray(t[0])&&t[0].length)return Y(t[0]);throw new Error("coordinates must only contain numbers")}function V(t,e,n){if(!e||!n)throw new Error("type and name required");if(!t||t.type!==e)throw new Error("Invalid input to "+n+": must be a "+e+", given "+t.type)}function H(t,e,n){if(!t)throw new Error("No feature passed");if(!n)throw new Error(".featureOf() requires a name");if(!t||"Feature"!==t.type||!t.geometry)throw new Error("Invalid input to "+n+", Feature with geometry required");if(!t.geometry||t.geometry.type!==e)throw new Error("Invalid input to "+n+": must be a "+e+", given "+t.geometry.type)}function W(t,e,n){if(!t)throw new Error("No featureCollection passed");if(!n)throw new Error(".collectionOf() requires a name");if(!t||"FeatureCollection"!==t.type)throw new Error("Invalid input to "+n+", FeatureCollection required");for(var r=0;r<t.features.length;r++){var i=t.features[r];if(!i||"Feature"!==i.type||!i.geometry)throw new Error("Invalid input to "+n+", Feature with geometry required");if(!i.geometry||i.geometry.type!==e)throw new Error("Invalid input to "+n+": must be a "+e+", given "+i.geometry.type)}}function J(t){if(!t)throw new Error("geojson is required");if(void 0!==t.geometry)return t.geometry;if(t.coordinates||t.geometries)return t;throw new Error("geojson must be a valid Feature or Geometry Object")}function Z(){throw new Error("invariant.getGeomType has been deprecated in v5.0 in favor of invariant.getType")}function K(t,e){if(!t)throw new Error((e||"geojson")+" is required");if(t.geometry&&t.geometry.type)return t.geometry.type;if(t.type)return t.type;throw new Error((e||"geojson")+" is invalid")}function Q(t,e,n){n=n||{};for(var r=Object.keys(Xo),i=0;i<r.length;i++){var o=r[i],s=n[o];s=void 0!==s&&null!==s?s:Xo[o],Uo[o]=s}Uo.verbose&&console.log("MarchingSquaresJS-isoContours: computing isocontour for "+e);var a=function(t){var e=[],n=0;return t.rows,t.cols,t.cells.forEach((function(r,i){r.forEach((function(r,o){if(void 0!==r&&!function(t){return 5===t.cval||10===t.cval}(r)&&!tt(r)){var s=function(t,e,n){var r,i,o,s=t.length,a=[],u=[0,0,1,1,0,0,0,0,-1,0,1,1,-1,0,-1,0],c=[0,-1,0,0,1,1,1,1,0,-1,0,0,0,-1,0,0],h=["none","bottom","right","right","top","top","top","top","left","bottom","right","right","left","bottom","left","none"],l=(t[e][n],t[e][n]),p=l.cval,f=nt(l,o=["none","left","bottom","left","right","none","bottom","left","top","top","none","top","right","right","bottom","none"][p]);a.push([n+f[0],e+f[1]]),f=nt(l,o=h[p]),a.push([n+f[0],e+f[1]]),et(l);for(var g=n+u[p],d=e+c[p],y=p;g>=0&&d>=0&&d<s&&(g!=n||d!=e)&&void 0!==(l=t[d][g]);){if(0===(p=l.cval)||15===p)return{path:a,info:"mergeable"};o=h[p],r=u[p],i=c[p],5!==p&&10!==p||(5===p?l.flipped?-1===c[y]?(o="left",r=-1,i=0):(o="right",r=1,i=0):-1===u[y]&&(o="bottom",r=0,i=-1):10===p&&(l.flipped?-1===u[y]?(o="top",r=0,i=1):(o="bottom",r=0,i=-1):1===c[y]&&(o="left",r=-1,i=0))),f=nt(l,o),a.push([g+f[0],d+f[1]]),et(l),g+=r,d+=i,y=p}return{path:a,info:"closed"}}(t.cells,i,o),a=!1;if("mergeable"===s.info)for(var u=s.path[s.path.length-1][0],c=s.path[s.path.length-1][1],h=n-1;h>=0;h--)if(Math.abs(e[h][0][0]-u)<=1e-7&&Math.abs(e[h][0][1]-c)<=1e-7){for(var l=s.path.length-2;l>=0;--l)e[h].unshift(s.path[l]);a=!0;break}a||(e[n++]=s.path)}}))})),e}(function(t,e){for(var n=t.length-1,r=t[0].length-1,i={rows:n,cols:r,cells:[]},o=0;o<n;++o){i.cells[o]=[];for(var s=0;s<r;++s){var a=0,u=t[o+1][s],c=t[o+1][s+1],h=t[o][s+1],l=t[o][s];if(!(isNaN(u)||isNaN(c)||isNaN(h)||isNaN(l))){a|=u>=e?8:0,a|=c>=e?4:0,a|=h>=e?2:0;var p,f,g,d,y=!1;if(5===(a|=l>=e?1:0)||10===a){var _=(u+c+h+l)/4;5===a&&_<e?(a=10,y=!0):10===a&&_<e&&(a=5,y=!0)}0!==a&&15!==a&&(p=f=g=d=.5,1===a?(g=1-$(e,u,l),f=1-$(e,h,l)):2===a?(f=$(e,l,h),d=1-$(e,c,h)):3===a?(g=1-$(e,u,l),d=1-$(e,c,h)):4===a?(p=$(e,u,c),d=$(e,h,c)):5===a?(p=$(e,u,c),d=$(e,h,c),f=1-$(e,h,l),g=1-$(e,u,l)):6===a?(f=$(e,l,h),p=$(e,u,c)):7===a?(g=1-$(e,u,l),p=$(e,u,c)):8===a?(g=$(e,l,u),p=1-$(e,c,u)):9===a?(f=1-$(e,h,l),p=1-$(e,c,u)):10===a?(p=1-$(e,c,u),d=1-$(e,c,h),f=$(e,l,h),g=$(e,l,u)):11===a?(p=1-$(e,c,u),d=1-$(e,c,h)):12===a?(g=$(e,l,u),d=$(e,h,c)):13===a?(f=1-$(e,h,l),d=$(e,h,c)):14===a?(g=$(e,l,u),f=$(e,l,h)):console.log("MarchingSquaresJS-isoContours: Illegal cval detected: "+a),i.cells[o][s]={cval:a,flipped:y,top:p,right:d,bottom:f,left:g})}}}return i}(t,e));return"function"==typeof Uo.successCallback&&Uo.successCallback(a),a}function $(t,e,n){return(t-e)/(n-e)}function tt(t){return 0===t.cval||15===t.cval}function et(t){tt(t)||5===t.cval||10===t.cval||(t.cval=15)}function nt(t,e){return"top"===e?[t.top,1]:"bottom"===e?[t.bottom,0]:"right"===e?[1,t.right]:"left"===e?[0,t.left]:void 0}function rt(t,e){if(!I(e=e||{}))throw new Error("options is invalid");var n=e.zProperty||"elevation",r=e.flip,i=e.flags;W(t,"Point","input must contain Points");for(var o=function(t,e){var n={};return O(t,(function(t){var e=U(t)[1];n[e]||(n[e]=[]),n[e].push(t)})),Object.keys(n).map((function(t){var e=n[t].sort((function(t,e){return U(t)[0]-U(e)[0]}));return e})).sort((function(t,n){return e?U(t[0])[1]-U(n[0])[1]:U(n[0])[1]-U(t[0])[1]}))}(t,r),s=[],a=0;a<o.length;a++){for(var u=o[a],c=[],h=0;h<u.length;h++){var l=u[h];l.properties[n]?c.push(l.properties[n]):c.push(0),!0===i&&(l.properties.matrixPosition=[a,h])}s.push(c)}return s}function it(t,e,n,r,i){for(n=n||0,r=r||t.length-1,i=i||function(t,e){return t<e?-1:t>e?1:0};r>n;){if(r-n>600){var o=r-n+1,s=e-n+1,a=Math.log(o),u=.5*Math.exp(2*a/3),c=.5*Math.sqrt(a*u*(o-u)/o)*(s-o/2<0?-1:1);it(t,e,Math.max(n,Math.floor(e-s*u/o+c)),Math.min(r,Math.floor(e+(o-s)*u/o+c)),i)}var h=t[e],l=n,p=r;for(ot(t,n,e),i(t[r],h)>0&&ot(t,n,r);l<p;){for(ot(t,l,p),l++,p--;i(t[l],h)<0;)l++;for(;i(t[p],h)>0;)p--}0===i(t[n],h)?ot(t,n,p):ot(t,++p,r),p<=e&&(n=p+1),e<=p&&(r=p-1)}}function ot(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function st(t,e){if(!(this instanceof st))return new st(t,e);this._maxEntries=Math.max(4,t||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),e&&this._initFormat(e),this.clear()}function at(t,e){ut(t,0,t.children.length,e,t)}function ut(t,e,n,r,i){i||(i=yt(null)),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(var o,s=e;s<n;s++)o=t.children[s],ct(i,t.leaf?r(o):o);return i}function ct(t,e){return t.minX=Math.min(t.minX,e.minX),t.minY=Math.min(t.minY,e.minY),t.maxX=Math.max(t.maxX,e.maxX),t.maxY=Math.max(t.maxY,e.maxY),t}function ht(t,e){return t.minX-e.minX}function lt(t,e){return t.minY-e.minY}function pt(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function ft(t){return t.maxX-t.minX+(t.maxY-t.minY)}function gt(t,e){return t.minX<=e.minX&&t.minY<=e.minY&&e.maxX<=t.maxX&&e.maxY<=t.maxY}function dt(t,e){return e.minX<=t.maxX&&e.minY<=t.maxY&&e.maxX>=t.minX&&e.maxY>=t.minY}function yt(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function _t(t,e,n,r,i){for(var o,s=[e,n];s.length;)(n=s.pop())-(e=s.pop())<=r||(o=e+Math.ceil((n-e)/r/2)*r,Yo(t,o,e,n,i),s.push(e,o,o,n))}function mt(t,e){return t(e={exports:{}},e.exports),e.exports}function vt(t,e){if(!(this instanceof vt))return new vt(t,e);if(this.data=t||[],this.length=this.data.length,this.compare=e||function(t,e){return t<e?-1:t>e?1:0},this.length>0)for(var n=(this.length>>1)-1;n>=0;n--)this._down(n)}function xt(t,e,n){e=Math.max(0,void 0===e?2:e),n=n||0;for(var r,i=function(t){for(var e=t[0],n=t[0],r=t[0],i=t[0],o=0;o<t.length;o++){var s=t[o];s[0]<e[0]&&(e=s),s[0]>r[0]&&(r=s),s[1]<n[1]&&(n=s),s[1]>i[1]&&(i=s)}var a=[e,n,r,i],u=a.slice();for(o=0;o<t.length;o++)is(t[o],a)||u.push(t[o]);var c=ts(u),h=[];for(o=0;o<c.length;o++)h.push(u[c[o]]);return h}(t),o=Vo(16,["[0]","[1]","[0]","[1]"]).load(t),s=[],a=0;a<i.length;a++){var u=i[a];o.remove(u),r=Nt(u,r),s.push(r)}var c=Vo(16);for(a=0;a<s.length;a++)c.insert(It(s[a]));for(var h=e*e,l=n*n;s.length;){var p=s.shift(),f=p.p,g=p.next.p,d=Ct(f,g);if(!(d<l)){var y=d/h;(u=function(t,e,n,r,i,o,s){for(var a=new ns(null,Et),u=t.data;u;){for(var c=0;c<u.children.length;c++){var h=u.children[c],l=u.leaf?St(h,n,r):function(t,e,n){if(wt(t,n)||wt(e,n))return 0;var r=Mt(t[0],t[1],e[0],e[1],n.minX,n.minY,n.maxX,n.minY);if(0===r)return 0;var i=Mt(t[0],t[1],e[0],e[1],n.minX,n.minY,n.minX,n.maxY);if(0===i)return 0;var o=Mt(t[0],t[1],e[0],e[1],n.maxX,n.minY,n.maxX,n.maxY);if(0===o)return 0;var s=Mt(t[0],t[1],e[0],e[1],n.minX,n.maxY,n.maxX,n.maxY);return 0===s?0:Math.min(r,i,o,s)}(n,r,h);l>o||a.push({node:h,dist:l})}for(;a.length&&!a.peek().node.children;){var p=a.pop(),f=p.node,g=St(f,e,n),d=St(f,r,i);if(p.dist<g&&p.dist<d&&bt(n,f,s)&&bt(r,f,s))return f}(u=a.pop())&&(u=u.node)}return null}(o,p.prev.p,f,g,p.next.next.p,y,c))&&Math.min(Ct(u,f),Ct(u,g))<=y&&(s.push(p),s.push(Nt(u,p)),o.remove(u),c.remove(p),c.insert(It(p)),c.insert(It(p.next)))}}p=r;var _=[];do{_.push(p.p),p=p.next}while(p!==r);return _.push(p.p),_}function Et(t,e){return t.dist-e.dist}function wt(t,e){return t[0]>=e.minX&&t[0]<=e.maxX&&t[1]>=e.minY&&t[1]<=e.maxY}function bt(t,e,n){for(var r=Math.min(t[0],e[0]),i=Math.min(t[1],e[1]),o=Math.max(t[0],e[0]),s=Math.max(t[1],e[1]),a=n.search({minX:r,minY:i,maxX:o,maxY:s}),u=0;u<a.length;u++)if(function(t,e,n,r){return t!==r&&e!==n&&os(t,e,n)>0!=os(t,e,r)>0&&os(n,r,t)>0!=os(n,r,e)>0}(a[u].p,a[u].next.p,t,e))return!1;return!0}function It(t){var e=t.p,n=t.next.p;return t.minX=Math.min(e[0],n[0]),t.minY=Math.min(e[1],n[1]),t.maxX=Math.max(e[0],n[0]),t.maxY=Math.max(e[1],n[1]),t}function Nt(t,e){var n={p:t,prev:null,next:null,minX:0,minY:0,maxX:0,maxY:0};return e?(n.next=e.next,n.prev=e,e.next.prev=n,e.next=n):(n.prev=n,n.next=n),n}function Ct(t,e){var n=t[0]-e[0],r=t[1]-e[1];return n*n+r*r}function St(t,e,n){var r=e[0],i=e[1],o=n[0]-r,s=n[1]-i;if(0!==o||0!==s){var a=((t[0]-r)*o+(t[1]-i)*s)/(o*o+s*s);a>1?(r=n[0],i=n[1]):a>0&&(r+=o*a,i+=s*a)}return(o=t[0]-r)*o+(s=t[1]-i)*s}function Mt(t,e,n,r,i,o,s,a){var u,c,h,l,p=n-t,f=r-e,g=s-i,d=a-o,y=t-i,_=e-o,m=p*p+f*f,v=p*g+f*d,x=g*g+d*d,E=p*y+f*_,w=g*y+d*_,b=m*x-v*v,I=b,N=b;0===b?(c=0,I=1,l=w,N=x):(l=m*w-v*E,(c=v*w-x*E)<0?(c=0,l=w,N=x):c>I&&(c=I,l=w+v,N=x)),l<0?(l=0,-E<0?c=0:-E>m?c=I:(c=-E,I=m)):l>N&&(l=N,-E+v<0?c=0:-E+v>m?c=I:(c=-E+v,I=m));var C=(1-(h=0===l?0:l/N))*i+h*s-((1-(u=0===c?0:c/I))*t+u*n),S=(1-h)*o+h*a-((1-u)*e+u*r);return C*C+S*S}function Lt(t,e){if(!I(e=e||{}))throw new Error("options is invalid");var n=e.concavity||1/0,r=[];if(S(t,(function(t){r.push([t[0],t[1]])})),!r.length)return null;var i=ss(r,n);return i.length>3?o([i]):null}function Pt(t,e,n){if("object"!=typeof(n=n||{}))throw new Error("options is invalid");var r=n.ignoreBoundary;if(!t)throw new Error("point is required");if(!e)throw new Error("polygon is required");var i=X(t),o=U(e),s=e.geometry?e.geometry.type:e.type,a=e.bbox;if(a&&!1===function(t,e){return e[0]<=t[0]&&e[1]<=t[1]&&e[2]>=t[0]&&e[3]>=t[1]}(i,a))return!1;"Polygon"===s&&(o=[o]);for(var u=0,c=!1;u<o.length&&!c;u++)if(Ot(i,o[u][0],r)){for(var h=!1,l=1;l<o[u].length&&!h;)Ot(i,o[u][l],!r)&&(h=!0),l++;h||(c=!0)}return c}function Ot(t,e,n){var r=!1;e[0][0]===e[e.length-1][0]&&e[0][1]===e[e.length-1][1]&&(e=e.slice(0,e.length-1));for(var i=0,o=e.length-1;i<e.length;o=i++){var s=e[i][0],a=e[i][1],u=e[o][0],c=e[o][1];if(t[1]*(s-u)+a*(u-t[0])+c*(t[0]-s)==0&&(s-t[0])*(u-t[0])<=0&&(a-t[1])*(c-t[1])<=0)return!n;a>t[1]!=c>t[1]&&t[0]<(u-s)*(t[1]-a)/(c-a)+s&&(r=!r)}return r}function Rt(t,e){var n=[];return A(e,(function(e){O(t,(function(t){Pt(t,e)&&n.push(t)}))})),c(n)}function Tt(t,e){if("FeatureCollection"!==t.type)throw new Error("points must be a FeatureCollection");var n=!1;return c(function(t){if(t.length<3)return[];t.sort(Dt);for(var e,n,r,i,o,s,a=t.length-1,u=t[a].x,c=t[0].x,h=t[a].y,l=h;a--;)t[a].y<h&&(h=t[a].y),t[a].y>l&&(l=t[a].y);var p,f=c-u,g=l-h,d=f>g?f:g,y=.5*(c+u),_=.5*(l+h),m=[new At({x:y-20*d,y:_-d,__sentinel:!0},{x:y,y:_+20*d,__sentinel:!0},{x:y+20*d,y:_-d,__sentinel:!0})],v=[],x=[];for(a=t.length;a--;){for(x.length=0,p=m.length;p--;)(f=t[a].x-m[p].x)>0&&f*f>m[p].r?(v.push(m[p]),m.splice(p,1)):f*f+(g=t[a].y-m[p].y)*g>m[p].r||(x.push(m[p].a,m[p].b,m[p].b,m[p].c,m[p].c,m[p].a),m.splice(p,1));for(Ft(x),p=x.length;p;)n=x[--p],e=x[--p],r=t[a],i=n.x-e.x,o=n.y-e.y,s=2*(i*(r.y-n.y)-o*(r.x-n.x)),Math.abs(s)>1e-12&&m.push(new At(e,n,r))}for(Array.prototype.push.apply(v,m),a=v.length;a--;)(v[a].a.__sentinel||v[a].b.__sentinel||v[a].c.__sentinel)&&v.splice(a,1);return v}(t.features.map((function(t){var r={x:t.geometry.coordinates[0],y:t.geometry.coordinates[1]};return e?r.z=t.properties[e]:3===t.geometry.coordinates.length&&(n=!0,r.z=t.geometry.coordinates[2]),r}))).map((function(t){var e=[t.a.x,t.a.y],r=[t.b.x,t.b.y],i=[t.c.x,t.c.y],s={};return n?(e.push(t.a.z),r.push(t.b.z),i.push(t.c.z)):s={a:t.a.z,b:t.b.z,c:t.c.z},o([[e,r,i,e]],s)})))}function At(t,e,n){this.a=t,this.b=e,this.c=n;var r,i,o=e.x-t.x,s=e.y-t.y,a=n.x-t.x,u=n.y-t.y,c=o*(t.x+e.x)+s*(t.y+e.y),h=a*(t.x+n.x)+u*(t.y+n.y),l=2*(o*(n.y-e.y)-s*(n.x-e.x));this.x=(u*c-s*h)/l,this.y=(o*h-a*c)/l,r=this.x-t.x,i=this.y-t.y,this.r=r*r+i*i}function Dt(t,e){return e.x-t.x}function Ft(t){var e,n,r,i,o,s=t.length;t:for(;s;)for(n=t[--s],e=t[--s],r=s;r;)if(o=t[--r],i=t[--r],e===i&&n===o||e===o&&n===i){t.splice(s,2),t.splice(r,2),s-=2;continue t}}function qt(t,e,n){if(!I(n=n||{}))throw new Error("options is invalid");var r=n.units,i=X(t),o=X(e),s=x(o[1]-i[1]),a=x(o[0]-i[0]),u=x(i[1]),c=x(o[1]),h=Math.pow(Math.sin(s/2),2)+Math.pow(Math.sin(a/2),2)*Math.cos(u)*Math.cos(c);return d(2*Math.atan2(Math.sqrt(h),Math.sqrt(1-h)),r)}function Gt(t){if(!t)throw new Error("geojson is required");switch(t.type){case"Feature":return Bt(t);case"FeatureCollection":return function(t){var e={type:"FeatureCollection"};return Object.keys(t).forEach((function(n){switch(n){case"type":case"features":return;default:e[n]=t[n]}})),e.features=t.features.map((function(t){return Bt(t)})),e}(t);case"Point":case"LineString":case"Polygon":case"MultiPoint":case"MultiLineString":case"MultiPolygon":case"GeometryCollection":return zt(t);default:throw new Error("unknown GeoJSON type")}}function Bt(t){var e={type:"Feature"};return Object.keys(t).forEach((function(n){switch(n){case"type":case"properties":case"geometry":return;default:e[n]=t[n]}})),e.properties=kt(t.properties),e.geometry=zt(t.geometry),e}function kt(t){var e={};return t?(Object.keys(t).forEach((function(n){var r=t[n];"object"==typeof r?null===r?e[n]=null:r.length?e[n]=r.map((function(t){return t})):e[n]=kt(r):e[n]=r})),e):e}function zt(t){var e={type:t.type};return t.bbox&&(e.bbox=t.bbox),"GeometryCollection"===t.type?(e.geometries=t.geometries.map((function(t){return zt(t)})),e):(e.coordinates=jt(t.coordinates),e)}function jt(t){return"object"!=typeof t[0]?t.slice():t.map((function(t){return jt(t)}))}function Xt(t,e){function n(t,e){e.length&&e.pop();for(var n=c[t<0?~t:t],r=0,i=n.length;r<i;++r)e.push(u(n[r],r));t<0&&hs(e,i)}function r(t){return u(t)}function i(t){for(var e=[],r=0,i=t.length;r<i;++r)n(t[r],e);return e.length<2&&e.push(e[0]),e}function o(t){for(var e=i(t);e.length<4;)e.push(e[0]);return e}function s(t){return t.map(o)}function a(t){var e,n=t.type;switch(n){case"GeometryCollection":return{type:n,geometries:t.geometries.map(a)};case"Point":e=r(t.coordinates);break;case"MultiPoint":e=t.coordinates.map(r);break;case"LineString":e=i(t.arcs);break;case"MultiLineString":e=t.arcs.map(i);break;case"Polygon":e=s(t.arcs);break;case"MultiPolygon":e=t.arcs.map(s);break;default:return null}return{type:n,coordinates:e}}var u=cs(t.transform),c=t.arcs;return a(e)}function Ut(t,e){function n(t){switch(t.type){case"GeometryCollection":t.geometries.forEach(n);break;case"Polygon":r(t.arcs);break;case"MultiPolygon":t.arcs.forEach(r)}}function r(t){t.forEach((function(e){e.forEach((function(e){(o[e=e<0?~e:e]||(o[e]=[])).push(t)}))})),s.push(t)}function i(e){return function(t){for(var e,n=-1,r=t.length,i=t[r-1],o=0;++n<r;)e=i,i=t[n],o+=e[0]*i[1]-e[1]*i[0];return Math.abs(o)}(Xt(t,{type:"Polygon",arcs:[e]}).coordinates[0])}var o={},s=[],a=[];return e.forEach(n),s.forEach((function(t){if(!t._){var e=[],n=[t];for(t._=1,a.push(e);t=n.pop();)e.push(t),t.forEach((function(t){t.forEach((function(t){o[t<0?~t:t].forEach((function(t){t._||(t._=1,n.push(t))}))}))}))}})),s.forEach((function(t){delete t._})),{type:"MultiPolygon",arcs:a.map((function(e){var n,r=[];if(e.forEach((function(t){t.forEach((function(t){t.forEach((function(t){o[t<0?~t:t].length<2&&r.push(t)}))}))})),(n=(r=ls(t,r)).length)>1)for(var s,a,u=1,c=i(r[0]);u<n;++u)(s=i(r[u]))>c&&(a=r[0],r[0]=r[u],r[u]=a,c=s);return r}))}}function Yt(t,e,n){for(var r,i=e+(n---e>>1);e<i;++e,--n)r=t[e],t[e]=t[n],t[n]=r}function Vt(t){return null==t?{type:null}:("FeatureCollection"===t.type?function(t){var e={type:"GeometryCollection",geometries:t.features.map(Ht)};return null!=t.bbox&&(e.bbox=t.bbox),e}:"Feature"===t.type?Ht:Wt)(t)}function Ht(t){var e,n=Wt(t.geometry);for(e in null!=t.id&&(n.id=t.id),null!=t.bbox&&(n.bbox=t.bbox),t.properties){n.properties=t.properties;break}return n}function Wt(t){if(null==t)return{type:null};var e="GeometryCollection"===t.type?{type:"GeometryCollection",geometries:t.geometries.map(Wt)}:"Point"===t.type||"MultiPoint"===t.type?{type:t.type,coordinates:t.coordinates}:{type:t.type,arcs:t.coordinates};return null!=t.bbox&&(e.bbox=t.bbox),e}function Jt(t){var e,n=t[0],r=t[1];return r<n&&(e=n,n=r,r=e),n+31*r}function Zt(t,e){var n,r=t[0],i=t[1],o=e[0],s=e[1];return i<r&&(n=r,r=i,i=n),s<o&&(n=o,o=s,s=n),r===o&&i===s}function Kt(t,e){if(!I(e=e||{}))throw new Error("options is invalid");var n=e.mutate;if("FeatureCollection"!==K(t))throw new Error("geojson must be a FeatureCollection");if(!t.features.length)throw new Error("geojson is empty");!1!==n&&void 0!==n||(t=Gt(t));var r=[],i=z(t,(function(t,e){var n=function(t,e){var n,r=t.geometry.coordinates,i=e.geometry.coordinates,o=Qt(r[0]),s=Qt(r[r.length-1]),u=Qt(i[0]),c=Qt(i[i.length-1]);if(o===c)n=i.concat(r.slice(1));else if(u===s)n=r.concat(i.slice(1));else if(o===u)n=r.slice(1).reverse().concat(i);else{if(s!==c)return null;n=r.concat(i.reverse().slice(1))}return a(n)}(t,e);return n||(r.push(t),e)}));return i&&r.push(i),r.length?1===r.length?r[0]:h(r.map((function(t){return t.coordinates}))):null}function Qt(t){return t[0].toString()+","+t[1].toString()}function $t(t,e){if(!I(e=e||{}))throw new Error("options is invalid");var n=e.mutate;if("FeatureCollection"!==K(t))throw new Error("geojson must be a FeatureCollection");if(!t.features.length)throw new Error("geojson is empty");!1!==n&&void 0!==n||(t=Gt(t));var r=function(t){var e={};F(t,(function(t){e[t.geometry.type]=!0}));var n=Object.keys(e);return 1===n.length?n[0]:null}(t);if(!r)throw new Error("geojson must be homogenous");switch(r){case"LineString":return Kt(t,e);case"Polygon":return function(t,e){if(!I(e=e||{}))throw new Error("options is invalid");var n=e.mutate;if("FeatureCollection"!==K(t))throw new Error("geojson must be a FeatureCollection");if(!t.features.length)throw new Error("geojson is empty");!1!==n&&void 0!==n||(t=Gt(t));var r=[];F(t,(function(t){r.push(t.geometry)}));var i=ws({geoms:f(r).geometry});return ps(i,i.objects.geoms.geometries)}(t,e);default:throw new Error(r+" is not supported")}}function te(t,n){var r="object"==typeof n?n.mutate:n;if(!t)throw new Error("geojson is required");var i=K(t),o=[];switch(i){case"LineString":o=ee(t);break;case"MultiLineString":case"Polygon":U(t).forEach((function(t){o.push(ee(t))}));break;case"MultiPolygon":U(t).forEach((function(t){var e=[];t.forEach((function(t){e.push(ee(t))})),o.push(e)}));break;case"Point":return t;case"MultiPoint":var s={};U(t).forEach((function(t){var e=t.join("-");s.hasOwnProperty(e)||(o.push(t),s[e]=!0)}));break;default:throw new Error(i+" geometry not supported")}return t.coordinates?!0===r?(t.coordinates=o,t):{type:i,coordinates:o}:!0===r?(t.geometry.coordinates=o,t):e({type:i,coordinates:o},t.properties,t.bbox,t.id)}function ee(t){var e=U(t);if(2===e.length&&!function(t,e){return t[0]===e[0]&&t[1]===e[1]}(e[0],e[1]))return e;var n,r,i,o=[],s=e.length-1;o.push(e[0]);for(var a=1;a<s;a++)n=e[a-1],r=e[a],function(t,e,n){var r=n[0],i=n[1],o=t[0],s=t[1],a=e[0],u=e[1],c=a-o,h=u-s;return(r-o)*h-(i-s)*c==0&&(Math.abs(c)>=Math.abs(h)?c>0?o<=r&&r<=a:a<=r&&r<=o:h>0?s<=i&&i<=u:u<=i&&i<=s)}(n,i=e[a+1],r)||o.push(r);return o.push(i),o}function ne(t,e){var n=t.x-e.x,r=t.y-e.y;return n*n+r*r}function re(t,e,n){var r=e.x,i=e.y,o=n.x-r,s=n.y-i;if(0!==o||0!==s){var a=((t.x-r)*o+(t.y-i)*s)/(o*o+s*s);a>1?(r=n.x,i=n.y):a>0&&(r+=o*a,i+=s*a)}return(o=t.x-r)*o+(s=t.y-i)*s}function ie(t,e,n,r,i){for(var o,s=r,a=e+1;a<n;a++){var u=re(t[a],t[e],t[n]);u>s&&(o=a,s=u)}s>r&&(o-e>1&&ie(t,e,o,r,i),i.push(t[o]),n-o>1&&ie(t,o,n,r,i))}function oe(t,e,n){if(t.length<=2)return t;var r=void 0!==e?e*e:1;return t=n?t:function(t,e){for(var n,r=t[0],i=[r],o=1,s=t.length;o<s;o++)ne(n=t[o],r)>e&&(i.push(n),r=n);return r!==n&&i.push(n),i}(t,r),function(t,e){var n=t.length-1,r=[t[0]];return ie(t,0,n,e,r),r.push(t[n]),r}(t,r)}function se(t,e,n){return oe(t.map((function(t){return{x:t[0],y:t[1],z:t[2]}})),e,n).map((function(t){return t.z?[t.x,t.y,t.z]:[t.x,t.y]}))}function ae(t,e,n){return t.map((function(t){var r=t.map((function(t){return{x:t[0],y:t[1]}}));if(r.length<4)throw new Error("invalid polygon");for(var i=oe(r,e,n).map((function(t){return[t.x,t.y]}));!function(t){return!(t.length<3||3===t.length&&t[2][0]===t[0][0]&&t[2][1]===t[0][1])}(i);)i=oe(r,e-=.01*e,n).map((function(t){return[t.x,t.y]}));return i[i.length-1][0]===i[0][0]&&i[i.length-1][1]===i[0][1]||i.push(i[0]),i}))}function ue(t,e){if(!I(e=e||{}))throw new Error("options is invalid");var n=e.resolution||1e4,r=e.sharpness||.85;if(!t)throw new Error("line is required");if(!b(n))throw new Error("resolution must be an number");if(!b(r))throw new Error("sharpness must be an number");for(var i=[],o=new bs({points:J(t).coordinates.map((function(t){return{x:t[0],y:t[1]}})),duration:n,sharpness:r}),s=0;s<o.duration;s+=10){var u=o.pos(s);Math.floor(s/100)%2==0&&i.push([u.x,u.y])}return a(i,t.properties)}function ce(t){N(t);var e=Number(t[0]),n=Number(t[1]),r=Number(t[2]),i=Number(t[3]);if(6===t.length)throw new Error("@turf/bbox-polygon does not support BBox with 6 positions");var s=[e,n];return o([[s,[r,n],[r,i],[e,i],s]])}function he(t){return ce(j(t))}function le(t){var e=t[0],n=t[1],r=t[2],i=t[3];if(qt(t.slice(0,2),[r,n])>=qt(t.slice(0,2),[e,i])){var o=(n+i)/2;return[e,o-(r-e)/2,r,o+(r-e)/2]}var s=(e+r)/2;return[s-(i-n)/2,n,s+(i-n)/2,i]}function pe(t,e,n,i){if(!I(i=i||{}))throw new Error("options is invalid");var o=i.units,s=i.properties,a=X(t),u=x(a[0]),c=x(a[1]),h=x(n),l=y(e,o),p=Math.asin(Math.sin(c)*Math.cos(l)+Math.cos(c)*Math.sin(l)*Math.cos(h));return r([v(u+Math.atan2(Math.sin(h)*Math.sin(l)*Math.cos(c),Math.cos(l)-Math.sin(c)*Math.sin(p))),v(p)],s)}function fe(t,e,n){var r=(n=n||{}).steps||64,i=n.properties;if(!t)throw new Error("center is required");if(!e)throw new Error("radius is required");if("object"!=typeof n)throw new Error("options must be an object");if("number"!=typeof r)throw new Error("steps must be a number");r=r||64,i=i||t.properties||{};for(var s=[],a=0;a<r;a++)s.push(pe(t,e,-360*a/r,n).geometry.coordinates);return s.push(s[0]),o([s],i)}function ge(t,e,n){if(!I(n=n||{}))throw new Error("options is invalid");if(!0===n.final)return function(t,e){var n=ge(e,t);return(n+180)%360}(t,e);var r=X(t),i=X(e),o=x(r[0]),s=x(i[0]),a=x(r[1]),u=x(i[1]),c=Math.sin(s-o)*Math.cos(u),h=Math.cos(a)*Math.sin(u)-Math.sin(a)*Math.cos(u)*Math.cos(s-o);return v(Math.atan2(c,h))}function de(t,e){if(!I(e=e||{}))throw new Error("options is invalid");var n=e.properties;if(!t)throw new Error("geojson is required");var i=j(t);return r([(i[0]+i[2])/2,(i[1]+i[3])/2],n)}function ye(t,e){var n=0,i=0,o=0;return S(t,(function(t){n+=t[0],i+=t[1],o++}),!0),r([n/o,i/o],e)}function _e(t,e){switch(K(t)){case"Point":return t;case"Polygon":var n=[];S(t,(function(t){n.push(t)}));var i,o,s,a,u,c,h,l,p=ye(t,e),f=p.geometry.coordinates,g=0,d=0,y=0,_=n.map((function(t){return[t[0]-f[0],t[1]-f[1]]}));for(i=0;i<n.length-1;i++)a=(o=_[i])[0],c=o[1],u=(s=_[i+1])[0],y+=l=a*(h=s[1])-u*c,g+=(a+u)*l,d+=(c+h)*l;if(0===y)return p;var m=1/(.5*y*6);return r([f[0]+m*g,f[1]+m*d],e);default:var v=Lt(t);return v?_e(v,e):ye(t,e)}}function me(t){var e=[];return"FeatureCollection"===t.type?O(t,(function(t){S(t,(function(n){e.push(r(n,t.properties))}))})):S(t,(function(n){e.push(r(n,t.properties))})),c(e)}function ve(t,e,n){n=n||2;var r,i,o,s,a,u,c,h=e&&e.length,l=h?e[0]*n:t.length,p=xe(t,0,l,n,!0),f=[];if(!p)return f;if(h&&(p=function(t,e,n,r){var i,o,s,a=[];for(i=0,o=e.length;i<o;i++)(s=xe(t,e[i]*r,i<o-1?e[i+1]*r:t.length,r,!1))===s.next&&(s.steiner=!0),a.push(function(t){var e=t,n=t;do{e.x<n.x&&(n=e),e=e.next}while(e!==t);return n}(s));for(a.sort(be),i=0;i<a.length;i++)!function(t,e){if(e=function(t,e){var n,r=e,i=t.x,o=t.y,s=-1/0;do{if(o<=r.y&&o>=r.next.y&&r.next.y!==r.y){var a=r.x+(o-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(a<=i&&a>s){if(s=a,a===i){if(o===r.y)return r;if(o===r.next.y)return r.next}n=r.x<r.next.x?r:r.next}}r=r.next}while(r!==e);if(!n)return null;if(i===s)return n.prev;var u,c=n,h=n.x,l=n.y,p=1/0;for(r=n.next;r!==c;)i>=r.x&&r.x>=h&&i!==r.x&&Ne(o<l?i:s,o,h,l,o<l?s:i,o,r.x,r.y)&&((u=Math.abs(o-r.y)/(i-r.x))<p||u===p&&r.x>n.x)&&Le(r,t)&&(n=r,p=u),r=r.next;return n}(t,e)){var n=Pe(e,t);Ee(n,n.next)}}(a[i],n),n=Ee(n,n.next);return n}(t,e,p,n)),t.length>80*n){r=o=t[0],i=s=t[1];for(var g=n;g<l;g+=n)(a=t[g])<r&&(r=a),(u=t[g+1])<i&&(i=u),a>o&&(o=a),u>s&&(s=u);c=0!==(c=Math.max(o-r,s-i))?1/c:0}return we(p,f,n,r,i,c),f}function xe(t,e,n,r,i){var o,s;if(i===Ae(t,e,n,r)>0)for(o=e;o<n;o+=r)s=Oe(o,t[o],t[o+1],s);else for(o=n-r;o>=e;o-=r)s=Oe(o,t[o],t[o+1],s);return s&&Se(s,s.next)&&(Re(s),s=s.next),s}function Ee(t,e){if(!t)return t;e||(e=t);var n,r=t;do{if(n=!1,r.steiner||!Se(r,r.next)&&0!==Ce(r.prev,r,r.next))r=r.next;else{if(Re(r),(r=e=r.prev)===r.next)break;n=!0}}while(n||r!==e);return e}function we(t,e,n,r,i,o,s){if(t){!s&&o&&function(t,e,n,r){var i=t;do{null===i.z&&(i.z=Ie(i.x,i.y,e,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,function(t){var e,n,r,i,o,s,a,u,c=1;do{for(n=t,t=null,o=null,s=0;n;){for(s++,r=n,a=0,e=0;e<c&&(a++,r=r.nextZ);e++);for(u=c;a>0||u>0&&r;)0!==a&&(0===u||!r||n.z<=r.z)?(i=n,n=n.nextZ,a--):(i=r,r=r.nextZ,u--),o?o.nextZ=i:t=i,i.prevZ=o,o=i;n=r}o.nextZ=null,c*=2}while(s>1)}(i)}(t,r,i,o);for(var a,u,c=t;t.prev!==t.next;)if(a=t.prev,u=t.next,o?function(t,e,n,r){var i=t.prev,o=t,s=t.next;if(Ce(i,o,s)>=0)return!1;for(var a=i.x<o.x?i.x<s.x?i.x:s.x:o.x<s.x?o.x:s.x,u=i.y<o.y?i.y<s.y?i.y:s.y:o.y<s.y?o.y:s.y,c=i.x>o.x?i.x>s.x?i.x:s.x:o.x>s.x?o.x:s.x,h=i.y>o.y?i.y>s.y?i.y:s.y:o.y>s.y?o.y:s.y,l=Ie(a,u,e,n,r),p=Ie(c,h,e,n,r),f=t.nextZ;f&&f.z<=p;){if(f!==t.prev&&f!==t.next&&Ne(i.x,i.y,o.x,o.y,s.x,s.y,f.x,f.y)&&Ce(f.prev,f,f.next)>=0)return!1;f=f.nextZ}for(f=t.prevZ;f&&f.z>=l;){if(f!==t.prev&&f!==t.next&&Ne(i.x,i.y,o.x,o.y,s.x,s.y,f.x,f.y)&&Ce(f.prev,f,f.next)>=0)return!1;f=f.prevZ}return!0}(t,r,i,o):function(t){var e=t.prev,n=t,r=t.next;if(Ce(e,n,r)>=0)return!1;for(var i=t.next.next;i!==t.prev;){if(Ne(e.x,e.y,n.x,n.y,r.x,r.y,i.x,i.y)&&Ce(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}(t))e.push(a.i/n),e.push(t.i/n),e.push(u.i/n),Re(t),t=u.next,c=u.next;else if((t=u)===c){s?1===s?we(t=function(t,e,n){var r=t;do{var i=r.prev,o=r.next.next;!Se(i,o)&&Me(i,r,r.next,o)&&Le(i,o)&&Le(o,i)&&(e.push(i.i/n),e.push(r.i/n),e.push(o.i/n),Re(r),Re(r.next),r=t=o),r=r.next}while(r!==t);return r}(t,e,n),e,n,r,i,o,2):2===s&&function(t,e,n,r,i,o){var s=t;do{for(var a=s.next.next;a!==s.prev;){if(s.i!==a.i&&function(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var n=t;do{if(n.i!==t.i&&n.next.i!==t.i&&n.i!==e.i&&n.next.i!==e.i&&Me(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}(t,e)&&Le(t,e)&&Le(e,t)&&function(t,e){var n=t,r=!1,i=(t.x+e.x)/2,o=(t.y+e.y)/2;do{n.y>o!=n.next.y>o&&n.next.y!==n.y&&i<(n.next.x-n.x)*(o-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next}while(n!==t);return r}(t,e)}(s,a)){var u=Pe(s,a);return s=Ee(s,s.next),u=Ee(u,u.next),we(s,e,n,r,i,o),void we(u,e,n,r,i,o)}a=a.next}s=s.next}while(s!==t)}(t,e,n,r,i,o):we(Ee(t),e,n,r,i,o,1);break}}}function be(t,e){return t.x-e.x}function Ie(t,e,n,r,i){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-n)*i)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-r)*i)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function Ne(t,e,n,r,i,o,s,a){return(i-s)*(e-a)-(t-s)*(o-a)>=0&&(t-s)*(r-a)-(n-s)*(e-a)>=0&&(n-s)*(o-a)-(i-s)*(r-a)>=0}function Ce(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function Se(t,e){return t.x===e.x&&t.y===e.y}function Me(t,e,n,r){return!!(Se(t,e)&&Se(n,r)||Se(t,r)&&Se(n,e))||Ce(t,e,n)>0!=Ce(t,e,r)>0&&Ce(n,r,t)>0!=Ce(n,r,e)>0}function Le(t,e){return Ce(t.prev,t,t.next)<0?Ce(t,e,t.next)>=0&&Ce(t,t.prev,e)>=0:Ce(t,e,t.prev)<0||Ce(t,t.next,e)<0}function Pe(t,e){var n=new Te(t.i,t.x,t.y),r=new Te(e.i,e.x,e.y),i=t.next,o=e.prev;return t.next=e,e.prev=t,n.next=i,i.prev=n,r.next=n,n.prev=r,o.next=r,r.prev=o,r}function Oe(t,e,n,r){var i=new Te(t,e,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function Re(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function Te(t,e,n){this.i=t,this.x=e,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function Ae(t,e,n,r){for(var i=0,o=e,s=n-r;o<n;o+=r)i+=(t[s]-t[o])*(t[o+1]+t[s+1]),s=o;return i}function De(t){var e=function(t){for(var e=t[0][0].length,n={vertices:[],holes:[],dimensions:e},r=0,i=0;i<t.length;i++){for(var o=0;o<t[i].length;o++)for(var s=0;s<e;s++)n.vertices.push(t[i][o][s]);i>0&&(r+=t[i-1].length,n.holes.push(r))}return n}(t),n=Is(e.vertices,e.holes,2),r=[],i=[];n.forEach((function(t,r){var o=n[r];i.push([e.vertices[2*o],e.vertices[2*o+1]])}));for(var s=0;s<i.length;s+=3){var a=i.slice(s,s+3);a.push(i[s]),r.push(o([a]))}return r}function Fe(t,e){if(!t)throw new Error("targetPoint is required");if(!e)throw new Error("points is required");var n,r=1/0;return O(e,(function(e,i){var o=qt(t,e);o<r&&((n=Gt(e)).properties.featureIndex=i,n.properties.distanceToPoint=o,r=o)})),n}function qe(t,e,n,r,i){Ge(t,e,n||0,r||t.length-1,i||function(t,e){return t<e?-1:t>e?1:0})}function Ge(t,e,n,r,i){for(;r>n;){if(r-n>600){var o=r-n+1,s=e-n+1,a=Math.log(o),u=.5*Math.exp(2*a/3),c=.5*Math.sqrt(a*u*(o-u)/o)*(s-o/2<0?-1:1);Ge(t,e,Math.max(n,Math.floor(e-s*u/o+c)),Math.min(r,Math.floor(e+(o-s)*u/o+c)),i)}var h=t[e],l=n,p=r;for(Be(t,n,e),i(t[r],h)>0&&Be(t,n,r);l<p;){for(Be(t,l,p),l++,p--;i(t[l],h)<0;)l++;for(;i(t[p],h)>0;)p--}0===i(t[n],h)?Be(t,n,p):Be(t,++p,r),p<=e&&(n=p+1),e<=p&&(r=p-1)}}function Be(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function ke(t,e){if(!(this instanceof ke))return new ke(t,e);this._maxEntries=Math.max(4,t||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),e&&this._initFormat(e),this.clear()}function ze(t,e){je(t,0,t.children.length,e,t)}function je(t,e,n,r,i){i||(i=Ze(null)),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(var o,s=e;s<n;s++)o=t.children[s],Xe(i,t.leaf?r(o):o);return i}function Xe(t,e){return t.minX=Math.min(t.minX,e.minX),t.minY=Math.min(t.minY,e.minY),t.maxX=Math.max(t.maxX,e.maxX),t.maxY=Math.max(t.maxY,e.maxY),t}function Ue(t,e){return t.minX-e.minX}function Ye(t,e){return t.minY-e.minY}function Ve(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function He(t){return t.maxX-t.minX+(t.maxY-t.minY)}function We(t,e){return t.minX<=e.minX&&t.minY<=e.minY&&e.maxX<=t.maxX&&e.maxY<=t.maxY}function Je(t,e){return e.minX<=t.maxX&&e.minY<=t.maxY&&e.maxX>=t.minX&&e.maxY>=t.minY}function Ze(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function Ke(t,e,n,r,i){for(var o,s=[e,n];s.length;)(n=s.pop())-(e=s.pop())<=r||(qe(t,o=e+Math.ceil((n-e)/r/2)*r,e,n,i),s.push(e,o,o,n))}function Qe(t){var e=ke(t);return e.insert=function(t){if(Array.isArray(t)){var e=t;(t=$e(e)).bbox=e}else t.bbox=t.bbox?t.bbox:tn(t);return ke.prototype.insert.call(this,t)},e.load=function(t){var e=[];return Array.isArray(t)?t.forEach((function(t){var n=$e(t);n.bbox=t,e.push(n)})):O(t,(function(t){t.bbox=t.bbox?t.bbox:tn(t),e.push(t)})),ke.prototype.load.call(this,e)},e.remove=function(t){if(Array.isArray(t)){var e=t;(t=$e(e)).bbox=e}return ke.prototype.remove.call(this,t)},e.clear=function(){return ke.prototype.clear.call(this)},e.search=function(t){return{type:"FeatureCollection",features:ke.prototype.search.call(this,this.toBBox(t))}},e.collides=function(t){return ke.prototype.collides.call(this,this.toBBox(t))},e.all=function(){return{type:"FeatureCollection",features:ke.prototype.all.call(this)}},e.toJSON=function(){return ke.prototype.toJSON.call(this)},e.fromJSON=function(t){return ke.prototype.fromJSON.call(this,t)},e.toBBox=function(t){var e;return{minX:(e=t.bbox?t.bbox:Array.isArray(t)&&4===t.length?t:tn(t))[0],minY:e[1],maxX:e[2],maxY:e[3]}},e}function $e(t){var e=[t[0],t[1]],n=[t[0],t[3]],r=[t[2],t[3]];return{type:"Feature",bbox:t,properties:{},geometry:{type:"Polygon",coordinates:[[e,[t[2],t[1]],r,n,e]]}}}function tn(t){var e=[1/0,1/0,-1/0,-1/0];return S(t,(function(t){e[0]>t[0]&&(e[0]=t[0]),e[1]>t[1]&&(e[1]=t[1]),e[2]<t[0]&&(e[2]=t[0]),e[3]<t[1]&&(e[3]=t[1])})),e}function en(t){if(!t)throw new Error("geojson is required");var e=[];return F(t,(function(t){!function(t,e){var n=[],r=t.geometry;switch(r.type){case"Polygon":n=U(r);break;case"LineString":n=[U(r)]}n.forEach((function(n){var r=function(t,e){var n=[];return t.reduce((function(t,r){var i=a([t,r],e);return i.bbox=function(t,e){var n=t[0],r=t[1],i=e[0],o=e[1];return[n<i?n:i,r<o?r:o,n>i?n:i,r>o?r:o]}(t,r),n.push(i),r})),n}(n,t.properties);r.forEach((function(t){t.id=e.length,e.push(t)}))}))}(t,e)})),c(e)}function nn(t,n){var r={},i=[];if("LineString"===t.type&&(t=e(t)),"LineString"===n.type&&(n=e(n)),"Feature"===t.type&&"Feature"===n.type&&"LineString"===t.geometry.type&&"LineString"===n.geometry.type&&2===t.geometry.coordinates.length&&2===n.geometry.coordinates.length){var o=rn(t,n);return o&&i.push(o),c(i)}var s=Qe();return s.load(en(n)),O(en(t),(function(t){O(s.search(t),(function(e){var n=rn(t,e);if(n){var o=U(n).join(",");r[o]||(r[o]=!0,i.push(n))}}))})),c(i)}function rn(t,e){var n=U(t),i=U(e);if(2!==n.length)throw new Error("<intersects> line1 must only contain 2 coordinates");if(2!==i.length)throw new Error("<intersects> line2 must only contain 2 coordinates");var o=n[0][0],s=n[0][1],a=n[1][0],u=n[1][1],c=i[0][0],h=i[0][1],l=i[1][0],p=i[1][1],f=(p-h)*(a-o)-(l-c)*(u-s);if(0===f)return null;var g=((l-c)*(s-h)-(p-h)*(o-c))/f,d=((a-o)*(s-h)-(u-s)*(o-c))/f;return g>=0&&g<=1&&d>=0&&d<=1?r([o+g*(a-o),s+g*(u-s)]):null}function on(t,e,n){if(!I(n=n||{}))throw new Error("options is invalid");var i=t.geometry?t.geometry.type:t.type;if("LineString"!==i&&"MultiLineString"!==i)throw new Error("lines must be LineString or MultiLineString");var o=r([1/0,1/0],{dist:1/0}),s=0;return F(t,(function(t){for(var i=U(t),u=0;u<i.length-1;u++){var c=r(i[u]);c.properties.dist=qt(e,c,n);var h=r(i[u+1]);h.properties.dist=qt(e,h,n);var l=qt(c,h,n),p=Math.max(c.properties.dist,h.properties.dist),f=ge(c,h),g=pe(e,p,f+90,n),d=pe(e,p,f-90,n),y=nn(a([g.geometry.coordinates,d.geometry.coordinates]),a([c.geometry.coordinates,h.geometry.coordinates])),_=null;y.features.length>0&&((_=y.features[0]).properties.dist=qt(e,_,n),_.properties.location=s+qt(c,_,n)),c.properties.dist<o.properties.dist&&((o=c).properties.index=u,o.properties.location=s),h.properties.dist<o.properties.dist&&((o=h).properties.index=u+1,o.properties.location=s+l),_&&_.properties.dist<o.properties.dist&&((o=_).properties.index=u),s+=l}})),o}function sn(t,e,n){if(!I(n=n||{}))throw new Error("options is invalid");var r,i=n.final;if(!t)throw new Error("start point is required");if(!e)throw new Error("end point is required");return(r=i?an(X(e),X(t)):an(X(t),X(e)))>180?-(360-r):r}function an(t,e){var n=x(t[1]),r=x(e[1]),i=x(e[0]-t[0]);i>Math.PI&&(i-=2*Math.PI),i<-Math.PI&&(i+=2*Math.PI);var o=Math.log(Math.tan(r/2+Math.PI/4)/Math.tan(n/2+Math.PI/4));return(v(Math.atan2(i,o))+360)%360}function un(t,e,n){if(!I(n=n||{}))throw new Error("options is invalid");var r=n.units;if(!t)throw new Error("from point is required");if(!e)throw new Error("to point is required");var i=X(t),o=X(e);return o[0]+=o[0]-i[0]>180?-360:i[0]-o[0]>180?360:0,E(function(t,e,n){var r=n=void 0===n?Fo:Number(n),i=t[1]*Math.PI/180,o=e[1]*Math.PI/180,s=o-i,a=Math.abs(e[0]-t[0])*Math.PI/180;a>Math.PI&&(a-=2*Math.PI);var u=Math.log(Math.tan(o/2+Math.PI/4)/Math.tan(i/2+Math.PI/4)),c=Math.abs(u)>1e-11?s/u:Math.cos(i);return Math.sqrt(s*s+c*c*a*a)*r}(i,o),"meters",r)}function cn(t,e){return ln(t,"mercator",e)}function hn(t,e){return ln(t,"wgs84",e)}function ln(t,e,n){if(!I(n=n||{}))throw new Error("options is invalid");var r=n.mutate;if(!t)throw new Error("geojson is required");return Array.isArray(t)&&b(t[0])?t="mercator"===e?pn(t):fn(t):(!0!==r&&(t=Gt(t)),S(t,(function(t){var n="mercator"===e?pn(t):fn(t);t[0]=n[0],t[1]=n[1]}))),t}function pn(t){var e=Math.PI/180,n=20037508.342789244,r=[6378137*(Math.abs(t[0])<=180?t[0]:t[0]-360*function(t){return t<0?-1:t>0?1:0}(t[0]))*e,6378137*Math.log(Math.tan(.25*Math.PI+.5*t[1]*e))];return r[0]>n&&(r[0]=n),r[0]<-n&&(r[0]=-n),r[1]>n&&(r[1]=n),r[1]<-n&&(r[1]=-n),r}function fn(t){var e=180/Math.PI;return[t[0]*e/6378137,(.5*Math.PI-2*Math.atan(Math.exp(-t[1]/6378137)))*e]}function gn(t,n,i){if(!I(i=i||{}))throw new Error("options is invalid");if(!t)throw new Error("pt is required");if(Array.isArray(t)?t=r(t):"Point"===t.type?t=e(t):H(t,"Point","point"),!n)throw new Error("line is required");Array.isArray(n)?n=a(n):"LineString"===n.type?n=e(n):H(n,"LineString","line");var o=1/0,s=t.geometry.coordinates;return G(n,(function(t){var e=t.geometry.coordinates[0],n=t.geometry.coordinates[1],a=function(t,e,n,i){var o=i.mercator,s=!0!==o?qt(e,t,i):dn(e,t,i),a=m(!0!==o?ge(e,t):sn(e,t)),u=m(!0!==o?ge(e,n):sn(e,n)),c=Math.abs(a-u);if(c>90)return s;var h=(u+180)%360,l=m(!0!==o?ge(n,t):sn(n,t)),p=Math.abs(l-h);return p>180&&(p=Math.abs(p-360)),p>90?!0!==o?qt(t,n,i):dn(t,n,i):!0!==o?s*Math.sin(x(c)):function(t,e,n,i){var o=0;(Math.abs(t[0])>=180||Math.abs(e[0])>=180||Math.abs(n[0])>=180)&&(o=t[0]>0||e[0]>0||n[0]>0?-180:180);var s=r(n),a=hn(function(t,e,n){var r=t[0],i=t[1],o=e[0]-r,s=e[1]-i,a=((n[0]-r)*o+(n[1]-i)*s)/(o*o+s*s);return[r+a*o,i+a*s]}(cn([t[0]+o,t[1]]),cn([e[0]+o,e[1]]),cn([n[0]+o,n[1]])));return 0!==o&&(a[0]-=o),un(s,a,i)}(e,n,t,i)}(s,e,n,i);o>a&&(o=a)})),o}function dn(t,e,n){var r=n.units,i=0;Math.abs(t[0])>=180&&(i=t[0]>0?-180:180),Math.abs(e[0])>=180&&(i=e[0]>0?-180:180);var o=cn([t[0]+i,t[1]]),s=cn([e[0]+i,e[1]]),a=function(t){return t*t},u=a(o[0]-s[0])+a(o[1]-s[1]);return E(Math.sqrt(u),"meters",r)}function yn(t){for(var n=function(t){return"FeatureCollection"!==t.type?"Feature"!==t.type?c([e(t)]):c([t]):t}(t),i=de(n),o=!1,s=0;!o&&s<n.features.length;){var a,u=n.features[s].geometry,h=!1;if("Point"===u.type)i.geometry.coordinates[0]===u.coordinates[0]&&i.geometry.coordinates[1]===u.coordinates[1]&&(o=!0);else if("MultiPoint"===u.type){var l=!1;for(a=0;!l&&a<u.coordinates.length;)i.geometry.coordinates[0]===u.coordinates[a][0]&&i.geometry.coordinates[1]===u.coordinates[a][1]&&(o=!0,l=!0),a++}else if("LineString"===u.type)for(a=0;!h&&a<u.coordinates.length-1;)_n(i.geometry.coordinates[0],i.geometry.coordinates[1],u.coordinates[a][0],u.coordinates[a][1],u.coordinates[a+1][0],u.coordinates[a+1][1])&&(h=!0,o=!0),a++;else if("MultiLineString"===u.type)for(var p=0;p<u.coordinates.length;){h=!1,a=0;for(var f=u.coordinates[p];!h&&a<f.length-1;)_n(i.geometry.coordinates[0],i.geometry.coordinates[1],f[a][0],f[a][1],f[a+1][0],f[a+1][1])&&(h=!0,o=!0),a++;p++}else"Polygon"!==u.type&&"MultiPolygon"!==u.type||Pt(i,u)&&(o=!0);s++}if(o)return i;var g=c([]);for(s=0;s<n.features.length;s++)g.features=g.features.concat(me(n.features[s]).features);return r(Fe(i,g).geometry.coordinates)}function _n(t,e,n,r,i,o){return Math.sqrt((i-n)*(i-n)+(o-r)*(o-r))===Math.sqrt((t-n)*(t-n)+(e-r)*(e-r))+Math.sqrt((i-t)*(i-t)+(o-e)*(o-e))}function mn(t){return D(t,(function(t,e){return t+vn(e)}),0)}function vn(t){var e,n=0;switch(t.type){case"Polygon":return xn(t.coordinates);case"MultiPolygon":for(e=0;e<t.coordinates.length;e++)n+=xn(t.coordinates[e]);return n;case"Point":case"MultiPoint":case"LineString":case"MultiLineString":return 0;case"GeometryCollection":for(e=0;e<t.geometries.length;e++)n+=vn(t.geometries[e]);return n}}function xn(t){var e=0;if(t&&t.length>0){e+=Math.abs(En(t[0]));for(var n=1;n<t.length;n++)e-=Math.abs(En(t[n]))}return e}function En(t){var e,n,r,i,o,s,a=0,u=t.length;if(u>2){for(s=0;s<u;s++)s===u-2?(r=u-2,i=u-1,o=0):s===u-1?(r=u-1,i=0,o=1):(r=s,i=s+1,o=s+2),e=t[r],n=t[i],a+=(wn(t[o][0])-wn(e[0]))*Math.sin(wn(n[1]));a=a*Ss*Ss/2}return a}function wn(t){return t*Math.PI/180}function bn(t,e){if(!I(e=e||{}))throw new Error("options is invalid");if(!t)throw new Error("geojson is required");return B(t,(function(t,n){var r=n.geometry.coordinates;return t+qt(r[0],r[1],e)}),0)}function In(t,e,n,r){if(!I(r=r||{}))throw new Error("options is invalid");var i,o=[];if("Feature"===t.type)i=t.geometry.coordinates;else{if("LineString"!==t.type)throw new Error("input must be a LineString Feature or Geometry");i=t.coordinates}for(var s,u,c,h=0,l=0;l<i.length&&!(e>=h&&l===i.length-1);l++){if(h>e&&0===o.length){if(!(s=e-h))return o.push(i[l]),a(o);u=ge(i[l],i[l-1])-180,c=pe(i[l],s,u,r),o.push(c.geometry.coordinates)}if(h>=n)return(s=n-h)?(u=ge(i[l],i[l-1])-180,c=pe(i[l],s,u,r),o.push(c.geometry.coordinates),a(o)):(o.push(i[l]),a(o));if(h>=e&&o.push(i[l]),l===i.length-1)return a(o);h+=qt(i[l],i[l+1],r)}return a(i[i.length-1])}function Nn(t,e,n){var r=(n=n||{}).ignoreEndVertices;if(!I(n))throw new Error("invalid options");if(!t)throw new Error("pt is required");if(!e)throw new Error("line is required");for(var i=X(t),o=U(e),s=0;s<o.length-1;s++){var a=!1;if(r&&(0===s&&(a="start"),s===o.length-2&&(a="end"),0===s&&s+1===o.length-1&&(a="both")),function(t,e,n,r){var i=n[0],o=n[1],s=t[0],a=t[1],u=e[0],c=e[1],h=u-s,l=c-a;return(n[0]-s)*l-(n[1]-a)*h==0&&(r?"start"===r?Math.abs(h)>=Math.abs(l)?h>0?s<i&&i<=u:u<=i&&i<s:l>0?a<o&&o<=c:c<=o&&o<a:"end"===r?Math.abs(h)>=Math.abs(l)?h>0?s<=i&&i<u:u<i&&i<=s:l>0?a<=o&&o<c:c<o&&o<=a:"both"===r?Math.abs(h)>=Math.abs(l)?h>0?s<i&&i<u:u<i&&i<s:l>0?a<o&&o<c:c<o&&o<a:void 0:Math.abs(h)>=Math.abs(l)?h>0?s<=i&&i<=u:u<=i&&i<=s:l>0?a<=o&&o<=c:c<=o&&o<=a)}(o[s],o[s+1],i,a))return!0}return!1}function Cn(t,e){var n=K(t),r=K(e),i=J(t),o=J(e);switch(n){case"Point":switch(r){case"MultiPoint":return function(t,e){var n,r=!1;for(n=0;n<e.coordinates.length;n++)if(Mn(e.coordinates[n],t.coordinates)){r=!0;break}return r}(i,o);case"LineString":return Nn(i,o,{ignoreEndVertices:!0});case"Polygon":return Pt(i,o,{ignoreBoundary:!0});default:throw new Error("feature2 "+r+" geometry not supported")}case"MultiPoint":switch(r){case"MultiPoint":return function(t,e){for(var n=0;n<t.coordinates.length;n++){for(var r=!1,i=0;i<e.coordinates.length;i++)Mn(t.coordinates[n],e.coordinates[i])&&(r=!0);if(!r)return!1}return!0}(i,o);case"LineString":return function(t,e){for(var n=!1,r=0;r<t.coordinates.length;r++){if(!Nn(t.coordinates[r],e))return!1;n||(n=Nn(t.coordinates[r],e,{ignoreEndVertices:!0}))}return n}(i,o);case"Polygon":return function(t,e){for(var n=!0,r=0;r<t.coordinates.length;r++){var i=Pt(t.coordinates[1],e);if(!i){n=!1;break}i=Pt(t.coordinates[1],e,{ignoreBoundary:!0})}return n&&i}(i,o);default:throw new Error("feature2 "+r+" geometry not supported")}case"LineString":switch(r){case"LineString":return function(t,e){for(var n=0;n<t.coordinates.length;n++)if(!Nn(t.coordinates[n],e))return!1;return!0}(i,o);case"Polygon":return function(t,e){if(!Sn(j(e),j(t)))return!1;for(var n=!1,r=0;r<t.coordinates.length-1;r++){if(!Pt(t.coordinates[r],e))return!1;if(n||(n=Pt(t.coordinates[r],e,{ignoreBoundary:!0})),!n){var i=function(t,e){return[(t[0]+e[0])/2,(t[1]+e[1])/2]}(t.coordinates[r],t.coordinates[r+1]);n=Pt(i,e,{ignoreBoundary:!0})}}return n}(i,o);default:throw new Error("feature2 "+r+" geometry not supported")}case"Polygon":if("Polygon"===r)return function(t,e){var n=j(t);if(!Sn(j(e),n))return!1;for(var r=0;r<t.coordinates[0].length;r++)if(!Pt(t.coordinates[0][r],e))return!1;return!0}(i,o);throw new Error("feature2 "+r+" geometry not supported");default:throw new Error("feature1 "+n+" geometry not supported")}}function Sn(t,e){return!(t[0]>e[0])&&!(t[2]<e[2])&&!(t[1]>e[1])&&!(t[3]<e[3])}function Mn(t,e){return t[0]===e[0]&&t[1]===e[1]}function Ln(t,e,n){if(!I(n=n||{}))throw new Error("options is invalid");var i=n.mask,o=n.properties,s=[];if(null===e||void 0===e)throw new Error("cellSide is required");if(!b(e))throw new Error("cellSide is invalid");if(!t)throw new Error("bbox is required");if(!Array.isArray(t))throw new Error("bbox must be array");if(4!==t.length)throw new Error("bbox must contain 4 numbers");if(i&&-1===["Polygon","MultiPolygon"].indexOf(K(i)))throw new Error("options.mask must be a (Multi)Polygon");for(var a=t[0],u=t[1],h=t[2],l=t[3],p=e/qt([a,u],[h,u],n)*(h-a),f=e/qt([a,u],[a,l],n)*(l-u),g=h-a,d=l-u,y=Math.floor(g/p),_=(d-Math.floor(d/f)*f)/2,m=a+(g-y*p)/2;m<=h;){for(var v=u+_;v<=l;){var x=r([m,v],o);i?Cn(x,i)&&s.push(x):s.push(x),v+=f}m+=p}return c(s)}function Pn(t,e){if(!I(e=e||{}))throw new Error("options is invalid");var n=e.precision,r=e.coordinates,i=e.mutate;if(n=void 0===n||null===n||isNaN(n)?6:n,r=void 0===r||null===r||isNaN(r)?3:r,!t)throw new Error("<geojson> is required");if("number"!=typeof n)throw new Error("<precision> must be a number");if("number"!=typeof r)throw new Error("<coordinates> must be a number");!1!==i&&void 0!==i||(t=JSON.parse(JSON.stringify(t)));var o=Math.pow(10,n);return S(t,(function(t){!function(t,e,n){t.length>n&&t.splice(n,t.length);for(var r=0;r<t.length;r++)t[r]=Math.round(t[r]*e)/e}(t,o,r)})),t}function On(t,e){if(!t||!e)return!1;if(t.length!==e.length)return!1;for(var n=0,r=t.length;n<r;n++)if(t[n]instanceof Array&&e[n]instanceof Array){if(!On(t[n],e[n]))return!1}else if(t[n]!==e[n])return!1;return!0}function Rn(t,e){if(void 0===e&&(e=!0),3!=t.length)throw new Error("This function requires an array of three points [x,y]");return(t[1][0]-t[0][0])*(t[2][1]-t[0][1])-(t[1][1]-t[0][1])*(t[2][0]-t[0][0])>=0==e}function Tn(t,e){if(!t||!e)return!1;if(t.length!=e.length)return!1;for(var n=0,r=t.length;n<r;n++)if(t[n]instanceof Array&&e[n]instanceof Array){if(!Tn(t[n],e[n]))return!1}else if(t[n]!=e[n])return!1;return!0}function An(t,e){var n=[],r=Qe();return F(e,(function(e){if(n.forEach((function(t,e){t.id=e})),n.length){var i=r.search(e);if(i.features.length){var o=Fn(e,i);n=n.filter((function(t){return t.id!==o.id})),r.remove(o),O(Dn(o,e),(function(t){n.push(t),r.insert(t)}))}}else(n=Dn(t,e).features).forEach((function(t){t.bbox||(t.bbox=le(j(t)))})),r.load(c(n))})),c(n)}function Dn(t,e){var n=[],r=U(t)[0],i=U(t)[t.geometry.coordinates.length-1];if(qn(r,X(e))||qn(i,X(e)))return c([t]);var o=Qe(),s=en(t);o.load(s);var u=o.search(e);if(!u.features.length)return c([t]);var h=Fn(e,u),l=R(s,(function(t,r,i){var o=U(r)[1],s=X(e);return i===h.id?(t.push(s),n.push(a(t)),qn(s,o)?[s]:[s,o]):(t.push(o),t)}),[r]);return l.length>1&&n.push(a(l)),c(n)}function Fn(t,e){if(!e.features.length)throw new Error("lines must contain features");if(1===e.features.length)return e.features[0];var n,r=1/0;return O(e,(function(e){var i=on(e,t).properties.dist;i<r&&(n=e,r=i)})),n}function qn(t,e){return t[0]===e[0]&&t[1]===e[1]}function Gn(t,e,n,r,i){if(!I(i=i||{}))throw new Error("options is invalid");var o=i.steps,s=i.units;if(!t)throw new Error("center is required");if(!e)throw new Error("radius is required");if(void 0===n||null===n)throw new Error("bearing1 is required");if(void 0===r||null===r)throw new Error("bearing2 is required");if("object"!=typeof i)throw new Error("options must be an object");o=o||64;var u=Bn(n),c=Bn(r),h=t.properties;if(u===c)return a(fe(t,e,i).geometry.coordinates[0],h);for(var l=u,p=u<c?c:c+360,f=l,g=[],d=0;f<p;)g.push(pe(t,e,f,s).geometry.coordinates),f=l+360*++d/o;return f>p&&g.push(pe(t,e,p,s).geometry.coordinates),a(g,h)}function Bn(t){var e=t%360;return e<0&&(e+=360),e}function kn(t,e){if(!I(e=e||{}))throw new Error("options is invalid");var n=e.properties,r=K(t),i=U(t);if(n=n||t.properties||{},!i.length)throw new Error("polygon must contain coordinates");switch(r){case"Polygon":return zn(i,n);case"MultiPolygon":var o=[];return i.forEach((function(t){o.push(zn(t,n))})),c(o);default:throw new Error("geom "+r+" not supported")}}function zn(t,e){return t.length>1?h(t,e):a(t[0],e)}function jn(t,e){if(!I(e=e||{}))throw new Error("options is invalid");var n=e.properties,r=e.autoComplete,i=e.orderCoords;if(!t)throw new Error("lines is required");switch(r=void 0===r||r,i=void 0===i||i,K(t)){case"FeatureCollection":case"GeometryCollection":var o=[];return(t.features?t.features:t.geometries).forEach((function(t){o.push(U(Xn(t,{},r,i)))})),p(o,n)}return Xn(t,n,r,i)}function Xn(t,e,n,r){e=e||t.properties||{};var i=U(t),s=K(t);if(!i.length)throw new Error("line must contain coordinates");switch(s){case"LineString":return n&&(i=Un(i)),o([i],e);case"MultiLineString":var u=[],c=0;return i.forEach((function(t){if(n&&(t=Un(t)),r){var e=function(t){var e=t[0],n=t[1],r=t[2],i=t[3];return Math.abs(e-r)*Math.abs(n-i)}(j(a(t)));e>c?(u.unshift(t),c=e):u.push(t)}else u.push(t)})),o(u,e);default:throw new Error("geometry type "+s+" is not supported")}}function Un(t){var e=t[0],n=e[0],r=e[1],i=t[t.length-1],o=i[0],s=i[1];return n===o&&r===s||t.push(e),t}function Yn(t,e,n){var r,i,o,s,a,u=t.length,c=Hn(t[0],e),h=[];for(n||(n=[]),r=1;r<u;r++){for(i=t[r-1],s=a=Hn(o=t[r],e);;){if(!(c|s)){h.push(i),s!==a?(h.push(o),r<u-1&&(n.push(h),h=[])):r===u-1&&h.push(o);break}if(c&s)break;c?c=Hn(i=Vn(i,o,c,e),e):s=Hn(o=Vn(i,o,s,e),e)}c=a}return h.length&&n.push(h),n}function Vn(t,e,n,r){return 8&n?[t[0]+(e[0]-t[0])*(r[3]-t[1])/(e[1]-t[1]),r[3]]:4&n?[t[0]+(e[0]-t[0])*(r[1]-t[1])/(e[1]-t[1]),r[1]]:2&n?[r[2],t[1]+(e[1]-t[1])*(r[2]-t[0])/(e[0]-t[0])]:1&n?[r[0],t[1]+(e[1]-t[1])*(r[0]-t[0])/(e[0]-t[0])]:null}function Hn(t,e){var n=0;return t[0]<e[0]?n|=1:t[0]>e[2]&&(n|=2),t[1]<e[1]?n|=4:t[1]>e[3]&&(n|=8),n}function Wn(t,e){for(var n=[],r=0;r<t.length;r++){var i=Gs.polygon(t[r],e);i.length>0&&(i[0][0]===i[i.length-1][0]&&i[0][1]===i[i.length-1][1]||i.push(i[0]),i.length>=4&&n.push(i))}return n}function Jn(t){return"[object Arguments]"===Object.prototype.toString.call(t)}function Zn(t,e,n){return n||(n={}),t===e||(t instanceof Date&&e instanceof Date?t.getTime()===e.getTime():!t||!e||"object"!=typeof t&&"object"!=typeof e?(n.strict,t===e):function(t,e,n){var r,i;if(Kn(t)||Kn(e))return!1;if(t.prototype!==e.prototype)return!1;if(Jn(t))return!!Jn(e)&&Zn(t=Bs.call(t),e=Bs.call(e),n);if(Qn(t)){if(!Qn(e))return!1;if(t.length!==e.length)return!1;for(r=0;r<t.length;r++)if(t[r]!==e[r])return!1;return!0}try{var o=Object.keys(t),s=Object.keys(e)}catch(t){return!1}if(o.length!==s.length)return!1;for(o.sort(),s.sort(),r=o.length-1;r>=0;r--)if(o[r]!==s[r])return!1;for(r=o.length-1;r>=0;r--)if(!Zn(t[i=o[r]],e[i],n))return!1;return typeof t==typeof e}(t,e,n))}function Kn(t){return null===t||void 0===t}function Qn(t){return!(!t||"object"!=typeof t||"number"!=typeof t.length)&&"function"==typeof t.copy&&"function"==typeof t.slice&&!(t.length>0&&"number"!=typeof t[0])}function $n(t,e,n){if(!I(n=n||{}))throw new Error("options is invalid");var r,i=n.tolerance||0,o=[],s=Qe();return s.load(en(t)),G(e,(function(t){var e=!1;O(s.search(t),(function(n){if(!1===e){var o=U(t).sort(),s=U(n).sort();Zn(o,s)||(0===i?Nn(o[0],n)&&Nn(o[1],n):on(n,o[0]).properties.dist<=i&&on(n,o[1]).properties.dist<=i)?(e=!0,r=r?tr(r,t):t):(0===i?Nn(s[0],t)&&Nn(s[1],t):on(t,s[0]).properties.dist<=i&&on(t,s[1]).properties.dist<=i)&&(r=r?tr(r,n):n)}})),!1===e&&r&&(o.push(r),r=void 0)})),r&&o.push(r),c(o)}function tr(t,e){var n=U(e),r=U(t),i=r[0],o=r[r.length-1],s=t.geometry.coordinates;return Zn(n[0],i)?s.unshift(n[1]):Zn(n[0],o)?s.push(n[1]):Zn(n[1],i)?s.unshift(n[0]):Zn(n[1],o)&&s.push(n[0]),t}function er(t){var e=t%360;return e<0&&(e+=360),e}function nr(t,e,n,i){if(!I(i=i||{}))throw new Error("options is invalid");var o=i.units,s=i.properties;if(!t)throw new Error("origin is required");if(void 0===e||null===e)throw new Error("distance is required");if(void 0===n||null===n)throw new Error("bearing is required");if(!(e>=0))throw new Error("distance must be greater than 0");var a=E(e,o,"meters"),u=X(t),c=function(t,e,n,r){var i=e/(r=void 0===r?Fo:Number(r)),o=t[0]*Math.PI/180,s=x(t[1]),a=x(n),u=i*Math.cos(a),c=s+u;Math.abs(c)>Math.PI/2&&(c=c>0?Math.PI-c:-Math.PI-c);var h=Math.log(Math.tan(c/2+Math.PI/4)/Math.tan(s/2+Math.PI/4)),l=Math.abs(h)>1e-11?u/h:Math.cos(s);return[(180*(o+i*Math.sin(a)/l)/Math.PI+540)%360-180,180*c/Math.PI]}(u,a,n);return c[0]+=c[0]-u[0]>180?-360:u[0]-c[0]>180?360:0,r(c,s)}function rr(t,e,n,r,i,o){for(var s=0;s<t.length;s++){var a=t[s],u=t[s+1];s===t.length-1&&(u=t[0]),r=ir(a,u,e),n<=0&&r>0?function(t,e,n){return ir(t,e,n)<0}(e,a,i)||(i=a):n>0&&r<=0&&(function(t,e,n){return ir(t,e,n)>0}(e,a,o)||(o=a)),n=r}return[i,o]}function ir(t,e,n){return(e[0]-t[0])*(n[1]-t[1])-(n[0]-t[0])*(e[1]-t[1])}function or(t){if(!t)throw new Error("line is required");var e=t.geometry?t.geometry.type:t.type;if(!Array.isArray(t)&&"LineString"!==e)throw new Error("geometry must be a LineString");for(var n,r,i=U(t),o=0,s=1;s<i.length;)n=r||i[0],o+=((r=i[s])[0]-n[0])*(r[1]+n[1]),s++;return o>0}function sr(t,e){switch("Feature"===t.type?t.geometry.type:t.type){case"GeometryCollection":return A(t,(function(t){sr(t,e)})),t;case"LineString":return ar(U(t),e),t;case"Polygon":return ur(U(t),e),t;case"MultiLineString":return U(t).forEach((function(t){ar(t,e)})),t;case"MultiPolygon":return U(t).forEach((function(t){ur(t,e)})),t;case"Point":case"MultiPoint":return t}}function ar(t,e){or(t)===e&&t.reverse()}function ur(t,e){or(t[0])!==e&&t[0].reverse();for(var n=1;n<t.length;n++)or(t[n])===e&&t[n].reverse()}function cr(t,e){if(!I(e=e||{}))throw new Error("options is invalid");var n=e.zProperty||"elevation",r=e.flip,i=e.flags;W(t,"Point","input must contain Points");for(var o=function(t,e){var n={};return O(t,(function(t){var e=U(t)[1];n[e]||(n[e]=[]),n[e].push(t)})),Object.keys(n).map((function(t){var e=n[t].sort((function(t,e){return U(t)[0]-U(e)[0]}));return e})).sort((function(t,n){return e?U(t[0])[1]-U(n[0])[1]:U(n[0])[1]-U(t[0])[1]}))}(t,r),s=[],a=0;a<o.length;a++){for(var u=o[a],c=[],h=0;h<u.length;h++){var l=u[h];l.properties[n]?c.push(l.properties[n]):c.push(0),!0===i&&(l.properties.matrixPosition=[a,h])}s.push(c)}return s}function hr(t,e,n,r){r=r||{};for(var i=Object.keys(ks),o=0;o<i.length;o++){var s=i[o],a=r[s];a=void 0!==a&&null!==a?a:ks[s],zs[s]=a}zs.verbose&&console.log("MarchingSquaresJS-isoBands: computing isobands for ["+e+":"+(e+n)+"]");var u,c=function(t,e,n){for(var r=t.length-1,i=t[0].length-1,o={rows:r,cols:i,cells:[]},s=e+Math.abs(n),a=0;a<r;++a){o.cells[a]=[];for(var u=0;u<i;++u){var c=0,h=t[a+1][u],l=t[a+1][u+1],p=t[a][u+1],f=t[a][u];if(!(isNaN(h)||isNaN(l)||isNaN(p)||isNaN(f))){c|=h<e?0:h>s?128:64,c|=l<e?0:l>s?32:16,c|=p<e?0:p>s?8:4;var g=+(c|=f<e?0:f>s?2:1),d=0;if(17===c||18===c||33===c||34===c||38===c||68===c||72===c||98===c||102===c||132===c||136===c||137===c||152===c||153===c){var y=(h+l+p+f)/4;d=y>s?2:y<e?0:1,34===c?1===d?c=35:0===d&&(c=136):136===c?1===d?(c=35,d=4):0===d&&(c=34):17===c?1===d?(c=155,d=4):0===d&&(c=153):68===c?1===d?(c=103,d=4):0===d&&(c=102):153===c?1===d&&(c=155):102===c?1===d&&(c=103):152===c?d<2&&(c=156,d=1):137===c?d<2&&(c=139,d=1):98===c?d<2&&(c=99,d=1):38===c?d<2&&(c=39,d=1):18===c?d>0?(c=156,d=4):c=152:33===c?d>0?(c=139,d=4):c=137:72===c?d>0?(c=99,d=4):c=98:132===c&&(d>0?(c=39,d=4):c=38)}if(0!=c&&170!=c){var _,m,v,x,E,w,b,I;_=m=v=x=E=w=b=I=.5;var N=[];1===c?(v=1-lr(e,p,f),I=1-lr(e,h,f),N.push(Sa[c])):169===c?(v=lr(s,f,p),I=lr(s,f,h),N.push(Sa[c])):4===c?(w=1-lr(e,l,p),x=lr(e,f,p),N.push(Na[c])):166===c?(w=lr(s,p,l),x=1-lr(s,p,f),N.push(Na[c])):16===c?(E=lr(e,p,l),m=lr(e,h,l),N.push(Ia[c])):154===c?(E=1-lr(s,l,p),m=1-lr(s,l,h),N.push(Ia[c])):64===c?(b=lr(e,f,h),_=1-lr(e,l,h),N.push(La[c])):106===c?(b=1-lr(s,h,f),_=lr(s,h,l),N.push(La[c])):168===c?(x=lr(s,f,p),v=lr(e,f,p),I=lr(e,f,h),b=lr(s,f,h),N.push(Ca[c]),N.push(Sa[c])):2===c?(x=1-lr(e,p,f),v=1-lr(s,p,f),I=1-lr(s,h,f),b=1-lr(e,h,f),N.push(Ca[c]),N.push(Sa[c])):162===c?(E=lr(s,p,l),w=lr(e,p,l),x=1-lr(e,p,f),v=1-lr(s,p,f),N.push(Ca[c]),N.push(Sa[c])):8===c?(E=1-lr(e,l,p),w=1-lr(s,l,p),x=lr(s,f,p),v=lr(e,f,p),N.push(Ia[c]),N.push(Na[c])):138===c?(E=1-lr(e,l,p),w=1-lr(s,l,p),_=1-lr(s,l,h),m=1-lr(e,l,h),N.push(Ia[c]),N.push(Na[c])):32===c?(E=lr(s,p,l),w=lr(e,p,l),_=lr(e,h,l),m=lr(s,h,l),N.push(Ia[c]),N.push(Na[c])):42===c?(I=1-lr(s,h,f),b=1-lr(e,h,f),_=lr(e,h,l),m=lr(s,h,l),N.push(Ma[c]),N.push(La[c])):128===c&&(I=lr(e,f,h),b=lr(s,f,h),_=1-lr(s,l,h),m=1-lr(e,l,h),N.push(Ma[c]),N.push(La[c])),5===c?(w=1-lr(e,l,p),I=1-lr(e,h,f),N.push(Na[c])):165===c?(w=lr(s,p,l),I=lr(s,f,h),N.push(Na[c])):20===c?(x=lr(e,f,p),m=lr(e,h,l),N.push(Ca[c])):150===c?(x=1-lr(s,p,f),m=1-lr(s,l,h),N.push(Ca[c])):80===c?(E=lr(e,p,l),b=lr(e,f,h),N.push(Ia[c])):90===c?(E=1-lr(s,l,p),b=1-lr(s,h,f),N.push(Ia[c])):65===c?(v=1-lr(e,p,f),_=1-lr(e,l,h),N.push(Sa[c])):105===c?(v=lr(s,f,p),_=lr(s,h,l),N.push(Sa[c])):160===c?(E=lr(s,p,l),w=lr(e,p,l),I=lr(e,f,h),b=lr(s,f,h),N.push(Ia[c]),N.push(Na[c])):10===c?(E=1-lr(e,l,p),w=1-lr(s,l,p),I=1-lr(s,h,f),b=1-lr(e,h,f),N.push(Ia[c]),N.push(Na[c])):130===c?(x=1-lr(e,p,f),v=1-lr(s,p,f),_=1-lr(s,l,h),m=1-lr(e,l,h),N.push(Ca[c]),N.push(Sa[c])):40===c?(x=lr(s,f,p),v=lr(e,f,p),_=lr(e,h,l),m=lr(s,h,l),N.push(Ca[c]),N.push(Sa[c])):101===c?(w=lr(s,p,l),_=lr(s,h,l),N.push(Na[c])):69===c?(w=1-lr(e,l,p),_=1-lr(e,l,h),N.push(Na[c])):149===c?(I=lr(s,f,h),m=1-lr(s,l,h),N.push(Ma[c])):21===c?(I=1-lr(e,h,f),m=lr(e,h,l),N.push(Ma[c])):86===c?(x=1-lr(s,p,f),b=1-lr(s,h,f),N.push(Ca[c])):84===c?(x=lr(e,f,p),b=lr(e,f,h),N.push(Ca[c])):89===c?(E=1-lr(s,l,p),v=lr(s,f,p),N.push(Sa[c])):81===c?(E=lr(e,p,l),v=1-lr(e,p,f),N.push(Sa[c])):96===c?(E=lr(s,p,l),w=lr(e,p,l),b=lr(e,f,h),_=lr(s,h,l),N.push(Ia[c]),N.push(Na[c])):74===c?(E=1-lr(e,l,p),w=1-lr(s,l,p),b=1-lr(s,h,f),_=1-lr(e,l,h),N.push(Ia[c]),N.push(Na[c])):24===c?(E=1-lr(s,l,p),x=lr(s,f,p),v=lr(e,f,p),m=lr(e,h,l),N.push(Ia[c]),N.push(Sa[c])):146===c?(E=lr(e,p,l),x=1-lr(e,p,f),v=1-lr(s,p,f),m=1-lr(s,l,h),N.push(Ia[c]),N.push(Sa[c])):6===c?(w=1-lr(e,l,p),x=1-lr(s,p,f),I=1-lr(s,h,f),b=1-lr(e,h,f),N.push(Na[c]),N.push(Ca[c])):164===c?(w=lr(s,p,l),x=lr(e,f,p),I=lr(e,f,h),b=lr(s,f,h),N.push(Na[c]),N.push(Ca[c])):129===c?(v=1-lr(e,p,f),I=lr(s,f,h),_=1-lr(s,l,h),m=1-lr(e,l,h),N.push(Sa[c]),N.push(Ma[c])):41===c?(v=lr(s,f,p),I=1-lr(e,h,f),_=lr(e,h,l),m=lr(s,h,l),N.push(Sa[c]),N.push(Ma[c])):66===c?(x=1-lr(e,p,f),v=1-lr(s,p,f),b=1-lr(s,h,f),_=1-lr(e,l,h),N.push(Ca[c]),N.push(Sa[c])):104===c?(x=lr(s,f,p),v=lr(e,f,p),b=lr(e,f,h),_=lr(s,h,l),N.push(Sa[c]),N.push(Pa[c])):144===c?(E=lr(e,p,l),I=lr(e,f,h),b=lr(s,f,h),m=1-lr(s,l,h),N.push(Ia[c]),N.push(La[c])):26===c?(E=1-lr(s,l,p),I=1-lr(s,h,f),b=1-lr(e,h,f),m=lr(e,h,l),N.push(Ia[c]),N.push(La[c])):36===c?(w=lr(s,p,l),x=lr(e,f,p),_=lr(e,h,l),m=lr(s,h,l),N.push(Na[c]),N.push(Ca[c])):134===c?(w=1-lr(e,l,p),x=1-lr(s,p,f),_=1-lr(s,l,h),m=1-lr(e,l,h),N.push(Na[c]),N.push(Ca[c])):9===c?(E=1-lr(e,l,p),w=1-lr(s,l,p),v=lr(s,f,p),I=1-lr(e,h,f),N.push(Ia[c]),N.push(Na[c])):161===c?(E=lr(s,p,l),w=lr(e,p,l),v=1-lr(e,p,f),I=lr(s,f,h),N.push(Ia[c]),N.push(Na[c])):37===c?(w=lr(s,p,l),I=1-lr(e,h,f),_=lr(e,h,l),m=lr(s,h,l),N.push(Na[c]),N.push(Ma[c])):133===c?(w=1-lr(e,l,p),I=lr(s,f,h),_=1-lr(s,l,h),m=1-lr(e,l,h),N.push(Na[c]),N.push(Ma[c])):148===c?(x=lr(e,f,p),I=lr(e,f,h),b=lr(s,f,h),m=1-lr(s,l,h),N.push(Ca[c]),N.push(La[c])):22===c?(x=1-lr(s,p,f),I=1-lr(s,h,f),b=1-lr(e,h,f),m=lr(e,h,l),N.push(Ca[c]),N.push(La[c])):82===c?(E=lr(e,p,l),x=1-lr(e,p,f),v=1-lr(s,p,f),b=1-lr(s,h,f),N.push(Ia[c]),N.push(Sa[c])):88===c?(E=1-lr(s,l,p),x=lr(s,f,p),v=lr(e,f,p),b=lr(e,f,h),N.push(Ia[c]),N.push(Sa[c])):73===c?(E=1-lr(e,l,p),w=1-lr(s,l,p),v=lr(s,f,p),_=1-lr(e,l,h),N.push(Ia[c]),N.push(Na[c])):97===c?(E=lr(s,p,l),w=lr(e,p,l),v=1-lr(e,p,f),_=lr(s,h,l),N.push(Ia[c]),N.push(Na[c])):145===c?(E=lr(e,p,l),v=1-lr(e,p,f),I=lr(s,f,h),m=1-lr(s,l,h),N.push(Ia[c]),N.push(Ma[c])):25===c?(E=1-lr(s,l,p),v=lr(s,f,p),I=1-lr(e,h,f),m=lr(e,h,l),N.push(Ia[c]),N.push(Ma[c])):70===c?(w=1-lr(e,l,p),x=1-lr(s,p,f),b=1-lr(s,h,f),_=1-lr(e,l,h),N.push(Na[c]),N.push(Ca[c])):100===c?(w=lr(s,p,l),x=lr(e,f,p),b=lr(e,f,h),_=lr(s,h,l),N.push(Na[c]),N.push(Ca[c])):34===c?(0===d?(E=1-lr(e,l,p),w=1-lr(s,l,p),x=lr(s,f,p),v=lr(e,f,p),I=lr(e,f,h),b=lr(s,f,h),_=1-lr(s,l,h),m=1-lr(e,l,h)):(E=lr(s,p,l),w=lr(e,p,l),x=1-lr(e,p,f),v=1-lr(s,p,f),I=1-lr(s,h,f),b=1-lr(e,h,f),_=lr(e,h,l),m=lr(s,h,l)),N.push(Ia[c]),N.push(Na[c]),N.push(Ma[c]),N.push(La[c])):35===c?(4===d?(E=1-lr(e,l,p),w=1-lr(s,l,p),x=lr(s,f,p),v=lr(e,f,p),I=lr(e,f,h),b=lr(s,f,h),_=1-lr(s,l,h),m=1-lr(e,l,h)):(E=lr(s,p,l),w=lr(e,p,l),x=1-lr(e,p,f),v=1-lr(s,p,f),I=1-lr(s,h,f),b=1-lr(e,h,f),_=lr(e,h,l),m=lr(s,h,l)),N.push(Ia[c]),N.push(Na[c]),N.push(Sa[c]),N.push(La[c])):136===c?(0===d?(E=lr(s,p,l),w=lr(e,p,l),x=1-lr(e,p,f),v=1-lr(s,p,f),I=1-lr(s,h,f),b=1-lr(e,h,f),_=lr(e,h,l),m=lr(s,h,l)):(E=1-lr(e,l,p),w=1-lr(s,l,p),x=lr(s,f,p),v=lr(e,f,p),I=lr(e,f,h),b=lr(s,f,h),_=1-lr(s,l,h),m=1-lr(e,l,h)),N.push(Ia[c]),N.push(Na[c]),N.push(Ma[c]),N.push(La[c])):153===c?(0===d?(E=lr(e,p,l),v=1-lr(e,p,f),I=1-lr(e,h,f),m=lr(e,h,l)):(E=1-lr(s,l,p),v=lr(s,f,p),I=lr(s,f,h),m=1-lr(s,l,h)),N.push(Ia[c]),N.push(Sa[c])):102===c?(0===d?(w=1-lr(e,l,p),x=lr(e,f,p),b=lr(e,f,h),_=1-lr(e,l,h)):(w=lr(s,p,l),x=1-lr(s,p,f),b=1-lr(s,h,f),_=lr(s,h,l)),N.push(Na[c]),N.push(La[c])):155===c?(4===d?(E=lr(e,p,l),v=1-lr(e,p,f),I=1-lr(e,h,f),m=lr(e,h,l)):(E=1-lr(s,l,p),v=lr(s,f,p),I=lr(s,f,h),m=1-lr(s,l,h)),N.push(Ia[c]),N.push(Ma[c])):103===c?(4===d?(w=1-lr(e,l,p),x=lr(e,f,p),b=lr(e,f,h),_=1-lr(e,l,h)):(w=lr(s,p,l),x=1-lr(s,p,f),b=1-lr(s,h,f),_=lr(s,h,l)),N.push(Na[c]),N.push(Ca[c])):152===c?(0===d?(E=lr(e,p,l),x=1-lr(e,p,f),v=1-lr(s,p,f),I=1-lr(s,h,f),b=1-lr(e,h,f),m=lr(e,h,l)):(E=1-lr(s,l,p),x=lr(s,f,p),v=lr(e,f,p),I=lr(e,f,h),b=lr(s,f,h),m=1-lr(s,l,h)),N.push(Ia[c]),N.push(Ca[c]),N.push(Sa[c])):156===c?(4===d?(E=lr(e,p,l),x=1-lr(e,p,f),v=1-lr(s,p,f),I=1-lr(s,h,f),b=1-lr(e,h,f),m=lr(e,h,l)):(E=1-lr(s,l,p),x=lr(s,f,p),v=lr(e,f,p),I=lr(e,f,h),b=lr(s,f,h),m=1-lr(s,l,h)),N.push(Ia[c]),N.push(Sa[c]),N.push(La[c])):137===c?(0===d?(E=lr(s,p,l),w=lr(e,p,l),v=1-lr(e,p,f),I=1-lr(e,h,f),_=lr(e,h,l),m=lr(s,h,l)):(E=1-lr(e,l,p),w=1-lr(s,l,p),v=lr(s,f,p),I=lr(s,f,h),_=1-lr(s,l,h),m=1-lr(e,l,h)),N.push(Ia[c]),N.push(Na[c]),N.push(Sa[c])):139===c?(4===d?(E=lr(s,p,l),w=lr(e,p,l),v=1-lr(e,p,f),I=1-lr(e,h,f),_=lr(e,h,l),m=lr(s,h,l)):(E=1-lr(e,l,p),w=1-lr(s,l,p),v=lr(s,f,p),I=lr(s,f,h),_=1-lr(s,l,h),m=1-lr(e,l,h)),N.push(Ia[c]),N.push(Na[c]),N.push(Ma[c])):98===c?(0===d?(E=1-lr(e,l,p),w=1-lr(s,l,p),x=lr(s,f,p),v=lr(e,f,p),b=lr(e,f,h),_=1-lr(e,l,h)):(E=lr(s,p,l),w=lr(e,p,l),x=1-lr(e,p,f),v=1-lr(s,p,f),b=1-lr(s,h,f),_=lr(s,h,l)),N.push(Ia[c]),N.push(Na[c]),N.push(La[c])):99===c?(4===d?(E=1-lr(e,l,p),w=1-lr(s,l,p),x=lr(s,f,p),v=lr(e,f,p),b=lr(e,f,h),_=1-lr(e,l,h)):(E=lr(s,p,l),w=lr(e,p,l),x=1-lr(e,p,f),v=1-lr(s,p,f),b=1-lr(s,h,f),_=lr(s,h,l)),N.push(Ia[c]),N.push(Na[c]),N.push(Sa[c])):38===c?(0===d?(w=1-lr(e,l,p),x=lr(e,f,p),I=lr(e,f,h),b=lr(s,f,h),_=1-lr(s,l,h),m=1-lr(e,l,h)):(w=lr(s,p,l),x=1-lr(s,p,f),I=1-lr(s,h,f),b=1-lr(e,h,f),_=lr(e,h,l),m=lr(s,h,l)),N.push(Na[c]),N.push(Ma[c]),N.push(La[c])):39===c?(4===d?(w=1-lr(e,l,p),x=lr(e,f,p),I=lr(e,f,h),b=lr(s,f,h),_=1-lr(s,l,h),m=1-lr(e,l,h)):(w=lr(s,p,l),x=1-lr(s,p,f),I=1-lr(s,h,f),b=1-lr(e,h,f),_=lr(e,h,l),m=lr(s,h,l)),N.push(Na[c]),N.push(Ca[c]),N.push(La[c])):85===c&&(E=1,w=0,x=1,v=0,I=0,b=1,_=0,m=1),(_<0||_>1||m<0||m>1||E<0||E>1||x<0||x>1||I<0||I>1||b<0||b>1)&&console.log("MarchingSquaresJS-isoBands: "+c+" "+g+" "+h+","+l+","+p+","+f+" "+d+" "+_+" "+m+" "+E+" "+w+" "+x+" "+v+" "+I+" "+b),o.cells[a][u]={cval:c,cval_real:g,flipped:d,topleft:_,topright:m,righttop:E,rightbottom:w,bottomright:x,bottomleft:v,leftbottom:I,lefttop:b,edges:N}}}}}return o}(t,e,n);return zs.polygons?(zs.verbose&&console.log("MarchingSquaresJS-isoBands: returning single polygons for each grid cell"),u=function(t){var e=[],n=0;return t.cells.forEach((function(t,r){t.forEach((function(t,i){if(void 0!==t){var o=Ra[t.cval](t);"object"==typeof o&&pr(o)?"object"==typeof o[0]&&pr(o[0])?"object"==typeof o[0][0]&&pr(o[0][0])?o.forEach((function(t){t.forEach((function(t){t[0]+=i,t[1]+=r})),e[n++]=t})):(o.forEach((function(t){t[0]+=i,t[1]+=r})),e[n++]=o):console.log("MarchingSquaresJS-isoBands: bandcell polygon with malformed coordinates"):console.log("MarchingSquaresJS-isoBands: bandcell polygon with null coordinates")}}))})),e}(c)):(zs.verbose&&console.log("MarchingSquaresJS-isoBands: returning polygon paths for entire data grid"),u=function(t){for(var e=[],n=t.rows,r=t.cols,i=[],o=0;o<n;o++)for(var s=0;s<r;s++)if(void 0!==t.cells[o][s]&&t.cells[o][s].edges.length>0){var a=function(t){if(t.edges.length>0){var e=t.edges[t.edges.length-1],n=t.cval_real;switch(e){case 0:return n&Xs?{p:[1,t.righttop],x:-1,y:0,o:1}:{p:[t.topleft,1],x:0,y:-1,o:0};case 1:return n&Us?{p:[t.topleft,1],x:0,y:-1,o:0}:{p:[1,t.rightbottom],x:-1,y:0,o:0};case 2:return n&Us?{p:[t.bottomright,0],x:0,y:1,o:1}:{p:[t.topleft,1],x:0,y:-1,o:0};case 3:return n&Ys?{p:[t.topleft,1],x:0,y:-1,o:0}:{p:[t.bottomleft,0],x:0,y:1,o:0};case 4:return n&Xs?{p:[1,t.righttop],x:-1,y:0,o:1}:{p:[t.topright,1],x:0,y:-1,o:1};case 5:return n&Us?{p:[t.topright,1],x:0,y:-1,o:1}:{p:[1,t.rightbottom],x:-1,y:0,o:0};case 6:return n&Us?{p:[t.bottomright,0],x:0,y:1,o:1}:{p:[t.topright,1],x:0,y:-1,o:1};case 7:return n&Ys?{p:[t.topright,1],x:0,y:-1,o:1}:{p:[t.bottomleft,0],x:0,y:1,o:0};case 8:return n&Us?{p:[t.bottomright,0],x:0,y:1,o:1}:{p:[1,t.righttop],x:-1,y:0,o:1};case 9:return n&Ys?{p:[1,t.righttop],x:-1,y:0,o:1}:{p:[t.bottomleft,0],x:0,y:1,o:0};case 10:return n&Ys?{p:[0,t.leftbottom],x:1,y:0,o:0}:{p:[1,t.righttop],x:-1,y:0,o:1};case 11:return n&js?{p:[1,t.righttop],x:-1,y:0,o:1}:{p:[0,t.lefttop],x:1,y:0,o:1};case 12:return n&Us?{p:[t.bottomright,0],x:0,y:1,o:1}:{p:[1,t.rightbottom],x:-1,y:0,o:0};case 13:return n&Ys?{p:[1,t.rightbottom],x:-1,y:0,o:0}:{p:[t.bottomleft,0],x:0,y:1,o:0};case 14:return n&Ys?{p:[0,t.leftbottom],x:1,y:0,o:0}:{p:[1,t.rightbottom],x:-1,y:0,o:0};case 15:return n&js?{p:[1,t.rightbottom],x:-1,y:0,o:0}:{p:[0,t.lefttop],x:1,y:0,o:1};case 16:return n&Us?{p:[t.bottomright,0],x:0,y:1,o:1}:{p:[0,t.leftbottom],x:1,y:0,o:0};case 17:return n&js?{p:[t.bottomright,0],x:0,y:1,o:1}:{p:[0,t.lefttop],x:1,y:0,o:1};case 18:return n&Ys?{p:[0,t.leftbottom],x:1,y:0,o:0}:{p:[t.bottomleft,0],x:0,y:1,o:0};case 19:return n&js?{p:[t.bottomleft,0],x:0,y:1,o:0}:{p:[0,t.lefttop],x:1,y:0,o:1};case 20:return n&js?{p:[t.topleft,1],x:0,y:-1,o:0}:{p:[0,t.leftbottom],x:1,y:0,o:0};case 21:return n&Xs?{p:[0,t.leftbottom],x:1,y:0,o:0}:{p:[t.topright,1],x:0,y:-1,o:1};case 22:return n&js?{p:[t.topleft,1],x:0,y:-1,o:0}:{p:[0,t.lefttop],x:1,y:0,o:1};case 23:return n&Xs?{p:[0,t.lefttop],x:1,y:0,o:1}:{p:[t.topright,1],x:0,y:-1,o:1};default:console.log("MarchingSquaresJS-isoBands: edge index out of range!"),console.log(t)}}return null}(t.cells[o][s]),u=null,c=s,h=o;null!==a&&i.push([a.p[0]+c,a.p[1]+h]);do{if(null===(u=function(t,e,n,r){var i,o,s,a,u,c=t.cval;switch(e){case-1:0===r?(i=Na[c],s=ea[c],a=na[c],u=ra[c]):(i=Ia[c],s=Qs[c],a=$s[c],u=ta[c]);break;case 1:0===r?(i=Ma[c],s=fa[c],a=ga[c],u=da[c]):(i=La[c],s=ha[c],a=la[c],u=pa[c]);break;default:switch(n){case-1:0===r?(i=Pa[c],s=Vs[c],a=Hs[c],u=Ws[c]):(i=Oa[c],s=Js[c],a=Zs[c],u=Ks[c]);break;case 1:0===r?(i=Sa[c],s=ia[c],a=oa[c],u=sa[c]):(i=Ca[c],s=aa[c],a=ua[c],u=ca[c])}}if(o=t.edges.indexOf(i),void 0===t.edges[o])return null;switch(function(t,e){delete t.edges[e];for(var n=e+1;n<t.edges.length;n++)t.edges[n-1]=t.edges[n];t.edges.pop()}(t,o),c=t.cval_real,i){case 0:c&Xs?(e=t.topleft,n=1):(e=1,n=t.righttop);break;case 1:c&Us?(e=1,n=t.rightbottom):(e=t.topleft,n=1);break;case 2:c&Us?(e=t.topleft,n=1):(e=t.bottomright,n=0);break;case 3:c&Ys?(e=t.bottomleft,n=0):(e=t.topleft,n=1);break;case 4:c&Xs?(e=t.topright,n=1):(e=1,n=t.righttop);break;case 5:c&Us?(e=1,n=t.rightbottom):(e=t.topright,n=1);break;case 6:c&Us?(e=t.topright,n=1):(e=t.bottomright,n=0);break;case 7:c&Ys?(e=t.bottomleft,n=0):(e=t.topright,n=1);break;case 8:c&Us?(e=1,n=t.righttop):(e=t.bottomright,n=0);break;case 9:c&Ys?(e=t.bottomleft,n=0):(e=1,n=t.righttop);break;case 10:c&Ys?(e=1,n=t.righttop):(e=0,n=t.leftbottom);break;case 11:c&js?(e=0,n=t.lefttop):(e=1,n=t.righttop);break;case 12:c&Us?(e=1,n=t.rightbottom):(e=t.bottomright,n=0);break;case 13:c&Ys?(e=t.bottomleft,n=0):(e=1,n=t.rightbottom);break;case 14:c&Ys?(e=1,n=t.rightbottom):(e=0,n=t.leftbottom);break;case 15:c&js?(e=0,n=t.lefttop):(e=1,n=t.rightbottom);break;case 16:c&Us?(e=0,n=t.leftbottom):(e=t.bottomright,n=0);break;case 17:c&js?(e=0,n=t.lefttop):(e=t.bottomright,n=0);break;case 18:c&Ys?(e=t.bottomleft,n=0):(e=0,n=t.leftbottom);break;case 19:c&js?(e=0,n=t.lefttop):(e=t.bottomleft,n=0);break;case 20:c&js?(e=0,n=t.leftbottom):(e=t.topleft,n=1);break;case 21:c&Xs?(e=t.topright,n=1):(e=0,n=t.leftbottom);break;case 22:c&js?(e=0,n=t.lefttop):(e=t.topleft,n=1);break;case 23:c&Xs?(e=t.topright,n=1):(e=0,n=t.lefttop);break;default:return console.log("MarchingSquaresJS-isoBands: edge index out of range!"),console.log(t),null}return void 0!==e&&void 0!==n&&void 0!==s&&void 0!==a&&void 0!==u||(console.log("MarchingSquaresJS-isoBands: undefined value!"),console.log(t),console.log(e+" "+n+" "+s+" "+a+" "+u)),{p:[e,n],x:s,y:a,o:u}}(t.cells[h][c],a.x,a.y,a.o)))break;if(i.push([u.p[0]+c,u.p[1]+h]),c+=u.x,a=u,(h+=u.y)<0||h>=n||c<0||c>=r||void 0===t.cells[h][c]){var l=function(t,e,n,r,i,o){for(var s=t.cells[n][e],a=s.cval_real,u=e+r,c=n+i,h=[],l=!1;!l;){if(void 0===t.cells[c]||void 0===t.cells[c][u])if(c-=i,u-=r,a=(s=t.cells[c][u]).cval_real,-1===i)if(0===o)if(a&Ys)h.push([u,c]),r=-1,i=0,o=0;else{if(!(a&Us)){h.push([u+s.bottomright,c]),r=0,i=1,o=1,l=!0;break}h.push([u+1,c]),r=1,i=0,o=0}else{if(!(a&Ys)){if(a&Us){h.push([u+s.bottomright,c]),r=0,i=1,o=1,l=!0;break}h.push([u+s.bottomleft,c]),r=0,i=1,o=0,l=!0;break}h.push([u,c]),r=-1,i=0,o=0}else if(1===i)if(0===o){if(!(a&Xs)){if(a&js){h.push([u+s.topleft,c+1]),r=0,i=-1,o=0,l=!0;break}h.push([u+s.topright,c+1]),r=0,i=-1,o=1,l=!0;break}h.push([u+1,c+1]),r=1,i=0,o=1}else h.push([u+1,c+1]),r=1,i=0,o=1;else if(-1===r)if(0===o){if(!(a&js)){if(a&Ys){h.push([u,c+s.leftbottom]),r=1,i=0,o=0,l=!0;break}h.push([u,c+s.lefttop]),r=1,i=0,o=1,l=!0;break}h.push([u,c+1]),r=0,i=1,o=0}else{if(!(a&js)){console.log("MarchingSquaresJS-isoBands: wtf");break}h.push([u,c+1]),r=0,i=1,o=0}else{if(1!==r){console.log("MarchingSquaresJS-isoBands: we came from nowhere!");break}if(0===o){if(!(a&Us)){h.push([u+1,c+s.rightbottom]),r=-1,i=0,o=0,l=!0;break}h.push([u+1,c]),r=0,i=-1,o=1}else{if(!(a&Us)){if(a&Xs){h.push([u+1,c+s.righttop]),r=-1,i=0,o=1;break}h.push([u+1,c+s.rightbottom]),r=-1,i=0,o=0,l=!0;break}h.push([u+1,c]),r=0,i=-1,o=1}}else if(a=(s=t.cells[c][u]).cval_real,-1===r)if(0===o)if(void 0!==t.cells[c-1]&&void 0!==t.cells[c-1][u])r=0,i=-1,o=1;else{if(!(a&Ys)){h.push([u+s.bottomright,c]),r=0,i=1,o=1,l=!0;break}h.push([u,c])}else{if(!(a&js)){console.log("MarchingSquaresJS-isoBands: found entry from top at "+u+","+c);break}console.log("MarchingSquaresJS-isoBands: proceeding in x-direction!")}else if(1===r){if(0===o){console.log("MarchingSquaresJS-isoBands: wtf");break}if(void 0!==t.cells[c+1]&&void 0!==t.cells[c+1][u])r=0,i=1,o=0;else{if(!(a&Xs)){h.push([u+s.topleft,c+1]),r=0,i=-1,o=0,l=!0;break}h.push([u+1,c+1]),r=1,i=0,o=1}}else if(-1===i){if(1!==o){console.log("MarchingSquaresJS-isoBands: wtf");break}if(void 0!==t.cells[c][u+1])r=1,i=0,o=1;else{if(!(a&Us)){h.push([u+1,c+s.righttop]),r=-1,i=0,o=1,l=!0;break}h.push([u+1,c]),r=0,i=-1,o=1}}else{if(1!==i){console.log("MarchingSquaresJS-isoBands: where did we came from???");break}if(0!==o){console.log("MarchingSquaresJS-isoBands: wtf");break}if(void 0!==t.cells[c][u-1])r=-1,i=0,o=0;else{if(!(a&js)){h.push([u,c+s.leftbottom]),r=1,i=0,o=0,l=!0;break}h.push([u,c+1]),r=0,i=1,o=0}}if(c+=i,(u+=r)===e&&c===n)break}return{path:h,i:u,j:c,x:r,y:i,o}}(t,c-=u.x,h-=u.y,u.x,u.y,u.o);if(null===l)break;l.path.forEach((function(t){i.push(t)})),c=l.i,h=l.j,a=l}}while(void 0!==t.cells[h][c]&&t.cells[h][c].edges.length>0);e.push(i),i=[],t.cells[o][s].edges.length>0&&s--}return e}(c)),"function"==typeof zs.successCallback&&zs.successCallback(u),u}function lr(t,e,n){return(t-e)/(n-e)}function pr(t){return t.constructor.toString().indexOf("Array")>-1}function fr(t,e,n){if(!I(n=n||{}))throw new Error("options is invalid");var r=n.pivot,i=n.mutate;if(!t)throw new Error("geojson is required");if(void 0===e||null===e||isNaN(e))throw new Error("angle is required");return 0===e||(r||(r=ye(t)),!1!==i&&void 0!==i||(t=Gt(t)),S(t,(function(t){var n=sn(r,t)+e,i=un(r,t),o=U(nr(r,i,n));t[0]=o[0],t[1]=o[1]}))),t}function gr(t,e,n){if(!I(n=n||{}))throw new Error("options is invalid");var r=n.origin,i=n.mutate;if(!t)throw new Error("geojson required");if("number"!=typeof e||0===e)throw new Error("invalid factor");var o=Array.isArray(r)||"object"==typeof r;return!0!==i&&(t=Gt(t)),"FeatureCollection"!==t.type||o?dr(t,e,r):(O(t,(function(n,i){t.features[i]=dr(n,e,r)})),t)}function dr(t,e,n){var i="Point"===K(t);return n=function(t,e){if(void 0!==e&&null!==e||(e="centroid"),Array.isArray(e)||"object"==typeof e)return X(e);var n=t.bbox?t.bbox:j(t),i=n[0],o=n[1],s=n[2],a=n[3];switch(e){case"sw":case"southwest":case"westsouth":case"bottomleft":return r([i,o]);case"se":case"southeast":case"eastsouth":case"bottomright":return r([s,o]);case"nw":case"northwest":case"westnorth":case"topleft":return r([i,a]);case"ne":case"northeast":case"eastnorth":case"topright":return r([s,a]);case"center":return de(t);case void 0:case null:case"centroid":return ye(t);default:throw new Error("invalid origin")}}(t,n),1===e||i||S(t,(function(t){var r=un(n,t),i=sn(n,t),o=U(nr(n,r*e,i));t[0]=o[0],t[1]=o[1],3===t.length&&(t[2]*=e)})),t}function yr(t){var e=t[0],n=t[1];return[n[0]-e[0],n[1]-e[1]]}function _r(t,e){return t[0]*e[1]-e[0]*t[1]}function mr(t,e){return!function(t,e){return 0===_r(yr(t),yr(e))}(t,e)&&function(t,e){var n=t[0],r=yr(t),i=e[0],o=yr(e),s=_r(r,o);return function(t,e){return[t[0]+e[0],t[1]+e[1]]}(n,function(t,e){return[t*e[0],t*e[1]]}(_r(function(t,e){return[t[0]-e[0],t[1]-e[1]]}(i,n),o)/s,r))}(t,e)}function vr(t,e,n){var r=[],i=_(e,n),o=U(t),s=[];return o.forEach((function(t,e){if(e!==o.length-1){var n=function(t,e,n){var r=Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1])),i=t[0]+n*(e[1]-t[1])/r,o=e[0]+n*(e[1]-t[1])/r;return[[i,t[1]+n*(t[0]-e[0])/r],[o,e[1]+n*(t[0]-e[0])/r]]}(t,o[e+1],i);if(r.push(n),e>0){var a=r[e-1],u=mr(n,a);!1!==u&&(a[1]=u,n[0]=u),s.push(a[0]),e===o.length-2&&(s.push(n[0]),s.push(n[1]))}2===o.length&&(s.push(n[0]),s.push(n[1]))}})),a(s,t.properties)}function xr(t,e,n){var r=e[0]-t[0],i=e[1]-t[1],o=n[0]-e[0],s=n[1]-e[1];return Math.sign(r*s-o*i)}function Er(t,e){return e.geometry.coordinates[0].every((function(e){return Pt(r(e),t)}))}function wr(t,e){for(var n=0;n<t.coordinates.length-1;n++)if(function(t,e,n){var r=n[0]-t[0],i=n[1]-t[1],o=e[0]-t[0],s=e[1]-t[1];return r*s-i*o==0&&(Math.abs(o)>=Math.abs(s)?o>0?t[0]<=n[0]&&n[0]<=e[0]:e[0]<=n[0]&&n[0]<=t[0]:s>0?t[1]<=n[1]&&n[1]<=e[1]:e[1]<=n[1]&&n[1]<=t[1])}(t.coordinates[n],t.coordinates[n+1],e.coordinates))return!0;return!1}function br(t,e){return nn(e,kn(t)).features.length>0}function Ir(t,e){return!(t[0]>e[0])&&!(t[2]<e[2])&&!(t[1]>e[1])&&!(t[3]<e[3])}function Nr(t,e){return t[0]===e[0]&&t[1]===e[1]}function Cr(t,e){for(var n=!1,r=!1,i=t.coordinates.length,o=0;o<i&&!n&&!r;){for(var s=0;s<e.coordinates.length-1;s++){var a=!0;0!==s&&s!==e.coordinates.length-2||(a=!1),Lr(e.coordinates[s],e.coordinates[s+1],t.coordinates[o],a)?n=!0:r=!0}o++}return n&&r}function Sr(t,e){return nn(t,kn(e)).features.length>0}function Mr(t,e){for(var n=!1,i=!1,o=t.coordinates[0].length,s=0;s<o&&n&&i;)Pt(r(t.coordinates[0][s]),e)?n=!0:i=!0,s++;return i&&i}function Lr(t,e,n,r){var i=n[0]-t[0],o=n[1]-t[1],s=e[0]-t[0],a=e[1]-t[1];return 0==i*a-o*s&&(r?Math.abs(s)>=Math.abs(a)?s>0?t[0]<=n[0]&&n[0]<=e[0]:e[0]<=n[0]&&n[0]<=t[0]:a>0?t[1]<=n[1]&&n[1]<=e[1]:e[1]<=n[1]&&n[1]<=t[1]:Math.abs(s)>=Math.abs(a)?s>0?t[0]<n[0]&&n[0]<e[0]:e[0]<n[0]&&n[0]<t[0]:a>0?t[1]<n[1]&&n[1]<e[1]:e[1]<n[1]&&n[1]<t[1])}function Pr(t){return t.coordinates.map((function(e){return{type:t.type.replace("Multi",""),coordinates:e}}))}function Or(t,e){return t.hasOwnProperty("coordinates")?t.coordinates.length===e.coordinates.length:t.length===e.length}function Rr(t,e){return ka(t,e,{strict:!0})}function Tr(t,e){if(!t)throw new Error("feature1 is required");if(!e)throw new Error("feature2 is required");var n=K(t);if(n!==K(e))throw new Error("features must be of the same type");if("Point"===n)throw new Error("Point geometry not supported");if(new ja({precision:6}).compare(t,e))return!1;var r=0;switch(n){case"MultiPoint":var i=T(t),o=T(e);i.forEach((function(t){o.forEach((function(e){t[0]===e[0]&&t[1]===e[1]&&r++}))}));break;case"LineString":case"MultiLineString":G(t,(function(t){G(e,(function(e){$n(t,e).features.length&&r++}))}));break;case"Polygon":case"MultiPolygon":G(t,(function(t){G(e,(function(e){nn(t,e).features.length&&r++}))}))}return r>0}function Ar(t,e,n){n=n||[];for(var r=0;r<t;r++)n[r]=e;return n}function Dr(t,e){if(t.geometry&&t.geometry.type)return t.geometry.type;if(t.type)return t.type;throw new Error("Invalid GeoJSON object for "+e)}function Fr(t){for(var e=t,n=[];e.parent;)n.unshift(e),e=e.parent;return n}function qr(t,e){e=e||{},this.nodes=[],this.diagonal=!!e.diagonal,this.grid=[];for(var n=0;n<t.length;n++){this.grid[n]=[];for(var r=0,i=t[n];r<i.length;r++){var o=new Gr(n,r,i[r]);this.grid[n][r]=o,this.nodes.push(o)}}this.init()}function Gr(t,e,n){this.x=t,this.y=e,this.weight=n}function Br(t){this.content=[],this.scoreFunction=t}function kr(t){return t[0]}function zr(t){return t[1]}function jr(){this._=null}function Xr(t){t.U=t.C=t.L=t.R=t.P=t.N=null}function Ur(t,e){var n=e,r=e.R,i=n.U;i?i.L===n?i.L=r:i.R=r:t._=r,r.U=i,n.U=r,n.R=r.L,n.R&&(n.R.U=n),r.L=n}function Yr(t,e){var n=e,r=e.L,i=n.U;i?i.L===n?i.L=r:i.R=r:t._=r,r.U=i,n.U=r,n.L=r.R,n.L&&(n.L.U=n),r.R=n}function Vr(t){for(;t.L;)t=t.L;return t}function Hr(t,e,n,r){var i=[null,null],o=uu.push(i)-1;return i.left=t,i.right=e,n&&Jr(i,t,e,n),r&&Jr(i,e,t,r),su[t.index].halfedges.push(o),su[e.index].halfedges.push(o),i}function Wr(t,e,n){var r=[e,n];return r.left=t,r}function Jr(t,e,n,r){t[0]||t[1]?t.left===n?t[1]=r:t[0]=r:(t[0]=r,t.left=e,t.right=n)}function Zr(t,e,n,r,i){var o,s=t[0],a=t[1],u=s[0],c=s[1],h=0,l=1,p=a[0]-u,f=a[1]-c;if(o=e-u,p||!(o>0)){if(o/=p,p<0){if(o<h)return;o<l&&(l=o)}else if(p>0){if(o>l)return;o>h&&(h=o)}if(o=r-u,p||!(o<0)){if(o/=p,p<0){if(o>l)return;o>h&&(h=o)}else if(p>0){if(o<h)return;o<l&&(l=o)}if(o=n-c,f||!(o>0)){if(o/=f,f<0){if(o<h)return;o<l&&(l=o)}else if(f>0){if(o>l)return;o>h&&(h=o)}if(o=i-c,f||!(o<0)){if(o/=f,f<0){if(o>l)return;o>h&&(h=o)}else if(f>0){if(o<h)return;o<l&&(l=o)}return!(h>0||l<1)||(h>0&&(t[0]=[u+h*p,c+h*f]),l<1&&(t[1]=[u+l*p,c+l*f]),!0)}}}}}function Kr(t,e,n,r,i){var o=t[1];if(o)return!0;var s,a,u=t[0],c=t.left,h=t.right,l=c[0],p=c[1],f=h[0],g=h[1],d=(l+f)/2,y=(p+g)/2;if(g===p){if(d<e||d>=r)return;if(l>f){if(u){if(u[1]>=i)return}else u=[d,n];o=[d,i]}else{if(u){if(u[1]<n)return}else u=[d,i];o=[d,n]}}else if(a=y-(s=(l-f)/(g-p))*d,s<-1||s>1)if(l>f){if(u){if(u[1]>=i)return}else u=[(n-a)/s,n];o=[(i-a)/s,i]}else{if(u){if(u[1]<n)return}else u=[(i-a)/s,i];o=[(n-a)/s,n]}else if(p<g){if(u){if(u[0]>=r)return}else u=[e,s*e+a];o=[r,s*r+a]}else{if(u){if(u[0]<e)return}else u=[r,s*r+a];o=[e,s*e+a]}return t[0]=u,t[1]=o,!0}function Qr(t,e){var n=t.site,r=e.left,i=e.right;return n===i&&(i=r,r=n),i?Math.atan2(i[1]-r[1],i[0]-r[0]):(n===r?(r=e[1],i=e[0]):(r=e[0],i=e[1]),Math.atan2(r[0]-i[0],i[1]-r[1]))}function $r(t,e){return e[+(e.left!==t.site)]}function ti(t,e){return e[+(e.left===t.site)]}function ei(t){var e=t.P,n=t.N;if(e&&n){var r=e.site,i=t.site,o=n.site;if(r!==o){var s=i[0],a=i[1],u=r[0]-s,c=r[1]-a,h=o[0]-s,l=o[1]-a,p=2*(u*l-c*h);if(!(p>=-pu)){var f=u*u+c*c,g=h*h+l*l,d=(l*f-c*g)/p,y=(u*g-h*f)/p,_=cu.pop()||new function(){Xr(this),this.x=this.y=this.arc=this.site=this.cy=null};_.arc=t,_.site=i,_.x=d+s,_.y=(_.cy=y+a)+Math.sqrt(d*d+y*y),t.circle=_;for(var m=null,v=au._;v;)if(_.y<v.y||_.y===v.y&&_.x<=v.x){if(!v.L){m=v.P;break}v=v.L}else{if(!v.R){m=v;break}v=v.R}au.insert(m,_),m||(iu=_)}}}}function ni(t){var e=t.circle;e&&(e.P||(iu=e.N),au.remove(e),cu.push(e),Xr(e),t.circle=null)}function ri(t){var e=hu.pop()||new function(){Xr(this),this.edge=this.site=this.circle=null};return e.site=t,e}function ii(t){ni(t),ou.remove(t),hu.push(t),Xr(t)}function oi(t){var e=t.circle,n=e.x,r=e.cy,i=[n,r],o=t.P,s=t.N,a=[t];ii(t);for(var u=o;u.circle&&Math.abs(n-u.circle.x)<lu&&Math.abs(r-u.circle.cy)<lu;)o=u.P,a.unshift(u),ii(u),u=o;a.unshift(u),ni(u);for(var c=s;c.circle&&Math.abs(n-c.circle.x)<lu&&Math.abs(r-c.circle.cy)<lu;)s=c.N,a.push(c),ii(c),c=s;a.push(c),ni(c);var h,l=a.length;for(h=1;h<l;++h)c=a[h],u=a[h-1],Jr(c.edge,u.site,c.site,i);u=a[0],(c=a[l-1]).edge=Hr(u.site,c.site,null,i),ei(u),ei(c)}function si(t){for(var e,n,r,i,o=t[0],s=t[1],a=ou._;a;)if((r=ai(a,s)-o)>lu)a=a.L;else{if(!((i=o-function(t,e){var n=t.N;if(n)return ai(n,e);var r=t.site;return r[1]===e?r[0]:1/0}(a,s))>lu)){r>-lu?(e=a.P,n=a):i>-lu?(e=a,n=a.N):e=n=a;break}if(!a.R){e=a;break}a=a.R}!function(t){su[t.index]={site:t,halfedges:[]}}(t);var u=ri(t);if(ou.insert(e,u),e||n){if(e===n)return ni(e),n=ri(e.site),ou.insert(u,n),u.edge=n.edge=Hr(e.site,u.site),ei(e),void ei(n);if(n){ni(e),ni(n);var c=e.site,h=c[0],l=c[1],p=t[0]-h,f=t[1]-l,g=n.site,d=g[0]-h,y=g[1]-l,_=2*(p*y-f*d),m=p*p+f*f,v=d*d+y*y,x=[(y*m-f*v)/_+h,(p*v-d*m)/_+l];Jr(n.edge,c,g,x),u.edge=Hr(c,t,null,x),n.edge=Hr(t,g,null,x),ei(e),ei(n)}else u.edge=Hr(e.site,u.site)}}function ai(t,e){var n=t.site,r=n[0],i=n[1],o=i-e;if(!o)return r;var s=t.P;if(!s)return-1/0;var a=(n=s.site)[0],u=n[1],c=u-e;if(!c)return a;var h=a-r,l=1/o-1/c,p=h/c;return l?(-p+Math.sqrt(p*p-2*l*(h*h/(-2*c)-u+c/2+i-o/2)))/l+r:(r+a)/2}function ui(t,e,n){return(t[0]-n[0])*(e[1]-t[1])-(t[0]-e[0])*(n[1]-t[1])}function ci(t,e){return e[1]-t[1]||e[0]-t[0]}function hi(t,e){var n,r,i,o=t.sort(ci).pop();for(uu=[],su=new Array(t.length),ou=new jr,au=new jr;;)if(i=iu,o&&(!i||o[1]<i.y||o[1]===i.y&&o[0]<i.x))o[0]===n&&o[1]===r||(si(o),n=o[0],r=o[1]),o=t.pop();else{if(!i)break;oi(i.arc)}if(function(){for(var t,e,n,r,i=0,o=su.length;i<o;++i)if((t=su[i])&&(r=(e=t.halfedges).length)){var s=new Array(r),a=new Array(r);for(n=0;n<r;++n)s[n]=n,a[n]=Qr(t,uu[e[n]]);for(s.sort((function(t,e){return a[e]-a[t]})),n=0;n<r;++n)a[n]=e[s[n]];for(n=0;n<r;++n)e[n]=a[n]}}(),e){var s=+e[0][0],a=+e[0][1],u=+e[1][0],c=+e[1][1];!function(t,e,n,r){for(var i,o=uu.length;o--;)Kr(i=uu[o],t,e,n,r)&&Zr(i,t,e,n,r)&&(Math.abs(i[0][0]-i[1][0])>lu||Math.abs(i[0][1]-i[1][1])>lu)||delete uu[o]}(s,a,u,c),function(t,e,n,r){var i,o,s,a,u,c,h,l,p,f,g,d,y=su.length,_=!0;for(i=0;i<y;++i)if(o=su[i]){for(s=o.site,a=(u=o.halfedges).length;a--;)uu[u[a]]||u.splice(a,1);for(a=0,c=u.length;a<c;)g=(f=ti(o,uu[u[a]]))[0],d=f[1],l=(h=$r(o,uu[u[++a%c]]))[0],p=h[1],(Math.abs(g-l)>lu||Math.abs(d-p)>lu)&&(u.splice(a,0,uu.push(Wr(s,f,Math.abs(g-t)<lu&&r-d>lu?[t,Math.abs(l-t)<lu?p:r]:Math.abs(d-r)<lu&&n-g>lu?[Math.abs(p-r)<lu?l:n,r]:Math.abs(g-n)<lu&&d-e>lu?[n,Math.abs(l-n)<lu?p:e]:Math.abs(d-e)<lu&&g-t>lu?[Math.abs(p-e)<lu?l:t,e]:null))-1),++c);c&&(_=!1)}if(_){var m,v,x,E=1/0;for(i=0,_=null;i<y;++i)(o=su[i])&&(x=(m=(s=o.site)[0]-t)*m+(v=s[1]-e)*v)<E&&(E=x,_=o);if(_){var w=[t,e],b=[t,r],I=[n,r],N=[n,e];_.halfedges.push(uu.push(Wr(s=_.site,w,b))-1,uu.push(Wr(s,b,I))-1,uu.push(Wr(s,I,N))-1,uu.push(Wr(s,N,w))-1)}}for(i=0;i<y;++i)(o=su[i])&&(o.halfedges.length||delete su[i])}(s,a,u,c)}this.edges=uu,this.cells=su,ou=au=uu=su=null}function li(t){return(t=t.slice()).push(t[0]),o([t])}function pi(t,e,n,r){var i=(r=r||{}).steps||64,s=r.units||"kilometers",a=r.angle||0,u=r.pivot||t,c=r.properties||t.properties||{};if(!t)throw new Error("center is required");if(!e)throw new Error("xSemiAxis is required");if(!n)throw new Error("ySemiAxis is required");if(!I(r))throw new Error("options must be an object");if(!b(i))throw new Error("steps must be a number");if(!b(a))throw new Error("angle must be a number");var h=X(t);if("degrees"===s)var l=x(a);else e=nr(t,e,90,{units:s}),n=nr(t,n,0,{units:s}),e=X(e)[0]-h[0],n=X(n)[1]-h[1];for(var p=[],f=0;f<i;f+=1){var g=-360*f/i,d=e*n/Math.sqrt(Math.pow(n,2)+Math.pow(e,2)*Math.pow(fi(g),2)),y=e*n/Math.sqrt(Math.pow(e,2)+Math.pow(n,2)/Math.pow(fi(g),2));if(g<-90&&g>=-270&&(d=-d),g<-180&&g>=-360&&(y=-y),"degrees"===s){var _=d*Math.cos(l)+y*Math.sin(l),m=y*Math.cos(l)-d*Math.sin(l);d=_,y=m}p.push([d+h[0],y+h[1]])}return p.push(p[0]),"degrees"===s?o([p],c):fr(o([p],c),a,{pivot:u})}function fi(t){var e=t*Math.PI/180;return Math.tan(e)}function gi(t,e){if(!I(e=e||{}))throw new Error("options is invalid");var n=e.properties,i=e.weight;if(!t)throw new Error("geojson is required");var o=0,s=0,a=0;return A(t,(function(t,e,n){var r=n[i];if(!b(r=void 0===r||null===r?1:r))throw new Error("weight value must be a number for feature index "+e);(r=Number(r))>0&&S(t,(function(t){o+=t[0]*r,s+=t[1]*r,a+=r}))})),r([o/a,s/a],n)}function di(t,e,n,i){var o=n.properties.tolerance||.001,s=0,a=0,u=0,c=0;if(O(n,(function(e){var n=e.properties.weight,r=void 0===n||null===n?1:n;if(!b(r=Number(r)))throw new Error("weight value must be a number");if(r>0){c+=1;var i=r*qt(e,t);0===i&&(i=1);var o=r/i;s+=e.geometry.coordinates[0]*o,a+=e.geometry.coordinates[1]*o,u+=o}})),c<1)throw new Error("no features to measure");var h=s/u,l=a/u;return 1===c||0===i||Math.abs(h-e[0])<o&&Math.abs(l-e[1])<o?r([h,l],{medianCandidates:n.properties.medianCandidates}):(n.properties.medianCandidates.push([h,l]),di([h,l],t,n,i-1))}function yi(t,e){return{x:t[0]-e[0],y:t[1]-e[1]}}function _i(t){if(I(t)&&(t=t.bbox),t&&!Array.isArray(t))throw new Error("bbox is invalid");return t?function(t){return[Math.random()*(t[2]-t[0])+t[0],Math.random()*(t[3]-t[1])+t[1]]}(t):[360*Ei(),180*Ei()]}function mi(t,e){if(!I(e=e||{}))throw new Error("options is invalid");var n=e.bbox;void 0!==t&&null!==t||(t=1);for(var i=[],o=0;o<t;o++)i.push(r(_i(n)));return c(i)}function vi(t,e){if(!I(e=e||{}))throw new Error("options is invalid");var n=e.bbox,r=e.num_vertices,i=e.max_radial_length;void 0!==t&&null!==t||(t=1),b(r)||(r=10),b(i)||(i=10);for(var s=[],a=0;a<t;a++){var u=[],h=Array.apply(null,new Array(r+1)).map(Math.random);h.forEach((function(t,e,n){n[e]=e>0?t+n[e-1]:t})),h.forEach((function(t){t=2*t*Math.PI/h[h.length-1];var e=Math.random();u.push([e*i*Math.sin(t),e*i*Math.cos(t)])})),u[u.length-1]=u[0],u=u.map(function(t){return function(e){return[e[0]+t[0],e[1]+t[1]]}}(_i(n))),s.push(o([u]))}return c(s)}function xi(t,e){if(!I(e=e||{}))throw new Error("options is invalid");var n=e.bbox,r=e.num_vertices,i=e.max_length,o=e.max_rotation;void 0!==t&&null!==t||(t=1),(!b(r)||r<2)&&(r=10),b(i)||(i=1e-4),b(o)||(o=Math.PI/8);for(var s=[],u=0;u<t;u++){for(var h=[_i(n)],l=0;l<r-1;l++){var p=(0===l?2*Math.random()*Math.PI:Math.tan((h[l][1]-h[l-1][1])/(h[l][0]-h[l-1][0])))+(Math.random()-.5)*o*2,f=Math.random()*i;h.push([h[l][0]+f*Math.cos(p),h[l][1]+f*Math.sin(p)])}s.push(a(h))}return c(s)}function Ei(){return Math.random()-.5}function wi(t,e){if(!t)throw new Error("geojson is required");if("FeatureCollection"!==t.type)throw new Error("geojson must be a FeatureCollection");if(void 0===e||null===e)throw new Error("filter is required");var n=[];return O(t,(function(t){Ci(t.properties,e)&&n.push(t)})),c(n)}function bi(t,e,n){if(!t)throw new Error("geojson is required");if("FeatureCollection"!==t.type)throw new Error("geojson must be a FeatureCollection");if(void 0===e||null===e)throw new Error("property is required");for(var r=Ni(t,e),i=Object.keys(r),o=0;o<i.length;o++){for(var s=i[o],a=r[s],u=[],h=0;h<a.length;h++)u.push(t.features[a[h]]);n(c(u),s,o)}}function Ii(t,e,n,r){var i=r;return bi(t,e,(function(t,e,o){i=0===o&&void 0===r?t:n(i,t,e,o)})),i}function Ni(t,e){var n={};return O(t,(function(t,r){var i=t.properties||{};if(i.hasOwnProperty(e)){var o=i[e];n.hasOwnProperty(o)?n[o].push(r):n[o]=[r]}})),n}function Ci(t,e){if(void 0===t)return!1;var n=typeof e;if("number"===n||"string"===n)return t.hasOwnProperty(e);if(Array.isArray(e)){for(var r=0;r<e.length;r++)if(!Ci(t,e[r]))return!1;return!0}return Si(t,e)}function Si(t,e){for(var n=Object.keys(e),r=0;r<n.length;r++){var i=n[r];if(t[i]!==e[i])return!1}return!0}function Mi(t,e){if(!e)return{};if(!e.length)return{};for(var n={},r=0;r<e.length;r++){var i=e[r];t.hasOwnProperty(i)&&(n[i]=t[i])}return n}function Li(){}function Pi(t){this.message=t||""}function Oi(t){this.message=t||""}function Ri(){}function Ti(t){return null===t?Ac:t.color}function Ai(t){return null===t?null:t.parent}function Di(t,e){null!==t&&(t.color=e)}function Fi(t){return null===t?null:t.left}function qi(t){return null===t?null:t.right}function Gi(){this.root_=null,this.size_=0}function Bi(){}function ki(){this.array_=[],arguments[0]instanceof vc&&this.addAll(arguments[0])}function zi(){}function ji(t){this.message=t||""}function Xi(){this.array_=[]}function Ui(t){switch(t.type){case"Polygon":return mn(t)>1?t:null;case"MultiPolygon":var e=[];if(F(t,(function(t){mn(t)>1&&e.push(t.geometry.coordinates)})),e.length)return{type:"MultiPolygon",coordinates:e}}}function Yi(){this.reset()}function Vi(t,e,n){var r=t.s=e+n,i=r-e,o=r-i;t.t=e-o+(n-i)}function Hi(t){return t>1?kf:t<-1?-kf:Math.asin(t)}function Wi(){}function Ji(t,e){t&&eg.hasOwnProperty(t.type)&&eg[t.type](t,e)}function Zi(t,e,n){var r,i=-1,o=t.length-n;for(e.lineStart();++i<o;)r=t[i],e.point(r[0],r[1],r[2]);e.lineEnd()}function Ki(t,e){var n=-1,r=t.length;for(e.polygonStart();++n<r;)Zi(t[n],e,1);e.polygonEnd()}function Qi(t){return[Hf(t[1],t[0]),Hi(t[2])]}function $i(t){var e=t[0],n=t[1],r=Wf(n);return[r*Wf(e),r*Kf(e),Kf(n)]}function to(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function eo(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function no(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function ro(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function io(t){var e=Qf(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}function oo(t,e){return[t>Bf?t-jf:t<-Bf?t+jf:t,e]}function so(t,e,n){return(t%=jf)?e||n?rg(uo(t),co(e,n)):uo(t):e||n?co(e,n):oo}function ao(t){return function(e,n){return[(e+=t)>Bf?e-jf:e<-Bf?e+jf:e,n]}}function uo(t){var e=ao(t);return e.invert=ao(-t),e}function co(t,e){function n(t,e){var n=Wf(e),a=Wf(t)*n,u=Kf(t)*n,c=Kf(e),h=c*r+a*i;return[Hf(u*o-h*s,a*r-c*i),Hi(h*o+u*s)]}var r=Wf(t),i=Kf(t),o=Wf(e),s=Kf(e);return n.invert=function(t,e){var n=Wf(e),a=Wf(t)*n,u=Kf(t)*n,c=Kf(e),h=c*o-u*s;return[Hf(u*o+c*s,a*r+h*i),Hi(h*r-a*i)]},n}function ho(t,e){(e=$i(e))[0]-=t,io(e);var n=function(t){return t>1?0:t<-1?Bf:Math.acos(t)}(-e[1]);return((-e[2]<0?-n:n)+jf-Gf)%jf}function lo(t,e,n,r){this.x=t,this.z=e,this.o=n,this.e=r,this.v=!1,this.n=this.p=null}function po(t){if(e=t.length){for(var e,n,r=0,i=t[0];++r<e;)i.n=n=t[r],n.p=i,i=n;i.n=n=t[0],n.p=i}}function fo(t,e,n,r){function i(i,o){return t<=i&&i<=n&&e<=o&&o<=r}function o(i,o,a,c){var h=0,l=0;if(null==i||(h=s(i,a))!==(l=s(o,a))||u(i,o)<0^a>0)do{c.point(0===h||3===h?t:n,h>1?r:e)}while((h=(h+a+4)%4)!==l);else c.point(o[0],o[1])}function s(r,i){return Yf(r[0]-t)<Gf?i>0?0:3:Yf(r[0]-n)<Gf?i>0?2:1:Yf(r[1]-e)<Gf?i>0?1:0:i>0?3:2}function a(t,e){return u(t.x,e.x)}function u(t,e){var n=s(t,1),r=s(e,1);return n!==r?n-r:0===n?e[1]-t[1]:1===n?t[0]-e[0]:2===n?t[1]-e[1]:e[0]-t[0]}return function(s){function u(t,e){i(t,e)&&E.point(t,e)}function c(o,s){var a=i(o,s);if(l&&p.push([o,s]),v)f=o,g=s,d=a,v=!1,a&&(E.lineStart(),E.point(o,s));else if(a&&m)E.point(o,s);else{var u=[y=Math.max(pg,Math.min(lg,y)),_=Math.max(pg,Math.min(lg,_))],c=[o=Math.max(pg,Math.min(lg,o)),s=Math.max(pg,Math.min(lg,s))];sg(u,c,t,e,n,r)?(m||(E.lineStart(),E.point(u[0],u[1])),E.point(c[0],c[1]),a||E.lineEnd(),x=!1):a&&(E.lineStart(),E.point(o,s),x=!1)}y=o,_=s,m=a}var h,l,p,f,g,d,y,_,m,v,x,E=s,w=og(),b={point:u,lineStart:function(){b.point=c,l&&l.push(p=[]),v=!0,m=!1,y=_=NaN},lineEnd:function(){h&&(c(f,g),d&&m&&w.rejoin(),h.push(w.result())),b.point=u,m&&E.lineEnd()},polygonStart:function(){E=w,h=[],l=[],x=!0},polygonEnd:function(){var e=function(){for(var e=0,n=0,i=l.length;n<i;++n)for(var o,s,a=l[n],u=1,c=a.length,h=a[0],p=h[0],f=h[1];u<c;++u)o=p,s=f,p=(h=a[u])[0],f=h[1],s<=r?f>r&&(p-o)*(r-s)>(f-s)*(t-o)&&++e:f<=r&&(p-o)*(r-s)<(f-s)*(t-o)&&--e;return e}(),n=x&&e,i=(h=hg(h)).length;(n||i)&&(s.polygonStart(),n&&(s.lineStart(),o(null,null,1,s),s.lineEnd()),i&&ug(h,a,e,o,s),s.polygonEnd()),E=s,h=l=p=null}};return b}}function go(t){return t.length>1}function yo(t,e){return((t=t.x)[0]<0?t[1]-kf-Gf:kf-t[1])-((e=e.x)[0]<0?e[1]-kf-Gf:kf-e[1])}function _o(t){return function(e){var n=new mo;for(var r in t)n[r]=t[r];return n.stream=e,n}}function mo(){}function vo(t,e,n){var r=e[1][0]-e[0][0],i=e[1][1]-e[0][1],o=t.clipExtent&&t.clipExtent();t.scale(150).translate([0,0]),null!=o&&t.clipExtent(null),ng(n,t.stream(vg));var s=vg.result(),a=Math.min(r/(s[1][0]-s[0][0]),i/(s[1][1]-s[0][1])),u=+e[0][0]+(r-a*(s[1][0]+s[0][0]))/2,c=+e[0][1]+(i-a*(s[1][1]+s[0][1]))/2;return null!=o&&t.clipExtent(o),t.scale(150*a).translate([u,c])}function xo(t){return function(t){function e(t){return[(t=c(t[0]*Uf,t[1]*Uf))[0]*d+s,a-t[1]*d]}function n(t,e){return[(t=o(t,e))[0]*d+s,a-t[1]*d]}function r(){c=rg(u=so(x,E,w),o);var t=o(m,v);return s=y-t[0]*d,a=_+t[1]*d,i()}function i(){return f=g=null,e}var o,s,a,u,c,h,l,p,f,g,d=150,y=480,_=250,m=0,v=0,x=0,E=0,w=0,b=null,I=Eg,N=null,C=gg,S=.5,M=Ng(n,S);return e.stream=function(t){return f&&g===t?f:f=Cg(I(u,M(C(g=t))))},e.clipAngle=function(t){return arguments.length?(I=+t?wg(b=t*Uf,6*Uf):(b=null,Eg),i()):b*Xf},e.clipExtent=function(t){return arguments.length?(C=null==t?(N=h=l=p=null,gg):fo(N=+t[0][0],h=+t[0][1],l=+t[1][0],p=+t[1][1]),i()):null==N?null:[[N,h],[l,p]]},e.scale=function(t){return arguments.length?(d=+t,r()):d},e.translate=function(t){return arguments.length?(y=+t[0],_=+t[1],r()):[y,_]},e.center=function(t){return arguments.length?(m=t[0]%360*Uf,v=t[1]%360*Uf,r()):[m*Xf,v*Xf]},e.rotate=function(t){return arguments.length?(x=t[0]%360*Uf,E=t[1]%360*Uf,w=t.length>2?t[2]%360*Uf:0,r()):[x*Xf,E*Xf,w*Xf]},e.precision=function(t){return arguments.length?(M=Ng(n,S=t*t),i()):Qf(S)},e.fitExtent=function(t,n){return vo(e,t,n)},e.fitSize=function(t,n){return function(t,e,n){return vo(t,[[0,0],e],n)}(e,t,n)},function(){return o=t.apply(this,arguments),e.invert=o.invert&&function(t){return(t=c.invert((t[0]-s)/d,(a-t[1])/d))&&[t[0]*Xf,t[1]*Xf]},r()}}((function(){return t}))()}function Eo(t,e){return[t,Zf($f((kf+e)/2))]}function wo(t,e){return[Zf($f((kf+e)/2)),-t]}function bo(t,n,r,i){var o=t.properties||{},s="Feature"===t.type?t.geometry:t;if("GeometryCollection"===s.type){var a=[];return A(t,(function(t){var e=bo(t,n,r,i);e&&a.push(e)})),c(a)}var u,h=j(t),l=h[1]>50&&h[3]>50;u=l?{type:s.type,coordinates:No(s.coordinates,So(s))}:cn(s);var p,f=(new bh).read(u),g=d(y(n,r),"meters"),_=gp.bufferOp(f,g);if(!Io((_=(new Ih).write(_)).coordinates))return(p=l?{type:_.type,coordinates:Co(_.coordinates,So(s))}:hn(_)).geometry?p:e(p,o)}function Io(t){return Array.isArray(t[0])?Io(t[0]):isNaN(t[0])}function No(t,e){return"object"!=typeof t[0]?e(t):t.map((function(t){return No(t,e)}))}function Co(t,e){return"object"!=typeof t[0]?e.invert(t):t.map((function(t){return Co(t,e)}))}function So(t){var e=de(t).geometry.coordinates.reverse(),n=e.map((function(t){return-t}));return Sg().center(e).rotate(n).scale(Fo)}function Mo(){for(var t=new bh,e=t.read(JSON.stringify(arguments[0].geometry)),n=1;n<arguments.length;n++)e=Df.union(e,t.read(JSON.stringify(arguments[n].geometry)));return{type:"Feature",geometry:e=(new Ih).write(e),properties:arguments[0].properties}}function Lo(t,n){var r=J(t),i=J(n);if(te(Pn(i,{precision:4})).coordinates[0].length<4)return null;if(te(Pn(r,{precision:4})).coordinates[0].length<4)return null;var o=new bh,s=o.read(Pn(r)),a=o.read(Pn(i)),u=Cf.intersection(s,a);return u.isEmpty()?null:e((new Ih).write(u))}function Po(t,e){return function(t,e,n){var r,i;if(!Array.isArray(e))throw new Error("Get closest expects an array as second argument");return e.forEach((function(e,o){var s=n(e,t);s>=0&&(void 0===i||s<i)&&(i=s,r=o)})),r}(t,e,(function(t,e){return t-e}))}function Oo(t,e,n){if(!I(n=n||{}))throw new Error("options is invalid");var r=n.properties||{},i=n.triangles,s=n.mask;if(null===e||void 0===e)throw new Error("cellSide is required");if(!b(e))throw new Error("cellSide is invalid");if(!t)throw new Error("bbox is required");if(!Array.isArray(t))throw new Error("bbox must be array");if(4!==t.length)throw new Error("bbox must contain 4 numbers");if(s&&-1===["Polygon","MultiPolygon"].indexOf(K(s)))throw new Error("options.mask must be a (Multi)Polygon");var a=t[0],u=t[1],h=t[2],l=t[3],p=(u+l)/2,f=(a+h)/2,g=2*e/qt([a,p],[h,p],n)*(h-a),d=2*e/qt([f,u],[f,l],n)*(l-u),y=g/2,_=2*y,m=Math.sqrt(3)/2*d,v=h-a,x=l-u,E=.75*_,w=m,N=(v-_)/(_-y/2),C=Math.floor(N),S=(C*E-y/2-v)/2-y/2+E/2,M=Math.floor((x-m)/m),L=(x-M*m)/2,P=M*m-x>m/2;P&&(L-=m/4);for(var O=[],R=[],T=0;T<6;T++){var A=2*Math.PI/6*T;O.push(Math.cos(A)),R.push(Math.sin(A))}for(var D=[],F=0;F<=C;F++)for(var q=0;q<=M;q++){var G=F%2==1;if((0!==q||!G)&&(0!==q||!P)){var B=F*E+a-S,k=q*w+u+L;if(G&&(k-=m/2),!0===i)(function(t,e,n,r,i,s){for(var a=[],u=0;u<6;u++){var c=[];c.push(t),c.push([t[0]+e*i[u],t[1]+n*s[u]]),c.push([t[0]+e*i[(u+1)%6],t[1]+n*s[(u+1)%6]]),c.push(t),a.push(o([c],r))}return a})([B,k],g/2,d/2,r,O,R).forEach((function(t){s?Lo(s,t)&&D.push(t):D.push(t)}));else{var z=function(t,e,n,r,i,s){for(var a=[],u=0;u<6;u++){var c=t[0]+e*i[u],h=t[1]+n*s[u];a.push([c,h])}return a.push(a[0].slice()),o([a],r)}([B,k],g/2,d/2,r,O,R);s?Lo(s,z)&&D.push(z):D.push(z)}}}return c(D)}function Ro(t){if(t.features.length<=1)return t;var e=function(t){var e=Vo(),n=[];return F(t,(function(t,e){var r=j(t);n.push({minX:r[0],minY:r[1],maxX:r[2],maxY:r[3],geojson:t,index:e})})),e.load(n),e}(t),n=[],r={};return F(t,(function(t,i){if(r[i])return!0;for(e.remove({index:i},To),r[i]=!0;;){var o=j(t),s=e.search({minX:o[0],minY:o[1],maxX:o[2],maxY:o[3]});if(s.length>0){var a=s.map((function(t){return r[t.index]=!0,e.remove({index:t.index},To),t.geojson}));a.push(t),t=Mo.apply(this,a)}if(0===s.length)break}n.push(t)})),c(n)}function To(t,e){return t.index===e.index}function Ao(t,e,n){if(!I(n=n||{}))throw new Error("options is invalid");var r=n.properties,i=n.mask,s=[];if(null===e||void 0===e)throw new Error("cellSide is required");if(!b(e))throw new Error("cellSide is invalid");if(!t)throw new Error("bbox is required");if(!Array.isArray(t))throw new Error("bbox must be array");if(4!==t.length)throw new Error("bbox must contain 4 numbers");if(i&&-1===["Polygon","MultiPolygon"].indexOf(K(i)))throw new Error("options.mask must be a (Multi)Polygon");for(var a=t[0],u=t[1],h=t[2],l=t[3],p=e/qt([a,u],[h,u],n)*(h-a),f=e/qt([a,u],[a,l],n)*(l-u),g=h-a,d=l-u,y=Math.floor(g/p),_=Math.floor(d/f),m=(d-_*f)/2,v=a+(g-y*p)/2,x=0;x<y;x++){for(var E=u+m,w=0;w<_;w++){var N=o([[[v,E],[v,E+f],[v+p,E+f],[v+p,E],[v,E]]],r);i?Lo(i,N)&&s.push(N):s.push(N),E+=f}v+=p}return c(s)}function Do(t,e,n){if(!I(n=n||{}))throw new Error("options is invalid");var r=n.properties,i=n.mask,s=[];if(null===e||void 0===e)throw new Error("cellSide is required");if(!b(e))throw new Error("cellSide is invalid");if(!t)throw new Error("bbox is required");if(!Array.isArray(t))throw new Error("bbox must be array");if(4!==t.length)throw new Error("bbox must contain 4 numbers");if(i&&-1===["Polygon","MultiPolygon"].indexOf(K(i)))throw new Error("options.mask must be a (Multi)Polygon");for(var a=e/qt([t[0],t[1]],[t[2],t[1]],n)*(t[2]-t[0]),u=e/qt([t[0],t[1]],[t[0],t[3]],n)*(t[3]-t[1]),h=0,l=t[0];l<=t[2];){for(var p=0,f=t[1];f<=t[3];){var g=null,d=null;h%2==0&&p%2==0?(g=o([[[l,f],[l,f+u],[l+a,f],[l,f]]],r),d=o([[[l,f+u],[l+a,f+u],[l+a,f],[l,f+u]]],r)):h%2==0&&p%2==1?(g=o([[[l,f],[l+a,f+u],[l+a,f],[l,f]]],r),d=o([[[l,f],[l,f+u],[l+a,f+u],[l,f]]],r)):p%2==0&&h%2==1?(g=o([[[l,f],[l,f+u],[l+a,f+u],[l,f]]],r),d=o([[[l,f],[l+a,f+u],[l+a,f],[l,f]]],r)):p%2==1&&h%2==1&&(g=o([[[l,f],[l,f+u],[l+a,f],[l,f]]],r),d=o([[[l,f+u],[l+a,f+u],[l+a,f],[l,f+u]]],r)),i?(Lo(i,g)&&s.push(g),Lo(i,d)&&s.push(d)):(s.push(g),s.push(d)),f+=u,p++}h++,l+=a}return c(s)}var Fo=6371008.8,qo={meters:Fo,metres:Fo,millimeters:1e3*Fo,millimetres:1e3*Fo,centimeters:100*Fo,centimetres:100*Fo,kilometers:Fo/1e3,kilometres:Fo/1e3,miles:Fo/1609.344,nauticalmiles:Fo/1852,inches:39.37*Fo,yards:Fo/1.0936,feet:3.28084*Fo,radians:1,degrees:Fo/111325},Go={meters:1,metres:1,millimeters:1e3,millimetres:1e3,centimeters:100,centimetres:100,kilometers:.001,kilometres:.001,miles:1/1609.344,nauticalmiles:1/1852,inches:39.37,yards:1/1.0936,feet:3.28084,radians:1/Fo,degrees:1/111325},Bo={meters:1,metres:1,millimeters:1e6,millimetres:1e6,centimeters:1e4,centimetres:1e4,kilometers:1e-6,kilometres:1e-6,acres:247105e-9,miles:386e-9,yards:1.195990046,feet:10.763910417,inches:1550.003100006},ko=Object.freeze({earthRadius:Fo,factors:qo,unitsFactors:Go,areaFactors:Bo,feature:e,geometry:n,point:r,points:i,polygon:o,polygons:s,lineString:a,lineStrings:u,featureCollection:c,multiLineString:h,multiPoint:l,multiPolygon:p,geometryCollection:f,round:g,radiansToLength:d,lengthToRadians:y,lengthToDegrees:_,bearingToAzimuth:m,radiansToDegrees:v,degreesToRadians:x,convertLength:E,convertArea:w,isNumber:b,isObject:I,validateBBox:N,validateId:C,radians2degrees:function(){throw new Error("method has been renamed to `radiansToDegrees`")},degrees2radians:function(){throw new Error("method has been renamed to `degreesToRadians`")},distanceToDegrees:function(){throw new Error("method has been renamed to `lengthToDegrees`")},distanceToRadians:function(){throw new Error("method has been renamed to `lengthToRadians`")},radiansToDistance:function(){throw new Error("method has been renamed to `radiansToLength`")},bearingToAngle:function(){throw new Error("method has been renamed to `bearingToAzimuth`")},convertDistance:function(){throw new Error("method has been renamed to `convertLength`")}}),zo=Object.freeze({coordEach:S,coordReduce:M,propEach:L,propReduce:P,featureEach:O,featureReduce:R,coordAll:T,geomEach:A,geomReduce:D,flattenEach:F,flattenReduce:q,segmentEach:G,segmentReduce:B,lineEach:k,lineReduce:z}),jo=Object.freeze({getCoord:X,getCoords:U,containsNumber:Y,geojsonType:V,featureOf:H,collectionOf:W,getGeom:J,getGeomType:Z,getType:K}),Xo={successCallback:null,verbose:!1},Uo={},Yo=it,Vo=st;st.prototype={all:function(){return this._all(this.data,[])},search:function(t){var e=this.data,n=[],r=this.toBBox;if(!dt(t,e))return n;for(var i,o,s,a,u=[];e;){for(i=0,o=e.children.length;i<o;i++)s=e.children[i],dt(t,a=e.leaf?r(s):s)&&(e.leaf?n.push(s):gt(t,a)?this._all(s,n):u.push(s));e=u.pop()}return n},collides:function(t){var e=this.data,n=this.toBBox;if(!dt(t,e))return!1;for(var r,i,o,s,a=[];e;){for(r=0,i=e.children.length;r<i;r++)if(o=e.children[r],dt(t,s=e.leaf?n(o):o)){if(e.leaf||gt(t,s))return!0;a.push(o)}e=a.pop()}return!1},load:function(t){if(!t||!t.length)return this;if(t.length<this._minEntries){for(var e=0,n=t.length;e<n;e++)this.insert(t[e]);return this}var r=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===r.height)this._splitRoot(this.data,r);else{if(this.data.height<r.height){var i=this.data;this.data=r,r=i}this._insert(r,this.data.height-r.height-1,!0)}else this.data=r;return this},insert:function(t){return t&&this._insert(t,this.data.height-1),this},clear:function(){return this.data=yt([]),this},remove:function(t,e){if(!t)return this;for(var n,r,i,o,s=this.data,a=this.toBBox(t),u=[],c=[];s||u.length;){if(s||(s=u.pop(),r=u[u.length-1],n=c.pop(),o=!0),s.leaf&&-1!==(i=function(t,e,n){if(!n)return e.indexOf(t);for(var r=0;r<e.length;r++)if(n(t,e[r]))return r;return-1}(t,s.children,e)))return s.children.splice(i,1),u.push(s),this._condense(u),this;o||s.leaf||!gt(s,a)?r?(n++,s=r.children[n],o=!1):s=null:(u.push(s),c.push(n),n=0,r=s,s=s.children[0])}return this},toBBox:function(t){return t},compareMinX:ht,compareMinY:lt,toJSON:function(){return this.data},fromJSON:function(t){return this.data=t,this},_all:function(t,e){for(var n=[];t;)t.leaf?e.push.apply(e,t.children):n.push.apply(n,t.children),t=n.pop();return e},_build:function(t,e,n,r){var i,o=n-e+1,s=this._maxEntries;if(o<=s)return at(i=yt(t.slice(e,n+1)),this.toBBox),i;r||(r=Math.ceil(Math.log(o)/Math.log(s)),s=Math.ceil(o/Math.pow(s,r-1))),(i=yt([])).leaf=!1,i.height=r;var a,u,c,h,l=Math.ceil(o/s),p=l*Math.ceil(Math.sqrt(s));for(_t(t,e,n,p,this.compareMinX),a=e;a<=n;a+=p)for(_t(t,a,c=Math.min(a+p-1,n),l,this.compareMinY),u=a;u<=c;u+=l)h=Math.min(u+l-1,c),i.children.push(this._build(t,u,h,r-1));return at(i,this.toBBox),i},_chooseSubtree:function(t,e,n,r){for(var i,o,s,a,u,c,h,l;r.push(e),!e.leaf&&r.length-1!==n;){for(h=l=1/0,i=0,o=e.children.length;i<o;i++)u=pt(s=e.children[i]),(c=function(t,e){return(Math.max(e.maxX,t.maxX)-Math.min(e.minX,t.minX))*(Math.max(e.maxY,t.maxY)-Math.min(e.minY,t.minY))}(t,s)-u)<l?(l=c,h=u<h?u:h,a=s):c===l&&u<h&&(h=u,a=s);e=a||e.children[0]}return e},_insert:function(t,e,n){var r=this.toBBox,i=n?t:r(t),o=[],s=this._chooseSubtree(i,this.data,e,o);for(s.children.push(t),ct(s,i);e>=0&&o[e].children.length>this._maxEntries;)this._split(o,e),e--;this._adjustParentBBoxes(i,o,e)},_split:function(t,e){var n=t[e],r=n.children.length,i=this._minEntries;this._chooseSplitAxis(n,i,r);var o=this._chooseSplitIndex(n,i,r),s=yt(n.children.splice(o,n.children.length-o));s.height=n.height,s.leaf=n.leaf,at(n,this.toBBox),at(s,this.toBBox),e?t[e-1].children.push(s):this._splitRoot(n,s)},_splitRoot:function(t,e){this.data=yt([t,e]),this.data.height=t.height+1,this.data.leaf=!1,at(this.data,this.toBBox)},_chooseSplitIndex:function(t,e,n){var r,i,o,s,a,u,c,h;for(u=c=1/0,r=e;r<=n-e;r++)s=function(t,e){var n=Math.max(t.minX,e.minX),r=Math.max(t.minY,e.minY),i=Math.min(t.maxX,e.maxX),o=Math.min(t.maxY,e.maxY);return Math.max(0,i-n)*Math.max(0,o-r)}(i=ut(t,0,r,this.toBBox),o=ut(t,r,n,this.toBBox)),a=pt(i)+pt(o),s<u?(u=s,h=r,c=a<c?a:c):s===u&&a<c&&(c=a,h=r);return h},_chooseSplitAxis:function(t,e,n){var r=t.leaf?this.compareMinX:ht,i=t.leaf?this.compareMinY:lt;this._allDistMargin(t,e,n,r)<this._allDistMargin(t,e,n,i)&&t.children.sort(r)},_allDistMargin:function(t,e,n,r){t.children.sort(r);var i,o,s=this.toBBox,a=ut(t,0,e,s),u=ut(t,n-e,n,s),c=ft(a)+ft(u);for(i=e;i<n-e;i++)o=t.children[i],ct(a,t.leaf?s(o):o),c+=ft(a);for(i=n-e-1;i>=e;i--)o=t.children[i],ct(u,t.leaf?s(o):o),c+=ft(u);return c},_adjustParentBBoxes:function(t,e,n){for(var r=n;r>=0;r--)ct(e[r],t)},_condense:function(t){for(var e,n=t.length-1;n>=0;n--)0===t[n].children.length?n>0?(e=t[n-1].children).splice(e.indexOf(t[n]),1):this.clear():at(t[n],this.toBBox)},_initFormat:function(t){var e=["return a"," - b",";"];this.compareMinX=new Function("a","b",e.join(t[0])),this.compareMinY=new Function("a","b",e.join(t[1])),this.toBBox=new Function("a","return {minX: a"+t[0]+", minY: a"+t[1]+", maxX: a"+t[2]+", maxY: a"+t[3]+"};")}};var Ho=function(t,e,n){var r=t*e,i=Wo*t,o=i-(i-t),s=t-o,a=Wo*e,u=a-(a-e),c=e-u,h=s*c-(r-o*u-s*u-o*c);return n?(n[0]=h,n[1]=r,n):[h,r]},Wo=+(Math.pow(2,27)+1),Jo=function(t,e){var n=0|t.length,r=0|e.length;if(1===n&&1===r)return function(t,e){var n=t+e,r=n-t,i=t-(n-r)+(e-r);return i?[i,n]:[n]}(t[0],e[0]);var i,o,s=new Array(n+r),a=0,u=0,c=0,h=Math.abs,l=t[u],p=h(l),f=e[c],g=h(f);p<g?(o=l,(u+=1)<n&&(p=h(l=t[u]))):(o=f,(c+=1)<r&&(g=h(f=e[c]))),u<n&&p<g||c>=r?(i=l,(u+=1)<n&&(p=h(l=t[u]))):(i=f,(c+=1)<r&&(g=h(f=e[c])));for(var d,y,_=i+o,m=_-i,v=o-m,x=v,E=_;u<n&&c<r;)p<g?(i=l,(u+=1)<n&&(p=h(l=t[u]))):(i=f,(c+=1)<r&&(g=h(f=e[c]))),(v=(o=x)-(m=(_=i+o)-i))&&(s[a++]=v),x=E-((d=E+_)-(y=d-E))+(_-y),E=d;for(;u<n;)(v=(o=x)-(m=(_=(i=l)+o)-i))&&(s[a++]=v),x=E-((d=E+_)-(y=d-E))+(_-y),E=d,(u+=1)<n&&(l=t[u]);for(;c<r;)(v=(o=x)-(m=(_=(i=f)+o)-i))&&(s[a++]=v),x=E-((d=E+_)-(y=d-E))+(_-y),E=d,(c+=1)<r&&(f=e[c]);return x&&(s[a++]=x),E&&(s[a++]=E),a||(s[a++]=0),s.length=a,s},Zo=function(t,e,n){var r=t+e,i=r-t,o=e-i,s=t-(r-i);return n?(n[0]=s+o,n[1]=r,n):[s+o,r]},Ko=function(t,e){var n=t.length;if(1===n){var r=Ho(t[0],e);return r[0]?r:[r[1]]}var i=new Array(2*n),o=[.1,.1],s=[.1,.1],a=0;Ho(t[0],e,o),o[0]&&(i[a++]=o[0]);for(var u=1;u<n;++u){Ho(t[u],e,s);var c=o[1];Zo(c,s[0],o),o[0]&&(i[a++]=o[0]);var h=s[1],l=o[1],p=h+l,f=l-(p-h);o[1]=p,f&&(i[a++]=f)}return o[1]&&(i[a++]=o[1]),0===a&&(i[a++]=0),i.length=a,i},Qo=function(t,e){var n=0|t.length,r=0|e.length;if(1===n&&1===r)return function(t,e){var n=t+e,r=n-t,i=t-(n-r)+(e-r);return i?[i,n]:[n]}(t[0],-e[0]);var i,o,s=new Array(n+r),a=0,u=0,c=0,h=Math.abs,l=t[u],p=h(l),f=-e[c],g=h(f);p<g?(o=l,(u+=1)<n&&(p=h(l=t[u]))):(o=f,(c+=1)<r&&(g=h(f=-e[c]))),u<n&&p<g||c>=r?(i=l,(u+=1)<n&&(p=h(l=t[u]))):(i=f,(c+=1)<r&&(g=h(f=-e[c])));for(var d,y,_=i+o,m=_-i,v=o-m,x=v,E=_;u<n&&c<r;)p<g?(i=l,(u+=1)<n&&(p=h(l=t[u]))):(i=f,(c+=1)<r&&(g=h(f=-e[c]))),(v=(o=x)-(m=(_=i+o)-i))&&(s[a++]=v),x=E-((d=E+_)-(y=d-E))+(_-y),E=d;for(;u<n;)(v=(o=x)-(m=(_=(i=l)+o)-i))&&(s[a++]=v),x=E-((d=E+_)-(y=d-E))+(_-y),E=d,(u+=1)<n&&(l=t[u]);for(;c<r;)(v=(o=x)-(m=(_=(i=f)+o)-i))&&(s[a++]=v),x=E-((d=E+_)-(y=d-E))+(_-y),E=d,(c+=1)<r&&(f=-e[c]);return x&&(s[a++]=x),E&&(s[a++]=E),a||(s[a++]=0),s.length=a,s},$o=mt((function(t){function e(t,e){for(var n=new Array(t.length-1),r=1;r<t.length;++r)for(var i=n[r-1]=new Array(t.length-1),o=0,s=0;o<t.length;++o)o!==e&&(i[s++]=t[r][o]);return n}function n(t){return 1&t?"-":""}function r(t){if(1===t.length)return t[0];if(2===t.length)return["sum(",t[0],",",t[1],")"].join("");var e=t.length>>1;return["sum(",r(t.slice(0,e)),",",r(t.slice(e)),")"].join("")}function i(t){if(2===t.length)return[["sum(prod(",t[0][0],",",t[1][1],"),prod(-",t[0][1],",",t[1][0],"))"].join("")];for(var o=[],s=0;s<t.length;++s)o.push(["scale(",r(i(e(t,s))),",",n(s),t[0][s],")"].join(""));return o}function o(t){for(var n=[],o=[],s=function(t){for(var e=new Array(t),n=0;n<t;++n){e[n]=new Array(t);for(var r=0;r<t;++r)e[n][r]=["m",r,"[",t-n-1,"]"].join("")}return e}(t),a=[],u=0;u<t;++u)0==(1&u)?n.push.apply(n,i(e(s,u))):o.push.apply(o,i(e(s,u))),a.push("m"+u);var c=r(n),h=r(o),l="orientation"+t+"Exact",p=["function ",l,"(",a.join(),"){var p=",c,",n=",h,",d=sub(p,n);return d[d.length-1];};return ",l].join("");return new Function("sum","prod","scale","sub",p)(Jo,Ho,Ko,Qo)}var s=5,a=o(3),u=o(4),c=[function(){return 0},function(){return 0},function(t,e){return e[0]-t[0]},function(t,e,n){var r,i=(t[1]-n[1])*(e[0]-n[0]),o=(t[0]-n[0])*(e[1]-n[1]),s=i-o;if(i>0){if(o<=0)return s;r=i+o}else{if(!(i<0))return s;if(o>=0)return s;r=-(i+o)}var u=33306690738754716e-32*r;return s>=u||s<=-u?s:a(t,e,n)},function(t,e,n,r){var i=t[0]-r[0],o=e[0]-r[0],s=n[0]-r[0],a=t[1]-r[1],c=e[1]-r[1],h=n[1]-r[1],l=t[2]-r[2],p=e[2]-r[2],f=n[2]-r[2],g=o*h,d=s*c,y=s*a,_=i*h,m=i*c,v=o*a,x=l*(g-d)+p*(y-_)+f*(m-v),E=7771561172376103e-31*((Math.abs(g)+Math.abs(d))*Math.abs(l)+(Math.abs(y)+Math.abs(_))*Math.abs(p)+(Math.abs(m)+Math.abs(v))*Math.abs(f));return x>E||-x>E?x:u(t,e,n,r)}];!function(){for(;c.length<=s;)c.push(o(c.length));for(var e=[],n=["slow"],r=0;r<=s;++r)e.push("a"+r),n.push("o"+r);var i=["function getOrientation(",e.join(),"){switch(arguments.length){case 0:case 1:return 0;"];for(r=2;r<=s;++r)i.push("case ",r,":return o",r,"(",e.slice(0,r).join(),");");i.push("}var s=new Array(arguments.length);for(var i=0;i<arguments.length;++i){s[i]=arguments[i]};return slow(s);}return getOrientation"),n.push(i.join(""));var a=Function.apply(void 0,n);for(t.exports=a.apply(void 0,[function(t){var e=c[t.length];return e||(e=c[t.length]=o(t.length)),e.apply(void 0,t)}].concat(c)),r=0;r<=s;++r)t.exports[r]=c[r]}()})),ts=function(t){var e=t.length;if(e<3){for(var n=new Array(e),r=0;r<e;++r)n[r]=r;return 2===e&&t[0][0]===t[1][0]&&t[0][1]===t[1][1]?[0]:n}var i=new Array(e);for(r=0;r<e;++r)i[r]=r;i.sort((function(e,n){return t[e][0]-t[n][0]||t[e][1]-t[n][1]}));var o=[i[0],i[1]],s=[i[0],i[1]];for(r=2;r<e;++r){for(var a=i[r],u=t[a],c=o.length;c>1&&es(t[o[c-2]],t[o[c-1]],u)<=0;)c-=1,o.pop();for(o.push(a),c=s.length;c>1&&es(t[s[c-2]],t[s[c-1]],u)>=0;)c-=1,s.pop();s.push(a)}n=new Array(s.length+o.length-2);for(var h=0,l=(r=0,o.length);r<l;++r)n[h++]=o[r];for(var p=s.length-2;p>0;--p)n[h++]=s[p];return n},es=$o[3],ns=vt,rs=vt;vt.prototype={push:function(t){this.data.push(t),this.length++,this._up(this.length-1)},pop:function(){if(0!==this.length){var t=this.data[0];return this.length--,this.length>0&&(this.data[0]=this.data[this.length],this._down(0)),this.data.pop(),t}},peek:function(){return this.data[0]},_up: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},_down:function(t){for(var e=this.data,n=this.compare,r=this.length>>1,i=e[t];t<r;){var o=1+(t<<1),s=o+1,a=e[o];if(s<this.length&&n(e[s],a)<0&&(o=s,a=e[s]),n(a,i)>=0)break;e[t]=a,t=o}e[t]=i}},ns.default=rs;var is=function(t,e){for(var n=t[0],r=t[1],i=!1,o=0,s=e.length-1;o<e.length;s=o++){var a=e[o][0],u=e[o][1],c=e[s][0],h=e[s][1];u>r!=h>r&&n<(c-a)*(r-u)/(h-u)+a&&(i=!i)}return i},os=$o[3],ss=xt,as=xt;ss.default=as;var us=function(t){return t},cs=function(t){if(null==t)return us;var e,n,r=t.scale[0],i=t.scale[1],o=t.translate[0],s=t.translate[1];return function(t,a){a||(e=n=0);var u=2,c=t.length,h=new Array(c);for(h[0]=(e+=t[0])*r+o,h[1]=(n+=t[1])*i+s;u<c;)h[u]=t[u],++u;return h}},hs=function(t,e){for(var n,r=t.length,i=r-e;i<--r;)n=t[i],t[i++]=t[r],t[r]=n},ls=function(t,e){function n(t,e){for(var n in t){var i=t[n];delete e[i.start],delete i.start,delete i.end,i.forEach((function(t){r[t<0?~t:t]=1})),s.push(i)}}var r={},i={},o={},s=[],a=-1;return e.forEach((function(n,r){var i,o=t.arcs[n<0?~n:n];o.length<3&&!o[1][0]&&!o[1][1]&&(i=e[++a],e[a]=n,e[r]=i)})),e.forEach((function(e){var n,r,s=function(e){var n,r=t.arcs[e<0?~e:e],i=r[0];return t.transform?(n=[0,0],r.forEach((function(t){n[0]+=t[0],n[1]+=t[1]}))):n=r[r.length-1],e<0?[n,i]:[i,n]}(e),a=s[0],u=s[1];if(n=o[a])if(delete o[n.end],n.push(e),n.end=u,r=i[u]){delete i[r.start];var c=r===n?n:n.concat(r);i[c.start=n.start]=o[c.end=r.end]=c}else i[n.start]=o[n.end]=n;else if(n=i[u])if(delete i[n.start],n.unshift(e),n.start=a,r=o[a]){delete o[r.end];var h=r===n?n:r.concat(n);i[h.start=r.start]=o[h.end=n.end]=h}else i[n.start]=o[n.end]=n;else i[(n=[e]).start=a]=o[n.end=u]=n})),n(o,i),n(i,o),e.forEach((function(t){r[t<0?~t:t]||s.push([t])})),s},ps=function(t){return Xt(t,Ut.apply(this,arguments))},fs=function(t,e,n,r,i,o){3===arguments.length&&(r=o=Array,i=null);for(var s=new r(t=1<<Math.max(4,Math.ceil(Math.log(t)/Math.LN2))),a=new o(t),u=t-1,c=0;c<t;++c)s[c]=i;return{set:function(r,o){for(var c=e(r)&u,h=s[c],l=0;h!=i;){if(n(h,r))return a[c]=o;if(++l>=t)throw new Error("full hashmap");h=s[c=c+1&u]}return s[c]=r,a[c]=o,o},maybeSet:function(r,o){for(var c=e(r)&u,h=s[c],l=0;h!=i;){if(n(h,r))return a[c];if(++l>=t)throw new Error("full hashmap");h=s[c=c+1&u]}return s[c]=r,a[c]=o,o},get:function(r,o){for(var c=e(r)&u,h=s[c],l=0;h!=i;){if(n(h,r))return a[c];if(++l>=t)break;h=s[c=c+1&u]}return o},keys:function(){for(var t=[],e=0,n=s.length;e<n;++e){var r=s[e];r!=i&&t.push(r)}return t}}},gs=function(t,e){return t[0]===e[0]&&t[1]===e[1]},ds=new ArrayBuffer(16),ys=new Float64Array(ds),_s=new Uint32Array(ds),ms=function(t){ys[0]=t[0],ys[1]=t[1];var e=_s[0]^_s[1];return 2147483647&(e<<5^e>>7^_s[2]^_s[3])},vs=function(t){function e(t,e,n,r){if(p[n]!==t){p[n]=t;var i=f[n];if(i>=0){var o=g[n];i===e&&o===r||i===r&&o===e||(++y,d[n]=1)}else f[n]=e,g[n]=r}}function n(t){return ms(u[t])}function r(t,e){return gs(u[t],u[e])}var i,o,s,a,u=t.coordinates,c=t.lines,h=t.rings,l=function(){for(var t=fs(1.4*u.length,n,r,Int32Array,-1,Int32Array),e=new Int32Array(u.length),i=0,o=u.length;i<o;++i)e[i]=t.maybeSet(i,i);return e}(),p=new Int32Array(u.length),f=new Int32Array(u.length),g=new Int32Array(u.length),d=new Int8Array(u.length),y=0;for(i=0,o=u.length;i<o;++i)p[i]=f[i]=g[i]=-1;for(i=0,o=c.length;i<o;++i){var _=c[i],m=_[0],v=_[1];for(s=l[m],a=l[++m],++y,d[s]=1;++m<=v;)e(i,s,s=a,a=l[m]);++y,d[a]=1}for(i=0,o=u.length;i<o;++i)p[i]=-1;for(i=0,o=h.length;i<o;++i){var x=h[i],E=x[0]+1,w=x[1];for(e(i,l[w-1],s=l[E-1],a=l[E]);++E<=w;)e(i,s,s=a,a=l[E])}p=f=g=null;var b,I=function(t,e,n,r,i){3===arguments.length&&(r=Array,i=null);for(var o=new r(t=1<<Math.max(4,Math.ceil(Math.log(t)/Math.LN2))),s=t-1,a=0;a<t;++a)o[a]=i;return{add:function(r){for(var a=e(r)&s,u=o[a],c=0;u!=i;){if(n(u,r))return!0;if(++c>=t)throw new Error("full hashset");u=o[a=a+1&s]}return o[a]=r,!0},has:function(r){for(var a=e(r)&s,u=o[a],c=0;u!=i;){if(n(u,r))return!0;if(++c>=t)break;u=o[a=a+1&s]}return!1},values:function(){for(var t=[],e=0,n=o.length;e<n;++e){var r=o[e];r!=i&&t.push(r)}return t}}}(1.4*y,ms,gs);for(i=0,o=u.length;i<o;++i)d[b=l[i]]&&I.add(u[b]);return I},xs=function(t){var e,n,r,i=vs(t),o=t.coordinates,s=t.lines,a=t.rings;for(n=0,r=s.length;n<r;++n)for(var u=s[n],c=u[0],h=u[1];++c<h;)i.has(o[c])&&(e={0:c,1:u[1]},u[1]=c,u=u.next=e);for(n=0,r=a.length;n<r;++n)for(var l=a[n],p=l[0],f=p,g=l[1],d=i.has(o[p]);++f<g;)i.has(o[f])&&(d?(e={0:f,1:l[1]},l[1]=f,l=l.next=e):(function(t,e,n,r){Yt(t,e,n),Yt(t,e,e+r),Yt(t,e+r,n)}(o,p,g,g-f),o[g]=o[p],d=!0,f=p));return t},Es=function(t){function e(t){var e,n,r,i,o,s,a,u;if(r=f.get(e=c[t[0]]))for(a=0,u=r.length;a<u;++a)if(function(t,e){var n=t[0],r=e[0],i=t[1];if(n-i!=r-e[1])return!1;for(;n<=i;++n,++r)if(!gs(c[n],c[r]))return!1;return!0}(i=r[a],t))return t[0]=i[0],void(t[1]=i[1]);if(o=f.get(n=c[t[1]]))for(a=0,u=o.length;a<u;++a)if(function(t,e){var n=t[0],r=e[0],i=t[1],o=e[1];if(n-i!=r-o)return!1;for(;n<=i;++n,--o)if(!gs(c[n],c[o]))return!1;return!0}(s=o[a],t))return t[1]=s[0],void(t[0]=s[1]);r?r.push(t):f.set(e,[t]),o?o.push(t):f.set(n,[t]),g.push(t)}function n(t,e){var n=t[0],r=e[0],o=t[1]-n;if(o!==e[1]-r)return!1;for(var s=i(t),a=i(e),u=0;u<o;++u)if(!gs(c[n+(u+s)%o],c[r+(u+a)%o]))return!1;return!0}function r(t,e){var n=t[0],r=e[0],o=t[1],s=e[1],a=o-n;if(a!==s-r)return!1;for(var u=i(t),h=a-i(e),l=0;l<a;++l)if(!gs(c[n+(l+u)%a],c[s-(l+h)%a]))return!1;return!0}function i(t){for(var e=t[0],n=t[1],r=e,i=r,o=c[r];++r<n;){var s=c[r];(s[0]<o[0]||s[0]===o[0]&&s[1]<o[1])&&(i=r,o=s)}return i-e}var o,s,a,u,c=t.coordinates,h=t.lines,l=t.rings,p=h.length+l.length;for(delete t.lines,delete t.rings,a=0,u=h.length;a<u;++a)for(o=h[a];o=o.next;)++p;for(a=0,u=l.length;a<u;++a)for(s=l[a];s=s.next;)++p;var f=fs(2*p*1.4,ms,gs),g=t.arcs=[];for(a=0,u=h.length;a<u;++a){o=h[a];do{e(o)}while(o=o.next)}for(a=0,u=l.length;a<u;++a)if((s=l[a]).next)do{e(s)}while(s=s.next);else!function(t){var e,o,s,a,u;if(o=f.get(e=c[t[0]]))for(a=0,u=o.length;a<u;++a){if(n(s=o[a],t))return t[0]=s[0],void(t[1]=s[1]);if(r(s,t))return t[0]=s[1],void(t[1]=s[0])}if(o=f.get(e=c[t[0]+i(t)]))for(a=0,u=o.length;a<u;++a){if(n(s=o[a],t))return t[0]=s[0],void(t[1]=s[1]);if(r(s,t))return t[0]=s[1],void(t[1]=s[0])}o?o.push(t):f.set(e,[t]),g.push(t)}(s);return t},ws=function(t,e){function n(t){t&&h.hasOwnProperty(t.type)&&h[t.type](t)}function r(t){var e=[];do{var n=c.get(t);e.push(t[0]<t[1]?n:~n)}while(t=t.next);return e}function i(t){return t.map(r)}var o=function(t){function e(t){null!=t&&c.hasOwnProperty(t.type)&&c[t.type](t)}function n(t){var e=t[0],n=t[1];e<o&&(o=e),e>a&&(a=e),n<s&&(s=n),n>u&&(u=n)}function r(t){t.forEach(n)}function i(t){t.forEach(r)}var o=1/0,s=1/0,a=-1/0,u=-1/0,c={GeometryCollection:function(t){t.geometries.forEach(e)},Point:function(t){n(t.coordinates)},MultiPoint:function(t){t.coordinates.forEach(n)},LineString:function(t){r(t.arcs)},MultiLineString:function(t){t.arcs.forEach(r)},Polygon:function(t){t.arcs.forEach(r)},MultiPolygon:function(t){t.arcs.forEach(i)}};for(var h in t)e(t[h]);return a>=o&&u>=s?[o,s,a,u]:void 0}(t=function(t){var e,n={};for(e in t)n[e]=Vt(t[e]);return n}(t)),s=e>0&&o&&function(t,e,n){function r(t){return[Math.round((t[0]-c)*f),Math.round((t[1]-h)*g)]}function i(t,e){for(var n,r,i,o,s,a=-1,u=0,l=t.length,p=new Array(l);++a<l;)n=t[a],o=Math.round((n[0]-c)*f),s=Math.round((n[1]-h)*g),o===r&&s===i||(p[u++]=[r=o,i=s]);for(p.length=u;u<e;)u=p.push([p[0][0],p[0][1]]);return p}function o(t){return i(t,2)}function s(t){return i(t,4)}function a(t){return t.map(s)}function u(t){null!=t&&d.hasOwnProperty(t.type)&&d[t.type](t)}var c=e[0],h=e[1],l=e[2],p=e[3],f=l-c?(n-1)/(l-c):1,g=p-h?(n-1)/(p-h):1,d={GeometryCollection:function(t){t.geometries.forEach(u)},Point:function(t){t.coordinates=r(t.coordinates)},MultiPoint:function(t){t.coordinates=t.coordinates.map(r)},LineString:function(t){t.arcs=o(t.arcs)},MultiLineString:function(t){t.arcs=t.arcs.map(o)},Polygon:function(t){t.arcs=a(t.arcs)},MultiPolygon:function(t){t.arcs=t.arcs.map(a)}};for(var y in t)u(t[y]);return{scale:[1/f,1/g],translate:[c,h]}}(t,o,e),a=Es(xs(function(t){function e(t){t&&c.hasOwnProperty(t.type)&&c[t.type](t)}function n(t){for(var e=0,n=t.length;e<n;++e)u[++o]=t[e];var r={0:o-n+1,1:o};return s.push(r),r}function r(t){for(var e=0,n=t.length;e<n;++e)u[++o]=t[e];var r={0:o-n+1,1:o};return a.push(r),r}function i(t){return t.map(r)}var o=-1,s=[],a=[],u=[],c={GeometryCollection:function(t){t.geometries.forEach(e)},LineString:function(t){t.arcs=n(t.arcs)},MultiLineString:function(t){t.arcs=t.arcs.map(n)},Polygon:function(t){t.arcs=t.arcs.map(r)},MultiPolygon:function(t){t.arcs=t.arcs.map(i)}};for(var h in t)e(t[h]);return{type:"Topology",coordinates:u,lines:s,rings:a,objects:t}}(t))),u=a.coordinates,c=fs(1.4*a.arcs.length,Jt,Zt);t=a.objects,a.bbox=o,a.arcs=a.arcs.map((function(t,e){return c.set(t,e),u.slice(t[0],t[1]+1)})),delete a.coordinates,u=null;var h={GeometryCollection:function(t){t.geometries.forEach(n)},LineString:function(t){t.arcs=r(t.arcs)},MultiLineString:function(t){t.arcs=t.arcs.map(r)},Polygon:function(t){t.arcs=t.arcs.map(r)},MultiPolygon:function(t){t.arcs=t.arcs.map(i)}};for(var l in t)n(t[l]);return s&&(a.transform=s,a.arcs=function(t){for(var e=-1,n=t.length;++e<n;){for(var r,i,o=t[e],s=0,a=1,u=o.length,c=o[0],h=c[0],l=c[1];++s<u;)r=(c=o[s])[0],i=c[1],r===h&&i===l||(o[a++]=[r-h,i-l],h=r,l=i);1===a&&(o[a++]=[0,0]),o.length=a}return t}(a.arcs)),a},bs=function(t){this.points=t.points||[],this.duration=t.duration||1e4,this.sharpness=t.sharpness||.85,this.centers=[],this.controls=[],this.stepLength=t.stepLength||60,this.length=this.points.length,this.delay=0;for(var e=0;e<this.length;e++)this.points[e].z=this.points[e].z||0;for(e=0;e<this.length-1;e++){var n=this.points[e],r=this.points[e+1];this.centers.push({x:(n.x+r.x)/2,y:(n.y+r.y)/2,z:(n.z+r.z)/2})}for(this.controls.push([this.points[0],this.points[0]]),e=0;e<this.centers.length-1;e++){n=this.centers[e],r=this.centers[e+1];var i=this.points[e+1].x-(this.centers[e].x+this.centers[e+1].x)/2,o=this.points[e+1].y-(this.centers[e].y+this.centers[e+1].y)/2,s=this.points[e+1].z-(this.centers[e].y+this.centers[e+1].z)/2;this.controls.push([{x:(1-this.sharpness)*this.points[e+1].x+this.sharpness*(this.centers[e].x+i),y:(1-this.sharpness)*this.points[e+1].y+this.sharpness*(this.centers[e].y+o),z:(1-this.sharpness)*this.points[e+1].z+this.sharpness*(this.centers[e].z+s)},{x:(1-this.sharpness)*this.points[e+1].x+this.sharpness*(this.centers[e+1].x+i),y:(1-this.sharpness)*this.points[e+1].y+this.sharpness*(this.centers[e+1].y+o),z:(1-this.sharpness)*this.points[e+1].z+this.sharpness*(this.centers[e+1].z+s)}])}return this.controls.push([this.points[this.length-1],this.points[this.length-1]]),this.steps=this.cacheSteps(this.stepLength),this};bs.prototype.cacheSteps=function(t){var e=[],n=this.pos(0);e.push(0);for(var r=0;r<this.duration;r+=10){var i=this.pos(r);Math.sqrt((i.x-n.x)*(i.x-n.x)+(i.y-n.y)*(i.y-n.y)+(i.z-n.z)*(i.z-n.z))>t&&(e.push(r),n=i)}return e},bs.prototype.vector=function(t){var e=this.pos(t+10),n=this.pos(t-10);return{angle:180*Math.atan2(e.y-n.y,e.x-n.x)/3.14,speed:Math.sqrt((n.x-e.x)*(n.x-e.x)+(n.y-e.y)*(n.y-e.y)+(n.z-e.z)*(n.z-e.z))}},bs.prototype.pos=function(t){var e=t-this.delay;e<0&&(e=0),e>this.duration&&(e=this.duration-1);var n=e/this.duration;if(n>=1)return this.points[this.length-1];var r=Math.floor((this.points.length-1)*n);return function(t,e,n,r,i){var o=function(t){var e=t*t;return[e*t,3*e*(1-t),3*t*(1-t)*(1-t),(1-t)*(1-t)*(1-t)]}(t);return{x:i.x*o[0]+r.x*o[1]+n.x*o[2]+e.x*o[3],y:i.y*o[0]+r.y*o[1]+n.y*o[2]+e.y*o[3],z:i.z*o[0]+r.z*o[1]+n.z*o[2]+e.z*o[3]}}((this.length-1)*n-r,this.points[r],this.controls[r][1],this.controls[r+1][0],this.points[r+1])};var Is=ve,Ns=ve;ve.deviation=function(t,e,n,r){var i=e&&e.length,o=i?e[0]*n:t.length,s=Math.abs(Ae(t,0,o,n));if(i)for(var a=0,u=e.length;a<u;a++){var c=e[a]*n,h=a<u-1?e[a+1]*n:t.length;s-=Math.abs(Ae(t,c,h,n))}var l=0;for(a=0;a<r.length;a+=3){var p=r[a]*n,f=r[a+1]*n,g=r[a+2]*n;l+=Math.abs((t[p]-t[g])*(t[f+1]-t[p+1])-(t[p]-t[f])*(t[g+1]-t[p+1]))}return 0===s&&0===l?0:Math.abs((l-s)/s)},ve.flatten=function(t){for(var e=t[0][0].length,n={vertices:[],holes:[],dimensions:e},r=0,i=0;i<t.length;i++){for(var o=0;o<t[i].length;o++)for(var s=0;s<e;s++)n.vertices.push(t[i][o][s]);i>0&&(r+=t[i-1].length,n.holes.push(r))}return n},Is.default=Ns,ke.prototype={all:function(){return this._all(this.data,[])},search:function(t){var e=this.data,n=[],r=this.toBBox;if(!Je(t,e))return n;for(var i,o,s,a,u=[];e;){for(i=0,o=e.children.length;i<o;i++)s=e.children[i],Je(t,a=e.leaf?r(s):s)&&(e.leaf?n.push(s):We(t,a)?this._all(s,n):u.push(s));e=u.pop()}return n},collides:function(t){var e=this.data,n=this.toBBox;if(!Je(t,e))return!1;for(var r,i,o,s,a=[];e;){for(r=0,i=e.children.length;r<i;r++)if(o=e.children[r],Je(t,s=e.leaf?n(o):o)){if(e.leaf||We(t,s))return!0;a.push(o)}e=a.pop()}return!1},load:function(t){if(!t||!t.length)return this;if(t.length<this._minEntries){for(var e=0,n=t.length;e<n;e++)this.insert(t[e]);return this}var r=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===r.height)this._splitRoot(this.data,r);else{if(this.data.height<r.height){var i=this.data;this.data=r,r=i}this._insert(r,this.data.height-r.height-1,!0)}else this.data=r;return this},insert:function(t){return t&&this._insert(t,this.data.height-1),this},clear:function(){return this.data=Ze([]),this},remove:function(t,e){if(!t)return this;for(var n,r,i,o,s=this.data,a=this.toBBox(t),u=[],c=[];s||u.length;){if(s||(s=u.pop(),r=u[u.length-1],n=c.pop(),o=!0),s.leaf&&-1!==(i=function(t,e,n){if(!n)return e.indexOf(t);for(var r=0;r<e.length;r++)if(n(t,e[r]))return r;return-1}(t,s.children,e)))return s.children.splice(i,1),u.push(s),this._condense(u),this;o||s.leaf||!We(s,a)?r?(n++,s=r.children[n],o=!1):s=null:(u.push(s),c.push(n),n=0,r=s,s=s.children[0])}return this},toBBox:function(t){return t},compareMinX:Ue,compareMinY:Ye,toJSON:function(){return this.data},fromJSON:function(t){return this.data=t,this},_all:function(t,e){for(var n=[];t;)t.leaf?e.push.apply(e,t.children):n.push.apply(n,t.children),t=n.pop();return e},_build:function(t,e,n,r){var i,o=n-e+1,s=this._maxEntries;if(o<=s)return ze(i=Ze(t.slice(e,n+1)),this.toBBox),i;r||(r=Math.ceil(Math.log(o)/Math.log(s)),s=Math.ceil(o/Math.pow(s,r-1))),(i=Ze([])).leaf=!1,i.height=r;var a,u,c,h,l=Math.ceil(o/s),p=l*Math.ceil(Math.sqrt(s));for(Ke(t,e,n,p,this.compareMinX),a=e;a<=n;a+=p)for(Ke(t,a,c=Math.min(a+p-1,n),l,this.compareMinY),u=a;u<=c;u+=l)h=Math.min(u+l-1,c),i.children.push(this._build(t,u,h,r-1));return ze(i,this.toBBox),i},_chooseSubtree:function(t,e,n,r){for(var i,o,s,a,u,c,h,l;r.push(e),!e.leaf&&r.length-1!==n;){for(h=l=1/0,i=0,o=e.children.length;i<o;i++)u=Ve(s=e.children[i]),(c=function(t,e){return(Math.max(e.maxX,t.maxX)-Math.min(e.minX,t.minX))*(Math.max(e.maxY,t.maxY)-Math.min(e.minY,t.minY))}(t,s)-u)<l?(l=c,h=u<h?u:h,a=s):c===l&&u<h&&(h=u,a=s);e=a||e.children[0]}return e},_insert:function(t,e,n){var r=this.toBBox,i=n?t:r(t),o=[],s=this._chooseSubtree(i,this.data,e,o);for(s.children.push(t),Xe(s,i);e>=0&&o[e].children.length>this._maxEntries;)this._split(o,e),e--;this._adjustParentBBoxes(i,o,e)},_split:function(t,e){var n=t[e],r=n.children.length,i=this._minEntries;this._chooseSplitAxis(n,i,r);var o=this._chooseSplitIndex(n,i,r),s=Ze(n.children.splice(o,n.children.length-o));s.height=n.height,s.leaf=n.leaf,ze(n,this.toBBox),ze(s,this.toBBox),e?t[e-1].children.push(s):this._splitRoot(n,s)},_splitRoot:function(t,e){this.data=Ze([t,e]),this.data.height=t.height+1,this.data.leaf=!1,ze(this.data,this.toBBox)},_chooseSplitIndex:function(t,e,n){var r,i,o,s,a,u,c,h;for(u=c=1/0,r=e;r<=n-e;r++)s=function(t,e){var n=Math.max(t.minX,e.minX),r=Math.max(t.minY,e.minY),i=Math.min(t.maxX,e.maxX),o=Math.min(t.maxY,e.maxY);return Math.max(0,i-n)*Math.max(0,o-r)}(i=je(t,0,r,this.toBBox),o=je(t,r,n,this.toBBox)),a=Ve(i)+Ve(o),s<u?(u=s,h=r,c=a<c?a:c):s===u&&a<c&&(c=a,h=r);return h},_chooseSplitAxis:function(t,e,n){var r=t.leaf?this.compareMinX:Ue,i=t.leaf?this.compareMinY:Ye;this._allDistMargin(t,e,n,r)<this._allDistMargin(t,e,n,i)&&t.children.sort(r)},_allDistMargin:function(t,e,n,r){t.children.sort(r);var i,o,s=this.toBBox,a=je(t,0,e,s),u=je(t,n-e,n,s),c=He(a)+He(u);for(i=e;i<n-e;i++)o=t.children[i],Xe(a,t.leaf?s(o):o),c+=He(a);for(i=n-e-1;i>=e;i--)o=t.children[i],Xe(u,t.leaf?s(o):o),c+=He(u);return c},_adjustParentBBoxes:function(t,e,n){for(var r=n;r>=0;r--)Xe(e[r],t)},_condense:function(t){for(var e,n=t.length-1;n>=0;n--)0===t[n].children.length?n>0?(e=t[n-1].children).splice(e.indexOf(t[n]),1):this.clear():ze(t[n],this.toBBox)},_initFormat:function(t){var e=["return a"," - b",";"];this.compareMinX=new Function("a","b",e.join(t[0])),this.compareMinY=new Function("a","b",e.join(t[1])),this.toBBox=new Function("a","return {minX: a"+t[0]+", minY: a"+t[1]+", maxX: a"+t[2]+", maxY: a"+t[3]+"};")}};var Cs=Object.freeze({toMercator:cn,toWgs84:hn}),Ss=6378137,Ms=function(t,e,n){function r(t,n,r,i){var u,c,h=o[t][n],l=o[t][n+1],p=o[r][i],f=o[r][i+1],g=function(t,e,n,r){if(On(t,n)||On(t,r)||On(e,n)||On(r,n))return null;var i=t[0],o=t[1],s=e[0],a=e[1],u=n[0],c=n[1],h=r[0],l=r[1],p=(i-s)*(c-l)-(o-a)*(u-h);return 0===p?null:[((i*a-o*s)*(u-h)-(i-s)*(u*l-c*h))/p,((i*a-o*s)*(c-l)-(o-a)*(u*l-c*h))/p]}(h,l,p,f);if(null!==g&&(u=l[0]!==h[0]?(g[0]-h[0])/(l[0]-h[0]):(g[1]-h[1])/(l[1]-h[1]),c=f[0]!==p[0]?(g[0]-p[0])/(f[0]-p[0]):(g[1]-p[1])/(f[1]-p[1]),!(u>=1||u<=0||c>=1||c<=0))){var d=g,y=!a[d];y&&(a[d]=!0),e?s.push(e(g,t,n,h,l,u,r,i,p,f,c,y)):s.push(g)}}function i(t,e){var n,r,i,s,a=o[t][e],u=o[t][e+1];return a[0]<u[0]?(n=a[0],r=u[0]):(n=u[0],r=a[0]),a[1]<u[1]?(i=a[1],s=u[1]):(i=u[1],s=a[1]),{minX:n,minY:i,maxX:r,maxY:s,ring:t,edge:e}}if("Polygon"!==t.geometry.type)throw new Error("The input feature must be a Polygon");void 0===n&&(n=1);var o=t.geometry.coordinates,s=[],a={};if(n){for(var u=[],c=0;c<o.length;c++)for(var h=0;h<o[c].length-1;h++)u.push(i(c,h));var l=Vo();l.load(u)}for(var p=0;p<o.length;p++)for(var f=0;f<o[p].length-1;f++)if(n)l.search(i(p,f)).forEach((function(t){var e=t.ring,n=t.edge;r(p,f,e,n)}));else for(var g=0;g<o.length;g++)for(var d=0;d<o[g].length-1;d++)r(p,f,g,d);return e||(s={type:"Feature",geometry:{type:"MultiPoint",coordinates:s}}),s},Ls=function(t){function e(){for(var t=[],e=0;e<g.features.length;e++)-1==g.features[e].properties.parent&&t.push(e);if(t.length>1)for(e=0;e<t.length;e++){for(var n=-1,r=0;r<g.features.length;r++)t[e]!=r&&Pt(g.features[t[e]].geometry.coordinates[0][0],g.features[r],{ignoreBoundary:!0})&&mn(g.features[r])<1/0&&(n=r);g.features[t[e]].properties.parent=n}}function n(){for(var t=0;t<g.features.length;t++)if(-1==g.features[t].properties.parent){var e=g.features[t].properties.winding;g.features[t].properties.netWinding=e,r(t,e)}}function r(t,e){for(var n=0;n<g.features.length;n++)if(g.features[n].properties.parent==t){var i=e+g.features[n].properties.winding;g.features[n].properties.netWinding=i,r(n,i)}}if("Feature"!=t.type)throw new Error("The input must a geojson object of type Feature");if(void 0===t.geometry||null==t.geometry)throw new Error("The input must a geojson object with a non-empty geometry");if("Polygon"!=t.geometry.type)throw new Error("The input must be a geojson Polygon");for(var i=t.geometry.coordinates.length,s=[],a=0;a<i;a++){var u=t.geometry.coordinates[a];Tn(u[0],u[u.length-1])||u.push(u[0]),s.push.apply(s,u.slice(0,u.length-1))}if(!function(t){for(var e={},n=1,r=0,i=t.length;r<i;++r){if(e.hasOwnProperty(t[r])){n=0;break}e[t[r]]=1}return n}(s))throw new Error("The input polygon may not have duplicate vertices (except for the first and last vertex of each ring)");var h=s.length,l=Ms(t,(function(t,e,n,r,i,o,s,a,u,c,h,l){return[t,e,n,r,i,o,s,a,u,c,h,l]})),p=l.length;if(0==p){var f=[];for(a=0;a<i;a++)f.push(o([t.geometry.coordinates[a]],{parent:-1,winding:function(t){for(var e=0,n=0;n<t.length-1;n++)t[n][0]<t[e][0]&&(e=n);if(Rn([t[(e-1).modulo(t.length-1)],t[e],t[(e+1).modulo(t.length-1)]],!0))var r=1;else r=-1;return r}(t.geometry.coordinates[a])}));var g=c(f);return e(),n(),g}var d=[],y=[];for(a=0;a<i;a++){d.push([]);for(var _=0;_<t.geometry.coordinates[a].length-1;_++)d[a].push([new Ps(t.geometry.coordinates[a][(_+1).modulo(t.geometry.coordinates[a].length-1)],1,[a,_],[a,(_+1).modulo(t.geometry.coordinates[a].length-1)],void 0)]),y.push(new Os(t.geometry.coordinates[a][_],[a,(_-1).modulo(t.geometry.coordinates[a].length-1)],[a,_],void 0,void 0,!1,!0))}for(a=0;a<p;a++)d[l[a][1]][l[a][2]].push(new Ps(l[a][0],l[a][5],[l[a][1],l[a][2]],[l[a][6],l[a][7]],void 0)),l[a][11]&&y.push(new Os(l[a][0],[l[a][1],l[a][2]],[l[a][6],l[a][7]],void 0,void 0,!0,!0));var m=y.length;for(a=0;a<d.length;a++)for(_=0;_<d[a].length;_++)d[a][_].sort((function(t,e){return t.param<e.param?-1:1}));var v=[];for(a=0;a<m;a++)v.push({minX:y[a].coord[0],minY:y[a].coord[1],maxX:y[a].coord[0],maxY:y[a].coord[1],index:a});var x=Vo();for(x.load(v),a=0;a<d.length;a++)for(_=0;_<d[a].length;_++)for(var E=0;E<d[a][_].length;E++){b=E==d[a][_].length-1?d[a][(_+1).modulo(t.geometry.coordinates[a].length-1)][0].coord:d[a][_][E+1].coord;var w=x.search({minX:b[0],minY:b[1],maxX:b[0],maxY:b[1]})[0];d[a][_][E].nxtIsectAlongEdgeIn=w.index}for(a=0;a<d.length;a++)for(_=0;_<d[a].length;_++)for(E=0;E<d[a][_].length;E++){var b=d[a][_][E].coord,I=(w=x.search({minX:b[0],minY:b[1],maxX:b[0],maxY:b[1]})[0]).index;I<h?y[I].nxtIsectAlongRingAndEdge2=d[a][_][E].nxtIsectAlongEdgeIn:Tn(y[I].ringAndEdge1,d[a][_][E].ringAndEdgeIn)?y[I].nxtIsectAlongRingAndEdge1=d[a][_][E].nxtIsectAlongEdgeIn:y[I].nxtIsectAlongRingAndEdge2=d[a][_][E].nxtIsectAlongEdgeIn}var N=[];for(a=0,_=0;_<i;_++){var C=a;for(E=0;E<t.geometry.coordinates[_].length-1;E++)y[a].coord[0]<y[C].coord[0]&&(C=a),a++;var S=y[C].nxtIsectAlongRingAndEdge2;for(E=0;E<y.length;E++)if(y[E].nxtIsectAlongRingAndEdge1==C||y[E].nxtIsectAlongRingAndEdge2==C){var M=E;break}var L=Rn([y[M].coord,y[C].coord,y[S].coord],!0)?1:-1;N.push({isect:C,parent:-1,winding:L})}for(N.sort((function(t,e){return y[t.isect].coord>y[e.isect].coord?-1:1})),f=[];N.length>0;){var P=N.pop(),O=P.isect,R=P.parent,T=P.winding,A=f.length,D=[y[O].coord],F=O;if(y[O].ringAndEdge1Walkable)var q=y[O].ringAndEdge1,G=y[O].nxtIsectAlongRingAndEdge1;else q=y[O].ringAndEdge2,G=y[O].nxtIsectAlongRingAndEdge2;for(;!Tn(y[O].coord,y[G].coord);){D.push(y[G].coord);var B=void 0;for(a=0;a<N.length;a++)if(N[a].isect==G){B=a;break}if(void 0!=B&&N.splice(B,1),Tn(q,y[G].ringAndEdge1)){if(q=y[G].ringAndEdge2,y[G].ringAndEdge2Walkable=!1,y[G].ringAndEdge1Walkable){var k={isect:G};Rn([y[F].coord,y[G].coord,y[y[G].nxtIsectAlongRingAndEdge2].coord],1==T)?(k.parent=R,k.winding=-T):(k.parent=A,k.winding=T),N.push(k)}F=G,G=y[G].nxtIsectAlongRingAndEdge2}else q=y[G].ringAndEdge1,y[G].ringAndEdge1Walkable=!1,y[G].ringAndEdge2Walkable&&(k={isect:G},Rn([y[F].coord,y[G].coord,y[y[G].nxtIsectAlongRingAndEdge1].coord],1==T)?(k.parent=R,k.winding=-T):(k.parent=A,k.winding=T),N.push(k)),F=G,G=y[G].nxtIsectAlongRingAndEdge1}D.push(y[G].coord),f.push(o([D],{index:A,parent:R,winding:T,netWinding:void 0}))}return g=c(f),e(),n(),g},Ps=function(t,e,n,r,i){this.coord=t,this.param=e,this.ringAndEdgeIn=n,this.ringAndEdgeOut=r,this.nxtIsectAlongEdgeIn=i},Os=function(t,e,n,r,i,o,s){this.coord=t,this.ringAndEdge1=e,this.ringAndEdge2=n,this.nxtIsectAlongRingAndEdge1=r,this.nxtIsectAlongRingAndEdge2=i,this.ringAndEdge1Walkable=o,this.ringAndEdge2Walkable=s};Number.prototype.modulo=function(t){return(this%t+t)%t};var Rs=Math.PI/180,Ts=180/Math.PI,As=function(t,e){this.lon=t,this.lat=e,this.x=Rs*t,this.y=Rs*e};As.prototype.view=function(){return String(this.lon).slice(0,4)+","+String(this.lat).slice(0,4)},As.prototype.antipode=function(){var t=-1*this.lat,e=this.lon<0?180+this.lon:-1*(180-this.lon);return new As(e,t)};var Ds=function(){this.coords=[],this.length=0};Ds.prototype.move_to=function(t){this.length++,this.coords.push(t)};var Fs=function(t){this.properties=t||{},this.geometries=[]};Fs.prototype.json=function(){if(this.geometries.length<=0)return{geometry:{type:"LineString",coordinates:null},type:"Feature",properties:this.properties};if(1===this.geometries.length)return{geometry:{type:"LineString",coordinates:this.geometries[0].coords},type:"Feature",properties:this.properties};for(var t=[],e=0;e<this.geometries.length;e++)t.push(this.geometries[e].coords);return{geometry:{type:"MultiLineString",coordinates:t},type:"Feature",properties:this.properties}},Fs.prototype.wkt=function(){for(var t="",e="LINESTRING(",n=function(t){e+=t[0]+" "+t[1]+","},r=0;r<this.geometries.length;r++){if(0===this.geometries[r].coords.length)return"LINESTRING(empty)";this.geometries[r].coords.forEach(n),t+=e.substring(0,e.length-1)+")"}return t};var qs=function(t,e,n){if(!t||void 0===t.x||void 0===t.y)throw new Error("GreatCircle constructor expects two args: start and end objects with x and y properties");if(!e||void 0===e.x||void 0===e.y)throw new Error("GreatCircle constructor expects two args: start and end objects with x and y properties");this.start=new As(t.x,t.y),this.end=new As(e.x,e.y),this.properties=n||{};var r=this.start.x-this.end.x,i=this.start.y-this.end.y,o=Math.pow(Math.sin(i/2),2)+Math.cos(this.start.y)*Math.cos(this.end.y)*Math.pow(Math.sin(r/2),2);if(this.g=2*Math.asin(Math.sqrt(o)),this.g===Math.PI)throw new Error("it appears "+t.view()+" and "+e.view()+" are 'antipodal', e.g diametrically opposite, thus there is no single route but rather infinite");if(isNaN(this.g))throw new Error("could not calculate great circle between "+t+" and "+e)};qs.prototype.interpolate=function(t){var e=Math.sin((1-t)*this.g)/Math.sin(this.g),n=Math.sin(t*this.g)/Math.sin(this.g),r=e*Math.cos(this.start.y)*Math.cos(this.start.x)+n*Math.cos(this.end.y)*Math.cos(this.end.x),i=e*Math.cos(this.start.y)*Math.sin(this.start.x)+n*Math.cos(this.end.y)*Math.sin(this.end.x),o=e*Math.sin(this.start.y)+n*Math.sin(this.end.y),s=Ts*Math.atan2(o,Math.sqrt(Math.pow(r,2)+Math.pow(i,2)));return[Ts*Math.atan2(i,r),s]},qs.prototype.Arc=function(t,e){var n=[];if(!t||t<=2)n.push([this.start.lon,this.start.lat]),n.push([this.end.lon,this.end.lat]);else for(var r=1/(t-1),i=0;i<t;++i){var o=r*i,s=this.interpolate(o);n.push(s)}for(var a=!1,u=0,c=e&&e.offset?e.offset:10,h=180-c,l=-180+c,p=360-c,f=1;f<n.length;++f){var g=n[f-1][0],d=n[f][0],y=Math.abs(d-g);y>p&&(d>h&&g<l||g>h&&d<l)?a=!0:y>u&&(u=y)}var _=[];if(a&&u<c){var m=[];_.push(m);for(var v=0;v<n.length;++v){var x=parseFloat(n[v][0]);if(v>0&&Math.abs(x-n[v-1][0])>p){var E=parseFloat(n[v-1][0]),w=parseFloat(n[v-1][1]),b=parseFloat(n[v][0]),I=parseFloat(n[v][1]);if(E>-180&&E<l&&180===b&&v+1<n.length&&n[v-1][0]>-180&&n[v-1][0]<l){m.push([-180,n[v][1]]),v++,m.push([n[v][0],n[v][1]]);continue}if(E>h&&E<180&&-180===b&&v+1<n.length&&n[v-1][0]>h&&n[v-1][0]<180){m.push([180,n[v][1]]),v++,m.push([n[v][0],n[v][1]]);continue}if(E<l&&b>h){var N=E;E=b,b=N;var C=w;w=I,I=C}if(E>h&&b<l&&(b+=360),E<=180&&b>=180&&E<b){var S=(180-E)/(b-E),M=S*I+(1-S)*w;m.push([n[v-1][0]>h?180:-180,M]),(m=[]).push([n[v-1][0]>h?-180:180,M]),_.push(m)}else m=[],_.push(m);m.push([x,n[v][1]])}else m.push([n[v][0],n[v][1]])}}else{var L=[];_.push(L);for(var P=0;P<n.length;++P)L.push([n[P][0],n[P][1]])}for(var O=new Fs(this.properties),R=0;R<_.length;++R){var T=new Ds;O.geometries.push(T);for(var A=_[R],D=0;D<A.length;++D)T.move_to(A[D])}return O};var Gs=Yn;Yn.polyline=Yn,Yn.polygon=function(t,e){var n,r,i,o,s,a,u;for(r=1;r<=8;r*=2){for(n=[],o=!(Hn(i=t[t.length-1],e)&r),s=0;s<t.length;s++)(u=!(Hn(a=t[s],e)&r))!==o&&n.push(Vn(i,a,r,e)),u&&n.push(a),i=a,o=u;if(!(t=n).length)break}return n};var Bs=Array.prototype.slice,ks={successCallback:null,verbose:!1,polygons:!1},zs={},js=64,Xs=16,Us=4,Ys=1,Vs=[],Hs=[],Ws=[],Js=[],Zs=[],Ks=[],Qs=[],$s=[],ta=[],ea=[],na=[],ra=[],ia=[],oa=[],sa=[],aa=[],ua=[],ca=[],ha=[],la=[],pa=[],fa=[],ga=[],da=[];Qs[85]=ea[85]=-1,$s[85]=na[85]=0,ta[85]=ra[85]=1,ha[85]=fa[85]=1,la[85]=ga[85]=0,pa[85]=da[85]=1,Vs[85]=Js[85]=0,Hs[85]=Zs[85]=-1,Ws[85]=sa[85]=0,aa[85]=ia[85]=0,ua[85]=oa[85]=1,Ks[85]=ca[85]=1,fa[1]=fa[169]=0,ga[1]=ga[169]=-1,da[1]=da[169]=0,ia[1]=ia[169]=-1,oa[1]=oa[169]=0,sa[1]=sa[169]=0,ea[4]=ea[166]=0,na[4]=na[166]=-1,ra[4]=ra[166]=1,aa[4]=aa[166]=1,ua[4]=ua[166]=0,ca[4]=ca[166]=0,Qs[16]=Qs[154]=0,$s[16]=$s[154]=1,ta[16]=ta[154]=1,Js[16]=Js[154]=1,Zs[16]=Zs[154]=0,Ks[16]=Ks[154]=1,ha[64]=ha[106]=0,la[64]=la[106]=1,pa[64]=pa[106]=0,Vs[64]=Vs[106]=-1,Hs[64]=Hs[106]=0,Ws[64]=Ws[106]=1,ha[2]=ha[168]=0,la[2]=la[168]=-1,pa[2]=pa[168]=1,fa[2]=fa[168]=0,ga[2]=ga[168]=-1,da[2]=da[168]=0,ia[2]=ia[168]=-1,oa[2]=oa[168]=0,sa[2]=sa[168]=0,aa[2]=aa[168]=-1,ua[2]=ua[168]=0,ca[2]=ca[168]=1,Qs[8]=Qs[162]=0,$s[8]=$s[162]=-1,ta[8]=ta[162]=0,ea[8]=ea[162]=0,na[8]=na[162]=-1,ra[8]=ra[162]=1,ia[8]=ia[162]=1,oa[8]=oa[162]=0,sa[8]=sa[162]=1,aa[8]=aa[162]=1,ua[8]=ua[162]=0,ca[8]=ca[162]=0,Qs[32]=Qs[138]=0,$s[32]=$s[138]=1,ta[32]=ta[138]=1,ea[32]=ea[138]=0,na[32]=na[138]=1,ra[32]=ra[138]=0,Vs[32]=Vs[138]=1,Hs[32]=Hs[138]=0,Ws[32]=Ws[138]=0,Js[32]=Js[138]=1,Zs[32]=Zs[138]=0,Ks[32]=Ks[138]=1,fa[128]=fa[42]=0,ga[128]=ga[42]=1,da[128]=da[42]=1,ha[128]=ha[42]=0,la[128]=la[42]=1,pa[128]=pa[42]=0,Vs[128]=Vs[42]=-1,Hs[128]=Hs[42]=0,Ws[128]=Ws[42]=1,Js[128]=Js[42]=-1,Zs[128]=Zs[42]=0,Ks[128]=Ks[42]=0,ea[5]=ea[165]=-1,na[5]=na[165]=0,ra[5]=ra[165]=0,fa[5]=fa[165]=1,ga[5]=ga[165]=0,da[5]=da[165]=0,aa[20]=aa[150]=0,ua[20]=ua[150]=1,ca[20]=ca[150]=1,Js[20]=Js[150]=0,Zs[20]=Zs[150]=-1,Ks[20]=Ks[150]=1,Qs[80]=Qs[90]=-1,$s[80]=$s[90]=0,ta[80]=ta[90]=1,ha[80]=ha[90]=1,la[80]=la[90]=0,pa[80]=pa[90]=1,ia[65]=ia[105]=0,oa[65]=oa[105]=1,sa[65]=sa[105]=0,Vs[65]=Vs[105]=0,Hs[65]=Hs[105]=-1,Ws[65]=Ws[105]=0,Qs[160]=Qs[10]=-1,$s[160]=$s[10]=0,ta[160]=ta[10]=1,ea[160]=ea[10]=-1,na[160]=na[10]=0,ra[160]=ra[10]=0,fa[160]=fa[10]=1,ga[160]=ga[10]=0,da[160]=da[10]=0,ha[160]=ha[10]=1,la[160]=la[10]=0,pa[160]=pa[10]=1,aa[130]=aa[40]=0,ua[130]=ua[40]=1,ca[130]=ca[40]=1,ia[130]=ia[40]=0,oa[130]=oa[40]=1,sa[130]=sa[40]=0,Vs[130]=Vs[40]=0,Hs[130]=Hs[40]=-1,Ws[130]=Ws[40]=0,Js[130]=Js[40]=0,Zs[130]=Zs[40]=-1,Ks[130]=Ks[40]=1,ea[37]=ea[133]=0,na[37]=na[133]=1,ra[37]=ra[133]=1,fa[37]=fa[133]=0,ga[37]=ga[133]=1,da[37]=da[133]=0,Vs[37]=Vs[133]=-1,Hs[37]=Hs[133]=0,Ws[37]=Ws[133]=0,Js[37]=Js[133]=1,Zs[37]=Zs[133]=0,Ks[37]=Ks[133]=0,aa[148]=aa[22]=-1,ua[148]=ua[22]=0,ca[148]=ca[22]=0,fa[148]=fa[22]=0,ga[148]=ga[22]=-1,da[148]=da[22]=1,ha[148]=ha[22]=0,la[148]=la[22]=1,pa[148]=pa[22]=1,Js[148]=Js[22]=-1,Zs[148]=Zs[22]=0,Ks[148]=Ks[22]=1,Qs[82]=Qs[88]=0,$s[82]=$s[88]=-1,ta[82]=ta[88]=1,aa[82]=aa[88]=1,ua[82]=ua[88]=0,ca[82]=ca[88]=1,ia[82]=ia[88]=-1,oa[82]=oa[88]=0,sa[82]=sa[88]=1,ha[82]=ha[88]=0,la[82]=la[88]=-1,pa[82]=pa[88]=0,Qs[73]=Qs[97]=0,$s[73]=$s[97]=1,ta[73]=ta[97]=0,ea[73]=ea[97]=0,na[73]=na[97]=-1,ra[73]=ra[97]=0,ia[73]=ia[97]=1,oa[73]=oa[97]=0,sa[73]=sa[97]=0,Vs[73]=Vs[97]=1,Hs[73]=Hs[97]=0,Ws[73]=Ws[97]=1,Qs[145]=Qs[25]=0,$s[145]=$s[25]=-1,ta[145]=ta[25]=0,ia[145]=ia[25]=1,oa[145]=oa[25]=0,sa[145]=sa[25]=1,fa[145]=fa[25]=0,ga[145]=ga[25]=1,da[145]=da[25]=1,Js[145]=Js[25]=-1,Zs[145]=Zs[25]=0,Ks[145]=Ks[25]=0,ea[70]=ea[100]=0,na[70]=na[100]=1,ra[70]=ra[100]=0,aa[70]=aa[100]=-1,ua[70]=ua[100]=0,ca[70]=ca[100]=1,ha[70]=ha[100]=0,la[70]=la[100]=-1,pa[70]=pa[100]=1,Vs[70]=Vs[100]=1,Hs[70]=Hs[100]=0,Ws[70]=Ws[100]=0,ea[101]=ea[69]=0,na[101]=na[69]=1,ra[101]=ra[69]=0,Vs[101]=Vs[69]=1,Hs[101]=Hs[69]=0,Ws[101]=Ws[69]=0,fa[149]=fa[21]=0,ga[149]=ga[21]=1,da[149]=da[21]=1,Js[149]=Js[21]=-1,Zs[149]=Zs[21]=0,Ks[149]=Ks[21]=0,aa[86]=aa[84]=-1,ua[86]=ua[84]=0,ca[86]=ca[84]=1,ha[86]=ha[84]=0,la[86]=la[84]=-1,pa[86]=pa[84]=1,Qs[89]=Qs[81]=0,$s[89]=$s[81]=-1,ta[89]=ta[81]=0,ia[89]=ia[81]=1,oa[89]=oa[81]=0,sa[89]=sa[81]=1,Qs[96]=Qs[74]=0,$s[96]=$s[74]=1,ta[96]=ta[74]=0,ea[96]=ea[74]=-1,na[96]=na[74]=0,ra[96]=ra[74]=1,ha[96]=ha[74]=1,la[96]=la[74]=0,pa[96]=pa[74]=0,Vs[96]=Vs[74]=1,Hs[96]=Hs[74]=0,Ws[96]=Ws[74]=1,Qs[24]=Qs[146]=0,$s[24]=$s[146]=-1,ta[24]=ta[146]=1,aa[24]=aa[146]=1,ua[24]=ua[146]=0,ca[24]=ca[146]=1,ia[24]=ia[146]=0,oa[24]=oa[146]=1,sa[24]=sa[146]=1,Js[24]=Js[146]=0,Zs[24]=Zs[146]=-1,Ks[24]=Ks[146]=0,ea[6]=ea[164]=-1,na[6]=na[164]=0,ra[6]=ra[164]=1,aa[6]=aa[164]=-1,ua[6]=ua[164]=0,ca[6]=ca[164]=0,fa[6]=fa[164]=0,ga[6]=ga[164]=-1,da[6]=da[164]=1,ha[6]=ha[164]=1,la[6]=la[164]=0,pa[6]=pa[164]=0,ia[129]=ia[41]=0,oa[129]=oa[41]=1,sa[129]=sa[41]=1,fa[129]=fa[41]=0,ga[129]=ga[41]=1,da[129]=da[41]=0,Vs[129]=Vs[41]=-1,Hs[129]=Hs[41]=0,Ws[129]=Ws[41]=0,Js[129]=Js[41]=0,Zs[129]=Zs[41]=-1,Ks[129]=Ks[41]=0,aa[66]=aa[104]=0,ua[66]=ua[104]=1,ca[66]=ca[104]=0,ia[66]=ia[104]=-1,oa[66]=oa[104]=0,sa[66]=sa[104]=1,ha[66]=ha[104]=0,la[66]=la[104]=-1,pa[66]=pa[104]=0,Vs[66]=Vs[104]=0,Hs[66]=Hs[104]=-1,Ws[66]=Ws[104]=1,Qs[144]=Qs[26]=-1,$s[144]=$s[26]=0,ta[144]=ta[26]=0,fa[144]=fa[26]=1,ga[144]=ga[26]=0,da[144]=da[26]=1,ha[144]=ha[26]=0,la[144]=la[26]=1,pa[144]=pa[26]=1,Js[144]=Js[26]=-1,Zs[144]=Zs[26]=0,Ks[144]=Ks[26]=1,ea[36]=ea[134]=0,na[36]=na[134]=1,ra[36]=ra[134]=1,aa[36]=aa[134]=0,ua[36]=ua[134]=1,ca[36]=ca[134]=0,Vs[36]=Vs[134]=0,Hs[36]=Hs[134]=-1,Ws[36]=Ws[134]=1,Js[36]=Js[134]=1,Zs[36]=Zs[134]=0,Ks[36]=Ks[134]=0,Qs[9]=Qs[161]=-1,$s[9]=$s[161]=0,ta[9]=ta[161]=0,ea[9]=ea[161]=0,na[9]=na[161]=-1,ra[9]=ra[161]=0,ia[9]=ia[161]=1,oa[9]=oa[161]=0,sa[9]=sa[161]=0,fa[9]=fa[161]=1,ga[9]=ga[161]=0,da[9]=da[161]=1,Qs[136]=0,$s[136]=1,ta[136]=1,ea[136]=0,na[136]=1,ra[136]=0,aa[136]=-1,ua[136]=0,ca[136]=1,ia[136]=-1,oa[136]=0,sa[136]=0,fa[136]=0,ga[136]=-1,da[136]=0,ha[136]=0,la[136]=-1,pa[136]=1,Vs[136]=1,Hs[136]=0,Ws[136]=0,Js[136]=1,Zs[136]=0,Ks[136]=1,Qs[34]=0,$s[34]=-1,ta[34]=0,ea[34]=0,na[34]=-1,ra[34]=1,aa[34]=1,ua[34]=0,ca[34]=0,ia[34]=1,oa[34]=0,sa[34]=1,fa[34]=0,ga[34]=1,da[34]=1,ha[34]=0,la[34]=1,pa[34]=0,Vs[34]=-1,Hs[34]=0,Ws[34]=1,Js[34]=-1,Zs[34]=0,Ks[34]=0,Qs[35]=0,$s[35]=1,ta[35]=1,ea[35]=0,na[35]=-1,ra[35]=1,aa[35]=1,ua[35]=0,ca[35]=0,ia[35]=-1,oa[35]=0,sa[35]=0,fa[35]=0,ga[35]=-1,da[35]=0,ha[35]=0,la[35]=1,pa[35]=0,Vs[35]=-1,Hs[35]=0,Ws[35]=1,Js[35]=1,Zs[35]=0,Ks[35]=1,Qs[153]=0,$s[153]=1,ta[153]=1,ia[153]=-1,oa[153]=0,sa[153]=0,fa[153]=0,ga[153]=-1,da[153]=0,Js[153]=1,Zs[153]=0,Ks[153]=1,ea[102]=0,na[102]=-1,ra[102]=1,aa[102]=1,ua[102]=0,ca[102]=0,ha[102]=0,la[102]=1,pa[102]=0,Vs[102]=-1,Hs[102]=0,Ws[102]=1,Qs[155]=0,$s[155]=-1,ta[155]=0,ia[155]=1,oa[155]=0,sa[155]=1,fa[155]=0,ga[155]=1,da[155]=1,Js[155]=-1,Zs[155]=0,Ks[155]=0,ea[103]=0,na[103]=1,ra[103]=0,aa[103]=-1,ua[103]=0,ca[103]=1,ha[103]=0,la[103]=-1,pa[103]=1,Vs[103]=1,Hs[103]=0,Ws[103]=0,Qs[152]=0,$s[152]=1,ta[152]=1,aa[152]=-1,ua[152]=0,ca[152]=1,ia[152]=-1,oa[152]=0,sa[152]=0,fa[152]=0,ga[152]=-1,da[152]=0,ha[152]=0,la[152]=-1,pa[152]=1,Js[152]=1,Zs[152]=0,Ks[152]=1,Qs[156]=0,$s[156]=-1,ta[156]=1,aa[156]=1,ua[156]=0,ca[156]=1,ia[156]=-1,oa[156]=0,sa[156]=0,fa[156]=0,ga[156]=-1,da[156]=0,ha[156]=0,la[156]=1,pa[156]=1,Js[156]=-1,Zs[156]=0,Ks[156]=1,Qs[137]=0,$s[137]=1,ta[137]=1,ea[137]=0,na[137]=1,ra[137]=0,ia[137]=-1,oa[137]=0,sa[137]=0,fa[137]=0,ga[137]=-1,da[137]=0,Vs[137]=1,Hs[137]=0,Ws[137]=0,Js[137]=1,Zs[137]=0,Ks[137]=1,Qs[139]=0,$s[139]=1,ta[139]=1,ea[139]=0,na[139]=-1,ra[139]=0,ia[139]=1,oa[139]=0,sa[139]=0,fa[139]=0,ga[139]=1,da[139]=0,Vs[139]=-1,Hs[139]=0,Ws[139]=0,Js[139]=1,Zs[139]=0,Ks[139]=1,Qs[98]=0,$s[98]=-1,ta[98]=0,ea[98]=0,na[98]=-1,ra[98]=1,aa[98]=1,ua[98]=0,ca[98]=0,ia[98]=1,oa[98]=0,sa[98]=1,ha[98]=0,la[98]=1,pa[98]=0,Vs[98]=-1,Hs[98]=0,Ws[98]=1,Qs[99]=0,$s[99]=1,ta[99]=0,ea[99]=0,na[99]=-1,ra[99]=1,aa[99]=1,ua[99]=0,ca[99]=0,ia[99]=-1,oa[99]=0,sa[99]=1,ha[99]=0,la[99]=-1,pa[99]=0,Vs[99]=1,Hs[99]=0,Ws[99]=1,ea[38]=0,na[38]=-1,ra[38]=1,aa[38]=1,ua[38]=0,ca[38]=0,fa[38]=0,ga[38]=1,da[38]=1,ha[38]=0,la[38]=1,pa[38]=0,Vs[38]=-1,Hs[38]=0,Ws[38]=1,Js[38]=-1,Zs[38]=0,Ks[38]=0,ea[39]=0,na[39]=1,ra[39]=1,aa[39]=-1,ua[39]=0,ca[39]=0,fa[39]=0,ga[39]=-1,da[39]=1,ha[39]=0,la[39]=1,pa[39]=0,Vs[39]=-1,Hs[39]=0,Ws[39]=1,Js[39]=1,Zs[39]=0,Ks[39]=0;var ya=function(t){return[[t.bottomleft,0],[0,0],[0,t.leftbottom]]},_a=function(t){return[[1,t.rightbottom],[1,0],[t.bottomright,0]]},ma=function(t){return[[t.topright,1],[1,1],[1,t.righttop]]},va=function(t){return[[0,t.lefttop],[0,1],[t.topleft,1]]},xa=function(t){return[[t.bottomright,0],[t.bottomleft,0],[0,t.leftbottom],[0,t.lefttop]]},Ea=function(t){return[[t.bottomright,0],[t.bottomleft,0],[1,t.righttop],[1,t.rightbottom]]},wa=function(t){return[[1,t.righttop],[1,t.rightbottom],[t.topleft,1],[t.topright,1]]},ba=function(t){return[[0,t.leftbottom],[0,t.lefttop],[t.topleft,1],[t.topright,1]]},Ia=[],Na=[],Ca=[],Sa=[],Ma=[],La=[],Pa=[],Oa=[];Sa[1]=Ma[1]=18,Sa[169]=Ma[169]=18,Ca[4]=Na[4]=12,Ca[166]=Na[166]=12,Ia[16]=Oa[16]=4,Ia[154]=Oa[154]=4,La[64]=Pa[64]=22,La[106]=Pa[106]=22,Ca[2]=La[2]=17,Sa[2]=Ma[2]=18,Ca[168]=La[168]=17,Sa[168]=Ma[168]=18,Ia[8]=Sa[8]=9,Na[8]=Ca[8]=12,Ia[162]=Sa[162]=9,Na[162]=Ca[162]=12,Ia[32]=Oa[32]=4,Na[32]=Pa[32]=1,Ia[138]=Oa[138]=4,Na[138]=Pa[138]=1,Ma[128]=Oa[128]=21,La[128]=Pa[128]=22,Ma[42]=Oa[42]=21,La[42]=Pa[42]=22,Na[5]=Ma[5]=14,Na[165]=Ma[165]=14,Ca[20]=Oa[20]=6,Ca[150]=Oa[150]=6,Ia[80]=La[80]=11,Ia[90]=La[90]=11,Sa[65]=Pa[65]=3,Sa[105]=Pa[105]=3,Ia[160]=La[160]=11,Na[160]=Ma[160]=14,Ia[10]=La[10]=11,Na[10]=Ma[10]=14,Ca[130]=Oa[130]=6,Sa[130]=Pa[130]=3,Ca[40]=Oa[40]=6,Sa[40]=Pa[40]=3,Na[101]=Pa[101]=1,Na[69]=Pa[69]=1,Ma[149]=Oa[149]=21,Ma[21]=Oa[21]=21,Ca[86]=La[86]=17,Ca[84]=La[84]=17,Ia[89]=Sa[89]=9,Ia[81]=Sa[81]=9,Ia[96]=Pa[96]=0,Na[96]=La[96]=15,Ia[74]=Pa[74]=0,Na[74]=La[74]=15,Ia[24]=Ca[24]=8,Sa[24]=Oa[24]=7,Ia[146]=Ca[146]=8,Sa[146]=Oa[146]=7,Na[6]=La[6]=15,Ca[6]=Ma[6]=16,Na[164]=La[164]=15,Ca[164]=Ma[164]=16,Sa[129]=Oa[129]=7,Ma[129]=Pa[129]=20,Sa[41]=Oa[41]=7,Ma[41]=Pa[41]=20,Ca[66]=Pa[66]=2,Sa[66]=La[66]=19,Ca[104]=Pa[104]=2,Sa[104]=La[104]=19,Ia[144]=Ma[144]=10,La[144]=Oa[144]=23,Ia[26]=Ma[26]=10,La[26]=Oa[26]=23,Na[36]=Oa[36]=5,Ca[36]=Pa[36]=2,Na[134]=Oa[134]=5,Ca[134]=Pa[134]=2,Ia[9]=Ma[9]=10,Na[9]=Sa[9]=13,Ia[161]=Ma[161]=10,Na[161]=Sa[161]=13,Na[37]=Oa[37]=5,Ma[37]=Pa[37]=20,Na[133]=Oa[133]=5,Ma[133]=Pa[133]=20,Ca[148]=Ma[148]=16,La[148]=Oa[148]=23,Ca[22]=Ma[22]=16,La[22]=Oa[22]=23,Ia[82]=Ca[82]=8,Sa[82]=La[82]=19,Ia[88]=Ca[88]=8,Sa[88]=La[88]=19,Ia[73]=Pa[73]=0,Na[73]=Sa[73]=13,Ia[97]=Pa[97]=0,Na[97]=Sa[97]=13,Ia[145]=Sa[145]=9,Ma[145]=Oa[145]=21,Ia[25]=Sa[25]=9,Ma[25]=Oa[25]=21,Na[70]=Pa[70]=1,Ca[70]=La[70]=17,Na[100]=Pa[100]=1,Ca[100]=La[100]=17,Ia[34]=Sa[34]=9,Na[34]=Ca[34]=12,Ma[34]=Oa[34]=21,La[34]=Pa[34]=22,Ia[136]=Oa[136]=4,Na[136]=Pa[136]=1,Ca[136]=La[136]=17,Sa[136]=Ma[136]=18,Ia[35]=Oa[35]=4,Na[35]=Ca[35]=12,Sa[35]=Ma[35]=18,La[35]=Pa[35]=22,Ia[153]=Oa[153]=4,Sa[153]=Ma[153]=18,Na[102]=Ca[102]=12,La[102]=Pa[102]=22,Ia[155]=Sa[155]=9,Ma[155]=Oa[155]=23,Na[103]=Pa[103]=1,Ca[103]=La[103]=17,Ia[152]=Oa[152]=4,Ca[152]=La[152]=17,Sa[152]=Ma[152]=18,Ia[156]=Ca[156]=8,Sa[156]=Ma[156]=18,La[156]=Oa[156]=23,Ia[137]=Oa[137]=4,Na[137]=Pa[137]=1,Sa[137]=Ma[137]=18,Ia[139]=Oa[139]=4,Na[139]=Sa[139]=13,Ma[139]=Pa[139]=20,Ia[98]=Sa[98]=9,Na[98]=Ca[98]=12,La[98]=Pa[98]=22,Ia[99]=Pa[99]=0,Na[99]=Ca[99]=12,Sa[99]=La[99]=19,Na[38]=Ca[38]=12,Ma[38]=Oa[38]=21,La[38]=Pa[38]=22,Na[39]=Oa[39]=5,Ca[39]=Ma[39]=16,La[39]=Pa[39]=22;var Ra=[];Ra[1]=Ra[169]=ya,Ra[4]=Ra[166]=_a,Ra[16]=Ra[154]=ma,Ra[64]=Ra[106]=va,Ra[168]=Ra[2]=xa,Ra[162]=Ra[8]=Ea,Ra[138]=Ra[32]=wa,Ra[42]=Ra[128]=ba,Ra[5]=Ra[165]=function(t){return[[0,0],[0,t.leftbottom],[1,t.rightbottom],[1,0]]},Ra[20]=Ra[150]=function(t){return[[1,0],[t.bottomright,0],[t.topright,1],[1,1]]},Ra[80]=Ra[90]=function(t){return[[1,1],[1,t.righttop],[0,t.lefttop],[0,1]]},Ra[65]=Ra[105]=function(t){return[[t.bottomleft,0],[0,0],[0,1],[t.topleft,1]]},Ra[160]=Ra[10]=function(t){return[[1,t.righttop],[1,t.rightbottom],[0,t.leftbottom],[0,t.lefttop]]},Ra[130]=Ra[40]=function(t){return[[t.topleft,1],[t.topright,1],[t.bottomright,0],[t.bottomleft,0]]},Ra[85]=function(){return[[0,0],[0,1],[1,1],[1,0]]},Ra[101]=Ra[69]=function(t){return[[1,t.rightbottom],[1,0],[0,0],[0,1],[t.topleft,1]]},Ra[149]=Ra[21]=function(t){return[[t.topright,1],[1,1],[1,0],[0,0],[0,t.leftbottom]]},Ra[86]=Ra[84]=function(t){return[[1,0],[t.bottomright,0],[0,t.lefttop],[0,1],[1,1]]},Ra[89]=Ra[81]=function(t){return[[1,1],[1,t.righttop],[t.bottomleft,0],[0,0],[0,1]]},Ra[96]=Ra[74]=function(t){return[[1,t.righttop],[1,t.rightbottom],[0,t.lefttop],[0,1],[t.topleft,1]]},Ra[24]=Ra[146]=function(t){return[[1,1],[1,t.righttop],[t.bottomright,0],[t.bottomleft,0],[t.topright,1]]},Ra[6]=Ra[164]=function(t){return[[1,t.rightbottom],[1,0],[t.bottomright,0],[0,t.leftbottom],[0,t.lefttop]]},Ra[129]=Ra[41]=function(t){return[[t.topright,1],[t.bottomleft,0],[0,0],[0,t.leftbottom],[t.topleft,1]]},Ra[66]=Ra[104]=function(t){return[[t.bottomright,0],[t.bottomleft,0],[0,t.lefttop],[0,1],[t.topleft,1]]},Ra[144]=Ra[26]=function(t){return[[1,1],[1,t.righttop],[0,t.leftbottom],[0,t.lefttop],[t.topright,1]]},Ra[36]=Ra[134]=function(t){return[[1,t.rightbottom],[1,0],[t.bottomright,0],[t.topleft,1],[t.topright,1]]},Ra[9]=Ra[161]=function(t){return[[1,t.righttop],[1,t.rightbottom],[t.bottomleft,0],[0,0],[0,t.leftbottom]]},Ra[37]=Ra[133]=function(t){return[[1,t.rightbottom],[1,0],[0,0],[0,t.leftbottom],[t.topleft,1],[t.topright,1]]},Ra[148]=Ra[22]=function(t){return[[1,1],[1,0],[t.bottomright,0],[0,t.leftbottom],[0,t.lefttop],[t.topright,1]]},Ra[82]=Ra[88]=function(t){return[[1,1],[1,t.righttop],[t.bottomright,0],[t.bottomleft,0],[0,t.lefttop],[0,1]]},Ra[73]=Ra[97]=function(t){return[[1,t.righttop],[1,t.rightbottom],[t.bottomleft,0],[0,0],[0,1],[t.topleft,1]]},Ra[145]=Ra[25]=function(t){return[[1,1],[1,t.righttop],[t.bottomleft,0],[0,0],[0,t.leftbottom],[t.topright,1]]},Ra[70]=Ra[100]=function(t){return[[1,t.rightbottom],[1,0],[t.bottomright,0],[0,t.lefttop],[0,1],[t.topleft,1]]},Ra[34]=function(t){return[ba(t),Ea(t)]},Ra[35]=function(t){return[[1,t.righttop],[1,t.rightbottom],[t.bottomright,0],[t.bottomleft,0],[0,t.leftbottom],[0,t.lefttop],[t.topleft,1],[t.topright,1]]},Ra[136]=function(t){return[wa(t),xa(t)]},Ra[153]=function(t){return[ma(t),ya(t)]},Ra[102]=function(t){return[_a(t),va(t)]},Ra[155]=function(t){return[[1,1],[1,t.righttop],[t.bottomleft,0],[0,0],[0,t.leftbottom],[t.topright,1]]},Ra[103]=function(t){return[[1,t.rightbottom],[1,0],[t.bottomright,0],[0,t.lefttop],[0,1],[t.topleft,1]]},Ra[152]=function(t){return[ma(t),xa(t)]},Ra[156]=function(t){return[[1,1],[1,t.righttop],[t.bottomright,0],[t.bottomleft,0],[0,t.leftbottom],[0,t.lefttop],[t.topright,1]]},Ra[137]=function(t){return[wa(t),ya(t)]},Ra[139]=function(t){return[[1,t.righttop],[1,t.rightbottom],[t.bottomleft,0],[0,0],[0,t.leftbottom],[t.topleft,1],[t.topright,1]]},Ra[98]=function(t){return[Ea(t),va(t)]},Ra[99]=function(t){return[[1,t.righttop],[1,t.rightbottom],[t.bottomright,0],[t.bottomleft,0],[0,t.lefttop],[0,1],[t.topleft,1]]},Ra[38]=function(t){return[_a(t),ba(t)]},Ra[39]=function(t){return[[1,t.rightbottom],[1,0],[t.bottomright,0],[0,t.leftbottom],[0,t.lefttop],[t.topleft,1],[t.topright,1]]};var Ta=function t(e){this.id=t.buildId(e),this.coordinates=e,this.innerEdges=[],this.outerEdges=[],this.outerEdgesSorted=!1};Ta.buildId=function(t){return t.join(",")},Ta.prototype.removeInnerEdge=function(t){this.innerEdges=this.innerEdges.filter((function(e){return e.from.id!==t.from.id}))},Ta.prototype.removeOuterEdge=function(t){this.outerEdges=this.outerEdges.filter((function(e){return e.to.id!==t.to.id}))},Ta.prototype.addOuterEdge=function(t){this.outerEdges.push(t),this.outerEdgesSorted=!1},Ta.prototype.sortOuterEdges=function(){var t=this;this.outerEdgesSorted||(this.outerEdges.sort((function(e,n){var r=e.to,i=n.to;if(r.coordinates[0]-t.coordinates[0]>=0&&i.coordinates[0]-t.coordinates[0]<0)return 1;if(r.coordinates[0]-t.coordinates[0]<0&&i.coordinates[0]-t.coordinates[0]>=0)return-1;if(r.coordinates[0]-t.coordinates[0]==0&&i.coordinates[0]-t.coordinates[0]==0)return r.coordinates[1]-t.coordinates[1]>=0||i.coordinates[1]-t.coordinates[1]>=0?r.coordinates[1]-i.coordinates[1]:i.coordinates[1]-r.coordinates[1];var o=xr(t.coordinates,r.coordinates,i.coordinates);return o<0?1:o>0?-1:Math.pow(r.coordinates[0]-t.coordinates[0],2)+Math.pow(r.coordinates[1]-t.coordinates[1],2)-(Math.pow(i.coordinates[0]-t.coordinates[0],2)+Math.pow(i.coordinates[1]-t.coordinates[1],2))})),this.outerEdgesSorted=!0)},Ta.prototype.getOuterEdges=function(){return this.sortOuterEdges(),this.outerEdges},Ta.prototype.getOuterEdge=function(t){return this.sortOuterEdges(),this.outerEdges[t]},Ta.prototype.addInnerEdge=function(t){this.innerEdges.push(t)};var Aa=function(t,e){this.from=t,this.to=e,this.next=void 0,this.label=void 0,this.symetric=void 0,this.ring=void 0,this.from.addOuterEdge(this),this.to.addInnerEdge(this)};Aa.prototype.getSymetric=function(){return this.symetric||(this.symetric=new Aa(this.to,this.from),this.symetric.symetric=this),this.symetric},Aa.prototype.deleteEdge=function(){this.from.removeOuterEdge(this),this.to.removeInnerEdge(this)},Aa.prototype.isEqual=function(t){return this.from.id===t.from.id&&this.to.id===t.to.id},Aa.prototype.toString=function(){return"Edge { "+this.from.id+" -> "+this.to.id+" }"},Aa.prototype.toLineString=function(){return a([this.from.coordinates,this.to.coordinates])},Aa.prototype.compareTo=function(t){return xr(t.from.coordinates,t.to.coordinates,this.to.coordinates)};var Da=function(){this.edges=[],this.polygon=void 0,this.envelope=void 0},Fa={length:{configurable:!0}};Da.prototype.push=function(t){this[this.edges.length]=t,this.edges.push(t),this.polygon=this.envelope=void 0},Da.prototype.get=function(t){return this.edges[t]},Fa.length.get=function(){return this.edges.length},Da.prototype.forEach=function(t){this.edges.forEach(t)},Da.prototype.map=function(t){return this.edges.map(t)},Da.prototype.some=function(t){return this.edges.some(t)},Da.prototype.isValid=function(){return!0},Da.prototype.isHole=function(){var t=this,e=this.edges.reduce((function(e,n,r){return n.from.coordinates[1]>t.edges[e].from.coordinates[1]&&(e=r),e}),0),n=(0===e?this.length:e)-1,r=(e+1)%this.length,i=xr(this.edges[n].from.coordinates,this.edges[e].from.coordinates,this.edges[r].from.coordinates);return 0===i?this.edges[n].from.coordinates[0]>this.edges[r].from.coordinates[0]:i>0},Da.prototype.toMultiPoint=function(){return l(this.edges.map((function(t){return t.from.coordinates})))},Da.prototype.toPolygon=function(){if(this.polygon)return this.polygon;var t=this.edges.map((function(t){return t.from.coordinates}));return t.push(this.edges[0].from.coordinates),this.polygon=o([t])},Da.prototype.getEnvelope=function(){return this.envelope?this.envelope:this.envelope=he(this.toPolygon())},Da.findEdgeRingContaining=function(t,e){var n,i,o=t.getEnvelope();return e.forEach((function(e){var s=e.getEnvelope();if(i&&(n=i.getEnvelope()),!function(t,e){var n=t.geometry.coordinates.map((function(t){return t[0]})),r=t.geometry.coordinates.map((function(t){return t[1]})),i=e.geometry.coordinates.map((function(t){return t[0]})),o=e.geometry.coordinates.map((function(t){return t[1]}));return Math.max(null,n)===Math.max(null,i)&&Math.max(null,r)===Math.max(null,o)&&Math.min(null,n)===Math.min(null,i)&&Math.min(null,r)===Math.min(null,o)}(s,o)&&Er(s,o)){var a=t.map((function(t){return t.from.coordinates})).find((function(t){return!e.some((function(e){return function(t,e){return t[0]===e[0]&&t[1]===e[1]}(t,e.from.coordinates)}))}));a&&e.inside(r(a))&&(i&&!Er(n,s)||(i=e))}})),i},Da.prototype.inside=function(t){return Pt(t,this.toPolygon())},Object.defineProperties(Da.prototype,Fa);var qa=function(){this.edges=[],this.nodes={}};qa.fromGeoJson=function(t){!function(t){if(!t)throw new Error("No geojson passed");if("FeatureCollection"!==t.type&&"GeometryCollection"!==t.type&&"MultiLineString"!==t.type&&"LineString"!==t.type&&"Feature"!==t.type)throw new Error("Invalid input type '"+t.type+"'. Geojson must be FeatureCollection, GeometryCollection, LineString, MultiLineString or Feature")}(t);var e=new qa;return F(t,(function(t){H(t,"LineString","Graph::fromGeoJson"),M(t,(function(t,n){if(t){var r=e.getNode(t),i=e.getNode(n);e.addEdge(r,i)}return n}))})),e},qa.prototype.getNode=function(t){var e=Ta.buildId(t),n=this.nodes[e];return n||(n=this.nodes[e]=new Ta(t)),n},qa.prototype.addEdge=function(t,e){var n=new Aa(t,e),r=n.getSymetric();this.edges.push(n),this.edges.push(r)},qa.prototype.deleteDangles=function(){var t=this;Object.keys(this.nodes).map((function(e){return t.nodes[e]})).forEach((function(e){return t._removeIfDangle(e)}))},qa.prototype._removeIfDangle=function(t){var e=this;if(t.innerEdges.length<=1){var n=t.getOuterEdges().map((function(t){return t.to}));this.removeNode(t),n.forEach((function(t){return e._removeIfDangle(t)}))}},qa.prototype.deleteCutEdges=function(){var t=this;this._computeNextCWEdges(),this._findLabeledEdgeRings(),this.edges.forEach((function(e){e.label===e.symetric.label&&(t.removeEdge(e.symetric),t.removeEdge(e))}))},qa.prototype._computeNextCWEdges=function(t){var e=this;void 0===t?Object.keys(this.nodes).forEach((function(t){return e._computeNextCWEdges(e.nodes[t])})):t.getOuterEdges().forEach((function(e,n){t.getOuterEdge((0===n?t.getOuterEdges().length:n)-1).symetric.next=e}))},qa.prototype._computeNextCCWEdges=function(t,e){for(var n,r,i=t.getOuterEdges(),o=i.length-1;o>=0;--o){var s=i[o],a=s.symetric,u=void 0,c=void 0;s.label===e&&(u=s),a.label===e&&(c=a),u&&c&&(c&&(r=c),u&&(r&&(r.next=u,r=void 0),n||(n=u)))}r&&(r.next=n)},qa.prototype._findLabeledEdgeRings=function(){var t=[],e=0;return this.edges.forEach((function(n){if(!(n.label>=0)){t.push(n);var r=n;do{r.label=e,r=r.next}while(!n.isEqual(r));e++}})),t},qa.prototype.getEdgeRings=function(){var t=this;this._computeNextCWEdges(),this.edges.forEach((function(t){t.label=void 0})),this._findLabeledEdgeRings().forEach((function(e){t._findIntersectionNodes(e).forEach((function(n){t._computeNextCCWEdges(n,e.label)}))}));var e=[];return this.edges.forEach((function(n){n.ring||e.push(t._findEdgeRing(n))})),e},qa.prototype._findIntersectionNodes=function(t){var e=[],n=t,r=function(){var r=0;n.from.getOuterEdges().forEach((function(e){e.label===t.label&&++r})),r>1&&e.push(n.from),n=n.next};do{r()}while(!t.isEqual(n));return e},qa.prototype._findEdgeRing=function(t){var e=t,n=new Da;do{n.push(e),e.ring=n,e=e.next}while(!t.isEqual(e));return n},qa.prototype.removeNode=function(t){var e=this;t.getOuterEdges().forEach((function(t){return e.removeEdge(t)})),t.innerEdges.forEach((function(t){return e.removeEdge(t)})),delete this.nodes[t.id]},qa.prototype.removeEdge=function(t){this.edges=this.edges.filter((function(e){return!e.isEqual(t)})),t.deleteEdge()};var Ga=mt((function(t,e){function n(t){var e=[];for(var n in t)e.push(n);return e}(t.exports="function"==typeof Object.keys?Object.keys:n).shim=n})),Ba=(Ga.shim,mt((function(t,e){function n(t){return"[object Arguments]"==Object.prototype.toString.call(t)}function r(t){return t&&"object"==typeof t&&"number"==typeof t.length&&Object.prototype.hasOwnProperty.call(t,"callee")&&!Object.prototype.propertyIsEnumerable.call(t,"callee")||!1}var i="[object Arguments]"==function(){return Object.prototype.toString.call(arguments)}();(e=t.exports=i?n:r).supported=n,e.unsupported=r}))),ka=(Ba.supported,Ba.unsupported,mt((function(t){function e(t){return null===t||void 0===t}function n(t){return!(!t||"object"!=typeof t||"number"!=typeof t.length)&&"function"==typeof t.copy&&"function"==typeof t.slice&&!(t.length>0&&"number"!=typeof t[0])}var r=Array.prototype.slice,i=t.exports=function(t,o,s){return s||(s={}),t===o||(t instanceof Date&&o instanceof Date?t.getTime()===o.getTime():!t||!o||"object"!=typeof t&&"object"!=typeof o?s.strict?t===o:t==o:function(t,o,s){var a,u;if(e(t)||e(o))return!1;if(t.prototype!==o.prototype)return!1;if(Ba(t))return!!Ba(o)&&(t=r.call(t),o=r.call(o),i(t,o,s));if(n(t)){if(!n(o))return!1;if(t.length!==o.length)return!1;for(a=0;a<t.length;a++)if(t[a]!==o[a])return!1;return!0}try{var c=Ga(t),h=Ga(o)}catch(t){return!1}if(c.length!=h.length)return!1;for(c.sort(),h.sort(),a=c.length-1;a>=0;a--)if(c[a]!=h[a])return!1;for(a=c.length-1;a>=0;a--)if(u=c[a],!i(t[u],o[u],s))return!1;return typeof t==typeof o}(t,o,s))}}))),za=function(t){this.precision=t&&t.precision?t.precision:17,this.direction=!(!t||!t.direction)&&t.direction,this.pseudoNode=!(!t||!t.pseudoNode)&&t.pseudoNode,this.objectComparator=t&&t.objectComparator?t.objectComparator:Rr};za.prototype.compare=function(t,e){if(t.type!==e.type||!Or(t,e))return!1;switch(t.type){case"Point":return this.compareCoord(t.coordinates,e.coordinates);case"LineString":return this.compareLine(t.coordinates,e.coordinates,0,!1);case"Polygon":return this.comparePolygon(t,e);case"Feature":return this.compareFeature(t,e);default:if(0===t.type.indexOf("Multi")){var n=this,r=Pr(t),i=Pr(e);return r.every((function(t){return this.some((function(e){return n.compare(t,e)}))}),i)}}return!1},za.prototype.compareCoord=function(t,e){if(t.length!==e.length)return!1;for(var n=0;n<t.length;n++)if(t[n].toFixed(this.precision)!==e[n].toFixed(this.precision))return!1;return!0},za.prototype.compareLine=function(t,e,n,r){if(!Or(t,e))return!1;var i=this.pseudoNode?t:this.removePseudo(t),o=this.pseudoNode?e:this.removePseudo(e);if(!r||this.compareCoord(i[0],o[0])||(o=this.fixStartIndex(o,i))){var s=this.compareCoord(i[n],o[n]);return this.direction||s?this.comparePath(i,o):!!this.compareCoord(i[n],o[o.length-(1+n)])&&this.comparePath(i.slice().reverse(),o)}},za.prototype.fixStartIndex=function(t,e){for(var n,r=-1,i=0;i<t.length;i++)if(this.compareCoord(t[i],e[0])){r=i;break}return r>=0&&(n=[].concat(t.slice(r,t.length),t.slice(1,r+1))),n},za.prototype.comparePath=function(t,e){var n=this;return t.every((function(t,e){return n.compareCoord(t,this[e])}),e)},za.prototype.comparePolygon=function(t,e){if(this.compareLine(t.coordinates[0],e.coordinates[0],1,!0)){var n=t.coordinates.slice(1,t.coordinates.length),r=e.coordinates.slice(1,e.coordinates.length),i=this;return n.every((function(t){return this.some((function(e){return i.compareLine(t,e,1,!0)}))}),r)}return!1},za.prototype.compareFeature=function(t,e){return!(t.id!==e.id||!this.objectComparator(t.properties,e.properties)||!this.compareBBox(t,e))&&this.compare(t.geometry,e.geometry)},za.prototype.compareBBox=function(t,e){return!!(!t.bbox&&!e.bbox||t.bbox&&e.bbox&&this.compareCoord(t.bbox,e.bbox))},za.prototype.removePseudo=function(t){return t};var ja=za,Xa=mt((function(t){function e(t,e,n,r){this.dataset=[],this.epsilon=1,this.minPts=2,this.distance=this._euclideanDistance,this.clusters=[],this.noise=[],this._visited=[],this._assigned=[],this._datasetLength=0,this._init(t,e,n,r)}e.prototype.run=function(t,e,n,r){this._init(t,e,n,r);for(var i=0;i<this._datasetLength;i++)if(1!==this._visited[i]){this._visited[i]=1;var o=this._regionQuery(i);if(o.length<this.minPts)this.noise.push(i);else{var s=this.clusters.length;this.clusters.push([]),this._addToCluster(i,s),this._expandCluster(s,o)}}return this.clusters},e.prototype._init=function(t,e,n,r){if(t){if(!(t instanceof Array))throw Error("Dataset must be of type array, "+typeof t+" given");this.dataset=t,this.clusters=[],this.noise=[],this._datasetLength=t.length,this._visited=new Array(this._datasetLength),this._assigned=new Array(this._datasetLength)}e&&(this.epsilon=e),n&&(this.minPts=n),r&&(this.distance=r)},e.prototype._expandCluster=function(t,e){for(var n=0;n<e.length;n++){var r=e[n];if(1!==this._visited[r]){this._visited[r]=1;var i=this._regionQuery(r);i.length>=this.minPts&&(e=this._mergeArrays(e,i))}1!==this._assigned[r]&&this._addToCluster(r,t)}},e.prototype._addToCluster=function(t,e){this.clusters[e].push(t),this._assigned[t]=1},e.prototype._regionQuery=function(t){for(var e=[],n=0;n<this._datasetLength;n++)this.distance(this.dataset[t],this.dataset[n])<this.epsilon&&e.push(n);return e},e.prototype._mergeArrays=function(t,e){for(var n=e.length,r=0;r<n;r++){var i=e[r];t.indexOf(i)<0&&t.push(i)}return t},e.prototype._euclideanDistance=function(t,e){for(var n=0,r=Math.min(t.length,e.length);r--;)n+=(t[r]-e[r])*(t[r]-e[r]);return Math.sqrt(n)},t.exports&&(t.exports=e)})),Ua=mt((function(t){function e(t,e,n){this.k=3,this.dataset=[],this.assignments=[],this.centroids=[],this.init(t,e,n)}e.prototype.init=function(t,e,n){this.assignments=[],this.centroids=[],void 0!==t&&(this.dataset=t),void 0!==e&&(this.k=e),void 0!==n&&(this.distance=n)},e.prototype.run=function(t,e){this.init(t,e);for(var n=this.dataset.length,r=0;r<this.k;r++)this.centroids[r]=this.randomCentroid();for(var i=!0;i;){i=this.assign();for(var o=0;o<this.k;o++){for(var s=new Array(h),a=0,u=0;u<h;u++)s[u]=0;for(var c=0;c<n;c++){var h=this.dataset[c].length;if(o===this.assignments[c]){for(u=0;u<h;u++)s[u]+=this.dataset[c][u];a++}}if(a>0){for(u=0;u<h;u++)s[u]/=a;this.centroids[o]=s}else this.centroids[o]=this.randomCentroid(),i=!0}}return this.getClusters()},e.prototype.randomCentroid=function(){var t,e,n=this.dataset.length-1;do{e=Math.round(Math.random()*n),t=this.dataset[e]}while(this.centroids.indexOf(t)>=0);return t},e.prototype.assign=function(){for(var t,e=!1,n=this.dataset.length,r=0;r<n;r++)(t=this.argmin(this.dataset[r],this.centroids,this.distance))!=this.assignments[r]&&(this.assignments[r]=t,e=!0);return e},e.prototype.getClusters=function(){for(var t,e=new Array(this.k),n=0;n<this.assignments.length;n++)void 0===e[t=this.assignments[n]]&&(e[t]=[]),e[t].push(n);return e},e.prototype.argmin=function(t,e,n){for(var r,i=Number.MAX_VALUE,o=0,s=e.length,a=0;a<s;a++)(r=n(t,e[a]))<i&&(i=r,o=a);return o},e.prototype.distance=function(t,e){for(var n=0,r=Math.min(t.length,e.length);r--;){var i=t[r]-e[r];n+=i*i}return Math.sqrt(n)},t.exports&&(t.exports=e)})),Ya=mt((function(t){function e(t,e,n){this._queue=[],this._priorities=[],this._sorting="desc",this._init(t,e,n)}e.prototype.insert=function(t,e){for(var n=this._queue.length,r=n;r--;){var i=this._priorities[r];"desc"===this._sorting?e>i&&(n=r):e<i&&(n=r)}this._insertAt(t,e,n)},e.prototype.remove=function(t){for(var e=this._queue.length;e--;)if(t===this._queue[e]){this._queue.splice(e,1),this._priorities.splice(e,1);break}},e.prototype.forEach=function(t){this._queue.forEach(t)},e.prototype.getElements=function(){return this._queue},e.prototype.getElementPriority=function(t){return this._priorities[t]},e.prototype.getPriorities=function(){return this._priorities},e.prototype.getElementsWithPriorities=function(){for(var t=[],e=0,n=this._queue.length;e<n;e++)t.push([this._queue[e],this._priorities[e]]);return t},e.prototype._init=function(t,e,n){if(t&&e){if(this._queue=[],this._priorities=[],t.length!==e.length)throw new Error("Arrays must have the same length");for(var r=0;r<t.length;r++)this.insert(t[r],e[r])}n&&(this._sorting=n)},e.prototype._insertAt=function(t,e,n){this._queue.length===n?(this._queue.push(t),this._priorities.push(e)):(this._queue.splice(n,0,t),this._priorities.splice(n,0,e))},t.exports&&(t.exports=e)})),Va=mt((function(t){function e(t,e,n,r){this.epsilon=1,this.minPts=1,this.distance=this._euclideanDistance,this._reachability=[],this._processed=[],this._coreDistance=0,this._orderedList=[],this._init(t,e,n,r)}if(t.exports)var n=Ya;e.prototype.run=function(t,e,r,i){this._init(t,e,r,i);for(var o=0,s=this.dataset.length;o<s;o++)if(1!==this._processed[o]){this._processed[o]=1,this.clusters.push([o]);var a=this.clusters.length-1;this._orderedList.push(o);var u=new n(null,null,"asc"),c=this._regionQuery(o);void 0!==this._distanceToCore(o)&&(this._updateQueue(o,c,u),this._expandCluster(a,u))}return this.clusters},e.prototype.getReachabilityPlot=function(){for(var t=[],e=0,n=this._orderedList.length;e<n;e++){var r=this._orderedList[e],i=this._reachability[r];t.push([r,i])}return t},e.prototype._init=function(t,e,n,r){if(t){if(!(t instanceof Array))throw Error("Dataset must be of type array, "+typeof t+" given");this.dataset=t,this.clusters=[],this._reachability=new Array(this.dataset.length),this._processed=new Array(this.dataset.length),this._coreDistance=0,this._orderedList=[]}e&&(this.epsilon=e),n&&(this.minPts=n),r&&(this.distance=r)},e.prototype._updateQueue=function(t,e,n){var r=this;this._coreDistance=this._distanceToCore(t),e.forEach((function(e){if(void 0===r._processed[e]){var i=r.distance(r.dataset[t],r.dataset[e]),o=Math.max(r._coreDistance,i);void 0===r._reachability[e]?(r._reachability[e]=o,n.insert(e,o)):o<r._reachability[e]&&(r._reachability[e]=o,n.remove(e),n.insert(e,o))}}))},e.prototype._expandCluster=function(t,e){for(var n=e.getElements(),r=0,i=n.length;r<i;r++){var o=n[r];if(void 0===this._processed[o]){var s=this._regionQuery(o);this._processed[o]=1,this.clusters[t].push(o),this._orderedList.push(o),void 0!==this._distanceToCore(o)&&(this._updateQueue(o,s,e),this._expandCluster(t,e))}}},e.prototype._distanceToCore=function(t){for(var e=this.epsilon,n=0;n<e;n++)if(this._regionQuery(t,n).length>=this.minPts)return n},e.prototype._regionQuery=function(t,e){e=e||this.epsilon;for(var n=[],r=0,i=this.dataset.length;r<i;r++)this.distance(this.dataset[t],this.dataset[r])<e&&n.push(r);return n},e.prototype._euclideanDistance=function(t,e){for(var n=0,r=Math.min(t.length,e.length);r--;)n+=(t[r]-e[r])*(t[r]-e[r]);return Math.sqrt(n)},t.exports&&(t.exports=e)})),Ha=mt((function(t){t.exports&&(t.exports={DBSCAN:Xa,KMEANS:Ua,OPTICS:Va,PriorityQueue:Ya})})),Wa=(Ha.DBSCAN,Ha.KMEANS,Ha.OPTICS,Ha.PriorityQueue,function(t,e,n){for(var r=t.length,i=0,o=0;o<r;o++){var s=(t[o]||0)-(e[o]||0);i+=s*s}return n?Math.sqrt(i):i}),Ja=Wa,Za=function(t,e,n){var r=Math.abs(t-e);return n?r:r*r},Ka=Wa,Qa=function(t,e){for(var n={},r=[],i=e<<2,o=t.length,s=t[0].length>0;r.length<e&&i-- >0;){var a=t[Math.floor(Math.random()*o)],u=s?a.join("_"):""+a;n[u]||(n[u]=!0,r.push(a))}if(r.length<e)throw new Error("Error initializating clusters");return r},$a=function(t,e){var n=t[0].length?Ja:Za,r=[],i=t.length,o=t[0].length>0,s=t[Math.floor(Math.random()*i)];for(o&&s.join("_"),r.push(s);r.length<e;){for(var a=[],u=r.length,c=0,h=[],l=0;l<i;l++){for(var p=1/0,f=0;f<u;f++){var g=n(t[l],r[f]);g<=p&&(p=g)}a[l]=p}for(var d=0;d<i;d++)c+=a[d];for(var y=0;y<i;y++)h[y]={i:y,v:t[y],pr:a[y]/c,cs:0};h.sort((function(t,e){return t.pr-e.pr})),h[0].cs=h[0].pr;for(var _=1;_<i;_++)h[_].cs=h[_-1].cs+h[_].pr;for(var m=Math.random(),v=0;v<i-1&&h[v++].cs<m;);r.push(h[v-1].v)}return r},tu=1e4,eu=function(t,e,n,r){var i=[],o=[],s=[],a=[],u=!1,c=r||tu,h=t.length,l=t[0].length,p=l>0,f=[];if(n)i="kmrand"==n?Qa(t,e):"kmpp"==n?$a(t,e):n;else for(var g={};i.length<e;){var d=Math.floor(Math.random()*h);g[d]||(g[d]=!0,i.push(t[d]))}do{Ar(e,0,f);for(var y=0;y<h;y++){for(var _=1/0,m=0,v=0;v<e;v++)(a=p?Ka(t[y],i[v]):Math.abs(t[y]-i[v]))<=_&&(_=a,m=v);s[y]=m,f[m]++}for(var x=[],E=(o=[],0);E<e;E++)x[E]=p?Ar(l,0,x[E]):0,o[E]=i[E];if(p){for(var w=0;w<e;w++)i[w]=[];for(var b=0;b<h;b++)for(var I=x[s[b]],N=t[b],C=0;C<l;C++)I[C]+=N[C];u=!0;for(var S=0;S<e;S++){for(var M=i[S],L=x[S],P=o[S],O=f[S],R=0;R<l;R++)M[R]=L[R]/O||0;if(u)for(var T=0;T<l;T++)if(P[T]!=M[T]){u=!1;break}}}else{for(var A=0;A<h;A++)x[s[A]]+=t[A];for(var D=0;D<e;D++)i[D]=x[D]/f[D]||0;u=!0;for(var F=0;F<e;F++)if(o[F]!=i[F]){u=!1;break}}u=u||--c<=0}while(!u);return{it:tu-c,k:e,idxs:s,centroids:i}},nu={search:function(t,e,n,r){t.cleanDirty();var i=(r=r||{}).heuristic||nu.heuristics.manhattan,o=r.closest||!1,s=new Br((function(t){return t.f})),a=e;for(e.h=i(e,n),s.push(e);s.size()>0;){var u=s.pop();if(u===n)return Fr(u);u.closed=!0;for(var c=t.neighbors(u),h=0,l=c.length;h<l;++h){var p=c[h];if(!p.closed&&!p.isWall()){var f=u.g+p.getCost(u),g=p.visited;(!g||f<p.g)&&(p.visited=!0,p.parent=u,p.h=p.h||i(p,n),p.g=f,p.f=p.g+p.h,t.markDirty(p),o&&(p.h<a.h||p.h===a.h&&p.g<a.g)&&(a=p),g?s.rescoreElement(p):s.push(p))}}}return o?Fr(a):[]},heuristics:{manhattan:function(t,e){return Math.abs(e.x-t.x)+Math.abs(e.y-t.y)},diagonal:function(t,e){var n=Math.sqrt(2),r=Math.abs(e.x-t.x),i=Math.abs(e.y-t.y);return 1*(r+i)+(n-2)*Math.min(r,i)}},cleanNode:function(t){t.f=0,t.g=0,t.h=0,t.visited=!1,t.closed=!1,t.parent=null}};qr.prototype.init=function(){this.dirtyNodes=[];for(var t=0;t<this.nodes.length;t++)nu.cleanNode(this.nodes[t])},qr.prototype.cleanDirty=function(){for(var t=0;t<this.dirtyNodes.length;t++)nu.cleanNode(this.dirtyNodes[t]);this.dirtyNodes=[]},qr.prototype.markDirty=function(t){this.dirtyNodes.push(t)},qr.prototype.neighbors=function(t){var e=[],n=t.x,r=t.y,i=this.grid;return i[n-1]&&i[n-1][r]&&e.push(i[n-1][r]),i[n+1]&&i[n+1][r]&&e.push(i[n+1][r]),i[n]&&i[n][r-1]&&e.push(i[n][r-1]),i[n]&&i[n][r+1]&&e.push(i[n][r+1]),this.diagonal&&(i[n-1]&&i[n-1][r-1]&&e.push(i[n-1][r-1]),i[n+1]&&i[n+1][r-1]&&e.push(i[n+1][r-1]),i[n-1]&&i[n-1][r+1]&&e.push(i[n-1][r+1]),i[n+1]&&i[n+1][r+1]&&e.push(i[n+1][r+1])),e},qr.prototype.toString=function(){for(var t,e,n,r,i=[],o=this.grid,s=0,a=o.length;s<a;s++){for(t=[],n=0,r=(e=o[s]).length;n<r;n++)t.push(e[n].weight);i.push(t.join(" "))}return i.join("\n")},Gr.prototype.toString=function(){return"["+this.x+" "+this.y+"]"},Gr.prototype.getCost=function(t){return t&&t.x!==this.x&&t.y!==this.y?1.41421*this.weight:this.weight},Gr.prototype.isWall=function(){return 0===this.weight},Br.prototype={push:function(t){this.content.push(t),this.sinkDown(this.content.length-1)},pop:function(){var t=this.content[0],e=this.content.pop();return this.content.length>0&&(this.content[0]=e,this.bubbleUp(0)),t},remove:function(t){var e=this.content.indexOf(t),n=this.content.pop();e!==this.content.length-1&&(this.content[e]=n,this.scoreFunction(n)<this.scoreFunction(t)?this.sinkDown(e):this.bubbleUp(e))},size:function(){return this.content.length},rescoreElement:function(t){this.sinkDown(this.content.indexOf(t))},sinkDown:function(t){for(var e=this.content[t];t>0;){var n=(t+1>>1)-1,r=this.content[n];if(!(this.scoreFunction(e)<this.scoreFunction(r)))break;this.content[n]=e,this.content[t]=r,t=n}},bubbleUp:function(t){for(var e=this.content.length,n=this.content[t],r=this.scoreFunction(n);;){var i,o=t+1<<1,s=o-1,a=null;if(s<e){var u=this.content[s];(i=this.scoreFunction(u))<r&&(a=s)}if(o<e){var c=this.content[o];this.scoreFunction(c)<(null===a?r:i)&&(a=o)}if(null===a)break;this.content[t]=this.content[a],this.content[a]=n,t=a}}};var ru=function(t){return function(){return t}};jr.prototype={constructor:jr,insert:function(t,e){var n,r,i;if(t){if(e.P=t,e.N=t.N,t.N&&(t.N.P=e),t.N=e,t.R){for(t=t.R;t.L;)t=t.L;t.L=e}else t.R=e;n=t}else this._?(t=Vr(this._),e.P=null,e.N=t,t.P=t.L=e,n=t):(e.P=e.N=null,this._=e,n=null);for(e.L=e.R=null,e.U=n,e.C=!0,t=e;n&&n.C;)n===(r=n.U).L?(i=r.R)&&i.C?(n.C=i.C=!1,r.C=!0,t=r):(t===n.R&&(Ur(this,n),n=(t=n).U),n.C=!1,r.C=!0,Yr(this,r)):(i=r.L)&&i.C?(n.C=i.C=!1,r.C=!0,t=r):(t===n.L&&(Yr(this,n),n=(t=n).U),n.C=!1,r.C=!0,Ur(this,r)),n=t.U;this._.C=!1},remove:function(t){t.N&&(t.N.P=t.P),t.P&&(t.P.N=t.N),t.N=t.P=null;var e,n,r,i=t.U,o=t.L,s=t.R;if(n=o?s?Vr(s):o:s,i?i.L===t?i.L=n:i.R=n:this._=n,o&&s?(r=n.C,n.C=t.C,n.L=o,o.U=n,n!==s?(i=n.U,n.U=t.U,t=n.R,i.L=t,n.R=s,s.U=n):(n.U=i,i=n,t=n.R)):(r=t.C,t=n),t&&(t.U=i),!r)if(t&&t.C)t.C=!1;else{do{if(t===this._)break;if(t===i.L){if((e=i.R).C&&(e.C=!1,i.C=!0,Ur(this,i),e=i.R),e.L&&e.L.C||e.R&&e.R.C){e.R&&e.R.C||(e.L.C=!1,e.C=!0,Yr(this,e),e=i.R),e.C=i.C,i.C=e.R.C=!1,Ur(this,i),t=this._;break}}else if((e=i.L).C&&(e.C=!1,i.C=!0,Yr(this,i),e=i.L),e.L&&e.L.C||e.R&&e.R.C){e.L&&e.L.C||(e.R.C=!1,e.C=!0,Ur(this,e),e=i.L),e.C=i.C,i.C=e.L.C=!1,Yr(this,i),t=this._;break}e.C=!0,t=i,i=i.U}while(!t.C);t&&(t.C=!1)}}};var iu,ou,su,au,uu,cu=[],hu=[],lu=1e-6,pu=1e-12;hi.prototype={constructor:hi,polygons:function(){var t=this.edges;return this.cells.map((function(e){var n=e.halfedges.map((function(n){return $r(e,t[n])}));return n.data=e.site.data,n}))},triangles:function(){var t=[],e=this.edges;return this.cells.forEach((function(n,r){if(o=(i=n.halfedges).length)for(var i,o,s,a=n.site,u=-1,c=e[i[o-1]],h=c.left===a?c.right:c.left;++u<o;)s=h,h=(c=e[i[u]]).left===a?c.right:c.left,s&&h&&r<s.index&&r<h.index&&ui(a,s,h)<0&&t.push([a.data,s.data,h.data])})),t},links:function(){return this.edges.filter((function(t){return t.right})).map((function(t){return{source:t.left.data,target:t.right.data}}))},find:function(t,e,n){for(var r,i,o=this,s=o._found||0,a=o.cells.length;!(i=o.cells[s]);)if(++s>=a)return null;var u=t-i.site[0],c=e-i.site[1],h=u*u+c*c;do{i=o.cells[r=s],s=null,i.halfedges.forEach((function(n){var r=o.edges[n],a=r.left;if(a!==i.site&&a||(a=r.right)){var u=t-a[0],c=e-a[1],l=u*u+c*c;l<h&&(h=l,s=a.index)}}))}while(null!==s);return o._found=r,null==n||h<=n*n?i.site:null}};var fu=function(){function t(t){return new hi(t.map((function(r,i){var o=[Math.round(e(r,i,t)/lu)*lu,Math.round(n(r,i,t)/lu)*lu];return o.index=i,o.data=r,o})),r)}var e=kr,n=zr,r=null;return t.polygons=function(e){return t(e).polygons()},t.links=function(e){return t(e).links()},t.triangles=function(e){return t(e).triangles()},t.x=function(n){return arguments.length?(e="function"==typeof n?n:ru(+n),t):e},t.y=function(e){return arguments.length?(n="function"==typeof e?e:ru(+e),t):n},t.extent=function(e){return arguments.length?(r=null==e?null:[[+e[0][0],+e[0][1]],[+e[1][0],+e[1][1]]],t):r&&[[r[0][0],r[0][1]],[r[1][0],r[1][1]]]},t.size=function(e){return arguments.length?(r=null==e?null:[[0,0],[+e[0],+e[1]]],t):r&&[r[1][0]-r[0][0],r[1][1]-r[0][1]]},t},gu=Object.freeze({randomPosition:_i,randomPoint:mi,randomPolygon:vi,randomLineString:xi}),du=Object.freeze({getCluster:wi,clusterEach:bi,clusterReduce:Ii,createBins:Ni,applyFilter:Ci,propertiesContainsFilter:Si,filterProperties:Mi});"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);r<i;)e[r]=t,++r;return e},writable:!0}),Number.isFinite=Number.isFinite||function(t){return"number"==typeof t&&isFinite(t)},Number.isInteger=Number.isInteger||function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t},Number.parseFloat=Number.parseFloat||parseFloat,Number.isNaN=Number.isNaN||function(t){return t!=t},Math.trunc=Math.trunc||function(t){return t<0?Math.ceil(t):Math.floor(t)};var yu=function(){};yu.prototype.interfaces_=function(){return[]},yu.prototype.getClass=function(){return yu},yu.prototype.equalsWithTolerance=function(t,e,n){return Math.abs(t-e)<=n};var _u=function(){},mu=function(){},vu={MAX_VALUE:{configurable:!0}};mu.isNaN=function(t){return Number.isNaN(t)},mu.doubleToLongBits=function(t){return t},mu.longBitsToDouble=function(t){return t},mu.isInfinite=function(t){return!Number.isFinite(t)},vu.MAX_VALUE.get=function(){return Number.MAX_VALUE},Object.defineProperties(mu,vu);var xu=function(){},Eu=function(){},wu=function(){},bu=function t(){if(this.x=null,this.y=null,this.z=null,0===arguments.length)this.x=0,this.y=0,this.z=t.NULL_ORDINATE;else if(1===arguments.length){var e=arguments[0];this.x=e.x,this.y=e.y,this.z=e.z}else 2===arguments.length?(this.x=arguments[0],this.y=arguments[1],this.z=t.NULL_ORDINATE):3===arguments.length&&(this.x=arguments[0],this.y=arguments[1],this.z=arguments[2])},Iu={DimensionalComparator:{configurable:!0},serialVersionUID:{configurable:!0},NULL_ORDINATE:{configurable:!0},X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0}};bu.prototype.setOrdinate=function(t,e){switch(t){case bu.X:this.x=e;break;case bu.Y:this.y=e;break;case bu.Z:this.z=e;break;default:throw new _u("Invalid ordinate index: "+t)}},bu.prototype.equals2D=function(){if(1===arguments.length){var t=arguments[0];return this.x===t.x&&this.y===t.y}if(2===arguments.length){var e=arguments[0],n=arguments[1];return!!yu.equalsWithTolerance(this.x,e.x,n)&&!!yu.equalsWithTolerance(this.y,e.y,n)}},bu.prototype.getOrdinate=function(t){switch(t){case bu.X:return this.x;case bu.Y:return this.y;case bu.Z:return this.z}throw new _u("Invalid ordinate index: "+t)},bu.prototype.equals3D=function(t){return this.x===t.x&&this.y===t.y&&(this.z===t.z||mu.isNaN(this.z))&&mu.isNaN(t.z)},bu.prototype.equals=function(t){return t instanceof bu&&this.equals2D(t)},bu.prototype.equalInZ=function(t,e){return yu.equalsWithTolerance(this.z,t.z,e)},bu.prototype.compareTo=function(t){var e=t;return this.x<e.x?-1:this.x>e.x?1:this.y<e.y?-1:this.y>e.y?1:0},bu.prototype.clone=function(){},bu.prototype.copy=function(){return new bu(this)},bu.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},bu.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)},bu.prototype.distance=function(t){var e=this.x-t.x,n=this.y-t.y;return Math.sqrt(e*e+n*n)},bu.prototype.hashCode=function(){var t=17;return 37*(t=37*t+bu.hashCode(this.x))+bu.hashCode(this.y)},bu.prototype.setCoordinate=function(t){this.x=t.x,this.y=t.y,this.z=t.z},bu.prototype.interfaces_=function(){return[xu,Eu,Li]},bu.prototype.getClass=function(){return bu},bu.hashCode=function(){if(1===arguments.length){var t=arguments[0],e=mu.doubleToLongBits(t);return Math.trunc((e^e)>>>32)}},Iu.DimensionalComparator.get=function(){return Nu},Iu.serialVersionUID.get=function(){return 0x5cbf2c235c7e5800},Iu.NULL_ORDINATE.get=function(){return mu.NaN},Iu.X.get=function(){return 0},Iu.Y.get=function(){return 1},Iu.Z.get=function(){return 2},Object.defineProperties(bu,Iu);var Nu=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 _u("only 2 or 3 dimensions may be specified");this._dimensionsToTest=e}};Nu.prototype.compare=function(t,e){var n=t,r=e,i=Nu.compare(n.x,r.x);if(0!==i)return i;var o=Nu.compare(n.y,r.y);return 0!==o?o:this._dimensionsToTest<=2?0:Nu.compare(n.z,r.z)},Nu.prototype.interfaces_=function(){return[wu]},Nu.prototype.getClass=function(){return Nu},Nu.compare=function(t,e){return t<e?-1:t>e?1:mu.isNaN(t)?mu.isNaN(e)?0:-1:mu.isNaN(e)?1:0};var Cu=function(){};Cu.prototype.create=function(){},Cu.prototype.interfaces_=function(){return[]},Cu.prototype.getClass=function(){return Cu};var Su=function(){},Mu={INTERIOR:{configurable:!0},BOUNDARY:{configurable:!0},EXTERIOR:{configurable:!0},NONE:{configurable:!0}};Su.prototype.interfaces_=function(){return[]},Su.prototype.getClass=function(){return Su},Su.toLocationSymbol=function(t){switch(t){case Su.EXTERIOR:return"e";case Su.BOUNDARY:return"b";case Su.INTERIOR:return"i";case Su.NONE:return"-"}throw new _u("Unknown location value: "+t)},Mu.INTERIOR.get=function(){return 0},Mu.BOUNDARY.get=function(){return 1},Mu.EXTERIOR.get=function(){return 2},Mu.NONE.get=function(){return-1},Object.defineProperties(Su,Mu);var Lu=function(t,e){return t.interfaces_&&t.interfaces_().indexOf(e)>-1},Pu=function(){},Ou={LOG_10:{configurable:!0}};Pu.prototype.interfaces_=function(){return[]},Pu.prototype.getClass=function(){return Pu},Pu.log10=function(t){var e=Math.log(t);return mu.isInfinite(e)||mu.isNaN(e)?e:e/Pu.LOG_10},Pu.min=function(t,e,n,r){var i=t;return e<i&&(i=e),n<i&&(i=n),r<i&&(i=r),i},Pu.clamp=function(){if("number"==typeof arguments[2]&&"number"==typeof arguments[0]&&"number"==typeof arguments[1]){var t=arguments[0],e=arguments[1],n=arguments[2];return t<e?e:t>n?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 r<i?i:r>o?o:r}},Pu.wrap=function(t,e){return t<0?e- -t%e:t%e},Pu.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}},Pu.average=function(t,e){return(t+e)/2},Ou.LOG_10.get=function(){return Math.log(10)},Object.defineProperties(Pu,Ou);var Ru=function(t){this.str=t};Ru.prototype.append=function(t){this.str+=t},Ru.prototype.setCharAt=function(t,e){this.str=this.str.substr(0,t)+e+this.str.substr(t+1)},Ru.prototype.toString=function(t){return this.str};var Tu=function(t){this.value=t};Tu.prototype.intValue=function(){return this.value},Tu.prototype.compareTo=function(t){return this.value<t?-1:this.value>t?1:0},Tu.isNaN=function(t){return Number.isNaN(t)};var Au=function(){};Au.isWhitespace=function(t){return t<=32&&t>=0||127===t},Au.toUpperCase=function(t){return t.toUpperCase()};var Du=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)}},Fu={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}};Du.prototype.le=function(t){return(this._hi<t._hi||this._hi===t._hi)&&this._lo<=t._lo},Du.prototype.extractSignificantDigits=function(t,e){var n=this.abs(),r=Du.magnitude(n._hi),i=Du.TEN.pow(r);(n=n.divide(i)).gt(Du.TEN)?(n=n.divide(Du.TEN),r+=1):n.lt(Du.ONE)&&(n=n.multiply(Du.TEN),r-=1);for(var o=r+1,s=new Ru,a=Du.MAX_PRINT_DIGITS-1,u=0;u<=a;u++){t&&u===o&&s.append(".");var c=Math.trunc(n._hi);if(c<0)break;var h=!1,l=0;c>9?(h=!0,l="9"):l="0"+c,s.append(l),n=n.subtract(Du.valueOf(c)).multiply(Du.TEN),h&&n.selfAdd(Du.TEN);var p=!0,f=Du.magnitude(n._hi);if(f<0&&Math.abs(f)>=a-u&&(p=!1),!p)break}return e[0]=r,s.toString()},Du.prototype.sqr=function(){return this.multiply(this)},Du.prototype.doubleValue=function(){return this._hi+this._lo},Du.prototype.subtract=function(){if(arguments[0]instanceof Du){var t=arguments[0];return this.add(t.negate())}if("number"==typeof arguments[0]){var e=arguments[0];return this.add(-e)}},Du.prototype.equals=function(){if(1===arguments.length){var t=arguments[0];return this._hi===t._hi&&this._lo===t._lo}},Du.prototype.isZero=function(){return 0===this._hi&&0===this._lo},Du.prototype.selfSubtract=function(){if(arguments[0]instanceof Du){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)}},Du.prototype.getSpecialNumberString=function(){return this.isZero()?"0.0":this.isNaN()?"NaN ":null},Du.prototype.min=function(t){return this.le(t)?this:t},Du.prototype.selfDivide=function(){if(1===arguments.length){if(arguments[0]instanceof Du){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,c=null,h=null,l=null;return u=this._hi/n,l=(i=(c=Du.SPLIT*u)-(i=c-u))*(s=(l=Du.SPLIT*n)-(s=l-n))-(h=u*n)+i*(a=n-s)+(o=u-i)*s+o*a,l=u+(c=(this._hi-h-l+this._lo-u*r)/n),this._hi=l,this._lo=u-l+c,this}},Du.prototype.dump=function(){return"DD<"+this._hi+", "+this._lo+">"},Du.prototype.divide=function(){if(arguments[0]instanceof Du){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=Du.SPLIT*o)-(e=s-o)),u=e*(r=(u=Du.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 Du(u=o+s,o-u+s)}if("number"==typeof arguments[0]){var c=arguments[0];return mu.isNaN(c)?Du.createNaN():Du.copy(this).selfDivide(c,0)}},Du.prototype.ge=function(t){return(this._hi>t._hi||this._hi===t._hi)&&this._lo>=t._lo},Du.prototype.pow=function(t){if(0===t)return Du.valueOf(1);var e=new Du(this),n=Du.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},Du.prototype.ceil=function(){if(this.isNaN())return Du.NaN;var t=Math.ceil(this._hi),e=0;return t===this._hi&&(e=Math.ceil(this._lo)),new Du(t,e)},Du.prototype.compareTo=function(t){var e=t;return this._hi<e._hi?-1:this._hi>e._hi?1:this._lo<e._lo?-1:this._lo>e._lo?1:0},Du.prototype.rint=function(){return this.isNaN()?this:this.add(.5).floor()},Du.prototype.setValue=function(){if(arguments[0]instanceof Du){var t=arguments[0];return this.init(t),this}if("number"==typeof arguments[0]){var e=arguments[0];return this.init(e),this}},Du.prototype.max=function(t){return this.ge(t)?this:t},Du.prototype.sqrt=function(){if(this.isZero())return Du.valueOf(0);if(this.isNegative())return Du.NaN;var t=1/Math.sqrt(this._hi),e=this._hi*t,n=Du.valueOf(e),r=this.subtract(n.sqr())._hi*(.5*t);return n.add(r)},Du.prototype.selfAdd=function(){if(1===arguments.length){if(arguments[0]instanceof Du){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],c=arguments[1],h=null,l=null,p=null,f=null,g=null,d=null,y=null;f=this._hi+u,l=this._lo+c,g=f-(d=f-this._hi),p=l-(y=l-this._lo);var _=(h=f+(d=(g=u-d+(this._hi-g))+l))+(d=(p=c-y+(this._lo-p))+(d+(f-h))),m=d+(h-_);return this._hi=_,this._lo=m,this}},Du.prototype.selfMultiply=function(){if(1===arguments.length){if(arguments[0]instanceof Du){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,c=null;i=(u=Du.SPLIT*this._hi)-this._hi,c=Du.SPLIT*n,i=u-i,o=this._hi-i,s=c-n;var h=(u=this._hi*n)+(c=i*(s=c-s)-u+i*(a=n-s)+o*s+o*a+(this._hi*r+this._lo*n)),l=c+(i=u-h);return this._hi=h,this._lo=l,this}},Du.prototype.selfSqr=function(){return this.selfMultiply(this)},Du.prototype.floor=function(){if(this.isNaN())return Du.NaN;var t=Math.floor(this._hi),e=0;return t===this._hi&&(e=Math.floor(this._lo)),new Du(t,e)},Du.prototype.negate=function(){return this.isNaN()?this:new Du(-this._hi,-this._lo)},Du.prototype.clone=function(){},Du.prototype.multiply=function(){if(arguments[0]instanceof Du){var t=arguments[0];return t.isNaN()?Du.createNaN():Du.copy(this).selfMultiply(t)}if("number"==typeof arguments[0]){var e=arguments[0];return mu.isNaN(e)?Du.createNaN():Du.copy(this).selfMultiply(e,0)}},Du.prototype.isNaN=function(){return mu.isNaN(this._hi)},Du.prototype.intValue=function(){return Math.trunc(this._hi)},Du.prototype.toString=function(){var t=Du.magnitude(this._hi);return t>=-3&&t<=20?this.toStandardNotation():this.toSciNotation()},Du.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."+Du.stringOfChar("0",-r)+n;else if(-1===n.indexOf(".")){var o=r-n.length;i=n+Du.stringOfChar("0",o)+".0"}return this.isNegative()?"-"+i:i},Du.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=Du.SPLIT*i)-(t=o-i)),n=(a=Du.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 Du(u,i-u+o)},Du.prototype.toSciNotation=function(){if(this.isZero())return Du.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=Du.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},Du.prototype.abs=function(){return this.isNaN()?Du.NaN:this.isNegative()?this.negate():new Du(this)},Du.prototype.isPositive=function(){return(this._hi>0||0===this._hi)&&this._lo>0},Du.prototype.lt=function(t){return(this._hi<t._hi||this._hi===t._hi)&&this._lo<t._lo},Du.prototype.add=function(){if(arguments[0]instanceof Du){var t=arguments[0];return Du.copy(this).selfAdd(t)}if("number"==typeof arguments[0]){var e=arguments[0];return Du.copy(this).selfAdd(e)}},Du.prototype.init=function(){if(1===arguments.length){if("number"==typeof arguments[0]){var t=arguments[0];this._hi=t,this._lo=0}else if(arguments[0]instanceof Du){var e=arguments[0];this._hi=e._hi,this._lo=e._lo}}else if(2===arguments.length){var n=arguments[0],r=arguments[1];this._hi=n,this._lo=r}},Du.prototype.gt=function(t){return(this._hi>t._hi||this._hi===t._hi)&&this._lo>t._lo},Du.prototype.isNegative=function(){return(this._hi<0||0===this._hi)&&this._lo<0},Du.prototype.trunc=function(){return this.isNaN()?Du.NaN:this.isPositive()?this.floor():this.ceil()},Du.prototype.signum=function(){return this._hi>0?1:this._hi<0?-1:this._lo>0?1:this._lo<0?-1:0},Du.prototype.interfaces_=function(){return[Li,xu,Eu]},Du.prototype.getClass=function(){return Du},Du.sqr=function(t){return Du.valueOf(t).selfMultiply(t)},Du.valueOf=function(){if("string"==typeof arguments[0]){var t=arguments[0];return Du.parse(t)}if("number"==typeof arguments[0])return new Du(arguments[0])},Du.sqrt=function(t){return Du.valueOf(t).sqrt()},Du.parse=function(t){for(var e=0,n=t.length;Au.isWhitespace(t.charAt(e));)e++;var r=!1;if(e<n){var i=t.charAt(e);"-"!==i&&"+"!==i||(e++,"-"===i&&(r=!0))}for(var o=new Du,s=0,a=0,u=0;!(e>=n);){var c=t.charAt(e);if(e++,Au.isDigit(c)){var h=c-"0";o.selfMultiply(Du.TEN),o.selfAdd(h),s++}else{if("."!==c){if("e"===c||"E"===c){var l=t.substring(e);try{u=Tu.parseInt(l)}catch(e){throw e instanceof Error?new Error("Invalid exponent "+l+" in string "+t):e}break}throw new Error("Unexpected character '"+c+"' 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 g=Du.TEN.pow(f);p=o.divide(g)}else if(f<0){var d=Du.TEN.pow(-f);p=o.multiply(d)}return r?p.negate():p},Du.createNaN=function(){return new Du(mu.NaN,mu.NaN)},Du.copy=function(t){return new Du(t)},Du.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},Du.stringOfChar=function(t,e){for(var n=new Ru,r=0;r<e;r++)n.append(t);return n.toString()},Fu.PI.get=function(){return new Du(3.141592653589793,12246467991473532e-32)},Fu.TWO_PI.get=function(){return new Du(6.283185307179586,24492935982947064e-32)},Fu.PI_2.get=function(){return new Du(1.5707963267948966,6123233995736766e-32)},Fu.E.get=function(){return new Du(2.718281828459045,14456468917292502e-32)},Fu.NaN.get=function(){return new Du(mu.NaN,mu.NaN)},Fu.EPS.get=function(){return 123259516440783e-46},Fu.SPLIT.get=function(){return 134217729},Fu.MAX_PRINT_DIGITS.get=function(){return 32},Fu.TEN.get=function(){return Du.valueOf(10)},Fu.ONE.get=function(){return Du.valueOf(1)},Fu.SCI_NOT_EXPONENT_CHAR.get=function(){return"E"},Fu.SCI_NOT_ZERO.get=function(){return"0.0E0"},Object.defineProperties(Du,Fu);var qu=function(){},Gu={DP_SAFE_EPSILON:{configurable:!0}};qu.prototype.interfaces_=function(){return[]},qu.prototype.getClass=function(){return qu},qu.orientationIndex=function(t,e,n){var r=qu.orientationIndexFilter(t,e,n);if(r<=1)return r;var i=Du.valueOf(e.x).selfAdd(-t.x),o=Du.valueOf(e.y).selfAdd(-t.y),s=Du.valueOf(n.x).selfAdd(-e.x),a=Du.valueOf(n.y).selfAdd(-e.y);return i.selfMultiply(a).selfSubtract(o.selfMultiply(s)).signum()},qu.signOfDet2x2=function(t,e,n,r){return t.multiply(r).selfSubtract(e.multiply(n)).signum()},qu.intersection=function(t,e,n,r){var i=Du.valueOf(r.y).selfSubtract(n.y).selfMultiply(Du.valueOf(e.x).selfSubtract(t.x)),o=Du.valueOf(r.x).selfSubtract(n.x).selfMultiply(Du.valueOf(e.y).selfSubtract(t.y)),s=i.subtract(o),a=Du.valueOf(r.x).selfSubtract(n.x).selfMultiply(Du.valueOf(t.y).selfSubtract(n.y)),u=Du.valueOf(r.y).selfSubtract(n.y).selfMultiply(Du.valueOf(t.x).selfSubtract(n.x)),c=a.subtract(u).selfDivide(s).doubleValue(),h=Du.valueOf(t.x).selfAdd(Du.valueOf(e.x).selfSubtract(t.x).selfMultiply(c)).doubleValue(),l=Du.valueOf(e.x).selfSubtract(t.x).selfMultiply(Du.valueOf(t.y).selfSubtract(n.y)),p=Du.valueOf(e.y).selfSubtract(t.y).selfMultiply(Du.valueOf(t.x).selfSubtract(n.x)),f=l.subtract(p).selfDivide(s).doubleValue(),g=Du.valueOf(n.y).selfAdd(Du.valueOf(r.y).selfSubtract(n.y).selfMultiply(f)).doubleValue();return new bu(h,g)},qu.orientationIndexFilter=function(t,e,n){var r=null,i=(t.x-n.x)*(e.y-n.y),o=(t.y-n.y)*(e.x-n.x),s=i-o;if(i>0){if(o<=0)return qu.signum(s);r=i+o}else{if(!(i<0))return qu.signum(s);if(o>=0)return qu.signum(s);r=-i-o}var a=qu.DP_SAFE_EPSILON*r;return s>=a||-s>=a?qu.signum(s):2},qu.signum=function(t){return t>0?1:t<0?-1:0},Gu.DP_SAFE_EPSILON.get=function(){return 1e-15},Object.defineProperties(qu,Gu);var Bu=function(){},ku={X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0},M:{configurable:!0}};ku.X.get=function(){return 0},ku.Y.get=function(){return 1},ku.Z.get=function(){return 2},ku.M.get=function(){return 3},Bu.prototype.setOrdinate=function(t,e,n){},Bu.prototype.size=function(){},Bu.prototype.getOrdinate=function(t,e){},Bu.prototype.getCoordinate=function(){},Bu.prototype.getCoordinateCopy=function(t){},Bu.prototype.getDimension=function(){},Bu.prototype.getX=function(t){},Bu.prototype.clone=function(){},Bu.prototype.expandEnvelope=function(t){},Bu.prototype.copy=function(){},Bu.prototype.getY=function(t){},Bu.prototype.toCoordinateArray=function(){},Bu.prototype.interfaces_=function(){return[Eu]},Bu.prototype.getClass=function(){return Bu},Object.defineProperties(Bu,ku);var zu=function(){},ju=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}(zu),Xu=function(){};Xu.arraycopy=function(t,e,n,r,i){for(var o=0,s=e;s<e+i;s++)n[r+o]=t[s],o++},Xu.getProperty=function(t){return{"line.separator":"\n"}[t]};var Uu=function t(){if(this.x=null,this.y=null,this.w=null,0===arguments.length)this.x=0,this.y=0,this.w=1;else if(1===arguments.length){var e=arguments[0];this.x=e.x,this.y=e.y,this.w=1}else if(2===arguments.length){if("number"==typeof arguments[0]&&"number"==typeof arguments[1]){var n=arguments[0],r=arguments[1];this.x=n,this.y=r,this.w=1}else if(arguments[0]instanceof t&&arguments[1]instanceof t){var i=arguments[0],o=arguments[1];this.x=i.y*o.w-o.y*i.w,this.y=o.x*i.w-i.x*o.w,this.w=i.x*o.y-o.x*i.y}else if(arguments[0]instanceof bu&&arguments[1]instanceof bu){var s=arguments[0],a=arguments[1];this.x=s.y-a.y,this.y=a.x-s.x,this.w=s.x*a.y-a.x*s.y}}else if(3===arguments.length){var u=arguments[0],c=arguments[1],h=arguments[2];this.x=u,this.y=c,this.w=h}else if(4===arguments.length){var l=arguments[0],p=arguments[1],f=arguments[2],g=arguments[3],d=l.y-p.y,y=p.x-l.x,_=l.x*p.y-p.x*l.y,m=f.y-g.y,v=g.x-f.x,x=f.x*g.y-g.x*f.y;this.x=y*x-v*_,this.y=m*_-d*x,this.w=d*v-m*y}};Uu.prototype.getY=function(){var t=this.y/this.w;if(mu.isNaN(t)||mu.isInfinite(t))throw new ju;return t},Uu.prototype.getX=function(){var t=this.x/this.w;if(mu.isNaN(t)||mu.isInfinite(t))throw new ju;return t},Uu.prototype.getCoordinate=function(){var t=new bu;return t.x=this.getX(),t.y=this.getY(),t},Uu.prototype.interfaces_=function(){return[]},Uu.prototype.getClass=function(){return Uu},Uu.intersection=function(t,e,n,r){var i=t.y-e.y,o=e.x-t.x,s=t.x*e.y-e.x*t.y,a=n.y-r.y,u=r.x-n.x,c=n.x*r.y-r.x*n.y,h=i*u-a*o,l=(o*c-u*s)/h,p=(a*s-i*c)/h;if(mu.isNaN(l)||mu.isInfinite(l)||mu.isNaN(p)||mu.isInfinite(p))throw new ju;return new bu(l,p)};var Yu=function t(){if(this._minx=null,this._maxx=null,this._miny=null,this._maxy=null,0===arguments.length)this.init();else if(1===arguments.length){if(arguments[0]instanceof bu){var e=arguments[0];this.init(e.x,e.x,e.y,e.y)}else if(arguments[0]instanceof t){var n=arguments[0];this.init(n)}}else if(2===arguments.length){var r=arguments[0],i=arguments[1];this.init(r.x,i.x,r.y,i.y)}else if(4===arguments.length){var o=arguments[0],s=arguments[1],a=arguments[2],u=arguments[3];this.init(o,s,a,u)}},Vu={serialVersionUID:{configurable:!0}};Yu.prototype.getArea=function(){return this.getWidth()*this.getHeight()},Yu.prototype.equals=function(t){if(!(t instanceof Yu))return!1;var e=t;return this.isNull()?e.isNull():this._maxx===e.getMaxX()&&this._maxy===e.getMaxY()&&this._minx===e.getMinX()&&this._miny===e.getMinY()},Yu.prototype.intersection=function(t){if(this.isNull()||t.isNull()||!this.intersects(t))return new Yu;var e=this._minx>t._minx?this._minx:t._minx,n=this._miny>t._miny?this._miny:t._miny,r=this._maxx<t._maxx?this._maxx:t._maxx,i=this._maxy<t._maxy?this._maxy:t._maxy;return new Yu(e,r,n,i)},Yu.prototype.isNull=function(){return this._maxx<this._minx},Yu.prototype.getMaxX=function(){return this._maxx},Yu.prototype.covers=function(){if(1===arguments.length){if(arguments[0]instanceof bu){var t=arguments[0];return this.covers(t.x,t.y)}if(arguments[0]instanceof Yu){var e=arguments[0];return!this.isNull()&&!e.isNull()&&e.getMinX()>=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}},Yu.prototype.intersects=function(){if(1===arguments.length){if(arguments[0]instanceof Yu){var t=arguments[0];return!this.isNull()&&!t.isNull()&&!(t._minx>this._maxx||t._maxx<this._minx||t._miny>this._maxy||t._maxy<this._miny)}if(arguments[0]instanceof bu){var e=arguments[0];return this.intersects(e.x,e.y)}}else if(2===arguments.length){var n=arguments[0],r=arguments[1];return!this.isNull()&&!(n>this._maxx||n<this._minx||r>this._maxy||r<this._miny)}},Yu.prototype.getMinY=function(){return this._miny},Yu.prototype.getMinX=function(){return this._minx},Yu.prototype.expandToInclude=function(){if(1===arguments.length){if(arguments[0]instanceof bu){var t=arguments[0];this.expandToInclude(t.x,t.y)}else if(arguments[0]instanceof Yu){var e=arguments[0];if(e.isNull())return null;this.isNull()?(this._minx=e.getMinX(),this._maxx=e.getMaxX(),this._miny=e.getMinY(),this._maxy=e.getMaxY()):(e._minx<this._minx&&(this._minx=e._minx),e._maxx>this._maxx&&(this._maxx=e._maxx),e._miny<this._miny&&(this._miny=e._miny),e._maxy>this._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):(n<this._minx&&(this._minx=n),n>this._maxx&&(this._maxx=n),r<this._miny&&(this._miny=r),r>this._maxy&&(this._maxy=r))}},Yu.prototype.minExtent=function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return t<e?t:e},Yu.prototype.getWidth=function(){return this.isNull()?0:this._maxx-this._minx},Yu.prototype.compareTo=function(t){var e=t;return this.isNull()?e.isNull()?0:-1:e.isNull()?1:this._minx<e._minx?-1:this._minx>e._minx?1:this._miny<e._miny?-1:this._miny>e._miny?1:this._maxx<e._maxx?-1:this._maxx>e._maxx?1:this._maxy<e._maxy?-1:this._maxy>e._maxy?1:0},Yu.prototype.translate=function(t,e){if(this.isNull())return null;this.init(this.getMinX()+t,this.getMaxX()+t,this.getMinY()+e,this.getMaxY()+e)},Yu.prototype.toString=function(){return"Env["+this._minx+" : "+this._maxx+", "+this._miny+" : "+this._maxy+"]"},Yu.prototype.setToNull=function(){this._minx=0,this._maxx=-1,this._miny=0,this._maxy=-1},Yu.prototype.getHeight=function(){return this.isNull()?0:this._maxy-this._miny},Yu.prototype.maxExtent=function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return t>e?t:e},Yu.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()}},Yu.prototype.contains=function(){if(1===arguments.length){if(arguments[0]instanceof Yu){var t=arguments[0];return this.covers(t)}if(arguments[0]instanceof bu){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)}},Yu.prototype.centre=function(){return this.isNull()?null:new bu((this.getMinX()+this.getMaxX())/2,(this.getMinY()+this.getMaxY())/2)},Yu.prototype.init=function(){if(0===arguments.length)this.setToNull();else if(1===arguments.length){if(arguments[0]instanceof bu){var t=arguments[0];this.init(t.x,t.x,t.y,t.y)}else if(arguments[0]instanceof Yu){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];i<o?(this._minx=i,this._maxx=o):(this._minx=o,this._maxx=i),s<a?(this._miny=s,this._maxy=a):(this._miny=a,this._maxy=s)}},Yu.prototype.getMaxY=function(){return this._maxy},Yu.prototype.distance=function(t){if(this.intersects(t))return 0;var e=0;this._maxx<t._minx?e=t._minx-this._maxx:this._minx>t._maxx&&(e=this._minx-t._maxx);var n=0;return this._maxy<t._miny?n=t._miny-this._maxy:this._miny>t._maxy&&(n=this._miny-t._maxy),0===e?n:0===n?e:Math.sqrt(e*e+n*n)},Yu.prototype.hashCode=function(){var t=17;return 37*(t=37*(t=37*(t=37*t+bu.hashCode(this._minx))+bu.hashCode(this._maxx))+bu.hashCode(this._miny))+bu.hashCode(this._maxy)},Yu.prototype.interfaces_=function(){return[xu,Li]},Yu.prototype.getClass=function(){return Yu},Yu.intersects=function(){if(3===arguments.length){var t=arguments[0],e=arguments[1],n=arguments[2];return n.x>=(t.x<e.x?t.x:e.x)&&n.x<=(t.x>e.x?t.x:e.x)&&n.y>=(t.y<e.y?t.y:e.y)&&n.y<=(t.y>e.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),c=Math.min(r.x,i.x),h=Math.max(r.x,i.x);return!(c>u)&&!(h<a)&&(a=Math.min(o.y,s.y),u=Math.max(o.y,s.y),c=Math.min(r.y,i.y),h=Math.max(r.y,i.y),!(c>u)&&!(h<a))}},Vu.serialVersionUID.get=function(){return 0x51845cd552189800},Object.defineProperties(Yu,Vu);var Hu={typeStr:/^\s*(\w+)\s*\(\s*(.*)\s*\)\s*$/,emptyTypeStr:/^\s*(\w+)\s*EMPTY\s*$/,spaces:/\s+/,parenComma:/\)\s*,\s*\(/,doubleParenComma:/\)\s*\)\s*,\s*\(\s*\(/,trimParens:/^\s*\(?(.*?)\)?\s*$/},Wu=function(t){this.geometryFactory=t||new _h};Wu.prototype.read=function(t){var e,n,r;t=t.replace(/[\n\r]/g," ");var i=Hu.typeStr.exec(t);if(-1!==t.search("EMPTY")&&((i=Hu.emptyTypeStr.exec(t))[2]=void 0),i&&(n=i[1].toLowerCase(),r=i[2],Zu[n]&&(e=Zu[n].apply(this,[r]))),void 0===e)throw new Error("Could not parse WKT "+t);return e},Wu.prototype.write=function(t){return this.extractGeometry(t)},Wu.prototype.extractGeometry=function(t){var e=t.getGeometryType().toLowerCase();if(!Ju[e])return null;var n=e.toUpperCase();return t.isEmpty()?n+" EMPTY":n+"("+Ju[e].apply(this,[t])+")"};var Ju={coordinate:function(t){return t.x+" "+t.y},point:function(t){return Ju.coordinate.call(this,t._coordinates._coordinates[0])},multipoint:function(t){for(var e=[],n=0,r=t._geometries.length;n<r;++n)e.push("("+Ju.point.apply(this,[t._geometries[n]])+")");return e.join(",")},linestring:function(t){for(var e=[],n=0,r=t._points._coordinates.length;n<r;++n)e.push(Ju.coordinate.apply(this,[t._points._coordinates[n]]));return e.join(",")},linearring:function(t){for(var e=[],n=0,r=t._points._coordinates.length;n<r;++n)e.push(Ju.coordinate.apply(this,[t._points._coordinates[n]]));return e.join(",")},multilinestring:function(t){for(var e=[],n=0,r=t._geometries.length;n<r;++n)e.push("("+Ju.linestring.apply(this,[t._geometries[n]])+")");return e.join(",")},polygon:function(t){var e=[];e.push("("+Ju.linestring.apply(this,[t._shell])+")");for(var n=0,r=t._holes.length;n<r;++n)e.push("("+Ju.linestring.apply(this,[t._holes[n]])+")");return e.join(",")},multipolygon:function(t){for(var e=[],n=0,r=t._geometries.length;n<r;++n)e.push("("+Ju.polygon.apply(this,[t._geometries[n]])+")");return e.join(",")},geometrycollection:function(t){for(var e=[],n=0,r=t._geometries.length;n<r;++n)e.push(this.extractGeometry(t._geometries[n]));return e.join(",")}},Zu={point:function(t){if(void 0===t)return this.geometryFactory.createPoint();var e=t.trim().split(Hu.spaces);return this.geometryFactory.createPoint(new bu(Number.parseFloat(e[0]),Number.parseFloat(e[1])))},multipoint:function(t){if(void 0===t)return this.geometryFactory.createMultiPoint();for(var e,n=t.trim().split(","),r=[],i=0,o=n.length;i<o;++i)e=n[i].replace(Hu.trimParens,"$1"),r.push(Zu.point.apply(this,[e]));return this.geometryFactory.createMultiPoint(r)},linestring:function(t){if(void 0===t)return this.geometryFactory.createLineString();for(var e,n=t.trim().split(","),r=[],i=0,o=n.length;i<o;++i)e=n[i].trim().split(Hu.spaces),r.push(new bu(Number.parseFloat(e[0]),Number.parseFloat(e[1])));return this.geometryFactory.createLineString(r)},linearring:function(t){if(void 0===t)return this.geometryFactory.createLinearRing();for(var e,n=t.trim().split(","),r=[],i=0,o=n.length;i<o;++i)e=n[i].trim().split(Hu.spaces),r.push(new bu(Number.parseFloat(e[0]),Number.parseFloat(e[1])));return this.geometryFactory.createLinearRing(r)},multilinestring:function(t){if(void 0===t)return this.geometryFactory.createMultiLineString();for(var e,n=t.trim().split(Hu.parenComma),r=[],i=0,o=n.length;i<o;++i)e=n[i].replace(Hu.trimParens,"$1"),r.push(Zu.linestring.apply(this,[e]));return this.geometryFactory.createMultiLineString(r)},polygon:function(t){if(void 0===t)return this.geometryFactory.createPolygon();for(var e,n,r,i,o=t.trim().split(Hu.parenComma),s=[],a=0,u=o.length;a<u;++a)e=o[a].replace(Hu.trimParens,"$1"),n=Zu.linestring.apply(this,[e]),r=this.geometryFactory.createLinearRing(n._points),0===a?i=r:s.push(r);return this.geometryFactory.createPolygon(i,s)},multipolygon:function(t){if(void 0===t)return this.geometryFactory.createMultiPolygon();for(var e,n=t.trim().split(Hu.doubleParenComma),r=[],i=0,o=n.length;i<o;++i)e=n[i].replace(Hu.trimParens,"$1"),r.push(Zu.polygon.apply(this,[e]));return this.geometryFactory.createMultiPolygon(r)},geometrycollection:function(t){if(void 0===t)return this.geometryFactory.createGeometryCollection();for(var e=(t=t.replace(/,\s*([A-Za-z])/g,"|$1")).trim().split("|"),n=[],r=0,i=e.length;r<i;++r)n.push(this.read(e[r]));return this.geometryFactory.createGeometryCollection(n)}},Ku=function(t){this.parser=new Wu(t)};Ku.prototype.write=function(t){return this.parser.write(t)},Ku.toLineString=function(t,e){if(2!==arguments.length)throw new Error("Not implemented");return"LINESTRING ( "+t.x+" "+t.y+", "+e.x+" "+e.y+" )"};var Qu=function(t){function e(e){t.call(this,e),this.name="RuntimeException",this.message=e,this.stack=(new t).stack}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Error),$u=function(t){function e(){if(t.call(this),0===arguments.length)t.call(this);else if(1===arguments.length){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.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Qu),tc=function(){};tc.prototype.interfaces_=function(){return[]},tc.prototype.getClass=function(){return tc},tc.shouldNeverReachHere=function(){if(0===arguments.length)tc.shouldNeverReachHere(null);else if(1===arguments.length){var t=arguments[0];throw new $u("Should never reach here"+(null!==t?": "+t:""))}},tc.isTrue=function(){var t,e;if(1===arguments.length)t=arguments[0],tc.isTrue(t,null);else if(2===arguments.length&&(e=arguments[1],!(t=arguments[0])))throw null===e?new $u:new $u(e)},tc.equals=function(){var t,e,n;if(2===arguments.length)t=arguments[0],e=arguments[1],tc.equals(t,e,null);else if(3===arguments.length&&(t=arguments[0],n=arguments[2],!(e=arguments[1]).equals(t)))throw new $u("Expected "+t+" but encountered "+e+(null!==n?": "+n:""))};var ec=function(){this._result=null,this._inputLines=Array(2).fill().map((function(){return Array(2)})),this._intPt=new Array(2).fill(null),this._intLineIndex=null,this._isProper=null,this._pa=null,this._pb=null,this._precisionModel=null,this._intPt[0]=new bu,this._intPt[1]=new bu,this._pa=this._intPt[0],this._pb=this._intPt[1],this._result=0},nc={DONT_INTERSECT:{configurable:!0},DO_INTERSECT:{configurable:!0},COLLINEAR:{configurable:!0},NO_INTERSECTION:{configurable:!0},POINT_INTERSECTION:{configurable:!0},COLLINEAR_INTERSECTION:{configurable:!0}};ec.prototype.getIndexAlongSegment=function(t,e){return this.computeIntLineIndex(),this._intLineIndex[t][e]},ec.prototype.getTopologySummary=function(){var t=new Ru;return this.isEndPoint()&&t.append(" endpoint"),this._isProper&&t.append(" proper"),this.isCollinear()&&t.append(" collinear"),t.toString()},ec.prototype.computeIntersection=function(t,e,n,r){this._inputLines[0][0]=t,this._inputLines[0][1]=e,this._inputLines[1][0]=n,this._inputLines[1][1]=r,this._result=this.computeIntersect(t,e,n,r)},ec.prototype.getIntersectionNum=function(){return this._result},ec.prototype.computeIntLineIndex=function(){if(0===arguments.length)null===this._intLineIndex&&(this._intLineIndex=Array(2).fill().map((function(){return Array(2)})),this.computeIntLineIndex(0),this.computeIntLineIndex(1));else if(1===arguments.length){var t=arguments[0];this.getEdgeDistance(t,0)>this.getEdgeDistance(t,1)?(this._intLineIndex[t][0]=0,this._intLineIndex[t][1]=1):(this._intLineIndex[t][0]=1,this._intLineIndex[t][1]=0)}},ec.prototype.isProper=function(){return this.hasIntersection()&&this._isProper},ec.prototype.setPrecisionModel=function(t){this._precisionModel=t},ec.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;e<this._result;e++)if(!this._intPt[e].equals2D(this._inputLines[t][0])&&!this._intPt[e].equals2D(this._inputLines[t][1]))return!0;return!1}},ec.prototype.getIntersection=function(t){return this._intPt[t]},ec.prototype.isEndPoint=function(){return this.hasIntersection()&&!this._isProper},ec.prototype.hasIntersection=function(){return this._result!==ec.NO_INTERSECTION},ec.prototype.getEdgeDistance=function(t,e){return ec.computeEdgeDistance(this._intPt[e],this._inputLines[t][0],this._inputLines[t][1])},ec.prototype.isCollinear=function(){return this._result===ec.COLLINEAR_INTERSECTION},ec.prototype.toString=function(){return Ku.toLineString(this._inputLines[0][0],this._inputLines[0][1])+" - "+Ku.toLineString(this._inputLines[1][0],this._inputLines[1][1])+this.getTopologySummary()},ec.prototype.getEndpoint=function(t,e){return this._inputLines[t][e]},ec.prototype.isIntersection=function(t){for(var e=0;e<this._result;e++)if(this._intPt[e].equals2D(t))return!0;return!1},ec.prototype.getIntersectionAlongSegment=function(t,e){return this.computeIntLineIndex(),this._intPt[this._intLineIndex[t][e]]},ec.prototype.interfaces_=function(){return[]},ec.prototype.getClass=function(){return ec},ec.computeEdgeDistance=function(t,e,n){var r=Math.abs(n.x-e.x),i=Math.abs(n.y-e.y),o=-1;if(t.equals(e))o=0;else if(t.equals(n))o=r>i?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 tc.isTrue(!(0===o&&!t.equals(e)),"Bad distance calculation"),o},ec.nonRobustComputeEdgeDistance=function(t,e,n){var r=t.x-e.x,i=t.y-e.y,o=Math.sqrt(r*r+i*i);return tc.isTrue(!(0===o&&!t.equals(e)),"Invalid distance calculation"),o},nc.DONT_INTERSECT.get=function(){return 0},nc.DO_INTERSECT.get=function(){return 1},nc.COLLINEAR.get=function(){return 2},nc.NO_INTERSECTION.get=function(){return 0},nc.POINT_INTERSECTION.get=function(){return 1},nc.COLLINEAR_INTERSECTION.get=function(){return 2},Object.defineProperties(ec,nc);var rc=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 Yu(this._inputLines[0][0],this._inputLines[0][1]),n=new Yu(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,Yu.intersects(n,r,e)&&0===sc.orientationIndex(n,r,e)&&0===sc.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=Uu.intersection(t,n,r,i)}catch(s){if(!(s instanceof ju))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 bu(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)<o&&(i=e,o=Math.abs(e)),Math.abs(n)<o&&(i=n,o=Math.abs(n)),Math.abs(r)<o&&(i=r),i},e.prototype.checkDD=function(t,e,n,r,i){var o=qu.intersection(t,e,n,r),s=this.isInSegmentEnvelopes(o);Xu.out.println("DD in env = "+s+" --------------------- "+o),i.distance(o)>1e-4&&Xu.out.println("Distance = "+i.distance(o))},e.prototype.intersectionWithNormalization=function(t,e,n,r){var i=new bu(t),o=new bu(e),s=new bu(n),a=new bu(r),u=new bu;this.normalizeToEnvCentre(i,o,s,a,u);var c=this.safeHCoordinateIntersection(i,o,s,a);return c.x+=u.x,c.y+=u.y,c},e.prototype.computeCollinearIntersection=function(e,n,r,i){var o=Yu.intersects(e,n,r),s=Yu.intersects(e,n,i),a=Yu.intersects(r,i,e),u=Yu.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.x<e.x?t.x:e.x,s=t.y<e.y?t.y:e.y,a=t.x>e.x?t.x:e.x,u=t.y>e.y?t.y:e.y,c=n.x<r.x?n.x:r.x,h=n.y<r.y?n.y:r.y,l=n.x>r.x?n.x:r.x,p=n.y>r.y?n.y:r.y,f=((o>c?o:c)+(a<l?a:l))/2,g=((s>h?s:h)+(u<p?u:p))/2;i.x=f,i.y=g,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.computeIntersect=function(e,n,r,i){if(this._isProper=!1,!Yu.intersects(e,n,r,i))return t.NO_INTERSECTION;var o=sc.orientationIndex(e,n,r),s=sc.orientationIndex(e,n,i);if(o>0&&s>0||o<0&&s<0)return t.NO_INTERSECTION;var a=sc.orientationIndex(r,i,e),u=sc.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 bu(r):0===s?this._intPt[0]=new bu(i):0===a?this._intPt[0]=new bu(e):0===u&&(this._intPt[0]=new bu(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=sc.distancePointLine(t,n,r),s=sc.distancePointLine(e,n,r);return s<o&&(o=s,i=e),(s=sc.distancePointLine(n,t,e))<o&&(o=s,i=n),(s=sc.distancePointLine(r,t,e))<o&&(o=s,i=r),i},e}(ec),ic=function(){};ic.prototype.interfaces_=function(){return[]},ic.prototype.getClass=function(){return ic},ic.orientationIndex=function(t,e,n){var r=e.x-t.x,i=e.y-t.y,o=n.x-e.x,s=n.y-e.y;return ic.signOfDet2x2(r,i,o,s)},ic.signOfDet2x2=function(t,e,n,r){var i=null,o=null,s=null;if(i=1,0===t||0===r)return 0===e||0===n?0:e>0?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(e<r+r)return i}else{if(e>r+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(r<e+e)return-i}else{if(r>e+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 oc=function(){this._p=null,this._crossingCount=0,this._isPointOnSegment=!1;var t=arguments[0];this._p=t};oc.prototype.countSegment=function(t,e){if(t.x<this._p.x&&e.x<this._p.x)return null;if(this._p.x===e.x&&this._p.y===e.y)return this._isPointOnSegment=!0,null;if(t.y===this._p.y&&e.y===this._p.y){var n=t.x,r=e.x;return n>r&&(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=ic.signOfDet2x2(i,o,s,a);if(0===u)return this._isPointOnSegment=!0,null;a<o&&(u=-u),u>0&&this._crossingCount++}},oc.prototype.isPointInPolygon=function(){return this.getLocation()!==Su.EXTERIOR},oc.prototype.getLocation=function(){return this._isPointOnSegment?Su.BOUNDARY:this._crossingCount%2==1?Su.INTERIOR:Su.EXTERIOR},oc.prototype.isOnSegment=function(){return this._isPointOnSegment},oc.prototype.interfaces_=function(){return[]},oc.prototype.getClass=function(){return oc},oc.locatePointInRing=function(){if(arguments[0]instanceof bu&&Lu(arguments[1],Bu)){for(var t=arguments[1],e=new oc(arguments[0]),n=new bu,r=new bu,i=1;i<t.size();i++)if(t.getCoordinate(i,n),t.getCoordinate(i-1,r),e.countSegment(n,r),e.isOnSegment())return e.getLocation();return e.getLocation()}if(arguments[0]instanceof bu&&arguments[1]instanceof Array){for(var o=arguments[1],s=new oc(arguments[0]),a=1;a<o.length;a++){var u=o[a],c=o[a-1];if(s.countSegment(u,c),s.isOnSegment())return s.getLocation()}return s.getLocation()}};var sc=function(){},ac={CLOCKWISE:{configurable:!0},RIGHT:{configurable:!0},COUNTERCLOCKWISE:{configurable:!0},LEFT:{configurable:!0},COLLINEAR:{configurable:!0},STRAIGHT:{configurable:!0}};sc.prototype.interfaces_=function(){return[]},sc.prototype.getClass=function(){return sc},sc.orientationIndex=function(t,e,n){return qu.orientationIndex(t,e,n)},sc.signedArea=function(){if(arguments[0]instanceof Array){var t=arguments[0];if(t.length<3)return 0;for(var e=0,n=t[0].x,r=1;r<t.length-1;r++){var i=t[r].x-n,o=t[r+1].y;e+=i*(t[r-1].y-o)}return e/2}if(Lu(arguments[0],Bu)){var s=arguments[0],a=s.size();if(a<3)return 0;var u=new bu,c=new bu,h=new bu;s.getCoordinate(0,c),s.getCoordinate(1,h);var l=c.x;h.x-=l;for(var p=0,f=1;f<a-1;f++)u.y=c.y,c.x=h.x,c.y=h.y,s.getCoordinate(f+1,h),h.x-=l,p+=c.x*(u.y-h.y);return p/2}},sc.distanceLineLine=function(t,e,n,r){if(t.equals(e))return sc.distancePointLine(t,n,r);if(n.equals(r))return sc.distancePointLine(r,t,e);var i=!1;if(Yu.intersects(t,e,n,r)){var o=(e.x-t.x)*(r.y-n.y)-(e.y-t.y)*(r.x-n.x);if(0===o)i=!0;else{var s=(t.y-n.y)*(r.x-n.x)-(t.x-n.x)*(r.y-n.y),a=((t.y-n.y)*(e.x-t.x)-(t.x-n.x)*(e.y-t.y))/o,u=s/o;(u<0||u>1||a<0||a>1)&&(i=!0)}}else i=!0;return i?Pu.min(sc.distancePointLine(t,n,r),sc.distancePointLine(e,n,r),sc.distancePointLine(n,t,e),sc.distancePointLine(r,t,e)):0},sc.isPointInRing=function(t,e){return sc.locatePointInRing(t,e)!==Su.EXTERIOR},sc.computeLength=function(t){var e=t.size();if(e<=1)return 0;var n=0,r=new bu;t.getCoordinate(0,r);for(var i=r.x,o=r.y,s=1;s<e;s++){t.getCoordinate(s,r);var a=r.x,u=r.y,c=a-i,h=u-o;n+=Math.sqrt(c*c+h*h),i=a,o=u}return n},sc.isCCW=function(t){var e=t.length-1;if(e<3)throw new _u("Ring has fewer than 4 points, so orientation cannot be determined");for(var n=t[0],r=0,i=1;i<=e;i++){var o=t[i];o.y>n.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],c=t[a];if(u.equals2D(n)||c.equals2D(n)||u.equals2D(c))return!1;var h=sc.computeOrientation(u,n,c);return 0===h?u.x>c.x:h>0},sc.locatePointInRing=function(t,e){return oc.locatePointInRing(t,e)},sc.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)},sc.computeOrientation=function(t,e,n){return sc.orientationIndex(t,e,n)},sc.distancePointLine=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];if(0===e.length)throw new _u("Line array must contain at least one vertex");for(var n=t.distance(e[0]),r=0;r<e.length-1;r++){var i=sc.distancePointLine(t,e[r],e[r+1]);i<n&&(n=i)}return n}if(3===arguments.length){var o=arguments[0],s=arguments[1],a=arguments[2];if(s.x===a.x&&s.y===a.y)return o.distance(s);var u=(a.x-s.x)*(a.x-s.x)+(a.y-s.y)*(a.y-s.y),c=((o.x-s.x)*(a.x-s.x)+(o.y-s.y)*(a.y-s.y))/u;if(c<=0)return o.distance(s);if(c>=1)return o.distance(a);var h=((s.y-o.y)*(a.x-s.x)-(s.x-o.x)*(a.y-s.y))/u;return Math.abs(h)*Math.sqrt(u)}},sc.isOnLine=function(t,e){for(var n=new rc,r=1;r<e.length;r++){var i=e[r-1],o=e[r];if(n.computeIntersection(t,i,o),n.hasIntersection())return!0}return!1},ac.CLOCKWISE.get=function(){return-1},ac.RIGHT.get=function(){return sc.CLOCKWISE},ac.COUNTERCLOCKWISE.get=function(){return 1},ac.LEFT.get=function(){return sc.COUNTERCLOCKWISE},ac.COLLINEAR.get=function(){return 0},ac.STRAIGHT.get=function(){return sc.COLLINEAR},Object.defineProperties(sc,ac);var uc=function(){};uc.prototype.filter=function(t){},uc.prototype.interfaces_=function(){return[]},uc.prototype.getClass=function(){return uc};var cc=function(){var t=arguments[0];this._envelope=null,this._factory=null,this._SRID=null,this._userData=null,this._factory=t,this._SRID=t.getSRID()},hc={serialVersionUID:{configurable:!0},SORTINDEX_POINT:{configurable:!0},SORTINDEX_MULTIPOINT:{configurable:!0},SORTINDEX_LINESTRING:{configurable:!0},SORTINDEX_LINEARRING:{configurable:!0},SORTINDEX_MULTILINESTRING:{configurable:!0},SORTINDEX_POLYGON:{configurable:!0},SORTINDEX_MULTIPOLYGON:{configurable:!0},SORTINDEX_GEOMETRYCOLLECTION:{configurable:!0},geometryChangedFilter:{configurable:!0}};cc.prototype.isGeometryCollection=function(){return this.getSortIndex()===cc.SORTINDEX_GEOMETRYCOLLECTION},cc.prototype.getFactory=function(){return this._factory},cc.prototype.getGeometryN=function(t){return this},cc.prototype.getArea=function(){return 0},cc.prototype.isRectangle=function(){return!1},cc.prototype.equals=function(){if(arguments[0]instanceof cc){var t=arguments[0];return null!==t&&this.equalsTopo(t)}if(arguments[0]instanceof Object){var e=arguments[0];if(!(e instanceof cc))return!1;var n=e;return this.equalsExact(n)}},cc.prototype.equalsExact=function(t){return this===t||this.equalsExact(t,0)},cc.prototype.geometryChanged=function(){this.apply(cc.geometryChangedFilter)},cc.prototype.geometryChangedAction=function(){this._envelope=null},cc.prototype.equalsNorm=function(t){return null!==t&&this.norm().equalsExact(t.norm())},cc.prototype.getLength=function(){return 0},cc.prototype.getNumGeometries=function(){return 1},cc.prototype.compareTo=function(){if(1===arguments.length){var t=arguments[0],e=t;return this.getSortIndex()!==e.getSortIndex()?this.getSortIndex()-e.getSortIndex():this.isEmpty()&&e.isEmpty()?0:this.isEmpty()?-1:e.isEmpty()?1:this.compareToSameClass(t)}if(2===arguments.length){var n=arguments[0],r=arguments[1];return this.getSortIndex()!==n.getSortIndex()?this.getSortIndex()-n.getSortIndex():this.isEmpty()&&n.isEmpty()?0:this.isEmpty()?-1:n.isEmpty()?1:this.compareToSameClass(n,r)}},cc.prototype.getUserData=function(){return this._userData},cc.prototype.getSRID=function(){return this._SRID},cc.prototype.getEnvelope=function(){return this.getFactory().toGeometry(this.getEnvelopeInternal())},cc.prototype.checkNotGeometryCollection=function(t){if(t.getSortIndex()===cc.SORTINDEX_GEOMETRYCOLLECTION)throw new _u("This method does not support GeometryCollection arguments")},cc.prototype.equal=function(t,e,n){return 0===n?t.equals(e):t.distance(e)<=n},cc.prototype.norm=function(){var t=this.copy();return t.normalize(),t},cc.prototype.getPrecisionModel=function(){return this._factory.getPrecisionModel()},cc.prototype.getEnvelopeInternal=function(){return null===this._envelope&&(this._envelope=this.computeEnvelopeInternal()),new Yu(this._envelope)},cc.prototype.setSRID=function(t){this._SRID=t},cc.prototype.setUserData=function(t){this._userData=t},cc.prototype.compare=function(t,e){for(var n=t.iterator(),r=e.iterator();n.hasNext()&&r.hasNext();){var i=n.next(),o=r.next(),s=i.compareTo(o);if(0!==s)return s}return n.hasNext()?1:r.hasNext()?-1:0},cc.prototype.hashCode=function(){return this.getEnvelopeInternal().hashCode()},cc.prototype.isGeometryCollectionOrDerived=function(){return this.getSortIndex()===cc.SORTINDEX_GEOMETRYCOLLECTION||this.getSortIndex()===cc.SORTINDEX_MULTIPOINT||this.getSortIndex()===cc.SORTINDEX_MULTILINESTRING||this.getSortIndex()===cc.SORTINDEX_MULTIPOLYGON},cc.prototype.interfaces_=function(){return[Eu,xu,Li]},cc.prototype.getClass=function(){return cc},cc.hasNonEmptyElements=function(t){for(var e=0;e<t.length;e++)if(!t[e].isEmpty())return!0;return!1},cc.hasNullElements=function(t){for(var e=0;e<t.length;e++)if(null===t[e])return!0;return!1},hc.serialVersionUID.get=function(){return 0x799ea46522854c00},hc.SORTINDEX_POINT.get=function(){return 0},hc.SORTINDEX_MULTIPOINT.get=function(){return 1},hc.SORTINDEX_LINESTRING.get=function(){return 2},hc.SORTINDEX_LINEARRING.get=function(){return 3},hc.SORTINDEX_MULTILINESTRING.get=function(){return 4},hc.SORTINDEX_POLYGON.get=function(){return 5},hc.SORTINDEX_MULTIPOLYGON.get=function(){return 6},hc.SORTINDEX_GEOMETRYCOLLECTION.get=function(){return 7},hc.geometryChangedFilter.get=function(){return lc},Object.defineProperties(cc,hc);var lc=function(){};lc.interfaces_=function(){return[uc]},lc.filter=function(t){t.geometryChangedAction()};var pc=function(){};pc.prototype.filter=function(t){},pc.prototype.interfaces_=function(){return[]},pc.prototype.getClass=function(){return pc};var fc=function(){},gc={Mod2BoundaryNodeRule:{configurable:!0},EndPointBoundaryNodeRule:{configurable:!0},MultiValentEndPointBoundaryNodeRule:{configurable:!0},MonoValentEndPointBoundaryNodeRule:{configurable:!0},MOD2_BOUNDARY_RULE:{configurable:!0},ENDPOINT_BOUNDARY_RULE:{configurable:!0},MULTIVALENT_ENDPOINT_BOUNDARY_RULE:{configurable:!0},MONOVALENT_ENDPOINT_BOUNDARY_RULE:{configurable:!0},OGC_SFS_BOUNDARY_RULE:{configurable:!0}};fc.prototype.isInBoundary=function(t){},fc.prototype.interfaces_=function(){return[]},fc.prototype.getClass=function(){return fc},gc.Mod2BoundaryNodeRule.get=function(){return dc},gc.EndPointBoundaryNodeRule.get=function(){return yc},gc.MultiValentEndPointBoundaryNodeRule.get=function(){return _c},gc.MonoValentEndPointBoundaryNodeRule.get=function(){return mc},gc.MOD2_BOUNDARY_RULE.get=function(){return new dc},gc.ENDPOINT_BOUNDARY_RULE.get=function(){return new yc},gc.MULTIVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new _c},gc.MONOVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new mc},gc.OGC_SFS_BOUNDARY_RULE.get=function(){return fc.MOD2_BOUNDARY_RULE},Object.defineProperties(fc,gc);var dc=function(){};dc.prototype.isInBoundary=function(t){return t%2==1},dc.prototype.interfaces_=function(){return[fc]},dc.prototype.getClass=function(){return dc};var yc=function(){};yc.prototype.isInBoundary=function(t){return t>0},yc.prototype.interfaces_=function(){return[fc]},yc.prototype.getClass=function(){return yc};var _c=function(){};_c.prototype.isInBoundary=function(t){return t>1},_c.prototype.interfaces_=function(){return[fc]},_c.prototype.getClass=function(){return _c};var mc=function(){};mc.prototype.isInBoundary=function(t){return 1===t},mc.prototype.interfaces_=function(){return[fc]},mc.prototype.getClass=function(){return mc};var vc=function(){};vc.prototype.add=function(){},vc.prototype.addAll=function(){},vc.prototype.isEmpty=function(){},vc.prototype.iterator=function(){},vc.prototype.size=function(){},vc.prototype.toArray=function(){},vc.prototype.remove=function(){};var xc=function(t){function e(e){t.call(this),this.message=e||""}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={name:{configurable:!0}};return n.name.get=function(){return"IndexOutOfBoundsException"},Object.defineProperties(e,n),e}(Error),Ec=function(){};Ec.prototype.hasNext=function(){},Ec.prototype.next=function(){},Ec.prototype.remove=function(){};var wc=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}(vc);(Pi.prototype=new Error).name="NoSuchElementException";var bc=function(t){function e(){t.call(this),this.array_=[],arguments[0]instanceof vc&&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,vc]},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 Ic(this)},e.prototype.get=function(t){if(t<0||t>=this.size())throw new xc;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<n;e++)t.push(this.array_[e]);return t},e.prototype.remove=function(t){for(var e=!1,n=0,r=this.array_.length;n<r;n++)if(this.array_[n]===t){this.array_.splice(n,1),e=!0;break}return e},e}(wc),Ic=function(t){function e(e){t.call(this),this.arrayList_=e,this.position_=0}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.next=function(){if(this.position_===this.arrayList_.size())throw new Pi;return this.arrayList_.get(this.position_++)},e.prototype.hasNext=function(){return this.position_<this.arrayList_.size()},e.prototype.set=function(t){return this.arrayList_.set(this.position_-1,t)},e.prototype.remove=function(){this.arrayList_.remove(this.arrayList_.get(this.position_))},e}(Ec),Nc=function(t){function e(){if(t.call(this),0===arguments.length);else if(1===arguments.length){var e=arguments[0];this.ensureCapacity(e.length),this.add(e,!0)}else if(2===arguments.length){var n=arguments[0],r=arguments[1];this.ensureCapacity(n.length),this.add(n,r)}}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={coordArrayType:{configurable:!0}};return n.coordArrayType.get=function(){return new Array(0).fill(null)},e.prototype.getCoordinate=function(t){return this.get(t)},e.prototype.addAll=function(){if(2===arguments.length){for(var e=arguments[1],n=!1,r=arguments[0].iterator();r.hasNext();)this.add(r.next(),e),n=!0;return n}return t.prototype.addAll.apply(this,arguments)},e.prototype.clone=function(){for(var e=t.prototype.clone.call(this),n=0;n<this.size();n++)e.add(n,this.get(n).copy());return e},e.prototype.toCoordinateArray=function(){return this.toArray(e.coordArrayType)},e.prototype.add=function(){if(1===arguments.length){var e=arguments[0];t.prototype.add.call(this,e)}else if(2===arguments.length){if(arguments[0]instanceof Array&&"boolean"==typeof arguments[1]){var n=arguments[0],r=arguments[1];return this.add(n,r,!0),!0}if(arguments[0]instanceof bu&&"boolean"==typeof arguments[1]){var i=arguments[0];if(!arguments[1]&&this.size()>=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 c=0;c<a.length;c++)this.add(a[c],u);else for(var h=a.length-1;h>=0;h--)this.add(a[h],u);return!0}if("boolean"==typeof arguments[2]&&Number.isInteger(arguments[0])&&arguments[1]instanceof bu){var l=arguments[0],p=arguments[1];if(!arguments[2]){var f=this.size();if(f>0){if(l>0&&this.get(l-1).equals2D(p))return null;if(l<f&&this.get(l).equals2D(p))return null}}t.prototype.add.call(this,l,p)}}else if(4===arguments.length){var g=arguments[0],d=arguments[1],y=arguments[2],_=arguments[3],m=1;y>_&&(m=-1);for(var v=y;v!==_;v+=m)this.add(g[v],d);return!0}},e.prototype.closeRing=function(){this.size()>0&&this.add(new bu(this.get(0)),!1)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},Object.defineProperties(e,n),e}(bc),Cc=function(){},Sc={ForwardComparator:{configurable:!0},BidirectionalComparator:{configurable:!0},coordArrayType:{configurable:!0}};Sc.ForwardComparator.get=function(){return Mc},Sc.BidirectionalComparator.get=function(){return Lc},Sc.coordArrayType.get=function(){return new Array(0).fill(null)},Cc.prototype.interfaces_=function(){return[]},Cc.prototype.getClass=function(){return Cc},Cc.isRing=function(t){return!(t.length<4)&&!!t[0].equals2D(t[t.length-1])},Cc.ptNotInList=function(t,e){for(var n=0;n<t.length;n++){var r=t[n];if(Cc.indexOf(r,e)<0)return r}return null},Cc.scroll=function(t,e){var n=Cc.indexOf(e,t);if(n<0)return null;var r=new Array(t.length).fill(null);Xu.arraycopy(t,n,r,0,t.length-n),Xu.arraycopy(t,0,r,t.length-n,n),Xu.arraycopy(r,0,t,0,t.length)},Cc.equals=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];if(t===e)return!0;if(null===t||null===e)return!1;if(t.length!==e.length)return!1;for(var n=0;n<t.length;n++)if(!t[n].equals(e[n]))return!1;return!0}if(3===arguments.length){var r=arguments[0],i=arguments[1],o=arguments[2];if(r===i)return!0;if(null===r||null===i)return!1;if(r.length!==i.length)return!1;for(var s=0;s<r.length;s++)if(0!==o.compare(r[s],i[s]))return!1;return!0}},Cc.intersection=function(t,e){for(var n=new Nc,r=0;r<t.length;r++)e.intersects(t[r])&&n.add(t[r],!0);return n.toCoordinateArray()},Cc.hasRepeatedPoints=function(t){for(var e=1;e<t.length;e++)if(t[e-1].equals(t[e]))return!0;return!1},Cc.removeRepeatedPoints=function(t){return Cc.hasRepeatedPoints(t)?new Nc(t,!1).toCoordinateArray():t},Cc.reverse=function(t){for(var e=t.length-1,n=Math.trunc(e/2),r=0;r<=n;r++){var i=t[r];t[r]=t[e-r],t[e-r]=i}},Cc.removeNull=function(t){for(var e=0,n=0;n<t.length;n++)null!==t[n]&&e++;var r=new Array(e).fill(null);if(0===e)return r;for(var i=0,o=0;o<t.length;o++)null!==t[o]&&(r[i++]=t[o]);return r},Cc.copyDeep=function(){if(1===arguments.length){for(var t=arguments[0],e=new Array(t.length).fill(null),n=0;n<t.length;n++)e[n]=new bu(t[n]);return e}if(5===arguments.length)for(var r=arguments[0],i=arguments[1],o=arguments[2],s=arguments[3],a=arguments[4],u=0;u<a;u++)o[s+u]=new bu(r[i+u])},Cc.isEqualReversed=function(t,e){for(var n=0;n<t.length;n++){var r=t[n],i=e[t.length-n-1];if(0!==r.compareTo(i))return!1}return!0},Cc.envelope=function(t){for(var e=new Yu,n=0;n<t.length;n++)e.expandToInclude(t[n]);return e},Cc.toCoordinateArray=function(t){return t.toArray(Cc.coordArrayType)},Cc.atLeastNCoordinatesOrNothing=function(t,e){return e.length>=t?e:[]},Cc.indexOf=function(t,e){for(var n=0;n<e.length;n++)if(t.equals(e[n]))return n;return-1},Cc.increasingDirection=function(t){for(var e=0;e<Math.trunc(t.length/2);e++){var n=t.length-1-e,r=t[e].compareTo(t[n]);if(0!==r)return r}return 1},Cc.compare=function(t,e){for(var n=0;n<t.length&&n<e.length;){var r=t[n].compareTo(e[n]);if(0!==r)return r;n++}return n<e.length?-1:n<t.length?1:0},Cc.minCoordinate=function(t){for(var e=null,n=0;n<t.length;n++)(null===e||e.compareTo(t[n])>0)&&(e=t[n]);return e},Cc.extract=function(t,e,n){e=Pu.clamp(e,0,t.length);var r=(n=Pu.clamp(n,-1,t.length))-e+1;n<0&&(r=0),e>=t.length&&(r=0),n<e&&(r=0);var i=new Array(r).fill(null);if(0===r)return i;for(var o=0,s=e;s<=n;s++)i[o++]=t[s];return i},Object.defineProperties(Cc,Sc);var Mc=function(){};Mc.prototype.compare=function(t,e){return Cc.compare(t,e)},Mc.prototype.interfaces_=function(){return[wu]},Mc.prototype.getClass=function(){return Mc};var Lc=function(){};Lc.prototype.compare=function(t,e){var n=t,r=e;if(n.length<r.length)return-1;if(n.length>r.length)return 1;if(0===n.length)return 0;var i=Cc.compare(n,r);return Cc.isEqualReversed(n,r)?0:i},Lc.prototype.OLDcompare=function(t,e){var n=t,r=e;if(n.length<r.length)return-1;if(n.length>r.length)return 1;if(0===n.length)return 0;for(var i=Cc.increasingDirection(n),o=Cc.increasingDirection(r),s=i>0?0:n.length-1,a=o>0?0:n.length-1,u=0;u<n.length;u++){var c=n[s].compareTo(r[a]);if(0!==c)return c;s+=i,a+=o}return 0},Lc.prototype.interfaces_=function(){return[wu]},Lc.prototype.getClass=function(){return Lc};var Pc=function(){};Pc.prototype.get=function(){},Pc.prototype.put=function(){},Pc.prototype.size=function(){},Pc.prototype.values=function(){},Pc.prototype.entrySet=function(){};var Oc=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}(Pc);(Oi.prototype=new Error).name="OperationNotSupported",(Ri.prototype=new vc).contains=function(){};var Rc=function(t){function e(){t.call(this),this.array_=[],arguments[0]instanceof vc&&this.addAll(arguments[0])}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.contains=function(t){for(var e=0,n=this.array_.length;e<n;e++)if(this.array_[e]===t)return!0;return!1},e.prototype.add=function(t){return!this.contains(t)&&(this.array_.push(t),!0)},e.prototype.addAll=function(t){for(var e=t.iterator();e.hasNext();)this.add(e.next());return!0},e.prototype.remove=function(t){throw new Error},e.prototype.size=function(){return this.array_.length},e.prototype.isEmpty=function(){return 0===this.array_.length},e.prototype.toArray=function(){for(var t=[],e=0,n=this.array_.length;e<n;e++)t.push(this.array_[e]);return t},e.prototype.iterator=function(){return new Tc(this)},e}(Ri),Tc=function(t){function e(e){t.call(this),this.hashSet_=e,this.position_=0}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.next=function(){if(this.position_===this.hashSet_.size())throw new Pi;return this.hashSet_.array_[this.position_++]},e.prototype.hasNext=function(){return this.position_<this.hashSet_.size()},e.prototype.remove=function(){throw new Oi},e}(Ec),Ac=0;(Gi.prototype=new Oc).get=function(t){for(var e=this.root_;null!==e;){var n=t.compareTo(e.key);if(n<0)e=e.left;else{if(!(n>0))return e.value;e=e.right}}return null},Gi.prototype.put=function(t,e){if(null===this.root_)return this.root_={key:t,value:e,left:null,right:null,parent:null,color:Ac,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:Ac,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},Gi.prototype.fixAfterInsertion=function(t){for(t.color=1;null!=t&&t!==this.root_&&1===t.parent.color;)if(Ai(t)===Fi(Ai(Ai(t)))){var e=qi(Ai(Ai(t)));1===Ti(e)?(Di(Ai(t),Ac),Di(e,Ac),Di(Ai(Ai(t)),1),t=Ai(Ai(t))):(t===qi(Ai(t))&&(t=Ai(t),this.rotateLeft(t)),Di(Ai(t),Ac),Di(Ai(Ai(t)),1),this.rotateRight(Ai(Ai(t))))}else{var n=Fi(Ai(Ai(t)));1===Ti(n)?(Di(Ai(t),Ac),Di(n,Ac),Di(Ai(Ai(t)),1),t=Ai(Ai(t))):(t===Fi(Ai(t))&&(t=Ai(t),this.rotateRight(t)),Di(Ai(t),Ac),Di(Ai(Ai(t)),1),this.rotateLeft(Ai(Ai(t))))}this.root_.color=Ac},Gi.prototype.values=function(){var t=new bc,e=this.getFirstEntry();if(null!==e)for(t.add(e.value);null!==(e=Gi.successor(e));)t.add(e.value);return t},Gi.prototype.entrySet=function(){var t=new Rc,e=this.getFirstEntry();if(null!==e)for(t.add(e);null!==(e=Gi.successor(e));)t.add(e);return t},Gi.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}},Gi.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}},Gi.prototype.getFirstEntry=function(){var t=this.root_;if(null!=t)for(;null!=t.left;)t=t.left;return t},Gi.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},Gi.prototype.size=function(){return this.size_};var Dc=function(){};Dc.prototype.interfaces_=function(){return[]},Dc.prototype.getClass=function(){return Dc},Bi.prototype=new Ri,(ki.prototype=new Bi).contains=function(t){for(var e=0,n=this.array_.length;e<n;e++)if(0===this.array_[e].compareTo(t))return!0;return!1},ki.prototype.add=function(t){if(this.contains(t))return!1;for(var e=0,n=this.array_.length;e<n;e++)if(1===this.array_[e].compareTo(t))return this.array_.splice(e,0,t),!0;return this.array_.push(t),!0},ki.prototype.addAll=function(t){for(var e=t.iterator();e.hasNext();)this.add(e.next());return!0},ki.prototype.remove=function(t){throw new Oi},ki.prototype.size=function(){return this.array_.length},ki.prototype.isEmpty=function(){return 0===this.array_.length},ki.prototype.toArray=function(){for(var t=[],e=0,n=this.array_.length;e<n;e++)t.push(this.array_[e]);return t},ki.prototype.iterator=function(){return new Fc(this)};var Fc=function(t){this.treeSet_=t,this.position_=0};Fc.prototype.next=function(){if(this.position_===this.treeSet_.size())throw new Pi;return this.treeSet_.array_[this.position_++]},Fc.prototype.hasNext=function(){return this.position_<this.treeSet_.size()},Fc.prototype.remove=function(){throw new Oi};var qc=function(){};qc.sort=function(){var t,e,n,r,i=arguments[0];if(1===arguments.length)r=function(t,e){return t.compareTo(e)},i.sort(r);else if(2===arguments.length)n=arguments[1],r=function(t,e){return n.compare(t,e)},i.sort(r);else if(3===arguments.length){(e=i.slice(arguments[1],arguments[2])).sort();var o=i.slice(0,arguments[1]).concat(e,i.slice(arguments[2],i.length));for(i.splice(0,i.length),t=0;t<o.length;t++)i.push(o[t])}else if(4===arguments.length)for(e=i.slice(arguments[1],arguments[2]),n=arguments[3],r=function(t,e){return n.compare(t,e)},e.sort(r),o=i.slice(0,arguments[1]).concat(e,i.slice(arguments[2],i.length)),i.splice(0,i.length),t=0;t<o.length;t++)i.push(o[t])},qc.asList=function(t){for(var e=new bc,n=0,r=t.length;n<r;n++)e.add(t[n]);return e};var Gc=function(){},Bc={P:{configurable:!0},L:{configurable:!0},A:{configurable:!0},FALSE:{configurable:!0},TRUE:{configurable:!0},DONTCARE:{configurable:!0},SYM_FALSE:{configurable:!0},SYM_TRUE:{configurable:!0},SYM_DONTCARE:{configurable:!0},SYM_P:{configurable:!0},SYM_L:{configurable:!0},SYM_A:{configurable:!0}};Bc.P.get=function(){return 0},Bc.L.get=function(){return 1},Bc.A.get=function(){return 2},Bc.FALSE.get=function(){return-1},Bc.TRUE.get=function(){return-2},Bc.DONTCARE.get=function(){return-3},Bc.SYM_FALSE.get=function(){return"F"},Bc.SYM_TRUE.get=function(){return"T"},Bc.SYM_DONTCARE.get=function(){return"*"},Bc.SYM_P.get=function(){return"0"},Bc.SYM_L.get=function(){return"1"},Bc.SYM_A.get=function(){return"2"},Gc.prototype.interfaces_=function(){return[]},Gc.prototype.getClass=function(){return Gc},Gc.toDimensionSymbol=function(t){switch(t){case Gc.FALSE:return Gc.SYM_FALSE;case Gc.TRUE:return Gc.SYM_TRUE;case Gc.DONTCARE:return Gc.SYM_DONTCARE;case Gc.P:return Gc.SYM_P;case Gc.L:return Gc.SYM_L;case Gc.A:return Gc.SYM_A}throw new _u("Unknown dimension value: "+t)},Gc.toDimensionValue=function(t){switch(Au.toUpperCase(t)){case Gc.SYM_FALSE:return Gc.FALSE;case Gc.SYM_TRUE:return Gc.TRUE;case Gc.SYM_DONTCARE:return Gc.DONTCARE;case Gc.SYM_P:return Gc.P;case Gc.SYM_L:return Gc.L;case Gc.SYM_A:return Gc.A}throw new _u("Unknown dimension symbol: "+t)},Object.defineProperties(Gc,Bc);var kc=function(){};kc.prototype.filter=function(t){},kc.prototype.interfaces_=function(){return[]},kc.prototype.getClass=function(){return kc};var zc=function(){};zc.prototype.filter=function(t,e){},zc.prototype.isDone=function(){},zc.prototype.isGeometryChanged=function(){},zc.prototype.interfaces_=function(){return[]},zc.prototype.getClass=function(){return zc};var jc=function(t){function e(e,n){if(t.call(this,n),this._geometries=e||[],t.hasNullElements(this._geometries))throw new _u("geometries must not contain null elements")}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={serialVersionUID:{configurable:!0}};return e.prototype.computeEnvelopeInternal=function(){for(var t=new Yu,e=0;e<this._geometries.length;e++)t.expandToInclude(this._geometries[e].getEnvelopeInternal());return t},e.prototype.getGeometryN=function(t){return this._geometries[t]},e.prototype.getSortIndex=function(){return t.SORTINDEX_GEOMETRYCOLLECTION},e.prototype.getCoordinates=function(){for(var t=new Array(this.getNumPoints()).fill(null),e=-1,n=0;n<this._geometries.length;n++)for(var r=this._geometries[n].getCoordinates(),i=0;i<r.length;i++)t[++e]=r[i];return t},e.prototype.getArea=function(){for(var t=0,e=0;e<this._geometries.length;e++)t+=this._geometries[e].getArea();return t},e.prototype.equalsExact=function(){if(2===arguments.length){var e=arguments[0],n=arguments[1];if(!this.isEquivalentClass(e))return!1;var r=e;if(this._geometries.length!==r._geometries.length)return!1;for(var i=0;i<this._geometries.length;i++)if(!this._geometries[i].equalsExact(r._geometries[i],n))return!1;return!0}return t.prototype.equalsExact.apply(this,arguments)},e.prototype.normalize=function(){for(var t=0;t<this._geometries.length;t++)this._geometries[t].normalize();qc.sort(this._geometries)},e.prototype.getCoordinate=function(){return this.isEmpty()?null:this._geometries[0].getCoordinate()},e.prototype.getBoundaryDimension=function(){for(var t=Gc.FALSE,e=0;e<this._geometries.length;e++)t=Math.max(t,this._geometries[e].getBoundaryDimension());return t},e.prototype.getDimension=function(){for(var t=Gc.FALSE,e=0;e<this._geometries.length;e++)t=Math.max(t,this._geometries[e].getDimension());return t},e.prototype.getLength=function(){for(var t=0,e=0;e<this._geometries.length;e++)t+=this._geometries[e].getLength();return t},e.prototype.getNumPoints=function(){for(var t=0,e=0;e<this._geometries.length;e++)t+=this._geometries[e].getNumPoints();return t},e.prototype.getNumGeometries=function(){return this._geometries.length},e.prototype.reverse=function(){for(var t=this._geometries.length,e=new Array(t).fill(null),n=0;n<this._geometries.length;n++)e[n]=this._geometries[n].reverse();return this.getFactory().createGeometryCollection(e)},e.prototype.compareToSameClass=function(){if(1===arguments.length){var t=arguments[0],e=new ki(qc.asList(this._geometries)),n=new ki(qc.asList(t._geometries));return this.compare(e,n)}if(2===arguments.length){for(var r=arguments[1],i=arguments[0],o=this.getNumGeometries(),s=i.getNumGeometries(),a=0;a<o&&a<s;){var u=this.getGeometryN(a),c=i.getGeometryN(a),h=u.compareToSameClass(c,r);if(0!==h)return h;a++}return a<o?1:a<s?-1:0}},e.prototype.apply=function(){if(Lu(arguments[0],pc))for(var t=arguments[0],e=0;e<this._geometries.length;e++)this._geometries[e].apply(t);else if(Lu(arguments[0],zc)){var n=arguments[0];if(0===this._geometries.length)return null;for(var r=0;r<this._geometries.length&&(this._geometries[r].apply(n),!n.isDone());r++);n.isGeometryChanged()&&this.geometryChanged()}else if(Lu(arguments[0],kc)){var i=arguments[0];i.filter(this);for(var o=0;o<this._geometries.length;o++)this._geometries[o].apply(i)}else if(Lu(arguments[0],uc)){var s=arguments[0];s.filter(this);for(var a=0;a<this._geometries.length;a++)this._geometries[a].apply(s)}},e.prototype.getBoundary=function(){return this.checkNotGeometryCollection(this),tc.shouldNeverReachHere(),null},e.prototype.clone=function(){var e=t.prototype.clone.call(this);e._geometries=new Array(this._geometries.length).fill(null);for(var n=0;n<this._geometries.length;n++)e._geometries[n]=this._geometries[n].clone();return e},e.prototype.getGeometryType=function(){return"GeometryCollection"},e.prototype.copy=function(){for(var t=new Array(this._geometries.length).fill(null),n=0;n<t.length;n++)t[n]=this._geometries[n].copy();return new e(t,this._factory)},e.prototype.isEmpty=function(){for(var t=0;t<this._geometries.length;t++)if(!this._geometries[t].isEmpty())return!1;return!0},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return-0x4f07bcb1f857d800},Object.defineProperties(e,n),e}(cc),Xc=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 cc.SORTINDEX_MULTILINESTRING},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 this.isClosed()?Gc.FALSE:0},e.prototype.isClosed=function(){if(this.isEmpty())return!1;for(var t=0;t<this._geometries.length;t++)if(!this._geometries[t].isClosed())return!1;return!0},e.prototype.getDimension=function(){return 1},e.prototype.reverse=function(){for(var t=this._geometries.length,e=new Array(t).fill(null),n=0;n<this._geometries.length;n++)e[t-1-n]=this._geometries[n].reverse();return this.getFactory().createMultiLineString(e)},e.prototype.getBoundary=function(){return new Uc(this).getBoundary()},e.prototype.getGeometryType=function(){return"MultiLineString"},e.prototype.copy=function(){for(var t=new Array(this._geometries.length).fill(null),n=0;n<t.length;n++)t[n]=this._geometries[n].copy();return new e(t,this._factory)},e.prototype.interfaces_=function(){return[Dc]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return 0x7155d2ab4afa8000},Object.defineProperties(e,n),e}(jc),Uc=function(){if(this._geom=null,this._geomFact=null,this._bnRule=null,this._endpointMap=null,1===arguments.length){var t=arguments[0],e=fc.MOD2_BOUNDARY_RULE;this._geom=t,this._geomFact=t.getFactory(),this._bnRule=e}else if(2===arguments.length){var n=arguments[0],r=arguments[1];this._geom=n,this._geomFact=n.getFactory(),this._bnRule=r}};Uc.prototype.boundaryMultiLineString=function(t){if(this._geom.isEmpty())return this.getEmptyMultiPoint();var e=this.computeBoundaryCoordinates(t);return 1===e.length?this._geomFact.createPoint(e[0]):this._geomFact.createMultiPointFromCoords(e)},Uc.prototype.getBoundary=function(){return this._geom instanceof Jc?this.boundaryLineString(this._geom):this._geom instanceof Xc?this.boundaryMultiLineString(this._geom):this._geom.getBoundary()},Uc.prototype.boundaryLineString=function(t){return this._geom.isEmpty()?this.getEmptyMultiPoint():t.isClosed()?this._bnRule.isInBoundary(2)?t.getStartPoint():this._geomFact.createMultiPoint():this._geomFact.createMultiPoint([t.getStartPoint(),t.getEndPoint()])},Uc.prototype.getEmptyMultiPoint=function(){return this._geomFact.createMultiPoint()},Uc.prototype.computeBoundaryCoordinates=function(t){var e=new bc;this._endpointMap=new Gi;for(var n=0;n<t.getNumGeometries();n++){var r=t.getGeometryN(n);0!==r.getNumPoints()&&(this.addEndpoint(r.getCoordinateN(0)),this.addEndpoint(r.getCoordinateN(r.getNumPoints()-1)))}for(var i=this._endpointMap.entrySet().iterator();i.hasNext();){var o=i.next(),s=o.getValue().count;this._bnRule.isInBoundary(s)&&e.add(o.getKey())}return Cc.toCoordinateArray(e)},Uc.prototype.addEndpoint=function(t){var e=this._endpointMap.get(t);null===e&&(e=new Yc,this._endpointMap.put(t,e)),e.count++},Uc.prototype.interfaces_=function(){return[]},Uc.prototype.getClass=function(){return Uc},Uc.getBoundary=function(){return 1===arguments.length?new Uc(arguments[0]).getBoundary():2===arguments.length?new Uc(arguments[0],arguments[1]).getBoundary():void 0};var Yc=function(){this.count=null};Yc.prototype.interfaces_=function(){return[]},Yc.prototype.getClass=function(){return Yc};var Vc=function(){},Hc={NEWLINE:{configurable:!0},SIMPLE_ORDINATE_FORMAT:{configurable:!0}};Vc.prototype.interfaces_=function(){return[]},Vc.prototype.getClass=function(){return Vc},Vc.chars=function(t,e){for(var n=new Array(e).fill(null),r=0;r<e;r++)n[r]=t;return String(n)},Vc.getStackTrace=function(){if(1===arguments.length){var t=arguments[0],e=new function(){},n=new function(){}(e);return t.printStackTrace(n),e.toString()}if(2===arguments.length){for(var r=arguments[0],i=arguments[1],o="",s=new function(){}(new function(){}(Vc.getStackTrace(r))),a=0;a<i;a++)try{o+=s.readLine()+Vc.NEWLINE}catch(t){if(!(t instanceof zi))throw t;tc.shouldNeverReachHere()}return o}},Vc.split=function(t,e){for(var n=e.length,r=new bc,i=""+t,o=i.indexOf(e);o>=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;u<a.length;u++)a[u]=r.get(u);return a},Vc.toString=function(){if(1===arguments.length){var t=arguments[0];return Vc.SIMPLE_ORDINATE_FORMAT.format(t)}},Vc.spaces=function(t){return Vc.chars(" ",t)},Hc.NEWLINE.get=function(){return Xu.getProperty("line.separator")},Hc.SIMPLE_ORDINATE_FORMAT.get=function(){return new function(){}("0.#")},Object.defineProperties(Vc,Hc);var Wc=function(){};Wc.prototype.interfaces_=function(){return[]},Wc.prototype.getClass=function(){return Wc},Wc.copyCoord=function(t,e,n,r){for(var i=Math.min(t.getDimension(),n.getDimension()),o=0;o<i;o++)n.setOrdinate(r,o,t.getOrdinate(e,o))},Wc.isRing=function(t){var e=t.size();return 0===e||!(e<=3)&&t.getOrdinate(0,Bu.X)===t.getOrdinate(e-1,Bu.X)&&t.getOrdinate(0,Bu.Y)===t.getOrdinate(e-1,Bu.Y)},Wc.isEqual=function(t,e){var n=t.size();if(n!==e.size())return!1;for(var r=Math.min(t.getDimension(),e.getDimension()),i=0;i<n;i++)for(var o=0;o<r;o++){var s=t.getOrdinate(i,o),a=e.getOrdinate(i,o);if(t.getOrdinate(i,o)!==e.getOrdinate(i,o)&&(!mu.isNaN(s)||!mu.isNaN(a)))return!1}return!0},Wc.extend=function(t,e,n){var r=t.create(n,e.getDimension()),i=e.size();if(Wc.copy(e,0,r,0,i),i>0)for(var o=i;o<n;o++)Wc.copy(e,i-1,r,o,1);return r},Wc.reverse=function(t){for(var e=t.size()-1,n=Math.trunc(e/2),r=0;r<=n;r++)Wc.swap(t,r,e-r)},Wc.swap=function(t,e,n){if(e===n)return null;for(var r=0;r<t.getDimension();r++){var i=t.getOrdinate(e,r);t.setOrdinate(e,r,t.getOrdinate(n,r)),t.setOrdinate(n,r,i)}},Wc.copy=function(t,e,n,r,i){for(var o=0;o<i;o++)Wc.copyCoord(t,e+o,n,r+o)},Wc.toString=function(){if(1===arguments.length){var t=arguments[0],e=t.size();if(0===e)return"()";var n=t.getDimension(),r=new Ru;r.append("(");for(var i=0;i<e;i++){i>0&&r.append(" ");for(var o=0;o<n;o++)o>0&&r.append(","),r.append(Vc.toString(t.getOrdinate(i,o)))}return r.append(")"),r.toString()}},Wc.ensureValidRing=function(t,e){var n=e.size();return 0===n?e:n<=3?Wc.createClosedRing(t,e,4):e.getOrdinate(0,Bu.X)===e.getOrdinate(n-1,Bu.X)&&e.getOrdinate(0,Bu.Y)===e.getOrdinate(n-1,Bu.Y)?e:Wc.createClosedRing(t,e,n+1)},Wc.createClosedRing=function(t,e,n){var r=t.create(n,e.getDimension()),i=e.size();Wc.copy(e,0,r,0,i);for(var o=i;o<n;o++)Wc.copy(e,0,r,o,1);return r};var Jc=function(t){function e(e,n){t.call(this,n),this._points=null,this.init(e)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={serialVersionUID:{configurable:!0}};return e.prototype.computeEnvelopeInternal=function(){return this.isEmpty()?new Yu:this._points.expandEnvelope(new Yu)},e.prototype.isRing=function(){return this.isClosed()&&this.isSimple()},e.prototype.getSortIndex=function(){return t.SORTINDEX_LINESTRING},e.prototype.getCoordinates=function(){return this._points.toCoordinateArray()},e.prototype.equalsExact=function(){if(2===arguments.length){var e=arguments[0],n=arguments[1];if(!this.isEquivalentClass(e))return!1;var r=e;if(this._points.size()!==r._points.size())return!1;for(var i=0;i<this._points.size();i++)if(!this.equal(this._points.getCoordinate(i),r._points.getCoordinate(i),n))return!1;return!0}return t.prototype.equalsExact.apply(this,arguments)},e.prototype.normalize=function(){for(var t=0;t<Math.trunc(this._points.size()/2);t++){var e=this._points.size()-1-t;if(!this._points.getCoordinate(t).equals(this._points.getCoordinate(e)))return this._points.getCoordinate(t).compareTo(this._points.getCoordinate(e))>0&&Wc.reverse(this._points),null}},e.prototype.getCoordinate=function(){return this.isEmpty()?null:this._points.getCoordinate(0)},e.prototype.getBoundaryDimension=function(){return this.isClosed()?Gc.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 sc.computeLength(this._points)},e.prototype.getNumPoints=function(){return this._points.size()},e.prototype.reverse=function(){var t=this._points.copy();return Wc.reverse(t),this.getFactory().createLineString(t)},e.prototype.compareToSameClass=function(){if(1===arguments.length){for(var t=arguments[0],e=0,n=0;e<this._points.size()&&n<t._points.size();){var r=this._points.getCoordinate(e).compareTo(t._points.getCoordinate(n));if(0!==r)return r;e++,n++}return e<this._points.size()?1:n<t._points.size()?-1:0}if(2===arguments.length){var i=arguments[0];return arguments[1].compare(this._points,i._points)}},e.prototype.apply=function(){if(Lu(arguments[0],pc))for(var t=arguments[0],e=0;e<this._points.size();e++)t.filter(this._points.getCoordinate(e));else if(Lu(arguments[0],zc)){var n=arguments[0];if(0===this._points.size())return null;for(var r=0;r<this._points.size()&&(n.filter(this._points,r),!n.isDone());r++);n.isGeometryChanged()&&this.geometryChanged()}else(Lu(arguments[0],kc)||Lu(arguments[0],uc))&&arguments[0].filter(this)},e.prototype.getBoundary=function(){return new Uc(this).getBoundary()},e.prototype.isEquivalentClass=function(t){return t instanceof e},e.prototype.clone=function(){var e=t.prototype.clone.call(this);return e._points=this._points.clone(),e},e.prototype.getCoordinateN=function(t){return this._points.getCoordinate(t)},e.prototype.getGeometryType=function(){return"LineString"},e.prototype.copy=function(){return new e(this._points.copy(),this._factory)},e.prototype.getCoordinateSequence=function(){return this._points},e.prototype.isEmpty=function(){return 0===this._points.size()},e.prototype.init=function(t){if(null===t&&(t=this.getFactory().getCoordinateSequenceFactory().create([])),1===t.size())throw new _u("Invalid number of points in LineString (found "+t.size()+" - must be 0 or >= 2)");this._points=t},e.prototype.isCoordinate=function(t){for(var e=0;e<this._points.size();e++)if(this._points.getCoordinate(e).equals(t))return!0;return!1},e.prototype.getStartPoint=function(){return this.isEmpty()?null:this.getPointN(0)},e.prototype.getPointN=function(t){return this.getFactory().createPoint(this._points.getCoordinate(t))},e.prototype.interfaces_=function(){return[Dc]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return 0x2b2b51ba435c8e00},Object.defineProperties(e,n),e}(cc),Zc=function(){};Zc.prototype.interfaces_=function(){return[]},Zc.prototype.getClass=function(){return Zc};var Kc=function(t){function e(e,n){t.call(this,n),this._coordinates=e||null,this.init(this._coordinates)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={serialVersionUID:{configurable:!0}};return e.prototype.computeEnvelopeInternal=function(){if(this.isEmpty())return new Yu;var t=new Yu;return t.expandToInclude(this._coordinates.getX(0),this._coordinates.getY(0)),t},e.prototype.getSortIndex=function(){return t.SORTINDEX_POINT},e.prototype.getCoordinates=function(){return this.isEmpty()?[]:[this.getCoordinate()]},e.prototype.equalsExact=function(){if(2===arguments.length){var e=arguments[0],n=arguments[1];return!!this.isEquivalentClass(e)&&(!(!this.isEmpty()||!e.isEmpty())||this.isEmpty()===e.isEmpty()&&this.equal(e.getCoordinate(),this.getCoordinate(),n))}return t.prototype.equalsExact.apply(this,arguments)},e.prototype.normalize=function(){},e.prototype.getCoordinate=function(){return 0!==this._coordinates.size()?this._coordinates.getCoordinate(0):null},e.prototype.getBoundaryDimension=function(){return Gc.FALSE},e.prototype.getDimension=function(){return 0},e.prototype.getNumPoints=function(){return this.isEmpty()?0:1},e.prototype.reverse=function(){return this.copy()},e.prototype.getX=function(){if(null===this.getCoordinate())throw new Error("getX called on empty Point");return this.getCoordinate().x},e.prototype.compareToSameClass=function(){if(1===arguments.length){var t=arguments[0];return this.getCoordinate().compareTo(t.getCoordinate())}if(2===arguments.length){var e=arguments[0];return arguments[1].compare(this._coordinates,e._coordinates)}},e.prototype.apply=function(){if(Lu(arguments[0],pc)){var t=arguments[0];if(this.isEmpty())return null;t.filter(this.getCoordinate())}else if(Lu(arguments[0],zc)){var e=arguments[0];if(this.isEmpty())return null;e.filter(this._coordinates,0),e.isGeometryChanged()&&this.geometryChanged()}else(Lu(arguments[0],kc)||Lu(arguments[0],uc))&&arguments[0].filter(this)},e.prototype.getBoundary=function(){return this.getFactory().createGeometryCollection(null)},e.prototype.clone=function(){var e=t.prototype.clone.call(this);return e._coordinates=this._coordinates.clone(),e},e.prototype.getGeometryType=function(){return"Point"},e.prototype.copy=function(){return new e(this._coordinates.copy(),this._factory)},e.prototype.getCoordinateSequence=function(){return this._coordinates},e.prototype.getY=function(){if(null===this.getCoordinate())throw new Error("getY called on empty Point");return this.getCoordinate().y},e.prototype.isEmpty=function(){return 0===this._coordinates.size()},e.prototype.init=function(t){null===t&&(t=this.getFactory().getCoordinateSequenceFactory().create([])),tc.isTrue(t.size()<=1),this._coordinates=t},e.prototype.isSimple=function(){return!0},e.prototype.interfaces_=function(){return[Zc]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return 0x44077bad161cbc00},Object.defineProperties(e,n),e}(cc),Qc=function(){};Qc.prototype.interfaces_=function(){return[]},Qc.prototype.getClass=function(){return Qc};var $c=function(t){function e(e,n,r){if(t.call(this,r),this._shell=null,this._holes=null,null===e&&(e=this.getFactory().createLinearRing()),null===n&&(n=[]),t.hasNullElements(n))throw new _u("holes must not contain null elements");if(e.isEmpty()&&t.hasNonEmptyElements(n))throw new _u("shell is empty but holes are not");this._shell=e,this._holes=n}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={serialVersionUID:{configurable:!0}};return e.prototype.computeEnvelopeInternal=function(){return this._shell.getEnvelopeInternal()},e.prototype.getSortIndex=function(){return t.SORTINDEX_POLYGON},e.prototype.getCoordinates=function(){if(this.isEmpty())return[];for(var t=new Array(this.getNumPoints()).fill(null),e=-1,n=this._shell.getCoordinates(),r=0;r<n.length;r++)t[++e]=n[r];for(var i=0;i<this._holes.length;i++)for(var o=this._holes[i].getCoordinates(),s=0;s<o.length;s++)t[++e]=o[s];return t},e.prototype.getArea=function(){var t=0;t+=Math.abs(sc.signedArea(this._shell.getCoordinateSequence()));for(var e=0;e<this._holes.length;e++)t-=Math.abs(sc.signedArea(this._holes[e].getCoordinateSequence()));return t},e.prototype.isRectangle=function(){if(0!==this.getNumInteriorRing())return!1;if(null===this._shell)return!1;if(5!==this._shell.getNumPoints())return!1;for(var t=this._shell.getCoordinateSequence(),e=this.getEnvelopeInternal(),n=0;n<5;n++){var r=t.getX(n);if(r!==e.getMinX()&&r!==e.getMaxX())return!1;var i=t.getY(n);if(i!==e.getMinY()&&i!==e.getMaxY())return!1}for(var o=t.getX(0),s=t.getY(0),a=1;a<=4;a++){var u=t.getX(a),c=t.getY(a);if(u!==o===(c!==s))return!1;o=u,s=c}return!0},e.prototype.equalsExact=function(){if(2===arguments.length){var e=arguments[0],n=arguments[1];if(!this.isEquivalentClass(e))return!1;var r=e,i=this._shell,o=r._shell;if(!i.equalsExact(o,n))return!1;if(this._holes.length!==r._holes.length)return!1;for(var s=0;s<this._holes.length;s++)if(!this._holes[s].equalsExact(r._holes[s],n))return!1;return!0}return t.prototype.equalsExact.apply(this,arguments)},e.prototype.normalize=function(){if(0===arguments.length){this.normalize(this._shell,!0);for(var t=0;t<this._holes.length;t++)this.normalize(this._holes[t],!1);qc.sort(this._holes)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];if(e.isEmpty())return null;var r=new Array(e.getCoordinates().length-1).fill(null);Xu.arraycopy(e.getCoordinates(),0,r,0,r.length);var i=Cc.minCoordinate(e.getCoordinates());Cc.scroll(r,i),Xu.arraycopy(r,0,e.getCoordinates(),0,r.length),e.getCoordinates()[r.length]=r[0],sc.isCCW(e.getCoordinates())===n&&Cc.reverse(e.getCoordinates())}},e.prototype.getCoordinate=function(){return this._shell.getCoordinate()},e.prototype.getNumInteriorRing=function(){return this._holes.length},e.prototype.getBoundaryDimension=function(){return 1},e.prototype.getDimension=function(){return 2},e.prototype.getLength=function(){var t=0;t+=this._shell.getLength();for(var e=0;e<this._holes.length;e++)t+=this._holes[e].getLength();return t},e.prototype.getNumPoints=function(){for(var t=this._shell.getNumPoints(),e=0;e<this._holes.length;e++)t+=this._holes[e].getNumPoints();return t},e.prototype.reverse=function(){var t=this.copy();t._shell=this._shell.copy().reverse(),t._holes=new Array(this._holes.length).fill(null);for(var e=0;e<this._holes.length;e++)t._holes[e]=this._holes[e].copy().reverse();return t},e.prototype.convexHull=function(){return this.getExteriorRing().convexHull()},e.prototype.compareToSameClass=function(){if(1===arguments.length){var t=arguments[0],e=this._shell,n=t._shell;return e.compareToSameClass(n)}if(2===arguments.length){var r=arguments[1],i=arguments[0],o=this._shell,s=i._shell,a=o.compareToSameClass(s,r);if(0!==a)return a;for(var u=this.getNumInteriorRing(),c=i.getNumInteriorRing(),h=0;h<u&&h<c;){var l=this.getInteriorRingN(h),p=i.getInteriorRingN(h),f=l.compareToSameClass(p,r);if(0!==f)return f;h++}return h<u?1:h<c?-1:0}},e.prototype.apply=function(t){if(Lu(t,pc)){this._shell.apply(t);for(var e=0;e<this._holes.length;e++)this._holes[e].apply(t)}else if(Lu(t,zc)){if(this._shell.apply(t),!t.isDone())for(var n=0;n<this._holes.length&&(this._holes[n].apply(t),!t.isDone());n++);t.isGeometryChanged()&&this.geometryChanged()}else if(Lu(t,kc))t.filter(this);else if(Lu(t,uc)){t.filter(this),this._shell.apply(t);for(var r=0;r<this._holes.length;r++)this._holes[r].apply(t)}},e.prototype.getBoundary=function(){if(this.isEmpty())return this.getFactory().createMultiLineString();var t=new Array(this._holes.length+1).fill(null);t[0]=this._shell;for(var e=0;e<this._holes.length;e++)t[e+1]=this._holes[e];return t.length<=1?this.getFactory().createLinearRing(t[0].getCoordinateSequence()):this.getFactory().createMultiLineString(t)},e.prototype.clone=function(){var e=t.prototype.clone.call(this);e._shell=this._shell.clone(),e._holes=new Array(this._holes.length).fill(null);for(var n=0;n<this._holes.length;n++)e._holes[n]=this._holes[n].clone();return e},e.prototype.getGeometryType=function(){return"Polygon"},e.prototype.copy=function(){for(var t=this._shell.copy(),n=new Array(this._holes.length).fill(null),r=0;r<n.length;r++)n[r]=this._holes[r].copy();return new e(t,n,this._factory)},e.prototype.getExteriorRing=function(){return this._shell},e.prototype.isEmpty=function(){return this._shell.isEmpty()},e.prototype.getInteriorRingN=function(t){return this._holes[t]},e.prototype.interfaces_=function(){return[Qc]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return-0x307ffefd8dc97200},Object.defineProperties(e,n),e}(cc),th=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 cc.SORTINDEX_MULTIPOINT},e.prototype.isValid=function(){return!0},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.getCoordinate=function(){if(1===arguments.length){var e=arguments[0];return this._geometries[e].getCoordinate()}return t.prototype.getCoordinate.apply(this,arguments)},e.prototype.getBoundaryDimension=function(){return Gc.FALSE},e.prototype.getDimension=function(){return 0},e.prototype.getBoundary=function(){return this.getFactory().createGeometryCollection(null)},e.prototype.getGeometryType=function(){return"MultiPoint"},e.prototype.copy=function(){for(var t=new Array(this._geometries.length).fill(null),n=0;n<t.length;n++)t[n]=this._geometries[n].copy();return new e(t,this._factory)},e.prototype.interfaces_=function(){return[Zc]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return-0x6fb1ed4162e0fc00},Object.defineProperties(e,n),e}(jc),eh=function(t){function e(e,n){e instanceof bu&&n instanceof _h&&(e=n.getCoordinateSequenceFactory().create(e)),t.call(this,e,n),this.validateConstruction()}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={MINIMUM_VALID_SIZE:{configurable:!0},serialVersionUID:{configurable:!0}};return e.prototype.getSortIndex=function(){return cc.SORTINDEX_LINEARRING},e.prototype.getBoundaryDimension=function(){return Gc.FALSE},e.prototype.isClosed=function(){return!!this.isEmpty()||t.prototype.isClosed.call(this)},e.prototype.reverse=function(){var t=this._points.copy();return Wc.reverse(t),this.getFactory().createLinearRing(t)},e.prototype.validateConstruction=function(){if(!this.isEmpty()&&!t.prototype.isClosed.call(this))throw new _u("Points of LinearRing do not form a closed linestring");if(this.getCoordinateSequence().size()>=1&&this.getCoordinateSequence().size()<e.MINIMUM_VALID_SIZE)throw new _u("Invalid number of points in LinearRing (found "+this.getCoordinateSequence().size()+" - must be 0 or >= 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}(Jc),nh=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 cc.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;n<this._geometries.length;n++)e[n]=this._geometries[n].reverse();return this.getFactory().createMultiPolygon(e)},e.prototype.getBoundary=function(){if(this.isEmpty())return this.getFactory().createMultiLineString();for(var t=new bc,e=0;e<this._geometries.length;e++)for(var n=this._geometries[e].getBoundary(),r=0;r<n.getNumGeometries();r++)t.add(n.getGeometryN(r));var i=new Array(t.size()).fill(null);return this.getFactory().createMultiLineString(t.toArray(i))},e.prototype.getGeometryType=function(){return"MultiPolygon"},e.prototype.copy=function(){for(var t=new Array(this._geometries.length).fill(null),n=0;n<t.length;n++)t[n]=this._geometries[n].copy();return new e(t,this._factory)},e.prototype.interfaces_=function(){return[Qc]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return-0x7a5aa1369171980},Object.defineProperties(e,n),e}(jc),rh=function(t){this._factory=t||null,this._isUserDataCopied=!1},ih={NoOpGeometryOperation:{configurable:!0},CoordinateOperation:{configurable:!0},CoordinateSequenceOperation:{configurable:!0}};rh.prototype.setCopyUserData=function(t){this._isUserDataCopied=t},rh.prototype.edit=function(t,e){if(null===t)return null;var n=this.editInternal(t,e);return this._isUserDataCopied&&n.setUserData(t.getUserData()),n},rh.prototype.editInternal=function(t,e){return null===this._factory&&(this._factory=t.getFactory()),t instanceof jc?this.editGeometryCollection(t,e):t instanceof $c?this.editPolygon(t,e):t instanceof Kc||t instanceof Jc?e.edit(t,this._factory):(tc.shouldNeverReachHere("Unsupported Geometry class: "+t.getClass().getName()),null)},rh.prototype.editGeometryCollection=function(t,e){for(var n=e.edit(t,this._factory),r=new bc,i=0;i<n.getNumGeometries();i++){var o=this.edit(n.getGeometryN(i),e);null===o||o.isEmpty()||r.add(o)}return n.getClass()===th?this._factory.createMultiPoint(r.toArray([])):n.getClass()===Xc?this._factory.createMultiLineString(r.toArray([])):n.getClass()===nh?this._factory.createMultiPolygon(r.toArray([])):this._factory.createGeometryCollection(r.toArray([]))},rh.prototype.editPolygon=function(t,e){var n=e.edit(t,this._factory);if(null===n&&(n=this._factory.createPolygon(null)),n.isEmpty())return n;var r=this.edit(n.getExteriorRing(),e);if(null===r||r.isEmpty())return this._factory.createPolygon();for(var i=new bc,o=0;o<n.getNumInteriorRing();o++){var s=this.edit(n.getInteriorRingN(o),e);null===s||s.isEmpty()||i.add(s)}return this._factory.createPolygon(r,i.toArray([]))},rh.prototype.interfaces_=function(){return[]},rh.prototype.getClass=function(){return rh},rh.GeometryEditorOperation=function(){},ih.NoOpGeometryOperation.get=function(){return oh},ih.CoordinateOperation.get=function(){return sh},ih.CoordinateSequenceOperation.get=function(){return ah},Object.defineProperties(rh,ih);var oh=function(){};oh.prototype.edit=function(t,e){return t},oh.prototype.interfaces_=function(){return[rh.GeometryEditorOperation]},oh.prototype.getClass=function(){return oh};var sh=function(){};sh.prototype.edit=function(t,e){var n=this.editCoordinates(t.getCoordinates(),t);return null===n?t:t instanceof eh?e.createLinearRing(n):t instanceof Jc?e.createLineString(n):t instanceof Kc?n.length>0?e.createPoint(n[0]):e.createPoint():t},sh.prototype.interfaces_=function(){return[rh.GeometryEditorOperation]},sh.prototype.getClass=function(){return sh};var ah=function(){};ah.prototype.edit=function(t,e){return t instanceof eh?e.createLinearRing(this.edit(t.getCoordinateSequence(),t)):t instanceof Jc?e.createLineString(this.edit(t.getCoordinateSequence(),t)):t instanceof Kc?e.createPoint(this.edit(t.getCoordinateSequence(),t)):t},ah.prototype.interfaces_=function(){return[rh.GeometryEditorOperation]},ah.prototype.getClass=function(){return ah};var uh=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;e<t;e++)this._coordinates[e]=new bu}else if(Lu(arguments[0],Bu)){var n=arguments[0];if(null===n)return this._coordinates=new Array(0).fill(null),null;this._dimension=n.getDimension(),this._coordinates=new Array(n.size()).fill(null);for(var r=0;r<this._coordinates.length;r++)this._coordinates[r]=n.getCoordinateCopy(r)}}else if(2===arguments.length)if(arguments[0]instanceof Array&&Number.isInteger(arguments[1])){var i=arguments[0],o=arguments[1];this._coordinates=i,this._dimension=o,null===i&&(this._coordinates=new Array(0).fill(null))}else if(Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var s=arguments[0],a=arguments[1];this._coordinates=new Array(s).fill(null),this._dimension=a;for(var u=0;u<s;u++)this._coordinates[u]=new bu}},ch={serialVersionUID:{configurable:!0}};uh.prototype.setOrdinate=function(t,e,n){switch(e){case Bu.X:this._coordinates[t].x=n;break;case Bu.Y:this._coordinates[t].y=n;break;case Bu.Z:this._coordinates[t].z=n;break;default:throw new _u("invalid ordinateIndex")}},uh.prototype.size=function(){return this._coordinates.length},uh.prototype.getOrdinate=function(t,e){switch(e){case Bu.X:return this._coordinates[t].x;case Bu.Y:return this._coordinates[t].y;case Bu.Z:return this._coordinates[t].z}return mu.NaN},uh.prototype.getCoordinate=function(){if(1===arguments.length){var t=arguments[0];return this._coordinates[t]}if(2===arguments.length){var e=arguments[0],n=arguments[1];n.x=this._coordinates[e].x,n.y=this._coordinates[e].y,n.z=this._coordinates[e].z}},uh.prototype.getCoordinateCopy=function(t){return new bu(this._coordinates[t])},uh.prototype.getDimension=function(){return this._dimension},uh.prototype.getX=function(t){return this._coordinates[t].x},uh.prototype.clone=function(){for(var t=new Array(this.size()).fill(null),e=0;e<this._coordinates.length;e++)t[e]=this._coordinates[e].clone();return new uh(t,this._dimension)},uh.prototype.expandEnvelope=function(t){for(var e=0;e<this._coordinates.length;e++)t.expandToInclude(this._coordinates[e]);return t},uh.prototype.copy=function(){for(var t=new Array(this.size()).fill(null),e=0;e<this._coordinates.length;e++)t[e]=this._coordinates[e].copy();return new uh(t,this._dimension)},uh.prototype.toString=function(){if(this._coordinates.length>0){var t=new Ru(17*this._coordinates.length);t.append("("),t.append(this._coordinates[0]);for(var e=1;e<this._coordinates.length;e++)t.append(", "),t.append(this._coordinates[e]);return t.append(")"),t.toString()}return"()"},uh.prototype.getY=function(t){return this._coordinates[t].y},uh.prototype.toCoordinateArray=function(){return this._coordinates},uh.prototype.interfaces_=function(){return[Bu,Li]},uh.prototype.getClass=function(){return uh},ch.serialVersionUID.get=function(){return-0xcb44a778db18e00},Object.defineProperties(uh,ch);var hh=function(){},lh={serialVersionUID:{configurable:!0},instanceObject:{configurable:!0}};hh.prototype.readResolve=function(){return hh.instance()},hh.prototype.create=function(){if(1===arguments.length){if(arguments[0]instanceof Array)return new uh(arguments[0]);if(Lu(arguments[0],Bu))return new uh(arguments[0])}else if(2===arguments.length){var t=arguments[0],e=arguments[1];return e>3&&(e=3),e<2?new uh(t):new uh(t,e)}},hh.prototype.interfaces_=function(){return[Cu,Li]},hh.prototype.getClass=function(){return hh},hh.instance=function(){return hh.instanceObject},lh.serialVersionUID.get=function(){return-0x38e49fa6cf6f2e00},lh.instanceObject.get=function(){return new hh},Object.defineProperties(hh,lh);var ph=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 bc,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 Rc;return this.map_.entries().forEach((function(e){return t.add(e)})),t},e.prototype.size=function(){return this.map_.size()},e}(Pc),fh=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 dh){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}},gh={serialVersionUID:{configurable:!0},maximumPreciseValue:{configurable:!0}};fh.prototype.equals=function(t){if(!(t instanceof fh))return!1;var e=t;return this._modelType===e._modelType&&this._scale===e._scale},fh.prototype.compareTo=function(t){var e=t,n=this.getMaximumSignificantDigits(),r=e.getMaximumSignificantDigits();return new Tu(n).compareTo(new Tu(r))},fh.prototype.getScale=function(){return this._scale},fh.prototype.isFloating=function(){return this._modelType===fh.FLOATING||this._modelType===fh.FLOATING_SINGLE},fh.prototype.getType=function(){return this._modelType},fh.prototype.toString=function(){var t="UNKNOWN";return this._modelType===fh.FLOATING?t="Floating":this._modelType===fh.FLOATING_SINGLE?t="Floating-Single":this._modelType===fh.FIXED&&(t="Fixed (Scale="+this.getScale()+")"),t},fh.prototype.makePrecise=function(){if("number"==typeof arguments[0]){var t=arguments[0];return mu.isNaN(t)||this._modelType===fh.FLOATING_SINGLE?t:this._modelType===fh.FIXED?Math.round(t*this._scale)/this._scale:t}if(arguments[0]instanceof bu){var e=arguments[0];if(this._modelType===fh.FLOATING)return null;e.x=this.makePrecise(e.x),e.y=this.makePrecise(e.y)}},fh.prototype.getMaximumSignificantDigits=function(){var t=16;return this._modelType===fh.FLOATING?t=16:this._modelType===fh.FLOATING_SINGLE?t=6:this._modelType===fh.FIXED&&(t=1+Math.trunc(Math.ceil(Math.log(this.getScale())/Math.log(10)))),t},fh.prototype.setScale=function(t){this._scale=Math.abs(t)},fh.prototype.interfaces_=function(){return[Li,xu]},fh.prototype.getClass=function(){return fh},fh.mostPrecise=function(t,e){return t.compareTo(e)>=0?t:e},gh.serialVersionUID.get=function(){return 0x6bee6404e9a25c00},gh.maximumPreciseValue.get=function(){return 9007199254740992},Object.defineProperties(fh,gh);var dh=function t(e){this._name=e||null,t.nameToTypeMap.put(e,this)},yh={serialVersionUID:{configurable:!0},nameToTypeMap:{configurable:!0}};dh.prototype.readResolve=function(){return dh.nameToTypeMap.get(this._name)},dh.prototype.toString=function(){return this._name},dh.prototype.interfaces_=function(){return[Li]},dh.prototype.getClass=function(){return dh},yh.serialVersionUID.get=function(){return-552860263173159e4},yh.nameToTypeMap.get=function(){return new ph},Object.defineProperties(dh,yh),fh.Type=dh,fh.FIXED=new dh("FIXED"),fh.FLOATING=new dh("FLOATING"),fh.FLOATING_SINGLE=new dh("FLOATING SINGLE");var _h=function t(){this._precisionModel=new fh,this._SRID=0,this._coordinateSequenceFactory=t.getDefaultCoordinateSequenceFactory(),0===arguments.length||(1===arguments.length?Lu(arguments[0],Cu)?this._coordinateSequenceFactory=arguments[0]:arguments[0]instanceof fh&&(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]))},mh={serialVersionUID:{configurable:!0}};_h.prototype.toGeometry=function(t){return t.isNull()?this.createPoint(null):t.getMinX()===t.getMaxX()&&t.getMinY()===t.getMaxY()?this.createPoint(new bu(t.getMinX(),t.getMinY())):t.getMinX()===t.getMaxX()||t.getMinY()===t.getMaxY()?this.createLineString([new bu(t.getMinX(),t.getMinY()),new bu(t.getMaxX(),t.getMaxY())]):this.createPolygon(this.createLinearRing([new bu(t.getMinX(),t.getMinY()),new bu(t.getMinX(),t.getMaxY()),new bu(t.getMaxX(),t.getMaxY()),new bu(t.getMaxX(),t.getMinY()),new bu(t.getMinX(),t.getMinY())]),null)},_h.prototype.createLineString=function(t){return t?t instanceof Array?new Jc(this.getCoordinateSequenceFactory().create(t),this):Lu(t,Bu)?new Jc(t,this):void 0:new Jc(this.getCoordinateSequenceFactory().create([]),this)},_h.prototype.createMultiLineString=function(){return 0===arguments.length?new Xc(null,this):1===arguments.length?new Xc(arguments[0],this):void 0},_h.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(_h.toGeometryArray(t));var a=t.iterator().next();if(t.size()>1){if(a instanceof $c)return this.createMultiPolygon(_h.toPolygonArray(t));if(a instanceof Jc)return this.createMultiLineString(_h.toLineStringArray(t));if(a instanceof Kc)return this.createMultiPoint(_h.toPointArray(t));tc.shouldNeverReachHere("Unhandled class: "+a.getClass().getName())}return a},_h.prototype.createMultiPointFromCoords=function(t){return this.createMultiPoint(null!==t?this.getCoordinateSequenceFactory().create(t):null)},_h.prototype.createPoint=function(){if(0===arguments.length)return this.createPoint(this.getCoordinateSequenceFactory().create([]));if(1===arguments.length){if(arguments[0]instanceof bu){var t=arguments[0];return this.createPoint(null!==t?this.getCoordinateSequenceFactory().create([t]):null)}if(Lu(arguments[0],Bu))return new Kc(arguments[0],this)}},_h.prototype.getCoordinateSequenceFactory=function(){return this._coordinateSequenceFactory},_h.prototype.createPolygon=function(){if(0===arguments.length)return new $c(null,null,this);if(1===arguments.length){if(Lu(arguments[0],Bu)){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 eh){var n=arguments[0];return this.createPolygon(n,null)}}else if(2===arguments.length)return new $c(arguments[0],arguments[1],this)},_h.prototype.getSRID=function(){return this._SRID},_h.prototype.createGeometryCollection=function(){return 0===arguments.length?new jc(null,this):1===arguments.length?new jc(arguments[0],this):void 0},_h.prototype.createGeometry=function(t){return new rh(this).edit(t,{edit:function(){if(2===arguments.length){var t=arguments[0];return this._coordinateSequenceFactory.create(t)}}})},_h.prototype.getPrecisionModel=function(){return this._precisionModel},_h.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(Lu(arguments[0],Bu))return new eh(arguments[0],this)}},_h.prototype.createMultiPolygon=function(){return 0===arguments.length?new nh(null,this):1===arguments.length?new nh(arguments[0],this):void 0},_h.prototype.createMultiPoint=function(){if(0===arguments.length)return new th(null,this);if(1===arguments.length){if(arguments[0]instanceof Array)return new th(arguments[0],this);if(arguments[0]instanceof Array){var t=arguments[0];return this.createMultiPoint(null!==t?this.getCoordinateSequenceFactory().create(t):null)}if(Lu(arguments[0],Bu)){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<e.size();r++){var i=this.getCoordinateSequenceFactory().create(1,e.getDimension());Wc.copy(e,r,i,0,1),n[r]=this.createPoint(i)}return this.createMultiPoint(n)}}},_h.prototype.interfaces_=function(){return[Li]},_h.prototype.getClass=function(){return _h},_h.toMultiPolygonArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},_h.toGeometryArray=function(t){if(null===t)return null;var e=new Array(t.size()).fill(null);return t.toArray(e)},_h.getDefaultCoordinateSequenceFactory=function(){return hh.instance()},_h.toMultiLineStringArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},_h.toLineStringArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},_h.toMultiPointArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},_h.toLinearRingArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},_h.toPointArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},_h.toPolygonArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},_h.createPointFromInternalCoord=function(t,e){return e.getPrecisionModel().makePrecise(t),e.getFactory().createPoint(t)},mh.serialVersionUID.get=function(){return-0x5ea75f2051eeb400},Object.defineProperties(_h,mh);var vh=["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon"],xh=function(t){this.geometryFactory=t||new _h};xh.prototype.read=function(t){var e,n=(e="string"==typeof t?JSON.parse(t):t).type;if(!Eh[n])throw new Error("Unknown GeoJSON type: "+e.type);return-1!==vh.indexOf(n)?Eh[n].apply(this,[e.coordinates]):"GeometryCollection"===n?Eh[n].apply(this,[e.geometries]):Eh[n].apply(this,[e])},xh.prototype.write=function(t){var e=t.getGeometryType();if(!wh[e])throw new Error("Geometry is not supported");return wh[e].apply(this,[t])};var Eh={Feature:function(t){var e={};for(var n in t)e[n]=t[n];if(t.geometry){var r=t.geometry.type;if(!Eh[r])throw new Error("Unknown GeoJSON type: "+t.type);e.geometry=this.read(t.geometry)}return t.bbox&&(e.bbox=Eh.bbox.apply(this,[t.bbox])),e},FeatureCollection:function(t){var e={};if(t.features){e.features=[];for(var n=0;n<t.features.length;++n)e.features.push(this.read(t.features[n]))}return t.bbox&&(e.bbox=this.parse.bbox.apply(this,[t.bbox])),e},coordinates:function(t){for(var e=[],n=0;n<t.length;++n){var r=t[n];e.push(new bu(r[0],r[1]))}return e},bbox:function(t){return this.geometryFactory.createLinearRing([new bu(t[0],t[1]),new bu(t[2],t[1]),new bu(t[2],t[3]),new bu(t[0],t[3]),new bu(t[0],t[1])])},Point:function(t){var e=new bu(t[0],t[1]);return this.geometryFactory.createPoint(e)},MultiPoint:function(t){for(var e=[],n=0;n<t.length;++n)e.push(Eh.Point.apply(this,[t[n]]));return this.geometryFactory.createMultiPoint(e)},LineString:function(t){var e=Eh.coordinates.apply(this,[t]);return this.geometryFactory.createLineString(e)},MultiLineString:function(t){for(var e=[],n=0;n<t.length;++n)e.push(Eh.LineString.apply(this,[t[n]]));return this.geometryFactory.createMultiLineString(e)},Polygon:function(t){for(var e=Eh.coordinates.apply(this,[t[0]]),n=this.geometryFactory.createLinearRing(e),r=[],i=1;i<t.length;++i){var o=t[i],s=Eh.coordinates.apply(this,[o]),a=this.geometryFactory.createLinearRing(s);r.push(a)}return this.geometryFactory.createPolygon(n,r)},MultiPolygon:function(t){for(var e=[],n=0;n<t.length;++n){var r=t[n];e.push(Eh.Polygon.apply(this,[r]))}return this.geometryFactory.createMultiPolygon(e)},GeometryCollection:function(t){for(var e=[],n=0;n<t.length;++n){var r=t[n];e.push(this.read(r))}return this.geometryFactory.createGeometryCollection(e)}},wh={coordinate:function(t){return[t.x,t.y]},Point:function(t){return{type:"Point",coordinates:wh.coordinate.apply(this,[t.getCoordinate()])}},MultiPoint:function(t){for(var e=[],n=0;n<t._geometries.length;++n){var r=t._geometries[n],i=wh.Point.apply(this,[r]);e.push(i.coordinates)}return{type:"MultiPoint",coordinates:e}},LineString:function(t){for(var e=[],n=t.getCoordinates(),r=0;r<n.length;++r){var i=n[r];e.push(wh.coordinate.apply(this,[i]))}return{type:"LineString",coordinates:e}},MultiLineString:function(t){for(var e=[],n=0;n<t._geometries.length;++n){var r=t._geometries[n],i=wh.LineString.apply(this,[r]);e.push(i.coordinates)}return{type:"MultiLineString",coordinates:e}},Polygon:function(t){var e=[],n=wh.LineString.apply(this,[t._shell]);e.push(n.coordinates);for(var r=0;r<t._holes.length;++r){var i=t._holes[r],o=wh.LineString.apply(this,[i]);e.push(o.coordinates)}return{type:"Polygon",coordinates:e}},MultiPolygon:function(t){for(var e=[],n=0;n<t._geometries.length;++n){var r=t._geometries[n],i=wh.Polygon.apply(this,[r]);e.push(i.coordinates)}return{type:"MultiPolygon",coordinates:e}},GeometryCollection:function(t){for(var e=[],n=0;n<t._geometries.length;++n){var r=t._geometries[n],i=r.getGeometryType();e.push(wh[i].apply(this,[r]))}return{type:"GeometryCollection",geometries:e}}},bh=function(t){this.geometryFactory=t||new _h,this.precisionModel=this.geometryFactory.getPrecisionModel(),this.parser=new xh(this.geometryFactory)};bh.prototype.read=function(t){var e=this.parser.read(t);return this.precisionModel.getType()===fh.FIXED&&this.reducePrecision(e),e},bh.prototype.reducePrecision=function(t){var e,n;if(t.coordinate)this.precisionModel.makePrecise(t.coordinate);else if(t.points)for(e=0,n=t.points.length;e<n;e++)this.precisionModel.makePrecise(t.points[e]);else if(t.geometries)for(e=0,n=t.geometries.length;e<n;e++)this.reducePrecision(t.geometries[e])};var Ih=function(){this.parser=new xh(this.geometryFactory)};Ih.prototype.write=function(t){return this.parser.write(t)};var Nh=function(){},Ch={ON:{configurable:!0},LEFT:{configurable:!0},RIGHT:{configurable:!0}};Nh.prototype.interfaces_=function(){return[]},Nh.prototype.getClass=function(){return Nh},Nh.opposite=function(t){return t===Nh.LEFT?Nh.RIGHT:t===Nh.RIGHT?Nh.LEFT:t},Ch.ON.get=function(){return 0},Ch.LEFT.get=function(){return 1},Ch.RIGHT.get=function(){return 2},Object.defineProperties(Nh,Ch),(ji.prototype=new Error).name="EmptyStackException",(Xi.prototype=new wc).add=function(t){return this.array_.push(t),!0},Xi.prototype.get=function(t){if(t<0||t>=this.size())throw new Error;return this.array_[t]},Xi.prototype.push=function(t){return this.array_.push(t),t},Xi.prototype.pop=function(t){if(0===this.array_.length)throw new ji;return this.array_.pop()},Xi.prototype.peek=function(){if(0===this.array_.length)throw new ji;return this.array_[this.array_.length-1]},Xi.prototype.empty=function(){return 0===this.array_.length},Xi.prototype.isEmpty=function(){return this.empty()},Xi.prototype.search=function(t){return this.array_.indexOf(t)},Xi.prototype.size=function(){return this.array_.length},Xi.prototype.toArray=function(){for(var t=[],e=0,n=this.array_.length;e<n;e++)t.push(this.array_[e]);return t};var Sh=function(){this._minIndex=-1,this._minCoord=null,this._minDe=null,this._orientedDe=null};Sh.prototype.getCoordinate=function(){return this._minCoord},Sh.prototype.getRightmostSide=function(t,e){var n=this.getRightmostSideOfSegment(t,e);return n<0&&(n=this.getRightmostSideOfSegment(t,e-1)),n<0&&(this._minCoord=null,this.checkForRightmostCoordinate(t)),n},Sh.prototype.findRightmostEdgeAtVertex=function(){var t=this._minDe.getEdge().getCoordinates();tc.isTrue(this._minIndex>0&&this._minIndex<t.length,"rightmost point expected to be interior vertex of edge");var e=t[this._minIndex-1],n=t[this._minIndex+1],r=sc.computeOrientation(this._minCoord,n,e),i=!1;(e.y<this._minCoord.y&&n.y<this._minCoord.y&&r===sc.COUNTERCLOCKWISE||e.y>this._minCoord.y&&n.y>this._minCoord.y&&r===sc.CLOCKWISE)&&(i=!0),i&&(this._minIndex=this._minIndex-1)},Sh.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=Nh.LEFT;return n[e].y<n[e+1].y&&(r=Nh.RIGHT),r},Sh.prototype.getEdge=function(){return this._orientedDe},Sh.prototype.checkForRightmostCoordinate=function(t){for(var e=t.getEdge().getCoordinates(),n=0;n<e.length-1;n++)(null===this._minCoord||e[n].x>this._minCoord.x)&&(this._minDe=t,this._minIndex=n,this._minCoord=e[n])},Sh.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)},Sh.prototype.findEdge=function(t){for(var e=t.iterator();e.hasNext();){var n=e.next();n.isForward()&&this.checkForRightmostCoordinate(n)}tc.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)===Nh.LEFT&&(this._orientedDe=this._minDe.getSym())},Sh.prototype.interfaces_=function(){return[]},Sh.prototype.getClass=function(){return Sh};var Mh=function(t){function e(n,r){t.call(this,e.msgWithCoord(n,r)),this.pt=r?new bu(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}(Qu),Lh=function(){this.array_=[]};Lh.prototype.addLast=function(t){this.array_.push(t)},Lh.prototype.removeFirst=function(){return this.array_.shift()},Lh.prototype.isEmpty=function(){return 0===this.array_.length};var Ph=function(){this._finder=null,this._dirEdgeList=new bc,this._nodes=new bc,this._rightMostCoord=null,this._env=null,this._finder=new Sh};Ph.prototype.clearVisitedEdges=function(){for(var t=this._dirEdgeList.iterator();t.hasNext();)t.next().setVisited(!1)},Ph.prototype.getRightmostCoordinate=function(){return this._rightMostCoord},Ph.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 Mh("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)}},Ph.prototype.computeDepth=function(t){this.clearVisitedEdges();var e=this._finder.getEdge();e.setEdgeDepths(Nh.RIGHT,t),this.copySymDepths(e),this.computeDepths(e)},Ph.prototype.create=function(t){this.addReachable(t),this._finder.findEdge(this._dirEdgeList),this._rightMostCoord=this._finder.getCoordinate()},Ph.prototype.findResultEdges=function(){for(var t=this._dirEdgeList.iterator();t.hasNext();){var e=t.next();e.getDepth(Nh.RIGHT)>=1&&e.getDepth(Nh.LEFT)<=0&&!e.isInteriorAreaEdge()&&e.setInResult(!0)}},Ph.prototype.computeDepths=function(t){var e=new Rc,n=new Lh,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))}}}},Ph.prototype.compareTo=function(t){var e=t;return this._rightMostCoord.x<e._rightMostCoord.x?-1:this._rightMostCoord.x>e._rightMostCoord.x?1:0},Ph.prototype.getEnvelope=function(){if(null===this._env){for(var t=new Yu,e=this._dirEdgeList.iterator();e.hasNext();)for(var n=e.next().getEdge().getCoordinates(),r=0;r<n.length-1;r++)t.expandToInclude(n[r]);this._env=t}return this._env},Ph.prototype.addReachable=function(t){var e=new Xi;for(e.add(t);!e.empty();){var n=e.pop();this.add(n,e)}},Ph.prototype.copySymDepths=function(t){var e=t.getSym();e.setDepth(Nh.LEFT,t.getDepth(Nh.RIGHT)),e.setDepth(Nh.RIGHT,t.getDepth(Nh.LEFT))},Ph.prototype.add=function(t,e){t.setVisited(!0),this._nodes.add(t);for(var n=t.getEdges().iterator();n.hasNext();){var r=n.next();this._dirEdgeList.add(r);var i=r.getSym().getNode();i.isVisited()||e.push(i)}},Ph.prototype.getNodes=function(){return this._nodes},Ph.prototype.getDirectedEdges=function(){return this._dirEdgeList},Ph.prototype.interfaces_=function(){return[xu]},Ph.prototype.getClass=function(){return Ph};var Oh=function t(){if(this.location=null,1===arguments.length){if(arguments[0]instanceof Array){var e=arguments[0];this.init(e.length)}else if(Number.isInteger(arguments[0])){var n=arguments[0];this.init(1),this.location[Nh.ON]=n}else if(arguments[0]instanceof t){var r=arguments[0];if(this.init(r.location.length),null!==r)for(var i=0;i<this.location.length;i++)this.location[i]=r.location[i]}}else if(3===arguments.length){var o=arguments[0],s=arguments[1],a=arguments[2];this.init(3),this.location[Nh.ON]=o,this.location[Nh.LEFT]=s,this.location[Nh.RIGHT]=a}};Oh.prototype.setAllLocations=function(t){for(var e=0;e<this.location.length;e++)this.location[e]=t},Oh.prototype.isNull=function(){for(var t=0;t<this.location.length;t++)if(this.location[t]!==Su.NONE)return!1;return!0},Oh.prototype.setAllLocationsIfNull=function(t){for(var e=0;e<this.location.length;e++)this.location[e]===Su.NONE&&(this.location[e]=t)},Oh.prototype.isLine=function(){return 1===this.location.length},Oh.prototype.merge=function(t){if(t.location.length>this.location.length){var e=new Array(3).fill(null);e[Nh.ON]=this.location[Nh.ON],e[Nh.LEFT]=Su.NONE,e[Nh.RIGHT]=Su.NONE,this.location=e}for(var n=0;n<this.location.length;n++)this.location[n]===Su.NONE&&n<t.location.length&&(this.location[n]=t.location[n])},Oh.prototype.getLocations=function(){return this.location},Oh.prototype.flip=function(){if(this.location.length<=1)return null;var t=this.location[Nh.LEFT];this.location[Nh.LEFT]=this.location[Nh.RIGHT],this.location[Nh.RIGHT]=t},Oh.prototype.toString=function(){var t=new Ru;return this.location.length>1&&t.append(Su.toLocationSymbol(this.location[Nh.LEFT])),t.append(Su.toLocationSymbol(this.location[Nh.ON])),this.location.length>1&&t.append(Su.toLocationSymbol(this.location[Nh.RIGHT])),t.toString()},Oh.prototype.setLocations=function(t,e,n){this.location[Nh.ON]=t,this.location[Nh.LEFT]=e,this.location[Nh.RIGHT]=n},Oh.prototype.get=function(t){return t<this.location.length?this.location[t]:Su.NONE},Oh.prototype.isArea=function(){return this.location.length>1},Oh.prototype.isAnyNull=function(){for(var t=0;t<this.location.length;t++)if(this.location[t]===Su.NONE)return!0;return!1},Oh.prototype.setLocation=function(){if(1===arguments.length){var t=arguments[0];this.setLocation(Nh.ON,t)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this.location[e]=n}},Oh.prototype.init=function(t){this.location=new Array(t).fill(null),this.setAllLocations(Su.NONE)},Oh.prototype.isEqualOnSide=function(t,e){return this.location[e]===t.location[e]},Oh.prototype.allPositionsEqual=function(t){for(var e=0;e<this.location.length;e++)if(this.location[e]!==t)return!1;return!0},Oh.prototype.interfaces_=function(){return[]},Oh.prototype.getClass=function(){return Oh};var Rh=function t(){if(this.elt=new Array(2).fill(null),1===arguments.length){if(Number.isInteger(arguments[0])){var e=arguments[0];this.elt[0]=new Oh(e),this.elt[1]=new Oh(e)}else if(arguments[0]instanceof t){var n=arguments[0];this.elt[0]=new Oh(n.elt[0]),this.elt[1]=new Oh(n.elt[1])}}else if(2===arguments.length){var r=arguments[0],i=arguments[1];this.elt[0]=new Oh(Su.NONE),this.elt[1]=new Oh(Su.NONE),this.elt[r].setLocation(i)}else if(3===arguments.length){var o=arguments[0],s=arguments[1],a=arguments[2];this.elt[0]=new Oh(o,s,a),this.elt[1]=new Oh(o,s,a)}else if(4===arguments.length){var u=arguments[0],c=arguments[1],h=arguments[2],l=arguments[3];this.elt[0]=new Oh(Su.NONE,Su.NONE,Su.NONE),this.elt[1]=new Oh(Su.NONE,Su.NONE,Su.NONE),this.elt[u].setLocations(c,h,l)}};Rh.prototype.getGeometryCount=function(){var t=0;return this.elt[0].isNull()||t++,this.elt[1].isNull()||t++,t},Rh.prototype.setAllLocations=function(t,e){this.elt[t].setAllLocations(e)},Rh.prototype.isNull=function(t){return this.elt[t].isNull()},Rh.prototype.setAllLocationsIfNull=function(){if(1===arguments.length){var t=arguments[0];this.setAllLocationsIfNull(0,t),this.setAllLocationsIfNull(1,t)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this.elt[e].setAllLocationsIfNull(n)}},Rh.prototype.isLine=function(t){return this.elt[t].isLine()},Rh.prototype.merge=function(t){for(var e=0;e<2;e++)null===this.elt[e]&&null!==t.elt[e]?this.elt[e]=new Oh(t.elt[e]):this.elt[e].merge(t.elt[e])},Rh.prototype.flip=function(){this.elt[0].flip(),this.elt[1].flip()},Rh.prototype.getLocation=function(){if(1===arguments.length){var t=arguments[0];return this.elt[t].get(Nh.ON)}if(2===arguments.length){var e=arguments[0],n=arguments[1];return this.elt[e].get(n)}},Rh.prototype.toString=function(){var t=new Ru;return null!==this.elt[0]&&(t.append("A:"),t.append(this.elt[0].toString())),null!==this.elt[1]&&(t.append(" B:"),t.append(this.elt[1].toString())),t.toString()},Rh.prototype.isArea=function(){if(0===arguments.length)return this.elt[0].isArea()||this.elt[1].isArea();if(1===arguments.length){var t=arguments[0];return this.elt[t].isArea()}},Rh.prototype.isAnyNull=function(t){return this.elt[t].isAnyNull()},Rh.prototype.setLocation=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];this.elt[t].setLocation(Nh.ON,e)}else if(3===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2];this.elt[n].setLocation(r,i)}},Rh.prototype.isEqualOnSide=function(t,e){return this.elt[0].isEqualOnSide(t.elt[0],e)&&this.elt[1].isEqualOnSide(t.elt[1],e)},Rh.prototype.allPositionsEqual=function(t,e){return this.elt[t].allPositionsEqual(e)},Rh.prototype.toLine=function(t){this.elt[t].isArea()&&(this.elt[t]=new Oh(this.elt[t].location[0]))},Rh.prototype.interfaces_=function(){return[]},Rh.prototype.getClass=function(){return Rh},Rh.toLineLabel=function(t){for(var e=new Rh(Su.NONE),n=0;n<2;n++)e.setLocation(n,t.getLocation(n));return e};var Th=function(){this._startDe=null,this._maxNodeDegree=-1,this._edges=new bc,this._pts=new bc,this._label=new Rh(Su.NONE),this._ring=null,this._isHole=null,this._shell=null,this._holes=new bc,this._geometryFactory=null;var t=arguments[0],e=arguments[1];this._geometryFactory=e,this.computePoints(t),this.computeRing()};Th.prototype.computeRing=function(){if(null!==this._ring)return null;for(var t=new Array(this._pts.size()).fill(null),e=0;e<this._pts.size();e++)t[e]=this._pts.get(e);this._ring=this._geometryFactory.createLinearRing(t),this._isHole=sc.isCCW(this._ring.getCoordinates())},Th.prototype.isIsolated=function(){return 1===this._label.getGeometryCount()},Th.prototype.computePoints=function(t){this._startDe=t;var e=t,n=!0;do{if(null===e)throw new Mh("Found null DirectedEdge");if(e.getEdgeRing()===this)throw new Mh("Directed Edge visited twice during ring-building at "+e.getCoordinate());this._edges.add(e);var r=e.getLabel();tc.isTrue(r.isArea()),this.mergeLabel(r),this.addPoints(e.getEdge(),e.isForward(),n),n=!1,this.setEdgeRing(e,this),e=this.getNext(e)}while(e!==this._startDe)},Th.prototype.getLinearRing=function(){return this._ring},Th.prototype.getCoordinate=function(t){return this._pts.get(t)},Th.prototype.computeMaxNodeDegree=function(){this._maxNodeDegree=0;var t=this._startDe;do{var e=t.getNode().getEdges().getOutgoingDegree(this);e>this._maxNodeDegree&&(this._maxNodeDegree=e),t=this.getNext(t)}while(t!==this._startDe);this._maxNodeDegree*=2},Th.prototype.addPoints=function(t,e,n){var r=t.getCoordinates();if(e){var i=1;n&&(i=0);for(var o=i;o<r.length;o++)this._pts.add(r[o])}else{var s=r.length-2;n&&(s=r.length-1);for(var a=s;a>=0;a--)this._pts.add(r[a])}},Th.prototype.isHole=function(){return this._isHole},Th.prototype.setInResult=function(){var t=this._startDe;do{t.getEdge().setInResult(!0),t=t.getNext()}while(t!==this._startDe)},Th.prototype.containsPoint=function(t){var e=this.getLinearRing();if(!e.getEnvelopeInternal().contains(t))return!1;if(!sc.isPointInRing(t,e.getCoordinates()))return!1;for(var n=this._holes.iterator();n.hasNext();)if(n.next().containsPoint(t))return!1;return!0},Th.prototype.addHole=function(t){this._holes.add(t)},Th.prototype.isShell=function(){return null===this._shell},Th.prototype.getLabel=function(){return this._label},Th.prototype.getEdges=function(){return this._edges},Th.prototype.getMaxNodeDegree=function(){return this._maxNodeDegree<0&&this.computeMaxNodeDegree(),this._maxNodeDegree},Th.prototype.getShell=function(){return this._shell},Th.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,Nh.RIGHT);if(n===Su.NONE)return null;if(this._label.getLocation(e)===Su.NONE)return this._label.setLocation(e,n),null}},Th.prototype.setShell=function(t){this._shell=t,null!==t&&t.addHole(this)},Th.prototype.toPolygon=function(t){for(var e=new Array(this._holes.size()).fill(null),n=0;n<this._holes.size();n++)e[n]=this._holes.get(n).getLinearRing();return t.createPolygon(this.getLinearRing(),e)},Th.prototype.interfaces_=function(){return[]},Th.prototype.getClass=function(){return Th};var Ah=function(t){function e(){var e=arguments[0],n=arguments[1];t.call(this,e,n)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.setEdgeRing=function(t,e){t.setMinEdgeRing(e)},e.prototype.getNext=function(t){return t.getNextMin()},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Th),Dh=function(t){function e(){var e=arguments[0],n=arguments[1];t.call(this,e,n)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.buildMinimalRings=function(){var t=new bc,e=this._startDe;do{if(null===e.getMinEdgeRing()){var n=new Ah(e,this._geometryFactory);t.add(n)}e=e.getNext()}while(e!==this._startDe);return t},e.prototype.setEdgeRing=function(t,e){t.setEdgeRing(e)},e.prototype.linkDirectedEdgesForMinimalEdgeRings=function(){var t=this._startDe;do{t.getNode().getEdges().linkMinimalDirectedEdges(this),t=t.getNext()}while(t!==this._startDe)},e.prototype.getNext=function(t){return t.getNext()},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Th),Fh=function(){if(this._label=null,this._isInResult=!1,this._isCovered=!1,this._isCoveredSet=!1,this._isVisited=!1,0===arguments.length);else if(1===arguments.length){var t=arguments[0];this._label=t}};Fh.prototype.setVisited=function(t){this._isVisited=t},Fh.prototype.setInResult=function(t){this._isInResult=t},Fh.prototype.isCovered=function(){return this._isCovered},Fh.prototype.isCoveredSet=function(){return this._isCoveredSet},Fh.prototype.setLabel=function(t){this._label=t},Fh.prototype.getLabel=function(){return this._label},Fh.prototype.setCovered=function(t){this._isCovered=t,this._isCoveredSet=!0},Fh.prototype.updateIM=function(t){tc.isTrue(this._label.getGeometryCount()>=2,"found partial label"),this.computeIM(t)},Fh.prototype.isInResult=function(){return this._isInResult},Fh.prototype.isVisited=function(){return this._isVisited},Fh.prototype.interfaces_=function(){return[]},Fh.prototype.getClass=function(){return Fh};var qh=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 Rh(0,Su.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=Su.NONE;if(n=this._label.getLocation(e),!t.isNull(e)){var r=t.getLocation(e);n!==Su.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 Rh(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 Rh)for(var n=arguments[0],r=0;r<2;r++){var i=this.computeMergedLocation(n,r);this._label.getLocation(r)===Su.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=Su.NONE;null!==this._label&&(e=this._label.getLocation(t));var n=null;switch(e){case Su.BOUNDARY:n=Su.INTERIOR;break;case Su.INTERIOR:default:n=Su.BOUNDARY}this._label.setLocation(t,n)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Fh),Gh=function(){this.nodeMap=new Gi,this.nodeFact=null;var t=arguments[0];this.nodeFact=t};Gh.prototype.find=function(t){return this.nodeMap.get(t)},Gh.prototype.addNode=function(){if(arguments[0]instanceof bu){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 qh){var n=arguments[0],r=this.nodeMap.get(n.getCoordinate());return null===r?(this.nodeMap.put(n.getCoordinate(),n),n):(r.mergeLabel(n),r)}},Gh.prototype.print=function(t){for(var e=this.iterator();e.hasNext();)e.next().print(t)},Gh.prototype.iterator=function(){return this.nodeMap.values().iterator()},Gh.prototype.values=function(){return this.nodeMap.values()},Gh.prototype.getBoundaryNodes=function(t){for(var e=new bc,n=this.iterator();n.hasNext();){var r=n.next();r.getLabel().getLocation(t)===Su.BOUNDARY&&e.add(r)}return e},Gh.prototype.add=function(t){var e=t.getCoordinate();this.addNode(e).add(t)},Gh.prototype.interfaces_=function(){return[]},Gh.prototype.getClass=function(){return Gh};var Bh=function(){},kh={NE:{configurable:!0},NW:{configurable:!0},SW:{configurable:!0},SE:{configurable:!0}};Bh.prototype.interfaces_=function(){return[]},Bh.prototype.getClass=function(){return Bh},Bh.isNorthern=function(t){return t===Bh.NE||t===Bh.NW},Bh.isOpposite=function(t,e){return t!==e&&2===(t-e+4)%4},Bh.commonHalfPlane=function(t,e){if(t===e)return t;if(2===(t-e+4)%4)return-1;var n=t<e?t:e;return 0===n&&3===(t>e?t:e)?3:n},Bh.isInHalfPlane=function(t,e){return e===Bh.SE?t===Bh.SE||t===Bh.SW:t===e||t===e+1},Bh.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 _u("Cannot compute the quadrant for point ( "+t+", "+e+" )");return t>=0?e>=0?Bh.NE:Bh.SE:e>=0?Bh.NW:Bh.SW}if(arguments[0]instanceof bu&&arguments[1]instanceof bu){var n=arguments[0],r=arguments[1];if(r.x===n.x&&r.y===n.y)throw new _u("Cannot compute the quadrant for two identical points "+n);return r.x>=n.x?r.y>=n.y?Bh.NE:Bh.SE:r.y>=n.y?Bh.NW:Bh.SW}},kh.NE.get=function(){return 0},kh.NW.get=function(){return 1},kh.SW.get=function(){return 2},kh.SE.get=function(){return 3},Object.defineProperties(Bh,kh);var zh=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}};zh.prototype.compareDirection=function(t){return this._dx===t._dx&&this._dy===t._dy?0:this._quadrant>t._quadrant?1:this._quadrant<t._quadrant?-1:sc.computeOrientation(t._p0,t._p1,this._p1)},zh.prototype.getDy=function(){return this._dy},zh.prototype.getCoordinate=function(){return this._p0},zh.prototype.setNode=function(t){this._node=t},zh.prototype.print=function(t){var e=Math.atan2(this._dy,this._dx),n=this.getClass().getName(),r=n.lastIndexOf("."),i=n.substring(r+1);t.print(" "+i+": "+this._p0+" - "+this._p1+" "+this._quadrant+":"+e+" "+this._label)},zh.prototype.compareTo=function(t){var e=t;return this.compareDirection(e)},zh.prototype.getDirectedCoordinate=function(){return this._p1},zh.prototype.getDx=function(){return this._dx},zh.prototype.getLabel=function(){return this._label},zh.prototype.getEdge=function(){return this._edge},zh.prototype.getQuadrant=function(){return this._quadrant},zh.prototype.getNode=function(){return this._node},zh.prototype.toString=function(){var t=Math.atan2(this._dy,this._dx),e=this.getClass().getName(),n=e.lastIndexOf(".");return" "+e.substring(n+1)+": "+this._p0+" - "+this._p1+" "+this._quadrant+":"+t+" "+this._label},zh.prototype.computeLabel=function(t){},zh.prototype.init=function(t,e){this._p0=t,this._p1=e,this._dx=e.x-t.x,this._dy=e.y-t.y,this._quadrant=Bh.quadrant(this._dx,this._dy),tc.isTrue(!(0===this._dx&&0===this._dy),"EdgeEnd with identical endpoints found")},zh.prototype.interfaces_=function(){return[xu]},zh.prototype.getClass=function(){return zh};var jh=function(t){function e(){var e=arguments[0],n=arguments[1];if(t.call(this,e),this._isForward=null,this._isInResult=!1,this._isVisited=!1,this._sym=null,this._next=null,this._nextMin=null,this._edgeRing=null,this._minEdgeRing=null,this._depth=[0,-999,-999],this._isForward=n,n)this.init(e.getCoordinate(0),e.getCoordinate(1));else{var r=e.getNumPoints()-1;this.init(e.getCoordinate(r),e.getCoordinate(r-1))}this.computeDirectedLabel()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getNextMin=function(){return this._nextMin},e.prototype.getDepth=function(t){return this._depth[t]},e.prototype.setVisited=function(t){this._isVisited=t},e.prototype.computeDirectedLabel=function(){this._label=new Rh(this._edge.getLabel()),this._isForward||this._label.flip()},e.prototype.getNext=function(){return this._next},e.prototype.setDepth=function(t,e){if(-999!==this._depth[t]&&this._depth[t]!==e)throw new Mh("assigned depths do not match",this.getCoordinate());this._depth[t]=e},e.prototype.isInteriorAreaEdge=function(){for(var t=!0,e=0;e<2;e++)this._label.isArea(e)&&this._label.getLocation(e,Nh.LEFT)===Su.INTERIOR&&this._label.getLocation(e,Nh.RIGHT)===Su.INTERIOR||(t=!1);return t},e.prototype.setNextMin=function(t){this._nextMin=t},e.prototype.print=function(e){t.prototype.print.call(this,e),e.print(" "+this._depth[Nh.LEFT]+"/"+this._depth[Nh.RIGHT]),e.print(" ("+this.getDepthDelta()+")"),this._isInResult&&e.print(" inResult")},e.prototype.setMinEdgeRing=function(t){this._minEdgeRing=t},e.prototype.isLineEdge=function(){var t=this._label.isLine(0)||this._label.isLine(1),e=!this._label.isArea(0)||this._label.allPositionsEqual(0,Su.EXTERIOR),n=!this._label.isArea(1)||this._label.allPositionsEqual(1,Su.EXTERIOR);return t&&e&&n},e.prototype.setEdgeRing=function(t){this._edgeRing=t},e.prototype.getMinEdgeRing=function(){return this._minEdgeRing},e.prototype.getDepthDelta=function(){var t=this._edge.getDepthDelta();return this._isForward||(t=-t),t},e.prototype.setInResult=function(t){this._isInResult=t},e.prototype.getSym=function(){return this._sym},e.prototype.isForward=function(){return this._isForward},e.prototype.getEdge=function(){return this._edge},e.prototype.printEdge=function(t){this.print(t),t.print(" "),this._isForward?this._edge.print(t):this._edge.printReverse(t)},e.prototype.setSym=function(t){this._sym=t},e.prototype.setVisitedEdge=function(t){this.setVisited(t),this._sym.setVisited(t)},e.prototype.setEdgeDepths=function(t,e){var n=this.getEdge().getDepthDelta();this._isForward||(n=-n);var r=1;t===Nh.LEFT&&(r=-1);var i=Nh.opposite(t),o=e+n*r;this.setDepth(t,e),this.setDepth(i,o)},e.prototype.getEdgeRing=function(){return this._edgeRing},e.prototype.isInResult=function(){return this._isInResult},e.prototype.setNext=function(t){this._next=t},e.prototype.isVisited=function(){return this._isVisited},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.depthFactor=function(t,e){return t===Su.EXTERIOR&&e===Su.INTERIOR?1:t===Su.INTERIOR&&e===Su.EXTERIOR?-1:0},e}(zh),Xh=function(){};Xh.prototype.createNode=function(t){return new qh(t,null)},Xh.prototype.interfaces_=function(){return[]},Xh.prototype.getClass=function(){return Xh};var Uh=function(){if(this._edges=new bc,this._nodes=null,this._edgeEndList=new bc,0===arguments.length)this._nodes=new Gh(new Xh);else if(1===arguments.length){var t=arguments[0];this._nodes=new Gh(t)}};Uh.prototype.printEdges=function(t){t.println("Edges:");for(var e=0;e<this._edges.size();e++){t.println("edge "+e+":");var n=this._edges.get(e);n.print(t),n.eiList.print(t)}},Uh.prototype.find=function(t){return this._nodes.find(t)},Uh.prototype.addNode=function(){if(arguments[0]instanceof qh){var t=arguments[0];return this._nodes.addNode(t)}if(arguments[0]instanceof bu){var e=arguments[0];return this._nodes.addNode(e)}},Uh.prototype.getNodeIterator=function(){return this._nodes.iterator()},Uh.prototype.linkResultDirectedEdges=function(){for(var t=this._nodes.iterator();t.hasNext();)t.next().getEdges().linkResultDirectedEdges()},Uh.prototype.debugPrintln=function(t){Xu.out.println(t)},Uh.prototype.isBoundaryNode=function(t,e){var n=this._nodes.find(e);if(null===n)return!1;var r=n.getLabel();return null!==r&&r.getLocation(t)===Su.BOUNDARY},Uh.prototype.linkAllDirectedEdges=function(){for(var t=this._nodes.iterator();t.hasNext();)t.next().getEdges().linkAllDirectedEdges()},Uh.prototype.matchInSameDirection=function(t,e,n,r){return!!t.equals(n)&&sc.computeOrientation(t,e,r)===sc.COLLINEAR&&Bh.quadrant(t,e)===Bh.quadrant(n,r)},Uh.prototype.getEdgeEnds=function(){return this._edgeEndList},Uh.prototype.debugPrint=function(t){Xu.out.print(t)},Uh.prototype.getEdgeIterator=function(){return this._edges.iterator()},Uh.prototype.findEdgeInSameDirection=function(t,e){for(var n=0;n<this._edges.size();n++){var r=this._edges.get(n),i=r.getCoordinates();if(this.matchInSameDirection(t,e,i[0],i[1]))return r;if(this.matchInSameDirection(t,e,i[i.length-1],i[i.length-2]))return r}return null},Uh.prototype.insertEdge=function(t){this._edges.add(t)},Uh.prototype.findEdgeEnd=function(t){for(var e=this.getEdgeEnds().iterator();e.hasNext();){var n=e.next();if(n.getEdge()===t)return n}return null},Uh.prototype.addEdges=function(t){for(var e=t.iterator();e.hasNext();){var n=e.next();this._edges.add(n);var r=new jh(n,!0),i=new jh(n,!1);r.setSym(i),i.setSym(r),this.add(r),this.add(i)}},Uh.prototype.add=function(t){this._nodes.add(t),this._edgeEndList.add(t)},Uh.prototype.getNodes=function(){return this._nodes.values()},Uh.prototype.findEdge=function(t,e){for(var n=0;n<this._edges.size();n++){var r=this._edges.get(n),i=r.getCoordinates();if(t.equals(i[0])&&e.equals(i[1]))return r}return null},Uh.prototype.interfaces_=function(){return[]},Uh.prototype.getClass=function(){return Uh},Uh.linkResultDirectedEdges=function(t){for(var e=t.iterator();e.hasNext();)e.next().getEdges().linkResultDirectedEdges()};var Yh=function(){this._geometryFactory=null,this._shellList=new bc;var t=arguments[0];this._geometryFactory=t};Yh.prototype.sortShellsAndHoles=function(t,e,n){for(var r=t.iterator();r.hasNext();){var i=r.next();i.isHole()?n.add(i):e.add(i)}},Yh.prototype.computePolygons=function(t){for(var e=new bc,n=t.iterator();n.hasNext();){var r=n.next().toPolygon(this._geometryFactory);e.add(r)}return e},Yh.prototype.placeFreeHoles=function(t,e){for(var n=e.iterator();n.hasNext();){var r=n.next();if(null===r.getShell()){var i=this.findEdgeRingContaining(r,t);if(null===i)throw new Mh("unable to assign hole to a shell",r.getCoordinate(0));r.setShell(i)}}},Yh.prototype.buildMinimalEdgeRings=function(t,e,n){for(var r=new bc,i=t.iterator();i.hasNext();){var o=i.next();if(o.getMaxNodeDegree()>2){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},Yh.prototype.containsPoint=function(t){for(var e=this._shellList.iterator();e.hasNext();)if(e.next().containsPoint(t))return!0;return!1},Yh.prototype.buildMaximalEdgeRings=function(t){for(var e=new bc,n=t.iterator();n.hasNext();){var r=n.next();if(r.isInResult()&&r.getLabel().isArea()&&null===r.getEdgeRing()){var i=new Dh(r,this._geometryFactory);e.add(i),i.setInResult()}}return e},Yh.prototype.placePolygonHoles=function(t,e){for(var n=e.iterator();n.hasNext();){var r=n.next();r.isHole()&&r.setShell(t)}},Yh.prototype.getPolygons=function(){return this.computePolygons(this._shellList)},Yh.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(),c=u.getLinearRing(),h=c.getEnvelopeInternal();null!==o&&(s=o.getLinearRing().getEnvelopeInternal());var l=!1;h.contains(r)&&sc.isPointInRing(i,c.getCoordinates())&&(l=!0),l&&(null===o||s.contains(h))&&(o=u)}return o},Yh.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 tc.isTrue(e<=1,"found two shells in MinimalEdgeRing list"),n},Yh.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];Uh.linkResultDirectedEdges(n);var r=this.buildMaximalEdgeRings(e),i=new bc,o=this.buildMinimalEdgeRings(r,this._shellList,i);this.sortShellsAndHoles(o,this._shellList,i),this.placeFreeHoles(this._shellList,i)}},Yh.prototype.interfaces_=function(){return[]},Yh.prototype.getClass=function(){return Yh};var Vh=function(){};Vh.prototype.getBounds=function(){},Vh.prototype.interfaces_=function(){return[]},Vh.prototype.getClass=function(){return Vh};var Hh=function(){this._bounds=null,this._item=null;var t=arguments[0],e=arguments[1];this._bounds=t,this._item=e};Hh.prototype.getItem=function(){return this._item},Hh.prototype.getBounds=function(){return this._bounds},Hh.prototype.interfaces_=function(){return[Vh,Li]},Hh.prototype.getClass=function(){return Hh};var Wh=function(){this._size=null,this._items=null,this._size=0,this._items=new bc,this._items.add(null)};Wh.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},Wh.prototype.size=function(){return this._size},Wh.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)},Wh.prototype.clear=function(){this._size=0,this._items.clear()},Wh.prototype.isEmpty=function(){return 0===this._size},Wh.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)},Wh.prototype.interfaces_=function(){return[]},Wh.prototype.getClass=function(){return Wh};var Jh=function(){};Jh.prototype.visitItem=function(t){},Jh.prototype.interfaces_=function(){return[]},Jh.prototype.getClass=function(){return Jh};var Zh=function(){};Zh.prototype.insert=function(t,e){},Zh.prototype.remove=function(t,e){},Zh.prototype.query=function(){},Zh.prototype.interfaces_=function(){return[]},Zh.prototype.getClass=function(){return Zh};var Kh=function(){if(this._childBoundables=new bc,this._bounds=null,this._level=null,0===arguments.length);else if(1===arguments.length){var t=arguments[0];this._level=t}},Qh={serialVersionUID:{configurable:!0}};Kh.prototype.getLevel=function(){return this._level},Kh.prototype.size=function(){return this._childBoundables.size()},Kh.prototype.getChildBoundables=function(){return this._childBoundables},Kh.prototype.addChildBoundable=function(t){tc.isTrue(null===this._bounds),this._childBoundables.add(t)},Kh.prototype.isEmpty=function(){return this._childBoundables.isEmpty()},Kh.prototype.getBounds=function(){return null===this._bounds&&(this._bounds=this.computeBounds()),this._bounds},Kh.prototype.interfaces_=function(){return[Vh,Li]},Kh.prototype.getClass=function(){return Kh},Qh.serialVersionUID.get=function(){return 0x5a1e55ec41369800},Object.defineProperties(Kh,Qh);var $h=function(){};$h.reverseOrder=function(){return{compare:function(t,e){return e.compareTo(t)}}},$h.min=function(t){return $h.sort(t),t.get(0)},$h.sort=function(t,e){var n=t.toArray();e?qc.sort(n,e):qc.sort(n);for(var r=t.iterator(),i=0,o=n.length;i<o;i++)r.next(),r.set(n[i])},$h.singletonList=function(t){var e=new bc;return e.add(t),e};var tl=function(){this._boundable1=null,this._boundable2=null,this._distance=null,this._itemDistance=null;var t=arguments[0],e=arguments[1],n=arguments[2];this._boundable1=t,this._boundable2=e,this._itemDistance=n,this._distance=this.distance()};tl.prototype.expandToQueue=function(t,e){var n=tl.isComposite(this._boundable1),r=tl.isComposite(this._boundable2);if(n&&r)return tl.area(this._boundable1)>tl.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 _u("neither boundable is composite")},tl.prototype.isLeaves=function(){return!(tl.isComposite(this._boundable1)||tl.isComposite(this._boundable2))},tl.prototype.compareTo=function(t){var e=t;return this._distance<e._distance?-1:this._distance>e._distance?1:0},tl.prototype.expand=function(t,e,n,r){for(var i=t.getChildBoundables().iterator();i.hasNext();){var o=i.next(),s=new tl(o,e,this._itemDistance);s.getDistance()<r&&n.add(s)}},tl.prototype.getBoundable=function(t){return 0===t?this._boundable1:this._boundable2},tl.prototype.getDistance=function(){return this._distance},tl.prototype.distance=function(){return this.isLeaves()?this._itemDistance.distance(this._boundable1,this._boundable2):this._boundable1.getBounds().distance(this._boundable2.getBounds())},tl.prototype.interfaces_=function(){return[xu]},tl.prototype.getClass=function(){return tl},tl.area=function(t){return t.getBounds().getArea()},tl.isComposite=function(t){return t instanceof Kh};var el=function t(){if(this._root=null,this._built=!1,this._itemBoundables=new bc,this._nodeCapacity=null,0===arguments.length){var e=t.DEFAULT_NODE_CAPACITY;this._nodeCapacity=e}else if(1===arguments.length){var n=arguments[0];tc.isTrue(n>1,"Node capacity must be greater than 1"),this._nodeCapacity=n}},nl={IntersectsOp:{configurable:!0},serialVersionUID:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};el.prototype.getNodeCapacity=function(){return this._nodeCapacity},el.prototype.lastNode=function(t){return t.get(t.size()-1)},el.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 Kh?t+=this.size(n):n instanceof Hh&&(t+=1)}return t}},el.prototype.removeItem=function(t,e){for(var n=null,r=t.getChildBoundables().iterator();r.hasNext();){var i=r.next();i instanceof Hh&&i.getItem()===e&&(n=i)}return null!==n&&(t.getChildBoundables().remove(n),!0)},el.prototype.itemsTree=function(){if(0===arguments.length){this.build();var t=this.itemsTree(this._root);return null===t?new bc:t}if(1===arguments.length){for(var e=arguments[0],n=new bc,r=e.getChildBoundables().iterator();r.hasNext();){var i=r.next();if(i instanceof Kh){var o=this.itemsTree(i);null!==o&&n.add(o)}else i instanceof Hh?n.add(i.getItem()):tc.shouldNeverReachHere()}return n.size()<=0?null:n}},el.prototype.insert=function(t,e){tc.isTrue(!this._built,"Cannot insert items into an STR packed R-tree after it has been built."),this._itemBoundables.add(new Hh(t,e))},el.prototype.boundablesAtLevel=function(){if(1===arguments.length){var t=arguments[0],e=new bc;return this.boundablesAtLevel(t,this._root,e),e}if(3===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2];if(tc.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 Kh?this.boundablesAtLevel(n,s,i):(tc.isTrue(s instanceof Hh),-1===n&&i.add(s))}return null}},el.prototype.query=function(){if(1===arguments.length){var t=arguments[0];this.build();var e=new bc;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(Lu(arguments[2],Jh)&&arguments[0]instanceof Object&&arguments[1]instanceof Kh)for(var i=arguments[0],o=arguments[2],s=arguments[1].getChildBoundables(),a=0;a<s.size();a++){var u=s.get(a);this.getIntersectsOp().intersects(u.getBounds(),i)&&(u instanceof Kh?this.query(i,u,o):u instanceof Hh?o.visitItem(u.getItem()):tc.shouldNeverReachHere())}else if(Lu(arguments[2],wc)&&arguments[0]instanceof Object&&arguments[1]instanceof Kh)for(var c=arguments[0],h=arguments[2],l=arguments[1].getChildBoundables(),p=0;p<l.size();p++){var f=l.get(p);this.getIntersectsOp().intersects(f.getBounds(),c)&&(f instanceof Kh?this.query(c,f,h):f instanceof Hh?h.add(f.getItem()):tc.shouldNeverReachHere())}},el.prototype.build=function(){if(this._built)return null;this._root=this._itemBoundables.isEmpty()?this.createNode(0):this.createHigherLevels(this._itemBoundables,-1),this._itemBoundables=null,this._built=!0},el.prototype.getRoot=function(){return this.build(),this._root},el.prototype.remove=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];return this.build(),!!this.getIntersectsOp().intersects(this._root.getBounds(),t)&&this.remove(t,this._root,e)}if(3===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2],o=this.removeItem(r,i);if(o)return!0;for(var s=null,a=r.getChildBoundables().iterator();a.hasNext();){var u=a.next();if(this.getIntersectsOp().intersects(u.getBounds(),n)&&u instanceof Kh&&(o=this.remove(n,u,i))){s=u;break}}return null!==s&&s.getChildBoundables().isEmpty()&&r.getChildBoundables().remove(s),o}},el.prototype.createHigherLevels=function(t,e){tc.isTrue(!t.isEmpty());var n=this.createParentBoundables(t,e+1);return 1===n.size()?n.get(0):this.createHigherLevels(n,e+1)},el.prototype.depth=function(){if(0===arguments.length)return this.isEmpty()?0:(this.build(),this.depth(this._root));if(1===arguments.length){for(var t=0,e=arguments[0].getChildBoundables().iterator();e.hasNext();){var n=e.next();if(n instanceof Kh){var r=this.depth(n);r>t&&(t=r)}}return t+1}},el.prototype.createParentBoundables=function(t,e){tc.isTrue(!t.isEmpty());var n=new bc;n.add(this.createNode(e));var r=new bc(t);$h.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},el.prototype.isEmpty=function(){return this._built?this._root.isEmpty():this._itemBoundables.isEmpty()},el.prototype.interfaces_=function(){return[Li]},el.prototype.getClass=function(){return el},el.compareDoubles=function(t,e){return t>e?1:t<e?-1:0},nl.IntersectsOp.get=function(){return rl},nl.serialVersionUID.get=function(){return-0x35ef64c82d4c5400},nl.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(el,nl);var rl=function(){},il=function(){};il.prototype.distance=function(t,e){},il.prototype.interfaces_=function(){return[]},il.prototype.getClass=function(){return il};var ol=function(t){function e(n){n=n||e.DEFAULT_NODE_CAPACITY,t.call(this,n)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={STRtreeNode:{configurable:!0},serialVersionUID:{configurable:!0},xComparator:{configurable:!0},yComparator:{configurable:!0},intersectsOp:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};return e.prototype.createParentBoundablesFromVerticalSlices=function(t,e){tc.isTrue(t.length>0);for(var n=new bc,r=0;r<t.length;r++)n.addAll(this.createParentBoundablesFromVerticalSlice(t[r],e));return n},e.prototype.createNode=function(t){return new sl(t)},e.prototype.size=function(){return 0===arguments.length?t.prototype.size.call(this):t.prototype.size.apply(this,arguments)},e.prototype.insert=function(){if(2!==arguments.length)return t.prototype.insert.apply(this,arguments);var e=arguments[0],n=arguments[1];if(e.isNull())return null;t.prototype.insert.call(this,e,n)},e.prototype.getIntersectsOp=function(){return e.intersectsOp},e.prototype.verticalSlices=function(t,e){for(var n=Math.trunc(Math.ceil(t.size()/e)),r=new Array(e).fill(null),i=t.iterator(),o=0;o<e;o++){r[o]=new bc;for(var s=0;i.hasNext()&&s<n;){var a=i.next();r[o].add(a),s++}}return r},e.prototype.query=function(){if(1===arguments.length){var e=arguments[0];return t.prototype.query.call(this,e)}if(2===arguments.length){var n=arguments[0],r=arguments[1];t.prototype.query.call(this,n,r)}else if(3===arguments.length)if(Lu(arguments[2],Jh)&&arguments[0]instanceof Object&&arguments[1]instanceof Kh){var i=arguments[0],o=arguments[1],s=arguments[2];t.prototype.query.call(this,i,o,s)}else if(Lu(arguments[2],wc)&&arguments[0]instanceof Object&&arguments[1]instanceof Kh){var a=arguments[0],u=arguments[1],c=arguments[2];t.prototype.query.call(this,a,u,c)}},e.prototype.getComparator=function(){return e.yComparator},e.prototype.createParentBoundablesFromVerticalSlice=function(e,n){return t.prototype.createParentBoundables.call(this,e,n)},e.prototype.remove=function(){if(2===arguments.length){var e=arguments[0],n=arguments[1];return t.prototype.remove.call(this,e,n)}return t.prototype.remove.apply(this,arguments)},e.prototype.depth=function(){return 0===arguments.length?t.prototype.depth.call(this):t.prototype.depth.apply(this,arguments)},e.prototype.createParentBoundables=function(t,n){tc.isTrue(!t.isEmpty());var r=Math.trunc(Math.ceil(t.size()/this.getNodeCapacity())),i=new bc(t);$h.sort(i,e.xComparator);var o=this.verticalSlices(i,Math.trunc(Math.ceil(Math.sqrt(r))));return this.createParentBoundablesFromVerticalSlices(o,n)},e.prototype.nearestNeighbour=function(){if(1===arguments.length){if(Lu(arguments[0],il)){var t=arguments[0],n=new tl(this.getRoot(),this.getRoot(),t);return this.nearestNeighbour(n)}if(arguments[0]instanceof tl){var r=arguments[0];return this.nearestNeighbour(r,mu.POSITIVE_INFINITY)}}else if(2===arguments.length){if(arguments[0]instanceof e&&Lu(arguments[1],il)){var i=arguments[0],o=arguments[1],s=new tl(this.getRoot(),i.getRoot(),o);return this.nearestNeighbour(s)}if(arguments[0]instanceof tl&&"number"==typeof arguments[1]){var a=arguments[0],u=arguments[1],c=null,h=new Wh;for(h.add(a);!h.isEmpty()&&u>0;){var l=h.poll(),p=l.getDistance();if(p>=u)break;l.isLeaves()?(u=p,c=l):l.expandToQueue(h,u)}return[c.getBoundable(0).getItem(),c.getBoundable(1).getItem()]}}else if(3===arguments.length){var f=arguments[2],g=new Hh(arguments[0],arguments[1]),d=new tl(this.getRoot(),g,f);return this.nearestNeighbour(d)[0]}},e.prototype.interfaces_=function(){return[Zh,Li]},e.prototype.getClass=function(){return e},e.centreX=function(t){return e.avg(t.getMinX(),t.getMaxX())},e.avg=function(t,e){return(t+e)/2},e.centreY=function(t){return e.avg(t.getMinY(),t.getMaxY())},n.STRtreeNode.get=function(){return sl},n.serialVersionUID.get=function(){return 0x39920f7d5f261e0},n.xComparator.get=function(){return{interfaces_:function(){return[wu]},compare:function(n,r){return t.compareDoubles(e.centreX(n.getBounds()),e.centreX(r.getBounds()))}}},n.yComparator.get=function(){return{interfaces_:function(){return[wu]},compare:function(n,r){return t.compareDoubles(e.centreY(n.getBounds()),e.centreY(r.getBounds()))}}},n.intersectsOp.get=function(){return{interfaces_:function(){return[t.IntersectsOp]},intersects:function(t,e){return t.intersects(e)}}},n.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(e,n),e}(el),sl=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 Yu(n.getBounds()):t.expandToInclude(n.getBounds())}return t},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Kh),al=function(){};al.prototype.interfaces_=function(){return[]},al.prototype.getClass=function(){return al},al.relativeSign=function(t,e){return t<e?-1:t>e?1:0},al.compare=function(t,e,n){if(e.equals2D(n))return 0;var r=al.relativeSign(e.x,n.x),i=al.relativeSign(e.y,n.y);switch(t){case 0:return al.compareValue(r,i);case 1:return al.compareValue(i,r);case 2:return al.compareValue(i,-r);case 3:return al.compareValue(-r,i);case 4:return al.compareValue(-r,-i);case 5:return al.compareValue(-i,-r);case 6:return al.compareValue(-i,r);case 7:return al.compareValue(r,-i)}return tc.shouldNeverReachHere("invalid octant value"),0},al.compareValue=function(t,e){return t<0?-1:t>0?1:e<0?-1:e>0?1:0};var ul=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 bu(e),this.segmentIndex=n,this._segmentOctant=r,this._isInterior=!e.equals2D(t.getCoordinate(n))};ul.prototype.getCoordinate=function(){return this.coord},ul.prototype.print=function(t){t.print(this.coord),t.print(" seg # = "+this.segmentIndex)},ul.prototype.compareTo=function(t){var e=t;return this.segmentIndex<e.segmentIndex?-1:this.segmentIndex>e.segmentIndex?1:this.coord.equals2D(e.coord)?0:al.compare(this._segmentOctant,this.coord,e.coord)},ul.prototype.isEndPoint=function(t){return 0===this.segmentIndex&&!this._isInterior||this.segmentIndex===t},ul.prototype.isInterior=function(){return this._isInterior},ul.prototype.interfaces_=function(){return[xu]},ul.prototype.getClass=function(){return ul};var cl=function(){this._nodeMap=new Gi,this._edge=null;var t=arguments[0];this._edge=t};cl.prototype.getSplitCoordinates=function(){var t=new Nc;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()},cl.prototype.addCollapsedNodes=function(){var t=new bc;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)}},cl.prototype.print=function(t){t.println("Intersections:");for(var e=this.iterator();e.hasNext();)e.next().print(t)},cl.prototype.findCollapsesFromExistingVertices=function(t){for(var e=0;e<this._edge.size()-2;e++){var n=this._edge.getCoordinate(e),r=this._edge.getCoordinate(e+2);n.equals2D(r)&&t.add(new Tu(e+1))}},cl.prototype.addEdgeCoordinates=function(t,e,n){var r=this._edge.getCoordinate(e.segmentIndex),i=e.isInterior()||!e.coord.equals2D(r);n.add(new bu(t.coord),!1);for(var o=t.segmentIndex+1;o<=e.segmentIndex;o++)n.add(this._edge.getCoordinate(o));i&&n.add(new bu(e.coord))},cl.prototype.iterator=function(){return this._nodeMap.values().iterator()},cl.prototype.addSplitEdges=function(t){this.addEndpoints(),this.addCollapsedNodes();for(var e=this.iterator(),n=e.next();e.hasNext();){var r=e.next(),i=this.createSplitEdge(n,r);t.add(i),n=r}},cl.prototype.findCollapseIndex=function(t,e,n){if(!t.coord.equals2D(e.coord))return!1;var r=e.segmentIndex-t.segmentIndex;return e.isInterior()||r--,1===r&&(n[0]=t.segmentIndex+1,!0)},cl.prototype.findCollapsesFromInsertedNodes=function(t){for(var e=new Array(1).fill(null),n=this.iterator(),r=n.next();n.hasNext();){var i=n.next();this.findCollapseIndex(r,i,e)&&t.add(new Tu(e[0])),r=i}},cl.prototype.getEdge=function(){return this._edge},cl.prototype.addEndpoints=function(){var t=this._edge.size()-1;this.add(this._edge.getCoordinate(0),0),this.add(this._edge.getCoordinate(t),t)},cl.prototype.createSplitEdge=function(t,e){var n=e.segmentIndex-t.segmentIndex+2,r=this._edge.getCoordinate(e.segmentIndex),i=e.isInterior()||!e.coord.equals2D(r);i||n--;var o=new Array(n).fill(null),s=0;o[s++]=new bu(t.coord);for(var a=t.segmentIndex+1;a<=e.segmentIndex;a++)o[s++]=this._edge.getCoordinate(a);return i&&(o[s]=new bu(e.coord)),new fl(o,this._edge.getData())},cl.prototype.add=function(t,e){var n=new ul(this._edge,t,e,this._edge.getSegmentOctant(e)),r=this._nodeMap.get(n);return null!==r?(tc.isTrue(r.coord.equals2D(t),"Found equal nodes with different coordinates"),r):(this._nodeMap.put(n,n),n)},cl.prototype.checkSplitEdgesCorrectness=function(t){var e=this._edge.getCoordinates(),n=t.get(0).getCoordinate(0);if(!n.equals2D(e[0]))throw new Qu("bad split edge start point at "+n);var r=t.get(t.size()-1).getCoordinates(),i=r[r.length-1];if(!i.equals2D(e[e.length-1]))throw new Qu("bad split edge end point at "+i)},cl.prototype.interfaces_=function(){return[]},cl.prototype.getClass=function(){return cl};var hl=function(){};hl.prototype.interfaces_=function(){return[]},hl.prototype.getClass=function(){return hl},hl.octant=function(){if("number"==typeof arguments[0]&&"number"==typeof arguments[1]){var t=arguments[0],e=arguments[1];if(0===t&&0===e)throw new _u("Cannot compute the octant for point ( "+t+", "+e+" )");var n=Math.abs(t),r=Math.abs(e);return t>=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 bu&&arguments[1]instanceof bu){var i=arguments[0],o=arguments[1],s=o.x-i.x,a=o.y-i.y;if(0===s&&0===a)throw new _u("Cannot compute the octant for two identical points "+i);return hl.octant(s,a)}};var ll=function(){};ll.prototype.getCoordinates=function(){},ll.prototype.size=function(){},ll.prototype.getCoordinate=function(t){},ll.prototype.isClosed=function(){},ll.prototype.setData=function(t){},ll.prototype.getData=function(){},ll.prototype.interfaces_=function(){return[]},ll.prototype.getClass=function(){return ll};var pl=function(){};pl.prototype.addIntersection=function(t,e){},pl.prototype.interfaces_=function(){return[ll]},pl.prototype.getClass=function(){return pl};var fl=function(){this._nodeList=new cl(this),this._pts=null,this._data=null;var t=arguments[0],e=arguments[1];this._pts=t,this._data=e};fl.prototype.getCoordinates=function(){return this._pts},fl.prototype.size=function(){return this._pts.length},fl.prototype.getCoordinate=function(t){return this._pts[t]},fl.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},fl.prototype.getSegmentOctant=function(t){return t===this._pts.length-1?-1:this.safeOctant(this.getCoordinate(t),this.getCoordinate(t+1))},fl.prototype.setData=function(t){this._data=t},fl.prototype.safeOctant=function(t,e){return t.equals2D(e)?0:hl.octant(t,e)},fl.prototype.getData=function(){return this._data},fl.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 bu(arguments[0].getIntersection(r));this.addIntersection(i,n)}},fl.prototype.toString=function(){return Ku.toLineString(new uh(this._pts))},fl.prototype.getNodeList=function(){return this._nodeList},fl.prototype.addIntersectionNode=function(t,e){var n=e,r=n+1;if(r<this._pts.length){var i=this._pts[r];t.equals2D(i)&&(n=r)}return this._nodeList.add(t,n)},fl.prototype.addIntersections=function(t,e,n){for(var r=0;r<t.getIntersectionNum();r++)this.addIntersection(t,e,n,r)},fl.prototype.interfaces_=function(){return[pl]},fl.prototype.getClass=function(){return fl},fl.getNodedSubstrings=function(){if(1===arguments.length){var t=arguments[0],e=new bc;return fl.getNodedSubstrings(t,e),e}if(2===arguments.length)for(var n=arguments[1],r=arguments[0].iterator();r.hasNext();)r.next().getNodeList().addSplitEdges(n)};var gl=function(){if(this.p0=null,this.p1=null,0===arguments.length)this.p0=new bu,this.p1=new bu;else if(1===arguments.length){var t=arguments[0];this.p0=new bu(t.p0),this.p1=new bu(t.p1)}else if(2===arguments.length)this.p0=arguments[0],this.p1=arguments[1];else if(4===arguments.length){var e=arguments[0],n=arguments[1],r=arguments[2],i=arguments[3];this.p0=new bu(e,n),this.p1=new bu(r,i)}},dl={serialVersionUID:{configurable:!0}};gl.prototype.minX=function(){return Math.min(this.p0.x,this.p1.x)},gl.prototype.orientationIndex=function(){if(arguments[0]instanceof gl){var t=arguments[0],e=sc.orientationIndex(this.p0,this.p1,t.p0),n=sc.orientationIndex(this.p0,this.p1,t.p1);return e>=0&&n>=0||e<=0&&n<=0?Math.max(e,n):0}if(arguments[0]instanceof bu){var r=arguments[0];return sc.orientationIndex(this.p0,this.p1,r)}},gl.prototype.toGeometry=function(t){return t.createLineString([this.p0,this.p1])},gl.prototype.isVertical=function(){return this.p0.x===this.p1.x},gl.prototype.equals=function(t){if(!(t instanceof gl))return!1;var e=t;return this.p0.equals(e.p0)&&this.p1.equals(e.p1)},gl.prototype.intersection=function(t){var e=new rc;return e.computeIntersection(this.p0,this.p1,t.p0,t.p1),e.hasIntersection()?e.getIntersection(0):null},gl.prototype.project=function(){if(arguments[0]instanceof bu){var t=arguments[0];if(t.equals(this.p0)||t.equals(this.p1))return new bu(t);var e=this.projectionFactor(t),n=new bu;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 gl){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 gl(s,a)}},gl.prototype.normalize=function(){this.p1.compareTo(this.p0)<0&&this.reverse()},gl.prototype.angle=function(){return Math.atan2(this.p1.y-this.p0.y,this.p1.x-this.p0.x)},gl.prototype.getCoordinate=function(t){return 0===t?this.p0:this.p1},gl.prototype.distancePerpendicular=function(t){return sc.distancePointLinePerpendicular(t,this.p0,this.p1)},gl.prototype.minY=function(){return Math.min(this.p0.y,this.p1.y)},gl.prototype.midPoint=function(){return gl.midPoint(this.p0,this.p1)},gl.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?mu.NaN:((t.x-this.p0.x)*e+(t.y-this.p0.y)*n)/r},gl.prototype.closestPoints=function(t){var e=this.intersection(t);if(null!==e)return[e,e];var n=new Array(2).fill(null),r=mu.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))<r&&(r=i,n[0]=s,n[1]=t.p1);var a=t.closestPoint(this.p0);(i=a.distance(this.p0))<r&&(r=i,n[0]=this.p0,n[1]=a);var u=t.closestPoint(this.p1);return(i=u.distance(this.p1))<r&&(r=i,n[0]=this.p1,n[1]=u),n},gl.prototype.closestPoint=function(t){var e=this.projectionFactor(t);return e>0&&e<1?this.project(t):this.p0.distance(t)<this.p1.distance(t)?this.p0:this.p1},gl.prototype.maxX=function(){return Math.max(this.p0.x,this.p1.x)},gl.prototype.getLength=function(){return this.p0.distance(this.p1)},gl.prototype.compareTo=function(t){var e=t,n=this.p0.compareTo(e.p0);return 0!==n?n:this.p1.compareTo(e.p1)},gl.prototype.reverse=function(){var t=this.p0;this.p0=this.p1,this.p1=t},gl.prototype.equalsTopo=function(t){return this.p0.equals(t.p0)&&(this.p1.equals(t.p1)||this.p0.equals(t.p1))&&this.p1.equals(t.p0)},gl.prototype.lineIntersection=function(t){try{return Uu.intersection(this.p0,this.p1,t.p0,t.p1)}catch(t){if(!(t instanceof ju))throw t}return null},gl.prototype.maxY=function(){return Math.max(this.p0.y,this.p1.y)},gl.prototype.pointAlongOffset=function(t,e){var n=this.p0.x+t*(this.p1.x-this.p0.x),r=this.p0.y+t*(this.p1.y-this.p0.y),i=this.p1.x-this.p0.x,o=this.p1.y-this.p0.y,s=Math.sqrt(i*i+o*o),a=0,u=0;if(0!==e){if(s<=0)throw new Error("Cannot compute offset from zero-length line segment");a=e*i/s,u=e*o/s}return new bu(n-u,r+a)},gl.prototype.setCoordinates=function(){if(1===arguments.length){var t=arguments[0];this.setCoordinates(t.p0,t.p1)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this.p0.x=e.x,this.p0.y=e.y,this.p1.x=n.x,this.p1.y=n.y}},gl.prototype.segmentFraction=function(t){var e=this.projectionFactor(t);return e<0?e=0:(e>1||mu.isNaN(e))&&(e=1),e},gl.prototype.toString=function(){return"LINESTRING( "+this.p0.x+" "+this.p0.y+", "+this.p1.x+" "+this.p1.y+")"},gl.prototype.isHorizontal=function(){return this.p0.y===this.p1.y},gl.prototype.distance=function(){if(arguments[0]instanceof gl){var t=arguments[0];return sc.distanceLineLine(this.p0,this.p1,t.p0,t.p1)}if(arguments[0]instanceof bu){var e=arguments[0];return sc.distancePointLine(e,this.p0,this.p1)}},gl.prototype.pointAlong=function(t){var e=new bu;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},gl.prototype.hashCode=function(){var t=mu.doubleToLongBits(this.p0.x);t^=31*mu.doubleToLongBits(this.p0.y);var e=Math.trunc(t)^Math.trunc(t>>32),n=mu.doubleToLongBits(this.p1.x);return n^=31*mu.doubleToLongBits(this.p1.y),e^Math.trunc(n)^Math.trunc(n>>32)},gl.prototype.interfaces_=function(){return[xu,Li]},gl.prototype.getClass=function(){return gl},gl.midPoint=function(t,e){return new bu((t.x+e.x)/2,(t.y+e.y)/2)},dl.serialVersionUID.get=function(){return 0x2d2172135f411c00},Object.defineProperties(gl,dl);var yl=function(){this.tempEnv1=new Yu,this.tempEnv2=new Yu,this._overlapSeg1=new gl,this._overlapSeg2=new gl};yl.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)}},yl.prototype.interfaces_=function(){return[]},yl.prototype.getClass=function(){return yl};var _l=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};_l.prototype.getLineSegment=function(t,e){e.p0=this._pts[t],e.p1=this._pts[t+1]},_l.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<s&&this.computeSelect(t,e,s,r),s<n&&this.computeSelect(t,s,n,r)},_l.prototype.getCoordinates=function(){for(var t=new Array(this._end-this._start+1).fill(null),e=0,n=this._start;n<=this._end;n++)t[e++]=this._pts[n];return t},_l.prototype.computeOverlaps=function(t,e){this.computeOverlapsInternal(this._start,this._end,t,t._start,t._end,e)},_l.prototype.setId=function(t){this._id=t},_l.prototype.select=function(t,e){this.computeSelect(t,this._start,this._end,e)},_l.prototype.getEnvelope=function(){if(null===this._env){var t=this._pts[this._start],e=this._pts[this._end];this._env=new Yu(t,e)}return this._env},_l.prototype.getEndIndex=function(){return this._end},_l.prototype.getStartIndex=function(){return this._start},_l.prototype.getContext=function(){return this._context},_l.prototype.getId=function(){return this._id},_l.prototype.computeOverlapsInternal=function(t,e,n,r,i,o){var s=this._pts[t],a=this._pts[e],u=n._pts[r],c=n._pts[i];if(e-t==1&&i-r==1)return o.overlap(this,t,n,r),null;if(o.tempEnv1.init(s,a),o.tempEnv2.init(u,c),!o.tempEnv1.intersects(o.tempEnv2))return null;var h=Math.trunc((t+e)/2),l=Math.trunc((r+i)/2);t<h&&(r<l&&this.computeOverlapsInternal(t,h,n,r,l,o),l<i&&this.computeOverlapsInternal(t,h,n,l,i,o)),h<e&&(r<l&&this.computeOverlapsInternal(h,e,n,r,l,o),l<i&&this.computeOverlapsInternal(h,e,n,l,i,o))},_l.prototype.interfaces_=function(){return[]},_l.prototype.getClass=function(){return _l};var ml=function(){};ml.prototype.interfaces_=function(){return[]},ml.prototype.getClass=function(){return ml},ml.getChainStartIndices=function(t){var e=0,n=new bc;n.add(new Tu(e));do{var r=ml.findChainEnd(t,e);n.add(new Tu(r)),e=r}while(e<t.length-1);return ml.toIntArray(n)},ml.findChainEnd=function(t,e){for(var n=e;n<t.length-1&&t[n].equals2D(t[n+1]);)n++;if(n>=t.length-1)return t.length-1;for(var r=Bh.quadrant(t[n],t[n+1]),i=e+1;i<t.length&&(t[i-1].equals2D(t[i])||Bh.quadrant(t[i-1],t[i])===r);)i++;return i-1},ml.getChains=function(){if(1===arguments.length){var t=arguments[0];return ml.getChains(t,null)}if(2===arguments.length){for(var e=arguments[0],n=arguments[1],r=new bc,i=ml.getChainStartIndices(e),o=0;o<i.length-1;o++){var s=new _l(e,i[o],i[o+1],n);r.add(s)}return r}},ml.toIntArray=function(t){for(var e=new Array(t.size()).fill(null),n=0;n<e.length;n++)e[n]=t.get(n).intValue();return e};var vl=function(){};vl.prototype.computeNodes=function(t){},vl.prototype.getNodedSubstrings=function(){},vl.prototype.interfaces_=function(){return[]},vl.prototype.getClass=function(){return vl};var xl=function(){if(this._segInt=null,0===arguments.length);else if(1===arguments.length){var t=arguments[0];this.setSegmentIntersector(t)}};xl.prototype.setSegmentIntersector=function(t){this._segInt=t},xl.prototype.interfaces_=function(){return[vl]},xl.prototype.getClass=function(){return xl};var El=function(t){function e(e){e?t.call(this,e):t.call(this),this._monoChains=new bc,this._index=new ol,this._idCounter=0,this._nodedSegStrings=null,this._nOverlaps=0}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={SegmentOverlapAction:{configurable:!0}};return e.prototype.getMonotoneChains=function(){return this._monoChains},e.prototype.getNodedSubstrings=function(){return fl.getNodedSubstrings(this._nodedSegStrings)},e.prototype.getIndex=function(){return this._index},e.prototype.add=function(t){for(var e=ml.getChains(t.getCoordinates(),t).iterator();e.hasNext();){var n=e.next();n.setId(this._idCounter++),this._index.insert(n.getEnvelope(),n),this._monoChains.add(n)}},e.prototype.computeNodes=function(t){this._nodedSegStrings=t;for(var e=t.iterator();e.hasNext();)this.add(e.next());this.intersectChains()},e.prototype.intersectChains=function(){for(var t=new wl(this._segInt),e=this._monoChains.iterator();e.hasNext();)for(var n=e.next(),r=this._index.query(n.getEnvelope()).iterator();r.hasNext();){var i=r.next();if(i.getId()>n.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 wl},Object.defineProperties(e,n),e}(xl),wl=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}(yl),bl=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)}},Il={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}};bl.prototype.getEndCapStyle=function(){return this._endCapStyle},bl.prototype.isSingleSided=function(){return this._isSingleSided},bl.prototype.setQuadrantSegments=function(t){this._quadrantSegments=t,0===this._quadrantSegments&&(this._joinStyle=bl.JOIN_BEVEL),this._quadrantSegments<0&&(this._joinStyle=bl.JOIN_MITRE,this._mitreLimit=Math.abs(this._quadrantSegments)),t<=0&&(this._quadrantSegments=1),this._joinStyle!==bl.JOIN_ROUND&&(this._quadrantSegments=bl.DEFAULT_QUADRANT_SEGMENTS)},bl.prototype.getJoinStyle=function(){return this._joinStyle},bl.prototype.setJoinStyle=function(t){this._joinStyle=t},bl.prototype.setSimplifyFactor=function(t){this._simplifyFactor=t<0?0:t},bl.prototype.getSimplifyFactor=function(){return this._simplifyFactor},bl.prototype.getQuadrantSegments=function(){return this._quadrantSegments},bl.prototype.setEndCapStyle=function(t){this._endCapStyle=t},bl.prototype.getMitreLimit=function(){return this._mitreLimit},bl.prototype.setMitreLimit=function(t){this._mitreLimit=t},bl.prototype.setSingleSided=function(t){this._isSingleSided=t},bl.prototype.interfaces_=function(){return[]},bl.prototype.getClass=function(){return bl},bl.bufferDistanceError=function(t){var e=Math.PI/2/t;return 1-Math.cos(e/2)},Il.CAP_ROUND.get=function(){return 1},Il.CAP_FLAT.get=function(){return 2},Il.CAP_SQUARE.get=function(){return 3},Il.JOIN_ROUND.get=function(){return 1},Il.JOIN_MITRE.get=function(){return 2},Il.JOIN_BEVEL.get=function(){return 3},Il.DEFAULT_QUADRANT_SEGMENTS.get=function(){return 8},Il.DEFAULT_MITRE_LIMIT.get=function(){return 5},Il.DEFAULT_SIMPLIFY_FACTOR.get=function(){return.01},Object.defineProperties(bl,Il);var Nl=function(t){this._distanceTol=null,this._isDeleted=null,this._angleOrientation=sc.COUNTERCLOCKWISE,this._inputLine=t||null},Cl={INIT:{configurable:!0},DELETE:{configurable:!0},KEEP:{configurable:!0},NUM_PTS_TO_CHECK:{configurable:!0}};Nl.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)},Nl.prototype.deleteShallowConcavities=function(){for(var t=1,e=this.findNextNonDeletedIndex(t),n=this.findNextNonDeletedIndex(e),r=!1;n<this._inputLine.length;){var i=!1;this.isDeletable(t,e,n,this._distanceTol)&&(this._isDeleted[e]=Nl.DELETE,i=!0,r=!0),t=i?n:e,e=this.findNextNonDeletedIndex(t),n=this.findNextNonDeletedIndex(e)}return r},Nl.prototype.isShallowConcavity=function(t,e,n,r){return sc.computeOrientation(t,e,n)===this._angleOrientation&&sc.distancePointLine(e,t,n)<r},Nl.prototype.isShallowSampled=function(t,e,n,r,i){var o=Math.trunc((r-n)/Nl.NUM_PTS_TO_CHECK);o<=0&&(o=1);for(var s=n;s<r;s+=o)if(!this.isShallow(t,e,this._inputLine[s],i))return!1;return!0},Nl.prototype.isConcave=function(t,e,n){return sc.computeOrientation(t,e,n)===this._angleOrientation},Nl.prototype.simplify=function(t){this._distanceTol=Math.abs(t),t<0&&(this._angleOrientation=sc.CLOCKWISE),this._isDeleted=new Array(this._inputLine.length).fill(null);var e=!1;do{e=this.deleteShallowConcavities()}while(e);return this.collapseLine()},Nl.prototype.findNextNonDeletedIndex=function(t){for(var e=t+1;e<this._inputLine.length&&this._isDeleted[e]===Nl.DELETE;)e++;return e},Nl.prototype.isShallow=function(t,e,n,r){return sc.distancePointLine(e,t,n)<r},Nl.prototype.collapseLine=function(){for(var t=new Nc,e=0;e<this._inputLine.length;e++)this._isDeleted[e]!==Nl.DELETE&&t.add(this._inputLine[e]);return t.toCoordinateArray()},Nl.prototype.interfaces_=function(){return[]},Nl.prototype.getClass=function(){return Nl},Nl.simplify=function(t,e){return new Nl(t).simplify(e)},Cl.INIT.get=function(){return 0},Cl.DELETE.get=function(){return 1},Cl.KEEP.get=function(){return 1},Cl.NUM_PTS_TO_CHECK.get=function(){return 10},Object.defineProperties(Nl,Cl);var Sl=function(){this._ptList=null,this._precisionModel=null,this._minimimVertexDistance=0,this._ptList=new bc},Ml={COORDINATE_ARRAY_TYPE:{configurable:!0}};Sl.prototype.getCoordinates=function(){return this._ptList.toArray(Sl.COORDINATE_ARRAY_TYPE)},Sl.prototype.setPrecisionModel=function(t){this._precisionModel=t},Sl.prototype.addPt=function(t){var e=new bu(t);if(this._precisionModel.makePrecise(e),this.isRedundant(e))return null;this._ptList.add(e)},Sl.prototype.revere=function(){},Sl.prototype.addPts=function(t,e){if(e)for(var n=0;n<t.length;n++)this.addPt(t[n]);else for(var r=t.length-1;r>=0;r--)this.addPt(t[r])},Sl.prototype.isRedundant=function(t){if(this._ptList.size()<1)return!1;var e=this._ptList.get(this._ptList.size()-1);return t.distance(e)<this._minimimVertexDistance},Sl.prototype.toString=function(){return(new _h).createLineString(this.getCoordinates()).toString()},Sl.prototype.closeRing=function(){if(this._ptList.size()<1)return null;var t=new bu(this._ptList.get(0)),e=this._ptList.get(this._ptList.size()-1);if(t.equals(e))return null;this._ptList.add(t)},Sl.prototype.setMinimumVertexDistance=function(t){this._minimimVertexDistance=t},Sl.prototype.interfaces_=function(){return[]},Sl.prototype.getClass=function(){return Sl},Ml.COORDINATE_ARRAY_TYPE.get=function(){return new Array(0).fill(null)},Object.defineProperties(Sl,Ml);var Ll=function(){},Pl={PI_TIMES_2:{configurable:!0},PI_OVER_2:{configurable:!0},PI_OVER_4:{configurable:!0},COUNTERCLOCKWISE:{configurable:!0},CLOCKWISE:{configurable:!0},NONE:{configurable:!0}};Ll.prototype.interfaces_=function(){return[]},Ll.prototype.getClass=function(){return Ll},Ll.toDegrees=function(t){return 180*t/Math.PI},Ll.normalize=function(t){for(;t>Math.PI;)t-=Ll.PI_TIMES_2;for(;t<=-Math.PI;)t+=Ll.PI_TIMES_2;return t},Ll.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)}},Ll.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},Ll.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},Ll.interiorAngle=function(t,e,n){var r=Ll.angle(e,t),i=Ll.angle(e,n);return Math.abs(i-r)},Ll.normalizePositive=function(t){if(t<0){for(;t<0;)t+=Ll.PI_TIMES_2;t>=Ll.PI_TIMES_2&&(t=0)}else{for(;t>=Ll.PI_TIMES_2;)t-=Ll.PI_TIMES_2;t<0&&(t=0)}return t},Ll.angleBetween=function(t,e,n){var r=Ll.angle(e,t),i=Ll.angle(e,n);return Ll.diff(r,i)},Ll.diff=function(t,e){var n=null;return(n=t<e?e-t:t-e)>Math.PI&&(n=2*Math.PI-n),n},Ll.toRadians=function(t){return t*Math.PI/180},Ll.getTurn=function(t,e){var n=Math.sin(e-t);return n>0?Ll.COUNTERCLOCKWISE:n<0?Ll.CLOCKWISE:Ll.NONE},Ll.angleBetweenOriented=function(t,e,n){var r=Ll.angle(e,t),i=Ll.angle(e,n)-r;return i<=-Math.PI?i+Ll.PI_TIMES_2:i>Math.PI?i-Ll.PI_TIMES_2:i},Pl.PI_TIMES_2.get=function(){return 2*Math.PI},Pl.PI_OVER_2.get=function(){return Math.PI/2},Pl.PI_OVER_4.get=function(){return Math.PI/4},Pl.COUNTERCLOCKWISE.get=function(){return sc.COUNTERCLOCKWISE},Pl.CLOCKWISE.get=function(){return sc.CLOCKWISE},Pl.NONE.get=function(){return sc.COLLINEAR},Object.defineProperties(Ll,Pl);var Ol=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 gl,this._seg1=new gl,this._offset0=new gl,this._offset1=new gl,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 rc,this._filletAngleQuantum=Math.PI/2/n.getQuadrantSegments(),n.getQuadrantSegments()>=8&&n.getJoinStyle()===bl.JOIN_ROUND&&(this._closingSegLengthFactor=t.MAX_CLOSING_SEG_LEN_FACTOR),this.init(r)},Rl={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}};Ol.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=sc.computeOrientation(this._s0,this._s1,this._s2),r=n===sc.CLOCKWISE&&this._side===Nh.LEFT||n===sc.COUNTERCLOCKWISE&&this._side===Nh.RIGHT;0===n?this.addCollinear(e):r?this.addOutsideTurn(n,e):this.addInsideTurn(n,e)},Ol.prototype.addLineEndCap=function(t,e){var n=new gl(t,e),r=new gl;this.computeOffsetSegment(n,Nh.LEFT,this._distance,r);var i=new gl;this.computeOffsetSegment(n,Nh.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 bl.CAP_ROUND:this._segList.addPt(r.p1),this.addFilletArc(e,a+Math.PI/2,a-Math.PI/2,sc.CLOCKWISE,this._distance),this._segList.addPt(i.p1);break;case bl.CAP_FLAT:this._segList.addPt(r.p1),this._segList.addPt(i.p1);break;case bl.CAP_SQUARE:var u=new bu;u.x=Math.abs(this._distance)*Math.cos(a),u.y=Math.abs(this._distance)*Math.sin(a);var c=new bu(r.p1.x+u.x,r.p1.y+u.y),h=new bu(i.p1.x+u.x,i.p1.y+u.y);this._segList.addPt(c),this._segList.addPt(h)}},Ol.prototype.getCoordinates=function(){return this._segList.getCoordinates()},Ol.prototype.addMitreJoin=function(t,e,n,r){var i=!0,o=null;try{o=Uu.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 ju))throw t;o=new bu(0,0),i=!1}i?this._segList.addPt(o):this.addLimitedMitreJoin(e,n,r,this._bufParams.getMitreLimit())},Ol.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,c=n.y-t.y,h=Math.atan2(c,u);r===sc.CLOCKWISE?a<=h&&(a+=2*Math.PI):a>=h&&(a-=2*Math.PI),this._segList.addPt(e),this.addFilletArc(t,a,h,r,i),this._segList.addPt(n)},Ol.prototype.addOutsideTurn=function(t,e){if(this._offset0.p1.distance(this._offset1.p0)<this._distance*Ol.OFFSET_SEGMENT_SEPARATION_FACTOR)return this._segList.addPt(this._offset0.p1),null;this._bufParams.getJoinStyle()===bl.JOIN_MITRE?this.addMitreJoin(this._s1,this._offset0,this._offset1,this._distance):this._bufParams.getJoinStyle()===bl.JOIN_BEVEL?this.addBevelJoin(this._offset0,this._offset1):(e&&this._segList.addPt(this._offset0.p1),this.addFilletCorner(this._s1,this._offset0.p1,this._offset1.p0,t,this._distance),this._segList.addPt(this._offset1.p0))},Ol.prototype.createSquare=function(t){this._segList.addPt(new bu(t.x+this._distance,t.y+this._distance)),this._segList.addPt(new bu(t.x+this._distance,t.y-this._distance)),this._segList.addPt(new bu(t.x-this._distance,t.y-this._distance)),this._segList.addPt(new bu(t.x-this._distance,t.y+this._distance)),this._segList.closeRing()},Ol.prototype.addSegments=function(t,e){this._segList.addPts(t,e)},Ol.prototype.addFirstSegment=function(){this._segList.addPt(this._offset1.p0)},Ol.prototype.addLastSegment=function(){this._segList.addPt(this._offset1.p1)},Ol.prototype.initSideSegments=function(t,e,n){this._s1=t,this._s2=e,this._side=n,this._seg1.setCoordinates(t,e),this.computeOffsetSegment(this._seg1,n,this._distance,this._offset1)},Ol.prototype.addLimitedMitreJoin=function(t,e,n,r){var i=this._seg0.p1,o=Ll.angle(i,this._seg0.p0),s=Ll.angleBetweenOriented(this._seg0.p0,i,this._seg1.p1)/2,a=Ll.normalize(o+s),u=Ll.normalize(a+Math.PI),c=r*n,h=n-c*Math.abs(Math.sin(s)),l=i.x+c*Math.cos(u),p=i.y+c*Math.sin(u),f=new bu(l,p),g=new gl(i,f),d=g.pointAlongOffset(1,h),y=g.pointAlongOffset(1,-h);this._side===Nh.LEFT?(this._segList.addPt(d),this._segList.addPt(y)):(this._segList.addPt(y),this._segList.addPt(d))},Ol.prototype.computeOffsetSegment=function(t,e,n,r){var i=e===Nh.LEFT?1:-1,o=t.p1.x-t.p0.x,s=t.p1.y-t.p0.y,a=Math.sqrt(o*o+s*s),u=i*n*o/a,c=i*n*s/a;r.p0.x=t.p0.x-c,r.p0.y=t.p0.y+u,r.p1.x=t.p1.x-c,r.p1.y=t.p1.y+u},Ol.prototype.addFilletArc=function(t,e,n,r,i){var o=r===sc.CLOCKWISE?-1:1,s=Math.abs(e-n),a=Math.trunc(s/this._filletAngleQuantum+.5);if(a<1)return null;for(var u=s/a,c=0,h=new bu;c<s;){var l=e+o*c;h.x=t.x+i*Math.cos(l),h.y=t.y+i*Math.sin(l),this._segList.addPt(h),c+=u}},Ol.prototype.addInsideTurn=function(t,e){if(this._li.computeIntersection(this._offset0.p0,this._offset0.p1,this._offset1.p0,this._offset1.p1),this._li.hasIntersection())this._segList.addPt(this._li.getIntersection(0));else if(this._hasNarrowConcaveAngle=!0,this._offset0.p1.distance(this._offset1.p0)<this._distance*Ol.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR)this._segList.addPt(this._offset0.p1);else{if(this._segList.addPt(this._offset0.p1),this._closingSegLengthFactor>0){var n=new bu((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 bu((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)}},Ol.prototype.createCircle=function(t){var e=new bu(t.x+this._distance,t.y);this._segList.addPt(e),this.addFilletArc(t,0,2*Math.PI,-1,this._distance),this._segList.closeRing()},Ol.prototype.addBevelJoin=function(t,e){this._segList.addPt(t.p1),this._segList.addPt(e.p0)},Ol.prototype.init=function(t){this._distance=t,this._maxCurveSegmentError=t*(1-Math.cos(this._filletAngleQuantum/2)),this._segList=new Sl,this._segList.setPrecisionModel(this._precisionModel),this._segList.setMinimumVertexDistance(t*Ol.CURVE_VERTEX_SNAP_DISTANCE_FACTOR)},Ol.prototype.addCollinear=function(t){this._li.computeIntersection(this._s0,this._s1,this._s1,this._s2),this._li.getIntersectionNum()>=2&&(this._bufParams.getJoinStyle()===bl.JOIN_BEVEL||this._bufParams.getJoinStyle()===bl.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,sc.CLOCKWISE,this._distance))},Ol.prototype.closeRing=function(){this._segList.closeRing()},Ol.prototype.hasNarrowConcaveAngle=function(){return this._hasNarrowConcaveAngle},Ol.prototype.interfaces_=function(){return[]},Ol.prototype.getClass=function(){return Ol},Rl.OFFSET_SEGMENT_SEPARATION_FACTOR.get=function(){return.001},Rl.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return.001},Rl.CURVE_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return 1e-6},Rl.MAX_CLOSING_SEG_LEN_FACTOR.get=function(){return 80},Object.defineProperties(Ol,Rl);var Tl=function(){this._distance=0,this._precisionModel=null,this._bufParams=null;var t=arguments[0],e=arguments[1];this._precisionModel=t,this._bufParams=e};Tl.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&&Cc.reverse(o),o},Tl.prototype.computeSingleSidedBufferCurve=function(t,e,n){var r=this.simplifyTolerance(this._distance);if(e){n.addSegments(t,!0);var i=Nl.simplify(t,-r),o=i.length-1;n.initSideSegments(i[o],i[o-1],Nh.LEFT),n.addFirstSegment();for(var s=o-2;s>=0;s--)n.addNextSegment(i[s],!0)}else{n.addSegments(t,!1);var a=Nl.simplify(t,r),u=a.length-1;n.initSideSegments(a[0],a[1],Nh.LEFT),n.addFirstSegment();for(var c=2;c<=u;c++)n.addNextSegment(a[c],!0)}n.addLastSegment(),n.closeRing()},Tl.prototype.computeRingBufferCurve=function(t,e,n){var r=this.simplifyTolerance(this._distance);e===Nh.RIGHT&&(r=-r);var i=Nl.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()},Tl.prototype.computeLineBufferCurve=function(t,e){var n=this.simplifyTolerance(this._distance),r=Nl.simplify(t,n),i=r.length-1;e.initSideSegments(r[0],r[1],Nh.LEFT);for(var o=2;o<=i;o++)e.addNextSegment(r[o],!0);e.addLastSegment(),e.addLineEndCap(r[i-1],r[i]);var s=Nl.simplify(t,-n),a=s.length-1;e.initSideSegments(s[a],s[a-1],Nh.LEFT);for(var u=a-2;u>=0;u--)e.addNextSegment(s[u],!0);e.addLastSegment(),e.addLineEndCap(s[1],s[0]),e.closeRing()},Tl.prototype.computePointCurve=function(t,e){switch(this._bufParams.getEndCapStyle()){case bl.CAP_ROUND:e.createCircle(t);break;case bl.CAP_SQUARE:e.createSquare(t)}},Tl.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()},Tl.prototype.getBufferParameters=function(){return this._bufParams},Tl.prototype.simplifyTolerance=function(t){return t*this._bufParams.getSimplifyFactor()},Tl.prototype.getRingCurve=function(t,e,n){if(this._distance=n,t.length<=2)return this.getLineCurve(t,n);if(0===n)return Tl.copyCoordinates(t);var r=this.getSegGen(n);return this.computeRingBufferCurve(t,e,r),r.getCoordinates()},Tl.prototype.computeOffsetCurve=function(t,e,n){var r=this.simplifyTolerance(this._distance);if(e){var i=Nl.simplify(t,-r),o=i.length-1;n.initSideSegments(i[o],i[o-1],Nh.LEFT),n.addFirstSegment();for(var s=o-2;s>=0;s--)n.addNextSegment(i[s],!0)}else{var a=Nl.simplify(t,r),u=a.length-1;n.initSideSegments(a[0],a[1],Nh.LEFT),n.addFirstSegment();for(var c=2;c<=u;c++)n.addNextSegment(a[c],!0)}n.addLastSegment()},Tl.prototype.getSegGen=function(t){return new Ol(this._precisionModel,this._bufParams,t)},Tl.prototype.interfaces_=function(){return[]},Tl.prototype.getClass=function(){return Tl},Tl.copyCoordinates=function(t){for(var e=new Array(t.length).fill(null),n=0;n<e.length;n++)e[n]=new bu(t[n]);return e};var Al=function(){this._subgraphs=null,this._seg=new gl,this._cga=new sc;var t=arguments[0];this._subgraphs=t},Dl={DepthSegment:{configurable:!0}};Al.prototype.findStabbedSegments=function(){if(1===arguments.length){for(var t=arguments[0],e=new bc,n=this._subgraphs.iterator();n.hasNext();){var r=n.next(),i=r.getEnvelope();t.y<i.getMinY()||t.y>i.getMaxY()||this.findStabbedSegments(t,r.getDirectedEdges(),e)}return e}if(3===arguments.length)if(Lu(arguments[2],wc)&&arguments[0]instanceof bu&&arguments[1]instanceof jh){for(var o=arguments[0],s=arguments[1],a=arguments[2],u=s.getEdge().getCoordinates(),c=0;c<u.length-1;c++)if(this._seg.p0=u[c],this._seg.p1=u[c+1],this._seg.p0.y>this._seg.p1.y&&this._seg.reverse(),!(Math.max(this._seg.p0.x,this._seg.p1.x)<o.x)&&!(this._seg.isHorizontal()||o.y<this._seg.p0.y||o.y>this._seg.p1.y||sc.computeOrientation(this._seg.p0,this._seg.p1,o)===sc.RIGHT)){var h=s.getDepth(Nh.LEFT);this._seg.p0.equals(u[c])||(h=s.getDepth(Nh.RIGHT));var l=new Fl(this._seg,h);a.add(l)}}else if(Lu(arguments[2],wc)&&arguments[0]instanceof bu&&Lu(arguments[1],wc))for(var p=arguments[0],f=arguments[2],g=arguments[1].iterator();g.hasNext();){var d=g.next();d.isForward()&&this.findStabbedSegments(p,d,f)}},Al.prototype.getDepth=function(t){var e=this.findStabbedSegments(t);return 0===e.size()?0:$h.min(e)._leftDepth},Al.prototype.interfaces_=function(){return[]},Al.prototype.getClass=function(){return Al},Dl.DepthSegment.get=function(){return Fl},Object.defineProperties(Al,Dl);var Fl=function(){this._upwardSeg=null,this._leftDepth=null;var t=arguments[0],e=arguments[1];this._upwardSeg=new gl(t),this._leftDepth=e};Fl.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)},Fl.prototype.compareX=function(t,e){var n=t.p0.compareTo(e.p0);return 0!==n?n:t.p1.compareTo(e.p1)},Fl.prototype.toString=function(){return this._upwardSeg.toString()},Fl.prototype.interfaces_=function(){return[xu]},Fl.prototype.getClass=function(){return Fl};var ql=function(t,e,n){this.p0=t||null,this.p1=e||null,this.p2=n||null};ql.prototype.area=function(){return ql.area(this.p0,this.p1,this.p2)},ql.prototype.signedArea=function(){return ql.signedArea(this.p0,this.p1,this.p2)},ql.prototype.interpolateZ=function(t){if(null===t)throw new _u("Supplied point is null.");return ql.interpolateZ(t,this.p0,this.p1,this.p2)},ql.prototype.longestSideLength=function(){return ql.longestSideLength(this.p0,this.p1,this.p2)},ql.prototype.isAcute=function(){return ql.isAcute(this.p0,this.p1,this.p2)},ql.prototype.circumcentre=function(){return ql.circumcentre(this.p0,this.p1,this.p2)},ql.prototype.area3D=function(){return ql.area3D(this.p0,this.p1,this.p2)},ql.prototype.centroid=function(){return ql.centroid(this.p0,this.p1,this.p2)},ql.prototype.inCentre=function(){return ql.inCentre(this.p0,this.p1,this.p2)},ql.prototype.interfaces_=function(){return[]},ql.prototype.getClass=function(){return ql},ql.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)},ql.signedArea=function(t,e,n){return((n.x-t.x)*(e.y-t.y)-(e.x-t.x)*(n.y-t.y))/2},ql.det=function(t,e,n,r){return t*r-e*n},ql.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,c=r.y-o,h=s*c-a*u,l=t.x-i,p=t.y-o,f=(c*l-a*p)/h,g=(-u*l+s*p)/h;return e.z+f*(n.z-e.z)+g*(r.z-e.z)},ql.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},ql.isAcute=function(t,e,n){return!!Ll.isAcute(t,e,n)&&!!Ll.isAcute(e,n,t)&&!!Ll.isAcute(n,t,e)},ql.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,c=2*ql.det(o,s,a,u),h=ql.det(s,o*o+s*s,u,a*a+u*u),l=ql.det(o,o*o+s*s,a,a*a+u*u);return new bu(r-h/c,i+l/c)},ql.perpendicularBisector=function(t,e){var n=e.x-t.x,r=e.y-t.y,i=new Uu(t.x+n/2,t.y+r/2,1),o=new Uu(t.x-r+n/2,t.y+n+r/2,1);return new Uu(i,o)},ql.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 bu(t.x+i*o,t.y+i*s)},ql.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,c=i*u-o*a,h=o*s-r*u,l=r*a-i*s,p=c*c+h*h+l*l;return Math.sqrt(p)/2},ql.centroid=function(t,e,n){var r=(t.x+e.x+n.x)/3,i=(t.y+e.y+n.y)/3;return new bu(r,i)},ql.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 bu(a,u)};var Gl=function(){this._inputGeom=null,this._distance=null,this._curveBuilder=null,this._curveList=new bc;var t=arguments[0],e=arguments[1],n=arguments[2];this._inputGeom=t,this._distance=e,this._curveBuilder=n};Gl.prototype.addPoint=function(t){if(this._distance<=0)return null;var e=t.getCoordinates(),n=this._curveBuilder.getLineCurve(e,this._distance);this.addCurve(n,Su.EXTERIOR,Su.INTERIOR)},Gl.prototype.addPolygon=function(t){var e=this._distance,n=Nh.LEFT;this._distance<0&&(e=-this._distance,n=Nh.RIGHT);var r=t.getExteriorRing(),i=Cc.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,Su.EXTERIOR,Su.INTERIOR);for(var o=0;o<t.getNumInteriorRing();o++){var s=t.getInteriorRingN(o),a=Cc.removeRepeatedPoints(s.getCoordinates());this._distance>0&&this.isErodedCompletely(s,-this._distance)||this.addPolygonRing(a,e,Nh.opposite(n),Su.INTERIOR,Su.EXTERIOR)}},Gl.prototype.isTriangleErodedCompletely=function(t,e){var n=new ql(t[0],t[1],t[2]),r=n.inCentre();return sc.distancePointLine(r,n.p0,n.p1)<Math.abs(e)},Gl.prototype.addLineString=function(t){if(this._distance<=0&&!this._curveBuilder.getBufferParameters().isSingleSided())return null;var e=Cc.removeRepeatedPoints(t.getCoordinates()),n=this._curveBuilder.getLineCurve(e,this._distance);this.addCurve(n,Su.EXTERIOR,Su.INTERIOR)},Gl.prototype.addCurve=function(t,e,n){if(null===t||t.length<2)return null;var r=new fl(t,new Rh(0,Su.BOUNDARY,e,n));this._curveList.add(r)},Gl.prototype.getCurves=function(){return this.add(this._inputGeom),this._curveList},Gl.prototype.addPolygonRing=function(t,e,n,r,i){if(0===e&&t.length<eh.MINIMUM_VALID_SIZE)return null;var o=r,s=i;t.length>=eh.MINIMUM_VALID_SIZE&&sc.isCCW(t)&&(o=i,s=r,n=Nh.opposite(n));var a=this._curveBuilder.getRingCurve(t,n,e);this.addCurve(a,o,s)},Gl.prototype.add=function(t){if(t.isEmpty())return null;t instanceof $c?this.addPolygon(t):t instanceof Jc?this.addLineString(t):t instanceof Kc?this.addPoint(t):(t instanceof th||t instanceof Xc||t instanceof nh||t instanceof jc)&&this.addCollection(t)},Gl.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},Gl.prototype.addCollection=function(t){for(var e=0;e<t.getNumGeometries();e++){var n=t.getGeometryN(e);this.add(n)}},Gl.prototype.interfaces_=function(){return[]},Gl.prototype.getClass=function(){return Gl};var Bl=function(){};Bl.prototype.locate=function(t){},Bl.prototype.interfaces_=function(){return[]},Bl.prototype.getClass=function(){return Bl};var kl=function(){this._parent=null,this._atStart=null,this._max=null,this._index=null,this._subcollectionIterator=null;var t=arguments[0];this._parent=t,this._atStart=!0,this._index=0,this._max=t.getNumGeometries()};kl.prototype.next=function(){if(this._atStart)return this._atStart=!1,kl.isAtomic(this._parent)&&this._index++,this._parent;if(null!==this._subcollectionIterator){if(this._subcollectionIterator.hasNext())return this._subcollectionIterator.next();this._subcollectionIterator=null}if(this._index>=this._max)throw new Pi;var t=this._parent.getGeometryN(this._index++);return t instanceof jc?(this._subcollectionIterator=new kl(t),this._subcollectionIterator.next()):t},kl.prototype.remove=function(){throw new Error(this.getClass().getName())},kl.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)},kl.prototype.interfaces_=function(){return[Ec]},kl.prototype.getClass=function(){return kl},kl.isAtomic=function(t){return!(t instanceof jc)};var zl=function(){this._geom=null;var t=arguments[0];this._geom=t};zl.prototype.locate=function(t){return zl.locate(t,this._geom)},zl.prototype.interfaces_=function(){return[Bl]},zl.prototype.getClass=function(){return zl},zl.isPointInRing=function(t,e){return!!e.getEnvelopeInternal().intersects(t)&&sc.isPointInRing(t,e.getCoordinates())},zl.containsPointInPolygon=function(t,e){if(e.isEmpty())return!1;var n=e.getExteriorRing();if(!zl.isPointInRing(t,n))return!1;for(var r=0;r<e.getNumInteriorRing();r++){var i=e.getInteriorRingN(r);if(zl.isPointInRing(t,i))return!1}return!0},zl.containsPoint=function(t,e){if(e instanceof $c)return zl.containsPointInPolygon(t,e);if(e instanceof jc)for(var n=new kl(e);n.hasNext();){var r=n.next();if(r!==e&&zl.containsPoint(t,r))return!0}return!1},zl.locate=function(t,e){return e.isEmpty()?Su.EXTERIOR:zl.containsPoint(t,e)?Su.INTERIOR:Su.EXTERIOR};var jl=function(){this._edgeMap=new Gi,this._edgeList=null,this._ptInAreaLocation=[Su.NONE,Su.NONE]};jl.prototype.getNextCW=function(t){this.getEdges();var e=this._edgeList.indexOf(t),n=e-1;return 0===e&&(n=this._edgeList.size()-1),this._edgeList.get(n)},jl.prototype.propagateSideLabels=function(t){for(var e=Su.NONE,n=this.iterator();n.hasNext();){var r=n.next().getLabel();r.isArea(t)&&r.getLocation(t,Nh.LEFT)!==Su.NONE&&(e=r.getLocation(t,Nh.LEFT))}if(e===Su.NONE)return null;for(var i=e,o=this.iterator();o.hasNext();){var s=o.next(),a=s.getLabel();if(a.getLocation(t,Nh.ON)===Su.NONE&&a.setLocation(t,Nh.ON,i),a.isArea(t)){var u=a.getLocation(t,Nh.LEFT),c=a.getLocation(t,Nh.RIGHT);if(c!==Su.NONE){if(c!==i)throw new Mh("side location conflict",s.getCoordinate());u===Su.NONE&&tc.shouldNeverReachHere("found single null side (at "+s.getCoordinate()+")"),i=u}else tc.isTrue(a.getLocation(t,Nh.LEFT)===Su.NONE,"found single null side"),a.setLocation(t,Nh.RIGHT,i),a.setLocation(t,Nh.LEFT,i)}}},jl.prototype.getCoordinate=function(){var t=this.iterator();return t.hasNext()?t.next().getCoordinate():null},jl.prototype.print=function(t){Xu.out.println("EdgeEndStar: "+this.getCoordinate());for(var e=this.iterator();e.hasNext();)e.next().print(t)},jl.prototype.isAreaLabelsConsistent=function(t){return this.computeEdgeEndLabels(t.getBoundaryNodeRule()),this.checkAreaLabelsConsistent(0)},jl.prototype.checkAreaLabelsConsistent=function(t){var e=this.getEdges();if(e.size()<=0)return!0;var n=e.size()-1,r=e.get(n).getLabel().getLocation(t,Nh.LEFT);tc.isTrue(r!==Su.NONE,"Found unlabelled area edge");for(var i=r,o=this.iterator();o.hasNext();){var s=o.next().getLabel();tc.isTrue(s.isArea(t),"Found non-area edge");var a=s.getLocation(t,Nh.LEFT),u=s.getLocation(t,Nh.RIGHT);if(a===u)return!1;if(u!==i)return!1;i=a}return!0},jl.prototype.findIndex=function(t){this.iterator();for(var e=0;e<this._edgeList.size();e++)if(this._edgeList.get(e)===t)return e;return-1},jl.prototype.iterator=function(){return this.getEdges().iterator()},jl.prototype.getEdges=function(){return null===this._edgeList&&(this._edgeList=new bc(this._edgeMap.values())),this._edgeList},jl.prototype.getLocation=function(t,e,n){return this._ptInAreaLocation[t]===Su.NONE&&(this._ptInAreaLocation[t]=zl.locate(e,n[t].getGeometry())),this._ptInAreaLocation[t]},jl.prototype.toString=function(){var t=new Ru;t.append("EdgeEndStar: "+this.getCoordinate()),t.append("\n");for(var e=this.iterator();e.hasNext();){var n=e.next();t.append(n),t.append("\n")}return t.toString()},jl.prototype.computeEdgeEndLabels=function(t){for(var e=this.iterator();e.hasNext();)e.next().computeLabel(t)},jl.prototype.computeLabelling=function(t){this.computeEdgeEndLabels(t[0].getBoundaryNodeRule()),this.propagateSideLabels(0),this.propagateSideLabels(1);for(var e=[!1,!1],n=this.iterator();n.hasNext();)for(var r=n.next().getLabel(),i=0;i<2;i++)r.isLine(i)&&r.getLocation(i)===Su.BOUNDARY&&(e[i]=!0);for(var o=this.iterator();o.hasNext();)for(var s=o.next(),a=s.getLabel(),u=0;u<2;u++)if(a.isAnyNull(u)){var c=Su.NONE;if(e[u])c=Su.EXTERIOR;else{var h=s.getCoordinate();c=this.getLocation(u,h,t)}a.setAllLocationsIfNull(u,c)}},jl.prototype.getDegree=function(){return this._edgeMap.size()},jl.prototype.insertEdgeEnd=function(t,e){this._edgeMap.put(t,e),this._edgeList=null},jl.prototype.interfaces_=function(){return[]},jl.prototype.getClass=function(){return jl};var Xl=function(t){function e(){t.call(this),this._resultAreaEdgeList=null,this._label=null,this._SCANNING_FOR_INCOMING=1,this._LINKING_TO_OUTGOING=2}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.linkResultDirectedEdges=function(){this.getResultAreaEdges();for(var t=null,e=null,n=this._SCANNING_FOR_INCOMING,r=0;r<this._resultAreaEdgeList.size();r++){var i=this._resultAreaEdgeList.get(r),o=i.getSym();if(i.getLabel().isArea())switch(null===t&&i.isInResult()&&(t=i),n){case this._SCANNING_FOR_INCOMING:if(!o.isInResult())continue;e=o,n=this._LINKING_TO_OUTGOING;break;case this._LINKING_TO_OUTGOING:if(!i.isInResult())continue;e.setNext(i),n=this._SCANNING_FOR_INCOMING}}if(n===this._LINKING_TO_OUTGOING){if(null===t)throw new Mh("no outgoing dirEdge found",this.getCoordinate());tc.isTrue(t.isInResult(),"unable to link last incoming dirEdge"),e.setNext(t)}},e.prototype.insert=function(t){var e=t;this.insertEdgeEnd(e,e)},e.prototype.getRightmostEdge=function(){var t=this.getEdges(),e=t.size();if(e<1)return null;var n=t.get(0);if(1===e)return n;var r=t.get(e-1),i=n.getQuadrant(),o=r.getQuadrant();return Bh.isNorthern(i)&&Bh.isNorthern(o)?n:Bh.isNorthern(i)||Bh.isNorthern(o)?0!==n.getDy()?n:0!==r.getDy()?r:(tc.shouldNeverReachHere("found two horizontal edges incident on node"),null):r},e.prototype.print=function(t){Xu.out.println("DirectedEdgeStar: "+this.getCoordinate());for(var e=this.iterator();e.hasNext();){var n=e.next();t.print("out "),n.print(t),t.println(),t.print("in "),n.getSym().print(t),t.println()}},e.prototype.getResultAreaEdges=function(){if(null!==this._resultAreaEdgeList)return this._resultAreaEdgeList;this._resultAreaEdgeList=new bc;for(var t=this.iterator();t.hasNext();){var e=t.next();(e.isInResult()||e.getSym().isInResult())&&this._resultAreaEdgeList.add(e)}return this._resultAreaEdgeList},e.prototype.updateLabelling=function(t){for(var e=this.iterator();e.hasNext();){var n=e.next().getLabel();n.setAllLocationsIfNull(0,t.getLocation(0)),n.setAllLocationsIfNull(1,t.getLocation(1))}},e.prototype.linkAllDirectedEdges=function(){this.getEdges();for(var t=null,e=null,n=this._edgeList.size()-1;n>=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(Nh.LEFT),r=t.getDepth(Nh.RIGHT),i=this.computeDepths(e+1,this._edgeList.size(),n);if(this.computeDepths(0,e,i)!==r)throw new Mh("depth mismatch at "+t.getCoordinate())}else if(3===arguments.length){for(var o=arguments[1],s=arguments[2],a=arguments[0];a<o;a++){var u=this._edgeList.get(a);u.setEdgeDepths(Nh.RIGHT,s),s=u.getDepth(Nh.LEFT)}return s}},e.prototype.mergeSymLabels=function(){for(var t=this.iterator();t.hasNext();){var e=t.next();e.getLabel().merge(e.getSym().getLabel())}},e.prototype.linkMinimalDirectedEdges=function(t){for(var e=null,n=null,r=this._SCANNING_FOR_INCOMING,i=this._resultAreaEdgeList.size()-1;i>=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&&(tc.isTrue(null!==e,"found null for first outgoing dirEdge"),tc.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=Su.NONE,e=this.iterator();e.hasNext();){var n=e.next(),r=n.getSym();if(!n.isLineEdge()){if(n.isInResult()){t=Su.INTERIOR;break}if(r.isInResult()){t=Su.EXTERIOR;break}}}if(t===Su.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===Su.INTERIOR):(s.isInResult()&&(i=Su.EXTERIOR),a.isInResult()&&(i=Su.INTERIOR))}},e.prototype.computeLabelling=function(e){t.prototype.computeLabelling.call(this,e),this._label=new Rh(Su.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!==Su.INTERIOR&&o!==Su.BOUNDARY||this._label.setLocation(i,Su.INTERIOR)}},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(jl),Ul=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 qh(t,new Xl)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Xh),Yl=function t(){this._pts=null,this._orientation=null;var e=arguments[0];this._pts=e,this._orientation=t.orientation(e)};Yl.prototype.compareTo=function(t){var e=t;return Yl.compareOriented(this._pts,this._orientation,e._pts,e._orientation)},Yl.prototype.interfaces_=function(){return[xu]},Yl.prototype.getClass=function(){return Yl},Yl.orientation=function(t){return 1===Cc.increasingDirection(t)},Yl.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,c=r?0:n.length-1;;){var h=t[u].compareTo(n[c]);if(0!==h)return h;var l=(u+=i)===s,p=(c+=o)===a;if(l&&!p)return-1;if(!l&&p)return 1;if(l&&p)return 0}};var Vl=function(){this._edges=new bc,this._ocaMap=new Gi};Vl.prototype.print=function(t){t.print("MULTILINESTRING ( ");for(var e=0;e<this._edges.size();e++){var n=this._edges.get(e);e>0&&t.print(","),t.print("(");for(var r=n.getCoordinates(),i=0;i<r.length;i++)i>0&&t.print(","),t.print(r[i].x+" "+r[i].y);t.println(")")}t.print(") ")},Vl.prototype.addAll=function(t){for(var e=t.iterator();e.hasNext();)this.add(e.next())},Vl.prototype.findEdgeIndex=function(t){for(var e=0;e<this._edges.size();e++)if(this._edges.get(e).equals(t))return e;return-1},Vl.prototype.iterator=function(){return this._edges.iterator()},Vl.prototype.getEdges=function(){return this._edges},Vl.prototype.get=function(t){return this._edges.get(t)},Vl.prototype.findEqualEdge=function(t){var e=new Yl(t.getCoordinates());return this._ocaMap.get(e)},Vl.prototype.add=function(t){this._edges.add(t);var e=new Yl(t.getCoordinates());this._ocaMap.put(e,t)},Vl.prototype.interfaces_=function(){return[]},Vl.prototype.getClass=function(){return Vl};var Hl=function(){};Hl.prototype.processIntersections=function(t,e,n,r){},Hl.prototype.isDone=function(){},Hl.prototype.interfaces_=function(){return[]},Hl.prototype.getClass=function(){return Hl};var Wl=function(){this._hasIntersection=!1,this._hasProper=!1,this._hasProperInterior=!1,this._hasInterior=!1,this._properIntersectionPoint=null,this._li=null,this._isSelfIntersection=null,this.numIntersections=0,this.numInteriorIntersections=0,this.numProperIntersections=0,this.numTests=0;var t=arguments[0];this._li=t};Wl.prototype.isTrivialIntersection=function(t,e,n,r){if(t===n&&1===this._li.getIntersectionNum()){if(Wl.isAdjacentSegments(e,r))return!0;if(t.isClosed()){var i=t.size()-1;if(0===e&&r===i||0===r&&e===i)return!0}}return!1},Wl.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},Wl.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},Wl.prototype.getLineIntersector=function(){return this._li},Wl.prototype.hasProperIntersection=function(){return this._hasProper},Wl.prototype.processIntersections=function(t,e,n,r){if(t===n&&e===r)return null;this.numTests++;var i=t.getCoordinates()[e],o=t.getCoordinates()[e+1],s=n.getCoordinates()[r],a=n.getCoordinates()[r+1];this._li.computeIntersection(i,o,s,a),this._li.hasIntersection()&&(this.numIntersections++,this._li.isInteriorIntersection()&&(this.numInteriorIntersections++,this._hasInterior=!0),this.isTrivialIntersection(t,e,n,r)||(this._hasIntersection=!0,t.addIntersections(this._li,e,0),n.addIntersections(this._li,r,1),this._li.isProper()&&(this.numProperIntersections++,this._hasProper=!0,this._hasProperInterior=!0)))},Wl.prototype.hasIntersection=function(){return this._hasIntersection},Wl.prototype.isDone=function(){return!1},Wl.prototype.hasInteriorIntersection=function(){return this._hasInterior},Wl.prototype.interfaces_=function(){return[Hl]},Wl.prototype.getClass=function(){return Wl},Wl.isAdjacentSegments=function(t,e){return 1===Math.abs(t-e)};var Jl=function(){this.coord=null,this.segmentIndex=null,this.dist=null;var t=arguments[0],e=arguments[1],n=arguments[2];this.coord=new bu(t),this.segmentIndex=e,this.dist=n};Jl.prototype.getSegmentIndex=function(){return this.segmentIndex},Jl.prototype.getCoordinate=function(){return this.coord},Jl.prototype.print=function(t){t.print(this.coord),t.print(" seg # = "+this.segmentIndex),t.println(" dist = "+this.dist)},Jl.prototype.compareTo=function(t){var e=t;return this.compare(e.segmentIndex,e.dist)},Jl.prototype.isEndPoint=function(t){return 0===this.segmentIndex&&0===this.dist||this.segmentIndex===t},Jl.prototype.toString=function(){return this.coord+" seg # = "+this.segmentIndex+" dist = "+this.dist},Jl.prototype.getDistance=function(){return this.dist},Jl.prototype.compare=function(t,e){return this.segmentIndex<t?-1:this.segmentIndex>t?1:this.dist<e?-1:this.dist>e?1:0},Jl.prototype.interfaces_=function(){return[xu]},Jl.prototype.getClass=function(){return Jl};var Zl=function(){this._nodeMap=new Gi,this.edge=null;var t=arguments[0];this.edge=t};Zl.prototype.print=function(t){t.println("Intersections:");for(var e=this.iterator();e.hasNext();)e.next().print(t)},Zl.prototype.iterator=function(){return this._nodeMap.values().iterator()},Zl.prototype.addSplitEdges=function(t){this.addEndpoints();for(var e=this.iterator(),n=e.next();e.hasNext();){var r=e.next(),i=this.createSplitEdge(n,r);t.add(i),n=r}},Zl.prototype.addEndpoints=function(){var t=this.edge.pts.length-1;this.add(this.edge.pts[0],0,0),this.add(this.edge.pts[t],t,0)},Zl.prototype.createSplitEdge=function(t,e){var n=e.segmentIndex-t.segmentIndex+2,r=this.edge.pts[e.segmentIndex],i=e.dist>0||!e.coord.equals2D(r);i||n--;var o=new Array(n).fill(null),s=0;o[s++]=new bu(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 ep(o,new Rh(this.edge._label))},Zl.prototype.add=function(t,e,n){var r=new Jl(t,e,n),i=this._nodeMap.get(r);return null!==i?i:(this._nodeMap.put(r,r),r)},Zl.prototype.isIntersection=function(t){for(var e=this.iterator();e.hasNext();)if(e.next().coord.equals(t))return!0;return!1},Zl.prototype.interfaces_=function(){return[]},Zl.prototype.getClass=function(){return Zl};var Kl=function(){};Kl.prototype.getChainStartIndices=function(t){var e=0,n=new bc;n.add(new Tu(e));do{var r=this.findChainEnd(t,e);n.add(new Tu(r)),e=r}while(e<t.length-1);return Kl.toIntArray(n)},Kl.prototype.findChainEnd=function(t,e){for(var n=Bh.quadrant(t[e],t[e+1]),r=e+1;r<t.length&&Bh.quadrant(t[r-1],t[r])===n;)r++;return r-1},Kl.prototype.interfaces_=function(){return[]},Kl.prototype.getClass=function(){return Kl},Kl.toIntArray=function(t){for(var e=new Array(t.size()).fill(null),n=0;n<e.length;n++)e[n]=t.get(n).intValue();return e};var Ql=function(){this.e=null,this.pts=null,this.startIndex=null,this.env1=new Yu,this.env2=new Yu;var t=arguments[0];this.e=t,this.pts=t.getCoordinates();var e=new Kl;this.startIndex=e.getChainStartIndices(this.pts)};Ql.prototype.getCoordinates=function(){return this.pts},Ql.prototype.getMaxX=function(t){var e=this.pts[this.startIndex[t]].x,n=this.pts[this.startIndex[t+1]].x;return e>n?e:n},Ql.prototype.getMinX=function(t){var e=this.pts[this.startIndex[t]].x,n=this.pts[this.startIndex[t+1]].x;return e<n?e:n},Ql.prototype.computeIntersectsForChain=function(){if(4===arguments.length){var t=arguments[0],e=arguments[1],n=arguments[2],r=arguments[3];this.computeIntersectsForChain(this.startIndex[t],this.startIndex[t+1],e,e.startIndex[n],e.startIndex[n+1],r)}else if(6===arguments.length){var i=arguments[0],o=arguments[1],s=arguments[2],a=arguments[3],u=arguments[4],c=arguments[5],h=this.pts[i],l=this.pts[o],p=s.pts[a],f=s.pts[u];if(o-i==1&&u-a==1)return c.addIntersections(this.e,i,s.e,a),null;if(this.env1.init(h,l),this.env2.init(p,f),!this.env1.intersects(this.env2))return null;var g=Math.trunc((i+o)/2),d=Math.trunc((a+u)/2);i<g&&(a<d&&this.computeIntersectsForChain(i,g,s,a,d,c),d<u&&this.computeIntersectsForChain(i,g,s,d,u,c)),g<o&&(a<d&&this.computeIntersectsForChain(g,o,s,a,d,c),d<u&&this.computeIntersectsForChain(g,o,s,d,u,c))}},Ql.prototype.getStartIndexes=function(){return this.startIndex},Ql.prototype.computeIntersects=function(t,e){for(var n=0;n<this.startIndex.length-1;n++)for(var r=0;r<t.startIndex.length-1;r++)this.computeIntersectsForChain(n,t,r,e)},Ql.prototype.interfaces_=function(){return[]},Ql.prototype.getClass=function(){return Ql};var $l=function t(){this._depth=Array(2).fill().map((function(){return Array(3)}));for(var e=0;e<2;e++)for(var n=0;n<3;n++)this._depth[e][n]=t.NULL_VALUE},tp={NULL_VALUE:{configurable:!0}};$l.prototype.getDepth=function(t,e){return this._depth[t][e]},$l.prototype.setDepth=function(t,e,n){this._depth[t][e]=n},$l.prototype.isNull=function(){if(0===arguments.length){for(var t=0;t<2;t++)for(var e=0;e<3;e++)if(this._depth[t][e]!==$l.NULL_VALUE)return!1;return!0}if(1===arguments.length){var n=arguments[0];return this._depth[n][1]===$l.NULL_VALUE}if(2===arguments.length){var r=arguments[0],i=arguments[1];return this._depth[r][i]===$l.NULL_VALUE}},$l.prototype.normalize=function(){for(var t=0;t<2;t++)if(!this.isNull(t)){var e=this._depth[t][1];this._depth[t][2]<e&&(e=this._depth[t][2]),e<0&&(e=0);for(var n=1;n<3;n++){var r=0;this._depth[t][n]>e&&(r=1),this._depth[t][n]=r}}},$l.prototype.getDelta=function(t){return this._depth[t][Nh.RIGHT]-this._depth[t][Nh.LEFT]},$l.prototype.getLocation=function(t,e){return this._depth[t][e]<=0?Su.EXTERIOR:Su.INTERIOR},$l.prototype.toString=function(){return"A: "+this._depth[0][1]+","+this._depth[0][2]+" B: "+this._depth[1][1]+","+this._depth[1][2]},$l.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!==Su.EXTERIOR&&r!==Su.INTERIOR||(this.isNull(e,n)?this._depth[e][n]=$l.depthAtLocation(r):this._depth[e][n]+=$l.depthAtLocation(r))}else if(3===arguments.length){var i=arguments[0],o=arguments[1];arguments[2]===Su.INTERIOR&&this._depth[i][o]++}},$l.prototype.interfaces_=function(){return[]},$l.prototype.getClass=function(){return $l},$l.depthAtLocation=function(t){return t===Su.EXTERIOR?0:t===Su.INTERIOR?1:$l.NULL_VALUE},tp.NULL_VALUE.get=function(){return-1},Object.defineProperties($l,tp);var ep=function(t){function e(){if(t.call(this),this.pts=null,this._env=null,this.eiList=new Zl(this),this._name=null,this._mce=null,this._isIsolated=!0,this._depth=new $l,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,Rh.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;s<this.pts.length;s++)if(this.pts[s].equals2D(n.pts[s])||(r=!1),this.pts[s].equals2D(n.pts[--o])||(i=!1),!r&&!i)return!1;return!0},e.prototype.getCoordinate=function(){if(0===arguments.length)return this.pts.length>0?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<this.pts.length;e++)e>0&&t.print(","),t.print(this.pts[e].x+" "+this.pts[e].y);t.print(") "+this._label+" "+this._depthDelta)},e.prototype.computeIM=function(t){e.updateIM(this._label,t)},e.prototype.isCollapsed=function(){return!!this._label.isArea()&&3===this.pts.length&&!!this.pts[0].equals(this.pts[2])},e.prototype.isClosed=function(){return this.pts[0].equals(this.pts[this.pts.length-1])},e.prototype.getMaximumSegmentIndex=function(){return this.pts.length-1},e.prototype.getDepthDelta=function(){return this._depthDelta},e.prototype.getNumPoints=function(){return this.pts.length},e.prototype.printReverse=function(t){t.print("edge "+this._name+": ");for(var e=this.pts.length-1;e>=0;e--)t.print(this.pts[e]+" ");t.println("")},e.prototype.getMonotoneChainEdge=function(){return null===this._mce&&(this._mce=new Ql(this)),this._mce},e.prototype.getEnvelope=function(){if(null===this._env){this._env=new Yu;for(var t=0;t<this.pts.length;t++)this._env.expandToInclude(this.pts[t])}return this._env},e.prototype.addIntersection=function(t,e,n,r){var i=new bu(t.getIntersection(r)),o=e,s=t.getEdgeDistance(n,r),a=o+1;if(a<this.pts.length){var u=this.pts[a];i.equals2D(u)&&(o=a,s=0)}this.eiList.add(i,o,s)},e.prototype.toString=function(){var t=new Ru;t.append("edge "+this._name+": "),t.append("LINESTRING (");for(var e=0;e<this.pts.length;e++)e>0&&t.append(","),t.append(this.pts[e].x+" "+this.pts[e].y);return t.append(") "+this._label+" "+this._depthDelta),t.toString()},e.prototype.isPointwiseEqual=function(t){if(this.pts.length!==t.pts.length)return!1;for(var e=0;e<this.pts.length;e++)if(!this.pts[e].equals2D(t.pts[e]))return!1;return!0},e.prototype.setDepthDelta=function(t){this._depthDelta=t},e.prototype.getEdgeIntersectionList=function(){return this.eiList},e.prototype.addIntersections=function(t,e,n){for(var r=0;r<t.getIntersectionNum();r++)this.addIntersection(t,e,n,r)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.updateIM=function(){if(2!==arguments.length)return t.prototype.updateIM.apply(this,arguments);var e=arguments[0],n=arguments[1];n.setAtLeastIfValid(e.getLocation(0,Nh.ON),e.getLocation(1,Nh.ON),1),e.isArea()&&(n.setAtLeastIfValid(e.getLocation(0,Nh.LEFT),e.getLocation(1,Nh.LEFT),2),n.setAtLeastIfValid(e.getLocation(0,Nh.RIGHT),e.getLocation(1,Nh.RIGHT),2))},e}(Fh),np=function(t){this._workingPrecisionModel=null,this._workingNoder=null,this._geomFact=null,this._graph=null,this._edgeList=new Vl,this._bufParams=t||null};np.prototype.setWorkingPrecisionModel=function(t){this._workingPrecisionModel=t},np.prototype.insertUniqueEdge=function(t){var e=this._edgeList.findEqualEdge(t);if(null!==e){var n=e.getLabel(),r=t.getLabel();e.isPointwiseEqual(t)||(r=new Rh(t.getLabel())).flip(),n.merge(r);var i=np.depthDelta(r),o=e.getDepthDelta()+i;e.setDepthDelta(o)}else this._edgeList.add(t),t.setDepthDelta(np.depthDelta(t.getLabel()))},np.prototype.buildSubgraphs=function(t,e){for(var n=new bc,r=t.iterator();r.hasNext();){var i=r.next(),o=i.getRightmostCoordinate(),s=new Al(n).getDepth(o);i.computeDepth(s),i.findResultEdges(),n.add(i),e.add(i.getDirectedEdges(),i.getNodes())}},np.prototype.createSubgraphs=function(t){for(var e=new bc,n=t.getNodes().iterator();n.hasNext();){var r=n.next();if(!r.isVisited()){var i=new Ph;i.create(r),e.add(i)}}return $h.sort(e,$h.reverseOrder()),e},np.prototype.createEmptyResultGeometry=function(){return this._geomFact.createPolygon()},np.prototype.getNoder=function(t){if(null!==this._workingNoder)return this._workingNoder;var e=new El,n=new rc;return n.setPrecisionModel(t),e.setSegmentIntersector(new Wl(n)),e},np.prototype.buffer=function(t,e){var n=this._workingPrecisionModel;null===n&&(n=t.getPrecisionModel()),this._geomFact=t.getFactory();var r=new Tl(n,this._bufParams),i=new Gl(t,e,r).getCurves();if(i.size()<=0)return this.createEmptyResultGeometry();this.computeNodedEdges(i,n),this._graph=new Uh(new Ul),this._graph.addEdges(this._edgeList.getEdges());var o=this.createSubgraphs(this._graph),s=new Yh(this._geomFact);this.buildSubgraphs(o,s);var a=s.getPolygons();return a.size()<=0?this.createEmptyResultGeometry():this._geomFact.buildGeometry(a)},np.prototype.computeNodedEdges=function(t,e){var n=this.getNoder(e);n.computeNodes(t);for(var r=n.getNodedSubstrings().iterator();r.hasNext();){var i=r.next(),o=i.getCoordinates();if(2!==o.length||!o[0].equals2D(o[1])){var s=i.getData(),a=new ep(i.getCoordinates(),new Rh(s));this.insertUniqueEdge(a)}}},np.prototype.setNoder=function(t){this._workingNoder=t},np.prototype.interfaces_=function(){return[]},np.prototype.getClass=function(){return np},np.depthDelta=function(t){var e=t.getLocation(0,Nh.LEFT),n=t.getLocation(0,Nh.RIGHT);return e===Su.INTERIOR&&n===Su.EXTERIOR?1:e===Su.EXTERIOR&&n===Su.INTERIOR?-1:0},np.convertSegStrings=function(t){for(var e=new _h,n=new bc;t.hasNext();){var r=t.next(),i=e.createLineString(r.getCoordinates());n.add(i)}return e.buildGeometry(n)};var rp=function(){if(this._noder=null,this._scaleFactor=null,this._offsetX=null,this._offsetY=null,this._isScaled=!1,2===arguments.length){var t=arguments[0],e=arguments[1];this._noder=t,this._scaleFactor=e,this._offsetX=0,this._offsetY=0,this._isScaled=!this.isIntegerPrecision()}else if(4===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2],o=arguments[3];this._noder=n,this._scaleFactor=r,this._offsetX=i,this._offsetY=o,this._isScaled=!this.isIntegerPrecision()}};rp.prototype.rescale=function(){if(Lu(arguments[0],vc))for(var t=arguments[0].iterator();t.hasNext();){var e=t.next();this.rescale(e.getCoordinates())}else if(arguments[0]instanceof Array){for(var n=arguments[0],r=0;r<n.length;r++)n[r].x=n[r].x/this._scaleFactor+this._offsetX,n[r].y=n[r].y/this._scaleFactor+this._offsetY;2===n.length&&n[0].equals2D(n[1])&&Xu.out.println(n)}},rp.prototype.scale=function(){if(Lu(arguments[0],vc)){for(var t=arguments[0],e=new bc,n=t.iterator();n.hasNext();){var r=n.next();e.add(new fl(this.scale(r.getCoordinates()),r.getData()))}return e}if(arguments[0]instanceof Array){for(var i=arguments[0],o=new Array(i.length).fill(null),s=0;s<i.length;s++)o[s]=new bu(Math.round((i[s].x-this._offsetX)*this._scaleFactor),Math.round((i[s].y-this._offsetY)*this._scaleFactor),i[s].z);return Cc.removeRepeatedPoints(o)}},rp.prototype.isIntegerPrecision=function(){return 1===this._scaleFactor},rp.prototype.getNodedSubstrings=function(){var t=this._noder.getNodedSubstrings();return this._isScaled&&this.rescale(t),t},rp.prototype.computeNodes=function(t){var e=t;this._isScaled&&(e=this.scale(t)),this._noder.computeNodes(e)},rp.prototype.interfaces_=function(){return[vl]},rp.prototype.getClass=function(){return rp};var ip=function(){this._li=new rc,this._segStrings=null;var t=arguments[0];this._segStrings=t},op={fact:{configurable:!0}};ip.prototype.checkEndPtVertexIntersections=function(){if(0===arguments.length)for(var t=this._segStrings.iterator();t.hasNext();){var e=t.next().getCoordinates();this.checkEndPtVertexIntersections(e[0],this._segStrings),this.checkEndPtVertexIntersections(e[e.length-1],this._segStrings)}else if(2===arguments.length)for(var n=arguments[0],r=arguments[1].iterator();r.hasNext();)for(var i=r.next().getCoordinates(),o=1;o<i.length-1;o++)if(i[o].equals(n))throw new Qu("found endpt/interior pt intersection at index "+o+" :pt "+n)},ip.prototype.checkInteriorIntersections=function(){if(0===arguments.length)for(var t=this._segStrings.iterator();t.hasNext();)for(var e=t.next(),n=this._segStrings.iterator();n.hasNext();){var r=n.next();this.checkInteriorIntersections(e,r)}else if(2===arguments.length)for(var i=arguments[0],o=arguments[1],s=i.getCoordinates(),a=o.getCoordinates(),u=0;u<s.length-1;u++)for(var c=0;c<a.length-1;c++)this.checkInteriorIntersections(i,u,o,c);else if(4===arguments.length){var h=arguments[0],l=arguments[1],p=arguments[2],f=arguments[3];if(h===p&&l===f)return null;var g=h.getCoordinates()[l],d=h.getCoordinates()[l+1],y=p.getCoordinates()[f],_=p.getCoordinates()[f+1];if(this._li.computeIntersection(g,d,y,_),this._li.hasIntersection()&&(this._li.isProper()||this.hasInteriorIntersection(this._li,g,d)||this.hasInteriorIntersection(this._li,y,_)))throw new Qu("found non-noded intersection at "+g+"-"+d+" and "+y+"-"+_)}},ip.prototype.checkValid=function(){this.checkEndPtVertexIntersections(),this.checkInteriorIntersections(),this.checkCollapses()},ip.prototype.checkCollapses=function(){if(0===arguments.length)for(var t=this._segStrings.iterator();t.hasNext();){var e=t.next();this.checkCollapses(e)}else if(1===arguments.length)for(var n=arguments[0].getCoordinates(),r=0;r<n.length-2;r++)this.checkCollapse(n[r],n[r+1],n[r+2])},ip.prototype.hasInteriorIntersection=function(t,e,n){for(var r=0;r<t.getIntersectionNum();r++){var i=t.getIntersection(r);if(!i.equals(e)&&!i.equals(n))return!0}return!1},ip.prototype.checkCollapse=function(t,e,n){if(t.equals(n))throw new Qu("found non-noded collapse at "+ip.fact.createLineString([t,e,n]))},ip.prototype.interfaces_=function(){return[]},ip.prototype.getClass=function(){return ip},op.fact.get=function(){return new _h},Object.defineProperties(ip,op);var sp=function(){this._li=null,this._pt=null,this._originalPt=null,this._ptScaled=null,this._p0Scaled=null,this._p1Scaled=null,this._scaleFactor=null,this._minx=null,this._maxx=null,this._miny=null,this._maxy=null,this._corner=new Array(4).fill(null),this._safeEnv=null;var t=arguments[0],e=arguments[1],n=arguments[2];if(this._originalPt=t,this._pt=t,this._scaleFactor=e,this._li=n,e<=0)throw new _u("Scale factor must be non-zero");1!==e&&(this._pt=new bu(this.scale(t.x),this.scale(t.y)),this._p0Scaled=new bu,this._p1Scaled=new bu),this.initCorners(this._pt)},ap={SAFE_ENV_EXPANSION_FACTOR:{configurable:!0}};sp.prototype.intersectsScaled=function(t,e){var n=Math.min(t.x,e.x),r=Math.max(t.x,e.x),i=Math.min(t.y,e.y),o=Math.max(t.y,e.y),s=this._maxx<n||this._minx>r||this._maxy<i||this._miny>o;if(s)return!1;var a=this.intersectsToleranceSquare(t,e);return tc.isTrue(!(s&&a),"Found bad envelope test"),a},sp.prototype.initCorners=function(t){this._minx=t.x-.5,this._maxx=t.x+.5,this._miny=t.y-.5,this._maxy=t.y+.5,this._corner[0]=new bu(this._maxx,this._maxy),this._corner[1]=new bu(this._minx,this._maxy),this._corner[2]=new bu(this._minx,this._miny),this._corner[3]=new bu(this._maxx,this._miny)},sp.prototype.intersects=function(t,e){return 1===this._scaleFactor?this.intersectsScaled(t,e):(this.copyScaled(t,this._p0Scaled),this.copyScaled(e,this._p1Scaled),this.intersectsScaled(this._p0Scaled,this._p1Scaled))},sp.prototype.scale=function(t){return Math.round(t*this._scaleFactor)},sp.prototype.getCoordinate=function(){return this._originalPt},sp.prototype.copyScaled=function(t,e){e.x=this.scale(t.x),e.y=this.scale(t.y)},sp.prototype.getSafeEnvelope=function(){if(null===this._safeEnv){var t=sp.SAFE_ENV_EXPANSION_FACTOR/this._scaleFactor;this._safeEnv=new Yu(this._originalPt.x-t,this._originalPt.x+t,this._originalPt.y-t,this._originalPt.y+t)}return this._safeEnv},sp.prototype.intersectsPixelClosure=function(t,e){return this._li.computeIntersection(t,e,this._corner[0],this._corner[1]),!!this._li.hasIntersection()||(this._li.computeIntersection(t,e,this._corner[1],this._corner[2]),!!this._li.hasIntersection()||(this._li.computeIntersection(t,e,this._corner[2],this._corner[3]),!!this._li.hasIntersection()||(this._li.computeIntersection(t,e,this._corner[3],this._corner[0]),!!this._li.hasIntersection())))},sp.prototype.intersectsToleranceSquare=function(t,e){var n=!1,r=!1;return this._li.computeIntersection(t,e,this._corner[0],this._corner[1]),!!this._li.isProper()||(this._li.computeIntersection(t,e,this._corner[1],this._corner[2]),!!this._li.isProper()||(this._li.hasIntersection()&&(n=!0),this._li.computeIntersection(t,e,this._corner[2],this._corner[3]),!!this._li.isProper()||(this._li.hasIntersection()&&(r=!0),this._li.computeIntersection(t,e,this._corner[3],this._corner[0]),!!this._li.isProper()||!(!n||!r)||!!t.equals(this._pt)||!!e.equals(this._pt))))},sp.prototype.addSnappedNode=function(t,e){var n=t.getCoordinate(e),r=t.getCoordinate(e+1);return!!this.intersects(n,r)&&(t.addIntersection(this.getCoordinate(),e),!0)},sp.prototype.interfaces_=function(){return[]},sp.prototype.getClass=function(){return sp},ap.SAFE_ENV_EXPANSION_FACTOR.get=function(){return.75},Object.defineProperties(sp,ap);var up=function(){this.tempEnv1=new Yu,this.selectedSegment=new gl};up.prototype.select=function(){if(1===arguments.length);else if(2===arguments.length){var t=arguments[1];arguments[0].getLineSegment(t,this.selectedSegment),this.select(this.selectedSegment)}},up.prototype.interfaces_=function(){return[]},up.prototype.getClass=function(){return up};var cp=function(){this._index=null;var t=arguments[0];this._index=t},hp={HotPixelSnapAction:{configurable:!0}};cp.prototype.snap=function(){if(1===arguments.length){var t=arguments[0];return this.snap(t,null,-1)}if(3===arguments.length){var e=arguments[0],n=arguments[1],r=arguments[2],i=e.getSafeEnvelope(),o=new lp(e,n,r);return this._index.query(i,{interfaces_:function(){return[Jh]},visitItem:function(t){t.select(i,o)}}),o.isNodeAdded()}},cp.prototype.interfaces_=function(){return[]},cp.prototype.getClass=function(){return cp},hp.HotPixelSnapAction.get=function(){return lp},Object.defineProperties(cp,hp);var lp=function(t){function e(){t.call(this),this._hotPixel=null,this._parentEdge=null,this._hotPixelVertexIndex=null,this._isNodeAdded=!1;var e=arguments[0],n=arguments[1],r=arguments[2];this._hotPixel=e,this._parentEdge=n,this._hotPixelVertexIndex=r}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.isNodeAdded=function(){return this._isNodeAdded},e.prototype.select=function(){if(2!==arguments.length)return t.prototype.select.apply(this,arguments);var e=arguments[1],n=arguments[0].getContext();if(null!==this._parentEdge&&n===this._parentEdge&&e===this._hotPixelVertexIndex)return null;this._isNodeAdded=this._hotPixel.addSnappedNode(n,e)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(up),pp=function(){this._li=null,this._interiorIntersections=null;var t=arguments[0];this._li=t,this._interiorIntersections=new bc};pp.prototype.processIntersections=function(t,e,n,r){if(t===n&&e===r)return null;var i=t.getCoordinates()[e],o=t.getCoordinates()[e+1],s=n.getCoordinates()[r],a=n.getCoordinates()[r+1];if(this._li.computeIntersection(i,o,s,a),this._li.hasIntersection()&&this._li.isInteriorIntersection()){for(var u=0;u<this._li.getIntersectionNum();u++)this._interiorIntersections.add(this._li.getIntersection(u));t.addIntersections(this._li,e,0),n.addIntersections(this._li,r,1)}},pp.prototype.isDone=function(){return!1},pp.prototype.getInteriorIntersections=function(){return this._interiorIntersections},pp.prototype.interfaces_=function(){return[Hl]},pp.prototype.getClass=function(){return pp};var fp=function(){this._pm=null,this._li=null,this._scaleFactor=null,this._noder=null,this._pointSnapper=null,this._nodedSegStrings=null;var t=arguments[0];this._pm=t,this._li=new rc,this._li.setPrecisionModel(t),this._scaleFactor=t.getScale()};fp.prototype.checkCorrectness=function(t){var e=fl.getNodedSubstrings(t),n=new ip(e);try{n.checkValid()}catch(t){if(!(t instanceof zu))throw t;t.printStackTrace()}},fp.prototype.getNodedSubstrings=function(){return fl.getNodedSubstrings(this._nodedSegStrings)},fp.prototype.snapRound=function(t,e){var n=this.findInteriorIntersections(t,e);this.computeIntersectionSnaps(n),this.computeVertexSnaps(t)},fp.prototype.findInteriorIntersections=function(t,e){var n=new pp(e);return this._noder.setSegmentIntersector(n),this._noder.computeNodes(t),n.getInteriorIntersections()},fp.prototype.computeVertexSnaps=function(){if(Lu(arguments[0],vc))for(var t=arguments[0].iterator();t.hasNext();){var e=t.next();this.computeVertexSnaps(e)}else if(arguments[0]instanceof fl)for(var n=arguments[0],r=n.getCoordinates(),i=0;i<r.length;i++){var o=new sp(r[i],this._scaleFactor,this._li);this._pointSnapper.snap(o,n,i)&&n.addIntersection(r[i],i)}},fp.prototype.computeNodes=function(t){this._nodedSegStrings=t,this._noder=new El,this._pointSnapper=new cp(this._noder.getIndex()),this.snapRound(t,this._li)},fp.prototype.computeIntersectionSnaps=function(t){for(var e=t.iterator();e.hasNext();){var n=e.next(),r=new sp(n,this._scaleFactor,this._li);this._pointSnapper.snap(r)}},fp.prototype.interfaces_=function(){return[vl]},fp.prototype.getClass=function(){return fp};var gp=function(){if(this._argGeom=null,this._distance=null,this._bufParams=new bl,this._resultGeometry=null,this._saveException=null,1===arguments.length){var t=arguments[0];this._argGeom=t}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this._argGeom=e,this._bufParams=n}},dp={CAP_ROUND:{configurable:!0},CAP_BUTT:{configurable:!0},CAP_FLAT:{configurable:!0},CAP_SQUARE:{configurable:!0},MAX_PRECISION_DIGITS:{configurable:!0}};gp.prototype.bufferFixedPrecision=function(t){var e=new rp(new fp(new fh(1)),t.getScale()),n=new np(this._bufParams);n.setWorkingPrecisionModel(t),n.setNoder(e),this._resultGeometry=n.buffer(this._argGeom,this._distance)},gp.prototype.bufferReducedPrecision=function(){var t=this;if(0===arguments.length){for(var e=gp.MAX_PRECISION_DIGITS;e>=0;e--){try{t.bufferReducedPrecision(e)}catch(e){if(!(e instanceof Mh))throw e;t._saveException=e}if(null!==t._resultGeometry)return null}throw this._saveException}if(1===arguments.length){var n=arguments[0],r=gp.precisionScaleFactor(this._argGeom,this._distance,n),i=new fh(r);this.bufferFixedPrecision(i)}},gp.prototype.computeGeometry=function(){if(this.bufferOriginalPrecision(),null!==this._resultGeometry)return null;var t=this._argGeom.getFactory().getPrecisionModel();t.getType()===fh.FIXED?this.bufferFixedPrecision(t):this.bufferReducedPrecision()},gp.prototype.setQuadrantSegments=function(t){this._bufParams.setQuadrantSegments(t)},gp.prototype.bufferOriginalPrecision=function(){try{var t=new np(this._bufParams);this._resultGeometry=t.buffer(this._argGeom,this._distance)}catch(t){if(!(t instanceof Qu))throw t;this._saveException=t}},gp.prototype.getResultGeometry=function(t){return this._distance=t,this.computeGeometry(),this._resultGeometry},gp.prototype.setEndCapStyle=function(t){this._bufParams.setEndCapStyle(t)},gp.prototype.interfaces_=function(){return[]},gp.prototype.getClass=function(){return gp},gp.bufferOp=function(){if(2===arguments.length){var t=arguments[1];return new gp(arguments[0]).getResultGeometry(t)}if(3===arguments.length){if(Number.isInteger(arguments[2])&&arguments[0]instanceof cc&&"number"==typeof arguments[1]){var e=arguments[1],n=arguments[2],r=new gp(arguments[0]);return r.setQuadrantSegments(n),r.getResultGeometry(e)}if(arguments[2]instanceof bl&&arguments[0]instanceof cc&&"number"==typeof arguments[1]){var i=arguments[1];return new gp(arguments[0],arguments[2]).getResultGeometry(i)}}else if(4===arguments.length){var o=arguments[1],s=arguments[2],a=arguments[3],u=new gp(arguments[0]);return u.setQuadrantSegments(s),u.setEndCapStyle(a),u.getResultGeometry(o)}},gp.precisionScaleFactor=function(t,e,n){var r=t.getEnvelopeInternal(),i=Pu.max(Math.abs(r.getMaxX()),Math.abs(r.getMaxY()),Math.abs(r.getMinX()),Math.abs(r.getMinY()))+2*(e>0?e:0),o=n-Math.trunc(Math.log(i)/Math.log(10)+1);return Math.pow(10,o)},dp.CAP_ROUND.get=function(){return bl.CAP_ROUND},dp.CAP_BUTT.get=function(){return bl.CAP_FLAT},dp.CAP_FLAT.get=function(){return bl.CAP_FLAT},dp.CAP_SQUARE.get=function(){return bl.CAP_SQUARE},dp.MAX_PRECISION_DIGITS.get=function(){return 12},Object.defineProperties(gp,dp);var yp=function(){this._pt=[new bu,new bu],this._distance=mu.NaN,this._isNull=!0};yp.prototype.getCoordinates=function(){return this._pt},yp.prototype.getCoordinate=function(t){return this._pt[t]},yp.prototype.setMinimum=function(){if(1===arguments.length){var t=arguments[0];this.setMinimum(t._pt[0],t._pt[1])}else if(2===arguments.length){var e=arguments[0],n=arguments[1];if(this._isNull)return this.initialize(e,n),null;var r=e.distance(n);r<this._distance&&this.initialize(e,n,r)}},yp.prototype.initialize=function(){if(0===arguments.length)this._isNull=!0;else if(2===arguments.length){var t=arguments[0],e=arguments[1];this._pt[0].setCoordinate(t),this._pt[1].setCoordinate(e),this._distance=t.distance(e),this._isNull=!1}else if(3===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2];this._pt[0].setCoordinate(n),this._pt[1].setCoordinate(r),this._distance=i,this._isNull=!1}},yp.prototype.getDistance=function(){return this._distance},yp.prototype.setMaximum=function(){if(1===arguments.length){var t=arguments[0];this.setMaximum(t._pt[0],t._pt[1])}else if(2===arguments.length){var e=arguments[0],n=arguments[1];if(this._isNull)return this.initialize(e,n),null;var r=e.distance(n);r>this._distance&&this.initialize(e,n,r)}},yp.prototype.interfaces_=function(){return[]},yp.prototype.getClass=function(){return yp};var _p=function(){};_p.prototype.interfaces_=function(){return[]},_p.prototype.getClass=function(){return _p},_p.computeDistance=function(){if(arguments[2]instanceof yp&&arguments[0]instanceof Jc&&arguments[1]instanceof bu)for(var t=arguments[1],e=arguments[2],n=arguments[0].getCoordinates(),r=new gl,i=0;i<n.length-1;i++){r.setCoordinates(n[i],n[i+1]);var o=r.closestPoint(t);e.setMinimum(o,t)}else if(arguments[2]instanceof yp&&arguments[0]instanceof $c&&arguments[1]instanceof bu){var s=arguments[0],a=arguments[1],u=arguments[2];_p.computeDistance(s.getExteriorRing(),a,u);for(var c=0;c<s.getNumInteriorRing();c++)_p.computeDistance(s.getInteriorRingN(c),a,u)}else if(arguments[2]instanceof yp&&arguments[0]instanceof cc&&arguments[1]instanceof bu){var h=arguments[0],l=arguments[1],p=arguments[2];if(h instanceof Jc)_p.computeDistance(h,l,p);else if(h instanceof $c)_p.computeDistance(h,l,p);else if(h instanceof jc)for(var f=h,g=0;g<f.getNumGeometries();g++){var d=f.getGeometryN(g);_p.computeDistance(d,l,p)}else p.setMinimum(h.getCoordinate(),l)}else if(arguments[2]instanceof yp&&arguments[0]instanceof gl&&arguments[1]instanceof bu){var y=arguments[1],_=arguments[2],m=arguments[0].closestPoint(y);_.setMinimum(m,y)}};var mp=function(t){this._maxPtDist=new yp,this._inputGeom=t||null},vp={MaxPointDistanceFilter:{configurable:!0},MaxMidpointDistanceFilter:{configurable:!0}};mp.prototype.computeMaxMidpointDistance=function(t){var e=new Ep(this._inputGeom);t.apply(e),this._maxPtDist.setMaximum(e.getMaxPointDistance())},mp.prototype.computeMaxVertexDistance=function(t){var e=new xp(this._inputGeom);t.apply(e),this._maxPtDist.setMaximum(e.getMaxPointDistance())},mp.prototype.findDistance=function(t){return this.computeMaxVertexDistance(t),this.computeMaxMidpointDistance(t),this._maxPtDist.getDistance()},mp.prototype.getDistancePoints=function(){return this._maxPtDist},mp.prototype.interfaces_=function(){return[]},mp.prototype.getClass=function(){return mp},vp.MaxPointDistanceFilter.get=function(){return xp},vp.MaxMidpointDistanceFilter.get=function(){return Ep},Object.defineProperties(mp,vp);var xp=function(t){this._maxPtDist=new yp,this._minPtDist=new yp,this._geom=t||null};xp.prototype.filter=function(t){this._minPtDist.initialize(),_p.computeDistance(this._geom,t,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},xp.prototype.getMaxPointDistance=function(){return this._maxPtDist},xp.prototype.interfaces_=function(){return[pc]},xp.prototype.getClass=function(){return xp};var Ep=function(t){this._maxPtDist=new yp,this._minPtDist=new yp,this._geom=t||null};Ep.prototype.filter=function(t,e){if(0===e)return null;var n=t.getCoordinate(e-1),r=t.getCoordinate(e),i=new bu((n.x+r.x)/2,(n.y+r.y)/2);this._minPtDist.initialize(),_p.computeDistance(this._geom,i,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},Ep.prototype.isDone=function(){return!1},Ep.prototype.isGeometryChanged=function(){return!1},Ep.prototype.getMaxPointDistance=function(){return this._maxPtDist},Ep.prototype.interfaces_=function(){return[zc]},Ep.prototype.getClass=function(){return Ep};var wp=function(t){this._comps=t||null};wp.prototype.filter=function(t){t instanceof $c&&this._comps.add(t)},wp.prototype.interfaces_=function(){return[kc]},wp.prototype.getClass=function(){return wp},wp.getPolygons=function(){if(1===arguments.length){var t=arguments[0];return wp.getPolygons(t,new bc)}if(2===arguments.length){var e=arguments[0],n=arguments[1];return e instanceof $c?n.add(e):e instanceof jc&&e.apply(new wp(n)),n}};var bp=function(){if(this._lines=null,this._isForcedToLineString=!1,1===arguments.length){var t=arguments[0];this._lines=t}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this._lines=e,this._isForcedToLineString=n}};bp.prototype.filter=function(t){if(this._isForcedToLineString&&t instanceof eh){var e=t.getFactory().createLineString(t.getCoordinateSequence());return this._lines.add(e),null}t instanceof Jc&&this._lines.add(t)},bp.prototype.setForceToLineString=function(t){this._isForcedToLineString=t},bp.prototype.interfaces_=function(){return[uc]},bp.prototype.getClass=function(){return bp},bp.getGeometry=function(){if(1===arguments.length){var t=arguments[0];return t.getFactory().buildGeometry(bp.getLines(t))}if(2===arguments.length){var e=arguments[0],n=arguments[1];return e.getFactory().buildGeometry(bp.getLines(e,n))}},bp.getLines=function(){if(1===arguments.length){var t=arguments[0];return bp.getLines(t,!1)}if(2===arguments.length){if(Lu(arguments[0],vc)&&Lu(arguments[1],vc)){for(var e=arguments[1],n=arguments[0].iterator();n.hasNext();){var r=n.next();bp.getLines(r,e)}return e}if(arguments[0]instanceof cc&&"boolean"==typeof arguments[1]){var i=arguments[0],o=arguments[1],s=new bc;return i.apply(new bp(s,o)),s}if(arguments[0]instanceof cc&&Lu(arguments[1],vc)){var a=arguments[0],u=arguments[1];return a instanceof Jc?u.add(a):a.apply(new bp(u)),u}}else if(3===arguments.length){if("boolean"==typeof arguments[2]&&Lu(arguments[0],vc)&&Lu(arguments[1],vc)){for(var c=arguments[1],h=arguments[2],l=arguments[0].iterator();l.hasNext();){var p=l.next();bp.getLines(p,c,h)}return c}if("boolean"==typeof arguments[2]&&arguments[0]instanceof cc&&Lu(arguments[1],vc)){var f=arguments[1],g=arguments[2];return arguments[0].apply(new bp(f,g)),f}}};var Ip=function(){if(this._boundaryRule=fc.OGC_SFS_BOUNDARY_RULE,this._isIn=null,this._numBoundaries=null,0===arguments.length);else if(1===arguments.length){var t=arguments[0];if(null===t)throw new _u("Rule must be non-null");this._boundaryRule=t}};Ip.prototype.locateInternal=function(){if(arguments[0]instanceof bu&&arguments[1]instanceof $c){var t=arguments[0],e=arguments[1];if(e.isEmpty())return Su.EXTERIOR;var n=e.getExteriorRing(),r=this.locateInPolygonRing(t,n);if(r===Su.EXTERIOR)return Su.EXTERIOR;if(r===Su.BOUNDARY)return Su.BOUNDARY;for(var i=0;i<e.getNumInteriorRing();i++){var o=e.getInteriorRingN(i),s=this.locateInPolygonRing(t,o);if(s===Su.INTERIOR)return Su.EXTERIOR;if(s===Su.BOUNDARY)return Su.BOUNDARY}return Su.INTERIOR}if(arguments[0]instanceof bu&&arguments[1]instanceof Jc){var a=arguments[0],u=arguments[1];if(!u.getEnvelopeInternal().intersects(a))return Su.EXTERIOR;var c=u.getCoordinates();return u.isClosed()||!a.equals(c[0])&&!a.equals(c[c.length-1])?sc.isOnLine(a,c)?Su.INTERIOR:Su.EXTERIOR:Su.BOUNDARY}if(arguments[0]instanceof bu&&arguments[1]instanceof Kc){var h=arguments[0];return arguments[1].getCoordinate().equals2D(h)?Su.INTERIOR:Su.EXTERIOR}},Ip.prototype.locateInPolygonRing=function(t,e){return e.getEnvelopeInternal().intersects(t)?sc.locatePointInRing(t,e.getCoordinates()):Su.EXTERIOR},Ip.prototype.intersects=function(t,e){return this.locate(t,e)!==Su.EXTERIOR},Ip.prototype.updateLocationInfo=function(t){t===Su.INTERIOR&&(this._isIn=!0),t===Su.BOUNDARY&&this._numBoundaries++},Ip.prototype.computeLocation=function(t,e){if(e instanceof Kc&&this.updateLocationInfo(this.locateInternal(t,e)),e instanceof Jc)this.updateLocationInfo(this.locateInternal(t,e));else if(e instanceof $c)this.updateLocationInfo(this.locateInternal(t,e));else if(e instanceof Xc)for(var n=e,r=0;r<n.getNumGeometries();r++){var i=n.getGeometryN(r);this.updateLocationInfo(this.locateInternal(t,i))}else if(e instanceof nh)for(var o=e,s=0;s<o.getNumGeometries();s++){var a=o.getGeometryN(s);this.updateLocationInfo(this.locateInternal(t,a))}else if(e instanceof jc)for(var u=new kl(e);u.hasNext();){var c=u.next();c!==e&&this.computeLocation(t,c)}},Ip.prototype.locate=function(t,e){return e.isEmpty()?Su.EXTERIOR:e instanceof Jc||e instanceof $c?this.locateInternal(t,e):(this._isIn=!1,this._numBoundaries=0,this.computeLocation(t,e),this._boundaryRule.isInBoundary(this._numBoundaries)?Su.BOUNDARY:this._numBoundaries>0||this._isIn?Su.INTERIOR:Su.EXTERIOR)},Ip.prototype.interfaces_=function(){return[]},Ip.prototype.getClass=function(){return Ip};var Np=function t(){if(this._component=null,this._segIndex=null,this._pt=null,2===arguments.length)t.call(this,arguments[0],t.INSIDE_AREA,arguments[1]);else if(3===arguments.length){var e=arguments[0],n=arguments[1],r=arguments[2];this._component=e,this._segIndex=n,this._pt=r}},Cp={INSIDE_AREA:{configurable:!0}};Np.prototype.isInsideArea=function(){return this._segIndex===Np.INSIDE_AREA},Np.prototype.getCoordinate=function(){return this._pt},Np.prototype.getGeometryComponent=function(){return this._component},Np.prototype.getSegmentIndex=function(){return this._segIndex},Np.prototype.interfaces_=function(){return[]},Np.prototype.getClass=function(){return Np},Cp.INSIDE_AREA.get=function(){return-1},Object.defineProperties(Np,Cp);var Sp=function(t){this._pts=t||null};Sp.prototype.filter=function(t){t instanceof Kc&&this._pts.add(t)},Sp.prototype.interfaces_=function(){return[kc]},Sp.prototype.getClass=function(){return Sp},Sp.getPoints=function(){if(1===arguments.length){var t=arguments[0];return t instanceof Kc?$h.singletonList(t):Sp.getPoints(t,new bc)}if(2===arguments.length){var e=arguments[0],n=arguments[1];return e instanceof Kc?n.add(e):e instanceof jc&&e.apply(new Sp(n)),n}};var Mp=function(){this._locations=null;var t=arguments[0];this._locations=t};Mp.prototype.filter=function(t){(t instanceof Kc||t instanceof Jc||t instanceof $c)&&this._locations.add(new Np(t,0,t.getCoordinate()))},Mp.prototype.interfaces_=function(){return[kc]},Mp.prototype.getClass=function(){return Mp},Mp.getLocations=function(t){var e=new bc;return t.apply(new Mp(e)),e};var Lp=function(){if(this._geom=null,this._terminateDistance=0,this._ptLocator=new Ip,this._minDistanceLocation=null,this._minDistance=mu.MAX_VALUE,2===arguments.length){var t=arguments[0],e=arguments[1];this._geom=[t,e],this._terminateDistance=0}else if(3===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2];this._geom=new Array(2).fill(null),this._geom[0]=n,this._geom[1]=r,this._terminateDistance=i}};Lp.prototype.computeContainmentDistance=function(){if(0===arguments.length){var t=new Array(2).fill(null);if(this.computeContainmentDistance(0,t),this._minDistance<=this._terminateDistance)return null;this.computeContainmentDistance(1,t)}else if(2===arguments.length){var e=arguments[0],n=arguments[1],r=1-e,i=wp.getPolygons(this._geom[e]);if(i.size()>0){var o=Mp.getLocations(this._geom[r]);if(this.computeContainmentDistance(o,i,n),this._minDistance<=this._terminateDistance)return this._minDistanceLocation[r]=n[0],this._minDistanceLocation[e]=n[1],null}}else if(3===arguments.length)if(arguments[2]instanceof Array&&Lu(arguments[0],wc)&&Lu(arguments[1],wc)){for(var s=arguments[0],a=arguments[1],u=arguments[2],c=0;c<s.size();c++)for(var h=s.get(c),l=0;l<a.size();l++)if(this.computeContainmentDistance(h,a.get(l),u),this._minDistance<=this._terminateDistance)return null}else if(arguments[2]instanceof Array&&arguments[0]instanceof Np&&arguments[1]instanceof $c){var p=arguments[0],f=arguments[1],g=arguments[2],d=p.getCoordinate();if(Su.EXTERIOR!==this._ptLocator.locate(d,f))return this._minDistance=0,g[0]=p,g[1]=new Np(f,d),null}},Lp.prototype.computeMinDistanceLinesPoints=function(t,e,n){for(var r=0;r<t.size();r++)for(var i=t.get(r),o=0;o<e.size();o++){var s=e.get(o);if(this.computeMinDistance(i,s,n),this._minDistance<=this._terminateDistance)return null}},Lp.prototype.computeFacetDistance=function(){var t=new Array(2).fill(null),e=bp.getLines(this._geom[0]),n=bp.getLines(this._geom[1]),r=Sp.getPoints(this._geom[0]),i=Sp.getPoints(this._geom[1]);return this.computeMinDistanceLines(e,n,t),this.updateMinDistance(t,!1),this._minDistance<=this._terminateDistance?null:(t[0]=null,t[1]=null,this.computeMinDistanceLinesPoints(e,i,t),this.updateMinDistance(t,!1),this._minDistance<=this._terminateDistance?null:(t[0]=null,t[1]=null,this.computeMinDistanceLinesPoints(n,r,t),this.updateMinDistance(t,!0),this._minDistance<=this._terminateDistance?null:(t[0]=null,t[1]=null,this.computeMinDistancePoints(r,i,t),void this.updateMinDistance(t,!1))))},Lp.prototype.nearestLocations=function(){return this.computeMinDistance(),this._minDistanceLocation},Lp.prototype.updateMinDistance=function(t,e){if(null===t[0])return null;e?(this._minDistanceLocation[0]=t[1],this._minDistanceLocation[1]=t[0]):(this._minDistanceLocation[0]=t[0],this._minDistanceLocation[1]=t[1])},Lp.prototype.nearestPoints=function(){return this.computeMinDistance(),[this._minDistanceLocation[0].getCoordinate(),this._minDistanceLocation[1].getCoordinate()]},Lp.prototype.computeMinDistance=function(){if(0===arguments.length){if(null!==this._minDistanceLocation)return null;if(this._minDistanceLocation=new Array(2).fill(null),this.computeContainmentDistance(),this._minDistance<=this._terminateDistance)return null;this.computeFacetDistance()}else if(3===arguments.length)if(arguments[2]instanceof Array&&arguments[0]instanceof Jc&&arguments[1]instanceof Kc){var t=arguments[0],e=arguments[1],n=arguments[2];if(t.getEnvelopeInternal().distance(e.getEnvelopeInternal())>this._minDistance)return null;for(var r=t.getCoordinates(),i=e.getCoordinate(),o=0;o<r.length-1;o++){var s=sc.distancePointLine(i,r[o],r[o+1]);if(s<this._minDistance){this._minDistance=s;var a=new gl(r[o],r[o+1]).closestPoint(i);n[0]=new Np(t,o,a),n[1]=new Np(e,0,i)}if(this._minDistance<=this._terminateDistance)return null}}else if(arguments[2]instanceof Array&&arguments[0]instanceof Jc&&arguments[1]instanceof Jc){var u=arguments[0],c=arguments[1],h=arguments[2];if(u.getEnvelopeInternal().distance(c.getEnvelopeInternal())>this._minDistance)return null;for(var l=u.getCoordinates(),p=c.getCoordinates(),f=0;f<l.length-1;f++)for(var g=0;g<p.length-1;g++){var d=sc.distanceLineLine(l[f],l[f+1],p[g],p[g+1]);if(d<this._minDistance){this._minDistance=d;var y=new gl(l[f],l[f+1]),_=new gl(p[g],p[g+1]),m=y.closestPoints(_);h[0]=new Np(u,f,m[0]),h[1]=new Np(c,g,m[1])}if(this._minDistance<=this._terminateDistance)return null}}},Lp.prototype.computeMinDistancePoints=function(t,e,n){for(var r=0;r<t.size();r++)for(var i=t.get(r),o=0;o<e.size();o++){var s=e.get(o),a=i.getCoordinate().distance(s.getCoordinate());if(a<this._minDistance&&(this._minDistance=a,n[0]=new Np(i,0,i.getCoordinate()),n[1]=new Np(s,0,s.getCoordinate())),this._minDistance<=this._terminateDistance)return null}},Lp.prototype.distance=function(){if(null===this._geom[0]||null===this._geom[1])throw new _u("null geometries are not supported");return this._geom[0].isEmpty()||this._geom[1].isEmpty()?0:(this.computeMinDistance(),this._minDistance)},Lp.prototype.computeMinDistanceLines=function(t,e,n){for(var r=0;r<t.size();r++)for(var i=t.get(r),o=0;o<e.size();o++){var s=e.get(o);if(this.computeMinDistance(i,s,n),this._minDistance<=this._terminateDistance)return null}},Lp.prototype.interfaces_=function(){return[]},Lp.prototype.getClass=function(){return Lp},Lp.distance=function(t,e){return new Lp(t,e).distance()},Lp.isWithinDistance=function(t,e,n){return new Lp(t,e,n).distance()<=n},Lp.nearestPoints=function(t,e){return new Lp(t,e).nearestPoints()};var Pp=function(){this._pt=[new bu,new bu],this._distance=mu.NaN,this._isNull=!0};Pp.prototype.getCoordinates=function(){return this._pt},Pp.prototype.getCoordinate=function(t){return this._pt[t]},Pp.prototype.setMinimum=function(){if(1===arguments.length){var t=arguments[0];this.setMinimum(t._pt[0],t._pt[1])}else if(2===arguments.length){var e=arguments[0],n=arguments[1];if(this._isNull)return this.initialize(e,n),null;var r=e.distance(n);r<this._distance&&this.initialize(e,n,r)}},Pp.prototype.initialize=function(){if(0===arguments.length)this._isNull=!0;else if(2===arguments.length){var t=arguments[0],e=arguments[1];this._pt[0].setCoordinate(t),this._pt[1].setCoordinate(e),this._distance=t.distance(e),this._isNull=!1}else if(3===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2];this._pt[0].setCoordinate(n),this._pt[1].setCoordinate(r),this._distance=i,this._isNull=!1}},Pp.prototype.toString=function(){return Ku.toLineString(this._pt[0],this._pt[1])},Pp.prototype.getDistance=function(){return this._distance},Pp.prototype.setMaximum=function(){if(1===arguments.length){var t=arguments[0];this.setMaximum(t._pt[0],t._pt[1])}else if(2===arguments.length){var e=arguments[0],n=arguments[1];if(this._isNull)return this.initialize(e,n),null;var r=e.distance(n);r>this._distance&&this.initialize(e,n,r)}},Pp.prototype.interfaces_=function(){return[]},Pp.prototype.getClass=function(){return Pp};var Op=function(){};Op.prototype.interfaces_=function(){return[]},Op.prototype.getClass=function(){return Op},Op.computeDistance=function(){if(arguments[2]instanceof Pp&&arguments[0]instanceof Jc&&arguments[1]instanceof bu)for(var t=arguments[0],e=arguments[1],n=arguments[2],r=new gl,i=t.getCoordinates(),o=0;o<i.length-1;o++){r.setCoordinates(i[o],i[o+1]);var s=r.closestPoint(e);n.setMinimum(s,e)}else if(arguments[2]instanceof Pp&&arguments[0]instanceof $c&&arguments[1]instanceof bu){var a=arguments[0],u=arguments[1],c=arguments[2];Op.computeDistance(a.getExteriorRing(),u,c);for(var h=0;h<a.getNumInteriorRing();h++)Op.computeDistance(a.getInteriorRingN(h),u,c)}else if(arguments[2]instanceof Pp&&arguments[0]instanceof cc&&arguments[1]instanceof bu){var l=arguments[0],p=arguments[1],f=arguments[2];if(l instanceof Jc)Op.computeDistance(l,p,f);else if(l instanceof $c)Op.computeDistance(l,p,f);else if(l instanceof jc)for(var g=l,d=0;d<g.getNumGeometries();d++){var y=g.getGeometryN(d);Op.computeDistance(y,p,f)}else f.setMinimum(l.getCoordinate(),p)}else if(arguments[2]instanceof Pp&&arguments[0]instanceof gl&&arguments[1]instanceof bu){var _=arguments[1],m=arguments[2],v=arguments[0].closestPoint(_);m.setMinimum(v,_)}};var Rp=function(){this._g0=null,this._g1=null,this._ptDist=new Pp,this._densifyFrac=0;var t=arguments[0],e=arguments[1];this._g0=t,this._g1=e},Tp={MaxPointDistanceFilter:{configurable:!0},MaxDensifiedByFractionDistanceFilter:{configurable:!0}};Rp.prototype.getCoordinates=function(){return this._ptDist.getCoordinates()},Rp.prototype.setDensifyFraction=function(t){if(t>1||t<=0)throw new _u("Fraction is not in range (0.0 - 1.0]");this._densifyFrac=t},Rp.prototype.compute=function(t,e){this.computeOrientedDistance(t,e,this._ptDist),this.computeOrientedDistance(e,t,this._ptDist)},Rp.prototype.distance=function(){return this.compute(this._g0,this._g1),this._ptDist.getDistance()},Rp.prototype.computeOrientedDistance=function(t,e,n){var r=new Ap(e);if(t.apply(r),n.setMaximum(r.getMaxPointDistance()),this._densifyFrac>0){var i=new Dp(e,this._densifyFrac);t.apply(i),n.setMaximum(i.getMaxPointDistance())}},Rp.prototype.orientedDistance=function(){return this.computeOrientedDistance(this._g0,this._g1,this._ptDist),this._ptDist.getDistance()},Rp.prototype.interfaces_=function(){return[]},Rp.prototype.getClass=function(){return Rp},Rp.distance=function(){if(2===arguments.length)return new Rp(arguments[0],arguments[1]).distance();if(3===arguments.length){var t=arguments[2],e=new Rp(arguments[0],arguments[1]);return e.setDensifyFraction(t),e.distance()}},Tp.MaxPointDistanceFilter.get=function(){return Ap},Tp.MaxDensifiedByFractionDistanceFilter.get=function(){return Dp},Object.defineProperties(Rp,Tp);var Ap=function(){this._maxPtDist=new Pp,this._minPtDist=new Pp,this._euclideanDist=new Op,this._geom=null;var t=arguments[0];this._geom=t};Ap.prototype.filter=function(t){this._minPtDist.initialize(),Op.computeDistance(this._geom,t,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},Ap.prototype.getMaxPointDistance=function(){return this._maxPtDist},Ap.prototype.interfaces_=function(){return[pc]},Ap.prototype.getClass=function(){return Ap};var Dp=function(){this._maxPtDist=new Pp,this._minPtDist=new Pp,this._geom=null,this._numSubSegs=0;var t=arguments[0],e=arguments[1];this._geom=t,this._numSubSegs=Math.trunc(Math.round(1/e))};Dp.prototype.filter=function(t,e){if(0===e)return null;for(var n=t.getCoordinate(e-1),r=t.getCoordinate(e),i=(r.x-n.x)/this._numSubSegs,o=(r.y-n.y)/this._numSubSegs,s=0;s<this._numSubSegs;s++){var a=n.x+s*i,u=n.y+s*o,c=new bu(a,u);this._minPtDist.initialize(),Op.computeDistance(this._geom,c,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)}},Dp.prototype.isDone=function(){return!1},Dp.prototype.isGeometryChanged=function(){return!1},Dp.prototype.getMaxPointDistance=function(){return this._maxPtDist},Dp.prototype.interfaces_=function(){return[zc]},Dp.prototype.getClass=function(){return Dp};var Fp=function(t,e,n){this._minValidDistance=null,this._maxValidDistance=null,this._minDistanceFound=null,this._maxDistanceFound=null,this._isValid=!0,this._errMsg=null,this._errorLocation=null,this._errorIndicator=null,this._input=t||null,this._bufDistance=e||null,this._result=n||null},qp={VERBOSE:{configurable:!0},MAX_DISTANCE_DIFF_FRAC:{configurable:!0}};Fp.prototype.checkMaximumDistance=function(t,e,n){var r=new Rp(e,t);if(r.setDensifyFraction(.25),this._maxDistanceFound=r.orientedDistance(),this._maxDistanceFound>n){this._isValid=!1;var i=r.getCoordinates();this._errorLocation=i[1],this._errorIndicator=t.getFactory().createLineString(i),this._errMsg="Distance between buffer curve and input is too large ("+this._maxDistanceFound+" at "+Ku.toLineString(i[0],i[1])+")"}},Fp.prototype.isValid=function(){var t=Math.abs(this._bufDistance),e=Fp.MAX_DISTANCE_DIFF_FRAC*t;return this._minValidDistance=t-e,this._maxValidDistance=t+e,!(!this._input.isEmpty()&&!this._result.isEmpty())||(this._bufDistance>0?this.checkPositiveValid():this.checkNegativeValid(),Fp.VERBOSE&&Xu.out.println("Min Dist= "+this._minDistanceFound+" err= "+(1-this._minDistanceFound/this._bufDistance)+" Max Dist= "+this._maxDistanceFound+" err= "+(this._maxDistanceFound/this._bufDistance-1)),this._isValid)},Fp.prototype.checkNegativeValid=function(){if(!(this._input instanceof $c||this._input instanceof nh||this._input instanceof jc))return null;var t=this.getPolygonLines(this._input);if(this.checkMinimumDistance(t,this._result,this._minValidDistance),!this._isValid)return null;this.checkMaximumDistance(t,this._result,this._maxValidDistance)},Fp.prototype.getErrorIndicator=function(){return this._errorIndicator},Fp.prototype.checkMinimumDistance=function(t,e,n){var r=new Lp(t,e,n);if(this._minDistanceFound=r.distance(),this._minDistanceFound<n){this._isValid=!1;var i=r.nearestPoints();this._errorLocation=r.nearestPoints()[1],this._errorIndicator=t.getFactory().createLineString(i),this._errMsg="Distance between buffer curve and input is too small ("+this._minDistanceFound+" at "+Ku.toLineString(i[0],i[1])+" )"}},Fp.prototype.checkPositiveValid=function(){var t=this._result.getBoundary();if(this.checkMinimumDistance(this._input,t,this._minValidDistance),!this._isValid)return null;this.checkMaximumDistance(this._input,t,this._maxValidDistance)},Fp.prototype.getErrorLocation=function(){return this._errorLocation},Fp.prototype.getPolygonLines=function(t){for(var e=new bc,n=new bp(e),r=wp.getPolygons(t).iterator();r.hasNext();)r.next().apply(n);return t.getFactory().buildGeometry(e)},Fp.prototype.getErrorMessage=function(){return this._errMsg},Fp.prototype.interfaces_=function(){return[]},Fp.prototype.getClass=function(){return Fp},qp.VERBOSE.get=function(){return!1},qp.MAX_DISTANCE_DIFF_FRAC.get=function(){return.012},Object.defineProperties(Fp,qp);var Gp=function(t,e,n){this._isValid=!0,this._errorMsg=null,this._errorLocation=null,this._errorIndicator=null,this._input=t||null,this._distance=e||null,this._result=n||null},Bp={VERBOSE:{configurable:!0},MAX_ENV_DIFF_FRAC:{configurable:!0}};Gp.prototype.isValid=function(){return this.checkPolygonal(),this._isValid?(this.checkExpectedEmpty(),this._isValid?(this.checkEnvelope(),this._isValid?(this.checkArea(),this._isValid?(this.checkDistance(),this._isValid):this._isValid):this._isValid):this._isValid):this._isValid},Gp.prototype.checkEnvelope=function(){if(this._distance<0)return null;var t=this._distance*Gp.MAX_ENV_DIFF_FRAC;0===t&&(t=.001);var e=new Yu(this._input.getEnvelopeInternal());e.expandBy(this._distance);var n=new Yu(this._result.getEnvelopeInternal());n.expandBy(t),n.contains(e)||(this._isValid=!1,this._errorMsg="Buffer envelope is incorrect",this._errorIndicator=this._input.getFactory().toGeometry(n)),this.report("Envelope")},Gp.prototype.checkDistance=function(){var t=new Fp(this._input,this._distance,this._result);t.isValid()||(this._isValid=!1,this._errorMsg=t.getErrorMessage(),this._errorLocation=t.getErrorLocation(),this._errorIndicator=t.getErrorIndicator()),this.report("Distance")},Gp.prototype.checkArea=function(){var t=this._input.getArea(),e=this._result.getArea();this._distance>0&&t>e&&(this._isValid=!1,this._errorMsg="Area of positive buffer is smaller than input",this._errorIndicator=this._result),this._distance<0&&t<e&&(this._isValid=!1,this._errorMsg="Area of negative buffer is larger than input",this._errorIndicator=this._result),this.report("Area")},Gp.prototype.checkPolygonal=function(){this._result instanceof $c||this._result instanceof nh||(this._isValid=!1),this._errorMsg="Result is not polygonal",this._errorIndicator=this._result,this.report("Polygonal")},Gp.prototype.getErrorIndicator=function(){return this._errorIndicator},Gp.prototype.getErrorLocation=function(){return this._errorLocation},Gp.prototype.checkExpectedEmpty=function(){return this._input.getDimension()>=2||this._distance>0?null:(this._result.isEmpty()||(this._isValid=!1,this._errorMsg="Result is non-empty",this._errorIndicator=this._result),void this.report("ExpectedEmpty"))},Gp.prototype.report=function(t){if(!Gp.VERBOSE)return null;Xu.out.println("Check "+t+": "+(this._isValid?"passed":"FAILED"))},Gp.prototype.getErrorMessage=function(){return this._errorMsg},Gp.prototype.interfaces_=function(){return[]},Gp.prototype.getClass=function(){return Gp},Gp.isValidMsg=function(t,e,n){var r=new Gp(t,e,n);return r.isValid()?null:r.getErrorMessage()},Gp.isValid=function(t,e,n){return!!new Gp(t,e,n).isValid()},Bp.VERBOSE.get=function(){return!1},Bp.MAX_ENV_DIFF_FRAC.get=function(){return.012},Object.defineProperties(Gp,Bp);var kp=function(){this._pts=null,this._data=null;var t=arguments[0],e=arguments[1];this._pts=t,this._data=e};kp.prototype.getCoordinates=function(){return this._pts},kp.prototype.size=function(){return this._pts.length},kp.prototype.getCoordinate=function(t){return this._pts[t]},kp.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},kp.prototype.getSegmentOctant=function(t){return t===this._pts.length-1?-1:hl.octant(this.getCoordinate(t),this.getCoordinate(t+1))},kp.prototype.setData=function(t){this._data=t},kp.prototype.getData=function(){return this._data},kp.prototype.toString=function(){return Ku.toLineString(new uh(this._pts))},kp.prototype.interfaces_=function(){return[ll]},kp.prototype.getClass=function(){return kp};var zp=function(){this._findAllIntersections=!1,this._isCheckEndSegmentsOnly=!1,this._li=null,this._interiorIntersection=null,this._intSegments=null,this._intersections=new bc,this._intersectionCount=0,this._keepIntersections=!0;var t=arguments[0];this._li=t,this._interiorIntersection=null};zp.prototype.getInteriorIntersection=function(){return this._interiorIntersection},zp.prototype.setCheckEndSegmentsOnly=function(t){this._isCheckEndSegmentsOnly=t},zp.prototype.getIntersectionSegments=function(){return this._intSegments},zp.prototype.count=function(){return this._intersectionCount},zp.prototype.getIntersections=function(){return this._intersections},zp.prototype.setFindAllIntersections=function(t){this._findAllIntersections=t},zp.prototype.setKeepIntersections=function(t){this._keepIntersections=t},zp.prototype.processIntersections=function(t,e,n,r){if(!this._findAllIntersections&&this.hasIntersection())return null;if(t===n&&e===r)return null;if(this._isCheckEndSegmentsOnly&&!this.isEndSegment(t,e)&&!this.isEndSegment(n,r))return null;var i=t.getCoordinates()[e],o=t.getCoordinates()[e+1],s=n.getCoordinates()[r],a=n.getCoordinates()[r+1];this._li.computeIntersection(i,o,s,a),this._li.hasIntersection()&&this._li.isInteriorIntersection()&&(this._intSegments=new Array(4).fill(null),this._intSegments[0]=i,this._intSegments[1]=o,this._intSegments[2]=s,this._intSegments[3]=a,this._interiorIntersection=this._li.getIntersection(0),this._keepIntersections&&this._intersections.add(this._interiorIntersection),this._intersectionCount++)},zp.prototype.isEndSegment=function(t,e){return 0===e||e>=t.size()-2},zp.prototype.hasIntersection=function(){return null!==this._interiorIntersection},zp.prototype.isDone=function(){return!this._findAllIntersections&&null!==this._interiorIntersection},zp.prototype.interfaces_=function(){return[Hl]},zp.prototype.getClass=function(){return zp},zp.createAllIntersectionsFinder=function(t){var e=new zp(t);return e.setFindAllIntersections(!0),e},zp.createAnyIntersectionFinder=function(t){return new zp(t)},zp.createIntersectionCounter=function(t){var e=new zp(t);return e.setFindAllIntersections(!0),e.setKeepIntersections(!1),e};var jp=function(){this._li=new rc,this._segStrings=null,this._findAllIntersections=!1,this._segInt=null,this._isValid=!0;var t=arguments[0];this._segStrings=t};jp.prototype.execute=function(){if(null!==this._segInt)return null;this.checkInteriorIntersections()},jp.prototype.getIntersections=function(){return this._segInt.getIntersections()},jp.prototype.isValid=function(){return this.execute(),this._isValid},jp.prototype.setFindAllIntersections=function(t){this._findAllIntersections=t},jp.prototype.checkInteriorIntersections=function(){this._isValid=!0,this._segInt=new zp(this._li),this._segInt.setFindAllIntersections(this._findAllIntersections);var t=new El;if(t.setSegmentIntersector(this._segInt),t.computeNodes(this._segStrings),this._segInt.hasIntersection())return this._isValid=!1,null},jp.prototype.checkValid=function(){if(this.execute(),!this._isValid)throw new Mh(this.getErrorMessage(),this._segInt.getInteriorIntersection())},jp.prototype.getErrorMessage=function(){if(this._isValid)return"no intersections found";var t=this._segInt.getIntersectionSegments();return"found non-noded intersection between "+Ku.toLineString(t[0],t[1])+" and "+Ku.toLineString(t[2],t[3])},jp.prototype.interfaces_=function(){return[]},jp.prototype.getClass=function(){return jp},jp.computeIntersections=function(t){var e=new jp(t);return e.setFindAllIntersections(!0),e.isValid(),e.getIntersections()};var Xp=function t(){this._nv=null;var e=arguments[0];this._nv=new jp(t.toSegmentStrings(e))};Xp.prototype.checkValid=function(){this._nv.checkValid()},Xp.prototype.interfaces_=function(){return[]},Xp.prototype.getClass=function(){return Xp},Xp.toSegmentStrings=function(t){for(var e=new bc,n=t.iterator();n.hasNext();){var r=n.next();e.add(new kp(r.getCoordinates(),r))}return e},Xp.checkValid=function(t){new Xp(t).checkValid()};var Up=function(t){this._mapOp=t};Up.prototype.map=function(t){for(var e=new bc,n=0;n<t.getNumGeometries();n++){var r=this._mapOp.map(t.getGeometryN(n));r.isEmpty()||e.add(r)}return t.getFactory().createGeometryCollection(_h.toGeometryArray(e))},Up.prototype.interfaces_=function(){return[]},Up.prototype.getClass=function(){return Up},Up.map=function(t,e){return new Up(e).map(t)};var Yp=function(){this._op=null,this._geometryFactory=null,this._ptLocator=null,this._lineEdgesList=new bc,this._resultLineList=new bc;var t=arguments[0],e=arguments[1],n=arguments[2];this._op=t,this._geometryFactory=e,this._ptLocator=n};Yp.prototype.collectLines=function(t){for(var e=this._op.getGraph().getEdgeEnds().iterator();e.hasNext();){var n=e.next();this.collectLineEdge(n,t,this._lineEdgesList),this.collectBoundaryTouchEdge(n,t,this._lineEdgesList)}},Yp.prototype.labelIsolatedLine=function(t,e){var n=this._ptLocator.locate(t.getCoordinate(),this._op.getArgGeometry(e));t.getLabel().setLocation(e,n)},Yp.prototype.build=function(t){return this.findCoveredLineEdges(),this.collectLines(t),this.buildLines(t),this._resultLineList},Yp.prototype.collectLineEdge=function(t,e,n){var r=t.getLabel(),i=t.getEdge();t.isLineEdge()&&(t.isVisited()||!Cf.isResultOfOp(r,e)||i.isCovered()||(n.add(i),t.setVisitedEdge(!0)))},Yp.prototype.findCoveredLineEdges=function(){for(var t=this._op.getGraph().getNodes().iterator();t.hasNext();)t.next().getEdges().findCoveredLineEdges();for(var e=this._op.getGraph().getEdgeEnds().iterator();e.hasNext();){var n=e.next(),r=n.getEdge();if(n.isLineEdge()&&!r.isCoveredSet()){var i=this._op.isCoveredByA(n.getCoordinate());r.setCovered(i)}}},Yp.prototype.labelIsolatedLines=function(t){for(var e=t.iterator();e.hasNext();){var n=e.next(),r=n.getLabel();n.isIsolated()&&(r.isNull(0)?this.labelIsolatedLine(n,0):this.labelIsolatedLine(n,1))}},Yp.prototype.buildLines=function(t){for(var e=this._lineEdgesList.iterator();e.hasNext();){var n=e.next(),r=this._geometryFactory.createLineString(n.getCoordinates());this._resultLineList.add(r),n.setInResult(!0)}},Yp.prototype.collectBoundaryTouchEdge=function(t,e,n){var r=t.getLabel();return t.isLineEdge()||t.isVisited()||t.isInteriorAreaEdge()||t.getEdge().isInResult()?null:(tc.isTrue(!(t.isInResult()||t.getSym().isInResult())||!t.getEdge().isInResult()),void(Cf.isResultOfOp(r,e)&&e===Cf.INTERSECTION&&(n.add(t.getEdge()),t.setVisitedEdge(!0))))},Yp.prototype.interfaces_=function(){return[]},Yp.prototype.getClass=function(){return Yp};var Vp=function(){this._op=null,this._geometryFactory=null,this._resultPointList=new bc;var t=arguments[0],e=arguments[1];this._op=t,this._geometryFactory=e};Vp.prototype.filterCoveredNodeToPoint=function(t){var e=t.getCoordinate();if(!this._op.isCoveredByLA(e)){var n=this._geometryFactory.createPoint(e);this._resultPointList.add(n)}},Vp.prototype.extractNonCoveredResultNodes=function(t){for(var e=this._op.getGraph().getNodes().iterator();e.hasNext();){var n=e.next();if(!n.isInResult()&&!n.isIncidentEdgeInResult()&&(0===n.getEdges().getDegree()||t===Cf.INTERSECTION)){var r=n.getLabel();Cf.isResultOfOp(r,t)&&this.filterCoveredNodeToPoint(n)}}},Vp.prototype.build=function(t){return this.extractNonCoveredResultNodes(t),this._resultPointList},Vp.prototype.interfaces_=function(){return[]},Vp.prototype.getClass=function(){return Vp};var Hp=function(){this._inputGeom=null,this._factory=null,this._pruneEmptyGeometry=!0,this._preserveGeometryCollectionType=!0,this._preserveCollections=!1,this._preserveType=!1};Hp.prototype.transformPoint=function(t,e){return this._factory.createPoint(this.transformCoordinates(t.getCoordinateSequence(),t))},Hp.prototype.transformPolygon=function(t,e){var n=!0,r=this.transformLinearRing(t.getExteriorRing(),t);null!==r&&r instanceof eh&&!r.isEmpty()||(n=!1);for(var i=new bc,o=0;o<t.getNumInteriorRing();o++){var s=this.transformLinearRing(t.getInteriorRingN(o),t);null===s||s.isEmpty()||(s instanceof eh||(n=!1),i.add(s))}if(n)return this._factory.createPolygon(r,i.toArray([]));var a=new bc;return null!==r&&a.add(r),a.addAll(i),this._factory.buildGeometry(a)},Hp.prototype.createCoordinateSequence=function(t){return this._factory.getCoordinateSequenceFactory().create(t)},Hp.prototype.getInputGeometry=function(){return this._inputGeom},Hp.prototype.transformMultiLineString=function(t,e){for(var n=new bc,r=0;r<t.getNumGeometries();r++){var i=this.transformLineString(t.getGeometryN(r),t);null!==i&&(i.isEmpty()||n.add(i))}return this._factory.buildGeometry(n)},Hp.prototype.transformCoordinates=function(t,e){return this.copy(t)},Hp.prototype.transformLineString=function(t,e){return this._factory.createLineString(this.transformCoordinates(t.getCoordinateSequence(),t))},Hp.prototype.transformMultiPoint=function(t,e){for(var n=new bc,r=0;r<t.getNumGeometries();r++){var i=this.transformPoint(t.getGeometryN(r),t);null!==i&&(i.isEmpty()||n.add(i))}return this._factory.buildGeometry(n)},Hp.prototype.transformMultiPolygon=function(t,e){for(var n=new bc,r=0;r<t.getNumGeometries();r++){var i=this.transformPolygon(t.getGeometryN(r),t);null!==i&&(i.isEmpty()||n.add(i))}return this._factory.buildGeometry(n)},Hp.prototype.copy=function(t){return t.copy()},Hp.prototype.transformGeometryCollection=function(t,e){for(var n=new bc,r=0;r<t.getNumGeometries();r++){var i=this.transform(t.getGeometryN(r));null!==i&&(this._pruneEmptyGeometry&&i.isEmpty()||n.add(i))}return this._preserveGeometryCollectionType?this._factory.createGeometryCollection(_h.toGeometryArray(n)):this._factory.buildGeometry(n)},Hp.prototype.transform=function(t){if(this._inputGeom=t,this._factory=t.getFactory(),t instanceof Kc)return this.transformPoint(t,null);if(t instanceof th)return this.transformMultiPoint(t,null);if(t instanceof eh)return this.transformLinearRing(t,null);if(t instanceof Jc)return this.transformLineString(t,null);if(t instanceof Xc)return this.transformMultiLineString(t,null);if(t instanceof $c)return this.transformPolygon(t,null);if(t instanceof nh)return this.transformMultiPolygon(t,null);if(t instanceof jc)return this.transformGeometryCollection(t,null);throw new _u("Unknown Geometry subtype: "+t.getClass().getName())},Hp.prototype.transformLinearRing=function(t,e){var n=this.transformCoordinates(t.getCoordinateSequence(),t);if(null===n)return this._factory.createLinearRing(null);var r=n.size();return r>0&&r<4&&!this._preserveType?this._factory.createLineString(n):this._factory.createLinearRing(n)},Hp.prototype.interfaces_=function(){return[]},Hp.prototype.getClass=function(){return Hp};var Wp=function t(){if(this._snapTolerance=0,this._srcPts=null,this._seg=new gl,this._allowSnappingToSourceVertices=!1,this._isClosed=!1,arguments[0]instanceof Jc&&"number"==typeof arguments[1]){var e=arguments[1];t.call(this,arguments[0].getCoordinates(),e)}else if(arguments[0]instanceof Array&&"number"==typeof arguments[1]){var n=arguments[0],r=arguments[1];this._srcPts=n,this._isClosed=t.isClosed(n),this._snapTolerance=r}};Wp.prototype.snapVertices=function(t,e){for(var n=this._isClosed?t.size()-1:t.size(),r=0;r<n;r++){var i=t.get(r),o=this.findSnapForVertex(i,e);null!==o&&(t.set(r,new bu(o)),0===r&&this._isClosed&&t.set(t.size()-1,new bu(o)))}},Wp.prototype.findSnapForVertex=function(t,e){for(var n=0;n<e.length;n++){if(t.equals2D(e[n]))return null;if(t.distance(e[n])<this._snapTolerance)return e[n]}return null},Wp.prototype.snapTo=function(t){var e=new Nc(this._srcPts);return this.snapVertices(e,t),this.snapSegments(e,t),e.toCoordinateArray()},Wp.prototype.snapSegments=function(t,e){if(0===e.length)return null;var n=e.length;e[0].equals2D(e[e.length-1])&&(n=e.length-1);for(var r=0;r<n;r++){var i=e[r],o=this.findSegmentIndexToSnap(i,t);o>=0&&t.add(o+1,new bu(i),!1)}},Wp.prototype.findSegmentIndexToSnap=function(t,e){for(var n=mu.MAX_VALUE,r=-1,i=0;i<e.size()-1;i++){if(this._seg.p0=e.get(i),this._seg.p1=e.get(i+1),this._seg.p0.equals2D(t)||this._seg.p1.equals2D(t)){if(this._allowSnappingToSourceVertices)continue;return-1}var o=this._seg.distance(t);o<this._snapTolerance&&o<n&&(n=o,r=i)}return r},Wp.prototype.setAllowSnappingToSourceVertices=function(t){this._allowSnappingToSourceVertices=t},Wp.prototype.interfaces_=function(){return[]},Wp.prototype.getClass=function(){return Wp},Wp.isClosed=function(t){return!(t.length<=1)&&t[0].equals2D(t[t.length-1])};var Jp=function(t){this._srcGeom=t||null},Zp={SNAP_PRECISION_FACTOR:{configurable:!0}};Jp.prototype.snapTo=function(t,e){var n=this.extractTargetCoordinates(t);return new Kp(e,n).transform(this._srcGeom)},Jp.prototype.snapToSelf=function(t,e){var n=this.extractTargetCoordinates(this._srcGeom),r=new Kp(t,n,!0).transform(this._srcGeom),i=r;return e&&Lu(i,Qc)&&(i=r.buffer(0)),i},Jp.prototype.computeSnapTolerance=function(t){return this.computeMinimumSegmentLength(t)/10},Jp.prototype.extractTargetCoordinates=function(t){for(var e=new ki,n=t.getCoordinates(),r=0;r<n.length;r++)e.add(n[r]);return e.toArray(new Array(0).fill(null))},Jp.prototype.computeMinimumSegmentLength=function(t){for(var e=mu.MAX_VALUE,n=0;n<t.length-1;n++){var r=t[n].distance(t[n+1]);r<e&&(e=r)}return e},Jp.prototype.interfaces_=function(){return[]},Jp.prototype.getClass=function(){return Jp},Jp.snap=function(t,e,n){var r=new Array(2).fill(null),i=new Jp(t);r[0]=i.snapTo(e,n);var o=new Jp(e);return r[1]=o.snapTo(r[0],n),r},Jp.computeOverlaySnapTolerance=function(){if(1===arguments.length){var t=arguments[0],e=Jp.computeSizeBasedSnapTolerance(t),n=t.getPrecisionModel();if(n.getType()===fh.FIXED){var r=1/n.getScale()*2/1.415;r>e&&(e=r)}return e}if(2===arguments.length){var i=arguments[0],o=arguments[1];return Math.min(Jp.computeOverlaySnapTolerance(i),Jp.computeOverlaySnapTolerance(o))}},Jp.computeSizeBasedSnapTolerance=function(t){var e=t.getEnvelopeInternal();return Math.min(e.getHeight(),e.getWidth())*Jp.SNAP_PRECISION_FACTOR},Jp.snapToSelf=function(t,e,n){return new Jp(t).snapToSelf(e,n)},Zp.SNAP_PRECISION_FACTOR.get=function(){return 1e-9},Object.defineProperties(Jp,Zp);var Kp=function(t){function e(e,n,r){t.call(this),this._snapTolerance=e||null,this._snapPts=n||null,this._isSelfSnap=void 0!==r&&r}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.snapLine=function(t,e){var n=new Wp(t,this._snapTolerance);return n.setAllowSnappingToSourceVertices(this._isSelfSnap),n.snapTo(e)},e.prototype.transformCoordinates=function(t,e){var n=t.toCoordinateArray(),r=this.snapLine(n,this._snapPts);return this._factory.getCoordinateSequenceFactory().create(r)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Hp),Qp=function(){this._isFirst=!0,this._commonMantissaBitsCount=53,this._commonBits=0,this._commonSignExp=null};Qp.prototype.getCommon=function(){return mu.longBitsToDouble(this._commonBits)},Qp.prototype.add=function(t){var e=mu.doubleToLongBits(t);return this._isFirst?(this._commonBits=e,this._commonSignExp=Qp.signExpBits(this._commonBits),this._isFirst=!1,null):Qp.signExpBits(e)!==this._commonSignExp?(this._commonBits=0,null):(this._commonMantissaBitsCount=Qp.numCommonMostSigMantissaBits(this._commonBits,e),void(this._commonBits=Qp.zeroLowerBits(this._commonBits,64-(12+this._commonMantissaBitsCount))))},Qp.prototype.toString=function(){if(1===arguments.length){var t=arguments[0],e=mu.longBitsToDouble(t),n="0000000000000000000000000000000000000000000000000000000000000000"+mu.toBinaryString(t),r=n.substring(n.length-64);return r.substring(0,1)+" "+r.substring(1,12)+"(exp) "+r.substring(12)+" [ "+e+" ]"}},Qp.prototype.interfaces_=function(){return[]},Qp.prototype.getClass=function(){return Qp},Qp.getBit=function(t,e){return 0!=(t&1<<e)?1:0},Qp.signExpBits=function(t){return t>>52},Qp.zeroLowerBits=function(t,e){return t&~((1<<e)-1)},Qp.numCommonMostSigMantissaBits=function(t,e){for(var n=0,r=52;r>=0;r--){if(Qp.getBit(t,r)!==Qp.getBit(e,r))return n;n++}return 52};var $p=function(){this._commonCoord=null,this._ccFilter=new ef},tf={CommonCoordinateFilter:{configurable:!0},Translater:{configurable:!0}};$p.prototype.addCommonBits=function(t){var e=new nf(this._commonCoord);t.apply(e),t.geometryChanged()},$p.prototype.removeCommonBits=function(t){if(0===this._commonCoord.x&&0===this._commonCoord.y)return t;var e=new bu(this._commonCoord);e.x=-e.x,e.y=-e.y;var n=new nf(e);return t.apply(n),t.geometryChanged(),t},$p.prototype.getCommonCoordinate=function(){return this._commonCoord},$p.prototype.add=function(t){t.apply(this._ccFilter),this._commonCoord=this._ccFilter.getCommonCoordinate()},$p.prototype.interfaces_=function(){return[]},$p.prototype.getClass=function(){return $p},tf.CommonCoordinateFilter.get=function(){return ef},tf.Translater.get=function(){return nf},Object.defineProperties($p,tf);var ef=function(){this._commonBitsX=new Qp,this._commonBitsY=new Qp};ef.prototype.filter=function(t){this._commonBitsX.add(t.x),this._commonBitsY.add(t.y)},ef.prototype.getCommonCoordinate=function(){return new bu(this._commonBitsX.getCommon(),this._commonBitsY.getCommon())},ef.prototype.interfaces_=function(){return[pc]},ef.prototype.getClass=function(){return ef};var nf=function(){this.trans=null;var t=arguments[0];this.trans=t};nf.prototype.filter=function(t,e){var n=t.getOrdinate(e,0)+this.trans.x,r=t.getOrdinate(e,1)+this.trans.y;t.setOrdinate(e,0,n),t.setOrdinate(e,1,r)},nf.prototype.isDone=function(){return!1},nf.prototype.isGeometryChanged=function(){return!0},nf.prototype.interfaces_=function(){return[zc]},nf.prototype.getClass=function(){return nf};var rf=function(t,e){this._geom=new Array(2).fill(null),this._snapTolerance=null,this._cbr=null,this._geom[0]=t,this._geom[1]=e,this.computeSnapTolerance()};rf.prototype.selfSnap=function(t){return new Jp(t).snapTo(t,this._snapTolerance)},rf.prototype.removeCommonBits=function(t){this._cbr=new $p,this._cbr.add(t[0]),this._cbr.add(t[1]);var e=new Array(2).fill(null);return e[0]=this._cbr.removeCommonBits(t[0].copy()),e[1]=this._cbr.removeCommonBits(t[1].copy()),e},rf.prototype.prepareResult=function(t){return this._cbr.addCommonBits(t),t},rf.prototype.getResultGeometry=function(t){var e=this.snap(this._geom),n=Cf.overlayOp(e[0],e[1],t);return this.prepareResult(n)},rf.prototype.checkValid=function(t){t.isValid()||Xu.out.println("Snapped geometry is invalid")},rf.prototype.computeSnapTolerance=function(){this._snapTolerance=Jp.computeOverlaySnapTolerance(this._geom[0],this._geom[1])},rf.prototype.snap=function(t){var e=this.removeCommonBits(t);return Jp.snap(e[0],e[1],this._snapTolerance)},rf.prototype.interfaces_=function(){return[]},rf.prototype.getClass=function(){return rf},rf.overlayOp=function(t,e,n){return new rf(t,e).getResultGeometry(n)},rf.union=function(t,e){return rf.overlayOp(t,e,Cf.UNION)},rf.intersection=function(t,e){return rf.overlayOp(t,e,Cf.INTERSECTION)},rf.symDifference=function(t,e){return rf.overlayOp(t,e,Cf.SYMDIFFERENCE)},rf.difference=function(t,e){return rf.overlayOp(t,e,Cf.DIFFERENCE)};var of=function(t,e){this._geom=new Array(2).fill(null),this._geom[0]=t,this._geom[1]=e};of.prototype.getResultGeometry=function(t){var e=null,n=!1,r=null;try{e=Cf.overlayOp(this._geom[0],this._geom[1],t),n=!0}catch(t){if(!(t instanceof Qu))throw t;r=t}if(!n)try{e=rf.overlayOp(this._geom[0],this._geom[1],t)}catch(t){throw t instanceof Qu?r:t}return e},of.prototype.interfaces_=function(){return[]},of.prototype.getClass=function(){return of},of.overlayOp=function(t,e,n){return new of(t,e).getResultGeometry(n)},of.union=function(t,e){return of.overlayOp(t,e,Cf.UNION)},of.intersection=function(t,e){return of.overlayOp(t,e,Cf.INTERSECTION)},of.symDifference=function(t,e){return of.overlayOp(t,e,Cf.SYMDIFFERENCE)},of.difference=function(t,e){return of.overlayOp(t,e,Cf.DIFFERENCE)};var sf=function(){this.mce=null,this.chainIndex=null;var t=arguments[0],e=arguments[1];this.mce=t,this.chainIndex=e};sf.prototype.computeIntersections=function(t,e){this.mce.computeIntersectsForChain(this.chainIndex,t.mce,t.chainIndex,e)},sf.prototype.interfaces_=function(){return[]},sf.prototype.getClass=function(){return sf};var af=function t(){if(this._label=null,this._xValue=null,this._eventType=null,this._insertEvent=null,this._deleteEventIndex=null,this._obj=null,2===arguments.length){var e=arguments[0],n=arguments[1];this._eventType=t.DELETE,this._xValue=e,this._insertEvent=n}else if(3===arguments.length){var r=arguments[0],i=arguments[1],o=arguments[2];this._eventType=t.INSERT,this._label=r,this._xValue=i,this._obj=o}},uf={INSERT:{configurable:!0},DELETE:{configurable:!0}};af.prototype.isDelete=function(){return this._eventType===af.DELETE},af.prototype.setDeleteEventIndex=function(t){this._deleteEventIndex=t},af.prototype.getObject=function(){return this._obj},af.prototype.compareTo=function(t){var e=t;return this._xValue<e._xValue?-1:this._xValue>e._xValue?1:this._eventType<e._eventType?-1:this._eventType>e._eventType?1:0},af.prototype.getInsertEvent=function(){return this._insertEvent},af.prototype.isInsert=function(){return this._eventType===af.INSERT},af.prototype.isSameLabel=function(t){return null!==this._label&&this._label===t._label},af.prototype.getDeleteEventIndex=function(){return this._deleteEventIndex},af.prototype.interfaces_=function(){return[xu]},af.prototype.getClass=function(){return af},uf.INSERT.get=function(){return 1},uf.DELETE.get=function(){return 2},Object.defineProperties(af,uf);var cf=function(){};cf.prototype.interfaces_=function(){return[]},cf.prototype.getClass=function(){return cf};var hf=function(){this._hasIntersection=!1,this._hasProper=!1,this._hasProperInterior=!1,this._properIntersectionPoint=null,this._li=null,this._includeProper=null,this._recordIsolated=null,this._isSelfIntersection=null,this._numIntersections=0,this.numTests=0,this._bdyNodes=null,this._isDone=!1,this._isDoneWhenProperInt=!1;var t=arguments[0],e=arguments[1],n=arguments[2];this._li=t,this._includeProper=e,this._recordIsolated=n};hf.prototype.isTrivialIntersection=function(t,e,n,r){if(t===n&&1===this._li.getIntersectionNum()){if(hf.isAdjacentSegments(e,r))return!0;if(t.isClosed()){var i=t.getNumPoints()-1;if(0===e&&r===i||0===r&&e===i)return!0}}return!1},hf.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},hf.prototype.setIsDoneIfProperInt=function(t){this._isDoneWhenProperInt=t},hf.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},hf.prototype.isBoundaryPointInternal=function(t,e){for(var n=e.iterator();n.hasNext();){var r=n.next().getCoordinate();if(t.isIntersection(r))return!0}return!1},hf.prototype.hasProperIntersection=function(){return this._hasProper},hf.prototype.hasIntersection=function(){return this._hasIntersection},hf.prototype.isDone=function(){return this._isDone},hf.prototype.isBoundaryPoint=function(t,e){return null!==e&&(!!this.isBoundaryPointInternal(t,e[0])||!!this.isBoundaryPointInternal(t,e[1]))},hf.prototype.setBoundaryNodes=function(t,e){this._bdyNodes=new Array(2).fill(null),this._bdyNodes[0]=t,this._bdyNodes[1]=e},hf.prototype.addIntersections=function(t,e,n,r){if(t===n&&e===r)return null;this.numTests++;var i=t.getCoordinates()[e],o=t.getCoordinates()[e+1],s=n.getCoordinates()[r],a=n.getCoordinates()[r+1];this._li.computeIntersection(i,o,s,a),this._li.hasIntersection()&&(this._recordIsolated&&(t.setIsolated(!1),n.setIsolated(!1)),this._numIntersections++,this.isTrivialIntersection(t,e,n,r)||(this._hasIntersection=!0,!this._includeProper&&this._li.isProper()||(t.addIntersections(this._li,e,0),n.addIntersections(this._li,r,1)),this._li.isProper()&&(this._properIntersectionPoint=this._li.getIntersection(0).copy(),this._hasProper=!0,this._isDoneWhenProperInt&&(this._isDone=!0),this.isBoundaryPoint(this._li,this._bdyNodes)||(this._hasProperInterior=!0))))},hf.prototype.interfaces_=function(){return[]},hf.prototype.getClass=function(){return hf},hf.isAdjacentSegments=function(t,e){return 1===Math.abs(t-e)};var lf=function(t){function e(){t.call(this),this.events=new bc,this.nOverlaps=null}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.prepareEvents=function(){$h.sort(this.events);for(var t=0;t<this.events.size();t++){var e=this.events.get(t);e.isDelete()&&e.getInsertEvent().setDeleteEventIndex(t)}},e.prototype.computeIntersections=function(){if(1===arguments.length){var t=arguments[0];this.nOverlaps=0,this.prepareEvents();for(var e=0;e<this.events.size();e++){var n=this.events.get(e);if(n.isInsert()&&this.processOverlaps(e,n.getDeleteEventIndex(),n,t),t.isDone())break}}else if(3===arguments.length)if(arguments[2]instanceof hf&&Lu(arguments[0],wc)&&Lu(arguments[1],wc)){var r=arguments[0],i=arguments[1],o=arguments[2];this.addEdges(r,r),this.addEdges(i,i),this.computeIntersections(o)}else if("boolean"==typeof arguments[2]&&Lu(arguments[0],wc)&&arguments[1]instanceof hf){var s=arguments[0],a=arguments[1];arguments[2]?this.addEdges(s,null):this.addEdges(s),this.computeIntersections(a)}},e.prototype.addEdge=function(t,e){for(var n=t.getMonotoneChainEdge(),r=n.getStartIndexes(),i=0;i<r.length-1;i++){var o=new sf(n,i),s=new af(e,n.getMinX(i),o);this.events.add(s),this.events.add(new af(n.getMaxX(i),s))}},e.prototype.processOverlaps=function(t,e,n,r){for(var i=n.getObject(),o=t;o<e;o++){var s=this.events.get(o);if(s.isInsert()){var a=s.getObject();n.isSameLabel(s)||(i.computeIntersections(a,r),this.nOverlaps++)}}},e.prototype.addEdges=function(){if(1===arguments.length)for(var t=arguments[0].iterator();t.hasNext();){var e=t.next();this.addEdge(e,e)}else if(2===arguments.length)for(var n=arguments[1],r=arguments[0].iterator();r.hasNext();){var i=r.next();this.addEdge(i,n)}},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(cf),pf=function(){this._min=mu.POSITIVE_INFINITY,this._max=mu.NEGATIVE_INFINITY},ff={NodeComparator:{configurable:!0}};pf.prototype.getMin=function(){return this._min},pf.prototype.intersects=function(t,e){return!(this._min>e||this._max<t)},pf.prototype.getMax=function(){return this._max},pf.prototype.toString=function(){return Ku.toLineString(new bu(this._min,0),new bu(this._max,0))},pf.prototype.interfaces_=function(){return[]},pf.prototype.getClass=function(){return pf},ff.NodeComparator.get=function(){return gf},Object.defineProperties(pf,ff);var gf=function(){};gf.prototype.compare=function(t,e){var n=t,r=e,i=(n._min+n._max)/2,o=(r._min+r._max)/2;return i<o?-1:i>o?1:0},gf.prototype.interfaces_=function(){return[wu]},gf.prototype.getClass=function(){return gf};var df=function(t){function e(){t.call(this),this._item=null;var e=arguments[0],n=arguments[1],r=arguments[2];this._min=e,this._max=n,this._item=r}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.query=function(t,e,n){if(!this.intersects(t,e))return null;n.visitItem(this._item)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(pf),yf=function(t){function e(){t.call(this),this._node1=null,this._node2=null;var e=arguments[0],n=arguments[1];this._node1=e,this._node2=n,this.buildExtent(this._node1,this._node2)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.buildExtent=function(t,e){this._min=Math.min(t._min,e._min),this._max=Math.max(t._max,e._max)},e.prototype.query=function(t,e,n){if(!this.intersects(t,e))return null;null!==this._node1&&this._node1.query(t,e,n),null!==this._node2&&this._node2.query(t,e,n)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(pf),_f=function(){this._leaves=new bc,this._root=null,this._level=0};_f.prototype.buildTree=function(){$h.sort(this._leaves,new pf.NodeComparator);for(var t=this._leaves,e=null,n=new bc;;){if(this.buildLevel(t,n),1===n.size())return n.get(0);e=t,t=n,n=e}},_f.prototype.insert=function(t,e,n){if(null!==this._root)throw new Error("Index cannot be added to once it has been queried");this._leaves.add(new df(t,e,n))},_f.prototype.query=function(t,e,n){this.init(),this._root.query(t,e,n)},_f.prototype.buildRoot=function(){if(null!==this._root)return null;this._root=this.buildTree()},_f.prototype.printNode=function(t){Xu.out.println(Ku.toLineString(new bu(t._min,this._level),new bu(t._max,this._level)))},_f.prototype.init=function(){if(null!==this._root)return null;this.buildRoot()},_f.prototype.buildLevel=function(t,e){this._level++,e.clear();for(var n=0;n<t.size();n+=2){var r=t.get(n);if(null===(n+1<t.size()?t.get(n):null))e.add(r);else{var i=new yf(t.get(n),t.get(n+1));e.add(i)}}},_f.prototype.interfaces_=function(){return[]},_f.prototype.getClass=function(){return _f};var mf=function(){this._items=new bc};mf.prototype.visitItem=function(t){this._items.add(t)},mf.prototype.getItems=function(){return this._items},mf.prototype.interfaces_=function(){return[Jh]},mf.prototype.getClass=function(){return mf};var vf=function(){this._index=null;var t=arguments[0];if(!Lu(t,Qc))throw new _u("Argument must be Polygonal");this._index=new wf(t)},xf={SegmentVisitor:{configurable:!0},IntervalIndexedGeometry:{configurable:!0}};vf.prototype.locate=function(t){var e=new oc(t),n=new Ef(e);return this._index.query(t.y,t.y,n),e.getLocation()},vf.prototype.interfaces_=function(){return[Bl]},vf.prototype.getClass=function(){return vf},xf.SegmentVisitor.get=function(){return Ef},xf.IntervalIndexedGeometry.get=function(){return wf},Object.defineProperties(vf,xf);var Ef=function(){this._counter=null;var t=arguments[0];this._counter=t};Ef.prototype.visitItem=function(t){var e=t;this._counter.countSegment(e.getCoordinate(0),e.getCoordinate(1))},Ef.prototype.interfaces_=function(){return[Jh]},Ef.prototype.getClass=function(){return Ef};var wf=function(){this._index=new _f;var t=arguments[0];this.init(t)};wf.prototype.init=function(t){for(var e=bp.getLines(t).iterator();e.hasNext();){var n=e.next().getCoordinates();this.addLine(n)}},wf.prototype.addLine=function(t){for(var e=1;e<t.length;e++){var n=new gl(t[e-1],t[e]),r=Math.min(n.p0.y,n.p1.y),i=Math.max(n.p0.y,n.p1.y);this._index.insert(r,i,n)}},wf.prototype.query=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1],n=new mf;return this._index.query(t,e,n),n.getItems()}if(3===arguments.length){var r=arguments[0],i=arguments[1],o=arguments[2];this._index.query(r,i,o)}},wf.prototype.interfaces_=function(){return[]},wf.prototype.getClass=function(){return wf};var bf=function(t){function e(){if(t.call(this),this._parentGeom=null,this._lineEdgeMap=new ph,this._boundaryNodeRule=null,this._useBoundaryDeterminationRule=!0,this._argIndex=null,this._boundaryNodes=null,this._hasTooFewPoints=!1,this._invalidPoint=null,this._areaPtLocator=null,this._ptLocator=new Ip,2===arguments.length){var e=arguments[0],n=arguments[1],r=fc.OGC_SFS_BOUNDARY_RULE;this._argIndex=e,this._parentGeom=n,this._boundaryNodeRule=r,null!==n&&this.add(n)}else if(3===arguments.length){var i=arguments[0],o=arguments[1],s=arguments[2];this._argIndex=i,this._parentGeom=o,this._boundaryNodeRule=s,null!==o&&this.add(o)}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.insertBoundaryPoint=function(t,n){var r=this._nodes.addNode(n).getLabel(),i=1;Su.NONE,r.getLocation(t,Nh.ON)===Su.BOUNDARY&&i++;var o=e.determineBoundary(this._boundaryNodeRule,i);r.setLocation(t,o)},e.prototype.computeSelfNodes=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];return this.computeSelfNodes(t,e,!1)}if(3===arguments.length){var n=arguments[1],r=arguments[2],i=new hf(arguments[0],!0,!1);i.setIsDoneIfProperInt(r);var o=this.createEdgeSetIntersector(),s=this._parentGeom instanceof eh||this._parentGeom instanceof $c||this._parentGeom instanceof nh,a=n||!s;return o.computeIntersections(this._edges,i,a),this.addSelfIntersectionNodes(this._argIndex),i}},e.prototype.computeSplitEdges=function(t){for(var e=this._edges.iterator();e.hasNext();)e.next().eiList.addSplitEdges(t)},e.prototype.computeEdgeIntersections=function(t,e,n){var r=new hf(e,n,!0);return r.setBoundaryNodes(this.getBoundaryNodes(),t.getBoundaryNodes()),this.createEdgeSetIntersector().computeIntersections(this._edges,t._edges,r),r},e.prototype.getGeometry=function(){return this._parentGeom},e.prototype.getBoundaryNodeRule=function(){return this._boundaryNodeRule},e.prototype.hasTooFewPoints=function(){return this._hasTooFewPoints},e.prototype.addPoint=function(){if(arguments[0]instanceof Kc){var t=arguments[0].getCoordinate();this.insertPoint(this._argIndex,t,Su.INTERIOR)}else if(arguments[0]instanceof bu){var e=arguments[0];this.insertPoint(this._argIndex,e,Su.INTERIOR)}},e.prototype.addPolygon=function(t){this.addPolygonRing(t.getExteriorRing(),Su.EXTERIOR,Su.INTERIOR);for(var e=0;e<t.getNumInteriorRing();e++){var n=t.getInteriorRingN(e);this.addPolygonRing(n,Su.INTERIOR,Su.EXTERIOR)}},e.prototype.addEdge=function(t){this.insertEdge(t);var e=t.getCoordinates();this.insertPoint(this._argIndex,e[0],Su.BOUNDARY),this.insertPoint(this._argIndex,e[e.length-1],Su.BOUNDARY)},e.prototype.addLineString=function(t){var e=Cc.removeRepeatedPoints(t.getCoordinates());if(e.length<2)return this._hasTooFewPoints=!0,this._invalidPoint=e[0],null;var n=new ep(e,new Rh(this._argIndex,Su.INTERIOR));this._lineEdgeMap.put(t,n),this.insertEdge(n),tc.isTrue(e.length>=2,"found LineString with single point"),this.insertBoundaryPoint(this._argIndex,e[0]),this.insertBoundaryPoint(this._argIndex,e[e.length-1])},e.prototype.getInvalidPoint=function(){return this._invalidPoint},e.prototype.getBoundaryPoints=function(){for(var t=this.getBoundaryNodes(),e=new Array(t.size()).fill(null),n=0,r=t.iterator();r.hasNext();){var i=r.next();e[n++]=i.getCoordinate().copy()}return e},e.prototype.getBoundaryNodes=function(){return null===this._boundaryNodes&&(this._boundaryNodes=this._nodes.getBoundaryNodes(this._argIndex)),this._boundaryNodes},e.prototype.addSelfIntersectionNode=function(t,e,n){if(this.isBoundaryNode(t,e))return null;n===Su.BOUNDARY&&this._useBoundaryDeterminationRule?this.insertBoundaryPoint(t,e):this.insertPoint(t,e,n)},e.prototype.addPolygonRing=function(t,e,n){if(t.isEmpty())return null;var r=Cc.removeRepeatedPoints(t.getCoordinates());if(r.length<4)return this._hasTooFewPoints=!0,this._invalidPoint=r[0],null;var i=e,o=n;sc.isCCW(r)&&(i=n,o=e);var s=new ep(r,new Rh(this._argIndex,Su.BOUNDARY,i,o));this._lineEdgeMap.put(t,s),this.insertEdge(s),this.insertPoint(this._argIndex,r[0],Su.BOUNDARY)},e.prototype.insertPoint=function(t,e,n){var r=this._nodes.addNode(e),i=r.getLabel();null===i?r._label=new Rh(t,n):i.setLocation(t,n)},e.prototype.createEdgeSetIntersector=function(){return new lf},e.prototype.addSelfIntersectionNodes=function(t){for(var e=this._edges.iterator();e.hasNext();)for(var n=e.next(),r=n.getLabel().getLocation(t),i=n.eiList.iterator();i.hasNext();){var o=i.next();this.addSelfIntersectionNode(t,o.coord,r)}},e.prototype.add=function(){if(1!==arguments.length)return t.prototype.add.apply(this,arguments);var e=arguments[0];if(e.isEmpty())return null;if(e instanceof nh&&(this._useBoundaryDeterminationRule=!1),e instanceof $c)this.addPolygon(e);else if(e instanceof Jc)this.addLineString(e);else if(e instanceof Kc)this.addPoint(e);else if(e instanceof th)this.addCollection(e);else if(e instanceof Xc)this.addCollection(e);else if(e instanceof nh)this.addCollection(e);else{if(!(e instanceof jc))throw new Error(e.getClass().getName());this.addCollection(e)}},e.prototype.addCollection=function(t){for(var e=0;e<t.getNumGeometries();e++){var n=t.getGeometryN(e);this.add(n)}},e.prototype.locate=function(t){return Lu(this._parentGeom,Qc)&&this._parentGeom.getNumGeometries()>50?(null===this._areaPtLocator&&(this._areaPtLocator=new vf(this._parentGeom)),this._areaPtLocator.locate(t)):this._ptLocator.locate(t,this._parentGeom)},e.prototype.findEdge=function(){if(1===arguments.length){var e=arguments[0];return this._lineEdgeMap.get(e)}return t.prototype.findEdge.apply(this,arguments)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.determineBoundary=function(t,e){return t.isInBoundary(e)?Su.BOUNDARY:Su.INTERIOR},e}(Uh),If=function(){if(this._li=new rc,this._resultPrecisionModel=null,this._arg=null,1===arguments.length){var t=arguments[0];this.setComputationPrecision(t.getPrecisionModel()),this._arg=new Array(1).fill(null),this._arg[0]=new bf(0,t)}else if(2===arguments.length){var e=arguments[0],n=arguments[1],r=fc.OGC_SFS_BOUNDARY_RULE;e.getPrecisionModel().compareTo(n.getPrecisionModel())>=0?this.setComputationPrecision(e.getPrecisionModel()):this.setComputationPrecision(n.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new bf(0,e,r),this._arg[1]=new bf(1,n,r)}else if(3===arguments.length){var i=arguments[0],o=arguments[1],s=arguments[2];i.getPrecisionModel().compareTo(o.getPrecisionModel())>=0?this.setComputationPrecision(i.getPrecisionModel()):this.setComputationPrecision(o.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new bf(0,i,s),this._arg[1]=new bf(1,o,s)}};If.prototype.getArgGeometry=function(t){return this._arg[t].getGeometry()},If.prototype.setComputationPrecision=function(t){this._resultPrecisionModel=t,this._li.setPrecisionModel(this._resultPrecisionModel)},If.prototype.interfaces_=function(){return[]},If.prototype.getClass=function(){return If};var Nf=function(){};Nf.prototype.interfaces_=function(){return[]},Nf.prototype.getClass=function(){return Nf},Nf.map=function(){if(arguments[0]instanceof cc&&Lu(arguments[1],Nf.MapOp)){for(var t=arguments[0],e=arguments[1],n=new bc,r=0;r<t.getNumGeometries();r++){var i=e.map(t.getGeometryN(r));null!==i&&n.add(i)}return t.getFactory().buildGeometry(n)}if(Lu(arguments[0],vc)&&Lu(arguments[1],Nf.MapOp)){for(var o=arguments[0],s=arguments[1],a=new bc,u=o.iterator();u.hasNext();){var c=u.next(),h=s.map(c);null!==h&&a.add(h)}return a}},Nf.MapOp=function(){};var Cf=function(t){function e(){var e=arguments[0],n=arguments[1];t.call(this,e,n),this._ptLocator=new Ip,this._geomFact=null,this._resultGeom=null,this._graph=null,this._edgeList=new Vl,this._resultPolyList=new bc,this._resultLineList=new bc,this._resultPointList=new bc,this._graph=new Uh(new Ul),this._geomFact=e.getFactory()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.insertUniqueEdge=function(t){var e=this._edgeList.findEqualEdge(t);if(null!==e){var n=e.getLabel(),r=t.getLabel();e.isPointwiseEqual(t)||(r=new Rh(t.getLabel())).flip();var i=e.getDepth();i.isNull()&&i.add(n),i.add(r),n.merge(r)}else this._edgeList.add(t)},e.prototype.getGraph=function(){return this._graph},e.prototype.cancelDuplicateResultEdges=function(){for(var t=this._graph.getEdgeEnds().iterator();t.hasNext();){var e=t.next(),n=e.getSym();e.isInResult()&&n.isInResult()&&(e.setInResult(!1),n.setInResult(!1))}},e.prototype.isCoveredByLA=function(t){return!!this.isCovered(t,this._resultLineList)||!!this.isCovered(t,this._resultPolyList)},e.prototype.computeGeometry=function(t,n,r,i){var o=new bc;return o.addAll(t),o.addAll(n),o.addAll(r),o.isEmpty()?e.createEmptyResult(i,this._arg[0].getGeometry(),this._arg[1].getGeometry(),this._geomFact):this._geomFact.buildGeometry(o)},e.prototype.mergeSymLabels=function(){for(var t=this._graph.getNodes().iterator();t.hasNext();)t.next().getEdges().mergeSymLabels()},e.prototype.isCovered=function(t,e){for(var n=e.iterator();n.hasNext();){var r=n.next();if(this._ptLocator.locate(t,r)!==Su.EXTERIOR)return!0}return!1},e.prototype.replaceCollapsedEdges=function(){for(var t=new bc,e=this._edgeList.iterator();e.hasNext();){var n=e.next();n.isCollapsed()&&(e.remove(),t.add(n.getCollapsedEdge()))}this._edgeList.addAll(t)},e.prototype.updateNodeLabelling=function(){for(var t=this._graph.getNodes().iterator();t.hasNext();){var e=t.next(),n=e.getEdges().getLabel();e.getLabel().merge(n)}},e.prototype.getResultGeometry=function(t){return this.computeOverlay(t),this._resultGeom},e.prototype.insertUniqueEdges=function(t){for(var e=t.iterator();e.hasNext();){var n=e.next();this.insertUniqueEdge(n)}},e.prototype.computeOverlay=function(t){this.copyPoints(0),this.copyPoints(1),this._arg[0].computeSelfNodes(this._li,!1),this._arg[1].computeSelfNodes(this._li,!1),this._arg[0].computeEdgeIntersections(this._arg[1],this._li,!0);var e=new bc;this._arg[0].computeSplitEdges(e),this._arg[1].computeSplitEdges(e),this.insertUniqueEdges(e),this.computeLabelsFromDepths(),this.replaceCollapsedEdges(),Xp.checkValid(this._edgeList.getEdges()),this._graph.addEdges(this._edgeList.getEdges()),this.computeLabelling(),this.labelIncompleteNodes(),this.findResultAreaEdges(t),this.cancelDuplicateResultEdges();var n=new Yh(this._geomFact);n.add(this._graph),this._resultPolyList=n.getPolygons();var r=new Yp(this,this._geomFact,this._ptLocator);this._resultLineList=r.build(t);var i=new Vp(this,this._geomFact,this._ptLocator);this._resultPointList=i.build(t),this._resultGeom=this.computeGeometry(this._resultPointList,this._resultLineList,this._resultPolyList,t)},e.prototype.labelIncompleteNode=function(t,e){var n=this._ptLocator.locate(t.getCoordinate(),this._arg[e].getGeometry());t.getLabel().setLocation(e,n)},e.prototype.copyPoints=function(t){for(var e=this._arg[t].getNodeIterator();e.hasNext();){var n=e.next();this._graph.addNode(n.getCoordinate()).setLabel(t,n.getLabel().getLocation(t))}},e.prototype.findResultAreaEdges=function(t){for(var n=this._graph.getEdgeEnds().iterator();n.hasNext();){var r=n.next(),i=r.getLabel();i.isArea()&&!r.isInteriorAreaEdge()&&e.isResultOfOp(i.getLocation(0,Nh.RIGHT),i.getLocation(1,Nh.RIGHT),t)&&r.setInResult(!0)}},e.prototype.computeLabelsFromDepths=function(){for(var t=this._edgeList.iterator();t.hasNext();){var e=t.next(),n=e.getLabel(),r=e.getDepth();if(!r.isNull()){r.normalize();for(var i=0;i<2;i++)n.isNull(i)||!n.isArea()||r.isNull(i)||(0===r.getDelta(i)?n.toLine(i):(tc.isTrue(!r.isNull(i,Nh.LEFT),"depth of LEFT side has not been initialized"),n.setLocation(i,Nh.LEFT,r.getLocation(i,Nh.LEFT)),tc.isTrue(!r.isNull(i,Nh.RIGHT),"depth of RIGHT side has not been initialized"),n.setLocation(i,Nh.RIGHT,r.getLocation(i,Nh.RIGHT))))}}},e.prototype.computeLabelling=function(){for(var t=this._graph.getNodes().iterator();t.hasNext();)t.next().getEdges().computeLabelling(this._arg);this.mergeSymLabels(),this.updateNodeLabelling()},e.prototype.labelIncompleteNodes=function(){for(var t=this._graph.getNodes().iterator();t.hasNext();){var e=t.next(),n=e.getLabel();e.isIsolated()&&(n.isNull(0)?this.labelIncompleteNode(e,0):this.labelIncompleteNode(e,1)),e.getEdges().updateLabelling(n)}},e.prototype.isCoveredByA=function(t){return!!this.isCovered(t,this._resultPolyList)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(If);Cf.overlayOp=function(t,e,n){return new Cf(t,e).getResultGeometry(n)},Cf.intersection=function(t,e){if(t.isEmpty()||e.isEmpty())return Cf.createEmptyResult(Cf.INTERSECTION,t,e,t.getFactory());if(t.isGeometryCollection()){var n=e;return Up.map(t,{interfaces_:function(){return[Nf.MapOp]},map:function(t){return t.intersection(n)}})}return t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),of.overlayOp(t,e,Cf.INTERSECTION)},Cf.symDifference=function(t,e){if(t.isEmpty()||e.isEmpty()){if(t.isEmpty()&&e.isEmpty())return Cf.createEmptyResult(Cf.SYMDIFFERENCE,t,e,t.getFactory());if(t.isEmpty())return e.copy();if(e.isEmpty())return t.copy()}return t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),of.overlayOp(t,e,Cf.SYMDIFFERENCE)},Cf.resultDimension=function(t,e,n){var r=e.getDimension(),i=n.getDimension(),o=-1;switch(t){case Cf.INTERSECTION:o=Math.min(r,i);break;case Cf.UNION:o=Math.max(r,i);break;case Cf.DIFFERENCE:o=r;break;case Cf.SYMDIFFERENCE:o=Math.max(r,i)}return o},Cf.createEmptyResult=function(t,e,n,r){var i=null;switch(Cf.resultDimension(t,e,n)){case-1:i=r.createGeometryCollection(new Array(0).fill(null));break;case 0:i=r.createPoint();break;case 1:i=r.createLineString();break;case 2:i=r.createPolygon()}return i},Cf.difference=function(t,e){return t.isEmpty()?Cf.createEmptyResult(Cf.DIFFERENCE,t,e,t.getFactory()):e.isEmpty()?t.copy():(t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),of.overlayOp(t,e,Cf.DIFFERENCE))},Cf.isResultOfOp=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1],n=t.getLocation(0),r=t.getLocation(1);return Cf.isResultOfOp(n,r,e)}if(3===arguments.length){var i=arguments[0],o=arguments[1],s=arguments[2];switch(i===Su.BOUNDARY&&(i=Su.INTERIOR),o===Su.BOUNDARY&&(o=Su.INTERIOR),s){case Cf.INTERSECTION:return i===Su.INTERIOR&&o===Su.INTERIOR;case Cf.UNION:return i===Su.INTERIOR||o===Su.INTERIOR;case Cf.DIFFERENCE:return i===Su.INTERIOR&&o!==Su.INTERIOR;case Cf.SYMDIFFERENCE:return i===Su.INTERIOR&&o!==Su.INTERIOR||i!==Su.INTERIOR&&o===Su.INTERIOR}return!1}},Cf.INTERSECTION=1,Cf.UNION=2,Cf.DIFFERENCE=3,Cf.SYMDIFFERENCE=4;var Sf=function(){this._g=null,this._boundaryDistanceTolerance=null,this._linework=null,this._ptLocator=new Ip,this._seg=new gl;var t=arguments[0],e=arguments[1];this._g=t,this._boundaryDistanceTolerance=e,this._linework=this.extractLinework(t)};Sf.prototype.isWithinToleranceOfBoundary=function(t){for(var e=0;e<this._linework.getNumGeometries();e++)for(var n=this._linework.getGeometryN(e).getCoordinateSequence(),r=0;r<n.size()-1;r++)if(n.getCoordinate(r,this._seg.p0),n.getCoordinate(r+1,this._seg.p1),this._seg.distance(t)<=this._boundaryDistanceTolerance)return!0;return!1},Sf.prototype.getLocation=function(t){return this.isWithinToleranceOfBoundary(t)?Su.BOUNDARY:this._ptLocator.locate(t,this._g)},Sf.prototype.extractLinework=function(t){var e=new Mf;t.apply(e);var n=e.getLinework(),r=_h.toLineStringArray(n);return t.getFactory().createMultiLineString(r)},Sf.prototype.interfaces_=function(){return[]},Sf.prototype.getClass=function(){return Sf};var Mf=function(){this._linework=null,this._linework=new bc};Mf.prototype.getLinework=function(){return this._linework},Mf.prototype.filter=function(t){if(t instanceof $c){var e=t;this._linework.add(e.getExteriorRing());for(var n=0;n<e.getNumInteriorRing();n++)this._linework.add(e.getInteriorRingN(n))}},Mf.prototype.interfaces_=function(){return[kc]},Mf.prototype.getClass=function(){return Mf};var Lf=function(){this._g=null,this._doLeft=!0,this._doRight=!0;var t=arguments[0];this._g=t};Lf.prototype.extractPoints=function(t,e,n){for(var r=t.getCoordinates(),i=0;i<r.length-1;i++)this.computeOffsetPoints(r[i],r[i+1],e,n)},Lf.prototype.setSidesToGenerate=function(t,e){this._doLeft=t,this._doRight=e},Lf.prototype.getPoints=function(t){for(var e=new bc,n=bp.getLines(this._g).iterator();n.hasNext();){var r=n.next();this.extractPoints(r,t,e)}return e},Lf.prototype.computeOffsetPoints=function(t,e,n,r){var i=e.x-t.x,o=e.y-t.y,s=Math.sqrt(i*i+o*o),a=n*i/s,u=n*o/s,c=(e.x+t.x)/2,h=(e.y+t.y)/2;if(this._doLeft){var l=new bu(c-u,h+a);r.add(l)}if(this._doRight){var p=new bu(c+u,h-a);r.add(p)}},Lf.prototype.interfaces_=function(){return[]},Lf.prototype.getClass=function(){return Lf};var Pf=function t(){this._geom=null,this._locFinder=null,this._location=new Array(3).fill(null),this._invalidLocation=null,this._boundaryDistanceTolerance=t.TOLERANCE,this._testCoords=new bc;var e=arguments[0],n=arguments[1],r=arguments[2];this._boundaryDistanceTolerance=t.computeBoundaryDistanceTolerance(e,n),this._geom=[e,n,r],this._locFinder=[new Sf(this._geom[0],this._boundaryDistanceTolerance),new Sf(this._geom[1],this._boundaryDistanceTolerance),new Sf(this._geom[2],this._boundaryDistanceTolerance)]},Of={TOLERANCE:{configurable:!0}};Pf.prototype.reportResult=function(t,e,n){Xu.out.println("Overlay result invalid - A:"+Su.toLocationSymbol(e[0])+" B:"+Su.toLocationSymbol(e[1])+" expected:"+(n?"i":"e")+" actual:"+Su.toLocationSymbol(e[2]))},Pf.prototype.isValid=function(t){return this.addTestPts(this._geom[0]),this.addTestPts(this._geom[1]),this.checkValid(t)},Pf.prototype.checkValid=function(){if(1===arguments.length){for(var t=arguments[0],e=0;e<this._testCoords.size();e++){var n=this._testCoords.get(e);if(!this.checkValid(t,n))return this._invalidLocation=n,!1}return!0}if(2===arguments.length){var r=arguments[0],i=arguments[1];return this._location[0]=this._locFinder[0].getLocation(i),this._location[1]=this._locFinder[1].getLocation(i),this._location[2]=this._locFinder[2].getLocation(i),!!Pf.hasLocation(this._location,Su.BOUNDARY)||this.isValidResult(r,this._location)}},Pf.prototype.addTestPts=function(t){var e=new Lf(t);this._testCoords.addAll(e.getPoints(5*this._boundaryDistanceTolerance))},Pf.prototype.isValidResult=function(t,e){var n=Cf.isResultOfOp(e[0],e[1],t),r=!(n^e[2]===Su.INTERIOR);return r||this.reportResult(t,e,n),r},Pf.prototype.getInvalidLocation=function(){return this._invalidLocation},Pf.prototype.interfaces_=function(){return[]},Pf.prototype.getClass=function(){return Pf},Pf.hasLocation=function(t,e){for(var n=0;n<3;n++)if(t[n]===e)return!0;return!1},Pf.computeBoundaryDistanceTolerance=function(t,e){return Math.min(Jp.computeSizeBasedSnapTolerance(t),Jp.computeSizeBasedSnapTolerance(e))},Pf.isValid=function(t,e,n,r){return new Pf(t,e,r).isValid(n)},Of.TOLERANCE.get=function(){return 1e-6},Object.defineProperties(Pf,Of);var Rf=function t(e){this._geomFactory=null,this._skipEmpty=!1,this._inputGeoms=null,this._geomFactory=t.extractFactory(e),this._inputGeoms=e};Rf.prototype.extractElements=function(t,e){if(null===t)return null;for(var n=0;n<t.getNumGeometries();n++){var r=t.getGeometryN(n);this._skipEmpty&&r.isEmpty()||e.add(r)}},Rf.prototype.combine=function(){for(var t=new bc,e=this._inputGeoms.iterator();e.hasNext();){var n=e.next();this.extractElements(n,t)}return 0===t.size()?null!==this._geomFactory?this._geomFactory.createGeometryCollection(null):null:this._geomFactory.buildGeometry(t)},Rf.prototype.interfaces_=function(){return[]},Rf.prototype.getClass=function(){return Rf},Rf.combine=function(){if(1===arguments.length)return new Rf(arguments[0]).combine();if(2===arguments.length){var t=arguments[0],e=arguments[1];return new Rf(Rf.createList(t,e)).combine()}if(3===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2];return new Rf(Rf.createList(n,r,i)).combine()}},Rf.extractFactory=function(t){return t.isEmpty()?null:t.iterator().next().getFactory()},Rf.createList=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1],n=new bc;return n.add(t),n.add(e),n}if(3===arguments.length){var r=arguments[0],i=arguments[1],o=arguments[2],s=new bc;return s.add(r),s.add(i),s.add(o),s}};var Tf=function(){this._inputPolys=null,this._geomFactory=null;var t=arguments[0];this._inputPolys=t,null===this._inputPolys&&(this._inputPolys=new bc)},Af={STRTREE_NODE_CAPACITY:{configurable:!0}};Tf.prototype.reduceToGeometries=function(t){for(var e=new bc,n=t.iterator();n.hasNext();){var r=n.next(),i=null;Lu(r,wc)?i=this.unionTree(r):r instanceof cc&&(i=r),e.add(i)}return e},Tf.prototype.extractByEnvelope=function(t,e,n){for(var r=new bc,i=0;i<e.getNumGeometries();i++){var o=e.getGeometryN(i);o.getEnvelopeInternal().intersects(t)?r.add(o):n.add(o)}return this._geomFactory.buildGeometry(r)},Tf.prototype.unionOptimized=function(t,e){var n=t.getEnvelopeInternal(),r=e.getEnvelopeInternal();if(!n.intersects(r))return Rf.combine(t,e);if(t.getNumGeometries()<=1&&e.getNumGeometries()<=1)return this.unionActual(t,e);var i=n.intersection(r);return this.unionUsingEnvelopeIntersection(t,e,i)},Tf.prototype.union=function(){if(null===this._inputPolys)throw new Error("union() method cannot be called twice");if(this._inputPolys.isEmpty())return null;this._geomFactory=this._inputPolys.iterator().next().getFactory();for(var t=new ol(Tf.STRTREE_NODE_CAPACITY),e=this._inputPolys.iterator();e.hasNext();){var n=e.next();t.insert(n.getEnvelopeInternal(),n)}this._inputPolys=null;var r=t.itemsTree();return this.unionTree(r)},Tf.prototype.binaryUnion=function(){if(1===arguments.length){var t=arguments[0];return this.binaryUnion(t,0,t.size())}if(3===arguments.length){var e=arguments[0],n=arguments[1],r=arguments[2];if(r-n<=1){var i=Tf.getGeometry(e,n);return this.unionSafe(i,null)}if(r-n==2)return this.unionSafe(Tf.getGeometry(e,n),Tf.getGeometry(e,n+1));var o=Math.trunc((r+n)/2),s=this.binaryUnion(e,n,o),a=this.binaryUnion(e,o,r);return this.unionSafe(s,a)}},Tf.prototype.repeatedUnion=function(t){for(var e=null,n=t.iterator();n.hasNext();){var r=n.next();e=null===e?r.copy():e.union(r)}return e},Tf.prototype.unionSafe=function(t,e){return null===t&&null===e?null:null===t?e.copy():null===e?t.copy():this.unionOptimized(t,e)},Tf.prototype.unionActual=function(t,e){return Tf.restrictToPolygons(t.union(e))},Tf.prototype.unionTree=function(t){var e=this.reduceToGeometries(t);return this.binaryUnion(e)},Tf.prototype.unionUsingEnvelopeIntersection=function(t,e,n){var r=new bc,i=this.extractByEnvelope(n,t,r),o=this.extractByEnvelope(n,e,r),s=this.unionActual(i,o);return r.add(s),Rf.combine(r)},Tf.prototype.bufferUnion=function(){if(1===arguments.length){var t=arguments[0];return t.get(0).getFactory().buildGeometry(t).buffer(0)}if(2===arguments.length){var e=arguments[0],n=arguments[1];return e.getFactory().createGeometryCollection([e,n]).buffer(0)}},Tf.prototype.interfaces_=function(){return[]},Tf.prototype.getClass=function(){return Tf},Tf.restrictToPolygons=function(t){if(Lu(t,Qc))return t;var e=wp.getPolygons(t);return 1===e.size()?e.get(0):t.getFactory().createMultiPolygon(_h.toPolygonArray(e))},Tf.getGeometry=function(t,e){return e>=t.size()?null:t.get(e)},Tf.union=function(t){return new Tf(t).union()},Af.STRTREE_NODE_CAPACITY.get=function(){return 4},Object.defineProperties(Tf,Af);var Df=function(){};Df.prototype.interfaces_=function(){return[]},Df.prototype.getClass=function(){return Df},Df.union=function(t,e){if(t.isEmpty()||e.isEmpty()){if(t.isEmpty()&&e.isEmpty())return Cf.createEmptyResult(Cf.UNION,t,e,t.getFactory());if(t.isEmpty())return e.copy();if(e.isEmpty())return t.copy()}return t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),of.overlayOp(t,e,Cf.UNION)};var Ff=function(){return new Yi};Yi.prototype={constructor:Yi,reset:function(){this.s=this.t=0},add:function(t){Vi(qf,t,this.t),Vi(this,qf.s,this.s),this.s?this.t+=qf.t:this.s=qf.t},valueOf:function(){return this.s}};var qf=new Yi,Gf=1e-6,Bf=Math.PI,kf=Bf/2,zf=Bf/4,jf=2*Bf,Xf=180/Bf,Uf=Bf/180,Yf=Math.abs,Vf=Math.atan,Hf=Math.atan2,Wf=Math.cos,Jf=Math.exp,Zf=Math.log,Kf=Math.sin,Qf=Math.sqrt,$f=Math.tan,tg={Feature:function(t,e){Ji(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,i=n.length;++r<i;)Ji(n[r].geometry,e)}},eg={Sphere:function(t,e){e.sphere()},Point:function(t,e){t=t.coordinates,e.point(t[0],t[1],t[2])},MultiPoint:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)t=n[r],e.point(t[0],t[1],t[2])},LineString:function(t,e){Zi(t.coordinates,e,0)},MultiLineString:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)Zi(n[r],e,0)},Polygon:function(t,e){Ki(t.coordinates,e)},MultiPolygon:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)Ki(n[r],e)},GeometryCollection:function(t,e){for(var n=t.geometries,r=-1,i=n.length;++r<i;)Ji(n[r],e)}},ng=function(t,e){t&&tg.hasOwnProperty(t.type)?tg[t.type](t,e):Ji(t,e)},rg=(Ff(),Ff(),Ff(),function(t,e){function n(n,r){return n=t(n,r),e(n[0],n[1])}return t.invert&&e.invert&&(n.invert=function(n,r){return(n=e.invert(n,r))&&t.invert(n[0],n[1])}),n});oo.invert=oo;var ig=function(t){function e(e){return(e=t(e[0]*Uf,e[1]*Uf))[0]*=Xf,e[1]*=Xf,e}return t=so(t[0]*Uf,t[1]*Uf,t.length>2?t[2]*Uf:0),e.invert=function(e){return(e=t.invert(e[0]*Uf,e[1]*Uf))[0]*=Xf,e[1]*=Xf,e},e},og=function(){var t,e=[];return{point:function(e,n){t.push([e,n])},lineStart:function(){e.push(t=[])},lineEnd:Wi,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}},sg=function(t,e,n,r,i,o){var s,a=t[0],u=t[1],c=0,h=1,l=e[0]-a,p=e[1]-u;if(s=n-a,l||!(s>0)){if(s/=l,l<0){if(s<c)return;s<h&&(h=s)}else if(l>0){if(s>h)return;s>c&&(c=s)}if(s=i-a,l||!(s<0)){if(s/=l,l<0){if(s>h)return;s>c&&(c=s)}else if(l>0){if(s<c)return;s<h&&(h=s)}if(s=r-u,p||!(s>0)){if(s/=p,p<0){if(s<c)return;s<h&&(h=s)}else if(p>0){if(s>h)return;s>c&&(c=s)}if(s=o-u,p||!(s<0)){if(s/=p,p<0){if(s>h)return;s>c&&(c=s)}else if(p>0){if(s<c)return;s<h&&(h=s)}return c>0&&(t[0]=a+c*l,t[1]=u+c*p),h<1&&(e[0]=a+h*l,e[1]=u+h*p),!0}}}}},ag=function(t,e){return Yf(t[0]-e[0])<Gf&&Yf(t[1]-e[1])<Gf},ug=function(t,e,n,r,i){var o,s,a=[],u=[];if(t.forEach((function(t){if(!((e=t.length-1)<=0)){var e,n,r=t[0],s=t[e];if(ag(r,s)){for(i.lineStart(),o=0;o<e;++o)i.point((r=t[o])[0],r[1]);i.lineEnd()}else a.push(n=new lo(r,t,null,!0)),u.push(n.o=new lo(r,null,n,!1)),a.push(n=new lo(s,t,null,!1)),u.push(n.o=new lo(s,null,n,!0))}})),a.length){for(u.sort(e),po(a),po(u),o=0,s=u.length;o<s;++o)u[o].e=n=!n;for(var c,h,l=a[0];;){for(var p=l,f=!0;p.v;)if((p=p.n)===l)return;c=p.z,i.lineStart();do{if(p.v=p.o.v=!0,p.e){if(f)for(o=0,s=c.length;o<s;++o)i.point((h=c[o])[0],h[1]);else r(p.x,p.n.x,1,i);p=p.n}else{if(f)for(c=p.p.z,o=c.length-1;o>=0;--o)i.point((h=c[o])[0],h[1]);else r(p.x,p.p.x,-1,i);p=p.p}c=(p=p.o).z,f=!f}while(!p.v);i.lineEnd()}}},cg=function(t,e){return t<e?-1:t>e?1:t>=e?0:NaN},hg=(function(t){1===t.length&&(t=function(t){return function(e,n){return cg(t(e),n)}}(t))}(cg),function(t){for(var e,n,r,i=t.length,o=-1,s=0;++o<i;)s+=t[o].length;for(n=new Array(s);--i>=0;)for(e=(r=t[i]).length;--e>=0;)n[--s]=r[e];return n}),lg=1e9,pg=-lg,fg=Ff(),gg=(Ff(),function(t){return t}),dg=(Ff(),Ff(),1/0),yg=dg,_g=-dg,mg=_g,vg={point:function(t,e){t<dg&&(dg=t),t>_g&&(_g=t),e<yg&&(yg=e),e>mg&&(mg=e)},lineStart:Wi,lineEnd:Wi,polygonStart:Wi,polygonEnd:Wi,result:function(){var t=[[dg,yg],[_g,mg]];return _g=mg=-(yg=dg=1/0),t}},xg=(Ff(),function(t,e,n,r){return function(i,o){function s(e,n){var r=i(e,n);t(e=r[0],n=r[1])&&o.point(e,n)}function a(t,e){var n=i(t,e);y.point(n[0],n[1])}function u(){E.point=a,y.lineStart()}function c(){E.point=s,y.lineEnd()}function h(t,e){d.push([t,e]);var n=i(t,e);v.point(n[0],n[1])}function l(){v.lineStart(),d=[]}function p(){h(d[0][0],d[0][1]),v.lineEnd();var t,e,n,r,i=v.clean(),s=m.result(),a=s.length;if(d.pop(),f.push(d),d=null,a)if(1&i){if((e=(n=s[0]).length-1)>0){for(x||(o.polygonStart(),x=!0),o.lineStart(),t=0;t<e;++t)o.point((r=n[t])[0],r[1]);o.lineEnd()}}else a>1&&2&i&&s.push(s.pop().concat(s.shift())),g.push(s.filter(go))}var f,g,d,y=e(o),_=i.invert(r[0],r[1]),m=og(),v=e(m),x=!1,E={point:s,lineStart:u,lineEnd:c,polygonStart:function(){E.point=h,E.lineStart=l,E.lineEnd=p,g=[],f=[]},polygonEnd:function(){E.point=s,E.lineStart=u,E.lineEnd=c,g=hg(g);var t=function(t,e){var n=e[0],r=e[1],i=[Kf(n),-Wf(n),0],o=0,s=0;fg.reset();for(var a=0,u=t.length;a<u;++a)if(h=(c=t[a]).length)for(var c,h,l=c[h-1],p=l[0],f=l[1]/2+zf,g=Kf(f),d=Wf(f),y=0;y<h;++y,p=m,g=x,d=E,l=_){var _=c[y],m=_[0],v=_[1]/2+zf,x=Kf(v),E=Wf(v),w=m-p,b=w>=0?1:-1,I=b*w,N=I>Bf,C=g*x;if(fg.add(Hf(C*b*Kf(I),d*E+C*Wf(I))),o+=N?w+b*jf:w,N^p>=n^m>=n){var S=eo($i(l),$i(_));io(S);var M=eo(i,S);io(M);var L=(N^w>=0?-1:1)*Hi(M[2]);(r>L||r===L&&(S[0]||S[1]))&&(s+=N^w>=0?1:-1)}}return(o<-Gf||o<Gf&&fg<-Gf)^1&s}(f,_);g.length?(x||(o.polygonStart(),x=!0),ug(g,yo,t,n,o)):t&&(x||(o.polygonStart(),x=!0),o.lineStart(),n(null,null,1,o),o.lineEnd()),x&&(o.polygonEnd(),x=!1),g=f=null},sphere:function(){o.polygonStart(),o.lineStart(),n(null,null,1,o),o.lineEnd(),o.polygonEnd()}};return E}}),Eg=xg((function(){return!0}),(function(t){var e,n=NaN,r=NaN,i=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(o,s){var a=o>0?Bf:-Bf,u=Yf(o-n);Yf(u-Bf)<Gf?(t.point(n,r=(r+s)/2>0?kf:-kf),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(a,r),t.point(o,r),e=0):i!==a&&u>=Bf&&(Yf(n-i)<Gf&&(n-=i*Gf),Yf(o-a)<Gf&&(o-=a*Gf),r=function(t,e,n,r){var i,o,s=Kf(t-n);return Yf(s)>Gf?Vf((Kf(e)*(o=Wf(r))*Kf(n)-Kf(r)*(i=Wf(e))*Kf(t))/(i*o*s)):(e+r)/2}(n,r,o,s),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(a,r),e=0),t.point(n=o,r=s),i=a},lineEnd:function(){t.lineEnd(),n=r=NaN},clean:function(){return 2-e}}}),(function(t,e,n,r){var i;if(null==t)i=n*kf,r.point(-Bf,i),r.point(0,i),r.point(Bf,i),r.point(Bf,0),r.point(Bf,-i),r.point(0,-i),r.point(-Bf,-i),r.point(-Bf,0),r.point(-Bf,i);else if(Yf(t[0]-e[0])>Gf){var o=t[0]<e[0]?Bf:-Bf;i=n*o/2,r.point(-o,i),r.point(0,i),r.point(o,i)}else r.point(e[0],e[1])}),[-Bf,-kf]),wg=function(t,e){function n(t,e){return Wf(t)*Wf(e)>o}function r(t,e,n){var r=[1,0,0],i=eo($i(t),$i(e)),s=to(i,i),a=i[0],u=s-a*a;if(!u)return!n&&t;var c=o*s/u,h=-o*a/u,l=eo(r,i),p=ro(r,c);no(p,ro(i,h));var f=l,g=to(p,f),d=to(f,f),y=g*g-d*(to(p,p)-1);if(!(y<0)){var _=Qf(y),m=ro(f,(-g-_)/d);if(no(m,p),m=Qi(m),!n)return m;var v,x=t[0],E=e[0],w=t[1],b=e[1];E<x&&(v=x,x=E,E=v);var I=E-x,N=Yf(I-Bf)<Gf;if(!N&&b<w&&(v=w,w=b,b=v),N||I<Gf?N?w+b>0^m[1]<(Yf(m[0]-x)<Gf?w:b):w<=m[1]&&m[1]<=b:I>Bf^(x<=m[0]&&m[0]<=E)){var C=ro(f,(-g+_)/d);return no(C,p),[m,Qi(C)]}}}function i(e,n){var r=s?t:Bf-t,i=0;return e<-r?i|=1:e>r&&(i|=2),n<-r?i|=4:n>r&&(i|=8),i}var o=Wf(t),s=o>0,a=Yf(o)>Gf;return xg(n,(function(t){var e,o,u,c,h;return{lineStart:function(){c=u=!1,h=1},point:function(l,p){var f,g=[l,p],d=n(l,p),y=s?d?0:i(l,p):d?i(l+(l<0?Bf:-Bf),p):0;if(!e&&(c=u=d)&&t.lineStart(),d!==u&&(!(f=r(e,g))||ag(e,f)||ag(g,f))&&(g[0]+=Gf,g[1]+=Gf,d=n(g[0],g[1])),d!==u)h=0,d?(t.lineStart(),f=r(g,e),t.point(f[0],f[1])):(f=r(e,g),t.point(f[0],f[1]),t.lineEnd()),e=f;else if(a&&e&&s^d){var _;y&o||!(_=r(g,e,!0))||(h=0,s?(t.lineStart(),t.point(_[0][0],_[0][1]),t.point(_[1][0],_[1][1]),t.lineEnd()):(t.point(_[1][0],_[1][1]),t.lineEnd(),t.lineStart(),t.point(_[0][0],_[0][1])))}!d||e&&ag(e,g)||t.point(g[0],g[1]),e=g,u=d,o=y},lineEnd:function(){u&&t.lineEnd(),e=null},clean:function(){return h|(c&&u)<<1}}}),(function(n,r,i,o){!function(t,e,n,r,i,o){if(n){var s=Wf(e),a=Kf(e),u=r*n;null==i?(i=e+r*jf,o=e-u/2):(i=ho(s,i),o=ho(s,o),(r>0?i<o:i>o)&&(i+=r*jf));for(var c,h=i;r>0?h>o:h<o;h-=u)c=Qi([s,-a*Wf(h),-a*Kf(h)]),t.point(c[0],c[1])}}(o,t,e,i,n,r)}),s?[0,-t]:[-Bf,t-Bf])};mo.prototype={constructor:mo,point:function(t,e){this.stream.point(t,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var bg=16,Ig=Wf(30*Uf),Ng=function(t,e){return+e?function(t,e){function n(r,i,o,s,a,u,c,h,l,p,f,g,d,y){var _=c-r,m=h-i,v=_*_+m*m;if(v>4*e&&d--){var x=s+p,E=a+f,w=u+g,b=Qf(x*x+E*E+w*w),I=Hi(w/=b),N=Yf(Yf(w)-1)<Gf||Yf(o-l)<Gf?(o+l)/2:Hf(E,x),C=t(N,I),S=C[0],M=C[1],L=S-r,P=M-i,O=m*L-_*P;(O*O/v>e||Yf((_*L+m*P)/v-.5)>.3||s*p+a*f+u*g<Ig)&&(n(r,i,o,s,a,u,S,M,N,x/=b,E/=b,w,d,y),y.point(S,M),n(S,M,N,x,E,w,c,h,l,p,f,g,d,y))}}return function(e){function r(n,r){n=t(n,r),e.point(n[0],n[1])}function i(){_=NaN,w.point=o,e.lineStart()}function o(r,i){var o=$i([r,i]),s=t(r,i);n(_,m,y,v,x,E,_=s[0],m=s[1],y=r,v=o[0],x=o[1],E=o[2],bg,e),e.point(_,m)}function s(){w.point=r,e.lineEnd()}function a(){i(),w.point=u,w.lineEnd=c}function u(t,e){o(h=t,e),l=_,p=m,f=v,g=x,d=E,w.point=o}function c(){n(_,m,y,v,x,E,l,p,h,f,g,d,bg,e),w.lineEnd=s,s()}var h,l,p,f,g,d,y,_,m,v,x,E,w={point:r,lineStart:i,lineEnd:s,polygonStart:function(){e.polygonStart(),w.lineStart=a},polygonEnd:function(){e.polygonEnd(),w.lineStart=i}};return w}}(t,e):function(t){return _o({point:function(e,n){e=t(e,n),this.stream.point(e[0],e[1])}})}(t)},Cg=_o({point:function(t,e){this.stream.point(t*Uf,e*Uf)}});Eo.invert=function(t,e){return[t,2*Vf(Jf(e))-kf]},wo.invert=function(t,e){return[-e,2*Vf(Jf(t))-kf]};var Sg=function(){var t=function(t){function e(){var e=Bf*a(),s=o(ig(o.rotate()).invert([0,0]));return c(null==h?[[s[0]-e,s[1]-e],[s[0]+e,s[1]+e]]:t===Eo?[[Math.max(s[0]-e,h),n],[Math.min(s[0]+e,r),i]]:[[h,Math.max(s[1]-e,n)],[r,Math.min(s[1]+e,i)]])}var n,r,i,o=xo(t),s=o.center,a=o.scale,u=o.translate,c=o.clipExtent,h=null;return o.scale=function(t){return arguments.length?(a(t),e()):a()},o.translate=function(t){return arguments.length?(u(t),e()):u()},o.center=function(t){return arguments.length?(s(t),e()):s()},o.clipExtent=function(t){return arguments.length?(null==t?h=n=r=i=null:(h=+t[0][0],n=+t[0][1],r=+t[1][0],i=+t[1][1]),e()):null==h?null:[[h,n],[r,i]]},e()}(wo),e=t.center,n=t.rotate;return t.center=function(t){return arguments.length?e([-t[1],t[0]]):[(t=e())[1],-t[0]]},t.rotate=function(t){return arguments.length?n([t[0],t[1],t.length>2?t[2]+90:90]):[(t=n())[0],t[1],t[2]-90]},n([0,0,90]).scale(159.155)};t.projection=Cs,t.random=gu,t.clusters=du,t.helpers=ko,t.invariant=jo,t.meta=zo,t.isolines=function(t,e,n){if(!I(n=n||{}))throw new Error("options is invalid");var r=n.zProperty||"elevation",i=n.commonProperties||{},o=n.breaksProperties||[];if(W(t,"Point","Input must contain Points"),!e)throw new Error("breaks is required");if(!Array.isArray(e))throw new Error("breaks must be an Array");if(!I(i))throw new Error("commonProperties must be an Object");if(!Array.isArray(o))throw new Error("breaksProperties must be an Array");var s=rt(t,{zProperty:r,flip:!0});return c(function(t,e,n){var r=j(n),i=r[2]-r[0],o=r[3]-r[1],s=r[0],a=r[1],u=e[0].length-1,c=e.length-1,h=i/u,l=o/c,p=function(t){t[0]=t[0]*h+s,t[1]=t[1]*l+a};return t.forEach((function(t){S(t,p)})),t}(function(t,e,n,r,i){for(var o=[],s=1;s<e.length;s++){var a=+e[s],u=Object.assign({},r,i[s]);u[n]=a;var c=h(Q(t,a),u);o.push(c)}return o}(s,e,r,i,o),s,t))},t.convex=Lt,t.pointsWithinPolygon=Rt,t.concave=function(t,n){if(!I(n=n||{}))throw new Error("options is invalid");if(!t)throw new Error("points is required");var r=n.maxEdge||1/0;if(!b(r))throw new Error("maxEdge is invalid");var i=Tt(function(t){var e=[],n={};return O(t,(function(t){if(t.geometry){var r=t.geometry.coordinates.join("-");n.hasOwnProperty(r)||(e.push(t),n[r]=!0)}})),c(e)}(t));if(i.features=i.features.filter((function(t){var e=t.geometry.coordinates[0][0],i=t.geometry.coordinates[0][1],o=t.geometry.coordinates[0][2],s=qt(e,i,n),a=qt(i,o,n),u=qt(e,o,n);return s<=r&&a<=r&&u<=r})),i.features.length<1)return null;var o=$t(i,n);return 1===o.coordinates.length&&(o.coordinates=o.coordinates[0],o.type="Polygon"),e(o)},t.collect=function(t,e,n,r){var i=Vo(6),o=e.features.map((function(t){return{minX:t.geometry.coordinates[0],minY:t.geometry.coordinates[1],maxX:t.geometry.coordinates[0],maxY:t.geometry.coordinates[1],property:t.properties[n]}}));return i.load(o),t.features.forEach((function(t){t.properties||(t.properties={});var e=j(t),n=[];i.search({minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]}).forEach((function(e){Pt([e.minX,e.minY],t)&&n.push(e.property)})),t.properties[r]=n})),t},t.flip=function(t,e){if(!I(e=e||{}))throw new Error("options is invalid");var n=e.mutate;if(!t)throw new Error("geojson is required");return!1!==n&&void 0!==n||(t=Gt(t)),S(t,(function(t){var e=t[0],n=t[1];t[0]=n,t[1]=e})),t},t.simplify=function(t,e){if(!I(e=e||{}))throw new Error("options is invalid");var n=void 0!==e.tolerance?e.tolerance:1,r=e.highQuality||!1,i=e.mutate||!1;if(!t)throw new Error("geojson is required");if(n&&n<0)throw new Error("invalid tolerance");return!0!==i&&(t=Gt(t)),A(t,(function(t){!function(t,e,n){var r=t.type;if("Point"===r||"MultiPoint"===r)return t;te(t,!0);var i=t.coordinates;switch(r){case"LineString":t.coordinates=se(i,e,n);break;case"MultiLineString":t.coordinates=i.map((function(t){return se(t,e,n)}));break;case"Polygon":t.coordinates=ae(i,e,n);break;case"MultiPolygon":t.coordinates=i.map((function(t){return ae(t,e,n)}))}}(t,n,r)})),t},t.bezierSpline=ue,t.tag=function(t,e,n,r){return t=Gt(t),e=Gt(e),O(t,(function(t){t.properties||(t.properties={}),O(e,(function(e){void 0===t.properties[r]&&Pt(t,e)&&(t.properties[r]=e.properties[n])}))})),t},t.sample=function(t,e){if(!t)throw new Error("featurecollection is required");if(null===e||void 0===e)throw new Error("num is required");if("number"!=typeof e)throw new Error("num must be a number");return c(function(t,e){for(var n,r,i=t.slice(0),o=t.length,s=o-e;o-- >s;)n=i[r=Math.floor((o+1)*Math.random())],i[r]=i[o],i[o]=n;return i.slice(s)}(t.features,e))},t.envelope=he,t.square=le,t.circle=fe,t.midpoint=function(t,e){return pe(t,qt(t,e)/2,ge(t,e))},t.center=de,t.centerOfMass=_e,t.centroid=ye,t.combine=function(t){function n(t,e,n){n?r[e].coordinates=r[e].coordinates.concat(t.geometry.coordinates):r[e].coordinates.push(t.geometry.coordinates),r[e].properties.push(t.properties)}var r={MultiPoint:{coordinates:[],properties:[]},MultiLineString:{coordinates:[],properties:[]},MultiPolygon:{coordinates:[],properties:[]}},i=Object.keys(r).reduce((function(t,e){return t[e.replace("Multi","")]=e,t}),{});return O(t,(function(t){t.geometry&&(r[t.geometry.type]?n(t,t.geometry.type,!0):i[t.geometry.type]&&n(t,i[t.geometry.type],!1))})),c(Object.keys(r).filter((function(t){return r[t].coordinates.length})).sort().map((function(t){return e({type:t,coordinates:r[t].coordinates},{collectedProperties:r[t].properties})})))},t.distance=qt,t.explode=me,t.bbox=j,t.tesselate=function(t){if(!t.geometry||"Polygon"!==t.geometry.type&&"MultiPolygon"!==t.geometry.type)throw new Error("input must be a Polygon or MultiPolygon");var e={type:"FeatureCollection",features:[]};return"Polygon"===t.geometry.type?e.features=De(t.geometry.coordinates):t.geometry.coordinates.forEach((function(t){e.features=e.features.concat(De(t))})),e},t.bboxPolygon=ce,t.booleanPointInPolygon=Pt,t.nearestPoint=Fe,t.nearestPointOnLine=on,t.nearestPointToLine=function(t,e,n){if(!I(n=n||{}))throw new Error("options is invalid");var r=n.units,i=n.properties||{};if(!t)throw new Error("points is required");if(!(t=function(t){var e=[];switch(t.geometry?t.geometry.type:t.type){case"GeometryCollection":return A(t,(function(t){"Point"===t.type&&e.push({type:"Feature",properties:{},geometry:t})})),{type:"FeatureCollection",features:e};case"FeatureCollection":return t.features=t.features.filter((function(t){return"Point"===t.geometry.type})),t;default:throw new Error("points must be a Point Collection")}}(t)).features.length)throw new Error("points must contain features");if(!e)throw new Error("line is required");if("LineString"!==K(e))throw new Error("line must be a LineString");var o=1/0,s=null;return O(t,(function(t){var n=gn(t,e,{units:r});n<o&&(o=n,s=t)})),s&&(s.properties=Object.assign({dist:o},s.properties,i)),s},t.planepoint=function(t,e){var n=X(t),r=J(e).coordinates[0];if(r.length<4)throw new Error("OuterRing of a Polygon must have 4 or more Positions.");var i=e.properties||{},o=i.a,s=i.b,a=i.c,u=n[0],c=n[1],h=r[0][0],l=r[0][1],p=void 0!==o?o:r[0][2],f=r[1][0],g=r[1][1],d=void 0!==s?s:r[1][2],y=r[2][0],_=r[2][1],m=void 0!==a?a:r[2][2];return(m*(u-h)*(c-g)+p*(u-f)*(c-_)+d*(u-y)*(c-l)-d*(u-h)*(c-_)-m*(u-f)*(c-l)-p*(u-y)*(c-g))/((u-h)*(c-g)+(u-f)*(c-_)+(u-y)*(c-l)-(u-h)*(c-_)-(u-f)*(c-l)-(u-y)*(c-g))},t.tin=Tt,t.bearing=ge,t.destination=pe,t.kinks=function(t){var e,n,i={type:"FeatureCollection",features:[]};if("LineString"===(n="Feature"===t.type?t.geometry:t).type)e=[n.coordinates];else if("MultiLineString"===n.type)e=n.coordinates;else if("MultiPolygon"===n.type)e=[].concat.apply([],n.coordinates);else{if("Polygon"!==n.type)throw new Error("Input must be a LineString, MultiLineString, Polygon, or MultiPolygon Feature or Geometry");e=n.coordinates}return e.forEach((function(t){e.forEach((function(e){for(var n=0;n<t.length-1;n++)for(var o=n;o<e.length-1;o++){if(t===e){if(1===Math.abs(n-o))continue;if(0===n&&o===t.length-2&&t[n][0]===t[t.length-1][0]&&t[n][1]===t[t.length-1][1])continue}var s=function(t,e,n,r,i,o,s,a){var u,c,h,l,p={x:null,y:null,onLine1:!1,onLine2:!1};return 0==(u=(a-o)*(n-t)-(s-i)*(r-e))?null!==p.x&&null!==p.y&&p:(l=(n-t)*(c=e-o)-(r-e)*(h=t-i),c=((s-i)*c-(a-o)*h)/u,h=l/u,p.x=t+c*(n-t),p.y=e+c*(r-e),c>=0&&c<=1&&(p.onLine1=!0),h>=0&&h<=1&&(p.onLine2=!0),!(!p.onLine1||!p.onLine2)&&[p.x,p.y])}(t[n][0],t[n][1],t[n+1][0],t[n+1][1],e[o][0],e[o][1],e[o+1][0],e[o+1][1]);s&&i.features.push(r([s[0],s[1]]))}}))})),i},t.pointOnFeature=yn,t.area=mn,t.along=function(t,e,n){if(!I(n=n||{}))throw new Error("options is invalid");var i;if("Feature"===t.type)i=t.geometry.coordinates;else{if("LineString"!==t.type)throw new Error("input must be a LineString Feature or Geometry");i=t.coordinates}if(!b(e))throw new Error("distance must be a number");for(var o=0,s=0;s<i.length&&!(e>=o&&s===i.length-1);s++){if(o>=e){var a=e-o;if(a){var u=ge(i[s],i[s-1])-180;return pe(i[s],a,u,n)}return r(i[s])}o+=qt(i[s],i[s+1],n)}return r(i[i.length-1])},t.length=bn,t.lineSlice=function(t,e,n){var r=U(n);if("LineString"!==K(n))throw new Error("line must be a LineString");for(var i,o=on(n,t),s=on(n,e),u=[(i=o.properties.index<=s.properties.index?[o,s]:[s,o])[0].geometry.coordinates],c=i[0].properties.index+1;c<i[1].properties.index+1;c++)u.push(r[c]);return u.push(i[1].geometry.coordinates),a(u,n.properties)},t.lineSliceAlong=In,t.pointGrid=Ln,t.truncate=Pn,t.flatten=function(t){if(!t)throw new Error("geojson is required");var e=[];return F(t,(function(t){e.push(t)})),c(e)},t.lineIntersect=nn,t.lineChunk=function(t,e,n){if(!I(n=n||{}))throw new Error("options is invalid");var r=n.units,i=n.reverse;if(!t)throw new Error("geojson is required");if(e<=0)throw new Error("segmentLength must be greater than 0");var o=[];return F(t,(function(t){i&&(t.geometry.coordinates=t.geometry.coordinates.reverse()),function(t,e,n,r){var i=bn(t,{units:n});if(i<=e)return r(t);var o=i/e;Number.isInteger(o)||(o=Math.floor(o)+1);for(var s=0;s<o;s++)r(In(t,e*s,e*(s+1),{units:n}),s)}(t,e,r,(function(t){o.push(t)}))})),c(o)},t.unkinkPolygon=function(t){var e=[];return F(t,(function(t){"Polygon"===t.geometry.type&&O(Ls(t),(function(n){e.push(o(n.geometry.coordinates,t.properties))}))})),c(e)},t.greatCircle=function(t,e,n){if("object"!=typeof(n=n||{}))throw new Error("options is invalid");var r=n.properties,i=n.npoints,o=n.offset;return t=X(t),e=X(e),r=r||{},i=i||100,o=o||10,new qs({x:t[0],y:t[1]},{x:e[0],y:e[1]},r).Arc(i,{offset:o}).json()},t.lineSegment=en,t.lineSplit=function(t,e){if(!t)throw new Error("line is required");if(!e)throw new Error("splitter is required");var n=K(t),r=K(e);if("LineString"!==n)throw new Error("line must be LineString");if("FeatureCollection"===r)throw new Error("splitter cannot be a FeatureCollection");if("GeometryCollection"===r)throw new Error("splitter cannot be a GeometryCollection");var i=Pn(e,{precision:7});switch(r){case"Point":return Dn(t,i);case"MultiPoint":return An(t,i);case"LineString":case"MultiLineString":case"Polygon":case"MultiPolygon":return An(t,nn(t,i))}},t.lineArc=Gn,t.polygonToLine=kn,t.lineToPolygon=jn,t.bboxClip=function(t,e){var n=function(t){return t.geometry?t.geometry.type:t.type}(t),r=U(t),i=t.properties;switch(n){case"LineString":case"MultiLineString":var s=[];return"LineString"===n&&(r=[r]),r.forEach((function(t){Gs(t,e,s)})),1===s.length?a(s[0],i):h(s,i);case"Polygon":return o(Wn(r,e),i);case"MultiPolygon":return p(r.map((function(t){return Wn(t,e)})),i);default:throw new Error("geometry "+n+" not supported")}},t.lineOverlap=$n,t.sector=function(t,e,n,r,i){if(!I(i=i||{}))throw new Error("options is invalid");if(!t)throw new Error("center is required");if(void 0===n||null===n)throw new Error("bearing1 is required");if(void 0===r||null===r)throw new Error("bearing2 is required");if(!e)throw new Error("radius is required");if("object"!=typeof i)throw new Error("options must be an object");if(er(n)===er(r))return fe(t,e,i);var s=U(t),a=[[s]];return S(Gn(t,e,n,r,i),(function(t){a[0].push(t)})),a[0].push(s),o(a)},t.rhumbBearing=sn,t.rhumbDistance=un,t.rhumbDestination=nr,t.polygonTangents=function(t,e){var n,i,o,s=U(t),a=U(e);switch(K(e)){case"Polygon":n=a[0][0],i=a[0][0],o=ir(a[0][0],a[0][a[0].length-1],s);var u=rr(a[0],s,o,void 0,n,i);n=u[0],i=u[1];break;case"MultiPolygon":n=a[0][0][0],i=a[0][0][0],o=ir(a[0][0][0],a[0][0][a[0][0].length-1],s),a.forEach((function(t){var e=rr(t[0],s,o,void 0,n,i);n=e[0],i=e[1]}))}return c([r(n),r(i)])},t.rewind=function(t,e){if(!I(e=e||{}))throw new Error("options is invalid");var n=e.reverse||!1,r=e.mutate||!1;if(!t)throw new Error("<geojson> is required");if("boolean"!=typeof n)throw new Error("<reverse> must be a boolean");if("boolean"!=typeof r)throw new Error("<mutate> must be a boolean");!1===r&&(t=Gt(t));var i=[];switch(t.type){case"GeometryCollection":return A(t,(function(t){sr(t,n)})),t;case"FeatureCollection":return O(t,(function(t){O(sr(t,n),(function(t){i.push(t)}))})),c(i)}return sr(t,n)},t.isobands=function(t,e,n){if(!I(n=n||{}))throw new Error("options is invalid");var r=n.zProperty||"elevation",i=n.commonProperties||{},s=n.breaksProperties||[];if(W(t,"Point","Input must contain Points"),!e)throw new Error("breaks is required");if(!Array.isArray(e))throw new Error("breaks is not an Array");if(!I(i))throw new Error("commonProperties is not an Object");if(!Array.isArray(s))throw new Error("breaksProperties is not an Array");var a=cr(t,{zProperty:r,flip:!0}),u=function(t,e,n){for(var r=[],i=1;i<e.length;i++){var s=+e[i-1],a=+e[i],u=function(t){var e=[],n=[];t.forEach((function(t){var r=mn(o([t]));n.push(r),e.push({ring:t,area:r})})),n.sort((function(t,e){return e-t}));var r=[];return n.forEach((function(t){for(var n=0;n<e.length;n++)if(e[n].area===t){r.push(e[n].ring),e.splice(n,1);break}})),r}(hr(t,s,a-s)),c=function(t){for(var e=t.map((function(t){return{lrCoordinates:t,grouped:!1}})),n=[];!function(t){for(var e=0;e<t.length;e++)if(!1===t[e].grouped)return!1;return!0}(e);)for(var r=0;r<e.length;r++)if(!e[r].grouped){var i=[];i.push(e[r].lrCoordinates),e[r].grouped=!0;for(var s=o([e[r].lrCoordinates]),a=r+1;a<e.length;a++)e[a].grouped||function(t,e){for(var n=me(t),r=0;r<n.features.length;r++)if(!Pt(n.features[r],e))return!1;return!0}(o([e[a].lrCoordinates]),s)&&(i.push(e[a].lrCoordinates),e[a].grouped=!0);n.push(i)}return n}(u),h={};h.groupedRings=c,h[n]=s+"-"+a,r.push(h)}return r}(a,e,r);return c((u=function(t,e,n){var r=j(n),i=r[2]-r[0],o=r[3]-r[1],s=r[0],a=r[1],u=e[0].length-1,c=e.length-1,h=i/u,l=o/c,p=function(t){t[0]=t[0]*h+s,t[1]=t[1]*l+a};return t.forEach((function(t){t.groupedRings.forEach((function(t){t.forEach((function(t){t.forEach(p)}))}))})),t}(u,a,t)).map((function(t,e){if(s[e]&&!I(s[e]))throw new Error("Each mappedProperty is required to be an Object");var n=Object.assign({},i,s[e]);return n[r]=t[r],p(t.groupedRings,n)})))},t.transformRotate=fr,t.transformScale=gr,t.transformTranslate=function(t,e,n,r){if(!I(r=r||{}))throw new Error("options is invalid");var i=r.units,o=r.zTranslation,s=r.mutate;if(!t)throw new Error("geojson is required");if(void 0===e||null===e||isNaN(e))throw new Error("distance is required");if(o&&"number"!=typeof o&&isNaN(o))throw new Error("zTranslation is not a number");if(o=void 0!==o?o:0,0===e&&0===o)return t;if(void 0===n||null===n||isNaN(n))throw new Error("direction is required");return e<0&&(e=-e,n=-n),!1!==s&&void 0!==s||(t=Gt(t)),S(t,(function(t){var r=U(nr(t,e,n,{units:i}));t[0]=r[0],t[1]=r[1],o&&3===t.length&&(t[2]+=o)})),t},t.lineOffset=function(t,e,n){if(!I(n=n||{}))throw new Error("options is invalid");var r=n.units;if(!t)throw new Error("geojson is required");if(void 0===e||null===e||isNaN(e))throw new Error("distance is required");var i=K(t),o=t.properties;switch(i){case"LineString":return vr(t,e,r);case"MultiLineString":var s=[];return F(t,(function(t){s.push(vr(t,e,r).geometry.coordinates)})),h(s,o);default:throw new Error("geometry "+i+" is not supported")}},t.polygonize=function(t){var e=qa.fromGeoJson(t);e.deleteDangles(),e.deleteCutEdges();var n=[],r=[];return e.getEdgeRings().filter((function(t){return t.isValid()})).forEach((function(t){t.isHole()?n.push(t):r.push(t)})),n.forEach((function(t){Da.findEdgeRingContaining(t,r)&&r.push(t)})),c(r.map((function(t){return t.toPolygon()})))},t.booleanDisjoint=function(t,e){var n;return F(t,(function(t){F(e,(function(e){if(!1===n)return!1;n=function(t,e){switch(t.type){case"Point":switch(e.type){case"Point":return!function(t,e){return t[0]===e[0]&&t[1]===e[1]}(t.coordinates,e.coordinates);case"LineString":return!wr(e,t);case"Polygon":return!Pt(t,e)}break;case"LineString":switch(e.type){case"Point":return!wr(t,e);case"LineString":return!function(t,e){return nn(t,e).features.length>0}(t,e);case"Polygon":return!br(e,t)}break;case"Polygon":switch(e.type){case"Point":return!Pt(e,t);case"LineString":return!br(t,e);case"Polygon":return!function(t,e){for(var n=0;n<t.coordinates[0].length;n++)if(Pt(t.coordinates[0][n],e))return!0;for(var r=0;r<e.coordinates[0].length;r++)if(Pt(e.coordinates[0][r],t))return!0;return!1}(e,t)}}}(t.geometry,e.geometry)}))})),n},t.booleanContains=function(t,e){var n=K(t),r=K(e),i=J(t),o=J(e),s=U(t),a=U(e);switch(n){case"Point":if("Point"===r)return Nr(s,a);throw new Error("feature2 "+r+" geometry not supported");case"MultiPoint":switch(r){case"Point":return function(t,e){var n,r=!1;for(n=0;n<t.coordinates.length;n++)if(Nr(t.coordinates[n],e.coordinates)){r=!0;break}return r}(i,o);case"MultiPoint":return function(t,e){for(var n=0;n<e.coordinates.length;n++){for(var r=!1,i=0;i<t.coordinates.length;i++)if(Nr(e.coordinates[n],t.coordinates[i])){r=!0;break}if(!r)return!1}return!0}(i,o);default:throw new Error("feature2 "+r+" geometry not supported")}case"LineString":switch(r){case"Point":return Nn(o,i,{ignoreEndVertices:!0});case"LineString":return function(t,e){for(var n=!1,r=0;r<e.coordinates.length;r++)if(Nn({type:"Point",coordinates:e.coordinates[r]},t,{ignoreEndVertices:!0})&&(n=!0),!Nn({type:"Point",coordinates:e.coordinates[r]},t,{ignoreEndVertices:!1}))return!1;return n}(i,o);case"MultiPoint":return function(t,e){for(var n=!1,r=0;r<e.coordinates.length;r++)if(Nn(e.coordinates[r],t,{ignoreEndVertices:!0})&&(n=!0),!Nn(e.coordinates[r],t))return!1;return!!n}(i,o);default:throw new Error("feature2 "+r+" geometry not supported")}case"Polygon":switch(r){case"Point":return Pt(o,i,{ignoreBoundary:!0});case"LineString":return function(t,e){var n=!1,r=0;if(!Ir(j(t),j(e)))return!1;for(;r<e.coordinates.length-1;r++){var i=function(t,e){return[(t[0]+e[0])/2,(t[1]+e[1])/2]}(e.coordinates[r],e.coordinates[r+1]);if(Pt({type:"Point",coordinates:i},t,{ignoreBoundary:!0})){n=!0;break}}return n}(i,o);case"Polygon":return function(t,e){if(!Ir(j(t),j(e)))return!1;for(var n=0;n<e.coordinates[0].length;n++)if(!Pt(e.coordinates[0][n],t))return!1;return!0}(i,o);case"MultiPoint":return function(t,e){for(var n=0;n<e.coordinates.length;n++)if(!Pt(e.coordinates[n],t,{ignoreBoundary:!0}))return!1;return!0}(i,o);default:throw new Error("feature2 "+r+" geometry not supported")}default:throw new Error("feature1 "+n+" geometry not supported")}},t.booleanCrosses=function(t,e){var n=K(t),r=K(e),i=J(t),o=J(e);switch(n){case"MultiPoint":switch(r){case"LineString":return Cr(i,o);case"Polygon":return Mr(i,o);default:throw new Error("feature2 "+r+" geometry not supported")}case"LineString":switch(r){case"MultiPoint":return Cr(o,i);case"LineString":return function(t,e){if(nn(t,e).features.length>0)for(var n=0;n<t.coordinates.length-1;n++)for(var r=0;r<e.coordinates.length-1;r++){var i=!0;if(0!==r&&r!==e.coordinates.length-2||(i=!1),Lr(t.coordinates[n],t.coordinates[n+1],e.coordinates[r],i))return!0}return!1}(i,o);case"Polygon":return Sr(i,o);default:throw new Error("feature2 "+r+" geometry not supported")}case"Polygon":switch(r){case"MultiPoint":return Mr(o,i);case"LineString":return Sr(o,i);default:throw new Error("feature2 "+r+" geometry not supported")}default:throw new Error("feature1 "+n+" geometry not supported")}},t.booleanClockwise=or,t.booleanOverlap=Tr,t.booleanPointOnLine=Nn,t.booleanEqual=function(t,e){if(!t)throw new Error("feature1 is required");if(!e)throw new Error("feature2 is required");return K(t)===K(e)&&new ja({precision:6}).compare(te(t),te(e))},t.booleanWithin=Cn,t.clone=Gt,t.cleanCoords=te,t.clustersDbscan=function(t,e,n){if("object"!=typeof(n=n||{}))throw new Error("options is invalid");var r=n.minPoints,i=n.units;if(W(t,"Point","Input must contain Points"),null===e||void 0===e)throw new Error("maxDistance is required");if(!(Math.sign(e)>0))throw new Error("Invalid maxDistance");if(!(void 0===r||null===r||Math.sign(r)>0))throw new Error("Invalid minPoints");t=Gt(t),r=r||3;var o=new Ha.DBSCAN,s=-1;return o.run(T(t),E(e,i),r,qt).forEach((function(e){s++,e.forEach((function(e){var n=t.features[e];n.properties||(n.properties={}),n.properties.cluster=s,n.properties.dbscan="core"}))})),o.noise.forEach((function(e){var n=t.features[e];n.properties||(n.properties={}),n.properties.cluster?n.properties.dbscan="edge":n.properties.dbscan="noise"})),t},t.clustersKmeans=function(t,e){if("object"!=typeof(e=e||{}))throw new Error("options is invalid");var n=e.numberOfClusters,r=e.mutate;W(t,"Point","Input must contain Points");var i=t.features.length;(n=n||Math.round(Math.sqrt(i/2)))>i&&(n=i),!1!==r&&void 0!==r||(t=Gt(t));var o=T(t),s=o.slice(0,n),a=eu(o,n,s),u={};return a.centroids.forEach((function(t,e){u[e]=t})),O(t,(function(t,e){var n=a.idxs[e];t.properties.cluster=n,t.properties.centroid=u[n]})),t},t.pointToLineDistance=gn,t.booleanParallel=function(t,e){if(!t)throw new Error("line1 is required");if(!e)throw new Error("line2 is required");if("LineString"!==Dr(t,"line1"))throw new Error("line1 must be a LineString");if("LineString"!==Dr(e,"line2"))throw new Error("line2 must be a LineString");for(var n=en(te(t)).features,r=en(te(e)).features,i=0;i<n.length;i++){var o=n[i].geometry.coordinates;if(!r[i])break;if(!function(t,e){return m(sn(t[0],t[1]))===m(sn(e[0],e[1]))}(o,r[i].geometry.coordinates))return!1}return!0},t.shortestPath=function(t,n,i){if(!I(i=i||{}))throw new Error("options is invalid");var o=i.resolution,s=i.minDistance,u=i.obstacles||c([]);if(!t)throw new Error("start is required");if(!n)throw new Error("end is required");if(o&&!b(o)||o<=0)throw new Error("options.resolution must be a number, greater than 0");if(s)throw new Error("options.minDistance is not yet implemented");var h=X(t),l=X(n);switch(t=r(h),n=r(l),K(u)){case"FeatureCollection":if(0===u.features.length)return a([h,l]);break;case"Polygon":u=c([e(J(u))]);break;default:throw new Error("invalid obstacles")}var p=u;p.features.push(t),p.features.push(n);var f=j(gr(ce(j(p)),1.15));o||(o=qt([f[0],f[1]],[f[2],f[1]],i)/100),p.features.pop(),p.features.pop();for(var g=f[0],d=f[1],y=f[2],_=f[3],m=o/qt([g,d],[y,d],i)*(y-g),v=o/qt([g,d],[g,_],i)*(_-d),x=y-g,E=_-d,w=(x-Math.floor(x/m)*m)/2,N=[],C=[],S=[],M=[],L=1/0,P=1/0,O=_-(E-Math.floor(E/v)*v)/2,R=0;O>=d;){for(var T=[],A=[],D=g+w,F=0;D<=y;){var q=r([D,O]),G=function(t,e){for(var n=0;n<e.features.length;n++)if(Pt(t,e.features[n]))return!0;return!1}(q,u);T.push(G?0:1),A.push(D+"|"+O);var B=qt(q,t);!G&&B<L&&(L=B,S={x:F,y:R});var k=qt(q,n);!G&&k<P&&(P=k,M={x:F,y:R}),D+=m,F++}C.push(T),N.push(A),O-=v,R++}var z=new qr(C,{diagonal:!0}),U=z.grid[S.y][S.x],Y=z.grid[M.y][M.x],V=[h];return nu.search(z,U,Y).forEach((function(t){var e=N[t.x][t.y].split("|");V.push([+e[0],+e[1]])})),V.push(l),te(a(V))},t.voronoi=function(t,e){if(!I(e=e||{}))throw new Error("options is invalid");var n=e.bbox||[-180,-85,180,85];if(!t)throw new Error("points is required");if(!Array.isArray(n))throw new Error("bbox is invalid");return W(t,"Point","points"),c(fu().x((function(t){return t.geometry.coordinates[0]})).y((function(t){return t.geometry.coordinates[1]})).extent([[n[0],n[1]],[n[2],n[3]]]).polygons(t.features).map(li))},t.ellipse=pi,t.centerMean=gi,t.centerMedian=function(t,e){if(!I(e=e||{}))throw new Error("options is invalid");var n=e.counter||10;if(!b(n))throw new Error("counter must be a number");var r=e.weight,i=gi(t,{weight:e.weight}),o=c([]);return O(t,(function(t){o.features.push(ye(t,{weight:t.properties[r]}))})),o.properties={tolerance:e.tolerance,medianCandidates:[]},di(i.geometry.coordinates,[0,0],o,n)},t.standardDeviationalEllipse=function(t,e){if(!I(e=e||{}))throw new Error("options is invalid");var n=e.steps||64,r=e.weight,i=e.properties||{};if(!b(n))throw new Error("steps must be a number");if(!I(i))throw new Error("properties must be a number");var o=T(t).length,s=gi(t,{weight:r}),a=0,u=0,h=0;O(t,(function(t){var e=t.properties[r]||1,n=yi(U(t),U(s));a+=Math.pow(n.x,2)*e,u+=Math.pow(n.y,2)*e,h+=n.x*n.y*e}));var l=a-u,p=Math.sqrt(Math.pow(l,2)+4*Math.pow(h,2)),f=2*h,g=Math.atan((l+p)/f),d=180*g/Math.PI,y=0,_=0,m=0;O(t,(function(t){var e=t.properties[r]||1,n=yi(U(t),U(s));y+=Math.pow(n.x*Math.cos(g)-n.y*Math.sin(g),2)*e,_+=Math.pow(n.x*Math.sin(g)+n.y*Math.cos(g),2)*e,m+=e}));var v=Math.sqrt(2*y/m),x=Math.sqrt(2*_/m),E=pi(s,v,x,{units:"degrees",angle:d,steps:n,properties:i}),w=Rt(t,c([E])),N={meanCenterCoordinates:U(s),semiMajorAxis:v,semiMinorAxis:x,numberOfFeatures:o,angle:d,percentageWithinEllipse:100*T(w).length/o};return E.properties.standardDeviationalEllipse=N,E},t.difference=function(t,n){var r=J(t),i=J(n),o=t.properties||{};if(r=Ui(r),i=Ui(i),!r)return null;if(!i)return e(r,o);var s=new bh,a=s.read(r),u=s.read(i),c=Cf.difference(a,u);return c.isEmpty()?null:e((new Ih).write(c),o)},t.buffer=function(t,e,n){var r=(n=n||{}).units,i=n.steps||64;if(!t)throw new Error("geojson is required");if("object"!=typeof n)throw new Error("options must be an object");if("number"!=typeof i)throw new Error("steps must be an number");if(void 0===e)throw new Error("radius is required");if(i<=0)throw new Error("steps must be greater than 0");i=i||64,r=r||"kilometers";var o=[];switch(t.type){case"GeometryCollection":return A(t,(function(t){var n=bo(t,e,r,i);n&&o.push(n)})),c(o);case"FeatureCollection":return O(t,(function(t){var n=bo(t,e,r,i);n&&O(n,(function(t){t&&o.push(t)}))})),c(o)}return bo(t,e,r,i)},t.union=Mo,t.intersect=Lo,t.dissolve=function(t,e){if(!I(e=e||{}))throw new Error("options is invalid");var n=e.propertyName;W(t,"Polygon","dissolve");var r=Gt(t),i=r.features,o=[];i.forEach((function(t,e){t.properties.origIndexPosition=e}));var s=Qe();for(var u in s.load(r),i){var c=i[u],h=!1;if(s.search(c).features.forEach((function(t){c=i[u];var e=t.properties.origIndexPosition;if(o.length>0&&0!==e)if(e>o[o.length-1])e-=o.length;else{var r=Po(e,o);0!==r&&(e-=r)}if(e!==+u){var l=i[e];l&&c&&(void 0!==n&&l.properties[n]!==c.properties[n]||Tr(c,l)&&function(t,e){return nn(a(T(t)),a(T(e))).features.length>0}(c,l)&&(i[u]=Mo(c,l),o.push(t.properties.origIndexPosition),o.sort((function(t,e){return t-e})),s.remove(t),i.splice(e,1),c.properties.origIndexPosition=u,s.remove(c,(function(t,e){return t.properties.origIndexPosition===e.properties.origIndexPosition})),h=!0))}})),h){if(!c)continue;c.properties.origIndexPosition=u,s.insert(c),u--}}return i.forEach((function(t){delete t.properties.origIndexPosition,delete t.bbox})),r},t.hexGrid=Oo,t.mask=function(t,e){var n=function(t){return o(t&&t.geometry.coordinates||[[[180,90],[-180,90],[-180,-90],[180,-90],[180,90]]])}(e),r=function(t){var e=[],n=[];return F(t,(function(t){var r=t.geometry.coordinates,i=r[0],s=r.slice(1);e.push(o([i])),s.forEach((function(t){n.push(o([t]))}))})),[c(e),c(n)]}(t),i=r[0],s=r[1];return function(t,e,n){var r=[];return r.push(t.geometry.coordinates[0]),F(e,(function(t){r.push(t.geometry.coordinates[0])})),F(n,(function(t){r.push(t.geometry.coordinates[0])})),o(r)}(n,i=Ro(i),s=Ro(s))},t.squareGrid=Ao,t.triangleGrid=Do,t.interpolate=function(t,e,n){if("object"!=typeof(n=n||{}))throw new Error("options is invalid");var r=n.gridType,i=n.property,o=n.weight;if(!t)throw new Error("points is required");if(W(t,"Point","input must contain Points"),!e)throw new Error("cellSize is required");if(void 0!==o&&"number"!=typeof o)throw new Error("weight must be a number");i=i||"elevation",r=r||"square",o=o||1;var s,a=j(t);switch(r){case"point":case"points":s=Ln(a,e,n);break;case"square":case"squares":s=Ao(a,e,n);break;case"hex":case"hexes":s=Oo(a,e,n);break;case"triangle":case"triangles":s=Do(a,e,n);break;default:throw new Error("invalid gridType")}var u=[];return O(s,(function(e){var s=0,a=0;O(t,(function(t){var u,c=qt("point"===r?e:ye(e),t,n);if(void 0!==i&&(u=t.properties[i]),void 0===u&&(u=t.geometry.coordinates[2]),void 0===u)throw new Error("zValue is missing");0===c&&(s=u);var h=1/Math.pow(c,o);a+=h,s+=h*u}));var c=Gt(e);c.properties[i]=s/a,u.push(c)})),c(u)},t.pointOnSurface=yn,t.polygonToLineString=kn,t.lineStringToPolygon=jn,t.inside=Pt,t.within=Rt,t.bezier=ue,t.nearest=Fe,t.pointOnLine=on,t.lineDistance=bn,t.radians2degrees=v,t.degrees2radians=x,t.distanceToDegrees=_,t.distanceToRadians=y,t.radiansToDistance=d,t.bearingToAngle=m,t.convertDistance=E,t.toMercator=cn,t.toWgs84=hn,t.randomPosition=_i,t.randomPoint=mi,t.randomPolygon=vi,t.randomLineString=xi,t.getCluster=wi,t.clusterEach=bi,t.clusterReduce=Ii,t.createBins=Ni,t.applyFilter=Ci,t.propertiesContainsFilter=Si,t.filterProperties=Mi,t.earthRadius=Fo,t.factors=qo,t.unitsFactors=Go,t.areaFactors=Bo,t.feature=e,t.geometry=n,t.point=r,t.points=i,t.polygon=o,t.polygons=s,t.lineString=a,t.lineStrings=u,t.featureCollection=c,t.multiLineString=h,t.multiPoint=l,t.multiPolygon=p,t.geometryCollection=f,t.round=g,t.radiansToLength=d,t.lengthToRadians=y,t.lengthToDegrees=_,t.bearingToAzimuth=m,t.radiansToDegrees=v,t.degreesToRadians=x,t.convertLength=E,t.convertArea=w,t.isNumber=b,t.isObject=I,t.validateBBox=N,t.validateId=C,t.getCoord=X,t.getCoords=U,t.containsNumber=Y,t.geojsonType=V,t.featureOf=H,t.collectionOf=W,t.getGeom=J,t.getGeomType=Z,t.getType=K,t.coordEach=S,t.coordReduce=M,t.propEach=L,t.propReduce=P,t.featureEach=O,t.featureReduce=R,t.coordAll=T,t.geomEach=A,t.geomReduce=D,t.flattenEach=F,t.flattenReduce=q,t.segmentEach=G,t.segmentReduce=B,t.lineEach=k,t.lineReduce=z,Object.defineProperty(t,"__esModule",{value:!0})}(e)}}]); //# sourceMappingURL=vendors.turf.js.map \ No newline at end of file diff --git a/src/components/Display.js b/src/components/Display.js index cbc9d1f..f583157 100644 --- a/src/components/Display.js +++ b/src/components/Display.js @@ -204,7 +204,7 @@ export default class Display extends HTMLElement { buildHRDFlooding(values) { console.log(values.data.attributes.neighborhood_name); - let validNeighborhoods = ['Cornerstone Village', 'Morningside', 'Chandler Park', 'Fox Creek', 'Riverbend', 'Morningside', 'West End', 'Midwest', 'Chadsey Condon', 'Claytown', 'North Corktown', 'Michigan-Martin', 'Aviation Sub', 'Garden View', 'Plymouth-I96', 'Plymouth-Hubbell', 'Paveway', 'We Care Community', 'Fiskhorn', 'Joy-Schaefer', 'Warrendale', 'Warren Ave Community', 'Barton-McFarland']; + let validNeighborhoods = ['Cornerstone Village', 'Morningside', 'Chandler Park', 'Fox Creek', 'Riverbend', 'Morningside', 'West End', 'Midwest', 'Chadsey Condon', 'Claytown', 'North Corktown', 'Michigan-Martin', 'Aviation Sub', 'Garden View', 'Plymouth-I96', 'Plymouth-Hubbell', 'Paveway', 'We Care Community', 'Fiskhorn', 'Joy-Schaefer', 'Warrendale', 'Warren Ave Community', 'Barton-McFarland', 'East Canfield']; let dataParsing = { title: "CDBG-DR Private Sewer Repair Program", content: null }; if (values && values.data.attributes.neighborhood_name) { if (validNeighborhoods.includes(values.data.attributes.neighborhood_name)) {