(()=>{"use strict";var e,i={761:()=>{const e=window.wp.blocks,i=window.wp.i18n,t=window.wp.blockEditor,a=window.wp.components,l=window.wp.element,o=window.ReactJSXRuntime,s=JSON.parse('{"UU":"buntywp/explicit-media-item"}');(0,e.registerBlockType)(s.UU,{edit:function({attributes:e,setAttributes:s,clientId:r}){const{mediaUrl:n,mediaType:d,likeCount:c,blockId:p,scale:m}=e,h=(0,t.useBlockProps)();(0,l.useEffect)((()=>{p||s({blockId:r})}),[p,r,s]);const{borderWidth:x,borderRadius:u,...v}=h.style,w={...h,style:v};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(t.InspectorControls,{children:(0,o.jsx)(a.PanelBody,{title:(0,i.__)("Explicit Media Settings","explicit-media"),children:(0,o.jsx)(a.SelectControl,{label:(0,i.__)("Scale","explicit-media"),value:m,options:[{label:(0,i.__)("Cover","explicit-media"),value:"cover"},{label:(0,i.__)("Contain","explicit-media"),value:"contain"}],onChange:e=>s({scale:e})})})}),(0,o.jsxs)("div",{className:"buntywp-exp-media-container",children:[(0,o.jsxs)("div",{className:"image-container",children:[(0,o.jsx)(t.MediaUploadCheck,{children:(0,o.jsx)(t.MediaUpload,{onSelect:e=>{"image"!==e.type&&"video"!==e.type||s({mediaUrl:e.url,mediaType:e.type,mediaId:e.id})},allowedTypes:["image","video"],render:({open:e})=>(0,o.jsx)(a.Button,{onClick:e,variant:"primary",className:"upload-button "+(n?"hover-visible":"centered"),children:n?(0,i.__)("Replace Media","explicit-media"):(0,i.__)("Upload Image or Video","explicit-media")})})}),(0,o.jsxs)("figure",{...w,children:[n&&"image"===d&&(0,o.jsx)("img",{src:n,alt:(0,i.__)("Selected Media","explicit-media"),className:"uploaded-media",loading:"lazy",style:{borderWidth:x,borderRadius:u,objectFit:m}}),n&&"video"===d&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)("video",{controls:!0,className:"uploaded-media",children:[(0,o.jsx)("source",{src:n,type:"video/mp4"}),"Your browser does not support the video tag."]}),(0,o.jsx)(a.Button,{className:"pip-button","aria-label":"Toggle PiP",children:(0,o.jsx)("svg",{fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,o.jsx)("path",{d:"M2 5.75C2 4.23122 3.23122 3 4.75 3H15.25C16.7688 3 18 4.23122 18 5.75V10H17V5.75C17 4.7835 16.2165 4 15.25 4H4.75C3.7835 4 3 4.7835 3 5.75V12.25C3 13.2165 3.7835 14 4.75 14H9V15H4.75C3.23122 15 2 13.7688 2 12.25V5.75ZM11.5 11C10.6716 11 10 11.6716 10 12.5V16.5C10 17.3284 10.6716 18 11.5 18H17.5C18.3284 18 19 17.3284 19 16.5V12.5C19 11.6716 18.3284 11 17.5 11H11.5ZM4.64645 5.64645C4.84171 5.45118 5.15829 5.45118 5.35355 5.64645L8 8.29289V6.5C8 6.22386 8.22386 6 8.5 6C8.77614 6 9 6.22386 9 6.5V9.5C9 9.77614 8.77614 10 8.5 10H5.5C5.22386 10 5 9.77614 5 9.5C5 9.22386 5.22386 9 5.5 9H7.29289L4.64645 6.35355C4.45118 6.15829 4.45118 5.84171 4.64645 5.64645Z",fill:"#212121"})})})]})]})]}),n&&(0,o.jsxs)("div",{className:"exp-media-actions",children:[(0,o.jsxs)("div",{className:"exp-media-action-item",children:[(0,o.jsx)(a.Button,{className:"exp-media-like-button",children:(0,o.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"heart-icon",children:(0,o.jsx)("path",{d:"M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z"})})}),(0,o.jsx)("span",{className:"exp-media-like-count",children:c})]}),(0,o.jsx)("div",{className:"exp-media-action-item",children:(0,o.jsx)(a.Button,{className:"exp-media-share-button exp-media-button",children:(0,o.jsx)("svg",{className:"w-6 h-6 text-gray-800 dark:text-white","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",viewBox:"0 0 24 24",children:(0,o.jsx)("path",{d:"M17.5 3a3.5 3.5 0 0 0-3.456 4.06L8.143 9.704a3.5 3.5 0 1 0-.01 4.6l5.91 2.65a3.5 3.5 0 1 0 .863-1.805l-5.94-2.662a3.53 3.53 0 0 0 .002-.961l5.948-2.667A3.5 3.5 0 1 0 17.5 3Z"})})})})]})]})]})},save:function(){return null}})}},t={};function a(e){var l=t[e];if(void 0!==l)return l.exports;var o=t[e]={exports:{}};return i[e](o,o.exports,a),o.exports}a.m=i,e=[],a.O=(i,t,l,o)=>{if(!t){var s=1/0;for(c=0;c<e.length;c++){for(var[t,l,o]=e[c],r=!0,n=0;n<t.length;n++)(!1&o||s>=o)&&Object.keys(a.O).every((e=>a.O[e](t[n])))?t.splice(n--,1):(r=!1,o<s&&(s=o));if(r){e.splice(c--,1);var d=l();void 0!==d&&(i=d)}}return i}o=o||0;for(var c=e.length;c>0&&e[c-1][2]>o;c--)e[c]=e[c-1];e[c]=[t,l,o]},a.o=(e,i)=>Object.prototype.hasOwnProperty.call(e,i),(()=>{var e={945:0,69:0};a.O.j=i=>0===e[i];var i=(i,t)=>{var l,o,[s,r,n]=t,d=0;if(s.some((i=>0!==e[i]))){for(l in r)a.o(r,l)&&(a.m[l]=r[l]);if(n)var c=n(a)}for(i&&i(t);d<s.length;d++)o=s[d],a.o(e,o)&&e[o]&&e[o][0](),e[o]=0;return a.O(c)},t=globalThis.webpackChunkexplicit_media_block=globalThis.webpackChunkexplicit_media_block||[];t.forEach(i.bind(null,0)),t.push=i.bind(null,t.push.bind(t))})();var l=a.O(void 0,[69],(()=>a(761)));l=a.O(l)})();