(()=>{"use strict";const e=window.ReactJSXRuntime,t=({selectedIcon:t,onIconSelect:n})=>{const i=iconsData.icons,a=iconsData.iconPath,s=e=>{n(e)};return(0,e.jsxs)("div",{className:"icon-selector",children:[(0,e.jsx)("style",{children:"\n            .icon-selector {\n                display: flex;\n                flex-wrap: wrap;\n                gap: 10px;\n            }\n            .icon-label {\n                cursor: pointer;\n                display: inline-block;\n                transition: transform 0.2s ease;\n            }\n            .icon-label:hover {\n                transform: scale(1.1);\n            }\n            .icon-option {\n                width: 50px;\n                height: 50px;\n                border-radius: 4px;\n                transition: border-color 0.2s ease;\n            }\n            .icon-radio:checked + img {\n                border: 2px solid #007cba;\n                border-radius: 4px;\n            }\n            .icon-selected {\n                border-color: #007cba;\n            }\n        "}),i.map(((n,i)=>(0,e.jsxs)("label",{className:"icon-label",children:[(0,e.jsx)("input",{type:"radio",name:"selectedIcon",value:a+n,className:"icon-radio",checked:t===n,onChange:()=>s(n),style:{display:"none"}}),(0,e.jsx)("img",{src:a+n,alt:`Icon ${i+1}`,className:"icon-option "+(t===n?"icon-selected":""),onClick:()=>s(n),height:"50",width:"50"})]},i)))]})},{__}=wp.i18n,{registerBlockType:n}=wp.blocks,{RichText:i,MediaUpload:a,InspectorControls:s,InnerBlocks:o}=wp.blockEditor,{Button:c,PanelBody:l,SelectControl:r}=wp.components,{Fragment:d}=wp.element;n("xgate/service-list-item",{title:__("Service list item","xgate"),icon:"smiley",category:"xgate-blocks",attributes:{title:{type:"string"},subtitle:{type:"string"},content:{type:"string"},selectedIcon:{type:"string",default:""}},parent:["xgate/service-list"],usesContext:["xgate/service-list-variant"],edit:function(n){const{attributes:s,setAttributes:o,className:l,context:r}=n,{title:g,subtitle:p,content:x,imageUrl:h,variant:m,selectedIcon:u}=s;return(0,e.jsxs)("div",{className:l,children:[(0,e.jsxs)(d,{children:[(0,e.jsx)(t,{selectedIcon:u,onIconSelect:e=>{o({selectedIcon:e})}}),(0,e.jsx)("div",{className:"icon-preview",children:u&&(0,e.jsx)("img",{src:`${mythemeIconBlockData.iconPath}${u}`,alt:u,height:"45",width:"45"})})]}),(0,e.jsx)(i,{tagName:"h3",placeholder:__("Add Title","xgate"),value:g,onChange:e=>{o({title:e})}}),(0,e.jsx)(i,{tagName:"h4",placeholder:__("Add Subtitle","xgate"),value:p,onChange:e=>{o({subtitle:e})}}),(0,e.jsx)(i,{tagName:"p",placeholder:__("Add content","xgate"),value:x,onChange:e=>{o({content:e})}}),(0,e.jsx)(a,{onSelect:e=>{o({imageUrl:e.url,imageId:e.id})},allowedTypes:["image"],value:n.attributes.imageId,render:({open:t})=>(0,e.jsx)(c,{className:"button button-large",onClick:t,children:h?(0,e.jsx)("img",{src:h,width:"50",heigh:"50",alt:__("Selected Image","xgate")}):__("Choose an image","xgate")})})]})},save:function(){return null}})})();