(()=>{"use strict";const e=window.wp.blocks,t=JSON.parse('{"u2":"foxiz-elements/highlight"}'),l=window.wp.element,i=window.wp.i18n,n=window.wp.blockEditor,a=window.wp.components;(0,e.registerBlockType)(t.u2,{edit:function(e){const{attributes:t,setAttributes:o}=e,{heading:h,highlight:g,headingTag:r,textAlign:c,tocAdded:d,desktopHeadingSize:s,tabletHeadingSize:b,mobileHeadingSize:m,highLightColor:u,highLightBg:_,darkHighLightColor:p,darkHighLightBg:C}=t,v=(e,t)=>{o({[e]:t})};var E="gb-highlight gb-heading";d||(E+=" none-toc"),c&&(E+=` has-text-align-${c}`);const k=(0,n.useBlockProps)({className:E,style:{...s&&{"--desktop-heading-size":`${s}px`},...b&&{"--tablet-heading-size":`${b}px`},...m&&{"--mobile-heading-size":`${m}px`},...u&&{"--highlight-color":u},...p&&{"--dark-highlight-color":p},..._&&{"--highlight-bg":_},...C&&{"--dark-highlight-bg":C}}}),H=[{label:(0,i.__)("H2"),value:"h2"},{label:(0,i.__)("H3"),value:"h3"},{label:(0,i.__)("H4"),value:"h4"},{label:(0,i.__)("H5"),value:"h5"},{label:(0,i.__)("H6"),value:"h6"},{label:(0,i.__)("p"),value:"p"},{label:(0,i.__)("div"),value:"div"}],x=r||"div";return(0,l.createElement)(x,k,(0,l.createElement)(n.BlockControls,{group:"block"},(0,l.createElement)(n.AlignmentControl,{value:c,onChange:e=>{o({textAlign:e})}})),(0,l.createElement)(n.InspectorControls,null,(0,l.createElement)(a.PanelBody,{title:(0,i.__)("General"),initialOpen:!0},(0,l.createElement)(a.TextareaControl,{label:(0,i.__)("Content"),value:h,onChange:e=>v("heading",e),placeholder:"Add your content here..."}),(0,l.createElement)(a.TextareaControl,{label:(0,i.__)("Highlight Text"),value:g,onChange:e=>v("highlight",e),help:(0,i.__)("Input text to search for and highlight within the text. Case insensitive, multiple matches")}),(0,l.createElement)(a.SelectControl,{label:(0,i.__)("Content Tag"),value:r,options:H,onChange:e=>v("headingTag",e)}),(0,l.createElement)(a.ToggleControl,{label:(0,i.__)("Table of Content Included"),checked:d,onChange:e=>v("tocAdded",e)}))),(0,l.createElement)(n.InspectorControls,{group:"styles"},(0,l.createElement)(a.PanelBody,{title:(0,i.__)("Style"),initialOpen:!0},(0,l.createElement)("label",{className:"rb-control-label"},(0,i.__)("Font Size")),(0,l.createElement)("div",{className:"responsive-settings"},(0,l.createElement)("div",null,(0,l.createElement)("label",null,(0,l.createElement)(a.Dashicon,{icon:"desktop"}),(0,i.__)("Desktop")),(0,l.createElement)(a.TextControl,{type:"number",placeholder:"18",value:s,onChange:e=>v("desktopHeadingSize",e)})),(0,l.createElement)("div",null,(0,l.createElement)("label",null,(0,l.createElement)(a.Dashicon,{icon:"tablet"}),(0,i.__)("Tablet")),(0,l.createElement)(a.TextControl,{type:"number",placeholder:"17",value:b,onChange:e=>v("tabletHeadingSize",e)})),(0,l.createElement)("div",null,(0,l.createElement)("label",null,(0,l.createElement)(a.Dashicon,{icon:"smartphone"}),(0,i.__)("Mobile")),(0,l.createElement)(a.TextControl,{type:"number",placeholder:"16",value:m,onChange:e=>v("mobileHeadingSize",e)}))),(0,l.createElement)(n.PanelColorSettings,{title:(0,i.__)("Color"),colorSettings:[{value:u,onChange:e=>v("highLightColor",e),label:(0,i.__)("Highlight Color")},{value:_,onChange:e=>v("highLightBg",e),label:(0,i.__)("Highlight Background")}]}),(0,l.createElement)(n.PanelColorSettings,{title:(0,i.__)("Dark Mode - Color"),colorSettings:[{value:p,onChange:e=>v("darkHighLightColor",e),label:(0,i.__)("Highlight Color")},{value:C,onChange:e=>v("darkHighLightBg",e),label:(0,i.__)("Highlight Background")}]}))),(0,l.createElement)(a.TextHighlight,{text:h,highlight:g}))},save:function({attributes:e}){const{heading:t,headingTag:i,tocAdded:o,textAlign:h,desktopHeadingSize:g,tabletHeadingSize:r,mobileHeadingSize:c,highlight:d,highLightColor:s,highLightBg:b,darkHighLightColor:m,darkHighLightBg:u}=e;var _="gb-highlight";o||(_+=" none-toc"),h&&(_+=` has-text-align-${h}`);const p=i||"h2",C=n.useBlockProps.save({className:_,style:{...g&&{"--desktop-heading-size":`${g}px`},...r&&{"--tablet-heading-size":`${r}px`},...c&&{"--mobile-heading-size":`${c}px`},...s&&{"--highlight-color":s},...m&&{"--dark-highlight-color":m},...b&&{"--highlight-bg":b},...u&&{"--dark-highlight-bg":u}}});return(0,l.createElement)("div",C,(0,l.createElement)(p,{className:"gb-heading"},(0,l.createElement)(a.TextHighlight,{text:t,highlight:d})))}})})();