File "video.2be65474f4a78954309a.bundle.min.js"

Full path: /home/kosmetik/public_html/wp-content/plugins/elementor/assets/js/video.2be65474f4a78954309a.bundle.min.js
File size: 6.24 B
MIME-type: text/plain
Charset: utf-8

Download   Open   Edit   Advanced Editor   Back

/*! elementor - v3.2.5 - 16-06-2021 */
(self.webpackChunkelementor=self.webpackChunkelementor||[]).push([[791],{5363:(e,t,i)=>{"use strict";var n=i(7971);i(7394)(t,"__esModule",{value:!0}),t.default=void 0;var a=n(i(7135));i(6248);var r=n(i(9117));i(8081),i(3777),i(4208),i(1954);var o=n(i(1959)),l=n(i(9041)),s=n(i(6700)),u=n(i(4263)),d=n(i(7371)),c=n(i(8537)),v=function(e){(0,d.default)(Video,e);var t,i,n,v=(0,c.default)(Video);function Video(){return(0,o.default)(this,Video),v.apply(this,arguments)}return(0,l.default)(Video,[{key:"getDefaultSettings",value:function getDefaultSettings(){return{selectors:{imageOverlay:".elementor-custom-embed-image-overlay",video:".elementor-video",videoIframe:".elementor-video-iframe"}}}},{key:"getDefaultElements",value:function getDefaultElements(){var e=this.getSettings("selectors");return{$imageOverlay:this.$element.find(e.imageOverlay),$video:this.$element.find(e.video),$videoIframe:this.$element.find(e.videoIframe)}}},{key:"handleVideo",value:function handleVideo(){var e=this;this.getElementSettings("lightbox")||("youtube"===this.getElementSettings("video_type")?this.apiProvider.onApiReady((function(t){e.elements.$imageOverlay.remove(),e.prepareYTVideo(t,!0)})):(this.elements.$imageOverlay.remove(),this.playVideo()))}},{key:"playVideo",value:function playVideo(){if(this.elements.$video.length)this.youtubePlayer?this.youtubePlayer.playVideo():this.elements.$video[0].play();else{var e=this.elements.$videoIframe,t=e.data("lazy-load");t&&e.attr("src",t);var i=e[0].src.replace("&autoplay=0","");if(e[0].src=i+"&autoplay=1",e[0].src.includes("vimeo.com")){var n=e[0].src,a=/#t=[^&]*/.exec(n);e[0].src=n.slice(0,a.index)+n.slice(a.index+a[0].length)+a[0]}}}},{key:"animateVideo",value:(n=(0,r.default)(a.default.mark((function _callee(){return a.default.wrap((function _callee$(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,elementorFrontend.utils.lightbox;case 2:e.sent.setEntranceAnimation(this.getCurrentDeviceSetting("lightbox_content_animation"));case 4:case"end":return e.stop()}}),_callee,this)}))),function animateVideo(){return n.apply(this,arguments)})},{key:"handleAspectRatio",value:(i=(0,r.default)(a.default.mark((function _callee2(){return a.default.wrap((function _callee2$(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,elementorFrontend.utils.lightbox;case 2:e.sent.setVideoAspectRatio(this.getElementSettings("aspect_ratio"));case 4:case"end":return e.stop()}}),_callee2,this)}))),function handleAspectRatio(){return i.apply(this,arguments)})},{key:"hideLightbox",value:(t=(0,r.default)(a.default.mark((function _callee3(){return a.default.wrap((function _callee3$(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,elementorFrontend.utils.lightbox;case 2:e.sent.getModal().hide();case 4:case"end":return e.stop()}}),_callee3)}))),function hideLightbox(){return t.apply(this,arguments)})},{key:"prepareYTVideo",value:function prepareYTVideo(e,t){var i=this,n=this.getElementSettings(),a={videoId:this.videoID,events:{onReady:function onReady(){n.mute&&i.youtubePlayer.mute(),(n.autoplay||t)&&i.youtubePlayer.playVideo()},onStateChange:function onStateChange(t){t.data===e.PlayerState.ENDED&&n.loop&&i.youtubePlayer.seekTo(n.start||0)}},playerVars:{controls:n.controls?1:0,rel:n.rel?1:0,playsinline:n.play_on_mobile?1:0,modestbranding:n.modestbranding?1:0,autoplay:n.autoplay?1:0,start:n.start,end:n.end}};n.yt_privacy&&(a.host="https://www.youtube-nocookie.com",a.origin=window.location.hostname),this.youtubePlayer=new e.Player(this.elements.$video[0],a)}},{key:"bindEvents",value:function bindEvents(){this.elements.$imageOverlay.on("click",this.handleVideo.bind(this))}},{key:"onInit",value:function onInit(){var e=this;(0,s.default)((0,u.default)(Video.prototype),"onInit",this).call(this);var t=this.getElementSettings();if("youtube"===t.video_type&&(this.apiProvider=elementorFrontend.utils.youtube,this.videoID=this.apiProvider.getVideoIDFromURL(t.youtube_url),this.videoID&&(!t.show_image_overlay||!t.image_overlay.url)))return t.lazy_load?(this.intersectionObserver=elementorModules.utils.Scroll.scrollObserver({callback:function callback(t){t.isInViewport&&(e.intersectionObserver.unobserve(e.elements.$video.parent()[0]),e.apiProvider.onApiReady((function(t){return e.prepareYTVideo(t)})))}}),void this.intersectionObserver.observe(this.elements.$video.parent()[0])):void(elementorFrontend.config.experimentalFeatures.e_optimized_assets_loading?this.apiProvider.onApiReady((function(t){return e.prepareYTVideo(t)})):setTimeout((function(){e.apiProvider.onApiReady((function(t){return e.prepareYTVideo(t)}))}),0))}},{key:"onElementChange",value:function onElementChange(e){if(0!==e.indexOf("lightbox_content_animation")){var t=this.getElementSettings("lightbox");"lightbox"!==e||t?"aspect_ratio"===e&&t&&this.handleAspectRatio():this.hideLightbox()}else this.animateVideo()}}]),Video}(elementorModules.frontend.handlers.Base);t.default=v},4208:(e,t,i)=>{"use strict";var n=i(6365),a=i(6033),r=i(6078),o=i(3338),l=i(8492),s=i(2404),u=Math.max,d=Math.min,c=Math.floor,v=/\$([$&`']|\d\d?|<[^>]*>)/g,h=/\$([$&`']|\d\d?)/g;i(8897)("replace",2,(function(e,t,i,f){return[function replace(n,a){var r=e(this),o=null==n?void 0:n[t];return void 0!==o?o.call(n,r,a):i.call(String(r),n,a)},function(e,t){var a=f(i,e,this,t);if(a.done)return a.value;var c=n(e),v=String(this),h="function"==typeof t;h||(t=String(t));var p=c.global;if(p){var m=c.unicode;c.lastIndex=0}for(var g=[];;){var y=s(c,v);if(null===y)break;if(g.push(y),!p)break;""===String(y[0])&&(c.lastIndex=l(v,r(c.lastIndex),m))}for(var b,_="",V=0,x=0;x<g.length;x++){y=g[x];for(var k=String(y[0]),$=u(d(o(y.index),v.length),0),S=[],w=1;w<y.length;w++)S.push(void 0===(b=y[w])?b:String(b));var I=y.groups;if(h){var E=[k].concat(S,$,v);void 0!==I&&E.push(I);var P=String(t.apply(void 0,E))}else P=getSubstitution(k,v,$,S,I,t);$>=V&&(_+=v.slice(V,$)+P,V=$+k.length)}return _+v.slice(V)}];function getSubstitution(e,t,n,r,o,l){var s=n+e.length,u=r.length,d=h;return void 0!==o&&(o=a(o),d=v),i.call(l,d,(function(i,a){var l;switch(a.charAt(0)){case"$":return"$";case"&":return e;case"`":return t.slice(0,n);case"'":return t.slice(s);case"<":l=o[a.slice(1,-1)];break;default:var d=+a;if(0===d)return i;if(d>u){var v=c(d/10);return 0===v?i:v<=u?void 0===r[v-1]?a.charAt(1):r[v-1]+a.charAt(1):i}l=r[d-1]}return void 0===l?"":l}))}}))}}]);