HEX
Server: Apache/2.4.65 (Debian)
System: Linux 88f31f35b0b8 6.1.0-38-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.147-1 (2025-08-02) x86_64
User: www-data (33)
PHP: 8.2.29
Disabled: NONE
Upload Files
File: /var/www/html/wp-content/plugins/wp-seopress/public/admin/settings.js
(()=>{"use strict";var e,s,t={9654:(e,s,t)=>{t.d(s,{Z:()=>o});var a=t(9196),n=t(5736),r=t(3781);const l={titles:{id:"ctx-titles",icon:"edit",title:(0,n.__)("Need more control over your titles?","wp-seopress"),body:(0,n.__)("PRO adds AI-powered title generation, advanced breadcrumbs, and more.","wp-seopress"),cta_text:(0,n.__)("Discover PRO","wp-seopress")},sitemaps:{id:"ctx-sitemaps",icon:"networking",title:(0,n.__)("Video & News Sitemaps","wp-seopress"),body:(0,n.__)("Get your videos and news articles indexed faster with dedicated sitemaps.","wp-seopress"),cta_text:(0,n.__)("Learn more","wp-seopress")},analytics:{id:"ctx-analytics",icon:"chart-area",title:(0,n.__)("Advanced Analytics & Events","wp-seopress"),body:(0,n.__)("Track custom events, download tracking, affiliate links, and more with PRO.","wp-seopress"),cta_text:(0,n.__)("Explore features","wp-seopress")},advanced:{id:"ctx-advanced",icon:"admin-settings",title:(0,n.__)("Redirections, Broken Links & 404 Monitoring","wp-seopress"),body:(0,n.__)("Manage redirections, monitor 404 errors, and fix broken links automatically.","wp-seopress"),cta_text:(0,n.__)("Get PRO","wp-seopress")},social:{id:"ctx-social",icon:"share",title:(0,n.__)("Enhanced Social Media Integration","wp-seopress"),body:(0,n.__)("Unlock advanced Open Graph controls, social preview, and more with PRO.","wp-seopress"),cta_text:(0,n.__)("Discover PRO","wp-seopress")},"instant-indexing":{id:"ctx-instant-indexing",icon:"superhero",title:(0,n.__)("Instant Indexing for Google","wp-seopress"),body:(0,n.__)("Automatically submit your pages to Google's Indexing API for faster crawling.","wp-seopress"),cta_text:(0,n.__)("Learn more","wp-seopress")},tools:{id:"ctx-tools",icon:"admin-tools",title:(0,n.__)("Advanced SEO Tools","wp-seopress"),body:(0,n.__)("Unlock redirections, 404 monitoring, broken link checker, and htaccess editor with PRO.","wp-seopress"),cta_text:(0,n.__)("Get PRO","wp-seopress")}},o=()=>{const e=window.SEOPRESS_SETTINGS_DATA||{},{pageType:s}=(0,r.i3)(),t=e.IS_PRO_ACTIVE,o=e.DOCS_LINKS||{},i=l[s]||e.PROMOTIONS||null,c=i?`seopress_promo_dismissed_${i.id}`:null,[p,d]=(0,a.useState)((()=>{if(!c)return!1;try{const e=localStorage.getItem(c);if(!e)return!1;const s=parseInt(e,10);return Date.now()<s||(localStorage.removeItem(c),!1)}catch{return!1}})),[m,u]=(0,a.useState)(!1),_=i?.cta_url||o?.addons?.pro||"https://www.seopress.org/wordpress-seo-plugins/pro/",E=(0,a.useCallback)((s=>{if(s.preventDefault(),s.stopPropagation(),m||!i)return;u(!0);const t=new FormData;t.append("action","seopress_dismiss_promotion"),t.append("promo_id",i.id),t.append("duration","30"),t.append("_ajax_nonce",e.PROMO_NONCE||""),fetch(e.AJAX_URL,{method:"POST",credentials:"same-origin",body:t}).then((e=>e.json())).then((()=>{if(c)try{const e=Date.now()+2592e6;localStorage.setItem(c,String(e))}catch{}d(!0)})).catch((()=>{u(!1)}))}),[m,i,c,e.PROMO_NONCE,e.AJAX_URL]);return!i||t||p?null:React.createElement("div",{className:"seopress-contextual-promo","data-promo-id":i.id},React.createElement("div",{className:"promo-content"},i.icon&&React.createElement("div",{className:"promo-icon"},React.createElement("span",{className:`dashicons dashicons-${i.icon}`})),React.createElement("div",{className:"promo-text"},i.title&&React.createElement("h4",{className:"promo-title"},i.title),i.body&&React.createElement("p",{className:"promo-body"},i.body)),i.cta_text&&React.createElement("a",{href:_,className:"btn btnSecondary promo-cta",target:"_blank",rel:"noopener noreferrer"},i.cta_text),React.createElement("button",{type:"button",className:"promo-dismiss","data-promo-id":i.id,"data-dismiss-duration":"30","aria-label":(0,n.__)("Dismiss","wp-seopress"),onClick:E,disabled:m,style:m?{opacity:.5}:void 0},React.createElement("span",{className:"dashicons dashicons-no-alt"}))))}},5124:(e,s,t)=>{t.d(s,{Z:()=>o});var a=t(9196),n=t.n(a),r=t(5736),l=t(9818);const o=({featureKey:e})=>{const s=()=>!!e&&"1"===SEOPRESS_SETTINGS_DATA.FEATURE_TOGGLES?.[e],[t,o]=(0,a.useState)(s),[i,c]=(0,a.useState)(!1);(0,a.useEffect)((()=>{o(s())}),[e]);const p=(0,a.useCallback)((async()=>{if(i)return;const s=t?"0":"1";o(!t),c(!0);try{const t=new FormData;t.append("action","seopress_toggle_features"),t.append("feature","toggle-"+e),t.append("feature_value",s),t.append("_ajax_nonce",SEOPRESS_SETTINGS_DATA.TOGGLE_NONCE),await fetch(SEOPRESS_SETTINGS_DATA.AJAX_URL,{method:"POST",body:t}),SEOPRESS_SETTINGS_DATA.FEATURE_TOGGLES&&(SEOPRESS_SETTINGS_DATA.FEATURE_TOGGLES[e]=s),(0,l.dispatch)("core/notices").createSuccessNotice((0,r.__)("Feature has been successfully updated!","wp-seopress"),{type:"snackbar",isDismissible:!0})}catch{o(t),(0,l.dispatch)("core/notices").createErrorNotice((0,r.__)("Failed to update feature.","wp-seopress"),{type:"snackbar",isDismissible:!0})}finally{c(!1)}}),[t,e,i]);if(!e)return null;const d="toggle-"+e;return n().createElement(n().Fragment,null,n().createElement("input",{type:"checkbox",name:d,id:d,className:"toggle","data-toggle":t?"1":"0",checked:t,onChange:p}),n().createElement("label",{htmlFor:d}),t?n().createElement("span",{className:"feature-state"},n().createElement("span",{className:"dashicons dashicons-arrow-left-alt"}),(0,r.__)("Click to disable this feature","wp-seopress")):n().createElement("span",{className:"feature-state"},n().createElement("span",{className:"dashicons dashicons-arrow-left-alt"}),(0,r.__)("Click to enable this feature","wp-seopress")))}},953:(e,s,t)=>{t.d(s,{F8:()=>b,lS:()=>h,Ev:()=>y,FH:()=>g,P4:()=>S,mg:()=>c,nv:()=>r,XL:()=>o,gE:()=>i});var a=t(9196),n=t.n(a);const r=({label:e,value:s,onChange:t,onBlur:a,help:r,placeholder:l,className:o,error:i})=>n().createElement("div",{className:`seopress-field seopress-text-field ${i?"has-error":""} ${o||""}`},n().createElement("div",{className:"seopress-input-wrapper"},n().createElement("input",{type:"text",className:"seopress-input",value:s||"",onChange:e=>t(e.target.value),onBlur:a,placeholder:l})),i&&n().createElement("div",{className:"seopress-field-error"},i),r&&!i&&n().createElement("div",{className:"seopress-field-help"},r));var l=t(5609);const o=({label:e,value:s,onChange:t,onBlur:a,help:r,placeholder:o,rows:i,className:c,error:p})=>n().createElement("div",{className:`seopress-field seopress-textarea-field ${p?"has-error":""} ${c||""}`},n().createElement(l.TextareaControl,{label:e,value:s||"",onChange:t,onBlur:a,help:p||r,placeholder:o,rows:i||4,className:p?"has-error":""}),p&&n().createElement("div",{className:"seopress-field-error"},p)),i=({label:e,checked:s,onChange:t,help:a,className:r})=>{const o="1"===s||!0===s;return n().createElement("div",{className:`seopress-field seopress-toggle-field ${r||""}`},n().createElement(l.ToggleControl,{label:e,checked:o,onChange:e=>{t(e?"1":"")},help:a}))},c=({label:e,value:s,onChange:t,options:a,help:r,className:o})=>n().createElement("div",{className:`seopress-field seopress-select-field ${o||""}`},n().createElement(l.SelectControl,{label:e,value:s||"",options:a,onChange:t,help:r}));var p=t(5736);const d=[{key:"%%sitetitle%%",label:(0,p.__)("Site title","wp-seopress")},{key:"%%sep%%",label:(0,p.__)("Separator","wp-seopress")},{key:"%%tagline%%",label:(0,p.__)("Tagline","wp-seopress")}];function m(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function u(e){if(!e)return"";let s="";for(const t of e.childNodes)Node.TEXT_NODE===t.nodeType?s+=t.textContent:Node.ELEMENT_NODE===t.nodeType&&(t.dataset&&t.dataset.var?s+=t.dataset.var:"BR"===t.tagName?s+="\n":"DIV"===t.tagName||"P"===t.tagName?(s.length>0&&!s.endsWith("\n")&&(s+="\n"),s+=u(t)):s+=u(t));return s}function _(e){for(const s of e.childNodes){if(Node.TEXT_NODE===s.nodeType&&/%%[a-zA-Z0-9_]+%%/.test(s.textContent))return!0;if(Node.ELEMENT_NODE===s.nodeType&&!s.dataset?.var&&_(s))return!0}return!1}const E=(0,a.forwardRef)((({value:e,onChange:s,variableLabels:t,multiline:r,placeholder:l},o)=>{const i=(0,a.useRef)(null),c=(0,a.useRef)(e||""),d=(0,a.useRef)(!1),E=(0,a.useRef)(null),h=(0,a.useCallback)((e=>{const s=i.current;s&&(s.innerHTML=function(e,s){if(!e)return"";const t=[],a=/%%([a-zA-Z0-9_]+)%%/g;let n,r=0;for(;null!==(n=a.exec(e));){if(n.index>r){const s=e.substring(r,n.index);t.push(m(s).replace(/\n/g,"<br>"))}const a=n[0],l=m(s[a]||n[1]),o=m(a);t.push(`<span class="seopress-token" contenteditable="false" draggable="true" data-var="${o}" title="${o}"><span class="seopress-token-label">${l}</span><button type="button" class="seopress-token-remove" tabindex="-1" aria-label="${(0,p.__)("Remove","wp-seopress")}">×</button></span>`),r=n.index+n[0].length}if(r<e.length){const s=e.substring(r);t.push(m(s).replace(/\n/g,"<br>"))}return t.join("")}(e,t),c.current=e||"")}),[t]);(0,a.useEffect)((()=>{h(e||"")}),[]),(0,a.useEffect)((()=>{const s=c.current;e===s||d.current||h(e||"")}),[e,h]);const g=(0,a.useCallback)((()=>{const e=i.current;if(!e)return;const t=u(e);c.current=t,s(t)}),[s]),b=(0,a.useCallback)((e=>{e.preventDefault();const s=e.clipboardData.getData("text/plain");document.execCommand("insertText",!1,s)}),[]),v=(0,a.useCallback)((e=>{r||"Enter"!==e.key||e.preventDefault()}),[r]),w=(0,a.useCallback)((e=>{e.target.classList.contains("seopress-token-remove")&&e.preventDefault()}),[]),f=(0,a.useCallback)((e=>{if(e.target.classList.contains("seopress-token-remove")){e.preventDefault(),e.stopPropagation();const s=e.target.closest(".seopress-token");s&&s.parentNode&&(s.parentNode.removeChild(s),g(),i.current?.focus())}}),[g]),S=(0,a.useCallback)((()=>{d.current=!0}),[]),y=(0,a.useCallback)((()=>{d.current=!1;const e=i.current;if(!e)return;const t=u(e).trim();(_(e)||!t&&e.innerHTML)&&h(t),t!==c.current&&(c.current=t,s(t))}),[h,s]),k=(0,a.useCallback)((()=>{const e=i.current;e&&(E.current&&(E.current.classList.remove("seopress-token--dragging"),E.current=null),e.querySelectorAll(".seopress-token--drop-before, .seopress-token--drop-after").forEach((e=>{e.classList.remove("seopress-token--drop-before","seopress-token--drop-after")})))}),[]),N=(0,a.useCallback)((e=>{const s=e.target.closest(".seopress-token");s&&(E.current=s,s.classList.add("seopress-token--dragging"),e.dataTransfer.effectAllowed="move",e.dataTransfer.setData("text/plain",s.dataset.var))}),[]),T=(0,a.useCallback)((e=>{if(!E.current)return;e.preventDefault(),e.dataTransfer.dropEffect="move";const s=i.current;if(!s)return;s.querySelectorAll(".seopress-token--drop-before, .seopress-token--drop-after").forEach((e=>{e.classList.remove("seopress-token--drop-before","seopress-token--drop-after")}));const t=s.querySelectorAll(".seopress-token:not(.seopress-token--dragging)");let a=null,n=!0,r=1/0;t.forEach((s=>{const t=s.getBoundingClientRect(),l=t.left+t.width/2,o=Math.abs(e.clientX-l);o<r&&(r=o,a=s,n=e.clientX<l)})),a&&a.classList.add(n?"seopress-token--drop-before":"seopress-token--drop-after")}),[]),C=(0,a.useCallback)((e=>{e.preventDefault();const s=i.current,t=E.current;if(!s||!t)return;const a=s.querySelector(".seopress-token--drop-before"),n=s.querySelector(".seopress-token--drop-after");a?s.insertBefore(t,a):n&&n.nextSibling?s.insertBefore(t,n.nextSibling):s.appendChild(t),k(),g()}),[k,g]),x=(0,a.useCallback)((()=>{k()}),[k]),A=(0,a.useCallback)((e=>{const s=i.current;if(!s)return;u(s).trim()||(s.innerHTML="");const a=t[e]||e.replace(/%%/g,""),n=document.createElement("span");n.className="seopress-token",n.contentEditable="false",n.draggable=!0,n.dataset.var=e,n.title=e;const r=document.createElement("span");r.className="seopress-token-label",r.textContent=a,n.appendChild(r);const l=document.createElement("button");l.type="button",l.className="seopress-token-remove",l.tabIndex=-1,l.setAttribute("aria-label",(0,p.__)("Remove","wp-seopress")),l.textContent="×",n.appendChild(l),s.appendChild(n);const o=document.createTextNode(" ");s.appendChild(o),s.focus();const c=window.getSelection(),d=document.createRange();d.setStartAfter(o),d.collapse(!0),c.removeAllRanges(),c.addRange(d),g()}),[t,g]),P=(0,a.useCallback)((()=>{const e=i.current;e&&(e.innerHTML="",c.current="",s(""))}),[s]);return(0,a.useImperativeHandle)(o,(()=>({insertVariable:A,clearAll:P,focus:()=>i.current?.focus()}))),n().createElement("div",{ref:i,className:"seopress-token-editor"+(r?" seopress-token-editor--multiline":""),contentEditable:!0,suppressContentEditableWarning:!0,onInput:g,onPaste:b,onKeyDown:v,onMouseDown:w,onClick:f,onFocus:S,onBlur:y,onDragStart:N,onDragOver:T,onDrop:C,onDragEnd:x,"data-placeholder":l||"",role:"textbox","aria-multiline":r||!1})}));E.displayName="TokenEditor";const h=({value:e,onChange:s,help:t,placeholder:r,multiline:o,className:i,quickVars:c})=>{const[m,u]=(0,a.useState)(!1),[_,h]=(0,a.useState)(""),[g,b]=(0,a.useState)(0),v=(0,a.useRef)(null),w=(0,a.useRef)(null),f=(0,a.useRef)(null),S="undefined"!=typeof SEOPRESS_SETTINGS_DATA&&SEOPRESS_SETTINGS_DATA.DYNAMIC_VARIABLES||{},y="undefined"!=typeof SEOPRESS_SETTINGS_DATA&&SEOPRESS_SETTINGS_DATA.PREVIEW_VALUES||{},k=c||d,N=(0,a.useMemo)((()=>function(e){if(!e)return new Set;const s=new Set,t=/%%[a-zA-Z0-9_]+%%/g;let a;for(;null!==(a=t.exec(e));)s.add(a[0]);return s}(e)),[e]),T=(0,a.useMemo)((()=>{if("undefined"!=typeof SEOPRESS_SETTINGS_DATA&&SEOPRESS_SETTINGS_DATA.OPTION_NAME)try{const e=document.getElementById("seopress-admin-settings-root");if(e&&e.__seopressSettings)return e.__seopressSettings.seopress_titles_sep||"-"}catch(e){}return"-"}),[]),C=(0,a.useMemo)((()=>{const e=_.toLowerCase();return Object.entries(S).filter((([s,t])=>s.toLowerCase().includes(e)||t.toLowerCase().includes(e)))}),[S,_]);(0,a.useEffect)((()=>{b(0)}),[C.length]);const x=(0,a.useCallback)((e=>{v.current&&v.current.insertVariable(e),u(!1),h(""),b(0)}),[]),A=(0,a.useCallback)((()=>{v.current&&v.current.clearAll()}),[]),P=(0,a.useCallback)((e=>{"ArrowDown"===e.key?(e.preventDefault(),b((e=>e<C.length-1?e+1:0))):"ArrowUp"===e.key?(e.preventDefault(),b((e=>e>0?e-1:C.length-1))):"Enter"===e.key?(e.preventDefault(),C[g]&&x(C[g][0])):"Escape"===e.key&&(u(!1),h(""),b(0))}),[C,g,x]);(0,a.useEffect)((()=>{if(m&&f.current){const e=f.current.querySelector(".seopress-variable-item--highlighted");e&&e.scrollIntoView({block:"nearest"})}}),[g,m]),(0,a.useEffect)((()=>{m&&w.current&&w.current.focus()}),[m]);const R=(0,a.useMemo)((()=>function(e,s,t,a){if(!e)return"";const n={...t};return a&&(n["%%sep%%"]=a),e.replace(/%%([a-zA-Z0-9_]+)%%/g,(e=>n[e]?n[e]:s[e]||e.replace(/%%/g,"")))}(e,S,y,T)),[e,S,y,T]),D=e&&e.trim().length>0;return n().createElement("div",{className:`seopress-field seopress-dynamic-tag-field ${i||""}`},n().createElement("div",{className:"seopress-token-editor-wrapper"},n().createElement(E,{ref:v,value:e,onChange:s,variableLabels:S,multiline:o,placeholder:r}),D&&n().createElement("button",{type:"button",className:"seopress-token-clear-btn",onClick:A,title:(0,p.__)("Clear all","wp-seopress"),"aria-label":(0,p.__)("Clear all","wp-seopress")},"×")),D&&R&&n().createElement("div",{className:"seopress-token-preview"},n().createElement("span",{className:"seopress-token-preview-label"},(0,p.__)("Preview:","wp-seopress"))," ",n().createElement("span",{className:"seopress-token-preview-text"},R)),n().createElement("div",{className:"seopress-variable-chips"},k.map((e=>{const s=N.has(e.key);return n().createElement("button",{key:e.key,type:"button",className:"seopress-variable-chip"+(s?" seopress-variable-chip--used":""),onClick:()=>x(e.key)},n().createElement("span",{className:"seopress-chip-icon"},s?"✓":"+"),n().createElement("span",{className:"seopress-chip-label"},e.label))})),n().createElement("div",{className:"seopress-more-variables-wrapper"},n().createElement("button",{type:"button",className:"seopress-more-variables-btn",onClick:()=>u(!m),"aria-expanded":m},n().createElement("span",{className:"dashicons dashicons-arrow-down-alt2"})),m&&n().createElement(l.Popover,{className:"seopress-variables-popover",position:"bottom left",onClose:()=>{u(!1),h(""),b(0)}},n().createElement("div",{className:"seopress-variables-list"},n().createElement("input",{ref:w,type:"text",className:"seopress-variables-search",placeholder:(0,p.__)("Search variables...","wp-seopress"),value:_,onChange:e=>h(e.target.value),onKeyDown:P,autoFocus:!0}),n().createElement("ul",{ref:f},C.map((([e,s],t)=>{const a=N.has(e),r=t===g;return n().createElement("li",{key:e,className:(r?"seopress-variable-item--highlighted":"")+(a?" seopress-variable-item--used":""),onClick:()=>x(e),onKeyDown:s=>{"Enter"!==s.key&&" "!==s.key||(s.preventDefault(),x(e))},onMouseEnter:()=>b(t),tabIndex:0,role:"button"},n().createElement("code",null,e),n().createElement("span",null,s,a&&n().createElement("span",{className:"seopress-variable-used-badge"},(0,p.__)("in use","wp-seopress"))))})),0===C.length&&n().createElement("li",{className:"seopress-no-results"},(0,p.__)("No variables found","wp-seopress"))))))),t&&n().createElement("div",{className:"seopress-field-help"},t))},g=({value:e,onChange:s,help:t,placeholder:r})=>{const[o,i]=(0,a.useState)(!1),c=(0,a.useCallback)((()=>{const e=wp.media({title:(0,p.__)("Select or Upload an Image","wp-seopress"),button:{text:(0,p.__)("Use this image","wp-seopress")},multiple:!1,library:{type:"image"}});e.on("select",(()=>{const t=e.state().get("selection").first().toJSON();s(t.url)})),e.open()}),[s]),d=(0,a.useCallback)((()=>{s(""),i(!1)}),[s]);return n().createElement("div",{className:"seopress-field seopress-media-upload-field"},n().createElement("div",{className:"seopress-media-upload-wrapper"},n().createElement("input",{type:"text",className:"seopress-input",value:e||"",onChange:e=>s(e.target.value),placeholder:r||"https://"}),n().createElement("div",{className:"seopress-media-upload-buttons"},n().createElement("button",{type:"button",className:"btn btnSecondary",onClick:c},(0,p.__)("Upload an Image","wp-seopress")),e&&n().createElement("button",{type:"button",className:"btn btnLink is-deletable",onClick:()=>i(!0)},(0,p.__)("Remove","wp-seopress")))),e&&n().createElement("div",{className:"seopress-media-upload-preview"},n().createElement("img",{src:e,alt:""})),t&&n().createElement("div",{className:"seopress-field-help"},t),o&&n().createElement(l.Modal,{title:(0,p.__)("Remove image","wp-seopress"),onRequestClose:()=>i(!1),className:"seopress-confirm-modal"},n().createElement("p",null,(0,p.__)("Are you sure you want to remove this image?","wp-seopress")),n().createElement("div",{className:"seopress-confirm-modal-actions"},n().createElement(l.Button,{variant:"secondary",onClick:()=>i(!1)},(0,p.__)("Cancel","wp-seopress")),n().createElement(l.Button,{variant:"primary",onClick:d,className:"seopress-confirm-modal-primary"},(0,p.__)("Remove","wp-seopress")))))},b=({value:e,onChange:s,defaultColor:t,label:r})=>{const l=(0,a.useRef)(null),o=e||t||"";return n().createElement("div",{className:"seopress-color-picker-wrapper"},r&&n().createElement("p",{className:"description"},r),n().createElement("div",{className:"seopress-color-picker-control"},n().createElement("div",{className:"seopress-color-picker-swatch-wrap"},n().createElement("button",{type:"button",className:"seopress-color-picker-swatch",onClick:()=>{l.current&&l.current.click()},style:{backgroundColor:o||"transparent"},"aria-label":(0,p.__)("Select Color","wp-seopress")}),n().createElement("input",{ref:l,type:"color",className:"seopress-color-picker-native",value:o&&o.startsWith("#")?o:"#000000",onChange:e=>s(e.target.value),tabIndex:-1})),n().createElement("input",{type:"text",className:"seopress-color-picker-input",value:e||"",onChange:e=>s(e.target.value),placeholder:t||"#000000"}),e&&n().createElement("button",{type:"button",className:"seopress-color-picker-clear",onClick:()=>s(""),"aria-label":(0,p.__)("Clear color","wp-seopress")},(0,p.__)("Clear","wp-seopress"))))};var v=t(6989),w=t.n(v);const f=e=>`${e.title} (${e.post_type} — #${e.id})`,S=({value:e,onChange:s,help:t,placeholder:r})=>{const[o,i]=(0,a.useState)({}),[c,d]=(0,a.useState)([]),m=(0,a.useRef)(null),u=(0,a.useRef)(null),_=(0,a.useRef)(!1),E=(e=>e?e.split(",").map((e=>parseInt(e.trim(),10))).filter((e=>!isNaN(e)&&e>0)):[])(e);(0,a.useEffect)((()=>{if(0===E.length)return void(_.current||(_.current=!0));const e=E.filter((e=>!o[e]));0!==e.length?w()({path:`/seopress/v1/search-posts?ids=${e.join(",")}`,headers:{"X-WP-Nonce":SEOPRESS_SETTINGS_DATA.NONCE}}).then((s=>{const t={...o};s.forEach((e=>{t[e.id]=f(e)})),e.forEach((e=>{t[e]||(t[e]=`#${e} (${(0,p.__)("not found","wp-seopress")})`)})),i(t),_.current=!0})).catch((()=>{_.current=!0})):_.current=!0}),[e]);const h=(0,a.useCallback)((e=>{u.current&&clearTimeout(u.current),!e||e.length<1?d([]):u.current=setTimeout((()=>{m.current&&m.current.abort();const s=new AbortController;m.current=s,w()({path:`/seopress/v1/search-posts?search=${encodeURIComponent(e)}`,headers:{"X-WP-Nonce":SEOPRESS_SETTINGS_DATA.NONCE},signal:s.signal}).then((e=>{const s={...o},t=[];e.forEach((e=>{const a=f(e);s[e.id]=a,t.push(a)})),i(s),d(t)})).catch((()=>{}))}),300)}),[o]),g=E.map((e=>o[e]||`#${e}`)),b=(0,a.useCallback)((e=>{const t=e.map((e=>{const s=(e=>{const s=e.match(/#(\d+)\)$/);return s?parseInt(s[1],10):null})(e);if(s)return s;const t=parseInt(e,10);if(!isNaN(t)&&t>0)return t;for(const[s,t]of Object.entries(o))if(t===e)return parseInt(s,10);return null})).filter(Boolean);s(t.length>0?t.join(", "):"")}),[o,s]);return n().createElement("div",{className:"seopress-field seopress-post-id-token-field"},n().createElement(l.FormTokenField,{value:g,suggestions:c,onChange:b,onInputChange:h,placeholder:r,__experimentalExpandOnFocus:!0,__experimentalAutoSelectFirstMatch:!0,__experimentalShowHowTo:!1}),t&&n().createElement("div",{className:"seopress-field-help"},t))},y=({label:e,children:s,className:t="",id:a})=>n().createElement("div",{id:a?`seopress-field-${a}`:void 0,"data-seopress-field":a||void 0,className:`seopress-field-row ${t}`},e&&n().createElement("div",{className:"seopress-field-label"},e),n().createElement("div",{className:"seopress-field-control"},s))},7862:(e,s,t)=>{t.d(s,{Z:()=>l});var a=t(9196),n=t.n(a),r=t(5609);const l=({status:e="info",children:s,className:t="",style:a})=>{const l=n().createElement(r.Notice,{status:e,isDismissible:!1,className:`seopress-wp-notice ${t}`.trim()},s);return a?n().createElement("div",{style:a},l):l}},7978:(e,s,t)=>{t.d(s,{Z:()=>u});var a=t(9196),n=t.n(a),r=t(9818);const l=window.wp.notices;var o=t(5609);const i=({tabs:e,activeTab:s,onTabChange:t})=>n().createElement("div",{className:"seopress-sidebar"},n().createElement("nav",{className:"seopress-sidebar-nav"},e.map((e=>n().createElement("a",{key:e.key,id:`${e.key}-tab`,className:"seopress-sidebar-tab "+(s===e.key?"is-active":""),href:`?page=seopress-titles#tab=${e.key}`,onClick:s=>((e,s)=>{e.preventDefault(),t(s),window.history.replaceState(null,null,`#tab=${s}`)})(s,e.key)},e.sidebarLabel||e.label)))));var c=t(5736),p=t(3781);const d=()=>{const{isDirty:e,dirtyCount:s,isSaving:t,saveError:i,saveSuccess:d,saveSettings:m,dismissNotice:u,validationErrors:_,resetDirty:E}=(0,p.i3)(),{createSuccessNotice:h,createErrorNotice:g}=(0,r.useDispatch)(l.store),[b,v]=(0,a.useState)(!1),w=(0,a.useRef)(t),f=(0,a.useRef)(_),S=(0,a.useRef)(m);return(0,a.useEffect)((()=>{w.current=t}),[t]),(0,a.useEffect)((()=>{f.current=_}),[_]),(0,a.useEffect)((()=>{S.current=m}),[m]),(0,a.useEffect)((()=>{const e=e=>{(e.metaKey||e.ctrlKey)&&"s"===e.key&&(e.preventDefault(),w.current||f.current||S.current())};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)}),[]),(0,a.useEffect)((()=>{d&&(h((0,c.__)("Settings saved successfully.","wp-seopress"),{type:"snackbar",isDismissible:!0,id:"seopress-save-success"}),u())}),[d]),(0,a.useEffect)((()=>{i&&(g(i,{type:"snackbar",isDismissible:!0,id:"seopress-save-error"}),u())}),[i]),n().createElement("div",{className:"seopress-save-bar is-visible"},n().createElement(o.Button,{variant:"primary",onClick:m,disabled:t||_,isBusy:t,className:"seopress-save-button"},t?(0,c.__)("Saving...","wp-seopress"):(0,c.__)("Save changes","wp-seopress")),n().createElement(o.Button,{variant:"tertiary",onClick:()=>v(!0),disabled:t,className:"seopress-undo-button",style:e?void 0:{visibility:"hidden"}},(0,c.__)("Undo changes","wp-seopress")),b&&n().createElement(o.Modal,{title:(0,c.__)("Undo changes","wp-seopress"),onRequestClose:()=>v(!1),className:"seopress-confirm-modal"},n().createElement("p",null,1===s?(0,c.__)("You have 1 unsaved change. Are you sure you want to discard it?","wp-seopress"):`${(0,c.__)("You have","wp-seopress")} ${s} ${(0,c.__)("unsaved changes. Are you sure you want to discard them?","wp-seopress")}`),n().createElement("div",{className:"seopress-confirm-modal-actions"},n().createElement(o.Button,{variant:"secondary",onClick:()=>v(!1)},(0,c.__)("Cancel","wp-seopress")),n().createElement(o.Button,{variant:"primary",onClick:()=>{E(),v(!1)},className:"seopress-confirm-modal-primary"},(0,c.__)("Discard changes","wp-seopress")))))};var m=t(5124);const u=({tabs:e,activeTab:s,onTabChange:t,children:a})=>{const c=e.find((e=>e.key===s)),p=c?c.label:"",u=c?.featureKey||null,_=(0,r.useSelect)((e=>e(l.store).getNotices().filter((e=>"snackbar"===e.type))),[]),{removeNotice:E}=(0,r.useDispatch)(l.store);return n().createElement("div",{className:"seopress-settings-layout"},n().createElement("div",{className:"seopress-settings-container"},n().createElement(i,{tabs:e,activeTab:s,onTabChange:t}),n().createElement("div",{className:"seopress-settings-content"},n().createElement("h2",{className:"seopress-section-title"},p,n().createElement(m.Z,{key:u,featureKey:u})),a)),n().createElement(d,null),n().createElement(o.SnackbarList,{className:"seopress-snackbar-list",notices:_,onRemove:E}))}},3781:(e,s,t)=>{t.d(s,{i3:()=>m,nf:()=>_,rV:()=>u});var a=t(9196),n=t.n(a),r=t(5736),l=t(6989),o=t.n(l);const i={titles:"/seopress/v1/options/titles-settings",sitemaps:"/seopress/v1/options/sitemaps-settings",social:"/seopress/v1/options/social-settings",analytics:"/seopress/v1/options/analytics-settings","instant-indexing":"/seopress/v1/options/indexing-settings",advanced:"/seopress/v1/options/advanced-settings",..."undefined"!=typeof SEOPRESS_SETTINGS_DATA&&SEOPRESS_SETTINGS_DATA.EXTRA_API_ENDPOINTS?SEOPRESS_SETTINGS_DATA.EXTRA_API_ENDPOINTS:{}},c=e=>i[e]||null,p=(0,a.createContext)({pageType:"titles",isLoading:!0,loadError:null,isSaving:!1,saveError:null,saveSuccess:!1,isDirty:!1,dirtyCount:0,validationErrors:!1,setPageType:()=>{},saveSettings:()=>{},resetDirty:()=>{},dismissNotice:()=>{},setValidationErrors:()=>{}}),d=(0,a.createContext)({settings:{},updateSetting:()=>{}}),m=()=>(0,a.useContext)(p),u=()=>({...m(),...(0,a.useContext)(d)});window.seopressUseSettings=u;const _=({children:e,pageType:s})=>{const t="undefined"!=typeof SEOPRESS_SETTINGS_DATA&&SEOPRESS_SETTINGS_DATA.INITIAL_SETTINGS?SEOPRESS_SETTINGS_DATA.INITIAL_SETTINGS:null,l=t&&Object.keys(t).length>0,[i,m]=(0,a.useState)(s||"titles"),u=(0,a.useRef)(null);null===u.current&&(u.current=new Map,l&&u.current.set(s||"titles",t));const _=u.current.get(i),[E,h]=(0,a.useState)(_||{}),[g,b]=(0,a.useState)(_||{}),[v,w]=(0,a.useState)(!_),[f,S]=(0,a.useState)(!1),[y,k]=(0,a.useState)(null),[N,T]=(0,a.useState)(!1),[C,x]=(0,a.useState)(null),[A,P]=(0,a.useState)(!1),[R,D]=(0,a.useState)((()=>new Set)),O=(0,a.useRef)(!1),I=(0,a.useRef)(g);(0,a.useEffect)((()=>{I.current=g}),[g]),(0,a.useEffect)((()=>{const e=u.current.get(i);if(e)return h(e),b(e),D(new Set),w(!1),x(null),T(!1),void k(null);const s=c(i);if(!s)return u.current.set(i,{}),h({}),b({}),D(new Set),w(!1),x(null),T(!1),void k(null);let t=!1;return(async()=>{try{w(!0),x(null),T(!1),k(null);const e=await o()({path:s,method:"GET",headers:{"X-WP-Nonce":SEOPRESS_SETTINGS_DATA.NONCE}});if(t)return;const a=e||{};u.current.set(i,a),h(a),b(a),D(new Set)}catch(e){if(t)return;console.error("Error fetching settings:",e),x(e.message||(0,r.__)("Failed to load settings","wp-seopress"))}finally{t||w(!1)}})(),()=>{t=!0}}),[i]),(0,a.useEffect)((()=>{const e=e=>{O.current&&(e.preventDefault(),e.returnValue="")};return window.addEventListener("beforeunload",e),()=>window.removeEventListener("beforeunload",e)}),[]);const L=(0,a.useCallback)(((e,s)=>{h((t=>({...t,[e]:s}))),D((t=>{var a,n;if((a=s)===(n=I.current[e])||null!=a&&null!=n&&("object"==typeof a||"object"==typeof n)&&JSON.stringify(a)===JSON.stringify(n)){if(!t.has(e))return t;const s=new Set(t);return s.delete(e),s}if(t.has(e))return t;const r=new Set(t);return r.add(e),r})),T(!1),k(null)}),[]),G=(0,a.useCallback)((async()=>{if(A)k((0,r.__)("Please fix the errors before saving.","wp-seopress"));else try{S(!0),k(null),T(!1);const e=c(i),s={...E};await o()({path:e,method:"POST",headers:{"X-WP-Nonce":SEOPRESS_SETTINGS_DATA.NONCE,"Content-Type":"application/json"},data:s}),u.current.set(i,s),h(s),b(s),D(new Set),T(!0)}catch(e){console.error("Error saving settings:",e),k(e.message||(0,r.__)("Failed to save settings","wp-seopress"))}finally{S(!1)}}),[E,i,A]),F=(0,a.useCallback)((()=>{h(g),D(new Set)}),[g]),M=(0,a.useCallback)((()=>{T(!1),k(null)}),[]),$=R.size,B=$>0;(0,a.useEffect)((()=>{O.current=B}),[B]);const V=(0,a.useMemo)((()=>({settings:E,updateSetting:L})),[E,L]),q=(0,a.useMemo)((()=>({pageType:i,isLoading:v,loadError:C,isSaving:f,saveError:y,saveSuccess:N,isDirty:B,dirtyCount:$,validationErrors:A,setPageType:m,saveSettings:G,resetDirty:F,dismissNotice:M,setValidationErrors:P})),[i,v,C,f,y,N,B,$,A,G,F,M]);return n().createElement(p.Provider,{value:q},n().createElement(d.Provider,{value:V},e))}},9643:(e,s,t)=>{t.d(s,{Z:()=>i});const a={},n={},r=new Set;function l(){r.forEach((e=>e()))}const o={registerField(e,s){a[e]=s,l()},registerPage(e,s){a["page-"+e]=s,l()},registerTab(e,s){n[e]=s,l()},getField:e=>a[e]||null,getTabs(e){if(!e)return{...n};const s={};return Object.entries(n).forEach((([t,a])=>{a.page===e&&(s[t]=a)})),s},subscribe:e=>(r.add(e),()=>r.delete(e))};window.seopressExtensions=o;const i=o},5460:(e,s,t)=>{t.d(s,{Z:()=>r});var a=t(9196);const n=e=>{const s=window.location.hash;if(!s)return null;const t=s.match(/tab=([^&]+)/);if(!t)return null;const a=e.find((e=>e.key===t[1]));return a?a.key:null},r=e=>{const s=(0,a.useRef)(e);(0,a.useEffect)((()=>{s.current=e}));const[t,r]=(0,a.useState)((()=>n(e)||e[0]&&e[0].key||null));return(0,a.useEffect)((()=>{const e=()=>{const e=n(s.current);e&&r(e)};return window.addEventListener("hashchange",e),()=>window.removeEventListener("hashchange",e)}),[]),[t,r]}},9196:e=>{e.exports=window.React},6989:e=>{e.exports=window.wp.apiFetch},5609:e=>{e.exports=window.wp.components},9818:e=>{e.exports=window.wp.data},5736:e=>{e.exports=window.wp.i18n}},a={};function n(e){var s=a[e];if(void 0!==s)return s.exports;var r=a[e]={exports:{}};return t[e](r,r.exports,n),r.exports}n.m=t,n.n=e=>{var s=e&&e.__esModule?()=>e.default:()=>e;return n.d(s,{a:s}),s},n.d=(e,s)=>{for(var t in s)n.o(s,t)&&!n.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:s[t]})},n.f={},n.e=e=>Promise.all(Object.keys(n.f).reduce(((s,t)=>(n.f[t](e,s),s)),[])),n.u=e=>"admin/settings/"+e+"."+{57:"5953970a2d06d89b62d5",298:"13c3af247755d6f227a5",349:"90cdbfccbf8b6389ee8a",415:"d5c51ee68ed0f6e6785b",876:"c221da0948f33d6e6275",891:"32e707794a3f17560780"}[e]+".js",n.miniCssF=e=>{},n.o=(e,s)=>Object.prototype.hasOwnProperty.call(e,s),e={},s="wp-seopress:",n.l=(t,a,r,l)=>{if(e[t])e[t].push(a);else{var o,i;if(void 0!==r)for(var c=document.getElementsByTagName("script"),p=0;p<c.length;p++){var d=c[p];if(d.getAttribute("src")==t||d.getAttribute("data-webpack")==s+r){o=d;break}}o||(i=!0,(o=document.createElement("script")).charset="utf-8",o.timeout=120,n.nc&&o.setAttribute("nonce",n.nc),o.setAttribute("data-webpack",s+r),o.src=t),e[t]=[a];var m=(s,a)=>{o.onerror=o.onload=null,clearTimeout(u);var n=e[t];if(delete e[t],o.parentNode&&o.parentNode.removeChild(o),n&&n.forEach((e=>e(a))),s)return s(a)},u=setTimeout(m.bind(null,void 0,{type:"timeout",target:o}),12e4);o.onerror=m.bind(null,o.onerror),o.onload=m.bind(null,o.onload),i&&document.head.appendChild(o)}},n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.p="/public/",(()=>{var e={27:0};n.f.j=(s,t)=>{var a=n.o(e,s)?e[s]:void 0;if(0!==a)if(a)t.push(a[2]);else{var r=new Promise(((t,n)=>a=e[s]=[t,n]));t.push(a[2]=r);var l=n.p+n.u(s),o=new Error;n.l(l,(t=>{if(n.o(e,s)&&(0!==(a=e[s])&&(e[s]=void 0),a)){var r=t&&("load"===t.type?"missing":t.type),l=t&&t.target&&t.target.src;o.message="Loading chunk "+s+" failed.\n("+r+": "+l+")",o.name="ChunkLoadError",o.type=r,o.request=l,a[1](o)}}),"chunk-"+s,s)}};var s=(s,t)=>{var a,r,l=t[0],o=t[1],i=t[2],c=0;if(l.some((s=>0!==e[s]))){for(a in o)n.o(o,a)&&(n.m[a]=o[a]);i&&i(n)}for(s&&s(t);c<l.length;c++)r=l[c],n.o(e,r)&&e[r]&&e[r][0](),e[r]=0},t=self.webpackChunkwp_seopress=self.webpackChunkwp_seopress||[];t.forEach(s.bind(null,0)),t.push=s.bind(null,t.push.bind(t))})(),(()=>{const e=window.wp.element;var s=n(9196),t=n.n(s);const a=window.ReactDOM;var r=n(5736),l=n(5609),o=n(3781);const i="seopress-highlight",c="is-seopress-highlight";var p=n(5124);const d=({label:e,featureKey:s})=>t().createElement("h1",null,e,t().createElement(p.Z,{featureKey:s}));var m=n(7978),u=n(953),_=n(7862);const E=()=>{const{settings:e,updateSetting:s}=(0,o.rV)();return t().createElement("div",{className:"seopress-tab-content"},t().createElement(_.Z,null,(0,r.__)("Title and meta description are used by search engines to generate the snippet of your site in search results page.","wp-seopress")),t().createElement("p",{className:"seopress-description"},(0,r.__)("Customize your title & meta description for homepage.","wp-seopress")),t().createElement("a",{href:"https://www.seopress.org/support/guides/wrong-meta-title-meta-description-serp/",target:"_blank",rel:"noopener noreferrer",className:"seopress-help-link"},(0,r.__)("Wrong meta title / description in SERP?","wp-seopress"),t().createElement("span",{className:"dashicons dashicons-external"})),t().createElement(u.Ev,{id:"seopress_titles_sep",label:(0,r.__)("Separator","wp-seopress")},t().createElement(u.nv,{value:e.seopress_titles_sep,onChange:e=>s("seopress_titles_sep",e),placeholder:"-",help:(0,r.__)("Use this separator with %%sep%% in your title and meta description.","wp-seopress")})),t().createElement(u.Ev,{id:"seopress_titles_home_site_title",label:(0,r.__)("Site title","wp-seopress")},t().createElement(u.lS,{value:e.seopress_titles_home_site_title,onChange:e=>s("seopress_titles_home_site_title",e),placeholder:"%%sitetitle%% %%sep%% %%tagline%%"})),t().createElement(u.Ev,{id:"seopress_titles_home_site_title_alt",label:(0,r.__)("Alternative site title","wp-seopress")},t().createElement(u.nv,{value:e.seopress_titles_home_site_title_alt,onChange:e=>s("seopress_titles_home_site_title_alt",e),placeholder:(0,r.__)("My alternative site title","wp-seopress"),help:t().createElement(t().Fragment,null,(0,r.__)("The alternate name of the website (for example, if there's a commonly recognized acronym or shorter name for your site), if applicable. Make sure the name meets the","wp-seopress")," ",t().createElement("a",{href:"https://developers.google.com/search/docs/appearance/site-names#content-guidelines",target:"_blank",rel:"noopener noreferrer"},(0,r.__)("content guidelines","wp-seopress"))," ",t().createElement("span",{className:"dashicons dashicons-external"}),".")})),t().createElement(u.Ev,{id:"seopress_titles_home_site_desc",label:(0,r.__)("Meta description","wp-seopress")},t().createElement(u.lS,{value:e.seopress_titles_home_site_desc,onChange:e=>s("seopress_titles_home_site_desc",e),placeholder:(0,r.__)("This is a cool website about Wookiees","wp-seopress"),multiline:!0,rows:3})))},h=({icon:e,className:s=""})=>{const a=e||"dashicons-admin-post";if(a.startsWith("data:")||a.startsWith("http"))return t().createElement("img",{src:a,alt:"",className:`seopress-panel-icon seopress-panel-icon--img ${s}`,width:"20",height:"20","aria-hidden":"true"});const n=a.startsWith("dashicons-")?a:`dashicons-${a}`;return t().createElement("span",{className:`dashicons ${n} seopress-panel-icon ${s}`,"aria-hidden":"true"})},g=({noindex:e,nofollow:s})=>{const a="1"===e||!0===e,n="1"===s||!0===s;return a||n?t().createElement("span",{className:"seopress-robots-badges","aria-label":(0,r.__)("Robots directives","wp-seopress")},a&&t().createElement("span",{className:"seopress-robots-badge seopress-robots-badge--noindex"},(0,r.__)("noindex","wp-seopress")),n&&t().createElement("span",{className:"seopress-robots-badge seopress-robots-badge--nofollow"},(0,r.__)("nofollow","wp-seopress"))):null};var b=n(6989),v=n.n(b);const w=(e,t,a="name")=>{const n="undefined"!=typeof SEOPRESS_SETTINGS_DATA&&SEOPRESS_SETTINGS_DATA.PANELS_STATE||{},r=!(e in n)||n[e],[l,o]=(0,s.useState)(r),[i,c]=(0,s.useState)((()=>{const e={};return t.forEach((s=>{e[s[a]]=r})),e})),p=(0,s.useRef)(null),d=(0,s.useCallback)((s=>{p.current&&clearTimeout(p.current),p.current=setTimeout((()=>{v()({path:"/seopress/v1/user/panels-state",method:"POST",headers:{"X-WP-Nonce":SEOPRESS_SETTINGS_DATA.NONCE},data:{tab:e,expanded:s}}).catch((()=>{}))}),500)}),[e]);return{allExpanded:l,openPanels:i,togglePanel:(0,s.useCallback)((e=>{c((s=>({...s,[e]:!s[e]})))}),[]),toggleAll:(0,s.useCallback)((()=>{const e=window.scrollY;o((e=>{const s=!e,n={};return t.forEach((e=>{n[e[a]]=s})),c(n),d(s),s})),requestAnimationFrame((()=>{window.scrollTo(0,e)}))}),[t,a,d])}},f=[{key:"%%post_title%%",label:"Post Title"},{key:"%%sep%%",label:"Separator"},{key:"%%sitetitle%%",label:"Site Title"}],S=[{key:"%%post_excerpt%%",label:"Post excerpt"}],y=()=>{const{settings:e,updateSetting:s}=(0,o.rV)(),a=SEOPRESS_SETTINGS_DATA.POST_TYPES||[],{allExpanded:n,openPanels:i,togglePanel:c,toggleAll:p}=w("post_types",a),d=(s,t)=>((e.seopress_titles_single_titles||{})[s]||{})[t]||"",m=(t,a,n)=>{const r=e.seopress_titles_single_titles||{},l=r[t]||{};s("seopress_titles_single_titles",{...r,[t]:{...l,[a]:n}})};return t().createElement("div",{className:"seopress-tab-content seopress-post-types-tab"},t().createElement("p",null,(0,r.__)("Customize your titles & metas for Single Custom Post Types.","wp-seopress")),t().createElement(_.Z,null,(0,r.__)("Only post types registered with the","wp-seopress")," ",t().createElement("code",null,"public => true")," ",(0,r.__)("and","wp-seopress")," ",t().createElement("code",null,"show_ui => true")," ",(0,r.__)("arguments will be listed here.","wp-seopress")),t().createElement("div",{className:"seopress-panels-toggle-all"},t().createElement(l.Button,{variant:"link",onClick:p},n?(0,r.__)("Collapse all","wp-seopress"):(0,r.__)("Expand all","wp-seopress"))),a.map((e=>t().createElement(l.Panel,{key:e.name,className:"seopress-panel "+(!1!==i[e.name]?"is-opened":"")},t().createElement(l.PanelBody,{title:t().createElement(t().Fragment,null,t().createElement(h,{icon:e.menu_icon}),t().createElement("span",null,e.label),t().createElement(g,{noindex:d(e.name,"noindex"),nofollow:d(e.name,"nofollow")})),opened:!1!==i[e.name],onToggle:()=>c(e.name)},t().createElement("div",{className:"seopress-panel-content"},t().createElement(u.Ev,{label:(0,r.__)("Title template","wp-seopress")},t().createElement(u.lS,{value:d(e.name,"title"),onChange:s=>m(e.name,"title",s),placeholder:"%%post_title%% %%sep%% %%sitetitle%%",quickVars:f})),t().createElement(u.Ev,{label:(0,r.__)("Meta description template","wp-seopress")},t().createElement(u.lS,{value:d(e.name,"description"),onChange:s=>m(e.name,"description",s),placeholder:"%%post_excerpt%%",multiline:!0,rows:3,quickVars:S})),t().createElement(u.Ev,{label:(0,r.__)("Robots","wp-seopress")},t().createElement(u.gE,{label:(0,r.__)("noindex","wp-seopress"),checked:d(e.name,"noindex"),onChange:s=>m(e.name,"noindex",s),help:(0,r.__)("Do not display this post type in search engine results.","wp-seopress")}),t().createElement(u.gE,{label:(0,r.__)("nofollow","wp-seopress"),checked:d(e.name,"nofollow"),onChange:s=>m(e.name,"nofollow",s),help:(0,r.__)("Do not follow links on this post type.","wp-seopress")})),t().createElement(u.Ev,{label:(0,r.__)("Date in Google search results","wp-seopress")},t().createElement(u.gE,{label:(0,r.__)("Show date","wp-seopress"),checked:d(e.name,"date"),onChange:s=>m(e.name,"date",s),help:t().createElement(t().Fragment,null,(0,r.__)("Display date in Google search results by adding","wp-seopress")," ",t().createElement("code",null,"article:published_time")," ",(0,r.__)("and","wp-seopress")," ",t().createElement("code",null,"article:modified_time")," ",(0,r.__)("meta?","wp-seopress"),t().createElement("br",null),(0,r.__)("Unchecking this doesn't prevent Google to display post date in search results.","wp-seopress"))})),t().createElement(u.Ev,{label:(0,r.__)("Disable SEO metabox","wp-seopress")},t().createElement(u.gE,{label:(0,r.__)("Disable","wp-seopress"),checked:d(e.name,"enable"),onChange:s=>m(e.name,"enable",s),help:(0,r.__)("Click to hide any SEO metaboxes / columns / bulk actions for this post type.","wp-seopress")}))))))))},k=[{key:"%%cpt_plural%%",label:"Post Type Archive Name"},{key:"%%sep%%",label:"Separator"},{key:"%%sitetitle%%",label:"Site Title"}],N=[{key:"%%post_author%%",label:"Post author"},{key:"%%sep%%",label:"Separator"},{key:"%%sitetitle%%",label:"Site Title"}],T=[{key:"%%author_bio%%",label:"Author biography"}],C=[{key:"%%archive_date%%",label:"Date archives"},{key:"%%sep%%",label:"Separator"},{key:"%%sitetitle%%",label:"Site Title"}],x=[{key:"%%search_keywords%%",label:"Search Keywords"},{key:"%%sep%%",label:"Separator"},{key:"%%sitetitle%%",label:"Site Title"}],A=()=>{const{settings:e,updateSetting:a}=(0,o.rV)(),n=(SEOPRESS_SETTINGS_DATA.POST_TYPES||[]).filter((e=>"post"!==e.name&&"page"!==e.name)),i=(0,s.useMemo)((()=>{const e=n.map((e=>({key:`archive_${e.name}`})));return e.push({key:"author"},{key:"date"},{key:"search"},{key:"notFound"}),e}),[n]),{allExpanded:c,openPanels:p,togglePanel:d,toggleAll:m}=w("archives",i,"key"),_=(s,t)=>((e.seopress_titles_archive_titles||{})[s]||{})[t]||"",E=(s,t,n)=>{const r=e.seopress_titles_archive_titles||{},l=r[s]||{};a("seopress_titles_archive_titles",{...r,[s]:{...l,[t]:n}})};return t().createElement("div",{className:"seopress-tab-content seopress-archives-tab"},t().createElement("p",{className:"seopress-tab-description"},(0,r.__)("Customize your metas for all archives.","wp-seopress")),t().createElement("div",{className:"seopress-panels-toggle-all"},t().createElement(l.Button,{variant:"link",onClick:m},c?(0,r.__)("Collapse all","wp-seopress"):(0,r.__)("Expand all","wp-seopress"))),n.length>0&&t().createElement(t().Fragment,null,t().createElement("h3",{className:"seopress-subsection-title"},(0,r.__)("Post Type Archives","wp-seopress")),n.map((e=>t().createElement(l.Panel,{key:e.name,className:"seopress-panel "+(!1!==p[`archive_${e.name}`]?"is-opened":"")},t().createElement(l.PanelBody,{title:t().createElement(t().Fragment,null,t().createElement(h,{icon:e.menu_icon}),t().createElement("span",null,e.label),t().createElement(g,{noindex:_(e.name,"noindex"),nofollow:_(e.name,"nofollow")})),opened:!1!==p[`archive_${e.name}`],onToggle:()=>d(`archive_${e.name}`)},t().createElement("div",{className:"seopress-panel-content"},t().createElement(u.Ev,{label:(0,r.__)("Title template","wp-seopress")},t().createElement(u.lS,{value:_(e.name,"title"),onChange:s=>E(e.name,"title",s),placeholder:"%%cpt_plural%% %%sep%% %%sitetitle%%",quickVars:k})),t().createElement(u.Ev,{label:(0,r.__)("Meta description template","wp-seopress")},t().createElement(u.lS,{value:_(e.name,"description"),onChange:s=>E(e.name,"description",s),multiline:!0,rows:3})),t().createElement(u.Ev,{label:(0,r.__)("Robots","wp-seopress")},t().createElement(u.gE,{label:(0,r.__)("noindex","wp-seopress"),checked:_(e.name,"noindex"),onChange:s=>E(e.name,"noindex",s)}),t().createElement(u.gE,{label:(0,r.__)("nofollow","wp-seopress"),checked:_(e.name,"nofollow"),onChange:s=>E(e.name,"nofollow",s)})))))))),t().createElement("h3",{className:"seopress-subsection-title"},(0,r.__)("Author Archives","wp-seopress")),t().createElement("p",{className:"seopress-section-description"},(0,r.__)("Author archives are automatically generated by WordPress. They group specific content by author.","wp-seopress")),t().createElement("p",{className:"seopress-section-description"},(0,r.__)("Example: https://example.com/author/john-doe/","wp-seopress")),t().createElement("p",{className:"seopress-section-description"},(0,r.__)("You only have one author on your site? Check this option to avoid duplicate content.","wp-seopress")),t().createElement(l.Panel,{className:"seopress-panel "+(!1!==p.author?"is-opened":"")},t().createElement(l.PanelBody,{title:t().createElement(t().Fragment,null,t().createElement("span",null,(0,r.__)("Author","wp-seopress")),t().createElement(g,{noindex:e.seopress_titles_archives_author_noindex})),opened:!1!==p.author,onToggle:()=>d("author")},t().createElement("div",{className:"seopress-panel-content"},t().createElement(u.Ev,{label:(0,r.__)("Title template","wp-seopress")},t().createElement(u.lS,{value:e.seopress_titles_archives_author_title,onChange:e=>a("seopress_titles_archives_author_title",e),placeholder:"%%post_author%% %%sep%% %%sitetitle%%",quickVars:N})),t().createElement(u.Ev,{label:(0,r.__)("Meta description template","wp-seopress")},t().createElement(u.lS,{value:e.seopress_titles_archives_author_desc,onChange:e=>a("seopress_titles_archives_author_desc",e),multiline:!0,rows:3,quickVars:T})),t().createElement(u.Ev,{id:"seopress_titles_archives_author_noindex",label:(0,r.__)("Robots","wp-seopress")},t().createElement(u.gE,{label:(0,r.__)("noindex","wp-seopress"),checked:e.seopress_titles_archives_author_noindex,onChange:e=>a("seopress_titles_archives_author_noindex",e)})),t().createElement(u.Ev,{id:"seopress_titles_archives_author_disable",label:(0,r.__)("Disable","wp-seopress")},t().createElement(u.gE,{label:(0,r.__)("Disable author archives","wp-seopress"),checked:e.seopress_titles_archives_author_disable,onChange:e=>a("seopress_titles_archives_author_disable",e),help:(0,r.__)("Redirect author archives to homepage.","wp-seopress")}))))),t().createElement("h3",{className:"seopress-subsection-title"},(0,r.__)("Date Archives","wp-seopress")),t().createElement("p",{className:"seopress-section-description"},(0,r.__)("Date archives are automatically generated by WordPress. They group specific content by date.","wp-seopress")),t().createElement("p",{className:"seopress-section-description"},(0,r.__)("Example: https://example.com/2025/01/01/","wp-seopress")),t().createElement(l.Panel,{className:"seopress-panel "+(!1!==p.date?"is-opened":"")},t().createElement(l.PanelBody,{title:t().createElement(t().Fragment,null,t().createElement("span",null,(0,r.__)("Date","wp-seopress")),t().createElement(g,{noindex:e.seopress_titles_archives_date_noindex})),opened:!1!==p.date,onToggle:()=>d("date")},t().createElement("div",{className:"seopress-panel-content"},t().createElement(u.Ev,{label:(0,r.__)("Title template","wp-seopress")},t().createElement(u.lS,{value:e.seopress_titles_archives_date_title,onChange:e=>a("seopress_titles_archives_date_title",e),placeholder:"%%archive_date%% %%sep%% %%sitetitle%%",quickVars:C})),t().createElement(u.Ev,{label:(0,r.__)("Meta description template","wp-seopress")},t().createElement(u.lS,{value:e.seopress_titles_archives_date_desc,onChange:e=>a("seopress_titles_archives_date_desc",e),multiline:!0,rows:3})),t().createElement(u.Ev,{id:"seopress_titles_archives_date_noindex",label:(0,r.__)("Robots","wp-seopress")},t().createElement(u.gE,{label:(0,r.__)("noindex","wp-seopress"),checked:e.seopress_titles_archives_date_noindex,onChange:e=>a("seopress_titles_archives_date_noindex",e)})),t().createElement(u.Ev,{id:"seopress_titles_archives_date_disable",label:(0,r.__)("Disable","wp-seopress")},t().createElement(u.gE,{label:(0,r.__)("Disable date archives","wp-seopress"),checked:e.seopress_titles_archives_date_disable,onChange:e=>a("seopress_titles_archives_date_disable",e),help:(0,r.__)("Redirect date archives to homepage.","wp-seopress")}))))),t().createElement("h3",{className:"seopress-subsection-title"},(0,r.__)("Search Archives","wp-seopress")),t().createElement("p",{className:"seopress-section-description"},(0,r.__)("Search archives are automatically generated by WordPress. They group specific content by search term.","wp-seopress")),t().createElement("p",{className:"seopress-section-description"},(0,r.__)("Example: https://example.com/?s=keyword","wp-seopress")),t().createElement(l.Panel,{className:"seopress-panel "+(!1!==p.search?"is-opened":"")},t().createElement(l.PanelBody,{title:t().createElement(t().Fragment,null,t().createElement("span",null,(0,r.__)("Search","wp-seopress")),t().createElement(g,{noindex:e.seopress_titles_archives_search_title_noindex})),opened:!1!==p.search,onToggle:()=>d("search")},t().createElement("div",{className:"seopress-panel-content"},t().createElement(u.Ev,{label:(0,r.__)("Title template","wp-seopress")},t().createElement(u.lS,{value:e.seopress_titles_archives_search_title,onChange:e=>a("seopress_titles_archives_search_title",e),placeholder:"%%search_keywords%% %%sep%% %%sitetitle%%",quickVars:x})),t().createElement(u.Ev,{label:(0,r.__)("Meta description template","wp-seopress")},t().createElement(u.lS,{value:e.seopress_titles_archives_search_desc,onChange:e=>a("seopress_titles_archives_search_desc",e),multiline:!0,rows:3})),t().createElement(u.Ev,{id:"seopress_titles_archives_search_title_noindex",label:(0,r.__)("Robots","wp-seopress")},t().createElement(u.gE,{label:(0,r.__)("noindex","wp-seopress"),checked:e.seopress_titles_archives_search_title_noindex,onChange:e=>a("seopress_titles_archives_search_title_noindex",e)}))))),t().createElement("h3",{className:"seopress-subsection-title"},(0,r.__)("404 Page","wp-seopress")),t().createElement(l.Panel,{className:"seopress-panel"},t().createElement(l.PanelBody,{title:(0,r.__)("404","wp-seopress"),opened:!1!==p.notFound,onToggle:()=>d("notFound")},t().createElement("div",{className:"seopress-panel-content"},t().createElement(u.Ev,{id:"seopress_titles_archives_404_title",label:(0,r.__)("Title template","wp-seopress")},t().createElement(u.lS,{value:e.seopress_titles_archives_404_title,onChange:e=>a("seopress_titles_archives_404_title",e),placeholder:"404 %%sep%% %%sitetitle%%"})),t().createElement(u.Ev,{label:(0,r.__)("Meta description template","wp-seopress")},t().createElement(u.lS,{value:e.seopress_titles_archives_404_desc,onChange:e=>a("seopress_titles_archives_404_desc",e),multiline:!0,rows:3}))))))},P=e=>"category"===e?[{key:"%%_category_description%%",label:"Category Description"}]:"post_tag"===e?[{key:"%%tag_description%%",label:"Tag Description"}]:[{key:"%%term_description%%",label:"Term Description"}],R=()=>{const{settings:e,updateSetting:s}=(0,o.rV)(),a=SEOPRESS_SETTINGS_DATA.TAXONOMIES||[],{allExpanded:n,openPanels:i,togglePanel:c,toggleAll:p}=w("taxonomies",a),d=(s,t)=>((e.seopress_titles_tax_titles||{})[s]||{})[t]||"",m=(t,a,n)=>{const r=e.seopress_titles_tax_titles||{},l=r[t]||{};s("seopress_titles_tax_titles",{...r,[t]:{...l,[a]:n}})};return t().createElement("div",{className:"seopress-tab-content seopress-taxonomies-tab"},t().createElement("p",null,(0,r.__)("Customize your metas for all taxonomies archives.","wp-seopress")),t().createElement(_.Z,null,t().createElement("p",null,(0,r.__)("Only taxonomies registered with the","wp-seopress")," ",t().createElement("code",null,"public => true")," ",(0,r.__)("and","wp-seopress")," ",t().createElement("code",null,"show_ui => true")," ",(0,r.__)("arguments will be listed here.","wp-seopress"))),t().createElement("div",{className:"seopress-panels-toggle-all"},t().createElement(l.Button,{variant:"link",onClick:p},n?(0,r.__)("Collapse all","wp-seopress"):(0,r.__)("Expand all","wp-seopress"))),a.map((e=>{return t().createElement(l.Panel,{key:e.name,className:"seopress-panel "+(!1!==i[e.name]?"is-opened":"")},t().createElement(l.PanelBody,{title:t().createElement(t().Fragment,null,t().createElement("span",null,e.label),t().createElement(g,{noindex:d(e.name,"noindex"),nofollow:d(e.name,"nofollow")})),opened:!1!==i[e.name],onToggle:()=>c(e.name)},t().createElement("div",{className:"seopress-panel-content"},t().createElement(u.Ev,{label:(0,r.__)("Title template","wp-seopress")},t().createElement(u.lS,{value:d(e.name,"title"),onChange:s=>m(e.name,"title",s),placeholder:"%%term_title%% %%sep%% %%sitetitle%%",quickVars:(s=e.name,"category"===s?[{key:"%%_category_title%%",label:"Category Title"},{key:"%%sep%%",label:"Separator"},{key:"%%sitetitle%%",label:"Site Title"}]:"post_tag"===s?[{key:"%%tag_title%%",label:"Tag Title"},{key:"%%sep%%",label:"Separator"},{key:"%%sitetitle%%",label:"Site Title"}]:[{key:"%%term_title%%",label:"Term Title"},{key:"%%sep%%",label:"Separator"},{key:"%%sitetitle%%",label:"Site Title"}])})),t().createElement(u.Ev,{label:(0,r.__)("Meta description template","wp-seopress")},t().createElement(u.lS,{value:d(e.name,"description"),onChange:s=>m(e.name,"description",s),placeholder:"%%term_description%%",multiline:!0,rows:3,quickVars:P(e.name)})),t().createElement(u.Ev,{label:(0,r.__)("Robots","wp-seopress")},t().createElement(u.gE,{label:(0,r.__)("noindex","wp-seopress"),checked:d(e.name,"noindex"),onChange:s=>m(e.name,"noindex",s),help:(0,r.__)("Do not display this taxonomy in search engine results.","wp-seopress")}),"post_tag"===e.name&&t().createElement(_.Z,{status:"warning"},t().createElement("p",null,(0,r.__)("We do not recommend indexing","wp-seopress")," ",t().createElement("strong",null,(0,r.__)("tags","wp-seopress"))," ",(0,r.__)("which are, in the vast majority of cases, a source of duplicate content.","wp-seopress"))),t().createElement(u.gE,{label:(0,r.__)("nofollow","wp-seopress"),checked:d(e.name,"nofollow"),onChange:s=>m(e.name,"nofollow",s),help:(0,r.__)("Do not follow links on this taxonomy.","wp-seopress")})),t().createElement(u.Ev,{label:(0,r.__)("Disable SEO metabox","wp-seopress")},t().createElement(u.gE,{label:(0,r.__)("Disable","wp-seopress"),checked:d(e.name,"enable"),onChange:s=>m(e.name,"enable",s),help:(0,r.__)("Disable the SEO metabox for this taxonomy.","wp-seopress")})))));var s})))},D=()=>{const{settings:e,updateSetting:s}=(0,o.rV)();return t().createElement("div",{className:"seopress-tab-content seopress-advanced-tab"},t().createElement("p",{className:"seopress-tab-description"},(0,r.__)("Customize your metas for all pages.","wp-seopress")),t().createElement(u.Ev,{id:"seopress_titles_noindex",label:(0,r.__)("noindex","wp-seopress")},t().createElement(u.gE,{label:(0,r.__)("noindex entire site","wp-seopress"),checked:e.seopress_titles_noindex,onChange:e=>s("seopress_titles_noindex",e),help:t().createElement(t().Fragment,null,(0,r.__)('Do not display all pages of the site in Google search results and do not display "Cached" links in search results.',"wp-seopress"),t().createElement("br",null),t().createElement("br",null),(0,r.__)("Check also the","wp-seopress")," ",t().createElement("strong",null,(0,r.__)("Search engine visibility","wp-seopress"))," ",(0,r.__)("setting from the","wp-seopress")," ",t().createElement("a",{href:(SEOPRESS_SETTINGS_DATA.ADMIN_URL||"/wp-admin/")+"options-reading.php"},(0,r.__)("WordPress Reading page","wp-seopress")),".")})),t().createElement(u.Ev,{id:"seopress_titles_nofollow",label:(0,r.__)("nofollow","wp-seopress")},t().createElement(u.gE,{label:(0,r.__)("nofollow entire site","wp-seopress"),checked:e.seopress_titles_nofollow,onChange:e=>s("seopress_titles_nofollow",e),help:(0,r.__)("Do not follow links for all pages.","wp-seopress")})),t().createElement(u.Ev,{id:"seopress_titles_noimageindex",label:(0,r.__)("noimageindex","wp-seopress")},t().createElement(u.gE,{label:(0,r.__)("noimageindex entire site","wp-seopress"),checked:e.seopress_titles_noimageindex,onChange:e=>s("seopress_titles_noimageindex",e),help:(0,r.__)("Do not index images from the entire site.","wp-seopress")})),t().createElement(u.Ev,{id:"seopress_titles_nosnippet",label:(0,r.__)("nosnippet","wp-seopress")},t().createElement(u.gE,{label:(0,r.__)("nosnippet entire site","wp-seopress"),checked:e.seopress_titles_nosnippet,onChange:e=>s("seopress_titles_nosnippet",e),help:(0,r.__)("Do not display a description in the Google search results for all pages.","wp-seopress")})),t().createElement(u.Ev,{id:"seopress_titles_nositelinkssearchbox",label:(0,r.__)("Remove Website schema","wp-seopress")},t().createElement(u.gE,{label:(0,r.__)("Remove sitelinks searchbox and Website schema","wp-seopress"),checked:e.seopress_titles_nositelinkssearchbox,onChange:e=>s("seopress_titles_nositelinkssearchbox",e),help:(0,r.__)("Note that the alternative site title declared in the Titles and metas settings is used by this.","wp-seopress")})),t().createElement(u.Ev,{id:"seopress_titles_paged_rel",label:(0,r.__)("Indicate paginated content to Google","wp-seopress")},t().createElement(u.gE,{label:(0,r.__)("Add rel next/prev link in head of paginated archive pages","wp-seopress"),checked:e.seopress_titles_paged_rel,onChange:e=>s("seopress_titles_paged_rel",e)})),t().createElement(u.Ev,{id:"seopress_titles_paged_noindex",label:(0,r.__)("noindex on paged archives","wp-seopress")},t().createElement(u.gE,{label:(0,r.__)('Add a "noindex" meta robots for all paginated archive pages',"wp-seopress"),checked:e.seopress_titles_paged_noindex,onChange:e=>s("seopress_titles_paged_noindex",e),help:(0,r.__)("e.g. https://example.com/category/my-category/page/2/","wp-seopress")})),t().createElement(u.Ev,{id:"seopress_titles_attachments_noindex",label:(0,r.__)("noindex on attachment pages","wp-seopress")},t().createElement(u.gE,{label:(0,r.__)('Add a "noindex" meta robots for all attachment pages',"wp-seopress"),checked:e.seopress_titles_attachments_noindex,onChange:e=>s("seopress_titles_attachments_noindex",e),help:(0,r.__)("e.g. https://example.com/my-media-attachment-page","wp-seopress")})))};var O=n(9654),I=n(5460);const L=[{key:"tab_seopress_titles_home",label:(0,r.__)("Home","wp-seopress")},{key:"tab_seopress_titles_single",label:(0,r.__)("Post Types","wp-seopress")},{key:"tab_seopress_titles_archives",label:(0,r.__)("Archives","wp-seopress")},{key:"tab_seopress_titles_tax",label:(0,r.__)("Taxonomies","wp-seopress")},{key:"tab_seopress_titles_advanced",label:(0,r.__)("Advanced","wp-seopress")}],G=()=>{const[e,s]=(0,I.Z)(L);return t().createElement(m.Z,{tabs:L,activeTab:e,onTabChange:s,title:(0,r.__)("Titles & Metas","wp-seopress")},t().createElement("div",{className:"seopress-tab active",id:e},(()=>{switch(e){case"tab_seopress_titles_home":default:return t().createElement(E,null);case"tab_seopress_titles_single":return t().createElement(y,null);case"tab_seopress_titles_archives":return t().createElement(A,null);case"tab_seopress_titles_tax":return t().createElement(R,null);case"tab_seopress_titles_advanced":return t().createElement(D,null)}})(),t().createElement(O.Z,null)))},F=(0,s.lazy)((()=>n.e(57).then(n.bind(n,57)))),M=(0,s.lazy)((()=>n.e(876).then(n.bind(n,8876)))),$=(0,s.lazy)((()=>n.e(891).then(n.bind(n,7891)))),B=(0,s.lazy)((()=>n.e(349).then(n.bind(n,3349)))),V=(0,s.lazy)((()=>n.e(415).then(n.bind(n,4415)))),q=(0,s.lazy)((()=>n.e(298).then(n.bind(n,3298)))),U=()=>{const{isLoading:e,loadError:n,isDirty:p,dirtyCount:m,pageType:u,setPageType:_}=(0,o.i3)(),E=(0,s.useCallback)((e=>{_(e)}),[_]),{pendingNavigation:h,confirmNavigation:g,cancelNavigation:b}=((e,t)=>{const a=(0,s.useRef)(t),[n,r]=(0,s.useState)(null);(0,s.useEffect)((()=>{a.current=t}),[t]);const l=(0,s.useCallback)((e=>{try{return new URL(e,window.location.origin).searchParams.get("page")}catch{return null}}),[]),o=(0,s.useCallback)((e=>(SEOPRESS_SETTINGS_DATA.ALL_PAGES||[]).find((s=>s.slug===e))),[]),i=(0,s.useCallback)((e=>(SEOPRESS_SETTINGS_DATA.REACT_READY_PAGES||[]).includes(e)),[]),c=(0,s.useCallback)((e=>{const s=e.label||"",t=document.querySelector("#seopress-navbar ul li:last-child");t&&(t.textContent=s);const a=document.querySelector(".seopress-switch-ui a");a&&(a.href=e.url+"&view=php"),document.title=s+" ‹ "+(document.title.split("‹").slice(1).join("‹").trim()||"WordPress")}),[]),p=(0,s.useCallback)((e=>{document.querySelectorAll('#adminmenu a[href*="page=seopress-"], #adminmenu a[href*="page=seopress-option"]').forEach((e=>{const s=e.closest("li");s&&s.classList.remove("current"),e.classList.remove("current")}));const s=document.querySelector(`#adminmenu a[href*="page=${e}"]`);if(s){s.classList.add("current");const e=s.closest("li");e&&e.classList.add("current")}}),[]),d=(0,s.useCallback)((s=>{window.history.pushState({seopressPage:s.type},"",s.url),p(s.slug),c(s),e(s.type)}),[e,p,c]),m=(0,s.useCallback)((e=>{const s=e.currentTarget.href,t=l(s);if(!t)return;const n=o(t);n&&i(n.type)&&(e.preventDefault(),a.current?r(n):d(n))}),[l,o,i,d]),u=(0,s.useCallback)((s=>{const t=l(window.location.href);if(!t)return;const a=o(t);a&&(i(a.type)?(p(a.slug),c(a),e(a.type)):window.location.reload())}),[l,o,i,p,c,e]);(0,s.useEffect)((()=>{const e=document.querySelectorAll('#adminmenu a[href*="page=seopress-"]');return e.forEach((e=>{e.addEventListener("click",m)})),window.addEventListener("popstate",u),()=>{e.forEach((e=>{e.removeEventListener("click",m)})),window.removeEventListener("popstate",u)}}),[m,u]),(0,s.useEffect)((()=>{const e=l(window.location.href),s=e?o(e):null;s&&window.history.replaceState({seopressPage:s.type},"",window.location.href)}),[]);const _=(0,s.useCallback)((()=>{n&&(d(n),r(null))}),[n,d]),E=(0,s.useCallback)((()=>{r(null)}),[]);return{pendingNavigation:n,confirmNavigation:_,cancelNavigation:E}})(E,p);if((0,s.useEffect)((()=>{let e=null,s=null;const t=()=>{null!==e&&(window.clearInterval(e),e=null),null!==s&&(window.clearTimeout(s),s=null)},a=()=>{let a;try{a=sessionStorage.getItem(i)}catch(e){return}if(!a)return;try{sessionStorage.removeItem(i)}catch(e){}t();let n=0;const r=()=>{const t=document.getElementById(`seopress-field-${a}`);return t?(null!==e&&(window.clearInterval(e),e=null),(e=>{e.scrollIntoView({behavior:"smooth",block:"center"}),e.classList.remove(c),e.offsetWidth,e.classList.add(c),s=window.setTimeout((()=>{e.classList.remove(c)}),3e3)})(t),!0):(n+=1,n>=40&&null!==e&&(window.clearInterval(e),e=null),!1)};r()||(e=window.setInterval(r,100))};return a(),window.addEventListener("popstate",a),window.addEventListener("hashchange",a),()=>{window.removeEventListener("popstate",a),window.removeEventListener("hashchange",a),t()}}),[]),n)return t().createElement("div",{className:"seopress-settings-error"},t().createElement("p",null,(0,r.__)("Error loading settings. Please refresh the page.","wp-seopress")));if(e)return t().createElement("div",{className:"seopress-settings-loading"},t().createElement(l.Spinner,null));const v=(SEOPRESS_SETTINGS_DATA.ALL_PAGES||[]).find((e=>e.type===u)),w=document.querySelector(".seopress-php-header");return t().createElement(t().Fragment,null,w&&v&&(0,a.createPortal)(t().createElement(d,{label:v.label,featureKey:v.feature}),w),t().createElement(s.Suspense,{fallback:t().createElement("div",{className:"seopress-settings-loading"},t().createElement(l.Spinner,null))},(()=>{switch(u){case"titles":return t().createElement(G,null);case"sitemaps":return t().createElement(F,null);case"social":return t().createElement(M,null);case"analytics":return t().createElement($,null);case"instant-indexing":return t().createElement(B,null);case"advanced":return t().createElement(V,null);case"tools":return t().createElement(q,null);default:{const e=window.seopressExtensions?.getField(`page-${u}`);return e?t().createElement(e,null):t().createElement(G,null)}}})()),h&&t().createElement(l.Modal,{title:(0,r.__)("Unsaved changes","wp-seopress"),onRequestClose:b,className:"seopress-confirm-modal"},t().createElement("p",null,1===m?(0,r.__)("You have 1 unsaved change. Are you sure you want to leave?","wp-seopress"):`${(0,r.__)("You have","wp-seopress")} ${m} ${(0,r.__)("unsaved changes. Are you sure you want to leave?","wp-seopress")}`),t().createElement("div",{className:"seopress-confirm-modal-actions"},t().createElement(l.Button,{variant:"secondary",onClick:b},(0,r.__)("Cancel","wp-seopress")),t().createElement(l.Button,{variant:"primary",onClick:g,className:"seopress-confirm-modal-primary"},(0,r.__)("Leave","wp-seopress")))))};n(9643),"undefined"!=typeof SEOPRESS_SETTINGS_DATA&&SEOPRESS_SETTINGS_DATA.ASSETS_URL&&(n.p=SEOPRESS_SETTINGS_DATA.ASSETS_URL+"/"),window.seopressComponents={SettingsLayout:m.Z,TextField:u.nv,TextareaField:u.XL,ToggleField:u.gE,SelectField:u.mg,DynamicTagField:u.lS,MediaUploadField:u.FH,ColorPickerField:u.F8,FieldRow:u.Ev,SeopressNotice:_.Z,FeatureToggle:p.Z,useSettings:o.rV},document.addEventListener("DOMContentLoaded",(()=>{const s=document.getElementById("seopress-admin-settings-root");if(!s)return;const t=document.querySelector(".seopress-php-header");t&&(t.innerHTML=""),(0,e.createRoot)(s).render(React.createElement(o.nf,{pageType:SEOPRESS_SETTINGS_DATA.PAGE_TYPE},React.createElement(U,null)))}))})()})();