@panoramax/web-viewer 4.1.0-develop-46faa835 → 4.1.0-develop-b34f912e

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(at,st){"object"===typeof exports&&"object"===typeof module?module.exports=st():"function"===typeof define&&define.amd?define("Panoramax",[],st):"object"===typeof exports?exports.Panoramax=st():at.Panoramax=st()}(this,(()=>(()=>{var at={9039:(at,st,ot)=>{"use strict";ot.d(st,{A:()=>Basic});var ut=ot(4542),Hl=ot(5254),rc=ot(4964),sc=ot(7208),oc=ot(5995),_c=ot(7343),wc=ot(2614),Sc=ot.n(wc),iu=ot(8330);ot(1865),ot(3638);class Basic extends ut.WF{constructor(){let at=arguments.length>0&&void 0!==arguments[0]&&arguments[0];super(),this.users=["geovisio"],this["map-style"]=this.getAttribute("map-style")||(0,sc.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 ${iu.rE} (46faa83)\n\n\ud83c\udd98 Issues can be reported at ${iu.Jk.O}`),at||(this._isInternetFast=null,(0,_c.isInternetFast)().then((at=>this._isInternetFast=at)))}connectedCallback(){super.connectedCallback(),this._t=(0,rc.getTranslations)(this.lang),this.loader=(0,oc.createWebComp)("pnx-loader",{_parent:this,"no-label":(0,_c.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((at=>{let[st,ot]=at;this.getAttribute(st)&&console.error(`Component attribute "${st}" has been renamed into "${ot}". Old attribute "${st}" is ignored.`)}))}_setupAPI(){if(this.loader=this.loader||(0,oc.createWebComp)("pnx-loader",{_parent:this}),!this.endpoint)return void console.warn("No endpoint is defined");this._loadsAPI=this.endpoint;let at=this.endpoint;try{this["map-style"]=JSON.parse(this["map-style"])}catch(ot){}try{this.api=new Hl.A(this.endpoint,{users:this.users,fetch:this["fetch-options"],style:this["map-style"]}),this.api.onceReady().then((()=>{if(at!=this._loadsAPI||!this.api)return;let st=this.api.getUnavailableFeatures(),ot=this.api.getAvailableFeatures();ot=0===st.length?"\u2705 All features available":"\u2705 Available features: "+ot.join(", "),st=0===st.length?"":"\ud83d\udeab Unavailable features: "+st.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 ${ot}\n ${st}\n`.trim())})).catch((at=>this.loader.dismiss(at,this._t.pnx.error_api))).finally((()=>delete this._loadsAPI))}catch(ot){var st;delete this._loadsAPI,null!==(st=this.loader)&&void 0!==st&&st.dismiss?this.loader.dismiss(ot,this._t.pnx.error_api):console.error(ot)}}onceReady(){throw new Error("You must override this method on sub-class")}onceAPIReady(){return this.api?this.api.onceReady():new Promise((at=>setTimeout(at,100))).then(this.onceAPIReady.bind(this))}createRenderRoot(){return this}attributeChangedCallback(at,st,ot){if(super.attributeChangedCallback(at,st,ot),"endpoint"===at&&(this._loadsAPI&&ot&&this._loadsAPI===ot||this.api&&this.api._endpoint===ot||!ot||((this._loadsAPI||this.api)&&(delete this.api,delete this._loadsAPI),this._setupAPI())),["picture","sequence"].includes(at)){let ut,Hl,rc,sc;"picture"===at?(ut=this.sequence,rc=this.sequence,Hl=ot,sc=st):(ut=ot,rc=st,Hl=this.picture,sc=this.picture),this.dispatchEvent(new CustomEvent("select",{bubbles:!0,composed:!0,detail:{seqId:ut,picId:Hl,prevSeqId:rc,prevPicId:sc}}))}}getClassName(){return"Basic"}select(){let at=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,st=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=st,this.sequence=at}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(at,st,ot){let ut=at.split(":").shift();if(ut&&this.getSubComponentsNames().includes(ut)){var Hl;const rc=at.substring(ut.length+1);null!==(Hl=this[ut])&&void 0!==Hl&&Hl.addEventListener?this[ut].addEventListener(rc,st,ot):setTimeout((()=>this.addEventListener(at,st,ot)),50)}else super.addEventListener(at,st,ot)}static GetJSONConverter(){return{fromAttribute:at=>null===at||""===at?null:"object"===typeof at||Array.isArray(at)?at:Sc().parse(at),toAttribute:at=>null===at||""===at?"":"string"===typeof at?at:Sc().stringify(at)}}}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:(at,st,ot)=>{"use strict";ot.d(st,{A:()=>CoverageMap});var ut=ot(9039),Hl=ot(5642),rc=ot(8340),sc=ot(927),oc=(ot(7776),ot(2118));class CoverageMap extends ut.A{constructor(){super(),this._mapContainer=document.createElement("div"),this.onceAPIReady().then((()=>{this.loader.setAttribute("value",30),this._initParams=new oc.Ay(oc.Ay.GetComponentProperties(CoverageMap,this)),this._initMap()}))}disconnectedCallback(){var at;super.disconnectedCallback(),null===(at=this.map)||void 0===at||at.destroy()}getClassName(){return"CoverageMap"}onceReady(){return this.map&&this.map.waitForEnoughMapLoaded?this.map.waitForEnoughMapLoaded():new Promise((at=>setTimeout(at,100))).then(this.onceReady.bind(this))}render(){return[this.loader,this._mapContainer]}getSubComponentsNames(){const at=super.getSubComponentsNames();return at.push("map"),at}_initMap(){class MyMap extends Hl.A{_getLayerStyleProperties(at){return"pictures_symbols"===at?{layout:{visibility:"none"}}:super._getLayerStyleProperties(at)}}this.map=new MyMap(this,this._mapContainer,Object.assign({},this._initParams.getMapInit(),{hash:!0})),this.map.addControl(new sc.NavigationControl({showCompass:!1})),this.loader.setAttribute("value",70),this.addEventListener("select",this._onSelect.bind(this)),this.map.on("picture-click",(at=>this.select(at.seqId,at.picId))),this.map.on("sequence-click",(at=>this.select(at.seqId))),this.map.waitForEnoughMapLoaded().then((async()=>{await(0,oc.mK)(this.map,this._initParams.getMapPostInit()),this.map.reloadLayersStyles(),this.loader.dismiss()}))}_onSelect(at){if(at.detail.picId||at.detail.seqId){const st=at.detail.picId?"pictures":"sequences",ot=this.map.queryRenderedFeatures({layers:[...this.map._userLayers].map((at=>(0,rc.getUserLayerId)(at,st))),filter:["==",["get","id"],at.detail.picId||at.detail.seqId]});ot.length>=0&&null!=ot[0]&&this.map._attachPreviewToPictures({features:ot},st)}}}CoverageMap.properties={"map-options":{converter:ut.A.GetJSONConverter()},...ut.A.properties},customElements.define("pnx-coverage-map",CoverageMap)},1752:(at,st,ot)=>{"use strict";ot.d(st,{A:()=>Editor});ot(7365);var ut=ot(9039),Hl=ot(5642),rc=ot(9048),sc=ot(508),oc=ot(8340),_c=ot(1545),wc=ot(5995);const Sc="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,wc.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 at,st;super.disconnectedCallback(),null===(at=this.map)||void 0===at||at.destroy(),null===(st=this.psv)||void 0===st||st.destroy()}getClassName(){return"Editor"}onceReady(){var at,st;return this.map&&this.psv&&null!==(at=(st=this.map).loaded)&&void 0!==at&&at.call(st)?Promise.resolve():new Promise((at=>setTimeout(at,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(at,st,ot){"users"===at&&Array.isArray(ot)&&ot.length>0?console.warn("Parameters users can't be changed in Editor, only selected sequence can be visible"):super.attributeChangedCallback(at,st,ot)}render(){return[this.loader,this.grid]}getSubComponentsNames(){return super.getSubComponentsNames().concat(["map","psv","grid"])}_initPSV(){try{this.psv=new rc.Ay(this,this._psvContainer),this.psv._myVTour.datasource.nodeResolver=this._getNode.bind(this)}catch(at){let st=_c.IJ.isWebGLSupported?this._t.pnx.error_psv:this._t.pnx.error_webgl;this.loader.dismiss(at,st)}}_initMap(){try{this.map=new Hl.A(this,this._mapContainer,{raster:this.raster,background:this.background,supplementaryStyle:this._createMapStyle(),zoom:15,picMarkerDraggable:!0}),(0,oc.linkMapAndPhoto)(this),this.loader.setAttribute("value",50),this._loadSequence(),this.map.once("load",(()=>{this.map.hasTwoBackgrounds()&&this._addMapBackgroundWidget(),this._bindPicturesEvents()}));const at=this.map._picMarker.setRotation.bind(this.map._picMarker);this.map._picMarker.setRotation=st=>(st=void 0===this._lastRelHeading?st:st+this._lastRelHeading-this.psv.getPictureRelativeHeading(),at(st))}catch(at){this.loader.dismiss(at,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:{...oc.VECTOR_STYLES.SEQUENCES.layout},paint:{...oc.VECTOR_STYLES.SEQUENCES.paint}},{id:"geovisio_editor_pictures",type:"circle",source:"geovisio_editor_sequences",layout:{...oc.VECTOR_STYLES.PICTURES.layout},paint:{...oc.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((at=>{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=at.features,this.map.getSource("geovisio_editor_sequences").setData({type:"FeatureCollection",features:[{id:this.sequence,type:"Feature",properties:{id:this.sequence},geometry:{type:"LineString",coordinates:at.features.map((at=>at.geometry.coordinates))}},...at.features.map((at=>(at.properties.id=at.id,at.properties.sequences=[this.sequence],at)))]}),this.picture){const st=at.features.find((at=>at.id===this.picture));st?(this.select(this.sequence,this.picture,!0),this.map.jumpTo({center:st.geometry.coordinates,zoom:18})):console.log("Picture with ID",st,"was not found")}else{const st=[...at.features[0].geometry.coordinates,...at.features[0].geometry.coordinates];for(let ot=1;ot<at.features.length;ot++){const ut=at.features[ot].geometry.coordinates;ut[0]<st[0]&&(st[0]=ut[0]),ut[1]<st[1]&&(st[1]=ut[1]),ut[0]>st[2]&&(st[2]=ut[0]),ut[1]>st[3]&&(st[3]=ut[1])}this.map.fitBounds(st,{animate:!1})}})).catch((at=>this.loader.dismiss(at,this._t.pnx.error_api)))}_getNode(at){const st=this._sequenceData.find((st=>st.properties.id===at)),ot=st?(0,sc.apiFeatureToPSVNode)(st,this._t,this._isInternetFast,void 0,(at=>this.api.cleanResourceURL(at))):null;return ot&&delete ot.links,ot}_addMapBackgroundWidget(){const at=(0,wc.createWebComp)("pnx-map-background",{_parent:this,size:"sm",slot:"bottom-left"});this.grid.appendChild(at)}_moveChildToGrid(){Array.from(this.querySelectorAll("[slot]")).forEach((at=>{var st;null!==(st=at.tagName)&&void 0!==st&&st.toLowerCase().startsWith("pnx-")&&(at._parent=this,at._t=this._t),this.grid.appendChild(at)}))}previewSequenceHeadingChange(at){const st=void 0!==this.map.getLayer(Sc);if(this.map._picMarkerPreview.remove(),void 0===at)return delete this._lastRelHeading,st&&this.map.setLayoutProperty(Sc,"visibility","none"),void(this.picture&&this.map._picMarker.setRotation(this.psv.getXY().x));this._lastRelHeading=at,st||this.map.addLayer({id:Sc,type:"symbol",source:"geovisio_editor_sequences",layout:{"icon-image":"pnx-marker","icon-overlap":"always","icon-size":.8}});const ot=-this.psv.getPictureRelativeHeading();this.map.setLayoutProperty(Sc,"visibility","visible"),this.map.setLayoutProperty(Sc,"icon-rotate",["+",["get","view:azimuth"],ot,at]);const ut=[["==",["geometry-type"],"Point"]];this.picture&&ut.push(["!=",["get","id"],this.picture]),this.map.setFilter(Sc,["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:(at,st,ot)=>{"use strict";ot.d(st,{$p:()=>iu,Ay:()=>PhotoViewer,RD:()=>lu});ot(970);var ut=ot(1545),Hl=ot(4451),rc=ot(9039),sc=ot(9048),oc=ot(5995),_c=ot(7343),wc=ot(2118),Sc=ot(4207);const iu=20,su=Math.PI/6,lu=["pnx-mini","pnx-widget-player","pnx-widget-zoom"];class PhotoViewer extends rc.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,oc.createWebComp)("pnx-cornered-grid"),this.psvContainer=document.createElement("div"),this.psvContainer.setAttribute("slot","bg"),this.grid.appendChild(this.psvContainer),this.popup=(0,oc.createWebComp)("pnx-popup",{_parent:this,onclose:this._onPopupClose.bind(this)}),this.tabindex=0}_createInitParamsHandler(){var at,st;this._initParams=new wc.Ay(wc.Ay.GetComponentProperties(PhotoViewer,this),Object.assign({},null===(at=this.urlHandler)||void 0===at?void 0:at.currentURLParams(),null===(st=this.urlHandler)||void 0===st?void 0:st.currentURLParams(!0)),{disableAnnotations:localStorage.getItem(_c.DISABLE_ANNOTATIONS_PARAM)})}_initWidgets(){"false"!==this._initParams.getParentPostInit().widgets&&((0,_c.isInIframe)()||(this.grid.appendChild((0,oc.createWebComp)("pnx-widget-player",{slot:"top",_parent:this,class:"pnx-only-psv pnx-print-hidden",size:this.isHeightSmall()?"md":"xl"})),this.grid.appendChild((0,oc.createWebComp)("pnx-annotations-switch",{slot:"top",_parent:this,class:"pnx-only-psv pnx-print-hidden",size:this.isHeightSmall()?"md":"xl"}))),(0,_c.isInIframe)()?(this.legend=(0,oc.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,oc.createWebComp)("pnx-picture-legend",{_parent:this}),this.bottomDrawer=(0,oc.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",(at=>{(0,_c.isNullId)(at.detail.picId)?this.bottomDrawer.classList.add("pnx-hidden"):this.bottomDrawer.classList.remove("pnx-hidden")}))):(this.legend=(0,oc.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,oc.createWebComp)("pnx-widget-zoom",{slot:"bottom-right",class:"pnx-print-hidden",_parent:this})),this.grid.appendChild(this.legend)))}connectedCallback(){super.connectedCallback(),this.presetsManager=new Sc.A(this.lang),this["url-parameters"]&&"false"!==this["url-parameters"]&&(this.urlHandler=new Hl.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 at,st;super.disconnectedCallback(),null===(at=this.urlHandler)||void 0===at||at.destroy(),null===(st=this.psv)||void 0===st||st.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 at;return new Promise((st=>{at=setInterval((()=>{this.psv&&"object"===typeof this.psv&&(this.psv.container?(clearInterval(at),st()):this.psv.addEventListener&&this.psv.addEventListener("ready",(()=>{clearInterval(at),st()}),{once:!0}))}),250)}))}onceFirstPicLoaded(){return this.oncePSVReady().then((()=>this.psv.getPictureMetadata()?Promise.resolve():new Promise((at=>{this.psv.addEventListener("picture-loaded",at,{once:!0})}))))}async _postAPIInit(){this.loader.setAttribute("value",30),this._createInitParamsHandler();const at=this._initParams.getParentPostInit();this._initPSV(),this._initWidgets(),(0,wc.ai)(this,at),at.keyboardShortcuts&&this._handleKeyboardManagement(),at.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 sc.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 at;return null===(at=this._toggleFocus)||void 0===at?void 0:at.call(this)},7:()=>{var at;return null===(at=this._toggleFocus)||void 0===at?void 0:at.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,wc.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(at){let st=ut.IJ.isWebGLSupported?this._t.pnx.error_psv:this._t.pnx.error_webgl;this.loader.dismiss(at,st)}}_enableKeyboard(){this.psv.startKeyboardControl()}_disableKeyboard(){this.psv.stopKeyboardControl()}_toggleKeyboardBasedOnFocus(at){const st=(null===at||void 0===at?void 0:at.target)||document.activeElement;if(this.contains(st)){for(let at of this.grid.childNodes)if("bg"!==at.getAttribute("slot")&&!lu.includes(at.tagName.toLowerCase())&&at.contains(st))return void this._disableKeyboard();this._enableKeyboard()}else this._disableKeyboard()}_handleKeyboardManagement(){window.addEventListener("click",(at=>this._toggleKeyboardBasedOnFocus(at))),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 at of this.grid.childNodes)"bg"===at.getAttribute("slot")||lu.includes(at.tagName.toLowerCase())||(at.addEventListener("focusin",this._disableKeyboard.bind(this)),at.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((at=>{var st;null!==(st=at.tagName)&&void 0!==st&&st.toLowerCase().startsWith("pnx-")&&(at._parent=this,at._t=this._t),"editors"===at.getAttribute("slot")?this.onceReady().then((()=>{var st;return null===(st=this.legend)||void 0===st?void 0:st.appendChild(at)})):this.grid.appendChild(at)}))}setPopup(at){let st=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;at?this.popup.setAttribute("visible",""):this.popup.removeAttribute("visible"),this.popup.innerHTML="","string"===typeof st?this.popup.innerHTML=st:Array.isArray(st)&&st.forEach((at=>this.popup.appendChild(at)))}_onPopupClose(){this.dispatchEvent(new CustomEvent("focus-changed",{detail:{focus:this.map&&this.isMapWide()?"map":"pic"}}))}_showQualityScoreDoc(){this.setPopup(!0,[(0,oc.createWebComp)("pnx-quality-score-doc",{_t:this._t})])}_showReportForm(){if(!this.psv.getPictureMetadata())throw new Error("No picture currently selected");this.setPopup(!0,[(0,oc.createWebComp)("pnx-report-form",{_parent:this})])}_showShareOptions(){this.setPopup(!0,[(0,oc.createWebComp)("pnx-share-menu",{_parent:this})])}moveCenter(){this.psv.getPictureMetadata()&&this._psvAnimate({speed:sc.LM,yaw:0,pitch:0,zoom:sc.cS})}moveLeft(){this._moveToDirection("left")}moveRight(){this._moveToDirection("right")}moveUp(){this._moveToDirection("up")}moveDown(){this._moveToDirection("down")}_moveToDirection(at){let st=this.psv.getPosition();switch(at){case"up":st.pitch+=su;break;case"left":st.yaw-=su;break;case"down":st.pitch-=su;break;case"right":st.yaw+=su}this._psvAnimate({speed:sc.LM,...st})}_psvAnimate(at){this._lastPsvAnim&&this._lastPsvAnim.cancel(),this._lastPsvAnim=this.psv.animate(at)}addEventListener(at,st,ot){super.addEventListener(at,st,ot)}}PhotoViewer.properties={"psv-options":{converter:rc.A.GetJSONConverter()},widgets:{type:String},"url-parameters":{type:String},"keyboard-shortcuts":{type:String},tabindex:{type:Number},...rc.A.properties},customElements.define("pnx-photo-viewer",PhotoViewer)},8743:(at,st,ot)=>{"use strict";ot.d(st,{A:()=>Viewer});ot(9616);var ut=ot(8340),Hl=ot(3407),rc=ot(2771),sc=ot(7343),oc=ot(5995),_c=ot(9683),wc=ot(2e3),Sc=ot(9438),iu=ot(2118);const su=100;class Viewer extends Hl.Ay{constructor(){super(),this["map-options"]=!0,this.geocoder=this.getAttribute("geocoder")||"nominatim",this.mini=(0,oc.createWebComp)("pnx-mini",{slot:"bottom-left",_parent:this,onexpand:this._onMiniExpand.bind(this),collapsed:!!(0,sc.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 at,st;this._initParams=new iu.Ay(iu.Ay.GetComponentProperties(Viewer,this),Object.assign({},null===(at=this.urlHandler)||void 0===at?void 0:at.currentURLParams(),null===(st=this.urlHandler)||void 0===st?void 0:st.currentURLParams(!0)),{map:(0,ut.getMapParamsFromLocalStorage)(),disableAnnotations:localStorage.getItem(sc.DISABLE_ANNOTATIONS_PARAM)})}_initWidgets(){var at,st;"false"!==this._initParams.getParentPostInit().widgets&&(this.grid.appendChild((0,oc.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,sc.isInIframe)()?(this.legend=(0,oc.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,oc.createWebComp)("pnx-picture-legend",{_parent:this}),this.bottomDrawer=(0,oc.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",(at=>{(0,sc.isNullId)(at.detail.picId)?this.bottomDrawer.classList.add("pnx-hidden"):this.bottomDrawer.classList.remove("pnx-hidden")}))):(this.legend=(0,oc.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,oc.createWebComp)("pnx-mini-picture-legend",{_parent:this}),this.grid.appendChild(this.legend)),(0,sc.isInIframe)()||(this.grid.appendChild((0,oc.createWebComp)("pnx-widget-player",{slot:"top",_parent:this,class:"pnx-only-psv pnx-print-hidden",size:this.isHeightSmall()?"md":"xl"})),this.grid.appendChild((0,oc.createWebComp)("pnx-annotations-switch",{slot:"top",_parent:this,class:"pnx-only-psv pnx-print-hidden",size:this.isHeightSmall()?"md":"xl"})),this.grid.appendChild((0,oc.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,oc.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===(at=this.map)||void 0===at||null===(st=at._hasQualityScore)||void 0===st?void 0:st.call(at))||!1,class:"pnx-only-map pnx-print-hidden"})),this.grid.appendChild((0,oc.createWebComp)("pnx-widget-maplayers",{slot:"top-right",_parent:this,class:"pnx-only-map pnx-print-hidden"}))))}disconnectedCallback(){var at;super.disconnectedCallback(),null===(at=this.map)||void 0===at||at.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(at,st,ot){var ut,Hl;if(super.attributeChangedCallback(at,st,ot),"picture"===at)if(null===(ut=this.legend)||void 0===ut||null===(Hl=ut.setAttribute)||void 0===Hl||Hl.call(ut,"picture",ot),(0,sc.isNullId)(st)&&!(0,sc.isNullId)(ot)&&this.mini.removeAttribute("collapsed"),(0,sc.isNullId)(ot))this.map&&this.isMapWide()?this.mini.classList.add("pnx-hidden"):this.map&&!this.isMapWide()&&this._setFocus("map");else if((0,sc.isNullId)(st)&&this.sequence==this._initParams.getParentPostInit().sequence&&!this._initParams.getParentPostInit().picture){var rc,oc;this.mini.classList.remove("pnx-hidden"),this.mini.removeAttribute("collapsed"),"closed"===(null===(rc=this.bottomDrawer)||void 0===rc||null===(oc=rc.getAttribute)||void 0===oc?void 0:oc.call(rc,"openness"))&&this.bottomDrawer.setAttribute("openness","half-opened")}else{var _c,wc;if(this.mini.classList.remove("pnx-hidden"),(0,sc.isNullId)(st))this._setFocus("pic"),"closed"===(null===(_c=this.bottomDrawer)||void 0===_c||null===(wc=_c.getAttribute)||void 0===wc?void 0:wc.call(_c,"openness"))&&this.bottomDrawer.setAttribute("openness","half-opened")}"focus"===at&&this._setFocus(ot)}onceMapReady(){if(!this.map)return Promise.resolve();let at;return new Promise((st=>{at=setInterval((()=>{var ot,ut,Hl;"object"===typeof this.map&&(null!==(ot=this.map)&&void 0!==ot&&null!==(ut=ot.loaded)&&void 0!==ut&&ut.call(ot)?(clearInterval(at),st()):null!==(Hl=this.map)&&void 0!==Hl&&Hl.once&&this.map.once("render",(()=>{clearInterval(at),st()})))}),250)}))}async _initMap(){await new Promise((at=>{this.map=new rc.A(this,this.mapContainer,this._initParams.getMapInit()),(0,ut.saveMapParamsToLocalStorage)(this.map),this.map.once("users-changed",(()=>{this.loader.setAttribute("value",75),at()}))})),await(0,iu.mK)(this.map,this._initParams.getMapPostInit()),(0,ut.initMapKeyboardHandler)(this),(0,ut.linkMapAndPhoto)(this)}async _postAPIInit(){this.loader.setAttribute("value",30),this._createInitParamsHandler();const at=this._initParams.getParentPostInit();this._initPSV(),await this._initMap(),this._initWidgets(),this._moveChildToGrid(),(0,iu.iz)(this,at),at.keyboardShortcuts&&this._handleKeyboardManagement(),at.willLoadPicture?this.psv.addEventListener("picture-loaded",(st=>{(0,iu.iz)(this,at),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(at){const st=(null===at||void 0===at?void 0:at.target)||document.activeElement;if(this.contains(st)){for(let at of this.grid.childNodes)if("bg"!==at.getAttribute("slot")&&!Hl.RD.includes(at.tagName.toLowerCase())&&at.contains(st))return void this._disableKeyboard();this._enableKeyboard()}else this._disableKeyboard()}_handleKeyboardManagement(){window.addEventListener("click",(at=>this._toggleKeyboardBasedOnFocus(at))),window.addEventListener("keypress",this._toggleKeyboardBasedOnFocus.bind(this)),this.addEventListener("focus-changed",(at=>{this.popup.getAttribute("visible")?this._disableKeyboard():"map"===at.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 at of this.grid.childNodes)"bg"===at.getAttribute("slot")||Hl.RD.includes(at.tagName.toLowerCase())||(at.addEventListener("focusin",this._disableKeyboard.bind(this)),at.addEventListener("focusout",(()=>{null===this.popup.getAttribute("visible")&&this._enableKeyboard()})))}moveCenter(){const at=this.psv.getPictureMetadata();at&&(this.map&&this.isMapWide()?this.map.flyTo({center:at.gps,zoom:20}):super.moveCenter())}_moveToDirection(at){if(this.map&&this.isMapWide()){let st;switch(at){case"up":st=[0,-100];break;case"left":st=[-100,0];break;case"down":st=[0,su];break;case"right":st=[su,0]}this.map.panBy(st)}else super._moveToDirection(at)}isMapWide(){return this.mapContainer.parentNode==this.grid}_setFocus(at){var st,ot,ut,Hl;let rc=arguments.length>1&&void 0!==arguments[1]&&arguments[1],Sc=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if("map"===at&&!this.map)throw new Error("Map is not enabled");if(!["map","pic"].includes(at))throw new Error("Invalid focus value (should be pic or map)");if(this.focus=at,(Sc||("map"!==at||!this.map||!this.isMapWide())&&("pic"!==at||this.map&&this.isMapWide()))&&("map"===at?(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,oc.fa)(_c.pt),this._miniPicLegend&&this.mini.appendChild(this._miniPicLegend),(0,sc.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,oc.fa)(wc.e5),this.psvContainer.focus()),null===this||void 0===this||null===(st=this.map)||void 0===st||null===(ot=st.resize)||void 0===ot||ot.call(st),this.psv.autoSize(),this.psv.forceRefresh(),null===(ut=this.legend)||void 0===ut||null===(Hl=ut.setAttribute)||void 0===Hl||Hl.call(ut,"focus",this.focus),!rc)){const st=new CustomEvent("focus-changed",{detail:{focus:at}});this.dispatchEvent(st)}}_toggleFocus(){this._setFocus(this.isMapWide()?"pic":"map")}_onMiniExpand(){this.map.resize(),this.psv.autoSize()}_onMapFiltersChange(){var at;const st=(0,Sc.qi)("#pnx-map-filters-menu"),ot=(0,Sc.qi)("#pnx-map-theme"),Hl=(0,ut.mapFiltersFormValues)(st,ot,null===(at=this.map)||void 0===at?void 0:at._hasQualityScore());this.map.setFilters(Hl)}}Viewer.properties={"map-options":{converter:Hl.Ay.GetJSONConverter()},focus:{type:String,reflect:!0},geocoder:{type:String},tabindex:{type:Number},...Hl.Ay.properties},customElements.define("pnx-viewer",Viewer)},3921:(at,st,ot)=>{"use strict";ot.r(st),ot.d(st,{Basic:()=>ut.A,CoverageMap:()=>Hl.A,Editor:()=>rc.A,PhotoViewer:()=>oc.Ay,Viewer:()=>sc.A});var ut=ot(9039),Hl=ot(153),rc=ot(1752),sc=ot(8743),oc=ot(3407)},9341:(at,st,ot)=>{"use strict";ot.r(st),ot.d(st,{core:()=>ut,layout:()=>Hl,menus:()=>rc,ui:()=>sc});var ut=ot(3921),Hl=ot(456),rc=ot(8794),sc=ot(9472)},6784:(at,st,ot)=>{"use strict";ot.d(st,{A:()=>BottomDrawer});var ut=ot(4542),Hl=ot(1198),rc=ot(5995);const sc={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 at=this._getDrawer();at&&(at.style.height=`${this._drawerHeight}px`,at.style.maxHeight=`${this._drawerHeight}px`,(0,rc.onceParentAvailable)(this).then((()=>this._parent.onceReady())).then((()=>{var at,st;null===(at=this._parent.map)||void 0===at||at.addEventListener("click",(()=>this.openness="closed")),null===(st=this._parent.psv)||void 0===st||st.addEventListener("click",(()=>this.openness="closed"))})))}attributeChangedCallback(at,st,ot){if(super.attributeChangedCallback(at,st,ot),"openness"===at){if("opened"!==ot){const at=this.shadowRoot.querySelector(".content");at&&(at.scrollTop=0)}const at=this._getDrawer();at&&(at.style.transform=null)}}disconnectedCallback(){super.disconnectedCallback(),this._cleanupTouchListeners()}_getDrawer(){var at;return null===(at=this.shadowRoot)||void 0===at?void 0:at.querySelector(".drawer")}_onHandleClick(){"opened"===this.openness?this.openness="closed":"half-opened"===this.openness?this.openness="opened":"closed"===this.openness&&(this.openness="half-opened")}_onTouchStart(at){this._isDragging=!0,this._startFingerY=at.touches[0].clientY,this._deltaFingerY=0,this._drawerY=this._drawerHeight*sc[this.openness],window.addEventListener("touchmove",this._boundTouchMove,{passive:!0}),window.addEventListener("touchend",this._boundTouchEnd),window.addEventListener("touchcancel",this._boundTouchEnd)}_onTouchMove(at){if(!this._isDragging)return;const st=this.shadowRoot.querySelector(".content");st.scrollHeight>st.offsetHeight&&st.scrollTop>0?this._updateDrawerTransform(0):(this._deltaFingerY=at.touches[0].clientY-this._startFingerY,this._updateDrawerTransform(this._drawerY+this._deltaFingerY))}_onTouchEnd(at){(this._isDragging&&!(Math.abs(this._deltaFingerY)<30)||at.target.closest(".handle"))&&(at.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(at){let st=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const ot=this._getDrawer();ot&&(at=Math.max(0,Math.min(at,this._drawerHeight-30)),st&&(this._deltaFingerY<0?"closed"===this.openness?Math.abs(this._deltaFingerY)>this._drawerHeight*(1-sc["half-opened"])?this.openness="opened":this.openness="half-opened":this.openness="opened":this.openness="closed",this._drawerY=null,at=Math.max(0,Math.min(sc[this.openness]*this._drawerHeight,this._drawerHeight-30))),ot.style.transform=`translateY(${at}px)`)}render(){const at={drawer:!0,[this.openness]:!0,dragging:this._isDragging};return ut.qy`
12
+ !function(at,st){"object"===typeof exports&&"object"===typeof module?module.exports=st():"function"===typeof define&&define.amd?define("Panoramax",[],st):"object"===typeof exports?exports.Panoramax=st():at.Panoramax=st()}(this,(()=>(()=>{var at={9039:(at,st,ot)=>{"use strict";ot.d(st,{A:()=>Basic});var ut=ot(4542),Hl=ot(5254),rc=ot(4964),sc=ot(7208),oc=ot(5995),_c=ot(7343),wc=ot(2614),Sc=ot.n(wc),iu=ot(8330);ot(1865),ot(3638);class Basic extends ut.WF{constructor(){let at=arguments.length>0&&void 0!==arguments[0]&&arguments[0];super(),this.users=["geovisio"],this["map-style"]=this.getAttribute("map-style")||(0,sc.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 ${iu.rE} (b34f912)\n\n\ud83c\udd98 Issues can be reported at ${iu.Jk.O}`),at||(this._isInternetFast=null,(0,_c.isInternetFast)().then((at=>this._isInternetFast=at)))}connectedCallback(){super.connectedCallback(),this._t=(0,rc.getTranslations)(this.lang),this.loader=(0,oc.createWebComp)("pnx-loader",{_parent:this,"no-label":(0,_c.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((at=>{let[st,ot]=at;this.getAttribute(st)&&console.error(`Component attribute "${st}" has been renamed into "${ot}". Old attribute "${st}" is ignored.`)}))}_setupAPI(){if(this.loader=this.loader||(0,oc.createWebComp)("pnx-loader",{_parent:this}),!this.endpoint)return void console.warn("No endpoint is defined");this._loadsAPI=this.endpoint;let at=this.endpoint;try{this["map-style"]=JSON.parse(this["map-style"])}catch(ot){}try{this.api=new Hl.A(this.endpoint,{users:this.users,fetch:this["fetch-options"],style:this["map-style"]}),this.api.onceReady().then((()=>{if(at!=this._loadsAPI||!this.api)return;let st=this.api.getUnavailableFeatures(),ot=this.api.getAvailableFeatures();ot=0===st.length?"\u2705 All features available":"\u2705 Available features: "+ot.join(", "),st=0===st.length?"":"\ud83d\udeab Unavailable features: "+st.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 ${ot}\n ${st}\n`.trim())})).catch((at=>this.loader.dismiss(at,this._t.pnx.error_api))).finally((()=>delete this._loadsAPI))}catch(ot){var st;delete this._loadsAPI,null!==(st=this.loader)&&void 0!==st&&st.dismiss?this.loader.dismiss(ot,this._t.pnx.error_api):console.error(ot)}}onceReady(){throw new Error("You must override this method on sub-class")}onceAPIReady(){return this.api?this.api.onceReady():new Promise((at=>setTimeout(at,100))).then(this.onceAPIReady.bind(this))}createRenderRoot(){return this}attributeChangedCallback(at,st,ot){if(super.attributeChangedCallback(at,st,ot),"endpoint"===at&&(this._loadsAPI&&ot&&this._loadsAPI===ot||this.api&&this.api._endpoint===ot||!ot||((this._loadsAPI||this.api)&&(delete this.api,delete this._loadsAPI),this._setupAPI())),["picture","sequence"].includes(at)){let ut,Hl,rc,sc;"picture"===at?(ut=this.sequence,rc=this.sequence,Hl=ot,sc=st):(ut=ot,rc=st,Hl=this.picture,sc=this.picture),this.dispatchEvent(new CustomEvent("select",{bubbles:!0,composed:!0,detail:{seqId:ut,picId:Hl,prevSeqId:rc,prevPicId:sc}}))}}getClassName(){return"Basic"}select(){let at=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,st=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=st,this.sequence=at}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(at,st,ot){let ut=at.split(":").shift();if(ut&&this.getSubComponentsNames().includes(ut)){var Hl;const rc=at.substring(ut.length+1);null!==(Hl=this[ut])&&void 0!==Hl&&Hl.addEventListener?this[ut].addEventListener(rc,st,ot):setTimeout((()=>this.addEventListener(at,st,ot)),50)}else super.addEventListener(at,st,ot)}static GetJSONConverter(){return{fromAttribute:at=>null===at||""===at?null:"object"===typeof at||Array.isArray(at)?at:Sc().parse(at),toAttribute:at=>null===at||""===at?"":"string"===typeof at?at:Sc().stringify(at)}}}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:(at,st,ot)=>{"use strict";ot.d(st,{A:()=>CoverageMap});var ut=ot(9039),Hl=ot(5642),rc=ot(8340),sc=ot(927),oc=(ot(7776),ot(2118));class CoverageMap extends ut.A{constructor(){super(),this._mapContainer=document.createElement("div"),this.onceAPIReady().then((()=>{this.loader.setAttribute("value",30),this._initParams=new oc.Ay(oc.Ay.GetComponentProperties(CoverageMap,this)),this._initMap()}))}disconnectedCallback(){var at;super.disconnectedCallback(),null===(at=this.map)||void 0===at||at.destroy()}getClassName(){return"CoverageMap"}onceReady(){return this.map&&this.map.waitForEnoughMapLoaded?this.map.waitForEnoughMapLoaded():new Promise((at=>setTimeout(at,100))).then(this.onceReady.bind(this))}render(){return[this.loader,this._mapContainer]}getSubComponentsNames(){const at=super.getSubComponentsNames();return at.push("map"),at}_initMap(){class MyMap extends Hl.A{_getLayerStyleProperties(at){return"pictures_symbols"===at?{layout:{visibility:"none"}}:super._getLayerStyleProperties(at)}}this.map=new MyMap(this,this._mapContainer,Object.assign({},this._initParams.getMapInit(),{hash:!0})),this.map.addControl(new sc.NavigationControl({showCompass:!1})),this.loader.setAttribute("value",70),this.addEventListener("select",this._onSelect.bind(this)),this.map.on("picture-click",(at=>this.select(at.seqId,at.picId))),this.map.on("sequence-click",(at=>this.select(at.seqId))),this.map.waitForEnoughMapLoaded().then((async()=>{await(0,oc.mK)(this.map,this._initParams.getMapPostInit()),this.map.reloadLayersStyles(),this.loader.dismiss()}))}_onSelect(at){if(at.detail.picId||at.detail.seqId){const st=at.detail.picId?"pictures":"sequences",ot=this.map.queryRenderedFeatures({layers:[...this.map._userLayers].map((at=>(0,rc.getUserLayerId)(at,st))),filter:["==",["get","id"],at.detail.picId||at.detail.seqId]});ot.length>=0&&null!=ot[0]&&this.map._attachPreviewToPictures({features:ot},st)}}}CoverageMap.properties={"map-options":{converter:ut.A.GetJSONConverter()},...ut.A.properties},customElements.define("pnx-coverage-map",CoverageMap)},1752:(at,st,ot)=>{"use strict";ot.d(st,{A:()=>Editor});ot(7365);var ut=ot(9039),Hl=ot(5642),rc=ot(9048),sc=ot(508),oc=ot(8340),_c=ot(1545),wc=ot(5995);const Sc="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,wc.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 at,st;super.disconnectedCallback(),null===(at=this.map)||void 0===at||at.destroy(),null===(st=this.psv)||void 0===st||st.destroy()}getClassName(){return"Editor"}onceReady(){var at,st;return this.map&&this.psv&&null!==(at=(st=this.map).loaded)&&void 0!==at&&at.call(st)?Promise.resolve():new Promise((at=>setTimeout(at,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(at,st,ot){"users"===at&&Array.isArray(ot)&&ot.length>0?console.warn("Parameters users can't be changed in Editor, only selected sequence can be visible"):super.attributeChangedCallback(at,st,ot)}render(){return[this.loader,this.grid]}getSubComponentsNames(){return super.getSubComponentsNames().concat(["map","psv","grid"])}_initPSV(){try{this.psv=new rc.Ay(this,this._psvContainer),this.psv._myVTour.datasource.nodeResolver=this._getNode.bind(this)}catch(at){let st=_c.IJ.isWebGLSupported?this._t.pnx.error_psv:this._t.pnx.error_webgl;this.loader.dismiss(at,st)}}_initMap(){try{this.map=new Hl.A(this,this._mapContainer,{raster:this.raster,background:this.background,supplementaryStyle:this._createMapStyle(),zoom:15,picMarkerDraggable:!0}),(0,oc.linkMapAndPhoto)(this),this.loader.setAttribute("value",50),this._loadSequence(),this.map.once("load",(()=>{this.map.hasTwoBackgrounds()&&this._addMapBackgroundWidget(),this._bindPicturesEvents()}));const at=this.map._picMarker.setRotation.bind(this.map._picMarker);this.map._picMarker.setRotation=st=>(st=void 0===this._lastRelHeading?st:st+this._lastRelHeading-this.psv.getPictureRelativeHeading(),at(st))}catch(at){this.loader.dismiss(at,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:{...oc.VECTOR_STYLES.SEQUENCES.layout},paint:{...oc.VECTOR_STYLES.SEQUENCES.paint}},{id:"geovisio_editor_pictures",type:"circle",source:"geovisio_editor_sequences",layout:{...oc.VECTOR_STYLES.PICTURES.layout},paint:{...oc.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((at=>{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=at.features,this.map.getSource("geovisio_editor_sequences").setData({type:"FeatureCollection",features:[{id:this.sequence,type:"Feature",properties:{id:this.sequence},geometry:{type:"LineString",coordinates:at.features.map((at=>at.geometry.coordinates))}},...at.features.map((at=>(at.properties.id=at.id,at.properties.sequences=[this.sequence],at)))]}),this.picture){const st=at.features.find((at=>at.id===this.picture));st?(this.select(this.sequence,this.picture,!0),this.map.jumpTo({center:st.geometry.coordinates,zoom:18})):console.log("Picture with ID",st,"was not found")}else{const st=[...at.features[0].geometry.coordinates,...at.features[0].geometry.coordinates];for(let ot=1;ot<at.features.length;ot++){const ut=at.features[ot].geometry.coordinates;ut[0]<st[0]&&(st[0]=ut[0]),ut[1]<st[1]&&(st[1]=ut[1]),ut[0]>st[2]&&(st[2]=ut[0]),ut[1]>st[3]&&(st[3]=ut[1])}this.map.fitBounds(st,{animate:!1})}})).catch((at=>this.loader.dismiss(at,this._t.pnx.error_api)))}_getNode(at){const st=this._sequenceData.find((st=>st.properties.id===at)),ot=st?(0,sc.apiFeatureToPSVNode)(st,this._t,this._isInternetFast,void 0,(at=>this.api.cleanResourceURL(at))):null;return ot&&delete ot.links,ot}_addMapBackgroundWidget(){const at=(0,wc.createWebComp)("pnx-map-background",{_parent:this,size:"sm",slot:"bottom-left"});this.grid.appendChild(at)}_moveChildToGrid(){Array.from(this.querySelectorAll("[slot]")).forEach((at=>{var st;null!==(st=at.tagName)&&void 0!==st&&st.toLowerCase().startsWith("pnx-")&&(at._parent=this,at._t=this._t),this.grid.appendChild(at)}))}previewSequenceHeadingChange(at){const st=void 0!==this.map.getLayer(Sc);if(this.map._picMarkerPreview.remove(),void 0===at)return delete this._lastRelHeading,st&&this.map.setLayoutProperty(Sc,"visibility","none"),void(this.picture&&this.map._picMarker.setRotation(this.psv.getXY().x));this._lastRelHeading=at,st||this.map.addLayer({id:Sc,type:"symbol",source:"geovisio_editor_sequences",layout:{"icon-image":"pnx-marker","icon-overlap":"always","icon-size":.8}});const ot=-this.psv.getPictureRelativeHeading();this.map.setLayoutProperty(Sc,"visibility","visible"),this.map.setLayoutProperty(Sc,"icon-rotate",["+",["get","view:azimuth"],ot,at]);const ut=[["==",["geometry-type"],"Point"]];this.picture&&ut.push(["!=",["get","id"],this.picture]),this.map.setFilter(Sc,["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:(at,st,ot)=>{"use strict";ot.d(st,{$p:()=>iu,Ay:()=>PhotoViewer,RD:()=>lu});ot(970);var ut=ot(1545),Hl=ot(4451),rc=ot(9039),sc=ot(9048),oc=ot(5995),_c=ot(7343),wc=ot(2118),Sc=ot(4207);const iu=20,su=Math.PI/6,lu=["pnx-mini","pnx-widget-player","pnx-widget-zoom"];class PhotoViewer extends rc.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,oc.createWebComp)("pnx-cornered-grid"),this.psvContainer=document.createElement("div"),this.psvContainer.setAttribute("slot","bg"),this.grid.appendChild(this.psvContainer),this.popup=(0,oc.createWebComp)("pnx-popup",{_parent:this,onclose:this._onPopupClose.bind(this)}),this.tabindex=0}_createInitParamsHandler(){var at,st;this._initParams=new wc.Ay(wc.Ay.GetComponentProperties(PhotoViewer,this),Object.assign({},null===(at=this.urlHandler)||void 0===at?void 0:at.currentURLParams(),null===(st=this.urlHandler)||void 0===st?void 0:st.currentURLParams(!0)),{disableAnnotations:localStorage.getItem(_c.DISABLE_ANNOTATIONS_PARAM)})}_initWidgets(){"false"!==this._initParams.getParentPostInit().widgets&&((0,_c.isInIframe)()||(this.grid.appendChild((0,oc.createWebComp)("pnx-widget-player",{slot:"top",_parent:this,class:"pnx-only-psv pnx-print-hidden",size:this.isHeightSmall()?"md":"xl"})),this.grid.appendChild((0,oc.createWebComp)("pnx-annotations-switch",{slot:"top",_parent:this,class:"pnx-only-psv pnx-print-hidden",size:this.isHeightSmall()?"md":"xl"}))),(0,_c.isInIframe)()?(this.legend=(0,oc.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,oc.createWebComp)("pnx-picture-legend",{_parent:this}),this.bottomDrawer=(0,oc.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",(at=>{(0,_c.isNullId)(at.detail.picId)?this.bottomDrawer.classList.add("pnx-hidden"):this.bottomDrawer.classList.remove("pnx-hidden")}))):(this.legend=(0,oc.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,oc.createWebComp)("pnx-widget-zoom",{slot:"bottom-right",class:"pnx-print-hidden",_parent:this})),this.grid.appendChild(this.legend)))}connectedCallback(){super.connectedCallback(),this.presetsManager=new Sc.A(this.lang),this["url-parameters"]&&"false"!==this["url-parameters"]&&(this.urlHandler=new Hl.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 at,st;super.disconnectedCallback(),null===(at=this.urlHandler)||void 0===at||at.destroy(),null===(st=this.psv)||void 0===st||st.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 at;return new Promise((st=>{at=setInterval((()=>{this.psv&&"object"===typeof this.psv&&(this.psv.container?(clearInterval(at),st()):this.psv.addEventListener&&this.psv.addEventListener("ready",(()=>{clearInterval(at),st()}),{once:!0}))}),250)}))}onceFirstPicLoaded(){return this.oncePSVReady().then((()=>this.psv.getPictureMetadata()?Promise.resolve():new Promise((at=>{this.psv.addEventListener("picture-loaded",at,{once:!0})}))))}async _postAPIInit(){this.loader.setAttribute("value",30),this._createInitParamsHandler();const at=this._initParams.getParentPostInit();this._initPSV(),this._initWidgets(),(0,wc.ai)(this,at),at.keyboardShortcuts&&this._handleKeyboardManagement(),at.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 sc.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 at;return null===(at=this._toggleFocus)||void 0===at?void 0:at.call(this)},7:()=>{var at;return null===(at=this._toggleFocus)||void 0===at?void 0:at.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,wc.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(at){let st=ut.IJ.isWebGLSupported?this._t.pnx.error_psv:this._t.pnx.error_webgl;this.loader.dismiss(at,st)}}_enableKeyboard(){this.psv.startKeyboardControl()}_disableKeyboard(){this.psv.stopKeyboardControl()}_toggleKeyboardBasedOnFocus(at){const st=(null===at||void 0===at?void 0:at.target)||document.activeElement;if(this.contains(st)){for(let at of this.grid.childNodes)if("bg"!==at.getAttribute("slot")&&!lu.includes(at.tagName.toLowerCase())&&at.contains(st))return void this._disableKeyboard();this._enableKeyboard()}else this._disableKeyboard()}_handleKeyboardManagement(){window.addEventListener("click",(at=>this._toggleKeyboardBasedOnFocus(at))),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 at of this.grid.childNodes)"bg"===at.getAttribute("slot")||lu.includes(at.tagName.toLowerCase())||(at.addEventListener("focusin",this._disableKeyboard.bind(this)),at.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((at=>{var st;null!==(st=at.tagName)&&void 0!==st&&st.toLowerCase().startsWith("pnx-")&&(at._parent=this,at._t=this._t),"editors"===at.getAttribute("slot")?this.onceReady().then((()=>{var st;return null===(st=this.legend)||void 0===st?void 0:st.appendChild(at)})):this.grid.appendChild(at)}))}setPopup(at){let st=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;at?this.popup.setAttribute("visible",""):this.popup.removeAttribute("visible"),this.popup.innerHTML="","string"===typeof st?this.popup.innerHTML=st:Array.isArray(st)&&st.forEach((at=>this.popup.appendChild(at)))}_onPopupClose(){this.dispatchEvent(new CustomEvent("focus-changed",{detail:{focus:this.map&&this.isMapWide()?"map":"pic"}}))}_showQualityScoreDoc(){this.setPopup(!0,[(0,oc.createWebComp)("pnx-quality-score-doc",{_t:this._t})])}_showReportForm(){if(!this.psv.getPictureMetadata())throw new Error("No picture currently selected");this.setPopup(!0,[(0,oc.createWebComp)("pnx-report-form",{_parent:this})])}_showShareOptions(){this.setPopup(!0,[(0,oc.createWebComp)("pnx-share-menu",{_parent:this})])}moveCenter(){this.psv.getPictureMetadata()&&this._psvAnimate({speed:sc.LM,yaw:0,pitch:0,zoom:sc.cS})}moveLeft(){this._moveToDirection("left")}moveRight(){this._moveToDirection("right")}moveUp(){this._moveToDirection("up")}moveDown(){this._moveToDirection("down")}_moveToDirection(at){let st=this.psv.getPosition();switch(at){case"up":st.pitch+=su;break;case"left":st.yaw-=su;break;case"down":st.pitch-=su;break;case"right":st.yaw+=su}this._psvAnimate({speed:sc.LM,...st})}_psvAnimate(at){this._lastPsvAnim&&this._lastPsvAnim.cancel(),this._lastPsvAnim=this.psv.animate(at)}addEventListener(at,st,ot){super.addEventListener(at,st,ot)}}PhotoViewer.properties={"psv-options":{converter:rc.A.GetJSONConverter()},widgets:{type:String},"url-parameters":{type:String},"keyboard-shortcuts":{type:String},tabindex:{type:Number},...rc.A.properties},customElements.define("pnx-photo-viewer",PhotoViewer)},8743:(at,st,ot)=>{"use strict";ot.d(st,{A:()=>Viewer});ot(9616);var ut=ot(8340),Hl=ot(3407),rc=ot(2771),sc=ot(7343),oc=ot(5995),_c=ot(9683),wc=ot(2e3),Sc=ot(9438),iu=ot(2118);const su=100;class Viewer extends Hl.Ay{constructor(){super(),this["map-options"]=!0,this.geocoder=this.getAttribute("geocoder")||"nominatim",this.mini=(0,oc.createWebComp)("pnx-mini",{slot:"bottom-left",_parent:this,onexpand:this._onMiniExpand.bind(this),collapsed:!!(0,sc.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 at,st;this._initParams=new iu.Ay(iu.Ay.GetComponentProperties(Viewer,this),Object.assign({},null===(at=this.urlHandler)||void 0===at?void 0:at.currentURLParams(),null===(st=this.urlHandler)||void 0===st?void 0:st.currentURLParams(!0)),{map:(0,ut.getMapParamsFromLocalStorage)(),disableAnnotations:localStorage.getItem(sc.DISABLE_ANNOTATIONS_PARAM)})}_initWidgets(){var at,st;"false"!==this._initParams.getParentPostInit().widgets&&(this.grid.appendChild((0,oc.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,sc.isInIframe)()?(this.legend=(0,oc.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,oc.createWebComp)("pnx-picture-legend",{_parent:this}),this.bottomDrawer=(0,oc.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",(at=>{(0,sc.isNullId)(at.detail.picId)?this.bottomDrawer.classList.add("pnx-hidden"):this.bottomDrawer.classList.remove("pnx-hidden")}))):(this.legend=(0,oc.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,oc.createWebComp)("pnx-mini-picture-legend",{_parent:this}),this.grid.appendChild(this.legend)),(0,sc.isInIframe)()||(this.grid.appendChild((0,oc.createWebComp)("pnx-widget-player",{slot:"top",_parent:this,class:"pnx-only-psv pnx-print-hidden",size:this.isHeightSmall()?"md":"xl"})),this.grid.appendChild((0,oc.createWebComp)("pnx-annotations-switch",{slot:"top",_parent:this,class:"pnx-only-psv pnx-print-hidden",size:this.isHeightSmall()?"md":"xl"})),this.grid.appendChild((0,oc.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,oc.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===(at=this.map)||void 0===at||null===(st=at._hasQualityScore)||void 0===st?void 0:st.call(at))||!1,class:"pnx-only-map pnx-print-hidden"})),this.grid.appendChild((0,oc.createWebComp)("pnx-widget-maplayers",{slot:"top-right",_parent:this,class:"pnx-only-map pnx-print-hidden"}))))}disconnectedCallback(){var at;super.disconnectedCallback(),null===(at=this.map)||void 0===at||at.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(at,st,ot){var ut,Hl;if(super.attributeChangedCallback(at,st,ot),"picture"===at)if(null===(ut=this.legend)||void 0===ut||null===(Hl=ut.setAttribute)||void 0===Hl||Hl.call(ut,"picture",ot),(0,sc.isNullId)(st)&&!(0,sc.isNullId)(ot)&&this.mini.removeAttribute("collapsed"),(0,sc.isNullId)(ot))this.map&&this.isMapWide()?this.mini.classList.add("pnx-hidden"):this.map&&!this.isMapWide()&&this._setFocus("map");else if((0,sc.isNullId)(st)&&this.sequence==this._initParams.getParentPostInit().sequence&&!this._initParams.getParentPostInit().picture){var rc,oc;this.mini.classList.remove("pnx-hidden"),this.mini.removeAttribute("collapsed"),"closed"===(null===(rc=this.bottomDrawer)||void 0===rc||null===(oc=rc.getAttribute)||void 0===oc?void 0:oc.call(rc,"openness"))&&this.bottomDrawer.setAttribute("openness","half-opened")}else{var _c,wc;if(this.mini.classList.remove("pnx-hidden"),(0,sc.isNullId)(st))this._setFocus("pic"),"closed"===(null===(_c=this.bottomDrawer)||void 0===_c||null===(wc=_c.getAttribute)||void 0===wc?void 0:wc.call(_c,"openness"))&&this.bottomDrawer.setAttribute("openness","half-opened")}"focus"===at&&this._setFocus(ot)}onceMapReady(){if(!this.map)return Promise.resolve();let at;return new Promise((st=>{at=setInterval((()=>{var ot,ut,Hl;"object"===typeof this.map&&(null!==(ot=this.map)&&void 0!==ot&&null!==(ut=ot.loaded)&&void 0!==ut&&ut.call(ot)?(clearInterval(at),st()):null!==(Hl=this.map)&&void 0!==Hl&&Hl.once&&this.map.once("render",(()=>{clearInterval(at),st()})))}),250)}))}async _initMap(){await new Promise((at=>{this.map=new rc.A(this,this.mapContainer,this._initParams.getMapInit()),(0,ut.saveMapParamsToLocalStorage)(this.map),this.map.once("users-changed",(()=>{this.loader.setAttribute("value",75),at()}))})),await(0,iu.mK)(this.map,this._initParams.getMapPostInit()),(0,ut.initMapKeyboardHandler)(this),(0,ut.linkMapAndPhoto)(this)}async _postAPIInit(){this.loader.setAttribute("value",30),this._createInitParamsHandler();const at=this._initParams.getParentPostInit();this._initPSV(),await this._initMap(),this._initWidgets(),this._moveChildToGrid(),(0,iu.iz)(this,at),at.keyboardShortcuts&&this._handleKeyboardManagement(),at.willLoadPicture?this.psv.addEventListener("picture-loaded",(st=>{(0,iu.iz)(this,at),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(at){const st=(null===at||void 0===at?void 0:at.target)||document.activeElement;if(this.contains(st)){for(let at of this.grid.childNodes)if("bg"!==at.getAttribute("slot")&&!Hl.RD.includes(at.tagName.toLowerCase())&&at.contains(st))return void this._disableKeyboard();this._enableKeyboard()}else this._disableKeyboard()}_handleKeyboardManagement(){window.addEventListener("click",(at=>this._toggleKeyboardBasedOnFocus(at))),window.addEventListener("keypress",this._toggleKeyboardBasedOnFocus.bind(this)),this.addEventListener("focus-changed",(at=>{this.popup.getAttribute("visible")?this._disableKeyboard():"map"===at.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 at of this.grid.childNodes)"bg"===at.getAttribute("slot")||Hl.RD.includes(at.tagName.toLowerCase())||(at.addEventListener("focusin",this._disableKeyboard.bind(this)),at.addEventListener("focusout",(()=>{null===this.popup.getAttribute("visible")&&this._enableKeyboard()})))}moveCenter(){const at=this.psv.getPictureMetadata();at&&(this.map&&this.isMapWide()?this.map.flyTo({center:at.gps,zoom:20}):super.moveCenter())}_moveToDirection(at){if(this.map&&this.isMapWide()){let st;switch(at){case"up":st=[0,-100];break;case"left":st=[-100,0];break;case"down":st=[0,su];break;case"right":st=[su,0]}this.map.panBy(st)}else super._moveToDirection(at)}isMapWide(){return this.mapContainer.parentNode==this.grid}_setFocus(at){var st,ot,ut,Hl;let rc=arguments.length>1&&void 0!==arguments[1]&&arguments[1],Sc=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if("map"===at&&!this.map)throw new Error("Map is not enabled");if(!["map","pic"].includes(at))throw new Error("Invalid focus value (should be pic or map)");if(this.focus=at,(Sc||("map"!==at||!this.map||!this.isMapWide())&&("pic"!==at||this.map&&this.isMapWide()))&&("map"===at?(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,oc.fa)(_c.pt),this._miniPicLegend&&this.mini.appendChild(this._miniPicLegend),(0,sc.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,oc.fa)(wc.e5),this.psvContainer.focus()),null===this||void 0===this||null===(st=this.map)||void 0===st||null===(ot=st.resize)||void 0===ot||ot.call(st),this.psv.autoSize(),this.psv.forceRefresh(),null===(ut=this.legend)||void 0===ut||null===(Hl=ut.setAttribute)||void 0===Hl||Hl.call(ut,"focus",this.focus),!rc)){const st=new CustomEvent("focus-changed",{detail:{focus:at}});this.dispatchEvent(st)}}_toggleFocus(){this._setFocus(this.isMapWide()?"pic":"map")}_onMiniExpand(){this.map.resize(),this.psv.autoSize()}_onMapFiltersChange(){var at;const st=(0,Sc.qi)("#pnx-map-filters-menu"),ot=(0,Sc.qi)("#pnx-map-theme"),Hl=(0,ut.mapFiltersFormValues)(st,ot,null===(at=this.map)||void 0===at?void 0:at._hasQualityScore());this.map.setFilters(Hl)}}Viewer.properties={"map-options":{converter:Hl.Ay.GetJSONConverter()},focus:{type:String,reflect:!0},geocoder:{type:String},tabindex:{type:Number},...Hl.Ay.properties},customElements.define("pnx-viewer",Viewer)},3921:(at,st,ot)=>{"use strict";ot.r(st),ot.d(st,{Basic:()=>ut.A,CoverageMap:()=>Hl.A,Editor:()=>rc.A,PhotoViewer:()=>oc.Ay,Viewer:()=>sc.A});var ut=ot(9039),Hl=ot(153),rc=ot(1752),sc=ot(8743),oc=ot(3407)},9341:(at,st,ot)=>{"use strict";ot.r(st),ot.d(st,{core:()=>ut,layout:()=>Hl,menus:()=>rc,ui:()=>sc});var ut=ot(3921),Hl=ot(456),rc=ot(8794),sc=ot(9472)},6784:(at,st,ot)=>{"use strict";ot.d(st,{A:()=>BottomDrawer});var ut=ot(4542),Hl=ot(1198),rc=ot(5995);const sc={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 at=this._getDrawer();at&&(at.style.height=`${this._drawerHeight}px`,at.style.maxHeight=`${this._drawerHeight}px`,(0,rc.onceParentAvailable)(this).then((()=>this._parent.onceReady())).then((()=>{var at,st;null===(at=this._parent.map)||void 0===at||at.addEventListener("click",(()=>this.openness="closed")),null===(st=this._parent.psv)||void 0===st||st.addEventListener("click",(()=>this.openness="closed"))})))}attributeChangedCallback(at,st,ot){if(super.attributeChangedCallback(at,st,ot),"openness"===at){if("opened"!==ot){const at=this.shadowRoot.querySelector(".content");at&&(at.scrollTop=0)}const at=this._getDrawer();at&&(at.style.transform=null)}}disconnectedCallback(){super.disconnectedCallback(),this._cleanupTouchListeners()}_getDrawer(){var at;return null===(at=this.shadowRoot)||void 0===at?void 0:at.querySelector(".drawer")}_onHandleClick(){"opened"===this.openness?this.openness="closed":"half-opened"===this.openness?this.openness="opened":"closed"===this.openness&&(this.openness="half-opened")}_onTouchStart(at){this._isDragging=!0,this._startFingerY=at.touches[0].clientY,this._deltaFingerY=0,this._drawerY=this._drawerHeight*sc[this.openness],window.addEventListener("touchmove",this._boundTouchMove,{passive:!0}),window.addEventListener("touchend",this._boundTouchEnd),window.addEventListener("touchcancel",this._boundTouchEnd)}_onTouchMove(at){if(!this._isDragging)return;const st=this.shadowRoot.querySelector(".content");st.scrollHeight>st.offsetHeight&&st.scrollTop>0?this._updateDrawerTransform(0):(this._deltaFingerY=at.touches[0].clientY-this._startFingerY,this._updateDrawerTransform(this._drawerY+this._deltaFingerY))}_onTouchEnd(at){(this._isDragging&&!(Math.abs(this._deltaFingerY)<30)||at.target.closest(".handle"))&&(at.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(at){let st=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const ot=this._getDrawer();ot&&(at=Math.max(0,Math.min(at,this._drawerHeight-30)),st&&(this._deltaFingerY<0?"closed"===this.openness?Math.abs(this._deltaFingerY)>this._drawerHeight*(1-sc["half-opened"])?this.openness="opened":this.openness="half-opened":this.openness="opened":this.openness="closed",this._drawerY=null,at=Math.max(0,Math.min(sc[this.openness]*this._drawerHeight,this._drawerHeight-30))),ot.style.transform=`translateY(${at}px)`)}render(){const at={drawer:!0,[this.openness]:!0,dragging:this._isDragging};return ut.qy`
13
13
  <div
14
14
  class=${(0,Hl.H)(at)}
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),E=A(7343),_=A(2614),x=A.n(_),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} (46faa83)\n\n\ud83c\udd98 Issues can be reported at ${w.Jk.O}`),t||(this._isInternetFast=null,(0,E.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,E.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),E=A(7343),_=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}_createInitParamsHandler(){var t,a;this._initParams=new _.Ay(_.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(E.DISABLE_ANNOTATIONS_PARAM)})}_initWidgets(){"false"!==this._initParams.getParentPostInit().widgets&&((0,E.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,E.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,E.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,_.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,_.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})])}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),E=A(7343),_=A(2614),x=A.n(_),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} (b34f912)\n\n\ud83c\udd98 Issues can be reported at ${w.Jk.O}`),t||(this._isInternetFast=null,(0,E.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,E.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),E=A(7343),_=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}_createInitParamsHandler(){var t,a;this._initParams=new _.Ay(_.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(E.DISABLE_ANNOTATIONS_PARAM)})}_initWidgets(){"false"!==this._initParams.getParentPostInit().widgets&&((0,E.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,E.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,E.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,_.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,_.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})])}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.1.0-develop-46faa835",
3
+ "version": "4.1.0-develop-b34f912e",
4
4
  "description": "Panoramax web viewer for geolocated pictures",
5
5
  "main": "build/index.js",
6
6
  "author": "Panoramax team",
@@ -1 +1,250 @@
1
- {}
1
+ {
2
+ "pnx": {
3
+ "loading_labels_fun": [
4
+ "🦌 Detectando sinais de travessia de veados",
5
+ "🚘 Procurando Panoramax Car ©",
6
+ "☕ Injetando cafeína",
7
+ "😀 Sorria, você está mapeado!",
8
+ "🐈 Compartilhando imagens de gatos",
9
+ "😴 Reduzindo a procrastinação",
10
+ "🫖 Preparando chá",
11
+ "🐧 Abrindo código-fonte",
12
+ "🚇 Indexando as estações de metrô",
13
+ "🧹 Limpeza de metadados",
14
+ "🚒 Enviando fotos do quartel dos bombeiros",
15
+ "🚲 Atualização de corredor verde",
16
+ "🚉 Passagem pela plataforma da estação",
17
+ "🛰️ Procurando satélites",
18
+ "👥 Escrevendo as personagens",
19
+ "🐟 Localizando lojas de batatas fritas",
20
+ "🧑‍💻 Depurando a interface",
21
+ "📈 Incrementando as estatísticas",
22
+ "🤖 Aprendendo semântica",
23
+ "🎨 Redesenho da interface",
24
+ "📅 Planejando festas de mapeamento fotográfico",
25
+ "🧀 Maturando os queijos cheddar",
26
+ "🌄 Calculando a insolação na Cornualha",
27
+ "🌊 Medindo as marés altas"
28
+ ],
29
+ "zoom": "Zoom",
30
+ "zoomOut": "Diminuir o zoom",
31
+ "zoomIn": "Ampliar o zoom",
32
+ "moveUp": "Mover para cima",
33
+ "moveDown": "Mover para baixo",
34
+ "moveLeft": "Mover para a esquerda",
35
+ "expand": "Expandir",
36
+ "expand_info": "Fazer com que o widget apareça em página inteira",
37
+ "show_psv": "Exibir o visualizador de imagens",
38
+ "show_map": "Exibir o mapa",
39
+ "minimize_short": "Ocultar",
40
+ "options": "Opções",
41
+ "filters": "Filtros",
42
+ "layers": "Camadas",
43
+ "search": "Pesquisa",
44
+ "search_empty": "Nenhum resultado encontrado",
45
+ "search_address": "Pesquisar um endereço, cidade…",
46
+ "search_user": "Pesquisar um nome de usuário…",
47
+ "share": "Compartilhar",
48
+ "share_links": "Links",
49
+ "share_page": "Link para esta foto",
50
+ "share_image": "Imagem HD",
51
+ "share_rss": "Feed RSS",
52
+ "share_embed": "Incorporar no seu site",
53
+ "share_embed_docs": "Leia mais sobre a configuração de incorporação",
54
+ "share_print": "Imprimir",
55
+ "panoramax": "Panoramax",
56
+ "whats_panoramax": "Panoramax é o geo-repositório comum para imagens de territórios.",
57
+ "copy": "Copiar",
58
+ "copied": "Copiado",
59
+ "error": "Temos um problema…",
60
+ "error_retry": "Por favor, tente novamente mais tarde",
61
+ "sequence_play": "Reproduzir esta sequência",
62
+ "sequence_pause": "Pausar sequência",
63
+ "sequence_next": "Próxima imagem na sequência",
64
+ "sequence_more": "Mais opções de reprodução",
65
+ "sequence_speed": "Velocidade de reprodução",
66
+ "legend_license": "Licença: {l}",
67
+ "legend_title": "Exibir detalhes da imagem",
68
+ "id": "iD",
69
+ "geo_uri": "Aplicativo externo",
70
+ "josm": "JOSM",
71
+ "josm_live": "Ativar a sincronização automática do JOSM ao carregar imagens",
72
+ "loading_labels_serious": [
73
+ "🗺️ Carregando dados do mapa",
74
+ "🖥️ Consultando a API",
75
+ "🖼️ Carregando miniaturas",
76
+ "🔍 Analisando os metadados EXIF",
77
+ "🏘️ Renderização 3D",
78
+ "📷 Inicializando imagens em 360°",
79
+ "🟠 Ajuste de cores",
80
+ "💯 Computando o Quality Score ©",
81
+ "📡 Baixando atualizações",
82
+ "🌍 Buscando blocos de mapa",
83
+ "📸 Processando sombras"
84
+ ],
85
+ "moveMiddle": "Centralizar a visualização",
86
+ "share_rss_title": "Feed RSS de novas sequências na área do mapa atualmente visível",
87
+ "contribute_id": "Contribua para o OpenStreetMap com o editor iD",
88
+ "moveRight": "Mover para a direita",
89
+ "sequence_prev": "Imagem anterior na sequência",
90
+ "minimize": "Ocultar este widget. Você pode exibi-lo novamente usando o botão no canto inferior esquerdo",
91
+ "error_click": "Continuar",
92
+ "semantics_features_none": "Ainda não foi desenhado nenhuma característica nesta imagem.",
93
+ "semantics_draw_annotation": "Primeiro, clique no canto da característica que deseja representar. Em seguida, clique no canto oposto. Você pode clicar novamente em um canto para movê-lo.",
94
+ "semantics_login_needed": "Para editar etiquetas ou características de imagens, você precisa fazer login na instância Panoramax {n}. Deseja fazer login?",
95
+ "filter_zoom_in": "Amplie o mapa para ver este filtro",
96
+ "picture_360": "360°",
97
+ "picture_flat_long": "Imagem clássica",
98
+ "filter_qualityscore": "Pontuação de qualidade",
99
+ "filter_qualityscore_help": "Clique para ativar ou desativar",
100
+ "qualityscore_title": "Sobre a pontuação de qualidade",
101
+ "qualityscore_doc_2": "A nota é apresentada aos usuários como uma pontuação A/B/C/D/E (A é a melhor, E a pior) e mostrada graficamente através desta escala:",
102
+ "semantics_features": "Características da imagem",
103
+ "semantics_features_default_title": "Característica {nb}",
104
+ "semantics_features_subtitle": "{nb} propriedades associadas",
105
+ "semantics_annotation_tooltip": "Clique para ver detalhes",
106
+ "semantics_hide_all_tags": "Ocultar todas as etiquetas",
107
+ "semantics_key": "Chave",
108
+ "semantics_value": "Valor",
109
+ "semantics_value_doc": "Saiba mais sobre esta etiqueta",
110
+ "semantics_tags_picture": "Etiquetas de imagem",
111
+ "qualityscore_doc_3": "É calculada com base na precisão do GPS e na resolução da imagem. Um sistema profissional terá uma classificação A, uma câmera de ação 360° terá uma classificação B e um smartphone terá uma classificação C/D/E.",
112
+ "error_psv": "O Photo Sphere Viewer não está carregando corretamente",
113
+ "error_pic": "A imagem solicitada não foi encontrada",
114
+ "error_api": "O servidor de imagens não está disponível",
115
+ "error_webgl": "O WebGL não é compatível com o seu navegador",
116
+ "error_api_compatibility": "O servidor de imagens não é compatível com esta versão do visualizador",
117
+ "filter_date": "Data",
118
+ "filter_date_1month": "1 mês",
119
+ "filter_date_6months": "6 meses",
120
+ "filter_date_1year": "1 ano",
121
+ "filter_user": "Usuário",
122
+ "filter_user_mypics": "Minhas imagens",
123
+ "error_josm": "O JOSM não responde. Ele está sendo executado e está ativado o acesso remoto?",
124
+ "filter_picture": "Tipo de imagem",
125
+ "picture_flat": "Clássica",
126
+ "picture_360_long": "Imagem panorâmica",
127
+ "qualityscore_doc_link": "Saiba mais sobre a Pontuação de Qualidade",
128
+ "metadata_general_picid_link": "Ir para a descrição JSON da imagem",
129
+ "metadata_camera_resolution": "Resolução",
130
+ "metadata_exif_doc": "Documentação para etiquetas EXIF",
131
+ "metadata_exif_doc_title": "Acesse a documentação do Exiv2 para obter detalhes completos sobre as definições das tags EXIF e XMP",
132
+ "semantics_title": "Etiquetas",
133
+ "semantics_show_all_tags": "Mostrar todas as etiquetas",
134
+ "semantics_tags_picture_none": "Ainda não foram definidas etiquetas para esta imagem.",
135
+ "semantics_send_fail": "Não é possível salvar suas alterações, por favor, tente novamente mais tarde",
136
+ "report_details_placeholder": "Opcionalmente, você pode adicionar detalhes sobre o problema",
137
+ "report_nature": {
138
+ "inappropriate": "A imagem é inadequada (sem relação, nudez…)",
139
+ "": "Selecione o tipo do problema…",
140
+ "blur_missing": "O rosto de uma pessoa ou a placa de um carro são visíveis",
141
+ "blur_excess": "Um desfoque desnecessário foi aplicado a um objeto",
142
+ "privacy": "Um caminho ou propriedade privada é visível",
143
+ "picture_low_quality": "A imagem é de baixa qualidade",
144
+ "mislocated": "A imagem está mal posicionada no mapa",
145
+ "copyright": "A imagem viola direitos autorais",
146
+ "other": "Qualquer outro tipo de problema"
147
+ },
148
+ "error_nopic": "Nenhuma imagem disponível na posição indicada",
149
+ "picture_all": "Todas",
150
+ "metadata_location_copy_more": "Mais opções de cópia de coordenadas",
151
+ "semantics_tags": "{nb} etiquetas",
152
+ "semantics_zero_annotations": "Nenhuma característica desenhada nesta imagem",
153
+ "semantics_save_drawn_annotation_incomplete": "Você deve desenhar um retângulo que se encaixe na imagem antes de validar",
154
+ "map_background": "Fundo do mapa",
155
+ "map_background_aerial": "Aéreo",
156
+ "map_background_streets": "Ruas",
157
+ "map_theme": "Tema do mapa",
158
+ "map_theme_default": "Clássico",
159
+ "map_theme_age": "Data da captura",
160
+ "map_theme_age_1": "> 2 anos",
161
+ "map_theme_age_2": "< 2 anos",
162
+ "map_theme_age_3": "< 1 ano",
163
+ "map_theme_age_4": "< 1 mês",
164
+ "map_theme_type": "Tipo de câmera",
165
+ "contrast": "Ativar maior contraste da imagem",
166
+ "metadata": "Metadados de imagem",
167
+ "metadata_summary": "Resumo",
168
+ "metadata_general_copy_id": "Copiar ID",
169
+ "metadata_general_copy_picid": "Copiar ID da imagem",
170
+ "metadata_general_picid": "Imagem",
171
+ "metadata_general_seqid": "Sequência",
172
+ "metadata_general_seqid_link": "Ir para a descrição JSON da sequência",
173
+ "metadata_general_author": "Autor",
174
+ "metadata_general_license": "Licença",
175
+ "metadata_general_license_link": "Consulte a descrição completa da licença",
176
+ "metadata_general_date": "Data da captura",
177
+ "metadata_general_instance": "Instância de origem",
178
+ "metadata_camera": "Câmera",
179
+ "metadata_camera_make": "Marca",
180
+ "metadata_camera_model": "Modelo",
181
+ "metadata_camera_type": "Tipo",
182
+ "metadata_camera_focal_length": "Distância focal",
183
+ "metadata_location": "Posição",
184
+ "metadata_location_coordinates": "Coordenadas (longitude, latitude)",
185
+ "metadata_location_orientation": "Direção",
186
+ "metadata_location_precision": "Precisão de posicionamento",
187
+ "metadata_location_copy": "Copiar {v}",
188
+ "metadata_quality": "Qualidade",
189
+ "metadata_quality_help": "Saiba mais sobre a Pontuação de Qualidade",
190
+ "metadata_quality_score": "Pontuação global",
191
+ "metadata_quality_gps_score": "Pontuação de posicionamento",
192
+ "metadata_quality_resolution_score": "Pontuação de resolução",
193
+ "metadata_quality_missing": "nenhum valor definido na imagem",
194
+ "metadata_exif": "EXIF",
195
+ "metadata_exif_name": "Etiqueta",
196
+ "metadata_exif_value": "Valor",
197
+ "semantics_editor_error": "A sintaxe está inválida. Suas etiquetas podem ficar assim:\nchave=valor\nprefixo|chave=valor\nprefixo|chave[qualif_chave=qualif_val]=valor\n\nO comprimento máximo da chave é de 256 caracteres, e o comprimento máximo do valor é de 2048 caracteres.",
198
+ "report": "Denunciar",
199
+ "report_auth": "Este relatório será enviado usando sua conta \"{a}\"",
200
+ "report_nature_label": "Causa do problema",
201
+ "semantics_qualifiers": "Qualificadores",
202
+ "semantics_show_annotations": "Exibir características da imagem",
203
+ "semantics_hide_annotations": "Ocultar características da imagem",
204
+ "semantics_add_annotation": "Adicionar uma nova característica",
205
+ "semantics_save_drawn_annotation": "Salvar posição",
206
+ "semantics_undo_drawn_annotation": "Cancelar",
207
+ "semantics_delete_annotation": "Excluir esta característica",
208
+ "semantics_delete_annotation_confirm": "Você realmente deseja excluir esta característica?",
209
+ "semantics_hashtags": "Hashtags da imagem",
210
+ "semantics_wikidata_properties": {
211
+ "P31": "instância de",
212
+ "P279": "subclasse de",
213
+ "P361": "parte de"
214
+ },
215
+ "semantics_editor_example": "chave=valor\nprefixo|chave=valor",
216
+ "semantics_edit": "Editar atributos",
217
+ "semantics_save": "Salvar suas alterações",
218
+ "semantics_undo": "Cancelar suas edições",
219
+ "semantics_cantsave_invalid": "Não é possível salvar as alterações, entrada é inválida",
220
+ "semantics_send_ok": "Suas edições foram enviadas com êxito",
221
+ "report_whole_sequence": "Isso diz respeito a toda a sequência",
222
+ "report_details": "Detalhes adicionais",
223
+ "report_email": "Seu e-mail",
224
+ "report_email_placeholder": "Opcional",
225
+ "report_submit": "Enviar",
226
+ "report_wait": "Enviando relatório…",
227
+ "qualityscore_doc_1": "O Panoramax oferece uma pontuação de qualidade para cada imagem. Isso permite uma fácil filtragem do mapa e uma exibição abrangente da disponibilidade de imagens de alta qualidade.",
228
+ "map_theme_score": "Pontuação de qualidade",
229
+ "report_success": "O relatório foi enviado com sucesso. Ele será analisado assim que possível.",
230
+ "report_failure": "Ocorreu um erro ao criar o relatório: {e}. Tente novamente mais tarde.",
231
+ "semantics_key_doc": "Saiba mais sobre esta chave"
232
+ },
233
+ "psv": {
234
+ "ctrlZoom": "Use ctrl + rolagem para ampliar a imagem",
235
+ "loadError": "O panorama não pode ser carregado",
236
+ "twoFingers": "Use does dedos para navegar"
237
+ },
238
+ "maplibre": {
239
+ "GeolocateControl.LocationNotAvailable": "Localização não disponível",
240
+ "GeolocateControl.FindMyLocation": "Encontre minha localização"
241
+ },
242
+ "map": {
243
+ "thumbnail": "Miniatura da imagem ao passar o cursor",
244
+ "not_public": "Não visível publicamente",
245
+ "slow_loading": "O mapa demora a carregar e pode parecer danificado",
246
+ "map_data": "Mapa baseado em {m}",
247
+ "more_panoramax": "Descubra mais sobre o Panoramax",
248
+ "loading": "Carregando…"
249
+ }
250
+ }