!function(){"use strict";var e,t={502:function(){var e=window.wp.blocks,t=JSON.parse('{"$schema":"https://json.schemastore.org/block.json","apiVersion":2,"name":"gutenberg-examples/example-05-recipe-card-esnext","title":"Example: Recipe Card (ESNext)","icon":"index-card","category":"layout","attributes":{"title":{"type":"string","source":"html","selector":"h2"},"mediaID":{"type":"number"},"mediaURL":{"type":"string","source":"attribute","selector":"img","attribute":"src"},"ingredients":{"type":"string","source":"html","selector":".ingredients"},"instructions":{"type":"string","source":"html","selector":".steps"}},"example":{"attributes":{"title":"Chocolate Chip Cookies","mediaID":1,"mediaURL":"https://upload.wikimedia.org/wikipedia/commons/thumb/f/f1/2ChocolateChipCookies.jpg/320px-2ChocolateChipCookies.jpg","ingredients":[{"type":"li","props":{"children":["flour"]}},{"type":"li","props":{"children":["sugar"]}},{"type":"li","props":{"children":["chocolate"]}},{"type":"li","props":{"children":["💖"]}}],"instructions":[{"type":"p","props":{"children":["Mix, Bake, Enjoy!"]}}]}},"editorScript":"file:./build/index.js","style":"file:./build/style-index.css"}'),n=window.wp.element,i=window.wp.i18n,r=window.wp.blockEditor,a=window.wp.components;const{name:l}=t;(0,e.registerBlockType)(l,{edit:e=>{const{attributes:{title:t,mediaID:l,mediaURL:s,ingredients:o,instructions:c},setAttributes:p}=e,u=(0,r.useBlockProps)();return(0,n.createElement)("div",u,(0,n.createElement)(r.RichText,{tagName:"h2",placeholder:(0,i.__)("Write Recipe title…","gutenberg-examples"),value:t,onChange:e=>{p({title:e})}}),(0,n.createElement)("div",{className:"recipe-image"},(0,n.createElement)(r.MediaUpload,{onSelect:e=>{p({mediaURL:e.url,mediaID:e.id})},allowedTypes:"image",value:l,render:({open:e})=>(0,n.createElement)(a.Button,{className:l?"image-button":"button button-large",onClick:e},l?(0,n.createElement)("img",{src:s,alt:(0,i.__)("Upload Recipe Image","gutenberg-examples")}):(0,i.__)("Upload Image","gutenberg-examples"))})),(0,n.createElement)("h3",null,(0,i.__)("Ingredients","gutenberg-examples")),(0,n.createElement)(r.RichText,{tagName:"ul",multiline:"li",placeholder:(0,i.__)("Write a list of ingredients…","gutenberg-examples"),value:o,onChange:e=>{p({ingredients:e})},className:"ingredients"}),(0,n.createElement)("h3",null,(0,i.__)("Instructions","gutenberg-examples")),(0,n.createElement)(r.RichText,{tagName:"div",multiline:"p",className:"steps",placeholder:(0,i.__)("Write the instructions…","gutenberg-examples"),value:c,onChange:e=>{p({instructions:e})}}))},save:e=>{const{attributes:{title:t,mediaURL:a,ingredients:l,instructions:s}}=e,o=r.useBlockProps.save();return(0,n.createElement)("div",o,(0,n.createElement)(r.RichText.Content,{tagName:"h2",value:t}),a&&(0,n.createElement)("img",{className:"recipe-image",src:a,alt:(0,i.__)("Recipe Image","gutenberg-examples")}),(0,n.createElement)("h3",null,(0,i.__)("Ingredients","gutenberg-examples")),(0,n.createElement)(r.RichText.Content,{tagName:"ul",className:"ingredients",value:l}),(0,n.createElement)("h3",null,(0,i.__)("Instructions","gutenberg-examples")),(0,n.createElement)(r.RichText.Content,{tagName:"div",className:"steps",value:s}))}})}},n={};function i(e){var r=n[e];if(void 0!==r)return r.exports;var a=n[e]={exports:{}};return t[e](a,a.exports,i),a.exports}i.m=t,e=[],i.O=function(t,n,r,a){if(!n){var l=1/0;for(p=0;p<e.length;p++){n=e[p][0],r=e[p][1],a=e[p][2];for(var s=!0,o=0;o<n.length;o++)(!1&a||l>=a)&&Object.keys(i.O).every((function(e){return i.O[e](n[o])}))?n.splice(o--,1):(s=!1,a<l&&(l=a));if(s){e.splice(p--,1);var c=r();void 0!==c&&(t=c)}}return t}a=a||0;for(var p=e.length;p>0&&e[p-1][2]>a;p--)e[p]=e[p-1];e[p]=[n,r,a]},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},function(){var e={826:0,46:0};i.O.j=function(t){return 0===e[t]};var t=function(t,n){var r,a,l=n[0],s=n[1],o=n[2],c=0;if(l.some((function(t){return 0!==e[t]}))){for(r in s)i.o(s,r)&&(i.m[r]=s[r]);if(o)var p=o(i)}for(t&&t(n);c<l.length;c++)a=l[c],i.o(e,a)&&e[a]&&e[a][0](),e[l[c]]=0;return i.O(p)},n=self.webpackChunk_05_recipe_card_esnext=self.webpackChunk_05_recipe_card_esnext||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))}();var r=i.O(void 0,[46],(function(){return i(502)}));r=i.O(r)}();