mediacms/static/js/embed.js

1 line
42 KiB
JavaScript
Raw Permalink Normal View History

!function(){"use strict";var e,t={3170:function(e,t,n){var r,i,a,o=n(5466),l=n(6116);n(1394),n(5063),n(4083),n(6191),r="page-embed",i=n(645).EmbedPage,(a=document.getElementById(r))&&i&&l.render(o.createElement(i,null),a)},7714:function(e,t,n){n.d(t,{M:function(){return l}}),n(4517);var r=n(5466),i=n(3074),a=n.n(i);function o(){return(o=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}).apply(this,arguments)}function l(e){var t=r.createElement("span",null,r.createElement("span",null,e.children)),n={tabIndex:e.tabIndex||null,title:e.title||null,className:"circle-icon-button"+(void 0!==e.className?" "+e.className:"")+(e.buttonShadow?" button-shadow":"")};return void 0!==e["data-page-id"]&&(n["data-page-id"]=e["data-page-id"]),void 0!==e["aria-label"]&&(n["aria-label"]=e["aria-label"]),"link"===e.type?r.createElement("a",o({},n,{href:e.href||null,rel:e.rel||null}),t):"span"===e.type?r.createElement("span",o({},n,{onClick:e.onClick||null}),t):r.createElement("button",o({},n,{onClick:e.onClick||null}),t)}l.propTypes={type:a().oneOf(["button","link","span"]),buttonShadow:a().bool,className:a().string},l.defaultProps={type:"button",buttonShadow:!1}},4234:function(e,t,n){n.d(t,{CircleIconButton:function(){return r.M}});var r=n(7714);n(7446),n(2915),n(2299),n(2917),n(5671),n(2436),n(5517),n(940),n(6309),n(6142)},2299:function(e,t,n){n.d(t,{O:function(){return i}});var r=n(5466),i=function(e){var t=e.type;return t?r.createElement("i",{className:"material-icons","data-icon":t}):null}},2917:function(e,t,n){n(3233),n(9751),n(2004),n(8407),n(6394),n(8288),n(5677),n(2129),n(4655),n(288),n(4458),n(3675);var r=n(5466),i=n(6116),a=n(3074),o=n.n(a);function l(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}function s(e){var t,n,a=(0,r.useRef)(null),o=(t=(0,r.useState)(null),n=2,function(e){if(Array.isArray(e))return e}(t)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,a=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(a.push(r.value),!t||a.length!==t);o=!0);}catch(e){l=!0,i=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw i}}return a}}(t,n)||function(e,t){if(e){if("string"==typeof e)return l(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)?l(e,t):void 0}}(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),s=o[0],u=o[1],d=[];function c(t,n){var r;n.preventDefault(),n.stopPropagation(),r=d[t].id,void 0!==e.pages[r]&&u(r)}return(0,r.useEffect)((function(){void 0!==e.pages[e.initPage]?u(e.initPage):Object.keys(e.pages).length?u(Object.keys(e.pages)[0]):u(null)}),[e.initPage]),(0,r.useEffect)((function(){!function(){for(var e=0;e<d.length;)d[e].elem.removeEventListener("click",d[e].listener),e+=1;d=[]}(),s&&(function(){var t,n,r=(0,i.findDOMNode)(a.current),o=r.querySelectorAll(e.pageChangeSelector);if(o.length)for(t=0;t<o.length;)(n=(n=o[t].getAttribute(e.pageIdSelectorAttr))?n.trim():n)&&(d[t]={id:n,elem:o[t]},d[t].listener=function(e){return function(t){return c(e,t)}}(t),d[t].elem.addEventListener("click",d[t].listener)),t+=1;e.focusFirstItemOnPageChange&&r.focus()}(),"function"==typeof e.pageChangeCallback&&e.pageChangeCallback(s))}),[s]),s?r.createElement("div",{ref:a},r.cloneElement(e.pages[s])):null}s.propTypes={initPage:o().string,pages:o().object.isRequired,pageChangeSelector:o().string.isRequired,pageIdSelectorAttr:o().string.isRequired,focusFirstItemOnPageChange:o().bool,pageChangeCallback:o().func},s.defaultProps={focusFirstItemOnPageChange:!0}},5671:function(e,t,n){n(9808),n(3233),n(2070),n(4517);var r=n(5466),i=n(3074),a=n.n(i),o=n(2299);function l(){return(l=Object.assign||function(e){