(()=>{"use strict";var e,t={407:()=>{const e=window.React,t=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"plover-kit/code-snippet","title":"Plover: Code Snippet","category":"plover-blocks","description":"Insert code snippets to current post","keywords":["code","snippet"],"textdomain":"plover-kit","version":"1.0.0","attributes":{"snippet":{"type":"number"}},"editorScript":"file:./index.js","editorStyle":"file:./index.min.css","style":"file:./style-index.min.css","render":"file:./render.php"}'),o=window.wp.blockEditor,n=window.wp.components,r=window.wp.i18n,l=window.wp.coreData,i=window.ploverKit.dashboard,a=window.plover.utils,p=window.plover.components;function s(t){return(0,e.createElement)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",...t},(0,e.createElement)(n.Path,{fillRule:"evenodd",d:"M14.447 3.026a.75.75 0 0 1 .527.921l-4.5 16.5a.75.75 0 0 1-1.448-.394l4.5-16.5a.75.75 0 0 1 .921-.527ZM16.72 6.22a.75.75 0 0 1 1.06 0l5.25 5.25a.75.75 0 0 1 0 1.06l-5.25 5.25a.75.75 0 1 1-1.06-1.06L21.44 12l-4.72-4.72a.75.75 0 0 1 0-1.06Zm-9.44 0a.75.75 0 0 1 0 1.06L2.56 12l4.72 4.72a.75.75 0 0 1-1.06 1.06L.97 12.53a.75.75 0 0 1 0-1.06l5.25-5.25a.75.75 0 0 1 1.06 0Z",clipRule:"evenodd"}))}const c=window.wp.blocks,{name:d}=t;!function(e){if(!e)return;const{metadata:t,settings:o,name:n}=e;(0,c.registerBlockType)({name:n,...t},o)}({name:d,metadata:t,settings:{icon:(0,e.createElement)(s,null),example:{},edit:function({attributes:t,setAttributes:c}){const d=(0,o.useBlockProps)();let m=(0,e.createElement)("p",null,(0,e.createElement)("span",{dangerouslySetInnerHTML:{__html:(0,r.sprintf)(/* translators: %s is the premium text and link. */ /* translators: %s is the premium text and link. */
(0,r.__)("Upgrade to %s to access this block.","plover-kit"),'<a href="'+(0,a.upsell_url)({utm_campaign:"code_snippet_block"})+'" target="_blank">'+(0,r.__)("Premium","plover-kit")+"</a>")}}),(0,e.createElement)("a",{href:"https://wpplover.com/docs/plover-kit/modules/code-snippets/#code-snippet-block",target:"_blank",style:{padding:"0 4px"}},(0,r.__)("Learn More ↗","plover-kit")));if((0,a.is_premium)()){m=(0,e.createElement)(n.Spinner,null);const{records:o,hasResolved:r}=(0,l.useEntityRecords)("postType","plover_code_snippet",{status:"draft,publish",per_page:-1});if(r){const n=[{value:"",label:""},...(o||[]).map((({id:e,title:t})=>({value:e,label:t.raw})))];m=(0,e.createElement)(i.Select,{label:null,value:t?.snippet,options:n,onChange:e=>{e=Number.parseInt(e),c({snippet:isNaN(e)?"":e})},__nextHasNoMarginBottom:!0})}}return(0,e.createElement)("div",{...d},(0,e.createElement)(o.InspectorControls,null,(0,e.createElement)(p.DocLink,{borderTop:!0,link:"https://wpplover.com/docs/plover-kit/modules/code-snippets/",text:(0,r.__)("Read Documentation ↗","plover-kit")})),(0,e.createElement)(n.Placeholder,{icon:(0,e.createElement)(s,{width:20}),label:(0,e.createElement)("span",{style:{padding:"0 6px"}},(0,r.__)("Plover: Code Snippet","plover-kit")),className:"plover-code-snippet-block-placeholder"},m))}}})}},o={};function n(e){var r=o[e];if(void 0!==r)return r.exports;var l=o[e]={exports:{}};return t[e](l,l.exports,n),l.exports}n.m=t,e=[],n.O=(t,o,r,l)=>{if(!o){var i=1/0;for(c=0;c<e.length;c++){for(var[o,r,l]=e[c],a=!0,p=0;p<o.length;p++)(!1&l||i>=l)&&Object.keys(n.O).every((e=>n.O[e](o[p])))?o.splice(p--,1):(a=!1,l<i&&(i=l));if(a){e.splice(c--,1);var s=r();void 0!==s&&(t=s)}}return t}l=l||0;for(var c=e.length;c>0&&e[c-1][2]>l;c--)e[c]=e[c-1];e[c]=[o,r,l]},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={169:0,1581:0};n.O.j=t=>0===e[t];var t=(t,o)=>{var r,l,[i,a,p]=o,s=0;if(i.some((t=>0!==e[t]))){for(r in a)n.o(a,r)&&(n.m[r]=a[r]);if(p)var c=p(n)}for(t&&t(o);s<i.length;s++)l=i[s],n.o(e,l)&&e[l]&&e[l][0](),e[l]=0;return n.O(c)},o=globalThis.webpackChunkplover_kit=globalThis.webpackChunkplover_kit||[];o.forEach(t.bind(null,0)),o.push=t.bind(null,o.push.bind(o))})();var r=n.O(void 0,[1581],(()=>n(407)));r=n.O(r)})();