@panoramax/web-viewer 4.0.3-develop-05bbd331 → 4.0.3-develop-e6a52885

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build/index.js CHANGED
@@ -9,7 +9,7 @@
9
9
  * LICENSE file in the root directory of this source tree.
10
10
  *
11
11
  */
12
- !function(Qe,rt){"object"===typeof exports&&"object"===typeof module?module.exports=rt():"function"===typeof define&&define.amd?define("Panoramax",[],rt):"object"===typeof exports?exports.Panoramax=rt():Qe.Panoramax=rt()}(this,(()=>(()=>{var Qe={9039:(Qe,rt,Wn)=>{"use strict";Wn.d(rt,{A:()=>Basic});var Co=Wn(4542),Dl=Wn(5254),Ll=Wn(4964),Rl=Wn(8340),Ul=Wn(5995),Gl=Wn(7343),Zl=Wn(2614),Hl=Wn.n(Zl),ql=Wn(8330);Wn(1865),Wn(3638);class Basic extends Co.WF{constructor(){let Qe=arguments.length>0&&void 0!==arguments[0]&&arguments[0];super(),this.users=["geovisio"],this.mapstyle=this.getAttribute("mapstyle")||Rl.DEFAULT_TILES,this.lang=this.getAttribute("lang")||null,this.endpoint=this.getAttribute("endpoint")||null,this.picture=this.getAttribute("picture")||null,this.sequence=this.getAttribute("sequence")||null,console.info(`\ud83d\udcf7 Panoramax ${this.getClassName()} - Version ${ql.rE} (05bbd33)\n\n\ud83c\udd98 Issues can be reported at ${ql.Jk.O}`),Qe||(this._isInternetFast=null,(0,Gl.isInternetFast)().then((Qe=>this._isInternetFast=Qe)))}connectedCallback(){super.connectedCallback(),this._t=(0,Ll.getTranslations)(this.lang),this.loader=(0,Ul.createWebComp)("pnx-loader",{_parent:this,"no-label":(0,Gl.isInIframe)()}),this._loadsAPI&&this.endpoint&&this._loadsAPI===this.endpoint||this.api&&this.api._endpoint===this.endpoint||!this.endpoint||((this._loadsAPI||this.api)&&(delete this.api,delete this._loadsAPI),this._setupAPI())}_setupAPI(){if(this.loader=this.loader||(0,Ul.createWebComp)("pnx-loader",{_parent:this}),!this.endpoint)return void console.warn("No endpoint is defined");this._loadsAPI=this.endpoint;let Qe=this.endpoint;try{this.mapstyle=JSON.parse(this.mapstyle)}catch(Wn){}try{this.api=new Dl.A(this.endpoint,{users:this.users,fetch:this.fetchOptions,style:this.mapstyle}),this.api.onceReady().then((()=>{if(Qe!=this._loadsAPI||!this.api)return;let rt=this.api.getUnavailableFeatures(),Wn=this.api.getAvailableFeatures();Wn=0===rt.length?"\u2705 All features available":"\u2705 Available features: "+Wn.join(", "),rt=0===rt.length?"":"\ud83d\udeab Unavailable features: "+rt.join(", "),console.info(`\ud83c\udf10 Connected to API "${this.api._metadata.name}" (${this.api._endpoint})\n\u2139\ufe0f API runs STAC ${this.api._metadata.stac_version} ${this.api._metadata.geovisio_version?"& GeoVisio "+this.api._metadata.geovisio_version:""}\n ${Wn}\n ${rt}\n`.trim())})).catch((Qe=>this.loader.dismiss(Qe,this._t.pnx.error_api))).finally((()=>delete this._loadsAPI))}catch(Wn){var rt;delete this._loadsAPI,null!==(rt=this.loader)&&void 0!==rt&&rt.dismiss?this.loader.dismiss(Wn,this._t.pnx.error_api):console.error(Wn)}}onceReady(){throw new Error("You must override this method on sub-class")}onceAPIReady(){return this.api?this.api.onceReady():new Promise((Qe=>setTimeout(Qe,100))).then(this.onceAPIReady.bind(this))}createRenderRoot(){return this}attributeChangedCallback(Qe,rt,Wn){if(super.attributeChangedCallback(Qe,rt,Wn),"endpoint"===Qe&&(this._loadsAPI&&Wn&&this._loadsAPI===Wn||this.api&&this.api._endpoint===Wn||!Wn||((this._loadsAPI||this.api)&&(delete this.api,delete this._loadsAPI),this._setupAPI())),["picture","sequence"].includes(Qe)){let Co,Dl,Ll,Rl;"picture"===Qe?(Co=this.sequence,Ll=this.sequence,Dl=Wn,Rl=rt):(Co=Wn,Ll=rt,Dl=this.picture,Rl=this.picture),this.dispatchEvent(new CustomEvent("select",{bubbles:!0,composed:!0,detail:{seqId:Co,picId:Dl,prevSeqId:Ll,prevPicId:Rl}}))}}getClassName(){return"Basic"}select(){let Qe=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,rt=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;arguments.length>2&&void 0!==arguments[2]&&arguments[2]&&(this.picture=null,this.sequence=null),this.picture=rt,this.sequence=Qe}isWidthSmall(){return(null===this||void 0===this?void 0:this.offsetWidth)<576}isHeightSmall(){return(null===this||void 0===this?void 0:this.offsetHeight)<400}render(){return Co.qy`<p>Should not be used directly, use Viewer/CoverageMap/Editor instead</p>`}getSubComponentsNames(){return["loader","api"]}addEventListener(Qe,rt,Wn){let Co=Qe.split(":").shift();if(Co&&this.getSubComponentsNames().includes(Co)){var Dl;const Ll=Qe.substring(Co.length+1);null!==(Dl=this[Co])&&void 0!==Dl&&Dl.addEventListener?this[Co].addEventListener(Ll,rt,Wn):setTimeout((()=>this.addEventListener(Qe,rt,Wn)),50)}else super.addEventListener(Qe,rt,Wn)}static GetJSONConverter(){return{fromAttribute:Qe=>"object"===typeof Qe?Qe:Hl().parse(Qe),toAttribute:Qe=>JSON.stringify(Qe)}}}Basic.properties={picture:{type:String,reflect:!0},sequence:{type:String,reflect:!0},fetchOptions:{converter:Basic.GetJSONConverter()},users:{type:Array,reflect:!0},mapstyle:{type:String},lang:{type:String},endpoint:{type:String}}},153:(Qe,rt,Wn)=>{"use strict";Wn.d(rt,{A:()=>CoverageMap});var Co=Wn(9039),Dl=Wn(5642),Ll=Wn(8340),Rl=Wn(927),Ul=(Wn(7776),Wn(2118));class CoverageMap extends Co.A{constructor(){super(),this._mapContainer=document.createElement("div"),this.onceAPIReady().then((()=>{this.loader.setAttribute("value",30),this._initParams=new Ul.Ay(Ul.Ay.GetComponentProperties(CoverageMap,this)),this._initMap()}))}getClassName(){return"CoverageMap"}onceReady(){return this.map&&this.map.waitForEnoughMapLoaded?this.map.waitForEnoughMapLoaded():new Promise((Qe=>setTimeout(Qe,100))).then(this.onceReady.bind(this))}render(){return[this.loader,this._mapContainer]}getSubComponentsNames(){const Qe=super.getSubComponentsNames();return Qe.push("map"),Qe}_initMap(){class MyMap extends Dl.A{_getLayerStyleProperties(Qe){return"pictures_symbols"===Qe?{layout:{visibility:"none"}}:super._getLayerStyleProperties(Qe)}}this.map=new MyMap(this,this._mapContainer,Object.assign({},this._initParams.getMapInit(),{hash:!0})),this.map.addControl(new Rl.NavigationControl({showCompass:!1})),this.loader.setAttribute("value",70),this.addEventListener("select",this._onSelect.bind(this)),this.map.on("picture-click",(Qe=>this.select(Qe.seqId,Qe.picId))),this.map.on("sequence-click",(Qe=>this.select(Qe.seqId))),this.map.waitForEnoughMapLoaded().then((async()=>{await(0,Ul.mK)(this.map,this._initParams.getMapPostInit()),this.map.reloadLayersStyles(),this.loader.dismiss()}))}_onSelect(Qe){if(Qe.detail.picId||Qe.detail.seqId){const rt=Qe.detail.picId?"pictures":"sequences",Wn=this.map.queryRenderedFeatures({layers:[...this.map._userLayers].map((Qe=>(0,Ll.getUserLayerId)(Qe,rt))),filter:["==",["get","id"],Qe.detail.picId||Qe.detail.seqId]});Wn.length>=0&&null!=Wn[0]&&this.map._attachPreviewToPictures({features:Wn},rt)}}}CoverageMap.properties={map:{converter:Co.A.GetJSONConverter()},...Co.A.properties},customElements.define("pnx-coverage-map",CoverageMap)},1752:(Qe,rt,Wn)=>{"use strict";Wn.d(rt,{A:()=>Editor});Wn(7365);var Co=Wn(9039),Dl=Wn(5642),Ll=Wn(9048),Rl=(Wn(7534),Wn(6810),Wn(508)),Ul=Wn(8340),Gl=Wn(1545),Zl=(Wn(4542),Wn(5995));const Hl="sequence-headings";class Editor extends Co.A{constructor(){super(),this.raster=null,this.background="streets",this.users=[],this._psvContainer=document.createElement("div"),this._mapContainer=document.createElement("div"),this.onceAPIReady().then((()=>{this.loader.setAttribute("value",30),this.sequence||this.loader.dismiss({},"No sequence is selected"),this.addEventListener("select",this._onSelect.bind(this)),this._initPSV(),this._initMap()}))}getClassName(){return"Editor"}onceReady(){var Qe,rt;return this.map&&this.psv&&null!==(Qe=(rt=this.map).loaded)&&void 0!==Qe&&Qe.call(rt)?Promise.resolve():new Promise((Qe=>setTimeout(Qe,100))).then(this.onceReady.bind(this))}connectedCallback(){Array.isArray(this.users)&&this.users.length>0&&(console.warn("Parameters users can't be changed in Editor, only selected sequence can be visible"),this.users=[]),super.connectedCallback()}attributeChangedCallback(Qe,rt,Wn){"users"===Qe&&Array.isArray(Wn)&&Wn.length>0?console.warn("Parameters users can't be changed in Editor, only selected sequence can be visible"):super.attributeChangedCallback(Qe,rt,Wn)}render(){return[this.loader,this._psvContainer,this._mapContainer]}getSubComponentsNames(){return super.getSubComponentsNames().concat(["map","psv"])}_initPSV(){try{this.psv=new Ll.Ay(this,this._psvContainer),this.psv._myVTour.datasource.nodeResolver=this._getNode.bind(this)}catch(Qe){let rt=Gl.IJ.isWebGLSupported?this._t.pnx.error_psv:this._t.pnx.error_webgl;this.loader.dismiss(Qe,rt)}}_initMap(){try{this.map=new Dl.A(this,this._mapContainer,{raster:this.raster,background:this.background,supplementaryStyle:this._createMapStyle(),zoom:15}),(0,Ul.linkMapAndPhoto)(this),this.loader.setAttribute("value",50),this._loadSequence(),this.map.once("load",(()=>{this.map.hasTwoBackgrounds()&&this._addMapBackgroundWidget(),this._bindPicturesEvents()}));const Qe=this.map._picMarker.setRotation.bind(this.map._picMarker);this.map._picMarker.setRotation=rt=>(rt=void 0===this._lastRelHeading?rt:rt+this._lastRelHeading-this.psv.getPictureRelativeHeading(),Qe(rt))}catch(Qe){this.loader.dismiss(Qe,this._t.pnx.error_psv)}}_createMapStyle(){return{sources:{geovisio_editor_sequences:{type:"geojson",data:{type:"FeatureCollection",features:[]}}},layers:[{id:"geovisio_editor_sequences",type:"line",source:"geovisio_editor_sequences",layout:{...Ul.VECTOR_STYLES.SEQUENCES.layout},paint:{...Ul.VECTOR_STYLES.SEQUENCES.paint}},{id:"geovisio_editor_pictures",type:"circle",source:"geovisio_editor_sequences",layout:{...Ul.VECTOR_STYLES.PICTURES.layout},paint:{...Ul.VECTOR_STYLES.PICTURES.paint}}]}}_bindPicturesEvents(){this.map.on("mousemove","geovisio_editor_pictures",(()=>{this.map.getCanvas().style.cursor="pointer"})),this.map.on("mouseleave","geovisio_editor_pictures",(()=>{this.map.getCanvas().style.cursor=""})),this.map.on("click","geovisio_editor_pictures",this.map._onPictureClick.bind(this.map))}_loadSequence(){return this.loader.setAttribute("value",60),this.api.getSequenceItems(this.sequence).then((Qe=>{if(this.loader.setAttribute("value",80),this.map.once("sourcedata",(()=>{this.map.setPaintProperty("geovisio_editor_sequences","line-color",this.map._getLayerColorStyle("sequences")),this.map.setPaintProperty("geovisio_editor_pictures","circle-color",this.map._getLayerColorStyle("pictures")),this.map.setLayoutProperty("geovisio_editor_sequences","visibility","visible"),this.map.setLayoutProperty("geovisio_editor_pictures","visibility","visible"),this.map.once("styledata",(()=>this.loader.dismiss()))})),this._sequenceData=Qe.features,this.map.getSource("geovisio_editor_sequences").setData({type:"FeatureCollection",features:[{type:"Feature",properties:{id:this.sequence},geometry:{type:"LineString",coordinates:Qe.features.map((Qe=>Qe.geometry.coordinates))}},...Qe.features.map((Qe=>(Qe.properties.id=Qe.id,Qe.properties.sequences=[this.sequence],Qe)))]}),this.picture){const rt=Qe.features.find((Qe=>Qe.id===this.picture));rt?(this.select(this.sequence,this.picture,!0),this.map.jumpTo({center:rt.geometry.coordinates,zoom:18})):console.log("Picture with ID",rt,"was not found")}else{const rt=[...Qe.features[0].geometry.coordinates,...Qe.features[0].geometry.coordinates];for(let Wn=1;Wn<Qe.features.length;Wn++){const Co=Qe.features[Wn].geometry.coordinates;Co[0]<rt[0]&&(rt[0]=Co[0]),Co[1]<rt[1]&&(rt[1]=Co[1]),Co[0]>rt[2]&&(rt[2]=Co[0]),Co[1]>rt[3]&&(rt[3]=Co[1])}this.map.fitBounds(rt,{animate:!1})}})).catch((Qe=>this.loader.dismiss(Qe,this._t.pnx.error_api)))}_getNode(Qe){const rt=this._sequenceData.find((rt=>rt.properties.id===Qe)),Wn=rt?(0,Rl.apiFeatureToPSVNode)(rt,this._t,this._isInternetFast):null;return Wn&&delete Wn.links,Wn}_addMapBackgroundWidget(){const Qe=(0,Zl.createWebComp)("pnx-map-background",{_parent:this,size:"sm"});this._mapContainer.appendChild(Qe)}previewSequenceHeadingChange(Qe){const rt=void 0!==this.map.getLayer(Hl);if(this.map._picMarkerPreview.remove(),void 0===Qe)return delete this._lastRelHeading,rt&&this.map.setLayoutProperty(Hl,"visibility","none"),void(this.picture&&this.map._picMarker.setRotation(this.psv.getXY().x));this._lastRelHeading=Qe,rt||this.map.addLayer({id:Hl,type:"symbol",source:"geovisio_editor_sequences",layout:{"icon-image":"pnx-marker","icon-overlap":"always","icon-size":.8}});const Wn=-this.psv.getPictureRelativeHeading();this.map.setLayoutProperty(Hl,"visibility","visible"),this.map.setLayoutProperty(Hl,"icon-rotate",["+",["get","view:azimuth"],Wn,Qe]);const Co=[["==",["geometry-type"],"Point"]];this.picture&&Co.push(["!=",["get","id"],this.picture]),this.map.setFilter(Hl,["all",...Co]),this.picture&&this.map._picMarker.setRotation(this.psv.getXY().x)}_onSelect(){void 0!==this._lastRelHeading&&this.previewSequenceHeadingChange(this._lastRelHeading)}}Editor.properties={raster:{converter:Co.A.GetJSONConverter()},background:{type:String},...Co.A.properties},customElements.define("pnx-editor",Editor)},3407:(Qe,rt,Wn)=>{"use strict";Wn.d(rt,{A:()=>PhotoViewer});Wn(970);var Co=Wn(1545),Dl=Wn(4451),Ll=Wn(9039),Rl=Wn(9048),Ul=Wn(5995),Gl=Wn(7343),Zl=Wn(2118),Hl=Wn(4207);const ql=Math.PI/6;class PhotoViewer extends Ll.A{constructor(){super(),this.psv={},this["url-parameters"]=this.getAttribute("url-parameters")||!0,this.widgets=this.getAttribute("widgets")||"true",this.grid=(0,Ul.createWebComp)("pnx-cornered-grid"),this.psvContainer=document.createElement("div"),this.psvContainer.setAttribute("slot","bg"),this.grid.appendChild(this.psvContainer),this.popup=(0,Ul.createWebComp)("pnx-popup",{_parent:this,onclose:this._onPopupClose.bind(this)})}_createInitParamsHandler(){var Qe,rt;this._initParams=new Zl.Ay(Zl.Ay.GetComponentProperties(PhotoViewer,this),Object.assign({},null===(Qe=this.urlHandler)||void 0===Qe?void 0:Qe.currentURLParams(),null===(rt=this.urlHandler)||void 0===rt?void 0:rt.currentURLParams(!0)),{})}_initWidgets(){"false"!==this._initParams.getParentPostInit().widgets&&(this.grid.appendChild((0,Ul.createWebComp)("pnx-widget-player",{slot:"top",_parent:this,class:"pnx-only-psv pnx-print-hidden",size:this.isHeightSmall()?"md":"xl"})),this.isWidthSmall()?(this.legend=(0,Ul.createWebComp)("pnx-picture-legend",{_parent:this}),this.bottomDrawer=(0,Ul.createWebComp)("pnx-bottom-drawer",{slot:"bottom",_parent:this,class:this._initParams.getParentPostInit().picture?void 0:"pnx-hidden"}),this.bottomDrawer.appendChild(this.legend),this.grid.appendChild(this.bottomDrawer),this.addEventListener("select",(Qe=>{(0,Gl.isNullId)(Qe.detail.picId)?this.bottomDrawer.classList.add("pnx-hidden"):this.bottomDrawer.classList.remove("pnx-hidden")}))):(this.legend=(0,Ul.createWebComp)("pnx-widget-legend",{slot:this.isWidthSmall()?void 0:"top-left",_parent:this,focus:this._initParams.getParentPostInit().focus,picture:this._initParams.getParentPostInit().picture}),this.grid.appendChild((0,Ul.createWebComp)("pnx-widget-zoom",{slot:"bottom-right",class:"pnx-print-hidden",_parent:this})),this.grid.appendChild(this.legend),this.grid.appendChild((0,Ul.createWebComp)("pnx-hashtags",{slot:"top-right",_parent:this,class:"pnx-only-psv pnx-print-hidden"}))))}connectedCallback(){super.connectedCallback(),this.presetsManager=new Hl.A(this.lang),this["url-parameters"]&&"false"!==this["url-parameters"]&&(this.urlHandler=new Dl.A(this),this.onceReady().then((()=>{this.urlHandler.listenToChanges(),this.urlHandler._onParentChange()}))),this.onceAPIReady().then(this._postAPIInit.bind(this))}firstUpdated(){super.firstUpdated(),this._moveChildToGrid()}getClassName(){return"PhotoViewer"}onceReady(){return this.oncePSVReady().then((()=>this._initParams.getParentPostInit().picture&&!this.psv.getPictureMetadata()?this.onceFirstPicLoaded():Promise.resolve()))}render(){return[this.loader,this.grid,this.popup]}getSubComponentsNames(){return super.getSubComponentsNames().concat(["psv","grid","popup","urlHandler"])}oncePSVReady(){let Qe;return new Promise((rt=>{Qe=setInterval((()=>{this.psv&&"object"===typeof this.psv&&(this.psv.container?(clearInterval(Qe),rt()):this.psv.addEventListener&&this.psv.addEventListener("ready",(()=>{clearInterval(Qe),rt()}),{once:!0}))}),250)}))}onceFirstPicLoaded(){return this.oncePSVReady().then((()=>this.psv.getPictureMetadata()?Promise.resolve():new Promise((Qe=>{this.psv.addEventListener("picture-loaded",Qe,{once:!0})}))))}async _postAPIInit(){this.loader.setAttribute("value",30),this._createInitParamsHandler();const Qe=this._initParams.getParentPostInit();this._initPSV(),this._initWidgets(),(0,Zl.ai)(this,Qe),this._handleKeyboardManagement(),Qe.picture?this.psv.addEventListener("picture-loaded",(()=>this.loader.dismiss()),{once:!0}):this.loader.dismiss()}_initPSV(){try{this.psv=new Rl.Ay(this,this.psvContainer,{shouldGoFast:this._psvShouldGoFast.bind(this),keyboard:"always",keyboardActions:{...Co.zY.keyboardActions,8:"ROTATE_UP",2:"ROTATE_DOWN",4:"ROTATE_LEFT",6:"ROTATE_RIGHT",PageUp:()=>this.psv.goToNextPicture(),9:()=>this.psv.goToNextPicture(),PageDown:()=>this.psv.goToPrevPicture(),3:()=>this.psv.goToPrevPicture(),5:()=>this.moveCenter(),"*":()=>this.moveCenter(),Home:()=>this._toggleFocus(),7:()=>this._toggleFocus(),End:()=>this.mini.toggleAttribute("collapsed"),1:()=>this.mini.toggleAttribute("collapsed")," ":()=>this.psv.toggleSequencePlaying(),0:()=>this.psv.toggleSequencePlaying()},...this._initParams.getPSVInit()}),this.oncePSVReady().then((()=>{this.loader.setAttribute("value",50),(0,Zl.Vy)(this.psv,this._initParams.getPSVPostInit())}))}catch(Qe){let rt=Co.IJ.isWebGLSupported?this._t.pnx.error_psv:this._t.pnx.error_webgl;this.loader.dismiss(Qe,rt)}}_handleKeyboardManagement(){const keytonone=()=>this.psv.stopKeyboardControl(),keytopsv=()=>this.psv.startKeyboardControl();this.popup.addEventListener("open",(()=>keytonone())),this.popup.addEventListener("close",(()=>keytopsv()));for(let Qe of this.grid.childNodes)"bg"!==Qe.getAttribute("slot")&&(Qe.addEventListener("focusin",(()=>keytonone())),Qe.addEventListener("focusout",(()=>{null===this.popup.getAttribute("visible")&&keytopsv()})))}_psvShouldGoFast(){return this.psv._sequencePlaying&&this.psv.getTransitionDuration()<1e3}_moveChildToGrid(){Array.from(this.querySelectorAll("[slot]")).forEach((Qe=>{var rt;null!==(rt=Qe.tagName)&&void 0!==rt&&rt.toLowerCase().startsWith("pnx-")&&(Qe._parent=this,Qe._t=this._t),"editors"===Qe.getAttribute("slot")?this.onceReady().then((()=>{var rt;return null===(rt=this.legend)||void 0===rt?void 0:rt.appendChild(Qe)})):this.grid.appendChild(Qe)}))}setPopup(Qe){let rt=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;Qe?this.popup.setAttribute("visible",""):this.popup.removeAttribute("visible"),this.popup.innerHTML="","string"===typeof rt?this.popup.innerHTML=rt:Array.isArray(rt)&&rt.forEach((Qe=>this.popup.appendChild(Qe)))}_onPopupClose(){this.dispatchEvent(new CustomEvent("focus-changed",{detail:{focus:this.map&&this.isMapWide()?"map":"pic"}}))}_showQualityScoreDoc(){this.setPopup(!0,[(0,Ul.createWebComp)("pnx-quality-score-doc",{_t:this._t})])}_showReportForm(){if(!this.psv.getPictureMetadata())throw new Error("No picture currently selected");this.setPopup(!0,[(0,Ul.createWebComp)("pnx-report-form",{_parent:this})])}_showShareOptions(){this.setPopup(!0,[(0,Ul.createWebComp)("pnx-share-menu",{_parent:this})])}moveCenter(){this.psv.getPictureMetadata()&&this._psvAnimate({speed:Rl.LM,yaw:0,pitch:0,zoom:Rl.cS})}moveLeft(){this._moveToDirection("left")}moveRight(){this._moveToDirection("right")}moveUp(){this._moveToDirection("up")}moveDown(){this._moveToDirection("down")}_moveToDirection(Qe){let rt=this.psv.getPosition();switch(Qe){case"up":rt.pitch+=ql;break;case"left":rt.yaw-=ql;break;case"down":rt.pitch-=ql;break;case"right":rt.yaw+=ql}this._psvAnimate({speed:Rl.LM,...rt})}_psvAnimate(Qe){this._lastPsvAnim&&this._lastPsvAnim.cancel(),this._lastPsvAnim=this.psv.animate(Qe)}addEventListener(Qe,rt,Wn){super.addEventListener(Qe,rt,Wn)}}PhotoViewer.properties={psv:{converter:Ll.A.GetJSONConverter()},widgets:{type:String},"url-parameters":{type:String},...Ll.A.properties},customElements.define("pnx-photo-viewer",PhotoViewer)},8743:(Qe,rt,Wn)=>{"use strict";Wn.d(rt,{$:()=>Ql,A:()=>Viewer});Wn(9616);var Co=Wn(8340),Dl=Wn(3407),Ll=(Wn(9039),Wn(2771)),Rl=Wn(7343),Ul=Wn(5995),Gl=Wn(9683),Zl=Wn(2e3),Hl=Wn(9438),ql=Wn(2118);const Ql=20,Kl=(Math.PI,100);class Viewer extends Dl.A{constructor(){super(),this.map=!0,this.geocoder=this.getAttribute("geocoder")||"nominatim",this.mini=(0,Ul.createWebComp)("pnx-mini",{slot:"bottom-left",_parent:this,onexpand:this._onMiniExpand.bind(this),collapsed:!!(0,Rl.isNullId)(this.picture)||void 0}),this.mini.addEventListener("expand",this._toggleFocus.bind(this)),this.grid.appendChild(this.mini),this.mapContainer=document.createElement("div")}_createInitParamsHandler(){var Qe,rt;this._initParams=new ql.Ay(ql.Ay.GetComponentProperties(Viewer,this),Object.assign({},null===(Qe=this.urlHandler)||void 0===Qe?void 0:Qe.currentURLParams(),null===(rt=this.urlHandler)||void 0===rt?void 0:rt.currentURLParams(!0)),{map:(0,Co.getMapParamsFromLocalStorage)()})}_initWidgets(){var Qe,rt;"false"!==this._initParams.getParentPostInit().widgets&&(this.grid.appendChild((0,Ul.createWebComp)("pnx-widget-zoom",{slot:this.isWidthSmall()?"top-left":"bottom-right",class:this.isWidthSmall()?"pnx-only-map pnx-print-hidden":"pnx-print-hidden",_parent:this})),this.isWidthSmall()?(this.legend=(0,Ul.createWebComp)("pnx-picture-legend",{_parent:this}),this.bottomDrawer=(0,Ul.createWebComp)("pnx-bottom-drawer",{slot:"bottom",_parent:this,class:this._initParams.getParentPostInit().picture?void 0:"pnx-hidden"}),this.bottomDrawer.appendChild(this.legend),this.grid.appendChild(this.bottomDrawer),this.addEventListener("select",(Qe=>{(0,Rl.isNullId)(Qe.detail.picId)?this.bottomDrawer.classList.add("pnx-hidden"):this.bottomDrawer.classList.remove("pnx-hidden")}))):(this.legend=(0,Ul.createWebComp)("pnx-widget-legend",{slot:this.isWidthSmall()?"top":"top-left",_parent:this,focus:this._initParams.getParentPostInit().focus,picture:this._initParams.getParentPostInit().picture}),this.grid.appendChild(this.legend),this.grid.appendChild((0,Ul.createWebComp)("pnx-hashtags",{slot:"top-right",_parent:this,class:"pnx-only-psv pnx-print-hidden"}))),this.grid.appendChild((0,Ul.createWebComp)("pnx-widget-player",{slot:"top",_parent:this,class:"pnx-only-psv pnx-print-hidden",size:this.isHeightSmall()?"md":"xl"})),this.grid.appendChild((0,Ul.createWebComp)("pnx-widget-geosearch",{slot:this.isWidthSmall()?"top-right":"top-left",_parent:this,class:"pnx-only-map pnx-print-hidden",geocoder:this._initParams.getParentPostInit().geocoder})),this.grid.appendChild((0,Ul.createWebComp)("pnx-widget-mapfilters",{slot:this.isWidthSmall()?"top-right":"top-left",_parent:this,"user-search":null!==this.api._endpoints.user_search&&null!==this.api._endpoints.user_tiles,"quality-score":(null===(Qe=this.map)||void 0===Qe||null===(rt=Qe._hasQualityScore)||void 0===rt?void 0:rt.call(Qe))||!1,class:"pnx-only-map pnx-print-hidden"})),this.grid.appendChild((0,Ul.createWebComp)("pnx-widget-maplayers",{slot:"top-right",_parent:this,class:"pnx-only-map pnx-print-hidden"})))}getClassName(){return"Viewer"}getSubComponentsNames(){return super.getSubComponentsNames().concat(["mini","map"])}onceReady(){return Promise.all([this.oncePSVReady(),this.onceMapReady()]).then((()=>this._initParams.getParentPostInit().picture&&!this.psv.getPictureMetadata()?this.onceFirstPicLoaded():Promise.resolve()))}attributeChangedCallback(Qe,rt,Wn){var Co,Dl,Ll,Ul;(super.attributeChangedCallback(Qe,rt,Wn),"picture"===Qe)&&(null===(Co=this.legend)||void 0===Co||null===(Dl=Co.setAttribute)||void 0===Dl||Dl.call(Co,"picture",Wn),(0,Rl.isNullId)(rt)&&!(0,Rl.isNullId)(Wn)&&this.mini.removeAttribute("collapsed"),(0,Rl.isNullId)(Wn)?this.map&&this.isMapWide()?this.mini.classList.add("pnx-hidden"):this.map&&!this.isMapWide()&&this._setFocus("map"):(this.mini.classList.remove("pnx-hidden"),(0,Rl.isNullId)(rt)&&(this._setFocus("pic"),"closed"===(null===(Ll=this.bottomDrawer)||void 0===Ll||null===(Ul=Ll.getAttribute)||void 0===Ul?void 0:Ul.call(Ll,"openness"))&&this.bottomDrawer.setAttribute("openness","half-opened"))));"focus"===Qe&&this._setFocus(Wn)}onceMapReady(){if(!this.map)return Promise.resolve();let Qe;return new Promise((rt=>{Qe=setInterval((()=>{var Wn,Co,Dl;"object"===typeof this.map&&(null!==(Wn=this.map)&&void 0!==Wn&&null!==(Co=Wn.loaded)&&void 0!==Co&&Co.call(Wn)?(clearInterval(Qe),rt()):null!==(Dl=this.map)&&void 0!==Dl&&Dl.once&&this.map.once("render",(()=>{clearInterval(Qe),rt()})))}),250)}))}async _initMap(){await new Promise((Qe=>{this.map=new Ll.A(this,this.mapContainer,this._initParams.getMapInit()),(0,Co.saveMapParamsToLocalStorage)(this.map),this.map.once("users-changed",(()=>{this.loader.setAttribute("value",75),Qe()}))})),await(0,ql.mK)(this.map,this._initParams.getMapPostInit()),(0,Co.initMapKeyboardHandler)(this),(0,Co.linkMapAndPhoto)(this)}async _postAPIInit(){this.loader.setAttribute("value",30),this._createInitParamsHandler();const Qe=this._initParams.getParentPostInit();this._initPSV(),await this._initMap(),this._initWidgets(),this._moveChildToGrid(),(0,ql.iz)(this,Qe),this._handleKeyboardManagement(),Qe.picture?this.psv.addEventListener("picture-loaded",(()=>{(0,ql.iz)(this,Qe),this.loader.dismiss()}),{once:!0}):this.loader.dismiss()}_handleKeyboardManagement(){const keytomap=()=>{this.psv.stopKeyboardControl(),this.map.keyboard.enable()},keytopsv=()=>{this.psv.startKeyboardControl(),this.map.keyboard.disable()},keytonone=()=>{this.psv.stopKeyboardControl(),this.map.keyboard.disable()},keytofocused=()=>{this.map&&this.isMapWide()?keytomap():keytopsv()};this.addEventListener("focus-changed",(Qe=>{"map"===Qe.detail.focus&&keytomap(),this.popup.getAttribute("visible")?keytonone():keytopsv()})),this.popup.addEventListener("open",(()=>keytonone())),this.popup.addEventListener("close",(()=>keytofocused()));for(let Qe of this.grid.childNodes)"bg"!==Qe.getAttribute("slot")&&(Qe.addEventListener("focusin",(()=>keytonone())),Qe.addEventListener("focusout",(()=>{null===this.popup.getAttribute("visible")&&keytofocused()})))}moveCenter(){const Qe=this.psv.getPictureMetadata();Qe&&(this.map&&this.isMapWide()?this.map.flyTo({center:Qe.gps,zoom:20}):super.moveCenter())}_moveToDirection(Qe){if(this.map&&this.isMapWide()){let rt;switch(Qe){case"up":rt=[0,-100];break;case"left":rt=[-100,0];break;case"down":rt=[0,Kl];break;case"right":rt=[Kl,0]}this.map.panBy(rt)}else super._moveToDirection(Qe)}isMapWide(){return this.mapContainer.parentNode==this.grid}_setFocus(Qe){var rt,Wn,Co,Dl;let Ll=arguments.length>1&&void 0!==arguments[1]&&arguments[1],Hl=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if("map"===Qe&&!this.map)throw new Error("Map is not enabled");if(!["map","pic"].includes(Qe))throw new Error("Invalid focus value (should be pic or map)");if(this.focus=Qe,(Hl||("map"!==Qe||!this.map||!this.isMapWide())&&("pic"!==Qe||this.map&&this.isMapWide()))&&("map"===Qe?(this.psvContainer.parentNode==this.grid&&(this.grid.removeChild(this.psvContainer),this.psvContainer.removeAttribute("slot")),this.mapContainer.parentNode==this.mini&&this.mini.removeChild(this.mapContainer),this.mapContainer.setAttribute("slot","bg"),this.grid.appendChild(this.mapContainer),this.mini.appendChild(this.psvContainer),this.mini.icon=(0,Ul.fa)(Gl.pt),(0,Rl.isNullId)(this.picture)?this.mini.classList.add("pnx-hidden"):this.mini.classList.remove("pnx-hidden"),this.map.getCanvas().focus()):(this.mapContainer.parentNode==this.grid&&(this.grid.removeChild(this.mapContainer),this.mapContainer.removeAttribute("slot")),this.psvContainer.parentNode==this.mini&&this.mini.removeChild(this.psvContainer),this.psvContainer.setAttribute("slot","bg"),this.grid.appendChild(this.psvContainer),this.mini.classList.remove("pnx-hidden"),this.mini.appendChild(this.mapContainer),this.mini.icon=(0,Ul.fa)(Zl.e5),this.psvContainer.focus()),null===this||void 0===this||null===(rt=this.map)||void 0===rt||null===(Wn=rt.resize)||void 0===Wn||Wn.call(rt),this.psv.autoSize(),this.psv.forceRefresh(),null===(Co=this.legend)||void 0===Co||null===(Dl=Co.setAttribute)||void 0===Dl||Dl.call(Co,"focus",this.focus),!Ll)){const rt=new CustomEvent("focus-changed",{detail:{focus:Qe}});this.dispatchEvent(rt)}}_toggleFocus(){this._setFocus(this.isMapWide()?"pic":"map")}_onMiniExpand(){this.map.resize(),this.psv.autoSize()}_onMapFiltersChange(){var Qe;const rt=(0,Hl.qi)("#pnx-map-filters-menu"),Wn=null===rt||void 0===rt?void 0:rt.shadowRoot.getElementById("pnx-filter-date-from"),Co=null===rt||void 0===rt?void 0:rt.shadowRoot.getElementById("pnx-filter-date-end"),Dl=null===rt||void 0===rt?void 0:rt.shadowRoot.querySelectorAll("input[name='pnx-filter-type']"),Ll=(0,Hl.qi)("#pnx-map-theme");let Rl="";for(let Zl=0;Zl<Dl.length;Zl++){const Qe=Dl[Zl];if(Qe.checked){Rl=Qe.value;break}}let Ul=[];if(null!==(Qe=this.map)&&void 0!==Qe&&Qe._hasQualityScore()){const Qe=null===rt||void 0===rt?void 0:rt.shadowRoot.getElementById("pnx-filter-qualityscore");Ul=((null===Qe||void 0===Qe?void 0:Qe.grade)||"").split(",").map((Qe=>parseInt(Qe))).filter((Qe=>!isNaN(Qe))),5==Ul.length&&(Ul=[])}const Gl={minDate:null===Wn||void 0===Wn?void 0:Wn.value,maxDate:null===Co||void 0===Co?void 0:Co.value,pic_type:Rl,theme:null===Ll||void 0===Ll?void 0:Ll.value,qualityscore:Ul};this.map.setFilters(Gl)}}Viewer.properties={map:{converter:Dl.A.GetJSONConverter()},focus:{type:String,reflect:!0},geocoder:{type:String},...Dl.A.properties},customElements.define("pnx-viewer",Viewer)},3921:(Qe,rt,Wn)=>{"use strict";Wn.r(rt),Wn.d(rt,{Basic:()=>Co.A,CoverageMap:()=>Dl.A,Editor:()=>Ll.A,PhotoViewer:()=>Ul.A,Viewer:()=>Rl.A});var Co=Wn(9039),Dl=Wn(153),Ll=Wn(1752),Rl=Wn(8743),Ul=Wn(3407)},9341:(Qe,rt,Wn)=>{"use strict";Wn.r(rt),Wn.d(rt,{core:()=>Co,layout:()=>Dl,menus:()=>Ll,ui:()=>Rl});var Co=Wn(3921),Dl=Wn(456),Ll=Wn(8794),Rl=Wn(9472)},6784:(Qe,rt,Wn)=>{"use strict";Wn.d(rt,{A:()=>BottomDrawer});var Co=Wn(4542),Dl=Wn(1198);const Ll={opened:0,"half-opened":.7,closed:1};class BottomDrawer extends Co.WF{constructor(){super(),this._isDragging=!1,this.openness="half-opened"}firstUpdated(){var Qe;super.firstUpdated(),this._boundTouchMove=this._onTouchMove.bind(this),this._boundTouchEnd=this._onTouchEnd.bind(this),this._drawerHeight=window.innerHeight-30;const rt=this._getDrawer();rt&&(rt.style.height=`${this._drawerHeight}px`,rt.style.maxHeight=`${this._drawerHeight}px`,null===(Qe=this._parent)||void 0===Qe||Qe.onceReady().then((()=>{var Qe,rt;null===(Qe=this._parent.map)||void 0===Qe||Qe.addEventListener("click",(()=>this.openness="closed")),null===(rt=this._parent.psv)||void 0===rt||rt.addEventListener("click",(()=>this.openness="closed"))})))}attributeChangedCallback(Qe,rt,Wn){if(super.attributeChangedCallback(Qe,rt,Wn),"openness"===Qe){if("opened"!==Wn){const Qe=this.shadowRoot.querySelector(".content");Qe&&(Qe.scrollTop=0)}const Qe=this._getDrawer();Qe&&(Qe.style.transform=null)}}disconnectedCallback(){super.disconnectedCallback(),this._cleanupTouchListeners()}_getDrawer(){var Qe;return null===(Qe=this.shadowRoot)||void 0===Qe?void 0:Qe.querySelector(".drawer")}_onHandleClick(){"opened"===this.openness?this.openness="closed":"half-opened"===this.openness?this.openness="opened":"closed"===this.openness&&(this.openness="half-opened")}_onTouchStart(Qe){this._isDragging=!0,this._startFingerY=Qe.touches[0].clientY,this._deltaFingerY=0,this._drawerY=this._drawerHeight*Ll[this.openness],window.addEventListener("touchmove",this._boundTouchMove,{passive:!0}),window.addEventListener("touchend",this._boundTouchEnd),window.addEventListener("touchcancel",this._boundTouchEnd)}_onTouchMove(Qe){if(!this._isDragging)return;const rt=this.shadowRoot.querySelector(".content");rt.scrollHeight>rt.offsetHeight&&rt.scrollTop>0?this._updateDrawerTransform(0):(this._deltaFingerY=Qe.touches[0].clientY-this._startFingerY,this._updateDrawerTransform(this._drawerY+this._deltaFingerY))}_onTouchEnd(Qe){(this._isDragging&&!(Math.abs(this._deltaFingerY)<30)||Qe.target.closest(".handle"))&&(Qe.preventDefault(),this._isDragging=!1,0===this._deltaFingerY&&"closed"===this.openness?this.openness="half-opened":this._updateDrawerTransform(this._drawerY+this._deltaFingerY,!0),this._cleanupTouchListeners(),this._startFingerY=null,this._deltaFingerY=null)}_cleanupTouchListeners(){window.removeEventListener("touchmove",this._boundTouchMove),window.removeEventListener("touchend",this._boundTouchEnd),window.removeEventListener("touchcancel",this._boundTouchCancel)}_updateDrawerTransform(Qe){let rt=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const Wn=this._getDrawer();Wn&&(Qe=Math.max(0,Math.min(Qe,this._drawerHeight-30)),rt&&(this._deltaFingerY<0?"closed"===this.openness?Math.abs(this._deltaFingerY)>this._drawerHeight*(1-Ll["half-opened"])?this.openness="opened":this.openness="half-opened":this.openness="opened":this.openness="closed",this._drawerY=null,Qe=Math.max(0,Math.min(Ll[this.openness]*this._drawerHeight,this._drawerHeight-30))),Wn.style.transform=`translateY(${Qe}px)`)}render(){const Qe={drawer:!0,[this.openness]:!0,dragging:this._isDragging};return Co.qy`
12
+ !function(Qe,rt){"object"===typeof exports&&"object"===typeof module?module.exports=rt():"function"===typeof define&&define.amd?define("Panoramax",[],rt):"object"===typeof exports?exports.Panoramax=rt():Qe.Panoramax=rt()}(this,(()=>(()=>{var Qe={9039:(Qe,rt,Wn)=>{"use strict";Wn.d(rt,{A:()=>Basic});var Co=Wn(4542),Dl=Wn(5254),Ll=Wn(4964),Rl=Wn(8340),Ul=Wn(5995),Gl=Wn(7343),Zl=Wn(2614),Hl=Wn.n(Zl),ql=Wn(8330);Wn(1865),Wn(3638);class Basic extends Co.WF{constructor(){let Qe=arguments.length>0&&void 0!==arguments[0]&&arguments[0];super(),this.users=["geovisio"],this.mapstyle=this.getAttribute("mapstyle")||Rl.DEFAULT_TILES,this.lang=this.getAttribute("lang")||null,this.endpoint=this.getAttribute("endpoint")||null,this.picture=this.getAttribute("picture")||null,this.sequence=this.getAttribute("sequence")||null,console.info(`\ud83d\udcf7 Panoramax ${this.getClassName()} - Version ${ql.rE} (e6a5288)\n\n\ud83c\udd98 Issues can be reported at ${ql.Jk.O}`),Qe||(this._isInternetFast=null,(0,Gl.isInternetFast)().then((Qe=>this._isInternetFast=Qe)))}connectedCallback(){super.connectedCallback(),this._t=(0,Ll.getTranslations)(this.lang),this.loader=(0,Ul.createWebComp)("pnx-loader",{_parent:this,"no-label":(0,Gl.isInIframe)()}),this._loadsAPI&&this.endpoint&&this._loadsAPI===this.endpoint||this.api&&this.api._endpoint===this.endpoint||!this.endpoint||((this._loadsAPI||this.api)&&(delete this.api,delete this._loadsAPI),this._setupAPI())}_setupAPI(){if(this.loader=this.loader||(0,Ul.createWebComp)("pnx-loader",{_parent:this}),!this.endpoint)return void console.warn("No endpoint is defined");this._loadsAPI=this.endpoint;let Qe=this.endpoint;try{this.mapstyle=JSON.parse(this.mapstyle)}catch(Wn){}try{this.api=new Dl.A(this.endpoint,{users:this.users,fetch:this.fetchOptions,style:this.mapstyle}),this.api.onceReady().then((()=>{if(Qe!=this._loadsAPI||!this.api)return;let rt=this.api.getUnavailableFeatures(),Wn=this.api.getAvailableFeatures();Wn=0===rt.length?"\u2705 All features available":"\u2705 Available features: "+Wn.join(", "),rt=0===rt.length?"":"\ud83d\udeab Unavailable features: "+rt.join(", "),console.info(`\ud83c\udf10 Connected to API "${this.api._metadata.name}" (${this.api._endpoint})\n\u2139\ufe0f API runs STAC ${this.api._metadata.stac_version} ${this.api._metadata.geovisio_version?"& GeoVisio "+this.api._metadata.geovisio_version:""}\n ${Wn}\n ${rt}\n`.trim())})).catch((Qe=>this.loader.dismiss(Qe,this._t.pnx.error_api))).finally((()=>delete this._loadsAPI))}catch(Wn){var rt;delete this._loadsAPI,null!==(rt=this.loader)&&void 0!==rt&&rt.dismiss?this.loader.dismiss(Wn,this._t.pnx.error_api):console.error(Wn)}}onceReady(){throw new Error("You must override this method on sub-class")}onceAPIReady(){return this.api?this.api.onceReady():new Promise((Qe=>setTimeout(Qe,100))).then(this.onceAPIReady.bind(this))}createRenderRoot(){return this}attributeChangedCallback(Qe,rt,Wn){if(super.attributeChangedCallback(Qe,rt,Wn),"endpoint"===Qe&&(this._loadsAPI&&Wn&&this._loadsAPI===Wn||this.api&&this.api._endpoint===Wn||!Wn||((this._loadsAPI||this.api)&&(delete this.api,delete this._loadsAPI),this._setupAPI())),["picture","sequence"].includes(Qe)){let Co,Dl,Ll,Rl;"picture"===Qe?(Co=this.sequence,Ll=this.sequence,Dl=Wn,Rl=rt):(Co=Wn,Ll=rt,Dl=this.picture,Rl=this.picture),this.dispatchEvent(new CustomEvent("select",{bubbles:!0,composed:!0,detail:{seqId:Co,picId:Dl,prevSeqId:Ll,prevPicId:Rl}}))}}getClassName(){return"Basic"}select(){let Qe=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,rt=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;arguments.length>2&&void 0!==arguments[2]&&arguments[2]&&(this.picture=null,this.sequence=null),this.picture=rt,this.sequence=Qe}isWidthSmall(){return(null===this||void 0===this?void 0:this.offsetWidth)<576}isHeightSmall(){return(null===this||void 0===this?void 0:this.offsetHeight)<400}render(){return Co.qy`<p>Should not be used directly, use Viewer/CoverageMap/Editor instead</p>`}getSubComponentsNames(){return["loader","api"]}addEventListener(Qe,rt,Wn){let Co=Qe.split(":").shift();if(Co&&this.getSubComponentsNames().includes(Co)){var Dl;const Ll=Qe.substring(Co.length+1);null!==(Dl=this[Co])&&void 0!==Dl&&Dl.addEventListener?this[Co].addEventListener(Ll,rt,Wn):setTimeout((()=>this.addEventListener(Qe,rt,Wn)),50)}else super.addEventListener(Qe,rt,Wn)}static GetJSONConverter(){return{fromAttribute:Qe=>"object"===typeof Qe?Qe:Hl().parse(Qe),toAttribute:Qe=>JSON.stringify(Qe)}}}Basic.properties={picture:{type:String,reflect:!0},sequence:{type:String,reflect:!0},fetchOptions:{converter:Basic.GetJSONConverter()},users:{type:Array,reflect:!0},mapstyle:{type:String},lang:{type:String},endpoint:{type:String}}},153:(Qe,rt,Wn)=>{"use strict";Wn.d(rt,{A:()=>CoverageMap});var Co=Wn(9039),Dl=Wn(5642),Ll=Wn(8340),Rl=Wn(927),Ul=(Wn(7776),Wn(2118));class CoverageMap extends Co.A{constructor(){super(),this._mapContainer=document.createElement("div"),this.onceAPIReady().then((()=>{this.loader.setAttribute("value",30),this._initParams=new Ul.Ay(Ul.Ay.GetComponentProperties(CoverageMap,this)),this._initMap()}))}getClassName(){return"CoverageMap"}onceReady(){return this.map&&this.map.waitForEnoughMapLoaded?this.map.waitForEnoughMapLoaded():new Promise((Qe=>setTimeout(Qe,100))).then(this.onceReady.bind(this))}render(){return[this.loader,this._mapContainer]}getSubComponentsNames(){const Qe=super.getSubComponentsNames();return Qe.push("map"),Qe}_initMap(){class MyMap extends Dl.A{_getLayerStyleProperties(Qe){return"pictures_symbols"===Qe?{layout:{visibility:"none"}}:super._getLayerStyleProperties(Qe)}}this.map=new MyMap(this,this._mapContainer,Object.assign({},this._initParams.getMapInit(),{hash:!0})),this.map.addControl(new Rl.NavigationControl({showCompass:!1})),this.loader.setAttribute("value",70),this.addEventListener("select",this._onSelect.bind(this)),this.map.on("picture-click",(Qe=>this.select(Qe.seqId,Qe.picId))),this.map.on("sequence-click",(Qe=>this.select(Qe.seqId))),this.map.waitForEnoughMapLoaded().then((async()=>{await(0,Ul.mK)(this.map,this._initParams.getMapPostInit()),this.map.reloadLayersStyles(),this.loader.dismiss()}))}_onSelect(Qe){if(Qe.detail.picId||Qe.detail.seqId){const rt=Qe.detail.picId?"pictures":"sequences",Wn=this.map.queryRenderedFeatures({layers:[...this.map._userLayers].map((Qe=>(0,Ll.getUserLayerId)(Qe,rt))),filter:["==",["get","id"],Qe.detail.picId||Qe.detail.seqId]});Wn.length>=0&&null!=Wn[0]&&this.map._attachPreviewToPictures({features:Wn},rt)}}}CoverageMap.properties={map:{converter:Co.A.GetJSONConverter()},...Co.A.properties},customElements.define("pnx-coverage-map",CoverageMap)},1752:(Qe,rt,Wn)=>{"use strict";Wn.d(rt,{A:()=>Editor});Wn(7365);var Co=Wn(9039),Dl=Wn(5642),Ll=Wn(9048),Rl=(Wn(7534),Wn(6810),Wn(508)),Ul=Wn(8340),Gl=Wn(1545),Zl=(Wn(4542),Wn(5995));const Hl="sequence-headings";class Editor extends Co.A{constructor(){super(),this.raster=null,this.background="streets",this.users=[],this._psvContainer=document.createElement("div"),this._mapContainer=document.createElement("div"),this.onceAPIReady().then((()=>{this.loader.setAttribute("value",30),this.sequence||this.loader.dismiss({},"No sequence is selected"),this.addEventListener("select",this._onSelect.bind(this)),this._initPSV(),this._initMap()}))}getClassName(){return"Editor"}onceReady(){var Qe,rt;return this.map&&this.psv&&null!==(Qe=(rt=this.map).loaded)&&void 0!==Qe&&Qe.call(rt)?Promise.resolve():new Promise((Qe=>setTimeout(Qe,100))).then(this.onceReady.bind(this))}connectedCallback(){Array.isArray(this.users)&&this.users.length>0&&(console.warn("Parameters users can't be changed in Editor, only selected sequence can be visible"),this.users=[]),super.connectedCallback()}attributeChangedCallback(Qe,rt,Wn){"users"===Qe&&Array.isArray(Wn)&&Wn.length>0?console.warn("Parameters users can't be changed in Editor, only selected sequence can be visible"):super.attributeChangedCallback(Qe,rt,Wn)}render(){return[this.loader,this._psvContainer,this._mapContainer]}getSubComponentsNames(){return super.getSubComponentsNames().concat(["map","psv"])}_initPSV(){try{this.psv=new Ll.Ay(this,this._psvContainer),this.psv._myVTour.datasource.nodeResolver=this._getNode.bind(this)}catch(Qe){let rt=Gl.IJ.isWebGLSupported?this._t.pnx.error_psv:this._t.pnx.error_webgl;this.loader.dismiss(Qe,rt)}}_initMap(){try{this.map=new Dl.A(this,this._mapContainer,{raster:this.raster,background:this.background,supplementaryStyle:this._createMapStyle(),zoom:15}),(0,Ul.linkMapAndPhoto)(this),this.loader.setAttribute("value",50),this._loadSequence(),this.map.once("load",(()=>{this.map.hasTwoBackgrounds()&&this._addMapBackgroundWidget(),this._bindPicturesEvents()}));const Qe=this.map._picMarker.setRotation.bind(this.map._picMarker);this.map._picMarker.setRotation=rt=>(rt=void 0===this._lastRelHeading?rt:rt+this._lastRelHeading-this.psv.getPictureRelativeHeading(),Qe(rt))}catch(Qe){this.loader.dismiss(Qe,this._t.pnx.error_psv)}}_createMapStyle(){return{sources:{geovisio_editor_sequences:{type:"geojson",data:{type:"FeatureCollection",features:[]}}},layers:[{id:"geovisio_editor_sequences",type:"line",source:"geovisio_editor_sequences",layout:{...Ul.VECTOR_STYLES.SEQUENCES.layout},paint:{...Ul.VECTOR_STYLES.SEQUENCES.paint}},{id:"geovisio_editor_pictures",type:"circle",source:"geovisio_editor_sequences",layout:{...Ul.VECTOR_STYLES.PICTURES.layout},paint:{...Ul.VECTOR_STYLES.PICTURES.paint}}]}}_bindPicturesEvents(){this.map.on("mousemove","geovisio_editor_pictures",(()=>{this.map.getCanvas().style.cursor="pointer"})),this.map.on("mouseleave","geovisio_editor_pictures",(()=>{this.map.getCanvas().style.cursor=""})),this.map.on("click","geovisio_editor_pictures",this.map._onPictureClick.bind(this.map))}_loadSequence(){return this.loader.setAttribute("value",60),this.api.getSequenceItems(this.sequence).then((Qe=>{if(this.loader.setAttribute("value",80),this.map.once("sourcedata",(()=>{this.map.setPaintProperty("geovisio_editor_sequences","line-color",this.map._getLayerColorStyle("sequences")),this.map.setPaintProperty("geovisio_editor_pictures","circle-color",this.map._getLayerColorStyle("pictures")),this.map.setLayoutProperty("geovisio_editor_sequences","visibility","visible"),this.map.setLayoutProperty("geovisio_editor_pictures","visibility","visible"),this.map.once("styledata",(()=>this.loader.dismiss()))})),this._sequenceData=Qe.features,this.map.getSource("geovisio_editor_sequences").setData({type:"FeatureCollection",features:[{type:"Feature",properties:{id:this.sequence},geometry:{type:"LineString",coordinates:Qe.features.map((Qe=>Qe.geometry.coordinates))}},...Qe.features.map((Qe=>(Qe.properties.id=Qe.id,Qe.properties.sequences=[this.sequence],Qe)))]}),this.picture){const rt=Qe.features.find((Qe=>Qe.id===this.picture));rt?(this.select(this.sequence,this.picture,!0),this.map.jumpTo({center:rt.geometry.coordinates,zoom:18})):console.log("Picture with ID",rt,"was not found")}else{const rt=[...Qe.features[0].geometry.coordinates,...Qe.features[0].geometry.coordinates];for(let Wn=1;Wn<Qe.features.length;Wn++){const Co=Qe.features[Wn].geometry.coordinates;Co[0]<rt[0]&&(rt[0]=Co[0]),Co[1]<rt[1]&&(rt[1]=Co[1]),Co[0]>rt[2]&&(rt[2]=Co[0]),Co[1]>rt[3]&&(rt[3]=Co[1])}this.map.fitBounds(rt,{animate:!1})}})).catch((Qe=>this.loader.dismiss(Qe,this._t.pnx.error_api)))}_getNode(Qe){const rt=this._sequenceData.find((rt=>rt.properties.id===Qe)),Wn=rt?(0,Rl.apiFeatureToPSVNode)(rt,this._t,this._isInternetFast):null;return Wn&&delete Wn.links,Wn}_addMapBackgroundWidget(){const Qe=(0,Zl.createWebComp)("pnx-map-background",{_parent:this,size:"sm"});this._mapContainer.appendChild(Qe)}previewSequenceHeadingChange(Qe){const rt=void 0!==this.map.getLayer(Hl);if(this.map._picMarkerPreview.remove(),void 0===Qe)return delete this._lastRelHeading,rt&&this.map.setLayoutProperty(Hl,"visibility","none"),void(this.picture&&this.map._picMarker.setRotation(this.psv.getXY().x));this._lastRelHeading=Qe,rt||this.map.addLayer({id:Hl,type:"symbol",source:"geovisio_editor_sequences",layout:{"icon-image":"pnx-marker","icon-overlap":"always","icon-size":.8}});const Wn=-this.psv.getPictureRelativeHeading();this.map.setLayoutProperty(Hl,"visibility","visible"),this.map.setLayoutProperty(Hl,"icon-rotate",["+",["get","view:azimuth"],Wn,Qe]);const Co=[["==",["geometry-type"],"Point"]];this.picture&&Co.push(["!=",["get","id"],this.picture]),this.map.setFilter(Hl,["all",...Co]),this.picture&&this.map._picMarker.setRotation(this.psv.getXY().x)}_onSelect(){void 0!==this._lastRelHeading&&this.previewSequenceHeadingChange(this._lastRelHeading)}}Editor.properties={raster:{converter:Co.A.GetJSONConverter()},background:{type:String},...Co.A.properties},customElements.define("pnx-editor",Editor)},3407:(Qe,rt,Wn)=>{"use strict";Wn.d(rt,{A:()=>PhotoViewer});Wn(970);var Co=Wn(1545),Dl=Wn(4451),Ll=Wn(9039),Rl=Wn(9048),Ul=Wn(5995),Gl=Wn(7343),Zl=Wn(2118),Hl=Wn(4207);const ql=Math.PI/6;class PhotoViewer extends Ll.A{constructor(){super(),this.psv={},this["url-parameters"]=this.getAttribute("url-parameters")||!0,this["keyboard-shortcuts"]=this.getAttribute("keyboard-shortcuts")||!0,this.widgets=this.getAttribute("widgets")||"true",this.grid=(0,Ul.createWebComp)("pnx-cornered-grid"),this.psvContainer=document.createElement("div"),this.psvContainer.setAttribute("slot","bg"),this.grid.appendChild(this.psvContainer),this.popup=(0,Ul.createWebComp)("pnx-popup",{_parent:this,onclose:this._onPopupClose.bind(this)})}_createInitParamsHandler(){var Qe,rt;this._initParams=new Zl.Ay(Zl.Ay.GetComponentProperties(PhotoViewer,this),Object.assign({},null===(Qe=this.urlHandler)||void 0===Qe?void 0:Qe.currentURLParams(),null===(rt=this.urlHandler)||void 0===rt?void 0:rt.currentURLParams(!0)),{})}_initWidgets(){"false"!==this._initParams.getParentPostInit().widgets&&(this.grid.appendChild((0,Ul.createWebComp)("pnx-widget-player",{slot:"top",_parent:this,class:"pnx-only-psv pnx-print-hidden",size:this.isHeightSmall()?"md":"xl"})),this.isWidthSmall()?(this.legend=(0,Ul.createWebComp)("pnx-picture-legend",{_parent:this}),this.bottomDrawer=(0,Ul.createWebComp)("pnx-bottom-drawer",{slot:"bottom",_parent:this,class:this._initParams.getParentPostInit().picture?void 0:"pnx-hidden"}),this.bottomDrawer.appendChild(this.legend),this.grid.appendChild(this.bottomDrawer),this.addEventListener("select",(Qe=>{(0,Gl.isNullId)(Qe.detail.picId)?this.bottomDrawer.classList.add("pnx-hidden"):this.bottomDrawer.classList.remove("pnx-hidden")}))):(this.legend=(0,Ul.createWebComp)("pnx-widget-legend",{slot:this.isWidthSmall()?void 0:"top-left",_parent:this,focus:this._initParams.getParentPostInit().focus,picture:this._initParams.getParentPostInit().picture}),this.grid.appendChild((0,Ul.createWebComp)("pnx-widget-zoom",{slot:"bottom-right",class:"pnx-print-hidden",_parent:this})),this.grid.appendChild(this.legend),this.grid.appendChild((0,Ul.createWebComp)("pnx-hashtags",{slot:"top-right",_parent:this,class:"pnx-only-psv pnx-print-hidden"}))))}connectedCallback(){super.connectedCallback(),this.presetsManager=new Hl.A(this.lang),this["url-parameters"]&&"false"!==this["url-parameters"]&&(this.urlHandler=new Dl.A(this),this.onceReady().then((()=>{this.urlHandler.listenToChanges(),this.urlHandler._onParentChange()}))),this.onceAPIReady().then(this._postAPIInit.bind(this))}firstUpdated(){super.firstUpdated(),this._moveChildToGrid()}getClassName(){return"PhotoViewer"}onceReady(){return this.oncePSVReady().then((()=>this._initParams.getParentPostInit().picture&&!this.psv.getPictureMetadata()?this.onceFirstPicLoaded():Promise.resolve()))}render(){return[this.loader,this.grid,this.popup]}getSubComponentsNames(){return super.getSubComponentsNames().concat(["psv","grid","popup","urlHandler"])}oncePSVReady(){let Qe;return new Promise((rt=>{Qe=setInterval((()=>{this.psv&&"object"===typeof this.psv&&(this.psv.container?(clearInterval(Qe),rt()):this.psv.addEventListener&&this.psv.addEventListener("ready",(()=>{clearInterval(Qe),rt()}),{once:!0}))}),250)}))}onceFirstPicLoaded(){return this.oncePSVReady().then((()=>this.psv.getPictureMetadata()?Promise.resolve():new Promise((Qe=>{this.psv.addEventListener("picture-loaded",Qe,{once:!0})}))))}async _postAPIInit(){this.loader.setAttribute("value",30),this._createInitParamsHandler();const Qe=this._initParams.getParentPostInit();this._initPSV(),this._initWidgets(),(0,Zl.ai)(this,Qe),Qe.keyboardShortcuts&&this._handleKeyboardManagement(),Qe.picture?this.psv.addEventListener("picture-loaded",(()=>this.loader.dismiss()),{once:!0}):this.loader.dismiss()}_initPSV(){try{this.psv=new Rl.Ay(this,this.psvContainer,{shouldGoFast:this._psvShouldGoFast.bind(this),keyboard:"always",keyboardActions:{...Co.zY.keyboardActions,8:"ROTATE_UP",2:"ROTATE_DOWN",4:"ROTATE_LEFT",6:"ROTATE_RIGHT",PageUp:()=>this.psv.goToNextPicture(),9:()=>this.psv.goToNextPicture(),PageDown:()=>this.psv.goToPrevPicture(),3:()=>this.psv.goToPrevPicture(),5:()=>this.moveCenter(),"*":()=>this.moveCenter(),Home:()=>this._toggleFocus(),7:()=>this._toggleFocus(),End:()=>this.mini.toggleAttribute("collapsed"),1:()=>this.mini.toggleAttribute("collapsed")," ":()=>this.psv.toggleSequencePlaying(),0:()=>this.psv.toggleSequencePlaying()},...this._initParams.getPSVInit()}),this.oncePSVReady().then((()=>{this.loader.setAttribute("value",50),(0,Zl.Vy)(this.psv,this._initParams.getPSVPostInit())}))}catch(Qe){let rt=Co.IJ.isWebGLSupported?this._t.pnx.error_psv:this._t.pnx.error_webgl;this.loader.dismiss(Qe,rt)}}_handleKeyboardManagement(){const keytonone=()=>this.psv.stopKeyboardControl(),keytopsv=()=>this.psv.startKeyboardControl();this.popup.addEventListener("open",(()=>keytonone())),this.popup.addEventListener("close",(()=>keytopsv()));for(let Qe of this.grid.childNodes)"bg"!==Qe.getAttribute("slot")&&(Qe.addEventListener("focusin",(()=>keytonone())),Qe.addEventListener("focusout",(()=>{null===this.popup.getAttribute("visible")&&keytopsv()})))}_psvShouldGoFast(){return this.psv._sequencePlaying&&this.psv.getTransitionDuration()<1e3}_moveChildToGrid(){Array.from(this.querySelectorAll("[slot]")).forEach((Qe=>{var rt;null!==(rt=Qe.tagName)&&void 0!==rt&&rt.toLowerCase().startsWith("pnx-")&&(Qe._parent=this,Qe._t=this._t),"editors"===Qe.getAttribute("slot")?this.onceReady().then((()=>{var rt;return null===(rt=this.legend)||void 0===rt?void 0:rt.appendChild(Qe)})):this.grid.appendChild(Qe)}))}setPopup(Qe){let rt=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;Qe?this.popup.setAttribute("visible",""):this.popup.removeAttribute("visible"),this.popup.innerHTML="","string"===typeof rt?this.popup.innerHTML=rt:Array.isArray(rt)&&rt.forEach((Qe=>this.popup.appendChild(Qe)))}_onPopupClose(){this.dispatchEvent(new CustomEvent("focus-changed",{detail:{focus:this.map&&this.isMapWide()?"map":"pic"}}))}_showQualityScoreDoc(){this.setPopup(!0,[(0,Ul.createWebComp)("pnx-quality-score-doc",{_t:this._t})])}_showReportForm(){if(!this.psv.getPictureMetadata())throw new Error("No picture currently selected");this.setPopup(!0,[(0,Ul.createWebComp)("pnx-report-form",{_parent:this})])}_showShareOptions(){this.setPopup(!0,[(0,Ul.createWebComp)("pnx-share-menu",{_parent:this})])}moveCenter(){this.psv.getPictureMetadata()&&this._psvAnimate({speed:Rl.LM,yaw:0,pitch:0,zoom:Rl.cS})}moveLeft(){this._moveToDirection("left")}moveRight(){this._moveToDirection("right")}moveUp(){this._moveToDirection("up")}moveDown(){this._moveToDirection("down")}_moveToDirection(Qe){let rt=this.psv.getPosition();switch(Qe){case"up":rt.pitch+=ql;break;case"left":rt.yaw-=ql;break;case"down":rt.pitch-=ql;break;case"right":rt.yaw+=ql}this._psvAnimate({speed:Rl.LM,...rt})}_psvAnimate(Qe){this._lastPsvAnim&&this._lastPsvAnim.cancel(),this._lastPsvAnim=this.psv.animate(Qe)}addEventListener(Qe,rt,Wn){super.addEventListener(Qe,rt,Wn)}}PhotoViewer.properties={psv:{converter:Ll.A.GetJSONConverter()},widgets:{type:String},"url-parameters":{type:String},"keyboard-shortcuts":{type:String},...Ll.A.properties},customElements.define("pnx-photo-viewer",PhotoViewer)},8743:(Qe,rt,Wn)=>{"use strict";Wn.d(rt,{$:()=>Ql,A:()=>Viewer});Wn(9616);var Co=Wn(8340),Dl=Wn(3407),Ll=(Wn(9039),Wn(2771)),Rl=Wn(7343),Ul=Wn(5995),Gl=Wn(9683),Zl=Wn(2e3),Hl=Wn(9438),ql=Wn(2118);const Ql=20,Kl=(Math.PI,100);class Viewer extends Dl.A{constructor(){super(),this.map=!0,this.geocoder=this.getAttribute("geocoder")||"nominatim",this.mini=(0,Ul.createWebComp)("pnx-mini",{slot:"bottom-left",_parent:this,onexpand:this._onMiniExpand.bind(this),collapsed:!!(0,Rl.isNullId)(this.picture)||void 0}),this.mini.addEventListener("expand",this._toggleFocus.bind(this)),this.grid.appendChild(this.mini),this.mapContainer=document.createElement("div")}_createInitParamsHandler(){var Qe,rt;this._initParams=new ql.Ay(ql.Ay.GetComponentProperties(Viewer,this),Object.assign({},null===(Qe=this.urlHandler)||void 0===Qe?void 0:Qe.currentURLParams(),null===(rt=this.urlHandler)||void 0===rt?void 0:rt.currentURLParams(!0)),{map:(0,Co.getMapParamsFromLocalStorage)()})}_initWidgets(){var Qe,rt;"false"!==this._initParams.getParentPostInit().widgets&&(this.grid.appendChild((0,Ul.createWebComp)("pnx-widget-zoom",{slot:this.isWidthSmall()?"top-left":"bottom-right",class:this.isWidthSmall()?"pnx-only-map pnx-print-hidden":"pnx-print-hidden",_parent:this})),this.isWidthSmall()?(this.legend=(0,Ul.createWebComp)("pnx-picture-legend",{_parent:this}),this.bottomDrawer=(0,Ul.createWebComp)("pnx-bottom-drawer",{slot:"bottom",_parent:this,class:this._initParams.getParentPostInit().picture?void 0:"pnx-hidden"}),this.bottomDrawer.appendChild(this.legend),this.grid.appendChild(this.bottomDrawer),this.addEventListener("select",(Qe=>{(0,Rl.isNullId)(Qe.detail.picId)?this.bottomDrawer.classList.add("pnx-hidden"):this.bottomDrawer.classList.remove("pnx-hidden")}))):(this.legend=(0,Ul.createWebComp)("pnx-widget-legend",{slot:this.isWidthSmall()?"top":"top-left",_parent:this,focus:this._initParams.getParentPostInit().focus,picture:this._initParams.getParentPostInit().picture}),this.grid.appendChild(this.legend),this.grid.appendChild((0,Ul.createWebComp)("pnx-hashtags",{slot:"top-right",_parent:this,class:"pnx-only-psv pnx-print-hidden"}))),this.grid.appendChild((0,Ul.createWebComp)("pnx-widget-player",{slot:"top",_parent:this,class:"pnx-only-psv pnx-print-hidden",size:this.isHeightSmall()?"md":"xl"})),this.grid.appendChild((0,Ul.createWebComp)("pnx-widget-geosearch",{slot:this.isWidthSmall()?"top-right":"top-left",_parent:this,class:"pnx-only-map pnx-print-hidden",geocoder:this._initParams.getParentPostInit().geocoder})),this.grid.appendChild((0,Ul.createWebComp)("pnx-widget-mapfilters",{slot:this.isWidthSmall()?"top-right":"top-left",_parent:this,"user-search":null!==this.api._endpoints.user_search&&null!==this.api._endpoints.user_tiles,"quality-score":(null===(Qe=this.map)||void 0===Qe||null===(rt=Qe._hasQualityScore)||void 0===rt?void 0:rt.call(Qe))||!1,class:"pnx-only-map pnx-print-hidden"})),this.grid.appendChild((0,Ul.createWebComp)("pnx-widget-maplayers",{slot:"top-right",_parent:this,class:"pnx-only-map pnx-print-hidden"})))}getClassName(){return"Viewer"}getSubComponentsNames(){return super.getSubComponentsNames().concat(["mini","map"])}onceReady(){return Promise.all([this.oncePSVReady(),this.onceMapReady()]).then((()=>this._initParams.getParentPostInit().picture&&!this.psv.getPictureMetadata()?this.onceFirstPicLoaded():Promise.resolve()))}attributeChangedCallback(Qe,rt,Wn){var Co,Dl,Ll,Ul;(super.attributeChangedCallback(Qe,rt,Wn),"picture"===Qe)&&(null===(Co=this.legend)||void 0===Co||null===(Dl=Co.setAttribute)||void 0===Dl||Dl.call(Co,"picture",Wn),(0,Rl.isNullId)(rt)&&!(0,Rl.isNullId)(Wn)&&this.mini.removeAttribute("collapsed"),(0,Rl.isNullId)(Wn)?this.map&&this.isMapWide()?this.mini.classList.add("pnx-hidden"):this.map&&!this.isMapWide()&&this._setFocus("map"):(this.mini.classList.remove("pnx-hidden"),(0,Rl.isNullId)(rt)&&(this._setFocus("pic"),"closed"===(null===(Ll=this.bottomDrawer)||void 0===Ll||null===(Ul=Ll.getAttribute)||void 0===Ul?void 0:Ul.call(Ll,"openness"))&&this.bottomDrawer.setAttribute("openness","half-opened"))));"focus"===Qe&&this._setFocus(Wn)}onceMapReady(){if(!this.map)return Promise.resolve();let Qe;return new Promise((rt=>{Qe=setInterval((()=>{var Wn,Co,Dl;"object"===typeof this.map&&(null!==(Wn=this.map)&&void 0!==Wn&&null!==(Co=Wn.loaded)&&void 0!==Co&&Co.call(Wn)?(clearInterval(Qe),rt()):null!==(Dl=this.map)&&void 0!==Dl&&Dl.once&&this.map.once("render",(()=>{clearInterval(Qe),rt()})))}),250)}))}async _initMap(){await new Promise((Qe=>{this.map=new Ll.A(this,this.mapContainer,this._initParams.getMapInit()),(0,Co.saveMapParamsToLocalStorage)(this.map),this.map.once("users-changed",(()=>{this.loader.setAttribute("value",75),Qe()}))})),await(0,ql.mK)(this.map,this._initParams.getMapPostInit()),(0,Co.initMapKeyboardHandler)(this),(0,Co.linkMapAndPhoto)(this)}async _postAPIInit(){this.loader.setAttribute("value",30),this._createInitParamsHandler();const Qe=this._initParams.getParentPostInit();this._initPSV(),await this._initMap(),this._initWidgets(),this._moveChildToGrid(),(0,ql.iz)(this,Qe),Qe.keyboardShortcuts&&this._handleKeyboardManagement(),Qe.picture?this.psv.addEventListener("picture-loaded",(()=>{(0,ql.iz)(this,Qe),this.loader.dismiss()}),{once:!0}):this.loader.dismiss()}_handleKeyboardManagement(){const keytomap=()=>{this.psv.stopKeyboardControl(),this.map.keyboard.enable()},keytopsv=()=>{this.psv.startKeyboardControl(),this.map.keyboard.disable()},keytonone=()=>{this.psv.stopKeyboardControl(),this.map.keyboard.disable()},keytofocused=()=>{this.map&&this.isMapWide()?keytomap():keytopsv()};this.addEventListener("focus-changed",(Qe=>{"map"===Qe.detail.focus&&keytomap(),this.popup.getAttribute("visible")?keytonone():keytopsv()})),this.popup.addEventListener("open",(()=>keytonone())),this.popup.addEventListener("close",(()=>keytofocused()));for(let Qe of this.grid.childNodes)"bg"!==Qe.getAttribute("slot")&&(Qe.addEventListener("focusin",(()=>keytonone())),Qe.addEventListener("focusout",(()=>{null===this.popup.getAttribute("visible")&&keytofocused()})))}moveCenter(){const Qe=this.psv.getPictureMetadata();Qe&&(this.map&&this.isMapWide()?this.map.flyTo({center:Qe.gps,zoom:20}):super.moveCenter())}_moveToDirection(Qe){if(this.map&&this.isMapWide()){let rt;switch(Qe){case"up":rt=[0,-100];break;case"left":rt=[-100,0];break;case"down":rt=[0,Kl];break;case"right":rt=[Kl,0]}this.map.panBy(rt)}else super._moveToDirection(Qe)}isMapWide(){return this.mapContainer.parentNode==this.grid}_setFocus(Qe){var rt,Wn,Co,Dl;let Ll=arguments.length>1&&void 0!==arguments[1]&&arguments[1],Hl=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if("map"===Qe&&!this.map)throw new Error("Map is not enabled");if(!["map","pic"].includes(Qe))throw new Error("Invalid focus value (should be pic or map)");if(this.focus=Qe,(Hl||("map"!==Qe||!this.map||!this.isMapWide())&&("pic"!==Qe||this.map&&this.isMapWide()))&&("map"===Qe?(this.psvContainer.parentNode==this.grid&&(this.grid.removeChild(this.psvContainer),this.psvContainer.removeAttribute("slot")),this.mapContainer.parentNode==this.mini&&this.mini.removeChild(this.mapContainer),this.mapContainer.setAttribute("slot","bg"),this.grid.appendChild(this.mapContainer),this.mini.appendChild(this.psvContainer),this.mini.icon=(0,Ul.fa)(Gl.pt),(0,Rl.isNullId)(this.picture)?this.mini.classList.add("pnx-hidden"):this.mini.classList.remove("pnx-hidden"),this.map.getCanvas().focus()):(this.mapContainer.parentNode==this.grid&&(this.grid.removeChild(this.mapContainer),this.mapContainer.removeAttribute("slot")),this.psvContainer.parentNode==this.mini&&this.mini.removeChild(this.psvContainer),this.psvContainer.setAttribute("slot","bg"),this.grid.appendChild(this.psvContainer),this.mini.classList.remove("pnx-hidden"),this.mini.appendChild(this.mapContainer),this.mini.icon=(0,Ul.fa)(Zl.e5),this.psvContainer.focus()),null===this||void 0===this||null===(rt=this.map)||void 0===rt||null===(Wn=rt.resize)||void 0===Wn||Wn.call(rt),this.psv.autoSize(),this.psv.forceRefresh(),null===(Co=this.legend)||void 0===Co||null===(Dl=Co.setAttribute)||void 0===Dl||Dl.call(Co,"focus",this.focus),!Ll)){const rt=new CustomEvent("focus-changed",{detail:{focus:Qe}});this.dispatchEvent(rt)}}_toggleFocus(){this._setFocus(this.isMapWide()?"pic":"map")}_onMiniExpand(){this.map.resize(),this.psv.autoSize()}_onMapFiltersChange(){var Qe;const rt=(0,Hl.qi)("#pnx-map-filters-menu"),Wn=null===rt||void 0===rt?void 0:rt.shadowRoot.getElementById("pnx-filter-date-from"),Co=null===rt||void 0===rt?void 0:rt.shadowRoot.getElementById("pnx-filter-date-end"),Dl=null===rt||void 0===rt?void 0:rt.shadowRoot.querySelectorAll("input[name='pnx-filter-type']"),Ll=(0,Hl.qi)("#pnx-map-theme");let Rl="";for(let Zl=0;Zl<Dl.length;Zl++){const Qe=Dl[Zl];if(Qe.checked){Rl=Qe.value;break}}let Ul=[];if(null!==(Qe=this.map)&&void 0!==Qe&&Qe._hasQualityScore()){const Qe=null===rt||void 0===rt?void 0:rt.shadowRoot.getElementById("pnx-filter-qualityscore");Ul=((null===Qe||void 0===Qe?void 0:Qe.grade)||"").split(",").map((Qe=>parseInt(Qe))).filter((Qe=>!isNaN(Qe))),5==Ul.length&&(Ul=[])}const Gl={minDate:null===Wn||void 0===Wn?void 0:Wn.value,maxDate:null===Co||void 0===Co?void 0:Co.value,pic_type:Rl,theme:null===Ll||void 0===Ll?void 0:Ll.value,qualityscore:Ul};this.map.setFilters(Gl)}}Viewer.properties={map:{converter:Dl.A.GetJSONConverter()},focus:{type:String,reflect:!0},geocoder:{type:String},...Dl.A.properties},customElements.define("pnx-viewer",Viewer)},3921:(Qe,rt,Wn)=>{"use strict";Wn.r(rt),Wn.d(rt,{Basic:()=>Co.A,CoverageMap:()=>Dl.A,Editor:()=>Ll.A,PhotoViewer:()=>Ul.A,Viewer:()=>Rl.A});var Co=Wn(9039),Dl=Wn(153),Ll=Wn(1752),Rl=Wn(8743),Ul=Wn(3407)},9341:(Qe,rt,Wn)=>{"use strict";Wn.r(rt),Wn.d(rt,{core:()=>Co,layout:()=>Dl,menus:()=>Ll,ui:()=>Rl});var Co=Wn(3921),Dl=Wn(456),Ll=Wn(8794),Rl=Wn(9472)},6784:(Qe,rt,Wn)=>{"use strict";Wn.d(rt,{A:()=>BottomDrawer});var Co=Wn(4542),Dl=Wn(1198);const Ll={opened:0,"half-opened":.7,closed:1};class BottomDrawer extends Co.WF{constructor(){super(),this._isDragging=!1,this.openness="half-opened"}firstUpdated(){var Qe;super.firstUpdated(),this._boundTouchMove=this._onTouchMove.bind(this),this._boundTouchEnd=this._onTouchEnd.bind(this),this._drawerHeight=window.innerHeight-30;const rt=this._getDrawer();rt&&(rt.style.height=`${this._drawerHeight}px`,rt.style.maxHeight=`${this._drawerHeight}px`,null===(Qe=this._parent)||void 0===Qe||Qe.onceReady().then((()=>{var Qe,rt;null===(Qe=this._parent.map)||void 0===Qe||Qe.addEventListener("click",(()=>this.openness="closed")),null===(rt=this._parent.psv)||void 0===rt||rt.addEventListener("click",(()=>this.openness="closed"))})))}attributeChangedCallback(Qe,rt,Wn){if(super.attributeChangedCallback(Qe,rt,Wn),"openness"===Qe){if("opened"!==Wn){const Qe=this.shadowRoot.querySelector(".content");Qe&&(Qe.scrollTop=0)}const Qe=this._getDrawer();Qe&&(Qe.style.transform=null)}}disconnectedCallback(){super.disconnectedCallback(),this._cleanupTouchListeners()}_getDrawer(){var Qe;return null===(Qe=this.shadowRoot)||void 0===Qe?void 0:Qe.querySelector(".drawer")}_onHandleClick(){"opened"===this.openness?this.openness="closed":"half-opened"===this.openness?this.openness="opened":"closed"===this.openness&&(this.openness="half-opened")}_onTouchStart(Qe){this._isDragging=!0,this._startFingerY=Qe.touches[0].clientY,this._deltaFingerY=0,this._drawerY=this._drawerHeight*Ll[this.openness],window.addEventListener("touchmove",this._boundTouchMove,{passive:!0}),window.addEventListener("touchend",this._boundTouchEnd),window.addEventListener("touchcancel",this._boundTouchEnd)}_onTouchMove(Qe){if(!this._isDragging)return;const rt=this.shadowRoot.querySelector(".content");rt.scrollHeight>rt.offsetHeight&&rt.scrollTop>0?this._updateDrawerTransform(0):(this._deltaFingerY=Qe.touches[0].clientY-this._startFingerY,this._updateDrawerTransform(this._drawerY+this._deltaFingerY))}_onTouchEnd(Qe){(this._isDragging&&!(Math.abs(this._deltaFingerY)<30)||Qe.target.closest(".handle"))&&(Qe.preventDefault(),this._isDragging=!1,0===this._deltaFingerY&&"closed"===this.openness?this.openness="half-opened":this._updateDrawerTransform(this._drawerY+this._deltaFingerY,!0),this._cleanupTouchListeners(),this._startFingerY=null,this._deltaFingerY=null)}_cleanupTouchListeners(){window.removeEventListener("touchmove",this._boundTouchMove),window.removeEventListener("touchend",this._boundTouchEnd),window.removeEventListener("touchcancel",this._boundTouchCancel)}_updateDrawerTransform(Qe){let rt=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const Wn=this._getDrawer();Wn&&(Qe=Math.max(0,Math.min(Qe,this._drawerHeight-30)),rt&&(this._deltaFingerY<0?"closed"===this.openness?Math.abs(this._deltaFingerY)>this._drawerHeight*(1-Ll["half-opened"])?this.openness="opened":this.openness="half-opened":this.openness="opened":this.openness="closed",this._drawerY=null,Qe=Math.max(0,Math.min(Ll[this.openness]*this._drawerHeight,this._drawerHeight-30))),Wn.style.transform=`translateY(${Qe}px)`)}render(){const Qe={drawer:!0,[this.openness]:!0,dragging:this._isDragging};return Co.qy`
13
13
  <div
14
14
  class=${(0,Dl.H)(Qe)}
15
15
  @touchstart="${this._onTouchStart}"
@@ -1708,7 +1708,7 @@
1708
1708
  }
1709
1709
  /* Logo */
1710
1710
  img.logo-dead { width: 100px; }
1711
- `,Loader.properties={_mode:{state:!0},_label:{state:!0},_isLabelFun:{state:!0},visible:{type:Boolean,reflect:!0},"no-label":{type:Boolean},value:{type:Number}},customElements.define("pnx-loader",Loader)},5642:(Qe,rt,Wn)=>{"use strict";Wn.d(rt,{A:()=>Map});Wn(3041);var Co=Wn(8340),Dl=Wn(7343),Ll=Wn(6883),Rl=Wn(270),Ul=Wn(6462),Gl=Wn(9740),Zl=(Wn(6795),Wn(927)),Hl=Wn.n(Zl),ql=Wn(2968),Ql=Wn.n(ql),Kl=Wn(748);Hl().workerClass=Ql(),Hl().addProtocol("pmtiles",(new Kl.Zs).tile);class Map extends Hl().Map{constructor(Qe,rt){let Wn=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};var Dl;(super({container:rt,style:(0,Co.combineStyles)(Qe,Wn),center:[0,0],zoom:0,maxZoom:24,attributionControl:!1,dragRotate:!1,pitchWithRotate:!1,touchZoomRotate:!0,touchPitch:!1,doubleClickZoom:!1,canvasContextAttributes:{preserveDrawingBuffer:!Qe.isWidthSmall()},transformRequest:Qe.api._getMapRequestTransform(),locale:Qe._t.maplibre,hash:!1,...Wn}),this._loadMarkerImages(),this._parent=Qe,this._options=Wn,this.getContainer().classList.add("pnx-map"),void 0===Wn.touchZoomRotate)&&(null===this||void 0===this||null===(Dl=this.touchZoomRotate)||void 0===Dl||Dl.disableRotation());this._options.raster&&(this._options.background=this._options.background||"streets"),this._attribution=new(Hl().AttributionControl)({compact:!1,...Wn.attributionControl}),this.addControl(this._attribution),this._initMapPosition(),this._picMarker=this._getPictureMarker(),this._picMarkerPreview=this._getPictureMarker(!1),this._picThumbUrl={},this._seqPictures={},this._userLayers=new Set,this._parent.addEventListener("select",this.reloadLayersStyles.bind(this)),setTimeout((()=>{var Qe;!this.loaded()&&null!==(Qe=this._parent)&&void 0!==Qe&&Qe.loader.isVisible()&&this._parent.loader.dismiss({},this._parent._t.map.slow_loading,(async()=>{await this._postLoad(),this._parent.loader.dismiss()}))}),15e3),this.waitForEnoughMapLoaded().then((async()=>await this._postLoad()))}async _postLoad(){this.resize(),await this.setVisibleUsers(this._parent.users),this.reloadLayersStyles(),this.fire("ready")}destroy(){this.remove(),delete this._parent,delete this._options,delete this._attribution,delete this._picMarker,delete this._picMarkerPreview,delete this._picThumbUrl,delete this._seqPictures,delete this._userLayers}waitForEnoughMapLoaded(){return new Promise((Qe=>{let rt=0,Wn=0,Co=0,Dl=0;const onSourceDataLoading=Qe=>{"source"===Qe.dataType&&Qe.tile&&(Qe.sourceId.startsWith("geovisio")?Wn++:rt++)},onSourceData=Qe=>{"source"===Qe.dataType&&Qe.tile&&(Qe.sourceId.startsWith("geovisio")?(Dl++,Qe.isSourceLoaded&&(Dl=Wn)):(Co++,Qe.isSourceLoaded&&(Co=rt))),checkEnoughLoaded()},checkEnoughLoaded=()=>{Co/rt>=.75&&(0===Wn||Dl/Wn>=.75)&&(this.off("sourcedata",onSourceData),this.off("sourcedataloading",onSourceDataLoading),Qe())};this.on("sourcedataloading",onSourceDataLoading),this.on("sourcedata",onSourceData)}))}_initMapPosition(){this._options.center&&this._options.center!=[0,0]||this._options.zoom&&0!==this._options.zoom||this._options.hash||this._parent.onceAPIReady().then((()=>{var Qe,rt;let Wn=null===(Qe=this._parent)||void 0===Qe||null===(rt=Qe.api)||void 0===rt?void 0:rt.getDataBbox();if(Wn)try{Wn=new(Hl().LngLatBounds)(Wn),this.loaded()?this.fitBounds(Wn,{animate:!1}):this.waitForEnoughMapLoaded().then((()=>this.fitBounds(Wn,{animate:!1})))}catch(Co){console.warn("Received invalid bbox: "+Wn)}}))}_loadMarkerImages(){[{id:"pnx-marker",img:Ll},{id:"pnx-arrow-flat",img:Ul},{id:"pnx-arrow-360",img:Gl}].forEach((Qe=>{const rt=new Image(64,64);rt.onload=()=>this.addImage(Qe.id,rt),rt.src=Qe.img}))}_hasQualityScore(){var Qe,rt,Wn,Co;const Dl=(null===(Qe=this.getStyle())||void 0===Qe||null===(rt=Qe.metadata)||void 0===rt?void 0:rt["panoramax:fields"])||{};return(null===Dl||void 0===Dl||null===(Wn=Dl.pictures)||void 0===Wn?void 0:Wn.includes("gps_accuracy"))&&(null===Dl||void 0===Dl||null===(Co=Dl.pictures)||void 0===Co?void 0:Co.includes("h_pixel_density"))}_hasGridStats(){var Qe,rt,Wn,Co,Dl,Ll;const Rl=(null===(Qe=this.getStyle())||void 0===Qe||null===(rt=Qe.metadata)||void 0===rt?void 0:rt["panoramax:fields"])||{};return(null===Rl||void 0===Rl||null===(Wn=Rl.grid)||void 0===Wn?void 0:Wn.includes("nb_360_pictures"))&&(null===Rl||void 0===Rl||null===(Co=Rl.grid)||void 0===Co?void 0:Co.includes("nb_flat_pictures"))&&(null===Rl||void 0===Rl||null===(Dl=Rl.grid)||void 0===Dl?void 0:Dl.includes("coef_360_pictures"))&&(null===Rl||void 0===Rl||null===(Ll=Rl.grid)||void 0===Ll?void 0:Ll.includes("coef_flat_pictures"))}reloadVectorTiles(){[...this._userLayers].forEach((Qe=>{const rt=this.getSource((0,Co.getUserSourceId)(Qe));rt.setTiles(rt.tiles)}))}hasTwoBackgrounds(){return void 0!==this.getLayer(Co.RASTER_LAYER_ID)}getBackground(){if(!this.getLayer(Co.RASTER_LAYER_ID))return"streets";return"visible"==this.getLayoutProperty(Co.RASTER_LAYER_ID,"visibility")?"aerial":"streets"}setBackground(Qe){if(!this.getLayer(Co.RASTER_LAYER_ID)&&"aerial"===Qe)throw new Error("No aerial imagery available");this.getLayer(Co.RASTER_LAYER_ID)&&(this.setLayoutProperty(Co.RASTER_LAYER_ID,"visibility","aerial"===Qe?"visible":"none"),this.fire("background-changed",{background:Qe||"streets"}))}getVisibleUsers(){return[...this._userLayers].filter((Qe=>this.getLayer((0,Co.getUserLayerId)(Qe,"pictures"))&&"visible"===this.getLayoutProperty((0,Co.getUserLayerId)(Qe,"pictures"),"visibility")))}onceLayerReady(Qe){return this.getLayer(Qe)?Promise.resolve():new Promise((Qe=>{setTimeout(Qe,250)})).then((()=>this.onceLayerReady(Qe)))}async setVisibleUsers(){let Qe=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];"string"===typeof Qe?Qe=[Qe]:null===Qe&&(Qe=[]),await Promise.all(Qe.filter((Qe=>""!=Qe&&!this._userLayers.has(Qe))).map((Qe=>(this._createPicturesTilesLayer(Qe),this.onceLayerReady((0,Co.getUserLayerId)(Qe,"pictures"))))));const rt=["pictures","sequences","sequences_plus","grid","pictures_symbols"];[...this._userLayers].forEach((Wn=>{rt.forEach((rt=>{const Dl=(0,Co.getUserLayerId)(Wn,rt);this.getLayer(Dl)&&this.setLayoutProperty(Dl,"visibility",Qe.includes(Wn)?"visible":"none")}))})),this.fire("users-changed",{usersIds:Qe})}filterUserLayersContent(Qe,rt){[...this._userLayers].forEach((Wn=>{this.getLayer((0,Co.getUserLayerId)(Wn,Qe))?(this.setFilter((0,Co.getUserLayerId)(Wn,Qe),rt),"sequences"===Qe&&this.getLayer((0,Co.getUserLayerId)(Wn,"sequences_plus"))&&this.setFilter((0,Co.getUserLayerId)(Wn,"sequences_plus"),rt),"pictures"===Qe&&this.getLayer((0,Co.getUserLayerId)(Wn,"pictures_symbols"))&&this.setFilter((0,Co.getUserLayerId)(Wn,"pictures_symbols"),rt)):console.warn("Layer",(0,Co.getUserLayerId)(Wn,Qe),"not ready")}))}displayPictureMarker(Qe,rt,Wn){let Dl=arguments.length>3&&void 0!==arguments[3]&&arguments[3];this._picMarkerPreview.remove(),void 0!==Qe&&void 0!==rt?this._picMarker.setLngLat([Qe,rt]).setRotation(Wn).addTo(this):this._picMarker.remove(),this.reloadLayersStyles(),Dl||void 0===Qe||void 0===rt||this.flyTo({center:[Qe,rt],zoom:this.getZoom()<Co.TILES_PICTURES_ZOOM+2?Co.TILES_PICTURES_ZOOM+2:this.getZoom(),maxDuration:2e3})}reloadLayersStyles(){const updateStyle=(Qe,rt)=>{[...this._userLayers].forEach((Wn=>{const Dl=(0,Co.getUserLayerId)(Wn,Qe);if(this.getLayer(Dl)){for(let Qe in rt.layout)this.setLayoutProperty(Dl,Qe,rt.layout[Qe]);for(let Qe in rt.paint)this.setPaintProperty(Dl,Qe,rt.paint[Qe])}else console.warn("Layer",Dl,"not ready")}))};["pictures","pictures_symbols","sequences"].forEach((Qe=>{updateStyle(Qe,this._getLayerStyleProperties(Qe))}))}async _createPicturesTilesLayer(Qe){this._userLayers.add(Qe);const rt=this.getStyle().layers.find(Co.isLabelLayer);if("geovisio"!==Qe&&!this.getSource(`geovisio_${Qe}`)){const Wn=await this._parent.api.getUserMapStyle(Qe);Object.entries(Wn.sources).forEach((Qe=>{let[rt,Wn]=Qe;return this.addSource(rt,Wn)})),Wn.layers=Wn.layers||[];Wn.layers.concat((0,Co.getMissingLayerStyles)(Wn.sources,Wn.layers)).filter((Qe=>Object.keys(Qe).length>0)).forEach((Qe=>this.addLayer(Qe,null===rt||void 0===rt?void 0:rt.id)))}this._picPreviewTimer=null,this._picPopup=new(Hl().Popup)({closeButton:!1,closeOnClick:!this._parent.isWidthSmall(),offset:3}),this._picPopup.on("close",(()=>{delete this._picPopup._picId}));const Wn=(0,Co.getUserLayerId)(Qe,"pictures");this.on("mousemove",Wn,(Qe=>{this.getCanvas().style.cursor="pointer";const rt=Object.assign({},Qe);clearTimeout(this._picPreviewTimer),this._picPreviewTimer=setTimeout((()=>this._attachPreviewToPictures(rt,Wn)),100)})),this.on("mouseleave",Wn,(()=>{clearTimeout(this._picPreviewTimer),this.getCanvas().style.cursor="",this._picPopup._picId,this._picPopup.remove()})),this.on("click",Wn,this._onPictureClick.bind(this));const Dl=(0,Co.getUserLayerId)(Qe,"sequences_plus");this.on("mousemove",Dl,(Qe=>{if(this._onSequenceHover(Qe),this.getZoom()<=Co.TILES_PICTURES_ZOOM+1&&(this.getCanvas().style.cursor="pointer",Qe.features[0].properties.id)){const rt=Object.assign({},Qe);clearTimeout(this._picPreviewTimer),this._picPreviewTimer=setTimeout((()=>this._attachPreviewToPictures(rt,Dl)),100)}})),this.on("mouseleave",Dl,(()=>{clearTimeout(this._picPreviewTimer),this.getCanvas().style.cursor="",this._picPopup._picId,this._picPopup.remove()})),this.on("click",Dl,(Qe=>{Qe.preventDefault(),this.getZoom()<=Co.TILES_PICTURES_ZOOM+1&&this._onSequenceClick(Qe)})),"geovisio"===Qe&&this.getLayer("geovisio_grid")&&(this.on("mousemove","geovisio_grid",(Qe=>{if(this.getZoom()<=Co.TILES_PICTURES_ZOOM+1){this.getCanvas().style.cursor="pointer";const rt=Object.assign({},Qe);clearTimeout(this._picPreviewTimer),this._picPreviewTimer=setTimeout((()=>this._attachPreviewToPictures(rt,"geovisio_grid")),100)}})),this.on("mouseleave","geovisio_grid",(()=>{clearTimeout(this._picPreviewTimer),this.getCanvas().style.cursor="",this._picPopup._picId,this._picPopup.remove()})),this.on("click","geovisio_grid",(Qe=>{Qe.preventDefault(),this.flyTo({center:Qe.lngLat,zoom:Co.TILES_PICTURES_ZOOM-6})}))),this.on("click",(Qe=>{!1===Qe.defaultPrevented&&(clearTimeout(this._picPreviewTimer),this._picPopup.remove())}))}_getLayerStyleProperties(Qe){if("pictures_symbols"===Qe)return{paint:{},layout:{"icon-image":["case",["==",["get","id"],this._parent.picture],"",["==",["get","type"],"equirectangular"],"pnx-arrow-360","pnx-arrow-flat"],"symbol-sort-key":this._getLayerSortStyle(Qe)}};{const rt={pictures:"circle",sequences:"line"};return{paint:Object.assign({[`${rt[Qe]}-color`]:this._getLayerColorStyle(Qe)},Co.VECTOR_STYLES[Qe.toUpperCase()].paint),layout:Object.assign({[`${rt[Qe]}-sort-key`]:this._getLayerSortStyle(Qe)},Co.VECTOR_STYLES[Qe.toUpperCase()].layout)}}}_getLayerColorStyle(Qe){const rt=["case",["==",["get","hidden"],!0],Dl.COLORS.HIDDEN,["==",["get","geovisio:status"],"hidden"],Dl.COLORS.HIDDEN],Wn=this._parent.sequence;return"sequences"==Qe&&Wn?rt.push(["==",["get","id"],Wn],Dl.COLORS.SELECTED):Qe.startsWith("pictures")&&Wn&&rt.push(["in",Wn,["get","sequences"]],Dl.COLORS.SELECTED),rt.push(Dl.COLORS.BASE),rt}_getLayerSortStyle(Qe){const rt=["case",["==",["get","hidden"],!0],90],Wn=this._parent.sequence;return"sequences"==Qe&&Wn?rt.push(["==",["get","id"],Wn],100):Qe.startsWith("pictures")&&Wn&&rt.push(["in",Wn,["get","sequences"]],100),rt.push(10),rt}_attachPreviewToPictures(Qe,rt){let Wn=Qe.features.pop();if(!Wn||Wn.properties.id==this._picPopup._picId)return;let Dl=null;if(rt.endsWith("pictures")?Dl=Wn.geometry.coordinates.slice():Qe.lngLat&&(Dl=[Qe.lngLat.lng,Qe.lngLat.lat]),!Dl){const Qe="LineString"===Wn.geometry.type?[Wn.geometry.coordinates]:Wn.geometry.coordinates;let rt=null;const Co=this.getBounds(),Ll=Co.getCenter();for(let Wn=0;Wn<Qe.length;Wn++)for(let Rl=0;Rl<Qe[Wn].length;Rl++)if(Co.contains(Qe[Wn][Rl])){let Co=Ll.distanceTo(new(Hl().LngLat)(...Qe[Wn][Rl]));(null===rt||Co<rt)&&(Dl=Qe[Wn][Rl],rt=Co)}if(!Dl)return}this._picPopup.setLngLat(Dl).addTo(this),this._picThumbUrl[Wn.properties.id]||this._picPopup.setDOMContent((0,Co.getThumbGif)(this._parent._t)),this._picPopup._loading=Wn.properties.id,this._picPopup._picId=Wn.properties.id;const displayThumb=Qe=>{if(this._picPopup._loading===Wn.properties.id)if(delete this._picPopup._loading,Qe){let rt=document.createElement("img");rt.classList.add("pnx-map-thumb"),rt.alt=this._parent._t.map.thumbnail;let Co=new Image;if(Co.src=Qe,Co.addEventListener("load",(()=>{Wn.properties.hidden?rt.children[0].src=Co.src:rt.src=Co.src,this._picPopup.setDOMContent(rt)})),Wn.properties.hidden){const Qe=document.createElement("div");Qe.classList.add("pnx-map-thumb-legend"),Qe.appendChild(document.createTextNode(this._parent._t.map.not_public));const Wn=document.createElement("div");Wn.appendChild(rt),Wn.appendChild(Qe),rt=Wn}}else this._picPopup.remove()};rt.endsWith("pictures")?this._getPictureThumbURL(Wn.properties.id).then(displayThumb):rt.endsWith("grid")?this._getThumbURL(Dl).then(displayThumb):this._getSequenceThumbURL(Wn.properties.id,new(Hl().LngLat)(...Dl)).then(displayThumb)}_getThumbURL(Qe){return this._parent.api.getPicturesAroundCoordinates(Qe[1],Qe[0],.1,1).then((Qe=>{var rt;const Wn=null===Qe||void 0===Qe||null===(rt=Qe.features)||void 0===rt?void 0:rt.pop();return Wn?this._parent.api.findThumbnailInPictureFeature(Wn):null}))}_getSequenceThumbURL(Qe,rt){return rt?this._parent.api.getPicturesAroundCoordinates(rt.lat,rt.lng,1,1,Qe).then((rt=>{var Wn;return(null===rt||void 0===rt||null===(Wn=rt.features)||void 0===Wn?void 0:Wn.length)>0?this._parent.api.findThumbnailInPictureFeature(rt.features[0]):this._parent.api.getPictureThumbnailURLForSequence(Qe)})):this._parent.api.getPictureThumbnailURLForSequence(Qe)}_getPictureThumbURL(Qe,rt){let Wn=null;return Qe&&(void 0!==this._picThumbUrl[Qe]?Wn="string"===typeof this._picThumbUrl[Qe]?Promise.resolve(this._picThumbUrl[Qe]):this._picThumbUrl[Qe]:(this._picThumbUrl[Qe]=this._parent.api.getPictureThumbnailURL(Qe,rt).then((rt=>rt?(this._picThumbUrl[Qe]=rt,rt):(this._picThumbUrl[Qe]=null,null))).catch((()=>{this._picThumbUrl[Qe]=null})),Wn=this._picThumbUrl[Qe])),Wn}_getPictureMarker(){let Qe=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];const rt=document.createElement("img");return rt.src=Qe?Rl:Ll,rt.alt="",new(Hl().Marker)({element:rt})}_onSequenceHover(Qe){var rt;Qe.preventDefault(),Qe.features.length>0&&null!==(rt=Qe.features[0].properties)&&void 0!==rt&&rt.id&&this.fire("sequence-hover",{seqId:Qe.features[0].properties.id})}_onSequenceClick(Qe){var rt;Qe.preventDefault(),Qe.features.length>0&&null!==(rt=Qe.features[0].properties)&&void 0!==rt&&rt.id&&this.fire("sequence-click",{seqId:Qe.features[0].properties.id,coordinates:Qe.lngLat})}_onPictureClick(Qe){var rt,Wn;Qe.preventDefault();const Co=(null===Qe||void 0===Qe||null===(rt=Qe.features)||void 0===rt?void 0:rt.length)>0?Qe.features[0]:null;if(null!==Co&&void 0!==Co&&null!==(Wn=Co.properties)&&void 0!==Wn&&Wn.id){let rt=null;try{Co.properties.sequences&&(Array.isArray(Co.properties.sequences)||(Co.properties.sequences=JSON.parse(Co.properties.sequences)),rt=Co.properties.sequences.pop())}catch(Qe){console.log("Sequence ID is not available in vector tiles for picture "+Co.properties.id)}this.fire("picture-click",{picId:Co.properties.id,seqId:rt,feature:Co})}}addEventListener(Qe,rt){let Wn=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};null!==Wn&&void 0!==Wn&&Wn.once?this.once(Qe,rt):this.on(Qe,rt)}}},2771:(Qe,rt,Wn)=>{"use strict";Wn.d(rt,{A:()=>MapMore,T:()=>Ul});var Co=Wn(5642),Dl=Wn(7343),Ll=Wn(8340);const Rl={DEFAULT:"default",AGE:"age",TYPE:"type",SCORE:"score"},Ul=["minDate","maxDate","pic_type","camera","theme","qualityscore"];class MapMore extends Co.A{constructor(Qe,rt){super(Qe,rt,arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}),this._mapFilters={},this._options.theme&&(this._mapFilters={theme:this._options.theme})}reloadLayersStyles(){if(super.reloadLayersStyles(),this._hasGridStats()){let Qe="coef";this._mapFilters.pic_type&&(Qe="flat"==this._mapFilters.pic_type?"coef_flat_pictures":"coef_360_pictures"),this.getStyle().layers.filter((Qe=>Qe.id.endsWith("_grid"))).forEach((rt=>{const Wn=(0,Ll.switchCoefValue)(rt,Qe);for(let Qe in Wn.layout)this.setLayoutProperty(rt.id,Qe,Wn.layout[Qe]);for(let Qe in Wn.paint)this.setPaintProperty(rt.id,Qe,Wn.paint[Qe])}))}}_getDatesForLayerColors(){const Qe=864e5,rt=Date.now();return[rt-30*Qe,rt-365*Qe,rt-730*Qe].map((Qe=>new Date(Qe).toISOString().split("T")[0]))}_getLayerColorStyle(Qe){var rt,Wn,Co,Ul,Gl,Zl,Hl,ql;const Ql=["case",["==",["get","hidden"],!0],Dl.COLORS.HIDDEN],Kl=(null===(rt=this._parent.psv)||void 0===rt||null===(Wn=rt._myVTour)||void 0===Wn||null===(Co=Wn.state)||void 0===Co?void 0:Co.loadingNode)||(null===(Ul=this._parent.psv)||void 0===Ul||null===(Gl=Ul._myVTour)||void 0===Gl||null===(Zl=Gl.state)||void 0===Zl||null===(Hl=Zl.currentNode)||void 0===Hl?void 0:Hl.id),$l=Kl?null===(ql=this._parent.psv)||void 0===ql?void 0:ql._picturesSequences[Kl]:null;if("sequences"==Qe&&$l?Ql.push(["==",["get","id"],$l],Dl.COLORS.SELECTED):"pictures"==Qe&&$l&&Ql.push(["in",$l,["get","sequences"]],Dl.COLORS.SELECTED),this._mapFilters.theme==Rl.AGE){const rt="sequences"==Qe?"date":"ts",Wn=this._getDatesForLayerColors();Ql.push(["!",["has",rt]],Dl.COLORS.BASE,[">=",["get",rt],Wn[0]],Dl.COLORS.PALETTE_4,[">=",["get",rt],Wn[1]],Dl.COLORS.PALETTE_3,[">=",["get",rt],Wn[2]],Dl.COLORS.PALETTE_2,Dl.COLORS.PALETTE_1)}else this._mapFilters.theme==Rl.TYPE?Ql.push(["!",["has","type"]],Dl.COLORS.BASE,["==",["get","type"],"equirectangular"],Dl.COLORS.QUALI_1,Dl.COLORS.QUALI_2):this._mapFilters.theme==Rl.SCORE?Ql.push(["==",Ll.MAP_EXPR_QUALITYSCORE,5],Dl.QUALITYSCORE_VALUES[0].color,["==",Ll.MAP_EXPR_QUALITYSCORE,4],Dl.QUALITYSCORE_VALUES[1].color,["==",Ll.MAP_EXPR_QUALITYSCORE,3],Dl.QUALITYSCORE_VALUES[2].color,["==",Ll.MAP_EXPR_QUALITYSCORE,2],Dl.QUALITYSCORE_VALUES[3].color,Dl.QUALITYSCORE_VALUES[4].color):Ql.push(Dl.COLORS.BASE);return Ql}_getLayerSortStyle(Qe){var rt,Wn,Co,Dl,Ul,Gl,Zl,Hl;const ql=["case",["==",["get","hidden"],!0],90],Ql=(null===(rt=this._parent.psv)||void 0===rt||null===(Wn=rt._myVTour)||void 0===Wn||null===(Co=Wn.state)||void 0===Co?void 0:Co.loadingNode)||(null===(Dl=this._parent.psv)||void 0===Dl||null===(Ul=Dl._myVTour)||void 0===Ul||null===(Gl=Ul.state)||void 0===Gl||null===(Zl=Gl.currentNode)||void 0===Zl?void 0:Zl.id),Kl=Ql?null===(Hl=this._parent.psv)||void 0===Hl?void 0:Hl._picturesSequences[Ql]:null;if("sequences"==Qe&&Kl?ql.push(["==",["get","id"],Kl],100):"pictures"==Qe&&Kl&&ql.push(["in",Kl,["get","sequences"]],100),this._mapFilters.theme==Rl.AGE){const rt="sequences"==Qe?"date":"ts",Wn=this._getDatesForLayerColors();ql.push(["!",["has",rt]],0,[">=",["get",rt],Wn[0]],50,[">=",["get",rt],Wn[1]],49,[">=",["get",rt],Wn[2]],48)}else this._mapFilters.theme==Rl.TYPE?ql.push(["!",["has","type"]],0,["==",["get","type"],"equirectangular"],50):this._mapFilters.theme==Rl.SCORE&&ql.push(["==",Ll.MAP_EXPR_QUALITYSCORE,5],80,["==",Ll.MAP_EXPR_QUALITYSCORE,4],65,["==",Ll.MAP_EXPR_QUALITYSCORE,3],50,["==",Ll.MAP_EXPR_QUALITYSCORE,2],35,["==",Ll.MAP_EXPR_QUALITYSCORE,1],20);return ql.push(10),ql}setFilters(Qe){let rt=arguments.length>1&&void 0!==arguments[1]&&arguments[1],Wn=[],Co=[],Dl=!1;if(this._mapFilters={},Qe.minDate&&""!==Qe.minDate&&(this._mapFilters.minDate=Qe.minDate,Wn.push([">=",["get","date"],Qe.minDate]),Co.push([">=",["get","ts"],Qe.minDate])),Qe.maxDate&&""!==Qe.maxDate){this._mapFilters.maxDate=Qe.maxDate,Wn.push(["<=",["get","date"],Qe.maxDate]);let rt=new Date(Qe.maxDate);rt.setDate(rt.getDate()+1),rt=rt.toISOString().split("T")[0],Co.push(["<=",["get","ts"],rt])}if(Qe.pic_type&&""!==Qe.pic_type&&(this._mapFilters.pic_type="flat"===Qe.pic_type?"flat":"equirectangular",Wn.push(["==",["get","type"],this._mapFilters.pic_type]),Co.push(["==",["get","type"],this._mapFilters.pic_type])),this._hasGridStats()&&(Dl=!0),Qe.camera&&""!==Qe.camera){this._mapFilters.camera=Qe.camera;const rt=Qe.camera.toLowerCase().trim()+" ",Dl=Qe.camera.toLowerCase().trim()+"zzzzzzzzzzzzzzzzzzzz",Ll=["collator",{"case-sensitive":!1,"diacritic-sensitive":!1}];Wn.push([">=",["get","model"],rt,Ll]),Wn.push(["<=",["get","model"],Dl,Ll]),Co.push([">=",["get","model"],rt,Ll]),Co.push(["<=",["get","model"],Dl,Ll])}Qe.qualityscore&&Qe.qualityscore.length>0&&(this._mapFilters.qualityscore=Qe.qualityscore,Wn.push(["in",Ll.MAP_EXPR_QUALITYSCORE,["literal",this._mapFilters.qualityscore]]),Co.push(["in",Ll.MAP_EXPR_QUALITYSCORE,["literal",this._mapFilters.qualityscore]])),Qe.theme&&Object.values(Rl).includes(Qe.theme)&&(this._mapFilters.theme=Qe.theme,Dl=!0),0==Wn.length?Wn=null:Wn.unshift("all"),0==Co.length?Co=null:(Co.unshift("all"),Co=["step",["zoom"],!0,Ll.TILES_PICTURES_ZOOM,Co]),Dl&&this.reloadLayersStyles();const Ul=this.getVisibleUsers().includes("geovisio");Wn&&Ul&&(Wn=["step",["zoom"],!0,7,Wn]),this.filterUserLayersContent("sequences",Wn),this.filterUserLayersContent("pictures",Co),!rt&&(null!==Wn||null!==Co||null!==this._mapFilters.theme&&this._mapFilters.theme!==Rl.DEFAULT)&&Ul&&this.getZoom()<7&&!this._hasGridStats()&&this.easeTo({zoom:7}),this.fire("filters-changed",Object.assign({},this._mapFilters))}}},9048:(Qe,rt,Wn)=>{"use strict";Wn.d(rt,{Ay:()=>Photo,LM:()=>$l,Vf:()=>Tc,cS:()=>Kl});Wn(5003);var Co=Wn(5975),Dl=Wn(2305),Ll=Wn(7343),Rl=Wn(508),Ul=(Wn(3961),Wn(1080),Wn(2710),Wn(1575),Wn(1545)),Gl=Wn(3348),Zl=Wn(4991),Hl=Wn(3727);const ql={baseUrl:Co,width:1280,cols:2,rows:1,tileUrl:()=>null},Ql={id:Ll.BASE_PANORAMA_ID,caption:"",panorama:ql,links:[],gps:[0,0],sequence:{},sphereCorrection:{},horizontalFov:360,properties:{}},Kl=30,$l=250,Tc=3e3;Ul.jM.useNewAnglesOrder=!0;class Photo extends Ul.jM{constructor(Qe,rt){var Wn,Co;let Dl=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};super({container:rt,adapter:[Hl.A,{showErrorTile:!1,baseBlur:!1,resolution:Qe.isWidthSmall()?32:64,shouldGoFast:Dl.shouldGoFast}],withCredentials:"include"==(null===Qe||void 0===Qe||null===(Wn=Qe.fetchOptions)||void 0===Wn?void 0:Wn.credentials),requestHeaders:null===Qe||void 0===Qe||null===(Co=Qe.fetchOptions)||void 0===Co?void 0:Co.headers,panorama:ql,lang:Qe._t.psv,minFov:5,loadingTxt:"&nbsp;",navbar:null,rendererParameters:{preserveDrawingBuffer:!Qe.isWidthSmall()},plugins:[[Gl.$,{dataMode:"server",positionMode:"gps",renderMode:"3d",preload:!0,getNode:()=>{},transitionOptions:()=>{},arrowsPosition:{linkOverlapAngle:Math.PI/6}}],[Zl.b,{}]],...Dl}),this._parent=Qe,this._options=Dl,rt.classList.add("pnx-psv"),this._shouldGoFast=(null===Dl||void 0===Dl?void 0:Dl.shouldGoFast)||(()=>!1),this._transitionDuration=(null===Dl||void 0===Dl?void 0:Dl.transitionDuration)||$l,this._myVTour=this.getPlugin(Gl.$),this._myVTour.datasource.nodeResolver=this._getNodeFromAPI.bind(this),this._myVTour.config.transitionOptions=this._psvNodeTransition.bind(this),this._clearArrows=this._myVTour.arrowsRenderer.clear.bind(this._myVTour.arrowsRenderer),this._myVTour.arrowsRenderer.clear=()=>{},this._myMarkers=this.getPlugin(Zl.b),this._annotationsVisible=!1,this._sequencePlaying=!1,this._picturesNavigation=this._options.picturesNavigation||"any",this._picturesSequences={},this._myVTour.addEventListener("enter-arrow",this._onEnterArrow.bind(this)),this._myVTour.addEventListener("leave-arrow",this._onLeaveArrow.bind(this)),this._myVTour.addEventListener("node-changed",this._onNodeChanged.bind(this)),this._myMarkers.addEventListener("select-marker",this._onSelectMarker.bind(this)),this.addEventListener("position-updated",this._onPositionUpdated.bind(this)),this.addEventListener("zoom-updated",this._onZoomUpdated.bind(this)),this.addEventListener("dblclick",this._onDoubleClick.bind(this)),this._parent.addEventListener("select",this._onSelect.bind(this)),this.loader.size=150,this.loader.color="rgba(61, 61, 61, 0.5)",this.loader.textColor="rgba(255, 255, 255, 0.7)",this.loader.border=5,this.loader.thickness=10,this.loader.canvas.setAttribute("viewBox","0 0 150 150"),this.loader.__updateContent(),this._options.position&&!this._parent.picture&&this.goToPosition(...this._options.position)}async _getNodeFromAPI(Qe){var rt,Wn;if((0,Ll.isNullId)(Qe))return Ql;const Co=await fetch(this._parent.api.getPictureMetadataUrl(Qe,this._picturesSequences[Qe]),this._parent.api._getFetchOptions());let Dl=await Co.json();if(Dl.features&&(Dl=Dl.features.pop()),!Dl||0===Object.keys(Dl).length||!Co.ok)throw this._parent.loader&&this._parent.loader.dismiss(!0,this._parent._t.pnx.error_pic),new Error("Picture with ID "+Qe+" was not found");this._picturesSequences[Qe]=Dl.collection;const Ul=(0,Rl.apiFeatureToPSVNode)(Dl,this._parent._t,this._parent._isInternetFast,this._picturesNavFilter.bind(this));var Gl,Zl;null!==Ul&&void 0!==Ul&&null!==(rt=Ul.sequence)&&void 0!==rt&&rt.prevPic&&(this._picturesSequences[null===Ul||void 0===Ul||null===(Gl=Ul.sequence)||void 0===Gl?void 0:Gl.prevPic]=Dl.collection);null!==Ul&&void 0!==Ul&&null!==(Wn=Ul.sequence)&&void 0!==Wn&&Wn.nextPic&&(this._picturesSequences[null===Ul||void 0===Ul||null===(Zl=Ul.sequence)||void 0===Zl?void 0:Zl.nextPic]=Dl.collection);return Ul}_psvNodeTransition(Qe,rt,Wn){var Co,Dl,Rl;let Ul={};const Gl=this._shouldGoFast()?0:Math.min($l,this._transitionDuration),Zl=Gl>100,Hl=null!=(Wn||(null===rt||void 0===rt?void 0:rt.links.find((rt=>rt.nodeId==Qe.id)))),ql=rt&&Qe.sequence.id===rt.sequence.id,Ql=((null===rt||void 0===rt||null===(Co=rt.properties)||void 0===Co?void 0:Co["view:azimuth"])||0)*(Math.PI/180),Tc=((null===Qe||void 0===Qe||null===(Dl=Qe.properties)||void 0===Dl?void 0:Dl["view:azimuth"])||0)*(Math.PI/180),tu=(0,Ll.getRelativeHeading)(Qe)*(Math.PI/180);this.setOption("maxFov",Math.min(3*Qe.horizontalFov/4,90));const lu={showLoader:!1,effect:"none",speed:0,rotation:!1,rotateTo:{pitch:0,yaw:-tu},zoomTo:Kl};if(360==Qe.horizontalFov)Ul=rt?(0,Ll.getDistance)(rt.gps,Qe.gps)>=.001?lu:{speed:Gl,effect:Hl&&Zl?"fade":"none",rotation:Hl&&ql&&Zl,rotateTo:this.getPosition()}:lu;else if(ql){const Qe=this.getPosition().yaw,Wn=rt.horizontalFov*(Math.PI/180)/2,Co=Qe<=Wn||Qe>=2*Math.PI-Wn,Dl=Math.abs(Ql-Tc)<=Math.PI/4;Ul={speed:Gl,effect:Hl&&Dl&&Zl?"fade":"none",rotation:Hl&&Dl&&Zl,rotateTo:Co?this.getPosition():{pitch:0,yaw:0},zoomTo:Co?this.getZoomLevel():Kl}}else Ul=Object.assign(lu,{rotateTo:{pitch:0,yaw:0}});"fade"===Ul.effect&&Ul.speed>=150?setTimeout(this._clearArrows,Ul.speed-100):this._clearArrows();const du=new CustomEvent("picture-loading",{detail:{...Object.assign({},this.getXYZ(),Ul.rotateTo?{x:180*(Tc+Ul.rotateTo.yaw)/Math.PI}:null,Ul.zoomTo?{z:Ul.zoomTo}:null),picId:Qe.id,lon:Qe.gps[0],lat:Qe.gps[1],first:(null===(Rl=this._parent._initParams)||void 0===Rl?void 0:Rl.getParentPostInit().picture)==Qe.id}});return this.dispatchEvent(du),Ul}_onEnterArrow(Qe){const rt=Qe.link,Wn=Qe.node;let Co;Wn&&(Co=360===Wn.horizontalFov?(this.getPictureOriginalHeading()+180*this.getPosition().yaw/Math.PI)%360:this.getPictureOriginalHeading());const Dl=new CustomEvent("picture-preview-started",{detail:{picId:rt.nodeId,coordinates:rt.gps,direction:Co}});this.dispatchEvent(Dl)}_onLeaveArrow(Qe){const rt=Qe.link,Wn=new CustomEvent("picture-preview-stopped",{detail:{picId:rt.nodeId}});this.dispatchEvent(Wn)}_onPositionUpdated(Qe){let{position:rt}=Qe;const Wn=(0,Ll.positionToXYZ)(rt,this.getZoomLevel());Wn.x+=this.getPictureOriginalHeading(),Wn.x=Wn.x%360;const Co=new CustomEvent("view-rotated",{detail:Wn});this.dispatchEvent(Co),this._onTilesStartLoading()}_onZoomUpdated(Qe){let{zoomLevel:rt}=Qe;const Wn=new CustomEvent("view-rotated",{detail:{...this.getXY(),z:rt}});this.dispatchEvent(Wn),this._onTilesStartLoading()}_onDoubleClick(){this.unfocusAnnotation()}_onNodeChanged(Qe){for(let Dl of document.getElementsByClassName("pnx-psv-tour-arrows"))Dl.classList.remove("pnx-clicked");if(Qe.node.id){var rt,Wn,Co;const Dl=(null===(rt=this._parent._initParams)||void 0===rt?void 0:rt.getParentPostInit().picture)==Qe.node.id;this._parent.select(null===(Wn=Qe.node)||void 0===Wn||null===(Co=Wn.sequence)||void 0===Co?void 0:Co.id,Qe.node.id);const Ll=this.getPictureMetadata();if(!Ll)return void this.dispatchEvent(new CustomEvent("picture-loaded",{detail:{}}));this._prevSequence=Ll.sequence.id;const Rl=new CustomEvent("picture-loaded",{detail:{...this.getXYZ(),picId:Qe.node.id,lon:Ll.gps[0],lat:Ll.gps[1],first:Dl}});this.dispatchEvent(Rl),Ll.panorama.hdUrl?(this.setOption("downloadUrl",Ll.panorama.hdUrl),this.setOption("downloadName",Qe.node.id+".jpg")):this.setOption("downloadUrl",null),this._annotationsVisible&&this.toggleAllAnnotations(!0)}this._onTilesStartLoading()}_onSelectMarker(Qe){var rt;if(Qe.marker&&null!==(rt=Qe.marker.id)&&void 0!==rt&&rt.startsWith("annotation-")){const rt=new CustomEvent("annotation-click",{detail:{annotationId:Qe.marker.data.id}});this.dispatchEvent(rt)}}_onTilesStartLoading(){this._tilesQueueTimer&&(clearInterval(this._tilesQueueTimer),delete this._tilesQueueTimer),this._tilesQueueTimer=setInterval((()=>{if(0===Object.keys(this.adapter.queue.tasks).length){if(this._myVTour.state.currentNode){const Qe=new CustomEvent("picture-tiles-loaded",{detail:{picId:this._myVTour.state.currentNode.id}});this.dispatchEvent(Qe)}clearInterval(this._tilesQueueTimer),delete this._tilesQueueTimer}}),100)}getPictureMetadata(){var Qe,rt,Wn;return(0,Ll.isNullId)(null===(Qe=this._myVTour)||void 0===Qe||null===(rt=Qe.state)||void 0===rt||null===(Wn=rt.currentNode)||void 0===Wn?void 0:Wn.id)?null:this._myVTour.state.currentNode?Object.assign({},this._myVTour.state.currentNode):null}getPictureId(){var Qe,rt,Wn,Co,Dl;const Rl=(null===(Qe=this._myVTour)||void 0===Qe||null===(rt=Qe.state)||void 0===rt?void 0:rt.loadingNode)||(null===(Wn=this._myVTour)||void 0===Wn||null===(Co=Wn.state)||void 0===Co||null===(Dl=Co.currentNode)||void 0===Dl?void 0:Dl.id);return(0,Ll.isNullId)(Rl)?null:Rl}_onSelect(Qe){var rt;Qe.detail.seqId&&(this._picturesSequences[Qe.detail.picId]=Qe.detail.seqId),(null===(rt=this._myVTour.getCurrentNode())||void 0===rt?void 0:rt.id)!==Qe.detail.picId&&(this.loader.show(),this._myVTour.setCurrentNode(Qe.detail.picId).catch((Qe=>{this.showErrorOverlay(Qe,this._parent._t.pnx.error_pic,!0)})))}goToNextPicture(){if(!this.getPictureMetadata())throw new Error("No picture currently selected");const Qe=this.getPictureMetadata().sequence.nextPic;if(!Qe)throw new Error("No next picture available");this._parent.select(this.getPictureMetadata().sequence.id,Qe)}goToPrevPicture(){if(!this.getPictureMetadata())throw new Error("No picture currently selected");const Qe=this.getPictureMetadata().sequence.prevPic;if(!Qe)throw new Error("No previous picture available");this._parent.select(this.getPictureMetadata().sequence.id,Qe)}async goToPosition(Qe,rt){return this._parent.api.getPicturesAroundCoordinates(Qe,rt).then((Qe=>{if(Qe.features.length>0){const rt=Qe.features.pop();return this._parent.select(null===rt||void 0===rt?void 0:rt.collection,rt.id),rt.id}return Promise.reject(new Error("No picture found nearby given coordinates"))}))}getXY(){const Qe=(0,Ll.positionToXYZ)(this.getPosition());return Qe.x=(Qe.x+this.getPictureOriginalHeading())%360,Qe}getXYZ(){const Qe=this.getXY();return Qe.z=this.getZoomLevel(),Qe}getPictureOriginalHeading(){var Qe,rt;return(null===(Qe=this.getPictureMetadata())||void 0===Qe||null===(rt=Qe.properties)||void 0===rt?void 0:rt["view:azimuth"])||0}getPictureRelativeHeading(){return(0,Ll.getRelativeHeading)(this.getPictureMetadata())}clearPictureMetadataCache(){var Qe,rt,Wn,Co;const Dl=null===(Qe=this.getPictureMetadata())||void 0===Qe?void 0:Qe.id,Ll=null===(rt=this.getPictureMetadata())||void 0===rt||null===(Wn=rt.sequence)||void 0===Wn?void 0:Wn.id;null===(Co=this._myVTour.state.currentTooltip)||void 0===Co||Co.hide(),this._myVTour.state.currentTooltip=null,this._myVTour.state.currentNode=null,this._myVTour.state.preload={},this._myVTour.datasource.nodes={},Dl&&this._parent.select(Ll,Dl)}setXYZ(Qe,rt,Wn){const Co=(0,Ll.xyzToPosition)(Qe-this.getPictureOriginalHeading(),rt,Wn);this.rotate({yaw:Co.yaw,pitch:Co.pitch}),this.zoom(Co.zoom)}setHigherContrast(Qe){this.renderer.renderer.toneMapping=Qe?3:0,this.renderer.renderer.toneMappingExposure=Qe?2:1,this.needsUpdate()}getTransitionDuration(){return this._transitionDuration}setTransitionDuration(Qe){if((Qe=parseFloat(Qe))<100||Qe>Tc)throw new Error("Invalid transition duration (should be between 100 and "+Tc+")");this._transitionDuration=Qe;const rt=new CustomEvent("transition-duration-changed",{detail:{value:Qe}});this.dispatchEvent(rt)}setPanorama(Qe,rt){const onFailure=Qe=>{var rt;return this.showErrorOverlay(Qe,null===(rt=this._parent)||void 0===rt?void 0:rt._t.pnx.error_pic,!0)};try{return super.setPanorama(Qe,rt).catch(onFailure)}catch(Wn){onFailure(Wn)}}showErrorOverlay(Qe,rt,Wn){var Co,Ll,Rl,Ul;null!==(Co=this._parent)&&void 0!==Co&&Co.loader.isVisible()||!this.overlay.isVisible()?null===(Ll=this._parent)||void 0===Ll||Ll.loader.dismiss(Qe,rt,Wn?()=>{var Qe;null===(Qe=this._parent)||void 0===Qe||Qe.loader.dismiss(),this.overlay.hide()}:void 0):(console.error(Qe),this.overlay.show({image:`<img style="width: 200px" src="${Dl}" alt="" />`,title:null===(Rl=this._parent)||void 0===Rl?void 0:Rl._t.pnx.error,text:rt+"<br />"+(null===(Ul=this._parent)||void 0===Ul?void 0:Ul._t.pnx.error_click),dissmisable:Wn}))}playSequence(){this._sequencePlaying=!0;const Qe=new Event("sequence-playing",{bubbles:!0,composed:!0});this.dispatchEvent(Qe);const nextPicturePlay=()=>{if(this._sequencePlaying){this.addEventListener("picture-loaded",(()=>{this._playTimer=setTimeout((()=>{nextPicturePlay()}),this.getTransitionDuration())}),{once:!0});try{this.goToNextPicture()}catch(Qe){this.stopSequence()}}};this.addEventListener("click",(()=>this.stopSequence())),nextPicturePlay()}stopSequence(){this._sequencePlaying=!1,this._playTimer&&(clearTimeout(this._playTimer),delete this._playTimer),this.forceRefresh();const Qe=new Event("sequence-stopped",{bubbles:!0,composed:!0});this.dispatchEvent(Qe)}isSequencePlaying(){return this._sequencePlaying}toggleSequencePlaying(){this.isSequencePlaying()?this.stopSequence():this.playSequence()}getPicturesNavigation(){return this._picturesNavigation}setPicturesNavigation(Qe){"none"===Qe&&(Qe="pic"),this._picturesNavigation=Qe;const rt=new CustomEvent("pictures-navigation-changed",{detail:{value:Qe}});this.dispatchEvent(rt)}_picturesNavFilter(Qe){switch(this._picturesNavigation){case"seq":return["next","prev"].includes(Qe.rel);case"pic":case"none":return!1;default:return!0}}areAnnotationsVisible(){return this._annotationsVisible}toggleAllAnnotations(Qe){const rt=this.getPictureMetadata();if(!rt)throw this._myMarkers.clearMarkers(),new Error("No picture currently selected");if(Qe){var Wn;let Qe=rt.properties.annotations;0===Qe.length&&console.warn("No annotation available on picture",rt.id);const Co=null===(Wn=this.state.textureData.panoData)||void 0===Wn?void 0:Wn.baseData;Qe=Qe.map((Qe=>{const rt=this.getPictureMetadata().properties["pers:interior_orientation"].sensor_array_dimensions;if(!rt)return console.warn("Picture lacks pers:interior_orientation.sensor_array_dimensions property, can't compute marker"),null;const Wn=Qe.shape.coordinates.map((Qe=>Qe.map((Qe=>{const Wn=[Qe[0]*Co.croppedWidth/rt[0],Qe[1]*Co.croppedHeight/rt[1]],Dl=[(Co.croppedX+Wn[0])/Co.fullWidth,(Co.croppedY+Wn[1])/Co.fullHeight];return[2*(Dl[0]-.5)*Math.PI,(.5-Dl[1])*Math.PI]}))));return{id:`annotation-${Qe.id}`,polygon:Wn,data:{id:Qe.id},svgStyle:{stroke:"var(--orange)",strokeWidth:"3px",fill:"var(--orange-transparent)",cursor:"pointer"},tooltip:this._parent._t.pnx.semantics_annotation_tooltip}})),this._myMarkers.setMarkers(Qe)}else this._myMarkers.clearMarkers();const Co=this._annotationsVisible!=Qe;this._annotationsVisible=Qe,Co&&this.dispatchEvent(new CustomEvent("annotations-toggled",{detail:{visible:Qe}}))}focusOnAnnotation(Qe){this.areAnnotationsVisible()||this.toggleAllAnnotations(!0),this.unfocusAnnotation(!0);const rt=`annotation-${Qe}`;this._myMarkers.updateMarker({id:rt,svgStyle:{stroke:"var(--red)",strokeWidth:"3px",fill:"var(--red-transparent)"},data:{selected:!0}}),this._myMarkers.gotoMarker(rt,0),this.zoom(65)}unfocusAnnotation(){let Qe=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const rt=Object.keys(this._myMarkers.markers).filter((Qe=>{var rt,Wn,Co;return Qe.startsWith("annotation-")&&(null===(rt=this._myMarkers.markers[Qe])||void 0===rt||null===(Wn=rt.config)||void 0===Wn||null===(Co=Wn.data)||void 0===Co?void 0:Co.selected)}));rt.length>0&&(rt.forEach((Qe=>{this._myMarkers.updateMarker({id:Qe,svgStyle:{stroke:"var(--orange)",strokeWidth:"3px",fill:"var(--orange-transparent)"},data:{selected:!1}})})),Qe||this.dispatchEvent(new Event("annotations-unfocused")))}forceRefresh(){var Qe;const rt=this._myVTour.getCurrentNode();if(rt&&rt.panorama.baseUrl!==(null===rt||void 0===rt||null===(Qe=rt.panorama)||void 0===Qe?void 0:Qe.origBaseUrl)){const Qe=this.getZoomLevel(),Wn=this.getPosition();this._myVTour.state.currentNode=null,this._myVTour.setCurrentNode(rt.id,{zoomTo:Qe,rotateTo:Wn,fadeIn:!1,speed:0,rotation:!1})}rt&&rt.panorama.rows>1&&this.adapter.__refresh()}}},4374:(Qe,rt,Wn)=>{"use strict";Wn.d(rt,{A:()=>Popup});var Co=Wn(4542),Dl=Wn(5995),Ll=Wn(8591),Rl=Wn(6627);class Popup extends Co.WF{constructor(){super(),this.visible=!1}connectedCallback(){super.connectedCallback(),this.addEventListener("click",(Qe=>{Qe.target===this&&this.close()})),document.addEventListener("keyup",(Qe=>{"Escape"===Qe.key&&this.visible&&this.close()}))}attributeChangedCallback(Qe,rt,Wn){super.attributeChangedCallback(Qe,rt,Wn),"visible"==Qe&&(""!==Wn&&!0!==Wn||this.dispatchEvent(new Event("open")))}close(){this.visible=!1,this.dispatchEvent(new Event("close"))}render(){return Co.qy`
1711
+ `,Loader.properties={_mode:{state:!0},_label:{state:!0},_isLabelFun:{state:!0},visible:{type:Boolean,reflect:!0},"no-label":{type:Boolean},value:{type:Number}},customElements.define("pnx-loader",Loader)},5642:(Qe,rt,Wn)=>{"use strict";Wn.d(rt,{A:()=>Map});Wn(3041);var Co=Wn(8340),Dl=Wn(7343),Ll=Wn(6883),Rl=Wn(270),Ul=Wn(6462),Gl=Wn(9740),Zl=(Wn(6795),Wn(927)),Hl=Wn.n(Zl),ql=Wn(2968),Ql=Wn.n(ql),Kl=Wn(748);Hl().workerClass=Ql(),Hl().addProtocol("pmtiles",(new Kl.Zs).tile);class Map extends Hl().Map{constructor(Qe,rt){let Wn=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};var Dl;(super({container:rt,style:(0,Co.combineStyles)(Qe,Wn),center:[0,0],zoom:0,maxZoom:24,attributionControl:!1,dragRotate:!1,pitchWithRotate:!1,touchZoomRotate:!0,touchPitch:!1,doubleClickZoom:!1,canvasContextAttributes:{preserveDrawingBuffer:!Qe.isWidthSmall()},transformRequest:Qe.api._getMapRequestTransform(),locale:Qe._t.maplibre,hash:!1,...Wn}),this._loadMarkerImages(),this._parent=Qe,this._options=Wn,this.getContainer().classList.add("pnx-map"),void 0===Wn.touchZoomRotate)&&(null===this||void 0===this||null===(Dl=this.touchZoomRotate)||void 0===Dl||Dl.disableRotation());this._options.raster&&(this._options.background=this._options.background||"streets"),this._attribution=new(Hl().AttributionControl)({compact:!1,...Wn.attributionControl}),this.addControl(this._attribution),this._initMapPosition(),this._picMarker=this._getPictureMarker(),this._picMarkerPreview=this._getPictureMarker(!1),this._picThumbUrl={},this._seqPictures={},this._userLayers=new Set,this._parent.addEventListener("select",this.reloadLayersStyles.bind(this)),setTimeout((()=>{var Qe;!this.loaded()&&null!==(Qe=this._parent)&&void 0!==Qe&&Qe.loader.isVisible()&&this._parent.loader.dismiss({},this._parent._t.map.slow_loading,(async()=>{await this._postLoad(),this._parent.loader.dismiss()}))}),15e3),this.waitForEnoughMapLoaded().then((async()=>await this._postLoad()))}async _postLoad(){this.resize(),await this.setVisibleUsers(this._parent.users),this.reloadLayersStyles(),this.fire("ready")}destroy(){this.remove(),delete this._parent,delete this._options,delete this._attribution,delete this._picMarker,delete this._picMarkerPreview,delete this._picThumbUrl,delete this._seqPictures,delete this._userLayers}waitForEnoughMapLoaded(){return new Promise((Qe=>{let rt=0,Wn=0,Co=0,Dl=0;const onSourceDataLoading=Qe=>{"source"===Qe.dataType&&Qe.tile&&(Qe.sourceId.startsWith("geovisio")?Wn++:rt++)},onSourceData=Qe=>{"source"===Qe.dataType&&Qe.tile&&(Qe.sourceId.startsWith("geovisio")?(Dl++,Qe.isSourceLoaded&&(Dl=Wn)):(Co++,Qe.isSourceLoaded&&(Co=rt))),checkEnoughLoaded()},checkEnoughLoaded=()=>{Co/rt>=.75&&(0===Wn||Dl/Wn>=.75)&&(this.off("sourcedata",onSourceData),this.off("sourcedataloading",onSourceDataLoading),Qe())};this.on("sourcedataloading",onSourceDataLoading),this.on("sourcedata",onSourceData)}))}_initMapPosition(){this._options.center&&this._options.center!=[0,0]||this._options.zoom&&0!==this._options.zoom||this._options.hash||this._parent.onceAPIReady().then((()=>{var Qe,rt;let Wn=null===(Qe=this._parent)||void 0===Qe||null===(rt=Qe.api)||void 0===rt?void 0:rt.getDataBbox();if(Wn)try{Wn=new(Hl().LngLatBounds)(Wn),this.loaded()?this.fitBounds(Wn,{animate:!1}):this.waitForEnoughMapLoaded().then((()=>this.fitBounds(Wn,{animate:!1})))}catch(Co){console.warn("Received invalid bbox: "+Wn)}}))}_loadMarkerImages(){[{id:"pnx-marker",img:Ll},{id:"pnx-arrow-flat",img:Ul},{id:"pnx-arrow-360",img:Gl}].forEach((Qe=>{const rt=new Image(64,64);rt.onload=()=>this.addImage(Qe.id,rt),rt.src=Qe.img}))}_hasQualityScore(){var Qe,rt,Wn,Co;const Dl=(null===(Qe=this.getStyle())||void 0===Qe||null===(rt=Qe.metadata)||void 0===rt?void 0:rt["panoramax:fields"])||{};return(null===Dl||void 0===Dl||null===(Wn=Dl.pictures)||void 0===Wn?void 0:Wn.includes("gps_accuracy"))&&(null===Dl||void 0===Dl||null===(Co=Dl.pictures)||void 0===Co?void 0:Co.includes("h_pixel_density"))}_hasGridStats(){var Qe,rt,Wn,Co,Dl,Ll;const Rl=(null===(Qe=this.getStyle())||void 0===Qe||null===(rt=Qe.metadata)||void 0===rt?void 0:rt["panoramax:fields"])||{};return(null===Rl||void 0===Rl||null===(Wn=Rl.grid)||void 0===Wn?void 0:Wn.includes("nb_360_pictures"))&&(null===Rl||void 0===Rl||null===(Co=Rl.grid)||void 0===Co?void 0:Co.includes("nb_flat_pictures"))&&(null===Rl||void 0===Rl||null===(Dl=Rl.grid)||void 0===Dl?void 0:Dl.includes("coef_360_pictures"))&&(null===Rl||void 0===Rl||null===(Ll=Rl.grid)||void 0===Ll?void 0:Ll.includes("coef_flat_pictures"))}reloadVectorTiles(){[...this._userLayers].forEach((Qe=>{const rt=this.getSource((0,Co.getUserSourceId)(Qe));rt.setTiles(rt.tiles)}))}hasTwoBackgrounds(){return void 0!==this.getLayer(Co.RASTER_LAYER_ID)}getBackground(){if(!this.getLayer(Co.RASTER_LAYER_ID))return"streets";return"visible"==this.getLayoutProperty(Co.RASTER_LAYER_ID,"visibility")?"aerial":"streets"}setBackground(Qe){if(!this.getLayer(Co.RASTER_LAYER_ID)&&"aerial"===Qe)throw new Error("No aerial imagery available");this.getLayer(Co.RASTER_LAYER_ID)&&(this.setLayoutProperty(Co.RASTER_LAYER_ID,"visibility","aerial"===Qe?"visible":"none"),this.fire("background-changed",{background:Qe||"streets"}))}getVisibleUsers(){return[...this._userLayers].filter((Qe=>this.getLayer((0,Co.getUserLayerId)(Qe,"pictures"))&&"visible"===this.getLayoutProperty((0,Co.getUserLayerId)(Qe,"pictures"),"visibility")))}onceLayerReady(Qe){return this.getLayer(Qe)?Promise.resolve():new Promise((Qe=>{setTimeout(Qe,250)})).then((()=>this.onceLayerReady(Qe)))}async setVisibleUsers(){let Qe=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];"string"===typeof Qe?Qe=[Qe]:null===Qe&&(Qe=[]),await Promise.all(Qe.filter((Qe=>""!=Qe&&!this._userLayers.has(Qe))).map((Qe=>(this._createPicturesTilesLayer(Qe),this.onceLayerReady((0,Co.getUserLayerId)(Qe,"pictures"))))));const rt=["pictures","sequences","sequences_plus","grid","pictures_symbols"];[...this._userLayers].forEach((Wn=>{rt.forEach((rt=>{const Dl=(0,Co.getUserLayerId)(Wn,rt);this.getLayer(Dl)&&this.setLayoutProperty(Dl,"visibility",Qe.includes(Wn)?"visible":"none")}))})),this.reloadLayersStyles(),this.fire("users-changed",{usersIds:Qe})}filterUserLayersContent(Qe,rt){[...this._userLayers].forEach((Wn=>{this.getLayer((0,Co.getUserLayerId)(Wn,Qe))?(this.setFilter((0,Co.getUserLayerId)(Wn,Qe),rt),"sequences"===Qe&&this.getLayer((0,Co.getUserLayerId)(Wn,"sequences_plus"))&&this.setFilter((0,Co.getUserLayerId)(Wn,"sequences_plus"),rt),"pictures"===Qe&&this.getLayer((0,Co.getUserLayerId)(Wn,"pictures_symbols"))&&this.setFilter((0,Co.getUserLayerId)(Wn,"pictures_symbols"),rt)):console.warn("Layer",(0,Co.getUserLayerId)(Wn,Qe),"not ready")}))}displayPictureMarker(Qe,rt,Wn){let Dl=arguments.length>3&&void 0!==arguments[3]&&arguments[3];this._picMarkerPreview.remove(),void 0!==Qe&&void 0!==rt?this._picMarker.setLngLat([Qe,rt]).setRotation(Wn).addTo(this):this._picMarker.remove(),this.reloadLayersStyles(),Dl||void 0===Qe||void 0===rt||this.flyTo({center:[Qe,rt],zoom:this.getZoom()<Co.TILES_PICTURES_ZOOM+2?Co.TILES_PICTURES_ZOOM+2:this.getZoom(),maxDuration:2e3})}reloadLayersStyles(){const updateStyle=(Qe,rt)=>{[...this._userLayers].forEach((Wn=>{const Dl=(0,Co.getUserLayerId)(Wn,Qe);if(this.getLayer(Dl)){for(let Qe in rt.layout)this.setLayoutProperty(Dl,Qe,rt.layout[Qe]);for(let Qe in rt.paint)this.setPaintProperty(Dl,Qe,rt.paint[Qe])}else console.warn("Layer",Dl,"not ready")}))};["pictures","pictures_symbols","sequences"].forEach((Qe=>{updateStyle(Qe,this._getLayerStyleProperties(Qe))}))}async _createPicturesTilesLayer(Qe){this._userLayers.add(Qe);const rt=this.getStyle().layers.find(Co.isLabelLayer);if("geovisio"!==Qe&&!this.getSource(`geovisio_${Qe}`)){const Wn=await this._parent.api.getUserMapStyle(Qe);Object.entries(Wn.sources).forEach((Qe=>{let[rt,Wn]=Qe;return this.addSource(rt,Wn)})),Wn.layers=Wn.layers||[];Wn.layers.concat((0,Co.getMissingLayerStyles)(Wn.sources,Wn.layers)).filter((Qe=>Object.keys(Qe).length>0)).forEach((Qe=>this.addLayer(Qe,null===rt||void 0===rt?void 0:rt.id)))}this._picPreviewTimer=null,this._picPopup=new(Hl().Popup)({closeButton:!1,closeOnClick:!this._parent.isWidthSmall(),offset:3}),this._picPopup.on("close",(()=>{delete this._picPopup._picId}));const Wn=(0,Co.getUserLayerId)(Qe,"pictures");this.on("mousemove",Wn,(Qe=>{this.getCanvas().style.cursor="pointer";const rt=Object.assign({},Qe);clearTimeout(this._picPreviewTimer),this._picPreviewTimer=setTimeout((()=>this._attachPreviewToPictures(rt,Wn)),100)})),this.on("mouseleave",Wn,(()=>{clearTimeout(this._picPreviewTimer),this.getCanvas().style.cursor="",this._picPopup._picId,this._picPopup.remove()})),this.on("click",Wn,this._onPictureClick.bind(this));const Dl=(0,Co.getUserLayerId)(Qe,"sequences_plus");this.on("mousemove",Dl,(Qe=>{if(this._onSequenceHover(Qe),this.getZoom()<=Co.TILES_PICTURES_ZOOM+1&&(this.getCanvas().style.cursor="pointer",Qe.features[0].properties.id)){const rt=Object.assign({},Qe);clearTimeout(this._picPreviewTimer),this._picPreviewTimer=setTimeout((()=>this._attachPreviewToPictures(rt,Dl)),100)}})),this.on("mouseleave",Dl,(()=>{clearTimeout(this._picPreviewTimer),this.getCanvas().style.cursor="",this._picPopup._picId,this._picPopup.remove()})),this.on("click",Dl,(Qe=>{Qe.preventDefault(),this.getZoom()<=Co.TILES_PICTURES_ZOOM+1&&this._onSequenceClick(Qe)})),"geovisio"===Qe&&this.getLayer("geovisio_grid")&&(this.on("mousemove","geovisio_grid",(Qe=>{if(this.getZoom()<=Co.TILES_PICTURES_ZOOM+1){this.getCanvas().style.cursor="pointer";const rt=Object.assign({},Qe);clearTimeout(this._picPreviewTimer),this._picPreviewTimer=setTimeout((()=>this._attachPreviewToPictures(rt,"geovisio_grid")),100)}})),this.on("mouseleave","geovisio_grid",(()=>{clearTimeout(this._picPreviewTimer),this.getCanvas().style.cursor="",this._picPopup._picId,this._picPopup.remove()})),this.on("click","geovisio_grid",(Qe=>{Qe.preventDefault(),this.flyTo({center:Qe.lngLat,zoom:Co.TILES_PICTURES_ZOOM-6})}))),this.on("click",(Qe=>{!1===Qe.defaultPrevented&&(clearTimeout(this._picPreviewTimer),this._picPopup.remove())}))}_getLayerStyleProperties(Qe){if("pictures_symbols"===Qe)return{paint:{},layout:{"icon-image":["case",["==",["get","id"],this._parent.picture],"",["==",["get","type"],"equirectangular"],"pnx-arrow-360","pnx-arrow-flat"],"symbol-sort-key":this._getLayerSortStyle(Qe)}};{const rt={pictures:"circle",sequences:"line"};return{paint:Object.assign({[`${rt[Qe]}-color`]:this._getLayerColorStyle(Qe)},Co.VECTOR_STYLES[Qe.toUpperCase()].paint),layout:Object.assign({[`${rt[Qe]}-sort-key`]:this._getLayerSortStyle(Qe)},Co.VECTOR_STYLES[Qe.toUpperCase()].layout)}}}_getLayerColorStyle(Qe){const rt=["case",["==",["get","hidden"],!0],Dl.COLORS.HIDDEN,["==",["get","geovisio:status"],"hidden"],Dl.COLORS.HIDDEN],Wn=this._parent.sequence;return"sequences"==Qe&&Wn?rt.push(["==",["get","id"],Wn],Dl.COLORS.SELECTED):Qe.startsWith("pictures")&&Wn&&rt.push(["in",Wn,["get","sequences"]],Dl.COLORS.SELECTED),rt.push(Dl.COLORS.BASE),rt}_getLayerSortStyle(Qe){const rt=["case",["==",["get","hidden"],!0],90],Wn=this._parent.sequence;return"sequences"==Qe&&Wn?rt.push(["==",["get","id"],Wn],100):Qe.startsWith("pictures")&&Wn&&rt.push(["in",Wn,["get","sequences"]],100),rt.push(10),rt}_attachPreviewToPictures(Qe,rt){let Wn=Qe.features.pop();if(!Wn||Wn.properties.id==this._picPopup._picId)return;let Dl=null;if(rt.endsWith("pictures")?Dl=Wn.geometry.coordinates.slice():Qe.lngLat&&(Dl=[Qe.lngLat.lng,Qe.lngLat.lat]),!Dl){const Qe="LineString"===Wn.geometry.type?[Wn.geometry.coordinates]:Wn.geometry.coordinates;let rt=null;const Co=this.getBounds(),Ll=Co.getCenter();for(let Wn=0;Wn<Qe.length;Wn++)for(let Rl=0;Rl<Qe[Wn].length;Rl++)if(Co.contains(Qe[Wn][Rl])){let Co=Ll.distanceTo(new(Hl().LngLat)(...Qe[Wn][Rl]));(null===rt||Co<rt)&&(Dl=Qe[Wn][Rl],rt=Co)}if(!Dl)return}this._picPopup.setLngLat(Dl).addTo(this),this._picThumbUrl[Wn.properties.id]||this._picPopup.setDOMContent((0,Co.getThumbGif)(this._parent._t)),this._picPopup._loading=Wn.properties.id,this._picPopup._picId=Wn.properties.id;const displayThumb=Qe=>{if(this._picPopup._loading===Wn.properties.id)if(delete this._picPopup._loading,Qe){let rt=document.createElement("img");rt.classList.add("pnx-map-thumb"),rt.alt=this._parent._t.map.thumbnail;let Co=new Image;if(Co.src=Qe,Co.addEventListener("load",(()=>{Wn.properties.hidden?rt.children[0].src=Co.src:rt.src=Co.src,this._picPopup.setDOMContent(rt)})),Wn.properties.hidden){const Qe=document.createElement("div");Qe.classList.add("pnx-map-thumb-legend"),Qe.appendChild(document.createTextNode(this._parent._t.map.not_public));const Wn=document.createElement("div");Wn.appendChild(rt),Wn.appendChild(Qe),rt=Wn}}else this._picPopup.remove()};rt.endsWith("pictures")?this._getPictureThumbURL(Wn.properties.id).then(displayThumb):rt.endsWith("grid")?this._getThumbURL(Dl).then(displayThumb):this._getSequenceThumbURL(Wn.properties.id,new(Hl().LngLat)(...Dl)).then(displayThumb)}_getThumbURL(Qe){return this._parent.api.getPicturesAroundCoordinates(Qe[1],Qe[0],.1,1).then((Qe=>{var rt;const Wn=null===Qe||void 0===Qe||null===(rt=Qe.features)||void 0===rt?void 0:rt.pop();return Wn?this._parent.api.findThumbnailInPictureFeature(Wn):null}))}_getSequenceThumbURL(Qe,rt){return rt?this._parent.api.getPicturesAroundCoordinates(rt.lat,rt.lng,1,1,Qe).then((rt=>{var Wn;return(null===rt||void 0===rt||null===(Wn=rt.features)||void 0===Wn?void 0:Wn.length)>0?this._parent.api.findThumbnailInPictureFeature(rt.features[0]):this._parent.api.getPictureThumbnailURLForSequence(Qe)})):this._parent.api.getPictureThumbnailURLForSequence(Qe)}_getPictureThumbURL(Qe,rt){let Wn=null;return Qe&&(void 0!==this._picThumbUrl[Qe]?Wn="string"===typeof this._picThumbUrl[Qe]?Promise.resolve(this._picThumbUrl[Qe]):this._picThumbUrl[Qe]:(this._picThumbUrl[Qe]=this._parent.api.getPictureThumbnailURL(Qe,rt).then((rt=>rt?(this._picThumbUrl[Qe]=rt,rt):(this._picThumbUrl[Qe]=null,null))).catch((()=>{this._picThumbUrl[Qe]=null})),Wn=this._picThumbUrl[Qe])),Wn}_getPictureMarker(){let Qe=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];const rt=document.createElement("img");return rt.src=Qe?Rl:Ll,rt.alt="",new(Hl().Marker)({element:rt})}_onSequenceHover(Qe){var rt;Qe.preventDefault(),Qe.features.length>0&&null!==(rt=Qe.features[0].properties)&&void 0!==rt&&rt.id&&this.fire("sequence-hover",{seqId:Qe.features[0].properties.id})}_onSequenceClick(Qe){var rt;Qe.preventDefault(),Qe.features.length>0&&null!==(rt=Qe.features[0].properties)&&void 0!==rt&&rt.id&&this.fire("sequence-click",{seqId:Qe.features[0].properties.id,coordinates:Qe.lngLat})}_onPictureClick(Qe){var rt,Wn;Qe.preventDefault();const Co=(null===Qe||void 0===Qe||null===(rt=Qe.features)||void 0===rt?void 0:rt.length)>0?Qe.features[0]:null;if(null!==Co&&void 0!==Co&&null!==(Wn=Co.properties)&&void 0!==Wn&&Wn.id){let rt=null;try{Co.properties.sequences&&(Array.isArray(Co.properties.sequences)||(Co.properties.sequences=JSON.parse(Co.properties.sequences)),rt=Co.properties.sequences.pop())}catch(Qe){console.log("Sequence ID is not available in vector tiles for picture "+Co.properties.id)}this.fire("picture-click",{picId:Co.properties.id,seqId:rt,feature:Co})}}addEventListener(Qe,rt){let Wn=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};null!==Wn&&void 0!==Wn&&Wn.once?this.once(Qe,rt):this.on(Qe,rt)}}},2771:(Qe,rt,Wn)=>{"use strict";Wn.d(rt,{A:()=>MapMore,T:()=>Ul});var Co=Wn(5642),Dl=Wn(7343),Ll=Wn(8340);const Rl={DEFAULT:"default",AGE:"age",TYPE:"type",SCORE:"score"},Ul=["minDate","maxDate","pic_type","camera","theme","qualityscore"];class MapMore extends Co.A{constructor(Qe,rt){super(Qe,rt,arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}),this._mapFilters={},this._options.theme&&(this._mapFilters={theme:this._options.theme})}reloadLayersStyles(){if(super.reloadLayersStyles(),this._hasGridStats()){let Qe="coef";this._mapFilters.pic_type&&(Qe="flat"==this._mapFilters.pic_type?"coef_flat_pictures":"coef_360_pictures"),this.getStyle().layers.filter((Qe=>Qe.id.endsWith("_grid"))).forEach((rt=>{const Wn=(0,Ll.switchCoefValue)(rt,Qe);for(let Qe in Wn.layout)this.setLayoutProperty(rt.id,Qe,Wn.layout[Qe]);for(let Qe in Wn.paint)this.setPaintProperty(rt.id,Qe,Wn.paint[Qe])}))}}_getDatesForLayerColors(){const Qe=864e5,rt=Date.now();return[rt-30*Qe,rt-365*Qe,rt-730*Qe].map((Qe=>new Date(Qe).toISOString().split("T")[0]))}_getLayerColorStyle(Qe){var rt,Wn,Co,Ul,Gl,Zl,Hl,ql;const Ql=["case",["==",["get","hidden"],!0],Dl.COLORS.HIDDEN],Kl=(null===(rt=this._parent.psv)||void 0===rt||null===(Wn=rt._myVTour)||void 0===Wn||null===(Co=Wn.state)||void 0===Co?void 0:Co.loadingNode)||(null===(Ul=this._parent.psv)||void 0===Ul||null===(Gl=Ul._myVTour)||void 0===Gl||null===(Zl=Gl.state)||void 0===Zl||null===(Hl=Zl.currentNode)||void 0===Hl?void 0:Hl.id),$l=Kl?null===(ql=this._parent.psv)||void 0===ql?void 0:ql._picturesSequences[Kl]:null;if("sequences"==Qe&&$l?Ql.push(["==",["get","id"],$l],Dl.COLORS.SELECTED):"pictures"==Qe&&$l&&Ql.push(["in",$l,["get","sequences"]],Dl.COLORS.SELECTED),this._mapFilters.theme==Rl.AGE){const rt="sequences"==Qe?"date":"ts",Wn=this._getDatesForLayerColors();Ql.push(["!",["has",rt]],Dl.COLORS.BASE,[">=",["get",rt],Wn[0]],Dl.COLORS.PALETTE_4,[">=",["get",rt],Wn[1]],Dl.COLORS.PALETTE_3,[">=",["get",rt],Wn[2]],Dl.COLORS.PALETTE_2,Dl.COLORS.PALETTE_1)}else this._mapFilters.theme==Rl.TYPE?Ql.push(["!",["has","type"]],Dl.COLORS.BASE,["==",["get","type"],"equirectangular"],Dl.COLORS.QUALI_1,Dl.COLORS.QUALI_2):this._mapFilters.theme==Rl.SCORE?Ql.push(["==",Ll.MAP_EXPR_QUALITYSCORE,5],Dl.QUALITYSCORE_VALUES[0].color,["==",Ll.MAP_EXPR_QUALITYSCORE,4],Dl.QUALITYSCORE_VALUES[1].color,["==",Ll.MAP_EXPR_QUALITYSCORE,3],Dl.QUALITYSCORE_VALUES[2].color,["==",Ll.MAP_EXPR_QUALITYSCORE,2],Dl.QUALITYSCORE_VALUES[3].color,Dl.QUALITYSCORE_VALUES[4].color):Ql.push(Dl.COLORS.BASE);return Ql}_getLayerSortStyle(Qe){var rt,Wn,Co,Dl,Ul,Gl,Zl,Hl;const ql=["case",["==",["get","hidden"],!0],90],Ql=(null===(rt=this._parent.psv)||void 0===rt||null===(Wn=rt._myVTour)||void 0===Wn||null===(Co=Wn.state)||void 0===Co?void 0:Co.loadingNode)||(null===(Dl=this._parent.psv)||void 0===Dl||null===(Ul=Dl._myVTour)||void 0===Ul||null===(Gl=Ul.state)||void 0===Gl||null===(Zl=Gl.currentNode)||void 0===Zl?void 0:Zl.id),Kl=Ql?null===(Hl=this._parent.psv)||void 0===Hl?void 0:Hl._picturesSequences[Ql]:null;if("sequences"==Qe&&Kl?ql.push(["==",["get","id"],Kl],100):"pictures"==Qe&&Kl&&ql.push(["in",Kl,["get","sequences"]],100),this._mapFilters.theme==Rl.AGE){const rt="sequences"==Qe?"date":"ts",Wn=this._getDatesForLayerColors();ql.push(["!",["has",rt]],0,[">=",["get",rt],Wn[0]],50,[">=",["get",rt],Wn[1]],49,[">=",["get",rt],Wn[2]],48)}else this._mapFilters.theme==Rl.TYPE?ql.push(["!",["has","type"]],0,["==",["get","type"],"equirectangular"],50):this._mapFilters.theme==Rl.SCORE&&ql.push(["==",Ll.MAP_EXPR_QUALITYSCORE,5],80,["==",Ll.MAP_EXPR_QUALITYSCORE,4],65,["==",Ll.MAP_EXPR_QUALITYSCORE,3],50,["==",Ll.MAP_EXPR_QUALITYSCORE,2],35,["==",Ll.MAP_EXPR_QUALITYSCORE,1],20);return ql.push(10),ql}_mapFiltersToLayersFilters(Qe){let rt={},Wn=[],Co=[],Dl=!1;if(Qe.minDate&&""!==Qe.minDate&&(rt.minDate=Qe.minDate,Wn.push([">=",["get","date"],Qe.minDate]),Co.push([">=",["get","ts"],Qe.minDate])),Qe.maxDate&&""!==Qe.maxDate){rt.maxDate=Qe.maxDate,Wn.push(["<=",["get","date"],Qe.maxDate]);let Dl=new Date(Qe.maxDate);Dl.setDate(Dl.getDate()+1),Dl=Dl.toISOString().split("T")[0],Co.push(["<=",["get","ts"],Dl])}if(Qe.pic_type&&""!==Qe.pic_type&&(rt.pic_type="flat"===Qe.pic_type?"flat":"equirectangular",Wn.push(["==",["get","type"],rt.pic_type]),Co.push(["==",["get","type"],rt.pic_type])),this._hasGridStats()&&(Dl=!0),Qe.camera&&""!==Qe.camera){rt.camera=Qe.camera;const Dl=Qe.camera.toLowerCase().trim()+" ",Ll=Qe.camera.toLowerCase().trim()+"zzzzzzzzzzzzzzzzzzzz",Rl=["collator",{"case-sensitive":!1,"diacritic-sensitive":!1}];Wn.push([">=",["get","model"],Dl,Rl]),Wn.push(["<=",["get","model"],Ll,Rl]),Co.push([">=",["get","model"],Dl,Rl]),Co.push(["<=",["get","model"],Ll,Rl])}return Qe.qualityscore&&Qe.qualityscore.length>0&&(rt.qualityscore=Qe.qualityscore,Wn.push(["in",Ll.MAP_EXPR_QUALITYSCORE,["literal",rt.qualityscore]]),Co.push(["in",Ll.MAP_EXPR_QUALITYSCORE,["literal",rt.qualityscore]])),Qe.theme&&Object.values(Rl).includes(Qe.theme)&&(rt.theme=Qe.theme,Dl=!0),0==Wn.length?Wn=null:Wn.unshift("all"),0==Co.length?Co=null:(Co.unshift("all"),Co=["step",["zoom"],!0,Ll.TILES_PICTURES_ZOOM,Co]),{mapFilters:rt,mapSeqFilters:Wn,mapPicFilters:Co,reloadMapStyle:Dl}}setFilters(Qe){let rt=arguments.length>1&&void 0!==arguments[1]&&arguments[1],{mapFilters:Wn,mapSeqFilters:Co,mapPicFilters:Dl,reloadMapStyle:Ll}=this._mapFiltersToLayersFilters(Qe);this._mapFilters=Wn,Ll&&this.reloadLayersStyles();const Ul=this.getVisibleUsers().includes("geovisio");Co&&Ul&&(Co=["step",["zoom"],!0,7,Co]),this.filterUserLayersContent("sequences",Co),this.filterUserLayersContent("pictures",Dl),!rt&&(null!==Co||null!==Dl||null!==this._mapFilters.theme&&this._mapFilters.theme!==Rl.DEFAULT)&&Ul&&this.getZoom()<7&&!this._hasGridStats()&&this.easeTo({zoom:7}),this.fire("filters-changed",Object.assign({},this._mapFilters))}async setVisibleUsers(){let Qe=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];await super.setVisibleUsers(Qe);let{mapSeqFilters:rt,mapPicFilters:Wn,reloadMapStyle:Co}=this._mapFiltersToLayersFilters(this._mapFilters);Co&&this.reloadLayersStyles();const Dl=Qe.includes("geovisio");rt&&Dl&&(rt=["step",["zoom"],!0,7,rt]),this.filterUserLayersContent("sequences",rt),this.filterUserLayersContent("pictures",Wn)}}},9048:(Qe,rt,Wn)=>{"use strict";Wn.d(rt,{Ay:()=>Photo,LM:()=>$l,Vf:()=>Tc,cS:()=>Kl});Wn(5003);var Co=Wn(5975),Dl=Wn(2305),Ll=Wn(7343),Rl=Wn(508),Ul=(Wn(3961),Wn(1080),Wn(2710),Wn(1575),Wn(1545)),Gl=Wn(3348),Zl=Wn(4991),Hl=Wn(3727);const ql={baseUrl:Co,width:1280,cols:2,rows:1,tileUrl:()=>null},Ql={id:Ll.BASE_PANORAMA_ID,caption:"",panorama:ql,links:[],gps:[0,0],sequence:{},sphereCorrection:{},horizontalFov:360,properties:{}},Kl=30,$l=250,Tc=3e3;Ul.jM.useNewAnglesOrder=!0;class Photo extends Ul.jM{constructor(Qe,rt){var Wn,Co;let Dl=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};super({container:rt,adapter:[Hl.A,{showErrorTile:!1,baseBlur:!1,resolution:Qe.isWidthSmall()?32:64,shouldGoFast:Dl.shouldGoFast}],withCredentials:"include"==(null===Qe||void 0===Qe||null===(Wn=Qe.fetchOptions)||void 0===Wn?void 0:Wn.credentials),requestHeaders:null===Qe||void 0===Qe||null===(Co=Qe.fetchOptions)||void 0===Co?void 0:Co.headers,panorama:ql,lang:Qe._t.psv,minFov:5,loadingTxt:"&nbsp;",navbar:null,rendererParameters:{preserveDrawingBuffer:!Qe.isWidthSmall()},plugins:[[Gl.$,{dataMode:"server",positionMode:"gps",renderMode:"3d",preload:!0,getNode:()=>{},transitionOptions:()=>{},arrowsPosition:{linkOverlapAngle:Math.PI/6}}],[Zl.b,{}]],...Dl}),this._parent=Qe,this._options=Dl,rt.classList.add("pnx-psv"),this._shouldGoFast=(null===Dl||void 0===Dl?void 0:Dl.shouldGoFast)||(()=>!1),this._transitionDuration=(null===Dl||void 0===Dl?void 0:Dl.transitionDuration)||$l,this._myVTour=this.getPlugin(Gl.$),this._myVTour.datasource.nodeResolver=this._getNodeFromAPI.bind(this),this._myVTour.config.transitionOptions=this._psvNodeTransition.bind(this),this._clearArrows=this._myVTour.arrowsRenderer.clear.bind(this._myVTour.arrowsRenderer),this._myVTour.arrowsRenderer.clear=()=>{},this._myMarkers=this.getPlugin(Zl.b),this._annotationsVisible=!1,this._sequencePlaying=!1,this._picturesNavigation=this._options.picturesNavigation||"any",this._picturesSequences={},this._myVTour.addEventListener("enter-arrow",this._onEnterArrow.bind(this)),this._myVTour.addEventListener("leave-arrow",this._onLeaveArrow.bind(this)),this._myVTour.addEventListener("node-changed",this._onNodeChanged.bind(this)),this._myMarkers.addEventListener("select-marker",this._onSelectMarker.bind(this)),this.addEventListener("position-updated",this._onPositionUpdated.bind(this)),this.addEventListener("zoom-updated",this._onZoomUpdated.bind(this)),this.addEventListener("dblclick",this._onDoubleClick.bind(this)),this._parent.addEventListener("select",this._onSelect.bind(this)),this.loader.size=150,this.loader.color="rgba(61, 61, 61, 0.5)",this.loader.textColor="rgba(255, 255, 255, 0.7)",this.loader.border=5,this.loader.thickness=10,this.loader.canvas.setAttribute("viewBox","0 0 150 150"),this.loader.__updateContent(),this._options.position&&!this._parent.picture&&this.goToPosition(...this._options.position)}async _getNodeFromAPI(Qe){var rt,Wn;if((0,Ll.isNullId)(Qe))return Ql;const Co=await fetch(this._parent.api.getPictureMetadataUrl(Qe,this._picturesSequences[Qe]),this._parent.api._getFetchOptions());let Dl=await Co.json();if(Dl.features&&(Dl=Dl.features.pop()),!Dl||0===Object.keys(Dl).length||!Co.ok)throw this._parent.loader&&this._parent.loader.dismiss(!0,this._parent._t.pnx.error_pic),new Error("Picture with ID "+Qe+" was not found");this._picturesSequences[Qe]=Dl.collection;const Ul=(0,Rl.apiFeatureToPSVNode)(Dl,this._parent._t,this._parent._isInternetFast,this._picturesNavFilter.bind(this));var Gl,Zl;null!==Ul&&void 0!==Ul&&null!==(rt=Ul.sequence)&&void 0!==rt&&rt.prevPic&&(this._picturesSequences[null===Ul||void 0===Ul||null===(Gl=Ul.sequence)||void 0===Gl?void 0:Gl.prevPic]=Dl.collection);null!==Ul&&void 0!==Ul&&null!==(Wn=Ul.sequence)&&void 0!==Wn&&Wn.nextPic&&(this._picturesSequences[null===Ul||void 0===Ul||null===(Zl=Ul.sequence)||void 0===Zl?void 0:Zl.nextPic]=Dl.collection);return Ul}_psvNodeTransition(Qe,rt,Wn){var Co,Dl,Rl;let Ul={};const Gl=this._shouldGoFast()?0:Math.min($l,this._transitionDuration),Zl=Gl>100,Hl=null!=(Wn||(null===rt||void 0===rt?void 0:rt.links.find((rt=>rt.nodeId==Qe.id)))),ql=rt&&Qe.sequence.id===rt.sequence.id,Ql=((null===rt||void 0===rt||null===(Co=rt.properties)||void 0===Co?void 0:Co["view:azimuth"])||0)*(Math.PI/180),Tc=((null===Qe||void 0===Qe||null===(Dl=Qe.properties)||void 0===Dl?void 0:Dl["view:azimuth"])||0)*(Math.PI/180),tu=(0,Ll.getRelativeHeading)(Qe)*(Math.PI/180);this.setOption("maxFov",Math.min(3*Qe.horizontalFov/4,90));const lu={showLoader:!1,effect:"none",speed:0,rotation:!1,rotateTo:{pitch:0,yaw:-tu},zoomTo:Kl};if(360==Qe.horizontalFov)Ul=rt?(0,Ll.getDistance)(rt.gps,Qe.gps)>=.001?lu:{speed:Gl,effect:Hl&&Zl?"fade":"none",rotation:Hl&&ql&&Zl,rotateTo:this.getPosition()}:lu;else if(ql){const Qe=this.getPosition().yaw,Wn=rt.horizontalFov*(Math.PI/180)/2,Co=Qe<=Wn||Qe>=2*Math.PI-Wn,Dl=Math.abs(Ql-Tc)<=Math.PI/4;Ul={speed:Gl,effect:Hl&&Dl&&Zl?"fade":"none",rotation:Hl&&Dl&&Zl,rotateTo:Co?this.getPosition():{pitch:0,yaw:0},zoomTo:Co?this.getZoomLevel():Kl}}else Ul=Object.assign(lu,{rotateTo:{pitch:0,yaw:0}});"fade"===Ul.effect&&Ul.speed>=150?setTimeout(this._clearArrows,Ul.speed-100):this._clearArrows();const du=new CustomEvent("picture-loading",{detail:{...Object.assign({},this.getXYZ(),Ul.rotateTo?{x:180*(Tc+Ul.rotateTo.yaw)/Math.PI}:null,Ul.zoomTo?{z:Ul.zoomTo}:null),picId:Qe.id,lon:Qe.gps[0],lat:Qe.gps[1],first:(null===(Rl=this._parent._initParams)||void 0===Rl?void 0:Rl.getParentPostInit().picture)==Qe.id}});return this.dispatchEvent(du),Ul}_onEnterArrow(Qe){const rt=Qe.link,Wn=Qe.node;let Co;Wn&&(Co=360===Wn.horizontalFov?(this.getPictureOriginalHeading()+180*this.getPosition().yaw/Math.PI)%360:this.getPictureOriginalHeading());const Dl=new CustomEvent("picture-preview-started",{detail:{picId:rt.nodeId,coordinates:rt.gps,direction:Co}});this.dispatchEvent(Dl)}_onLeaveArrow(Qe){const rt=Qe.link,Wn=new CustomEvent("picture-preview-stopped",{detail:{picId:rt.nodeId}});this.dispatchEvent(Wn)}_onPositionUpdated(Qe){let{position:rt}=Qe;const Wn=(0,Ll.positionToXYZ)(rt,this.getZoomLevel());Wn.x+=this.getPictureOriginalHeading(),Wn.x=Wn.x%360;const Co=new CustomEvent("view-rotated",{detail:Wn});this.dispatchEvent(Co),this._onTilesStartLoading()}_onZoomUpdated(Qe){let{zoomLevel:rt}=Qe;const Wn=new CustomEvent("view-rotated",{detail:{...this.getXY(),z:rt}});this.dispatchEvent(Wn),this._onTilesStartLoading()}_onDoubleClick(){this.unfocusAnnotation()}_onNodeChanged(Qe){for(let Dl of document.getElementsByClassName("pnx-psv-tour-arrows"))Dl.classList.remove("pnx-clicked");if(Qe.node.id){var rt,Wn,Co;const Dl=(null===(rt=this._parent._initParams)||void 0===rt?void 0:rt.getParentPostInit().picture)==Qe.node.id;this._parent.select(null===(Wn=Qe.node)||void 0===Wn||null===(Co=Wn.sequence)||void 0===Co?void 0:Co.id,Qe.node.id);const Ll=this.getPictureMetadata();if(!Ll)return void this.dispatchEvent(new CustomEvent("picture-loaded",{detail:{}}));this._prevSequence=Ll.sequence.id;const Rl=new CustomEvent("picture-loaded",{detail:{...this.getXYZ(),picId:Qe.node.id,lon:Ll.gps[0],lat:Ll.gps[1],first:Dl}});this.dispatchEvent(Rl),Ll.panorama.hdUrl?(this.setOption("downloadUrl",Ll.panorama.hdUrl),this.setOption("downloadName",Qe.node.id+".jpg")):this.setOption("downloadUrl",null),this._annotationsVisible&&this.toggleAllAnnotations(!0)}this._onTilesStartLoading()}_onSelectMarker(Qe){var rt;if(Qe.marker&&null!==(rt=Qe.marker.id)&&void 0!==rt&&rt.startsWith("annotation-")){const rt=new CustomEvent("annotation-click",{detail:{annotationId:Qe.marker.data.id}});this.dispatchEvent(rt)}}_onTilesStartLoading(){this._tilesQueueTimer&&(clearInterval(this._tilesQueueTimer),delete this._tilesQueueTimer),this._tilesQueueTimer=setInterval((()=>{if(0===Object.keys(this.adapter.queue.tasks).length){if(this._myVTour.state.currentNode){const Qe=new CustomEvent("picture-tiles-loaded",{detail:{picId:this._myVTour.state.currentNode.id}});this.dispatchEvent(Qe)}clearInterval(this._tilesQueueTimer),delete this._tilesQueueTimer}}),100)}getPictureMetadata(){var Qe,rt,Wn;return(0,Ll.isNullId)(null===(Qe=this._myVTour)||void 0===Qe||null===(rt=Qe.state)||void 0===rt||null===(Wn=rt.currentNode)||void 0===Wn?void 0:Wn.id)?null:this._myVTour.state.currentNode?Object.assign({},this._myVTour.state.currentNode):null}getPictureId(){var Qe,rt,Wn,Co,Dl;const Rl=(null===(Qe=this._myVTour)||void 0===Qe||null===(rt=Qe.state)||void 0===rt?void 0:rt.loadingNode)||(null===(Wn=this._myVTour)||void 0===Wn||null===(Co=Wn.state)||void 0===Co||null===(Dl=Co.currentNode)||void 0===Dl?void 0:Dl.id);return(0,Ll.isNullId)(Rl)?null:Rl}_onSelect(Qe){var rt;Qe.detail.seqId&&(this._picturesSequences[Qe.detail.picId]=Qe.detail.seqId),(null===(rt=this._myVTour.getCurrentNode())||void 0===rt?void 0:rt.id)!==Qe.detail.picId&&(this.loader.show(),this._myVTour.setCurrentNode(Qe.detail.picId).catch((Qe=>{this.showErrorOverlay(Qe,this._parent._t.pnx.error_pic,!0)})))}goToNextPicture(){if(!this.getPictureMetadata())throw new Error("No picture currently selected");const Qe=this.getPictureMetadata().sequence.nextPic;if(!Qe)throw new Error("No next picture available");this._parent.select(this.getPictureMetadata().sequence.id,Qe)}goToPrevPicture(){if(!this.getPictureMetadata())throw new Error("No picture currently selected");const Qe=this.getPictureMetadata().sequence.prevPic;if(!Qe)throw new Error("No previous picture available");this._parent.select(this.getPictureMetadata().sequence.id,Qe)}async goToPosition(Qe,rt){return this._parent.api.getPicturesAroundCoordinates(Qe,rt).then((Qe=>{if(Qe.features.length>0){const rt=Qe.features.pop();return this._parent.select(null===rt||void 0===rt?void 0:rt.collection,rt.id),rt.id}return Promise.reject(new Error("No picture found nearby given coordinates"))}))}getXY(){const Qe=(0,Ll.positionToXYZ)(this.getPosition());return Qe.x=(Qe.x+this.getPictureOriginalHeading())%360,Qe}getXYZ(){const Qe=this.getXY();return Qe.z=this.getZoomLevel(),Qe}getPictureOriginalHeading(){var Qe,rt;return(null===(Qe=this.getPictureMetadata())||void 0===Qe||null===(rt=Qe.properties)||void 0===rt?void 0:rt["view:azimuth"])||0}getPictureRelativeHeading(){return(0,Ll.getRelativeHeading)(this.getPictureMetadata())}clearPictureMetadataCache(){var Qe,rt,Wn,Co;const Dl=null===(Qe=this.getPictureMetadata())||void 0===Qe?void 0:Qe.id,Ll=null===(rt=this.getPictureMetadata())||void 0===rt||null===(Wn=rt.sequence)||void 0===Wn?void 0:Wn.id;null===(Co=this._myVTour.state.currentTooltip)||void 0===Co||Co.hide(),this._myVTour.state.currentTooltip=null,this._myVTour.state.currentNode=null,this._myVTour.state.preload={},this._myVTour.datasource.nodes={},Dl&&this._parent.select(Ll,Dl)}setXYZ(Qe,rt,Wn){const Co=(0,Ll.xyzToPosition)(Qe-this.getPictureOriginalHeading(),rt,Wn);this.rotate({yaw:Co.yaw,pitch:Co.pitch}),this.zoom(Co.zoom)}setHigherContrast(Qe){this.renderer.renderer.toneMapping=Qe?3:0,this.renderer.renderer.toneMappingExposure=Qe?2:1,this.needsUpdate()}getTransitionDuration(){return this._transitionDuration}setTransitionDuration(Qe){if((Qe=parseFloat(Qe))<100||Qe>Tc)throw new Error("Invalid transition duration (should be between 100 and "+Tc+")");this._transitionDuration=Qe;const rt=new CustomEvent("transition-duration-changed",{detail:{value:Qe}});this.dispatchEvent(rt)}setPanorama(Qe,rt){const onFailure=Qe=>{var rt;return this.showErrorOverlay(Qe,null===(rt=this._parent)||void 0===rt?void 0:rt._t.pnx.error_pic,!0)};try{return super.setPanorama(Qe,rt).catch(onFailure)}catch(Wn){onFailure(Wn)}}showErrorOverlay(Qe,rt,Wn){var Co,Ll,Rl,Ul;null!==(Co=this._parent)&&void 0!==Co&&Co.loader.isVisible()||!this.overlay.isVisible()?null===(Ll=this._parent)||void 0===Ll||Ll.loader.dismiss(Qe,rt,Wn?()=>{var Qe;null===(Qe=this._parent)||void 0===Qe||Qe.loader.dismiss(),this.overlay.hide()}:void 0):(console.error(Qe),this.overlay.show({image:`<img style="width: 200px" src="${Dl}" alt="" />`,title:null===(Rl=this._parent)||void 0===Rl?void 0:Rl._t.pnx.error,text:rt+"<br />"+(null===(Ul=this._parent)||void 0===Ul?void 0:Ul._t.pnx.error_click),dissmisable:Wn}))}playSequence(){this._sequencePlaying=!0;const Qe=new Event("sequence-playing",{bubbles:!0,composed:!0});this.dispatchEvent(Qe);const nextPicturePlay=()=>{if(this._sequencePlaying){this.addEventListener("picture-loaded",(()=>{this._playTimer=setTimeout((()=>{nextPicturePlay()}),this.getTransitionDuration())}),{once:!0});try{this.goToNextPicture()}catch(Qe){this.stopSequence()}}};this.addEventListener("click",(()=>this.stopSequence())),nextPicturePlay()}stopSequence(){this._sequencePlaying=!1,this._playTimer&&(clearTimeout(this._playTimer),delete this._playTimer),this.forceRefresh();const Qe=new Event("sequence-stopped",{bubbles:!0,composed:!0});this.dispatchEvent(Qe)}isSequencePlaying(){return this._sequencePlaying}toggleSequencePlaying(){this.isSequencePlaying()?this.stopSequence():this.playSequence()}getPicturesNavigation(){return this._picturesNavigation}setPicturesNavigation(Qe){"none"===Qe&&(Qe="pic"),this._picturesNavigation=Qe;const rt=new CustomEvent("pictures-navigation-changed",{detail:{value:Qe}});this.dispatchEvent(rt)}_picturesNavFilter(Qe){switch(this._picturesNavigation){case"seq":return["next","prev"].includes(Qe.rel);case"pic":case"none":return!1;default:return!0}}areAnnotationsVisible(){return this._annotationsVisible}toggleAllAnnotations(Qe){const rt=this.getPictureMetadata();if(!rt)throw this._myMarkers.clearMarkers(),new Error("No picture currently selected");if(Qe){var Wn,Co;let Qe=rt.properties.annotations;0===(null===(Wn=Qe)||void 0===Wn?void 0:Wn.length)&&console.warn("No annotation available on picture",rt.id);const Dl=null===(Co=this.state.textureData.panoData)||void 0===Co?void 0:Co.baseData;Qe=Qe.map((Qe=>{const rt=this.getPictureMetadata().properties["pers:interior_orientation"].sensor_array_dimensions;if(!rt)return console.warn("Picture lacks pers:interior_orientation.sensor_array_dimensions property, can't compute marker"),null;const Wn=Qe.shape.coordinates.map((Qe=>Qe.map((Qe=>{const Wn=[Qe[0]*Dl.croppedWidth/rt[0],Qe[1]*Dl.croppedHeight/rt[1]],Co=[(Dl.croppedX+Wn[0])/Dl.fullWidth,(Dl.croppedY+Wn[1])/Dl.fullHeight];return[2*(Co[0]-.5)*Math.PI,(.5-Co[1])*Math.PI]}))));return{id:`annotation-${Qe.id}`,polygon:Wn,data:{id:Qe.id},svgStyle:{stroke:"var(--orange)",strokeWidth:"3px",fill:"var(--orange-transparent)",cursor:"pointer"},tooltip:this._parent._t.pnx.semantics_annotation_tooltip}})),this._myMarkers.setMarkers(Qe)}else this._myMarkers.clearMarkers();const Dl=this._annotationsVisible!=Qe;this._annotationsVisible=Qe,Dl&&this.dispatchEvent(new CustomEvent("annotations-toggled",{detail:{visible:Qe}}))}focusOnAnnotation(Qe){this.areAnnotationsVisible()||this.toggleAllAnnotations(!0),this.unfocusAnnotation(!0);const rt=`annotation-${Qe}`;this._myMarkers.updateMarker({id:rt,svgStyle:{stroke:"var(--red)",strokeWidth:"3px",fill:"var(--red-transparent)"},data:{selected:!0}}),this._myMarkers.gotoMarker(rt,0),this.zoom(65)}unfocusAnnotation(){let Qe=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const rt=Object.keys(this._myMarkers.markers).filter((Qe=>{var rt,Wn,Co;return Qe.startsWith("annotation-")&&(null===(rt=this._myMarkers.markers[Qe])||void 0===rt||null===(Wn=rt.config)||void 0===Wn||null===(Co=Wn.data)||void 0===Co?void 0:Co.selected)}));rt.length>0&&(rt.forEach((Qe=>{this._myMarkers.updateMarker({id:Qe,svgStyle:{stroke:"var(--orange)",strokeWidth:"3px",fill:"var(--orange-transparent)"},data:{selected:!1}})})),Qe||this.dispatchEvent(new Event("annotations-unfocused")))}forceRefresh(){var Qe;const rt=this._myVTour.getCurrentNode();if(rt&&rt.panorama.baseUrl!==(null===rt||void 0===rt||null===(Qe=rt.panorama)||void 0===Qe?void 0:Qe.origBaseUrl)){const Qe=this.getZoomLevel(),Wn=this.getPosition();this._myVTour.state.currentNode=null,this._myVTour.setCurrentNode(rt.id,{zoomTo:Qe,rotateTo:Wn,fadeIn:!1,speed:0,rotation:!1})}rt&&rt.panorama.rows>1&&this.adapter.__refresh()}}},4374:(Qe,rt,Wn)=>{"use strict";Wn.d(rt,{A:()=>Popup});var Co=Wn(4542),Dl=Wn(5995),Ll=Wn(8591),Rl=Wn(6627);class Popup extends Co.WF{constructor(){super(),this.visible=!1}connectedCallback(){super.connectedCallback(),this.addEventListener("click",(Qe=>{Qe.target===this&&this.close()})),document.addEventListener("keyup",(Qe=>{"Escape"===Qe.key&&this.visible&&this.close()}))}attributeChangedCallback(Qe,rt,Wn){super.attributeChangedCallback(Qe,rt,Wn),"visible"==Qe&&(""!==Wn&&!0!==Wn||this.dispatchEvent(new Event("open")))}close(){this.visible=!1,this.dispatchEvent(new Event("close"))}render(){return Co.qy`
1712
1712
  <div class="pnx-panel pnx-padded">
1713
1713
  <pnx-button
1714
1714
  class="btn-close"
@@ -2381,7 +2381,7 @@
2381
2381
  @click=${Qe=>this._onClick(Qe,!1)}
2382
2382
  >${(0,Rl.fa)(Gl.EZ)}</pnx-button>
2383
2383
  </pnx-button-group>
2384
- `}}Zoom.properties={_lastWantedZoom:{state:!0}},customElements.define("pnx-widget-zoom",Zoom)},222:(Qe,rt,Wn)=>{"use strict";Wn.r(rt),Wn.d(rt,{CopyCoordinates:()=>Co.A,GeoSearch:()=>Dl.A,Legend:()=>Ll.A,MapFiltersButton:()=>Rl.A,MapLayersButton:()=>Ul.A,OSMEditors:()=>Gl.A,PictureLegendActions:()=>Zl.A,Player:()=>Hl.A,Zoom:()=>ql.A});var Co=Wn(5114),Dl=Wn(2603),Ll=Wn(4385),Rl=Wn(4529),Ul=Wn(1614),Gl=Wn(5789),Zl=Wn(8806),Hl=Wn(8305),ql=Wn(3023)},5254:(Qe,rt,Wn)=>{"use strict";Wn.d(rt,{A:()=>API});var Co=Wn(8340),Dl=Wn(7343);class API extends EventTarget{constructor(Qe){let rt=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(super(),null===Qe||void 0===Qe||"string"!==typeof Qe){const Qe=new Error("endpoint parameter is empty or not a valid string");throw this.dispatchEvent(new CustomEvent("broken",{detail:{error:Qe}})),Qe}if(Qe.startsWith("/")&&(Qe=window.location.href.split("/").slice(0,3).join("/")+Qe),!API.isValidHttpUrl(Qe)){const rt=new Error(`endpoint parameter is not a valid URL: ${Qe}`);throw this.dispatchEvent(new CustomEvent("broken",{detail:{error:rt}})),rt}this._endpoint=Qe,this._isReady=0,this._dataBbox=null,this._fetchOpts=(null===rt||void 0===rt?void 0:rt.fetch)||{},this._metadata={},rt.skipReadLanding||(this._readLanding=fetch(Qe,this._getFetchOptions()).then((Qe=>Qe.json())).then((Qe=>this._parseLanding(Qe,rt))).catch((Qe=>(this._isReady=-1,console.error(Qe),this.dispatchEvent(new CustomEvent("broken",{detail:{error:Qe}})),Promise.reject("Viewer failed to communicate with API")))).then((()=>this._loadMapStyles(rt.style,rt.users))).then((()=>(this._isReady=1,this.dispatchEvent(new Event("ready")),"API is ready"))))}onceReady(){return-1==this._isReady?Promise.reject("Viewer failed to communicate with API"):1==this._isReady?Promise.resolve("API is ready"):this._readLanding}isReady(){return 1==this._isReady}getAvailableFeatures(){return Object.entries(this._endpoints).filter((Qe=>null!==Qe[1])).map((Qe=>Qe[0]))}getUnavailableFeatures(){return Object.entries(this._endpoints).filter((Qe=>null===Qe[1])).map((Qe=>Qe[0]))}_parseLanding(Qe,rt){var Wn,Co;if(this._endpoints={collections:null,search:null,style:null,user_style:null,tiles:(null===rt||void 0===rt?void 0:rt.tiles)||null,user_tiles:null,user_search:null,collection_preview:null,item_preview:null,rss:null,report:null},!Qe||!Qe.links||!Array.isArray(Qe.links))throw new Error("API Landing page doesn't contain 'links' list");if(!Qe.stac_version.startsWith("1."))throw new Error(`API is not in a supported STAC version (Panoramax viewer supports only 1.x, API is ${Qe.stac_version})`);this._metadata.name=Qe.title||"Unnamed",this._metadata.stac_version=Qe.stac_version,this._metadata.geovisio_version=Qe.geovisio_version;const Dl=[],Ll=[];if([{rel:"search",type:"application/geo+json",endpointId:"search",mandatory:!0,missingIssue:"No direct access to pictures metadata."},{rel:"data",type:"application/json",endpointId:"collections",mandatory:!0,missingIssue:"No way for viewer to access sequences."},{rel:"data",type:"application/rss+xml",endpointId:"rss"},{rel:"xyz",type:"application/vnd.mapbox-vector-tile",endpointId:"tiles"},{rel:"xyz-style",type:"application/json",endpointId:"style"},{rel:"user-xyz-style",type:"application/json",endpointId:"user_style"},{rel:"user-xyz",type:"application/vnd.mapbox-vector-tile",endpointId:"user_tiles"},{rel:"user-search",type:"application/json",endpointId:"user_search",missingIssue:"Filter map data by user name will not be available."},{rel:"collection-preview",type:"image/jpeg",endpointId:"collection_preview",missingIssue:"Display of thumbnail could be slower."},{rel:"item-preview",type:"image/jpeg",endpointId:"item_preview",missingIssue:"Display of thumbnail could be slower."},{rel:"report",type:"application/json",endpointId:"report"}].forEach((rt=>{const Wn=Qe.links.find((Qe=>Qe.rel==rt.rel&&Qe.type==rt.type));if(Wn){if(!API.isValidHttpUrl(Wn.href))throw new Error(`API endpoint '${Wn.rel}' (${Wn.type}) is not a valid URL: ${Wn.href}`);this._endpoints[rt.endpointId]||(this._endpoints[rt.endpointId]=Wn.href)}else if(!this._endpoints[rt.endpointId]){let Qe=`API doesn't offer a '${rt.rel}' (${rt.type}) endpoint in its links`;rt.missingIssue&&(Qe+=`\n${rt.missingIssue}`),rt.mandatory?Dl.push(Qe):rt.missingIssue&&Ll.push(Qe)}})),this._endpoints.style||this._endpoints.tiles||Ll.push("API doesn't offer 'xyz' or 'xyz-style' endpoints in its links.\nMap widget will not be available."),this._endpoints.user_style||this._endpoints.user_tiles||Ll.push("API doesn't offer 'user-xyz' or 'user-xyz-style' endpoints in its links.\nFilter map data by user ID will not be available."),Ll.forEach((Qe=>console.warn(Qe))),Dl.length>0)throw new Error(Dl.join("\n"));const Rl=null===Qe||void 0===Qe||null===(Wn=Qe.extent)||void 0===Wn||null===(Co=Wn.spatial)||void 0===Co?void 0:Co.bbox;this._dataBbox=Rl&&Array.isArray(Rl)&&Rl.length>0&&Array.isArray(Rl[0])&&4===Rl[0].length?[[Rl[0][0],Rl[0][1]],[Rl[0][2],Rl[0][3]]]:null}_loadMapStyles(Qe,rt){const Wn=new Set(rt||[]);this.mapStyle={version:8,sources:{},layers:[],metadata:{}};const Co=[this.getMapStyle()];if("string"===typeof Qe){const rt=Qe.startsWith(this._endpoint)?this._getFetchOptions():void 0;Co.push(fetch(Qe,rt).then((Qe=>Qe.json())))}else"object"===typeof Qe&&Co.push(Promise.resolve(Qe));return[...Wn].filter((Qe=>"geovisio"!==Qe)).forEach((Qe=>{Co.push(this.getUserMapStyle(Qe,!0))})),Promise.all(Co).then((Qe=>{const rt=["bearing","center","glyphs","light","name","pitch","sky","sprite","terrain","transition","zoom"];Qe.forEach((Qe=>{rt.forEach((rt=>{Qe[rt]&&(this.mapStyle[rt]=Qe[rt]||this.mapStyle[rt])})),Object.assign(this.mapStyle.sources,(null===Qe||void 0===Qe?void 0:Qe.sources)||{}),Object.assign(this.mapStyle.metadata,(null===Qe||void 0===Qe?void 0:Qe.metadata)||{}),this.mapStyle.layers=this.mapStyle.layers.concat((null===Qe||void 0===Qe?void 0:Qe.layers)||[])}))})).catch((Qe=>console.error(Qe)))}_getFetchOptions(){let Qe=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return Object.assign({signal:Qe?void 0:AbortSignal.timeout(15e3)},this._fetchOpts)}_getMapRequestTransform(){const Qe=this._getFetchOptions();if(delete Qe.signal,Object.keys(Qe).length>0)return rt=>{if(rt.startsWith(this._endpoint))return{url:rt,...Qe}}}async getSequenceItems(Qe){let rt=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,Wn=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!this.isReady())throw new Error("API is not ready to use");try{return API.isIdValid(Qe),fetch(rt||`${this._endpoints.collections}/${Qe}/items`,this._getFetchOptions(!0)).then((Qe=>Qe.json())).then((rt=>{let Co=rt;Wn&&(Co.features=Wn.features.concat(Co.features));const Dl=rt.links.find((Qe=>"next"===Qe.rel));return Dl?this.getSequenceItems(Qe,Dl.href,Co):Co}))}catch(Co){return Promise.reject(Co)}}getPicturesAroundCoordinatesUrl(Qe,rt){let Wn=arguments.length>2&&void 0!==arguments[2]?arguments[2]:5e-4,Co=arguments.length>3?arguments[3]:void 0,Dl=arguments.length>4?arguments[4]:void 0;if(!this.isReady())throw new Error("API is not ready to use");if(isNaN(parseFloat(Qe))||isNaN(parseFloat(rt)))throw new Error("lat and lon parameters should be valid numbers");const Ll=[rt-Wn,Qe-Wn,rt+Wn,Qe+Wn].map((Qe=>Qe.toFixed(4))).join(","),Rl=Co?`&limit=${Co}`:"",Ul=Dl?`&collections=${Dl}`:"";return`${this._endpoints.search}?bbox=${Ll}${Rl}${Ul}`}getPicturesAroundCoordinates(Qe,rt,Wn,Co,Dl){return fetch(this.getPicturesAroundCoordinatesUrl(Qe,rt,Wn,Co,Dl),this._getFetchOptions()).then((Qe=>Qe.json()))}getPictureMetadataUrl(Qe,rt){if(!this.isReady())throw new Error("API is not ready to use");if(API.isIdValid(Qe))return rt?`${this._endpoints.collections}/${rt}/items/${Qe}`:`${this._endpoints.search}?ids=${Qe}`}getMapStyle(){if(this.isReady())return this.mapStyle;let Qe;return Qe=this._endpoints.style?this._endpoints.style:this._endpoints.tiles?{version:8,sources:{geovisio:{type:"vector",tiles:[this._endpoints.tiles],minzoom:0,maxzoom:Co.TILES_PICTURES_ZOOM}}}:fetch(`${this._endpoint}/map/14/0/0.mvt`,this._getFetchOptions()).then((()=>(this._endpoints.tiles=`${this._endpoint}/map/{z}/{x}/{y}.mvt`,console.log("Using fallback endpoint for vector tiles"),this.getMapStyle()))).catch((Qe=>(console.error(Qe),Promise.reject(new Error("API doesn't offer a vector tiles endpoint"))))),"string"===typeof Qe?fetch(Qe,this._getFetchOptions()).then((Qe=>Qe.json())):Promise.resolve(Qe)}getUserMapStyle(Qe){let rt;return arguments.length>1&&void 0!==arguments[1]&&arguments[1]||this.isReady()?Qe?(this._endpoints.user_style?rt=this._endpoints.user_style.replace(/\{userId\}/g,Qe):this._endpoints.user_tiles&&(rt={version:8,sources:{[`geovisio_${Qe}`]:{type:"vector",tiles:[this._endpoints.user_tiles.replace(/\{userId\}/g,Qe)],minzoom:0,maxzoom:Co.TILES_PICTURES_ZOOM}}}),rt?"string"===typeof rt?fetch(rt,this._getFetchOptions()).then((Qe=>Qe.json())):Promise.resolve(rt):Promise.reject(new Error("API doesn't offer map style for specific user"))):Promise.reject(new Error("Parameter userId is empty")):Promise.reject(new Error("API is not ready to use"))}findThumbnailInPictureFeature(Qe){if(!this.isReady())throw new Error("API is not ready to use");if(!Qe||!Qe.assets)return null;let rt=null;for(let Wn of Object.values(Qe.assets)){if(Wn.roles.includes("thumbnail")&&"image/jpeg"==Wn.type&&API.isValidHttpUrl(Wn.href))return Wn.href;Wn.roles.includes("visual")&&"image/jpeg"==Wn.type&&API.isValidHttpUrl(Wn.href)&&(rt=Wn.href)}return rt}getPictureThumbnailURLForSequence(Qe,rt){if(!this.isReady())throw new Error("API is not ready to use");if(this._endpoints.collection_preview)return Promise.resolve(this._endpoints.collection_preview.replace("{id}",Qe));if(rt&&Array.isArray(rt.links)&&rt.links.length>0){let Qe=rt.links.find((Qe=>"preview"===Qe.rel&&"image/jpeg"===Qe.type));if(Qe&&API.isValidHttpUrl(Qe.href))return Promise.resolve(Qe.href)}const Wn=`${this._endpoints.search}?limit=1&collections=${Qe}`;return fetch(Wn,this._getFetchOptions()).then((Qe=>Qe.json())).then((Qe=>Array.isArray(Qe.features)&&0!=Qe.features.length?this.findThumbnailInPictureFeature(Qe.features.pop()):null))}getPictureThumbnailURL(Qe,rt){if(!this.isReady())throw new Error("API is not ready to use");return Qe?this._endpoints.item_preview?Promise.resolve(this._endpoints.item_preview.replace("{id}",Qe)):Qe&&rt?fetch(`${this._endpoints.collections}/${rt}/items/${Qe}`,this._getFetchOptions()).then((Qe=>Qe.json())).then((Qe=>Qe?this.findThumbnailInPictureFeature(Qe):null)):fetch(`${this._endpoints.search}?ids=${Qe}`,this._getFetchOptions()).then((Qe=>Qe.json())).then((Qe=>Qe&&Array.isArray(Qe.features)&&0!=Qe.features.length?this.findThumbnailInPictureFeature(Qe.features.pop()):null)):Promise.resolve(null)}getRSSURL(Qe){if(!this.isReady())throw new Error("API is not ready to use");if(this._endpoints.rss){let rt=this._endpoints.rss;return Qe&&(rt+=rt.includes("?")?"&":"?",rt+="bbox="+[Qe.getWest(),Qe.getSouth(),Qe.getEast(),Qe.getNorth()].join(",")),rt}return null}getSequenceMetadataUrl(Qe){if(!this.isReady())throw new Error("API is not ready to use");return`${this._endpoints.collections}/${Qe}`}getDataBbox(){if(!this.isReady())throw new Error("API is not ready to use");return this._dataBbox}searchUsers(Qe){if(!this.isReady())throw new Error("API is not ready to use");if(!this._endpoints.user_search)throw new Error("User search is not available");return fetch(`${this._endpoints.user_search}?q=${Qe}`,this._getFetchOptions()).then((Qe=>Qe.json())).then((Qe=>(null===Qe||void 0===Qe?void 0:Qe.features)||null))}getUserName(Qe){if(!this.isReady())throw new Error("API is not ready to use");if(!this._endpoints.user_search)throw new Error("User search is not available");return fetch(this._endpoints.user_search.replace(/\/search$/,`/${Qe}`),this._getFetchOptions()).then((Qe=>Qe.json())).then((Qe=>(null===Qe||void 0===Qe?void 0:Qe.name)||null))}sendReport(Qe){if(!this.isReady())throw new Error("API is not ready to use");if(!this._endpoints.report)throw new Error("Report sending is not available");const rt={...this._getFetchOptions(),method:"POST",body:JSON.stringify(Qe),headers:{"Content-Type":"application/json"}};return fetch(this._endpoints.report,rt).then((async Qe=>{if(Qe.status>=400){let Wn=await Qe.text();try{Wn=JSON.parse(Wn).message}catch(rt){}return Promise.reject(Wn)}return Qe.json()}))}static isValidHttpUrl(Qe){let rt;try{rt=new URL(Qe)}catch(Wn){return!1}return"http:"===rt.protocol||"https:"===rt.protocol}static isIdValid(Qe){if((0,Dl.isNullId)(Qe))throw new Error("id should be a valid picture unique identifier");return!0}}},2118:(Qe,rt,Wn)=>{"use strict";Wn.d(rt,{Ay:()=>InitParameters,Qm:()=>Co,Vy:()=>alterPSVState,ai:()=>alterPhotoViewerState,iz:()=>alterViewerState,mK:()=>alterMapState});const Co={minDate:"date_from",maxDate:"date_to",pic_type:"pic_type",camera:"camera",theme:"theme",qualityscore:"pic_score"},Dl=Object.fromEntries(Object.entries(Co).map((Qe=>[Qe[1],Qe[0]]))),Ll=["none","null","false",!1],Rl=["antialias","bearing","bearingSnap","bounds","boxZoom","clickTolerance","collectResourceTiming","cooperativeGestures","crossSourceCollisions","doubleClickZoom","dragPan","dragRotate","fadeDuration","failIfMajorPerformanceCaveat","fitBoundsOptions","hash","interactive","keyboard","localIdeographFontFamily","locale","logoPosition","maplibreLogo","maxBounds","maxCanvasSize","maxPitch","maxTileCacheSize","maxTileCacheZoomLevels","maxZoom","minPitch","minZoom","pitch","pitchWithRotate","pixelRatio","preserveDrawingBuffer","refreshExpiredTiles","renderWorldCopies","scrollZoom","touchPitch","touchZoomRotate","trackResize","transformCameraUpdate","transformRequest","validateStyle"];class InitParameters{constructor(){var Qe,rt,Wn,Co,Dl,Ul;let Gl=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},Zl=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},Hl=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};"false"===Gl["url-parameters"]&&(Zl={});let ql={};"object"===typeof(null===Gl||void 0===Gl?void 0:Gl.psv)&&(ql=Gl.psv);let Ql={};"object"===typeof(null===Gl||void 0===Gl?void 0:Gl.map)&&(Ql=Gl.map);let Kl={};"object"===typeof(null===Hl||void 0===Hl?void 0:Hl.map)&&(Kl=Hl.map);let $l=Zl.map&&"none"!==Zl.map?getMapPositionFromString(Zl.map):null,Tc=!Ll.includes(Zl.map)&&!Ll.includes(Gl.map),tu=Zl.focus||Gl.focus,lu=Zl.pic||Gl.picture,du=Zl.users||Gl.users,fu=Zl.speed||(null===(Qe=ql)||void 0===Qe?void 0:Qe.transitionDuration),yu=Zl.nav||(null===(rt=ql)||void 0===rt?void 0:rt.picturesNavigation),Eu=Zl.theme||(null===(Wn=Kl)||void 0===Wn?void 0:Wn.theme)||Ql.theme,Tu=Zl.background||(null===(Co=Kl)||void 0===Co?void 0:Co.background)||Ql.background,Lu=(null===$l||void 0===$l?void 0:$l.center)||(null===(Dl=Kl)||void 0===Dl?void 0:Dl.center)||Ql.center,Zu=(null===$l||void 0===$l?void 0:$l.zoom)||(null===(Ul=Kl)||void 0===Ul?void 0:Ul.zoom)||Ql.zoom,Xu=(null===$l||void 0===$l?void 0:$l.pitch)||Ql.pitch,Ju=(null===$l||void 0===$l?void 0:$l.bearing)||Ql.bearing,$u=Gl.geocoder,ed=Gl.widgets,td=Gl.sequence,id=Gl.fetchOptions,nd=Gl.style,rd=Gl.lang,ad=Gl.endpoint,sd=Ql.raster,od=Ql.attributionControl,ld=(cd=Ql,Object.fromEntries(Object.entries(cd).filter((Qe=>{let[rt]=Qe;return Rl.includes(rt)}))));var cd;let ud=Zl.xyz,hd=Zl.date_from,dd=Zl.date_to,pd=Zl.pic_type,md=Zl.camera,fd=Zl.pic_score;["map","pic"].includes(tu)?"map"!==tu||Tc||(console.warn("Parameter focus can't be 'map' as map is disabled"),tu="pic"):(console.warn("Invalid value for parameter focus:",tu),tu=Tc&&!lu?"map":"pic"),"aerial"!=Tu||sd||(console.warn("Parameter background can't be 'aerial' as no aerial imagery is available"),Tu="streets"),Tc&&!lu&&(tu="map"),this._parentInit={map:Tc,users:du,fetchOptions:id,style:nd,lang:rd,endpoint:ad},this._parentPostInit={focus:tu,picture:lu,sequence:td,geocoder:$u,widgets:ed,forceFocus:!0},this._psvInit=Object.fromEntries(Object.entries(ql).filter((Qe=>{let[rt]=Qe;return!["transitionDuration","picturesNavigation"].includes(rt)}))),this._psvAny={transitionDuration:fu,picturesNavigation:yu},this._psvPostInit={xyz:ud},this._mapInit={raster:sd,attributionControl:od,...ld},this._mapAny={theme:Eu,background:Tu,center:Lu,zoom:Zu,pitch:Xu,bearing:Ju,users:du},this._mapPostInit={date_from:hd,date_to:dd,pic_type:pd,camera:md,pic_score:fd}}_sanitize(Qe){return Object.fromEntries(Object.entries(Qe).filter((Qe=>{let[,rt]=Qe;return void 0!==rt})))}getParentInit(){return this._sanitize(this._parentInit)}getParentPostInit(){return this._sanitize(this._parentPostInit)}getPSVInit(){return this._sanitize(Object.assign({},this._psvInit,this._psvAny))}getPSVPostInit(){return this._sanitize(Object.assign({},this._psvPostInit,this._psvAny))}getMapInit(){return this._sanitize(Object.assign({},this._mapInit,this._mapAny))}getMapPostInit(){return this._sanitize(Object.assign({},this._mapPostInit,this._mapAny))}static GetComponentProperties(Qe,rt){const Wn={};for(let Co in Qe.properties){Qe.properties[Co].state||null==rt[Co]||(Wn[Co]=rt[Co])}return Wn}}function getMapPositionFromString(Qe,rt){const Wn=(Qe||"").split("/");if(Wn.length>=3&&!Wn.some((Qe=>isNaN(Qe)))){const Qe={center:[+Wn[2],+Wn[1]],zoom:+Wn[0],pitch:+(Wn[4]||0)};return rt&&(Qe.bearing=rt.dragRotate.isEnabled()&&rt.touchZoomRotate.isEnabled()?+(Wn[3]||0):rt.getBearing()),Qe}return null}function alterPSVState(Qe,rt){rt.xyz&&Qe.addEventListener("picture-loaded",(()=>{const Wn=function(Qe){const rt=(Qe||"").split("/");return 3!==rt.length||rt.some((Qe=>isNaN(Qe)))?null:{x:+rt[0],y:+rt[1],z:+rt[2]}}(rt.xyz);Qe.setXYZ(Wn.x,Wn.y,Wn.z)}),{once:!0});let Wn=rt.transitionDuration||rt.speed;void 0!==Wn&&Qe.setTransitionDuration(Wn);let Co=rt.picturesNavigation||rt.nav;["none","pic","any","seq"].includes(Co)&&Qe.setPicturesNavigation(Co)}async function alterMapState(Qe,rt){var Wn;const Co=getMapPositionFromString(rt.map,Qe);Co&&Qe.jumpTo(Co);let Ll=Array.isArray(rt.users)?rt.users:(rt.users||"").split(",");(0===Ll.length||1===Ll.length&&""===Ll[0].trim())&&(Ll=["geovisio"]),await Qe.setVisibleUsers(Ll),null===(Wn=Qe.setFilters)||void 0===Wn||Wn.call(Qe,function(Qe){const rt={};for(let Wn in Dl)Qe[Wn]&&(rt[Dl[Wn]]=Qe[Wn]);if(rt.qualityscore){let Qe=rt.qualityscore.split("");const Wn={A:5,B:4,C:3,D:2,E:1};rt.qualityscore=Qe.map((Qe=>Wn[Qe]))}return rt}(rt)),["aerial","streets"].includes(rt.background)&&Qe.setBackground(rt.background)}function alterPhotoViewerState(Qe,rt){let Wn=rt.picture||rt.pic;if(Wn){const rt=Wn.split(";");rt.length>1&&console.warn("Multiple picture IDs passed in URL, only first one kept"),Qe.select(null,rt[0],!0)}else Qe.select()}function alterViewerState(Qe,rt){alterPhotoViewerState(Qe,rt),"map"===rt.focus&&null!==Qe&&void 0!==Qe&&Qe.map?(Qe.setPopup(!1),Qe._setFocus("map",null,rt.forceFocus)):"pic"===rt.focus&&null!==Qe&&void 0!==Qe&&Qe.mini?(Qe.setPopup(!1),Qe._setFocus("pic",null,rt.forceFocus)):rt.focus&&"meta"===rt.focus&&null!==Qe&&void 0!==Qe&&Qe.mini&&Qe._setFocus("pic",null,rt.forceFocus)}},3727:(Qe,rt,Wn)=>{"use strict";Wn.d(rt,{A:()=>PhotoAdapter});var Co=Wn(3890);class PhotoAdapter extends Co.D{constructor(Qe,rt){super(Qe,rt),this._shouldGoFast=rt.shouldGoFast||(()=>!0)}loadTexture(Qe,rt){return Qe.origBaseUrl?Qe.baseUrl=Qe.origBaseUrl:Qe.origBaseUrl=Qe.baseUrl,this._shouldGoFast()&&Qe.thumbUrl&&!Qe.hdLoaded&&1==Qe.rows&&(Qe.baseUrl=Qe.thumbUrl),super.loadTexture(Qe,rt).then((rt=>(Qe.baseUrl===Qe.origBaseUrl&&(Qe.hdLoaded=!0),rt)))}__loadTiles(Qe){this._shouldGoFast()||super.__loadTiles(Qe)}}},4207:(Qe,rt,Wn)=>{"use strict";Wn.d(rt,{A:()=>PresetManager});var Co=Wn(7208);const Dl={fas:"fa6-solid"},Ll={"fa6-solid:directions":"fa6-solid:diamond-turn-right"};class PresetManager{constructor(){let Qe=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,rt=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this._ready=!1,this._presets=null,this._translations={},rt||this._load(Qe)}async _load(Qe){var rt;Qe=Qe||(null===(rt=window.navigator.languages[0])||void 0===rt?void 0:rt.substring(0,2));try{var Wn,Rl;const[rt,Zl,Hl]=await Promise.all([fetch(`${(0,Co.PanoramaxPresetsURL)()}/translations/en.min.json`),Qe?fetch(`${(0,Co.PanoramaxPresetsURL)()}/translations/${Qe}.min.json`):Promise.resolve({ok:!0}),fetch(`${(0,Co.PanoramaxPresetsURL)()}/presets.min.json`)]);if(!rt||!Zl||!Hl||!rt.ok||!Zl.ok||!Hl.ok)throw this._ready=-1,new Error("Presets service is not available");var Ul,Gl;if(this._presets=await Hl.json(),this._translations.en=null===(Wn=await rt.json())||void 0===Wn||null===(Rl=Wn.en)||void 0===Rl?void 0:Rl.presets,Qe)this._translations[Qe]=null===(Ul=await Zl.json())||void 0===Ul||null===(Gl=Ul[Qe])||void 0===Gl?void 0:Gl.presets;Object.entries(this._presets).forEach((rt=>{var Wn,Co,Rl,Ul,Gl,Zl;let[Hl,ql]=rt;if(null!==(Wn=this._translations[Qe])&&void 0!==Wn&&null!==(Co=Wn.presets)&&void 0!==Co&&null!==(Rl=Co[Hl])&&void 0!==Rl&&Rl.name?ql.name=this._translations[Qe].presets[Hl].name:null!==(Ul=this._translations.en)&&void 0!==Ul&&null!==(Gl=Ul.presets)&&void 0!==Gl&&null!==(Zl=Gl[Hl])&&void 0!==Zl&&Zl.name&&(ql.name=this._translations.en.presets[Hl].name),ql.icon){const Qe=ql.icon.split("-")[0],rt=Dl[Qe];ql.iconify=rt?ql.icon.replace(Qe+"-",rt+":"):ql.icon.split("-")[0]+":"+ql.icon.split("-").slice(1).join("-"),Ll[ql.iconify]&&(ql.iconify=Ll[ql.iconify])}})),this._ready=!0}catch(Zl){console.error("Presets service throws an error:",Zl),this._ready=-1}}async onceReady(){return this._ready?-1===this._ready?Promise.reject():Promise.resolve():(await new Promise((Qe=>setTimeout(Qe,250))),this.onceReady())}async getPreset(Qe){return this.onceReady().then((()=>{const rt=Object.values(this._presets).filter((rt=>{if(0===Object.keys(rt.tags).length)return!1;for(let Wn in rt.tags){const Co=rt.tags[Wn];if(!Qe.semantics.find((Qe=>Qe.key===Wn&&("*"===Co||Co===Qe.value))))return!1}return!0}));return rt.sort(((Qe,rt)=>{const Wn=Object.keys(Qe.tags).length,Co=Object.keys(rt.tags).length;if(Wn>Co)return-1;if(Wn===Co){const Wn=Object.values(Qe.tags).filter((Qe=>"*"===Qe)).length,Co=Object.values(rt.tags).filter((Qe=>"*"===Qe)).length;return Wn<Co?-1:Wn>Co?1:0}return 1})),rt.shift()}))}}},4451:(Qe,rt,Wn)=>{"use strict";Wn.d(rt,{A:()=>URLHandler});var Co=Wn(2118);const Dl=["speed","nav","focus","pic","xyz","map","background","users","pic_score","s"].concat(Object.values(Co.Qm)),Ll=["focus-changed","pictures-navigation-changed"],Rl=["position-updated","zoom-updated","view-rotated","picture-loaded","transition-duration-changed"],Ul=["moveend","zoomend","boxzoomend","background-changed","users-changed","filters-changed"];class URLHandler extends EventTarget{constructor(Qe){super(),this._parent=Qe,this._delay=null}listenToChanges(){window.addEventListener("popstate",this._onURLChange.bind(this),!1),Ll.forEach((Qe=>this._parent.addEventListener(Qe,this._onParentChange.bind(this)))),Rl.forEach((Qe=>this._parent.psv.addEventListener(Qe,this._onParentChange.bind(this)))),this._parent.map&&Ul.forEach((Qe=>this._parent.map.on(Qe,this._onParentChange.bind(this))))}nextURLParams(){let Qe={};"number"==typeof this._parent.psv.getTransitionDuration()&&(Qe.speed=this._parent.psv.getTransitionDuration()),[null,"any"].includes(this._parent.psv.getPicturesNavigation())||(Qe.nav=this._parent.psv.getPicturesNavigation()),this._parent.psv.getPictureId()&&(Qe.pic=this._parent.psv.getPictureId());if(this._parent.psv.getPictureMetadata()&&(Qe.xyz=this.currentPSVString()),this._parent.map){Qe.map=this.currentMapString(),Qe.focus="pic",this._parent.isMapWide()&&(Qe.focus="map"),this._parent.map.hasTwoBackgrounds()&&this._parent.map.getBackground()&&(Qe.background=this._parent.map.getBackground());const rt=this._parent.map.getVisibleUsers();if((rt.length>1||!rt.includes("geovisio"))&&(Qe.users=rt.join(",")),this._parent.map._mapFilters){for(let rt in Co.Qm)this._parent.map._mapFilters[rt]&&(Qe[Co.Qm[rt]]=this._parent.map._mapFilters[rt]);if(Qe.pic_score){const rt=[null,"E","D","C","B","A"];Qe.pic_score=Qe.pic_score.map((Qe=>rt[Qe])).join("")}}}return Qe}nextURLString(){let Qe="";return Object.entries(this.nextURLParams()).sort(((Qe,rt)=>Qe[0].localeCompare(rt[0]))).forEach((rt=>{let[Wn,Co]=rt,Dl=!1;const Ll=Qe.split("&").map((Qe=>{const rt=Qe.split("=")[0];return rt===Wn?(Dl=!0,`${rt}=${Co}`):Qe})).filter((Qe=>Qe));Dl||Ll.push(`${Wn}=${Co}`),Qe=`${Ll.join("&")}`})),`?${Qe}`.replace(/^\?+/,"?")}currentURLParams(){const Qe=(arguments.length>0&&void 0!==arguments[0]&&arguments[0]?window.location.hash:window.location.search).replace(/^[?#]/,"");let rt={};if(Qe.split("&").map((Qe=>Qe.split("="))).filter((Qe=>void 0!==Qe[0]&&Qe[0].length>0&&Dl.includes(Qe[0]))).forEach((Qe=>{rt[Qe[0]]=Qe[1]})),rt.s){const Qe=Object.fromEntries(decodeURIComponent(rt.s).split(";").map((Qe=>[Qe[0],Qe.substring(1)])));rt={},"m"===Qe.f?rt.focus="map":"p"===Qe.f?rt.focus="pic":"t"===Qe.f&&(rt.focus="meta"),""!==Qe.s&&(rt.speed=100*parseFloat(Qe.s)),"a"===Qe.n?rt.nav="any":"s"===Qe.n&&(rt.nav="seq"),"n"===Qe.n&&(rt.nav="none"),""!==Qe.p&&(rt.pic=Qe.p),""!==Qe.c&&(rt.xyz=Qe.c),""!==Qe.m&&(rt.map=Qe.m),""!==Qe.d&&(rt.date_from=Qe.d),""!==Qe.e&&(rt.date_to=Qe.e),"f"===Qe.t?rt.pic_type="flat":"e"===Qe.t&&(rt.pic_type="equirectangular"),""!==Qe.k&&(rt.camera=Qe.k),"d"===Qe.v?rt.theme="default":"a"===Qe.v?rt.theme="age":"t"===Qe.v?rt.theme="type":"s"===Qe.v&&(rt.theme="score"),"s"===Qe.b?rt.background="streets":"a"===Qe.b&&(rt.background="aerial"),""!==Qe.u&&(rt.users=Qe.u),""!==Qe.q&&(rt.pic_score=Qe.q)}return rt}currentMapString(){const Qe=this._parent.map.getCenter(),rt=Math.round(100*this._parent.map.getZoom())/100,Wn=Math.ceil((rt*Math.LN2+Math.log(512/360/.5))/Math.LN10),Co=Math.pow(10,Wn),Dl=Math.round(Qe.lng*Co)/Co,Ll=Math.round(Qe.lat*Co)/Co,Rl=this._parent.map.getBearing(),Ul=this._parent.map.getPitch();let Gl=`${rt}/${Ll}/${Dl}`;return(Rl||Ul)&&(Gl+="/"+Math.round(10*Rl)/10),Ul&&(Gl+=`/${Math.round(Ul)}`),Gl}currentPSVString(){const Qe=this._parent.psv.getXYZ();return`${Qe.x.toFixed(2)}/${Qe.y.toFixed(2)}/${Math.round(Qe.z||0)}`}_onURLChange(){let Qe=this.currentURLParams();"Viewer"===this._parent.getClassName()?(0,Co.iz)(this._parent,Qe):(0,Co.ai)(this._parent,Qe),(0,Co.Vy)(this._parent.psv,Qe),this._parent.map&&(0,Co.mK)(this._parent.map,Qe)}nextShortLink(Qe){const rt=new URL(Qe),Wn=this.nextURLParams(),Co={f:(Wn.focus||"").substring(0,1),s:isNaN(parseInt(Wn.speed))?void 0:Math.floor(parseInt(Wn.speed)/100),n:(Wn.nav||"").substring(0,1),p:Wn.pic,c:Wn.xyz,m:Wn.map,d:Wn.date_from,e:Wn.date_to,t:(Wn.pic_type||"").substring(0,1),k:Wn.camera,v:(Wn.theme||"").substring(0,1),b:(Wn.background||"").substring(0,1),u:Wn.users,q:Wn.pic_score},Dl=Object.entries(Co).filter((Qe=>{let[,rt]=Qe;return void 0!=rt&&""!=rt})).map((Qe=>{let[rt,Wn]=Qe;return`${rt}${Wn}`})).join(";");return rt.search=`s=${Dl}`,rt}getUnmanagedParameters(Qe){return new URLSearchParams(Array.from(Qe.searchParams).filter((Qe=>{let[rt]=Qe;return!Dl.includes(rt)}))).toString()}_onParentChange(){this._delay&&(clearTimeout(this._delay),this._delay=null),this._delay=setTimeout((()=>{var Qe,rt,Wn;const Co=new URL(window.location.href),Dl=new URL(window.location.href),Ll=this.getUnmanagedParameters(Co);if(Dl.search=this._parent?this.nextURLString()+(Ll.length>0?"&"+Ll:""):"",Object.keys(this.currentURLParams(!0)).length>0&&(Dl.hash=""),Co.search==Dl.search)return;const Rl=this.currentURLParams().pic||"",Ul=(null===(Qe=this._parent)||void 0===Qe||null===(rt=Qe.psv)||void 0===rt||null===(Wn=rt.getPictureId)||void 0===Wn?void 0:Wn.call(rt))||"";try{if(Rl!=Ul?window.history.pushState(window.history.state,null,Dl.href):window.history.replaceState(window.history.state,null,Dl.href),this._parent){const Qe=new CustomEvent("url-changed",{detail:{url:Dl.href}});this.dispatchEvent(Qe)}}catch(Gl){}}),500)}}},3606:(Qe,rt,Wn)=>{"use strict";Wn.r(rt),Wn.d(rt,{forwardGeocodingBAN:()=>forwardGeocodingBAN,forwardGeocodingNominatim:()=>forwardGeocodingNominatim,forwardGeocodingStandard:()=>forwardGeocodingStandard,reverseGeocodingNominatim:()=>reverseGeocodingNominatim});var Co=Wn(927),Dl=Wn.n(Co),Ll=Wn(7208);const Rl={house:20,housenumber:20,street:18,locality:15,district:13,municipality:12,city:12,county:8,region:7,state:7,country:5};function geocoderParamsToURLString(Qe){let rt={};return Object.entries(Qe).filter((Qe=>void 0!==Qe[1]&&null!==Qe[1])).forEach((Qe=>rt[Qe[0]]=Qe[1])),new URLSearchParams(rt).toString()}function forwardGeocodingNominatim(Qe){const rt={q:Qe.query,countrycodes:Qe.countries,limit:Qe.limit,viewbox:Qe.bbox};return fetch(`${(0,Ll.NominatimBaseUrl)()}/search?${geocoderParamsToURLString(rt)}&format=geocodejson&addressdetails=1`).then((Qe=>Qe.json())).then((Qe=>{const rt={features:[]},Wn=[];return(Qe.features||[]).forEach((Qe=>{var Co,Ll,Ul;const Gl=geocodeJsonToPlaceName(null===(Co=Qe.properties)||void 0===Co?void 0:Co.geocoding)||(null===(Ll=Qe.properties)||void 0===Ll||null===(Ul=Ll.geocoding)||void 0===Ul?void 0:Ul.label);var Zl,Hl;Wn.includes(Gl)||(rt.features.push({place_type:["place"],place_name:Gl,center:new(Dl().LngLat)(...Qe.geometry.coordinates),zoom:Rl[null===(Zl=Qe.properties)||void 0===Zl||null===(Hl=Zl.geocoding)||void 0===Hl?void 0:Hl.type]}),Wn.push(Gl))})),rt}))}function reverseGeocodingNominatim(Qe,rt){return fetch(`${(0,Ll.NominatimBaseUrl)()}/reverse?lat=${Qe}&lon=${rt}&zoom=18&format=geocodejson`).then((Qe=>Qe.json())).then((Qe=>{var rt,Wn,Co;return geocodeJsonToPlaceName(null===Qe||void 0===Qe||null===(rt=Qe.features)||void 0===rt||null===(Wn=rt.shift())||void 0===Wn||null===(Co=Wn.properties)||void 0===Co?void 0:Co.geocoding)}))}function forwardGeocodingBAN(Qe){return forwardGeocodingStandard(Qe,(0,Ll.AdresseDataGouvBaseURL)())}function geocodeJsonToPlaceName(Qe){if(!Qe||"object"!=typeof Qe)return"";let rt=Qe.name,Wn=[],Co=[];switch(Qe.type){case"hamlet":case"croft":case"isolated_dwelling":case"neighbourhood":case"allotments":case"quarter":case"farm":case"farmyard":case"industrial":case"commercial":case"retail":case"city_block":case"residential":case"locality":case"district":Co.push(Qe.city),Co.push(Qe.county),Co.push(Qe.state),Co.push(Qe.country);break;case"city":case"region":Co.push(Qe.county),Co.push(Qe.state),Co.push(Qe.country);break;case"country":break;case"house":case"housenumber":Wn.push(Qe.housenumber),Wn.push(Qe.street),Wn.push(Qe.locality),Wn.push(Qe.district),Co.push(Qe.city),Co.push(Qe.county),Co.push(Qe.state),Co.push(Qe.country);break;default:Wn.push(Qe.street),Wn.push(Qe.locality),Wn.push(Qe.district),Co.push(Qe.city),Co.push(Qe.county),Co.push(Qe.state),Co.push(Qe.country)}return Wn=Wn.filter((Qe=>Qe)),Wn=Wn.filter(((Qe,Co)=>Qe!=rt&&(0===Co||Wn[Co-1]!==Qe))),Wn=Wn.length>0?Qe.housenumber?Wn.slice(0,2).join(" "):Wn.shift():null,Wn===rt&&(Wn=null),Co=Co.filter((Qe=>Qe)),Co=Co.filter(((Qe,Dl)=>Qe!=rt&&(!Wn||!Wn.includes(Qe))&&(0===Dl||Co[Dl-1]!==Qe))),[rt,Wn,Co.shift()].filter((Qe=>Qe)).join(", ")}function forwardGeocodingStandard(Qe,rt){const Wn={q:Qe.query,limit:Qe.limit};if("string"===typeof Qe.proximity){const[rt,Co]=Qe.proximity.split(",").map((Qe=>parseFloat(Qe.trim())));Wn.lat=rt,Wn.lon=Co}return fetch(`${rt}/?${geocoderParamsToURLString(Wn)}`).then((Qe=>Qe.json())).then((Qe=>{const rt={features:[]},Wn=[];return(Qe.features||[]).forEach((Qe=>{const Co=geocodeJsonToPlaceName(Qe.properties);Wn.includes(Co)||"other"==Qe.properties.type||(rt.features.push({place_type:["place"],place_name:Co,center:new(Dl().LngLat)(...Qe.geometry.coordinates),zoom:Rl[Qe.properties.type]}),Wn.push(Co))})),rt}))}},4964:(Qe,rt,Wn)=>{"use strict";Wn.r(rt),Wn.d(rt,{autoDetectLocale:()=>autoDetectLocale,getTranslations:()=>getTranslations});var Co=Wn(4149),Dl=Wn(369),Ll=Wn(389),Rl=Wn(9946),Ul=Wn(8302),Gl=Wn(5222),Zl=Wn(6909),Hl=Wn(4895),ql=Wn(3979),Ql=Wn(6920),Kl=Wn(9026),$l=Wn(991),Tc=Wn(6984);const tu="en",lu={da:Co,de:Dl,eo:Rl,en:Ll,es:Ul,fr:Gl,hu:Zl,it:Hl,ja:ql,nl:Ql,pl:Kl,sv:$l,"zh-Hant":Tc,zh:Tc};function autoDetectLocale(Qe,rt){for(const Wn of window.navigator.languages){let rt=Wn;switch(rt){case"zh-TW":case"zh-HK":case"zh-MO":rt="zh-Hant";break;case"zh-CN":case"zh-SG":rt="zh-Hans";break;default:rt.length>2&&(rt=Wn.substring(0,2))}const Co=Qe.find((Qe=>Qe===rt));if(Co)return Co}return rt}function getTranslations(){let Qe=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";const rt=JSON.parse(JSON.stringify(Ll));let Wn;if(Qe||(Qe=autoDetectLocale(Object.keys(lu),tu)),lu[Qe]&&"en"!==Qe&&(Wn=lu[Qe]),Qe.length>2){const rt=Qe.substring(0,2);lu[rt]&&(Wn=lu[rt])}return Wn&&Object.entries(Wn).forEach((Qe=>{let[Wn,Co]=Qe;Object.entries(Co).forEach((Qe=>{let[Co,Dl]=Qe;Array.isArray(Dl)&&(Dl=Dl.filter((Qe=>null!=Qe))),rt[Wn][Co]=Dl}))})),rt}},2030:(Qe,rt,Wn)=>{"use strict";Wn.r(rt),Wn.d(rt,{API:()=>ql.A,PhotoAdapter:()=>Ql.A,PresetsManager:()=>Kl.A,URLHandler:()=>$l.A,geocoder:()=>Co,i18n:()=>Dl,map:()=>Ll,picture:()=>Rl,semantics:()=>Ul,services:()=>Gl,utils:()=>Zl,widgets:()=>Hl});var Co=Wn(3606),Dl=Wn(4964),Ll=Wn(8340),Rl=Wn(508),Ul=Wn(2283),Gl=Wn(7208),Zl=Wn(7343),Hl=Wn(5995),ql=Wn(5254),Ql=Wn(3727),Kl=Wn(4207),$l=Wn(4451)},8340:(Qe,rt,Wn)=>{"use strict";Wn.r(rt),Wn.d(rt,{DEFAULT_TILES:()=>Rl,MAP_EXPR_QUALITYSCORE:()=>Kl,RASTER_LAYER_ID:()=>Ul,TILES_PICTURES_SYMBOL_ZOOM:()=>Zl,TILES_PICTURES_ZOOM:()=>Gl,VECTOR_STYLES:()=>Hl,combineStyles:()=>combineStyles,getMapParamsFromLocalStorage:()=>getMapParamsFromLocalStorage,getMissingLayerStyles:()=>getMissingLayerStyles,getThumbGif:()=>getThumbGif,getUserLayerId:()=>getUserLayerId,getUserSourceId:()=>getUserSourceId,initMapKeyboardHandler:()=>initMapKeyboardHandler,isLabelLayer:()=>isLabelLayer,linkMapAndPhoto:()=>linkMapAndPhoto,saveMapParamsToLocalStorage:()=>saveMapParamsToLocalStorage,switchCoefValue:()=>switchCoefValue});var Co=Wn(6883),Dl=Wn(7343),Ll=Wn(4964);const Rl="https://panoramax.openstreetmap.fr/pmtiles/basic.json",Ul="pnx-aerial",Gl=15,Zl=18,Hl={PICTURES:{paint:{"circle-radius":["interpolate",["linear"],["zoom"],Gl,4.5,Zl,6,24,12],"circle-opacity":["interpolate",["linear"],["zoom"],Gl,0,Gl+1,1],"circle-stroke-color":"#ffffff","circle-stroke-width":["interpolate",["linear"],["zoom"],Gl+1,0,Gl+2,1,Zl,1.5,24,3]},layout:{}},PICTURES_SYMBOLS:{paint:{"icon-opacity":["interpolate",["linear"],["zoom"],Zl,0,Zl+1,1]},layout:{"icon-image":["case",["==",["get","type"],"equirectangular"],"pnx-arrow-360","pnx-arrow-flat"],"icon-size":["interpolate",["linear"],["zoom"],Zl,.5,24,1],"icon-rotate":["to-number",["get","heading"]],"icon-allow-overlap":!0}},SEQUENCES:{paint:{"line-width":["interpolate",["linear"],["zoom"],0,.5,10,2,14,4,16,5,22,3]},layout:{"line-cap":"square"}},SEQUENCES_PLUS:{paint:{"line-width":["interpolate",["linear"],["zoom"],0,15,Gl+1,30,Gl+2,0],"line-opacity":0,"line-color":"#ff0000"},layout:{"line-cap":"square"}}},ql=["case",["==",["get","type"],"equirectangular"],["case",["has","h_pixel_density"],["step",["get","h_pixel_density"],...Dl.QUALITYSCORE_RES_360_VALUES],1],["case",["has","h_pixel_density"],["step",["get","h_pixel_density"],...Dl.QUALITYSCORE_RES_FLAT_VALUES],1]],Ql=["case",["has","gps_accuracy"],["step",["get","gps_accuracy"],...Dl.QUALITYSCORE_GPS_VALUES],1],Kl=["round",["+",["*",ql,Dl.QUALITYSCORE_POND_RES],["*",Ql,Dl.QUALITYSCORE_POND_GPS]]];function getThumbGif(Qe){const rt=document.createElement("img");return rt.src=Co,rt.alt=Qe.loading,rt.title=Qe.loading,rt.classList.add("pnx-map-thumb","pnx-map-thumb-loader"),rt}function isLabelLayer(Qe){var rt;return"symbol"===Qe.type&&void 0!==(null===Qe||void 0===Qe||null===(rt=Qe.layout)||void 0===rt?void 0:rt["text-field"])&&(void 0===Qe.minzoom||Qe.minzoom<15)}function combineStyles(Qe,rt){var Wn,Co;const Dl=Qe.api.getMapStyle();if(Dl.layers=Dl.layers||[],Dl.layers=Dl.layers.concat(getMissingLayerStyles(Dl.sources,Dl.layers)),Dl.metadata||(Dl.metadata={}),rt.supplementaryStyle&&(Object.assign(Dl.sources,rt.supplementaryStyle.sources||{}),Object.assign(Dl.metadata,rt.supplementaryStyle.metadata||{}),Dl.layers=Dl.layers.concat(rt.supplementaryStyle.layers||[])),Dl.layers=Dl.layers.filter((Qe=>Qe.id)),rt.raster&&(Dl.sources["pnx-aerial"]=rt.raster,Dl.layers.push({id:Ul,type:"raster",source:"pnx-aerial",layout:{visibility:"aerial"===rt.background?"visible":"none"}})),null!==Qe&&void 0!==Qe&&null!==(Wn=Qe.users)&&void 0!==Wn&&Wn.includes("geovisio")||Dl.layers.forEach((Qe=>{"geovisio"===Qe.source&&(Qe.layout||(Qe.layout={}),Qe.layout.visibility="none")})),Dl.layers.sort(((Qe,rt)=>isLabelLayer(Qe)&&!isLabelLayer(rt)?1:!isLabelLayer(Qe)&&isLabelLayer(rt)?-1:Qe.id.startsWith("geovisio")&&!rt.id.startsWith("geovisio")?1:!Qe.id.startsWith("geovisio")&&rt.id.startsWith("geovisio")?-1:Qe.id.endsWith("_pictures")&&!rt.id.endsWith("_pictures")?1:!Qe.id.endsWith("_pictures")&&rt.id.endsWith("_pictures")?-1:0)),null!==(Co=Dl.metadata)&&void 0!==Co&&Co["panoramax:locales"]||(Dl.metadata["panoramax:locales"]=["fr","en","de","es","ru","pt","zh","hi","latin"]),Dl.metadata["panoramax:locales"]){let rt=Qe.lang||(0,Ll.autoDetectLocale)(Dl.metadata["panoramax:locales"],"latin");rt.includes("-")&&(rt=rt.split("-")[0]),rt.includes("_")&&(rt=rt.split("_")[0]),Dl.layers.forEach((Qe=>{isLabelLayer(Qe)&&Qe.layout["text-field"].includes("name:latin")&&(Qe.layout["text-field"]=["coalesce",["get",`name:${rt}`],["get","name:latin"],["get","name"]])}))}const Rl=Dl.layers.find((Qe=>"place_label_city"==Qe.id));let Gl=Dl.layers.find((Qe=>"place_label_capital"==Qe.id));return Rl&&!Gl&&(Rl.paint={"text-color":"hsl(0, 0%, 0%)","text-halo-blur":0,"text-halo-color":"hsla(0, 0%, 100%, 1)","text-halo-width":3},Rl.layout["text-letter-spacing"]=.1,Gl=JSON.parse(JSON.stringify(Rl)),Gl.id="place_label_capital",Gl.filter.push(["<=","capital",2]),Rl.filter.push([">","capital",2]),Dl.layers.push(Gl)),Dl}function getMissingLayerStyles(){let Qe=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},rt=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const Wn=[];return Object.keys(Qe).filter((Qe=>void 0===rt.find((rt=>(null===rt||void 0===rt?void 0:rt.source)===Qe)))).forEach((Qe=>{Qe.startsWith("geovisio")&&(Wn.push({id:`${Qe}_sequences`,type:"line",source:Qe,"source-layer":"sequences",layout:{...Hl.SEQUENCES.layout},paint:{...Hl.SEQUENCES.paint,"line-color":Dl.COLORS.BASE}}),Wn.push({id:`${Qe}_sequences_plus`,type:"line",source:Qe,"source-layer":"sequences",layout:{...Hl.SEQUENCES_PLUS.layout},paint:{...Hl.SEQUENCES_PLUS.paint}}),Wn.push({id:`${Qe}_pictures_symbols`,type:"symbol",source:Qe,"source-layer":"pictures",...Hl.PICTURES_SYMBOLS}),Wn.push({id:`${Qe}_pictures_symbols`,type:"symbol",source:Qe,"source-layer":"pictures",...Hl.PICTURES_SYMBOLS}),Wn.push({id:`${Qe}_pictures`,type:"circle",source:Qe,"source-layer":"pictures",layout:{...Hl.PICTURES.layout},paint:{...Hl.PICTURES.paint,"circle-color":Dl.COLORS.BASE}}))})),rt.filter((Qe=>{var Wn;return(null===Qe||void 0===Qe||null===(Wn=Qe.id)||void 0===Wn?void 0:Wn.endsWith("_sequences"))&&void 0===rt.find((rt=>(null===rt||void 0===rt?void 0:rt.id)===Qe.id+"_plus"))})).forEach((Qe=>{Wn.push({id:`${Qe.id}_plus`,type:"line",source:Qe.source,"source-layer":Qe["source-layer"],layout:{...Hl.SEQUENCES_PLUS.layout},paint:{...Hl.SEQUENCES_PLUS.paint}})})),rt.filter((Qe=>{var Wn;return(null===Qe||void 0===Qe||null===(Wn=Qe.id)||void 0===Wn?void 0:Wn.endsWith("_pictures"))&&void 0===rt.find((rt=>(null===rt||void 0===rt?void 0:rt.id)===Qe.id+"_symbols"))})).forEach((Qe=>{Wn.unshift({id:`${Qe.id}_symbols`,type:"symbol",source:Qe.source,"source-layer":"pictures",...Hl.PICTURES_SYMBOLS}),Qe.paint=Object.assign(Qe.paint||{},Hl.PICTURES.paint),Qe.layout=Object.assign(Qe.layout||{},Hl.PICTURES.layout)})),Wn}function getUserLayerId(Qe,rt){return`${getUserSourceId(Qe)}_${rt}`}function getUserSourceId(Qe){return"geovisio"===Qe?"geovisio":"geovisio_"+Qe}function switchCoefValue(Qe,rt){if(Array.isArray(Qe))return Qe.map((Qe=>switchCoefValue(Qe,rt)));if("object"===typeof Qe&&null!==Qe){const Wn={};for(const Co in Qe)Wn[Co]=switchCoefValue(Qe[Co],rt);return Wn}return"string"===typeof Qe&&Qe.startsWith("coef")?rt:Qe}function linkMapAndPhoto(Qe){const onPicLoad=rt=>{var Wn,Co,Ll,Rl;(0,Dl.isNullId)(rt.detail.picId)?(Qe.map.displayPictureMarker(),null!==Qe&&void 0!==Qe&&null!==(Wn=Qe.isMapWide)&&void 0!==Wn&&Wn.call(Qe)&&(null===Qe||void 0===Qe||null===(Co=Qe.mini)||void 0===Co||Co.setAttribute("collapsed",""))):(Qe.map.displayPictureMarker(rt.detail.lon,rt.detail.lat,Qe.psv.getXY().x,rt.detail.first),null!==Qe&&void 0!==Qe&&null!==(Ll=Qe.isMapWide)&&void 0!==Ll&&Ll.call(Qe)&&(null===Qe||void 0===Qe||null===(Rl=Qe.mini)||void 0===Rl||Rl.removeAttribute("collapsed")))};Qe.psv.addEventListener("picture-loading",onPicLoad),Qe.psv.addEventListener("picture-loaded",onPicLoad),Qe.psv.addEventListener("view-rotated",(()=>{let rt=Qe.psv.getPosition().yaw*(180/Math.PI);rt+=Qe.psv.getPictureOriginalHeading(),Qe.map._picMarker.setRotation(rt)})),Qe.psv.addEventListener("picture-preview-started",(rt=>{Qe.map._picMarkerPreview.setLngLat(rt.detail.coordinates).setRotation(rt.detail.direction||0).addTo(Qe.map)})),Qe.psv.addEventListener("picture-preview-stopped",(()=>{Qe.map._picMarkerPreview.remove()})),Qe.psv.addEventListener("picture-loaded",(rt=>{Qe.isWidthSmall()&&Qe._picPopup&&rt.detail.picId==Qe._picPopup._picId&&Qe._picPopup.remove()})),Qe.map.on("picture-click",(rt=>{Qe.select(rt.seqId,rt.picId),!Qe.psv._myVTour.state.currentNode&&null!==Qe&&void 0!==Qe&&Qe._setFocus&&Qe._setFocus("pic")})),Qe.map.on("sequence-click",(rt=>{Qe.api.getPicturesAroundCoordinates(rt.coordinates.lat,rt.coordinates.lng,1,1,rt.seqId).then((rt=>{var Wn,Co;(null===rt||void 0===rt||null===(Wn=rt.features)||void 0===Wn?void 0:Wn.length)>0&&(Qe.select(null===(Co=rt.features[0])||void 0===Co?void 0:Co.collection,rt.features[0].id),!Qe.psv.getPictureMetadata()&&null!==Qe&&void 0!==Qe&&Qe._setFocus&&Qe._setFocus("pic"))}))})),Qe._setFocus&&(Qe.psv.addEventListener("dblclick",(()=>{Qe.isMapWide()&&Qe._setFocus("pic")})),Qe.map.on("dblclick",(()=>{Qe.isMapWide()?Qe.select():Qe._setFocus("map")})))}function initMapKeyboardHandler(Qe){Qe.map.keyboard.keydown=function(rt){if(rt.altKey||rt.ctrlKey||rt.metaKey)return;switch(rt.key){case"*":case"5":return void Qe.moveCenter();case"PageUp":case"9":return void Qe.psv.goToNextPicture();case"PageDown":case"3":return void Qe.psv.goToPrevPicture();case"Home":case"7":return rt.stopPropagation(),void Qe._toggleFocus();case"End":case"1":return void Qe.mini.toggleAttribute("collapsed");case" ":case"0":return void Qe.psv.toggleSequencePlaying()}let Wn=0,Co=0,Dl=0,Ll=0,Rl=0;switch(rt.keyCode){case 61:case 107:case 171:case 187:Wn=1;break;case 189:case 109:case 173:Wn=-1;break;case 37:case 100:rt.shiftKey?Co=-1:(rt.preventDefault(),Ll=-1);break;case 39:case 102:rt.shiftKey?Co=1:(rt.preventDefault(),Ll=1);break;case 38:case 104:rt.shiftKey?Dl=1:(rt.preventDefault(),Rl=-1);break;case 40:case 98:rt.shiftKey?Dl=-1:(rt.preventDefault(),Rl=1);break;default:return}return this._rotationDisabled&&(Co=0,Dl=0),{cameraAnimation:Qe=>{const Ul=this._tr;Qe.easeTo({duration:300,easeId:"keyboardHandler",easing:Qe=>Qe*(2-Qe),zoom:Wn?Math.round(Ul.zoom)+Wn*(rt.shiftKey?2:1):Ul.zoom,bearing:Ul.bearing+Co*this._bearingStep,pitch:Ul.pitch+Dl*this._pitchStep,offset:[-Ll*this._panStep,-Rl*this._panStep],center:Ul.center},{originalEvent:rt})}}}.bind(Qe.map.keyboard)}const $l="pnx-map-parameters";function getMapParamsFromLocalStorage(){const Qe=localStorage.getItem($l);if(!Qe)return{};try{return JSON.parse(Qe)}catch(rt){return console.warn("Can't read map parameters stored in localStorage",rt),{}}}function saveMapParamsToLocalStorage(Qe){const save=()=>localStorage.setItem($l,JSON.stringify({center:Object.fromEntries(Object.entries(Qe.getCenter()).map((Qe=>{let[rt,Wn]=Qe;return[rt,Wn.toFixed(7)]}))),zoom:Qe.getZoom().toFixed(1),background:Qe.getBackground(),theme:Qe._mapFilters.theme}));Qe.on("background-changed",save),Qe.on("filters-changed",save),Qe.on("moveend",save),Qe.on("zoomend",save),Qe.on("dragend",save),Qe.on("boxzoomend",save)}},508:(Qe,rt,Wn)=>{"use strict";Wn.r(rt),Wn.d(rt,{apiFeatureToPSVNode:()=>apiFeatureToPSVNode,filterRelatedPicsLinks:()=>filterRelatedPicsLinks,getCroppedPanoData:()=>getCroppedPanoData,getExifFloat:()=>getExifFloat,getGPSPrecision:()=>getGPSPrecision,getHashTags:()=>getHashTags,getNodeCaption:()=>getNodeCaption,getSphereCorrection:()=>getSphereCorrection,hasAnnotations:()=>hasAnnotations,sortPicturesInDirection:()=>sortPicturesInDirection});var Co=Wn(8407),Dl=Wn(6830),Ll=Wn(7343);const Rl=(0,Ll.svgToPSVLink)(Co,"white"),Ul=(0,Ll.svgToPSVLink)(Dl,Ll.COLORS.NEXT);function getExifFloat(Qe){if(!([null,void 0,""].includes(Qe)||"string"===typeof Qe&&""===Qe.trim())){if("number"===typeof Qe)return Qe;if("string"!==typeof Qe);else{if(/^-?\d+(\.\d+)?\/-?\d+(\.\d+)?$/.test(Qe)){const rt=Qe.split("/").map((Qe=>parseFloat(Qe)));return rt[0]/rt[1]}try{return parseFloat(Qe)}catch(rt){}}}}function getGPSPrecision(Qe){var rt,Wn,Co,Dl,Ll;let Rl=null;const Ul=(null===Qe||void 0===Qe||null===(rt=Qe.properties)||void 0===rt?void 0:rt["quality:horizontal_accuracy"])||getExifFloat(null===Qe||void 0===Qe||null===(Wn=Qe.properties)||void 0===Wn||null===(Co=Wn.exif)||void 0===Co?void 0:Co["Exif.GPSInfo.GPSHPositioningError"]),Gl=getExifFloat(null===Qe||void 0===Qe||null===(Dl=Qe.properties)||void 0===Dl||null===(Ll=Dl.exif)||void 0===Ll?void 0:Ll["Exif.GPSInfo.GPSDOP"]);return void 0!==Ul?Rl=`${Ul} m`:void 0!==Gl&&(Rl=Gl<1?"ideal":Gl<2?"excellent":Gl<5?"good":Gl<10?"moderate":Gl<20?"fair":"poor"),Rl}function getSphereCorrection(Qe){var rt,Wn,Co,Dl;let Ll=null===(rt=Qe.properties)||void 0===rt?void 0:rt["view:azimuth"];if(void 0===Ll){var Rl,Ul;const rt=getExifFloat(null===(Rl=Qe.properties)||void 0===Rl||null===(Ul=Rl.exif)||void 0===Ul?void 0:Ul["Exif.GPSInfo.GPSImgDirection"]);void 0!==rt&&(Ll=rt)}Ll=Ll||0;let Gl=null===(Wn=Qe.properties)||void 0===Wn?void 0:Wn["pers:yaw"],Zl=["Xmp.GPano.PoseHeadingDegrees","Xmp.Camera.Yaw","Exif.MpfInfo.MPFYawAngle"];if(void 0===Gl)for(let du of Zl){var Hl,ql;const rt=getExifFloat(null===(Hl=Qe.properties)||void 0===Hl||null===(ql=Hl.exif)||void 0===ql?void 0:ql[du]);if(void 0!==rt){Gl=rt;break}}Gl=Gl||0,Math.round(Ll)===Math.round(Gl)&&Gl>0&&console.warn("Picture with UUID",Qe.id,"has same GPS Image direction and Yaw, could cause rendering issues");let Ql=null===(Co=Qe.properties)||void 0===Co?void 0:Co["pers:pitch"];if(Zl=["Xmp.GPano.PosePitchDegrees","Xmp.Camera.Pitch","Exif.MpfInfo.MPFPitchAngle"],void 0===Ql)for(let du of Zl){var Kl,$l;const rt=getExifFloat(null===(Kl=Qe.properties)||void 0===Kl||null===($l=Kl.exif)||void 0===$l?void 0:$l[du]);if(void 0!==rt){Ql=rt;break}}Ql=Ql||0;let Tc=null===(Dl=Qe.properties)||void 0===Dl?void 0:Dl["pers:roll"];if(Zl=["Xmp.GPano.PoseRollDegrees","Xmp.Camera.Roll","Exif.MpfInfo.MPFRollAngle"],void 0===Tc)for(let du of Zl){var tu,lu;const rt=getExifFloat(null===(tu=Qe.properties)||void 0===tu||null===(lu=tu.exif)||void 0===lu?void 0:lu[du]);if(void 0!==rt){Tc=rt;break}}return Tc=Tc||0,0!==Ql&&0!==Tc?{pan:Gl*Math.PI/180,tilt:Ql*Math.PI/180,roll:Tc*Math.PI/180}:{}}function getCroppedPanoData(Qe){var rt,Wn;let Co;var Dl,Ll;if(null!==(rt=Qe.properties)&&void 0!==rt&&rt["pers:interior_orientation"]&&(null!==(Dl=Qe.properties["pers:interior_orientation"])&&void 0!==Dl&&Dl.visible_area&&null!==(Ll=Qe.properties["pers:interior_orientation"])&&void 0!==Ll&&Ll.sensor_array_dimensions)){const rt=Qe.properties["pers:interior_orientation"].visible_area,Wn=Qe.properties["pers:interior_orientation"].sensor_array_dimensions;try{Co={fullWidth:parseInt(Wn[0]),fullHeight:parseInt(Wn[1]),croppedX:parseInt(rt[0]),croppedY:parseInt(rt[1]),croppedWidth:parseInt(Wn[0])-parseInt(rt[2])-parseInt(rt[0]),croppedHeight:parseInt(Wn[1])-parseInt(rt[3])-parseInt(rt[1])}}catch(Ql){console.warn("Invalid pers:interior_orientation values for cropped panorama "+Qe.id)}}if(!Co&&null!==(Wn=Qe.properties)&&void 0!==Wn&&Wn.exif)try{var Rl,Ul,Gl,Zl,Hl,ql;Co={fullWidth:parseInt(null===(Rl=Qe.properties.exif)||void 0===Rl?void 0:Rl["Xmp.GPano.FullPanoWidthPixels"]),fullHeight:parseInt(null===(Ul=Qe.properties.exif)||void 0===Ul?void 0:Ul["Xmp.GPano.FullPanoHeightPixels"]),croppedX:parseInt(null===(Gl=Qe.properties.exif)||void 0===Gl?void 0:Gl["Xmp.GPano.CroppedAreaLeftPixels"]),croppedY:parseInt(null===(Zl=Qe.properties.exif)||void 0===Zl?void 0:Zl["Xmp.GPano.CroppedAreaTopPixels"]),croppedWidth:parseInt(null===(Hl=Qe.properties.exif)||void 0===Hl?void 0:Hl["Xmp.GPano.CroppedAreaImageWidthPixels"]),croppedHeight:parseInt(null===(ql=Qe.properties.exif)||void 0===ql?void 0:ql["Xmp.GPano.CroppedAreaImageHeightPixels"])}}catch(Ql){console.warn("Invalid XMP.GPano values for cropped panorama "+Qe.id)}return Co&&(Co=Object.fromEntries(Object.entries(Co||{}).filter((Qe=>!isNaN(Qe[1])))),(!Co.fullWidth&&!Co.croppedWidth&&Co.fullHeight&&!Co.croppedHeight||Co.fullWidth&&!Co.croppedWidth&&!Co.fullHeight&&!Co.croppedHeight||Co.fullWidth&&!Co.croppedWidth&&Co.fullHeight&&!Co.croppedHeight||Co.fullWidth==Co.croppedWidth&&Co.fullHeight==Co.croppedHeight)&&(Co={})),Co||{}}function sortPicturesInDirection(Qe){return(rt,Wn)=>"related"!=rt.rel&&"related"!=Wn.rel?0:"related"!=rt.rel?-1:"related"!=Wn.rel?1:rt.date==Wn.date?(0,Ll.getDistance)(Qe,rt.geometry.coordinates)-(0,Ll.getDistance)(Qe,Wn.geometry.coordinates):Wn.date.localeCompare(rt.date)}function getNodeCaption(Qe,rt){var Wn,Co,Dl;const Ll={};if(null!==Qe&&void 0!==Qe&&null!==(Wn=Qe.properties)&&void 0!==Wn&&Wn.datetimetz){Ll.date=new Date(Qe.properties.datetimetz);const rt=Qe.properties.datetimetz.match(/([+-]\d{2}):(\d{2})$|Z$/);rt&&("Z"===rt[0]?Ll.tz="UTC":Ll.tz=rt[0])}else null!==Qe&&void 0!==Qe&&null!==(Co=Qe.properties)&&void 0!==Co&&Co.datetime&&(Ll.date=new Date(Qe.properties.datetime));if(null!==Qe&&void 0!==Qe&&Qe.providers){var Rl;const rt=null===Qe||void 0===Qe||null===(Rl=Qe.providers)||void 0===Rl?void 0:Rl.filter((Qe=>{var rt;return null===Qe||void 0===Qe||null===(rt=Qe.roles)||void 0===rt?void 0:rt.includes("producer")}));if((null===rt||void 0===rt?void 0:rt.length)>=0){const Qe={};rt.map((Qe=>Qe.name)).forEach((rt=>{const Wn=rt.toLowerCase().replace(/\s/g,"");Qe[Wn]?Qe[Wn].push(rt):Qe[Wn]=[rt]})),Ll.producer=[],Object.values(Qe).forEach((Qe=>{const rt=Qe[0],Wn=Qe.find((Qe=>Qe.toLowerCase()!=Qe));Ll.producer.push(Wn||rt)}))}}if(null!==Qe&&void 0!==Qe&&null!==(Dl=Qe.properties)&&void 0!==Dl&&Dl.license&&(Ll.license=Qe.properties.license,null!==Qe&&void 0!==Qe&&Qe.links)){const Wn=Qe.links.find((Qe=>"license"===(null===Qe||void 0===Qe?void 0:Qe.rel)));Wn&&(Ll.license=`<a href="${Wn.href}" title="${rt.pnx.metadata_general_license_link}" target="_blank">${Ll.license}</a>`)}return Ll}function apiFeatureToPSVNode(Qe,rt){var Wn,Co,Dl,Ll,Rl,Ul,Gl,Zl,Hl,ql,Ql,Kl,$l,Tc;let tu=arguments.length>2&&void 0!==arguments[2]&&arguments[2],lu=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;const du=null!=(null===(Wn=Qe.properties)||void 0===Wn||null===(Co=Wn["pers:interior_orientation"])||void 0===Co?void 0:Co.field_of_view);let fu=du?parseInt(Qe.properties["pers:interior_orientation"].field_of_view):70;const yu=360===fu,Eu=(Object.values(Qe.assets).find((Qe=>{var rt;return null===Qe||void 0===Qe||null===(rt=Qe.roles)||void 0===rt?void 0:rt.includes("data")}))||{}).href,Tu=null===Qe||void 0===Qe||null===(Dl=Qe.properties)||void 0===Dl||null===(Ll=Dl["tiles:tile_matrix_sets"])||void 0===Ll?void 0:Ll.geovisio,Lu=null===(Rl=Qe.links)||void 0===Rl||null===(Ul=Rl.find)||void 0===Ul?void 0:Ul.call(Rl,(Qe=>"prev"===(null===Qe||void 0===Qe?void 0:Qe.rel)&&"application/geo+json"===(null===Qe||void 0===Qe?void 0:Qe.type))),Zu=null===(Gl=Qe.links)||void 0===Gl||null===(Zl=Gl.find)||void 0===Zl?void 0:Zl.call(Gl,(Qe=>"next"===(null===Qe||void 0===Qe?void 0:Qe.rel)&&"application/geo+json"===(null===Qe||void 0===Qe?void 0:Qe.type))),Xu=Object.values(Qe.assets).find((Qe=>{var rt;return(null===(rt=Qe.roles)||void 0===rt?void 0:rt.includes("visual"))&&"image/webp"===Qe.type})),Ju=Object.values(Qe.assets).find((Qe=>{var rt;return(null===(rt=Qe.roles)||void 0===rt?void 0:rt.includes("visual"))&&"image/jpeg"===Qe.type})),$u=(Xu||Ju).href,ed=null===(Hl=Object.values(Qe.assets).find((Qe=>{var rt;return(null===(rt=Qe.roles)||void 0===rt?void 0:rt.includes("thumbnail"))&&"image/jpeg"===Qe.type})))||void 0===Hl?void 0:Hl.href,td=(null===Qe||void 0===Qe||null===(ql=Qe.asset_templates)||void 0===ql?void 0:ql.tiles_webp)||(null===Qe||void 0===Qe||null===(Ql=Qe.asset_templates)||void 0===Ql?void 0:Ql.tiles),id=getCroppedPanoData(Qe),nd=null===(Kl=Qe.links)||void 0===Kl||null===($l=Kl.find)||void 0===$l?void 0:$l.call(Kl,(Qe=>"via"===(null===Qe||void 0===Qe?void 0:Qe.rel)&&"application/json"===(null===Qe||void 0===Qe?void 0:Qe.type)));let rd;rd=Object.keys(id).length>0?{baseUrl:tu?Eu:$u,origBaseUrl:tu?Eu:$u,hdUrl:Eu,thumbUrl:ed,basePanoData:id,cols:2,rows:1,width:2,tileUrl:()=>null}:yu&&Tu?{baseUrl:$u,origBaseUrl:$u,basePanoData:Qe=>({fullWidth:Qe.width,fullHeight:Qe.height}),hdUrl:Eu,thumbUrl:ed,cols:Tu&&Tu.tileMatrix[0].matrixWidth,rows:Tu&&Tu.tileMatrix[0].matrixHeight,width:Tu&&Tu.tileMatrix[0].matrixWidth*Tu.tileMatrix[0].tileWidth,tileUrl:Tu&&((Qe,rt)=>td.href.replace(/\{TileCol\}/g,Qe).replace(/\{TileRow\}/g,rt))}:{baseUrl:tu?Eu:$u,origBaseUrl:tu?Eu:$u,hdUrl:Eu,thumbUrl:ed,basePanoData:Qe=>{Qe.width<Qe.height&&!du&&(fu=35);const rt=fu*Qe.height/Qe.width,Wn=360*Qe.width/fu,Co=180*Qe.height/rt;return{fullWidth:Wn,fullHeight:Co,croppedWidth:Qe.width,croppedHeight:Qe.height,croppedX:(Wn-Qe.width)/2,croppedY:(Co-Qe.height)/2}},cols:2,rows:1,width:2,tileUrl:()=>null},null!==(Tc=Qe.properties)&&void 0!==Tc&&Tc.semantics&&(Qe.properties.semantics=Qe.properties.semantics.filter((Qe=>Object.keys(Qe).length>0)));return{id:Qe.id,caption:getNodeCaption(Qe,rt),panorama:rd,links:filterRelatedPicsLinks(Qe,lu),gps:Qe.geometry.coordinates,sequence:{id:Qe.collection,nextPic:Zu?Zu.id:void 0,prevPic:Lu?Lu.id:void 0},sphereCorrection:getSphereCorrection(Qe),horizontalFov:fu,origInstance:nd,properties:Qe.properties}}function filterRelatedPicsLinks(Qe){var rt;let Wn=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const Co=Qe.links.filter((Qe=>["next","prev","related"].includes(null===Qe||void 0===Qe?void 0:Qe.rel)&&"application/geo+json"===(null===Qe||void 0===Qe?void 0:Qe.type))).filter((Qe=>!Wn||Wn(Qe))).map((Qe=>(Qe.datetime&&(Qe.date=Qe.datetime.split("T")[0]),Qe))),Dl=Qe.geometry.coordinates,Gl=[],Zl={N:[],ENE:[],ESE:[],S:[],WSW:[],WNW:[]};for(let Rl of Co){Zl[(0,Ll.getSimplifiedAngle)(Dl,Rl.geometry.coordinates)].push(Rl)}for(let Ll in Zl){const Qe=Zl[Ll];0!=Qe.length&&(Qe.sort(sortPicturesInDirection(Dl)),Gl.push(Qe.shift()))}let arrowStyle=Qe=>"related"===Qe.rel?{element:(0,Ll.getArrow)(Ul),size:{width:128/3,height:128}}:{element:(0,Ll.getArrow)(Rl),size:{width:75,height:75}};const Hl=-((null===(rt=Qe.properties)||void 0===rt?void 0:rt["view:azimuth"])||0)*(Math.PI/180);return Gl.map((Qe=>({nodeId:Qe.id,gps:Qe.geometry.coordinates,arrowStyle:arrowStyle(Qe),linkOffset:{yaw:Hl}})))}function getHashTags(Qe){var rt;if(null===Qe||void 0===Qe||null===(rt=Qe.properties)||void 0===rt||!rt.semantics)return[];const Wn=Qe.properties.semantics.filter((Qe=>"hashtags"===Qe.key)),Co=[];return Wn.forEach((Qe=>Qe.value.split(";").forEach((Qe=>Co.push(Qe.trim()))))),Co}function hasAnnotations(Qe){var rt,Wn;return(null===Qe||void 0===Qe||null===(rt=Qe.properties)||void 0===rt||null===(Wn=rt.annotations)||void 0===Wn?void 0:Wn.length)>0}},2283:(Qe,rt,Wn)=>{"use strict";Wn.r(rt),Wn.d(rt,{decodeBasicTag:()=>decodeBasicTag,decodeKey:()=>decodeKey,groupByPrefix:()=>groupByPrefix});var Co=Wn(4542),Dl=Wn(5995),Ll=Wn(7929),Rl=Wn(1760),Ul=Wn(7091),Gl=Wn(7208);function valToValLink(Qe,rt,Wn){return Co.qy`
2384
+ `}}Zoom.properties={_lastWantedZoom:{state:!0}},customElements.define("pnx-widget-zoom",Zoom)},222:(Qe,rt,Wn)=>{"use strict";Wn.r(rt),Wn.d(rt,{CopyCoordinates:()=>Co.A,GeoSearch:()=>Dl.A,Legend:()=>Ll.A,MapFiltersButton:()=>Rl.A,MapLayersButton:()=>Ul.A,OSMEditors:()=>Gl.A,PictureLegendActions:()=>Zl.A,Player:()=>Hl.A,Zoom:()=>ql.A});var Co=Wn(5114),Dl=Wn(2603),Ll=Wn(4385),Rl=Wn(4529),Ul=Wn(1614),Gl=Wn(5789),Zl=Wn(8806),Hl=Wn(8305),ql=Wn(3023)},5254:(Qe,rt,Wn)=>{"use strict";Wn.d(rt,{A:()=>API});var Co=Wn(8340),Dl=Wn(7343);class API extends EventTarget{constructor(Qe){let rt=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(super(),null===Qe||void 0===Qe||"string"!==typeof Qe){const Qe=new Error("endpoint parameter is empty or not a valid string");throw this.dispatchEvent(new CustomEvent("broken",{detail:{error:Qe}})),Qe}if(Qe.startsWith("/")&&(Qe=window.location.href.split("/").slice(0,3).join("/")+Qe),!API.isValidHttpUrl(Qe)){const rt=new Error(`endpoint parameter is not a valid URL: ${Qe}`);throw this.dispatchEvent(new CustomEvent("broken",{detail:{error:rt}})),rt}this._endpoint=Qe,this._isReady=0,this._dataBbox=null,this._fetchOpts=(null===rt||void 0===rt?void 0:rt.fetch)||{},this._metadata={},rt.skipReadLanding||(this._readLanding=fetch(Qe,this._getFetchOptions()).then((Qe=>Qe.json())).then((Qe=>this._parseLanding(Qe,rt))).catch((Qe=>(this._isReady=-1,console.error(Qe),this.dispatchEvent(new CustomEvent("broken",{detail:{error:Qe}})),Promise.reject("Viewer failed to communicate with API")))).then((()=>this._loadMapStyles(rt.style,rt.users))).then((()=>(this._isReady=1,this.dispatchEvent(new Event("ready")),"API is ready"))))}onceReady(){return-1==this._isReady?Promise.reject("Viewer failed to communicate with API"):1==this._isReady?Promise.resolve("API is ready"):this._readLanding}isReady(){return 1==this._isReady}getAvailableFeatures(){return Object.entries(this._endpoints).filter((Qe=>null!==Qe[1])).map((Qe=>Qe[0]))}getUnavailableFeatures(){return Object.entries(this._endpoints).filter((Qe=>null===Qe[1])).map((Qe=>Qe[0]))}_parseLanding(Qe,rt){var Wn,Co;if(this._endpoints={collections:null,search:null,style:null,user_style:null,tiles:(null===rt||void 0===rt?void 0:rt.tiles)||null,user_tiles:null,user_search:null,collection_preview:null,item_preview:null,rss:null,report:null},!Qe||!Qe.links||!Array.isArray(Qe.links))throw new Error("API Landing page doesn't contain 'links' list");if(!Qe.stac_version.startsWith("1."))throw new Error(`API is not in a supported STAC version (Panoramax viewer supports only 1.x, API is ${Qe.stac_version})`);this._metadata.name=Qe.title||"Unnamed",this._metadata.stac_version=Qe.stac_version,this._metadata.geovisio_version=Qe.geovisio_version;const Dl=[],Ll=[];if([{rel:"search",type:"application/geo+json",endpointId:"search",mandatory:!0,missingIssue:"No direct access to pictures metadata."},{rel:"data",type:"application/json",endpointId:"collections",mandatory:!0,missingIssue:"No way for viewer to access sequences."},{rel:"data",type:"application/rss+xml",endpointId:"rss"},{rel:"xyz",type:"application/vnd.mapbox-vector-tile",endpointId:"tiles"},{rel:"xyz-style",type:"application/json",endpointId:"style"},{rel:"user-xyz-style",type:"application/json",endpointId:"user_style"},{rel:"user-xyz",type:"application/vnd.mapbox-vector-tile",endpointId:"user_tiles"},{rel:"user-search",type:"application/json",endpointId:"user_search",missingIssue:"Filter map data by user name will not be available."},{rel:"collection-preview",type:"image/jpeg",endpointId:"collection_preview",missingIssue:"Display of thumbnail could be slower."},{rel:"item-preview",type:"image/jpeg",endpointId:"item_preview",missingIssue:"Display of thumbnail could be slower."},{rel:"report",type:"application/json",endpointId:"report"}].forEach((rt=>{const Wn=Qe.links.find((Qe=>Qe.rel==rt.rel&&Qe.type==rt.type));if(Wn){if(!API.isValidHttpUrl(Wn.href))throw new Error(`API endpoint '${Wn.rel}' (${Wn.type}) is not a valid URL: ${Wn.href}`);this._endpoints[rt.endpointId]||(this._endpoints[rt.endpointId]=Wn.href)}else if(!this._endpoints[rt.endpointId]){let Qe=`API doesn't offer a '${rt.rel}' (${rt.type}) endpoint in its links`;rt.missingIssue&&(Qe+=`\n${rt.missingIssue}`),rt.mandatory?Dl.push(Qe):rt.missingIssue&&Ll.push(Qe)}})),this._endpoints.style||this._endpoints.tiles||Ll.push("API doesn't offer 'xyz' or 'xyz-style' endpoints in its links.\nMap widget will not be available."),this._endpoints.user_style||this._endpoints.user_tiles||Ll.push("API doesn't offer 'user-xyz' or 'user-xyz-style' endpoints in its links.\nFilter map data by user ID will not be available."),Ll.forEach((Qe=>console.warn(Qe))),Dl.length>0)throw new Error(Dl.join("\n"));const Rl=null===Qe||void 0===Qe||null===(Wn=Qe.extent)||void 0===Wn||null===(Co=Wn.spatial)||void 0===Co?void 0:Co.bbox;this._dataBbox=Rl&&Array.isArray(Rl)&&Rl.length>0&&Array.isArray(Rl[0])&&4===Rl[0].length?[[Rl[0][0],Rl[0][1]],[Rl[0][2],Rl[0][3]]]:null}_loadMapStyles(Qe,rt){const Wn=new Set(rt||[]);this.mapStyle={version:8,sources:{},layers:[],metadata:{}};const Co=[this.getMapStyle()];if("string"===typeof Qe){const rt=Qe.startsWith(this._endpoint)?this._getFetchOptions():void 0;Co.push(fetch(Qe,rt).then((Qe=>Qe.json())))}else"object"===typeof Qe&&Co.push(Promise.resolve(Qe));return[...Wn].filter((Qe=>"geovisio"!==Qe)).forEach((Qe=>{Co.push(this.getUserMapStyle(Qe,!0))})),Promise.all(Co).then((Qe=>{const rt=["bearing","center","glyphs","light","name","pitch","sky","sprite","terrain","transition","zoom"];Qe.forEach((Qe=>{rt.forEach((rt=>{Qe[rt]&&(this.mapStyle[rt]=Qe[rt]||this.mapStyle[rt])})),Object.assign(this.mapStyle.sources,(null===Qe||void 0===Qe?void 0:Qe.sources)||{}),Object.assign(this.mapStyle.metadata,(null===Qe||void 0===Qe?void 0:Qe.metadata)||{}),this.mapStyle.layers=this.mapStyle.layers.concat((null===Qe||void 0===Qe?void 0:Qe.layers)||[])}))})).catch((Qe=>console.error(Qe)))}_getFetchOptions(){let Qe=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return Object.assign({signal:Qe?void 0:AbortSignal.timeout(15e3)},this._fetchOpts)}_getMapRequestTransform(){const Qe=this._getFetchOptions();if(delete Qe.signal,Object.keys(Qe).length>0)return rt=>{if(rt.startsWith(this._endpoint))return{url:rt,...Qe}}}async getSequenceItems(Qe){let rt=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,Wn=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!this.isReady())throw new Error("API is not ready to use");try{return API.isIdValid(Qe),fetch(rt||`${this._endpoints.collections}/${Qe}/items`,this._getFetchOptions(!0)).then((Qe=>Qe.json())).then((rt=>{let Co=rt;Wn&&(Co.features=Wn.features.concat(Co.features));const Dl=rt.links.find((Qe=>"next"===Qe.rel));return Dl?this.getSequenceItems(Qe,Dl.href,Co):Co}))}catch(Co){return Promise.reject(Co)}}getPicturesAroundCoordinatesUrl(Qe,rt){let Wn=arguments.length>2&&void 0!==arguments[2]?arguments[2]:5e-4,Co=arguments.length>3?arguments[3]:void 0,Dl=arguments.length>4?arguments[4]:void 0;if(!this.isReady())throw new Error("API is not ready to use");if(isNaN(parseFloat(Qe))||isNaN(parseFloat(rt)))throw new Error("lat and lon parameters should be valid numbers");const Ll=[rt-Wn,Qe-Wn,rt+Wn,Qe+Wn].map((Qe=>Qe.toFixed(4))).join(","),Rl=Co?`&limit=${Co}`:"",Ul=Dl?`&collections=${Dl}`:"";return`${this._endpoints.search}?bbox=${Ll}${Rl}${Ul}`}getPicturesAroundCoordinates(Qe,rt,Wn,Co,Dl){return fetch(this.getPicturesAroundCoordinatesUrl(Qe,rt,Wn,Co,Dl),this._getFetchOptions()).then((Qe=>Qe.json()))}getPictureMetadataUrl(Qe,rt){if(!this.isReady())throw new Error("API is not ready to use");if(API.isIdValid(Qe))return rt?`${this._endpoints.collections}/${rt}/items/${Qe}`:`${this._endpoints.search}?ids=${Qe}`}getMapStyle(){if(this.isReady())return this.mapStyle;let Qe;return Qe=this._endpoints.style?this._endpoints.style:this._endpoints.tiles?{version:8,sources:{geovisio:{type:"vector",tiles:[this._endpoints.tiles],minzoom:0,maxzoom:Co.TILES_PICTURES_ZOOM}}}:fetch(`${this._endpoint}/map/14/0/0.mvt`,this._getFetchOptions()).then((()=>(this._endpoints.tiles=`${this._endpoint}/map/{z}/{x}/{y}.mvt`,console.log("Using fallback endpoint for vector tiles"),this.getMapStyle()))).catch((Qe=>(console.error(Qe),Promise.reject(new Error("API doesn't offer a vector tiles endpoint"))))),"string"===typeof Qe?fetch(Qe,this._getFetchOptions()).then((Qe=>Qe.json())):Promise.resolve(Qe)}getUserMapStyle(Qe){let rt;return arguments.length>1&&void 0!==arguments[1]&&arguments[1]||this.isReady()?Qe?(this._endpoints.user_style?rt=this._endpoints.user_style.replace(/\{userId\}/g,Qe):this._endpoints.user_tiles&&(rt={version:8,sources:{[`geovisio_${Qe}`]:{type:"vector",tiles:[this._endpoints.user_tiles.replace(/\{userId\}/g,Qe)],minzoom:0,maxzoom:Co.TILES_PICTURES_ZOOM}}}),rt?"string"===typeof rt?fetch(rt,this._getFetchOptions()).then((Qe=>Qe.json())):Promise.resolve(rt):Promise.reject(new Error("API doesn't offer map style for specific user"))):Promise.reject(new Error("Parameter userId is empty")):Promise.reject(new Error("API is not ready to use"))}findThumbnailInPictureFeature(Qe){if(!this.isReady())throw new Error("API is not ready to use");if(!Qe||!Qe.assets)return null;let rt=null;for(let Wn of Object.values(Qe.assets)){if(Wn.roles.includes("thumbnail")&&"image/jpeg"==Wn.type&&API.isValidHttpUrl(Wn.href))return Wn.href;Wn.roles.includes("visual")&&"image/jpeg"==Wn.type&&API.isValidHttpUrl(Wn.href)&&(rt=Wn.href)}return rt}getPictureThumbnailURLForSequence(Qe,rt){if(!this.isReady())throw new Error("API is not ready to use");if(this._endpoints.collection_preview)return Promise.resolve(this._endpoints.collection_preview.replace("{id}",Qe));if(rt&&Array.isArray(rt.links)&&rt.links.length>0){let Qe=rt.links.find((Qe=>"preview"===Qe.rel&&"image/jpeg"===Qe.type));if(Qe&&API.isValidHttpUrl(Qe.href))return Promise.resolve(Qe.href)}const Wn=`${this._endpoints.search}?limit=1&collections=${Qe}`;return fetch(Wn,this._getFetchOptions()).then((Qe=>Qe.json())).then((Qe=>Array.isArray(Qe.features)&&0!=Qe.features.length?this.findThumbnailInPictureFeature(Qe.features.pop()):null))}getPictureThumbnailURL(Qe,rt){if(!this.isReady())throw new Error("API is not ready to use");return Qe?this._endpoints.item_preview?Promise.resolve(this._endpoints.item_preview.replace("{id}",Qe)):Qe&&rt?fetch(`${this._endpoints.collections}/${rt}/items/${Qe}`,this._getFetchOptions()).then((Qe=>Qe.json())).then((Qe=>Qe?this.findThumbnailInPictureFeature(Qe):null)):fetch(`${this._endpoints.search}?ids=${Qe}`,this._getFetchOptions()).then((Qe=>Qe.json())).then((Qe=>Qe&&Array.isArray(Qe.features)&&0!=Qe.features.length?this.findThumbnailInPictureFeature(Qe.features.pop()):null)):Promise.resolve(null)}getRSSURL(Qe){if(!this.isReady())throw new Error("API is not ready to use");if(this._endpoints.rss){let rt=this._endpoints.rss;return Qe&&(rt+=rt.includes("?")?"&":"?",rt+="bbox="+[Qe.getWest(),Qe.getSouth(),Qe.getEast(),Qe.getNorth()].join(",")),rt}return null}getSequenceMetadataUrl(Qe){if(!this.isReady())throw new Error("API is not ready to use");return`${this._endpoints.collections}/${Qe}`}getDataBbox(){if(!this.isReady())throw new Error("API is not ready to use");return this._dataBbox}searchUsers(Qe){if(!this.isReady())throw new Error("API is not ready to use");if(!this._endpoints.user_search)throw new Error("User search is not available");return fetch(`${this._endpoints.user_search}?q=${Qe}`,this._getFetchOptions()).then((Qe=>Qe.json())).then((Qe=>(null===Qe||void 0===Qe?void 0:Qe.features)||null))}getUserName(Qe){if(!this.isReady())throw new Error("API is not ready to use");if(!this._endpoints.user_search)throw new Error("User search is not available");return fetch(this._endpoints.user_search.replace(/\/search$/,`/${Qe}`),this._getFetchOptions()).then((Qe=>Qe.json())).then((Qe=>(null===Qe||void 0===Qe?void 0:Qe.name)||null))}sendReport(Qe){if(!this.isReady())throw new Error("API is not ready to use");if(!this._endpoints.report)throw new Error("Report sending is not available");const rt={...this._getFetchOptions(),method:"POST",body:JSON.stringify(Qe),headers:{"Content-Type":"application/json"}};return fetch(this._endpoints.report,rt).then((async Qe=>{if(Qe.status>=400){let Wn=await Qe.text();try{Wn=JSON.parse(Wn).message}catch(rt){}return Promise.reject(Wn)}return Qe.json()}))}static isValidHttpUrl(Qe){let rt;try{rt=new URL(Qe)}catch(Wn){return!1}return"http:"===rt.protocol||"https:"===rt.protocol}static isIdValid(Qe){if((0,Dl.isNullId)(Qe))throw new Error("id should be a valid picture unique identifier");return!0}}},2118:(Qe,rt,Wn)=>{"use strict";Wn.d(rt,{Ay:()=>InitParameters,Qm:()=>Co,Vy:()=>alterPSVState,ai:()=>alterPhotoViewerState,iz:()=>alterViewerState,mK:()=>alterMapState});const Co={minDate:"date_from",maxDate:"date_to",pic_type:"pic_type",camera:"camera",theme:"theme",qualityscore:"pic_score"},Dl=Object.fromEntries(Object.entries(Co).map((Qe=>[Qe[1],Qe[0]]))),Ll=["none","null","false",!1],Rl=["antialias","bearing","bearingSnap","bounds","boxZoom","clickTolerance","collectResourceTiming","cooperativeGestures","crossSourceCollisions","doubleClickZoom","dragPan","dragRotate","fadeDuration","failIfMajorPerformanceCaveat","fitBoundsOptions","hash","interactive","localIdeographFontFamily","locale","logoPosition","maplibreLogo","maxBounds","maxCanvasSize","maxPitch","maxTileCacheSize","maxTileCacheZoomLevels","maxZoom","minPitch","minZoom","pitch","pitchWithRotate","pixelRatio","preserveDrawingBuffer","refreshExpiredTiles","renderWorldCopies","scrollZoom","touchPitch","touchZoomRotate","trackResize","transformCameraUpdate","transformRequest","validateStyle"];class InitParameters{constructor(){var Qe,rt,Wn,Co,Dl,Ul;let Gl=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},Zl=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},Hl=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};"false"===Gl["url-parameters"]&&(Zl={});let ql={};"object"===typeof(null===Gl||void 0===Gl?void 0:Gl.psv)&&(ql=Gl.psv);let Ql={};"object"===typeof(null===Gl||void 0===Gl?void 0:Gl.map)&&(Ql=Gl.map);let Kl={};"object"===typeof(null===Hl||void 0===Hl?void 0:Hl.map)&&(Kl=Hl.map);let $l=Zl.map&&"none"!==Zl.map?getMapPositionFromString(Zl.map):null,Tc=!Ll.includes(Zl.map)&&!Ll.includes(Gl.map),tu=Zl.focus||Gl.focus,lu=Zl.pic||Gl.picture,du=Zl.users||Gl.users,fu=Zl.speed||(null===(Qe=ql)||void 0===Qe?void 0:Qe.transitionDuration),yu=Zl.nav||(null===(rt=ql)||void 0===rt?void 0:rt.picturesNavigation),Eu=Zl.theme||(null===(Wn=Kl)||void 0===Wn?void 0:Wn.theme)||Ql.theme,Tu=Zl.background||(null===(Co=Kl)||void 0===Co?void 0:Co.background)||Ql.background,Lu=(null===$l||void 0===$l?void 0:$l.center)||(null===(Dl=Kl)||void 0===Dl?void 0:Dl.center)||Ql.center,Zu=(null===$l||void 0===$l?void 0:$l.zoom)||(null===(Ul=Kl)||void 0===Ul?void 0:Ul.zoom)||Ql.zoom,Xu=(null===$l||void 0===$l?void 0:$l.pitch)||Ql.pitch,Ju=(null===$l||void 0===$l?void 0:$l.bearing)||Ql.bearing,$u=Gl.geocoder,ed=Gl.widgets,td=Gl.sequence,id=Gl.fetchOptions,nd=Gl.style,rd=Gl.lang,ad=Gl.endpoint,sd=Ql.raster,od=Ql.attributionControl,ld=(cd=Ql,Object.fromEntries(Object.entries(cd).filter((Qe=>{let[rt]=Qe;return Rl.includes(rt)}))));var cd;let ud=Gl["keyboard-shortcuts"],hd=Zl.xyz,dd=Zl.date_from,pd=Zl.date_to,md=Zl.pic_type,fd=Zl.camera,gd=Zl.pic_score;["map","pic"].includes(tu)?"map"!==tu||Tc||(console.warn("Parameter focus can't be 'map' as map is disabled"),tu="pic"):(console.warn("Invalid value for parameter focus:",tu),tu=Tc&&!lu?"map":"pic"),"aerial"!=Tu||sd||(console.warn("Parameter background can't be 'aerial' as no aerial imagery is available"),Tu="streets"),Tc&&!lu&&(tu="map"),this._parentInit={map:Tc,users:du,fetchOptions:id,style:nd,lang:rd,endpoint:ad},this._parentPostInit={focus:tu,picture:lu,sequence:td,geocoder:$u,widgets:ed,forceFocus:!0,keyboardShortcuts:!0},this._psvInit=Object.fromEntries(Object.entries(ql).filter((Qe=>{let[rt]=Qe;return!["transitionDuration","picturesNavigation"].includes(rt)}))),this._psvAny={transitionDuration:fu,picturesNavigation:yu},this._psvPostInit={xyz:hd},this._mapInit={raster:sd,attributionControl:od,...ld},this._mapAny={theme:Eu,background:Tu,center:Lu,zoom:Zu,pitch:Xu,bearing:Ju,users:du},this._mapPostInit={date_from:dd,date_to:pd,pic_type:md,camera:fd,pic_score:gd},"false"===ud&&(this._psvInit.keyboard=!1,this._psvInit.keyboardActions={},this._mapInit.keyboard=!1,this._parentPostInit.keyboardShortcuts=!1)}_sanitize(Qe){return Object.fromEntries(Object.entries(Qe).filter((Qe=>{let[,rt]=Qe;return void 0!==rt})))}getParentInit(){return this._sanitize(this._parentInit)}getParentPostInit(){return this._sanitize(this._parentPostInit)}getPSVInit(){return this._sanitize(Object.assign({},this._psvInit,this._psvAny))}getPSVPostInit(){return this._sanitize(Object.assign({},this._psvPostInit,this._psvAny))}getMapInit(){return this._sanitize(Object.assign({},this._mapInit,this._mapAny))}getMapPostInit(){return this._sanitize(Object.assign({},this._mapPostInit,this._mapAny))}static GetComponentProperties(Qe,rt){const Wn={};for(let Co in Qe.properties){Qe.properties[Co].state||null==rt[Co]||(Wn[Co]=rt[Co])}return Wn}}function getMapPositionFromString(Qe,rt){const Wn=(Qe||"").split("/");if(Wn.length>=3&&!Wn.some((Qe=>isNaN(Qe)))){const Qe={center:[+Wn[2],+Wn[1]],zoom:+Wn[0],pitch:+(Wn[4]||0)};return rt&&(Qe.bearing=rt.dragRotate.isEnabled()&&rt.touchZoomRotate.isEnabled()?+(Wn[3]||0):rt.getBearing()),Qe}return null}function alterPSVState(Qe,rt){rt.xyz&&Qe.addEventListener("picture-loaded",(()=>{const Wn=function(Qe){const rt=(Qe||"").split("/");return 3!==rt.length||rt.some((Qe=>isNaN(Qe)))?null:{x:+rt[0],y:+rt[1],z:+rt[2]}}(rt.xyz);Qe.setXYZ(Wn.x,Wn.y,Wn.z)}),{once:!0});let Wn=rt.transitionDuration||rt.speed;void 0!==Wn&&Qe.setTransitionDuration(Wn);let Co=rt.picturesNavigation||rt.nav;["none","pic","any","seq"].includes(Co)&&Qe.setPicturesNavigation(Co)}async function alterMapState(Qe,rt){var Wn;const Co=getMapPositionFromString(rt.map,Qe);Co&&Qe.jumpTo(Co);let Ll=Array.isArray(rt.users)?rt.users:(rt.users||"").split(",");(0===Ll.length||1===Ll.length&&""===Ll[0].trim())&&(Ll=["geovisio"]),await Qe.setVisibleUsers(Ll),null===(Wn=Qe.setFilters)||void 0===Wn||Wn.call(Qe,function(Qe){const rt={};for(let Wn in Dl)Qe[Wn]&&(rt[Dl[Wn]]=Qe[Wn]);if(rt.qualityscore){let Qe=rt.qualityscore.split("");const Wn={A:5,B:4,C:3,D:2,E:1};rt.qualityscore=Qe.map((Qe=>Wn[Qe]))}return rt}(rt)),["aerial","streets"].includes(rt.background)&&Qe.setBackground(rt.background)}function alterPhotoViewerState(Qe,rt){let Wn=rt.picture||rt.pic;if(Wn){const rt=Wn.split(";");rt.length>1&&console.warn("Multiple picture IDs passed in URL, only first one kept"),Qe.select(null,rt[0],!0)}else Qe.select()}function alterViewerState(Qe,rt){alterPhotoViewerState(Qe,rt),"map"===rt.focus&&null!==Qe&&void 0!==Qe&&Qe.map?(Qe.setPopup(!1),Qe._setFocus("map",null,rt.forceFocus)):"pic"===rt.focus&&null!==Qe&&void 0!==Qe&&Qe.mini?(Qe.setPopup(!1),Qe._setFocus("pic",null,rt.forceFocus)):rt.focus&&"meta"===rt.focus&&null!==Qe&&void 0!==Qe&&Qe.mini&&Qe._setFocus("pic",null,rt.forceFocus)}},3727:(Qe,rt,Wn)=>{"use strict";Wn.d(rt,{A:()=>PhotoAdapter});var Co=Wn(3890);class PhotoAdapter extends Co.D{constructor(Qe,rt){super(Qe,rt),this._shouldGoFast=rt.shouldGoFast||(()=>!0)}loadTexture(Qe,rt){return Qe.origBaseUrl?Qe.baseUrl=Qe.origBaseUrl:Qe.origBaseUrl=Qe.baseUrl,this._shouldGoFast()&&Qe.thumbUrl&&!Qe.hdLoaded&&1==Qe.rows&&(Qe.baseUrl=Qe.thumbUrl),super.loadTexture(Qe,rt).then((rt=>(Qe.baseUrl===Qe.origBaseUrl&&(Qe.hdLoaded=!0),rt)))}__loadTiles(Qe){this._shouldGoFast()||super.__loadTiles(Qe)}}},4207:(Qe,rt,Wn)=>{"use strict";Wn.d(rt,{A:()=>PresetManager});var Co=Wn(7208);const Dl={fas:"fa6-solid"},Ll={"fa6-solid:directions":"fa6-solid:diamond-turn-right"};class PresetManager{constructor(){let Qe=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,rt=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this._ready=!1,this._presets=null,this._translations={},rt||this._load(Qe)}async _load(Qe){var rt;Qe=Qe||(null===(rt=window.navigator.languages[0])||void 0===rt?void 0:rt.substring(0,2));try{var Wn,Rl;const[rt,Zl,Hl]=await Promise.all([fetch(`${(0,Co.PanoramaxPresetsURL)()}/translations/en.min.json`),Qe?fetch(`${(0,Co.PanoramaxPresetsURL)()}/translations/${Qe}.min.json`):Promise.resolve({ok:!0}),fetch(`${(0,Co.PanoramaxPresetsURL)()}/presets.min.json`)]);if(!rt||!Zl||!Hl||!rt.ok||!Zl.ok||!Hl.ok)throw this._ready=-1,new Error("Presets service is not available");var Ul,Gl;if(this._presets=await Hl.json(),this._translations.en=null===(Wn=await rt.json())||void 0===Wn||null===(Rl=Wn.en)||void 0===Rl?void 0:Rl.presets,Qe)this._translations[Qe]=null===(Ul=await Zl.json())||void 0===Ul||null===(Gl=Ul[Qe])||void 0===Gl?void 0:Gl.presets;Object.entries(this._presets).forEach((rt=>{var Wn,Co,Rl,Ul,Gl,Zl;let[Hl,ql]=rt;if(null!==(Wn=this._translations[Qe])&&void 0!==Wn&&null!==(Co=Wn.presets)&&void 0!==Co&&null!==(Rl=Co[Hl])&&void 0!==Rl&&Rl.name?ql.name=this._translations[Qe].presets[Hl].name:null!==(Ul=this._translations.en)&&void 0!==Ul&&null!==(Gl=Ul.presets)&&void 0!==Gl&&null!==(Zl=Gl[Hl])&&void 0!==Zl&&Zl.name&&(ql.name=this._translations.en.presets[Hl].name),ql.icon){const Qe=ql.icon.split("-")[0],rt=Dl[Qe];ql.iconify=rt?ql.icon.replace(Qe+"-",rt+":"):ql.icon.split("-")[0]+":"+ql.icon.split("-").slice(1).join("-"),Ll[ql.iconify]&&(ql.iconify=Ll[ql.iconify])}})),this._ready=!0}catch(Zl){console.error("Presets service throws an error:",Zl),this._ready=-1}}async onceReady(){return this._ready?-1===this._ready?Promise.reject():Promise.resolve():(await new Promise((Qe=>setTimeout(Qe,250))),this.onceReady())}async getPreset(Qe){return this.onceReady().then((()=>{const rt=Object.values(this._presets).filter((rt=>{if(0===Object.keys(rt.tags).length)return!1;for(let Wn in rt.tags){const Co=rt.tags[Wn];if(!Qe.semantics.find((Qe=>Qe.key===Wn&&("*"===Co||Co===Qe.value))))return!1}return!0}));return rt.sort(((Qe,rt)=>{const Wn=Object.keys(Qe.tags).length,Co=Object.keys(rt.tags).length;if(Wn>Co)return-1;if(Wn===Co){const Wn=Object.values(Qe.tags).filter((Qe=>"*"===Qe)).length,Co=Object.values(rt.tags).filter((Qe=>"*"===Qe)).length;return Wn<Co?-1:Wn>Co?1:0}return 1})),rt.shift()}))}}},4451:(Qe,rt,Wn)=>{"use strict";Wn.d(rt,{A:()=>URLHandler});var Co=Wn(2118);const Dl=["speed","nav","focus","pic","xyz","map","background","users","pic_score","s"].concat(Object.values(Co.Qm)),Ll=["focus-changed","pictures-navigation-changed"],Rl=["position-updated","zoom-updated","view-rotated","picture-loaded","transition-duration-changed"],Ul=["moveend","zoomend","boxzoomend","background-changed","users-changed","filters-changed"];class URLHandler extends EventTarget{constructor(Qe){super(),this._parent=Qe,this._delay=null}listenToChanges(){window.addEventListener("popstate",this._onURLChange.bind(this),!1),Ll.forEach((Qe=>this._parent.addEventListener(Qe,this._onParentChange.bind(this)))),Rl.forEach((Qe=>this._parent.psv.addEventListener(Qe,this._onParentChange.bind(this)))),this._parent.map&&Ul.forEach((Qe=>this._parent.map.on(Qe,this._onParentChange.bind(this))))}nextURLParams(){let Qe={};"number"==typeof this._parent.psv.getTransitionDuration()&&(Qe.speed=this._parent.psv.getTransitionDuration()),[null,"any"].includes(this._parent.psv.getPicturesNavigation())||(Qe.nav=this._parent.psv.getPicturesNavigation()),this._parent.psv.getPictureId()&&(Qe.pic=this._parent.psv.getPictureId());if(this._parent.psv.getPictureMetadata()&&(Qe.xyz=this.currentPSVString()),this._parent.map){Qe.map=this.currentMapString(),Qe.focus="pic",this._parent.isMapWide()&&(Qe.focus="map"),this._parent.map.hasTwoBackgrounds()&&this._parent.map.getBackground()&&(Qe.background=this._parent.map.getBackground());const rt=this._parent.map.getVisibleUsers();if((rt.length>1||!rt.includes("geovisio"))&&(Qe.users=rt.join(",")),this._parent.map._mapFilters){for(let rt in Co.Qm)this._parent.map._mapFilters[rt]&&(Qe[Co.Qm[rt]]=this._parent.map._mapFilters[rt]);if(Qe.pic_score){const rt=[null,"E","D","C","B","A"];Qe.pic_score=Qe.pic_score.map((Qe=>rt[Qe])).join("")}}}return Qe}nextURLString(){let Qe="";return Object.entries(this.nextURLParams()).sort(((Qe,rt)=>Qe[0].localeCompare(rt[0]))).forEach((rt=>{let[Wn,Co]=rt,Dl=!1;const Ll=Qe.split("&").map((Qe=>{const rt=Qe.split("=")[0];return rt===Wn?(Dl=!0,`${rt}=${Co}`):Qe})).filter((Qe=>Qe));Dl||Ll.push(`${Wn}=${Co}`),Qe=`${Ll.join("&")}`})),`?${Qe}`.replace(/^\?+/,"?")}currentURLParams(){const Qe=(arguments.length>0&&void 0!==arguments[0]&&arguments[0]?window.location.hash:window.location.search).replace(/^[?#]/,"");let rt={};if(Qe.split("&").map((Qe=>Qe.split("="))).filter((Qe=>void 0!==Qe[0]&&Qe[0].length>0&&Dl.includes(Qe[0]))).forEach((Qe=>{rt[Qe[0]]=Qe[1]})),rt.s){const Qe=Object.fromEntries(decodeURIComponent(rt.s).split(";").map((Qe=>[Qe[0],Qe.substring(1)])));rt={},"m"===Qe.f?rt.focus="map":"p"===Qe.f?rt.focus="pic":"t"===Qe.f&&(rt.focus="meta"),""!==Qe.s&&(rt.speed=100*parseFloat(Qe.s)),"a"===Qe.n?rt.nav="any":"s"===Qe.n&&(rt.nav="seq"),"n"===Qe.n&&(rt.nav="none"),""!==Qe.p&&(rt.pic=Qe.p),""!==Qe.c&&(rt.xyz=Qe.c),""!==Qe.m&&(rt.map=Qe.m),""!==Qe.d&&(rt.date_from=Qe.d),""!==Qe.e&&(rt.date_to=Qe.e),"f"===Qe.t?rt.pic_type="flat":"e"===Qe.t&&(rt.pic_type="equirectangular"),""!==Qe.k&&(rt.camera=Qe.k),"d"===Qe.v?rt.theme="default":"a"===Qe.v?rt.theme="age":"t"===Qe.v?rt.theme="type":"s"===Qe.v&&(rt.theme="score"),"s"===Qe.b?rt.background="streets":"a"===Qe.b&&(rt.background="aerial"),""!==Qe.u&&(rt.users=Qe.u),""!==Qe.q&&(rt.pic_score=Qe.q)}return rt}currentMapString(){const Qe=this._parent.map.getCenter(),rt=Math.round(100*this._parent.map.getZoom())/100,Wn=Math.ceil((rt*Math.LN2+Math.log(512/360/.5))/Math.LN10),Co=Math.pow(10,Wn),Dl=Math.round(Qe.lng*Co)/Co,Ll=Math.round(Qe.lat*Co)/Co,Rl=this._parent.map.getBearing(),Ul=this._parent.map.getPitch();let Gl=`${rt}/${Ll}/${Dl}`;return(Rl||Ul)&&(Gl+="/"+Math.round(10*Rl)/10),Ul&&(Gl+=`/${Math.round(Ul)}`),Gl}currentPSVString(){const Qe=this._parent.psv.getXYZ();return`${Qe.x.toFixed(2)}/${Qe.y.toFixed(2)}/${Math.round(Qe.z||0)}`}_onURLChange(){let Qe=this.currentURLParams();"Viewer"===this._parent.getClassName()?(0,Co.iz)(this._parent,Qe):(0,Co.ai)(this._parent,Qe),(0,Co.Vy)(this._parent.psv,Qe),this._parent.map&&(0,Co.mK)(this._parent.map,Qe)}nextShortLink(Qe){const rt=new URL(Qe),Wn=this.nextURLParams(),Co={f:(Wn.focus||"").substring(0,1),s:isNaN(parseInt(Wn.speed))?void 0:Math.floor(parseInt(Wn.speed)/100),n:(Wn.nav||"").substring(0,1),p:Wn.pic,c:Wn.xyz,m:Wn.map,d:Wn.date_from,e:Wn.date_to,t:(Wn.pic_type||"").substring(0,1),k:Wn.camera,v:(Wn.theme||"").substring(0,1),b:(Wn.background||"").substring(0,1),u:Wn.users,q:Wn.pic_score},Dl=Object.entries(Co).filter((Qe=>{let[,rt]=Qe;return void 0!=rt&&""!=rt})).map((Qe=>{let[rt,Wn]=Qe;return`${rt}${Wn}`})).join(";");return rt.search=`s=${Dl}`,rt}getUnmanagedParameters(Qe){return new URLSearchParams(Array.from(Qe.searchParams).filter((Qe=>{let[rt]=Qe;return!Dl.includes(rt)}))).toString()}_onParentChange(){this._delay&&(clearTimeout(this._delay),this._delay=null),this._delay=setTimeout((()=>{var Qe,rt,Wn;const Co=new URL(window.location.href),Dl=new URL(window.location.href),Ll=this.getUnmanagedParameters(Co);if(Dl.search=this._parent?this.nextURLString()+(Ll.length>0?"&"+Ll:""):"",Object.keys(this.currentURLParams(!0)).length>0&&(Dl.hash=""),Co.search==Dl.search)return;const Rl=this.currentURLParams().pic||"",Ul=(null===(Qe=this._parent)||void 0===Qe||null===(rt=Qe.psv)||void 0===rt||null===(Wn=rt.getPictureId)||void 0===Wn?void 0:Wn.call(rt))||"";try{if(Rl!=Ul?window.history.pushState(window.history.state,null,Dl.href):window.history.replaceState(window.history.state,null,Dl.href),this._parent){const Qe=new CustomEvent("url-changed",{detail:{url:Dl.href}});this.dispatchEvent(Qe)}}catch(Gl){}}),500)}}},3606:(Qe,rt,Wn)=>{"use strict";Wn.r(rt),Wn.d(rt,{forwardGeocodingBAN:()=>forwardGeocodingBAN,forwardGeocodingNominatim:()=>forwardGeocodingNominatim,forwardGeocodingStandard:()=>forwardGeocodingStandard,reverseGeocodingNominatim:()=>reverseGeocodingNominatim});var Co=Wn(927),Dl=Wn.n(Co),Ll=Wn(7208);const Rl={house:20,housenumber:20,street:18,locality:15,district:13,municipality:12,city:12,county:8,region:7,state:7,country:5};function geocoderParamsToURLString(Qe){let rt={};return Object.entries(Qe).filter((Qe=>void 0!==Qe[1]&&null!==Qe[1])).forEach((Qe=>rt[Qe[0]]=Qe[1])),new URLSearchParams(rt).toString()}function forwardGeocodingNominatim(Qe){const rt={q:Qe.query,countrycodes:Qe.countries,limit:Qe.limit,viewbox:Qe.bbox};return fetch(`${(0,Ll.NominatimBaseUrl)()}/search?${geocoderParamsToURLString(rt)}&format=geocodejson&addressdetails=1`).then((Qe=>Qe.json())).then((Qe=>{const rt={features:[]},Wn=[];return(Qe.features||[]).forEach((Qe=>{var Co,Ll,Ul;const Gl=geocodeJsonToPlaceName(null===(Co=Qe.properties)||void 0===Co?void 0:Co.geocoding)||(null===(Ll=Qe.properties)||void 0===Ll||null===(Ul=Ll.geocoding)||void 0===Ul?void 0:Ul.label);var Zl,Hl;Wn.includes(Gl)||(rt.features.push({place_type:["place"],place_name:Gl,center:new(Dl().LngLat)(...Qe.geometry.coordinates),zoom:Rl[null===(Zl=Qe.properties)||void 0===Zl||null===(Hl=Zl.geocoding)||void 0===Hl?void 0:Hl.type]}),Wn.push(Gl))})),rt}))}function reverseGeocodingNominatim(Qe,rt){return fetch(`${(0,Ll.NominatimBaseUrl)()}/reverse?lat=${Qe}&lon=${rt}&zoom=18&format=geocodejson`).then((Qe=>Qe.json())).then((Qe=>{var rt,Wn,Co;return geocodeJsonToPlaceName(null===Qe||void 0===Qe||null===(rt=Qe.features)||void 0===rt||null===(Wn=rt.shift())||void 0===Wn||null===(Co=Wn.properties)||void 0===Co?void 0:Co.geocoding)}))}function forwardGeocodingBAN(Qe){return forwardGeocodingStandard(Qe,(0,Ll.AdresseDataGouvBaseURL)())}function geocodeJsonToPlaceName(Qe){if(!Qe||"object"!=typeof Qe)return"";let rt=Qe.name,Wn=[],Co=[];switch(Qe.type){case"hamlet":case"croft":case"isolated_dwelling":case"neighbourhood":case"allotments":case"quarter":case"farm":case"farmyard":case"industrial":case"commercial":case"retail":case"city_block":case"residential":case"locality":case"district":Co.push(Qe.city),Co.push(Qe.county),Co.push(Qe.state),Co.push(Qe.country);break;case"city":case"region":Co.push(Qe.county),Co.push(Qe.state),Co.push(Qe.country);break;case"country":break;case"house":case"housenumber":Wn.push(Qe.housenumber),Wn.push(Qe.street),Wn.push(Qe.locality),Wn.push(Qe.district),Co.push(Qe.city),Co.push(Qe.county),Co.push(Qe.state),Co.push(Qe.country);break;default:Wn.push(Qe.street),Wn.push(Qe.locality),Wn.push(Qe.district),Co.push(Qe.city),Co.push(Qe.county),Co.push(Qe.state),Co.push(Qe.country)}return Wn=Wn.filter((Qe=>Qe)),Wn=Wn.filter(((Qe,Co)=>Qe!=rt&&(0===Co||Wn[Co-1]!==Qe))),Wn=Wn.length>0?Qe.housenumber?Wn.slice(0,2).join(" "):Wn.shift():null,Wn===rt&&(Wn=null),Co=Co.filter((Qe=>Qe)),Co=Co.filter(((Qe,Dl)=>Qe!=rt&&(!Wn||!Wn.includes(Qe))&&(0===Dl||Co[Dl-1]!==Qe))),[rt,Wn,Co.shift()].filter((Qe=>Qe)).join(", ")}function forwardGeocodingStandard(Qe,rt){const Wn={q:Qe.query,limit:Qe.limit};if("string"===typeof Qe.proximity){const[rt,Co]=Qe.proximity.split(",").map((Qe=>parseFloat(Qe.trim())));Wn.lat=rt,Wn.lon=Co}return fetch(`${rt}/?${geocoderParamsToURLString(Wn)}`).then((Qe=>Qe.json())).then((Qe=>{const rt={features:[]},Wn=[];return(Qe.features||[]).forEach((Qe=>{const Co=geocodeJsonToPlaceName(Qe.properties);Wn.includes(Co)||"other"==Qe.properties.type||(rt.features.push({place_type:["place"],place_name:Co,center:new(Dl().LngLat)(...Qe.geometry.coordinates),zoom:Rl[Qe.properties.type]}),Wn.push(Co))})),rt}))}},4964:(Qe,rt,Wn)=>{"use strict";Wn.r(rt),Wn.d(rt,{autoDetectLocale:()=>autoDetectLocale,getTranslations:()=>getTranslations});var Co=Wn(4149),Dl=Wn(369),Ll=Wn(389),Rl=Wn(9946),Ul=Wn(8302),Gl=Wn(5222),Zl=Wn(6909),Hl=Wn(4895),ql=Wn(3979),Ql=Wn(6920),Kl=Wn(9026),$l=Wn(991),Tc=Wn(6984);const tu="en",lu={da:Co,de:Dl,eo:Rl,en:Ll,es:Ul,fr:Gl,hu:Zl,it:Hl,ja:ql,nl:Ql,pl:Kl,sv:$l,"zh-Hant":Tc,zh:Tc};function autoDetectLocale(Qe,rt){for(const Wn of window.navigator.languages){let rt=Wn;switch(rt){case"zh-TW":case"zh-HK":case"zh-MO":rt="zh-Hant";break;case"zh-CN":case"zh-SG":rt="zh-Hans";break;default:rt.length>2&&(rt=Wn.substring(0,2))}const Co=Qe.find((Qe=>Qe===rt));if(Co)return Co}return rt}function getTranslations(){let Qe=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";const rt=JSON.parse(JSON.stringify(Ll));let Wn;if(Qe||(Qe=autoDetectLocale(Object.keys(lu),tu)),lu[Qe]&&"en"!==Qe&&(Wn=lu[Qe]),Qe.length>2){const rt=Qe.substring(0,2);lu[rt]&&(Wn=lu[rt])}return Wn&&Object.entries(Wn).forEach((Qe=>{let[Wn,Co]=Qe;Object.entries(Co).forEach((Qe=>{let[Co,Dl]=Qe;Array.isArray(Dl)&&(Dl=Dl.filter((Qe=>null!=Qe))),rt[Wn][Co]=Dl}))})),rt}},2030:(Qe,rt,Wn)=>{"use strict";Wn.r(rt),Wn.d(rt,{API:()=>ql.A,PhotoAdapter:()=>Ql.A,PresetsManager:()=>Kl.A,URLHandler:()=>$l.A,geocoder:()=>Co,i18n:()=>Dl,map:()=>Ll,picture:()=>Rl,semantics:()=>Ul,services:()=>Gl,utils:()=>Zl,widgets:()=>Hl});var Co=Wn(3606),Dl=Wn(4964),Ll=Wn(8340),Rl=Wn(508),Ul=Wn(2283),Gl=Wn(7208),Zl=Wn(7343),Hl=Wn(5995),ql=Wn(5254),Ql=Wn(3727),Kl=Wn(4207),$l=Wn(4451)},8340:(Qe,rt,Wn)=>{"use strict";Wn.r(rt),Wn.d(rt,{DEFAULT_TILES:()=>Rl,MAP_EXPR_QUALITYSCORE:()=>Kl,RASTER_LAYER_ID:()=>Ul,TILES_PICTURES_SYMBOL_ZOOM:()=>Zl,TILES_PICTURES_ZOOM:()=>Gl,VECTOR_STYLES:()=>Hl,combineStyles:()=>combineStyles,getMapParamsFromLocalStorage:()=>getMapParamsFromLocalStorage,getMissingLayerStyles:()=>getMissingLayerStyles,getThumbGif:()=>getThumbGif,getUserLayerId:()=>getUserLayerId,getUserSourceId:()=>getUserSourceId,initMapKeyboardHandler:()=>initMapKeyboardHandler,isLabelLayer:()=>isLabelLayer,linkMapAndPhoto:()=>linkMapAndPhoto,saveMapParamsToLocalStorage:()=>saveMapParamsToLocalStorage,switchCoefValue:()=>switchCoefValue});var Co=Wn(6883),Dl=Wn(7343),Ll=Wn(4964);const Rl="https://panoramax.openstreetmap.fr/pmtiles/basic.json",Ul="pnx-aerial",Gl=15,Zl=18,Hl={PICTURES:{paint:{"circle-radius":["interpolate",["linear"],["zoom"],Gl,4.5,Zl,6,24,12],"circle-opacity":["interpolate",["linear"],["zoom"],Gl,0,Gl+1,1],"circle-stroke-color":"#ffffff","circle-stroke-width":["interpolate",["linear"],["zoom"],Gl+1,0,Gl+2,1,Zl,1.5,24,3]},layout:{}},PICTURES_SYMBOLS:{paint:{"icon-opacity":["interpolate",["linear"],["zoom"],Zl,0,Zl+1,1]},layout:{"icon-image":["case",["==",["get","type"],"equirectangular"],"pnx-arrow-360","pnx-arrow-flat"],"icon-size":["interpolate",["linear"],["zoom"],Zl,.5,24,1],"icon-rotate":["to-number",["get","heading"]],"icon-allow-overlap":!0}},SEQUENCES:{paint:{"line-width":["interpolate",["linear"],["zoom"],0,.5,10,2,14,4,16,5,22,3]},layout:{"line-cap":"square"}},SEQUENCES_PLUS:{paint:{"line-width":["interpolate",["linear"],["zoom"],0,15,Gl+1,30,Gl+2,0],"line-opacity":0,"line-color":"#ff0000"},layout:{"line-cap":"square"}}},ql=["case",["==",["get","type"],"equirectangular"],["case",["has","h_pixel_density"],["step",["get","h_pixel_density"],...Dl.QUALITYSCORE_RES_360_VALUES],1],["case",["has","h_pixel_density"],["step",["get","h_pixel_density"],...Dl.QUALITYSCORE_RES_FLAT_VALUES],1]],Ql=["case",["has","gps_accuracy"],["step",["get","gps_accuracy"],...Dl.QUALITYSCORE_GPS_VALUES],1],Kl=["round",["+",["*",ql,Dl.QUALITYSCORE_POND_RES],["*",Ql,Dl.QUALITYSCORE_POND_GPS]]];function getThumbGif(Qe){const rt=document.createElement("img");return rt.src=Co,rt.alt=Qe.loading,rt.title=Qe.loading,rt.classList.add("pnx-map-thumb","pnx-map-thumb-loader"),rt}function isLabelLayer(Qe){var rt;return"symbol"===Qe.type&&void 0!==(null===Qe||void 0===Qe||null===(rt=Qe.layout)||void 0===rt?void 0:rt["text-field"])&&(void 0===Qe.minzoom||Qe.minzoom<15)}function combineStyles(Qe,rt){var Wn,Co;const Dl=Qe.api.getMapStyle();if(Dl.layers=Dl.layers||[],Dl.layers=Dl.layers.concat(getMissingLayerStyles(Dl.sources,Dl.layers)),Dl.metadata||(Dl.metadata={}),rt.supplementaryStyle&&(Object.assign(Dl.sources,rt.supplementaryStyle.sources||{}),Object.assign(Dl.metadata,rt.supplementaryStyle.metadata||{}),Dl.layers=Dl.layers.concat(rt.supplementaryStyle.layers||[])),Dl.layers=Dl.layers.filter((Qe=>Qe.id)),rt.raster&&(Dl.sources["pnx-aerial"]=rt.raster,Dl.layers.push({id:Ul,type:"raster",source:"pnx-aerial",layout:{visibility:"aerial"===rt.background?"visible":"none"}})),null!==Qe&&void 0!==Qe&&null!==(Wn=Qe.users)&&void 0!==Wn&&Wn.includes("geovisio")||Dl.layers.forEach((Qe=>{"geovisio"===Qe.source&&(Qe.layout||(Qe.layout={}),Qe.layout.visibility="none")})),Dl.layers.sort(((Qe,rt)=>isLabelLayer(Qe)&&!isLabelLayer(rt)?1:!isLabelLayer(Qe)&&isLabelLayer(rt)?-1:Qe.id.startsWith("geovisio")&&!rt.id.startsWith("geovisio")?1:!Qe.id.startsWith("geovisio")&&rt.id.startsWith("geovisio")?-1:Qe.id.endsWith("_pictures")&&!rt.id.endsWith("_pictures")?1:!Qe.id.endsWith("_pictures")&&rt.id.endsWith("_pictures")?-1:0)),null!==(Co=Dl.metadata)&&void 0!==Co&&Co["panoramax:locales"]||(Dl.metadata["panoramax:locales"]=["fr","en","de","es","ru","pt","zh","hi","latin"]),Dl.metadata["panoramax:locales"]){let rt=Qe.lang||(0,Ll.autoDetectLocale)(Dl.metadata["panoramax:locales"],"latin");rt.includes("-")&&(rt=rt.split("-")[0]),rt.includes("_")&&(rt=rt.split("_")[0]),Dl.layers.forEach((Qe=>{isLabelLayer(Qe)&&Qe.layout["text-field"].includes("name:latin")&&(Qe.layout["text-field"]=["coalesce",["get",`name:${rt}`],["get","name:latin"],["get","name"]])}))}const Rl=Dl.layers.find((Qe=>"place_label_city"==Qe.id));let Gl=Dl.layers.find((Qe=>"place_label_capital"==Qe.id));return Rl&&!Gl&&(Rl.paint={"text-color":"hsl(0, 0%, 0%)","text-halo-blur":0,"text-halo-color":"hsla(0, 0%, 100%, 1)","text-halo-width":3},Rl.layout["text-letter-spacing"]=.1,Gl=JSON.parse(JSON.stringify(Rl)),Gl.id="place_label_capital",Gl.filter.push(["<=","capital",2]),Rl.filter.push([">","capital",2]),Dl.layers.push(Gl)),Dl}function getMissingLayerStyles(){let Qe=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},rt=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const Wn=[];return Object.keys(Qe).filter((Qe=>void 0===rt.find((rt=>(null===rt||void 0===rt?void 0:rt.source)===Qe)))).forEach((Qe=>{Qe.startsWith("geovisio")&&(Wn.push({id:`${Qe}_sequences`,type:"line",source:Qe,"source-layer":"sequences",layout:{...Hl.SEQUENCES.layout},paint:{...Hl.SEQUENCES.paint,"line-color":Dl.COLORS.BASE}}),Wn.push({id:`${Qe}_sequences_plus`,type:"line",source:Qe,"source-layer":"sequences",layout:{...Hl.SEQUENCES_PLUS.layout},paint:{...Hl.SEQUENCES_PLUS.paint}}),Wn.push({id:`${Qe}_pictures_symbols`,type:"symbol",source:Qe,"source-layer":"pictures",...Hl.PICTURES_SYMBOLS}),Wn.push({id:`${Qe}_pictures_symbols`,type:"symbol",source:Qe,"source-layer":"pictures",...Hl.PICTURES_SYMBOLS}),Wn.push({id:`${Qe}_pictures`,type:"circle",source:Qe,"source-layer":"pictures",layout:{...Hl.PICTURES.layout},paint:{...Hl.PICTURES.paint,"circle-color":Dl.COLORS.BASE}}))})),rt.filter((Qe=>{var Wn;return(null===Qe||void 0===Qe||null===(Wn=Qe.id)||void 0===Wn?void 0:Wn.endsWith("_sequences"))&&void 0===rt.find((rt=>(null===rt||void 0===rt?void 0:rt.id)===Qe.id+"_plus"))})).forEach((Qe=>{Wn.push({id:`${Qe.id}_plus`,type:"line",source:Qe.source,"source-layer":Qe["source-layer"],layout:{...Hl.SEQUENCES_PLUS.layout},paint:{...Hl.SEQUENCES_PLUS.paint}})})),rt.filter((Qe=>{var Wn;return(null===Qe||void 0===Qe||null===(Wn=Qe.id)||void 0===Wn?void 0:Wn.endsWith("_pictures"))&&void 0===rt.find((rt=>(null===rt||void 0===rt?void 0:rt.id)===Qe.id+"_symbols"))})).forEach((Qe=>{Wn.unshift({id:`${Qe.id}_symbols`,type:"symbol",source:Qe.source,"source-layer":"pictures",...Hl.PICTURES_SYMBOLS}),Qe.paint=Object.assign(Qe.paint||{},Hl.PICTURES.paint),Qe.layout=Object.assign(Qe.layout||{},Hl.PICTURES.layout)})),Wn}function getUserLayerId(Qe,rt){return`${getUserSourceId(Qe)}_${rt}`}function getUserSourceId(Qe){return"geovisio"===Qe?"geovisio":"geovisio_"+Qe}function switchCoefValue(Qe,rt){if(Array.isArray(Qe))return Qe.map((Qe=>switchCoefValue(Qe,rt)));if("object"===typeof Qe&&null!==Qe){const Wn={};for(const Co in Qe)Wn[Co]=switchCoefValue(Qe[Co],rt);return Wn}return"string"===typeof Qe&&Qe.startsWith("coef")?rt:Qe}function linkMapAndPhoto(Qe){const onPicLoad=rt=>{var Wn,Co,Ll,Rl;(0,Dl.isNullId)(rt.detail.picId)?(Qe.map.displayPictureMarker(),null!==Qe&&void 0!==Qe&&null!==(Wn=Qe.isMapWide)&&void 0!==Wn&&Wn.call(Qe)&&(null===Qe||void 0===Qe||null===(Co=Qe.mini)||void 0===Co||Co.setAttribute("collapsed",""))):(Qe.map.displayPictureMarker(rt.detail.lon,rt.detail.lat,Qe.psv.getXY().x,rt.detail.first),null!==Qe&&void 0!==Qe&&null!==(Ll=Qe.isMapWide)&&void 0!==Ll&&Ll.call(Qe)&&(null===Qe||void 0===Qe||null===(Rl=Qe.mini)||void 0===Rl||Rl.removeAttribute("collapsed")))};Qe.psv.addEventListener("picture-loading",onPicLoad),Qe.psv.addEventListener("picture-loaded",onPicLoad),Qe.psv.addEventListener("view-rotated",(()=>{let rt=Qe.psv.getPosition().yaw*(180/Math.PI);rt+=Qe.psv.getPictureOriginalHeading(),Qe.map._picMarker.setRotation(rt)})),Qe.psv.addEventListener("picture-preview-started",(rt=>{Qe.map._picMarkerPreview.setLngLat(rt.detail.coordinates).setRotation(rt.detail.direction||0).addTo(Qe.map)})),Qe.psv.addEventListener("picture-preview-stopped",(()=>{Qe.map._picMarkerPreview.remove()})),Qe.psv.addEventListener("picture-loaded",(rt=>{Qe.isWidthSmall()&&Qe._picPopup&&rt.detail.picId==Qe._picPopup._picId&&Qe._picPopup.remove()})),Qe.map.on("picture-click",(rt=>{Qe.select(rt.seqId,rt.picId),!Qe.psv._myVTour.state.currentNode&&null!==Qe&&void 0!==Qe&&Qe._setFocus&&Qe._setFocus("pic")})),Qe.map.on("sequence-click",(rt=>{Qe.api.getPicturesAroundCoordinates(rt.coordinates.lat,rt.coordinates.lng,1,1,rt.seqId).then((rt=>{var Wn,Co;(null===rt||void 0===rt||null===(Wn=rt.features)||void 0===Wn?void 0:Wn.length)>0&&(Qe.select(null===(Co=rt.features[0])||void 0===Co?void 0:Co.collection,rt.features[0].id),!Qe.psv.getPictureMetadata()&&null!==Qe&&void 0!==Qe&&Qe._setFocus&&Qe._setFocus("pic"))}))})),Qe._setFocus&&(Qe.psv.addEventListener("dblclick",(()=>{Qe.isMapWide()&&Qe._setFocus("pic")})),Qe.map.on("dblclick",(()=>{Qe.isMapWide()?Qe.select():Qe._setFocus("map")})))}function initMapKeyboardHandler(Qe){Qe.map.keyboard.keydown=function(rt){if(rt.altKey||rt.ctrlKey||rt.metaKey)return;switch(rt.key){case"*":case"5":return void Qe.moveCenter();case"PageUp":case"9":return void Qe.psv.goToNextPicture();case"PageDown":case"3":return void Qe.psv.goToPrevPicture();case"Home":case"7":return rt.stopPropagation(),void Qe._toggleFocus();case"End":case"1":return void Qe.mini.toggleAttribute("collapsed");case" ":case"0":return void Qe.psv.toggleSequencePlaying()}let Wn=0,Co=0,Dl=0,Ll=0,Rl=0;switch(rt.keyCode){case 61:case 107:case 171:case 187:Wn=1;break;case 189:case 109:case 173:Wn=-1;break;case 37:case 100:rt.shiftKey?Co=-1:(rt.preventDefault(),Ll=-1);break;case 39:case 102:rt.shiftKey?Co=1:(rt.preventDefault(),Ll=1);break;case 38:case 104:rt.shiftKey?Dl=1:(rt.preventDefault(),Rl=-1);break;case 40:case 98:rt.shiftKey?Dl=-1:(rt.preventDefault(),Rl=1);break;default:return}return this._rotationDisabled&&(Co=0,Dl=0),{cameraAnimation:Qe=>{const Ul=this._tr;Qe.easeTo({duration:300,easeId:"keyboardHandler",easing:Qe=>Qe*(2-Qe),zoom:Wn?Math.round(Ul.zoom)+Wn*(rt.shiftKey?2:1):Ul.zoom,bearing:Ul.bearing+Co*this._bearingStep,pitch:Ul.pitch+Dl*this._pitchStep,offset:[-Ll*this._panStep,-Rl*this._panStep],center:Ul.center},{originalEvent:rt})}}}.bind(Qe.map.keyboard)}const $l="pnx-map-parameters";function getMapParamsFromLocalStorage(){const Qe=localStorage.getItem($l);if(!Qe)return{};try{return JSON.parse(Qe)}catch(rt){return console.warn("Can't read map parameters stored in localStorage",rt),{}}}function saveMapParamsToLocalStorage(Qe){const save=()=>localStorage.setItem($l,JSON.stringify({center:Object.fromEntries(Object.entries(Qe.getCenter()).map((Qe=>{let[rt,Wn]=Qe;return[rt,Wn.toFixed(7)]}))),zoom:Qe.getZoom().toFixed(1),background:Qe.getBackground(),theme:Qe._mapFilters.theme}));Qe.on("background-changed",save),Qe.on("filters-changed",save),Qe.on("moveend",save),Qe.on("zoomend",save),Qe.on("dragend",save),Qe.on("boxzoomend",save)}},508:(Qe,rt,Wn)=>{"use strict";Wn.r(rt),Wn.d(rt,{apiFeatureToPSVNode:()=>apiFeatureToPSVNode,filterRelatedPicsLinks:()=>filterRelatedPicsLinks,getCroppedPanoData:()=>getCroppedPanoData,getExifFloat:()=>getExifFloat,getGPSPrecision:()=>getGPSPrecision,getHashTags:()=>getHashTags,getNodeCaption:()=>getNodeCaption,getSphereCorrection:()=>getSphereCorrection,hasAnnotations:()=>hasAnnotations,sortPicturesInDirection:()=>sortPicturesInDirection});var Co=Wn(8407),Dl=Wn(6830),Ll=Wn(7343);const Rl=(0,Ll.svgToPSVLink)(Co,"white"),Ul=(0,Ll.svgToPSVLink)(Dl,Ll.COLORS.NEXT);function getExifFloat(Qe){if(!([null,void 0,""].includes(Qe)||"string"===typeof Qe&&""===Qe.trim())){if("number"===typeof Qe)return Qe;if("string"!==typeof Qe);else{if(/^-?\d+(\.\d+)?\/-?\d+(\.\d+)?$/.test(Qe)){const rt=Qe.split("/").map((Qe=>parseFloat(Qe)));return rt[0]/rt[1]}try{return parseFloat(Qe)}catch(rt){}}}}function getGPSPrecision(Qe){var rt,Wn,Co,Dl,Ll;let Rl=null;const Ul=(null===Qe||void 0===Qe||null===(rt=Qe.properties)||void 0===rt?void 0:rt["quality:horizontal_accuracy"])||getExifFloat(null===Qe||void 0===Qe||null===(Wn=Qe.properties)||void 0===Wn||null===(Co=Wn.exif)||void 0===Co?void 0:Co["Exif.GPSInfo.GPSHPositioningError"]),Gl=getExifFloat(null===Qe||void 0===Qe||null===(Dl=Qe.properties)||void 0===Dl||null===(Ll=Dl.exif)||void 0===Ll?void 0:Ll["Exif.GPSInfo.GPSDOP"]);return void 0!==Ul?Rl=`${Ul} m`:void 0!==Gl&&(Rl=Gl<1?"ideal":Gl<2?"excellent":Gl<5?"good":Gl<10?"moderate":Gl<20?"fair":"poor"),Rl}function getSphereCorrection(Qe){var rt,Wn,Co,Dl;let Ll=null===(rt=Qe.properties)||void 0===rt?void 0:rt["view:azimuth"];if(void 0===Ll){var Rl,Ul;const rt=getExifFloat(null===(Rl=Qe.properties)||void 0===Rl||null===(Ul=Rl.exif)||void 0===Ul?void 0:Ul["Exif.GPSInfo.GPSImgDirection"]);void 0!==rt&&(Ll=rt)}Ll=Ll||0;let Gl=null===(Wn=Qe.properties)||void 0===Wn?void 0:Wn["pers:yaw"],Zl=["Xmp.GPano.PoseHeadingDegrees","Xmp.Camera.Yaw","Exif.MpfInfo.MPFYawAngle"];if(void 0===Gl)for(let du of Zl){var Hl,ql;const rt=getExifFloat(null===(Hl=Qe.properties)||void 0===Hl||null===(ql=Hl.exif)||void 0===ql?void 0:ql[du]);if(void 0!==rt){Gl=rt;break}}Gl=Gl||0,Math.round(Ll)===Math.round(Gl)&&Gl>0&&console.warn("Picture with UUID",Qe.id,"has same GPS Image direction and Yaw, could cause rendering issues");let Ql=null===(Co=Qe.properties)||void 0===Co?void 0:Co["pers:pitch"];if(Zl=["Xmp.GPano.PosePitchDegrees","Xmp.Camera.Pitch","Exif.MpfInfo.MPFPitchAngle"],void 0===Ql)for(let du of Zl){var Kl,$l;const rt=getExifFloat(null===(Kl=Qe.properties)||void 0===Kl||null===($l=Kl.exif)||void 0===$l?void 0:$l[du]);if(void 0!==rt){Ql=rt;break}}Ql=Ql||0;let Tc=null===(Dl=Qe.properties)||void 0===Dl?void 0:Dl["pers:roll"];if(Zl=["Xmp.GPano.PoseRollDegrees","Xmp.Camera.Roll","Exif.MpfInfo.MPFRollAngle"],void 0===Tc)for(let du of Zl){var tu,lu;const rt=getExifFloat(null===(tu=Qe.properties)||void 0===tu||null===(lu=tu.exif)||void 0===lu?void 0:lu[du]);if(void 0!==rt){Tc=rt;break}}return Tc=Tc||0,0!==Ql&&0!==Tc?{pan:Gl*Math.PI/180,tilt:Ql*Math.PI/180,roll:Tc*Math.PI/180}:{}}function getCroppedPanoData(Qe){var rt,Wn;let Co;var Dl,Ll;if(null!==(rt=Qe.properties)&&void 0!==rt&&rt["pers:interior_orientation"]&&(null!==(Dl=Qe.properties["pers:interior_orientation"])&&void 0!==Dl&&Dl.visible_area&&null!==(Ll=Qe.properties["pers:interior_orientation"])&&void 0!==Ll&&Ll.sensor_array_dimensions)){const rt=Qe.properties["pers:interior_orientation"].visible_area,Wn=Qe.properties["pers:interior_orientation"].sensor_array_dimensions;try{Co={fullWidth:parseInt(Wn[0]),fullHeight:parseInt(Wn[1]),croppedX:parseInt(rt[0]),croppedY:parseInt(rt[1]),croppedWidth:parseInt(Wn[0])-parseInt(rt[2])-parseInt(rt[0]),croppedHeight:parseInt(Wn[1])-parseInt(rt[3])-parseInt(rt[1])}}catch(Ql){console.warn("Invalid pers:interior_orientation values for cropped panorama "+Qe.id)}}if(!Co&&null!==(Wn=Qe.properties)&&void 0!==Wn&&Wn.exif)try{var Rl,Ul,Gl,Zl,Hl,ql;Co={fullWidth:parseInt(null===(Rl=Qe.properties.exif)||void 0===Rl?void 0:Rl["Xmp.GPano.FullPanoWidthPixels"]),fullHeight:parseInt(null===(Ul=Qe.properties.exif)||void 0===Ul?void 0:Ul["Xmp.GPano.FullPanoHeightPixels"]),croppedX:parseInt(null===(Gl=Qe.properties.exif)||void 0===Gl?void 0:Gl["Xmp.GPano.CroppedAreaLeftPixels"]),croppedY:parseInt(null===(Zl=Qe.properties.exif)||void 0===Zl?void 0:Zl["Xmp.GPano.CroppedAreaTopPixels"]),croppedWidth:parseInt(null===(Hl=Qe.properties.exif)||void 0===Hl?void 0:Hl["Xmp.GPano.CroppedAreaImageWidthPixels"]),croppedHeight:parseInt(null===(ql=Qe.properties.exif)||void 0===ql?void 0:ql["Xmp.GPano.CroppedAreaImageHeightPixels"])}}catch(Ql){console.warn("Invalid XMP.GPano values for cropped panorama "+Qe.id)}return Co&&(Co=Object.fromEntries(Object.entries(Co||{}).filter((Qe=>!isNaN(Qe[1])))),(!Co.fullWidth&&!Co.croppedWidth&&Co.fullHeight&&!Co.croppedHeight||Co.fullWidth&&!Co.croppedWidth&&!Co.fullHeight&&!Co.croppedHeight||Co.fullWidth&&!Co.croppedWidth&&Co.fullHeight&&!Co.croppedHeight||Co.fullWidth==Co.croppedWidth&&Co.fullHeight==Co.croppedHeight)&&(Co={})),Co||{}}function sortPicturesInDirection(Qe){return(rt,Wn)=>"related"!=rt.rel&&"related"!=Wn.rel?0:"related"!=rt.rel?-1:"related"!=Wn.rel?1:rt.date==Wn.date?(0,Ll.getDistance)(Qe,rt.geometry.coordinates)-(0,Ll.getDistance)(Qe,Wn.geometry.coordinates):Wn.date.localeCompare(rt.date)}function getNodeCaption(Qe,rt){var Wn,Co,Dl;const Ll={};if(null!==Qe&&void 0!==Qe&&null!==(Wn=Qe.properties)&&void 0!==Wn&&Wn.datetimetz){Ll.date=new Date(Qe.properties.datetimetz);const rt=Qe.properties.datetimetz.match(/([+-]\d{2}):(\d{2})$|Z$/);rt&&("Z"===rt[0]?Ll.tz="UTC":Ll.tz=rt[0])}else null!==Qe&&void 0!==Qe&&null!==(Co=Qe.properties)&&void 0!==Co&&Co.datetime&&(Ll.date=new Date(Qe.properties.datetime));if(null!==Qe&&void 0!==Qe&&Qe.providers){var Rl;const rt=null===Qe||void 0===Qe||null===(Rl=Qe.providers)||void 0===Rl?void 0:Rl.filter((Qe=>{var rt;return null===Qe||void 0===Qe||null===(rt=Qe.roles)||void 0===rt?void 0:rt.includes("producer")}));if((null===rt||void 0===rt?void 0:rt.length)>=0){const Qe={};rt.map((Qe=>Qe.name)).forEach((rt=>{const Wn=rt.toLowerCase().replace(/\s/g,"");Qe[Wn]?Qe[Wn].push(rt):Qe[Wn]=[rt]})),Ll.producer=[],Object.values(Qe).forEach((Qe=>{const rt=Qe[0],Wn=Qe.find((Qe=>Qe.toLowerCase()!=Qe));Ll.producer.push(Wn||rt)}))}}if(null!==Qe&&void 0!==Qe&&null!==(Dl=Qe.properties)&&void 0!==Dl&&Dl.license&&(Ll.license=Qe.properties.license,null!==Qe&&void 0!==Qe&&Qe.links)){const Wn=Qe.links.find((Qe=>"license"===(null===Qe||void 0===Qe?void 0:Qe.rel)));Wn&&(Ll.license=`<a href="${Wn.href}" title="${rt.pnx.metadata_general_license_link}" target="_blank">${Ll.license}</a>`)}return Ll}function apiFeatureToPSVNode(Qe,rt){var Wn,Co,Dl,Ll,Rl,Ul,Gl,Zl,Hl,ql,Ql,Kl,$l,Tc;let tu=arguments.length>2&&void 0!==arguments[2]&&arguments[2],lu=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;const du=null!=(null===(Wn=Qe.properties)||void 0===Wn||null===(Co=Wn["pers:interior_orientation"])||void 0===Co?void 0:Co.field_of_view);let fu=du?parseInt(Qe.properties["pers:interior_orientation"].field_of_view):70;const yu=360===fu,Eu=(Object.values(Qe.assets).find((Qe=>{var rt;return null===Qe||void 0===Qe||null===(rt=Qe.roles)||void 0===rt?void 0:rt.includes("data")}))||{}).href,Tu=null===Qe||void 0===Qe||null===(Dl=Qe.properties)||void 0===Dl||null===(Ll=Dl["tiles:tile_matrix_sets"])||void 0===Ll?void 0:Ll.geovisio,Lu=null===(Rl=Qe.links)||void 0===Rl||null===(Ul=Rl.find)||void 0===Ul?void 0:Ul.call(Rl,(Qe=>"prev"===(null===Qe||void 0===Qe?void 0:Qe.rel)&&"application/geo+json"===(null===Qe||void 0===Qe?void 0:Qe.type))),Zu=null===(Gl=Qe.links)||void 0===Gl||null===(Zl=Gl.find)||void 0===Zl?void 0:Zl.call(Gl,(Qe=>"next"===(null===Qe||void 0===Qe?void 0:Qe.rel)&&"application/geo+json"===(null===Qe||void 0===Qe?void 0:Qe.type))),Xu=Object.values(Qe.assets).find((Qe=>{var rt;return(null===(rt=Qe.roles)||void 0===rt?void 0:rt.includes("visual"))&&"image/webp"===Qe.type})),Ju=Object.values(Qe.assets).find((Qe=>{var rt;return(null===(rt=Qe.roles)||void 0===rt?void 0:rt.includes("visual"))&&"image/jpeg"===Qe.type})),$u=(Xu||Ju).href,ed=null===(Hl=Object.values(Qe.assets).find((Qe=>{var rt;return(null===(rt=Qe.roles)||void 0===rt?void 0:rt.includes("thumbnail"))&&"image/jpeg"===Qe.type})))||void 0===Hl?void 0:Hl.href,td=(null===Qe||void 0===Qe||null===(ql=Qe.asset_templates)||void 0===ql?void 0:ql.tiles_webp)||(null===Qe||void 0===Qe||null===(Ql=Qe.asset_templates)||void 0===Ql?void 0:Ql.tiles),id=getCroppedPanoData(Qe),nd=null===(Kl=Qe.links)||void 0===Kl||null===($l=Kl.find)||void 0===$l?void 0:$l.call(Kl,(Qe=>"via"===(null===Qe||void 0===Qe?void 0:Qe.rel)&&"application/json"===(null===Qe||void 0===Qe?void 0:Qe.type)));let rd;rd=Object.keys(id).length>0?{baseUrl:tu?Eu:$u,origBaseUrl:tu?Eu:$u,hdUrl:Eu,thumbUrl:ed,basePanoData:id,cols:2,rows:1,width:2,tileUrl:()=>null}:yu&&Tu?{baseUrl:$u,origBaseUrl:$u,basePanoData:Qe=>({fullWidth:Qe.width,fullHeight:Qe.height}),hdUrl:Eu,thumbUrl:ed,cols:Tu&&Tu.tileMatrix[0].matrixWidth,rows:Tu&&Tu.tileMatrix[0].matrixHeight,width:Tu&&Tu.tileMatrix[0].matrixWidth*Tu.tileMatrix[0].tileWidth,tileUrl:Tu&&((Qe,rt)=>td.href.replace(/\{TileCol\}/g,Qe).replace(/\{TileRow\}/g,rt))}:{baseUrl:tu?Eu:$u,origBaseUrl:tu?Eu:$u,hdUrl:Eu,thumbUrl:ed,basePanoData:Qe=>{Qe.width<Qe.height&&!du&&(fu=35);const rt=fu*Qe.height/Qe.width,Wn=360*Qe.width/fu,Co=180*Qe.height/rt;return{fullWidth:Wn,fullHeight:Co,croppedWidth:Qe.width,croppedHeight:Qe.height,croppedX:(Wn-Qe.width)/2,croppedY:(Co-Qe.height)/2}},cols:2,rows:1,width:2,tileUrl:()=>null},null!==(Tc=Qe.properties)&&void 0!==Tc&&Tc.semantics&&(Qe.properties.semantics=Qe.properties.semantics.filter((Qe=>Object.keys(Qe).length>0)));return{id:Qe.id,caption:getNodeCaption(Qe,rt),panorama:rd,links:filterRelatedPicsLinks(Qe,lu),gps:Qe.geometry.coordinates,sequence:{id:Qe.collection,nextPic:Zu?Zu.id:void 0,prevPic:Lu?Lu.id:void 0},sphereCorrection:getSphereCorrection(Qe),horizontalFov:fu,origInstance:nd,properties:Qe.properties}}function filterRelatedPicsLinks(Qe){var rt;let Wn=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const Co=Qe.links.filter((Qe=>["next","prev","related"].includes(null===Qe||void 0===Qe?void 0:Qe.rel)&&"application/geo+json"===(null===Qe||void 0===Qe?void 0:Qe.type))).filter((Qe=>!Wn||Wn(Qe))).map((Qe=>(Qe.datetime&&(Qe.date=Qe.datetime.split("T")[0]),Qe))),Dl=Qe.geometry.coordinates,Gl=[],Zl={N:[],ENE:[],ESE:[],S:[],WSW:[],WNW:[]};for(let Rl of Co){Zl[(0,Ll.getSimplifiedAngle)(Dl,Rl.geometry.coordinates)].push(Rl)}for(let Ll in Zl){const Qe=Zl[Ll];0!=Qe.length&&(Qe.sort(sortPicturesInDirection(Dl)),Gl.push(Qe.shift()))}let arrowStyle=Qe=>"related"===Qe.rel?{element:(0,Ll.getArrow)(Ul),size:{width:128/3,height:128}}:{element:(0,Ll.getArrow)(Rl),size:{width:75,height:75}};const Hl=-((null===(rt=Qe.properties)||void 0===rt?void 0:rt["view:azimuth"])||0)*(Math.PI/180);return Gl.map((Qe=>({nodeId:Qe.id,gps:Qe.geometry.coordinates,arrowStyle:arrowStyle(Qe),linkOffset:{yaw:Hl}})))}function getHashTags(Qe){var rt;if(null===Qe||void 0===Qe||null===(rt=Qe.properties)||void 0===rt||!rt.semantics)return[];const Wn=Qe.properties.semantics.filter((Qe=>"hashtags"===Qe.key)),Co=[];return Wn.forEach((Qe=>Qe.value.split(";").forEach((Qe=>Co.push(Qe.trim()))))),Co}function hasAnnotations(Qe){var rt,Wn;return(null===Qe||void 0===Qe||null===(rt=Qe.properties)||void 0===rt||null===(Wn=rt.annotations)||void 0===Wn?void 0:Wn.length)>0}},2283:(Qe,rt,Wn)=>{"use strict";Wn.r(rt),Wn.d(rt,{decodeBasicTag:()=>decodeBasicTag,decodeKey:()=>decodeKey,groupByPrefix:()=>groupByPrefix});var Co=Wn(4542),Dl=Wn(5995),Ll=Wn(7929),Rl=Wn(1760),Ul=Wn(7091),Gl=Wn(7208);function valToValLink(Qe,rt,Wn){return Co.qy`
2385
2385
  ${Qe}
2386
2386
  <pnx-link-button
2387
2387
  kind="superinline"