(()=>{"use strict";const t=window.wp.blocks,e=window.wp.i18n,o=window.wp.blockEditor,r=window.wp.components,i=window.wp.data,l=window.wp.coreData,u=window.wp.htmlEntities,n=JSON.parse('{"UU":"vist360/tour"}'),s=window.ReactJSXRuntime;(0,t.registerBlockType)(n.UU,{edit:({attributes:t,setAttributes:n})=>{const{tourId:a,height:d}=t,c=(0,o.useBlockProps)(),v=(0,i.useSelect)(t=>t(l.store).getEntityRecords("postType","vist360_tour",{per_page:100}),[]),w=[{value:0,label:(0,e.__)("— Select a tour —","vistour-virtual-tour-builder")},...(v||[]).map(t=>({value:t.id,label:(0,u.decodeEntities)(t.title.rendered)||(0,e.__)("(no title)","vistour-virtual-tour-builder")}))],_=(v||[]).find(t=>t.id===a);return(0,s.jsxs)("div",{...c,children:[(0,s.jsx)(o.InspectorControls,{children:(0,s.jsxs)(r.PanelBody,{title:(0,e.__)("Tour","vistour-virtual-tour-builder"),children:[(0,s.jsx)(r.SelectControl,{__nextHasNoMarginBottom:!0,label:(0,e.__)("Tour","vistour-virtual-tour-builder"),value:a,options:w,onChange:t=>n({tourId:parseInt(t,10)})}),(0,s.jsx)(r.RangeControl,{__nextHasNoMarginBottom:!0,label:(0,e.__)("Height (px, 0 = tour default)","vistour-virtual-tour-builder"),min:0,max:1200,step:10,value:d,onChange:t=>n({height:t})})]})}),(0,s.jsx)(r.Placeholder,{icon:"format-image",label:(0,e.__)("360° Panorama Tour","vistour-virtual-tour-builder"),instructions:_?(0,u.decodeEntities)(_.title.rendered):(0,e.__)("Select a tour in the block settings sidebar.","vistour-virtual-tour-builder"),children:!v&&(0,e.__)("Loading tours…","vistour-virtual-tour-builder")})]})},save:()=>null})})();