(()=>{"use strict";var e,t={832(){const e=window.wp.blocks,t=window.wp.blockEditor,n=window.wp.element,i=window.wp.components,o=window.wp.data,r=window.wp.i18n;function s(e){var t,n,i="";if("string"==typeof e||"number"==typeof e)i+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=s(e[t]))&&(i&&(i+=" "),i+=n)}else for(n in e)e[n]&&(i&&(i+=" "),i+=n);return i}const l=function(){for(var e,t,n=0,i="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=s(e))&&(i&&(i+=" "),i+=t);return i};function a(e){return!e||"center center"===e}function c(e){if(!e)return e;const t=Object.entries(e).map(([e,t])=>{if(null==t||""===t)return[];if("object"==typeof t&&!Array.isArray(t)){const n=c(t);return n&&0!==Object.keys(n).length?[e,n]:[]}return[e,t]}).filter(e=>e.length>0);return 0!==t.length?Object.fromEntries(t):void 0}const p=window.ReactJSXRuntime,u=JSON.parse('{"UU":"clanbite/player-cover"}');(0,e.registerBlockType)(u.UU,{edit:function({attributes:e,clientId:s,context:{postId:u,postType:d},setAttributes:h,toggleSelection:f}){const{contentPosition:g,id:v,minHeight:m,minHeightUnit:b,allowedBlocks:w,templateLock:k}=e,[y,j]=(0,n.useState)(m),[x,O]=(0,n.useState)(b),[B,_]=(0,n.useState)(!1),H="vh"===b&&100===m&&!e?.style?.dimensions?.aspectRatio,U=(0,o.useSelect)(e=>e(t.store).getBlock(s).innerBlocks.length>0,[s]),A=(0,n.useRef)(),C=l({"has-custom-content-position":!a(g)},function(e){var t;if(!e)return"";const n=e.split(" "),i=n[0],o=null!==(t=n[1])&&void 0!==t?t:n[0],r=[];return i&&r.push(`is-position-${i}`),o&&o!==i&&r.push(`is-position-${o}`),r.join(" ")}(g)),S=(0,t.useBlockProps)({ref:A}),I=(0,t.useInnerBlocksProps)({className:"player-cover__inner-container"},{template:U?void 0:[],templateInsertUpdatesSelection:!0,allowedBlocks:w,templateLock:k});return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)(t.BlockControls,{group:"block",children:[(0,p.jsx)(t.__experimentalBlockAlignmentMatrixControl,{label:(0,r.__)("Change content position"),value:g,onChange:e=>h({contentPosition:e}),isDisabled:!U}),(0,p.jsx)(t.__experimentalBlockFullHeightAligmentControl,{isActive:H,onToggle:()=>H?h("vh"===x&&100===y?{minHeight:void 0,minHeightUnit:void 0}:{minHeight:y,minHeightUnit:x}):(j(m),O(b),h({minHeight:100,minHeightUnit:"vh",style:c({...e?.style,dimensions:{...e?.style?.dimensions,aspectRatio:void 0}})})),isDisabled:!U})]}),(0,p.jsxs)("div",{...S,className:l(C,S.className),children:[(0,p.jsx)(i.Placeholder,{className:"player-cover__image-background--placeholder-image",withIllustration:!0}),(0,p.jsx)("div",{...I})]})]})},save:function(){return(0,p.jsx)(t.InnerBlocks.Content,{})}})}},n={};function i(e){var o=n[e];if(void 0!==o)return o.exports;var r=n[e]={exports:{}};return t[e](r,r.exports,i),r.exports}i.m=t,e=[],i.O=(t,n,o,r)=>{if(!n){var s=1/0;for(p=0;p<e.length;p++){for(var[n,o,r]=e[p],l=!0,a=0;a<n.length;a++)(!1&r||s>=r)&&Object.keys(i.O).every(e=>i.O[e](n[a]))?n.splice(a--,1):(l=!1,r<s&&(s=r));if(l){e.splice(p--,1);var c=o();void 0!==c&&(t=c)}}return t}r=r||0;for(var p=e.length;p>0&&e[p-1][2]>r;p--)e[p]=e[p-1];e[p]=[n,o,r]},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={3466:0,5806:0};i.O.j=t=>0===e[t];var t=(t,n)=>{var o,r,[s,l,a]=n,c=0;if(s.some(t=>0!==e[t])){for(o in l)i.o(l,o)&&(i.m[o]=l[o]);if(a)var p=a(i)}for(t&&t(n);c<s.length;c++)r=s[c],i.o(e,r)&&e[r]&&e[r][0](),e[r]=0;return i.O(p)},n=globalThis.webpackChunkclanbite=globalThis.webpackChunkclanbite||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))})();var o=i.O(void 0,[5806],()=>i(832));o=i.O(o)})();