PageSourceSearch

https://www.bhg.com.au/wp-content/plugins/aremedia-keywords/dist/frontend.js?ver=e878b9062e78f83e4220

js bhg.com.au collected 2026-10-02 03:21:03 UTC 4,122 bytes, 1 lines download raw bytes

1(()=>{"use strict";const e=async(e,o={},t={})=>{var n,r;const a=`${e}?${new URLSearchParams(o).toString()}`,d=await fetch(a,{method:"GET",headers:Object.assign(Object.assign({},t),{"X-WP-Nonce":null===(n=null===window||void 0===window?void 0:window.amKeywordsVars)||void 0===n?void 0:n.nonce,"Access-Key":null===(r=null===window||void 0===window?void 0:window.amKeywordsVars)||void 0===r?void 0:r.accessKey,"Content-Type":"application/json"})});return{data:await d.json(),header:d.headers}};var o;const t="/wp-json/"+((null===(o=null===window||void 0===window?void 0:window.amKeywordsVars)||void 0===o?void 0:o.pluginRoute)||"am-keywords/v1"),n=[{method:"GET",name:"post_url",prefix:"/wp-json/wp/v2/posts"},{method:"GET",name:"post_types",prefix:"/wp-json/wp/v2/types"},{method:"GET",name:"dynamic_post_type_url",prefix:"/wp-json/wp/v2/<post_type>"},{method:"GET",name:"admin_edit_url",prefix:"/wp-admin/post.php?post=<post_id>&action=edit"},{method:"POST",name:"keywords_update",prefix:t+"/update-keyword"},{method:"POST",name:"exclusion_update",prefix:t+"/update-exclusion"},{method:"GET",name:"keywords_list",prefix:t+"/get-all-keywords"},{method:"GET",name:"exclusion_list",prefix:t+"/get-all-exclusions"},{method:"GET",name:"keywords_post_type",prefix:t+"/get-keywords"},{method:"GET",name:"get_exclusion_post_id",prefix:t+"/get-exclusion/<post_id>"},{method:"GET",name:"keywords_delete",prefix:t+"/delete-keyword"},{method:"GET",name:"exclusion_delete",prefix:t+"/delete-exclusion"},{method:"GET",name:"coauthor_search",prefix:"/wp-json/coauthors/v1/search"},{method:"GET",name:"custom_search_url",prefix:t+"/custom-search/<post_type>"}],r=[{siteName:"Current",url:window.location.origin},{siteName:"Now to love",url:"https://www.nowtolove.com.au/"},{siteName:"Elle",url:"https://www.elle.com.au/"},{siteName:"BHG",url:"https://www.bhg.com.au/"},{siteName:"Marie Claire",url:"https://www.marieclaire.com.au/"}],a=e=>new RegExp(`\\b${e}(?=[.,!?:; ])?\\b`,"g"),d=(()=>{let e=!1;return(o,t,n)=>{"true"===new URLSearchParams(window.location.search).get("am_keyword_debug")&&(e||(console.log("%cDebug mode is enabled","color: green","Aremedia Keywords Plugin"),e=!0),Array.isArray(o)?console.table(o):n?console.error(o,t):console.log(o,t))}})(),i=(e,o=null)=>{o&&e.forEach(e=>{const{keyword:t,productReplace:n,productLink:r,action:i}=e,s=r?`<a href="${r}" target="_blank">${n}</a>`:n,l=a(t);d("Processing keyword",t),d("Found Keyword",((e,o)=>{const t=a(o),n=e.match(t);return n?n.length:0})(o.innerHTML,t));const c=e=>{var o;if(e.nodeType===Node.TEXT_NODE){if(e.textContent){let n;switch(i){case"prepend":n=e.textContent.replace(l,`${s} ${t}`);break;case"append":n=e.textContent.replace(l,`${t} ${s}`);break;case"replace":n=e.textContent.replace(l,s);break;default:d("Unknown action",i,!0)}if(n&&n!==e.textContent){const t=document.createElement("span");for(t.innerHTML=n;t.firstChild;)null===(o=e.parentNode)||void 0===o||o.insertBefore(t.firstChild,e);e.remove()}}}else e.childNodes.forEach(c)};o.childNodes.forEach(c)})};(()=>{const o=(()=>{const e=r.find(e=>"Current"===e.siteName);return e?e.url:window.location.origin})();window.processKeywordsUnique=async(t,r)=>{const a=document.getElementById(t);if(d("Processing keywords for div ",t),a&&r){d("Div id class ",a.className);const t=100,s=((e,o)=>{const t=n.find(e=>"keywords_post_type"===e.name);return o+(null==t?void 0:t.prefix)})(0,o),l=`${s}/${r}`;let c=await e(l,{page:1,per_page:t,orderby:"id",order:"desc"});const{data:w={}}=c||{},{data:p=[],totalCount:u=100}=w||{},m=Math.ceil(u/t);d("Processing page ",1),d(p),i(p,a);for(let o=2;o<=m;o++){c=await e(l,{page:o,per_page:t,orderby:"id",order:"desc"});const{data:n={}}=c||{},{data:r=[]}=n||{};d("Processing page "+o),d(r),i(r,a)}}},document.addEventListener("DOMContentLoaded",async()=>{var e,o;const t=(null===(e=null===window||void 0===window?void 0:window.amKeywordsVars)||void 0===e?void 0:e.divId)||"am_keyword_product_mention_wrapper",n=(null===(o=null===window||void 0===window?void 0:window.amKeywordsVars)||void 0===o?void 0:o.postType)||null;t&&n&&await window.processKeywordsUnique(t,n)})})()})();

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.