1"use strict"; 2!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="54dba521-3955-5b81-b498-2ade195b82be")}catch(e){}}(); 3(self.webpackChunkthe_hive_legacy=self.webpackChunkthe_hive_legacy||[]).push([[698],{20769:function(o,t,a){var e=a(45627),r=a.n(e),s=a(76798),i=a.n(s)()(r());i.push([o.id,".add-bookmark[data-v-3defe36f]{margin-top:-50px}.list-group-empty[data-v-3defe36f]{border:1px solid #ddd;border-radius:4px;padding:15px}.panel .panel-footer[data-v-3defe36f]{overflow:hidden}.list-group .list-group-item.draggable[data-v-3defe36f]{cursor:move}.list-group .list-group-item-heading[data-v-3defe36f]{font-size:14px}.list-group .list-group-item-text[data-v-3defe36f]{font-size:12px}.vue-slider[data-v-3defe36f]{margin-bottom:20px}","",{version:3,sources:["webpack://./application/js/build/blockUI/components/panels/LocationBookmarks.vue"],names:[],mappings:"AACA,+BACI,gBAAA,CAEJ,mCACI,qBAAA,CAEA,iBAAA,CADA,YACA,CAGA,sCACI,eAAA,CAIJ,wDACI,WAAA,CAEJ,sDACI,cAAA,CAEJ,mDACI,cAAA,CAGR,6BACI,kBAAA",sourcesContent:["\n.add-bookmark {\n margin-top: -50px;\n}\n.list-group-empty {\n border: 1px solid #ddd;\n padding: 15px;\n border-radius: 4px;\n}\n.panel {\n .panel-footer {\n overflow: hidden;\n }\n}\n.list-group {\n .list-group-item.draggable {\n cursor: move;\n }\n .list-group-item-heading {\n font-size: 14px;\n }\n .list-group-item-text {\n font-size: 12px;\n }\n}\n.vue-slider {\n margin-bottom: 20px;\n}\n"],sourceRoot:""}]),t.A=i},67698:function(o,t,a){a.r(t),a.d(t,{default:function(){return f}});var e=a(5615),r=a(50964),s=a(37353),i=a(20378),n=(a(95504),a(63366)),l=a(98528),k=a(52993),m=a(23041);function d(o,t){var a=Object.keys(o);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(o);t&&(e=e.filter((function(t){return Object.getOwnPropertyDescriptor(o,t).enumerable}))),a.push.apply(a,e)}return a}function c(o){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?d(Object(a),!0).forEach((function(t){b(o,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(a)):d(Object(a)).forEach((function(t){Object.defineProperty(o,t,Object.getOwnPropertyDescriptor(a,t))}))}return o}function b(o,t,a){return(t=function(o){var t=function(o,t){if("object"!=typeof o||!o)return o;var a=o[Symbol.toPrimitive];if(void 0!==a){var e=a.call(o,t||"default");if("object"!=typeof e)return e;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(o)}(o,"string");return"symbol"==typeof t?t:t+""}(t))in o?Object.defineProperty(o,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):o[t]=a,o}var u={name:"location-bookmarks",components:{BlockElement:()=>a.e(244).then(a.bind(a,16244)),Toggletip:()=>Promise.all([a.e(0),a.e(593)]).then(a.bind(a,22593)),draggable:()=>a.e(0).then(a.t.bind(a,432,23)),RangeSlider:i},props:{transformConfig:{type:Object,default(){return{types:["geocode"],componentRestrictions:{country:["AU"]}}}}},computed:c(c({},(0,e.n2)(r.J)),{},{metadata(){return this.BlockEditorStore.metadata},dragOptions(){return{animation:200,group:"description",disabled:!1,ghostClass:"ghost"}},zoomMark(){return{1:this._$t("zoomWorld"),10:this._$t("zoomCity"),20:this._$t("zoomBuildings")}},bookmarks(){return this.BlockEditorStore.formdata.bookmarks},displayBookmarks:{get(){return this.BlockEditorStore.formdata.displayBookmarks},set(o){this.BlockEditorStore.formdata.displayBookmarks=o}},googleMapsAPIKey(){return this.BlockEditorStore.blockSets.googleMapsAPIKey}}),methods:{_$t(o,t){return this.$t("block_ui:panels.locationBookmarks."+o,t)},googlePlacesAutocomplete({inputNode:o,transformConfig:t,transformOptions:a,linked:e}={}){let r=this;hiveUtils.waitForNestedProperty("google.maps.places",window).then((function(){r.transformation.googlePlacesAutocomplete=new google.maps.places.Autocomplete(o[0]||o,t),r.transformation.googlePlacesAutocomplete.addListener("place_changed",(()=>{let o=r.transformation.googlePlacesAutocomplete.getPlace(),t={address:o.formatted_address,lon:o.geometry.location.lng(),lat:o.geometry.location.lat()};s.l.$emit("place_changed",{response:o,data:t,linked:e})}))}))},onCoordinateInput:(0,n.A)((function(o){let t=this;this.reverseGeocode(this.bookmark.bookmarkLat,this.bookmark.bookmarkLon).then((function(o){t.bookmark.bookmarkLocation=o[0].formatted_address||""})).catch((function(o){t.bookmark.bookmarkLocation="",console.error(o)}))}),1e3),setCoordinates({lon:o,lat:t,linked:a}={}){"locationBookmarks"==a.lon.panelId&&a.lon.inputName&&o&&(this.bookmark[a.lon.inputName]=o),"locationBookmarks"==a.lat.panelId&&a.lat.inputName&&t&&(this.bookmark[a.lat.inputName]=t)},setLocation({address:o,linked:t}){"locationBookmarks"==t.address.panelId&&t.address&&t.address.inputName&&(this.bookmark[t.address.inputName]=o)},reverseGeocode(o,t){let a=this;return new Promise((function(e,r){if(!t||!o){let o=a._$t("invalidCoordinatesDesc");HiveAlerts.error({title:a._$t("invalidCoordinates"),message:o}),r(Error(o))}
3m.A.get(`https://maps.googleapis.com/maps/api/geocode/json?key=${a.googleMapsAPIKey}&latlng=${o},${t}`).then((o=>{"OK"==o.data.status?o.data.results.length?e(o.data.results):e("No results found"):r(Error("Geocoder failed due to: "+status))})).catch((o=>r(Error(o))))}))},setInputValue(o,t){Object.keys(o).map((a=>t?this[t][a]=o[a]:this[a]=o[a]))},resetBookmark(){this.bookmarksArray=this.bookmarksArray.map(((o,t)=>(o.bookmarkOrder=t,o))),this.bookmark=Object.assign({},this.bookmarkObj,{ftID:this.metadata["ft-id"],bID:this.metadata["b-id"],bookmarkID:(0,l.A)(1e7)}),this.mode="show-bookmarks"},cancelBookmarkAction(){this.resetBookmark()},saveBookmark(){if(this.isBusy=!0,this.isValid()){let o=(0,k.Q)(this.bookmarksArray),t=(0,k.Q)(this.bookmark);if("edit-bookmark"==this.mode){let a=o.findIndex((o=>o.bookmarkOrder==t.bookmarkOrder));o[a]=c(c({},o[a]),t)}else o.push(t);this.bookmarksArray=(0,k.Q)(o),this.resetBookmark()}else HiveAlerts.error({title:this._$t("error"),message:this._$t("errorDesc")});this.isBusy=!1},setupBookmark({mode:o,bookmark:t}){this.mode=o,window.hiveUtils.waitForElement('[name="bookmarkLocation"]',`#${this.metadata.uniqid}`).then((()=>{this.googlePlacesAutocomplete({inputNode:this.$refs.bookmarkLocation,transformConfig:this.transformConfig,transformOptions:{},linked:{lat:{panelId:"locationBookmarks",inputName:"bookmarkLat"},lon:{panelId:"locationBookmarks",inputName:"bookmarkLon"},address:{panelId:"locationBookmarks",inputName:"bookmarkLocation"}}})})),"edit-bookmark"===o&&(this.bookmark=Object.assign({},t)),"add-bookmark"===o&&(this.bookmark.bookmarkOrder=this.bookmarksArray.length)},deleteBookmark({bookmark:o}){this.bookmarksArray=this.bookmarksArray.filter((t=>t!=o)),this.bookmarksArray.length||(this.displayBookmarks=0),this.resetBookmark()},onDragEnd(){this.bookmarksArray=this.bookmarksArray.map(((o,t)=>(o.bookmarkOrder=t,o))),this.drag=!1},handleCharCount({ref:o,limit:t=20,value:a=""}){this.$set(this.countable,o,{length:a.length,left:t-a.length,isOver:t-a.length<0||!1})},isValid(){let o={htmlValidity:Object.values(this.$refs).filter((o=>!!o&&["text","number","select","textarea","checkbox","radio"].includes(o.type))).every((o=>o.checkValidity())),bookmarkLocation:!!this.bookmark.bookmarkLocation,countable:Object.values(this.countable).every((o=>!o.isOver))};return Object.values(o).every((o=>!!o))}}
3,watch:{mode:function(o){let t=o.startsWith("add")||o.startsWith("edit")?"disabled":"";this.BlockEditorStore.setNavigationState({state:t,excludeIds:["map"]}),this.BlockEditorStore.setAllPanelState({state:t,excludeIds:["locationBookmarks"]}),this.BlockEditorStore.setButtonState(t)},"bookmark.bookmarkTitle":{immediate:!0,handler:function(o){this.handleCharCount({ref:"bookmarkTitle",value:o})}},bookmarksArray:function(o){this.BlockEditorStore.formdata.bookmarks=o}},data(){return{mode:"show-bookmarks",bookmarksArray:[],bookmark:{},bookmarkObj:{bookmarkID:"",ftID:"",bID:"",bookmarkTitle:"",bookmarkLocation:"",bookmarkLat:"",bookmarkLon:"",bookmarkZoomLevel:10,bookmarkOrder:""},drag:!1,countable:{},transformation:{},isBusy:!1}},created(){let o=this;this.bookmarksArray=[...this.bookmarksArray,...this.bookmarks?this.bookmarks:[]],this.resetBookmark(),s.l.$on("place_changed",(function(t){o.setCoordinates({lon:Number(t.data.lon.toFixed(7)),lat:Number(t.data.lat.toFixed(7)),linked:t.linked}),o.setLocation({address:t.data.address,linked:t.linked})}))}},p=a(85072),v=a.n(p),h=a(20769),g={insert:"head",singleton:!1},f=(v()(h.A,g),h.A.locals,(0,a(14486).A)(u,(function(){var o=this,t=o._self._c;return t("div",{staticClass:"component-location-bookmarks"},[t("button",{directives:[{name:"show",rawName:"v-show",value:"show-bookmarks"===o.mode,expression:"mode === 'show-bookmarks'"}],staticClass:"btn btn-sm btn-primary pull-right add-bookmark",attrs:{type:"button"},on:{click:function(t){return o.setupBookmark({mode:"add-bookmark"})}}},[o._v("\n "+o._s(o._$t("add"))+"\n ")]),o._v(" "),t("div",{directives:[{name:"show",rawName:"v-show",value:"show-bookmarks"===o.mode&&!o.bookmarksArray.length,expression:"mode === 'show-bookmarks' && !bookmarksArray.length"}],staticClass:"list-group-empty text-center"},[o._v("\n "+o._s(o._$t("noBookmarks"))+"\n ")]),o._v(" "),t("draggable",o._b({directives:[{name:"show",rawName:"v-show",value:"show-bookmarks"===o.mode&&o.bookmarksArray.length,expression:"mode === 'show-bookmarks' && bookmarksArray.length"}],staticClass:"list-group",attrs:{tag:"ul",draggable:".draggable"},on:{start:function(t){o.drag=!0},end:o.onDragEnd},model:{value:o.bookmarksArray,callback:function(t){o.bookmarksArray=t},expression:"bookmarksArray"}},"draggable",o.dragOptions,!1),[t("transition-group",{attrs:{type:"transition",name:o.drag?null:"flip-list"}},o._l(o.bookmarksArray,(function(a){return t("li",{key:`marker-bookmark-${a.bookmarkID}-${a.bookmarkOrder}`,staticClass:"list-group-item draggable"},[t("div",{staticClass:"btn-group pull-right",attrs:{role:"group","aria-label":o._$t("actions")}},[t("button",{staticClass:"btn btn-link",attrs:{type:"button",title:o._$t("edit"),"aria-label":o._$t("edit")},on:{click:function(t){return o.setupBookmark({mode:"edit-bookmark",bookmark:a})}}},[t("i",{staticClass:"fa fa-pencil"})]),o._v(" "),t("button",{staticClass:"btn btn-link",attrs:{type:"button",title:o._$t("delete"),"aria-label":o._$t("delete")},on:{click:function(t){return o.deleteBookmark({bookmark:a})}}},[t("i",{staticClass:"fa fa-trash"})])]),o._v(" "),t("h4",{staticClass:"list-group-item-heading"},[o._v("\n "+o._s(a.bookmarkTitle)+"\n ")]),o._v(" "),t("p",{staticClass:"list-group-item-text"},[o._v("\n "+o._s(a.bookmarkLocation)+"\n ")]),o._v(" "),t("input",{attrs:{type:"hidden",name:"bookmarkTitle[]"},domProps:{value:a.bookmarkTitle}}),o._v(" "),t("input",{attrs:{type:"hidden",name:"bookmarkLocation[]"},domProps:{value:a.bookmarkLocation}}),o._v(" "),t("input",{attrs:{type:"hidden",name:"bookmarkLat[]"},domProps:{value:a.bookmarkLat}}),o._v(" "),t("input",{attrs:{type:"hidden",name:"bookmarkLon[]"},domProps:{value:a.bookmarkLon}}),o._v(" "),t("input",{attrs:{type:"hidden",name:"bookmarkZoomLevel[]"},domProps:{value:a.bookmarkZoomLevel}}),o._v(" "),t("input",{attrs:{type:"hidden",name:"bookmarkOrder[]"},domProps:{value:a.bookmarkOrder}})])})),0)],1),o._v(" "),t("div",{directives:[{name:"show",rawName:"v-show",value:"show-bookmarks"===o.mode&&o.bookmarksArray.length,expression:"mode === 'show-bookmarks' && bookmarksArray.length"}],staticClass:"form-group displayBookmarks"},[t("div",{staticClass:"checkbox"},[t("input",{directives:[{name:"model",rawName:"v-model",value:o.displayBookmarks,expression:"displayBookmarks"}],staticClass:"custom",attrs:{type:"checkbox",id:"displayBookmarks",name:"displayBookmarks","true-value":"1","false-value":"0"},domProps:{checked:Array.isArray(o.displayBookmarks)?o._i(o.displayBookmarks,null)>-1:o._q(o.displayBookmarks,"1")},on:{change:function(t){var a=o.displayBookmarks,e=t.target,r=e.checked?"1":"0";if(Array.isArray(a)){var s=o._i(a,null);e.checked?s<0&&(o.displayBookmarks=a.concat([null])):s>-1&&(o.displayBookmarks=a.slice(0,s).concat(a.slice(s+1)))}else o.displayBookmarks=r}}}),o._v(" "),t("label",{staticClass:"control-label",attrs:{for:"displayBookmarks"}},[o._v(o._s(o._$t("display")))])])]),o._v(" "),["add-bookmark","edit-bookmark"].includes(o.mode)?t("div",{staticClass:"panel panel-default inset-form"},[t("div",{staticClass:"panel-heading"},[t("h3",{staticClass:"panel-title"},[o._v("\n "+o._s("add-bookmark"===o.mode?o._$t("addLocation"):o._$t("editLocation"))+"\n ")])]),o._v(" "),t("div",{staticClass:"panel-body"},[t("input",{attrs:{type:"hidden",name:"bookmarkOrder"},domProps:{value:o.bookmark.bookmarkOrder}}),o._v(" "),t("div",{staticClass:"form-group"},[t("label",{staticClass:"control-label",attrs:{for:"bookmarkTitle"}},[o._v("\n "+o._s(o._$t("title"))+"\n "),t("span",{staticClass:"text-muted small"},[o._v(o._s(o._$t("required")))])]),o._v(" "),t("input",{directives:[{name:"model",rawName:"v-model",value:o.bookmark.bookmarkTitle,expression:"bookmark.bookmarkTitle"}],ref:"bookmarkTitle",staticClass:"form-control",attrs:{type:"text",id:"bookmarkTitle",name:"bookmarkTitle",maxlength:"20",required:""},domProps:{value:o.bookmark.bookmarkTitle},on:{input:function(t){t.target.composing||o.$set(o.bookmark,"bookmarkTitle",t.target.value)}}}),o._v(" "),t("small",{staticClass:"character-counter help-block"},[o._v("\n "+o._s(o._$t("charactersRemaining",{chars:o.countable.bookmarkTitle.left}))+"\n ")])]),o._v(" "),t("div",{staticClass:"form-group"},[t("div",[t("label",{staticClass:"control-label",attrs:{for:"bookmarkLocation"}},[o._v("\n "+o._s(o._$t("location"))+"\n "),t("span",{staticClass:"text-muted small"},[o._v(o._s(o._$t("required")))]),o._v(" "),t("toggletip",{attrs:{message:o._$t("locationHelp")}})],1),o._v(" "),t("input",{directives:[{name:"model",rawName:"v-model",value:o.bookmark.bookmarkLocation,expression:"bookmark.bookmarkLocation"}],ref:"bookmarkLocation",staticClass:"form-control",attrs:{type:"text",id:"bookmarkLocation",name:"bookmarkLocation",placeholder:o._$t("locationPlaceholder"),autocomplete:"off",required:""},domProps:{value:o.bookmark.bookmarkLocation},on:{input:function(t){t.target.composing||o.$set(o.bookmark,"bookmarkLocation",t.target.value)}}})])]),o._v(" "),t("div",{staticClass:"row form-group"},[t("div",{staticClass:"col-sm-6"},[t("label",{staticClass:"control-label",attrs:{for:"bookmarkLat"}},[o._v("\n "+o._s(o._$t("latitude"))+"\n "),t("span",{staticClass:"text-muted small"},[o._v(o._s(o._$t("required")))])]),o._v(" "),t("input",{directives:[{name:"model",rawName:"v-model",value:o.bookmark.bookmarkLat,expression:"bookmark.bookmarkLat"}],ref:"bookmarkLat",staticClass:"form-control",attrs:{type:"number",id:"bookmarkLat",name:"bookmarkLat",min:"-90",max:"90",step:"any",required:""},domProps:{value:o.bookmark.bookmarkLat},on:{input:[function(t){t.target.composing||o.$set(o.bookmark,"bookmarkLat",t.target.value)},o.onCoordinateInput]}})]),o._v(" "),t("div",{staticClass:"col-sm-6"},[t("label",{staticClass:"control-label",attrs:{for:"bookmarkLon"}},[o._v("\n "+o._s(o._$t("longitude"))+"\n "),t("span",{staticClass:"text-muted small"},[o._v(o._s(o._$t("required")))])]),o._v(" "),t("input",{directives:[{name:"model",rawName:"v-model",value:o.bookmark.bookmarkLon,expression:"bookmark.bookmarkLon"}],ref:"bookmarkLon",staticClass:"form-control",attrs:{type:"number",id:"bookmarkLon",name:"bookmarkLon",min:"-180",max:"180",step:"any",required:""},domProps:{value:o.bookmark.bookmarkLon},on:{input:[function(t){t.target.composing||o.$set(o.bookmark,"bookmarkLon",t.target.value)},o.onCoordinateInput]}})])]),o._v(" "),t("div",{staticClass:"form-group"}
3,[t("label",{staticClass:"control-label",attrs:{for:"bookmarkZoomLevel"}},[o._v(o._s(o._$t("zoom")))]),o._v(" "),t("div",{staticClass:"slider",attrs:{id:"bookmarkZoomLevel"}}),o._v(" "),t("input",{directives:[{name:"model",rawName:"v-model",value:o.bookmark.bookmarkZoomLevel,expression:"bookmark.bookmarkZoomLevel"}],staticClass:"form-control",attrs:{type:"hidden",name:"bookmarkZoomLevel"},domProps:{value:o.bookmark.bookmarkZoomLevel},on:{input:function(t){t.target.composing||o.$set(o.bookmark,"bookmarkZoomLevel",t.target.value)}}}),o._v(" "),t("range-slider",{attrs:{contained:!0,min:1,max:20,interval:1,useKeyboard:!0,marks:o.zoomMark},model:{value:o.bookmark.bookmarkZoomLevel,callback:function(t){o.$set(o.bookmark,"bookmarkZoomLevel",t)},expression:"bookmark.bookmarkZoomLevel"}})],1)]),o._v(" "),t("div",{staticClass:"panel-footer"},[t("button",{staticClass:"btn btn-sm btn-default pull-left",attrs:{type:"button"},on:{click:o.cancelBookmarkAction}},[o._v("\n "+o._s(o._$t("cancel"))+"\n ")]),o._v(" "),t("button",{staticClass:"btn btn-sm btn-primary pull-right",attrs:{type:"button",disabled:o.isBusy},on:{click:o.saveBookmark}},[o._v("\n "+o._s(o._$t("save"))+"\n ")])])]):o._e()],1)}),[],!1,null,"3defe36f",null).exports)}}]); 4//# debugId=54dba521-3955-5b81-b498-2ade195b82be
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.