diff --git a/build/content-helper/dashboard-page.asset.php b/build/content-helper/dashboard-page.asset.php index b8aa34498..e0be14269 100644 --- a/build/content-helper/dashboard-page.asset.php +++ b/build/content-helper/dashboard-page.asset.php @@ -1 +1 @@ - array('react', 'react-dom', 'wp-api-fetch', 'wp-components', 'wp-compose', 'wp-data', 'wp-date', 'wp-dom-ready', 'wp-element', 'wp-i18n', 'wp-notices', 'wp-primitives', 'wp-url'), 'version' => '5a2443845dcf94f0dfd5'); + array('react', 'react-dom', 'wp-api-fetch', 'wp-components', 'wp-compose', 'wp-data', 'wp-date', 'wp-dom-ready', 'wp-element', 'wp-i18n', 'wp-notices', 'wp-primitives', 'wp-url'), 'version' => 'ab56d2f1d28d0b1481e8'); diff --git a/build/content-helper/dashboard-page.js b/build/content-helper/dashboard-page.js index 48a05e857..5de5ed91a 100644 --- a/build/content-helper/dashboard-page.js +++ b/build/content-helper/dashboard-page.js @@ -1,6 +1,6 @@ -!function(){"use strict";var e={20:function(e,t,n){var r=n(609),i=Symbol.for("react.element"),o=Symbol.for("react.fragment"),a=Object.prototype.hasOwnProperty,s=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function c(e,t,n){var r,o={},c=null,u=null;for(r in void 0!==n&&(c=""+n),void 0!==t.key&&(c=""+t.key),void 0!==t.ref&&(u=t.ref),t)a.call(t,r)&&!l.hasOwnProperty(r)&&(o[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===o[r]&&(o[r]=t[r]);return{$$typeof:i,type:e,key:c,ref:u,props:o,_owner:s.current}}t.Fragment=o,t.jsx=c,t.jsxs=c},848:function(e,t,n){e.exports=n(20)},609:function(e){e.exports=window.React}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={exports:{}};return e[r](o,o.exports,n),o.exports}n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},function(){var e,t=n(848),r=n(609),i=window.ReactDOM;function o(){return o=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}var f;function h(e,t,n){void 0===n&&(n="/");let r=N(("string"==typeof t?p(t):t).pathname||"/",n);if(null==r)return null;let i=g(e);!function(e){e.sort(((e,t)=>e.score!==t.score?t.score-e.score:function(e,t){return e.length===t.length&&e.slice(0,-1).every(((e,n)=>e===t[n]))?e[e.length-1]-t[t.length-1]:0}(e.routesMeta.map((e=>e.childrenIndex)),t.routesMeta.map((e=>e.childrenIndex)))))}(i);let o=null;for(let e=0;null==o&&e{let a={relativePath:void 0===o?e.path||"":o,caseSensitive:!0===e.caseSensitive,childrenIndex:i,route:e};a.relativePath.startsWith("/")&&(s(a.relativePath.startsWith(r),'Absolute route path "'+a.relativePath+'" nested under path "'+r+'" is not valid. An absolute child route path must start with the combined path of all its parent routes.'),a.relativePath=a.relativePath.slice(r.length));let l=I([r,a.relativePath]),c=n.concat(a);e.children&&e.children.length>0&&(s(!0!==e.index,'Index routes must not have child routes. Please remove all child routes from route path "'+l+'".'),g(e.children,t,c,l)),(null!=e.path||e.index)&&t.push({path:l,score:_(l,e.index),routesMeta:c})};return e.forEach(((e,t)=>{var n;if(""!==e.path&&null!=(n=e.path)&&n.includes("?"))for(let n of v(e.path))i(e,t,n);else i(e,t)})),t}function v(e){let t=e.split("/");if(0===t.length)return[];let[n,...r]=t,i=n.endsWith("?"),o=n.replace(/\?$/,"");if(0===r.length)return i?[o,""]:[o];let a=v(r.join("/")),s=[];return s.push(...a.map((e=>""===e?o:[o,e].join("/")))),i&&s.push(...a),s.map((t=>e.startsWith("/")&&""===t?"/":t))}!function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"}(f||(f={})),new Set(["lazy","caseSensitive","path","id","index","children"]);const m=/^:[\w-]+$/,y=3,b=2,w=1,x=10,S=-2,k=e=>"*"===e;function _(e,t){let n=e.split("/"),r=n.length;return n.some(k)&&(r+=S),t&&(r+=b),n.filter((e=>!k(e))).reduce(((e,t)=>e+(m.test(t)?y:""===t?w:x)),r)}function P(e,t){let{routesMeta:n}=e,r={},i="/",o=[];for(let e=0;e(r.push({paramName:t,isOptional:null!=n}),n?"/?([^\\/]+)?":"/([^\\/]+)")));return e.endsWith("*")?(r.push({paramName:"*"}),i+="*"===e||"/*"===e?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":""!==e&&"/"!==e&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),r]}(e.path,e.caseSensitive,e.end),i=t.match(n);if(!i)return null;let o=i[0],a=o.replace(/(.)\/+$/,"$1"),s=i.slice(1);return{params:r.reduce(((e,t,n)=>{let{paramName:r,isOptional:i}=t;if("*"===r){let e=s[n]||"";a=o.slice(0,o.length-e.length).replace(/(.)\/+$/,"$1")}const l=s[n];return e[r]=i&&!l?void 0:(l||"").replace(/%2F/g,"/"),e}),{}),pathname:o,pathnameBase:a,pattern:e}}function E(e){try{return e.split("/").map((e=>decodeURIComponent(e).replace(/\//g,"%2F"))).join("/")}catch(t){return l(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent encoding ('+t+")."),e}}function N(e,t){if("/"===t)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&"/"!==r?null:e.slice(n)||"/"}function T(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified `to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the `to."+n+'` field. Alternatively you may provide the full path as a string in and the router will parse it for you.'}function L(e,t){let n=function(e){return e.filter(((e,t)=>0===t||e.route.path&&e.route.path.length>0))}(e);return t?n.map(((t,n)=>n===e.length-1?t.pathname:t.pathnameBase)):n.map((e=>e.pathnameBase))}function C(e,t,n,r){let i;void 0===r&&(r=!1),"string"==typeof e?i=p(e):(i=o({},e),s(!i.pathname||!i.pathname.includes("?"),T("?","pathname","search",i)),s(!i.pathname||!i.pathname.includes("#"),T("#","pathname","hash",i)),s(!i.search||!i.search.includes("#"),T("#","search","hash",i)));let a,l=""===e||""===i.pathname,c=l?"/":i.pathname;if(null==c)a=n;else{let e=t.length-1;if(!r&&c.startsWith("..")){let t=c.split("/");for(;".."===t[0];)t.shift(),e-=1;i.pathname=t.join("/")}a=e>=0?t[e]:"/"}let u=function(e,t){void 0===t&&(t="/");let{pathname:n,search:r="",hash:i=""}="string"==typeof e?p(e):e,o=n?n.startsWith("/")?n:function(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach((e=>{".."===e?n.length>1&&n.pop():"."!==e&&n.push(e)})),n.length>1?n.join("/"):"/"}(n,t):t;return{pathname:o,search:A(r),hash:R(i)}}(i,a),d=c&&"/"!==c&&c.endsWith("/"),f=(l||"."===c)&&n.endsWith("/");return u.pathname.endsWith("/")||!d&&!f||(u.pathname+="/"),u}const I=e=>e.join("/").replace(/\/\/+/g,"/"),O=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),A=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",R=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:"";Error;const D=["post","put","patch","delete"],G=(new Set(D),["get",...D]);function M(){return M=Object.assign?Object.assign.bind():function(e){for(var t=1;t{n.current=!0})),r.useCallback((function(r,i){void 0===i&&(i={}),n.current&&("number"==typeof r?e.navigate(r):e.navigate(r,M({fromRouteId:t},i)))}),[e,t])}():function(){z()||s(!1);let e=r.useContext(B),{basename:t,future:n,navigator:i}=r.useContext(F),{matches:o}=r.useContext(H),{pathname:a}=q(),l=JSON.stringify(L(o,n.v7_relativeSplatPath)),c=r.useRef(!1);return K((()=>{c.current=!0})),r.useCallback((function(n,r){if(void 0===r&&(r={}),!c.current)return;if("number"==typeof n)return void i.go(n);let o=C(n,JSON.parse(l),a,"path"===r.relative);null==e&&"/"!==t&&(o.pathname="/"===o.pathname?t:I([t,o.pathname])),(r.replace?i.replace:i.push)(o,r.state,r)}),[t,i,l,a,e])}()}function Z(e,t){let{relative:n}=void 0===t?{}:t,{future:i}=r.useContext(F),{matches:o}=r.useContext(H),{pathname:a}=q(),s=JSON.stringify(L(o,i.v7_relativeSplatPath));return r.useMemo((()=>C(e,JSON.parse(s),a,"path"===n)),[e,s,a,n])}function J(t,n,i,o){z()||s(!1);let{navigator:a}=r.useContext(F),{matches:l}=r.useContext(H),c=l[l.length-1],u=c?c.params:{},d=(c&&c.pathname,c?c.pathnameBase:"/");c&&c.route;let f,g=q();if(n){var v;let e="string"==typeof n?p(n):n;"/"===d||(null==(v=e.pathname)?void 0:v.startsWith(d))||s(!1),f=e}else f=g;let m=f.pathname||"/",y=m;if("/"!==d){let e=d.replace(/^\//,"").split("/");y="/"+m.replace(/^\//,"").split("/").slice(e.length).join("/")}let b=h(t,{pathname:y}),w=function(e,t,n,i){var o;if(void 0===t&&(t=[]),void 0===n&&(n=null),void 0===i&&(i=null),null==e){var a;if(null==(a=n)||!a.errors)return null;e=n.matches}let l=e,c=null==(o=n)?void 0:o.errors;if(null!=c){let e=l.findIndex((e=>e.route.id&&(null==c?void 0:c[e.route.id])));e>=0||s(!1),l=l.slice(0,Math.min(l.length,e+1))}let u=!1,d=-1;if(n&&i&&i.v7_partialHydration)for(let e=0;e=0?l.slice(0,d+1):[l[0]];break}}}return l.reduceRight(((e,i,o)=>{let a,s=!1,p=null,f=null;var h;n&&(a=c&&i.route.id?c[i.route.id]:void 0,p=i.route.errorElement||Q,u&&(d<0&&0===o?(ie[h="route-fallback"]||(ie[h]=!0),s=!0,f=null):d===o&&(s=!0,f=i.route.hydrateFallbackElement||null)));let g=t.concat(l.slice(0,o+1)),v=()=>{let t;return t=a?p:s?f:i.route.Component?r.createElement(i.route.Component,null):i.route.element?i.route.element:e,r.createElement(ee,{match:i,routeContext:{outlet:e,matches:g,isDataRoute:null!=n},children:t})};return n&&(i.route.ErrorBoundary||i.route.errorElement||0===o)?r.createElement(X,{location:n.location,revalidation:n.revalidation,component:p,error:a,children:v(),routeContext:{outlet:null,matches:g,isDataRoute:!0}}):v()}),null)}(b&&b.map((e=>Object.assign({},e,{params:Object.assign({},u,e.params),pathname:I([d,a.encodeLocation?a.encodeLocation(e.pathname).pathname:e.pathname]),pathnameBase:"/"===e.pathnameBase?d:I([d,a.encodeLocation?a.encodeLocation(e.pathnameBase).pathname:e.pathnameBase])}))),l,i,o);return n&&w?r.createElement(V.Provider,{value:{location:M({pathname:"/",search:"",hash:"",state:null,key:"default"},f),navigationType:e.Pop}},w):w}function Y(){let e=function(){var e;let t=r.useContext(W),n=function(){let e=r.useContext(U);return e||s(!1),e}(ne.UseRouteError),i=re(ne.UseRouteError);return void 0!==t?t:null==(e=n.errors)?void 0:e[i]}(),t=function(e){return null!=e&&"number"==typeof e.status&&"string"==typeof e.statusText&&"boolean"==typeof e.internal&&"data"in e}(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return r.createElement(r.Fragment,null,r.createElement("h2",null,"Unexpected Application Error!"),r.createElement("h3",{style:{fontStyle:"italic"}},t),n?r.createElement("pre",{style:i},n):null,null)}const Q=r.createElement(Y,null);class X extends r.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||"idle"!==t.revalidation&&"idle"===e.revalidation?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:void 0!==e.error?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){console.error("React Router caught the following error during render",e,t)}render(){return void 0!==this.state.error?r.createElement(H.Provider,{value:this.props.routeContext},r.createElement(W.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function ee(e){let{routeContext:t,match:n,children:i}=e,o=r.useContext(B);return o&&o.static&&o.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=n.route.id),r.createElement(H.Provider,{value:t},i)}var te=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(te||{}),ne=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(ne||{});function re(e){let t=function(){let e=r.useContext(H);return e||s(!1),e}(),n=t.matches[t.matches.length-1];return n.route.id||s(!1),n.route.id}const ie={};function oe(e){s(!1)}function ae(t){let{basename:n="/",children:i=null,location:o,navigationType:a=e.Pop,navigator:l,static:c=!1,future:u}=t;z()&&s(!1);let d=n.replace(/^\/*/,"/"),f=r.useMemo((()=>({basename:d,navigator:l,static:c,future:M({v7_relativeSplatPath:!1},u)})),[d,u,l,c]);"string"==typeof o&&(o=p(o));let{pathname:h="/",search:g="",hash:v="",state:m=null,key:y="default"}=o,b=r.useMemo((()=>{let e=N(h,d);return null==e?null:{location:{pathname:e,search:g,hash:v,state:m,key:y},navigationType:a}}),[d,h,g,v,m,y,a]);return null==b?null:r.createElement(F.Provider,{value:f},r.createElement(V.Provider,{children:i,value:b}))}function se(e){let{children:t,location:n}=e;return J(le(t),n)}function le(e,t){void 0===t&&(t=[]);let n=[];return r.Children.forEach(e,((e,i)=>{if(!r.isValidElement(e))return;let o=[...t,i];if(e.type===r.Fragment)return void n.push.apply(n,le(e.props.children,o));e.type!==oe&&s(!1),e.props.index&&e.props.children&&s(!1);let a={id:e.props.id||o.join("-"),caseSensitive:e.props.caseSensitive,element:e.props.element,Component:e.props.Component,index:e.props.index,path:e.props.path,loader:e.props.loader,action:e.props.action,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:null!=e.props.ErrorBoundary||null!=e.props.errorElement,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(a.children=le(e.props.children,o)),n.push(a)})),n}function ce(){return ce=Object.assign?Object.assign.bind():function(e){for(var t=1;t{})),r.Component,new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);const ue=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"];try{window.__reactRouterVersion="6"}catch(e){}new Map;const de=r.startTransition;function pe(t){let{basename:n,children:i,future:f,window:h}=t,g=r.useRef();var v;null==g.current&&(g.current=(void 0===(v={window:h,v5Compat:!0})&&(v={}),function(t,n,r,i){void 0===i&&(i={});let{window:l=document.defaultView,v5Compat:p=!1}=i,f=l.history,h=e.Pop,g=null,v=m();function m(){return(f.state||{idx:null}).idx}function y(){h=e.Pop;let t=m(),n=null==t?null:t-v;v=t,g&&g({action:h,location:w.location,delta:n})}function b(e){let t="null"!==l.location.origin?l.location.origin:l.location.href,n="string"==typeof e?e:d(e);return n=n.replace(/ $/,"%20"),s(t,"No window.location.(origin|href) available to create URL for href: "+n),new URL(n,t)}null==v&&(v=0,f.replaceState(o({},f.state,{idx:v}),""));let w={get action(){return h},get location(){return t(l,f)},listen(e){if(g)throw new Error("A history only accepts one active listener");return l.addEventListener(a,y),g=e,()=>{l.removeEventListener(a,y),g=null}},createHref(e){return n(l,e)},createURL:b,encodeLocation(e){let t=b(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:function(t,n){h=e.Push;let i=u(w.location,t,n);r&&r(i,t),v=m()+1;let o=c(i,v),a=w.createHref(i);try{f.pushState(o,"",a)}catch(e){if(e instanceof DOMException&&"DataCloneError"===e.name)throw e;l.location.assign(a)}p&&g&&g({action:h,location:w.location,delta:1})},replace:function(t,n){h=e.Replace;let i=u(w.location,t,n);r&&r(i,t),v=m();let o=c(i,v),a=w.createHref(i);f.replaceState(o,"",a),p&&g&&g({action:h,location:w.location,delta:0})},go(e){return f.go(e)}};return w}((function(e,t){let{pathname:n="/",search:r="",hash:i=""}=p(e.location.hash.substr(1));return n.startsWith("/")||n.startsWith(".")||(n="/"+n),u("",{pathname:n,search:r,hash:i},t.state&&t.state.usr||null,t.state&&t.state.key||"default")}),(function(e,t){let n=e.document.querySelector("base"),r="";if(n&&n.getAttribute("href")){let t=e.location.href,n=t.indexOf("#");r=-1===n?t:t.slice(0,n)}return r+"#"+("string"==typeof t?t:d(t))}),(function(e,t){l("/"===e.pathname.charAt(0),"relative pathnames are not supported in hash history.push("+JSON.stringify(t)+")")}),v)));let m=g.current,[y,b]=r.useState({action:m.action,location:m.location}),{v7_startTransition:w}=f||{},x=r.useCallback((e=>{w&&de?de((()=>b(e))):b(e)}),[b,w]);return r.useLayoutEffect((()=>m.listen(x)),[m,x]),r.createElement(ae,{basename:n,children:i,location:y.location,navigationType:y.action,navigator:m,future:f})}i.flushSync,r.useId;const fe="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,he=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ge=r.forwardRef((function(e,t){let n,{onClick:i,relative:o,reloadDocument:a,replace:l,state:c,target:u,to:p,preventScrollReset:f,unstable_viewTransition:h}=e,g=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r=0||(i[n]=e[n]);return i}(e,ue),{basename:v}=r.useContext(F),m=!1;if("string"==typeof p&&he.test(p)&&(n=p,fe))try{let e=new URL(window.location.href),t=p.startsWith("//")?new URL(e.protocol+p):new URL(p),n=N(t.pathname,v);t.origin===e.origin&&null!=n?p=n+t.search+t.hash:m=!0}catch(e){}let y=function(e,t){let{relative:n}=void 0===t?{}:t;z()||s(!1);let{basename:i,navigator:o}=r.useContext(F),{hash:a,pathname:l,search:c}=Z(e,{relative:n}),u=l;return"/"!==i&&(u="/"===l?i:I([i,l])),o.createHref({pathname:u,search:c,hash:a})}(p,{relative:o}),b=function(e,t){let{target:n,replace:i,state:o,preventScrollReset:a,relative:s,unstable_viewTransition:l}=void 0===t?{}:t,c=$(),u=q(),p=Z(e,{relative:s});return r.useCallback((t=>{if(function(e,t){return!(0!==e.button||t&&"_self"!==t||function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e))}(t,n)){t.preventDefault();let n=void 0!==i?i:d(u)===d(p);c(e,{replace:n,state:o,preventScrollReset:a,relative:s,unstable_viewTransition:l})}}),[u,c,p,i,o,n,e,a,s,l])}(p,{replace:l,state:c,target:u,preventScrollReset:f,relative:o,unstable_viewTransition:h});return r.createElement("a",ce({},g,{href:n||y,onClick:m||a?i:function(e){i&&i(e),e.defaultPrevented||b(e)},ref:t,target:u}))}));var ve,me;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(ve||(ve={})),function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"}(me||(me={}));var ye=window.wp.domReady,be=n.n(ye),we=window.wp.element,xe=window.wp.i18n,Se=window.wp.data,ke=function(){return ke=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0?"".concat(i," ").concat(t):t)||this).hint=null,o.name=o.constructor.name,o.code=r;var a=[Oe.AccessToFeatureDisabled,Oe.ParselyApiForbidden,Oe.ParselyApiResponseContainsError,Oe.ParselyApiReturnedNoData,Oe.ParselyApiReturnedTooManyResults,Oe.PluginCredentialsNotSetMessageDetected,Oe.PluginSettingsApiSecretNotSet,Oe.PluginSettingsSiteIdNotSet,Oe.PostIsNotPublished,Oe.UnknownError,Oe.ParselySuggestionsApiAuthUnavailable,Oe.ParselySuggestionsApiNoAuthentication,Oe.ParselySuggestionsApiNoAuthorization,Oe.ParselySuggestionsApiNoData,Oe.ParselySuggestionsApiSchemaError];return o.retryFetch=!a.includes(o.code),Object.setPrototypeOf(o,n.prototype),o.code===Oe.AccessToFeatureDisabled?o.message=(0,xe.__)("Access to this feature is disabled by the site's administration.","wp-parsely"):o.code===Oe.ParselySuggestionsApiNoAuthorization?o.message=(0,xe.__)('This AI-powered feature is opt-in. To gain access, please submit a request here.',"wp-parsely"):o.code===Oe.ParselySuggestionsApiOpenAiError||o.code===Oe.ParselySuggestionsApiOpenAiUnavailable?o.message=(0,xe.__)("The Parse.ly API returned an internal server error. Please retry with a different input, or try again later.","wp-parsely"):o.code===Oe.HttpRequestFailed&&o.message.includes("cURL error 28")?o.message=(0,xe.__)("The Parse.ly API did not respond in a timely manner. Please try again later.","wp-parsely"):o.code===Oe.ParselySuggestionsApiSchemaError?o.message=(0,xe.__)("The Parse.ly API returned a validation error. Please try again with different parameters.","wp-parsely"):o.code===Oe.ParselySuggestionsApiNoData?o.message=(0,xe.__)("The Parse.ly API couldn't find any relevant data to fulfill the request. Please retry with a different input.","wp-parsely"):o.code===Oe.ParselySuggestionsApiOpenAiSchema?o.message=(0,xe.__)("The Parse.ly API returned an incorrect response. Please try again later.","wp-parsely"):o.code===Oe.ParselySuggestionsApiAuthUnavailable&&(o.message=(0,xe.__)("The Parse.ly API is currently unavailable. Please try again later.","wp-parsely")),o}return Je(n,e),n.prototype.Message=function(e){return void 0===e&&(e=null),[Oe.PluginCredentialsNotSetMessageDetected,Oe.PluginSettingsSiteIdNotSet,Oe.PluginSettingsApiSecretNotSet].includes(this.code)?Re(e):(this.code===Oe.FetchError&&(this.hint=this.Hint((0,xe.__)("This error can sometimes be caused by ad-blockers or browser tracking protections. Please add this site to any applicable allow lists and try again.","wp-parsely"))),this.code!==Oe.ParselyApiForbidden&&this.code!==Oe.ParselySuggestionsApiNoAuthentication||(this.hint=this.Hint((0,xe.__)("Please ensure that the Site ID and API Secret given in the plugin's settings are correct.","wp-parsely"))),this.code===Oe.HttpRequestFailed&&(this.hint=this.Hint((0,xe.__)("The Parse.ly API cannot be reached. Please verify that you are online.","wp-parsely"))),(0,t.jsx)(Ae,{className:null==e?void 0:e.className,testId:"error",children:"

".concat(this.message,"

").concat(this.hint?this.hint:"")}))},n.prototype.Hint=function(e){return'

'.concat((0,xe.__)("Hint:","wp-parsely")," ").concat(e,"

")},n.prototype.createErrorSnackbar=function(){//.test(this.message)||(0,Se.dispatch)("core/notices").createNotice("error",this.message,{type:"snackbar"})},n}(Error),Xe=function(){function e(){this.abortControllers=new Map}return e.prototype.cancelRequest=function(e){if(e)(t=this.abortControllers.get(e))&&(t.abort(),this.abortControllers.delete(e));else{var t,n=Array.from(this.abortControllers.keys()).pop();n&&(t=this.abortControllers.get(n))&&(t.abort(),this.abortControllers.delete(n))}},e.prototype.cancelAll=function(){this.abortControllers.forEach((function(e){return e.abort()})),this.abortControllers.clear()},e.prototype.getOrCreateController=function(e){if(e&&this.abortControllers.has(e))return{abortController:this.abortControllers.get(e),abortId:e};var t=null!=e?e:"auto-"+Date.now(),n=new AbortController;return this.abortControllers.set(t,n),{abortController:n,abortId:t}},e.prototype.fetch=function(e,t){return n=this,r=void 0,o=function(){var n,r,i,o,a,s;return function(e,t){var n,r,i,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]0&&i[i.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]i?t=i:t<1&&(t=1),r(t)},min:1,max:i,dragDirection:"e"}),(0,t.jsxs)("span",{children:[(0,xe.__)("of","wp-parsely")," ",i]})]}),(0,t.jsxs)("div",{className:"page-navigation",children:[(0,t.jsx)(Fe.Button,{icon:We,onClick:o,disabled:1===n}),(0,t.jsx)(Fe.Button,{icon:ze,onClick:a,disabled:n>=i})]})]})},ut=function(){return(0,t.jsx)(Fe.DropdownMenu,{icon:qe,label:(0,xe.__)("Actions","wp-parsely"),children:function(e){var n=e.onClose;return(0,t.jsx)(t.Fragment,{children:(0,t.jsxs)(Fe.MenuGroup,{children:[(0,t.jsx)(Fe.MenuItem,{onClick:n,children:(0,xe.__)("View","wp-parsely")}),(0,t.jsx)(Fe.MenuItem,{onClick:n,children:(0,xe.__)("Edit","wp-parsely")})]})})}})},dt=function(e){var n,r=e.query,i=void 0===r?{}:r,o=e.hideHeader,a=void 0!==o&&o,s=e.hidePagination,l=void 0!==s&&s,c=e.hideLoading,u=void 0!==c&&c,d=e.compact,p=void 0!==d&&d,f=e.noResultsMessage,h=void 0===f?(0,xe.__)("No posts found.","wp-parsely"):f,g=e.className,v=e.onPostClick,m=(0,we.useState)([]),y=m[0],b=m[1],w=(0,we.useState)(1),x=w[0],S=w[1],k=(0,we.useState)(1),_=k[0],P=k[1],j=(0,we.useState)(null!==(n=i.per_page)&&void 0!==n?n:10)[0],E=(0,we.useState)(!0),N=E[0],T=E[1],L=(0,we.useRef)(!1);(0,we.useEffect)((function(){var e,t,n,r;T(!0),e=void 0,t=void 0,r=function(){var e,t;return function(e,t){var n,r,i,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]0},getError:function(e){return e.error},getCurrentPost:function(e){return e.currentPost},getSelectedTab:function(e){return e.selectedTab},getSuggestions:function(e){return e.suggestionsTab.suggestions},getSuggestionsPage:function(e){return e.suggestionsTab.currentPage},getSuggestionsItemsPerPage:function(e){return e.suggestionsTab.itemsPerPage},getInboundLinks:function(e){return e.inboundLinksTab.links},getInboundLinksPage:function(e){return e.inboundLinksTab.currentPage},getInboundLinksItemsPerPage:function(e){return e.inboundLinksTab.itemsPerPage},isSuggestionsLoading:function(e){return e.loading.includes("suggestions")},getSelectedLink:function(e){return e.selectedLink},getPreviewLinkType:function(e){return e.preview.selectedLinkType},isFrontendPreview:function(e){return e.preview.frontendPreview},isAccepting:function(e,t){return e.acceptingLinks.includes(t.uid)},isRemoving:function(e,t){return e.removingLinks.includes(t.uid)},isGeneratingSuggestions:function(e){return e.isGeneratingSuggestions},isGenerating:function(e,t){return e.generatingLinks.includes(t.uid)}}});(0,Se.register)(Ot);var At=(0,t.jsx)(He.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,t.jsx)(He.Path,{d:"M20 11.2H6.8l3.7-3.7-1-1L3.9 12l5.6 5.5 1-1-3.7-3.7H20z"})}),Rt=(0,t.jsx)(He.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,t.jsx)(He.Path,{d:"m14.5 6.5-1 1 3.7 3.7H4v1.6h13.2l-3.7 3.7 1 1 5.6-5.5z"})}),Dt=function(e){var n=e.size,r=void 0===n?40:n;return(0,t.jsx)(Fe.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"1",height:r,viewBox:"0 0 1 ".concat(r),fill:"none",children:(0,t.jsx)(Fe.Rect,{width:"1",height:r,fill:"#cccccc"})})},Gt=function(e){var n=e.activeLink,r=e.onAccept,i=e.onUpdateLink,o=e.onDiscard,a=e.onNext,s=e.onPrevious,l=e.onRemove,c=e.onSelectIndex,u=e.totalItems,d=e.itemIndex,p=e.onRestoreOriginal,f=e.selectedText,h=!(null==n?void 0:n.isSuggestion),g=d1,m=(0,Se.useSelect)((function(e){return{isAccepting:!!n&&e(Ot).isAccepting(n),isRemoving:!!n&&e(Ot).isRemoving(n),isGenerating:!!n&&e(Ot).isGenerating(n)}}),[n]),y=m.isAccepting,b=m.isRemoving,w=m.isGenerating;return n?(0,t.jsxs)("div",{className:"traffic-boost-preview-footer",children:[(0,t.jsx)("div",{className:"traffic-boost-preview-footer-previous",children:v&&(0,t.jsx)(Fe.Button,{variant:"tertiary",onClick:s,icon:At})}),!w&&(0,t.jsxs)("div",{className:"traffic-boost-preview-footer-actions",children:[!h&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(Fe.Button,{variant:"primary",onClick:function(){return r(n)},isBusy:y,disabled:y,children:y?(0,xe.__)("Accepting…","wp-parsely"):(0,xe.__)("Accept","wp-parsely")}),(0,t.jsx)(Fe.Button,{variant:"tertiary",onClick:function(){return o(n)},children:(0,xe.__)("Discard","wp-parsely")}),f&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(Dt,{size:36}),(0,t.jsx)(Fe.Button,{variant:"tertiary",onClick:p,children:(0,xe.__)("Clear changes","wp-parsely")})]})]}),h&&(0,t.jsx)(t.Fragment,{children:f?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(Fe.Button,{variant:"primary",onClick:function(){return i(n)},children:(0,xe.__)("Update Link","wp-parsely")}),(0,t.jsx)(Dt,{size:36}),(0,t.jsx)(Fe.Button,{variant:"tertiary",onClick:p,children:(0,xe.__)("Clear changes","wp-parsely")})]}):(0,t.jsx)(Fe.Button,{variant:"tertiary",onClick:function(){return l(n)},isBusy:b,disabled:b,isDestructive:!0,children:b?(0,xe.__)("Removing…","wp-parsely"):(0,xe.__)("Remove","wp-parsely")})}),!h&&(0,t.jsxs)("div",{className:"traffic-boost-preview-footer-navigation",children:[(0,xe.__)("Suggestion","wp-parsely"),(0,t.jsx)("select",{className:"traffic-boost-preview-footer-navigation-number",value:d,onChange:function(e){var t=parseInt(e.target.value,10);c(t)},children:Array.from({length:u},(function(e,n){return(0,t.jsx)("option",{value:n+1,children:n+1},n+1)}))}),(0,xe.__)("of","wp-parsely"),(0,t.jsx)("span",{className:"traffic-boost-preview-footer-navigation-number",children:u})]})]}),(0,t.jsx)("div",{className:"traffic-boost-preview-footer-next",children:g&&(0,t.jsx)(Fe.Button,{variant:"tertiary",onClick:a,icon:Rt})})]}):(0,t.jsx)(t.Fragment,{})},Mt=(0,t.jsx)(He.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,t.jsx)(He.Path,{d:"m19 7-3-3-8.5 8.5-1 4 4-1L19 7Zm-7 11.5H5V20h7v-1.5Z"})}),Bt=(0,t.jsx)(He.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,t.jsx)(He.Path,{d:"M19.5 4.5h-7V6h4.44l-5.97 5.97 1.06 1.06L18 7.06v4.44h1.5v-7Zm-13 1a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-3H17v3a.5.5 0 0 1-.5.5h-10a.5.5 0 0 1-.5-.5v-10a.5.5 0 0 1 .5-.5h3V5.5h-3Z"})}),Ut=(0,t.jsx)(He.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,t.jsx)(He.Path,{d:"M20.5 16h-.7V8c0-1.1-.9-2-2-2H6.2c-1.1 0-2 .9-2 2v8h-.7c-.8 0-1.5.7-1.5 1.5h20c0-.8-.7-1.5-1.5-1.5zM5.7 8c0-.3.2-.5.5-.5h11.6c.3 0 .5.2.5.5v7.6H5.7V8z"})}),Ft=function(e){var n=e.size,r=void 0===n?24:n,i=e.className,o=void 0===i?"wp-parsely-icon":i;return(0,t.jsxs)(Fe.SVG,{className:o,height:r,viewBox:"0 0 60 65",width:r,xmlns:"http://www.w3.org/2000/svg",children:[(0,t.jsx)(Fe.Path,{fill:"#5ba745",d:"M23.72,51.53c0-.18,0-.34-.06-.52a13.11,13.11,0,0,0-2.1-5.53A14.74,14.74,0,0,0,19.12,43c-.27-.21-.5-.11-.51.22l-.24,3.42c0,.33-.38.35-.49,0l-1.5-4.8a1.4,1.4,0,0,0-.77-.78,23.91,23.91,0,0,0-3.1-.84c-1.38-.24-3.39-.39-3.39-.39-.34,0-.45.21-.25.49l2.06,3.76c.2.27,0,.54-.29.33l-4.51-3.6a3.68,3.68,0,0,0-2.86-.48c-1,.16-2.44.46-2.44.46a.68.68,0,0,0-.39.25.73.73,0,0,0-.14.45S.41,43,.54,44a3.63,3.63,0,0,0,1.25,2.62L6.48,50c.28.2.09.49-.23.37l-4.18-.94c-.32-.12-.5,0-.4.37,0,0,.69,1.89,1.31,3.16a24,24,0,0,0,1.66,2.74,1.34,1.34,0,0,0,1,.52l5,.13c.33,0,.41.38.1.48L7.51,58c-.31.1-.34.35-.07.55a14.29,14.29,0,0,0,3.05,1.66,13.09,13.09,0,0,0,5.9.5,25.13,25.13,0,0,0,4.34-1,9.55,9.55,0,0,1-.08-1.2,9.32,9.32,0,0,1,3.07-6.91"}),(0,t.jsx)(Fe.Path,{fill:"#5ba745",d:"M59.7,41.53a.73.73,0,0,0-.14-.45.68.68,0,0,0-.39-.25s-1.43-.3-2.44-.46a3.64,3.64,0,0,0-2.86.48l-4.51,3.6c-.26.21-.49-.06-.29-.33l2.06-3.76c.2-.28.09-.49-.25-.49,0,0-2,.15-3.39.39a23.91,23.91,0,0,0-3.1.84,1.4,1.4,0,0,0-.77.78l-1.5,4.8c-.11.32-.48.3-.49,0l-.24-3.42c0-.33-.24-.43-.51-.22a14.74,14.74,0,0,0-2.44,2.47A13.11,13.11,0,0,0,36.34,51c0,.18,0,.34-.06.52a9.26,9.26,0,0,1,3,8.1,24.1,24.1,0,0,0,4.34,1,13.09,13.09,0,0,0,5.9-.5,14.29,14.29,0,0,0,3.05-1.66c.27-.2.24-.45-.07-.55l-3.22-1.17c-.31-.1-.23-.47.1-.48l5-.13a1.38,1.38,0,0,0,1-.52A24.6,24.6,0,0,0,57,52.92c.61-1.27,1.31-3.16,1.31-3.16.1-.33-.08-.49-.4-.37l-4.18.94c-.32.12-.51-.17-.23-.37l4.69-3.34A3.63,3.63,0,0,0,59.46,44c.13-1,.24-2.47.24-2.47"}),(0,t.jsx)(Fe.Path,{fill:"#5ba745",d:"M46.5,25.61c0-.53-.35-.72-.8-.43l-4.86,2.66c-.45.28-.56-.27-.23-.69l4.66-6.23a2,2,0,0,0,.28-1.68,36.51,36.51,0,0,0-2.19-4.89,34,34,0,0,0-2.81-3.94c-.33-.41-.74-.35-.91.16l-2.28,5.68c-.16.5-.6.48-.59-.05l.28-8.93a2.54,2.54,0,0,0-.66-1.64S35,4.27,33.88,3.27,30.78.69,30.78.69a1.29,1.29,0,0,0-1.54,0s-1.88,1.49-3.12,2.59-2.48,2.35-2.48,2.35A2.5,2.5,0,0,0,23,7.27l.27,8.93c0,.53-.41.55-.58.05l-2.29-5.69c-.17-.5-.57-.56-.91-.14a35.77,35.77,0,0,0-3,4.2,35.55,35.55,0,0,0-2,4.62,2,2,0,0,0,.27,1.67l4.67,6.24c.33.42.23,1-.22.69l-4.87-2.66c-.45-.29-.82-.1-.82.43a18.6,18.6,0,0,0,.83,5.07,20.16,20.16,0,0,0,5.37,7.77c3.19,3,5.93,7.8,7.45,11.08A9.6,9.6,0,0,1,30,49.09a9.31,9.31,0,0,1,2.86.45c1.52-3.28,4.26-8.11,7.44-11.09a20.46,20.46,0,0,0,5.09-7,19,19,0,0,0,1.11-5.82"}),(0,t.jsx)(Fe.Path,{fill:"#5ba745",d:"M36.12,58.44A6.12,6.12,0,1,1,30,52.32a6.11,6.11,0,0,1,6.12,6.12"})]})},Vt=function(e){try{var t=new URL(e.targetPost.guid.raw),n=new URL(window.location.href);return t.hostname!==n.hostname}catch(e){return!0}},Ht=function(e){var n=e.postLinks,r=e.onLinkTypeClick,i=e.selectedLinkType,o=(0,we.useState)(i),a=o[0],s=o[1],l=(0,we.useState)({external:0,internal:0,smart:0}),c=l[0],u=l[1],d=(0,Se.useDispatch)(Ot).setPreviewLinkType;(0,we.useEffect)((function(){s(i),d(i)}),[i,d]),(0,we.useEffect)((function(){var e={external:n.external.length,internal:n.internal.length,smart:n.smart.length};u(e)}),[n]);var p=function(e){var t=e;a===e&&(t=null),s(t),d(t),null==r||r(t)},f=function(e){return a===e};return(0,t.jsxs)("div",{className:"traffic-boost-preview-info-links",children:[(0,t.jsx)("div",{className:"traffic-boost-preview-info-links-summary",children:n.total>0?(0,t.jsx)(t.Fragment,{children:(0,xe.sprintf)(/* translators: %d: number of outbound links */ /* translators: %d: number of outbound links */ +!function(){"use strict";var e={20:function(e,t,n){var r=n(609),i=Symbol.for("react.element"),o=Symbol.for("react.fragment"),a=Object.prototype.hasOwnProperty,s=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function c(e,t,n){var r,o={},c=null,u=null;for(r in void 0!==n&&(c=""+n),void 0!==t.key&&(c=""+t.key),void 0!==t.ref&&(u=t.ref),t)a.call(t,r)&&!l.hasOwnProperty(r)&&(o[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===o[r]&&(o[r]=t[r]);return{$$typeof:i,type:e,key:c,ref:u,props:o,_owner:s.current}}t.Fragment=o,t.jsx=c,t.jsxs=c},848:function(e,t,n){e.exports=n(20)},609:function(e){e.exports=window.React}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={exports:{}};return e[r](o,o.exports,n),o.exports}n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},function(){var e,t=n(848),r=n(609),i=window.ReactDOM;function o(){return o=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}var f;function h(e,t,n){void 0===n&&(n="/");let r=N(("string"==typeof t?p(t):t).pathname||"/",n);if(null==r)return null;let i=g(e);!function(e){e.sort(((e,t)=>e.score!==t.score?t.score-e.score:function(e,t){return e.length===t.length&&e.slice(0,-1).every(((e,n)=>e===t[n]))?e[e.length-1]-t[t.length-1]:0}(e.routesMeta.map((e=>e.childrenIndex)),t.routesMeta.map((e=>e.childrenIndex)))))}(i);let o=null;for(let e=0;null==o&&e{let a={relativePath:void 0===o?e.path||"":o,caseSensitive:!0===e.caseSensitive,childrenIndex:i,route:e};a.relativePath.startsWith("/")&&(s(a.relativePath.startsWith(r),'Absolute route path "'+a.relativePath+'" nested under path "'+r+'" is not valid. An absolute child route path must start with the combined path of all its parent routes.'),a.relativePath=a.relativePath.slice(r.length));let l=I([r,a.relativePath]),c=n.concat(a);e.children&&e.children.length>0&&(s(!0!==e.index,'Index routes must not have child routes. Please remove all child routes from route path "'+l+'".'),g(e.children,t,c,l)),(null!=e.path||e.index)&&t.push({path:l,score:_(l,e.index),routesMeta:c})};return e.forEach(((e,t)=>{var n;if(""!==e.path&&null!=(n=e.path)&&n.includes("?"))for(let n of v(e.path))i(e,t,n);else i(e,t)})),t}function v(e){let t=e.split("/");if(0===t.length)return[];let[n,...r]=t,i=n.endsWith("?"),o=n.replace(/\?$/,"");if(0===r.length)return i?[o,""]:[o];let a=v(r.join("/")),s=[];return s.push(...a.map((e=>""===e?o:[o,e].join("/")))),i&&s.push(...a),s.map((t=>e.startsWith("/")&&""===t?"/":t))}!function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"}(f||(f={})),new Set(["lazy","caseSensitive","path","id","index","children"]);const m=/^:[\w-]+$/,y=3,b=2,w=1,x=10,S=-2,k=e=>"*"===e;function _(e,t){let n=e.split("/"),r=n.length;return n.some(k)&&(r+=S),t&&(r+=b),n.filter((e=>!k(e))).reduce(((e,t)=>e+(m.test(t)?y:""===t?w:x)),r)}function P(e,t){let{routesMeta:n}=e,r={},i="/",o=[];for(let e=0;e(r.push({paramName:t,isOptional:null!=n}),n?"/?([^\\/]+)?":"/([^\\/]+)")));return e.endsWith("*")?(r.push({paramName:"*"}),i+="*"===e||"/*"===e?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":""!==e&&"/"!==e&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),r]}(e.path,e.caseSensitive,e.end),i=t.match(n);if(!i)return null;let o=i[0],a=o.replace(/(.)\/+$/,"$1"),s=i.slice(1);return{params:r.reduce(((e,t,n)=>{let{paramName:r,isOptional:i}=t;if("*"===r){let e=s[n]||"";a=o.slice(0,o.length-e.length).replace(/(.)\/+$/,"$1")}const l=s[n];return e[r]=i&&!l?void 0:(l||"").replace(/%2F/g,"/"),e}),{}),pathname:o,pathnameBase:a,pattern:e}}function E(e){try{return e.split("/").map((e=>decodeURIComponent(e).replace(/\//g,"%2F"))).join("/")}catch(t){return l(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent encoding ('+t+")."),e}}function N(e,t){if("/"===t)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&"/"!==r?null:e.slice(n)||"/"}function T(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified `to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the `to."+n+'` field. Alternatively you may provide the full path as a string in and the router will parse it for you.'}function L(e,t){let n=function(e){return e.filter(((e,t)=>0===t||e.route.path&&e.route.path.length>0))}(e);return t?n.map(((t,n)=>n===e.length-1?t.pathname:t.pathnameBase)):n.map((e=>e.pathnameBase))}function C(e,t,n,r){let i;void 0===r&&(r=!1),"string"==typeof e?i=p(e):(i=o({},e),s(!i.pathname||!i.pathname.includes("?"),T("?","pathname","search",i)),s(!i.pathname||!i.pathname.includes("#"),T("#","pathname","hash",i)),s(!i.search||!i.search.includes("#"),T("#","search","hash",i)));let a,l=""===e||""===i.pathname,c=l?"/":i.pathname;if(null==c)a=n;else{let e=t.length-1;if(!r&&c.startsWith("..")){let t=c.split("/");for(;".."===t[0];)t.shift(),e-=1;i.pathname=t.join("/")}a=e>=0?t[e]:"/"}let u=function(e,t){void 0===t&&(t="/");let{pathname:n,search:r="",hash:i=""}="string"==typeof e?p(e):e,o=n?n.startsWith("/")?n:function(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach((e=>{".."===e?n.length>1&&n.pop():"."!==e&&n.push(e)})),n.length>1?n.join("/"):"/"}(n,t):t;return{pathname:o,search:A(r),hash:R(i)}}(i,a),d=c&&"/"!==c&&c.endsWith("/"),f=(l||"."===c)&&n.endsWith("/");return u.pathname.endsWith("/")||!d&&!f||(u.pathname+="/"),u}const I=e=>e.join("/").replace(/\/\/+/g,"/"),O=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),A=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",R=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:"";Error;const D=["post","put","patch","delete"],G=(new Set(D),["get",...D]);function M(){return M=Object.assign?Object.assign.bind():function(e){for(var t=1;t{n.current=!0})),r.useCallback((function(r,i){void 0===i&&(i={}),n.current&&("number"==typeof r?e.navigate(r):e.navigate(r,M({fromRouteId:t},i)))}),[e,t])}():function(){z()||s(!1);let e=r.useContext(B),{basename:t,future:n,navigator:i}=r.useContext(F),{matches:o}=r.useContext(H),{pathname:a}=q(),l=JSON.stringify(L(o,n.v7_relativeSplatPath)),c=r.useRef(!1);return K((()=>{c.current=!0})),r.useCallback((function(n,r){if(void 0===r&&(r={}),!c.current)return;if("number"==typeof n)return void i.go(n);let o=C(n,JSON.parse(l),a,"path"===r.relative);null==e&&"/"!==t&&(o.pathname="/"===o.pathname?t:I([t,o.pathname])),(r.replace?i.replace:i.push)(o,r.state,r)}),[t,i,l,a,e])}()}function Z(e,t){let{relative:n}=void 0===t?{}:t,{future:i}=r.useContext(F),{matches:o}=r.useContext(H),{pathname:a}=q(),s=JSON.stringify(L(o,i.v7_relativeSplatPath));return r.useMemo((()=>C(e,JSON.parse(s),a,"path"===n)),[e,s,a,n])}function J(t,n,i,o){z()||s(!1);let{navigator:a}=r.useContext(F),{matches:l}=r.useContext(H),c=l[l.length-1],u=c?c.params:{},d=(c&&c.pathname,c?c.pathnameBase:"/");c&&c.route;let f,g=q();if(n){var v;let e="string"==typeof n?p(n):n;"/"===d||(null==(v=e.pathname)?void 0:v.startsWith(d))||s(!1),f=e}else f=g;let m=f.pathname||"/",y=m;if("/"!==d){let e=d.replace(/^\//,"").split("/");y="/"+m.replace(/^\//,"").split("/").slice(e.length).join("/")}let b=h(t,{pathname:y}),w=function(e,t,n,i){var o;if(void 0===t&&(t=[]),void 0===n&&(n=null),void 0===i&&(i=null),null==e){var a;if(null==(a=n)||!a.errors)return null;e=n.matches}let l=e,c=null==(o=n)?void 0:o.errors;if(null!=c){let e=l.findIndex((e=>e.route.id&&(null==c?void 0:c[e.route.id])));e>=0||s(!1),l=l.slice(0,Math.min(l.length,e+1))}let u=!1,d=-1;if(n&&i&&i.v7_partialHydration)for(let e=0;e=0?l.slice(0,d+1):[l[0]];break}}}return l.reduceRight(((e,i,o)=>{let a,s=!1,p=null,f=null;var h;n&&(a=c&&i.route.id?c[i.route.id]:void 0,p=i.route.errorElement||Q,u&&(d<0&&0===o?(ie[h="route-fallback"]||(ie[h]=!0),s=!0,f=null):d===o&&(s=!0,f=i.route.hydrateFallbackElement||null)));let g=t.concat(l.slice(0,o+1)),v=()=>{let t;return t=a?p:s?f:i.route.Component?r.createElement(i.route.Component,null):i.route.element?i.route.element:e,r.createElement(ee,{match:i,routeContext:{outlet:e,matches:g,isDataRoute:null!=n},children:t})};return n&&(i.route.ErrorBoundary||i.route.errorElement||0===o)?r.createElement(X,{location:n.location,revalidation:n.revalidation,component:p,error:a,children:v(),routeContext:{outlet:null,matches:g,isDataRoute:!0}}):v()}),null)}(b&&b.map((e=>Object.assign({},e,{params:Object.assign({},u,e.params),pathname:I([d,a.encodeLocation?a.encodeLocation(e.pathname).pathname:e.pathname]),pathnameBase:"/"===e.pathnameBase?d:I([d,a.encodeLocation?a.encodeLocation(e.pathnameBase).pathname:e.pathnameBase])}))),l,i,o);return n&&w?r.createElement(V.Provider,{value:{location:M({pathname:"/",search:"",hash:"",state:null,key:"default"},f),navigationType:e.Pop}},w):w}function Y(){let e=function(){var e;let t=r.useContext(W),n=function(){let e=r.useContext(U);return e||s(!1),e}(ne.UseRouteError),i=re(ne.UseRouteError);return void 0!==t?t:null==(e=n.errors)?void 0:e[i]}(),t=function(e){return null!=e&&"number"==typeof e.status&&"string"==typeof e.statusText&&"boolean"==typeof e.internal&&"data"in e}(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return r.createElement(r.Fragment,null,r.createElement("h2",null,"Unexpected Application Error!"),r.createElement("h3",{style:{fontStyle:"italic"}},t),n?r.createElement("pre",{style:i},n):null,null)}const Q=r.createElement(Y,null);class X extends r.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||"idle"!==t.revalidation&&"idle"===e.revalidation?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:void 0!==e.error?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){console.error("React Router caught the following error during render",e,t)}render(){return void 0!==this.state.error?r.createElement(H.Provider,{value:this.props.routeContext},r.createElement(W.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function ee(e){let{routeContext:t,match:n,children:i}=e,o=r.useContext(B);return o&&o.static&&o.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=n.route.id),r.createElement(H.Provider,{value:t},i)}var te=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(te||{}),ne=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(ne||{});function re(e){let t=function(){let e=r.useContext(H);return e||s(!1),e}(),n=t.matches[t.matches.length-1];return n.route.id||s(!1),n.route.id}const ie={};function oe(e){s(!1)}function ae(t){let{basename:n="/",children:i=null,location:o,navigationType:a=e.Pop,navigator:l,static:c=!1,future:u}=t;z()&&s(!1);let d=n.replace(/^\/*/,"/"),f=r.useMemo((()=>({basename:d,navigator:l,static:c,future:M({v7_relativeSplatPath:!1},u)})),[d,u,l,c]);"string"==typeof o&&(o=p(o));let{pathname:h="/",search:g="",hash:v="",state:m=null,key:y="default"}=o,b=r.useMemo((()=>{let e=N(h,d);return null==e?null:{location:{pathname:e,search:g,hash:v,state:m,key:y},navigationType:a}}),[d,h,g,v,m,y,a]);return null==b?null:r.createElement(F.Provider,{value:f},r.createElement(V.Provider,{children:i,value:b}))}function se(e){let{children:t,location:n}=e;return J(le(t),n)}function le(e,t){void 0===t&&(t=[]);let n=[];return r.Children.forEach(e,((e,i)=>{if(!r.isValidElement(e))return;let o=[...t,i];if(e.type===r.Fragment)return void n.push.apply(n,le(e.props.children,o));e.type!==oe&&s(!1),e.props.index&&e.props.children&&s(!1);let a={id:e.props.id||o.join("-"),caseSensitive:e.props.caseSensitive,element:e.props.element,Component:e.props.Component,index:e.props.index,path:e.props.path,loader:e.props.loader,action:e.props.action,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:null!=e.props.ErrorBoundary||null!=e.props.errorElement,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(a.children=le(e.props.children,o)),n.push(a)})),n}function ce(){return ce=Object.assign?Object.assign.bind():function(e){for(var t=1;t{})),r.Component,new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);const ue=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"];try{window.__reactRouterVersion="6"}catch(e){}new Map;const de=r.startTransition;function pe(t){let{basename:n,children:i,future:f,window:h}=t,g=r.useRef();var v;null==g.current&&(g.current=(void 0===(v={window:h,v5Compat:!0})&&(v={}),function(t,n,r,i){void 0===i&&(i={});let{window:l=document.defaultView,v5Compat:p=!1}=i,f=l.history,h=e.Pop,g=null,v=m();function m(){return(f.state||{idx:null}).idx}function y(){h=e.Pop;let t=m(),n=null==t?null:t-v;v=t,g&&g({action:h,location:w.location,delta:n})}function b(e){let t="null"!==l.location.origin?l.location.origin:l.location.href,n="string"==typeof e?e:d(e);return n=n.replace(/ $/,"%20"),s(t,"No window.location.(origin|href) available to create URL for href: "+n),new URL(n,t)}null==v&&(v=0,f.replaceState(o({},f.state,{idx:v}),""));let w={get action(){return h},get location(){return t(l,f)},listen(e){if(g)throw new Error("A history only accepts one active listener");return l.addEventListener(a,y),g=e,()=>{l.removeEventListener(a,y),g=null}},createHref(e){return n(l,e)},createURL:b,encodeLocation(e){let t=b(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:function(t,n){h=e.Push;let i=u(w.location,t,n);r&&r(i,t),v=m()+1;let o=c(i,v),a=w.createHref(i);try{f.pushState(o,"",a)}catch(e){if(e instanceof DOMException&&"DataCloneError"===e.name)throw e;l.location.assign(a)}p&&g&&g({action:h,location:w.location,delta:1})},replace:function(t,n){h=e.Replace;let i=u(w.location,t,n);r&&r(i,t),v=m();let o=c(i,v),a=w.createHref(i);f.replaceState(o,"",a),p&&g&&g({action:h,location:w.location,delta:0})},go(e){return f.go(e)}};return w}((function(e,t){let{pathname:n="/",search:r="",hash:i=""}=p(e.location.hash.substr(1));return n.startsWith("/")||n.startsWith(".")||(n="/"+n),u("",{pathname:n,search:r,hash:i},t.state&&t.state.usr||null,t.state&&t.state.key||"default")}),(function(e,t){let n=e.document.querySelector("base"),r="";if(n&&n.getAttribute("href")){let t=e.location.href,n=t.indexOf("#");r=-1===n?t:t.slice(0,n)}return r+"#"+("string"==typeof t?t:d(t))}),(function(e,t){l("/"===e.pathname.charAt(0),"relative pathnames are not supported in hash history.push("+JSON.stringify(t)+")")}),v)));let m=g.current,[y,b]=r.useState({action:m.action,location:m.location}),{v7_startTransition:w}=f||{},x=r.useCallback((e=>{w&&de?de((()=>b(e))):b(e)}),[b,w]);return r.useLayoutEffect((()=>m.listen(x)),[m,x]),r.createElement(ae,{basename:n,children:i,location:y.location,navigationType:y.action,navigator:m,future:f})}i.flushSync,r.useId;const fe="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,he=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ge=r.forwardRef((function(e,t){let n,{onClick:i,relative:o,reloadDocument:a,replace:l,state:c,target:u,to:p,preventScrollReset:f,unstable_viewTransition:h}=e,g=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r=0||(i[n]=e[n]);return i}(e,ue),{basename:v}=r.useContext(F),m=!1;if("string"==typeof p&&he.test(p)&&(n=p,fe))try{let e=new URL(window.location.href),t=p.startsWith("//")?new URL(e.protocol+p):new URL(p),n=N(t.pathname,v);t.origin===e.origin&&null!=n?p=n+t.search+t.hash:m=!0}catch(e){}let y=function(e,t){let{relative:n}=void 0===t?{}:t;z()||s(!1);let{basename:i,navigator:o}=r.useContext(F),{hash:a,pathname:l,search:c}=Z(e,{relative:n}),u=l;return"/"!==i&&(u="/"===l?i:I([i,l])),o.createHref({pathname:u,search:c,hash:a})}(p,{relative:o}),b=function(e,t){let{target:n,replace:i,state:o,preventScrollReset:a,relative:s,unstable_viewTransition:l}=void 0===t?{}:t,c=$(),u=q(),p=Z(e,{relative:s});return r.useCallback((t=>{if(function(e,t){return!(0!==e.button||t&&"_self"!==t||function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e))}(t,n)){t.preventDefault();let n=void 0!==i?i:d(u)===d(p);c(e,{replace:n,state:o,preventScrollReset:a,relative:s,unstable_viewTransition:l})}}),[u,c,p,i,o,n,e,a,s,l])}(p,{replace:l,state:c,target:u,preventScrollReset:f,relative:o,unstable_viewTransition:h});return r.createElement("a",ce({},g,{href:n||y,onClick:m||a?i:function(e){i&&i(e),e.defaultPrevented||b(e)},ref:t,target:u}))}));var ve,me;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(ve||(ve={})),function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"}(me||(me={}));var ye=window.wp.domReady,be=n.n(ye),we=window.wp.element,xe=window.wp.i18n,Se=window.wp.data,ke=function(){return ke=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0?"".concat(i," ").concat(t):t)||this).hint=null,o.name=o.constructor.name,o.code=r;var a=[Oe.AccessToFeatureDisabled,Oe.ParselyApiForbidden,Oe.ParselyApiResponseContainsError,Oe.ParselyApiReturnedNoData,Oe.ParselyApiReturnedTooManyResults,Oe.PluginCredentialsNotSetMessageDetected,Oe.PluginSettingsApiSecretNotSet,Oe.PluginSettingsSiteIdNotSet,Oe.PostIsNotPublished,Oe.UnknownError,Oe.ParselySuggestionsApiAuthUnavailable,Oe.ParselySuggestionsApiNoAuthentication,Oe.ParselySuggestionsApiNoAuthorization,Oe.ParselySuggestionsApiNoData,Oe.ParselySuggestionsApiSchemaError];return o.retryFetch=!a.includes(o.code),Object.setPrototypeOf(o,n.prototype),o.code===Oe.AccessToFeatureDisabled?o.message=(0,xe.__)("Access to this feature is disabled by the site's administration.","wp-parsely"):o.code===Oe.ParselySuggestionsApiNoAuthorization?o.message=(0,xe.__)('This AI-powered feature is opt-in. To gain access, please submit a request here.',"wp-parsely"):o.code===Oe.ParselySuggestionsApiOpenAiError||o.code===Oe.ParselySuggestionsApiOpenAiUnavailable?o.message=(0,xe.__)("The Parse.ly API returned an internal server error. Please retry with a different input, or try again later.","wp-parsely"):o.code===Oe.HttpRequestFailed&&o.message.includes("cURL error 28")?o.message=(0,xe.__)("The Parse.ly API did not respond in a timely manner. Please try again later.","wp-parsely"):o.code===Oe.ParselySuggestionsApiSchemaError?o.message=(0,xe.__)("The Parse.ly API returned a validation error. Please try again with different parameters.","wp-parsely"):o.code===Oe.ParselySuggestionsApiNoData?o.message=(0,xe.__)("The Parse.ly API couldn't find any relevant data to fulfill the request. Please retry with a different input.","wp-parsely"):o.code===Oe.ParselySuggestionsApiOpenAiSchema?o.message=(0,xe.__)("The Parse.ly API returned an incorrect response. Please try again later.","wp-parsely"):o.code===Oe.ParselySuggestionsApiAuthUnavailable&&(o.message=(0,xe.__)("The Parse.ly API is currently unavailable. Please try again later.","wp-parsely")),o}return Je(n,e),n.prototype.Message=function(e){return void 0===e&&(e=null),[Oe.PluginCredentialsNotSetMessageDetected,Oe.PluginSettingsSiteIdNotSet,Oe.PluginSettingsApiSecretNotSet].includes(this.code)?Re(e):(this.code===Oe.FetchError&&(this.hint=this.Hint((0,xe.__)("This error can sometimes be caused by ad-blockers or browser tracking protections. Please add this site to any applicable allow lists and try again.","wp-parsely"))),this.code!==Oe.ParselyApiForbidden&&this.code!==Oe.ParselySuggestionsApiNoAuthentication||(this.hint=this.Hint((0,xe.__)("Please ensure that the Site ID and API Secret given in the plugin's settings are correct.","wp-parsely"))),this.code===Oe.HttpRequestFailed&&(this.hint=this.Hint((0,xe.__)("The Parse.ly API cannot be reached. Please verify that you are online.","wp-parsely"))),(0,t.jsx)(Ae,{className:null==e?void 0:e.className,testId:"error",children:"

".concat(this.message,"

").concat(this.hint?this.hint:"")}))},n.prototype.Hint=function(e){return'

'.concat((0,xe.__)("Hint:","wp-parsely")," ").concat(e,"

")},n.prototype.createErrorSnackbar=function(){//.test(this.message)||(0,Se.dispatch)("core/notices").createNotice("error",this.message,{type:"snackbar"})},n}(Error),Xe=function(){function e(){this.abortControllers=new Map}return e.prototype.cancelRequest=function(e){if(e)(t=this.abortControllers.get(e))&&(t.abort(),this.abortControllers.delete(e));else{var t,n=Array.from(this.abortControllers.keys()).pop();n&&(t=this.abortControllers.get(n))&&(t.abort(),this.abortControllers.delete(n))}},e.prototype.cancelAll=function(){this.abortControllers.forEach((function(e){return e.abort()})),this.abortControllers.clear()},e.prototype.getOrCreateController=function(e){if(e&&this.abortControllers.has(e))return{abortController:this.abortControllers.get(e),abortId:e};var t=null!=e?e:"auto-"+Date.now(),n=new AbortController;return this.abortControllers.set(t,n),{abortController:n,abortId:t}},e.prototype.fetch=function(e,t){return n=this,r=void 0,o=function(){var n,r,i,o,a,s;return function(e,t){var n,r,i,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]0&&i[i.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]i?t=i:t<1&&(t=1),r(t)},min:1,max:i,dragDirection:"e"}),(0,t.jsxs)("span",{children:[(0,xe.__)("of","wp-parsely")," ",i]})]}),(0,t.jsxs)("div",{className:"page-navigation",children:[(0,t.jsx)(Fe.Button,{icon:We,onClick:o,disabled:1===n}),(0,t.jsx)(Fe.Button,{icon:ze,onClick:a,disabled:n>=i})]})]})},ut=function(){return(0,t.jsx)(Fe.DropdownMenu,{icon:qe,label:(0,xe.__)("Actions","wp-parsely"),children:function(e){var n=e.onClose;return(0,t.jsx)(t.Fragment,{children:(0,t.jsxs)(Fe.MenuGroup,{children:[(0,t.jsx)(Fe.MenuItem,{onClick:n,children:(0,xe.__)("View","wp-parsely")}),(0,t.jsx)(Fe.MenuItem,{onClick:n,children:(0,xe.__)("Edit","wp-parsely")})]})})}})},dt=function(e){var n,r=e.query,i=void 0===r?{}:r,o=e.hideHeader,a=void 0!==o&&o,s=e.hidePagination,l=void 0!==s&&s,c=e.hideLoading,u=void 0!==c&&c,d=e.compact,p=void 0!==d&&d,f=e.noResultsMessage,h=void 0===f?(0,xe.__)("No posts found.","wp-parsely"):f,g=e.className,v=e.onPostClick,m=(0,we.useState)([]),y=m[0],b=m[1],w=(0,we.useState)(1),x=w[0],S=w[1],k=(0,we.useState)(1),_=k[0],P=k[1],j=(0,we.useState)(null!==(n=i.per_page)&&void 0!==n?n:10)[0],E=(0,we.useState)(!0),N=E[0],T=E[1],L=(0,we.useRef)(!1);(0,we.useEffect)((function(){var e,t,n,r;T(!0),e=void 0,t=void 0,r=function(){var e,t;return function(e,t){var n,r,i,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]0},getError:function(e){return e.error},getCurrentPost:function(e){return e.currentPost},getSelectedTab:function(e){return e.selectedTab},getSuggestions:function(e){return e.suggestionsTab.suggestions},getSuggestionsPage:function(e){return e.suggestionsTab.currentPage},getSuggestionsItemsPerPage:function(e){return e.suggestionsTab.itemsPerPage},getInboundLinks:function(e){return e.inboundLinksTab.links},getInboundLinksPage:function(e){return e.inboundLinksTab.currentPage},getInboundLinksItemsPerPage:function(e){return e.inboundLinksTab.itemsPerPage},isSuggestionsLoading:function(e){return e.loading.includes("suggestions")},getSelectedLink:function(e){return e.selectedLink},getPreviewLinkType:function(e){return e.preview.selectedLinkType},isFrontendPreview:function(e){return e.preview.frontendPreview},isAccepting:function(e,t){return e.acceptingLinks.includes(t.uid)},isRemoving:function(e,t){return e.removingLinks.includes(t.uid)},isGeneratingSuggestions:function(e){return e.isGeneratingSuggestions},isGenerating:function(e,t){return e.generatingLinks.includes(t.uid)}}});(0,Se.register)(Ot);var At=(0,t.jsx)(He.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,t.jsx)(He.Path,{d:"M20 11.2H6.8l3.7-3.7-1-1L3.9 12l5.6 5.5 1-1-3.7-3.7H20z"})}),Rt=(0,t.jsx)(He.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,t.jsx)(He.Path,{d:"m14.5 6.5-1 1 3.7 3.7H4v1.6h13.2l-3.7 3.7 1 1 5.6-5.5z"})}),Dt=function(e){var n=e.size,r=void 0===n?40:n;return(0,t.jsx)(Fe.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"1",height:r,viewBox:"0 0 1 ".concat(r),fill:"none",children:(0,t.jsx)(Fe.Rect,{width:"1",height:r,fill:"#cccccc"})})},Gt=function(e){var n=e.activeLink,r=e.onAccept,i=e.onUpdateLink,o=e.onDiscard,a=e.onNext,s=e.onPrevious,l=e.onRemove,c=e.onSelectIndex,u=e.totalItems,d=e.itemIndex,p=e.onRestoreOriginal,f=e.selectedText,h=!(null==n?void 0:n.isSuggestion),g=d1,m=(0,Se.useSelect)((function(e){return{isAccepting:!!n&&e(Ot).isAccepting(n),isRemoving:!!n&&e(Ot).isRemoving(n),isGenerating:!!n&&e(Ot).isGenerating(n)}}),[n]),y=m.isAccepting,b=m.isRemoving,w=m.isGenerating;return n?(0,t.jsxs)("div",{className:"traffic-boost-preview-footer",children:[(0,t.jsx)("div",{className:"traffic-boost-preview-footer-previous",children:v&&(0,t.jsx)(Fe.Button,{variant:"tertiary",onClick:s,icon:At})}),!w&&(0,t.jsxs)("div",{className:"traffic-boost-preview-footer-actions",children:[!h&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(Fe.Button,{variant:"primary",onClick:function(){return r(n)},isBusy:y,disabled:y,children:y?(0,xe.__)("Accepting…","wp-parsely"):(0,xe.__)("Accept","wp-parsely")}),(0,t.jsx)(Fe.Button,{variant:"tertiary",onClick:function(){return o(n)},children:(0,xe.__)("Discard","wp-parsely")}),f&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(Dt,{size:36}),(0,t.jsx)(Fe.Button,{variant:"tertiary",onClick:p,children:(0,xe.__)("Clear changes","wp-parsely")})]})]}),h&&(0,t.jsx)(t.Fragment,{children:f?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(Fe.Button,{variant:"primary",onClick:function(){return i(n)},children:(0,xe.__)("Update Link","wp-parsely")}),(0,t.jsx)(Dt,{size:36}),(0,t.jsx)(Fe.Button,{variant:"tertiary",onClick:p,children:(0,xe.__)("Clear changes","wp-parsely")})]}):(0,t.jsx)(Fe.Button,{variant:"tertiary",onClick:function(){return l(n)},isBusy:b,disabled:b,isDestructive:!0,children:b?(0,xe.__)("Removing…","wp-parsely"):(0,xe.__)("Remove","wp-parsely")})}),!h&&(0,t.jsxs)("div",{className:"traffic-boost-preview-footer-navigation",children:[(0,xe.__)("Suggestion","wp-parsely"),(0,t.jsx)("select",{className:"traffic-boost-preview-footer-navigation-number",value:d,onChange:function(e){var t=parseInt(e.target.value,10);c(t)},children:Array.from({length:u},(function(e,n){return(0,t.jsx)("option",{value:n+1,children:n+1},n+1)}))}),(0,xe.__)("of","wp-parsely"),(0,t.jsx)("span",{className:"traffic-boost-preview-footer-navigation-number",children:u})]})]}),(0,t.jsx)("div",{className:"traffic-boost-preview-footer-next",children:g&&(0,t.jsx)(Fe.Button,{variant:"tertiary",onClick:a,icon:Rt})})]}):(0,t.jsx)(t.Fragment,{})},Mt=(0,t.jsx)(He.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,t.jsx)(He.Path,{d:"m19 7-3-3-8.5 8.5-1 4 4-1L19 7Zm-7 11.5H5V20h7v-1.5Z"})}),Bt=(0,t.jsx)(He.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,t.jsx)(He.Path,{d:"M19.5 4.5h-7V6h4.44l-5.97 5.97 1.06 1.06L18 7.06v4.44h1.5v-7Zm-13 1a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-3H17v3a.5.5 0 0 1-.5.5h-10a.5.5 0 0 1-.5-.5v-10a.5.5 0 0 1 .5-.5h3V5.5h-3Z"})}),Ut=(0,t.jsx)(He.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,t.jsx)(He.Path,{d:"M20.5 16h-.7V8c0-1.1-.9-2-2-2H6.2c-1.1 0-2 .9-2 2v8h-.7c-.8 0-1.5.7-1.5 1.5h20c0-.8-.7-1.5-1.5-1.5zM5.7 8c0-.3.2-.5.5-.5h11.6c.3 0 .5.2.5.5v7.6H5.7V8z"})}),Ft=function(e){var n=e.size,r=void 0===n?24:n,i=e.className,o=void 0===i?"wp-parsely-icon":i;return(0,t.jsxs)(Fe.SVG,{className:o,height:r,viewBox:"0 0 60 65",width:r,xmlns:"http://www.w3.org/2000/svg",children:[(0,t.jsx)(Fe.Path,{fill:"#5ba745",d:"M23.72,51.53c0-.18,0-.34-.06-.52a13.11,13.11,0,0,0-2.1-5.53A14.74,14.74,0,0,0,19.12,43c-.27-.21-.5-.11-.51.22l-.24,3.42c0,.33-.38.35-.49,0l-1.5-4.8a1.4,1.4,0,0,0-.77-.78,23.91,23.91,0,0,0-3.1-.84c-1.38-.24-3.39-.39-3.39-.39-.34,0-.45.21-.25.49l2.06,3.76c.2.27,0,.54-.29.33l-4.51-3.6a3.68,3.68,0,0,0-2.86-.48c-1,.16-2.44.46-2.44.46a.68.68,0,0,0-.39.25.73.73,0,0,0-.14.45S.41,43,.54,44a3.63,3.63,0,0,0,1.25,2.62L6.48,50c.28.2.09.49-.23.37l-4.18-.94c-.32-.12-.5,0-.4.37,0,0,.69,1.89,1.31,3.16a24,24,0,0,0,1.66,2.74,1.34,1.34,0,0,0,1,.52l5,.13c.33,0,.41.38.1.48L7.51,58c-.31.1-.34.35-.07.55a14.29,14.29,0,0,0,3.05,1.66,13.09,13.09,0,0,0,5.9.5,25.13,25.13,0,0,0,4.34-1,9.55,9.55,0,0,1-.08-1.2,9.32,9.32,0,0,1,3.07-6.91"}),(0,t.jsx)(Fe.Path,{fill:"#5ba745",d:"M59.7,41.53a.73.73,0,0,0-.14-.45.68.68,0,0,0-.39-.25s-1.43-.3-2.44-.46a3.64,3.64,0,0,0-2.86.48l-4.51,3.6c-.26.21-.49-.06-.29-.33l2.06-3.76c.2-.28.09-.49-.25-.49,0,0-2,.15-3.39.39a23.91,23.91,0,0,0-3.1.84,1.4,1.4,0,0,0-.77.78l-1.5,4.8c-.11.32-.48.3-.49,0l-.24-3.42c0-.33-.24-.43-.51-.22a14.74,14.74,0,0,0-2.44,2.47A13.11,13.11,0,0,0,36.34,51c0,.18,0,.34-.06.52a9.26,9.26,0,0,1,3,8.1,24.1,24.1,0,0,0,4.34,1,13.09,13.09,0,0,0,5.9-.5,14.29,14.29,0,0,0,3.05-1.66c.27-.2.24-.45-.07-.55l-3.22-1.17c-.31-.1-.23-.47.1-.48l5-.13a1.38,1.38,0,0,0,1-.52A24.6,24.6,0,0,0,57,52.92c.61-1.27,1.31-3.16,1.31-3.16.1-.33-.08-.49-.4-.37l-4.18.94c-.32.12-.51-.17-.23-.37l4.69-3.34A3.63,3.63,0,0,0,59.46,44c.13-1,.24-2.47.24-2.47"}),(0,t.jsx)(Fe.Path,{fill:"#5ba745",d:"M46.5,25.61c0-.53-.35-.72-.8-.43l-4.86,2.66c-.45.28-.56-.27-.23-.69l4.66-6.23a2,2,0,0,0,.28-1.68,36.51,36.51,0,0,0-2.19-4.89,34,34,0,0,0-2.81-3.94c-.33-.41-.74-.35-.91.16l-2.28,5.68c-.16.5-.6.48-.59-.05l.28-8.93a2.54,2.54,0,0,0-.66-1.64S35,4.27,33.88,3.27,30.78.69,30.78.69a1.29,1.29,0,0,0-1.54,0s-1.88,1.49-3.12,2.59-2.48,2.35-2.48,2.35A2.5,2.5,0,0,0,23,7.27l.27,8.93c0,.53-.41.55-.58.05l-2.29-5.69c-.17-.5-.57-.56-.91-.14a35.77,35.77,0,0,0-3,4.2,35.55,35.55,0,0,0-2,4.62,2,2,0,0,0,.27,1.67l4.67,6.24c.33.42.23,1-.22.69l-4.87-2.66c-.45-.29-.82-.1-.82.43a18.6,18.6,0,0,0,.83,5.07,20.16,20.16,0,0,0,5.37,7.77c3.19,3,5.93,7.8,7.45,11.08A9.6,9.6,0,0,1,30,49.09a9.31,9.31,0,0,1,2.86.45c1.52-3.28,4.26-8.11,7.44-11.09a20.46,20.46,0,0,0,5.09-7,19,19,0,0,0,1.11-5.82"}),(0,t.jsx)(Fe.Path,{fill:"#5ba745",d:"M36.12,58.44A6.12,6.12,0,1,1,30,52.32a6.11,6.11,0,0,1,6.12,6.12"})]})},Vt=function(e){try{var t=new URL(e.targetPost.link),n=new URL(window.location.href);return t.hostname!==n.hostname}catch(e){return!0}},Ht=function(e){var t=e.querySelector(".".concat("wp-parsely-preview-marker"));return t&&t.parentElement||null},Wt=function(e){var n=e.postLinks,r=e.onLinkTypeClick,i=e.selectedLinkType,o=(0,we.useState)(i),a=o[0],s=o[1],l=(0,we.useState)({external:0,internal:0,smart:0}),c=l[0],u=l[1],d=(0,Se.useDispatch)(Ot).setPreviewLinkType;(0,we.useEffect)((function(){s(i),d(i)}),[i,d]),(0,we.useEffect)((function(){var e={external:n.external.length,internal:n.internal.length,smart:n.smart.length};u(e)}),[n]);var p=function(e){var t=e;a===e&&(t=null),s(t),d(t),null==r||r(t)},f=function(e){return a===e};return(0,t.jsxs)("div",{className:"traffic-boost-preview-info-links",children:[(0,t.jsx)("div",{className:"traffic-boost-preview-info-links-summary",children:n.total>0?(0,t.jsx)(t.Fragment,{children:(0,xe.sprintf)(/* translators: %d: number of outbound links */ /* translators: %d: number of outbound links */ (0,xe.__)("Contains %d outbound links:","wp-parsely"),n.total)}):(0,t.jsx)(t.Fragment,{children:(0,xe.__)("This post has no outbound links.","wp-parsely")})}),(0,t.jsxs)("div",{className:"traffic-boost-preview-info-links-counter",children:[c.external>0&&(0,t.jsx)(Fe.Button,{variant:"secondary",isPressed:f("external"),onClick:function(){return p("external")},children:(0,xe.sprintf)(/* translators: %d: number of outbound links */ /* translators: %d: number of outbound links */ (0,xe.__)("%d external","wp-parsely"),c.external)}),c.internal>0&&(0,t.jsx)(Fe.Button,{variant:"secondary",isPressed:f("internal"),onClick:function(){return p("internal")},children:(0,xe.sprintf)(/* translators: %d: number of internal links */ /* translators: %d: number of internal links */ (0,xe.__)("%d internal","wp-parsely"),c.internal)}),c.smart>0&&(0,t.jsx)(Fe.Button,{variant:"secondary",isPressed:f("smart"),onClick:function(){return p("smart")},children:(0,xe.sprintf)(/* translators: %d: number of smart links */ /* translators: %d: number of smart links */ -(0,xe.__)("%d smart links","wp-parsely"),c.smart)})]})]})},Wt=function(e){var n=e.post,r=e.onEditClick,i=e.onViewInNewTabClick,o=e.onViewInParseLyClick,a=function(e,t){switch(e){case"edit":r(n);break;case"view-in-new-tab":i(n);break;case"view-in-parse-ly":o(n)}t()};return(0,t.jsx)(Fe.DropdownMenu,{icon:qe,iconSize:24,label:(0,xe.__)("Actions","wp-parsely"),children:function(e){var n=e.onClose;return(0,t.jsxs)(Fe.MenuGroup,{children:[(0,t.jsx)(Fe.MenuItem,{icon:Mt,onClick:function(){return a("edit",n)},children:(0,xe.__)("Edit Post","wp-parsely")}),(0,t.jsx)(Fe.MenuItem,{icon:Bt,onClick:function(){return a("view-in-new-tab",n)},children:(0,xe.__)("View post in a new tab","wp-parsely")}),(0,t.jsx)(Fe.MenuItem,{icon:(0,t.jsx)(Ft,{}),onClick:function(){return a("view-in-parse-ly",n)},children:(0,xe.__)("View in Parse.ly","wp-parsely")})]})}})},zt=function(e){var n,r=e.activeLink,i=e.isFrontendPreview,o=e.setIsFrontendPreview,a=e.onOpenPostEditor,s=e.onOpenPostInNewTab,l=e.onOpenParselyDashboard;return(0,we.useEffect)((function(){r&&Vt(r)&&o(!1)}),[r,o]),r?(0,t.jsxs)("div",{className:"traffic-boost-preview-header",children:[(0,t.jsxs)("div",{className:"traffic-boost-preview-info",children:[(0,t.jsx)("div",{className:"traffic-boost-preview-info-title",children:null===(n=null==r?void 0:r.targetPost)||void 0===n?void 0:n.title.rendered}),(0,t.jsx)(Ht,{postLinks:r.postLinks,selectedLinkType:null})]}),(0,t.jsxs)("div",{className:"traffic-boost-preview-actions",children:[!Vt(r)&&(0,t.jsx)(Fe.Button,{icon:Ut,isPressed:i,iconSize:24,onClick:function(){o(!i)},label:(0,xe.__)("Toggle Frontend Preview","wp-parsely")}),(0,t.jsx)(Wt,{post:r.targetPost,onEditClick:a,onViewInNewTabClick:s,onViewInParseLyClick:l})]})]}):(0,t.jsx)(t.Fragment,{})},qt=function(){return(0,t.jsx)(He.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:"48",height:"48","aria-hidden":"true",focusable:"false",children:(0,t.jsx)(He.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M12.218 5.377a.25.25 0 0 0-.436 0l-7.29 12.96a.25.25 0 0 0 .218.373h14.58a.25.25 0 0 0 .218-.372l-7.29-12.96Zm-1.743-.735c.669-1.19 2.381-1.19 3.05 0l7.29 12.96a1.75 1.75 0 0 1-1.525 2.608H4.71a1.75 1.75 0 0 1-1.525-2.608l7.29-12.96ZM12.75 17.46h-1.5v-1.5h1.5v1.5Zm-1.5-3h1.5v-5h-1.5v5Z"})})},Kt=(0,t.jsx)(He.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,t.jsx)(He.Path,{d:"M12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4ZM12.75 8V13H11.25V8H12.75ZM12.75 14.5V16H11.25V14.5H12.75Z"})}),$t=function(e){var n=e.onSelect,r=e.iframeDocument,i=e.selection,o=e.onErrorClick;!function(e){(0,we.useEffect)((function(){var t=window.getComputedStyle(document.documentElement).getPropertyValue("--wp-admin-theme-color").trim(),n=e.createElement("link");n.rel="stylesheet",n.href="/wp-includes/css/dist/components/style.css",e.head.appendChild(n);var r=e.createElement("style");return r.textContent="\n\t\t\t/* Highlight styles */\n\t\t\t.parsely-traffic-boost-highlight {\n\t\t\t\tposition: absolute;\n\t\t\t\tpointer-events: none;\n\t\t\t\tz-index: 1000;\n\t\t\t\ttransition: all 0.15s ease-out;\n\t\t\t}\n\n\t\t\t/* Popover container styles */\n\t\t\t.parsely-traffic-boost-popover-container {\n\t\t\t\tposition: absolute;\n\t\t\t\tleft: 50%;\n\t\t\t\tbottom: 100%;\n\t\t\t\ttransform: translateX(-50%);\n\t\t\t\tmargin-bottom: 12px;\n\t\t\t\tz-index: 1001;\n\t\t\t\topacity: 0;\n\t\t\t\tanimation: slideUp 0.2s ease-out forwards;\n\t\t\t}\n\n\t\t\t.parsely-traffic-boost-popover-container .components-button.is-primary:focus:not(:disabled) {\n\t\t\t\tbox-shadow:none;\n\t\t\t}\n\n\t\t\t.parsely-traffic-boost-popover-container.closing {\n\t\t\t\tanimation: slideDown 0.2s ease-out forwards;\n\t\t\t}\n\n\t\t\t.parsely-traffic-boost-iframe-popover {\n\t\t\t\tpadding: 0;\n\t\t\t\tpointer-events: auto;\n\t\t\t\twhite-space: nowrap;\n\t\t\t}\n\n\t\t\t.parsely-traffic-boost-iframe-popover-button {\n\t\t\t\tbox-shadow: 0px 2px 3px 0px rgba(0, 0, 0, 0.05),\n\t\t\t\t\t0px 4px 5px 0px rgba(0, 0, 0, 0.04),\n\t\t\t\t\t0px 4px 5px 0px rgba(0, 0, 0, 0.03),\n\t\t\t\t\t0px 16px 16px 0px rgba(0, 0, 0, 0.02);\n\t\t\t\tpadding: 6px 12px;\n\t\t\t\tbackground: var(--wp-admin-theme-color, ".concat(t,");\n\t\t\t\tborder-radius: 2px;\n\t\t\t}\n\n\t\t\t.parsely-traffic-boost-iframe-popover-error {\n\t\t\t\tbackground: #000 !important;\n\t\t\t\tcolor: #fff !important;\n\t\t\t}\n\n\t\t\t/* Animation styles */\n\t\t\t@keyframes slideUp {\n\t\t\t\tfrom {\n\t\t\t\t\topacity: 0;\n\t\t\t\t\ttransform: translate(-50%, 10px);\n\t\t\t\t}\n\t\t\t\tto {\n\t\t\t\t\topacity: 1;\n\t\t\t\t\ttransform: translate(-50%, 0);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t@keyframes slideDown {\n\t\t\t\tfrom {\n\t\t\t\t\topacity: 1;\n\t\t\t\t\ttransform: translate(-50%, 0);\n\t\t\t\t}\n\t\t\t\tto {\n\t\t\t\t\topacity: 0;\n\t\t\t\t\ttransform: translate(-50%, 10px);\n\t\t\t\t}\n\t\t\t}\n\t\t"),e.head.appendChild(r),function(){n.remove(),r.remove()}}),[e])}(r);var a=(0,we.useState)(null),s=a[0],l=a[1],c=(0,we.useState)(!1),u=c[0],d=c[1],p=(0,we.useCallback)((function(e){if(e.nodeType===Node.ELEMENT_NODE){var t=e;return"A"===t.tagName||Array.from(t.children).some(p)}return!1}),[]),f=(0,we.useCallback)((function(){var e,t,n=i.getRangeAt(0).commonAncestorContainer,r=n.nodeType===Node.ELEMENT_NODE?n.closest("a"):null===(e=n.parentElement)||void 0===e?void 0:e.closest("a");return!(!r||i.isCollapsed)&&i.toString().trim()===(null===(t=r.textContent)||void 0===t?void 0:t.trim())}),[i]);return(0,we.useEffect)((function(){var e=i.getRangeAt(0).commonAncestorContainer;f()?d(!0):p(e)?l((0,xe.__)("Select text without existing links.","wp-parsely")):l(null)}),[p,f,i]),s?(0,t.jsx)("div",{className:"parsely-traffic-boost-iframe-popover",children:(0,t.jsx)(Fe.Button,{variant:"primary",className:"parsely-traffic-boost-iframe-popover-error",icon:Kt,onClick:o,children:s})}):(0,t.jsx)("div",{className:"parsely-traffic-boost-iframe-popover",children:(0,t.jsx)(Fe.Button,{variant:"primary",icon:gt,className:"parsely-traffic-boost-iframe-popover-button",onClick:n,children:u?(0,xe.__)("Replace Link","wp-parsely"):(0,xe.__)("Use as Link Text","wp-parsely")})})},Zt=function(e){var n=e.iframeRef,r=e.onTextSelected,i=(0,we.useCallback)((function(){var e,i,o,a=null===(e=n.current)||void 0===e?void 0:e.contentDocument;if(a){var s=a.getSelection(),l=a.querySelector(".parsely-traffic-boost-highlight");if(l){if(!s||s.isCollapsed){var c=l.querySelector(".parsely-traffic-boost-popover-container");return void(c?(c.classList.add("closing"),setTimeout((function(){l.remove()}),200)):l.remove())}l.remove()}if(s&&!s.isCollapsed){var u=s.getRangeAt(0),d=a.querySelector(".wp-parsely-preview-wrapper");if(null==d?void 0:d.contains(u.commonAncestorContainer)){var p=null===(i=u.startContainer.parentElement)||void 0===i?void 0:i.closest("p"),f=null===(o=u.endContainer.parentElement)||void 0===o?void 0:o.closest("p");if(p&&f&&p===f){(function(e,t){var n,r=t.commonAncestorContainer,i=r.nodeType===Node.ELEMENT_NODE?r.closest("a"):null===(n=r.parentElement)||void 0===n?void 0:n.closest("a");if(e.toString()===(null==i?void 0:i.textContent))return!0;if(i){var o=t.cloneRange();return o.selectNodeContents(i),e.removeAllRanges(),e.addRange(o),!0}return!1})(s,u)||function(e,t){for(var n,r,i=t.startContainer,o=t.endContainer,a=null!==(n=i.textContent)&&void 0!==n?n:"",s=null!==(r=o.textContent)&&void 0!==r?r:"",l=t.startOffset,c=t.endOffset,u=t.startOffset;u>0&&/[^\s.,!?;:'")\]}]/g.test(a[u-1]);)u--;for(var d=t.endOffset;d=e.start&&te.start&&r<=e.end}));if(i&&s&&i.blockParent&&s.blockParent&&i.blockParent===s.blockParent){var l=n.createRange();l.setStart(i.node,t-i.start),l.setEnd(s.node,r-s.start),a.push(l)}};null!==(o=f.exec(c));)h();return a}),[]),c=(0,we.useCallback)((function(e,n,r){var i,o,a,s,l,c,u;void 0===r&&(r=!1);try{var d=null!==(o=null===(i=t.current)||void 0===i?void 0:i.contentDocument)&&void 0!==o?o:null===(s=null===(a=t.current)||void 0===a?void 0:a.contentWindow)||void 0===s?void 0:s.document;if(!d)return;var p=e.cloneContents(),f=d.createElement("span");f.className=r?"".concat(n," previous-suggestion"):n;var h=e.commonAncestorContainer,g=h.nodeType===Node.ELEMENT_NODE?h.closest("a"):null===(l=h.parentElement)||void 0===l?void 0:l.closest("a");return g&&e.toString().trim()===(null===(c=g.textContent)||void 0===c?void 0:c.trim())&&g?(null===(u=g.parentNode)||void 0===u||u.insertBefore(f,g),f.appendChild(g)):(e.deleteContents(),f.appendChild(p),e.insertNode(f)),f}catch(e){console.error("WP Parsely: Error highlighting range",e)}}),[t]),u=(0,we.useCallback)((function(e,t,n){var r,i;void 0===n&&(n=!1);try{var o=null!==(r=e.contentDocument)&&void 0!==r?r:null===(i=e.contentWindow)||void 0===i?void 0:i.document;if(!o)return;var a=function(e,t){for(;e.firstChild;)t.insertBefore(e.firstChild,e);t.removeChild(e),t.normalize(),t.querySelectorAll("a").forEach((function(e){if(e.textContent){var n=e.nextElementSibling;if(n&&(e.href===n.href||e.getAttribute("data-smartlink")===n.getAttribute("data-smartlink")&&null!==e.getAttribute("data-smartlink"))){for(;n.firstChild;)e.appendChild(n.firstChild);t.removeChild(n)}}else t.removeChild(e)}))},s=function(e){e.querySelectorAll(t).forEach((function(e){return s(e)}));var r=e.parentNode;r&&(n?(e.classList.add("removing"),setTimeout((function(){a(e,r)}),200)):a(e,r))};o.querySelectorAll(t).forEach((function(e){var n;(null===(n=e.parentElement)||void 0===n?void 0:n.closest(t))||s(e)}))}catch(e){}}),[]),d=(0,we.useCallback)((function(e){u(e,".smart-link-highlight")}),[u]),p=(0,we.useCallback)((function(e,t,n){var r;if(e.compareBoundaryPoints(Range.END_TO_START,t)>0||e.compareBoundaryPoints(Range.START_TO_END,t)<0)c(t,n,!0),r=c(e,n);else{if(t.compareBoundaryPoints(Range.START_TO_START,e)<0){var i=t.cloneRange();i.setEnd(e.startContainer,e.startOffset),c(i,n,!0),e.setStart(i.endContainer,i.endOffset)}if(t.compareBoundaryPoints(Range.END_TO_END,e)>0){var o=t.cloneRange();o.setStart(e.endContainer,e.endOffset),c(o,n,!0)}r=c(e,n)}return r}),[c]),f=(0,we.useCallback)((function(e,t,r){if(void 0===r&&(r=0),n.current){var o=l(t,n.current,e)[r];if(o)if(null==i?void 0:i.text){var s=l(i.text,n.current,e)[i.offset];if(s){var u=p(s,o,"smart-link-highlight");u&&(u.style.cursor="pointer",u.addEventListener("click",(function(){a()})))}}else c(o,"smart-link-highlight")}}),[n,l,p,c,i,a]),h=(0,we.useCallback)((function(e,t){var o,a,s=e.querySelector('a[data-smartlink="'.concat(t,'"]'));if(s){var u=e.createRange();if(u.selectNode(s),(null==i?void 0:i.text)&&n.current){var d=l(i.text,n.current,e);if(d[i.offset]){var h=d[i.offset];return void p(h,u,"smart-link-highlight")}}c(u,"smart-link-highlight",!!i)}else(null===(o=null==r?void 0:r.smartLink)||void 0===o?void 0:o.text)&&f(e,r.smartLink.text,null!==(a=r.smartLink.offset)&&void 0!==a?a:0)}),[r,i,n,c,l,p,f]),g=(0,we.useCallback)((function(e){var t,n,i,a;try{var s=null!==(t=e.contentDocument)&&void 0!==t?t:null===(n=e.contentWindow)||void 0===n?void 0:n.document;if(!s||!(null===(i=null==r?void 0:r.smartLink)||void 0===i?void 0:i.text))return;o?h(s,r.smartLink.uid):f(s,r.smartLink.text,null!==(a=r.smartLink.offset)&&void 0!==a?a:0)}catch(e){console.error("WP Parsely: Error highlighting smart link text",e)}}),[r,h,f,o]),v=(0,we.useCallback)((function(e,t){var n,i,o=null!==(n=e.contentDocument)&&void 0!==n?n:null===(i=e.contentWindow)||void 0===i?void 0:i.document;if(o&&(u(e,".link-type-highlight",!0),r&&t)){var a=null==r?void 0:r.postLinks[t];(null==a?void 0:a.length)&&o.querySelectorAll("a").forEach((function(e){if(a.find((function(t){if(t.hasAttribute("data-smartlink"))return t.getAttribute("data-smartlink")===e.getAttribute("data-smartlink");var n=t.href===e.href,r=t.textContent===e.textContent;return n&&r}))){var t=o.createRange();t.selectNode(e),c(t,"link-type-highlight")}}))}}),[r,c,u]);return{injectHighlightStyles:s,highlightSmartLink:g,highlightLinkType:v,removeSmartLinkHighlights:d,removeHighlights:u}}({iframeRef:h,contentAreaRef:f,activeLink:a,selectedText:s,isInboundLink:g,onRestoreOriginal:c}),S=x.injectHighlightStyles,k=x.highlightSmartLink,_=x.highlightLinkType,P=x.removeSmartLinkHighlights,j=(0,we.useCallback)((function(e){var t,n;if(o){var r=null===(t=e.contentWindow)||void 0===t?void 0:t.document.getElementById("wpadminbar");r&&(r.style.display="none");var i=null===(n=e.contentWindow)||void 0===n?void 0:n.document.documentElement;i&&i.style.setProperty("margin-top","0","important")}}),[o]),E=(0,we.useCallback)((function(e){var t,n,r,i,o=null!==(t=null==e?void 0:e.contentDocument)&&void 0!==t?t:null===(n=e.contentWindow)||void 0===n?void 0:n.document;if(o){o.addEventListener("click",(function(e){var t,n,r,i,o=e.target;if(!(null===(t=f.current)||void 0===t?void 0:t.contains(o)))return e.preventDefault(),void e.stopPropagation();var a="A"===o.tagName?o:o.closest("a");if(a){if(e.preventDefault(),e.stopPropagation(),"P"!==(null===(n=o.parentElement)||void 0===n?void 0:n.tagName))return;a.blur(),null===(i=null===(r=a.ownerDocument.defaultView)||void 0===r?void 0:r.getSelection())||void 0===i||i.selectAllChildren(a)}}),!0),o.addEventListener("submit",(function(e){e.preventDefault(),e.stopPropagation()}),!0),e.contentWindow&&Object.defineProperty(e.contentWindow,"open",{value:function(){return null},writable:!1}),o.addEventListener("contextmenu",(function(e){e.preventDefault(),e.stopPropagation()}),!0);try{(null===(r=e.contentWindow)||void 0===r?void 0:r.history)&&(e.contentWindow.history.pushState=function(){},e.contentWindow.history.replaceState=function(){})}catch(e){}null===(i=e.contentWindow)||void 0===i||i.addEventListener("popstate",(function(e){e.preventDefault(),e.stopPropagation()}),!0)}}),[]),N=(0,we.useCallback)((function(e){var t,n,r=null!==(t=e.contentDocument)&&void 0!==t?t:null===(n=e.contentWindow)||void 0===n?void 0:n.document;if(r){var i=function(){return e=void 0,t=void 0,i=function(){var e;return function(e,t){var n,r,i,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]0&&i[i.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]0&&i[i.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]100&&console.warn("Parse.ly: More than 100 inbound smart links. This is not supported yet."),[2,n.data.map((function(e){return{uid:"inbound-".concat(e.id,"-").concat(Date.now()),targetPost:e,postLinks:r.populatePostLinks(e),smartLink:t.find((function(t){var n;return(null===(n=t.source)||void 0===n?void 0:n.post_id)===e.id})),isSuggestion:!1}})).filter((function(e){return void 0!==e.smartLink}))]}}))}))},t}(it),on=function(e){var n=e.post;return(0,t.jsxs)("div",{className:"traffic-boost-post-details",children:[(0,t.jsx)("div",{className:"traffic-boost-post-details-label",children:(0,xe.__)("Current Post:","wp-parsely")}),(0,t.jsxs)("div",{className:"traffic-boost-post-details-content",children:[(0,t.jsx)($e,{post:n,size:52,className:"traffic-boost-thumbnail"}),(0,t.jsx)("div",{className:"post-title",children:""!==n.title.rendered?n.title.rendered:(0,xe.__)("(no title)","wp-parsely")})]}),(0,t.jsx)("div",{className:"traffic-boost-post-details-divider"}),(0,t.jsx)("div",{className:"traffic-boost-post-details-description",children:(0,xe.__)("Use Parse.ly data to increase your post's traffic. Plant links to this post in high-performing related content.","wp-parsely")})]})},an=function(e){var n=e.onBackClick,r=e.post;return(0,t.jsxs)("div",{className:"traffic-boost-sidebar-header",children:[(0,t.jsx)("div",{className:"traffic-boost-sidebar-header-nav",children:(0,t.jsx)(Fe.Button,{icon:We,onClick:n,children:(0,xe.__)("Back","wp-parsely")})}),(0,t.jsx)("div",{className:"traffic-boost-sidebar-inner",children:(0,t.jsx)(on,{post:r})})]})},sn=(0,t.jsx)(He.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,t.jsx)(He.Path,{d:"M11.6 7l-1.1-1L5 12l5.5 6 1.1-1L7 12l4.6-5zm6 0l-1.1-1-5.5 6 5.5 6 1.1-1-4.6-5 4.6-5z"})}),ln=(0,t.jsx)(He.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,t.jsx)(He.Path,{d:"M6.6 6L5.4 7l4.5 5-4.5 5 1.1 1 5.5-6-5.4-6zm6 0l-1.1 1 4.5 5-4.5 5 1.1 1 5.5-6-5.5-6z"})}),cn=function(e){var n=e.suggestion,r=e.isActive,i=e.onClick,o=n.targetPost,a=function(){null==i||i(n)};return(0,t.jsxs)("div",{className:"traffic-boost-single-link ".concat(r?"active":""),onClick:function(e){e.preventDefault(),a()},onKeyDown:function(e){e.preventDefault(),"Enter"!==e.key&&" "!==e.key||a()},role:"button",tabIndex:0,"aria-label":(0,xe.sprintf)(/* translators: %s: Post title */ /* translators: %s: Post title */ -(0,xe.__)("Traffic boost link for %s","wp-parsely"),o.title.rendered),"aria-pressed":r,children:[(0,t.jsx)("div",{className:"single-link-thumbnail",children:(0,t.jsx)($e,{post:o,size:52,className:"traffic-boost-preview-thumbnail"})}),(0,t.jsx)("div",{className:"single-link-details",children:(0,t.jsx)("div",{className:"single-link-title",children:o.title.rendered})})]})},un=function(e){var n,r=e.children,i=e.links,o=e.onClick,a=e.activeLink,s=e.minItemsPerPage,l=void 0===s?3:s,c=e.currentPage,u=void 0===c?1:c,d=e.itemsPerPage,p=void 0===d?3:d,f=e.onPageChange,h=e.onItemsPerPageChange,g=e.renderEmptyState,v=(0,we.useState)(!1),m=v[0],y=v[1],b=(0,we.useState)([]),w=b[0],x=b[1],S=(0,we.useState)(1),k=S[0],_=S[1],P=(0,we.useState)(null!==(n=null==a?void 0:a.targetPost.id)&&void 0!==n?n:null),j=P[0],E=P[1],N=(0,we.useRef)(null),T=(0,we.useRef)(0),L=(0,we.useCallback)((function(){if(N.current){var e=N.current.clientHeight;if(e!==T.current){T.current=e;var t=e-60,n=Math.floor(t/85),r=Math.max(l,n);null==h||h(r),y(!1)}}else null==h||h(l)}),[l,h]);(0,we.useEffect)((function(){var e;E(null!==(e=null==a?void 0:a.targetPost.id)&&void 0!==e?e:null)}),[a]),(0,we.useEffect)((function(){L();var e=new ResizeObserver(L);return N.current&&e.observe(N.current),function(){e.disconnect()}}),[L]),(0,we.useEffect)((function(){var e=Math.max(1,Math.ceil(i.length/p));_(e);var t=(u-1)*p,n=t+p;x(i.slice(t,n)),e0&&(null==f||f(e))}),[u,p,i,f]),(0,we.useEffect)((function(){if(a&&i){var e=i.findIndex((function(e){return e.targetPost.id===a.targetPost.id}));if(-1!==e){var t=Math.floor(e/p)+1;null==f||f(t)}}}),[a,i,p,f]);var C=function(e){E(e.targetPost.id),null==o||o(e)};return(0,t.jsxs)("div",{className:"traffic-boost-links",ref:N,children:[m&&0===w.length?(0,t.jsx)(Fe.Spinner,{}):i.length>0&&0===w.length?null:0===w.length?g?g():(0,t.jsx)("p",{children:(0,xe.__)("No posts found.","wp-parsely")}):(0,t.jsx)("div",{className:"traffic-boost-links-list",children:w.map((function(e){var n,r;return(0,t.jsx)(cn,{suggestion:e,isActive:e.targetPost.id===j,onClick:C},e.targetPost.id+(null!==(r=null===(n=e.smartLink)||void 0===n?void 0:n.uid)&&void 0!==r?r:""))}))}),(0,t.jsxs)("div",{className:"links-pagination",children:[(0,t.jsx)("div",{className:"links-pagination-children",children:r}),i.length>p&&k>0&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"page-selector",children:[(0,t.jsx)("span",{children:(0,xe.__)("Page","wp-parsely")}),(0,t.jsx)("select",{value:u,onChange:function(e){return function(e){if(e){var t=parseInt(e,10);t>k?t=k:t<1&&(t=1),null==f||f(t)}}(e.target.value)},children:Array.from({length:Math.max(1,k)},(function(e,t){return t+1})).map((function(e){return(0,t.jsx)("option",{value:e,children:e},e)}))}),(0,t.jsxs)("span",{children:[(0,xe.__)("of","wp-parsely")," ",k]})]}),(0,t.jsxs)("div",{className:"page-navigation",children:[(0,t.jsx)(Fe.Button,{icon:sn,onClick:function(){null==f||f(Math.max(u-1,1))},disabled:u<=1}),(0,t.jsx)(Fe.Button,{icon:ln,onClick:function(){null==f||f(Math.min(u+1,k))},disabled:u>=k})]})]})]})]})},dn=function(e){var n=e.onInboundLinkClick,r=(0,Se.useSelect)((function(e){return{selectedLink:e(Ot).getSelectedLink(),inboundLinks:e(Ot).getInboundLinks(),currentPage:e(Ot).getInboundLinksPage(),itemsPerPage:e(Ot).getInboundLinksItemsPerPage()}}),[]),i=r.selectedLink,o=r.inboundLinks,a=r.currentPage,s=r.itemsPerPage,l=(0,Se.useDispatch)(Ot),c=l.setInboundLinksItemsPerPage,u=l.setInboundLinksPage;return(0,t.jsx)(un,{links:o,onClick:n,activeLink:(null==i?void 0:i.isSuggestion)?null:i,currentPage:a,itemsPerPage:s,onPageChange:u,onItemsPerPageChange:c})},pn=(0,t.jsx)(He.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,t.jsx)(He.Path,{d:"m11.3 17.2-5-5c-.1-.1-.1-.3 0-.4l2.3-2.3-1.1-1-2.3 2.3c-.7.7-.7 1.8 0 2.5l5 5H7.5v1.5h5.3v-5.2h-1.5v2.6zm7.5-6.4-5-5h2.7V4.2h-5.2v5.2h1.5V6.8l5 5c.1.1.1.3 0 .4l-2.3 2.3 1.1 1.1 2.3-2.3c.6-.7.6-1.9-.1-2.5z"})}),fn=(0,t.jsx)(He.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,t.jsx)(He.Path,{d:"M11 12.5V17.5H12.5V12.5H17.5V11H12.5V6H11V11H6V12.5H11Z"})}),hn=function(e){var n=e.disabled,r=e.onPostClick,i=e.suggestions,o=(0,we.useState)(""),a=o[0],s=o[1],l=(0,we.useRef)(null),c=(0,kt.useDebounce)(s,300),u=(0,we.useState)([]),d=u[0],p=u[1];return(0,we.useEffect)((function(){i.length>0&&p(i.map((function(e){return e.targetPost.id})))}),[i]),(0,t.jsx)(Fe.Dropdown,{contentClassName:"wp-parsely-traffic-boost-add-new-link-popover",onClose:function(){s("")},renderToggle:function(e){var r=e.isOpen,i=e.onToggle;return(0,t.jsx)(Fe.Button,{icon:fn,variant:"secondary",className:"traffic-boost-add-suggestion",onClick:i,isPressed:r,disabled:n,children:(0,xe.__)("Add","wp-parsely")})},popoverProps:{placement:"bottom-start"},renderContent:function(e){var n=e.onClose;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{children:(0,xe.__)("Manually add a post where you would like Parse.ly to plant a link.","wp-parsely")}),(0,t.jsx)("div",{children:(0,t.jsx)(Fe.SearchControl,{__nextHasNoMarginBottom:!0,ref:l,value:a,onChange:c})}),a&&(0,t.jsx)(dt,{className:"traffic-boost-add-link-table",query:{status:"publish",per_page:5,search:a,search_columns:["post_title","post_excerpt"],exclude:d},hideHeader:!0,hidePagination:!0,hideLoading:!0,compact:!0,noResultsMessage:(0,xe.__)("No posts found.","wp-parsely"),onPostClick:function(e){r(e),n()}})]})}})},gn=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))},vn=function(e,t){var n,r,i,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]0&&i[i.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]0?y(t.data[0]):y(null),[3,4];case 2:return n=r.sent(),v(n),console.error(n),[3,4];case 3:return m(!1),c(!0),[7];case 4:return[2]}}))}))}),[e,m,y,v,p]),(0,we.useEffect)((function(){return function(){y(null),b(null)}}),[y,b]),(0,we.useEffect)((function(){!l||d||f||n("/traffic-boost")}),[l,d,f,n]),(0,we.useEffect)((function(){f&&Sn(void 0,void 0,void 0,(function(){var e,t;return kn(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,3,4]),m(!0,"inbound_links"),[4,rn.getInstance().getInboundLinks(f.id)];case 1:return e=(e=n.sent()).filter((function(e){var t;return(null===(t=e.targetPost)||void 0===t?void 0:t.id)!==f.id})),e=e.filter((function(e){var t,n;return"post"===(null===(n=null===(t=e.smartLink)||void 0===t?void 0:t.source)||void 0===n?void 0:n.post_type)})),w(e),[3,4];case 2:return t=n.sent(),v(t),console.error(t),[3,4];case 3:return m(!1,"inbound_links"),[7];case 4:return[2]}}))}))}),[p,f,w,v,m]),(0,we.useEffect)((function(){f&&Sn(void 0,void 0,void 0,(function(){var e,t;return kn(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,3,4]),m(!0,"suggestions"),[4,rn.getInstance().generateBoostLinks(f.id)];case 1:return e=n.sent(),x(e),[3,4];case 2:return t=n.sent(),v(t),console.error(t),[3,4];case 3:return m(!1,"suggestions"),[7];case 4:return[2]}}))}))}),[p,f,v,m,x]),(0,t.jsxs)(Be,{name:"traffic-boost-single-post",backgroundColor:o,children:[(0,t.jsx)("style",{children:"\n\t\t\t\t\t#wpfooter {\n\t\t\t\t\t\tdisplay: none;\n\t\t\t\t\t}\n\t\t\t\t\t#wpbody-content {\n\t\t\t\t\t\tpadding-bottom: 0 !important;\n\t\t\t\t\t}\n\t\t\t\t"}),(0,t.jsx)(xn,{isLoading:d,onLinkClick:function(e){b(e)}}),h&&(0,t.jsx)(Xt,{activeLink:h,onAccept:function(e){return Sn(void 0,void 0,void 0,(function(){return kn(this,(function(t){switch(t.label){case 0:return[4,rn.getInstance().acceptSuggestion(e)];case 1:return[2,t.sent()]}}))}))},onRemoveInboundLink:function(e){return Sn(void 0,void 0,void 0,(function(){return kn(this,(function(t){switch(t.label){case 0:return[4,rn.getInstance().removeInboundLink(e)];case 1:return t.sent(),[2]}}))}))}})]})};be()((function(){(0,we.createRoot)(document.getElementById("parsely-dashboard-page")).render((0,t.jsx)(pe,{children:(0,t.jsx)(jn,{})}))}));var jn=function(){var e=q();return(0,we.useEffect)((function(){var e=document.querySelector("#toplevel_page_parsely-dashboard-page .wp-submenu li a.wp-first-item");e&&e.setAttribute("href",window.location.pathname+window.location.search+"#/")}),[]),(0,we.useEffect)((function(){document.querySelectorAll("#toplevel_page_parsely-dashboard-page .wp-submenu li").forEach((function(t){var n,r=t.querySelector("a"),i=null===(n=null==r?void 0:r.getAttribute("href"))||void 0===n?void 0:n.split("#")[1];e.pathname.split("/")[1]===(null==i?void 0:i.split("/")[1])||i===e.pathname?(t.classList.add("current"),null==r||r.blur()):t.classList.remove("current")}))}),[e]),(0,t.jsxs)(se,{children:[(0,t.jsx)(oe,{path:"/",element:(0,t.jsx)(St,{})}),(0,t.jsx)(oe,{path:"/traffic-boost",element:(0,t.jsx)(_t,{})}),(0,t.jsx)(oe,{path:"/traffic-boost/:postId",element:(0,t.jsx)(Pn,{})}),(0,t.jsx)(oe,{path:"/settings",element:(0,t.jsx)(Pt,{})})]})}}()}(); \ No newline at end of file +(0,xe.__)("%d smart links","wp-parsely"),c.smart)})]})]})},zt=function(e){var n=e.post,r=e.onEditClick,i=e.onViewInNewTabClick,o=e.onViewInParseLyClick,a=function(e,t){switch(e){case"edit":r(n);break;case"view-in-new-tab":i(n);break;case"view-in-parse-ly":o(n)}t()};return(0,t.jsx)(Fe.DropdownMenu,{icon:qe,iconSize:24,label:(0,xe.__)("Actions","wp-parsely"),children:function(e){var n=e.onClose;return(0,t.jsxs)(Fe.MenuGroup,{children:[(0,t.jsx)(Fe.MenuItem,{icon:Mt,onClick:function(){return a("edit",n)},children:(0,xe.__)("Edit Post","wp-parsely")}),(0,t.jsx)(Fe.MenuItem,{icon:Bt,onClick:function(){return a("view-in-new-tab",n)},children:(0,xe.__)("View post in a new tab","wp-parsely")}),(0,t.jsx)(Fe.MenuItem,{icon:(0,t.jsx)(Ft,{}),onClick:function(){return a("view-in-parse-ly",n)},children:(0,xe.__)("View in Parse.ly","wp-parsely")})]})}})},qt=function(e){var n,r=e.activeLink,i=e.isFrontendPreview,o=e.setIsFrontendPreview,a=e.onOpenPostEditor,s=e.onOpenPostInNewTab,l=e.onOpenParselyDashboard;return(0,we.useEffect)((function(){r&&Vt(r)&&o(!1)}),[r,o]),r?(0,t.jsxs)("div",{className:"traffic-boost-preview-header",children:[(0,t.jsxs)("div",{className:"traffic-boost-preview-info",children:[(0,t.jsx)("div",{className:"traffic-boost-preview-info-title",children:null===(n=null==r?void 0:r.targetPost)||void 0===n?void 0:n.title.rendered}),(0,t.jsx)(Wt,{postLinks:r.postLinks,selectedLinkType:null})]}),(0,t.jsxs)("div",{className:"traffic-boost-preview-actions",children:[!Vt(r)&&(0,t.jsx)(Fe.Button,{icon:Ut,isPressed:i,iconSize:24,onClick:function(){o(!i)},label:(0,xe.__)("Toggle Frontend Preview","wp-parsely")}),(0,t.jsx)(zt,{post:r.targetPost,onEditClick:a,onViewInNewTabClick:s,onViewInParseLyClick:l})]})]}):(0,t.jsx)(t.Fragment,{})},Kt=function(){return(0,t.jsx)(He.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:"48",height:"48","aria-hidden":"true",focusable:"false",children:(0,t.jsx)(He.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M12.218 5.377a.25.25 0 0 0-.436 0l-7.29 12.96a.25.25 0 0 0 .218.373h14.58a.25.25 0 0 0 .218-.372l-7.29-12.96Zm-1.743-.735c.669-1.19 2.381-1.19 3.05 0l7.29 12.96a1.75 1.75 0 0 1-1.525 2.608H4.71a1.75 1.75 0 0 1-1.525-2.608l7.29-12.96ZM12.75 17.46h-1.5v-1.5h1.5v1.5Zm-1.5-3h1.5v-5h-1.5v5Z"})})},$t=(0,t.jsx)(He.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,t.jsx)(He.Path,{d:"M12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4ZM12.75 8V13H11.25V8H12.75ZM12.75 14.5V16H11.25V14.5H12.75Z"})}),Zt=function(e){var n=e.onSelect,r=e.iframeDocument,i=e.selection,o=e.onErrorClick;!function(e){(0,we.useEffect)((function(){var t=window.getComputedStyle(document.documentElement).getPropertyValue("--wp-admin-theme-color").trim(),n=e.createElement("link");n.rel="stylesheet",n.href="/wp-includes/css/dist/components/style.css",e.head.appendChild(n);var r=e.createElement("style");return r.textContent="\n\t\t\t/* Highlight styles */\n\t\t\t.parsely-traffic-boost-highlight {\n\t\t\t\tposition: absolute;\n\t\t\t\tpointer-events: none;\n\t\t\t\tz-index: 1000;\n\t\t\t\ttransition: all 0.15s ease-out;\n\t\t\t}\n\n\t\t\t/* Popover container styles */\n\t\t\t.parsely-traffic-boost-popover-container {\n\t\t\t\tposition: absolute;\n\t\t\t\tleft: 50%;\n\t\t\t\tbottom: 100%;\n\t\t\t\ttransform: translateX(-50%);\n\t\t\t\tmargin-bottom: 12px;\n\t\t\t\tz-index: 1001;\n\t\t\t\topacity: 0;\n\t\t\t\tanimation: slideUp 0.2s ease-out forwards;\n\t\t\t}\n\n\t\t\t.parsely-traffic-boost-popover-container .components-button.is-primary:focus:not(:disabled) {\n\t\t\t\tbox-shadow:none;\n\t\t\t}\n\n\t\t\t.parsely-traffic-boost-popover-container.closing {\n\t\t\t\tanimation: slideDown 0.2s ease-out forwards;\n\t\t\t}\n\n\t\t\t.parsely-traffic-boost-iframe-popover {\n\t\t\t\tpadding: 0;\n\t\t\t\tpointer-events: auto;\n\t\t\t\twhite-space: nowrap;\n\t\t\t}\n\n\t\t\t.parsely-traffic-boost-iframe-popover-button {\n\t\t\t\tbox-shadow: 0px 2px 3px 0px rgba(0, 0, 0, 0.05),\n\t\t\t\t\t0px 4px 5px 0px rgba(0, 0, 0, 0.04),\n\t\t\t\t\t0px 4px 5px 0px rgba(0, 0, 0, 0.03),\n\t\t\t\t\t0px 16px 16px 0px rgba(0, 0, 0, 0.02);\n\t\t\t\tpadding: 6px 12px;\n\t\t\t\tbackground: var(--wp-admin-theme-color, ".concat(t,");\n\t\t\t\tborder-radius: 2px;\n\t\t\t}\n\n\t\t\t.parsely-traffic-boost-iframe-popover-error {\n\t\t\t\tbackground: #000 !important;\n\t\t\t\tcolor: #fff !important;\n\t\t\t}\n\n\t\t\t/* Animation styles */\n\t\t\t@keyframes slideUp {\n\t\t\t\tfrom {\n\t\t\t\t\topacity: 0;\n\t\t\t\t\ttransform: translate(-50%, 10px);\n\t\t\t\t}\n\t\t\t\tto {\n\t\t\t\t\topacity: 1;\n\t\t\t\t\ttransform: translate(-50%, 0);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t@keyframes slideDown {\n\t\t\t\tfrom {\n\t\t\t\t\topacity: 1;\n\t\t\t\t\ttransform: translate(-50%, 0);\n\t\t\t\t}\n\t\t\t\tto {\n\t\t\t\t\topacity: 0;\n\t\t\t\t\ttransform: translate(-50%, 10px);\n\t\t\t\t}\n\t\t\t}\n\t\t"),e.head.appendChild(r),function(){n.remove(),r.remove()}}),[e])}(r);var a=(0,we.useState)(null),s=a[0],l=a[1],c=(0,we.useState)(!1),u=c[0],d=c[1],p=(0,we.useCallback)((function(e){if(e.nodeType===Node.ELEMENT_NODE){var t=e;return"A"===t.tagName||Array.from(t.children).some(p)}return!1}),[]),f=(0,we.useCallback)((function(){var e,t,n=i.getRangeAt(0).commonAncestorContainer,r=n.nodeType===Node.ELEMENT_NODE?n.closest("a"):null===(e=n.parentElement)||void 0===e?void 0:e.closest("a");return!(!r||i.isCollapsed)&&i.toString().trim()===(null===(t=r.textContent)||void 0===t?void 0:t.trim())}),[i]);return(0,we.useEffect)((function(){var e=i.getRangeAt(0).commonAncestorContainer;f()?d(!0):p(e)?l((0,xe.__)("Select text without existing links.","wp-parsely")):l(null)}),[p,f,i]),s?(0,t.jsx)("div",{className:"parsely-traffic-boost-iframe-popover",children:(0,t.jsx)(Fe.Button,{variant:"primary",className:"parsely-traffic-boost-iframe-popover-error",icon:$t,onClick:o,children:s})}):(0,t.jsx)("div",{className:"parsely-traffic-boost-iframe-popover",children:(0,t.jsx)(Fe.Button,{variant:"primary",icon:gt,className:"parsely-traffic-boost-iframe-popover-button",onClick:n,children:u?(0,xe.__)("Replace Link","wp-parsely"):(0,xe.__)("Use as Link Text","wp-parsely")})})},Jt=function(e){var n=e.iframeRef,r=e.onTextSelected,i=(0,we.useCallback)((function(){var e,i,o,a=null===(e=n.current)||void 0===e?void 0:e.contentDocument;if(a){var s=a.getSelection(),l=a.querySelector(".parsely-traffic-boost-highlight");if(l){if(!s||s.isCollapsed){var c=l.querySelector(".parsely-traffic-boost-popover-container");return void(c?(c.classList.add("closing"),setTimeout((function(){l.remove()}),200)):l.remove())}l.remove()}if(s&&!s.isCollapsed){var u=Ht(a);if(u){var d=s.getRangeAt(0);if(u.contains(d.commonAncestorContainer)){var p=null===(i=d.startContainer.parentElement)||void 0===i?void 0:i.closest("p"),f=null===(o=d.endContainer.parentElement)||void 0===o?void 0:o.closest("p");if(p&&f&&p===f){(function(e,t){var n,r=t.commonAncestorContainer,i=r.nodeType===Node.ELEMENT_NODE?r.closest("a"):null===(n=r.parentElement)||void 0===n?void 0:n.closest("a");if(e.toString()===(null==i?void 0:i.textContent))return!0;if(i){var o=t.cloneRange();return o.selectNodeContents(i),e.removeAllRanges(),e.addRange(o),!0}return!1})(s,d)||function(e,t){for(var n,r,i=t.startContainer,o=t.endContainer,a=null!==(n=i.textContent)&&void 0!==n?n:"",s=null!==(r=o.textContent)&&void 0!==r?r:"",l=t.startOffset,c=t.endOffset,u=t.startOffset;u>0&&/[^\s.,!?;:'")\]}]/g.test(a[u-1]);)u--;for(var d=t.endOffset;d=e.start&&te.start&&r<=e.end}));if(i&&s&&i.blockParent&&s.blockParent&&i.blockParent===s.blockParent){var l=n.createRange();l.setStart(i.node,t-i.start),l.setEnd(s.node,r-s.start),a.push(l)}};null!==(o=f.exec(c));)h();return a}),[]),c=(0,we.useCallback)((function(e,n,r){var i,o,a,s,l,c,u;void 0===r&&(r=!1);try{var d=null!==(o=null===(i=t.current)||void 0===i?void 0:i.contentDocument)&&void 0!==o?o:null===(s=null===(a=t.current)||void 0===a?void 0:a.contentWindow)||void 0===s?void 0:s.document;if(!d)return;var p=e.cloneContents(),f=d.createElement("span");f.className=r?"".concat(n," previous-suggestion"):n;var h=e.commonAncestorContainer,g=h.nodeType===Node.ELEMENT_NODE?h.closest("a"):null===(l=h.parentElement)||void 0===l?void 0:l.closest("a");return g&&e.toString().trim()===(null===(c=g.textContent)||void 0===c?void 0:c.trim())&&g?(null===(u=g.parentNode)||void 0===u||u.insertBefore(f,g),f.appendChild(g)):(e.deleteContents(),f.appendChild(p),e.insertNode(f)),f}catch(e){console.error("WP Parsely: Error highlighting range",e)}}),[t]),u=(0,we.useCallback)((function(e,t,n){var r,i;void 0===n&&(n=!1);try{var o=null!==(r=e.contentDocument)&&void 0!==r?r:null===(i=e.contentWindow)||void 0===i?void 0:i.document;if(!o)return;var a=function(e,t){for(;e.firstChild;)t.insertBefore(e.firstChild,e);t.removeChild(e),t.normalize(),t.querySelectorAll("a").forEach((function(e){if(e.textContent){var n=e.nextElementSibling;if(n&&(e.href===n.href||e.getAttribute("data-smartlink")===n.getAttribute("data-smartlink")&&null!==e.getAttribute("data-smartlink"))){for(;n.firstChild;)e.appendChild(n.firstChild);t.removeChild(n)}}else t.removeChild(e)}))},s=function(e){e.querySelectorAll(t).forEach((function(e){return s(e)}));var r=e.parentNode;r&&(n?(e.classList.add("removing"),setTimeout((function(){a(e,r)}),200)):a(e,r))};o.querySelectorAll(t).forEach((function(e){var n;(null===(n=e.parentElement)||void 0===n?void 0:n.closest(t))||s(e)}))}catch(e){}}),[]),d=(0,we.useCallback)((function(e){u(e,".smart-link-highlight")}),[u]),p=(0,we.useCallback)((function(e,t,n){var r;if(e.compareBoundaryPoints(Range.END_TO_START,t)>0||e.compareBoundaryPoints(Range.START_TO_END,t)<0)c(t,n,!0),r=c(e,n);else{if(t.compareBoundaryPoints(Range.START_TO_START,e)<0){var i=t.cloneRange();i.setEnd(e.startContainer,e.startOffset),c(i,n,!0),e.setStart(i.endContainer,i.endOffset)}if(t.compareBoundaryPoints(Range.END_TO_END,e)>0){var o=t.cloneRange();o.setStart(e.endContainer,e.endOffset),c(o,n,!0)}r=c(e,n)}return r}),[c]),f=(0,we.useCallback)((function(e,t,r){if(void 0===r&&(r=0),n.current){var o=l(t,n.current,e)[r];if(o)if(null==i?void 0:i.text){var s=l(i.text,n.current,e)[i.offset];if(s){var u=p(s,o,"smart-link-highlight");u&&(u.style.cursor="pointer",u.addEventListener("click",(function(){a()})))}}else c(o,"smart-link-highlight")}}),[n,l,p,c,i,a]),h=(0,we.useCallback)((function(e,t){var o,a,s=e.querySelector('a[data-smartlink="'.concat(t,'"]'));if(s){var u=e.createRange();if(u.selectNode(s),(null==i?void 0:i.text)&&n.current){var d=l(i.text,n.current,e);if(d[i.offset]){var h=d[i.offset];return void p(h,u,"smart-link-highlight")}}c(u,"smart-link-highlight",!!i)}else(null===(o=null==r?void 0:r.smartLink)||void 0===o?void 0:o.text)&&f(e,r.smartLink.text,null!==(a=r.smartLink.offset)&&void 0!==a?a:0)}),[r,i,n,c,l,p,f]),g=(0,we.useCallback)((function(e){var t,n,i,a;try{var s=null!==(t=e.contentDocument)&&void 0!==t?t:null===(n=e.contentWindow)||void 0===n?void 0:n.document;if(!s||!(null===(i=null==r?void 0:r.smartLink)||void 0===i?void 0:i.text))return;o?h(s,r.smartLink.uid):f(s,r.smartLink.text,null!==(a=r.smartLink.offset)&&void 0!==a?a:0)}catch(e){console.error("WP Parsely: Error highlighting smart link text",e)}}),[r,h,f,o]),v=(0,we.useCallback)((function(e,t){var n,i,o=null!==(n=e.contentDocument)&&void 0!==n?n:null===(i=e.contentWindow)||void 0===i?void 0:i.document;if(o&&(u(e,".link-type-highlight",!0),r&&t)){var a=null==r?void 0:r.postLinks[t];(null==a?void 0:a.length)&&o.querySelectorAll("a").forEach((function(e){if(a.find((function(t){if(t.hasAttribute("data-smartlink"))return t.getAttribute("data-smartlink")===e.getAttribute("data-smartlink");var n=t.href===e.href,r=t.textContent===e.textContent;return n&&r}))){var t=o.createRange();t.selectNode(e),c(t,"link-type-highlight")}}))}}),[r,c,u]);return{injectHighlightStyles:s,highlightSmartLink:g,highlightLinkType:v,removeSmartLinkHighlights:d,removeHighlights:u}}({iframeRef:h,contentAreaRef:f,activeLink:a,selectedText:s,isInboundLink:g,onRestoreOriginal:c}),S=x.injectHighlightStyles,k=x.highlightSmartLink,_=x.highlightLinkType,P=x.removeSmartLinkHighlights,j=(0,we.useCallback)((function(e){var t,n;if(o){var r=null===(t=e.contentWindow)||void 0===t?void 0:t.document.getElementById("wpadminbar");r&&(r.style.display="none");var i=null===(n=e.contentWindow)||void 0===n?void 0:n.document.documentElement;i&&i.style.setProperty("margin-top","0","important")}}),[o]),E=(0,we.useCallback)((function(e){var t,n,r,i,o=null!==(t=null==e?void 0:e.contentDocument)&&void 0!==t?t:null===(n=e.contentWindow)||void 0===n?void 0:n.document;if(o){o.addEventListener("click",(function(e){var t,n,r,i,o=e.target;if(!(null===(t=f.current)||void 0===t?void 0:t.contains(o)))return e.preventDefault(),void e.stopPropagation();var a="A"===o.tagName?o:o.closest("a");if(a){if(e.preventDefault(),e.stopPropagation(),"P"!==(null===(n=o.parentElement)||void 0===n?void 0:n.tagName))return;a.blur(),null===(i=null===(r=a.ownerDocument.defaultView)||void 0===r?void 0:r.getSelection())||void 0===i||i.selectAllChildren(a)}}),!0),o.addEventListener("submit",(function(e){e.preventDefault(),e.stopPropagation()}),!0),e.contentWindow&&Object.defineProperty(e.contentWindow,"open",{value:function(){return null},writable:!1}),o.addEventListener("contextmenu",(function(e){e.preventDefault(),e.stopPropagation()}),!0);try{(null===(r=e.contentWindow)||void 0===r?void 0:r.history)&&(e.contentWindow.history.pushState=function(){},e.contentWindow.history.replaceState=function(){})}catch(e){}null===(i=e.contentWindow)||void 0===i||i.addEventListener("popstate",(function(e){e.preventDefault(),e.stopPropagation()}),!0)}}),[]),N=(0,we.useCallback)((function(e){var t,n,r=null!==(t=e.contentDocument)&&void 0!==t?t:null===(n=e.contentWindow)||void 0===n?void 0:n.document;if(r){var i=function(){return e=void 0,t=void 0,i=function(){var e;return function(e,t){var n,r,i,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]0&&i[i.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]0&&i[i.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]100&&console.warn("Parse.ly: More than 100 inbound smart links. This is not supported yet."),[2,n.data.map((function(e){return{uid:"inbound-".concat(e.id,"-").concat(Date.now()),targetPost:e,postLinks:r.populatePostLinks(e),smartLink:t.find((function(t){var n;return(null===(n=t.source)||void 0===n?void 0:n.post_id)===e.id})),isSuggestion:!1}})).filter((function(e){return void 0!==e.smartLink}))]}}))}))},t}(it),an=function(e){var n=e.post;return(0,t.jsxs)("div",{className:"traffic-boost-post-details",children:[(0,t.jsx)("div",{className:"traffic-boost-post-details-label",children:(0,xe.__)("Current Post:","wp-parsely")}),(0,t.jsxs)("div",{className:"traffic-boost-post-details-content",children:[(0,t.jsx)($e,{post:n,size:52,className:"traffic-boost-thumbnail"}),(0,t.jsx)("div",{className:"post-title",children:""!==n.title.rendered?n.title.rendered:(0,xe.__)("(no title)","wp-parsely")})]}),(0,t.jsx)("div",{className:"traffic-boost-post-details-divider"}),(0,t.jsx)("div",{className:"traffic-boost-post-details-description",children:(0,xe.__)("Use Parse.ly data to increase your post's traffic. Plant links to this post in high-performing related content.","wp-parsely")})]})},sn=function(e){var n=e.onBackClick,r=e.post;return(0,t.jsxs)("div",{className:"traffic-boost-sidebar-header",children:[(0,t.jsx)("div",{className:"traffic-boost-sidebar-header-nav",children:(0,t.jsx)(Fe.Button,{icon:We,onClick:n,children:(0,xe.__)("Back","wp-parsely")})}),(0,t.jsx)("div",{className:"traffic-boost-sidebar-inner",children:(0,t.jsx)(an,{post:r})})]})},ln=(0,t.jsx)(He.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,t.jsx)(He.Path,{d:"M11.6 7l-1.1-1L5 12l5.5 6 1.1-1L7 12l4.6-5zm6 0l-1.1-1-5.5 6 5.5 6 1.1-1-4.6-5 4.6-5z"})}),cn=(0,t.jsx)(He.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,t.jsx)(He.Path,{d:"M6.6 6L5.4 7l4.5 5-4.5 5 1.1 1 5.5-6-5.4-6zm6 0l-1.1 1 4.5 5-4.5 5 1.1 1 5.5-6-5.5-6z"})}),un=function(e){var n=e.suggestion,r=e.isActive,i=e.onClick,o=n.targetPost,a=function(){null==i||i(n)};return(0,t.jsxs)("div",{className:"traffic-boost-single-link ".concat(r?"active":""),onClick:function(e){e.preventDefault(),a()},onKeyDown:function(e){e.preventDefault(),"Enter"!==e.key&&" "!==e.key||a()},role:"button",tabIndex:0,"aria-label":(0,xe.sprintf)(/* translators: %s: Post title */ /* translators: %s: Post title */ +(0,xe.__)("Traffic boost link for %s","wp-parsely"),o.title.rendered),"aria-pressed":r,children:[(0,t.jsx)("div",{className:"single-link-thumbnail",children:(0,t.jsx)($e,{post:o,size:52,className:"traffic-boost-preview-thumbnail"})}),(0,t.jsx)("div",{className:"single-link-details",children:(0,t.jsx)("div",{className:"single-link-title",children:o.title.rendered})})]})},dn=function(e){var n,r=e.children,i=e.links,o=e.onClick,a=e.activeLink,s=e.minItemsPerPage,l=void 0===s?3:s,c=e.currentPage,u=void 0===c?1:c,d=e.itemsPerPage,p=void 0===d?3:d,f=e.onPageChange,h=e.onItemsPerPageChange,g=e.renderEmptyState,v=(0,we.useState)(!1),m=v[0],y=v[1],b=(0,we.useState)([]),w=b[0],x=b[1],S=(0,we.useState)(1),k=S[0],_=S[1],P=(0,we.useState)(null!==(n=null==a?void 0:a.targetPost.id)&&void 0!==n?n:null),j=P[0],E=P[1],N=(0,we.useRef)(null),T=(0,we.useRef)(0),L=(0,we.useCallback)((function(){if(N.current){var e=N.current.clientHeight;if(e!==T.current){T.current=e;var t=e-60,n=Math.floor(t/85),r=Math.max(l,n);null==h||h(r),y(!1)}}else null==h||h(l)}),[l,h]);(0,we.useEffect)((function(){var e;E(null!==(e=null==a?void 0:a.targetPost.id)&&void 0!==e?e:null)}),[a]),(0,we.useEffect)((function(){L();var e=new ResizeObserver(L);return N.current&&e.observe(N.current),function(){e.disconnect()}}),[L]),(0,we.useEffect)((function(){var e=Math.max(1,Math.ceil(i.length/p));_(e);var t=(u-1)*p,n=t+p;x(i.slice(t,n)),e0&&(null==f||f(e))}),[u,p,i,f]),(0,we.useEffect)((function(){if(a&&i){var e=i.findIndex((function(e){return e.targetPost.id===a.targetPost.id}));if(-1!==e){var t=Math.floor(e/p)+1;null==f||f(t)}}}),[a,i,p,f]);var C=function(e){E(e.targetPost.id),null==o||o(e)};return(0,t.jsxs)("div",{className:"traffic-boost-links",ref:N,children:[m&&0===w.length?(0,t.jsx)(Fe.Spinner,{}):i.length>0&&0===w.length?null:0===w.length?g?g():(0,t.jsx)("p",{children:(0,xe.__)("No posts found.","wp-parsely")}):(0,t.jsx)("div",{className:"traffic-boost-links-list",children:w.map((function(e){var n,r;return(0,t.jsx)(un,{suggestion:e,isActive:e.targetPost.id===j,onClick:C},e.targetPost.id+(null!==(r=null===(n=e.smartLink)||void 0===n?void 0:n.uid)&&void 0!==r?r:""))}))}),(0,t.jsxs)("div",{className:"links-pagination",children:[(0,t.jsx)("div",{className:"links-pagination-children",children:r}),i.length>p&&k>0&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"page-selector",children:[(0,t.jsx)("span",{children:(0,xe.__)("Page","wp-parsely")}),(0,t.jsx)("select",{value:u,onChange:function(e){return function(e){if(e){var t=parseInt(e,10);t>k?t=k:t<1&&(t=1),null==f||f(t)}}(e.target.value)},children:Array.from({length:Math.max(1,k)},(function(e,t){return t+1})).map((function(e){return(0,t.jsx)("option",{value:e,children:e},e)}))}),(0,t.jsxs)("span",{children:[(0,xe.__)("of","wp-parsely")," ",k]})]}),(0,t.jsxs)("div",{className:"page-navigation",children:[(0,t.jsx)(Fe.Button,{icon:ln,onClick:function(){null==f||f(Math.max(u-1,1))},disabled:u<=1}),(0,t.jsx)(Fe.Button,{icon:cn,onClick:function(){null==f||f(Math.min(u+1,k))},disabled:u>=k})]})]})]})]})},pn=function(e){var n=e.onInboundLinkClick,r=(0,Se.useSelect)((function(e){return{selectedLink:e(Ot).getSelectedLink(),inboundLinks:e(Ot).getInboundLinks(),currentPage:e(Ot).getInboundLinksPage(),itemsPerPage:e(Ot).getInboundLinksItemsPerPage()}}),[]),i=r.selectedLink,o=r.inboundLinks,a=r.currentPage,s=r.itemsPerPage,l=(0,Se.useDispatch)(Ot),c=l.setInboundLinksItemsPerPage,u=l.setInboundLinksPage;return(0,t.jsx)(dn,{links:o,onClick:n,activeLink:(null==i?void 0:i.isSuggestion)?null:i,currentPage:a,itemsPerPage:s,onPageChange:u,onItemsPerPageChange:c})},fn=(0,t.jsx)(He.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,t.jsx)(He.Path,{d:"m11.3 17.2-5-5c-.1-.1-.1-.3 0-.4l2.3-2.3-1.1-1-2.3 2.3c-.7.7-.7 1.8 0 2.5l5 5H7.5v1.5h5.3v-5.2h-1.5v2.6zm7.5-6.4-5-5h2.7V4.2h-5.2v5.2h1.5V6.8l5 5c.1.1.1.3 0 .4l-2.3 2.3 1.1 1.1 2.3-2.3c.6-.7.6-1.9-.1-2.5z"})}),hn=(0,t.jsx)(He.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,t.jsx)(He.Path,{d:"M11 12.5V17.5H12.5V12.5H17.5V11H12.5V6H11V11H6V12.5H11Z"})}),gn=function(e){var n=e.disabled,r=e.onPostClick,i=e.suggestions,o=(0,we.useState)(""),a=o[0],s=o[1],l=(0,we.useRef)(null),c=(0,kt.useDebounce)(s,300),u=(0,we.useState)([]),d=u[0],p=u[1];return(0,we.useEffect)((function(){i.length>0&&p(i.map((function(e){return e.targetPost.id})))}),[i]),(0,t.jsx)(Fe.Dropdown,{contentClassName:"wp-parsely-traffic-boost-add-new-link-popover",onClose:function(){s("")},renderToggle:function(e){var r=e.isOpen,i=e.onToggle;return(0,t.jsx)(Fe.Button,{icon:hn,variant:"secondary",className:"traffic-boost-add-suggestion",onClick:i,isPressed:r,disabled:n,children:(0,xe.__)("Add","wp-parsely")})},popoverProps:{placement:"bottom-start"},renderContent:function(e){var n=e.onClose;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{children:(0,xe.__)("Manually add a post where you would like Parse.ly to plant a link.","wp-parsely")}),(0,t.jsx)("div",{children:(0,t.jsx)(Fe.SearchControl,{__nextHasNoMarginBottom:!0,ref:l,value:a,onChange:c})}),a&&(0,t.jsx)(dt,{className:"traffic-boost-add-link-table",query:{status:"publish",per_page:5,search:a,search_columns:["post_title","post_excerpt"],exclude:d},hideHeader:!0,hidePagination:!0,hideLoading:!0,compact:!0,noResultsMessage:(0,xe.__)("No posts found.","wp-parsely"),onPostClick:function(e){r(e),n()}})]})}})},vn=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))},mn=function(e,t){var n,r,i,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]0&&i[i.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]0?y(t.data[0]):y(null),[3,4];case 2:return n=r.sent(),v(n),console.error(n),[3,4];case 3:return m(!1),c(!0),[7];case 4:return[2]}}))}))}),[e,m,y,v,p]),(0,we.useEffect)((function(){return function(){y(null),b(null)}}),[y,b]),(0,we.useEffect)((function(){!l||d||f||n("/traffic-boost")}),[l,d,f,n]),(0,we.useEffect)((function(){f&&kn(void 0,void 0,void 0,(function(){var e,t;return Pn(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,3,4]),m(!0,"inbound_links"),[4,on.getInstance().getInboundLinks(f.id)];case 1:return e=(e=n.sent()).filter((function(e){var t;return(null===(t=e.targetPost)||void 0===t?void 0:t.id)!==f.id})),e=e.filter((function(e){var t,n;return"post"===(null===(n=null===(t=e.smartLink)||void 0===t?void 0:t.source)||void 0===n?void 0:n.post_type)})),w(e),[3,4];case 2:return t=n.sent(),v(t),console.error(t),[3,4];case 3:return m(!1,"inbound_links"),[7];case 4:return[2]}}))}))}),[p,f,w,v,m]),(0,we.useEffect)((function(){f&&kn(void 0,void 0,void 0,(function(){var e,t;return Pn(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,3,4]),m(!0,"suggestions"),[4,on.getInstance().generateBoostLinks(f.id)];case 1:return e=n.sent(),x(e),[3,4];case 2:return t=n.sent(),v(t),console.error(t),[3,4];case 3:return m(!1,"suggestions"),[7];case 4:return[2]}}))}))}),[p,f,v,m,x]),(0,t.jsxs)(Be,{name:"traffic-boost-single-post",backgroundColor:o,children:[(0,t.jsx)("style",{children:"\n\t\t\t\t\t#wpfooter {\n\t\t\t\t\t\tdisplay: none;\n\t\t\t\t\t}\n\t\t\t\t\t#wpbody-content {\n\t\t\t\t\t\tpadding-bottom: 0 !important;\n\t\t\t\t\t}\n\t\t\t\t"}),(0,t.jsx)(Sn,{isLoading:d,onLinkClick:function(e){b(e)}}),h&&(0,t.jsx)(en,{activeLink:h,onAccept:function(e){return kn(void 0,void 0,void 0,(function(){return Pn(this,(function(t){switch(t.label){case 0:return[4,on.getInstance().acceptSuggestion(e)];case 1:return[2,t.sent()]}}))}))},onRemoveInboundLink:function(e){return kn(void 0,void 0,void 0,(function(){return Pn(this,(function(t){switch(t.label){case 0:return[4,on.getInstance().removeInboundLink(e)];case 1:return t.sent(),[2]}}))}))}})]})};be()((function(){(0,we.createRoot)(document.getElementById("parsely-dashboard-page")).render((0,t.jsx)(pe,{children:(0,t.jsx)(En,{})}))}));var En=function(){var e=q();return(0,we.useEffect)((function(){var e=document.querySelector("#toplevel_page_parsely-dashboard-page .wp-submenu li a.wp-first-item");e&&e.setAttribute("href",window.location.pathname+window.location.search+"#/")}),[]),(0,we.useEffect)((function(){document.querySelectorAll("#toplevel_page_parsely-dashboard-page .wp-submenu li").forEach((function(t){var n,r=t.querySelector("a"),i=null===(n=null==r?void 0:r.getAttribute("href"))||void 0===n?void 0:n.split("#")[1];e.pathname.split("/")[1]===(null==i?void 0:i.split("/")[1])||i===e.pathname?(t.classList.add("current"),null==r||r.blur()):t.classList.remove("current")}))}),[e]),(0,t.jsxs)(se,{children:[(0,t.jsx)(oe,{path:"/",element:(0,t.jsx)(St,{})}),(0,t.jsx)(oe,{path:"/traffic-boost",element:(0,t.jsx)(_t,{})}),(0,t.jsx)(oe,{path:"/traffic-boost/:postId",element:(0,t.jsx)(jn,{})}),(0,t.jsx)(oe,{path:"/settings",element:(0,t.jsx)(Pt,{})})]})}}()}(); \ No newline at end of file diff --git a/src/UI/class-dashboard-page.php b/src/UI/class-dashboard-page.php index 57396c411..c24468162 100644 --- a/src/UI/class-dashboard-page.php +++ b/src/UI/class-dashboard-page.php @@ -132,7 +132,8 @@ public function add_parsely_preview_wrapper( string $content ): string { return $content; } - return '
' . $content . '
'; + // Add a marker class to the content container and add the wrapper as a sibling. + return $content . '
'; } /** diff --git a/src/content-helper/common/base-wordpress-provider.tsx b/src/content-helper/common/base-wordpress-provider.tsx index d9a68ded5..d949b42ed 100644 --- a/src/content-helper/common/base-wordpress-provider.tsx +++ b/src/content-helper/common/base-wordpress-provider.tsx @@ -67,6 +67,7 @@ export interface Post extends CorePost { * @since 3.18.0 */ export type HydratedPost = Omit & { + link: string; author: User | null; categories: Taxonomy[]; tags: Taxonomy[]; diff --git a/src/content-helper/dashboard-page/pages/traffic-boost/preview/components/link-options-panel.tsx b/src/content-helper/dashboard-page/pages/traffic-boost/preview/components/link-options-panel.tsx index bac11e93a..8c3125078 100644 --- a/src/content-helper/dashboard-page/pages/traffic-boost/preview/components/link-options-panel.tsx +++ b/src/content-helper/dashboard-page/pages/traffic-boost/preview/components/link-options-panel.tsx @@ -117,7 +117,7 @@ export const LinkOptionsPanel = ( { {} } // Disabled, so no need for implementation /> diff --git a/src/content-helper/dashboard-page/pages/traffic-boost/preview/components/preview-iframe.tsx b/src/content-helper/dashboard-page/pages/traffic-boost/preview/components/preview-iframe.tsx index 810851d6d..a18402620 100644 --- a/src/content-helper/dashboard-page/pages/traffic-boost/preview/components/preview-iframe.tsx +++ b/src/content-helper/dashboard-page/pages/traffic-boost/preview/components/preview-iframe.tsx @@ -15,7 +15,7 @@ import { TrafficBoostLink } from '../../provider'; import { TrafficBoostStore } from '../../store'; import { useIframeHighlight } from '../hooks/use-iframe-highlight'; import { TextSelection } from '../preview'; -import { isExternalURL } from '../utils'; +import { getContentArea, isExternalURL } from '../utils'; import { TextSelectionTooltip } from './text-selection-tooltip'; /** @@ -242,16 +242,20 @@ export const PreviewIframe = ( { }; const observer = new MutationObserver( watchForHighlightedElement ); - observer.observe( iframeDocument.querySelector( '.wp-parsely-preview-wrapper' ) as Element, { - childList: true, - subtree: true, - } ); + const contentArea = getContentArea( iframeDocument ); - // Try to scroll to the highlighted element immediately. - scrollToHighlightedElement(); + if ( contentArea ) { + observer.observe( contentArea, { + childList: true, + subtree: true, + } ); - // Disconnect the observer after a short delay to prevent infinite observation. - setTimeout( () => observer.disconnect(), 1000 ); + // Try to scroll to the highlighted element immediately. + scrollToHighlightedElement(); + + // Disconnect the observer after a short delay to prevent infinite observation. + setTimeout( () => observer.disconnect(), 1000 ); + } }, [] ); /** @@ -269,7 +273,7 @@ export const PreviewIframe = ( { injectHighlightStyles( iframe ); // Updates the content area ref to the iframe's content area. - const contentArea = iframe.contentWindow?.document.querySelector( '.wp-parsely-preview-wrapper' ); + const contentArea = getContentArea( iframe.contentDocument ); if ( contentArea ) { contentAreaRef.current = contentArea; } diff --git a/src/content-helper/dashboard-page/pages/traffic-boost/preview/components/text-selection-tooltip.tsx b/src/content-helper/dashboard-page/pages/traffic-boost/preview/components/text-selection-tooltip.tsx index 0aa9c4d63..a0673c8f5 100644 --- a/src/content-helper/dashboard-page/pages/traffic-boost/preview/components/text-selection-tooltip.tsx +++ b/src/content-helper/dashboard-page/pages/traffic-boost/preview/components/text-selection-tooltip.tsx @@ -6,6 +6,7 @@ import { debounce } from '@wordpress/compose'; import { createRoot, useCallback, useEffect, useState } from '@wordpress/element'; import { __ } from '@wordpress/i18n'; import { link, warning } from '@wordpress/icons'; +import { getContentArea } from '../utils'; /** * Custom hook to inject styles into the iframe. @@ -401,11 +402,16 @@ export const TextSelectionTooltip = ( { return; } + // Get the content area. + const contentArea = getContentArea( iframeDocument ); + if ( ! contentArea ) { + return; + } + const range = docSelection.getRangeAt( 0 ); - const previewWrapper = iframeDocument.querySelector( '.wp-parsely-preview-wrapper' ); - // Check if selection is within preview wrapper. - if ( ! previewWrapper?.contains( range.commonAncestorContainer ) ) { + // Check if selection is within content area. + if ( ! contentArea.contains( range.commonAncestorContainer ) ) { return; } @@ -450,7 +456,7 @@ export const TextSelectionTooltip = ( { onSelect={ () => { popoverContainer.classList.add( 'closing' ); - const offset = calculateOffset( iframeDocument, docSelection, previewWrapper ); + const offset = calculateOffset( iframeDocument, docSelection, contentArea ); onTextSelected( docSelection.toString().trim(), offset ); docSelection.removeAllRanges(); @@ -478,7 +484,7 @@ export const TextSelectionTooltip = ( { }; updatePosition(); - previewWrapper.appendChild( highlight ); + contentArea.appendChild( highlight ); // Add scroll event listener. const scrollHandler = () => { diff --git a/src/content-helper/dashboard-page/pages/traffic-boost/preview/preview-post.php b/src/content-helper/dashboard-page/pages/traffic-boost/preview/preview-post.php index b5ac9dd48..978ac7c0a 100644 --- a/src/content-helper/dashboard-page/pages/traffic-boost/preview/preview-post.php +++ b/src/content-helper/dashboard-page/pages/traffic-boost/preview/preview-post.php @@ -40,9 +40,6 @@ a { cursor: pointer !important; } - .wp-parsely-preview-wrapper { - padding-bottom: 46px; - }