1"use strict"; 2(self["webpackChunk_N_E"] = self["webpackChunk_N_E"] || []).push([[8003],{ 3 4/***/ 8221: 5/***/ (function(module, exports) { 6 7 8Object.defineProperty(exports, "__esModule", ({ 9 value: true 10})); 110 && (0); 12function _export(target, all) { 13 for(var name in all)Object.defineProperty(target, name, { 14 enumerable: true, 15 get: all[name] 16 }); 17} 18_export(exports, { 19 DOMAttributeNames: function() { 20 return DOMAttributeNames; 21 }, 22 default: function() { 23 return initHeadManager; 24 }, 25 isEqualNode: function() { 26 return isEqualNode; 27 } 28}); 29const DOMAttributeNames = { 30 acceptCharset: "accept-charset", 31 className: "class", 32 htmlFor: "for", 33 httpEquiv: "http-equiv", 34 noModule: "noModule" 35}; 36function reactElementToDOM(param) { 37 let { type, props } = param; 38 const el = document.createElement(type); 39 for(const p in props){ 40 if (!props.hasOwnProperty(p)) continue; 41 if (p === "children" || p === "dangerouslySetInnerHTML") continue; 42 // we don't render undefined props to the DOM 43 if (props[p] === undefined) continue; 44 const attr = DOMAttributeNames[p] || p.toLowerCase(); 45 if (type === "script" && (attr === "async" || attr === "defer" || attr === "noModule")) { 46 el[attr] = !!props[p]; 47 } else { 48 el.setAttribute(attr, props[p]); 49 } 50 } 51 const { children, dangerouslySetInnerHTML } = props; 52 if (dangerouslySetInnerHTML) { 53 el.innerHTML = dangerouslySetInnerHTML.__html || ""; 54 } else if (children) { 55 el.textContent = typeof children === "string" ? children : Array.isArray(children) ? children.join("") : ""; 56 } 57 return el; 58} 59function isEqualNode(oldTag, newTag) { 60 if (oldTag instanceof HTMLElement && newTag instanceof HTMLElement) { 61 const nonce = newTag.getAttribute("nonce"); 62 // Only strip the nonce if `oldTag` has had it stripped. An element's nonce attribute will not 63 // be stripped if there is no content security policy response header that includes a nonce. 64 if (nonce && !oldTag.getAttribute("nonce")) { 65 const cloneTag = newTag.cloneNode(true); 66 cloneTag.setAttribute("nonce", ""); 67 cloneTag.nonce = nonce; 68 return nonce === oldTag.nonce && oldTag.isEqualNode(cloneTag); 69 } 70 } 71 return oldTag.isEqualNode(newTag); 72} 73let updateElements; 74if (false) {} else { 75 updateElements = (type, components)=>{ 76 const headEl = document.getElementsByTagName("head")[0]; 77 const headCountEl = headEl.querySelector("meta[name=next-head-count]"); 78 if (false) {} 79 const headCount = Number(headCountEl.content); 80 const oldTags = []; 81 for(let i = 0, j = headCountEl.previousElementSibling; i < headCount; i++, j = (j == null ? void 0 : j.previousElementSibling) || null){ 82 var _j_tagName; 83 if ((j == null ? void 0 : (_j_tagName = j.tagName) == null ? void 0 : _j_tagName.toLowerCase()) === type) { 84 oldTags.push(j); 85 } 86 } 87 const newTags = components.map(reactElementToDOM).filter((newTag)=>{ 88 for(let k = 0, len = oldTags.length; k < len; k++){ 89 const oldTag = oldTags[k]; 90 if (isEqualNode(oldTag, newTag)) { 91 oldTags.splice(k, 1); 92 return false; 93 } 94 } 95 return true; 96 }); 97 oldTags.forEach((t)=>{ 98 var _t_parentNode; 99 return (_t_parentNode = t.parentNode) == null ? void 0 : _t_parentNode.removeChild(t); 100 });
101 newTags.forEach((t)=>headEl.insertBefore(t, headCountEl)); 102 headCountEl.content = (headCount - oldTags.length + newTags.length).toString(); 103 }; 104} 105function initHeadManager() { 106 return { 107 mountedInstances: new Set(), 108 updateHead: (head)=>{ 109 const tags = {}; 110 head.forEach((h)=>{ 111 if (// it won't be inlined. In this case revert to the original behavior 112 h.type === "link" && h.props["data-optimized-fonts"]) { 113 if (document.querySelector('style[data-href="' + h.props["data-href"] + '"]')) { 114 return; 115 } else { 116 h.props.href = h.props["data-href"]; 117 h.props["data-href"] = undefined; 118 } 119 } 120 const components = tags[h.type] || []; 121 components.push(h); 122 tags[h.type] = components; 123 }); 124 const titleComponent = tags.title ? tags.title[0] : null; 125 let title = ""; 126 if (titleComponent) { 127 const { children } = titleComponent.props; 128 title = typeof children === "string" ? children : Array.isArray(children) ? children.join("") : ""; 129 } 130 if (title !== document.title) document.title = title; 131 [ 132 "meta", 133 "base", 134 "link", 135 "style", 136 "script" 137 ].forEach((type)=>{ 138 updateElements(type, tags[type] || []); 139 }); 140 } 141 }; 142} 143if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") { 144 Object.defineProperty(exports.default, "__esModule", { 145 value: true 146 }); 147 Object.assign(exports.default, exports); 148 module.exports = exports.default; 149} //# sourceMappingURL=head-manager.js.map 150 151 152/***/ }), 153 154/***/ 88003: 155/***/ (function(module, exports, __webpack_require__) { 156 157/* __next_internal_client_entry_do_not_use__ cjs */ 158Object.defineProperty(exports, "__esModule", ({ 159 value: true 160})); 1610 && (0); 162function _export(target, all) { 163 for(var name in all)Object.defineProperty(target, name, { 164 enumerable: true, 165 get: all[name] 166 }); 167} 168_export(exports, { 169 default: function() { 170 return _default; 171 }, 172 handleClientScriptLoad: function() { 173 return handleClientScriptLoad; 174 }, 175 initScriptLoader: function() { 176 return initScriptLoader; 177 } 178}); 179const _interop_require_default = __webpack_require__(47043); 180const _interop_require_wildcard = __webpack_require__(53099); 181const _jsxruntime = __webpack_require__(57437); 182const _reactdom = /*#__PURE__*/ _interop_require_default._(__webpack_require__(54887)); 183const _react = /*#__PURE__*/ _interop_require_wildcard._(__webpack_require__(2265)); 184const _headmanagercontextsharedruntime = __webpack_require__(48701); 185const _headmanager = __webpack_require__(8221); 186const _requestidlecallback = __webpack_require__(63515); 187const ScriptCache = new Map(); 188const LoadCache = new Set(); 189const ignoreProps = [ 190 "onLoad", 191 "onReady", 192 "dangerouslySetInnerHTML", 193 "children", 194 "onError", 195 "strategy", 196 "stylesheets" 197]; 198const insertStylesheets = (stylesheets)=>{ 199 // Case 1: Styles for afterInteractive/lazyOnload with appDir injected via handleClientScriptLoad 200 // 201 // Using ReactDOM.preinit to feature detect appDir and inject styles 202 // Stylesheets might have already been loaded if initialized with Script component 203 // Re-inject styles here to handle scripts loaded via handleClientScriptLoad 204 // ReactDOM.preinit handles dedup and ensures the styles are loaded only once 205 if (_reactdom.default.preinit) { 206 stylesheets.forEach((stylesheet)=>{ 207 _reactdom.default.preinit(stylesheet, { 208 as: "style" 209 }); 210 }); 211 return; 212 } 213 // Case 2: Styles for afterInteractive/lazyOnload with pages injected via handleClientScriptLoad 214 // 215 // We use this function to load styles when appdir is not detected 216 // TODO: Use React float APIs to load styles once available for pages dir 217 if (typeof window !== "undefined") { 218 let head = document.head;
219 stylesheets.forEach((stylesheet)=>{ 220 let link = document.createElement("link"); 221 link.type = "text/css"; 222 link.rel = "stylesheet"; 223 link.href = stylesheet; 224 head.appendChild(link); 225 }); 226 } 227}; 228const loadScript = (props)=>{ 229 const { src, id, onLoad = ()=>{}, onReady = null, dangerouslySetInnerHTML, children = "", strategy = "afterInteractive", onError, stylesheets } = props; 230 const cacheKey = id || src; 231 // Script has already loaded 232 if (cacheKey && LoadCache.has(cacheKey)) { 233 return; 234 } 235 // Contents of this script are already loading/loaded 236 if (ScriptCache.has(src)) { 237 LoadCache.add(cacheKey); 238 // It is possible that multiple `next/script` components all have same "src", but has different "onLoad" 239 // This is to make sure the same remote script will only load once, but "onLoad" are executed in order 240 ScriptCache.get(src).then(onLoad, onError); 241 return; 242 } 243 /** Execute after the script first loaded */ const afterLoad = ()=>{ 244 // Run onReady for the first time after load event 245 if (onReady) { 246 onReady(); 247 } 248 // add cacheKey to LoadCache when load successfully 249 LoadCache.add(cacheKey); 250 }; 251 const el = document.createElement("script"); 252 const loadPromise = new Promise((resolve, reject)=>{ 253 el.addEventListener("load", function(e) { 254 resolve(); 255 if (onLoad) { 256 onLoad.call(this, e); 257 } 258 afterLoad(); 259 }); 260 el.addEventListener("error", function(e) { 261 reject(e); 262 }); 263 }).catch(function(e) { 264 if (onError) { 265 onError(e); 266 } 267 }); 268 if (dangerouslySetInnerHTML) { 269 // Casting since lib.dom.d.ts doesn't have TrustedHTML yet. 270 el.innerHTML = dangerouslySetInnerHTML.__html || ""; 271 afterLoad(); 272 } else if (children) { 273 el.textContent = typeof children === "string" ? children : Array.isArray(children) ? children.join("") : ""; 274 afterLoad(); 275 } else if (src) { 276 el.src = src; 277 // do not add cacheKey into LoadCache for remote script here 278 // cacheKey will be added to LoadCache when it is actually loaded (see loadPromise above) 279 ScriptCache.set(src, loadPromise); 280 } 281 for (const [k, value] of Object.entries(props)){ 282 if (value === undefined || ignoreProps.includes(k)) { 283 continue; 284 } 285 const attr = _headmanager.DOMAttributeNames[k] || k.toLowerCase(); 286 el.setAttribute(attr, value); 287 } 288 if (strategy === "worker") { 289 el.setAttribute("type", "text/partytown"); 290 } 291 el.setAttribute("data-nscript", strategy); 292 // Load styles associated with this script 293 if (stylesheets) { 294 insertStylesheets(stylesheets); 295 } 296 document.body.appendChild(el); 297}; 298function handleClientScriptLoad(props) { 299 const { strategy = "afterInteractive" } = props; 300 if (strategy === "lazyOnload") { 301 window.addEventListener("load", ()=>{ 302 (0, _requestidlecallback.requestIdleCallback)(()=>loadScript(props)); 303 }); 304 } else { 305 loadScript(props); 306 } 307} 308function loadLazyScript(props) { 309 if (document.readyState === "complete") { 310 (0, _requestidlecallback.requestIdleCallback)(()=>loadScript(props)); 311 } else { 312 window.addEventListener("load", ()=>{ 313 (0, _requestidlecallback.requestIdleCallback)(()=>loadScript(props)); 314 }); 315 } 316} 317function addBeforeInteractiveToCache() { 318 const scripts = [ 319 ...document.querySelectorAll('[data-nscript="beforeInteractive"]'), 320 ...document.querySelectorAll('[data-nscript="beforePageRender"]') 321 ]; 322 scripts.forEach((script)=>{ 323 const cacheKey = script.id || script.getAttribute("src"); 324 LoadCache.add(cacheKey); 325 }); 326} 327function initScriptLoader(scriptLoaderItems) { 328 scriptLoaderItems.forEach(handleClientScriptLoad); 329 addBeforeInteractiveToCache(); 330} 331/** 332 * Load a third-party scripts in an optimized way. 333 * 334 * Read more: [Next.js Docs: `next/script`](https://nextjs.org/docs/app/api-reference/components/script) 335 */ function Script(props) { 336 const { id, src = "", onLoad = ()=>{}, onReady = null, strategy = "afterInteractive", onError, stylesheets, ...restProps } = props; 337 // Context is available only during SSR 338 const { updateScripts, scripts, getIsSsr, appDir, nonce } = (0, _react.useContext)(_headmanagercontextsharedruntime.HeadManagerContext); 339 /** 340 * - First mount: 341 * 1. The useEffect for onReady executes 342 * 2. hasOnReadyEffectCalled.current is false, but the script hasn't loaded yet (not in LoadCache) 343 * onReady is skipped, set hasOnReadyEffectCalled.current to true 344 * 3. The useEffect for loadScript executes 345 * 4. hasLoadScriptEffectCalled.current is false, loadScript executes 346 * Once the script is loaded, the onLoad and onReady will be called by then
347 * [If strict mode is enabled / is wrapped in <OffScreen /> component] 348 * 5. The useEffect for onReady executes again 349 * 6. hasOnReadyEffectCalled.current is true, so entire effect is skipped 350 * 7. The useEffect for loadScript executes again 351 * 8. hasLoadScriptEffectCalled.current is true, so entire effect is skipped 352 * 353 * - Second mount: 354 * 1. The useEffect for onReady executes 355 * 2. hasOnReadyEffectCalled.current is false, but the script has already loaded (found in LoadCache) 356 * onReady is called, set hasOnReadyEffectCalled.current to true 357 * 3. The useEffect for loadScript executes 358 * 4. The script is already loaded, loadScript bails out 359 * [If strict mode is enabled / is wrapped in <OffScreen /> component] 360 * 5. The useEffect for onReady executes again 361 * 6. hasOnReadyEffectCalled.current is true, so entire effect is skipped 362 * 7. The useEffect for loadScript executes again 363 * 8. hasLoadScriptEffectCalled.current is true, so entire effect is skipped 364 */ const hasOnReadyEffectCalled = (0, _react.useRef)(false); 365 (0, _react.useEffect)(()=>{ 366 const cacheKey = id || src; 367 if (!hasOnReadyEffectCalled.current) { 368 // Run onReady if script has loaded before but component is re-mounted 369 if (onReady && cacheKey && LoadCache.has(cacheKey)) { 370 onReady(); 371 } 372 hasOnReadyEffectCalled.current = true; 373 } 374 }, [ 375 onReady, 376 id, 377 src 378 ]); 379 const hasLoadScriptEffectCalled = (0, _react.useRef)(false); 380 (0, _react.useEffect)(()=>{ 381 if (!hasLoadScriptEffectCalled.current) { 382 if (strategy === "afterInteractive") { 383 loadScript(props); 384 } else if (strategy === "lazyOnload") { 385 loadLazyScript(props); 386 } 387 hasLoadScriptEffectCalled.current = true; 388 } 389 }, [ 390 props, 391 strategy 392 ]); 393 if (strategy === "beforeInteractive" || strategy === "worker") { 394 if (updateScripts) { 395 scripts[strategy] = (scripts[strategy] || []).concat([ 396 { 397 id, 398 src, 399 onLoad, 400 onReady, 401 onError, 402 ...restProps 403 } 404 ]); 405 updateScripts(scripts); 406 } else if (getIsSsr && getIsSsr()) { 407 // Script has already loaded during SSR 408 LoadCache.add(id || src); 409 } else if (getIsSsr && !getIsSsr()) { 410 loadScript(props); 411 } 412 } 413 // For the app directory, we need React Float to preload these scripts. 414 if (appDir) { 415 // Injecting stylesheets here handles beforeInteractive and worker scripts correctly 416 // For other strategies injecting here ensures correct stylesheet order 417 // ReactDOM.preinit handles loading the styles in the correct order, 418 // also ensures the stylesheet is loaded only once and in a consistent manner 419 // 420 // Case 1: Styles for beforeInteractive/worker with appDir - handled here 421 // Case 2: Styles for beforeInteractive/worker with pages dir - Not handled yet 422 // Case 3: Styles for afterInteractive/lazyOnload with appDir - handled here 423 // Case 4: Styles for afterInteractive/lazyOnload with pages dir - handled in insertStylesheets function 424 if (stylesheets) { 425 stylesheets.forEach((styleSrc)=>{ 426 _reactdom.default.preinit(styleSrc, { 427 as: "style" 428 }); 429 }); 430 } 431 // Before interactive scripts need to be loaded by Next.js' runtime instead 432 // of native <script> tags, because they no longer have `defer`. 433 if (strategy === "beforeInteractive") { 434 if (!src) { 435 // For inlined scripts, we put the content in `children`. 436 if (restProps.dangerouslySetInnerHTML) { 437 // Casting since lib.dom.d.ts doesn't have TrustedHTML yet. 438 restProps.children = restProps.dangerouslySetInnerHTML.__html; 439 delete restProps.dangerouslySetInnerHTML; 440 } 441 return /*#__PURE__*/ (0, _jsxruntime.jsx)("script", { 442 nonce: nonce, 443 dangerouslySetInnerHTML: { 444 __html: "(self.__next_s=self.__next_s||[]).push(" + JSON.stringify([ 445 0, 446 { 447 ...restProps, 448 id 449 } 450 ]) + ")" 451 } 452 }); 453 } else { 454 // @ts-ignore 455 _reactdom.default.preload(src, restProps.integrity ? {
456 as: "script", 457 integrity: restProps.integrity, 458 nonce, 459 crossOrigin: restProps.crossOrigin 460 } : { 461 as: "script", 462 nonce, 463 crossOrigin: restProps.crossOrigin 464 }); 465 return /*#__PURE__*/ (0, _jsxruntime.jsx)("script", { 466 nonce: nonce, 467 dangerouslySetInnerHTML: { 468 __html: "(self.__next_s=self.__next_s||[]).push(" + JSON.stringify([ 469 src, 470 { 471 ...restProps, 472 id 473 } 474 ]) + ")" 475 } 476 }); 477 } 478 } else if (strategy === "afterInteractive") { 479 if (src) { 480 // @ts-ignore 481 _reactdom.default.preload(src, restProps.integrity ? { 482 as: "script", 483 integrity: restProps.integrity, 484 nonce, 485 crossOrigin: restProps.crossOrigin 486 } : { 487 as: "script", 488 nonce, 489 crossOrigin: restProps.crossOrigin 490 }); 491 } 492 } 493 } 494 return null; 495} 496Object.defineProperty(Script, "__nextScript", { 497 value: true 498}); 499const _default = Script; 500if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") { 501 Object.defineProperty(exports.default, "__esModule", { 502 value: true 503 }); 504 Object.assign(exports.default, exports); 505 module.exports = exports.default; 506} //# sourceMappingURL=script.js.map 507 508 509/***/ }) 510 511}]);
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.