import{h as N,r as B,m as E}from"../js/utils.68c800e0.js";import{aq as _,f as m,i as y,a0 as u,R as p,j as i,U as n,T as A,ae as f,Q as w,M as v,O as I,ad as U,P as M,an as j,h as L}from"../js/vendor-vue-ui.f00a1236.js";import{y as J,b as Z,aq as H,l as z}from"../js/app-core.b862f9c8.js";import{l as q}from"../js/index.18357c0f.js";import{u as G}from"../js/JsonValues.a0694556.js";import{S as F}from"../js/AddPlus.f0e1a4b0.js";import{S as Q}from"../js/Close.de45e465.js";import{S as W}from"../js/External.e3085be4.js";import{_ as C}from"../js/_plugin-vue_export-helper.eefbdd86.js";import{_ as s}from"../js/vendor-other.7b559694.js";import{u as K}from"../js/PostTypes.54ea30b8.js";import{B as X}from"../js/HighlightToggle.ff63a064.js";import{C as Y}from"../js/Tooltip.cb3a78f6.js";import{G as ee,a as te}from"../js/Row.2a7735dd.js";import{l as se}from"../js/index.60474bd4.js";import{l as oe}from"../js/index.0d80c2c2.js";import"../js/vendor-lodash.d3ad8b99.js";import"../js/Checkbox.e62f1ba4.js";import"../js/Checkmark.af3294f4.js";import"../js/Radio.b5155ca9.js";import"../js/Button.6c09d515.js";import"../js/Input.af82b72e.js";import"../js/Index.3967c277.js";import"../js/Pencil.1ca5815a.js";import"../js/Trash.c3e8db0b.js";import"../js/Select.952b21a0.js";import"../js/Caret.e6c9f7cc.js";import"../js/Toggle.b43ed20a.js";const ae=N` `,ne="aioseo/html-sitemap",le="AIOSEO - HTML Sitemap",ie="Displays a sitemap with your site's posts and terms.",re="widgets",de={default:{type:"boolean",default:!0},post_types:{type:"string",default:'["post", "page"]'},post_types_all:{type:"boolean",default:!0},taxonomies:{type:"string",default:'["category", "post_tag"]'},taxonomies_all:{type:"boolean",default:!0},show_label:{type:"boolean",default:!0},archives:{type:"boolean",default:!1},publication_date:{type:"boolean",default:!0},nofollow_links:{type:"boolean",default:!1},order_by:{type:"string",default:"publish_date"},order:{type:"string",default:"asc"},excluded_posts:{type:"string",default:"[]"},excluded_terms:{type:"string",default:"[]"},is_admin:{type:"boolean"}},ce={html:!1},ue={name:ne,title:le,description:ie,category:re,attributes:de,supports:ce},V="all-in-one-seo-pack",pe={setup(){const{getJsonValues:e,setJsonValues:t}=G();return{getJsonValues:e,optionsStore:J(),setJsonValues:t}},components:{SvgAddPlus:F,SvgClose:Q,SvgExternal:W},props:{type:{type:String,required:!0}},data(){return{excludeOptions:[],strings:{typeToSearch:s("Type to search...",V),noOptionsPosts:s("Begin typing a post ID, title or slug to search...",V),noOptionsTerms:s("Begin typing a term ID or name to search...",V),noResult:s("No results found for your search. Try again!",V),clear:s("Clear",V),id:s("ID",V),type:s("Type",V)}}},computed:{optionName:{get(){return this.type==="posts"?JSON.parse(this.$root.$data.excluded_posts):JSON.parse(this.$root.$data.excluded_terms)},set(e){if(e=JSON.stringify(e),this.type==="posts"){this.$root.$data.excluded_posts=e;return}this.$root.$data.excluded_terms=e}},noOptions(){return this.type==="posts"?this.strings.noOptionsPosts:this.strings.noOptionsTerms}},methods:{processGetObjects(e){return this.optionsStore.getObjects({query:e,type:this.type}).then(t=>{this.excludeOptions=t.body.objects})},getOptionTitle(e,t){e=e.replace(/<\/?[^>]+(>|$)/g,""),t=t.replace(/<\/?[^>]+(>|$)/g,"");const r=new RegExp(`(${t})`,"gi");return e.replace(r,'$1')}}},me={class:"aioseo-exclude-posts"},ge={class:"option"},_e=["innerHTML"],he={class:"option-details"},be=["href"],ye={class:"multiselect__tag"},fe={class:"multiselect__tag-value"},ve=["onClick"];function $e(e,t,r,g,a,d){const b=_("svg-add-plus"),$=_("base-button"),S=_("svg-external"),h=_("svg-close"),l=_("base-select");return m(),y("div",me,[u(l,{options:a.excludeOptions,"ajax-search":d.processGetObjects,size:"medium",multiple:"",modelValue:g.getJsonValues(d.optionName),"onUpdate:modelValue":t[0]||(t[0]=o=>d.optionName=g.setJsonValues(o)),placeholder:a.strings.typeToSearch},{noOptions:p(()=>[f(n(d.noOptions),1)]),noResult:p(()=>[f(n(a.strings.noResult),1)]),caret:p(({toggle:o})=>[u($,{class:"multiselect-toggle",style:{padding:"10px 13px",width:"40px",position:"absolute",height:"36px",right:"2px",top:"2px","text-align":"center",transition:"transform .2s ease"},type:"gray",onClick:o},{default:p(()=>[u(b,{style:{width:"14px",height:"14px",color:"black"}})]),_:1},8,["onClick"])]),option:p(({option:o,search:x})=>[i("div",ge,[i("div",{class:"option-title",innerHTML:d.getOptionTitle(o.label,x)},null,8,_e),i("div",he,[i("span",null,n(a.strings.id)+": #"+n(o.value),1),i("span",null,n(a.strings.type)+": "+n(o.type),1)])]),i("a",{class:"option-permalink",href:o.link,target:"_blank",onClick:A(()=>{},["stop"])},[u(S)],8,be)]),tag:p(({option:o,remove:x})=>[i("div",ye,[i("div",fe,n(o.label)+" - #"+n(o.value),1),i("div",{class:"multiselect__tag-remove",onClick:A(T=>x(o),["stop"])},[u(h,{onClick:A(T=>x(o),["stop"])},null,8,["onClick"])],8,ve)])]),_:1},8,["options","ajax-search","modelValue","placeholder"]),u($,{type:"gray",size:"small",onClick:t[1]||(t[1]=o=>d.optionName=[])},{default:p(()=>[f(n(a.strings.clear),1)]),_:1})])}const Se=C(pe,[["render",$e]]),O="all-in-one-seo-pack",Ve={setup(){const{getPostIconClass:e}=K();return{getPostIconClass:e,rootStore:Z()}},components:{BaseHighlightToggle:X,CoreTooltip:Y,GridColumn:te,GridRow:ee},props:{type:{type:String,required:!0},excluded:{type:Array,default(){return[]}}},data(){return{strings:{label:s("Label:",O),name:s("Slug:",O),includeAllPostTypes:s("Include All Post Types",O),includeAllTaxonomies:s("Include All Taxonomies",O)}}},computed:{includeAllSetting(){const e=this.type+"_all";return this.$root.$data[e]},objects(){const e=this.type==="taxonomies"?"taxonomies":"postTypes";return this.rootStore.aioseo.postData[e].filter(t=>!this.excluded.includes(t.name))}},methods:{getState(){return JSON.parse(this.$root.$data[this.type])},setState(e){this.$root.$data[this.type]=JSON.stringify(e)},getValue(e){return this.getState().includes(e.name)},updateValue(e,t){const r=this.getState();if(e){r.push(t.name),this.setState(r);return}const g=r.findIndex(a=>a===t.name);g!==-1&&(r.splice(g,1),this.setState(r))},isActive(e){return this.getState().findIndex(r=>r===e.name)!==-1}}},xe={class:"aioseo-included-objects-toggle"},ke={class:"included-objects-settings"},we={class:"aioseo-description"};function Oe(e,t,r,g,a,d){const b=_("base-toggle"),$=_("core-tooltip"),S=_("base-highlight-toggle"),h=_("grid-column"),l=_("grid-row");return m(),y("div",xe,[i("div",ke,[r.type==="post_types"?(m(),w(b,{key:0,size:"medium",modelValue:e.$root.$data.post_types_all,"onUpdate:modelValue":t[0]||(t[0]=o=>e.$root.$data.post_types_all=o)},{default:p(()=>[f(n(a.strings.includeAllPostTypes),1)]),_:1},8,["modelValue"])):v("",!0),r.type==="taxonomies"?(m(),w(b,{key:1,size:"medium",modelValue:e.$root.$data.taxonomies_all,"onUpdate:modelValue":t[1]||(t[1]=o=>e.$root.$data.taxonomies_all=o)},{default:p(()=>[f(n(a.strings.includeAllTaxonomies),1)]),_:1},8,["modelValue"])):v("",!0),0[(m(!0),y(I,null,U(d.objects,(o,x)=>(m(),w(h,{md:"6",key:x},{default:p(()=>[u(S,{size:"medium",active:d.isActive(o),name:o.name,type:"checkbox",modelValue:d.getValue(o),"onUpdate:modelValue":T=>d.updateValue(T,o)},{default:p(()=>[u($,null,{tooltip:p(()=>[i("div",we,[f(n(a.strings.label)+" ",1),i("strong",null,n(o.label),1),t[2]||(t[2]=i("br",null,null,-1)),f(" "+n(a.strings.name)+" ",1),i("strong",null,n(o.name),1)])]),default:p(()=>[i("span",{class:M(["icon dashicons",g.getPostIconClass(o.icon)])},null,2)]),_:2},1024),f(" "+n(o.label),1)]),_:2},1032,["active","name","modelValue","onUpdate:modelValue"])]),_:2},1024))),128))]),_:1})):v("",!0)])])}const Te=C(Ve,[["render",Oe]]),c="all-in-one-seo-pack",Ae={components:{HtmlSitemapExcludeObjects:Se,HtmlSitemapIncludedObjects:Te},data(){return{sortDirections:[{label:s("Ascending",c),value:"asc"},{label:s("Descending",c),value:"desc"}],sortOrders:[{label:s("Publish Date",c),value:"publish_date"},{label:s("Last Updated",c),value:"last_updated"},{label:s("Alphabetical",c),value:"alphabetical"},{label:s("Post/Term ID",c),value:"id"}],strings:{useDefault:s("Use Default Settings",c),postTypes:s("Post Types",c),taxonomies:s("Taxonomies",c),includeAllPostTypes:s("Include All Post Types",c),includeAllTaxonomies:s("Include All Taxonomies",c),showLabel:s("Show Labels",c),publicationDate:s("Show Publication Date",c),archives:s("Compact Archives",c),sortOrder:s("Sort Order",c),sortDirection:s("Sort Direction",c),excludePostsPages:s("Exclude Posts / Pages",c),excludeTerms:s("Exclude Terms",c)}}},methods:{getSortOrder(e){return this.sortOrders.find(t=>t.value===e)},getSortDirection(e){return this.sortDirections.find(t=>t.value===e)}}},Pe={class:"aioseo-html-sitemap-sidebar"},Ce={class:"sidebar-row"},He={class:"sidebar-row"},De={key:0,class:"sidebar-row"},Ie={key:1,class:"sidebar-row"},Re={key:2,class:"sidebar-row"},Ne={class:"aioseo-sidebar-title"},Be={key:3,class:"sidebar-row"},Ee={class:"aioseo-sidebar-title"},Ue={key:4,class:"sidebar-row"},Me={class:"aioseo-sidebar-title"},je={class:"sidebar-row"},Le={class:"aioseo-sidebar-title"},Je={key:5,class:"sidebar-row"},Ze={class:"aioseo-sidebar-title"},ze={key:6,class:"sidebar-row"},qe={class:"aioseo-sidebar-title"};function Ge(e,t,r,g,a,d){const b=_("base-toggle"),$=_("html-sitemap-included-objects"),S=_("base-select"),h=_("html-sitemap-exclude-objects");return m(),y("div",Pe,[i("div",Ce,[u(b,{modelValue:e.$root.$data.default,"onUpdate:modelValue":t[0]||(t[0]=l=>e.$root.$data.default=l)},{default:p(()=>[f(n(a.strings.useDefault),1)]),_:1},8,["modelValue"])]),e.$root.$data.default?v("",!0):(m(),y(I,{key:0},[i("div",He,[u(b,{modelValue:e.$root.$data.archives,"onUpdate:modelValue":t[1]||(t[1]=l=>e.$root.$data.archives=l)},{default:p(()=>[f(n(a.strings.archives),1)]),_:1},8,["modelValue"])]),e.$root.$data.archives?v("",!0):(m(),y("div",De,[u(b,{modelValue:e.$root.$data.show_label,"onUpdate:modelValue":t[2]||(t[2]=l=>e.$root.$data.show_label=l)},{default:p(()=>[f(n(a.strings.showLabel),1)]),_:1},8,["modelValue"])])),e.$root.$data.archives?v("",!0):(m(),y("div",Ie,[u(b,{modelValue:e.$root.$data.publication_date,"onUpdate:modelValue":t[3]||(t[3]=l=>e.$root.$data.publication_date=l)},{default:p(()=>[f(n(a.strings.publicationDate),1)]),_:1},8,["modelValue"])])),e.$root.$data.archives?v("",!0):(m(),y("div",Re,[i("p",Ne,n(a.strings.postTypes),1),u($,{type:"post_types",excluded:["attachment"]})])),e.$root.$data.archives?v("",!0):(m(),y("div",Be,[i("p",Ee,n(a.strings.taxonomies),1),u($,{type:"taxonomies"})])),e.$root.$data.archives?v("",!0):(m(),y("div",Ue,[i("p",Me,n(a.strings.sortOrder),1),u(S,{size:"medium",options:a.sortOrders,modelValue:d.getSortOrder(e.$root.$data.order_by),"onUpdate:modelValue":t[4]||(t[4]=l=>e.$root.$data.order_by=l.value),"track-by":"value"},null,8,["options","modelValue"])])),i("div",je,[i("p",Le,n(a.strings.sortDirection),1),u(S,{size:"medium",options:a.sortDirections,modelValue:d.getSortDirection(e.$root.$data.order),"onUpdate:modelValue":t[5]||(t[5]=l=>e.$root.$data.order=l.value),"track-by":"value"},null,8,["options","modelValue"])]),e.$root.$data.archives?v("",!0):(m(),y("div",Je,[i("p",Ze,n(a.strings.excludePostsPages),1),u(h,{type:"posts"})])),e.$root.$data.archives?v("",!0):(m(),y("div",ze,[i("p",qe,n(a.strings.excludeTerms),1),u(h,{type:"terms"})]))],64))])}const Fe=C(Ae,[["render",Ge]]),Qe="all-in-one-seo-pack",{name:R,title:We,description:Ke,category:Xe,supports:Ye,attributes:et}=ue,k=window.wp,tt=k.serverSideRender||k.components.ServerSideRender,st=k.blockEditor?.InspectorControls||k.editor.InspectorControls,ot=k.components.PanelBody,P={},D=[],at={title:We,description:Ke,category:Xe,supports:Ye,attributes:et,icon:ae,edit:function(e){const{setAttributes:t,attributes:r,clientId:g,isSelected:a,toggleSelection:d}=e,b="aioseo-"+g;r.is_admin=window?.location&&window?.location?.pathname.startsWith("/wp-admin/");const $={id:b,parent:document.querySelector(".block-editor"),subtree:!0,loop:!1,done:function(h){E(g,D);let l=j({name:"Blocks/HtmlSitemap",data:function(){return P[g]},watch:{$data:{handler:function(o){t(o)},deep:!0}},render:()=>L(Fe)});l=q(l),l=se(l),l=oe(l),z(l),l.mount(h),D.push({id:g,app:l})}};return a&&(P[g]={},Object.keys(r).forEach(h=>{P[g][h]=r[h]}),H($)),k.data.useSelect(h=>h("core/edit-post").getActiveGeneralSidebarName())==="edit-post/block"&&(typeof d!="function"||d(!0)),React.createElement(React.Fragment,null,React.createElement(st,null,React.createElement(ot,{title:s("Block Settings",Qe),initialOpen:!0,onToggle:H($)},React.createElement("div",{id:b}))),React.createElement(tt,{block:R,attributes:{...r}}))},save:function(){return null}};B({name:R,settings:at});