Sid Gifari File Manager
🏠 Root
/
home2
/
meumer25
/
meupet.app
/
wp-content
/
plugins
/
all-in-one-seo-pack
/
dist
/
Lite
/
assets
/
js
/
Editing: Index.9292de28.js
import{z as y,b as W,w as z,u as J,a as H,m as I}from"./index.317ad629.js";import{u as N}from"./Url.c2dcf147.js";import{B as j}from"./Input.f04bee4d.js";import{C as M}from"./Button.9a301412.js";import{a as q,S as G}from"./Pencil.d82df6a1.js";import{S as K}from"./Exclamation.fc507dc9.js";import{_ as T}from"./_plugin-vue_export-helper.eefbdd86.js";import{a6 as n,o as l,c as _,_ as p,F as b,af as B,a1 as d,a2 as v,a7 as L,$ as U,a4 as h,l as S,ae as F,a3 as Q}from"./runtime-core.esm-bundler.ce5add0b.js";import"./translations.e71e2202.js";import{_ as o,a as k}from"./default-i18n.65d58dd6.js";import{B as X}from"./Checkbox.6a913600.js";import{C as $}from"./ProBadge.e6ec5f9a.js";import{S as ee}from"./External.641efa63.js";import{a as te}from"./runtime-dom.esm-bundler.dc49ee3e.js";import{e as re}from"./escapeRegExp.39041b6f.js";import{C as se}from"./Index.2a391835.js";import{S as le}from"./Gear.0f79dbf5.js";import{_ as oe}from"./Trash.87a7d946.js";import{T as ie}from"./Slide.3003ef51.js";const x="all-in-one-seo-pack",ne=()=>({redirectHasUnPublishedPost:e=>e.post_id&&e.postStatus!=="publish",validateRedirect:e=>{const u=[];if(!e.url.url)return u;if(e.url.regex)try{new RegExp(e.url.url)}catch{return u.push(o("The regex syntax is invalid.",x)),u}if(!e.url.regex&&!y(e.url.url))return u.push(o("Your URL is invalid.",x)),u;e.url.url.substr(0,4)==="http"&&u.push(o("Please enter a valid relative source URL.",x));const s=/%[a-zA-Z_]+%/,a=/%[0-9A-Fa-f]{2}/;if(e.url.url.match(s)&&!e.url.url.match(a)&&u.push(o("Permalinks are not currently supported.",x)),(e.url.url==="/(.*)"||e.url.url==="^/(.*)")&&u.push(o("This redirect is supported using the Relocate Site feature under Full Site Redirect tab.",x)),e.url.url&&e.url.url.length&&e.targetUrl&&e.targetUrl.length){let c=e.url.ignoreSlash?W.unTrailingSlashIt(e.url.url):e.url.url,i=e.url.ignoreSlash?W.unTrailingSlashIt(e.targetUrl):e.targetUrl;c=e.url.ignoreCase?c.toLowerCase():c,i=e.url.ignoreCase?i.toLowerCase():i,e.url.regex||(c=c.replace(/#.*?$/,"")),i=i.replace(/#.*?$/,""),(c===i||e.url.regex&&i.match(c))&&u.push(o("Your source is the same as a target and this will create a loop.",x))}const f=z();if(0<(f==null?void 0:f.protectedPaths.length)){const c=f.protectedPaths.map(i=>i.replace(/\/$/,""));e.url.url.match(new RegExp("^("+c.join("|")+")"))&&u.push(o("Your source is a protected path and cannot be redirected.",x))}return u}}),P="all-in-one-seo-pack",ue={emits:["set-url"],components:{CoreProBadge:$,SvgExternal:ee},props:{results:{type:Array,required:!0},url:String},data(){return{strings:{DRAFT:o("DRAFT",P),PENDING:o("PENDING",P),FUTURE:o("FUTURE",P)}}},methods:{getOptionTitle(t){t=y(t);const r=y(this.url),e=new RegExp(`(${re(r)})`,"gi");return t.replace(e,'<span class="search-term">$1</span>')},getStatusLabel(t){switch(t.toLowerCase()){case"draft":return this.strings.DRAFT;case"future":return this.strings.FUTURE;case"pending":return this.strings.PENDING}}}},ae={class:"aioseo-add-redirection-url-results"},ce=["onClick"],he={class:"option"},de={class:"option-title"},ge=["innerHTML"],me={class:"option-details"},pe=["href"];function fe(t,r,e,u,s,a){const f=n("core-pro-badge"),c=n("svg-external");return l(),_("div",ae,[p("ul",null,[(l(!0),_(b,null,B(e.results,(i,R)=>(l(),_("li",{key:R,onClick:C=>t.$emit("set-url",i.link)},[p("span",null,[p("div",he,[p("div",de,[p("div",{innerHTML:a.getOptionTitle(i.label)},null,8,ge),i.status!=="publish"?(l(),d(f,{key:0},{default:v(()=>[L(U(a.getStatusLabel(i.status)),1)]),_:2},1024)):h("",!0)]),p("div",me,[p("span",null,U(i.link),1)])]),p("a",{class:"option-permalink",href:i.link,target:"_blank",onClick:te(()=>{},["stop"])},[S(c)],8,pe)])],8,ce))),128))])])}const Y=T(ue,[["render",fe]]),_e={setup(){const{decodeUrl:t}=N();return{postEditorStore:J(),redirectsStore:z(),rootStore:H(),decodeUrl:t}},components:{BaseInput:j,CoreAddRedirectionUrlResults:Y,CoreLoader:M,SvgCircleCheck:q,SvgCircleClose:G,SvgCircleExclamation:K},props:{url:String,errors:Array,warnings:Array,disableSearch:Boolean},data(){return{showResults:!1,isLoading:!1,value:null,results:[]}},watch:{value(){this.value&&(this.value=this.value.replace(/(https?:\/)(\/)+|(\/)+/g,"$1$2$3"),this.value.startsWith("/")&&(this.value=this.value.replace(/\s+/g,"")))},url:{immediate:!0,handler(){this.value=this.url}}},methods:{onBlur(){setTimeout(()=>{this.$emit("update:modelValue",this.value)},150)},searchChange(){if(!this.disableSearch){if(!this.value){this.isLoading=!1,this.showResults=!1,this.results=[];return}if(this.value.startsWith("/")||this.value.startsWith("http:")||this.value.startsWith("https:")){this.isLoading=!1,this.showResults=!1,this.results=[];return}this.isLoading=!0,I(()=>{if(!this.value){this.isLoading=!1,this.showResults=!1,this.results=[];return}this.showResults=!0,this.ajaxSearch(this.value).then(()=>this.isLoading=!1)},500)}},ajaxSearch(t){return this.redirectsStore.getPosts({query:t,postId:this.postEditorStore.currentPost.id}).then(r=>{this.results=r.body.objects})},setUrl(t){this.showResults=!1,this.value=t.replace(this.rootStore.aioseo.urls.home,"",t),this.$emit("update:modelValue",this.value)},inputEventDecodeUrl(t){this.value="",this.value=this.decodeUrl(t)},documentClick(t){if(!this.showResults)return;const r=t&&t.target?t.target:null,e=this.$refs["redirect-target-url"];e&&e!==r&&!e.contains(r)&&(this.showResults=!1)}},mounted(){document.addEventListener("click",this.documentClick);const t=document.querySelector("#aioseo-modal-portal .modal-wrapper");t&&t.addEventListener("click",this.documentClick);const r=document.querySelector("#main-settings-cont");r&&r.addEventListener("click",this.documentClick)},beforeUnmount(){document.removeEventListener("click",this.documentClick);const t=document.querySelector("#aioseo-modal-portal .modal-wrapper");t&&t.removeEventListener("click",this.documentClick);const r=document.querySelector("#main-settings-cont");r&&r.removeEventListener("click",this.documentClick)}},ve={class:"aioseo-add-redirection-target-url",ref:"redirect-target-url"},Se={class:"append-icon"};function we(t,r,e,u,s,a){const f=n("svg-circle-close"),c=n("svg-circle-check"),i=n("svg-circle-exclamation"),R=n("core-loader"),C=n("base-input"),E=n("core-add-redirection-url-results");return l(),_("div",ve,[S(C,{modelValue:s.value,"onUpdate:modelValue":[r[0]||(r[0]=w=>s.value=w),r[2]||(r[2]=w=>t.$emit("update:modelValue",u.decodeUrl(s.value)))],onKeyup:a.searchChange,onFocus:r[1]||(r[1]=w=>s.showResults=!0),onInput:r[3]||(r[3]=w=>a.inputEventDecodeUrl(w.target.value)),size:"medium",placeholder:"/target-page/",class:F({"aioseo-error":e.errors.length,"aioseo-active":!e.errors.length&&!e.warnings.length&&e.url,"aioseo-warning":e.warnings.length})},{"append-icon":v(()=>[p("div",Se,[s.isLoading?h("",!0):(l(),_(b,{key:0},[e.errors.length?(l(),d(f,{key:0})):h("",!0),!e.errors.length&&!e.warnings.length&&e.url?(l(),d(c,{key:1})):h("",!0),e.warnings.length?(l(),d(i,{key:2})):h("",!0)],64)),s.isLoading?(l(),d(R,{key:1,dark:""})):h("",!0)])]),_:1},8,["modelValue","onKeyup","class"]),s.showResults&&s.results.length?(l(),d(E,{key:0,results:s.results,url:s.value,onSetUrl:a.setUrl},null,8,["results","url","onSetUrl"])):h("",!0)],512)}const Je=T(_e,[["render",we]]),xe=function(t,r){if(typeof t!="string")return t;const e=new RegExp("^"+r.replace(/\/$/,""),"i");return t.replace(e,"")},m="all-in-one-seo-pack",ke={emits:["updated-url","remove-url","updated-option"],setup(){const{validateRedirect:t}=ne(),{decodeUrl:r}=N();return{redirectsStore:z(),rootStore:H(),validateRedirect:t,decodeUrl:r}},components:{BaseCheckbox:X,BaseInput:j,CoreAddRedirectionUrlResults:Y,CoreAlert:se,CoreLoader:M,SvgCircleCheck:q,SvgCircleClose:G,SvgCircleExclamation:K,SvgGear:le,SvgTrash:oe,TransitionSlide:ie},props:{url:{type:Object,default(){return{id:null,url:null,regex:!1,ignoreSlash:!0,ignoreCase:!0,errors:[],warnings:[]}}},allowDelete:Boolean,targetUrl:String,log404:Boolean,disableSource:Boolean,disableSearch:Boolean},data(){return{showResults:!1,isLoading:!1,showOptions:!1,strings:{ignoreSlash:o("Ignore Slash",m),ignoreCase:o("Ignore Case",m),regex:o("Regex",m)},results:[]}},watch:{targetUrl(){this.updateSourceUrl(this.url.url)}},computed:{maybeRegex(){return this.url.url.match(/[*\\()[\]^$]/)!==null||this.url.url.indexOf(".?")!==-1},iffyUrl(){if(!this.url.url||this.disableSource)return[];const t=[];return this.url.url.substr(0,4)!=="http"&&this.url.url.substr(0,1)!=="/"&&0<this.url.url.length&&!this.url.regex&&t.push(k(o("The source URL should probably start with a %1$s",m),"<code>/</code>")),this.url.url.indexOf("#")!==-1&&t.push(o("Anchor values are not sent to the server and cannot be redirected.",m)),!this.log404&&this.maybeRegex&&!this.url.regex&&t.push(k(o("Remember to enable the %1$s option if this is a regular expression.",m),"<code>Regex</code>")),this.url.regex&&(this.url.url.indexOf("^")===-1&&this.url.url.indexOf("$")===-1&&t.push(k(o("To prevent a greedy regular expression you can use %1$s to anchor it to the start of the URL. For example: %2$s",m),"<code>^/</code>","<code>^/"+y(this.url.url.replace(/^\//,""))+"</code>")),0<this.url.url.indexOf("^")&&t.push(k(o("The caret %1$s should be at the start. For example: %2$s",m),"<code>^/</code>","<code>^/"+y(this.url.url.replace("^","").replace(/^\//,""))+"</code>")),this.url.url.indexOf("^")===0&&this.url.url.indexOf("^/")===-1&&t.push(k(o("The source URL should probably start with a %1$s",m),"<code>^/</code>")),this.url.url.length-1!==this.url.url.indexOf("$")&&this.url.url.indexOf("$")!==-1&&t.push(k(o("The dollar symbol %1$s should be at the end. For example: %2$s",m),"<code>$</code>","<code>"+y(this.url.url.replace(/\$/g,""))+"$</code>"))),this.url.url.match(/(\.html|\.htm|\.php|\.pdf|\.jpg)$/)!==null&&t.push(o("Some servers may be configured to serve file resources directly, preventing a redirect occurring.",m)),t},urlOptionsActive(){return this.url.regex||this.showOptions}},methods:{updateSourceUrl(t){!this.disableSource&&t&&(t&&(t=t.replace(/(https?:\/)(\/)+|(\/)+/g,"$1$2$3")),!this.url.regex&&t.startsWith("/")&&(t=t.replace(/\s+/g,"")),t=xe(t,this.rootStore.aioseo.urls.home)),this.url.url=t,this.url.errors=this.validateRedirect(this),this.url.warnings=this.iffyUrl,this.$emit("updated-url",this.url)},updateOption(t,r){this.url[t]=r,this.updateSourceUrl(this.url.url),this.$emit("updated-option",this.url)},searchChange(){if(!this.disableSearch){if(!this.url.url||this.url.regex){this.isLoading=!1,this.showResults=!1,this.results=[];return}if(this.url.url.startsWith("/")||this.url.url.startsWith("^")||this.url.url.startsWith("http:")||this.url.url.startsWith("https:")){this.isLoading=!1,this.showResults=!1,this.results=[];return}this.isLoading=!0,I(()=>{if(!this.url.url){this.isLoading=!1,this.showResults=!1,this.results=[];return}this.showResults=!0,this.ajaxSearch(this.url.url).then(()=>this.isLoading=!1)},500)}},ajaxSearch(t){return this.redirectsStore.getPosts({query:t}).then(r=>{this.results=r.body.objects})},setUrl(t){this.showResults=!1,this.updateOption("url",t.replace(this.rootStore.aioseo.urls.home,"",t))},documentClick(t){if(!this.showResults)return;const r=t&&t.target?t.target:null,e=this.$refs["redirect-source-url"];e&&e!==r&&!e.contains(r)&&(this.showResults=!1)}},mounted(){this.url.showOptions&&(this.showOptions=!0,this.updateSourceUrl(this.url.url)),document.addEventListener("click",this.documentClick)},beforeUnmount(){document.removeEventListener("click",this.documentClick)}},ye={class:"aioseo-redirect-source-url",ref:"redirect-source-url"},Re={class:"append-icon"};function be(t,r,e,u,s,a){const f=n("svg-circle-close"),c=n("svg-circle-check"),i=n("svg-circle-exclamation"),R=n("svg-gear"),C=n("svg-trash"),E=n("core-loader"),w=n("base-input"),Z=n("core-add-redirection-url-results"),O=n("base-checkbox"),V=n("transition-slide"),D=n("core-alert");return l(),_("div",ye,[S(w,{modelValue:u.decodeUrl(e.url.url),"onUpdate:modelValue":r[2]||(r[2]=g=>a.updateSourceUrl(u.decodeUrl(g))),onKeyup:a.searchChange,onFocus:r[3]||(r[3]=g=>s.showResults=!0),disabled:e.log404||e.disableSource,size:"medium",placeholder:"/source-page/",class:F({"aioseo-error":e.url.errors.length,"aioseo-active":!e.url.errors.length&&!e.url.warnings.length&&e.url.url,"aioseo-warning":e.url.warnings.length})},{"append-icon":v(()=>[p("div",Re,[s.isLoading?h("",!0):(l(),_(b,{key:0},[e.url.errors.length?(l(),d(f,{key:0})):h("",!0),!e.url.errors.length&&!e.url.warnings.length&&e.url.url?(l(),d(c,{key:1})):h("",!0),e.url.warnings.length?(l(),d(i,{key:2})):h("",!0),S(R,{class:F({active:a.urlOptionsActive}),onClick:r[0]||(r[0]=g=>s.showOptions=!s.showOptions)},null,8,["class"]),e.allowDelete?(l(),d(C,{key:3,onClick:r[1]||(r[1]=g=>t.$emit("remove-url"))})):h("",!0)],64)),s.isLoading?(l(),d(E,{key:1,dark:""})):h("",!0)])]),_:1},8,["modelValue","onKeyup","disabled","class"]),!e.url.regex&&s.showResults&&s.results.length?(l(),d(Z,{key:0,results:s.results,url:e.url.url,onSetUrl:a.setUrl},null,8,["results","url","onSetUrl"])):h("",!0),e.log404?h("",!0):Q(t.$slots,"source-url-description",{key:1}),S(V,{active:s.showOptions,class:"source-url-options"},{default:v(()=>[S(O,{size:"medium",modelValue:e.url.ignoreSlash,"onUpdate:modelValue":r[4]||(r[4]=g=>a.updateOption("ignoreSlash",g))},{default:v(()=>[L(U(s.strings.ignoreSlash),1)]),_:1},8,["modelValue"]),S(O,{size:"medium",modelValue:e.url.ignoreCase,"onUpdate:modelValue":r[5]||(r[5]=g=>a.updateOption("ignoreCase",g))},{default:v(()=>[L(U(s.strings.ignoreCase),1)]),_:1},8,["modelValue"]),!e.log404&&!e.disableSource?(l(),d(O,{key:0,size:"medium",modelValue:e.url.regex,"onUpdate:modelValue":r[6]||(r[6]=g=>a.updateOption("regex",g))},{default:v(()=>[L(U(s.strings.regex),1)]),_:1},8,["modelValue"])):h("",!0)]),_:1},8,["active"]),S(V,{active:!!e.url.errors.length},{default:v(()=>[(l(!0),_(b,null,B(e.url.errors,(g,A)=>(l(),d(D,{key:A,class:"source-url-error",type:"red",size:"small",innerHTML:g},null,8,["innerHTML"]))),128))]),_:1},8,["active"]),S(V,{active:!!e.url.warnings.length},{default:v(()=>[(l(!0),_(b,null,B(e.url.warnings,(g,A)=>(l(),d(D,{key:A,class:"source-url-warning",type:"yellow",size:"small",innerHTML:g},null,8,["innerHTML"]))),128))]),_:1},8,["active"])],512)}const Qe=T(ke,[["render",be]]),Ue={},Ce={width:"36",height:"16",viewBox:"0 0 36 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"aioseo-right-arrow"},Le=p("path",{d:"M36 8L28.4211 0.5V6.125H0V9.875H28.4211V15.5L36 8Z",fill:"currentColor"},null,-1),Te=[Le];function Ee(t,r){return l(),_("svg",Ce,Te)}const Xe=T(Ue,[["render",Ee]]);export{Je as C,Xe as S,Qe as a,ne as u};
Save
Cancel