(()=>{"use strict";var e={n:o=>{var l=o&&o.__esModule?()=>o.default:()=>o;return e.d(l,{a:l}),l},d:(o,l)=>{for(var n in l)e.o(l,n)&&!e.o(o,n)&&Object.defineProperty(o,n,{enumerable:!0,get:l[n]})},o:(e,o)=>Object.prototype.hasOwnProperty.call(e,o)};const o=window.wp.blocks,l=JSON.parse('{"UU":"snow-monkey-blocks/child-pages","uK":{"$t":{"A":{}},"DD":{"A":""},"Zp":{"A":"rich-media"},"rQ":{"A":""},"ez":{"A":0},"$w":{"A":"h3"},"cn":{"A":"full"},"d$":{"A":false},"r$":{"A":true},"YP":{"A":0},"EP":{"A":false}}}'),n=window.ReactJSXRuntime,a=(0,n.jsxs)("svg",{viewBox:"0 0 24 20",children:[(0,n.jsx)("path",{d:"M6.5,1V6a1,1,0,0,0,1,1h9a1,1,0,0,0,1-1V1a1,1,0,0,0-1-1h-9A1,1,0,0,0,6.5,1ZM16,6H8a.5.5,0,0,1-.5-.5v-4A.5.5,0,0,1,8,1h8a.5.5,0,0,1,.5.5v4A.5.5,0,0,1,16,6Z"}),(0,n.jsx)("rect",{x:"11.5",y:"6",width:"1",height:"4.26"}),(0,n.jsx)("path",{d:"M0,14v5a1,1,0,0,0,1,1h9a1,1,0,0,0,1-1V14a1,1,0,0,0-1-1H1A1,1,0,0,0,0,14Zm9.5,5h-8a.5.5,0,0,1-.5-.5v-4a.5.5,0,0,1,.5-.5h8a.5.5,0,0,1,.5.5v4A.5.5,0,0,1,9.5,19Z"}),(0,n.jsx)("path",{d:"M13,14v5a1,1,0,0,0,1,1h9a1,1,0,0,0,1-1V14a1,1,0,0,0-1-1H14A1,1,0,0,0,13,14Zm9.5,5h-8a.5.5,0,0,1-.5-.5v-4a.5.5,0,0,1,.5-.5h8a.5.5,0,0,1,.5.5v4A.5.5,0,0,1,22.5,19Z"}),(0,n.jsx)("path",{d:"M5.75,13V10.76a.5.5,0,0,1,.5-.5h11.5a.5.5,0,0,1,.5.5V13h1V10.26a1,1,0,0,0-1-1H5.75a1,1,0,0,0-1,1V13Z"})]}),s=window.lodash,t=window.wp.components,i=window.wp.blockEditor,r=window.wp.data,c=window.wp.element,u=window.wp.i18n,m=window.wp.serverSideRender;var _=e.n(m);function p({label:e,...o}){return(0,n.jsx)(t.BaseControl,{__nextHasNoMarginBottom:!0,label:e,id:"snow-monkey-blocks/component/search-post-control",children:(0,n.jsx)("div",{className:"smb-search-post-control",children:(0,n.jsx)(i.LinkControl,{...o,forceIsEditingLink:!o?.value?.id})})})}const h=window.wp.compose,b=(e,o=0,l=null)=>(e=Number(e),(isNaN(e)||e<o)&&(e=o),null!==l&&e>l&&(e=l),e),d=[];(0,o.registerBlockType)(l.UU,{icon:{foreground:"#cd162c",src:a},edit:function({attributes:e,setAttributes:o,clientId:a}){const{title:m,layout:k,gap:w,smCols:x,itemTitleTagName:y,itemThumbnailSizeSlug:g,arrows:v,dots:j,interval:f,autoplayButton:A,parent:D}=e,S=(0,r.useSelect)((e=>{const{getSettings:o}=e("core/block-editor"),{imageSizes:l}=o();return l||d}),[]),C=(0,c.useMemo)((()=>S.map((e=>({value:e.slug,label:e.name})))),[S]),T=(0,h.useViewportMatch)("medium","<")?{}:{popoverProps:{placement:"left-start",offset:259}},B=["h2","h3","h4"],N=[{label:"S",value:1},{label:"M",value:2},{label:"L",value:3}];return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(i.InspectorControls,{children:(0,n.jsxs)(t.__experimentalToolsPanel,{label:(0,u.__)("Block settings","snow-monkey-blocks"),dropdownMenuProps:T,children:[(0,n.jsx)(t.__experimentalToolsPanelItem,{hasValue:()=>m!==l.uK.DD.A,isShownByDefault:!0,label:(0,u.__)("Title","snow-monkey-blocks"),onDeselect:()=>o({title:l.uK.DD.A}),children:(0,n.jsx)(t.TextControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:(0,u.__)("Title","snow-monkey-blocks"),value:m,placeholder:(0,u.__)("Child pages","snow-monkey-blocks"),onChange:e=>o({title:e})})}),(0,n.jsx)(t.__experimentalToolsPanelItem,{hasValue:()=>k!==l.uK.Zp.A,isShownByDefault:!0,label:(0,u.__)("Layout","snow-monkey-blocks"),onDeselect:()=>o({layout:l.uK.Zp.A}),children:(0,n.jsx)(t.SelectControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:(0,u.__)("Layout","snow-monkey-blocks"),value:k,onChange:e=>o({layout:e}),options:[{value:"rich-media",label:(0,u.__)("Rich media","snow-monkey-blocks")},{value:"simple",label:(0,u.__)("Simple","snow-monkey-blocks")},{value:"text",label:(0,u.__)("Text","snow-monkey-blocks")},{value:"text2",label:(0,u.__)("Text 2","snow-monkey-blocks")},{value:"panel",label:(0,u.__)("Panels","snow-monkey-blocks")},{value:"carousel",label:(0,u.sprintf)(
// translators: %1$s: Layout
// translators: %1$s: Layout
(0,u.__)("Carousel (%1$s)","snow-monkey-blocks"),(0,u.__)("Rich media","snow-monkey-blocks"))},{value:"large-image",label:(0,u.__)("Large image","snow-monkey-blocks")}]})}),"carousel"===k&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(t.__experimentalToolsPanelItem,{hasValue:()=>v!==l.uK.d$.A,isShownByDefault:!0,label:(0,u.__)("Display arrows","snow-monkey-blocks"),onDeselect:()=>o({arrows:l.uK.d$.A}),children:(0,n.jsx)(t.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,u.__)("Display arrows","snow-monkey-blocks"),checked:v,onChange:e=>o({arrows:e})})}),(0,n.jsx)(t.__experimentalToolsPanelItem,{hasValue:()=>j!==l.uK.r$.A,isShownByDefault:!0,label:(0,u.__)("Display dots","snow-monkey-blocks"),onDeselect:()=>o({dots:l.uK.r$.A}),children:(0,n.jsx)(t.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,u.__)("Display dots","snow-monkey-blocks"),checked:j,onChange:e=>o({dots:e})})}),(0,n.jsx)(t.__experimentalToolsPanelItem,{hasValue:()=>f!==l.uK.YP.A,isShownByDefault:!0,label:(0,u.__)("Autoplay Speed in seconds","snow-monkey-blocks"),onDeselect:()=>o({interval:l.uK.YP.A}),children:(0,n.jsx)(t.RangeControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:(0,u.__)("Autoplay Speed in seconds","snow-monkey-blocks"),help:(0,u.__)('If "0", no scroll.',"snow-monkey-blocks"),value:f,onChange:e=>o({interval:b(e,0,10)}),min:"0",max:"10"})}),0<f&&(0,n.jsx)(t.__experimentalToolsPanelItem,{hasValue:()=>A!==l.uK.EP.A,isShownByDefault:!0,label:(0,u.__)("Display pause button for autoplay","snow-monkey-blocks"),onDeselect:()=>o({autoplayButton:l.uK.EP.A}),children:(0,n.jsx)(t.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,u.__)("Display pause button for autoplay","snow-monkey-blocks"),checked:A,onChange:e=>o({autoplayButton:e})})})]}),(0,n.jsx)(t.__experimentalToolsPanelItem,{hasValue:()=>y!==l.uK.$w.A,isShownByDefault:!0,label:(0,u.__)("Title tag","snow-monkey-blocks"),onDeselect:()=>o({itemTitleTagName:l.uK.$w.A}),children:(0,n.jsx)(t.BaseControl,{__nextHasNoMarginBottom:!0,label:(0,u.__)("Title tag","snow-monkey-blocks"),id:"snow-monkey-blocks/child-pages/item-title-tag-name",children:(0,n.jsx)("div",{className:"smb-list-icon-selector",children:(0,s.times)(B.length,(e=>(0,n.jsx)(t.Button,{variant:y===B[e]?"primary":"secondary",onClick:()=>o({itemTitleTagName:B[e]}),children:B[e]},e)))})})}),(0,n.jsx)(t.__experimentalToolsPanelItem,{hasValue:()=>g!==l.uK.cn.A,isShownByDefault:!0,label:(0,u.__)("Images size","snow-monkey-blocks"),onDeselect:()=>o({itemThumbnailSizeSlug:l.uK.cn.A}),children:(0,n.jsx)(t.SelectControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:(0,u.__)("Images size","snow-monkey-blocks"),value:g,options:C,onChange:e=>o({itemThumbnailSizeSlug:e})})}),("rich-media"===k||"panel"===k)&&(0,n.jsx)(t.__experimentalToolsPanelItem,{hasValue:()=>x!==l.uK.ez.A,isShownByDefault:!0,label:(0,u.__)("Number of columns displayed on mobile device","snow-monkey-blocks"),onDeselect:()=>o({smCols:l.uK.ez.A}),children:(0,n.jsx)(t.SelectControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:(0,u.__)("Number of columns displayed on mobile device","snow-monkey-blocks"),value:x,onChange:e=>o({smCols:b(e)}),options:[{value:0,label:(0,u.__)("Default","snow-monkey-blocks")},{value:1,label:(0,u.__)("1 column","snow-monkey-blocks")},{value:2,label:(0,u.__)("2 columns","snow-monkey-blocks")}]})}),(0,n.jsx)(t.__experimentalToolsPanelItem,{hasValue:()=>D!==l.uK.$t.A,isShownByDefault:!0,label:(0,u.__)("Specify the parent page","snow-monkey-blocks"),onDeselect:()=>o({parent:l.uK.$t.A}),children:(0,n.jsx)(p,{label:(0,u.__)("Specify the parent page","snow-monkey-blocks"),onRemove:()=>o({parent:{}}),settings:[],searchInputPlaceholder:(0,u.__)("Search","snow-monkey-blocks"),value:D,onChange:e=>{o({parent:{id:e.id,title:e.title,url:e.url}})},suggestionQuery:{type:"post",subtype:"page"}})})]})}),(0,n.jsx)(i.InspectorControls,{group:"dimensions",children:(0,n.jsx)(t.__experimentalToolsPanelItem,{hasValue:()=>w!==l.uK.rQ.A,isShownByDefault:!0,label:(0,u.__)("The gap between each item","snow-monkey-blocks"),onDeselect:()=>o({gap:l.uK.rQ.A}),panelId:a,children:(0,n.jsx)(t.BaseControl,{__nextHasNoMarginBottom:!0,id:"snow-monkey-blocks/child-pages/gap",label:(0,u.__)("The gap between each item","snow-monkey-blocks"),className:"spacing-sizes-control",children:(0,n.jsx)(t.RangeControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,className:"spacing-sizes-control__range-control",value:N.filter((e=>e.label?.toLowerCase()===w))?.[0]?.value,resetFallbackValue:void 0,onChange:e=>o({gap:N.filter((o=>o.value===e))?.[0]?.label?.toLowerCase()}),withInputField:!1,min:1,max:3,marks:!0,renderTooltipContent:e=>N.filter((o=>o.value===e))?.[0]?.label?.toUpperCase(),hideLabelFromVision:!0})})})}),(0,n.jsx)("div",{...(0,i.useBlockProps)(),children:(0,n.jsx)(t.Disabled,{children:(0,n.jsx)(_(),{block:"snow-monkey-blocks/child-pages",attributes:e})})})]})},save:function(){return null}})})();