!function(){"use strict";var e={n:function(t){var r=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(r,{a:r}),r},d:function(t,r){for(var n in r)e.o(r,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:r[n]})},o:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}},t=window.wp.i18n,r=window.wp.blocks,n=window.wp.components,o=window.wp.blockEditor,a=window.wp.data;function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var i=function(e){var r=e.attributes,a=e.setAttributes,i=e.allowedPostTypes;return React.createElement(o.InspectorControls,null,React.createElement(n.PanelBody,{title:(0,t.__)("Post types to display","siteseo")},i&&React.createElement(React.Fragment,null,React.createElement("p",null,(0,t.__)("By default, if you have not selected any post types below, we’ll automatically take the ones set from the Sitemap setting page.","siteseo")),React.createElement("ul",null,i.map((function(e){return React.createElement("li",{key:e.slug},React.createElement(n.CheckboxControl,{label:e.name,checked:r.postTypes.includes(e.slug),onChange:function(t){return o=e.slug,(n=r.postTypes,i=function(e){if(Array.isArray(e))return s(e)}(n)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(n)||function(e,t){if(e){if("string"==typeof e)return s(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?s(e,t):void 0}}(n)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).includes(o)?i=i.filter((function(e){return e!==o})):i.push(o),void a({postTypes:i});var n,o,i}}))}))))))},l=window.wp.serverSideRender,c=e.n(l);function p(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function u(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}(0,r.registerBlockType)("siteseo/sitemap",{title:(0,t.__)("Sitemap","siteseo"),description:(0,t.__)("Display an HTML sitemap.","siteseo"),keywords:[(0,t.__)("sitemap","siteseo"),(0,t.__)("navigation","siteseo")],edit:function(e){var r=e.attributes,s=e.setAttributes,l=r.isSiteMapEnabled,f=r.optionsPageUrl,m=(0,t.__)("It looks like the Sitemap feature is not enabled from your SEO settings. You must activate it to use this block. Make sure the HTML sitemap option is also enabled.","siteseo"),w=[{label:(0,t.__)("Review settings","siteseo"),url:f,variant:"primary",isPrimary:!0,noDefaultClasses:!0}],b=["attachment","wp_navigation","nav_menu_item","wp_block","wp_template","wp_template_part","wp_navigation"],y=(0,a.withSelect)((function(e,t){var r=e("core").getPostTypes({per_page:-1})||[],n=[];return r&&r.length&&(n=r.filter((function(e){return!b.includes(e.slug)}))),function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?p(Object(r),!0).forEach((function(t){u(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):p(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({allowedPostTypes:n},t)}))(i);return React.createElement("div",(0,o.useBlockProps)(),React.createElement(y,{attributes:r,setAttributes:s}),l?React.createElement(c(),{block:"siteseo/sitemap",attributes:r}):React.createElement(n.Notice,{status:"warning",isDismissible:!1,actions:w},React.createElement("p",null,m)))},save:function(){return null}})}();