HEX
Server: Apache
System: Linux cp4.skywebbox.com 5.14.0-503.15.1.el9_5.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Nov 28 07:25:19 EST 2024 x86_64
User: alfouzantranspor (1054)
PHP: 8.3.23
Disabled: exec,passthru,shell_exec,system
Upload Files
File: /home/alfouzantranspor/www/wp-content/plugins_backup/surerank/build/seo-popup/index.js
"use strict";(globalThis.webpackChunksurerank=globalThis.webpackChunksurerank||[]).push([[5307],{1455:e=>{e.exports=window.wp.apiFetch},1671:(e,t,a)=>{a.d(t,{E:()=>r});const r="surerank"},9607:(e,t,a)=>{a.d(t,{EJ:()=>m,MI:()=>F,OY:()=>x,P$:()=>w,P3:()=>_,PA:()=>v,RL:()=>H,XY:()=>p,ZV:()=>S,_t:()=>z,b7:()=>R,bF:()=>g,cn:()=>k,e$:()=>f,jP:()=>E,jT:()=>T,mT:()=>M,mv:()=>P,ns:()=>I,pk:()=>y,sI:()=>L,sL:()=>N,sz:()=>B,tX:()=>A,we:()=>j,x7:()=>O,xZ:()=>D,xx:()=>b});var r=a(27723),n=a(65313),s=a(6463),l=a(80696),o=a(81301),i=a(34164),c=a(75795),u=a(50856),d=a(76016);const p=e=>{const t=e.match(/<p>(.*?)<\/p>/g);return t?.length?t[0].replace(/(<([^>]+)>)/gi,""):e.replace(/(<([^>]+)>)/gi,"").replace(/\s+/g," ")},m=(e,t,a="...")=>!e?.length||!t||t<0||e.length<=t?e:e.slice(0,t)+a,g=(e,t,a=100)=>{if("string"!==typeof e||!e.trim())return;if(!h(t))return;const r=document.querySelector(e);r&&setTimeout(()=>{(0,c.createRoot)(r).render(t)},a)},h=e=>e&&e?.$$typeof===Symbol.for("react.element"),f=()=>({surerank_general:"general_settings",surerank_social:"social_settings",surerank_advanced:"advanced_settings"}[new URLSearchParams(window.location.search).get("page")]||"general_settings"),k=(...e)=>(0,u.QP)((0,i.A)(...e)),_=(e,t="value")=>{const a=e?.root?.children[0]?.children;if(!a||!a?.length)return"";let r="";return a.forEach(e=>{switch(e.type){case"text":r+=e.text;break;case"mention":r+=e.data[t];break;case"linebreak":r+="\n"}}),r},y=(e,t=[],a="value",r={type:"mention",version:1,data:{},size:"md",by:"label"})=>{const n={root:{children:[{children:[],direction:null,format:"",indent:0,type:"paragraph",version:1,textFormat:0,textStyle:""}],direction:null,format:"",indent:0,type:"root",version:1}};return("string"===typeof e?e:"").trim().split(/(\s+|%[\w\-_.]+%)/).filter(Boolean).forEach(e=>{if("\n"===e)n.root.children[0].children.push({type:"linebreak",version:1});else if(e?.startsWith("%")&&e?.endsWith("%")){const s=t?.find(t=>t[a]===e.trim());s&&n.root.children[0].children.push({...r,data:{...s}})}else n.root.children[0].children.push({detail:0,format:0,mode:"normal",style:"",text:e,type:"text",version:1})}),JSON.stringify(n)};function E(e,t=65){const a=e.split("/");let r=`${a.slice(0,3).join("/")} \u203a ${a.slice(3).filter(Boolean).join(" \u203a ")}`;return r.length>t&&(r=r.substring(0,t-3)+"..."),r}const w=e=>{const t=window.location.pathname;return Array.isArray(e)?e.some(e=>t.includes(e)):t.includes(e)},v=(e,t={})=>{if(!e)return;const{delay:a=1e3,retryDelay:r=200,maxRetries:n=5}=t,s=(t=0)=>{const l=document.getElementById(e);l?setTimeout(()=>{l.scrollIntoView({behavior:"smooth",block:"center",inline:"nearest"})},a):t<n&&setTimeout(()=>{s(t+1)},r)};window.requestAnimationFrame(()=>{s()})},b=(e,t)=>{try{return new URL(window.location.href).searchParams.get(e)===t}catch(a){return!1}},C=(e,t="yyyy-MM-dd")=>{try{if(!e||isNaN(new Date(e).getTime()))throw new Error((0,r.__)("Invalid Date","surerank"));return(0,n.GP)(new Date(e),t)}catch(a){return(0,r.__)("No Date","surerank")}},x=(e,t=!0)=>{if(isNaN(e))return{from:"",to:""};const a=t?(0,l.R)():(0,o.K)();let r=new Date(a);return r.setDate(a.getDate()-e),r=(0,s.o)(r),{from:r,to:a}},S=(e,t={})=>{const{decimals:a=1,forceDecimals:r=!1}=t;if("number"!==typeof e||isNaN(e))return"0";const n=e<0,s=Math.abs(e);if(s<1e3)return n?`-${s}`:s.toString();const l=[{value:1e3,suffix:"k"},{value:1e6,suffix:"m"},{value:1e9,suffix:"b"},{value:1e12,suffix:"t"},{value:1e15,suffix:"p"},{value:1e18,suffix:"e"},{value:1e21,suffix:"z"},{value:1e24,suffix:"y"},{value:1e27,suffix:"r"},{value:1e30,suffix:"q"}],o=l.find(({value:e})=>s<1e3*e)||l[l.length-1],i=(s/o.value).toFixed(a);return`${n?"-":""}${r?i:i.replace(/\.?0+$/,"")}${o.suffix}`},N=e=>{const t=new Date(e);return new Date(t.getTime()-6e4*t.getTimezoneOffset()).toISOString()},A=(e,t,a,n="MMM dd, yyyy")=>{if(!e)return"";const s=new Date(e),l=t?new Date(t):null,o=a?new Date(a):null;return isNaN(s.getTime())?(0,r.__)("Invalid Date","surerank"):l&&o?l.getMonth()===o.getMonth()&&l.getFullYear()===o.getFullYear()?C(s,"dd"):l.getFullYear()===o.getFullYear()?C(s,"MMM dd"):C(s,n):C(s,n)},L=e=>{let t,a="pending";const r=e.then(e=>{a="success",t=e},e=>{a="error",t=e});return{read(){if("pending"===a)throw r;if("error"===a)throw t;if("success"===a)return t}}},T=e=>{var t;return e&&"string"===typeof e&&null!==(t=(new DOMParser).parseFromString(e,"text/html").documentElement.textContent)&&void 0!==t?t:e},P=e=>{try{return/^(https?:\/\/)?((([a-z\d]([a-z\d-]*[a-z\d])*)\.)+[a-z]{2,}|localhost|\d{1,3}(\.\d{1,3}){3})(:\d+)?(\/[-a-z\d%_.~+]*)*(\?[;&a-z\d%_.~+=-]*)?(\#[-a-z\d_]*)?(\s.*)?$/i.test(e)}catch(t){return!1}},M=e=>e?Object.entries(e).map(([e,t])=>{const a=e.replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase());return{...t,id:e,title:t?.message||a,data:t?.description,showImages:"image_alt_text"===e}}):[],D=(e,t=[])=>e.filter(Boolean).reduce((e,a)=>(t.includes(a.id)?(a.ignore=!0,e.ignoredChecks.push(a)):(a.ignore=!1,"error"===a.status?e.badChecks.push(a):"warning"===a.status?e.fairChecks.push(a):"suggestion"===a.status?e.suggestionChecks.push(a):"success"===a.status&&e.passedChecks.push(a)),e),{badChecks:[],fairChecks:[],suggestionChecks:[],passedChecks:[],ignoredChecks:[]}),z=(e,t)=>"error"===e?(0,r.sprintf)("%1$s %2$s Detected",t,(0,r._n)("Issue","Issues",t,"surerank")):"warning"===e?(0,r.sprintf)("%1$s %2$s Detected",t,(0,r._n)("Warning","Warnings",t,"surerank")):(0,r.__)("SEO is Optimized","surerank"),I=e=>{switch(e){case"error":return"bg-support-error";case"warning":return"bg-support-warning";case"suggestion":return"bg-support-info";case"success":return"bg-support-success";default:return"bg-background-secondary"}},O=e=>e>0?(0,r.sprintf)((0,r.__)("%1$d %2$s need attention.","surerank"),e,(0,r._n)("issue","issues",e,"surerank")):(0,r.__)("All SEO checks passed.","surerank"),F=(e,t="")=>{try{const a=new URL(e,window.location.origin).searchParams;return t?a.get(t)||"":Object.fromEntries(a.entries())}catch(a){return t?"":{}}},R=(e,t)=>{try{const a=new URL(e,window.location.origin),r=a.searchParams;return Array.isArray(t)?t.forEach(e=>r.delete(e)):r.delete(t),a.toString()}catch(a){return e}},j=(e,t)=>(e&&"object"===typeof e&&Object.keys(e).forEach(a=>{e[a]&&"object"===typeof e[a]&&(e[a].category=t)}),e),H=(e,t,a)=>{const r=[];return d.Tv.forEach(n=>{if(n===t)r.push(...a);else{const t=B(n).type;r.push(...e.pageSeoChecks?.[t]||[])}}),r},B=e=>({type:`${e}Checks`,categorizedType:`categorized${e.charAt(0).toUpperCase()+e.slice(1)}Checks`})},10960:(e,t,a)=>{a.d(t,{A:()=>c});var r=a(51609),n=a(30732),s=a(418),l=a(45773),o=a(97213),i=a(9607);const c=({title:e="",message:t="",showIcon:a=!1,className:c="",color:u="success",footer:d=null,...p})=>{const m={success:"text-support-success",error:"text-support-error",warning:"text-support-warning",info:"text-support-info"}[u]||"text-support-success",g={success:l.A,error:s.A,warning:s.A,info:o.A}[u]||l.A;return(0,r.createElement)("div",{className:(0,i.cn)("flex flex-row self-stretch gap-2 p-3 border border-solid rounded-lg",{success:"border-alert-border-green",error:"border-alert-border-danger",warning:"border-alert-border-warning",info:"border-alert-border-info"}[u]||"border-alert-border-green",{success:"bg-alert-background-green",error:"bg-alert-background-danger",warning:"bg-alert-background-warning",info:"bg-alert-background-info"}[u]||"bg-alert-background-green",c),role:"alert",...p},a&&(0,r.createElement)(g,{className:(0,i.cn)(m,"shrink-0"),size:20}),(0,r.createElement)("div",{className:"flex flex-col gap-3 pl-1 pr-5 py-0 flex-1"},(0,r.createElement)("div",{className:"flex flex-col justify-center self-stretch gap-0.5"},e&&(0,r.createElement)(n.E,{size:14,weight:600,color:"primary",className:"leading-[1.43]"},e),t&&(0,r.createElement)(n.E,{size:14,weight:400,color:"primary",className:"self-stretch"},t)),d))}},11936:(e,t,a)=>{a.d(t,{R:()=>n});var r=a(27723);const n=e=>{if(!e||"object"!==typeof e)return(0,r.__)("SureRank Meta Box","surerank");const t="number"===typeof e.error?e.error:0,a="number"===typeof e.warning?e.warning:0;return t>0?(0,r.sprintf)((0,r._n)("%s Issue Detected","%s Issues Detected",t,"surerank"),t):a>0?(0,r.sprintf)((0,r._n)("%s Warning Detected","%s Warnings Detected",a,"surerank"),a):(0,r.__)("SureRank Meta Box","surerank")}},15345:(e,t,a)=>{a.d(t,{M:()=>_e});var r={};a.r(r),a.d(r,{fetchFromAPI:()=>j,ignorePageSeoCheck:()=>B,ignoreSeoBarCheck:()=>G,initMetaDataAndDefaults:()=>P,resetUnsavedMetaSettings:()=>O,restoreIgnoreCheck:()=>H,restorePageSeoCheck:()=>V,restoreSeoBarCheck:()=>q,setCurrentPostIgnoredList:()=>R,setPageSeoCheck:()=>z,setPageSeoChecks:()=>D,setPageSeoChecksByIdAndType:()=>$,setRefreshCalled:()=>F,setUnsavedMetaSettings:()=>I,updateAppSettings:()=>M,updateGlobalDefaults:()=>T,updateInitialState:()=>L,updateMetaboxState:()=>x,updateModalState:()=>S,updatePostDynamicData:()=>N,updatePostMetaData:()=>A,updatePostSeoMeta:()=>C});var n={};a.r(n),a.d(n,{getAppSettings:()=>ee,getCurrentPostIgnoredList:()=>re,getGlobalDefaults:()=>Q,getMetaboxState:()=>Y,getModalState:()=>J,getPageSeoChecks:()=>ne,getPostDynamicData:()=>X,getPostSeoMeta:()=>Z,getRefreshCalled:()=>ae,getSeoBarChecks:()=>se,getState:()=>W,getUnsavedMetaSettings:()=>te,getVariables:()=>K});var s={};a.r(s),a.d(s,{getCurrentPostIgnoredList:()=>ge,getSeoBarChecks:()=>he});var l=a(47143),o=a(52619);const i="FETCH_FROM_API",c="UPDATE_META_DATA",u="UPDATE_GLOBAL_DEFAULTS",d="UPDATE_APP_SETTINGS",p="SET_PAGE_SEO_CHECKS",m="SET_PAGE_SEO_CHECK",g="SET_UNSAVED_META_SETTINGS",h="RESET_UNSAVED_META_SETTINGS",f="SET_REFRESH_CALLED",k="SET_CURRENT_POST_IGNORED_LIST",_="SET_PAGE_SEO_CHECKS_BY_ID_AND_TYPE",y={modalEnabled:!1,metaboxInitialized:!1,postSeoMeta:{page_title:"",page_description:"",post_no_index:"",post_no_follow:"",post_no_archive:"",facebook_image_url:"",facebook_title:"",facebook_description:"",facebook_image_id:"",twitter_image_url:"",twitter_title:"",twitter_description:"",twitter_image_id:"",twitter_same_as_facebook:!0,focus_keyword:"",canonical_url:""},unsavedPostSeoMeta:{},postDynamicData:{title:"",excerpt:"",content:""},research:{},globalDefaults:{},appSettings:{currentTab:"optimize",previousTab:"",currentScreen:"settings",previousScreen:"",generateContentProcess:"idle",generatedContents:{},selectedCheckId:null,selectedFieldKey:null,error:null,fixProcess:"idle",onUseThis:null},pageSeoChecks:{authenticated:window?.surerank_globals?.ai_authenticated||!1,initializing:!0,isCheckingLinks:!1,linkCheckProgress:{current:0,total:0},refreshCalled:!1,postId:null,checkType:null,isRefreshing:!1,pageChecks:[],keywordChecks:[],brokenLinkState:{isChecking:!1,checkedLinks:[],brokenLinks:[],allLinks:[]},hideFixHelpButtons:!1}};var E=a(66087),w=a(1671),v=a(9607),b=a(76016);function C(e){return{type:"UPDATE_POST_SEO_META",value:e}}function x(e){return{type:"UPDATE_METABOX_STATE",value:e}}function S(e){return{type:"UPDATE_MODAL_STATE",value:e}}function N(e){return{type:"UPDATE_DYNAMIC_DATA",value:e}}function*A(e){return yield I(e),{type:c,value:e}}function L(e){return{type:"UPDATE_INITIAL_STATE",value:e}}const T=e=>({type:u,payload:e});function*P({postSeoMeta:e,globalDefaults:t}){let a=e;return a&&!Object.keys(a).length?(a=(0,l.select)(w.E).getPostSeoMeta(),a=(0,E.pick)(t,Object.keys(a)),yield A(a)):yield C(a),T(t)}function M(e){return{type:d,value:e}}const D=e=>({type:p,payload:e}),z=(e,t)=>{let a={[e]:t};if("checks"===e){const e=(0,l.select)(w.E).getState();a={checks:t,categorizedChecks:(0,v.xZ)(t,e.pageSeoChecks?.ignoredList||[])}}else if(b.Tv.includes(e)){const r=(0,l.select)(w.E).getState(),n=r.pageSeoChecks?.ignoredList||[],s=(0,v.RL)(r,e,t)?.filter(Boolean)||[],o=(0,v.xZ)(s,n),i=(0,v.xZ)(t,n),c=(0,v.sz)(e);a={[c.type]:t,checks:s,categorizedChecks:o,[c.categorizedType]:i}}return{type:m,payload:a}},I=e=>({type:g,payload:e}),O=()=>({type:h}),F=e=>({type:f,value:e}),R=e=>({type:k,payload:e});function j(e){return{type:i,payload:e}}function*H(e,t){const a=(0,l.select)(w.E).getState(),r=a.pageSeoChecks?.postId||a.variables?.post?.ID?.value||a.variables?.term?.ID?.value,n="1"===window?.surerank_seo_popup?.is_taxonomy?"taxonomy":"post";try{const a=yield j({path:"surerank/v1/checks/ignore-page-check",method:"ignore"===t?"POST":"DELETE",data:{post_id:r,id:e,check_type:n}});yield R(a?.checks);const s=(0,l.select)(w.E).getPageSeoChecks(),o=s.checks.find(t=>t.id===e)?.type,i=(0,v.sz)(o)?.type||"checks";yield z(o,s[i])}catch(s){}}function*B(e){yield H(e,"ignore")}function*V(e){yield H(e,"restore")}const $=(e,t,a,r=null)=>{const n=[],s=a.reduce((e,t)=>(n.push(t.id),t?.ignore?e.ignoredChecks.push(t):(t.ignore=!1,"error"===t.status?e.badChecks.push(t):"warning"===t.status?e.fairChecks.push(t):"suggestion"===t.status?e.suggestionChecks.push(t):"success"===t.status&&e.passedChecks.push(t)),e),{badChecks:[],fairChecks:[],suggestionChecks:[],passedChecks:[],ignoredChecks:[]});return{type:_,payload:{postId:e,postType:t,checks:s,sequence:n,error:r}}};function*U(e,t,a,r,n){try{const s=yield j({path:"surerank/v1/checks/ignore-page-check",method:r,data:{post_id:t,id:e,check_type:a}});if("success"!==s?.status)throw new Error(s?.message);const{checks:o,sequence:i}=(0,l.select)(w.E).getSeoBarChecks(t,a),c=Object.values(o).flat().map(t=>(t.id===e&&(t.ignore=n),t)).sort((e,t)=>i.indexOf(e.id)-i.indexOf(t.id));yield $(t,a,c)}catch(s){}}function*G(e,t,a){yield U(e,t,a,"POST",!0)}function*q(e,t,a){yield U(e,t,a,"DELETE",!1)}function Z(e){return e.postSeoMeta}function K(e){return e.variables}function Y(e){return e.metaboxInitialized}function W(e){return e}function J(e){return e.modalEnabled}function X(e){const t=e.postDynamicData;return e?.variables?.post?.title?.value&&!t?.title&&(t.title=e.variables.post.title.value),e?.variables?.post?.content?.value&&!t?.content&&(t.content=(0,v.XY)(e.variables.post.content.value)),e?.variables?.post?.excerpt?.value&&!t?.excerpt&&(t.excerpt=e.variables.post.excerpt.value),t}const Q=e=>e.globalDefaults,ee=e=>e.appSettings,te=e=>e.unsavedPostSeoMeta,ae=e=>e.pageSeoChecks.refreshCalled,re=e=>{var t;return(null!==(t=e.pageSeoChecks?.postId)&&void 0!==t?t:e?.variables?.post?.ID?.value)&&e.pageSeoChecks.ignoredList||[]},ne=e=>e.pageSeoChecks,se=(e,t,a)=>t&&a?{checks:e.pageSeoChecks[t]?.checks||{},sequence:e.pageSeoChecks[t]?.sequence||[],error:e.pageSeoChecks[t]?.error||null}:{};var le=a(1455),oe=a.n(le),ie=a(93832),ce=a(62220);const ue={FETCH_FROM_API:e=>oe()(e.payload)};var de,pe,me=a(27723);function*ge(){const e=yield(0,l.select)(w.E).getState(),t=e.pageSeoChecks?.postId||e.variables?.post?.ID?.value||e.variables?.term?.ID?.value||window?.surerank_seo_popup?.post_id||window?.surerank_seo_popup?.term_id||window?.surerank_globals?.post_id||window?.surerank_globals?.term_id,a=e.pageSeoChecks?.checkType||("1"===window?.surerank_seo_popup?.is_taxonomy?"taxonomy":"post");if(!t||!a)return[];const r=e.pageSeoChecks?.ignoredList;if(r?.length>0)return r;try{const e=yield j({path:(0,ie.addQueryArgs)("surerank/v1/checks/ignore-page-check",{post_id:t,check_type:a}),method:"GET"});yield R(e?.checks||[])}catch(n){yield R([])}}function*he(e,t,a=null){if(!e||!t)return{};const r=a?`&_t=${a}`:"",n="taxonomy"===window?.surerank_seo_bar?.type?(0,ie.addQueryArgs)("/surerank/v1/checks/taxonomy",{term_id:e}):(0,ie.addQueryArgs)("/surerank/v1/checks/page",{post_id:e});try{const a=yield j({path:n+r,method:"GET"});if("success"!==a?.status)throw new Error(a?.message||(0,me.__)("Error loading SEO checks","surerank"));yield $(e,t,Object.entries(a?.checks).map(([e,t])=>({...t,id:e,title:t?.message||e.replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase()),data:t?.description,showImages:"image_alt_text"===e})))}catch(s){const a=s?.message||(0,me.__)("Error loading SEO checks","surerank");yield $(e,t,[],a)}}const fe=null!==(de=(0,o.applyFilters)("surerank-pro.seo-metabox-actions",r))&&void 0!==de?de:r,ke=null!==(pe=(0,o.applyFilters)("surerank-pro.seo-metabox-selectors",n))&&void 0!==pe?pe:n,_e=(0,l.createReduxStore)(w.E,{reducer:function(e=y,t){switch(t.type){case"UPDATE_MODAL_STATE":return{...e,modalEnabled:t.value};case"UPDATE_INITIAL_STATE":return{...e,...t.value};case"UPDATE_METABOX_STATE":return{...e,metaboxInitialized:t.value};case"UPDATE_POST_SEO_META":case"UPDATE_META_DATA":if("object"!==typeof t.value)throw new Error("Value should be an object");return{...e,postSeoMeta:{...e.postSeoMeta,...t.value}};case"UPDATE_DYNAMIC_DATA":return{...e,postDynamicData:{...e.postDynamicData,...t.value}};case u:return{...e,globalDefaults:t.payload};case d:return{...e,appSettings:{...e.appSettings,...t.value}};case p:case m:return{...e,pageSeoChecks:{...e.pageSeoChecks,...t.payload}};case g:return{...e,unsavedPostSeoMeta:{...e.unsavedPostSeoMeta,...t.payload}};case h:return{...e,unsavedPostSeoMeta:{}};case f:return{...e,pageSeoChecks:{...e.pageSeoChecks,refreshCalled:t.value}};case k:return{...e,pageSeoChecks:{...e.pageSeoChecks,ignoredList:t.payload}};case _:return{...e,pageSeoChecks:{...e.pageSeoChecks,[t.payload.postId]:{checks:{...e.pageSeoChecks[t.payload.postId]?.checks,...t.payload.checks},sequence:t.payload.sequence,error:t.payload.error}}};default:return(0,o.applyFilters)("surerank-pro.seo-metabox-store",e,t)||e}},actions:fe,selectors:ke,controls:ue,resolvers:s});(0,l.register)(_e),(()=>{const e={};window?.surerank_globals?.post_id&&(e.post_id=window?.surerank_globals.post_id),window?.surerank_globals?.term_id&&(e.term_id=window?.surerank_globals.term_id),window?.surerank_seo_popup?.post_id&&(e.post_id=window?.surerank_seo_popup.post_id),window?.surerank_seo_popup?.term_id&&(e.term_id=window?.surerank_seo_popup.term_id),oe()({path:(0,ie.addQueryArgs)(ce.uX,e)}).then(e=>{if(e?.success){let t={variables:e.variables};e.other&&(t={...t,...e.other}),(0,l.dispatch)(_e).updateInitialState(t)}})})()},18947:(e,t,a)=>{a.d(t,{SZ:()=>c,_e:()=>d,aS:()=>i,bY:()=>s,cd:()=>u,jU:()=>o});var r=a(27723),n=a(76016);const s=({id:e,title:t,status:a,description:r,data:n,showImages:s,type:l="page"})=>({id:e,title:t,status:a,description:r,data:n,showImages:s,type:l}),l=async()=>{if(window?.tinymce?.editors?.length)return document.querySelector("#set-post-thumbnail>img");const e=window?.wp?.data?.select("core/editor");if(e&&"function"===typeof e.getEditedPostContent){const r=e.getEditedPostAttribute("featured_media");if(r){var t,a;const e=await new Promise(e=>{const t=wp.media.attachment(r);"function"===typeof t.fetch&&t.fetch().then(t=>e(t)).catch(()=>{e({})})});return{alt:null!==(t=e?.alt)&&void 0!==t?t:"",src:null!==(a=e?.url)&&void 0!==a?a:""}}}},o=async e=>{let t=[];const a=await l();if(a&&t.push(a),t=[...t,...Array.from(e.querySelectorAll("img"))?.filter(e=>e?.src)],0===t.length)return;const n=t.filter(Boolean).filter(e=>!e?.alt?.trim());if(0===n.length)return s({id:"image_alt_text",title:(0,r.__)("All images on this page have alt text attributes.","surerank"),status:"success",type:"page"});const o=window?.surerank_seo_popup?.image_seo,i=(0,r.__)("One or more images are missing alt text attributes.","surerank");let c=`${i} ${(0,r.__)("You can add them manually or turn on auto-set image title and alt in the settings.","surerank")}`;return o&&(c=`${i} ${(0,r.__)("But don't worry, we will add them automatically for you.","surerank")}`),s({id:"image_alt_text",title:c,status:"suggestion",data:Array.from(new Set(n.map(e=>e.src))),showImages:!0,type:"page"})},i=async e=>{const t=!!await l(),a=e.querySelectorAll("img, figure img, figure picture, figure.is-type-photo").length>0||t,n=e.querySelectorAll("video, figure.is-type-video").length>0;return s(a||n?!a&&n?{id:"media_present",title:(0,r.__)("This page includes video(s) but no images.","surerank"),status:"warning",type:"page"}:{id:"media_present",title:(0,r.__)("This page includes images or videos to enhance content.","surerank"),status:"success",type:"page"}:{id:"media_present",title:(0,r.__)("No images or videos found on this page.","surerank"),status:"warning",type:"page"})},c=e=>{const t=Array.from(e.querySelectorAll("a[href]"));return 0===t.length?s({id:"links_present",title:(0,r.__)("No links found on this page.","surerank"),status:"warning",type:"page"}):t.length>0?s({id:"links_present",title:(0,r.__)("Links are present on this page.","surerank"),status:"success",type:"page"}):void 0},u=e=>{const t=e.length,a=(0,r.sprintf)((0,r.__)("Page URL is longer than %s characters and may affect SEO and readability.","surerank"),n.X);return s(t>n.X?{id:"url_length",title:a,status:"warning",type:"page"}:{id:"url_length",title:(0,r.__)("Page URL is short and SEO-friendly.","surerank"),status:"success",type:"page"})},d=e=>{const t=Array.from(e.querySelectorAll("h2, h3, h4, h5, h6"));return s(t.length?{id:"h2_subheadings",title:(0,r.__)("Page contains at least one subheading.","surerank"),status:"success",type:"page"}:{id:"h2_subheadings",title:(0,r.__)("Page does not contain at least one subheading.","surerank"),status:"warning",type:"page"})}},22895:(e,t,a)=>{a.d(t,{A:()=>p});var r=a(51609),n=a(88029),s=a(43953),l=a(45350),o=a(85173),i=a(80697),c=a(48697),u=a(27723),d=a(86087);const p=({selectedSchema:e,setSelectedSchema:t,selectedType:a,setSelectedType:p,schemaTypeOptions:m,defaultSchemas:g,handleAddSchema:h})=>((0,d.useEffect)(()=>{""===a&&p(e)},[e,a,p]),(0,r.createElement)(o.Ay,{trigger:(0,r.createElement)(n.A,{icon:(0,r.createElement)(i.A,{"aria-label":"icon",role:"img"}),iconPosition:"left",size:"md",variant:"outline"},(0,u.__)("Add Schema","surerank"))},(0,r.createElement)(o.Ay.Panel,{className:"gap-2 p-3"},({close:i})=>(0,r.createElement)(r.Fragment,null,(0,r.createElement)(o.Ay.Header,{className:"p-2"},(0,r.createElement)("div",{className:"flex items-center justify-between"},(0,r.createElement)(o.Ay.Title,null,(0,u.__)("Add Schema","surerank")),(0,r.createElement)(n.A,{className:"text-text-secondary [&_svg]:text-text-secondary [&_svg]:size-4 p-0",variant:"ghost",onClick:i,icon:(0,r.createElement)(c.A,{"aria-label":"icon",role:"img"})}))),(0,r.createElement)(o.Ay.Body,{className:"p-2"},(0,r.createElement)(l.mc,{align:"start",containerType:"flex",direction:"column",gap:"xs",justify:"start"},(0,r.createElement)(l.mc.Item,{className:"w-full pb-1"},(0,r.createElement)("label",{className:"text-base block font-medium text-field-label"},(0,u.__)("Choose Schema","surerank"))),(0,r.createElement)(l.mc.Item,{className:"w-full"},(0,r.createElement)(s.Ay,{combobox:!0,size:"md",value:e,onChange:e=>{t(e);const a=m[e]&&Object.keys(m[e]).length;p(a?"":e)}},(0,r.createElement)(s.Ay.Button,null),(0,r.createElement)(s.Ay.Options,null,g.map((e,t)=>(0,r.createElement)(s.Ay.Option,{key:t,value:e.title},e.title)))))),e&&m[e]&&(0,r.createElement)("div",{className:"flex flex-col mt-3 gap-1.5"},(0,r.createElement)("label",{className:"text-base block font-medium text-field-label"},(0,u.__)("Schema Type","surerank")),(0,r.createElement)(s.Ay,{combobox:!0,size:"md",value:a||e,onChange:e=>p(e)},(0,r.createElement)(s.Ay.Button,{render:e=>e,type:"button"}),(0,r.createElement)(s.Ay.Options,null,(()=>{const t=m[e];return Object.values(t).every(e=>e.label&&e.options)?Object.values(t).map((e,t)=>(0,r.createElement)(s.Ay.OptionGroup,{key:t,label:e.label},Object.entries(e.options).map(([e])=>(0,r.createElement)(s.Ay.Option,{key:e,value:e},e)))):Object.entries(t||{}).map(([e,t])=>(0,r.createElement)(s.Ay.Option,{key:e,value:e},t))})())))),(0,r.createElement)(o.Ay.Footer,{className:"p-2"},(0,r.createElement)(n.A,{variant:"outline",onClick:i},(0,u.__)("Cancel","surerank")),(0,r.createElement)(n.A,{variant:"primary",onClick:()=>{h(),i()},disabled:!e},(0,u.__)("Add Schema","surerank"))),(0,r.createElement)(o.Ay.Backdrop,{className:"bg-misc-overlay"})))))},23551:(e,t,a)=>{a.d(t,{A:()=>o});var r=a(51609),n=a(29767),s=a(27723);const l=()=>(0,r.createElement)("div",{className:"relative flex flex-col gap-3 p-3 bg-background-primary rounded-lg shadow-sm border-0.5 border-solid border-border-subtle"},(0,r.createElement)("div",{className:"w-full flex items-start gap-2"},(0,r.createElement)(n.A,{variant:"rectangular",className:"h-6 w-16 rounded-full"}),(0,r.createElement)("div",{className:"flex-1"},(0,r.createElement)(n.A,{variant:"rectangular",className:"h-5 w-48"})),(0,r.createElement)(n.A,{variant:"rectangular",className:"h-6 w-20 rounded"})),(0,r.createElement)("div",{className:"ml-3 space-y-1"},(0,r.createElement)(n.A,{variant:"rectangular",className:"h-4 w-full"}),(0,r.createElement)(n.A,{variant:"rectangular",className:"h-4 w-3/4"}))),o=()=>(0,r.createElement)("div",{className:"p-2 overflow-y-auto",role:"status","aria-live":"polite","aria-busy":"true"},(0,r.createElement)("span",{className:"sr-only"},(0,s.__)("Loading page SEO checks\u2026","surerank")),(0,r.createElement)("div",{className:"space-y-3"},Array.from({length:4}).map((e,t)=>(0,r.createElement)(l,{key:`check-skeleton-${t}`}))))},27165:(e,t,a)=>{a.d(t,{E:()=>r});const r="surerank-admin"},27723:e=>{e.exports=window.wp.i18n},28177:(e,t,a)=>{a.d(t,{$4:()=>C,FQ:()=>N,OH:()=>x,Yi:()=>S,hx:()=>b});var r=a(51609),n=a(27723),s=a(88029),l=a(62163),o=a(71087),i=a(43953),c=a(65650),u=a(24345),d=a(30732),p=a(9607),m=a(32307),g=a(97213),h=a(80697),f=a(1839),k=a(98583),_=a(94879),y=a(86087);const E=["url","logo"],w={wordBreak:"break-all"},v=({field:e,currentValue:t,onFieldChange:a,placeholder:l,variableSuggestions:o})=>{const[i,d]=(0,y.useState)(!1),[g,h]=(0,y.useState)(0),f=(0,y.useRef)(null);return(0,y.useEffect)(()=>{function e(e){i&&f.current&&!f.current.contains(e.target)&&d(!1)}return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[i]),(0,r.createElement)("div",{ref:f,className:"w-full relative"},(0,r.createElement)("div",{className:"flex items-center gap-2 w-full"},(0,r.createElement)(c.A,{key:`${e.id}-${g}`,by:"label",trigger:"@",options:o,placeholder:l,defaultValue:(0,p.pk)(!t||t.startsWith("%")||t.includes("@")?t:(e=>{if(!e)return"";try{const t=new Date(e);return isNaN(t.getTime())?"":t.toLocaleDateString()+" "+t.toLocaleTimeString()}catch(t){return""}})(t),o),onChange:t=>a(e.id,(0,p.P3)(t,o)),"aria-label":e.label,className:"flex-grow max-w-full",size:"md",style:E.includes(e.id)?w:{}}),(0,r.createElement)(s.A,{variant:"ghost",size:"md",onClick:()=>d(e=>!e),className:"flex-shrink-0","aria-label":(0,n.__)("Open date picker","surerank"),icon:(0,r.createElement)(m.A,{strokeWidth:1.5,className:"text-icon-secondary"})})),i&&(0,r.createElement)("div",{className:"absolute z-10 mb-2 rounded-lg shadow-lg right-0 bg-background-primary bottom-full"},(0,r.createElement)(u.A,{applyButtonText:(0,n.__)("Apply","surerank"),cancelButtonText:(0,n.__)("Cancel","surerank"),selectionType:"single",showOutsideDays:!1,variant:"normal",onApply:t=>{a(e.id,(e=>{if(!e)return"";try{const t=new Date(e);return isNaN(t.getTime())?"":t.toISOString()}catch(t){return""}})(t)),d(!1),h(e=>e+1)},onCancel:()=>{d(!1)},selected:t&&!t.startsWith("%")?new Date(t):null})))},b=({field:e,schemaId:t,getFieldValue:a,onFieldChange:l,variableSuggestions:i,fieldItemIds:c,setFieldItemIds:u,renderHelpTextFunction:p=null})=>{let m=a(e.id)||[];if(Array.isArray(m)||(m="object"===typeof m&&null!==m?Object.values(m):[]),0===m.length){const t={};e.fields.forEach(e=>{if("Group"===e.type&&e.fields){const a={};e.fields.forEach(e=>{a[e.id]=e.std||""}),t[e.id]=a}else t[e.id]=e.std||""}),m=[t]}m=m.map(t=>{const a={...t};return e.fields.forEach(e=>{"Group"===e.type&&e.fields&&(a[e.id]&&"object"===typeof a[e.id]||(a[e.id]={}),e.fields.forEach(t=>{t.required&&void 0===a[e.id][t.id]&&(a[e.id][t.id]=t.std||"")}))}),a});const k=`${t}-${e.id}`;if(!c[k]||c[k].length!==m.length){const e=m.map((e,t)=>c[k]?.[t]||`item-${Date.now()}-${t}-${Math.random().toString(36).substr(2,9)}`);u(t=>({...t,[k]:e}))}const y=c[k]||[],E=m.map((e,t)=>({...e,_id:y[t]||`temp-${t}`})),w=(t,a,r)=>{const n=[...m];n[t]={...n[t],[a]:r},l(e.id,n)};return(0,r.createElement)(r.Fragment,null,E.map((t,a)=>(0,r.createElement)("div",{key:t._id,className:"border border-gray-200 rounded-lg mb-4 space-y-3"},(0,r.createElement)("div",{className:"flex items-center justify-between"},(0,r.createElement)(d.E,{size:14,lineHeight:20,weight:500,className:"text-text-primary"},e.cloneItemHeading?`${e.cloneItemHeading} ${a+1}`:`Item ${a+1}`),E.length>1&&(0,r.createElement)(s.A,{variant:"ghost",size:"sm",onClick:()=>(t=>{const a=m.filter((e,a)=>a!==t),r=y.filter((e,a)=>a!==t);u(e=>({...e,[k]:r})),l(e.id,a)})(a),icon:(0,r.createElement)(f.A,{strokeWidth:1.5,className:"text-icon-secondary"})})),e.fields.map(e=>e.hidden||"Hidden"===e.type?null:"Group"===e.type&&e.fields?(0,r.createElement)("div",{key:e.id,className:"space-y-2"},e.label&&(0,r.createElement)("div",{className:"flex items-center justify-start gap-1.5 w-full"},(0,r.createElement)(o.A,{tag:"span",size:"sm",className:"space-x-0.5",required:e.required},e.label),e.tooltip&&(0,r.createElement)(_.$w,{content:e.tooltip,placement:"top",arrow:!0,className:"z-[99999]"},(0,r.createElement)(g.A,{className:"size-4 text-icon-secondary",title:e.tooltip}))),e.fields.map(n=>n.hidden||"Hidden"===n.type?null:(0,r.createElement)("div",{key:n.id,className:"space-y-1.5"},(0,r.createElement)("div",{className:"flex items-center justify-start gap-1.5 w-full"},(0,r.createElement)(o.A,{tag:"span",size:"sm",className:"space-x-0.5",required:n.required},n.label),n.tooltip&&(0,r.createElement)(_.$w,{content:n.tooltip,placement:"top",arrow:!0,className:"z-[99999]"},(0,r.createElement)(g.A,{className:"size-4 text-icon-secondary",title:n.tooltip}))),(0,r.createElement)("div",{className:"flex items-center justify-start gap-1.5 w-full"},S({field:{...n,id:n.id},getFieldValue:()=>(t[e.id]||{})[n.id]||n.std||"",onFieldChange:(r,n)=>{const s={...t[e.id]||{},[r]:n};w(a,e.id,s)},variableSuggestions:i,renderAsGroupComponent:!1})),p&&p(n))),p&&p(e)):(0,r.createElement)("div",{key:e.id,className:"space-y-1.5"},(0,r.createElement)("div",{className:"flex items-center justify-start gap-1.5 w-full"},(0,r.createElement)(o.A,{tag:"span",size:"sm",className:"space-x-0.5",required:e.required},e.label),e.tooltip&&(0,r.createElement)(_.$w,{content:e.tooltip,placement:"top",arrow:!0,className:"z-[99999]"},(0,r.createElement)(g.A,{className:"size-4 text-icon-secondary",title:e.tooltip}))),(0,r.createElement)("div",{className:"flex items-center justify-start gap-1.5 w-full"},S({field:{...e,id:e.id},getFieldValue:()=>t[e.id]||e.std||"",onFieldChange:(e,t)=>w(a,e,t),variableSuggestions:i,renderAsGroupComponent:!1})),p&&p(e))))),(0,r.createElement)(s.A,{variant:"outline",className:"w-fit",size:"sm",onClick:()=>{const t={};e.fields.forEach(e=>{if("Group"===e.type&&e.fields){const a={};e.fields.forEach(e=>{a[e.id]=e.std||""}),t[e.id]=a}else t[e.id]=e.std||""});const a=[...m,t],r=`item-${Date.now()}-${m.length}-${Math.random().toString(36).substr(2,9)}`;u(e=>({...e,[k]:[...e[k]||[],r]})),l(e.id,a)},icon:(0,r.createElement)(h.A,null)},(0,n.__)("Add New","surerank")))},C=({field:e,schemaType:t,getFieldValue:a,onFieldChange:s,variableSuggestions:l})=>{if(!e.fields||0===e.fields.length)return null;const i=e.fields.find(e=>"@type"===e.id)?a("@type",e.id):null;return(0,r.createElement)("div",{className:"space-y-2 w-full border-l-2 border-gray-100 pt-2"},e.fields.map(c=>c.hidden||"Hidden"===c.type||c.main&&i&&c.main!==i?null:(0,r.createElement)("div",{key:c.id,className:"space-y-1.5"},(0,r.createElement)("div",{className:"flex items-center justify-start gap-1.5 w-full"},(0,r.createElement)(o.A,{tag:"span",size:"sm",className:"space-x-0.5",required:c.required},(0,r.createElement)("span",null,c.label)),c.tooltip&&(0,r.createElement)(_.$w,{content:c.tooltip,placement:"top",arrow:!0,className:"z-[99999]"},(0,r.createElement)(g.A,{className:"size-4 text-icon-secondary",title:c.tooltip}))),(0,r.createElement)("div",{className:"flex items-center justify-start gap-1.5 w-full"},S({field:c,schemaType:t,getFieldValue:t=>a(t,e.id),onFieldChange:(t,a)=>s(t,a,e.id),variableSuggestions:l,renderAsGroupComponent:!1})),"Select"!==c.type&&(0,r.createElement)(d.E,{size:14,weight:400,color:"help"},(0,n.__)("Type @ to view variable suggestions","surerank")))))},x=({field:e,getFieldValue:t,onFieldChange:a,variableSuggestions:l,placeholder:o=""})=>{const i=t(e.id)||{};return 0===Object.keys(i).length&&(i[(0,k.lk)(7)]=""),(0,r.createElement)("div",{className:"flex flex-col gap-2 w-full"},Object.entries(i).map(([t,n])=>(0,r.createElement)("div",{key:t,className:"flex items-center gap-1.5 w-full"},S({field:{...e,id:e.id},getFieldValue:()=>n||e.std||"",onFieldChange:(r,n)=>((t,r)=>{a(e.id,{...i,[t]:r})})(t,n),variableSuggestions:l,placeholder:o,renderAsGroupComponent:!1}),(0,r.createElement)(s.A,{variant:"ghost",size:"md",onClick:()=>{const r={...i};delete r[t],a(e.id,r)},icon:(0,r.createElement)(f.A,{strokeWidth:1.5,className:"text-icon-secondary"})}))),(0,r.createElement)(s.A,{variant:"outline",className:"w-fit",size:"sm",onClick:()=>{const t=(0,k.lk)(7),r={...i,[t]:""};a(e.id,r)},icon:(0,r.createElement)(h.A,null)},(0,n.__)("Add New","surerank")))};function S({field:e,getFieldValue:t,onFieldChange:a,variableSuggestions:s,placeholder:o="",renderAsGroupComponent:u=!1}){if(!e)return null;const d=t(e.id)||e.std||"";switch(e.type){case"Select":{const t=Array.isArray(e.options)?e.options.reduce((e,t)=>t.options?{...e,...t.options}:e,{}):e.options||{};return(0,r.createElement)("div",{key:e.id,className:"w-full"},(0,r.createElement)(i.Ay,{size:"md",value:d,onChange:t=>a(e.id,t)},(0,r.createElement)(i.Ay.Button,{render:e=>{const a=Object.entries(t).find(([t])=>t===e);return a?a[1]:e},placeholder:(0,n.__)("Select an option","surerank")}),(0,r.createElement)(i.Ay.Options,{className:"z-50"},Object.entries(t).map(([e,t])=>(0,r.createElement)(i.Ay.Option,{key:e,value:e},t)))))}case"MultiSelect":{const t=Array.isArray(e.options)?e.options.reduce((e,t)=>t.options?{...e,...t.options}:e,{}):e.options||{};let n=[];return n=Array.isArray(d)?d:d?[d]:[],(0,r.createElement)("div",{key:e.id,className:"w-full"},(0,r.createElement)(i.Ay,{size:"md",value:n,onChange:t=>a(e.id,t),multiple:!0},(0,r.createElement)(i.Ay.Button,null),(0,r.createElement)(i.Ay.Options,{className:"z-50"},Object.entries(t).map(([e,t])=>(0,r.createElement)(i.Ay.Option,{key:e,value:e},t)))))}case"Group":return u?(0,r.createElement)(C,{key:e.id,field:e,getFieldValue:t,onFieldChange:a,variableSuggestions:s}):e.fields?.length?(0,r.createElement)("div",{key:e.id,className:"space-y-2 w-full"},(0,r.createElement)("div",{className:"space-y-4 pl-4"},e.fields.map(e=>!e.hidden&&"Hidden"!==e.type&&(0,r.createElement)("div",{key:e.id,className:"flex items-center gap-4"})))):null;case"SelectGroup":{const t=Object.values(e?.options||{});return(0,r.createElement)("div",{key:e.id,className:"w-full"},(0,r.createElement)(i.Ay,{size:"md",value:d,onChange:t=>a(e.id,t),combobox:!0,placeholder:(0,n.__)("Search or select an option","surerank"),"aria-label":e.label},(0,r.createElement)(i.Ay.Button,{placeholder:(0,n.__)("Search or select an option","surerank"),render:e=>{for(const a of t){const t=Object.entries(a.options).find(([t])=>t===e);if(t)return t[1]}return e}}),(0,r.createElement)(i.Ay.Options,null,t.map((e,t)=>(0,r.createElement)(i.Ay.OptionGroup,{key:t,label:e.label},Object.entries(e.options).map(([e,t])=>(0,r.createElement)(i.Ay.Option,{key:e,value:e},t)))))))}case"DateTime":return(0,r.createElement)(v,{field:e,currentValue:d,onFieldChange:a,placeholder:o,variableSuggestions:s});case"Title":return(0,r.createElement)("div",{className:"w-full"},(0,r.createElement)(l.A,{key:e.id,by:"label",placeholder:o,defaultValue:d,"aria-label":e.label,className:"flex-grow max-w-full mdx",size:"md",type:"text",onChange:t=>{a(e.id,t)}}));default:return(0,r.createElement)(c.A,{key:e.id,by:"label",trigger:"@",options:s,placeholder:o,defaultValue:(0,p.pk)(d,s,"value"),onChange:t=>{a(e.id,(0,p.P3)(t.toJSON()))},className:"flex-grow",wrapperClassName:"[&>ul>li]:capitalize",...E.includes(e.id)&&{style:w}})}}function N(e){return"Group"===e?.type||"Select"===e?.type||"SelectGroup"===e?.type||"schema_name"===e?.id?null:(0,r.createElement)(d.E,{size:14,weight:400,color:"help"},(0,n.__)("Type @ to view variable suggestions","surerank"))}},33937:(e,t,a)=>{var r=a(51609),n=a(75795);const s=window.wp.compose;var l=a(86087),o=a(47143),i=a(1671),c=a(9607),u=a(66221),d=a(46615),p=a(60443),m=a(30758);const g=e=>t=>{const a=(0,o.useSelect)(e=>{const t=e("core/editor");return{postTitle:t.getEditedPostAttribute("title"),postExcerpt:t.getEditedPostAttribute("excerpt"),postContent:t.getEditedPostContent()}},[]);return(0,l.useEffect)(()=>{(0,o.dispatch)(i.E).updatePostDynamicData({title:a.postTitle,excerpt:a.postExcerpt,content:(0,c.XY)(a.postContent)})},[a.postTitle,a.postExcerpt,a.postContent]),(0,r.createElement)(e,{...t})},h=e=>t=>{const a=(e,t)=>{const a=(0,o.dispatch)(i.E);"content"===e&&(t=(0,c.XY)(t)),a.updatePostDynamicData({[e]:t})};return(0,l.useEffect)(()=>{const e=document.querySelector("textarea[name='content']#content");e&&e.addEventListener("input",e=>{a("content",e.target.value)});const t=document.querySelector("iframe#content_ifr");t&&t.contentDocument.body.addEventListener("input",e=>{a("content",e.target.innerHTML)});const r=document.querySelector("textarea[name='excerpt']#excerpt");r&&r.addEventListener("input",e=>{a("excerpt",e.target.value)});const n=document.querySelector("input[name='post_title']#title");return n&&n.addEventListener("input",e=>{a("title",e.target.value)}),()=>{e&&e.removeEventListener("input",e=>{a("content",e.target.value)}),t&&t.contentDocument.body.removeEventListener("input",e=>{a("content",e.target.innerHTML)}),r&&r.removeEventListener("input",e=>{a("excerpt",e.target.value)}),n&&n.removeEventListener("input",e=>{a("title",e.target.value)})}},[]),(0,r.createElement)(e,{...t})};var f=a(71149),k=a(54429),_=a(88029),y=a(48697),E=a(27723),w=a(52619),v=a(76316),b=a(70010),C=a(29767),x=a(62163),S=a(98979);const N=({value:e,onChange:t,suffix:a=null,placeholder:n=(0,E.__)("Enter your focus keyword","surerank"),props:s={},isLoading:l=!1})=>l?(0,r.createElement)(C.A,{className:"w-full h-10"}):(0,r.createElement)(x.A,{className:"[&_input]:transition-[color,outline] [&_input]:duration-200",size:"md",placeholder:n,suffix:null!==a&&void 0!==a?a:(0,r.createElement)(S.A,{className:"size-5 text-icon-primary",strokeWidth:1.5}),value:e,onChange:t,...s});var A=a(30732),L=a(94879);const T=()=>{const{updatePostMetaData:e}=(0,o.useDispatch)(i.E),{focusKeyword:t,initialized:a}=(0,o.useSelect)(e=>{const t=e(i.E);return{focusKeyword:t?.getPostSeoMeta?.()?.focus_keyword,initialized:t.getMetaboxState()}});return(0,r.createElement)("div",{className:"w-full flex flex-col gap-2 [&>div]:w-full"},(0,r.createElement)("div",{className:"flex items-center gap-2"},(0,r.createElement)(A.E,{size:14,weight:500,lineHeight:20},(0,E.__)("Focus Keyword","surerank")),(0,r.createElement)(L.ID,{content:(0,E.__)("The primary keyword or phrase you want this content to rank for in search engines. Keyword checks will be based on this.","surerank"),placement:"top-start",arrow:!1})),(0,r.createElement)(N,{value:t||"",onChange:t=>{e({focus_keyword:t})},isLoading:!a}))};var P=a(12395),M=a(76016),D=a(71087),z=a(97213),I=a(61456),O=a(64506);const F=(e,t="")=>{if(!e)return;let a={};return"richSelect"===t&&(a=[]),Object.values(e).forEach(e=>{Object.keys(e).forEach(r=>{switch(t){case"richSelect":a.push({value:r,label:e[r].label,title:"%"+r+"%",description:e[r].description});break;case"detailed":a[r]=e[r];break;default:a[r]=e[r].value}})}),a};var R=a(65650);const j=({fieldKey:e,onUseThis:t})=>{const{currentScreen:a,currentTab:n,currentMetaTab:s,generatedContents:l}=(0,o.useSelect)(e=>{const t=e(i.E);return{...t.getPageSeoChecks(),...t.getAppSettings()}},[]),{updateAppSettings:u}=(0,o.useDispatch)(i.E),d=l&&l[e]&&l[e].length>0;return(0,r.createElement)(_.A,{size:"xs",variant:"ghost",className:(0,c.cn)("p-0.5 text-icon-interactive outline-brand-200 rounded-sm",d&&"[&>svg]:size-3 p-1"),icon:(0,r.createElement)(d?f.jf:f.Wn,null),onClick:()=>{const r={...l};r[e]&&delete r[e],u({currentScreen:"fixItForMe",previousScreen:a,previousTab:n,previousMetaTab:s,selectedFieldKey:e,onUseThis:t,generateContentProcess:"idle",generatedContents:r,error:null})}})},H=({label:e,inputContent:t,maxLength:a,editorRef:n,defaultValue:s,variableSuggestions:l,onChange:o,placeholder:i="",className:u="",editorKey:d,fieldKey:p,onUseThis:m})=>{var g;return(0,r.createElement)("div",{className:"space-y-1.5 p-2"},(0,r.createElement)("div",{className:"flex items-center justify-start gap-1"},(0,r.createElement)(D.A,{tag:"span",size:"sm",className:"space-x-0.5"},(0,r.createElement)("span",null,e)),(0,r.createElement)("div",{className:"ml-auto inline-flex items-center gap-2"},(0,r.createElement)(A.E,{size:12,weight:400,color:"help"},(0,r.createElement)("span",{className:(0,c.cn)({"text-text-error":t?.length>a})},null!==(g=t?.length)&&void 0!==g?g:0),"/ ",a),(0,r.createElement)(j,{fieldKey:p,onUseThis:m}))),(0,r.createElement)(R.A,{key:d,ref:n,by:"label",defaultValue:s,trigger:"@",options:l,onChange:o,placeholder:i,className:u,maxLength:"description"===d?M.x8:void 0}),(0,r.createElement)(A.E,{size:12,color:"help",weight:400},(0,E.__)("Type @ to view variable suggestions","surerank")))},B=({postMetaData:e,updatePostMetaData:t,globalDefaults:a})=>{const{variables:n,postDynamicData:s,title:u,description:d}=(0,o.useSelect)(e=>{const t=e(i.E);return{variables:t?.getVariables(),postDynamicData:t?.getPostDynamicData(),title:t?.getPostSeoMeta()?.page_title,description:t?.getPostSeoMeta()?.page_description}},[]),p=a,m=(0,l.useRef)(null),g=(0,l.useRef)(null),h=(a,r)=>{e[a]!==r&&t({[a]:r})},f=(e,t)=>{h(e,t)},k=F(n),_=surerank_seo_popup?.site_icon_url?surerank_seo_popup?.site_icon_url:"",y=(0,O.A)(u||p.page_title,k,s),w=(0,O.A)(d||p?.page_description,k,s),v=(0,c.EJ)(y,M.qt),b=(0,c.EJ)(w,M.UM),C=(0,O.A)(u,k,s),x=(0,O.A)(d,k,s),S=(()=>{const e=()=>{if(!wp?.data?.select("core/editor"))return"";const{getPermalink:e,isCurrentPostPublished:t}=wp.data.select("core/editor"),a=e();return t()&&a||a&&!a?.includes("auto-draft")?a:""},[t,a]=(0,l.useState)(e());return wp.data.subscribe(()=>{const r=e();r&&r!==t&&a(r)}),t})(),N=(0,l.useMemo)(()=>/page_id=|p=/.test(k?.permalink)&&S?S:k?.permalink,[k?.permalink,S]);return(0,r.createElement)("div",{className:"flex flex-col gap-2"},(0,r.createElement)("div",{className:"space-y-2.5 p-2 px-0"},(0,r.createElement)("div",{className:"flex items-center justify-between gap-10"},(0,r.createElement)("div",{className:"flex items-center justify-start gap-1"},(0,r.createElement)(D.A,{tag:"span",size:"sm",className:"space-x-0.5"},(0,r.createElement)("span",null,(0,E.__)("Search Engine Preview","surerank"))),(0,r.createElement)(L.$w,{content:(0,E.__)("View a preview of how your page may appear in search engine results. This preview is for guidance only and might not exactly match how search engines display your content.","surerank"),placement:"top",arrow:!0,className:"z-[99999]"},(0,r.createElement)(z.A,{className:"size-4 text-icon-secondary"})))),(0,r.createElement)(I.A,{siteTitle:k?.site_name,faviconURL:_,title:v,description:b,permalink:(0,c.jP)(N,65),deviceType:"desktop"})),(0,r.createElement)(H,{label:(0,E.__)("Search Engine Title","surerank"),inputContent:C,maxLength:M.qt,editorRef:m,defaultValue:(0,c.pk)(e.page_title||p.page_title,M.Op,"value"),variableSuggestions:M.Op,onChange:e=>{h("page_title",(0,c.P3)(e.toJSON()))},editorKey:"title",fieldKey:"page_title",onUseThis:f}),(0,r.createElement)(H,{label:(0,E.__)("Search Engine Description","surerank"),inputContent:x,maxLength:M.UM,editorRef:g,defaultValue:(0,c.pk)(e?.page_description||p?.page_description,M.Op,"value"),variableSuggestions:M.Op,onChange:e=>{h("page_description",(0,c.P3)(e.toJSON()))},className:"[&+div]:items-start [&+div]:pt-1",editorKey:"description",fieldKey:"page_description",onUseThis:f}))};var V=a(74443);const $=(0,s.compose)((0,o.withSelect)(e=>{var t,a;const r=e(i.E),n=null!==(t=null!==(a=e("core/editor")?.getPermalink())&&void 0!==a?a:surerank_seo_popup?.link)&&void 0!==t?t:"";return{postMetaData:r.getPostSeoMeta(),canonicalURLPlaceholder:n,globalDefaults:r.getGlobalDefaults()}}),(0,o.withDispatch)(e=>{const t=e(i.E);return{setMetaData:e=>t.updatePostMetaData(e)}}))(({postMetaData:e,setMetaData:t,canonicalURLPlaceholder:a,globalDefaults:n})=>{var s,l;const o=null!==(s=null!==(l=surerank_seo_popup?.post_type)&&void 0!==l?l:wp?.data?.select("core/editor")?.getCurrentPostType())&&void 0!==s?s:"post",i=e?.post_no_index,c=e?.post_no_follow,u=e?.post_no_archive;let d={};if(""===i&&""===c&&""===u){const e=void 0!==n?.no_index?n.no_index:[],t=void 0!==n?.no_follow?n.no_follow:[],a=void 0!==n?.no_archive?n.no_archive:[];e?.includes(o)&&(d={...d,post_no_index:"yes"}),t?.includes(o)&&(d={...d,post_no_follow:"yes"}),a?.includes(o)&&(d={...d,post_no_archive:"yes"})}return"yes"===i&&(d={...d,post_no_index:"yes"}),"yes"===c&&(d={...d,post_no_follow:"yes"}),"yes"===u&&(d={...d,post_no_archive:"yes"}),(0,r.createElement)(r.Fragment,null,(0,r.createElement)("div",{className:"p-2 pl-0 space-y-2"},(0,r.createElement)("div",{className:"flex items-center justify-start gap-1"},(0,r.createElement)(D.A,{as:"p",size:"sm"},(0,E.__)("Robot Instructions","surerank")," ",(0,r.createElement)(L.Nr,{content:(0,E.__)("These settings help search engines understand how to treat your page in search results. Enabling \u2018No Index\u2019 will prevent the page from appearing in search results. \u2018No Follow\u2019 tells search engines not to follow any links on the page, and \u2018No Archive\u2019 prevents search engines from storing a cached version of the page.","surerank")}))),(0,r.createElement)("div",{className:"flex flex-col gap-2 items-start"},M.vr.map(e=>(0,r.createElement)(V.A,{key:e.id,size:"sm",label:{heading:(0,r.createElement)("div",{className:"flex items-center gap-1"},e.label,(0,r.createElement)(L.Nr,{content:e.description}))},checked:"yes"===d[e.id],onChange:a=>{return r=e.id,n=a,d={...d,[r]:n?"yes":"no"},void t(d);var r,n}})))),(0,r.createElement)("div",{className:"space-y-2 pt-2 px-2 pl-0"},(0,r.createElement)(D.A,{htmlFor:"canonical-url",size:"sm",className:"gap-1"},(0,E.__)("Canonical URL","surerank"),(0,r.createElement)(L.Nr,{content:(0,E.__)("The Canonical URL tells search engines which version of a page should be indexed to avoid duplicate content issues. Leave blank to let SureRank set it automatically.","surerank")})),(0,r.createElement)(x.A,{id:"canonical-url",type:"text",size:"md",className:"[&_input]:m-0",value:e.canonical_url,onChange:e=>(e=>{t({canonical_url:e})})(e),placeholder:a})))});var U=a(13739),G=a(1839),q=a(28177),Z=a(98583),K=a(22895);const Y=({onConfirm:e,confirmText:t=(0,E.__)("Remove","surerank"),cancelText:a=(0,E.__)("Cancel","surerank"),children:n,className:s,...o})=>{const[i,u]=(0,l.useState)(!1),d=e=>{e.preventDefault(),e.stopPropagation()},p=(0,r.createElement)("div",{className:"flex gap-2 items-center"},(0,r.createElement)(_.A,{size:"xs",variant:"outline",onClick:e=>{d(e),u(!1)},"aria-label":(0,E.__)("Cancel","surerank")},a),(0,r.createElement)(_.A,{size:"xs",className:"focus:[box-shadow:none] bg-button-danger hover:bg-button-danger-hover outline-button-danger hover:outline-button-danger-hover",onClick:t=>{d(t),e(),u(!1)},destructive:!0,"aria-label":(0,E.__)("Confirm","surerank")},t));return(0,r.createElement)(L.$w,{className:(0,c.cn)("w-fit p-1.5 rounded shadow-md border border-solid border-border-subtle [&>svg]:fill-border-subtle",s),content:p,open:i,setOpen:u,variant:"light",arrow:!0,...o},(0,l.cloneElement)(n,{onClick:e=>{d(e),u(e=>!e)}}))},W=({postMetaData:e,globalDefaults:t,updatePostMetaData:a})=>{const[n,s]=(0,l.useState)(!1),[o,i]=(0,l.useState)(""),[u,d]=(0,l.useState)(""),[p,m]=(0,l.useState)(null),[g,h]=(0,l.useState)({}),f=surerank_globals?.default_schemas||{},k=Object.entries(f).map(([e,t])=>({id:e,...t})),_=e.schemas?e.schemas:t.schemas||{}||{},y=(0,l.useMemo)(()=>Object.entries(_).filter(([,e])=>(0,Z.sP)(e?.title)),[_]),w=surerank_globals?.schema_type_data||{},v=surerank_globals?.schema_type_options||{},b=(0,l.useMemo)(()=>Object.entries(surerank_globals?.schema_variables||{}).map(([e,t])=>({value:e,label:t})),[]),C=e=>e.reduce((e,t)=>{if("Group"===t.type&&t.fields)if(t.cloneable){const a={};t.fields.forEach(e=>{a[e.id]="Group"===e.type&&e.fields?C(e.fields):void 0!==e.std?e.std:""}),e[t.id]=[a]}else{const a={};t.fields.forEach(e=>{a[e.id]="Group"===e.type&&e.fields?C(e.fields):void 0!==e.std?e.std:""}),e[t.id]=a}else void 0!==t.std&&(e[t.id]=t.std);return e},{}),x=e=>{const t={};return Object.entries(e).forEach(([e,a])=>{const{show_on:r,not_show_on:n,...s}=a,l={...s,parent:!0};t[e]=l}),t};(0,l.useEffect)(()=>{const e={};if(Object.entries(_).forEach(([t,a])=>{const r=a.fields||{},n=C(w[a.title]||[]),s={...r,...n};0===Object.keys(r).length&&(s["@type"]=a?.type||"",e[t]={...a,fields:s})}),Object.keys(e).length>0){const t=x({..._,...e});JSON.stringify(t)!==JSON.stringify(_)&&a({schemas:t})}},[_,w,a]);const S=(e,t)=>_[e]?.fields?.[t]||"",N=(e,t,r)=>{if(((e,t,r)=>{const n={..._,[e]:{..._[e],fields:{..._[e].fields,[t]:r}}},s=x(n);a({schemas:s})})(e,t,r),"@type"===t){const t={..._};t[e].type=r,t[e].fields["@type"]=r,a({schemas:t})}};return(0,r.createElement)("div",{className:"pt-2 gap-2"},(0,r.createElement)("div",{className:"flex items-center mb-4.5 -mt-0.5"},(0,r.createElement)(A.E,{size:14,weight:500,color:"label"},(0,E.__)("Schemas in Use","surerank"))),(0,r.createElement)("div",{className:(0,c.cn)("w-full bg-background-secondary flex flex-col items-center justify-center rounded p-1")},y.length>0?(0,r.createElement)(P.Ay,{type:"simple",iconType:"arrow",className:"w-full space-y-1",autoClose:!1},y.map(([e,t])=>(0,r.createElement)(P.Ay.Item,{key:e,value:e,className:"bg-background-primary rounded-md",defaultExpanded:e===p},(0,r.createElement)(P.Ay.Trigger,{iconType:"arrow",className:"hover:bg-background-primary rounded-md flex justify-between items-center [&>div]:w-full p-2 gap-2 [&>svg]:size-4 cursor-pointer"},(0,r.createElement)("span",{className:"text-base font-normal text-text-primary leading-6 ml-1"},t.title),(0,r.createElement)(Y,{onConfirm:()=>(e=>{const t={..._};delete t[e];const r=x(t);a({schemas:r})})(e),placement:"bottom",offset:{mainAxis:8,crossAxis:-28}},(0,r.createElement)("div",{className:"inline-flex ml-auto",role:"button",tabIndex:0},(0,r.createElement)(G.A,{className:"size-3.5 text-icon-secondary cursor-pointer"})))),(0,r.createElement)(P.Ay.Content,null,(0,r.createElement)("div",{className:"mt-3 space-y-4"},(e=>{const t=_[e]?.title;if(!(0,Z.sP)(t))return Z.lz;const a=w[t]||[];return 0===a.length||a.every(e=>"Hidden"===e.type||"schema_name"===e.id)?Z.lz:a.map(t=>"Hidden"===t.type||"SchemaDocs"===t.type?null:t.show||t.required?(0,r.createElement)("div",{key:t.id,className:"flex flex-col items-start justify-start gap-1.5 w-full p-1"},(0,r.createElement)("div",{className:"flex items-center gap-1.5"},(0,r.createElement)(D.A,{tag:"span",size:"sm",required:t.required},t.label),t.tooltip&&(0,r.createElement)(L.$w,{content:t.tooltip,placement:"top",arrow:!0,className:"z-[99999]"},(0,r.createElement)(z.A,{className:"size-4 text-icon-secondary",title:t.tooltip}))),"Group"===t.type&&t.cloneable?(0,r.createElement)("div",{className:"flex flex-col w-full"},(0,q.hx)({field:t,schemaId:e,getFieldValue:t=>S(e,t),onFieldChange:(t,a)=>N(e,t,a),variableSuggestions:b,fieldItemIds:g,setFieldItemIds:h})):"Group"!==t.type||t.cloneable?(0,r.createElement)("div",{className:"flex items-center gap-1.5 w-full"},t.cloneable?(0,q.OH)({field:t,schemaType:_[e].type,getFieldValue:t=>S(e,t),onFieldChange:(t,a)=>N(e,t,a),variableSuggestions:b,renderAsGroupComponent:!0}):(0,q.Yi)({field:t,schemaType:_[e].type,getFieldValue:t=>S(e,t),onFieldChange:(t,a)=>N(e,t,a),variableSuggestions:b,renderAsGroupComponent:!0})):(0,r.createElement)("div",{className:"flex flex-col w-full space-y-3 border border-border-subtle rounded-lg p-3"},t.fields.map(a=>"Hidden"===a.type?null:(0,r.createElement)("div",{key:a.id,className:"flex flex-col items-start justify-start gap-1.5 w-full"},(0,r.createElement)("div",{className:"flex items-center gap-1.5"},(0,r.createElement)(D.A,{tag:"span",size:"sm",required:a.required},a.label),a.tooltip&&(0,r.createElement)(L.$w,{content:a.tooltip,placement:"top",arrow:!0,className:"z-[99999]"},(0,r.createElement)(z.A,{className:"size-4 text-icon-secondary",title:a.tooltip}))),(0,r.createElement)("div",{className:"flex items-center gap-1.5 w-full"},(0,q.Yi)({field:a,schemaType:_[e].type,getFieldValue:r=>(S(e,t.id)||{})[r]||a.std||"",onFieldChange:(a,r)=>{const n={...S(e,t.id)||{},[a]:r};N(e,t.id,n)},variableSuggestions:b,renderAsGroupComponent:!1})))))):null)})(e)))))):(0,r.createElement)(U.A,{className:"w-full shadow-none",content:(0,E.__)("No schemas configured.","surerank"),variant:"info"})),(0,r.createElement)("div",{className:"w-full mt-6 rounded"},(0,r.createElement)(K.A,{selectedSchema:o,setSelectedSchema:i,selectedType:u,setSelectedType:d,schemaTypeOptions:v,defaultSchemas:k,handleAddSchema:()=>{const e=(0,Z.lk)(),t={title:o,type:u,show_on:{rules:[],specific:[],specificText:[]},fields:{}},r={..._,[e]:t},n=x(r);a({schemas:n}),m(e),s(!1),i(""),d("")},isModalOpen:n,closeModal:()=>s(!1)})))},J=({postMetaData:e,updatePostMetaData:t,globalDefaults:a})=>(0,r.createElement)(P.Ay,{autoClose:!0,defaultValue:"general",type:"boxed",className:"bg-background-secondary space-y-1 p-1 rounded-lg"},(0,r.createElement)(P.Ay.Item,{value:"general",className:"bg-background-primary border-none"},(0,r.createElement)(P.Ay.Trigger,{className:"text-base [&>svg]:size-5 pr-2 pl-3 py-3"},(0,E.__)("General","surerank")),(0,r.createElement)(P.Ay.Content,null,(0,r.createElement)(B,{postMetaData:e,updatePostMetaData:t,globalDefaults:a}))),(0,r.createElement)(P.Ay.Item,{value:"advanced",className:"bg-background-primary border-none"},(0,r.createElement)(P.Ay.Trigger,{className:"text-base [&>svg]:size-5 pr-2 pl-3 py-3"},(0,E.__)("Advanced","surerank")),(0,r.createElement)(P.Ay.Content,null,(0,r.createElement)($,{postMetaData:e,updatePostMetaData:t,globalDefaults:a}))),M.Rw&&(0,r.createElement)(P.Ay.Item,{value:"schema",className:"bg-background-primary border-none"},(0,r.createElement)(P.Ay.Trigger,{className:"text-base [&>svg]:size-5 pr-2 pl-3 py-3"},(0,E.__)("Schema","surerank")),(0,r.createElement)(P.Ay.Content,null,(0,r.createElement)(W,{postMetaData:e,updatePostMetaData:t,globalDefaults:a}))));var X=a(19781),Q=a(82313),ee=a(14060),te=a(38502),ae=a(68458),re=a(60249);const ne=[{label:"Facebook",icon:Q.A,tabSlug:"facebook"},{label:"X",icon:f.B0,tabSlug:"twitter"}],se=({postMetaData:e,updatePostMetaData:t,globalDefaults:a})=>{const{variables:n,postDynamicData:s}=(0,o.useSelect)(e=>{const{getVariables:t,getPostDynamicData:a}=e(i.E);return{variables:t(),postDynamicData:a()}},[]),u=a,[p,m]=(0,l.useState)("facebook"),g=(0,l.useCallback)((t,a)=>{let r=p;return"twitter"===p&&e?.twitter_same_as_facebook&&(r="facebook"),e?.[`${r}_${t}`]||a?.[`${r}_${t}`]},[p,e,n,s]),h=F(n),f=(0,c.EJ)((0,O.A)(g("title",u),h,s),null),k=(0,c.EJ)((0,O.A)(g("description",u),h,s),78),y=e?.auto_generated_og_image?e?.auto_generated_og_image:u?.fallback_image,w=g("image_url",u)?g("image_url",u):y;let v=e?.[`${p}_image_url`]?e?.[`${p}_image_url`]:w;"twitter"===p&&e?.twitter_same_as_facebook&&(v=e?.facebook_image_url||y);const b=!!e?.[`${p}_image_url`],C=()=>{t({[`${p}_image_url`]:"",[`${p}_image_id`]:""})},S=(0,l.useRef)(null),N=(0,l.useRef)(null),A=(a,r)=>{e[a]!==r&&t({[a]:r})},T=e=>{e.preventDefault();const a=(0,re.a)({title:"Select Image",button:{text:"Use this image"},multiple:!1});a.on("select",()=>{const e=a.state().get("selection").first().toJSON();t({[`${p}_image_url`]:e.url,[`${p}_image_id`]:e.id})}),a.open()},I=()=>{const e=window?.wp?.data?.select("core/editor")?.getPermalink()||n?.term?.permalink?.value;window.open(`https://developers.facebook.com/tools/debug/?q=${e}`,"_blank")};return(0,r.createElement)("div",{className:"flex flex-col gap-2 max-h-full w-full"},(0,r.createElement)(P.Ay,{autoClose:!0,defaultValue:"facebook",collapsible:!1,type:"boxed",className:"bg-background-secondary space-y-1 rounded-lg w-full"},ne.map(({label:t,tabSlug:s})=>{return(0,r.createElement)(P.Ay.Item,{key:s,value:s,className:"bg-background-primary border-none w-full"},(0,r.createElement)(P.Ay.Trigger,{className:"text-base [&>svg]:size-5 pr-2 pl-3 py-3 flex items-center gap-2 w-full",onClick:()=>{m("twitter"===s?"twitter":"facebook")}},t),(0,r.createElement)(P.Ay.Content,null,(0,r.createElement)(d.P.div,{key:s,className:"flex-1 flex flex-col gap-2 overflow-y-auto",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2}},"twitter"===s&&(0,r.createElement)("div",{className:"flex items-center gap-3 p-2"},(0,r.createElement)(X.Ay,{id:"facebook_same_as_twitter",name:"facebook_same_as_twitter",size:"sm",defaultValue:!!e?.twitter_same_as_facebook,onChange:e=>{A("twitter_same_as_facebook",!!e&&"1")}}),(0,r.createElement)(D.A,{htmlFor:"facebook_same_as_twitter",size:"sm"},(0,E.__)("Use Data from Facebook Tab","surerank"))),(l="twitter"===s&&!!e?.twitter_same_as_facebook,o=(0,r.createElement)(r.Fragment,null,(0,r.createElement)("div",{className:"p-2 space-y-1.5"},(0,r.createElement)("div",{className:"flex items-center gap-1"},(0,r.createElement)(D.A,{tag:"span",size:"sm"},(0,E.__)("Social Image","surerank")),(0,r.createElement)(L.$w,{content:(0,E.__)("Upload at least 600x315px image. Recommended size is 1200x630px.","surerank"),placement:"top",arrow:!0,className:"z-[99999]"},(0,r.createElement)(z.A,{className:"size-4 text-icon-secondary"}))),(0,r.createElement)(x.A,{className:"m-0 [&>input]:m-0 [&>input]:transition-colors [&>input]:duration-150 [&>input]:ease-in-out",type:"file",size:"md",onClick:T}),b&&(0,r.createElement)(ae.A,{imageId:e?.[`${p}_image_id`],onRemove:C})),(0,r.createElement)("div",{className:"space-y-1.5 p-2"},(0,r.createElement)("div",{className:"flex items-center justify-between gap-1"},(0,r.createElement)(D.A,{tag:"span",size:"sm",className:"space-x-0.5"},(0,r.createElement)("span",null,(0,E.__)("Social Title","surerank"))),(0,r.createElement)(j,{fieldKey:`${s}_title`,onUseThis:(e,t)=>{A(e,t)}})),(0,r.createElement)(R.A,{ref:S,by:"label",defaultValue:(0,c.pk)(e?.[`${s}_title`],M.Op,"value"),trigger:"@",options:M.Op,onChange:e=>{A(`${s}_title`,(0,c.P3)(e.toJSON()))},placeholder:""}),(0,r.createElement)("span",{className:"block text-xs leading-4 font-normal text-field-helper"},(0,E.__)("Type @ to view variable suggestions","surerank"))),(0,r.createElement)("div",{className:"space-y-1.5 p-2"},(0,r.createElement)("div",{className:"flex items-center justify-between gap-1"},(0,r.createElement)(D.A,{tag:"span",size:"sm",className:"space-x-0.5"},(0,r.createElement)("span",null,(0,E.__)("Social Description","surerank"))),(0,r.createElement)(j,{fieldKey:`${s}_description`,onUseThis:(e,t)=>{A(e,t)}})),(0,r.createElement)(R.A,{ref:N,className:"[&+div]:items-start [&+div]:pt-1",by:"label",defaultValue:(0,c.pk)(e?.[`${s}_description`],M.Op,"value"),options:M.Op,onChange:e=>{A(`${s}_description`,(0,c.P3)(e.toJSON()))},trigger:"@",placeholder:"",maxLength:M.x8}),(0,r.createElement)("span",{className:"block text-xs leading-4 font-normal text-field-helper"},(0,E.__)("Type @ to view variable suggestions","surerank")))),l?null:"function"===typeof o?o():o),(0,r.createElement)("div",{className:"p-2 space-y-2"},(0,r.createElement)("div",{className:"flex items-center justify-between"},(0,r.createElement)(D.A,{tag:"span",size:"sm"},(0,E.sprintf)((0,E.__)("%s Preview","surerank"),"facebook"===s?"Facebook":"X")),"facebook"===s&&(0,r.createElement)(L.$w,{content:(0,E.__)("Click to update Facebook's share preview cache. This will update the preview with the latest content.","surerank"),placement:"top-end",offset:{alignmentAxis:"0",mainAxis:"8"},arrow:!0},(0,r.createElement)(_.A,{size:"sm",className:"p-0.5",onClick:I,icon:(0,r.createElement)(ee.A,null),variant:"ghost"}))),(0,r.createElement)(te.A,{type:s,title:f,description:k,imageURL:v,twitterLargePreview:"twitter"===s&&"summary_large_image"===a?.twitter_card_type,siteURL:n?.site?.site_url?.value?.replace(/(^\w+:|^)\/\//,""),hideRemoveButton:!0,forMetaBox:!0})))));var l,o})))},le=({postMetaData:e,updatePostMetaData:t,globalDefaults:a})=>(0,r.createElement)("div",{className:"p-2 gap-2"},(0,r.createElement)("div",{className:"w-full bg-background-secondary flex flex-col items-center justify-center rounded p-1"},(0,r.createElement)(se,{postMetaData:e,updatePostMetaData:t,globalDefaults:a}))),oe=({tab:e="general"})=>{if("advanced"===e){const e=3;return(0,r.createElement)("div",{className:"w-full p-4 space-y-5"},(0,r.createElement)("div",{className:"space-y-2"},(0,r.createElement)("div",{className:"w-full flex items-center gap-2"},(0,r.createElement)(C.A,{variant:"rectangular",className:"w-32 h-4"}),(0,r.createElement)(C.A,{variant:"circular",className:"size-5"})),(0,r.createElement)("div",{className:"space-y-4"},Array.from({length:e}).map((e,t)=>(0,r.createElement)("div",{key:t,className:"flex items-start gap-2"},(0,r.createElement)(C.A,{variant:"rectangular",className:"size-5"}),(0,r.createElement)("div",{className:"space-y-2"},(0,r.createElement)(C.A,{variant:"rectangular",className:(0,c.cn)("w-44 h-5",t%2===0&&"w-52")}),(0,r.createElement)(C.A,{variant:"rectangular",className:"w-full h-4"})))))),(0,r.createElement)("div",{className:"w-full p-1 space-y-1.5"},(0,r.createElement)("div",{className:"w-full flex items-center gap-2"},(0,r.createElement)(C.A,{variant:"rectangular",className:"w-32 h-4"}),(0,r.createElement)(C.A,{variant:"rectangular",className:"w-5 h-4"})),(0,r.createElement)(C.A,{variant:"rectangular",className:"w-full h-12"}),(0,r.createElement)(C.A,{variant:"rectangular",className:"w-full h-3"})))}const t="social"===e?2:1;return(0,r.createElement)("div",{className:"w-full space-y-2 p-2"},"social"===e&&(0,r.createElement)("div",{className:"w-full p-1"},(0,r.createElement)(C.A,{variant:"rectangular",className:"w-full h-14"})),(0,r.createElement)("div",{className:"w-full p-1 space-y-2"},(0,r.createElement)("div",{className:"w-full flex items-center justify-between"},(0,r.createElement)(C.A,{variant:"rectangular",className:"w-32 h-4"}),(0,r.createElement)(C.A,{variant:"rectangular",className:"w-10 h-5"})),(0,r.createElement)(C.A,{variant:"rectangular",className:(0,c.cn)("w-full h-40",{"h-48":"social"===e})})),Array.from({length:t}).map((e,t)=>(0,r.createElement)("div",{key:t,className:"w-full p-1 space-y-1.5"},(0,r.createElement)("div",{className:"w-full flex items-center gap-2"},(0,r.createElement)(C.A,{variant:"rectangular",className:"w-32 h-4"}),(0,r.createElement)(C.A,{variant:"rectangular",className:"w-5 h-4"})),(0,r.createElement)(C.A,{variant:"rectangular",className:"w-full h-12"}),(0,r.createElement)(C.A,{variant:"rectangular",className:"w-full h-3"}))),(0,r.createElement)("div",{className:"w-full p-1 space-y-1.5"},(0,r.createElement)("div",{className:"w-full flex items-center gap-2"},(0,r.createElement)(C.A,{variant:"rectangular",className:"w-32 h-4"}),(0,r.createElement)(C.A,{variant:"rectangular",className:"w-5 h-4"})),(0,r.createElement)(C.A,{variant:"rectangular",className:"w-full h-32"}),(0,r.createElement)(C.A,{variant:"rectangular",className:"w-full h-3"})))},ie=[{label:(0,E.__)("Meta","surerank"),slug:"meta"},{label:(0,E.__)("Social","surerank"),slug:"social"}];let ce=e=>e;"block"===surerank_seo_popup?.editor_type?ce=g:"classic"===surerank_seo_popup?.editor_type&&(ce=h);const ue=(0,s.compose)((0,o.withSelect)(e=>{const t=e(i.E);return{postMetaData:t.getPostSeoMeta(),initialized:t.getMetaboxState(),globalDefaults:t.getGlobalDefaults()}}),(0,o.withDispatch)(e=>{const t=e(i.E);return{updatePostMetaData:e=>t.updatePostMetaData(e)}}),ce)((0,l.memo)(e=>{const{postMetaData:t,updatePostMetaData:a,initialized:n,globalDefaults:s}=e,{updateAppSettings:c}=(0,o.useDispatch)(i.E),{currentMetaTab:u}=(0,o.useSelect)(e=>e(i.E).getAppSettings()),[p,m]=(0,l.useState)(u||"meta");(0,l.useEffect)(()=>{u&&u!==p&&m(u)},[u]);let g=null;switch(p){case"meta":g=(0,r.createElement)(J,{postMetaData:t,updatePostMetaData:a,globalDefaults:s});break;case"social":g=(0,r.createElement)(le,{postMetaData:t,updatePostMetaData:a,globalDefaults:s});break;default:g=null}return n||(g=(0,r.createElement)(oe,{tab:p})),(0,r.createElement)(l.Fragment,null,(0,r.createElement)("div",null,(0,r.createElement)(k.Ay.Group,{className:"w-full",size:"md",variant:"rounded",activeItem:p,onChange:({event:e,value:{slug:t}})=>{e.preventDefault(),e.stopPropagation(),m(t),c({currentMetaTab:t})}},ie.map(({label:e,slug:t})=>(0,r.createElement)(k.Ay.Tab,{key:e,slug:t,text:e,className:"text-sm"})))),(0,r.createElement)(d.P.div,{key:p,className:"flex flex-col gap-2 flex-1 overflow-y-auto",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2}},g))}));var de=a(74801);const pe=({isRefreshing:e,isChecking:t,onClick:a,targetSelector:n=".refresh-button-container"})=>{const[s,o]=(0,l.useState)(null);return(0,l.useEffect)(()=>{const e=()=>{const e=document.querySelector(n);e&&o(e)};e();const t=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver,a=t?new t(e):null;return a&&a.observe(document.body,{childList:!0,subtree:!0}),()=>a.disconnect()},[n]),s?(0,l.createPortal)((0,r.createElement)(de.sv,{isRefreshing:e,isChecking:t,onClick:a}),s):null};var me=a(54822),ge=a(68402);const he={IDLE:"idle",START:"start",IN_PROGRESS:"inProgress",COMPLETED:"completed",FAILED:"failed"};var fe=a(23551),ke=a(66087),_e=a(18947);const ye=(e,t)=>!(!e||!t)&&e.toLowerCase().includes(t.toLowerCase()),Ee=()=>{var e;const{setPageSeoCheck:t}=(0,o.useDispatch)(i.E),{metaData:a,variables:r,postDynamicData:n,globalDefaults:s,settingsLoaded:c,pageSeoChecks:u,focusKeyword:d,ignoredList:p,initializing:m}=(0,o.useSuspenseSelect)(e=>{const t=e(i.E);return{metaData:t?.getPostSeoMeta(),variables:t?.getVariables(),postDynamicData:t?.getPostDynamicData(),globalDefaults:t?.getGlobalDefaults(),settingsLoaded:t?.getMetaboxState(),pageSeoChecks:t?.getPageSeoChecks()||{},focusKeyword:t?.getPostSeoMeta()?.focus_keyword,ignoredList:t.getCurrentPostIgnoredList(),initializing:t.getPageSeoChecks().initializing}},[]),g=(0,l.useRef)({postContent:"",permalink:""}),h=(0,l.useRef)(a),f=(0,l.useRef)(d),k=(0,l.useRef)(p),_=(0,l.useCallback)((e,a,l)=>{if(!l)return void t("keyword",[]);const o=F(r),i=(0,O.A)(a.page_title||s.page_title||"",o,n),c=(0,O.A)(a.page_description||s.page_description||"",o,n),u=e?.permalink||r?.post?.permalink?.value||r?.term?.permalink?.value||window.location.href||"",d=e?.postContent||n?.content||"",p=[];p.push(((e,t)=>t?e?ye(e,t)?(0,_e.bY)({id:"keyword_in_title",title:(0,E.sprintf)((0,E.__)('Focus keyword "%s" found in SEO title.',"surerank"),t),status:"success",type:"keyword"}):(0,_e.bY)({id:"keyword_in_title",title:(0,E.sprintf)((0,E.__)('Focus keyword "%s" not found in SEO title.',"surerank"),t),status:"warning",type:"keyword"}):(0,_e.bY)({id:"keyword_in_title",title:(0,E.__)("No SEO title found to analyze.","surerank"),status:"warning",type:"keyword"}):(0,_e.bY)({id:"keyword_in_title",title:(0,E.__)("No focus keyword set to analyze title.","surerank"),status:"suggestion",type:"keyword"}))(i,l)),p.push(((e,t)=>t?e?ye(e,t)?(0,_e.bY)({id:"keyword_in_description",title:(0,E.sprintf)((0,E.__)('Focus keyword "%s" found in meta description.',"surerank"),t),status:"success",type:"keyword"}):(0,_e.bY)({id:"keyword_in_description",title:(0,E.sprintf)((0,E.__)('Focus keyword "%s" not found in meta description.',"surerank"),t),status:"warning",type:"keyword"}):(0,_e.bY)({id:"keyword_in_description",title:(0,E.__)("No meta description found to analyze.","surerank"),status:"warning",type:"keyword"}):(0,_e.bY)({id:"keyword_in_description",title:(0,E.__)("No focus keyword set to analyze meta description.","surerank"),status:"suggestion",type:"keyword"}))(c,l)),p.push(((e,t)=>{if(!t)return(0,_e.bY)({id:"keyword_in_url",title:(0,E.__)("No focus keyword set to analyze URL.","surerank"),status:"suggestion",type:"keyword"});if(!e)return(0,_e.bY)({id:"keyword_in_url",title:(0,E.__)("No URL found to analyze.","surerank"),status:"warning",type:"keyword"});const a=t.toLowerCase().replace(/\s+/g,"-");return e.toLowerCase().includes(a)||ye(e,t)?(0,_e.bY)({id:"keyword_in_url",title:(0,E.sprintf)((0,E.__)('Focus keyword "%s" found in URL.',"surerank"),t),status:"success",type:"keyword"}):(0,_e.bY)({id:"keyword_in_url",title:(0,E.sprintf)((0,E.__)('Focus keyword "%s" not found in URL.',"surerank"),t),status:"warning",type:"keyword"})})(u,l)),p.push(((e,t)=>{if(!t)return(0,_e.bY)({id:"keyword_in_content",title:(0,E.__)("No focus keyword set to analyze content.","surerank"),status:"suggestion",type:"keyword"});if(!e)return(0,_e.bY)({id:"keyword_in_content",title:(0,E.__)("No content found to analyze.","surerank"),status:"warning",type:"keyword"});const a=e.replace(/<[^>]*>/g," ").replace(/\s+/g," ").trim();return ye(a,t)?(0,_e.bY)({id:"keyword_in_content",title:(0,E.sprintf)((0,E.__)('Focus keyword "%s" found in content.',"surerank"),t),status:"success",type:"keyword"}):(0,_e.bY)({id:"keyword_in_content",title:(0,E.sprintf)((0,E.__)('Focus keyword "%s" not found in content.',"surerank"),t),status:"warning",type:"keyword"})})(d,l));const m=p.filter(Boolean);t("keyword",m)},[r,n,s,t]);(0,l.useLayoutEffect)(()=>{if(!c)return;const e=st();(!(0,ke.isEqual)(h.current,a)||!(0,ke.isEqual)(g.current,e)||f.current!==d||!(0,ke.isEqual)(k.current,p))&&(_(e,a,d),g.current=e,h.current=a,f.current=d,k.current=p)},[c,d,a,r,s,n,p,m]),(0,l.useLayoutEffect)(()=>{if(!c)return;const e=(0,ke.debounce)(()=>{const e=st();(0,ke.isEqual)(g.current,e)&&(0,ke.isEqual)(h.current,a)&&f.current===d&&(0,ke.isEqual)(k.current,p)||(g.current=e,h.current=a,f.current=d,k.current=p,_(e,a,d))},300),t=(0,o.subscribe)(e);return()=>{t(),e.cancel()}},[c,a,d,r,s,n,p,_,m]);const y=null!==(e=u?.keywordChecks)&&void 0!==e?e:{badChecks:[],fairChecks:[],passedChecks:[],suggestionChecks:[],ignoredChecks:[]},w=y?.badChecks?.length>0||y?.fairChecks?.length>0||y?.suggestionChecks?.length>0;return{...y,hasBadOrFairChecks:w}},we=({type:e="page"})=>{const{pageSeoChecks:t,focusKeyword:a,currentScreen:n,currentTab:s}=(0,o.useSuspenseSelect)(e=>{const t=e(i.E),a=t.getAppSettings();return{pageSeoChecks:t?.getPageSeoChecks()||{},focusKeyword:t?.getPostSeoMeta?.()?.focus_keyword,ignoredList:t.getCurrentPostIgnoredList(),currentScreen:a?.currentScreen,currentTab:a?.currentTab}},[]),{ignorePageSeoCheck:u,restorePageSeoCheck:d,updateAppSettings:p,updatePostSeoMeta:m}=(0,o.useDispatch)(i.E);Ee();const g=(0,l.useMemo)(()=>{var a;const r=t?.categorizedChecks||{badChecks:[],fairChecks:[],passedChecks:[],suggestionChecks:[],ignoredChecks:[]};return null!==(a=t[(0,c.sz)(e)?.categorizedType])&&void 0!==a?a:{...r}},[e,t?.checks]),h=({selectedCheckId:e,content:t})=>{if("url_length"===e&&t){const e=(0,w.applyFilters)("surerank-pro.page-seo-checks-fix-url-length",null);if("function"!==typeof e)return;return void e(t)}const a=ge.BB[e];a&&m({[a]:t})};return"keyword"!==e||a?(0,r.createElement)(me.A,{type:e,pageSeoChecks:{...t,...g},onIgnore:e=>{u(e)},onRestore:e=>{d(e)},onFix:e=>{p({selectedCheckId:e,onSuccess:h,generateContentProcess:he.IDLE,error:null,fixProcess:he.IDLE,currentScreen:"fixItForMe",previousScreen:n,previousTab:s})}}):(0,r.createElement)("div",{className:"text-center py-4"},(0,r.createElement)(A.E,{as:"p",color:"secondary",size:14},(0,E.__)("To see keyword-specific SEO checks, first set a focus keyword under the Optimize tab.","surerank")))},ve=({type:e="page"})=>!1===M.Jj?null:(0,r.createElement)(l.Suspense,{fallback:(0,r.createElement)(fe.A,null)},(0,r.createElement)(we,{type:e})),be=({type:e="page"})=>{const t=(0,o.useSelect)(e=>e(i.E).getPageSeoChecks(),[]),{ignorePageSeoCheck:a,restorePageSeoCheck:n,updateAppSettings:s,updatePostSeoMeta:u}=(0,o.useDispatch)(i.E),{focusKeyword:d,currentScreen:p,currentTab:m}=(0,o.useSelect)(e=>{const t=e(i.E),a=t.getAppSettings();return{focusKeyword:t?.getPostSeoMeta?.()?.focus_keyword,currentScreen:a?.currentScreen,currentTab:a?.currentTab}},[]),g=(0,l.useMemo)(()=>{var a;const r=t?.categorizedChecks||{badChecks:[],fairChecks:[],passedChecks:[],suggestionChecks:[],ignoredChecks:[]},n=(0,c.sz)(e)?.categorizedType;return null!==(a=t[n])&&void 0!==a?a:{...r}},[e,t?.checks]),h=({selectedCheckId:e,content:t})=>{const a=ge.BB[e];a&&u({[a]:t})};return(0,de.ep)()?null:"keyword"!==e||d?(0,r.createElement)("div",{className:"p-1 space-y-2 flex-1 flex flex-col"},(0,r.createElement)("div",{className:"flex-1"},(0,r.createElement)(l.Suspense,{fallback:(0,r.createElement)(fe.A,null)},(0,r.createElement)(me.A,{type:e,pageSeoChecks:{...t,...g,isCheckingLinks:t.isCheckingLinks},onIgnore:e=>{a(e)},onRestore:e=>{n(e)},onFix:e=>{s({selectedCheckId:e,onSuccess:h,generateContentProcess:he.IDLE,error:null,fixProcess:he.IDLE,currentScreen:"fixItForMe",previousScreen:p,previousTab:m})}})))):(0,r.createElement)("div",{className:"text-center py-4"},(0,r.createElement)(A.E,{as:"p",color:"secondary",size:14},(0,E.__)("Enter a focus keyword to see keyword-specific SEO checks.","surerank")))};var Ce=a(54486);const xe=({type:e})=>{if(!M.Jj||(0,de.ep)())return null;const t=(0,de.jK)();return(0,r.createElement)(t?be:ve,{type:e})},Se=(0,w.applyFilters)("surerank-pro.seo-popup-tabs",{optimize:{title:(0,E.__)("Optimize","surerank"),component:()=>(0,r.createElement)(r.Fragment,null,M.Jj&&!(0,de.ep)()&&(0,r.createElement)("div",{className:"flex items-center gap-2"},(0,r.createElement)(T,null)),(0,r.createElement)(ue,null)),label:(0,E.__)("Optimize","surerank"),icon:(0,r.createElement)(v.A,null),slug:"optimize"},...!M.Jj||(0,de.ep)()?{}:{analyze:{title:(0,E.__)("Analyze","surerank"),component:()=>{const e=(0,de.jK)(),t=(0,o.useSelect)(e=>e(i.E).getPageSeoChecks(),[]),a=(0,l.useMemo)(()=>{const e=t?.categorizedPageChecks||{};return"success"!==(0,Ce.F)(e)?.status},[t?.categorizedPageChecks]),n=t?.isRefreshing||!1,s=t?.brokenLinkState||{isChecking:!1,checkedLinks:[],brokenLinks:[],allLinks:[]},c={...s,checkedLinks:new Set(s.checkedLinks),brokenLinks:new Set(s.brokenLinks)},u=(0,o.useSelect)(e=>e(i.E).getModalState(),[]),d=(0,o.useSelect)(e=>e(i.E).getRefreshCalled(),[]),{setPageSeoCheck:p,setRefreshCalled:m}=(0,o.useDispatch)(i.E),g=(0,l.useCallback)(e=>{p("isRefreshing",e)},[p]),h=(0,l.useCallback)(e=>{let t=e;if("function"===typeof e){const a=e({...s,checkedLinks:new Set(s.checkedLinks),brokenLinks:new Set(s.brokenLinks)});t={...a,checkedLinks:Array.from(a.checkedLinks||[]),brokenLinks:Array.from(a.brokenLinks||[])}}else e&&"object"===typeof e&&(t={...e,checkedLinks:e.checkedLinks instanceof Set?Array.from(e.checkedLinks):e.checkedLinks||[],brokenLinks:e.brokenLinks instanceof Set?Array.from(e.brokenLinks):e.brokenLinks||[]});p("brokenLinkState",t)},[p,s]),f=(0,l.useCallback)(async()=>{m(!0),await(0,de.OV)(g,h,p,o.select,t,c)},[g,h,p,t,c,m]);(0,l.useEffect)(()=>{e&&u&&!d&&((0,de.OV)(g,h,p,o.select,t,c),m(!0))},[e,u,d,p,t,c,m]);const k=a?"page-checks":"keyword-checks";return!M.Jj||(0,de.ep)()?(0,r.createElement)("div",null,(0,r.createElement)(A.E,{color:"help",size:14,className:"text-center py-5 border-0.5 border-solid border-border-secondary rounded-md"},(0,E.__)("SEO analysis is not available for this page.","surerank"))):(0,r.createElement)("div",{className:"space-y-2"},(0,de.jp)()&&(0,r.createElement)("div",{className:"[&_p.mr-10]:mr-0"},(0,r.createElement)(U.A,{variant:"info",content:(0,r.createElement)("span",{className:"flex items-start gap-2"},(0,r.createElement)("p",null,(0,E.__)("Please save changes in the editor before refreshing the checks.","surerank")),(0,r.createElement)("span",{className:"-mr-3 refresh-button-container shrink-0"})),className:"shadow-none"})),e&&(0,r.createElement)(pe,{isRefreshing:n,isChecking:t.isCheckingLinks,onClick:f}),(0,r.createElement)(P.Ay,{autoClose:!0,defaultValue:k,type:"boxed"},(0,r.createElement)(P.Ay.Item,{value:"page-checks",className:"bg-background-primary overflow-hidden"},(0,r.createElement)(P.Ay.Trigger,{className:"text-base [&>svg]:size-5 pr-2 pl-3 py-3"},(0,E.__)("Page Checks","surerank")),(0,r.createElement)(P.Ay.Content,null,(0,r.createElement)("div",{className:"pt-3"},(0,r.createElement)(xe,{type:"page"})))),(0,r.createElement)(P.Ay.Item,{value:"keyword-checks",className:"bg-background-primary overflow-hidden"},(0,r.createElement)(P.Ay.Trigger,{className:"text-base [&>svg]:size-5 pr-2 pl-3 py-3"},(0,E.__)("Keyword Checks","surerank")),(0,r.createElement)(P.Ay.Content,null,(0,r.createElement)("div",{className:"pt-3"},(0,r.createElement)(xe,{type:"keyword"}))))))},label:(0,E.__)("Analyze","surerank"),slug:"analyze",icon:(0,r.createElement)(b.A,null),className:"relative surerank-page-checks-indicator"}}}),Ne=(0,l.memo)(({status:e,errorAndWarnings:t=0,initializing:a=!1,className:n=""})=>{const s=(0,l.useMemo)(()=>(0,c.ns)(e),[e]),o=(0,l.useMemo)(()=>(0,c.x7)(t),[t]);return!a&&e&&M.Jj?(0,r.createElement)("div",{className:(0,c.cn)("absolute top-0.5 right-1 size-2 rounded-full z-10 duration-200",s,n),"aria-label":o,title:o}):null}),Ae=()=>{const{categorizedChecks:e={},initializing:t=!0}=(0,o.useSelect)(e=>{const t=e(i.E).getPageSeoChecks();return{categorizedChecks:t.categorizedChecks,initializing:t.initializing}},[]),{status:a,counts:r}=(0,l.useMemo)(()=>{var t;return null!==(t=(0,Ce.F)(e))&&void 0!==t?t:{status:null,initializing:!0,counts:{errorAndWarnings:0}}},[e]);return{status:a,initializing:t,counts:r}},Le=()=>{const{updateAppSettings:e}=(0,o.useDispatch)(i.E),{currentTab:t,currentScreen:a}=(0,o.useSelect)(e=>e(i.E).getAppSettings());if("fixItForMe"===a)return null;const n=Object.values(null!==Se&&void 0!==Se?Se:{}).filter(e=>!!e?.slug);return(0,r.createElement)(k.Ay.Group,{className:"h-full [&_button]:h-full border-0",size:"sm",variant:"underline",activeItem:t,onChange:({value:{slug:r}})=>{t!==r&&"settings"===a&&e({currentTab:r,previousTab:t||""})}},n.map(e=>(0,r.createElement)(k.Ay.Tab,{className:(0,c.cn)("font-medium [box-shadow:none]",e?.className),key:e.slug,slug:e.slug,text:e.label,icon:e.icon})))},Te=()=>{const[e,t]=(0,l.useState)(null),{status:a,initializing:n,counts:s}=Ae();return(0,l.useEffect)(()=>{const e=()=>document.querySelector(".surerank-page-checks-indicator");let a=e();a&&t(a);const r=new MutationObserver(()=>{const r=e();r!==a&&(a=r,t(r))}),n=document.getElementById("surerank-metabox-header");if(n)return r.observe(n,{childList:!0,subtree:!0}),()=>{r.disconnect()}},[]),e&&(0,l.createPortal)((0,r.createElement)(Ne,{status:a,errorAndWarnings:s.errorAndWarnings,initializing:n,className:"static ml-1 size-1.5"}),e)},Pe=(0,l.memo)(({onClose:e})=>(0,r.createElement)("div",{id:"surerank-metabox-header",className:"flex items-center justify-between gap-3 border-0 border-b-0.5 border-solid border-border-subtle"},(0,r.createElement)("div",{className:"flex items-center py-3.5 px-4"},(0,r.createElement)(f.V_,{width:32,height:20})),(0,r.createElement)("div",{className:"h-full flex items-center mr-auto gap-2"},(0,r.createElement)(Le,null)),(0,r.createElement)("div",{className:"flex items-center py-3.5 px-4 gap-2"},(0,r.createElement)(_.A,{variant:"ghost",size:"sm",onClick:e,className:"p-1 text-icon-secondary hover:text-icon-primary hover:bg-transparent bg-transparent focus:outline-none",icon:(0,r.createElement)(y.A,null)})),(0,r.createElement)(Te,null)));var Me=a(1455),De=a.n(Me),ze=a(87096),Ie=a(62220),Oe=a(64894);const Fe=()=>{const e=(0,o.useSelect)(e=>e(i.E).getUnsavedMetaSettings(),[]),{resetUnsavedMetaSettings:t,initMetaDataAndDefaults:a}=(0,o.useDispatch)(i.E),n=(0,l.useCallback)(e=>{e.preventDefault(),e.returnValue=null},[e]);(0,l.useEffect)(()=>{if(e&&Object.keys(null!==e&&void 0!==e?e:{}).length)return window.addEventListener("beforeunload",n),()=>{window.removeEventListener("beforeunload",n)}},[n]);const s=Object.keys(null!==e&&void 0!==e?e:{}).length>0;return(0,r.createElement)(ze.A,{onClick:async()=>{const r={metaData:e,...(0,c.P$)("term.php")?{term_id:surerank_seo_popup?.term_id}:{post_id:surerank_seo_popup?.post_id}};try{const e=await De()({path:(0,c.P$)("term.php")?Ie.EJ:Ie.MF,method:"POST",data:r});if(!e.success)throw e;return(async()=>{try{const e=await(0,Oe.lr)();a({postSeoMeta:e.data,globalDefaults:e.global_default})}catch(e){}})(),setTimeout(()=>{t()},1e3),e}catch(n){throw n}},className:s?"":"opacity-60 bg-background-brand cursor-not-allowed pointer-events-none",icon:s?(0,r.createElement)(f.Zy,null):null,disabled:!s})},Re=({onClose:e})=>(0,r.createElement)("div",{className:"flex items-center justify-start gap-3 px-5 py-2.5"},(0,r.createElement)(Fe,null),(0,r.createElement)(_.A,{onClick:e,variant:"outline"},(0,E.__)("Close","surerank"))),je=e=>(0,_e.bY)(e?e.length>60?{id:"search_engine_title",title:(0,E.sprintf)((0,E.__)("Search engine title exceeds %1$d characters.","surerank"),M.qt),status:"warning",type:"page"}:{id:"search_engine_title",title:(0,E.sprintf)((0,E.__)("Search engine title is present and under %1$d characters.","surerank"),M.qt),status:"success",type:"page"}:{id:"search_engine_title",title:(0,E.__)("Search engine title is missing on the page.","surerank"),status:"error",type:"page"}),He=e=>(0,_e.bY)(e?e.length>160?{id:"search_engine_description",title:(0,E.sprintf)((0,E.__)("Search engine description exceeds %1$d characters.","surerank"),M.UM),status:"warning",type:"page"}:{id:"search_engine_description",title:(0,E.sprintf)((0,E.__)("Search engine description is present and under %1$d characters.","surerank"),M.UM),status:"success",type:"page"}:{id:"search_engine_description",title:(0,E.__)("Search engine description is missing on the page.","surerank"),status:"warning",type:"page"}),Be=()=>{var e;const t=null!==(e=window?.surerank_globals?.open_graph_tags)&&void 0!==e&&e;return(0,_e.bY)(t?{id:"open_graph_tags",title:(0,E.__)("Open Graph tags are not present on the page.","surerank"),status:"suggestion",type:"page"}:{id:"open_graph_tags",title:(0,E.__)("Open Graph tags are present on the page.","surerank"),status:"success",type:"page"})};var Ve=a(84038),$e=a(45350),Ue=a(3535),Ge=a(80827);const qe=({onClickGetStarted:e,onClickLearnMore:t,heading:a,subheading:n})=>{const[s,o]=(0,l.useState)(!1),i=[{id:1,text:(0,E.__)("Meta Titles & Descriptions","surerank")},{id:2,text:(0,E.__)("Social Titles & Descriptions","surerank")},{id:3,text:(0,E.__)("Site level SEO Checks","surerank")}];return(0,r.createElement)("div",{className:"flex flex-col items-center self-stretch gap-3 px-5 py-8"},(0,r.createElement)($e.mc,{className:"flex flex-col justify-center items-center gap-8 mx-auto max-w-[24.75rem]"},(0,r.createElement)(f.V_,{width:28,height:31}),(0,r.createElement)("div",{className:"flex flex-col items-center self-stretch gap-3"},(0,r.createElement)(A.E,{size:18,weight:600,color:"primary",className:"text-center"},a||(0,E.__)("Let SureRank AI optimize your SEO","surerank")),(0,r.createElement)(A.E,{size:14,weight:400,color:"secondary",className:"text-center self-stretch"},n||(0,E.__)("Our AI-powered assistant helps you fix SEO issues smartly and quickly. No need to dig through settings or guess what's wrong \u2014 we'll do the heavy lifting for you.","surerank"))),(0,r.createElement)("div",{className:"flex flex-row self-stretch flex-wrap justify-center gap-6 py-2"},i.map(e=>(0,r.createElement)("div",{key:e.id,className:"flex flex-col items-center gap-2 max-w-28"},(0,r.createElement)(Ge.A,{width:16,height:16,className:"text-icon-interactive"}),(0,r.createElement)(A.E,{size:14,weight:500,color:"primary",className:"text-center"},e.text)))),(0,r.createElement)("div",{className:"flex flex-col w-full gap-2 p-2"},(0,r.createElement)(_.A,{variant:"primary",onClick:async()=>{s||"function"!==typeof e||(o(!0),await e(),o(!1))},className:"[&>span]:flex [&>span]:items-center [&>span]:justify-center [&>span]:gap-2",icon:s&&(0,r.createElement)(Ue.a,{size:"sm",variant:"secondary"})},(0,E.__)("Let's Get Started","surerank")),(0,r.createElement)(_.A,{variant:"ghost",className:"w-fit mx-auto hover:bg-transparent focus:[box-shadow:none] text-text-tertiary hover:text-text-secondary font-normal",onClick:()=>{"function"===typeof t&&t()}},(0,E.__)("Learn more","surerank")))))};var Ze=a(90232);const Ke=({title:e=(0,E.__)("Here are a few suggestions","surerank"),onBack:t,onClose:a,className:n})=>(0,r.createElement)("div",{className:(0,c.cn)("flex flex-col self-stretch gap-2 px-4 pt-3.5 pb-2",n)},(0,r.createElement)("div",{className:"flex justify-between items-center self-stretch gap-8"},(0,r.createElement)(A.E,{size:16,lineHeight:20,color:"primary",weight:600},e),(0,r.createElement)("div",{className:"flex items-center gap-2"},(0,r.createElement)(_.A,{variant:"outline",size:"xs",onClick:t,className:"px-1 py-1 border border-gray-300 shadow-sm bg-white",icon:(0,r.createElement)(Ze.A,{className:"text-text-primary"}),iconPosition:"left"},(0,r.createElement)("span",null,(0,E.__)("Back","surerank"))),"function"===typeof a&&(0,r.createElement)(_.A,{variant:"ghost",size:"xs",onClick:a,className:"p-1 text-icon-secondary hover:text-icon-primary hover:bg-transparent bg-transparent focus:outline-none",icon:(0,r.createElement)(y.A,null)})))),Ye=({onClickUpgrade:e})=>(0,r.createElement)("div",{className:"bg-background-secondary rounded-lg p-2"},(0,r.createElement)("div",{className:"bg-background-primary rounded-md p-4 flex flex-col items-center gap-3"},(0,r.createElement)(f.BZ,{className:"text-text-primary"}),(0,r.createElement)("div",{className:"text-center"},(0,r.createElement)(A.E,{as:"h3",size:16,weight:600,color:"primary"},(0,E.__)("AI Credits Exhausted","surerank")),(0,r.createElement)(A.E,{color:"secondary",className:"mt-1"},(0,E.__)("You've used all your available AI credits. To keep generating titles, descriptions, and more with AI, please purchase additional credits.","surerank"))),(0,r.createElement)(_.A,{variant:"primary",size:"md",onClick:()=>{if("function"!==typeof e){const e=window?.surerank_globals?.pricing_link;return void(e&&window.open(e,"_blank","noopener"))}e()}},(0,E.__)("Upgrade Now","surerank"))));var We=a(15977);const Je=({message:e,className:t})=>(0,r.createElement)($e.mc,{align:"center",justify:"center",className:(0,c.cn)("p-8 bg-background-primary border border-solid border-border-subtle rounded-lg",t)},(0,r.createElement)(A.E,{size:14,weight:400,color:"secondary"},e||(0,E.__)("No data available","surerank"))),Xe=({item:e,onUseThis:t,globalFixing:a})=>{const[n,s]=(0,l.useState)(!1);let o=(0,E.__)("Use This","surerank");return n&&(o=(0,E.__)("Fixing\u2026","surerank")),(0,r.createElement)("div",{className:"flex flex-row self-stretch gap-1 p-2 bg-white rounded-md shadow-sm"},(0,r.createElement)("div",{className:"flex flex-row items-center gap-1 p-1 flex-1"},(0,r.createElement)("div",{className:"flex flex-row justify-stretch items-stretch gap-2 flex-1"},(0,r.createElement)(A.E,{size:14,weight:500,color:"secondary",className:"flex-1"},e.text))),(0,r.createElement)("div",{className:"flex flex-row items-start gap-2"},(0,r.createElement)(_.A,{variant:"link",size:"xs",tag:"button",className:"mt-2",onClick:()=>(async e=>{if(!n&&!a){s(!0);try{"function"===typeof t&&await t(e)}finally{s(!1)}}})(e.text),disabled:n||a,icon:n&&(0,r.createElement)(Ue.a,{size:"sm"})},o)))},Qe=({onUseThis:e,onRegenerate:t,contents:a=[],generating:n=!1,fixing:s=!1,error:l=null})=>{const o=a&&a?.length>0,i=null!==l,u=()=>{let e=(0,E.__)("Generate","surerank");return!o&&i&&(e=(0,E.__)("Retry","surerank")),n&&(e=(0,E.__)("Generating\u2026","surerank")),o?(0,E.__)("Regenerate","surerank"):e};let d;return d=n?Array.from({length:5}).map((e,t)=>(0,r.createElement)("div",{key:t,className:"flex flex-row self-stretch gap-1 p-2 bg-white rounded-md shadow-sm"},(0,r.createElement)("div",{className:"flex flex-row items-center gap-1 p-1 flex-1"},(0,r.createElement)("div",{className:"flex flex-row justify-stretch items-stretch gap-2 flex-1"},(0,r.createElement)("div",{className:"flex-1 space-y-2"},(0,r.createElement)(C.A,{variant:"rectangular",className:"w-full h-4"}),(0,r.createElement)(C.A,{variant:"rectangular",className:"w-3/4 h-4"})))),(0,r.createElement)("div",{className:"flex flex-row items-center gap-2"},(0,r.createElement)(C.A,{variant:"rectangular",className:"w-16 h-8 rounded"})))):o?a.map(t=>(0,r.createElement)(Xe,{key:t.id,item:t,onUseThis:e,globalFixing:s})):(0,r.createElement)("div",{className:"flex flex-col self-stretch gap-2"},(0,r.createElement)(Je,{message:o?(0,E.__)('No content generated yet. Click "Generate" to create AI-powered content suggestions.',"surerank"):(0,E.sprintf)((0,E.__)("No content generated. Click %s to retry creating AI-powered content suggestions.","surerank"),`"${u()}"`),className:"m-2 text-center"})),(0,r.createElement)("div",{className:"flex flex-col self-stretch gap-3"},(0,r.createElement)(A.E,{size:14,weight:400,color:"primary",className:"self-stretch"},(0,E.__)("Here are the fixes generated by SureRank AI based on your request. Review and apply the ones you'd like to use.","surerank")),(0,r.createElement)("div",{className:"flex flex-col items-end self-stretch gap-2 p-2 bg-background-secondary rounded-lg"},d,(0,r.createElement)("div",{className:"flex flex-row items-center gap-2 p-1"},(0,r.createElement)(_.A,{variant:"ghost",size:"xs",onClick:()=>{n||"function"===typeof t&&t()},disabled:n,icon:(0,r.createElement)(We.A,{className:(0,c.cn)("w-4 h-4",n&&"animate-spin")}),iconPosition:"left",className:"px-1"},u()))))};var et=a(10960);const tt=({error:e,onRetry:t,title:a,fallbackMessage:n,supportText:s,retryText:l})=>{const o=["content_generation_error","internal_server_error"].includes(e?.code),i=window?.surerank_globals?.support_link,c=(0,E.__)("Generation Failed","surerank"),u=(0,E.__)("Oops! Something went wrong while generating content. You can try again, or edit it manually to make sure it's correct.","surerank"),d=(0,E.__)("Click here to contact support.","surerank"),p=(0,E.__)("Retry","surerank");return(0,r.createElement)(et.A,{color:"error",title:a||c,message:e?.message||n||u,footer:(0,r.createElement)("div",{className:"flex flex-col gap-1"},o&&i&&(0,r.createElement)(_.A,{tag:"a",size:"md",href:i,target:"_blank",variant:"link",className:"w-fit [&>span]:p-0 no-underline hover:no-underline ring-0 -mt-2 mb-2"},s||d),(0,r.createElement)(_.A,{onClick:t,tag:"button",variant:"link",className:"w-fit [&>span]:p-0"},l||p))})},at=e=>{const{updateAppSettings:t}=(0,o.useDispatch)(i.E),{status:a=he.IDLE,allGeneratedContents:n={},selectedCheckId:s,selectedFieldKey:c,checkType:u,genError:d,postId:m,onSuccess:g,onError:h,onProgress:f,onUseThis:k,previousScreen:_}=(0,o.useSelect)(e=>{const t=e(i.E).getPageSeoChecks(),a=e(i.E).getAppSettings();return{status:a?.generateContentProcess,allGeneratedContents:a?.generatedContents,selectedCheckId:a?.selectedCheckId||t?.selectedItem,selectedFieldKey:a?.selectedFieldKey,genError:a?.error,postId:t?.postId,checkType:t?.checkType,previousScreen:a?.previousScreen,onSuccess:a?.onSuccess,onError:a?.onError,onProgress:a?.onProgress,onUseThis:a?.onUseThis}},[]),y=c||s,w=n[y]||[],{handleFixContent:v,isFixing:b}=((e={})=>{const{onSuccess:t,onError:a,onProgress:r}=e,{updateAppSettings:n}=(0,o.useDispatch)(i.E),{postId:s,checkType:l,selectedCheckId:c,status:u,currentScreen:d,previousScreen:m}=(0,o.useSelect)(e=>{const t=e(i.E).getPageSeoChecks(),a=e(i.E).getAppSettings();return{postId:t?.postId,checkType:t?.checkType,selectedCheckId:a?.selectedCheckId,status:a?.fixProcess,currentScreen:a?.currentScreen,previousScreen:a?.previousScreen}},[]);return{handleFixContent:async e=>{try{if(u===he.IN_PROGRESS)return;if(""===e?.trim())throw new Error((0,E.__)("Selected content is empty.","surerank"));const a=s||window?.surerank_seo_popup?.post_id||window?.surerank_seo_popup?.term_id;if(!a)throw new Error((0,E.__)("Post or term ID not found.","surerank"));n({fixProcess:he.IN_PROGRESS}),r&&"function"===typeof r&&r({selectedCheckId:c,content:e,postId:a,checkType:l});const o="taxonomy"===l||"1"===window?.surerank_seo_popup?.is_taxonomy,i=await De()({path:"/surerank/v1/page-seo-checks/fix",method:"POST",data:{type:"content-generation",input_key:c,input_value:e,id:parseInt(a),is_taxonomy:o}});if(!i?.success)throw new Error(i?.message||(0,E.__)("Failed to apply content.","surerank"));return t&&"function"===typeof t&&t({response:i,selectedCheckId:c,content:e,postId:a,checkType:l}),"block"!==surerank_seo_popup.editor_type&&p.o.success(i?.message||(0,E.__)("Fixed successfully","surerank"),{description:(0,E.__)("Fix applied successfully. Some fixes may require a page reload to see changes.","surerank")}),n({currentScreen:m,previousScreen:d,fixProcess:he.IDLE,selectedCheckId:null,error:null}),i}catch(o){n({fixProcess:he.ERROR});const t=o?.message||(0,E.__)("An unexpected error occurred while applying content.","surerank");return a&&"function"===typeof a&&a({error:o,selectedCheckId:c,content:e,postId:s||window?.surerank_seo_popup?.post_id||window?.surerank_seo_popup?.term_id,checkType:l}),p.o.error(t),{error:o?.message||(0,E.__)("Unknown error","surerank")}}},isFixing:u===he.IN_PROGRESS}})({onSuccess:g,onError:h,onProgress:f}),C=async()=>{if(a!==he.IN_PROGRESS)try{t({generateContentProcess:he.START});const e=s||c,a=ge.EF[e]?ge.EF[e]:"";if(!a)throw{message:(0,E.__)("No content type selected. Please select an item to generate content for.","surerank"),code:"no_content_type"};t({generateContentProcess:he.IN_PROGRESS});const r=m||window?.surerank_seo_popup?.post_id||window?.surerank_seo_popup?.term_id,l="taxonomy"===u||"1"===window?.surerank_seo_popup?.is_taxonomy,o=await(0,Oe.lX)(a,r,l);if(!o?.success)throw o;const i=o.content.map((e,t)=>({id:Date.now()+t,text:e}));t({generateContentProcess:he.COMPLETED,generatedContents:{...n,[y]:i}})}catch(r){var e;t({generateContentProcess:he.FAILED,error:{message:null!==(e=r?.message)&&void 0!==e?e:(0,E.__)("An unexpected error occurred while generating content.","surerank"),code:r?.code||"unknown_error"}})}},x=()=>{C()},S=async e=>{if(k&&c)return k(c,e),void t({currentScreen:_,previousScreen:"",selectedCheckId:null,selectedFieldKey:null,onUseThis:null,generateContentProcess:he.IDLE,error:null});await v(e)};return(0,l.useEffect)(()=>{a!==he.IDLE||!s&&!c||w.length||C()},[]),a===he.FAILED?"require_pro"===d?.code?(0,r.createElement)(Ye,{onClickUpgrade:()=>{window.open(window?.surerank_globals.pricing_link,"_blank","noopener")}}):(0,r.createElement)(tt,{error:d,onRetry:x,title:(0,E.__)("Generation Failed","surerank"),supportText:(0,E.__)("Click here to contact support.","surerank"),retryText:(0,E.__)("Retry","surerank")}):(0,r.createElement)(Qe,a===he.COMPLETED?{...e,contents:w,onRegenerate:x,onUseThis:S,fixing:b}:{...e,contents:w,onRegenerate:x,onUseThis:S,generating:a===he.IN_PROGRESS||a===he.START,error:a===he.FAILED?d:null,fixing:b})},rt=(0,w.applyFilters)("surerank-pro.seo-popup-screens",{settings:{title:(0,E.__)("Settings","surerank"),component:()=>{const{currentTab:e}=(0,o.useSelect)(e=>e(i.E).getAppSettings(),[]),t=(0,l.useMemo)(()=>{const t=Se[null!==e&&void 0!==e?e:"optimize"];return(0,de.jK)()&&t?.pageBuilderComponent||t?.component},[e]);return(0,r.createElement)(t,null)}},fixItForMe:{title:(0,E.__)("Fix It For Me","surerank"),component:()=>{const{authenticated:e,previousScreen:t,currentScreen:a,previousTab:n,previousMetaTab:s}=(0,o.useSelect)(e=>{const t=e(i.E).getPageSeoChecks(),a=e(i.E).getAppSettings();return{authenticated:t?.authenticated,previousScreen:a?.previousScreen,currentScreen:a?.currentScreen,previousTab:a?.previousTab,previousMetaTab:a?.previousMetaTab}},[]),{updateAppSettings:c,setPageSeoCheck:u}=(0,o.useDispatch)(i.E),{openAuthPopup:d}=((e,t={})=>{const{pollingInterval:a=2e3,maxPollingTime:r=3e5}=t,n=(0,l.useRef)(null),s=(0,l.useRef)(null),o=(0,l.useRef)(null),i=(0,l.useRef)(0),c=(0,l.useRef)(!1);(0,l.useEffect)(()=>()=>{n.current&&clearInterval(n.current)},[]);const u=async()=>{try{if(c.current&&(i.current+=1,i.current>10))return m(),void p.o.error((0,E.__)("Authentication timeout. Please try again.","surerank"));if(Date.now()-o.current>r)return m(),void p.o.error((0,E.__)("Authentication timeout. Please try again.","surerank"));const t=await(0,Oe.xI)();if(!t?.success)return;t?.auth_url||(m(),s.current&&!s.current.closed&&s.current.close(),e&&e(),p.o.success((0,E.__)("Authentication successful!","surerank")))}catch(t){p.o.error((0,E.__)("An error occurred during authentication","surerank"),{description:t?.message||"",autoDismiss:!1})}},d=(e=null)=>{if(m(),i.current=0,c.current=!1,e&&(s.current=e),o.current=Date.now(),n.current=setInterval(u,a),s.current){const e=setInterval(()=>{s.current?.closed&&(c.current=!0,clearInterval(e))},1e3)}},m=()=>{n.current&&(clearInterval(n.current),n.current=null),o.current=null,i.current=0,c.current=!1};return{startPolling:d,stopPolling:m,openAuthPopup:e=>{const t=window.open(e,"surerank_auth","fullscreen=yes,scrollbars=yes,resizable=yes");return!t||t.closed?(p.o.error((0,E.__)("Popup blocked. Redirecting to authentication\u2026","surerank")),window.location.href=e,null):(d(t),t)},isPolling:null!==n.current}})(()=>u("authenticated",!0));let m,g=(0,r.createElement)(at,null);if(!e){const e=()=>window.open(M.Vy,"_blank","noopener"),t=async()=>{try{const e=await(0,Oe.xI)();if(!e?.success)throw new Error(e?.message||(0,E.__)("Authentication failed","surerank"));if(e?.auth_url)return void d(e.auth_url);u("authenticated",!0)}catch(e){p.o.error(e?.message||(0,E.__)("An error occurred during authentication","surerank"))}};m=(0,E.__)("Connect SureRank AI","surerank"),g=(0,r.createElement)(qe,{onClickLearnMore:e,onClickGetStarted:t})}return(0,r.createElement)("div",{className:"p-2 space-y-6"},(0,r.createElement)(Ke,{className:"p-0",title:m,onBack:()=>{c({currentScreen:t,previousScreen:a,currentTab:n||"optimize",currentMetaTab:s||"meta",selectedCheckId:null,selectedFieldKey:null,onUseThis:null,generateContentProcess:he.IDLE,error:null})}}),g)}}});window&&!window?.toast&&(window.toast=p.o);const nt={open:{x:0},closed:{x:"100%"}},st=()=>{const e=(0,o.select)("core/editor"),t=(0,o.select)(i.E);if(e&&"function"===typeof e.getEditedPostContent)return{postContent:e.getEditedPostContent()||"",permalink:e.getPermalink()||surerank_seo_popup?.link,title:e.getEditedPostAttribute("title")||"",description:t.getPostSeoMeta()?.page_description||""};if("undefined"!==typeof window.tinymce&&window.tinymce.get("content")){const e=document.getElementById("title");return{postContent:window.tinymce.get("content").getContent()||"",permalink:surerank_seo_popup?.link,title:e&&e.value||"",description:t.getPostSeoMeta()?.page_description||""}}const a=document.getElementById("content"),r=document.getElementById("title");return{postContent:a&&a.value||"",permalink:surerank_seo_popup?.link,title:r&&r.value||"",description:t.getPostSeoMeta()?.page_description||""}},lt=()=>(Ee(),(()=>{const{setPageSeoCheck:e}=(0,o.useDispatch)(i.E),{metaData:t,variables:a,postDynamicData:r,globalDefaults:n,pageSeoChecks:s,settingsLoaded:c}=(0,o.useSuspenseSelect)(e=>{const t=e(i.E);return t?.getCurrentPostIgnoredList(),{metaData:t?.getPostSeoMeta()||{},variables:t?.getVariables()||{},postDynamicData:t?.getPostDynamicData()||{},globalDefaults:t?.getGlobalDefaults()||{},pageSeoChecks:t?.getPageSeoChecks()||{},settingsLoaded:t?.getMetaboxState()}},[]),{categorizedChecks:u={},initializing:d}=s,[,p]=(0,l.useTransition)(),m=(0,l.useRef)({postContent:"",permalink:""}),g=(0,l.useRef)(t),h=(0,de.jK)(),f=(0,l.useMemo)(()=>F(a),[a]),k=(0,l.useMemo)(()=>(0,O.A)(t.page_title||n.page_title||"",f,r),[t.page_title,n.page_title,f,r]),_=(0,l.useMemo)(()=>(0,O.A)(t.page_description||n.page_description||"",f,r),[t.page_description,n.page_description,f,r]),y=(0,l.useMemo)(()=>(0,O.A)(t.canonical_url||n.canonical_url||"",f,r),[t.canonical_url,n.canonical_url,f,r]),E=(0,l.useCallback)(async(t,r,n,s,l)=>{if("1"===surerank_seo_popup?.is_taxonomy)return e("page",[(0,_e.cd)(t.permalink),je(n),He(s),(0,Ve.aO)(l)]);const o=(i=t.postContent,(new DOMParser).parseFromString(i,"text/html"));var i;const c=await Promise.all([await(0,_e.jU)(o),await(0,_e.aS)(o),(0,_e.SZ)(o),(0,_e.cd)(t.permalink),je(n),He(s),Be(),(0,_e._e)(o),(0,Ve.aO)(l)]);e("page",c),p(async()=>{const t=await(0,Ve.Tq)(o,a?.post?.ID?.value||0,void 0,e),r=[...c];t&&r.push(t),e("page",r)})},[]);(0,l.useLayoutEffect)(()=>{!h&&c&&d&&M.Jj&&(async()=>{const a=st();await E(a,t,k,_,y),m.current=a,d&&e("initializing",!1)})()},[h,d,t,k,_,y,c]),(0,l.useLayoutEffect)(()=>{if(h||!c||d||!M.Jj)return;const e=(0,ke.debounce)(async()=>{const e=st();(0,ke.isEqual)(m.current,e)&&(0,ke.isEqual)(g.current,t)||(m.current=e,g.current=t,await E(e,t,k,_,y))},300),a=(0,o.subscribe)(e);return()=>{a(),e.cancel()}},[h,t,k,_,E,y,d,c]);(0,l.useMemo)(()=>(0,Ce.F)(u),[u])})(),null);let ot=e=>e;"block"===surerank_seo_popup?.editor_type?ot=g:"classic"===surerank_seo_popup?.editor_type&&(ot=h);const it=(0,s.compose)((0,o.withSelect)(e=>{const t=e(i.E);return{initialized:t.getMetaboxState(),appSettings:t.getAppSettings()}}),(0,o.withDispatch)(e=>{const t=e(i.E);return{setMetaDataAndDefaults:e=>t.initMetaDataAndDefaults(e),setInitialized:e=>t.updateMetaboxState(e),updateModalState:e=>t.updateModalState(e),updateAppSettings:e=>t.updateAppSettings(e)}}),ot,l.memo)(e=>{const{setMetaDataAndDefaults:t,initialized:a,setInitialized:n,updateModalState:s,appSettings:g}=e,h=(0,o.useSelect)(e=>e(i.E).getModalState(),[]),f=(0,l.useRef)(!1),k=(0,l.useCallback)(async()=>{if(!a)try{const e=await(0,Oe.lr)();p.o.success(e.message),t({postSeoMeta:e.data,globalDefaults:e.global_default})}catch(e){p.o.error(e.message)}finally{n(!0)}},[a]);(0,l.useEffect)(()=>{f.current||(k(),f.current=!0)},[k]);const _=(0,l.useCallback)(()=>{s(!1)},[s]),y=(0,l.useMemo)(()=>{if(g?.currentScreen)return rt[g?.currentScreen].component},[g?.currentScreen]),E=(0,l.useMemo)(()=>{const e=rt[g?.currentScreen];return e?.header?e.header:Pe},[g?.currentScreen]);return(0,r.createElement)(l.Fragment,null,(0,r.createElement)(l.Suspense,{fallback:null},(0,r.createElement)(lt,null)),(0,r.createElement)(m.Ay,{className:"z-[100000]"}),(0,r.createElement)(u.N,null,h&&(0,r.createElement)(d.P.div,{tabIndex:"0",id:"surerank-seo-popup-modal-container",className:"fixed inset-y-0 right-0 lg:w-slide-over-container md:w-slide-over-container w-full z-[99999] bg-background-primary shadow-2xl p-0 flex flex-col",initial:"closed",animate:"open",exit:"closed",variants:nt,transition:{duration:.3}},(0,r.createElement)(E,{onClose:_}),(0,r.createElement)("div",{className:(0,c.cn)("flex-1 flex flex-col gap-6 overflow-y-auto px-4 pt-4 pb-0","optimize"!==g?.currentTab&&"pb-4")},(0,r.createElement)(y,null)),"optimize"===g?.currentTab&&"settings"===g.currentScreen&&(0,r.createElement)(Re,{onClose:_}))))}),ct=window.wp.editor,ut=window.wp.components;var dt=a(11936);const pt=()=>{const{updateModalState:e}=(0,o.useDispatch)(i.E),[t,a]=(0,l.useState)(null),n=(0,o.useSelect)(e=>{try{return!!e(i.E).getModalState()}catch(t){return!1}},[]),{status:s,initializing:c,counts:u}=Ae(),d=(0,l.useCallback)(()=>e(!0),[e]);return(0,l.useEffect)(()=>{const e=()=>{const e=document.querySelector(".interface-pinned-items");if(e){let t=e.querySelector("#surerank-toolbar-portal");return t?t.parentElement!==e&&(e.firstChild&&e.firstChild!==t?e.insertBefore(t,e.firstChild):e.appendChild(t)):(t=document.createElement("div"),t.id="surerank-toolbar-portal",t.className="surerank-root",e.firstChild?e.insertBefore(t,e.firstChild):e.appendChild(t)),t}const t=document.querySelector([".edit-post-header__settings",".editor-header__actions",".edit-site-header__actions"].join(", "));if(!t)return null;let a=t.querySelector("#surerank-toolbar-portal");if(!a){a=document.createElement("div"),a.id="surerank-toolbar-portal",a.className="surerank-root";const e=t.querySelector([".edit-post-post-preview__button",".editor-preview-dropdown"].join(", "));e?(n=a,(r=e.closest("button, div, span")||e)&&r.parentNode?r.nextSibling?r.parentNode.insertBefore(n,r.nextSibling):r.parentNode.appendChild(n):t.appendChild(n)):t.appendChild(a)}var r,n;return a};let t=e();t&&a(t);const r=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;if(r){const n=new r(()=>{const r=document.getElementById("surerank-toolbar-portal"),n=document.querySelector(".interface-pinned-items");r?n&&r.parentElement!==n&&(n.firstChild&&n.firstChild!==r?n.insertBefore(r,n.firstChild):n.appendChild(r)):(t=e(),t&&a(t))}),s=document.querySelector(".editor-header, .edit-post-header");return n.observe(s,{childList:!0,subtree:!0}),()=>n.disconnect()}const n=window.setInterval(()=>{document.getElementById("surerank-toolbar-portal")||(t=e(),t&&a(t))},1500);return()=>window.clearInterval(n)},[]),t?(0,l.createPortal)((0,r.createElement)("div",{className:"relative"},(0,r.createElement)(ut.Button,{icon:(0,r.createElement)(f.bk,null),label:(0,dt.R)(u),"aria-label":(0,E.__)("Open SureRank Meta Box","surerank"),"aria-haspopup":"dialog",showTooltip:!0,isPressed:n,"aria-pressed":n,type:"button",size:"compact",onClick:d},(0,r.createElement)(Ne,{status:s,errorAndWarnings:u.errorAndWarnings,initializing:c}))),t):null},mt=window.wp.plugins;a(15345),(0,o.select)("core/editor")&&(0,mt.registerPlugin)("surerank-page-level-settings",{render:()=>{const{updateModalState:e}=(0,o.useDispatch)(i.E),t=(0,l.useCallback)(()=>{e(!0)},[e]);return(0,r.createElement)(r.Fragment,null,(0,r.createElement)(ct.PluginMoreMenuItem,{onClick:t,icon:(0,r.createElement)(f.bk,null),"aria-label":(0,E.__)("Open SureRank Meta Box","surerank"),"aria-haspopup":"dialog"},(0,E.__)("SureRank Meta Box","surerank")),(0,r.createElement)(pt,null))}});const gt=()=>{const{updateModalState:e}=(0,o.useDispatch)(i.E),{status:t,initializing:a,counts:n}=Ae();return(0,l.useEffect)(()=>{const e=document.querySelector("#wpadminbar");e&&(e.style.zIndex="10")},[]),(0,r.createElement)("div",{className:"relative inline-flex"},(0,r.createElement)("button",{className:"inline-flex w-auto h-auto p-1 rounded-full border-0 bg-transparent focus:outline-none outline-none cursor-pointer",type:"button",onClick:()=>e(!0)},(0,r.createElement)(f.CX,{className:"size-6"})),(0,r.createElement)(Ne,{className:"z-auto",status:t,errorAndWarnings:n.errorAndWarnings,initializing:a}))};if("classic"===surerank_seo_popup.editor_type){const e=(()=>{const e=document.querySelector(".wrap > h1");if(e){const t=document.createElement("span");return t.id="seo-popup",t.className="surerank-root",e.appendChild(t),t}return null})();e&&(0,n.createRoot)(e).render((0,r.createElement)(gt,null))}document.addEventListener("DOMContentLoaded",function(){let e=document.querySelector("#surerank-root");e||(e=document.body.appendChild(document.createElement("div")),e.id="surerank-root",e.className="surerank-root"),setTimeout(function(){(0,n.createRoot)(e).render((0,r.createElement)(it,null))},1e3)})},37042:(e,t,a)=>{a.d(t,{A:()=>d});var r,n=a(51609),s=a(94879),l=a(88029),o=a(30732),i=a(27723),c=a(9607);const u=null!==(r=window?.surerank_globals?.pro_link)&&void 0!==r?r:"",d=({size:e="xs",tooltipProps:t,title:a=(0,i.__)("Fix SEO Issues with AI","surerank"),description:r=(0,n.createElement)(n.Fragment,null,(0,n.createElement)("span",null,(0,i.__)("Let AI automatically detect and resolve on-page SEO problems, such as missing SEO descriptions, image alt tags, and more.","surerank")),(0,n.createElement)("br",null),(0,n.createElement)("span",{className:"mt-2 block"},(0,i.__)("Coming Soon in SureRank Pro.","surerank"))),link:d=u,linkLabel:p=(0,i.__)("Join the Beta Program","surerank"),iconPosition:m="left",icon:g,buttonLabel:h=(0,i.__)("Fix It for Me","surerank"),className:f,hidden:k=!0,locked:_=!0,onClick:y,...E})=>{const w=(0,n.createElement)(l.A,{className:(0,c.cn)("w-fit",k&&"hidden",f),size:e,icon:g,iconPosition:m,...E,onClick:()=>{"function"!==typeof y||_||y()}},h);return _?(0,n.createElement)(s.$w,{arrow:!0,interactive:!0,placement:"top-end",...t,content:(0,n.createElement)("div",{className:"space-y-1"},(0,n.createElement)(o.E,{size:12,weight:600,color:"inverse"},a),(0,n.createElement)(o.E,{size:12,weight:400,color:"inverse",className:"leading-relaxed"},r),(0,n.createElement)("div",{className:"mt-1.5"},(0,n.createElement)(l.A,{size:"xs",variant:"link",className:"[&>span]:px-0 no-underline hover:no-underline focus:[box-shadow:none] text-link-inverse hover:text-link-inverse-hover",tag:"a",href:d,target:"_blank"},p)))},w):w}},38502:(e,t,a)=>{a.d(t,{A:()=>_});var r=a(51609),n=a(27723),s=a(59612),l=a(66803),o=a(56523),i=a(30732),c=a(9607),u=a(48697),d=a(88029),p=a(99019);const m=({variant:e="outline",size:t="xs",strokeWidth:a=2,icon:n=(0,r.createElement)(u.A,{strokeWidth:a,className:"h-4 w-4"}),onClick:s,className:l="absolute top-2 right-2 flex items-center p-1 h-8 w-8 rounded leading-[0]",disabled:o=!1,tooltip_label:i})=>{const c=(0,r.createElement)(d.A,{variant:e,size:t,className:l,onClick:s,disabled:o},n);return i?(0,r.createElement)(p.m,{placement:"top",offset:10,variant:"dark",title:i,tooltipPortalId:"surerank-root"},c):c};var g=a(86087);const h=e=>{const t=new Date,a=t.toLocaleString("default",{month:"long"}),r=t.getDate();return"twitter"===e?`${a?.slice(0,3)} ${r}`:`${a} ${r}`},f=({className:e,...t})=>(0,r.createElement)("div",{className:(0,c.cn)("w-full h-full bg-background-secondary flex items-center justify-center",e),...t},(0,r.createElement)(s.A,{className:"size-6 m-auto"})),k=({displayName:e="Name",username:t="@username",timeLabel:a="28m",postText:s="Sample Post Title",title:u=(0,n.__)("Modern WordPress SEO Plugin Without the Bloat - SureRank","surerank"),description:d="",imageURL:p="",siteURL:h="surerank.com",onClickRemove:k,hideRemoveButton:_=!0,forMetaBox:y=!1,cardType:E="summary_large_image"})=>{const w=(0,c.jT)(u),v=(0,c.jT)(d),b={id:"x-preview-large",className:"[#x-preview-large&_*]:font-twitter"},C=(0,r.createElement)(o.A,{className:"flex-shrink-0",size:y?"sm":"md",variant:"primary",src:"https://www.gravatar.com/avatar/?d=mp"},"User"),x=(0,r.createElement)("div",{className:"inline-flex items-center gap-1"},(0,r.createElement)(i.E,{as:"p",className:"m-0",size:16,weight:500,color:"secondary"},e),(0,r.createElement)(l.A,{className:"size-5 text-white fill-[#1d9bf0]","aria-label":(0,n.__)("Verified account","surerank")}),(0,r.createElement)(i.E,{as:"p",className:"m-0",size:16,weight:400,color:"secondary"},t," \xb7 ",a));if("summary_large_image"===E){const e=(0,n.sprintf)((0,n.__)("Check out my page: %s","surerank"),(0,g.renderToString)((0,r.createElement)(i.E,{className:"inline text-[#1d9bf0] m-0 hover:underline",as:"p"},h.startsWith("http")?h:`https://${h}`)));return(0,r.createElement)("div",{...b},(0,r.createElement)("div",{className:"p-3 flex items-start gap-3"},C,(0,r.createElement)("div",{className:"flex-1"},x,s?(0,r.createElement)(i.E,{as:"p",className:"mt-0.5 mb-0 line-clamp-2",size:14,color:"secondary"},s):(0,r.createElement)(i.E,{as:"p",color:"secondary",size:14,className:"mt-0.5 mb-0 line-clamp-2",dangerouslySetInnerHTML:{__html:e}}),(0,r.createElement)("div",{className:"relative mt-3 rounded-2xl border border-solid border-border-subtle overflow-hidden"},p?(0,r.createElement)("div",{className:(0,c.cn)("relative w-full h-[16.8125rem]",y&&"h-52")},(0,r.createElement)("img",{src:p,alt:"Shared link preview",className:"w-full h-full object-cover"}),!_&&(0,r.createElement)(m,{onClick:k})):(0,r.createElement)("div",{className:"h-[16.8125rem]"},(0,r.createElement)(f,null)),(0,r.createElement)("div",{className:"inline-block w-fit px-2 rounded absolute bottom-3 left-3 right-3 text-xs text-white bg-black/[0.77]"},(0,r.createElement)(i.E,{as:"p",className:"m-0 line-clamp-1 text-inherit"},w))),(0,r.createElement)(i.E,{as:"p",color:"secondary",size:14,weight:400,className:"mt-2 mb-1"},(0,n.__)("From","surerank")," ",(0,r.createElement)("span",{className:"hover:underline"},h)))))}return(0,r.createElement)("div",{id:b.id,className:(0,c.cn)("p-3",b.className)},(0,r.createElement)("div",{className:"flex gap-3 justify-start items-start"},C,(0,r.createElement)("div",{className:"space-y-4"},x,(0,r.createElement)("div",{className:"grid overflow-hidden min-h-[7.75rem] grid-cols-[7.5rem_1fr] rounded-2xl border border-solid border-border-subtle"},p?(0,r.createElement)("div",{className:"relative w-full h-full inline-flex"},(0,r.createElement)("img",{className:"w-full h-full object-cover m-0 max-h-[7.625rem] border-y-0 border-l-0 border-r border-solid border-border-subtle",src:p,alt:"thumbnail"}),!_&&(0,r.createElement)(m,{onClick:k})):(0,r.createElement)(f,{className:"border-y-0 border-l-0 border-r border-solid border-border-subtle"}),(0,r.createElement)("div",{className:"inline-grid items-center justify-start gap-0.5 px-3 py-5"},(0,r.createElement)("p",{className:"m-0 font-normal text-text-secondary leading-4 text-xs"},h),(0,r.createElement)("div",{className:"w-full overflow-hidden"},(0,r.createElement)("p",{className:"m-0 text-[0.9375rem] font-semibold text-text-primary whitespace-nowrap leading-5"},w)),(0,r.createElement)("p",{className:"m-0 font-normal text-text-secondary line-clamp-3 leading-5 text-sm"},v||""))))))},_=({displayName:e="Name",username:t="@username",type:a="facebook",title:s=(0,n.__)("Sample Post - Testing Site","surerank"),description:l="",imageURL:o="",siteURL:i="surerank.com",twitterLargePreview:u=!1,onClickRemove:d,hideRemoveButton:p=!0,forMetaBox:g=!1})=>{let _=null;const y=(0,c.jT)(l),E=(0,c.jT)(s),w=y||"";switch(a){case"twitter":_=(0,r.createElement)(k,{displayName:e,username:t,timeLabel:h("twitter"),title:E,description:y,imageURL:o,siteURL:i,onClickRemove:d,hideRemoveButton:p,forMetaBox:g,cardType:u?"summary_large_image":"summary"});break;case"facebook":_=(0,r.createElement)(r.Fragment,null,(0,r.createElement)("div",{className:"w-full h-[16.8125rem] overflow-clip"},o?(0,r.createElement)("div",{className:"relative w-full h-full"},(0,r.createElement)("img",{src:o,alt:"Social Post",className:"w-full h-full object-cover"}),!p&&(0,r.createElement)(m,{onClick:d})):(0,r.createElement)(f,null)),(0,r.createElement)("div",{className:"p-3 w-full"},(0,r.createElement)("p",{className:"m-0 text-xs leading-4 font-normal text-text-secondary"},i),(0,r.createElement)("p",{className:"mt-1.5 mb-1 text-base leading-6 font-semibold text-text-primary line-clamp-2"},E),(0,r.createElement)("p",{className:"m-0 text-sm leading-5 font-normal line-clamp-2"},w)));break;default:_=null}return(0,r.createElement)("div",{className:"p-2 rounded-lg bg-background-secondary"},(0,r.createElement)("div",{className:"flex flex-col rounded-md border border-solid border-border-subtle shadow-sm overflow-hidden bg-background-primary"},_))}},47143:e=>{e.exports=window.wp.data},48029:(e,t,a)=>{a.d(t,{Kl:()=>b,Tr:()=>v});var r=a(51609),n=a(88029),s=a(87835),l=a(71087),o=a(60443),i=a(9607),c=a(37042),u=a(27723),d=a(37946),p=a(79804),m=a(418),g=a(97213),h=a(48697),f=a(94879),k=a(86087),_=a(64894),y=a(99418);const E=new Map,w=e=>{if(!e||"object"!==typeof e)return null;const{status:t,details:a}=e;let n="";a&&(n+=a),404===t?n+=" "+(0,u.__)("(The page or resource was not found)","surerank"):"http_request_failed"===t?n+=" "+(0,u.__)("(Unable to connect to the URL)","surerank"):403===t?n+=" "+(0,u.__)("(Access to this resource is forbidden)","surerank"):500===t?n+=" "+(0,u.__)("(Server error occurred)","surerank"):"number"===typeof t&&t>=400&&(n+=` ${(0,u.__)("(HTTP error","surerank")} ${t})`);const s=y.A.sanitize(n);return(0,r.createElement)("div",{className:"space-y-1"},(0,r.createElement)("p",{className:"m-0"},(0,r.createElement)("b",null,(0,u.__)("Why is this link broken?","surerank"))),(0,r.createElement)("p",{className:"m-0",dangerouslySetInnerHTML:{__html:s}}),t&&(0,r.createElement)("p",{className:"text-xs m-0"},(0,r.createElement)("b",null,(0,u.__)("Status:","surerank"))," ",t))},v=({variant:e,label:t,title:a,data:_,showImages:y,onIgnore:E,showRestoreButton:v=!1,onRestore:x,showIgnoreButton:S=!1,onFix:N,fixItButtonProps:A={}})=>{const{data:L,listStyleClassName:T}=C(_);return(0,r.createElement)(k.Fragment,null,(0,r.createElement)("div",{className:"relative flex flex-col gap-3 p-3 bg-background-primary rounded-lg shadow-sm border-0.5 border-solid border-border-subtle"},S&&(0,r.createElement)(n.A,{variant:"outline",type:"button",onClick:async()=>{try{await E(),o.o.success((0,u.__)("Check ignored successfully","surerank"))}catch(e){o.o.error((0,u.__)("Failed to ignore check","surerank"))}},"aria-label":(0,u.__)("Ignore this check","surerank"),className:"absolute -top-2 -right-2 rounded-full *:focus:outline-none [&>svg]:size-3 focus:ring-0 focus:[box-shadow:none] p-0.5",icon:(0,r.createElement)(h.A,{className:"text-text-primary"}),size:"xs"}),(0,r.createElement)("div",{className:"w-full flex items-start gap-2"},v?(0,r.createElement)(s.A,{label:t,size:"sm",type:"pill",variant:e,disableHover:!0,className:(0,i.cn)(v?"text-badge-color-disabled":"")}):(0,r.createElement)(k.Fragment,null,(0,r.createElement)("div",null,(0,r.createElement)("p",{className:"sr-only"},t),(0,r.createElement)("span",{className:"p-1 flex [&>svg]:size-4"},(e=>{const t="size-4";switch(e){case"blue":return(0,r.createElement)(g.A,{className:(0,i.cn)(t,"text-badge-color-sky")});case"red":return(0,r.createElement)(d.A,{className:(0,i.cn)(t,"text-badge-color-red")});case"yellow":return(0,r.createElement)(m.A,{className:(0,i.cn)(t,"text-badge-color-yellow")});case"green":return(0,r.createElement)(p.A,{className:(0,i.cn)(t,"text-badge-color-green")});default:return null}})(e)))),(0,r.createElement)("div",{className:"flex items-center mt-px"},(0,r.createElement)(l.A,{size:"xs",className:"space-x-1 text-sm text-text-secondary inline"},a,(0,r.createElement)(f.$w,{content:(0,u.__)("Click here to discover more details about this check.","surerank"),arrow:!0},(0,r.createElement)("a",{href:surerank_globals?.help_link,className:"shrink-0 align-sub ml-2 focus:outline-none focus:ring-0",target:"_blank",rel:"noopener noreferrer"},(0,r.createElement)(g.A,{className:"size-4 text-icon-secondary hidden"}))))),v&&(0,r.createElement)(n.A,{variant:"outline",type:"button",onClick:async()=>{try{await x(),o.o.success((0,u.__)("Check restored successfully","surerank"))}catch(e){o.o.error((0,u.__)("Failed to restore check","surerank"))}},"aria-label":(0,u.__)("Restore this check","surerank"),size:"xs",className:"ml-auto min-w-fit shrink-0"},(0,u.__)("Restore","surerank"))),y&&(0,r.createElement)(b,{images:L}),!y&&L&&L.length>0&&(0,r.createElement)("ul",{className:(0,i.cn)("list-disc list-inside ml-3 mr-0 mt-0 mb-0.5",T)},L.map((e,t)=>(0,r.createElement)(k.Fragment,{key:`${e}-${t}`},(e=>{const t={tag:"a",variant:"link",className:"font-medium focus:outline-none focus:[box-shadow:none] [&>span]:px-0 break-all",target:"_blank",rel:"noopener noreferrer"};return(0,i.mv)(e)?(0,r.createElement)("li",{className:"m-0 text-sm"},(0,r.createElement)(n.A,{...t,href:e},e)):"object"===typeof e&&e?.url?(0,r.createElement)("li",{className:"my-1 p-2 flex items-center justify-between gap-1.5 text-sm border border-dashed border-border-subtle rounded-md bg-background-secondary"},(0,r.createElement)(n.A,{...t,href:e.url},e.url),(0,r.createElement)(f.Nr,{content:w(e),interactive:!0,placement:"top-start",offset:{alignmentAxis:-10,mainAxis:8}})):(0,r.createElement)("li",{className:"m-0 text-sm font-medium text-text-secondary list-none"},e)})(e)))),A?.show&&(0,r.createElement)(c.A,{variant:"link",size:"xs",className:"mr-auto min-w-fit shrink-0 underline",tooltipProps:{className:"z-999999"},hidden:!1,onClick:N,...(({show:e,...t})=>t)(A)})))},b=({images:e})=>e&&e.length?(0,r.createElement)("div",{className:"grid grid-cols-3 gap-2 mb-0.5"},e.map((e,t)=>(0,i.mv)(e)?(0,r.createElement)(n.A,{variant:"link",className:"inline-flex focus:outline-none focus:[box-shadow:none] p-0 relative",onClick:t=>(async(e,t)=>{if(e?.preventDefault(),E.has(t))window.open(`/wp-admin/upload.php?item=${E.get(t)}`,"_blank","noopener noreferrer");else try{const e=await(0,_.ih)(t);if(!e)throw new Error("No image found");const a=e?.id;E.set(t,a),window.open(`/wp-admin/upload.php?item=${a}`,"_blank","noopener noreferrer")}catch(a){window.open("/wp-admin/upload.php","_blank","noopener noreferrer")}})(t,e),key:`${e}-${t}`},(0,r.createElement)("div",{className:"absolute inset-0 bg-black bg-opacity-20 pointer-events-none"}),(0,r.createElement)("div",{className:"relative w-full h-36 rounded overflow-hidden"},(0,r.createElement)("img",{src:e,alt:e,className:"w-full h-36 object-cover rounded"}))):null)):null,C=e=>{if(!Array.isArray(e)||!e.length)return{data:[]};const t=[];let a="";return e.forEach(e=>{"string"===typeof e?t.push(e):e&&"object"===typeof e&&Array.isArray(e.list)?(t.push(...e.list),e.list?.some(e=>e?.url&&e?.status)&&(a="list-none mx-0")):e&&"object"===typeof e&&!Array.isArray(e?.list)&&"object"===typeof e?.list?t.push(...Object.values(e.list)):(t.push(e),a="list-none mx-0")}),{data:t,listStyleClassName:a}}},51609:e=>{e.exports=window.React},52619:e=>{e.exports=window.wp.hooks},54486:(e,t,a)=>{a.d(t,{F:()=>r});const r=(e={})=>{const t=e.badChecks||[],a=e.fairChecks||[],r=e.suggestionChecks||[];let n="success";return t.length>0?n="error":a.length>0?n="warning":r.length>0&&(n="suggestion"),{status:n,counts:{errorAndWarnings:t.length+a.length,success:(e.passedChecks||[]).length,error:t.length,warning:a.length,suggestion:r.length}}}},54822:(e,t,a)=>{a.d(t,{A:()=>p});var r=a(51609),n=a(86087),s=a(27723),l=a(3535),o=a(30732),i=a(46615),c=a(48029),u=a(68402),d=a(1671);const p=(0,n.memo)(({pageSeoChecks:e={},onIgnore:t,onRestore:a,onFix:p,type:m="page"})=>{const{badChecks:g=[],fairChecks:h=[],passedChecks:f=[],ignoredChecks:k=[],suggestionChecks:_=[],isCheckingLinks:y=!1,linkCheckProgress:E={current:0,total:0}}=e,w=(0,u.ZD)(d.E),v=(0,n.useMemo)(()=>g.length>0||h.length>0||_.length>0,[g.length,h.length,_.length]),b=e=>()=>{e&&"function"===typeof t&&t(e)},C=e=>()=>{e&&((0,u.M6)(e)&&"function"===typeof p?p(e):(0,u.J9)(e))},x=e=>{if(w)return{show:!1};const t=(0,u.M6)(e);return{show:!0,locked:t?u.IG.includes(e):!u.X2,...!t&&{buttonLabel:(0,s.__)("Help Me Fix","surerank")}}};return(0,r.createElement)(i.P.div,{className:"space-y-3 p-1",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.3}},v&&(0,r.createElement)("div",{className:"space-y-3"},"page"===m&&y&&(0,r.createElement)("div",{className:"flex items-center gap-2 p-2 bg-white rounded-lg shadow-sm border-0.5 border-solid border-border-subtle"},(0,r.createElement)(l.a,{size:"sm"}),(0,r.createElement)(o.E,{size:14,weight:500,color:"tertiary"},(0,s.sprintf)((0,s.__)("%1$d out of %2$d checks are done.","surerank"),E.current,E.total))),g.map(e=>(0,r.createElement)(c.Tr,{key:e.id,variant:"red",label:(0,s.__)("Critical","surerank"),title:e.title,data:e?.data,showImages:e?.showImages,onIgnore:b(e.id),showIgnoreButton:!0,onFix:C(e.id),fixItButtonProps:x(e.id)})),h.map(e=>(0,r.createElement)(c.Tr,{key:e.id,variant:"yellow",label:(0,s.__)("Warning","surerank"),title:e.title,data:e?.data,showImages:e?.showImages,onIgnore:b(e.id),onFix:C(e.id),showIgnoreButton:!0,fixItButtonProps:x(e.id)})),_.map(e=>(0,r.createElement)(c.Tr,{key:e.id,variant:"blue",label:(0,s.__)("Suggestion","surerank"),title:e.title,data:e?.data,showImages:e?.showImages,onIgnore:b(e.id),showIgnoreButton:!0,onFix:C(e.id),fixItButtonProps:x(e.id)}))),k.length>0&&(0,r.createElement)("div",{className:"space-y-3"},k.map(e=>(0,r.createElement)(c.Tr,{key:e.id,variant:"neutral",label:(0,s.__)("Ignore","surerank"),title:e.title,showRestoreButton:!0,onRestore:()=>a(e.id)}))),f.length>0&&(0,r.createElement)("div",{className:"space-y-3"},f.map(e=>(0,r.createElement)(c.Tr,{key:e.id,variant:"green",label:(0,s.__)("Passed","surerank"),title:e.title,onIgnore:()=>t(e.id)}))))})},60249:(e,t,a)=>{a.d(t,{a:()=>r});const r=e=>{const t=wp.media(e);return e.button&&e.button.text&&((e,t)=>{const a=()=>{const a=[".media-button-select",".media-button-insert",".button-primary"];for(const r of a){const a=e.$(r);if(a.length&&a.is(":visible")){a.text(t);break}}};e.on("ready",a),e.on("selection:toggle",a),e.on("content:render",a)})(t,e.button.text),t}},61456:(e,t,a)=>{a.d(t,{A:()=>o});var r=a(51609),n=a(3213),s=a(9607),l=a(71149);const o=({deviceType:e="desktop",faviconURL:t="",title:a="",description:o="",permalink:i="",siteTitle:c=""})=>{const u=(0,s.jT)(a),d=(0,s.jT)(o);return(0,r.createElement)("div",{className:"p-2 rounded-lg bg-background-secondary"},(0,r.createElement)("div",{className:"rounded-md border border-solid border-border-subtle bg-background-primary p-4 space-y-1.5 shadow-sm"},(0,r.createElement)("div",{className:"grid grid-cols-[1.75rem_1fr] items-center gap-3"},t?(0,r.createElement)("div",{className:"relative w-7 h-7"},(0,r.createElement)("img",{className:"w-full h-full object-cover m-0",src:t,alt:"favicon"})):(0,r.createElement)(l.V_,{className:"size-7"}),(0,r.createElement)("div",{className:"flex flex-col gap-0.5"},(0,r.createElement)("span",{className:"text-text-primary font-semibold"},c),(0,r.createElement)("div",{className:"flex items-center justify-start gap-2"},(0,r.createElement)("span",{className:"text-text-secondary line-clamp-1 break-all"},i),(0,r.createElement)(n.A,{className:"size-3.5 text-icon-secondary"})))),(0,r.createElement)("div",{className:"space-y-1"},(0,r.createElement)("p",{className:"text-xl leading-8 font-normal text-text-seo-title m-0 line-clamp-1 break-all"},u),(0,r.createElement)("p",{className:(0,s.cn)("text-sm leading-5 font-medium text-text-secondary m-0 break-words","mobile"===e&&"text-2xl leading-9.5 line-clamp-2")},d))))}},62220:(e,t,a)=>{a.d(t,{CS:()=>u,DN:()=>p,EJ:()=>i,Li:()=>o,MF:()=>c,W9:()=>r,mY:()=>d,qh:()=>l,uX:()=>s,wX:()=>n});const r="/surerank/v1/admin/global-settings",n="/surerank/v1/admin/site-settings",s="/surerank/v1/admin/editor",l="/surerank/v1/onboarding",o="/surerank/v1/admin/post-content",i="/surerank/v1/term/settings",c="/surerank/v1/post/settings",u="/surerank/v1/admin/posts",d="/surerank/v1/plugins/installed",p="/surerank/v1/robots-txt"},64506:(e,t,a)=>{a.d(t,{A:()=>r});const r=(e,t,a={})=>{if(!e||!t)return e;const r=(e=>{const t=e.match(/%([^%\s]+)%/g);return t?t.map(e=>e.replace(/%/g,"")):[]})(e),n=[];return r.forEach(e=>{n[e]||(n[e]=["title","excerpt","content"].includes(e)&&a?.[e]?a[e]:t[e]||"")}),e.replace(/%([^%\s]+)%/g,(e,t)=>n[t]||"")}},64894:(e,t,a)=>{a.d(t,{Af:()=>d,Lx:()=>m,ih:()=>u,lX:()=>g,lr:()=>c,xI:()=>p});var r=a(1455),n=a.n(r),s=a(93832),l=a(62220),o=a(9607);const i="/surerank/v1",c=async()=>{const e=new URLSearchParams;(0,o.P$)("term.php")?e.append("term_id",surerank_seo_popup?.term_id):e.append("post_id",surerank_seo_popup?.post_id),e.append("post_type",surerank_seo_popup?.post_type),e.append("is_taxonomy",surerank_seo_popup?.is_taxonomy);try{const t=await n()({path:`${(0,o.P$)("term.php")?l.EJ:l.MF}?${e.toString()}`,method:"GET"});if(!t.success)throw new Error(t.message);return t}catch(t){throw new Error(t.message)}},u=async e=>{if(!e)return null;const t=new URL(e).pathname.split("/").pop().split("?")[0],a=t.replace(/-\d+x\d+\.(jpg|jpeg|png|gif|webp)$/i,"").replace(/-scaled\.(jpg|jpeg|png|gif|webp)$/i,"").replace(/\.(webp)$/i,"").replace(/(-optimized|-compressed)/i,""),r=[{search:t},{search:a},{search:t.replace(/\.[^/.]+$/,"")},{search:a.replace(/\.[^/.]+$/,"")}];for(const o of r)try{const e=await n()({path:(0,s.addQueryArgs)("/wp/v2/media",{search:o.search,media_type:"image",slug:o.search,per_page:20}),method:"GET"});if(e&&e.length>0)return e.find(e=>{const r=e.source_url||e.url,n=r.split("/").pop().split("?")[0];return n===t||r.includes(a)||n.includes(a)})||e[0]}catch(l){continue}try{const e=a.split("-")[0],t=await n()({path:(0,s.addQueryArgs)("/wp/v2/media",{search:e,media_type:"image",per_page:50}),method:"GET"});if(t&&t.length>0)return t[0]}catch(l){}return null},d=()=>n()({path:`${i}/migration/migrated-data`,method:"GET"}),p=()=>n()({path:`${i}/ai/auth`}),m=e=>n()({path:`${i}/ai/auth`,method:"POST",data:{accessKey:e}}),g=(e,t,a)=>{const r={type:e};return t&&(r.post_id=t),a&&(r.is_taxonomy=a),n()({path:`${i}/generate-content`,method:"POST",data:r})}},66087:e=>{e.exports=window.lodash},68402:(e,t,a)=>{a.d(t,{EF:()=>c,X2:()=>g,BB:()=>u,IG:()=>i,J9:()=>p,M6:()=>m,ZD:()=>h});var r=a(52619);const n={page_title:"content_generation",page_description:"content_generation",title:"content_generation",meta_description:"content_generation",url_length:"content_generation",site_tag_line:"content_generation",other_seo_plugins:"other_seo_plugins",indexing:"indexing",sitemaps:"sitemaps",index_status:"index_status"};var s=a(47143);const l={page_title:"page_title",page_description:"page_description",title:"home_page_title",meta_description:"home_page_description",site_tag_line:"site_tag_line",url_length:"page_url_slug"},o=(0,r.applyFilters)("surerank-pro.page-seo-checks-content-generation-mapping",{search_engine_title:"page_title",search_engine_description:"page_description",url_length:"page_url_slug"}),i=(0,r.applyFilters)("surerank-pro.pro-page-seo-checks-content-generation",["url_length","search_engine_title","search_engine_description"]),c=Object.freeze({...l,...o,facebook_title:"social_title",facebook_description:"social_description",twitter_title:"social_title",twitter_description:"social_description"}),u={search_engine_title:"page_title",search_engine_description:"page_description"},d=Object.freeze(Array.from(new Set([...Object.keys(l),...Object.keys(o)]))),p=e=>{const t=(0,r.applyFilters)("surerank-pro.help-me-fix-redirect",null);"function"===typeof t&&t(e)},m=e=>d.includes(null!==e&&void 0!==e?e:"")||Object.keys(n).includes(null!==e&&void 0!==e?e:""),g=(0,r.applyFilters)("surerank-pro.help-me-fix-active",!1),h=e=>{const t=(0,s.select)(e).getPageSeoChecks();return t?.hideFixHelpButtons||!1}},68458:(e,t,a)=>{a.d(t,{A:()=>m});var r=a(51609),n=a(86087),s=a(29767),l=a(9655);const o=class extends n.Component{constructor(e){super(e),this.state={hasError:!1,error:null}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}render(){return this.state.hasError?(0,r.createElement)("div",{className:"text-base font-medium text-text-error p-4 border border-solid border-border-error rounded-lg"},"Error: ",this.state.error.message||"Unknown error"):this.props.children}};var i=a(9607),c=a(64894);const u=new Map,d=()=>(0,r.createElement)(s.A,{className:"h-14 w-full"}),p=({imageId:e,imageUrl:t,onRemove:a})=>{let n=(({imageId:e="",imageUrl:t=""})=>{if(u.has(e||t))return u.get(e||t);const a=(0,i.sI)(new Promise(a=>{if(!e&&!t)return void a({});const r=e=>{if(!e)return void a({});const t=(e=>wp.media.attachment(e).fetch())(e);t&&"function"===typeof t.then?t.then(()=>{a(t)}).catch(()=>{a({})}):a(t)};t?(0,c.ih)(t).then(e=>{e?r(e.id):a({})}).catch(()=>{a({})}):e?r(e):a({})}));return u.set(e||t,a),a})({imageId:e,imageUrl:t}).read()||{};return"attributes"in n&&(n=n.attributes),(0,r.createElement)("div",{className:"[&>div]:m-0"},(0,r.createElement)(l.d,{file:{name:n.filename||"",url:n.url||"",type:n.type||"",size:n.filesizeInBytes||""},onRemove:a,size:"md"}))},m=(0,n.memo)(({imageId:e,imageUrl:t,onRemove:a})=>((0,n.useEffect)(()=>{const a=()=>{(e||t)&&u.delete(e||t)};return window.addEventListener("beforeunload",a),()=>{window.removeEventListener("beforeunload",a)}},[e,t]),e||t?(0,r.createElement)(o,null,(0,r.createElement)(n.Suspense,{fallback:(0,r.createElement)(d,null)},(0,r.createElement)(p,{imageId:e,imageUrl:t,onRemove:a}))):null))},71149:(e,t,a)=>{a.d(t,{B0:()=>g,BZ:()=>f,CX:()=>l,Ew:()=>i,GP:()=>m,IY:()=>p,OZ:()=>c,V_:()=>s,Wn:()=>k,Zy:()=>h,bk:()=>o,jf:()=>_,uw:()=>n,v1:()=>u,y0:()=>d});var r=a(51609);const n=e=>(0,r.createElement)("svg",{width:"538",height:"84",viewBox:"0 0 538 84",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},(0,r.createElement)("path",{d:"M74.7021 31.1187C74.7021 13.9953 60.8924 0.118378 43.8521 0.118378H0.670166V83.7997H7.9266C20.5234 83.7997 30.9189 74.347 32.4782 62.1087H32.4986L32.5496 49.1228H31.459C22.735 49.1228 15.6417 42.1383 15.3971 33.4332H15.3869V29.2957H19.5145C25.2829 29.2957 30.3889 32.1633 33.5076 36.5465C36.4835 25.9468 46.1859 18.1737 57.6821 18.1737V22.3112V27.8722C57.6821 39.5575 48.9275 49.0409 37.3192 49.1126V62.1087C38.8276 74.3777 49.2434 83.8816 61.8708 83.8816H74.7225V59.0056H57.3356C67.6291 53.9772 74.7225 43.3774 74.7225 31.1084L74.7021 31.1187Z",fill:"#4338CA"}),(0,r.createElement)("path",{d:"M219.188 21.9015V12.4591H210.261V71.5512H219.188V29.7259C220.513 27.2987 222.786 25.1275 226.017 23.2124C229.248 21.2563 232.234 20.2834 234.996 20.2834C235.892 20.2834 237.034 20.3654 238.44 20.519V11.0765C234.71 11.0765 231.194 12.0699 227.882 14.067C224.58 16.0231 221.685 18.6243 219.188 21.8913V21.9015Z",fill:"#1B1933"}),(0,r.createElement)("path",{d:"M284.874 15.2037C280.634 12.3772 275.681 10.9639 270.004 10.9639C264.327 10.9639 259.721 12.3567 255.369 15.1423C251.017 17.887 247.613 21.6353 245.167 26.377C242.752 31.0777 241.549 36.2598 241.549 41.913C241.549 51.1096 244.311 58.6062 249.835 64.3823C255.359 70.1583 262.432 73.0464 271.064 73.0464C280.237 73.0464 287.88 69.974 293.985 63.8497L289.725 57.8791C287.391 60.3063 284.65 62.1804 281.5 63.4913C278.392 64.8022 275.141 65.4678 271.757 65.4678C265.764 65.4678 260.903 63.5118 257.173 59.6098C253.484 55.7079 251.455 50.8433 251.109 45.0365H297.715V42.7015C297.715 36.7309 296.625 31.3645 294.454 26.633C292.314 21.8503 289.124 18.0508 284.884 15.2242L284.874 15.2037ZM250.976 38.1544C251.089 35.8399 251.578 33.5766 252.434 31.344C253.29 29.0704 254.452 26.9812 255.93 25.0661C257.448 23.11 259.415 21.5431 261.82 20.3449C264.226 19.1466 266.916 18.5526 269.872 18.5526C273.021 18.5526 275.844 19.1671 278.331 20.4063C280.817 21.6045 282.805 23.1714 284.283 25.1275C285.76 27.0836 286.871 29.1728 287.605 31.4054C288.38 33.638 288.798 35.8911 288.828 38.1544H250.976Z",fill:"#1B1933"}),(0,r.createElement)("path",{d:"M132.336 41.913C130.277 40.6738 127.963 39.6394 125.395 38.8098C122.868 37.9701 120.32 37.2737 117.751 36.7206C115.224 36.1266 112.91 35.5019 110.811 34.867C108.752 34.191 107.06 33.2693 105.735 32.1223C104.41 30.9241 103.748 29.4698 103.748 27.7595C103.748 25.0866 104.91 22.8847 107.244 21.1232C109.578 19.331 112.666 18.4297 116.518 18.4297C120.371 18.4297 123.499 19.1262 126.496 20.519C129.523 21.8708 131.938 23.663 133.732 25.8956L137.87 19.5665C132.427 13.8314 125.313 10.9639 116.518 10.9639C109.863 10.9639 104.635 12.5922 100.823 15.8592C97.0114 19.0852 95.1055 23.1305 95.1055 27.9848C95.1055 30.9343 95.768 33.4844 97.0929 35.6351C98.4178 37.7448 100.13 39.3834 102.229 40.5304C104.329 41.6876 106.642 42.6606 109.17 43.4594C111.738 44.2582 114.286 44.9546 116.814 45.5486C119.341 46.1426 121.655 46.8083 123.754 47.5149C125.854 48.2318 127.566 49.2457 128.891 50.5668C130.216 51.8777 130.878 53.4958 130.878 55.4109C130.878 58.4423 129.655 60.89 127.199 62.7641C124.794 64.6383 121.43 65.5703 117.109 65.5703C113.338 65.5703 109.741 64.7509 106.316 63.1226C102.892 61.4942 100.15 59.4767 98.0917 57.0905L93.5972 63.7268C99.4268 69.9433 107.183 73.0464 116.865 73.0464C124.019 73.0464 129.563 71.377 133.487 68.0282C137.452 64.6383 139.439 60.3575 139.439 55.1856C139.439 52.0825 138.777 49.3891 137.452 47.1155C136.127 44.8419 134.415 43.1112 132.315 41.913H132.336Z",fill:"#1B1933"}),(0,r.createElement)("path",{d:"M188.155 55.8923C186.402 58.4014 183.976 60.5111 180.868 62.2214C177.76 63.9317 174.529 64.7919 171.186 64.7919C166.946 64.7919 163.716 63.7985 161.504 61.8015C159.292 59.7737 158.182 56.2815 158.182 51.3452V12.4591H149.254V54.1615C149.254 66.748 155.379 73.0464 167.629 73.0464C171.675 73.0464 175.507 72.1144 179.125 70.2403C182.743 68.3661 185.76 66.0414 188.165 63.2455V71.5512H197.144V12.4591H188.165V55.8923H188.155Z",fill:"#1B1933"}),(0,r.createElement)("path",{d:"M340.917 48.6312C344.332 46.9209 347.002 44.5552 348.948 41.534C350.946 38.4617 351.955 34.9694 351.955 31.0675C351.955 27.1656 351.017 23.6426 349.132 20.6931C347.246 17.6821 344.627 15.3164 341.274 13.5959C337.921 11.8856 334.069 11.0253 329.717 11.0253H306.775V73.1078H318.863V51.1096H328.127L340.744 73.1078H354.421L340.122 48.9897C340.387 48.877 340.652 48.7644 340.917 48.6312ZM338.094 35.6863C337.269 37.0484 336.127 38.1135 334.649 38.8815C333.233 39.6496 331.623 40.0388 329.798 40.0388H318.852V22.1269H329.177C332.183 22.1269 334.619 22.9564 336.504 24.6052C338.451 26.2643 339.419 28.415 339.419 31.0777C339.419 32.788 338.981 34.3344 338.094 35.6863Z",fill:"#1B1933"}),(0,r.createElement)("path",{d:"M394.607 11.0356H382.52L358.162 73.1181H370.962L376.17 59.4562H401.772L406.98 73.1181H419.78L395.422 11.0356H394.627H394.607ZM380.247 48.7234L388.961 25.8547L397.675 48.7234H380.247Z",fill:"#1B1933"}),(0,r.createElement)("path",{d:"M467.701 52.7175L437.524 11.0356H424.906V73.1078H436.994V30.6271L467.701 73.1078H479.707V11.0356H467.701V52.7175Z",fill:"#1B1933"}),(0,r.createElement)("path",{d:"M510.302 39.0352L536.362 11.0356H520.738L497.878 35.6146V11.0356H485.964V73.1078H497.878V52.3898L502.434 47.4944L522.409 73.1078H537.33L510.302 39.0352Z",fill:"#1B1933"})),s=e=>(0,r.createElement)("svg",{width:"128",height:"128",viewBox:"0 0 128 128",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},(0,r.createElement)("rect",{width:"128",height:"128",fill:"white"}),(0,r.createElement)("path",{d:"M73.4731 0C99.6321 6.3594e-05 120.838 21.2062 120.838 47.3652C120.838 66.1146 109.944 82.3181 94.1401 89.9941H120.838V128H101.114C81.7276 128 65.7331 113.485 63.4018 94.7305H63.4008L63.4125 74.8838C81.2408 74.7673 94.685 60.2785 94.685 42.4229V33.9307H94.6879V27.6074C77.0272 27.6075 62.1389 39.4779 57.5649 55.6748C52.7868 48.9672 44.9453 44.5928 36.0825 44.5928H29.7495V50.915H29.7719C30.1453 64.2164 41.0453 74.8848 54.437 74.8848H56.1166L56.0356 94.7305H56.0073C53.6177 113.422 37.6508 127.868 18.31 127.868H7.16156V0H73.4731Z",fill:"#4338CA"})),l=e=>(0,r.createElement)("svg",{width:"128",height:"128",viewBox:"0 0 128 128",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},(0,r.createElement)("path",{d:"M73.4731 0C99.6321 6.3594e-05 120.838 21.2062 120.838 47.3652C120.838 66.1146 109.944 82.3181 94.1401 89.9941H120.838V128H101.114C81.7276 128 65.7331 113.485 63.4018 94.7305H63.4008L63.4125 74.8838C81.2408 74.7673 94.685 60.2785 94.685 42.4229V33.9307H94.6879V27.6074C77.0272 27.6075 62.1389 39.4779 57.5649 55.6748C52.7868 48.9672 44.9453 44.5928 36.0825 44.5928H29.7495V50.915H29.7719C30.1453 64.2164 41.0453 74.8848 54.437 74.8848H56.1166L56.0356 94.7305H56.0073C53.6177 113.422 37.6508 127.868 18.31 127.868H7.16156V0H73.4731Z",fill:"currentColor"})),o=e=>(0,r.createElement)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},(0,r.createElement)("path",{d:"M13.5537 1.5C17.8453 1.5 21.3251 4.97895 21.3252 9.27051C21.3252 12.347 19.5368 15.0056 16.9434 16.2646H21.3252V22.5H18.0889C14.9086 22.5 12.2861 20.1186 11.9033 17.042H11.9014L11.9033 13.7852C14.8283 13.7661 17.0342 11.3894 17.0342 8.45996V6.0293C14.137 6.02947 11.6948 7.97682 10.9443 10.6338C10.1605 9.53345 8.87383 8.8165 7.41992 8.81641H6.38086V9.85352H6.38379C6.44515 12.0356 8.23375 13.786 10.4307 13.7861H10.7061L10.6934 17.042H10.6865C10.2943 20.1082 7.67678 22.4785 4.50391 22.4785H2.6748V1.5H13.5537Z",fill:"currentColor"})),i=e=>(0,r.createElement)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},(0,r.createElement)("path",{d:"M23.25 0H0.75C0.335787 0 0 0.335787 0 0.75V23.25C0 23.6642 0.335787 24 0.75 24H23.25C23.6642 24 24 23.6642 24 23.25V0.75C24 0.335787 23.6642 0 23.25 0Z",fill:"#0D7EE8"}),(0,r.createElement)("path",{d:"M6.40292 11.6635C6.61165 11.8145 6.90801 11.7649 7.04455 11.5618C7.19552 11.3531 7.14591 11.0567 6.94285 10.9202L4.93281 9.48016C4.86137 9.42507 4.8676 9.35611 4.87071 9.32164C4.87386 9.28718 4.90015 9.22703 4.98662 9.19317L18.3609 5.78333C18.4386 5.76953 18.4844 5.80148 18.5157 5.83906C18.547 5.87667 18.5784 5.91424 18.5433 5.99446L13.476 18.8162C13.4409 18.8964 13.3776 18.9045 13.3488 18.9158C13.3143 18.9127 13.2454 18.9065 13.2028 18.8401L11.6711 16.0326C11.6228 15.9518 11.5833 15.8509 11.535 15.7701C10.9355 14.4093 10.7842 13.4051 11.9093 12.416L14.806 9.73531C15.0027 9.55853 15.0221 9.26839 14.8509 9.08611C14.6742 8.88942 14.384 8.87007 14.2017 9.04118L11.1593 11.6635C9.62635 13.0119 9.88161 14.6891 10.8516 16.4865L12.3833 19.294C12.5789 19.6661 12.9769 19.8759 13.4023 19.8589C13.5145 19.8482 13.6354 19.8175 13.7363 19.778C14.0101 19.6707 14.2244 19.4538 14.3471 19.1731L19.4144 6.35138C19.5666 5.97597 19.495 5.53861 19.2242 5.22916C18.9534 4.91967 18.5405 4.79884 18.1432 4.88794L4.7545 8.30341C4.34849 8.41257 4.04151 8.73226 3.95519 9.14836C3.86882 9.56446 4.04691 9.97673 4.39289 10.2235L6.40292 11.6635Z",fill:"white"}),(0,r.createElement)("path",{d:"M5.76973 15.5256C5.80738 15.5108 5.85264 15.4786 5.88538 15.4513L7.90981 13.6745C8.08107 13.5206 8.09791 13.268 7.94892 13.1093C7.79502 12.9381 7.54246 12.9212 7.38376 13.0702L5.35929 14.847C5.18806 15.0009 5.17123 15.2535 5.32018 15.4122C5.43425 15.5557 5.60664 15.5894 5.76973 15.5256Z",fill:"white"}),(0,r.createElement)("path",{d:"M5.51088 18.3676C5.54857 18.353 5.59394 18.321 5.62672 18.2938L9.0673 15.2807C9.23898 15.1273 9.25653 14.8748 9.10799 14.7156C8.95458 14.544 8.70205 14.5264 8.54294 14.6749L5.10235 17.688C4.93068 17.8414 4.91313 18.0939 5.06167 18.253C5.17045 18.3843 5.36017 18.4262 5.51088 18.3676Z",fill:"white"})),c=e=>(0,r.createElement)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},(0,r.createElement)("path",{d:"M20 0H0V20H20V0Z",fill:"#D54407"}),(0,r.createElement)("path",{d:"M5.71094 4.28125H14.2824V7.13841H7.13952L5.71094 8.56697V7.13841V4.28125Z",fill:"white"}),(0,r.createElement)("path",{d:"M5.71094 8.57031H12.8538V11.4274H7.13952L5.71094 12.856V11.4274V8.57031Z",fill:"white"}),(0,r.createElement)("path",{d:"M5.71094 12.8516H9.99664V15.7087H5.71094V12.8516Z",fill:"white"})),u=e=>(0,r.createElement)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},(0,r.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10 20C15.5229 20 20 15.5228 20 10C20 4.47715 15.5229 0 10 0C4.47716 0 0 4.47715 0 10C0 15.5228 4.47716 20 10 20ZM9.87902 4.43553C9.03231 6.22172 8.18559 8.00991 7.33888 9.79805C6.49206 11.5865 5.64519 13.3749 4.79838 15.1613H6.97578C7.6613 13.7783 8.34678 12.3932 9.03225 11.0081C9.71773 9.62302 10.4032 8.23794 11.0887 6.85487L9.87902 4.43553ZM11.0887 11.0483C11.4374 10.3225 11.7862 9.59679 12.137 8.87103C12.649 9.91933 13.1591 10.9677 13.6691 12.016C14.1793 13.0644 14.6894 14.1129 15.2015 15.1613H12.8628C12.7298 14.8509 12.5946 14.5424 12.4596 14.2339C12.3245 13.9255 12.1894 13.617 12.0563 13.3065H10.0402H9.99989L10.0402 13.2258C10.3911 12.5 10.7399 11.7742 11.0887 11.0483Z",fill:"url(#paint0_linear_10691_20999)"}),(0,r.createElement)("defs",null,(0,r.createElement)("linearGradient",{id:"paint0_linear_10691_20999",x1:"20",y1:"-5.96046e-07",x2:"-1.78814e-06",y2:"20",gradientUnits:"userSpaceOnUse"},(0,r.createElement)("stop",{stopColor:"#B147E1"}),(0,r.createElement)("stop",{offset:"1",stopColor:"#5236DD"})))),d=e=>(0,r.createElement)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},(0,r.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10 20C15.5229 20 20 15.5229 20 10C20 4.47714 15.5229 0 10 0C4.47714 0 0 4.47714 0 10C0 15.5229 4.47714 20 10 20ZM13.0751 12.93C13.6533 12.5645 14 11.9529 14 11.2985C14 10.389 13.336 9.59814 12.3943 9.38589L9.57257 8.68549C9.30657 8.62554 9.24283 8.29757 9.46911 8.15323L11.6675 6.75106C12.6907 6.09837 12.9568 4.79034 12.2617 3.82949C12.1748 3.70937 12.0007 3.67814 11.8728 3.75974L6.90669 7.10954C6.33954 7.47129 6 8.07331 6 8.71709C6 9.61566 6.65603 10.397 7.58654 10.6067L10.4542 11.3175C10.7208 11.3776 10.784 11.7067 10.5566 11.8504L8.34209 13.2504C7.31594 13.8991 7.04411 15.2061 7.73494 16.1696C7.82131 16.2901 7.99529 16.322 8.12357 16.2409L13.0751 12.93Z",fill:"#5733FF"})),p=e=>(0,r.createElement)("svg",{width:"52",height:"52",viewBox:"0 0 52 52",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},(0,r.createElement)("g",{filter:"url(#filter0_d_17130_33424)"},(0,r.createElement)("g",{clipPath:"url(#clip0_17130_33424)"},(0,r.createElement)("rect",{x:"2",y:"2",width:"48",height:"48",rx:"12.9231",fill:"#D2F059"}),(0,r.createElement)("g",{filter:"url(#filter1_dddd_17130_33424)"},(0,r.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M25.9963 35.6777C31.3412 35.6777 35.6733 31.3451 35.6733 26.0005C35.6733 20.6559 31.3412 16.3232 25.9963 16.3232C20.6514 16.3232 16.3193 20.6559 16.3193 26.0005C16.3193 31.3451 20.6514 35.6777 25.9963 35.6777ZM25.9963 43.078C34.1601 43.078 40.986 37.3493 42.6734 29.6924H47.2264V22.3078L42.6732 22.3078C40.9855 14.6513 34.1598 8.92297 25.9963 8.92297C17.8328 8.92297 11.0071 14.6513 9.31944 22.3078L4.76562 22.3078V29.6924H9.31928C11.0067 37.3493 17.8325 43.078 25.9963 43.078Z",fill:"url(#paint0_linear_17130_33424)"})))),(0,r.createElement)("defs",null,(0,r.createElement)("filter",{id:"filter0_d_17130_33424",x:"0.615385",y:"0.615385",width:"50.7692",height:"50.7692",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},(0,r.createElement)("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),(0,r.createElement)("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),(0,r.createElement)("feMorphology",{radius:"1.38462",operator:"dilate",in:"SourceAlpha",result:"effect1_dropShadow_17130_33424"}),(0,r.createElement)("feOffset",null),(0,r.createElement)("feComposite",{in2:"hardAlpha",operator:"out"}),(0,r.createElement)("feColorMatrix",{type:"matrix",values:"0 0 0 0 0.777287 0 0 0 0 0.9125 0 0 0 0 0.231927 0 0 0 1 0"}),(0,r.createElement)("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow_17130_33424"}),(0,r.createElement)("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow_17130_33424",result:"shape"})),(0,r.createElement)("filter",{id:"filter1_dddd_17130_33424",x:"-3.1163",y:"6.29567",width:"58.2245",height:"49.9188",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},(0,r.createElement)("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),(0,r.createElement)("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),(0,r.createElement)("feOffset",{dy:"5.25461"}),(0,r.createElement)("feGaussianBlur",{stdDeviation:"3.94096"}),(0,r.createElement)("feComposite",{in2:"hardAlpha",operator:"out"}),(0,r.createElement)("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.06 0"}),(0,r.createElement)("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow_17130_33424"}),(0,r.createElement)("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),(0,r.createElement)("feOffset",{dx:"-1.18229",dy:"3.94096"}),(0,r.createElement)("feGaussianBlur",{stdDeviation:"2.29889"}),(0,r.createElement)("feComposite",{in2:"hardAlpha",operator:"out"}),(0,r.createElement)("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.04 0"}),(0,r.createElement)("feBlend",{mode:"normal",in2:"effect1_dropShadow_17130_33424",result:"effect2_dropShadow_17130_33424"}),(0,r.createElement)("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),(0,r.createElement)("feOffset",{dy:"1.31365"}),(0,r.createElement)("feGaussianBlur",{stdDeviation:"1.31365"}),(0,r.createElement)("feComposite",{in2:"hardAlpha",operator:"out"}),(0,r.createElement)("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.03 0"}),(0,r.createElement)("feBlend",{mode:"normal",in2:"effect2_dropShadow_17130_33424",result:"effect3_dropShadow_17130_33424"}),(0,r.createElement)("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),(0,r.createElement)("feOffset",{dy:"1.31365"}),(0,r.createElement)("feGaussianBlur",{stdDeviation:"0.656827"}),(0,r.createElement)("feComposite",{in2:"hardAlpha",operator:"out"}),(0,r.createElement)("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.08 0"}),(0,r.createElement)("feBlend",{mode:"normal",in2:"effect3_dropShadow_17130_33424",result:"effect4_dropShadow_17130_33424"}),(0,r.createElement)("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect4_dropShadow_17130_33424",result:"shape"})),(0,r.createElement)("linearGradient",{id:"paint0_linear_17130_33424",x1:"25.9961",y1:"43.0779",x2:"25.9961",y2:"8.92297",gradientUnits:"userSpaceOnUse"},(0,r.createElement)("stop",{stopColor:"#072F50",stopOpacity:"0.95"}),(0,r.createElement)("stop",{offset:"1",stopColor:"#172A39",stopOpacity:"0.75"})),(0,r.createElement)("clipPath",{id:"clip0_17130_33424"},(0,r.createElement)("rect",{x:"2",y:"2",width:"48",height:"48",rx:"12.9231",fill:"white"})))),m=e=>(0,r.createElement)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},(0,r.createElement)("path",{d:"M12.0002 0C5.37167 0 0 5.37381 0 11.9991C0 18.6267 5.37167 24 12.0002 24C18.6279 24 24 18.6267 24 11.9991C24 5.37241 18.6269 0 12.0002 0ZM11.7686 14.1946C11.6219 14.7039 11.403 15.154 11.102 15.5402C10.809 15.9218 10.426 16.2254 9.96699 16.4447C9.5038 16.6625 8.95904 16.7716 8.32145 16.7716C7.66183 16.7716 7.10253 16.6541 6.63606 16.4218C6.17147 16.1942 5.79642 15.8835 5.50013 15.4945C5.21368 15.1083 4.9985 14.6592 4.86488 14.147C4.72752 13.6316 4.66189 13.0966 4.66189 12.5355V8.18455H6.56715V12.5355C6.56715 12.8662 6.59809 13.1796 6.65857 13.473C6.72092 13.7729 6.81796 14.0341 6.96142 14.2673C7.10253 14.4987 7.27787 14.6839 7.50337 14.8187C7.7209 14.9544 7.99328 15.023 8.32098 15.023C8.64868 15.023 8.91919 14.9544 9.14469 14.814C9.37019 14.6741 9.55584 14.4889 9.68945 14.2594C9.83056 14.0276 9.92995 13.7599 9.98902 13.4567C10.0462 13.1591 10.0767 12.8545 10.0767 12.5369V8.18875H11.9819V12.5369H11.9829C11.9824 13.1325 11.9102 13.6824 11.7686 14.1946ZM19.3376 16.7726H13.5665V14.9941H19.3376V16.7726ZM19.3376 13.3685H13.5665V11.59H19.3376V13.3685ZM19.3376 9.96587H13.5665V8.18735H19.3376V9.96587Z",fill:"url(#paint0_linear_17897_4967)"}),(0,r.createElement)("defs",null,(0,r.createElement)("linearGradient",{id:"paint0_linear_17897_4967",x1:"0",y1:"12",x2:"24.0002",y2:"12",gradientUnits:"userSpaceOnUse"},(0,r.createElement)("stop",{stopColor:"#681DDD"}),(0,r.createElement)("stop",{offset:"1",stopColor:"#3A1B95"})))),g=e=>(0,r.createElement)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},(0,r.createElement)("path",{d:"M12.2149 1.26929H14.4639L9.55054 6.88495L15.3307 14.5266H10.8049L7.26009 9.89198L3.20403 14.5266H0.953684L6.20902 8.52002L0.664062 1.26929H5.3048L8.50899 5.50551L12.2149 1.26929ZM11.4256 13.1805H12.6718L4.62766 2.54471H3.29037L11.4256 13.1805Z",fill:"#111827"})),h=e=>(0,r.createElement)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},(0,r.createElement)("path",{d:"M13.1667 10C13.1667 11.7489 11.7489 13.1667 10 13.1667C8.25113 13.1667 6.83337 11.7489 6.83337 10C6.83337 8.25113 8.25113 6.83337 10 6.83337C11.7489 6.83337 13.1667 8.25113 13.1667 10Z",fill:"#FFFFFF"})),f=e=>(0,r.createElement)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},(0,r.createElement)("path",{d:"M9.93548 15.5002C9.8462 15.1542 9.66581 14.8384 9.41309 14.5856C9.16037 14.3329 8.84455 14.1525 8.49848 14.0632L2.36348 12.4812C2.25881 12.4515 2.16668 12.3885 2.10109 12.3017C2.03549 12.2149 2 12.1091 2 12.0002C2 11.8914 2.03549 11.7856 2.10109 11.6988C2.16668 11.612 2.25881 11.549 2.36348 11.5192L8.49848 9.93625C8.84442 9.84706 9.16017 9.66682 9.41288 9.41429C9.66559 9.16175 9.84604 8.84614 9.93548 8.50025L11.5175 2.36525C11.5469 2.26017 11.6099 2.16759 11.6968 2.10164C11.7837 2.0357 11.8899 2 11.999 2C12.1081 2 12.2142 2.0357 12.3012 2.10164C12.3881 2.16759 12.4511 2.26017 12.4805 2.36525L14.0615 8.50025C14.1508 8.84632 14.3311 9.16215 14.5839 9.41487C14.8366 9.66759 15.1524 9.84797 15.4985 9.93725L21.6335 11.5182C21.739 11.5473 21.832 11.6103 21.8983 11.6973C21.9646 11.7844 22.0005 11.8908 22.0005 12.0002C22.0005 12.1097 21.9646 12.2161 21.8983 12.3032C21.832 12.3902 21.739 12.4531 21.6335 12.4822L15.4985 14.0632C15.1524 14.1525 14.8366 14.3329 14.5839 14.5856C14.3311 14.8384 14.1508 15.1542 14.0615 15.5002L12.4795 21.6353C12.4501 21.7403 12.3871 21.8329 12.3002 21.8989C12.2132 21.9648 12.1071 22.0005 11.998 22.0005C11.8889 22.0005 11.7827 21.9648 11.6958 21.8989C11.6089 21.8329 11.5459 21.7403 11.5165 21.6353L9.93548 15.5002Z",stroke:"#111827",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"}),(0,r.createElement)("path",{d:"M20 3V7",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"}),(0,r.createElement)("path",{d:"M22 5H18",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"}),(0,r.createElement)("path",{d:"M4 17V19",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"}),(0,r.createElement)("path",{d:"M5 18H3",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})),k=e=>(0,r.createElement)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},(0,r.createElement)("path",{d:"M6.64847 3.71638L7.04997 4.83138C7.49597 6.06888 8.47047 7.04338 9.70797 7.48938L10.823 7.89087C10.9235 7.92737 10.9235 8.06988 10.823 8.10588L9.70797 8.50737C8.47047 8.95337 7.49597 9.92787 7.04997 11.1654L6.64847 12.2804C6.61197 12.3809 6.46947 12.3809 6.43347 12.2804L6.03197 11.1654C5.58597 9.92787 4.61147 8.95337 3.37397 8.50737L2.25897 8.10588C2.15847 8.06938 2.15847 7.92687 2.25897 7.89087L3.37397 7.48938C4.61147 7.04338 5.58597 6.06888 6.03197 4.83138L6.43347 3.71638C6.46947 3.61537 6.61197 3.61537 6.64847 3.71638Z",fill:"currentColor"}),(0,r.createElement)("path",{d:"M11.6675 1.03863L11.871 1.60313C12.097 2.22963 12.5905 2.72312 13.217 2.94912L13.7815 3.15262C13.8325 3.17112 13.8325 3.24312 13.7815 3.26162L13.217 3.46512C12.5905 3.69112 12.097 4.18462 11.871 4.81112L11.6675 5.37563C11.649 5.42663 11.577 5.42663 11.5585 5.37563L11.355 4.81112C11.129 4.18462 10.6355 3.69112 10.009 3.46512L9.4445 3.26162C9.3935 3.24312 9.3935 3.17112 9.4445 3.15262L10.009 2.94912C10.6355 2.72312 11.129 2.22963 11.355 1.60313L11.5585 1.03863C11.577 0.987125 11.6495 0.987125 11.6675 1.03863Z",fill:"currentColor"}),(0,r.createElement)("path",{d:"M11.6675 10.6242L11.871 11.1887C12.097 11.8152 12.5905 12.3087 13.217 12.5347L13.7815 12.7382C13.8325 12.7567 13.8325 12.8287 13.7815 12.8472L13.217 13.0507C12.5905 13.2767 12.097 13.7702 11.871 14.3967L11.6675 14.9612C11.649 15.0122 11.577 15.0122 11.5585 14.9612L11.355 14.3967C11.129 13.7702 10.6355 13.2767 10.009 13.0507L9.4445 12.8472C9.3935 12.8287 9.3935 12.7567 9.4445 12.7382L10.009 12.5347C10.6355 12.3087 11.129 11.8152 11.355 11.1887L11.5585 10.6242C11.577 10.5732 11.6495 10.5732 11.6675 10.6242Z",fill:"currentColor"})),_=e=>(0,r.createElement)("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},(0,r.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0.91255 5.99999C0.91255 3.44174 2.9291 0.902258 6.06843 0.902258C8.60378 0.902258 9.85689 2.75767 10.3909 3.74438H8.80609C8.55414 3.74438 8.34982 3.94635 8.34982 4.1955C8.34982 4.44465 8.55414 4.64663 8.80609 4.64663H11.5437C11.7957 4.64663 12 4.44465 12 4.1955V1.48874C12 1.23959 11.7957 1.03761 11.5437 1.03761C11.2918 1.03761 11.0875 1.23959 11.0875 1.48874V3.12469C10.4446 2.00416 8.95748 0 6.06843 0C2.36092 0 0 3.00937 0 5.99999C0 8.99062 2.36092 12 6.06843 12C7.84228 12 9.31912 11.306 10.3707 10.2482C10.9337 9.68175 11.3734 9.01264 11.6731 8.29237C11.769 8.06199 11.6579 7.79834 11.4249 7.70352C11.1918 7.60869 10.9252 7.71861 10.8293 7.94901C10.5731 8.56467 10.1978 9.13489 9.71982 9.6157C8.83301 10.5079 7.58788 11.0977 6.06843 11.0977C2.9291 11.0977 0.91255 8.55826 0.91255 5.99999Z",fill:"currentColor"}))},74801:(e,t,a)=>{a.d(t,{OV:()=>g,ep:()=>f,jK:()=>k,jp:()=>h,sv:()=>_});var r=a(51609),n=a(1455),s=a.n(n),l=a(27723),o=a(88029),i=a(60443),c=a(9607),u=a(1671),d=a(84038),p=a(14060),m=a(76016);const g=async(e,t,a,r,n,o)=>{const p=r(u.E).getVariables()?.post?.ID?.value||0;e(!0);try{const e=await s()({path:`/surerank/v1/checks/page?post_id=${p}&_t=${Date.now()}`,method:"GET"}),r=(0,c.mT)(e?.checks),n=e?.checks?.all_links||[];t(e=>{const t=new Set(n),a=new Set;return e.brokenLinks.forEach(e=>{t.has(e)&&a.add(e)}),{isChecking:!1,checkedLinks:new Set,brokenLinks:a,allLinks:n}});const o=[...r].filter(e=>"broken_links"!==e.id);m.Tv.forEach(e=>{a(e,o.filter(t=>t.type===e))}),0===n.length?(a("isCheckingLinks",!1),a("linkCheckProgress",{current:0,total:0})):(a("isCheckingLinks",!0),a("linkCheckProgress",{current:0,total:n.length}),await(async(e,t,a,r,n,s,o)=>{const i=a.length,c=[];for(const l of e){let e=!1;try{(await(0,d.Q7)({postId:t,userAgent:window.navigator.userAgent,url:l,allLinks:a})).success||(e=!0)}catch{e=!0}r(t=>{const a=new Set(t.checkedLinks),r=new Set(t.brokenLinks);return a.add(l),e&&(r.add(l),c.push(l)),n("linkCheckProgress",{current:a.size,total:i}),{...t,checkedLinks:a,brokenLinks:r}})}r(e=>{const t=[...o].filter(e=>"broken_links"!==e.id);return c.length>0&&t.push({id:"broken_links",title:(0,l.__)("One or more broken links found on the page.","surerank"),status:"error",type:"page",data:[(0,l.__)("These broken links were found on the page:","surerank"),{list:[...c]}]}),m.Tv.forEach(e=>{n(e,t.filter(t=>t.type===e))}),n("isCheckingLinks",!1),n("linkCheckProgress",{current:i,total:i}),{...e,isChecking:!1}})})(n,p,n,t,a,0,o))}catch(g){i.o.error(g.message),t({isChecking:!1,checkedLinks:new Set,brokenLinks:new Set,allLinks:[]}),a("isCheckingLinks",!1),a("linkCheckProgress",{current:0,total:0})}finally{e(!1)}},h=()=>"undefined"!==typeof window&&"undefined"!==typeof window.elementor&&window.elementor.hasOwnProperty("elements"),f=()=>!!surerank_globals?.is_bricks,k=()=>f()||h(),_=({isRefreshing:e,isChecking:t,onClick:a})=>(0,r.createElement)(o.A,{variant:"outline",size:"xs",onClick:a,disabled:e||t,icon:(0,r.createElement)(p.A,{className:(0,c.cn)("size-4",(e||t)&&"animate-spin")})},(0,l.__)(e||t?"Refreshing":"Refresh","surerank"))},75795:e=>{e.exports=window.ReactDOM},76016:(e,t,a)=>{a.d(t,{$K:()=>f,Et:()=>w,Jj:()=>b,KT:()=>C,Op:()=>g,Rw:()=>x,Tv:()=>N,UM:()=>_,Vy:()=>A,X:()=>E,dc:()=>S,de:()=>k,qt:()=>y,vr:()=>h,x8:()=>v});var r,n,s,l,o,i,c,u,d,p=a(51609),m=a(27723);const g=null!==(r=window?.surerank_globals?.input_variable_suggestions)&&void 0!==r?r:null,h=[{id:"post_no_index",value:"no",label:(0,m.__)("No index","surerank"),description:(0,m.__)("Prevents search engines from listing your page in search results.","surerank")},{id:"post_no_follow",value:"no",label:(0,m.__)("No follow","surerank"),description:(0,m.__)("Tells search engines not to follow any links on your page.","surerank")},{id:"post_no_archive",value:"no",label:(0,m.__)("No archive","surerank"),description:(0,m.__)("Blocks search engines from storing a cached version of your page.","surerank")}],f=()=>(0,m.__)("This content will be set as the meta description tag and may appear in search results. Keep it short and clearly explain what the page is about.","surerank"),k=null!==(n=window?.surerank_globals?.wp_dashboard_url)&&void 0!==n?n:"",_=null!==(s=window?.surerank_globals?.description_length)&&void 0!==s?s:160,y=null!==(l=window?.surerank_globals?.title_length)&&void 0!==l?l:60,E=null!==(o=window?.surerank_globals?.url_length)&&void 0!==o?o:90,w=()=>{var e;return(0,p.createElement)(p.Fragment,null,(0,m.__)("View a preview of how your page may appear in search engine results. This preview is for guidance only and might not exactly match how search engines display your content.","surerank"),(0,p.createElement)("div",{className:"mt-2"},(0,p.createElement)("strong",null,(0,m.__)("Site Icon: ","surerank")),(0,p.createElement)("span",null,(0,m.__)("The site icon (favicon) appears in browser tabs, bookmarks, and mobile devices. To update it, go to General Settings \u2192 Site Icon and upload a new image under Site Identity.","surerank")," ",(0,p.createElement)("a",{href:null!==(e=window?.surerank_globals?.wp_general_settings_url)&&void 0!==e?e:"",target:"_blank",rel:"noopener noreferrer",className:"block mt-2 no-underline hover:no-underline focus:[box-shadow:none] text-link-inverse hover:text-link-inverse-hover"},(0,m.__)("Change Here","surerank")))))},v=500,b=null!==(i=window?.surerank_globals?.enable_page_level_seo)&&void 0!==i&&i,C=null!==(c=window?.surerank_globals?.enable_google_console)&&void 0!==c&&c,x=null!==(u=window?.surerank_globals?.enable_schemas)&&void 0!==u&&u,S=null!==(d=window?.surerank_globals?.enable_migration)&&void 0!==d&&d,N=["page","keyword"],A="https://surerank.com/docs-category/page-seo-analysis/"},84038:(e,t,a)=>{a.d(t,{Q7:()=>d,Tq:()=>c,aO:()=>u});var r=a(27723),n=a(18947),s=a(1455),l=a.n(s);const o=new Map,i=e=>{if(!e?.length)return[];const t=[];for(const a of e){const e=o.get(a);e?.broken&&t.push({url:a,...e})}return t},c=async(e,t,a=window.navigator.userAgent,s)=>{if(!e||!t)return;const l=(e=>{if(!e)return[];const t=Array.from(e.querySelectorAll("a[href]")).map(e=>{const t=e.getAttribute("href");if(!t)return null;const a=t.trim();if((e=>{if(!e)return!0;const t=e.trim();if(""===t)return!0;if(t.startsWith("#"))return!0;try{const e=(new URL(t,surerank_globals.site_url).protocol||"").replace(":","").toLowerCase();return!("http"===e||"https"===e)}catch(a){return t.includes(":")}})(a))return null;if(!a.startsWith("http")){const e=(a.startsWith("/")?"":"/")+a;return`${surerank_globals.site_url}${e}`}return a}).filter(Boolean);return[...new Set(t)]})(e);if(!l.length)return;const c=await(async({links:e,postId:t,userAgent:a,onProgress:n})=>{if((e=>{if(!e?.length)return o.clear();Array.from(o.keys()).forEach(t=>{e.includes(t)||o.delete(t)})})(e),!e.length)return[];const s=e.filter(e=>!o.has(e)),l=i(e);if(0===s.length)return l;const c=e.length;let u=e.length-s.length;"function"===typeof n&&(n("isCheckingLinks",!0),n("linkCheckProgress",{current:u,total:c}));for(const i of s){try{const r=await d({postId:t,userAgent:a,url:i,allLinks:e}),{success:n,...s}=r;o.set(i,{broken:!n,...s})}catch(g){var p,m;o.set(i,{broken:!0,status:null!==(p=null!==(m=g?.data?.status)&&void 0!==m?m:g?.code)&&void 0!==p?p:"error",details:g.message,message:(0,r.__)("Failed to check link","surerank")})}u++,"function"===typeof n&&n("linkCheckProgress",{current:u,total:c}),u<c&&await new Promise(e=>setTimeout(e,100))}return n("isCheckingLinks",!1),i(e)})({links:l,postId:t,userAgent:a,onProgress:s});return(0,n.bY)(c.length?{id:"broken_links",title:(0,r.__)("One or more broken links found on the page.","surerank"),status:"error",data:c,type:"page"}:{id:"broken_links",title:(0,r.__)("No broken links found on the page.","surerank"),status:"success",description:[],type:"page"})},u=e=>(0,n.bY)(e?{id:"canonical_url",title:(0,r.__)("Canonical tag is present on the page.","surerank"),status:"success",type:"page"}:{id:"canonical_url",title:(0,r.__)("Canonical tag is not present on the page.","surerank"),status:"warning",type:"page"}),d=async({postId:e,userAgent:t,url:a,allLinks:r})=>await l()({path:"/surerank/v1/checks/broken-link",method:"POST",data:{post_id:e,user_agent:t,url:a,urls:r}})},86087:e=>{e.exports=window.wp.element},87096:(e,t,a)=>{a.d(t,{A:()=>_,j:()=>k});var r=a(51609),n=a(86087),s=a(88029),l=a(60443),o=a(8723),i=a(45773),c=a(27723),u=a(62220),d=a(27165),p=a(47143),m=a(1455),g=a.n(m),h=a(71149);const f=({onClick:e,onSuccess:t,buttonTextInitial:a=(0,c.__)("Save","surerank"),icon:u,disabled:d,...p})=>{const[m,g]=(0,n.useState)(a),[h,f]=(0,n.useState)(!1),k=(0,n.useRef)(!0);return(0,r.createElement)(s.A,{onClick:async()=>{if(!h&&!d&&k.current){k.current=!1,f(!0),g((0,c.__)("Saving..","surerank"));try{const r=await e();if(!r.success)throw new Error(r.message);return g((0,c.__)("Saved","surerank")),t&&"function"===typeof t?await t(r):l.o.success((0,c.__)("Settings saved successfully.","surerank")),new Promise(e=>{setTimeout(()=>{g(a),k.current=!0,e(r)},1e3)})}catch(r){l.o.error(r.message),g(a),k.current=!0}finally{f(!1)}}},icon:h?(0,r.createElement)(o.A,{className:"animate-spin"}):m===(0,c.__)("Saved","surerank")?(0,r.createElement)(i.A,null):u||null,...p},m)},k=({onSuccess:e})=>{const{unsavedSettings:t}=(0,p.useSelect)(e=>{const{getUnsavedSettings:t}=e(d.E);return{unsavedSettings:t()||{}}},[]),{resetUnsavedSettings:a}=(0,p.useDispatch)(d.E),n=Object.keys(t||{}).length>0;return(0,r.createElement)(f,{onClick:async()=>{const e={data:t},r=await g()({path:u.W9,method:"POST",data:e});return r.success&&a(),r},onSuccess:e,className:n?"":"opacity-60 bg-background-brand cursor-not-allowed pointer-events-none",icon:n?(0,r.createElement)(h.Zy,null):null},(0,c.__)("Save","surerank"))},_=f},93832:e=>{e.exports=window.wp.url},94879:(e,t,a)=>{a.d(t,{$w:()=>c,ID:()=>i,Nr:()=>u,m_:()=>o});var r=a(51609),n=a(9607),s=a(99019),l=a(97213);const o=e=>e.content||e.title?(0,r.createElement)(s.m,{...e,tooltipPortalId:"surerank-root",boundary:document?.querySelector("#surerank-root")||"clippingAncestors"}):e.children,i=({content:e,...t})=>(0,r.createElement)(o,{content:e,placement:"top",arrow:!0,className:(0,n.cn)("max-w-95 z-[99999]",t?.className),...t},(0,r.createElement)(l.A,{className:"size-4 text-icon-secondary"})),c=e=>e.content||e.title?(0,r.createElement)(s.m,{...e,className:(0,n.cn)("z-[99999] max-w-95",e.className),tooltipPortalId:"surerank-root",boundary:document?.querySelector("#surerank-seo-popup-modal-container")||"clippingAncestors"}):e.children,u=({content:e,className:t,...a})=>(0,r.createElement)(c,{className:(0,n.cn)("z-[99999] max-w-95",t),content:e,placement:"top",arrow:!0,...a},(0,r.createElement)(l.A,{className:"shrink-0 size-4 !text-icon-secondary"}))},98583:(e,t,a)=>{a.d(t,{lk:()=>o,lz:()=>l,sP:()=>i});var r=a(51609),n=a(13739),s=a(27723);const l=(0,r.createElement)(n.A,{content:(0,s.__)("This schema does not have any configurable fields","surerank"),className:"shadow-none",variant:"info"}),o=(e=16)=>"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){const a=Math.floor(Math.random()*e);return("x"===t?a:a%4+8).toString(16)}),i=e=>{const t=surerank_globals?.schema_type_data||{};return t[e]&&Array.isArray(t[e])&&t[e].length>0}}},e=>{e.O(0,[6091,4795,7167,862,5988,9743,4912,4865,5608,6115,1085,359,6018,2691,8426,9254,2584,418,5555,6770,938,8427,9526,8871,2002,908,8789,9658,8645,4973,5043,8732,5599,1811,4160,7683,5408,7040,703,4634,4787,8433,1624],()=>e(e.s=33937)),e.O()}]);