kollapsminoriteten/wp-content/plugins/jetpack/_inc/blocks/editor-beta.js

31 lines
949 KiB
JavaScript
Raw Normal View History

2021-07-23 11:58:50 +02:00
!function(e,t){for(var n in t)e[n]=t[n]}(window,function(e){function t(t){for(var n,r,o=t[0],c=t[1],i=0,l=[];i<o.length;i++)r=o[i],Object.prototype.hasOwnProperty.call(a,r)&&a[r]&&l.push(a[r][0]),a[r]=0;for(n in c)Object.prototype.hasOwnProperty.call(c,n)&&(e[n]=c[n]);for(s&&s(t);l.length;)l.shift()()}var n={},r={7:0},a={7:0};function o(t){if(n[t])return n[t].exports;var r=n[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,o),r.l=!0,r.exports}o.e=function(e){var t=[];r[e]?t.push(r[e]):0!==r[e]&&{29:1}[e]&&t.push(r[e]=new Promise((function(t,n){for(var a="rtl"===document.dir?({29:"vendors~swiper"}[e]||e)+"."+{29:"ca03362195b614e03692"}[e]+".rtl.css":({29:"vendors~swiper"}[e]||e)+"."+{29:"ca03362195b614e03692"}[e]+".css",c=o.p+a,i=document.getElementsByTagName("link"),l=0;l<i.length;l++){var s=(p=i[l]).getAttribute("data-href")||p.getAttribute("href");if("stylesheet"===p.rel&&(s===a||s===c))return t()}var u=document.getElementsByTagName("style");for(l=0;l<u.length;l++){var p;if((s=(p=u[l]).getAttribute("data-href"))===a||s===c)return t()}var d=document.createElement("link");d.rel="stylesheet",d.type="text/css",d.setAttribute("data-webpack",!0),d.onload=t,d.onerror=function(t){var a=t&&t.target&&t.target.src||c,o=new Error("Loading CSS chunk "+e+" failed.\n("+a+")");o.code="CSS_CHUNK_LOAD_FAILED",o.request=a,delete r[e],d.parentNode.removeChild(d),n(o)},d.href=c,document.getElementsByTagName("head")[0].appendChild(d)})).then((function(){r[e]=0})));var n=a[e];if(0!==n)if(n)t.push(n[2]);else{var c=new Promise((function(t,r){n=a[e]=[t,r]}));t.push(n[2]=c);var i,l=document.createElement("script");l.charset="utf-8",l.timeout=120,o.nc&&l.setAttribute("nonce",o.nc),l.src=function(e){return o.p+""+({29:"vendors~swiper"}[e]||e)+"."+{29:"ca03362195b614e03692"}[e]+".js"}(e);var s=new Error;i=function(t){l.onerror=l.onload=null,clearTimeout(u);var n=a[e];if(0!==n){if(n){var r=t&&("load"===t.type?"missing":t.type),o=t&&t.target&&t.target.src;s.message="Loading chunk "+e+" failed.\n("+r+": "+o+")",s.name="ChunkLoadError",s.type=r,s.request=o,n[1](s)}a[e]=void 0}};var u=setTimeout((function(){i({type:"timeout",target:l})}),12e4);l.onerror=l.onload=i,document.head.appendChild(l)}return Promise.all(t)},o.m=e,o.c=n,o.d=function(e,t,n){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)o.d(n,r,function(t){return e[t]}.bind(null,r));return n},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o.oe=function(e){throw console.error(e),e};var c=window.webpackJsonpJetpack=window.webpackJsonpJetpack||[],i=c.push.bind(c);c.push=t,c=c.slice();for(var l=0;l<c.length;l++)t(c[l]);var s=i;return o(o.s=459)}([function(e,t){e.exports=window.wp.element},function(e,t){e.exports=window.wp.i18n},function(e,t){e.exports=window.wp.components},function(e,t){e.exports=window.lodash},function(e,t,n){var r=n(5);function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}e.exports=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?a(Object(n),!0).forEach((function(t){r(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}},function(e,t){e.exports=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writab
2020-05-06 17:20:49 +02:00
/*!
2021-07-23 11:58:50 +02:00
Copyright (c) 2018 Jed Watson.
2020-05-06 17:20:49 +02:00
Licensed under the MIT License (MIT), see
http://jedwatson.github.io/classnames
2021-07-23 11:58:50 +02:00
*/!function(){"use strict";var n={}.hasOwnProperty;function a(){for(var e=[],t=0;t<arguments.length;t++){var r=arguments[t];if(r){var o=typeof r;if("string"===o||"number"===o)e.push(r);else if(Array.isArray(r)){if(r.length){var c=a.apply(null,r);c&&e.push(c)}}else if("object"===o)if(r.toString===Object.prototype.toString)for(var i in r)n.call(r,i)&&r[i]&&e.push(i);else e.push(r.toString())}}return e.join(" ")}e.exports?(a.default=a,e.exports=a):void 0===(r=function(){return a}.apply(t,[]))||(e.exports=r)}()},function(e,t,n){var r=n(115),a=n(116),o=n(75),c=n(117);e.exports=function(e,t){return r(e)||a(e,t)||o(e,t)||c()}},function(e,t){e.exports=window.wp.data},function(e,t){e.exports=window.wp.blocks},function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},function(e,t,n){var r=n(159);e.exports=function(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}}),t&&r(e,t)}},function(e,t,n){var r=n(160),a=n(161),o=n(162);e.exports=function(e){var t=a();return function(){var n,a=r(e);if(t){var c=r(this).constructor;n=Reflect.construct(a,arguments,c)}else n=a.apply(this,arguments);return o(this,n)}}},function(e,t){function n(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}e.exports=function(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e}},function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(106),a=n(23),o=r.a["Jetpack Green 40"];function c(){return Object(a.a)()||Object(a.c)()?"#1e1e1e":o}},function(e,t){e.exports=window.wp.compose},function(e,t){e.exports=window.React},function(e,t,n){var r=n(123),a=n(124),o=n(75),c=n(125);e.exports=function(e){return r(e)||a(e)||o(e)||c()}},function(e,t,n){"use strict";n.d(t,"b",(function(){return m})),n.d(t,"a",(function(){return f}));var r=n(4),a=n.n(r),o=n(1),c=n(31),i=n(11),l=n(183),s=n(49),u=n(107),p={paid:Object(o._x)("paid","Short label appearing near a block requiring a paid plan","jetpack"),beta:Object(o.__)("beta","jetpack")},d=l.beta||[];function m(e,t){return"missing_plan"===e&&t.required_plan}function b(e){var t=[];return d.includes(e)&&t.push(p.beta),t}function h(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return t.length?"".concat(e," (").concat(t.join(", "),")"):e}function f(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],o=Object(s.a)(e),l=o.available,p=o.details,d=o.unavailableReason,f=m(d,p),g=r?"jetpack/":"";if(!l&&!f)return!1;var j=Object(i.registerBlockType)(g+e,a()(a()({},t),{},{title:h(t.title,b(e))}));return f&&Object(c.addFilter)("editor.BlockListBlock","".concat(g+e,"-with-has-warning-is-interactive-class-names"),Object(u.a)(g+e)),n.forEach((function(e){return Object(i.registerBlockType)(g+e.name,e.settings)})),j}},function(e,t){function n(){return e.exports=n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},n.apply(this,arguments)}e.exports=n},function(e,t){e.exports=window.wp.apiFetch},function(e,t,n){"use strict";n.d(t,"c",(function(){return c})),n.d(t,"a",(function(){return i})),n.d(t,"b",(function(){return l}));var r=n(3),a=n(46);function o(){return"object"==typeof window&&"string"==typeof window._currentSiteType?window._currentSiteType:null}function c(){return"simple"===o()}function i(){return"atomic"===o()}function l(){return Object(r.get)(Object(a.a)(),["jetpack","is_private_site"],!1)}},function(e,t){e.exports=window.wp.keycodes},function(e,t,n){"use strict";var r=n(0),a=n(2);t.a=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:24,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:24,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"0 0 24 24";return Object(r.createElement)(a
2020-05-06 17:20:49 +02:00
/*
* Exposes number format capability
*
* @copyright Copyright (c) 2013 Kevin van Zonneveld (http://kvz.io) and Contributors (http://phpjs.org/authors).
* @license See CREDITS.md
* @see https://github.com/kvz/phpjs/blob/ffe1356af23a6f2512c84c954dd4e828e92579fa/functions/strings/number_format.js
2021-07-23 11:58:50 +02:00
*/function S(e,t,n,r){e=(e+"").replace(/[^0-9+\-Ee.]/g,"");var a=isFinite(+e)?+e:0,o=isFinite(+t)?Math.abs(t):0,c=void 0===r?",":r,i=void 0===n?".":n,l="";return(l=(o?function(e,t){var n=Math.pow(10,t);return""+(Math.round(e*n)/n).toFixed(t)}(a,o):""+Math.round(a)).split("."))[0].length>3&&(l[0]=l[0].replace(/\B(?=(?:\d{3})+(?!\d))/g,c)),(l[1]||"").length<o&&(l[1]=l[1]||"",l[1]+=new Array(o-l[1].length+1).join("0")),l.join(i)}var N=b()("i18n-calypso"),A="number_format_decimals",T="number_format_thousands_sep",P="messages",I=[function(e){return e}],M={};function R(){z.throwErrors&&"undefined"!=typeof window&&window.console&&window.console.warn&&window.console.warn.apply(window.console,arguments)}function B(e){return Array.prototype.slice.call(e)}function L(e){var t=e[0];("string"!=typeof t||e.length>3||e.length>2&&"object"==typeof e[1]&&"object"==typeof e[2])&&R("Deprecated Invocation: `translate()` accepts ( string, [string], [object] ). These arguments passed:",B(e),". See https://github.com/Automattic/i18n-calypso#translate-method"),2===e.length&&"string"==typeof t&&"string"==typeof e[1]&&R("Invalid Invocation: `translate()` requires an options object for plural translations, but passed:",B(e));for(var n={},r=0;r<e.length;r++)"object"==typeof e[r]&&(n=e[r]);if("string"==typeof t?n.original=t:"object"==typeof n.original&&(n.plural=n.original.plural,n.count=n.original.count,n.original=n.original.single),"string"==typeof e[1]&&(n.plural=e[1]),void 0===n.original)throw new Error("Translate called without a `string` value as first argument.");return n}function D(e,t){return e.dcnpgettext(P,t.context,t.original,t.plural,t.count)}function F(e,t){for(var n=I.length-1;n>=0;n--){var r=I[n](Object.assign({},t));if(e.state.locale[r.original])return D(e.state.tannin,r)}return null}function z(){if(!(this instanceof z))return new z;this.defaultLocaleSlug="en",this.defaultPluralForms=function(e){return 1===e?0:1},this.state={numberFormatSettings:{},tannin:void 0,locale:void 0,localeSlug:void 0,textDirection:void 0,translations:_()({max:100})},this.componentUpdateHooks=[],this.translateHooks=[],this.stateObserver=new w.EventEmitter,this.stateObserver.setMaxListeners(0),this.configure()}z.throwErrors=!1,z.prototype.on=function(){var e;(e=this.stateObserver).on.apply(e,arguments)},z.prototype.off=function(){var e;(e=this.stateObserver).off.apply(e,arguments)},z.prototype.emit=function(){var e;(e=this.stateObserver).emit.apply(e,arguments)},z.prototype.numberFormat=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n="number"==typeof t?t:t.decimals||0,r=t.decPoint||this.state.numberFormatSettings.decimal_point||".",a=t.thousandsSep||this.state.numberFormatSettings.thousands_sep||",";return S(e,n,r,a)},z.prototype.configure=function(e){Object.assign(this,e||{}),this.setLocale()},z.prototype.setLocale=function(e){var t,n,r;if(e&&e[""]&&e[""]["key-hash"]){var a=e[""]["key-hash"],o=function(e,t){var n=!1===t?"":String(t);if(void 0!==M[n+e])return M[n+e];var r=E()().update(e).digest("hex");return M[n+e]=t?r.substr(0,t):r},c=function(e){return function(t){return t.context?(t.original=o(t.context+String.fromCharCode(4)+t.original,e),delete t.context):t.original=o(t.original,e),t}};if("sha1"===a.substr(0,4))if(4===a.length)I.push(c(!1));else{var i=a.substr(5).indexOf("-");if(i<0){var l=Number(a.substr(5));I.push(c(l))}else for(var s=Number(a.substr(5,i)),u=Number(a.substr(6+i)),p=s;p<=u;p++)I.push(c(p))}}if(e&&e[""].localeSlug)if(e[""].localeSlug===this.state.localeSlug){if(e===this.state.locale)return;Object.assign(this.state.locale,e)}else this.state.locale=Object.assign({},e);else this.state.locale={"":{localeSlug:this.defaultLocaleSlug,plural_forms:this.defaultPluralForms}};this.state.localeSlug=this.state.locale[""].localeSlug,this.state.textDirection=(null===(t=this.state.locale["text directionltr"])||void 0===t?void 0:t[0])||(null===(n=this.state.locale[""])||void 0===n||null===(r=n.momentjs_locale)||void 0===r?void 0:r.textDirection),this.state.tannin=new O(d()({},P,this.state.locale)),this.state.numberFormatSe
2021-04-27 08:32:47 +02:00
/*!
2021-07-23 11:58:50 +02:00
Copyright (c) 2018 Jed Watson.
2021-04-27 08:32:47 +02:00
Licensed under the MIT License (MIT), see
http://jedwatson.github.io/classnames
2021-07-23 11:58:50 +02:00
*/!function(){"use strict";var n=function(){function e(){}function t(e,t){for(var n=t.length,r=0;r<n;++r)a(e,t[r])}e.prototype=Object.create(null);var n={}.hasOwnProperty;var r=/\s+/;function a(e,a){if(a){var o=typeof a;"string"===o?function(e,t){for(var n=t.split(r),a=n.length,o=0;o<a;++o)e[n[o]]=!0}(e,a):Array.isArray(a)?t(e,a):"object"===o?function(e,t){if(t.toString===Object.prototype.toString)for(var r in t)n.call(t,r)&&(e[r]=!!t[r]);else e[t.toString()]=!0}(e,a):"number"===o&&function(e,t){e[t]=!0}(e,a)}}return function(){for(var n=arguments.length,r=Array(n),a=0;a<n;a++)r[a]=arguments[a];var o=new e;t(o,r);var c=[];for(var i in o)o[i]&&c.push(i);return c.join(" ")}}();e.exports?(n.default=n,e.exports=n):void 0===(r=function(){return n}.apply(t,[]))||(e.exports=r)}()},function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(9),a=n.n(r),o=n(11);function c(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return void 0!==o.createBlocksFromInnerBlocksTemplate?Object(o.createBlocksFromInnerBlocksTemplate)(e):e.map((function(e){var t=Array.isArray(e)?e:[e.name,e.attributes,e.innerBlocks],n=a()(t,3),r=n[0],i=n[1],l=n[2],s=void 0===l?[]:l;return Object(o.createBlock)(r,i,c(s))}))}},function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){var r=n(138);e.exports=function(e,t){if(e){if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){"use strict";function r(e){return function(){return e}}var a=function(){};a.thatReturns=r,a.thatReturnsFalse=r(!1),a.thatReturnsTrue=r(!0),a.thatReturnsNull=r(null),a.thatReturnsThis=function(){return this},a.thatReturnsArgument=function(e){return e},e.exports=a},function(e,t){"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}},function(e,t){function n(e,t){if(!e)throw new Error(t||"Assertion failed")}e.exports=n,n.equal=function(e,t,n){if(e!=t)throw new Error(n||"Assertion failed: "+e+" != "+t)}},function(e,t,n){var r=n(217),a=n(218),o=n(139),c=n(219);e.exports=function(e){return r(e)||a(e)||o(e)||c()},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r="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},a=i(n(18)),o=i(n(220)),c=i(n(223));function i(e){return e&&e.__esModule?e:{default:e}}var l=void 0;function s(e,t){var n,c,i,u,p,d,m,b,h=[],f={};for(d=0;d<e.length;d++)if("string"!==(p=e[d]).type){if(!t.hasOwnProperty(p.value)||void 0===t[p.value])throw new Error("Invalid interpolation, missing component node: `"+p.value+"`");if("object"!==r(t[p.value]))throw new Error("Invalid interpolation, component node must be a ReactElement or null: `"+p.value+"`","\n> "+l);if("componentClose"===p.type)throw new Error("Missing opening component token: `"+p.value+"`");if("componentOpen"===p.type){n=t[p.value],i=d;break}h.push(t[p.value])}else h.push(p.value);return n&&(u=function(e,t){var n,r,a=t[e],o=0;for(r=e+1;r<t.length;r++)if((n=t[r]).value===a.value){if("componentOpen"===n.type){o++;continue}if("componentClose"===n.type){if(0===o)return r;o--}}throw new Error("Missing closing component token `"+a.value+"`")}(i,e),m=s(e.slice(i+1,u),t),c=a.default.cloneElement(n,{},m),h.push(c),u<e.length-1&&(b=s(e.slice(u+1),t),h=h.concat(b))),1===h.length?h[0]:(h.forEach((function(e,t){e
/** @license React vundefined
* use-subscription.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var r=n(232),a=n(18);t.useSubscription=function(e){var t=e.getCurrentValue,n=e.subscribe,o=a.useState((function(){return{getCurrentValue:t,subscribe:n,value:t()}}));e=o[0];var c=o[1];return o=e.value,e.getCurrentValue===t&&e.subscribe===n||(o=t(),c({getCurrentValue:t,subscribe:n,value:o})),a.useDebugValue(o),a.useEffect((function(){function e(){if(!a){var e=t();c((function(a){return a.getCurrentValue!==t||a.subscribe!==n||a.value===e?a:r({},a,{value:e})}))}}var a=!1,o=n(e);return e(),function(){a=!0,o()}}),[t,n]),o}},function(e,t,n){"use strict";
2021-04-27 08:32:47 +02:00
/*
object-assign
(c) Sindre Sorhus
@license MIT
2021-07-23 11:58:50 +02:00
*/var r=Object.getOwnPropertySymbols,a=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable;function c(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(a){return!1}}()?Object.assign:function(e,t){for(var n,i,l=c(e),s=1;s<arguments.length;s++){for(var u in n=Object(arguments[s]))a.call(n,u)&&(l[u]=n[u]);if(r){i=r(n);for(var p=0;p<i.length;p++)o.call(n,i[p])&&(l[i[p]]=n[i[p]])}}return l}},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){"use strict";var r=n(10),a=n(5),o=n.n(a),c=n(4),i=n.n(c),l=n(32),s={sources:{},default:null},u={getDefaultMediaSource:function(e){var t=null,n=Object.keys(e.sources);if(e.default?t=e.default:null!=n&&n.length&&(t=e.sources[n[0]].id),t)return e.sources[t]},getMediaPlayerState:function(e,t){var n,r=t?null===(n=e.sources)||void 0===n?void 0:n[t]:u.getDefaultMediaSource(e);return null==r?void 0:r.state},getMediaSourceCurrentTime:function(e,t){var n,r=t?null===(n=e.sources)||void 0===n?void 0:n[t]:u.getDefaultMediaSource(e);return null==r?void 0:r.currentTime},getMediaSourceDuration:function(e,t){var n,r;if(!t){var a=u.getDefaultMediaSource(e);return null==a?void 0:a.duration}return null===(n=e.sources)||void 0===n||null===(r=n[t])||void 0===r?void 0:r.duration},getMediaSourceDomReference:function(e,t){var n,r=t?null===(n=e.sources)||void 0===n?void 0:n[t]:u.getDefaultMediaSource(e);if(r){var a=null==r?void 0:r.domId;if(a)return document.getElementById(a)}}},p={reducer:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:s,n=arguments.length>1?arguments[1]:void 0,r=n.id||t.default||(null===(e=Object.keys(t.sources))||void 0===e?void 0:e[0]);switch(n.type){case"REGISTER_MEDIA_SOURCE":return i()(i()({},t),{},{sources:i()(i()({},t.sources),{},o()({},n.id,i()({id:n.id},n.mediaSourceState)))});case"UPDATE_MEDIA_SOURCE_DATA":return i()(i()({},t),{},{sources:i()(i()({},t.sources),{},o()({},n.id,i()(i()({},t.sources[n.id]),n.data)))});case"UNREGISTER_MEDIA_SOURCE":var a,c=Object.assign({},t);if(c.sources[n.id]&&delete c.sources[n.id],n.id===t.default)c.default=null===(a=Object.keys(t.sources))||void 0===a?void 0:a[0];return c;case"SET_DEFAULT_MEDIA_SOURCE":return i()(i()({},t),{},{default:n.id});case"SET_MEDIA_PLAYER_STATE":return i()(i()({},t),{},{sources:i()(i()({},t.sources),{},o()({},r,i()(i()({},t.sources[r]),{},{state:n.state})))});case"TOGGLE_MEDIA_PLAYER_STATE":return i()(i()({},t),{},{sources:i()(i()({},t.sources),{},o()({},r,i()(i()({},t.sources[r]),{},{state:t.sources[r].state===l.c?l.b:l.c})))});case"SET_MEDIA_PLAYER_CURRENT_TIME":return i()(i()({},t),{},{sources:i()(i()({},t.sources),{},o()({},r,i()(i()({},t.sources[r]),{},{currentTime:n.currentTime})))})}return t},actions:{registerMediaSource:function(e,t){return{type:"REGISTER_MEDIA_SOURCE",id:e,mediaSourceState:t}},updateMediaSourceData:function(e,t){return{type:"UPDATE_MEDIA_SOURCE_DATA",id:e,data:t}},unregisterMediaSource:function(e){return{type:"UNREGISTER_MEDIA_SOURCE",id:e}},setDefaultMediaSource:function(e){return{type:"SET_DEFAULT_MEDIA_SOURCE",id:e}},playMediaSource:function(e){return{type:"SET_MEDIA_PLAYER_STATE",id:e,state:l.c}},toggleMediaSource:function(e){return{type:"TOGGLE_MEDIA_PLAYER_STATE",id:e}},pauseMediaSource:function(e){return{type:"SET_MEDIA_PLAYER_STATE",id:e,state:l.b}},errorMediaSource:function(e){return{type:"SET_MEDIA_PLAYER_STATE",id:e,state:l.a}},setMediaSourceCurrentTime:function(e,t){return{type:"SET_MEDIA_PLAYER_CURRENT_TIME",id:e,currentTime:t}}},selectors:u};