"use strict";(self.webpackChunkUmbracoVuePrototype=self.webpackChunkUmbracoVuePrototype||[]).push([[7178],{5262:(t,i,e)=>{e.d(i,{Z:()=>r});var n=e(7537),o=e.n(n),a=e(3645),s=e.n(a)()(o());s.push([t.id,".image-basic a{height:inherit}.image-basic a img{object-fit:cover;object-position:center;min-width:100%;min-height:100%;height:inherit;width:100%}.image-basic .image-wrapper{position:relative;height:inherit}.image-basic .disable-link{cursor:default;pointer-events:none}.image-basic .contain-image img{object-fit:contain}","",{version:3,sources:["webpack://./Scripts/src/vue-components/_image/image-basic/style.scss"],names:[],mappings:"AACE,eACE,cAAA,CACA,mBACE,gBAAA,CACA,sBAAA,CACA,cAAA,CACA,eAAA,CACA,cAAA,CACA,UAAA,CAIJ,4BACE,iBAAA,CACA,cAAA,CAGF,2BACE,cAAA,CACA,mBAAA,CAGF,gCACE,kBAAA",sourcesContent:[".image-basic {\r\n a {\r\n height: inherit;\r\n img {\r\n object-fit: cover;\r\n object-position: center;\r\n min-width: 100%;\r\n min-height: 100%;\r\n height: inherit;\r\n width: 100%;\r\n }\r\n }\r\n\r\n .image-wrapper {\r\n position: relative;\r\n height: inherit;\r\n }\r\n\r\n .disable-link {\r\n cursor: default;\r\n pointer-events: none;\r\n }\r\n\r\n .contain-image img {\r\n object-fit: contain;\r\n }\r\n}\r\n"],sourceRoot:""}]);const r=s},7178:(t,i,e)=>{e.r(i),e.d(i,{default:()=>z});var n=e(6252),o=e(3577);const a={class:"image-wrapper"},s=["href"],r=["src","alt"];var m=e(98),l=e(4437),h=e(8159);const d=(0,n.aZ)({mixins:[h.Z],data:()=>({componentModel:{image:{resizedImages:[],url:""}},imageUrl:"",imageWidth:-1,linkStyle:"",displayEntireImage:!1,altText:""}),mounted(){const t=this.$el.querySelector(".image");t&&(this.imageWidth=t.getBoundingClientRect().width),this.imageUrl=(0,m.U)().getResizedImage(this.componentModel.image.resizedImages,this.imageWidth),this.componentModel.urlRedirect=(0,l.G)().string(this.componentModel.urlRedirect,""),0===this.componentModel.urlRedirect.length&&(this.linkStyle="disable-link"),this.displayEntireImage=(0,l.G)().boolean(this.componentModel.displayEntireImage,!1),this.displayEntireImage&&(this.linkStyle+=" contain-image"),this.altText=(0,l.G)().string(this.componentModel.image.altText,"")}});var c=e(3379),A=e.n(c),y=e(7795),g=e.n(y),p=e(569),u=e.n(p),b=e(3565),C=e.n(b),v=e(9216),w=e.n(v),f=e(4589),S=e.n(f),M=e(5262),x={};x.styleTagTransform=S(),x.setAttributes=C(),x.insert=u().bind(null,"head"),x.domAPI=g(),x.insertStyleElement=w();A()(M.Z,x);M.Z&&M.Z.locals&&M.Z.locals;const z=(0,e(3744).Z)(d,[["render",function(t,i,e,m,l,h){return(0,n.wg)(),(0,n.iD)("div",{class:"image-basic component-margins",style:(0,o.j5)(t.entryAnimationStyle)},[(0,n._)("div",a,[(0,n._)("a",{href:t.componentModel.urlRedirect,class:(0,o.C_)(t.linkStyle)},[(0,n._)("img",{class:"image",src:t.imageUrl,alt:t.altText,loading:"lazy"},null,8,r)],10,s)])],4)}]])},8159:(t,i,e)=>{e.d(i,{Z:()=>m});var n=e(655),o=e(6252),a=e(4437);class s{constructor(t){this.animationEnable=(0,a.G)().boolean(t.animationEnable,!1),this.animationAlwaysRunOnLoad=(0,a.G)().boolean(t.animationAlwaysRunOnLoad,!1),this.animationDelay=(0,a.G)().number(t.animationDelay,.2),this.animationDuration=(0,a.G)().number(t.animationDuration,.3),this.animationDirection=(0,a.G)().string(t.animationDirection,"bottom")}}var r=e(4572);const m=(0,o.aZ)({data:()=>({backgroundUrl:"",componentModel:{},componentWidth:0,isDesktopSize:!0,themeId:"",elementContainer:{},entryAnimations:{},entryAnimationStyle:{},loadState:{},observer:{},observerFirstRun:!0}),watch:{loadState(t,i){1==t&&this.entryAnimations.animationEnable&&this.setupEntryAnimationObserver(this.runEntryAnimations)}},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 i=window.innerWidth;this.initiateMargins(i),this.initiatePadding(i),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((i=>setTimeout(i,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,a.G)().size(t.top,"0px"):"0px",this.elementContainer.style.marginBottom=t.bottom?(0,a.G)().size(t.bottom,"0px"):"0px",this.elementContainer.style.marginLeft=t.left?(0,a.G)().size(t.left,"0px"):"0px",this.elementContainer.style.marginRight=t.right?(0,a.G)().size(t.right,"0px"):"0px")},setPadding(t){null!==this.elementContainer&&t&&(this.elementContainer.style.paddingTop=t.top?(0,a.G)().size(t.top,"0px"):"0px",this.elementContainer.style.paddingBottom=t.bottom?(0,a.G)().size(t.bottom,"0px"):"0px",this.elementContainer.style.paddingLeft=t.left?(0,a.G)().size(t.left,"0px"):"0px",this.elementContainer.style.paddingRight=t.right?(0,a.G)().size(t.right,"0px"):"0px")},initiateHeight(){if(null!==this.elementContainer){let t;t=this.componentModel.moduleHeight?(0,a.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 s(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"}},setupEntryAnimationObserver(){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:[.3]}),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.")}}))}}})}}]); //# sourceMappingURL=source-maps-1.2/7178.8248e13205356f8ce4f5.map