(()=>{"use strict";var e,t={939(){const e=window.wp.primitives,t=window.ReactJSXRuntime,o=(0,t.jsx)(e.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,t.jsx)(e.Path,{d:"M18.7 3H5.3C4 3 3 4 3 5.3v13.4C3 20 4 21 5.3 21h13.4c1.3 0 2.3-1 2.3-2.3V5.3C21 4 20 3 18.7 3zm.8 15.7c0 .4-.4.8-.8.8H5.3c-.4 0-.8-.4-.8-.8V5.3c0-.4.4-.8.8-.8h13.4c.4 0 .8.4.8.8v13.4zM10 15l5-3-5-3v6z"})}),i=window.wp.blocks,a=window.wp.i18n,n=window.wp.blockEditor,l=window.wp.components,d=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"godam/video-thumbnail","title":"GoDAM Video Thumbnail","category":"media","description":"Display GoDAM video thumbnail","keywords":["video","gallery","grid","videos","thumbnail"],"textdomain":"godam","attributes":{"linkToVideo":{"type":"boolean","default":false},"showPlayButton":{"type":"boolean","default":false},"openInNewTab":{"type":"boolean","default":false}},"supports":{"anchor":true,"align":["left","center","right","wide","full"],"spacing":{"margin":true,"padding":true},"alignWide":true,"color":{"background":true,"gradients":true},"dimensions":{"aspectRatio":true,"minHeight":true},"shadow":true,"customClassName":true,"__experimentalBorder":{"color":true,"radius":true,"style":true,"width":true,"__experimentalDefaultControls":{"color":true,"radius":true,"style":true,"width":true}}},"editorScript":["file:./index.js"],"style":["file:./style-index.css"],"editorStyle":["file:./index.css"],"render":"file:./render.php"}'),{name:r}=d;!function(e){if(!e)return;const{metadata:t,settings:o,name:a}=e;(0,i.registerBlockType)({name:a,...t},o)}({name:r,metadata:d,settings:{icon:o,edit:function({attributes:e,setAttributes:o}){const{linkToVideo:i,showPlayButton:d,openInNewTab:r}=e,s=(0,n.useBlockProps)({className:"godam-editor-video-item"});return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.InspectorControls,{children:(0,t.jsxs)(l.PanelBody,{title:(0,a.__)("Thumbnail Settings","godam"),"data-test-id":"godam-video-thumbnail-panel-settings",children:[(0,t.jsx)("div",{"data-test-id":"godam-video-thumbnail-control-show-play-button",children:(0,t.jsx)(l.ToggleControl,{label:(0,a.__)("Show play button overlay","godam"),checked:d,onChange:e=>o({showPlayButton:e}),help:d?(0,a.__)("Play button will be displayed.","godam"):(0,a.__)("No play button will be displayed.","godam")})}),(0,t.jsx)("div",{"data-test-id":"godam-video-thumbnail-control-link-to-video",children:(0,t.jsx)(l.ToggleControl,{label:(0,a.__)("Link to post","godam"),checked:i,onChange:e=>o({linkToVideo:e}),help:i?(0,a.__)("Thumbnail will link to the video page.","godam"):(0,a.__)("Thumbnail will not be linked.","godam")})}),i&&(0,t.jsx)("div",{"data-test-id":"godam-video-thumbnail-control-open-in-new-tab",children:(0,t.jsx)(l.ToggleControl,{label:(0,a.__)("Open in new tab","godam"),checked:r,onChange:e=>o({openInNewTab:e}),help:r?(0,a.__)("Link will open in a new tab.","godam"):(0,a.__)("Link will open in the same tab.","godam")})})]})}),(0,t.jsx)("div",{...s,"data-test-id":"godam-video-thumbnail-canvas",children:(0,t.jsxs)("div",{className:"godam-editor-video-thumbnail",children:[(0,t.jsx)("span",{className:"godam-editor-video-label","data-test-id":"godam-video-thumbnail-element-label",children:(0,a.__)("GoDAM Video Thumbnail","godam")}),d&&(0,t.jsx)("div",{className:"godam-editor-video-play-button","data-test-id":"godam-video-thumbnail-element-play-button",children:(0,t.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"60",height:"60","aria-hidden":"true",focusable:"false",children:(0,t.jsx)("path",{d:"M8 5v14l11-7z",fill:"currentColor"})})})]})})]})},save:function(){return null},example:{viewportWidth:350}}})}},o={};function i(e){var a=o[e];if(void 0!==a)return a.exports;var n=o[e]={exports:{}};return t[e](n,n.exports,i),n.exports}i.m=t,e=[],i.O=(t,o,a,n)=>{if(!o){var l=1/0;for(u=0;u<e.length;u++){for(var[o,a,n]=e[u],d=!0,r=0;r<o.length;r++)(!1&n||l>=n)&&Object.keys(i.O).every(e=>i.O[e](o[r]))?o.splice(r--,1):(d=!1,n<l&&(l=n));if(d){e.splice(u--,1);var s=a();void 0!==s&&(t=s)}}return t}n=n||0;for(var u=e.length;u>0&&e[u-1][2]>n;u--)e[u]=e[u-1];e[u]=[o,a,n]},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={489:0,362:0};i.O.j=t=>0===e[t];var t=(t,o)=>{var a,n,[l,d,r]=o,s=0;if(l.some(t=>0!==e[t])){for(a in d)i.o(d,a)&&(i.m[a]=d[a]);if(r)var u=r(i)}for(t&&t(o);s<l.length;s++)n=l[s],i.o(e,n)&&e[n]&&e[n][0](),e[n]=0;return i.O(u)},o=globalThis.webpackChunkgodam=globalThis.webpackChunkgodam||[];o.forEach(t.bind(null,0)),o.push=t.bind(null,o.push.bind(o))})();var a=i.O(void 0,[362],()=>i(939));a=i.O(a)})();