Jake Vanderwerf
2026-05-31 97e7c319d656a5f05489ca996e249e7359303d4d
build/video/index.js
@@ -1 +1,586 @@
(()=>{"use strict";var e,t={747:()=>{const e=window.wp.blocks,t=window.wp.blockEditor,o=window.wp.i18n,l=window.wp.components,r=window.ReactJSXRuntime,i=["video"],n=[["core/heading",{level:1,placeholder:"Add heading...",textAlign:"center"}],["core/paragraph",{placeholder:"Add description...",align:"center"}],["core/buttons",{layout:{type:"flex",justifyContent:"center"}}]];(0,e.registerBlockType)("jvb/video",{edit:function({attributes:e,setAttributes:s}){const{posterId:a,posterUrl:c,videoSources:d,fadeEffect:v,overlayOpacity:p,contentAlignment:h,minHeight:j}=e,b=(0,t.useBlockProps)({className:"video-cover-editor",style:{minHeight:j?`${j}px`:void 0}}),m=(0,t.useInnerBlocksProps)({className:"video-cover-content"},{template:n,templateLock:!1});return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(t.InspectorControls,{children:[(0,r.jsxs)(l.PanelBody,{title:(0,o.__)("Video Settings","jvb"),initialOpen:!0,children:[(0,r.jsx)(l.BaseControl,{label:(0,o.__)("Poster Image","jvb"),help:(0,o.__)("Image shown while video loads","jvb"),children:(0,r.jsx)(t.MediaUploadCheck,{children:(0,r.jsx)(t.MediaUpload,{onSelect:e=>{s({posterId:e.id,posterUrl:e.url})},allowedTypes:["image"],value:a,render:({open:e})=>(0,r.jsxs)(r.Fragment,{children:[c&&(0,r.jsx)("img",{src:c,alt:(0,o.__)("Poster preview","jvb"),style:{maxWidth:"100%",marginBottom:"10px"}}),(0,r.jsx)(l.Button,{onClick:e,variant:c?"secondary":"primary",children:c?(0,o.__)("Change Poster","jvb"):(0,o.__)("Select Poster","jvb")}),c&&(0,r.jsx)(l.Button,{isDestructive:!0,onClick:()=>s({posterId:0,posterUrl:""}),style:{marginLeft:"10px"},children:(0,o.__)("Remove","jvb")})]})})})}),(0,r.jsxs)(l.BaseControl,{label:(0,o.__)("Video Sources","jvb"),help:(0,o.__)("Add multiple formats for better browser support (mp4, webm, etc.)","jvb"),children:[d.length>0&&(0,r.jsx)("ul",{className:"video-source-list",children:d.map(((e,t)=>(0,r.jsxs)("li",{className:"video-source-item",children:[(0,r.jsx)("span",{className:"video-source-mime",children:e.mime}),(0,r.jsx)(l.Button,{isDestructive:!0,isSmall:!0,onClick:()=>(e=>{const t=[...d];t.splice(e,1),s({videoSources:t})})(t),children:(0,o.__)("Remove","jvb")})]},t)))}),(0,r.jsx)(t.MediaUploadCheck,{children:(0,r.jsx)(t.MediaUpload,{multiple:!0,onSelect:e=>{const t=(Array.isArray(e)?e:[e]).filter((e=>!d.some((t=>t.id===e.id)))).map((e=>({id:e.id,url:e.url,mime:e.mime})));t.length&&s({videoSources:[...d,...t]})},allowedTypes:i,render:({open:e})=>(0,r.jsx)(l.Button,{onClick:e,variant:"secondary",children:(0,o.__)("Add Video","jvb")})})})]}),(0,r.jsx)(l.ToggleControl,{label:(0,o.__)("Fade Effect","jvb"),help:(0,o.__)("Add fade class to video element","jvb"),checked:v,onChange:e=>s({fadeEffect:e})})]}),(0,r.jsxs)(l.PanelBody,{title:(0,o.__)("Overlay Settings","jvb"),initialOpen:!0,children:[(0,r.jsx)(l.RangeControl,{label:(0,o.__)("Overlay Opacity","jvb"),help:(0,o.__)("Darken video for better text readability","jvb"),value:p,onChange:e=>s({overlayOpacity:e}),min:0,max:100,step:5}),(0,r.jsx)(l.SelectControl,{label:(0,o.__)("Content Alignment","jvb"),value:h,options:[{label:(0,o.__)("Top Left","jvb"),value:"top-left"},{label:(0,o.__)("Top Center","jvb"),value:"top-center"},{label:(0,o.__)("Top Right","jvb"),value:"top-right"},{label:(0,o.__)("Center Left","jvb"),value:"center-left"},{label:(0,o.__)("Center","jvb"),value:"center"},{label:(0,o.__)("Center Right","jvb"),value:"center-right"},{label:(0,o.__)("Bottom Left","jvb"),value:"bottom-left"},{label:(0,o.__)("Bottom Center","jvb"),value:"bottom-center"},{label:(0,o.__)("Bottom Right","jvb"),value:"bottom-right"}],onChange:e=>s({contentAlignment:e})}),(0,r.jsx)(l.RangeControl,{label:(0,o.__)("Minimum Height","jvb"),help:(0,o.__)("Minimum height in pixels (leave 0 for auto)","jvb"),value:j,onChange:e=>s({minHeight:e}),min:0,max:1e3,step:50})]})]}),(0,r.jsx)("div",{...b,children:c||d.length>0?(0,r.jsxs)("div",{className:"video-cover-preview",children:[c&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("img",{src:c,alt:(0,o.__)("Video poster","jvb")}),p>0&&(0,r.jsx)("div",{className:"video-overlay-preview",style:{opacity:p/100}})]}),(0,r.jsx)("div",{className:`video-cover-content-preview align-${h}`,children:(0,r.jsx)("div",{...m})}),(0,r.jsx)("div",{className:"video-info",children:(0,r.jsxs)("p",{children:[d.length," ",(0,o.__)("desktop source(s)","jvb")]})})]}):(0,r.jsx)("div",{className:"video-cover-placeholder",children:(0,r.jsx)("p",{children:(0,o.__)("Configure video sources in the sidebar →","jvb")})})})]})},save:({attributes:e})=>{const o=t.useBlockProps.save({className:"video-cover-wrapper-placeholder"});return(0,r.jsx)("div",{...o,children:(0,r.jsx)(t.InnerBlocks.Content,{})})}})}},o={};function l(e){var r=o[e];if(void 0!==r)return r.exports;var i=o[e]={exports:{}};return t[e](i,i.exports,l),i.exports}l.m=t,e=[],l.O=(t,o,r,i)=>{if(!o){var n=1/0;for(d=0;d<e.length;d++){for(var[o,r,i]=e[d],s=!0,a=0;a<o.length;a++)(!1&i||n>=i)&&Object.keys(l.O).every((e=>l.O[e](o[a])))?o.splice(a--,1):(s=!1,i<n&&(n=i));if(s){e.splice(d--,1);var c=r();void 0!==c&&(t=c)}}return t}i=i||0;for(var d=e.length;d>0&&e[d-1][2]>i;d--)e[d]=e[d-1];e[d]=[o,r,i]},l.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={205:0,601:0};l.O.j=t=>0===e[t];var t=(t,o)=>{var r,i,[n,s,a]=o,c=0;if(n.some((t=>0!==e[t]))){for(r in s)l.o(s,r)&&(l.m[r]=s[r]);if(a)var d=a(l)}for(t&&t(o);c<n.length;c++)i=n[c],l.o(e,i)&&e[i]&&e[i][0](),e[i]=0;return l.O(d)},o=globalThis.webpackChunkjvb=globalThis.webpackChunkjvb||[];o.forEach(t.bind(null,0)),o.push=t.bind(null,o.push.bind(o))})();var r=l.O(void 0,[601],(()=>l(747)));r=l.O(r)})();
/******/ (() => { // webpackBootstrap
/******/    "use strict";
/******/    var __webpack_modules__ = ({
/***/ "./src/video/edit.js"
/*!***************************!*\
  !*** ./src/video/edit.js ***!
  \***************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ Edit)
/* harmony export */ });
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor");
/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _editor_scss__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./editor.scss */ "./src/video/editor.scss");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__);
//edit.js
const ALLOWED_VIDEO_TYPES = ['video'];
const INNER_BLOCKS_TEMPLATE = [['core/heading', {
  level: 1,
  placeholder: 'Add heading...',
  textAlign: 'center'
}], ['core/paragraph', {
  placeholder: 'Add description...',
  align: 'center'
}], ['core/buttons', {
  layout: {
    type: 'flex',
    justifyContent: 'center'
  }
}]];
function Edit({
  attributes,
  setAttributes
}) {
  const {
    posterId,
    posterUrl,
    videoSources,
    fadeEffect,
    overlayOpacity,
    contentAlignment,
    minHeight
  } = attributes;
  const blockProps = (0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.useBlockProps)({
    className: 'video-cover-editor',
    style: {
      minHeight: minHeight ? `${minHeight}px` : undefined
    }
  });
  const innerBlocksProps = (0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.useInnerBlocksProps)({
    className: 'video-cover-content'
  }, {
    template: INNER_BLOCKS_TEMPLATE,
    templateLock: false
  });
  const onSelectPoster = media => {
    setAttributes({
      posterId: media.id,
      posterUrl: media.url
    });
  };
  const onSelectVideos = mediaItems => {
    // multiple=true returns an array
    const items = Array.isArray(mediaItems) ? mediaItems : [mediaItems];
    const newSources = items.filter(media => !videoSources.some(s => s.id === media.id)).map(media => ({
      id: media.id,
      url: media.url,
      mime: media.mime
    }));
    if (newSources.length) {
      setAttributes({
        videoSources: [...videoSources, ...newSources]
      });
    }
  };
  const removeVideoSource = index => {
    const updated = [...videoSources];
    updated.splice(index, 1);
    setAttributes({
      videoSources: updated
    });
  };
  const renderVideoSourceList = (sources, isMobile = false) => {
    if (sources.length === 0) return null;
    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("ul", {
      className: "video-source-list",
      children: sources.map((source, index) => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("li", {
        className: "video-source-item",
        children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("span", {
          className: "video-source-mime",
          children: source.mime
        }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.Button, {
          isDestructive: true,
          isSmall: true,
          onClick: () => removeVideoSource(index, isMobile),
          children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Remove', 'jvb')
        })]
      }, index))
    });
  };
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.Fragment, {
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.InspectorControls, {
      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.PanelBody, {
        title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Video Settings', 'jvb'),
        initialOpen: true,
        children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.BaseControl, {
          label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Poster Image', 'jvb'),
          help: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Image shown while video loads', 'jvb'),
          children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.MediaUploadCheck, {
            children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.MediaUpload, {
              onSelect: onSelectPoster,
              allowedTypes: ['image'],
              value: posterId,
              render: ({
                open
              }) => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.Fragment, {
                children: [posterUrl && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("img", {
                  src: posterUrl,
                  alt: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Poster preview', 'jvb'),
                  style: {
                    maxWidth: '100%',
                    marginBottom: '10px'
                  }
                }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.Button, {
                  onClick: open,
                  variant: posterUrl ? 'secondary' : 'primary',
                  children: posterUrl ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Change Poster', 'jvb') : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Select Poster', 'jvb')
                }), posterUrl && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.Button, {
                  isDestructive: true,
                  onClick: () => setAttributes({
                    posterId: 0,
                    posterUrl: ''
                  }),
                  style: {
                    marginLeft: '10px'
                  },
                  children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Remove', 'jvb')
                })]
              })
            })
          })
        }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.BaseControl, {
          label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Video Sources', 'jvb'),
          help: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Add multiple formats for better browser support (mp4, webm, etc.)', 'jvb'),
          children: [videoSources.length > 0 && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("ul", {
            className: "video-source-list",
            children: videoSources.map((source, index) => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("li", {
              className: "video-source-item",
              children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("span", {
                className: "video-source-mime",
                children: source.mime
              }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.Button, {
                isDestructive: true,
                isSmall: true,
                onClick: () => removeVideoSource(index),
                children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Remove', 'jvb')
              })]
            }, index))
          }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.MediaUploadCheck, {
            children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.MediaUpload, {
              multiple: true,
              onSelect: onSelectVideos,
              allowedTypes: ALLOWED_VIDEO_TYPES,
              render: ({
                open
              }) => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.Button, {
                onClick: open,
                variant: "secondary",
                children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Add Video', 'jvb')
              })
            })
          })]
        }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.ToggleControl, {
          label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Fade Effect', 'jvb'),
          help: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Add fade class to video element', 'jvb'),
          checked: fadeEffect,
          onChange: value => setAttributes({
            fadeEffect: value
          })
        })]
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.PanelBody, {
        title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Overlay Settings', 'jvb'),
        initialOpen: true,
        children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.RangeControl, {
          label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Overlay Opacity', 'jvb'),
          help: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Darken video for better text readability', 'jvb'),
          value: overlayOpacity,
          onChange: value => setAttributes({
            overlayOpacity: value
          }),
          min: 0,
          max: 100,
          step: 5
        }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.SelectControl, {
          label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Content Alignment', 'jvb'),
          value: contentAlignment,
          options: [{
            label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Top Left', 'jvb'),
            value: 'top-left'
          }, {
            label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Top Center', 'jvb'),
            value: 'top-center'
          }, {
            label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Top Right', 'jvb'),
            value: 'top-right'
          }, {
            label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Center Left', 'jvb'),
            value: 'center-left'
          }, {
            label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Center', 'jvb'),
            value: 'center'
          }, {
            label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Center Right', 'jvb'),
            value: 'center-right'
          }, {
            label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Bottom Left', 'jvb'),
            value: 'bottom-left'
          }, {
            label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Bottom Center', 'jvb'),
            value: 'bottom-center'
          }, {
            label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Bottom Right', 'jvb'),
            value: 'bottom-right'
          }],
          onChange: value => setAttributes({
            contentAlignment: value
          })
        }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.RangeControl, {
          label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Minimum Height', 'jvb'),
          help: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Minimum height in pixels (leave 0 for auto)', 'jvb'),
          value: minHeight,
          onChange: value => setAttributes({
            minHeight: value
          }),
          min: 0,
          max: 1000,
          step: 50
        })]
      })]
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div", {
      ...blockProps,
      children: posterUrl || videoSources.length > 0 ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", {
        className: "video-cover-preview",
        children: [posterUrl && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.Fragment, {
          children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("img", {
            src: posterUrl,
            alt: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Video poster', 'jvb')
          }), overlayOpacity > 0 && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div", {
            className: "video-overlay-preview",
            style: {
              opacity: overlayOpacity / 100
            }
          })]
        }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div", {
          className: `video-cover-content-preview align-${contentAlignment}`,
          children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div", {
            ...innerBlocksProps
          })
        }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div", {
          className: "video-info",
          children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("p", {
            children: [videoSources.length, " ", (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('desktop source(s)', 'jvb')]
          })
        })]
      }) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div", {
        className: "video-cover-placeholder",
        children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("p", {
          children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Configure video sources in the sidebar →', 'jvb')
        })
      })
    })]
  });
}
/***/ },
/***/ "./src/video/index.js"
/*!****************************!*\
  !*** ./src/video/index.js ***!
  \****************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks");
/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor");
/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./style.scss */ "./src/video/style.scss");
/* harmony import */ var _edit__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./edit */ "./src/video/edit.js");
/* harmony import */ var _block_json__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./block.json */ "./src/video/block.json");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__);
/* index.js */
(0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__.registerBlockType)(_block_json__WEBPACK_IMPORTED_MODULE_4__.name, {
  edit: _edit__WEBPACK_IMPORTED_MODULE_3__["default"],
  save: ({
    attributes
  }) => {
    const blockProps = _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.useBlockProps.save({
      className: 'video-cover-wrapper-placeholder'
    });
    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("div", {
      ...blockProps,
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.InnerBlocks.Content, {})
    });
  }
});
/***/ },
/***/ "./src/video/editor.scss"
/*!*******************************!*\
  !*** ./src/video/editor.scss ***!
  \*******************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
__webpack_require__.r(__webpack_exports__);
// extracted by mini-css-extract-plugin
/***/ },
/***/ "./src/video/style.scss"
/*!******************************!*\
  !*** ./src/video/style.scss ***!
  \******************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
__webpack_require__.r(__webpack_exports__);
// extracted by mini-css-extract-plugin
/***/ },
/***/ "react/jsx-runtime"
/*!**********************************!*\
  !*** external "ReactJSXRuntime" ***!
  \**********************************/
(module) {
module.exports = window["ReactJSXRuntime"];
/***/ },
/***/ "@wordpress/block-editor"
/*!*************************************!*\
  !*** external ["wp","blockEditor"] ***!
  \*************************************/
(module) {
module.exports = window["wp"]["blockEditor"];
/***/ },
/***/ "@wordpress/blocks"
/*!********************************!*\
  !*** external ["wp","blocks"] ***!
  \********************************/
(module) {
module.exports = window["wp"]["blocks"];
/***/ },
/***/ "@wordpress/components"
/*!************************************!*\
  !*** external ["wp","components"] ***!
  \************************************/
(module) {
module.exports = window["wp"]["components"];
/***/ },
/***/ "@wordpress/i18n"
/*!******************************!*\
  !*** external ["wp","i18n"] ***!
  \******************************/
(module) {
module.exports = window["wp"]["i18n"];
/***/ },
/***/ "./src/video/block.json"
/*!******************************!*\
  !*** ./src/video/block.json ***!
  \******************************/
(module) {
module.exports = /*#__PURE__*/JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"jvb/video","version":"1.0.0","title":"Video Cover","category":"jvb","icon":"video-alt3","description":"Self-hosted video cover with poster and multiple format support","supports":{"html":false,"align":["wide","full"],"spacing":{"margin":true,"padding":true},"color":{"background":true,"text":true}},"attributes":{"title":{"type":"string","default":""},"description":{"type":"string","default":""},"posterId":{"type":"number","default":0},"posterUrl":{"type":"string","default":""},"videoSources":{"type":"array","default":[],"items":{"type":"object","properties":{"id":{"type":"number"},"url":{"type":"string"},"mime":{"type":"string"}}}},"fadeEffect":{"type":"boolean","default":false},"overlayOpacity":{"type":"number","default":0},"contentAlignment":{"type":"string","default":"center"},"minHeight":{"type":"number","default":0}},"textdomain":"jvb","editorScript":"file:./index.js","viewScript":"file:./view.js","editorStyle":"file:./index.css","style":"file:./style-index.css"}');
/***/ }
/******/    });
/************************************************************************/
/******/    // The module cache
/******/    var __webpack_module_cache__ = {};
/******/
/******/    // The require function
/******/    function __webpack_require__(moduleId) {
/******/       // Check if module is in cache
/******/       var cachedModule = __webpack_module_cache__[moduleId];
/******/       if (cachedModule !== undefined) {
/******/          return cachedModule.exports;
/******/       }
/******/       // Create a new module (and put it into the cache)
/******/       var module = __webpack_module_cache__[moduleId] = {
/******/          // no module.id needed
/******/          // no module.loaded needed
/******/          exports: {}
/******/       };
/******/
/******/       // Execute the module function
/******/       if (!(moduleId in __webpack_modules__)) {
/******/          delete __webpack_module_cache__[moduleId];
/******/          var e = new Error("Cannot find module '" + moduleId + "'");
/******/          e.code = 'MODULE_NOT_FOUND';
/******/          throw e;
/******/       }
/******/       __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
/******/
/******/       // Return the exports of the module
/******/       return module.exports;
/******/    }
/******/
/******/    // expose the modules object (__webpack_modules__)
/******/    __webpack_require__.m = __webpack_modules__;
/******/
/************************************************************************/
/******/    /* webpack/runtime/chunk loaded */
/******/    (() => {
/******/       var deferred = [];
/******/       __webpack_require__.O = (result, chunkIds, fn, priority) => {
/******/          if(chunkIds) {
/******/             priority = priority || 0;
/******/             for(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];
/******/             deferred[i] = [chunkIds, fn, priority];
/******/             return;
/******/          }
/******/          var notFulfilled = Infinity;
/******/          for (var i = 0; i < deferred.length; i++) {
/******/             var [chunkIds, fn, priority] = deferred[i];
/******/             var fulfilled = true;
/******/             for (var j = 0; j < chunkIds.length; j++) {
/******/                if ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {
/******/                   chunkIds.splice(j--, 1);
/******/                } else {
/******/                   fulfilled = false;
/******/                   if(priority < notFulfilled) notFulfilled = priority;
/******/                }
/******/             }
/******/             if(fulfilled) {
/******/                deferred.splice(i--, 1)
/******/                var r = fn();
/******/                if (r !== undefined) result = r;
/******/             }
/******/          }
/******/          return result;
/******/       };
/******/    })();
/******/
/******/    /* webpack/runtime/compat get default export */
/******/    (() => {
/******/       // getDefaultExport function for compatibility with non-harmony modules
/******/       __webpack_require__.n = (module) => {
/******/          var getter = module && module.__esModule ?
/******/             () => (module['default']) :
/******/             () => (module);
/******/          __webpack_require__.d(getter, { a: getter });
/******/          return getter;
/******/       };
/******/    })();
/******/
/******/    /* webpack/runtime/define property getters */
/******/    (() => {
/******/       // define getter functions for harmony exports
/******/       __webpack_require__.d = (exports, definition) => {
/******/          for(var key in definition) {
/******/             if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
/******/                Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/             }
/******/          }
/******/       };
/******/    })();
/******/
/******/    /* webpack/runtime/hasOwnProperty shorthand */
/******/    (() => {
/******/       __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
/******/    })();
/******/
/******/    /* webpack/runtime/make namespace object */
/******/    (() => {
/******/       // define __esModule on exports
/******/       __webpack_require__.r = (exports) => {
/******/          if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/             Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/          }
/******/          Object.defineProperty(exports, '__esModule', { value: true });
/******/       };
/******/    })();
/******/
/******/    /* webpack/runtime/jsonp chunk loading */
/******/    (() => {
/******/       // no baseURI
/******/
/******/       // object to store loaded and loading chunks
/******/       // undefined = chunk not loaded, null = chunk preloaded/prefetched
/******/       // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded
/******/       var installedChunks = {
/******/          "video/index": 0,
/******/          "video/style-index": 0
/******/       };
/******/
/******/       // no chunk on demand loading
/******/
/******/       // no prefetching
/******/
/******/       // no preloaded
/******/
/******/       // no HMR
/******/
/******/       // no HMR manifest
/******/
/******/       __webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0);
/******/
/******/       // install a JSONP callback for chunk loading
/******/       var webpackJsonpCallback = (parentChunkLoadingFunction, data) => {
/******/          var [chunkIds, moreModules, runtime] = data;
/******/          // add "moreModules" to the modules object,
/******/          // then flag all "chunkIds" as loaded and fire callback
/******/          var moduleId, chunkId, i = 0;
/******/          if(chunkIds.some((id) => (installedChunks[id] !== 0))) {
/******/             for(moduleId in moreModules) {
/******/                if(__webpack_require__.o(moreModules, moduleId)) {
/******/                   __webpack_require__.m[moduleId] = moreModules[moduleId];
/******/                }
/******/             }
/******/             if(runtime) var result = runtime(__webpack_require__);
/******/          }
/******/          if(parentChunkLoadingFunction) parentChunkLoadingFunction(data);
/******/          for(;i < chunkIds.length; i++) {
/******/             chunkId = chunkIds[i];
/******/             if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {
/******/                installedChunks[chunkId][0]();
/******/             }
/******/             installedChunks[chunkId] = 0;
/******/          }
/******/          return __webpack_require__.O(result);
/******/       }
/******/
/******/       var chunkLoadingGlobal = globalThis["webpackChunkjvb"] = globalThis["webpackChunkjvb"] || [];
/******/       chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));
/******/       chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));
/******/    })();
/******/
/************************************************************************/
/******/
/******/    // startup
/******/    // Load entry module and return exports
/******/    // This entry module depends on other loaded chunks and execution need to be delayed
/******/    var __webpack_exports__ = __webpack_require__.O(undefined, ["video/style-index"], () => (__webpack_require__("./src/video/index.js")))
/******/    __webpack_exports__ = __webpack_require__.O(__webpack_exports__);
/******/
/******/ })()
;
//# sourceMappingURL=index.js.map