@playkit-js/playkit-js-providers 2.40.3-canary.0-f4a978f → 2.40.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,3 @@
1
1
  /*! For license information please see playkit-ovp-provider.js.LICENSE.txt */
2
- !function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var r=e();for(var n in r)("object"==typeof exports?exports:t)[n]=r[n]}}(self,(function(){return function(){var t={61:function(t,e,r){var n=r(698).default;function i(){"use strict";t.exports=i=function(){return r},t.exports.__esModule=!0,t.exports.default=t.exports;var e,r={},o=Object.prototype,a=o.hasOwnProperty,s=Object.defineProperty||function(t,e,r){t[e]=r.value},u="function"==typeof Symbol?Symbol:{},c=u.iterator||"@@iterator",l=u.asyncIterator||"@@asyncIterator",f=u.toStringTag||"@@toStringTag";function d(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{d({},"")}catch(e){d=function(t,e,r){return t[e]=r}}function h(t,e,r,n){var i=e&&e.prototype instanceof _?e:_,o=Object.create(i.prototype),a=new D(n||[]);return s(o,"_invoke",{value:b(t,r,a)}),o}function p(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}r.wrap=h;var y="suspendedStart",v="suspendedYield",m="executing",g="completed",E={};function _(){}function I(){}function R(){}var T={};d(T,c,(function(){return this}));var A=Object.getPrototypeOf,w=A&&A(A(x([])));w&&w!==o&&a.call(w,c)&&(T=w);var C=R.prototype=_.prototype=Object.create(T);function O(t){["next","throw","return"].forEach((function(e){d(t,e,(function(t){return this._invoke(e,t)}))}))}function k(t,e){function r(i,o,s,u){var c=p(t[i],t,o);if("throw"!==c.type){var l=c.arg,f=l.value;return f&&"object"==n(f)&&a.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,s,u)}),(function(t){r("throw",t,s,u)})):e.resolve(f).then((function(t){l.value=t,s(l)}),(function(t){return r("throw",t,s,u)}))}u(c.arg)}var i;s(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,i){r(t,n,e,i)}))}return i=i?i.then(o,o):o()}})}function b(t,r,n){var i=y;return function(o,a){if(i===m)throw new Error("Generator is already running");if(i===g){if("throw"===o)throw a;return{value:e,done:!0}}for(n.method=o,n.arg=a;;){var s=n.delegate;if(s){var u=P(s,n);if(u){if(u===E)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===y)throw i=g,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=m;var c=p(t,r,n);if("normal"===c.type){if(i=n.done?g:v,c.arg===E)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(i=g,n.method="throw",n.arg=c.arg)}}}function P(t,r){var n=r.method,i=t.iterator[n];if(i===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,P(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),E;var o=p(i,t.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,E;var a=o.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,E):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,E)}function S(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function L(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function D(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(S,this),this.reset(!0)}function x(t){if(t||""===t){var r=t[c];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,o=function r(){for(;++i<t.length;)if(a.call(t,i))return r.value=t[i],r.done=!1,r;return r.value=e,r.done=!0,r};return o.next=o}}throw new TypeError(n(t)+" is not iterable")}return I.prototype=R,s(C,"constructor",{value:R,configurable:!0}),s(R,"constructor",{value:I,configurable:!0}),I.displayName=d(R,f,"GeneratorFunction"),r.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===I||"GeneratorFunction"===(e.displayName||e.name))},r.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,R):(t.__proto__=R,d(t,f,"GeneratorFunction")),t.prototype=Object.create(C),t},r.awrap=function(t){return{__await:t}},O(k.prototype),d(k.prototype,l,(function(){return this})),r.AsyncIterator=k,r.async=function(t,e,n,i,o){void 0===o&&(o=Promise);var a=new k(h(t,e,n,i),o);return r.isGeneratorFunction(e)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},O(C),d(C,f,"Generator"),d(C,c,(function(){return this})),d(C,"toString",(function(){return"[object Generator]"})),r.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},r.values=x,D.prototype={constructor:D,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(L),!t)for(var r in this)"t"===r.charAt(0)&&a.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(n,i){return s.type="throw",s.arg=t,r.next=n,i&&(r.method="next",r.arg=e),!!i}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],s=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var u=a.call(o,"catchLoc"),c=a.call(o,"finallyLoc");if(u&&c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(u){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&a.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var i=n;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var o=i?i.completion:{};return o.type=t,o.arg=e,i?(this.method="next",this.next=i.finallyLoc,E):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),E},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),L(r),E}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;L(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:x(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),E}},r}t.exports=i,t.exports.__esModule=!0,t.exports.default=t.exports},698:function(t){function e(r){return t.exports=e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t.exports.__esModule=!0,t.exports.default=t.exports,e(r)}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports},687:function(t,e,r){var n=r(61)();t.exports=n;try{regeneratorRuntime=n}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=n:Function("r","regeneratorRuntime = r")(n)}}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var o=e[n]={exports:{}};return t[n](o,o.exports,r),o.exports}r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,{a:e}),e},r.d=function(t,e){for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return function(){"use strict";r.r(n),r.d(n,{NAME:function(){return Dt},Provider:function(){return Lt},ProviderParser:function(){return ot},RequestBuilder:function(){return st},ResponseTypes:function(){return t},VERSION:function(){return xt}});var t={};function e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i(t)}function o(t){var e=function(t,e){if("object"!==i(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==i(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"===i(e)?e:String(e)}function a(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,o(n.key),n)}}function s(t,e,r){return e&&a(t.prototype,e),r&&a(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function u(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function c(t,e){return c=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},c(t,e)}function l(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&c(t,e)}function f(t,e){if(e&&("object"===i(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return u(t)}function d(t){return d=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},d(t)}function h(t,e,r){return(e=o(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}r.r(t),r.d(t,{BaseServiceResult:function(){return I},KalturaAccessControlMessage:function(){return x},KalturaAccessControlModifyRequestHostRegexAction:function(){return C},KalturaBaseEntryListResponse:function(){return A},KalturaBumper:function(){return b},KalturaDrmPlaybackPluginData:function(){return O},KalturaFlavorAsset:function(){return P},KalturaMediaEntries:function(){return S},KalturaMediaEntry:function(){return T},KalturaMetadata:function(){return L},KalturaMetadataListResponse:function(){return D},KalturaPlaybackContext:function(){return M},KalturaPlaybackSource:function(){return k},KalturaPlaylist:function(){return N},KalturaRuleAction:function(){return w},KalturaUIConfResponse:function(){return U},KalturaUserEntry:function(){return j},KalturaUserEntryListResponse:function(){return B}});var p={get:function(){return{VERSION:"",DEBUG:{value:"",name:""},ERROR:{value:"",name:""},INFO:{value:"",name:""},OFF:{value:"",name:""},TIME:{value:"",name:""},TRACE:{value:"",name:""},WARN:{value:"",name:""},createDefaultHandler:function(){},debug:function(){},enabledFor:function(){},error:function(){},get:function(){},getLevel:function(){},info:function(){},log:function(){},setHandler:function(){},setLevel:function(){},time:function(){},timeEnd:function(){},trace:function(){},useDefaults:function(){},warn:function(){}}}},y={};function v(t){return p.get(t)}var m=v,g=function t(e){var r;return Array.isArray(e)?(r=e.length>0?e.slice(0):[]).forEach((function(e,n){("object"===i(e)||Array.isArray(e)&&e.length>0)&&(r[n]=t(e))})):"object"===i(e)?(r=Object.assign({},e),Object.keys(r).forEach((function(e){("object"===i(r[e])||Array.isArray(r[e])&&r[e].length>0)&&(r[e]=t(r[e]))}))):r=e,r},E={serviceUrl:"https://cdnapisec.kaltura.com/api_v3",cdnUrl:"https://cdnapisec.kaltura.com",serviceParams:{apiVersion:"3.3.0",format:1},useApiCaptions:!0,loadThumbnailWithKs:!1,replaceHostOnlyManifestUrls:!1},_=function(){function t(){e(this,t)}return s(t,null,[{key:"set",value:function(t){t&&Object.assign(E,t)}},{key:"get",value:function(){return g(E)}}]),t}(),I=s((function t(r){e(this,t),h(this,"hasError",!1),"KalturaAPIException"===r.objectType?(this.hasError=!0,this.error=new R(r.code,r.message)):r.error&&"KalturaAPIException"===r.error.objectType?(this.hasError=!0,this.error=new R(r.error.code,r.error.message)):this.data=r})),R=s((function t(r,n){e(this,t),this.code=r,this.message=n})),T=s((function t(r){e(this,t),this.id=r.id,this.referenceId=r.referenceId,this.externalSourceType=r.externalSourceType,this.name=r.name,this.description=r.description,this.dataUrl=r.dataUrl,this.type=r.type,this.entryType=r.mediaType,this.flavorParamsIds=r.flavorParamsIds,this.duration=r.duration,this.poster=r.thumbnailUrl,this.status=r.status,this.dvrStatus=r.dvrStatus,this.tags=r.tags,this.createdAt=r.createdAt,this.updatedAt=r.updatedAt,this.creatorId=r.creatorId,this.endDate=r.endDate,this.plays=r.plays,this.views=r.views,this.downloadUrl=r.downloadUrl}));h(T,"EntryType",{AUTOMATIC:{value:-1},EXTERNAL_MEDIA:{value:"externalMedia.externalMedia"},MEDIA_CLIP:{value:1},MIX:{value:2},PLAYLIST:{value:5},DATA:{value:6},LIVE_STREAM:{value:7},LIVE_CHANNEL:{value:8},DOCUMENT:{value:10}}),h(T,"MediaType",{VIDEO:{value:1},IMAGE:{value:2},AUDIO:{value:5},LIVE_STREAM_FLASH:{value:201},LIVE_STREAM_WINDOWS_MEDIA:{value:202},LIVE_STREAM_REAL_MEDIA:{value:203},LIVE_STREAM_QUICK_TIME:{value:204}}),h(T,"EntryStatus",{ERROR_IMPORTING:-2,ERROR_CONVERTING:-1,SCAN_FAILURE:"virusScan.ScanFailure",IMPORT:0,INFECTED:"virusScan.Infected",PRECONVERT:1,READY:2,DELETED:3,PENDING:4,MODERATE:5,BLOCKED:6,NO_CONTENT:7}),h(T,"EntryModerationStatus",{PENDING_MODERATION:1,APPROVED:2,REJECTED:3,FLAGGED_FOR_REVIEW:4,MODERATE:5,AUTO_APPROVED:6});var A=function(t){l(o,t);var r,n,i=(r=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=d(r);if(n){var i=d(this).constructor;t=Reflect.construct(e,arguments,i)}else t=e.apply(this,arguments);return f(this,t)});function o(t){var r;return e(this,o),(r=i.call(this,t)).hasError||(r.totalCount=t.totalCount,r.totalCount>0&&(r.entries=[],t.objects.map((function(t){return r.entries.push(new T(t))})))),r}return s(o)}(I),w=s((function t(r){e(this,t),this.type=r.type}));h(w,"Type",{DRM_POLICY:"drm.DRM_POLICY",BLOCK:1,PREVIEW:2,LIMIT_FLAVORS:3,ADD_TO_STORAGE:4,LIMIT_DELIVERY_PROFILES:5,SERVE_FROM_REMOTE_SERVER:6,REQUEST_HOST_REGEX:7,LIMIT_THUMBNAIL_CAPTURE:8});var C=function(t){l(o,t);var r,n,i=(r=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=d(r);if(n){var i=d(this).constructor;t=Reflect.construct(e,arguments,i)}else t=e.apply(this,arguments);return f(this,t)});function o(t){var r;return e(this,o),(r=i.call(this,t)).pattern=t.pattern,r.replacement=t.replacement,r.replacmenServerNodeId=t.replacmenServerNodeId,r.checkAliveTimeoutMs=t.checkAliveTimeoutMs,r}return s(o)}(w),O=s((function t(r){e(this,t),this.scheme=r.scheme,this.licenseURL=r.licenseURL,this.certificate=r.certificate}));h(O,"Scheme",{"drm.PLAYREADY_CENC":"com.microsoft.playready","drm.WIDEVINE_CENC":"com.widevine.alpha","fairplay.FAIRPLAY":"com.apple.fairplay",WIDEVINE_CENC:"com.widevine.alpha",PLAYREADY_CENC:"com.microsoft.playready",FAIRPLAY:"com.apple.fairplay"});var k=function(){function t(r){var n=this;e(this,t),h(this,"drm",[]),this.format=r.format,this.deliveryProfileId=r.deliveryProfileId,this.url=r.url,this.protocols=r.protocols,this.flavorIds=r.flavorIds,r.drm&&r.drm.map((function(t){return n.drm.push(new O(t))}))}return s(t,[{key:"hasDrmData",value:function(){return this.drm&&this.drm.length>0}},{key:"hasFlavorIds",value:function(){return!!this.flavorIds&&this.flavorIds.length>0}},{key:"getProtocol",value:function(t){var e="";if(this.protocols&&this.protocols.length>0)this.protocols.split(",").forEach((function(r){r===t&&(e=r)}));else if("http"===t)return t;return e}}]),t}(),b=s((function t(r){e(this,t),this.entryId=r.entryId,this.clickThroughUrl=r.url,this.sources=r.sources?r.sources.map((function(t){return new k(t)})):[]})),P=s((function t(r){e(this,t),this.id=r.id,this.flavorParamsId=r.flavorParamsId,this.fileExt=r.fileExt,this.bitrate=r.bitrate,this.width=r.width,this.height=r.height,this.id=r.id,this.frameRate=r.frameRate,this.isOriginal=r.isOriginal,this.isWeb=r.isWeb,this.containerFormat=r.containerFormat,this.videoCodecId=r.videoCodecId,this.status=r.status,this.language=r.language,this.label=r.label}));h(P,"Status",{ERROR:-1,QUEUED:0,CONVERTING:1,READY:2,DELETED:3,NOT_APPLICABLE:4,TEMP:5,WAIT_FOR_CONVERT:6,IMPORTING:7,VALIDATING:8,EXPORTING:9});var S=function(t){l(o,t);var r,n,i=(r=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=d(r);if(n){var i=d(this).constructor;t=Reflect.construct(e,arguments,i)}else t=e.apply(this,arguments);return f(this,t)});function o(t){var r;return e(this,o),(r=i.call(this,t)).hasError||(r.entries=[],t.map((function(t){return r.entries.push(new T(t))}))),r}return s(o)}(I),L=s((function t(r){e(this,t),this.id=r.id,this.metadataProfileId=r.metadataProfileId,this.metadataProfileVersion=r.metadataProfileVersion,this.metadataProfileId=r.metadataProfileId,this.metadataObjectType=r.metadataObjectType,this.objectId=r.objectId,this.version=r.version,this.created=new Date(0),this.created.setUTCSeconds(r.createdAt),this.updated=new Date(0),this.updated.setUTCSeconds(r.updatedAt),this.status=r.status,this.xml=r.xml}));h(L,"ObjectType",{AD_CUE_POINT:"adCuePointMetadata.AdCuePoint",ANNOTATION:"annotationMetadata.Annotation",CODE_CUE_POINT:"codeCuePointMetadata.CodeCuePoint",THUMB_CUE_POINT:"thumbCuePointMetadata.thumbCuePoint",ENTRY:1,CATEGORY:2,USER:3,PARTNER:4,DYNAMIC_OBJECT:5}),h(L,"Status",{VALID:1,INVALID:2,DELETED:3});var D=function(t){l(o,t);var r,n,i=(r=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=d(r);if(n){var i=d(this).constructor;t=Reflect.construct(e,arguments,i)}else t=e.apply(this,arguments);return f(this,t)});function o(t){var r;return e(this,o),(r=i.call(this,t)).hasError||(r.totalCount=t.totalCount,r.totalCount>0&&(r.metas=[],t.objects.map((function(t){return r.metas.push(new L(t))})))),r}return s(o)}(I),x=s((function t(r){e(this,t),this.message=r.message,this.code=r.code}));var M=function(t){l(o,t);var r,n,i=(r=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=d(r);if(n){var i=d(this).constructor;t=Reflect.construct(e,arguments,i)}else t=e.apply(this,arguments);return f(this,t)});function o(t){var r;if(e(this,o),h(u(r=i.call(this,t)),"sources",[]),h(u(r),"actions",[]),h(u(r),"messages",[]),h(u(r),"flavorAssets",[]),h(u(r),"bumperData",[]),!r.hasError){var n=t.messages;n&&n.map((function(t){return r.messages.push(new x(t))}));var a=t.actions;a&&a.map((function(t){t.type===w.Type.REQUEST_HOST_REGEX?r.actions.push(new C(t)):r.actions.push(new w(t))}));var s=t.sources;s&&s.map((function(t){return r.sources.push(new k(t))}));var c=t.flavorAssets;c&&c.map((function(t){return r.flavorAssets.push(new P(t))}));var l=t.bumperData;l&&l.map((function(t){return r.bumperData.push(new b(t))}))}return r}return s(o,[{key:"hasBlockAction",value:function(){return void 0!==this.getBlockAction()}},{key:"getBlockAction",value:function(){return this.actions.find((function(t){return t.type===w.Type.BLOCK}))}},{key:"getErrorMessages",value:function(){return this.messages}},{key:"getRequestHostRegexAction",value:function(){var t=this.actions.find((function(t){return t.type===w.Type.REQUEST_HOST_REGEX}));if(t instanceof C)return t}}]),o}(I),N=s((function t(r){e(this,t),this.id=r.id,this.name=r.name,this.description=r.description,this.poster=r.thumbnailUrl}));var U=function(t){l(o,t);var r,n,i=(r=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=d(r);if(n){var i=d(this).constructor;t=Reflect.construct(e,arguments,i)}else t=e.apply(this,arguments);return f(this,t)});function o(t){var r;return e(this,o),(r=i.call(this,t)).hasError||(r.name=t.name,r.description=t.description,r.objTypeAsString=t.objTypeAsString,r.width=t.width,r.height=t.height,r.htmlParams=t.htmlParams,r.swfUrl=t.swfUrl,r.confFilePath=t.confFilePath,r.confFile=t.confFile,r.confFileFeatures=t.confFileFeatures,r.config=t.config,r.confVars=t.confVars,r.useCdn=t.useCdn,r.tags=t.tags,r.swfUrlVersion=t.swfUrlVersion,r.created=new Date(0),r.created.setUTCSeconds(t.createdAt),r.updated=new Date(0),r.updated.setUTCSeconds(t.updatedAt),r.html5Url=t.description,r.version=t.description,r.partnerTags=t.description,r.objType=t.description,r.creationMode=t.description),r}return s(o)}(I);h(U,"Type",{PLAYER:1,CONTRIBUTION_WIZARD:2,SIMPLE_EDITOR:3,ADVANCED_EDITOR:4,PLAYLIST:5,APP_STUDIO:6,KRECORD:7,PLAYER_V3:8,KMC_ACCOUNT:9,KMC_ANALYTICS:10,KMC_CONTENT:11,KMC_DASHBOARD:12,KMC_LOGIN:13,PLAYER_SL:14,CLIENTSIDE_ENCODER:15,KMC_GENERAL:16,KMC_ROLES_AND_PERMISSIONS:17,CLIPPER:18,KSR:19,KUPLOAD:20,WEBCASTING:21}),h(U,"CreationMode",{WIZARD:2,ADVANCED:3});var j=s((function t(r){e(this,t),this.playlistLastEntryId=r.playlistLastEntryId,this.entryId=r.entryId,this.id=r.id,this.userId=r.userId,this.partnerId=r.partnerId,this.status=r.status,this.createdAt=r.createdAt,this.updatedAt=r.updatedAt}));var B=function(t){l(o,t);var r,n,i=(r=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=d(r);if(n){var i=d(this).constructor;t=Reflect.construct(e,arguments,i)}else t=e.apply(this,arguments);return f(this,t)});function o(t){var r;return e(this,o),(r=i.call(this,t)).hasError||(r.totalCount=t.totalCount,r.entries=[],r.totalCount>0&&t.objects.map((function(t){return r.entries.push(new j(t))}))),r}return s(o)}(I),V=function(){function t(){e(this,t)}return s(t,null,[{key:"build",value:function(t){var e=_.get(),r=e.serviceUrl.substr(0,e.serviceUrl.lastIndexOf("/")),n=t.partnerId,i=t.entryId,o=t.ks,a=t.uiConfId,s=t.format,u=t.protocol,c=t.extension,l=t.flavorIds;if(!r||isNaN(Number.parseInt(n))||!i||!s||!u)return"";var f=r;return r.endsWith("/")||(f+="/"),f+="p/"+n+"/sp/"+n+"00/playManifest/entryId/"+i+"/protocol/"+u+"/format/"+s,l?f+="/flavorIds/"+l:a&&(f+="/uiConfId/"+a),""!==o&&(f+="/ks/"+o),""!==c&&(f+="/a."+c),a&&""!==l&&(f+="?uiConfId="+a),f}}]),t}(),F=function(){function t(){e(this,t)}return s(t,null,[{key:"xmlToJson",value:function(t){var e={};if(1===t.nodeType){if(t.attributes.length>0){e["@attributes"]={};for(var r=0;r<t.attributes.length;r++){var n=t.attributes.item(r);e["@attributes"][n.nodeName]=n.nodeValue}}}else 3===t.nodeType&&(e=t.nodeValue);if(t.hasChildNodes())for(var i=0;i<t.childNodes.length;i++){var o=t.childNodes.item(i),a=o.nodeName;if(void 0===e[a])e[a]=this.xmlToJson(o);else{if(void 0===e[a].push){var s=e[a];e[a]=[],e[a].push(s)}e[a].push(this.xmlToJson(o))}}return e}}]),t}(),q={DASH:{name:"dash",mimeType:"application/dash+xml",pathExt:"mpd"},HLS:{name:"hls",mimeType:"application/x-mpegURL",pathExt:"m3u8"},WVM:{name:"wvm",mimeType:"video/wvm",pathExt:"wvm"},MP4:{name:"mp4",mimeType:"video/mp4",pathExt:"mp4"},MP3:{name:"mp3",mimeType:"audio/mpeg",pathExt:"mp3"}},H=new Map([["mpegdash",q.DASH],["applehttp",q.HLS],["url",q.MP4]]);function K(t){var e=H.get(t);return!!e&&e.name===q.MP4.name}var G=function(){function t(){e(this,t),this.progressive=[],this.dash=[],this.hls=[],this.image=[],this.document=[]}return s(t,[{key:"map",value:function(t,e){if(e)switch(e.name){case q.MP4.name:this.progressive.push(t);break;case q.DASH.name:this.dash.push(t);break;case q.HLS.name:this.hls.push(t)}}},{key:"toJSON",value:function(){var t={progressive:[],dash:[],hls:[],image:[],document:[]};return this.progressive.forEach((function(e){return t.progressive.push(e.toJSON())})),this.hls.forEach((function(e){return t.hls.push(e.toJSON())})),this.dash.forEach((function(e){return t.dash.push(e.toJSON())})),t.image=this.image,t.document=this.document,t}}]),t}(),W=function(){function t(){e(this,t),this.metadata=new Map,this.sources=new G,this.type=t.Type.UNKNOWN}return s(t,[{key:"toJSON",value:function(){return{id:this.id,name:this.name,sources:this.sources.toJSON(),duration:this.duration,dvrStatus:this.dvrStatus,status:this.status,metadata:this.metadata,type:this.type,poster:this.poster,assetReferenceType:this.assetReferenceType,downloadUrl:this.downloadUrl}}}]),t}();h(W,"Type",{VOD:"Vod",LIVE:"Live",IMAGE:"Image",AUDIO:"Audio",UNKNOWN:"Unknown",DOCUMENT:"Document"}),h(W,"DvrStatus",{ON:1,OFF:0});var Y=function(){function t(r,n,i){e(this,t),this.licenseUrl=r,this.scheme=n,i&&(this.certificate=i)}return s(t,[{key:"toJSON",value:function(){var t={licenseUrl:this.licenseUrl,scheme:this.scheme};return this.certificate&&(t.certificate=this.certificate),t}}]),t}(),J=function(){function t(){e(this,t)}return s(t,[{key:"toJSON",value:function(){var t={id:this.id,url:this.url,mimetype:this.mimetype};return this.bandwidth&&(t.bandwidth=this.bandwidth),this.width&&(t.width=this.width),this.height&&(t.height=this.height),this.label&&(t.label=this.label),this.drmData&&this.drmData.length>0&&(t.drmData=[],this.drmData.forEach((function(e){Array.isArray(t.drmData)&&t.drmData.push(e.toJSON())}))),t}}]),t}(),X=s((function t(){e(this,t),this.items=[]})),Q=s((function t(){e(this,t),this.items=[]})),Z=s((function t(r){e(this,t),this.url=r.url,this.clickThroughUrl=r.clickThroughUrl})),z={SRT:"1",DFXP:"2",WEBVTT:"3",CAP:"4"},$={3:"vtt",1:"srt"},tt=function(){function t(){e(this,t)}return s(t,null,[{key:"createConfig",value:function(t,e){return t.map((function(t){var r=t.url,n=$[t.format];return[z.DFXP,z.CAP].includes(t.format)&&(r=t.webVttUrl,n=$[z.WEBVTT]),r=it(r,e),{default:!!t.isDefault,type:n,language:t.languageCode,label:t.label,url:r}}))}}]),t}(),et=function(){function t(r){e(this,t),this.id=r.id,this.url=t.extractBaseThumbnailUrl(r.dataUrl),this.mimetype=""}return s(t,null,[{key:"extractBaseThumbnailUrl",value:function(t){return t.match(".+entry_id/[a-zA-Z0-9_]+/")[0].slice(0,-1)}}]),t}(),rt=s((function t(r){e(this,t),this.id=r.id,this.url=r.downloadUrl,this.thumbnailUrl=r.poster,this.mimetype=""})),nt=function(){function t(){e(this,t)}return s(t,null,[{key:"getMediaEntry",value:function(e,r,n,i){var o=new W,a=i.entry,s=i.playBackContextResult,u=i.metadataListResult,c=s.sources;return o.sources=t._getParsedSources(c,e,r,n,a,s),t._fillBaseData(o,a,u),o.type!==W.Type.LIVE&&_.get().useApiCaptions&&s.data.playbackCaptions&&(o.sources.captions=tt.createConfig(s.data.playbackCaptions,e)),o}},{key:"addKsToUrl",value:function(t,e){var r;return e?(r=-1!==t.split("?")[0].replace(/^.*[\\/]/,"").indexOf(".")?-1===t.indexOf("?")?"?ks=":"&ks=":"/ks/",t+r+e):t}},{key:"getPlaylist",value:function(e){var r=new X,n=e.playlistData,i=e.playlistItems.entries,o=e.playlistUserEntries.entries;return r.id=n.id,r.name=n.name,r.description=n.description,r.poster=n.poster,r.playlistLastEntryId=o.map((function(t){return t.playlistLastEntryId}))[0],i.forEach((function(e){var n=new W;t._fillBaseData(n,e),r.items.push(n)})),r}},{key:"getEntryList",value:function(e){var r=new Q;return e.playlistItems.entries.forEach((function(e){var n=new W;t._fillBaseData(n,e),r.items.push(n)})),r}},{key:"getBumper",value:function(e,r,n){var i=e.playBackContextResult,o=i.bumperData[0];if(o){var a=(o&&o.sources).find((function(t){return K(t.format)}));if(a){var s=t._parseProgressiveSources(a,i,r,n,0,o.entryId);if(s[0])return new Z({url:s[0].url,clickThroughUrl:o.clickThroughUrl})}}}},{key:"_fillBaseData",value:function(e,r,n){return e.poster=r.poster,e.id=r.id,e.duration=r.duration,e.downloadUrl=r.downloadUrl||"",e.metadata=t._parseMetadata(n),e.metadata.description=r.description||"",e.metadata.entryId=r.id||"",e.metadata.name=r.name||"",r.createdAt&&(e.metadata.createdAt=r.createdAt),r.updatedAt&&(e.metadata.updatedAt=r.updatedAt),r.creatorId&&(e.metadata.creatorId=r.creatorId),r.endDate&&(e.metadata.endDate=r.endDate),r.views&&(e.metadata.views=r.views),r.plays&&(e.metadata.plays=r.plays),e.metadata.tags=r.tags||"",e.status=r.status,e.type=t._getEntryType(r.entryType,r.type),e.type===W.Type.LIVE&&(e.dvrStatus=r.dvrStatus),e}},{key:"_getEntryType",value:function(t,e){var r=W.Type.UNKNOWN;switch(t){case T.MediaType.IMAGE.value:r=W.Type.IMAGE;break;case T.MediaType.AUDIO.value:r=W.Type.AUDIO;break;default:switch(e){case T.EntryType.MEDIA_CLIP.value:r=W.Type.VOD;break;case T.EntryType.LIVE_STREAM.value:case T.EntryType.LIVE_CHANNEL.value:r=W.Type.LIVE;break;case T.EntryType.DOCUMENT.value:r=W.Type.DOCUMENT;break;default:r=W.Type.UNKNOWN}}return r}},{key:"_getParsedSources",value:function(e,r,n,i,o,a){var s,u,c=new G;return o.type===T.EntryType.EXTERNAL_MEDIA.value?((u=new J).mimetype="video/youtube",u.url=o.referenceId,u.id=o.id+"_youtube",c.progressive.push(u)):o.entryType===T.MediaType.IMAGE.value?c.image.push(new et(o)):o.type===T.EntryType.DOCUMENT.value?c.document.push(new rt(o)):e&&e.length>0&&(e.filter((function(t){return!K(t.format)})).forEach((function(e){var s=t._parseAdaptiveSource(e,a,r,n,i,o.id);if(s){var u=H.get(e.format);c.map(s,u)}})),s=e.find((function(e){return K(e.format)&&""!==e.getProtocol(t._getBaseProtocol())})),c.progressive=t._parseProgressiveSources(s,a,r,n,i,o.id)),c}},{key:"_parseAdaptiveSource",value:function(e,r,n,i,o,a){var s=new J;if(e){var u="",c=H.get(e.format),l=e.getProtocol(t._getBaseProtocol()),f=e.deliveryProfileId,d=e.format,h="";if(c&&(h=c.pathExt,s.mimetype=c.mimeType),e.hasFlavorIds()?(!h&&r.flavorAssets&&r.flavorAssets.length>0&&(h=r.flavorAssets[0].fileExt),u=V.build({entryId:a,flavorIds:e.flavorIds,format:d,ks:n,partnerId:i,uiConfId:o,extension:h,protocol:l})):u=t.addKsToUrl(e.url,n),!u){var p="failed to create play url from source, discarding source: (".concat(a,"_").concat(f,"), ").concat(d);return t._logger.warn(p),null}if(s.url=u,s.id=a+"_"+f+","+d,e.hasDrmData()){var y=[];e.drm.forEach((function(t){y.push(new Y(t.licenseURL,O.Scheme[t.scheme],t.certificate))})),s.drmData=y}}return s}},{key:"_parseProgressiveSources",value:function(e,r,n,i,o,a){var s=[],u=[];if(e){var c=e.getProtocol(t._getBaseProtocol()),l=e.format,f=e.deliveryProfileId,d=f+","+l;r.flavorAssets.map((function(e){var r=new J;r.id=e.id+d,r.mimetype="mp3"===e.fileExt?"audio/mp3":"video/mp4",r.height=e.height,r.width=e.width,r.bandwidth=1024*e.bitrate,r.label=e.label||e.language;var h=V.build({entryId:a,flavorIds:e.id,format:l,ks:n,partnerId:i,uiConfId:o,extension:e.fileExt,protocol:c});if(""===h)return t._logger.warn("failed to create play url from source, discarding source: (".concat(a,"_").concat(f,"), ").concat(l,".")),null;r.url=h,e.height&&e.width?s.push(r):u.push(r)}))}return u.length&&!s.length?u:s}},{key:"_parseMetadata",value:function(t){var e={};return t&&t.metas&&t.metas.length>0&&t.metas.forEach((function(t){if(t.xml){var r=new DOMParser;t.xml=t.xml.replace(/\r?\n|\r/g,""),t.xml=t.xml.replace(/>\s*/g,">"),t.xml=t.xml.replace(/>\s*/g,">");var n=r.parseFromString(t.xml,"text/xml"),i=F.xmlToJson(n);Object.keys(i.metadata).forEach((function(t){e[t]=i.metadata[t]["#text"]}))}})),e}},{key:"_getBaseProtocol",value:function(){var t=_.get(),e=/^https?:/.exec(t.cdnUrl),r=e?e[0]:document.location.protocol;return"string"==typeof r?r.slice(0,-1):"https"}},{key:"hasBlockAction",value:function(t){return t.playBackContextResult.hasBlockAction()}},{key:"getBlockAction",value:function(t){return t.playBackContextResult.getBlockAction()}},{key:"getErrorMessages",value:function(t){return t.playBackContextResult.getErrorMessages()}}]),t}();h(nt,"_logger",m("OVPProviderParser"));var it=nt.addKsToUrl,ot=nt,at=s((function t(r,n,i){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};e(this,t),this.severity=r,this.category=n,this.code=i,this.data=o,t._logger.error("Category:".concat(n," | Code:").concat(i," |"),o)}));h(at,"Severity",{RECOVERABLE:1,CRITICAL:2}),h(at,"Category",{NETWORK:1,SERVICE:2,PROVIDER:3}),h(at,"Code",{UNSUPPORTED_SCHEME:1e3,BAD_HTTP_STATUS:1001,HTTP_ERROR:1002,TIMEOUT:1003,MALFORMED_DATA_URI:1004,BAD_SERVER_RESPONSE:1005,MULTIREQUEST_API_ERROR:1006,API_RESPONSE_MISMATCH:1007,ERROR:2e3,BLOCK_ACTION:2001,MEDIA_STATUS_NOT_READY:2002,MISSING_MANDATORY_PARAMS:3e3,MISSING_PLAY_SOURCE:3001,METHOD_NOT_IMPLEMENTED:3002}),h(at,"_logger",m("Error"));var st=function(){function t(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Map;e(this,t),h(this,"retryConfig",{async:!0,timeout:0,maxAttempts:4}),h(this,"_attemptCounter",1),this.headers=r}return s(t,[{key:"getUrl",value:function(t){return t+"/service/"+this.service+(this.action?"/action/"+this.action:"")}},{key:"doHttpRequest",value:function(){var t=this,e=new Promise((function(e,r){t._requestPromise={resolve:e,reject:r}}));return this.url||this._requestPromise.reject(new at(at.Severity.CRITICAL,at.Category.NETWORK,at.Code.MALFORMED_DATA_URI,{url:this.url})),this._createXHR(),e}},{key:"_createXHR",value:function(){var t=this,e=new XMLHttpRequest;e.onreadystatechange=function(){if(4===e.readyState&&200===e.status)try{var r=JSON.parse(e.responseText);return t.responseHeaders=t._getResponseHeaders(e),t._requestPromise.resolve(r)}catch(r){t._requestPromise.reject(t._createError(e,at.Code.BAD_SERVER_RESPONSE,{text:e.responseText}))}},e.open(this.method,this.url,this.retryConfig.async),this.retryConfig.async&&this.retryConfig.timeout&&(e.timeout=this.retryConfig.timeout);var r=performance.now();e.ontimeout=function(){t._handleError(e,at.Code.TIMEOUT,{timeout:(performance.now()-r)/1e3,statusText:e.statusText})},e.onerror=e.onabort=function(){t._handleError(e,at.Code.HTTP_ERROR,{text:e.responseText,statusText:e.statusText})},this.headers.forEach((function(t,r){e.setRequestHeader(r,t)})),e.send(this.params)}},{key:"_getResponseHeaders",value:function(t){return t.getAllResponseHeaders().split("\n").filter((function(t){return 0===t.toLowerCase().indexOf("x-")}))}},{key:"_handleError",value:function(t,e,r){var n=this._createError(t,e,r);if(t.onreadystatechange=function(){},t.onerror=function(){},t.ontimeout=function(){},t.onabort=function(){},!(this.retryConfig.maxAttempts&&this._attemptCounter<this.retryConfig.maxAttempts))return this._requestPromise.reject(n);this._attemptCounter++,this._createXHR()}},{key:"_createError",value:function(t,e,r){return Object.assign(r,{url:this.url,headers:this._getResponseHeaders(t),attempt:this._attemptCounter}),new at(at.Severity.CRITICAL,at.Category.NETWORK,e,r)}}]),t}();var ut=function(t){l(o,t);var r,n,i=(r=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=d(r);if(n){var i=d(this).constructor;t=Reflect.construct(e,arguments,i)}else t=e.apply(this,arguments);return f(this,t)});function o(){var t;e(this,o);for(var r=arguments.length,n=new Array(r),a=0;a<r;a++)n[a]=arguments[a];return h(u(t=i.call.apply(i,[this].concat(n))),"requests",[]),t}return s(o,[{key:"add",value:function(t){this.requests.push(t);var e={},r={service:t.service,action:t.action};return Object.assign(e,h({},this.requests.length,Object.assign(r,t.params))),Object.assign(e,this.params),this.params=e,this}},{key:"execute",value:function(t){var e=this;return new Promise((function(r,n){try{e.params=JSON.stringify(e.params)}catch(t){o._logger.error("".concat(t.message)),n(new at(at.Severity.CRITICAL,at.Category.PROVIDER,at.Code.FAILED_PARSING_REQUEST,{error:t,params:e.params}))}e.doHttpRequest().then((function(i){var o=new ct(i,t);o.success?r({headers:e.responseHeaders,response:o}):n(new at(at.Severity.CRITICAL,at.Category.NETWORK,at.Code.MULTIREQUEST_API_ERROR,{url:e.url,headers:e.responseHeaders,results:o.results}))}),(function(t){n(t)}))}))}}]),o}(st);h(ut,"_logger",m("MultiRequestBuilder"));var ct=s((function t(r){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];e(this,t),h(this,"results",[]);var i=r.result?r.result:r,o=(Array.isArray(i)?i:[i]).map((function(t){return new I(t)})),a=o.filter((function(t){return t.hasError}));a.forEach((function(e){t._logger.error("Service returned an error with error code: ".concat(e.error.code," and message: ").concat(e.error.message,"."))})),this.results=o,n&&a.length||a.length===this.results.length?this.success=!1:(this.results=this.results.filter((function(t){return!t.hasError})),this.success=!0)}));h(ct,"_logger",m("MultiRequestResult"));var lt=function(){function t(){e(this,t)}return s(t,null,[{key:"getMultiRequest",value:function(t,e,r){var n=_.get(),i=n.serviceParams;Object.assign(i,{ks:e,clientTag:"html5:v"+t}),r&&Object.assign(i,{partnerId:r});var o=new Map;o.set("Content-Type","application/json");var a=new ut(o);return a.method="POST",a.service="multirequest",a.url=a.getUrl(n.serviceUrl),a.params=i,a}}]),t}(),ft=s((function t(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e(this,t),this.type=r.type||t.Type.INCLUDE_FIELDS,this.fields=r.fields||"id,referenceId,name,description,thumbnailUrl,dataUrl,duration,msDuration,flavorParamsIds,mediaType,type,tags,dvrStatus,externalSourceType,status,createdAt,updatedAt,endDate,plays,views,downloadUrl,creatorId"}));h(ft,"Type",{INCLUDE_FIELDS:1,EXCLUDE_FIELDS:2});var dt="baseEntry",ht=function(t){l(o,t);var r,n,i=(r=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=d(r);if(n){var i=d(this).constructor;t=Reflect.construct(e,arguments,i)}else t=e.apply(this,arguments);return f(this,t)});function o(){return e(this,o),i.apply(this,arguments)}return s(o,null,[{key:"getPlaybackContext",value:function(t,e,r){var n=new Map;n.set("Content-Type","application/json");var i=new st(n);return i.service=dt,i.action="getPlaybackContext",i.method="POST",i.url=i.getUrl(t),i.tag="baseEntry-getPlaybackContext",i.params={entryId:r,ks:e,contextDataParams:{objectType:"KalturaContextDataParams",flavorTags:"all"}},i}},{key:"list",value:function(t,e,r,n,i){var a=new Map;a.set("Content-Type","application/json");var s=new st(a);return s.service=dt,s.action="list",s.method="POST",s.url=s.getUrl(t),s.tag="list",s.params=o.getEntryListReqParams(r,e,n,i),s}},{key:"getEntryListReqParams",value:function(t,e,r,n){var i={};return t?i=r?{redirectFromEntryId:t}:{idEqual:t}:n&&(i={objectType:"KalturaBaseEntryFilter",referenceIdEqual:n}),{ks:e,filter:i,responseProfile:new ft}}}]),o}(lt);var pt=function(t){l(o,t);var r,n,i=(r=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=d(r);if(n){var i=d(this).constructor;t=Reflect.construct(e,arguments,i)}else t=e.apply(this,arguments);return f(this,t)});function o(){return e(this,o),i.apply(this,arguments)}return s(o,null,[{key:"list",value:function(t,e,r){var n=new Map;n.set("Content-Type","application/json");var i=new st(n);i.service="metadata_metadata",i.action="list",i.method="POST",i.url=i.getUrl(t),i.tag="metadata_metadata-list";var o={objectType:"KalturaMetadataFilter",objectIdEqual:r,metadataObjectTypeEqual:"1"};return i.params={filter:o,ks:e},i}}]),o}(lt),yt=function(){function t(r){e(this,t),h(this,"_response",{}),this.requests=this.buildRequests(r),this._entryId=r.entryId,this._referenceId=r.referenceId}return s(t,[{key:"requests",get:function(){return this._requests},set:function(t){this._requests=t}},{key:"response",get:function(){return this._response},set:function(t){var e=new A(t[0].data);this._response.entry=e.entries[0],this._response.playBackContextResult=new M(t[1].data),this._response.metadataListResult=new D(t[2].data)}},{key:"buildRequests",value:function(t){var e=_.get(),r=[];r.push(ht.list(e.serviceUrl,t.ks,t.entryId,t.redirectFromEntryId,t.referenceId));var n="{1:result:ks}"===t.ks?"{2:result:objects:0:id}":"{1:result:objects:0:id}";return r.push(ht.getPlaybackContext(e.serviceUrl,t.ks,n)),r.push(pt.list(e.serviceUrl,t.ks,n)),r}},{key:"isValid",value:function(){return!(!this._entryId&&!this._referenceId)}}],[{key:"id",get:function(){return"media"}}]),t}();var vt=function(t){l(o,t);var r,n,i=(r=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=d(r);if(n){var i=d(this).constructor;t=Reflect.construct(e,arguments,i)}else t=e.apply(this,arguments);return f(this,t)});function o(){return e(this,o),i.apply(this,arguments)}return s(o,null,[{key:"anonymousSession",value:function(t,e){var r=new Map;r.set("Content-Type","application/json");var n=new st(r);return n.service="session",n.action="startWidgetSession",n.method="POST",n.url=n.getUrl(t),n.tag="session-startWidget",n.params={widgetId:e},n}}]),o}(lt),mt=function(){function t(r){e(this,t),h(this,"_response",{}),this.requests=this.buildRequests(r),this._widgetId=r.widgetId}return s(t,[{key:"requests",get:function(){return this._requests},set:function(t){this._requests=t}},{key:"response",get:function(){return this._response.ks},set:function(t){this._response.ks=t[0].data.ks}},{key:"buildRequests",value:function(t){var e=_.get(),r=[];return r.push(vt.anonymousSession(e.serviceUrl,t.widgetId)),r}},{key:"isValid",value:function(){return!!this._widgetId}}],[{key:"id",get:function(){return"session"}}]),t}();var gt=function(t){l(o,t);var r,n,i=(r=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=d(r);if(n){var i=d(this).constructor;t=Reflect.construct(e,arguments,i)}else t=e.apply(this,arguments);return f(this,t)});function o(t,r){var n,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",s=arguments.length>3?arguments[3]:void 0;return e(this,o),(n=i.call(this,s))._multiRequest=lt.getMultiRequest(t,a,r),n}return s(o)}(function(){function t(r){e(this,t),h(this,"_loadersResponseMap",new Map),h(this,"_loaders",new Map),this._networkRetryConfig=r}return s(t,[{key:"add",value:function(t,e,r){var n=this,i=new t(e);if(i.isValid()){this._loaders.set(t.id,i);var o=this._multiRequest.requests.length,a=i.requests;this._multiRequest.retryConfig=this._networkRetryConfig,a.forEach((function(t){t.params=t.params||{},t.params.ks=t.params.ks||r,n._multiRequest.add(t)}));var s=Array.from(new Array(a.length),(function(t,e){return e+o}));this._loadersResponseMap.set(t.id,s)}}},{key:"fetchData",value:function(t){var e=this;return new Promise((function(r,n){e._multiRequest.execute(t).then((function(t){e._multiResponse=t.response,e.prepareData(t.response).success?r(e._loaders):n(new at(at.Severity.CRITICAL,at.Category.NETWORK,at.Code.API_RESPONSE_MISMATCH,{headers:t.headers}))}),(function(t){n(t)}))}))}},{key:"prepareData",value:function(t){var e=this;return this._loaders.forEach((function(r,n){var i=e._loadersResponseMap.get(n);try{i&&i.length>0&&(r.response=t.results.slice(i[0],i[i.length-1]+1))}catch(t){return{success:!1,error:t}}})),{success:!0,data:this._loaders}}}]),t}());var Et="playlist",_t=function(t){l(o,t);var r,n,i=(r=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=d(r);if(n){var i=d(this).constructor;t=Reflect.construct(e,arguments,i)}else t=e.apply(this,arguments);return f(this,t)});function o(){return e(this,o),i.apply(this,arguments)}return s(o,null,[{key:"execute",value:function(t,e,r){var n=new Map;n.set("Content-Type","application/json");var i=new st(n);return i.service=Et,i.action="execute",i.method="POST",i.url=i.getUrl(t),i.tag="".concat(Et,"-execute"),i.params={ks:e,id:r,responseProfile:new ft},i}},{key:"get",value:function(t,e,r){var n=new Map;n.set("Content-Type","application/json");var i=new st(n);return i.service=Et,i.action="get",i.method="POST",i.url=i.getUrl(t),i.tag="".concat(Et,"-get"),i.params={ks:e,id:r,responseProfile:{fields:"id,name,description,thumbnailUrl",type:1}},i}},{key:"getLastEntryId",value:function(t,e,r){var n=new Map;n.set("Content-Type","application/json");var i=new st(n);return i.service="userEntry",i.action="list",i.method="POST",i.url=i.getUrl(t),i.tag="userEntry-list",i.params={ks:e,filter:{objectType:"KalturaViewHistoryUserEntry",entryIdEqual:r,userIdEqualCurrent:1},responseProfile:{fields:"playlistLastEntryId",type:1}},i}}]),o}(lt),It=function(){function t(r){e(this,t),h(this,"_response",{}),this.requests=this.buildRequests(r),this._playlistId=r.playlistId}return s(t,[{key:"requests",get:function(){return this._requests},set:function(t){this._requests=t}},{key:"response",get:function(){return this._response},set:function(t){this._response.playlistData=new N(t[0].data),this._response.playlistItems=new S(t[1].data),this._response.playlistUserEntries=new B(t[2].data)}},{key:"buildRequests",value:function(t){var e=_.get(),r=[];return r.push(_t.get(e.serviceUrl,t.ks,t.playlistId)),r.push(_t.execute(e.serviceUrl,t.ks,t.playlistId)),r.push(_t.getLastEntryId(e.serviceUrl,t.ks,t.playlistId)),r}},{key:"isValid",value:function(){return!!this._playlistId}}],[{key:"id",get:function(){return"playlist"}}]),t}(),Rt=function(){function t(r,n){e(this,t),h(this,"_networkRetryConfig",{async:!0,timeout:0,maxAttempts:4}),function(t){t&&"function"==typeof t.getLogger&&(p.get=t.getLogger),t&&t.LogLevel&&(y=t.LogLevel)}(r.logger),this._partnerId=r.partnerId,this._widgetId=r.widgetId,this._uiConfId=r.uiConfId,this._isAnonymous=!r.ks,this._ks=r.ks||"",this._playerVersion=n}return s(t,[{key:"partnerId",get:function(){return this._partnerId}},{key:"widgetId",get:function(){return this._widgetId||this.defaultWidgetId}},{key:"defaultWidgetId",get:function(){return"_"+this._partnerId}},{key:"uiConfId",get:function(){return this._uiConfId}},{key:"ks",get:function(){return this._ks},set:function(t){this._ks=t}},{key:"playerVersion",get:function(){return this._playerVersion}},{key:"isAnonymous",get:function(){return this._isAnonymous}},{key:"getMediaConfig",value:function(t){return Promise.reject(new at(at.Severity.CRITICAL,at.Category.PROVIDER,at.Code.METHOD_NOT_IMPLEMENTED,{message:"getMediaConfig method must be implement by the derived class"}))}},{key:"getPlaylistConfig",value:function(t){return Promise.reject(new at(at.Severity.CRITICAL,at.Category.PROVIDER,at.Code.METHOD_NOT_IMPLEMENTED,{message:"The provider does not support loading playlist by id"}))}},{key:"getEntryListConfig",value:function(t){return Promise.reject(new at(at.Severity.CRITICAL,at.Category.PROVIDER,at.Code.METHOD_NOT_IMPLEMENTED,{message:"The provider does not support loading entry list"}))}},{key:"_verifyHasSources",value:function(t){if(0===t.hls.concat(t.dash,t.progressive,t.image,t.document).length)throw new at(at.Severity.CRITICAL,at.Category.SERVICE,at.Code.MISSING_PLAY_SOURCE,{action:"",messages:"No play source for entry id: ".concat(t.id)})}},{key:"LogLevel",get:function(){return y}},{key:"getLogLevel",value:function(t){return function(t){return v(t).getLevel()}(t)}},{key:"setLogLevel",value:function(t,e){!function(t,e){v(e).setLevel(t)}(t,e)}}]),t}(),Tt=function(){function t(r){e(this,t),h(this,"_response",{playlistItems:{entries:[]}}),this.requests=this.buildRequests(r),this._entries=r.entries}return s(t,[{key:"requests",get:function(){return this._requests},set:function(t){this._requests=t}},{key:"response",get:function(){return this._response},set:function(t){var e,r=this;t.forEach((function(t){e=new A(t.data),r._response.playlistItems.entries.push(e.entries[0])}))}},{key:"buildRequests",value:function(t){var e=_.get(),r=[];return t.entries.forEach((function(n){r.push(ht.list(e.serviceUrl,t.ks,n.entryId||n,t.redirectFromEntryId,n.referenceId))})),r}},{key:"isValid",value:function(){return!(!this._entries||!this._entries.length)}}],[{key:"id",get:function(){return"entry_list"}}]),t}();function At(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function wt(t){return function(t){if(Array.isArray(t))return At(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return At(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?At(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ct(t,e,r,n,i,o,a){try{var s=t[o](a),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(n,i)}function Ot(t){return function(){var e=this,r=arguments;return new Promise((function(n,i){var o=t.apply(e,r);function a(t){Ct(o,n,i,a,s,"next",t)}function s(t){Ct(o,n,i,a,s,"throw",t)}a(void 0)}))}}var kt=r(687),bt=r.n(kt),Pt=function(){function t(){e(this,t)}var r,n;return s(t,null,[{key:"_applyRegexAction",value:function(t,e){if(t){var r=new RegExp(t.pattern,"i");if(e.match(r))return e.replace(r,t.replacement+"/")}return e}},{key:"_isECDNUrlAlive",value:(n=Ot(bt().mark((function e(r,n){var i,o;return bt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=n+"/api_v3/service/system/action/ping/format/1",(o=new XMLHttpRequest).open("GET",i),o.timeout=r.checkAliveTimeoutMs,o.onreadystatechange=function(){return 4===o.readyState&&200===o.status},o.ontimeout=function(){return t._logger.warn("Got timeout while pinging the ECDN url. the ping url: ".concat(i)),!1},o.send(),e.abrupt("return",!1);case 8:case"end":return e.stop()}}),e)}))),function(t,e){return n.apply(this,arguments)})},{key:"handleRegexAction",value:(r=Ot(bt().mark((function e(r,n){var i,o,a;return bt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=_.get().cdnUrl,o=t._extractRegexActionFromData(n),a=t._getRegExp(o),e.t0=i&&o&&a&&i.match(a),!e.t0){e.next=11;break}if(e.t1=o.checkAliveTimeoutMs>0,!e.t1){e.next=10;break}return e.next=9,t._isECDNUrlAlive(o,i.replace(a,o.replacement));case 9:e.t1=!e.sent;case 10:e.t0=!e.t1;case 11:if(!e.t0){e.next=14;break}return t._replaceHostUrls(r,o),e.abrupt("return",r);case 14:return t._logger.debug("exiting handleRegexAction - not applying regex action."),e.abrupt("return",r);case 16:case"end":return e.stop()}}),e)}))),function(t,e){return r.apply(this,arguments)})},{key:"_replaceHostUrls",value:function(e,r){t._logger.debug("Starting to modify urls...");var n=e.sources,i=n.hls,o=n.dash,a=n.progressive,s=n.image;[].concat(wt(i),wt(o),wt(a),wt(s)).forEach((function(e){return e.url=t._applyRegexAction(r,e.url)})),_.get().replaceHostOnlyManifestUrls||(t._logger.debug("replaceHostOnlyManifestUrls flag is off - modifying captions and poster URLs"),n.captions&&n.captions.forEach((function(e){return e.url=t._applyRegexAction(r,e.url)})),"string"==typeof n.poster&&(n.poster=t._applyRegexAction(r,n.poster))),t._logger.debug("Finished modifying urls")}},{key:"_extractRegexActionFromData",value:function(t){var e;return null===(e=t.get(yt.id))||void 0===e||null===(e=e.response)||void 0===e?void 0:e.playBackContextResult.getRequestHostRegexAction()}},{key:"_getRegExp",value:function(t){if(t&&t.pattern&&t.replacement)return new RegExp(t.pattern,"i")}}]),t}();h(Pt,"_logger",m("RegexActionHandler"));var St=Pt;var Lt=function(t){l(o,t);var r,n,i=(r=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=d(r);if(n){var i=d(this).constructor;t=Reflect.construct(e,arguments,i)}else t=e.apply(this,arguments);return f(this,t)});function o(t,r){var n;return e(this,o),h(u(n=i.call(this,t,r)),"_filterOptionsConfig",{redirectFromEntryId:!0}),n._logger=m("OVPProvider"),_.set(t.env),n._setFilterOptionsConfig(t.filterOptions),n._networkRetryConfig=Object.assign(n._networkRetryConfig,t.networkRetryParameters),n}return s(o,[{key:"env",get:function(){return _.get()}},{key:"getMediaConfig",value:function(t){var e=this;return t.ks&&(this.ks=t.ks,this._isAnonymous=!1),this.widgetId!==this.defaultWidgetId&&(this._isAnonymous=!1),this._dataLoader=new gt(this.playerVersion,this.partnerId,this.ks,this._networkRetryConfig),new Promise((function(r,n){var i=t.entryId,o=t.referenceId;if(i||o){var a=e.ks;a||(a="{1:result:ks}",e._dataLoader.add(mt,{widgetId:e.widgetId}));var s=e._getEntryRedirectFilter(t);return e._dataLoader.add(yt,{entryId:i,ks:a,redirectFromEntryId:s,referenceId:o}),e._dataLoader.fetchData().then((function(t){try{var i=e._parseDataFromResponse(t);St.handleRegexAction(i,t).then(r)}catch(t){n(t)}}),(function(t){n(t)}))}n(new at(at.Severity.CRITICAL,at.Category.PROVIDER,at.Code.MISSING_MANDATORY_PARAMS,{message:"missing entry id"}))}))}},{key:"doRequest",value:function(t,e){var r=this,n=e||this.ks,i=new gt(this.playerVersion,this.partnerId,n,this._networkRetryConfig);return new Promise((function(e,o){return n||i.add(mt,{widgetId:r.widgetId}),t.forEach((function(t){i.add(t.loader,t.params,n||"{1:result:ks}")})),i.fetchData().then((function(t){try{e(t)}catch(t){o(t)}}),(function(t){o(t)}))}))}},{key:"_getEntryRedirectFilter",value:function(t){return"boolean"==typeof t.redirectFromEntryId?t.redirectFromEntryId:"boolean"!=typeof this._filterOptionsConfig.redirectFromEntryId||this._filterOptionsConfig.redirectFromEntryId}},{key:"_setFilterOptionsConfig",value:function(t){t&&"boolean"==typeof t.redirectFromEntryId&&(this._filterOptionsConfig.redirectFromEntryId=t.redirectFromEntryId)}},{key:"_parseDataFromResponse",value:function(t){this._logger.debug("Data parsing started");var e={session:{isAnonymous:this._isAnonymous,partnerId:this.partnerId},sources:this._getDefaultSourcesObject(),plugins:{}};if(this.uiConfId&&(e.session.uiConfId=this.uiConfId),t){if(t.has(mt.id)){var r=t.get(mt.id);r&&r.response&&(e.session.ks=r.response,this.widgetId!==this.defaultWidgetId&&(this.ks=e.session.ks))}else e.session.ks=this.ks;if(t.has(yt.id)){var n=t.get(yt.id);if(n&&n.response){var i=n.response;if(ot.hasBlockAction(i))throw new at(at.Severity.CRITICAL,at.Category.SERVICE,at.Code.BLOCK_ACTION,{action:ot.getBlockAction(i),messages:ot.getErrorMessages(i)});var o=ot.getMediaEntry(this.isAnonymous?"":this.ks,this.partnerId,this.uiConfId,i);Object.assign(e.sources,this._getSourcesObject(o)),this._verifyMediaStatus(o),this._verifyHasSources(e.sources);var a=ot.getBumper(i,this.isAnonymous?"":this.ks,this.partnerId);a&&Object.assign(e.plugins,{bumper:a})}}}return this._logger.debug("Data parsing finished",e),e}},{key:"_verifyMediaStatus",value:function(t){if([T.EntryStatus.IMPORT,T.EntryStatus.PRECONVERT].includes(t.status))throw new at(at.Severity.CRITICAL,at.Category.SERVICE,at.Code.MEDIA_STATUS_NOT_READY,{messages:"Status of entry id ".concat(t.id," is ").concat(t.status," and is still being imported or converted"),data:{status:status}})}},{key:"getPlaylistConfig",value:function(t){var e=this;return t.ks&&(this.ks=t.ks,this._isAnonymous=!1),this.widgetId!==this.defaultWidgetId&&(this._isAnonymous=!1),this._dataLoader=new gt(this.playerVersion,this.partnerId,this.ks,this._networkRetryConfig),new Promise((function(r,n){var i=t.playlistId;if(i){var o=e.ks;o||(o="{1:result:ks}",e._dataLoader.add(mt,{widgetId:e.widgetId})),e._dataLoader.add(It,{playlistId:i,ks:o}),e._dataLoader.fetchData().then((function(t){r(e._parsePlaylistDataFromResponse(t))}),(function(t){n(t)}))}else n({success:!1,data:"Missing mandatory parameter"})}))}},{key:"_parsePlaylistDataFromResponse",value:function(t){var e=this;this._logger.debug("Data parsing started");var r=this._getPlaylistObject();if(t&&t.has(It.id)){var n=t.get(It.id);if(n&&n.response){var i=ot.getPlaylist(n.response);r.id=i.id,r.poster=i.poster,r.metadata.name=i.name,r.metadata.description=i.description,r.playlistLastEntryId=i.playlistLastEntryId,i.items.forEach((function(t){return r.items.push({sources:e._getSourcesObject(t)})}))}}return this._logger.debug("Data parsing finished",r),r}},{key:"getEntryListConfig",value:function(t){var e=this;return t.ks&&(this.ks=t.ks,this._isAnonymous=!1),this.widgetId!==this.defaultWidgetId&&(this._isAnonymous=!1),this._dataLoader=new gt(this.playerVersion,this.partnerId,this.ks,this._networkRetryConfig),new Promise((function(r,n){var i=t.entries;if(i&&i.length){var o=e.ks;o||(o="{1:result:ks}",e._dataLoader.add(mt,{widgetId:e.widgetId}));var a=e._getEntryRedirectFilter(t);e._dataLoader.add(Tt,{entries:i,ks:o,redirectFromEntryId:a}),e._dataLoader.fetchData(!1).then((function(t){r(e._parseEntryListDataFromResponse(t))}),(function(t){n(t)}))}else n({success:!1,data:"Missing mandatory parameter"})}))}},{key:"_parseEntryListDataFromResponse",value:function(t){var e=this;this._logger.debug("Data parsing started");var r=this._getPlaylistObject();if(t&&t.has(Tt.id)){var n=t.get(Tt.id);n&&n.response&&ot.getEntryList(n.response).items.forEach((function(t){return r.items.push({sources:e._getSourcesObject(t)})}))}return this._logger.debug("Data parsing finished",r),r}},{key:"_getPlaylistObject",value:function(){return{id:"",metadata:{name:"",description:""},poster:"",playlistLastEntryId:"",items:[]}}},{key:"_getDefaultSourcesObject",value:function(){return{hls:[],dash:[],progressive:[],image:[],document:[],id:"",duration:0,type:W.Type.UNKNOWN,poster:"",dvr:!1,vr:null,metadata:{name:"",description:"",tags:""}}}},{key:"_getSourcesObject",value:function(t){var e=this._getDefaultSourcesObject(),r=t.sources.toJSON();return e.hls=r.hls,e.dash=r.dash,e.progressive=r.progressive,e.image=r.image,e.document=r.document,e.id=t.id,e.duration=t.duration,e.type=t.type,e.dvr=!!t.dvrStatus,e.poster=t.poster,e.downloadUrl=t.downloadUrl,t.sources.captions&&(e.captions=t.sources.captions),t.metadata&&"string"==typeof t.metadata.tags&&t.metadata.tags.split(", ").includes("360")&&(e.vr={}),Object.assign(e.metadata,t.metadata),e}}]),o}(Rt),Dt="@playkit-js/playkit-js-providers-ovp",xt="2.40.3-canary.0-f4a978f"}(),n}()}));
2
+ !function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var r=e();for(var n in r)("object"==typeof exports?exports:t)[n]=r[n]}}(self,(function(){return function(){var t={61:function(t,e,r){var n=r(698).default;function i(){"use strict";t.exports=i=function(){return r},t.exports.__esModule=!0,t.exports.default=t.exports;var e,r={},o=Object.prototype,a=o.hasOwnProperty,s=Object.defineProperty||function(t,e,r){t[e]=r.value},u="function"==typeof Symbol?Symbol:{},c=u.iterator||"@@iterator",l=u.asyncIterator||"@@asyncIterator",f=u.toStringTag||"@@toStringTag";function d(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{d({},"")}catch(e){d=function(t,e,r){return t[e]=r}}function h(t,e,r,n){var i=e&&e.prototype instanceof _?e:_,o=Object.create(i.prototype),a=new D(n||[]);return s(o,"_invoke",{value:b(t,r,a)}),o}function p(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}r.wrap=h;var y="suspendedStart",v="suspendedYield",m="executing",g="completed",E={};function _(){}function I(){}function R(){}var T={};d(T,c,(function(){return this}));var A=Object.getPrototypeOf,w=A&&A(A(x([])));w&&w!==o&&a.call(w,c)&&(T=w);var C=R.prototype=_.prototype=Object.create(T);function O(t){["next","throw","return"].forEach((function(e){d(t,e,(function(t){return this._invoke(e,t)}))}))}function k(t,e){function r(i,o,s,u){var c=p(t[i],t,o);if("throw"!==c.type){var l=c.arg,f=l.value;return f&&"object"==n(f)&&a.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,s,u)}),(function(t){r("throw",t,s,u)})):e.resolve(f).then((function(t){l.value=t,s(l)}),(function(t){return r("throw",t,s,u)}))}u(c.arg)}var i;s(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,i){r(t,n,e,i)}))}return i=i?i.then(o,o):o()}})}function b(t,r,n){var i=y;return function(o,a){if(i===m)throw new Error("Generator is already running");if(i===g){if("throw"===o)throw a;return{value:e,done:!0}}for(n.method=o,n.arg=a;;){var s=n.delegate;if(s){var u=P(s,n);if(u){if(u===E)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===y)throw i=g,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=m;var c=p(t,r,n);if("normal"===c.type){if(i=n.done?g:v,c.arg===E)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(i=g,n.method="throw",n.arg=c.arg)}}}function P(t,r){var n=r.method,i=t.iterator[n];if(i===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,P(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),E;var o=p(i,t.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,E;var a=o.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,E):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,E)}function S(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function L(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function D(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(S,this),this.reset(!0)}function x(t){if(t||""===t){var r=t[c];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,o=function r(){for(;++i<t.length;)if(a.call(t,i))return r.value=t[i],r.done=!1,r;return r.value=e,r.done=!0,r};return o.next=o}}throw new TypeError(n(t)+" is not iterable")}return I.prototype=R,s(C,"constructor",{value:R,configurable:!0}),s(R,"constructor",{value:I,configurable:!0}),I.displayName=d(R,f,"GeneratorFunction"),r.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===I||"GeneratorFunction"===(e.displayName||e.name))},r.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,R):(t.__proto__=R,d(t,f,"GeneratorFunction")),t.prototype=Object.create(C),t},r.awrap=function(t){return{__await:t}},O(k.prototype),d(k.prototype,l,(function(){return this})),r.AsyncIterator=k,r.async=function(t,e,n,i,o){void 0===o&&(o=Promise);var a=new k(h(t,e,n,i),o);return r.isGeneratorFunction(e)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},O(C),d(C,f,"Generator"),d(C,c,(function(){return this})),d(C,"toString",(function(){return"[object Generator]"})),r.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},r.values=x,D.prototype={constructor:D,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(L),!t)for(var r in this)"t"===r.charAt(0)&&a.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(n,i){return s.type="throw",s.arg=t,r.next=n,i&&(r.method="next",r.arg=e),!!i}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],s=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var u=a.call(o,"catchLoc"),c=a.call(o,"finallyLoc");if(u&&c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(u){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&a.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var i=n;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var o=i?i.completion:{};return o.type=t,o.arg=e,i?(this.method="next",this.next=i.finallyLoc,E):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),E},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),L(r),E}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;L(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:x(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),E}},r}t.exports=i,t.exports.__esModule=!0,t.exports.default=t.exports},698:function(t){function e(r){return t.exports=e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t.exports.__esModule=!0,t.exports.default=t.exports,e(r)}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports},687:function(t,e,r){var n=r(61)();t.exports=n;try{regeneratorRuntime=n}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=n:Function("r","regeneratorRuntime = r")(n)}}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var o=e[n]={exports:{}};return t[n](o,o.exports,r),o.exports}r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,{a:e}),e},r.d=function(t,e){for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return function(){"use strict";r.r(n),r.d(n,{NAME:function(){return Dt},Provider:function(){return Lt},ProviderParser:function(){return ot},RequestBuilder:function(){return st},ResponseTypes:function(){return t},VERSION:function(){return xt}});var t={};function e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i(t)}function o(t){var e=function(t,e){if("object"!==i(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==i(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"===i(e)?e:String(e)}function a(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,o(n.key),n)}}function s(t,e,r){return e&&a(t.prototype,e),r&&a(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function u(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function c(t,e){return c=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},c(t,e)}function l(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&c(t,e)}function f(t,e){if(e&&("object"===i(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return u(t)}function d(t){return d=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},d(t)}function h(t,e,r){return(e=o(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}r.r(t),r.d(t,{BaseServiceResult:function(){return I},KalturaAccessControlMessage:function(){return x},KalturaAccessControlModifyRequestHostRegexAction:function(){return C},KalturaBaseEntryListResponse:function(){return A},KalturaBumper:function(){return b},KalturaDrmPlaybackPluginData:function(){return O},KalturaFlavorAsset:function(){return P},KalturaMediaEntries:function(){return S},KalturaMediaEntry:function(){return T},KalturaMetadata:function(){return L},KalturaMetadataListResponse:function(){return D},KalturaPlaybackContext:function(){return M},KalturaPlaybackSource:function(){return k},KalturaPlaylist:function(){return N},KalturaRuleAction:function(){return w},KalturaUIConfResponse:function(){return U},KalturaUserEntry:function(){return j},KalturaUserEntryListResponse:function(){return B}});var p={get:function(){return{VERSION:"",DEBUG:{value:"",name:""},ERROR:{value:"",name:""},INFO:{value:"",name:""},OFF:{value:"",name:""},TIME:{value:"",name:""},TRACE:{value:"",name:""},WARN:{value:"",name:""},createDefaultHandler:function(){},debug:function(){},enabledFor:function(){},error:function(){},get:function(){},getLevel:function(){},info:function(){},log:function(){},setHandler:function(){},setLevel:function(){},time:function(){},timeEnd:function(){},trace:function(){},useDefaults:function(){},warn:function(){}}}},y={};function v(t){return p.get(t)}var m=v,g=function t(e){var r;return Array.isArray(e)?(r=e.length>0?e.slice(0):[]).forEach((function(e,n){("object"===i(e)||Array.isArray(e)&&e.length>0)&&(r[n]=t(e))})):"object"===i(e)?(r=Object.assign({},e),Object.keys(r).forEach((function(e){("object"===i(r[e])||Array.isArray(r[e])&&r[e].length>0)&&(r[e]=t(r[e]))}))):r=e,r},E={serviceUrl:"https://cdnapisec.kaltura.com/api_v3",cdnUrl:"https://cdnapisec.kaltura.com",serviceParams:{apiVersion:"3.3.0",format:1},useApiCaptions:!0,loadThumbnailWithKs:!1,replaceHostOnlyManifestUrls:!1},_=function(){function t(){e(this,t)}return s(t,null,[{key:"set",value:function(t){t&&Object.assign(E,t)}},{key:"get",value:function(){return g(E)}}]),t}(),I=s((function t(r){e(this,t),h(this,"hasError",!1),"KalturaAPIException"===r.objectType?(this.hasError=!0,this.error=new R(r.code,r.message)):r.error&&"KalturaAPIException"===r.error.objectType?(this.hasError=!0,this.error=new R(r.error.code,r.error.message)):this.data=r})),R=s((function t(r,n){e(this,t),this.code=r,this.message=n})),T=s((function t(r){e(this,t),this.id=r.id,this.referenceId=r.referenceId,this.externalSourceType=r.externalSourceType,this.name=r.name,this.description=r.description,this.dataUrl=r.dataUrl,this.type=r.type,this.entryType=r.mediaType,this.flavorParamsIds=r.flavorParamsIds,this.duration=r.duration,this.poster=r.thumbnailUrl,this.status=r.status,this.dvrStatus=r.dvrStatus,this.tags=r.tags,this.createdAt=r.createdAt,this.updatedAt=r.updatedAt,this.creatorId=r.creatorId,this.endDate=r.endDate,this.plays=r.plays,this.views=r.views,this.downloadUrl=r.downloadUrl}));h(T,"EntryType",{AUTOMATIC:{value:-1},EXTERNAL_MEDIA:{value:"externalMedia.externalMedia"},MEDIA_CLIP:{value:1},MIX:{value:2},PLAYLIST:{value:5},DATA:{value:6},LIVE_STREAM:{value:7},LIVE_CHANNEL:{value:8},DOCUMENT:{value:10}}),h(T,"MediaType",{VIDEO:{value:1},IMAGE:{value:2},AUDIO:{value:5},LIVE_STREAM_FLASH:{value:201},LIVE_STREAM_WINDOWS_MEDIA:{value:202},LIVE_STREAM_REAL_MEDIA:{value:203},LIVE_STREAM_QUICK_TIME:{value:204}}),h(T,"EntryStatus",{ERROR_IMPORTING:-2,ERROR_CONVERTING:-1,SCAN_FAILURE:"virusScan.ScanFailure",IMPORT:0,INFECTED:"virusScan.Infected",PRECONVERT:1,READY:2,DELETED:3,PENDING:4,MODERATE:5,BLOCKED:6,NO_CONTENT:7}),h(T,"EntryModerationStatus",{PENDING_MODERATION:1,APPROVED:2,REJECTED:3,FLAGGED_FOR_REVIEW:4,MODERATE:5,AUTO_APPROVED:6});var A=function(t){l(o,t);var r,n,i=(r=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=d(r);if(n){var i=d(this).constructor;t=Reflect.construct(e,arguments,i)}else t=e.apply(this,arguments);return f(this,t)});function o(t){var r;return e(this,o),(r=i.call(this,t)).hasError||(r.totalCount=t.totalCount,r.totalCount>0&&(r.entries=[],t.objects.map((function(t){return r.entries.push(new T(t))})))),r}return s(o)}(I),w=s((function t(r){e(this,t),this.type=r.type}));h(w,"Type",{DRM_POLICY:"drm.DRM_POLICY",BLOCK:1,PREVIEW:2,LIMIT_FLAVORS:3,ADD_TO_STORAGE:4,LIMIT_DELIVERY_PROFILES:5,SERVE_FROM_REMOTE_SERVER:6,REQUEST_HOST_REGEX:7,LIMIT_THUMBNAIL_CAPTURE:8});var C=function(t){l(o,t);var r,n,i=(r=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=d(r);if(n){var i=d(this).constructor;t=Reflect.construct(e,arguments,i)}else t=e.apply(this,arguments);return f(this,t)});function o(t){var r;return e(this,o),(r=i.call(this,t)).pattern=t.pattern,r.replacement=t.replacement,r.replacmenServerNodeId=t.replacmenServerNodeId,r.checkAliveTimeoutMs=t.checkAliveTimeoutMs,r}return s(o)}(w),O=s((function t(r){e(this,t),this.scheme=r.scheme,this.licenseURL=r.licenseURL,this.certificate=r.certificate}));h(O,"Scheme",{"drm.PLAYREADY_CENC":"com.microsoft.playready","drm.WIDEVINE_CENC":"com.widevine.alpha","fairplay.FAIRPLAY":"com.apple.fairplay",WIDEVINE_CENC:"com.widevine.alpha",PLAYREADY_CENC:"com.microsoft.playready",FAIRPLAY:"com.apple.fairplay"});var k=function(){function t(r){var n=this;e(this,t),h(this,"drm",[]),this.format=r.format,this.deliveryProfileId=r.deliveryProfileId,this.url=r.url,this.protocols=r.protocols,this.flavorIds=r.flavorIds,r.drm&&r.drm.map((function(t){return n.drm.push(new O(t))}))}return s(t,[{key:"hasDrmData",value:function(){return this.drm&&this.drm.length>0}},{key:"hasFlavorIds",value:function(){return!!this.flavorIds&&this.flavorIds.length>0}},{key:"getProtocol",value:function(t){var e="";if(this.protocols&&this.protocols.length>0)this.protocols.split(",").forEach((function(r){r===t&&(e=r)}));else if("http"===t)return t;return e}}]),t}(),b=s((function t(r){e(this,t),this.entryId=r.entryId,this.clickThroughUrl=r.url,this.sources=r.sources?r.sources.map((function(t){return new k(t)})):[]})),P=s((function t(r){e(this,t),this.id=r.id,this.flavorParamsId=r.flavorParamsId,this.fileExt=r.fileExt,this.bitrate=r.bitrate,this.width=r.width,this.height=r.height,this.id=r.id,this.frameRate=r.frameRate,this.isOriginal=r.isOriginal,this.isWeb=r.isWeb,this.containerFormat=r.containerFormat,this.videoCodecId=r.videoCodecId,this.status=r.status,this.language=r.language,this.label=r.label}));h(P,"Status",{ERROR:-1,QUEUED:0,CONVERTING:1,READY:2,DELETED:3,NOT_APPLICABLE:4,TEMP:5,WAIT_FOR_CONVERT:6,IMPORTING:7,VALIDATING:8,EXPORTING:9});var S=function(t){l(o,t);var r,n,i=(r=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=d(r);if(n){var i=d(this).constructor;t=Reflect.construct(e,arguments,i)}else t=e.apply(this,arguments);return f(this,t)});function o(t){var r;return e(this,o),(r=i.call(this,t)).hasError||(r.entries=[],t.map((function(t){return r.entries.push(new T(t))}))),r}return s(o)}(I),L=s((function t(r){e(this,t),this.id=r.id,this.metadataProfileId=r.metadataProfileId,this.metadataProfileVersion=r.metadataProfileVersion,this.metadataProfileId=r.metadataProfileId,this.metadataObjectType=r.metadataObjectType,this.objectId=r.objectId,this.version=r.version,this.created=new Date(0),this.created.setUTCSeconds(r.createdAt),this.updated=new Date(0),this.updated.setUTCSeconds(r.updatedAt),this.status=r.status,this.xml=r.xml}));h(L,"ObjectType",{AD_CUE_POINT:"adCuePointMetadata.AdCuePoint",ANNOTATION:"annotationMetadata.Annotation",CODE_CUE_POINT:"codeCuePointMetadata.CodeCuePoint",THUMB_CUE_POINT:"thumbCuePointMetadata.thumbCuePoint",ENTRY:1,CATEGORY:2,USER:3,PARTNER:4,DYNAMIC_OBJECT:5}),h(L,"Status",{VALID:1,INVALID:2,DELETED:3});var D=function(t){l(o,t);var r,n,i=(r=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=d(r);if(n){var i=d(this).constructor;t=Reflect.construct(e,arguments,i)}else t=e.apply(this,arguments);return f(this,t)});function o(t){var r;return e(this,o),(r=i.call(this,t)).hasError||(r.totalCount=t.totalCount,r.totalCount>0&&(r.metas=[],t.objects.map((function(t){return r.metas.push(new L(t))})))),r}return s(o)}(I),x=s((function t(r){e(this,t),this.message=r.message,this.code=r.code}));var M=function(t){l(o,t);var r,n,i=(r=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=d(r);if(n){var i=d(this).constructor;t=Reflect.construct(e,arguments,i)}else t=e.apply(this,arguments);return f(this,t)});function o(t){var r;if(e(this,o),h(u(r=i.call(this,t)),"sources",[]),h(u(r),"actions",[]),h(u(r),"messages",[]),h(u(r),"flavorAssets",[]),h(u(r),"bumperData",[]),!r.hasError){var n=t.messages;n&&n.map((function(t){return r.messages.push(new x(t))}));var a=t.actions;a&&a.map((function(t){t.type===w.Type.REQUEST_HOST_REGEX?r.actions.push(new C(t)):r.actions.push(new w(t))}));var s=t.sources;s&&s.map((function(t){return r.sources.push(new k(t))}));var c=t.flavorAssets;c&&c.map((function(t){return r.flavorAssets.push(new P(t))}));var l=t.bumperData;l&&l.map((function(t){return r.bumperData.push(new b(t))}))}return r}return s(o,[{key:"hasBlockAction",value:function(){return void 0!==this.getBlockAction()}},{key:"getBlockAction",value:function(){return this.actions.find((function(t){return t.type===w.Type.BLOCK}))}},{key:"getErrorMessages",value:function(){return this.messages}},{key:"getRequestHostRegexAction",value:function(){var t=this.actions.find((function(t){return t.type===w.Type.REQUEST_HOST_REGEX}));if(t instanceof C)return t}}]),o}(I),N=s((function t(r){e(this,t),this.id=r.id,this.name=r.name,this.description=r.description,this.poster=r.thumbnailUrl}));var U=function(t){l(o,t);var r,n,i=(r=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=d(r);if(n){var i=d(this).constructor;t=Reflect.construct(e,arguments,i)}else t=e.apply(this,arguments);return f(this,t)});function o(t){var r;return e(this,o),(r=i.call(this,t)).hasError||(r.name=t.name,r.description=t.description,r.objTypeAsString=t.objTypeAsString,r.width=t.width,r.height=t.height,r.htmlParams=t.htmlParams,r.swfUrl=t.swfUrl,r.confFilePath=t.confFilePath,r.confFile=t.confFile,r.confFileFeatures=t.confFileFeatures,r.config=t.config,r.confVars=t.confVars,r.useCdn=t.useCdn,r.tags=t.tags,r.swfUrlVersion=t.swfUrlVersion,r.created=new Date(0),r.created.setUTCSeconds(t.createdAt),r.updated=new Date(0),r.updated.setUTCSeconds(t.updatedAt),r.html5Url=t.description,r.version=t.description,r.partnerTags=t.description,r.objType=t.description,r.creationMode=t.description),r}return s(o)}(I);h(U,"Type",{PLAYER:1,CONTRIBUTION_WIZARD:2,SIMPLE_EDITOR:3,ADVANCED_EDITOR:4,PLAYLIST:5,APP_STUDIO:6,KRECORD:7,PLAYER_V3:8,KMC_ACCOUNT:9,KMC_ANALYTICS:10,KMC_CONTENT:11,KMC_DASHBOARD:12,KMC_LOGIN:13,PLAYER_SL:14,CLIENTSIDE_ENCODER:15,KMC_GENERAL:16,KMC_ROLES_AND_PERMISSIONS:17,CLIPPER:18,KSR:19,KUPLOAD:20,WEBCASTING:21}),h(U,"CreationMode",{WIZARD:2,ADVANCED:3});var j=s((function t(r){e(this,t),this.playlistLastEntryId=r.playlistLastEntryId,this.entryId=r.entryId,this.id=r.id,this.userId=r.userId,this.partnerId=r.partnerId,this.status=r.status,this.createdAt=r.createdAt,this.updatedAt=r.updatedAt}));var B=function(t){l(o,t);var r,n,i=(r=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=d(r);if(n){var i=d(this).constructor;t=Reflect.construct(e,arguments,i)}else t=e.apply(this,arguments);return f(this,t)});function o(t){var r;return e(this,o),(r=i.call(this,t)).hasError||(r.totalCount=t.totalCount,r.entries=[],r.totalCount>0&&t.objects.map((function(t){return r.entries.push(new j(t))}))),r}return s(o)}(I),V=function(){function t(){e(this,t)}return s(t,null,[{key:"build",value:function(t){var e=_.get(),r=e.serviceUrl.substr(0,e.serviceUrl.lastIndexOf("/")),n=t.partnerId,i=t.entryId,o=t.ks,a=t.uiConfId,s=t.format,u=t.protocol,c=t.extension,l=t.flavorIds;if(!r||isNaN(Number.parseInt(n))||!i||!s||!u)return"";var f=r;return r.endsWith("/")||(f+="/"),f+="p/"+n+"/sp/"+n+"00/playManifest/entryId/"+i+"/protocol/"+u+"/format/"+s,l?f+="/flavorIds/"+l:a&&(f+="/uiConfId/"+a),""!==o&&(f+="/ks/"+o),""!==c&&(f+="/a."+c),a&&""!==l&&(f+="?uiConfId="+a),f}}]),t}(),F=function(){function t(){e(this,t)}return s(t,null,[{key:"xmlToJson",value:function(t){var e={};if(1===t.nodeType){if(t.attributes.length>0){e["@attributes"]={};for(var r=0;r<t.attributes.length;r++){var n=t.attributes.item(r);e["@attributes"][n.nodeName]=n.nodeValue}}}else 3===t.nodeType&&(e=t.nodeValue);if(t.hasChildNodes())for(var i=0;i<t.childNodes.length;i++){var o=t.childNodes.item(i),a=o.nodeName;if(void 0===e[a])e[a]=this.xmlToJson(o);else{if(void 0===e[a].push){var s=e[a];e[a]=[],e[a].push(s)}e[a].push(this.xmlToJson(o))}}return e}}]),t}(),q={DASH:{name:"dash",mimeType:"application/dash+xml",pathExt:"mpd"},HLS:{name:"hls",mimeType:"application/x-mpegURL",pathExt:"m3u8"},WVM:{name:"wvm",mimeType:"video/wvm",pathExt:"wvm"},MP4:{name:"mp4",mimeType:"video/mp4",pathExt:"mp4"},MP3:{name:"mp3",mimeType:"audio/mpeg",pathExt:"mp3"}},H=new Map([["mpegdash",q.DASH],["applehttp",q.HLS],["url",q.MP4]]);function K(t){var e=H.get(t);return!!e&&e.name===q.MP4.name}var G=function(){function t(){e(this,t),this.progressive=[],this.dash=[],this.hls=[],this.image=[],this.document=[]}return s(t,[{key:"map",value:function(t,e){if(e)switch(e.name){case q.MP4.name:this.progressive.push(t);break;case q.DASH.name:this.dash.push(t);break;case q.HLS.name:this.hls.push(t)}}},{key:"toJSON",value:function(){var t={progressive:[],dash:[],hls:[],image:[],document:[]};return this.progressive.forEach((function(e){return t.progressive.push(e.toJSON())})),this.hls.forEach((function(e){return t.hls.push(e.toJSON())})),this.dash.forEach((function(e){return t.dash.push(e.toJSON())})),t.image=this.image,t.document=this.document,t}}]),t}(),W=function(){function t(){e(this,t),this.metadata=new Map,this.sources=new G,this.type=t.Type.UNKNOWN}return s(t,[{key:"toJSON",value:function(){return{id:this.id,name:this.name,sources:this.sources.toJSON(),duration:this.duration,dvrStatus:this.dvrStatus,status:this.status,metadata:this.metadata,type:this.type,poster:this.poster,assetReferenceType:this.assetReferenceType,downloadUrl:this.downloadUrl}}}]),t}();h(W,"Type",{VOD:"Vod",LIVE:"Live",IMAGE:"Image",AUDIO:"Audio",UNKNOWN:"Unknown",DOCUMENT:"Document"}),h(W,"DvrStatus",{ON:1,OFF:0});var Y=function(){function t(r,n,i){e(this,t),this.licenseUrl=r,this.scheme=n,i&&(this.certificate=i)}return s(t,[{key:"toJSON",value:function(){var t={licenseUrl:this.licenseUrl,scheme:this.scheme};return this.certificate&&(t.certificate=this.certificate),t}}]),t}(),J=function(){function t(){e(this,t)}return s(t,[{key:"toJSON",value:function(){var t={id:this.id,url:this.url,mimetype:this.mimetype};return this.bandwidth&&(t.bandwidth=this.bandwidth),this.width&&(t.width=this.width),this.height&&(t.height=this.height),this.label&&(t.label=this.label),this.drmData&&this.drmData.length>0&&(t.drmData=[],this.drmData.forEach((function(e){Array.isArray(t.drmData)&&t.drmData.push(e.toJSON())}))),t}}]),t}(),X=s((function t(){e(this,t),this.items=[]})),Q=s((function t(){e(this,t),this.items=[]})),Z=s((function t(r){e(this,t),this.url=r.url,this.clickThroughUrl=r.clickThroughUrl})),z={SRT:"1",DFXP:"2",WEBVTT:"3",CAP:"4"},$={3:"vtt",1:"srt"},tt=function(){function t(){e(this,t)}return s(t,null,[{key:"createConfig",value:function(t,e){return t.map((function(t){var r=t.url,n=$[t.format];return[z.DFXP,z.CAP].includes(t.format)&&(r=t.webVttUrl,n=$[z.WEBVTT]),r=it(r,e),{default:!!t.isDefault,type:n,language:t.languageCode,label:t.label,url:r}}))}}]),t}(),et=function(){function t(r){e(this,t),this.id=r.id,this.url=t.extractBaseThumbnailUrl(r.dataUrl),this.mimetype=""}return s(t,null,[{key:"extractBaseThumbnailUrl",value:function(t){return t.match(".+entry_id/[a-zA-Z0-9_]+/")[0].slice(0,-1)}}]),t}(),rt=s((function t(r){e(this,t),this.id=r.id,this.url=r.downloadUrl,this.thumbnailUrl=r.poster,this.mimetype=""})),nt=function(){function t(){e(this,t)}return s(t,null,[{key:"getMediaEntry",value:function(e,r,n,i){var o=new W,a=i.entry,s=i.playBackContextResult,u=i.metadataListResult,c=s.sources;return o.sources=t._getParsedSources(c,e,r,n,a,s),t._fillBaseData(o,a,u),o.type!==W.Type.LIVE&&_.get().useApiCaptions&&s.data.playbackCaptions&&(o.sources.captions=tt.createConfig(s.data.playbackCaptions,e)),o}},{key:"addKsToUrl",value:function(t,e){var r;return e?(r=-1!==t.split("?")[0].replace(/^.*[\\/]/,"").indexOf(".")?-1===t.indexOf("?")?"?ks=":"&ks=":"/ks/",t+r+e):t}},{key:"getPlaylist",value:function(e){var r=new X,n=e.playlistData,i=e.playlistItems.entries,o=e.playlistUserEntries.entries;return r.id=n.id,r.name=n.name,r.description=n.description,r.poster=n.poster,r.playlistLastEntryId=o.map((function(t){return t.playlistLastEntryId}))[0],i.forEach((function(e){var n=new W;t._fillBaseData(n,e),r.items.push(n)})),r}},{key:"getEntryList",value:function(e){var r=new Q;return e.playlistItems.entries.forEach((function(e){var n=new W;t._fillBaseData(n,e),r.items.push(n)})),r}},{key:"getBumper",value:function(e,r,n){var i=e.playBackContextResult,o=i.bumperData[0];if(o){var a=(o&&o.sources).find((function(t){return K(t.format)}));if(a){var s=t._parseProgressiveSources(a,i,r,n,0,o.entryId);if(s[0])return new Z({url:s[0].url,clickThroughUrl:o.clickThroughUrl})}}}},{key:"_fillBaseData",value:function(e,r,n){return e.poster=r.poster,e.id=r.id,e.duration=r.duration,e.downloadUrl=r.downloadUrl||"",e.metadata=t._parseMetadata(n),e.metadata.description=r.description||"",e.metadata.entryId=r.id||"",e.metadata.name=r.name||"",r.createdAt&&(e.metadata.createdAt=r.createdAt),r.updatedAt&&(e.metadata.updatedAt=r.updatedAt),r.creatorId&&(e.metadata.creatorId=r.creatorId),r.endDate&&(e.metadata.endDate=r.endDate),r.views&&(e.metadata.views=r.views),r.plays&&(e.metadata.plays=r.plays),e.metadata.tags=r.tags||"",e.status=r.status,e.type=t._getEntryType(r.entryType,r.type),e.type===W.Type.LIVE&&(e.dvrStatus=r.dvrStatus),e}},{key:"_getEntryType",value:function(t,e){var r=W.Type.UNKNOWN;switch(t){case T.MediaType.IMAGE.value:r=W.Type.IMAGE;break;case T.MediaType.AUDIO.value:r=W.Type.AUDIO;break;default:switch(e){case T.EntryType.MEDIA_CLIP.value:r=W.Type.VOD;break;case T.EntryType.LIVE_STREAM.value:case T.EntryType.LIVE_CHANNEL.value:r=W.Type.LIVE;break;case T.EntryType.DOCUMENT.value:r=W.Type.DOCUMENT;break;default:r=W.Type.UNKNOWN}}return r}},{key:"_getParsedSources",value:function(e,r,n,i,o,a){var s,u,c=new G;return o.type===T.EntryType.EXTERNAL_MEDIA.value?((u=new J).mimetype="video/youtube",u.url=o.referenceId,u.id=o.id+"_youtube",c.progressive.push(u)):o.entryType===T.MediaType.IMAGE.value?c.image.push(new et(o)):o.type===T.EntryType.DOCUMENT.value?c.document.push(new rt(o)):e&&e.length>0&&(e.filter((function(t){return!K(t.format)})).forEach((function(e){var s=t._parseAdaptiveSource(e,a,r,n,i,o.id);if(s){var u=H.get(e.format);c.map(s,u)}})),s=e.find((function(e){return K(e.format)&&""!==e.getProtocol(t._getBaseProtocol())})),c.progressive=t._parseProgressiveSources(s,a,r,n,i,o.id)),c}},{key:"_parseAdaptiveSource",value:function(e,r,n,i,o,a){var s=new J;if(e){var u="",c=H.get(e.format),l=e.getProtocol(t._getBaseProtocol()),f=e.deliveryProfileId,d=e.format,h="";if(c&&(h=c.pathExt,s.mimetype=c.mimeType),e.hasFlavorIds()?(!h&&r.flavorAssets&&r.flavorAssets.length>0&&(h=r.flavorAssets[0].fileExt),u=V.build({entryId:a,flavorIds:e.flavorIds,format:d,ks:n,partnerId:i,uiConfId:o,extension:h,protocol:l})):u=t.addKsToUrl(e.url,n),!u){var p="failed to create play url from source, discarding source: (".concat(a,"_").concat(f,"), ").concat(d);return t._logger.warn(p),null}if(s.url=u,s.id=a+"_"+f+","+d,e.hasDrmData()){var y=[];e.drm.forEach((function(t){y.push(new Y(t.licenseURL,O.Scheme[t.scheme],t.certificate))})),s.drmData=y}}return s}},{key:"_parseProgressiveSources",value:function(e,r,n,i,o,a){var s=[],u=[];if(e){var c=e.getProtocol(t._getBaseProtocol()),l=e.format,f=e.deliveryProfileId,d=f+","+l;r.flavorAssets.map((function(e){var r=new J;r.id=e.id+d,r.mimetype="mp3"===e.fileExt?"audio/mp3":"video/mp4",r.height=e.height,r.width=e.width,r.bandwidth=1024*e.bitrate,r.label=e.label||e.language;var h=V.build({entryId:a,flavorIds:e.id,format:l,ks:n,partnerId:i,uiConfId:o,extension:e.fileExt,protocol:c});if(""===h)return t._logger.warn("failed to create play url from source, discarding source: (".concat(a,"_").concat(f,"), ").concat(l,".")),null;r.url=h,e.height&&e.width?s.push(r):u.push(r)}))}return u.length&&!s.length?u:s}},{key:"_parseMetadata",value:function(t){var e={};return t&&t.metas&&t.metas.length>0&&t.metas.forEach((function(t){if(t.xml){var r=new DOMParser;t.xml=t.xml.replace(/\r?\n|\r/g,""),t.xml=t.xml.replace(/>\s*/g,">"),t.xml=t.xml.replace(/>\s*/g,">");var n=r.parseFromString(t.xml,"text/xml"),i=F.xmlToJson(n);Object.keys(i.metadata).forEach((function(t){e[t]=i.metadata[t]["#text"]}))}})),e}},{key:"_getBaseProtocol",value:function(){var t=_.get(),e=/^https?:/.exec(t.cdnUrl),r=e?e[0]:document.location.protocol;return"string"==typeof r?r.slice(0,-1):"https"}},{key:"hasBlockAction",value:function(t){return t.playBackContextResult.hasBlockAction()}},{key:"getBlockAction",value:function(t){return t.playBackContextResult.getBlockAction()}},{key:"getErrorMessages",value:function(t){return t.playBackContextResult.getErrorMessages()}}]),t}();h(nt,"_logger",m("OVPProviderParser"));var it=nt.addKsToUrl,ot=nt,at=s((function t(r,n,i){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};e(this,t),this.severity=r,this.category=n,this.code=i,this.data=o,t._logger.error("Category:".concat(n," | Code:").concat(i," |"),o)}));h(at,"Severity",{RECOVERABLE:1,CRITICAL:2}),h(at,"Category",{NETWORK:1,SERVICE:2,PROVIDER:3}),h(at,"Code",{UNSUPPORTED_SCHEME:1e3,BAD_HTTP_STATUS:1001,HTTP_ERROR:1002,TIMEOUT:1003,MALFORMED_DATA_URI:1004,BAD_SERVER_RESPONSE:1005,MULTIREQUEST_API_ERROR:1006,API_RESPONSE_MISMATCH:1007,ERROR:2e3,BLOCK_ACTION:2001,MEDIA_STATUS_NOT_READY:2002,MISSING_MANDATORY_PARAMS:3e3,MISSING_PLAY_SOURCE:3001,METHOD_NOT_IMPLEMENTED:3002}),h(at,"_logger",m("Error"));var st=function(){function t(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Map;e(this,t),h(this,"retryConfig",{async:!0,timeout:0,maxAttempts:4}),h(this,"_attemptCounter",1),this.headers=r}return s(t,[{key:"getUrl",value:function(t){return t+"/service/"+this.service+(this.action?"/action/"+this.action:"")}},{key:"doHttpRequest",value:function(){var t=this,e=new Promise((function(e,r){t._requestPromise={resolve:e,reject:r}}));return this.url||this._requestPromise.reject(new at(at.Severity.CRITICAL,at.Category.NETWORK,at.Code.MALFORMED_DATA_URI,{url:this.url})),this._createXHR(),e}},{key:"_createXHR",value:function(){var t=this,e=new XMLHttpRequest;e.onreadystatechange=function(){if(4===e.readyState&&200===e.status)try{var r=JSON.parse(e.responseText);return t.responseHeaders=t._getResponseHeaders(e),t._requestPromise.resolve(r)}catch(r){t._requestPromise.reject(t._createError(e,at.Code.BAD_SERVER_RESPONSE,{text:e.responseText}))}},e.open(this.method,this.url,this.retryConfig.async),this.retryConfig.async&&this.retryConfig.timeout&&(e.timeout=this.retryConfig.timeout);var r=performance.now();e.ontimeout=function(){t._handleError(e,at.Code.TIMEOUT,{timeout:(performance.now()-r)/1e3,statusText:e.statusText})},e.onerror=e.onabort=function(){t._handleError(e,at.Code.HTTP_ERROR,{text:e.responseText,statusText:e.statusText})},this.headers.forEach((function(t,r){e.setRequestHeader(r,t)})),e.send(this.params)}},{key:"_getResponseHeaders",value:function(t){return t.getAllResponseHeaders().split("\n").filter((function(t){return 0===t.toLowerCase().indexOf("x-")}))}},{key:"_handleError",value:function(t,e,r){var n=this._createError(t,e,r);if(t.onreadystatechange=function(){},t.onerror=function(){},t.ontimeout=function(){},t.onabort=function(){},!(this.retryConfig.maxAttempts&&this._attemptCounter<this.retryConfig.maxAttempts))return this._requestPromise.reject(n);this._attemptCounter++,this._createXHR()}},{key:"_createError",value:function(t,e,r){return Object.assign(r,{url:this.url,headers:this._getResponseHeaders(t),attempt:this._attemptCounter}),new at(at.Severity.CRITICAL,at.Category.NETWORK,e,r)}}]),t}();var ut=function(t){l(o,t);var r,n,i=(r=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=d(r);if(n){var i=d(this).constructor;t=Reflect.construct(e,arguments,i)}else t=e.apply(this,arguments);return f(this,t)});function o(){var t;e(this,o);for(var r=arguments.length,n=new Array(r),a=0;a<r;a++)n[a]=arguments[a];return h(u(t=i.call.apply(i,[this].concat(n))),"requests",[]),t}return s(o,[{key:"add",value:function(t){this.requests.push(t);var e={},r={service:t.service,action:t.action};return Object.assign(e,h({},this.requests.length,Object.assign(r,t.params))),Object.assign(e,this.params),this.params=e,this}},{key:"execute",value:function(t){var e=this;return new Promise((function(r,n){try{e.params=JSON.stringify(e.params)}catch(t){o._logger.error("".concat(t.message)),n(new at(at.Severity.CRITICAL,at.Category.PROVIDER,at.Code.FAILED_PARSING_REQUEST,{error:t,params:e.params}))}e.doHttpRequest().then((function(i){var o=new ct(i,t);o.success?r({headers:e.responseHeaders,response:o}):n(new at(at.Severity.CRITICAL,at.Category.NETWORK,at.Code.MULTIREQUEST_API_ERROR,{url:e.url,headers:e.responseHeaders,results:o.results}))}),(function(t){n(t)}))}))}}]),o}(st);h(ut,"_logger",m("MultiRequestBuilder"));var ct=s((function t(r){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];e(this,t),h(this,"results",[]);var i=r.result?r.result:r,o=(Array.isArray(i)?i:[i]).map((function(t){return new I(t)})),a=o.filter((function(t){return t.hasError}));a.forEach((function(e){t._logger.error("Service returned an error with error code: ".concat(e.error.code," and message: ").concat(e.error.message,"."))})),this.results=o,n&&a.length||a.length===this.results.length?this.success=!1:(this.results=this.results.filter((function(t){return!t.hasError})),this.success=!0)}));h(ct,"_logger",m("MultiRequestResult"));var lt=function(){function t(){e(this,t)}return s(t,null,[{key:"getMultiRequest",value:function(t,e,r){var n=_.get(),i=n.serviceParams;Object.assign(i,{ks:e,clientTag:"html5:v"+t}),r&&Object.assign(i,{partnerId:r});var o=new Map;o.set("Content-Type","application/json");var a=new ut(o);return a.method="POST",a.service="multirequest",a.url=a.getUrl(n.serviceUrl),a.params=i,a}}]),t}(),ft=s((function t(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e(this,t),this.type=r.type||t.Type.INCLUDE_FIELDS,this.fields=r.fields||"id,referenceId,name,description,thumbnailUrl,dataUrl,duration,msDuration,flavorParamsIds,mediaType,type,tags,dvrStatus,externalSourceType,status,createdAt,updatedAt,endDate,plays,views,downloadUrl,creatorId"}));h(ft,"Type",{INCLUDE_FIELDS:1,EXCLUDE_FIELDS:2});var dt="baseEntry",ht=function(t){l(o,t);var r,n,i=(r=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=d(r);if(n){var i=d(this).constructor;t=Reflect.construct(e,arguments,i)}else t=e.apply(this,arguments);return f(this,t)});function o(){return e(this,o),i.apply(this,arguments)}return s(o,null,[{key:"getPlaybackContext",value:function(t,e,r){var n=new Map;n.set("Content-Type","application/json");var i=new st(n);return i.service=dt,i.action="getPlaybackContext",i.method="POST",i.url=i.getUrl(t),i.tag="baseEntry-getPlaybackContext",i.params={entryId:r,ks:e,contextDataParams:{objectType:"KalturaContextDataParams",flavorTags:"all"}},i}},{key:"list",value:function(t,e,r,n,i){var a=new Map;a.set("Content-Type","application/json");var s=new st(a);return s.service=dt,s.action="list",s.method="POST",s.url=s.getUrl(t),s.tag="list",s.params=o.getEntryListReqParams(r,e,n,i),s}},{key:"getEntryListReqParams",value:function(t,e,r,n){var i={};return t?i=r?{redirectFromEntryId:t}:{idEqual:t}:n&&(i={objectType:"KalturaBaseEntryFilter",referenceIdEqual:n}),{ks:e,filter:i,responseProfile:new ft}}}]),o}(lt);var pt=function(t){l(o,t);var r,n,i=(r=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=d(r);if(n){var i=d(this).constructor;t=Reflect.construct(e,arguments,i)}else t=e.apply(this,arguments);return f(this,t)});function o(){return e(this,o),i.apply(this,arguments)}return s(o,null,[{key:"list",value:function(t,e,r){var n=new Map;n.set("Content-Type","application/json");var i=new st(n);i.service="metadata_metadata",i.action="list",i.method="POST",i.url=i.getUrl(t),i.tag="metadata_metadata-list";var o={objectType:"KalturaMetadataFilter",objectIdEqual:r,metadataObjectTypeEqual:"1"};return i.params={filter:o,ks:e},i}}]),o}(lt),yt=function(){function t(r){e(this,t),h(this,"_response",{}),this.requests=this.buildRequests(r),this._entryId=r.entryId,this._referenceId=r.referenceId}return s(t,[{key:"requests",get:function(){return this._requests},set:function(t){this._requests=t}},{key:"response",get:function(){return this._response},set:function(t){var e=new A(t[0].data);this._response.entry=e.entries[0],this._response.playBackContextResult=new M(t[1].data),this._response.metadataListResult=new D(t[2].data)}},{key:"buildRequests",value:function(t){var e=_.get(),r=[];r.push(ht.list(e.serviceUrl,t.ks,t.entryId,t.redirectFromEntryId,t.referenceId));var n="{1:result:ks}"===t.ks?"{2:result:objects:0:id}":"{1:result:objects:0:id}";return r.push(ht.getPlaybackContext(e.serviceUrl,t.ks,n)),r.push(pt.list(e.serviceUrl,t.ks,n)),r}},{key:"isValid",value:function(){return!(!this._entryId&&!this._referenceId)}}],[{key:"id",get:function(){return"media"}}]),t}();var vt=function(t){l(o,t);var r,n,i=(r=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=d(r);if(n){var i=d(this).constructor;t=Reflect.construct(e,arguments,i)}else t=e.apply(this,arguments);return f(this,t)});function o(){return e(this,o),i.apply(this,arguments)}return s(o,null,[{key:"anonymousSession",value:function(t,e){var r=new Map;r.set("Content-Type","application/json");var n=new st(r);return n.service="session",n.action="startWidgetSession",n.method="POST",n.url=n.getUrl(t),n.tag="session-startWidget",n.params={widgetId:e},n}}]),o}(lt),mt=function(){function t(r){e(this,t),h(this,"_response",{}),this.requests=this.buildRequests(r),this._widgetId=r.widgetId}return s(t,[{key:"requests",get:function(){return this._requests},set:function(t){this._requests=t}},{key:"response",get:function(){return this._response.ks},set:function(t){this._response.ks=t[0].data.ks}},{key:"buildRequests",value:function(t){var e=_.get(),r=[];return r.push(vt.anonymousSession(e.serviceUrl,t.widgetId)),r}},{key:"isValid",value:function(){return!!this._widgetId}}],[{key:"id",get:function(){return"session"}}]),t}();var gt=function(t){l(o,t);var r,n,i=(r=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=d(r);if(n){var i=d(this).constructor;t=Reflect.construct(e,arguments,i)}else t=e.apply(this,arguments);return f(this,t)});function o(t,r){var n,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",s=arguments.length>3?arguments[3]:void 0;return e(this,o),(n=i.call(this,s))._multiRequest=lt.getMultiRequest(t,a,r),n}return s(o)}(function(){function t(r){e(this,t),h(this,"_loadersResponseMap",new Map),h(this,"_loaders",new Map),this._networkRetryConfig=r}return s(t,[{key:"add",value:function(t,e,r){var n=this,i=new t(e);if(i.isValid()){this._loaders.set(t.id,i);var o=this._multiRequest.requests.length,a=i.requests;this._multiRequest.retryConfig=this._networkRetryConfig,a.forEach((function(t){t.params=t.params||{},t.params.ks=t.params.ks||r,n._multiRequest.add(t)}));var s=Array.from(new Array(a.length),(function(t,e){return e+o}));this._loadersResponseMap.set(t.id,s)}}},{key:"fetchData",value:function(t){var e=this;return new Promise((function(r,n){e._multiRequest.execute(t).then((function(t){e._multiResponse=t.response,e.prepareData(t.response).success?r(e._loaders):n(new at(at.Severity.CRITICAL,at.Category.NETWORK,at.Code.API_RESPONSE_MISMATCH,{headers:t.headers}))}),(function(t){n(t)}))}))}},{key:"prepareData",value:function(t){var e=this;return this._loaders.forEach((function(r,n){var i=e._loadersResponseMap.get(n);try{i&&i.length>0&&(r.response=t.results.slice(i[0],i[i.length-1]+1))}catch(t){return{success:!1,error:t}}})),{success:!0,data:this._loaders}}}]),t}());var Et="playlist",_t=function(t){l(o,t);var r,n,i=(r=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=d(r);if(n){var i=d(this).constructor;t=Reflect.construct(e,arguments,i)}else t=e.apply(this,arguments);return f(this,t)});function o(){return e(this,o),i.apply(this,arguments)}return s(o,null,[{key:"execute",value:function(t,e,r){var n=new Map;n.set("Content-Type","application/json");var i=new st(n);return i.service=Et,i.action="execute",i.method="POST",i.url=i.getUrl(t),i.tag="".concat(Et,"-execute"),i.params={ks:e,id:r,responseProfile:new ft},i}},{key:"get",value:function(t,e,r){var n=new Map;n.set("Content-Type","application/json");var i=new st(n);return i.service=Et,i.action="get",i.method="POST",i.url=i.getUrl(t),i.tag="".concat(Et,"-get"),i.params={ks:e,id:r,responseProfile:{fields:"id,name,description,thumbnailUrl",type:1}},i}},{key:"getLastEntryId",value:function(t,e,r){var n=new Map;n.set("Content-Type","application/json");var i=new st(n);return i.service="userEntry",i.action="list",i.method="POST",i.url=i.getUrl(t),i.tag="userEntry-list",i.params={ks:e,filter:{objectType:"KalturaViewHistoryUserEntry",entryIdEqual:r,userIdEqualCurrent:1},responseProfile:{fields:"playlistLastEntryId",type:1}},i}}]),o}(lt),It=function(){function t(r){e(this,t),h(this,"_response",{}),this.requests=this.buildRequests(r),this._playlistId=r.playlistId}return s(t,[{key:"requests",get:function(){return this._requests},set:function(t){this._requests=t}},{key:"response",get:function(){return this._response},set:function(t){this._response.playlistData=new N(t[0].data),this._response.playlistItems=new S(t[1].data),this._response.playlistUserEntries=new B(t[2].data)}},{key:"buildRequests",value:function(t){var e=_.get(),r=[];return r.push(_t.get(e.serviceUrl,t.ks,t.playlistId)),r.push(_t.execute(e.serviceUrl,t.ks,t.playlistId)),r.push(_t.getLastEntryId(e.serviceUrl,t.ks,t.playlistId)),r}},{key:"isValid",value:function(){return!!this._playlistId}}],[{key:"id",get:function(){return"playlist"}}]),t}(),Rt=function(){function t(r,n){e(this,t),h(this,"_networkRetryConfig",{async:!0,timeout:0,maxAttempts:4}),function(t){t&&"function"==typeof t.getLogger&&(p.get=t.getLogger),t&&t.LogLevel&&(y=t.LogLevel)}(r.logger),this._partnerId=r.partnerId,this._widgetId=r.widgetId,this._uiConfId=r.uiConfId,this._isAnonymous=!r.ks,this._ks=r.ks||"",this._playerVersion=n}return s(t,[{key:"partnerId",get:function(){return this._partnerId}},{key:"widgetId",get:function(){return this._widgetId||this.defaultWidgetId}},{key:"defaultWidgetId",get:function(){return"_"+this._partnerId}},{key:"uiConfId",get:function(){return this._uiConfId}},{key:"ks",get:function(){return this._ks},set:function(t){this._ks=t}},{key:"playerVersion",get:function(){return this._playerVersion}},{key:"isAnonymous",get:function(){return this._isAnonymous}},{key:"getMediaConfig",value:function(t){return Promise.reject(new at(at.Severity.CRITICAL,at.Category.PROVIDER,at.Code.METHOD_NOT_IMPLEMENTED,{message:"getMediaConfig method must be implement by the derived class"}))}},{key:"getPlaylistConfig",value:function(t){return Promise.reject(new at(at.Severity.CRITICAL,at.Category.PROVIDER,at.Code.METHOD_NOT_IMPLEMENTED,{message:"The provider does not support loading playlist by id"}))}},{key:"getEntryListConfig",value:function(t){return Promise.reject(new at(at.Severity.CRITICAL,at.Category.PROVIDER,at.Code.METHOD_NOT_IMPLEMENTED,{message:"The provider does not support loading entry list"}))}},{key:"_verifyHasSources",value:function(t){if(0===t.hls.concat(t.dash,t.progressive,t.image,t.document).length)throw new at(at.Severity.CRITICAL,at.Category.SERVICE,at.Code.MISSING_PLAY_SOURCE,{action:"",messages:"No play source for entry id: ".concat(t.id)})}},{key:"LogLevel",get:function(){return y}},{key:"getLogLevel",value:function(t){return function(t){return v(t).getLevel()}(t)}},{key:"setLogLevel",value:function(t,e){!function(t,e){v(e).setLevel(t)}(t,e)}}]),t}(),Tt=function(){function t(r){e(this,t),h(this,"_response",{playlistItems:{entries:[]}}),this.requests=this.buildRequests(r),this._entries=r.entries}return s(t,[{key:"requests",get:function(){return this._requests},set:function(t){this._requests=t}},{key:"response",get:function(){return this._response},set:function(t){var e,r=this;t.forEach((function(t){e=new A(t.data),r._response.playlistItems.entries.push(e.entries[0])}))}},{key:"buildRequests",value:function(t){var e=_.get(),r=[];return t.entries.forEach((function(n){r.push(ht.list(e.serviceUrl,t.ks,n.entryId||n,t.redirectFromEntryId,n.referenceId))})),r}},{key:"isValid",value:function(){return!(!this._entries||!this._entries.length)}}],[{key:"id",get:function(){return"entry_list"}}]),t}();function At(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function wt(t){return function(t){if(Array.isArray(t))return At(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return At(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?At(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ct(t,e,r,n,i,o,a){try{var s=t[o](a),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(n,i)}function Ot(t){return function(){var e=this,r=arguments;return new Promise((function(n,i){var o=t.apply(e,r);function a(t){Ct(o,n,i,a,s,"next",t)}function s(t){Ct(o,n,i,a,s,"throw",t)}a(void 0)}))}}var kt=r(687),bt=r.n(kt),Pt=function(){function t(){e(this,t)}var r,n;return s(t,null,[{key:"_applyRegexAction",value:function(t,e){if(t){var r=new RegExp(t.pattern,"i");if(e.match(r))return e.replace(r,t.replacement+"/")}return e}},{key:"_isECDNUrlAlive",value:(n=Ot(bt().mark((function e(r,n){var i,o;return bt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=n+"/api_v3/service/system/action/ping/format/1",(o=new XMLHttpRequest).open("GET",i),o.timeout=r.checkAliveTimeoutMs,o.onreadystatechange=function(){return 4===o.readyState&&200===o.status},o.ontimeout=function(){return t._logger.warn("Got timeout while pinging the ECDN url. the ping url: ".concat(i)),!1},o.send(),e.abrupt("return",!1);case 8:case"end":return e.stop()}}),e)}))),function(t,e){return n.apply(this,arguments)})},{key:"handleRegexAction",value:(r=Ot(bt().mark((function e(r,n){var i,o,a;return bt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=_.get().cdnUrl,o=t._extractRegexActionFromData(n),a=t._getRegExp(o),e.t0=i&&o&&a&&i.match(a),!e.t0){e.next=11;break}if(e.t1=o.checkAliveTimeoutMs>0,!e.t1){e.next=10;break}return e.next=9,t._isECDNUrlAlive(o,i.replace(a,o.replacement));case 9:e.t1=!e.sent;case 10:e.t0=!e.t1;case 11:if(!e.t0){e.next=14;break}return t._replaceHostUrls(r,o),e.abrupt("return",r);case 14:return t._logger.debug("exiting handleRegexAction - not applying regex action."),e.abrupt("return",r);case 16:case"end":return e.stop()}}),e)}))),function(t,e){return r.apply(this,arguments)})},{key:"_replaceHostUrls",value:function(e,r){t._logger.debug("Starting to modify urls...");var n=e.sources,i=n.hls,o=n.dash,a=n.progressive,s=n.image;[].concat(wt(i),wt(o),wt(a),wt(s)).forEach((function(e){return e.url=t._applyRegexAction(r,e.url)})),_.get().replaceHostOnlyManifestUrls||(t._logger.debug("replaceHostOnlyManifestUrls flag is off - modifying captions and poster URLs"),n.captions&&n.captions.forEach((function(e){return e.url=t._applyRegexAction(r,e.url)})),"string"==typeof n.poster&&(n.poster=t._applyRegexAction(r,n.poster))),t._logger.debug("Finished modifying urls")}},{key:"_extractRegexActionFromData",value:function(t){var e;return null===(e=t.get(yt.id))||void 0===e||null===(e=e.response)||void 0===e?void 0:e.playBackContextResult.getRequestHostRegexAction()}},{key:"_getRegExp",value:function(t){if(t&&t.pattern&&t.replacement)return new RegExp(t.pattern,"i")}}]),t}();h(Pt,"_logger",m("RegexActionHandler"));var St=Pt;var Lt=function(t){l(o,t);var r,n,i=(r=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=d(r);if(n){var i=d(this).constructor;t=Reflect.construct(e,arguments,i)}else t=e.apply(this,arguments);return f(this,t)});function o(t,r){var n;return e(this,o),h(u(n=i.call(this,t,r)),"_filterOptionsConfig",{redirectFromEntryId:!0}),n._logger=m("OVPProvider"),_.set(t.env),n._setFilterOptionsConfig(t.filterOptions),n._networkRetryConfig=Object.assign(n._networkRetryConfig,t.networkRetryParameters),n}return s(o,[{key:"env",get:function(){return _.get()}},{key:"getMediaConfig",value:function(t){var e=this;return t.ks&&(this.ks=t.ks,this._isAnonymous=!1),this.widgetId!==this.defaultWidgetId&&(this._isAnonymous=!1),this._dataLoader=new gt(this.playerVersion,this.partnerId,this.ks,this._networkRetryConfig),new Promise((function(r,n){var i=t.entryId,o=t.referenceId;if(i||o){var a=e.ks;a||(a="{1:result:ks}",e._dataLoader.add(mt,{widgetId:e.widgetId}));var s=e._getEntryRedirectFilter(t);return e._dataLoader.add(yt,{entryId:i,ks:a,redirectFromEntryId:s,referenceId:o}),e._dataLoader.fetchData().then((function(t){try{var i=e._parseDataFromResponse(t);St.handleRegexAction(i,t).then(r)}catch(t){n(t)}}),(function(t){n(t)}))}n(new at(at.Severity.CRITICAL,at.Category.PROVIDER,at.Code.MISSING_MANDATORY_PARAMS,{message:"missing entry id"}))}))}},{key:"doRequest",value:function(t,e){var r=this,n=e||this.ks,i=new gt(this.playerVersion,this.partnerId,n,this._networkRetryConfig);return new Promise((function(e,o){return n||i.add(mt,{widgetId:r.widgetId}),t.forEach((function(t){i.add(t.loader,t.params,n||"{1:result:ks}")})),i.fetchData().then((function(t){try{e(t)}catch(t){o(t)}}),(function(t){o(t)}))}))}},{key:"_getEntryRedirectFilter",value:function(t){return"boolean"==typeof t.redirectFromEntryId?t.redirectFromEntryId:"boolean"!=typeof this._filterOptionsConfig.redirectFromEntryId||this._filterOptionsConfig.redirectFromEntryId}},{key:"_setFilterOptionsConfig",value:function(t){t&&"boolean"==typeof t.redirectFromEntryId&&(this._filterOptionsConfig.redirectFromEntryId=t.redirectFromEntryId)}},{key:"_parseDataFromResponse",value:function(t){this._logger.debug("Data parsing started");var e={session:{isAnonymous:this._isAnonymous,partnerId:this.partnerId},sources:this._getDefaultSourcesObject(),plugins:{}};if(this.uiConfId&&(e.session.uiConfId=this.uiConfId),t){if(t.has(mt.id)){var r=t.get(mt.id);r&&r.response&&(e.session.ks=r.response,this.widgetId!==this.defaultWidgetId&&(this.ks=e.session.ks))}else e.session.ks=this.ks;if(t.has(yt.id)){var n=t.get(yt.id);if(n&&n.response){var i=n.response;if(ot.hasBlockAction(i))throw new at(at.Severity.CRITICAL,at.Category.SERVICE,at.Code.BLOCK_ACTION,{action:ot.getBlockAction(i),messages:ot.getErrorMessages(i)});var o=ot.getMediaEntry(this.isAnonymous?"":this.ks,this.partnerId,this.uiConfId,i);Object.assign(e.sources,this._getSourcesObject(o)),this._verifyMediaStatus(o),this._verifyHasSources(e.sources);var a=ot.getBumper(i,this.isAnonymous?"":this.ks,this.partnerId);a&&Object.assign(e.plugins,{bumper:a})}}}return this._logger.debug("Data parsing finished",e),e}},{key:"_verifyMediaStatus",value:function(t){if([T.EntryStatus.IMPORT,T.EntryStatus.PRECONVERT].includes(t.status))throw new at(at.Severity.CRITICAL,at.Category.SERVICE,at.Code.MEDIA_STATUS_NOT_READY,{messages:"Status of entry id ".concat(t.id," is ").concat(t.status," and is still being imported or converted"),data:{status:status}})}},{key:"getPlaylistConfig",value:function(t){var e=this;return t.ks&&(this.ks=t.ks,this._isAnonymous=!1),this.widgetId!==this.defaultWidgetId&&(this._isAnonymous=!1),this._dataLoader=new gt(this.playerVersion,this.partnerId,this.ks,this._networkRetryConfig),new Promise((function(r,n){var i=t.playlistId;if(i){var o=e.ks;o||(o="{1:result:ks}",e._dataLoader.add(mt,{widgetId:e.widgetId})),e._dataLoader.add(It,{playlistId:i,ks:o}),e._dataLoader.fetchData().then((function(t){r(e._parsePlaylistDataFromResponse(t))}),(function(t){n(t)}))}else n({success:!1,data:"Missing mandatory parameter"})}))}},{key:"_parsePlaylistDataFromResponse",value:function(t){var e=this;this._logger.debug("Data parsing started");var r=this._getPlaylistObject();if(t&&t.has(It.id)){var n=t.get(It.id);if(n&&n.response){var i=ot.getPlaylist(n.response);r.id=i.id,r.poster=i.poster,r.metadata.name=i.name,r.metadata.description=i.description,r.playlistLastEntryId=i.playlistLastEntryId,i.items.forEach((function(t){return r.items.push({sources:e._getSourcesObject(t)})}))}}return this._logger.debug("Data parsing finished",r),r}},{key:"getEntryListConfig",value:function(t){var e=this;return t.ks&&(this.ks=t.ks,this._isAnonymous=!1),this.widgetId!==this.defaultWidgetId&&(this._isAnonymous=!1),this._dataLoader=new gt(this.playerVersion,this.partnerId,this.ks,this._networkRetryConfig),new Promise((function(r,n){var i=t.entries;if(i&&i.length){var o=e.ks;o||(o="{1:result:ks}",e._dataLoader.add(mt,{widgetId:e.widgetId}));var a=e._getEntryRedirectFilter(t);e._dataLoader.add(Tt,{entries:i,ks:o,redirectFromEntryId:a}),e._dataLoader.fetchData(!1).then((function(t){r(e._parseEntryListDataFromResponse(t))}),(function(t){n(t)}))}else n({success:!1,data:"Missing mandatory parameter"})}))}},{key:"_parseEntryListDataFromResponse",value:function(t){var e=this;this._logger.debug("Data parsing started");var r=this._getPlaylistObject();if(t&&t.has(Tt.id)){var n=t.get(Tt.id);n&&n.response&&ot.getEntryList(n.response).items.forEach((function(t){return r.items.push({sources:e._getSourcesObject(t)})}))}return this._logger.debug("Data parsing finished",r),r}},{key:"_getPlaylistObject",value:function(){return{id:"",metadata:{name:"",description:""},poster:"",playlistLastEntryId:"",items:[]}}},{key:"_getDefaultSourcesObject",value:function(){return{hls:[],dash:[],progressive:[],image:[],document:[],id:"",duration:0,type:W.Type.UNKNOWN,poster:"",dvr:!1,vr:null,metadata:{name:"",description:"",tags:""}}}},{key:"_getSourcesObject",value:function(t){var e=this._getDefaultSourcesObject(),r=t.sources.toJSON();return e.hls=r.hls,e.dash=r.dash,e.progressive=r.progressive,e.image=r.image,e.document=r.document,e.id=t.id,e.duration=t.duration,e.type=t.type,e.dvr=!!t.dvrStatus,e.poster=t.poster,e.downloadUrl=t.downloadUrl,t.sources.captions&&(e.captions=t.sources.captions),t.metadata&&"string"==typeof t.metadata.tags&&t.metadata.tags.split(", ").includes("360")&&(e.vr={}),Object.assign(e.metadata,t.metadata),e}}]),o}(Rt),Dt="@playkit-js/playkit-js-providers-ovp",xt="2.40.3"}(),n}()}));
3
3
  //# sourceMappingURL=playkit-ovp-provider.js.map
@@ -1,2 +1,2 @@
1
- !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var r=t();for(var n in r)("object"==typeof exports?exports:e)[n]=r[n]}}(self,(function(){return function(){"use strict";var e={d:function(t,r){for(var n in r)e.o(r,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:r[n]})},o:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r:function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(e){var t=function(e,t){if("object"!==n(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,"string");if("object"!==n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===n(t)?t:String(t)}function i(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,o(n.key),n)}}function s(e,t,r){return t&&i(e.prototype,t),r&&i(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function a(e,t,r){return(t=o(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}e.r(t),e.d(t,{NAME:function(){return S},OVPConfiguration:function(){return y},OVPStatsService:function(){return T},RequestBuilder:function(){return l},VERSION:function(){return A}});var u=function(){return{VERSION:"",DEBUG:{value:"",name:""},ERROR:{value:"",name:""},INFO:{value:"",name:""},OFF:{value:"",name:""},TIME:{value:"",name:""},TRACE:{value:"",name:""},WARN:{value:"",name:""},createDefaultHandler:function(){},debug:function(){},enabledFor:function(){},error:function(){},get:function(){},getLevel:function(){},info:function(){},log:function(){},setHandler:function(){},setLevel:function(){},time:function(){},timeEnd:function(){},trace:function(){},useDefaults:function(){},warn:function(){}}};var c=function(e){return u(e)},f=s((function e(t,n,o){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};r(this,e),this.severity=t,this.category=n,this.code=o,this.data=i,e._logger.error("Category:".concat(n," | Code:").concat(o," |"),i)}));a(f,"Severity",{RECOVERABLE:1,CRITICAL:2}),a(f,"Category",{NETWORK:1,SERVICE:2,PROVIDER:3}),a(f,"Code",{UNSUPPORTED_SCHEME:1e3,BAD_HTTP_STATUS:1001,HTTP_ERROR:1002,TIMEOUT:1003,MALFORMED_DATA_URI:1004,BAD_SERVER_RESPONSE:1005,MULTIREQUEST_API_ERROR:1006,API_RESPONSE_MISMATCH:1007,ERROR:2e3,BLOCK_ACTION:2001,MEDIA_STATUS_NOT_READY:2002,MISSING_MANDATORY_PARAMS:3e3,MISSING_PLAY_SOURCE:3001,METHOD_NOT_IMPLEMENTED:3002}),a(f,"_logger",c("Error"));var l=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Map;r(this,e),a(this,"retryConfig",{async:!0,timeout:0,maxAttempts:4}),a(this,"_attemptCounter",1),this.headers=t}return s(e,[{key:"getUrl",value:function(e){return e+"/service/"+this.service+(this.action?"/action/"+this.action:"")}},{key:"doHttpRequest",value:function(){var e=this,t=new Promise((function(t,r){e._requestPromise={resolve:t,reject:r}}));return this.url||this._requestPromise.reject(new f(f.Severity.CRITICAL,f.Category.NETWORK,f.Code.MALFORMED_DATA_URI,{url:this.url})),this._createXHR(),t}},{key:"_createXHR",value:function(){var e=this,t=new XMLHttpRequest;t.onreadystatechange=function(){if(4===t.readyState&&200===t.status)try{var r=JSON.parse(t.responseText);return e.responseHeaders=e._getResponseHeaders(t),e._requestPromise.resolve(r)}catch(r){e._requestPromise.reject(e._createError(t,f.Code.BAD_SERVER_RESPONSE,{text:t.responseText}))}},t.open(this.method,this.url,this.retryConfig.async),this.retryConfig.async&&this.retryConfig.timeout&&(t.timeout=this.retryConfig.timeout);var r=performance.now();t.ontimeout=function(){e._handleError(t,f.Code.TIMEOUT,{timeout:(performance.now()-r)/1e3,statusText:t.statusText})},t.onerror=t.onabort=function(){e._handleError(t,f.Code.HTTP_ERROR,{text:t.responseText,statusText:t.statusText})},this.headers.forEach((function(e,r){t.setRequestHeader(r,e)})),t.send(this.params)}},{key:"_getResponseHeaders",value:function(e){return e.getAllResponseHeaders().split("\n").filter((function(e){return 0===e.toLowerCase().indexOf("x-")}))}},{key:"_handleError",value:function(e,t,r){var n=this._createError(e,t,r);if(e.onreadystatechange=function(){},e.onerror=function(){},e.ontimeout=function(){},e.onabort=function(){},!(this.retryConfig.maxAttempts&&this._attemptCounter<this.retryConfig.maxAttempts))return this._requestPromise.reject(n);this._attemptCounter++,this._createXHR()}},{key:"_createError",value:function(e,t,r){return Object.assign(r,{url:this.url,headers:this._getResponseHeaders(e),attempt:this._attemptCounter}),new f(f.Severity.CRITICAL,f.Category.NETWORK,t,r)}}]),e}(),p=function e(t){var r;return Array.isArray(t)?(r=t.length>0?t.slice(0):[]).forEach((function(t,o){("object"===n(t)||Array.isArray(t)&&t.length>0)&&(r[o]=e(t))})):"object"===n(t)?(r=Object.assign({},t),Object.keys(r).forEach((function(t){("object"===n(r[t])||Array.isArray(r[t])&&r[t].length>0)&&(r[t]=e(r[t]))}))):r=t,r},h={serviceUrl:"https://cdnapisec.kaltura.com/api_v3",cdnUrl:"https://cdnapisec.kaltura.com",serviceParams:{apiVersion:"3.3.0",format:1},useApiCaptions:!0,loadThumbnailWithKs:!1,replaceHostOnlyManifestUrls:!1},y=function(){function e(){r(this,e)}return s(e,null,[{key:"set",value:function(e){e&&Object.assign(h,e)}},{key:"get",value:function(){return p(h)}}]),e}();function v(e,t){return v=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},v(e,t)}function d(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&v(e,t)}function m(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function g(e,t){if(t&&("object"===n(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return m(e)}function R(e){return R=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},R(e)}var E=s((function e(t){r(this,e),a(this,"hasError",!1),"KalturaAPIException"===t.objectType?(this.hasError=!0,this.error=new b(t.code,t.message)):t.error&&"KalturaAPIException"===t.error.objectType?(this.hasError=!0,this.error=new b(t.error.code,t.error.message)):this.data=t})),b=s((function e(t,n){r(this,e),this.code=t,this.message=n}));var O=function(e){d(i,e);var t,n,o=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=R(t);if(n){var o=R(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return g(this,e)});function i(){var e;r(this,i);for(var t=arguments.length,n=new Array(t),s=0;s<t;s++)n[s]=arguments[s];return a(m(e=o.call.apply(o,[this].concat(n))),"requests",[]),e}return s(i,[{key:"add",value:function(e){this.requests.push(e);var t={},r={service:e.service,action:e.action};return Object.assign(t,a({},this.requests.length,Object.assign(r,e.params))),Object.assign(t,this.params),this.params=t,this}},{key:"execute",value:function(e){var t=this;return new Promise((function(r,n){try{t.params=JSON.stringify(t.params)}catch(e){i._logger.error("".concat(e.message)),n(new f(f.Severity.CRITICAL,f.Category.PROVIDER,f.Code.FAILED_PARSING_REQUEST,{error:e,params:t.params}))}t.doHttpRequest().then((function(o){var i=new _(o,e);i.success?r({headers:t.responseHeaders,response:i}):n(new f(f.Severity.CRITICAL,f.Category.NETWORK,f.Code.MULTIREQUEST_API_ERROR,{url:t.url,headers:t.responseHeaders,results:i.results}))}),(function(e){n(e)}))}))}}]),i}(l);a(O,"_logger",c("MultiRequestBuilder"));var _=s((function e(t){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];r(this,e),a(this,"results",[]);var o=t.result?t.result:t,i=(Array.isArray(o)?o:[o]).map((function(e){return new E(e)})),s=i.filter((function(e){return e.hasError}));s.forEach((function(t){e._logger.error("Service returned an error with error code: ".concat(t.error.code," and message: ").concat(t.error.message,"."))})),this.results=i,n&&s.length||s.length===this.results.length?this.success=!1:(this.results=this.results.filter((function(e){return!e.hasError})),this.success=!0)}));a(_,"_logger",c("MultiRequestResult"));var T=function(e){d(a,e);var t,o,i=(t=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=R(t);if(o){var n=R(this).constructor;e=Reflect.construct(r,arguments,n)}else e=r.apply(this,arguments);return g(this,e)});function a(){return r(this,a),i.apply(this,arguments)}return s(a,null,[{key:"collect",value:function(e,t,r,o){var i=y.get(),s={};Object.assign(s,i.serviceParams,{ks:t,clientTag:"html5:v"+r},o);var a,u,c,f,p,h=new l;return h.service="stats",h.action="collect",h.method="GET",h.tag="stats-collect",h.params=s,h.url=e+"?service="+h.service+"&action="+h.action+"&"+(a=h.params,u=[],c=/\[\]$/,f=function(e){return"[object Array]"===Object.prototype.toString.call(e)},p=function(e,t){t="function"==typeof t?t():null==t?"":t,u[u.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)},function e(t,r){var o,i,s;if(t)if(f(r))for(o=0,i=r.length;o<i;o++)c.test(t)?p(t,r[o]):e(t+":"+("object"===n(r[o])?o:""),r[o]);else if(r&&"[object Object]"===String(r))for(s in r)e(t+":"+s,r[s]);else p(t,r);else if(f(r))for(o=0,i=r.length;o<i;o++)p(r[o].name,r[o].value);else for(s in r)e(s,r[s]);return u}("",a).join("&").replace(/%20/g,"+")),h}}]),a}(function(){function e(){r(this,e)}return s(e,null,[{key:"getMultiRequest",value:function(e,t,r){var n=y.get(),o=n.serviceParams;Object.assign(o,{ks:t,clientTag:"html5:v"+e}),r&&Object.assign(o,{partnerId:r});var i=new Map;i.set("Content-Type","application/json");var s=new O(i);return s.method="POST",s.service="multirequest",s.url=s.getUrl(n.serviceUrl),s.params=o,s}}]),e}()),S="@playkit-js/playkit-js-providers-stats-service",A="2.40.3-canary.0-f4a978f";return t}()}));
1
+ !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var r=t();for(var n in r)("object"==typeof exports?exports:e)[n]=r[n]}}(self,(function(){return function(){"use strict";var e={d:function(t,r){for(var n in r)e.o(r,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:r[n]})},o:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r:function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(e){var t=function(e,t){if("object"!==n(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,"string");if("object"!==n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===n(t)?t:String(t)}function i(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,o(n.key),n)}}function s(e,t,r){return t&&i(e.prototype,t),r&&i(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function u(e,t,r){return(t=o(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}e.r(t),e.d(t,{NAME:function(){return S},OVPConfiguration:function(){return y},OVPStatsService:function(){return T},RequestBuilder:function(){return l},VERSION:function(){return A}});var a=function(){return{VERSION:"",DEBUG:{value:"",name:""},ERROR:{value:"",name:""},INFO:{value:"",name:""},OFF:{value:"",name:""},TIME:{value:"",name:""},TRACE:{value:"",name:""},WARN:{value:"",name:""},createDefaultHandler:function(){},debug:function(){},enabledFor:function(){},error:function(){},get:function(){},getLevel:function(){},info:function(){},log:function(){},setHandler:function(){},setLevel:function(){},time:function(){},timeEnd:function(){},trace:function(){},useDefaults:function(){},warn:function(){}}};var c=function(e){return a(e)},f=s((function e(t,n,o){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};r(this,e),this.severity=t,this.category=n,this.code=o,this.data=i,e._logger.error("Category:".concat(n," | Code:").concat(o," |"),i)}));u(f,"Severity",{RECOVERABLE:1,CRITICAL:2}),u(f,"Category",{NETWORK:1,SERVICE:2,PROVIDER:3}),u(f,"Code",{UNSUPPORTED_SCHEME:1e3,BAD_HTTP_STATUS:1001,HTTP_ERROR:1002,TIMEOUT:1003,MALFORMED_DATA_URI:1004,BAD_SERVER_RESPONSE:1005,MULTIREQUEST_API_ERROR:1006,API_RESPONSE_MISMATCH:1007,ERROR:2e3,BLOCK_ACTION:2001,MEDIA_STATUS_NOT_READY:2002,MISSING_MANDATORY_PARAMS:3e3,MISSING_PLAY_SOURCE:3001,METHOD_NOT_IMPLEMENTED:3002}),u(f,"_logger",c("Error"));var l=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Map;r(this,e),u(this,"retryConfig",{async:!0,timeout:0,maxAttempts:4}),u(this,"_attemptCounter",1),this.headers=t}return s(e,[{key:"getUrl",value:function(e){return e+"/service/"+this.service+(this.action?"/action/"+this.action:"")}},{key:"doHttpRequest",value:function(){var e=this,t=new Promise((function(t,r){e._requestPromise={resolve:t,reject:r}}));return this.url||this._requestPromise.reject(new f(f.Severity.CRITICAL,f.Category.NETWORK,f.Code.MALFORMED_DATA_URI,{url:this.url})),this._createXHR(),t}},{key:"_createXHR",value:function(){var e=this,t=new XMLHttpRequest;t.onreadystatechange=function(){if(4===t.readyState&&200===t.status)try{var r=JSON.parse(t.responseText);return e.responseHeaders=e._getResponseHeaders(t),e._requestPromise.resolve(r)}catch(r){e._requestPromise.reject(e._createError(t,f.Code.BAD_SERVER_RESPONSE,{text:t.responseText}))}},t.open(this.method,this.url,this.retryConfig.async),this.retryConfig.async&&this.retryConfig.timeout&&(t.timeout=this.retryConfig.timeout);var r=performance.now();t.ontimeout=function(){e._handleError(t,f.Code.TIMEOUT,{timeout:(performance.now()-r)/1e3,statusText:t.statusText})},t.onerror=t.onabort=function(){e._handleError(t,f.Code.HTTP_ERROR,{text:t.responseText,statusText:t.statusText})},this.headers.forEach((function(e,r){t.setRequestHeader(r,e)})),t.send(this.params)}},{key:"_getResponseHeaders",value:function(e){return e.getAllResponseHeaders().split("\n").filter((function(e){return 0===e.toLowerCase().indexOf("x-")}))}},{key:"_handleError",value:function(e,t,r){var n=this._createError(e,t,r);if(e.onreadystatechange=function(){},e.onerror=function(){},e.ontimeout=function(){},e.onabort=function(){},!(this.retryConfig.maxAttempts&&this._attemptCounter<this.retryConfig.maxAttempts))return this._requestPromise.reject(n);this._attemptCounter++,this._createXHR()}},{key:"_createError",value:function(e,t,r){return Object.assign(r,{url:this.url,headers:this._getResponseHeaders(e),attempt:this._attemptCounter}),new f(f.Severity.CRITICAL,f.Category.NETWORK,t,r)}}]),e}(),p=function e(t){var r;return Array.isArray(t)?(r=t.length>0?t.slice(0):[]).forEach((function(t,o){("object"===n(t)||Array.isArray(t)&&t.length>0)&&(r[o]=e(t))})):"object"===n(t)?(r=Object.assign({},t),Object.keys(r).forEach((function(t){("object"===n(r[t])||Array.isArray(r[t])&&r[t].length>0)&&(r[t]=e(r[t]))}))):r=t,r},h={serviceUrl:"https://cdnapisec.kaltura.com/api_v3",cdnUrl:"https://cdnapisec.kaltura.com",serviceParams:{apiVersion:"3.3.0",format:1},useApiCaptions:!0,loadThumbnailWithKs:!1,replaceHostOnlyManifestUrls:!1},y=function(){function e(){r(this,e)}return s(e,null,[{key:"set",value:function(e){e&&Object.assign(h,e)}},{key:"get",value:function(){return p(h)}}]),e}();function v(e,t){return v=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},v(e,t)}function d(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&v(e,t)}function m(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function g(e,t){if(t&&("object"===n(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return m(e)}function R(e){return R=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},R(e)}var E=s((function e(t){r(this,e),u(this,"hasError",!1),"KalturaAPIException"===t.objectType?(this.hasError=!0,this.error=new b(t.code,t.message)):t.error&&"KalturaAPIException"===t.error.objectType?(this.hasError=!0,this.error=new b(t.error.code,t.error.message)):this.data=t})),b=s((function e(t,n){r(this,e),this.code=t,this.message=n}));var O=function(e){d(i,e);var t,n,o=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=R(t);if(n){var o=R(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return g(this,e)});function i(){var e;r(this,i);for(var t=arguments.length,n=new Array(t),s=0;s<t;s++)n[s]=arguments[s];return u(m(e=o.call.apply(o,[this].concat(n))),"requests",[]),e}return s(i,[{key:"add",value:function(e){this.requests.push(e);var t={},r={service:e.service,action:e.action};return Object.assign(t,u({},this.requests.length,Object.assign(r,e.params))),Object.assign(t,this.params),this.params=t,this}},{key:"execute",value:function(e){var t=this;return new Promise((function(r,n){try{t.params=JSON.stringify(t.params)}catch(e){i._logger.error("".concat(e.message)),n(new f(f.Severity.CRITICAL,f.Category.PROVIDER,f.Code.FAILED_PARSING_REQUEST,{error:e,params:t.params}))}t.doHttpRequest().then((function(o){var i=new _(o,e);i.success?r({headers:t.responseHeaders,response:i}):n(new f(f.Severity.CRITICAL,f.Category.NETWORK,f.Code.MULTIREQUEST_API_ERROR,{url:t.url,headers:t.responseHeaders,results:i.results}))}),(function(e){n(e)}))}))}}]),i}(l);u(O,"_logger",c("MultiRequestBuilder"));var _=s((function e(t){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];r(this,e),u(this,"results",[]);var o=t.result?t.result:t,i=(Array.isArray(o)?o:[o]).map((function(e){return new E(e)})),s=i.filter((function(e){return e.hasError}));s.forEach((function(t){e._logger.error("Service returned an error with error code: ".concat(t.error.code," and message: ").concat(t.error.message,"."))})),this.results=i,n&&s.length||s.length===this.results.length?this.success=!1:(this.results=this.results.filter((function(e){return!e.hasError})),this.success=!0)}));u(_,"_logger",c("MultiRequestResult"));var T=function(e){d(u,e);var t,o,i=(t=u,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=R(t);if(o){var n=R(this).constructor;e=Reflect.construct(r,arguments,n)}else e=r.apply(this,arguments);return g(this,e)});function u(){return r(this,u),i.apply(this,arguments)}return s(u,null,[{key:"collect",value:function(e,t,r,o){var i=y.get(),s={};Object.assign(s,i.serviceParams,{ks:t,clientTag:"html5:v"+r},o);var u,a,c,f,p,h=new l;return h.service="stats",h.action="collect",h.method="GET",h.tag="stats-collect",h.params=s,h.url=e+"?service="+h.service+"&action="+h.action+"&"+(u=h.params,a=[],c=/\[\]$/,f=function(e){return"[object Array]"===Object.prototype.toString.call(e)},p=function(e,t){t="function"==typeof t?t():null==t?"":t,a[a.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)},function e(t,r){var o,i,s;if(t)if(f(r))for(o=0,i=r.length;o<i;o++)c.test(t)?p(t,r[o]):e(t+":"+("object"===n(r[o])?o:""),r[o]);else if(r&&"[object Object]"===String(r))for(s in r)e(t+":"+s,r[s]);else p(t,r);else if(f(r))for(o=0,i=r.length;o<i;o++)p(r[o].name,r[o].value);else for(s in r)e(s,r[s]);return a}("",u).join("&").replace(/%20/g,"+")),h}}]),u}(function(){function e(){r(this,e)}return s(e,null,[{key:"getMultiRequest",value:function(e,t,r){var n=y.get(),o=n.serviceParams;Object.assign(o,{ks:t,clientTag:"html5:v"+e}),r&&Object.assign(o,{partnerId:r});var i=new Map;i.set("Content-Type","application/json");var s=new O(i);return s.method="POST",s.service="multirequest",s.url=s.getUrl(n.serviceUrl),s.params=o,s}}]),e}()),S="@playkit-js/playkit-js-providers-stats-service",A="2.40.3";return t}()}));
2
2
  //# sourceMappingURL=playkit-stats-service.js.map