@panoramax/web-viewer 4.2.0-develop-613d3794 → 4.2.0-develop-2a3367e4

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(ae,ue){"object"===typeof exports&&"object"===typeof module?module.exports=ue():"function"===typeof define&&define.amd?define("Panoramax",[],ue):"object"===typeof exports?exports.Panoramax=ue():ae.Panoramax=ue()}(this,(()=>(()=>{var ae={9039:(ae,ue,nt)=>{"use strict";nt.d(ue,{A:()=>Basic});var ut=nt(4542),qt=nt(5254),Yt=nt(4964),Xt=nt(7208),ys=nt(5995),Ec=nt(7343),lu=nt(2614),uu=nt.n(lu),_u=nt(8330);nt(1865),nt(3638);class Basic extends ut.WF{constructor(){let ae=arguments.length>0&&void 0!==arguments[0]&&arguments[0];super(),this.users=["geovisio"],this["map-style"]=this.getAttribute("map-style")||(0,Xt.MapTiles)(),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 ${_u.rE} (613d379)\n\n\ud83c\udd98 Issues can be reported at ${_u.Jk.O}`),ae||(this._isInternetFast=null,(0,Ec.isInternetFast)().then((ae=>this._isInternetFast=ae)))}connectedCallback(){super.connectedCallback(),this._t=(0,Yt.getTranslations)(this.lang),this.loader=(0,ys.createWebComp)("pnx-loader",{_parent:this,"no-label":(0,Ec.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()),Object.entries({map:"map-options",psv:"psv-options",fetchOptions:"fetch-options",mapstyle:"map-style"}).forEach((ae=>{let[ue,nt]=ae;this.getAttribute(ue)&&console.error(`Component attribute "${ue}" has been renamed into "${nt}". Old attribute "${ue}" is ignored.`)}))}_setupAPI(){if(this.loader=this.loader||(0,ys.createWebComp)("pnx-loader",{_parent:this}),!this.endpoint)return void console.warn("No endpoint is defined");this._loadsAPI=this.endpoint;let ae=this.endpoint;try{this["map-style"]=JSON.parse(this["map-style"])}catch(nt){}try{this.api=new qt.A(this.endpoint,{users:this.users,fetch:this["fetch-options"],style:this["map-style"]}),this.api.onceReady().then((()=>{if(ae!=this._loadsAPI||!this.api)return;let ue=this.api.getUnavailableFeatures(),nt=this.api.getAvailableFeatures();nt=0===ue.length?"\u2705 All features available":"\u2705 Available features: "+nt.join(", "),ue=0===ue.length?"":"\ud83d\udeab Unavailable features: "+ue.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 ${nt}\n ${ue}\n`.trim())})).catch((ae=>this.loader.dismiss(ae,this._t.pnx.error_api))).finally((()=>delete this._loadsAPI))}catch(nt){var ue;delete this._loadsAPI,null!==(ue=this.loader)&&void 0!==ue&&ue.dismiss?this.loader.dismiss(nt,this._t.pnx.error_api):console.error(nt)}}onceReady(){throw new Error("You must override this method on sub-class")}onceAPIReady(){return this.api?this.api.onceReady():new Promise((ae=>setTimeout(ae,100))).then(this.onceAPIReady.bind(this))}createRenderRoot(){return this}attributeChangedCallback(ae,ue,nt){if(super.attributeChangedCallback(ae,ue,nt),"endpoint"===ae&&(this._loadsAPI&&nt&&this._loadsAPI===nt||this.api&&this.api._endpoint===nt||!nt||((this._loadsAPI||this.api)&&(delete this.api,delete this._loadsAPI),this._setupAPI())),["picture","sequence"].includes(ae)){let ut,qt,Yt,Xt;"picture"===ae?(ut=this.sequence,Yt=this.sequence,qt=nt,Xt=ue):(ut=nt,Yt=ue,qt=this.picture,Xt=this.picture),this.dispatchEvent(new CustomEvent("select",{bubbles:!0,composed:!0,detail:{seqId:ut,picId:qt,prevSeqId:Yt,prevPicId:Xt}}))}}getClassName(){return"Basic"}select(){let ae=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,ue=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=ue,this.sequence=ae}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 ut.qy`<p>Should not be used directly, use Viewer/CoverageMap/Editor instead</p>`}getSubComponentsNames(){return["loader","api"]}addEventListener(ae,ue,nt){let ut=ae.split(":").shift();if(ut&&this.getSubComponentsNames().includes(ut)){var qt;const Yt=ae.substring(ut.length+1);null!==(qt=this[ut])&&void 0!==qt&&qt.addEventListener?this[ut].addEventListener(Yt,ue,nt):setTimeout((()=>this.addEventListener(ae,ue,nt)),50)}else super.addEventListener(ae,ue,nt)}static GetJSONConverter(){return{fromAttribute:ae=>null===ae||""===ae?null:"object"===typeof ae||Array.isArray(ae)?ae:uu().parse(ae),toAttribute:ae=>null===ae||""===ae?"":"string"===typeof ae?ae:uu().stringify(ae)}}}Basic.properties={picture:{type:String,reflect:!0},sequence:{type:String,reflect:!0},"fetch-options":{converter:Basic.GetJSONConverter()},users:{type:Array,reflect:!0},"map-style":{type:String},lang:{type:String},endpoint:{type:String}}},153:(ae,ue,nt)=>{"use strict";nt.d(ue,{A:()=>CoverageMap});var ut=nt(9039),qt=nt(5642),Yt=nt(8340),Xt=nt(927),ys=(nt(7776),nt(2118));class CoverageMap extends ut.A{constructor(){super(),this._mapContainer=document.createElement("div"),this.onceAPIReady().then((()=>{this.loader.setAttribute("value",30),this._initParams=new ys.Ay(ys.Ay.GetComponentProperties(CoverageMap,this)),this._initMap()}))}disconnectedCallback(){var ae;super.disconnectedCallback(),null===(ae=this.map)||void 0===ae||ae.destroy()}getClassName(){return"CoverageMap"}onceReady(){return this.map&&this.map.waitForEnoughMapLoaded?this.map.waitForEnoughMapLoaded():new Promise((ae=>setTimeout(ae,100))).then(this.onceReady.bind(this))}render(){return[this.loader,this._mapContainer]}getSubComponentsNames(){const ae=super.getSubComponentsNames();return ae.push("map"),ae}_initMap(){class MyMap extends qt.A{_getLayerStyleProperties(ae){return"pictures_symbols"===ae?{layout:{visibility:"none"}}:super._getLayerStyleProperties(ae)}}this.map=new MyMap(this,this._mapContainer,Object.assign({},this._initParams.getMapInit(),{hash:!0})),this.map.addControl(new Xt.NavigationControl({showCompass:!1})),this.loader.setAttribute("value",70),this.addEventListener("select",this._onSelect.bind(this)),this.map.on("picture-click",(ae=>this.select(ae.seqId,ae.picId))),this.map.on("sequence-click",(ae=>this.select(ae.seqId))),this.map.waitForEnoughMapLoaded().then((async()=>{await(0,ys.mK)(this.map,this._initParams.getMapPostInit()),this.map.reloadLayersStyles(),this.loader.dismiss()}))}_onSelect(ae){if(ae.detail.picId||ae.detail.seqId){const ue=ae.detail.picId?"pictures":"sequences",nt=this.map.queryRenderedFeatures({layers:[...this.map._userLayers].map((ae=>(0,Yt.getUserLayerId)(ae,ue))),filter:["==",["get","id"],ae.detail.picId||ae.detail.seqId]});nt.length>=0&&null!=nt[0]&&this.map._attachPreviewToPictures({features:nt},ue)}}}CoverageMap.properties={"map-options":{converter:ut.A.GetJSONConverter()},...ut.A.properties},customElements.define("pnx-coverage-map",CoverageMap)},1752:(ae,ue,nt)=>{"use strict";nt.d(ue,{A:()=>Editor});nt(7365);var ut=nt(9039),qt=nt(5642),Yt=nt(9048),Xt=nt(508),ys=nt(8340),Ec=nt(1545),lu=nt(5995);const uu="sequence-headings";class Editor extends ut.A{constructor(){super(),this.raster=null,this.background="streets",this.users=[],this._psvContainer=document.createElement("div"),this._psvContainer.setAttribute("slot","bg"),this._mapContainer=document.createElement("div"),this._mapContainer.setAttribute("slot","bg"),this.grid=(0,lu.createWebComp)("pnx-cornered-grid"),this.grid.appendChild(this._psvContainer),this.grid.appendChild(this._mapContainer),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()}))}disconnectedCallback(){var ae,ue;super.disconnectedCallback(),null===(ae=this.map)||void 0===ae||ae.destroy(),null===(ue=this.psv)||void 0===ue||ue.destroy()}getClassName(){return"Editor"}onceReady(){var ae,ue;return this.map&&this.psv&&null!==(ae=(ue=this.map).loaded)&&void 0!==ae&&ae.call(ue)?Promise.resolve():new Promise((ae=>setTimeout(ae,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(),this._moveChildToGrid(),window.addEventListener("DOMContentLoaded",(()=>{this._moveChildToGrid()}),{once:!0})}attributeChangedCallback(ae,ue,nt){"users"===ae&&Array.isArray(nt)&&nt.length>0?console.warn("Parameters users can't be changed in Editor, only selected sequence can be visible"):super.attributeChangedCallback(ae,ue,nt)}render(){return[this.loader,this.grid]}getSubComponentsNames(){return super.getSubComponentsNames().concat(["map","psv","grid"])}_initPSV(){try{this.psv=new Yt.Ay(this,this._psvContainer),this.psv._myVTour.datasource.nodeResolver=this._getNode.bind(this)}catch(ae){let ue=Ec.IJ.isWebGLSupported?this._t.pnx.error_psv:this._t.pnx.error_webgl;this.loader.dismiss(ae,ue)}}_initMap(){try{this.map=new qt.A(this,this._mapContainer,{raster:this.raster,background:this.background,supplementaryStyle:this._createMapStyle(),zoom:15,picMarkerDraggable:!0}),(0,ys.linkMapAndPhoto)(this),this.loader.setAttribute("value",50),this._loadSequence(),this.map.once("load",(()=>{this.map.hasTwoBackgrounds()&&this._addMapBackgroundWidget(),this._bindPicturesEvents()}));const ae=this.map._picMarker.setRotation.bind(this.map._picMarker);this.map._picMarker.setRotation=ue=>(ue=void 0===this._lastRelHeading?ue:ue+this._lastRelHeading-this.psv.getPictureRelativeHeading(),ae(ue))}catch(ae){this.loader.dismiss(ae,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:{...ys.VECTOR_STYLES.SEQUENCES.layout},paint:{...ys.VECTOR_STYLES.SEQUENCES.paint}},{id:"geovisio_editor_pictures",type:"circle",source:"geovisio_editor_sequences",layout:{...ys.VECTOR_STYLES.PICTURES.layout},paint:{...ys.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((ae=>{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=ae.features,this.map.getSource("geovisio_editor_sequences").setData({type:"FeatureCollection",features:[{id:this.sequence,type:"Feature",properties:{id:this.sequence},geometry:{type:"LineString",coordinates:ae.features.map((ae=>ae.geometry.coordinates))}},...ae.features.map((ae=>(ae.properties.id=ae.id,ae.properties.sequences=[this.sequence],ae)))]}),this.picture){const ue=ae.features.find((ae=>ae.id===this.picture));ue?(this.select(this.sequence,this.picture,!0),this.map.jumpTo({center:ue.geometry.coordinates,zoom:18})):console.log("Picture with ID",ue,"was not found")}else{const ue=[...ae.features[0].geometry.coordinates,...ae.features[0].geometry.coordinates];for(let nt=1;nt<ae.features.length;nt++){const ut=ae.features[nt].geometry.coordinates;ut[0]<ue[0]&&(ue[0]=ut[0]),ut[1]<ue[1]&&(ue[1]=ut[1]),ut[0]>ue[2]&&(ue[2]=ut[0]),ut[1]>ue[3]&&(ue[3]=ut[1])}this.map.fitBounds(ue,{animate:!1})}})).catch((ae=>this.loader.dismiss(ae,this._t.pnx.error_api)))}_getNode(ae){const ue=this._sequenceData.find((ue=>ue.properties.id===ae)),nt=ue?(0,Xt.apiFeatureToPSVNode)(ue,this._t,this._isInternetFast,void 0,(ae=>this.api.cleanResourceURL(ae))):null;return nt&&delete nt.links,nt}_addMapBackgroundWidget(){const ae=(0,lu.createWebComp)("pnx-map-background",{_parent:this,size:"sm",slot:"bottom-left"});this.grid.appendChild(ae)}_moveChildToGrid(){Array.from(this.querySelectorAll("[slot]")).forEach((ae=>{var ue;null!==(ue=ae.tagName)&&void 0!==ue&&ue.toLowerCase().startsWith("pnx-")&&(ae._parent=this,ae._t=this._t),this.grid.appendChild(ae)}))}previewSequenceHeadingChange(ae){const ue=void 0!==this.map.getLayer(uu);if(this.map._picMarkerPreview.remove(),void 0===ae)return delete this._lastRelHeading,ue&&this.map.setLayoutProperty(uu,"visibility","none"),void(this.picture&&this.map._picMarker.setRotation(this.psv.getXY().x));this._lastRelHeading=ae,ue||this.map.addLayer({id:uu,type:"symbol",source:"geovisio_editor_sequences",layout:{"icon-image":"pnx-marker","icon-overlap":"always","icon-size":.8}});const nt=-this.psv.getPictureRelativeHeading();this.map.setLayoutProperty(uu,"visibility","visible"),this.map.setLayoutProperty(uu,"icon-rotate",["+",["get","view:azimuth"],nt,ae]);const ut=[["==",["geometry-type"],"Point"]];this.picture&&ut.push(["!=",["get","id"],this.picture]),this.map.setFilter(uu,["all",...ut]),this.picture&&this.map._picMarker.setRotation(this.psv.getXY().x)}_onSelect(){void 0!==this._lastRelHeading&&this.previewSequenceHeadingChange(this._lastRelHeading)}}Editor.properties={raster:{converter:ut.A.GetJSONConverter()},background:{type:String},...ut.A.properties},customElements.define("pnx-editor",Editor)},3407:(ae,ue,nt)=>{"use strict";nt.d(ue,{$p:()=>_u,Ay:()=>PhotoViewer,RD:()=>wu});nt(970);var ut=nt(1545),qt=nt(4451),Yt=nt(9039),Xt=nt(9048),ys=nt(5995),Ec=nt(7343),lu=nt(2118),uu=nt(4207);const _u=20,vu=Math.PI/6,wu=["pnx-mini","pnx-widget-player","pnx-widget-zoom"];class PhotoViewer extends Yt.A{constructor(){super(),this["psv-options"]={},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,ys.createWebComp)("pnx-cornered-grid"),this.psvContainer=document.createElement("div"),this.psvContainer.setAttribute("slot","bg"),this.grid.appendChild(this.psvContainer),this.popup=(0,ys.createWebComp)("pnx-popup",{_parent:this,onclose:this._onPopupClose.bind(this)}),this.tabindex=0,this._sequencesMetadata={}}_createInitParamsHandler(){var ae,ue;this._initParams=new lu.Ay(lu.Ay.GetComponentProperties(PhotoViewer,this),Object.assign({},null===(ae=this.urlHandler)||void 0===ae?void 0:ae.currentURLParams(),null===(ue=this.urlHandler)||void 0===ue?void 0:ue.currentURLParams(!0)),{disableAnnotations:localStorage.getItem(Ec.DISABLE_ANNOTATIONS_PARAM)})}_initWidgets(){"false"!==this._initParams.getParentPostInit().widgets&&((0,Ec.isInIframe)()||(this.grid.appendChild((0,ys.createWebComp)("pnx-widget-player",{slot:"top",_parent:this,class:"pnx-only-psv pnx-print-hidden",size:this.isHeightSmall()?"md":"xl"})),this.grid.appendChild((0,ys.createWebComp)("pnx-annotations-switch",{slot:"top",_parent:this,class:"pnx-only-psv pnx-print-hidden",size:this.isHeightSmall()?"md":"xl"}))),(0,Ec.isInIframe)()?(this.legend=(0,ys.createWebComp)("pnx-widget-legend",{slot:"bottom-right",light:!0,_parent:this,focus:this._initParams.getParentPostInit().focus,picture:this._initParams.getParentPostInit().picture}),this.grid.appendChild(this.legend)):this.isWidthSmall()?(this.legend=(0,ys.createWebComp)("pnx-picture-legend",{_parent:this}),this.bottomDrawer=(0,ys.createWebComp)("pnx-bottom-drawer",{slot:"bottom",_parent:this,class:this._initParams.getParentPostInit().willLoadPicture?void 0:"pnx-hidden"}),this.bottomDrawer.appendChild(this.legend),this.grid.appendChild(this.bottomDrawer),this.addEventListener("select",(ae=>{(0,Ec.isNullId)(ae.detail.picId)?this.bottomDrawer.classList.add("pnx-hidden"):this.bottomDrawer.classList.remove("pnx-hidden")}))):(this.legend=(0,ys.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,ys.createWebComp)("pnx-widget-zoom",{slot:"bottom-right",class:"pnx-print-hidden",_parent:this})),this.grid.appendChild(this.legend)))}connectedCallback(){super.connectedCallback(),this.presetsManager=new uu.A(this.lang),this["url-parameters"]&&"false"!==this["url-parameters"]&&(this.urlHandler=new qt.A(this),this.onceReady().then((()=>{this.urlHandler.listenToChanges(),this.urlHandler._onParentChange()}))),this.onceAPIReady().then(this._postAPIInit.bind(this)),this._moveChildToGrid(),window.addEventListener("DOMContentLoaded",(()=>{this._moveChildToGrid()}),{once:!0})}disconnectedCallback(){var ae,ue;super.disconnectedCallback(),null===(ae=this.urlHandler)||void 0===ae||ae.destroy(),null===(ue=this.psv)||void 0===ue||ue.destroy(),document.body.removeEventListener("click",this._toggleKeyboardBasedOnFocus),window.removeEventListener("keypress",this._toggleKeyboardBasedOnFocus)}getClassName(){return"PhotoViewer"}onceReady(){return this.oncePSVReady().then((()=>this._initParams.getParentPostInit().willLoadPicture&&!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 ae;return new Promise((ue=>{ae=setInterval((()=>{this.psv&&"object"===typeof this.psv&&(this.psv.container?(clearInterval(ae),ue()):this.psv.addEventListener&&this.psv.addEventListener("ready",(()=>{clearInterval(ae),ue()}),{once:!0}))}),250)}))}onceFirstPicLoaded(){return this.oncePSVReady().then((()=>this.psv.getPictureMetadata()?Promise.resolve():new Promise((ae=>{this.psv.addEventListener("picture-loaded",ae,{once:!0})}))))}async _postAPIInit(){this.loader.setAttribute("value",30),this._createInitParamsHandler();const ae=this._initParams.getParentPostInit();this._initPSV(),this._initWidgets(),(0,lu.ai)(this,ae),ae.keyboardShortcuts&&this._handleKeyboardManagement(),ae.willLoadPicture?this.psv.getPictureMetadata()?this.loader.dismiss():this.psv.addEventListener("picture-loaded",(()=>this.loader.dismiss()),{once:!0}):this.loader.dismiss()}_initPSV(){try{this.psv=new Xt.Ay(this,this.psvContainer,{shouldGoFast:this._psvShouldGoFast.bind(this),keyboard:"always",keyboardActions:{...ut.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:()=>{var ae;return null===(ae=this._toggleFocus)||void 0===ae?void 0:ae.call(this)},7:()=>{var ae;return null===(ae=this._toggleFocus)||void 0===ae?void 0:ae.call(this)},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,lu.Vy)(this.psv,this._initParams.getPSVPostInit())})),this.psv.addEventListener("sequence-playing",(()=>this.classList.add("pnx-playing"))),this.psv.addEventListener("sequence-stopped",(()=>this.classList.remove("pnx-playing")))}catch(ae){let ue=ut.IJ.isWebGLSupported?this._t.pnx.error_psv:this._t.pnx.error_webgl;this.loader.dismiss(ae,ue)}}_enableKeyboard(){this.psv.startKeyboardControl()}_disableKeyboard(){this.psv.stopKeyboardControl()}_toggleKeyboardBasedOnFocus(ae){const ue=(null===ae||void 0===ae?void 0:ae.target)||document.activeElement;if(this.contains(ue)){for(let ae of this.grid.childNodes)if("bg"!==ae.getAttribute("slot")&&!wu.includes(ae.tagName.toLowerCase())&&ae.contains(ue))return void this._disableKeyboard();this._enableKeyboard()}else this._disableKeyboard()}_handleKeyboardManagement(){window.addEventListener("click",(ae=>this._toggleKeyboardBasedOnFocus(ae))),window.addEventListener("keypress",this._toggleKeyboardBasedOnFocus.bind(this)),this.popup.addEventListener("open",this._disableKeyboard.bind(this)),this.popup.addEventListener("close",this._enableKeyboard.bind(this)),this.psv.addEventListener("click",this._enableKeyboard.bind(this));for(let ae of this.grid.childNodes)"bg"===ae.getAttribute("slot")||wu.includes(ae.tagName.toLowerCase())||(ae.addEventListener("focusin",this._disableKeyboard.bind(this)),ae.addEventListener("focusout",(()=>{null===this.popup.getAttribute("visible")&&this._enableKeyboard()})))}_psvShouldGoFast(){return this.psv._sequencePlaying&&this.psv.getTransitionDuration()<1e3}_moveChildToGrid(){Array.from(this.querySelectorAll("[slot]")).forEach((ae=>{var ue;null!==(ue=ae.tagName)&&void 0!==ue&&ue.toLowerCase().startsWith("pnx-")&&(ae._parent=this,ae._t=this._t),"editors"===ae.getAttribute("slot")?this.onceReady().then((()=>{var ue;return null===(ue=this.legend)||void 0===ue?void 0:ue.appendChild(ae)})):this.grid.appendChild(ae)}))}setPopup(ae){let ue=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;ae?this.popup.setAttribute("visible",""):this.popup.removeAttribute("visible"),this.popup.innerHTML="","string"===typeof ue?this.popup.innerHTML=ue:Array.isArray(ue)&&ue.forEach((ae=>this.popup.appendChild(ae)))}_onPopupClose(){this.dispatchEvent(new CustomEvent("focus-changed",{detail:{focus:this.map&&this.isMapWide()?"map":"pic"}}))}_showQualityScoreDoc(){this.setPopup(!0,[(0,ys.createWebComp)("pnx-quality-score-doc",{_t:this._t})])}_showReportForm(){if(!this.psv.getPictureMetadata())throw new Error("No picture currently selected");this.setPopup(!0,[(0,ys.createWebComp)("pnx-report-form",{_parent:this})])}_showShareOptions(){this.setPopup(!0,[(0,ys.createWebComp)("pnx-share-menu",{_parent:this})])}_showSemanticsDoc(){this.setPopup(!0,[(0,ys.createWebComp)("pnx-semantics-doc",{_t:this._t})])}moveCenter(){this.psv.getPictureMetadata()&&this._psvAnimate({speed:Xt.LM,yaw:0,pitch:0,zoom:Xt.cS})}moveLeft(){this._moveToDirection("left")}moveRight(){this._moveToDirection("right")}moveUp(){this._moveToDirection("up")}moveDown(){this._moveToDirection("down")}_moveToDirection(ae){let ue=this.psv.getPosition();switch(ae){case"up":ue.pitch+=vu;break;case"left":ue.yaw-=vu;break;case"down":ue.pitch-=vu;break;case"right":ue.yaw+=vu}this._psvAnimate({speed:Xt.LM,...ue})}_psvAnimate(ae){this._lastPsvAnim&&this._lastPsvAnim.cancel(),this._lastPsvAnim=this.psv.animate(ae)}addEventListener(ae,ue,nt){super.addEventListener(ae,ue,nt)}}PhotoViewer.properties={"psv-options":{converter:Yt.A.GetJSONConverter()},widgets:{type:String},"url-parameters":{type:String},"keyboard-shortcuts":{type:String},tabindex:{type:Number},...Yt.A.properties},customElements.define("pnx-photo-viewer",PhotoViewer)},8743:(ae,ue,nt)=>{"use strict";nt.d(ue,{A:()=>Viewer});nt(9616);var ut=nt(8340),qt=nt(3407),Yt=nt(2771),Xt=nt(7343),ys=nt(5995),Ec=nt(9683),lu=nt(2e3),uu=nt(9438),_u=nt(2118);const vu=100;class Viewer extends qt.Ay{constructor(){super(),this["map-options"]=!0,this.geocoder=this.getAttribute("geocoder")||"nominatim",this.mini=(0,ys.createWebComp)("pnx-mini",{slot:"bottom-left",_parent:this,onexpand:this._onMiniExpand.bind(this),collapsed:!!(0,Xt.isNullId)(this.picture)||void 0}),this.mini.addEventListener("expand",this._toggleFocus.bind(this)),this.grid.appendChild(this.mini),this.mapContainer=document.createElement("div"),this.tabindex=0}_createInitParamsHandler(){var ae,ue;this._initParams=new _u.Ay(_u.Ay.GetComponentProperties(Viewer,this),Object.assign({},null===(ae=this.urlHandler)||void 0===ae?void 0:ae.currentURLParams(),null===(ue=this.urlHandler)||void 0===ue?void 0:ue.currentURLParams(!0)),{map:(0,ut.getMapParamsFromLocalStorage)(),disableAnnotations:localStorage.getItem(Xt.DISABLE_ANNOTATIONS_PARAM)})}_initWidgets(){var ae,ue;"false"!==this._initParams.getParentPostInit().widgets&&(this.grid.appendChild((0,ys.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})),(0,Xt.isInIframe)()?(this.legend=(0,ys.createWebComp)("pnx-widget-legend",{slot:"bottom-right",light:!0,_parent:this,focus:this._initParams.getParentPostInit().focus,picture:this._initParams.getParentPostInit().picture}),this.grid.appendChild(this.legend)):this.isWidthSmall()?(this.legend=(0,ys.createWebComp)("pnx-picture-legend",{_parent:this}),this.bottomDrawer=(0,ys.createWebComp)("pnx-bottom-drawer",{slot:"bottom",_parent:this,class:this._initParams.getParentPostInit().willLoadPicture?void 0:"pnx-hidden"}),this.bottomDrawer.appendChild(this.legend),this.grid.appendChild(this.bottomDrawer),this.addEventListener("select",(ae=>{(0,Xt.isNullId)(ae.detail.picId)?this.bottomDrawer.classList.add("pnx-hidden"):this.bottomDrawer.classList.remove("pnx-hidden")}))):(this.legend=(0,ys.createWebComp)("pnx-widget-legend",{slot:this.isWidthSmall()?"top":"top-left",_parent:this,focus:this._initParams.getParentPostInit().focus,picture:this._initParams.getParentPostInit().picture}),this._miniPicLegend=(0,ys.createWebComp)("pnx-mini-picture-legend",{_parent:this}),this.grid.appendChild(this.legend)),(0,Xt.isInIframe)()||(this.grid.appendChild((0,ys.createWebComp)("pnx-widget-player",{slot:"top",_parent:this,class:"pnx-only-psv pnx-print-hidden",size:this.isHeightSmall()?"md":"xl"})),this.grid.appendChild((0,ys.createWebComp)("pnx-annotations-switch",{slot:"top",_parent:this,class:"pnx-only-psv pnx-print-hidden",size:this.isHeightSmall()?"md":"xl"})),this.grid.appendChild((0,ys.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,ys.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===(ae=this.map)||void 0===ae||null===(ue=ae._hasQualityScore)||void 0===ue?void 0:ue.call(ae))||!1,class:"pnx-only-map pnx-print-hidden"})),this.grid.appendChild((0,ys.createWebComp)("pnx-widget-maplayers",{slot:"top-right",_parent:this,class:"pnx-only-map pnx-print-hidden"}))))}disconnectedCallback(){var ae;super.disconnectedCallback(),null===(ae=this.map)||void 0===ae||ae.destroy()}getClassName(){return"Viewer"}getSubComponentsNames(){return super.getSubComponentsNames().concat(["mini","map"])}onceReady(){return Promise.all([this.oncePSVReady(),this.onceMapReady()]).then((()=>this._initParams.getParentPostInit().willLoadPicture&&!this.psv.getPictureMetadata()?this.onceFirstPicLoaded():Promise.resolve()))}attributeChangedCallback(ae,ue,nt){var ut,qt;if(super.attributeChangedCallback(ae,ue,nt),"picture"===ae)if(null===(ut=this.legend)||void 0===ut||null===(qt=ut.setAttribute)||void 0===qt||qt.call(ut,"picture",nt),(0,Xt.isNullId)(ue)&&!(0,Xt.isNullId)(nt)&&this.mini.removeAttribute("collapsed"),(0,Xt.isNullId)(nt))this.map&&this.isMapWide()?this.mini.classList.add("pnx-hidden"):this.map&&!this.isMapWide()&&this._setFocus("map");else if((0,Xt.isNullId)(ue)&&this.sequence==this._initParams.getParentPostInit().sequence&&!this._initParams.getParentPostInit().picture){var Yt,ys;this.mini.classList.remove("pnx-hidden"),this.mini.removeAttribute("collapsed"),"closed"===(null===(Yt=this.bottomDrawer)||void 0===Yt||null===(ys=Yt.getAttribute)||void 0===ys?void 0:ys.call(Yt,"openness"))&&this.bottomDrawer.setAttribute("openness","half-opened")}else{var Ec,lu;if(this.mini.classList.remove("pnx-hidden"),(0,Xt.isNullId)(ue))this._setFocus("pic"),"closed"===(null===(Ec=this.bottomDrawer)||void 0===Ec||null===(lu=Ec.getAttribute)||void 0===lu?void 0:lu.call(Ec,"openness"))&&this.bottomDrawer.setAttribute("openness","half-opened")}"focus"===ae&&this._setFocus(nt)}onceMapReady(){if(!this.map)return Promise.resolve();let ae;return new Promise((ue=>{ae=setInterval((()=>{var nt,ut,qt;"object"===typeof this.map&&(null!==(nt=this.map)&&void 0!==nt&&null!==(ut=nt.loaded)&&void 0!==ut&&ut.call(nt)?(clearInterval(ae),ue()):null!==(qt=this.map)&&void 0!==qt&&qt.once&&this.map.once("render",(()=>{clearInterval(ae),ue()})))}),250)}))}async _initMap(){await new Promise((ae=>{this.map=new Yt.A(this,this.mapContainer,this._initParams.getMapInit()),(0,ut.saveMapParamsToLocalStorage)(this.map),this.map.once("users-changed",(()=>{this.loader.setAttribute("value",75),ae()}))})),await(0,_u.mK)(this.map,this._initParams.getMapPostInit()),(0,ut.initMapKeyboardHandler)(this),(0,ut.linkMapAndPhoto)(this)}async _postAPIInit(){this.loader.setAttribute("value",30),this._createInitParamsHandler();const ae=this._initParams.getParentPostInit();this._initPSV(),await this._initMap(),this._initWidgets(),this._moveChildToGrid(),(0,_u.iz)(this,ae),ae.keyboardShortcuts&&this._handleKeyboardManagement(),ae.willLoadPicture?this.psv.addEventListener("picture-loaded",(ue=>{(0,_u.iz)(this,ae),this.loader.dismiss()}),{once:!0}):this.loader.dismiss()}_enableKeyboard(){this.map&&this.isMapWide()?this._enableKeyboardMap():this._enableKeyboardPSV()}_enableKeyboardMap(){this.psv.stopKeyboardControl(),this.map.keyboard.enable()}_enableKeyboardPSV(){this.psv.startKeyboardControl(),this.map.keyboard.disable()}_disableKeyboard(){this.psv.stopKeyboardControl(),this.map.keyboard.disable()}_toggleKeyboardBasedOnFocus(ae){const ue=(null===ae||void 0===ae?void 0:ae.target)||document.activeElement;if(this.contains(ue)){for(let ae of this.grid.childNodes)if("bg"!==ae.getAttribute("slot")&&!qt.RD.includes(ae.tagName.toLowerCase())&&ae.contains(ue))return void this._disableKeyboard();this._enableKeyboard()}else this._disableKeyboard()}_handleKeyboardManagement(){window.addEventListener("click",(ae=>this._toggleKeyboardBasedOnFocus(ae))),window.addEventListener("keypress",this._toggleKeyboardBasedOnFocus.bind(this)),this.addEventListener("focus-changed",(ae=>{this.popup.getAttribute("visible")?this._disableKeyboard():"map"===ae.detail.focus?this._enableKeyboardMap():this._enableKeyboardPSV()})),this.popup.addEventListener("open",this._disableKeyboard.bind(this)),this.popup.addEventListener("close",this._enableKeyboard.bind(this)),this.psv.addEventListener("click",this._enableKeyboardPSV.bind(this));for(let ae of this.grid.childNodes)"bg"===ae.getAttribute("slot")||qt.RD.includes(ae.tagName.toLowerCase())||(ae.addEventListener("focusin",this._disableKeyboard.bind(this)),ae.addEventListener("focusout",(()=>{null===this.popup.getAttribute("visible")&&this._enableKeyboard()})))}moveCenter(){const ae=this.psv.getPictureMetadata();ae&&(this.map&&this.isMapWide()?this.map.flyTo({center:ae.gps,zoom:20}):super.moveCenter())}_moveToDirection(ae){if(this.map&&this.isMapWide()){let ue;switch(ae){case"up":ue=[0,-100];break;case"left":ue=[-100,0];break;case"down":ue=[0,vu];break;case"right":ue=[vu,0]}this.map.panBy(ue)}else super._moveToDirection(ae)}isMapWide(){return this.mapContainer.parentNode==this.grid}_setFocus(ae){var ue,nt,ut,qt;let Yt=arguments.length>1&&void 0!==arguments[1]&&arguments[1],uu=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if("map"===ae&&!this.map)throw new Error("Map is not enabled");if(!["map","pic"].includes(ae))throw new Error("Invalid focus value (should be pic or map)");if(this.focus=ae,(uu||("map"!==ae||!this.map||!this.isMapWide())&&("pic"!==ae||this.map&&this.isMapWide()))&&("map"===ae?(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,ys.fa)(Ec.pt),this._miniPicLegend&&this.mini.appendChild(this._miniPicLegend),(0,Xt.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._miniPicLegend&&this.mini.removeChild(this._miniPicLegend)),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,ys.fa)(lu.e5),this.psvContainer.focus()),null===this||void 0===this||null===(ue=this.map)||void 0===ue||null===(nt=ue.resize)||void 0===nt||nt.call(ue),this.psv.autoSize(),this.psv.forceRefresh(),null===(ut=this.legend)||void 0===ut||null===(qt=ut.setAttribute)||void 0===qt||qt.call(ut,"focus",this.focus),!Yt)){const ue=new CustomEvent("focus-changed",{detail:{focus:ae}});this.dispatchEvent(ue)}}_toggleFocus(){this._setFocus(this.isMapWide()?"pic":"map")}_onMiniExpand(){this.map.resize(),this.psv.autoSize()}_onMapFiltersChange(){var ae;const ue=(0,uu.qi)("#pnx-map-filters-menu"),nt=(0,uu.qi)("#pnx-map-theme"),qt=(0,ut.mapFiltersFormValues)(ue,nt,null===(ae=this.map)||void 0===ae?void 0:ae._hasQualityScore());this.map.setFilters(qt)}}Viewer.properties={"map-options":{converter:qt.Ay.GetJSONConverter()},focus:{type:String,reflect:!0},geocoder:{type:String},tabindex:{type:Number},...qt.Ay.properties},customElements.define("pnx-viewer",Viewer)},3921:(ae,ue,nt)=>{"use strict";nt.r(ue),nt.d(ue,{Basic:()=>ut.A,CoverageMap:()=>qt.A,Editor:()=>Yt.A,PhotoViewer:()=>ys.Ay,Viewer:()=>Xt.A});var ut=nt(9039),qt=nt(153),Yt=nt(1752),Xt=nt(8743),ys=nt(3407)},9341:(ae,ue,nt)=>{"use strict";nt.r(ue),nt.d(ue,{core:()=>ut,layout:()=>qt,menus:()=>Yt,ui:()=>Xt});var ut=nt(3921),qt=nt(456),Yt=nt(8794),Xt=nt(7091)},6784:(ae,ue,nt)=>{"use strict";nt.d(ue,{A:()=>BottomDrawer});var ut=nt(4542),qt=nt(1198),Yt=nt(5995);const Xt={opened:0,"half-opened":.7,closed:1};class BottomDrawer extends ut.WF{constructor(){super(),this._isDragging=!1,this.openness="half-opened"}firstUpdated(){super.firstUpdated(),this._boundTouchMove=this._onTouchMove.bind(this),this._boundTouchEnd=this._onTouchEnd.bind(this),this._drawerHeight=window.innerHeight-30;const ae=this._getDrawer();ae&&(ae.style.height=`${this._drawerHeight}px`,ae.style.maxHeight=`${this._drawerHeight}px`,(0,Yt.onceParentAvailable)(this).then((()=>this._parent.onceReady())).then((()=>{var ae,ue;null===(ae=this._parent.map)||void 0===ae||ae.addEventListener("click",(()=>this.openness="closed")),null===(ue=this._parent.psv)||void 0===ue||ue.addEventListener("click",(()=>this.openness="closed"))})))}attributeChangedCallback(ae,ue,nt){if(super.attributeChangedCallback(ae,ue,nt),"openness"===ae){if("opened"!==nt){const ae=this.shadowRoot.querySelector(".content");ae&&(ae.scrollTop=0)}const ae=this._getDrawer();ae&&(ae.style.transform=null)}}disconnectedCallback(){super.disconnectedCallback(),this._cleanupTouchListeners()}_getDrawer(){var ae;return null===(ae=this.shadowRoot)||void 0===ae?void 0:ae.querySelector(".drawer")}_onHandleClick(){"opened"===this.openness?this.openness="closed":"half-opened"===this.openness?this.openness="opened":"closed"===this.openness&&(this.openness="half-opened")}_onTouchStart(ae){this._isDragging=!0,this._startFingerY=ae.touches[0].clientY,this._deltaFingerY=0,this._drawerY=this._drawerHeight*Xt[this.openness],window.addEventListener("touchmove",this._boundTouchMove,{passive:!0}),window.addEventListener("touchend",this._boundTouchEnd),window.addEventListener("touchcancel",this._boundTouchEnd)}_onTouchMove(ae){if(!this._isDragging)return;const ue=this.shadowRoot.querySelector(".content");ue.scrollHeight>ue.offsetHeight&&ue.scrollTop>0?this._updateDrawerTransform(0):(this._deltaFingerY=ae.touches[0].clientY-this._startFingerY,this._updateDrawerTransform(this._drawerY+this._deltaFingerY))}_onTouchEnd(ae){(this._isDragging&&!(Math.abs(this._deltaFingerY)<30)||ae.target.closest(".handle"))&&(ae.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(ae){let ue=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const nt=this._getDrawer();nt&&(ae=Math.max(0,Math.min(ae,this._drawerHeight-30)),ue&&(this._deltaFingerY<0?"closed"===this.openness?Math.abs(this._deltaFingerY)>this._drawerHeight*(1-Xt["half-opened"])?this.openness="opened":this.openness="half-opened":this.openness="opened":this.openness="closed",this._drawerY=null,ae=Math.max(0,Math.min(Xt[this.openness]*this._drawerHeight,this._drawerHeight-30))),nt.style.transform=`translateY(${ae}px)`)}render(){const ae={drawer:!0,[this.openness]:!0,dragging:this._isDragging};return ut.qy`
12
+ !function(ae,ue){"object"===typeof exports&&"object"===typeof module?module.exports=ue():"function"===typeof define&&define.amd?define("Panoramax",[],ue):"object"===typeof exports?exports.Panoramax=ue():ae.Panoramax=ue()}(this,(()=>(()=>{var ae={9039:(ae,ue,nt)=>{"use strict";nt.d(ue,{A:()=>Basic});var ut=nt(4542),qt=nt(5254),Yt=nt(4964),Xt=nt(7208),ys=nt(5995),Ec=nt(7343),lu=nt(2614),uu=nt.n(lu),_u=nt(8330);nt(1865),nt(3638);class Basic extends ut.WF{constructor(){let ae=arguments.length>0&&void 0!==arguments[0]&&arguments[0];super(),this.users=["geovisio"],this["map-style"]=this.getAttribute("map-style")||(0,Xt.MapTiles)(),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 ${_u.rE} (2a3367e)\n\n\ud83c\udd98 Issues can be reported at ${_u.Jk.O}`),ae||(this._isInternetFast=null,(0,Ec.isInternetFast)().then((ae=>this._isInternetFast=ae)))}connectedCallback(){super.connectedCallback(),this._t=(0,Yt.getTranslations)(this.lang),this.loader=(0,ys.createWebComp)("pnx-loader",{_parent:this,"no-label":(0,Ec.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()),Object.entries({map:"map-options",psv:"psv-options",fetchOptions:"fetch-options",mapstyle:"map-style"}).forEach((ae=>{let[ue,nt]=ae;this.getAttribute(ue)&&console.error(`Component attribute "${ue}" has been renamed into "${nt}". Old attribute "${ue}" is ignored.`)}))}_setupAPI(){if(this.loader=this.loader||(0,ys.createWebComp)("pnx-loader",{_parent:this}),!this.endpoint)return void console.warn("No endpoint is defined");this._loadsAPI=this.endpoint;let ae=this.endpoint;try{this["map-style"]=JSON.parse(this["map-style"])}catch(nt){}try{this.api=new qt.A(this.endpoint,{users:this.users,fetch:this["fetch-options"],style:this["map-style"]}),this.api.onceReady().then((()=>{if(ae!=this._loadsAPI||!this.api)return;let ue=this.api.getUnavailableFeatures(),nt=this.api.getAvailableFeatures();nt=0===ue.length?"\u2705 All features available":"\u2705 Available features: "+nt.join(", "),ue=0===ue.length?"":"\ud83d\udeab Unavailable features: "+ue.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 ${nt}\n ${ue}\n`.trim())})).catch((ae=>this.loader.dismiss(ae,this._t.pnx.error_api))).finally((()=>delete this._loadsAPI))}catch(nt){var ue;delete this._loadsAPI,null!==(ue=this.loader)&&void 0!==ue&&ue.dismiss?this.loader.dismiss(nt,this._t.pnx.error_api):console.error(nt)}}onceReady(){throw new Error("You must override this method on sub-class")}onceAPIReady(){return this.api?this.api.onceReady():new Promise((ae=>setTimeout(ae,100))).then(this.onceAPIReady.bind(this))}createRenderRoot(){return this}attributeChangedCallback(ae,ue,nt){if(super.attributeChangedCallback(ae,ue,nt),"endpoint"===ae&&(this._loadsAPI&&nt&&this._loadsAPI===nt||this.api&&this.api._endpoint===nt||!nt||((this._loadsAPI||this.api)&&(delete this.api,delete this._loadsAPI),this._setupAPI())),["picture","sequence"].includes(ae)){let ut,qt,Yt,Xt;"picture"===ae?(ut=this.sequence,Yt=this.sequence,qt=nt,Xt=ue):(ut=nt,Yt=ue,qt=this.picture,Xt=this.picture),this.dispatchEvent(new CustomEvent("select",{bubbles:!0,composed:!0,detail:{seqId:ut,picId:qt,prevSeqId:Yt,prevPicId:Xt}}))}}getClassName(){return"Basic"}select(){let ae=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,ue=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=ue,this.sequence=ae}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 ut.qy`<p>Should not be used directly, use Viewer/CoverageMap/Editor instead</p>`}getSubComponentsNames(){return["loader","api"]}addEventListener(ae,ue,nt){let ut=ae.split(":").shift();if(ut&&this.getSubComponentsNames().includes(ut)){var qt;const Yt=ae.substring(ut.length+1);null!==(qt=this[ut])&&void 0!==qt&&qt.addEventListener?this[ut].addEventListener(Yt,ue,nt):setTimeout((()=>this.addEventListener(ae,ue,nt)),50)}else super.addEventListener(ae,ue,nt)}static GetJSONConverter(){return{fromAttribute:ae=>null===ae||""===ae?null:"object"===typeof ae||Array.isArray(ae)?ae:uu().parse(ae),toAttribute:ae=>null===ae||""===ae?"":"string"===typeof ae?ae:uu().stringify(ae)}}}Basic.properties={picture:{type:String,reflect:!0},sequence:{type:String,reflect:!0},"fetch-options":{converter:Basic.GetJSONConverter()},users:{type:Array,reflect:!0},"map-style":{type:String},lang:{type:String},endpoint:{type:String}}},153:(ae,ue,nt)=>{"use strict";nt.d(ue,{A:()=>CoverageMap});var ut=nt(9039),qt=nt(5642),Yt=nt(8340),Xt=nt(927),ys=(nt(7776),nt(2118));class CoverageMap extends ut.A{constructor(){super(),this._mapContainer=document.createElement("div"),this.onceAPIReady().then((()=>{this.loader.setAttribute("value",30),this._initParams=new ys.Ay(ys.Ay.GetComponentProperties(CoverageMap,this)),this._initMap()}))}disconnectedCallback(){var ae;super.disconnectedCallback(),null===(ae=this.map)||void 0===ae||ae.destroy()}getClassName(){return"CoverageMap"}onceReady(){return this.map&&this.map.waitForEnoughMapLoaded?this.map.waitForEnoughMapLoaded():new Promise((ae=>setTimeout(ae,100))).then(this.onceReady.bind(this))}render(){return[this.loader,this._mapContainer]}getSubComponentsNames(){const ae=super.getSubComponentsNames();return ae.push("map"),ae}_initMap(){class MyMap extends qt.A{_getLayerStyleProperties(ae){return"pictures_symbols"===ae?{layout:{visibility:"none"}}:super._getLayerStyleProperties(ae)}}this.map=new MyMap(this,this._mapContainer,Object.assign({},this._initParams.getMapInit(),{hash:!0})),this.map.addControl(new Xt.NavigationControl({showCompass:!1})),this.loader.setAttribute("value",70),this.addEventListener("select",this._onSelect.bind(this)),this.map.on("picture-click",(ae=>this.select(ae.seqId,ae.picId))),this.map.on("sequence-click",(ae=>this.select(ae.seqId))),this.map.waitForEnoughMapLoaded().then((async()=>{await(0,ys.mK)(this.map,this._initParams.getMapPostInit()),this.map.reloadLayersStyles(),this.loader.dismiss()}))}_onSelect(ae){if(ae.detail.picId||ae.detail.seqId){const ue=ae.detail.picId?"pictures":"sequences",nt=this.map.queryRenderedFeatures({layers:[...this.map._userLayers].map((ae=>(0,Yt.getUserLayerId)(ae,ue))),filter:["==",["get","id"],ae.detail.picId||ae.detail.seqId]});nt.length>=0&&null!=nt[0]&&this.map._attachPreviewToPictures({features:nt},ue)}}}CoverageMap.properties={"map-options":{converter:ut.A.GetJSONConverter()},...ut.A.properties},customElements.define("pnx-coverage-map",CoverageMap)},1752:(ae,ue,nt)=>{"use strict";nt.d(ue,{A:()=>Editor});nt(7365);var ut=nt(9039),qt=nt(5642),Yt=nt(9048),Xt=nt(508),ys=nt(8340),Ec=nt(1545),lu=nt(5995);const uu="sequence-headings";class Editor extends ut.A{constructor(){super(),this.raster=null,this.background="streets",this.users=[],this._psvContainer=document.createElement("div"),this._psvContainer.setAttribute("slot","bg"),this._mapContainer=document.createElement("div"),this._mapContainer.setAttribute("slot","bg"),this.grid=(0,lu.createWebComp)("pnx-cornered-grid"),this.grid.appendChild(this._psvContainer),this.grid.appendChild(this._mapContainer),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()}))}disconnectedCallback(){var ae,ue;super.disconnectedCallback(),null===(ae=this.map)||void 0===ae||ae.destroy(),null===(ue=this.psv)||void 0===ue||ue.destroy()}getClassName(){return"Editor"}onceReady(){var ae,ue;return this.map&&this.psv&&null!==(ae=(ue=this.map).loaded)&&void 0!==ae&&ae.call(ue)?Promise.resolve():new Promise((ae=>setTimeout(ae,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(),this._moveChildToGrid(),window.addEventListener("DOMContentLoaded",(()=>{this._moveChildToGrid()}),{once:!0})}attributeChangedCallback(ae,ue,nt){"users"===ae&&Array.isArray(nt)&&nt.length>0?console.warn("Parameters users can't be changed in Editor, only selected sequence can be visible"):super.attributeChangedCallback(ae,ue,nt)}render(){return[this.loader,this.grid]}getSubComponentsNames(){return super.getSubComponentsNames().concat(["map","psv","grid"])}_initPSV(){try{this.psv=new Yt.Ay(this,this._psvContainer),this.psv._myVTour.datasource.nodeResolver=this._getNode.bind(this)}catch(ae){let ue=Ec.IJ.isWebGLSupported?this._t.pnx.error_psv:this._t.pnx.error_webgl;this.loader.dismiss(ae,ue)}}_initMap(){try{this.map=new qt.A(this,this._mapContainer,{raster:this.raster,background:this.background,supplementaryStyle:this._createMapStyle(),zoom:15,picMarkerDraggable:!0}),(0,ys.linkMapAndPhoto)(this),this.loader.setAttribute("value",50),this._loadSequence(),this.map.once("load",(()=>{this.map.hasTwoBackgrounds()&&this._addMapBackgroundWidget(),this._bindPicturesEvents()}));const ae=this.map._picMarker.setRotation.bind(this.map._picMarker);this.map._picMarker.setRotation=ue=>(ue=void 0===this._lastRelHeading?ue:ue+this._lastRelHeading-this.psv.getPictureRelativeHeading(),ae(ue))}catch(ae){this.loader.dismiss(ae,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:{...ys.VECTOR_STYLES.SEQUENCES.layout},paint:{...ys.VECTOR_STYLES.SEQUENCES.paint}},{id:"geovisio_editor_pictures",type:"circle",source:"geovisio_editor_sequences",layout:{...ys.VECTOR_STYLES.PICTURES.layout},paint:{...ys.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((ae=>{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=ae.features,this.map.getSource("geovisio_editor_sequences").setData({type:"FeatureCollection",features:[{id:this.sequence,type:"Feature",properties:{id:this.sequence},geometry:{type:"LineString",coordinates:ae.features.map((ae=>ae.geometry.coordinates))}},...ae.features.map((ae=>(ae.properties.id=ae.id,ae.properties.sequences=[this.sequence],ae)))]}),this.picture){const ue=ae.features.find((ae=>ae.id===this.picture));ue?(this.select(this.sequence,this.picture,!0),this.map.jumpTo({center:ue.geometry.coordinates,zoom:18})):console.log("Picture with ID",ue,"was not found")}else{const ue=[...ae.features[0].geometry.coordinates,...ae.features[0].geometry.coordinates];for(let nt=1;nt<ae.features.length;nt++){const ut=ae.features[nt].geometry.coordinates;ut[0]<ue[0]&&(ue[0]=ut[0]),ut[1]<ue[1]&&(ue[1]=ut[1]),ut[0]>ue[2]&&(ue[2]=ut[0]),ut[1]>ue[3]&&(ue[3]=ut[1])}this.map.fitBounds(ue,{animate:!1})}})).catch((ae=>this.loader.dismiss(ae,this._t.pnx.error_api)))}_getNode(ae){const ue=this._sequenceData.find((ue=>ue.properties.id===ae)),nt=ue?(0,Xt.apiFeatureToPSVNode)(ue,this._t,this._isInternetFast,void 0,(ae=>this.api.cleanResourceURL(ae))):null;return nt&&delete nt.links,nt}_addMapBackgroundWidget(){const ae=(0,lu.createWebComp)("pnx-map-background",{_parent:this,size:"sm",slot:"bottom-left"});this.grid.appendChild(ae)}_moveChildToGrid(){Array.from(this.querySelectorAll("[slot]")).forEach((ae=>{var ue;null!==(ue=ae.tagName)&&void 0!==ue&&ue.toLowerCase().startsWith("pnx-")&&(ae._parent=this,ae._t=this._t),this.grid.appendChild(ae)}))}previewSequenceHeadingChange(ae){const ue=void 0!==this.map.getLayer(uu);if(this.map._picMarkerPreview.remove(),void 0===ae)return delete this._lastRelHeading,ue&&this.map.setLayoutProperty(uu,"visibility","none"),void(this.picture&&this.map._picMarker.setRotation(this.psv.getXY().x));this._lastRelHeading=ae,ue||this.map.addLayer({id:uu,type:"symbol",source:"geovisio_editor_sequences",layout:{"icon-image":"pnx-marker","icon-overlap":"always","icon-size":.8}});const nt=-this.psv.getPictureRelativeHeading();this.map.setLayoutProperty(uu,"visibility","visible"),this.map.setLayoutProperty(uu,"icon-rotate",["+",["get","view:azimuth"],nt,ae]);const ut=[["==",["geometry-type"],"Point"]];this.picture&&ut.push(["!=",["get","id"],this.picture]),this.map.setFilter(uu,["all",...ut]),this.picture&&this.map._picMarker.setRotation(this.psv.getXY().x)}_onSelect(){void 0!==this._lastRelHeading&&this.previewSequenceHeadingChange(this._lastRelHeading)}}Editor.properties={raster:{converter:ut.A.GetJSONConverter()},background:{type:String},...ut.A.properties},customElements.define("pnx-editor",Editor)},3407:(ae,ue,nt)=>{"use strict";nt.d(ue,{$p:()=>_u,Ay:()=>PhotoViewer,RD:()=>wu});nt(970);var ut=nt(1545),qt=nt(4451),Yt=nt(9039),Xt=nt(9048),ys=nt(5995),Ec=nt(7343),lu=nt(2118),uu=nt(4207);const _u=20,vu=Math.PI/6,wu=["pnx-mini","pnx-widget-player","pnx-widget-zoom"];class PhotoViewer extends Yt.A{constructor(){super(),this["psv-options"]={},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,ys.createWebComp)("pnx-cornered-grid"),this.psvContainer=document.createElement("div"),this.psvContainer.setAttribute("slot","bg"),this.grid.appendChild(this.psvContainer),this.popup=(0,ys.createWebComp)("pnx-popup",{_parent:this,onclose:this._onPopupClose.bind(this)}),this.tabindex=0,this._sequencesMetadata={}}_createInitParamsHandler(){var ae,ue;this._initParams=new lu.Ay(lu.Ay.GetComponentProperties(PhotoViewer,this),Object.assign({},null===(ae=this.urlHandler)||void 0===ae?void 0:ae.currentURLParams(),null===(ue=this.urlHandler)||void 0===ue?void 0:ue.currentURLParams(!0)),{disableAnnotations:localStorage.getItem(Ec.DISABLE_ANNOTATIONS_PARAM)})}_initWidgets(){"false"!==this._initParams.getParentPostInit().widgets&&((0,Ec.isInIframe)()||(this.grid.appendChild((0,ys.createWebComp)("pnx-widget-player",{slot:"top",_parent:this,class:"pnx-only-psv pnx-print-hidden",size:this.isHeightSmall()?"md":"xl"})),this.grid.appendChild((0,ys.createWebComp)("pnx-annotations-switch",{slot:"top",_parent:this,class:"pnx-only-psv pnx-print-hidden",size:this.isHeightSmall()?"md":"xl"}))),(0,Ec.isInIframe)()?(this.legend=(0,ys.createWebComp)("pnx-widget-legend",{slot:"bottom-right",light:!0,_parent:this,focus:this._initParams.getParentPostInit().focus,picture:this._initParams.getParentPostInit().picture}),this.grid.appendChild(this.legend)):this.isWidthSmall()?(this.legend=(0,ys.createWebComp)("pnx-picture-legend",{_parent:this}),this.bottomDrawer=(0,ys.createWebComp)("pnx-bottom-drawer",{slot:"bottom",_parent:this,class:this._initParams.getParentPostInit().willLoadPicture?void 0:"pnx-hidden"}),this.bottomDrawer.appendChild(this.legend),this.grid.appendChild(this.bottomDrawer),this.addEventListener("select",(ae=>{(0,Ec.isNullId)(ae.detail.picId)?this.bottomDrawer.classList.add("pnx-hidden"):this.bottomDrawer.classList.remove("pnx-hidden")}))):(this.legend=(0,ys.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,ys.createWebComp)("pnx-widget-zoom",{slot:"bottom-right",class:"pnx-print-hidden",_parent:this})),this.grid.appendChild(this.legend)))}connectedCallback(){super.connectedCallback(),this.presetsManager=new uu.A(this.lang),this["url-parameters"]&&"false"!==this["url-parameters"]&&(this.urlHandler=new qt.A(this),this.onceReady().then((()=>{this.urlHandler.listenToChanges(),this.urlHandler._onParentChange()}))),this.onceAPIReady().then(this._postAPIInit.bind(this)),this._moveChildToGrid(),window.addEventListener("DOMContentLoaded",(()=>{this._moveChildToGrid()}),{once:!0})}disconnectedCallback(){var ae,ue;super.disconnectedCallback(),null===(ae=this.urlHandler)||void 0===ae||ae.destroy(),null===(ue=this.psv)||void 0===ue||ue.destroy(),document.body.removeEventListener("click",this._toggleKeyboardBasedOnFocus),window.removeEventListener("keypress",this._toggleKeyboardBasedOnFocus)}getClassName(){return"PhotoViewer"}onceReady(){return this.oncePSVReady().then((()=>this._initParams.getParentPostInit().willLoadPicture&&!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 ae;return new Promise((ue=>{ae=setInterval((()=>{this.psv&&"object"===typeof this.psv&&(this.psv.container?(clearInterval(ae),ue()):this.psv.addEventListener&&this.psv.addEventListener("ready",(()=>{clearInterval(ae),ue()}),{once:!0}))}),250)}))}onceFirstPicLoaded(){return this.oncePSVReady().then((()=>this.psv.getPictureMetadata()?Promise.resolve():new Promise((ae=>{this.psv.addEventListener("picture-loaded",ae,{once:!0})}))))}async _postAPIInit(){this.loader.setAttribute("value",30),this._createInitParamsHandler();const ae=this._initParams.getParentPostInit();this._initPSV(),this._initWidgets(),(0,lu.ai)(this,ae),ae.keyboardShortcuts&&this._handleKeyboardManagement(),ae.willLoadPicture?this.psv.getPictureMetadata()?this.loader.dismiss():this.psv.addEventListener("picture-loaded",(()=>this.loader.dismiss()),{once:!0}):this.loader.dismiss()}_initPSV(){try{this.psv=new Xt.Ay(this,this.psvContainer,{shouldGoFast:this._psvShouldGoFast.bind(this),keyboard:"always",keyboardActions:{...ut.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:()=>{var ae;return null===(ae=this._toggleFocus)||void 0===ae?void 0:ae.call(this)},7:()=>{var ae;return null===(ae=this._toggleFocus)||void 0===ae?void 0:ae.call(this)},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,lu.Vy)(this.psv,this._initParams.getPSVPostInit())})),this.psv.addEventListener("sequence-playing",(()=>this.classList.add("pnx-playing"))),this.psv.addEventListener("sequence-stopped",(()=>this.classList.remove("pnx-playing")))}catch(ae){let ue=ut.IJ.isWebGLSupported?this._t.pnx.error_psv:this._t.pnx.error_webgl;this.loader.dismiss(ae,ue)}}_enableKeyboard(){this.psv.startKeyboardControl()}_disableKeyboard(){this.psv.stopKeyboardControl()}_toggleKeyboardBasedOnFocus(ae){const ue=(null===ae||void 0===ae?void 0:ae.target)||document.activeElement;if(this.contains(ue)){for(let ae of this.grid.childNodes)if("bg"!==ae.getAttribute("slot")&&!wu.includes(ae.tagName.toLowerCase())&&ae.contains(ue))return void this._disableKeyboard();this._enableKeyboard()}else this._disableKeyboard()}_handleKeyboardManagement(){window.addEventListener("click",(ae=>this._toggleKeyboardBasedOnFocus(ae))),window.addEventListener("keypress",this._toggleKeyboardBasedOnFocus.bind(this)),this.popup.addEventListener("open",this._disableKeyboard.bind(this)),this.popup.addEventListener("close",this._enableKeyboard.bind(this)),this.psv.addEventListener("click",this._enableKeyboard.bind(this));for(let ae of this.grid.childNodes)"bg"===ae.getAttribute("slot")||wu.includes(ae.tagName.toLowerCase())||(ae.addEventListener("focusin",this._disableKeyboard.bind(this)),ae.addEventListener("focusout",(()=>{null===this.popup.getAttribute("visible")&&this._enableKeyboard()})))}_psvShouldGoFast(){return this.psv._sequencePlaying&&this.psv.getTransitionDuration()<1e3}_moveChildToGrid(){Array.from(this.querySelectorAll("[slot]")).forEach((ae=>{var ue;null!==(ue=ae.tagName)&&void 0!==ue&&ue.toLowerCase().startsWith("pnx-")&&(ae._parent=this,ae._t=this._t),"editors"===ae.getAttribute("slot")?this.onceReady().then((()=>{var ue;return null===(ue=this.legend)||void 0===ue?void 0:ue.appendChild(ae)})):this.grid.appendChild(ae)}))}setPopup(ae){let ue=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;ae?this.popup.setAttribute("visible",""):this.popup.removeAttribute("visible"),this.popup.innerHTML="","string"===typeof ue?this.popup.innerHTML=ue:Array.isArray(ue)&&ue.forEach((ae=>this.popup.appendChild(ae)))}_onPopupClose(){this.dispatchEvent(new CustomEvent("focus-changed",{detail:{focus:this.map&&this.isMapWide()?"map":"pic"}}))}_showQualityScoreDoc(){this.setPopup(!0,[(0,ys.createWebComp)("pnx-quality-score-doc",{_t:this._t})])}_showReportForm(){if(!this.psv.getPictureMetadata())throw new Error("No picture currently selected");this.setPopup(!0,[(0,ys.createWebComp)("pnx-report-form",{_parent:this})])}_showShareOptions(){this.setPopup(!0,[(0,ys.createWebComp)("pnx-share-menu",{_parent:this})])}_showSemanticsDoc(){this.setPopup(!0,[(0,ys.createWebComp)("pnx-semantics-doc",{_t:this._t})])}moveCenter(){this.psv.getPictureMetadata()&&this._psvAnimate({speed:Xt.LM,yaw:0,pitch:0,zoom:Xt.cS})}moveLeft(){this._moveToDirection("left")}moveRight(){this._moveToDirection("right")}moveUp(){this._moveToDirection("up")}moveDown(){this._moveToDirection("down")}_moveToDirection(ae){let ue=this.psv.getPosition();switch(ae){case"up":ue.pitch+=vu;break;case"left":ue.yaw-=vu;break;case"down":ue.pitch-=vu;break;case"right":ue.yaw+=vu}this._psvAnimate({speed:Xt.LM,...ue})}_psvAnimate(ae){this._lastPsvAnim&&this._lastPsvAnim.cancel(),this._lastPsvAnim=this.psv.animate(ae)}addEventListener(ae,ue,nt){super.addEventListener(ae,ue,nt)}}PhotoViewer.properties={"psv-options":{converter:Yt.A.GetJSONConverter()},widgets:{type:String},"url-parameters":{type:String},"keyboard-shortcuts":{type:String},tabindex:{type:Number},...Yt.A.properties},customElements.define("pnx-photo-viewer",PhotoViewer)},8743:(ae,ue,nt)=>{"use strict";nt.d(ue,{A:()=>Viewer});nt(9616);var ut=nt(8340),qt=nt(3407),Yt=nt(2771),Xt=nt(7343),ys=nt(5995),Ec=nt(9683),lu=nt(2e3),uu=nt(9438),_u=nt(2118);const vu=100;class Viewer extends qt.Ay{constructor(){super(),this["map-options"]=!0,this.geocoder=this.getAttribute("geocoder")||"nominatim",this.mini=(0,ys.createWebComp)("pnx-mini",{slot:"bottom-left",_parent:this,onexpand:this._onMiniExpand.bind(this),collapsed:!!(0,Xt.isNullId)(this.picture)||void 0}),this.mini.addEventListener("expand",this._toggleFocus.bind(this)),this.grid.appendChild(this.mini),this.mapContainer=document.createElement("div"),this.tabindex=0}_createInitParamsHandler(){var ae,ue;this._initParams=new _u.Ay(_u.Ay.GetComponentProperties(Viewer,this),Object.assign({},null===(ae=this.urlHandler)||void 0===ae?void 0:ae.currentURLParams(),null===(ue=this.urlHandler)||void 0===ue?void 0:ue.currentURLParams(!0)),{map:(0,ut.getMapParamsFromLocalStorage)(),disableAnnotations:localStorage.getItem(Xt.DISABLE_ANNOTATIONS_PARAM)})}_initWidgets(){var ae,ue;"false"!==this._initParams.getParentPostInit().widgets&&(this.grid.appendChild((0,ys.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})),(0,Xt.isInIframe)()?(this.legend=(0,ys.createWebComp)("pnx-widget-legend",{slot:"bottom-right",light:!0,_parent:this,focus:this._initParams.getParentPostInit().focus,picture:this._initParams.getParentPostInit().picture}),this.grid.appendChild(this.legend)):this.isWidthSmall()?(this.legend=(0,ys.createWebComp)("pnx-picture-legend",{_parent:this}),this.bottomDrawer=(0,ys.createWebComp)("pnx-bottom-drawer",{slot:"bottom",_parent:this,class:this._initParams.getParentPostInit().willLoadPicture?void 0:"pnx-hidden"}),this.bottomDrawer.appendChild(this.legend),this.grid.appendChild(this.bottomDrawer),this.addEventListener("select",(ae=>{(0,Xt.isNullId)(ae.detail.picId)?this.bottomDrawer.classList.add("pnx-hidden"):this.bottomDrawer.classList.remove("pnx-hidden")}))):(this.legend=(0,ys.createWebComp)("pnx-widget-legend",{slot:this.isWidthSmall()?"top":"top-left",_parent:this,focus:this._initParams.getParentPostInit().focus,picture:this._initParams.getParentPostInit().picture}),this._miniPicLegend=(0,ys.createWebComp)("pnx-mini-picture-legend",{_parent:this}),this.grid.appendChild(this.legend)),(0,Xt.isInIframe)()||(this.grid.appendChild((0,ys.createWebComp)("pnx-widget-player",{slot:"top",_parent:this,class:"pnx-only-psv pnx-print-hidden",size:this.isHeightSmall()?"md":"xl"})),this.grid.appendChild((0,ys.createWebComp)("pnx-annotations-switch",{slot:"top",_parent:this,class:"pnx-only-psv pnx-print-hidden",size:this.isHeightSmall()?"md":"xl"})),this.grid.appendChild((0,ys.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,ys.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===(ae=this.map)||void 0===ae||null===(ue=ae._hasQualityScore)||void 0===ue?void 0:ue.call(ae))||!1,class:"pnx-only-map pnx-print-hidden"})),this.grid.appendChild((0,ys.createWebComp)("pnx-widget-maplayers",{slot:"top-right",_parent:this,class:"pnx-only-map pnx-print-hidden"}))))}disconnectedCallback(){var ae;super.disconnectedCallback(),null===(ae=this.map)||void 0===ae||ae.destroy()}getClassName(){return"Viewer"}getSubComponentsNames(){return super.getSubComponentsNames().concat(["mini","map"])}onceReady(){return Promise.all([this.oncePSVReady(),this.onceMapReady()]).then((()=>this._initParams.getParentPostInit().willLoadPicture&&!this.psv.getPictureMetadata()?this.onceFirstPicLoaded():Promise.resolve()))}attributeChangedCallback(ae,ue,nt){var ut,qt;if(super.attributeChangedCallback(ae,ue,nt),"picture"===ae)if(null===(ut=this.legend)||void 0===ut||null===(qt=ut.setAttribute)||void 0===qt||qt.call(ut,"picture",nt),(0,Xt.isNullId)(ue)&&!(0,Xt.isNullId)(nt)&&this.mini.removeAttribute("collapsed"),(0,Xt.isNullId)(nt))this.map&&this.isMapWide()?this.mini.classList.add("pnx-hidden"):this.map&&!this.isMapWide()&&this._setFocus("map");else if((0,Xt.isNullId)(ue)&&this.sequence==this._initParams.getParentPostInit().sequence&&!this._initParams.getParentPostInit().picture){var Yt,ys;this.mini.classList.remove("pnx-hidden"),this.mini.removeAttribute("collapsed"),"closed"===(null===(Yt=this.bottomDrawer)||void 0===Yt||null===(ys=Yt.getAttribute)||void 0===ys?void 0:ys.call(Yt,"openness"))&&this.bottomDrawer.setAttribute("openness","half-opened")}else{var Ec,lu;if(this.mini.classList.remove("pnx-hidden"),(0,Xt.isNullId)(ue))this._setFocus("pic"),"closed"===(null===(Ec=this.bottomDrawer)||void 0===Ec||null===(lu=Ec.getAttribute)||void 0===lu?void 0:lu.call(Ec,"openness"))&&this.bottomDrawer.setAttribute("openness","half-opened")}"focus"===ae&&this._setFocus(nt)}onceMapReady(){if(!this.map)return Promise.resolve();let ae;return new Promise((ue=>{ae=setInterval((()=>{var nt,ut,qt;"object"===typeof this.map&&(null!==(nt=this.map)&&void 0!==nt&&null!==(ut=nt.loaded)&&void 0!==ut&&ut.call(nt)?(clearInterval(ae),ue()):null!==(qt=this.map)&&void 0!==qt&&qt.once&&this.map.once("render",(()=>{clearInterval(ae),ue()})))}),250)}))}async _initMap(){await new Promise((ae=>{this.map=new Yt.A(this,this.mapContainer,this._initParams.getMapInit()),(0,ut.saveMapParamsToLocalStorage)(this.map),this.map.once("users-changed",(()=>{this.loader.setAttribute("value",75),ae()}))})),await(0,_u.mK)(this.map,this._initParams.getMapPostInit()),(0,ut.initMapKeyboardHandler)(this),(0,ut.linkMapAndPhoto)(this)}async _postAPIInit(){this.loader.setAttribute("value",30),this._createInitParamsHandler();const ae=this._initParams.getParentPostInit();this._initPSV(),await this._initMap(),this._initWidgets(),this._moveChildToGrid(),(0,_u.iz)(this,ae),ae.keyboardShortcuts&&this._handleKeyboardManagement(),ae.willLoadPicture?this.psv.addEventListener("picture-loaded",(ue=>{(0,_u.iz)(this,ae),this.loader.dismiss()}),{once:!0}):this.loader.dismiss()}_enableKeyboard(){this.map&&this.isMapWide()?this._enableKeyboardMap():this._enableKeyboardPSV()}_enableKeyboardMap(){this.psv.stopKeyboardControl(),this.map.keyboard.enable()}_enableKeyboardPSV(){this.psv.startKeyboardControl(),this.map.keyboard.disable()}_disableKeyboard(){this.psv.stopKeyboardControl(),this.map.keyboard.disable()}_toggleKeyboardBasedOnFocus(ae){const ue=(null===ae||void 0===ae?void 0:ae.target)||document.activeElement;if(this.contains(ue)){for(let ae of this.grid.childNodes)if("bg"!==ae.getAttribute("slot")&&!qt.RD.includes(ae.tagName.toLowerCase())&&ae.contains(ue))return void this._disableKeyboard();this._enableKeyboard()}else this._disableKeyboard()}_handleKeyboardManagement(){window.addEventListener("click",(ae=>this._toggleKeyboardBasedOnFocus(ae))),window.addEventListener("keypress",this._toggleKeyboardBasedOnFocus.bind(this)),this.addEventListener("focus-changed",(ae=>{this.popup.getAttribute("visible")?this._disableKeyboard():"map"===ae.detail.focus?this._enableKeyboardMap():this._enableKeyboardPSV()})),this.popup.addEventListener("open",this._disableKeyboard.bind(this)),this.popup.addEventListener("close",this._enableKeyboard.bind(this)),this.psv.addEventListener("click",this._enableKeyboardPSV.bind(this));for(let ae of this.grid.childNodes)"bg"===ae.getAttribute("slot")||qt.RD.includes(ae.tagName.toLowerCase())||(ae.addEventListener("focusin",this._disableKeyboard.bind(this)),ae.addEventListener("focusout",(()=>{null===this.popup.getAttribute("visible")&&this._enableKeyboard()})))}moveCenter(){const ae=this.psv.getPictureMetadata();ae&&(this.map&&this.isMapWide()?this.map.flyTo({center:ae.gps,zoom:20}):super.moveCenter())}_moveToDirection(ae){if(this.map&&this.isMapWide()){let ue;switch(ae){case"up":ue=[0,-100];break;case"left":ue=[-100,0];break;case"down":ue=[0,vu];break;case"right":ue=[vu,0]}this.map.panBy(ue)}else super._moveToDirection(ae)}isMapWide(){return this.mapContainer.parentNode==this.grid}_setFocus(ae){var ue,nt,ut,qt;let Yt=arguments.length>1&&void 0!==arguments[1]&&arguments[1],uu=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if("map"===ae&&!this.map)throw new Error("Map is not enabled");if(!["map","pic"].includes(ae))throw new Error("Invalid focus value (should be pic or map)");if(this.focus=ae,(uu||("map"!==ae||!this.map||!this.isMapWide())&&("pic"!==ae||this.map&&this.isMapWide()))&&("map"===ae?(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,ys.fa)(Ec.pt),this._miniPicLegend&&this.mini.appendChild(this._miniPicLegend),(0,Xt.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._miniPicLegend&&this.mini.removeChild(this._miniPicLegend)),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,ys.fa)(lu.e5),this.psvContainer.focus()),null===this||void 0===this||null===(ue=this.map)||void 0===ue||null===(nt=ue.resize)||void 0===nt||nt.call(ue),this.psv.autoSize(),this.psv.forceRefresh(),null===(ut=this.legend)||void 0===ut||null===(qt=ut.setAttribute)||void 0===qt||qt.call(ut,"focus",this.focus),!Yt)){const ue=new CustomEvent("focus-changed",{detail:{focus:ae}});this.dispatchEvent(ue)}}_toggleFocus(){this._setFocus(this.isMapWide()?"pic":"map")}_onMiniExpand(){this.map.resize(),this.psv.autoSize()}_onMapFiltersChange(){var ae;const ue=(0,uu.qi)("#pnx-map-filters-menu"),nt=(0,uu.qi)("#pnx-map-theme"),qt=(0,ut.mapFiltersFormValues)(ue,nt,null===(ae=this.map)||void 0===ae?void 0:ae._hasQualityScore());this.map.setFilters(qt)}}Viewer.properties={"map-options":{converter:qt.Ay.GetJSONConverter()},focus:{type:String,reflect:!0},geocoder:{type:String},tabindex:{type:Number},...qt.Ay.properties},customElements.define("pnx-viewer",Viewer)},3921:(ae,ue,nt)=>{"use strict";nt.r(ue),nt.d(ue,{Basic:()=>ut.A,CoverageMap:()=>qt.A,Editor:()=>Yt.A,PhotoViewer:()=>ys.Ay,Viewer:()=>Xt.A});var ut=nt(9039),qt=nt(153),Yt=nt(1752),Xt=nt(8743),ys=nt(3407)},9341:(ae,ue,nt)=>{"use strict";nt.r(ue),nt.d(ue,{core:()=>ut,layout:()=>qt,menus:()=>Yt,ui:()=>Xt});var ut=nt(3921),qt=nt(456),Yt=nt(8794),Xt=nt(7091)},6784:(ae,ue,nt)=>{"use strict";nt.d(ue,{A:()=>BottomDrawer});var ut=nt(4542),qt=nt(1198),Yt=nt(5995);const Xt={opened:0,"half-opened":.7,closed:1};class BottomDrawer extends ut.WF{constructor(){super(),this._isDragging=!1,this.openness="half-opened"}firstUpdated(){super.firstUpdated(),this._boundTouchMove=this._onTouchMove.bind(this),this._boundTouchEnd=this._onTouchEnd.bind(this),this._drawerHeight=window.innerHeight-30;const ae=this._getDrawer();ae&&(ae.style.height=`${this._drawerHeight}px`,ae.style.maxHeight=`${this._drawerHeight}px`,(0,Yt.onceParentAvailable)(this).then((()=>this._parent.onceReady())).then((()=>{var ae,ue;null===(ae=this._parent.map)||void 0===ae||ae.addEventListener("click",(()=>this.openness="closed")),null===(ue=this._parent.psv)||void 0===ue||ue.addEventListener("click",(()=>this.openness="closed"))})))}attributeChangedCallback(ae,ue,nt){if(super.attributeChangedCallback(ae,ue,nt),"openness"===ae){if("opened"!==nt){const ae=this.shadowRoot.querySelector(".content");ae&&(ae.scrollTop=0)}const ae=this._getDrawer();ae&&(ae.style.transform=null)}}disconnectedCallback(){super.disconnectedCallback(),this._cleanupTouchListeners()}_getDrawer(){var ae;return null===(ae=this.shadowRoot)||void 0===ae?void 0:ae.querySelector(".drawer")}_onHandleClick(){"opened"===this.openness?this.openness="closed":"half-opened"===this.openness?this.openness="opened":"closed"===this.openness&&(this.openness="half-opened")}_onTouchStart(ae){this._isDragging=!0,this._startFingerY=ae.touches[0].clientY,this._deltaFingerY=0,this._drawerY=this._drawerHeight*Xt[this.openness],window.addEventListener("touchmove",this._boundTouchMove,{passive:!0}),window.addEventListener("touchend",this._boundTouchEnd),window.addEventListener("touchcancel",this._boundTouchEnd)}_onTouchMove(ae){if(!this._isDragging)return;const ue=this.shadowRoot.querySelector(".content");ue.scrollHeight>ue.offsetHeight&&ue.scrollTop>0?this._updateDrawerTransform(0):(this._deltaFingerY=ae.touches[0].clientY-this._startFingerY,this._updateDrawerTransform(this._drawerY+this._deltaFingerY))}_onTouchEnd(ae){(this._isDragging&&!(Math.abs(this._deltaFingerY)<30)||ae.target.closest(".handle"))&&(ae.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(ae){let ue=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const nt=this._getDrawer();nt&&(ae=Math.max(0,Math.min(ae,this._drawerHeight-30)),ue&&(this._deltaFingerY<0?"closed"===this.openness?Math.abs(this._deltaFingerY)>this._drawerHeight*(1-Xt["half-opened"])?this.openness="opened":this.openness="half-opened":this.openness="opened":this.openness="closed",this._drawerY=null,ae=Math.max(0,Math.min(Xt[this.openness]*this._drawerHeight,this._drawerHeight-30))),nt.style.transform=`translateY(${ae}px)`)}render(){const ae={drawer:!0,[this.openness]:!0,dragging:this._isDragging};return ut.qy`
13
13
  <div
14
14
  class=${(0,qt.H)(ae)}
15
15
  @touchstart="${this._onTouchStart}"
@@ -9,7 +9,7 @@
9
9
  * LICENSE file in the root directory of this source tree.
10
10
  *
11
11
  */
12
- !function(t,a){"object"===typeof exports&&"object"===typeof module?module.exports=a():"function"===typeof define&&define.amd?define("Panoramax",[],a):"object"===typeof exports?exports.Panoramax=a():t.Panoramax=a()}(this,(()=>(()=>{var t={9039:(t,a,A)=>{"use strict";A.d(a,{A:()=>Basic});var h=A(4542),p=A(5254),g=A(4964),m=A(7208),v=A(5995),_=A(7343),E=A(2614),x=A.n(E),w=A(8330);A(1865),A(3638);class Basic extends h.WF{constructor(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];super(),this.users=["geovisio"],this["map-style"]=this.getAttribute("map-style")||(0,m.MapTiles)(),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 ${w.rE} (613d379)\n\n\ud83c\udd98 Issues can be reported at ${w.Jk.O}`),t||(this._isInternetFast=null,(0,_.isInternetFast)().then((t=>this._isInternetFast=t)))}connectedCallback(){super.connectedCallback(),this._t=(0,g.getTranslations)(this.lang),this.loader=(0,v.createWebComp)("pnx-loader",{_parent:this,"no-label":(0,_.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()),Object.entries({map:"map-options",psv:"psv-options",fetchOptions:"fetch-options",mapstyle:"map-style"}).forEach((t=>{let[a,A]=t;this.getAttribute(a)&&console.error(`Component attribute "${a}" has been renamed into "${A}". Old attribute "${a}" is ignored.`)}))}_setupAPI(){if(this.loader=this.loader||(0,v.createWebComp)("pnx-loader",{_parent:this}),!this.endpoint)return void console.warn("No endpoint is defined");this._loadsAPI=this.endpoint;let t=this.endpoint;try{this["map-style"]=JSON.parse(this["map-style"])}catch(A){}try{this.api=new p.A(this.endpoint,{users:this.users,fetch:this["fetch-options"],style:this["map-style"]}),this.api.onceReady().then((()=>{if(t!=this._loadsAPI||!this.api)return;let a=this.api.getUnavailableFeatures(),A=this.api.getAvailableFeatures();A=0===a.length?"\u2705 All features available":"\u2705 Available features: "+A.join(", "),a=0===a.length?"":"\ud83d\udeab Unavailable features: "+a.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 ${A}\n ${a}\n`.trim())})).catch((t=>this.loader.dismiss(t,this._t.pnx.error_api))).finally((()=>delete this._loadsAPI))}catch(A){var a;delete this._loadsAPI,null!==(a=this.loader)&&void 0!==a&&a.dismiss?this.loader.dismiss(A,this._t.pnx.error_api):console.error(A)}}onceReady(){throw new Error("You must override this method on sub-class")}onceAPIReady(){return this.api?this.api.onceReady():new Promise((t=>setTimeout(t,100))).then(this.onceAPIReady.bind(this))}createRenderRoot(){return this}attributeChangedCallback(t,a,A){if(super.attributeChangedCallback(t,a,A),"endpoint"===t&&(this._loadsAPI&&A&&this._loadsAPI===A||this.api&&this.api._endpoint===A||!A||((this._loadsAPI||this.api)&&(delete this.api,delete this._loadsAPI),this._setupAPI())),["picture","sequence"].includes(t)){let h,p,g,m;"picture"===t?(h=this.sequence,g=this.sequence,p=A,m=a):(h=A,g=a,p=this.picture,m=this.picture),this.dispatchEvent(new CustomEvent("select",{bubbles:!0,composed:!0,detail:{seqId:h,picId:p,prevSeqId:g,prevPicId:m}}))}}getClassName(){return"Basic"}select(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,a=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=a,this.sequence=t}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 h.qy`<p>Should not be used directly, use Viewer/CoverageMap/Editor instead</p>`}getSubComponentsNames(){return["loader","api"]}addEventListener(t,a,A){let h=t.split(":").shift();if(h&&this.getSubComponentsNames().includes(h)){var p;const g=t.substring(h.length+1);null!==(p=this[h])&&void 0!==p&&p.addEventListener?this[h].addEventListener(g,a,A):setTimeout((()=>this.addEventListener(t,a,A)),50)}else super.addEventListener(t,a,A)}static GetJSONConverter(){return{fromAttribute:t=>null===t||""===t?null:"object"===typeof t||Array.isArray(t)?t:x().parse(t),toAttribute:t=>null===t||""===t?"":"string"===typeof t?t:x().stringify(t)}}}Basic.properties={picture:{type:String,reflect:!0},sequence:{type:String,reflect:!0},"fetch-options":{converter:Basic.GetJSONConverter()},users:{type:Array,reflect:!0},"map-style":{type:String},lang:{type:String},endpoint:{type:String}}},3407:(t,a,A)=>{"use strict";A.d(a,{$p:()=>w,Ay:()=>PhotoViewer});A(970);var h=A(1545),p=A(4451),g=A(9039),m=A(9048),v=A(5995),_=A(7343),E=A(2118),x=A(4207);const w=20,C=Math.PI/6,T=["pnx-mini","pnx-widget-player","pnx-widget-zoom"];class PhotoViewer extends g.A{constructor(){super(),this["psv-options"]={},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,v.createWebComp)("pnx-cornered-grid"),this.psvContainer=document.createElement("div"),this.psvContainer.setAttribute("slot","bg"),this.grid.appendChild(this.psvContainer),this.popup=(0,v.createWebComp)("pnx-popup",{_parent:this,onclose:this._onPopupClose.bind(this)}),this.tabindex=0,this._sequencesMetadata={}}_createInitParamsHandler(){var t,a;this._initParams=new E.Ay(E.Ay.GetComponentProperties(PhotoViewer,this),Object.assign({},null===(t=this.urlHandler)||void 0===t?void 0:t.currentURLParams(),null===(a=this.urlHandler)||void 0===a?void 0:a.currentURLParams(!0)),{disableAnnotations:localStorage.getItem(_.DISABLE_ANNOTATIONS_PARAM)})}_initWidgets(){"false"!==this._initParams.getParentPostInit().widgets&&((0,_.isInIframe)()||(this.grid.appendChild((0,v.createWebComp)("pnx-widget-player",{slot:"top",_parent:this,class:"pnx-only-psv pnx-print-hidden",size:this.isHeightSmall()?"md":"xl"})),this.grid.appendChild((0,v.createWebComp)("pnx-annotations-switch",{slot:"top",_parent:this,class:"pnx-only-psv pnx-print-hidden",size:this.isHeightSmall()?"md":"xl"}))),(0,_.isInIframe)()?(this.legend=(0,v.createWebComp)("pnx-widget-legend",{slot:"bottom-right",light:!0,_parent:this,focus:this._initParams.getParentPostInit().focus,picture:this._initParams.getParentPostInit().picture}),this.grid.appendChild(this.legend)):this.isWidthSmall()?(this.legend=(0,v.createWebComp)("pnx-picture-legend",{_parent:this}),this.bottomDrawer=(0,v.createWebComp)("pnx-bottom-drawer",{slot:"bottom",_parent:this,class:this._initParams.getParentPostInit().willLoadPicture?void 0:"pnx-hidden"}),this.bottomDrawer.appendChild(this.legend),this.grid.appendChild(this.bottomDrawer),this.addEventListener("select",(t=>{(0,_.isNullId)(t.detail.picId)?this.bottomDrawer.classList.add("pnx-hidden"):this.bottomDrawer.classList.remove("pnx-hidden")}))):(this.legend=(0,v.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,v.createWebComp)("pnx-widget-zoom",{slot:"bottom-right",class:"pnx-print-hidden",_parent:this})),this.grid.appendChild(this.legend)))}connectedCallback(){super.connectedCallback(),this.presetsManager=new x.A(this.lang),this["url-parameters"]&&"false"!==this["url-parameters"]&&(this.urlHandler=new p.A(this),this.onceReady().then((()=>{this.urlHandler.listenToChanges(),this.urlHandler._onParentChange()}))),this.onceAPIReady().then(this._postAPIInit.bind(this)),this._moveChildToGrid(),window.addEventListener("DOMContentLoaded",(()=>{this._moveChildToGrid()}),{once:!0})}disconnectedCallback(){var t,a;super.disconnectedCallback(),null===(t=this.urlHandler)||void 0===t||t.destroy(),null===(a=this.psv)||void 0===a||a.destroy(),document.body.removeEventListener("click",this._toggleKeyboardBasedOnFocus),window.removeEventListener("keypress",this._toggleKeyboardBasedOnFocus)}getClassName(){return"PhotoViewer"}onceReady(){return this.oncePSVReady().then((()=>this._initParams.getParentPostInit().willLoadPicture&&!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 t;return new Promise((a=>{t=setInterval((()=>{this.psv&&"object"===typeof this.psv&&(this.psv.container?(clearInterval(t),a()):this.psv.addEventListener&&this.psv.addEventListener("ready",(()=>{clearInterval(t),a()}),{once:!0}))}),250)}))}onceFirstPicLoaded(){return this.oncePSVReady().then((()=>this.psv.getPictureMetadata()?Promise.resolve():new Promise((t=>{this.psv.addEventListener("picture-loaded",t,{once:!0})}))))}async _postAPIInit(){this.loader.setAttribute("value",30),this._createInitParamsHandler();const t=this._initParams.getParentPostInit();this._initPSV(),this._initWidgets(),(0,E.ai)(this,t),t.keyboardShortcuts&&this._handleKeyboardManagement(),t.willLoadPicture?this.psv.getPictureMetadata()?this.loader.dismiss():this.psv.addEventListener("picture-loaded",(()=>this.loader.dismiss()),{once:!0}):this.loader.dismiss()}_initPSV(){try{this.psv=new m.Ay(this,this.psvContainer,{shouldGoFast:this._psvShouldGoFast.bind(this),keyboard:"always",keyboardActions:{...h.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:()=>{var t;return null===(t=this._toggleFocus)||void 0===t?void 0:t.call(this)},7:()=>{var t;return null===(t=this._toggleFocus)||void 0===t?void 0:t.call(this)},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,E.Vy)(this.psv,this._initParams.getPSVPostInit())})),this.psv.addEventListener("sequence-playing",(()=>this.classList.add("pnx-playing"))),this.psv.addEventListener("sequence-stopped",(()=>this.classList.remove("pnx-playing")))}catch(t){let a=h.IJ.isWebGLSupported?this._t.pnx.error_psv:this._t.pnx.error_webgl;this.loader.dismiss(t,a)}}_enableKeyboard(){this.psv.startKeyboardControl()}_disableKeyboard(){this.psv.stopKeyboardControl()}_toggleKeyboardBasedOnFocus(t){const a=(null===t||void 0===t?void 0:t.target)||document.activeElement;if(this.contains(a)){for(let t of this.grid.childNodes)if("bg"!==t.getAttribute("slot")&&!T.includes(t.tagName.toLowerCase())&&t.contains(a))return void this._disableKeyboard();this._enableKeyboard()}else this._disableKeyboard()}_handleKeyboardManagement(){window.addEventListener("click",(t=>this._toggleKeyboardBasedOnFocus(t))),window.addEventListener("keypress",this._toggleKeyboardBasedOnFocus.bind(this)),this.popup.addEventListener("open",this._disableKeyboard.bind(this)),this.popup.addEventListener("close",this._enableKeyboard.bind(this)),this.psv.addEventListener("click",this._enableKeyboard.bind(this));for(let t of this.grid.childNodes)"bg"===t.getAttribute("slot")||T.includes(t.tagName.toLowerCase())||(t.addEventListener("focusin",this._disableKeyboard.bind(this)),t.addEventListener("focusout",(()=>{null===this.popup.getAttribute("visible")&&this._enableKeyboard()})))}_psvShouldGoFast(){return this.psv._sequencePlaying&&this.psv.getTransitionDuration()<1e3}_moveChildToGrid(){Array.from(this.querySelectorAll("[slot]")).forEach((t=>{var a;null!==(a=t.tagName)&&void 0!==a&&a.toLowerCase().startsWith("pnx-")&&(t._parent=this,t._t=this._t),"editors"===t.getAttribute("slot")?this.onceReady().then((()=>{var a;return null===(a=this.legend)||void 0===a?void 0:a.appendChild(t)})):this.grid.appendChild(t)}))}setPopup(t){let a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;t?this.popup.setAttribute("visible",""):this.popup.removeAttribute("visible"),this.popup.innerHTML="","string"===typeof a?this.popup.innerHTML=a:Array.isArray(a)&&a.forEach((t=>this.popup.appendChild(t)))}_onPopupClose(){this.dispatchEvent(new CustomEvent("focus-changed",{detail:{focus:this.map&&this.isMapWide()?"map":"pic"}}))}_showQualityScoreDoc(){this.setPopup(!0,[(0,v.createWebComp)("pnx-quality-score-doc",{_t:this._t})])}_showReportForm(){if(!this.psv.getPictureMetadata())throw new Error("No picture currently selected");this.setPopup(!0,[(0,v.createWebComp)("pnx-report-form",{_parent:this})])}_showShareOptions(){this.setPopup(!0,[(0,v.createWebComp)("pnx-share-menu",{_parent:this})])}_showSemanticsDoc(){this.setPopup(!0,[(0,v.createWebComp)("pnx-semantics-doc",{_t:this._t})])}moveCenter(){this.psv.getPictureMetadata()&&this._psvAnimate({speed:m.LM,yaw:0,pitch:0,zoom:m.cS})}moveLeft(){this._moveToDirection("left")}moveRight(){this._moveToDirection("right")}moveUp(){this._moveToDirection("up")}moveDown(){this._moveToDirection("down")}_moveToDirection(t){let a=this.psv.getPosition();switch(t){case"up":a.pitch+=C;break;case"left":a.yaw-=C;break;case"down":a.pitch-=C;break;case"right":a.yaw+=C}this._psvAnimate({speed:m.LM,...a})}_psvAnimate(t){this._lastPsvAnim&&this._lastPsvAnim.cancel(),this._lastPsvAnim=this.psv.animate(t)}addEventListener(t,a,A){super.addEventListener(t,a,A)}}PhotoViewer.properties={"psv-options":{converter:g.A.GetJSONConverter()},widgets:{type:String},"url-parameters":{type:String},"keyboard-shortcuts":{type:String},tabindex:{type:Number},...g.A.properties},customElements.define("pnx-photo-viewer",PhotoViewer)},2504:(t,a,A)=>{"use strict";A.r(a),A.d(a,{layout:()=>h,menus:()=>p,ui:()=>g});var h=A(456),p=A(9015),g=A(6957)},6784:(t,a,A)=>{"use strict";A.d(a,{A:()=>BottomDrawer});var h=A(4542),p=A(1198),g=A(5995);const m={opened:0,"half-opened":.7,closed:1};class BottomDrawer extends h.WF{constructor(){super(),this._isDragging=!1,this.openness="half-opened"}firstUpdated(){super.firstUpdated(),this._boundTouchMove=this._onTouchMove.bind(this),this._boundTouchEnd=this._onTouchEnd.bind(this),this._drawerHeight=window.innerHeight-30;const t=this._getDrawer();t&&(t.style.height=`${this._drawerHeight}px`,t.style.maxHeight=`${this._drawerHeight}px`,(0,g.onceParentAvailable)(this).then((()=>this._parent.onceReady())).then((()=>{var t,a;null===(t=this._parent.map)||void 0===t||t.addEventListener("click",(()=>this.openness="closed")),null===(a=this._parent.psv)||void 0===a||a.addEventListener("click",(()=>this.openness="closed"))})))}attributeChangedCallback(t,a,A){if(super.attributeChangedCallback(t,a,A),"openness"===t){if("opened"!==A){const t=this.shadowRoot.querySelector(".content");t&&(t.scrollTop=0)}const t=this._getDrawer();t&&(t.style.transform=null)}}disconnectedCallback(){super.disconnectedCallback(),this._cleanupTouchListeners()}_getDrawer(){var t;return null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector(".drawer")}_onHandleClick(){"opened"===this.openness?this.openness="closed":"half-opened"===this.openness?this.openness="opened":"closed"===this.openness&&(this.openness="half-opened")}_onTouchStart(t){this._isDragging=!0,this._startFingerY=t.touches[0].clientY,this._deltaFingerY=0,this._drawerY=this._drawerHeight*m[this.openness],window.addEventListener("touchmove",this._boundTouchMove,{passive:!0}),window.addEventListener("touchend",this._boundTouchEnd),window.addEventListener("touchcancel",this._boundTouchEnd)}_onTouchMove(t){if(!this._isDragging)return;const a=this.shadowRoot.querySelector(".content");a.scrollHeight>a.offsetHeight&&a.scrollTop>0?this._updateDrawerTransform(0):(this._deltaFingerY=t.touches[0].clientY-this._startFingerY,this._updateDrawerTransform(this._drawerY+this._deltaFingerY))}_onTouchEnd(t){(this._isDragging&&!(Math.abs(this._deltaFingerY)<30)||t.target.closest(".handle"))&&(t.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(t){let a=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const A=this._getDrawer();A&&(t=Math.max(0,Math.min(t,this._drawerHeight-30)),a&&(this._deltaFingerY<0?"closed"===this.openness?Math.abs(this._deltaFingerY)>this._drawerHeight*(1-m["half-opened"])?this.openness="opened":this.openness="half-opened":this.openness="opened":this.openness="closed",this._drawerY=null,t=Math.max(0,Math.min(m[this.openness]*this._drawerHeight,this._drawerHeight-30))),A.style.transform=`translateY(${t}px)`)}render(){const t={drawer:!0,[this.openness]:!0,dragging:this._isDragging};return h.qy`
12
+ !function(t,a){"object"===typeof exports&&"object"===typeof module?module.exports=a():"function"===typeof define&&define.amd?define("Panoramax",[],a):"object"===typeof exports?exports.Panoramax=a():t.Panoramax=a()}(this,(()=>(()=>{var t={9039:(t,a,A)=>{"use strict";A.d(a,{A:()=>Basic});var h=A(4542),p=A(5254),g=A(4964),m=A(7208),v=A(5995),_=A(7343),E=A(2614),x=A.n(E),w=A(8330);A(1865),A(3638);class Basic extends h.WF{constructor(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];super(),this.users=["geovisio"],this["map-style"]=this.getAttribute("map-style")||(0,m.MapTiles)(),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 ${w.rE} (2a3367e)\n\n\ud83c\udd98 Issues can be reported at ${w.Jk.O}`),t||(this._isInternetFast=null,(0,_.isInternetFast)().then((t=>this._isInternetFast=t)))}connectedCallback(){super.connectedCallback(),this._t=(0,g.getTranslations)(this.lang),this.loader=(0,v.createWebComp)("pnx-loader",{_parent:this,"no-label":(0,_.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()),Object.entries({map:"map-options",psv:"psv-options",fetchOptions:"fetch-options",mapstyle:"map-style"}).forEach((t=>{let[a,A]=t;this.getAttribute(a)&&console.error(`Component attribute "${a}" has been renamed into "${A}". Old attribute "${a}" is ignored.`)}))}_setupAPI(){if(this.loader=this.loader||(0,v.createWebComp)("pnx-loader",{_parent:this}),!this.endpoint)return void console.warn("No endpoint is defined");this._loadsAPI=this.endpoint;let t=this.endpoint;try{this["map-style"]=JSON.parse(this["map-style"])}catch(A){}try{this.api=new p.A(this.endpoint,{users:this.users,fetch:this["fetch-options"],style:this["map-style"]}),this.api.onceReady().then((()=>{if(t!=this._loadsAPI||!this.api)return;let a=this.api.getUnavailableFeatures(),A=this.api.getAvailableFeatures();A=0===a.length?"\u2705 All features available":"\u2705 Available features: "+A.join(", "),a=0===a.length?"":"\ud83d\udeab Unavailable features: "+a.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 ${A}\n ${a}\n`.trim())})).catch((t=>this.loader.dismiss(t,this._t.pnx.error_api))).finally((()=>delete this._loadsAPI))}catch(A){var a;delete this._loadsAPI,null!==(a=this.loader)&&void 0!==a&&a.dismiss?this.loader.dismiss(A,this._t.pnx.error_api):console.error(A)}}onceReady(){throw new Error("You must override this method on sub-class")}onceAPIReady(){return this.api?this.api.onceReady():new Promise((t=>setTimeout(t,100))).then(this.onceAPIReady.bind(this))}createRenderRoot(){return this}attributeChangedCallback(t,a,A){if(super.attributeChangedCallback(t,a,A),"endpoint"===t&&(this._loadsAPI&&A&&this._loadsAPI===A||this.api&&this.api._endpoint===A||!A||((this._loadsAPI||this.api)&&(delete this.api,delete this._loadsAPI),this._setupAPI())),["picture","sequence"].includes(t)){let h,p,g,m;"picture"===t?(h=this.sequence,g=this.sequence,p=A,m=a):(h=A,g=a,p=this.picture,m=this.picture),this.dispatchEvent(new CustomEvent("select",{bubbles:!0,composed:!0,detail:{seqId:h,picId:p,prevSeqId:g,prevPicId:m}}))}}getClassName(){return"Basic"}select(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,a=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=a,this.sequence=t}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 h.qy`<p>Should not be used directly, use Viewer/CoverageMap/Editor instead</p>`}getSubComponentsNames(){return["loader","api"]}addEventListener(t,a,A){let h=t.split(":").shift();if(h&&this.getSubComponentsNames().includes(h)){var p;const g=t.substring(h.length+1);null!==(p=this[h])&&void 0!==p&&p.addEventListener?this[h].addEventListener(g,a,A):setTimeout((()=>this.addEventListener(t,a,A)),50)}else super.addEventListener(t,a,A)}static GetJSONConverter(){return{fromAttribute:t=>null===t||""===t?null:"object"===typeof t||Array.isArray(t)?t:x().parse(t),toAttribute:t=>null===t||""===t?"":"string"===typeof t?t:x().stringify(t)}}}Basic.properties={picture:{type:String,reflect:!0},sequence:{type:String,reflect:!0},"fetch-options":{converter:Basic.GetJSONConverter()},users:{type:Array,reflect:!0},"map-style":{type:String},lang:{type:String},endpoint:{type:String}}},3407:(t,a,A)=>{"use strict";A.d(a,{$p:()=>w,Ay:()=>PhotoViewer});A(970);var h=A(1545),p=A(4451),g=A(9039),m=A(9048),v=A(5995),_=A(7343),E=A(2118),x=A(4207);const w=20,C=Math.PI/6,T=["pnx-mini","pnx-widget-player","pnx-widget-zoom"];class PhotoViewer extends g.A{constructor(){super(),this["psv-options"]={},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,v.createWebComp)("pnx-cornered-grid"),this.psvContainer=document.createElement("div"),this.psvContainer.setAttribute("slot","bg"),this.grid.appendChild(this.psvContainer),this.popup=(0,v.createWebComp)("pnx-popup",{_parent:this,onclose:this._onPopupClose.bind(this)}),this.tabindex=0,this._sequencesMetadata={}}_createInitParamsHandler(){var t,a;this._initParams=new E.Ay(E.Ay.GetComponentProperties(PhotoViewer,this),Object.assign({},null===(t=this.urlHandler)||void 0===t?void 0:t.currentURLParams(),null===(a=this.urlHandler)||void 0===a?void 0:a.currentURLParams(!0)),{disableAnnotations:localStorage.getItem(_.DISABLE_ANNOTATIONS_PARAM)})}_initWidgets(){"false"!==this._initParams.getParentPostInit().widgets&&((0,_.isInIframe)()||(this.grid.appendChild((0,v.createWebComp)("pnx-widget-player",{slot:"top",_parent:this,class:"pnx-only-psv pnx-print-hidden",size:this.isHeightSmall()?"md":"xl"})),this.grid.appendChild((0,v.createWebComp)("pnx-annotations-switch",{slot:"top",_parent:this,class:"pnx-only-psv pnx-print-hidden",size:this.isHeightSmall()?"md":"xl"}))),(0,_.isInIframe)()?(this.legend=(0,v.createWebComp)("pnx-widget-legend",{slot:"bottom-right",light:!0,_parent:this,focus:this._initParams.getParentPostInit().focus,picture:this._initParams.getParentPostInit().picture}),this.grid.appendChild(this.legend)):this.isWidthSmall()?(this.legend=(0,v.createWebComp)("pnx-picture-legend",{_parent:this}),this.bottomDrawer=(0,v.createWebComp)("pnx-bottom-drawer",{slot:"bottom",_parent:this,class:this._initParams.getParentPostInit().willLoadPicture?void 0:"pnx-hidden"}),this.bottomDrawer.appendChild(this.legend),this.grid.appendChild(this.bottomDrawer),this.addEventListener("select",(t=>{(0,_.isNullId)(t.detail.picId)?this.bottomDrawer.classList.add("pnx-hidden"):this.bottomDrawer.classList.remove("pnx-hidden")}))):(this.legend=(0,v.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,v.createWebComp)("pnx-widget-zoom",{slot:"bottom-right",class:"pnx-print-hidden",_parent:this})),this.grid.appendChild(this.legend)))}connectedCallback(){super.connectedCallback(),this.presetsManager=new x.A(this.lang),this["url-parameters"]&&"false"!==this["url-parameters"]&&(this.urlHandler=new p.A(this),this.onceReady().then((()=>{this.urlHandler.listenToChanges(),this.urlHandler._onParentChange()}))),this.onceAPIReady().then(this._postAPIInit.bind(this)),this._moveChildToGrid(),window.addEventListener("DOMContentLoaded",(()=>{this._moveChildToGrid()}),{once:!0})}disconnectedCallback(){var t,a;super.disconnectedCallback(),null===(t=this.urlHandler)||void 0===t||t.destroy(),null===(a=this.psv)||void 0===a||a.destroy(),document.body.removeEventListener("click",this._toggleKeyboardBasedOnFocus),window.removeEventListener("keypress",this._toggleKeyboardBasedOnFocus)}getClassName(){return"PhotoViewer"}onceReady(){return this.oncePSVReady().then((()=>this._initParams.getParentPostInit().willLoadPicture&&!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 t;return new Promise((a=>{t=setInterval((()=>{this.psv&&"object"===typeof this.psv&&(this.psv.container?(clearInterval(t),a()):this.psv.addEventListener&&this.psv.addEventListener("ready",(()=>{clearInterval(t),a()}),{once:!0}))}),250)}))}onceFirstPicLoaded(){return this.oncePSVReady().then((()=>this.psv.getPictureMetadata()?Promise.resolve():new Promise((t=>{this.psv.addEventListener("picture-loaded",t,{once:!0})}))))}async _postAPIInit(){this.loader.setAttribute("value",30),this._createInitParamsHandler();const t=this._initParams.getParentPostInit();this._initPSV(),this._initWidgets(),(0,E.ai)(this,t),t.keyboardShortcuts&&this._handleKeyboardManagement(),t.willLoadPicture?this.psv.getPictureMetadata()?this.loader.dismiss():this.psv.addEventListener("picture-loaded",(()=>this.loader.dismiss()),{once:!0}):this.loader.dismiss()}_initPSV(){try{this.psv=new m.Ay(this,this.psvContainer,{shouldGoFast:this._psvShouldGoFast.bind(this),keyboard:"always",keyboardActions:{...h.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:()=>{var t;return null===(t=this._toggleFocus)||void 0===t?void 0:t.call(this)},7:()=>{var t;return null===(t=this._toggleFocus)||void 0===t?void 0:t.call(this)},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,E.Vy)(this.psv,this._initParams.getPSVPostInit())})),this.psv.addEventListener("sequence-playing",(()=>this.classList.add("pnx-playing"))),this.psv.addEventListener("sequence-stopped",(()=>this.classList.remove("pnx-playing")))}catch(t){let a=h.IJ.isWebGLSupported?this._t.pnx.error_psv:this._t.pnx.error_webgl;this.loader.dismiss(t,a)}}_enableKeyboard(){this.psv.startKeyboardControl()}_disableKeyboard(){this.psv.stopKeyboardControl()}_toggleKeyboardBasedOnFocus(t){const a=(null===t||void 0===t?void 0:t.target)||document.activeElement;if(this.contains(a)){for(let t of this.grid.childNodes)if("bg"!==t.getAttribute("slot")&&!T.includes(t.tagName.toLowerCase())&&t.contains(a))return void this._disableKeyboard();this._enableKeyboard()}else this._disableKeyboard()}_handleKeyboardManagement(){window.addEventListener("click",(t=>this._toggleKeyboardBasedOnFocus(t))),window.addEventListener("keypress",this._toggleKeyboardBasedOnFocus.bind(this)),this.popup.addEventListener("open",this._disableKeyboard.bind(this)),this.popup.addEventListener("close",this._enableKeyboard.bind(this)),this.psv.addEventListener("click",this._enableKeyboard.bind(this));for(let t of this.grid.childNodes)"bg"===t.getAttribute("slot")||T.includes(t.tagName.toLowerCase())||(t.addEventListener("focusin",this._disableKeyboard.bind(this)),t.addEventListener("focusout",(()=>{null===this.popup.getAttribute("visible")&&this._enableKeyboard()})))}_psvShouldGoFast(){return this.psv._sequencePlaying&&this.psv.getTransitionDuration()<1e3}_moveChildToGrid(){Array.from(this.querySelectorAll("[slot]")).forEach((t=>{var a;null!==(a=t.tagName)&&void 0!==a&&a.toLowerCase().startsWith("pnx-")&&(t._parent=this,t._t=this._t),"editors"===t.getAttribute("slot")?this.onceReady().then((()=>{var a;return null===(a=this.legend)||void 0===a?void 0:a.appendChild(t)})):this.grid.appendChild(t)}))}setPopup(t){let a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;t?this.popup.setAttribute("visible",""):this.popup.removeAttribute("visible"),this.popup.innerHTML="","string"===typeof a?this.popup.innerHTML=a:Array.isArray(a)&&a.forEach((t=>this.popup.appendChild(t)))}_onPopupClose(){this.dispatchEvent(new CustomEvent("focus-changed",{detail:{focus:this.map&&this.isMapWide()?"map":"pic"}}))}_showQualityScoreDoc(){this.setPopup(!0,[(0,v.createWebComp)("pnx-quality-score-doc",{_t:this._t})])}_showReportForm(){if(!this.psv.getPictureMetadata())throw new Error("No picture currently selected");this.setPopup(!0,[(0,v.createWebComp)("pnx-report-form",{_parent:this})])}_showShareOptions(){this.setPopup(!0,[(0,v.createWebComp)("pnx-share-menu",{_parent:this})])}_showSemanticsDoc(){this.setPopup(!0,[(0,v.createWebComp)("pnx-semantics-doc",{_t:this._t})])}moveCenter(){this.psv.getPictureMetadata()&&this._psvAnimate({speed:m.LM,yaw:0,pitch:0,zoom:m.cS})}moveLeft(){this._moveToDirection("left")}moveRight(){this._moveToDirection("right")}moveUp(){this._moveToDirection("up")}moveDown(){this._moveToDirection("down")}_moveToDirection(t){let a=this.psv.getPosition();switch(t){case"up":a.pitch+=C;break;case"left":a.yaw-=C;break;case"down":a.pitch-=C;break;case"right":a.yaw+=C}this._psvAnimate({speed:m.LM,...a})}_psvAnimate(t){this._lastPsvAnim&&this._lastPsvAnim.cancel(),this._lastPsvAnim=this.psv.animate(t)}addEventListener(t,a,A){super.addEventListener(t,a,A)}}PhotoViewer.properties={"psv-options":{converter:g.A.GetJSONConverter()},widgets:{type:String},"url-parameters":{type:String},"keyboard-shortcuts":{type:String},tabindex:{type:Number},...g.A.properties},customElements.define("pnx-photo-viewer",PhotoViewer)},2504:(t,a,A)=>{"use strict";A.r(a),A.d(a,{layout:()=>h,menus:()=>p,ui:()=>g});var h=A(456),p=A(9015),g=A(6957)},6784:(t,a,A)=>{"use strict";A.d(a,{A:()=>BottomDrawer});var h=A(4542),p=A(1198),g=A(5995);const m={opened:0,"half-opened":.7,closed:1};class BottomDrawer extends h.WF{constructor(){super(),this._isDragging=!1,this.openness="half-opened"}firstUpdated(){super.firstUpdated(),this._boundTouchMove=this._onTouchMove.bind(this),this._boundTouchEnd=this._onTouchEnd.bind(this),this._drawerHeight=window.innerHeight-30;const t=this._getDrawer();t&&(t.style.height=`${this._drawerHeight}px`,t.style.maxHeight=`${this._drawerHeight}px`,(0,g.onceParentAvailable)(this).then((()=>this._parent.onceReady())).then((()=>{var t,a;null===(t=this._parent.map)||void 0===t||t.addEventListener("click",(()=>this.openness="closed")),null===(a=this._parent.psv)||void 0===a||a.addEventListener("click",(()=>this.openness="closed"))})))}attributeChangedCallback(t,a,A){if(super.attributeChangedCallback(t,a,A),"openness"===t){if("opened"!==A){const t=this.shadowRoot.querySelector(".content");t&&(t.scrollTop=0)}const t=this._getDrawer();t&&(t.style.transform=null)}}disconnectedCallback(){super.disconnectedCallback(),this._cleanupTouchListeners()}_getDrawer(){var t;return null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector(".drawer")}_onHandleClick(){"opened"===this.openness?this.openness="closed":"half-opened"===this.openness?this.openness="opened":"closed"===this.openness&&(this.openness="half-opened")}_onTouchStart(t){this._isDragging=!0,this._startFingerY=t.touches[0].clientY,this._deltaFingerY=0,this._drawerY=this._drawerHeight*m[this.openness],window.addEventListener("touchmove",this._boundTouchMove,{passive:!0}),window.addEventListener("touchend",this._boundTouchEnd),window.addEventListener("touchcancel",this._boundTouchEnd)}_onTouchMove(t){if(!this._isDragging)return;const a=this.shadowRoot.querySelector(".content");a.scrollHeight>a.offsetHeight&&a.scrollTop>0?this._updateDrawerTransform(0):(this._deltaFingerY=t.touches[0].clientY-this._startFingerY,this._updateDrawerTransform(this._drawerY+this._deltaFingerY))}_onTouchEnd(t){(this._isDragging&&!(Math.abs(this._deltaFingerY)<30)||t.target.closest(".handle"))&&(t.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(t){let a=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const A=this._getDrawer();A&&(t=Math.max(0,Math.min(t,this._drawerHeight-30)),a&&(this._deltaFingerY<0?"closed"===this.openness?Math.abs(this._deltaFingerY)>this._drawerHeight*(1-m["half-opened"])?this.openness="opened":this.openness="half-opened":this.openness="opened":this.openness="closed",this._drawerY=null,t=Math.max(0,Math.min(m[this.openness]*this._drawerHeight,this._drawerHeight-30))),A.style.transform=`translateY(${t}px)`)}render(){const t={drawer:!0,[this.openness]:!0,dragging:this._isDragging};return h.qy`
13
13
  <div
14
14
  class=${(0,p.H)(t)}
15
15
  @touchstart="${this._onTouchStart}"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@panoramax/web-viewer",
3
- "version": "4.2.0-develop-613d3794",
3
+ "version": "4.2.0-develop-2a3367e4",
4
4
  "description": "Panoramax web viewer for geolocated pictures",
5
5
  "main": "build/index.js",
6
6
  "author": "Panoramax team",
@@ -0,0 +1,257 @@
1
+ {
2
+ "psv": {
3
+ "twoFingers": "Выкарыстоўвайце два пальцы для навігацыі",
4
+ "ctrlZoom": "Выкарыстоўвайце ctrl + прокрутка для маштабавання выявы",
5
+ "loadError": "Панараму немагчыма загрузіць"
6
+ },
7
+ "maplibre": {
8
+ "GeolocateControl.FindMyLocation": "Знайсці маё месцазнаходжанне",
9
+ "GeolocateControl.LocationNotAvailable": "Месцазнаходжанне недаступна"
10
+ },
11
+ "pnx": {
12
+ "zoom": "Маштаб",
13
+ "zoomOut": "Аддаліць",
14
+ "zoomIn": "Наблізіць",
15
+ "moveUp": "Рухацца ўверх",
16
+ "search_user": "Шукаць імя карыстальніка…",
17
+ "share": "Падзяліцца",
18
+ "share_links": "Спасылкі",
19
+ "share_page": "Спасылка на гэту выяву",
20
+ "share_image": "Выява высокай якасці",
21
+ "share_rss": "RSS стужка",
22
+ "share_rss_title": "RSS стужка новых серый у бачнай вобласці карты",
23
+ "share_embed": "Убудаваць на Ваш сайт",
24
+ "share_embed_docs": "Даведацца больш пра наладку ўбудовы",
25
+ "share_print": "Друк",
26
+ "panoramax": "Panoramax",
27
+ "copy": "Капіяваць",
28
+ "loading_labels_serious": [
29
+ "🗺️ Загрузка даных карты",
30
+ "🖥️ Запыт да API",
31
+ "🖼️ Загрузка мініяцюр",
32
+ "🔍 Аналіз EXIF метаданых",
33
+ "🏘️ 3D рэндэрынг",
34
+ "📷 Ініцыялізацыя 360° выяў",
35
+ "🟠 Баланс колераў",
36
+ "💯 Разлік адзнакі якасці ©",
37
+ "📡 Сцягванне абнаўленняў",
38
+ "🌍 Загрузка тайлаў карты",
39
+ "📸 Апрацоўка ценяў"
40
+ ],
41
+ "loading_labels_fun": [
42
+ "🦌 Выяўленне знакаў пераходу аленяў",
43
+ "🚘 Пошук аўтамабіля Panoramax©",
44
+ "☕ Ін'екцыя кафеіну",
45
+ "😀 Усміхніцеся, вы на карце!",
46
+ "🐈 Падзяляемся фатаграфіямі каткоў",
47
+ "😴 Змяншэнне пракрастынацыі",
48
+ "🫖 Заварванне гарбаты",
49
+ "🐧 Адкрыццё зыходнага кода",
50
+ "🚇 Індэксацыя станцый метро",
51
+ "🧹 Прыбіраем ўсё смецце з вуліц",
52
+ "🚒 Расчышчаем вуліцы ад машын для праезду пажарных",
53
+ "🌳 Пералічваем лясныя сцежачкі ў Белавежскай пушчы... Адна, другая, трэцяя... Збіліся! Пачынаем спачатку!",
54
+ "🚉 Агляд платформ станцый",
55
+ "🛰️ Пошук спадарожнікаў",
56
+ "👥 Стварэнне персон",
57
+ "🐟 Лакацыя рыбных крам",
58
+ "🧑‍💻 Адладка інтэрфейсу",
59
+ "📈 Павелічэнне статыстыкі",
60
+ "🤖 Вывучэнне семантыкі",
61
+ "🎨 Рэдызайн інтэрфейсу",
62
+ "📅 Планаванне фота-картаграфічных вечарын",
63
+ "🧀 Паспяванне клінковага сыру",
64
+ "🌄 Чакаем наступу світанку",
65
+ "🌊 Вымярэнне прыліваў"
66
+ ],
67
+ "qualityscore_doc_3": "Яна разлічваецца на аснове дакладнасці GPS і раздзяляльнасці выявы. Прафесійная сістэма будзе мець адзнаку A, экшн-камера 360° - B, а смартфон - C/D/E.",
68
+ "qualityscore_doc_link": "Даведацца больш пра адзнаку якасці",
69
+ "filter_gps_precision": "Дакладнасць пазіцыянавання",
70
+ "filter_gps_precision_between": "Паміж {n1} і {n2} метрамі",
71
+ "filter_gps_precision_morethan": "Больш за {n} метраў",
72
+ "map_theme_age": "Дата здымкі",
73
+ "map_theme_type": "Тып камеры",
74
+ "map_theme_score": "Адзнака якасці",
75
+ "map_theme_gps": "Дакладнасць пазіцыянавання",
76
+ "map_theme_age_1": "> 2 гады",
77
+ "map_theme_age_2": "< 2 гады",
78
+ "map_theme_age_3": "< 1 год",
79
+ "map_theme_age_4": "< 1 месяц",
80
+ "contrast": "Уключыць большы кантраст выявы",
81
+ "metadata": "Метаданыя выявы",
82
+ "metadata_summary": "Апісанне",
83
+ "metadata_location_coordinates": "Каардынаты (даўгата, шырата)",
84
+ "metadata_location_orientation": "Напрамак",
85
+ "metadata_location_precision": "Дакладнасць пазіцыянавання",
86
+ "metadata_location_copy": "Капіяваць {v}",
87
+ "metadata_location_copy_more": "Больш опцый капіявання каардынат",
88
+ "metadata_quality": "Якасць",
89
+ "metadata_quality_help": "Даведацца больш пра адзнаку якасці",
90
+ "metadata_quality_gps_score": "Адзнака пазіцыянавання",
91
+ "metadata_quality_resolution_score": "Адзнака раздзяляльнасці",
92
+ "metadata_quality_missing": "значэнне не зададзена ў выяве",
93
+ "metadata_exif": "EXIF",
94
+ "metadata_exif_name": "Тэг",
95
+ "semantics_features": "Аб'екты на выяве",
96
+ "semantics_features_none": "На гэтай выяве яшчэ не вылучаны ніводны аб'ект.",
97
+ "semantics_show_all_tags": "Паказаць усе тэгі",
98
+ "semantics_hide_all_tags": "Схаваць усе тэгі",
99
+ "report_nature": {
100
+ "blur_missing": "Бачны твар чалавека або нумарны знак аўто",
101
+ "blur_excess": "На аб'ект быў ужыты непатрэбнае размыццё",
102
+ "": "Выберыце тып праблемы…",
103
+ "inappropriate": "Неадпаведная выява (не звязаная, аголенасць…)",
104
+ "privacy": "Бачны прыватны шлях або ўласнасць",
105
+ "picture_low_quality": "Выява нізкай якасці",
106
+ "mislocated": "Выява дрэнна размешчана на карце",
107
+ "copyright": "Выява парушае аўтарскія правы",
108
+ "other": "Любы іншы від праблемы"
109
+ },
110
+ "semantics_editor_example": "ключ=значэнне\nпрэфікс|ключ=значэнне",
111
+ "moveDown": "Рухацца ўніз",
112
+ "moveLeft": "Рухацца налева",
113
+ "moveRight": "Рухацца направа",
114
+ "moveMiddle": "Цэнтраваць від",
115
+ "expand": "Разгарнуць",
116
+ "expand_info": "Адлюстраваць віджэт на ўсю старонку",
117
+ "show_psv": "Паказаць праглядальнік выяў",
118
+ "show_map": "Паказаць карту",
119
+ "minimize": "Схаваць гэты віджэт, Вы можаце зноў паказаць яго з дапамогай кнопкі ў левым ніжнім куце",
120
+ "minimize_short": "Схаваць",
121
+ "options": "Опцыі",
122
+ "filters": "Фільтры",
123
+ "layers": "Слаі",
124
+ "search": "Пошук",
125
+ "search_empty": "Вынікаў не знойдзена",
126
+ "search_address": "Шукаць адрас, горад…",
127
+ "whats_panoramax": "Panoramax - гэта агульныя гка-рэсурсы для выяў тэрыторый.",
128
+ "copied": "Скапіявана",
129
+ "error": "У нас праблема…",
130
+ "error_click": "Працягваць",
131
+ "error_retry": "Калі ласка, паспрабуйце пазней",
132
+ "sequence_next": "Наступная выява ў серыі",
133
+ "sequence_play": "Прайграць гэтую серыю",
134
+ "sequence_pause": "Прыпыніць серыю",
135
+ "sequence_prev": "Папярэдняя выява ў серыі",
136
+ "sequence_more": "Больш опцый прайгравання",
137
+ "sequence_speed": "Хуткасць прайгравання",
138
+ "legend_license": "Ліцэнзія: {l}",
139
+ "legend_title": "Паказаць падрабязнасці выявы",
140
+ "id": "iD",
141
+ "contribute_id": "Унесці ўклад у OpenStreetMap з дапамогай рэдактара iD",
142
+ "geo_uri": "Знешняя праграма",
143
+ "josm": "JOSM",
144
+ "josm_live": "Уключыць аўтаматычную сінхранізацыю JOSM пры загрузцы выявы",
145
+ "error_psv": "Photo Sphere Viewer не загружаецца правільна",
146
+ "error_pic": "Запытаная выява не знойдзена",
147
+ "error_nopic": "Няма выявы ў зададзенай пазіцыі",
148
+ "error_api": "Сервер выяў недаступны",
149
+ "error_webgl": "WebGL не падтрымліваецца вашым браўзарам",
150
+ "error_josm": "JOSM не адказвае, ці ён запушчаны і ўключаны выдалены доступ?",
151
+ "error_api_compatibility": "Сервер выяў несумяшчальны з гэтай версіяй праглядальніка",
152
+ "filter_date": "Дата",
153
+ "filter_date_1month": "1 месяц",
154
+ "filter_date_6months": "6 месяцаў",
155
+ "filter_date_1year": "1 год",
156
+ "filter_user": "Карыстальнік",
157
+ "filter_user_mypics": "Мае выявы",
158
+ "filter_picture": "Тып выявы",
159
+ "filter_zoom_in": "Наблізьце карту, каб убачыць гэты фільтр",
160
+ "picture_all": "Усе",
161
+ "picture_flat": "Класічныя",
162
+ "picture_360": "360°",
163
+ "picture_flat_long": "Класічная выява",
164
+ "picture_360_long": "Панарамная выява",
165
+ "filter_qualityscore": "Адзнака якасці",
166
+ "filter_qualityscore_help": "Націсніце, каб уключыць або выключыць",
167
+ "qualityscore_title": "Пра адзнаку якасці",
168
+ "qualityscore_doc_1": "Panoramax прапануе адзнаку якасці для кожнай выявы. Гэта дазваляе лёгка фільтраваць карту і паказваць наяўнасць выяў высокай якасці.",
169
+ "qualityscore_doc_2": "Адзнака паказваецца карыстальнікам як A/B/C/D/E (A - лепшая, E - горшая) ды адлюстроўваецца графічна праз гэтую шкалу:",
170
+ "filter_gps_precision_lessthan": "Менш за {n} метраў",
171
+ "map_background": "Фон карты",
172
+ "map_background_aerial": "Спадарожнікавы",
173
+ "map_background_streets": "Вулічны",
174
+ "map_theme": "Тэма карты",
175
+ "map_theme_default": "Класічная",
176
+ "metadata_general_copy_id": "Капіяваць ID",
177
+ "metadata_general_copy_picid": "Капіяваць ID выявы",
178
+ "metadata_general_picid": "Выява",
179
+ "metadata_general_seqid": "Серыя",
180
+ "metadata_general_picid_link": "Перайсці да JSON апісання выявы",
181
+ "metadata_general_seqid_link": "Перайсці да JSON апісання серыі",
182
+ "metadata_general_author": "Аўтар",
183
+ "metadata_general_license": "Ліцэнзія",
184
+ "metadata_general_license_link": "Глядзець поўнае апісанне ліцэнзіі",
185
+ "metadata_general_date": "Дата здымкі",
186
+ "metadata_general_instance": "Інстанцыя паходжання",
187
+ "metadata_camera": "Камера",
188
+ "metadata_camera_make": "Вытворца",
189
+ "metadata_camera_model": "Мадэль",
190
+ "metadata_camera_type": "Тып",
191
+ "metadata_camera_resolution": "Раздзяляльнасць",
192
+ "metadata_camera_focal_length": "Факусная адлегласць",
193
+ "metadata_location": "Пазіцыя",
194
+ "metadata_quality_score": "Агульная адзнака",
195
+ "metadata_exif_value": "Значэнне",
196
+ "metadata_exif_doc": "Дакументацыя па EXIF тэгах",
197
+ "metadata_exif_doc_title": "Перайсці да дакументацыі Exiv2 для поўных звестак пра вызначэнні EXIF і XMP тэгаў",
198
+ "semantics_title": "Тэгі",
199
+ "semantics_tags": "{nb} тэгаў",
200
+ "semantics_features_default_title": "Тэг {nb}",
201
+ "semantics_features_subtitle": "{nb} звязаных уласцівасцей",
202
+ "semantics_annotation_tooltip": "Націсніце, каб убачыць падрабязнасці",
203
+ "semantics_key": "Ключ",
204
+ "semantics_value": "Значэнне",
205
+ "semantics_sequence_tags": "Тэг серыі",
206
+ "semantics_picture_tags": "Тэг выявы",
207
+ "semantics_annotation_tags": "Тэг аб'екта",
208
+ "semantics_doc": "Дапамога",
209
+ "semantics_doc_title": "Пра тэгі",
210
+ "semantics_doc_info1": "Дадайце кантэкст да выявы з дапамогай тэгаў. Вы можаце пазначыць, што яна зроблена з машыны, з дапамогай тэга transport=car.",
211
+ "semantics_doc_info2": "Вы таксама можаце вылучыць аб'екты на выяве: дарожныя знакі, гарадское абсталяванне… Пазначайце тое, што бачыце, з дапамогай існуючых тэгаў. Пры неабходнасці вы можаце ствараць свае ўласныя.",
212
+ "semantics_doc_info3": "Некаторыя аб'екты аўтаматычна выяўляюцца з дапамогай ШІ: якасць не гарантуецца.",
213
+ "semantics_doc_link": "Даведацца больш пра тэгі",
214
+ "semantics_key_doc": "Даведацца больш пра гэты ключ",
215
+ "semantics_value_doc": "Даведацца больш пра гэты тэг",
216
+ "semantics_qualifiers": "Кваліфікатары",
217
+ "semantics_show_annotations": "Адлюстроўваць аб'екты на выяве",
218
+ "semantics_hide_annotations": "Схаваць аб'екты на выяве",
219
+ "semantics_zero_annotations": "На гэтай выяве аб'екты не вылучаны",
220
+ "semantics_add_annotation": "Дадаць новы тэг",
221
+ "semantics_draw_annotation": "Вы можаце вылучыць аб'ект, які хочаце дадаць, на выяве (Неабавязкова).",
222
+ "semantics_erase_annotation": "Сцерці вылучаны аб'ект",
223
+ "semantics_delete_annotation": "Выдаліць гэты аб'ект",
224
+ "semantics_delete_annotation_confirm": "Вы сапраўды жадаеце выдаліць гэты тэг?",
225
+ "semantics_wikidata_properties": {
226
+ "P31": "асобнік класа",
227
+ "P279": "падклас",
228
+ "P361": "частка"
229
+ },
230
+ "semantics_editor_error": "Сінтаксіс несапраўдны. Вашы тэгі могуць выглядаць так:\nkey=value\nprefix|key=value\nprefix|key[qualif_key=qualif_val]=value\n\nМаксімальная даўжыня ключа - 256 сімвалаў, максімальная даўжыня значэння - 2048 сімвалаў.",
231
+ "semantics_edit": "Рэдагаваць атрыбуты",
232
+ "semantics_save": "Захаваць змены",
233
+ "semantics_undo": "Скасаваць рэдагаванне",
234
+ "semantics_send_fail": "Немагчыма захаваць змены, калі ласка, паспрабуйце пазней",
235
+ "semantics_login_needed": "Для рэдагавання тэгаў або аб'ектаў на выяве вам неабходна ўвайсці ў інстанцыю Panoramax {n}. Жадаеце ўвайсці?",
236
+ "report": "Паведамленне",
237
+ "report_auth": "Гэтая паведамленне будзе адпраўлена з вашага ўліковага запісу \"{a}\"",
238
+ "report_nature_label": "Прычына праблемы",
239
+ "report_whole_sequence": "Гэта тычыцца ўсёй серыі",
240
+ "report_details": "Дадатковыя падрабязнасці",
241
+ "report_details_placeholder": "Па жаданні, вы можаце дадаць падрабязнасці пра праблему",
242
+ "report_email": "Ваш email",
243
+ "report_email_placeholder": "Неабавязкова",
244
+ "report_submit": "Адправіць",
245
+ "report_wait": "Адпраўка паведамлення…",
246
+ "report_failure": "Пры стварэнні паведамлення адбылася памылка: {e}. Калі ласка, паспрабуйце пазней.",
247
+ "report_success": "ПАведамленне паспяхова адпраўлена. Яно будзе разгледжана як мага хутчэй."
248
+ },
249
+ "map": {
250
+ "loading": "Загрузка…",
251
+ "thumbnail": "Мініяцюра выявы пад курсорам",
252
+ "not_public": "Непублічна бачная",
253
+ "slow_loading": "Карта павольна загружаецца і можа здавацца пашкоджанай",
254
+ "map_data": "Карта на аснове {m}",
255
+ "more_panoramax": "Даведацца больш пра Panoramax"
256
+ }
257
+ }