(()=>{"use strict";var e,t={961:()=>{const e=window.wp.blocks,t=window.wp.i18n,i=window.wp.blockEditor,n=window.wp.url,r=window.wp.element,o=window.wp.components;function a(e){var t=e.description,i=e.isLimited,n=e.limit;return React.createElement(r.RawHTML,null,i?t.substring(0,n):t)}function l(e){var i=e.isLimited,n=e.setIsLimited,r=e.limit,a=e.setLimit;return React.createElement(React.Fragment,null,React.createElement(o.PanelRow,null,React.createElement(o.ToggleControl,{label:(0,t.__)("Limit Text Length?","matador-jobs"),checked:i,onChange:function(e){return n(e)}})),React.createElement(o.PanelRow,null,i&&React.createElement(o.RangeControl,{__next40pxDefaultSize:!0,label:(0,t.__)("Limit","matador-jobs"),help:(0,t.__)("Set the limit for how many characters to display","matador-jobs"),value:r,onChange:function(e){return a(e)},min:20,max:4e3})))}const c=JSON.parse('{"UU":"matador-jobs/job-description"}');(0,e.registerBlockType)(c.UU,{edit:function(e){var c=e.attributes,s=e.setAttributes,m=e.context,d=(0,i.useBlockProps)({className:"matador-description-block"}),u=c.postId,p=void 0===u?m.postId:u,f=c.descriptionContent,v=c.limit,w=c.isLimited;return(0,r.useEffect)((function(){if(p){var e={fields:"description",limit:v};wp.apiFetch({path:(0,n.addQueryArgs)("matador/v1/jobs/job-listings/".concat(p),e)}).then((function(e){var t;null!=e&&e.description&&(t=null==e?void 0:e.description,s({descriptionContent:t}))}))}}),[p,v,w,s]),React.createElement(React.Fragment,null,React.createElement(i.InspectorControls,null,React.createElement(o.PanelBody,{title:(0,t.__)("Settings","matador-jobs"),initialOpen:!0},React.createElement(l,{isLimited:w,setIsLimited:function(e){s({isLimited:e})},limit:v,setLimit:function(e){return s({limit:e})}}))),React.createElement("div",d,React.createElement(a,{description:f,isLimited:w,limit:v})))}})}},i={};function n(e){var r=i[e];if(void 0!==r)return r.exports;var o=i[e]={exports:{}};return t[e](o,o.exports,n),o.exports}n.m=t,e=[],n.O=(t,i,r,o)=>{if(!i){var a=1/0;for(m=0;m<e.length;m++){for(var[i,r,o]=e[m],l=!0,c=0;c<i.length;c++)(!1&o||a>=o)&&Object.keys(n.O).every((e=>n.O[e](i[c])))?i.splice(c--,1):(l=!1,o<a&&(a=o));if(l){e.splice(m--,1);var s=r();void 0!==s&&(t=s)}}return t}o=o||0;for(var m=e.length;m>0&&e[m-1][2]>o;m--)e[m]=e[m-1];e[m]=[i,r,o]},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={660:0,652:0};n.O.j=t=>0===e[t];var t=(t,i)=>{var r,o,[a,l,c]=i,s=0;if(a.some((t=>0!==e[t]))){for(r in l)n.o(l,r)&&(n.m[r]=l[r]);if(c)var m=c(n)}for(t&&t(i);s<a.length;s++)o=a[s],n.o(e,o)&&e[o]&&e[o][0](),e[o]=0;return n.O(m)},i=globalThis.webpackChunkmatador_plugin=globalThis.webpackChunkmatador_plugin||[];i.forEach(t.bind(null,0)),i.push=t.bind(null,i.push.bind(i))})();var r=n.O(void 0,[652],(()=>n(961)));r=n.O(r)})();