PageSourceSearch

https://www.averys.com/_next/static/chunks/6276-d2328d83915555e9.js

js averys.com collected 2026-10-02 12:47:26 UTC 6,102 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6276],{24990:(t,e,n)=>{n.d(e,{H:()=>h});var i=n(67652),r=n(48298),s=n(16471),a=n.n(s);class o{constructor(t){this._clients={},this.DEFAULT_CONTENT_DEPTH=10,this.UNRESOLVED_LINK={},this.contentfulOrchestrations={},this.isLink=t=>t?.sys?.type==="Link",this.isResourceLink=t=>t?.sys?.type==="ResourceLink";let e=(0,r.createClient)({space:t.space,environment:t.environment,accessToken:t.accessToken,host:t.host});this._clients.primary=e,this.createOrchestrationClients(t)}get clients(){return this._clients}get primaryClient(){return this._clients.primary}createOrchestrationClients(t){if(!t.contentfulOrchestration)return;let e=t.contentfulOrchestration.split(",");this.contentfulOrchestrations=e.reduce((t,e)=>{let[n,i]=e.split(":");return Object.assign(t,{[n]:i})},this.contentfulOrchestrations)}getClient(t,e){let n=this._clients[t+e];if(!n){let i=this.contentfulOrchestrations[t];if(!i)return null;n=(0,r.createClient)({space:t,environment:e,accessToken:i}
1),this._clients[t+e]=n}return n}getIdsFromUrn(t){let e=/.*:spaces\/([^/]+)(?:\/environments\/([^/]+))?\/entries\/([^/]+)$/;if(!e.test(t))return;let[n,i,r="master",s]=e.exec(t)||[];return{spaceId:i,environmentId:r,entryId:s}}makeEntryObject(t,e){return Array.isArray(e)?Object.keys(t).filter(t=>e.includes(t)).reduce((e,n)=>(e[n]=t[n],e),{}):t}cleanUpLinks(t){if(Array.isArray(t))return t.filter(t=>t&&t!==this.UNRESOLVED_LINK);for(let e in t)t[e]===this.UNRESOLVED_LINK&&delete t[e];return t}async lookupInEntityMap(t){let e,{entryId:n,spaceId:i,environmentId:r}=t,s=this.getClient(i,r);return s&&(e=await s?.withoutUnresolvableLinks.getEntries({"sys.id":n,include:this.DEFAULT_CONTENT_DEPTH})),e?.items[0]}async normalizeLink(t){let{type:e,linkType:n}=t.sys;if("ResourceLink"===e){let{urn:e}=t.sys,{spaceId:i,environmentId:r,entryId:s}=this.getIdsFromUrn(e),[,a]=n.split(":");return this.lookupInEntityMap({linkType:a,entryId:s,spaceId:i,environmentId:r})}return t}async walkMutate(t,e){if(this.isResourceLink(t))return e(t);if(t&&"object"==typeof t){let n=Object.keys(t);await Promise.all(n.map(async n=>{if(t.hasOwnProperty(n)){if(t[n].sys&&this.isLink(t[n])&&t[n].sys?.linkType==="Entry"){t[n]=this.UNRESOLVED_LINK;return}t[n]=await this.walkMutate(t[n],e)}}))}return this.cleanUpLinks(t)}async resolveContentfulResponse(t){if(!t.items||0===t.items.length)return t;let e=await Promise.all(t.items.map(async t=>{let e=this.makeEntryObject(t,["fields"]),n=await this.walkMutate(e,async t=>this.normalizeLink(t));return{...t,...n}}));return{...t,items:e}}async fetchContentEntries(t){if(a()(this.contentfulOrchestrations))return this.primaryClient.withoutUnresolvableLinks.getEntries(t);let e=await this.primaryClient.getEntries(t);return this.resolveContentfulResponse(e)}async fetchSiteConfig(){try{let t=await this.fetchContentEntries({content_type:"site",include:this.DEFAULT_CONTENT_DEPTH});return 0===t.items.length&&i.vF.error("Site item not found in this space and environment"),t.items.length>1&&i.vF.error("More than 1 Site item found. Using first",JSON.stringify(t.items,null,2)),t.items[0]}catch(t){i.vF.error("Error",t)}}async fetchContentPage(t){try{let e=await this.fetchContentEntries({content_type:"contentPage",include:this.DEFAULT_CONTENT_DEPTH,...t});return 0===e.items.length&&i.vF.info("Contentful - No Content Page found for",t),e.items}catch(t){i.vF.error("Error",t)}}async fetchLandingPage(t){try{let e=await this.fetchContentEntries({content_type:"landingPage",include:this.DEFAULT_CONTENT_DEPTH,...t});return 0===e.items.length&&i.vF.error(`ContentPage item not found: '${t}'`),e.items}catch(t){i.vF.error("Error",t)}}}var l=n(88850);let c=t=>{let e=new o(t),n=e.primaryClient,r=e=>t.isPreview?e:(0,l.V)(e);return{fetchListOfAllContentPages:async()=>{try{let t=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(e>=1e4)return i.vF.error("fetchListOfAllContentPages: Too many pages, stopping pagination at 10000"),r;let s=await n.withoutUnresolvableLinks.getEntries({content_type:"contentPage",include:1,limit:1e3,skip:e}),a=r.concat(s.items);return s.total>e+1e3?t(e+1e3,a):a},e=await t(),s=Math.max(1,Math.ceil(e.length/1e3));return i.vF.log(`Fetched ${e.length} total pages from Contentful (across ${s} requests)`),r(e)}catch(t){i.vF.error("fetchListOfAllContentPages: Error fetching Contentful pages",t);return}},fetchListOfAllLandingPages:async()=>{try{let t=await n.withoutUnresolvableLinks.getEntries({content_type:"acquisitionLandingPage",include:0});return r(t.items)}catch(t){i.vF.error("Error",t)}},fetchSiteConfig:async()=>r(await e.fetchSiteConfig()),fetchContentPageForSlug:async t=>{let n=await e.fetchContentPage({"fields.slug":t});return n&&n?.length>1&&i.vF.error(`More than 1 ContentPage item found for slug '${t}'. Using first`,JSON.stringify(n,null,2)),r(n?.[0])},fetchContentPageForId:async t=>{let n=await e.fetchContentPage({"fields.id":t});return n&&n?.length>1&&i.vF.error(`More than 1 ContentPage item found for id '${t}'. Using first`,JSON.stringify(n,null,2)),n?.[0]},fetchLandingPageForSlug:async t=>{let n=await e.fetchLandingPage({"fields.slug":t});return n&&n?.length>1&&i.vF.error(`More than 1 ContentPage item found for slug '${t}'. Using first`,JSON.stringify(n,null,2)),r(n?.[0])}}},h=t=>c({space:t.contentfulSpace,environment:t.contentfulEnvironment,accessToken:t.contentfulPreviewMode?t.contentfulPreviewToken:t.contentfulToken,host:t.contentfulPreviewMode?"preview.contentful.com":"cdn.contentful.com",contentfulOrchestration:t.contentfulOrchestration,isPreview:t.contentfulPreviewMode})},45129:(t,e,n)=>
1{n(79749)},79135:(t,e,n)=>{n.d(e,{cM:()=>s.c,gC:()=>i.g,n:()=>r.n}),n(7977),n(50712),n(14437),n(48826),n(61803),n(97137),n(98180),n(58180),n(53964),n(14292),n(53638),n(33786);var i=n(77278);n(74890),n(33102),n(10228),n(92446),n(73719),n(22223);var r=n(84053);n(37402),n(80381),n(52891),n(88715);var s=n(2347);n(11718),n(80492),n(42525),n(53702),n(78035),n(91842),n(12676),n(10600),n(59618),n(26891),n(17481)}}]);

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.