PageSourceSearch

https://www.enchantingtravels.com/wp-content/themes/enchanting/dis…/load-more/index.js?ver=2026.09.23.04

js enchantingtravels.com collected 2026-09-24 19:40:47 UTC 2,997 bytes, 1 lines download raw bytes

1(()=>{"use strict";const{customElements:t,HTMLElement:e,fetchPartial:n}=window;t.define("et-load-more",class extends e{constructor(){var t,e,n,i,s,o;super(),this.initialElementCount=0,this.recurringElementSelector=null,this.announcementResetDelay=1e3,this.url=null!==(n=null===(e=null===(t=window.et)||void 0===t?void 0:t.fetchPartial)||void 0===e?void 0:e.url)&&void 0!==n?n:"",this.partialName=this.getAttribute("partial"),this.itemsContainerSelector=this.getAttribute("selector");try{this.payload=JSON.parse(this.getAttribute("payload")||"{}")}catch(t){this.payload={}}this.nextPage=null!==(s=null===(i=this.payload)||void 0===i?void 0:i.page)&&void 0!==s?s:0,this.loadMoreButton=this.querySelector(".load-more__load-more-button"),this.itemsContainer=this.itemsContainerSelector?this.querySelector(this.itemsContainerSelector):null,this.loadingAnnouncement=this.querySelector(".load-more__announcement--loading"),this.resultsAnnouncement=this.querySelector(".load-more__announcement--results"),null===(o=this.loadMoreButton)||void 0===o||o.addEventListener("click",this.fetchPosts.bind(this))}fetchPosts(){if(this.itemsContainer&&(this.recurringElementSelector=this.getRecurringElement(this.itemsContainer.innerHTML),this.recurringElementSelector)){const t=this.itemsContainer.querySelectorAll(this.recurringElementSelector);this.initialElementCount=t.length;const n=t[t.length-1];n&&n instanceof e&&(n.setAttribute("tabindex","-1"),n.focus())}this.setAttribute("loading","true"),this.setAttribute("aria-busy","true"),this.loadingAnnouncement&&this.loadingAnnouncement.announce(),n(this.partialName,{selectedFilters:Object.assign(Object.assign({},this.payload),{page:this.nextPage}),base_url:this.url},this.updateResults.bind(this),this.itemsContainerSelector).catch(()=>{this.setAttribute("loading","false"),this.loadingAnnouncement&&this.loadingAnnouncement.reset()})}getRecurringElement(t){const e=(new DOMParser).parseFromString(t,"text/html"),n=new Set,i=e.body.querySelectorAll("article, section");for(const t of i){const e=t.tagName.toLowerCase();if(n.has(e))return e;n.add(e)}return null}updateResults(t){var n;if(this.setAttribute("loading","false"),this.setAttribute("aria-busy","false"),this.loadingAnnouncement&&this.loadingAnnouncement.reset(),this.itemsContainer&&t.markup){if(this.itemsContainer.innerHTML+=t.markup,this.recurringElementSelector){const t=this.itemsContainer.querySelectorAll(this.recurringElementSelector),n=t[this.initialElementCount];n&&n instanceof e&&(n.setAttribute("tabindex","-1"),n.focus()),this.resultsAnnouncement&&(this.resultsAnnouncement.announce(t.length-this.initialElementCount+" items added."),this.initialElementCount=t.length,setTimeout(()=>{var t;null===(t=this.resultsAnnouncement)||void 0===t||t.reset()},this.announcementResetDelay))}void 0!==t.data.nextPage&&void 0!==t.data.page&&t.data.page>t.data.nextPage&&(null===(n=this.loadMoreButton)||void 0===n||n.setAttribute("active","false")),this.nextPage=Number(t.data.nextPage)||0}}})})();

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.