Current File : /home/kelaby89/muzza.fit/wp-content/plugins/wolf-visual-composer/assets/js/lib/player.min.js |
!function(a,b){"object"==typeof exports&&"undefined"!=typeof module?module.exports=b():"function"==typeof define&&define.amd?define(b):(a.Vimeo=a.Vimeo||{},a.Vimeo.Player=b())}(this,function(){"use strict";function a(a,b){return 0===a.indexOf(b.toLowerCase())?a:""+b.toLowerCase()+a.substr(0,1).toUpperCase()+a.substr(1)}function b(a){return a instanceof window.HTMLElement}function c(a){return!isNaN(parseFloat(a))&&isFinite(a)&&Math.floor(a)==a}function d(a){return/^(https?:)?\/\/((player|www).)?vimeo.com(?=$|\/)/.test(a)}function e(){var a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},b=a.id,e=a.url,f=b||e;if(!f)throw new Error("An id or url must be passed, either in an options object or as a data-vimeo-id or data-vimeo-url attribute.");if(c(f))return"https://vimeo.com/"+f;if(d(f))return f.replace("http:","https:");if(b)throw new TypeError("“"+b+"” is not a valid video id.");throw new TypeError("“"+f+"” is not a vimeo.com url.")}function f(a,b){return b={exports:{}},a(b,b.exports),b.exports}function g(a,b,c){var d=z.get(a.element)||{};b in d||(d[b]=[]),d[b].push(c),z.set(a.element,d)}function h(a,b){var c=z.get(a.element)||{};return c[b]||[]}function i(a,b,c){var d=z.get(a.element)||{};if(!d[b])return!0;if(!c)return d[b]=[],z.set(a.element,d),!0;var e=d[b].indexOf(c);return e!==-1&&d[b].splice(e,1),z.set(a.element,d),d[b]&&0===d[b].length}function j(a,b){var c=h(a,b);if(c.length<1)return!1;var d=c.shift();return i(a,b,d),d}function k(a,b){var c=z.get(a);z.set(b,c),z["delete"](a)}function l(a){var b=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return A.reduce(function(b,c){var d=a.getAttribute("data-vimeo-"+c);return(d||""===d)&&(b[c]=""===d?1:d),b},b)}function m(a){var b=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise(function(c,e){if(!d(a))throw new TypeError("“"+a+"” is not a vimeo.com url.");var f="https://vimeo.com/api/oembed.json?url="+encodeURIComponent(a);for(var g in b)b.hasOwnProperty(g)&&(f+="&"+g+"="+encodeURIComponent(b[g]));var h="XDomainRequest"in window?new XDomainRequest:new XMLHttpRequest;h.open("GET",f,!0),h.onload=function(){if(404===h.status)return void e(new Error("“"+a+"” was not found."));if(403===h.status)return void e(new Error("“"+a+"” is not embeddable."));try{var b=JSON.parse(h.responseText);c(b)}catch(d){e(d)}},h.onerror=function(){var a=h.status?" ("+h.status+")":"";e(new Error("There was an error fetching the embed code from Vimeo"+a+"."))},h.send()})}function n(a,b){var c=a.html;if(!b)throw new TypeError("An element must be provided");if(null!==b.getAttribute("data-vimeo-initialized"))return b.querySelector("iframe");var d=document.createElement("div");return d.innerHTML=c,b.appendChild(d.firstChild),b.setAttribute("data-vimeo-initialized","true"),b.querySelector("iframe")}function o(){var a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document,b=[].slice.call(a.querySelectorAll("[data-vimeo-id], [data-vimeo-url]")),c=function(a){"console"in window&&console.error&&console.error("There was an error creating an embed: "+a)};b.forEach(function(a){try{if(null!==a.getAttribute("data-vimeo-defer"))return;var b=l(a),d=e(b);m(d,b).then(function(b){return n(b,a)})["catch"](c)}catch(f){c(f)}})}function p(){var a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document,b=function(b){if(d(b.origin)&&b.data&&"spacechange"===b.data.event)for(var c=a.querySelectorAll("iframe"),e=0;e<c.length;e++)if(c[e].contentWindow===b.source){var f=c[e].parentElement;f.style.paddingBottom=b.data.data[0].bottom+"px";break}};window.addEventListener?window.addEventListener("message",b,!1):window.attachEvent&&window.attachEvent("onmessage",b)}function q(a){return"string"==typeof a&&(a=JSON.parse(a)),a}function r(a,b,c){if(a.element.contentWindow&&a.element.contentWindow.postMessage){var d={method:b};void 0!==c&&(d.value=c);var e=parseFloat(navigator.userAgent.toLowerCase().replace(/^.*msie (\d+).*$/,"$1"));e>=8&&e<10&&(d=JSON.stringify(d)),a.element.contentWindow.postMessage(d,a.origin)}}function s(a,b){b=q(b);var c=[],d=void 0;if(b.event){if("error"===b.event){var e=h(a,b.data.method);e.forEach(function(c){var d=new Error(b.data.message);d.name=b.data.name,c.reject(d),i(a,b.data.method,c)})}c=h(a,"event:"+b.event),d=b.data}else if(b.method){var f=j(a,b.method);f&&(c.push(f),d=b.value)}c.forEach(function(b){try{if("function"==typeof b)return void b.call(a,d);b.resolve(d)}catch(c){}})}function t(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}var u="undefined"!=typeof global&&"[object global]"==={}.toString.call(global),v="undefined"!=typeof Array.prototype.indexOf,w="undefined"!=typeof window&&"undefined"!=typeof window.postMessage;if(!(u||v&&w))throw new Error("Sorry, the Vimeo Player API is not available in this browser.");var x="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},y=(f(function(a,b){!function(a){function b(a,b){function d(a){return this&&this.constructor===d?(this._keys=[],this._values=[],this._itp=[],this.objectOnly=b,void(a&&c.call(this,a))):new d(a)}return b||t(a,"size",{get:q}),a.constructor=d,d.prototype=a,d}function c(a){this.add?a.forEach(this.add,this):a.forEach(function(a){this.set(a[0],a[1])},this)}function d(a){return this.has(a)&&(this._keys.splice(s,1),this._values.splice(s,1),this._itp.forEach(function(a){s<a[0]&&a[0]--})),-1<s}function e(a){return this.has(a)?this._values[s]:void 0}function f(a,b){if(this.objectOnly&&b!==Object(b))throw new TypeError("Invalid value used as weak collection key");if(b!=b||0===b)for(s=a.length;s--&&!u(a[s],b););else s=a.indexOf(b);return-1<s}function g(a){return f.call(this,this._values,a)}function h(a){return f.call(this,this._keys,a)}function i(a,b){return this.has(a)?this._values[s]=b:this._values[this._keys.push(a)-1]=b,this}function j(a){return this.has(a)||this._values.push(a),this}function k(){(this._keys||0).length=this._values.length=0}function l(){return p(this._itp,this._keys)}function m(){return p(this._itp,this._values)}function n(){return p(this._itp,this._keys,this._values)}function o(){return p(this._itp,this._values,this._values)}function p(a,b,c){var d=[0],e=!1;return a.push(d),{next:function(){var f,g=d[0];return!e&&g<b.length?(f=c?[b[g],c[g]]:b[g],d[0]++):(e=!0,a.splice(a.indexOf(d),1)),{done:e,value:f}}}}function q(){return this._values.length}function r(a,b){for(var c=this.entries();;){var d=c.next();if(d.done)break;a.call(b,d.value[1],d.value[0],this)}}var s,t=Object.defineProperty,u=function(a,b){return a===b||a!==a&&b!==b};"undefined"==typeof WeakMap&&(a.WeakMap=b({"delete":d,clear:k,get:e,has:h,set:i},!0)),"undefined"!=typeof Map&&"function"==typeof(new Map).values&&(new Map).values().next||(a.Map=b({"delete":d,has:h,get:e,set:i,keys:l,values:m,entries:n,forEach:r,clear:k})),"undefined"!=typeof Set&&"function"==typeof(new Set).values&&(new Set).values().next||(a.Set=b({has:g,add:j,"delete":d,clear:k,keys:m,values:m,entries:o,forEach:r})),"undefined"==typeof WeakSet&&(a.WeakSet=b({"delete":d,add:j,clear:k,has:g},!0))}("undefined"!=typeof x?x:window)}),f(function(a){var b="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a};!function(b,c,d){c[b]=c[b]||d(),a.exports&&(a.exports=c[b])}("Promise","undefined"!=typeof x?x:x,function(){function a(a,b){n.add(a,b),m||(m=p(n.drain))}function c(a){var c,d="undefined"==typeof a?"undefined":b(a);return null==a||"object"!=d&&"function"!=d||(c=a.then),"function"==typeof c&&c}function d(){for(var a=0;a<this.chain.length;a++)e(this,1===this.state?this.chain[a].success:this.chain[a].failure,this.chain[a]);this.chain.length=0}function e(a,b,d){var e,f;try{b===!1?d.reject(a.msg):(e=b===!0?a.msg:b.call(void 0,a.msg),e===d.promise?d.reject(TypeError("Promise-chain cycle")):(f=c(e))?f.call(e,d.resolve,d.reject):d.resolve(e))}catch(g){d.reject(g)}}function f(b){var e,h=this;if(!h.triggered){h.triggered=!0,h.def&&(h=h.def);try{(e=c(b))?a(function(){var a=new i(h);try{e.call(b,function(){f.apply(a,arguments)},function(){g.apply(a,arguments)})}catch(c){g.call(a,c)}}):(h.msg=b,h.state=1,h.chain.length>0&&a(d,h))}catch(j){g.call(new i(h),j)}}}function g(b){var c=this;c.triggered||(c.triggered=!0,c.def&&(c=c.def),c.msg=b,c.state=2,c.chain.length>0&&a(d,c))}function h(a,b,c,d){for(var e=0;e<b.length;e++)!function(e){a.resolve(b[e]).then(function(a){c(e,a)},d)}(e)}function i(a){this.def=a,this.triggered=!1}function j(a){this.promise=a,this.state=0,this.triggered=!1,this.chain=[],this.msg=void 0}function k(b){if("function"!=typeof b)throw TypeError("Not a function");if(0!==this.__NPO__)throw TypeError("Not a promise");this.__NPO__=1;var c=new j(this);this.then=function(b,e){var f={success:"function"!=typeof b||b,failure:"function"==typeof e&&e};return f.promise=new this.constructor(function(a,b){if("function"!=typeof a||"function"!=typeof b)throw TypeError("Not a function");f.resolve=a,f.reject=b}),c.chain.push(f),0!==c.state&&a(d,c),f.promise},this["catch"]=function(a){return this.then(void 0,a)};try{b.call(void 0,function(a){f.call(c,a)},function(a){g.call(c,a)})}catch(e){g.call(c,e)}}var l,m,n,o=Object.prototype.toString,p="undefined"!=typeof setImmediate?function(a){return setImmediate(a)}:setTimeout;try{Object.defineProperty({},"x",{}),l=function(a,b,c,d){return Object.defineProperty(a,b,{value:c,writable:!0,configurable:d!==!1})}}catch(q){l=function(a,b,c){return a[b]=c,a}}n=function(){function a(a,b){this.fn=a,this.self=b,this.next=void 0}var b,c,d;return{add:function(e,f){d=new a(e,f),c?c.next=d:b=d,c=d,d=void 0},drain:function(){var a=b;for(b=c=m=void 0;a;)a.fn.call(a.self),a=a.next}}}();var r=l({},"constructor",k,!1);return k.prototype=r,l(r,"__NPO__",0,!1),l(k,"resolve",function(a){var c=this;return a&&"object"==("undefined"==typeof a?"undefined":b(a))&&1===a.__NPO__?a:new c(function(b,c){if("function"!=typeof b||"function"!=typeof c)throw TypeError("Not a function");b(a)})}),l(k,"reject",function(a){return new this(function(b,c){if("function"!=typeof b||"function"!=typeof c)throw TypeError("Not a function");c(a)})}),l(k,"all",function(a){var b=this;return"[object Array]"!=o.call(a)?b.reject(TypeError("Not an array")):0===a.length?b.resolve([]):new b(function(c,d){if("function"!=typeof c||"function"!=typeof d)throw TypeError("Not a function");var e=a.length,f=Array(e),g=0;h(b,a,function(a,b){f[a]=b,++g===e&&c(f)},d)})}),l(k,"race",function(a){var b=this;return"[object Array]"!=o.call(a)?b.reject(TypeError("Not an array")):new b(function(c,d){if("function"!=typeof c||"function"!=typeof d)throw TypeError("Not a function");h(b,a,function(a,b){c(b)},d)})}),k})})),z=new WeakMap,A=["autopause","autoplay","background","byline","color","height","id","loop","maxheight","maxwidth","muted","playsinline","portrait","responsive","speed","title","transparent","url","width"],B=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),C=new WeakMap,D=new WeakMap,E=function(){function c(a){var f=this,g=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(t(this,c),window.jQuery&&a instanceof jQuery&&(a.length>1&&window.console&&console.warn&&console.warn("A jQuery object with multiple elements was passed, using the first element."),a=a[0]),"undefined"!=typeof document&&"string"==typeof a&&(a=document.getElementById(a)),!b(a))throw new TypeError("You must pass either a valid element or a valid id.");if("IFRAME"!==a.nodeName){var h=a.querySelector("iframe");h&&(a=h)}if("IFRAME"===a.nodeName&&!d(a.getAttribute("src")||""))throw new Error("The player element passed isn’t a Vimeo embed.");if(C.has(a))return C.get(a);this.element=a,this.origin="*";var i=new y(function(b,c){var h=function(a){if(d(a.origin)&&f.element.contentWindow===a.source){"*"===f.origin&&(f.origin=a.origin);var c=q(a.data),e="event"in c&&"ready"===c.event,g="method"in c&&"ping"===c.method;return e||g?(f.element.setAttribute("data-ready","true"),void b()):void s(f,c)}};if(window.addEventListener?window.addEventListener("message",h,!1):window.attachEvent&&window.attachEvent("onmessage",h),"IFRAME"!==f.element.nodeName){var i=l(a,g),j=e(i);m(j,i).then(function(b){var c=n(b,a);return f.element=c,f._originalElement=a,k(a,c),C.set(f.element,f),b})["catch"](function(a){return c(a)})}});return D.set(this,i),C.set(this.element,this),"IFRAME"===this.element.nodeName&&r(this,"ping"),this}return B(c,[{key:"callMethod",value:function(a){var b=this,c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new y(function(d,e){return b.ready().then(function(){g(b,a,{resolve:d,reject:e}),r(b,a,c)})["catch"](function(a){e(a)})})}},{key:"get",value:function(b){var c=this;return new y(function(d,e){return b=a(b,"get"),c.ready().then(function(){g(c,b,{resolve:d,reject:e}),r(c,b)})})}},{key:"set",value:function(b,c){var d=this;return y.resolve(c).then(function(c){if(b=a(b,"set"),void 0===c||null===c)throw new TypeError("There must be a value to set.");return d.ready().then(function(){return new y(function(a,e){g(d,b,{resolve:a,reject:e}),r(d,b,c)})})})}},{key:"on",value:function(a,b){if(!a)throw new TypeError("You must pass an event name.");if(!b)throw new TypeError("You must pass a callback function.");if("function"!=typeof b)throw new TypeError("The callback must be a function.");var c=h(this,"event:"+a);0===c.length&&this.callMethod("addEventListener",a)["catch"](function(){}),g(this,"event:"+a,b)}},{key:"off",value:function(a,b){if(!a)throw new TypeError("You must pass an event name.");if(b&&"function"!=typeof b)throw new TypeError("The callback must be a function.");var c=i(this,"event:"+a,b);c&&this.callMethod("removeEventListener",a)["catch"](function(a){})}},{key:"loadVideo",value:function(a){return this.callMethod("loadVideo",a)}},{key:"ready",value:function(){var a=D.get(this)||new y(function(a,b){b("Unknown player. Probably unloaded.")});return y.resolve(a)}},{key:"addCuePoint",value:function(a){var b=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.callMethod("addCuePoint",{time:a,data:b})}},{key:"removeCuePoint",value:function(a){return this.callMethod("removeCuePoint",a)}},{key:"enableTextTrack",value:function(a,b){if(!a)throw new TypeError("You must pass a language.");return this.callMethod("enableTextTrack",{language:a,kind:b})}},{key:"disableTextTrack",value:function(){return this.callMethod("disableTextTrack")}},{key:"pause",value:function(){return this.callMethod("pause")}},{key:"play",value:function(){return this.callMethod("play")}},{key:"unload",value:function(){return this.callMethod("unload")}},{key:"destroy",value:function(){var a=this;return new y(function(b){D["delete"](a),C["delete"](a.element),a._originalElement&&(C["delete"](a._originalElement),a._originalElement.removeAttribute("data-vimeo-initialized")),a.element&&"IFRAME"===a.element.nodeName&&a.element.remove(),b()})}},{key:"getAutopause",value:function(){return this.get("autopause")}},{key:"setAutopause",value:function(a){return this.set("autopause",a)}},{key:"getColor",value:function(){return this.get("color")}},{key:"setColor",value:function(a){return this.set("color",a)}},{key:"getCuePoints",value:function(){return this.get("cuePoints")}},{key:"getCurrentTime",value:function(){return this.get("currentTime")}},{key:"setCurrentTime",value:function(a){return this.set("currentTime",a)}},{key:"getDuration",value:function(){return this.get("duration")}},{key:"getEnded",value:function(){return this.get("ended")}},{key:"getLoop",value:function(){return this.get("loop")}},{key:"setLoop",value:function(a){return this.set("loop",a)}},{key:"getPaused",value:function(){return this.get("paused")}},{key:"getPlaybackRate",value:function(){return this.get("playbackRate")}},{key:"setPlaybackRate",value:function(a){return this.set("playbackRate",a)}},{key:"getTextTracks",value:function(){return this.get("textTracks")}},{key:"getVideoEmbedCode",value:function(){return this.get("videoEmbedCode")}},{key:"getVideoId",value:function(){return this.get("videoId")}},{key:"getVideoTitle",value:function(){return this.get("videoTitle")}},{key:"getVideoWidth",value:function(){return this.get("videoWidth")}},{key:"getVideoHeight",value:function(){return this.get("videoHeight")}},{key:"getVideoUrl",value:function(){return this.get("videoUrl")}},{key:"getVolume",value:function(){return this.get("volume")}},{key:"setVolume",value:function(a){return this.set("volume",a)}}]),c}();return u||!window.Vimeo||window.Vimeo.Player||(o(),p()),E});