"use strict";(self.webpackChunkUmbracoVuePrototype=self.webpackChunkUmbracoVuePrototype||[]).push([[2266],{8159:(t,e,i)=>{i.d(e,{Z:()=>l});var n=i(655),o=i(6252),s=i(4437);class a{constructor(t){this.animationEnable=(0,s.G)().boolean(t.animationEnable,!1),this.animationAlwaysRunOnLoad=(0,s.G)().boolean(t.animationAlwaysRunOnLoad,!1),this.animationDelay=(0,s.G)().number(t.animationDelay,.2),this.animationDuration=(0,s.G)().number(t.animationDuration,.3),this.animationDirection=(0,s.G)().string(t.animationDirection,"bottom")}}var r=i(4572);const l=(0,o.aZ)({data:()=>({backgroundUrl:"",componentModel:{},componentWidth:0,isDesktopSize:!0,themeId:"",elementContainer:{},entryAnimations:{},entryAnimationStyle:{},loadState:{},observer:{},observerFirstRun:!0}),watch:{loadState(t,e){1==t&&this.entryAnimations.animationEnable&&this.setupEntryAnimation()}},beforeUnmount:function(){window.removeEventListener("resize",this.handleResize)},mounted(){const t=this.$el.parentElement.getAttribute("umbracomodel");this.componentModel="null"!==t&&null!=t?JSON.parse(t):{},this.componentModel.entryAnimations||(this.componentModel.entryAnimations={}),this.initiateEntryAnimations(),this.elementContainer=this.$el.closest(".component-margins");const e=window.innerWidth;this.initiateMargins(e),this.initiatePadding(e),this.initiateHeight(),this.initiateResizeListener(),(0,r.y)().addLoadedModule(),this.loadState=(0,r.y)().getLoadState()},onUnmounted(){if(this.entryAnimations.animationEnable)try{this.observer.unobserve(this.elementContainer)}catch(t){}},methods:{delay(t){return(0,n.mG)(this,void 0,void 0,(function*(){return new Promise((e=>setTimeout(e,t)))}))},handleResize(t){this.componentWidth=this.$el.clientWidth,this.resizeWindow()},resizeWindow(){const t=window.innerWidth;t>991!==this.isDesktopSize&&(this.initiateMargins(t),this.initiatePadding(t),this.calculateSize(t))},initiateResizeListener(){window.addEventListener("resize",this.handleResize),this.$el&&(this.componentWidth=this.$el.clientWidth);const t=window.innerWidth;this.calculateSize(t)},calculateSize(t){this.isDesktopSize=t>991},initiateMargins(t){t>991?this.setMargins(this.componentModel.moduleMargin):this.setMargins(this.componentModel.moduleMarginMobile)},initiatePadding(t){t>991?this.setPadding(this.componentModel.modulePadding):this.setPadding(this.componentModel.modulePaddingMobile)},setMargins(t){null!==this.elementContainer&&t&&(this.elementContainer.style.marginTop=t.top?(0,s.G)().size(t.top,"0px"):"0px",this.elementContainer.style.marginBottom=t.bottom?(0,s.G)().size(t.bottom,"0px"):"0px",this.elementContainer.style.marginLeft=t.left?(0,s.G)().size(t.left,"0px"):"0px",this.elementContainer.style.marginRight=t.right?(0,s.G)().size(t.right,"0px"):"0px")},setPadding(t){null!==this.elementContainer&&t&&(this.elementContainer.style.paddingTop=t.top?(0,s.G)().size(t.top,"0px"):"0px",this.elementContainer.style.paddingBottom=t.bottom?(0,s.G)().size(t.bottom,"0px"):"0px",this.elementContainer.style.paddingLeft=t.left?(0,s.G)().size(t.left,"0px"):"0px",this.elementContainer.style.paddingRight=t.right?(0,s.G)().size(t.right,"0px"):"0px")},initiateHeight(){if(null!==this.elementContainer){let t;t=this.componentModel.moduleHeight?(0,s.G)().size(this.componentModel.moduleHeight,"auto"):"auto",this.elementContainer.style.height=t,(t.includes("vh")||t.includes("vmax"))&&(this.elementContainer.style.maxHeight="2300px"),this.elementContainer.style.overflow="hidden"}},initiateEntryAnimations(){if(this.entryAnimations=new a(this.componentModel.entryAnimations),this.entryAnimations.animationEnable)switch(this.entryAnimationStyle.opacity="0!important",this.entryAnimations.animationDirection){case"bottom":this.entryAnimationStyle.bottom="-20vh";break;case"top":this.entryAnimationStyle.top="-20vh";break;case"left":this.entryAnimationStyle.left="-20vw";break;case"right":this.entryAnimationStyle.right="-20vw"}},setupEntryAnimation(){this.setupEntryAnimationObserver(.3)},setupEntryAnimationObserver(t){return(0,n.mG)(this,void 0,void 0,(function*(){this.entryAnimations.animationAlwaysRunOnLoad&&(this.observerFirstRun=!1),this.observer=new IntersectionObserver((t=>{t[0].isIntersecting&&this.runEntryAnimations(),this.observerFirstRun=!1}),{threshold:[t]}),this.observer.observe(this.elementContainer)}))},runEntryAnimations(){return(0,n.mG)(this,void 0,void 0,(function*(){switch(this.observerFirstRun?this.entryAnimationStyle.transition="none!important":this.entryAnimationStyle.transition="opacity "+this.entryAnimations.animationDuration+"s ease-in-out "+this.entryAnimations.animationDelay+"s,bottom "+this.entryAnimations.animationDuration+"s ease-in-out "+this.entryAnimations.animationDelay+"s,top "+this.entryAnimations.animationDuration+"s ease-in-out "+this.entryAnimations.animationDelay+"s,left "+this.entryAnimations.animationDuration+"s ease-in-out "+this.entryAnimations.animationDelay+"s,right "+this.entryAnimations.animationDuration+"s ease-in-out "+this.entryAnimations.animationDelay+"s",this.entryAnimationStyle.opacity="1",this.entryAnimations.animationDirection){case"bottom":this.entryAnimationStyle.bottom="0px";break;case"top":this.entryAnimationStyle.top="-0px";break;case"left":this.entryAnimationStyle.left="-0px";break;case"right":this.entryAnimationStyle.right="-0px"}this.observer.unobserve(this.elementContainer);try{let t=this.entryAnimations.animationDuration+this.entryAnimations.animationDelay;yield this.delay(1e3*t),this.entryAnimationStyle={}}catch(t){this.entryAnimationStyle={},console.log("Core mixin addition failed.")}}))}}})},47:(t,e,i)=>{i.d(e,{Z:()=>c});var n=i(6252),o=i(3577),s=i(9963);const a=["id","placeholder","disabled"];const r={subpremise:"short_name",street_number:"short_name",route:"long_name",locality:"long_name",administrative_area_level_1:"short_name",administrative_area_level_2:"long_name",country:"long_name",postal_code:"short_name"},l=["locality","administrative_area_level_3"],m=["locality","sublocality","postal_code","country","administrative_area_level_1","administrative_area_level_2"],h=["address_components","adr_address","alt_id","formatted_address","geometry","icon","id","name","business_status","photo","place_id","scope","type","url","utc_offset_minutes","vicinity"],d={name:"VueGoogleAutocomplete",props:{id:{type:String,required:!0},classname:String,placeholder:{type:String,default:"Start typing"},disabled:{type:Boolean,default:!1},types:{type:String,default:"address"},fields:{type:Array,default:function(){return h}},country:{type:[String,Array],default:null},enableGeolocation:{type:Boolean,default:!1},geolocationOptions:{type:Object,default:null}},data:()=>({autocomplete:null,autocompleteText:"",geolocation:{geocoder:null,loc:null,position:null}}),watch:{autocompleteText:function(t,e){this.$emit("inputChange",{newVal:t,oldVal:e},this.id)},country:function(t,e){this.autocomplete.setComponentRestrictions({country:null===this.country?[]:this.country})}},mounted:function(){const t={};this.types&&(t.types=[this.types]),this.country&&(t.componentRestrictions={country:this.country}),this.autocomplete=new google.maps.places.Autocomplete(document.getElementById(this.id),t),this.autocomplete.setFields(this.fields),this.autocomplete.addListener("place_changed",this.onPlaceChanged)},methods:{onPlaceChanged(){let t=this.autocomplete.getPlace();t.geometry?void 0!==t.address_components&&(this.$emit("placechanged",this.formatResult(t),t,this.id),this.autocompleteText=document.getElementById(this.id).value,this.onChange()):this.$emit("no-results-found",t,this.id)},onFocus(){this.biasAutocompleteLocation(),this.$emit("focus")},onBlur(){this.$emit("blur")},onChange(){this.$emit("change",this.autocompleteText)},onKeyPress(t){this.$emit("keypress",t)},onKeyUp(t){this.$emit("keyup",t)},clear(){this.autocompleteText=""},focus(){this.$refs.autocomplete.focus()},blur(){this.$refs.autocomplete.blur()},update(t){this.autocompleteText=t},updateCoordinates(t){(t||t.lat||t.lng)&&(this.geolocation.geocoder||(this.geolocation.geocoder=new google.maps.Geocoder),this.geolocation.geocoder.geocode({location:t},((t,e)=>{"OK"===e?(t=this.filterGeocodeResultTypes(t))[0]?(this.$emit("placechanged",this.formatResult(t[0]),t[0],this.id),this.update(t[0].formatted_address)):this.$emit("error","no result for provided coordinates"):this.$emit("error","error getting address from coords")})))},geolocate(){this.updateGeolocation(((t,e)=>{this.updateCoordinates(t)}))},updateGeolocation(t=null){if(navigator.geolocation){let e={};this.geolocationOptions&&Object.assign(e,this.geolocationOptions),navigator.geolocation.getCurrentPosition((e=>{let i={lat:e.coords.latitude,lng:e.coords.longitude};this.geolocation.loc=i,this.geolocation.position=e,t&&t(i,e)}),(t=>{this.$emit("error","Cannot get Coordinates from navigator",t)}),e)}},biasAutocompleteLocation(){this.enableGeolocation&&this.updateGeolocation(((t,e)=>{let i=new google.maps.Circle({center:t,radius:e.coords.accuracy});this.autocomplete.setBounds(i.getBounds())}))},formatResult(t){let e={};for(let i=0;il.autocompleteText=t),onFocus:e[1]||(e[1]=t=>m.onFocus()),onBlur:e[2]||(e[2]=t=>m.onBlur()),onChange:e[3]||(e[3]=(...t)=>m.onChange&&m.onChange(...t)),onKeypress:e[4]||(e[4]=(...t)=>m.onKeyPress&&m.onKeyPress(...t)),onKeyup:e[5]||(e[5]=(...t)=>m.onKeyUp&&m.onKeyUp(...t))},null,42,a)),[[s.nr,l.autocompleteText]])}]])}}]); //# sourceMappingURL=source-maps-1.2/2266.d76ead842063a36fc909.map