mediacms/static/js/embed.js

1 line
43 KiB
JavaScript
Raw Normal View History

!function(){"use strict";var e,t={3170:function(e,t,n){var r,i,a,o=n(35466),l=n(46116);n(51394),n(45063),n(34083),n(36191),r="page-embed",i=n(645).EmbedPage,(a=document.getElementById(r))&&i&&l.render(o.createElement(i,null),a)},17714:function(e,t,n){n.d(t,{M:function(){return l}}),n(74517);var r=n(35466),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}},84234:function(e,t,n){n.d(t,{CircleIconButton:function(){return r.M}});var r=n(17714);n(47446),n(2915),n(2299),n(72917),n(5671),n(72436),n(15517),n(60940),n(26309),n(86142)},2299:function(e,t,n){n.d(t,{O:function(){return i}});var r=n(35466),i=function(e){var t=e.type;return t?r.createElement("i",{className:"material-icons","data-icon":t}):null}},72917:function(e,t,n){n(13233),n(99751),n(52004),n(28407),n(56394),n(38288),n(55677),n(92129),n(24655),n(20288),n(54458),n(23675);var r=n(35466),i=n(46116),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(59808),n(13233),n(92070),n(74517);var r=n(35466),i=n(3074),a=n.n(i),o=n(2299);function