1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/NotFound-DuUX8w0X.js","assets/card-CV3CzesJ.js","assets/house-1fQZgX0U.js","assets/AgentLogin-D0Z9FNo3.js","assets/alert-HWzlhw99.js","assets/select-3x7TRCw-.js","assets/index-BEBgmBqK.js","assets/index-B88B3rZe.js","assets/chevron-down-DFKrqu4j.js","assets/check-BezXvNsL.js","assets/chevron-up-Do8Lk9oa.js","assets/circle-check-CqW-unub.js","assets/arrow-left-BTjDVb-D.js","assets/AgentChangePassword-CEgFEfda.js","assets/shield-alert-CBrDuGMb.js","assets/key-round-CJadK3Ea.js","assets/CommandCenter-D1zQcdxK.js","assets/agencyGroups-CU_2ZOuP.js","assets/map-pin-B8IF_FiU.js","assets/clock-CjjskDf6.js","assets/OnboardingPanel-B0xVOcMX.js","assets/download-BMCjKajM.js","assets/circle-check-big-CmJOxlC9.js","assets/upload-BrgTKlQs.js","assets/LoginPrompt-CHjJZnu_.js","assets/useComposition-DPCJbBnn.js","assets/input-Dy4-W9m0.js","assets/label-BdZn6Q6n.js","assets/AgentChat-DDAj7r8S.js","assets/textarea-B3UNOK9R.js","assets/user-B4RG8T6t.js","assets/copy-BAoxz8Jl.js","assets/message-circle-DqDT8bSb.js","assets/filter-BxjGUbXo.js","assets/DatePicker-mymcOl0Q.js","assets/calendar-CGh5WTcU.js","assets/monitor-D_0pd9Oa.js","assets/external-link-BPkSVFWl.js","assets/trash-2-DkCMhEWr.js","assets/plus-BP2QxMPQ.js","assets/link-2-fjaVShKv.js","assets/QuotingPanel-BYCCm3lE.js","assets/QuoteComparisonPanel-SXICjd1Y.js","assets/alert-dialog-CZgE41L3.js","assets/RichEmailEditor-P_kw8zDm.js","assets/dropdown-menu-Cv-n8opx.js","assets/index-D1Fi90JZ.js","assets/tag-BX0RA0Cu.js","assets/index-CCUpuQVn.js","assets/index-XSfRedCB.css","assets/lock-DbL7ogbc.js","assets/file-down-CrR0CtQE.js","assets/sparkles-I54sm_K8.js","assets/save-PDl6zfI9.js","assets/pen-line-Bn1tOSLX.js","assets/arrow-right-CECJo1mW.js","assets/trending-down-Dg4gecsZ.js","assets/FormsPanel-BxBz0mR5.js","assets/AcordFieldEditor-DmOR2NZ0.js","assets/search-BQjKKf9D.js","assets/RenewalsPanel-BTzdftpx.js","assets/EmailTemplateAIChat-BbGSZrtA.js","assets/tabs-50Gco_8f.js","assets/TemplateCombobox-DL12KN4V.js","assets/circle-help-CxcHWdLN.js","assets/MarketingPanel-Dp6ZhF9H.js","assets/heart-JRsWOGao.js","assets/wand-sparkles-B3-1FwPg.js","assets/bookmark-plus-yd6OhDVs.js","assets/paperclip-ByAkYqma.js","assets/history-D_9iPYu-.js","assets/InsightsPanel-CfwjSLvR.js","assets/brain-DKju9Imd.js","assets/car-DSWUF9xe.js","assets/CarrierInfoPanel-BjJIlTgc.js","assets/phone-BYCO7cEE.js","assets/MessagesPanel-BsiBgCf3.js","assets/briefcase-d8WvXAbR.js","assets/CommissionsPanel-B1oyhC_N.js","assets/circle-plus-By14nPvx.js","assets/ScriptsPanel-CHR7ARc_.js","assets/ProductionPanel-sfD_1hG1.js","assets/string-vV7IM_jW.js","assets/band-CCjStBCv.js","assets/init-CT6u7j_0.js","assets/ordinal-DAGjAj5m.js","assets/linear-zF72F6JW.js","assets/defaultLocale-BfO4jui1.js","assets/time-CZpBxYtE.js","assets/AgentAccountsPanel-B0GtKqEU.js","assets/info-D8W5gqg6.js","assets/smartphone-CqOXnKJs.js","assets/CommissionSettings-DhC_W6rb.js","assets/PolicyChangeForm-DKAai6vd.js","assets/circle-x-Bp9RgmBn.js","assets/ClaimForm-xDPOuNvk.js","assets/PolicyChangesPanel-B23pjLFe.js","assets/ClaimsPanel-Dcvj4cRl.js","assets/link-z_tGrdGA.js","assets/PaymentsPanel-BLwv2yfS.js","assets/pen-dQQbmgRv.js","assets/SuggestionsPanel-CYrNFSBK.js","assets/GoogleReviewPanel-BCgbJJ70.js","assets/NewBusinessPanel-LPl104hJ.js","assets/ExcelPreviewModal-WbsYLFzS.js","assets/user-x-NyWr_xzT.js","assets/ClientDirectoryPanel-DA8guksW.js","assets/AgentEmailSettings-0HKnL0l8.js","assets/AdminSettingsPage-DcAvQfOs.js","assets/unlink-D-MGif8T.js","assets/AgencyGroupManager-o_BX2-oj.js","assets/FeatureGapLogPage-CcphG7Jy.js","assets/ProducerHome-DNKjZ2e4.js","assets/AcordFormsAgentPage-CyvELDyg.js","assets/MyAccountPage-s_c9Y6q4.js","assets/CalendarPageWrapper-BQeLV0Uk.js","assets/CelebrationAgent-0zPzVDKW.js","assets/ProspectStart-cAe1ZIiO.js","assets/SignDocument-BcDb5Nwr.js","assets/ConfirmReceipt-CjY9Sm7E.js","assets/SmsConsentPage-Bm3HAi5G.js","assets/PrivacyPolicyPage-CTcS9rGC.js","assets/AcordClientIntakePage-B9aVKGQO.js"])))=>i.map(i=>d[i]); 2function _mergeNamespaces(n, m) { 3 for (var i = 0; i < m.length; i++) { 4 const e = m[i]; 5 if (typeof e !== 'string' && !Array.isArray(e)) { for (const k in e) { 6 if (k !== 'default' && !(k in n)) { 7 const d = Object.getOwnPropertyDescriptor(e, k); 8 if (d) { 9 Object.defineProperty(n, k, d.get ? d : { 10 enumerable: true, 11 get: () => e[k] 12 }); 13 } 14 } 15 } } 16 } 17 return Object.freeze(Object.defineProperty(n, Symbol.toStringTag, { value: 'Module' })); 18} 19 20true &&(function polyfill() { 21 const relList = document.createElement("link").relList; 22 if (relList && relList.supports && relList.supports("modulepreload")) return; 23 for (const link of document.querySelectorAll("link[rel=\"modulepreload\"]")) processPreload(link); 24 new MutationObserver((mutations) => { 25 for (const mutation of mutations) { 26 if (mutation.type !== "childList") continue; 27 for (const node of mutation.addedNodes) if (node.tagName === "LINK" && node.rel === "modulepreload") processPreload(node); 28 } 29 }).observe(document, { 30 childList: true, 31 subtree: true 32 }); 33 function getFetchOpts(link) { 34 const fetchOpts = {}; 35 if (link.integrity) fetchOpts.integrity = link.integrity; 36 if (link.referrerPolicy) fetchOpts.referrerPolicy = link.referrerPolicy; 37 if (link.crossOrigin === "use-credentials") fetchOpts.credentials = "include"; 38 else if (link.crossOrigin === "anonymous") fetchOpts.credentials = "omit"; 39 else fetchOpts.credentials = "same-origin"; 40 return fetchOpts; 41 } 42 function processPreload(link) { 43 if (link.ep) return; 44 link.ep = true; 45 const fetchOpts = getFetchOpts(link); 46 fetch(link.href, fetchOpts); 47 } 48}()); 49
vendor: 1,990 bytes, lines 50-113
50var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; 51 52function getDefaultExportFromCjs (x) { 53 return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x; 54} 55 56var jsxRuntime = {exports: {}}; 57 58var reactJsxRuntime_production = {}; 59 60/** 61 * @license React 62 * react-jsx-runtime.production.js 63 * 64 * Copyright (c) Meta Platforms, Inc. and affiliates. 65 * 66 * This source code is licensed under the MIT license found in the 67 * LICENSE file in the root directory of this source tree. 68 */ 69 70var hasRequiredReactJsxRuntime_production; 71 72function requireReactJsxRuntime_production () { 73 if (hasRequiredReactJsxRuntime_production) return reactJsxRuntime_production; 74 hasRequiredReactJsxRuntime_production = 1; 75 var REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"), 76 REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"); 77 function jsxProd(type, config, maybeKey) { 78 var key = null; 79 void 0 !== maybeKey && (key = "" + maybeKey); 80 void 0 !== config.key && (key = "" + config.key); 81 if ("key" in config) { 82 maybeKey = {}; 83 for (var propName in config) 84 "key" !== propName && (maybeKey[propName] = config[propName]); 85 } else maybeKey = config; 86 config = maybeKey.ref; 87 return { 88 $$typeof: REACT_ELEMENT_TYPE, 89 type: type, 90 key: key, 91 ref: void 0 !== config ? config : null, 92 props: maybeKey 93 }; 94 } 95 reactJsxRuntime_production.Fragment = REACT_FRAGMENT_TYPE; 96 reactJsxRuntime_production.jsx = jsxProd; 97 reactJsxRuntime_production.jsxs = jsxProd; 98 return reactJsxRuntime_production; 99} 100 101var hasRequiredJsxRuntime; 102 103function requireJsxRuntime () { 104 if (hasRequiredJsxRuntime) return jsxRuntime.exports; 105 hasRequiredJsxRuntime = 1; 106 { 107 jsxRuntime.exports = requireReactJsxRuntime_production(); 108 } 109 return jsxRuntime.exports; 110} 111 112var jsxRuntimeExports = requireJsxRuntime(); 113
114// src/subscribable.ts 115var Subscribable = class { 116 constructor() { 117 this.listeners = /* @__PURE__ */ new Set(); 118 this.subscribe = this.subscribe.bind(this); 119 } 120 subscribe(listener) { 121 this.listeners.add(listener); 122 this.onSubscribe(); 123 return () => { 124 this.listeners.delete(listener); 125 this.onUnsubscribe(); 126 }; 127 } 128 hasListeners() { 129 return this.listeners.size > 0; 130 } 131 onSubscribe() { 132 } 133 onUnsubscribe() { 134 } 135}; 136 137var defaultTimeoutProvider = { 138 // We need the wrapper function syntax below instead of direct references to 139 // global setTimeout etc. 140 // 141 // BAD: `setTimeout: setTimeout` 142 // GOOD: `setTimeout: (cb, delay) => setTimeout(cb, delay)` 143 // 144 // If we use direct references here, then anything that wants to spy on or 145 // replace the global setTimeout (like tests) won't work since we'll already 146 // have a hard reference to the original implementation at the time when this 147 // file was imported. 148 setTimeout: (callback, delay) => setTimeout(callback, delay), 149 clearTimeout: (timeoutId) => clearTimeout(timeoutId), 150 setInterval: (callback, delay) => setInterval(callback, delay), 151 clearInterval: (intervalId) => clearInterval(intervalId) 152}; 153var TimeoutManager = class { 154 // We cannot have TimeoutManager<T> as we must instantiate it with a concrete 155 // type at app boot; and if we leave that type, then any new timer provider 156 // would need to support ReturnType<typeof setTimeout>, which is infeasible. 157 // 158 // We settle for type safety for the TimeoutProvider type, and accept that 159 // this class is unsafe internally to allow for extension. 160 #provider = defaultTimeoutProvider; 161 #providerCalled = false; 162 setTimeoutProvider(provider) { 163 this.#provider = provider; 164 } 165 setTimeout(callback, delay) { 166 return this.#provider.setTimeout(callback, delay); 167 } 168 clearTimeout(timeoutId) { 169 this.#provider.clearTimeout(timeoutId); 170 } 171 setInterval(callback, delay) { 172 return this.#provider.setInterval(callback, delay); 173 } 174 clearInterval(intervalId) { 175 this.#provider.clearInterval(intervalId); 176 } 177}; 178var timeoutManager = new TimeoutManager(); 179function systemSetTimeoutZero(callback) { 180 setTimeout(callback, 0); 181} 182 183var isServer = typeof window === "undefined" || "Deno" in globalThis; 184function noop$3() { 185} 186function functionalUpdate(updater, input) { 187 return typeof updater === "function" ? updater(input) : updater; 188} 189function isValidTimeout(value) { 190 return typeof value === "number" && value >= 0 && value !== Infinity; 191} 192function timeUntilStale(updatedAt, staleTime) { 193 return Math.max(updatedAt + (staleTime || 0) - Date.now(), 0); 194} 195function resolveStaleTime(staleTime, query) { 196 return typeof staleTime === "function" ? staleTime(query) : staleTime; 197} 198function resolveEnabled(enabled, query) { 199 return typeof enabled === "function" ? enabled(query) : enabled; 200} 201function matchQuery(filters, query) { 202 const { 203 type = "all", 204 exact, 205 fetchStatus, 206 predicate, 207 queryKey, 208 stale 209 } = filters; 210 if (queryKey) { 211 if (exact) { 212 if (query.queryHash !== hashQueryKeyByOptions(queryKey, query.options)) { 213 return false; 214 } 215 } else if (!partialMatchKey(query.queryKey, queryKey)) { 216 return false; 217 } 218 } 219 if (type !== "all") { 220 const isActive = query.isActive(); 221 if (type === "active" && !isActive) { 222 return false; 223 } 224 if (type === "inactive" && isActive) { 225 return false; 226 } 227 } 228 if (typeof stale === "boolean" && query.isStale() !== stale) { 229 return false; 230 } 231 if (fetchStatus && fetchStatus !== query.state.fetchStatus) { 232 return false; 233 } 234 if (predicate && !predicate(query)) { 235 return false; 236 } 237 return true; 238} 239function matchMutation(filters, mutation) { 240 const { exact, status, predicate, mutationKey } = filters; 241 if (mutationKey) { 242 if (!mutation.options.mutationKey) { 243 return false; 244 } 245 if (exact) { 246 if (hashKey(mutation.options.mutationKey) !== hashKey(mutationKey)) { 247 return false; 248 } 249 } else if (!partialMatchKey(mutation.options.mutationKey, mutationKey)) { 250 return false;
251 } 252 } 253 if (status && mutation.state.status !== status) { 254 return false; 255 } 256 if (predicate && !predicate(mutation)) { 257 return false; 258 } 259 return true; 260} 261function hashQueryKeyByOptions(queryKey, options) { 262 const hashFn = options?.queryKeyHashFn || hashKey; 263 return hashFn(queryKey); 264} 265function hashKey(queryKey) { 266 return JSON.stringify( 267 queryKey, 268 (_, val) => isPlainObject$2(val) ? Object.keys(val).sort().reduce((result, key) => { 269 result[key] = val[key]; 270 return result; 271 }, {}) : val 272 ); 273} 274function partialMatchKey(a, b) { 275 if (a === b) { 276 return true; 277 } 278 if (typeof a !== typeof b) { 279 return false; 280 } 281 if (a && b && typeof a === "object" && typeof b === "object") { 282 return Object.keys(b).every((key) => partialMatchKey(a[key], b[key])); 283 } 284 return false; 285} 286var hasOwn = Object.prototype.hasOwnProperty; 287function replaceEqualDeep(a, b) { 288 if (a === b) { 289 return a; 290 } 291 const array = isPlainArray(a) && isPlainArray(b); 292 if (!array && !(isPlainObject$2(a) && isPlainObject$2(b))) return b; 293 const aItems = array ? a : Object.keys(a); 294 const aSize = aItems.length; 295 const bItems = array ? b : Object.keys(b); 296 const bSize = bItems.length; 297 const copy = array ? new Array(bSize) : {}; 298 let equalItems = 0; 299 for (let i = 0; i < bSize; i++) { 300 const key = array ? i : bItems[i]; 301 const aItem = a[key]; 302 const bItem = b[key]; 303 if (aItem === bItem) { 304 copy[key] = aItem; 305 if (array ? i < aSize : hasOwn.call(a, key)) equalItems++; 306 continue; 307 } 308 if (aItem === null || bItem === null || typeof aItem !== "object" || typeof bItem !== "object") { 309 copy[key] = bItem; 310 continue; 311 } 312 const v = replaceEqualDeep(aItem, bItem); 313 copy[key] = v; 314 if (v === aItem) equalItems++; 315 } 316 return aSize === bSize && equalItems === aSize ? a : copy; 317} 318function shallowEqualObjects(a, b) { 319 if (!b || Object.keys(a).length !== Object.keys(b).length) { 320 return false; 321 } 322 for (const key in a) { 323 if (a[key] !== b[key]) { 324 return false; 325 } 326 } 327 return true; 328} 329function isPlainArray(value) { 330 return Array.isArray(value) && value.length === Object.keys(value).length; 331} 332function isPlainObject$2(o) { 333 if (!hasObjectPrototype(o)) { 334 return false; 335 } 336 const ctor = o.constructor; 337 if (ctor === void 0) { 338 return true; 339 } 340 const prot = ctor.prototype; 341 if (!hasObjectPrototype(prot)) { 342 return false; 343 } 344 if (!prot.hasOwnProperty("isPrototypeOf")) { 345 return false; 346 } 347 if (Object.getPrototypeOf(o) !== Object.prototype) { 348 return false; 349 } 350 return true; 351} 352function hasObjectPrototype(o) { 353 return Object.prototype.toString.call(o) === "[object Object]"; 354} 355function sleep(timeout) { 356 return new Promise((resolve) => { 357 timeoutManager.setTimeout(resolve, timeout); 358 }); 359} 360function replaceData(prevData, data, options) { 361 if (typeof options.structuralSharing === "function") { 362 return options.structuralSharing(prevData, data); 363 } else if (options.structuralSharing !== false) { 364 return replaceEqualDeep(prevData, data); 365 } 366 return data; 367} 368function addToEnd(items, item, max = 0) { 369 const newItems = [...items, item]; 370 return max && newItems.length > max ? newItems.slice(1) : newItems; 371} 372function addToStart(items, item, max = 0) { 373 const newItems = [item, ...items]; 374 return max && newItems.length > max ? newItems.slice(0, -1) : newItems; 375} 376var skipToken = Symbol(); 377function ensureQueryFn(options, fetchOptions) { 378 if (!options.queryFn && fetchOptions?.initialPromise) { 379 return () => fetchOptions.initialPromise; 380 } 381 if (!options.queryFn || options.queryFn === skipToken) { 382 return () => Promise.reject(new Error(`Missing queryFn: '${options.queryHash}'`)); 383 } 384 return options.queryFn; 385} 386function shouldThrowError(throwOnError, params) { 387 if (typeof throwOnError === "function") { 388 return throwOnError(...params); 389 } 390 return !!throwOnError; 391} 392
393// src/focusManager.ts 394var FocusManager = class extends Subscribable { 395 #focused; 396 #cleanup; 397 #setup; 398 constructor() { 399 super(); 400 this.#setup = (onFocus) => { 401 if (!isServer && window.addEventListener) { 402 const listener = () => onFocus(); 403 window.addEventListener("visibilitychange", listener, false); 404 return () => { 405 window.removeEventListener("visibilitychange", listener); 406 }; 407 } 408 return; 409 }; 410 } 411 onSubscribe() { 412 if (!this.#cleanup) { 413 this.setEventListener(this.#setup); 414 } 415 } 416 onUnsubscribe() { 417 if (!this.hasListeners()) { 418 this.#cleanup?.(); 419 this.#cleanup = void 0; 420 } 421 } 422 setEventListener(setup) { 423 this.#setup = setup; 424 this.#cleanup?.(); 425 this.#cleanup = setup((focused) => { 426 if (typeof focused === "boolean") { 427 this.setFocused(focused); 428 } else { 429 this.onFocus(); 430 } 431 }); 432 } 433 setFocused(focused) { 434 const changed = this.#focused !== focused; 435 if (changed) { 436 this.#focused = focused; 437 this.onFocus(); 438 } 439 } 440 onFocus() { 441 const isFocused = this.isFocused(); 442 this.listeners.forEach((listener) => { 443 listener(isFocused); 444 }); 445 } 446 isFocused() { 447 if (typeof this.#focused === "boolean") { 448 return this.#focused; 449 } 450 return globalThis.document?.visibilityState !== "hidden"; 451 } 452}; 453var focusManager = new FocusManager(); 454
vendor: 2,495 bytes, lines 455-567
455// src/thenable.ts 456function pendingThenable() { 457 let resolve; 458 let reject; 459 const thenable = new Promise((_resolve, _reject) => { 460 resolve = _resolve; 461 reject = _reject; 462 }); 463 thenable.status = "pending"; 464 thenable.catch(() => { 465 }); 466 function finalize(data) { 467 Object.assign(thenable, data); 468 delete thenable.resolve; 469 delete thenable.reject; 470 } 471 thenable.resolve = (value) => { 472 finalize({ 473 status: "fulfilled", 474 value 475 }); 476 resolve(value); 477 }; 478 thenable.reject = (reason) => { 479 finalize({ 480 status: "rejected", 481 reason 482 }); 483 reject(reason); 484 }; 485 return thenable; 486} 487 488// src/notifyManager.ts 489var defaultScheduler = systemSetTimeoutZero; 490function createNotifyManager() { 491 let queue = []; 492 let transactions = 0; 493 let notifyFn = (callback) => { 494 callback(); 495 }; 496 let batchNotifyFn = (callback) => { 497 callback(); 498 }; 499 let scheduleFn = defaultScheduler; 500 const schedule = (callback) => { 501 if (transactions) { 502 queue.push(callback); 503 } else { 504 scheduleFn(() => { 505 notifyFn(callback); 506 }); 507 } 508 }; 509 const flush = () => { 510 const originalQueue = queue; 511 queue = []; 512 if (originalQueue.length) { 513 scheduleFn(() => { 514 batchNotifyFn(() => { 515 originalQueue.forEach((callback) => { 516 notifyFn(callback); 517 }); 518 }); 519 }); 520 } 521 }; 522 return { 523 batch: (callback) => { 524 let result; 525 transactions++; 526 try { 527 result = callback(); 528 } finally { 529 transactions--; 530 if (!transactions) { 531 flush(); 532 } 533 } 534 return result; 535 }, 536 /** 537 * All calls to the wrapped function will be batched. 538 */ 539 batchCalls: (callback) => { 540 return (...args) => { 541 schedule(() => { 542 callback(...args); 543 }); 544 }; 545 }, 546 schedule, 547 /** 548 * Use this method to set a custom notify function. 549 * This can be used to for example wrap notifications with `React.act` while running tests. 550 */ 551 setNotifyFunction: (fn) => { 552 notifyFn = fn; 553 }, 554 /** 555 * Use this method to set a custom function to batch notifications together into a single tick. 556 * By default React Query will use the batch function provided by ReactDOM or React Native. 557 */ 558 setBatchNotifyFunction: (fn) => { 559 batchNotifyFn = fn; 560 }, 561 setScheduler: (fn) => { 562 scheduleFn = fn; 563 } 564 }; 565} 566var notifyManager = createNotifyManager(); 567
568// src/onlineManager.ts 569var OnlineManager = class extends Subscribable { 570 #online = true; 571 #cleanup; 572 #setup; 573 constructor() { 574 super(); 575 this.#setup = (onOnline) => { 576 if (!isServer && window.addEventListener) { 577 const onlineListener = () => onOnline(true); 578 const offlineListener = () => onOnline(false); 579 window.addEventListener("online", onlineListener, false); 580 window.addEventListener("offline", offlineListener, false); 581 return () => { 582 window.removeEventListener("online", onlineListener); 583 window.removeEventListener("offline", offlineListener); 584 }; 585 } 586 return; 587 }; 588 } 589 onSubscribe() { 590 if (!this.#cleanup) { 591 this.setEventListener(this.#setup); 592 } 593 } 594 onUnsubscribe() { 595 if (!this.hasListeners()) { 596 this.#cleanup?.(); 597 this.#cleanup = void 0; 598 } 599 } 600 setEventListener(setup) { 601 this.#setup = setup; 602 this.#cleanup?.(); 603 this.#cleanup = setup(this.setOnline.bind(this)); 604 } 605 setOnline(online) { 606 const changed = this.#online !== online; 607 if (changed) { 608 this.#online = online; 609 this.listeners.forEach((listener) => { 610 listener(online); 611 }); 612 } 613 } 614 isOnline() { 615 return this.#online; 616 } 617}; 618var onlineManager = new OnlineManager(); 619
620// src/retryer.ts 621function defaultRetryDelay(failureCount) { 622 return Math.min(1e3 * 2 ** failureCount, 3e4); 623} 624function canFetch(networkMode) { 625 return (networkMode ?? "online") === "online" ? onlineManager.isOnline() : true; 626} 627var CancelledError = class extends Error { 628 constructor(options) { 629 super("CancelledError"); 630 this.revert = options?.revert; 631 this.silent = options?.silent; 632 } 633}; 634function createRetryer(config) { 635 let isRetryCancelled = false; 636 let failureCount = 0; 637 let continueFn; 638 const thenable = pendingThenable(); 639 const isResolved = () => thenable.status !== "pending"; 640 const cancel = (cancelOptions) => { 641 if (!isResolved()) { 642 const error = new CancelledError(cancelOptions); 643 reject(error); 644 config.onCancel?.(error); 645 } 646 }; 647 const cancelRetry = () => { 648 isRetryCancelled = true; 649 }; 650 const continueRetry = () => { 651 isRetryCancelled = false; 652 }; 653 const canContinue = () => focusManager.isFocused() && (config.networkMode === "always" || onlineManager.isOnline()) && config.canRun(); 654 const canStart = () => canFetch(config.networkMode) && config.canRun(); 655 const resolve = (value) => { 656 if (!isResolved()) { 657 continueFn?.(); 658 thenable.resolve(value); 659 } 660 }; 661 const reject = (value) => { 662 if (!isResolved()) { 663 continueFn?.(); 664 thenable.reject(value); 665 } 666 }; 667 const pause = () => { 668 return new Promise((continueResolve) => { 669 continueFn = (value) => { 670 if (isResolved() || canContinue()) { 671 continueResolve(value); 672 } 673 }; 674 config.onPause?.(); 675 }).then(() => { 676 continueFn = void 0; 677 if (!isResolved()) { 678 config.onContinue?.(); 679 } 680 }); 681 }; 682 const run = () => { 683 if (isResolved()) { 684 return; 685 } 686 let promiseOrValue; 687 const initialPromise = failureCount === 0 ? config.initialPromise : void 0; 688 try { 689 promiseOrValue = initialPromise ?? config.fn(); 690 } catch (error) { 691 promiseOrValue = Promise.reject(error); 692 } 693 Promise.resolve(promiseOrValue).then(resolve).catch((error) => { 694 if (isResolved()) { 695 return; 696 } 697 const retry = config.retry ?? (isServer ? 0 : 3); 698 const retryDelay = config.retryDelay ?? defaultRetryDelay; 699 const delay = typeof retryDelay === "function" ? retryDelay(failureCount, error) : retryDelay; 700 const shouldRetry = retry === true || typeof retry === "number" && failureCount < retry || typeof retry === "function" && retry(failureCount, error); 701 if (isRetryCancelled || !shouldRetry) { 702 reject(error); 703 return; 704 } 705 failureCount++; 706 config.onFail?.(failureCount, error); 707 sleep(delay).then(() => { 708 return canContinue() ? void 0 : pause(); 709 }).then(() => { 710 if (isRetryCancelled) { 711 reject(error); 712 } else { 713 run(); 714 } 715 }); 716 }); 717 }; 718 return { 719 promise: thenable, 720 status: () => thenable.status, 721 cancel, 722 continue: () => { 723 continueFn?.(); 724 return thenable; 725 }, 726 cancelRetry, 727 continueRetry, 728 canStart, 729 start: () => { 730 if (canStart()) { 731 run(); 732 } else { 733 pause().then(run); 734 } 735 return thenable; 736 } 737 }; 738} 739
740// src/removable.ts 741var Removable = class { 742 #gcTimeout; 743 destroy() { 744 this.clearGcTimeout(); 745 } 746 scheduleGc() { 747 this.clearGcTimeout(); 748 if (isValidTimeout(this.gcTime)) { 749 this.#gcTimeout = timeoutManager.setTimeout(() => { 750 this.optionalRemove(); 751 }, this.gcTime); 752 } 753 } 754 updateGcTime(newGcTime) { 755 this.gcTime = Math.max( 756 this.gcTime || 0, 757 newGcTime ?? (isServer ? Infinity : 5 * 60 * 1e3) 758 ); 759 } 760 clearGcTimeout() { 761 if (this.#gcTimeout) { 762 timeoutManager.clearTimeout(this.#gcTimeout); 763 this.#gcTimeout = void 0; 764 } 765 } 766}; 767 768var Query = class extends Removable { 769 #initialState; 770 #revertState; 771 #cache; 772 #client; 773 #retryer; 774 #defaultOptions; 775 #abortSignalConsumed; 776 constructor(config) { 777 super(); 778 this.#abortSignalConsumed = false; 779 this.#defaultOptions = config.defaultOptions; 780 this.setOptions(config.options); 781 this.observers = []; 782 this.#client = config.client; 783 this.#cache = this.#client.getQueryCache(); 784 this.queryKey = config.queryKey; 785 this.queryHash = config.queryHash; 786 this.#initialState = getDefaultState$1(this.options); 787 this.state = config.state ?? this.#initialState; 788 this.scheduleGc(); 789 } 790 get meta() { 791 return this.options.meta; 792 } 793 get promise() { 794 return this.#retryer?.promise; 795 } 796 setOptions(options) { 797 this.options = { ...this.#defaultOptions, ...options }; 798 this.updateGcTime(this.options.gcTime); 799 if (this.state && this.state.data === void 0) { 800 const defaultState = getDefaultState$1(this.options); 801 if (defaultState.data !== void 0) { 802 this.setData(defaultState.data, { 803 updatedAt: defaultState.dataUpdatedAt, 804 manual: true 805 }); 806 this.#initialState = defaultState; 807 } 808 } 809 } 810 optionalRemove() { 811 if (!this.observers.length && this.state.fetchStatus === "idle") { 812 this.#cache.remove(this); 813 } 814 } 815 setData(newData, options) { 816 const data = replaceData(this.state.data, newData, this.options); 817 this.#dispatch({ 818 data, 819 type: "success", 820 dataUpdatedAt: options?.updatedAt, 821 manual: options?.manual 822 }); 823 return data; 824 } 825 setState(state, setStateOptions) { 826 this.#dispatch({ type: "setState", state, setStateOptions }); 827 } 828 cancel(options) { 829 const promise = this.#retryer?.promise; 830 this.#retryer?.cancel(options); 831 return promise ? promise.then(noop$3).catch(noop$3) : Promise.resolve(); 832 } 833 destroy() { 834 super.destroy(); 835 this.cancel({ silent: true }); 836 } 837 reset() { 838 this.destroy(); 839 this.setState(this.#initialState); 840 } 841 isActive() { 842 return this.observers.some( 843 (observer) => resolveEnabled(observer.options.enabled, this) !== false 844 ); 845 } 846 isDisabled() { 847 if (this.getObserversCount() > 0) { 848 return !this.isActive(); 849 } 850 return this.options.queryFn === skipToken || this.state.dataUpdateCount + this.state.errorUpdateCount === 0; 851 } 852 isStatic() { 853 if (this.getObserversCount() > 0) { 854 return this.observers.some( 855 (observer) => resolveStaleTime(observer.options.staleTime, this) === "static" 856 ); 857 } 858 return false; 859 } 860 isStale() { 861 if (this.getObserversCount() > 0) { 862 return this.observers.some( 863 (observer) => observer.getCurrentResult().isStale 864 ); 865 } 866 return this.state.data === void 0 || this.state.isInvalidated; 867 } 868 isStaleByTime(staleTime = 0) { 869 if (this.state.data === void 0) { 870 return true; 871 } 872 if (staleTime === "static") { 873 return false; 874 } 875 if (this.state.isInvalidated) { 876 return true; 877 } 878 return !timeUntilStale(this.state.dataUpdatedAt, staleTime); 879 } 880 onFocus() { 881 const observer = this.observers.find((x) => x.shouldFetchOnWindowFocus()); 882 observer?.refetch({ cancelRefetch: false }); 883 this.#retryer?.continue(); 884 } 885 onOnline() { 886 const observer = this.observers.find((x) => x.shouldFetchOnReconnect()); 887 observer?.refetch({ cancelRefetch: false }); 888 this.#retryer?.continue(); 889 } 890 addObserver(observer) { 891 if (!this.observers.includes(observer)) { 892 this.observers.push(observer); 893 this.clearGcTimeout(); 894 this.#cache.notify({ type: "observerAdded", query: this, observer }); 895 } 896 } 897 removeObserver(observer) { 898 if (this.observers.includes(observer)) { 899 this.observers = this.observers.filter((x) => x !== observer); 900 if (!this.observers.length) { 901 if (this.#retryer) { 902 if (this.#abortSignalConsumed) { 903 this.#retryer.cancel({ revert: true }); 904 } else { 905 this.#retryer.cancelRetry(); 906 } 907 } 908 this.scheduleGc(); 909 } 910 this.#cache.notify({ type: "observerRemoved", query: this, observer }); 911 } 912 } 913 getObserversCount() { 914 return this.observers.length; 915 } 916 invalidate() { 917 if (!this.state.isInvalidated) {
918 this.#dispatch({ type: "invalidate" }); 919 } 920 } 921 async fetch(options, fetchOptions) { 922 if (this.state.fetchStatus !== "idle" && // If the promise in the retyer is already rejected, we have to definitely 923 // re-start the fetch; there is a chance that the query is still in a 924 // pending state when that happens 925 this.#retryer?.status() !== "rejected") { 926 if (this.state.data !== void 0 && fetchOptions?.cancelRefetch) { 927 this.cancel({ silent: true }); 928 } else if (this.#retryer) { 929 this.#retryer.continueRetry(); 930 return this.#retryer.promise; 931 } 932 } 933 if (options) { 934 this.setOptions(options); 935 } 936 if (!this.options.queryFn) { 937 const observer = this.observers.find((x) => x.options.queryFn); 938 if (observer) { 939 this.setOptions(observer.options); 940 } 941 } 942 const abortController = new AbortController(); 943 const addSignalProperty = (object) => { 944 Object.defineProperty(object, "signal", { 945 enumerable: true, 946 get: () => { 947 this.#abortSignalConsumed = true; 948 return abortController.signal; 949 } 950 }); 951 }; 952 const fetchFn = () => { 953 const queryFn = ensureQueryFn(this.options, fetchOptions); 954 const createQueryFnContext = () => { 955 const queryFnContext2 = { 956 client: this.#client, 957 queryKey: this.queryKey, 958 meta: this.meta 959 }; 960 addSignalProperty(queryFnContext2); 961 return queryFnContext2; 962 }; 963 const queryFnContext = createQueryFnContext(); 964 this.#abortSignalConsumed = false; 965 if (this.options.persister) { 966 return this.options.persister( 967 queryFn, 968 queryFnContext, 969 this 970 ); 971 } 972 return queryFn(queryFnContext); 973 }; 974 const createFetchContext = () => { 975 const context2 = { 976 fetchOptions, 977 options: this.options, 978 queryKey: this.queryKey, 979 client: this.#client, 980 state: this.state, 981 fetchFn 982 }; 983 addSignalProperty(context2); 984 return context2; 985 }; 986 const context = createFetchContext(); 987 this.options.behavior?.onFetch(context, this); 988 this.#revertState = this.state; 989 if (this.state.fetchStatus === "idle" || this.state.fetchMeta !== context.fetchOptions?.meta) { 990 this.#dispatch({ type: "fetch", meta: context.fetchOptions?.meta }); 991 } 992 this.#retryer = createRetryer({ 993 initialPromise: fetchOptions?.initialPromise, 994 fn: context.fetchFn, 995 onCancel: (error) => { 996 if (error instanceof CancelledError && error.revert) { 997 this.setState({ 998 ...this.#revertState, 999 fetchStatus: "idle" 1000 }); 1001 } 1002 abortController.abort(); 1003 }, 1004 onFail: (failureCount, error) => { 1005 this.#dispatch({ type: "failed", failureCount, error }); 1006 }, 1007 onPause: () => { 1008 this.#dispatch({ type: "pause" }); 1009 }, 1010 onContinue: () => { 1011 this.#dispatch({ type: "continue" }); 1012 }, 1013 retry: context.options.retry, 1014 retryDelay: context.options.retryDelay, 1015 networkMode: context.options.networkMode, 1016 canRun: () => true 1017 }); 1018 try { 1019 const data = await this.#retryer.start(); 1020 if (data === void 0) { 1021 if (false) ; 1022 throw new Error(`${this.queryHash} data is undefined`); 1023 } 1024 this.setData(data); 1025 this.#cache.config.onSuccess?.(data, this); 1026 this.#cache.config.onSettled?.( 1027 data, 1028 this.state.error, 1029 this 1030 ); 1031 return data; 1032 } catch (error) { 1033 if (error instanceof CancelledError) { 1034 if (error.silent) { 1035 return this.#retryer.promise; 1036 } else if (error.revert) { 1037 if (this.state.data === void 0) { 1038 throw error; 1039 } 1040 return this.state.data; 1041 } 1042 } 1043 this.#dispatch({ 1044 type: "error", 1045 error 1046 }); 1047 this.#cache.config.onError?.( 1048 error, 1049 this 1050 ); 1051 this.#cache.config.onSettled?.( 1052 this.state.data, 1053 error, 1054 this 1055 ); 1056 throw error; 1057 } finally { 1058 this.scheduleGc(); 1059 } 1060 } 1061 #dispatch(action) { 1062 const reducer = (state) => { 1063 switch (action.type) { 1064 case "failed": 1065 return { 1066 ...state, 1067 fetchFailureCount: action.failureCount, 1068 fetchFailureReason: action.error 1069 }; 1070 case "pause": 1071 return { 1072 ...state, 1073 fetchStatus: "paused" 1074 }; 1075 case "continue": 1076 return { 1077 ...state, 1078 fetchStatus: "fetching" 1079 }; 1080 case "fetch": 1081 return { 1082 ...state, 1083 ...fetchState(state.data, this.options), 1084 fetchMeta: action.meta ?? null 1085 }; 1086 case "success": 1087 const newState = { 1088 ...state, 1089 data: action.data, 1090 dataUpdateCount: state.dataUpdateCount + 1, 1091 dataUpdatedAt: action.dataUpdatedAt ?? Date.now(), 1092 error: null, 1093 isInvalidated: false, 1094 status: "success", 1095 ...!action.manual && { 1096 fetchStatus: "idle", 1097 fetchFailureCount: 0, 1098 fetchFailureReason: null 1099 } 1100 }; 1101 this.#revertState = action.manual ? newState : void 0; 1102 return newState; 1103 case "error": 1104 const error = action.error; 1105 return { 1106 ...state, 1107 error,
1108 errorUpdateCount: state.errorUpdateCount + 1, 1109 errorUpdatedAt: Date.now(), 1110 fetchFailureCount: state.fetchFailureCount + 1, 1111 fetchFailureReason: error, 1112 fetchStatus: "idle", 1113 status: "error" 1114 }; 1115 case "invalidate": 1116 return { 1117 ...state, 1118 isInvalidated: true 1119 }; 1120 case "setState": 1121 return { 1122 ...state, 1123 ...action.state 1124 }; 1125 } 1126 }; 1127 this.state = reducer(this.state); 1128 notifyManager.batch(() => { 1129 this.observers.forEach((observer) => { 1130 observer.onQueryUpdate(); 1131 }); 1132 this.#cache.notify({ query: this, type: "updated", action }); 1133 }); 1134 } 1135}; 1136function fetchState(data, options) { 1137 return { 1138 fetchFailureCount: 0, 1139 fetchFailureReason: null, 1140 fetchStatus: canFetch(options.networkMode) ? "fetching" : "paused", 1141 ...data === void 0 && { 1142 error: null, 1143 status: "pending" 1144 } 1145 }; 1146} 1147function getDefaultState$1(options) { 1148 const data = typeof options.initialData === "function" ? options.initialData() : options.initialData; 1149 const hasData = data !== void 0; 1150 const initialDataUpdatedAt = hasData ? typeof options.initialDataUpdatedAt === "function" ? options.initialDataUpdatedAt() : options.initialDataUpdatedAt : 0; 1151 return { 1152 data, 1153 dataUpdateCount: 0, 1154 dataUpdatedAt: hasData ? initialDataUpdatedAt ?? Date.now() : 0, 1155 error: null, 1156 errorUpdateCount: 0, 1157 errorUpdatedAt: 0, 1158 fetchFailureCount: 0, 1159 fetchFailureReason: null, 1160 fetchMeta: null, 1161 isInvalidated: false, 1162 status: hasData ? "success" : "pending", 1163 fetchStatus: "idle" 1164 }; 1165} 1166
1167// src/queryObserver.ts 1168var QueryObserver = class extends Subscribable { 1169 constructor(client, options) { 1170 super(); 1171 this.options = options; 1172 this.#client = client; 1173 this.#selectError = null; 1174 this.#currentThenable = pendingThenable(); 1175 this.bindMethods(); 1176 this.setOptions(options); 1177 } 1178 #client; 1179 #currentQuery = void 0; 1180 #currentQueryInitialState = void 0; 1181 #currentResult = void 0; 1182 #currentResultState; 1183 #currentResultOptions; 1184 #currentThenable; 1185 #selectError; 1186 #selectFn; 1187 #selectResult; 1188 // This property keeps track of the last query with defined data. 1189 // It will be used to pass the previous data and query to the placeholder function between renders. 1190 #lastQueryWithDefinedData; 1191 #staleTimeoutId; 1192 #refetchIntervalId; 1193 #currentRefetchInterval; 1194 #trackedProps = /* @__PURE__ */ new Set(); 1195 bindMethods() { 1196 this.refetch = this.refetch.bind(this); 1197 } 1198 onSubscribe() { 1199 if (this.listeners.size === 1) { 1200 this.#currentQuery.addObserver(this); 1201 if (shouldFetchOnMount(this.#currentQuery, this.options)) { 1202 this.#executeFetch(); 1203 } else { 1204 this.updateResult(); 1205 } 1206 this.#updateTimers(); 1207 } 1208 } 1209 onUnsubscribe() { 1210 if (!this.hasListeners()) { 1211 this.destroy(); 1212 } 1213 } 1214 shouldFetchOnReconnect() { 1215 return shouldFetchOn( 1216 this.#currentQuery, 1217 this.options, 1218 this.options.refetchOnReconnect 1219 ); 1220 } 1221 shouldFetchOnWindowFocus() { 1222 return shouldFetchOn( 1223 this.#currentQuery, 1224 this.options, 1225 this.options.refetchOnWindowFocus 1226 ); 1227 } 1228 destroy() { 1229 this.listeners = /* @__PURE__ */ new Set(); 1230 this.#clearStaleTimeout(); 1231 this.#clearRefetchInterval(); 1232 this.#currentQuery.removeObserver(this); 1233 } 1234 setOptions(options) { 1235 const prevOptions = this.options; 1236 const prevQuery = this.#currentQuery; 1237 this.options = this.#client.defaultQueryOptions(options); 1238 if (this.options.enabled !== void 0 && typeof this.options.enabled !== "boolean" && typeof this.options.enabled !== "function" && typeof resolveEnabled(this.options.enabled, this.#currentQuery) !== "boolean") { 1239 throw new Error( 1240 "Expected enabled to be a boolean or a callback that returns a boolean" 1241 ); 1242 } 1243 this.#updateQuery(); 1244 this.#currentQuery.setOptions(this.options); 1245 if (prevOptions._defaulted && !shallowEqualObjects(this.options, prevOptions)) { 1246 this.#client.getQueryCache().notify({ 1247 type: "observerOptionsUpdated", 1248 query: this.#currentQuery, 1249 observer: this 1250 }); 1251 } 1252 const mounted = this.hasListeners(); 1253 if (mounted && shouldFetchOptionally( 1254 this.#currentQuery, 1255 prevQuery, 1256 this.options, 1257 prevOptions 1258 )) { 1259 this.#executeFetch(); 1260 } 1261 this.updateResult(); 1262 if (mounted && (this.#currentQuery !== prevQuery || resolveEnabled(this.options.enabled, this.#currentQuery) !== resolveEnabled(prevOptions.enabled, this.#currentQuery) || resolveStaleTime(this.options.staleTime, this.#currentQuery) !== resolveStaleTime(prevOptions.staleTime, this.#currentQuery))) { 1263 this.#updateStaleTimeout(); 1264 } 1265 const nextRefetchInterval = this.#computeRefetchInterval(); 1266 if (mounted && (this.#currentQuery !== prevQuery || resolveEnabled(this.options.enabled, this.#currentQuery) !== resolveEnabled(prevOptions.enabled, this.#currentQuery) || nextRefetchInterval !== this.#currentRefetchInterval)) { 1267 this.#updateRefetchInterval(nextRefetchInterval); 1268 } 1269 } 1270 getOptimisticResult(options) { 1271 const query = this.#client.getQueryCache().build(this.#client, options); 1272 const result = this.createResult(query, options); 1273 if (shouldAssignObserverCurrentProperties(this, result)) { 1274 this.#currentResult = result; 1275 this.#currentResultOptions = this.options; 1276 this.#currentResultState = this.#currentQuery.state; 1277 } 1278 return result; 1279 } 1280 getCurrentResult() { 1281 return this.#currentResult; 1282 } 1283 trackResult(result, onPropTracked) { 1284 return new Proxy(result, { 1285 get: (target, key) => { 1286 this.trackProp(key); 1287 onPropTracked?.(key); 1288 if (key === "promise" && !this.options.experimental_prefetchInRender && this.#currentThenable.status === "pending") { 1289 this.#currentThenable.reject( 1290 new Error( 1291 "experimental_prefetchInRender feature flag is not enabled" 1292 ) 1293 ); 1294 } 1295 return Reflect.get(target, key); 1296 } 1297 }); 1298 } 1299 trackProp(key) { 1300 this.#trackedProps.add(key); 1301 } 1302 getCurrentQuery() { 1303 return this.#currentQuery; 1304 } 1305 refetch({ ...options } = {}) { 1306 return this.fetch({ 1307 ...options 1308 }); 1309 } 1310 fetchOptimistic(options) { 1311 const defaultedOptions = this.#client.defaultQueryOptions(options); 1312 const query = this.#client.getQueryCache().build(this.#client, defaultedOptions); 1313 return query.fetch().then(() => this.createResult(query, defaultedOptions)); 1314 } 1315 fetch(fetchOptions) { 1316 return this.#executeFetch({ 1317 ...fetchOptions, 1318 cancelRefetch: fetchOptions.cancelRefetch ?? true 1319 }).then(() => { 1320 this.updateResult(); 1321 return this.#currentResult; 1322 }); 1323 } 1324 #executeFetch(fetchOptions) { 1325 this.#updateQuery(); 1326 let promise = this.#currentQuery.fetch( 1327 this.options, 1328 fetchOptions 1329 ); 1330 if (!fetchOptions?.throwOnError) { 1331 promise = promise.catch(noop$3); 1332 } 1333 return promise; 1334 } 1335 #updateStaleTimeout() { 1336 this.#clearStaleTimeout(); 1337 const staleTime = resolveStaleTime( 1338 this.options.staleTime, 1339 this.#currentQuery 1340 ); 1341 if (isServer || this.#currentResult.isStale || !isValidTimeout(staleTime)) { 1342 return; 1343 } 1344 const time = timeUntilStale(this.#currentResult.dataUpdatedAt, staleTime); 1345 const timeout = time + 1; 1346 this.#staleTimeoutId = timeoutManager.setTimeout(() => { 1347 if (!this.#currentResult.isStale) { 1348 this.updateResult(); 1349 } 1350 }, timeout); 1351 } 1352 #computeRefetchInterval() { 1353 return (typeof this.options.refetchInterval === "function" ? this.options.refetchInterval(this.#currentQuery) : this.options.refetchInterval) ?? false; 1354 } 1355 #updateRefetchInterval(nextInterval) { 1356 this.#clearRefetchInterval(); 1357 this.#currentRefetchInterval = nextInterval; 1358 if (isServer || resolveEnabled(this.options.enabled, this.#currentQuery) === false || !isValidTimeout(this.#currentRefetchInterval) || this.#currentRefetchInterval === 0) { 1359 return; 1360 } 1361 this.#refetchIntervalId = timeoutManager.setInterval(() => {
1362 if (this.options.refetchIntervalInBackground || focusManager.isFocused()) { 1363 this.#executeFetch(); 1364 } 1365 }, this.#currentRefetchInterval); 1366 } 1367 #updateTimers() { 1368 this.#updateStaleTimeout(); 1369 this.#updateRefetchInterval(this.#computeRefetchInterval()); 1370 } 1371 #clearStaleTimeout() { 1372 if (this.#staleTimeoutId) { 1373 timeoutManager.clearTimeout(this.#staleTimeoutId); 1374 this.#staleTimeoutId = void 0; 1375 } 1376 } 1377 #clearRefetchInterval() { 1378 if (this.#refetchIntervalId) { 1379 timeoutManager.clearInterval(this.#refetchIntervalId); 1380 this.#refetchIntervalId = void 0; 1381 } 1382 } 1383 createResult(query, options) { 1384 const prevQuery = this.#currentQuery; 1385 const prevOptions = this.options; 1386 const prevResult = this.#currentResult; 1387 const prevResultState = this.#currentResultState; 1388 const prevResultOptions = this.#currentResultOptions; 1389 const queryChange = query !== prevQuery; 1390 const queryInitialState = queryChange ? query.state : this.#currentQueryInitialState; 1391 const { state } = query; 1392 let newState = { ...state }; 1393 let isPlaceholderData = false; 1394 let data; 1395 if (options._optimisticResults) { 1396 const mounted = this.hasListeners(); 1397 const fetchOnMount = !mounted && shouldFetchOnMount(query, options); 1398 const fetchOptionally = mounted && shouldFetchOptionally(query, prevQuery, options, prevOptions); 1399 if (fetchOnMount || fetchOptionally) { 1400 newState = { 1401 ...newState, 1402 ...fetchState(state.data, query.options) 1403 }; 1404 } 1405 if (options._optimisticResults === "isRestoring") { 1406 newState.fetchStatus = "idle"; 1407 } 1408 } 1409 let { error, errorUpdatedAt, status } = newState; 1410 data = newState.data; 1411 let skipSelect = false; 1412 if (options.placeholderData !== void 0 && data === void 0 && status === "pending") { 1413 let placeholderData; 1414 if (prevResult?.isPlaceholderData && options.placeholderData === prevResultOptions?.placeholderData) { 1415 placeholderData = prevResult.data; 1416 skipSelect = true; 1417 } else { 1418 placeholderData = typeof options.placeholderData === "function" ? options.placeholderData( 1419 this.#lastQueryWithDefinedData?.state.data, 1420 this.#lastQueryWithDefinedData 1421 ) : options.placeholderData; 1422 } 1423 if (placeholderData !== void 0) { 1424 status = "success"; 1425 data = replaceData( 1426 prevResult?.data, 1427 placeholderData, 1428 options 1429 ); 1430 isPlaceholderData = true; 1431 } 1432 } 1433 if (options.select && data !== void 0 && !skipSelect) { 1434 if (prevResult && data === prevResultState?.data && options.select === this.#selectFn) { 1435 data = this.#selectResult; 1436 } else { 1437 try { 1438 this.#selectFn = options.select; 1439 data = options.select(data); 1440 data = replaceData(prevResult?.data, data, options); 1441 this.#selectResult = data; 1442 this.#selectError = null; 1443 } catch (selectError) { 1444 this.#selectError = selectError; 1445 } 1446 } 1447 } 1448 if (this.#selectError) { 1449 error = this.#selectError; 1450 data = this.#selectResult; 1451 errorUpdatedAt = Date.now(); 1452 status = "error"; 1453 } 1454 const isFetching = newState.fetchStatus === "fetching"; 1455 const isPending = status === "pending"; 1456 const isError = status === "error"; 1457 const isLoading = isPending && isFetching; 1458 const hasData = data !== void 0; 1459 const result = { 1460 status, 1461 fetchStatus: newState.fetchStatus, 1462 isPending, 1463 isSuccess: status === "success", 1464 isError, 1465 isInitialLoading: isLoading, 1466 isLoading, 1467 data, 1468 dataUpdatedAt: newState.dataUpdatedAt, 1469 error, 1470 errorUpdatedAt, 1471 failureCount: newState.fetchFailureCount, 1472 failureReason: newState.fetchFailureReason, 1473 errorUpdateCount: newState.errorUpdateCount, 1474 isFetched: newState.dataUpdateCount > 0 || newState.errorUpdateCount > 0, 1475 isFetchedAfterMount: newState.dataUpdateCount >
1475 queryInitialState.dataUpdateCount || newState.errorUpdateCount > queryInitialState.errorUpdateCount, 1476 isFetching, 1477 isRefetching: isFetching && !isPending, 1478 isLoadingError: isError && !hasData, 1479 isPaused: newState.fetchStatus === "paused", 1480 isPlaceholderData, 1481 isRefetchError: isError && hasData, 1482 isStale: isStale(query, options), 1483 refetch: this.refetch, 1484 promise: this.#currentThenable, 1485 isEnabled: resolveEnabled(options.enabled, query) !== false 1486 }; 1487 const nextResult = result; 1488 if (this.options.experimental_prefetchInRender) { 1489 const finalizeThenableIfPossible = (thenable) => { 1490 if (nextResult.status === "error") { 1491 thenable.reject(nextResult.error); 1492 } else if (nextResult.data !== void 0) { 1493 thenable.resolve(nextResult.data); 1494 } 1495 }; 1496 const recreateThenable = () => { 1497 const pending = this.#currentThenable = nextResult.promise = pendingThenable(); 1498 finalizeThenableIfPossible(pending); 1499 }; 1500 const prevThenable = this.#currentThenable; 1501 switch (prevThenable.status) { 1502 case "pending": 1503 if (query.queryHash === prevQuery.queryHash) { 1504 finalizeThenableIfPossible(prevThenable); 1505 } 1506 break; 1507 case "fulfilled": 1508 if (nextResult.status === "error" || nextResult.data !== prevThenable.value) { 1509 recreateThenable(); 1510 } 1511 break; 1512 case "rejected": 1513 if (nextResult.status !== "error" || nextResult.error !== prevThenable.reason) { 1514 recreateThenable(); 1515 } 1516 break; 1517 } 1518 } 1519 return nextResult; 1520 } 1521 updateResult() { 1522 const prevResult = this.#currentResult; 1523 const nextResult = this.createResult(this.#currentQuery, this.options); 1524 this.#currentResultState = this.#currentQuery.state; 1525 this.#currentResultOptions = this.options; 1526 if (this.#currentResultState.data !== void 0) { 1527 this.#lastQueryWithDefinedData = this.#currentQuery; 1528 } 1529 if (shallowEqualObjects(nextResult, prevResult)) { 1530 return; 1531 } 1532 this.#currentResult = nextResult; 1533 const shouldNotifyListeners = () => { 1534 if (!prevResult) { 1535 return true; 1536 } 1537 const { notifyOnChangeProps } = this.options; 1538 const notifyOnChangePropsValue = typeof notifyOnChangeProps === "function" ? notifyOnChangeProps() : notifyOnChangeProps; 1539 if (notifyOnChangePropsValue === "all" || !notifyOnChangePropsValue && !this.#trackedProps.size) { 1540 return true; 1541 } 1542 const includedProps = new Set( 1543 notifyOnChangePropsValue ?? this.#trackedProps 1544 ); 1545 if (this.options.throwOnError) { 1546 includedProps.add("error"); 1547 } 1548 return Object.keys(this.#currentResult).some((key) => { 1549 const typedKey = key; 1550 const changed = this.#currentResult[typedKey] !== prevResult[typedKey]; 1551 return changed && includedProps.has(typedKey); 1552 }); 1553 }; 1554 this.#notify({ listeners: shouldNotifyListeners() }); 1555 } 1556 #updateQuery() { 1557 const query = this.#client.getQueryCache().build(this.#client, this.options); 1558 if (query === this.#currentQuery) { 1559 return; 1560 } 1561 const prevQuery = this.#currentQuery; 1562 this.#currentQuery = query; 1563 this.#currentQueryInitialState = query.state; 1564 if (this.hasListeners()) { 1565 prevQuery?.removeObserver(this); 1566 query.addObserver(this); 1567 } 1568 } 1569 onQueryUpdate() { 1570 this.updateResult(); 1571 if (this.hasListeners()) { 1572 this.#updateTimers(); 1573 } 1574 } 1575 #notify(notifyOptions) { 1576 notifyManager.batch(() => { 1577 if (notifyOptions.listeners) { 1578 this.listeners.forEach((listener) => { 1579 listener(this.#currentResult); 1580 }); 1581 } 1582 this.#client.getQueryCache().notify({ 1583 query: this.#currentQuery, 1584 type: "observerResultsUpdated" 1585 }); 1586 }); 1587 } 1588}; 1589function shouldLoadOnMount(query, options) { 1590 return resolveEnabled(options.enabled, query) !== false && query.state.data === void 0 && !(query.state.status === "error" && options.retryOnMount === false); 1591} 1592function shouldFetchOnMount(query, options) { 1593 return shouldLoadOnMount(query, options) || query.state.data !== void 0 && shouldFetchOn(query, options, options.refetchOnMount); 1594} 1595function shouldFetchOn(query, options, field) { 1596 if (resolveEnabled(options.enabled, query) !== false && resolveStaleTime(options.staleTime, query) !== "static") { 1597 const value = typeof field === "function" ? field(query) : field; 1598 return value === "always" || value !== false && isStale(query, options); 1599 } 1600 return false;
1601} 1602function shouldFetchOptionally(query, prevQuery, options, prevOptions) { 1603 return (query !== prevQuery || resolveEnabled(prevOptions.enabled, query) === false) && (!options.suspense || query.state.status !== "error") && isStale(query, options); 1604} 1605function isStale(query, options) { 1606 return resolveEnabled(options.enabled, query) !== false && query.isStaleByTime(resolveStaleTime(options.staleTime, query)); 1607} 1608function shouldAssignObserverCurrentProperties(observer, optimisticResult) { 1609 if (!shallowEqualObjects(observer.getCurrentResult(), optimisticResult)) { 1610 return true; 1611 } 1612 return false; 1613} 1614
1615// src/infiniteQueryBehavior.ts 1616function infiniteQueryBehavior(pages) { 1617 return { 1618 onFetch: (context, query) => { 1619 const options = context.options; 1620 const direction = context.fetchOptions?.meta?.fetchMore?.direction; 1621 const oldPages = context.state.data?.pages || []; 1622 const oldPageParams = context.state.data?.pageParams || []; 1623 let result = { pages: [], pageParams: [] }; 1624 let currentPage = 0; 1625 const fetchFn = async () => { 1626 let cancelled = false; 1627 const addSignalProperty = (object) => { 1628 Object.defineProperty(object, "signal", { 1629 enumerable: true, 1630 get: () => { 1631 if (context.signal.aborted) { 1632 cancelled = true; 1633 } else { 1634 context.signal.addEventListener("abort", () => { 1635 cancelled = true; 1636 }); 1637 } 1638 return context.signal; 1639 } 1640 }); 1641 }; 1642 const queryFn = ensureQueryFn(context.options, context.fetchOptions); 1643 const fetchPage = async (data, param, previous) => { 1644 if (cancelled) { 1645 return Promise.reject(); 1646 } 1647 if (param == null && data.pages.length) { 1648 return Promise.resolve(data); 1649 } 1650 const createQueryFnContext = () => { 1651 const queryFnContext2 = { 1652 client: context.client, 1653 queryKey: context.queryKey, 1654 pageParam: param, 1655 direction: previous ? "backward" : "forward", 1656 meta: context.options.meta 1657 }; 1658 addSignalProperty(queryFnContext2); 1659 return queryFnContext2; 1660 }; 1661 const queryFnContext = createQueryFnContext(); 1662 const page = await queryFn(queryFnContext); 1663 const { maxPages } = context.options; 1664 const addTo = previous ? addToStart : addToEnd; 1665 return { 1666 pages: addTo(data.pages, page, maxPages), 1667 pageParams: addTo(data.pageParams, param, maxPages) 1668 }; 1669 }; 1670 if (direction && oldPages.length) { 1671 const previous = direction === "backward"; 1672 const pageParamFn = previous ? getPreviousPageParam : getNextPageParam; 1673 const oldData = { 1674 pages: oldPages, 1675 pageParams: oldPageParams 1676 }; 1677 const param = pageParamFn(options, oldData); 1678 result = await fetchPage(oldData, param, previous); 1679 } else { 1680 const remainingPages = pages ?? oldPages.length; 1681 do { 1682 const param = currentPage === 0 ? oldPageParams[0] ?? options.initialPageParam : getNextPageParam(options, result); 1683 if (currentPage > 0 && param == null) { 1684 break; 1685 } 1686 result = await fetchPage(result, param); 1687 currentPage++; 1688 } while (currentPage < remainingPages); 1689 } 1690 return result; 1691 }; 1692 if (context.options.persister) { 1693 context.fetchFn = () => { 1694 return context.options.persister?.( 1695 fetchFn, 1696 { 1697 client: context.client, 1698 queryKey: context.queryKey, 1699 meta: context.options.meta, 1700 signal: context.signal 1701 }, 1702 query 1703 ); 1704 }; 1705 } else { 1706 context.fetchFn = fetchFn; 1707 } 1708 } 1709 }; 1710} 1711function getNextPageParam(options, { pages, pageParams }) { 1712 const lastIndex = pages.length - 1; 1713 return pages.length > 0 ? options.getNextPageParam( 1714 pages[lastIndex], 1715 pages, 1716 pageParams[lastIndex], 1717 pageParams 1718 ) : void 0; 1719} 1720function getPreviousPageParam(options, { pages, pageParams }) { 1721 return pages.length > 0 ? options.getPreviousPageParam?.(pages[0], pages, pageParams[0], pageParams) : void 0; 1722} 1723function hasNextPage(options, data) { 1724 if (!data) return false; 1725 return getNextPageParam(options, data) != null; 1726} 1727function hasPreviousPage(options, data) { 1728 if (!data || !options.getPreviousPageParam) return false; 1729 return getPreviousPageParam(options, data) != null; 1730} 1731
1732// src/infiniteQueryObserver.ts 1733var InfiniteQueryObserver = class extends QueryObserver { 1734 constructor(client, options) { 1735 super(client, options); 1736 } 1737 bindMethods() { 1738 super.bindMethods(); 1739 this.fetchNextPage = this.fetchNextPage.bind(this); 1740 this.fetchPreviousPage = this.fetchPreviousPage.bind(this); 1741 } 1742 setOptions(options) { 1743 super.setOptions({ 1744 ...options, 1745 behavior: infiniteQueryBehavior() 1746 }); 1747 } 1748 getOptimisticResult(options) { 1749 options.behavior = infiniteQueryBehavior(); 1750 return super.getOptimisticResult(options); 1751 } 1752 fetchNextPage(options) { 1753 return this.fetch({ 1754 ...options, 1755 meta: { 1756 fetchMore: { direction: "forward" } 1757 } 1758 }); 1759 } 1760 fetchPreviousPage(options) { 1761 return this.fetch({ 1762 ...options, 1763 meta: { 1764 fetchMore: { direction: "backward" } 1765 } 1766 }); 1767 } 1768 createResult(query, options) { 1769 const { state } = query; 1770 const parentResult = super.createResult(query, options); 1771 const { isFetching, isRefetching, isError, isRefetchError } = parentResult; 1772 const fetchDirection = state.fetchMeta?.fetchMore?.direction; 1773 const isFetchNextPageError = isError && fetchDirection === "forward"; 1774 const isFetchingNextPage = isFetching && fetchDirection === "forward"; 1775 const isFetchPreviousPageError = isError && fetchDirection === "backward"; 1776 const isFetchingPreviousPage = isFetching && fetchDirection === "backward"; 1777 const result = { 1778 ...parentResult, 1779 fetchNextPage: this.fetchNextPage, 1780 fetchPreviousPage: this.fetchPreviousPage, 1781 hasNextPage: hasNextPage(options, state.data), 1782 hasPreviousPage: hasPreviousPage(options, state.data), 1783 isFetchNextPageError, 1784 isFetchingNextPage, 1785 isFetchPreviousPageError, 1786 isFetchingPreviousPage, 1787 isRefetchError: isRefetchError && !isFetchNextPageError && !isFetchPreviousPageError, 1788 isRefetching: isRefetching && !isFetchingNextPage && !isFetchingPreviousPage 1789 }; 1790 return result; 1791 } 1792}; 1793
1794// src/mutation.ts 1795var Mutation = class extends Removable { 1796 #client; 1797 #observers; 1798 #mutationCache; 1799 #retryer; 1800 constructor(config) { 1801 super(); 1802 this.#client = config.client; 1803 this.mutationId = config.mutationId; 1804 this.#mutationCache = config.mutationCache; 1805 this.#observers = []; 1806 this.state = config.state || getDefaultState(); 1807 this.setOptions(config.options); 1808 this.scheduleGc(); 1809 } 1810 setOptions(options) { 1811 this.options = options; 1812 this.updateGcTime(this.options.gcTime); 1813 } 1814 get meta() { 1815 return this.options.meta; 1816 } 1817 addObserver(observer) { 1818 if (!this.#observers.includes(observer)) { 1819 this.#observers.push(observer); 1820 this.clearGcTimeout(); 1821 this.#mutationCache.notify({ 1822 type: "observerAdded", 1823 mutation: this, 1824 observer 1825 }); 1826 } 1827 } 1828 removeObserver(observer) { 1829 this.#observers = this.#observers.filter((x) => x !== observer); 1830 this.scheduleGc(); 1831 this.#mutationCache.notify({ 1832 type: "observerRemoved", 1833 mutation: this, 1834 observer 1835 }); 1836 } 1837 optionalRemove() { 1838 if (!this.#observers.length) { 1839 if (this.state.status === "pending") { 1840 this.scheduleGc(); 1841 } else { 1842 this.#mutationCache.remove(this); 1843 } 1844 } 1845 } 1846 continue() { 1847 return this.#retryer?.continue() ?? // continuing a mutation assumes that variables are set, mutation must have been dehydrated before 1848 this.execute(this.state.variables); 1849 } 1850 async execute(variables) { 1851 const onContinue = () => { 1852 this.#dispatch({ type: "continue" }); 1853 }; 1854 const mutationFnContext = { 1855 client: this.#client, 1856 meta: this.options.meta, 1857 mutationKey: this.options.mutationKey 1858 }; 1859 this.#retryer = createRetryer({ 1860 fn: () => { 1861 if (!this.options.mutationFn) { 1862 return Promise.reject(new Error("No mutationFn found")); 1863 } 1864 return this.options.mutationFn(variables, mutationFnContext); 1865 }, 1866 onFail: (failureCount, error) => { 1867 this.#dispatch({ type: "failed", failureCount, error }); 1868 }, 1869 onPause: () => { 1870 this.#dispatch({ type: "pause" }); 1871 }, 1872 onContinue, 1873 retry: this.options.retry ?? 0, 1874 retryDelay: this.options.retryDelay, 1875 networkMode: this.options.networkMode, 1876 canRun: () => this.#mutationCache.canRun(this) 1877 }); 1878 const restored = this.state.status === "pending"; 1879 const isPaused = !this.#retryer.canStart(); 1880 try { 1881 if (restored) { 1882 onContinue(); 1883 } else { 1884 this.#dispatch({ type: "pending", variables, isPaused }); 1885 await this.#mutationCache.config.onMutate?.( 1886 variables, 1887 this, 1888 mutationFnContext 1889 ); 1890 const context = await this.options.onMutate?.( 1891 variables, 1892 mutationFnContext 1893 ); 1894 if (context !== this.state.context) { 1895 this.#dispatch({ 1896 type: "pending", 1897 context, 1898 variables, 1899 isPaused 1900 }); 1901 } 1902 } 1903 const data = await this.#retryer.start(); 1904 await this.#mutationCache.config.onSuccess?.( 1905 data, 1906 variables, 1907 this.state.context, 1908 this, 1909 mutationFnContext 1910 ); 1911 await this.options.onSuccess?.( 1912 data, 1913 variables, 1914 this.state.context, 1915 mutationFnContext 1916 ); 1917 await this.#mutationCache.config.onSettled?.( 1918 data, 1919 null, 1920 this.state.variables, 1921 this.state.context, 1922 this, 1923 mutationFnContext 1924 ); 1925 await this.options.onSettled?.( 1926 data, 1927 null, 1928 variables, 1929 this.state.context, 1930 mutationFnContext 1931 ); 1932 this.#dispatch({ type: "success", data }); 1933 return data; 1934 } catch (error) { 1935 try { 1936 await this.#mutationCache.config.onError?.( 1937 error, 1938 variables, 1939 this.state.context, 1940 this, 1941 mutationFnContext 1942 ); 1943 await this.options.onError?.( 1944 error, 1945 variables, 1946 this.state.context, 1947 mutationFnContext 1948 ); 1949 await this.#mutationCache.config.onSettled?.( 1950 void 0, 1951 error, 1952 this.state.variables, 1953 this.state.context, 1954 this, 1955 mutationFnContext 1956 ); 1957 await this.options.onSettled?.( 1958 void 0, 1959 error, 1960 variables, 1961 this.state.context, 1962 mutationFnContext 1963 ); 1964 throw error; 1965 } finally { 1966 this.#dispatch({ type: "error", error }); 1967 } 1968 } finally { 1969 this.#mutationCache.runNext(this); 1970 } 1971 } 1972 #dispatch(action) { 1973 const reducer = (state) => { 1974 switch (action.type) { 1975 case "failed": 1976 return { 1977 ...state, 1978 failureCount: action.failureCount, 1979 failureReason: action.error 1980 }; 1981 case "pause": 1982 return { 1983 ...state, 1984 isPaused: true 1985 }; 1986 case "continue": 1987 return { 1988 ...state, 1989 isPaused: false 1990 }; 1991 case "pending": 1992 return { 1993 ...state, 1994 context: action.context, 1995 data: void 0, 1996 failureCount: 0, 1997 failureReason: null, 1998 error: null, 1999 isPaused: action.isPaused, 2000 status: "pending", 2001 variables: action.variables, 2002 submittedAt: Date.now() 2003 }; 2004 case "success": 2005 return { 2006 ...state, 2007 data: action.data, 2008 failureCount: 0, 2009 failureReason: null, 2010 error: null, 2011 status: "success", 2012 isPaused: false 2013 }; 2014 case "error": 2015 return { 2016 ...state, 2017 data: void 0, 2018 error: action.error, 2019 failureCount: state.failureCount + 1, 2020 failureReason: action.error, 2021 isPaused: false, 2022 status: "error" 2023 }; 2024 } 2025 }; 2026 this.state = reducer(this.state); 2027 notifyManager.batch(() => {
2028 this.#observers.forEach((observer) => { 2029 observer.onMutationUpdate(action); 2030 }); 2031 this.#mutationCache.notify({ 2032 mutation: this, 2033 type: "updated", 2034 action 2035 }); 2036 }); 2037 } 2038}; 2039function getDefaultState() { 2040 return { 2041 context: void 0, 2042 data: void 0, 2043 error: null, 2044 failureCount: 0, 2045 failureReason: null, 2046 isPaused: false, 2047 status: "idle", 2048 variables: void 0, 2049 submittedAt: 0 2050 }; 2051} 2052
2053// src/mutationCache.ts 2054var MutationCache = class extends Subscribable { 2055 constructor(config = {}) { 2056 super(); 2057 this.config = config; 2058 this.#mutations = /* @__PURE__ */ new Set(); 2059 this.#scopes = /* @__PURE__ */ new Map(); 2060 this.#mutationId = 0; 2061 } 2062 #mutations; 2063 #scopes; 2064 #mutationId; 2065 build(client, options, state) { 2066 const mutation = new Mutation({ 2067 client, 2068 mutationCache: this, 2069 mutationId: ++this.#mutationId, 2070 options: client.defaultMutationOptions(options), 2071 state 2072 }); 2073 this.add(mutation); 2074 return mutation; 2075 } 2076 add(mutation) { 2077 this.#mutations.add(mutation); 2078 const scope = scopeFor(mutation); 2079 if (typeof scope === "string") { 2080 const scopedMutations = this.#scopes.get(scope); 2081 if (scopedMutations) { 2082 scopedMutations.push(mutation); 2083 } else { 2084 this.#scopes.set(scope, [mutation]); 2085 } 2086 } 2087 this.notify({ type: "added", mutation }); 2088 } 2089 remove(mutation) { 2090 if (this.#mutations.delete(mutation)) { 2091 const scope = scopeFor(mutation); 2092 if (typeof scope === "string") { 2093 const scopedMutations = this.#scopes.get(scope); 2094 if (scopedMutations) { 2095 if (scopedMutations.length > 1) { 2096 const index = scopedMutations.indexOf(mutation); 2097 if (index !== -1) { 2098 scopedMutations.splice(index, 1); 2099 } 2100 } else if (scopedMutations[0] === mutation) { 2101 this.#scopes.delete(scope); 2102 } 2103 } 2104 } 2105 } 2106 this.notify({ type: "removed", mutation }); 2107 } 2108 canRun(mutation) { 2109 const scope = scopeFor(mutation); 2110 if (typeof scope === "string") { 2111 const mutationsWithSameScope = this.#scopes.get(scope); 2112 const firstPendingMutation = mutationsWithSameScope?.find( 2113 (m) => m.state.status === "pending" 2114 ); 2115 return !firstPendingMutation || firstPendingMutation === mutation; 2116 } else { 2117 return true; 2118 } 2119 } 2120 runNext(mutation) { 2121 const scope = scopeFor(mutation); 2122 if (typeof scope === "string") { 2123 const foundMutation = this.#scopes.get(scope)?.find((m) =>
2123 m !== mutation && m.state.isPaused); 2124 return foundMutation?.continue() ?? Promise.resolve(); 2125 } else { 2126 return Promise.resolve(); 2127 } 2128 } 2129 clear() { 2130 notifyManager.batch(() => { 2131 this.#mutations.forEach((mutation) => { 2132 this.notify({ type: "removed", mutation }); 2133 }); 2134 this.#mutations.clear(); 2135 this.#scopes.clear(); 2136 }); 2137 } 2138 getAll() { 2139 return Array.from(this.#mutations); 2140 } 2141 find(filters) { 2142 const defaultedFilters = { exact: true, ...filters }; 2143 return this.getAll().find( 2144 (mutation) => matchMutation(defaultedFilters, mutation) 2145 ); 2146 } 2147 findAll(filters = {}) { 2148 return this.getAll().filter((mutation) => matchMutation(filters, mutation)); 2149 } 2150 notify(event) { 2151 notifyManager.batch(() => { 2152 this.listeners.forEach((listener) => { 2153 listener(event); 2154 }); 2155 }); 2156 } 2157 resumePausedMutations() { 2158 const pausedMutations = this.getAll().filter((x) => x.state.isPaused); 2159 return notifyManager.batch( 2160 () => Promise.all( 2161 pausedMutations.map((mutation) => mutation.continue().catch(noop$3)) 2162 ) 2163 ); 2164 } 2165}; 2166function scopeFor(mutation) { 2167 return mutation.options.scope?.id; 2168} 2169
2170// src/mutationObserver.ts 2171var MutationObserver$1 = class MutationObserver extends Subscribable { 2172 #client; 2173 #currentResult = void 0; 2174 #currentMutation; 2175 #mutateOptions; 2176 constructor(client, options) { 2177 super(); 2178 this.#client = client; 2179 this.setOptions(options); 2180 this.bindMethods(); 2181 this.#updateResult(); 2182 } 2183 bindMethods() { 2184 this.mutate = this.mutate.bind(this); 2185 this.reset = this.reset.bind(this); 2186 } 2187 setOptions(options) { 2188 const prevOptions = this.options; 2189 this.options = this.#client.defaultMutationOptions(options); 2190 if (!shallowEqualObjects(this.options, prevOptions)) { 2191 this.#client.getMutationCache().notify({ 2192 type: "observerOptionsUpdated", 2193 mutation: this.#currentMutation, 2194 observer: this 2195 }); 2196 } 2197 if (prevOptions?.mutationKey && this.options.mutationKey && hashKey(prevOptions.mutationKey) !== hashKey(this.options.mutationKey)) { 2198 this.reset(); 2199 } else if (this.#currentMutation?.state.status === "pending") { 2200 this.#currentMutation.setOptions(this.options); 2201 } 2202 } 2203 onUnsubscribe() { 2204 if (!this.hasListeners()) { 2205 this.#currentMutation?.removeObserver(this); 2206 } 2207 } 2208 onMutationUpdate(action) { 2209 this.#updateResult(); 2210 this.#notify(action); 2211 } 2212 getCurrentResult() { 2213 return this.#currentResult; 2214 } 2215 reset() { 2216 this.#currentMutation?.removeObserver(this); 2217 this.#currentMutation = void 0; 2218 this.#updateResult(); 2219 this.#notify(); 2220 } 2221 mutate(variables, options) { 2222 this.#mutateOptions = options; 2223 this.#currentMutation?.removeObserver(this); 2224 this.#currentMutation = this.#client.getMutationCache().build(this.#client, this.options); 2225 this.#currentMutation.addObserver(this); 2226 return this.#currentMutation.execute(variables); 2227 } 2228 #updateResult() { 2229 const state = this.#currentMutation?.state ?? getDefaultState(); 2230 this.#currentResult = { 2231 ...state, 2232 isPending: state.status === "pending", 2233 isSuccess: state.status === "success", 2234 isError: state.status === "error", 2235 isIdle: state.status === "idle", 2236 mutate: this.mutate, 2237 reset: this.reset 2238 }; 2239 } 2240 #notify(action) { 2241 notifyManager.batch(() => { 2242 if (this.#mutateOptions && this.hasListeners()) { 2243 const variables = this.#currentResult.variables; 2244 const onMutateResult = this.#currentResult.context; 2245 const context = { 2246 client: this.#client, 2247 meta: this.options.meta, 2248 mutationKey: this.options.mutationKey 2249 }; 2250 if (action?.type === "success") { 2251 this.#mutateOptions.onSuccess?.( 2252 action.data, 2253 variables, 2254 onMutateResult, 2255 context 2256 ); 2257 this.#mutateOptions.onSettled?.( 2258 action.data, 2259 null, 2260 variables, 2261 onMutateResult, 2262 context 2263 ); 2264 } else if (action?.type === "error") { 2265 this.#mutateOptions.onError?.( 2266 action.error, 2267 variables, 2268 onMutateResult, 2269 context 2270 ); 2271 this.#mutateOptions.onSettled?.( 2272 void 0, 2273 action.error, 2274 variables, 2275 onMutateResult, 2276 context 2277 ); 2278 } 2279 } 2280 this.listeners.forEach((listener) => { 2281 listener(this.#currentResult); 2282 }); 2283 }); 2284 } 2285}; 2286 2287function difference(array1, array2) { 2288 const excludeSet = new Set(array2); 2289 return array1.filter((x) => !excludeSet.has(x)); 2290} 2291function replaceAt(array, index, value) { 2292 const copy = array.slice(0); 2293 copy[index] = value; 2294 return copy; 2295} 2296var QueriesObserver = class extends Subscribable { 2297 #client; 2298 #result; 2299 #queries; 2300 #options; 2301 #observers; 2302 #combinedResult; 2303 #lastCombine; 2304 #lastResult; 2305 #observerMatches = []; 2306 constructor(client, queries, options) { 2307 super(); 2308 this.#client = client; 2309 this.#options = options; 2310 this.#queries = []; 2311 this.#observers = []; 2312 this.#result = []; 2313 this.setQueries(queries); 2314 } 2315 onSubscribe() { 2316 if (this.listeners.size === 1) {
2317 this.#observers.forEach((observer) => { 2318 observer.subscribe((result) => { 2319 this.#onUpdate(observer, result); 2320 }); 2321 }); 2322 } 2323 } 2324 onUnsubscribe() { 2325 if (!this.listeners.size) { 2326 this.destroy(); 2327 } 2328 } 2329 destroy() { 2330 this.listeners = /* @__PURE__ */ new Set(); 2331 this.#observers.forEach((observer) => { 2332 observer.destroy(); 2333 }); 2334 } 2335 setQueries(queries, options) { 2336 this.#queries = queries; 2337 this.#options = options; 2338 notifyManager.batch(() => { 2339 const prevObservers = this.#observers; 2340 const newObserverMatches = this.#findMatchingObservers(this.#queries); 2341 this.#observerMatches = newObserverMatches; 2342 newObserverMatches.forEach( 2343 (match) => match.observer.setOptions(match.defaultedQueryOptions) 2344 ); 2345 const newObservers = newObserverMatches.map((match) => match.observer); 2346 const newResult = newObservers.map( 2347 (observer) => observer.getCurrentResult() 2348 ); 2349 const hasLengthChange = prevObservers.length !== newObservers.length; 2350 const hasIndexChange = newObservers.some( 2351 (observer, index) => observer !== prevObservers[index] 2352 ); 2353 const hasStructuralChange = hasLengthChange || hasIndexChange;
2354 const hasResultChange = hasStructuralChange ? true : newResult.some((result, index) => { 2355 const prev = this.#result[index]; 2356 return !prev || !shallowEqualObjects(result, prev); 2357 }); 2358 if (!hasStructuralChange && !hasResultChange) return; 2359 if (hasStructuralChange) { 2360 this.#observers = newObservers; 2361 } 2362 this.#result = newResult; 2363 if (!this.hasListeners()) return; 2364 if (hasStructuralChange) { 2365 difference(prevObservers, newObservers).forEach((observer) => { 2366 observer.destroy(); 2367 }); 2368 difference(newObservers, prevObservers).forEach((observer) => { 2369 observer.subscribe((result) => { 2370 this.#onUpdate(observer, result); 2371 }); 2372 }); 2373 } 2374 this.#notify(); 2375 }); 2376 } 2377 getCurrentResult() { 2378 return this.#result; 2379 } 2380 getQueries() { 2381 return this.#observers.map((observer) => observer.getCurrentQuery()); 2382 } 2383 getObservers() { 2384 return this.#observers; 2385 } 2386 getOptimisticResult(queries, combine) { 2387 const matches = this.#findMatchingObservers(queries); 2388 const result = matches.map( 2389 (match) => match.observer.getOptimisticResult(match.defaultedQueryOptions) 2390 ); 2391 return [ 2392 result, 2393 (r) => { 2394 return this.#combineResult(r ?? result, combine); 2395 }, 2396 () => { 2397 return this.#trackResult(result, matches); 2398 } 2399 ]; 2400 } 2401 #trackResult(result, matches) { 2402 return matches.map((match, index) => { 2403 const observerResult = result[index]; 2404 return !match.defaultedQueryOptions.notifyOnChangeProps ? match.observer.trackResult(observerResult, (accessedProp) => { 2405 matches.forEach((m) => { 2406 m.observer.trackProp(accessedProp); 2407 }); 2408 }) : observerResult; 2409 }); 2410 } 2411 #combineResult(input, combine) { 2412 if (combine) { 2413 if (!this.#combinedResult || this.#result !== this.#lastResult || combine !== this.#lastCombine) { 2414 this.#lastCombine = combine; 2415 this.#lastResult = this.#result; 2416 this.#combinedResult = replaceEqualDeep( 2417 this.#combinedResult, 2418 combine(input) 2419 ); 2420 } 2421 return this.#combinedResult; 2422 } 2423 return input; 2424 } 2425 #findMatchingObservers(queries) { 2426 const prevObserversMap = new Map( 2427 this.#observers.map((observer) => [observer.options.queryHash, observer]) 2428 ); 2429 const observers = []; 2430 queries.forEach((options) => { 2431 const defaultedOptions = this.#client.defaultQueryOptions(options); 2432 const match = prevObserversMap.get(defaultedOptions.queryHash); 2433 if (match) { 2434 observers.push({ 2435 defaultedQueryOptions: defaultedOptions, 2436 observer: match 2437 }); 2438 } else { 2439 observers.push({ 2440 defaultedQueryOptions: defaultedOptions, 2441 observer: new QueryObserver(this.#client, defaultedOptions) 2442 }); 2443 } 2444 }); 2445 return observers; 2446 } 2447 #onUpdate(observer, result) { 2448 const index = this.#observers.indexOf(observer); 2449 if (index !== -1) { 2450 this.#result = replaceAt(this.#result, index, result); 2451 this.#notify(); 2452 } 2453 } 2454 #notify() { 2455 if (this.hasListeners()) { 2456 const previousResult = this.#combinedResult; 2457 const newTracked = this.#trackResult(this.#result, this.#observerMatches); 2458 const newResult = this.#combineResult(newTracked, this.#options?.combine); 2459 if (previousResult !== newResult) { 2460 notifyManager.batch(() => { 2461 this.listeners.forEach((listener) => { 2462 listener(this.#result); 2463 }); 2464 }); 2465 } 2466 } 2467 } 2468}; 2469
2470// src/queryCache.ts 2471var QueryCache = class extends Subscribable { 2472 constructor(config = {}) { 2473 super(); 2474 this.config = config; 2475 this.#queries = /* @__PURE__ */ new Map(); 2476 } 2477 #queries; 2478 build(client, options, state) { 2479 const queryKey = options.queryKey; 2480 const queryHash = options.queryHash ?? hashQueryKeyByOptions(queryKey, options); 2481 let query = this.get(queryHash); 2482 if (!query) { 2483 query = new Query({ 2484 client, 2485 queryKey, 2486 queryHash, 2487 options: client.defaultQueryOptions(options), 2488 state, 2489 defaultOptions: client.getQueryDefaults(queryKey) 2490 }); 2491 this.add(query); 2492 } 2493 return query; 2494 } 2495 add(query) { 2496 if (!this.#queries.has(query.queryHash)) { 2497 this.#queries.set(query.queryHash, query); 2498 this.notify({ 2499 type: "added", 2500 query 2501 }); 2502 } 2503 } 2504 remove(query) { 2505 const queryInMap = this.#queries.get(query.queryHash); 2506 if (queryInMap) { 2507 query.destroy(); 2508 if (queryInMap === query) { 2509 this.#queries.delete(query.queryHash); 2510 } 2511 this.notify({ type: "removed", query }); 2512 } 2513 } 2514 clear() { 2515 notifyManager.batch(() => { 2516 this.getAll().forEach((query) => { 2517 this.remove(query); 2518 }); 2519 }); 2520 } 2521 get(queryHash) { 2522 return this.#queries.get(queryHash); 2523 } 2524 getAll() { 2525 return [...this.#queries.values()]; 2526 } 2527 find(filters) { 2528 const defaultedFilters = { exact: true, ...filters }; 2529 return this.getAll().find( 2530 (query) => matchQuery(defaultedFilters, query) 2531 ); 2532 } 2533 findAll(filters = {}) { 2534 const queries = this.getAll(); 2535 return Object.keys(filters).length > 0 ? queries.filter((query) => matchQuery(filters, query)) : queries; 2536 } 2537 notify(event) { 2538 notifyManager.batch(() => { 2539 this.listeners.forEach((listener) => { 2540 listener(event); 2541 }); 2542 }); 2543 } 2544 onFocus() { 2545 notifyManager.batch(() => { 2546 this.getAll().forEach((query) => { 2547 query.onFocus(); 2548 }); 2549 }); 2550 } 2551 onOnline() { 2552 notifyManager.batch(() => { 2553 this.getAll().forEach((query) => { 2554 query.onOnline(); 2555 }); 2556 }); 2557 } 2558}; 2559
2560// src/queryClient.ts 2561var QueryClient = class { 2562 #queryCache; 2563 #mutationCache; 2564 #defaultOptions; 2565 #queryDefaults; 2566 #mutationDefaults; 2567 #mountCount; 2568 #unsubscribeFocus; 2569 #unsubscribeOnline; 2570 constructor(config = {}) { 2571 this.#queryCache = config.queryCache || new QueryCache(); 2572 this.#mutationCache = config.mutationCache || new MutationCache(); 2573 this.#defaultOptions = config.defaultOptions || {}; 2574 this.#queryDefaults = /* @__PURE__ */ new Map(); 2575 this.#mutationDefaults = /* @__PURE__ */ new Map(); 2576 this.#mountCount = 0; 2577 } 2578 mount() { 2579 this.#mountCount++; 2580 if (this.#mountCount !== 1) return; 2581 this.#unsubscribeFocus = focusManager.subscribe(async (focused) => { 2582 if (focused) { 2583 await this.resumePausedMutations(); 2584 this.#queryCache.onFocus(); 2585 } 2586 }); 2587 this.#unsubscribeOnline = onlineManager.subscribe(async (online) => { 2588 if (online) { 2589 await this.resumePausedMutations(); 2590 this.#queryCache.onOnline(); 2591 } 2592 }); 2593 } 2594 unmount() { 2595 this.#mountCount--; 2596 if (this.#mountCount !== 0) return; 2597 this.#unsubscribeFocus?.(); 2598 this.#unsubscribeFocus = void 0; 2599 this.#unsubscribeOnline?.(); 2600 this.#unsubscribeOnline = void 0; 2601 } 2602 isFetching(filters) { 2603 return this.#queryCache.findAll({ ...filters, fetchStatus: "fetching" }).length; 2604 } 2605 isMutating(filters) { 2606 return this.#mutationCache.findAll({ ...filters, status: "pending" }).length; 2607 } 2608 /** 2609 * Imperative (non-reactive) way to retrieve data for a QueryKey. 2610 * Should only be used in callbacks or functions where reading the latest data is necessary, e.g. for optimistic updates. 2611 * 2612 * Hint: Do not use this function inside a component, because it won't receive updates. 2613 * Use `useQuery` to create a `QueryObserver` that subscribes to changes. 2614 */ 2615 getQueryData(queryKey) { 2616 const options = this.defaultQueryOptions({ queryKey }); 2617 return this.#queryCache.get(options.queryHash)?.state.data; 2618 } 2619 ensureQueryData(options) { 2620 const defaultedOptions = this.defaultQueryOptions(options); 2621 const query = this.#queryCache.build(this, defaultedOptions); 2622 const cachedData = query.state.data; 2623 if (cachedData === void 0) { 2624 return this.fetchQuery(options); 2625 } 2626 if (options.revalidateIfStale && query.isStaleByTime(resolveStaleTime(defaultedOptions.staleTime, query))) { 2627 void this.prefetchQuery(defaultedOptions); 2628 } 2629 return Promise.resolve(cachedData); 2630 } 2631 getQueriesData(filters) { 2632 return this.#queryCache.findAll(filters).map(({ queryKey, state }) => { 2633 const data = state.data; 2634 return [queryKey, data]; 2635 }); 2636 } 2637 setQueryData(queryKey, updater, options) { 2638 const defaultedOptions = this.defaultQueryOptions({ queryKey }); 2639 const query = this.#queryCache.get( 2640 defaultedOptions.queryHash 2641 ); 2642 const prevData = query?.state.data; 2643 const data = functionalUpdate(updater, prevData); 2644 if (data === void 0) { 2645 return void 0; 2646 } 2647 return this.#queryCache.build(this, defaultedOptions).setData(data, { ...options, manual: true }); 2648 } 2649 setQueriesData(filters, updater, options) { 2650 return notifyManager.batch( 2651 () => this.#queryCache.findAll(filters).map(({ queryKey }) => [ 2652 queryKey, 2653 this.setQueryData(queryKey, updater, options) 2654 ]) 2655 ); 2656 } 2657 getQueryState(queryKey) { 2658 const options = this.defaultQueryOptions({ queryKey }); 2659 return this.#queryCache.get( 2660 options.queryHash 2661 )?.state; 2662 } 2663 removeQueries(filters) { 2664 const queryCache = this.#queryCache; 2665 notifyManager.batch(() => { 2666 queryCache.findAll(filters).forEach((query) => { 2667 queryCache.remove(query); 2668 }); 2669 }); 2670 } 2671 resetQueries(filters, options) { 2672 const queryCache = this.#queryCache; 2673 return notifyManager.batch(() => { 2674 queryCache.findAll(filters).forEach((query) => { 2675 query.reset(); 2676 }); 2677 return this.refetchQueries( 2678 { 2679 type: "active", 2680 ...filters 2681 }, 2682 options 2683 ); 2684 }); 2685 } 2686 cancelQueries(filters, cancelOptions = {}) { 2687 const defaultedCancelOptions = { revert: true, ...cancelOptions }; 2688 const promises = notifyManager.batch( 2689 () => this.#queryCache.findAll(filters).map((query) => query.cancel(defaultedCancelOptions)) 2690 );
2691 return Promise.all(promises).then(noop$3).catch(noop$3); 2692 } 2693 invalidateQueries(filters, options = {}) { 2694 return notifyManager.batch(() => { 2695 this.#queryCache.findAll(filters).forEach((query) => { 2696 query.invalidate(); 2697 }); 2698 if (filters?.refetchType === "none") { 2699 return Promise.resolve(); 2700 } 2701 return this.refetchQueries( 2702 { 2703 ...filters, 2704 type: filters?.refetchType ?? filters?.type ?? "active" 2705 }, 2706 options 2707 ); 2708 }); 2709 } 2710 refetchQueries(filters, options = {}) { 2711 const fetchOptions = { 2712 ...options, 2713 cancelRefetch: options.cancelRefetch ?? true 2714 }; 2715 const promises = notifyManager.batch( 2716 () => this.#queryCache.findAll(filters).filter((query) => !query.isDisabled() && !query.isStatic()).map((query) => { 2717 let promise = query.fetch(void 0, fetchOptions); 2718 if (!fetchOptions.throwOnError) { 2719 promise = promise.catch(noop$3); 2720 } 2721 return query.state.fetchStatus === "paused" ? Promise.resolve() : promise; 2722 }) 2723 ); 2724 return Promise.all(promises).then(noop$3); 2725 } 2726 fetchQuery(options) { 2727 const defaultedOptions = this.defaultQueryOptions(options); 2728 if (defaultedOptions.retry === void 0) { 2729 defaultedOptions.retry = false; 2730 } 2731 const query = this.#queryCache.build(this, defaultedOptions); 2732 return query.isStaleByTime( 2733 resolveStaleTime(defaultedOptions.staleTime, query) 2734 ) ? query.fetch(defaultedOptions) : Promise.resolve(query.state.data); 2735 } 2736 prefetchQuery(options) { 2737 return this.fetchQuery(options).then(noop$3).catch(noop$3); 2738 } 2739 fetchInfiniteQuery(options) { 2740 options.behavior = infiniteQueryBehavior(options.pages); 2741 return this.fetchQuery(options); 2742 } 2743 prefetchInfiniteQuery(options) { 2744 return this.fetchInfiniteQuery(options).then(noop$3).catch(noop$3); 2745 } 2746 ensureInfiniteQueryData(options) { 2747 options.behavior = infiniteQueryBehavior(options.pages); 2748 return this.ensureQueryData(options); 2749 } 2750 resumePausedMutations() { 2751 if (onlineManager.isOnline()) { 2752 return this.#mutationCache.resumePausedMutations(); 2753 } 2754 return Promise.resolve(); 2755 } 2756 getQueryCache() { 2757 return this.#queryCache; 2758 } 2759 getMutationCache() { 2760 return this.#mutationCache; 2761 } 2762 getDefaultOptions() { 2763 return this.#defaultOptions; 2764 } 2765 setDefaultOptions(options) { 2766 this.#defaultOptions = options; 2767 } 2768 setQueryDefaults(queryKey, options) { 2769 this.#queryDefaults.set(hashKey(queryKey), { 2770 queryKey, 2771 defaultOptions: options 2772 }); 2773 } 2774 getQueryDefaults(queryKey) { 2775 const defaults = [...this.#queryDefaults.values()]; 2776 const result = {}; 2777 defaults.forEach((queryDefault) => { 2778 if (partialMatchKey(queryKey, queryDefault.queryKey)) { 2779 Object.assign(result, queryDefault.defaultOptions); 2780 } 2781 }); 2782 return result; 2783 } 2784 setMutationDefaults(mutationKey, options) { 2785 this.#mutationDefaults.set(hashKey(mutationKey), { 2786 mutationKey, 2787 defaultOptions: options 2788 }); 2789 } 2790 getMutationDefaults(mutationKey) { 2791 const defaults = [...this.#mutationDefaults.values()]; 2792 const result = {}; 2793 defaults.forEach((queryDefault) => { 2794 if (partialMatchKey(mutationKey, queryDefault.mutationKey)) { 2795 Object.assign(result, queryDefault.defaultOptions); 2796 } 2797 }); 2798 return result; 2799 } 2800 defaultQueryOptions(options) { 2801 if (options._defaulted) { 2802 return options; 2803 } 2804 const defaultedOptions = { 2805 ...this.#defaultOptions.queries, 2806 ...this.getQueryDefaults(options.queryKey), 2807 ...options, 2808 _defaulted: true 2809 }; 2810 if (!defaultedOptions.queryHash) { 2811 defaultedOptions.queryHash = hashQueryKeyByOptions( 2812 defaultedOptions.queryKey, 2813 defaultedOptions 2814 ); 2815 } 2816 if (defaultedOptions.refetchOnReconnect === void 0) { 2817 defaultedOptions.refetchOnReconnect = defaultedOptions.networkMode !== "always"; 2818 } 2819 if (defaultedOptions.throwOnError === void 0) { 2820 defaultedOptions.throwOnError = !!defaultedOptions.suspense; 2821 } 2822 if (!defaultedOptions.networkMode && defaultedOptions.persister) { 2823 defaultedOptions.networkMode = "offlineFirst"; 2824 } 2825 if (defaultedOptions.queryFn === skipToken) { 2826 defaultedOptions.enabled = false;
2827 } 2828 return defaultedOptions; 2829 } 2830 defaultMutationOptions(options) { 2831 if (options?._defaulted) { 2832 return options; 2833 } 2834 return { 2835 ...this.#defaultOptions.mutations, 2836 ...options?.mutationKey && this.getMutationDefaults(options.mutationKey), 2837 ...options, 2838 _defaulted: true 2839 }; 2840 } 2841 clear() { 2842 this.#queryCache.clear(); 2843 this.#mutationCache.clear(); 2844 } 2845};
vendor: 18,348 bytes, lines 2845-3396
2845 2846 2847var react = {exports: {}}; 2848 2849var react_production = {}; 2850 2851/** 2852 * @license React 2853 * react.production.js 2854 * 2855 * Copyright (c) Meta Platforms, Inc. and affiliates. 2856 * 2857 * This source code is licensed under the MIT license found in the 2858 * LICENSE file in the root directory of this source tree. 2859 */ 2860 2861var hasRequiredReact_production; 2862 2863function requireReact_production () { 2864 if (hasRequiredReact_production) return react_production; 2865 hasRequiredReact_production = 1; 2866 var REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"), 2867 REACT_PORTAL_TYPE = Symbol.for("react.portal"), 2868 REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), 2869 REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"), 2870 REACT_PROFILER_TYPE = Symbol.for("react.profiler"), 2871 REACT_CONSUMER_TYPE = Symbol.for("react.consumer"), 2872 REACT_CONTEXT_TYPE = Symbol.for("react.context"), 2873 REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"), 2874 REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"), 2875 REACT_MEMO_TYPE = Symbol.for("react.memo"), 2876 REACT_LAZY_TYPE = Symbol.for("react.lazy"), 2877 REACT_ACTIVITY_TYPE = Symbol.for("react.activity"), 2878 MAYBE_ITERATOR_SYMBOL = Symbol.iterator; 2879 function getIteratorFn(maybeIterable) { 2880 if (null === maybeIterable || "object" !== typeof maybeIterable) return null; 2881 maybeIterable = 2882 (MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL]) || 2883 maybeIterable["@@iterator"]; 2884 return "function" === typeof maybeIterable ? maybeIterable : null; 2885 } 2886 var ReactNoopUpdateQueue = { 2887 isMounted: function () { 2888 return false; 2889 }, 2890 enqueueForceUpdate: function () {}, 2891 enqueueReplaceState: function () {}, 2892 enqueueSetState: function () {} 2893 }, 2894 assign = Object.assign, 2895 emptyObject = {}; 2896 function Component(props, context, updater) { 2897 this.props = props; 2898 this.context = context; 2899 this.refs = emptyObject; 2900 this.updater = updater || ReactNoopUpdateQueue; 2901 } 2902 Component.prototype.isReactComponent = {}; 2903 Component.prototype.setState = function (partialState, callback) { 2904 if ( 2905 "object" !== typeof partialState && 2906 "function" !== typeof partialState && 2907 null != partialState 2908 ) 2909 throw Error( 2910 "takes an object of state variables to update or a function which returns an object of state variables." 2911 ); 2912 this.updater.enqueueSetState(this, partialState, callback, "setState"); 2913 }; 2914 Component.prototype.forceUpdate = function (callback) { 2915 this.updater.enqueueForceUpdate(this, callback, "forceUpdate"); 2916 }; 2917 function ComponentDummy() {} 2918 ComponentDummy.prototype = Component.prototype; 2919 function PureComponent(props, context, updater) { 2920 this.props = props; 2921 this.context = context; 2922 this.refs = emptyObject; 2923 this.updater = updater || ReactNoopUpdateQueue; 2924 } 2925 var pureComponentPrototype = (PureComponent.prototype = new ComponentDummy()); 2926 pureComponentPrototype.constructor = PureComponent; 2927 assign(pureComponentPrototype, Component.prototype); 2928 pureComponentPrototype.isPureReactComponent = true; 2929 var isArrayImpl = Array.isArray; 2930 function noop() {} 2931 var ReactSharedInternals = { H: null, A: null, T: null, S: null }, 2932 hasOwnProperty = Object.prototype.hasOwnProperty; 2933 function ReactElement(type, key, props) { 2934 var refProp = props.ref; 2935 return { 2936 $$typeof: REACT_ELEMENT_TYPE, 2937 type: type, 2938 key: key, 2939 ref: void 0 !== refProp ? refProp : null, 2940 props: props 2941 }; 2942 } 2943 function cloneAndReplaceKey(oldElement, newKey) { 2944 return ReactElement(oldElement.type, newKey, oldElement.props); 2945 } 2946 function isValidElement(object) { 2947 return ( 2948 "object" === typeof object && 2949 null !== object && 2950 object.$$typeof === REACT_ELEMENT_TYPE 2951 ); 2952 } 2953 function escape(key) { 2954 var escaperLookup = { "=": "=0", ":": "=2" }; 2955 return ( 2956 "$" + 2957 key.replace(/[=:]/g, function (match) { 2958 return escaperLookup[match]; 2959 }) 2960 ); 2961 } 2962 var userProvidedKeyEscapeRegex = /\/+/g; 2963 function getElementKey(element, index) { 2964 return "object" === typeof element && null !== element && null != element.key 2965 ? escape("" + element.key) 2966 : index.toString(36); 2967 } 2968 function resolveThenable(thenable) { 2969 switch (thenable.status) { 2970 case "fulfilled": 2971 return thenable.value; 2972 case "rejected": 2973 throw thenable.reason; 2974 default: 2975 switch ( 2976 ("string" === typeof thenable.status 2977 ? thenable.then(noop, noop) 2978 : ((thenable.status = "pending"), 2979 thenable.then( 2980 function (fulfilledValue) { 2981 "pending" === thenable.status && 2982 ((thenable.status = "fulfilled"), 2983 (thenable.value = fulfilledValue)); 2984 }, 2985 function (error) { 2986 "pending" === thenable.status && 2987 ((thenable.status = "rejected"), (thenable.reason = error)); 2988 } 2989 )), 2990 thenable.status) 2991 ) { 2992 case "fulfilled": 2993 return thenable.value; 2994 case "rejected": 2995 throw thenable.reason; 2996 } 2997 } 2998 throw thenable; 2999 } 3000 function mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) { 3001 var type = typeof children; 3002 if ("undefined" === type || "boolean" === type) children = null; 3003 var invokeCallback = false; 3004 if (null === children) invokeCallback = true; 3005 else 3006 switch (type) { 3007 case "bigint": 3008 case "string": 3009 case "number": 3010 invokeCallback = true; 3011 break; 3012 case "object": 3013 switch (children.$$typeof) { 3014 case REACT_ELEMENT_TYPE: 3015 case REACT_PORTAL_TYPE: 3016 invokeCallback = true; 3017 break; 3018 case REACT_LAZY_TYPE: 3019 return ( 3020 (invokeCallback = children._init), 3021 mapIntoArray( 3022 invokeCallback(children._payload), 3023 array, 3024 escapedPrefix, 3025 nameSoFar, 3026 callback 3027 ) 3028 ); 3029 } 3030 } 3031 if (invokeCallback) 3032 return ( 3033 (callback = callback(children)), 3034 (invokeCallback = 3035 "" === nameSoFar ? "." + getElementKey(children, 0) : nameSoFar), 3036 isArrayImpl(callback) 3037 ? ((escapedPrefix = ""), 3038 null != invokeCallback && 3039 (escapedPrefix = 3040 invokeCallback.replace(userProvidedKeyEscapeRegex, "$&/") + "/"), 3041 mapIntoArray(callback, array, escapedPrefix, "", function (c) { 3042 return c; 3043 })) 3044 : null != callback && 3045 (isValidElement(callback) && 3046 (callback = cloneAndReplaceKey( 3047 callback, 3048 escapedPrefix + 3049 (null == callback.key || 3050 (children && children.key === callback.key) 3051 ? "" 3052 : ("" + callback.key).replace( 3053 userProvidedKeyEscapeRegex, 3054 "$&/" 3055 ) + "/") + 3056 invokeCallback 3057 )), 3058 array.push(callback)), 3059 1 3060 ); 3061 invokeCallback = 0; 3062 var nextNamePrefix = "" === nameSoFar ? "." : nameSoFar + ":"; 3063 if (isArrayImpl(children)) 3064 for (var i = 0; i < children.length; i++) 3065 (nameSoFar = children[i]), 3066 (type = nextNamePrefix + getElementKey(nameSoFar, i)), 3067 (invokeCallback += mapIntoArray( 3068 nameSoFar, 3069 array, 3070 escapedPrefix, 3071 type, 3072 callback 3073 )); 3074 else if (((i = getIteratorFn(children)), "function" === typeof i)) 3075 for ( 3076 children = i.call(children), i = 0; 3077 !(nameSoFar = children.next()).done; 3078 3079 ) 3080 (nameSoFar = nameSoFar.value), 3081 (type = nextNamePrefix + getElementKey(nameSoFar, i++)), 3082 (invokeCallback += mapIntoArray( 3083 nameSoFar, 3084 array, 3085 escapedPrefix, 3086 type, 3087 callback 3088 )); 3089 else if ("object" === type) { 3090 if ("function" === typeof children.then) 3091 return mapIntoArray( 3092 resolveThenable(children), 3093 array, 3094 escapedPrefix, 3095 nameSoFar, 3096 callback 3097 ); 3098 array = String(children); 3099 throw Error( 3100 "Objects are not valid as a React child (found: " + 3101 ("[object Object]" === array 3102 ? "object with keys {" + Object.keys(children).join(", ") + "}" 3103 : array) + 3104 "). If you meant to render a collection of children, use an array instead." 3105 ); 3106 } 3107 return invokeCallback; 3108 } 3109 function mapChildren(children, func, context) { 3110 if (null == children) return children; 3111 var result = [], 3112 count = 0; 3113 mapIntoArray(children, result, "", "", function (child) { 3114 return func.call(context, child, count++); 3115 }); 3116 return result; 3117 } 3118 function lazyInitializer(payload) { 3119 if (-1 === payload._status) { 3120 var ctor = payload._result; 3121 ctor = ctor(); 3122 ctor.then( 3123 function (moduleObject) { 3124 if (0 === payload._status || -1 === payload._status) 3125 (payload._status = 1), (payload._result = moduleObject); 3126 }, 3127 function (error) { 3128 if (0 === payload._status || -1 === payload._status) 3129 (payload._status = 2), (payload._result = error); 3130 } 3131 ); 3132 -1 === payload._status && ((payload._status = 0), (payload._result = ctor)); 3133 } 3134 if (1 === payload._status) return payload._result.default; 3135 throw payload._result; 3136 } 3137 var reportGlobalError = 3138 "function" === typeof reportError 3139 ? reportError 3140 : function (error) { 3141 if ( 3142 "object" === typeof window && 3143 "function" === typeof window.ErrorEvent 3144 ) { 3145 var event = new window.ErrorEvent("error", { 3146 bubbles: true, 3147 cancelable: true, 3148 message: 3149 "object" === typeof error && 3150 null !== error && 3151 "string" === typeof error.message 3152 ? String(error.message) 3153 : String(error), 3154 error: error 3155 }); 3156 if (!window.dispatchEvent(event)) return; 3157 } else if ( 3158 "object" === typeof process && 3159 "function" === typeof process.emit 3160 ) { 3161 process.emit("uncaughtException", error); 3162 return; 3163 } 3164 console.error(error); 3165 }, 3166 Children = { 3167 map: mapChildren, 3168 forEach: function (children, forEachFunc, forEachContext) { 3169 mapChildren( 3170 children, 3171 function () { 3172 forEachFunc.apply(this, arguments); 3173 }, 3174 forEachContext 3175 ); 3176 }, 3177 count: function (children) { 3178 var n = 0; 3179 mapChildren(children, function () { 3180 n++; 3181 }); 3182 return n; 3183 }, 3184 toArray: function (children) { 3185 return ( 3186 mapChildren(children, function (child) { 3187 return child; 3188 }) || [] 3189 ); 3190 }, 3191 only: function (children) { 3192 if (!isValidElement(children)) 3193 throw Error( 3194 "React.Children.only expected to receive a single React element child." 3195 ); 3196 return children; 3197 } 3198 }; 3199 react_production.Activity = REACT_ACTIVITY_TYPE; 3200 react_production.Children = Children; 3201 react_production.Component = Component; 3202 react_production.Fragment = REACT_FRAGMENT_TYPE; 3203 react_production.Profiler = REACT_PROFILER_TYPE; 3204 react_production.PureComponent = PureComponent; 3205 react_production.StrictMode = REACT_STRICT_MODE_TYPE; 3206 react_production.Suspense = REACT_SUSPENSE_TYPE; 3207 react_production.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = 3208 ReactSharedInternals; 3209 react_production.__COMPILER_RUNTIME = { 3210 __proto__: null, 3211 c: function (size) { 3212 return ReactSharedInternals.H.useMemoCache(size); 3213 } 3214 }; 3215 react_production.cache = function (fn) { 3216 return function () { 3217 return fn.apply(null, arguments); 3218 }; 3219 }; 3220 react_production.cacheSignal = function () { 3221 return null; 3222 }; 3223 react_production.cloneElement = function (element, config, children) { 3224 if (null === element || void 0 === element) 3225 throw Error( 3226 "The argument must be a React element, but you passed " + element + "." 3227 ); 3228 var props = assign({}, element.props), 3229 key = element.key; 3230 if (null != config) 3231 for (propName in (void 0 !== config.key && (key = "" + config.key), config)) 3232 !hasOwnProperty.call(config, propName) || 3233 "key" === propName || 3234 "__self" === propName || 3235 "__source" === propName || 3236 ("ref" === propName && void 0 === config.ref) || 3237 (props[propName] = config[propName]); 3238 var propName = arguments.length - 2; 3239 if (1 === propName) props.children = children; 3240 else if (1 < propName) { 3241 for (var childArray = Array(propName), i = 0; i < propName; i++) 3242 childArray[i] = arguments[i + 2]; 3243 props.children = childArray; 3244 } 3245 return ReactElement(element.type, key, props); 3246 }; 3247 react_production.createContext = function (defaultValue) { 3248 defaultValue = { 3249 $$typeof: REACT_CONTEXT_TYPE, 3250 _currentValue: defaultValue, 3251 _currentValue2: defaultValue, 3252 _threadCount: 0, 3253 Provider: null, 3254 Consumer: null 3255 }; 3256 defaultValue.Provider = defaultValue; 3257 defaultValue.Consumer = { 3258 $$typeof: REACT_CONSUMER_TYPE, 3259 _context: defaultValue 3260 }; 3261 return defaultValue; 3262 }; 3263 react_production.createElement = function (type, config, children) { 3264 var propName, 3265 props = {}, 3266 key = null; 3267 if (null != config) 3268 for (propName in (void 0 !== config.key && (key = "" + config.key), config)) 3269 hasOwnProperty.call(config, propName) && 3270 "key" !== propName && 3271 "__self" !== propName && 3272 "__source" !== propName && 3273 (props[propName] = config[propName]); 3274 var childrenLength = arguments.length - 2; 3275 if (1 === childrenLength) props.children = children; 3276 else if (1 < childrenLength) { 3277 for (var childArray = Array(childrenLength), i = 0; i < childrenLength; i++) 3278 childArray[i] = arguments[i + 2]; 3279 props.children = childArray; 3280 } 3281 if (type && type.defaultProps) 3282 for (propName in ((childrenLength = type.defaultProps), childrenLength)) 3283 void 0 === props[propName] && 3284 (props[propName] = childrenLength[propName]); 3285 return ReactElement(type, key, props); 3286 }; 3287 react_production.createRef = function () { 3288 return { current: null }; 3289 }; 3290 react_production.forwardRef = function (render) { 3291 return { $$typeof: REACT_FORWARD_REF_TYPE, render: render }; 3292 }; 3293 react_production.isValidElement = isValidElement; 3294 react_production.lazy = function (ctor) { 3295 return { 3296 $$typeof: REACT_LAZY_TYPE, 3297 _payload: { _status: -1, _result: ctor }, 3298 _init: lazyInitializer 3299 }; 3300 }; 3301 react_production.memo = function (type, compare) { 3302 return { 3303 $$typeof: REACT_MEMO_TYPE, 3304 type: type, 3305 compare: void 0 === compare ? null : compare 3306 }; 3307 }; 3308 react_production.startTransition = function (scope) { 3309 var prevTransition = ReactSharedInternals.T, 3310 currentTransition = {}; 3311 ReactSharedInternals.T = currentTransition; 3312 try { 3313 var returnValue = scope(), 3314 onStartTransitionFinish = ReactSharedInternals.S; 3315 null !== onStartTransitionFinish && 3316 onStartTransitionFinish(currentTransition, returnValue); 3317 "object" === typeof returnValue && 3318 null !== returnValue && 3319 "function" === typeof returnValue.then && 3320 returnValue.then(noop, reportGlobalError); 3321 } catch (error) { 3322 reportGlobalError(error); 3323 } finally { 3324 null !== prevTransition && 3325 null !== currentTransition.types && 3326 (prevTransition.types = currentTransition.types), 3327 (ReactSharedInternals.T = prevTransition); 3328 } 3329 }; 3330 react_production.unstable_useCacheRefresh = function () { 3331 return ReactSharedInternals.H.useCacheRefresh(); 3332 }; 3333 react_production.use = function (usable) { 3334 return ReactSharedInternals.H.use(usable); 3335 }; 3336 react_production.useActionState = function (action, initialState, permalink) { 3337 return ReactSharedInternals.H.useActionState(action, initialState, permalink); 3338 }; 3339 react_production.useCallback = function (callback, deps) { 3340 return ReactSharedInternals.H.useCallback(callback, deps); 3341 }; 3342 react_production.useContext = function (Context) { 3343 return ReactSharedInternals.H.useContext(Context); 3344 }; 3345 react_production.useDebugValue = function () {}; 3346 react_production.useDeferredValue = function (value, initialValue) { 3347 return ReactSharedInternals.H.useDeferredValue(value, initialValue); 3348 }; 3349 react_production.useEffect = function (create, deps) { 3350 return ReactSharedInternals.H.useEffect(create, deps); 3351 }; 3352 react_production.useEffectEvent = function (callback) { 3353 return ReactSharedInternals.H.useEffectEvent(callback); 3354 }; 3355 react_production.useId = function () { 3356 return ReactSharedInternals.H.useId(); 3357 }; 3358 react_production.useImperativeHandle = function (ref, create, deps) { 3359 return ReactSharedInternals.H.useImperativeHandle(ref, create, deps); 3360 }; 3361 react_production.useInsertionEffect = function (create, deps) { 3362 return ReactSharedInternals.H.useInsertionEffect(create, deps); 3363 }; 3364 react_production.useLayoutEffect = function (create, deps) { 3365 return ReactSharedInternals.H.useLayoutEffect(create, deps); 3366 }; 3367 react_production.useMemo = function (create, deps) { 3368 return ReactSharedInternals.H.useMemo(create, deps); 3369 }; 3370 react_production.useOptimistic = function (passthrough, reducer) { 3371 return ReactSharedInternals.H.useOptimistic(passthrough, reducer); 3372 }; 3373 react_production.useReducer = function (reducer, initialArg, init) { 3374 return ReactSharedInternals.H.useReducer(reducer, initialArg, init); 3375 }; 3376 react_production.useRef = function (initialValue) { 3377 return ReactSharedInternals.H.useRef(initialValue); 3378 }; 3379 react_production.useState = function (initialState) { 3380 return ReactSharedInternals.H.useState(initialState); 3381 }; 3382 react_production.useSyncExternalStore = function ( 3383 subscribe, 3384 getSnapshot, 3385 getServerSnapshot 3386 ) { 3387 return ReactSharedInternals.H.useSyncExternalStore( 3388 subscribe, 3389 getSnapshot, 3390 getServerSnapshot 3391 ); 3392 }; 3393 react_production.useTransition = function () { 3394 return ReactSharedInternals.H.useTransition(); 3395 }; 3396 react_production.version = "19.2.
33961"; 3397 return react_production; 3398} 3399 3400var hasRequiredReact; 3401 3402function requireReact () { 3403 if (hasRequiredReact) return react.exports; 3404 hasRequiredReact = 1; 3405 { 3406 react.exports = requireReact_production(); 3407 } 3408 return react.exports; 3409} 3410 3411var reactExports = requireReact(); 3412const React = /*@__PURE__*/getDefaultExportFromCjs(reactExports); 3413 3414const React$1 = /*#__PURE__*/_mergeNamespaces({ 3415 __proto__: null, 3416 default: React 3417}, [reactExports]); 3418 3419var QueryClientContext = reactExports.createContext( 3420 void 0 3421); 3422var useQueryClient = (queryClient) => { 3423 const client = reactExports.useContext(QueryClientContext); 3424 if (queryClient) { 3425 return queryClient; 3426 } 3427 if (!client) { 3428 throw new Error("No QueryClient set, use QueryClientProvider to set one"); 3429 } 3430 return client; 3431}; 3432var QueryClientProvider = ({ 3433 client, 3434 children 3435}) => { 3436 reactExports.useEffect(() => { 3437 client.mount(); 3438 return () => { 3439 client.unmount(); 3440 }; 3441 }, [client]); 3442 return /* @__PURE__ */ jsxRuntimeExports.jsx(QueryClientContext.Provider, { value: client, children }); 3443}; 3444 3445var IsRestoringContext = reactExports.createContext(false); 3446var useIsRestoring = () => reactExports.useContext(IsRestoringContext); 3447IsRestoringContext.Provider; 3448 3449function createValue() { 3450 let isReset = false; 3451 return { 3452 clearReset: () => { 3453 isReset = false; 3454 }, 3455 reset: () => { 3456 isReset = true; 3457 }, 3458 isReset: () => { 3459 return isReset; 3460 } 3461 }; 3462} 3463var QueryErrorResetBoundaryContext = reactExports.createContext(createValue()); 3464var useQueryErrorResetBoundary = () => reactExports.useContext(QueryErrorResetBoundaryContext); 3465 3466var ensurePreventErrorBoundaryRetry = (options, errorResetBoundary) => { 3467 if (options.suspense || options.throwOnError || options.experimental_prefetchInRender) { 3468 if (!errorResetBoundary.isReset()) { 3469 options.retryOnMount = false; 3470 } 3471 } 3472}; 3473var useClearResetErrorBoundary = (errorResetBoundary) => { 3474 reactExports.useEffect(() => { 3475 errorResetBoundary.clearReset(); 3476 }, [errorResetBoundary]); 3477}; 3478var getHasError = ({ 3479 result, 3480 errorResetBoundary, 3481 throwOnError, 3482 query, 3483 suspense 3484}) => { 3485 return result.isError && !errorResetBoundary.isReset() && !result.isFetching && query && (suspense && result.data === void 0 || shouldThrowError(throwOnError, [result.error, query])); 3486}; 3487
3488// src/suspense.ts 3489var defaultThrowOnError = (_error, query) => query.state.data === void 0; 3490var ensureSuspenseTimers = (defaultedOptions) => { 3491 if (defaultedOptions.suspense) { 3492 const MIN_SUSPENSE_TIME_MS = 1e3; 3493 const clamp = (value) => value === "static" ? value : Math.max(value ?? MIN_SUSPENSE_TIME_MS, MIN_SUSPENSE_TIME_MS); 3494 const originalStaleTime = defaultedOptions.staleTime; 3495 defaultedOptions.staleTime = typeof originalStaleTime === "function" ? (...args) => clamp(originalStaleTime(...args)) : clamp(originalStaleTime); 3496 if (typeof defaultedOptions.gcTime === "number") { 3497 defaultedOptions.gcTime = Math.max( 3498 defaultedOptions.gcTime, 3499 MIN_SUSPENSE_TIME_MS 3500 ); 3501 } 3502 } 3503}; 3504var willFetch = (result, isRestoring) => result.isLoading && result.isFetching && !isRestoring; 3505var shouldSuspend = (defaultedOptions, result) => defaultedOptions?.suspense && result.isPending; 3506var fetchOptimistic = (defaultedOptions, observer, errorResetBoundary) => observer.fetchOptimistic(defaultedOptions).catch(() => { 3507 errorResetBoundary.clearReset(); 3508}); 3509 3510function useQueries({ 3511 queries, 3512 ...options 3513}, queryClient) { 3514 const client = useQueryClient(queryClient); 3515 const isRestoring = useIsRestoring(); 3516 const errorResetBoundary = useQueryErrorResetBoundary(); 3517 const defaultedQueries = reactExports.useMemo( 3518 () => queries.map((opts) => { 3519 const defaultedOptions = client.defaultQueryOptions( 3520 opts 3521 ); 3522 defaultedOptions._optimisticResults = isRestoring ? "isRestoring" : "optimistic"; 3523 return defaultedOptions; 3524 }), 3525 [queries, client, isRestoring] 3526 ); 3527 defaultedQueries.forEach((query) => { 3528 ensureSuspenseTimers(query); 3529 ensurePreventErrorBoundaryRetry(query, errorResetBoundary); 3530 }); 3531 useClearResetErrorBoundary(errorResetBoundary); 3532 const [observer] = reactExports.useState( 3533 () => new QueriesObserver( 3534 client, 3535 defaultedQueries, 3536 options 3537 ) 3538 ); 3539 const [optimisticResult, getCombinedResult, trackResult] = observer.getOptimisticResult( 3540 defaultedQueries, 3541 options.combine 3542 ); 3543 const shouldSubscribe = !isRestoring && options.subscribed !== false; 3544 reactExports.useSyncExternalStore( 3545 reactExports.useCallback( 3546 (onStoreChange) => shouldSubscribe ? observer.subscribe(notifyManager.batchCalls(onStoreChange)) : noop$3, 3547 [observer, shouldSubscribe] 3548 ), 3549 () => observer.getCurrentResult(), 3550 () => observer.getCurrentResult() 3551 ); 3552 reactExports.useEffect(() => { 3553 observer.setQueries( 3554 defaultedQueries, 3555 options 3556 ); 3557 }, [defaultedQueries, options, observer]); 3558 const shouldAtLeastOneSuspend = optimisticResult.some( 3559 (result, index) => shouldSuspend(defaultedQueries[index], result) 3560 ); 3561 const suspensePromises = shouldAtLeastOneSuspend ? optimisticResult.flatMap((result, index) => { 3562 const opts = defaultedQueries[index]; 3563 if (opts) { 3564 const queryObserver = new QueryObserver(client, opts); 3565 if (shouldSuspend(opts, result)) { 3566 return fetchOptimistic(opts, queryObserver, errorResetBoundary); 3567 } else if (willFetch(result, isRestoring)) { 3568 void fetchOptimistic(opts, queryObserver, errorResetBoundary); 3569 } 3570 } 3571 return []; 3572 }) : []; 3573 if (suspensePromises.length > 0) { 3574 throw Promise.all(suspensePromises); 3575 } 3576 const firstSingleResultWhichShouldThrow = optimisticResult.find( 3577 (result, index) => { 3578 const query = defaultedQueries[index]; 3579 return query && getHasError({ 3580 result, 3581 errorResetBoundary, 3582 throwOnError: query.throwOnError, 3583 query: client.getQueryCache().get(query.queryHash), 3584 suspense: query.suspense 3585 }); 3586 } 3587 ); 3588 if (firstSingleResultWhichShouldThrow?.error) { 3589 throw firstSingleResultWhichShouldThrow.error; 3590 } 3591 return getCombinedResult(trackResult()); 3592} 3593 3594function useBaseQuery(options, Observer, queryClient) { 3595 const isRestoring = useIsRestoring(); 3596 const errorResetBoundary = useQueryErrorResetBoundary(); 3597 const client = useQueryClient(queryClient); 3598 const defaultedOptions = client.defaultQueryOptions(options); 3599 client.getDefaultOptions().queries?._experimental_beforeQuery?.( 3600 defaultedOptions 3601 ); 3602 defaultedOptions._optimisticResults = isRestoring ? "isRestoring" : "optimistic"; 3603 ensureSuspenseTimers(defaultedOptions); 3604 ensurePreventErrorBoundaryRetry(defaultedOptions, errorResetBoundary); 3605 useClearResetErrorBoundary(errorResetBoundary); 3606 const isNewCacheEntry = !client.getQueryCache().get(defaultedOptions.queryHash); 3607 const [observer] = reactExports.useState( 3608 () => new Observer( 3609 client, 3610 defaultedOptions 3611 ) 3612 ); 3613 const result = observer.getOptimisticResult(defaultedOptions); 3614 const shouldSubscribe = !isRestoring && options.subscribed !== false; 3615 reactExports.useSyncExternalStore( 3616 reactExports.useCallback( 3617 (onStoreChange) => { 3618 const unsubscribe = shouldSubscribe ? observer.subscribe(notifyManager.batchCalls(onStoreChange)) : noop$3; 3619 observer.updateResult(); 3620 return unsubscribe; 3621 }, 3622 [observer, shouldSubscribe] 3623 ), 3624 () => observer.getCurrentResult(), 3625 () => observer.getCurrentResult() 3626 ); 3627 reactExports.useEffect(() => { 3628 observer.setOptions(defaultedOptions); 3629 }, [defaultedOptions, observer]); 3630 if (shouldSuspend(defaultedOptions, result)) { 3631 throw fetchOptimistic(defaultedOptions, observer, errorResetBoundary); 3632 } 3633 if (getHasError({ 3634 result, 3635 errorResetBoundary, 3636 throwOnError: defaultedOptions.throwOnError, 3637 query: client.getQueryCache().get(defaultedOptions.queryHash), 3638 suspense: defaultedOptions.suspense 3639 })) { 3640 throw result.error; 3641 } 3642 client.getDefaultOptions().queries?._experimental_afterQuery?.( 3643 defaultedOptions, 3644 result 3645 ); 3646 if (defaultedOptions.experimental_prefetchInRender && !isServer && willFetch(result, isRestoring)) { 3647 const promise = isNewCacheEntry ? ( 3648 // Fetch immediately on render in order to ensure `.promise` is resolved even if the component is unmounted 3649 fetchOptimistic(defaultedOptions, observer, errorResetBoundary) 3650 ) : (
3651 // subscribe to the "cache promise" so that we can finalize the currentThenable once data comes in 3652 client.getQueryCache().get(defaultedOptions.queryHash)?.promise 3653 ); 3654 promise?.catch(noop$3).finally(() => { 3655 observer.updateResult(); 3656 }); 3657 } 3658 return !defaultedOptions.notifyOnChangeProps ? observer.trackResult(result) : result; 3659} 3660 3661function useQuery(options, queryClient) { 3662 return useBaseQuery(options, QueryObserver, queryClient); 3663} 3664 3665function useSuspenseQuery(options, queryClient) { 3666 return useBaseQuery( 3667 { 3668 ...options, 3669 enabled: true, 3670 suspense: true, 3671 throwOnError: defaultThrowOnError, 3672 placeholderData: void 0 3673 }, 3674 QueryObserver, 3675 queryClient 3676 ); 3677} 3678 3679function useSuspenseInfiniteQuery(options, queryClient) { 3680 return useBaseQuery( 3681 { 3682 ...options, 3683 enabled: true, 3684 suspense: true, 3685 throwOnError: defaultThrowOnError 3686 }, 3687 InfiniteQueryObserver, 3688 queryClient 3689 ); 3690} 3691 3692function useSuspenseQueries(options, queryClient) { 3693 return useQueries( 3694 { 3695 ...options, 3696 queries: options.queries.map((query) => { 3697 return { 3698 ...query, 3699 suspense: true, 3700 throwOnError: defaultThrowOnError, 3701 enabled: true, 3702 placeholderData: void 0 3703 }; 3704 }) 3705 }, 3706 queryClient 3707 ); 3708} 3709
3710// src/usePrefetchQuery.tsx 3711function usePrefetchQuery(options, queryClient) { 3712 const client = useQueryClient(queryClient); 3713 if (!client.getQueryState(options.queryKey)) { 3714 client.prefetchQuery(options); 3715 } 3716} 3717
3718// src/usePrefetchInfiniteQuery.tsx 3719function usePrefetchInfiniteQuery(options, queryClient) { 3720 const client = useQueryClient(queryClient); 3721 if (!client.getQueryState(options.queryKey)) { 3722 client.prefetchInfiniteQuery(options); 3723 } 3724} 3725
3726// src/queryOptions.ts 3727function queryOptions(options) { 3728 return options; 3729} 3730
3731// src/infiniteQueryOptions.ts 3732function infiniteQueryOptions(options) { 3733 return options; 3734} 3735 3736function useMutation(options, queryClient) { 3737 const client = useQueryClient(queryClient); 3738 const [observer] = reactExports.useState( 3739 () => new MutationObserver$1( 3740 client, 3741 options 3742 ) 3743 ); 3744 reactExports.useEffect(() => { 3745 observer.setOptions(options); 3746 }, [observer, options]); 3747 const result = reactExports.useSyncExternalStore( 3748 reactExports.useCallback( 3749 (onStoreChange) => observer.subscribe(notifyManager.batchCalls(onStoreChange)), 3750 [observer] 3751 ), 3752 () => observer.getCurrentResult(), 3753 () => observer.getCurrentResult() 3754 ); 3755 const mutate = reactExports.useCallback( 3756 (variables, mutateOptions) => { 3757 observer.mutate(variables, mutateOptions).catch(noop$3); 3758 }, 3759 [observer] 3760 ); 3761 if (result.error && shouldThrowError(observer.options.throwOnError, [result.error])) { 3762 throw result.error; 3763 } 3764 return { ...result, mutate, mutateAsync: result.mutate }; 3765} 3766 3767function useInfiniteQuery(options, queryClient) { 3768 return useBaseQuery( 3769 options, 3770 InfiniteQueryObserver, 3771 queryClient 3772 ); 3773} 3774 3775//#region src/unstable-core-do-not-import/utils.ts 3776/** 3777* Ensures there are no duplicate keys when building a procedure. 3778* @internal 3779*/ 3780/** 3781* Check that value is object 3782* @internal 3783*/ 3784function isObject(value) { 3785 return !!value && !Array.isArray(value) && typeof value === "object"; 3786} 3787/** 3788* Create an object without inheriting anything from `Object.prototype` 3789* @internal 3790*/ 3791function emptyObject() { 3792 return Object.create(null); 3793} 3794const asyncIteratorsSupported = typeof Symbol === "function" && !!Symbol.asyncIterator; 3795function isAsyncIterable(value) { 3796 return asyncIteratorsSupported && isObject(value) && Symbol.asyncIterator in value; 3797} 3798 3799//#region rolldown:runtime 3800var __create$2 = Object.create; 3801var __defProp$2 = Object.defineProperty; 3802var __getOwnPropDesc$2 = Object.getOwnPropertyDescriptor; 3803var __getOwnPropNames$2 = Object.getOwnPropertyNames; 3804var __getProtoOf$2 = Object.getPrototypeOf; 3805var __hasOwnProp$2 = Object.prototype.hasOwnProperty; 3806var __commonJS$2 = (cb, mod) => function() { 3807 return mod || (0, cb[__getOwnPropNames$2(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; 3808}; 3809var __copyProps$2 = (to, from, except, desc) => { 3810 if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames$2(from), i = 0, n = keys.length, key; i < n; i++) { 3811 key = keys[i]; 3812 if (!__hasOwnProp$2.call(to, key) && key !== except) __defProp$2(to, key, { 3813 get: ((k) => from[k]).bind(null, key), 3814 enumerable: !(desc = __getOwnPropDesc$2(from, key)) || desc.enumerable 3815 }); 3816 } 3817 return to; 3818}; 3819var __toESM$2 = (mod, isNodeMode, target) => (target = mod != null ? __create$2(__getProtoOf$2(mod)) : {}, __copyProps$2(__defProp$2(target, "default", { 3820 value: mod, 3821 enumerable: true 3822}) , mod)); 3823 3824//#endregion 3825//#region src/unstable-core-do-not-import/createProxy.ts 3826const noop$2 = () => {}; 3827const freezeIfAvailable = (obj) => { 3828 if (Object.freeze) Object.freeze(obj); 3829}; 3830function createInnerProxy(callback, path, memo) { 3831 var _memo$cacheKey; 3832 const cacheKey = path.join("."); 3833 (_memo$cacheKey = memo[cacheKey]) !== null && _memo$cacheKey !== void 0 || (memo[cacheKey] = new Proxy(noop$2, { 3834 get(_obj, key) { 3835 if (typeof key !== "string" || key === "then") return void 0; 3836 return createInnerProxy(callback, [...path, key], memo); 3837 }, 3838 apply(_1, _2, args) { 3839 const lastOfPath = path[path.length - 1]; 3840 if (lastOfPath === "valueOf" || lastOfPath === "toString" || lastOfPath === "toJSON") { 3841 const debugPath = path.slice(0, -1).join("."); 3842 return `tRPC.proxy(${debugPath})`; 3843 } 3844 let opts = { 3845 args, 3846 path 3847 }; 3848 if (lastOfPath === "call") opts = { 3849 args: args.length >= 2 ? [args[1]] : [], 3850 path: path.slice(0, -1) 3851 }; 3852 else if (lastOfPath === "apply") opts = { 3853 args: args.length >= 2 ? args[1] : [], 3854 path: path.slice(0, -1) 3855 }; 3856 freezeIfAvailable(opts.args); 3857 freezeIfAvailable(opts.path); 3858 return callback(opts); 3859 } 3860 })); 3861 return memo[cacheKey]; 3862} 3863/** 3864* Creates a proxy that calls the callback with the path and arguments 3865* 3866* @internal 3867*/ 3868const createRecursiveProxy = (callback) => createInnerProxy(callback, [], emptyObject()); 3869/** 3870* Used in place of `new Proxy` where each handler will map 1 level deep to another value. 3871* 3872* @internal 3873*/ 3874const createFlatProxy = (callback) => { 3875 return new Proxy(noop$2, { get(_obj, name) { 3876 if (name === "then") return void 0; 3877 return callback(name); 3878 } }); 3879}; 3880 3881//#endregion 3882//#region ../../node_modules/.pnpm/@[email protected]/node_modules/@oxc-project/runtime/src/helpers/typeof.js 3883var require_typeof$2 = __commonJS$2({ "../../node_modules/.pnpm/@[email protected]/node_modules/@oxc-project/runtime/src/helpers/typeof.js"(exports, module) { 3884 function _typeof$2(o) { 3885 "@babel/helpers - typeof"; 3886 return module.exports = _typeof$2 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o$1) { 3887 return typeof o$1; 3888 } : function(o$1) { 3889 return o$1 && "function" == typeof Symbol && o$1.constructor === Symbol && o$1 !== Symbol.prototype ? "symbol" : typeof o$1; 3890 }, module.exports.__esModule = true, module.exports["default"] = module.exports, _typeof$2(o); 3891 } 3892 module.exports = _typeof$2, module.exports.__esModule = true, module.exports["default"] = module.exports; 3893} }); 3894 3895//#endregion 3896//#region ../../node_modules/.pnpm/@[email protected]/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js 3897var require_toPrimitive$2 = __commonJS$2({ "../../node_modules/.pnpm/@[email protected]/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js"(exports, module) { 3898 var _typeof$1 = require_typeof$2()["default"]; 3899 function toPrimitive$1(t, r) { 3900 if ("object" != _typeof$1(t) || !t) return t; 3901 var e = t[Symbol.toPrimitive]; 3902 if (void 0 !== e) { 3903 var i = e.call(t, r || "default"); 3904 if ("object" != _typeof$1(i)) return i; 3905 throw new TypeError("@@toPrimitive must return a primitive value."); 3906 } 3907 return ("string" === r ? String : Number)(t); 3908 } 3909 module.exports = toPrimitive$1, module.exports.__esModule = true, module.exports["default"] = module.exports; 3910} }); 3911 3912//#endregion 3913//#region ../../node_modules/.pnpm/@[email protected]/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js 3914var require_toPropertyKey$2 = __commonJS$2({ "../../node_modules/.pnpm/@[email protected]/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js"(exports, module) { 3915 var _typeof = require_typeof$2()["default"]; 3916 var toPrimitive = require_toPrimitive$2(); 3917 function toPropertyKey$1(t) { 3918 var i = toPrimitive(t, "string"); 3919 return "symbol" == _typeof(i) ? i : i + ""; 3920 } 3921 module.exports = toPropertyKey$1, module.exports.__esModule = true, module.exports["default"] = module.exports; 3922} }); 3923 3924//#endregion 3925//#region ../../node_modules/.pnpm/@[email protected]/node_modules/@oxc-project/runtime/src/helpers/
3925defineProperty.js 3926var require_defineProperty$2 = __commonJS$2({ "../../node_modules/.pnpm/@[email protected]/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js"(exports, module) { 3927 var toPropertyKey = require_toPropertyKey$2(); 3928 function _defineProperty(e, r, t) { 3929 return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, { 3930 value: t, 3931 enumerable: true, 3932 configurable: true, 3933 writable: true 3934 }) : e[r] = t, e; 3935 } 3936 module.exports = _defineProperty, module.exports.__esModule = true, module.exports["default"] = module.exports; 3937} }); 3938 3939//#endregion 3940//#region ../../node_modules/.pnpm/@[email protected]/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js 3941var require_objectSpread2$2 = __commonJS$2({ "../../node_modules/.pnpm/@[email protected]/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js"(exports, module) { 3942 var defineProperty = require_defineProperty$2(); 3943 function ownKeys(e, r) { 3944 var t = Object.keys(e); 3945 if (Object.getOwnPropertySymbols) { 3946 var o = Object.getOwnPropertySymbols(e); 3947 r && (o = o.filter(function(r$1) { 3948 return Object.getOwnPropertyDescriptor(e, r$1).enumerable; 3949 })), t.push.apply(t, o); 3950 } 3951 return t; 3952 } 3953 function _objectSpread2(e) { 3954 for (var r = 1; r < arguments.length; r++) { 3955 var t = null != arguments[r] ? arguments[r] : {}; 3956 r % 2 ? ownKeys(Object(t), true).forEach(function(r$1) { 3957 defineProperty(e, r$1, t[r$1]); 3958 }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r$1) { 3959 Object.defineProperty(e, r$1, Object.getOwnPropertyDescriptor(t, r$1)); 3960 }); 3961 } 3962 return e; 3963 } 3964 module.exports = _objectSpread2, module.exports.__esModule = true, module.exports["default"] = module.exports; 3965} }); 3966 3967//#endregion 3968//#region src/unstable-core-do-not-import/error/getErrorShape.ts 3969__toESM$2(require_objectSpread2$2()); 3970 3971//#endregion 3972//#region src/unstable-core-do-not-import/error/TRPCError.ts 3973__toESM$2(require_defineProperty$2()); 3974 3975//#endregion 3976//#region src/unstable-core-do-not-import/transformer.ts 3977var import_objectSpread2$1$1 = __toESM$2(require_objectSpread2$2()); 3978/** @internal */ 3979function transformResultInner(response, transformer) { 3980 if ("error" in response) { 3981 const error = transformer.deserialize(response.error); 3982 return { 3983 ok: false, 3984 error: (0, import_objectSpread2$1$1.default)((0, import_objectSpread2$1$1.default)({}, response), {}, { error }) 3985 }; 3986 } 3987 const result = (0, import_objectSpread2$1$1.default)((0, import_objectSpread2$1$1.default)({}, response.result), (!response.result.type || response.result.type === "data") && { 3988 type: "data", 3989 data: transformer.deserialize(response.result.data) 3990 }); 3991 return { 3992 ok: true, 3993 result 3994 }; 3995} 3996var TransformResultError = class extends Error { 3997 constructor() { 3998 super("Unable to transform response from server"); 3999 } 4000}; 4001/** 4002* Transforms and validates that the result is a valid TRPCResponse 4003* @internal 4004*/ 4005function transformResult(response, transformer) { 4006 let result; 4007 try { 4008 result = transformResultInner(response, transformer); 4009 } catch (_unused) { 4010 throw new TransformResultError(); 4011 } 4012 if (!result.ok && (!isObject(result.error.error) || typeof result.error.error["code"] !== "number")) throw new TransformResultError(); 4013 if (result.ok && !isObject(result.result)) throw new TransformResultError(); 4014 return result; 4015} 4016 4017//#endregion 4018//#region src/unstable-core-do-not-import/router.ts 4019__toESM$2(require_objectSpread2$2()); 4020 4021//#region src/observable/observable.ts 4022/** @public */ 4023/** @public */ 4024function observable(subscribe) { 4025 const self = { 4026 subscribe(observer) { 4027 let teardownRef = null; 4028 let isDone = false; 4029 let unsubscribed = false; 4030 let teardownImmediately = false; 4031 function unsubscribe() { 4032 if (teardownRef === null) { 4033 teardownImmediately = true; 4034 return; 4035 } 4036 if (unsubscribed) return; 4037 unsubscribed = true; 4038 if (typeof teardownRef === "function") teardownRef(); 4039 else if (teardownRef) teardownRef.unsubscribe(); 4040 } 4041 teardownRef = subscribe({ 4042 next(value) { 4043 var _observer$next; 4044 if (isDone) return; 4045 (_observer$next = observer.next) === null || _observer$next === void 0 || _observer$next.call(observer, value); 4046 }, 4047 error(err) { 4048 var _observer$error; 4049 if (isDone) return; 4050 isDone = true; 4051 (_observer$error = observer.error) === null || _observer$error === void 0 || _observer$error.call(observer, err); 4052 unsubscribe(); 4053 }, 4054 complete() { 4055 var _observer$complete; 4056 if (isDone) return; 4057 isDone = true; 4058 (_observer$complete = observer.complete) === null || _observer$complete === void 0 || _observer$complete.call(observer); 4059 unsubscribe(); 4060 } 4061 }); 4062 if (teardownImmediately) unsubscribe(); 4063 return { unsubscribe }; 4064 }, 4065 pipe(...operations) { 4066 return operations.reduce(pipeReducer, self); 4067 } 4068 }; 4069 return self; 4070} 4071function pipeReducer(prev, fn) { 4072 return fn(prev); 4073} 4074/** @internal */ 4075function observableToPromise(observable$1) { 4076 const ac = new AbortController(); 4077 const promise = new Promise((resolve, reject) => { 4078 let isDone = false;
4079 function onDone() { 4080 if (isDone) return; 4081 isDone = true; 4082 obs$.unsubscribe(); 4083 } 4084 ac.signal.addEventListener("abort", () => { 4085 reject(ac.signal.reason); 4086 }); 4087 const obs$ = observable$1.subscribe({ 4088 next(data) { 4089 isDone = true; 4090 resolve(data); 4091 onDone(); 4092 }, 4093 error(data) { 4094 reject(data); 4095 }, 4096 complete() { 4097 ac.abort(); 4098 onDone(); 4099 } 4100 }); 4101 }); 4102 return promise; 4103} 4104 4105//#region rolldown:runtime 4106var __create$1 = Object.create; 4107var __defProp$1 = Object.defineProperty; 4108var __getOwnPropDesc$1 = Object.getOwnPropertyDescriptor; 4109var __getOwnPropNames$1 = Object.getOwnPropertyNames; 4110var __getProtoOf$1 = Object.getPrototypeOf; 4111var __hasOwnProp$1 = Object.prototype.hasOwnProperty; 4112var __commonJS$1 = (cb, mod) => function() { 4113 return mod || (0, cb[__getOwnPropNames$1(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; 4114}; 4115var __copyProps$1 = (to, from, except, desc) => { 4116 if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames$1(from), i = 0, n = keys.length, key; i < n; i++) { 4117 key = keys[i]; 4118 if (!__hasOwnProp$1.call(to, key) && key !== except) __defProp$1(to, key, { 4119 get: ((k) => from[k]).bind(null, key), 4120 enumerable: !(desc = __getOwnPropDesc$1(from, key)) || desc.enumerable 4121 }); 4122 } 4123 return to; 4124}; 4125var __toESM$1 = (mod, isNodeMode, target) => (target = mod != null ? __create$1(__getProtoOf$1(mod)) : {}, __copyProps$1(isNodeMode || !mod || !mod.__esModule ? __defProp$1(target, "default", { 4126 value: mod, 4127 enumerable: true 4128}) : target, mod)); 4129 4130//#endregion 4131//#region ../../node_modules/.pnpm/@[email protected]/node_modules/@oxc-project/runtime/src/helpers/objectWithoutPropertiesLoose.js 4132var require_objectWithoutPropertiesLoose = __commonJS$1({ "../../node_modules/.pnpm/@[email protected]/node_modules/@oxc-project/runtime/src/helpers/objectWithoutPropertiesLoose.js"(exports, module) { 4133 function _objectWithoutPropertiesLoose(r, e) { 4134 if (null == r) return {}; 4135 var t = {}; 4136 for (var n in r) if ({}.hasOwnProperty.call(r, n)) { 4137 if (e.includes(n)) continue; 4138 t[n] = r[n]; 4139 } 4140 return t; 4141 } 4142 module.exports = _objectWithoutPropertiesLoose, module.exports.__esModule = true, module.exports["default"] = module.exports; 4143} }); 4144 4145//#endregion 4146//#region ../../node_modules/.pnpm/@[email protected]/node_modules/@oxc-project/runtime/src/helpers/objectWithoutProperties.js 4147var require_objectWithoutProperties = __commonJS$1({ "../../node_modules/.pnpm/@[email protected]/node_modules/@oxc-project/runtime/src/helpers/objectWithoutProperties.js"(exports, module) { 4148 var objectWithoutPropertiesLoose = require_objectWithoutPropertiesLoose(); 4149 function _objectWithoutProperties$1(e, t) { 4150 if (null == e) return {}; 4151 var o, r, i = objectWithoutPropertiesLoose(e, t); 4152 if (Object.getOwnPropertySymbols) { 4153 var s = Object.getOwnPropertySymbols(e); 4154 for (r = 0; r < s.length; r++) o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); 4155 } 4156 return i; 4157 } 4158 module.exports = _objectWithoutProperties$1, module.exports.__esModule = true, module.exports["default"] = module.exports; 4159} }); 4160 4161//#endregion 4162//#region ../../node_modules/.pnpm/@[email protected]/node_modules/@oxc-project/runtime/src/helpers/typeof.js 4163var require_typeof$1 = __commonJS$1({ "../../node_modules/.pnpm/@[email protected]/node_modules/@oxc-project/runtime/src/helpers/typeof.js"(exports, module) { 4164 function _typeof$2(o) { 4165 "@babel/helpers - typeof"; 4166 return module.exports = _typeof$2 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o$1) { 4167 return typeof o$1; 4168 } : function(o$1) { 4169 return o$1 && "function" == typeof Symbol && o$1.constructor === Symbol && o$1 !== Symbol.prototype ? "symbol" : typeof o$1; 4170 }, module.exports.__esModule = true, module.exports["default"] = module.exports, _typeof$2(o); 4171 } 4172 module.exports = _typeof$2, module.exports.__esModule = true, module.exports["default"] = module.exports; 4173} }); 4174 4175//#endregion 4176//#region ../../node_modules/.pnpm/@[email protected]/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js 4177var require_toPrimitive$1 = __commonJS$1({ "../../node_modules/.pnpm/@[email protected]/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js"(exports, module) { 4178 var _typeof$1 = require_typeof$1()["default"]; 4179 function toPrimitive$1(t, r) { 4180 if ("object" != _typeof$1(t) || !t) return t; 4181 var e = t[Symbol.toPrimitive]; 4182 if (void 0 !== e) { 4183 var i = e.call(t, r || "default"); 4184 if ("object" != _typeof$1(i)) return i; 4185 throw new TypeError("@@toPrimitive must return a primitive value."); 4186 } 4187 return ("string" === r ? String : Number)(t); 4188 } 4189 module.exports = toPrimitive$1, module.exports.__esModule = true, module.exports["default"] = module.exports; 4190} }); 4191 4192//#endregion 4193//#region ../../node_modules/.pnpm/@[email protected]/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js 4194var require_toPropertyKey$1 = __commonJS$1({ "../../node_modules/.pnpm/@[email protected]/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js"(exports, module) { 4195 var _typeof = require_typeof$1()["default"]; 4196 var toPrimitive = require_toPrimitive$1(); 4197 function toPropertyKey$1(t) { 4198 var i = toPrimitive(t, "string"); 4199 return "symbol" == _typeof(i) ? i : i + ""; 4200 } 4201 module.exports = toPropertyKey$1, module.exports.__esModule = true, module.exports["default"] = module.exports; 4202} }); 4203 4204//#endregion 4205//#region ../../node_modules/.pnpm/@[email protected]/node_modules/@oxc-project/runtime/src/helpers/
4205defineProperty.js 4206var require_defineProperty$1 = __commonJS$1({ "../../node_modules/.pnpm/@[email protected]/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js"(exports, module) { 4207 var toPropertyKey = require_toPropertyKey$1(); 4208 function _defineProperty(e, r, t) { 4209 return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, { 4210 value: t, 4211 enumerable: true, 4212 configurable: true, 4213 writable: true 4214 }) : e[r] = t, e; 4215 } 4216 module.exports = _defineProperty, module.exports.__esModule = true, module.exports["default"] = module.exports; 4217} }); 4218 4219//#endregion 4220//#region ../../node_modules/.pnpm/@[email protected]/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js 4221var require_objectSpread2$1 = __commonJS$1({ "../../node_modules/.pnpm/@[email protected]/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js"(exports, module) { 4222 var defineProperty = require_defineProperty$1(); 4223 function ownKeys(e, r) { 4224 var t = Object.keys(e); 4225 if (Object.getOwnPropertySymbols) { 4226 var o = Object.getOwnPropertySymbols(e); 4227 r && (o = o.filter(function(r$1) { 4228 return Object.getOwnPropertyDescriptor(e, r$1).enumerable; 4229 })), t.push.apply(t, o); 4230 } 4231 return t; 4232 } 4233 function _objectSpread2(e) { 4234 for (var r = 1; r < arguments.length; r++) { 4235 var t = null != arguments[r] ? arguments[r] : {}; 4236 r % 2 ? ownKeys(Object(t), true).forEach(function(r$1) { 4237 defineProperty(e, r$1, t[r$1]); 4238 }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r$1) { 4239 Object.defineProperty(e, r$1, Object.getOwnPropertyDescriptor(t, r$1)); 4240 }); 4241 } 4242 return e; 4243 } 4244 module.exports = _objectSpread2, module.exports.__esModule = true, module.exports["default"] = module.exports; 4245} }); 4246 4247//#endregion 4248//#region src/internals/getQueryKey.ts 4249var import_objectWithoutProperties = __toESM$1(require_objectWithoutProperties(), 1); 4250var import_objectSpread2$8 = __toESM$1(require_objectSpread2$1(), 1); 4251const _excluded = ["cursor", "direction"]; 4252/** 4253* To allow easy interactions with groups of related queries, such as 4254* invalidating all queries of a router, we use an array as the path when 4255* storing in tanstack query. 4256**/ 4257function getQueryKeyInternal(path, input, type) { 4258 const splitPath = path.flatMap((part) => part.split(".")); 4259 if (!input && (!type || type === "any")) return splitPath.length ? [splitPath] : []; 4260 if (type === "infinite" && isObject(input) && ("direction" in input || "cursor" in input)) { 4261 const { cursor: _, direction: __ } = input, inputWithoutCursorAndDirection = (0, import_objectWithoutProperties.default)(input, _excluded); 4262 return [splitPath, {
4263 input: inputWithoutCursorAndDirection, 4264 type: "infinite" 4265 }]; 4266 } 4267 return [splitPath, (0, import_objectSpread2$8.default)((0, import_objectSpread2$8.default)({}, typeof input !== "undefined" && input !== skipToken && { input }), type && type !== "any" && { type })]; 4268} 4269function getMutationKeyInternal(path) { 4270 return getQueryKeyInternal(path, void 0, "any"); 4271} 4272 4273//#region rolldown:runtime 4274var __create = Object.create; 4275var __defProp = Object.defineProperty; 4276var __getOwnPropDesc = Object.getOwnPropertyDescriptor; 4277var __getOwnPropNames = Object.getOwnPropertyNames; 4278var __getProtoOf = Object.getPrototypeOf; 4279var __hasOwnProp = Object.prototype.hasOwnProperty; 4280var __commonJS = (cb, mod) => function() { 4281 return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; 4282}; 4283var __copyProps = (to, from, except, desc) => { 4284 if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) { 4285 key = keys[i]; 4286 if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, { 4287 get: ((k) => from[k]).bind(null, key), 4288 enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable 4289 }); 4290 } 4291 return to; 4292}; 4293var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { 4294 value: mod, 4295 enumerable: true 4296}) : target, mod)); 4297 4298//#endregion 4299//#region ../../node_modules/.pnpm/@[email protected]/node_modules/@oxc-project/runtime/src/helpers/typeof.js 4300var require_typeof = __commonJS({ "../../node_modules/.pnpm/@[email protected]/node_modules/@oxc-project/runtime/src/helpers/typeof.js"(exports, module) { 4301 function _typeof$2(o) { 4302 "@babel/helpers - typeof"; 4303 return module.exports = _typeof$2 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o$1) { 4304 return typeof o$1; 4305 } : function(o$1) { 4306 return o$1 && "function" == typeof Symbol && o$1.constructor === Symbol && o$1 !== Symbol.prototype ? "symbol" : typeof o$1; 4307 }, module.exports.__esModule = true, module.exports["default"] = module.exports, _typeof$2(o); 4308 } 4309 module.exports = _typeof$2, module.exports.__esModule = true, module.exports["default"] = module.exports; 4310} }); 4311 4312//#endregion 4313//#region ../../node_modules/.pnpm/@[email protected]/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js 4314var require_toPrimitive = __commonJS({ "../../node_modules/.pnpm/@[email protected]/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js"(exports, module) { 4315 var _typeof$1 = require_typeof()["default"]; 4316 function toPrimitive$1(t, r) { 4317 if ("object" != _typeof$1(t) || !t) return t; 4318 var e = t[Symbol.toPrimitive]; 4319 if (void 0 !== e) { 4320 var i = e.call(t, r || "default"); 4321 if ("object" != _typeof$1(i)) return i; 4322 throw new TypeError("@@toPrimitive must return a primitive value."); 4323 } 4324 return ("string" === r ? String : Number)(t); 4325 } 4326 module.exports = toPrimitive$1, module.exports.__esModule = true, module.exports["default"] = module.exports; 4327} }); 4328 4329//#endregion 4330//#region ../../node_modules/.pnpm/@[email protected]/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js 4331var require_toPropertyKey = __commonJS({ "../../node_modules/.pnpm/@[email protected]/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js"(exports, module) { 4332 var _typeof = require_typeof()["default"]; 4333 var toPrimitive = require_toPrimitive(); 4334 function toPropertyKey$1(t) { 4335 var i = toPrimitive(t, "string"); 4336 return "symbol" == _typeof(i) ? i : i + ""; 4337 } 4338 module.exports = toPropertyKey$1, module.exports.__esModule = true, module.exports["default"] = module.exports; 4339} }); 4340 4341//#endregion 4342//#region ../../node_modules/.pnpm/@[email protected]/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js 4343var require_defineProperty = __commonJS({ "../../node_modules/.pnpm/@[email protected]/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js"(exports, module) { 4344 var toPropertyKey = require_toPropertyKey(); 4345 function _defineProperty(e, r, t) { 4346 return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, { 4347 value: t, 4348 enumerable: true, 4349 configurable: true, 4350 writable: true 4351 }) : e[r] = t, e; 4352 } 4353 module.exports = _defineProperty, module.exports.__esModule = true, module.exports["default"] = module.exports; 4354} }); 4355 4356//#endregion 4357//#region ../../node_modules/.pnpm/@[email protected]/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js 4358var require_objectSpread2 = __commonJS({ "../../node_modules/.pnpm/@[email protected]/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js"(exports, module) { 4359 var defineProperty = require_defineProperty(); 4360 function ownKeys(e, r) { 4361 var t = Object.keys(e); 4362 if (Object.getOwnPropertySymbols) { 4363 var o = Object.getOwnPropertySymbols(e); 4364 r && (o = o.filter(function(r$1) { 4365 return Object.getOwnPropertyDescriptor(e, r$1).enumerable; 4366 })), t.push.apply(t, o); 4367 } 4368 return t; 4369 }
4370 function _objectSpread2(e) { 4371 for (var r = 1; r < arguments.length; r++) { 4372 var t = null != arguments[r] ? arguments[r] : {}; 4373 r % 2 ? ownKeys(Object(t), true).forEach(function(r$1) { 4374 defineProperty(e, r$1, t[r$1]); 4375 }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r$1) { 4376 Object.defineProperty(e, r$1, Object.getOwnPropertyDescriptor(t, r$1)); 4377 }); 4378 } 4379 return e; 4380 } 4381 module.exports = _objectSpread2, module.exports.__esModule = true, module.exports["default"] = module.exports; 4382} }); 4383 4384function share(_opts) { 4385 return (source) => { 4386 let refCount = 0; 4387 let subscription = null; 4388 const observers = []; 4389 function startIfNeeded() { 4390 if (subscription) return; 4391 subscription = source.subscribe({ 4392 next(value) { 4393 for (const observer of observers) { 4394 var _observer$next; 4395 (_observer$next = observer.next) === null || _observer$next === void 0 || _observer$next.call(observer, value); 4396 } 4397 }, 4398 error(error) { 4399 for (const observer of observers) { 4400 var _observer$error; 4401 (_observer$error = observer.error) === null || _observer$error === void 0 || _observer$error.call(observer, error); 4402 } 4403 }, 4404 complete() { 4405 for (const observer of observers) { 4406 var _observer$complete; 4407 (_observer$complete = observer.complete) === null || _observer$complete === void 0 || _observer$complete.call(observer); 4408 } 4409 } 4410 }); 4411 } 4412 function resetIfNeeded() { 4413 if (refCount === 0 && subscription) { 4414 const _sub = subscription; 4415 subscription = null; 4416 _sub.unsubscribe(); 4417 } 4418 } 4419 return observable((subscriber) => { 4420 refCount++; 4421 observers.push(subscriber); 4422 startIfNeeded(); 4423 return { unsubscribe() { 4424 refCount--; 4425 resetIfNeeded(); 4426 const index = observers.findIndex((v) => v === subscriber); 4427 if (index > -1) observers.splice(index, 1); 4428 } }; 4429 }); 4430 }; 4431} 4432 4433//#endregion 4434//#region src/observable/behaviorSubject.ts 4435/** 4436* @internal 4437* An observable that maintains and provides a "current value" to subscribers 4438* @see https://www.learnrxjs.io/learn-rxjs/subjects/behaviorsubject 4439*/ 4440function behaviorSubject(initialValue) { 4441 let value = initialValue; 4442 const observerList = []; 4443 const addObserver = (observer) => { 4444 if (value !== void 0) observer.next(value); 4445 observerList.push(observer); 4446 }; 4447 const removeObserver = (observer) => { 4448 observerList.splice(observerList.indexOf(observer), 1); 4449 }; 4450 const obs = observable((observer) => { 4451 addObserver(observer); 4452 return () => { 4453 removeObserver(observer); 4454 }; 4455 }); 4456 obs.next = (nextValue) => { 4457 if (value === nextValue) return; 4458 value = nextValue; 4459 for (const observer of observerList) observer.next(nextValue); 4460 }; 4461 obs.get = () => value; 4462 return obs; 4463} 4464 4465//#region src/links/internals/createChain.ts 4466/** @internal */ 4467function createChain(opts) { 4468 return observable((observer) => { 4469 function execute(index = 0, op = opts.op) { 4470 const next = opts.links[index]; 4471 if (!next) throw new Error("No more links to execute - did you forget to add an ending link?"); 4472 const subscription = next({ 4473 op, 4474 next(nextOp) { 4475 const nextObserver = execute(index + 1, nextOp); 4476 return nextObserver; 4477 } 4478 }); 4479 return subscription; 4480 } 4481 const obs$ = execute(); 4482 return obs$.subscribe(observer); 4483 }); 4484} 4485 4486//#region src/TRPCClientError.ts 4487var import_defineProperty$2 = __toESM(require_defineProperty(), 1); 4488var import_objectSpread2$7 = __toESM(require_objectSpread2(), 1); 4489function isTRPCClientError(cause) { 4490 return cause instanceof TRPCClientError; 4491} 4492function isTRPCErrorResponse(obj) { 4493 return isObject(obj) && isObject(obj["error"]) && typeof obj["error"]["code"] === "number" && typeof obj["error"]["message"] === "string"; 4494} 4495function getMessageFromUnknownError(err, fallback) { 4496 if (typeof err === "string") return err; 4497 if (isObject(err) && typeof err["message"] === "string") return err["message"]; 4498 return fallback; 4499} 4500var TRPCClientError = class TRPCClientError extends Error { 4501 constructor(message, opts) { 4502 var _opts$result, _opts$result2; 4503 const cause = opts === null || opts === void 0 ? void 0 : opts.cause; 4504 super(message, { cause }); 4505 (0, import_defineProperty$2.default)(this, "cause", void 0); 4506 (0, import_defineProperty$2.default)(this, "shape", void 0); 4507 (0, import_defineProperty$2.default)(this, "data", void 0); 4508 (0, import_defineProperty$2.default)(this, "meta", void 0); 4509 this.meta = opts === null || opts === void 0 ? void 0 : opts.meta; 4510 this.cause = cause; 4511 this.shape = opts === null || opts === void 0 || (_opts$result = opts.result) === null || _opts$result === void 0 ? void 0 : _opts$result.error; 4512 this.data = opts === null || opts === void 0 || (_opts$result2 = opts.result) === null || _opts$result2 === void 0 ? void 0 : _opts$result2.error.data; 4513 this.name = "TRPCClientError"; 4514 Object.setPrototypeOf(this, TRPCClientError.prototype); 4515 } 4516 static from(_cause, opts = {}) { 4517 const cause = _cause; 4518 if (isTRPCClientError(cause)) { 4519 if (opts.meta) cause.meta = (0, import_objectSpread2$7.default)((0, import_objectSpread2$7.default)({}, cause.meta), opts.meta); 4520 return cause; 4521 } 4522 if (isTRPCErrorResponse(cause)) return new TRPCClientError(cause.error.message, (0, import_objectSpread2$7.default)((0, import_objectSpread2$7.default)({}, opts), {}, { 4523 result: cause, 4524 cause: opts.cause 4525 })); 4526 return new TRPCClientError(getMessageFromUnknownError(cause, "Unknown error"), (0, import_objectSpread2$7.default)((0, import_objectSpread2$7.default)({}, opts), {}, { cause })); 4527 } 4528}; 4529 4530//#region src/internals/transformer.ts 4531/** 4532* @internal 4533*/ 4534/** 4535* @internal 4536*/ 4537function getTransformer(transformer) { 4538 const _transformer = transformer; 4539 if (!_transformer) return { 4540 input: { 4541 serialize: (data) => data, 4542 deserialize: (data) => data 4543 }, 4544 output: { 4545 serialize: (data) => data, 4546 deserialize: (data) => data 4547 } 4548 }; 4549 if ("input" in _transformer) return _transformer; 4550 return { 4551 input: _transformer, 4552 output: _transformer 4553 }; 4554} 4555 4556//#region src/getFetch.ts 4557const isFunction$1 = (fn) => typeof fn === "function"; 4558function getFetch(customFetchImpl) { 4559 if (customFetchImpl) return customFetchImpl; 4560 if (typeof window !== "undefined" && isFunction$1(window.fetch)) return window.fetch; 4561 if (typeof globalThis !== "undefined" && isFunction$1(globalThis.fetch)) return globalThis.fetch; 4562 throw new Error("No fetch implementation found"); 4563} 4564 4565//#endregion 4566//#region src/links/internals/httpUtils.ts
4567var import_objectSpread2$6 = __toESM(require_objectSpread2()); 4568function resolveHTTPLinkOptions(opts) { 4569 return { 4570 url: opts.url.toString(), 4571 fetch: opts.fetch, 4572 transformer: getTransformer(opts.transformer), 4573 methodOverride: opts.methodOverride 4574 }; 4575} 4576function arrayToDict(array) { 4577 const dict = {}; 4578 for (let index = 0; index < array.length; index++) { 4579 const element = array[index]; 4580 dict[index] = element; 4581 } 4582 return dict; 4583} 4584const METHOD = { 4585 query: "GET", 4586 mutation: "POST", 4587 subscription: "PATCH" 4588}; 4589function getInput(opts) { 4590 return "input" in opts ? opts.transformer.input.serialize(opts.input) : arrayToDict(opts.inputs.map((_input) => opts.transformer.input.serialize(_input))); 4591} 4592const getUrl = (opts) => { 4593 const parts = opts.url.split("?"); 4594 const base = parts[0].replace(/\/$/, ""); 4595 let url = base + "/" + opts.path; 4596 const queryParts = []; 4597 if (parts[1]) queryParts.push(parts[1]); 4598 if ("inputs" in opts) queryParts.push("batch=1"); 4599 if (opts.type === "query" || opts.type === "subscription") { 4600 const input = getInput(opts); 4601 if (input !== void 0 && opts.methodOverride !== "POST") queryParts.push(`input=${encodeURIComponent(JSON.stringify(input))}`); 4602 } 4603 if (queryParts.length) url += "?" + queryParts.join("&"); 4604 return url; 4605}; 4606const getBody = (opts) => { 4607 if (opts.type === "query" && opts.methodOverride !== "POST") return void 0; 4608 const input = getInput(opts); 4609 return input !== void 0 ? JSON.stringify(input) : void 0; 4610}; 4611const jsonHttpRequester = (opts) => { 4612 return httpRequest((0, import_objectSpread2$6.default)((0, import_objectSpread2$6.default)({}, opts), {}, { 4613 contentTypeHeader: "application/json", 4614 getUrl, 4615 getBody 4616 })); 4617}; 4618/** 4619* Polyfill for DOMException with AbortError name 4620*/ 4621var AbortError = class extends Error { 4622 constructor() { 4623 const name = "AbortError"; 4624 super(name); 4625 this.name = name; 4626 this.message = name; 4627 } 4628}; 4629/** 4630* Polyfill for `signal.throwIfAborted()` 4631* 4632* @see https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal/throwIfAborted 4633*/ 4634const throwIfAborted = (signal) => { 4635 var _signal$throwIfAborte; 4636 if (!(signal === null || signal === void 0 ? void 0 : signal.aborted)) return; 4637 (_signal$throwIfAborte = signal.throwIfAborted) === null || _signal$throwIfAborte === void 0 || _signal$throwIfAborte.call(signal); 4638 if (typeof DOMException !== "undefined") throw new DOMException("AbortError", "AbortError"); 4639 throw new AbortError(); 4640}; 4641async function fetchHTTPResponse(opts) { 4642 var _opts$methodOverride, _opts$trpcAcceptHeade; 4643 throwIfAborted(opts.signal); 4644 const url = opts.getUrl(opts); 4645 const body = opts.getBody(opts); 4646 const method = (_opts$methodOverride = opts.methodOverride) !== null && _opts$methodOverride !== void 0 ? _opts$methodOverride : METHOD[opts.type]; 4647 const resolvedHeaders = await (async () => { 4648 const heads = await opts.headers(); 4649 if (Symbol.iterator in heads) return Object.fromEntries(heads); 4650 return heads; 4651 })(); 4652 const headers = (0, import_objectSpread2$6.default)((0, import_objectSpread2$6.default)((0, import_objectSpread2$6.default)({}, opts.contentTypeHeader && method !== "GET" ? { "content-type": opts.contentTypeHeader } : {}), opts.trpcAcceptHeader ? { [(_opts$trpcAcceptHeade = opts.trpcAcceptHeaderKey) !== null && _opts$trpcAcceptHeade !== void 0 ? _opts$trpcAcceptHeade : "trpc-accept"]: opts.trpcAcceptHeader } : void 0), resolvedHeaders); 4653 return getFetch(opts.fetch)(url, { 4654 method, 4655 signal: opts.signal, 4656 body, 4657 headers 4658 }); 4659} 4660async function httpRequest(opts) { 4661 const meta = {}; 4662 const res = await fetchHTTPResponse(opts); 4663 meta.response = res; 4664 const json = await res.json(); 4665 meta.responseJSON = json; 4666 return { 4667 json, 4668 meta 4669 }; 4670} 4671 4672//#endregion 4673//#region src/links/httpLink.ts 4674__toESM(require_objectSpread2(), 1); 4675 4676//#region src/internals/dataLoader.ts 4677/** 4678* A function that should never be called unless we messed something up. 4679*/ 4680const throwFatalError = () => { 4681 throw new Error("Something went wrong. Please submit an issue at https://github.com/trpc/trpc/issues/new"); 4682}; 4683/** 4684* Dataloader that's very inspired by https://github.com/graphql/dataloader 4685* Less configuration, no caching, and allows you to cancel requests 4686* When cancelling a single fetch the whole batch will be cancelled only when _all_ items are cancelled 4687*/ 4688function dataLoader(batchLoader) { 4689 let pendingItems = null; 4690 let dispatchTimer = null; 4691 const destroyTimerAndPendingItems = () => { 4692 clearTimeout(dispatchTimer); 4693 dispatchTimer = null; 4694 pendingItems = null; 4695 }; 4696 /** 4697 * Iterate through the items and split them into groups based on the `batchLoader`'s validate function 4698 */ 4699 function groupItems(items) { 4700 const groupedItems = [[]]; 4701 let index = 0; 4702 while (true) { 4703 const item = items[index]; 4704 if (!item) break; 4705 const lastGroup = groupedItems[groupedItems.length - 1]; 4706 if (item.aborted) { 4707 var _item$reject; 4708 (_item$reject = item.reject) === null || _item$reject === void 0 || _item$reject.call(item, new Error("Aborted")); 4709 index++; 4710 continue; 4711 } 4712 const isValid = batchLoader.validate(lastGroup.concat(item).map((it) => it.key)); 4713 if (isValid) { 4714 lastGroup.push(item); 4715 index++; 4716 continue; 4717 } 4718 if (lastGroup.length === 0) { 4719 var _item$reject2; 4720 (_item$reject2 = item.reject) === null || _item$reject2 === void 0 || _item$reject2.call(item, new Error("Input is too big for a single dispatch")); 4721 index++; 4722 continue; 4723 } 4724 groupedItems.push([]); 4725 } 4726 return groupedItems; 4727 } 4728 function dispatch() { 4729 const groupedItems = groupItems(pendingItems); 4730 destroyTimerAndPendingItems(); 4731 for (const items of groupedItems) { 4732 if (!items.length) continue; 4733 const batch = { items }; 4734 for (const item of items) item.batch = batch; 4735 const promise = batchLoader.fetch(batch.items.map((_item) => _item.key)); 4736 promise.then(async (result) => { 4737 await Promise.all(result.map(async (valueOrPromise, index) => { 4738 const item = batch.items[index]; 4739 try { 4740 var _item$resolve; 4741 const value = await Promise.resolve(valueOrPromise); 4742 (_item$resolve = item.resolve) === null || _item$resolve === void 0 || _item$resolve.call(item, value); 4743 } catch (cause) { 4744 var _item$reject3; 4745 (_item$reject3 = item.reject) === null || _item$reject3 === void 0 || _item$reject3.call(item, cause); 4746 } 4747 item.batch = null; 4748 item.reject = null; 4749 item.resolve = null; 4750 })); 4751 for (const item of batch.items) { 4752 var _item$reject4; 4753 (_item$reject4 = item.reject) === null || _item$reject4 === void 0 || _item$reject4.call(item, new Error("Missing result")); 4754 item.batch = null; 4755 } 4756 }).catch((cause) => { 4757 for (const item of batch.items) { 4758 var _item$reject5;
4759 (_item$reject5 = item.reject) === null || _item$reject5 === void 0 || _item$reject5.call(item, cause); 4760 item.batch = null; 4761 } 4762 }); 4763 } 4764 } 4765 function load(key) { 4766 var _dispatchTimer; 4767 const item = { 4768 aborted: false, 4769 key, 4770 batch: null, 4771 resolve: throwFatalError, 4772 reject: throwFatalError 4773 }; 4774 const promise = new Promise((resolve, reject) => { 4775 var _pendingItems; 4776 item.reject = reject; 4777 item.resolve = resolve; 4778 (_pendingItems = pendingItems) !== null && _pendingItems !== void 0 || (pendingItems = []); 4779 pendingItems.push(item); 4780 }); 4781 (_dispatchTimer = dispatchTimer) !== null && _dispatchTimer !== void 0 || (dispatchTimer = setTimeout(dispatch)); 4782 return promise; 4783 } 4784 return { load }; 4785} 4786 4787//#endregion 4788//#region src/internals/signals.ts 4789/** 4790* Like `Promise.all()` but for abort signals 4791* - When all signals have been aborted, the merged signal will be aborted 4792* - If one signal is `null`, no signal will be aborted 4793*/ 4794function allAbortSignals(...signals) { 4795 const ac = new AbortController(); 4796 const count = signals.length; 4797 let abortedCount = 0; 4798 const onAbort = () => { 4799 if (++abortedCount === count) ac.abort(); 4800 }; 4801 for (const signal of signals) if (signal === null || signal === void 0 ? void 0 : signal.aborted) onAbort(); 4802 else signal === null || signal === void 0 || signal.addEventListener("abort", onAbort, { once: true }); 4803 return ac.signal; 4804} 4805 4806//#endregion 4807//#region src/links/httpBatchLink.ts 4808var import_objectSpread2$5 = __toESM(require_objectSpread2(), 1); 4809/** 4810* @see https://trpc.io/docs/client/links/httpBatchLink 4811*/ 4812function httpBatchLink(opts) { 4813 var _opts$maxURLLength, _opts$maxItems; 4814 const resolvedOpts = resolveHTTPLinkOptions(opts); 4815 const maxURLLength = (_opts$maxURLLength = opts.maxURLLength) !== null && _opts$maxURLLength !== void 0 ? _opts$maxURLLength : Infinity; 4816 const maxItems = (_opts$maxItems = opts.maxItems) !== null && _opts$maxItems !== void 0 ? _opts$maxItems : Infinity; 4817 return () => { 4818 const batchLoader = (type) => { 4819 return { 4820 validate(batchOps) { 4821 if (maxURLLength === Infinity && maxItems === Infinity) return true; 4822 if (batchOps.length > maxItems) return false; 4823 const path = batchOps.map((op) => op.path).join(","); 4824 const inputs = batchOps.map((op) => op.input); 4825 const url = getUrl((0, import_objectSpread2$5.default)((0, import_objectSpread2$5.default)({}, resolvedOpts), {}, { 4826 type, 4827 path, 4828 inputs, 4829 signal: null 4830 })); 4831 return url.length <= maxURLLength; 4832 }, 4833 async fetch(batchOps) { 4834 const path = batchOps.map((op) => op.path).join(","); 4835 const inputs = batchOps.map((op) => op.input); 4836 const signal = allAbortSignals(...batchOps.map((op) => op.signal)); 4837 const res = await jsonHttpRequester((0, import_objectSpread2$5.default)((0, import_objectSpread2$5.default)({}, resolvedOpts), {}, { 4838 path, 4839 inputs, 4840 type, 4841 headers() { 4842 if (!opts.headers) return {}; 4843 if (typeof opts.headers === "function") return opts.headers({ opList: batchOps }); 4844 return opts.headers; 4845 }, 4846 signal 4847 })); 4848 const resJSON = Array.isArray(res.json) ? res.json : batchOps.map(() => res.json); 4849 const result = resJSON.map((item) => ({ 4850 meta: res.meta, 4851 json: item 4852 })); 4853 return result; 4854 } 4855 }; 4856 }; 4857 const query = dataLoader(batchLoader("query")); 4858 const mutation = dataLoader(batchLoader("mutation")); 4859 const loaders = { 4860 query, 4861 mutation 4862 }; 4863 return ({ op }) => { 4864 return observable((observer) => { 4865 /* istanbul ignore if -- @preserve */ 4866 if (op.type === "subscription") throw new Error("Subscriptions are unsupported by `httpLink` - use `httpSubscriptionLink` or `wsLink`"); 4867 const loader = loaders[op.type]; 4868 const promise = loader.load(op); 4869 let _res = void 0; 4870 promise.then((res) => { 4871 _res = res; 4872 const transformed = transformResult(res.json, resolvedOpts.transformer.output); 4873 if (!transformed.ok) { 4874 observer.error(TRPCClientError.from(transformed.error, { meta: res.meta })); 4875 return; 4876 } 4877 observer.next({ 4878 context: res.meta, 4879 result: transformed.result 4880 }); 4881 observer.complete(); 4882 }).catch((err) => { 4883 observer.error(TRPCClientError.from(err, { meta: _res === null || _res === void 0 ? void 0 : _res.meta })); 4884 }); 4885 return () => {}; 4886 }); 4887 }; 4888 }; 4889} 4890 4891//#region src/links/loggerLink.ts
4892__toESM(require_objectSpread2(), 1); 4893 4894//#endregion 4895//#region src/links/internals/urlWithConnectionParams.ts 4896/** 4897* Get the result of a value or function that returns a value 4898* It also optionally accepts typesafe arguments for the function 4899*/ 4900const resultOf = (value, ...args) => { 4901 return typeof value === "function" ? value(...args) : value; 4902}; 4903 4904//#endregion 4905//#region src/links/wsLink/wsClient/utils.ts 4906__toESM(require_defineProperty(), 1); 4907function withResolvers() { 4908 let resolve; 4909 let reject; 4910 const promise = new Promise((res, rej) => { 4911 resolve = res; 4912 reject = rej; 4913 }); 4914 return { 4915 promise, 4916 resolve, 4917 reject 4918 }; 4919} 4920/** 4921* Resolves a WebSocket URL and optionally appends connection parameters. 4922* 4923* If connectionParams are provided, appends 'connectionParams=1' query parameter. 4924*/ 4925async function prepareUrl(urlOptions) { 4926 const url = await resultOf(urlOptions.url); 4927 if (!urlOptions.connectionParams) return url; 4928 const prefix = url.includes("?") ? "&" : "?"; 4929 const connectionParams = `${prefix}connectionParams=1`; 4930 return url + connectionParams; 4931} 4932async function buildConnectionMessage(connectionParams, encoder) { 4933 const message = { 4934 method: "connectionParams", 4935 data: await resultOf(connectionParams) 4936 }; 4937 return encoder.encode(message); 4938} 4939 4940//#endregion 4941//#region src/links/wsLink/wsClient/requestManager.ts 4942__toESM(require_defineProperty(), 1); 4943 4944//#endregion 4945//#region src/links/wsLink/wsClient/wsConnection.ts 4946var import_defineProperty$1 = __toESM(require_defineProperty(), 1); 4947/** 4948* Opens a WebSocket connection asynchronously and returns a promise 4949* that resolves when the connection is successfully established. 4950* The promise rejects if an error occurs during the connection attempt. 4951*/ 4952function asyncWsOpen(ws) { 4953 const { promise, resolve, reject } = withResolvers(); 4954 ws.addEventListener("open", () => { 4955 ws.removeEventListener("error", reject); 4956 resolve(); 4957 }); 4958 ws.addEventListener("error", reject); 4959 return promise; 4960} 4961/** 4962* Sets up a periodic ping-pong mechanism to keep the WebSocket connection alive. 4963* 4964* - Sends "PING" messages at regular intervals defined by `intervalMs`. 4965* - If a "PONG" response is not received within the `pongTimeoutMs`, the WebSocket is closed. 4966* - The ping timer resets upon receiving any message to maintain activity. 4967* - Automatically starts the ping process when the WebSocket connection is opened. 4968* - Cleans up timers when the WebSocket is closed. 4969* 4970* @param ws - The WebSocket instance to manage. 4971* @param options - Configuration options for ping-pong intervals and timeouts. 4972*/ 4973function setupPingInterval(ws, { intervalMs, pongTimeoutMs }) { 4974 let pingTimeout; 4975 let pongTimeout; 4976 function start() { 4977 pingTimeout = setTimeout(() => { 4978 ws.send("PING"); 4979 pongTimeout = setTimeout(() => { 4980 ws.close(); 4981 }, pongTimeoutMs); 4982 }, intervalMs); 4983 } 4984 function reset() { 4985 clearTimeout(pingTimeout); 4986 start(); 4987 } 4988 function pong() { 4989 clearTimeout(pongTimeout); 4990 reset(); 4991 } 4992 ws.addEventListener("open", start); 4993 ws.addEventListener("message", ({ data }) => { 4994 clearTimeout(pingTimeout); 4995 start(); 4996 if (data === "PONG") pong(); 4997 }); 4998 ws.addEventListener("close", () => { 4999 clearTimeout(pingTimeout); 5000 clearTimeout(pongTimeout); 5001 }); 5002} 5003/** 5004* Manages a WebSocket connection with support for reconnection, keep-alive mechanisms, 5005* and observable state tracking. 5006*/ 5007var WsConnection = class WsConnection { 5008 constructor(opts) { 5009 var _opts$WebSocketPonyfi; 5010 (0, import_defineProperty$1.default)(this, "id", ++WsConnection.connectCount); 5011 (0, import_defineProperty$1.default)(this, "WebSocketPonyfill", void 0); 5012 (0, import_defineProperty$1.default)(this, "urlOptions", void 0); 5013 (0, import_defineProperty$1.default)(this, "keepAliveOpts", void 0); 5014 (0, import_defineProperty$1.default)(this, "encoder", void 0); 5015 (0, import_defineProperty$1.default)(this, "wsObservable", behaviorSubject(null)); 5016 (0, import_defineProperty$1.default)(this, "openPromise", null); 5017 this.WebSocketPonyfill = (_opts$WebSocketPonyfi = opts.WebSocketPonyfill) !== null && _opts$WebSocketPonyfi !== void 0 ? _opts$WebSocketPonyfi : WebSocket; 5018 if (!this.WebSocketPonyfill) throw new Error("No WebSocket implementation found - you probably don't want to use this on the server, but if you do you need to pass a `WebSocket`-ponyfill"); 5019 this.urlOptions = opts.urlOptions; 5020 this.keepAliveOpts = opts.keepAlive; 5021 this.encoder = opts.encoder; 5022 } 5023 get ws() { 5024 return this.wsObservable.get(); 5025 } 5026 set ws(ws) { 5027 this.wsObservable.next(ws); 5028 } 5029 /** 5030 * Checks if the WebSocket connection is open and ready to communicate. 5031 */ 5032 isOpen() { 5033 return !!this.ws && this.ws.readyState === this.WebSocketPonyfill.OPEN && !this.openPromise; 5034 }
5035 /** 5036 * Checks if the WebSocket connection is closed or in the process of closing. 5037 */ 5038 isClosed() { 5039 return !!this.ws && (this.ws.readyState === this.WebSocketPonyfill.CLOSING || this.ws.readyState === this.WebSocketPonyfill.CLOSED); 5040 } 5041 async open() { 5042 var _this = this; 5043 if (_this.openPromise) return _this.openPromise; 5044 _this.id = ++WsConnection.connectCount; 5045 const wsPromise = prepareUrl(_this.urlOptions).then((url) => new _this.WebSocketPonyfill(url)); 5046 _this.openPromise = wsPromise.then(async (ws) => { 5047 _this.ws = ws; 5048 ws.binaryType = "arraybuffer"; 5049 ws.addEventListener("message", function({ data }) { 5050 if (data === "PING") this.send("PONG"); 5051 }); 5052 if (_this.keepAliveOpts.enabled) setupPingInterval(ws, _this.keepAliveOpts); 5053 ws.addEventListener("close", () => { 5054 if (_this.ws === ws) _this.ws = null; 5055 }); 5056 await asyncWsOpen(ws); 5057 if (_this.urlOptions.connectionParams) ws.send(await buildConnectionMessage(_this.urlOptions.connectionParams, _this.encoder)); 5058 }); 5059 try { 5060 await _this.openPromise; 5061 } finally { 5062 _this.openPromise = null; 5063 } 5064 } 5065 /** 5066 * Closes the WebSocket connection gracefully. 5067 * Waits for any ongoing open operation to complete before closing. 5068 */ 5069 async close() { 5070 var _this2 = this; 5071 try { 5072 await _this2.openPromise; 5073 } finally { 5074 var _this$ws; 5075 (_this$ws = _this2.ws) === null || _this$ws === void 0 || _this$ws.close(); 5076 } 5077 } 5078}; 5079(0, import_defineProperty$1.default)(WsConnection, "connectCount", 0); 5080 5081//#endregion 5082//#region src/links/wsLink/wsClient/wsClient.ts 5083__toESM(require_defineProperty(), 1); 5084__toESM(require_objectSpread2(), 1); 5085 5086//#region src/internals/TRPCUntypedClient.ts 5087var import_defineProperty = __toESM(require_defineProperty(), 1); 5088var import_objectSpread2$4 = __toESM(require_objectSpread2(), 1); 5089var TRPCUntypedClient = class { 5090 constructor(opts) { 5091 (0, import_defineProperty.default)(this, "links", void 0); 5092 (0, import_defineProperty.default)(this, "runtime", void 0); 5093 (0, import_defineProperty.default)(this, "requestId", void 0); 5094 this.requestId = 0; 5095 this.runtime = {}; 5096 this.links = opts.links.map((link) => link(this.runtime)); 5097 } 5098 $request(opts) { 5099 var _opts$context; 5100 const chain$ = createChain({ 5101 links: this.links, 5102 op: (0, import_objectSpread2$4.default)((0, import_objectSpread2$4.default)({}, opts), {}, { 5103 context: (_opts$context = opts.context) !== null && _opts$context !== void 0 ? _opts$context : {}, 5104 id: ++this.requestId 5105 }) 5106 }); 5107 return chain$.pipe(share()); 5108 } 5109 async requestAsPromise(opts) { 5110 var _this = this; 5111 try { 5112 const req$ = _this.$request(opts); 5113 const envelope = await observableToPromise(req$); 5114 const data = envelope.result.data; 5115 return data; 5116 } catch (err) { 5117 throw TRPCClientError.from(err); 5118 } 5119 } 5120 query(path, input, opts) { 5121 return this.requestAsPromise({ 5122 type: "query", 5123 path, 5124 input, 5125 context: opts === null || opts === void 0 ? void 0 : opts.context, 5126 signal: opts === null || opts === void 0 ? void 0 : opts.signal 5127 }); 5128 } 5129 mutation(path, input, opts) { 5130 return this.requestAsPromise({ 5131 type: "mutation", 5132 path, 5133 input, 5134 context: opts === null || opts === void 0 ? void 0 : opts.context, 5135 signal: opts === null || opts === void 0 ? void 0 : opts.signal 5136 }); 5137 } 5138 subscription(path, input, opts) { 5139 const observable$ = this.$request({ 5140 type: "subscription", 5141 path, 5142 input, 5143 context: opts.context, 5144 signal: opts.signal 5145 }); 5146 return observable$.subscribe({ 5147 next(envelope) { 5148 switch (envelope.result.type) { 5149 case "state": { 5150 var _opts$onConnectionSta; 5151 (_opts$onConnectionSta = opts.onConnectionStateChange) === null || _opts$onConnectionSta === void 0 || _opts$onConnectionSta.call(opts, envelope.result); 5152 break; 5153 } 5154 case "started": { 5155 var _opts$onStarted; 5156 (_opts$onStarted = opts.onStarted) === null || _opts$onStarted === void 0 || _opts$onStarted.call(opts, { context: envelope.context }); 5157 break; 5158 } 5159 case "stopped": { 5160 var _opts$onStopped; 5161 (_opts$onStopped = opts.onStopped) === null || _opts$onStopped === void 0 || _opts$onStopped.call(opts); 5162 break; 5163 } 5164 case "data": 5165 case void 0: { 5166 var _opts$onData; 5167 (_opts$onData = opts.onData) === null || _opts$onData === void 0 || _opts$onData.call(opts, envelope.result.data); 5168 break; 5169 } 5170 } 5171 }, 5172 error(err) { 5173 var _opts$onError; 5174 (_opts$onError = opts.onError) === null || _opts$onError === void 0 || _opts$onError.call(opts, err); 5175 },
5176 complete() { 5177 var _opts$onComplete; 5178 (_opts$onComplete = opts.onComplete) === null || _opts$onComplete === void 0 || _opts$onComplete.call(opts); 5179 } 5180 }); 5181 } 5182}; 5183 5184//#endregion 5185//#region src/createTRPCClient.ts 5186const untypedClientSymbol = Symbol.for("trpc_untypedClient"); 5187const clientCallTypeMap = { 5188 query: "query", 5189 mutate: "mutation", 5190 subscribe: "subscription" 5191}; 5192/** @internal */ 5193const clientCallTypeToProcedureType = (clientCallType) => { 5194 return clientCallTypeMap[clientCallType]; 5195}; 5196/** 5197* @internal 5198*/ 5199function createTRPCClientProxy(client) { 5200 const proxy = createRecursiveProxy(({ path, args }) => { 5201 const pathCopy = [...path]; 5202 const procedureType = clientCallTypeToProcedureType(pathCopy.pop()); 5203 const fullPath = pathCopy.join("."); 5204 return client[procedureType](fullPath, ...args); 5205 }); 5206 return createFlatProxy((key) => { 5207 if (key === untypedClientSymbol) return client; 5208 return proxy[key]; 5209 }); 5210} 5211function createTRPCClient(opts) { 5212 const client = new TRPCUntypedClient(opts); 5213 const proxy = createTRPCClientProxy(client); 5214 return proxy; 5215} 5216/** 5217* Get an untyped client from a proxy client 5218* @internal 5219*/ 5220function getUntypedClient(client) { 5221 return client[untypedClientSymbol]; 5222} 5223 5224//#endregion 5225//#region src/links/httpBatchStreamLink.ts 5226__toESM(require_objectSpread2(), 1); 5227 5228//#endregion 5229//#region src/internals/inputWithTrackedEventId.ts 5230__toESM(require_objectSpread2(), 1); 5231 5232//#endregion 5233//#region ../../node_modules/.pnpm/@[email protected]/node_modules/@oxc-project/runtime/src/helpers/asyncIterator.js 5234var require_asyncIterator$1 = __commonJS({ "../../node_modules/.pnpm/@[email protected]/node_modules/@oxc-project/runtime/src/helpers/asyncIterator.js"(exports, module) { 5235 function _asyncIterator$1(r) { 5236 var n, t, o, e = 2; 5237 for ("undefined" != typeof Symbol && (t = Symbol.asyncIterator, o = Symbol.iterator); e--;) { 5238 if (t && null != (n = r[t])) return n.call(r); 5239 if (o && null != (n = r[o])) return new AsyncFromSyncIterator(n.call(r)); 5240 t = "@@asyncIterator", o = "@@iterator"; 5241 } 5242 throw new TypeError("Object is not async iterable"); 5243 } 5244 function AsyncFromSyncIterator(r) { 5245 function AsyncFromSyncIteratorContinuation(r$1) { 5246 if (Object(r$1) !== r$1) return Promise.reject(new TypeError(r$1 + " is not an object.")); 5247 var n = r$1.done; 5248 return Promise.resolve(r$1.value).then(function(r$2) { 5249 return { 5250 value: r$2, 5251 done: n 5252 }; 5253 }); 5254 } 5255 return AsyncFromSyncIterator = function AsyncFromSyncIterator$1(r$1) { 5256 this.s = r$1, this.n = r$1.next; 5257 }, AsyncFromSyncIterator.prototype = { 5258 s: null, 5259 n: null, 5260 next: function next() { 5261 return AsyncFromSyncIteratorContinuation(this.n.apply(this.s, arguments)); 5262 }, 5263 "return": function _return(r$1) { 5264 var n = this.s["return"]; 5265 return void 0 === n ? Promise.resolve({ 5266 value: r$1, 5267 done: true 5268 }) : AsyncFromSyncIteratorContinuation(n.apply(this.s, arguments)); 5269 }, 5270 "throw": function _throw(r$1) { 5271 var n = this.s["return"]; 5272 return void 0 === n ? Promise.reject(r$1) : AsyncFromSyncIteratorContinuation(n.apply(this.s, arguments)); 5273 } 5274 }, new AsyncFromSyncIterator(r); 5275 } 5276 module.exports = _asyncIterator$1, module.exports.__esModule = true, module.exports["default"] = module.exports; 5277} }); 5278 5279//#endregion 5280//#region src/links/httpSubscriptionLink.ts 5281__toESM(require_asyncIterator$1(), 1); 5282 5283//#endregion 5284//#region src/links/retryLink.ts 5285__toESM(require_objectSpread2(), 1); 5286 5287//#endregion 5288//#region ../../node_modules/.pnpm/@[email protected]/node_modules/@oxc-project/runtime/src/helpers/usingCtx.js 5289var require_usingCtx = __commonJS({ "../../node_modules/.pnpm/@[email protected]/node_modules/@oxc-project/runtime/src/helpers/usingCtx.js"(exports, module) { 5290 function _usingCtx() { 5291 var r = "function" == typeof SuppressedError ? SuppressedError : function(r$1, e$1) { 5292 var n$1 = Error(); 5293 return n$1.name = "SuppressedError", n$1.error = r$1, n$1.suppressed = e$1, n$1; 5294 }, e = {}, n = []; 5295 function using(r$1, e$1) { 5296 if (null != e$1) { 5297 if (Object(e$1) !== e$1) throw new TypeError("using declarations can only be used with objects, functions, null, or undefined."); 5298 if (r$1) var o = e$1[Symbol.asyncDispose || Symbol["for"]("Symbol.asyncDispose")]; 5299 if (void 0 === o && (o = e$1[Symbol.dispose || Symbol["for"]("Symbol.dispose")], r$1)) var t = o; 5300 if ("function" != typeof o) throw new TypeError("Object is not disposable."); 5301 t && (o = function o$1() { 5302 try { 5303 t.call(e$1); 5304 } catch (r$2) { 5305 return Promise.reject(r$2); 5306 } 5307 }), n.push({ 5308 v: e$1, 5309 d: o, 5310 a: r$1 5311 }); 5312 } else r$1 && n.push({ 5313 d: e$1, 5314 a: r$1 5315 }); 5316 return e$1; 5317 } 5318 return { 5319 e, 5320 u: using.bind(null, false), 5321 a: using.bind(null, true), 5322 d: function d() { 5323 var o, t = this.e, s = 0; 5324 function next() { 5325 for (; o = n.pop();) try { 5326 if (!o.a && 1 === s) return s = 0, n.push(o), Promise.resolve().then(next); 5327 if (o.d) { 5328 var r$1 = o.d.call(o.v); 5329 if (o.a) return s |= 2, Promise.resolve(r$1).then(next, err); 5330 } else s |= 1; 5331 } catch (r$2) { 5332 return err(r$2); 5333 } 5334 if (1 === s) return t !== e ? Promise.reject(t) : Promise.resolve(); 5335 if (t !== e) throw t; 5336 } 5337 function err(n$1) { 5338 return t = t !== e ? new r(n$1, t) : n$1, next(); 5339 } 5340 return next(); 5341 } 5342 }; 5343 } 5344 module.exports = _usingCtx, module.exports.__esModule = true, module.exports["default"] = module.exports; 5345} }); 5346 5347//#endregion 5348//#region ../../node_modules/.pnpm/@[email protected]/node_modules/@oxc-project/runtime/src/helpers/OverloadYield.js 5349var require_OverloadYield = __commonJS({ "../../node_modules/.pnpm/@[email protected]/node_modules/@oxc-project/runtime/src/helpers/OverloadYield.js"(exports, module) { 5350 function _OverloadYield(e, d) { 5351 this.v = e, this.k = d; 5352 } 5353 module.exports = _OverloadYield, module.exports.__esModule = true, module.exports["default"] = module.exports; 5354} }); 5355 5356//#endregion 5357//#region ../../node_modules/.pnpm/@[email protected]/node_modules/@oxc-project/runtime/src/helpers/awaitAsyncGenerator.js 5358var require_awaitAsyncGenerator = __commonJS({ "../../node_modules/.pnpm/@[email protected]/node_modules/@oxc-project/runtime/src/helpers/awaitAsyncGenerator.js"(exports, module) { 5359 var OverloadYield$1 = require_OverloadYield(); 5360 function _awaitAsyncGenerator$1(e) { 5361 return new OverloadYield$1(e, 0); 5362 } 5363 module.exports = _awaitAsyncGenerator$1, module.exports.__esModule = true, module.exports["default"] = module.exports; 5364} }); 5365 5366//#endregion 5367//#region ../../node_modules/.pnpm/@[email protected]/node_modules/@oxc-project/runtime/src/helpers/wrapAsyncGenerator.js 5368var require_wrapAsyncGenerator = __commonJS({ "../../node_modules/.pnpm/@[email protected]/node_modules/@oxc-project/runtime/src/helpers/wrapAsyncGenerator.js"(exports, module) { 5369 var OverloadYield = require_OverloadYield(); 5370 function _wrapAsyncGenerator$1(e) { 5371 return function() { 5372 return new AsyncGenerator(e.apply(this, arguments)); 5373 }; 5374 } 5375 function AsyncGenerator(e) { 5376 var r, t; 5377 function resume(r$1, t$1) { 5378 try { 5379 var n = e[r$1](t$1), o = n.value, u = o instanceof OverloadYield; 5380 Promise.resolve(u ? o.v : o).then(function(t$2) { 5381 if (u) { 5382 var i = "return" === r$1 ? "return" : "next"; 5383 if (!o.k || t$2.done) return resume(i, t$2); 5384 t$2 = e[i](t$2).value; 5385 } 5386 settle(n.done ? "return" : "normal", t$2); 5387 }, function(e$1) { 5388 resume("throw", e$1); 5389 }); 5390 } catch (e$1) { 5391 settle("throw", e$1); 5392 } 5393 } 5394 function settle(e$1, n) { 5395 switch (e$1) { 5396 case "return": 5397 r.resolve({ 5398 value: n, 5399 done: true 5400 }); 5401 break; 5402 case "throw": 5403 r.reject(n); 5404 break; 5405 default: r.resolve({ 5406 value: n, 5407 done: false 5408 }); 5409 } 5410 (r = r.next) ? resume(r.key, r.arg) : t = null; 5411 } 5412 this._invoke = function(e$1, n) { 5413 return new Promise(function(o, u) { 5414 var i = { 5415 key: e$1, 5416 arg: n, 5417 resolve: o, 5418 reject: u, 5419 next: null 5420 }; 5421 t ? t = t.next = i : (r = t = i, resume(e$1, n)); 5422 }); 5423 }, "function" != typeof e["return"] && (this["return"] = void 0); 5424 } 5425 AsyncGenerator.prototype["function" == typeof Symbol && Symbol.asyncIterator || "@@asyncIterator"] = function() { 5426 return this; 5427 }, AsyncGenerator.prototype.next = function(e) { 5428 return this._invoke("next", e); 5429 }, AsyncGenerator.prototype["throw"] = function(e) { 5430 return this._invoke("throw", e); 5431 }, AsyncGenerator.prototype["return"] = function(e) { 5432 return this._invoke("return", e); 5433 }; 5434 module.exports = _wrapAsyncGenerator$1, module.exports.__esModule = true, module.exports["default"] = module.exports; 5435} }); 5436 5437//#endregion 5438//#region src/links/localLink.ts 5439__toESM(require_usingCtx(), 1); 5440__toESM(require_awaitAsyncGenerator(), 1); 5441__toESM(require_wrapAsyncGenerator(), 1);
5442__toESM(require_objectSpread2(), 1); 5443 5444//#region src/shared/proxy/decorationProxy.ts 5445/** 5446* Create proxy for decorating procedures 5447* @internal 5448*/ 5449function createReactDecoration(hooks) { 5450 return createRecursiveProxy(({ path, args }) => { 5451 var _rest$; 5452 const pathCopy = [...path]; 5453 const lastArg = pathCopy.pop(); 5454 if (lastArg === "useMutation") return hooks[lastArg](pathCopy, ...args); 5455 if (lastArg === "_def") return { path: pathCopy }; 5456 const [input, ...rest] = args; 5457 const opts = (_rest$ = rest[0]) !== null && _rest$ !== void 0 ? _rest$ : {}; 5458 return hooks[lastArg](pathCopy, input, opts); 5459 }); 5460} 5461 5462//#endregion 5463//#region src/internals/context.tsx 5464var _React$createContext; 5465const contextProps = [ 5466 "client", 5467 "ssrContext", 5468 "ssrState", 5469 "abortOnUnmount" 5470]; 5471const TRPCContext = (_React$createContext = reactExports.createContext) === null || _React$createContext === void 0 ? void 0 : _React$createContext.call(React$1, null); 5472 5473//#endregion 5474//#region src/shared/proxy/utilsProxy.ts 5475const getQueryType = (utilName) => { 5476 switch (utilName) { 5477 case "queryOptions": 5478 case "fetch": 5479 case "ensureData": 5480 case "prefetch": 5481 case "getData": 5482 case "setData": 5483 case "setQueriesData": return "query"; 5484 case "infiniteQueryOptions": 5485 case "fetchInfinite": 5486 case "prefetchInfinite": 5487 case "getInfiniteData": 5488 case "setInfiniteData": return "infinite"; 5489 case "setMutationDefaults": 5490 case "getMutationDefaults": 5491 case "isMutating": 5492 case "cancel": 5493 case "invalidate": 5494 case "refetch": 5495 case "reset": return "any"; 5496 } 5497}; 5498/** 5499* @internal 5500*/ 5501function createRecursiveUtilsProxy(context) { 5502 return createRecursiveProxy((opts) => { 5503 const path = [...opts.path]; 5504 const utilName = path.pop(); 5505 const args = [...opts.args]; 5506 const input = args.shift(); 5507 const queryType = getQueryType(utilName); 5508 const queryKey = getQueryKeyInternal(path, input, queryType); 5509 const contextMap = { 5510 infiniteQueryOptions: () => context.infiniteQueryOptions(path, queryKey, args[0]), 5511 queryOptions: () => context.queryOptions(path, queryKey, ...args), 5512 fetch: () => context.fetchQuery(queryKey, ...args), 5513 fetchInfinite: () => context.fetchInfiniteQuery(queryKey, args[0]), 5514 prefetch: () => context.prefetchQuery(queryKey, ...args), 5515 prefetchInfinite: () => context.prefetchInfiniteQuery(queryKey, args[0]), 5516 ensureData: () => context.ensureQueryData(queryKey, ...args), 5517 invalidate: () => context.invalidateQueries(queryKey, ...args), 5518 reset: () => context.resetQueries(queryKey, ...args), 5519 refetch: () => context.refetchQueries(queryKey, ...args), 5520 cancel: () => context.cancelQuery(queryKey, ...args), 5521 setData: () => { 5522 context.setQueryData(queryKey, args[0], args[1]); 5523 }, 5524 setQueriesData: () => context.setQueriesData(queryKey, args[0], args[1], args[2]), 5525 setInfiniteData: () => { 5526 context.setInfiniteQueryData(queryKey, args[0], args[1]); 5527 }, 5528 getData: () => context.getQueryData(queryKey), 5529 getInfiniteData: () => context.getInfiniteQueryData(queryKey), 5530 setMutationDefaults: () => context.setMutationDefaults(getMutationKeyInternal(path), input), 5531 getMutationDefaults: () => context.getMutationDefaults(getMutationKeyInternal(path)), 5532 isMutating: () => context.isMutating({ mutationKey: getMutationKeyInternal(path) }) 5533 }; 5534 return contextMap[utilName](); 5535 }); 5536} 5537/** 5538* @internal 5539*/ 5540function createReactQueryUtils(context) { 5541 const clientProxy = createTRPCClientProxy(context.client); 5542 const proxy = createRecursiveUtilsProxy(context); 5543 return createFlatProxy((key) => { 5544 const contextName = key; 5545 if (contextName === "client") return clientProxy; 5546 if (contextProps.includes(contextName)) return context[contextName]; 5547 return proxy[key]; 5548 }); 5549} 5550 5551//#endregion 5552//#region src/shared/proxy/useQueriesProxy.ts 5553var import_objectSpread2$3 = __toESM$1(require_objectSpread2$1(), 1); 5554/** 5555* Create proxy for `useQueries` options 5556* @internal 5557*/ 5558function createUseQueries(client) { 5559 const untypedClient = client instanceof TRPCUntypedClient ? client : getUntypedClient(client); 5560 return createRecursiveProxy((opts) => { 5561 const arrayPath = opts.path; 5562 const dotPath = arrayPath.join("."); 5563 const [input, _opts] = opts.args; 5564 const options = (0, import_objectSpread2$3.default)({ 5565 queryKey: getQueryKeyInternal(arrayPath, input, "query"), 5566 queryFn: () => { 5567 return untypedClient.query(dotPath, input, _opts === null || _opts === void 0 ? void 0 : _opts.trpc); 5568 } 5569 }, _opts); 5570 return options; 5571 }); 5572} 5573 5574//#endregion 5575//#region src/internals/getClientArgs.ts 5576var import_objectSpread2$2 = __toESM$1(require_objectSpread2$1(), 1
5576); 5577/** 5578* @internal 5579*/ 5580function getClientArgs(queryKey, opts, infiniteParams) { 5581 var _queryKey$; 5582 const path = queryKey[0]; 5583 let input = (_queryKey$ = queryKey[1]) === null || _queryKey$ === void 0 ? void 0 : _queryKey$.input; 5584 if (infiniteParams) { 5585 var _input; 5586 input = (0, import_objectSpread2$2.default)((0, import_objectSpread2$2.default)((0, import_objectSpread2$2.default)({}, (_input = input) !== null && _input !== void 0 ? _input : {}), infiniteParams.pageParam ? { cursor: infiniteParams.pageParam } : {}), {}, { direction: infiniteParams.direction }); 5587 } 5588 return [ 5589 path.join("."), 5590 input, 5591 opts === null || opts === void 0 ? void 0 : opts.trpc 5592 ]; 5593} 5594 5595//#endregion 5596//#region ../../node_modules/.pnpm/@[email protected]/node_modules/@oxc-project/runtime/src/helpers/asyncIterator.js 5597var require_asyncIterator = __commonJS$1({ "../../node_modules/.pnpm/@[email protected]/node_modules/@oxc-project/runtime/src/helpers/asyncIterator.js"(exports, module) { 5598 function _asyncIterator$1(r) { 5599 var n, t, o, e = 2; 5600 for ("undefined" != typeof Symbol && (t = Symbol.asyncIterator, o = Symbol.iterator); e--;) { 5601 if (t && null != (n = r[t])) return n.call(r); 5602 if (o && null != (n = r[o])) return new AsyncFromSyncIterator(n.call(r)); 5603 t = "@@asyncIterator", o = "@@iterator"; 5604 } 5605 throw new TypeError("Object is not async iterable"); 5606 } 5607 function AsyncFromSyncIterator(r) { 5608 function AsyncFromSyncIteratorContinuation(r$1) { 5609 if (Object(r$1) !== r$1) return Promise.reject(new TypeError(r$1 + " is not an object.")); 5610 var n = r$1.done; 5611 return Promise.resolve(r$1.value).then(function(r$2) { 5612 return { 5613 value: r$2, 5614 done: n 5615 }; 5616 }); 5617 } 5618 return AsyncFromSyncIterator = function AsyncFromSyncIterator$1(r$1) { 5619 this.s = r$1, this.n = r$1.next; 5620 }, AsyncFromSyncIterator.prototype = { 5621 s: null, 5622 n: null, 5623 next: function next() { 5624 return AsyncFromSyncIteratorContinuation(this.n.apply(this.s, arguments)); 5625 }, 5626 "return": function _return(r$1) { 5627 var n = this.s["return"]; 5628 return void 0 === n ? Promise.resolve({ 5629 value: r$1, 5630 done: true 5631 }) : AsyncFromSyncIteratorContinuation(n.apply(this.s, arguments)); 5632 }, 5633 "throw": function _throw(r$1) { 5634 var n = this.s["return"]; 5635 return void 0 === n ? Promise.reject(r$1) : AsyncFromSyncIteratorContinuation(n.apply(this.s, arguments)); 5636 } 5637 }, new AsyncFromSyncIterator(r); 5638 } 5639 module.exports = _asyncIterator$1, module.exports.__esModule = true, module.exports["default"] = module.exports; 5640} }); 5641 5642//#endregion 5643//#region src/internals/trpcResult.ts 5644var import_asyncIterator = __toESM$1(require_asyncIterator(), 1); 5645function createTRPCOptionsResult(value) { 5646 const path = value.path.join("."); 5647 return { path }; 5648} 5649/** 5650* Makes a stable reference of the `trpc` prop 5651*/ 5652function useHookResult(value) { 5653 const result = createTRPCOptionsResult(value); 5654 return reactExports.useMemo(() => result, [result]); 5655} 5656/** 5657* @internal 5658*/ 5659async function buildQueryFromAsyncIterable(asyncIterable, queryClient, queryKey) { 5660 const queryCache = queryClient.getQueryCache(); 5661 const query = queryCache.build(queryClient, { queryKey }); 5662 query.setState({ 5663 data: [], 5664 status: "success" 5665 }); 5666 const aggregate = []; 5667 var _iteratorAbruptCompletion = false; 5668 var _didIteratorError = false; 5669 var _iteratorError; 5670 try { 5671 for (var _iterator = (0, import_asyncIterator.default)(asyncIterable), _step; _iteratorAbruptCompletion = !(_step = await _iterator.next()).done; _iteratorAbruptCompletion = false) { 5672 const value = _step.value; 5673 { 5674 aggregate.push(value); 5675 query.setState({ data: [...aggregate] }); 5676 } 5677 } 5678 } catch (err) { 5679 _didIteratorError = true; 5680 _iteratorError = err; 5681 } finally { 5682 try { 5683 if (_iteratorAbruptCompletion && _iterator.return != null) await _iterator.return(); 5684 } finally { 5685 if (_didIteratorError) throw _iteratorError; 5686 } 5687 } 5688 return aggregate; 5689} 5690 5691//#endregion 5692//#region src/utils/createUtilityFunctions.ts 5693var import_objectSpread2$1 = __toESM$1(require_objectSpread2$1(), 1); 5694/** 5695* Creates a set of utility functions that can be used to interact with `react-query` 5696* @param opts the `TRPCClient` and `QueryClient` to use 5697* @returns a set of utility functions that can be used to interact with `react-query` 5698* @internal 5699*/ 5700function createUtilityFunctions(opts) { 5701 const { client, queryClient } = opts; 5702 const untypedClient = client instanceof TRPCUntypedClient ? client : getUntypedClient(client); 5703 return { 5704 infiniteQueryOptions: (path, queryKey, opts$1) => { 5705 var _queryKey$, _ref; 5706 const inputIsSkipToken = ((_queryKey$ = queryKey[1]) === null || _queryKey$ === void 0 ? void 0 : _queryKey$.input)
5706=== skipToken; 5707 const queryFn = async (queryFnContext) => { 5708 var _opts$trpc; 5709 const actualOpts = (0, import_objectSpread2$1.default)((0, import_objectSpread2$1.default)({}, opts$1), {}, { trpc: (0, import_objectSpread2$1.default)((0, import_objectSpread2$1.default)({}, opts$1 === null || opts$1 === void 0 ? void 0 : opts$1.trpc), (opts$1 === null || opts$1 === void 0 || (_opts$trpc = opts$1.trpc) === null || _opts$trpc === void 0 ? void 0 : _opts$trpc.abortOnUnmount) ? { signal: queryFnContext.signal } : { signal: null }) }); 5710 const result = await untypedClient.query(...getClientArgs(queryKey, actualOpts, { 5711 direction: queryFnContext.direction, 5712 pageParam: queryFnContext.pageParam 5713 })); 5714 return result; 5715 }; 5716 return Object.assign(infiniteQueryOptions((0, import_objectSpread2$1.default)((0, import_objectSpread2$1.default)({}, opts$1), {}, { 5717 initialData: opts$1 === null || opts$1 === void 0 ? void 0 : opts$1.initialData, 5718 queryKey, 5719 queryFn: inputIsSkipToken ? skipToken : queryFn, 5720 initialPageParam: (_ref = opts$1 === null || opts$1 === void 0 ? void 0 : opts$1.initialCursor) !== null && _ref !== void 0 ? _ref : null 5721 })), { trpc: createTRPCOptionsResult({ path }) }); 5722 }, 5723 queryOptions: (path, queryKey, opts$1) => { 5724 var _queryKey$2; 5725 const inputIsSkipToken = ((_queryKey$2 = queryKey[1]) === null || _queryKey$2 === void 0 ? void 0 : _queryKey$2.input) === skipToken; 5726 const queryFn = async (queryFnContext) => { 5727 var _opts$trpc2; 5728 const actualOpts = (0, import_objectSpread2$1.default)((0, import_objectSpread2$1.default)({}, opts$1), {}, { trpc: (0, import_objectSpread2$1.default)((0, import_objectSpread2$1.default)({}, opts$1 === null || opts$1 === void 0 ? void 0 : opts$1.trpc), (opts$1 === null || opts$1 === void 0 || (_opts$trpc2 = opts$1.trpc) === null || _opts$trpc2 === void 0 ? void 0 : _opts$trpc2.abortOnUnmount) ? { signal: queryFnContext.signal } : { signal: null }) }); 5729 const result = await untypedClient.query(...getClientArgs(queryKey, actualOpts)); 5730 if (isAsyncIterable(result)) return buildQueryFromAsyncIterable(result, queryClient, queryKey); 5731 return result; 5732 }; 5733 return Object.assign(queryOptions((0, import_objectSpread2$1.default)((0, import_objectSpread2$1.default)({}, opts$1), {}, { 5734 initialData: opts$1 === null || opts$1 === void 0 ? void 0 : opts$1.initialData, 5735 queryKey, 5736 queryFn: inputIsSkipToken ? skipToken : queryFn 5737 })), { trpc: createTRPCOptionsResult({ path }) }); 5738 }, 5739 fetchQuery: (queryKey, opts$1) => { 5740 return queryClient.fetchQuery((0, import_objectSpread2$1.default)((0, import_objectSpread2$1.default)({}, opts$1), {}, { 5741 queryKey, 5742 queryFn: () => untypedClient.query(...getClientArgs(queryKey, opts$1)) 5743 })); 5744 }, 5745 fetchInfiniteQuery: (queryKey, opts$1) => { 5746 var _opts$initialCursor; 5747 return queryClient.fetchInfiniteQuery((0, import_objectSpread2$1.default)((0, import_objectSpread2$1.default)({}, opts$1), {}, { 5748 queryKey, 5749 queryFn: ({ pageParam, direction }) => { 5750 return untypedClient.query(...getClientArgs(queryKey, opts$1, { 5751 pageParam, 5752 direction 5753 })); 5754 }, 5755 initialPageParam: (_opts$initialCursor = opts$1 === null || opts$1 === void 0 ? void 0 : opts$1.initialCursor) !== null && _opts$initialCursor !== void 0 ? _opts$initialCursor : null 5756 })); 5757 }, 5758 prefetchQuery: (queryKey, opts$1) => { 5759 return queryClient.prefetchQuery((0, import_objectSpread2$1.default)((0, import_objectSpread2$1.default)({}, opts$1), {}, { 5760 queryKey, 5761 queryFn: () => untypedClient.query(...getClientArgs(queryKey, opts$1)) 5762 })); 5763 }, 5764 prefetchInfiniteQuery: (queryKey, opts$1) => { 5765 var _opts$initialCursor2; 5766 return queryClient.prefetchInfiniteQuery((0, import_objectSpread2$1.default)((0, import_objectSpread2$1.default)({}, opts$1), {}, { 5767 queryKey, 5768 queryFn: ({ pageParam, direction }) => { 5769 return untypedClient.query(...getClientArgs(queryKey, opts$1, { 5770 pageParam, 5771 direction 5772 })); 5773 }, 5774 initialPageParam: (_opts$initialCursor2 = opts$1 === null || opts$1 === void 0 ? void 0 : opts$1.initialCursor) !== null && _opts$initialCursor2 !== void 0 ? _opts$initialCursor2 : null 5775 })); 5776 }, 5777 ensureQueryData: (queryKey, opts$1) => { 5778 return queryClient.ensureQueryData((0, import_objectSpread2$1.default)((0, import_objectSpread2$1.default)({}, opts$1), {}, { 5779 queryKey, 5780 queryFn: () => untypedClient.query(...getClientArgs(queryKey, opts$1)) 5781 })); 5782 }, 5783 invalidateQueries: (queryKey, filters, options) => {
5784 return queryClient.invalidateQueries((0, import_objectSpread2$1.default)((0, import_objectSpread2$1.default)({}, filters), {}, { queryKey }), options); 5785 }, 5786 resetQueries: (queryKey, filters, options) => { 5787 return queryClient.resetQueries((0, import_objectSpread2$1.default)((0, import_objectSpread2$1.default)({}, filters), {}, { queryKey }), options); 5788 }, 5789 refetchQueries: (queryKey, filters, options) => { 5790 return queryClient.refetchQueries((0, import_objectSpread2$1.default)((0, import_objectSpread2$1.default)({}, filters), {}, { queryKey }), options); 5791 }, 5792 cancelQuery: (queryKey, options) => { 5793 return queryClient.cancelQueries({ queryKey }, options); 5794 }, 5795 setQueryData: (queryKey, updater, options) => { 5796 return queryClient.setQueryData(queryKey, updater, options); 5797 }, 5798 setQueriesData: (queryKey, filters, updater, options) => { 5799 return queryClient.setQueriesData((0, import_objectSpread2$1.default)((0, import_objectSpread2$1.default)({}, filters), {}, { queryKey }), updater, options); 5800 }, 5801 getQueryData: (queryKey) => { 5802 return queryClient.getQueryData(queryKey); 5803 }, 5804 setInfiniteQueryData: (queryKey, updater, options) => { 5805 return queryClient.setQueryData(queryKey, updater, options); 5806 }, 5807 getInfiniteQueryData: (queryKey) => { 5808 return queryClient.getQueryData(queryKey); 5809 }, 5810 setMutationDefaults: (mutationKey, options) => { 5811 const path = mutationKey[0]; 5812 const canonicalMutationFn = (input) => { 5813 return untypedClient.mutation(...getClientArgs([path, { input }], opts)); 5814 }; 5815 return queryClient.setMutationDefaults(mutationKey, typeof options === "function" ? options({ canonicalMutationFn }) : options); 5816 }, 5817 getMutationDefaults: (mutationKey) => { 5818 return queryClient.getMutationDefaults(mutationKey); 5819 }, 5820 isMutating: (filters) => { 5821 return queryClient.isMutating((0, import_objectSpread2$1.default)((0, import_objectSpread2$1.default)({}, filters), {}, { exact: true })); 5822 } 5823 }; 5824} 5825 5826//#endregion 5827//#region src/shared/hooks/createHooksInternal.tsx 5828var import_objectSpread2 = __toESM$1(require_objectSpread2$1()); 5829const trackResult = (result, onTrackResult) => { 5830 const trackedResult = new Proxy(result, { get(target, prop) { 5831 onTrackResult(prop); 5832 return target[prop]; 5833 } }); 5834 return trackedResult; 5835}; 5836/** 5837* @internal 5838*/ 5839function createRootHooks(config) { 5840 var _config$overrides$use, _config$context; 5841 const mutationSuccessOverride = (_config$overrides$use = void 0 ) !== null && _config$overrides$use !== void 0 ? _config$overrides$use : (options) => options.originalFn(); 5842 const Context = (_config$context = void 0 ) !== null && _config$context !== void 0 ? _config$context : TRPCContext; 5843 const createClient = createTRPCClient; 5844 const TRPCProvider = (props) => { 5845 var _props$ssrState; 5846 const { abortOnUnmount = false, queryClient, ssrContext } = props; 5847 const [ssrState, setSSRState] = reactExports.useState((_props$ssrState = props.ssrState) !== null && _props$ssrState !== void 0 ? _props$ssrState : false); 5848 const client = props.client instanceof TRPCUntypedClient ? props.client : getUntypedClient(props.client); 5849 const fns = reactExports.useMemo(() => createUtilityFunctions({ 5850 client, 5851 queryClient 5852 }), [client, queryClient]); 5853 const contextValue = reactExports.useMemo(() => (0, import_objectSpread2.default)({ 5854 abortOnUnmount, 5855 queryClient, 5856 client, 5857 ssrContext: ssrContext !== null && ssrContext !== void 0 ? ssrContext : null, 5858 ssrState 5859 }, fns), [ 5860 abortOnUnmount, 5861 client, 5862 fns, 5863 queryClient, 5864 ssrContext, 5865 ssrState 5866 ]); 5867 reactExports.useEffect(() => { 5868 setSSRState((state) => state ? "mounted" : false); 5869 }, []); 5870 return /* @__PURE__ */ jsxRuntimeExports.jsx(Context.Provider, { 5871 value: contextValue, 5872 children: props.children 5873 }); 5874 }; 5875 function useContext() { 5876 const context = reactExports.useContext(Context); 5877 if (!context) throw new Error("Unable to find tRPC Context. Did you forget to wrap your App inside `withTRPC` HoC?"); 5878 return context; 5879 } 5880 /** 5881 * Hack to make sure errors return `status`='error` when doing SSR 5882 * @see https://github.com/trpc/trpc/pull/1645 5883 */ 5884 function useSSRQueryOptionsIfNeeded(queryKey, opts) { 5885 var _queryClient$getQuery; 5886 const { queryClient, ssrState } = useContext(); 5887 return ssrState && ssrState !== "mounted" && ((_queryClient$getQuery = queryClient.getQueryCache().find({ queryKey })) === null || _queryClient$getQuery === void 0 ? void 0 : _queryClient$getQuery.state.status) === "error" ? (0, import_objectSpread2.default)({ retryOnMount: false }, opts) : opts; 5888 } 5889 function useQuery$1(path, input, opts) { 5890 var _opts$trpc, _opts$enabled, _ref, _opts$trpc$abortOnUnm, _opts$trpc2; 5891 const context = useContext(); 5892 const { abortOnUnmount, client, ssrState, queryClient, prefetchQuery } = context; 5893 const queryKey = getQueryKeyInternal(path, input, "query"); 5894 const defaultOpts = queryClient.getQueryDefaults(queryKey); 5895 const isInputSkipToken = input === skipToken; 5896 if (typeof window === "undefined" && ssrState === "prepass" && (opts === null || opts === void 0 || (_opts$trpc = opts.trpc) === null || _opts$trpc === void 0 ? void 0 : _opts$trpc.ssr) !== false && ((_opts$enabled = opts === null || opts === void 0 ? void 0 : opts.enabled) !== null && _opts$enabled !== void 0 ? _opts$enabled : defaultOpts === null || defaultOpts === void 0 ? void 0 : defaultOpts.enabled) !== false && !isInputSkipToken && !queryClient.getQueryCache().find({ queryKey })) prefetchQuery(queryKey, opts); 5897 const ssrOpts = useSSRQueryOptionsIfNeeded(queryKey, (0, import_objectSpread2.default)((0, import_objectSpread2.default)({}, defaultOpts), opts)); 5898 const shouldAbortOnUnmount = (_ref = (_opts$trpc$abortOnUnm = opts === null || opts === void 0 || (_opts$trpc2 = opts.trpc) === null || _opts$trpc2 === void 0 ? void 0 : _opts$trpc2.abortOnUnmount) !== null && _opts$trpc$abortOnUnm !== void 0 ? _opts$trpc$abortOnUnm : void 0 ) !== null && _ref !== void 0 ? _ref : abortOnUnmount; 5899 const hook = useQuery((0, import_objectSpread2.default)((0, import_objectSpread2.default)({}, ssrOpts), {}, { 5900 queryKey, 5901 queryFn: isInputSkipToken ? input : async (queryFunctionContext) => { 5902 const actualOpts = (0, import_objectSpread2.default)((0, import_objectSpread2.default)({}, ssrOpts), {}, { trpc: (0, import_objectSpread2.default)((0, import_objectSpread2.default)({}, ssrOpts === null || ssrOpts === void 0 ? void 0 : ssrOpts.trpc), shouldAbortOnUnmount ? { signal: queryFunctionContext.signal }
5902 : { signal: null }) }); 5903 const result = await client.query(...getClientArgs(queryKey, actualOpts)); 5904 if (isAsyncIterable(result)) return buildQueryFromAsyncIterable(result, queryClient, queryKey); 5905 return result; 5906 } 5907 }), queryClient); 5908 hook.trpc = useHookResult({ path }); 5909 return hook; 5910 } 5911 function usePrefetchQuery$1(path, input, opts) { 5912 var _ref2, _opts$trpc$abortOnUnm2, _opts$trpc3; 5913 const context = useContext(); 5914 const queryKey = getQueryKeyInternal(path, input, "query"); 5915 const isInputSkipToken = input === skipToken; 5916 const shouldAbortOnUnmount = (_ref2 = (_opts$trpc$abortOnUnm2 = opts === null || opts === void 0 || (_opts$trpc3 = opts.trpc) === null || _opts$trpc3 === void 0 ? void 0 : _opts$trpc3.abortOnUnmount) !== null && _opts$trpc$abortOnUnm2 !== void 0 ? _opts$trpc$abortOnUnm2 : void 0 ) !== null && _ref2 !== void 0 ? _ref2 : context.abortOnUnmount; 5917 usePrefetchQuery((0, import_objectSpread2.default)((0, import_objectSpread2.default)({}, opts), {}, { 5918 queryKey, 5919 queryFn: isInputSkipToken ? input : (queryFunctionContext) => { 5920 const actualOpts = { trpc: (0, import_objectSpread2.default)((0, import_objectSpread2.default)({}, opts === null || opts === void 0 ? void 0 : opts.trpc), shouldAbortOnUnmount ? { signal: queryFunctionContext.signal } : {}) }; 5921 return context.client.query(...getClientArgs(queryKey, actualOpts)); 5922 } 5923 })); 5924 } 5925 function useSuspenseQuery$1(path, input, opts) { 5926 var _ref3, _opts$trpc$abortOnUnm3, _opts$trpc4; 5927 const context = useContext(); 5928 const queryKey = getQueryKeyInternal(path, input, "query"); 5929 const shouldAbortOnUnmount = (_ref3 = (_opts$trpc$abortOnUnm3 = opts === null || opts === void 0 || (_opts$trpc4 = opts.trpc) === null || _opts$trpc4 === void 0 ? void 0 : _opts$trpc4.abortOnUnmount) !== null && _opts$trpc$abortOnUnm3 !== void 0 ? _opts$trpc$abortOnUnm3 : void 0 ) !== null && _ref3 !== void 0 ? _ref3 : context.abortOnUnmount; 5930 const hook = useSuspenseQuery((0, import_objectSpread2.default)((0, import_objectSpread2.default)({}, opts), {}, { 5931 queryKey, 5932 queryFn: (queryFunctionContext) => { 5933 const actualOpts = (0, import_objectSpread2.default)((0, import_objectSpread2.default)({}, opts), {}, { trpc: (0, import_objectSpread2.default)((0, import_objectSpread2.default)({}, opts === null || opts === void 0 ? void 0 : opts.trpc), shouldAbortOnUnmount ? { signal: queryFunctionContext.signal } : { signal: null }) }); 5934 return context.client.query(...getClientArgs(queryKey, actualOpts)); 5935 } 5936 }), context.queryClient); 5937 hook.trpc = useHookResult({ path }); 5938 return [hook.data, hook]; 5939 } 5940 function useMutation$1(path, opts) { 5941 const { client, queryClient } = useContext(); 5942 const mutationKey = getMutationKeyInternal(path); 5943 const defaultOpts = queryClient.defaultMutationOptions(queryClient.getMutationDefaults(mutationKey)); 5944 const hook = useMutation((0, import_objectSpread2.default)((0, import_objectSpread2.default)({}, opts), {}, { 5945 mutationKey, 5946 mutationFn: (input) => { 5947 return client.mutation(...getClientArgs([path, { input }], opts)); 5948 }, 5949 onSuccess(...args) { 5950 var _ref4, _opts$meta; 5951 const originalFn = () => { 5952 var _opts$onSuccess, _opts$onSuccess2, _defaultOpts$onSucces; 5953 return (_opts$onSuccess = opts === null || opts === void 0 || (_opts$onSuccess2 = opts.onSuccess) === null || _opts$onSuccess2 === void 0 ? void 0 : _opts$onSuccess2.call(opts, ...args)) !== null && _opts$onSuccess !== void 0 ? _opts$onSuccess : defaultOpts === null || defaultOpts === void 0 || (_defaultOpts$onSucces = defaultOpts.onSuccess) === null || _defaultOpts$onSucces === void 0 ? void 0 : _defaultOpts$onSucces.call(defaultOpts, ...args); 5954 }; 5955 return mutationSuccessOverride({ 5956 originalFn, 5957 queryClient, 5958 meta: (_ref4 = (_opts$meta = opts === null || opts === void 0 ? void 0 : opts.meta) !== null && _opts$meta !== void 0 ? _opts$meta : defaultOpts === null || defaultOpts === void 0 ? void 0 : defaultOpts.meta) !== null && _ref4 !== void 0 ? _ref4 : {} 5959 }); 5960 } 5961 }), queryClient); 5962 hook.trpc = useHookResult({ path }); 5963 return hook; 5964 } 5965 const initialStateIdle = { 5966 data: void 0, 5967 error: null, 5968 status: "idle" 5969 }; 5970 const initialStateConnecting = { 5971 data: void 0, 5972 error: null, 5973 status: "connecting" 5974 }; 5975 /* istanbul ignore next -- @preserve */ 5976 function useSubscription(path, input, opts) { 5977 var _opts$enabled2; 5978 const enabled = (_opts$enabled2 = opts === null || opts === void 0 ? void 0 : opts.enabled) !== null && _opts$enabled2 !== void 0 ? _opts$enabled2 : input !== skipToken; 5979 const queryKey = hashKey(getQueryKeyInternal(path, input, "any")); 5980 const { client } = useContext(); 5981 const optsRef = reactExports.useRef(opts); 5982 reactExports.useEffect(() => { 5983 optsRef.current = opts; 5984 }); 5985 const [trackedProps] = reactExports.useState(new Set([])); 5986 const addTrackedProp = reactExports.useCallback((key) => { 5987 trackedProps.add(key); 5988 }, [trackedProps]); 5989 const currentSubscriptionRef = reactExports.useRef(null); 5990 const updateState = reactExports.useCallback((callback) => { 5991 const prev = resultRef.current; 5992 const next = resultRef.current = callback(prev); 5993 let shouldUpdate = false;
5994 for (const key of trackedProps) if (prev[key] !== next[key]) { 5995 shouldUpdate = true; 5996 break; 5997 } 5998 if (shouldUpdate) setState(trackResult(next, addTrackedProp)); 5999 }, [addTrackedProp, trackedProps]); 6000 const reset = reactExports.useCallback(() => { 6001 var _currentSubscriptionR; 6002 (_currentSubscriptionR = currentSubscriptionRef.current) === null || _currentSubscriptionR === void 0 || _currentSubscriptionR.unsubscribe(); 6003 if (!enabled) { 6004 updateState(() => (0, import_objectSpread2.default)((0, import_objectSpread2.default)({}, initialStateIdle), {}, { reset })); 6005 return; 6006 } 6007 updateState(() => (0, import_objectSpread2.default)((0, import_objectSpread2.default)({}, initialStateConnecting), {}, { reset })); 6008 const subscription = client.subscription(path.join("."), input !== null && input !== void 0 ? input : void 0, { 6009 onStarted: () => { 6010 var _optsRef$current$onSt, _optsRef$current; 6011 (_optsRef$current$onSt = (_optsRef$current = optsRef.current).onStarted) === null || _optsRef$current$onSt === void 0 || _optsRef$current$onSt.call(_optsRef$current); 6012 updateState((prev) => (0, import_objectSpread2.default)((0, import_objectSpread2.default)({}, prev), {}, { 6013 status: "pending", 6014 error: null 6015 })); 6016 }, 6017 onData: (data) => { 6018 var _optsRef$current$onDa, _optsRef$current2; 6019 (_optsRef$current$onDa = (_optsRef$current2 = optsRef.current).onData) === null || _optsRef$current$onDa === void 0 || _optsRef$current$onDa.call(_optsRef$current2, data); 6020 updateState((prev) => (0, import_objectSpread2.default)((0, import_objectSpread2.default)({}, prev), {}, { 6021 status: "pending", 6022 data, 6023 error: null 6024 })); 6025 }, 6026 onError: (error) => { 6027 var _optsRef$current$onEr, _optsRef$current3; 6028 (_optsRef$current$onEr = (_optsRef$current3 = optsRef.current).onError) === null || _optsRef$current$onEr === void 0 || _optsRef$current$onEr.call(_optsRef$current3, error); 6029 updateState((prev) => (0, import_objectSpread2.default)((0, import_objectSpread2.default)({}, prev), {}, { 6030 status: "error", 6031 error 6032 })); 6033 }, 6034 onConnectionStateChange: (result) => { 6035 updateState((prev) => { 6036 switch (result.state) { 6037 case "idle": return (0, import_objectSpread2.default)((0, import_objectSpread2.default)({}, prev), {}, { 6038 status: result.state, 6039 error: null, 6040 data: void 0 6041 }); 6042 case "connecting": return (0, import_objectSpread2.default)((0, import_objectSpread2.default)({}, prev), {}, { 6043 error: result.error, 6044 status: result.state 6045 }); 6046 case "pending": return prev; 6047 } 6048 }); 6049 }, 6050 onComplete: () => { 6051 var _optsRef$current$onCo, _optsRef$current4; 6052 (_optsRef$current$onCo = (_optsRef$current4 = optsRef.current).onComplete) === null || _optsRef$current$onCo === void 0 || _optsRef$current$onCo.call(_optsRef$current4); 6053 updateState((prev) => (0, import_objectSpread2.default)((0, import_objectSpread2.default)({}, prev), {}, { 6054 status: "idle", 6055 error: null, 6056 data: void 0 6057 })); 6058 } 6059 }); 6060 currentSubscriptionRef.current = subscription; 6061 }, [ 6062 client, 6063 queryKey, 6064 enabled, 6065 updateState 6066 ]); 6067 reactExports.useEffect(() => { 6068 reset(); 6069 return () => { 6070 var _currentSubscriptionR2; 6071 (_currentSubscriptionR2 = currentSubscriptionRef.current) === null || _currentSubscriptionR2 === void 0 || _currentSubscriptionR2.unsubscribe(); 6072 }; 6073 }, [reset]); 6074 const resultRef = reactExports.useRef(enabled ? (0, import_objectSpread2.default)((0, import_objectSpread2.default)({}, initialStateConnecting), {}, { reset }) : (0, import_objectSpread2.default)((0, import_objectSpread2.default)({}, initialStateIdle), {}, { reset })); 6075 const [state, setState] = reactExports.useState(trackResult(resultRef.current, addTrackedProp)); 6076 return state; 6077 } 6078 function useInfiniteQuery$1(path, input, opts) { 6079 var _opts$trpc5, _opts$enabled3, _opts$trpc$abortOnUnm4, _opts$trpc6, _opts$initialCursor; 6080 const { client, ssrState, prefetchInfiniteQuery, queryClient, abortOnUnmount } = useContext(); 6081 const queryKey = getQueryKeyInternal(path, input, "infinite");
6082 const defaultOpts = queryClient.getQueryDefaults(queryKey); 6083 const isInputSkipToken = input === skipToken; 6084 if (typeof window === "undefined" && ssrState === "prepass" && (opts === null || opts === void 0 || (_opts$trpc5 = opts.trpc) === null || _opts$trpc5 === void 0 ? void 0 : _opts$trpc5.ssr) !== false && ((_opts$enabled3 = opts === null || opts === void 0 ? void 0 : opts.enabled) !== null && _opts$enabled3 !== void 0 ? _opts$enabled3 : defaultOpts === null || defaultOpts === void 0 ? void 0 : defaultOpts.enabled) !== false && !isInputSkipToken && !queryClient.getQueryCache().find({ queryKey })) prefetchInfiniteQuery(queryKey, (0, import_objectSpread2.default)((0, import_objectSpread2.default)({}, defaultOpts), opts)); 6085 const ssrOpts = useSSRQueryOptionsIfNeeded(queryKey, (0, import_objectSpread2.default)((0, import_objectSpread2.default)({}, defaultOpts), opts)); 6086 const shouldAbortOnUnmount = (_opts$trpc$abortOnUnm4 = opts === null || opts === void 0 || (_opts$trpc6 = opts.trpc) === null || _opts$trpc6 === void 0 ? void 0 : _opts$trpc6.abortOnUnmount) !== null && _opts$trpc$abortOnUnm4 !== void 0 ? _opts$trpc$abortOnUnm4 : abortOnUnmount; 6087 const hook = useInfiniteQuery((0, import_objectSpread2.default)((0, import_objectSpread2.default)({}, ssrOpts), {}, { 6088 initialPageParam: (_opts$initialCursor = opts.initialCursor) !== null && _opts$initialCursor !== void 0 ? _opts$initialCursor : null, 6089 persister: opts.persister, 6090 queryKey, 6091 queryFn: isInputSkipToken ? input : (queryFunctionContext) => { 6092 var _queryFunctionContext; 6093 const actualOpts = (0, import_objectSpread2.default)((0, import_objectSpread2.default)({}, ssrOpts), {}, { trpc: (0, import_objectSpread2.default)((0, import_objectSpread2.default)({}, ssrOpts === null || ssrOpts === void 0 ? void 0 : ssrOpts.trpc), shouldAbortOnUnmount ? { signal: queryFunctionContext.signal } : { signal: null }) }); 6094 return client.query(...getClientArgs(queryKey, actualOpts, { 6095 pageParam: (_queryFunctionContext = queryFunctionContext.pageParam) !== null && _queryFunctionContext !== void 0 ? _queryFunctionContext : opts.initialCursor, 6096 direction: queryFunctionContext.direction 6097 })); 6098 } 6099 }), queryClient); 6100 hook.trpc = useHookResult({ path }); 6101 return hook; 6102 } 6103 function usePrefetchInfiniteQuery$1(path, input, opts) { 6104 var _opts$trpc$abortOnUnm5, _opts$trpc7, _opts$initialCursor2; 6105 const context = useContext(); 6106 const queryKey = getQueryKeyInternal(path, input, "infinite"); 6107 const defaultOpts = context.queryClient.getQueryDefaults(queryKey); 6108 const isInputSkipToken = input === skipToken; 6109 const ssrOpts = useSSRQueryOptionsIfNeeded(queryKey, (0, import_objectSpread2.default)((0, import_objectSpread2.default)({}, defaultOpts), opts)); 6110 const shouldAbortOnUnmount = (_opts$trpc$abortOnUnm5 = opts === null || opts === void 0 || (_opts$trpc7 = opts.trpc) === null || _opts$trpc7 === void 0 ? void 0 : _opts$trpc7.abortOnUnmount) !== null && _opts$trpc$abortOnUnm5 !== void 0 ? _opts$trpc$abortOnUnm5 : context.abortOnUnmount; 6111 usePrefetchInfiniteQuery((0, import_objectSpread2.default)((0, import_objectSpread2.default)({}, opts), {}, { 6112 initialPageParam: (_opts$initialCursor2 = opts.initialCursor) !== null && _opts$initialCursor2 !== void 0 ? _opts$initialCursor2 : null, 6113 queryKey, 6114 queryFn: isInputSkipToken ? input : (queryFunctionContext) => { 6115 var _queryFunctionContext2; 6116 const actualOpts = (0, import_objectSpread2.default)((0, import_objectSpread2.default)({}, ssrOpts), {}, { trpc: (0, import_objectSpread2.default)((0, import_objectSpread2.default)({}, ssrOpts === null || ssrOpts === void 0 ? void 0 : ssrOpts.trpc), shouldAbortOnUnmount ? { signal: queryFunctionContext.signal } : {}) }); 6117 return context.client.query(...getClientArgs(queryKey, actualOpts, { 6118 pageParam: (_queryFunctionContext2 = queryFunctionContext.pageParam) !== null && _queryFunctionContext2 !== void 0 ? _queryFunctionContext2 : opts.initialCursor, 6119 direction: queryFunctionContext.direction 6120 })); 6121 } 6122 })); 6123 } 6124 function useSuspenseInfiniteQuery$1(path, input, opts) { 6125 var _opts$trpc$abortOnUnm6, _opts$trpc8, _opts$initialCursor3; 6126 const context = useContext(); 6127 const queryKey = getQueryKeyInternal(path, input, "infinite");
6128 const defaultOpts = context.queryClient.getQueryDefaults(queryKey); 6129 const ssrOpts = useSSRQueryOptionsIfNeeded(queryKey, (0, import_objectSpread2.default)((0, import_objectSpread2.default)({}, defaultOpts), opts)); 6130 const shouldAbortOnUnmount = (_opts$trpc$abortOnUnm6 = opts === null || opts === void 0 || (_opts$trpc8 = opts.trpc) === null || _opts$trpc8 === void 0 ? void 0 : _opts$trpc8.abortOnUnmount) !== null && _opts$trpc$abortOnUnm6 !== void 0 ? _opts$trpc$abortOnUnm6 : context.abortOnUnmount; 6131 const hook = useSuspenseInfiniteQuery((0, import_objectSpread2.default)((0, import_objectSpread2.default)({}, opts), {}, { 6132 initialPageParam: (_opts$initialCursor3 = opts.initialCursor) !== null && _opts$initialCursor3 !== void 0 ? _opts$initialCursor3 : null, 6133 queryKey, 6134 queryFn: (queryFunctionContext) => { 6135 var _queryFunctionContext3; 6136 const actualOpts = (0, import_objectSpread2.default)((0, import_objectSpread2.default)({}, ssrOpts), {}, { trpc: (0, import_objectSpread2.default)((0, import_objectSpread2.default)({}, ssrOpts === null || ssrOpts === void 0 ? void 0 : ssrOpts.trpc), shouldAbortOnUnmount ? { signal: queryFunctionContext.signal } : {}) }); 6137 return context.client.query(...getClientArgs(queryKey, actualOpts, { 6138 pageParam: (_queryFunctionContext3 = queryFunctionContext.pageParam) !== null && _queryFunctionContext3 !== void 0 ? _queryFunctionContext3 : opts.initialCursor, 6139 direction: queryFunctionContext.direction 6140 })); 6141 } 6142 }), context.queryClient); 6143 hook.trpc = useHookResult({ path }); 6144 return [hook.data, hook]; 6145 } 6146 const useQueries$1 = (queriesCallback, options) => { 6147 const { ssrState, queryClient, prefetchQuery, client } = useContext(); 6148 const proxy = createUseQueries(client); 6149 const queries = queriesCallback(proxy); 6150 if (typeof window === "undefined" && ssrState === "prepass") for (const query of queries) { 6151 var _queryOption$trpc; 6152 const queryOption = query; 6153 if (((_queryOption$trpc = queryOption.trpc) === null || _queryOption$trpc === void 0 ? void 0 : _queryOption$trpc.ssr) !== false && !queryClient.getQueryCache().find({ queryKey: queryOption.queryKey })) prefetchQuery(queryOption.queryKey, queryOption); 6154 } 6155 return useQueries({ 6156 queries: queries.map((query) => (0, import_objectSpread2.default)((0, import_objectSpread2.default)({}, query), {}, { queryKey: query.queryKey })), 6157 combine: options === null || options === void 0 ? void 0 : options.combine 6158 }, queryClient); 6159 }; 6160 const useSuspenseQueries$1 = (queriesCallback) => { 6161 const { queryClient, client } = useContext(); 6162 const proxy = createUseQueries(client); 6163 const queries = queriesCallback(proxy); 6164 const hook = useSuspenseQueries({ queries: queries.map((query) => (0, import_objectSpread2.default)((0, import_objectSpread2.default)({}, query), {}, { 6165 queryFn: query.queryFn, 6166 queryKey: query.queryKey 6167 })) }, queryClient); 6168 return [hook.map((h) => h.data), hook]; 6169 }; 6170 return { 6171 Provider: TRPCProvider, 6172 createClient, 6173 useContext, 6174 useUtils: useContext, 6175 useQuery: useQuery$1, 6176 usePrefetchQuery: usePrefetchQuery$1, 6177 useSuspenseQuery: useSuspenseQuery$1, 6178 useQueries: useQueries$1, 6179 useSuspenseQueries: useSuspenseQueries$1, 6180 useMutation: useMutation$1, 6181 useSubscription, 6182 useInfiniteQuery: useInfiniteQuery$1, 6183 usePrefetchInfiniteQuery: usePrefetchInfiniteQuery$1, 6184 useSuspenseInfiniteQuery: useSuspenseInfiniteQuery$1 6185 }; 6186} 6187 6188//#region src/createTRPCReact.tsx 6189/** 6190* @internal 6191*/ 6192function createHooksInternal(trpc) { 6193 const proxy = createReactDecoration(trpc); 6194 return createFlatProxy((key) => { 6195 if (key === "useContext" || key === "useUtils") return () => { 6196 const context = trpc.useUtils(); 6197 return reactExports.useMemo(() => { 6198 return createReactQueryUtils(context); 6199 }, [context]); 6200 }; 6201 if (trpc.hasOwnProperty(key)) return trpc[key]; 6202 return proxy[key]; 6203 }); 6204} 6205function createTRPCReact(opts) { 6206 const hooks = createRootHooks(); 6207 const proxy = createHooksInternal(hooks); 6208 return proxy; 6209} 6210 6211const trpc = createTRPCReact(); 6212 6213const UNAUTHED_ERR_MSG = "Please login (10001)"; 6214 6215var client = {exports: {}}; 6216 6217var reactDomClient_production = {}; 6218 6219var scheduler = {exports: {}}; 6220 6221var scheduler_production = {}; 6222 6223/** 6224 * @license React 6225 * scheduler.production.js 6226 * 6227 * Copyright (c) Meta Platforms, Inc. and affiliates. 6228 * 6229 * This source code is licensed under the MIT license found in the 6230 * LICENSE file in the root directory of this source tree. 6231 */ 6232 6233var hasRequiredScheduler_production; 6234 6235function requireScheduler_production () { 6236 if (hasRequiredScheduler_production) return scheduler_production; 6237 hasRequiredScheduler_production = 1; 6238 (function (exports) { 6239 function push(heap, node) { 6240 var index = heap.length; 6241 heap.push(node); 6242 a: for (; 0 < index; ) { 6243 var parentIndex = (index - 1) >>> 1, 6244 parent = heap[parentIndex]; 6245 if (0 < compare(parent, node)) 6246 (heap[parentIndex] = node), (heap[index] = parent), (index = parentIndex); 6247 else break a; 6248 } 6249 } 6250 function peek(heap) { 6251 return 0 === heap.length ? null : heap[0]; 6252 } 6253 function pop(heap) { 6254 if (0 === heap.length) return null; 6255 var first = heap[0], 6256 last = heap.pop(); 6257 if (last !== first) { 6258 heap[0] = last; 6259 a: for ( 6260 var index = 0, length = heap.length, halfLength = length >>> 1; 6261 index < halfLength; 6262 6263 ) {
vendor: 5,052 bytes, lines 6264-6406
6264 var leftIndex = 2 * (index + 1) - 1, 6265 left = heap[leftIndex], 6266 rightIndex = leftIndex + 1, 6267 right = heap[rightIndex]; 6268 if (0 > compare(left, last)) 6269 rightIndex < length && 0 > compare(right, left) 6270 ? ((heap[index] = right), 6271 (heap[rightIndex] = last), 6272 (index = rightIndex)) 6273 : ((heap[index] = left), 6274 (heap[leftIndex] = last), 6275 (index = leftIndex)); 6276 else if (rightIndex < length && 0 > compare(right, last)) 6277 (heap[index] = right), (heap[rightIndex] = last), (index = rightIndex); 6278 else break a; 6279 } 6280 } 6281 return first; 6282 } 6283 function compare(a, b) { 6284 var diff = a.sortIndex - b.sortIndex; 6285 return 0 !== diff ? diff : a.id - b.id; 6286 } 6287 exports.unstable_now = void 0; 6288 if ("object" === typeof performance && "function" === typeof performance.now) { 6289 var localPerformance = performance; 6290 exports.unstable_now = function () { 6291 return localPerformance.now(); 6292 }; 6293 } else { 6294 var localDate = Date, 6295 initialTime = localDate.now(); 6296 exports.unstable_now = function () { 6297 return localDate.now() - initialTime; 6298 }; 6299 } 6300 var taskQueue = [], 6301 timerQueue = [], 6302 taskIdCounter = 1, 6303 currentTask = null, 6304 currentPriorityLevel = 3, 6305 isPerformingWork = false, 6306 isHostCallbackScheduled = false, 6307 isHostTimeoutScheduled = false, 6308 needsPaint = false, 6309 localSetTimeout = "function" === typeof setTimeout ? setTimeout : null, 6310 localClearTimeout = "function" === typeof clearTimeout ? clearTimeout : null, 6311 localSetImmediate = "undefined" !== typeof setImmediate ? setImmediate : null; 6312 function advanceTimers(currentTime) { 6313 for (var timer = peek(timerQueue); null !== timer; ) { 6314 if (null === timer.callback) pop(timerQueue); 6315 else if (timer.startTime <= currentTime) 6316 pop(timerQueue), 6317 (timer.sortIndex = timer.expirationTime), 6318 push(taskQueue, timer); 6319 else break; 6320 timer = peek(timerQueue); 6321 } 6322 } 6323 function handleTimeout(currentTime) { 6324 isHostTimeoutScheduled = false; 6325 advanceTimers(currentTime); 6326 if (!isHostCallbackScheduled) 6327 if (null !== peek(taskQueue)) 6328 (isHostCallbackScheduled = true), 6329 isMessageLoopRunning || 6330 ((isMessageLoopRunning = true), schedulePerformWorkUntilDeadline()); 6331 else { 6332 var firstTimer = peek(timerQueue); 6333 null !== firstTimer && 6334 requestHostTimeout(handleTimeout, firstTimer.startTime - currentTime); 6335 } 6336 } 6337 var isMessageLoopRunning = false, 6338 taskTimeoutID = -1, 6339 frameInterval = 5, 6340 startTime = -1; 6341 function shouldYieldToHost() { 6342 return needsPaint 6343 ? true 6344 : exports.unstable_now() - startTime < frameInterval 6345 ? false 6346 : true; 6347 } 6348 function performWorkUntilDeadline() { 6349 needsPaint = false; 6350 if (isMessageLoopRunning) { 6351 var currentTime = exports.unstable_now(); 6352 startTime = currentTime; 6353 var hasMoreWork = true; 6354 try { 6355 a: { 6356 isHostCallbackScheduled = !1; 6357 isHostTimeoutScheduled && 6358 ((isHostTimeoutScheduled = !1), 6359 localClearTimeout(taskTimeoutID), 6360 (taskTimeoutID = -1)); 6361 isPerformingWork = !0; 6362 var previousPriorityLevel = currentPriorityLevel; 6363 try { 6364 b: { 6365 advanceTimers(currentTime); 6366 for ( 6367 currentTask = peek(taskQueue); 6368 null !== currentTask && 6369 !( 6370 currentTask.expirationTime > currentTime && shouldYieldToHost() 6371 ); 6372 6373 ) { 6374 var callback = currentTask.callback; 6375 if ("function" === typeof callback) { 6376 currentTask.callback = null; 6377 currentPriorityLevel = currentTask.priorityLevel; 6378 var continuationCallback = callback( 6379 currentTask.expirationTime <= currentTime 6380 ); 6381 currentTime = exports.unstable_now(); 6382 if ("function" === typeof continuationCallback) { 6383 currentTask.callback = continuationCallback; 6384 advanceTimers(currentTime); 6385 hasMoreWork = !0; 6386 break b; 6387 } 6388 currentTask === peek(taskQueue) && pop(taskQueue); 6389 advanceTimers(currentTime); 6390 } else pop(taskQueue); 6391 currentTask = peek(taskQueue); 6392 } 6393 if (null !== currentTask) hasMoreWork = !0; 6394 else { 6395 var firstTimer = peek(timerQueue); 6396 null !== firstTimer && 6397 requestHostTimeout( 6398 handleTimeout, 6399 firstTimer.startTime - currentTime 6400 ); 6401 hasMoreWork = !1; 6402 } 6403 } 6404 break a; 6405 } finally { 6406 (currentTask = null),
vendor: 8,391 bytes, lines 6407-6690
6407 (currentPriorityLevel = previousPriorityLevel), 6408 (isPerformingWork = !1); 6409 } 6410 hasMoreWork = void 0; 6411 } 6412 } finally { 6413 hasMoreWork 6414 ? schedulePerformWorkUntilDeadline() 6415 : (isMessageLoopRunning = false); 6416 } 6417 } 6418 } 6419 var schedulePerformWorkUntilDeadline; 6420 if ("function" === typeof localSetImmediate) 6421 schedulePerformWorkUntilDeadline = function () { 6422 localSetImmediate(performWorkUntilDeadline); 6423 }; 6424 else if ("undefined" !== typeof MessageChannel) { 6425 var channel = new MessageChannel(), 6426 port = channel.port2; 6427 channel.port1.onmessage = performWorkUntilDeadline; 6428 schedulePerformWorkUntilDeadline = function () { 6429 port.postMessage(null); 6430 }; 6431 } else 6432 schedulePerformWorkUntilDeadline = function () { 6433 localSetTimeout(performWorkUntilDeadline, 0); 6434 }; 6435 function requestHostTimeout(callback, ms) { 6436 taskTimeoutID = localSetTimeout(function () { 6437 callback(exports.unstable_now()); 6438 }, ms); 6439 } 6440 exports.unstable_IdlePriority = 5; 6441 exports.unstable_ImmediatePriority = 1; 6442 exports.unstable_LowPriority = 4; 6443 exports.unstable_NormalPriority = 3; 6444 exports.unstable_Profiling = null; 6445 exports.unstable_UserBlockingPriority = 2; 6446 exports.unstable_cancelCallback = function (task) { 6447 task.callback = null; 6448 }; 6449 exports.unstable_forceFrameRate = function (fps) { 6450 0 > fps || 125 < fps 6451 ? console.error( 6452 "forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported" 6453 ) 6454 : (frameInterval = 0 < fps ? Math.floor(1e3 / fps) : 5); 6455 }; 6456 exports.unstable_getCurrentPriorityLevel = function () { 6457 return currentPriorityLevel; 6458 }; 6459 exports.unstable_next = function (eventHandler) { 6460 switch (currentPriorityLevel) { 6461 case 1: 6462 case 2: 6463 case 3: 6464 var priorityLevel = 3; 6465 break; 6466 default: 6467 priorityLevel = currentPriorityLevel; 6468 } 6469 var previousPriorityLevel = currentPriorityLevel; 6470 currentPriorityLevel = priorityLevel; 6471 try { 6472 return eventHandler(); 6473 } finally { 6474 currentPriorityLevel = previousPriorityLevel; 6475 } 6476 }; 6477 exports.unstable_requestPaint = function () { 6478 needsPaint = true; 6479 }; 6480 exports.unstable_runWithPriority = function (priorityLevel, eventHandler) { 6481 switch (priorityLevel) { 6482 case 1: 6483 case 2: 6484 case 3: 6485 case 4: 6486 case 5: 6487 break; 6488 default: 6489 priorityLevel = 3; 6490 } 6491 var previousPriorityLevel = currentPriorityLevel; 6492 currentPriorityLevel = priorityLevel; 6493 try { 6494 return eventHandler(); 6495 } finally { 6496 currentPriorityLevel = previousPriorityLevel; 6497 } 6498 }; 6499 exports.unstable_scheduleCallback = function ( 6500 priorityLevel, 6501 callback, 6502 options 6503 ) { 6504 var currentTime = exports.unstable_now(); 6505 "object" === typeof options && null !== options 6506 ? ((options = options.delay), 6507 (options = 6508 "number" === typeof options && 0 < options 6509 ? currentTime + options 6510 : currentTime)) 6511 : (options = currentTime); 6512 switch (priorityLevel) { 6513 case 1: 6514 var timeout = -1; 6515 break; 6516 case 2: 6517 timeout = 250; 6518 break; 6519 case 5: 6520 timeout = 1073741823; 6521 break; 6522 case 4: 6523 timeout = 1e4; 6524 break; 6525 default: 6526 timeout = 5e3; 6527 } 6528 timeout = options + timeout; 6529 priorityLevel = { 6530 id: taskIdCounter++, 6531 callback: callback, 6532 priorityLevel: priorityLevel, 6533 startTime: options, 6534 expirationTime: timeout, 6535 sortIndex: -1 6536 }; 6537 options > currentTime 6538 ? ((priorityLevel.sortIndex = options), 6539 push(timerQueue, priorityLevel), 6540 null === peek(taskQueue) && 6541 priorityLevel === peek(timerQueue) && 6542 (isHostTimeoutScheduled 6543 ? (localClearTimeout(taskTimeoutID), (taskTimeoutID = -1)) 6544 : (isHostTimeoutScheduled = true), 6545 requestHostTimeout(handleTimeout, options - currentTime))) 6546 : ((priorityLevel.sortIndex = timeout), 6547 push(taskQueue, priorityLevel), 6548 isHostCallbackScheduled || 6549 isPerformingWork || 6550 ((isHostCallbackScheduled = true), 6551 isMessageLoopRunning || 6552 ((isMessageLoopRunning = true), schedulePerformWorkUntilDeadline()))); 6553 return priorityLevel; 6554 }; 6555 exports.unstable_shouldYield = shouldYieldToHost; 6556 exports.unstable_wrapCallback = function (callback) { 6557 var parentPriorityLevel = currentPriorityLevel; 6558 return function () { 6559 var previousPriorityLevel = currentPriorityLevel; 6560 currentPriorityLevel = parentPriorityLevel; 6561 try { 6562 return callback.apply(this, arguments); 6563 } finally { 6564 currentPriorityLevel = previousPriorityLevel; 6565 } 6566 }; 6567 }; 6568 } (scheduler_production)); 6569 return scheduler_production; 6570} 6571 6572var hasRequiredScheduler; 6573 6574function requireScheduler () { 6575 if (hasRequiredScheduler) return scheduler.exports; 6576 hasRequiredScheduler = 1; 6577 { 6578 scheduler.exports = requireScheduler_production(); 6579 } 6580 return scheduler.exports; 6581} 6582 6583var reactDom = {exports: {}}; 6584 6585var reactDom_production = {}; 6586 6587/** 6588 * @license React 6589 * react-dom.production.js 6590 * 6591 * Copyright (c) Meta Platforms, Inc. and affiliates. 6592 * 6593 * This source code is licensed under the MIT license found in the 6594 * LICENSE file in the root directory of this source tree. 6595 */ 6596 6597var hasRequiredReactDom_production; 6598 6599function requireReactDom_production () { 6600 if (hasRequiredReactDom_production) return reactDom_production; 6601 hasRequiredReactDom_production = 1; 6602 var React = requireReact(); 6603 function formatProdErrorMessage(code) { 6604 var url = "https://react.dev/errors/" + code; 6605 if (1 < arguments.length) { 6606 url += "?args[]=" + encodeURIComponent(arguments[1]); 6607 for (var i = 2; i < arguments.length; i++) 6608 url += "&args[]=" + encodeURIComponent(arguments[i]); 6609 } 6610 return ( 6611 "Minified React error #" + 6612 code + 6613 "; visit " + 6614 url + 6615 " for the full message or use the non-minified dev environment for full errors and additional helpful warnings." 6616 ); 6617 } 6618 function noop() {} 6619 var Internals = { 6620 d: { 6621 f: noop, 6622 r: function () { 6623 throw Error(formatProdErrorMessage(522)); 6624 }, 6625 D: noop, 6626 C: noop, 6627 L: noop, 6628 m: noop, 6629 X: noop, 6630 S: noop, 6631 M: noop 6632 }, 6633 p: 0, 6634 findDOMNode: null 6635 }, 6636 REACT_PORTAL_TYPE = Symbol.for("react.portal"); 6637 function createPortal$1(children, containerInfo, implementation) { 6638 var key = 6639 3 < arguments.length && void 0 !== arguments[3] ? arguments[3] : null; 6640 return { 6641 $$typeof: REACT_PORTAL_TYPE, 6642 key: null == key ? null : "" + key, 6643 children: children, 6644 containerInfo: containerInfo, 6645 implementation: implementation 6646 }; 6647 } 6648 var ReactSharedInternals = 6649 React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE; 6650 function getCrossOriginStringAs(as, input) { 6651 if ("font" === as) return ""; 6652 if ("string" === typeof input) 6653 return "use-credentials" === input ? input : ""; 6654 } 6655 reactDom_production.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = 6656 Internals; 6657 reactDom_production.createPortal = function (children, container) { 6658 var key = 6659 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : null; 6660 if ( 6661 !container || 6662 (1 !== container.nodeType && 6663 9 !== container.nodeType && 6664 11 !== container.nodeType) 6665 ) 6666 throw Error(formatProdErrorMessage(299)); 6667 return createPortal$1(children, container, null, key); 6668 }; 6669 reactDom_production.flushSync = function (fn) { 6670 var previousTransition = ReactSharedInternals.T, 6671 previousUpdatePriority = Internals.p; 6672 try { 6673 if (((ReactSharedInternals.T = null), (Internals.p = 2), fn)) return fn(); 6674 } finally { 6675 (ReactSharedInternals.T = previousTransition), 6676 (Internals.p = previousUpdatePriority), 6677 Internals.d.f(); 6678 } 6679 }; 6680 reactDom_production.preconnect = function (href, options) { 6681 "string" === typeof href && 6682 (options 6683 ? ((options = options.crossOrigin), 6684 (options = 6685 "string" === typeof options 6686 ? "use-credentials" === options 6687 ? options 6688 : "" 6689 : void 0)) 6690 : (options = null),
vendor: 4,475 bytes, lines 6691-6819
6691 Internals.d.C(href, options)); 6692 }; 6693 reactDom_production.prefetchDNS = function (href) { 6694 "string" === typeof href && Internals.d.D(href); 6695 }; 6696 reactDom_production.preinit = function (href, options) { 6697 if ("string" === typeof href && options && "string" === typeof options.as) { 6698 var as = options.as, 6699 crossOrigin = getCrossOriginStringAs(as, options.crossOrigin), 6700 integrity = 6701 "string" === typeof options.integrity ? options.integrity : void 0, 6702 fetchPriority = 6703 "string" === typeof options.fetchPriority 6704 ? options.fetchPriority 6705 : void 0; 6706 "style" === as 6707 ? Internals.d.S( 6708 href, 6709 "string" === typeof options.precedence ? options.precedence : void 0, 6710 { 6711 crossOrigin: crossOrigin, 6712 integrity: integrity, 6713 fetchPriority: fetchPriority 6714 } 6715 ) 6716 : "script" === as && 6717 Internals.d.X(href, { 6718 crossOrigin: crossOrigin, 6719 integrity: integrity, 6720 fetchPriority: fetchPriority, 6721 nonce: "string" === typeof options.nonce ? options.nonce : void 0 6722 }); 6723 } 6724 }; 6725 reactDom_production.preinitModule = function (href, options) { 6726 if ("string" === typeof href) 6727 if ("object" === typeof options && null !== options) { 6728 if (null == options.as || "script" === options.as) { 6729 var crossOrigin = getCrossOriginStringAs( 6730 options.as, 6731 options.crossOrigin 6732 ); 6733 Internals.d.M(href, { 6734 crossOrigin: crossOrigin, 6735 integrity: 6736 "string" === typeof options.integrity ? options.integrity : void 0, 6737 nonce: "string" === typeof options.nonce ? options.nonce : void 0 6738 }); 6739 } 6740 } else null == options && Internals.d.M(href); 6741 }; 6742 reactDom_production.preload = function (href, options) { 6743 if ( 6744 "string" === typeof href && 6745 "object" === typeof options && 6746 null !== options && 6747 "string" === typeof options.as 6748 ) { 6749 var as = options.as, 6750 crossOrigin = getCrossOriginStringAs(as, options.crossOrigin); 6751 Internals.d.L(href, as, { 6752 crossOrigin: crossOrigin, 6753 integrity: 6754 "string" === typeof options.integrity ? options.integrity : void 0, 6755 nonce: "string" === typeof options.nonce ? options.nonce : void 0, 6756 type: "string" === typeof options.type ? options.type : void 0, 6757 fetchPriority: 6758 "string" === typeof options.fetchPriority 6759 ? options.fetchPriority 6760 : void 0, 6761 referrerPolicy: 6762 "string" === typeof options.referrerPolicy 6763 ? options.referrerPolicy 6764 : void 0, 6765 imageSrcSet: 6766 "string" === typeof options.imageSrcSet ? options.imageSrcSet : void 0, 6767 imageSizes: 6768 "string" === typeof options.imageSizes ? options.imageSizes : void 0, 6769 media: "string" === typeof options.media ? options.media : void 0 6770 }); 6771 } 6772 }; 6773 reactDom_production.preloadModule = function (href, options) { 6774 if ("string" === typeof href) 6775 if (options) { 6776 var crossOrigin = getCrossOriginStringAs(options.as, options.crossOrigin); 6777 Internals.d.m(href, { 6778 as: 6779 "string" === typeof options.as && "script" !== options.as 6780 ? options.as 6781 : void 0, 6782 crossOrigin: crossOrigin, 6783 integrity: 6784 "string" === typeof options.integrity ? options.integrity : void 0 6785 }); 6786 } else Internals.d.m(href); 6787 }; 6788 reactDom_production.requestFormReset = function (form) { 6789 Internals.d.r(form); 6790 }; 6791 reactDom_production.unstable_batchedUpdates = function (fn, a) { 6792 return fn(a); 6793 }; 6794 reactDom_production.useFormState = function (action, initialState, permalink) { 6795 return ReactSharedInternals.H.useFormState(action, initialState, permalink); 6796 }; 6797 reactDom_production.useFormStatus = function () { 6798 return ReactSharedInternals.H.useHostTransitionStatus(); 6799 }; 6800 reactDom_production.version = "19.2.1"; 6801 return reactDom_production; 6802} 6803 6804var hasRequiredReactDom; 6805 6806function requireReactDom () { 6807 if (hasRequiredReactDom) return reactDom.exports; 6808 hasRequiredReactDom = 1; 6809 function checkDCE() { 6810 if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === "undefined" || typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE !== "function") { 6811 return; 6812 } 6813 try { 6814 __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(checkDCE); 6815 } catch (err) { 6816 console.error(err); 6817 } 6818 } 6819 {
vendor: 51,560 bytes, lines 6819-8388
6819 6820 checkDCE(); 6821 reactDom.exports = requireReactDom_production(); 6822 } 6823 return reactDom.exports; 6824} 6825 6826/** 6827 * @license React 6828 * react-dom-client.production.js 6829 * 6830 * Copyright (c) Meta Platforms, Inc. and affiliates. 6831 * 6832 * This source code is licensed under the MIT license found in the 6833 * LICENSE file in the root directory of this source tree. 6834 */ 6835 6836var hasRequiredReactDomClient_production; 6837 6838function requireReactDomClient_production () { 6839 if (hasRequiredReactDomClient_production) return reactDomClient_production; 6840 hasRequiredReactDomClient_production = 1; 6841 var Scheduler = requireScheduler(), 6842 React = requireReact(), 6843 ReactDOM = requireReactDom(); 6844 function formatProdErrorMessage(code) { 6845 var url = "https://react.dev/errors/" + code; 6846 if (1 < arguments.length) { 6847 url += "?args[]=" + encodeURIComponent(arguments[1]); 6848 for (var i = 2; i < arguments.length; i++) 6849 url += "&args[]=" + encodeURIComponent(arguments[i]); 6850 } 6851 return ( 6852 "Minified React error #" + 6853 code + 6854 "; visit " + 6855 url + 6856 " for the full message or use the non-minified dev environment for full errors and additional helpful warnings." 6857 ); 6858 } 6859 function isValidContainer(node) { 6860 return !( 6861 !node || 6862 (1 !== node.nodeType && 9 !== node.nodeType && 11 !== node.nodeType) 6863 ); 6864 } 6865 function getNearestMountedFiber(fiber) { 6866 var node = fiber, 6867 nearestMounted = fiber; 6868 if (fiber.alternate) for (; node.return; ) node = node.return; 6869 else { 6870 fiber = node; 6871 do 6872 (node = fiber), 6873 0 !== (node.flags & 4098) && (nearestMounted = node.return), 6874 (fiber = node.return); 6875 while (fiber); 6876 } 6877 return 3 === node.tag ? nearestMounted : null; 6878 } 6879 function getSuspenseInstanceFromFiber(fiber) { 6880 if (13 === fiber.tag) { 6881 var suspenseState = fiber.memoizedState; 6882 null === suspenseState && 6883 ((fiber = fiber.alternate), 6884 null !== fiber && (suspenseState = fiber.memoizedState)); 6885 if (null !== suspenseState) return suspenseState.dehydrated; 6886 } 6887 return null; 6888 } 6889 function getActivityInstanceFromFiber(fiber) { 6890 if (31 === fiber.tag) { 6891 var activityState = fiber.memoizedState; 6892 null === activityState && 6893 ((fiber = fiber.alternate), 6894 null !== fiber && (activityState = fiber.memoizedState)); 6895 if (null !== activityState) return activityState.dehydrated; 6896 } 6897 return null; 6898 } 6899 function assertIsMounted(fiber) { 6900 if (getNearestMountedFiber(fiber) !== fiber) 6901 throw Error(formatProdErrorMessage(188)); 6902 } 6903 function findCurrentFiberUsingSlowPath(fiber) { 6904 var alternate = fiber.alternate; 6905 if (!alternate) { 6906 alternate = getNearestMountedFiber(fiber); 6907 if (null === alternate) throw Error(formatProdErrorMessage(188)); 6908 return alternate !== fiber ? null : fiber; 6909 } 6910 for (var a = fiber, b = alternate; ; ) { 6911 var parentA = a.return; 6912 if (null === parentA) break; 6913 var parentB = parentA.alternate; 6914 if (null === parentB) { 6915 b = parentA.return; 6916 if (null !== b) { 6917 a = b; 6918 continue; 6919 } 6920 break; 6921 } 6922 if (parentA.child === parentB.child) { 6923 for (parentB = parentA.child; parentB; ) { 6924 if (parentB === a) return assertIsMounted(parentA), fiber; 6925 if (parentB === b) return assertIsMounted(parentA), alternate; 6926 parentB = parentB.sibling; 6927 } 6928 throw Error(formatProdErrorMessage(188)); 6929 } 6930 if (a.return !== b.return) (a = parentA), (b = parentB); 6931 else { 6932 for (var didFindChild = false, child$0 = parentA.child; child$0; ) { 6933 if (child$0 === a) { 6934 didFindChild = true; 6935 a = parentA; 6936 b = parentB; 6937 break; 6938 } 6939 if (child$0 === b) { 6940 didFindChild = true; 6941 b = parentA; 6942 a = parentB; 6943 break; 6944 } 6945 child$0 = child$0.sibling; 6946 } 6947 if (!didFindChild) { 6948 for (child$0 = parentB.child; child$0; ) { 6949 if (child$0 === a) { 6950 didFindChild = true; 6951 a = parentB; 6952 b = parentA; 6953 break; 6954 } 6955 if (child$0 === b) { 6956 didFindChild = true; 6957 b = parentB; 6958 a = parentA; 6959 break; 6960 } 6961 child$0 = child$0.sibling; 6962 } 6963 if (!didFindChild) throw Error(formatProdErrorMessage(189)); 6964 } 6965 } 6966 if (a.alternate !== b) throw Error(formatProdErrorMessage(190)); 6967 } 6968 if (3 !== a.tag) throw Error(formatProdErrorMessage(188)); 6969 return a.stateNode.current === a ? fiber : alternate; 6970 } 6971 function findCurrentHostFiberImpl(node) { 6972 var tag = node.tag; 6973 if (5 === tag || 26 === tag || 27 === tag || 6 === tag) return node; 6974 for (node = node.child; null !== node; ) { 6975 tag = findCurrentHostFiberImpl(node); 6976 if (null !== tag) return tag; 6977 node = node.sibling; 6978 } 6979 return null; 6980 } 6981 var assign = Object.assign, 6982 REACT_LEGACY_ELEMENT_TYPE = Symbol.for("react.element"), 6983 REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"), 6984 REACT_PORTAL_TYPE = Symbol.for("react.portal"), 6985 REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), 6986 REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"), 6987 REACT_PROFILER_TYPE = Symbol.for("react.profiler"), 6988 REACT_CONSUMER_TYPE = Symbol.for("react.consumer"), 6989 REACT_CONTEXT_TYPE = Symbol.for("react.context"), 6990 REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"), 6991 REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"), 6992 REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"), 6993 REACT_MEMO_TYPE = Symbol.for("react.memo"), 6994 REACT_LAZY_TYPE = Symbol.for("react.lazy"); 6995 var REACT_ACTIVITY_TYPE = Symbol.for("react.activity"); 6996 var REACT_MEMO_CACHE_SENTINEL = Symbol.for("react.memo_cache_sentinel"); 6997 var MAYBE_ITERATOR_SYMBOL = Symbol.iterator; 6998 function getIteratorFn(maybeIterable) { 6999 if (null === maybeIterable || "object" !== typeof maybeIterable) return null; 7000 maybeIterable = 7001 (MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL]) || 7002 maybeIterable["@@iterator"]; 7003 return "function" === typeof maybeIterable ? maybeIterable : null; 7004 } 7005 var REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"); 7006 function getComponentNameFromType(type) { 7007 if (null == type) return null; 7008 if ("function" === typeof type) 7009 return type.$$typeof === REACT_CLIENT_REFERENCE 7010 ? null 7011 : type.displayName || type.name || null; 7012 if ("string" === typeof type) return type; 7013 switch (type) { 7014 case REACT_FRAGMENT_TYPE: 7015 return "Fragment"; 7016 case REACT_PROFILER_TYPE: 7017 return "Profiler"; 7018 case REACT_STRICT_MODE_TYPE: 7019 return "StrictMode"; 7020 case REACT_SUSPENSE_TYPE: 7021 return "Suspense"; 7022 case REACT_SUSPENSE_LIST_TYPE: 7023 return "SuspenseList"; 7024 case REACT_ACTIVITY_TYPE: 7025 return "Activity"; 7026 } 7027 if ("object" === typeof type) 7028 switch (type.$$typeof) { 7029 case REACT_PORTAL_TYPE: 7030 return "Portal"; 7031 case REACT_CONTEXT_TYPE: 7032 return type.displayName || "Context"; 7033 case REACT_CONSUMER_TYPE: 7034 return (type._context.displayName || "Context") + ".Consumer"; 7035 case REACT_FORWARD_REF_TYPE: 7036 var innerType = type.render; 7037 type = type.displayName; 7038 type || 7039 ((type = innerType.displayName || innerType.name || ""), 7040 (type = "" !== type ? "ForwardRef(" + type + ")" : "ForwardRef")); 7041 return type; 7042 case REACT_MEMO_TYPE: 7043 return ( 7044 (innerType = type.displayName || null), 7045 null !== innerType 7046 ? innerType 7047 : getComponentNameFromType(type.type) || "Memo" 7048 ); 7049 case REACT_LAZY_TYPE: 7050 innerType = type._payload; 7051 type = type._init; 7052 try { 7053 return getComponentNameFromType(type(innerType)); 7054 } catch (x) {} 7055 } 7056 return null; 7057 } 7058 var isArrayImpl = Array.isArray, 7059 ReactSharedInternals = 7060 React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, 7061 ReactDOMSharedInternals = 7062 ReactDOM.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, 7063 sharedNotPendingObject = { 7064 pending: false, 7065 data: null, 7066 method: null, 7067 action: null 7068 }, 7069 valueStack = [], 7070 index = -1; 7071 function createCursor(defaultValue) { 7072 return { current: defaultValue }; 7073 } 7074 function pop(cursor) { 7075 0 > index || 7076 ((cursor.current = valueStack[index]), (valueStack[index] = null), index--); 7077 } 7078 function push(cursor, value) { 7079 index++; 7080 valueStack[index] = cursor.current; 7081 cursor.current = value; 7082 } 7083 var contextStackCursor = createCursor(null), 7084 contextFiberStackCursor = createCursor(null), 7085 rootInstanceStackCursor = createCursor(null), 7086 hostTransitionProviderCursor = createCursor(null); 7087 function pushHostContainer(fiber, nextRootInstance) { 7088 push(rootInstanceStackCursor, nextRootInstance); 7089 push(contextFiberStackCursor, fiber); 7090 push(contextStackCursor, null); 7091 switch (nextRootInstance.nodeType) { 7092 case 9: 7093 case 11: 7094 fiber = (fiber = nextRootInstance.documentElement) 7095 ? (fiber = fiber.namespaceURI) 7096 ? getOwnHostContext(fiber) 7097 : 0 7098 : 0; 7099 break; 7100 default: 7101 if ( 7102 ((fiber = nextRootInstance.tagName), 7103 (nextRootInstance = nextRootInstance.namespaceURI)) 7104 ) 7105 (nextRootInstance = getOwnHostContext(nextRootInstance)), 7106 (fiber = getChildHostContextProd(nextRootInstance, fiber)); 7107 else 7108 switch (fiber) { 7109 case "svg": 7110 fiber = 1; 7111 break; 7112 case "math": 7113 fiber = 2; 7114 break; 7115 default: 7116 fiber = 0; 7117 } 7118 } 7119 pop(contextStackCursor); 7120 push(contextStackCursor, fiber); 7121 } 7122 function popHostContainer() { 7123 pop(contextStackCursor); 7124 pop(contextFiberStackCursor); 7125 pop(rootInstanceStackCursor); 7126 } 7127 function pushHostContext(fiber) { 7128 null !== fiber.memoizedState && push(hostTransitionProviderCursor, fiber); 7129 var context = contextStackCursor.current; 7130 var JSCompiler_inline_result = getChildHostContextProd(context, fiber.type); 7131 context !== JSCompiler_inline_result && 7132 (push(contextFiberStackCursor, fiber), 7133 push(contextStackCursor, JSCompiler_inline_result)); 7134 } 7135 function popHostContext(fiber) { 7136 contextFiberStackCursor.current === fiber && 7137 (pop(contextStackCursor), pop(contextFiberStackCursor)); 7138 hostTransitionProviderCursor.current === fiber && 7139 (pop(hostTransitionProviderCursor), 7140 (HostTransitionContext._currentValue = sharedNotPendingObject)); 7141 } 7142 var prefix, suffix; 7143 function describeBuiltInComponentFrame(name) { 7144 if (void 0 === prefix) 7145 try { 7146 throw Error(); 7147 } catch (x) { 7148 var match = x.stack.trim().match(/\n( *(at )?)/); 7149 prefix = (match && match[1]) || ""; 7150 suffix = 7151 -1 < x.stack.indexOf("\n at") 7152 ? " (<anonymous>)" 7153 : -1 < x.stack.indexOf("@") 7154 ? "@unknown:0:0" 7155 : ""; 7156 } 7157 return "\n" + prefix + name + suffix; 7158 } 7159 var reentry = false; 7160 function describeNativeComponentFrame(fn, construct) { 7161 if (!fn || reentry) return ""; 7162 reentry = true; 7163 var previousPrepareStackTrace = Error.prepareStackTrace; 7164 Error.prepareStackTrace = void 0; 7165 try { 7166 var RunInRootFrame = { 7167 DetermineComponentFrameRoot: function () { 7168 try { 7169 if (construct) { 7170 var Fake = function () { 7171 throw Error(); 7172 }; 7173 Object.defineProperty(Fake.prototype, "props", { 7174 set: function () { 7175 throw Error(); 7176 } 7177 }); 7178 if ("object" === typeof Reflect && Reflect.construct) { 7179 try { 7180 Reflect.construct(Fake, []); 7181 } catch (x) { 7182 var control = x; 7183 } 7184 Reflect.construct(fn, [], Fake); 7185 } else { 7186 try { 7187 Fake.call(); 7188 } catch (x$1) { 7189 control = x$1; 7190 } 7191 fn.call(Fake.prototype); 7192 } 7193 } else { 7194 try { 7195 throw Error(); 7196 } catch (x$2) { 7197 control = x$2; 7198 } 7199 (Fake = fn()) && 7200 "function" === typeof Fake.catch && 7201 Fake.catch(function () {}); 7202 } 7203 } catch (sample) { 7204 if (sample && control && "string" === typeof sample.stack) 7205 return [sample.stack, control.stack]; 7206 } 7207 return [null, null]; 7208 } 7209 }; 7210 RunInRootFrame.DetermineComponentFrameRoot.displayName = 7211 "DetermineComponentFrameRoot"; 7212 var namePropDescriptor = Object.getOwnPropertyDescriptor( 7213 RunInRootFrame.DetermineComponentFrameRoot, 7214 "name" 7215 ); 7216 namePropDescriptor && 7217 namePropDescriptor.configurable && 7218 Object.defineProperty( 7219 RunInRootFrame.DetermineComponentFrameRoot, 7220 "name", 7221 { value: "DetermineComponentFrameRoot" } 7222 ); 7223 var _RunInRootFrame$Deter = RunInRootFrame.DetermineComponentFrameRoot(), 7224 sampleStack = _RunInRootFrame$Deter[0], 7225 controlStack = _RunInRootFrame$Deter[1]; 7226 if (sampleStack && controlStack) { 7227 var sampleLines = sampleStack.split("\n"), 7228 controlLines = controlStack.split("\n"); 7229 for ( 7230 namePropDescriptor = RunInRootFrame = 0; 7231 RunInRootFrame < sampleLines.length && 7232 !sampleLines[RunInRootFrame].includes("DetermineComponentFrameRoot"); 7233 7234 ) 7235 RunInRootFrame++; 7236 for ( 7237 ; 7238 namePropDescriptor < controlLines.length && 7239 !controlLines[namePropDescriptor].includes( 7240 "DetermineComponentFrameRoot" 7241 ); 7242 7243 ) 7244 namePropDescriptor++; 7245 if ( 7246 RunInRootFrame === sampleLines.length || 7247 namePropDescriptor === controlLines.length 7248 ) 7249 for ( 7250 RunInRootFrame = sampleLines.length - 1, 7251 namePropDescriptor = controlLines.length - 1; 7252 1 <= RunInRootFrame && 7253 0 <= namePropDescriptor && 7254 sampleLines[RunInRootFrame] !== controlLines[namePropDescriptor]; 7255 7256 ) 7257 namePropDescriptor--; 7258 for ( 7259 ; 7260 1 <= RunInRootFrame && 0 <= namePropDescriptor; 7261 RunInRootFrame--, namePropDescriptor-- 7262 ) 7263 if (sampleLines[RunInRootFrame] !== controlLines[namePropDescriptor]) { 7264 if (1 !== RunInRootFrame || 1 !== namePropDescriptor) { 7265 do 7266 if ( 7267 (RunInRootFrame--, 7268 namePropDescriptor--, 7269 0 > namePropDescriptor || 7270 sampleLines[RunInRootFrame] !== 7271 controlLines[namePropDescriptor]) 7272 ) { 7273 var frame = 7274 "\n" + 7275 sampleLines[RunInRootFrame].replace(" at new ", " at "); 7276 fn.displayName && 7277 frame.includes("<anonymous>") && 7278 (frame = frame.replace("<anonymous>", fn.displayName)); 7279 return frame; 7280 } 7281 while (1 <= RunInRootFrame && 0 <= namePropDescriptor); 7282 } 7283 break; 7284 } 7285 } 7286 } finally { 7287 (reentry = false), (Error.prepareStackTrace = previousPrepareStackTrace); 7288 } 7289 return (previousPrepareStackTrace = fn ? fn.displayName || fn.name : "") 7290 ? describeBuiltInComponentFrame(previousPrepareStackTrace) 7291 : ""; 7292 } 7293 function describeFiber(fiber, childFiber) { 7294 switch (fiber.tag) { 7295 case 26: 7296 case 27: 7297 case 5: 7298 return describeBuiltInComponentFrame(fiber.type); 7299 case 16: 7300 return describeBuiltInComponentFrame("Lazy"); 7301 case 13: 7302 return fiber.child !== childFiber && null !== childFiber 7303 ? describeBuiltInComponentFrame("Suspense Fallback") 7304 : describeBuiltInComponentFrame("Suspense"); 7305 case 19: 7306 return describeBuiltInComponentFrame("SuspenseList"); 7307 case 0: 7308 case 15: 7309 return describeNativeComponentFrame(fiber.type, false); 7310 case 11: 7311 return describeNativeComponentFrame(fiber.type.render, false); 7312 case 1: 7313 return describeNativeComponentFrame(fiber.type, true); 7314 case 31: 7315 return describeBuiltInComponentFrame("Activity"); 7316 default: 7317 return ""; 7318 } 7319 } 7320 function getStackByFiberInDevAndProd(workInProgress) { 7321 try { 7322 var info = "", 7323 previous = null; 7324 do 7325 (info += describeFiber(workInProgress, previous)), 7326 (previous = workInProgress), 7327 (workInProgress = workInProgress.return); 7328 while (workInProgress); 7329 return info; 7330 } catch (x) { 7331 return "\nError generating stack: " + x.message + "\n" + x.stack; 7332 } 7333 } 7334 var hasOwnProperty = Object.prototype.hasOwnProperty, 7335 scheduleCallback$3 = Scheduler.unstable_scheduleCallback, 7336 cancelCallback$1 = Scheduler.unstable_cancelCallback, 7337 shouldYield = Scheduler.unstable_shouldYield, 7338 requestPaint = Scheduler.unstable_requestPaint, 7339 now = Scheduler.unstable_now, 7340 getCurrentPriorityLevel = Scheduler.unstable_getCurrentPriorityLevel, 7341 ImmediatePriority = Scheduler.unstable_ImmediatePriority, 7342 UserBlockingPriority = Scheduler.unstable_UserBlockingPriority, 7343 NormalPriority$1 = Scheduler.unstable_NormalPriority, 7344 LowPriority = Scheduler.unstable_LowPriority, 7345 IdlePriority = Scheduler.unstable_IdlePriority, 7346 log$1 = Scheduler.log, 7347 unstable_setDisableYieldValue = Scheduler.unstable_setDisableYieldValue, 7348 rendererID = null, 7349 injectedHook = null; 7350 function setIsStrictModeForDevtools(newIsStrictMode) { 7351 "function" === typeof log$1 && unstable_setDisableYieldValue(newIsStrictMode); 7352 if (injectedHook && "function" === typeof injectedHook.setStrictMode) 7353 try { 7354 injectedHook.setStrictMode(rendererID, newIsStrictMode); 7355 } catch (err) {} 7356 } 7357 var clz32 = Math.clz32 ? Math.clz32 : clz32Fallback, 7358 log = Math.log, 7359 LN2 = Math.LN2; 7360 function clz32Fallback(x) { 7361 x >>>= 0; 7362 return 0 === x ? 32 : (31 - ((log(x) / LN2) | 0)) | 0; 7363 } 7364 var nextTransitionUpdateLane = 256, 7365 nextTransitionDeferredLane = 262144, 7366 nextRetryLane = 4194304; 7367 function getHighestPriorityLanes(lanes) { 7368 var pendingSyncLanes = lanes & 42; 7369 if (0 !== pendingSyncLanes) return pendingSyncLanes; 7370 switch (lanes & -lanes) { 7371 case 1: 7372 return 1; 7373 case 2: 7374 return 2; 7375 case 4: 7376 return 4; 7377 case 8: 7378 return 8; 7379 case 16: 7380 return 16; 7381 case 32: 7382 return 32; 7383 case 64: 7384 return 64; 7385 case 128: 7386 return 128; 7387 case 256: 7388 case 512: 7389 case 1024: 7390 case 2048: 7391 case 4096: 7392 case 8192: 7393 case 16384: 7394 case 32768: 7395 case 65536: 7396 case 131072: 7397 return lanes & 261888; 7398 case 262144: 7399 case 524288: 7400 case 1048576: 7401 case 2097152: 7402 return lanes & 3932160; 7403 case 4194304: 7404 case 8388608: 7405 case 16777216: 7406 case 33554432: 7407 return lanes & 62914560; 7408 case 67108864: 7409 return 67108864; 7410 case 134217728: 7411 return 134217728; 7412 case 268435456: 7413 return 268435456; 7414 case 536870912: 7415 return 536870912; 7416 case 1073741824: 7417 return 0; 7418 default: 7419 return lanes; 7420 } 7421 } 7422 function getNextLanes(root, wipLanes, rootHasPendingCommit) { 7423 var pendingLanes = root.pendingLanes; 7424 if (0 === pendingLanes) return 0; 7425 var nextLanes = 0, 7426 suspendedLanes = root.suspendedLanes, 7427 pingedLanes = root.pingedLanes; 7428 root = root.warmLanes; 7429 var nonIdlePendingLanes = pendingLanes & 134217727; 7430 0 !== nonIdlePendingLanes 7431 ? ((pendingLanes = nonIdlePendingLanes & ~suspendedLanes), 7432 0 !== pendingLanes 7433 ? (nextLanes = getHighestPriorityLanes(pendingLanes)) 7434 : ((pingedLanes &= nonIdlePendingLanes), 7435 0 !== pingedLanes 7436 ? (nextLanes = getHighestPriorityLanes(pingedLanes)) 7437 : rootHasPendingCommit || 7438 ((rootHasPendingCommit = nonIdlePendingLanes & ~root), 7439 0 !== rootHasPendingCommit && 7440 (nextLanes = getHighestPriorityLanes(rootHasPendingCommit))))) 7441 : ((nonIdlePendingLanes = pendingLanes & ~suspendedLanes), 7442 0 !== nonIdlePendingLanes 7443 ? (nextLanes = getHighestPriorityLanes(nonIdlePendingLanes)) 7444 : 0 !== pingedLanes 7445 ? (nextLanes = getHighestPriorityLanes(pingedLanes)) 7446 : rootHasPendingCommit || 7447 ((rootHasPendingCommit = pendingLanes & ~root), 7448 0 !== rootHasPendingCommit && 7449 (nextLanes = getHighestPriorityLanes(rootHasPendingCommit)))); 7450 return 0 === nextLanes 7451 ? 0 7452 : 0 !== wipLanes && 7453 wipLanes !== nextLanes && 7454 0 === (wipLanes & suspendedLanes) && 7455 ((suspendedLanes = nextLanes & -nextLanes), 7456 (rootHasPendingCommit = wipLanes & -wipLanes), 7457 suspendedLanes >= rootHasPendingCommit || 7458 (32 === suspendedLanes && 0 !== (rootHasPendingCommit & 4194048))) 7459 ? wipLanes 7460 : nextLanes; 7461 } 7462 function checkIfRootIsPrerendering(root, renderLanes) { 7463 return ( 7464 0 === 7465 (root.pendingLanes & 7466 ~(root.suspendedLanes & ~root.pingedLanes) & 7467 renderLanes) 7468 ); 7469 } 7470 function computeExpirationTime(lane, currentTime) { 7471 switch (lane) { 7472 case 1: 7473 case 2: 7474 case 4: 7475 case 8: 7476 case 64: 7477 return currentTime + 250; 7478 case 16: 7479 case 32: 7480 case 128: 7481 case 256: 7482 case 512: 7483 case 1024: 7484 case 2048: 7485 case 4096: 7486 case 8192: 7487 case 16384: 7488 case 32768: 7489 case 65536: 7490 case 131072: 7491 case 262144: 7492 case 524288: 7493 case 1048576: 7494 case 2097152: 7495 return currentTime + 5e3; 7496 case 4194304: 7497 case 8388608: 7498 case 16777216: 7499 case 33554432: 7500 return -1; 7501 case 67108864: 7502 case 134217728: 7503 case 268435456: 7504 case 536870912: 7505 case 1073741824: 7506 return -1; 7507 default: 7508 return -1; 7509 } 7510 } 7511 function claimNextRetryLane() { 7512 var lane = nextRetryLane; 7513 nextRetryLane <<= 1; 7514 0 === (nextRetryLane & 62914560) && (nextRetryLane = 4194304); 7515 return lane; 7516 } 7517 function createLaneMap(initial) { 7518 for (var laneMap = [], i = 0; 31 > i; i++) laneMap.push(initial); 7519 return laneMap; 7520 } 7521 function markRootUpdated$1(root, updateLane) { 7522 root.pendingLanes |= updateLane; 7523 268435456 !== updateLane && 7524 ((root.suspendedLanes = 0), (root.pingedLanes = 0), (root.warmLanes = 0)); 7525 } 7526 function markRootFinished( 7527 root, 7528 finishedLanes, 7529 remainingLanes, 7530 spawnedLane, 7531 updatedLanes, 7532 suspendedRetryLanes 7533 ) { 7534 var previouslyPendingLanes = root.pendingLanes; 7535 root.pendingLanes = remainingLanes; 7536 root.suspendedLanes = 0; 7537 root.pingedLanes = 0; 7538 root.warmLanes = 0; 7539 root.expiredLanes &= remainingLanes; 7540 root.entangledLanes &= remainingLanes; 7541 root.errorRecoveryDisabledLanes &= remainingLanes; 7542 root.shellSuspendCounter = 0; 7543 var entanglements = root.entanglements, 7544 expirationTimes = root.expirationTimes, 7545 hiddenUpdates = root.hiddenUpdates; 7546 for ( 7547 remainingLanes = previouslyPendingLanes & ~remainingLanes; 7548 0 < remainingLanes; 7549 7550 ) { 7551 var index$7 = 31 - clz32(remainingLanes), 7552 lane = 1 << index$7; 7553 entanglements[index$7] = 0; 7554 expirationTimes[index$7] = -1; 7555 var hiddenUpdatesForLane = hiddenUpdates[index$7]; 7556 if (null !== hiddenUpdatesForLane) 7557 for ( 7558 hiddenUpdates[index$7] = null, index$7 = 0; 7559 index$7 < hiddenUpdatesForLane.length; 7560 index$7++ 7561 ) { 7562 var update = hiddenUpdatesForLane[index$7]; 7563 null !== update && (update.lane &= -536870913); 7564 } 7565 remainingLanes &= ~lane; 7566 } 7567 0 !== spawnedLane && markSpawnedDeferredLane(root, spawnedLane, 0); 7568 0 !== suspendedRetryLanes && 7569 0 === updatedLanes && 7570 0 !== root.tag && 7571 (root.suspendedLanes |= 7572 suspendedRetryLanes & ~(previouslyPendingLanes & ~finishedLanes)); 7573 } 7574 function markSpawnedDeferredLane(root, spawnedLane, entangledLanes) { 7575 root.pendingLanes |= spawnedLane; 7576 root.suspendedLanes &= ~spawnedLane; 7577 var spawnedLaneIndex = 31 - clz32(spawnedLane); 7578 root.entangledLanes |= spawnedLane; 7579 root.entanglements[spawnedLaneIndex] = 7580 root.entanglements[spawnedLaneIndex] | 7581 1073741824 | 7582 (entangledLanes & 261930); 7583 } 7584 function markRootEntangled(root, entangledLanes) { 7585 var rootEntangledLanes = (root.entangledLanes |= entangledLanes); 7586 for (root = root.entanglements; rootEntangledLanes; ) { 7587 var index$8 = 31 - clz32(rootEntangledLanes), 7588 lane = 1 << index$8; 7589 (lane & entangledLanes) | (root[index$8] & entangledLanes) && 7590 (root[index$8] |= entangledLanes); 7591 rootEntangledLanes &= ~lane; 7592 } 7593 } 7594 function getBumpedLaneForHydration(root, renderLanes) { 7595 var renderLane = renderLanes & -renderLanes; 7596 renderLane = 7597 0 !== (renderLane & 42) ? 1 : getBumpedLaneForHydrationByLane(renderLane); 7598 return 0 !== (renderLane & (root.suspendedLanes | renderLanes)) 7599 ? 0 7600 : renderLane; 7601 } 7602 function getBumpedLaneForHydrationByLane(lane) { 7603 switch (lane) { 7604 case 2: 7605 lane = 1; 7606 break; 7607 case 8: 7608 lane = 4; 7609 break; 7610 case 32: 7611 lane = 16; 7612 break; 7613 case 256: 7614 case 512: 7615 case 1024: 7616 case 2048: 7617 case 4096: 7618 case 8192: 7619 case 16384: 7620 case 32768: 7621 case 65536: 7622 case 131072: 7623 case 262144: 7624 case 524288: 7625 case 1048576: 7626 case 2097152: 7627 case 4194304: 7628 case 8388608: 7629 case 16777216: 7630 case 33554432: 7631 lane = 128; 7632 break; 7633 case 268435456: 7634 lane = 134217728; 7635 break; 7636 default: 7637 lane = 0; 7638 } 7639 return lane; 7640 } 7641 function lanesToEventPriority(lanes) { 7642 lanes &= -lanes; 7643 return 2 < lanes 7644 ? 8 < lanes 7645 ? 0 !== (lanes & 134217727) 7646 ? 32 7647 : 268435456 7648 : 8 7649 : 2; 7650 } 7651 function resolveUpdatePriority() { 7652 var updatePriority = ReactDOMSharedInternals.p; 7653 if (0 !== updatePriority) return updatePriority; 7654 updatePriority = window.event; 7655 return void 0 === updatePriority ? 32 : getEventPriority(updatePriority.type); 7656 } 7657 function runWithPriority(priority, fn) { 7658 var previousPriority = ReactDOMSharedInternals.p; 7659 try { 7660 return (ReactDOMSharedInternals.p = priority), fn(); 7661 } finally { 7662 ReactDOMSharedInternals.p = previousPriority; 7663 } 7664 } 7665 var randomKey = Math.random().toString(36).slice(2), 7666 internalInstanceKey = "__reactFiber$" + randomKey, 7667 internalPropsKey = "__reactProps$" + randomKey, 7668 internalContainerInstanceKey = "__reactContainer$" + randomKey, 7669 internalEventHandlersKey = "__reactEvents$" + randomKey, 7670 internalEventHandlerListenersKey = "__reactListeners$" + randomKey, 7671 internalEventHandlesSetKey = "__reactHandles$" + randomKey, 7672 internalRootNodeResourcesKey = "__reactResources$" + randomKey, 7673 internalHoistableMarker = "__reactMarker$" + randomKey; 7674 function detachDeletedInstance(node) { 7675 delete node[internalInstanceKey]; 7676 delete node[internalPropsKey]; 7677 delete node[internalEventHandlersKey]; 7678 delete node[internalEventHandlerListenersKey]; 7679 delete node[internalEventHandlesSetKey]; 7680 } 7681 function getClosestInstanceFromNode(targetNode) { 7682 var targetInst = targetNode[internalInstanceKey]; 7683 if (targetInst) return targetInst; 7684 for (var parentNode = targetNode.parentNode; parentNode; ) { 7685 if ( 7686 (targetInst = 7687 parentNode[internalContainerInstanceKey] || 7688 parentNode[internalInstanceKey]) 7689 ) { 7690 parentNode = targetInst.alternate; 7691 if ( 7692 null !== targetInst.child || 7693 (null !== parentNode && null !== parentNode.child) 7694 ) 7695 for ( 7696 targetNode = getParentHydrationBoundary(targetNode); 7697 null !== targetNode; 7698 7699 ) { 7700 if ((parentNode = targetNode[internalInstanceKey])) return parentNode; 7701 targetNode = getParentHydrationBoundary(targetNode); 7702 } 7703 return targetInst; 7704 } 7705 targetNode = parentNode; 7706 parentNode = targetNode.parentNode; 7707 } 7708 return null; 7709 } 7710 function getInstanceFromNode(node) { 7711 if ( 7712 (node = node[internalInstanceKey] || node[internalContainerInstanceKey]) 7713 ) { 7714 var tag = node.tag; 7715 if ( 7716 5 === tag || 7717 6 === tag || 7718 13 === tag || 7719 31 === tag || 7720 26 === tag || 7721 27 === tag || 7722 3 === tag 7723 ) 7724 return node; 7725 } 7726 return null; 7727 } 7728 function getNodeFromInstance(inst) { 7729 var tag = inst.tag; 7730 if (5 === tag || 26 === tag || 27 === tag || 6 === tag) return inst.stateNode; 7731 throw Error(formatProdErrorMessage(33)); 7732 } 7733 function getResourcesFromRoot(root) { 7734 var resources = root[internalRootNodeResourcesKey]; 7735 resources || 7736 (resources = root[internalRootNodeResourcesKey] = 7737 { hoistableStyles: new Map(), hoistableScripts: new Map() }); 7738 return resources; 7739 } 7740 function markNodeAsHoistable(node) { 7741 node[internalHoistableMarker] = true; 7742 } 7743 var allNativeEvents = new Set(), 7744 registrationNameDependencies = {}; 7745 function registerTwoPhaseEvent(registrationName, dependencies) { 7746 registerDirectEvent(registrationName, dependencies); 7747 registerDirectEvent(registrationName + "Capture", dependencies); 7748 } 7749 function registerDirectEvent(registrationName, dependencies) { 7750 registrationNameDependencies[registrationName] = dependencies; 7751 for ( 7752 registrationName = 0; 7753 registrationName < dependencies.length; 7754 registrationName++ 7755 ) 7756 allNativeEvents.add(dependencies[registrationName]); 7757 } 7758 var VALID_ATTRIBUTE_NAME_REGEX = RegExp( 7759 "^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$" 7760 ), 7761 illegalAttributeNameCache = {}, 7762 validatedAttributeNameCache = {}; 7763 function isAttributeNameSafe(attributeName) { 7764 if (hasOwnProperty.call(validatedAttributeNameCache, attributeName)) 7765 return true; 7766 if (hasOwnProperty.call(illegalAttributeNameCache, attributeName)) return false; 7767 if (VALID_ATTRIBUTE_NAME_REGEX.test(attributeName)) 7768 return (validatedAttributeNameCache[attributeName] = true); 7769 illegalAttributeNameCache[attributeName] = true; 7770 return false; 7771 } 7772 function setValueForAttribute(node, name, value) { 7773 if (isAttributeNameSafe(name)) 7774 if (null === value) node.removeAttribute(name); 7775 else { 7776 switch (typeof value) { 7777 case "undefined": 7778 case "function": 7779 case "symbol": 7780 node.removeAttribute(name); 7781 return; 7782 case "boolean": 7783 var prefix$10 = name.toLowerCase().slice(0, 5); 7784 if ("data-" !== prefix$10 && "aria-" !== prefix$10) { 7785 node.removeAttribute(name); 7786 return; 7787 } 7788 } 7789 node.setAttribute(name, "" + value); 7790 } 7791 } 7792 function setValueForKnownAttribute(node, name, value) { 7793 if (null === value) node.removeAttribute(name); 7794 else { 7795 switch (typeof value) { 7796 case "undefined": 7797 case "function": 7798 case "symbol": 7799 case "boolean": 7800 node.removeAttribute(name); 7801 return; 7802 } 7803 node.setAttribute(name, "" + value); 7804 } 7805 } 7806 function setValueForNamespacedAttribute(node, namespace, name, value) { 7807 if (null === value) node.removeAttribute(name); 7808 else { 7809 switch (typeof value) { 7810 case "undefined": 7811 case "function": 7812 case "symbol": 7813 case "boolean": 7814 node.removeAttribute(name); 7815 return; 7816 } 7817 node.setAttributeNS(namespace, name, "" + value); 7818 } 7819 } 7820 function getToStringValue(value) { 7821 switch (typeof value) { 7822 case "bigint": 7823 case "boolean": 7824 case "number": 7825 case "string": 7826 case "undefined": 7827 return value; 7828 case "object": 7829 return value; 7830 default: 7831 return ""; 7832 } 7833 } 7834 function isCheckable(elem) { 7835 var type = elem.type; 7836 return ( 7837 (elem = elem.nodeName) && 7838 "input" === elem.toLowerCase() && 7839 ("checkbox" === type || "radio" === type) 7840 ); 7841 } 7842 function trackValueOnNode(node, valueField, currentValue) { 7843 var descriptor = Object.getOwnPropertyDescriptor( 7844 node.constructor.prototype, 7845 valueField 7846 ); 7847 if ( 7848 !node.hasOwnProperty(valueField) && 7849 "undefined" !== typeof descriptor && 7850 "function" === typeof descriptor.get && 7851 "function" === typeof descriptor.set 7852 ) { 7853 var get = descriptor.get, 7854 set = descriptor.set; 7855 Object.defineProperty(node, valueField, { 7856 configurable: true, 7857 get: function () { 7858 return get.call(this); 7859 }, 7860 set: function (value) { 7861 currentValue = "" + value; 7862 set.call(this, value); 7863 } 7864 }); 7865 Object.defineProperty(node, valueField, { 7866 enumerable: descriptor.enumerable 7867 }); 7868 return { 7869 getValue: function () { 7870 return currentValue; 7871 }, 7872 setValue: function (value) { 7873 currentValue = "" + value; 7874 }, 7875 stopTracking: function () { 7876 node._valueTracker = null; 7877 delete node[valueField]; 7878 } 7879 }; 7880 } 7881 } 7882 function track(node) { 7883 if (!node._valueTracker) { 7884 var valueField = isCheckable(node) ? "checked" : "value"; 7885 node._valueTracker = trackValueOnNode( 7886 node, 7887 valueField, 7888 "" + node[valueField] 7889 ); 7890 } 7891 } 7892 function updateValueIfChanged(node) { 7893 if (!node) return false; 7894 var tracker = node._valueTracker; 7895 if (!tracker) return true; 7896 var lastValue = tracker.getValue(); 7897 var value = ""; 7898 node && 7899 (value = isCheckable(node) 7900 ? node.checked 7901 ? "true" 7902 : "false" 7903 : node.value); 7904 node = value; 7905 return node !== lastValue ? (tracker.setValue(node), true) : false; 7906 } 7907 function getActiveElement(doc) { 7908 doc = doc || ("undefined" !== typeof document ? document : void 0); 7909 if ("undefined" === typeof doc) return null; 7910 try { 7911 return doc.activeElement || doc.body; 7912 } catch (e) { 7913 return doc.body; 7914 } 7915 } 7916 var escapeSelectorAttributeValueInsideDoubleQuotesRegex = /[\n"\\]/g; 7917 function escapeSelectorAttributeValueInsideDoubleQuotes(value) { 7918 return value.replace( 7919 escapeSelectorAttributeValueInsideDoubleQuotesRegex, 7920 function (ch) { 7921 return "\\" + ch.charCodeAt(0).toString(16) + " "; 7922 } 7923 ); 7924 } 7925 function updateInput( 7926 element, 7927 value, 7928 defaultValue, 7929 lastDefaultValue, 7930 checked, 7931 defaultChecked, 7932 type, 7933 name 7934 ) { 7935 element.name = ""; 7936 null != type && 7937 "function" !== typeof type && 7938 "symbol" !== typeof type && 7939 "boolean" !== typeof type 7940 ? (element.type = type) 7941 : element.removeAttribute("type"); 7942 if (null != value) 7943 if ("number" === type) { 7944 if ((0 === value && "" === element.value) || element.value != value) 7945 element.value = "" + getToStringValue(value); 7946 } else 7947 element.value !== "" + getToStringValue(value) && 7948 (element.value = "" + getToStringValue(value)); 7949 else 7950 ("submit" !== type && "reset" !== type) || element.removeAttribute("value"); 7951 null != value 7952 ? setDefaultValue(element, type, getToStringValue(value)) 7953 : null != defaultValue 7954 ? setDefaultValue(element, type, getToStringValue(defaultValue)) 7955 : null != lastDefaultValue && element.removeAttribute("value"); 7956 null == checked && 7957 null != defaultChecked && 7958 (element.defaultChecked = !!defaultChecked); 7959 null != checked && 7960 (element.checked = 7961 checked && "function" !== typeof checked && "symbol" !== typeof checked); 7962 null != name && 7963 "function" !== typeof name && 7964 "symbol" !== typeof name && 7965 "boolean" !== typeof name 7966 ? (element.name = "" + getToStringValue(name)) 7967 : element.removeAttribute("name"); 7968 } 7969 function initInput( 7970 element, 7971 value, 7972 defaultValue, 7973 checked, 7974 defaultChecked, 7975 type, 7976 name, 7977 isHydrating 7978 ) { 7979 null != type && 7980 "function" !== typeof type && 7981 "symbol" !== typeof type && 7982 "boolean" !== typeof type && 7983 (element.type = type); 7984 if (null != value || null != defaultValue) { 7985 if ( 7986 !( 7987 ("submit" !== type && "reset" !== type) || 7988 (void 0 !== value && null !== value) 7989 ) 7990 ) { 7991 track(element); 7992 return; 7993 } 7994 defaultValue = 7995 null != defaultValue ? "" + getToStringValue(defaultValue) : ""; 7996 value = null != value ? "" + getToStringValue(value) : defaultValue; 7997 isHydrating || value === element.value || (element.value = value); 7998 element.defaultValue = value; 7999 } 8000 checked = null != checked ? checked : defaultChecked; 8001 checked = 8002 "function" !== typeof checked && "symbol" !== typeof checked && !!checked; 8003 element.checked = isHydrating ? element.checked : !!checked; 8004 element.defaultChecked = !!checked; 8005 null != name && 8006 "function" !== typeof name && 8007 "symbol" !== typeof name && 8008 "boolean" !== typeof name && 8009 (element.name = name); 8010 track(element); 8011 } 8012 function setDefaultValue(node, type, value) { 8013 ("number" === type && getActiveElement(node.ownerDocument) === node) || 8014 node.defaultValue === "" + value || 8015 (node.defaultValue = "" + value); 8016 } 8017 function updateOptions(node, multiple, propValue, setDefaultSelected) { 8018 node = node.options; 8019 if (multiple) { 8020 multiple = {}; 8021 for (var i = 0; i < propValue.length; i++) 8022 multiple["$" + propValue[i]] = true; 8023 for (propValue = 0; propValue < node.length; propValue++) 8024 (i = multiple.hasOwnProperty("$" + node[propValue].value)), 8025 node[propValue].selected !== i && (node[propValue].selected = i), 8026 i && setDefaultSelected && (node[propValue].defaultSelected = true); 8027 } else { 8028 propValue = "" + getToStringValue(propValue); 8029 multiple = null; 8030 for (i = 0; i < node.length; i++) { 8031 if (node[i].value === propValue) { 8032 node[i].selected = true; 8033 setDefaultSelected && (node[i].defaultSelected = true); 8034 return; 8035 } 8036 null !== multiple || node[i].disabled || (multiple = node[i]); 8037 } 8038 null !== multiple && (multiple.selected = true); 8039 } 8040 } 8041 function updateTextarea(element, value, defaultValue) { 8042 if ( 8043 null != value && 8044 ((value = "" + getToStringValue(value)), 8045 value !== element.value && (element.value = value), 8046 null == defaultValue) 8047 ) { 8048 element.defaultValue !== value && (element.defaultValue = value); 8049 return; 8050 } 8051 element.defaultValue = 8052 null != defaultValue ? "" + getToStringValue(defaultValue) : ""; 8053 } 8054 function initTextarea(element, value, defaultValue, children) { 8055 if (null == value) { 8056 if (null != children) { 8057 if (null != defaultValue) throw Error(formatProdErrorMessage(92)); 8058 if (isArrayImpl(children)) { 8059 if (1 < children.length) throw Error(formatProdErrorMessage(93)); 8060 children = children[0]; 8061 } 8062 defaultValue = children; 8063 } 8064 null == defaultValue && (defaultValue = ""); 8065 value = defaultValue; 8066 } 8067 defaultValue = getToStringValue(value); 8068 element.defaultValue = defaultValue; 8069 children = element.textContent; 8070 children === defaultValue && 8071 "" !== children && 8072 null !== children && 8073 (element.value = children); 8074 track(element); 8075 } 8076 function setTextContent(node, text) { 8077 if (text) { 8078 var firstChild = node.firstChild; 8079 if ( 8080 firstChild && 8081 firstChild === node.lastChild && 8082 3 === firstChild.nodeType 8083 ) { 8084 firstChild.nodeValue = text; 8085 return; 8086 } 8087 } 8088 node.textContent = text; 8089 } 8090 var unitlessNumbers = new Set( 8091 "animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split( 8092 " " 8093 ) 8094 ); 8095 function setValueForStyle(style, styleName, value) { 8096 var isCustomProperty = 0 === styleName.indexOf("--"); 8097 null == value || "boolean" === typeof value || "" === value 8098 ? isCustomProperty 8099 ? style.setProperty(styleName, "") 8100 : "float" === styleName 8101 ? (style.cssFloat = "") 8102 : (style[styleName] = "") 8103 : isCustomProperty 8104 ? style.setProperty(styleName, value) 8105 : "number" !== typeof value || 8106 0 === value || 8107 unitlessNumbers.has(styleName) 8108 ? "float" === styleName 8109 ? (style.cssFloat = value) 8110 : (style[styleName] = ("" + value).trim()) 8111 : (style[styleName] = value + "px"); 8112 } 8113 function setValueForStyles(node, styles, prevStyles) { 8114 if (null != styles && "object" !== typeof styles) 8115 throw Error(formatProdErrorMessage(62)); 8116 node = node.style; 8117 if (null != prevStyles) { 8118 for (var styleName in prevStyles) 8119 !prevStyles.hasOwnProperty(styleName) || 8120 (null != styles && styles.hasOwnProperty(styleName)) || 8121 (0 === styleName.indexOf("--") 8122 ? node.setProperty(styleName, "") 8123 : "float" === styleName 8124 ? (node.cssFloat = "") 8125 : (node[styleName] = "")); 8126 for (var styleName$16 in styles) 8127 (styleName = styles[styleName$16]), 8128 styles.hasOwnProperty(styleName$16) && 8129 prevStyles[styleName$16] !== styleName && 8130 setValueForStyle(node, styleName$16, styleName); 8131 } else 8132 for (var styleName$17 in styles) 8133 styles.hasOwnProperty(styleName$17) && 8134 setValueForStyle(node, styleName$17, styles[styleName$17]); 8135 } 8136 function isCustomElement(tagName) { 8137 if (-1 === tagName.indexOf("-")) return false; 8138 switch (tagName) { 8139 case "annotation-xml": 8140 case "color-profile": 8141 case "font-face": 8142 case "font-face-src": 8143 case "font-face-uri": 8144 case "font-face-format": 8145 case "font-face-name": 8146 case "missing-glyph": 8147 return false; 8148 default: 8149 return true; 8150 } 8151 } 8152 var aliases = new Map([ 8153 ["acceptCharset", "accept-charset"], 8154 ["htmlFor", "for"], 8155 ["httpEquiv", "http-equiv"], 8156 ["crossOrigin", "crossorigin"], 8157 ["accentHeight", "accent-height"], 8158 ["alignmentBaseline", "alignment-baseline"], 8159 ["arabicForm", "arabic-form"], 8160 ["baselineShift", "baseline-shift"], 8161 ["capHeight", "cap-height"], 8162 ["clipPath", "clip-path"], 8163 ["clipRule", "clip-rule"], 8164 ["colorInterpolation", "color-interpolation"], 8165 ["colorInterpolationFilters", "color-interpolation-filters"], 8166 ["colorProfile", "color-profile"], 8167 ["colorRendering", "color-rendering"], 8168 ["dominantBaseline", "dominant-baseline"], 8169 ["enableBackground", "enable-background"], 8170 ["fillOpacity", "fill-opacity"], 8171 ["fillRule", "fill-rule"], 8172 ["floodColor", "flood-color"], 8173 ["floodOpacity", "flood-opacity"], 8174 ["fontFamily", "font-family"], 8175 ["fontSize", "font-size"], 8176 ["fontSizeAdjust", "font-size-adjust"], 8177 ["fontStretch", "font-stretch"], 8178 ["fontStyle", "font-style"], 8179 ["fontVariant", "font-variant"], 8180 ["fontWeight", "font-weight"], 8181 ["glyphName", "glyph-name"], 8182 ["glyphOrientationHorizontal", "glyph-orientation-horizontal"], 8183 ["glyphOrientationVertical", "glyph-orientation-vertical"], 8184 ["horizAdvX", "horiz-adv-x"], 8185 ["horizOriginX", "horiz-origin-x"], 8186 ["imageRendering", "image-rendering"], 8187 ["letterSpacing", "letter-spacing"], 8188 ["lightingColor", "lighting-color"], 8189 ["markerEnd", "marker-end"], 8190 ["markerMid", "marker-mid"], 8191 ["markerStart", "marker-start"], 8192 ["overlinePosition", "overline-position"], 8193 ["overlineThickness", "overline-thickness"], 8194 ["paintOrder", "paint-order"], 8195 ["panose-1", "panose-1"], 8196 ["pointerEvents", "pointer-events"], 8197 ["renderingIntent", "rendering-intent"], 8198 ["shapeRendering", "shape-rendering"], 8199 ["stopColor", "stop-color"], 8200 ["stopOpacity", "stop-opacity"], 8201 ["strikethroughPosition", "strikethrough-position"], 8202 ["strikethroughThickness", "strikethrough-thickness"], 8203 ["strokeDasharray", "stroke-dasharray"], 8204 ["strokeDashoffset", "stroke-dashoffset"], 8205 ["strokeLinecap", "stroke-linecap"], 8206 ["strokeLinejoin", "stroke-linejoin"], 8207 ["strokeMiterlimit", "stroke-miterlimit"], 8208 ["strokeOpacity", "stroke-opacity"], 8209 ["strokeWidth", "stroke-width"], 8210 ["textAnchor", "text-anchor"], 8211 ["textDecoration", "text-decoration"], 8212 ["textRendering", "text-rendering"], 8213 ["transformOrigin", "transform-origin"], 8214 ["underlinePosition", "underline-position"], 8215 ["underlineThickness", "underline-thickness"], 8216 ["unicodeBidi", "unicode-bidi"], 8217 ["unicodeRange", "unicode-range"], 8218 ["unitsPerEm", "units-per-em"], 8219 ["vAlphabetic", "v-alphabetic"], 8220 ["vHanging", "v-hanging"], 8221 ["vIdeographic", "v-ideographic"], 8222 ["vMathematical", "v-mathematical"], 8223 ["vectorEffect", "vector-effect"], 8224 ["vertAdvY", "vert-adv-y"], 8225 ["vertOriginX", "vert-origin-x"], 8226 ["vertOriginY", "vert-origin-y"], 8227 ["wordSpacing", "word-spacing"], 8228 ["writingMode", "writing-mode"], 8229 ["xmlnsXlink", "xmlns:xlink"], 8230 ["xHeight", "x-height"] 8231 ]), 8232 isJavaScriptProtocol = 8233 /^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i; 8234 function sanitizeURL(url) { 8235 return isJavaScriptProtocol.test("" + url) 8236 ? "javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')" 8237 : url; 8238 } 8239 function noop$1() {} 8240 var currentReplayingEvent = null; 8241 function getEventTarget(nativeEvent) { 8242 nativeEvent = nativeEvent.target || nativeEvent.srcElement || window; 8243 nativeEvent.correspondingUseElement && 8244 (nativeEvent = nativeEvent.correspondingUseElement); 8245 return 3 === nativeEvent.nodeType ? nativeEvent.parentNode : nativeEvent; 8246 } 8247 var restoreTarget = null, 8248 restoreQueue = null; 8249 function restoreStateOfTarget(target) { 8250 var internalInstance = getInstanceFromNode(target); 8251 if (internalInstance && (target = internalInstance.stateNode)) { 8252 var props = target[internalPropsKey] || null; 8253 a: switch (((target = internalInstance.stateNode), internalInstance.type)) { 8254 case "input": 8255 updateInput( 8256 target, 8257 props.value, 8258 props.defaultValue, 8259 props.defaultValue, 8260 props.checked, 8261 props.defaultChecked, 8262 props.type, 8263 props.name 8264 ); 8265 internalInstance = props.name; 8266 if ("radio" === props.type && null != internalInstance) { 8267 for (props = target; props.parentNode; ) props = props.parentNode; 8268 props = props.querySelectorAll( 8269 'input[name="' + 8270 escapeSelectorAttributeValueInsideDoubleQuotes( 8271 "" + internalInstance 8272 ) + 8273 '"][type="radio"]' 8274 ); 8275 for ( 8276 internalInstance = 0; 8277 internalInstance < props.length; 8278 internalInstance++ 8279 ) { 8280 var otherNode = props[internalInstance]; 8281 if (otherNode !== target && otherNode.form === target.form) { 8282 var otherProps = otherNode[internalPropsKey] || null; 8283 if (!otherProps) throw Error(formatProdErrorMessage(90)); 8284 updateInput( 8285 otherNode, 8286 otherProps.value, 8287 otherProps.defaultValue, 8288 otherProps.defaultValue, 8289 otherProps.checked, 8290 otherProps.defaultChecked, 8291 otherProps.type, 8292 otherProps.name 8293 ); 8294 } 8295 } 8296 for ( 8297 internalInstance = 0; 8298 internalInstance < props.length; 8299 internalInstance++ 8300 ) 8301 (otherNode = props[internalInstance]), 8302 otherNode.form === target.form && updateValueIfChanged(otherNode); 8303 } 8304 break a; 8305 case "textarea": 8306 updateTextarea(target, props.value, props.defaultValue); 8307 break a; 8308 case "select": 8309 (internalInstance = props.value), 8310 null != internalInstance && 8311 updateOptions(target, !!props.multiple, internalInstance, false); 8312 } 8313 } 8314 } 8315 var isInsideEventHandler = false; 8316 function batchedUpdates$1(fn, a, b) { 8317 if (isInsideEventHandler) return fn(a, b); 8318 isInsideEventHandler = true; 8319 try { 8320 var JSCompiler_inline_result = fn(a); 8321 return JSCompiler_inline_result; 8322 } finally { 8323 if ( 8324 ((isInsideEventHandler = false), 8325 null !== restoreTarget || null !== restoreQueue) 8326 ) 8327 if ( 8328 (flushSyncWork$1(), 8329 restoreTarget && 8330 ((a = restoreTarget), 8331 (fn = restoreQueue), 8332 (restoreQueue = restoreTarget = null), 8333 restoreStateOfTarget(a), 8334 fn)) 8335 ) 8336 for (a = 0; a < fn.length; a++) restoreStateOfTarget(fn[a]); 8337 } 8338 } 8339 function getListener(inst, registrationName) { 8340 var stateNode = inst.stateNode; 8341 if (null === stateNode) return null; 8342 var props = stateNode[internalPropsKey] || null; 8343 if (null === props) return null; 8344 stateNode = props[registrationName]; 8345 a: switch (registrationName) { 8346 case "onClick": 8347 case "onClickCapture": 8348 case "onDoubleClick": 8349 case "onDoubleClickCapture": 8350 case "onMouseDown": 8351 case "onMouseDownCapture": 8352 case "onMouseMove": 8353 case "onMouseMoveCapture": 8354 case "onMouseUp": 8355 case "onMouseUpCapture": 8356 case "onMouseEnter": 8357 (props = !props.disabled) || 8358 ((inst = inst.type), 8359 (props = !( 8360 "button" === inst || 8361 "input" === inst || 8362 "select" === inst || 8363 "textarea" === inst 8364 ))); 8365 inst = !props; 8366 break a; 8367 default: 8368 inst = false; 8369 } 8370 if (inst) return null; 8371 if (stateNode && "function" !== typeof stateNode) 8372 throw Error( 8373 formatProdErrorMessage(231, registrationName, typeof stateNode) 8374 ); 8375 return stateNode; 8376 } 8377 var canUseDOM = !( 8378 "undefined" === typeof window || 8379 "undefined" === typeof window.document || 8380 "undefined" === typeof window.document.createElement 8381 ), 8382 passiveBrowserEventsSupported = false; 8383 if (canUseDOM) 8384 try { 8385 var options = {}; 8386 Object.defineProperty(options, "passive", { 8387 get: function () { 8388 passiveBrowserEventsSupported =
8388!0
vendor: 125,689 bytes, lines 8388-12060
8388; 8389 } 8390 }); 8391 window.addEventListener("test", options, options); 8392 window.removeEventListener("test", options, options); 8393 } catch (e) { 8394 passiveBrowserEventsSupported = false; 8395 } 8396 var root = null, 8397 startText = null, 8398 fallbackText = null; 8399 function getData() { 8400 if (fallbackText) return fallbackText; 8401 var start, 8402 startValue = startText, 8403 startLength = startValue.length, 8404 end, 8405 endValue = "value" in root ? root.value : root.textContent, 8406 endLength = endValue.length; 8407 for ( 8408 start = 0; 8409 start < startLength && startValue[start] === endValue[start]; 8410 start++ 8411 ); 8412 var minEnd = startLength - start; 8413 for ( 8414 end = 1; 8415 end <= minEnd && 8416 startValue[startLength - end] === endValue[endLength - end]; 8417 end++ 8418 ); 8419 return (fallbackText = endValue.slice(start, 1 < end ? 1 - end : void 0)); 8420 } 8421 function getEventCharCode(nativeEvent) { 8422 var keyCode = nativeEvent.keyCode; 8423 "charCode" in nativeEvent 8424 ? ((nativeEvent = nativeEvent.charCode), 8425 0 === nativeEvent && 13 === keyCode && (nativeEvent = 13)) 8426 : (nativeEvent = keyCode); 8427 10 === nativeEvent && (nativeEvent = 13); 8428 return 32 <= nativeEvent || 13 === nativeEvent ? nativeEvent : 0; 8429 } 8430 function functionThatReturnsTrue() { 8431 return true; 8432 } 8433 function functionThatReturnsFalse() { 8434 return false; 8435 } 8436 function createSyntheticEvent(Interface) { 8437 function SyntheticBaseEvent( 8438 reactName, 8439 reactEventType, 8440 targetInst, 8441 nativeEvent, 8442 nativeEventTarget 8443 ) { 8444 this._reactName = reactName; 8445 this._targetInst = targetInst; 8446 this.type = reactEventType; 8447 this.nativeEvent = nativeEvent; 8448 this.target = nativeEventTarget; 8449 this.currentTarget = null; 8450 for (var propName in Interface) 8451 Interface.hasOwnProperty(propName) && 8452 ((reactName = Interface[propName]), 8453 (this[propName] = reactName 8454 ? reactName(nativeEvent) 8455 : nativeEvent[propName])); 8456 this.isDefaultPrevented = ( 8457 null != nativeEvent.defaultPrevented 8458 ? nativeEvent.defaultPrevented 8459 : false === nativeEvent.returnValue 8460 ) 8461 ? functionThatReturnsTrue 8462 : functionThatReturnsFalse; 8463 this.isPropagationStopped = functionThatReturnsFalse; 8464 return this; 8465 } 8466 assign(SyntheticBaseEvent.prototype, { 8467 preventDefault: function () { 8468 this.defaultPrevented = true; 8469 var event = this.nativeEvent; 8470 event && 8471 (event.preventDefault 8472 ? event.preventDefault() 8473 : "unknown" !== typeof event.returnValue && (event.returnValue = false), 8474 (this.isDefaultPrevented = functionThatReturnsTrue)); 8475 }, 8476 stopPropagation: function () { 8477 var event = this.nativeEvent; 8478 event && 8479 (event.stopPropagation 8480 ? event.stopPropagation() 8481 : "unknown" !== typeof event.cancelBubble && 8482 (event.cancelBubble = true), 8483 (this.isPropagationStopped = functionThatReturnsTrue)); 8484 }, 8485 persist: function () {}, 8486 isPersistent: functionThatReturnsTrue 8487 }); 8488 return SyntheticBaseEvent; 8489 } 8490 var EventInterface = { 8491 eventPhase: 0, 8492 bubbles: 0, 8493 cancelable: 0, 8494 timeStamp: function (event) { 8495 return event.timeStamp || Date.now(); 8496 }, 8497 defaultPrevented: 0, 8498 isTrusted: 0 8499 }, 8500 SyntheticEvent = createSyntheticEvent(EventInterface), 8501 UIEventInterface = assign({}, EventInterface, { view: 0, detail: 0 }), 8502 SyntheticUIEvent = createSyntheticEvent(UIEventInterface), 8503 lastMovementX, 8504 lastMovementY, 8505 lastMouseEvent, 8506 MouseEventInterface = assign({}, UIEventInterface, { 8507 screenX: 0, 8508 screenY: 0, 8509 clientX: 0, 8510 clientY: 0, 8511 pageX: 0, 8512 pageY: 0, 8513 ctrlKey: 0, 8514 shiftKey: 0, 8515 altKey: 0, 8516 metaKey: 0, 8517 getModifierState: getEventModifierState, 8518 button: 0, 8519 buttons: 0, 8520 relatedTarget: function (event) { 8521 return void 0 === event.relatedTarget 8522 ? event.fromElement === event.srcElement 8523 ? event.toElement 8524 : event.fromElement 8525 : event.relatedTarget; 8526 }, 8527 movementX: function (event) { 8528 if ("movementX" in event) return event.movementX; 8529 event !== lastMouseEvent && 8530 (lastMouseEvent && "mousemove" === event.type 8531 ? ((lastMovementX = event.screenX - lastMouseEvent.screenX), 8532 (lastMovementY = event.screenY - lastMouseEvent.screenY)) 8533 : (lastMovementY = lastMovementX = 0), 8534 (lastMouseEvent = event)); 8535 return lastMovementX; 8536 }, 8537 movementY: function (event) { 8538 return "movementY" in event ? event.movementY : lastMovementY; 8539 } 8540 }), 8541 SyntheticMouseEvent = createSyntheticEvent(MouseEventInterface), 8542 DragEventInterface = assign({}, MouseEventInterface, { dataTransfer: 0 }), 8543 SyntheticDragEvent = createSyntheticEvent(DragEventInterface), 8544 FocusEventInterface = assign({}, UIEventInterface, { relatedTarget: 0 }), 8545 SyntheticFocusEvent = createSyntheticEvent(FocusEventInterface), 8546 AnimationEventInterface = assign({}, EventInterface, { 8547 animationName: 0, 8548 elapsedTime: 0, 8549 pseudoElement: 0 8550 }), 8551 SyntheticAnimationEvent = createSyntheticEvent(AnimationEventInterface), 8552 ClipboardEventInterface = assign({}, EventInterface, { 8553 clipboardData: function (event) { 8554 return "clipboardData" in event 8555 ? event.clipboardData 8556 : window.clipboardData; 8557 } 8558 }), 8559 SyntheticClipboardEvent = createSyntheticEvent(ClipboardEventInterface), 8560 CompositionEventInterface = assign({}, EventInterface, { data: 0 }), 8561 SyntheticCompositionEvent = createSyntheticEvent(CompositionEventInterface), 8562 normalizeKey = { 8563 Esc: "Escape", 8564 Spacebar: " ", 8565 Left: "ArrowLeft", 8566 Up: "ArrowUp", 8567 Right: "ArrowRight", 8568 Down: "ArrowDown", 8569 Del: "Delete", 8570 Win: "OS", 8571 Menu: "ContextMenu", 8572 Apps: "ContextMenu", 8573 Scroll: "ScrollLock", 8574 MozPrintableKey: "Unidentified" 8575 }, 8576 translateToKey = { 8577 8: "Backspace", 8578 9: "Tab", 8579 12: "Clear", 8580 13: "Enter", 8581 16: "Shift", 8582 17: "Control", 8583 18: "Alt", 8584 19: "Pause", 8585 20: "CapsLock", 8586 27: "Escape", 8587 32: " ", 8588 33: "PageUp", 8589 34: "PageDown", 8590 35: "End", 8591 36: "Home", 8592 37: "ArrowLeft", 8593 38: "ArrowUp", 8594 39: "ArrowRight", 8595 40: "ArrowDown", 8596 45: "Insert", 8597 46: "Delete", 8598 112: "F1", 8599 113: "F2", 8600 114: "F3", 8601 115: "F4", 8602 116: "F5", 8603 117: "F6", 8604 118: "F7", 8605 119: "F8", 8606 120: "F9", 8607 121: "F10", 8608 122: "F11", 8609 123: "F12", 8610 144: "NumLock", 8611 145: "ScrollLock", 8612 224: "Meta" 8613 }, 8614 modifierKeyToProp = { 8615 Alt: "altKey", 8616 Control: "ctrlKey", 8617 Meta: "metaKey", 8618 Shift: "shiftKey" 8619 }; 8620 function modifierStateGetter(keyArg) { 8621 var nativeEvent = this.nativeEvent; 8622 return nativeEvent.getModifierState 8623 ? nativeEvent.getModifierState(keyArg) 8624 : (keyArg = modifierKeyToProp[keyArg]) 8625 ? !!nativeEvent[keyArg] 8626 : false; 8627 } 8628 function getEventModifierState() { 8629 return modifierStateGetter; 8630 } 8631 var KeyboardEventInterface = assign({}, UIEventInterface, { 8632 key: function (nativeEvent) { 8633 if (nativeEvent.key) { 8634 var key = normalizeKey[nativeEvent.key] || nativeEvent.key; 8635 if ("Unidentified" !== key) return key; 8636 } 8637 return "keypress" === nativeEvent.type 8638 ? ((nativeEvent = getEventCharCode(nativeEvent)), 8639 13 === nativeEvent ? "Enter" : String.fromCharCode(nativeEvent)) 8640 : "keydown" === nativeEvent.type || "keyup" === nativeEvent.type 8641 ? translateToKey[nativeEvent.keyCode] || "Unidentified" 8642 : ""; 8643 }, 8644 code: 0, 8645 location: 0, 8646 ctrlKey: 0, 8647 shiftKey: 0, 8648 altKey: 0, 8649 metaKey: 0, 8650 repeat: 0, 8651 locale: 0, 8652 getModifierState: getEventModifierState, 8653 charCode: function (event) { 8654 return "keypress" === event.type ? getEventCharCode(event) : 0; 8655 }, 8656 keyCode: function (event) { 8657 return "keydown" === event.type || "keyup" === event.type 8658 ? event.keyCode 8659 : 0; 8660 }, 8661 which: function (event) { 8662 return "keypress" === event.type 8663 ? getEventCharCode(event) 8664 : "keydown" === event.type || "keyup" === event.type 8665 ? event.keyCode 8666 : 0; 8667 } 8668 }), 8669 SyntheticKeyboardEvent = createSyntheticEvent(KeyboardEventInterface), 8670 PointerEventInterface = assign({}, MouseEventInterface, { 8671 pointerId: 0, 8672 width: 0, 8673 height: 0, 8674 pressure: 0, 8675 tangentialPressure: 0, 8676 tiltX: 0, 8677 tiltY: 0, 8678 twist: 0, 8679 pointerType: 0, 8680 isPrimary: 0 8681 }), 8682 SyntheticPointerEvent = createSyntheticEvent(PointerEventInterface), 8683 TouchEventInterface = assign({}, UIEventInterface, { 8684 touches: 0, 8685 targetTouches: 0, 8686 changedTouches: 0, 8687 altKey: 0, 8688 metaKey: 0, 8689 ctrlKey: 0, 8690 shiftKey: 0, 8691 getModifierState: getEventModifierState 8692 }), 8693 SyntheticTouchEvent = createSyntheticEvent(TouchEventInterface), 8694 TransitionEventInterface = assign({}, EventInterface, { 8695 propertyName: 0, 8696 elapsedTime: 0, 8697 pseudoElement: 0 8698 }), 8699 SyntheticTransitionEvent = createSyntheticEvent(TransitionEventInterface), 8700 WheelEventInterface = assign({}, MouseEventInterface, { 8701 deltaX: function (event) { 8702 return "deltaX" in event 8703 ? event.deltaX 8704 : "wheelDeltaX" in event 8705 ? -event.wheelDeltaX 8706 : 0; 8707 }, 8708 deltaY: function (event) { 8709 return "deltaY" in event 8710 ? event.deltaY 8711 : "wheelDeltaY" in event 8712 ? -event.wheelDeltaY 8713 : "wheelDelta" in event 8714 ? -event.wheelDelta 8715 : 0; 8716 }, 8717 deltaZ: 0, 8718 deltaMode: 0 8719 }), 8720 SyntheticWheelEvent = createSyntheticEvent(WheelEventInterface), 8721 ToggleEventInterface = assign({}, EventInterface, { 8722 newState: 0, 8723 oldState: 0 8724 }), 8725 SyntheticToggleEvent = createSyntheticEvent(ToggleEventInterface), 8726 END_KEYCODES = [9, 13, 27, 32], 8727 canUseCompositionEvent = canUseDOM && "CompositionEvent" in window, 8728 documentMode = null; 8729 canUseDOM && 8730 "documentMode" in document && 8731 (documentMode = document.documentMode); 8732 var canUseTextInputEvent = canUseDOM && "TextEvent" in window && !documentMode, 8733 useFallbackCompositionData = 8734 canUseDOM && 8735 (!canUseCompositionEvent || 8736 (documentMode && 8 < documentMode && 11 >= documentMode)), 8737 SPACEBAR_CHAR = String.fromCharCode(32), 8738 hasSpaceKeypress = false; 8739 function isFallbackCompositionEnd(domEventName, nativeEvent) { 8740 switch (domEventName) { 8741 case "keyup": 8742 return -1 !== END_KEYCODES.indexOf(nativeEvent.keyCode); 8743 case "keydown": 8744 return 229 !== nativeEvent.keyCode; 8745 case "keypress": 8746 case "mousedown": 8747 case "focusout": 8748 return true; 8749 default: 8750 return false; 8751 } 8752 } 8753 function getDataFromCustomEvent(nativeEvent) { 8754 nativeEvent = nativeEvent.detail; 8755 return "object" === typeof nativeEvent && "data" in nativeEvent 8756 ? nativeEvent.data 8757 : null; 8758 } 8759 var isComposing = false; 8760 function getNativeBeforeInputChars(domEventName, nativeEvent) { 8761 switch (domEventName) { 8762 case "compositionend": 8763 return getDataFromCustomEvent(nativeEvent); 8764 case "keypress": 8765 if (32 !== nativeEvent.which) return null; 8766 hasSpaceKeypress = true; 8767 return SPACEBAR_CHAR; 8768 case "textInput": 8769 return ( 8770 (domEventName = nativeEvent.data), 8771 domEventName === SPACEBAR_CHAR && hasSpaceKeypress ? null : domEventName 8772 ); 8773 default: 8774 return null; 8775 } 8776 } 8777 function getFallbackBeforeInputChars(domEventName, nativeEvent) { 8778 if (isComposing) 8779 return "compositionend" === domEventName || 8780 (!canUseCompositionEvent && 8781 isFallbackCompositionEnd(domEventName, nativeEvent)) 8782 ? ((domEventName = getData()), 8783 (fallbackText = startText = root = null), 8784 (isComposing = false), 8785 domEventName) 8786 : null; 8787 switch (domEventName) { 8788 case "paste": 8789 return null; 8790 case "keypress": 8791 if ( 8792 !(nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) || 8793 (nativeEvent.ctrlKey && nativeEvent.altKey) 8794 ) { 8795 if (nativeEvent.char && 1 < nativeEvent.char.length) 8796 return nativeEvent.char; 8797 if (nativeEvent.which) return String.fromCharCode(nativeEvent.which); 8798 } 8799 return null; 8800 case "compositionend": 8801 return useFallbackCompositionData && "ko" !== nativeEvent.locale 8802 ? null 8803 : nativeEvent.data; 8804 default: 8805 return null; 8806 } 8807 } 8808 var supportedInputTypes = { 8809 color: true, 8810 date: true, 8811 datetime: true, 8812 "datetime-local": true, 8813 email: true, 8814 month: true, 8815 number: true, 8816 password: true, 8817 range: true, 8818 search: true, 8819 tel: true, 8820 text: true, 8821 time: true, 8822 url: true, 8823 week: true 8824 }; 8825 function isTextInputElement(elem) { 8826 var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase(); 8827 return "input" === nodeName 8828 ? !!supportedInputTypes[elem.type] 8829 : "textarea" === nodeName 8830 ? true 8831 : false; 8832 } 8833 function createAndAccumulateChangeEvent( 8834 dispatchQueue, 8835 inst, 8836 nativeEvent, 8837 target 8838 ) { 8839 restoreTarget 8840 ? restoreQueue 8841 ? restoreQueue.push(target) 8842 : (restoreQueue = [target]) 8843 : (restoreTarget = target); 8844 inst = accumulateTwoPhaseListeners(inst, "onChange"); 8845 0 < inst.length && 8846 ((nativeEvent = new SyntheticEvent( 8847 "onChange", 8848 "change", 8849 null, 8850 nativeEvent, 8851 target 8852 )), 8853 dispatchQueue.push({ event: nativeEvent, listeners: inst })); 8854 } 8855 var activeElement$1 = null, 8856 activeElementInst$1 = null; 8857 function runEventInBatch(dispatchQueue) { 8858 processDispatchQueue(dispatchQueue, 0); 8859 } 8860 function getInstIfValueChanged(targetInst) { 8861 var targetNode = getNodeFromInstance(targetInst); 8862 if (updateValueIfChanged(targetNode)) return targetInst; 8863 } 8864 function getTargetInstForChangeEvent(domEventName, targetInst) { 8865 if ("change" === domEventName) return targetInst; 8866 } 8867 var isInputEventSupported = false; 8868 if (canUseDOM) { 8869 var JSCompiler_inline_result$jscomp$286; 8870 if (canUseDOM) { 8871 var isSupported$jscomp$inline_427 = "oninput" in document; 8872 if (!isSupported$jscomp$inline_427) { 8873 var element$jscomp$inline_428 = document.createElement("div"); 8874 element$jscomp$inline_428.setAttribute("oninput", "return;"); 8875 isSupported$jscomp$inline_427 = 8876 "function" === typeof element$jscomp$inline_428.oninput; 8877 } 8878 JSCompiler_inline_result$jscomp$286 = isSupported$jscomp$inline_427; 8879 } else JSCompiler_inline_result$jscomp$286 = false; 8880 isInputEventSupported = 8881 JSCompiler_inline_result$jscomp$286 && 8882 (!document.documentMode || 9 < document.documentMode); 8883 } 8884 function stopWatchingForValueChange() { 8885 activeElement$1 && 8886 (activeElement$1.detachEvent("onpropertychange", handlePropertyChange), 8887 (activeElementInst$1 = activeElement$1 = null)); 8888 } 8889 function handlePropertyChange(nativeEvent) { 8890 if ( 8891 "value" === nativeEvent.propertyName && 8892 getInstIfValueChanged(activeElementInst$1) 8893 ) { 8894 var dispatchQueue = []; 8895 createAndAccumulateChangeEvent( 8896 dispatchQueue, 8897 activeElementInst$1, 8898 nativeEvent, 8899 getEventTarget(nativeEvent) 8900 ); 8901 batchedUpdates$1(runEventInBatch, dispatchQueue); 8902 } 8903 } 8904 function handleEventsForInputEventPolyfill(domEventName, target, targetInst) { 8905 "focusin" === domEventName 8906 ? (stopWatchingForValueChange(), 8907 (activeElement$1 = target), 8908 (activeElementInst$1 = targetInst), 8909 activeElement$1.attachEvent("onpropertychange", handlePropertyChange)) 8910 : "focusout" === domEventName && stopWatchingForValueChange(); 8911 } 8912 function getTargetInstForInputEventPolyfill(domEventName) { 8913 if ( 8914 "selectionchange" === domEventName || 8915 "keyup" === domEventName || 8916 "keydown" === domEventName 8917 ) 8918 return getInstIfValueChanged(activeElementInst$1); 8919 } 8920 function getTargetInstForClickEvent(domEventName, targetInst) { 8921 if ("click" === domEventName) return getInstIfValueChanged(targetInst); 8922 } 8923 function getTargetInstForInputOrChangeEvent(domEventName, targetInst) { 8924 if ("input" === domEventName || "change" === domEventName) 8925 return getInstIfValueChanged(targetInst); 8926 } 8927 function is(x, y) { 8928 return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y); 8929 } 8930 var objectIs = "function" === typeof Object.is ? Object.is : is; 8931 function shallowEqual(objA, objB) { 8932 if (objectIs(objA, objB)) return true; 8933 if ( 8934 "object" !== typeof objA || 8935 null === objA || 8936 "object" !== typeof objB || 8937 null === objB 8938 ) 8939 return false; 8940 var keysA = Object.keys(objA), 8941 keysB = Object.keys(objB); 8942 if (keysA.length !== keysB.length) return false; 8943 for (keysB = 0; keysB < keysA.length; keysB++) { 8944 var currentKey = keysA[keysB]; 8945 if ( 8946 !hasOwnProperty.call(objB, currentKey) || 8947 !objectIs(objA[currentKey], objB[currentKey]) 8948 ) 8949 return false; 8950 } 8951 return true; 8952 } 8953 function getLeafNode(node) { 8954 for (; node && node.firstChild; ) node = node.firstChild; 8955 return node; 8956 } 8957 function getNodeForCharacterOffset(root, offset) { 8958 var node = getLeafNode(root); 8959 root = 0; 8960 for (var nodeEnd; node; ) { 8961 if (3 === node.nodeType) { 8962 nodeEnd = root + node.textContent.length; 8963 if (root <= offset && nodeEnd >= offset) 8964 return { node: node, offset: offset - root }; 8965 root = nodeEnd; 8966 } 8967 a: { 8968 for (; node; ) { 8969 if (node.nextSibling) { 8970 node = node.nextSibling; 8971 break a; 8972 } 8973 node = node.parentNode; 8974 } 8975 node = void 0; 8976 } 8977 node = getLeafNode(node); 8978 } 8979 } 8980 function containsNode(outerNode, innerNode) { 8981 return outerNode && innerNode 8982 ? outerNode === innerNode 8983 ? true 8984 : outerNode && 3 === outerNode.nodeType 8985 ? false 8986 : innerNode && 3 === innerNode.nodeType 8987 ? containsNode(outerNode, innerNode.parentNode) 8988 : "contains" in outerNode 8989 ? outerNode.contains(innerNode) 8990 : outerNode.compareDocumentPosition 8991 ? !!(outerNode.compareDocumentPosition(innerNode) & 16) 8992 : false 8993 : false; 8994 } 8995 function getActiveElementDeep(containerInfo) { 8996 containerInfo = 8997 null != containerInfo && 8998 null != containerInfo.ownerDocument && 8999 null != containerInfo.ownerDocument.defaultView 9000 ? containerInfo.ownerDocument.defaultView 9001 : window; 9002 for ( 9003 var element = getActiveElement(containerInfo.document); 9004 element instanceof containerInfo.HTMLIFrameElement; 9005 9006 ) { 9007 try { 9008 var JSCompiler_inline_result = 9009 "string" === typeof element.contentWindow.location.href; 9010 } catch (err) { 9011 JSCompiler_inline_result = false; 9012 } 9013 if (JSCompiler_inline_result) containerInfo = element.contentWindow; 9014 else break; 9015 element = getActiveElement(containerInfo.document); 9016 } 9017 return element; 9018 } 9019 function hasSelectionCapabilities(elem) { 9020 var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase(); 9021 return ( 9022 nodeName && 9023 (("input" === nodeName && 9024 ("text" === elem.type || 9025 "search" === elem.type || 9026 "tel" === elem.type || 9027 "url" === elem.type || 9028 "password" === elem.type)) || 9029 "textarea" === nodeName || 9030 "true" === elem.contentEditable) 9031 ); 9032 } 9033 var skipSelectionChangeEvent = 9034 canUseDOM && "documentMode" in document && 11 >= document.documentMode, 9035 activeElement = null, 9036 activeElementInst = null, 9037 lastSelection = null, 9038 mouseDown = false; 9039 function constructSelectEvent(dispatchQueue, nativeEvent, nativeEventTarget) { 9040 var doc = 9041 nativeEventTarget.window === nativeEventTarget 9042 ? nativeEventTarget.document 9043 : 9 === nativeEventTarget.nodeType 9044 ? nativeEventTarget 9045 : nativeEventTarget.ownerDocument; 9046 mouseDown || 9047 null == activeElement || 9048 activeElement !== getActiveElement(doc) || 9049 ((doc = activeElement), 9050 "selectionStart" in doc && hasSelectionCapabilities(doc) 9051 ? (doc = { start: doc.selectionStart, end: doc.selectionEnd }) 9052 : ((doc = ( 9053 (doc.ownerDocument && doc.ownerDocument.defaultView) || 9054 window 9055 ).getSelection()), 9056 (doc = { 9057 anchorNode: doc.anchorNode, 9058 anchorOffset: doc.anchorOffset, 9059 focusNode: doc.focusNode, 9060 focusOffset: doc.focusOffset 9061 })), 9062 (lastSelection && shallowEqual(lastSelection, doc)) || 9063 ((lastSelection = doc), 9064 (doc = accumulateTwoPhaseListeners(activeElementInst, "onSelect")), 9065 0 < doc.length && 9066 ((nativeEvent = new SyntheticEvent( 9067 "onSelect", 9068 "select", 9069 null, 9070 nativeEvent, 9071 nativeEventTarget 9072 )), 9073 dispatchQueue.push({ event: nativeEvent, listeners: doc }), 9074 (nativeEvent.target = activeElement)))); 9075 } 9076 function makePrefixMap(styleProp, eventName) { 9077 var prefixes = {}; 9078 prefixes[styleProp.toLowerCase()] = eventName.toLowerCase(); 9079 prefixes["Webkit" + styleProp] = "webkit" + eventName; 9080 prefixes["Moz" + styleProp] = "moz" + eventName; 9081 return prefixes; 9082 } 9083 var vendorPrefixes = { 9084 animationend: makePrefixMap("Animation", "AnimationEnd"), 9085 animationiteration: makePrefixMap("Animation", "AnimationIteration"), 9086 animationstart: makePrefixMap("Animation", "AnimationStart"), 9087 transitionrun: makePrefixMap("Transition", "TransitionRun"), 9088 transitionstart: makePrefixMap("Transition", "TransitionStart"), 9089 transitioncancel: makePrefixMap("Transition", "TransitionCancel"), 9090 transitionend: makePrefixMap("Transition", "TransitionEnd") 9091 }, 9092 prefixedEventNames = {}, 9093 style = {}; 9094 canUseDOM && 9095 ((style = document.createElement("div").style), 9096 "AnimationEvent" in window || 9097 (delete vendorPrefixes.animationend.animation, 9098 delete vendorPrefixes.animationiteration.animation, 9099 delete vendorPrefixes.animationstart.animation), 9100 "TransitionEvent" in window || 9101 delete vendorPrefixes.transitionend.transition); 9102 function getVendorPrefixedEventName(eventName) { 9103 if (prefixedEventNames[eventName]) return prefixedEventNames[eventName]; 9104 if (!vendorPrefixes[eventName]) return eventName; 9105 var prefixMap = vendorPrefixes[eventName], 9106 styleProp; 9107 for (styleProp in prefixMap) 9108 if (prefixMap.hasOwnProperty(styleProp) && styleProp in style) 9109 return (prefixedEventNames[eventName] = prefixMap[styleProp]); 9110 return eventName; 9111 } 9112 var ANIMATION_END = getVendorPrefixedEventName("animationend"), 9113 ANIMATION_ITERATION = getVendorPrefixedEventName("animationiteration"), 9114 ANIMATION_START = getVendorPrefixedEventName("animationstart"), 9115 TRANSITION_RUN = getVendorPrefixedEventName("transitionrun"), 9116 TRANSITION_START = getVendorPrefixedEventName("transitionstart"), 9117 TRANSITION_CANCEL = getVendorPrefixedEventName("transitioncancel"), 9118 TRANSITION_END = getVendorPrefixedEventName("transitionend"), 9119 topLevelEventsToReactNames = new Map(), 9120 simpleEventPluginEvents = 9121 "abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split( 9122 " " 9123 ); 9124 simpleEventPluginEvents.push("scrollEnd"); 9125 function registerSimpleEvent(domEventName, reactName) { 9126 topLevelEventsToReactNames.set(domEventName, reactName); 9127 registerTwoPhaseEvent(reactName, [domEventName]); 9128 } 9129 var reportGlobalError = 9130 "function" === typeof reportError 9131 ? reportError 9132 : function (error) { 9133 if ( 9134 "object" === typeof window && 9135 "function" === typeof window.ErrorEvent 9136 ) { 9137 var event = new window.ErrorEvent("error", { 9138 bubbles: true, 9139 cancelable: true, 9140 message: 9141 "object" === typeof error && 9142 null !== error && 9143 "string" === typeof error.message 9144 ? String(error.message) 9145 : String(error), 9146 error: error 9147 }); 9148 if (!window.dispatchEvent(event)) return; 9149 } else if ( 9150 "object" === typeof process && 9151 "function" === typeof process.emit 9152 ) { 9153 process.emit("uncaughtException", error); 9154 return; 9155 } 9156 console.error(error); 9157 }, 9158 concurrentQueues = [], 9159 concurrentQueuesIndex = 0, 9160 concurrentlyUpdatedLanes = 0; 9161 function finishQueueingConcurrentUpdates() { 9162 for ( 9163 var endIndex = concurrentQueuesIndex, 9164 i = (concurrentlyUpdatedLanes = concurrentQueuesIndex = 0); 9165 i < endIndex; 9166 9167 ) { 9168 var fiber = concurrentQueues[i]; 9169 concurrentQueues[i++] = null; 9170 var queue = concurrentQueues[i]; 9171 concurrentQueues[i++] = null; 9172 var update = concurrentQueues[i]; 9173 concurrentQueues[i++] = null; 9174 var lane = concurrentQueues[i]; 9175 concurrentQueues[i++] = null; 9176 if (null !== queue && null !== update) { 9177 var pending = queue.pending; 9178 null === pending 9179 ? (update.next = update) 9180 : ((update.next = pending.next), (pending.next = update)); 9181 queue.pending = update; 9182 } 9183 0 !== lane && markUpdateLaneFromFiberToRoot(fiber, update, lane); 9184 } 9185 } 9186 function enqueueUpdate$1(fiber, queue, update, lane) { 9187 concurrentQueues[concurrentQueuesIndex++] = fiber; 9188 concurrentQueues[concurrentQueuesIndex++] = queue; 9189 concurrentQueues[concurrentQueuesIndex++] = update; 9190 concurrentQueues[concurrentQueuesIndex++] = lane; 9191 concurrentlyUpdatedLanes |= lane; 9192 fiber.lanes |= lane; 9193 fiber = fiber.alternate; 9194 null !== fiber && (fiber.lanes |= lane); 9195 } 9196 function enqueueConcurrentHookUpdate(fiber, queue, update, lane) { 9197 enqueueUpdate$1(fiber, queue, update, lane); 9198 return getRootForUpdatedFiber(fiber); 9199 } 9200 function enqueueConcurrentRenderForLane(fiber, lane) { 9201 enqueueUpdate$1(fiber, null, null, lane); 9202 return getRootForUpdatedFiber(fiber); 9203 } 9204 function markUpdateLaneFromFiberToRoot(sourceFiber, update, lane) { 9205 sourceFiber.lanes |= lane; 9206 var alternate = sourceFiber.alternate; 9207 null !== alternate && (alternate.lanes |= lane); 9208 for (var isHidden = false, parent = sourceFiber.return; null !== parent; ) 9209 (parent.childLanes |= lane), 9210 (alternate = parent.alternate), 9211 null !== alternate && (alternate.childLanes |= lane), 9212 22 === parent.tag && 9213 ((sourceFiber = parent.stateNode), 9214 null === sourceFiber || sourceFiber._visibility & 1 || (isHidden = true)), 9215 (sourceFiber = parent), 9216 (parent = parent.return); 9217 return 3 === sourceFiber.tag 9218 ? ((parent = sourceFiber.stateNode), 9219 isHidden && 9220 null !== update && 9221 ((isHidden = 31 - clz32(lane)), 9222 (sourceFiber = parent.hiddenUpdates), 9223 (alternate = sourceFiber[isHidden]), 9224 null === alternate 9225 ? (sourceFiber[isHidden] = [update]) 9226 : alternate.push(update), 9227 (update.lane = lane | 536870912)), 9228 parent) 9229 : null; 9230 } 9231 function getRootForUpdatedFiber(sourceFiber) { 9232 if (50 < nestedUpdateCount) 9233 throw ( 9234 ((nestedUpdateCount = 0), 9235 (rootWithNestedUpdates = null), 9236 Error(formatProdErrorMessage(185))) 9237 ); 9238 for (var parent = sourceFiber.return; null !== parent; ) 9239 (sourceFiber = parent), (parent = sourceFiber.return); 9240 return 3 === sourceFiber.tag ? sourceFiber.stateNode : null; 9241 } 9242 var emptyContextObject = {}; 9243 function FiberNode(tag, pendingProps, key, mode) { 9244 this.tag = tag; 9245 this.key = key; 9246 this.sibling = 9247 this.child = 9248 this.return = 9249 this.stateNode = 9250 this.type = 9251 this.elementType = 9252 null; 9253 this.index = 0; 9254 this.refCleanup = this.ref = null; 9255 this.pendingProps = pendingProps; 9256 this.dependencies = 9257 this.memoizedState = 9258 this.updateQueue = 9259 this.memoizedProps = 9260 null; 9261 this.mode = mode; 9262 this.subtreeFlags = this.flags = 0; 9263 this.deletions = null; 9264 this.childLanes = this.lanes = 0; 9265 this.alternate = null; 9266 } 9267 function createFiberImplClass(tag, pendingProps, key, mode) { 9268 return new FiberNode(tag, pendingProps, key, mode); 9269 } 9270 function shouldConstruct(Component) { 9271 Component = Component.prototype; 9272 return !(!Component || !Component.isReactComponent); 9273 } 9274 function createWorkInProgress(current, pendingProps) { 9275 var workInProgress = current.alternate; 9276 null === workInProgress 9277 ? ((workInProgress = createFiberImplClass( 9278 current.tag, 9279 pendingProps, 9280 current.key, 9281 current.mode 9282 )), 9283 (workInProgress.elementType = current.elementType), 9284 (workInProgress.type = current.type), 9285 (workInProgress.stateNode = current.stateNode), 9286 (workInProgress.alternate = current), 9287 (current.alternate = workInProgress)) 9288 : ((workInProgress.pendingProps = pendingProps), 9289 (workInProgress.type = current.type), 9290 (workInProgress.flags = 0), 9291 (workInProgress.subtreeFlags = 0), 9292 (workInProgress.deletions = null)); 9293 workInProgress.flags = current.flags & 65011712; 9294 workInProgress.childLanes = current.childLanes; 9295 workInProgress.lanes = current.lanes; 9296 workInProgress.child = current.child; 9297 workInProgress.memoizedProps = current.memoizedProps; 9298 workInProgress.memoizedState = current.memoizedState; 9299 workInProgress.updateQueue = current.updateQueue; 9300 pendingProps = current.dependencies; 9301 workInProgress.dependencies = 9302 null === pendingProps 9303 ? null 9304 : { lanes: pendingProps.lanes, firstContext: pendingProps.firstContext }; 9305 workInProgress.sibling = current.sibling; 9306 workInProgress.index = current.index; 9307 workInProgress.ref = current.ref; 9308 workInProgress.refCleanup = current.refCleanup; 9309 return workInProgress; 9310 } 9311 function resetWorkInProgress(workInProgress, renderLanes) { 9312 workInProgress.flags &= 65011714; 9313 var current = workInProgress.alternate; 9314 null === current 9315 ? ((workInProgress.childLanes = 0), 9316 (workInProgress.lanes = renderLanes), 9317 (workInProgress.child = null), 9318 (workInProgress.subtreeFlags = 0), 9319 (workInProgress.memoizedProps = null), 9320 (workInProgress.memoizedState = null), 9321 (workInProgress.updateQueue = null), 9322 (workInProgress.dependencies = null), 9323 (workInProgress.stateNode = null)) 9324 : ((workInProgress.childLanes = current.childLanes), 9325 (workInProgress.lanes = current.lanes), 9326 (workInProgress.child = current.child), 9327 (workInProgress.subtreeFlags = 0), 9328 (workInProgress.deletions = null), 9329 (workInProgress.memoizedProps = current.memoizedProps), 9330 (workInProgress.memoizedState = current.memoizedState), 9331 (workInProgress.updateQueue = current.updateQueue), 9332 (workInProgress.type = current.type), 9333 (renderLanes = current.dependencies), 9334 (workInProgress.dependencies = 9335 null === renderLanes 9336 ? null 9337 : { 9338 lanes: renderLanes.lanes, 9339 firstContext: renderLanes.firstContext 9340 })); 9341 return workInProgress; 9342 } 9343 function createFiberFromTypeAndProps( 9344 type, 9345 key, 9346 pendingProps, 9347 owner, 9348 mode, 9349 lanes 9350 ) { 9351 var fiberTag = 0; 9352 owner = type; 9353 if ("function" === typeof type) shouldConstruct(type) && (fiberTag = 1); 9354 else if ("string" === typeof type) 9355 fiberTag = isHostHoistableType( 9356 type, 9357 pendingProps, 9358 contextStackCursor.current 9359 ) 9360 ? 26 9361 : "html" === type || "head" === type || "body" === type 9362 ? 27 9363 : 5; 9364 else 9365 a: switch (type) { 9366 case REACT_ACTIVITY_TYPE: 9367 return ( 9368 (type = createFiberImplClass(31, pendingProps, key, mode)), 9369 (type.elementType = REACT_ACTIVITY_TYPE), 9370 (type.lanes = lanes), 9371 type 9372 ); 9373 case REACT_FRAGMENT_TYPE: 9374 return createFiberFromFragment(pendingProps.children, mode, lanes, key); 9375 case REACT_STRICT_MODE_TYPE: 9376 fiberTag = 8; 9377 mode |= 24; 9378 break; 9379 case REACT_PROFILER_TYPE: 9380 return ( 9381 (type = createFiberImplClass(12, pendingProps, key, mode | 2)), 9382 (type.elementType = REACT_PROFILER_TYPE), 9383 (type.lanes = lanes), 9384 type 9385 ); 9386 case REACT_SUSPENSE_TYPE: 9387 return ( 9388 (type = createFiberImplClass(13, pendingProps, key, mode)), 9389 (type.elementType = REACT_SUSPENSE_TYPE), 9390 (type.lanes = lanes), 9391 type 9392 ); 9393 case REACT_SUSPENSE_LIST_TYPE: 9394 return ( 9395 (type = createFiberImplClass(19, pendingProps, key, mode)), 9396 (type.elementType = REACT_SUSPENSE_LIST_TYPE), 9397 (type.lanes = lanes), 9398 type 9399 ); 9400 default: 9401 if ("object" === typeof type && null !== type) 9402 switch (type.$$typeof) { 9403 case REACT_CONTEXT_TYPE: 9404 fiberTag = 10; 9405 break a; 9406 case REACT_CONSUMER_TYPE: 9407 fiberTag = 9; 9408 break a; 9409 case REACT_FORWARD_REF_TYPE: 9410 fiberTag = 11; 9411 break a; 9412 case REACT_MEMO_TYPE: 9413 fiberTag = 14; 9414 break a; 9415 case REACT_LAZY_TYPE: 9416 fiberTag = 16; 9417 owner = null; 9418 break a; 9419 } 9420 fiberTag = 29; 9421 pendingProps = Error( 9422 formatProdErrorMessage(130, null === type ? "null" : typeof type, "") 9423 ); 9424 owner = null; 9425 } 9426 key = createFiberImplClass(fiberTag, pendingProps, key, mode); 9427 key.elementType = type; 9428 key.type = owner; 9429 key.lanes = lanes; 9430 return key; 9431 } 9432 function createFiberFromFragment(elements, mode, lanes, key) { 9433 elements = createFiberImplClass(7, elements, key, mode); 9434 elements.lanes = lanes; 9435 return elements; 9436 } 9437 function createFiberFromText(content, mode, lanes) { 9438 content = createFiberImplClass(6, content, null, mode); 9439 content.lanes = lanes; 9440 return content; 9441 } 9442 function createFiberFromDehydratedFragment(dehydratedNode) { 9443 var fiber = createFiberImplClass(18, null, null, 0); 9444 fiber.stateNode = dehydratedNode; 9445 return fiber; 9446 } 9447 function createFiberFromPortal(portal, mode, lanes) { 9448 mode = createFiberImplClass( 9449 4, 9450 null !== portal.children ? portal.children : [], 9451 portal.key, 9452 mode 9453 ); 9454 mode.lanes = lanes; 9455 mode.stateNode = { 9456 containerInfo: portal.containerInfo, 9457 pendingChildren: null, 9458 implementation: portal.implementation 9459 }; 9460 return mode; 9461 } 9462 var CapturedStacks = new WeakMap(); 9463 function createCapturedValueAtFiber(value, source) { 9464 if ("object" === typeof value && null !== value) { 9465 var existing = CapturedStacks.get(value); 9466 if (void 0 !== existing) return existing; 9467 source = { 9468 value: value, 9469 source: source, 9470 stack: getStackByFiberInDevAndProd(source) 9471 }; 9472 CapturedStacks.set(value, source); 9473 return source; 9474 } 9475 return { 9476 value: value, 9477 source: source, 9478 stack: getStackByFiberInDevAndProd(source) 9479 }; 9480 } 9481 var forkStack = [], 9482 forkStackIndex = 0, 9483 treeForkProvider = null, 9484 treeForkCount = 0, 9485 idStack = [], 9486 idStackIndex = 0, 9487 treeContextProvider = null, 9488 treeContextId = 1, 9489 treeContextOverflow = ""; 9490 function pushTreeFork(workInProgress, totalChildren) { 9491 forkStack[forkStackIndex++] = treeForkCount; 9492 forkStack[forkStackIndex++] = treeForkProvider; 9493 treeForkProvider = workInProgress; 9494 treeForkCount = totalChildren; 9495 } 9496 function pushTreeId(workInProgress, totalChildren, index) { 9497 idStack[idStackIndex++] = treeContextId; 9498 idStack[idStackIndex++] = treeContextOverflow; 9499 idStack[idStackIndex++] = treeContextProvider; 9500 treeContextProvider = workInProgress; 9501 var baseIdWithLeadingBit = treeContextId; 9502 workInProgress = treeContextOverflow; 9503 var baseLength = 32 - clz32(baseIdWithLeadingBit) - 1; 9504 baseIdWithLeadingBit &= ~(1 << baseLength); 9505 index += 1; 9506 var length = 32 - clz32(totalChildren) + baseLength; 9507 if (30 < length) { 9508 var numberOfOverflowBits = baseLength - (baseLength % 5); 9509 length = ( 9510 baseIdWithLeadingBit & 9511 ((1 << numberOfOverflowBits) - 1) 9512 ).toString(32); 9513 baseIdWithLeadingBit >>= numberOfOverflowBits; 9514 baseLength -= numberOfOverflowBits; 9515 treeContextId = 9516 (1 << (32 - clz32(totalChildren) + baseLength)) | 9517 (index << baseLength) | 9518 baseIdWithLeadingBit; 9519 treeContextOverflow = length + workInProgress; 9520 } else 9521 (treeContextId = 9522 (1 << length) | (index << baseLength) | baseIdWithLeadingBit), 9523 (treeContextOverflow = workInProgress); 9524 } 9525 function pushMaterializedTreeId(workInProgress) { 9526 null !== workInProgress.return && 9527 (pushTreeFork(workInProgress, 1), pushTreeId(workInProgress, 1, 0)); 9528 } 9529 function popTreeContext(workInProgress) { 9530 for (; workInProgress === treeForkProvider; ) 9531 (treeForkProvider = forkStack[--forkStackIndex]), 9532 (forkStack[forkStackIndex] = null), 9533 (treeForkCount = forkStack[--forkStackIndex]), 9534 (forkStack[forkStackIndex] = null); 9535 for (; workInProgress === treeContextProvider; ) 9536 (treeContextProvider = idStack[--idStackIndex]), 9537 (idStack[idStackIndex] = null), 9538 (treeContextOverflow = idStack[--idStackIndex]), 9539 (idStack[idStackIndex] = null), 9540 (treeContextId = idStack[--idStackIndex]), 9541 (idStack[idStackIndex] = null); 9542 } 9543 function restoreSuspendedTreeContext(workInProgress, suspendedContext) { 9544 idStack[idStackIndex++] = treeContextId; 9545 idStack[idStackIndex++] = treeContextOverflow; 9546 idStack[idStackIndex++] = treeContextProvider; 9547 treeContextId = suspendedContext.id; 9548 treeContextOverflow = suspendedContext.overflow; 9549 treeContextProvider = workInProgress; 9550 } 9551 var hydrationParentFiber = null, 9552 nextHydratableInstance = null, 9553 isHydrating = false, 9554 hydrationErrors = null, 9555 rootOrSingletonContext = false, 9556 HydrationMismatchException = Error(formatProdErrorMessage(519)); 9557 function throwOnHydrationMismatch(fiber) { 9558 var error = Error( 9559 formatProdErrorMessage( 9560 418, 9561 1 < arguments.length && void 0 !== arguments[1] && arguments[1] 9562 ? "text" 9563 : "HTML", 9564 "" 9565 ) 9566 ); 9567 queueHydrationError(createCapturedValueAtFiber(error, fiber)); 9568 throw HydrationMismatchException; 9569 } 9570 function prepareToHydrateHostInstance(fiber) { 9571 var instance = fiber.stateNode, 9572 type = fiber.type, 9573 props = fiber.memoizedProps; 9574 instance[internalInstanceKey] = fiber; 9575 instance[internalPropsKey] = props; 9576 switch (type) { 9577 case "dialog": 9578 listenToNonDelegatedEvent("cancel", instance); 9579 listenToNonDelegatedEvent("close", instance); 9580 break; 9581 case "iframe": 9582 case "object": 9583 case "embed": 9584 listenToNonDelegatedEvent("load", instance); 9585 break; 9586 case "video": 9587 case "audio": 9588 for (type = 0; type < mediaEventTypes.length; type++) 9589 listenToNonDelegatedEvent(mediaEventTypes[type], instance); 9590 break; 9591 case "source": 9592 listenToNonDelegatedEvent("error", instance); 9593 break; 9594 case "img": 9595 case "image": 9596 case "link": 9597 listenToNonDelegatedEvent("error", instance); 9598 listenToNonDelegatedEvent("load", instance); 9599 break; 9600 case "details": 9601 listenToNonDelegatedEvent("toggle", instance); 9602 break; 9603 case "input": 9604 listenToNonDelegatedEvent("invalid", instance); 9605 initInput( 9606 instance, 9607 props.value, 9608 props.defaultValue, 9609 props.checked, 9610 props.defaultChecked, 9611 props.type, 9612 props.name, 9613 true 9614 ); 9615 break; 9616 case "select": 9617 listenToNonDelegatedEvent("invalid", instance); 9618 break; 9619 case "textarea": 9620 listenToNonDelegatedEvent("invalid", instance), 9621 initTextarea(instance, props.value, props.defaultValue, props.children); 9622 } 9623 type = props.children; 9624 ("string" !== typeof type && 9625 "number" !== typeof type && 9626 "bigint" !== typeof type) || 9627 instance.textContent === "" + type || 9628 true === props.suppressHydrationWarning || 9629 checkForUnmatchedText(instance.textContent, type) 9630 ? (null != props.popover && 9631 (listenToNonDelegatedEvent("beforetoggle", instance), 9632 listenToNonDelegatedEvent("toggle", instance)), 9633 null != props.onScroll && listenToNonDelegatedEvent("scroll", instance), 9634 null != props.onScrollEnd && 9635 listenToNonDelegatedEvent("scrollend", instance), 9636 null != props.onClick && (instance.onclick = noop$1), 9637 (instance = true)) 9638 : (instance = false); 9639 instance || throwOnHydrationMismatch(fiber, true); 9640 } 9641 function popToNextHostParent(fiber) { 9642 for (hydrationParentFiber = fiber.return; hydrationParentFiber; ) 9643 switch (hydrationParentFiber.tag) { 9644 case 5: 9645 case 31: 9646 case 13: 9647 rootOrSingletonContext = false; 9648 return; 9649 case 27: 9650 case 3: 9651 rootOrSingletonContext = true; 9652 return; 9653 default: 9654 hydrationParentFiber = hydrationParentFiber.return; 9655 } 9656 } 9657 function popHydrationState(fiber) { 9658 if (fiber !== hydrationParentFiber) return false; 9659 if (!isHydrating) return popToNextHostParent(fiber), (isHydrating = true), false; 9660 var tag = fiber.tag, 9661 JSCompiler_temp; 9662 if ((JSCompiler_temp = 3 !== tag && 27 !== tag)) { 9663 if ((JSCompiler_temp = 5 === tag)) 9664 (JSCompiler_temp = fiber.type), 9665 (JSCompiler_temp = 9666 !("form" !== JSCompiler_temp && "button" !== JSCompiler_temp) || 9667 shouldSetTextContent(fiber.type, fiber.memoizedProps)); 9668 JSCompiler_temp = !JSCompiler_temp; 9669 } 9670 JSCompiler_temp && nextHydratableInstance && throwOnHydrationMismatch(fiber); 9671 popToNextHostParent(fiber); 9672 if (13 === tag) { 9673 fiber = fiber.memoizedState; 9674 fiber = null !== fiber ? fiber.dehydrated : null; 9675 if (!fiber) throw Error(formatProdErrorMessage(317)); 9676 nextHydratableInstance = 9677 getNextHydratableInstanceAfterHydrationBoundary(fiber); 9678 } else if (31 === tag) { 9679 fiber = fiber.memoizedState; 9680 fiber = null !== fiber ? fiber.dehydrated : null; 9681 if (!fiber) throw Error(formatProdErrorMessage(317)); 9682 nextHydratableInstance = 9683 getNextHydratableInstanceAfterHydrationBoundary(fiber); 9684 } else 9685 27 === tag 9686 ? ((tag = nextHydratableInstance), 9687 isSingletonScope(fiber.type) 9688 ? ((fiber = previousHydratableOnEnteringScopedSingleton), 9689 (previousHydratableOnEnteringScopedSingleton = null), 9690 (nextHydratableInstance = fiber)) 9691 : (nextHydratableInstance = tag)) 9692 : (nextHydratableInstance = hydrationParentFiber 9693 ? getNextHydratable(fiber.stateNode.nextSibling) 9694 : null); 9695 return true; 9696 } 9697 function resetHydrationState() { 9698 nextHydratableInstance = hydrationParentFiber = null; 9699 isHydrating = false; 9700 } 9701 function upgradeHydrationErrorsToRecoverable() { 9702 var queuedErrors = hydrationErrors; 9703 null !== queuedErrors && 9704 (null === workInProgressRootRecoverableErrors 9705 ? (workInProgressRootRecoverableErrors = queuedErrors) 9706 : workInProgressRootRecoverableErrors.push.apply( 9707 workInProgressRootRecoverableErrors, 9708 queuedErrors 9709 ), 9710 (hydrationErrors = null)); 9711 return queuedErrors; 9712 } 9713 function queueHydrationError(error) { 9714 null === hydrationErrors 9715 ? (hydrationErrors = [error]) 9716 : hydrationErrors.push(error); 9717 } 9718 var valueCursor = createCursor(null), 9719 currentlyRenderingFiber$1 = null, 9720 lastContextDependency = null; 9721 function pushProvider(providerFiber, context, nextValue) { 9722 push(valueCursor, context._currentValue); 9723 context._currentValue = nextValue; 9724 } 9725 function popProvider(context) { 9726 context._currentValue = valueCursor.current; 9727 pop(valueCursor); 9728 } 9729 function scheduleContextWorkOnParentPath(parent, renderLanes, propagationRoot) { 9730 for (; null !== parent; ) { 9731 var alternate = parent.alternate; 9732 (parent.childLanes & renderLanes) !== renderLanes 9733 ? ((parent.childLanes |= renderLanes), 9734 null !== alternate && (alternate.childLanes |= renderLanes)) 9735 : null !== alternate && 9736 (alternate.childLanes & renderLanes) !== renderLanes && 9737 (alternate.childLanes |= renderLanes); 9738 if (parent === propagationRoot) break; 9739 parent = parent.return; 9740 } 9741 } 9742 function propagateContextChanges( 9743 workInProgress, 9744 contexts, 9745 renderLanes, 9746 forcePropagateEntireTree 9747 ) { 9748 var fiber = workInProgress.child; 9749 null !== fiber && (fiber.return = workInProgress); 9750 for (; null !== fiber; ) { 9751 var list = fiber.dependencies; 9752 if (null !== list) { 9753 var nextFiber = fiber.child; 9754 list = list.firstContext; 9755 a: for (; null !== list; ) { 9756 var dependency = list; 9757 list = fiber; 9758 for (var i = 0; i < contexts.length; i++) 9759 if (dependency.context === contexts[i]) { 9760 list.lanes |= renderLanes; 9761 dependency = list.alternate; 9762 null !== dependency && (dependency.lanes |= renderLanes); 9763 scheduleContextWorkOnParentPath( 9764 list.return, 9765 renderLanes, 9766 workInProgress 9767 ); 9768 forcePropagateEntireTree || (nextFiber = null); 9769 break a; 9770 } 9771 list = dependency.next; 9772 } 9773 } else if (18 === fiber.tag) { 9774 nextFiber = fiber.return; 9775 if (null === nextFiber) throw Error(formatProdErrorMessage(341)); 9776 nextFiber.lanes |= renderLanes; 9777 list = nextFiber.alternate; 9778 null !== list && (list.lanes |= renderLanes); 9779 scheduleContextWorkOnParentPath(nextFiber, renderLanes, workInProgress); 9780 nextFiber = null; 9781 } else nextFiber = fiber.child; 9782 if (null !== nextFiber) nextFiber.return = fiber; 9783 else 9784 for (nextFiber = fiber; null !== nextFiber; ) { 9785 if (nextFiber === workInProgress) { 9786 nextFiber = null; 9787 break; 9788 } 9789 fiber = nextFiber.sibling; 9790 if (null !== fiber) { 9791 fiber.return = nextFiber.return; 9792 nextFiber = fiber; 9793 break; 9794 } 9795 nextFiber = nextFiber.return; 9796 } 9797 fiber = nextFiber; 9798 } 9799 } 9800 function propagateParentContextChanges( 9801 current, 9802 workInProgress, 9803 renderLanes, 9804 forcePropagateEntireTree 9805 ) { 9806 current = null; 9807 for ( 9808 var parent = workInProgress, isInsidePropagationBailout = false; 9809 null !== parent; 9810 9811 ) { 9812 if (!isInsidePropagationBailout) 9813 if (0 !== (parent.flags & 524288)) isInsidePropagationBailout = true; 9814 else if (0 !== (parent.flags & 262144)) break; 9815 if (10 === parent.tag) { 9816 var currentParent = parent.alternate; 9817 if (null === currentParent) throw Error(formatProdErrorMessage(387)); 9818 currentParent = currentParent.memoizedProps; 9819 if (null !== currentParent) { 9820 var context = parent.type; 9821 objectIs(parent.pendingProps.value, currentParent.value) || 9822 (null !== current ? current.push(context) : (current = [context])); 9823 } 9824 } else if (parent === hostTransitionProviderCursor.current) { 9825 currentParent = parent.alternate; 9826 if (null === currentParent) throw Error(formatProdErrorMessage(387)); 9827 currentParent.memoizedState.memoizedState !== 9828 parent.memoizedState.memoizedState && 9829 (null !== current 9830 ? current.push(HostTransitionContext) 9831 : (current = [HostTransitionContext])); 9832 } 9833 parent = parent.return; 9834 } 9835 null !== current && 9836 propagateContextChanges( 9837 workInProgress, 9838 current, 9839 renderLanes, 9840 forcePropagateEntireTree 9841 ); 9842 workInProgress.flags |= 262144; 9843 } 9844 function checkIfContextChanged(currentDependencies) { 9845 for ( 9846 currentDependencies = currentDependencies.firstContext; 9847 null !== currentDependencies; 9848 9849 ) { 9850 if ( 9851 !objectIs( 9852 currentDependencies.context._currentValue, 9853 currentDependencies.memoizedValue 9854 ) 9855 ) 9856 return true; 9857 currentDependencies = currentDependencies.next; 9858 } 9859 return false; 9860 } 9861 function prepareToReadContext(workInProgress) { 9862 currentlyRenderingFiber$1 = workInProgress; 9863 lastContextDependency = null; 9864 workInProgress = workInProgress.dependencies; 9865 null !== workInProgress && (workInProgress.firstContext = null); 9866 } 9867 function readContext(context) { 9868 return readContextForConsumer(currentlyRenderingFiber$1, context); 9869 } 9870 function readContextDuringReconciliation(consumer, context) { 9871 null === currentlyRenderingFiber$1 && prepareToReadContext(consumer); 9872 return readContextForConsumer(consumer, context); 9873 } 9874 function readContextForConsumer(consumer, context) { 9875 var value = context._currentValue; 9876 context = { context: context, memoizedValue: value, next: null }; 9877 if (null === lastContextDependency) { 9878 if (null === consumer) throw Error(formatProdErrorMessage(308)); 9879 lastContextDependency = context; 9880 consumer.dependencies = { lanes: 0, firstContext: context }; 9881 consumer.flags |= 524288; 9882 } else lastContextDependency = lastContextDependency.next = context; 9883 return value; 9884 } 9885 var AbortControllerLocal = 9886 "undefined" !== typeof AbortController 9887 ? AbortController 9888 : function () { 9889 var listeners = [], 9890 signal = (this.signal = { 9891 aborted: false, 9892 addEventListener: function (type, listener) { 9893 listeners.push(listener); 9894 } 9895 }); 9896 this.abort = function () { 9897 signal.aborted = true; 9898 listeners.forEach(function (listener) { 9899 return listener(); 9900 }); 9901 }; 9902 }, 9903 scheduleCallback$2 = Scheduler.unstable_scheduleCallback, 9904 NormalPriority = Scheduler.unstable_NormalPriority, 9905 CacheContext = { 9906 $$typeof: REACT_CONTEXT_TYPE, 9907 Consumer: null, 9908 Provider: null, 9909 _currentValue: null, 9910 _currentValue2: null, 9911 _threadCount: 0 9912 }; 9913 function createCache() { 9914 return { 9915 controller: new AbortControllerLocal(), 9916 data: new Map(), 9917 refCount: 0 9918 }; 9919 } 9920 function releaseCache(cache) { 9921 cache.refCount--; 9922 0 === cache.refCount && 9923 scheduleCallback$2(NormalPriority, function () { 9924 cache.controller.abort(); 9925 }); 9926 } 9927 var currentEntangledListeners = null, 9928 currentEntangledPendingCount = 0, 9929 currentEntangledLane = 0, 9930 currentEntangledActionThenable = null; 9931 function entangleAsyncAction(transition, thenable) { 9932 if (null === currentEntangledListeners) { 9933 var entangledListeners = (currentEntangledListeners = []); 9934 currentEntangledPendingCount = 0; 9935 currentEntangledLane = requestTransitionLane(); 9936 currentEntangledActionThenable = { 9937 status: "pending", 9938 value: void 0, 9939 then: function (resolve) { 9940 entangledListeners.push(resolve); 9941 } 9942 }; 9943 } 9944 currentEntangledPendingCount++; 9945 thenable.then(pingEngtangledActionScope, pingEngtangledActionScope); 9946 return thenable; 9947 } 9948 function pingEngtangledActionScope() { 9949 if ( 9950 0 === --currentEntangledPendingCount && 9951 null !== currentEntangledListeners 9952 ) { 9953 null !== currentEntangledActionThenable && 9954 (currentEntangledActionThenable.status = "fulfilled"); 9955 var listeners = currentEntangledListeners; 9956 currentEntangledListeners = null; 9957 currentEntangledLane = 0; 9958 currentEntangledActionThenable = null; 9959 for (var i = 0; i < listeners.length; i++) (0, listeners[i])(); 9960 } 9961 } 9962 function chainThenableValue(thenable, result) { 9963 var listeners = [], 9964 thenableWithOverride = { 9965 status: "pending", 9966 value: null, 9967 reason: null, 9968 then: function (resolve) { 9969 listeners.push(resolve); 9970 } 9971 }; 9972 thenable.then( 9973 function () { 9974 thenableWithOverride.status = "fulfilled"; 9975 thenableWithOverride.value = result; 9976 for (var i = 0; i < listeners.length; i++) (0, listeners[i])(result); 9977 }, 9978 function (error) { 9979 thenableWithOverride.status = "rejected"; 9980 thenableWithOverride.reason = error; 9981 for (error = 0; error < listeners.length; error++) 9982 (0, listeners[error])(void 0); 9983 } 9984 ); 9985 return thenableWithOverride; 9986 } 9987 var prevOnStartTransitionFinish = ReactSharedInternals.S; 9988 ReactSharedInternals.S = function (transition, returnValue) { 9989 globalMostRecentTransitionTime = now(); 9990 "object" === typeof returnValue && 9991 null !== returnValue && 9992 "function" === typeof returnValue.then && 9993 entangleAsyncAction(transition, returnValue); 9994 null !== prevOnStartTransitionFinish && 9995 prevOnStartTransitionFinish(transition, returnValue); 9996 }; 9997 var resumedCache = createCursor(null); 9998 function peekCacheFromPool() { 9999 var cacheResumedFromPreviousRender = resumedCache.current; 10000 return null !== cacheResumedFromPreviousRender 10001 ? cacheResumedFromPreviousRender 10002 : workInProgressRoot.pooledCache; 10003 } 10004 function pushTransition(offscreenWorkInProgress, prevCachePool) { 10005 null === prevCachePool 10006 ? push(resumedCache, resumedCache.current) 10007 : push(resumedCache, prevCachePool.pool); 10008 } 10009 function getSuspendedCache() { 10010 var cacheFromPool = peekCacheFromPool(); 10011 return null === cacheFromPool 10012 ? null 10013 : { parent: CacheContext._currentValue, pool: cacheFromPool }; 10014 } 10015 var SuspenseException = Error(formatProdErrorMessage(460)), 10016 SuspenseyCommitException = Error(formatProdErrorMessage(474)), 10017 SuspenseActionException = Error(formatProdErrorMessage(542)), 10018 noopSuspenseyCommitThenable = { then: function () {} }; 10019 function isThenableResolved(thenable) { 10020 thenable = thenable.status; 10021 return "fulfilled" === thenable || "rejected" === thenable; 10022 } 10023 function trackUsedThenable(thenableState, thenable, index) { 10024 index = thenableState[index]; 10025 void 0 === index 10026 ? thenableState.push(thenable) 10027 : index !== thenable && (thenable.then(noop$1, noop$1), (thenable = index)); 10028 switch (thenable.status) { 10029 case "fulfilled": 10030 return thenable.value; 10031 case "rejected": 10032 throw ( 10033 ((thenableState = thenable.reason), 10034 checkIfUseWrappedInAsyncCatch(thenableState), 10035 thenableState) 10036 ); 10037 default: 10038 if ("string" === typeof thenable.status) thenable.then(noop$1, noop$1); 10039 else { 10040 thenableState = workInProgressRoot; 10041 if (null !== thenableState && 100 < thenableState.shellSuspendCounter) 10042 throw Error(formatProdErrorMessage(482)); 10043 thenableState = thenable; 10044 thenableState.status = "pending"; 10045 thenableState.then( 10046 function (fulfilledValue) { 10047 if ("pending" === thenable.status) { 10048 var fulfilledThenable = thenable; 10049 fulfilledThenable.status = "fulfilled"; 10050 fulfilledThenable.value = fulfilledValue; 10051 } 10052 }, 10053 function (error) { 10054 if ("pending" === thenable.status) { 10055 var rejectedThenable = thenable; 10056 rejectedThenable.status = "rejected"; 10057 rejectedThenable.reason = error; 10058 } 10059 } 10060 ); 10061 } 10062 switch (thenable.status) { 10063 case "fulfilled": 10064 return thenable.value; 10065 case "rejected": 10066 throw ( 10067 ((thenableState = thenable.reason), 10068 checkIfUseWrappedInAsyncCatch(thenableState), 10069 thenableState) 10070 ); 10071 } 10072 suspendedThenable = thenable; 10073 throw SuspenseException; 10074 } 10075 } 10076 function resolveLazy(lazyType) { 10077 try { 10078 var init = lazyType._init; 10079 return init(lazyType._payload); 10080 } catch (x) { 10081 if (null !== x && "object" === typeof x && "function" === typeof x.then) 10082 throw ((suspendedThenable = x), SuspenseException); 10083 throw x; 10084 } 10085 } 10086 var suspendedThenable = null; 10087 function getSuspendedThenable() { 10088 if (null === suspendedThenable) throw Error(formatProdErrorMessage(459)); 10089 var thenable = suspendedThenable; 10090 suspendedThenable = null; 10091 return thenable; 10092 } 10093 function checkIfUseWrappedInAsyncCatch(rejectedReason) { 10094 if ( 10095 rejectedReason === SuspenseException || 10096 rejectedReason === SuspenseActionException 10097 ) 10098 throw Error(formatProdErrorMessage(483)); 10099 } 10100 var thenableState$1 = null, 10101 thenableIndexCounter$1 = 0; 10102 function unwrapThenable(thenable) { 10103 var index = thenableIndexCounter$1; 10104 thenableIndexCounter$1 += 1; 10105 null === thenableState$1 && (thenableState$1 = []); 10106 return trackUsedThenable(thenableState$1, thenable, index); 10107 } 10108 function coerceRef(workInProgress, element) { 10109 element = element.props.ref; 10110 workInProgress.ref = void 0 !== element ? element : null; 10111 } 10112 function throwOnInvalidObjectTypeImpl(returnFiber, newChild) { 10113 if (newChild.$$typeof === REACT_LEGACY_ELEMENT_TYPE) 10114 throw Error(formatProdErrorMessage(525)); 10115 returnFiber = Object.prototype.toString.call(newChild); 10116 throw Error( 10117 formatProdErrorMessage( 10118 31, 10119 "[object Object]" === returnFiber 10120 ? "object with keys {" + Object.keys(newChild).join(", ") + "}" 10121 : returnFiber 10122 ) 10123 ); 10124 } 10125 function createChildReconciler(shouldTrackSideEffects) { 10126 function deleteChild(returnFiber, childToDelete) { 10127 if (shouldTrackSideEffects) { 10128 var deletions = returnFiber.deletions; 10129 null === deletions 10130 ? ((returnFiber.deletions = [childToDelete]), (returnFiber.flags |= 16)) 10131 : deletions.push(childToDelete); 10132 } 10133 } 10134 function deleteRemainingChildren(returnFiber, currentFirstChild) { 10135 if (!shouldTrackSideEffects) return null; 10136 for (; null !== currentFirstChild; ) 10137 deleteChild(returnFiber, currentFirstChild), 10138 (currentFirstChild = currentFirstChild.sibling); 10139 return null; 10140 } 10141 function mapRemainingChildren(currentFirstChild) { 10142 for (var existingChildren = new Map(); null !== currentFirstChild; ) 10143 null !== currentFirstChild.key 10144 ? existingChildren.set(currentFirstChild.key, currentFirstChild) 10145 : existingChildren.set(currentFirstChild.index, currentFirstChild), 10146 (currentFirstChild = currentFirstChild.sibling); 10147 return existingChildren; 10148 } 10149 function useFiber(fiber, pendingProps) { 10150 fiber = createWorkInProgress(fiber, pendingProps); 10151 fiber.index = 0; 10152 fiber.sibling = null; 10153 return fiber; 10154 } 10155 function placeChild(newFiber, lastPlacedIndex, newIndex) { 10156 newFiber.index = newIndex; 10157 if (!shouldTrackSideEffects) 10158 return (newFiber.flags |= 1048576), lastPlacedIndex; 10159 newIndex = newFiber.alternate; 10160 if (null !== newIndex) 10161 return ( 10162 (newIndex = newIndex.index), 10163 newIndex < lastPlacedIndex 10164 ? ((newFiber.flags |= 67108866), lastPlacedIndex) 10165 : newIndex 10166 ); 10167 newFiber.flags |= 67108866; 10168 return lastPlacedIndex; 10169 } 10170 function placeSingleChild(newFiber) { 10171 shouldTrackSideEffects && 10172 null === newFiber.alternate && 10173 (newFiber.flags |= 67108866); 10174 return newFiber; 10175 } 10176 function updateTextNode(returnFiber, current, textContent, lanes) { 10177 if (null === current || 6 !== current.tag) 10178 return ( 10179 (current = createFiberFromText(textContent, returnFiber.mode, lanes)), 10180 (current.return = returnFiber), 10181 current 10182 ); 10183 current = useFiber(current, textContent); 10184 current.return = returnFiber; 10185 return current; 10186 } 10187 function updateElement(returnFiber, current, element, lanes) { 10188 var elementType = element.type; 10189 if (elementType === REACT_FRAGMENT_TYPE) 10190 return updateFragment( 10191 returnFiber, 10192 current, 10193 element.props.children, 10194 lanes, 10195 element.key 10196 ); 10197 if ( 10198 null !== current && 10199 (current.elementType === elementType || 10200 ("object" === typeof elementType && 10201 null !== elementType && 10202 elementType.$$typeof === REACT_LAZY_TYPE && 10203 resolveLazy(elementType) === current.type)) 10204 ) 10205 return ( 10206 (current = useFiber(current, element.props)), 10207 coerceRef(current, element), 10208 (current.return = returnFiber), 10209 current 10210 ); 10211 current = createFiberFromTypeAndProps( 10212 element.type, 10213 element.key, 10214 element.props, 10215 null, 10216 returnFiber.mode, 10217 lanes 10218 ); 10219 coerceRef(current, element); 10220 current.return = returnFiber; 10221 return current; 10222 } 10223 function updatePortal(returnFiber, current, portal, lanes) { 10224 if ( 10225 null === current || 10226 4 !== current.tag || 10227 current.stateNode.containerInfo !== portal.containerInfo || 10228 current.stateNode.implementation !== portal.implementation 10229 ) 10230 return ( 10231 (current = createFiberFromPortal(portal, returnFiber.mode, lanes)), 10232 (current.return = returnFiber), 10233 current 10234 ); 10235 current = useFiber(current, portal.children || []); 10236 current.return = returnFiber; 10237 return current; 10238 } 10239 function updateFragment(returnFiber, current, fragment, lanes, key) { 10240 if (null === current || 7 !== current.tag) 10241 return ( 10242 (current = createFiberFromFragment( 10243 fragment, 10244 returnFiber.mode, 10245 lanes, 10246 key 10247 )), 10248 (current.return = returnFiber), 10249 current 10250 ); 10251 current = useFiber(current, fragment); 10252 current.return = returnFiber; 10253 return current; 10254 } 10255 function createChild(returnFiber, newChild, lanes) { 10256 if ( 10257 ("string" === typeof newChild && "" !== newChild) || 10258 "number" === typeof newChild || 10259 "bigint" === typeof newChild 10260 ) 10261 return ( 10262 (newChild = createFiberFromText( 10263 "" + newChild, 10264 returnFiber.mode, 10265 lanes 10266 )), 10267 (newChild.return = returnFiber), 10268 newChild 10269 ); 10270 if ("object" === typeof newChild && null !== newChild) { 10271 switch (newChild.$$typeof) { 10272 case REACT_ELEMENT_TYPE: 10273 return ( 10274 (lanes = createFiberFromTypeAndProps( 10275 newChild.type, 10276 newChild.key, 10277 newChild.props, 10278 null, 10279 returnFiber.mode, 10280 lanes 10281 )), 10282 coerceRef(lanes, newChild), 10283 (lanes.return = returnFiber), 10284 lanes 10285 ); 10286 case REACT_PORTAL_TYPE: 10287 return ( 10288 (newChild = createFiberFromPortal( 10289 newChild, 10290 returnFiber.mode, 10291 lanes 10292 )), 10293 (newChild.return = returnFiber), 10294 newChild 10295 ); 10296 case REACT_LAZY_TYPE: 10297 return ( 10298 (newChild = resolveLazy(newChild)), 10299 createChild(returnFiber, newChild, lanes) 10300 ); 10301 } 10302 if (isArrayImpl(newChild) || getIteratorFn(newChild)) 10303 return ( 10304 (newChild = createFiberFromFragment( 10305 newChild, 10306 returnFiber.mode, 10307 lanes, 10308 null 10309 )), 10310 (newChild.return = returnFiber), 10311 newChild 10312 ); 10313 if ("function" === typeof newChild.then) 10314 return createChild(returnFiber, unwrapThenable(newChild), lanes); 10315 if (newChild.$$typeof === REACT_CONTEXT_TYPE) 10316 return createChild( 10317 returnFiber, 10318 readContextDuringReconciliation(returnFiber, newChild), 10319 lanes 10320 ); 10321 throwOnInvalidObjectTypeImpl(returnFiber, newChild); 10322 } 10323 return null; 10324 } 10325 function updateSlot(returnFiber, oldFiber, newChild, lanes) { 10326 var key = null !== oldFiber ? oldFiber.key : null; 10327 if ( 10328 ("string" === typeof newChild && "" !== newChild) || 10329 "number" === typeof newChild || 10330 "bigint" === typeof newChild 10331 ) 10332 return null !== key 10333 ? null 10334 : updateTextNode(returnFiber, oldFiber, "" + newChild, lanes); 10335 if ("object" === typeof newChild && null !== newChild) { 10336 switch (newChild.$$typeof) { 10337 case REACT_ELEMENT_TYPE: 10338 return newChild.key === key 10339 ? updateElement(returnFiber, oldFiber, newChild, lanes) 10340 : null; 10341 case REACT_PORTAL_TYPE: 10342 return newChild.key === key 10343 ? updatePortal(returnFiber, oldFiber, newChild, lanes) 10344 : null; 10345 case REACT_LAZY_TYPE: 10346 return ( 10347 (newChild = resolveLazy(newChild)), 10348 updateSlot(returnFiber, oldFiber, newChild, lanes) 10349 ); 10350 } 10351 if (isArrayImpl(newChild) || getIteratorFn(newChild)) 10352 return null !== key 10353 ? null 10354 : updateFragment(returnFiber, oldFiber, newChild, lanes, null); 10355 if ("function" === typeof newChild.then) 10356 return updateSlot( 10357 returnFiber, 10358 oldFiber, 10359 unwrapThenable(newChild), 10360 lanes 10361 ); 10362 if (newChild.$$typeof === REACT_CONTEXT_TYPE) 10363 return updateSlot( 10364 returnFiber, 10365 oldFiber, 10366 readContextDuringReconciliation(returnFiber, newChild), 10367 lanes 10368 ); 10369 throwOnInvalidObjectTypeImpl(returnFiber, newChild); 10370 } 10371 return null; 10372 } 10373 function updateFromMap( 10374 existingChildren, 10375 returnFiber, 10376 newIdx, 10377 newChild, 10378 lanes 10379 ) { 10380 if ( 10381 ("string" === typeof newChild && "" !== newChild) || 10382 "number" === typeof newChild || 10383 "bigint" === typeof newChild 10384 ) 10385 return ( 10386 (existingChildren = existingChildren.get(newIdx) || null), 10387 updateTextNode(returnFiber, existingChildren, "" + newChild, lanes) 10388 ); 10389 if ("object" === typeof newChild && null !== newChild) { 10390 switch (newChild.$$typeof) { 10391 case REACT_ELEMENT_TYPE: 10392 return ( 10393 (existingChildren = 10394 existingChildren.get( 10395 null === newChild.key ? newIdx : newChild.key 10396 ) || null), 10397 updateElement(returnFiber, existingChildren, newChild, lanes) 10398 ); 10399 case REACT_PORTAL_TYPE: 10400 return ( 10401 (existingChildren = 10402 existingChildren.get( 10403 null === newChild.key ? newIdx : newChild.key 10404 ) || null), 10405 updatePortal(returnFiber, existingChildren, newChild, lanes) 10406 ); 10407 case REACT_LAZY_TYPE: 10408 return ( 10409 (newChild = resolveLazy(newChild)), 10410 updateFromMap( 10411 existingChildren, 10412 returnFiber, 10413 newIdx, 10414 newChild, 10415 lanes 10416 ) 10417 ); 10418 } 10419 if (isArrayImpl(newChild) || getIteratorFn(newChild)) 10420 return ( 10421 (existingChildren = existingChildren.get(newIdx) || null), 10422 updateFragment(returnFiber, existingChildren, newChild, lanes, null) 10423 ); 10424 if ("function" === typeof newChild.then) 10425 return updateFromMap( 10426 existingChildren, 10427 returnFiber, 10428 newIdx, 10429 unwrapThenable(newChild), 10430 lanes 10431 ); 10432 if (newChild.$$typeof === REACT_CONTEXT_TYPE) 10433 return updateFromMap( 10434 existingChildren, 10435 returnFiber, 10436 newIdx, 10437 readContextDuringReconciliation(returnFiber, newChild), 10438 lanes 10439 ); 10440 throwOnInvalidObjectTypeImpl(returnFiber, newChild); 10441 } 10442 return null; 10443 } 10444 function reconcileChildrenArray( 10445 returnFiber, 10446 currentFirstChild, 10447 newChildren, 10448 lanes 10449 ) { 10450 for ( 10451 var resultingFirstChild = null, 10452 previousNewFiber = null, 10453 oldFiber = currentFirstChild, 10454 newIdx = (currentFirstChild = 0), 10455 nextOldFiber = null; 10456 null !== oldFiber && newIdx < newChildren.length; 10457 newIdx++ 10458 ) { 10459 oldFiber.index > newIdx 10460 ? ((nextOldFiber = oldFiber), (oldFiber = null)) 10461 : (nextOldFiber = oldFiber.sibling); 10462 var newFiber = updateSlot( 10463 returnFiber, 10464 oldFiber, 10465 newChildren[newIdx], 10466 lanes 10467 ); 10468 if (null === newFiber) { 10469 null === oldFiber && (oldFiber = nextOldFiber); 10470 break; 10471 } 10472 shouldTrackSideEffects && 10473 oldFiber && 10474 null === newFiber.alternate && 10475 deleteChild(returnFiber, oldFiber); 10476 currentFirstChild = placeChild(newFiber, currentFirstChild, newIdx); 10477 null === previousNewFiber 10478 ? (resultingFirstChild = newFiber) 10479 : (previousNewFiber.sibling = newFiber); 10480 previousNewFiber = newFiber; 10481 oldFiber = nextOldFiber; 10482 } 10483 if (newIdx === newChildren.length) 10484 return ( 10485 deleteRemainingChildren(returnFiber, oldFiber), 10486 isHydrating && pushTreeFork(returnFiber, newIdx), 10487 resultingFirstChild 10488 ); 10489 if (null === oldFiber) { 10490 for (; newIdx < newChildren.length; newIdx++) 10491 (oldFiber = createChild(returnFiber, newChildren[newIdx], lanes)), 10492 null !== oldFiber && 10493 ((currentFirstChild = placeChild( 10494 oldFiber, 10495 currentFirstChild, 10496 newIdx 10497 )), 10498 null === previousNewFiber 10499 ? (resultingFirstChild = oldFiber) 10500 : (previousNewFiber.sibling = oldFiber), 10501 (previousNewFiber = oldFiber)); 10502 isHydrating && pushTreeFork(returnFiber, newIdx); 10503 return resultingFirstChild; 10504 } 10505 for ( 10506 oldFiber = mapRemainingChildren(oldFiber); 10507 newIdx < newChildren.length; 10508 newIdx++ 10509 ) 10510 (nextOldFiber = updateFromMap( 10511 oldFiber, 10512 returnFiber, 10513 newIdx, 10514 newChildren[newIdx], 10515 lanes 10516 )), 10517 null !== nextOldFiber && 10518 (shouldTrackSideEffects && 10519 null !== nextOldFiber.alternate && 10520 oldFiber.delete( 10521 null === nextOldFiber.key ? newIdx : nextOldFiber.key 10522 ), 10523 (currentFirstChild = placeChild( 10524 nextOldFiber, 10525 currentFirstChild, 10526 newIdx 10527 )), 10528 null === previousNewFiber 10529 ? (resultingFirstChild = nextOldFiber) 10530 : (previousNewFiber.sibling = nextOldFiber), 10531 (previousNewFiber = nextOldFiber)); 10532 shouldTrackSideEffects && 10533 oldFiber.forEach(function (child) { 10534 return deleteChild(returnFiber, child); 10535 }); 10536 isHydrating && pushTreeFork(returnFiber, newIdx); 10537 return resultingFirstChild; 10538 } 10539 function reconcileChildrenIterator( 10540 returnFiber, 10541 currentFirstChild, 10542 newChildren, 10543 lanes 10544 ) { 10545 if (null == newChildren) throw Error(formatProdErrorMessage(151)); 10546 for ( 10547 var resultingFirstChild = null, 10548 previousNewFiber = null, 10549 oldFiber = currentFirstChild, 10550 newIdx = (currentFirstChild = 0), 10551 nextOldFiber = null, 10552 step = newChildren.next(); 10553 null !== oldFiber && !step.done; 10554 newIdx++, step = newChildren.next() 10555 ) { 10556 oldFiber.index > newIdx 10557 ? ((nextOldFiber = oldFiber), (oldFiber = null)) 10558 : (nextOldFiber = oldFiber.sibling); 10559 var newFiber = updateSlot(returnFiber, oldFiber, step.value, lanes); 10560 if (null === newFiber) { 10561 null === oldFiber && (oldFiber = nextOldFiber); 10562 break; 10563 } 10564 shouldTrackSideEffects && 10565 oldFiber && 10566 null === newFiber.alternate && 10567 deleteChild(returnFiber, oldFiber); 10568 currentFirstChild = placeChild(newFiber, currentFirstChild, newIdx); 10569 null === previousNewFiber 10570 ? (resultingFirstChild = newFiber) 10571 : (previousNewFiber.sibling = newFiber); 10572 previousNewFiber = newFiber; 10573 oldFiber = nextOldFiber; 10574 } 10575 if (step.done) 10576 return ( 10577 deleteRemainingChildren(returnFiber, oldFiber), 10578 isHydrating && pushTreeFork(returnFiber, newIdx), 10579 resultingFirstChild 10580 ); 10581 if (null === oldFiber) { 10582 for (; !step.done; newIdx++, step = newChildren.next()) 10583 (step = createChild(returnFiber, step.value, lanes)), 10584 null !== step && 10585 ((currentFirstChild = placeChild(step, currentFirstChild, newIdx)), 10586 null === previousNewFiber 10587 ? (resultingFirstChild = step) 10588 : (previousNewFiber.sibling = step), 10589 (previousNewFiber = step)); 10590 isHydrating && pushTreeFork(returnFiber, newIdx); 10591 return resultingFirstChild; 10592 } 10593 for ( 10594 oldFiber = mapRemainingChildren(oldFiber); 10595 !step.done; 10596 newIdx++, step = newChildren.next() 10597 ) 10598 (step = updateFromMap(oldFiber, returnFiber, newIdx, step.value, lanes)), 10599 null !== step && 10600 (shouldTrackSideEffects && 10601 null !== step.alternate && 10602 oldFiber.delete(null === step.key ? newIdx : step.key), 10603 (currentFirstChild = placeChild(step, currentFirstChild, newIdx)), 10604 null === previousNewFiber 10605 ? (resultingFirstChild = step) 10606 : (previousNewFiber.sibling = step), 10607 (previousNewFiber = step)); 10608 shouldTrackSideEffects && 10609 oldFiber.forEach(function (child) { 10610 return deleteChild(returnFiber, child); 10611 }); 10612 isHydrating && pushTreeFork(returnFiber, newIdx); 10613 return resultingFirstChild; 10614 } 10615 function reconcileChildFibersImpl( 10616 returnFiber, 10617 currentFirstChild, 10618 newChild, 10619 lanes 10620 ) { 10621 "object" === typeof newChild && 10622 null !== newChild && 10623 newChild.type === REACT_FRAGMENT_TYPE && 10624 null === newChild.key && 10625 (newChild = newChild.props.children); 10626 if ("object" === typeof newChild && null !== newChild) { 10627 switch (newChild.$$typeof) { 10628 case REACT_ELEMENT_TYPE: 10629 a: { 10630 for (var key = newChild.key; null !== currentFirstChild; ) { 10631 if (currentFirstChild.key === key) { 10632 key = newChild.type; 10633 if (key === REACT_FRAGMENT_TYPE) { 10634 if (7 === currentFirstChild.tag) { 10635 deleteRemainingChildren( 10636 returnFiber, 10637 currentFirstChild.sibling 10638 ); 10639 lanes = useFiber( 10640 currentFirstChild, 10641 newChild.props.children 10642 ); 10643 lanes.return = returnFiber; 10644 returnFiber = lanes; 10645 break a; 10646 } 10647 } else if ( 10648 currentFirstChild.elementType === key || 10649 ("object" === typeof key && 10650 null !== key && 10651 key.$$typeof === REACT_LAZY_TYPE && 10652 resolveLazy(key) === currentFirstChild.type) 10653 ) { 10654 deleteRemainingChildren( 10655 returnFiber, 10656 currentFirstChild.sibling 10657 ); 10658 lanes = useFiber(currentFirstChild, newChild.props); 10659 coerceRef(lanes, newChild); 10660 lanes.return = returnFiber; 10661 returnFiber = lanes; 10662 break a; 10663 } 10664 deleteRemainingChildren(returnFiber, currentFirstChild); 10665 break; 10666 } else deleteChild(returnFiber, currentFirstChild); 10667 currentFirstChild = currentFirstChild.sibling; 10668 } 10669 newChild.type === REACT_FRAGMENT_TYPE 10670 ? ((lanes = createFiberFromFragment( 10671 newChild.props.children, 10672 returnFiber.mode, 10673 lanes, 10674 newChild.key 10675 )), 10676 (lanes.return = returnFiber), 10677 (returnFiber = lanes)) 10678 : ((lanes = createFiberFromTypeAndProps( 10679 newChild.type, 10680 newChild.key, 10681 newChild.props, 10682 null, 10683 returnFiber.mode, 10684 lanes 10685 )), 10686 coerceRef(lanes, newChild), 10687 (lanes.return = returnFiber), 10688 (returnFiber = lanes)); 10689 } 10690 return placeSingleChild(returnFiber); 10691 case REACT_PORTAL_TYPE: 10692 a: { 10693 for (key = newChild.key; null !== currentFirstChild; ) { 10694 if (currentFirstChild.key === key) 10695 if ( 10696 4 === currentFirstChild.tag && 10697 currentFirstChild.stateNode.containerInfo === 10698 newChild.containerInfo && 10699 currentFirstChild.stateNode.implementation === 10700 newChild.implementation 10701 ) { 10702 deleteRemainingChildren( 10703 returnFiber, 10704 currentFirstChild.sibling 10705 ); 10706 lanes = useFiber(currentFirstChild, newChild.children || []); 10707 lanes.return = returnFiber; 10708 returnFiber = lanes; 10709 break a; 10710 } else { 10711 deleteRemainingChildren(returnFiber, currentFirstChild); 10712 break; 10713 } 10714 else deleteChild(returnFiber, currentFirstChild); 10715 currentFirstChild = currentFirstChild.sibling; 10716 } 10717 lanes = createFiberFromPortal(newChild, returnFiber.mode, lanes); 10718 lanes.return = returnFiber; 10719 returnFiber = lanes; 10720 } 10721 return placeSingleChild(returnFiber); 10722 case REACT_LAZY_TYPE: 10723 return ( 10724 (newChild = resolveLazy(newChild)), 10725 reconcileChildFibersImpl( 10726 returnFiber, 10727 currentFirstChild, 10728 newChild, 10729 lanes 10730 ) 10731 ); 10732 } 10733 if (isArrayImpl(newChild)) 10734 return reconcileChildrenArray( 10735 returnFiber, 10736 currentFirstChild, 10737 newChild, 10738 lanes 10739 ); 10740 if (getIteratorFn(newChild)) { 10741 key = getIteratorFn(newChild); 10742 if ("function" !== typeof key) throw Error(formatProdErrorMessage(150)); 10743 newChild = key.call(newChild); 10744 return reconcileChildrenIterator( 10745 returnFiber, 10746 currentFirstChild, 10747 newChild, 10748 lanes 10749 ); 10750 } 10751 if ("function" === typeof newChild.then) 10752 return reconcileChildFibersImpl( 10753 returnFiber, 10754 currentFirstChild, 10755 unwrapThenable(newChild), 10756 lanes 10757 ); 10758 if (newChild.$$typeof === REACT_CONTEXT_TYPE) 10759 return reconcileChildFibersImpl( 10760 returnFiber, 10761 currentFirstChild, 10762 readContextDuringReconciliation(returnFiber, newChild), 10763 lanes 10764 ); 10765 throwOnInvalidObjectTypeImpl(returnFiber, newChild); 10766 } 10767 return ("string" === typeof newChild && "" !== newChild) || 10768 "number" === typeof newChild || 10769 "bigint" === typeof newChild 10770 ? ((newChild = "" + newChild), 10771 null !== currentFirstChild && 6 === currentFirstChild.tag 10772 ? (deleteRemainingChildren(returnFiber, currentFirstChild.sibling), 10773 (lanes = useFiber(currentFirstChild, newChild)), 10774 (lanes.return = returnFiber), 10775 (returnFiber = lanes)) 10776 : (deleteRemainingChildren(returnFiber, currentFirstChild), 10777 (lanes = createFiberFromText(newChild, returnFiber.mode, lanes)), 10778 (lanes.return = returnFiber), 10779 (returnFiber = lanes)), 10780 placeSingleChild(returnFiber)) 10781 : deleteRemainingChildren(returnFiber, currentFirstChild); 10782 } 10783 return function (returnFiber, currentFirstChild, newChild, lanes) { 10784 try { 10785 thenableIndexCounter$1 = 0; 10786 var firstChildFiber = reconcileChildFibersImpl( 10787 returnFiber, 10788 currentFirstChild, 10789 newChild, 10790 lanes 10791 ); 10792 thenableState$1 = null; 10793 return firstChildFiber; 10794 } catch (x) { 10795 if (x === SuspenseException || x === SuspenseActionException) throw x; 10796 var fiber = createFiberImplClass(29, x, null, returnFiber.mode); 10797 fiber.lanes = lanes; 10798 fiber.return = returnFiber; 10799 return fiber; 10800 } finally { 10801 } 10802 }; 10803 } 10804 var reconcileChildFibers = createChildReconciler(true), 10805 mountChildFibers = createChildReconciler(false), 10806 hasForceUpdate = false; 10807 function initializeUpdateQueue(fiber) { 10808 fiber.updateQueue = { 10809 baseState: fiber.memoizedState, 10810 firstBaseUpdate: null, 10811 lastBaseUpdate: null, 10812 shared: { pending: null, lanes: 0, hiddenCallbacks: null }, 10813 callbacks: null 10814 }; 10815 } 10816 function cloneUpdateQueue(current, workInProgress) { 10817 current = current.updateQueue; 10818 workInProgress.updateQueue === current && 10819 (workInProgress.updateQueue = { 10820 baseState: current.baseState, 10821 firstBaseUpdate: current.firstBaseUpdate, 10822 lastBaseUpdate: current.lastBaseUpdate, 10823 shared: current.shared, 10824 callbacks: null 10825 }); 10826 } 10827 function createUpdate(lane) { 10828 return { lane: lane, tag: 0, payload: null, callback: null, next: null }; 10829 } 10830 function enqueueUpdate(fiber, update, lane) { 10831 var updateQueue = fiber.updateQueue; 10832 if (null === updateQueue) return null; 10833 updateQueue = updateQueue.shared; 10834 if (0 !== (executionContext & 2)) { 10835 var pending = updateQueue.pending; 10836 null === pending 10837 ? (update.next = update) 10838 : ((update.next = pending.next), (pending.next = update)); 10839 updateQueue.pending = update; 10840 update = getRootForUpdatedFiber(fiber); 10841 markUpdateLaneFromFiberToRoot(fiber, null, lane); 10842 return update; 10843 } 10844 enqueueUpdate$1(fiber, updateQueue, update, lane); 10845 return getRootForUpdatedFiber(fiber); 10846 } 10847 function entangleTransitions(root, fiber, lane) { 10848 fiber = fiber.updateQueue; 10849 if (null !== fiber && ((fiber = fiber.shared), 0 !== (lane & 4194048))) { 10850 var queueLanes = fiber.lanes; 10851 queueLanes &= root.pendingLanes; 10852 lane |= queueLanes; 10853 fiber.lanes = lane; 10854 markRootEntangled(root, lane); 10855 } 10856 } 10857 function enqueueCapturedUpdate(workInProgress, capturedUpdate) { 10858 var queue = workInProgress.updateQueue, 10859 current = workInProgress.alternate; 10860 if ( 10861 null !== current && 10862 ((current = current.updateQueue), queue === current) 10863 ) { 10864 var newFirst = null, 10865 newLast = null; 10866 queue = queue.firstBaseUpdate; 10867 if (null !== queue) { 10868 do { 10869 var clone = { 10870 lane: queue.lane, 10871 tag: queue.tag, 10872 payload: queue.payload, 10873 callback: null, 10874 next: null 10875 }; 10876 null === newLast 10877 ? (newFirst = newLast = clone) 10878 : (newLast = newLast.next = clone); 10879 queue = queue.next; 10880 } while (null !== queue); 10881 null === newLast 10882 ? (newFirst = newLast = capturedUpdate) 10883 : (newLast = newLast.next = capturedUpdate); 10884 } else newFirst = newLast = capturedUpdate; 10885 queue = { 10886 baseState: current.baseState, 10887 firstBaseUpdate: newFirst, 10888 lastBaseUpdate: newLast, 10889 shared: current.shared, 10890 callbacks: current.callbacks 10891 }; 10892 workInProgress.updateQueue = queue; 10893 return; 10894 } 10895 workInProgress = queue.lastBaseUpdate; 10896 null === workInProgress 10897 ? (queue.firstBaseUpdate = capturedUpdate) 10898 : (workInProgress.next = capturedUpdate); 10899 queue.lastBaseUpdate = capturedUpdate; 10900 } 10901 var didReadFromEntangledAsyncAction = false; 10902 function suspendIfUpdateReadFromEntangledAsyncAction() { 10903 if (didReadFromEntangledAsyncAction) { 10904 var entangledActionThenable = currentEntangledActionThenable; 10905 if (null !== entangledActionThenable) throw entangledActionThenable; 10906 } 10907 } 10908 function processUpdateQueue( 10909 workInProgress$jscomp$0, 10910 props, 10911 instance$jscomp$0, 10912 renderLanes 10913 ) { 10914 didReadFromEntangledAsyncAction = false; 10915 var queue = workInProgress$jscomp$0.updateQueue; 10916 hasForceUpdate = false; 10917 var firstBaseUpdate = queue.firstBaseUpdate, 10918 lastBaseUpdate = queue.lastBaseUpdate, 10919 pendingQueue = queue.shared.pending; 10920 if (null !== pendingQueue) { 10921 queue.shared.pending = null; 10922 var lastPendingUpdate = pendingQueue, 10923 firstPendingUpdate = lastPendingUpdate.next; 10924 lastPendingUpdate.next = null; 10925 null === lastBaseUpdate 10926 ? (firstBaseUpdate = firstPendingUpdate) 10927 : (lastBaseUpdate.next = firstPendingUpdate); 10928 lastBaseUpdate = lastPendingUpdate; 10929 var current = workInProgress$jscomp$0.alternate; 10930 null !== current && 10931 ((current = current.updateQueue), 10932 (pendingQueue = current.lastBaseUpdate), 10933 pendingQueue !== lastBaseUpdate && 10934 (null === pendingQueue 10935 ? (current.firstBaseUpdate = firstPendingUpdate) 10936 : (pendingQueue.next = firstPendingUpdate), 10937 (current.lastBaseUpdate = lastPendingUpdate))); 10938 } 10939 if (null !== firstBaseUpdate) { 10940 var newState = queue.baseState; 10941 lastBaseUpdate = 0; 10942 current = firstPendingUpdate = lastPendingUpdate = null; 10943 pendingQueue = firstBaseUpdate; 10944 do { 10945 var updateLane = pendingQueue.lane & -536870913, 10946 isHiddenUpdate = updateLane !== pendingQueue.lane; 10947 if ( 10948 isHiddenUpdate 10949 ? (workInProgressRootRenderLanes & updateLane) === updateLane 10950 : (renderLanes & updateLane) === updateLane 10951 ) { 10952 0 !== updateLane && 10953 updateLane === currentEntangledLane && 10954 (didReadFromEntangledAsyncAction = true); 10955 null !== current && 10956 (current = current.next = 10957 { 10958 lane: 0, 10959 tag: pendingQueue.tag, 10960 payload: pendingQueue.payload, 10961 callback: null, 10962 next: null 10963 }); 10964 a: { 10965 var workInProgress = workInProgress$jscomp$0, 10966 update = pendingQueue; 10967 updateLane = props; 10968 var instance = instance$jscomp$0; 10969 switch (update.tag) { 10970 case 1: 10971 workInProgress = update.payload; 10972 if ("function" === typeof workInProgress) { 10973 newState = workInProgress.call(instance, newState, updateLane); 10974 break a; 10975 } 10976 newState = workInProgress; 10977 break a; 10978 case 3: 10979 workInProgress.flags = (workInProgress.flags & -65537) | 128; 10980 case 0: 10981 workInProgress = update.payload; 10982 updateLane = 10983 "function" === typeof workInProgress 10984 ? workInProgress.call(instance, newState, updateLane) 10985 : workInProgress; 10986 if (null === updateLane || void 0 === updateLane) break a; 10987 newState = assign({}, newState, updateLane); 10988 break a; 10989 case 2: 10990 hasForceUpdate = true; 10991 } 10992 } 10993 updateLane = pendingQueue.callback; 10994 null !== updateLane && 10995 ((workInProgress$jscomp$0.flags |= 64), 10996 isHiddenUpdate && (workInProgress$jscomp$0.flags |= 8192), 10997 (isHiddenUpdate = queue.callbacks), 10998 null === isHiddenUpdate 10999 ? (queue.callbacks = [updateLane]) 11000 : isHiddenUpdate.push(updateLane)); 11001 } else 11002 (isHiddenUpdate = { 11003 lane: updateLane, 11004 tag: pendingQueue.tag, 11005 payload: pendingQueue.payload, 11006 callback: pendingQueue.callback, 11007 next: null 11008 }), 11009 null === current 11010 ? ((firstPendingUpdate = current = isHiddenUpdate), 11011 (lastPendingUpdate = newState)) 11012 : (current = current.next = isHiddenUpdate), 11013 (lastBaseUpdate |= updateLane); 11014 pendingQueue = pendingQueue.next; 11015 if (null === pendingQueue) 11016 if (((pendingQueue = queue.shared.pending), null === pendingQueue)) 11017 break; 11018 else 11019 (isHiddenUpdate = pendingQueue), 11020 (pendingQueue = isHiddenUpdate.next), 11021 (isHiddenUpdate.next = null), 11022 (queue.lastBaseUpdate = isHiddenUpdate), 11023 (queue.shared.pending = null); 11024 } while (1); 11025 null === current && (lastPendingUpdate = newState); 11026 queue.baseState = lastPendingUpdate; 11027 queue.firstBaseUpdate = firstPendingUpdate; 11028 queue.lastBaseUpdate = current; 11029 null === firstBaseUpdate && (queue.shared.lanes = 0); 11030 workInProgressRootSkippedLanes |= lastBaseUpdate; 11031 workInProgress$jscomp$0.lanes = lastBaseUpdate; 11032 workInProgress$jscomp$0.memoizedState = newState; 11033 } 11034 } 11035 function callCallback(callback, context) { 11036 if ("function" !== typeof callback) 11037 throw Error(formatProdErrorMessage(191, callback)); 11038 callback.call(context); 11039 } 11040 function commitCallbacks(updateQueue, context) { 11041 var callbacks = updateQueue.callbacks; 11042 if (null !== callbacks) 11043 for ( 11044 updateQueue.callbacks = null, updateQueue = 0; 11045 updateQueue < callbacks.length; 11046 updateQueue++ 11047 ) 11048 callCallback(callbacks[updateQueue], context); 11049 } 11050 var currentTreeHiddenStackCursor = createCursor(null), 11051 prevEntangledRenderLanesCursor = createCursor(0); 11052 function pushHiddenContext(fiber, context) { 11053 fiber = entangledRenderLanes; 11054 push(prevEntangledRenderLanesCursor, fiber); 11055 push(currentTreeHiddenStackCursor, context); 11056 entangledRenderLanes = fiber | context.baseLanes; 11057 } 11058 function reuseHiddenContextOnStack() { 11059 push(prevEntangledRenderLanesCursor, entangledRenderLanes); 11060 push(currentTreeHiddenStackCursor, currentTreeHiddenStackCursor.current); 11061 } 11062 function popHiddenContext() { 11063 entangledRenderLanes = prevEntangledRenderLanesCursor.current; 11064 pop(currentTreeHiddenStackCursor); 11065 pop(prevEntangledRenderLanesCursor); 11066 } 11067 var suspenseHandlerStackCursor = createCursor(null), 11068 shellBoundary = null; 11069 function pushPrimaryTreeSuspenseHandler(handler) { 11070 var current = handler.alternate; 11071 push(suspenseStackCursor, suspenseStackCursor.current & 1); 11072 push(suspenseHandlerStackCursor, handler); 11073 null === shellBoundary && 11074 (null === current || null !== currentTreeHiddenStackCursor.current 11075 ? (shellBoundary = handler) 11076 : null !== current.memoizedState && (shellBoundary = handler)); 11077 } 11078 function pushDehydratedActivitySuspenseHandler(fiber) { 11079 push(suspenseStackCursor, suspenseStackCursor.current); 11080 push(suspenseHandlerStackCursor, fiber); 11081 null === shellBoundary && (shellBoundary = fiber); 11082 } 11083 function pushOffscreenSuspenseHandler(fiber) { 11084 22 === fiber.tag 11085 ? (push(suspenseStackCursor, suspenseStackCursor.current), 11086 push(suspenseHandlerStackCursor, fiber), 11087 null === shellBoundary && (shellBoundary = fiber)) 11088 : reuseSuspenseHandlerOnStack(); 11089 } 11090 function reuseSuspenseHandlerOnStack() { 11091 push(suspenseStackCursor, suspenseStackCursor.current); 11092 push(suspenseHandlerStackCursor, suspenseHandlerStackCursor.current); 11093 } 11094 function popSuspenseHandler(fiber) { 11095 pop(suspenseHandlerStackCursor); 11096 shellBoundary === fiber && (shellBoundary = null); 11097 pop(suspenseStackCursor); 11098 } 11099 var suspenseStackCursor = createCursor(0); 11100 function findFirstSuspended(row) { 11101 for (var node = row; null !== node; ) { 11102 if (13 === node.tag) { 11103 var state = node.memoizedState; 11104 if ( 11105 null !== state && 11106 ((state = state.dehydrated), 11107 null === state || 11108 isSuspenseInstancePending(state) || 11109 isSuspenseInstanceFallback(state)) 11110 ) 11111 return node; 11112 } else if ( 11113 19 === node.tag && 11114 ("forwards" === node.memoizedProps.revealOrder || 11115 "backwards" === node.memoizedProps.revealOrder || 11116 "unstable_legacy-backwards" === node.memoizedProps.revealOrder || 11117 "together" === node.memoizedProps.revealOrder) 11118 ) { 11119 if (0 !== (node.flags & 128)) return node; 11120 } else if (null !== node.child) { 11121 node.child.return = node; 11122 node = node.child; 11123 continue; 11124 } 11125 if (node === row) break; 11126 for (; null === node.sibling; ) { 11127 if (null === node.return || node.return === row) return null; 11128 node = node.return; 11129 } 11130 node.sibling.return = node.return; 11131 node = node.sibling; 11132 } 11133 return null; 11134 } 11135 var renderLanes = 0, 11136 currentlyRenderingFiber = null, 11137 currentHook = null, 11138 workInProgressHook = null, 11139 didScheduleRenderPhaseUpdate = false, 11140 didScheduleRenderPhaseUpdateDuringThisPass = false, 11141 shouldDoubleInvokeUserFnsInHooksDEV = false, 11142 localIdCounter = 0, 11143 thenableIndexCounter = 0, 11144 thenableState = null, 11145 globalClientIdCounter = 0; 11146 function throwInvalidHookError() { 11147 throw Error(formatProdErrorMessage(321)); 11148 } 11149 function areHookInputsEqual(nextDeps, prevDeps) { 11150 if (null === prevDeps) return false; 11151 for (var i = 0; i < prevDeps.length && i < nextDeps.length; i++) 11152 if (!objectIs(nextDeps[i], prevDeps[i])) return false; 11153 return true; 11154 } 11155 function renderWithHooks( 11156 current, 11157 workInProgress, 11158 Component, 11159 props, 11160 secondArg, 11161 nextRenderLanes 11162 ) { 11163 renderLanes = nextRenderLanes; 11164 currentlyRenderingFiber = workInProgress; 11165 workInProgress.memoizedState = null; 11166 workInProgress.updateQueue = null; 11167 workInProgress.lanes = 0; 11168 ReactSharedInternals.H = 11169 null === current || null === current.memoizedState 11170 ? HooksDispatcherOnMount 11171 : HooksDispatcherOnUpdate; 11172 shouldDoubleInvokeUserFnsInHooksDEV = false; 11173 nextRenderLanes = Component(props, secondArg); 11174 shouldDoubleInvokeUserFnsInHooksDEV = false; 11175 didScheduleRenderPhaseUpdateDuringThisPass && 11176 (nextRenderLanes = renderWithHooksAgain( 11177 workInProgress, 11178 Component, 11179 props, 11180 secondArg 11181 )); 11182 finishRenderingHooks(current); 11183 return nextRenderLanes; 11184 } 11185 function finishRenderingHooks(current) { 11186 ReactSharedInternals.H = ContextOnlyDispatcher; 11187 var didRenderTooFewHooks = null !== currentHook && null !== currentHook.next; 11188 renderLanes = 0; 11189 workInProgressHook = currentHook = currentlyRenderingFiber = null; 11190 didScheduleRenderPhaseUpdate = false; 11191 thenableIndexCounter = 0; 11192 thenableState = null; 11193 if (didRenderTooFewHooks) throw Error(formatProdErrorMessage(300)); 11194 null === current || 11195 didReceiveUpdate || 11196 ((current = current.dependencies), 11197 null !== current && 11198 checkIfContextChanged(current) && 11199 (didReceiveUpdate = true)); 11200 } 11201 function renderWithHooksAgain(workInProgress, Component, props, secondArg) { 11202 currentlyRenderingFiber = workInProgress; 11203 var numberOfReRenders = 0; 11204 do { 11205 didScheduleRenderPhaseUpdateDuringThisPass && (thenableState = null); 11206 thenableIndexCounter = 0; 11207 didScheduleRenderPhaseUpdateDuringThisPass = false; 11208 if (25 <= numberOfReRenders) throw Error(formatProdErrorMessage(301)); 11209 numberOfReRenders += 1; 11210 workInProgressHook = currentHook = null; 11211 if (null != workInProgress.updateQueue) { 11212 var children = workInProgress.updateQueue; 11213 children.lastEffect = null; 11214 children.events = null; 11215 children.stores = null; 11216 null != children.memoCache && (children.memoCache.index = 0); 11217 } 11218 ReactSharedInternals.H = HooksDispatcherOnRerender; 11219 children = Component(props, secondArg); 11220 } while (didScheduleRenderPhaseUpdateDuringThisPass); 11221 return children; 11222 } 11223 function TransitionAwareHostComponent() { 11224 var dispatcher = ReactSharedInternals.H, 11225 maybeThenable = dispatcher.useState()[0]; 11226 maybeThenable = 11227 "function" === typeof maybeThenable.then 11228 ? useThenable(maybeThenable) 11229 : maybeThenable; 11230 dispatcher = dispatcher.useState()[0]; 11231 (null !== currentHook ? currentHook.memoizedState : null) !== dispatcher && 11232 (currentlyRenderingFiber.flags |= 1024); 11233 return maybeThenable; 11234 } 11235 function checkDidRenderIdHook() { 11236 var didRenderIdHook = 0 !== localIdCounter; 11237 localIdCounter = 0; 11238 return didRenderIdHook; 11239 } 11240 function bailoutHooks(current, workInProgress, lanes) { 11241 workInProgress.updateQueue = current.updateQueue; 11242 workInProgress.flags &= -2053; 11243 current.lanes &= ~lanes; 11244 } 11245 function resetHooksOnUnwind(workInProgress) { 11246 if (didScheduleRenderPhaseUpdate) { 11247 for ( 11248 workInProgress = workInProgress.memoizedState; 11249 null !== workInProgress; 11250 11251 ) { 11252 var queue = workInProgress.queue; 11253 null !== queue && (queue.pending = null); 11254 workInProgress = workInProgress.next; 11255 } 11256 didScheduleRenderPhaseUpdate = false; 11257 } 11258 renderLanes = 0; 11259 workInProgressHook = currentHook = currentlyRenderingFiber = null; 11260 didScheduleRenderPhaseUpdateDuringThisPass = false; 11261 thenableIndexCounter = localIdCounter = 0; 11262 thenableState = null; 11263 } 11264 function mountWorkInProgressHook() { 11265 var hook = { 11266 memoizedState: null, 11267 baseState: null, 11268 baseQueue: null, 11269 queue: null, 11270 next: null 11271 }; 11272 null === workInProgressHook 11273 ? (currentlyRenderingFiber.memoizedState = workInProgressHook = hook) 11274 : (workInProgressHook = workInProgressHook.next = hook); 11275 return workInProgressHook; 11276 } 11277 function updateWorkInProgressHook() { 11278 if (null === currentHook) { 11279 var nextCurrentHook = currentlyRenderingFiber.alternate; 11280 nextCurrentHook = 11281 null !== nextCurrentHook ? nextCurrentHook.memoizedState : null; 11282 } else nextCurrentHook = currentHook.next; 11283 var nextWorkInProgressHook = 11284 null === workInProgressHook 11285 ? currentlyRenderingFiber.memoizedState 11286 : workInProgressHook.next; 11287 if (null !== nextWorkInProgressHook) 11288 (workInProgressHook = nextWorkInProgressHook), 11289 (currentHook = nextCurrentHook); 11290 else { 11291 if (null === nextCurrentHook) { 11292 if (null === currentlyRenderingFiber.alternate) 11293 throw Error(formatProdErrorMessage(467)); 11294 throw Error(formatProdErrorMessage(310)); 11295 } 11296 currentHook = nextCurrentHook; 11297 nextCurrentHook = { 11298 memoizedState: currentHook.memoizedState, 11299 baseState: currentHook.baseState, 11300 baseQueue: currentHook.baseQueue, 11301 queue: currentHook.queue, 11302 next: null 11303 }; 11304 null === workInProgressHook 11305 ? (currentlyRenderingFiber.memoizedState = workInProgressHook = 11306 nextCurrentHook) 11307 : (workInProgressHook = workInProgressHook.next = nextCurrentHook); 11308 } 11309 return workInProgressHook; 11310 } 11311 function createFunctionComponentUpdateQueue() { 11312 return { lastEffect: null, events: null, stores: null, memoCache: null }; 11313 } 11314 function useThenable(thenable) { 11315 var index = thenableIndexCounter; 11316 thenableIndexCounter += 1; 11317 null === thenableState && (thenableState = []); 11318 thenable = trackUsedThenable(thenableState, thenable, index); 11319 index = currentlyRenderingFiber; 11320 null === 11321 (null === workInProgressHook 11322 ? index.memoizedState 11323 : workInProgressHook.next) && 11324 ((index = index.alternate), 11325 (ReactSharedInternals.H = 11326 null === index || null === index.memoizedState 11327 ? HooksDispatcherOnMount 11328 : HooksDispatcherOnUpdate)); 11329 return thenable; 11330 } 11331 function use(usable) { 11332 if (null !== usable && "object" === typeof usable) { 11333 if ("function" === typeof usable.then) return useThenable(usable); 11334 if (usable.$$typeof === REACT_CONTEXT_TYPE) return readContext(usable); 11335 } 11336 throw Error(formatProdErrorMessage(438, String(usable))); 11337 } 11338 function useMemoCache(size) { 11339 var memoCache = null, 11340 updateQueue = currentlyRenderingFiber.updateQueue; 11341 null !== updateQueue && (memoCache = updateQueue.memoCache); 11342 if (null == memoCache) { 11343 var current = currentlyRenderingFiber.alternate; 11344 null !== current && 11345 ((current = current.updateQueue), 11346 null !== current && 11347 ((current = current.memoCache), 11348 null != current && 11349 (memoCache = { 11350 data: current.data.map(function (array) { 11351 return array.slice(); 11352 }), 11353 index: 0 11354 }))); 11355 } 11356 null == memoCache && (memoCache = { data: [], index: 0 }); 11357 null === updateQueue && 11358 ((updateQueue = createFunctionComponentUpdateQueue()), 11359 (currentlyRenderingFiber.updateQueue = updateQueue)); 11360 updateQueue.memoCache = memoCache; 11361 updateQueue = memoCache.data[memoCache.index]; 11362 if (void 0 === updateQueue) 11363 for ( 11364 updateQueue = memoCache.data[memoCache.index] = Array(size), current = 0; 11365 current < size; 11366 current++ 11367 ) 11368 updateQueue[current] = REACT_MEMO_CACHE_SENTINEL; 11369 memoCache.index++; 11370 return updateQueue; 11371 } 11372 function basicStateReducer(state, action) { 11373 return "function" === typeof action ? action(state) : action; 11374 } 11375 function updateReducer(reducer) { 11376 var hook = updateWorkInProgressHook(); 11377 return updateReducerImpl(hook, currentHook, reducer); 11378 } 11379 function updateReducerImpl(hook, current, reducer) { 11380 var queue = hook.queue; 11381 if (null === queue) throw Error(formatProdErrorMessage(311)); 11382 queue.lastRenderedReducer = reducer; 11383 var baseQueue = hook.baseQueue, 11384 pendingQueue = queue.pending; 11385 if (null !== pendingQueue) { 11386 if (null !== baseQueue) { 11387 var baseFirst = baseQueue.next; 11388 baseQueue.next = pendingQueue.next; 11389 pendingQueue.next = baseFirst; 11390 } 11391 current.baseQueue = baseQueue = pendingQueue; 11392 queue.pending = null; 11393 } 11394 pendingQueue = hook.baseState; 11395 if (null === baseQueue) hook.memoizedState = pendingQueue; 11396 else { 11397 current = baseQueue.next; 11398 var newBaseQueueFirst = (baseFirst = null), 11399 newBaseQueueLast = null, 11400 update = current, 11401 didReadFromEntangledAsyncAction$60 = false; 11402 do { 11403 var updateLane = update.lane & -536870913; 11404 if ( 11405 updateLane !== update.lane 11406 ? (workInProgressRootRenderLanes & updateLane) === updateLane 11407 : (renderLanes & updateLane) === updateLane 11408 ) { 11409 var revertLane = update.revertLane; 11410 if (0 === revertLane) 11411 null !== newBaseQueueLast && 11412 (newBaseQueueLast = newBaseQueueLast.next = 11413 { 11414 lane: 0, 11415 revertLane: 0, 11416 gesture: null, 11417 action: update.action, 11418 hasEagerState: update.hasEagerState, 11419 eagerState: update.eagerState, 11420 next: null 11421 }), 11422 updateLane === currentEntangledLane && 11423 (didReadFromEntangledAsyncAction$60 = true); 11424 else if ((renderLanes & revertLane) === revertLane) { 11425 update = update.next; 11426 revertLane === currentEntangledLane && 11427 (didReadFromEntangledAsyncAction$60 = true); 11428 continue; 11429 } else 11430 (updateLane = { 11431 lane: 0, 11432 revertLane: update.revertLane, 11433 gesture: null, 11434 action: update.action, 11435 hasEagerState: update.hasEagerState, 11436 eagerState: update.eagerState, 11437 next: null 11438 }), 11439 null === newBaseQueueLast 11440 ? ((newBaseQueueFirst = newBaseQueueLast = updateLane), 11441 (baseFirst = pendingQueue)) 11442 : (newBaseQueueLast = newBaseQueueLast.next = updateLane), 11443 (currentlyRenderingFiber.lanes |= revertLane), 11444 (workInProgressRootSkippedLanes |= revertLane); 11445 updateLane = update.action; 11446 shouldDoubleInvokeUserFnsInHooksDEV && 11447 reducer(pendingQueue, updateLane); 11448 pendingQueue = update.hasEagerState 11449 ? update.eagerState 11450 : reducer(pendingQueue, updateLane); 11451 } else 11452 (revertLane = { 11453 lane: updateLane, 11454 revertLane: update.revertLane, 11455 gesture: update.gesture, 11456 action: update.action, 11457 hasEagerState: update.hasEagerState, 11458 eagerState: update.eagerState, 11459 next: null 11460 }), 11461 null === newBaseQueueLast 11462 ? ((newBaseQueueFirst = newBaseQueueLast = revertLane), 11463 (baseFirst = pendingQueue)) 11464 : (newBaseQueueLast = newBaseQueueLast.next = revertLane), 11465 (currentlyRenderingFiber.lanes |= updateLane), 11466 (workInProgressRootSkippedLanes |= updateLane); 11467 update = update.next; 11468 } while (null !== update && update !== current); 11469 null === newBaseQueueLast 11470 ? (baseFirst = pendingQueue) 11471 : (newBaseQueueLast.next = newBaseQueueFirst); 11472 if ( 11473 !objectIs(pendingQueue, hook.memoizedState) && 11474 ((didReceiveUpdate = true), 11475 didReadFromEntangledAsyncAction$60 && 11476 ((reducer = currentEntangledActionThenable), null !== reducer)) 11477 ) 11478 throw reducer; 11479 hook.memoizedState = pendingQueue; 11480 hook.baseState = baseFirst; 11481 hook.baseQueue = newBaseQueueLast; 11482 queue.lastRenderedState = pendingQueue; 11483 } 11484 null === baseQueue && (queue.lanes = 0); 11485 return [hook.memoizedState, queue.dispatch]; 11486 } 11487 function rerenderReducer(reducer) { 11488 var hook = updateWorkInProgressHook(), 11489 queue = hook.queue; 11490 if (null === queue) throw Error(formatProdErrorMessage(311)); 11491 queue.lastRenderedReducer = reducer; 11492 var dispatch = queue.dispatch, 11493 lastRenderPhaseUpdate = queue.pending, 11494 newState = hook.memoizedState; 11495 if (null !== lastRenderPhaseUpdate) { 11496 queue.pending = null; 11497 var update = (lastRenderPhaseUpdate = lastRenderPhaseUpdate.next); 11498 do (newState = reducer(newState, update.action)), (update = update.next); 11499 while (update !== lastRenderPhaseUpdate); 11500 objectIs(newState, hook.memoizedState) || (didReceiveUpdate = true); 11501 hook.memoizedState = newState; 11502 null === hook.baseQueue && (hook.baseState = newState); 11503 queue.lastRenderedState = newState; 11504 } 11505 return [newState, dispatch]; 11506 } 11507 function updateSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) { 11508 var fiber = currentlyRenderingFiber, 11509 hook = updateWorkInProgressHook(), 11510 isHydrating$jscomp$0 = isHydrating; 11511 if (isHydrating$jscomp$0) { 11512 if (void 0 === getServerSnapshot) throw Error(formatProdErrorMessage(407)); 11513 getServerSnapshot = getServerSnapshot(); 11514 } else getServerSnapshot = getSnapshot(); 11515 var snapshotChanged = !objectIs( 11516 (currentHook || hook).memoizedState, 11517 getServerSnapshot 11518 ); 11519 snapshotChanged && 11520 ((hook.memoizedState = getServerSnapshot), (didReceiveUpdate = true)); 11521 hook = hook.queue; 11522 updateEffect(subscribeToStore.bind(null, fiber, hook, subscribe), [ 11523 subscribe 11524 ]); 11525 if ( 11526 hook.getSnapshot !== getSnapshot || 11527 snapshotChanged || 11528 (null !== workInProgressHook && workInProgressHook.memoizedState.tag & 1) 11529 ) { 11530 fiber.flags |= 2048; 11531 pushSimpleEffect( 11532 9, 11533 { destroy: void 0 }, 11534 updateStoreInstance.bind( 11535 null, 11536 fiber, 11537 hook, 11538 getServerSnapshot, 11539 getSnapshot 11540 ), 11541 null 11542 ); 11543 if (null === workInProgressRoot) throw Error(formatProdErrorMessage(349)); 11544 isHydrating$jscomp$0 || 11545 0 !== (renderLanes & 127) || 11546 pushStoreConsistencyCheck(fiber, getSnapshot, getServerSnapshot); 11547 } 11548 return getServerSnapshot; 11549 } 11550 function pushStoreConsistencyCheck(fiber, getSnapshot, renderedSnapshot) { 11551 fiber.flags |= 16384; 11552 fiber = { getSnapshot: getSnapshot, value: renderedSnapshot }; 11553 getSnapshot = currentlyRenderingFiber.updateQueue; 11554 null === getSnapshot 11555 ? ((getSnapshot = createFunctionComponentUpdateQueue()), 11556 (currentlyRenderingFiber.updateQueue = getSnapshot), 11557 (getSnapshot.stores = [fiber])) 11558 : ((renderedSnapshot = getSnapshot.stores), 11559 null === renderedSnapshot 11560 ? (getSnapshot.stores = [fiber]) 11561 : renderedSnapshot.push(fiber)); 11562 } 11563 function updateStoreInstance(fiber, inst, nextSnapshot, getSnapshot) { 11564 inst.value = nextSnapshot; 11565 inst.getSnapshot = getSnapshot; 11566 checkIfSnapshotChanged(inst) && forceStoreRerender(fiber); 11567 } 11568 function subscribeToStore(fiber, inst, subscribe) { 11569 return subscribe(function () { 11570 checkIfSnapshotChanged(inst) && forceStoreRerender(fiber); 11571 }); 11572 } 11573 function checkIfSnapshotChanged(inst) { 11574 var latestGetSnapshot = inst.getSnapshot; 11575 inst = inst.value; 11576 try { 11577 var nextValue = latestGetSnapshot(); 11578 return !objectIs(inst, nextValue); 11579 } catch (error) { 11580 return true; 11581 } 11582 } 11583 function forceStoreRerender(fiber) { 11584 var root = enqueueConcurrentRenderForLane(fiber, 2); 11585 null !== root && scheduleUpdateOnFiber(root, fiber, 2); 11586 } 11587 function mountStateImpl(initialState) { 11588 var hook = mountWorkInProgressHook(); 11589 if ("function" === typeof initialState) { 11590 var initialStateInitializer = initialState; 11591 initialState = initialStateInitializer(); 11592 if (shouldDoubleInvokeUserFnsInHooksDEV) { 11593 setIsStrictModeForDevtools(true); 11594 try { 11595 initialStateInitializer(); 11596 } finally { 11597 setIsStrictModeForDevtools(false); 11598 } 11599 } 11600 } 11601 hook.memoizedState = hook.baseState = initialState; 11602 hook.queue = { 11603 pending: null, 11604 lanes: 0, 11605 dispatch: null, 11606 lastRenderedReducer: basicStateReducer, 11607 lastRenderedState: initialState 11608 }; 11609 return hook; 11610 } 11611 function updateOptimisticImpl(hook, current, passthrough, reducer) { 11612 hook.baseState = passthrough; 11613 return updateReducerImpl( 11614 hook, 11615 currentHook, 11616 "function" === typeof reducer ? reducer : basicStateReducer 11617 ); 11618 } 11619 function dispatchActionState( 11620 fiber, 11621 actionQueue, 11622 setPendingState, 11623 setState, 11624 payload 11625 ) { 11626 if (isRenderPhaseUpdate(fiber)) throw Error(formatProdErrorMessage(485)); 11627 fiber = actionQueue.action; 11628 if (null !== fiber) { 11629 var actionNode = { 11630 payload: payload, 11631 action: fiber, 11632 next: null, 11633 isTransition: true, 11634 status: "pending", 11635 value: null, 11636 reason: null, 11637 listeners: [], 11638 then: function (listener) { 11639 actionNode.listeners.push(listener); 11640 } 11641 }; 11642 null !== ReactSharedInternals.T 11643 ? setPendingState(true) 11644 : (actionNode.isTransition = false); 11645 setState(actionNode); 11646 setPendingState = actionQueue.pending; 11647 null === setPendingState 11648 ? ((actionNode.next = actionQueue.pending = actionNode), 11649 runActionStateAction(actionQueue, actionNode)) 11650 : ((actionNode.next = setPendingState.next), 11651 (actionQueue.pending = setPendingState.next = actionNode)); 11652 } 11653 } 11654 function runActionStateAction(actionQueue, node) { 11655 var action = node.action, 11656 payload = node.payload, 11657 prevState = actionQueue.state; 11658 if (node.isTransition) { 11659 var prevTransition = ReactSharedInternals.T, 11660 currentTransition = {}; 11661 ReactSharedInternals.T = currentTransition; 11662 try { 11663 var returnValue = action(prevState, payload), 11664 onStartTransitionFinish = ReactSharedInternals.S; 11665 null !== onStartTransitionFinish && 11666 onStartTransitionFinish(currentTransition, returnValue); 11667 handleActionReturnValue(actionQueue, node, returnValue); 11668 } catch (error) { 11669 onActionError(actionQueue, node, error); 11670 } finally { 11671 null !== prevTransition && 11672 null !== currentTransition.types && 11673 (prevTransition.types = currentTransition.types), 11674 (ReactSharedInternals.T = prevTransition); 11675 } 11676 } else 11677 try { 11678 (prevTransition = action(prevState, payload)), 11679 handleActionReturnValue(actionQueue, node, prevTransition); 11680 } catch (error$66) { 11681 onActionError(actionQueue, node, error$66); 11682 } 11683 } 11684 function handleActionReturnValue(actionQueue, node, returnValue) { 11685 null !== returnValue && 11686 "object" === typeof returnValue && 11687 "function" === typeof returnValue.then 11688 ? returnValue.then( 11689 function (nextState) { 11690 onActionSuccess(actionQueue, node, nextState); 11691 }, 11692 function (error) { 11693 return onActionError(actionQueue, node, error); 11694 } 11695 ) 11696 : onActionSuccess(actionQueue, node, returnValue); 11697 } 11698 function onActionSuccess(actionQueue, actionNode, nextState) { 11699 actionNode.status = "fulfilled"; 11700 actionNode.value = nextState; 11701 notifyActionListeners(actionNode); 11702 actionQueue.state = nextState; 11703 actionNode = actionQueue.pending; 11704 null !== actionNode && 11705 ((nextState = actionNode.next), 11706 nextState === actionNode 11707 ? (actionQueue.pending = null) 11708 : ((nextState = nextState.next), 11709 (actionNode.next = nextState), 11710 runActionStateAction(actionQueue, nextState))); 11711 } 11712 function onActionError(actionQueue, actionNode, error) { 11713 var last = actionQueue.pending; 11714 actionQueue.pending = null; 11715 if (null !== last) { 11716 last = last.next; 11717 do 11718 (actionNode.status = "rejected"), 11719 (actionNode.reason = error), 11720 notifyActionListeners(actionNode), 11721 (actionNode = actionNode.next); 11722 while (actionNode !== last); 11723 } 11724 actionQueue.action = null; 11725 } 11726 function notifyActionListeners(actionNode) { 11727 actionNode = actionNode.listeners; 11728 for (var i = 0; i < actionNode.length; i++) (0, actionNode[i])(); 11729 } 11730 function actionStateReducer(oldState, newState) { 11731 return newState; 11732 } 11733 function mountActionState(action, initialStateProp) { 11734 if (isHydrating) { 11735 var ssrFormState = workInProgressRoot.formState; 11736 if (null !== ssrFormState) { 11737 a: { 11738 var JSCompiler_inline_result = currentlyRenderingFiber; 11739 if (isHydrating) { 11740 if (nextHydratableInstance) { 11741 b: { 11742 var JSCompiler_inline_result$jscomp$0 = nextHydratableInstance; 11743 for ( 11744 var inRootOrSingleton = rootOrSingletonContext; 11745 8 !== JSCompiler_inline_result$jscomp$0.nodeType; 11746 11747 ) { 11748 if (!inRootOrSingleton) { 11749 JSCompiler_inline_result$jscomp$0 = null; 11750 break b; 11751 } 11752 JSCompiler_inline_result$jscomp$0 = getNextHydratable( 11753 JSCompiler_inline_result$jscomp$0.nextSibling 11754 ); 11755 if (null === JSCompiler_inline_result$jscomp$0) { 11756 JSCompiler_inline_result$jscomp$0 = null; 11757 break b; 11758 } 11759 } 11760 inRootOrSingleton = JSCompiler_inline_result$jscomp$0.data; 11761 JSCompiler_inline_result$jscomp$0 = 11762 "F!" === inRootOrSingleton || "F" === inRootOrSingleton 11763 ? JSCompiler_inline_result$jscomp$0 11764 : null; 11765 } 11766 if (JSCompiler_inline_result$jscomp$0) { 11767 nextHydratableInstance = getNextHydratable( 11768 JSCompiler_inline_result$jscomp$0.nextSibling 11769 ); 11770 JSCompiler_inline_result = 11771 "F!" === JSCompiler_inline_result$jscomp$0.data; 11772 break a; 11773 } 11774 } 11775 throwOnHydrationMismatch(JSCompiler_inline_result); 11776 } 11777 JSCompiler_inline_result = false; 11778 } 11779 JSCompiler_inline_result && (initialStateProp = ssrFormState[0]); 11780 } 11781 } 11782 ssrFormState = mountWorkInProgressHook(); 11783 ssrFormState.memoizedState = ssrFormState.baseState = initialStateProp; 11784 JSCompiler_inline_result = { 11785 pending: null, 11786 lanes: 0, 11787 dispatch: null, 11788 lastRenderedReducer: actionStateReducer, 11789 lastRenderedState: initialStateProp 11790 }; 11791 ssrFormState.queue = JSCompiler_inline_result; 11792 ssrFormState = dispatchSetState.bind( 11793 null, 11794 currentlyRenderingFiber, 11795 JSCompiler_inline_result 11796 ); 11797 JSCompiler_inline_result.dispatch = ssrFormState; 11798 JSCompiler_inline_result = mountStateImpl(false); 11799 inRootOrSingleton = dispatchOptimisticSetState.bind( 11800 null, 11801 currentlyRenderingFiber, 11802 false, 11803 JSCompiler_inline_result.queue 11804 ); 11805 JSCompiler_inline_result = mountWorkInProgressHook(); 11806 JSCompiler_inline_result$jscomp$0 = { 11807 state: initialStateProp, 11808 dispatch: null, 11809 action: action, 11810 pending: null 11811 }; 11812 JSCompiler_inline_result.queue = JSCompiler_inline_result$jscomp$0; 11813 ssrFormState = dispatchActionState.bind( 11814 null, 11815 currentlyRenderingFiber, 11816 JSCompiler_inline_result$jscomp$0, 11817 inRootOrSingleton, 11818 ssrFormState 11819 ); 11820 JSCompiler_inline_result$jscomp$0.dispatch = ssrFormState; 11821 JSCompiler_inline_result.memoizedState = action; 11822 return [initialStateProp, ssrFormState, false]; 11823 } 11824 function updateActionState(action) { 11825 var stateHook = updateWorkInProgressHook(); 11826 return updateActionStateImpl(stateHook, currentHook, action); 11827 } 11828 function updateActionStateImpl(stateHook, currentStateHook, action) { 11829 currentStateHook = updateReducerImpl( 11830 stateHook, 11831 currentStateHook, 11832 actionStateReducer 11833 )[0]; 11834 stateHook = updateReducer(basicStateReducer)[0]; 11835 if ( 11836 "object" === typeof currentStateHook && 11837 null !== currentStateHook && 11838 "function" === typeof currentStateHook.then 11839 ) 11840 try { 11841 var state = useThenable(currentStateHook); 11842 } catch (x) { 11843 if (x === SuspenseException) throw SuspenseActionException; 11844 throw x; 11845 } 11846 else state = currentStateHook; 11847 currentStateHook = updateWorkInProgressHook(); 11848 var actionQueue = currentStateHook.queue, 11849 dispatch = actionQueue.dispatch; 11850 action !== currentStateHook.memoizedState && 11851 ((currentlyRenderingFiber.flags |= 2048), 11852 pushSimpleEffect( 11853 9, 11854 { destroy: void 0 }, 11855 actionStateActionEffect.bind(null, actionQueue, action), 11856 null 11857 )); 11858 return [state, dispatch, stateHook]; 11859 } 11860 function actionStateActionEffect(actionQueue, action) { 11861 actionQueue.action = action; 11862 } 11863 function rerenderActionState(action) { 11864 var stateHook = updateWorkInProgressHook(), 11865 currentStateHook = currentHook; 11866 if (null !== currentStateHook) 11867 return updateActionStateImpl(stateHook, currentStateHook, action); 11868 updateWorkInProgressHook(); 11869 stateHook = stateHook.memoizedState; 11870 currentStateHook = updateWorkInProgressHook(); 11871 var dispatch = currentStateHook.queue.dispatch; 11872 currentStateHook.memoizedState = action; 11873 return [stateHook, dispatch, false]; 11874 } 11875 function pushSimpleEffect(tag, inst, create, deps) { 11876 tag = { tag: tag, create: create, deps: deps, inst: inst, next: null }; 11877 inst = currentlyRenderingFiber.updateQueue; 11878 null === inst && 11879 ((inst = createFunctionComponentUpdateQueue()), 11880 (currentlyRenderingFiber.updateQueue = inst)); 11881 create = inst.lastEffect; 11882 null === create 11883 ? (inst.lastEffect = tag.next = tag) 11884 : ((deps = create.next), 11885 (create.next = tag), 11886 (tag.next = deps), 11887 (inst.lastEffect = tag)); 11888 return tag; 11889 } 11890 function updateRef() { 11891 return updateWorkInProgressHook().memoizedState; 11892 } 11893 function mountEffectImpl(fiberFlags, hookFlags, create, deps) { 11894 var hook = mountWorkInProgressHook(); 11895 currentlyRenderingFiber.flags |= fiberFlags; 11896 hook.memoizedState = pushSimpleEffect( 11897 1 | hookFlags, 11898 { destroy: void 0 }, 11899 create, 11900 void 0 === deps ? null : deps 11901 ); 11902 } 11903 function updateEffectImpl(fiberFlags, hookFlags, create, deps) { 11904 var hook = updateWorkInProgressHook(); 11905 deps = void 0 === deps ? null : deps; 11906 var inst = hook.memoizedState.inst; 11907 null !== currentHook && 11908 null !== deps && 11909 areHookInputsEqual(deps, currentHook.memoizedState.deps) 11910 ? (hook.memoizedState = pushSimpleEffect(hookFlags, inst, create, deps)) 11911 : ((currentlyRenderingFiber.flags |= fiberFlags), 11912 (hook.memoizedState = pushSimpleEffect( 11913 1 | hookFlags, 11914 inst, 11915 create, 11916 deps 11917 ))); 11918 } 11919 function mountEffect(create, deps) { 11920 mountEffectImpl(8390656, 8, create, deps); 11921 } 11922 function updateEffect(create, deps) { 11923 updateEffectImpl(2048, 8, create, deps); 11924 } 11925 function useEffectEventImpl(payload) { 11926 currentlyRenderingFiber.flags |= 4; 11927 var componentUpdateQueue = currentlyRenderingFiber.updateQueue; 11928 if (null === componentUpdateQueue) 11929 (componentUpdateQueue = createFunctionComponentUpdateQueue()), 11930 (currentlyRenderingFiber.updateQueue = componentUpdateQueue), 11931 (componentUpdateQueue.events = [payload]); 11932 else { 11933 var events = componentUpdateQueue.events; 11934 null === events 11935 ? (componentUpdateQueue.events = [payload]) 11936 : events.push(payload); 11937 } 11938 } 11939 function updateEvent(callback) { 11940 var ref = updateWorkInProgressHook().memoizedState; 11941 useEffectEventImpl({ ref: ref, nextImpl: callback }); 11942 return function () { 11943 if (0 !== (executionContext & 2)) throw Error(formatProdErrorMessage(440)); 11944 return ref.impl.apply(void 0, arguments); 11945 }; 11946 } 11947 function updateInsertionEffect(create, deps) { 11948 return updateEffectImpl(4, 2, create, deps); 11949 } 11950 function updateLayoutEffect(create, deps) { 11951 return updateEffectImpl(4, 4, create, deps); 11952 } 11953 function imperativeHandleEffect(create, ref) { 11954 if ("function" === typeof ref) { 11955 create = create(); 11956 var refCleanup = ref(create); 11957 return function () { 11958 "function" === typeof refCleanup ? refCleanup() : ref(null); 11959 }; 11960 } 11961 if (null !== ref && void 0 !== ref) 11962 return ( 11963 (create = create()), 11964 (ref.current = create), 11965 function () { 11966 ref.current = null; 11967 } 11968 ); 11969 } 11970 function updateImperativeHandle(ref, create, deps) { 11971 deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null; 11972 updateEffectImpl(4, 4, imperativeHandleEffect.bind(null, create, ref), deps); 11973 } 11974 function mountDebugValue() {} 11975 function updateCallback(callback, deps) { 11976 var hook = updateWorkInProgressHook(); 11977 deps = void 0 === deps ? null : deps; 11978 var prevState = hook.memoizedState; 11979 if (null !== deps && areHookInputsEqual(deps, prevState[1])) 11980 return prevState[0]; 11981 hook.memoizedState = [callback, deps]; 11982 return callback; 11983 } 11984 function updateMemo(nextCreate, deps) { 11985 var hook = updateWorkInProgressHook(); 11986 deps = void 0 === deps ? null : deps; 11987 var prevState = hook.memoizedState; 11988 if (null !== deps && areHookInputsEqual(deps, prevState[1])) 11989 return prevState[0]; 11990 prevState = nextCreate(); 11991 if (shouldDoubleInvokeUserFnsInHooksDEV) { 11992 setIsStrictModeForDevtools(true); 11993 try { 11994 nextCreate(); 11995 } finally { 11996 setIsStrictModeForDevtools(false); 11997 } 11998 } 11999 hook.memoizedState = [prevState, deps]; 12000 return prevState; 12001 } 12002 function mountDeferredValueImpl(hook, value, initialValue) { 12003 if ( 12004 void 0 === initialValue || 12005 (0 !== (renderLanes & 1073741824) && 12006 0 === (workInProgressRootRenderLanes & 261930)) 12007 ) 12008 return (hook.memoizedState = value); 12009 hook.memoizedState = initialValue; 12010 hook = requestDeferredLane(); 12011 currentlyRenderingFiber.lanes |= hook; 12012 workInProgressRootSkippedLanes |= hook; 12013 return initialValue; 12014 } 12015 function updateDeferredValueImpl(hook, prevValue, value, initialValue) { 12016 if (objectIs(value, prevValue)) return value; 12017 if (null !== currentTreeHiddenStackCursor.current) 12018 return ( 12019 (hook = mountDeferredValueImpl(hook, value, initialValue)), 12020 objectIs(hook, prevValue) || (didReceiveUpdate = true), 12021 hook 12022 ); 12023 if ( 12024 0 === (renderLanes & 42) || 12025 (0 !== (renderLanes & 1073741824) && 12026 0 === (workInProgressRootRenderLanes & 261930)) 12027 ) 12028 return (didReceiveUpdate = true), (hook.memoizedState = value); 12029 hook = requestDeferredLane(); 12030 currentlyRenderingFiber.lanes |= hook; 12031 workInProgressRootSkippedLanes |= hook; 12032 return prevValue; 12033 } 12034 function startTransition(fiber, queue, pendingState, finishedState, callback) { 12035 var previousPriority = ReactDOMSharedInternals.p; 12036 ReactDOMSharedInternals.p = 12037 0 !== previousPriority && 8 > previousPriority ? previousPriority : 8; 12038 var prevTransition = ReactSharedInternals.T, 12039 currentTransition = {}; 12040 ReactSharedInternals.T = currentTransition; 12041 dispatchOptimisticSetState(fiber, false, queue, pendingState); 12042 try { 12043 var returnValue = callback(), 12044 onStartTransitionFinish = ReactSharedInternals.S; 12045 null !== onStartTransitionFinish && 12046 onStartTransitionFinish(currentTransition, returnValue); 12047 if ( 12048 null !== returnValue && 12049 "object" === typeof returnValue && 12050 "function" === typeof returnValue.then 12051 ) { 12052 var thenableForFinishedState = chainThenableValue( 12053 returnValue, 12054 finishedState 12055 ); 12056 dispatchSetStateInternal( 12057 fiber, 12058 queue, 12059 thenableForFinishedState, 12060 requestUpdateLane(
vendor: 4,899 bytes, lines 12060-12222
12060fiber) 12061 ); 12062 } else 12063 dispatchSetStateInternal( 12064 fiber, 12065 queue, 12066 finishedState, 12067 requestUpdateLane(fiber) 12068 ); 12069 } catch (error) { 12070 dispatchSetStateInternal( 12071 fiber, 12072 queue, 12073 { then: function () {}, status: "rejected", reason: error }, 12074 requestUpdateLane() 12075 ); 12076 } finally { 12077 (ReactDOMSharedInternals.p = previousPriority), 12078 null !== prevTransition && 12079 null !== currentTransition.types && 12080 (prevTransition.types = currentTransition.types), 12081 (ReactSharedInternals.T = prevTransition); 12082 } 12083 } 12084 function noop() {} 12085 function startHostTransition(formFiber, pendingState, action, formData) { 12086 if (5 !== formFiber.tag) throw Error(formatProdErrorMessage(476)); 12087 var queue = ensureFormComponentIsStateful(formFiber).queue; 12088 startTransition( 12089 formFiber, 12090 queue, 12091 pendingState, 12092 sharedNotPendingObject, 12093 null === action 12094 ? noop 12095 : function () { 12096 requestFormReset$1(formFiber); 12097 return action(formData); 12098 } 12099 ); 12100 } 12101 function ensureFormComponentIsStateful(formFiber) { 12102 var existingStateHook = formFiber.memoizedState; 12103 if (null !== existingStateHook) return existingStateHook; 12104 existingStateHook = { 12105 memoizedState: sharedNotPendingObject, 12106 baseState: sharedNotPendingObject, 12107 baseQueue: null, 12108 queue: { 12109 pending: null, 12110 lanes: 0, 12111 dispatch: null, 12112 lastRenderedReducer: basicStateReducer, 12113 lastRenderedState: sharedNotPendingObject 12114 }, 12115 next: null 12116 }; 12117 var initialResetState = {}; 12118 existingStateHook.next = { 12119 memoizedState: initialResetState, 12120 baseState: initialResetState, 12121 baseQueue: null, 12122 queue: { 12123 pending: null, 12124 lanes: 0, 12125 dispatch: null, 12126 lastRenderedReducer: basicStateReducer, 12127 lastRenderedState: initialResetState 12128 }, 12129 next: null 12130 }; 12131 formFiber.memoizedState = existingStateHook; 12132 formFiber = formFiber.alternate; 12133 null !== formFiber && (formFiber.memoizedState = existingStateHook); 12134 return existingStateHook; 12135 } 12136 function requestFormReset$1(formFiber) { 12137 var stateHook = ensureFormComponentIsStateful(formFiber); 12138 null === stateHook.next && (stateHook = formFiber.alternate.memoizedState); 12139 dispatchSetStateInternal( 12140 formFiber, 12141 stateHook.next.queue, 12142 {}, 12143 requestUpdateLane() 12144 ); 12145 } 12146 function useHostTransitionStatus() { 12147 return readContext(HostTransitionContext); 12148 } 12149 function updateId() { 12150 return updateWorkInProgressHook().memoizedState; 12151 } 12152 function updateRefresh() { 12153 return updateWorkInProgressHook().memoizedState; 12154 } 12155 function refreshCache(fiber) { 12156 for (var provider = fiber.return; null !== provider; ) { 12157 switch (provider.tag) { 12158 case 24: 12159 case 3: 12160 var lane = requestUpdateLane(); 12161 fiber = createUpdate(lane); 12162 var root$69 = enqueueUpdate(provider, fiber, lane); 12163 null !== root$69 && 12164 (scheduleUpdateOnFiber(root$69, provider, lane), 12165 entangleTransitions(root$69, provider, lane)); 12166 provider = { cache: createCache() }; 12167 fiber.payload = provider; 12168 return; 12169 } 12170 provider = provider.return; 12171 } 12172 } 12173 function dispatchReducerAction(fiber, queue, action) { 12174 var lane = requestUpdateLane(); 12175 action = { 12176 lane: lane, 12177 revertLane: 0, 12178 gesture: null, 12179 action: action, 12180 hasEagerState: false, 12181 eagerState: null, 12182 next: null 12183 }; 12184 isRenderPhaseUpdate(fiber) 12185 ? enqueueRenderPhaseUpdate(queue, action) 12186 : ((action = enqueueConcurrentHookUpdate(fiber, queue, action, lane)), 12187 null !== action && 12188 (scheduleUpdateOnFiber(action, fiber, lane), 12189 entangleTransitionUpdate(action, queue, lane))); 12190 } 12191 function dispatchSetState(fiber, queue, action) { 12192 var lane = requestUpdateLane(); 12193 dispatchSetStateInternal(fiber, queue, action, lane); 12194 } 12195 function dispatchSetStateInternal(fiber, queue, action, lane) { 12196 var update = { 12197 lane: lane, 12198 revertLane: 0, 12199 gesture: null, 12200 action: action, 12201 hasEagerState: false, 12202 eagerState: null, 12203 next: null 12204 }; 12205 if (isRenderPhaseUpdate(fiber)) enqueueRenderPhaseUpdate(queue, update); 12206 else { 12207 var alternate = fiber.alternate; 12208 if ( 12209 0 === fiber.lanes && 12210 (null === alternate || 0 === alternate.lanes) && 12211 ((alternate = queue.lastRenderedReducer), null !== alternate) 12212 ) 12213 try { 12214 var currentState = queue.lastRenderedState, 12215 eagerState = alternate(currentState, action); 12216 update.hasEagerState = !0; 12217 update.eagerState = eagerState; 12218 if (objectIs(eagerState, currentState)) 12219 return ( 12220 enqueueUpdate$1(fiber, queue, update, 0), 12221 null === workInProgressRoot && finishQueueingConcurrentUpdates(), 12222 !1
vendor: 122,473 bytes, lines 12222-15675
12222 12223 ); 12224 } catch (error) { 12225 } finally { 12226 } 12227 action = enqueueConcurrentHookUpdate(fiber, queue, update, lane); 12228 if (null !== action) 12229 return ( 12230 scheduleUpdateOnFiber(action, fiber, lane), 12231 entangleTransitionUpdate(action, queue, lane), 12232 true 12233 ); 12234 } 12235 return false; 12236 } 12237 function dispatchOptimisticSetState(fiber, throwIfDuringRender, queue, action) { 12238 action = { 12239 lane: 2, 12240 revertLane: requestTransitionLane(), 12241 gesture: null, 12242 action: action, 12243 hasEagerState: false, 12244 eagerState: null, 12245 next: null 12246 }; 12247 if (isRenderPhaseUpdate(fiber)) { 12248 if (throwIfDuringRender) throw Error(formatProdErrorMessage(479)); 12249 } else 12250 (throwIfDuringRender = enqueueConcurrentHookUpdate( 12251 fiber, 12252 queue, 12253 action, 12254 2 12255 )), 12256 null !== throwIfDuringRender && 12257 scheduleUpdateOnFiber(throwIfDuringRender, fiber, 2); 12258 } 12259 function isRenderPhaseUpdate(fiber) { 12260 var alternate = fiber.alternate; 12261 return ( 12262 fiber === currentlyRenderingFiber || 12263 (null !== alternate && alternate === currentlyRenderingFiber) 12264 ); 12265 } 12266 function enqueueRenderPhaseUpdate(queue, update) { 12267 didScheduleRenderPhaseUpdateDuringThisPass = didScheduleRenderPhaseUpdate = 12268 true; 12269 var pending = queue.pending; 12270 null === pending 12271 ? (update.next = update) 12272 : ((update.next = pending.next), (pending.next = update)); 12273 queue.pending = update; 12274 } 12275 function entangleTransitionUpdate(root, queue, lane) { 12276 if (0 !== (lane & 4194048)) { 12277 var queueLanes = queue.lanes; 12278 queueLanes &= root.pendingLanes; 12279 lane |= queueLanes; 12280 queue.lanes = lane; 12281 markRootEntangled(root, lane); 12282 } 12283 } 12284 var ContextOnlyDispatcher = { 12285 readContext: readContext, 12286 use: use, 12287 useCallback: throwInvalidHookError, 12288 useContext: throwInvalidHookError, 12289 useEffect: throwInvalidHookError, 12290 useImperativeHandle: throwInvalidHookError, 12291 useLayoutEffect: throwInvalidHookError, 12292 useInsertionEffect: throwInvalidHookError, 12293 useMemo: throwInvalidHookError, 12294 useReducer: throwInvalidHookError, 12295 useRef: throwInvalidHookError, 12296 useState: throwInvalidHookError, 12297 useDebugValue: throwInvalidHookError, 12298 useDeferredValue: throwInvalidHookError, 12299 useTransition: throwInvalidHookError, 12300 useSyncExternalStore: throwInvalidHookError, 12301 useId: throwInvalidHookError, 12302 useHostTransitionStatus: throwInvalidHookError, 12303 useFormState: throwInvalidHookError, 12304 useActionState: throwInvalidHookError, 12305 useOptimistic: throwInvalidHookError, 12306 useMemoCache: throwInvalidHookError, 12307 useCacheRefresh: throwInvalidHookError 12308 }; 12309 ContextOnlyDispatcher.useEffectEvent = throwInvalidHookError; 12310 var HooksDispatcherOnMount = { 12311 readContext: readContext, 12312 use: use, 12313 useCallback: function (callback, deps) { 12314 mountWorkInProgressHook().memoizedState = [ 12315 callback, 12316 void 0 === deps ? null : deps 12317 ]; 12318 return callback; 12319 }, 12320 useContext: readContext, 12321 useEffect: mountEffect, 12322 useImperativeHandle: function (ref, create, deps) { 12323 deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null; 12324 mountEffectImpl( 12325 4194308, 12326 4, 12327 imperativeHandleEffect.bind(null, create, ref), 12328 deps 12329 ); 12330 }, 12331 useLayoutEffect: function (create, deps) { 12332 return mountEffectImpl(4194308, 4, create, deps); 12333 }, 12334 useInsertionEffect: function (create, deps) { 12335 mountEffectImpl(4, 2, create, deps); 12336 }, 12337 useMemo: function (nextCreate, deps) { 12338 var hook = mountWorkInProgressHook(); 12339 deps = void 0 === deps ? null : deps; 12340 var nextValue = nextCreate(); 12341 if (shouldDoubleInvokeUserFnsInHooksDEV) { 12342 setIsStrictModeForDevtools(true); 12343 try { 12344 nextCreate(); 12345 } finally { 12346 setIsStrictModeForDevtools(false); 12347 } 12348 } 12349 hook.memoizedState = [nextValue, deps]; 12350 return nextValue; 12351 }, 12352 useReducer: function (reducer, initialArg, init) { 12353 var hook = mountWorkInProgressHook(); 12354 if (void 0 !== init) { 12355 var initialState = init(initialArg); 12356 if (shouldDoubleInvokeUserFnsInHooksDEV) { 12357 setIsStrictModeForDevtools(true); 12358 try { 12359 init(initialArg); 12360 } finally { 12361 setIsStrictModeForDevtools(false); 12362 } 12363 } 12364 } else initialState = initialArg; 12365 hook.memoizedState = hook.baseState = initialState; 12366 reducer = { 12367 pending: null, 12368 lanes: 0, 12369 dispatch: null, 12370 lastRenderedReducer: reducer, 12371 lastRenderedState: initialState 12372 }; 12373 hook.queue = reducer; 12374 reducer = reducer.dispatch = dispatchReducerAction.bind( 12375 null, 12376 currentlyRenderingFiber, 12377 reducer 12378 ); 12379 return [hook.memoizedState, reducer]; 12380 }, 12381 useRef: function (initialValue) { 12382 var hook = mountWorkInProgressHook(); 12383 initialValue = { current: initialValue }; 12384 return (hook.memoizedState = initialValue); 12385 }, 12386 useState: function (initialState) { 12387 initialState = mountStateImpl(initialState); 12388 var queue = initialState.queue, 12389 dispatch = dispatchSetState.bind(null, currentlyRenderingFiber, queue); 12390 queue.dispatch = dispatch; 12391 return [initialState.memoizedState, dispatch]; 12392 }, 12393 useDebugValue: mountDebugValue, 12394 useDeferredValue: function (value, initialValue) { 12395 var hook = mountWorkInProgressHook(); 12396 return mountDeferredValueImpl(hook, value, initialValue); 12397 }, 12398 useTransition: function () { 12399 var stateHook = mountStateImpl(false); 12400 stateHook = startTransition.bind( 12401 null, 12402 currentlyRenderingFiber, 12403 stateHook.queue, 12404 true, 12405 false 12406 ); 12407 mountWorkInProgressHook().memoizedState = stateHook; 12408 return [false, stateHook]; 12409 }, 12410 useSyncExternalStore: function (subscribe, getSnapshot, getServerSnapshot) { 12411 var fiber = currentlyRenderingFiber, 12412 hook = mountWorkInProgressHook(); 12413 if (isHydrating) { 12414 if (void 0 === getServerSnapshot) 12415 throw Error(formatProdErrorMessage(407)); 12416 getServerSnapshot = getServerSnapshot(); 12417 } else { 12418 getServerSnapshot = getSnapshot(); 12419 if (null === workInProgressRoot) 12420 throw Error(formatProdErrorMessage(349)); 12421 0 !== (workInProgressRootRenderLanes & 127) || 12422 pushStoreConsistencyCheck(fiber, getSnapshot, getServerSnapshot); 12423 } 12424 hook.memoizedState = getServerSnapshot; 12425 var inst = { value: getServerSnapshot, getSnapshot: getSnapshot }; 12426 hook.queue = inst; 12427 mountEffect(subscribeToStore.bind(null, fiber, inst, subscribe), [ 12428 subscribe 12429 ]); 12430 fiber.flags |= 2048; 12431 pushSimpleEffect( 12432 9, 12433 { destroy: void 0 }, 12434 updateStoreInstance.bind( 12435 null, 12436 fiber, 12437 inst, 12438 getServerSnapshot, 12439 getSnapshot 12440 ), 12441 null 12442 ); 12443 return getServerSnapshot; 12444 }, 12445 useId: function () { 12446 var hook = mountWorkInProgressHook(), 12447 identifierPrefix = workInProgressRoot.identifierPrefix; 12448 if (isHydrating) { 12449 var JSCompiler_inline_result = treeContextOverflow; 12450 var idWithLeadingBit = treeContextId; 12451 JSCompiler_inline_result = 12452 ( 12453 idWithLeadingBit & ~(1 << (32 - clz32(idWithLeadingBit) - 1)) 12454 ).toString(32) + JSCompiler_inline_result; 12455 identifierPrefix = 12456 "_" + identifierPrefix + "R_" + JSCompiler_inline_result; 12457 JSCompiler_inline_result = localIdCounter++; 12458 0 < JSCompiler_inline_result && 12459 (identifierPrefix += "H" + JSCompiler_inline_result.toString(32)); 12460 identifierPrefix += "_"; 12461 } else 12462 (JSCompiler_inline_result = globalClientIdCounter++), 12463 (identifierPrefix = 12464 "_" + 12465 identifierPrefix + 12466 "r_" + 12467 JSCompiler_inline_result.toString(32) + 12468 "_"); 12469 return (hook.memoizedState = identifierPrefix); 12470 }, 12471 useHostTransitionStatus: useHostTransitionStatus, 12472 useFormState: mountActionState, 12473 useActionState: mountActionState, 12474 useOptimistic: function (passthrough) { 12475 var hook = mountWorkInProgressHook(); 12476 hook.memoizedState = hook.baseState = passthrough; 12477 var queue = { 12478 pending: null, 12479 lanes: 0, 12480 dispatch: null, 12481 lastRenderedReducer: null, 12482 lastRenderedState: null 12483 }; 12484 hook.queue = queue; 12485 hook = dispatchOptimisticSetState.bind( 12486 null, 12487 currentlyRenderingFiber, 12488 true, 12489 queue 12490 ); 12491 queue.dispatch = hook; 12492 return [passthrough, hook]; 12493 }, 12494 useMemoCache: useMemoCache, 12495 useCacheRefresh: function () { 12496 return (mountWorkInProgressHook().memoizedState = refreshCache.bind( 12497 null, 12498 currentlyRenderingFiber 12499 )); 12500 }, 12501 useEffectEvent: function (callback) { 12502 var hook = mountWorkInProgressHook(), 12503 ref = { impl: callback }; 12504 hook.memoizedState = ref; 12505 return function () { 12506 if (0 !== (executionContext & 2)) 12507 throw Error(formatProdErrorMessage(440)); 12508 return ref.impl.apply(void 0, arguments); 12509 }; 12510 } 12511 }, 12512 HooksDispatcherOnUpdate = { 12513 readContext: readContext, 12514 use: use, 12515 useCallback: updateCallback, 12516 useContext: readContext, 12517 useEffect: updateEffect, 12518 useImperativeHandle: updateImperativeHandle, 12519 useInsertionEffect: updateInsertionEffect, 12520 useLayoutEffect: updateLayoutEffect, 12521 useMemo: updateMemo, 12522 useReducer: updateReducer, 12523 useRef: updateRef, 12524 useState: function () { 12525 return updateReducer(basicStateReducer); 12526 }, 12527 useDebugValue: mountDebugValue, 12528 useDeferredValue: function (value, initialValue) { 12529 var hook = updateWorkInProgressHook(); 12530 return updateDeferredValueImpl( 12531 hook, 12532 currentHook.memoizedState, 12533 value, 12534 initialValue 12535 ); 12536 }, 12537 useTransition: function () { 12538 var booleanOrThenable = updateReducer(basicStateReducer)[0], 12539 start = updateWorkInProgressHook().memoizedState; 12540 return [ 12541 "boolean" === typeof booleanOrThenable 12542 ? booleanOrThenable 12543 : useThenable(booleanOrThenable), 12544 start 12545 ]; 12546 }, 12547 useSyncExternalStore: updateSyncExternalStore, 12548 useId: updateId, 12549 useHostTransitionStatus: useHostTransitionStatus, 12550 useFormState: updateActionState, 12551 useActionState: updateActionState, 12552 useOptimistic: function (passthrough, reducer) { 12553 var hook = updateWorkInProgressHook(); 12554 return updateOptimisticImpl(hook, currentHook, passthrough, reducer); 12555 }, 12556 useMemoCache: useMemoCache, 12557 useCacheRefresh: updateRefresh 12558 }; 12559 HooksDispatcherOnUpdate.useEffectEvent = updateEvent; 12560 var HooksDispatcherOnRerender = { 12561 readContext: readContext, 12562 use: use, 12563 useCallback: updateCallback, 12564 useContext: readContext, 12565 useEffect: updateEffect, 12566 useImperativeHandle: updateImperativeHandle, 12567 useInsertionEffect: updateInsertionEffect, 12568 useLayoutEffect: updateLayoutEffect, 12569 useMemo: updateMemo, 12570 useReducer: rerenderReducer, 12571 useRef: updateRef, 12572 useState: function () { 12573 return rerenderReducer(basicStateReducer); 12574 }, 12575 useDebugValue: mountDebugValue, 12576 useDeferredValue: function (value, initialValue) { 12577 var hook = updateWorkInProgressHook(); 12578 return null === currentHook 12579 ? mountDeferredValueImpl(hook, value, initialValue) 12580 : updateDeferredValueImpl( 12581 hook, 12582 currentHook.memoizedState, 12583 value, 12584 initialValue 12585 ); 12586 }, 12587 useTransition: function () { 12588 var booleanOrThenable = rerenderReducer(basicStateReducer)[0], 12589 start = updateWorkInProgressHook().memoizedState; 12590 return [ 12591 "boolean" === typeof booleanOrThenable 12592 ? booleanOrThenable 12593 : useThenable(booleanOrThenable), 12594 start 12595 ]; 12596 }, 12597 useSyncExternalStore: updateSyncExternalStore, 12598 useId: updateId, 12599 useHostTransitionStatus: useHostTransitionStatus, 12600 useFormState: rerenderActionState, 12601 useActionState: rerenderActionState, 12602 useOptimistic: function (passthrough, reducer) { 12603 var hook = updateWorkInProgressHook(); 12604 if (null !== currentHook) 12605 return updateOptimisticImpl(hook, currentHook, passthrough, reducer); 12606 hook.baseState = passthrough; 12607 return [passthrough, hook.queue.dispatch]; 12608 }, 12609 useMemoCache: useMemoCache, 12610 useCacheRefresh: updateRefresh 12611 }; 12612 HooksDispatcherOnRerender.useEffectEvent = updateEvent; 12613 function applyDerivedStateFromProps( 12614 workInProgress, 12615 ctor, 12616 getDerivedStateFromProps, 12617 nextProps 12618 ) { 12619 ctor = workInProgress.memoizedState; 12620 getDerivedStateFromProps = getDerivedStateFromProps(nextProps, ctor); 12621 getDerivedStateFromProps = 12622 null === getDerivedStateFromProps || void 0 === getDerivedStateFromProps 12623 ? ctor 12624 : assign({}, ctor, getDerivedStateFromProps); 12625 workInProgress.memoizedState = getDerivedStateFromProps; 12626 0 === workInProgress.lanes && 12627 (workInProgress.updateQueue.baseState = getDerivedStateFromProps); 12628 } 12629 var classComponentUpdater = { 12630 enqueueSetState: function (inst, payload, callback) { 12631 inst = inst._reactInternals; 12632 var lane = requestUpdateLane(), 12633 update = createUpdate(lane); 12634 update.payload = payload; 12635 void 0 !== callback && null !== callback && (update.callback = callback); 12636 payload = enqueueUpdate(inst, update, lane); 12637 null !== payload && 12638 (scheduleUpdateOnFiber(payload, inst, lane), 12639 entangleTransitions(payload, inst, lane)); 12640 }, 12641 enqueueReplaceState: function (inst, payload, callback) { 12642 inst = inst._reactInternals; 12643 var lane = requestUpdateLane(), 12644 update = createUpdate(lane); 12645 update.tag = 1; 12646 update.payload = payload; 12647 void 0 !== callback && null !== callback && (update.callback = callback); 12648 payload = enqueueUpdate(inst, update, lane); 12649 null !== payload && 12650 (scheduleUpdateOnFiber(payload, inst, lane), 12651 entangleTransitions(payload, inst, lane)); 12652 }, 12653 enqueueForceUpdate: function (inst, callback) { 12654 inst = inst._reactInternals; 12655 var lane = requestUpdateLane(), 12656 update = createUpdate(lane); 12657 update.tag = 2; 12658 void 0 !== callback && null !== callback && (update.callback = callback); 12659 callback = enqueueUpdate(inst, update, lane); 12660 null !== callback && 12661 (scheduleUpdateOnFiber(callback, inst, lane), 12662 entangleTransitions(callback, inst, lane)); 12663 } 12664 }; 12665 function checkShouldComponentUpdate( 12666 workInProgress, 12667 ctor, 12668 oldProps, 12669 newProps, 12670 oldState, 12671 newState, 12672 nextContext 12673 ) { 12674 workInProgress = workInProgress.stateNode; 12675 return "function" === typeof workInProgress.shouldComponentUpdate 12676 ? workInProgress.shouldComponentUpdate(newProps, newState, nextContext) 12677 : ctor.prototype && ctor.prototype.isPureReactComponent 12678 ? !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState) 12679 : true; 12680 } 12681 function callComponentWillReceiveProps( 12682 workInProgress, 12683 instance, 12684 newProps, 12685 nextContext 12686 ) { 12687 workInProgress = instance.state; 12688 "function" === typeof instance.componentWillReceiveProps && 12689 instance.componentWillReceiveProps(newProps, nextContext); 12690 "function" === typeof instance.UNSAFE_componentWillReceiveProps && 12691 instance.UNSAFE_componentWillReceiveProps(newProps, nextContext); 12692 instance.state !== workInProgress && 12693 classComponentUpdater.enqueueReplaceState(instance, instance.state, null); 12694 } 12695 function resolveClassComponentProps(Component, baseProps) { 12696 var newProps = baseProps; 12697 if ("ref" in baseProps) { 12698 newProps = {}; 12699 for (var propName in baseProps) 12700 "ref" !== propName && (newProps[propName] = baseProps[propName]); 12701 } 12702 if ((Component = Component.defaultProps)) { 12703 newProps === baseProps && (newProps = assign({}, newProps)); 12704 for (var propName$73 in Component) 12705 void 0 === newProps[propName$73] && 12706 (newProps[propName$73] = Component[propName$73]); 12707 } 12708 return newProps; 12709 } 12710 function defaultOnUncaughtError(error) { 12711 reportGlobalError(error); 12712 } 12713 function defaultOnCaughtError(error) { 12714 console.error(error); 12715 } 12716 function defaultOnRecoverableError(error) { 12717 reportGlobalError(error); 12718 } 12719 function logUncaughtError(root, errorInfo) { 12720 try { 12721 var onUncaughtError = root.onUncaughtError; 12722 onUncaughtError(errorInfo.value, { componentStack: errorInfo.stack }); 12723 } catch (e$74) { 12724 setTimeout(function () { 12725 throw e$74; 12726 }); 12727 } 12728 } 12729 function logCaughtError(root, boundary, errorInfo) { 12730 try { 12731 var onCaughtError = root.onCaughtError; 12732 onCaughtError(errorInfo.value, { 12733 componentStack: errorInfo.stack, 12734 errorBoundary: 1 === boundary.tag ? boundary.stateNode : null 12735 }); 12736 } catch (e$75) { 12737 setTimeout(function () { 12738 throw e$75; 12739 }); 12740 } 12741 } 12742 function createRootErrorUpdate(root, errorInfo, lane) { 12743 lane = createUpdate(lane); 12744 lane.tag = 3; 12745 lane.payload = { element: null }; 12746 lane.callback = function () { 12747 logUncaughtError(root, errorInfo); 12748 }; 12749 return lane; 12750 } 12751 function createClassErrorUpdate(lane) { 12752 lane = createUpdate(lane); 12753 lane.tag = 3; 12754 return lane; 12755 } 12756 function initializeClassErrorUpdate(update, root, fiber, errorInfo) { 12757 var getDerivedStateFromError = fiber.type.getDerivedStateFromError; 12758 if ("function" === typeof getDerivedStateFromError) { 12759 var error = errorInfo.value; 12760 update.payload = function () { 12761 return getDerivedStateFromError(error); 12762 }; 12763 update.callback = function () { 12764 logCaughtError(root, fiber, errorInfo); 12765 }; 12766 } 12767 var inst = fiber.stateNode; 12768 null !== inst && 12769 "function" === typeof inst.componentDidCatch && 12770 (update.callback = function () { 12771 logCaughtError(root, fiber, errorInfo); 12772 "function" !== typeof getDerivedStateFromError && 12773 (null === legacyErrorBoundariesThatAlreadyFailed 12774 ? (legacyErrorBoundariesThatAlreadyFailed = new Set([this])) 12775 : legacyErrorBoundariesThatAlreadyFailed.add(this)); 12776 var stack = errorInfo.stack; 12777 this.componentDidCatch(errorInfo.value, { 12778 componentStack: null !== stack ? stack : "" 12779 }); 12780 }); 12781 } 12782 function throwException( 12783 root, 12784 returnFiber, 12785 sourceFiber, 12786 value, 12787 rootRenderLanes 12788 ) { 12789 sourceFiber.flags |= 32768; 12790 if ( 12791 null !== value && 12792 "object" === typeof value && 12793 "function" === typeof value.then 12794 ) { 12795 returnFiber = sourceFiber.alternate; 12796 null !== returnFiber && 12797 propagateParentContextChanges( 12798 returnFiber, 12799 sourceFiber, 12800 rootRenderLanes, 12801 true 12802 ); 12803 sourceFiber = suspenseHandlerStackCursor.current; 12804 if (null !== sourceFiber) { 12805 switch (sourceFiber.tag) { 12806 case 31: 12807 case 13: 12808 return ( 12809 null === shellBoundary 12810 ? renderDidSuspendDelayIfPossible() 12811 : null === sourceFiber.alternate && 12812 0 === workInProgressRootExitStatus && 12813 (workInProgressRootExitStatus = 3), 12814 (sourceFiber.flags &= -257), 12815 (sourceFiber.flags |= 65536), 12816 (sourceFiber.lanes = rootRenderLanes), 12817 value === noopSuspenseyCommitThenable 12818 ? (sourceFiber.flags |= 16384) 12819 : ((returnFiber = sourceFiber.updateQueue), 12820 null === returnFiber 12821 ? (sourceFiber.updateQueue = new Set([value])) 12822 : returnFiber.add(value), 12823 attachPingListener(root, value, rootRenderLanes)), 12824 false 12825 ); 12826 case 22: 12827 return ( 12828 (sourceFiber.flags |= 65536), 12829 value === noopSuspenseyCommitThenable 12830 ? (sourceFiber.flags |= 16384) 12831 : ((returnFiber = sourceFiber.updateQueue), 12832 null === returnFiber 12833 ? ((returnFiber = { 12834 transitions: null, 12835 markerInstances: null, 12836 retryQueue: new Set([value]) 12837 }), 12838 (sourceFiber.updateQueue = returnFiber)) 12839 : ((sourceFiber = returnFiber.retryQueue), 12840 null === sourceFiber 12841 ? (returnFiber.retryQueue = new Set([value])) 12842 : sourceFiber.add(value)), 12843 attachPingListener(root, value, rootRenderLanes)), 12844 false 12845 ); 12846 } 12847 throw Error(formatProdErrorMessage(435, sourceFiber.tag)); 12848 } 12849 attachPingListener(root, value, rootRenderLanes); 12850 renderDidSuspendDelayIfPossible(); 12851 return false; 12852 } 12853 if (isHydrating) 12854 return ( 12855 (returnFiber = suspenseHandlerStackCursor.current), 12856 null !== returnFiber 12857 ? (0 === (returnFiber.flags & 65536) && (returnFiber.flags |= 256), 12858 (returnFiber.flags |= 65536), 12859 (returnFiber.lanes = rootRenderLanes), 12860 value !== HydrationMismatchException && 12861 ((root = Error(formatProdErrorMessage(422), { cause: value })), 12862 queueHydrationError(createCapturedValueAtFiber(root, sourceFiber)))) 12863 : (value !== HydrationMismatchException && 12864 ((returnFiber = Error(formatProdErrorMessage(423), { 12865 cause: value 12866 })), 12867 queueHydrationError( 12868 createCapturedValueAtFiber(returnFiber, sourceFiber) 12869 )), 12870 (root = root.current.alternate), 12871 (root.flags |= 65536), 12872 (rootRenderLanes &= -rootRenderLanes), 12873 (root.lanes |= rootRenderLanes), 12874 (value = createCapturedValueAtFiber(value, sourceFiber)), 12875 (rootRenderLanes = createRootErrorUpdate( 12876 root.stateNode, 12877 value, 12878 rootRenderLanes 12879 )), 12880 enqueueCapturedUpdate(root, rootRenderLanes), 12881 4 !== workInProgressRootExitStatus && 12882 (workInProgressRootExitStatus = 2)), 12883 false 12884 ); 12885 var wrapperError = Error(formatProdErrorMessage(520), { cause: value }); 12886 wrapperError = createCapturedValueAtFiber(wrapperError, sourceFiber); 12887 null === workInProgressRootConcurrentErrors 12888 ? (workInProgressRootConcurrentErrors = [wrapperError]) 12889 : workInProgressRootConcurrentErrors.push(wrapperError); 12890 4 !== workInProgressRootExitStatus && (workInProgressRootExitStatus = 2); 12891 if (null === returnFiber) return true; 12892 value = createCapturedValueAtFiber(value, sourceFiber); 12893 sourceFiber = returnFiber; 12894 do { 12895 switch (sourceFiber.tag) { 12896 case 3: 12897 return ( 12898 (sourceFiber.flags |= 65536), 12899 (root = rootRenderLanes & -rootRenderLanes), 12900 (sourceFiber.lanes |= root), 12901 (root = createRootErrorUpdate(sourceFiber.stateNode, value, root)), 12902 enqueueCapturedUpdate(sourceFiber, root), 12903 false 12904 ); 12905 case 1: 12906 if ( 12907 ((returnFiber = sourceFiber.type), 12908 (wrapperError = sourceFiber.stateNode), 12909 0 === (sourceFiber.flags & 128) && 12910 ("function" === typeof returnFiber.getDerivedStateFromError || 12911 (null !== wrapperError && 12912 "function" === typeof wrapperError.componentDidCatch && 12913 (null === legacyErrorBoundariesThatAlreadyFailed || 12914 !legacyErrorBoundariesThatAlreadyFailed.has(wrapperError))))) 12915 ) 12916 return ( 12917 (sourceFiber.flags |= 65536), 12918 (rootRenderLanes &= -rootRenderLanes), 12919 (sourceFiber.lanes |= rootRenderLanes), 12920 (rootRenderLanes = createClassErrorUpdate(rootRenderLanes)), 12921 initializeClassErrorUpdate( 12922 rootRenderLanes, 12923 root, 12924 sourceFiber, 12925 value 12926 ), 12927 enqueueCapturedUpdate(sourceFiber, rootRenderLanes), 12928 false 12929 ); 12930 } 12931 sourceFiber = sourceFiber.return; 12932 } while (null !== sourceFiber); 12933 return false; 12934 } 12935 var SelectiveHydrationException = Error(formatProdErrorMessage(461)), 12936 didReceiveUpdate = false; 12937 function reconcileChildren(current, workInProgress, nextChildren, renderLanes) { 12938 workInProgress.child = 12939 null === current 12940 ? mountChildFibers(workInProgress, null, nextChildren, renderLanes) 12941 : reconcileChildFibers( 12942 workInProgress, 12943 current.child, 12944 nextChildren, 12945 renderLanes 12946 ); 12947 } 12948 function updateForwardRef( 12949 current, 12950 workInProgress, 12951 Component, 12952 nextProps, 12953 renderLanes 12954 ) { 12955 Component = Component.render; 12956 var ref = workInProgress.ref; 12957 if ("ref" in nextProps) { 12958 var propsWithoutRef = {}; 12959 for (var key in nextProps) 12960 "ref" !== key && (propsWithoutRef[key] = nextProps[key]); 12961 } else propsWithoutRef = nextProps; 12962 prepareToReadContext(workInProgress); 12963 nextProps = renderWithHooks( 12964 current, 12965 workInProgress, 12966 Component, 12967 propsWithoutRef, 12968 ref, 12969 renderLanes 12970 ); 12971 key = checkDidRenderIdHook(); 12972 if (null !== current && !didReceiveUpdate) 12973 return ( 12974 bailoutHooks(current, workInProgress, renderLanes), 12975 bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) 12976 ); 12977 isHydrating && key && pushMaterializedTreeId(workInProgress); 12978 workInProgress.flags |= 1; 12979 reconcileChildren(current, workInProgress, nextProps, renderLanes); 12980 return workInProgress.child; 12981 } 12982 function updateMemoComponent( 12983 current, 12984 workInProgress, 12985 Component, 12986 nextProps, 12987 renderLanes 12988 ) { 12989 if (null === current) { 12990 var type = Component.type; 12991 if ( 12992 "function" === typeof type && 12993 !shouldConstruct(type) && 12994 void 0 === type.defaultProps && 12995 null === Component.compare 12996 ) 12997 return ( 12998 (workInProgress.tag = 15), 12999 (workInProgress.type = type), 13000 updateSimpleMemoComponent( 13001 current, 13002 workInProgress, 13003 type, 13004 nextProps, 13005 renderLanes 13006 ) 13007 ); 13008 current = createFiberFromTypeAndProps( 13009 Component.type, 13010 null, 13011 nextProps, 13012 workInProgress, 13013 workInProgress.mode, 13014 renderLanes 13015 ); 13016 current.ref = workInProgress.ref; 13017 current.return = workInProgress; 13018 return (workInProgress.child = current); 13019 } 13020 type = current.child; 13021 if (!checkScheduledUpdateOrContext(current, renderLanes)) { 13022 var prevProps = type.memoizedProps; 13023 Component = Component.compare; 13024 Component = null !== Component ? Component : shallowEqual; 13025 if (Component(prevProps, nextProps) && current.ref === workInProgress.ref) 13026 return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes); 13027 } 13028 workInProgress.flags |= 1; 13029 current = createWorkInProgress(type, nextProps); 13030 current.ref = workInProgress.ref; 13031 current.return = workInProgress; 13032 return (workInProgress.child = current); 13033 } 13034 function updateSimpleMemoComponent( 13035 current, 13036 workInProgress, 13037 Component, 13038 nextProps, 13039 renderLanes 13040 ) { 13041 if (null !== current) { 13042 var prevProps = current.memoizedProps; 13043 if ( 13044 shallowEqual(prevProps, nextProps) && 13045 current.ref === workInProgress.ref 13046 ) 13047 if ( 13048 ((didReceiveUpdate = false), 13049 (workInProgress.pendingProps = nextProps = prevProps), 13050 checkScheduledUpdateOrContext(current, renderLanes)) 13051 ) 13052 0 !== (current.flags & 131072) && (didReceiveUpdate = true); 13053 else 13054 return ( 13055 (workInProgress.lanes = current.lanes), 13056 bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) 13057 ); 13058 } 13059 return updateFunctionComponent( 13060 current, 13061 workInProgress, 13062 Component, 13063 nextProps, 13064 renderLanes 13065 ); 13066 } 13067 function updateOffscreenComponent( 13068 current, 13069 workInProgress, 13070 renderLanes, 13071 nextProps 13072 ) { 13073 var nextChildren = nextProps.children, 13074 prevState = null !== current ? current.memoizedState : null; 13075 null === current && 13076 null === workInProgress.stateNode && 13077 (workInProgress.stateNode = { 13078 _visibility: 1, 13079 _pendingMarkers: null, 13080 _retryCache: null, 13081 _transitions: null 13082 }); 13083 if ("hidden" === nextProps.mode) { 13084 if (0 !== (workInProgress.flags & 128)) { 13085 prevState = 13086 null !== prevState ? prevState.baseLanes | renderLanes : renderLanes; 13087 if (null !== current) { 13088 nextProps = workInProgress.child = current.child; 13089 for (nextChildren = 0; null !== nextProps; ) 13090 (nextChildren = 13091 nextChildren | nextProps.lanes | nextProps.childLanes), 13092 (nextProps = nextProps.sibling); 13093 nextProps = nextChildren & ~prevState; 13094 } else (nextProps = 0), (workInProgress.child = null); 13095 return deferHiddenOffscreenComponent( 13096 current, 13097 workInProgress, 13098 prevState, 13099 renderLanes, 13100 nextProps 13101 ); 13102 } 13103 if (0 !== (renderLanes & 536870912)) 13104 (workInProgress.memoizedState = { baseLanes: 0, cachePool: null }), 13105 null !== current && 13106 pushTransition( 13107 workInProgress, 13108 null !== prevState ? prevState.cachePool : null 13109 ), 13110 null !== prevState 13111 ? pushHiddenContext(workInProgress, prevState) 13112 : reuseHiddenContextOnStack(), 13113 pushOffscreenSuspenseHandler(workInProgress); 13114 else 13115 return ( 13116 (nextProps = workInProgress.lanes = 536870912), 13117 deferHiddenOffscreenComponent( 13118 current, 13119 workInProgress, 13120 null !== prevState ? prevState.baseLanes | renderLanes : renderLanes, 13121 renderLanes, 13122 nextProps 13123 ) 13124 ); 13125 } else 13126 null !== prevState 13127 ? (pushTransition(workInProgress, prevState.cachePool), 13128 pushHiddenContext(workInProgress, prevState), 13129 reuseSuspenseHandlerOnStack(), 13130 (workInProgress.memoizedState = null)) 13131 : (null !== current && pushTransition(workInProgress, null), 13132 reuseHiddenContextOnStack(), 13133 reuseSuspenseHandlerOnStack()); 13134 reconcileChildren(current, workInProgress, nextChildren, renderLanes); 13135 return workInProgress.child; 13136 } 13137 function bailoutOffscreenComponent(current, workInProgress) { 13138 (null !== current && 22 === current.tag) || 13139 null !== workInProgress.stateNode || 13140 (workInProgress.stateNode = { 13141 _visibility: 1, 13142 _pendingMarkers: null, 13143 _retryCache: null, 13144 _transitions: null 13145 }); 13146 return workInProgress.sibling; 13147 } 13148 function deferHiddenOffscreenComponent( 13149 current, 13150 workInProgress, 13151 nextBaseLanes, 13152 renderLanes, 13153 remainingChildLanes 13154 ) { 13155 var JSCompiler_inline_result = peekCacheFromPool(); 13156 JSCompiler_inline_result = 13157 null === JSCompiler_inline_result 13158 ? null 13159 : { parent: CacheContext._currentValue, pool: JSCompiler_inline_result }; 13160 workInProgress.memoizedState = { 13161 baseLanes: nextBaseLanes, 13162 cachePool: JSCompiler_inline_result 13163 }; 13164 null !== current && pushTransition(workInProgress, null); 13165 reuseHiddenContextOnStack(); 13166 pushOffscreenSuspenseHandler(workInProgress); 13167 null !== current && 13168 propagateParentContextChanges(current, workInProgress, renderLanes, true); 13169 workInProgress.childLanes = remainingChildLanes; 13170 return null; 13171 } 13172 function mountActivityChildren(workInProgress, nextProps) { 13173 nextProps = mountWorkInProgressOffscreenFiber( 13174 { mode: nextProps.mode, children: nextProps.children }, 13175 workInProgress.mode 13176 ); 13177 nextProps.ref = workInProgress.ref; 13178 workInProgress.child = nextProps; 13179 nextProps.return = workInProgress; 13180 return nextProps; 13181 } 13182 function retryActivityComponentWithoutHydrating( 13183 current, 13184 workInProgress, 13185 renderLanes 13186 ) { 13187 reconcileChildFibers(workInProgress, current.child, null, renderLanes); 13188 current = mountActivityChildren(workInProgress, workInProgress.pendingProps); 13189 current.flags |= 2; 13190 popSuspenseHandler(workInProgress); 13191 workInProgress.memoizedState = null; 13192 return current; 13193 } 13194 function updateActivityComponent(current, workInProgress, renderLanes) { 13195 var nextProps = workInProgress.pendingProps, 13196 didSuspend = 0 !== (workInProgress.flags & 128); 13197 workInProgress.flags &= -129; 13198 if (null === current) { 13199 if (isHydrating) { 13200 if ("hidden" === nextProps.mode) 13201 return ( 13202 (current = mountActivityChildren(workInProgress, nextProps)), 13203 (workInProgress.lanes = 536870912), 13204 bailoutOffscreenComponent(null, current) 13205 ); 13206 pushDehydratedActivitySuspenseHandler(workInProgress); 13207 (current = nextHydratableInstance) 13208 ? ((current = canHydrateHydrationBoundary( 13209 current, 13210 rootOrSingletonContext 13211 )), 13212 (current = null !== current && "&" === current.data ? current : null), 13213 null !== current && 13214 ((workInProgress.memoizedState = { 13215 dehydrated: current, 13216 treeContext: 13217 null !== treeContextProvider 13218 ? { id: treeContextId, overflow: treeContextOverflow } 13219 : null, 13220 retryLane: 536870912, 13221 hydrationErrors: null 13222 }), 13223 (renderLanes = createFiberFromDehydratedFragment(current)), 13224 (renderLanes.return = workInProgress), 13225 (workInProgress.child = renderLanes), 13226 (hydrationParentFiber = workInProgress), 13227 (nextHydratableInstance = null))) 13228 : (current = null); 13229 if (null === current) throw throwOnHydrationMismatch(workInProgress); 13230 workInProgress.lanes = 536870912; 13231 return null; 13232 } 13233 return mountActivityChildren(workInProgress, nextProps); 13234 } 13235 var prevState = current.memoizedState; 13236 if (null !== prevState) { 13237 var dehydrated = prevState.dehydrated; 13238 pushDehydratedActivitySuspenseHandler(workInProgress); 13239 if (didSuspend) 13240 if (workInProgress.flags & 256) 13241 (workInProgress.flags &= -257), 13242 (workInProgress = retryActivityComponentWithoutHydrating( 13243 current, 13244 workInProgress, 13245 renderLanes 13246 )); 13247 else if (null !== workInProgress.memoizedState) 13248 (workInProgress.child = current.child), 13249 (workInProgress.flags |= 128), 13250 (workInProgress = null); 13251 else throw Error(formatProdErrorMessage(558)); 13252 else if ( 13253 (didReceiveUpdate || 13254 propagateParentContextChanges(current, workInProgress, renderLanes, false), 13255 (didSuspend = 0 !== (renderLanes & current.childLanes)), 13256 didReceiveUpdate || didSuspend) 13257 ) { 13258 nextProps = workInProgressRoot; 13259 if ( 13260 null !== nextProps && 13261 ((dehydrated = getBumpedLaneForHydration(nextProps, renderLanes)), 13262 0 !== dehydrated && dehydrated !== prevState.retryLane) 13263 ) 13264 throw ( 13265 ((prevState.retryLane = dehydrated), 13266 enqueueConcurrentRenderForLane(current, dehydrated), 13267 scheduleUpdateOnFiber(nextProps, current, dehydrated), 13268 SelectiveHydrationException) 13269 ); 13270 renderDidSuspendDelayIfPossible(); 13271 workInProgress = retryActivityComponentWithoutHydrating( 13272 current, 13273 workInProgress, 13274 renderLanes 13275 ); 13276 } else 13277 (current = prevState.treeContext), 13278 (nextHydratableInstance = getNextHydratable(dehydrated.nextSibling)), 13279 (hydrationParentFiber = workInProgress), 13280 (isHydrating = true), 13281 (hydrationErrors = null), 13282 (rootOrSingletonContext = false), 13283 null !== current && 13284 restoreSuspendedTreeContext(workInProgress, current), 13285 (workInProgress = mountActivityChildren(workInProgress, nextProps)), 13286 (workInProgress.flags |= 4096); 13287 return workInProgress; 13288 } 13289 current = createWorkInProgress(current.child, { 13290 mode: nextProps.mode, 13291 children: nextProps.children 13292 }); 13293 current.ref = workInProgress.ref; 13294 workInProgress.child = current; 13295 current.return = workInProgress; 13296 return current; 13297 } 13298 function markRef(current, workInProgress) { 13299 var ref = workInProgress.ref; 13300 if (null === ref) 13301 null !== current && 13302 null !== current.ref && 13303 (workInProgress.flags |= 4194816); 13304 else { 13305 if ("function" !== typeof ref && "object" !== typeof ref) 13306 throw Error(formatProdErrorMessage(284)); 13307 if (null === current || current.ref !== ref) 13308 workInProgress.flags |= 4194816; 13309 } 13310 } 13311 function updateFunctionComponent( 13312 current, 13313 workInProgress, 13314 Component, 13315 nextProps, 13316 renderLanes 13317 ) { 13318 prepareToReadContext(workInProgress); 13319 Component = renderWithHooks( 13320 current, 13321 workInProgress, 13322 Component, 13323 nextProps, 13324 void 0, 13325 renderLanes 13326 ); 13327 nextProps = checkDidRenderIdHook(); 13328 if (null !== current && !didReceiveUpdate) 13329 return ( 13330 bailoutHooks(current, workInProgress, renderLanes), 13331 bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) 13332 ); 13333 isHydrating && nextProps && pushMaterializedTreeId(workInProgress); 13334 workInProgress.flags |= 1; 13335 reconcileChildren(current, workInProgress, Component, renderLanes); 13336 return workInProgress.child; 13337 } 13338 function replayFunctionComponent( 13339 current, 13340 workInProgress, 13341 nextProps, 13342 Component, 13343 secondArg, 13344 renderLanes 13345 ) { 13346 prepareToReadContext(workInProgress); 13347 workInProgress.updateQueue = null; 13348 nextProps = renderWithHooksAgain( 13349 workInProgress, 13350 Component, 13351 nextProps, 13352 secondArg 13353 ); 13354 finishRenderingHooks(current); 13355 Component = checkDidRenderIdHook(); 13356 if (null !== current && !didReceiveUpdate) 13357 return ( 13358 bailoutHooks(current, workInProgress, renderLanes), 13359 bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) 13360 ); 13361 isHydrating && Component && pushMaterializedTreeId(workInProgress); 13362 workInProgress.flags |= 1; 13363 reconcileChildren(current, workInProgress, nextProps, renderLanes); 13364 return workInProgress.child; 13365 } 13366 function updateClassComponent( 13367 current, 13368 workInProgress, 13369 Component, 13370 nextProps, 13371 renderLanes 13372 ) { 13373 prepareToReadContext(workInProgress); 13374 if (null === workInProgress.stateNode) { 13375 var context = emptyContextObject, 13376 contextType = Component.contextType; 13377 "object" === typeof contextType && 13378 null !== contextType && 13379 (context = readContext(contextType)); 13380 context = new Component(nextProps, context); 13381 workInProgress.memoizedState = 13382 null !== context.state && void 0 !== context.state ? context.state : null; 13383 context.updater = classComponentUpdater; 13384 workInProgress.stateNode = context; 13385 context._reactInternals = workInProgress; 13386 context = workInProgress.stateNode; 13387 context.props = nextProps; 13388 context.state = workInProgress.memoizedState; 13389 context.refs = {}; 13390 initializeUpdateQueue(workInProgress); 13391 contextType = Component.contextType; 13392 context.context = 13393 "object" === typeof contextType && null !== contextType 13394 ? readContext(contextType) 13395 : emptyContextObject; 13396 context.state = workInProgress.memoizedState; 13397 contextType = Component.getDerivedStateFromProps; 13398 "function" === typeof contextType && 13399 (applyDerivedStateFromProps( 13400 workInProgress, 13401 Component, 13402 contextType, 13403 nextProps 13404 ), 13405 (context.state = workInProgress.memoizedState)); 13406 "function" === typeof Component.getDerivedStateFromProps || 13407 "function" === typeof context.getSnapshotBeforeUpdate || 13408 ("function" !== typeof context.UNSAFE_componentWillMount && 13409 "function" !== typeof context.componentWillMount) || 13410 ((contextType = context.state), 13411 "function" === typeof context.componentWillMount && 13412 context.componentWillMount(), 13413 "function" === typeof context.UNSAFE_componentWillMount && 13414 context.UNSAFE_componentWillMount(), 13415 contextType !== context.state && 13416 classComponentUpdater.enqueueReplaceState(context, context.state, null), 13417 processUpdateQueue(workInProgress, nextProps, context, renderLanes), 13418 suspendIfUpdateReadFromEntangledAsyncAction(), 13419 (context.state = workInProgress.memoizedState)); 13420 "function" === typeof context.componentDidMount && 13421 (workInProgress.flags |= 4194308); 13422 nextProps = true; 13423 } else if (null === current) { 13424 context = workInProgress.stateNode; 13425 var unresolvedOldProps = workInProgress.memoizedProps, 13426 oldProps = resolveClassComponentProps(Component, unresolvedOldProps); 13427 context.props = oldProps; 13428 var oldContext = context.context, 13429 contextType$jscomp$0 = Component.contextType; 13430 contextType = emptyContextObject; 13431 "object" === typeof contextType$jscomp$0 && 13432 null !== contextType$jscomp$0 && 13433 (contextType = readContext(contextType$jscomp$0)); 13434 var getDerivedStateFromProps = Component.getDerivedStateFromProps; 13435 contextType$jscomp$0 = 13436 "function" === typeof getDerivedStateFromProps || 13437 "function" === typeof context.getSnapshotBeforeUpdate; 13438 unresolvedOldProps = workInProgress.pendingProps !== unresolvedOldProps; 13439 contextType$jscomp$0 || 13440 ("function" !== typeof context.UNSAFE_componentWillReceiveProps && 13441 "function" !== typeof context.componentWillReceiveProps) || 13442 ((unresolvedOldProps || oldContext !== contextType) && 13443 callComponentWillReceiveProps( 13444 workInProgress, 13445 context, 13446 nextProps, 13447 contextType 13448 )); 13449 hasForceUpdate = false; 13450 var oldState = workInProgress.memoizedState; 13451 context.state = oldState; 13452 processUpdateQueue(workInProgress, nextProps, context, renderLanes); 13453 suspendIfUpdateReadFromEntangledAsyncAction(); 13454 oldContext = workInProgress.memoizedState; 13455 unresolvedOldProps || oldState !== oldContext || hasForceUpdate 13456 ? ("function" === typeof getDerivedStateFromProps && 13457 (applyDerivedStateFromProps( 13458 workInProgress, 13459 Component, 13460 getDerivedStateFromProps, 13461 nextProps 13462 ), 13463 (oldContext = workInProgress.memoizedState)), 13464 (oldProps = 13465 hasForceUpdate || 13466 checkShouldComponentUpdate( 13467 workInProgress, 13468 Component, 13469 oldProps, 13470 nextProps, 13471 oldState, 13472 oldContext, 13473 contextType 13474 )) 13475 ? (contextType$jscomp$0 || 13476 ("function" !== typeof context.UNSAFE_componentWillMount && 13477 "function" !== typeof context.componentWillMount) || 13478 ("function" === typeof context.componentWillMount && 13479 context.componentWillMount(), 13480 "function" === typeof context.UNSAFE_componentWillMount && 13481 context.UNSAFE_componentWillMount()), 13482 "function" === typeof context.componentDidMount && 13483 (workInProgress.flags |= 4194308)) 13484 : ("function" === typeof context.componentDidMount && 13485 (workInProgress.flags |= 4194308), 13486 (workInProgress.memoizedProps = nextProps), 13487 (workInProgress.memoizedState = oldContext)), 13488 (context.props = nextProps), 13489 (context.state = oldContext), 13490 (context.context = contextType), 13491 (nextProps = oldProps)) 13492 : ("function" === typeof context.componentDidMount && 13493 (workInProgress.flags |= 4194308), 13494 (nextProps = false)); 13495 } else { 13496 context = workInProgress.stateNode; 13497 cloneUpdateQueue(current, workInProgress); 13498 contextType = workInProgress.memoizedProps; 13499 contextType$jscomp$0 = resolveClassComponentProps(Component, contextType); 13500 context.props = contextType$jscomp$0; 13501 getDerivedStateFromProps = workInProgress.pendingProps; 13502 oldState = context.context; 13503 oldContext = Component.contextType; 13504 oldProps = emptyContextObject; 13505 "object" === typeof oldContext && 13506 null !== oldContext && 13507 (oldProps = readContext(oldContext)); 13508 unresolvedOldProps = Component.getDerivedStateFromProps; 13509 (oldContext = 13510 "function" === typeof unresolvedOldProps || 13511 "function" === typeof context.getSnapshotBeforeUpdate) || 13512 ("function" !== typeof context.UNSAFE_componentWillReceiveProps && 13513 "function" !== typeof context.componentWillReceiveProps) || 13514 ((contextType !== getDerivedStateFromProps || oldState !== oldProps) && 13515 callComponentWillReceiveProps( 13516 workInProgress, 13517 context, 13518 nextProps, 13519 oldProps 13520 )); 13521 hasForceUpdate = false; 13522 oldState = workInProgress.memoizedState; 13523 context.state = oldState; 13524 processUpdateQueue(workInProgress, nextProps, context, renderLanes); 13525 suspendIfUpdateReadFromEntangledAsyncAction(); 13526 var newState = workInProgress.memoizedState; 13527 contextType !== getDerivedStateFromProps || 13528 oldState !== newState || 13529 hasForceUpdate || 13530 (null !== current && 13531 null !== current.dependencies && 13532 checkIfContextChanged(current.dependencies)) 13533 ? ("function" === typeof unresolvedOldProps && 13534 (applyDerivedStateFromProps( 13535 workInProgress, 13536 Component, 13537 unresolvedOldProps, 13538 nextProps 13539 ), 13540 (newState = workInProgress.memoizedState)), 13541 (contextType$jscomp$0 = 13542 hasForceUpdate || 13543 checkShouldComponentUpdate( 13544 workInProgress, 13545 Component, 13546 contextType$jscomp$0, 13547 nextProps, 13548 oldState, 13549 newState, 13550 oldProps 13551 ) || 13552 (null !== current && 13553 null !== current.dependencies && 13554 checkIfContextChanged(current.dependencies))) 13555 ? (oldContext || 13556 ("function" !== typeof context.UNSAFE_componentWillUpdate && 13557 "function" !== typeof context.componentWillUpdate) || 13558 ("function" === typeof context.componentWillUpdate && 13559 context.componentWillUpdate(nextProps, newState, oldProps), 13560 "function" === typeof context.UNSAFE_componentWillUpdate && 13561 context.UNSAFE_componentWillUpdate( 13562 nextProps, 13563 newState, 13564 oldProps 13565 )), 13566 "function" === typeof context.componentDidUpdate && 13567 (workInProgress.flags |= 4), 13568 "function" === typeof context.getSnapshotBeforeUpdate && 13569 (workInProgress.flags |= 1024)) 13570 : ("function" !== typeof context.componentDidUpdate || 13571 (contextType === current.memoizedProps && 13572 oldState === current.memoizedState) || 13573 (workInProgress.flags |= 4), 13574 "function" !== typeof context.getSnapshotBeforeUpdate || 13575 (contextType === current.memoizedProps && 13576 oldState === current.memoizedState) || 13577 (workInProgress.flags |= 1024), 13578 (workInProgress.memoizedProps = nextProps), 13579 (workInProgress.memoizedState = newState)), 13580 (context.props = nextProps), 13581 (context.state = newState), 13582 (context.context = oldProps), 13583 (nextProps = contextType$jscomp$0)) 13584 : ("function" !== typeof context.componentDidUpdate || 13585 (contextType === current.memoizedProps && 13586 oldState === current.memoizedState) || 13587 (workInProgress.flags |= 4), 13588 "function" !== typeof context.getSnapshotBeforeUpdate || 13589 (contextType === current.memoizedProps && 13590 oldState === current.memoizedState) || 13591 (workInProgress.flags |= 1024), 13592 (nextProps = false)); 13593 } 13594 context = nextProps; 13595 markRef(current, workInProgress); 13596 nextProps = 0 !== (workInProgress.flags & 128); 13597 context || nextProps 13598 ? ((context = workInProgress.stateNode), 13599 (Component = 13600 nextProps && "function" !== typeof Component.getDerivedStateFromError 13601 ? null 13602 : context.render()), 13603 (workInProgress.flags |= 1), 13604 null !== current && nextProps 13605 ? ((workInProgress.child = reconcileChildFibers( 13606 workInProgress, 13607 current.child, 13608 null, 13609 renderLanes 13610 )), 13611 (workInProgress.child = reconcileChildFibers( 13612 workInProgress, 13613 null, 13614 Component, 13615 renderLanes 13616 ))) 13617 : reconcileChildren(current, workInProgress, Component, renderLanes), 13618 (workInProgress.memoizedState = context.state), 13619 (current = workInProgress.child)) 13620 : (current = bailoutOnAlreadyFinishedWork( 13621 current, 13622 workInProgress, 13623 renderLanes 13624 )); 13625 return current; 13626 } 13627 function mountHostRootWithoutHydrating( 13628 current, 13629 workInProgress, 13630 nextChildren, 13631 renderLanes 13632 ) { 13633 resetHydrationState(); 13634 workInProgress.flags |= 256; 13635 reconcileChildren(current, workInProgress, nextChildren, renderLanes); 13636 return workInProgress.child; 13637 } 13638 var SUSPENDED_MARKER = { 13639 dehydrated: null, 13640 treeContext: null, 13641 retryLane: 0, 13642 hydrationErrors: null 13643 }; 13644 function mountSuspenseOffscreenState(renderLanes) { 13645 return { baseLanes: renderLanes, cachePool: getSuspendedCache() }; 13646 } 13647 function getRemainingWorkInPrimaryTree( 13648 current, 13649 primaryTreeDidDefer, 13650 renderLanes 13651 ) { 13652 current = null !== current ? current.childLanes & ~renderLanes : 0; 13653 primaryTreeDidDefer && (current |= workInProgressDeferredLane); 13654 return current; 13655 } 13656 function updateSuspenseComponent(current, workInProgress, renderLanes) { 13657 var nextProps = workInProgress.pendingProps, 13658 showFallback = false, 13659 didSuspend = 0 !== (workInProgress.flags & 128), 13660 JSCompiler_temp; 13661 (JSCompiler_temp = didSuspend) || 13662 (JSCompiler_temp = 13663 null !== current && null === current.memoizedState 13664 ? false 13665 : 0 !== (suspenseStackCursor.current & 2)); 13666 JSCompiler_temp && ((showFallback = true), (workInProgress.flags &= -129)); 13667 JSCompiler_temp = 0 !== (workInProgress.flags & 32); 13668 workInProgress.flags &= -33; 13669 if (null === current) { 13670 if (isHydrating) { 13671 showFallback 13672 ? pushPrimaryTreeSuspenseHandler(workInProgress) 13673 : reuseSuspenseHandlerOnStack(); 13674 (current = nextHydratableInstance) 13675 ? ((current = canHydrateHydrationBoundary( 13676 current, 13677 rootOrSingletonContext 13678 )), 13679 (current = null !== current && "&" !== current.data ? current : null), 13680 null !== current && 13681 ((workInProgress.memoizedState = { 13682 dehydrated: current, 13683 treeContext: 13684 null !== treeContextProvider 13685 ? { id: treeContextId, overflow: treeContextOverflow } 13686 : null, 13687 retryLane: 536870912, 13688 hydrationErrors: null 13689 }), 13690 (renderLanes = createFiberFromDehydratedFragment(current)), 13691 (renderLanes.return = workInProgress), 13692 (workInProgress.child = renderLanes), 13693 (hydrationParentFiber = workInProgress), 13694 (nextHydratableInstance = null))) 13695 : (current = null); 13696 if (null === current) throw throwOnHydrationMismatch(workInProgress); 13697 isSuspenseInstanceFallback(current) 13698 ? (workInProgress.lanes = 32) 13699 : (workInProgress.lanes = 536870912); 13700 return null; 13701 } 13702 var nextPrimaryChildren = nextProps.children; 13703 nextProps = nextProps.fallback; 13704 if (showFallback) 13705 return ( 13706 reuseSuspenseHandlerOnStack(), 13707 (showFallback = workInProgress.mode), 13708 (nextPrimaryChildren = mountWorkInProgressOffscreenFiber( 13709 { mode: "hidden", children: nextPrimaryChildren }, 13710 showFallback 13711 )), 13712 (nextProps = createFiberFromFragment( 13713 nextProps, 13714 showFallback, 13715 renderLanes, 13716 null 13717 )), 13718 (nextPrimaryChildren.return = workInProgress), 13719 (nextProps.return = workInProgress), 13720 (nextPrimaryChildren.sibling = nextProps), 13721 (workInProgress.child = nextPrimaryChildren), 13722 (nextProps = workInProgress.child), 13723 (nextProps.memoizedState = mountSuspenseOffscreenState(renderLanes)), 13724 (nextProps.childLanes = getRemainingWorkInPrimaryTree( 13725 current, 13726 JSCompiler_temp, 13727 renderLanes 13728 )), 13729 (workInProgress.memoizedState = SUSPENDED_MARKER), 13730 bailoutOffscreenComponent(null, nextProps) 13731 ); 13732 pushPrimaryTreeSuspenseHandler(workInProgress); 13733 return mountSuspensePrimaryChildren(workInProgress, nextPrimaryChildren); 13734 } 13735 var prevState = current.memoizedState; 13736 if ( 13737 null !== prevState && 13738 ((nextPrimaryChildren = prevState.dehydrated), null !== nextPrimaryChildren) 13739 ) { 13740 if (didSuspend) 13741 workInProgress.flags & 256 13742 ? (pushPrimaryTreeSuspenseHandler(workInProgress), 13743 (workInProgress.flags &= -257), 13744 (workInProgress = retrySuspenseComponentWithoutHydrating( 13745 current, 13746 workInProgress, 13747 renderLanes 13748 ))) 13749 : null !== workInProgress.memoizedState 13750 ? (reuseSuspenseHandlerOnStack(), 13751 (workInProgress.child = current.child), 13752 (workInProgress.flags |= 128), 13753 (workInProgress = null)) 13754 : (reuseSuspenseHandlerOnStack(), 13755 (nextPrimaryChildren = nextProps.fallback), 13756 (showFallback = workInProgress.mode), 13757 (nextProps = mountWorkInProgressOffscreenFiber( 13758 { mode: "visible", children: nextProps.children }, 13759 showFallback 13760 )), 13761 (nextPrimaryChildren = createFiberFromFragment( 13762 nextPrimaryChildren, 13763 showFallback, 13764 renderLanes, 13765 null 13766 )), 13767 (nextPrimaryChildren.flags |= 2), 13768 (nextProps.return = workInProgress), 13769 (nextPrimaryChildren.return = workInProgress), 13770 (nextProps.sibling = nextPrimaryChildren), 13771 (workInProgress.child = nextProps), 13772 reconcileChildFibers( 13773 workInProgress, 13774 current.child, 13775 null, 13776 renderLanes 13777 ), 13778 (nextProps = workInProgress.child), 13779 (nextProps.memoizedState = 13780 mountSuspenseOffscreenState(renderLanes)), 13781 (nextProps.childLanes = getRemainingWorkInPrimaryTree( 13782 current, 13783 JSCompiler_temp, 13784 renderLanes 13785 )), 13786 (workInProgress.memoizedState = SUSPENDED_MARKER), 13787 (workInProgress = bailoutOffscreenComponent(null, nextProps))); 13788 else if ( 13789 (pushPrimaryTreeSuspenseHandler(workInProgress), 13790 isSuspenseInstanceFallback(nextPrimaryChildren)) 13791 ) { 13792 JSCompiler_temp = 13793 nextPrimaryChildren.nextSibling && 13794 nextPrimaryChildren.nextSibling.dataset; 13795 if (JSCompiler_temp) var digest = JSCompiler_temp.dgst; 13796 JSCompiler_temp = digest; 13797 nextProps = Error(formatProdErrorMessage(419)); 13798 nextProps.stack = ""; 13799 nextProps.digest = JSCompiler_temp; 13800 queueHydrationError({ value: nextProps, source: null, stack: null }); 13801 workInProgress = retrySuspenseComponentWithoutHydrating( 13802 current, 13803 workInProgress, 13804 renderLanes 13805 ); 13806 } else if ( 13807 (didReceiveUpdate || 13808 propagateParentContextChanges(current, workInProgress, renderLanes, false), 13809 (JSCompiler_temp = 0 !== (renderLanes & current.childLanes)), 13810 didReceiveUpdate || JSCompiler_temp) 13811 ) { 13812 JSCompiler_temp = workInProgressRoot; 13813 if ( 13814 null !== JSCompiler_temp && 13815 ((nextProps = getBumpedLaneForHydration(JSCompiler_temp, renderLanes)), 13816 0 !== nextProps && nextProps !== prevState.retryLane) 13817 ) 13818 throw ( 13819 ((prevState.retryLane = nextProps), 13820 enqueueConcurrentRenderForLane(current, nextProps), 13821 scheduleUpdateOnFiber(JSCompiler_temp, current, nextProps), 13822 SelectiveHydrationException) 13823 ); 13824 isSuspenseInstancePending(nextPrimaryChildren) || 13825 renderDidSuspendDelayIfPossible(); 13826 workInProgress = retrySuspenseComponentWithoutHydrating( 13827 current, 13828 workInProgress, 13829 renderLanes 13830 ); 13831 } else 13832 isSuspenseInstancePending(nextPrimaryChildren) 13833 ? ((workInProgress.flags |= 192), 13834 (workInProgress.child = current.child), 13835 (workInProgress = null)) 13836 : ((current = prevState.treeContext), 13837 (nextHydratableInstance = getNextHydratable( 13838 nextPrimaryChildren.nextSibling 13839 )), 13840 (hydrationParentFiber = workInProgress), 13841 (isHydrating = true), 13842 (hydrationErrors = null), 13843 (rootOrSingletonContext = false), 13844 null !== current && 13845 restoreSuspendedTreeContext(workInProgress, current), 13846 (workInProgress = mountSuspensePrimaryChildren( 13847 workInProgress, 13848 nextProps.children 13849 )), 13850 (workInProgress.flags |= 4096)); 13851 return workInProgress; 13852 } 13853 if (showFallback) 13854 return ( 13855 reuseSuspenseHandlerOnStack(), 13856 (nextPrimaryChildren = nextProps.fallback), 13857 (showFallback = workInProgress.mode), 13858 (prevState = current.child), 13859 (digest = prevState.sibling), 13860 (nextProps = createWorkInProgress(prevState, { 13861 mode: "hidden", 13862 children: nextProps.children 13863 })), 13864 (nextProps.subtreeFlags = prevState.subtreeFlags & 65011712), 13865 null !== digest 13866 ? (nextPrimaryChildren = createWorkInProgress( 13867 digest, 13868 nextPrimaryChildren 13869 )) 13870 : ((nextPrimaryChildren = createFiberFromFragment( 13871 nextPrimaryChildren, 13872 showFallback, 13873 renderLanes, 13874 null 13875 )), 13876 (nextPrimaryChildren.flags |= 2)), 13877 (nextPrimaryChildren.return = workInProgress), 13878 (nextProps.return = workInProgress), 13879 (nextProps.sibling = nextPrimaryChildren), 13880 (workInProgress.child = nextProps), 13881 bailoutOffscreenComponent(null, nextProps), 13882 (nextProps = workInProgress.child), 13883 (nextPrimaryChildren = current.child.memoizedState), 13884 null === nextPrimaryChildren 13885 ? (nextPrimaryChildren = mountSuspenseOffscreenState(renderLanes)) 13886 : ((showFallback = nextPrimaryChildren.cachePool), 13887 null !== showFallback 13888 ? ((prevState = CacheContext._currentValue), 13889 (showFallback = 13890 showFallback.parent !== prevState 13891 ? { parent: prevState, pool: prevState } 13892 : showFallback)) 13893 : (showFallback = getSuspendedCache()), 13894 (nextPrimaryChildren = { 13895 baseLanes: nextPrimaryChildren.baseLanes | renderLanes, 13896 cachePool: showFallback 13897 })), 13898 (nextProps.memoizedState = nextPrimaryChildren), 13899 (nextProps.childLanes = getRemainingWorkInPrimaryTree( 13900 current, 13901 JSCompiler_temp, 13902 renderLanes 13903 )), 13904 (workInProgress.memoizedState = SUSPENDED_MARKER), 13905 bailoutOffscreenComponent(current.child, nextProps) 13906 ); 13907 pushPrimaryTreeSuspenseHandler(workInProgress); 13908 renderLanes = current.child; 13909 current = renderLanes.sibling; 13910 renderLanes = createWorkInProgress(renderLanes, { 13911 mode: "visible", 13912 children: nextProps.children 13913 }); 13914 renderLanes.return = workInProgress; 13915 renderLanes.sibling = null; 13916 null !== current && 13917 ((JSCompiler_temp = workInProgress.deletions), 13918 null === JSCompiler_temp 13919 ? ((workInProgress.deletions = [current]), (workInProgress.flags |= 16)) 13920 : JSCompiler_temp.push(current)); 13921 workInProgress.child = renderLanes; 13922 workInProgress.memoizedState = null; 13923 return renderLanes; 13924 } 13925 function mountSuspensePrimaryChildren(workInProgress, primaryChildren) { 13926 primaryChildren = mountWorkInProgressOffscreenFiber( 13927 { mode: "visible", children: primaryChildren }, 13928 workInProgress.mode 13929 ); 13930 primaryChildren.return = workInProgress; 13931 return (workInProgress.child = primaryChildren); 13932 } 13933 function mountWorkInProgressOffscreenFiber(offscreenProps, mode) { 13934 offscreenProps = createFiberImplClass(22, offscreenProps, null, mode); 13935 offscreenProps.lanes = 0; 13936 return offscreenProps; 13937 } 13938 function retrySuspenseComponentWithoutHydrating( 13939 current, 13940 workInProgress, 13941 renderLanes 13942 ) { 13943 reconcileChildFibers(workInProgress, current.child, null, renderLanes); 13944 current = mountSuspensePrimaryChildren( 13945 workInProgress, 13946 workInProgress.pendingProps.children 13947 ); 13948 current.flags |= 2; 13949 workInProgress.memoizedState = null; 13950 return current; 13951 } 13952 function scheduleSuspenseWorkOnFiber(fiber, renderLanes, propagationRoot) { 13953 fiber.lanes |= renderLanes; 13954 var alternate = fiber.alternate; 13955 null !== alternate && (alternate.lanes |= renderLanes); 13956 scheduleContextWorkOnParentPath(fiber.return, renderLanes, propagationRoot); 13957 } 13958 function initSuspenseListRenderState( 13959 workInProgress, 13960 isBackwards, 13961 tail, 13962 lastContentRow, 13963 tailMode, 13964 treeForkCount 13965 ) { 13966 var renderState = workInProgress.memoizedState; 13967 null === renderState 13968 ? (workInProgress.memoizedState = { 13969 isBackwards: isBackwards, 13970 rendering: null, 13971 renderingStartTime: 0, 13972 last: lastContentRow, 13973 tail: tail, 13974 tailMode: tailMode, 13975 treeForkCount: treeForkCount 13976 }) 13977 : ((renderState.isBackwards = isBackwards), 13978 (renderState.rendering = null), 13979 (renderState.renderingStartTime = 0), 13980 (renderState.last = lastContentRow), 13981 (renderState.tail = tail), 13982 (renderState.tailMode = tailMode), 13983 (renderState.treeForkCount = treeForkCount)); 13984 } 13985 function updateSuspenseListComponent(current, workInProgress, renderLanes) { 13986 var nextProps = workInProgress.pendingProps, 13987 revealOrder = nextProps.revealOrder, 13988 tailMode = nextProps.tail; 13989 nextProps = nextProps.children; 13990 var suspenseContext = suspenseStackCursor.current, 13991 shouldForceFallback = 0 !== (suspenseContext & 2); 13992 shouldForceFallback 13993 ? ((suspenseContext = (suspenseContext & 1) | 2), 13994 (workInProgress.flags |= 128)) 13995 : (suspenseContext &= 1); 13996 push(suspenseStackCursor, suspenseContext); 13997 reconcileChildren(current, workInProgress, nextProps, renderLanes); 13998 nextProps = isHydrating ? treeForkCount : 0; 13999 if (!shouldForceFallback && null !== current && 0 !== (current.flags & 128)) 14000 a: for (current = workInProgress.child; null !== current; ) { 14001 if (13 === current.tag) 14002 null !== current.memoizedState && 14003 scheduleSuspenseWorkOnFiber(current, renderLanes, workInProgress); 14004 else if (19 === current.tag) 14005 scheduleSuspenseWorkOnFiber(current, renderLanes, workInProgress); 14006 else if (null !== current.child) { 14007 current.child.return = current; 14008 current = current.child; 14009 continue; 14010 } 14011 if (current === workInProgress) break a; 14012 for (; null === current.sibling; ) { 14013 if (null === current.return || current.return === workInProgress) 14014 break a; 14015 current = current.return; 14016 } 14017 current.sibling.return = current.return; 14018 current = current.sibling; 14019 } 14020 switch (revealOrder) { 14021 case "forwards": 14022 renderLanes = workInProgress.child; 14023 for (revealOrder = null; null !== renderLanes; ) 14024 (current = renderLanes.alternate), 14025 null !== current && 14026 null === findFirstSuspended(current) && 14027 (revealOrder = renderLanes), 14028 (renderLanes = renderLanes.sibling); 14029 renderLanes = revealOrder; 14030 null === renderLanes 14031 ? ((revealOrder = workInProgress.child), (workInProgress.child = null)) 14032 : ((revealOrder = renderLanes.sibling), (renderLanes.sibling = null)); 14033 initSuspenseListRenderState( 14034 workInProgress, 14035 false, 14036 revealOrder, 14037 renderLanes, 14038 tailMode, 14039 nextProps 14040 ); 14041 break; 14042 case "backwards": 14043 case "unstable_legacy-backwards": 14044 renderLanes = null; 14045 revealOrder = workInProgress.child; 14046 for (workInProgress.child = null; null !== revealOrder; ) { 14047 current = revealOrder.alternate; 14048 if (null !== current && null === findFirstSuspended(current)) { 14049 workInProgress.child = revealOrder; 14050 break; 14051 } 14052 current = revealOrder.sibling; 14053 revealOrder.sibling = renderLanes; 14054 renderLanes = revealOrder; 14055 revealOrder = current; 14056 } 14057 initSuspenseListRenderState( 14058 workInProgress, 14059 true, 14060 renderLanes, 14061 null, 14062 tailMode, 14063 nextProps 14064 ); 14065 break; 14066 case "together": 14067 initSuspenseListRenderState( 14068 workInProgress, 14069 false, 14070 null, 14071 null, 14072 void 0, 14073 nextProps 14074 ); 14075 break; 14076 default: 14077 workInProgress.memoizedState = null; 14078 } 14079 return workInProgress.child; 14080 } 14081 function bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) { 14082 null !== current && (workInProgress.dependencies = current.dependencies); 14083 workInProgressRootSkippedLanes |= workInProgress.lanes; 14084 if (0 === (renderLanes & workInProgress.childLanes)) 14085 if (null !== current) { 14086 if ( 14087 (propagateParentContextChanges( 14088 current, 14089 workInProgress, 14090 renderLanes, 14091 false 14092 ), 14093 0 === (renderLanes & workInProgress.childLanes)) 14094 ) 14095 return null; 14096 } else return null; 14097 if (null !== current && workInProgress.child !== current.child) 14098 throw Error(formatProdErrorMessage(153)); 14099 if (null !== workInProgress.child) { 14100 current = workInProgress.child; 14101 renderLanes = createWorkInProgress(current, current.pendingProps); 14102 workInProgress.child = renderLanes; 14103 for (renderLanes.return = workInProgress; null !== current.sibling; ) 14104 (current = current.sibling), 14105 (renderLanes = renderLanes.sibling = 14106 createWorkInProgress(current, current.pendingProps)), 14107 (renderLanes.return = workInProgress); 14108 renderLanes.sibling = null; 14109 } 14110 return workInProgress.child; 14111 } 14112 function checkScheduledUpdateOrContext(current, renderLanes) { 14113 if (0 !== (current.lanes & renderLanes)) return true; 14114 current = current.dependencies; 14115 return null !== current && checkIfContextChanged(current) ? true : false; 14116 } 14117 function attemptEarlyBailoutIfNoScheduledUpdate( 14118 current, 14119 workInProgress, 14120 renderLanes 14121 ) { 14122 switch (workInProgress.tag) { 14123 case 3: 14124 pushHostContainer(workInProgress, workInProgress.stateNode.containerInfo); 14125 pushProvider(workInProgress, CacheContext, current.memoizedState.cache); 14126 resetHydrationState(); 14127 break; 14128 case 27: 14129 case 5: 14130 pushHostContext(workInProgress); 14131 break; 14132 case 4: 14133 pushHostContainer(workInProgress, workInProgress.stateNode.containerInfo); 14134 break; 14135 case 10: 14136 pushProvider( 14137 workInProgress, 14138 workInProgress.type, 14139 workInProgress.memoizedProps.value 14140 ); 14141 break; 14142 case 31: 14143 if (null !== workInProgress.memoizedState) 14144 return ( 14145 (workInProgress.flags |= 128), 14146 pushDehydratedActivitySuspenseHandler(workInProgress), 14147 null 14148 ); 14149 break; 14150 case 13: 14151 var state$102 = workInProgress.memoizedState; 14152 if (null !== state$102) { 14153 if (null !== state$102.dehydrated) 14154 return ( 14155 pushPrimaryTreeSuspenseHandler(workInProgress), 14156 (workInProgress.flags |= 128), 14157 null 14158 ); 14159 if (0 !== (renderLanes & workInProgress.child.childLanes)) 14160 return updateSuspenseComponent(current, workInProgress, renderLanes); 14161 pushPrimaryTreeSuspenseHandler(workInProgress); 14162 current = bailoutOnAlreadyFinishedWork( 14163 current, 14164 workInProgress, 14165 renderLanes 14166 ); 14167 return null !== current ? current.sibling : null; 14168 } 14169 pushPrimaryTreeSuspenseHandler(workInProgress); 14170 break; 14171 case 19: 14172 var didSuspendBefore = 0 !== (current.flags & 128); 14173 state$102 = 0 !== (renderLanes & workInProgress.childLanes); 14174 state$102 || 14175 (propagateParentContextChanges( 14176 current, 14177 workInProgress, 14178 renderLanes, 14179 false 14180 ), 14181 (state$102 = 0 !== (renderLanes & workInProgress.childLanes))); 14182 if (didSuspendBefore) { 14183 if (state$102) 14184 return updateSuspenseListComponent( 14185 current, 14186 workInProgress, 14187 renderLanes 14188 ); 14189 workInProgress.flags |= 128; 14190 } 14191 didSuspendBefore = workInProgress.memoizedState; 14192 null !== didSuspendBefore && 14193 ((didSuspendBefore.rendering = null), 14194 (didSuspendBefore.tail = null), 14195 (didSuspendBefore.lastEffect = null)); 14196 push(suspenseStackCursor, suspenseStackCursor.current); 14197 if (state$102) break; 14198 else return null; 14199 case 22: 14200 return ( 14201 (workInProgress.lanes = 0), 14202 updateOffscreenComponent( 14203 current, 14204 workInProgress, 14205 renderLanes, 14206 workInProgress.pendingProps 14207 ) 14208 ); 14209 case 24: 14210 pushProvider(workInProgress, CacheContext, current.memoizedState.cache); 14211 } 14212 return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes); 14213 } 14214 function beginWork(current, workInProgress, renderLanes) { 14215 if (null !== current) 14216 if (current.memoizedProps !== workInProgress.pendingProps) 14217 didReceiveUpdate = true; 14218 else { 14219 if ( 14220 !checkScheduledUpdateOrContext(current, renderLanes) && 14221 0 === (workInProgress.flags & 128) 14222 ) 14223 return ( 14224 (didReceiveUpdate = false), 14225 attemptEarlyBailoutIfNoScheduledUpdate( 14226 current, 14227 workInProgress, 14228 renderLanes 14229 ) 14230 ); 14231 didReceiveUpdate = 0 !== (current.flags & 131072) ? true : false; 14232 } 14233 else 14234 (didReceiveUpdate = false), 14235 isHydrating && 14236 0 !== (workInProgress.flags & 1048576) && 14237 pushTreeId(workInProgress, treeForkCount, workInProgress.index); 14238 workInProgress.lanes = 0; 14239 switch (workInProgress.tag) { 14240 case 16: 14241 a: { 14242 var props = workInProgress.pendingProps; 14243 current = resolveLazy(workInProgress.elementType); 14244 workInProgress.type = current; 14245 if ("function" === typeof current) 14246 shouldConstruct(current) 14247 ? ((props = resolveClassComponentProps(current, props)), 14248 (workInProgress.tag = 1), 14249 (workInProgress = updateClassComponent( 14250 null, 14251 workInProgress, 14252 current, 14253 props, 14254 renderLanes 14255 ))) 14256 : ((workInProgress.tag = 0), 14257 (workInProgress = updateFunctionComponent( 14258 null, 14259 workInProgress, 14260 current, 14261 props, 14262 renderLanes 14263 ))); 14264 else { 14265 if (void 0 !== current && null !== current) { 14266 var $$typeof = current.$$typeof; 14267 if ($$typeof === REACT_FORWARD_REF_TYPE) { 14268 workInProgress.tag = 11; 14269 workInProgress = updateForwardRef( 14270 null, 14271 workInProgress, 14272 current, 14273 props, 14274 renderLanes 14275 ); 14276 break a; 14277 } else if ($$typeof === REACT_MEMO_TYPE) { 14278 workInProgress.tag = 14; 14279 workInProgress = updateMemoComponent( 14280 null, 14281 workInProgress, 14282 current, 14283 props, 14284 renderLanes 14285 ); 14286 break a; 14287 } 14288 } 14289 workInProgress = getComponentNameFromType(current) || current; 14290 throw Error(formatProdErrorMessage(306, workInProgress, "")); 14291 } 14292 } 14293 return workInProgress; 14294 case 0: 14295 return updateFunctionComponent( 14296 current, 14297 workInProgress, 14298 workInProgress.type, 14299 workInProgress.pendingProps, 14300 renderLanes 14301 ); 14302 case 1: 14303 return ( 14304 (props = workInProgress.type), 14305 ($$typeof = resolveClassComponentProps( 14306 props, 14307 workInProgress.pendingProps 14308 )), 14309 updateClassComponent( 14310 current, 14311 workInProgress, 14312 props, 14313 $$typeof, 14314 renderLanes 14315 ) 14316 ); 14317 case 3: 14318 a: { 14319 pushHostContainer( 14320 workInProgress, 14321 workInProgress.stateNode.containerInfo 14322 ); 14323 if (null === current) throw Error(formatProdErrorMessage(387)); 14324 props = workInProgress.pendingProps; 14325 var prevState = workInProgress.memoizedState; 14326 $$typeof = prevState.element; 14327 cloneUpdateQueue(current, workInProgress); 14328 processUpdateQueue(workInProgress, props, null, renderLanes); 14329 var nextState = workInProgress.memoizedState; 14330 props = nextState.cache; 14331 pushProvider(workInProgress, CacheContext, props); 14332 props !== prevState.cache && 14333 propagateContextChanges( 14334 workInProgress, 14335 [CacheContext], 14336 renderLanes, 14337 true 14338 ); 14339 suspendIfUpdateReadFromEntangledAsyncAction(); 14340 props = nextState.element; 14341 if (prevState.isDehydrated) 14342 if ( 14343 ((prevState = { 14344 element: props, 14345 isDehydrated: false, 14346 cache: nextState.cache 14347 }), 14348 (workInProgress.updateQueue.baseState = prevState), 14349 (workInProgress.memoizedState = prevState), 14350 workInProgress.flags & 256) 14351 ) { 14352 workInProgress = mountHostRootWithoutHydrating( 14353 current, 14354 workInProgress, 14355 props, 14356 renderLanes 14357 ); 14358 break a; 14359 } else if (props !== $$typeof) { 14360 $$typeof = createCapturedValueAtFiber( 14361 Error(formatProdErrorMessage(424)), 14362 workInProgress 14363 ); 14364 queueHydrationError($$typeof); 14365 workInProgress = mountHostRootWithoutHydrating( 14366 current, 14367 workInProgress, 14368 props, 14369 renderLanes 14370 ); 14371 break a; 14372 } else { 14373 current = workInProgress.stateNode.containerInfo; 14374 switch (current.nodeType) { 14375 case 9: 14376 current = current.body; 14377 break; 14378 default: 14379 current = 14380 "HTML" === current.nodeName 14381 ? current.ownerDocument.body 14382 : current; 14383 } 14384 nextHydratableInstance = getNextHydratable(current.firstChild); 14385 hydrationParentFiber = workInProgress; 14386 isHydrating = true; 14387 hydrationErrors = null; 14388 rootOrSingletonContext = true; 14389 renderLanes = mountChildFibers( 14390 workInProgress, 14391 null, 14392 props, 14393 renderLanes 14394 ); 14395 for (workInProgress.child = renderLanes; renderLanes; ) 14396 (renderLanes.flags = (renderLanes.flags & -3) | 4096), 14397 (renderLanes = renderLanes.sibling); 14398 } 14399 else { 14400 resetHydrationState(); 14401 if (props === $$typeof) { 14402 workInProgress = bailoutOnAlreadyFinishedWork( 14403 current, 14404 workInProgress, 14405 renderLanes 14406 ); 14407 break a; 14408 } 14409 reconcileChildren(current, workInProgress, props, renderLanes); 14410 } 14411 workInProgress = workInProgress.child; 14412 } 14413 return workInProgress; 14414 case 26: 14415 return ( 14416 markRef(current, workInProgress), 14417 null === current 14418 ? (renderLanes = getResource( 14419 workInProgress.type, 14420 null, 14421 workInProgress.pendingProps, 14422 null 14423 )) 14424 ? (workInProgress.memoizedState = renderLanes) 14425 : isHydrating || 14426 ((renderLanes = workInProgress.type), 14427 (current = workInProgress.pendingProps), 14428 (props = getOwnerDocumentFromRootContainer( 14429 rootInstanceStackCursor.current 14430 ).createElement(renderLanes)), 14431 (props[internalInstanceKey] = workInProgress), 14432 (props[internalPropsKey] = current), 14433 setInitialProperties(props, renderLanes, current), 14434 markNodeAsHoistable(props), 14435 (workInProgress.stateNode = props)) 14436 : (workInProgress.memoizedState = getResource( 14437 workInProgress.type, 14438 current.memoizedProps, 14439 workInProgress.pendingProps, 14440 current.memoizedState 14441 )), 14442 null 14443 ); 14444 case 27: 14445 return ( 14446 pushHostContext(workInProgress), 14447 null === current && 14448 isHydrating && 14449 ((props = workInProgress.stateNode = 14450 resolveSingletonInstance( 14451 workInProgress.type, 14452 workInProgress.pendingProps, 14453 rootInstanceStackCursor.current 14454 )), 14455 (hydrationParentFiber = workInProgress), 14456 (rootOrSingletonContext = true), 14457 ($$typeof = nextHydratableInstance), 14458 isSingletonScope(workInProgress.type) 14459 ? ((previousHydratableOnEnteringScopedSingleton = $$typeof), 14460 (nextHydratableInstance = getNextHydratable(props.firstChild))) 14461 : (nextHydratableInstance = $$typeof)), 14462 reconcileChildren( 14463 current, 14464 workInProgress, 14465 workInProgress.pendingProps.children, 14466 renderLanes 14467 ), 14468 markRef(current, workInProgress), 14469 null === current && (workInProgress.flags |= 4194304), 14470 workInProgress.child 14471 ); 14472 case 5: 14473 if (null === current && isHydrating) { 14474 if (($$typeof = props = nextHydratableInstance)) 14475 (props = canHydrateInstance( 14476 props, 14477 workInProgress.type, 14478 workInProgress.pendingProps, 14479 rootOrSingletonContext 14480 )), 14481 null !== props 14482 ? ((workInProgress.stateNode = props), 14483 (hydrationParentFiber = workInProgress), 14484 (nextHydratableInstance = getNextHydratable(props.firstChild)), 14485 (rootOrSingletonContext = false), 14486 ($$typeof = true)) 14487 : ($$typeof = false); 14488 $$typeof || throwOnHydrationMismatch(workInProgress); 14489 } 14490 pushHostContext(workInProgress); 14491 $$typeof = workInProgress.type; 14492 prevState = workInProgress.pendingProps; 14493 nextState = null !== current ? current.memoizedProps : null; 14494 props = prevState.children; 14495 shouldSetTextContent($$typeof, prevState) 14496 ? (props = null) 14497 : null !== nextState && 14498 shouldSetTextContent($$typeof, nextState) && 14499 (workInProgress.flags |= 32); 14500 null !== workInProgress.memoizedState && 14501 (($$typeof = renderWithHooks( 14502 current, 14503 workInProgress, 14504 TransitionAwareHostComponent, 14505 null, 14506 null, 14507 renderLanes 14508 )), 14509 (HostTransitionContext._currentValue = $$typeof)); 14510 markRef(current, workInProgress); 14511 reconcileChildren(current, workInProgress, props, renderLanes); 14512 return workInProgress.child; 14513 case 6: 14514 if (null === current && isHydrating) { 14515 if ((current = renderLanes = nextHydratableInstance)) 14516 (renderLanes = canHydrateTextInstance( 14517 renderLanes, 14518 workInProgress.pendingProps, 14519 rootOrSingletonContext 14520 )), 14521 null !== renderLanes 14522 ? ((workInProgress.stateNode = renderLanes), 14523 (hydrationParentFiber = workInProgress), 14524 (nextHydratableInstance = null), 14525 (current = true)) 14526 : (current = false); 14527 current || throwOnHydrationMismatch(workInProgress); 14528 } 14529 return null; 14530 case 13: 14531 return updateSuspenseComponent(current, workInProgress, renderLanes); 14532 case 4: 14533 return ( 14534 pushHostContainer( 14535 workInProgress, 14536 workInProgress.stateNode.containerInfo 14537 ), 14538 (props = workInProgress.pendingProps), 14539 null === current 14540 ? (workInProgress.child = reconcileChildFibers( 14541 workInProgress, 14542 null, 14543 props, 14544 renderLanes 14545 )) 14546 : reconcileChildren(current, workInProgress, props, renderLanes), 14547 workInProgress.child 14548 ); 14549 case 11: 14550 return updateForwardRef( 14551 current, 14552 workInProgress, 14553 workInProgress.type, 14554 workInProgress.pendingProps, 14555 renderLanes 14556 ); 14557 case 7: 14558 return ( 14559 reconcileChildren( 14560 current, 14561 workInProgress, 14562 workInProgress.pendingProps, 14563 renderLanes 14564 ), 14565 workInProgress.child 14566 ); 14567 case 8: 14568 return ( 14569 reconcileChildren( 14570 current, 14571 workInProgress, 14572 workInProgress.pendingProps.children, 14573 renderLanes 14574 ), 14575 workInProgress.child 14576 ); 14577 case 12: 14578 return ( 14579 reconcileChildren( 14580 current, 14581 workInProgress, 14582 workInProgress.pendingProps.children, 14583 renderLanes 14584 ), 14585 workInProgress.child 14586 ); 14587 case 10: 14588 return ( 14589 (props = workInProgress.pendingProps), 14590 pushProvider(workInProgress, workInProgress.type, props.value), 14591 reconcileChildren(current, workInProgress, props.children, renderLanes), 14592 workInProgress.child 14593 ); 14594 case 9: 14595 return ( 14596 ($$typeof = workInProgress.type._context), 14597 (props = workInProgress.pendingProps.children), 14598 prepareToReadContext(workInProgress), 14599 ($$typeof = readContext($$typeof)), 14600 (props = props($$typeof)), 14601 (workInProgress.flags |= 1), 14602 reconcileChildren(current, workInProgress, props, renderLanes), 14603 workInProgress.child 14604 ); 14605 case 14: 14606 return updateMemoComponent( 14607 current, 14608 workInProgress, 14609 workInProgress.type, 14610 workInProgress.pendingProps, 14611 renderLanes 14612 ); 14613 case 15: 14614 return updateSimpleMemoComponent( 14615 current, 14616 workInProgress, 14617 workInProgress.type, 14618 workInProgress.pendingProps, 14619 renderLanes 14620 ); 14621 case 19: 14622 return updateSuspenseListComponent(current, workInProgress, renderLanes); 14623 case 31: 14624 return updateActivityComponent(current, workInProgress, renderLanes); 14625 case 22: 14626 return updateOffscreenComponent( 14627 current, 14628 workInProgress, 14629 renderLanes, 14630 workInProgress.pendingProps 14631 ); 14632 case 24: 14633 return ( 14634 prepareToReadContext(workInProgress), 14635 (props = readContext(CacheContext)), 14636 null === current 14637 ? (($$typeof = peekCacheFromPool()), 14638 null === $$typeof && 14639 (($$typeof = workInProgressRoot), 14640 (prevState = createCache()), 14641 ($$typeof.pooledCache = prevState), 14642 prevState.refCount++, 14643 null !== prevState && ($$typeof.pooledCacheLanes |= renderLanes), 14644 ($$typeof = prevState)), 14645 (workInProgress.memoizedState = { parent: props, cache: $$typeof }), 14646 initializeUpdateQueue(workInProgress), 14647 pushProvider(workInProgress, CacheContext, $$typeof)) 14648 : (0 !== (current.lanes & renderLanes) && 14649 (cloneUpdateQueue(current, workInProgress), 14650 processUpdateQueue(workInProgress, null, null, renderLanes), 14651 suspendIfUpdateReadFromEntangledAsyncAction()), 14652 ($$typeof = current.memoizedState), 14653 (prevState = workInProgress.memoizedState), 14654 $$typeof.parent !== props 14655 ? (($$typeof = { parent: props, cache: props }), 14656 (workInProgress.memoizedState = $$typeof), 14657 0 === workInProgress.lanes && 14658 (workInProgress.memoizedState = 14659 workInProgress.updateQueue.baseState = 14660 $$typeof), 14661 pushProvider(workInProgress, CacheContext, props)) 14662 : ((props = prevState.cache), 14663 pushProvider(workInProgress, CacheContext, props), 14664 props !== $$typeof.cache && 14665 propagateContextChanges( 14666 workInProgress, 14667 [CacheContext], 14668 renderLanes, 14669 true 14670 ))), 14671 reconcileChildren( 14672 current, 14673 workInProgress, 14674 workInProgress.pendingProps.children, 14675 renderLanes 14676 ), 14677 workInProgress.child 14678 ); 14679 case 29: 14680 throw workInProgress.pendingProps; 14681 } 14682 throw Error(formatProdErrorMessage(156, workInProgress.tag)); 14683 } 14684 function markUpdate(workInProgress) { 14685 workInProgress.flags |= 4; 14686 } 14687 function preloadInstanceAndSuspendIfNeeded( 14688 workInProgress, 14689 type, 14690 oldProps, 14691 newProps, 14692 renderLanes 14693 ) { 14694 if ((type = 0 !== (workInProgress.mode & 32))) type = false; 14695 if (type) { 14696 if ( 14697 ((workInProgress.flags |= 16777216), 14698 (renderLanes & 335544128) === renderLanes) 14699 ) 14700 if (workInProgress.stateNode.complete) workInProgress.flags |= 8192; 14701 else if (shouldRemainOnPreviousScreen()) workInProgress.flags |= 8192; 14702 else 14703 throw ( 14704 ((suspendedThenable = noopSuspenseyCommitThenable), 14705 SuspenseyCommitException) 14706 ); 14707 } else workInProgress.flags &= -16777217; 14708 } 14709 function preloadResourceAndSuspendIfNeeded(workInProgress, resource) { 14710 if ("stylesheet" !== resource.type || 0 !== (resource.state.loading & 4)) 14711 workInProgress.flags &= -16777217; 14712 else if (((workInProgress.flags |= 16777216), !preloadResource(resource))) 14713 if (shouldRemainOnPreviousScreen()) workInProgress.flags |= 8192; 14714 else 14715 throw ( 14716 ((suspendedThenable = noopSuspenseyCommitThenable), 14717 SuspenseyCommitException) 14718 ); 14719 } 14720 function scheduleRetryEffect(workInProgress, retryQueue) { 14721 null !== retryQueue && (workInProgress.flags |= 4); 14722 workInProgress.flags & 16384 && 14723 ((retryQueue = 14724 22 !== workInProgress.tag ? claimNextRetryLane() : 536870912), 14725 (workInProgress.lanes |= retryQueue), 14726 (workInProgressSuspendedRetryLanes |= retryQueue)); 14727 } 14728 function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) { 14729 if (!isHydrating) 14730 switch (renderState.tailMode) { 14731 case "hidden": 14732 hasRenderedATailFallback = renderState.tail; 14733 for (var lastTailNode = null; null !== hasRenderedATailFallback; ) 14734 null !== hasRenderedATailFallback.alternate && 14735 (lastTailNode = hasRenderedATailFallback), 14736 (hasRenderedATailFallback = hasRenderedATailFallback.sibling); 14737 null === lastTailNode 14738 ? (renderState.tail = null) 14739 : (lastTailNode.sibling = null); 14740 break; 14741 case "collapsed": 14742 lastTailNode = renderState.tail; 14743 for (var lastTailNode$106 = null; null !== lastTailNode; ) 14744 null !== lastTailNode.alternate && (lastTailNode$106 = lastTailNode), 14745 (lastTailNode = lastTailNode.sibling); 14746 null === lastTailNode$106 14747 ? hasRenderedATailFallback || null === renderState.tail 14748 ? (renderState.tail = null) 14749 : (renderState.tail.sibling = null) 14750 : (lastTailNode$106.sibling = null); 14751 } 14752 } 14753 function bubbleProperties(completedWork) { 14754 var didBailout = 14755 null !== completedWork.alternate && 14756 completedWork.alternate.child === completedWork.child, 14757 newChildLanes = 0, 14758 subtreeFlags = 0; 14759 if (didBailout) 14760 for (var child$107 = completedWork.child; null !== child$107; ) 14761 (newChildLanes |= child$107.lanes | child$107.childLanes), 14762 (subtreeFlags |= child$107.subtreeFlags & 65011712), 14763 (subtreeFlags |= child$107.flags & 65011712), 14764 (child$107.return = completedWork), 14765 (child$107 = child$107.sibling); 14766 else 14767 for (child$107 = completedWork.child; null !== child$107; ) 14768 (newChildLanes |= child$107.lanes | child$107.childLanes), 14769 (subtreeFlags |= child$107.subtreeFlags), 14770 (subtreeFlags |= child$107.flags), 14771 (child$107.return = completedWork), 14772 (child$107 = child$107.sibling); 14773 completedWork.subtreeFlags |= subtreeFlags; 14774 completedWork.childLanes = newChildLanes; 14775 return didBailout; 14776 } 14777 function completeWork(current, workInProgress, renderLanes) { 14778 var newProps = workInProgress.pendingProps; 14779 popTreeContext(workInProgress); 14780 switch (workInProgress.tag) { 14781 case 16: 14782 case 15: 14783 case 0: 14784 case 11: 14785 case 7: 14786 case 8: 14787 case 12: 14788 case 9: 14789 case 14: 14790 return bubbleProperties(workInProgress), null; 14791 case 1: 14792 return bubbleProperties(workInProgress), null; 14793 case 3: 14794 renderLanes = workInProgress.stateNode; 14795 newProps = null; 14796 null !== current && (newProps = current.memoizedState.cache); 14797 workInProgress.memoizedState.cache !== newProps && 14798 (workInProgress.flags |= 2048); 14799 popProvider(CacheContext); 14800 popHostContainer(); 14801 renderLanes.pendingContext && 14802 ((renderLanes.context = renderLanes.pendingContext), 14803 (renderLanes.pendingContext = null)); 14804 if (null === current || null === current.child) 14805 popHydrationState(workInProgress) 14806 ? markUpdate(workInProgress) 14807 : null === current || 14808 (current.memoizedState.isDehydrated && 14809 0 === (workInProgress.flags & 256)) || 14810 ((workInProgress.flags |= 1024), 14811 upgradeHydrationErrorsToRecoverable()); 14812 bubbleProperties(workInProgress); 14813 return null; 14814 case 26: 14815 var type = workInProgress.type, 14816 nextResource = workInProgress.memoizedState; 14817 null === current 14818 ? (markUpdate(workInProgress), 14819 null !== nextResource 14820 ? (bubbleProperties(workInProgress), 14821 preloadResourceAndSuspendIfNeeded(workInProgress, nextResource)) 14822 : (bubbleProperties(workInProgress), 14823 preloadInstanceAndSuspendIfNeeded( 14824 workInProgress, 14825 type, 14826 null, 14827 newProps, 14828 renderLanes 14829 ))) 14830 : nextResource 14831 ? nextResource !== current.memoizedState 14832 ? (markUpdate(workInProgress), 14833 bubbleProperties(workInProgress), 14834 preloadResourceAndSuspendIfNeeded(workInProgress, nextResource)) 14835 : (bubbleProperties(workInProgress), 14836 (workInProgress.flags &= -16777217)) 14837 : ((current = current.memoizedProps), 14838 current !== newProps && markUpdate(workInProgress), 14839 bubbleProperties(workInProgress), 14840 preloadInstanceAndSuspendIfNeeded( 14841 workInProgress, 14842 type, 14843 current, 14844 newProps, 14845 renderLanes 14846 )); 14847 return null; 14848 case 27: 14849 popHostContext(workInProgress); 14850 renderLanes = rootInstanceStackCursor.current; 14851 type = workInProgress.type; 14852 if (null !== current && null != workInProgress.stateNode) 14853 current.memoizedProps !== newProps && markUpdate(workInProgress); 14854 else { 14855 if (!newProps) { 14856 if (null === workInProgress.stateNode) 14857 throw Error(formatProdErrorMessage(166)); 14858 bubbleProperties(workInProgress); 14859 return null; 14860 } 14861 current = contextStackCursor.current; 14862 popHydrationState(workInProgress) 14863 ? prepareToHydrateHostInstance(workInProgress) 14864 : ((current = resolveSingletonInstance(type, newProps, renderLanes)), 14865 (workInProgress.stateNode = current), 14866 markUpdate(workInProgress)); 14867 } 14868 bubbleProperties(workInProgress); 14869 return null; 14870 case 5: 14871 popHostContext(workInProgress); 14872 type = workInProgress.type; 14873 if (null !== current && null != workInProgress.stateNode) 14874 current.memoizedProps !== newProps && markUpdate(workInProgress); 14875 else { 14876 if (!newProps) { 14877 if (null === workInProgress.stateNode) 14878 throw Error(formatProdErrorMessage(166)); 14879 bubbleProperties(workInProgress); 14880 return null; 14881 } 14882 nextResource = contextStackCursor.current; 14883 if (popHydrationState(workInProgress)) 14884 prepareToHydrateHostInstance(workInProgress); 14885 else { 14886 var ownerDocument = getOwnerDocumentFromRootContainer( 14887 rootInstanceStackCursor.current 14888 ); 14889 switch (nextResource) { 14890 case 1: 14891 nextResource = ownerDocument.createElementNS( 14892 "http://www.w3.org/2000/svg", 14893 type 14894 ); 14895 break; 14896 case 2: 14897 nextResource = ownerDocument.createElementNS( 14898 "http://www.w3.org/1998/Math/MathML", 14899 type 14900 ); 14901 break; 14902 default: 14903 switch (type) { 14904 case "svg": 14905 nextResource = ownerDocument.createElementNS( 14906 "http://www.w3.org/2000/svg", 14907 type 14908 ); 14909 break; 14910 case "math": 14911 nextResource = ownerDocument.createElementNS( 14912 "http://www.w3.org/1998/Math/MathML", 14913 type 14914 ); 14915 break; 14916 case "script": 14917 nextResource = ownerDocument.createElement("div"); 14918 nextResource.innerHTML = "<script>\x3c/script>"; 14919 nextResource = nextResource.removeChild( 14920 nextResource.firstChild 14921 ); 14922 break; 14923 case "select": 14924 nextResource = 14925 "string" === typeof newProps.is 14926 ? ownerDocument.createElement("select", { 14927 is: newProps.is 14928 }) 14929 : ownerDocument.createElement("select"); 14930 newProps.multiple 14931 ? (nextResource.multiple = true) 14932 : newProps.size && (nextResource.size = newProps.size); 14933 break; 14934 default: 14935 nextResource = 14936 "string" === typeof newProps.is 14937 ? ownerDocument.createElement(type, { is: newProps.is }) 14938 : ownerDocument.createElement(type); 14939 } 14940 } 14941 nextResource[internalInstanceKey] = workInProgress; 14942 nextResource[internalPropsKey] = newProps; 14943 a: for ( 14944 ownerDocument = workInProgress.child; 14945 null !== ownerDocument; 14946 14947 ) { 14948 if (5 === ownerDocument.tag || 6 === ownerDocument.tag) 14949 nextResource.appendChild(ownerDocument.stateNode); 14950 else if ( 14951 4 !== ownerDocument.tag && 14952 27 !== ownerDocument.tag && 14953 null !== ownerDocument.child 14954 ) { 14955 ownerDocument.child.return = ownerDocument; 14956 ownerDocument = ownerDocument.child; 14957 continue; 14958 } 14959 if (ownerDocument === workInProgress) break a; 14960 for (; null === ownerDocument.sibling; ) { 14961 if ( 14962 null === ownerDocument.return || 14963 ownerDocument.return === workInProgress 14964 ) 14965 break a; 14966 ownerDocument = ownerDocument.return; 14967 } 14968 ownerDocument.sibling.return = ownerDocument.return; 14969 ownerDocument = ownerDocument.sibling; 14970 } 14971 workInProgress.stateNode = nextResource; 14972 a: switch ( 14973 (setInitialProperties(nextResource, type, newProps), type) 14974 ) { 14975 case "button": 14976 case "input": 14977 case "select": 14978 case "textarea": 14979 newProps = !!newProps.autoFocus; 14980 break a; 14981 case "img": 14982 newProps = true; 14983 break a; 14984 default: 14985 newProps = false; 14986 } 14987 newProps && markUpdate(workInProgress); 14988 } 14989 } 14990 bubbleProperties(workInProgress); 14991 preloadInstanceAndSuspendIfNeeded( 14992 workInProgress, 14993 workInProgress.type, 14994 null === current ? null : current.memoizedProps, 14995 workInProgress.pendingProps, 14996 renderLanes 14997 ); 14998 return null; 14999 case 6: 15000 if (current && null != workInProgress.stateNode) 15001 current.memoizedProps !== newProps && markUpdate(workInProgress); 15002 else { 15003 if ("string" !== typeof newProps && null === workInProgress.stateNode) 15004 throw Error(formatProdErrorMessage(166)); 15005 current = rootInstanceStackCursor.current; 15006 if (popHydrationState(workInProgress)) { 15007 current = workInProgress.stateNode; 15008 renderLanes = workInProgress.memoizedProps; 15009 newProps = null; 15010 type = hydrationParentFiber; 15011 if (null !== type) 15012 switch (type.tag) { 15013 case 27: 15014 case 5: 15015 newProps = type.memoizedProps; 15016 } 15017 current[internalInstanceKey] = workInProgress; 15018 current = 15019 current.nodeValue === renderLanes || 15020 (null !== newProps && true === newProps.suppressHydrationWarning) || 15021 checkForUnmatchedText(current.nodeValue, renderLanes) 15022 ? true 15023 : false; 15024 current || throwOnHydrationMismatch(workInProgress, true); 15025 } else 15026 (current = 15027 getOwnerDocumentFromRootContainer(current).createTextNode( 15028 newProps 15029 )), 15030 (current[internalInstanceKey] = workInProgress), 15031 (workInProgress.stateNode = current); 15032 } 15033 bubbleProperties(workInProgress); 15034 return null; 15035 case 31: 15036 renderLanes = workInProgress.memoizedState; 15037 if (null === current || null !== current.memoizedState) { 15038 newProps = popHydrationState(workInProgress); 15039 if (null !== renderLanes) { 15040 if (null === current) { 15041 if (!newProps) throw Error(formatProdErrorMessage(318)); 15042 current = workInProgress.memoizedState; 15043 current = null !== current ? current.dehydrated : null; 15044 if (!current) throw Error(formatProdErrorMessage(557)); 15045 current[internalInstanceKey] = workInProgress; 15046 } else 15047 resetHydrationState(), 15048 0 === (workInProgress.flags & 128) && 15049 (workInProgress.memoizedState = null), 15050 (workInProgress.flags |= 4); 15051 bubbleProperties(workInProgress); 15052 current = false; 15053 } else 15054 (renderLanes = upgradeHydrationErrorsToRecoverable()), 15055 null !== current && 15056 null !== current.memoizedState && 15057 (current.memoizedState.hydrationErrors = renderLanes), 15058 (current = true); 15059 if (!current) { 15060 if (workInProgress.flags & 256) 15061 return popSuspenseHandler(workInProgress), workInProgress; 15062 popSuspenseHandler(workInProgress); 15063 return null; 15064 } 15065 if (0 !== (workInProgress.flags & 128)) 15066 throw Error(formatProdErrorMessage(558)); 15067 } 15068 bubbleProperties(workInProgress); 15069 return null; 15070 case 13: 15071 newProps = workInProgress.memoizedState; 15072 if ( 15073 null === current || 15074 (null !== current.memoizedState && 15075 null !== current.memoizedState.dehydrated) 15076 ) { 15077 type = popHydrationState(workInProgress); 15078 if (null !== newProps && null !== newProps.dehydrated) { 15079 if (null === current) { 15080 if (!type) throw Error(formatProdErrorMessage(318)); 15081 type = workInProgress.memoizedState; 15082 type = null !== type ? type.dehydrated : null; 15083 if (!type) throw Error(formatProdErrorMessage(317)); 15084 type[internalInstanceKey] = workInProgress; 15085 } else 15086 resetHydrationState(), 15087 0 === (workInProgress.flags & 128) && 15088 (workInProgress.memoizedState = null), 15089 (workInProgress.flags |= 4); 15090 bubbleProperties(workInProgress); 15091 type = false; 15092 } else 15093 (type = upgradeHydrationErrorsToRecoverable()), 15094 null !== current && 15095 null !== current.memoizedState && 15096 (current.memoizedState.hydrationErrors = type), 15097 (type = true); 15098 if (!type) { 15099 if (workInProgress.flags & 256) 15100 return popSuspenseHandler(workInProgress), workInProgress; 15101 popSuspenseHandler(workInProgress); 15102 return null; 15103 } 15104 } 15105 popSuspenseHandler(workInProgress); 15106 if (0 !== (workInProgress.flags & 128)) 15107 return (workInProgress.lanes = renderLanes), workInProgress; 15108 renderLanes = null !== newProps; 15109 current = null !== current && null !== current.memoizedState; 15110 renderLanes && 15111 ((newProps = workInProgress.child), 15112 (type = null), 15113 null !== newProps.alternate && 15114 null !== newProps.alternate.memoizedState && 15115 null !== newProps.alternate.memoizedState.cachePool && 15116 (type = newProps.alternate.memoizedState.cachePool.pool), 15117 (nextResource = null), 15118 null !== newProps.memoizedState && 15119 null !== newProps.memoizedState.cachePool && 15120 (nextResource = newProps.memoizedState.cachePool.pool), 15121 nextResource !== type && (newProps.flags |= 2048)); 15122 renderLanes !== current && 15123 renderLanes && 15124 (workInProgress.child.flags |= 8192); 15125 scheduleRetryEffect(workInProgress, workInProgress.updateQueue); 15126 bubbleProperties(workInProgress); 15127 return null; 15128 case 4: 15129 return ( 15130 popHostContainer(), 15131 null === current && 15132 listenToAllSupportedEvents(workInProgress.stateNode.containerInfo), 15133 bubbleProperties(workInProgress), 15134 null 15135 ); 15136 case 10: 15137 return ( 15138 popProvider(workInProgress.type), bubbleProperties(workInProgress), null 15139 ); 15140 case 19: 15141 pop(suspenseStackCursor); 15142 newProps = workInProgress.memoizedState; 15143 if (null === newProps) return bubbleProperties(workInProgress), null; 15144 type = 0 !== (workInProgress.flags & 128); 15145 nextResource = newProps.rendering; 15146 if (null === nextResource) 15147 if (type) cutOffTailIfNeeded(newProps, false); 15148 else { 15149 if ( 15150 0 !== workInProgressRootExitStatus || 15151 (null !== current && 0 !== (current.flags & 128)) 15152 ) 15153 for (current = workInProgress.child; null !== current; ) { 15154 nextResource = findFirstSuspended(current); 15155 if (null !== nextResource) { 15156 workInProgress.flags |= 128; 15157 cutOffTailIfNeeded(newProps, false); 15158 current = nextResource.updateQueue; 15159 workInProgress.updateQueue = current; 15160 scheduleRetryEffect(workInProgress, current); 15161 workInProgress.subtreeFlags = 0; 15162 current = renderLanes; 15163 for (renderLanes = workInProgress.child; null !== renderLanes; ) 15164 resetWorkInProgress(renderLanes, current), 15165 (renderLanes = renderLanes.sibling); 15166 push( 15167 suspenseStackCursor, 15168 (suspenseStackCursor.current & 1) | 2 15169 ); 15170 isHydrating && 15171 pushTreeFork(workInProgress, newProps.treeForkCount); 15172 return workInProgress.child; 15173 } 15174 current = current.sibling; 15175 } 15176 null !== newProps.tail && 15177 now() > workInProgressRootRenderTargetTime && 15178 ((workInProgress.flags |= 128), 15179 (type = true), 15180 cutOffTailIfNeeded(newProps, false), 15181 (workInProgress.lanes = 4194304)); 15182 } 15183 else { 15184 if (!type) 15185 if ( 15186 ((current = findFirstSuspended(nextResource)), null !== current) 15187 ) { 15188 if ( 15189 ((workInProgress.flags |= 128), 15190 (type = true), 15191 (current = current.updateQueue), 15192 (workInProgress.updateQueue = current), 15193 scheduleRetryEffect(workInProgress, current), 15194 cutOffTailIfNeeded(newProps, true), 15195 null === newProps.tail && 15196 "hidden" === newProps.tailMode && 15197 !nextResource.alternate && 15198 !isHydrating) 15199 ) 15200 return bubbleProperties(workInProgress), null; 15201 } else 15202 2 * now() - newProps.renderingStartTime > 15203 workInProgressRootRenderTargetTime && 15204 536870912 !== renderLanes && 15205 ((workInProgress.flags |= 128), 15206 (type = true), 15207 cutOffTailIfNeeded(newProps, false), 15208 (workInProgress.lanes = 4194304)); 15209 newProps.isBackwards 15210 ? ((nextResource.sibling = workInProgress.child), 15211 (workInProgress.child = nextResource)) 15212 : ((current = newProps.last), 15213 null !== current 15214 ? (current.sibling = nextResource) 15215 : (workInProgress.child = nextResource), 15216 (newProps.last = nextResource)); 15217 } 15218 if (null !== newProps.tail) 15219 return ( 15220 (current = newProps.tail), 15221 (newProps.rendering = current), 15222 (newProps.tail = current.sibling), 15223 (newProps.renderingStartTime = now()), 15224 (current.sibling = null), 15225 (renderLanes = suspenseStackCursor.current), 15226 push( 15227 suspenseStackCursor, 15228 type ? (renderLanes & 1) | 2 : renderLanes & 1 15229 ), 15230 isHydrating && pushTreeFork(workInProgress, newProps.treeForkCount), 15231 current 15232 ); 15233 bubbleProperties(workInProgress); 15234 return null; 15235 case 22: 15236 case 23: 15237 return ( 15238 popSuspenseHandler(workInProgress), 15239 popHiddenContext(), 15240 (newProps = null !== workInProgress.memoizedState), 15241 null !== current 15242 ? (null !== current.memoizedState) !== newProps && 15243 (workInProgress.flags |= 8192) 15244 : newProps && (workInProgress.flags |= 8192), 15245 newProps 15246 ? 0 !== (renderLanes & 536870912) && 15247 0 === (workInProgress.flags & 128) && 15248 (bubbleProperties(workInProgress), 15249 workInProgress.subtreeFlags & 6 && (workInProgress.flags |= 8192)) 15250 : bubbleProperties(workInProgress), 15251 (renderLanes = workInProgress.updateQueue), 15252 null !== renderLanes && 15253 scheduleRetryEffect(workInProgress, renderLanes.retryQueue), 15254 (renderLanes = null), 15255 null !== current && 15256 null !== current.memoizedState && 15257 null !== current.memoizedState.cachePool && 15258 (renderLanes = current.memoizedState.cachePool.pool), 15259 (newProps = null), 15260 null !== workInProgress.memoizedState && 15261 null !== workInProgress.memoizedState.cachePool && 15262 (newProps = workInProgress.memoizedState.cachePool.pool), 15263 newProps !== renderLanes && (workInProgress.flags |= 2048), 15264 null !== current && pop(resumedCache), 15265 null 15266 ); 15267 case 24: 15268 return ( 15269 (renderLanes = null), 15270 null !== current && (renderLanes = current.memoizedState.cache), 15271 workInProgress.memoizedState.cache !== renderLanes && 15272 (workInProgress.flags |= 2048), 15273 popProvider(CacheContext), 15274 bubbleProperties(workInProgress), 15275 null 15276 ); 15277 case 25: 15278 return null; 15279 case 30: 15280 return null; 15281 } 15282 throw Error(formatProdErrorMessage(156, workInProgress.tag)); 15283 } 15284 function unwindWork(current, workInProgress) { 15285 popTreeContext(workInProgress); 15286 switch (workInProgress.tag) { 15287 case 1: 15288 return ( 15289 (current = workInProgress.flags), 15290 current & 65536 15291 ? ((workInProgress.flags = (current & -65537) | 128), workInProgress) 15292 : null 15293 ); 15294 case 3: 15295 return ( 15296 popProvider(CacheContext), 15297 popHostContainer(), 15298 (current = workInProgress.flags), 15299 0 !== (current & 65536) && 0 === (current & 128) 15300 ? ((workInProgress.flags = (current & -65537) | 128), workInProgress) 15301 : null 15302 ); 15303 case 26: 15304 case 27: 15305 case 5: 15306 return popHostContext(workInProgress), null; 15307 case 31: 15308 if (null !== workInProgress.memoizedState) { 15309 popSuspenseHandler(workInProgress); 15310 if (null === workInProgress.alternate) 15311 throw Error(formatProdErrorMessage(340)); 15312 resetHydrationState(); 15313 } 15314 current = workInProgress.flags; 15315 return current & 65536 15316 ? ((workInProgress.flags = (current & -65537) | 128), workInProgress) 15317 : null; 15318 case 13: 15319 popSuspenseHandler(workInProgress); 15320 current = workInProgress.memoizedState; 15321 if (null !== current && null !== current.dehydrated) { 15322 if (null === workInProgress.alternate) 15323 throw Error(formatProdErrorMessage(340)); 15324 resetHydrationState(); 15325 } 15326 current = workInProgress.flags; 15327 return current & 65536 15328 ? ((workInProgress.flags = (current & -65537) | 128), workInProgress) 15329 : null; 15330 case 19: 15331 return pop(suspenseStackCursor), null; 15332 case 4: 15333 return popHostContainer(), null; 15334 case 10: 15335 return popProvider(workInProgress.type), null; 15336 case 22: 15337 case 23: 15338 return ( 15339 popSuspenseHandler(workInProgress), 15340 popHiddenContext(), 15341 null !== current && pop(resumedCache), 15342 (current = workInProgress.flags), 15343 current & 65536 15344 ? ((workInProgress.flags = (current & -65537) | 128), workInProgress) 15345 : null 15346 ); 15347 case 24: 15348 return popProvider(CacheContext), null; 15349 case 25: 15350 return null; 15351 default: 15352 return null; 15353 } 15354 } 15355 function unwindInterruptedWork(current, interruptedWork) { 15356 popTreeContext(interruptedWork); 15357 switch (interruptedWork.tag) { 15358 case 3: 15359 popProvider(CacheContext); 15360 popHostContainer(); 15361 break; 15362 case 26: 15363 case 27: 15364 case 5: 15365 popHostContext(interruptedWork); 15366 break; 15367 case 4: 15368 popHostContainer(); 15369 break; 15370 case 31: 15371 null !== interruptedWork.memoizedState && 15372 popSuspenseHandler(interruptedWork); 15373 break; 15374 case 13: 15375 popSuspenseHandler(interruptedWork); 15376 break; 15377 case 19: 15378 pop(suspenseStackCursor); 15379 break; 15380 case 10: 15381 popProvider(interruptedWork.type); 15382 break; 15383 case 22: 15384 case 23: 15385 popSuspenseHandler(interruptedWork); 15386 popHiddenContext(); 15387 null !== current && pop(resumedCache); 15388 break; 15389 case 24: 15390 popProvider(CacheContext); 15391 } 15392 } 15393 function commitHookEffectListMount(flags, finishedWork) { 15394 try { 15395 var updateQueue = finishedWork.updateQueue, 15396 lastEffect = null !== updateQueue ? updateQueue.lastEffect : null; 15397 if (null !== lastEffect) { 15398 var firstEffect = lastEffect.next; 15399 updateQueue = firstEffect; 15400 do { 15401 if ((updateQueue.tag & flags) === flags) { 15402 lastEffect = void 0; 15403 var create = updateQueue.create, 15404 inst = updateQueue.inst; 15405 lastEffect = create(); 15406 inst.destroy = lastEffect; 15407 } 15408 updateQueue = updateQueue.next; 15409 } while (updateQueue !== firstEffect); 15410 } 15411 } catch (error) { 15412 captureCommitPhaseError(finishedWork, finishedWork.return, error); 15413 } 15414 } 15415 function commitHookEffectListUnmount( 15416 flags, 15417 finishedWork, 15418 nearestMountedAncestor$jscomp$0 15419 ) { 15420 try { 15421 var updateQueue = finishedWork.updateQueue, 15422 lastEffect = null !== updateQueue ? updateQueue.lastEffect : null; 15423 if (null !== lastEffect) { 15424 var firstEffect = lastEffect.next; 15425 updateQueue = firstEffect; 15426 do { 15427 if ((updateQueue.tag & flags) === flags) { 15428 var inst = updateQueue.inst, 15429 destroy = inst.destroy; 15430 if (void 0 !== destroy) { 15431 inst.destroy = void 0; 15432 lastEffect = finishedWork; 15433 var nearestMountedAncestor = nearestMountedAncestor$jscomp$0, 15434 destroy_ = destroy; 15435 try { 15436 destroy_(); 15437 } catch (error) { 15438 captureCommitPhaseError( 15439 lastEffect, 15440 nearestMountedAncestor, 15441 error 15442 ); 15443 } 15444 } 15445 } 15446 updateQueue = updateQueue.next; 15447 } while (updateQueue !== firstEffect); 15448 } 15449 } catch (error) { 15450 captureCommitPhaseError(finishedWork, finishedWork.return, error); 15451 } 15452 } 15453 function commitClassCallbacks(finishedWork) { 15454 var updateQueue = finishedWork.updateQueue; 15455 if (null !== updateQueue) { 15456 var instance = finishedWork.stateNode; 15457 try { 15458 commitCallbacks(updateQueue, instance); 15459 } catch (error) { 15460 captureCommitPhaseError(finishedWork, finishedWork.return, error); 15461 } 15462 } 15463 } 15464 function safelyCallComponentWillUnmount( 15465 current, 15466 nearestMountedAncestor, 15467 instance 15468 ) { 15469 instance.props = resolveClassComponentProps( 15470 current.type, 15471 current.memoizedProps 15472 ); 15473 instance.state = current.memoizedState; 15474 try { 15475 instance.componentWillUnmount(); 15476 } catch (error) { 15477 captureCommitPhaseError(current, nearestMountedAncestor, error); 15478 } 15479 } 15480 function safelyAttachRef(current, nearestMountedAncestor) { 15481 try { 15482 var ref = current.ref; 15483 if (null !== ref) { 15484 switch (current.tag) { 15485 case 26: 15486 case 27: 15487 case 5: 15488 var instanceToUse = current.stateNode; 15489 break; 15490 case 30: 15491 instanceToUse = current.stateNode; 15492 break; 15493 default: 15494 instanceToUse = current.stateNode; 15495 } 15496 "function" === typeof ref 15497 ? (current.refCleanup = ref(instanceToUse)) 15498 : (ref.current = instanceToUse); 15499 } 15500 } catch (error) { 15501 captureCommitPhaseError(current, nearestMountedAncestor, error); 15502 } 15503 } 15504 function safelyDetachRef(current, nearestMountedAncestor) { 15505 var ref = current.ref, 15506 refCleanup = current.refCleanup; 15507 if (null !== ref) 15508 if ("function" === typeof refCleanup) 15509 try { 15510 refCleanup(); 15511 } catch (error) { 15512 captureCommitPhaseError(current, nearestMountedAncestor, error); 15513 } finally { 15514 (current.refCleanup = null), 15515 (current = current.alternate), 15516 null != current && (current.refCleanup = null); 15517 } 15518 else if ("function" === typeof ref) 15519 try { 15520 ref(null); 15521 } catch (error$140) { 15522 captureCommitPhaseError(current, nearestMountedAncestor, error$140); 15523 } 15524 else ref.current = null; 15525 } 15526 function commitHostMount(finishedWork) { 15527 var type = finishedWork.type, 15528 props = finishedWork.memoizedProps, 15529 instance = finishedWork.stateNode; 15530 try { 15531 a: switch (type) { 15532 case "button": 15533 case "input": 15534 case "select": 15535 case "textarea": 15536 props.autoFocus && instance.focus(); 15537 break a; 15538 case "img": 15539 props.src 15540 ? (instance.src = props.src) 15541 : props.srcSet && (instance.srcset = props.srcSet); 15542 } 15543 } catch (error) { 15544 captureCommitPhaseError(finishedWork, finishedWork.return, error); 15545 } 15546 } 15547 function commitHostUpdate(finishedWork, newProps, oldProps) { 15548 try { 15549 var domElement = finishedWork.stateNode; 15550 updateProperties(domElement, finishedWork.type, oldProps, newProps); 15551 domElement[internalPropsKey] = newProps; 15552 } catch (error) { 15553 captureCommitPhaseError(finishedWork, finishedWork.return, error); 15554 } 15555 } 15556 function isHostParent(fiber) { 15557 return ( 15558 5 === fiber.tag || 15559 3 === fiber.tag || 15560 26 === fiber.tag || 15561 (27 === fiber.tag && isSingletonScope(fiber.type)) || 15562 4 === fiber.tag 15563 ); 15564 } 15565 function getHostSibling(fiber) { 15566 a: for (;;) { 15567 for (; null === fiber.sibling; ) { 15568 if (null === fiber.return || isHostParent(fiber.return)) return null; 15569 fiber = fiber.return; 15570 } 15571 fiber.sibling.return = fiber.return; 15572 for ( 15573 fiber = fiber.sibling; 15574 5 !== fiber.tag && 6 !== fiber.tag && 18 !== fiber.tag; 15575 15576 ) { 15577 if (27 === fiber.tag && isSingletonScope(fiber.type)) continue a; 15578 if (fiber.flags & 2) continue a; 15579 if (null === fiber.child || 4 === fiber.tag) continue a; 15580 else (fiber.child.return = fiber), (fiber = fiber.child); 15581 } 15582 if (!(fiber.flags & 2)) return fiber.stateNode; 15583 } 15584 } 15585 function insertOrAppendPlacementNodeIntoContainer(node, before, parent) { 15586 var tag = node.tag; 15587 if (5 === tag || 6 === tag) 15588 (node = node.stateNode), 15589 before 15590 ? (9 === parent.nodeType 15591 ? parent.body 15592 : "HTML" === parent.nodeName 15593 ? parent.ownerDocument.body 15594 : parent 15595 ).insertBefore(node, before) 15596 : ((before = 15597 9 === parent.nodeType 15598 ? parent.body 15599 : "HTML" === parent.nodeName 15600 ? parent.ownerDocument.body 15601 : parent), 15602 before.appendChild(node), 15603 (parent = parent._reactRootContainer), 15604 (null !== parent && void 0 !== parent) || 15605 null !== before.onclick || 15606 (before.onclick = noop$1)); 15607 else if ( 15608 4 !== tag && 15609 (27 === tag && 15610 isSingletonScope(node.type) && 15611 ((parent = node.stateNode), (before = null)), 15612 (node = node.child), 15613 null !== node) 15614 ) 15615 for ( 15616 insertOrAppendPlacementNodeIntoContainer(node, before, parent), 15617 node = node.sibling; 15618 null !== node; 15619 15620 ) 15621 insertOrAppendPlacementNodeIntoContainer(node, before, parent), 15622 (node = node.sibling); 15623 } 15624 function insertOrAppendPlacementNode(node, before, parent) { 15625 var tag = node.tag; 15626 if (5 === tag || 6 === tag) 15627 (node = node.stateNode), 15628 before ? parent.insertBefore(node, before) : parent.appendChild(node); 15629 else if ( 15630 4 !== tag && 15631 (27 === tag && isSingletonScope(node.type) && (parent = node.stateNode), 15632 (node = node.child), 15633 null !== node) 15634 ) 15635 for ( 15636 insertOrAppendPlacementNode(node, before, parent), node = node.sibling; 15637 null !== node; 15638 15639 ) 15640 insertOrAppendPlacementNode(node, before, parent), (node = node.sibling); 15641 } 15642 function commitHostSingletonAcquisition(finishedWork) { 15643 var singleton = finishedWork.stateNode, 15644 props = finishedWork.memoizedProps; 15645 try { 15646 for ( 15647 var type = finishedWork.type, attributes = singleton.attributes; 15648 attributes.length; 15649 15650 ) 15651 singleton.removeAttributeNode(attributes[0]); 15652 setInitialProperties(singleton, type, props); 15653 singleton[internalInstanceKey] = finishedWork; 15654 singleton[internalPropsKey] = props; 15655 } catch (error) { 15656 captureCommitPhaseError(finishedWork, finishedWork.return, error); 15657 } 15658 } 15659 var offscreenSubtreeIsHidden = false, 15660 offscreenSubtreeWasHidden = false, 15661 needsFormReset = false, 15662 PossiblyWeakSet = "function" === typeof WeakSet ? WeakSet : Set, 15663 nextEffect = null; 15664 function commitBeforeMutationEffects(root, firstChild) { 15665 root = root.containerInfo; 15666 eventsEnabled = _enabled; 15667 root = getActiveElementDeep(root); 15668 if (hasSelectionCapabilities(root)) { 15669 if ("selectionStart" in root) 15670 var JSCompiler_temp = { 15671 start: root.selectionStart, 15672 end: root.selectionEnd 15673 }; 15674 else 15675
15675a: { 15676 JSCompiler_temp = 15677 ((JSCompiler_temp = root.ownerDocument) && 15678 JSCompiler_temp.defaultView) || 15679 window; 15680 var selection = 15681 JSCompiler_temp.getSelection && JSCompiler_temp.getSelection(); 15682 if (selection && 0 !== selection.rangeCount) { 15683 JSCompiler_temp = selection.anchorNode; 15684 var anchorOffset = selection.anchorOffset, 15685 focusNode = selection.focusNode; 15686 selection = selection.focusOffset; 15687 try { 15688 JSCompiler_temp.nodeType, focusNode.nodeType; 15689 } catch (e$20) { 15690 JSCompiler_temp = null; 15691 break a; 15692 }
vendor: 30,708 bytes, lines 15692-16525
15692 15693 var length = 0, 15694 start = -1, 15695 end = -1, 15696 indexWithinAnchor = 0, 15697 indexWithinFocus = 0, 15698 node = root, 15699 parentNode = null; 15700 b: for (;;) { 15701 for (var next; ; ) { 15702 node !== JSCompiler_temp || 15703 (0 !== anchorOffset && 3 !== node.nodeType) || 15704 (start = length + anchorOffset); 15705 node !== focusNode || 15706 (0 !== selection && 3 !== node.nodeType) || 15707 (end = length + selection); 15708 3 === node.nodeType && (length += node.nodeValue.length); 15709 if (null === (next = node.firstChild)) break; 15710 parentNode = node; 15711 node = next; 15712 } 15713 for (;;) { 15714 if (node === root) break b; 15715 parentNode === JSCompiler_temp && 15716 ++indexWithinAnchor === anchorOffset && 15717 (start = length); 15718 parentNode === focusNode && 15719 ++indexWithinFocus === selection && 15720 (end = length); 15721 if (null !== (next = node.nextSibling)) break; 15722 node = parentNode; 15723 parentNode = node.parentNode; 15724 } 15725 node = next; 15726 } 15727 JSCompiler_temp = 15728 -1 === start || -1 === end ? null : { start: start, end: end }; 15729 } else JSCompiler_temp = null; 15730 } 15731 JSCompiler_temp = JSCompiler_temp || { start: 0, end: 0 }; 15732 } else JSCompiler_temp = null; 15733 selectionInformation = { focusedElem: root, selectionRange: JSCompiler_temp }; 15734 _enabled = false; 15735 for (nextEffect = firstChild; null !== nextEffect; ) 15736 if ( 15737 ((firstChild = nextEffect), 15738 (root = firstChild.child), 15739 0 !== (firstChild.subtreeFlags & 1028) && null !== root) 15740 ) 15741 (root.return = firstChild), (nextEffect = root); 15742 else 15743 for (; null !== nextEffect; ) { 15744 firstChild = nextEffect; 15745 focusNode = firstChild.alternate; 15746 root = firstChild.flags; 15747 switch (firstChild.tag) { 15748 case 0: 15749 if ( 15750 0 !== (root & 4) && 15751 ((root = firstChild.updateQueue), 15752 (root = null !== root ? root.events : null), 15753 null !== root) 15754 ) 15755 for ( 15756 JSCompiler_temp = 0; 15757 JSCompiler_temp < root.length; 15758 JSCompiler_temp++ 15759 ) 15760 (anchorOffset = root[JSCompiler_temp]), 15761 (anchorOffset.ref.impl = anchorOffset.nextImpl); 15762 break; 15763 case 11: 15764 case 15: 15765 break; 15766 case 1: 15767 if (0 !== (root & 1024) && null !== focusNode) { 15768 root = void 0; 15769 JSCompiler_temp = firstChild; 15770 anchorOffset = focusNode.memoizedProps; 15771 focusNode = focusNode.memoizedState; 15772 selection = JSCompiler_temp.stateNode; 15773 try { 15774 var resolvedPrevProps = resolveClassComponentProps( 15775 JSCompiler_temp.type, 15776 anchorOffset 15777 ); 15778 root = selection.getSnapshotBeforeUpdate( 15779 resolvedPrevProps, 15780 focusNode 15781 ); 15782 selection.__reactInternalSnapshotBeforeUpdate = root; 15783 } catch (error) { 15784 captureCommitPhaseError( 15785 JSCompiler_temp, 15786 JSCompiler_temp.return, 15787 error 15788 ); 15789 } 15790 } 15791 break; 15792 case 3: 15793 if (0 !== (root & 1024)) 15794 if ( 15795 ((root = firstChild.stateNode.containerInfo), 15796 (JSCompiler_temp = root.nodeType), 15797 9 === JSCompiler_temp) 15798 ) 15799 clearContainerSparingly(root); 15800 else if (1 === JSCompiler_temp) 15801 switch (root.nodeName) { 15802 case "HEAD": 15803 case "HTML": 15804 case "BODY": 15805 clearContainerSparingly(root); 15806 break; 15807 default: 15808 root.textContent = ""; 15809 } 15810 break; 15811 case 5: 15812 case 26: 15813 case 27: 15814 case 6: 15815 case 4: 15816 case 17: 15817 break; 15818 default: 15819 if (0 !== (root & 1024)) throw Error(formatProdErrorMessage(163)); 15820 } 15821 root = firstChild.sibling; 15822 if (null !== root) { 15823 root.return = firstChild.return; 15824 nextEffect = root; 15825 break; 15826 } 15827 nextEffect = firstChild.return; 15828 } 15829 } 15830 function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { 15831 var flags = finishedWork.flags; 15832 switch (finishedWork.tag) { 15833 case 0: 15834 case 11: 15835 case 15: 15836 recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); 15837 flags & 4 && commitHookEffectListMount(5, finishedWork); 15838 break; 15839 case 1: 15840 recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); 15841 if (flags & 4) 15842 if (((finishedRoot = finishedWork.stateNode), null === current)) 15843 try { 15844 finishedRoot.componentDidMount(); 15845 } catch (error) { 15846 captureCommitPhaseError(finishedWork, finishedWork.return, error); 15847 } 15848 else { 15849 var prevProps = resolveClassComponentProps( 15850 finishedWork.type, 15851 current.memoizedProps 15852 ); 15853 current = current.memoizedState; 15854 try { 15855 finishedRoot.componentDidUpdate( 15856 prevProps, 15857 current, 15858 finishedRoot.__reactInternalSnapshotBeforeUpdate 15859 ); 15860 } catch (error$139) { 15861 captureCommitPhaseError( 15862 finishedWork, 15863 finishedWork.return, 15864 error$139 15865 ); 15866 } 15867 } 15868 flags & 64 && commitClassCallbacks(finishedWork); 15869 flags & 512 && safelyAttachRef(finishedWork, finishedWork.return); 15870 break; 15871 case 3: 15872 recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); 15873 if ( 15874 flags & 64 && 15875 ((finishedRoot = finishedWork.updateQueue), null !== finishedRoot) 15876 ) { 15877 current = null; 15878 if (null !== finishedWork.child) 15879 switch (finishedWork.child.tag) { 15880 case 27: 15881 case 5: 15882 current = finishedWork.child.stateNode; 15883 break; 15884 case 1: 15885 current = finishedWork.child.stateNode; 15886 } 15887 try { 15888 commitCallbacks(finishedRoot, current); 15889 } catch (error) { 15890 captureCommitPhaseError(finishedWork, finishedWork.return, error); 15891 } 15892 } 15893 break; 15894 case 27: 15895 null === current && 15896 flags & 4 && 15897 commitHostSingletonAcquisition(finishedWork); 15898 case 26: 15899 case 5: 15900 recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); 15901 null === current && flags & 4 && commitHostMount(finishedWork); 15902 flags & 512 && safelyAttachRef(finishedWork, finishedWork.return); 15903 break; 15904 case 12: 15905 recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); 15906 break; 15907 case 31: 15908 recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); 15909 flags & 4 && commitActivityHydrationCallbacks(finishedRoot, finishedWork); 15910 break; 15911 case 13: 15912 recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); 15913 flags & 4 && commitSuspenseHydrationCallbacks(finishedRoot, finishedWork); 15914 flags & 64 && 15915 ((finishedRoot = finishedWork.memoizedState), 15916 null !== finishedRoot && 15917 ((finishedRoot = finishedRoot.dehydrated), 15918 null !== finishedRoot && 15919 ((finishedWork = retryDehydratedSuspenseBoundary.bind( 15920 null, 15921 finishedWork 15922 )), 15923 registerSuspenseInstanceRetry(finishedRoot, finishedWork)))); 15924 break; 15925 case 22: 15926 flags = null !== finishedWork.memoizedState || offscreenSubtreeIsHidden; 15927 if (!flags) { 15928 current = 15929 (null !== current && null !== current.memoizedState) || 15930 offscreenSubtreeWasHidden; 15931 prevProps = offscreenSubtreeIsHidden; 15932 var prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden; 15933 offscreenSubtreeIsHidden = flags; 15934 (offscreenSubtreeWasHidden = current) && !prevOffscreenSubtreeWasHidden 15935 ? recursivelyTraverseReappearLayoutEffects( 15936 finishedRoot, 15937 finishedWork, 15938 0 !== (finishedWork.subtreeFlags & 8772) 15939 ) 15940 : recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); 15941 offscreenSubtreeIsHidden = prevProps; 15942 offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden; 15943 } 15944 break; 15945 case 30: 15946 break; 15947 default: 15948 recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); 15949 } 15950 } 15951 function detachFiberAfterEffects(fiber) { 15952 var alternate = fiber.alternate; 15953 null !== alternate && 15954 ((fiber.alternate = null), detachFiberAfterEffects(alternate)); 15955 fiber.child = null; 15956 fiber.deletions = null; 15957 fiber.sibling = null; 15958 5 === fiber.tag && 15959 ((alternate = fiber.stateNode), 15960 null !== alternate && detachDeletedInstance(alternate)); 15961 fiber.stateNode = null; 15962 fiber.return = null; 15963 fiber.dependencies = null; 15964 fiber.memoizedProps = null; 15965 fiber.memoizedState = null; 15966 fiber.pendingProps = null; 15967 fiber.stateNode = null; 15968 fiber.updateQueue = null; 15969 } 15970 var hostParent = null, 15971 hostParentIsContainer = false; 15972 function recursivelyTraverseDeletionEffects( 15973 finishedRoot, 15974 nearestMountedAncestor, 15975 parent 15976 ) { 15977 for (parent = parent.child; null !== parent; ) 15978 commitDeletionEffectsOnFiber(finishedRoot, nearestMountedAncestor, parent), 15979 (parent = parent.sibling); 15980 } 15981 function commitDeletionEffectsOnFiber( 15982 finishedRoot, 15983 nearestMountedAncestor, 15984 deletedFiber 15985 ) { 15986 if (injectedHook && "function" === typeof injectedHook.onCommitFiberUnmount) 15987 try { 15988 injectedHook.onCommitFiberUnmount(rendererID, deletedFiber); 15989 } catch (err) {} 15990 switch (deletedFiber.tag) { 15991 case 26: 15992 offscreenSubtreeWasHidden || 15993 safelyDetachRef(deletedFiber, nearestMountedAncestor); 15994 recursivelyTraverseDeletionEffects( 15995 finishedRoot, 15996 nearestMountedAncestor, 15997 deletedFiber 15998 ); 15999 deletedFiber.memoizedState 16000 ? deletedFiber.memoizedState.count-- 16001 : deletedFiber.stateNode && 16002 ((deletedFiber = deletedFiber.stateNode), 16003 deletedFiber.parentNode.removeChild(deletedFiber)); 16004 break; 16005 case 27: 16006 offscreenSubtreeWasHidden || 16007 safelyDetachRef(deletedFiber, nearestMountedAncestor); 16008 var prevHostParent = hostParent, 16009 prevHostParentIsContainer = hostParentIsContainer; 16010 isSingletonScope(deletedFiber.type) && 16011 ((hostParent = deletedFiber.stateNode), (hostParentIsContainer = false)); 16012 recursivelyTraverseDeletionEffects( 16013 finishedRoot, 16014 nearestMountedAncestor, 16015 deletedFiber 16016 ); 16017 releaseSingletonInstance(deletedFiber.stateNode); 16018 hostParent = prevHostParent; 16019 hostParentIsContainer = prevHostParentIsContainer; 16020 break; 16021 case 5: 16022 offscreenSubtreeWasHidden || 16023 safelyDetachRef(deletedFiber, nearestMountedAncestor); 16024 case 6: 16025 prevHostParent = hostParent; 16026 prevHostParentIsContainer = hostParentIsContainer; 16027 hostParent = null; 16028 recursivelyTraverseDeletionEffects( 16029 finishedRoot, 16030 nearestMountedAncestor, 16031 deletedFiber 16032 ); 16033 hostParent = prevHostParent; 16034 hostParentIsContainer = prevHostParentIsContainer; 16035 if (null !== hostParent) 16036 if (hostParentIsContainer) 16037 try { 16038 (9 === hostParent.nodeType 16039 ? hostParent.body 16040 : "HTML" === hostParent.nodeName 16041 ? hostParent.ownerDocument.body 16042 : hostParent 16043 ).removeChild(deletedFiber.stateNode); 16044 } catch (error) { 16045 captureCommitPhaseError( 16046 deletedFiber, 16047 nearestMountedAncestor, 16048 error 16049 ); 16050 } 16051 else 16052 try { 16053 hostParent.removeChild(deletedFiber.stateNode); 16054 } catch (error) { 16055 captureCommitPhaseError( 16056 deletedFiber, 16057 nearestMountedAncestor, 16058 error 16059 ); 16060 } 16061 break; 16062 case 18: 16063 null !== hostParent && 16064 (hostParentIsContainer 16065 ? ((finishedRoot = hostParent), 16066 clearHydrationBoundary( 16067 9 === finishedRoot.nodeType 16068 ? finishedRoot.body 16069 : "HTML" === finishedRoot.nodeName 16070 ? finishedRoot.ownerDocument.body 16071 : finishedRoot, 16072 deletedFiber.stateNode 16073 ), 16074 retryIfBlockedOn(finishedRoot)) 16075 : clearHydrationBoundary(hostParent, deletedFiber.stateNode)); 16076 break; 16077 case 4: 16078 prevHostParent = hostParent; 16079 prevHostParentIsContainer = hostParentIsContainer; 16080 hostParent = deletedFiber.stateNode.containerInfo; 16081 hostParentIsContainer = true; 16082 recursivelyTraverseDeletionEffects( 16083 finishedRoot, 16084 nearestMountedAncestor, 16085 deletedFiber 16086 ); 16087 hostParent = prevHostParent; 16088 hostParentIsContainer = prevHostParentIsContainer; 16089 break; 16090 case 0: 16091 case 11: 16092 case 14: 16093 case 15: 16094 commitHookEffectListUnmount(2, deletedFiber, nearestMountedAncestor); 16095 offscreenSubtreeWasHidden || 16096 commitHookEffectListUnmount(4, deletedFiber, nearestMountedAncestor); 16097 recursivelyTraverseDeletionEffects( 16098 finishedRoot, 16099 nearestMountedAncestor, 16100 deletedFiber 16101 ); 16102 break; 16103 case 1: 16104 offscreenSubtreeWasHidden || 16105 (safelyDetachRef(deletedFiber, nearestMountedAncestor), 16106 (prevHostParent = deletedFiber.stateNode), 16107 "function" === typeof prevHostParent.componentWillUnmount && 16108 safelyCallComponentWillUnmount( 16109 deletedFiber, 16110 nearestMountedAncestor, 16111 prevHostParent 16112 )); 16113 recursivelyTraverseDeletionEffects( 16114 finishedRoot, 16115 nearestMountedAncestor, 16116 deletedFiber 16117 ); 16118 break; 16119 case 21: 16120 recursivelyTraverseDeletionEffects( 16121 finishedRoot, 16122 nearestMountedAncestor, 16123 deletedFiber 16124 ); 16125 break; 16126 case 22: 16127 offscreenSubtreeWasHidden = 16128 (prevHostParent = offscreenSubtreeWasHidden) || 16129 null !== deletedFiber.memoizedState; 16130 recursivelyTraverseDeletionEffects( 16131 finishedRoot, 16132 nearestMountedAncestor, 16133 deletedFiber 16134 ); 16135 offscreenSubtreeWasHidden = prevHostParent; 16136 break; 16137 default: 16138 recursivelyTraverseDeletionEffects( 16139 finishedRoot, 16140 nearestMountedAncestor, 16141 deletedFiber 16142 ); 16143 } 16144 } 16145 function commitActivityHydrationCallbacks(finishedRoot, finishedWork) { 16146 if ( 16147 null === finishedWork.memoizedState && 16148 ((finishedRoot = finishedWork.alternate), 16149 null !== finishedRoot && 16150 ((finishedRoot = finishedRoot.memoizedState), null !== finishedRoot)) 16151 ) { 16152 finishedRoot = finishedRoot.dehydrated; 16153 try { 16154 retryIfBlockedOn(finishedRoot); 16155 } catch (error) { 16156 captureCommitPhaseError(finishedWork, finishedWork.return, error); 16157 } 16158 } 16159 } 16160 function commitSuspenseHydrationCallbacks(finishedRoot, finishedWork) { 16161 if ( 16162 null === finishedWork.memoizedState && 16163 ((finishedRoot = finishedWork.alternate), 16164 null !== finishedRoot && 16165 ((finishedRoot = finishedRoot.memoizedState), 16166 null !== finishedRoot && 16167 ((finishedRoot = finishedRoot.dehydrated), null !== finishedRoot))) 16168 ) 16169 try { 16170 retryIfBlockedOn(finishedRoot); 16171 } catch (error) { 16172 captureCommitPhaseError(finishedWork, finishedWork.return, error); 16173 } 16174 } 16175 function getRetryCache(finishedWork) { 16176 switch (finishedWork.tag) { 16177 case 31: 16178 case 13: 16179 case 19: 16180 var retryCache = finishedWork.stateNode; 16181 null === retryCache && 16182 (retryCache = finishedWork.stateNode = new PossiblyWeakSet()); 16183 return retryCache; 16184 case 22: 16185 return ( 16186 (finishedWork = finishedWork.stateNode), 16187 (retryCache = finishedWork._retryCache), 16188 null === retryCache && 16189 (retryCache = finishedWork._retryCache = new PossiblyWeakSet()), 16190 retryCache 16191 ); 16192 default: 16193 throw Error(formatProdErrorMessage(435, finishedWork.tag)); 16194 } 16195 } 16196 function attachSuspenseRetryListeners(finishedWork, wakeables) { 16197 var retryCache = getRetryCache(finishedWork); 16198 wakeables.forEach(function (wakeable) { 16199 if (!retryCache.has(wakeable)) { 16200 retryCache.add(wakeable); 16201 var retry = resolveRetryWakeable.bind(null, finishedWork, wakeable); 16202 wakeable.then(retry, retry); 16203 } 16204 }); 16205 } 16206 function recursivelyTraverseMutationEffects(root$jscomp$0, parentFiber) { 16207 var deletions = parentFiber.deletions; 16208 if (null !== deletions) 16209 for (var i = 0; i < deletions.length; i++) { 16210 var childToDelete = deletions[i], 16211 root = root$jscomp$0, 16212 returnFiber = parentFiber, 16213 parent = returnFiber; 16214 a: for (; null !== parent; ) { 16215 switch (parent.tag) { 16216 case 27: 16217 if (isSingletonScope(parent.type)) { 16218 hostParent = parent.stateNode; 16219 hostParentIsContainer = false; 16220 break a; 16221 } 16222 break; 16223 case 5: 16224 hostParent = parent.stateNode; 16225 hostParentIsContainer = false; 16226 break a; 16227 case 3: 16228 case 4: 16229 hostParent = parent.stateNode.containerInfo; 16230 hostParentIsContainer = true; 16231 break a; 16232 } 16233 parent = parent.return; 16234 } 16235 if (null === hostParent) throw Error(formatProdErrorMessage(160)); 16236 commitDeletionEffectsOnFiber(root, returnFiber, childToDelete); 16237 hostParent = null; 16238 hostParentIsContainer = false; 16239 root = childToDelete.alternate; 16240 null !== root && (root.return = null); 16241 childToDelete.return = null; 16242 } 16243 if (parentFiber.subtreeFlags & 13886) 16244 for (parentFiber = parentFiber.child; null !== parentFiber; ) 16245 commitMutationEffectsOnFiber(parentFiber, root$jscomp$0), 16246 (parentFiber = parentFiber.sibling); 16247 } 16248 var currentHoistableRoot = null; 16249 function commitMutationEffectsOnFiber(finishedWork, root) { 16250 var current = finishedWork.alternate, 16251 flags = finishedWork.flags; 16252 switch (finishedWork.tag) { 16253 case 0: 16254 case 11: 16255 case 14: 16256 case 15: 16257 recursivelyTraverseMutationEffects(root, finishedWork); 16258 commitReconciliationEffects(finishedWork); 16259 flags & 4 && 16260 (commitHookEffectListUnmount(3, finishedWork, finishedWork.return), 16261 commitHookEffectListMount(3, finishedWork), 16262 commitHookEffectListUnmount(5, finishedWork, finishedWork.return)); 16263 break; 16264 case 1: 16265 recursivelyTraverseMutationEffects(root, finishedWork); 16266 commitReconciliationEffects(finishedWork); 16267 flags & 512 && 16268 (offscreenSubtreeWasHidden || 16269 null === current || 16270 safelyDetachRef(current, current.return)); 16271 flags & 64 && 16272 offscreenSubtreeIsHidden && 16273 ((finishedWork = finishedWork.updateQueue), 16274 null !== finishedWork && 16275 ((flags = finishedWork.callbacks), 16276 null !== flags && 16277 ((current = finishedWork.shared.hiddenCallbacks), 16278 (finishedWork.shared.hiddenCallbacks = 16279 null === current ? flags : current.concat(flags))))); 16280 break; 16281 case 26: 16282 var hoistableRoot = currentHoistableRoot; 16283 recursivelyTraverseMutationEffects(root, finishedWork); 16284 commitReconciliationEffects(finishedWork); 16285 flags & 512 && 16286 (offscreenSubtreeWasHidden || 16287 null === current || 16288 safelyDetachRef(current, current.return)); 16289 if (flags & 4) { 16290 var currentResource = null !== current ? current.memoizedState : null; 16291 flags = finishedWork.memoizedState; 16292 if (null === current) 16293 if (null === flags) 16294 if (null === finishedWork.stateNode) { 16295 a: { 16296 flags = finishedWork.type; 16297 current = finishedWork.memoizedProps; 16298 hoistableRoot = hoistableRoot.ownerDocument || hoistableRoot; 16299 b: switch (flags) { 16300 case "title": 16301 currentResource = 16302 hoistableRoot.getElementsByTagName("title")[0]; 16303 if ( 16304 !currentResource || 16305 currentResource[internalHoistableMarker] || 16306 currentResource[internalInstanceKey] || 16307 "http://www.w3.org/2000/svg" === 16308 currentResource.namespaceURI || 16309 currentResource.hasAttribute("itemprop") 16310 ) 16311 (currentResource = hoistableRoot.createElement(flags)), 16312 hoistableRoot.head.insertBefore( 16313 currentResource, 16314 hoistableRoot.querySelector("head > title") 16315 ); 16316 setInitialProperties(currentResource, flags, current); 16317 currentResource[internalInstanceKey] = finishedWork; 16318 markNodeAsHoistable(currentResource); 16319 flags = currentResource; 16320 break a; 16321 case "link": 16322 var maybeNodes = getHydratableHoistableCache( 16323 "link", 16324 "href", 16325 hoistableRoot 16326 ).get(flags + (current.href || "")); 16327 if (maybeNodes) 16328 for (var i = 0; i < maybeNodes.length; i++) 16329 if ( 16330 ((currentResource = maybeNodes[i]), 16331 currentResource.getAttribute("href") === 16332 (null == current.href || "" === current.href 16333 ? null 16334 : current.href) && 16335 currentResource.getAttribute("rel") === 16336 (null == current.rel ? null : current.rel) && 16337 currentResource.getAttribute("title") === 16338 (null == current.title ? null : current.title) && 16339 currentResource.getAttribute("crossorigin") === 16340 (null == current.crossOrigin 16341 ? null 16342 : current.crossOrigin)) 16343 ) { 16344 maybeNodes.splice(i, 1); 16345 break b; 16346 } 16347 currentResource = hoistableRoot.createElement(flags); 16348 setInitialProperties(currentResource, flags, current); 16349 hoistableRoot.head.appendChild(currentResource); 16350 break; 16351 case "meta": 16352 if ( 16353 (maybeNodes = getHydratableHoistableCache( 16354 "meta", 16355 "content", 16356 hoistableRoot 16357 ).get(flags + (current.content || ""))) 16358 ) 16359 for (i = 0; i < maybeNodes.length; i++) 16360 if ( 16361 ((currentResource = maybeNodes[i]), 16362 currentResource.getAttribute("content") === 16363 (null == current.content 16364 ? null 16365 : "" + current.content) && 16366 currentResource.getAttribute("name") === 16367 (null == current.name ? null : current.name) && 16368 currentResource.getAttribute("property") === 16369 (null == current.property 16370 ? null 16371 : current.property) && 16372 currentResource.getAttribute("http-equiv") === 16373 (null == current.httpEquiv 16374 ? null 16375 : current.httpEquiv) && 16376 currentResource.getAttribute("charset") === 16377 (null == current.charSet 16378 ? null 16379 : current.charSet)) 16380 ) { 16381 maybeNodes.splice(i, 1); 16382 break b; 16383 } 16384 currentResource = hoistableRoot.createElement(flags); 16385 setInitialProperties(currentResource, flags, current); 16386 hoistableRoot.head.appendChild(currentResource); 16387 break; 16388 default: 16389 throw Error(formatProdErrorMessage(468, flags)); 16390 } 16391 currentResource[internalInstanceKey] = finishedWork; 16392 markNodeAsHoistable(currentResource); 16393 flags = currentResource; 16394 } 16395 finishedWork.stateNode = flags; 16396 } else 16397 mountHoistable( 16398 hoistableRoot, 16399 finishedWork.type, 16400 finishedWork.stateNode 16401 ); 16402 else 16403 finishedWork.stateNode = acquireResource( 16404 hoistableRoot, 16405 flags, 16406 finishedWork.memoizedProps 16407 ); 16408 else 16409 currentResource !== flags 16410 ? (null === currentResource 16411 ? null !== current.stateNode && 16412 ((current = current.stateNode), 16413 current.parentNode.removeChild(current)) 16414 : currentResource.count--, 16415 null === flags 16416 ? mountHoistable( 16417 hoistableRoot, 16418 finishedWork.type, 16419 finishedWork.stateNode 16420 ) 16421 : acquireResource( 16422 hoistableRoot, 16423 flags, 16424 finishedWork.memoizedProps 16425 )) 16426 : null === flags && 16427 null !== finishedWork.stateNode && 16428 commitHostUpdate( 16429 finishedWork, 16430 finishedWork.memoizedProps, 16431 current.memoizedProps 16432 ); 16433 } 16434 break; 16435 case 27: 16436 recursivelyTraverseMutationEffects(root, finishedWork); 16437 commitReconciliationEffects(finishedWork); 16438 flags & 512 && 16439 (offscreenSubtreeWasHidden || 16440 null === current || 16441 safelyDetachRef(current, current.return)); 16442 null !== current && 16443 flags & 4 && 16444 commitHostUpdate( 16445 finishedWork, 16446 finishedWork.memoizedProps, 16447 current.memoizedProps 16448 ); 16449 break; 16450 case 5: 16451 recursivelyTraverseMutationEffects(root, finishedWork); 16452 commitReconciliationEffects(finishedWork); 16453 flags & 512 && 16454 (offscreenSubtreeWasHidden || 16455 null === current || 16456 safelyDetachRef(current, current.return)); 16457 if (finishedWork.flags & 32) { 16458 hoistableRoot = finishedWork.stateNode; 16459 try { 16460 setTextContent(hoistableRoot, ""); 16461 } catch (error) { 16462 captureCommitPhaseError(finishedWork, finishedWork.return, error); 16463 } 16464 } 16465 flags & 4 && 16466 null != finishedWork.stateNode && 16467 ((hoistableRoot = finishedWork.memoizedProps), 16468 commitHostUpdate( 16469 finishedWork, 16470 hoistableRoot, 16471 null !== current ? current.memoizedProps : hoistableRoot 16472 )); 16473 flags & 1024 && (needsFormReset = true); 16474 break; 16475 case 6: 16476 recursivelyTraverseMutationEffects(root, finishedWork); 16477 commitReconciliationEffects(finishedWork); 16478 if (flags & 4) { 16479 if (null === finishedWork.stateNode) 16480 throw Error(formatProdErrorMessage(162)); 16481 flags = finishedWork.memoizedProps; 16482 current = finishedWork.stateNode; 16483 try { 16484 current.nodeValue = flags; 16485 } catch (error) { 16486 captureCommitPhaseError(finishedWork, finishedWork.return, error); 16487 } 16488 } 16489 break; 16490 case 3: 16491 tagCaches = null; 16492 hoistableRoot = currentHoistableRoot; 16493 currentHoistableRoot = getHoistableRoot(root.containerInfo); 16494 recursivelyTraverseMutationEffects(root, finishedWork); 16495 currentHoistableRoot = hoistableRoot; 16496 commitReconciliationEffects(finishedWork); 16497 if (flags & 4 && null !== current && current.memoizedState.isDehydrated) 16498 try { 16499 retryIfBlockedOn(root.containerInfo); 16500 } catch (error) { 16501 captureCommitPhaseError(finishedWork, finishedWork.return, error); 16502 } 16503 needsFormReset && 16504 ((needsFormReset = false), recursivelyResetForms(finishedWork)); 16505 break; 16506 case 4: 16507 flags = currentHoistableRoot; 16508 currentHoistableRoot = getHoistableRoot( 16509 finishedWork.stateNode.containerInfo 16510 ); 16511 recursivelyTraverseMutationEffects(root, finishedWork); 16512 commitReconciliationEffects(finishedWork); 16513 currentHoistableRoot = flags; 16514 break; 16515 case 12: 16516 recursivelyTraverseMutationEffects(root, finishedWork); 16517 commitReconciliationEffects(finishedWork); 16518 break; 16519 case 31: 16520 recursivelyTraverseMutationEffects(root, finishedWork); 16521 commitReconciliationEffects(finishedWork); 16522 flags & 4 && 16523 ((flags = finishedWork.updateQueue), 16524 null !== flags && 16525 ((finishedWork.updateQueue = null),
vendor: 4,951 bytes, lines 16526-16644
16526 attachSuspenseRetryListeners(finishedWork, flags))); 16527 break; 16528 case 13: 16529 recursivelyTraverseMutationEffects(root, finishedWork); 16530 commitReconciliationEffects(finishedWork); 16531 finishedWork.child.flags & 8192 && 16532 (null !== finishedWork.memoizedState) !== 16533 (null !== current && null !== current.memoizedState) && 16534 (globalMostRecentFallbackTime = now()); 16535 flags & 4 && 16536 ((flags = finishedWork.updateQueue), 16537 null !== flags && 16538 ((finishedWork.updateQueue = null), 16539 attachSuspenseRetryListeners(finishedWork, flags))); 16540 break; 16541 case 22: 16542 hoistableRoot = null !== finishedWork.memoizedState; 16543 var wasHidden = null !== current && null !== current.memoizedState, 16544 prevOffscreenSubtreeIsHidden = offscreenSubtreeIsHidden, 16545 prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden; 16546 offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden || hoistableRoot; 16547 offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden || wasHidden; 16548 recursivelyTraverseMutationEffects(root, finishedWork); 16549 offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden; 16550 offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden; 16551 commitReconciliationEffects(finishedWork); 16552 if (flags & 8192) 16553 a: for ( 16554 root = finishedWork.stateNode, 16555 root._visibility = hoistableRoot 16556 ? root._visibility & -2 16557 : root._visibility | 1, 16558 hoistableRoot && 16559 (null === current || 16560 wasHidden || 16561 offscreenSubtreeIsHidden || 16562 offscreenSubtreeWasHidden || 16563 recursivelyTraverseDisappearLayoutEffects(finishedWork)), 16564 current = null, 16565 root = finishedWork; 16566 ; 16567 16568 ) { 16569 if (5 === root.tag || 26 === root.tag) { 16570 if (null === current) { 16571 wasHidden = current = root; 16572 try { 16573 if (((currentResource = wasHidden.stateNode), hoistableRoot)) 16574 (maybeNodes = currentResource.style), 16575 "function" === typeof maybeNodes.setProperty 16576 ? maybeNodes.setProperty("display", "none", "important") 16577 : (maybeNodes.display = "none"); 16578 else { 16579 i = wasHidden.stateNode; 16580 var styleProp = wasHidden.memoizedProps.style, 16581 display = 16582 void 0 !== styleProp && 16583 null !== styleProp && 16584 styleProp.hasOwnProperty("display") 16585 ? styleProp.display 16586 : null; 16587 i.style.display = 16588 null == display || "boolean" === typeof display 16589 ? "" 16590 : ("" + display).trim(); 16591 } 16592 } catch (error) { 16593 captureCommitPhaseError(wasHidden, wasHidden.return, error); 16594 } 16595 } 16596 } else if (6 === root.tag) { 16597 if (null === current) { 16598 wasHidden = root; 16599 try { 16600 wasHidden.stateNode.nodeValue = hoistableRoot 16601 ? "" 16602 : wasHidden.memoizedProps; 16603 } catch (error) { 16604 captureCommitPhaseError(wasHidden, wasHidden.return, error); 16605 } 16606 } 16607 } else if (18 === root.tag) { 16608 if (null === current) { 16609 wasHidden = root; 16610 try { 16611 var instance = wasHidden.stateNode; 16612 hoistableRoot 16613 ? hideOrUnhideDehydratedBoundary(instance, !0) 16614 : hideOrUnhideDehydratedBoundary(wasHidden.stateNode, !1); 16615 } catch (error) { 16616 captureCommitPhaseError(wasHidden, wasHidden.return, error); 16617 } 16618 } 16619 } else if ( 16620 ((22 !== root.tag && 23 !== root.tag) || 16621 null === root.memoizedState || 16622 root === finishedWork) && 16623 null !== root.child 16624 ) { 16625 root.child.return = root; 16626 root = root.child; 16627 continue; 16628 } 16629 if (root === finishedWork) break a; 16630 for (; null === root.sibling; ) { 16631 if (null === root.return || root.return === finishedWork) break a; 16632 current === root && (current = null); 16633 root = root.return; 16634 } 16635 current === root && (current = null); 16636 root.sibling.return = root.return; 16637 root = root.sibling; 16638 } 16639 flags & 4 && 16640 ((flags = finishedWork.updateQueue), 16641 null !== flags && 16642 ((current = flags.retryQueue), 16643 null !== current && 16644 ((flags.retryQueue = null),
vendor: 36,720 bytes, lines 16645-17768
16645 attachSuspenseRetryListeners(finishedWork, current)))); 16646 break; 16647 case 19: 16648 recursivelyTraverseMutationEffects(root, finishedWork); 16649 commitReconciliationEffects(finishedWork); 16650 flags & 4 && 16651 ((flags = finishedWork.updateQueue), 16652 null !== flags && 16653 ((finishedWork.updateQueue = null), 16654 attachSuspenseRetryListeners(finishedWork, flags))); 16655 break; 16656 case 30: 16657 break; 16658 case 21: 16659 break; 16660 default: 16661 recursivelyTraverseMutationEffects(root, finishedWork), 16662 commitReconciliationEffects(finishedWork); 16663 } 16664 } 16665 function commitReconciliationEffects(finishedWork) { 16666 var flags = finishedWork.flags; 16667 if (flags & 2) { 16668 try { 16669 for ( 16670 var hostParentFiber, parentFiber = finishedWork.return; 16671 null !== parentFiber; 16672 16673 ) { 16674 if (isHostParent(parentFiber)) { 16675 hostParentFiber = parentFiber; 16676 break; 16677 } 16678 parentFiber = parentFiber.return; 16679 } 16680 if (null == hostParentFiber) throw Error(formatProdErrorMessage(160)); 16681 switch (hostParentFiber.tag) { 16682 case 27: 16683 var parent = hostParentFiber.stateNode, 16684 before = getHostSibling(finishedWork); 16685 insertOrAppendPlacementNode(finishedWork, before, parent); 16686 break; 16687 case 5: 16688 var parent$141 = hostParentFiber.stateNode; 16689 hostParentFiber.flags & 32 && 16690 (setTextContent(parent$141, ""), (hostParentFiber.flags &= -33)); 16691 var before$142 = getHostSibling(finishedWork); 16692 insertOrAppendPlacementNode(finishedWork, before$142, parent$141); 16693 break; 16694 case 3: 16695 case 4: 16696 var parent$143 = hostParentFiber.stateNode.containerInfo, 16697 before$144 = getHostSibling(finishedWork); 16698 insertOrAppendPlacementNodeIntoContainer( 16699 finishedWork, 16700 before$144, 16701 parent$143 16702 ); 16703 break; 16704 default: 16705 throw Error(formatProdErrorMessage(161)); 16706 } 16707 } catch (error) { 16708 captureCommitPhaseError(finishedWork, finishedWork.return, error); 16709 } 16710 finishedWork.flags &= -3; 16711 } 16712 flags & 4096 && (finishedWork.flags &= -4097); 16713 } 16714 function recursivelyResetForms(parentFiber) { 16715 if (parentFiber.subtreeFlags & 1024) 16716 for (parentFiber = parentFiber.child; null !== parentFiber; ) { 16717 var fiber = parentFiber; 16718 recursivelyResetForms(fiber); 16719 5 === fiber.tag && fiber.flags & 1024 && fiber.stateNode.reset(); 16720 parentFiber = parentFiber.sibling; 16721 } 16722 } 16723 function recursivelyTraverseLayoutEffects(root, parentFiber) { 16724 if (parentFiber.subtreeFlags & 8772) 16725 for (parentFiber = parentFiber.child; null !== parentFiber; ) 16726 commitLayoutEffectOnFiber(root, parentFiber.alternate, parentFiber), 16727 (parentFiber = parentFiber.sibling); 16728 } 16729 function recursivelyTraverseDisappearLayoutEffects(parentFiber) { 16730 for (parentFiber = parentFiber.child; null !== parentFiber; ) { 16731 var finishedWork = parentFiber; 16732 switch (finishedWork.tag) { 16733 case 0: 16734 case 11: 16735 case 14: 16736 case 15: 16737 commitHookEffectListUnmount(4, finishedWork, finishedWork.return); 16738 recursivelyTraverseDisappearLayoutEffects(finishedWork); 16739 break; 16740 case 1: 16741 safelyDetachRef(finishedWork, finishedWork.return); 16742 var instance = finishedWork.stateNode; 16743 "function" === typeof instance.componentWillUnmount && 16744 safelyCallComponentWillUnmount( 16745 finishedWork, 16746 finishedWork.return, 16747 instance 16748 ); 16749 recursivelyTraverseDisappearLayoutEffects(finishedWork); 16750 break; 16751 case 27: 16752 releaseSingletonInstance(finishedWork.stateNode); 16753 case 26: 16754 case 5: 16755 safelyDetachRef(finishedWork, finishedWork.return); 16756 recursivelyTraverseDisappearLayoutEffects(finishedWork); 16757 break; 16758 case 22: 16759 null === finishedWork.memoizedState && 16760 recursivelyTraverseDisappearLayoutEffects(finishedWork); 16761 break; 16762 case 30: 16763 recursivelyTraverseDisappearLayoutEffects(finishedWork); 16764 break; 16765 default: 16766 recursivelyTraverseDisappearLayoutEffects(finishedWork); 16767 } 16768 parentFiber = parentFiber.sibling; 16769 } 16770 } 16771 function recursivelyTraverseReappearLayoutEffects( 16772 finishedRoot$jscomp$0, 16773 parentFiber, 16774 includeWorkInProgressEffects 16775 ) { 16776 includeWorkInProgressEffects = 16777 includeWorkInProgressEffects && 0 !== (parentFiber.subtreeFlags & 8772); 16778 for (parentFiber = parentFiber.child; null !== parentFiber; ) { 16779 var current = parentFiber.alternate, 16780 finishedRoot = finishedRoot$jscomp$0, 16781 finishedWork = parentFiber, 16782 flags = finishedWork.flags; 16783 switch (finishedWork.tag) { 16784 case 0: 16785 case 11: 16786 case 15: 16787 recursivelyTraverseReappearLayoutEffects( 16788 finishedRoot, 16789 finishedWork, 16790 includeWorkInProgressEffects 16791 ); 16792 commitHookEffectListMount(4, finishedWork); 16793 break; 16794 case 1: 16795 recursivelyTraverseReappearLayoutEffects( 16796 finishedRoot, 16797 finishedWork, 16798 includeWorkInProgressEffects 16799 ); 16800 current = finishedWork; 16801 finishedRoot = current.stateNode; 16802 if ("function" === typeof finishedRoot.componentDidMount) 16803 try { 16804 finishedRoot.componentDidMount(); 16805 } catch (error) { 16806 captureCommitPhaseError(current, current.return, error); 16807 } 16808 current = finishedWork; 16809 finishedRoot = current.updateQueue; 16810 if (null !== finishedRoot) { 16811 var instance = current.stateNode; 16812 try { 16813 var hiddenCallbacks = finishedRoot.shared.hiddenCallbacks; 16814 if (null !== hiddenCallbacks) 16815 for ( 16816 finishedRoot.shared.hiddenCallbacks = null, finishedRoot = 0; 16817 finishedRoot < hiddenCallbacks.length; 16818 finishedRoot++ 16819 ) 16820 callCallback(hiddenCallbacks[finishedRoot], instance); 16821 } catch (error) { 16822 captureCommitPhaseError(current, current.return, error); 16823 } 16824 } 16825 includeWorkInProgressEffects && 16826 flags & 64 && 16827 commitClassCallbacks(finishedWork); 16828 safelyAttachRef(finishedWork, finishedWork.return); 16829 break; 16830 case 27: 16831 commitHostSingletonAcquisition(finishedWork); 16832 case 26: 16833 case 5: 16834 recursivelyTraverseReappearLayoutEffects( 16835 finishedRoot, 16836 finishedWork, 16837 includeWorkInProgressEffects 16838 ); 16839 includeWorkInProgressEffects && 16840 null === current && 16841 flags & 4 && 16842 commitHostMount(finishedWork); 16843 safelyAttachRef(finishedWork, finishedWork.return); 16844 break; 16845 case 12: 16846 recursivelyTraverseReappearLayoutEffects( 16847 finishedRoot, 16848 finishedWork, 16849 includeWorkInProgressEffects 16850 ); 16851 break; 16852 case 31: 16853 recursivelyTraverseReappearLayoutEffects( 16854 finishedRoot, 16855 finishedWork, 16856 includeWorkInProgressEffects 16857 ); 16858 includeWorkInProgressEffects && 16859 flags & 4 && 16860 commitActivityHydrationCallbacks(finishedRoot, finishedWork); 16861 break; 16862 case 13: 16863 recursivelyTraverseReappearLayoutEffects( 16864 finishedRoot, 16865 finishedWork, 16866 includeWorkInProgressEffects 16867 ); 16868 includeWorkInProgressEffects && 16869 flags & 4 && 16870 commitSuspenseHydrationCallbacks(finishedRoot, finishedWork); 16871 break; 16872 case 22: 16873 null === finishedWork.memoizedState && 16874 recursivelyTraverseReappearLayoutEffects( 16875 finishedRoot, 16876 finishedWork, 16877 includeWorkInProgressEffects 16878 ); 16879 safelyAttachRef(finishedWork, finishedWork.return); 16880 break; 16881 case 30: 16882 break; 16883 default: 16884 recursivelyTraverseReappearLayoutEffects( 16885 finishedRoot, 16886 finishedWork, 16887 includeWorkInProgressEffects 16888 ); 16889 } 16890 parentFiber = parentFiber.sibling; 16891 } 16892 } 16893 function commitOffscreenPassiveMountEffects(current, finishedWork) { 16894 var previousCache = null; 16895 null !== current && 16896 null !== current.memoizedState && 16897 null !== current.memoizedState.cachePool && 16898 (previousCache = current.memoizedState.cachePool.pool); 16899 current = null; 16900 null !== finishedWork.memoizedState && 16901 null !== finishedWork.memoizedState.cachePool && 16902 (current = finishedWork.memoizedState.cachePool.pool); 16903 current !== previousCache && 16904 (null != current && current.refCount++, 16905 null != previousCache && releaseCache(previousCache)); 16906 } 16907 function commitCachePassiveMountEffect(current, finishedWork) { 16908 current = null; 16909 null !== finishedWork.alternate && 16910 (current = finishedWork.alternate.memoizedState.cache); 16911 finishedWork = finishedWork.memoizedState.cache; 16912 finishedWork !== current && 16913 (finishedWork.refCount++, null != current && releaseCache(current)); 16914 } 16915 function recursivelyTraversePassiveMountEffects( 16916 root, 16917 parentFiber, 16918 committedLanes, 16919 committedTransitions 16920 ) { 16921 if (parentFiber.subtreeFlags & 10256) 16922 for (parentFiber = parentFiber.child; null !== parentFiber; ) 16923 commitPassiveMountOnFiber( 16924 root, 16925 parentFiber, 16926 committedLanes, 16927 committedTransitions 16928 ), 16929 (parentFiber = parentFiber.sibling); 16930 } 16931 function commitPassiveMountOnFiber( 16932 finishedRoot, 16933 finishedWork, 16934 committedLanes, 16935 committedTransitions 16936 ) { 16937 var flags = finishedWork.flags; 16938 switch (finishedWork.tag) { 16939 case 0: 16940 case 11: 16941 case 15: 16942 recursivelyTraversePassiveMountEffects( 16943 finishedRoot, 16944 finishedWork, 16945 committedLanes, 16946 committedTransitions 16947 ); 16948 flags & 2048 && commitHookEffectListMount(9, finishedWork); 16949 break; 16950 case 1: 16951 recursivelyTraversePassiveMountEffects( 16952 finishedRoot, 16953 finishedWork, 16954 committedLanes, 16955 committedTransitions 16956 ); 16957 break; 16958 case 3: 16959 recursivelyTraversePassiveMountEffects( 16960 finishedRoot, 16961 finishedWork, 16962 committedLanes, 16963 committedTransitions 16964 ); 16965 flags & 2048 && 16966 ((finishedRoot = null), 16967 null !== finishedWork.alternate && 16968 (finishedRoot = finishedWork.alternate.memoizedState.cache), 16969 (finishedWork = finishedWork.memoizedState.cache), 16970 finishedWork !== finishedRoot && 16971 (finishedWork.refCount++, 16972 null != finishedRoot && releaseCache(finishedRoot))); 16973 break; 16974 case 12: 16975 if (flags & 2048) { 16976 recursivelyTraversePassiveMountEffects( 16977 finishedRoot, 16978 finishedWork, 16979 committedLanes, 16980 committedTransitions 16981 ); 16982 finishedRoot = finishedWork.stateNode; 16983 try { 16984 var _finishedWork$memoize2 = finishedWork.memoizedProps, 16985 id = _finishedWork$memoize2.id, 16986 onPostCommit = _finishedWork$memoize2.onPostCommit; 16987 "function" === typeof onPostCommit && 16988 onPostCommit( 16989 id, 16990 null === finishedWork.alternate ? "mount" : "update", 16991 finishedRoot.passiveEffectDuration, 16992 -0 16993 ); 16994 } catch (error) { 16995 captureCommitPhaseError(finishedWork, finishedWork.return, error); 16996 } 16997 } else 16998 recursivelyTraversePassiveMountEffects( 16999 finishedRoot, 17000 finishedWork, 17001 committedLanes, 17002 committedTransitions 17003 ); 17004 break; 17005 case 31: 17006 recursivelyTraversePassiveMountEffects( 17007 finishedRoot, 17008 finishedWork, 17009 committedLanes, 17010 committedTransitions 17011 ); 17012 break; 17013 case 13: 17014 recursivelyTraversePassiveMountEffects( 17015 finishedRoot, 17016 finishedWork, 17017 committedLanes, 17018 committedTransitions 17019 ); 17020 break; 17021 case 23: 17022 break; 17023 case 22: 17024 _finishedWork$memoize2 = finishedWork.stateNode; 17025 id = finishedWork.alternate; 17026 null !== finishedWork.memoizedState 17027 ? _finishedWork$memoize2._visibility & 2 17028 ? recursivelyTraversePassiveMountEffects( 17029 finishedRoot, 17030 finishedWork, 17031 committedLanes, 17032 committedTransitions 17033 ) 17034 : recursivelyTraverseAtomicPassiveEffects(finishedRoot, finishedWork) 17035 : _finishedWork$memoize2._visibility & 2 17036 ? recursivelyTraversePassiveMountEffects( 17037 finishedRoot, 17038 finishedWork, 17039 committedLanes, 17040 committedTransitions 17041 ) 17042 : ((_finishedWork$memoize2._visibility |= 2), 17043 recursivelyTraverseReconnectPassiveEffects( 17044 finishedRoot, 17045 finishedWork, 17046 committedLanes, 17047 committedTransitions, 17048 0 !== (finishedWork.subtreeFlags & 10256) || false 17049 )); 17050 flags & 2048 && commitOffscreenPassiveMountEffects(id, finishedWork); 17051 break; 17052 case 24: 17053 recursivelyTraversePassiveMountEffects( 17054 finishedRoot, 17055 finishedWork, 17056 committedLanes, 17057 committedTransitions 17058 ); 17059 flags & 2048 && 17060 commitCachePassiveMountEffect(finishedWork.alternate, finishedWork); 17061 break; 17062 default: 17063 recursivelyTraversePassiveMountEffects( 17064 finishedRoot, 17065 finishedWork, 17066 committedLanes, 17067 committedTransitions 17068 ); 17069 } 17070 } 17071 function recursivelyTraverseReconnectPassiveEffects( 17072 finishedRoot$jscomp$0, 17073 parentFiber, 17074 committedLanes$jscomp$0, 17075 committedTransitions$jscomp$0, 17076 includeWorkInProgressEffects 17077 ) { 17078 includeWorkInProgressEffects = 17079 includeWorkInProgressEffects && 17080 (0 !== (parentFiber.subtreeFlags & 10256) || false); 17081 for (parentFiber = parentFiber.child; null !== parentFiber; ) { 17082 var finishedRoot = finishedRoot$jscomp$0, 17083 finishedWork = parentFiber, 17084 committedLanes = committedLanes$jscomp$0, 17085 committedTransitions = committedTransitions$jscomp$0, 17086 flags = finishedWork.flags; 17087 switch (finishedWork.tag) { 17088 case 0: 17089 case 11: 17090 case 15: 17091 recursivelyTraverseReconnectPassiveEffects( 17092 finishedRoot, 17093 finishedWork, 17094 committedLanes, 17095 committedTransitions, 17096 includeWorkInProgressEffects 17097 ); 17098 commitHookEffectListMount(8, finishedWork); 17099 break; 17100 case 23: 17101 break; 17102 case 22: 17103 var instance = finishedWork.stateNode; 17104 null !== finishedWork.memoizedState 17105 ? instance._visibility & 2 17106 ? recursivelyTraverseReconnectPassiveEffects( 17107 finishedRoot, 17108 finishedWork, 17109 committedLanes, 17110 committedTransitions, 17111 includeWorkInProgressEffects 17112 ) 17113 : recursivelyTraverseAtomicPassiveEffects( 17114 finishedRoot, 17115 finishedWork 17116 ) 17117 : ((instance._visibility |= 2), 17118 recursivelyTraverseReconnectPassiveEffects( 17119 finishedRoot, 17120 finishedWork, 17121 committedLanes, 17122 committedTransitions, 17123 includeWorkInProgressEffects 17124 )); 17125 includeWorkInProgressEffects && 17126 flags & 2048 && 17127 commitOffscreenPassiveMountEffects( 17128 finishedWork.alternate, 17129 finishedWork 17130 ); 17131 break; 17132 case 24: 17133 recursivelyTraverseReconnectPassiveEffects( 17134 finishedRoot, 17135 finishedWork, 17136 committedLanes, 17137 committedTransitions, 17138 includeWorkInProgressEffects 17139 ); 17140 includeWorkInProgressEffects && 17141 flags & 2048 && 17142 commitCachePassiveMountEffect(finishedWork.alternate, finishedWork); 17143 break; 17144 default: 17145 recursivelyTraverseReconnectPassiveEffects( 17146 finishedRoot, 17147 finishedWork, 17148 committedLanes, 17149 committedTransitions, 17150 includeWorkInProgressEffects 17151 ); 17152 } 17153 parentFiber = parentFiber.sibling; 17154 } 17155 } 17156 function recursivelyTraverseAtomicPassiveEffects( 17157 finishedRoot$jscomp$0, 17158 parentFiber 17159 ) { 17160 if (parentFiber.subtreeFlags & 10256) 17161 for (parentFiber = parentFiber.child; null !== parentFiber; ) { 17162 var finishedRoot = finishedRoot$jscomp$0, 17163 finishedWork = parentFiber, 17164 flags = finishedWork.flags; 17165 switch (finishedWork.tag) { 17166 case 22: 17167 recursivelyTraverseAtomicPassiveEffects(finishedRoot, finishedWork); 17168 flags & 2048 && 17169 commitOffscreenPassiveMountEffects( 17170 finishedWork.alternate, 17171 finishedWork 17172 ); 17173 break; 17174 case 24: 17175 recursivelyTraverseAtomicPassiveEffects(finishedRoot, finishedWork); 17176 flags & 2048 && 17177 commitCachePassiveMountEffect(finishedWork.alternate, finishedWork); 17178 break; 17179 default: 17180 recursivelyTraverseAtomicPassiveEffects(finishedRoot, finishedWork); 17181 } 17182 parentFiber = parentFiber.sibling; 17183 } 17184 } 17185 var suspenseyCommitFlag = 8192; 17186 function recursivelyAccumulateSuspenseyCommit( 17187 parentFiber, 17188 committedLanes, 17189 suspendedState 17190 ) { 17191 if (parentFiber.subtreeFlags & suspenseyCommitFlag) 17192 for (parentFiber = parentFiber.child; null !== parentFiber; ) 17193 accumulateSuspenseyCommitOnFiber( 17194 parentFiber, 17195 committedLanes, 17196 suspendedState 17197 ), 17198 (parentFiber = parentFiber.sibling); 17199 } 17200 function accumulateSuspenseyCommitOnFiber( 17201 fiber, 17202 committedLanes, 17203 suspendedState 17204 ) { 17205 switch (fiber.tag) { 17206 case 26: 17207 recursivelyAccumulateSuspenseyCommit( 17208 fiber, 17209 committedLanes, 17210 suspendedState 17211 ); 17212 fiber.flags & suspenseyCommitFlag && 17213 null !== fiber.memoizedState && 17214 suspendResource( 17215 suspendedState, 17216 currentHoistableRoot, 17217 fiber.memoizedState, 17218 fiber.memoizedProps 17219 ); 17220 break; 17221 case 5: 17222 recursivelyAccumulateSuspenseyCommit( 17223 fiber, 17224 committedLanes, 17225 suspendedState 17226 ); 17227 break; 17228 case 3: 17229 case 4: 17230 var previousHoistableRoot = currentHoistableRoot; 17231 currentHoistableRoot = getHoistableRoot(fiber.stateNode.containerInfo); 17232 recursivelyAccumulateSuspenseyCommit( 17233 fiber, 17234 committedLanes, 17235 suspendedState 17236 ); 17237 currentHoistableRoot = previousHoistableRoot; 17238 break; 17239 case 22: 17240 null === fiber.memoizedState && 17241 ((previousHoistableRoot = fiber.alternate), 17242 null !== previousHoistableRoot && 17243 null !== previousHoistableRoot.memoizedState 17244 ? ((previousHoistableRoot = suspenseyCommitFlag), 17245 (suspenseyCommitFlag = 16777216), 17246 recursivelyAccumulateSuspenseyCommit( 17247 fiber, 17248 committedLanes, 17249 suspendedState 17250 ), 17251 (suspenseyCommitFlag = previousHoistableRoot)) 17252 : recursivelyAccumulateSuspenseyCommit( 17253 fiber, 17254 committedLanes, 17255 suspendedState 17256 )); 17257 break; 17258 default: 17259 recursivelyAccumulateSuspenseyCommit( 17260 fiber, 17261 committedLanes, 17262 suspendedState 17263 ); 17264 } 17265 } 17266 function detachAlternateSiblings(parentFiber) { 17267 var previousFiber = parentFiber.alternate; 17268 if ( 17269 null !== previousFiber && 17270 ((parentFiber = previousFiber.child), null !== parentFiber) 17271 ) { 17272 previousFiber.child = null; 17273 do 17274 (previousFiber = parentFiber.sibling), 17275 (parentFiber.sibling = null), 17276 (parentFiber = previousFiber); 17277 while (null !== parentFiber); 17278 } 17279 } 17280 function recursivelyTraversePassiveUnmountEffects(parentFiber) { 17281 var deletions = parentFiber.deletions; 17282 if (0 !== (parentFiber.flags & 16)) { 17283 if (null !== deletions) 17284 for (var i = 0; i < deletions.length; i++) { 17285 var childToDelete = deletions[i]; 17286 nextEffect = childToDelete; 17287 commitPassiveUnmountEffectsInsideOfDeletedTree_begin( 17288 childToDelete, 17289 parentFiber 17290 ); 17291 } 17292 detachAlternateSiblings(parentFiber); 17293 } 17294 if (parentFiber.subtreeFlags & 10256) 17295 for (parentFiber = parentFiber.child; null !== parentFiber; ) 17296 commitPassiveUnmountOnFiber(parentFiber), 17297 (parentFiber = parentFiber.sibling); 17298 } 17299 function commitPassiveUnmountOnFiber(finishedWork) { 17300 switch (finishedWork.tag) { 17301 case 0: 17302 case 11: 17303 case 15: 17304 recursivelyTraversePassiveUnmountEffects(finishedWork); 17305 finishedWork.flags & 2048 && 17306 commitHookEffectListUnmount(9, finishedWork, finishedWork.return); 17307 break; 17308 case 3: 17309 recursivelyTraversePassiveUnmountEffects(finishedWork); 17310 break; 17311 case 12: 17312 recursivelyTraversePassiveUnmountEffects(finishedWork); 17313 break; 17314 case 22: 17315 var instance = finishedWork.stateNode; 17316 null !== finishedWork.memoizedState && 17317 instance._visibility & 2 && 17318 (null === finishedWork.return || 13 !== finishedWork.return.tag) 17319 ? ((instance._visibility &= -3), 17320 recursivelyTraverseDisconnectPassiveEffects(finishedWork)) 17321 : recursivelyTraversePassiveUnmountEffects(finishedWork); 17322 break; 17323 default: 17324 recursivelyTraversePassiveUnmountEffects(finishedWork); 17325 } 17326 } 17327 function recursivelyTraverseDisconnectPassiveEffects(parentFiber) { 17328 var deletions = parentFiber.deletions; 17329 if (0 !== (parentFiber.flags & 16)) { 17330 if (null !== deletions) 17331 for (var i = 0; i < deletions.length; i++) { 17332 var childToDelete = deletions[i]; 17333 nextEffect = childToDelete; 17334 commitPassiveUnmountEffectsInsideOfDeletedTree_begin( 17335 childToDelete, 17336 parentFiber 17337 ); 17338 } 17339 detachAlternateSiblings(parentFiber); 17340 } 17341 for (parentFiber = parentFiber.child; null !== parentFiber; ) { 17342 deletions = parentFiber; 17343 switch (deletions.tag) { 17344 case 0: 17345 case 11: 17346 case 15: 17347 commitHookEffectListUnmount(8, deletions, deletions.return); 17348 recursivelyTraverseDisconnectPassiveEffects(deletions); 17349 break; 17350 case 22: 17351 i = deletions.stateNode; 17352 i._visibility & 2 && 17353 ((i._visibility &= -3), 17354 recursivelyTraverseDisconnectPassiveEffects(deletions)); 17355 break; 17356 default: 17357 recursivelyTraverseDisconnectPassiveEffects(deletions); 17358 } 17359 parentFiber = parentFiber.sibling; 17360 } 17361 } 17362 function commitPassiveUnmountEffectsInsideOfDeletedTree_begin( 17363 deletedSubtreeRoot, 17364 nearestMountedAncestor 17365 ) { 17366 for (; null !== nextEffect; ) { 17367 var fiber = nextEffect; 17368 switch (fiber.tag) { 17369 case 0: 17370 case 11: 17371 case 15: 17372 commitHookEffectListUnmount(8, fiber, nearestMountedAncestor); 17373 break; 17374 case 23: 17375 case 22: 17376 if ( 17377 null !== fiber.memoizedState && 17378 null !== fiber.memoizedState.cachePool 17379 ) { 17380 var cache = fiber.memoizedState.cachePool.pool; 17381 null != cache && cache.refCount++; 17382 } 17383 break; 17384 case 24: 17385 releaseCache(fiber.memoizedState.cache); 17386 } 17387 cache = fiber.child; 17388 if (null !== cache) (cache.return = fiber), (nextEffect = cache); 17389 else 17390 a: for (fiber = deletedSubtreeRoot; null !== nextEffect; ) { 17391 cache = nextEffect; 17392 var sibling = cache.sibling, 17393 returnFiber = cache.return; 17394 detachFiberAfterEffects(cache); 17395 if (cache === fiber) { 17396 nextEffect = null; 17397 break a; 17398 } 17399 if (null !== sibling) { 17400 sibling.return = returnFiber; 17401 nextEffect = sibling; 17402 break a; 17403 } 17404 nextEffect = returnFiber; 17405 } 17406 } 17407 } 17408 var DefaultAsyncDispatcher = { 17409 getCacheForType: function (resourceType) { 17410 var cache = readContext(CacheContext), 17411 cacheForType = cache.data.get(resourceType); 17412 void 0 === cacheForType && 17413 ((cacheForType = resourceType()), 17414 cache.data.set(resourceType, cacheForType)); 17415 return cacheForType; 17416 }, 17417 cacheSignal: function () { 17418 return readContext(CacheContext).controller.signal; 17419 } 17420 }, 17421 PossiblyWeakMap = "function" === typeof WeakMap ? WeakMap : Map, 17422 executionContext = 0, 17423 workInProgressRoot = null, 17424 workInProgress = null, 17425 workInProgressRootRenderLanes = 0, 17426 workInProgressSuspendedReason = 0, 17427 workInProgressThrownValue = null, 17428 workInProgressRootDidSkipSuspendedSiblings = false, 17429 workInProgressRootIsPrerendering = false, 17430 workInProgressRootDidAttachPingListener = false, 17431 entangledRenderLanes = 0, 17432 workInProgressRootExitStatus = 0, 17433 workInProgressRootSkippedLanes = 0, 17434 workInProgressRootInterleavedUpdatedLanes = 0, 17435 workInProgressRootPingedLanes = 0, 17436 workInProgressDeferredLane = 0, 17437 workInProgressSuspendedRetryLanes = 0, 17438 workInProgressRootConcurrentErrors = null, 17439 workInProgressRootRecoverableErrors = null, 17440 workInProgressRootDidIncludeRecursiveRenderUpdate = false, 17441 globalMostRecentFallbackTime = 0, 17442 globalMostRecentTransitionTime = 0, 17443 workInProgressRootRenderTargetTime = Infinity, 17444 workInProgressTransitions = null, 17445 legacyErrorBoundariesThatAlreadyFailed = null, 17446 pendingEffectsStatus = 0, 17447 pendingEffectsRoot = null, 17448 pendingFinishedWork = null, 17449 pendingEffectsLanes = 0, 17450 pendingEffectsRemainingLanes = 0, 17451 pendingPassiveTransitions = null, 17452 pendingRecoverableErrors = null, 17453 nestedUpdateCount = 0, 17454 rootWithNestedUpdates = null; 17455 function requestUpdateLane() { 17456 return 0 !== (executionContext & 2) && 0 !== workInProgressRootRenderLanes 17457 ? workInProgressRootRenderLanes & -workInProgressRootRenderLanes 17458 : null !== ReactSharedInternals.T 17459 ? requestTransitionLane() 17460 : resolveUpdatePriority(); 17461 } 17462 function requestDeferredLane() { 17463 if (0 === workInProgressDeferredLane) 17464 if (0 === (workInProgressRootRenderLanes & 536870912) || isHydrating) { 17465 var lane = nextTransitionDeferredLane; 17466 nextTransitionDeferredLane <<= 1; 17467 0 === (nextTransitionDeferredLane & 3932160) && 17468 (nextTransitionDeferredLane = 262144); 17469 workInProgressDeferredLane = lane; 17470 } else workInProgressDeferredLane = 536870912; 17471 lane = suspenseHandlerStackCursor.current; 17472 null !== lane && (lane.flags |= 32); 17473 return workInProgressDeferredLane; 17474 } 17475 function scheduleUpdateOnFiber(root, fiber, lane) { 17476 if ( 17477 (root === workInProgressRoot && 17478 (2 === workInProgressSuspendedReason || 17479 9 === workInProgressSuspendedReason)) || 17480 null !== root.cancelPendingCommit 17481 ) 17482 prepareFreshStack(root, 0), 17483 markRootSuspended( 17484 root, 17485 workInProgressRootRenderLanes, 17486 workInProgressDeferredLane, 17487 false 17488 ); 17489 markRootUpdated$1(root, lane); 17490 if (0 === (executionContext & 2) || root !== workInProgressRoot) 17491 root === workInProgressRoot && 17492 (0 === (executionContext & 2) && 17493 (workInProgressRootInterleavedUpdatedLanes |= lane), 17494 4 === workInProgressRootExitStatus && 17495 markRootSuspended( 17496 root, 17497 workInProgressRootRenderLanes, 17498 workInProgressDeferredLane, 17499 false 17500 )), 17501 ensureRootIsScheduled(root); 17502 } 17503 function performWorkOnRoot(root$jscomp$0, lanes, forceSync) { 17504 if (0 !== (executionContext & 6)) throw Error(formatProdErrorMessage(327)); 17505 var shouldTimeSlice = 17506 (!forceSync && 17507 0 === (lanes & 127) && 17508 0 === (lanes & root$jscomp$0.expiredLanes)) || 17509 checkIfRootIsPrerendering(root$jscomp$0, lanes), 17510 exitStatus = shouldTimeSlice 17511 ? renderRootConcurrent(root$jscomp$0, lanes) 17512 : renderRootSync(root$jscomp$0, lanes, true), 17513 renderWasConcurrent = shouldTimeSlice; 17514 do { 17515 if (0 === exitStatus) { 17516 workInProgressRootIsPrerendering && 17517 !shouldTimeSlice && 17518 markRootSuspended(root$jscomp$0, lanes, 0, false); 17519 break; 17520 } else { 17521 forceSync = root$jscomp$0.current.alternate; 17522 if ( 17523 renderWasConcurrent && 17524 !isRenderConsistentWithExternalStores(forceSync) 17525 ) { 17526 exitStatus = renderRootSync(root$jscomp$0, lanes, false); 17527 renderWasConcurrent = false; 17528 continue; 17529 } 17530 if (2 === exitStatus) { 17531 renderWasConcurrent = lanes; 17532 if (root$jscomp$0.errorRecoveryDisabledLanes & renderWasConcurrent) 17533 var JSCompiler_inline_result = 0; 17534 else 17535 (JSCompiler_inline_result = root$jscomp$0.pendingLanes & -536870913), 17536 (JSCompiler_inline_result = 17537 0 !== JSCompiler_inline_result 17538 ? JSCompiler_inline_result 17539 : JSCompiler_inline_result & 536870912 17540 ? 536870912 17541 : 0); 17542 if (0 !== JSCompiler_inline_result) { 17543 lanes = JSCompiler_inline_result; 17544 a: { 17545 var root = root$jscomp$0; 17546 exitStatus = workInProgressRootConcurrentErrors; 17547 var wasRootDehydrated = root.current.memoizedState.isDehydrated; 17548 wasRootDehydrated && 17549 (prepareFreshStack(root, JSCompiler_inline_result).flags |= 256); 17550 JSCompiler_inline_result = renderRootSync( 17551 root, 17552 JSCompiler_inline_result, 17553 false 17554 ); 17555 if (2 !== JSCompiler_inline_result) { 17556 if ( 17557 workInProgressRootDidAttachPingListener && 17558 !wasRootDehydrated 17559 ) { 17560 root.errorRecoveryDisabledLanes |= renderWasConcurrent; 17561 workInProgressRootInterleavedUpdatedLanes |= 17562 renderWasConcurrent; 17563 exitStatus = 4; 17564 break a; 17565 } 17566 renderWasConcurrent = workInProgressRootRecoverableErrors; 17567 workInProgressRootRecoverableErrors = exitStatus; 17568 null !== renderWasConcurrent && 17569 (null === workInProgressRootRecoverableErrors 17570 ? (workInProgressRootRecoverableErrors = renderWasConcurrent) 17571 : workInProgressRootRecoverableErrors.push.apply( 17572 workInProgressRootRecoverableErrors, 17573 renderWasConcurrent 17574 )); 17575 } 17576 exitStatus = JSCompiler_inline_result; 17577 } 17578 renderWasConcurrent = false; 17579 if (2 !== exitStatus) continue; 17580 } 17581 } 17582 if (1 === exitStatus) { 17583 prepareFreshStack(root$jscomp$0, 0); 17584 markRootSuspended(root$jscomp$0, lanes, 0, true); 17585 break; 17586 } 17587 a: { 17588 shouldTimeSlice = root$jscomp$0; 17589 renderWasConcurrent = exitStatus; 17590 switch (renderWasConcurrent) { 17591 case 0: 17592 case 1: 17593 throw Error(formatProdErrorMessage(345)); 17594 case 4: 17595 if ((lanes & 4194048) !== lanes) break; 17596 case 6: 17597 markRootSuspended( 17598 shouldTimeSlice, 17599 lanes, 17600 workInProgressDeferredLane, 17601 !workInProgressRootDidSkipSuspendedSiblings 17602 ); 17603 break a; 17604 case 2: 17605 workInProgressRootRecoverableErrors = null; 17606 break; 17607 case 3: 17608 case 5: 17609 break; 17610 default: 17611 throw Error(formatProdErrorMessage(329)); 17612 } 17613 if ( 17614 (lanes & 62914560) === lanes && 17615 ((exitStatus = globalMostRecentFallbackTime + 300 - now()), 17616 10 < exitStatus) 17617 ) { 17618 markRootSuspended( 17619 shouldTimeSlice, 17620 lanes, 17621 workInProgressDeferredLane, 17622 !workInProgressRootDidSkipSuspendedSiblings 17623 ); 17624 if (0 !== getNextLanes(shouldTimeSlice, 0, true)) break a; 17625 pendingEffectsLanes = lanes; 17626 shouldTimeSlice.timeoutHandle = scheduleTimeout( 17627 commitRootWhenReady.bind( 17628 null, 17629 shouldTimeSlice, 17630 forceSync, 17631 workInProgressRootRecoverableErrors, 17632 workInProgressTransitions, 17633 workInProgressRootDidIncludeRecursiveRenderUpdate, 17634 lanes, 17635 workInProgressDeferredLane, 17636 workInProgressRootInterleavedUpdatedLanes, 17637 workInProgressSuspendedRetryLanes, 17638 workInProgressRootDidSkipSuspendedSiblings, 17639 renderWasConcurrent, 17640 "Throttled", 17641 -0, 17642 0 17643 ), 17644 exitStatus 17645 ); 17646 break a; 17647 } 17648 commitRootWhenReady( 17649 shouldTimeSlice, 17650 forceSync, 17651 workInProgressRootRecoverableErrors, 17652 workInProgressTransitions, 17653 workInProgressRootDidIncludeRecursiveRenderUpdate, 17654 lanes, 17655 workInProgressDeferredLane, 17656 workInProgressRootInterleavedUpdatedLanes, 17657 workInProgressSuspendedRetryLanes, 17658 workInProgressRootDidSkipSuspendedSiblings, 17659 renderWasConcurrent, 17660 null, 17661 -0, 17662 0 17663 ); 17664 } 17665 } 17666 break; 17667 } while (1); 17668 ensureRootIsScheduled(root$jscomp$0); 17669 } 17670 function commitRootWhenReady( 17671 root, 17672 finishedWork, 17673 recoverableErrors, 17674 transitions, 17675 didIncludeRenderPhaseUpdate, 17676 lanes, 17677 spawnedLane, 17678 updatedLanes, 17679 suspendedRetryLanes, 17680 didSkipSuspendedSiblings, 17681 exitStatus, 17682 suspendedCommitReason, 17683 completedRenderStartTime, 17684 completedRenderEndTime 17685 ) { 17686 root.timeoutHandle = -1; 17687 suspendedCommitReason = finishedWork.subtreeFlags; 17688 if ( 17689 suspendedCommitReason & 8192 || 17690 16785408 === (suspendedCommitReason & 16785408) 17691 ) { 17692 suspendedCommitReason = { 17693 stylesheets: null, 17694 count: 0, 17695 imgCount: 0, 17696 imgBytes: 0, 17697 suspenseyImages: [], 17698 waitingForImages: true, 17699 waitingForViewTransition: false, 17700 unsuspend: noop$1 17701 }; 17702 accumulateSuspenseyCommitOnFiber( 17703 finishedWork, 17704 lanes, 17705 suspendedCommitReason 17706 ); 17707 var timeoutOffset = 17708 (lanes & 62914560) === lanes 17709 ? globalMostRecentFallbackTime - now() 17710 : (lanes & 4194048) === lanes 17711 ? globalMostRecentTransitionTime - now() 17712 : 0; 17713 timeoutOffset = waitForCommitToBeReady( 17714 suspendedCommitReason, 17715 timeoutOffset 17716 ); 17717 if (null !== timeoutOffset) { 17718 pendingEffectsLanes = lanes; 17719 root.cancelPendingCommit = timeoutOffset( 17720 commitRoot.bind( 17721 null, 17722 root, 17723 finishedWork, 17724 lanes, 17725 recoverableErrors, 17726 transitions, 17727 didIncludeRenderPhaseUpdate, 17728 spawnedLane, 17729 updatedLanes, 17730 suspendedRetryLanes, 17731 exitStatus, 17732 suspendedCommitReason, 17733 null, 17734 completedRenderStartTime, 17735 completedRenderEndTime 17736 ) 17737 ); 17738 markRootSuspended(root, lanes, spawnedLane, !didSkipSuspendedSiblings); 17739 return; 17740 } 17741 } 17742 commitRoot( 17743 root, 17744 finishedWork, 17745 lanes, 17746 recoverableErrors, 17747 transitions, 17748 didIncludeRenderPhaseUpdate, 17749 spawnedLane, 17750 updatedLanes, 17751 suspendedRetryLanes 17752 ); 17753 } 17754 function isRenderConsistentWithExternalStores(finishedWork) { 17755 for (var node = finishedWork; ; ) { 17756 var tag = node.tag; 17757 if ( 17758 (0 === tag || 11 === tag || 15 === tag) && 17759 node.flags & 16384 && 17760 ((tag = node.updateQueue), 17761 null !== tag && ((tag = tag.stores), null !== tag)) 17762 ) 17763 for (var i = 0; i < tag.length; i++) { 17764 var check = tag[i], 17765 getSnapshot = check.getSnapshot; 17766 check = check.value; 17767 try { 17768 if (!objectIs(getSnapshot(), check)) return
17768!1
vendor: 7,110 bytes, lines 17768-17965
17768; 17769 } catch (error) { 17770 return false; 17771 } 17772 } 17773 tag = node.child; 17774 if (node.subtreeFlags & 16384 && null !== tag) 17775 (tag.return = node), (node = tag); 17776 else { 17777 if (node === finishedWork) break; 17778 for (; null === node.sibling; ) { 17779 if (null === node.return || node.return === finishedWork) return true; 17780 node = node.return; 17781 } 17782 node.sibling.return = node.return; 17783 node = node.sibling; 17784 } 17785 } 17786 return true; 17787 } 17788 function markRootSuspended( 17789 root, 17790 suspendedLanes, 17791 spawnedLane, 17792 didAttemptEntireTree 17793 ) { 17794 suspendedLanes &= ~workInProgressRootPingedLanes; 17795 suspendedLanes &= ~workInProgressRootInterleavedUpdatedLanes; 17796 root.suspendedLanes |= suspendedLanes; 17797 root.pingedLanes &= ~suspendedLanes; 17798 didAttemptEntireTree && (root.warmLanes |= suspendedLanes); 17799 didAttemptEntireTree = root.expirationTimes; 17800 for (var lanes = suspendedLanes; 0 < lanes; ) { 17801 var index$6 = 31 - clz32(lanes), 17802 lane = 1 << index$6; 17803 didAttemptEntireTree[index$6] = -1; 17804 lanes &= ~lane; 17805 } 17806 0 !== spawnedLane && 17807 markSpawnedDeferredLane(root, spawnedLane, suspendedLanes); 17808 } 17809 function flushSyncWork$1() { 17810 return 0 === (executionContext & 6) 17811 ? (flushSyncWorkAcrossRoots_impl(0), false) 17812 : true; 17813 } 17814 function resetWorkInProgressStack() { 17815 if (null !== workInProgress) { 17816 if (0 === workInProgressSuspendedReason) 17817 var interruptedWork = workInProgress.return; 17818 else 17819 (interruptedWork = workInProgress), 17820 (lastContextDependency = currentlyRenderingFiber$1 = null), 17821 resetHooksOnUnwind(interruptedWork), 17822 (thenableState$1 = null), 17823 (thenableIndexCounter$1 = 0), 17824 (interruptedWork = workInProgress); 17825 for (; null !== interruptedWork; ) 17826 unwindInterruptedWork(interruptedWork.alternate, interruptedWork), 17827 (interruptedWork = interruptedWork.return); 17828 workInProgress = null; 17829 } 17830 } 17831 function prepareFreshStack(root, lanes) { 17832 var timeoutHandle = root.timeoutHandle; 17833 -1 !== timeoutHandle && 17834 ((root.timeoutHandle = -1), cancelTimeout(timeoutHandle)); 17835 timeoutHandle = root.cancelPendingCommit; 17836 null !== timeoutHandle && 17837 ((root.cancelPendingCommit = null), timeoutHandle()); 17838 pendingEffectsLanes = 0; 17839 resetWorkInProgressStack(); 17840 workInProgressRoot = root; 17841 workInProgress = timeoutHandle = createWorkInProgress(root.current, null); 17842 workInProgressRootRenderLanes = lanes; 17843 workInProgressSuspendedReason = 0; 17844 workInProgressThrownValue = null; 17845 workInProgressRootDidSkipSuspendedSiblings = false; 17846 workInProgressRootIsPrerendering = checkIfRootIsPrerendering(root, lanes); 17847 workInProgressRootDidAttachPingListener = false; 17848 workInProgressSuspendedRetryLanes = 17849 workInProgressDeferredLane = 17850 workInProgressRootPingedLanes = 17851 workInProgressRootInterleavedUpdatedLanes = 17852 workInProgressRootSkippedLanes = 17853 workInProgressRootExitStatus = 17854 0; 17855 workInProgressRootRecoverableErrors = workInProgressRootConcurrentErrors = 17856 null; 17857 workInProgressRootDidIncludeRecursiveRenderUpdate = false; 17858 0 !== (lanes & 8) && (lanes |= lanes & 32); 17859 var allEntangledLanes = root.entangledLanes; 17860 if (0 !== allEntangledLanes) 17861 for ( 17862 root = root.entanglements, allEntangledLanes &= lanes; 17863 0 < allEntangledLanes; 17864 17865 ) { 17866 var index$4 = 31 - clz32(allEntangledLanes), 17867 lane = 1 << index$4; 17868 lanes |= root[index$4]; 17869 allEntangledLanes &= ~lane; 17870 } 17871 entangledRenderLanes = lanes; 17872 finishQueueingConcurrentUpdates(); 17873 return timeoutHandle; 17874 } 17875 function handleThrow(root, thrownValue) { 17876 currentlyRenderingFiber = null; 17877 ReactSharedInternals.H = ContextOnlyDispatcher; 17878 thrownValue === SuspenseException || thrownValue === SuspenseActionException 17879 ? ((thrownValue = getSuspendedThenable()), 17880 (workInProgressSuspendedReason = 3)) 17881 : thrownValue === SuspenseyCommitException 17882 ? ((thrownValue = getSuspendedThenable()), 17883 (workInProgressSuspendedReason = 4)) 17884 : (workInProgressSuspendedReason = 17885 thrownValue === SelectiveHydrationException 17886 ? 8 17887 : null !== thrownValue && 17888 "object" === typeof thrownValue && 17889 "function" === typeof thrownValue.then 17890 ? 6 17891 : 1); 17892 workInProgressThrownValue = thrownValue; 17893 null === workInProgress && 17894 ((workInProgressRootExitStatus = 1), 17895 logUncaughtError( 17896 root, 17897 createCapturedValueAtFiber(thrownValue, root.current) 17898 )); 17899 } 17900 function shouldRemainOnPreviousScreen() { 17901 var handler = suspenseHandlerStackCursor.current; 17902 return null === handler 17903 ? true 17904 : (workInProgressRootRenderLanes & 4194048) === 17905 workInProgressRootRenderLanes 17906 ? null === shellBoundary 17907 ? true 17908 : false 17909 : (workInProgressRootRenderLanes & 62914560) === 17910 workInProgressRootRenderLanes || 17911 0 !== (workInProgressRootRenderLanes & 536870912) 17912 ? handler === shellBoundary 17913 : false; 17914 } 17915 function pushDispatcher() { 17916 var prevDispatcher = ReactSharedInternals.H; 17917 ReactSharedInternals.H = ContextOnlyDispatcher; 17918 return null === prevDispatcher ? ContextOnlyDispatcher : prevDispatcher; 17919 } 17920 function pushAsyncDispatcher() { 17921 var prevAsyncDispatcher = ReactSharedInternals.A; 17922 ReactSharedInternals.A = DefaultAsyncDispatcher; 17923 return prevAsyncDispatcher; 17924 } 17925 function renderDidSuspendDelayIfPossible() { 17926 workInProgressRootExitStatus = 4; 17927 workInProgressRootDidSkipSuspendedSiblings || 17928 ((workInProgressRootRenderLanes & 4194048) !== 17929 workInProgressRootRenderLanes && 17930 null !== suspenseHandlerStackCursor.current) || 17931 (workInProgressRootIsPrerendering = true); 17932 (0 === (workInProgressRootSkippedLanes & 134217727) && 17933 0 === (workInProgressRootInterleavedUpdatedLanes & 134217727)) || 17934 null === workInProgressRoot || 17935 markRootSuspended( 17936 workInProgressRoot, 17937 workInProgressRootRenderLanes, 17938 workInProgressDeferredLane, 17939 false 17940 ); 17941 } 17942 function renderRootSync(root, lanes, shouldYieldForPrerendering) { 17943 var prevExecutionContext = executionContext; 17944 executionContext |= 2; 17945 var prevDispatcher = pushDispatcher(), 17946 prevAsyncDispatcher = pushAsyncDispatcher(); 17947 if (workInProgressRoot !== root || workInProgressRootRenderLanes !== lanes) 17948 (workInProgressTransitions = null), prepareFreshStack(root, lanes); 17949 lanes = false; 17950 var exitStatus = workInProgressRootExitStatus; 17951 a: do 17952 try { 17953 if (0 !== workInProgressSuspendedReason && null !== workInProgress) { 17954 var unitOfWork = workInProgress, 17955 thrownValue = workInProgressThrownValue; 17956 switch (workInProgressSuspendedReason) { 17957 case 8: 17958 resetWorkInProgressStack(); 17959 exitStatus = 6; 17960 break a; 17961 case 3: 17962 case 2: 17963 case 9: 17964 case 6: 17965 null === suspenseHandlerStackCursor.current && (lanes =
17965!0
vendor: 10,664 bytes, lines 17965-18291
17965); 17966 var reason = workInProgressSuspendedReason; 17967 workInProgressSuspendedReason = 0; 17968 workInProgressThrownValue = null; 17969 throwAndUnwindWorkLoop(root, unitOfWork, thrownValue, reason); 17970 if ( 17971 shouldYieldForPrerendering && 17972 workInProgressRootIsPrerendering 17973 ) { 17974 exitStatus = 0; 17975 break a; 17976 } 17977 break; 17978 default: 17979 (reason = workInProgressSuspendedReason), 17980 (workInProgressSuspendedReason = 0), 17981 (workInProgressThrownValue = null), 17982 throwAndUnwindWorkLoop(root, unitOfWork, thrownValue, reason); 17983 } 17984 } 17985 workLoopSync(); 17986 exitStatus = workInProgressRootExitStatus; 17987 break; 17988 } catch (thrownValue$165) { 17989 handleThrow(root, thrownValue$165); 17990 } 17991 while (1); 17992 lanes && root.shellSuspendCounter++; 17993 lastContextDependency = currentlyRenderingFiber$1 = null; 17994 executionContext = prevExecutionContext; 17995 ReactSharedInternals.H = prevDispatcher; 17996 ReactSharedInternals.A = prevAsyncDispatcher; 17997 null === workInProgress && 17998 ((workInProgressRoot = null), 17999 (workInProgressRootRenderLanes = 0), 18000 finishQueueingConcurrentUpdates()); 18001 return exitStatus; 18002 } 18003 function workLoopSync() { 18004 for (; null !== workInProgress; ) performUnitOfWork(workInProgress); 18005 } 18006 function renderRootConcurrent(root, lanes) { 18007 var prevExecutionContext = executionContext; 18008 executionContext |= 2; 18009 var prevDispatcher = pushDispatcher(), 18010 prevAsyncDispatcher = pushAsyncDispatcher(); 18011 workInProgressRoot !== root || workInProgressRootRenderLanes !== lanes 18012 ? ((workInProgressTransitions = null), 18013 (workInProgressRootRenderTargetTime = now() + 500), 18014 prepareFreshStack(root, lanes)) 18015 : (workInProgressRootIsPrerendering = checkIfRootIsPrerendering( 18016 root, 18017 lanes 18018 )); 18019 a: do 18020 try { 18021 if (0 !== workInProgressSuspendedReason && null !== workInProgress) { 18022 lanes = workInProgress; 18023 var thrownValue = workInProgressThrownValue; 18024 b: switch (workInProgressSuspendedReason) { 18025 case 1: 18026 workInProgressSuspendedReason = 0; 18027 workInProgressThrownValue = null; 18028 throwAndUnwindWorkLoop(root, lanes, thrownValue, 1); 18029 break; 18030 case 2: 18031 case 9: 18032 if (isThenableResolved(thrownValue)) { 18033 workInProgressSuspendedReason = 0; 18034 workInProgressThrownValue = null; 18035 replaySuspendedUnitOfWork(lanes); 18036 break; 18037 } 18038 lanes = function () { 18039 (2 !== workInProgressSuspendedReason && 18040 9 !== workInProgressSuspendedReason) || 18041 workInProgressRoot !== root || 18042 (workInProgressSuspendedReason = 7); 18043 ensureRootIsScheduled(root); 18044 }; 18045 thrownValue.then(lanes, lanes); 18046 break a; 18047 case 3: 18048 workInProgressSuspendedReason = 7; 18049 break a; 18050 case 4: 18051 workInProgressSuspendedReason = 5; 18052 break a; 18053 case 7: 18054 isThenableResolved(thrownValue) 18055 ? ((workInProgressSuspendedReason = 0), 18056 (workInProgressThrownValue = null), 18057 replaySuspendedUnitOfWork(lanes)) 18058 : ((workInProgressSuspendedReason = 0), 18059 (workInProgressThrownValue = null), 18060 throwAndUnwindWorkLoop(root, lanes, thrownValue, 7)); 18061 break; 18062 case 5: 18063 var resource = null; 18064 switch (workInProgress.tag) { 18065 case 26: 18066 resource = workInProgress.memoizedState; 18067 case 5: 18068 case 27: 18069 var hostFiber = workInProgress; 18070 if ( 18071 resource 18072 ? preloadResource(resource) 18073 : hostFiber.stateNode.complete 18074 ) { 18075 workInProgressSuspendedReason = 0; 18076 workInProgressThrownValue = null; 18077 var sibling = hostFiber.sibling; 18078 if (null !== sibling) workInProgress = sibling; 18079 else { 18080 var returnFiber = hostFiber.return; 18081 null !== returnFiber 18082 ? ((workInProgress = returnFiber), 18083 completeUnitOfWork(returnFiber)) 18084 : (workInProgress = null); 18085 } 18086 break b; 18087 } 18088 } 18089 workInProgressSuspendedReason = 0; 18090 workInProgressThrownValue = null; 18091 throwAndUnwindWorkLoop(root, lanes, thrownValue, 5); 18092 break; 18093 case 6: 18094 workInProgressSuspendedReason = 0; 18095 workInProgressThrownValue = null; 18096 throwAndUnwindWorkLoop(root, lanes, thrownValue, 6); 18097 break; 18098 case 8: 18099 resetWorkInProgressStack(); 18100 workInProgressRootExitStatus = 6; 18101 break a; 18102 default: 18103 throw Error(formatProdErrorMessage(462)); 18104 } 18105 } 18106 workLoopConcurrentByScheduler(); 18107 break; 18108 } catch (thrownValue$167) { 18109 handleThrow(root, thrownValue$167); 18110 } 18111 while (1); 18112 lastContextDependency = currentlyRenderingFiber$1 = null; 18113 ReactSharedInternals.H = prevDispatcher; 18114 ReactSharedInternals.A = prevAsyncDispatcher; 18115 executionContext = prevExecutionContext; 18116 if (null !== workInProgress) return 0; 18117 workInProgressRoot = null; 18118 workInProgressRootRenderLanes = 0; 18119 finishQueueingConcurrentUpdates(); 18120 return workInProgressRootExitStatus; 18121 } 18122 function workLoopConcurrentByScheduler() { 18123 for (; null !== workInProgress && !shouldYield(); ) 18124 performUnitOfWork(workInProgress); 18125 } 18126 function performUnitOfWork(unitOfWork) { 18127 var next = beginWork(unitOfWork.alternate, unitOfWork, entangledRenderLanes); 18128 unitOfWork.memoizedProps = unitOfWork.pendingProps; 18129 null === next ? completeUnitOfWork(unitOfWork) : (workInProgress = next); 18130 } 18131 function replaySuspendedUnitOfWork(unitOfWork) { 18132 var next = unitOfWork; 18133 var current = next.alternate; 18134 switch (next.tag) { 18135 case 15: 18136 case 0: 18137 next = replayFunctionComponent( 18138 current, 18139 next, 18140 next.pendingProps, 18141 next.type, 18142 void 0, 18143 workInProgressRootRenderLanes 18144 ); 18145 break; 18146 case 11: 18147 next = replayFunctionComponent( 18148 current, 18149 next, 18150 next.pendingProps, 18151 next.type.render, 18152 next.ref, 18153 workInProgressRootRenderLanes 18154 ); 18155 break; 18156 case 5: 18157 resetHooksOnUnwind(next); 18158 default: 18159 unwindInterruptedWork(current, next), 18160 (next = workInProgress = 18161 resetWorkInProgress(next, entangledRenderLanes)), 18162 (next = beginWork(current, next, entangledRenderLanes)); 18163 } 18164 unitOfWork.memoizedProps = unitOfWork.pendingProps; 18165 null === next ? completeUnitOfWork(unitOfWork) : (workInProgress = next); 18166 } 18167 function throwAndUnwindWorkLoop( 18168 root, 18169 unitOfWork, 18170 thrownValue, 18171 suspendedReason 18172 ) { 18173 lastContextDependency = currentlyRenderingFiber$1 = null; 18174 resetHooksOnUnwind(unitOfWork); 18175 thenableState$1 = null; 18176 thenableIndexCounter$1 = 0; 18177 var returnFiber = unitOfWork.return; 18178 try { 18179 if ( 18180 throwException( 18181 root, 18182 returnFiber, 18183 unitOfWork, 18184 thrownValue, 18185 workInProgressRootRenderLanes 18186 ) 18187 ) { 18188 workInProgressRootExitStatus = 1; 18189 logUncaughtError( 18190 root, 18191 createCapturedValueAtFiber(thrownValue, root.current) 18192 ); 18193 workInProgress = null; 18194 return; 18195 } 18196 } catch (error) { 18197 if (null !== returnFiber) throw ((workInProgress = returnFiber), error); 18198 workInProgressRootExitStatus = 1; 18199 logUncaughtError( 18200 root, 18201 createCapturedValueAtFiber(thrownValue, root.current) 18202 ); 18203 workInProgress = null; 18204 return; 18205 } 18206 if (unitOfWork.flags & 32768) { 18207 if (isHydrating || 1 === suspendedReason) root = true; 18208 else if ( 18209 workInProgressRootIsPrerendering || 18210 0 !== (workInProgressRootRenderLanes & 536870912) 18211 ) 18212 root = false; 18213 else if ( 18214 ((workInProgressRootDidSkipSuspendedSiblings = root = true), 18215 2 === suspendedReason || 18216 9 === suspendedReason || 18217 3 === suspendedReason || 18218 6 === suspendedReason) 18219 ) 18220 (suspendedReason = suspenseHandlerStackCursor.current), 18221 null !== suspendedReason && 18222 13 === suspendedReason.tag && 18223 (suspendedReason.flags |= 16384); 18224 unwindUnitOfWork(unitOfWork, root); 18225 } else completeUnitOfWork(unitOfWork); 18226 } 18227 function completeUnitOfWork(unitOfWork) { 18228 var completedWork = unitOfWork; 18229 do { 18230 if (0 !== (completedWork.flags & 32768)) { 18231 unwindUnitOfWork( 18232 completedWork, 18233 workInProgressRootDidSkipSuspendedSiblings 18234 ); 18235 return; 18236 } 18237 unitOfWork = completedWork.return; 18238 var next = completeWork( 18239 completedWork.alternate, 18240 completedWork, 18241 entangledRenderLanes 18242 ); 18243 if (null !== next) { 18244 workInProgress = next; 18245 return; 18246 } 18247 completedWork = completedWork.sibling; 18248 if (null !== completedWork) { 18249 workInProgress = completedWork; 18250 return; 18251 } 18252 workInProgress = completedWork = unitOfWork; 18253 } while (null !== completedWork); 18254 0 === workInProgressRootExitStatus && (workInProgressRootExitStatus = 5); 18255 } 18256 function unwindUnitOfWork(unitOfWork, skipSiblings) { 18257 do { 18258 var next = unwindWork(unitOfWork.alternate, unitOfWork); 18259 if (null !== next) { 18260 next.flags &= 32767; 18261 workInProgress = next; 18262 return; 18263 } 18264 next = unitOfWork.return; 18265 null !== next && 18266 ((next.flags |= 32768), (next.subtreeFlags = 0), (next.deletions = null)); 18267 if ( 18268 !skipSiblings && 18269 ((unitOfWork = unitOfWork.sibling), null !== unitOfWork) 18270 ) { 18271 workInProgress = unitOfWork; 18272 return; 18273 } 18274 workInProgress = unitOfWork = next; 18275 } while (null !== unitOfWork); 18276 workInProgressRootExitStatus = 6; 18277 workInProgress = null; 18278 } 18279 function commitRoot( 18280 root, 18281 finishedWork, 18282 lanes, 18283 recoverableErrors, 18284 transitions, 18285 didIncludeRenderPhaseUpdate, 18286 spawnedLane, 18287 updatedLanes, 18288 suspendedRetryLanes 18289 ) { 18290 root.cancelPendingCommit = null; 18291 do flushPendingEffects();
vendor: 5,685 bytes, lines 18292-18424
18292 while (0 !== pendingEffectsStatus); 18293 if (0 !== (executionContext & 6)) throw Error(formatProdErrorMessage(327)); 18294 if (null !== finishedWork) { 18295 if (finishedWork === root.current) throw Error(formatProdErrorMessage(177)); 18296 didIncludeRenderPhaseUpdate = finishedWork.lanes | finishedWork.childLanes; 18297 didIncludeRenderPhaseUpdate |= concurrentlyUpdatedLanes; 18298 markRootFinished( 18299 root, 18300 lanes, 18301 didIncludeRenderPhaseUpdate, 18302 spawnedLane, 18303 updatedLanes, 18304 suspendedRetryLanes 18305 ); 18306 root === workInProgressRoot && 18307 ((workInProgress = workInProgressRoot = null), 18308 (workInProgressRootRenderLanes = 0)); 18309 pendingFinishedWork = finishedWork; 18310 pendingEffectsRoot = root; 18311 pendingEffectsLanes = lanes; 18312 pendingEffectsRemainingLanes = didIncludeRenderPhaseUpdate; 18313 pendingPassiveTransitions = transitions; 18314 pendingRecoverableErrors = recoverableErrors; 18315 0 !== (finishedWork.subtreeFlags & 10256) || 18316 0 !== (finishedWork.flags & 10256) 18317 ? ((root.callbackNode = null), 18318 (root.callbackPriority = 0), 18319 scheduleCallback$1(NormalPriority$1, function () { 18320 flushPassiveEffects(); 18321 return null; 18322 })) 18323 : ((root.callbackNode = null), (root.callbackPriority = 0)); 18324 recoverableErrors = 0 !== (finishedWork.flags & 13878); 18325 if (0 !== (finishedWork.subtreeFlags & 13878) || recoverableErrors) { 18326 recoverableErrors = ReactSharedInternals.T; 18327 ReactSharedInternals.T = null; 18328 transitions = ReactDOMSharedInternals.p; 18329 ReactDOMSharedInternals.p = 2; 18330 spawnedLane = executionContext; 18331 executionContext |= 4; 18332 try { 18333 commitBeforeMutationEffects(root, finishedWork, lanes); 18334 } finally { 18335 (executionContext = spawnedLane), 18336 (ReactDOMSharedInternals.p = transitions), 18337 (ReactSharedInternals.T = recoverableErrors); 18338 } 18339 } 18340 pendingEffectsStatus = 1; 18341 flushMutationEffects(); 18342 flushLayoutEffects(); 18343 flushSpawnedWork(); 18344 } 18345 } 18346 function flushMutationEffects() { 18347 if (1 === pendingEffectsStatus) { 18348 pendingEffectsStatus = 0; 18349 var root = pendingEffectsRoot, 18350 finishedWork = pendingFinishedWork, 18351 rootMutationHasEffect = 0 !== (finishedWork.flags & 13878); 18352 if (0 !== (finishedWork.subtreeFlags & 13878) || rootMutationHasEffect) { 18353 rootMutationHasEffect = ReactSharedInternals.T; 18354 ReactSharedInternals.T = null; 18355 var previousPriority = ReactDOMSharedInternals.p; 18356 ReactDOMSharedInternals.p = 2; 18357 var prevExecutionContext = executionContext; 18358 executionContext |= 4; 18359 try { 18360 commitMutationEffectsOnFiber(finishedWork, root); 18361 var priorSelectionInformation = selectionInformation, 18362 curFocusedElem = getActiveElementDeep(root.containerInfo), 18363 priorFocusedElem = priorSelectionInformation.focusedElem, 18364 priorSelectionRange = priorSelectionInformation.selectionRange; 18365 if ( 18366 curFocusedElem !== priorFocusedElem && 18367 priorFocusedElem && 18368 priorFocusedElem.ownerDocument && 18369 containsNode( 18370 priorFocusedElem.ownerDocument.documentElement, 18371 priorFocusedElem 18372 ) 18373 ) { 18374 if ( 18375 null !== priorSelectionRange && 18376 hasSelectionCapabilities(priorFocusedElem) 18377 ) { 18378 var start = priorSelectionRange.start, 18379 end = priorSelectionRange.end; 18380 void 0 === end && (end = start); 18381 if ("selectionStart" in priorFocusedElem) 18382 (priorFocusedElem.selectionStart = start), 18383 (priorFocusedElem.selectionEnd = Math.min( 18384 end, 18385 priorFocusedElem.value.length 18386 )); 18387 else { 18388 var doc = priorFocusedElem.ownerDocument || document, 18389 win = (doc && doc.defaultView) || window; 18390 if (win.getSelection) { 18391 var selection = win.getSelection(), 18392 length = priorFocusedElem.textContent.length, 18393 start$jscomp$0 = Math.min(priorSelectionRange.start, length), 18394 end$jscomp$0 = 18395 void 0 === priorSelectionRange.end 18396 ? start$jscomp$0 18397 : Math.min(priorSelectionRange.end, length); 18398 !selection.extend && 18399 start$jscomp$0 > end$jscomp$0 && 18400 ((curFocusedElem = end$jscomp$0), 18401 (end$jscomp$0 = start$jscomp$0), 18402 (start$jscomp$0 = curFocusedElem)); 18403 var startMarker = getNodeForCharacterOffset( 18404 priorFocusedElem, 18405 start$jscomp$0 18406 ), 18407 endMarker = getNodeForCharacterOffset( 18408 priorFocusedElem, 18409 end$jscomp$0 18410 ); 18411 if ( 18412 startMarker && 18413 endMarker && 18414 (1 !== selection.rangeCount || 18415 selection.anchorNode !== startMarker.node || 18416 selection.anchorOffset !== startMarker.offset || 18417 selection.focusNode !== endMarker.node || 18418 selection.focusOffset !== endMarker.offset) 18419 ) { 18420 var range = doc.createRange(); 18421 range.setStart(startMarker.node, startMarker.offset); 18422 selection.removeAllRanges(); 18423 start$jscomp$0 > end$jscomp$0 18424 ? (selection.addRange(range),
vendor: 6,142 bytes, lines 18425-18592
18425 selection.extend(endMarker.node, endMarker.offset)) 18426 : (range.setEnd(endMarker.node, endMarker.offset), 18427 selection.addRange(range)); 18428 } 18429 } 18430 } 18431 } 18432 doc = []; 18433 for ( 18434 selection = priorFocusedElem; 18435 (selection = selection.parentNode); 18436 18437 ) 18438 1 === selection.nodeType && 18439 doc.push({ 18440 element: selection, 18441 left: selection.scrollLeft, 18442 top: selection.scrollTop 18443 }); 18444 "function" === typeof priorFocusedElem.focus && 18445 priorFocusedElem.focus(); 18446 for ( 18447 priorFocusedElem = 0; 18448 priorFocusedElem < doc.length; 18449 priorFocusedElem++ 18450 ) { 18451 var info = doc[priorFocusedElem]; 18452 info.element.scrollLeft = info.left; 18453 info.element.scrollTop = info.top; 18454 } 18455 } 18456 _enabled = !!eventsEnabled; 18457 selectionInformation = eventsEnabled = null; 18458 } finally { 18459 (executionContext = prevExecutionContext), 18460 (ReactDOMSharedInternals.p = previousPriority), 18461 (ReactSharedInternals.T = rootMutationHasEffect); 18462 } 18463 } 18464 root.current = finishedWork; 18465 pendingEffectsStatus = 2; 18466 } 18467 } 18468 function flushLayoutEffects() { 18469 if (2 === pendingEffectsStatus) { 18470 pendingEffectsStatus = 0; 18471 var root = pendingEffectsRoot, 18472 finishedWork = pendingFinishedWork, 18473 rootHasLayoutEffect = 0 !== (finishedWork.flags & 8772); 18474 if (0 !== (finishedWork.subtreeFlags & 8772) || rootHasLayoutEffect) { 18475 rootHasLayoutEffect = ReactSharedInternals.T; 18476 ReactSharedInternals.T = null; 18477 var previousPriority = ReactDOMSharedInternals.p; 18478 ReactDOMSharedInternals.p = 2; 18479 var prevExecutionContext = executionContext; 18480 executionContext |= 4; 18481 try { 18482 commitLayoutEffectOnFiber(root, finishedWork.alternate, finishedWork); 18483 } finally { 18484 (executionContext = prevExecutionContext), 18485 (ReactDOMSharedInternals.p = previousPriority), 18486 (ReactSharedInternals.T = rootHasLayoutEffect); 18487 } 18488 } 18489 pendingEffectsStatus = 3; 18490 } 18491 } 18492 function flushSpawnedWork() { 18493 if (4 === pendingEffectsStatus || 3 === pendingEffectsStatus) { 18494 pendingEffectsStatus = 0; 18495 requestPaint(); 18496 var root = pendingEffectsRoot, 18497 finishedWork = pendingFinishedWork, 18498 lanes = pendingEffectsLanes, 18499 recoverableErrors = pendingRecoverableErrors; 18500 0 !== (finishedWork.subtreeFlags & 10256) || 18501 0 !== (finishedWork.flags & 10256) 18502 ? (pendingEffectsStatus = 5) 18503 : ((pendingEffectsStatus = 0), 18504 (pendingFinishedWork = pendingEffectsRoot = null), 18505 releaseRootPooledCache(root, root.pendingLanes)); 18506 var remainingLanes = root.pendingLanes; 18507 0 === remainingLanes && (legacyErrorBoundariesThatAlreadyFailed = null); 18508 lanesToEventPriority(lanes); 18509 finishedWork = finishedWork.stateNode; 18510 if (injectedHook && "function" === typeof injectedHook.onCommitFiberRoot) 18511 try { 18512 injectedHook.onCommitFiberRoot( 18513 rendererID, 18514 finishedWork, 18515 void 0, 18516 128 === (finishedWork.current.flags & 128) 18517 ); 18518 } catch (err) {} 18519 if (null !== recoverableErrors) { 18520 finishedWork = ReactSharedInternals.T; 18521 remainingLanes = ReactDOMSharedInternals.p; 18522 ReactDOMSharedInternals.p = 2; 18523 ReactSharedInternals.T = null; 18524 try { 18525 for ( 18526 var onRecoverableError = root.onRecoverableError, i = 0; 18527 i < recoverableErrors.length; 18528 i++ 18529 ) { 18530 var recoverableError = recoverableErrors[i]; 18531 onRecoverableError(recoverableError.value, { 18532 componentStack: recoverableError.stack 18533 }); 18534 } 18535 } finally { 18536 (ReactSharedInternals.T = finishedWork), 18537 (ReactDOMSharedInternals.p = remainingLanes); 18538 } 18539 } 18540 0 !== (pendingEffectsLanes & 3) && flushPendingEffects(); 18541 ensureRootIsScheduled(root); 18542 remainingLanes = root.pendingLanes; 18543 0 !== (lanes & 261930) && 0 !== (remainingLanes & 42) 18544 ? root === rootWithNestedUpdates 18545 ? nestedUpdateCount++ 18546 : ((nestedUpdateCount = 0), (rootWithNestedUpdates = root)) 18547 : (nestedUpdateCount = 0); 18548 flushSyncWorkAcrossRoots_impl(0); 18549 } 18550 } 18551 function releaseRootPooledCache(root, remainingLanes) { 18552 0 === (root.pooledCacheLanes &= remainingLanes) && 18553 ((remainingLanes = root.pooledCache), 18554 null != remainingLanes && 18555 ((root.pooledCache = null), releaseCache(remainingLanes))); 18556 } 18557 function flushPendingEffects() { 18558 flushMutationEffects(); 18559 flushLayoutEffects(); 18560 flushSpawnedWork(); 18561 return flushPassiveEffects(); 18562 } 18563 function flushPassiveEffects() { 18564 if (5 !== pendingEffectsStatus) return false; 18565 var root = pendingEffectsRoot, 18566 remainingLanes = pendingEffectsRemainingLanes; 18567 pendingEffectsRemainingLanes = 0; 18568 var renderPriority = lanesToEventPriority(pendingEffectsLanes), 18569 prevTransition = ReactSharedInternals.T, 18570 previousPriority = ReactDOMSharedInternals.p; 18571 try { 18572 ReactDOMSharedInternals.p = 32 > renderPriority ? 32 : renderPriority; 18573 ReactSharedInternals.T = null; 18574 renderPriority = pendingPassiveTransitions; 18575 pendingPassiveTransitions = null; 18576 var root$jscomp$0 = pendingEffectsRoot, 18577 lanes = pendingEffectsLanes; 18578 pendingEffectsStatus = 0; 18579 pendingFinishedWork = pendingEffectsRoot = null; 18580 pendingEffectsLanes = 0; 18581 if (0 !== (executionContext & 6)) throw Error(formatProdErrorMessage(331)); 18582 var prevExecutionContext = executionContext; 18583 executionContext |= 4; 18584 commitPassiveUnmountOnFiber(root$jscomp$0.current); 18585 commitPassiveMountOnFiber( 18586 root$jscomp$0, 18587 root$jscomp$0.current, 18588 lanes, 18589 renderPriority 18590 ); 18591 executionContext = prevExecutionContext; 18592 flushSyncWorkAcrossRoots_impl(0
18592, !1); 18593 if ( 18594 injectedHook && 18595 "function" === typeof injectedHook.onPostCommitFiberRoot 18596 ) 18597 try { 18598 injectedHook.onPostCommitFiberRoot(rendererID, root$jscomp$0); 18599 } catch (err) {} 18600 return !0
vendor: 30,697 bytes, lines 18600-19435
18600; 18601 } finally { 18602 (ReactDOMSharedInternals.p = previousPriority), 18603 (ReactSharedInternals.T = prevTransition), 18604 releaseRootPooledCache(root, remainingLanes); 18605 } 18606 } 18607 function captureCommitPhaseErrorOnRoot(rootFiber, sourceFiber, error) { 18608 sourceFiber = createCapturedValueAtFiber(error, sourceFiber); 18609 sourceFiber = createRootErrorUpdate(rootFiber.stateNode, sourceFiber, 2); 18610 rootFiber = enqueueUpdate(rootFiber, sourceFiber, 2); 18611 null !== rootFiber && 18612 (markRootUpdated$1(rootFiber, 2), ensureRootIsScheduled(rootFiber)); 18613 } 18614 function captureCommitPhaseError(sourceFiber, nearestMountedAncestor, error) { 18615 if (3 === sourceFiber.tag) 18616 captureCommitPhaseErrorOnRoot(sourceFiber, sourceFiber, error); 18617 else 18618 for (; null !== nearestMountedAncestor; ) { 18619 if (3 === nearestMountedAncestor.tag) { 18620 captureCommitPhaseErrorOnRoot( 18621 nearestMountedAncestor, 18622 sourceFiber, 18623 error 18624 ); 18625 break; 18626 } else if (1 === nearestMountedAncestor.tag) { 18627 var instance = nearestMountedAncestor.stateNode; 18628 if ( 18629 "function" === 18630 typeof nearestMountedAncestor.type.getDerivedStateFromError || 18631 ("function" === typeof instance.componentDidCatch && 18632 (null === legacyErrorBoundariesThatAlreadyFailed || 18633 !legacyErrorBoundariesThatAlreadyFailed.has(instance))) 18634 ) { 18635 sourceFiber = createCapturedValueAtFiber(error, sourceFiber); 18636 error = createClassErrorUpdate(2); 18637 instance = enqueueUpdate(nearestMountedAncestor, error, 2); 18638 null !== instance && 18639 (initializeClassErrorUpdate( 18640 error, 18641 instance, 18642 nearestMountedAncestor, 18643 sourceFiber 18644 ), 18645 markRootUpdated$1(instance, 2), 18646 ensureRootIsScheduled(instance)); 18647 break; 18648 } 18649 } 18650 nearestMountedAncestor = nearestMountedAncestor.return; 18651 } 18652 } 18653 function attachPingListener(root, wakeable, lanes) { 18654 var pingCache = root.pingCache; 18655 if (null === pingCache) { 18656 pingCache = root.pingCache = new PossiblyWeakMap(); 18657 var threadIDs = new Set(); 18658 pingCache.set(wakeable, threadIDs); 18659 } else 18660 (threadIDs = pingCache.get(wakeable)), 18661 void 0 === threadIDs && 18662 ((threadIDs = new Set()), pingCache.set(wakeable, threadIDs)); 18663 threadIDs.has(lanes) || 18664 ((workInProgressRootDidAttachPingListener = true), 18665 threadIDs.add(lanes), 18666 (root = pingSuspendedRoot.bind(null, root, wakeable, lanes)), 18667 wakeable.then(root, root)); 18668 } 18669 function pingSuspendedRoot(root, wakeable, pingedLanes) { 18670 var pingCache = root.pingCache; 18671 null !== pingCache && pingCache.delete(wakeable); 18672 root.pingedLanes |= root.suspendedLanes & pingedLanes; 18673 root.warmLanes &= ~pingedLanes; 18674 workInProgressRoot === root && 18675 (workInProgressRootRenderLanes & pingedLanes) === pingedLanes && 18676 (4 === workInProgressRootExitStatus || 18677 (3 === workInProgressRootExitStatus && 18678 (workInProgressRootRenderLanes & 62914560) === 18679 workInProgressRootRenderLanes && 18680 300 > now() - globalMostRecentFallbackTime) 18681 ? 0 === (executionContext & 2) && prepareFreshStack(root, 0) 18682 : (workInProgressRootPingedLanes |= pingedLanes), 18683 workInProgressSuspendedRetryLanes === workInProgressRootRenderLanes && 18684 (workInProgressSuspendedRetryLanes = 0)); 18685 ensureRootIsScheduled(root); 18686 } 18687 function retryTimedOutBoundary(boundaryFiber, retryLane) { 18688 0 === retryLane && (retryLane = claimNextRetryLane()); 18689 boundaryFiber = enqueueConcurrentRenderForLane(boundaryFiber, retryLane); 18690 null !== boundaryFiber && 18691 (markRootUpdated$1(boundaryFiber, retryLane), 18692 ensureRootIsScheduled(boundaryFiber)); 18693 } 18694 function retryDehydratedSuspenseBoundary(boundaryFiber) { 18695 var suspenseState = boundaryFiber.memoizedState, 18696 retryLane = 0; 18697 null !== suspenseState && (retryLane = suspenseState.retryLane); 18698 retryTimedOutBoundary(boundaryFiber, retryLane); 18699 } 18700 function resolveRetryWakeable(boundaryFiber, wakeable) { 18701 var retryLane = 0; 18702 switch (boundaryFiber.tag) { 18703 case 31: 18704 case 13: 18705 var retryCache = boundaryFiber.stateNode; 18706 var suspenseState = boundaryFiber.memoizedState; 18707 null !== suspenseState && (retryLane = suspenseState.retryLane); 18708 break; 18709 case 19: 18710 retryCache = boundaryFiber.stateNode; 18711 break; 18712 case 22: 18713 retryCache = boundaryFiber.stateNode._retryCache; 18714 break; 18715 default: 18716 throw Error(formatProdErrorMessage(314)); 18717 } 18718 null !== retryCache && retryCache.delete(wakeable); 18719 retryTimedOutBoundary(boundaryFiber, retryLane); 18720 } 18721 function scheduleCallback$1(priorityLevel, callback) { 18722 return scheduleCallback$3(priorityLevel, callback); 18723 } 18724 var firstScheduledRoot = null, 18725 lastScheduledRoot = null, 18726 didScheduleMicrotask = false, 18727 mightHavePendingSyncWork = false, 18728 isFlushingWork = false, 18729 currentEventTransitionLane = 0; 18730 function ensureRootIsScheduled(root) { 18731 root !== lastScheduledRoot && 18732 null === root.next && 18733 (null === lastScheduledRoot 18734 ? (firstScheduledRoot = lastScheduledRoot = root) 18735 : (lastScheduledRoot = lastScheduledRoot.next = root)); 18736 mightHavePendingSyncWork = true; 18737 didScheduleMicrotask || 18738 ((didScheduleMicrotask = true), scheduleImmediateRootScheduleTask()); 18739 } 18740 function flushSyncWorkAcrossRoots_impl(syncTransitionLanes, onlyLegacy) { 18741 if (!isFlushingWork && mightHavePendingSyncWork) { 18742 isFlushingWork = true; 18743 do { 18744 var didPerformSomeWork = false; 18745 for (var root$170 = firstScheduledRoot; null !== root$170; ) { 18746 if (0 !== syncTransitionLanes) { 18747 var pendingLanes = root$170.pendingLanes; 18748 if (0 === pendingLanes) var JSCompiler_inline_result = 0; 18749 else { 18750 var suspendedLanes = root$170.suspendedLanes, 18751 pingedLanes = root$170.pingedLanes; 18752 JSCompiler_inline_result = 18753 (1 << (31 - clz32(42 | syncTransitionLanes) + 1)) - 1; 18754 JSCompiler_inline_result &= 18755 pendingLanes & ~(suspendedLanes & ~pingedLanes); 18756 JSCompiler_inline_result = 18757 JSCompiler_inline_result & 201326741 18758 ? (JSCompiler_inline_result & 201326741) | 1 18759 : JSCompiler_inline_result 18760 ? JSCompiler_inline_result | 2 18761 : 0; 18762 } 18763 0 !== JSCompiler_inline_result && 18764 ((didPerformSomeWork = true), 18765 performSyncWorkOnRoot(root$170, JSCompiler_inline_result)); 18766 } else 18767 (JSCompiler_inline_result = workInProgressRootRenderLanes), 18768 (JSCompiler_inline_result = getNextLanes( 18769 root$170, 18770 root$170 === workInProgressRoot ? JSCompiler_inline_result : 0, 18771 null !== root$170.cancelPendingCommit || 18772 -1 !== root$170.timeoutHandle 18773 )), 18774 0 === (JSCompiler_inline_result & 3) || 18775 checkIfRootIsPrerendering(root$170, JSCompiler_inline_result) || 18776 ((didPerformSomeWork = true), 18777 performSyncWorkOnRoot(root$170, JSCompiler_inline_result)); 18778 root$170 = root$170.next; 18779 } 18780 } while (didPerformSomeWork); 18781 isFlushingWork = false; 18782 } 18783 } 18784 function processRootScheduleInImmediateTask() { 18785 processRootScheduleInMicrotask(); 18786 } 18787 function processRootScheduleInMicrotask() { 18788 mightHavePendingSyncWork = didScheduleMicrotask = false; 18789 var syncTransitionLanes = 0; 18790 0 !== currentEventTransitionLane && 18791 shouldAttemptEagerTransition() && 18792 (syncTransitionLanes = currentEventTransitionLane); 18793 for ( 18794 var currentTime = now(), prev = null, root = firstScheduledRoot; 18795 null !== root; 18796 18797 ) { 18798 var next = root.next, 18799 nextLanes = scheduleTaskForRootDuringMicrotask(root, currentTime); 18800 if (0 === nextLanes) 18801 (root.next = null), 18802 null === prev ? (firstScheduledRoot = next) : (prev.next = next), 18803 null === next && (lastScheduledRoot = prev); 18804 else if ( 18805 ((prev = root), 0 !== syncTransitionLanes || 0 !== (nextLanes & 3)) 18806 ) 18807 mightHavePendingSyncWork = true; 18808 root = next; 18809 } 18810 (0 !== pendingEffectsStatus && 5 !== pendingEffectsStatus) || 18811 flushSyncWorkAcrossRoots_impl(syncTransitionLanes); 18812 0 !== currentEventTransitionLane && (currentEventTransitionLane = 0); 18813 } 18814 function scheduleTaskForRootDuringMicrotask(root, currentTime) { 18815 for ( 18816 var suspendedLanes = root.suspendedLanes, 18817 pingedLanes = root.pingedLanes, 18818 expirationTimes = root.expirationTimes, 18819 lanes = root.pendingLanes & -62914561; 18820 0 < lanes; 18821 18822 ) { 18823 var index$5 = 31 - clz32(lanes), 18824 lane = 1 << index$5, 18825 expirationTime = expirationTimes[index$5]; 18826 if (-1 === expirationTime) { 18827 if (0 === (lane & suspendedLanes) || 0 !== (lane & pingedLanes)) 18828 expirationTimes[index$5] = computeExpirationTime(lane, currentTime); 18829 } else expirationTime <= currentTime && (root.expiredLanes |= lane); 18830 lanes &= ~lane; 18831 } 18832 currentTime = workInProgressRoot; 18833 suspendedLanes = workInProgressRootRenderLanes; 18834 suspendedLanes = getNextLanes( 18835 root, 18836 root === currentTime ? suspendedLanes : 0, 18837 null !== root.cancelPendingCommit || -1 !== root.timeoutHandle 18838 ); 18839 pingedLanes = root.callbackNode; 18840 if ( 18841 0 === suspendedLanes || 18842 (root === currentTime && 18843 (2 === workInProgressSuspendedReason || 18844 9 === workInProgressSuspendedReason)) || 18845 null !== root.cancelPendingCommit 18846 ) 18847 return ( 18848 null !== pingedLanes && 18849 null !== pingedLanes && 18850 cancelCallback$1(pingedLanes), 18851 (root.callbackNode = null), 18852 (root.callbackPriority = 0) 18853 ); 18854 if ( 18855 0 === (suspendedLanes & 3) || 18856 checkIfRootIsPrerendering(root, suspendedLanes) 18857 ) { 18858 currentTime = suspendedLanes & -suspendedLanes; 18859 if (currentTime === root.callbackPriority) return currentTime; 18860 null !== pingedLanes && cancelCallback$1(pingedLanes); 18861 switch (lanesToEventPriority(suspendedLanes)) { 18862 case 2: 18863 case 8: 18864 suspendedLanes = UserBlockingPriority; 18865 break; 18866 case 32: 18867 suspendedLanes = NormalPriority$1; 18868 break; 18869 case 268435456: 18870 suspendedLanes = IdlePriority; 18871 break; 18872 default: 18873 suspendedLanes = NormalPriority$1; 18874 } 18875 pingedLanes = performWorkOnRootViaSchedulerTask.bind(null, root); 18876 suspendedLanes = scheduleCallback$3(suspendedLanes, pingedLanes); 18877 root.callbackPriority = currentTime; 18878 root.callbackNode = suspendedLanes; 18879 return currentTime; 18880 } 18881 null !== pingedLanes && null !== pingedLanes && cancelCallback$1(pingedLanes); 18882 root.callbackPriority = 2; 18883 root.callbackNode = null; 18884 return 2; 18885 } 18886 function performWorkOnRootViaSchedulerTask(root, didTimeout) { 18887 if (0 !== pendingEffectsStatus && 5 !== pendingEffectsStatus) 18888 return (root.callbackNode = null), (root.callbackPriority = 0), null; 18889 var originalCallbackNode = root.callbackNode; 18890 if (flushPendingEffects() && root.callbackNode !== originalCallbackNode) 18891 return null; 18892 var workInProgressRootRenderLanes$jscomp$0 = workInProgressRootRenderLanes; 18893 workInProgressRootRenderLanes$jscomp$0 = getNextLanes( 18894 root, 18895 root === workInProgressRoot ? workInProgressRootRenderLanes$jscomp$0 : 0, 18896 null !== root.cancelPendingCommit || -1 !== root.timeoutHandle 18897 ); 18898 if (0 === workInProgressRootRenderLanes$jscomp$0) return null; 18899 performWorkOnRoot(root, workInProgressRootRenderLanes$jscomp$0, didTimeout); 18900 scheduleTaskForRootDuringMicrotask(root, now()); 18901 return null != root.callbackNode && root.callbackNode === originalCallbackNode 18902 ? performWorkOnRootViaSchedulerTask.bind(null, root) 18903 : null; 18904 } 18905 function performSyncWorkOnRoot(root, lanes) { 18906 if (flushPendingEffects()) return null; 18907 performWorkOnRoot(root, lanes, true); 18908 } 18909 function scheduleImmediateRootScheduleTask() { 18910 scheduleMicrotask(function () { 18911 0 !== (executionContext & 6) 18912 ? scheduleCallback$3( 18913 ImmediatePriority, 18914 processRootScheduleInImmediateTask 18915 ) 18916 : processRootScheduleInMicrotask(); 18917 }); 18918 } 18919 function requestTransitionLane() { 18920 if (0 === currentEventTransitionLane) { 18921 var actionScopeLane = currentEntangledLane; 18922 0 === actionScopeLane && 18923 ((actionScopeLane = nextTransitionUpdateLane), 18924 (nextTransitionUpdateLane <<= 1), 18925 0 === (nextTransitionUpdateLane & 261888) && 18926 (nextTransitionUpdateLane = 256)); 18927 currentEventTransitionLane = actionScopeLane; 18928 } 18929 return currentEventTransitionLane; 18930 } 18931 function coerceFormActionProp(actionProp) { 18932 return null == actionProp || 18933 "symbol" === typeof actionProp || 18934 "boolean" === typeof actionProp 18935 ? null 18936 : "function" === typeof actionProp 18937 ? actionProp 18938 : sanitizeURL("" + actionProp); 18939 } 18940 function createFormDataWithSubmitter(form, submitter) { 18941 var temp = submitter.ownerDocument.createElement("input"); 18942 temp.name = submitter.name; 18943 temp.value = submitter.value; 18944 form.id && temp.setAttribute("form", form.id); 18945 submitter.parentNode.insertBefore(temp, submitter); 18946 form = new FormData(form); 18947 temp.parentNode.removeChild(temp); 18948 return form; 18949 } 18950 function extractEvents$1( 18951 dispatchQueue, 18952 domEventName, 18953 maybeTargetInst, 18954 nativeEvent, 18955 nativeEventTarget 18956 ) { 18957 if ( 18958 "submit" === domEventName && 18959 maybeTargetInst && 18960 maybeTargetInst.stateNode === nativeEventTarget 18961 ) { 18962 var action = coerceFormActionProp( 18963 (nativeEventTarget[internalPropsKey] || null).action 18964 ), 18965 submitter = nativeEvent.submitter; 18966 submitter && 18967 ((domEventName = (domEventName = submitter[internalPropsKey] || null) 18968 ? coerceFormActionProp(domEventName.formAction) 18969 : submitter.getAttribute("formAction")), 18970 null !== domEventName && ((action = domEventName), (submitter = null))); 18971 var event = new SyntheticEvent( 18972 "action", 18973 "action", 18974 null, 18975 nativeEvent, 18976 nativeEventTarget 18977 ); 18978 dispatchQueue.push({ 18979 event: event, 18980 listeners: [ 18981 { 18982 instance: null, 18983 listener: function () { 18984 if (nativeEvent.defaultPrevented) { 18985 if (0 !== currentEventTransitionLane) { 18986 var formData = submitter 18987 ? createFormDataWithSubmitter(nativeEventTarget, submitter) 18988 : new FormData(nativeEventTarget); 18989 startHostTransition( 18990 maybeTargetInst, 18991 { 18992 pending: true, 18993 data: formData, 18994 method: nativeEventTarget.method, 18995 action: action 18996 }, 18997 null, 18998 formData 18999 ); 19000 } 19001 } else 19002 "function" === typeof action && 19003 (event.preventDefault(), 19004 (formData = submitter 19005 ? createFormDataWithSubmitter(nativeEventTarget, submitter) 19006 : new FormData(nativeEventTarget)), 19007 startHostTransition( 19008 maybeTargetInst, 19009 { 19010 pending: true, 19011 data: formData, 19012 method: nativeEventTarget.method, 19013 action: action 19014 }, 19015 action, 19016 formData 19017 )); 19018 }, 19019 currentTarget: nativeEventTarget 19020 } 19021 ] 19022 }); 19023 } 19024 } 19025 for ( 19026 var i$jscomp$inline_1577 = 0; 19027 i$jscomp$inline_1577 < simpleEventPluginEvents.length; 19028 i$jscomp$inline_1577++ 19029 ) { 19030 var eventName$jscomp$inline_1578 = 19031 simpleEventPluginEvents[i$jscomp$inline_1577], 19032 domEventName$jscomp$inline_1579 = 19033 eventName$jscomp$inline_1578.toLowerCase(), 19034 capitalizedEvent$jscomp$inline_1580 = 19035 eventName$jscomp$inline_1578[0].toUpperCase() + 19036 eventName$jscomp$inline_1578.slice(1); 19037 registerSimpleEvent( 19038 domEventName$jscomp$inline_1579, 19039 "on" + capitalizedEvent$jscomp$inline_1580 19040 ); 19041 } 19042 registerSimpleEvent(ANIMATION_END, "onAnimationEnd"); 19043 registerSimpleEvent(ANIMATION_ITERATION, "onAnimationIteration"); 19044 registerSimpleEvent(ANIMATION_START, "onAnimationStart"); 19045 registerSimpleEvent("dblclick", "onDoubleClick"); 19046 registerSimpleEvent("focusin", "onFocus"); 19047 registerSimpleEvent("focusout", "onBlur"); 19048 registerSimpleEvent(TRANSITION_RUN, "onTransitionRun"); 19049 registerSimpleEvent(TRANSITION_START, "onTransitionStart"); 19050 registerSimpleEvent(TRANSITION_CANCEL, "onTransitionCancel"); 19051 registerSimpleEvent(TRANSITION_END, "onTransitionEnd"); 19052 registerDirectEvent("onMouseEnter", ["mouseout", "mouseover"]); 19053 registerDirectEvent("onMouseLeave", ["mouseout", "mouseover"]); 19054 registerDirectEvent("onPointerEnter", ["pointerout", "pointerover"]); 19055 registerDirectEvent("onPointerLeave", ["pointerout", "pointerover"]); 19056 registerTwoPhaseEvent( 19057 "onChange", 19058 "change click focusin focusout input keydown keyup selectionchange".split(" ") 19059 ); 19060 registerTwoPhaseEvent( 19061 "onSelect", 19062 "focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split( 19063 " " 19064 ) 19065 ); 19066 registerTwoPhaseEvent("onBeforeInput", [ 19067 "compositionend", 19068 "keypress", 19069 "textInput", 19070 "paste" 19071 ]); 19072 registerTwoPhaseEvent( 19073 "onCompositionEnd", 19074 "compositionend focusout keydown keypress keyup mousedown".split(" ") 19075 ); 19076 registerTwoPhaseEvent( 19077 "onCompositionStart", 19078 "compositionstart focusout keydown keypress keyup mousedown".split(" ") 19079 ); 19080 registerTwoPhaseEvent( 19081 "onCompositionUpdate", 19082 "compositionupdate focusout keydown keypress keyup mousedown".split(" ") 19083 ); 19084 var mediaEventTypes = 19085 "abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split( 19086 " " 19087 ), 19088 nonDelegatedEvents = new Set( 19089 "beforetoggle cancel close invalid load scroll scrollend toggle" 19090 .split(" ") 19091 .concat(mediaEventTypes) 19092 ); 19093 function processDispatchQueue(dispatchQueue, eventSystemFlags) { 19094 eventSystemFlags = 0 !== (eventSystemFlags & 4); 19095 for (var i = 0; i < dispatchQueue.length; i++) { 19096 var _dispatchQueue$i = dispatchQueue[i], 19097 event = _dispatchQueue$i.event; 19098 _dispatchQueue$i = _dispatchQueue$i.listeners; 19099 a: { 19100 var previousInstance = void 0; 19101 if (eventSystemFlags) 19102 for ( 19103 var i$jscomp$0 = _dispatchQueue$i.length - 1; 19104 0 <= i$jscomp$0; 19105 i$jscomp$0-- 19106 ) { 19107 var _dispatchListeners$i = _dispatchQueue$i[i$jscomp$0], 19108 instance = _dispatchListeners$i.instance, 19109 currentTarget = _dispatchListeners$i.currentTarget; 19110 _dispatchListeners$i = _dispatchListeners$i.listener; 19111 if (instance !== previousInstance && event.isPropagationStopped()) 19112 break a; 19113 previousInstance = _dispatchListeners$i; 19114 event.currentTarget = currentTarget; 19115 try { 19116 previousInstance(event); 19117 } catch (error) { 19118 reportGlobalError(error); 19119 } 19120 event.currentTarget = null; 19121 previousInstance = instance; 19122 } 19123 else 19124 for ( 19125 i$jscomp$0 = 0; 19126 i$jscomp$0 < _dispatchQueue$i.length; 19127 i$jscomp$0++ 19128 ) { 19129 _dispatchListeners$i = _dispatchQueue$i[i$jscomp$0]; 19130 instance = _dispatchListeners$i.instance; 19131 currentTarget = _dispatchListeners$i.currentTarget; 19132 _dispatchListeners$i = _dispatchListeners$i.listener; 19133 if (instance !== previousInstance && event.isPropagationStopped()) 19134 break a; 19135 previousInstance = _dispatchListeners$i; 19136 event.currentTarget = currentTarget; 19137 try { 19138 previousInstance(event); 19139 } catch (error) { 19140 reportGlobalError(error); 19141 } 19142 event.currentTarget = null; 19143 previousInstance = instance; 19144 } 19145 } 19146 } 19147 } 19148 function listenToNonDelegatedEvent(domEventName, targetElement) { 19149 var JSCompiler_inline_result = targetElement[internalEventHandlersKey]; 19150 void 0 === JSCompiler_inline_result && 19151 (JSCompiler_inline_result = targetElement[internalEventHandlersKey] = 19152 new Set()); 19153 var listenerSetKey = domEventName + "__bubble"; 19154 JSCompiler_inline_result.has(listenerSetKey) || 19155 (addTrappedEventListener(targetElement, domEventName, 2, false), 19156 JSCompiler_inline_result.add(listenerSetKey)); 19157 } 19158 function listenToNativeEvent(domEventName, isCapturePhaseListener, target) { 19159 var eventSystemFlags = 0; 19160 isCapturePhaseListener && (eventSystemFlags |= 4); 19161 addTrappedEventListener( 19162 target, 19163 domEventName, 19164 eventSystemFlags, 19165 isCapturePhaseListener 19166 ); 19167 } 19168 var listeningMarker = "_reactListening" + Math.random().toString(36).slice(2); 19169 function listenToAllSupportedEvents(rootContainerElement) { 19170 if (!rootContainerElement[listeningMarker]) { 19171 rootContainerElement[listeningMarker] = true; 19172 allNativeEvents.forEach(function (domEventName) { 19173 "selectionchange" !== domEventName && 19174 (nonDelegatedEvents.has(domEventName) || 19175 listenToNativeEvent(domEventName, false, rootContainerElement), 19176 listenToNativeEvent(domEventName, true, rootContainerElement)); 19177 }); 19178 var ownerDocument = 19179 9 === rootContainerElement.nodeType 19180 ? rootContainerElement 19181 : rootContainerElement.ownerDocument; 19182 null === ownerDocument || 19183 ownerDocument[listeningMarker] || 19184 ((ownerDocument[listeningMarker] = true), 19185 listenToNativeEvent("selectionchange", false, ownerDocument)); 19186 } 19187 } 19188 function addTrappedEventListener( 19189 targetContainer, 19190 domEventName, 19191 eventSystemFlags, 19192 isCapturePhaseListener 19193 ) { 19194 switch (getEventPriority(domEventName)) { 19195 case 2: 19196 var listenerWrapper = dispatchDiscreteEvent; 19197 break; 19198 case 8: 19199 listenerWrapper = dispatchContinuousEvent; 19200 break; 19201 default: 19202 listenerWrapper = dispatchEvent; 19203 } 19204 eventSystemFlags = listenerWrapper.bind( 19205 null, 19206 domEventName, 19207 eventSystemFlags, 19208 targetContainer 19209 ); 19210 listenerWrapper = void 0; 19211 !passiveBrowserEventsSupported || 19212 ("touchstart" !== domEventName && 19213 "touchmove" !== domEventName && 19214 "wheel" !== domEventName) || 19215 (listenerWrapper = true); 19216 isCapturePhaseListener 19217 ? void 0 !== listenerWrapper 19218 ? targetContainer.addEventListener(domEventName, eventSystemFlags, { 19219 capture: true, 19220 passive: listenerWrapper 19221 }) 19222 : targetContainer.addEventListener(domEventName, eventSystemFlags, true) 19223 : void 0 !== listenerWrapper 19224 ? targetContainer.addEventListener(domEventName, eventSystemFlags, { 19225 passive: listenerWrapper 19226 }) 19227 : targetContainer.addEventListener(domEventName, eventSystemFlags, false); 19228 } 19229 function dispatchEventForPluginEventSystem( 19230 domEventName, 19231 eventSystemFlags, 19232 nativeEvent, 19233 targetInst$jscomp$0, 19234 targetContainer 19235 ) { 19236 var ancestorInst = targetInst$jscomp$0; 19237 if ( 19238 0 === (eventSystemFlags & 1) && 19239 0 === (eventSystemFlags & 2) && 19240 null !== targetInst$jscomp$0 19241 ) 19242 a: for (;;) { 19243 if (null === targetInst$jscomp$0) return; 19244 var nodeTag = targetInst$jscomp$0.tag; 19245 if (3 === nodeTag || 4 === nodeTag) { 19246 var container = targetInst$jscomp$0.stateNode.containerInfo; 19247 if (container === targetContainer) break; 19248 if (4 === nodeTag) 19249 for (nodeTag = targetInst$jscomp$0.return; null !== nodeTag; ) { 19250 var grandTag = nodeTag.tag; 19251 if ( 19252 (3 === grandTag || 4 === grandTag) && 19253 nodeTag.stateNode.containerInfo === targetContainer 19254 ) 19255 return; 19256 nodeTag = nodeTag.return; 19257 } 19258 for (; null !== container; ) { 19259 nodeTag = getClosestInstanceFromNode(container); 19260 if (null === nodeTag) return; 19261 grandTag = nodeTag.tag; 19262 if ( 19263 5 === grandTag || 19264 6 === grandTag || 19265 26 === grandTag || 19266 27 === grandTag 19267 ) { 19268 targetInst$jscomp$0 = ancestorInst = nodeTag; 19269 continue a; 19270 } 19271 container = container.parentNode; 19272 } 19273 } 19274 targetInst$jscomp$0 = targetInst$jscomp$0.return; 19275 } 19276 batchedUpdates$1(function () { 19277 var targetInst = ancestorInst, 19278 nativeEventTarget = getEventTarget(nativeEvent), 19279 dispatchQueue = []; 19280 a: { 19281 var reactName = topLevelEventsToReactNames.get(domEventName); 19282 if (void 0 !== reactName) { 19283 var SyntheticEventCtor = SyntheticEvent, 19284 reactEventType = domEventName; 19285 switch (domEventName) { 19286 case "keypress": 19287 if (0 === getEventCharCode(nativeEvent)) break a; 19288 case "keydown": 19289 case "keyup": 19290 SyntheticEventCtor = SyntheticKeyboardEvent; 19291 break; 19292 case "focusin": 19293 reactEventType = "focus"; 19294 SyntheticEventCtor = SyntheticFocusEvent; 19295 break; 19296 case "focusout": 19297 reactEventType = "blur"; 19298 SyntheticEventCtor = SyntheticFocusEvent; 19299 break; 19300 case "beforeblur": 19301 case "afterblur": 19302 SyntheticEventCtor = SyntheticFocusEvent; 19303 break; 19304 case "click": 19305 if (2 === nativeEvent.button) break a; 19306 case "auxclick": 19307 case "dblclick": 19308 case "mousedown": 19309 case "mousemove": 19310 case "mouseup": 19311 case "mouseout": 19312 case "mouseover": 19313 case "contextmenu": 19314 SyntheticEventCtor = SyntheticMouseEvent; 19315 break; 19316 case "drag": 19317 case "dragend": 19318 case "dragenter": 19319 case "dragexit": 19320 case "dragleave": 19321 case "dragover": 19322 case "dragstart": 19323 case "drop": 19324 SyntheticEventCtor = SyntheticDragEvent; 19325 break; 19326 case "touchcancel": 19327 case "touchend": 19328 case "touchmove": 19329 case "touchstart": 19330 SyntheticEventCtor = SyntheticTouchEvent; 19331 break; 19332 case ANIMATION_END: 19333 case ANIMATION_ITERATION: 19334 case ANIMATION_START: 19335 SyntheticEventCtor = SyntheticAnimationEvent; 19336 break; 19337 case TRANSITION_END: 19338 SyntheticEventCtor = SyntheticTransitionEvent; 19339 break; 19340 case "scroll": 19341 case "scrollend": 19342 SyntheticEventCtor = SyntheticUIEvent; 19343 break; 19344 case "wheel": 19345 SyntheticEventCtor = SyntheticWheelEvent; 19346 break; 19347 case "copy": 19348 case "cut": 19349 case "paste": 19350 SyntheticEventCtor = SyntheticClipboardEvent; 19351 break; 19352 case "gotpointercapture": 19353 case "lostpointercapture": 19354 case "pointercancel": 19355 case "pointerdown": 19356 case "pointermove": 19357 case "pointerout": 19358 case "pointerover": 19359 case "pointerup": 19360 SyntheticEventCtor = SyntheticPointerEvent; 19361 break; 19362 case "toggle": 19363 case "beforetoggle": 19364 SyntheticEventCtor = SyntheticToggleEvent; 19365 } 19366 var inCapturePhase = 0 !== (eventSystemFlags & 4), 19367 accumulateTargetOnly = 19368 !inCapturePhase && 19369 ("scroll" === domEventName || "scrollend" === domEventName), 19370 reactEventName = inCapturePhase 19371 ? null !== reactName 19372 ? reactName + "Capture" 19373 : null 19374 : reactName; 19375 inCapturePhase = []; 19376 for ( 19377 var instance = targetInst, lastHostComponent; 19378 null !== instance; 19379 19380 ) { 19381 var _instance = instance; 19382 lastHostComponent = _instance.stateNode; 19383 _instance = _instance.tag; 19384 (5 !== _instance && 26 !== _instance && 27 !== _instance) || 19385 null === lastHostComponent || 19386 null === reactEventName || 19387 ((_instance = getListener(instance, reactEventName)), 19388 null != _instance && 19389 inCapturePhase.push( 19390 createDispatchListener(instance, _instance, lastHostComponent) 19391 )); 19392 if (accumulateTargetOnly) break; 19393 instance = instance.return; 19394 } 19395 0 < inCapturePhase.length && 19396 ((reactName = new SyntheticEventCtor( 19397 reactName, 19398 reactEventType, 19399 null, 19400 nativeEvent, 19401 nativeEventTarget 19402 )), 19403 dispatchQueue.push({ event: reactName, listeners: inCapturePhase })); 19404 } 19405 } 19406 if (0 === (eventSystemFlags & 7)) { 19407 a: { 19408 reactName = 19409 "mouseover" === domEventName || "pointerover" === domEventName; 19410 SyntheticEventCtor = 19411 "mouseout" === domEventName || "pointerout" === domEventName; 19412 if ( 19413 reactName && 19414 nativeEvent !== currentReplayingEvent && 19415 (reactEventType = 19416 nativeEvent.relatedTarget || nativeEvent.fromElement) && 19417 (getClosestInstanceFromNode(reactEventType) || 19418 reactEventType[internalContainerInstanceKey]) 19419 ) 19420 break a; 19421 if (SyntheticEventCtor || reactName) { 19422 reactName = 19423 nativeEventTarget.window === nativeEventTarget 19424 ? nativeEventTarget 19425 : (reactName = nativeEventTarget.ownerDocument) 19426 ? reactName.defaultView || reactName.parentWindow 19427 : window; 19428 if (SyntheticEventCtor) { 19429 if ( 19430 ((reactEventType = 19431 nativeEvent.relatedTarget || nativeEvent.toElement), 19432 (SyntheticEventCtor = targetInst), 19433 (reactEventType = reactEventType 19434 ? getClosestInstanceFromNode(reactEventType) 19435 : null),
vendor: 9,978 bytes, lines 19436-19687
19436 null !== reactEventType && 19437 ((accumulateTargetOnly = 19438 getNearestMountedFiber(reactEventType)), 19439 (inCapturePhase = reactEventType.tag), 19440 reactEventType !== accumulateTargetOnly || 19441 (5 !== inCapturePhase && 19442 27 !== inCapturePhase && 19443 6 !== inCapturePhase))) 19444 ) 19445 reactEventType = null; 19446 } else (SyntheticEventCtor = null), (reactEventType = targetInst); 19447 if (SyntheticEventCtor !== reactEventType) { 19448 inCapturePhase = SyntheticMouseEvent; 19449 _instance = "onMouseLeave"; 19450 reactEventName = "onMouseEnter"; 19451 instance = "mouse"; 19452 if ("pointerout" === domEventName || "pointerover" === domEventName) 19453 (inCapturePhase = SyntheticPointerEvent), 19454 (_instance = "onPointerLeave"), 19455 (reactEventName = "onPointerEnter"), 19456 (instance = "pointer"); 19457 accumulateTargetOnly = 19458 null == SyntheticEventCtor 19459 ? reactName 19460 : getNodeFromInstance(SyntheticEventCtor); 19461 lastHostComponent = 19462 null == reactEventType 19463 ? reactName 19464 : getNodeFromInstance(reactEventType); 19465 reactName = new inCapturePhase( 19466 _instance, 19467 instance + "leave", 19468 SyntheticEventCtor, 19469 nativeEvent, 19470 nativeEventTarget 19471 ); 19472 reactName.target = accumulateTargetOnly; 19473 reactName.relatedTarget = lastHostComponent; 19474 _instance = null; 19475 getClosestInstanceFromNode(nativeEventTarget) === targetInst && 19476 ((inCapturePhase = new inCapturePhase( 19477 reactEventName, 19478 instance + "enter", 19479 reactEventType, 19480 nativeEvent, 19481 nativeEventTarget 19482 )), 19483 (inCapturePhase.target = lastHostComponent), 19484 (inCapturePhase.relatedTarget = accumulateTargetOnly), 19485 (_instance = inCapturePhase)); 19486 accumulateTargetOnly = _instance; 19487 if (SyntheticEventCtor && reactEventType) 19488 b: { 19489 inCapturePhase = getParent; 19490 reactEventName = SyntheticEventCtor; 19491 instance = reactEventType; 19492 lastHostComponent = 0; 19493 for ( 19494 _instance = reactEventName; 19495 _instance; 19496 _instance = inCapturePhase(_instance) 19497 ) 19498 lastHostComponent++; 19499 _instance = 0; 19500 for (var tempB = instance; tempB; tempB = inCapturePhase(tempB)) 19501 _instance++; 19502 for (; 0 < lastHostComponent - _instance; ) 19503 (reactEventName = inCapturePhase(reactEventName)), 19504 lastHostComponent--; 19505 for (; 0 < _instance - lastHostComponent; ) 19506 (instance = inCapturePhase(instance)), _instance--; 19507 for (; lastHostComponent--; ) { 19508 if ( 19509 reactEventName === instance || 19510 (null !== instance && reactEventName === instance.alternate) 19511 ) { 19512 inCapturePhase = reactEventName; 19513 break b; 19514 } 19515 reactEventName = inCapturePhase(reactEventName); 19516 instance = inCapturePhase(instance); 19517 } 19518 inCapturePhase = null; 19519 } 19520 else inCapturePhase = null; 19521 null !== SyntheticEventCtor && 19522 accumulateEnterLeaveListenersForEvent( 19523 dispatchQueue, 19524 reactName, 19525 SyntheticEventCtor, 19526 inCapturePhase, 19527 !1 19528 ); 19529 null !== reactEventType && 19530 null !== accumulateTargetOnly && 19531 accumulateEnterLeaveListenersForEvent( 19532 dispatchQueue, 19533 accumulateTargetOnly, 19534 reactEventType, 19535 inCapturePhase, 19536 !0 19537 ); 19538 } 19539 } 19540 } 19541 a: { 19542 reactName = targetInst ? getNodeFromInstance(targetInst) : window; 19543 SyntheticEventCtor = 19544 reactName.nodeName && reactName.nodeName.toLowerCase(); 19545 if ( 19546 "select" === SyntheticEventCtor || 19547 ("input" === SyntheticEventCtor && "file" === reactName.type) 19548 ) 19549 var getTargetInstFunc = getTargetInstForChangeEvent; 19550 else if (isTextInputElement(reactName)) 19551 if (isInputEventSupported) 19552 getTargetInstFunc = getTargetInstForInputOrChangeEvent; 19553 else { 19554 getTargetInstFunc = getTargetInstForInputEventPolyfill; 19555 var handleEventFunc = handleEventsForInputEventPolyfill; 19556 } 19557 else 19558 (SyntheticEventCtor = reactName.nodeName), 19559 !SyntheticEventCtor || 19560 "input" !== SyntheticEventCtor.toLowerCase() || 19561 ("checkbox" !== reactName.type && "radio" !== reactName.type) 19562 ? targetInst && 19563 isCustomElement(targetInst.elementType) && 19564 (getTargetInstFunc = getTargetInstForChangeEvent) 19565 : (getTargetInstFunc = getTargetInstForClickEvent); 19566 if ( 19567 getTargetInstFunc && 19568 (getTargetInstFunc = getTargetInstFunc(domEventName, targetInst)) 19569 ) { 19570 createAndAccumulateChangeEvent( 19571 dispatchQueue, 19572 getTargetInstFunc, 19573 nativeEvent, 19574 nativeEventTarget 19575 ); 19576 break a; 19577 } 19578 handleEventFunc && handleEventFunc(domEventName, reactName, targetInst); 19579 "focusout" === domEventName && 19580 targetInst && 19581 "number" === reactName.type && 19582 null != targetInst.memoizedProps.value && 19583 setDefaultValue(reactName, "number", reactName.value); 19584 } 19585 handleEventFunc = targetInst ? getNodeFromInstance(targetInst) : window; 19586 switch (domEventName) { 19587 case "focusin": 19588 if ( 19589 isTextInputElement(handleEventFunc) || 19590 "true" === handleEventFunc.contentEditable 19591 ) 19592 (activeElement = handleEventFunc), 19593 (activeElementInst = targetInst), 19594 (lastSelection = null); 19595 break; 19596 case "focusout": 19597 lastSelection = activeElementInst = activeElement = null; 19598 break; 19599 case "mousedown": 19600 mouseDown = !0; 19601 break; 19602 case "contextmenu": 19603 case "mouseup": 19604 case "dragend": 19605 mouseDown = !1; 19606 constructSelectEvent(dispatchQueue, nativeEvent, nativeEventTarget); 19607 break; 19608 case "selectionchange": 19609 if (skipSelectionChangeEvent) break; 19610 case "keydown": 19611 case "keyup": 19612 constructSelectEvent(dispatchQueue, nativeEvent, nativeEventTarget); 19613 } 19614 var fallbackData; 19615 if (canUseCompositionEvent) 19616 b: { 19617 switch (domEventName) { 19618 case "compositionstart": 19619 var eventType = "onCompositionStart"; 19620 break b; 19621 case "compositionend": 19622 eventType = "onCompositionEnd"; 19623 break b; 19624 case "compositionupdate": 19625 eventType = "onCompositionUpdate"; 19626 break b; 19627 } 19628 eventType = void 0; 19629 } 19630 else 19631 isComposing 19632 ? isFallbackCompositionEnd(domEventName, nativeEvent) && 19633 (eventType = "onCompositionEnd") 19634 : "keydown" === domEventName && 19635 229 === nativeEvent.keyCode && 19636 (eventType = "onCompositionStart"); 19637 eventType && 19638 (useFallbackCompositionData && 19639 "ko" !== nativeEvent.locale && 19640 (isComposing || "onCompositionStart" !== eventType 19641 ? "onCompositionEnd" === eventType && 19642 isComposing && 19643 (fallbackData = getData()) 19644 : ((root = nativeEventTarget), 19645 (startText = "value" in root ? root.value : root.textContent), 19646 (isComposing = !0))), 19647 (handleEventFunc = accumulateTwoPhaseListeners(targetInst, eventType)), 19648 0 < handleEventFunc.length && 19649 ((eventType = new SyntheticCompositionEvent( 19650 eventType, 19651 domEventName, 19652 null, 19653 nativeEvent, 19654 nativeEventTarget 19655 )), 19656 dispatchQueue.push({ event: eventType, listeners: handleEventFunc }), 19657 fallbackData 19658 ? (eventType.data = fallbackData) 19659 : ((fallbackData = getDataFromCustomEvent(nativeEvent)), 19660 null !== fallbackData && (eventType.data = fallbackData)))); 19661 if ( 19662 (fallbackData = canUseTextInputEvent 19663 ? getNativeBeforeInputChars(domEventName, nativeEvent) 19664 : getFallbackBeforeInputChars(domEventName, nativeEvent)) 19665 ) 19666 (eventType = accumulateTwoPhaseListeners(targetInst, "onBeforeInput")), 19667 0 < eventType.length && 19668 ((handleEventFunc = new SyntheticCompositionEvent( 19669 "onBeforeInput", 19670 "beforeinput", 19671 null, 19672 nativeEvent, 19673 nativeEventTarget 19674 )), 19675 dispatchQueue.push({ 19676 event: handleEventFunc, 19677 listeners: eventType 19678 }), 19679 (handleEventFunc.data = fallbackData)); 19680 extractEvents$1( 19681 dispatchQueue, 19682 domEventName, 19683 targetInst, 19684 nativeEvent, 19685 nativeEventTarget 19686 ); 19687 }
vendor: 99,975 bytes, lines 19688-22740
19688 processDispatchQueue(dispatchQueue, eventSystemFlags); 19689 }); 19690 } 19691 function createDispatchListener(instance, listener, currentTarget) { 19692 return { 19693 instance: instance, 19694 listener: listener, 19695 currentTarget: currentTarget 19696 }; 19697 } 19698 function accumulateTwoPhaseListeners(targetFiber, reactName) { 19699 for ( 19700 var captureName = reactName + "Capture", listeners = []; 19701 null !== targetFiber; 19702 19703 ) { 19704 var _instance2 = targetFiber, 19705 stateNode = _instance2.stateNode; 19706 _instance2 = _instance2.tag; 19707 (5 !== _instance2 && 26 !== _instance2 && 27 !== _instance2) || 19708 null === stateNode || 19709 ((_instance2 = getListener(targetFiber, captureName)), 19710 null != _instance2 && 19711 listeners.unshift( 19712 createDispatchListener(targetFiber, _instance2, stateNode) 19713 ), 19714 (_instance2 = getListener(targetFiber, reactName)), 19715 null != _instance2 && 19716 listeners.push( 19717 createDispatchListener(targetFiber, _instance2, stateNode) 19718 )); 19719 if (3 === targetFiber.tag) return listeners; 19720 targetFiber = targetFiber.return; 19721 } 19722 return []; 19723 } 19724 function getParent(inst) { 19725 if (null === inst) return null; 19726 do inst = inst.return; 19727 while (inst && 5 !== inst.tag && 27 !== inst.tag); 19728 return inst ? inst : null; 19729 } 19730 function accumulateEnterLeaveListenersForEvent( 19731 dispatchQueue, 19732 event, 19733 target, 19734 common, 19735 inCapturePhase 19736 ) { 19737 for ( 19738 var registrationName = event._reactName, listeners = []; 19739 null !== target && target !== common; 19740 19741 ) { 19742 var _instance3 = target, 19743 alternate = _instance3.alternate, 19744 stateNode = _instance3.stateNode; 19745 _instance3 = _instance3.tag; 19746 if (null !== alternate && alternate === common) break; 19747 (5 !== _instance3 && 26 !== _instance3 && 27 !== _instance3) || 19748 null === stateNode || 19749 ((alternate = stateNode), 19750 inCapturePhase 19751 ? ((stateNode = getListener(target, registrationName)), 19752 null != stateNode && 19753 listeners.unshift( 19754 createDispatchListener(target, stateNode, alternate) 19755 )) 19756 : inCapturePhase || 19757 ((stateNode = getListener(target, registrationName)), 19758 null != stateNode && 19759 listeners.push( 19760 createDispatchListener(target, stateNode, alternate) 19761 ))); 19762 target = target.return; 19763 } 19764 0 !== listeners.length && 19765 dispatchQueue.push({ event: event, listeners: listeners }); 19766 } 19767 var NORMALIZE_NEWLINES_REGEX = /\r\n?/g, 19768 NORMALIZE_NULL_AND_REPLACEMENT_REGEX = /\u0000|\uFFFD/g; 19769 function normalizeMarkupForTextOrAttribute(markup) { 19770 return ("string" === typeof markup ? markup : "" + markup) 19771 .replace(NORMALIZE_NEWLINES_REGEX, "\n") 19772 .replace(NORMALIZE_NULL_AND_REPLACEMENT_REGEX, ""); 19773 } 19774 function checkForUnmatchedText(serverText, clientText) { 19775 clientText = normalizeMarkupForTextOrAttribute(clientText); 19776 return normalizeMarkupForTextOrAttribute(serverText) === clientText ? true : false; 19777 } 19778 function setProp(domElement, tag, key, value, props, prevValue) { 19779 switch (key) { 19780 case "children": 19781 "string" === typeof value 19782 ? "body" === tag || 19783 ("textarea" === tag && "" === value) || 19784 setTextContent(domElement, value) 19785 : ("number" === typeof value || "bigint" === typeof value) && 19786 "body" !== tag && 19787 setTextContent(domElement, "" + value); 19788 break; 19789 case "className": 19790 setValueForKnownAttribute(domElement, "class", value); 19791 break; 19792 case "tabIndex": 19793 setValueForKnownAttribute(domElement, "tabindex", value); 19794 break; 19795 case "dir": 19796 case "role": 19797 case "viewBox": 19798 case "width": 19799 case "height": 19800 setValueForKnownAttribute(domElement, key, value); 19801 break; 19802 case "style": 19803 setValueForStyles(domElement, value, prevValue); 19804 break; 19805 case "data": 19806 if ("object" !== tag) { 19807 setValueForKnownAttribute(domElement, "data", value); 19808 break; 19809 } 19810 case "src": 19811 case "href": 19812 if ("" === value && ("a" !== tag || "href" !== key)) { 19813 domElement.removeAttribute(key); 19814 break; 19815 } 19816 if ( 19817 null == value || 19818 "function" === typeof value || 19819 "symbol" === typeof value || 19820 "boolean" === typeof value 19821 ) { 19822 domElement.removeAttribute(key); 19823 break; 19824 } 19825 value = sanitizeURL("" + value); 19826 domElement.setAttribute(key, value); 19827 break; 19828 case "action": 19829 case "formAction": 19830 if ("function" === typeof value) { 19831 domElement.setAttribute( 19832 key, 19833 "javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')" 19834 ); 19835 break; 19836 } else 19837 "function" === typeof prevValue && 19838 ("formAction" === key 19839 ? ("input" !== tag && 19840 setProp(domElement, tag, "name", props.name, props, null), 19841 setProp( 19842 domElement, 19843 tag, 19844 "formEncType", 19845 props.formEncType, 19846 props, 19847 null 19848 ), 19849 setProp( 19850 domElement, 19851 tag, 19852 "formMethod", 19853 props.formMethod, 19854 props, 19855 null 19856 ), 19857 setProp( 19858 domElement, 19859 tag, 19860 "formTarget", 19861 props.formTarget, 19862 props, 19863 null 19864 )) 19865 : (setProp(domElement, tag, "encType", props.encType, props, null), 19866 setProp(domElement, tag, "method", props.method, props, null), 19867 setProp(domElement, tag, "target", props.target, props, null))); 19868 if ( 19869 null == value || 19870 "symbol" === typeof value || 19871 "boolean" === typeof value 19872 ) { 19873 domElement.removeAttribute(key); 19874 break; 19875 } 19876 value = sanitizeURL("" + value); 19877 domElement.setAttribute(key, value); 19878 break; 19879 case "onClick": 19880 null != value && (domElement.onclick = noop$1); 19881 break; 19882 case "onScroll": 19883 null != value && listenToNonDelegatedEvent("scroll", domElement); 19884 break; 19885 case "onScrollEnd": 19886 null != value && listenToNonDelegatedEvent("scrollend", domElement); 19887 break; 19888 case "dangerouslySetInnerHTML": 19889 if (null != value) { 19890 if ("object" !== typeof value || !("__html" in value)) 19891 throw Error(formatProdErrorMessage(61)); 19892 key = value.__html; 19893 if (null != key) { 19894 if (null != props.children) throw Error(formatProdErrorMessage(60)); 19895 domElement.innerHTML = key; 19896 } 19897 } 19898 break; 19899 case "multiple": 19900 domElement.multiple = 19901 value && "function" !== typeof value && "symbol" !== typeof value; 19902 break; 19903 case "muted": 19904 domElement.muted = 19905 value && "function" !== typeof value && "symbol" !== typeof value; 19906 break; 19907 case "suppressContentEditableWarning": 19908 case "suppressHydrationWarning": 19909 case "defaultValue": 19910 case "defaultChecked": 19911 case "innerHTML": 19912 case "ref": 19913 break; 19914 case "autoFocus": 19915 break; 19916 case "xlinkHref": 19917 if ( 19918 null == value || 19919 "function" === typeof value || 19920 "boolean" === typeof value || 19921 "symbol" === typeof value 19922 ) { 19923 domElement.removeAttribute("xlink:href"); 19924 break; 19925 } 19926 key = sanitizeURL("" + value); 19927 domElement.setAttributeNS( 19928 "http://www.w3.org/1999/xlink", 19929 "xlink:href", 19930 key 19931 ); 19932 break; 19933 case "contentEditable": 19934 case "spellCheck": 19935 case "draggable": 19936 case "value": 19937 case "autoReverse": 19938 case "externalResourcesRequired": 19939 case "focusable": 19940 case "preserveAlpha": 19941 null != value && "function" !== typeof value && "symbol" !== typeof value 19942 ? domElement.setAttribute(key, "" + value) 19943 : domElement.removeAttribute(key); 19944 break; 19945 case "inert": 19946 case "allowFullScreen": 19947 case "async": 19948 case "autoPlay": 19949 case "controls": 19950 case "default": 19951 case "defer": 19952 case "disabled": 19953 case "disablePictureInPicture": 19954 case "disableRemotePlayback": 19955 case "formNoValidate": 19956 case "hidden": 19957 case "loop": 19958 case "noModule": 19959 case "noValidate": 19960 case "open": 19961 case "playsInline": 19962 case "readOnly": 19963 case "required": 19964 case "reversed": 19965 case "scoped": 19966 case "seamless": 19967 case "itemScope": 19968 value && "function" !== typeof value && "symbol" !== typeof value 19969 ? domElement.setAttribute(key, "") 19970 : domElement.removeAttribute(key); 19971 break; 19972 case "capture": 19973 case "download": 19974 true === value 19975 ? domElement.setAttribute(key, "") 19976 : false !== value && 19977 null != value && 19978 "function" !== typeof value && 19979 "symbol" !== typeof value 19980 ? domElement.setAttribute(key, value) 19981 : domElement.removeAttribute(key); 19982 break; 19983 case "cols": 19984 case "rows": 19985 case "size": 19986 case "span": 19987 null != value && 19988 "function" !== typeof value && 19989 "symbol" !== typeof value && 19990 !isNaN(value) && 19991 1 <= value 19992 ? domElement.setAttribute(key, value) 19993 : domElement.removeAttribute(key); 19994 break; 19995 case "rowSpan": 19996 case "start": 19997 null == value || 19998 "function" === typeof value || 19999 "symbol" === typeof value || 20000 isNaN(value) 20001 ? domElement.removeAttribute(key) 20002 : domElement.setAttribute(key, value); 20003 break; 20004 case "popover": 20005 listenToNonDelegatedEvent("beforetoggle", domElement); 20006 listenToNonDelegatedEvent("toggle", domElement); 20007 setValueForAttribute(domElement, "popover", value); 20008 break; 20009 case "xlinkActuate": 20010 setValueForNamespacedAttribute( 20011 domElement, 20012 "http://www.w3.org/1999/xlink", 20013 "xlink:actuate", 20014 value 20015 ); 20016 break; 20017 case "xlinkArcrole": 20018 setValueForNamespacedAttribute( 20019 domElement, 20020 "http://www.w3.org/1999/xlink", 20021 "xlink:arcrole", 20022 value 20023 ); 20024 break; 20025 case "xlinkRole": 20026 setValueForNamespacedAttribute( 20027 domElement, 20028 "http://www.w3.org/1999/xlink", 20029 "xlink:role", 20030 value 20031 ); 20032 break; 20033 case "xlinkShow": 20034 setValueForNamespacedAttribute( 20035 domElement, 20036 "http://www.w3.org/1999/xlink", 20037 "xlink:show", 20038 value 20039 ); 20040 break; 20041 case "xlinkTitle": 20042 setValueForNamespacedAttribute( 20043 domElement, 20044 "http://www.w3.org/1999/xlink", 20045 "xlink:title", 20046 value 20047 ); 20048 break; 20049 case "xlinkType": 20050 setValueForNamespacedAttribute( 20051 domElement, 20052 "http://www.w3.org/1999/xlink", 20053 "xlink:type", 20054 value 20055 ); 20056 break; 20057 case "xmlBase": 20058 setValueForNamespacedAttribute( 20059 domElement, 20060 "http://www.w3.org/XML/1998/namespace", 20061 "xml:base", 20062 value 20063 ); 20064 break; 20065 case "xmlLang": 20066 setValueForNamespacedAttribute( 20067 domElement, 20068 "http://www.w3.org/XML/1998/namespace", 20069 "xml:lang", 20070 value 20071 ); 20072 break; 20073 case "xmlSpace": 20074 setValueForNamespacedAttribute( 20075 domElement, 20076 "http://www.w3.org/XML/1998/namespace", 20077 "xml:space", 20078 value 20079 ); 20080 break; 20081 case "is": 20082 setValueForAttribute(domElement, "is", value); 20083 break; 20084 case "innerText": 20085 case "textContent": 20086 break; 20087 default: 20088 if ( 20089 !(2 < key.length) || 20090 ("o" !== key[0] && "O" !== key[0]) || 20091 ("n" !== key[1] && "N" !== key[1]) 20092 ) 20093 (key = aliases.get(key) || key), 20094 setValueForAttribute(domElement, key, value); 20095 } 20096 } 20097 function setPropOnCustomElement(domElement, tag, key, value, props, prevValue) { 20098 switch (key) { 20099 case "style": 20100 setValueForStyles(domElement, value, prevValue); 20101 break; 20102 case "dangerouslySetInnerHTML": 20103 if (null != value) { 20104 if ("object" !== typeof value || !("__html" in value)) 20105 throw Error(formatProdErrorMessage(61)); 20106 key = value.__html; 20107 if (null != key) { 20108 if (null != props.children) throw Error(formatProdErrorMessage(60)); 20109 domElement.innerHTML = key; 20110 } 20111 } 20112 break; 20113 case "children": 20114 "string" === typeof value 20115 ? setTextContent(domElement, value) 20116 : ("number" === typeof value || "bigint" === typeof value) && 20117 setTextContent(domElement, "" + value); 20118 break; 20119 case "onScroll": 20120 null != value && listenToNonDelegatedEvent("scroll", domElement); 20121 break; 20122 case "onScrollEnd": 20123 null != value && listenToNonDelegatedEvent("scrollend", domElement); 20124 break; 20125 case "onClick": 20126 null != value && (domElement.onclick = noop$1); 20127 break; 20128 case "suppressContentEditableWarning": 20129 case "suppressHydrationWarning": 20130 case "innerHTML": 20131 case "ref": 20132 break; 20133 case "innerText": 20134 case "textContent": 20135 break; 20136 default: 20137 if (!registrationNameDependencies.hasOwnProperty(key)) 20138 a: { 20139 if ( 20140 "o" === key[0] && 20141 "n" === key[1] && 20142 ((props = key.endsWith("Capture")), 20143 (tag = key.slice(2, props ? key.length - 7 : void 0)), 20144 (prevValue = domElement[internalPropsKey] || null), 20145 (prevValue = null != prevValue ? prevValue[key] : null), 20146 "function" === typeof prevValue && 20147 domElement.removeEventListener(tag, prevValue, props), 20148 "function" === typeof value) 20149 ) { 20150 "function" !== typeof prevValue && 20151 null !== prevValue && 20152 (key in domElement 20153 ? (domElement[key] = null) 20154 : domElement.hasAttribute(key) && 20155 domElement.removeAttribute(key)); 20156 domElement.addEventListener(tag, value, props); 20157 break a; 20158 } 20159 key in domElement 20160 ? (domElement[key] = value) 20161 : true === value 20162 ? domElement.setAttribute(key, "") 20163 : setValueForAttribute(domElement, key, value); 20164 } 20165 } 20166 } 20167 function setInitialProperties(domElement, tag, props) { 20168 switch (tag) { 20169 case "div": 20170 case "span": 20171 case "svg": 20172 case "path": 20173 case "a": 20174 case "g": 20175 case "p": 20176 case "li": 20177 break; 20178 case "img": 20179 listenToNonDelegatedEvent("error", domElement); 20180 listenToNonDelegatedEvent("load", domElement); 20181 var hasSrc = false, 20182 hasSrcSet = false, 20183 propKey; 20184 for (propKey in props) 20185 if (props.hasOwnProperty(propKey)) { 20186 var propValue = props[propKey]; 20187 if (null != propValue) 20188 switch (propKey) { 20189 case "src": 20190 hasSrc = true; 20191 break; 20192 case "srcSet": 20193 hasSrcSet = true; 20194 break; 20195 case "children": 20196 case "dangerouslySetInnerHTML": 20197 throw Error(formatProdErrorMessage(137, tag)); 20198 default: 20199 setProp(domElement, tag, propKey, propValue, props, null); 20200 } 20201 } 20202 hasSrcSet && 20203 setProp(domElement, tag, "srcSet", props.srcSet, props, null); 20204 hasSrc && setProp(domElement, tag, "src", props.src, props, null); 20205 return; 20206 case "input": 20207 listenToNonDelegatedEvent("invalid", domElement); 20208 var defaultValue = (propKey = propValue = hasSrcSet = null), 20209 checked = null, 20210 defaultChecked = null; 20211 for (hasSrc in props) 20212 if (props.hasOwnProperty(hasSrc)) { 20213 var propValue$184 = props[hasSrc]; 20214 if (null != propValue$184) 20215 switch (hasSrc) { 20216 case "name": 20217 hasSrcSet = propValue$184; 20218 break; 20219 case "type": 20220 propValue = propValue$184; 20221 break; 20222 case "checked": 20223 checked = propValue$184; 20224 break; 20225 case "defaultChecked": 20226 defaultChecked = propValue$184; 20227 break; 20228 case "value": 20229 propKey = propValue$184; 20230 break; 20231 case "defaultValue": 20232 defaultValue = propValue$184; 20233 break; 20234 case "children": 20235 case "dangerouslySetInnerHTML": 20236 if (null != propValue$184) 20237 throw Error(formatProdErrorMessage(137, tag)); 20238 break; 20239 default: 20240 setProp(domElement, tag, hasSrc, propValue$184, props, null); 20241 } 20242 } 20243 initInput( 20244 domElement, 20245 propKey, 20246 defaultValue, 20247 checked, 20248 defaultChecked, 20249 propValue, 20250 hasSrcSet, 20251 false 20252 ); 20253 return; 20254 case "select": 20255 listenToNonDelegatedEvent("invalid", domElement); 20256 hasSrc = propValue = propKey = null; 20257 for (hasSrcSet in props) 20258 if ( 20259 props.hasOwnProperty(hasSrcSet) && 20260 ((defaultValue = props[hasSrcSet]), null != defaultValue) 20261 ) 20262 switch (hasSrcSet) { 20263 case "value": 20264 propKey = defaultValue; 20265 break; 20266 case "defaultValue": 20267 propValue = defaultValue; 20268 break; 20269 case "multiple": 20270 hasSrc = defaultValue; 20271 default: 20272 setProp(domElement, tag, hasSrcSet, defaultValue, props, null); 20273 } 20274 tag = propKey; 20275 props = propValue; 20276 domElement.multiple = !!hasSrc; 20277 null != tag 20278 ? updateOptions(domElement, !!hasSrc, tag, false) 20279 : null != props && updateOptions(domElement, !!hasSrc, props, true); 20280 return; 20281 case "textarea": 20282 listenToNonDelegatedEvent("invalid", domElement); 20283 propKey = hasSrcSet = hasSrc = null; 20284 for (propValue in props) 20285 if ( 20286 props.hasOwnProperty(propValue) && 20287 ((defaultValue = props[propValue]), null != defaultValue) 20288 ) 20289 switch (propValue) { 20290 case "value": 20291 hasSrc = defaultValue; 20292 break; 20293 case "defaultValue": 20294 hasSrcSet = defaultValue; 20295 break; 20296 case "children": 20297 propKey = defaultValue; 20298 break; 20299 case "dangerouslySetInnerHTML": 20300 if (null != defaultValue) throw Error(formatProdErrorMessage(91)); 20301 break; 20302 default: 20303 setProp(domElement, tag, propValue, defaultValue, props, null); 20304 } 20305 initTextarea(domElement, hasSrc, hasSrcSet, propKey); 20306 return; 20307 case "option": 20308 for (checked in props) 20309 if ( 20310 props.hasOwnProperty(checked) && 20311 ((hasSrc = props[checked]), null != hasSrc) 20312 ) 20313 switch (checked) { 20314 case "selected": 20315 domElement.selected = 20316 hasSrc && 20317 "function" !== typeof hasSrc && 20318 "symbol" !== typeof hasSrc; 20319 break; 20320 default: 20321 setProp(domElement, tag, checked, hasSrc, props, null); 20322 } 20323 return; 20324 case "dialog": 20325 listenToNonDelegatedEvent("beforetoggle", domElement); 20326 listenToNonDelegatedEvent("toggle", domElement); 20327 listenToNonDelegatedEvent("cancel", domElement); 20328 listenToNonDelegatedEvent("close", domElement); 20329 break; 20330 case "iframe": 20331 case "object": 20332 listenToNonDelegatedEvent("load", domElement); 20333 break; 20334 case "video": 20335 case "audio": 20336 for (hasSrc = 0; hasSrc < mediaEventTypes.length; hasSrc++) 20337 listenToNonDelegatedEvent(mediaEventTypes[hasSrc], domElement); 20338 break; 20339 case "image": 20340 listenToNonDelegatedEvent("error", domElement); 20341 listenToNonDelegatedEvent("load", domElement); 20342 break; 20343 case "details": 20344 listenToNonDelegatedEvent("toggle", domElement); 20345 break; 20346 case "embed": 20347 case "source": 20348 case "link": 20349 listenToNonDelegatedEvent("error", domElement), 20350 listenToNonDelegatedEvent("load", domElement); 20351 case "area": 20352 case "base": 20353 case "br": 20354 case "col": 20355 case "hr": 20356 case "keygen": 20357 case "meta": 20358 case "param": 20359 case "track": 20360 case "wbr": 20361 case "menuitem": 20362 for (defaultChecked in props) 20363 if ( 20364 props.hasOwnProperty(defaultChecked) && 20365 ((hasSrc = props[defaultChecked]), null != hasSrc) 20366 ) 20367 switch (defaultChecked) { 20368 case "children": 20369 case "dangerouslySetInnerHTML": 20370 throw Error(formatProdErrorMessage(137, tag)); 20371 default: 20372 setProp(domElement, tag, defaultChecked, hasSrc, props, null); 20373 } 20374 return; 20375 default: 20376 if (isCustomElement(tag)) { 20377 for (propValue$184 in props) 20378 props.hasOwnProperty(propValue$184) && 20379 ((hasSrc = props[propValue$184]), 20380 void 0 !== hasSrc && 20381 setPropOnCustomElement( 20382 domElement, 20383 tag, 20384 propValue$184, 20385 hasSrc, 20386 props, 20387 void 0 20388 )); 20389 return; 20390 } 20391 } 20392 for (defaultValue in props) 20393 props.hasOwnProperty(defaultValue) && 20394 ((hasSrc = props[defaultValue]), 20395 null != hasSrc && 20396 setProp(domElement, tag, defaultValue, hasSrc, props, null)); 20397 } 20398 function updateProperties(domElement, tag, lastProps, nextProps) { 20399 switch (tag) { 20400 case "div": 20401 case "span": 20402 case "svg": 20403 case "path": 20404 case "a": 20405 case "g": 20406 case "p": 20407 case "li": 20408 break; 20409 case "input": 20410 var name = null, 20411 type = null, 20412 value = null, 20413 defaultValue = null, 20414 lastDefaultValue = null, 20415 checked = null, 20416 defaultChecked = null; 20417 for (propKey in lastProps) { 20418 var lastProp = lastProps[propKey]; 20419 if (lastProps.hasOwnProperty(propKey) && null != lastProp) 20420 switch (propKey) { 20421 case "checked": 20422 break; 20423 case "value": 20424 break; 20425 case "defaultValue": 20426 lastDefaultValue = lastProp; 20427 default: 20428 nextProps.hasOwnProperty(propKey) || 20429 setProp(domElement, tag, propKey, null, nextProps, lastProp); 20430 } 20431 } 20432 for (var propKey$201 in nextProps) { 20433 var propKey = nextProps[propKey$201]; 20434 lastProp = lastProps[propKey$201]; 20435 if ( 20436 nextProps.hasOwnProperty(propKey$201) && 20437 (null != propKey || null != lastProp) 20438 ) 20439 switch (propKey$201) { 20440 case "type": 20441 type = propKey; 20442 break; 20443 case "name": 20444 name = propKey; 20445 break; 20446 case "checked": 20447 checked = propKey; 20448 break; 20449 case "defaultChecked": 20450 defaultChecked = propKey; 20451 break; 20452 case "value": 20453 value = propKey; 20454 break; 20455 case "defaultValue": 20456 defaultValue = propKey; 20457 break; 20458 case "children": 20459 case "dangerouslySetInnerHTML": 20460 if (null != propKey) 20461 throw Error(formatProdErrorMessage(137, tag)); 20462 break; 20463 default: 20464 propKey !== lastProp && 20465 setProp( 20466 domElement, 20467 tag, 20468 propKey$201, 20469 propKey, 20470 nextProps, 20471 lastProp 20472 ); 20473 } 20474 } 20475 updateInput( 20476 domElement, 20477 value, 20478 defaultValue, 20479 lastDefaultValue, 20480 checked, 20481 defaultChecked, 20482 type, 20483 name 20484 ); 20485 return; 20486 case "select": 20487 propKey = value = defaultValue = propKey$201 = null; 20488 for (type in lastProps) 20489 if ( 20490 ((lastDefaultValue = lastProps[type]), 20491 lastProps.hasOwnProperty(type) && null != lastDefaultValue) 20492 ) 20493 switch (type) { 20494 case "value": 20495 break; 20496 case "multiple": 20497 propKey = lastDefaultValue; 20498 default: 20499 nextProps.hasOwnProperty(type) || 20500 setProp( 20501 domElement, 20502 tag, 20503 type, 20504 null, 20505 nextProps, 20506 lastDefaultValue 20507 ); 20508 } 20509 for (name in nextProps) 20510 if ( 20511 ((type = nextProps[name]), 20512 (lastDefaultValue = lastProps[name]), 20513 nextProps.hasOwnProperty(name) && 20514 (null != type || null != lastDefaultValue)) 20515 ) 20516 switch (name) { 20517 case "value": 20518 propKey$201 = type; 20519 break; 20520 case "defaultValue": 20521 defaultValue = type; 20522 break; 20523 case "multiple": 20524 value = type; 20525 default: 20526 type !== lastDefaultValue && 20527 setProp( 20528 domElement, 20529 tag, 20530 name, 20531 type, 20532 nextProps, 20533 lastDefaultValue 20534 ); 20535 } 20536 tag = defaultValue; 20537 lastProps = value; 20538 nextProps = propKey; 20539 null != propKey$201 20540 ? updateOptions(domElement, !!lastProps, propKey$201, false) 20541 : !!nextProps !== !!lastProps && 20542 (null != tag 20543 ? updateOptions(domElement, !!lastProps, tag, true) 20544 : updateOptions(domElement, !!lastProps, lastProps ? [] : "", false)); 20545 return; 20546 case "textarea": 20547 propKey = propKey$201 = null; 20548 for (defaultValue in lastProps) 20549 if ( 20550 ((name = lastProps[defaultValue]), 20551 lastProps.hasOwnProperty(defaultValue) && 20552 null != name && 20553 !nextProps.hasOwnProperty(defaultValue)) 20554 ) 20555 switch (defaultValue) { 20556 case "value": 20557 break; 20558 case "children": 20559 break; 20560 default: 20561 setProp(domElement, tag, defaultValue, null, nextProps, name); 20562 } 20563 for (value in nextProps) 20564 if ( 20565 ((name = nextProps[value]), 20566 (type = lastProps[value]), 20567 nextProps.hasOwnProperty(value) && (null != name || null != type)) 20568 ) 20569 switch (value) { 20570 case "value": 20571 propKey$201 = name; 20572 break; 20573 case "defaultValue": 20574 propKey = name; 20575 break; 20576 case "children": 20577 break; 20578 case "dangerouslySetInnerHTML": 20579 if (null != name) throw Error(formatProdErrorMessage(91)); 20580 break; 20581 default: 20582 name !== type && 20583 setProp(domElement, tag, value, name, nextProps, type); 20584 } 20585 updateTextarea(domElement, propKey$201, propKey); 20586 return; 20587 case "option": 20588 for (var propKey$217 in lastProps) 20589 if ( 20590 ((propKey$201 = lastProps[propKey$217]), 20591 lastProps.hasOwnProperty(propKey$217) && 20592 null != propKey$201 && 20593 !nextProps.hasOwnProperty(propKey$217)) 20594 ) 20595 switch (propKey$217) { 20596 case "selected": 20597 domElement.selected = false; 20598 break; 20599 default: 20600 setProp( 20601 domElement, 20602 tag, 20603 propKey$217, 20604 null, 20605 nextProps, 20606 propKey$201 20607 ); 20608 } 20609 for (lastDefaultValue in nextProps) 20610 if ( 20611 ((propKey$201 = nextProps[lastDefaultValue]), 20612 (propKey = lastProps[lastDefaultValue]), 20613 nextProps.hasOwnProperty(lastDefaultValue) && 20614 propKey$201 !== propKey && 20615 (null != propKey$201 || null != propKey)) 20616 ) 20617 switch (lastDefaultValue) { 20618 case "selected": 20619 domElement.selected = 20620 propKey$201 && 20621 "function" !== typeof propKey$201 && 20622 "symbol" !== typeof propKey$201; 20623 break; 20624 default: 20625 setProp( 20626 domElement, 20627 tag, 20628 lastDefaultValue, 20629 propKey$201, 20630 nextProps, 20631 propKey 20632 ); 20633 } 20634 return; 20635 case "img": 20636 case "link": 20637 case "area": 20638 case "base": 20639 case "br": 20640 case "col": 20641 case "embed": 20642 case "hr": 20643 case "keygen": 20644 case "meta": 20645 case "param": 20646 case "source": 20647 case "track": 20648 case "wbr": 20649 case "menuitem": 20650 for (var propKey$222 in lastProps) 20651 (propKey$201 = lastProps[propKey$222]), 20652 lastProps.hasOwnProperty(propKey$222) && 20653 null != propKey$201 && 20654 !nextProps.hasOwnProperty(propKey$222) && 20655 setProp(domElement, tag, propKey$222, null, nextProps, propKey$201); 20656 for (checked in nextProps) 20657 if ( 20658 ((propKey$201 = nextProps[checked]), 20659 (propKey = lastProps[checked]), 20660 nextProps.hasOwnProperty(checked) && 20661 propKey$201 !== propKey && 20662 (null != propKey$201 || null != propKey)) 20663 ) 20664 switch (checked) { 20665 case "children": 20666 case "dangerouslySetInnerHTML": 20667 if (null != propKey$201) 20668 throw Error(formatProdErrorMessage(137, tag)); 20669 break; 20670 default: 20671 setProp( 20672 domElement, 20673 tag, 20674 checked, 20675 propKey$201, 20676 nextProps, 20677 propKey 20678 ); 20679 } 20680 return; 20681 default: 20682 if (isCustomElement(tag)) { 20683 for (var propKey$227 in lastProps) 20684 (propKey$201 = lastProps[propKey$227]), 20685 lastProps.hasOwnProperty(propKey$227) && 20686 void 0 !== propKey$201 && 20687 !nextProps.hasOwnProperty(propKey$227) && 20688 setPropOnCustomElement( 20689 domElement, 20690 tag, 20691 propKey$227, 20692 void 0, 20693 nextProps, 20694 propKey$201 20695 ); 20696 for (defaultChecked in nextProps) 20697 (propKey$201 = nextProps[defaultChecked]), 20698 (propKey = lastProps[defaultChecked]), 20699 !nextProps.hasOwnProperty(defaultChecked) || 20700 propKey$201 === propKey || 20701 (void 0 === propKey$201 && void 0 === propKey) || 20702 setPropOnCustomElement( 20703 domElement, 20704 tag, 20705 defaultChecked, 20706 propKey$201, 20707 nextProps, 20708 propKey 20709 ); 20710 return; 20711 } 20712 } 20713 for (var propKey$232 in lastProps) 20714 (propKey$201 = lastProps[propKey$232]), 20715 lastProps.hasOwnProperty(propKey$232) && 20716 null != propKey$201 && 20717 !nextProps.hasOwnProperty(propKey$232) && 20718 setProp(domElement, tag, propKey$232, null, nextProps, propKey$201); 20719 for (lastProp in nextProps) 20720 (propKey$201 = nextProps[lastProp]), 20721 (propKey = lastProps[lastProp]), 20722 !nextProps.hasOwnProperty(lastProp) || 20723 propKey$201 === propKey || 20724 (null == propKey$201 && null == propKey) || 20725 setProp(domElement, tag, lastProp, propKey$201, nextProps, propKey); 20726 } 20727 function isLikelyStaticResource(initiatorType) { 20728 switch (initiatorType) { 20729 case "css": 20730 case "script": 20731 case "font": 20732 case "img": 20733 case "image": 20734 case "input": 20735 case "link": 20736 return true; 20737 default: 20738 return false; 20739 } 20740 } 20741 function estimateBandwidth() { 20742 if ("function" === typeof performance.getEntriesByType) { 20743 for ( 20744 var count = 0, 20745 bits = 0, 20746 resourceEntries = performance.getEntriesByType("resource"), 20747 i = 0; 20748 i < resourceEntries.length; 20749 i++ 20750 ) { 20751 var entry = resourceEntries[i], 20752 transferSize = entry.transferSize, 20753 initiatorType = entry.initiatorType, 20754 duration = entry.duration; 20755 if (transferSize && duration && isLikelyStaticResource(initiatorType)) { 20756 initiatorType = 0; 20757 duration = entry.responseEnd; 20758 for (i += 1; i < resourceEntries.length; i++) { 20759 var overlapEntry = resourceEntries[i], 20760 overlapStartTime = overlapEntry.startTime; 20761 if (overlapStartTime > duration) break; 20762 var overlapTransferSize = overlapEntry.transferSize, 20763 overlapInitiatorType = overlapEntry.initiatorType; 20764 overlapTransferSize && 20765 isLikelyStaticResource(overlapInitiatorType) && 20766 ((overlapEntry = overlapEntry.responseEnd), 20767 (initiatorType += 20768 overlapTransferSize * 20769 (overlapEntry < duration 20770 ? 1 20771 : (duration - overlapStartTime) / 20772 (overlapEntry - overlapStartTime)))); 20773 } 20774 --i; 20775 bits += (8 * (transferSize + initiatorType)) / (entry.duration / 1e3); 20776 count++; 20777 if (10 < count) break; 20778 } 20779 } 20780 if (0 < count) return bits / count / 1e6; 20781 } 20782 return navigator.connection && 20783 ((count = navigator.connection.downlink), "number" === typeof count) 20784 ? count 20785 : 5; 20786 } 20787 var eventsEnabled = null, 20788 selectionInformation = null; 20789 function getOwnerDocumentFromRootContainer(rootContainerElement) { 20790 return 9 === rootContainerElement.nodeType 20791 ? rootContainerElement 20792 : rootContainerElement.ownerDocument; 20793 } 20794 function getOwnHostContext(namespaceURI) { 20795 switch (namespaceURI) { 20796 case "http://www.w3.org/2000/svg": 20797 return 1; 20798 case "http://www.w3.org/1998/Math/MathML": 20799 return 2; 20800 default: 20801 return 0; 20802 } 20803 } 20804 function getChildHostContextProd(parentNamespace, type) { 20805 if (0 === parentNamespace) 20806 switch (type) { 20807 case "svg": 20808 return 1; 20809 case "math": 20810 return 2; 20811 default: 20812 return 0; 20813 } 20814 return 1 === parentNamespace && "foreignObject" === type 20815 ? 0 20816 : parentNamespace; 20817 } 20818 function shouldSetTextContent(type, props) { 20819 return ( 20820 "textarea" === type || 20821 "noscript" === type || 20822 "string" === typeof props.children || 20823 "number" === typeof props.children || 20824 "bigint" === typeof props.children || 20825 ("object" === typeof props.dangerouslySetInnerHTML && 20826 null !== props.dangerouslySetInnerHTML && 20827 null != props.dangerouslySetInnerHTML.__html) 20828 ); 20829 } 20830 var currentPopstateTransitionEvent = null; 20831 function shouldAttemptEagerTransition() { 20832 var event = window.event; 20833 if (event && "popstate" === event.type) { 20834 if (event === currentPopstateTransitionEvent) return false; 20835 currentPopstateTransitionEvent = event; 20836 return true; 20837 } 20838 currentPopstateTransitionEvent = null; 20839 return false; 20840 } 20841 var scheduleTimeout = "function" === typeof setTimeout ? setTimeout : void 0, 20842 cancelTimeout = "function" === typeof clearTimeout ? clearTimeout : void 0, 20843 localPromise = "function" === typeof Promise ? Promise : void 0, 20844 scheduleMicrotask = 20845 "function" === typeof queueMicrotask 20846 ? queueMicrotask 20847 : "undefined" !== typeof localPromise 20848 ? function (callback) { 20849 return localPromise 20850 .resolve(null) 20851 .then(callback) 20852 .catch(handleErrorInNextTick); 20853 } 20854 : scheduleTimeout; 20855 function handleErrorInNextTick(error) { 20856 setTimeout(function () { 20857 throw error; 20858 }); 20859 } 20860 function isSingletonScope(type) { 20861 return "head" === type; 20862 } 20863 function clearHydrationBoundary(parentInstance, hydrationInstance) { 20864 var node = hydrationInstance, 20865 depth = 0; 20866 do { 20867 var nextNode = node.nextSibling; 20868 parentInstance.removeChild(node); 20869 if (nextNode && 8 === nextNode.nodeType) 20870 if (((node = nextNode.data), "/$" === node || "/&" === node)) { 20871 if (0 === depth) { 20872 parentInstance.removeChild(nextNode); 20873 retryIfBlockedOn(hydrationInstance); 20874 return; 20875 } 20876 depth--; 20877 } else if ( 20878 "$" === node || 20879 "$?" === node || 20880 "$~" === node || 20881 "$!" === node || 20882 "&" === node 20883 ) 20884 depth++; 20885 else if ("html" === node) 20886 releaseSingletonInstance(parentInstance.ownerDocument.documentElement); 20887 else if ("head" === node) { 20888 node = parentInstance.ownerDocument.head; 20889 releaseSingletonInstance(node); 20890 for (var node$jscomp$0 = node.firstChild; node$jscomp$0; ) { 20891 var nextNode$jscomp$0 = node$jscomp$0.nextSibling, 20892 nodeName = node$jscomp$0.nodeName; 20893 node$jscomp$0[internalHoistableMarker] || 20894 "SCRIPT" === nodeName || 20895 "STYLE" === nodeName || 20896 ("LINK" === nodeName && 20897 "stylesheet" === node$jscomp$0.rel.toLowerCase()) || 20898 node.removeChild(node$jscomp$0); 20899 node$jscomp$0 = nextNode$jscomp$0; 20900 } 20901 } else 20902 "body" === node && 20903 releaseSingletonInstance(parentInstance.ownerDocument.body); 20904 node = nextNode; 20905 } while (node); 20906 retryIfBlockedOn(hydrationInstance); 20907 } 20908 function hideOrUnhideDehydratedBoundary(suspenseInstance, isHidden) { 20909 var node = suspenseInstance; 20910 suspenseInstance = 0; 20911 do { 20912 var nextNode = node.nextSibling; 20913 1 === node.nodeType 20914 ? isHidden 20915 ? ((node._stashedDisplay = node.style.display), 20916 (node.style.display = "none")) 20917 : ((node.style.display = node._stashedDisplay || ""), 20918 "" === node.getAttribute("style") && node.removeAttribute("style")) 20919 : 3 === node.nodeType && 20920 (isHidden 20921 ? ((node._stashedText = node.nodeValue), (node.nodeValue = "")) 20922 : (node.nodeValue = node._stashedText || "")); 20923 if (nextNode && 8 === nextNode.nodeType) 20924 if (((node = nextNode.data), "/$" === node)) 20925 if (0 === suspenseInstance) break; 20926 else suspenseInstance--; 20927 else 20928 ("$" !== node && "$?" !== node && "$~" !== node && "$!" !== node) || 20929 suspenseInstance++; 20930 node = nextNode; 20931 } while (node); 20932 } 20933 function clearContainerSparingly(container) { 20934 var nextNode = container.firstChild; 20935 nextNode && 10 === nextNode.nodeType && (nextNode = nextNode.nextSibling); 20936 for (; nextNode; ) { 20937 var node = nextNode; 20938 nextNode = nextNode.nextSibling; 20939 switch (node.nodeName) { 20940 case "HTML": 20941 case "HEAD": 20942 case "BODY": 20943 clearContainerSparingly(node); 20944 detachDeletedInstance(node); 20945 continue; 20946 case "SCRIPT": 20947 case "STYLE": 20948 continue; 20949 case "LINK": 20950 if ("stylesheet" === node.rel.toLowerCase()) continue; 20951 } 20952 container.removeChild(node); 20953 } 20954 } 20955 function canHydrateInstance(instance, type, props, inRootOrSingleton) { 20956 for (; 1 === instance.nodeType; ) { 20957 var anyProps = props; 20958 if (instance.nodeName.toLowerCase() !== type.toLowerCase()) { 20959 if ( 20960 !inRootOrSingleton && 20961 ("INPUT" !== instance.nodeName || "hidden" !== instance.type) 20962 ) 20963 break; 20964 } else if (!inRootOrSingleton) 20965 if ("input" === type && "hidden" === instance.type) { 20966 var name = null == anyProps.name ? null : "" + anyProps.name; 20967 if ( 20968 "hidden" === anyProps.type && 20969 instance.getAttribute("name") === name 20970 ) 20971 return instance; 20972 } else return instance; 20973 else if (!instance[internalHoistableMarker]) 20974 switch (type) { 20975 case "meta": 20976 if (!instance.hasAttribute("itemprop")) break; 20977 return instance; 20978 case "link": 20979 name = instance.getAttribute("rel"); 20980 if ("stylesheet" === name && instance.hasAttribute("data-precedence")) 20981 break; 20982 else if ( 20983 name !== anyProps.rel || 20984 instance.getAttribute("href") !== 20985 (null == anyProps.href || "" === anyProps.href 20986 ? null 20987 : anyProps.href) || 20988 instance.getAttribute("crossorigin") !== 20989 (null == anyProps.crossOrigin ? null : anyProps.crossOrigin) || 20990 instance.getAttribute("title") !== 20991 (null == anyProps.title ? null : anyProps.title) 20992 ) 20993 break; 20994 return instance; 20995 case "style": 20996 if (instance.hasAttribute("data-precedence")) break; 20997 return instance; 20998 case "script": 20999 name = instance.getAttribute("src"); 21000 if ( 21001 (name !== (null == anyProps.src ? null : anyProps.src) || 21002 instance.getAttribute("type") !== 21003 (null == anyProps.type ? null : anyProps.type) || 21004 instance.getAttribute("crossorigin") !== 21005 (null == anyProps.crossOrigin ? null : anyProps.crossOrigin)) && 21006 name && 21007 instance.hasAttribute("async") && 21008 !instance.hasAttribute("itemprop") 21009 ) 21010 break; 21011 return instance; 21012 default: 21013 return instance; 21014 } 21015 instance = getNextHydratable(instance.nextSibling); 21016 if (null === instance) break; 21017 } 21018 return null; 21019 } 21020 function canHydrateTextInstance(instance, text, inRootOrSingleton) { 21021 if ("" === text) return null; 21022 for (; 3 !== instance.nodeType; ) { 21023 if ( 21024 (1 !== instance.nodeType || 21025 "INPUT" !== instance.nodeName || 21026 "hidden" !== instance.type) && 21027 !inRootOrSingleton 21028 ) 21029 return null; 21030 instance = getNextHydratable(instance.nextSibling); 21031 if (null === instance) return null; 21032 } 21033 return instance; 21034 } 21035 function canHydrateHydrationBoundary(instance, inRootOrSingleton) { 21036 for (; 8 !== instance.nodeType; ) { 21037 if ( 21038 (1 !== instance.nodeType || 21039 "INPUT" !== instance.nodeName || 21040 "hidden" !== instance.type) && 21041 !inRootOrSingleton 21042 ) 21043 return null; 21044 instance = getNextHydratable(instance.nextSibling); 21045 if (null === instance) return null; 21046 } 21047 return instance; 21048 } 21049 function isSuspenseInstancePending(instance) { 21050 return "$?" === instance.data || "$~" === instance.data; 21051 } 21052 function isSuspenseInstanceFallback(instance) { 21053 return ( 21054 "$!" === instance.data || 21055 ("$?" === instance.data && "loading" !== instance.ownerDocument.readyState) 21056 ); 21057 } 21058 function registerSuspenseInstanceRetry(instance, callback) { 21059 var ownerDocument = instance.ownerDocument; 21060 if ("$~" === instance.data) instance._reactRetry = callback; 21061 else if ("$?" !== instance.data || "loading" !== ownerDocument.readyState) 21062 callback(); 21063 else { 21064 var listener = function () { 21065 callback(); 21066 ownerDocument.removeEventListener("DOMContentLoaded", listener); 21067 }; 21068 ownerDocument.addEventListener("DOMContentLoaded", listener); 21069 instance._reactRetry = listener; 21070 } 21071 } 21072 function getNextHydratable(node) { 21073 for (; null != node; node = node.nextSibling) { 21074 var nodeType = node.nodeType; 21075 if (1 === nodeType || 3 === nodeType) break; 21076 if (8 === nodeType) { 21077 nodeType = node.data; 21078 if ( 21079 "$" === nodeType || 21080 "$!" === nodeType || 21081 "$?" === nodeType || 21082 "$~" === nodeType || 21083 "&" === nodeType || 21084 "F!" === nodeType || 21085 "F" === nodeType 21086 ) 21087 break; 21088 if ("/$" === nodeType || "/&" === nodeType) return null; 21089 } 21090 } 21091 return node; 21092 } 21093 var previousHydratableOnEnteringScopedSingleton = null; 21094 function getNextHydratableInstanceAfterHydrationBoundary(hydrationInstance) { 21095 hydrationInstance = hydrationInstance.nextSibling; 21096 for (var depth = 0; hydrationInstance; ) { 21097 if (8 === hydrationInstance.nodeType) { 21098 var data = hydrationInstance.data; 21099 if ("/$" === data || "/&" === data) { 21100 if (0 === depth) 21101 return getNextHydratable(hydrationInstance.nextSibling); 21102 depth--; 21103 } else 21104 ("$" !== data && 21105 "$!" !== data && 21106 "$?" !== data && 21107 "$~" !== data && 21108 "&" !== data) || 21109 depth++; 21110 } 21111 hydrationInstance = hydrationInstance.nextSibling; 21112 } 21113 return null; 21114 } 21115 function getParentHydrationBoundary(targetInstance) { 21116 targetInstance = targetInstance.previousSibling; 21117 for (var depth = 0; targetInstance; ) { 21118 if (8 === targetInstance.nodeType) { 21119 var data = targetInstance.data; 21120 if ( 21121 "$" === data || 21122 "$!" === data || 21123 "$?" === data || 21124 "$~" === data || 21125 "&" === data 21126 ) { 21127 if (0 === depth) return targetInstance; 21128 depth--; 21129 } else ("/$" !== data && "/&" !== data) || depth++; 21130 } 21131 targetInstance = targetInstance.previousSibling; 21132 } 21133 return null; 21134 } 21135 function resolveSingletonInstance(type, props, rootContainerInstance) { 21136 props = getOwnerDocumentFromRootContainer(rootContainerInstance); 21137 switch (type) { 21138 case "html": 21139 type = props.documentElement; 21140 if (!type) throw Error(formatProdErrorMessage(452)); 21141 return type; 21142 case "head": 21143 type = props.head; 21144 if (!type) throw Error(formatProdErrorMessage(453)); 21145 return type; 21146 case "body": 21147 type = props.body; 21148 if (!type) throw Error(formatProdErrorMessage(454)); 21149 return type; 21150 default: 21151 throw Error(formatProdErrorMessage(451)); 21152 } 21153 } 21154 function releaseSingletonInstance(instance) { 21155 for (var attributes = instance.attributes; attributes.length; ) 21156 instance.removeAttributeNode(attributes[0]); 21157 detachDeletedInstance(instance); 21158 } 21159 var preloadPropsMap = new Map(), 21160 preconnectsSet = new Set(); 21161 function getHoistableRoot(container) { 21162 return "function" === typeof container.getRootNode 21163 ? container.getRootNode() 21164 : 9 === container.nodeType 21165 ? container 21166 : container.ownerDocument; 21167 } 21168 var previousDispatcher = ReactDOMSharedInternals.d; 21169 ReactDOMSharedInternals.d = { 21170 f: flushSyncWork, 21171 r: requestFormReset, 21172 D: prefetchDNS, 21173 C: preconnect, 21174 L: preload, 21175 m: preloadModule, 21176 X: preinitScript, 21177 S: preinitStyle, 21178 M: preinitModuleScript 21179 }; 21180 function flushSyncWork() { 21181 var previousWasRendering = previousDispatcher.f(), 21182 wasRendering = flushSyncWork$1(); 21183 return previousWasRendering || wasRendering; 21184 } 21185 function requestFormReset(form) { 21186 var formInst = getInstanceFromNode(form); 21187 null !== formInst && 5 === formInst.tag && "form" === formInst.type 21188 ? requestFormReset$1(formInst) 21189 : previousDispatcher.r(form); 21190 } 21191 var globalDocument = "undefined" === typeof document ? null : document; 21192 function preconnectAs(rel, href, crossOrigin) { 21193 var ownerDocument = globalDocument; 21194 if (ownerDocument && "string" === typeof href && href) { 21195 var limitedEscapedHref = 21196 escapeSelectorAttributeValueInsideDoubleQuotes(href); 21197 limitedEscapedHref = 21198 'link[rel="' + rel + '"][href="' + limitedEscapedHref + '"]'; 21199 "string" === typeof crossOrigin && 21200 (limitedEscapedHref += '[crossorigin="' + crossOrigin + '"]'); 21201 preconnectsSet.has(limitedEscapedHref) || 21202 (preconnectsSet.add(limitedEscapedHref), 21203 (rel = { rel: rel, crossOrigin: crossOrigin, href: href }), 21204 null === ownerDocument.querySelector(limitedEscapedHref) && 21205 ((href = ownerDocument.createElement("link")), 21206 setInitialProperties(href, "link", rel), 21207 markNodeAsHoistable(href), 21208 ownerDocument.head.appendChild(href))); 21209 } 21210 } 21211 function prefetchDNS(href) { 21212 previousDispatcher.D(href); 21213 preconnectAs("dns-prefetch", href, null); 21214 } 21215 function preconnect(href, crossOrigin) { 21216 previousDispatcher.C(href, crossOrigin); 21217 preconnectAs("preconnect", href, crossOrigin); 21218 } 21219 function preload(href, as, options) { 21220 previousDispatcher.L(href, as, options); 21221 var ownerDocument = globalDocument; 21222 if (ownerDocument && href && as) { 21223 var preloadSelector = 21224 'link[rel="preload"][as="' + 21225 escapeSelectorAttributeValueInsideDoubleQuotes(as) + 21226 '"]'; 21227 "image" === as 21228 ? options && options.imageSrcSet 21229 ? ((preloadSelector += 21230 '[imagesrcset="' + 21231 escapeSelectorAttributeValueInsideDoubleQuotes( 21232 options.imageSrcSet 21233 ) + 21234 '"]'), 21235 "string" === typeof options.imageSizes && 21236 (preloadSelector += 21237 '[imagesizes="' + 21238 escapeSelectorAttributeValueInsideDoubleQuotes( 21239 options.imageSizes 21240 ) + 21241 '"]')) 21242 : (preloadSelector += 21243 '[href="' + 21244 escapeSelectorAttributeValueInsideDoubleQuotes(href) + 21245 '"]') 21246 : (preloadSelector += 21247 '[href="' + 21248 escapeSelectorAttributeValueInsideDoubleQuotes(href) + 21249 '"]'); 21250 var key = preloadSelector; 21251 switch (as) { 21252 case "style": 21253 key = getStyleKey(href); 21254 break; 21255 case "script": 21256 key = getScriptKey(href); 21257 } 21258 preloadPropsMap.has(key) || 21259 ((href = assign( 21260 { 21261 rel: "preload", 21262 href: 21263 "image" === as && options && options.imageSrcSet ? void 0 : href, 21264 as: as 21265 }, 21266 options 21267 )), 21268 preloadPropsMap.set(key, href), 21269 null !== ownerDocument.querySelector(preloadSelector) || 21270 ("style" === as && 21271 ownerDocument.querySelector(getStylesheetSelectorFromKey(key))) || 21272 ("script" === as && 21273 ownerDocument.querySelector(getScriptSelectorFromKey(key))) || 21274 ((as = ownerDocument.createElement("link")), 21275 setInitialProperties(as, "link", href), 21276 markNodeAsHoistable(as), 21277 ownerDocument.head.appendChild(as))); 21278 } 21279 } 21280 function preloadModule(href, options) { 21281 previousDispatcher.m(href, options); 21282 var ownerDocument = globalDocument; 21283 if (ownerDocument && href) { 21284 var as = options && "string" === typeof options.as ? options.as : "script", 21285 preloadSelector = 21286 'link[rel="modulepreload"][as="' + 21287 escapeSelectorAttributeValueInsideDoubleQuotes(as) + 21288 '"][href="' + 21289 escapeSelectorAttributeValueInsideDoubleQuotes(href) + 21290 '"]', 21291 key = preloadSelector; 21292 switch (as) { 21293 case "audioworklet": 21294 case "paintworklet": 21295 case "serviceworker": 21296 case "sharedworker": 21297 case "worker": 21298 case "script": 21299 key = getScriptKey(href); 21300 } 21301 if ( 21302 !preloadPropsMap.has(key) && 21303 ((href = assign({ rel: "modulepreload", href: href }, options)), 21304 preloadPropsMap.set(key, href), 21305 null === ownerDocument.querySelector(preloadSelector)) 21306 ) { 21307 switch (as) { 21308 case "audioworklet": 21309 case "paintworklet": 21310 case "serviceworker": 21311 case "sharedworker": 21312 case "worker": 21313 case "script": 21314 if (ownerDocument.querySelector(getScriptSelectorFromKey(key))) 21315 return; 21316 } 21317 as = ownerDocument.createElement("link"); 21318 setInitialProperties(as, "link", href); 21319 markNodeAsHoistable(as); 21320 ownerDocument.head.appendChild(as); 21321 } 21322 } 21323 } 21324 function preinitStyle(href, precedence, options) { 21325 previousDispatcher.S(href, precedence, options); 21326 var ownerDocument = globalDocument; 21327 if (ownerDocument && href) { 21328 var styles = getResourcesFromRoot(ownerDocument).hoistableStyles, 21329 key = getStyleKey(href); 21330 precedence = precedence || "default"; 21331 var resource = styles.get(key); 21332 if (!resource) { 21333 var state = { loading: 0, preload: null }; 21334 if ( 21335 (resource = ownerDocument.querySelector( 21336 getStylesheetSelectorFromKey(key) 21337 )) 21338 ) 21339 state.loading = 5; 21340 else { 21341 href = assign( 21342 { rel: "stylesheet", href: href, "data-precedence": precedence }, 21343 options 21344 ); 21345 (options = preloadPropsMap.get(key)) && 21346 adoptPreloadPropsForStylesheet(href, options); 21347 var link = (resource = ownerDocument.createElement("link")); 21348 markNodeAsHoistable(link); 21349 setInitialProperties(link, "link", href); 21350 link._p = new Promise(function (resolve, reject) { 21351 link.onload = resolve; 21352 link.onerror = reject; 21353 }); 21354 link.addEventListener("load", function () { 21355 state.loading |= 1; 21356 }); 21357 link.addEventListener("error", function () { 21358 state.loading |= 2; 21359 }); 21360 state.loading |= 4; 21361 insertStylesheet(resource, precedence, ownerDocument); 21362 } 21363 resource = { 21364 type: "stylesheet", 21365 instance: resource, 21366 count: 1, 21367 state: state 21368 }; 21369 styles.set(key, resource); 21370 } 21371 } 21372 } 21373 function preinitScript(src, options) { 21374 previousDispatcher.X(src, options); 21375 var ownerDocument = globalDocument; 21376 if (ownerDocument && src) { 21377 var scripts = getResourcesFromRoot(ownerDocument).hoistableScripts, 21378 key = getScriptKey(src), 21379 resource = scripts.get(key); 21380 resource || 21381 ((resource = ownerDocument.querySelector(getScriptSelectorFromKey(key))), 21382 resource || 21383 ((src = assign({ src: src, async: true }, options)), 21384 (options = preloadPropsMap.get(key)) && 21385 adoptPreloadPropsForScript(src, options), 21386 (resource = ownerDocument.createElement("script")), 21387 markNodeAsHoistable(resource), 21388 setInitialProperties(resource, "link", src), 21389 ownerDocument.head.appendChild(resource)), 21390 (resource = { 21391 type: "script", 21392 instance: resource, 21393 count: 1, 21394 state: null 21395 }), 21396 scripts.set(key, resource)); 21397 } 21398 } 21399 function preinitModuleScript(src, options) { 21400 previousDispatcher.M(src, options); 21401 var ownerDocument = globalDocument; 21402 if (ownerDocument && src) { 21403 var scripts = getResourcesFromRoot(ownerDocument).hoistableScripts, 21404 key = getScriptKey(src), 21405 resource = scripts.get(key); 21406 resource || 21407 ((resource = ownerDocument.querySelector(getScriptSelectorFromKey(key))), 21408 resource || 21409 ((src = assign({ src: src, async: true, type: "module" }, options)), 21410 (options = preloadPropsMap.get(key)) && 21411 adoptPreloadPropsForScript(src, options), 21412 (resource = ownerDocument.createElement("script")), 21413 markNodeAsHoistable(resource), 21414 setInitialProperties(resource, "link", src), 21415 ownerDocument.head.appendChild(resource)), 21416 (resource = { 21417 type: "script", 21418 instance: resource, 21419 count: 1, 21420 state: null 21421 }), 21422 scripts.set(key, resource)); 21423 } 21424 } 21425 function getResource(type, currentProps, pendingProps, currentResource) { 21426 var JSCompiler_inline_result = (JSCompiler_inline_result = 21427 rootInstanceStackCursor.current) 21428 ? getHoistableRoot(JSCompiler_inline_result) 21429 : null; 21430 if (!JSCompiler_inline_result) throw Error(formatProdErrorMessage(446)); 21431 switch (type) { 21432 case "meta": 21433 case "title": 21434 return null; 21435 case "style": 21436 return "string" === typeof pendingProps.precedence && 21437 "string" === typeof pendingProps.href 21438 ? ((currentProps = getStyleKey(pendingProps.href)), 21439 (pendingProps = getResourcesFromRoot( 21440 JSCompiler_inline_result 21441 ).hoistableStyles), 21442 (currentResource = pendingProps.get(currentProps)), 21443 currentResource || 21444 ((currentResource = { 21445 type: "style", 21446 instance: null, 21447 count: 0, 21448 state: null 21449 }), 21450 pendingProps.set(currentProps, currentResource)), 21451 currentResource) 21452 : { type: "void", instance: null, count: 0, state: null }; 21453 case "link": 21454 if ( 21455 "stylesheet" === pendingProps.rel && 21456 "string" === typeof pendingProps.href && 21457 "string" === typeof pendingProps.precedence 21458 ) { 21459 type = getStyleKey(pendingProps.href); 21460 var styles$243 = getResourcesFromRoot( 21461 JSCompiler_inline_result 21462 ).hoistableStyles, 21463 resource$244 = styles$243.get(type); 21464 resource$244 || 21465 ((JSCompiler_inline_result = 21466 JSCompiler_inline_result.ownerDocument || JSCompiler_inline_result), 21467 (resource$244 = { 21468 type: "stylesheet", 21469 instance: null, 21470 count: 0, 21471 state: { loading: 0, preload: null } 21472 }), 21473 styles$243.set(type, resource$244), 21474 (styles$243 = JSCompiler_inline_result.querySelector( 21475 getStylesheetSelectorFromKey(type) 21476 )) && 21477 !styles$243._p && 21478 ((resource$244.instance = styles$243), 21479 (resource$244.state.loading = 5)), 21480 preloadPropsMap.has(type) || 21481 ((pendingProps = { 21482 rel: "preload", 21483 as: "style", 21484 href: pendingProps.href, 21485 crossOrigin: pendingProps.crossOrigin, 21486 integrity: pendingProps.integrity, 21487 media: pendingProps.media, 21488 hrefLang: pendingProps.hrefLang, 21489 referrerPolicy: pendingProps.referrerPolicy 21490 }), 21491 preloadPropsMap.set(type, pendingProps), 21492 styles$243 || 21493 preloadStylesheet( 21494 JSCompiler_inline_result, 21495 type, 21496 pendingProps, 21497 resource$244.state 21498 ))); 21499 if (currentProps && null === currentResource) 21500 throw Error(formatProdErrorMessage(528, "")); 21501 return resource$244; 21502 } 21503 if (currentProps && null !== currentResource) 21504 throw Error(formatProdErrorMessage(529, "")); 21505 return null; 21506 case "script": 21507 return ( 21508 (currentProps = pendingProps.async), 21509 (pendingProps = pendingProps.src), 21510 "string" === typeof pendingProps && 21511 currentProps && 21512 "function" !== typeof currentProps && 21513 "symbol" !== typeof currentProps 21514 ? ((currentProps = getScriptKey(pendingProps)), 21515 (pendingProps = getResourcesFromRoot( 21516 JSCompiler_inline_result 21517 ).hoistableScripts), 21518 (currentResource = pendingProps.get(currentProps)), 21519 currentResource || 21520 ((currentResource = { 21521 type: "script", 21522 instance: null, 21523 count: 0, 21524 state: null 21525 }), 21526 pendingProps.set(currentProps, currentResource)), 21527 currentResource) 21528 : { type: "void", instance: null, count: 0, state: null } 21529 ); 21530 default: 21531 throw Error(formatProdErrorMessage(444, type)); 21532 } 21533 } 21534 function getStyleKey(href) { 21535 return 'href="' + escapeSelectorAttributeValueInsideDoubleQuotes(href) + '"'; 21536 } 21537 function getStylesheetSelectorFromKey(key) { 21538 return 'link[rel="stylesheet"][' + key + "]"; 21539 } 21540 function stylesheetPropsFromRawProps(rawProps) { 21541 return assign({}, rawProps, { 21542 "data-precedence": rawProps.precedence, 21543 precedence: null 21544 }); 21545 } 21546 function preloadStylesheet(ownerDocument, key, preloadProps, state) { 21547 ownerDocument.querySelector('link[rel="preload"][as="style"][' + key + "]") 21548 ? (state.loading = 1) 21549 : ((key = ownerDocument.createElement("link")), 21550 (state.preload = key), 21551 key.addEventListener("load", function () { 21552 return (state.loading |= 1); 21553 }), 21554 key.addEventListener("error", function () { 21555 return (state.loading |= 2); 21556 }), 21557 setInitialProperties(key, "link", preloadProps), 21558 markNodeAsHoistable(key), 21559 ownerDocument.head.appendChild(key)); 21560 } 21561 function getScriptKey(src) { 21562 return '[src="' + escapeSelectorAttributeValueInsideDoubleQuotes(src) + '"]'; 21563 } 21564 function getScriptSelectorFromKey(key) { 21565 return "script[async]" + key; 21566 } 21567 function acquireResource(hoistableRoot, resource, props) { 21568 resource.count++; 21569 if (null === resource.instance) 21570 switch (resource.type) { 21571 case "style": 21572 var instance = hoistableRoot.querySelector( 21573 'style[data-href~="' + 21574 escapeSelectorAttributeValueInsideDoubleQuotes(props.href) + 21575 '"]' 21576 ); 21577 if (instance) 21578 return ( 21579 (resource.instance = instance), 21580 markNodeAsHoistable(instance), 21581 instance 21582 ); 21583 var styleProps = assign({}, props, { 21584 "data-href": props.href, 21585 "data-precedence": props.precedence, 21586 href: null, 21587 precedence: null 21588 }); 21589 instance = (hoistableRoot.ownerDocument || hoistableRoot).createElement( 21590 "style" 21591 ); 21592 markNodeAsHoistable(instance); 21593 setInitialProperties(instance, "style", styleProps); 21594 insertStylesheet(instance, props.precedence, hoistableRoot); 21595 return (resource.instance = instance); 21596 case "stylesheet": 21597 styleProps = getStyleKey(props.href); 21598 var instance$249 = hoistableRoot.querySelector( 21599 getStylesheetSelectorFromKey(styleProps) 21600 ); 21601 if (instance$249) 21602 return ( 21603 (resource.state.loading |= 4), 21604 (resource.instance = instance$249), 21605 markNodeAsHoistable(instance$249), 21606 instance$249 21607 ); 21608 instance = stylesheetPropsFromRawProps(props); 21609 (styleProps = preloadPropsMap.get(styleProps)) && 21610 adoptPreloadPropsForStylesheet(instance, styleProps); 21611 instance$249 = ( 21612 hoistableRoot.ownerDocument || hoistableRoot 21613 ).createElement("link"); 21614 markNodeAsHoistable(instance$249); 21615 var linkInstance = instance$249; 21616 linkInstance._p = new Promise(function (resolve, reject) { 21617 linkInstance.onload = resolve; 21618 linkInstance.onerror = reject; 21619 }); 21620 setInitialProperties(instance$249, "link", instance); 21621 resource.state.loading |= 4; 21622 insertStylesheet(instance$249, props.precedence, hoistableRoot); 21623 return (resource.instance = instance$249); 21624 case "script": 21625 instance$249 = getScriptKey(props.src); 21626 if ( 21627 (styleProps = hoistableRoot.querySelector( 21628 getScriptSelectorFromKey(instance$249) 21629 )) 21630 ) 21631 return ( 21632 (resource.instance = styleProps), 21633 markNodeAsHoistable(styleProps), 21634 styleProps 21635 ); 21636 instance = props; 21637 if ((styleProps = preloadPropsMap.get(instance$249))) 21638 (instance = assign({}, props)), 21639 adoptPreloadPropsForScript(instance, styleProps); 21640 hoistableRoot = hoistableRoot.ownerDocument || hoistableRoot; 21641 styleProps = hoistableRoot.createElement("script"); 21642 markNodeAsHoistable(styleProps); 21643 setInitialProperties(styleProps, "link", instance); 21644 hoistableRoot.head.appendChild(styleProps); 21645 return (resource.instance = styleProps); 21646 case "void": 21647 return null; 21648 default: 21649 throw Error(formatProdErrorMessage(443, resource.type)); 21650 } 21651 else 21652 "stylesheet" === resource.type && 21653 0 === (resource.state.loading & 4) && 21654 ((instance = resource.instance), 21655 (resource.state.loading |= 4), 21656 insertStylesheet(instance, props.precedence, hoistableRoot)); 21657 return resource.instance; 21658 } 21659 function insertStylesheet(instance, precedence, root) { 21660 for ( 21661 var nodes = root.querySelectorAll( 21662 'link[rel="stylesheet"][data-precedence],style[data-precedence]' 21663 ), 21664 last = nodes.length ? nodes[nodes.length - 1] : null, 21665 prior = last, 21666 i = 0; 21667 i < nodes.length; 21668 i++ 21669 ) { 21670 var node = nodes[i]; 21671 if (node.dataset.precedence === precedence) prior = node; 21672 else if (prior !== last) break; 21673 } 21674 prior 21675 ? prior.parentNode.insertBefore(instance, prior.nextSibling) 21676 : ((precedence = 9 === root.nodeType ? root.head : root), 21677 precedence.insertBefore(instance, precedence.firstChild)); 21678 } 21679 function adoptPreloadPropsForStylesheet(stylesheetProps, preloadProps) { 21680 null == stylesheetProps.crossOrigin && 21681 (stylesheetProps.crossOrigin = preloadProps.crossOrigin); 21682 null == stylesheetProps.referrerPolicy && 21683 (stylesheetProps.referrerPolicy = preloadProps.referrerPolicy); 21684 null == stylesheetProps.title && (stylesheetProps.title = preloadProps.title); 21685 } 21686 function adoptPreloadPropsForScript(scriptProps, preloadProps) { 21687 null == scriptProps.crossOrigin && 21688 (scriptProps.crossOrigin = preloadProps.crossOrigin); 21689 null == scriptProps.referrerPolicy && 21690 (scriptProps.referrerPolicy = preloadProps.referrerPolicy); 21691 null == scriptProps.integrity && 21692 (scriptProps.integrity = preloadProps.integrity); 21693 } 21694 var tagCaches = null; 21695 function getHydratableHoistableCache(type, keyAttribute, ownerDocument) { 21696 if (null === tagCaches) { 21697 var cache = new Map(); 21698 var caches = (tagCaches = new Map()); 21699 caches.set(ownerDocument, cache); 21700 } else 21701 (caches = tagCaches), 21702 (cache = caches.get(ownerDocument)), 21703 cache || ((cache = new Map()), caches.set(ownerDocument, cache)); 21704 if (cache.has(type)) return cache; 21705 cache.set(type, null); 21706 ownerDocument = ownerDocument.getElementsByTagName(type); 21707 for (caches = 0; caches < ownerDocument.length; caches++) { 21708 var node = ownerDocument[caches]; 21709 if ( 21710 !( 21711 node[internalHoistableMarker] || 21712 node[internalInstanceKey] || 21713 ("link" === type && "stylesheet" === node.getAttribute("rel")) 21714 ) && 21715 "http://www.w3.org/2000/svg" !== node.namespaceURI 21716 ) { 21717 var nodeKey = node.getAttribute(keyAttribute) || ""; 21718 nodeKey = type + nodeKey; 21719 var existing = cache.get(nodeKey); 21720 existing ? existing.push(node) : cache.set(nodeKey, [node]); 21721 } 21722 } 21723 return cache; 21724 } 21725 function mountHoistable(hoistableRoot, type, instance) { 21726 hoistableRoot = hoistableRoot.ownerDocument || hoistableRoot; 21727 hoistableRoot.head.insertBefore( 21728 instance, 21729 "title" === type ? hoistableRoot.querySelector("head > title") : null 21730 ); 21731 } 21732 function isHostHoistableType(type, props, hostContext) { 21733 if (1 === hostContext || null != props.itemProp) return false; 21734 switch (type) { 21735 case "meta": 21736 case "title": 21737 return true; 21738 case "style": 21739 if ( 21740 "string" !== typeof props.precedence || 21741 "string" !== typeof props.href || 21742 "" === props.href 21743 ) 21744 break; 21745 return true; 21746 case "link": 21747 if ( 21748 "string" !== typeof props.rel || 21749 "string" !== typeof props.href || 21750 "" === props.href || 21751 props.onLoad || 21752 props.onError 21753 ) 21754 break; 21755 switch (props.rel) { 21756 case "stylesheet": 21757 return ( 21758 (type = props.disabled), 21759 "string" === typeof props.precedence && null == type 21760 ); 21761 default: 21762 return true; 21763 } 21764 case "script": 21765 if ( 21766 props.async && 21767 "function" !== typeof props.async && 21768 "symbol" !== typeof props.async && 21769 !props.onLoad && 21770 !props.onError && 21771 props.src && 21772 "string" === typeof props.src 21773 ) 21774 return true; 21775 } 21776 return false; 21777 } 21778 function preloadResource(resource) { 21779 return "stylesheet" === resource.type && 0 === (resource.state.loading & 3) 21780 ? false 21781 : true; 21782 } 21783 function suspendResource(state, hoistableRoot, resource, props) { 21784 if ( 21785 "stylesheet" === resource.type && 21786 ("string" !== typeof props.media || 21787 false !== matchMedia(props.media).matches) && 21788 0 === (resource.state.loading & 4) 21789 ) { 21790 if (null === resource.instance) { 21791 var key = getStyleKey(props.href), 21792 instance = hoistableRoot.querySelector( 21793 getStylesheetSelectorFromKey(key) 21794 ); 21795 if (instance) { 21796 hoistableRoot = instance._p; 21797 null !== hoistableRoot && 21798 "object" === typeof hoistableRoot && 21799 "function" === typeof hoistableRoot.then && 21800 (state.count++, 21801 (state = onUnsuspend.bind(state)), 21802 hoistableRoot.then(state, state)); 21803 resource.state.loading |= 4; 21804 resource.instance = instance; 21805 markNodeAsHoistable(instance); 21806 return; 21807 } 21808 instance = hoistableRoot.ownerDocument || hoistableRoot; 21809 props = stylesheetPropsFromRawProps(props); 21810 (key = preloadPropsMap.get(key)) && 21811 adoptPreloadPropsForStylesheet(props, key); 21812 instance = instance.createElement("link"); 21813 markNodeAsHoistable(instance); 21814 var linkInstance = instance; 21815 linkInstance._p = new Promise(function (resolve, reject) { 21816 linkInstance.onload = resolve; 21817 linkInstance.onerror = reject; 21818 }); 21819 setInitialProperties(instance, "link", props); 21820 resource.instance = instance; 21821 } 21822 null === state.stylesheets && (state.stylesheets = new Map()); 21823 state.stylesheets.set(resource, hoistableRoot); 21824 (hoistableRoot = resource.state.preload) && 21825 0 === (resource.state.loading & 3) && 21826 (state.count++, 21827 (resource = onUnsuspend.bind(state)), 21828 hoistableRoot.addEventListener("load", resource), 21829 hoistableRoot.addEventListener("error", resource)); 21830 } 21831 } 21832 var estimatedBytesWithinLimit = 0; 21833 function waitForCommitToBeReady(state, timeoutOffset) { 21834 state.stylesheets && 21835 0 === state.count && 21836 insertSuspendedStylesheets(state, state.stylesheets); 21837 return 0 < state.count || 0 < state.imgCount 21838 ? function (commit) { 21839 var stylesheetTimer = setTimeout(function () { 21840 state.stylesheets && 21841 insertSuspendedStylesheets(state, state.stylesheets); 21842 if (state.unsuspend) { 21843 var unsuspend = state.unsuspend; 21844 state.unsuspend = null; 21845 unsuspend(); 21846 } 21847 }, 6e4 + timeoutOffset); 21848 0 < state.imgBytes && 21849 0 === estimatedBytesWithinLimit && 21850 (estimatedBytesWithinLimit = 62500 * estimateBandwidth()); 21851 var imgTimer = setTimeout( 21852 function () { 21853 state.waitingForImages = false; 21854 if ( 21855 0 === state.count && 21856 (state.stylesheets && 21857 insertSuspendedStylesheets(state, state.stylesheets), 21858 state.unsuspend) 21859 ) { 21860 var unsuspend = state.unsuspend; 21861 state.unsuspend = null; 21862 unsuspend(); 21863 } 21864 }, 21865 (state.imgBytes > estimatedBytesWithinLimit ? 50 : 800) + 21866 timeoutOffset 21867 ); 21868 state.unsuspend = commit; 21869 return function () { 21870 state.unsuspend = null; 21871 clearTimeout(stylesheetTimer); 21872 clearTimeout(imgTimer); 21873 }; 21874 } 21875 : null; 21876 } 21877 function onUnsuspend() { 21878 this.count--; 21879 if (0 === this.count && (0 === this.imgCount || !this.waitingForImages)) 21880 if (this.stylesheets) insertSuspendedStylesheets(this, this.stylesheets); 21881 else if (this.unsuspend) { 21882 var unsuspend = this.unsuspend; 21883 this.unsuspend = null; 21884 unsuspend(); 21885 } 21886 } 21887 var precedencesByRoot = null; 21888 function insertSuspendedStylesheets(state, resources) { 21889 state.stylesheets = null; 21890 null !== state.unsuspend && 21891 (state.count++, 21892 (precedencesByRoot = new Map()), 21893 resources.forEach(insertStylesheetIntoRoot, state), 21894 (precedencesByRoot = null), 21895 onUnsuspend.call(state)); 21896 } 21897 function insertStylesheetIntoRoot(root, resource) { 21898 if (!(resource.state.loading & 4)) { 21899 var precedences = precedencesByRoot.get(root); 21900 if (precedences) var last = precedences.get(null); 21901 else { 21902 precedences = new Map(); 21903 precedencesByRoot.set(root, precedences); 21904 for ( 21905 var nodes = root.querySelectorAll( 21906 "link[data-precedence],style[data-precedence]" 21907 ), 21908 i = 0; 21909 i < nodes.length; 21910 i++ 21911 ) { 21912 var node = nodes[i]; 21913 if ( 21914 "LINK" === node.nodeName || 21915 "not all" !== node.getAttribute("media") 21916 ) 21917 precedences.set(node.dataset.precedence, node), (last = node); 21918 } 21919 last && precedences.set(null, last); 21920 } 21921 nodes = resource.instance; 21922 node = nodes.getAttribute("data-precedence"); 21923 i = precedences.get(node) || last; 21924 i === last && precedences.set(null, nodes); 21925 precedences.set(node, nodes); 21926 this.count++; 21927 last = onUnsuspend.bind(this); 21928 nodes.addEventListener("load", last); 21929 nodes.addEventListener("error", last); 21930 i 21931 ? i.parentNode.insertBefore(nodes, i.nextSibling) 21932 : ((root = 9 === root.nodeType ? root.head : root), 21933 root.insertBefore(nodes, root.firstChild)); 21934 resource.state.loading |= 4; 21935 } 21936 } 21937 var HostTransitionContext = { 21938 $$typeof: REACT_CONTEXT_TYPE, 21939 Provider: null, 21940 Consumer: null, 21941 _currentValue: sharedNotPendingObject, 21942 _currentValue2: sharedNotPendingObject, 21943 _threadCount: 0 21944 }; 21945 function FiberRootNode( 21946 containerInfo, 21947 tag, 21948 hydrate, 21949 identifierPrefix, 21950 onUncaughtError, 21951 onCaughtError, 21952 onRecoverableError, 21953 onDefaultTransitionIndicator, 21954 formState 21955 ) { 21956 this.tag = 1; 21957 this.containerInfo = containerInfo; 21958 this.pingCache = this.current = this.pendingChildren = null; 21959 this.timeoutHandle = -1; 21960 this.callbackNode = 21961 this.next = 21962 this.pendingContext = 21963 this.context = 21964 this.cancelPendingCommit = 21965 null; 21966 this.callbackPriority = 0; 21967 this.expirationTimes = createLaneMap(-1); 21968 this.entangledLanes = 21969 this.shellSuspendCounter = 21970 this.errorRecoveryDisabledLanes = 21971 this.expiredLanes = 21972 this.warmLanes = 21973 this.pingedLanes = 21974 this.suspendedLanes = 21975 this.pendingLanes = 21976 0; 21977 this.entanglements = createLaneMap(0); 21978 this.hiddenUpdates = createLaneMap(null); 21979 this.identifierPrefix = identifierPrefix; 21980 this.onUncaughtError = onUncaughtError; 21981 this.onCaughtError = onCaughtError; 21982 this.onRecoverableError = onRecoverableError; 21983 this.pooledCache = null; 21984 this.pooledCacheLanes = 0; 21985 this.formState = formState; 21986 this.incompleteTransitions = new Map(); 21987 } 21988 function createFiberRoot( 21989 containerInfo, 21990 tag, 21991 hydrate, 21992 initialChildren, 21993 hydrationCallbacks, 21994 isStrictMode, 21995 identifierPrefix, 21996 formState, 21997 onUncaughtError, 21998 onCaughtError, 21999 onRecoverableError, 22000 onDefaultTransitionIndicator 22001 ) { 22002 containerInfo = new FiberRootNode( 22003 containerInfo, 22004 tag, 22005 hydrate, 22006 identifierPrefix, 22007 onUncaughtError, 22008 onCaughtError, 22009 onRecoverableError, 22010 onDefaultTransitionIndicator, 22011 formState 22012 ); 22013 tag = 1; 22014 true === isStrictMode && (tag |= 24); 22015 isStrictMode = createFiberImplClass(3, null, null, tag); 22016 containerInfo.current = isStrictMode; 22017 isStrictMode.stateNode = containerInfo; 22018 tag = createCache(); 22019 tag.refCount++; 22020 containerInfo.pooledCache = tag; 22021 tag.refCount++; 22022 isStrictMode.memoizedState = { 22023 element: initialChildren, 22024 isDehydrated: hydrate, 22025 cache: tag 22026 }; 22027 initializeUpdateQueue(isStrictMode); 22028 return containerInfo; 22029 } 22030 function getContextForSubtree(parentComponent) { 22031 if (!parentComponent) return emptyContextObject; 22032 parentComponent = emptyContextObject; 22033 return parentComponent; 22034 } 22035 function updateContainerImpl( 22036 rootFiber, 22037 lane, 22038 element, 22039 container, 22040 parentComponent, 22041 callback 22042 ) { 22043 parentComponent = getContextForSubtree(parentComponent); 22044 null === container.context 22045 ? (container.context = parentComponent) 22046 : (container.pendingContext = parentComponent); 22047 container = createUpdate(lane); 22048 container.payload = { element: element }; 22049 callback = void 0 === callback ? null : callback; 22050 null !== callback && (container.callback = callback); 22051 element = enqueueUpdate(rootFiber, container, lane); 22052 null !== element && 22053 (scheduleUpdateOnFiber(element, rootFiber, lane), 22054 entangleTransitions(element, rootFiber, lane)); 22055 } 22056 function markRetryLaneImpl(fiber, retryLane) { 22057 fiber = fiber.memoizedState; 22058 if (null !== fiber && null !== fiber.dehydrated) { 22059 var a = fiber.retryLane; 22060 fiber.retryLane = 0 !== a && a < retryLane ? a : retryLane; 22061 } 22062 } 22063 function markRetryLaneIfNotHydrated(fiber, retryLane) { 22064 markRetryLaneImpl(fiber, retryLane); 22065 (fiber = fiber.alternate) && markRetryLaneImpl(fiber, retryLane); 22066 } 22067 function attemptContinuousHydration(fiber) { 22068 if (13 === fiber.tag || 31 === fiber.tag) { 22069 var root = enqueueConcurrentRenderForLane(fiber, 67108864); 22070 null !== root && scheduleUpdateOnFiber(root, fiber, 67108864); 22071 markRetryLaneIfNotHydrated(fiber, 67108864); 22072 } 22073 } 22074 function attemptHydrationAtCurrentPriority(fiber) { 22075 if (13 === fiber.tag || 31 === fiber.tag) { 22076 var lane = requestUpdateLane(); 22077 lane = getBumpedLaneForHydrationByLane(lane); 22078 var root = enqueueConcurrentRenderForLane(fiber, lane); 22079 null !== root && scheduleUpdateOnFiber(root, fiber, lane); 22080 markRetryLaneIfNotHydrated(fiber, lane); 22081 } 22082 } 22083 var _enabled = true; 22084 function dispatchDiscreteEvent( 22085 domEventName, 22086 eventSystemFlags, 22087 container, 22088 nativeEvent 22089 ) { 22090 var prevTransition = ReactSharedInternals.T; 22091 ReactSharedInternals.T = null; 22092 var previousPriority = ReactDOMSharedInternals.p; 22093 try { 22094 (ReactDOMSharedInternals.p = 2), 22095 dispatchEvent(domEventName, eventSystemFlags, container, nativeEvent); 22096 } finally { 22097 (ReactDOMSharedInternals.p = previousPriority), 22098 (ReactSharedInternals.T = prevTransition); 22099 } 22100 } 22101 function dispatchContinuousEvent( 22102 domEventName, 22103 eventSystemFlags, 22104 container, 22105 nativeEvent 22106 ) { 22107 var prevTransition = ReactSharedInternals.T; 22108 ReactSharedInternals.T = null; 22109 var previousPriority = ReactDOMSharedInternals.p; 22110 try { 22111 (ReactDOMSharedInternals.p = 8), 22112 dispatchEvent(domEventName, eventSystemFlags, container, nativeEvent); 22113 } finally { 22114 (ReactDOMSharedInternals.p = previousPriority), 22115 (ReactSharedInternals.T = prevTransition); 22116 } 22117 } 22118 function dispatchEvent( 22119 domEventName, 22120 eventSystemFlags, 22121 targetContainer, 22122 nativeEvent 22123 ) { 22124 if (_enabled) { 22125 var blockedOn = findInstanceBlockingEvent(nativeEvent); 22126 if (null === blockedOn) 22127 dispatchEventForPluginEventSystem( 22128 domEventName, 22129 eventSystemFlags, 22130 nativeEvent, 22131 return_targetInst, 22132 targetContainer 22133 ), 22134 clearIfContinuousEvent(domEventName, nativeEvent); 22135 else if ( 22136 queueIfContinuousEvent( 22137 blockedOn, 22138 domEventName, 22139 eventSystemFlags, 22140 targetContainer, 22141 nativeEvent 22142 ) 22143 ) 22144 nativeEvent.stopPropagation(); 22145 else if ( 22146 (clearIfContinuousEvent(domEventName, nativeEvent), 22147 eventSystemFlags & 4 && 22148 -1 < discreteReplayableEvents.indexOf(domEventName)) 22149 ) { 22150 for (; null !== blockedOn; ) { 22151 var fiber = getInstanceFromNode(blockedOn); 22152 if (null !== fiber) 22153 switch (fiber.tag) { 22154 case 3: 22155 fiber = fiber.stateNode; 22156 if (fiber.current.memoizedState.isDehydrated) { 22157 var lanes = getHighestPriorityLanes(fiber.pendingLanes); 22158 if (0 !== lanes) { 22159 var root = fiber; 22160 root.pendingLanes |= 2; 22161 for (root.entangledLanes |= 2; lanes; ) { 22162 var lane = 1 << (31 - clz32(lanes)); 22163 root.entanglements[1] |= lane; 22164 lanes &= ~lane; 22165 } 22166 ensureRootIsScheduled(fiber); 22167 0 === (executionContext & 6) && 22168 ((workInProgressRootRenderTargetTime = now() + 500), 22169 flushSyncWorkAcrossRoots_impl(0)); 22170 } 22171 } 22172 break; 22173 case 31: 22174 case 13: 22175 (root = enqueueConcurrentRenderForLane(fiber, 2)), 22176 null !== root && scheduleUpdateOnFiber(root, fiber, 2), 22177 flushSyncWork$1(), 22178 markRetryLaneIfNotHydrated(fiber, 2); 22179 } 22180 fiber = findInstanceBlockingEvent(nativeEvent); 22181 null === fiber && 22182 dispatchEventForPluginEventSystem( 22183 domEventName, 22184 eventSystemFlags, 22185 nativeEvent, 22186 return_targetInst, 22187 targetContainer 22188 ); 22189 if (fiber === blockedOn) break; 22190 blockedOn = fiber; 22191 } 22192 null !== blockedOn && nativeEvent.stopPropagation(); 22193 } else 22194 dispatchEventForPluginEventSystem( 22195 domEventName, 22196 eventSystemFlags, 22197 nativeEvent, 22198 null, 22199 targetContainer 22200 ); 22201 } 22202 } 22203 function findInstanceBlockingEvent(nativeEvent) { 22204 nativeEvent = getEventTarget(nativeEvent); 22205 return findInstanceBlockingTarget(nativeEvent); 22206 } 22207 var return_targetInst = null; 22208 function findInstanceBlockingTarget(targetNode) { 22209 return_targetInst = null; 22210 targetNode = getClosestInstanceFromNode(targetNode); 22211 if (null !== targetNode) { 22212 var nearestMounted = getNearestMountedFiber(targetNode); 22213 if (null === nearestMounted) targetNode = null; 22214 else { 22215 var tag = nearestMounted.tag; 22216 if (13 === tag) { 22217 targetNode = getSuspenseInstanceFromFiber(nearestMounted); 22218 if (null !== targetNode) return targetNode; 22219 targetNode = null; 22220 } else if (31 === tag) { 22221 targetNode = getActivityInstanceFromFiber(nearestMounted); 22222 if (null !== targetNode) return targetNode; 22223 targetNode = null; 22224 } else if (3 === tag) { 22225 if (nearestMounted.stateNode.current.memoizedState.isDehydrated) 22226 return 3 === nearestMounted.tag 22227 ? nearestMounted.stateNode.containerInfo 22228 : null; 22229 targetNode = null; 22230 } else nearestMounted !== targetNode && (targetNode = null); 22231 } 22232 } 22233 return_targetInst = targetNode; 22234 return null; 22235 } 22236 function getEventPriority(domEventName) { 22237 switch (domEventName) { 22238 case "beforetoggle": 22239 case "cancel": 22240 case "click": 22241 case "close": 22242 case "contextmenu": 22243 case "copy": 22244 case "cut": 22245 case "auxclick": 22246 case "dblclick": 22247 case "dragend": 22248 case "dragstart": 22249 case "drop": 22250 case "focusin": 22251 case "focusout": 22252 case "input": 22253 case "invalid": 22254 case "keydown": 22255 case "keypress": 22256 case "keyup": 22257 case "mousedown": 22258 case "mouseup": 22259 case "paste": 22260 case "pause": 22261 case "play": 22262 case "pointercancel": 22263 case "pointerdown": 22264 case "pointerup": 22265 case "ratechange": 22266 case "reset": 22267 case "resize": 22268 case "seeked": 22269 case "submit": 22270 case "toggle": 22271 case "touchcancel": 22272 case "touchend": 22273 case "touchstart": 22274 case "volumechange": 22275 case "change": 22276 case "selectionchange": 22277 case "textInput": 22278 case "compositionstart": 22279 case "compositionend": 22280 case "compositionupdate": 22281 case "beforeblur": 22282 case "afterblur": 22283 case "beforeinput": 22284 case "blur": 22285 case "fullscreenchange": 22286 case "focus": 22287 case "hashchange": 22288 case "popstate": 22289 case "select": 22290 case "selectstart": 22291 return 2; 22292 case "drag": 22293 case "dragenter": 22294 case "dragexit": 22295 case "dragleave": 22296 case "dragover": 22297 case "mousemove": 22298 case "mouseout": 22299 case "mouseover": 22300 case "pointermove": 22301 case "pointerout": 22302 case "pointerover": 22303 case "scroll": 22304 case "touchmove": 22305 case "wheel": 22306 case "mouseenter": 22307 case "mouseleave": 22308 case "pointerenter": 22309 case "pointerleave": 22310 return 8; 22311 case "message": 22312 switch (getCurrentPriorityLevel()) { 22313 case ImmediatePriority: 22314 return 2; 22315 case UserBlockingPriority: 22316 return 8; 22317 case NormalPriority$1: 22318 case LowPriority: 22319 return 32; 22320 case IdlePriority: 22321 return 268435456; 22322 default: 22323 return 32; 22324 } 22325 default: 22326 return 32; 22327 } 22328 } 22329 var hasScheduledReplayAttempt = false, 22330 queuedFocus = null, 22331 queuedDrag = null, 22332 queuedMouse = null, 22333 queuedPointers = new Map(), 22334 queuedPointerCaptures = new Map(), 22335 queuedExplicitHydrationTargets = [], 22336 discreteReplayableEvents = 22337 "mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split( 22338 " " 22339 ); 22340 function clearIfContinuousEvent(domEventName, nativeEvent) { 22341 switch (domEventName) { 22342 case "focusin": 22343 case "focusout": 22344 queuedFocus = null; 22345 break; 22346 case "dragenter": 22347 case "dragleave": 22348 queuedDrag = null; 22349 break; 22350 case "mouseover": 22351 case "mouseout": 22352 queuedMouse = null; 22353 break; 22354 case "pointerover": 22355 case "pointerout": 22356 queuedPointers.delete(nativeEvent.pointerId); 22357 break; 22358 case "gotpointercapture": 22359 case "lostpointercapture": 22360 queuedPointerCaptures.delete(nativeEvent.pointerId); 22361 } 22362 } 22363 function accumulateOrCreateContinuousQueuedReplayableEvent( 22364 existingQueuedEvent, 22365 blockedOn, 22366 domEventName, 22367 eventSystemFlags, 22368 targetContainer, 22369 nativeEvent 22370 ) { 22371 if ( 22372 null === existingQueuedEvent || 22373 existingQueuedEvent.nativeEvent !== nativeEvent 22374 ) 22375 return ( 22376 (existingQueuedEvent = { 22377 blockedOn: blockedOn, 22378 domEventName: domEventName, 22379 eventSystemFlags: eventSystemFlags, 22380 nativeEvent: nativeEvent, 22381 targetContainers: [targetContainer] 22382 }), 22383 null !== blockedOn && 22384 ((blockedOn = getInstanceFromNode(blockedOn)), 22385 null !== blockedOn && attemptContinuousHydration(blockedOn)), 22386 existingQueuedEvent 22387 ); 22388 existingQueuedEvent.eventSystemFlags |= eventSystemFlags; 22389 blockedOn = existingQueuedEvent.targetContainers; 22390 null !== targetContainer && 22391 -1 === blockedOn.indexOf(targetContainer) && 22392 blockedOn.push(targetContainer); 22393 return existingQueuedEvent; 22394 } 22395 function queueIfContinuousEvent( 22396 blockedOn, 22397 domEventName, 22398 eventSystemFlags, 22399 targetContainer, 22400 nativeEvent 22401 ) { 22402 switch (domEventName) { 22403 case "focusin": 22404 return ( 22405 (queuedFocus = accumulateOrCreateContinuousQueuedReplayableEvent( 22406 queuedFocus, 22407 blockedOn, 22408 domEventName, 22409 eventSystemFlags, 22410 targetContainer, 22411 nativeEvent 22412 )), 22413 true 22414 ); 22415 case "dragenter": 22416 return ( 22417 (queuedDrag = accumulateOrCreateContinuousQueuedReplayableEvent( 22418 queuedDrag, 22419 blockedOn, 22420 domEventName, 22421 eventSystemFlags, 22422 targetContainer, 22423 nativeEvent 22424 )), 22425 true 22426 ); 22427 case "mouseover": 22428 return ( 22429 (queuedMouse = accumulateOrCreateContinuousQueuedReplayableEvent( 22430 queuedMouse, 22431 blockedOn, 22432 domEventName, 22433 eventSystemFlags, 22434 targetContainer, 22435 nativeEvent 22436 )), 22437 true 22438 ); 22439 case "pointerover": 22440 var pointerId = nativeEvent.pointerId; 22441 queuedPointers.set( 22442 pointerId, 22443 accumulateOrCreateContinuousQueuedReplayableEvent( 22444 queuedPointers.get(pointerId) || null, 22445 blockedOn, 22446 domEventName, 22447 eventSystemFlags, 22448 targetContainer, 22449 nativeEvent 22450 ) 22451 ); 22452 return true; 22453 case "gotpointercapture": 22454 return ( 22455 (pointerId = nativeEvent.pointerId), 22456 queuedPointerCaptures.set( 22457 pointerId, 22458 accumulateOrCreateContinuousQueuedReplayableEvent( 22459 queuedPointerCaptures.get(pointerId) || null, 22460 blockedOn, 22461 domEventName, 22462 eventSystemFlags, 22463 targetContainer, 22464 nativeEvent 22465 ) 22466 ), 22467 true 22468 ); 22469 } 22470 return false; 22471 } 22472 function attemptExplicitHydrationTarget(queuedTarget) { 22473 var targetInst = getClosestInstanceFromNode(queuedTarget.target); 22474 if (null !== targetInst) { 22475 var nearestMounted = getNearestMountedFiber(targetInst); 22476 if (null !== nearestMounted) 22477 if (((targetInst = nearestMounted.tag), 13 === targetInst)) { 22478 if ( 22479 ((targetInst = getSuspenseInstanceFromFiber(nearestMounted)), 22480 null !== targetInst) 22481 ) { 22482 queuedTarget.blockedOn = targetInst; 22483 runWithPriority(queuedTarget.priority, function () { 22484 attemptHydrationAtCurrentPriority(nearestMounted); 22485 }); 22486 return; 22487 } 22488 } else if (31 === targetInst) { 22489 if ( 22490 ((targetInst = getActivityInstanceFromFiber(nearestMounted)), 22491 null !== targetInst) 22492 ) { 22493 queuedTarget.blockedOn = targetInst; 22494 runWithPriority(queuedTarget.priority, function () { 22495 attemptHydrationAtCurrentPriority(nearestMounted); 22496 }); 22497 return; 22498 } 22499 } else if ( 22500 3 === targetInst && 22501 nearestMounted.stateNode.current.memoizedState.isDehydrated 22502 ) { 22503 queuedTarget.blockedOn = 22504 3 === nearestMounted.tag 22505 ? nearestMounted.stateNode.containerInfo 22506 : null; 22507 return; 22508 } 22509 } 22510 queuedTarget.blockedOn = null; 22511 } 22512 function attemptReplayContinuousQueuedEvent(queuedEvent) { 22513 if (null !== queuedEvent.blockedOn) return false; 22514 for ( 22515 var targetContainers = queuedEvent.targetContainers; 22516 0 < targetContainers.length; 22517 22518 ) { 22519 var nextBlockedOn = findInstanceBlockingEvent(queuedEvent.nativeEvent); 22520 if (null === nextBlockedOn) { 22521 nextBlockedOn = queuedEvent.nativeEvent; 22522 var nativeEventClone = new nextBlockedOn.constructor( 22523 nextBlockedOn.type, 22524 nextBlockedOn 22525 ); 22526 currentReplayingEvent = nativeEventClone; 22527 nextBlockedOn.target.dispatchEvent(nativeEventClone); 22528 currentReplayingEvent = null; 22529 } else 22530 return ( 22531 (targetContainers = getInstanceFromNode(nextBlockedOn)), 22532 null !== targetContainers && 22533 attemptContinuousHydration(targetContainers), 22534 (queuedEvent.blockedOn = nextBlockedOn), 22535 false 22536 ); 22537 targetContainers.shift(); 22538 } 22539 return true; 22540 } 22541 function attemptReplayContinuousQueuedEventInMap(queuedEvent, key, map) { 22542 attemptReplayContinuousQueuedEvent(queuedEvent) && map.delete(key); 22543 } 22544 function replayUnblockedEvents() { 22545 hasScheduledReplayAttempt = false; 22546 null !== queuedFocus && 22547 attemptReplayContinuousQueuedEvent(queuedFocus) && 22548 (queuedFocus = null); 22549 null !== queuedDrag && 22550 attemptReplayContinuousQueuedEvent(queuedDrag) && 22551 (queuedDrag = null); 22552 null !== queuedMouse && 22553 attemptReplayContinuousQueuedEvent(queuedMouse) && 22554 (queuedMouse = null); 22555 queuedPointers.forEach(attemptReplayContinuousQueuedEventInMap); 22556 queuedPointerCaptures.forEach(attemptReplayContinuousQueuedEventInMap); 22557 } 22558 function scheduleCallbackIfUnblocked(queuedEvent, unblocked) { 22559 queuedEvent.blockedOn === unblocked && 22560 ((queuedEvent.blockedOn = null), 22561 hasScheduledReplayAttempt || 22562 ((hasScheduledReplayAttempt = true), 22563 Scheduler.unstable_scheduleCallback( 22564 Scheduler.unstable_NormalPriority, 22565 replayUnblockedEvents 22566 ))); 22567 } 22568 var lastScheduledReplayQueue = null; 22569 function scheduleReplayQueueIfNeeded(formReplayingQueue) { 22570 lastScheduledReplayQueue !== formReplayingQueue && 22571 ((lastScheduledReplayQueue = formReplayingQueue), 22572 Scheduler.unstable_scheduleCallback( 22573 Scheduler.unstable_NormalPriority, 22574 function () { 22575 lastScheduledReplayQueue === formReplayingQueue && 22576 (lastScheduledReplayQueue = null); 22577 for (var i = 0; i < formReplayingQueue.length; i += 3) { 22578 var form = formReplayingQueue[i], 22579 submitterOrAction = formReplayingQueue[i + 1], 22580 formData = formReplayingQueue[i + 2]; 22581 if ("function" !== typeof submitterOrAction) 22582 if (null === findInstanceBlockingTarget(submitterOrAction || form)) 22583 continue; 22584 else break; 22585 var formInst = getInstanceFromNode(form); 22586 null !== formInst && 22587 (formReplayingQueue.splice(i, 3), 22588 (i -= 3), 22589 startHostTransition( 22590 formInst, 22591 { 22592 pending: true, 22593 data: formData, 22594 method: form.method, 22595 action: submitterOrAction 22596 }, 22597 submitterOrAction, 22598 formData 22599 )); 22600 } 22601 } 22602 )); 22603 } 22604 function retryIfBlockedOn(unblocked) { 22605 function unblock(queuedEvent) { 22606 return scheduleCallbackIfUnblocked(queuedEvent, unblocked); 22607 } 22608 null !== queuedFocus && scheduleCallbackIfUnblocked(queuedFocus, unblocked); 22609 null !== queuedDrag && scheduleCallbackIfUnblocked(queuedDrag, unblocked); 22610 null !== queuedMouse && scheduleCallbackIfUnblocked(queuedMouse, unblocked); 22611 queuedPointers.forEach(unblock); 22612 queuedPointerCaptures.forEach(unblock); 22613 for (var i = 0; i < queuedExplicitHydrationTargets.length; i++) { 22614 var queuedTarget = queuedExplicitHydrationTargets[i]; 22615 queuedTarget.blockedOn === unblocked && (queuedTarget.blockedOn = null); 22616 } 22617 for ( 22618 ; 22619 0 < queuedExplicitHydrationTargets.length && 22620 ((i = queuedExplicitHydrationTargets[0]), null === i.blockedOn); 22621 22622 ) 22623 attemptExplicitHydrationTarget(i), 22624 null === i.blockedOn && queuedExplicitHydrationTargets.shift(); 22625 i = (unblocked.ownerDocument || unblocked).$$reactFormReplay; 22626 if (null != i) 22627 for (queuedTarget = 0; queuedTarget < i.length; queuedTarget += 3) { 22628 var form = i[queuedTarget], 22629 submitterOrAction = i[queuedTarget + 1], 22630 formProps = form[internalPropsKey] || null; 22631 if ("function" === typeof submitterOrAction) 22632 formProps || scheduleReplayQueueIfNeeded(i); 22633 else if (formProps) { 22634 var action = null; 22635 if (submitterOrAction && submitterOrAction.hasAttribute("formAction")) 22636 if ( 22637 ((form = submitterOrAction), 22638 (formProps = submitterOrAction[internalPropsKey] || null)) 22639 ) 22640 action = formProps.formAction; 22641 else { 22642 if (null !== findInstanceBlockingTarget(form)) continue; 22643 } 22644 else action = formProps.action; 22645 "function" === typeof action 22646 ? (i[queuedTarget + 1] = action) 22647 : (i.splice(queuedTarget, 3), (queuedTarget -= 3)); 22648 scheduleReplayQueueIfNeeded(i); 22649 } 22650 } 22651 } 22652 function defaultOnDefaultTransitionIndicator() { 22653 function handleNavigate(event) { 22654 event.canIntercept && 22655 "react-transition" === event.info && 22656 event.intercept({ 22657 handler: function () { 22658 return new Promise(function (resolve) { 22659 return (pendingResolve = resolve); 22660 }); 22661 }, 22662 focusReset: "manual", 22663 scroll: "manual" 22664 }); 22665 } 22666 function handleNavigateComplete() { 22667 null !== pendingResolve && (pendingResolve(), (pendingResolve = null)); 22668 isCancelled || setTimeout(startFakeNavigation, 20); 22669 } 22670 function startFakeNavigation() { 22671 if (!isCancelled && !navigation.transition) { 22672 var currentEntry = navigation.currentEntry; 22673 currentEntry && 22674 null != currentEntry.url && 22675 navigation.navigate(currentEntry.url, { 22676 state: currentEntry.getState(), 22677 info: "react-transition", 22678 history: "replace" 22679 }); 22680 } 22681 } 22682 if ("object" === typeof navigation) { 22683 var isCancelled = false, 22684 pendingResolve = null; 22685 navigation.addEventListener("navigate", handleNavigate); 22686 navigation.addEventListener("navigatesuccess", handleNavigateComplete); 22687 navigation.addEventListener("navigateerror", handleNavigateComplete); 22688 setTimeout(startFakeNavigation, 100); 22689 return function () { 22690 isCancelled = true; 22691 navigation.removeEventListener("navigate", handleNavigate); 22692 navigation.removeEventListener("navigatesuccess", handleNavigateComplete); 22693 navigation.removeEventListener("navigateerror", handleNavigateComplete); 22694 null !== pendingResolve && (pendingResolve(), (pendingResolve = null)); 22695 }; 22696 } 22697 } 22698 function ReactDOMRoot(internalRoot) { 22699 this._internalRoot = internalRoot; 22700 } 22701 ReactDOMHydrationRoot.prototype.render = ReactDOMRoot.prototype.render = 22702 function (children) { 22703 var root = this._internalRoot; 22704 if (null === root) throw Error(formatProdErrorMessage(409)); 22705 var current = root.current, 22706 lane = requestUpdateLane(); 22707 updateContainerImpl(current, lane, children, root, null, null); 22708 }; 22709 ReactDOMHydrationRoot.prototype.unmount = ReactDOMRoot.prototype.unmount = 22710 function () { 22711 var root = this._internalRoot; 22712 if (null !== root) { 22713 this._internalRoot = null; 22714 var container = root.containerInfo; 22715 updateContainerImpl(root.current, 2, null, root, null, null); 22716 flushSyncWork$1(); 22717 container[internalContainerInstanceKey] = null; 22718 } 22719 }; 22720 function ReactDOMHydrationRoot(internalRoot) { 22721 this._internalRoot = internalRoot; 22722 } 22723 ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) { 22724 if (target) { 22725 var updatePriority = resolveUpdatePriority(); 22726 target = { blockedOn: null, target: target, priority: updatePriority }; 22727 for ( 22728 var i = 0; 22729 i < queuedExplicitHydrationTargets.length && 22730 0 !== updatePriority && 22731 updatePriority < queuedExplicitHydrationTargets[i].priority; 22732 i++ 22733 ); 22734 queuedExplicitHydrationTargets.splice(i, 0, target); 22735 0 === i && attemptExplicitHydrationTarget(target); 22736 } 22737 }; 22738 var isomorphicReactPackageVersion$jscomp$inline_1840 = React.version; 22739 if ( 22740 "19.2.
227401" !== 22741 isomorphicReactPackageVersion$jscomp$inline_1840 22742 ) 22743 throw Error( 22744 formatProdErrorMessage( 22745 527, 22746 isomorphicReactPackageVersion$jscomp$inline_1840, 22747 "19.2.1" 22748 ) 22749 ); 22750 ReactDOMSharedInternals.findDOMNode = function (componentOrElement) { 22751 var fiber = componentOrElement._reactInternals; 22752 if (void 0 === fiber) { 22753 if ("function" === typeof componentOrElement.render) 22754 throw Error(formatProdErrorMessage(188)); 22755 componentOrElement = Object.keys(componentOrElement).join(","); 22756 throw Error(formatProdErrorMessage(268, componentOrElement)); 22757 } 22758 componentOrElement = findCurrentFiberUsingSlowPath(fiber); 22759 componentOrElement = 22760 null !== componentOrElement 22761 ? findCurrentHostFiberImpl(componentOrElement) 22762 : null; 22763 componentOrElement = 22764 null === componentOrElement ? null : componentOrElement.stateNode; 22765 return componentOrElement; 22766 }; 22767 var internals$jscomp$inline_2347 = { 22768 bundleType: 0, 22769 version: "19.2.1", 22770 rendererPackageName: "react-dom", 22771 currentDispatcherRef: ReactSharedInternals, 22772 reconcilerVersion: "19.2.1" 22773 }; 22774 if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { 22775 var hook$jscomp$inline_2348 = __REACT_DEVTOOLS_GLOBAL_HOOK__; 22776 if ( 22777 !hook$jscomp$inline_2348.isDisabled && 22778 hook$jscomp$inline_2348.supportsFiber 22779 ) 22780 try { 22781 (rendererID = hook$jscomp$inline_2348.inject( 22782 internals$jscomp$inline_2347 22783 )), 22784 (injectedHook = hook$jscomp$inline_2348); 22785 } catch (err) {} 22786 } 22787 reactDomClient_production.createRoot = function (container, options) { 22788 if (!isValidContainer(container)) throw Error(formatProdErrorMessage(299)); 22789 var isStrictMode = false, 22790 identifierPrefix = "", 22791 onUncaughtError = defaultOnUncaughtError, 22792 onCaughtError = defaultOnCaughtError, 22793 onRecoverableError = defaultOnRecoverableError; 22794 null !== options && 22795 void 0 !== options && 22796 (true === options.unstable_strictMode && (isStrictMode = true), 22797 void 0 !== options.identifierPrefix && 22798 (identifierPrefix = options.identifierPrefix), 22799 void 0 !== options.onUncaughtError && 22800 (onUncaughtError = options.onUncaughtError), 22801 void 0 !== options.onCaughtError && (onCaughtError = options.onCaughtError), 22802 void 0 !== options.onRecoverableError && 22803 (onRecoverableError = options.onRecoverableError)); 22804 options = createFiberRoot( 22805 container, 22806 1, 22807 false, 22808 null, 22809 null, 22810 isStrictMode, 22811 identifierPrefix, 22812 null, 22813 onUncaughtError, 22814 onCaughtError, 22815 onRecoverableError, 22816 defaultOnDefaultTransitionIndicator 22817 ); 22818 container[internalContainerInstanceKey] = options.current; 22819 listenToAllSupportedEvents(container); 22820 return new ReactDOMRoot(options); 22821 }; 22822 reactDomClient_production.hydrateRoot = function (container, initialChildren, options) { 22823 if (!isValidContainer(container)) throw Error(formatProdErrorMessage(299)); 22824 var isStrictMode = false, 22825 identifierPrefix = "", 22826 onUncaughtError = defaultOnUncaughtError, 22827 onCaughtError = defaultOnCaughtError, 22828 onRecoverableError = defaultOnRecoverableError, 22829 formState = null; 22830 null !== options && 22831 void 0 !== options && 22832 (true === options.unstable_strictMode && (isStrictMode = true), 22833 void 0 !== options.identifierPrefix && 22834 (identifierPrefix = options.identifierPrefix), 22835 void 0 !== options.onUncaughtError && 22836 (onUncaughtError = options.onUncaughtError), 22837 void 0 !== options.onCaughtError && (onCaughtError = options.onCaughtError), 22838 void 0 !== options.onRecoverableError && 22839 (onRecoverableError = options.onRecoverableError), 22840 void 0 !== options.formState && (formState = options.formState)); 22841 initialChildren = createFiberRoot( 22842 container, 22843 1, 22844 true, 22845 initialChildren, 22846 null != options ? options : null, 22847 isStrictMode, 22848 identifierPrefix, 22849 formState, 22850 onUncaughtError, 22851 onCaughtError, 22852 onRecoverableError, 22853 defaultOnDefaultTransitionIndicator 22854 ); 22855 initialChildren.context = getContextForSubtree(null); 22856 options = initialChildren.current; 22857 isStrictMode = requestUpdateLane(); 22858 isStrictMode = getBumpedLaneForHydrationByLane(isStrictMode); 22859 identifierPrefix = createUpdate(isStrictMode); 22860 identifierPrefix.callback = null; 22861 enqueueUpdate(options, identifierPrefix, isStrictMode); 22862 options = isStrictMode; 22863 initialChildren.current.lanes = options; 22864 markRootUpdated$1(initialChildren, options); 22865 ensureRootIsScheduled(initialChildren); 22866 container[internalContainerInstanceKey] = initialChildren.current; 22867 listenToAllSupportedEvents(container); 22868 return new ReactDOMHydrationRoot(initialChildren); 22869 }; 22870 reactDomClient_production.version = "19.2.1"; 22871 return reactDomClient_production; 22872} 22873 22874var hasRequiredClient; 22875 22876function requireClient () { 22877 if (hasRequiredClient) return client.exports; 22878 hasRequiredClient = 1; 22879 function checkDCE() { 22880 if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === "undefined" || typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE !== "function") { 22881 return; 22882 } 22883 try { 22884 __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(checkDCE); 22885 } catch (err) { 22886 console.error(err); 22887 } 22888 } 22889 { 22890 checkDCE(); 22891 client.exports = requireReactDomClient_production(); 22892 } 22893 return client.exports; 22894} 22895 22896var clientExports = requireClient(); 22897 22898var DoubleIndexedKV = /** @class */ (function () { 22899 function DoubleIndexedKV() { 22900 this.keyToValue = new Map(); 22901 this.valueToKey = new Map(); 22902 } 22903 DoubleIndexedKV.prototype.set = function (key, value) { 22904 this.keyToValue.set(key, value); 22905 this.valueToKey.set(value, key); 22906 }; 22907 DoubleIndexedKV.prototype.getByKey = function (key) { 22908 return this.keyToValue.get(key); 22909 }; 22910 DoubleIndexedKV.prototype.getByValue = function (value) { 22911 return this.valueToKey.get(value); 22912 }; 22913 DoubleIndexedKV.prototype.clear = function () { 22914 this.keyToValue.clear(); 22915 this.valueToKey.clear(); 22916 }; 22917 return DoubleIndexedKV; 22918}()); 22919 22920var Registry = /** @class */ (function () { 22921 function Registry(generateIdentifier) { 22922 this.generateIdentifier = generateIdentifier; 22923 this.kv = new DoubleIndexedKV(); 22924 } 22925 Registry.prototype.register = function (value, identifier) { 22926 if (this.kv.getByValue(value)) { 22927 return; 22928 } 22929 if (!identifier) { 22930 identifier = this.generateIdentifier(value); 22931 } 22932 this.kv.set(identifier, value); 22933 }; 22934 Registry.prototype.clear = function () { 22935 this.kv.clear(); 22936 }; 22937 Registry.prototype.getIdentifier = function (value) { 22938 return this.kv.getByValue(value); 22939 }; 22940 Registry.prototype.getValue = function (identifier) { 22941 return this.kv.getByKey(identifier); 22942 }; 22943 return Registry; 22944}()); 22945 22946var __extends = (undefined && undefined.__extends) || (function () { 22947 var extendStatics = function (d, b) { 22948 extendStatics = Object.setPrototypeOf || 22949 ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || 22950 function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; 22951 return extendStatics(d, b); 22952 }; 22953 return function (d, b) { 22954 if (typeof b !== "function" && b !== null) 22955 throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); 22956 extendStatics(d, b); 22957 function __() { this.constructor = d; } 22958 d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); 22959 }; 22960})(); 22961var ClassRegistry = /** @class */ (function (_super) { 22962 __extends(ClassRegistry, _super); 22963 function ClassRegistry() { 22964 var _this = _super.call(this, function (c) { return c.name; }) || this; 22965 _this.classToAllowedProps = new Map(); 22966 return _this; 22967 } 22968 ClassRegistry.prototype.register = function (value, options) { 22969 if (typeof options === 'object') { 22970 if (options.allowProps) { 22971 this.classToAllowedProps.set(value, options.allowProps); 22972 } 22973 _super.prototype.register.call(this, value, options.identifier); 22974 } 22975 else { 22976 _super.prototype.register.call(this, value, options); 22977 } 22978 }; 22979 ClassRegistry.prototype.getAllowedProps = function (value) { 22980 return this.classToAllowedProps.get(value); 22981 }; 22982 return ClassRegistry; 22983}(Registry)); 22984 22985var __read$3 = (undefined && undefined.__read) || function (o, n) { 22986 var m = typeof Symbol === "function" && o[Symbol.iterator]; 22987 if (!m) return o; 22988 var i = m.call(o), r, ar = [], e; 22989 try { 22990 while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); 22991 } 22992 catch (error) { e = { error: error }; } 22993 finally { 22994 try { 22995 if (r && !r.done && (m = i["return"])) m.call(i); 22996 } 22997 finally { if (e) throw e.error; } 22998 } 22999 return ar; 23000}; 23001function valuesOfObj(record) { 23002 if ('values' in Object) { 23003 // eslint-disable-next-line es5/no-es6-methods 23004 return Object.values(record); 23005 } 23006 var values = []; 23007 // eslint-disable-next-line no-restricted-syntax 23008 for (var key in record) { 23009 if (record.hasOwnProperty(key)) { 23010 values.push(record[key]); 23011 } 23012 } 23013 return values; 23014} 23015function find(record, predicate) { 23016 var values = valuesOfObj(record); 23017 if ('find' in values) { 23018 // eslint-disable-next-line es5/no-es6-methods 23019 return values.find(predicate); 23020 } 23021 var valuesNotNever = values; 23022 for (var i = 0; i < valuesNotNever.length; i++) { 23023 var value = valuesNotNever[i]; 23024 if (predicate(value)) { 23025 return value; 23026 } 23027 } 23028 return undefined; 23029} 23030function forEach(record, run) {
23031 Object.entries(record).forEach(function (_a) { 23032 var _b = __read$3(_a, 2), key = _b[0], value = _b[1]; 23033 return run(value, key); 23034 }); 23035} 23036function includes(arr, value) { 23037 return arr.indexOf(value) !== -1; 23038} 23039function findArr(record, predicate) { 23040 for (var i = 0; i < record.length; i++) { 23041 var value = record[i]; 23042 if (predicate(value)) { 23043 return value; 23044 } 23045 } 23046 return undefined; 23047} 23048 23049var CustomTransformerRegistry = /** @class */ (function () { 23050 function CustomTransformerRegistry() { 23051 this.transfomers = {}; 23052 } 23053 CustomTransformerRegistry.prototype.register = function (transformer) { 23054 this.transfomers[transformer.name] = transformer; 23055 }; 23056 CustomTransformerRegistry.prototype.findApplicable = function (v) { 23057 return find(this.transfomers, function (transformer) { 23058 return transformer.isApplicable(v); 23059 }); 23060 }; 23061 CustomTransformerRegistry.prototype.findByName = function (name) { 23062 return this.transfomers[name]; 23063 }; 23064 return CustomTransformerRegistry; 23065}()); 23066 23067var getType$1 = function (payload) { 23068 return Object.prototype.toString.call(payload).slice(8, -1); 23069}; 23070var isUndefined = function (payload) { 23071 return typeof payload === 'undefined'; 23072}; 23073var isNull = function (payload) { return payload === null; }; 23074var isPlainObject$1 = function (payload) { 23075 if (typeof payload !== 'object' || payload === null) 23076 return false; 23077 if (payload === Object.prototype) 23078 return false; 23079 if (Object.getPrototypeOf(payload) === null) 23080 return true; 23081 return Object.getPrototypeOf(payload) === Object.prototype; 23082}; 23083var isEmptyObject = function (payload) { 23084 return isPlainObject$1(payload) && Object.keys(payload).length === 0; 23085}; 23086var isArray$1 = function (payload) { 23087 return Array.isArray(payload); 23088}; 23089var isString = function (payload) { 23090 return typeof payload === 'string'; 23091}; 23092var isNumber$1 = function (payload) { 23093 return typeof payload === 'number' && !isNaN(payload); 23094}; 23095var isBoolean = function (payload) { 23096 return typeof payload === 'boolean'; 23097}; 23098var isRegExp = function (payload) { 23099 return payload instanceof RegExp; 23100}; 23101var isMap = function (payload) { 23102 return payload instanceof Map; 23103}; 23104var isSet = function (payload) { 23105 return payload instanceof Set; 23106}; 23107var isSymbol = function (payload) { 23108 return getType$1(payload) === 'Symbol'; 23109}; 23110var isDate = function (payload) { 23111 return payload instanceof Date && !isNaN(payload.valueOf()); 23112}; 23113var isError = function (payload) { 23114 return payload instanceof Error; 23115}; 23116var isNaNValue = function (payload) { 23117 return typeof payload === 'number' && isNaN(payload); 23118}; 23119var isPrimitive = function (payload) { 23120 return isBoolean(payload) || 23121 isNull(payload) || 23122 isUndefined(payload) || 23123 isNumber$1(payload) || 23124 isString(payload) || 23125 isSymbol(payload); 23126}; 23127var isBigint = function (payload) { 23128 return typeof payload === 'bigint'; 23129}; 23130var isInfinite = function (payload) { 23131 return payload === Infinity || payload === -Infinity; 23132}; 23133var isTypedArray = function (payload) { 23134 return ArrayBuffer.isView(payload) && !(payload instanceof DataView); 23135}; 23136var isURL = function (payload) { return payload instanceof URL; }; 23137 23138var escapeKey = function (key) { return key.replace(/\./g, '\\.'); }; 23139var stringifyPath = function (path) { 23140 return path 23141 .map(String) 23142 .map(escapeKey) 23143 .join('.'); 23144}; 23145var parsePath = function (string) { 23146 var result = []; 23147 var segment = ''; 23148 for (var i = 0; i < string.length; i++) { 23149 var char = string.charAt(i); 23150 var isEscapedDot = char === '\\' && string.charAt(i + 1) === '.'; 23151 if (isEscapedDot) { 23152 segment += '.'; 23153 i++; 23154 continue; 23155 } 23156 var isEndOfSegment = char === '.'; 23157 if (isEndOfSegment) { 23158 result.push(segment); 23159 segment = ''; 23160 continue; 23161 } 23162 segment += char; 23163 } 23164 var lastSegment = segment; 23165 result.push(lastSegment); 23166 return result; 23167}; 23168 23169var __assign$2 = (undefined && undefined.__assign) || function () { 23170 __assign$2 = Object.assign || function(t) { 23171 for (var s, i = 1, n = arguments.length; i < n; i++) { 23172 s = arguments[i]; 23173 for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) 23174 t[p] = s[p]; 23175 } 23176 return t; 23177 }; 23178 return __assign$2.apply(this, arguments); 23179}; 23180var __read$2 = (undefined && undefined.__read) || function (o, n) { 23181 var m = typeof Symbol === "function" && o[Symbol.iterator]; 23182 if (!m) return o; 23183 var i = m.call(o), r, ar = [], e; 23184 try { 23185 while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); 23186 } 23187 catch (error) { e = { error: error }; } 23188 finally { 23189 try { 23190 if (r && !r.done && (m = i["return"])) m.call(i); 23191 } 23192 finally { if (e) throw e.error; } 23193 } 23194 return ar; 23195}; 23196var __spreadArray$3 = (undefined && undefined.__spreadArray) || function (to, from) { 23197 for (var i = 0, il = from.length, j = to.length; i < il; i++, j++) 23198 to[j] = from[i]; 23199 return to; 23200}; 23201function simpleTransformation(isApplicable, annotation, transform, untransform) { 23202 return { 23203 isApplicable: isApplicable, 23204 annotation: annotation, 23205 transform: transform, 23206 untransform: untransform 23207 }; 23208} 23209var simpleRules = [ 23210 simpleTransformation(isUndefined, 'undefined', function () { return null; }, function () { return undefined; }), 23211 simpleTransformation(isBigint, 'bigint', function (v) { return v.toString(); }, function (v) { 23212 if (typeof BigInt !== 'undefined') { 23213 return BigInt(v); 23214 } 23215 console.error('Please add a BigInt polyfill.'); 23216 return v; 23217 }), 23218 simpleTransformation(isDate, 'Date', function (v) { return v.toISOString(); }, function (v) { return new Date(v); }), 23219 simpleTransformation(isError, 'Error', function (v, superJson) { 23220 var baseError = { 23221 name: v.name, 23222 message: v.message 23223 }; 23224 superJson.allowedErrorProps.forEach(function (prop) { 23225 baseError[prop] = v[prop]; 23226 }); 23227 return baseError; 23228 }, function (v, superJson) { 23229 var e = new Error(v.message); 23230 e.name = v.name; 23231 e.stack = v.stack; 23232 superJson.allowedErrorProps.forEach(function (prop) { 23233 e[prop] = v[prop]; 23234 }); 23235 return e; 23236 }), 23237 simpleTransformation(isRegExp, 'regexp', function (v) { return '' + v; }, function (regex) { 23238 var body = regex.slice(1, regex.lastIndexOf('/')); 23239 var flags = regex.slice(regex.lastIndexOf('/') + 1); 23240 return new RegExp(body, flags); 23241 }), 23242 simpleTransformation(isSet, 'set', 23243 // (sets only exist in es6+) 23244 // eslint-disable-next-line es5/no-es6-methods 23245 function (v) { return __spreadArray$3([], __read$2(v.values())
23245); }, function (v) { return new Set(v); }), 23246 simpleTransformation(isMap, 'map', function (v) { return __spreadArray$3([], __read$2(v.entries())); }, function (v) { return new Map(v); }), 23247 simpleTransformation(function (v) { return isNaNValue(v) || isInfinite(v); }, 'number', function (v) { 23248 if (isNaNValue(v)) { 23249 return 'NaN'; 23250 } 23251 if (v > 0) { 23252 return 'Infinity'; 23253 } 23254 else { 23255 return '-Infinity'; 23256 } 23257 }, Number), 23258 simpleTransformation(function (v) { return v === 0 && 1 / v === -Infinity; }, 'number', function () { 23259 return '-0'; 23260 }, Number), 23261 simpleTransformation(isURL, 'URL', function (v) { return v.toString(); }, function (v) { return new URL(v); }), 23262]; 23263function compositeTransformation(isApplicable, annotation, transform, untransform) { 23264 return { 23265 isApplicable: isApplicable, 23266 annotation: annotation, 23267 transform: transform, 23268 untransform: untransform 23269 }; 23270} 23271var symbolRule = compositeTransformation(function (s, superJson) { 23272 if (isSymbol(s)) { 23273 var isRegistered = !!superJson.symbolRegistry.getIdentifier(s); 23274 return isRegistered; 23275 } 23276 return false; 23277}, function (s, superJson) { 23278 var identifier = superJson.symbolRegistry.getIdentifier(s); 23279 return ['symbol', identifier]; 23280}, function (v) { return v.description; }, function (_, a, superJson) { 23281 var value = superJson.symbolRegistry.getValue(a[1]); 23282 if (!value) { 23283 throw new Error('Trying to deserialize unknown symbol'); 23284 } 23285 return value; 23286}); 23287var constructorToName = [ 23288 Int8Array, 23289 Uint8Array, 23290 Int16Array, 23291 Uint16Array, 23292 Int32Array, 23293 Uint32Array, 23294 Float32Array, 23295 Float64Array, 23296 Uint8ClampedArray, 23297].reduce(function (obj, ctor) { 23298 obj[ctor.name] = ctor; 23299 return obj; 23300}, {}); 23301var typedArrayRule = compositeTransformation(isTypedArray, function (v) { return ['typed-array', v.constructor.name]; }, function (v) { return __spreadArray$3([], __read$2(v)); }, function (v, a) { 23302 var ctor = constructorToName[a[1]]; 23303 if (!ctor) { 23304 throw new Error('Trying to deserialize unknown typed array'); 23305 } 23306 return new ctor(v); 23307}); 23308function isInstanceOfRegisteredClass(potentialClass, superJson) { 23309 if (potentialClass === null || potentialClass === void 0 ? void 0 : potentialClass.constructor) { 23310 var isRegistered = !!superJson.classRegistry.getIdentifier(potentialClass.constructor); 23311 return isRegistered; 23312 } 23313 return false; 23314} 23315var classRule = compositeTransformation(isInstanceOfRegisteredClass, function (clazz, superJson) { 23316 var identifier = superJson.classRegistry.getIdentifier(clazz.constructor); 23317 return ['class', identifier]; 23318}, function (clazz, superJson) { 23319 var allowedProps = superJson.classRegistry.getAllowedProps(clazz.constructor); 23320 if (!allowedProps) { 23321 return __assign$2({}, clazz); 23322 } 23323 var result = {}; 23324 allowedProps.forEach(function (prop) { 23325 result[prop] = clazz[prop]; 23326 }); 23327 return result; 23328}, function (v, a, superJson) { 23329 var clazz = superJson.classRegistry.getValue(a[1]); 23330 if (!clazz) { 23331 throw new Error('Trying to deserialize unknown class - check https://github.com/blitz-js/superjson/issues/116#issuecomment-773996564'); 23332 } 23333 return Object.assign(Object.create(clazz.prototype), v); 23334}); 23335var customRule = compositeTransformation(function (value, superJson) { 23336 return !!superJson.customTransformerRegistry.findApplicable(value); 23337}, function (value, superJson) { 23338 var transformer = superJson.customTransformerRegistry.findApplicable(value); 23339 return ['custom', transformer.name]; 23340}, function (value, superJson) { 23341 var transformer = superJson.customTransformerRegistry.findApplicable(value); 23342 return transformer.serialize(value); 23343}, function (v, a, superJson) { 23344 var transformer = superJson.customTransformerRegistry.findByName(a[1]); 23345 if (!transformer) { 23346 throw new Error('Trying to deserialize unknown custom value'); 23347 } 23348 return transformer.deserialize(v); 23349}); 23350var compositeRules = [classRule, symbolRule, customRule, typedArrayRule]; 23351var transformValue = function (value, superJson) { 23352 var applicableCompositeRule = findArr(compositeRules, function (rule) { 23353 return rule.isApplicable(value, superJson); 23354 }); 23355 if (applicableCompositeRule) { 23356 return { 23357 value: applicableCompositeRule.transform(value, superJson), 23358 type: applicableCompositeRule.annotation(value, superJson) 23359 }; 23360 } 23361 var applicableSimpleRule = findArr(simpleRules, function (rule) { 23362 return rule.isApplicable(value, superJson); 23363 }); 23364 if (applicableSimpleRule) { 23365 return { 23366 value: applicableSimpleRule.transform(value, superJson), 23367 type: applicableSimpleRule.annotation 23368 }; 23369 } 23370 return undefined; 23371}; 23372var simpleRulesByAnnotation = {};
23373simpleRules.forEach(function (rule) { 23374 simpleRulesByAnnotation[rule.annotation] = rule; 23375}); 23376var untransformValue = function (json, type, superJson) { 23377 if (isArray$1(type)) { 23378 switch (type[0]) { 23379 case 'symbol': 23380 return symbolRule.untransform(json, type, superJson); 23381 case 'class': 23382 return classRule.untransform(json, type, superJson); 23383 case 'custom': 23384 return customRule.untransform(json, type, superJson); 23385 case 'typed-array': 23386 return typedArrayRule.untransform(json, type, superJson); 23387 default: 23388 throw new Error('Unknown transformation: ' + type); 23389 } 23390 } 23391 else { 23392 var transformation = simpleRulesByAnnotation[type]; 23393 if (!transformation) { 23394 throw new Error('Unknown transformation: ' + type); 23395 } 23396 return transformation.untransform(json, superJson); 23397 } 23398}; 23399 23400var getNthKey = function (value, n) { 23401 var keys = value.keys(); 23402 while (n > 0) { 23403 keys.next(); 23404 n--; 23405 } 23406 return keys.next().value; 23407}; 23408function validatePath(path) { 23409 if (includes(path, '__proto__')) { 23410 throw new Error('__proto__ is not allowed as a property'); 23411 } 23412 if (includes(path, 'prototype')) { 23413 throw new Error('prototype is not allowed as a property'); 23414 } 23415 if (includes(path, 'constructor')) { 23416 throw new Error('constructor is not allowed as a property'); 23417 } 23418} 23419var getDeep = function (object, path) { 23420 validatePath(path); 23421 for (var i = 0; i < path.length; i++) { 23422 var key = path[i]; 23423 if (isSet(object)) { 23424 object = getNthKey(object, +key); 23425 } 23426 else if (isMap(object)) { 23427 var row = +key; 23428 var type = +path[++i] === 0 ? 'key' : 'value'; 23429 var keyOfRow = getNthKey(object, row); 23430 switch (type) { 23431 case 'key': 23432 object = keyOfRow; 23433 break; 23434 case 'value': 23435 object = object.get(keyOfRow); 23436 break; 23437 } 23438 } 23439 else { 23440 object = object[key]; 23441 } 23442 } 23443 return object; 23444}; 23445var setDeep = function (object, path, mapper) { 23446 validatePath(path); 23447 if (path.length === 0) { 23448 return mapper(object); 23449 } 23450 var parent = object; 23451 for (var i = 0; i < path.length - 1; i++) { 23452 var key = path[i]; 23453 if (isArray$1(parent)) { 23454 var index = +key; 23455 parent = parent[index]; 23456 } 23457 else if (isPlainObject$1(parent)) { 23458 parent = parent[key]; 23459 } 23460 else if (isSet(parent)) { 23461 var row = +key; 23462 parent = getNthKey(parent, row); 23463 } 23464 else if (isMap(parent)) { 23465 var isEnd = i === path.length - 2; 23466 if (isEnd) { 23467 break; 23468 } 23469 var row = +key; 23470 var type = +path[++i] === 0 ? 'key' : 'value'; 23471 var keyOfRow = getNthKey(parent, row); 23472 switch (type) { 23473 case 'key': 23474 parent = keyOfRow; 23475 break; 23476 case 'value': 23477 parent = parent.get(keyOfRow); 23478 break; 23479 } 23480 } 23481 } 23482 var lastKey = path[path.length - 1]; 23483 if (isArray$1(parent)) { 23484 parent[+lastKey] = mapper(parent[+lastKey]); 23485 } 23486 else if (isPlainObject$1(parent)) { 23487 parent[lastKey] = mapper(parent[lastKey]); 23488 } 23489 if (isSet(parent)) { 23490 var oldValue = getNthKey(parent, +lastKey); 23491 var newValue = mapper(oldValue); 23492 if (oldValue !== newValue) { 23493 parent["delete"](oldValue); 23494 parent.add(newValue); 23495 } 23496 } 23497 if (isMap(parent)) { 23498 var row = +path[path.length - 2]; 23499 var keyToRow = getNthKey(parent, row); 23500 var type = +lastKey === 0 ? 'key' : 'value'; 23501 switch (type) { 23502 case 'key': { 23503 var newKey = mapper(keyToRow); 23504 parent.set(newKey, parent.get(keyToRow)); 23505 if (newKey !== keyToRow) { 23506 parent["delete"](keyToRow); 23507 } 23508 break; 23509 } 23510 case 'value': { 23511 parent.set(keyToRow, mapper(parent.get(keyToRow))); 23512 break; 23513 } 23514 } 23515 } 23516 return object; 23517}; 23518 23519var __read$1 = (undefined && undefined.__read) || function (o, n) { 23520 var m = typeof Symbol === "function" && o[Symbol.iterator]; 23521 if (!m) return o; 23522 var i = m.call(o), r, ar = [], e; 23523 try { 23524 while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); 23525 } 23526 catch (error) { e = { error: error }; } 23527 finally { 23528 try { 23529 if (r && !r.done && (m = i["return"])) m.call(i); 23530 } 23531 finally { if (e) throw e.error; } 23532 } 23533 return ar; 23534}; 23535var __spreadArray$2 = (undefined && undefined.__spreadArray) || function (to, from) { 23536 for (var i = 0, il = from.length, j = to.length; i < il; i++, j++) 23537 to[j] = from[i]; 23538 return to; 23539}; 23540function traverse(tree, walker, origin) { 23541 if (origin === void 0) { origin = []; } 23542 if (!tree) { 23543 return; 23544 } 23545 if (!isArray$1(tree)) {
23546 forEach(tree, function (subtree, key) { 23547 return traverse(subtree, walker, __spreadArray$2(__spreadArray$2([], __read$1(origin)), __read$1(parsePath(key)))); 23548 }); 23549 return; 23550 } 23551 var _a = __read$1(tree, 2), nodeValue = _a[0], children = _a[1]; 23552 if (children) { 23553 forEach(children, function (child, key) { 23554 traverse(child, walker, __spreadArray$2(__spreadArray$2([], __read$1(origin)), __read$1(parsePath(key)))); 23555 }); 23556 } 23557 walker(nodeValue, origin); 23558} 23559function applyValueAnnotations(plain, annotations, superJson) { 23560 traverse(annotations, function (type, path) { 23561 plain = setDeep(plain, path, function (v) { return untransformValue(v, type, superJson); }); 23562 }); 23563 return plain; 23564} 23565function applyReferentialEqualityAnnotations(plain, annotations) { 23566 function apply(identicalPaths, path) { 23567 var object = getDeep(plain, parsePath(path)); 23568 identicalPaths.map(parsePath).forEach(function (identicalObjectPath) { 23569 plain = setDeep(plain, identicalObjectPath, function () { return object; }); 23570 }); 23571 } 23572 if (isArray$1(annotations)) { 23573 var _a = __read$1(annotations, 2), root = _a[0], other = _a[1]; 23574 root.forEach(function (identicalPath) { 23575 plain = setDeep(plain, parsePath(identicalPath), function () { return plain; }); 23576 }); 23577 if (other) { 23578 forEach(other, apply); 23579 } 23580 } 23581 else { 23582 forEach(annotations, apply); 23583 } 23584 return plain; 23585} 23586var isDeep = function (object, superJson) { 23587 return isPlainObject$1(object) || 23588 isArray$1(object) || 23589 isMap(object) || 23590 isSet(object) || 23591 isInstanceOfRegisteredClass(object, superJson); 23592}; 23593function addIdentity(object, path, identities) { 23594 var existingSet = identities.get(object); 23595 if (existingSet) { 23596 existingSet.push(path); 23597 } 23598 else { 23599 identities.set(object, [path]); 23600 } 23601} 23602function generateReferentialEqualityAnnotations(identitites, dedupe) { 23603 var result = {}; 23604 var rootEqualityPaths = undefined; 23605 identitites.forEach(function (paths) { 23606 if (paths.length <= 1) { 23607 return; 23608 } 23609 // if we're not deduping, all of these objects continue existing. 23610 // putting the shortest path first makes it easier to parse for humans 23611 // if we're deduping though, only the first entry will still exist, so we can't do this optimisation. 23612 if (!dedupe) { 23613 paths = paths 23614 .map(function (path) { return path.map(String); }) 23615 .sort(function (a, b) { return a.length - b.length; }); 23616 } 23617 var _a = __read$1(paths), representativePath = _a[0], identicalPaths = _a.slice(1); 23618 if (representativePath.length === 0) { 23619 rootEqualityPaths = identicalPaths.map(stringifyPath); 23620 } 23621 else { 23622 result[stringifyPath(representativePath)] = identicalPaths.map(stringifyPath); 23623 } 23624 }); 23625 if (rootEqualityPaths) { 23626 if (isEmptyObject(result)) { 23627 return [rootEqualityPaths]; 23628 } 23629 else { 23630 return [rootEqualityPaths, result]; 23631 } 23632 } 23633 else { 23634 return isEmptyObject(result) ? undefined : result; 23635 } 23636} 23637var walker = function (object, identities, superJson, dedupe, path, objectsInThisPath, seenObjects) { 23638 var _a; 23639 if (path === void 0) { path = []; } 23640 if (objectsInThisPath === void 0) { objectsInThisPath = []; } 23641 if (seenObjects === void 0) { seenObjects = new Map(); } 23642 var primitive = isPrimitive(object); 23643 if (!primitive) { 23644 addIdentity(object, path, identities); 23645 var seen = seenObjects.get(object); 23646 if (seen) { 23647 // short-circuit result if we've seen this object before 23648 return dedupe 23649 ? { 23650 transformedValue: null 23651 } 23652 : seen; 23653 } 23654 } 23655 if (!isDeep(object, superJson)) { 23656 var transformed_1 = transformValue(object, superJson); 23657 var result_1 = transformed_1 23658 ? { 23659 transformedValue: transformed_1.value, 23660 annotations: [transformed_1.type] 23661 } 23662 : { 23663 transformedValue: object 23664 }; 23665 if (!primitive) { 23666 seenObjects.set(object, result_1); 23667 } 23668 return result_1; 23669 } 23670 if (includes(objectsInThisPath, object)) { 23671 // prevent circular references 23672 return { 23673 transformedValue: null 23674 }; 23675 } 23676 var transformationResult = transformValue(object, superJson); 23677 var transformed = (_a = transformationResult === null || transformationResult === void 0 ? void 0 : transformationResult.value) !== null && _a !== void 0 ? _a : object; 23678 var transformedValue = isArray$1(transformed) ? [] : {}; 23679 var innerAnnotations = {};
23680 forEach(transformed, function (value, index) { 23681 var recursiveResult = walker(value, identities, superJson, dedupe, __spreadArray$2(__spreadArray$2([], __read$1(path)), [index]), __spreadArray$2(__spreadArray$2([], __read$1(objectsInThisPath)), [object]), seenObjects); 23682 transformedValue[index] = recursiveResult.transformedValue; 23683 if (isArray$1(recursiveResult.annotations)) { 23684 innerAnnotations[index] = recursiveResult.annotations; 23685 } 23686 else if (isPlainObject$1(recursiveResult.annotations)) { 23687 forEach(recursiveResult.annotations, function (tree, key) { 23688 innerAnnotations[escapeKey(index) + '.' + key] = tree; 23689 }); 23690 } 23691 }); 23692 var result = isEmptyObject(innerAnnotations) 23693 ? { 23694 transformedValue: transformedValue, 23695 annotations: !!transformationResult 23696 ? [transformationResult.type] 23697 : undefined 23698 } 23699 : { 23700 transformedValue: transformedValue, 23701 annotations: !!transformationResult 23702 ? [transformationResult.type, innerAnnotations] 23703 : innerAnnotations 23704 }; 23705 if (!primitive) { 23706 seenObjects.set(object, result); 23707 } 23708 return result; 23709}; 23710 23711function getType(payload) { 23712 return Object.prototype.toString.call(payload).slice(8, -1); 23713} 23714 23715function isArray(payload) { 23716 return getType(payload) === "Array"; 23717} 23718 23719function isPlainObject(payload) { 23720 if (getType(payload) !== "Object") 23721 return false; 23722 const prototype = Object.getPrototypeOf(payload); 23723 return !!prototype && prototype.constructor === Object && prototype === Object.prototype; 23724} 23725 23726function assignProp(carry, key, newVal, originalObject, includeNonenumerable) { 23727 const propType = {}.propertyIsEnumerable.call(originalObject, key) ? "enumerable" : "nonenumerable"; 23728 if (propType === "enumerable") 23729 carry[key] = newVal; 23730 if (includeNonenumerable && propType === "nonenumerable") { 23731 Object.defineProperty(carry, key, { 23732 value: newVal, 23733 enumerable: false, 23734 writable: true, 23735 configurable: true 23736 }); 23737 } 23738} 23739function copy(target, options = {}) { 23740 if (isArray(target)) { 23741 return target.map((item) => copy(item, options)); 23742 } 23743 if (!isPlainObject(target)) { 23744 return target; 23745 } 23746 const props = Object.getOwnPropertyNames(target); 23747 const symbols = Object.getOwnPropertySymbols(target); 23748 return [...props, ...symbols].reduce((carry, key) => { 23749 if (isArray(options.props) && !options.props.includes(key)) { 23750 return carry; 23751 } 23752 const val = target[key]; 23753 const newVal = copy(val, options); 23754 assignProp(carry, key, newVal, target, options.nonenumerable); 23755 return carry; 23756 }, {}); 23757} 23758 23759var __assign$1 = (undefined && undefined.__assign) || function () { 23760 __assign$1 = Object.assign || function(t) { 23761 for (var s, i = 1, n = arguments.length; i < n; i++) { 23762 s = arguments[i]; 23763 for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) 23764 t[p] = s[p]; 23765 } 23766 return t; 23767 }; 23768 return __assign$1.apply(this, arguments); 23769}; 23770var __read = (undefined && undefined.__read) || function (o, n) { 23771 var m = typeof Symbol === "function" && o[Symbol.iterator]; 23772 if (!m) return o; 23773 var i = m.call(o), r, ar = [], e; 23774 try { 23775 while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); 23776 } 23777 catch (error) { e = { error: error }; } 23778 finally { 23779 try { 23780 if (r && !r.done && (m = i["return"])) m.call(i); 23781 } 23782 finally { if (e) throw e.error; } 23783 } 23784 return ar; 23785}; 23786var __spreadArray$1 = (undefined && undefined.__spreadArray) || function (to, from) { 23787 for (var i = 0, il = from.length, j = to.length; i < il; i++, j++) 23788 to[j] = from[i]; 23789 return to; 23790}; 23791var SuperJSON = /** @class */ (function () { 23792 /** 23793 * @param dedupeReferentialEqualities If true, SuperJSON will make sure only one instance of referentially equal objects are serialized and the rest are replaced with `null`. 23794 */ 23795 function SuperJSON(_a) { 23796 var _b = _a === void 0 ? {}
23796 : _a, _c = _b.dedupe, dedupe = _c === void 0 ? false : _c; 23797 this.classRegistry = new ClassRegistry(); 23798 this.symbolRegistry = new Registry(function (s) { var _a; return (_a = s.description) !== null && _a !== void 0 ? _a : ''; }); 23799 this.customTransformerRegistry = new CustomTransformerRegistry(); 23800 this.allowedErrorProps = []; 23801 this.dedupe = dedupe; 23802 } 23803 SuperJSON.prototype.serialize = function (object) { 23804 var identities = new Map(); 23805 var output = walker(object, identities, this, this.dedupe); 23806 var res = { 23807 json: output.transformedValue 23808 }; 23809 if (output.annotations) { 23810 res.meta = __assign$1(__assign$1({}, res.meta), { values: output.annotations }); 23811 } 23812 var equalityAnnotations = generateReferentialEqualityAnnotations(identities, this.dedupe); 23813 if (equalityAnnotations) { 23814 res.meta = __assign$1(__assign$1({}, res.meta), { referentialEqualities: equalityAnnotations }); 23815 } 23816 return res; 23817 }; 23818 SuperJSON.prototype.deserialize = function (payload) { 23819 var json = payload.json, meta = payload.meta; 23820 var result = copy(json); 23821 if (meta === null || meta === void 0 ? void 0 : meta.values) { 23822 result = applyValueAnnotations(result, meta.values, this); 23823 } 23824 if (meta === null || meta === void 0 ? void 0 : meta.referentialEqualities) { 23825 result = applyReferentialEqualityAnnotations(result, meta.referentialEqualities); 23826 } 23827 return result; 23828 }; 23829 SuperJSON.prototype.stringify = function (object) { 23830 return JSON.stringify(this.serialize(object)); 23831 }; 23832 SuperJSON.prototype.parse = function (string) { 23833 return this.deserialize(JSON.parse(string)); 23834 }; 23835 SuperJSON.prototype.registerClass = function (v, options) { 23836 this.classRegistry.register(v, options); 23837 }; 23838 SuperJSON.prototype.registerSymbol = function (v, identifier) { 23839 this.symbolRegistry.register(v, identifier); 23840 }; 23841 SuperJSON.prototype.registerCustom = function (transformer, name) { 23842 this.customTransformerRegistry.register(__assign$1({ name: name }, transformer)); 23843 }; 23844 SuperJSON.prototype.allowErrorProps = function () { 23845 var _a; 23846 var props = []; 23847 for (var _i = 0; _i < arguments.length; _i++) { 23848 props[_i] = arguments[_i]; 23849 } 23850 (_a = this.allowedErrorProps).push.apply(_a, __spreadArray$1([], __read(props))); 23851 }; 23852 SuperJSON.defaultInstance = new SuperJSON(); 23853 SuperJSON.serialize = SuperJSON.defaultInstance.serialize.bind(SuperJSON.defaultInstance); 23854 SuperJSON.deserialize = SuperJSON.defaultInstance.deserialize.bind(SuperJSON.defaultInstance); 23855 SuperJSON.stringify = SuperJSON.defaultInstance.stringify.bind(SuperJSON.defaultInstance); 23856 SuperJSON.parse = SuperJSON.defaultInstance.parse.bind(SuperJSON.defaultInstance); 23857 SuperJSON.registerClass = SuperJSON.defaultInstance.registerClass.bind(SuperJSON.defaultInstance); 23858 SuperJSON.registerSymbol = SuperJSON.defaultInstance.registerSymbol.bind(SuperJSON.defaultInstance); 23859 SuperJSON.registerCustom = SuperJSON.defaultInstance.registerCustom.bind(SuperJSON.defaultInstance); 23860 SuperJSON.allowErrorProps = SuperJSON.defaultInstance.allowErrorProps.bind(SuperJSON.defaultInstance); 23861 return SuperJSON; 23862}()); 23863SuperJSON.serialize; 23864SuperJSON.deserialize; 23865SuperJSON.stringify; 23866SuperJSON.parse; 23867SuperJSON.registerClass; 23868SuperJSON.registerCustom; 23869SuperJSON.registerSymbol; 23870SuperJSON.allowErrorProps; 23871 23872const scriptRel = 'modulepreload';const assetsURL = function(dep) { return "/"+dep };const seen = {};const __vitePreload = function preload(baseModule, deps, importerUrl) { 23873 let promise = Promise.resolve(); 23874 if (true && deps && deps.length > 0) { 23875 document.getElementsByTagName("link"); 23876 const cspNonceMeta = document.querySelector("meta[property=csp-nonce]"); 23877 const cspNonce = cspNonceMeta?.nonce || cspNonceMeta?.getAttribute("nonce"); 23878 function allSettled(promises$2) { 23879 return Promise.all(promises$2.map((p) => Promise.resolve(p).then((value$1) => ({ 23880 status: "fulfilled", 23881 value: value$1 23882 }), (reason) => ({ 23883 status: "rejected", 23884 reason 23885 })))); 23886 } 23887 promise = allSettled(deps.map((dep) => { 23888 dep = assetsURL(dep); 23889 if (dep in seen) return; 23890 seen[dep] = true;
23891 const isCss = dep.endsWith(".css"); 23892 const cssSelector = isCss ? "[rel=\"stylesheet\"]" : ""; 23893 if (document.querySelector(`link[href="${dep}"]${cssSelector}`)) return; 23894 const link = document.createElement("link"); 23895 link.rel = isCss ? "stylesheet" : scriptRel; 23896 if (!isCss) link.as = "script"; 23897 link.crossOrigin = ""; 23898 link.href = dep; 23899 if (cspNonce) link.setAttribute("nonce", cspNonce); 23900 document.head.appendChild(link); 23901 if (isCss) return new Promise((res, rej) => { 23902 link.addEventListener("load", res); 23903 link.addEventListener("error", () => rej(/* @__PURE__ */ new Error(`Unable to preload CSS for ${dep}`))); 23904 }); 23905 })); 23906 } 23907 function handlePreloadError(err$2) { 23908 const e$1 = new Event("vite:preloadError", { cancelable: true }); 23909 e$1.payload = err$2; 23910 window.dispatchEvent(e$1); 23911 if (!e$1.defaultPrevented) throw err$2; 23912 } 23913 return promise.then((res) => { 23914 for (const item of res || []) { 23915 if (item.status !== "rejected") continue; 23916 handlePreloadError(item.reason); 23917 } 23918 return baseModule().catch(handlePreloadError); 23919 }); 23920}; 23921 23922var M=(e,i,s,u,m,a,l,h)=>{let d=document.documentElement,w=["light","dark"];function p(n){(Array.isArray(e)?e:[e]).forEach(y=>{let k=y==="class",S=k&&a?m.map(f=>a[f]||f):m;k?(d.classList.remove(...S),d.classList.add(a&&a[n]?a[n]:n)):d.setAttribute(y,n);}),R(n);}function R(n){h&&w.includes(n)&&(d.style.colorScheme=n);}function c(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(u)p(u);else try{let n=localStorage.getItem(i)||s,y=l&&n==="system"?c():n;p(y);}catch(n){}};var x=reactExports.createContext(void 0),U={setTheme:e=>{},themes:[]},z=()=>{var e;return (e=reactExports.useContext(x))!=null?e:U};reactExports.memo(({forcedTheme:e,storageKey:i,attribute:s,enableSystem:u,enableColorScheme:m,defaultTheme:a,value:l,themes:h,nonce:d,scriptProps:w})=>{let p=JSON.stringify([s,i,a,e,h,l,u,m]).slice(1,-1);return reactExports.createElement("script",{...w,suppressHydrationWarning:true,nonce:typeof window=="undefined"?d:"",dangerouslySetInnerHTML:{__html:`(${M.toString()})(${p})`}})}); 23923 23924var reactDomExports = requireReactDom(); 23925const ReactDOM = /*@__PURE__*/getDefaultExportFromCjs(reactDomExports); 23926 23927function __insertCSS(code) { 23928 if (typeof document == 'undefined') return 23929 let head = document.head || document.getElementsByTagName('head')[0]; 23930 let style = document.createElement('style'); 23931 style.type = 'text/css'; 23932 head.appendChild(style) 23933 ;style.styleSheet ? (style.styleSheet.cssText = code) : style.appendChild(document.createTextNode(code)); 23934} 23935 23936const getAsset = (type)=>{ 23937 switch(type){ 23938 case 'success': 23939 return SuccessIcon; 23940 case 'info': 23941 return InfoIcon; 23942 case 'warning': 23943 return WarningIcon; 23944 case 'error': 23945 return ErrorIcon; 23946 default: 23947 return null; 23948 } 23949}; 23950const bars = Array(12).fill(0); 23951const Loader = ({ visible, className })=>{ 23952 return /*#__PURE__*/ React.createElement("div", { 23953 className: [ 23954 'sonner-loading-wrapper', 23955 className 23956 ].filter(Boolean).join(' '), 23957 "data-visible": visible 23958 }, /*#__PURE__*/ React.createElement("div", { 23959 className: "sonner-spinner" 23960 }, bars.map((_, i)=>/*#__PURE__*/ React.createElement("div", { 23961 className: "sonner-loading-bar", 23962 key: `spinner-bar-${i}` 23963 })))); 23964}; 23965const SuccessIcon = /*#__PURE__*/ React.createElement("svg", { 23966 xmlns: "http://www.w3.org/2000/svg", 23967 viewBox: "0 0 20 20", 23968 fill: "currentColor", 23969 height: "20", 23970 width: "20" 23971}, /*#__PURE__*/ React.createElement("path", { 23972 fillRule: "evenodd", 23973 d: "M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z", 23974 clipRule: "evenodd" 23975})); 23976const WarningIcon = /*#__PURE__*/ React.createElement("svg", { 23977 xmlns: "http://www.w3.org/2000/svg", 23978 viewBox: "0 0 24 24", 23979 fill: "currentColor", 23980 height: "20", 23981 width: "20" 23982}, /*#__PURE__*/ React.createElement("path", { 23983 fillRule: "evenodd", 23984 d: "M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z", 23985 clipRule: "evenodd" 23986})); 23987const InfoIcon = /*#__PURE__*/ React.createElement("svg", { 23988 xmlns: "http://www.w3.org/2000/svg",
vendor: 12,754 bytes, lines 23989-24326
23989 viewBox: "0 0 20 20", 23990 fill: "currentColor", 23991 height: "20", 23992 width: "20" 23993}, /*#__PURE__*/ React.createElement("path", { 23994 fillRule: "evenodd", 23995 d: "M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z", 23996 clipRule: "evenodd" 23997})); 23998const ErrorIcon = /*#__PURE__*/ React.createElement("svg", { 23999 xmlns: "http://www.w3.org/2000/svg", 24000 viewBox: "0 0 20 20", 24001 fill: "currentColor", 24002 height: "20", 24003 width: "20" 24004}, /*#__PURE__*/ React.createElement("path", { 24005 fillRule: "evenodd", 24006 d: "M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z", 24007 clipRule: "evenodd" 24008})); 24009const CloseIcon = /*#__PURE__*/ React.createElement("svg", { 24010 xmlns: "http://www.w3.org/2000/svg", 24011 width: "12", 24012 height: "12", 24013 viewBox: "0 0 24 24", 24014 fill: "none", 24015 stroke: "currentColor", 24016 strokeWidth: "1.5", 24017 strokeLinecap: "round", 24018 strokeLinejoin: "round" 24019}, /*#__PURE__*/ React.createElement("line", { 24020 x1: "18", 24021 y1: "6", 24022 x2: "6", 24023 y2: "18" 24024}), /*#__PURE__*/ React.createElement("line", { 24025 x1: "6", 24026 y1: "6", 24027 x2: "18", 24028 y2: "18" 24029})); 24030 24031const useIsDocumentHidden = ()=>{ 24032 const [isDocumentHidden, setIsDocumentHidden] = React.useState(document.hidden); 24033 React.useEffect(()=>{ 24034 const callback = ()=>{ 24035 setIsDocumentHidden(document.hidden); 24036 }; 24037 document.addEventListener('visibilitychange', callback); 24038 return ()=>window.removeEventListener('visibilitychange', callback); 24039 }, []); 24040 return isDocumentHidden; 24041}; 24042 24043let toastsCounter = 1; 24044class Observer { 24045 constructor(){ 24046 // We use arrow functions to maintain the correct `this` reference 24047 this.subscribe = (subscriber)=>{ 24048 this.subscribers.push(subscriber); 24049 return ()=>{ 24050 const index = this.subscribers.indexOf(subscriber); 24051 this.subscribers.splice(index, 1); 24052 }; 24053 }; 24054 this.publish = (data)=>{ 24055 this.subscribers.forEach((subscriber)=>subscriber(data)); 24056 }; 24057 this.addToast = (data)=>{ 24058 this.publish(data); 24059 this.toasts = [ 24060 ...this.toasts, 24061 data 24062 ]; 24063 }; 24064 this.create = (data)=>{ 24065 var _data_id; 24066 const { message, ...rest } = data; 24067 const id = typeof (data == null ? void 0 : data.id) === 'number' || ((_data_id = data.id) == null ? void 0 : _data_id.length) > 0 ? data.id : toastsCounter++; 24068 const alreadyExists = this.toasts.find((toast)=>{ 24069 return toast.id === id; 24070 }); 24071 const dismissible = data.dismissible === undefined ? true : data.dismissible; 24072 if (this.dismissedToasts.has(id)) { 24073 this.dismissedToasts.delete(id); 24074 } 24075 if (alreadyExists) { 24076 this.toasts = this.toasts.map((toast)=>{ 24077 if (toast.id === id) { 24078 this.publish({ 24079 ...toast, 24080 ...data, 24081 id, 24082 title: message 24083 }); 24084 return { 24085 ...toast, 24086 ...data, 24087 id, 24088 dismissible, 24089 title: message 24090 }; 24091 } 24092 return toast; 24093 }); 24094 } else { 24095 this.addToast({ 24096 title: message, 24097 ...rest, 24098 dismissible, 24099 id 24100 }); 24101 } 24102 return id; 24103 }; 24104 this.dismiss = (id)=>{ 24105 if (id) { 24106 this.dismissedToasts.add(id); 24107 requestAnimationFrame(()=>this.subscribers.forEach((subscriber)=>subscriber({ 24108 id, 24109 dismiss: true 24110 }))); 24111 } else { 24112 this.toasts.forEach((toast)=>{ 24113 this.subscribers.forEach((subscriber)=>subscriber({ 24114 id: toast.id, 24115 dismiss: true 24116 })); 24117 }); 24118 } 24119 return id; 24120 }; 24121 this.message = (message, data)=>{ 24122 return this.create({ 24123 ...data, 24124 message 24125 }); 24126 }; 24127 this.error = (message, data)=>{ 24128 return this.create({ 24129 ...data, 24130 message, 24131 type: 'error' 24132 }); 24133 }; 24134 this.success = (message, data)=>{ 24135 return this.create({ 24136 ...data, 24137 type: 'success', 24138 message 24139 }); 24140 }; 24141 this.info = (message, data)=>{ 24142 return this.create({ 24143 ...data, 24144 type: 'info', 24145 message 24146 }); 24147 }; 24148 this.warning = (message, data)=>{ 24149 return this.create({ 24150 ...data, 24151 type: 'warning', 24152 message 24153 }); 24154 }; 24155 this.loading = (message, data)=>{ 24156 return this.create({ 24157 ...data, 24158 type: 'loading', 24159 message 24160 }); 24161 }; 24162 this.promise = (promise, data)=>{ 24163 if (!data) { 24164 // Nothing to show 24165 return; 24166 } 24167 let id = undefined; 24168 if (data.loading !== undefined) { 24169 id = this.create({ 24170 ...data, 24171 promise, 24172 type: 'loading', 24173 message: data.loading, 24174 description: typeof data.description !== 'function' ? data.description : undefined 24175 }); 24176 } 24177 const p = Promise.resolve(promise instanceof Function ? promise() : promise); 24178 let shouldDismiss = id !== undefined; 24179 let result; 24180 const originalPromise = p.then(async (response)=>{ 24181 result = [ 24182 'resolve', 24183 response 24184 ]; 24185 const isReactElementResponse = React.isValidElement(response); 24186 if (isReactElementResponse) { 24187 shouldDismiss = false; 24188 this.create({ 24189 id, 24190 type: 'default', 24191 message: response 24192 }); 24193 } else if (isHttpResponse(response) && !response.ok) { 24194 shouldDismiss = false; 24195 const promiseData = typeof data.error === 'function' ? await data.error(`HTTP error! status: ${response.status}`) : data.error; 24196 const description = typeof data.description === 'function' ? await data.description(`HTTP error! status: ${response.status}`) : data.description; 24197 const isExtendedResult = typeof promiseData === 'object' && !React.isValidElement(promiseData); 24198 const toastSettings = isExtendedResult ? promiseData : { 24199 message: promiseData 24200 }; 24201 this.create({ 24202 id, 24203 type: 'error', 24204 description, 24205 ...toastSettings 24206 }); 24207 } else if (response instanceof Error) { 24208 shouldDismiss = false; 24209 const promiseData = typeof data.error === 'function' ? await data.error(response) : data.error; 24210 const description = typeof data.description === 'function' ? await data.description(response) : data.description; 24211 const isExtendedResult = typeof promiseData === 'object' && !React.isValidElement(promiseData); 24212 const toastSettings = isExtendedResult ? promiseData : { 24213 message: promiseData 24214 }; 24215 this.create({ 24216 id, 24217 type: 'error', 24218 description, 24219 ...toastSettings 24220 }); 24221 } else if (data.success !== undefined) { 24222 shouldDismiss = false; 24223 const promiseData = typeof data.success === 'function' ? await data.success(response) : data.success; 24224 const description = typeof data.description === 'function' ? await data.description(response) : data.description; 24225 const isExtendedResult = typeof promiseData === 'object' && !React.isValidElement(promiseData); 24226 const toastSettings = isExtendedResult ? promiseData : { 24227 message: promiseData 24228 }; 24229 this.create({ 24230 id, 24231 type: 'success', 24232 description, 24233 ...toastSettings 24234 }); 24235 } 24236 }).catch(async (error)=>{ 24237 result = [ 24238 'reject', 24239 error 24240 ]; 24241 if (data.error !== undefined) { 24242 shouldDismiss = false; 24243 const promiseData = typeof data.error === 'function' ? await data.error(error) : data.error; 24244 const description = typeof data.description === 'function' ? await data.description(error) : data.description; 24245 const isExtendedResult = typeof promiseData === 'object' && !React.isValidElement(promiseData); 24246 const toastSettings = isExtendedResult ? promiseData : { 24247 message: promiseData 24248 }; 24249 this.create({ 24250 id, 24251 type: 'error', 24252 description, 24253 ...toastSettings 24254 }); 24255 } 24256 }).finally(()=>{ 24257 if (shouldDismiss) { 24258 // Toast is still in load state (and will be indefinitely â dismiss it) 24259 this.dismiss(id); 24260 id = undefined; 24261 } 24262 data.finally == null ? void 0 : data.finally.call(data); 24263 }); 24264 const unwrap = ()=>new Promise((resolve, reject)=>originalPromise.then(()=>result[0] === 'reject' ? reject(result[1]) : resolve(result[1])).catch(reject)); 24265 if (typeof id !== 'string' && typeof id !== 'number') { 24266 // cannot Object.assign on undefined 24267 return { 24268 unwrap 24269 }; 24270 } else { 24271 return Object.assign(id, { 24272 unwrap 24273 }); 24274 } 24275 }; 24276 this.custom = (jsx, data)=>{ 24277 const id = (data == null ? void 0 : data.id) || toastsCounter++; 24278 this.create({ 24279 jsx: jsx(id), 24280 id, 24281 ...data 24282 }); 24283 return id; 24284 }; 24285 this.getActiveToasts = ()=>{ 24286 return this.toasts.filter((toast)=>!this.dismissedToasts.has(toast.id)); 24287 }; 24288 this.subscribers = []; 24289 this.toasts = []; 24290 this.dismissedToasts = new Set(); 24291 } 24292} 24293const ToastState = new Observer(); 24294// bind this to the toast function 24295const toastFunction = (message, data)=>{ 24296 const id = (data == null ? void 0 : data.id) || toastsCounter++; 24297 ToastState.addToast({ 24298 title: message, 24299 ...data, 24300 id 24301 }); 24302 return id; 24303}; 24304const isHttpResponse = (data)=>{ 24305 return data && typeof data === 'object' && 'ok' in data && typeof data.ok === 'boolean' && 'status' in data && typeof data.status === 'number'; 24306}; 24307const basicToast = toastFunction; 24308const getHistory = ()=>ToastState.toasts; 24309const getToasts = ()=>ToastState.getActiveToasts(); 24310// We use `Object.assign` to maintain the correct types as we would lose them otherwise 24311const toast = Object.assign(basicToast, { 24312 success: ToastState.success, 24313 info: ToastState.info, 24314 warning: ToastState.warning, 24315 error: ToastState.error, 24316 custom: ToastState.custom, 24317 message: ToastState.message, 24318 promise: ToastState.promise, 24319 dismiss: ToastState.dismiss, 24320 loading: ToastState.loading 24321}, { 24322 getHistory, 24323 getToasts 24324}); 24325 24326__insertCSS
vendor: 4,787 bytes, line 24326
24326("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;
vendor: 10,077 bytes, line 24326
24326left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");
24326 24327 24328function isAction(action) { 24329 return action.label !== undefined; 24330} 24331 24332// Visible toasts amount 24333const VISIBLE_TOASTS_AMOUNT = 3; 24334// Viewport padding 24335const VIEWPORT_OFFSET = '24px'; 24336// Mobile viewport padding 24337const MOBILE_VIEWPORT_OFFSET = '16px'; 24338// Default lifetime of a toasts (in ms) 24339const TOAST_LIFETIME = 4000; 24340// Default toast width 24341const TOAST_WIDTH = 356; 24342// Default gap between toasts 24343const GAP = 14; 24344// Threshold to dismiss a toast 24345const SWIPE_THRESHOLD = 45; 24346// Equal to exit animation duration 24347const TIME_BEFORE_UNMOUNT = 200; 24348function cn$1(...classes) {
vendor: 31,161 bytes, lines 24349-25011
24349 return classes.filter(Boolean).join(' '); 24350} 24351function getDefaultSwipeDirections(position) { 24352 const [y, x] = position.split('-'); 24353 const directions = []; 24354 if (y) { 24355 directions.push(y); 24356 } 24357 if (x) { 24358 directions.push(x); 24359 } 24360 return directions; 24361} 24362const Toast = (props)=>{ 24363 var _toast_classNames, _toast_classNames1, _toast_classNames2, _toast_classNames3, _toast_classNames4, _toast_classNames5, _toast_classNames6, _toast_classNames7, _toast_classNames8; 24364 const { invert: ToasterInvert, toast, unstyled, interacting, setHeights, visibleToasts, heights, index, toasts, expanded, removeToast, defaultRichColors, closeButton: closeButtonFromToaster, style, cancelButtonStyle, actionButtonStyle, className = '', descriptionClassName = '', duration: durationFromToaster, position, gap, expandByDefault, classNames, icons, closeButtonAriaLabel = 'Close toast' } = props; 24365 const [swipeDirection, setSwipeDirection] = React.useState(null); 24366 const [swipeOutDirection, setSwipeOutDirection] = React.useState(null); 24367 const [mounted, setMounted] = React.useState(false); 24368 const [removed, setRemoved] = React.useState(false); 24369 const [swiping, setSwiping] = React.useState(false); 24370 const [swipeOut, setSwipeOut] = React.useState(false); 24371 const [isSwiped, setIsSwiped] = React.useState(false); 24372 const [offsetBeforeRemove, setOffsetBeforeRemove] = React.useState(0); 24373 const [initialHeight, setInitialHeight] = React.useState(0); 24374 const remainingTime = React.useRef(toast.duration || durationFromToaster || TOAST_LIFETIME); 24375 const dragStartTime = React.useRef(null); 24376 const toastRef = React.useRef(null); 24377 const isFront = index === 0; 24378 const isVisible = index + 1 <= visibleToasts; 24379 const toastType = toast.type; 24380 const dismissible = toast.dismissible !== false; 24381 const toastClassname = toast.className || ''; 24382 const toastDescriptionClassname = toast.descriptionClassName || ''; 24383 // Height index is used to calculate the offset as it gets updated before the toast array, which means we can calculate the new layout faster. 24384 const heightIndex = React.useMemo(()=>heights.findIndex((height)=>height.toastId === toast.id) || 0, [ 24385 heights, 24386 toast.id 24387 ]); 24388 const closeButton = React.useMemo(()=>{ 24389 var _toast_closeButton; 24390 return (_toast_closeButton = toast.closeButton) != null ? _toast_closeButton : closeButtonFromToaster; 24391 }, [ 24392 toast.closeButton, 24393 closeButtonFromToaster 24394 ]); 24395 const duration = React.useMemo(()=>toast.duration || durationFromToaster || TOAST_LIFETIME, [ 24396 toast.duration, 24397 durationFromToaster 24398 ]); 24399 const closeTimerStartTimeRef = React.useRef(0); 24400 const offset = React.useRef(0); 24401 const lastCloseTimerStartTimeRef = React.useRef(0); 24402 const pointerStartRef = React.useRef(null); 24403 const [y, x] = position.split('-'); 24404 const toastsHeightBefore = React.useMemo(()=>{ 24405 return heights.reduce((prev, curr, reducerIndex)=>{ 24406 // Calculate offset up until current toast 24407 if (reducerIndex >= heightIndex) { 24408 return prev; 24409 } 24410 return prev + curr.height; 24411 }, 0); 24412 }, [ 24413 heights, 24414 heightIndex 24415 ]); 24416 const isDocumentHidden = useIsDocumentHidden(); 24417 const invert = toast.invert || ToasterInvert; 24418 const disabled = toastType === 'loading'; 24419 offset.current = React.useMemo(()=>heightIndex * gap + toastsHeightBefore, [ 24420 heightIndex, 24421 toastsHeightBefore 24422 ]); 24423 React.useEffect(()=>{ 24424 remainingTime.current = duration; 24425 }, [ 24426 duration 24427 ]); 24428 React.useEffect(()=>{ 24429 // Trigger enter animation without using CSS animation 24430 setMounted(true); 24431 }, []); 24432 React.useEffect(()=>{ 24433 const toastNode = toastRef.current; 24434 if (toastNode) { 24435 const height = toastNode.getBoundingClientRect().height; 24436 // Add toast height to heights array after the toast is mounted 24437 setInitialHeight(height); 24438 setHeights((h)=>[ 24439 { 24440 toastId: toast.id, 24441 height, 24442 position: toast.position 24443 }, 24444 ...h 24445 ]); 24446 return ()=>setHeights((h)=>h.filter((height)=>height.toastId !== toast.id)); 24447 } 24448 }, [ 24449 setHeights, 24450 toast.id 24451 ]); 24452 React.useLayoutEffect(()=>{ 24453 // Keep height up to date with the content in case it updates 24454 if (!mounted) return; 24455 const toastNode = toastRef.current; 24456 const originalHeight = toastNode.style.height; 24457 toastNode.style.height = 'auto'; 24458 const newHeight = toastNode.getBoundingClientRect().height; 24459 toastNode.style.height = originalHeight; 24460 setInitialHeight(newHeight); 24461 setHeights((heights)=>{ 24462 const alreadyExists = heights.find((height)=>height.toastId === toast.id); 24463 if (!alreadyExists) { 24464 return [ 24465 { 24466 toastId: toast.id, 24467 height: newHeight, 24468 position: toast.position 24469 }, 24470 ...heights 24471 ]; 24472 } else { 24473 return heights.map((height)=>height.toastId === toast.id ? { 24474 ...height, 24475 height: newHeight 24476 } : height); 24477 } 24478 }); 24479 }, [ 24480 mounted, 24481 toast.title, 24482 toast.description, 24483 setHeights, 24484 toast.id, 24485 toast.jsx, 24486 toast.action, 24487 toast.cancel 24488 ]); 24489 const deleteToast = React.useCallback(()=>{ 24490 // Save the offset for the exit swipe animation 24491 setRemoved(true); 24492 setOffsetBeforeRemove(offset.current); 24493 setHeights((h)=>h.filter((height)=>height.toastId !== toast.id)); 24494 setTimeout(()=>{ 24495 removeToast(toast); 24496 }, TIME_BEFORE_UNMOUNT); 24497 }, [ 24498 toast, 24499 removeToast, 24500 setHeights, 24501 offset 24502 ]); 24503 React.useEffect(()=>{ 24504 if (toast.promise && toastType === 'loading' || toast.duration === Infinity || toast.type === 'loading') return; 24505 let timeoutId; 24506 // Pause the timer on each hover 24507 const pauseTimer = ()=>{ 24508 if (lastCloseTimerStartTimeRef.current < closeTimerStartTimeRef.current) { 24509 // Get the elapsed time since the timer started 24510 const elapsedTime = new Date().getTime() - closeTimerStartTimeRef.current; 24511 remainingTime.current = remainingTime.current - elapsedTime; 24512 } 24513 lastCloseTimerStartTimeRef.current = new Date().getTime(); 24514 }; 24515 const startTimer = ()=>{ 24516 // setTimeout(, Infinity) behaves as if the delay is 0. 24517 // As a result, the toast would be closed immediately, giving the appearance that it was never rendered. 24518 // See: https://github.com/denysdovhan/wtfjs?tab=readme-ov-file#an-infinite-timeout 24519 if (remainingTime.current === Infinity) return; 24520 closeTimerStartTimeRef.current = new Date().getTime(); 24521 // Let the toast know it has started 24522 timeoutId = setTimeout(()=>{ 24523 toast.onAutoClose == null ? void 0 : toast.onAutoClose.call(toast, toast); 24524 deleteToast(); 24525 }, remainingTime.current); 24526 }; 24527 if (expanded || interacting || isDocumentHidden) { 24528 pauseTimer(); 24529 } else { 24530 startTimer(); 24531 } 24532 return ()=>clearTimeout(timeoutId); 24533 }, [ 24534 expanded, 24535 interacting, 24536 toast, 24537 toastType, 24538 isDocumentHidden, 24539 deleteToast 24540 ]); 24541 React.useEffect(()=>{ 24542 if (toast.delete) { 24543 deleteToast(); 24544 toast.onDismiss == null ? void 0 : toast.onDismiss.call(toast, toast); 24545 } 24546 }, [ 24547 deleteToast, 24548 toast.delete 24549 ]); 24550 function getLoadingIcon() { 24551 var _toast_classNames; 24552 if (icons == null ? void 0 : icons.loading) { 24553 var _toast_classNames1; 24554 return /*#__PURE__*/ React.createElement("div", { 24555 className: cn$1(classNames == null ? void 0 : classNames.loader, toast == null ? void 0 : (_toast_classNames1 = toast.classNames) == null ? void 0 : _toast_classNames1.loader, 'sonner-loader'), 24556 "data-visible": toastType === 'loading' 24557 }, icons.loading); 24558 } 24559 return /*#__PURE__*/ React.createElement(Loader, { 24560 className: cn$1(classNames == null ? void 0 : classNames.loader, toast == null ? void 0 : (_toast_classNames = toast.classNames) == null ? void 0 : _toast_classNames.loader), 24561 visible: toastType === 'loading' 24562 }); 24563 } 24564 const icon = toast.icon || (icons == null ? void 0 : icons[toastType]) || getAsset(toastType); 24565 var _toast_richColors, _icons_close; 24566 return /*#__PURE__*/ React.createElement("li", { 24567 tabIndex: 0, 24568 ref: toastRef, 24569 className: cn$1(className, toastClassname, classNames == null ? void 0 : classNames.toast, toast == null ? void 0 : (_toast_classNames = toast.classNames) == null ? void 0 : _toast_classNames.toast, classNames == null ? void 0 : classNames.default, classNames == null ? void 0 : classNames[toastType], toast == null ? void 0 : (_toast_classNames1 = toast.classNames) == null ? void 0 : _toast_classNames1[toastType]), 24570 "data-sonner-toast": "", 24571 "data-rich-colors": (_toast_richColors = toast.richColors) != null ? _toast_richColors : defaultRichColors, 24572 "data-styled": !Boolean(toast.jsx || toast.unstyled || unstyled), 24573 "data-mounted": mounted, 24574 "data-promise": Boolean(toast.promise), 24575 "data-swiped": isSwiped, 24576 "data-removed": removed, 24577 "data-visible": isVisible, 24578 "data-y-position": y, 24579 "data-x-position": x, 24580 "data-index": index, 24581 "data-front": isFront, 24582 "data-swiping": swiping, 24583 "data-dismissible": dismissible, 24584 "data-type": toastType, 24585 "data-invert": invert, 24586 "data-swipe-out": swipeOut, 24587 "data-swipe-direction": swipeOutDirection, 24588 "data-expanded": Boolean(expanded || expandByDefault && mounted), 24589 "data-testid": toast.testId, 24590 style: { 24591 '--index': index, 24592 '--toasts-before': index, 24593 '--z-index': toasts.length - index, 24594 '--offset': `${removed ? offsetBeforeRemove : offset.current}px`, 24595 '--initial-height': expandByDefault ? 'auto' : `${initialHeight}px`, 24596 ...style, 24597 ...toast.style 24598 }, 24599 onDragEnd: ()=>{ 24600 setSwiping(false); 24601 setSwipeDirection(null); 24602 pointerStartRef.current = null; 24603 }, 24604 onPointerDown: (event)=>{ 24605 if (event.button === 2) return; // Return early on right click 24606 if (disabled || !dismissible) return; 24607 dragStartTime.current = new Date(); 24608 setOffsetBeforeRemove(offset.current); 24609 // Ensure we maintain correct pointer capture even when going outside of the toast (e.g. when swiping) 24610 event.target.setPointerCapture(event.pointerId); 24611 if (event.target.tagName === 'BUTTON') return; 24612 setSwiping(true); 24613 pointerStartRef.current = { 24614 x: event.clientX, 24615 y: event.clientY 24616 }; 24617 }, 24618 onPointerUp: ()=>{ 24619 var _toastRef_current, _toastRef_current1, _dragStartTime_current; 24620 if (swipeOut || !dismissible) return; 24621 pointerStartRef.current = null; 24622 const swipeAmountX = Number(((_toastRef_current = toastRef.current) == null ? void 0 : _toastRef_current.style.getPropertyValue('--swipe-amount-x').replace('px', '')) || 0); 24623 const swipeAmountY = Number(((_toastRef_current1 = toastRef.current) == null ? void 0 : _toastRef_current1.style.getPropertyValue('--swipe-amount-y').replace('px', '')) || 0); 24624 const timeTaken = new Date().getTime() - ((_dragStartTime_current = dragStartTime.current) == null ? void 0 : _dragStartTime_current.getTime()); 24625 const swipeAmount = swipeDirection === 'x' ? swipeAmountX : swipeAmountY; 24626 const velocity = Math.abs(swipeAmount) / timeTaken; 24627 if (Math.abs(swipeAmount) >= SWIPE_THRESHOLD || velocity > 0.11) { 24628 setOffsetBeforeRemove(offset.current); 24629 toast.onDismiss == null ? void 0 : toast.onDismiss.call(toast, toast); 24630 if (swipeDirection === 'x') { 24631 setSwipeOutDirection(swipeAmountX > 0 ? 'right' : 'left'); 24632 } else { 24633 setSwipeOutDirection(swipeAmountY > 0 ? 'down' : 'up'); 24634 } 24635 deleteToast(); 24636 setSwipeOut(true); 24637 return; 24638 } else { 24639 var _toastRef_current2, _toastRef_current3; 24640 (_toastRef_current2 = toastRef.current) == null ? void 0 : _toastRef_current2.style.setProperty('--swipe-amount-x', `0px`); 24641 (_toastRef_current3 = toastRef.current) == null ? void 0 : _toastRef_current3.style.setProperty('--swipe-amount-y', `0px`); 24642 } 24643 setIsSwiped(false); 24644 setSwiping(false); 24645 setSwipeDirection(null); 24646 }, 24647 onPointerMove: (event)=>{ 24648 var _window_getSelection, // Apply transform using both x and y values 24649 _toastRef_current, _toastRef_current1; 24650 if (!pointerStartRef.current || !dismissible) return; 24651 const isHighlighted = ((_window_getSelection = window.getSelection()) == null ? void 0 : _window_getSelection.toString().length) > 0; 24652 if (isHighlighted) return; 24653 const yDelta = event.clientY - pointerStartRef.current.y; 24654 const xDelta = event.clientX - pointerStartRef.current.x; 24655 var _props_swipeDirections; 24656 const swipeDirections = (_props_swipeDirections = props.swipeDirections) != null ? _props_swipeDirections : getDefaultSwipeDirections(position); 24657 // Determine swipe direction if not already locked 24658 if (!swipeDirection && (Math.abs(xDelta) > 1 || Math.abs(yDelta) > 1)) { 24659 setSwipeDirection(Math.abs(xDelta) > Math.abs(yDelta) ? 'x' : 'y'); 24660 } 24661 let swipeAmount = { 24662 x: 0, 24663 y: 0 24664 }; 24665 const getDampening = (delta)=>{ 24666 const factor = Math.abs(delta) / 20; 24667 return 1 / (1.5 + factor); 24668 }; 24669 // Only apply swipe in the locked direction 24670 if (swipeDirection === 'y') { 24671 // Handle vertical swipes 24672 if (swipeDirections.includes('top') || swipeDirections.includes('bottom')) { 24673 if (swipeDirections.includes('top') && yDelta < 0 || swipeDirections.includes('bottom') && yDelta > 0) { 24674 swipeAmount.y = yDelta; 24675 } else { 24676 // Smoothly transition to dampened movement 24677 const dampenedDelta = yDelta * getDampening(yDelta); 24678 // Ensure we don't jump when transitioning to dampened movement 24679 swipeAmount.y = Math.abs(dampenedDelta) < Math.abs(yDelta) ? dampenedDelta : yDelta; 24680 } 24681 } 24682 } else if (swipeDirection === 'x') { 24683 // Handle horizontal swipes 24684 if (swipeDirections.includes('left') || swipeDirections.includes('right')) { 24685 if (swipeDirections.includes('left') && xDelta < 0 || swipeDirections.includes('right') && xDelta > 0) { 24686 swipeAmount.x = xDelta; 24687 } else { 24688 // Smoothly transition to dampened movement 24689 const dampenedDelta = xDelta * getDampening(xDelta); 24690 // Ensure we don't jump when transitioning to dampened movement 24691 swipeAmount.x = Math.abs(dampenedDelta) < Math.abs(xDelta) ? dampenedDelta : xDelta; 24692 } 24693 } 24694 } 24695 if (Math.abs(swipeAmount.x) > 0 || Math.abs(swipeAmount.y) > 0) { 24696 setIsSwiped(true); 24697 } 24698 (_toastRef_current = toastRef.current) == null ? void 0 : _toastRef_current.style.setProperty('--swipe-amount-x', `${swipeAmount.x}px`); 24699 (_toastRef_current1 = toastRef.current) == null ? void 0 : _toastRef_current1.style.setProperty('--swipe-amount-y', `${swipeAmount.y}px`); 24700 } 24701 }, closeButton && !toast.jsx && toastType !== 'loading' ? /*#__PURE__*/ React.createElement("button", { 24702 "aria-label": closeButtonAriaLabel, 24703 "data-disabled": disabled, 24704 "data-close-button": true, 24705 onClick: disabled || !dismissible ? ()=>{} : ()=>{ 24706 deleteToast(); 24707 toast.onDismiss == null ? void 0 : toast.onDismiss.call(toast, toast); 24708 }, 24709 className: cn$1(classNames == null ? void 0 : classNames.closeButton, toast == null ? void 0 : (_toast_classNames2 = toast.classNames) == null ? void 0 : _toast_classNames2.closeButton) 24710 }, (_icons_close = icons == null ? void 0 : icons.close) != null ? _icons_close : CloseIcon) : null, (toastType || toast.icon || toast.promise) && toast.icon !== null && ((icons == null ? void 0 : icons[toastType]) !== null || toast.icon) ? /*#__PURE__*/ React.createElement("div", { 24711 "data-icon": "", 24712 className: cn$1(classNames == null ? void 0 : classNames.icon, toast == null ? void 0 : (_toast_classNames3 = toast.classNames) == null ? void 0 : _toast_classNames3.icon) 24713 }, toast.promise || toast.type === 'loading' && !toast.icon ? toast.icon || getLoadingIcon() : null, toast.type !== 'loading' ? icon : null) : null, /*#__PURE__*/ React.createElement("div", { 24714 "data-content": "", 24715 className: cn$1(classNames == null ? void 0 : classNames.content, toast == null ? void 0 : (_toast_classNames4 = toast.classNames) == null ? void 0 : _toast_classNames4.content) 24716 }, /*#__PURE__*/ React.createElement("div", { 24717 "data-title": "", 24718 className: cn$1(classNames == null ? void 0 : classNames.title, toast == null ? void 0 : (_toast_classNames5 = toast.classNames) == null ? void 0 : _toast_classNames5.title) 24719 }, toast.jsx ? toast.jsx : typeof toast.title === 'function' ? toast.title() : toast.title), toast.description ? /*#__PURE__*/ React.createElement("div", { 24720 "data-description": "", 24721 className: cn$1(descriptionClassName, toastDescriptionClassname, classNames == null ? void 0 : classNames.description, toast == null ? void 0 : (_toast_classNames6 = toast.classNames) == null ? void 0 : _toast_classNames6.description) 24722 }, typeof toast.description === 'function' ? toast.description() : toast.description) : null), /*#__PURE__*/ React.isValidElement(toast.cancel) ? toast.cancel : toast.cancel && isAction(toast.cancel) ? /*#__PURE__*/ React.createElement("button", { 24723 "data-button": true, 24724 "data-cancel": true, 24725 style: toast.cancelButtonStyle || cancelButtonStyle, 24726 onClick: (event)=>{ 24727 // We need to check twice because typescript 24728 if (!isAction(toast.cancel)) return; 24729 if (!dismissible) return; 24730 toast.cancel.onClick == null ? void 0 : toast.cancel.onClick.call(toast.cancel, event); 24731 deleteToast(); 24732 }, 24733 className: cn$1(classNames == null ? void 0 : classNames.cancelButton, toast == null ? void 0 : (_toast_classNames7 = toast.classNames) == null ? void 0 : _toast_classNames7.cancelButton) 24734 }, toast.cancel.label) : null, /*#__PURE__*/ React.isValidElement(toast.action) ? toast.action : toast.action && isAction(toast.action) ? /*#__PURE__*/ React.createElement("button", { 24735 "data-button": true, 24736 "data-action": true, 24737 style: toast.actionButtonStyle || actionButtonStyle, 24738 onClick: (event)=>{ 24739 // We need to check twice because typescript 24740 if (!isAction(toast.action)) return; 24741 toast.action.onClick == null ? void 0 : toast.action.onClick.call(toast.action, event); 24742 if (event.defaultPrevented) return; 24743 deleteToast(); 24744 }, 24745 className: cn$1(classNames == null ? void 0 : classNames.actionButton, toast == null ? void 0 : (_toast_classNames8 = toast.classNames) == null ? void 0 : _toast_classNames8.actionButton) 24746 }, toast.action.label) : null); 24747}; 24748function getDocumentDirection() { 24749 if (typeof window === 'undefined') return 'ltr'; 24750 if (typeof document === 'undefined') return 'ltr'; // For Fresh purpose 24751 const dirAttribute = document.documentElement.getAttribute('dir'); 24752 if (dirAttribute === 'auto' || !dirAttribute) { 24753 return window.getComputedStyle(document.documentElement).direction; 24754 } 24755 return dirAttribute; 24756} 24757function assignOffset(defaultOffset, mobileOffset) { 24758 const styles = {}; 24759 [ 24760 defaultOffset, 24761 mobileOffset 24762 ].forEach((offset, index)=>{ 24763 const isMobile = index === 1; 24764 const prefix = isMobile ? '--mobile-offset' : '--offset'; 24765 const defaultValue = isMobile ? MOBILE_VIEWPORT_OFFSET : VIEWPORT_OFFSET; 24766 function assignAll(offset) { 24767 [ 24768 'top', 24769 'right', 24770 'bottom', 24771 'left' 24772 ].forEach((key)=>{ 24773 styles[`${prefix}-${key}`] = typeof offset === 'number' ? `${offset}px` : offset; 24774 }); 24775 } 24776 if (typeof offset === 'number' || typeof offset === 'string') { 24777 assignAll(offset); 24778 } else if (typeof offset === 'object') { 24779 [ 24780 'top', 24781 'right', 24782 'bottom', 24783 'left' 24784 ].forEach((key)=>{ 24785 if (offset[key] === undefined) { 24786 styles[`${prefix}-${key}`] = defaultValue; 24787 } else { 24788 styles[`${prefix}-${key}`] = typeof offset[key] === 'number' ? `${offset[key]}px` : offset[key]; 24789 } 24790 }); 24791 } else { 24792 assignAll(defaultValue); 24793 } 24794 }); 24795 return styles; 24796} 24797const Toaster$1 = /*#__PURE__*/ React.forwardRef(function Toaster(props, ref) { 24798 const { id, invert, position = 'bottom-right', hotkey = [ 24799 'altKey', 24800 'KeyT' 24801 ], expand, closeButton, className, offset, mobileOffset, theme = 'light', richColors, duration, style, visibleToasts = VISIBLE_TOASTS_AMOUNT, toastOptions, dir = getDocumentDirection(), gap = GAP, icons, containerAriaLabel = 'Notifications' } = props; 24802 const [toasts, setToasts] = React.useState([]); 24803 const filteredToasts = React.useMemo(()=>{ 24804 if (id) { 24805 return toasts.filter((toast)=>toast.toasterId === id); 24806 } 24807 return toasts.filter((toast)=>!toast.toasterId); 24808 }, [ 24809 toasts, 24810 id 24811 ]); 24812 const possiblePositions = React.useMemo(()=>{ 24813 return Array.from(new Set([ 24814 position 24815 ].concat(filteredToasts.filter((toast)=>toast.position).map((toast)=>toast.position)))); 24816 }, [ 24817 filteredToasts, 24818 position 24819 ]); 24820 const [heights, setHeights] = React.useState([]); 24821 const [expanded, setExpanded] = React.useState(false); 24822 const [interacting, setInteracting] = React.useState(false); 24823 const [actualTheme, setActualTheme] = React.useState(theme !== 'system' ? theme : typeof window !== 'undefined' ? window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light' : 'light'); 24824 const listRef = React.useRef(null); 24825 const hotkeyLabel = hotkey.join('+').replace(/Key/g, '').replace(/Digit/g, ''); 24826 const lastFocusedElementRef = React.useRef(null); 24827 const isFocusWithinRef = React.useRef(false); 24828 const removeToast = React.useCallback((toastToRemove)=>{ 24829 setToasts((toasts)=>{ 24830 var _toasts_find; 24831 if (!((_toasts_find = toasts.find((toast)=>toast.id === toastToRemove.id)) == null ? void 0 : _toasts_find.delete)) { 24832 ToastState.dismiss(toastToRemove.id); 24833 } 24834 return toasts.filter(({ id })=>id !== toastToRemove.id); 24835 }); 24836 }, []); 24837 React.useEffect(()=>{ 24838 return ToastState.subscribe((toast)=>{ 24839 if (toast.dismiss) { 24840 // Prevent batching of other state updates 24841 requestAnimationFrame(()=>{ 24842 setToasts((toasts)=>toasts.map((t)=>t.id === toast.id ? { 24843 ...t, 24844 delete: true 24845 } : t)); 24846 }); 24847 return; 24848 } 24849 // Prevent batching, temp solution. 24850 setTimeout(()=>{ 24851 ReactDOM.flushSync(()=>{ 24852 setToasts((toasts)=>{ 24853 const indexOfExistingToast = toasts.findIndex((t)=>t.id === toast.id); 24854 // Update the toast if it already exists 24855 if (indexOfExistingToast !== -1) { 24856 return [ 24857 ...toasts.slice(0, indexOfExistingToast), 24858 { 24859 ...toasts[indexOfExistingToast], 24860 ...toast 24861 }, 24862 ...toasts.slice(indexOfExistingToast + 1) 24863 ]; 24864 } 24865 return [ 24866 toast, 24867 ...toasts 24868 ]; 24869 }); 24870 }); 24871 }); 24872 }); 24873 }, [ 24874 toasts 24875 ]); 24876 React.useEffect(()=>{ 24877 if (theme !== 'system') { 24878 setActualTheme(theme); 24879 return; 24880 } 24881 if (theme === 'system') { 24882 // check if current preference is dark 24883 if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) { 24884 // it's currently dark 24885 setActualTheme('dark'); 24886 } else { 24887 // it's not dark 24888 setActualTheme('light'); 24889 } 24890 } 24891 if (typeof window === 'undefined') return; 24892 const darkMediaQuery = window.matchMedia('(prefers-color-scheme: dark)'); 24893 try { 24894 // Chrome & Firefox 24895 darkMediaQuery.addEventListener('change', ({ matches })=>{ 24896 if (matches) { 24897 setActualTheme('dark'); 24898 } else { 24899 setActualTheme('light'); 24900 } 24901 }); 24902 } catch (error) { 24903 // Safari < 14 24904 darkMediaQuery.addListener(({ matches })=>{ 24905 try { 24906 if (matches) { 24907 setActualTheme('dark'); 24908 } else { 24909 setActualTheme('light'); 24910 } 24911 } catch (e) { 24912 console.error(e); 24913 } 24914 }); 24915 } 24916 }, [ 24917 theme 24918 ]); 24919 React.useEffect(()=>{ 24920 // Ensure expanded is always false when no toasts are present / only one left 24921 if (toasts.length <= 1) { 24922 setExpanded(false); 24923 } 24924 }, [ 24925 toasts 24926 ]); 24927 React.useEffect(()=>{ 24928 const handleKeyDown = (event)=>{ 24929 var _listRef_current; 24930 const isHotkeyPressed = hotkey.every((key)=>event[key] || event.code === key); 24931 if (isHotkeyPressed) { 24932 var _listRef_current1; 24933 setExpanded(true); 24934 (_listRef_current1 = listRef.current) == null ? void 0 : _listRef_current1.focus(); 24935 } 24936 if (event.code === 'Escape' && (document.activeElement === listRef.current || ((_listRef_current = listRef.current) == null ? void 0 : _listRef_current.contains(document.activeElement)))) { 24937 setExpanded(false); 24938 } 24939 }; 24940 document.addEventListener('keydown', handleKeyDown); 24941 return ()=>document.removeEventListener('keydown', handleKeyDown); 24942 }, [ 24943 hotkey 24944 ]); 24945 React.useEffect(()=>{ 24946 if (listRef.current) { 24947 return ()=>{ 24948 if (lastFocusedElementRef.current) { 24949 lastFocusedElementRef.current.focus({ 24950 preventScroll: true 24951 }); 24952 lastFocusedElementRef.current = null; 24953 isFocusWithinRef.current = false; 24954 } 24955 }; 24956 } 24957 }, [ 24958 listRef.current 24959 ]); 24960 return(// Remove item from normal navigation flow, only available via hotkey 24961 /*#__PURE__*/ React.createElement("section", { 24962 ref: ref, 24963 "aria-label": `${containerAriaLabel} ${hotkeyLabel}`, 24964 tabIndex: -1, 24965 "aria-live": "polite", 24966 "aria-relevant": "additions text", 24967 "aria-atomic": "false", 24968 suppressHydrationWarning: true 24969 }, possiblePositions.map((position, index)=>{ 24970 var _heights_; 24971 const [y, x] = position.split('-'); 24972 if (!filteredToasts.length) return null; 24973 return /*#__PURE__*/ React.createElement("ol", { 24974 key: position, 24975 dir: dir === 'auto' ? getDocumentDirection() : dir, 24976 tabIndex: -1, 24977 ref: listRef, 24978 className: className, 24979 "data-sonner-toaster": true, 24980 "data-sonner-theme": actualTheme, 24981 "data-y-position": y, 24982 "data-x-position": x, 24983 style: { 24984 '--front-toast-height': `${((_heights_ = heights[0]) == null ? void 0 : _heights_.height) || 0}px`, 24985 '--width': `${TOAST_WIDTH}px`, 24986 '--gap': `${gap}px`, 24987 ...style, 24988 ...assignOffset(offset, mobileOffset) 24989 }, 24990 onBlur: (event)=>{ 24991 if (isFocusWithinRef.current && !event.currentTarget.contains(event.relatedTarget)) { 24992 isFocusWithinRef.current = false; 24993 if (lastFocusedElementRef.current) { 24994 lastFocusedElementRef.current.focus({ 24995 preventScroll: true 24996 }); 24997 lastFocusedElementRef.current = null; 24998 } 24999 } 25000 }, 25001 onFocus: (event)=>{ 25002 const isNotDismissible = event.target instanceof HTMLElement && event.target.dataset.dismissible === 'false'; 25003 if (isNotDismissible) return; 25004 if (!isFocusWithinRef.current) { 25005 isFocusWithinRef.current = true; 25006 lastFocusedElementRef.current = event.relatedTarget; 25007 } 25008 }, 25009 onMouseEnter: ()=>setExpanded(true), 25010 onMouseMove: ()=>setExpanded(true), 25011 onMouseLeave: ()=>{
25012 // Avoid setting expanded to false when interacting with a toast, e.g. swiping 25013 if (!interacting) { 25014 setExpanded(false); 25015 } 25016 }, 25017 onDragEnd: ()=>setExpanded(false), 25018 onPointerDown: (event)=>{ 25019 const isNotDismissible = event.target instanceof HTMLElement && event.target.dataset.dismissible === 'false'; 25020 if (isNotDismissible) return; 25021 setInteracting(true); 25022 }, 25023 onPointerUp: ()=>setInteracting(false) 25024 }, filteredToasts.filter((toast)=>!toast.position && index === 0 || toast.position === position).map((toast, index)=>{ 25025 var _toastOptions_duration, _toastOptions_closeButton; 25026 return /*#__PURE__*/ React.createElement(Toast, { 25027 key: toast.id, 25028 icons: icons, 25029 index: index, 25030 toast: toast, 25031 defaultRichColors: richColors, 25032 duration: (_toastOptions_duration = toastOptions == null ? void 0 : toastOptions.duration) != null ? _toastOptions_duration : duration, 25033 className: toastOptions == null ? void 0 : toastOptions.className, 25034 descriptionClassName: toastOptions == null ? void 0 : toastOptions.descriptionClassName, 25035 invert: invert, 25036 visibleToasts: visibleToasts, 25037 closeButton: (_toastOptions_closeButton = toastOptions == null ? void 0 : toastOptions.closeButton) != null ? _toastOptions_closeButton : closeButton, 25038 interacting: interacting, 25039 position: position, 25040 style: toastOptions == null ? void 0 : toastOptions.style, 25041 unstyled: toastOptions == null ? void 0 : toastOptions.unstyled, 25042 classNames: toastOptions == null ? void 0 : toastOptions.classNames, 25043 cancelButtonStyle: toastOptions == null ? void 0 : toastOptions.cancelButtonStyle, 25044 actionButtonStyle: toastOptions == null ? void 0 : toastOptions.actionButtonStyle, 25045 closeButtonAriaLabel: toastOptions == null ? void 0 : toastOptions.closeButtonAriaLabel, 25046 removeToast: removeToast, 25047 toasts: filteredToasts.filter((t)=>t.position == toast.position), 25048 heights: heights.filter((h)=>h.position == toast.position), 25049 setHeights: setHeights, 25050 expandByDefault: expand, 25051 gap: gap, 25052 expanded: expanded, 25053 swipeDirections: props.swipeDirections 25054 }); 25055 })); 25056 }))); 25057}); 25058 25059const Toaster = ({ ...props }) => { 25060 const { theme = "system" } = z(); 25061 return /* @__PURE__ */ jsxRuntimeExports.jsx( 25062 Toaster$1, 25063 { 25064 theme, 25065 className: "toaster group", 25066 style: { 25067 "--normal-bg": "var(--popover)", 25068 "--normal-text": "var(--popover-foreground)", 25069 "--normal-border": "var(--border)" 25070 }, 25071 ...props 25072 } 25073 ); 25074};
vendor: 354 bytes, lines 25074-25086
25074 25075 25076// src/primitive.tsx 25077function composeEventHandlers(originalEventHandler, ourEventHandler, { checkForDefaultPrevented = true } = {}) { 25078 return function handleEvent(event) { 25079 originalEventHandler?.(event); 25080 if (checkForDefaultPrevented === false || !event.defaultPrevented) { 25081 return ourEventHandler?.(event); 25082 } 25083 }; 25084} 25085 25086// packages/react/
vendor: 4,159 bytes, lines 25086-25196
25086compose-refs/src/compose-refs.tsx 25087function setRef(ref, value) { 25088 if (typeof ref === "function") { 25089 return ref(value); 25090 } else if (ref !== null && ref !== void 0) { 25091 ref.current = value; 25092 } 25093} 25094function composeRefs(...refs) { 25095 return (node) => { 25096 let hasCleanup = false; 25097 const cleanups = refs.map((ref) => { 25098 const cleanup = setRef(ref, node); 25099 if (!hasCleanup && typeof cleanup == "function") { 25100 hasCleanup = true; 25101 } 25102 return cleanup; 25103 }); 25104 if (hasCleanup) { 25105 return () => { 25106 for (let i = 0; i < cleanups.length; i++) { 25107 const cleanup = cleanups[i]; 25108 if (typeof cleanup == "function") { 25109 cleanup(); 25110 } else { 25111 setRef(refs[i], null); 25112 } 25113 } 25114 }; 25115 } 25116 }; 25117} 25118function useComposedRefs(...refs) { 25119 return reactExports.useCallback(composeRefs(...refs), refs); 25120} 25121 25122// packages/react/context/src/create-context.tsx 25123function createContext2(rootComponentName, defaultContext) { 25124 const Context = reactExports.createContext(defaultContext); 25125 const Provider = (props) => { 25126 const { children, ...context } = props; 25127 const value = reactExports.useMemo(() => context, Object.values(context)); 25128 return /* @__PURE__ */ jsxRuntimeExports.jsx(Context.Provider, { value, children }); 25129 }; 25130 Provider.displayName = rootComponentName + "Provider"; 25131 function useContext2(consumerName) { 25132 const context = reactExports.useContext(Context); 25133 if (context) return context; 25134 if (defaultContext !== void 0) return defaultContext; 25135 throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``); 25136 } 25137 return [Provider, useContext2]; 25138} 25139function createContextScope(scopeName, createContextScopeDeps = []) { 25140 let defaultContexts = []; 25141 function createContext3(rootComponentName, defaultContext) { 25142 const BaseContext = reactExports.createContext(defaultContext); 25143 const index = defaultContexts.length; 25144 defaultContexts = [...defaultContexts, defaultContext]; 25145 const Provider = (props) => { 25146 const { scope, children, ...context } = props; 25147 const Context = scope?.[scopeName]?.[index] || BaseContext; 25148 const value = reactExports.useMemo(() => context, Object.values(context)); 25149 return /* @__PURE__ */ jsxRuntimeExports.jsx(Context.Provider, { value, children }); 25150 }; 25151 Provider.displayName = rootComponentName + "Provider"; 25152 function useContext2(consumerName, scope) { 25153 const Context = scope?.[scopeName]?.[index] || BaseContext; 25154 const context = reactExports.useContext(Context); 25155 if (context) return context; 25156 if (defaultContext !== void 0) return defaultContext; 25157 throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``); 25158 } 25159 return [Provider, useContext2]; 25160 } 25161 const createScope = () => { 25162 const scopeContexts = defaultContexts.map((defaultContext) => { 25163 return reactExports.createContext(defaultContext); 25164 }); 25165 return function useScope(scope) { 25166 const contexts = scope?.[scopeName] || scopeContexts; 25167 return reactExports.useMemo( 25168 () => ({ [`__scope${scopeName}`]: { ...scope, [scopeName]: contexts } }), 25169 [scope, contexts] 25170 ); 25171 }; 25172 }; 25173 createScope.scopeName = scopeName; 25174 return [createContext3, composeContextScopes(createScope, ...createContextScopeDeps)]; 25175} 25176function composeContextScopes(...scopes) { 25177 const baseScope = scopes[0]; 25178 if (scopes.length === 1) return baseScope; 25179 const createScope = () => { 25180 const scopeHooks = scopes.map((createScope2) => ({ 25181 useScope: createScope2(), 25182 scopeName: createScope2.scopeName 25183 })); 25184 return function useComposedScopes(overrideScopes) { 25185 const nextScopes = scopeHooks.reduce((nextScopes2, { useScope, scopeName }) => { 25186 const scopeProps = useScope(overrideScopes); 25187 const currentScope = scopeProps[`__scope${scopeName}`]; 25188 return { ...nextScopes2, ...currentScope }; 25189 }, {}); 25190 return reactExports.useMemo(() => ({ [`__scope${baseScope.scopeName}`]: nextScopes }), [nextScopes]); 25191 }; 25192 }; 25193 createScope.scopeName = baseScope.scopeName; 25194 return createScope; 25195} 25196
vendor: 3,912 bytes, lines 25197-25290
25197// src/slot.tsx 25198// @__NO_SIDE_EFFECTS__ 25199function createSlot(ownerName) { 25200 const SlotClone = /* @__PURE__ */ createSlotClone(ownerName); 25201 const Slot2 = reactExports.forwardRef((props, forwardedRef) => { 25202 const { children, ...slotProps } = props; 25203 const childrenArray = reactExports.Children.toArray(children); 25204 const slottable = childrenArray.find(isSlottable); 25205 if (slottable) { 25206 const newElement = slottable.props.children; 25207 const newChildren = childrenArray.map((child) => { 25208 if (child === slottable) { 25209 if (reactExports.Children.count(newElement) > 1) return reactExports.Children.only(null); 25210 return reactExports.isValidElement(newElement) ? newElement.props.children : null; 25211 } else { 25212 return child; 25213 } 25214 }); 25215 return /* @__PURE__ */ jsxRuntimeExports.jsx(SlotClone, { ...slotProps, ref: forwardedRef, children: reactExports.isValidElement(newElement) ? reactExports.cloneElement(newElement, void 0, newChildren) : null }); 25216 } 25217 return /* @__PURE__ */ jsxRuntimeExports.jsx(SlotClone, { ...slotProps, ref: forwardedRef, children }); 25218 }); 25219 Slot2.displayName = `${ownerName}.Slot`; 25220 return Slot2; 25221} 25222var Slot$1 = /* @__PURE__ */ createSlot("Slot"); 25223// @__NO_SIDE_EFFECTS__ 25224function createSlotClone(ownerName) { 25225 const SlotClone = reactExports.forwardRef((props, forwardedRef) => { 25226 const { children, ...slotProps } = props; 25227 if (reactExports.isValidElement(children)) { 25228 const childrenRef = getElementRef$1(children); 25229 const props2 = mergeProps(slotProps, children.props); 25230 if (children.type !== reactExports.Fragment) { 25231 props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef; 25232 } 25233 return reactExports.cloneElement(children, props2); 25234 } 25235 return reactExports.Children.count(children) > 1 ? reactExports.Children.only(null) : null; 25236 }); 25237 SlotClone.displayName = `${ownerName}.SlotClone`; 25238 return SlotClone; 25239} 25240var SLOTTABLE_IDENTIFIER = Symbol("radix.slottable"); 25241// @__NO_SIDE_EFFECTS__ 25242function createSlottable(ownerName) { 25243 const Slottable2 = ({ children }) => { 25244 return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children }); 25245 }; 25246 Slottable2.displayName = `${ownerName}.Slottable`; 25247 Slottable2.__radixId = SLOTTABLE_IDENTIFIER; 25248 return Slottable2; 25249} 25250function isSlottable(child) { 25251 return reactExports.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER; 25252} 25253function mergeProps(slotProps, childProps) { 25254 const overrideProps = { ...childProps }; 25255 for (const propName in childProps) { 25256 const slotPropValue = slotProps[propName]; 25257 const childPropValue = childProps[propName]; 25258 const isHandler = /^on[A-Z]/.test(propName); 25259 if (isHandler) { 25260 if (slotPropValue && childPropValue) { 25261 overrideProps[propName] = (...args) => { 25262 const result = childPropValue(...args); 25263 slotPropValue(...args); 25264 return result; 25265 }; 25266 } else if (slotPropValue) { 25267 overrideProps[propName] = slotPropValue; 25268 } 25269 } else if (propName === "style") { 25270 overrideProps[propName] = { ...slotPropValue, ...childPropValue }; 25271 } else if (propName === "className") { 25272 overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(" "); 25273 } 25274 } 25275 return { ...slotProps, ...overrideProps }; 25276} 25277function getElementRef$1(element) { 25278 let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get; 25279 let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning; 25280 if (mayWarn) { 25281 return element.ref; 25282 } 25283 getter = Object.getOwnPropertyDescriptor(element, "ref")?.get; 25284 mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning; 25285 if (mayWarn) { 25286 return element.props.ref; 25287 } 25288 return element.props.ref || element.ref; 25289} 25290
vendor: 869 bytes, lines 25291-25327
25291// src/primitive.tsx 25292var NODES = [ 25293 "a", 25294 "button", 25295 "div", 25296 "form", 25297 "h2", 25298 "h3", 25299 "img", 25300 "input", 25301 "label", 25302 "li", 25303 "nav", 25304 "ol", 25305 "p", 25306 "select", 25307 "span", 25308 "svg", 25309 "ul" 25310]; 25311var Primitive = NODES.reduce((primitive, node) => { 25312 const Slot = createSlot(`Primitive.${node}`); 25313 const Node = reactExports.forwardRef((props, forwardedRef) => { 25314 const { asChild, ...primitiveProps } = props; 25315 const Comp = asChild ? Slot : node; 25316 if (typeof window !== "undefined") { 25317 window[Symbol.for("radix-ui")] = true; 25318 } 25319 return /* @__PURE__ */ jsxRuntimeExports.jsx(Comp, { ...primitiveProps, ref: forwardedRef }); 25320 }); 25321 Node.displayName = `Primitive.${node}`; 25322 return { ...primitive, [node]: Node }; 25323}, {}); 25324function dispatchDiscreteCustomEvent(target, event) { 25325 if (target) reactDomExports.flushSync(() => target.dispatchEvent(event)); 25326} 25327
25328// packages/react/use-callback-ref/src/use-callback-ref.tsx 25329function useCallbackRef$1(callback) { 25330 const callbackRef = reactExports.useRef(callback); 25331 reactExports.useEffect(() => { 25332 callbackRef.current = callback; 25333 }); 25334 return reactExports.useMemo(() => (...args) => callbackRef.current?.(...args), []); 25335} 25336
vendor: 9,055 bytes, lines 25337-25552
25337// packages/react/use-escape-keydown/src/use-escape-keydown.tsx 25338function useEscapeKeydown(onEscapeKeyDownProp, ownerDocument = globalThis?.document) { 25339 const onEscapeKeyDown = useCallbackRef$1(onEscapeKeyDownProp); 25340 reactExports.useEffect(() => { 25341 const handleKeyDown = (event) => { 25342 if (event.key === "Escape") { 25343 onEscapeKeyDown(event); 25344 } 25345 }; 25346 ownerDocument.addEventListener("keydown", handleKeyDown, { capture: true }); 25347 return () => ownerDocument.removeEventListener("keydown", handleKeyDown, { capture: true }); 25348 }, [onEscapeKeyDown, ownerDocument]); 25349} 25350 25351var DISMISSABLE_LAYER_NAME = "DismissableLayer"; 25352var CONTEXT_UPDATE = "dismissableLayer.update"; 25353var POINTER_DOWN_OUTSIDE = "dismissableLayer.pointerDownOutside"; 25354var FOCUS_OUTSIDE = "dismissableLayer.focusOutside"; 25355var originalBodyPointerEvents; 25356var DismissableLayerContext = reactExports.createContext({ 25357 layers: /* @__PURE__ */ new Set(), 25358 layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(), 25359 branches: /* @__PURE__ */ new Set() 25360}); 25361var DismissableLayer = reactExports.forwardRef( 25362 (props, forwardedRef) => { 25363 const { 25364 disableOutsidePointerEvents = false, 25365 onEscapeKeyDown, 25366 onPointerDownOutside, 25367 onFocusOutside, 25368 onInteractOutside, 25369 onDismiss, 25370 ...layerProps 25371 } = props; 25372 const context = reactExports.useContext(DismissableLayerContext); 25373 const [node, setNode] = reactExports.useState(null); 25374 const ownerDocument = node?.ownerDocument ?? globalThis?.document; 25375 const [, force] = reactExports.useState({}); 25376 const composedRefs = useComposedRefs(forwardedRef, (node2) => setNode(node2)); 25377 const layers = Array.from(context.layers); 25378 const [highestLayerWithOutsidePointerEventsDisabled] = [...context.layersWithOutsidePointerEventsDisabled].slice(-1); 25379 const highestLayerWithOutsidePointerEventsDisabledIndex = layers.indexOf(highestLayerWithOutsidePointerEventsDisabled); 25380 const index = node ? layers.indexOf(node) : -1; 25381 const isBodyPointerEventsDisabled = context.layersWithOutsidePointerEventsDisabled.size > 0; 25382 const isPointerEventsEnabled = index >= highestLayerWithOutsidePointerEventsDisabledIndex; 25383 const pointerDownOutside = usePointerDownOutside((event) => { 25384 const target = event.target; 25385 const isPointerDownOnBranch = [...context.branches].some((branch) => branch.contains(target)); 25386 if (!isPointerEventsEnabled || isPointerDownOnBranch) return; 25387 onPointerDownOutside?.(event); 25388 onInteractOutside?.(event); 25389 if (!event.defaultPrevented) onDismiss?.(); 25390 }, ownerDocument); 25391 const focusOutside = useFocusOutside((event) => { 25392 const target = event.target; 25393 const isFocusInBranch = [...context.branches].some((branch) => branch.contains(target)); 25394 if (isFocusInBranch) return; 25395 onFocusOutside?.(event); 25396 onInteractOutside?.(event); 25397 if (!event.defaultPrevented) onDismiss?.(); 25398 }, ownerDocument); 25399 useEscapeKeydown((event) => { 25400 const isHighestLayer = index === context.layers.size - 1; 25401 if (!isHighestLayer) return; 25402 onEscapeKeyDown?.(event); 25403 if (!event.defaultPrevented && onDismiss) { 25404 event.preventDefault(); 25405 onDismiss(); 25406 } 25407 }, ownerDocument); 25408 reactExports.useEffect(() => { 25409 if (!node) return; 25410 if (disableOutsidePointerEvents) { 25411 if (context.layersWithOutsidePointerEventsDisabled.size === 0) { 25412 originalBodyPointerEvents = ownerDocument.body.style.pointerEvents; 25413 ownerDocument.body.style.pointerEvents = "none"; 25414 } 25415 context.layersWithOutsidePointerEventsDisabled.add(node); 25416 } 25417 context.layers.add(node); 25418 dispatchUpdate(); 25419 return () => { 25420 if (disableOutsidePointerEvents && context.layersWithOutsidePointerEventsDisabled.size === 1) { 25421 ownerDocument.body.style.pointerEvents = originalBodyPointerEvents; 25422 } 25423 }; 25424 }, [node, ownerDocument, disableOutsidePointerEvents, context]); 25425 reactExports.useEffect(() => { 25426 return () => { 25427 if (!node) return; 25428 context.layers.delete(node); 25429 context.layersWithOutsidePointerEventsDisabled.delete(node); 25430 dispatchUpdate(); 25431 }; 25432 }, [node, context]); 25433 reactExports.useEffect(() => { 25434 const handleUpdate = () => force({}); 25435 document.addEventListener(CONTEXT_UPDATE, handleUpdate); 25436 return () => document.removeEventListener(CONTEXT_UPDATE, handleUpdate); 25437 }, []); 25438 return /* @__PURE__ */ jsxRuntimeExports.jsx( 25439 Primitive.div, 25440 { 25441 ...layerProps, 25442 ref: composedRefs, 25443 style: { 25444 pointerEvents: isBodyPointerEventsDisabled ? isPointerEventsEnabled ? "auto" : "none" : void 0, 25445 ...props.style 25446 }, 25447 onFocusCapture: composeEventHandlers(props.onFocusCapture, focusOutside.onFocusCapture), 25448 onBlurCapture: composeEventHandlers(props.onBlurCapture, focusOutside.onBlurCapture), 25449 onPointerDownCapture: composeEventHandlers( 25450 props.onPointerDownCapture, 25451 pointerDownOutside.onPointerDownCapture 25452 ) 25453 } 25454 ); 25455 } 25456); 25457DismissableLayer.displayName = DISMISSABLE_LAYER_NAME; 25458var BRANCH_NAME = "DismissableLayerBranch"; 25459var DismissableLayerBranch = reactExports.forwardRef((props, forwardedRef) => { 25460 const context = reactExports.useContext(DismissableLayerContext); 25461 const ref = reactExports.useRef(null); 25462 const composedRefs = useComposedRefs(forwardedRef, ref); 25463 reactExports.useEffect(() => { 25464 const node = ref.current; 25465 if (node) { 25466 context.branches.add(node); 25467 return () => { 25468 context.branches.delete(node); 25469 }; 25470 } 25471 }, [context.branches]); 25472 return /* @__PURE__ */ jsxRuntimeExports.jsx(Primitive.div, { ...props, ref: composedRefs }); 25473}); 25474DismissableLayerBranch.displayName = BRANCH_NAME; 25475function usePointerDownOutside(onPointerDownOutside, ownerDocument = globalThis?.document) { 25476 const handlePointerDownOutside = useCallbackRef$1(onPointerDownOutside); 25477 const isPointerInsideReactTreeRef = reactExports.useRef(false); 25478 const handleClickRef = reactExports.useRef(() => { 25479 }); 25480 reactExports.useEffect(() => { 25481 const handlePointerDown = (event) => { 25482 if (event.target && !isPointerInsideReactTreeRef.current) { 25483 let handleAndDispatchPointerDownOutsideEvent2 = function() { 25484 handleAndDispatchCustomEvent( 25485 POINTER_DOWN_OUTSIDE, 25486 handlePointerDownOutside, 25487 eventDetail, 25488 { discrete: true } 25489 ); 25490 }; 25491 const eventDetail = { originalEvent: event }; 25492 if (event.pointerType === "touch") { 25493 ownerDocument.removeEventListener("click", handleClickRef.current); 25494 handleClickRef.current = handleAndDispatchPointerDownOutsideEvent2; 25495 ownerDocument.addEventListener("click", handleClickRef.current, { once: true }); 25496 } else { 25497 handleAndDispatchPointerDownOutsideEvent2(); 25498 } 25499 } else { 25500 ownerDocument.removeEventListener("click", handleClickRef.current); 25501 } 25502 isPointerInsideReactTreeRef.current = false; 25503 }; 25504 const timerId = window.setTimeout(() => { 25505 ownerDocument.addEventListener("pointerdown", handlePointerDown); 25506 }, 0); 25507 return () => { 25508 window.clearTimeout(timerId); 25509 ownerDocument.removeEventListener("pointerdown", handlePointerDown); 25510 ownerDocument.removeEventListener("click", handleClickRef.current); 25511 }; 25512 }, [ownerDocument, handlePointerDownOutside]); 25513 return { 25514 // ensures we check React component tree (not just DOM tree) 25515 onPointerDownCapture: () => isPointerInsideReactTreeRef.current = true 25516 }; 25517} 25518function useFocusOutside(onFocusOutside, ownerDocument = globalThis?.document) { 25519 const handleFocusOutside = useCallbackRef$1(onFocusOutside); 25520 const isFocusInsideReactTreeRef = reactExports.useRef(false); 25521 reactExports.useEffect(() => { 25522 const handleFocus = (event) => { 25523 if (event.target && !isFocusInsideReactTreeRef.current) { 25524 const eventDetail = { originalEvent: event }; 25525 handleAndDispatchCustomEvent(FOCUS_OUTSIDE, handleFocusOutside, eventDetail, { 25526 discrete: false 25527 }); 25528 } 25529 }; 25530 ownerDocument.addEventListener("focusin", handleFocus); 25531 return () => ownerDocument.removeEventListener("focusin", handleFocus); 25532 }, [ownerDocument, handleFocusOutside]); 25533 return { 25534 onFocusCapture: () => isFocusInsideReactTreeRef.current = true, 25535 onBlurCapture: () => isFocusInsideReactTreeRef.current = false 25536 }; 25537} 25538function dispatchUpdate() { 25539 const event = new CustomEvent(CONTEXT_UPDATE); 25540 document.dispatchEvent(event); 25541} 25542function handleAndDispatchCustomEvent(name, handler, detail, { discrete }) { 25543 const target = detail.originalEvent.target; 25544 const event = new CustomEvent(name, { bubbles: false, cancelable: true, detail }); 25545 if (handler) target.addEventListener(name, handler, { once: true }); 25546 if (discrete) { 25547 dispatchDiscreteCustomEvent(target, event); 25548 } else { 25549 target.dispatchEvent(event); 25550 } 25551} 25552
25553// packages/react/use-layout-effect/src/use-layout-effect.tsx 25554var useLayoutEffect2 = globalThis?.document ? reactExports.useLayoutEffect : () => { 25555}; 25556
vendor: 5,546 bytes, lines 25557-25761
25557// packages/react/id/src/id.tsx 25558var useReactId = React$1[" useId ".trim().toString()] || (() => void 0); 25559var count$1 = 0; 25560function useId(deterministicId) { 25561 const [id, setId] = reactExports.useState(useReactId()); 25562 useLayoutEffect2(() => { 25563 setId((reactId) => reactId ?? String(count$1++)); 25564 }, [deterministicId]); 25565 return deterministicId || (id ? `radix-${id}` : ""); 25566} 25567 25568/** 25569 * Custom positioning reference element. 25570 * @see https://floating-ui.com/docs/virtual-elements 25571 */ 25572 25573const sides = ['top', 'right', 'bottom', 'left']; 25574const min = Math.min; 25575const max = Math.max; 25576const round = Math.round; 25577const floor = Math.floor; 25578const createCoords = v => ({ 25579 x: v, 25580 y: v 25581}); 25582const oppositeSideMap = { 25583 left: 'right', 25584 right: 'left', 25585 bottom: 'top', 25586 top: 'bottom' 25587}; 25588const oppositeAlignmentMap = { 25589 start: 'end', 25590 end: 'start' 25591}; 25592function clamp$1(start, value, end) { 25593 return max(start, min(value, end)); 25594} 25595function evaluate(value, param) { 25596 return typeof value === 'function' ? value(param) : value; 25597} 25598function getSide(placement) { 25599 return placement.split('-')[0]; 25600} 25601function getAlignment(placement) { 25602 return placement.split('-')[1]; 25603} 25604function getOppositeAxis(axis) { 25605 return axis === 'x' ? 'y' : 'x'; 25606} 25607function getAxisLength(axis) { 25608 return axis === 'y' ? 'height' : 'width'; 25609} 25610const yAxisSides = /*#__PURE__*/new Set(['top', 'bottom']); 25611function getSideAxis(placement) { 25612 return yAxisSides.has(getSide(placement)) ? 'y' : 'x'; 25613} 25614function getAlignmentAxis(placement) { 25615 return getOppositeAxis(getSideAxis(placement)); 25616} 25617function getAlignmentSides(placement, rects, rtl) { 25618 if (rtl === void 0) { 25619 rtl = false; 25620 } 25621 const alignment = getAlignment(placement); 25622 const alignmentAxis = getAlignmentAxis(placement); 25623 const length = getAxisLength(alignmentAxis); 25624 let mainAlignmentSide = alignmentAxis === 'x' ? alignment === (rtl ? 'end' : 'start') ? 'right' : 'left' : alignment === 'start' ? 'bottom' : 'top'; 25625 if (rects.reference[length] > rects.floating[length]) { 25626 mainAlignmentSide = getOppositePlacement(mainAlignmentSide); 25627 } 25628 return [mainAlignmentSide, getOppositePlacement(mainAlignmentSide)]; 25629} 25630function getExpandedPlacements(placement) { 25631 const oppositePlacement = getOppositePlacement(placement); 25632 return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)]; 25633} 25634function getOppositeAlignmentPlacement(placement) { 25635 return placement.replace(/start|end/g, alignment => oppositeAlignmentMap[alignment]); 25636} 25637const lrPlacement = ['left', 'right']; 25638const rlPlacement = ['right', 'left']; 25639const tbPlacement = ['top', 'bottom']; 25640const btPlacement = ['bottom', 'top']; 25641function getSideList(side, isStart, rtl) { 25642 switch (side) { 25643 case 'top': 25644 case 'bottom': 25645 if (rtl) return isStart ? rlPlacement : lrPlacement; 25646 return isStart ? lrPlacement : rlPlacement; 25647 case 'left': 25648 case 'right': 25649 return isStart ? tbPlacement : btPlacement; 25650 default: 25651 return []; 25652 } 25653} 25654function getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) { 25655 const alignment = getAlignment(placement); 25656 let list = getSideList(getSide(placement), direction === 'start', rtl); 25657 if (alignment) { 25658 list = list.map(side => side + "-" + alignment); 25659 if (flipAlignment) { 25660 list = list.concat(list.map(getOppositeAlignmentPlacement)); 25661 } 25662 } 25663 return list; 25664} 25665function getOppositePlacement(placement) { 25666 return placement.replace(/left|right|bottom|top/g, side => oppositeSideMap[side]); 25667} 25668function expandPaddingObject(padding) { 25669 return { 25670 top: 0, 25671 right: 0, 25672 bottom: 0, 25673 left: 0, 25674 ...padding 25675 }; 25676} 25677function getPaddingObject(padding) { 25678 return typeof padding !== 'number' ? expandPaddingObject(padding) : { 25679 top: padding, 25680 right: padding, 25681 bottom: padding, 25682 left: padding 25683 }; 25684} 25685function rectToClientRect(rect) { 25686 const { 25687 x, 25688 y, 25689 width, 25690 height 25691 } = rect; 25692 return { 25693 width, 25694 height, 25695 top: y, 25696 left: x, 25697 right: x + width, 25698 bottom: y + height, 25699 x, 25700 y 25701 }; 25702} 25703 25704function computeCoordsFromPlacement(_ref, placement, rtl) { 25705 let { 25706 reference, 25707 floating 25708 } = _ref; 25709 const sideAxis = getSideAxis(placement); 25710 const alignmentAxis = getAlignmentAxis(placement); 25711 const alignLength = getAxisLength(alignmentAxis); 25712 const side = getSide(placement); 25713 const isVertical = sideAxis === 'y'; 25714 const commonX = reference.x + reference.width / 2 - floating.width / 2; 25715 const commonY = reference.y + reference.height / 2 - floating.height / 2; 25716 const commonAlign = reference[alignLength] / 2 - floating[alignLength] / 2; 25717 let coords; 25718 switch (side) { 25719 case 'top': 25720 coords = { 25721 x: commonX, 25722 y: reference.y - floating.height 25723 }; 25724 break; 25725 case 'bottom': 25726 coords = { 25727 x: commonX, 25728 y: reference.y + reference.height 25729 }; 25730 break; 25731 case 'right': 25732 coords = { 25733 x: reference.x + reference.width, 25734 y: commonY 25735 }; 25736 break; 25737 case 'left': 25738 coords = { 25739 x: reference.x - floating.width, 25740 y: commonY 25741 }; 25742 break; 25743 default: 25744 coords = { 25745 x: reference.x, 25746 y: reference.y 25747 }; 25748 } 25749 switch (getAlignment(placement)) { 25750 case 'start': 25751 coords[alignmentAxis] -= commonAlign * (rtl && isVertical ? -1 : 1); 25752 break; 25753 case 'end': 25754 coords[alignmentAxis] += commonAlign * (rtl && isVertical ? -1 : 1); 25755 break; 25756 } 25757 return coords; 25758} 25759 25760/** 25761 * Computes the `x` and `y` coordinates that will place the floating element
vendor: 11,160 bytes, lines 25762-26069
25762 * next to a given reference element. 25763 * 25764 * This export does not have any `platform` interface logic. You will need to 25765 * write one for the platform you are using Floating UI with. 25766 */ 25767const computePosition$1 = async (reference, floating, config) => { 25768 const { 25769 placement = 'bottom', 25770 strategy = 'absolute', 25771 middleware = [], 25772 platform 25773 } = config; 25774 const validMiddleware = middleware.filter(Boolean); 25775 const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(floating)); 25776 let rects = await platform.getElementRects({ 25777 reference, 25778 floating, 25779 strategy 25780 }); 25781 let { 25782 x, 25783 y 25784 } = computeCoordsFromPlacement(rects, placement, rtl); 25785 let statefulPlacement = placement; 25786 let middlewareData = {}; 25787 let resetCount = 0; 25788 for (let i = 0; i < validMiddleware.length; i++) { 25789 const { 25790 name, 25791 fn 25792 } = validMiddleware[i]; 25793 const { 25794 x: nextX, 25795 y: nextY, 25796 data, 25797 reset 25798 } = await fn({ 25799 x, 25800 y, 25801 initialPlacement: placement, 25802 placement: statefulPlacement, 25803 strategy, 25804 middlewareData, 25805 rects, 25806 platform, 25807 elements: { 25808 reference, 25809 floating 25810 } 25811 }); 25812 x = nextX != null ? nextX : x; 25813 y = nextY != null ? nextY : y; 25814 middlewareData = { 25815 ...middlewareData, 25816 [name]: { 25817 ...middlewareData[name], 25818 ...data 25819 } 25820 }; 25821 if (reset && resetCount <= 50) { 25822 resetCount++; 25823 if (typeof reset === 'object') { 25824 if (reset.placement) { 25825 statefulPlacement = reset.placement; 25826 } 25827 if (reset.rects) { 25828 rects = reset.rects === true ? await platform.getElementRects({ 25829 reference, 25830 floating, 25831 strategy 25832 }) : reset.rects; 25833 } 25834 ({ 25835 x, 25836 y 25837 } = computeCoordsFromPlacement(rects, statefulPlacement, rtl)); 25838 } 25839 i = -1; 25840 } 25841 } 25842 return { 25843 x, 25844 y, 25845 placement: statefulPlacement, 25846 strategy, 25847 middlewareData 25848 }; 25849}; 25850 25851/** 25852 * Resolves with an object of overflow side offsets that determine how much the 25853 * element is overflowing a given clipping boundary on each side. 25854 * - positive = overflowing the boundary by that number of pixels 25855 * - negative = how many pixels left before it will overflow 25856 * - 0 = lies flush with the boundary 25857 * @see https://floating-ui.com/docs/detectOverflow 25858 */ 25859async function detectOverflow(state, options) { 25860 var _await$platform$isEle; 25861 if (options === void 0) { 25862 options = {}; 25863 } 25864 const { 25865 x, 25866 y, 25867 platform, 25868 rects, 25869 elements, 25870 strategy 25871 } = state; 25872 const { 25873 boundary = 'clippingAncestors', 25874 rootBoundary = 'viewport', 25875 elementContext = 'floating', 25876 altBoundary = false, 25877 padding = 0 25878 } = evaluate(options, state); 25879 const paddingObject = getPaddingObject(padding); 25880 const altContext = elementContext === 'floating' ? 'reference' : 'floating'; 25881 const element = elements[altBoundary ? altContext : elementContext]; 25882 const clippingClientRect = rectToClientRect(await platform.getClippingRect({ 25883 element: ((_await$platform$isEle = await (platform.isElement == null ? void 0 : platform.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || (await (platform.getDocumentElement == null ? void 0 : platform.getDocumentElement(elements.floating))), 25884 boundary, 25885 rootBoundary, 25886 strategy 25887 })); 25888 const rect = elementContext === 'floating' ? { 25889 x, 25890 y, 25891 width: rects.floating.width, 25892 height: rects.floating.height 25893 } : rects.reference; 25894 const offsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating)); 25895 const offsetScale = (await (platform.isElement == null ? void 0 : platform.isElement(offsetParent))) ? (await (platform.getScale == null ? void 0 : platform.getScale(offsetParent))) || { 25896 x: 1, 25897 y: 1 25898 } : { 25899 x: 1, 25900 y: 1 25901 }; 25902 const elementClientRect = rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({ 25903 elements, 25904 rect, 25905 offsetParent, 25906 strategy 25907 }) : rect); 25908 return { 25909 top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y, 25910 bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y, 25911 left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x, 25912 right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x 25913 }; 25914} 25915 25916/** 25917 * Provides data to position an inner element of the floating element so that it 25918 * appears centered to the reference element. 25919 * @see https://floating-ui.com/docs/arrow 25920 */ 25921const arrow$3 = options => ({ 25922 name: 'arrow', 25923 options, 25924 async fn(state) { 25925 const { 25926 x, 25927 y, 25928 placement, 25929 rects, 25930 platform, 25931 elements, 25932 middlewareData 25933 } = state; 25934 // Since `element` is required, we don't Partial<> the type. 25935 const { 25936 element, 25937 padding = 0 25938 } = evaluate(options, state) || {}; 25939 if (element == null) { 25940 return {}; 25941 } 25942 const paddingObject = getPaddingObject(padding); 25943 const coords = { 25944 x, 25945 y 25946 }; 25947 const axis = getAlignmentAxis(placement); 25948 const length = getAxisLength(axis); 25949 const arrowDimensions = await platform.getDimensions(element); 25950 const isYAxis = axis === 'y'; 25951 const minProp = isYAxis ? 'top' : 'left'; 25952 const maxProp = isYAxis ? 'bottom' : 'right'; 25953 const clientProp = isYAxis ? 'clientHeight' : 'clientWidth'; 25954 const endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length]; 25955 const startDiff = coords[axis] - rects.reference[axis]; 25956 const arrowOffsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(element)); 25957 let clientSize = arrowOffsetParent ? arrowOffsetParent[clientProp] : 0; 25958 25959 // DOM platform can return `window` as the `offsetParent`. 25960 if (!clientSize || !(await (platform.isElement == null ? void 0 : platform.isElement(arrowOffsetParent)))) { 25961 clientSize = elements.floating[clientProp] || rects.floating[length]; 25962 } 25963 const centerToReference = endDiff / 2 - startDiff / 2; 25964 25965 // If the padding is large enough that it causes the arrow to no longer be 25966 // centered, modify the padding so that it is centered. 25967 const largestPossiblePadding = clientSize / 2 - arrowDimensions[length] / 2 - 1; 25968 const minPadding = min(paddingObject[minProp], largestPossiblePadding); 25969 const maxPadding = min(paddingObject[maxProp], largestPossiblePadding); 25970 25971 // Make sure the arrow doesn't overflow the floating element if the center 25972 // point is outside the floating element's bounds. 25973 const min$1 = minPadding; 25974 const max = clientSize - arrowDimensions[length] - maxPadding; 25975 const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference; 25976 const offset = clamp$1(min$1, center, max); 25977 25978 // If the reference is small enough that the arrow's padding causes it to 25979 // to point to nothing for an aligned placement, adjust the offset of the 25980 // floating element itself. To ensure `shift()` continues to take action, 25981 // a single reset is performed when this is true. 25982 const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center !== offset && rects.reference[length] / 2 - (center < min$1 ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0; 25983 const alignmentOffset = shouldAddOffset ? center < min$1 ? center - min$1 : center - max : 0; 25984 return { 25985 [axis]: coords[axis] + alignmentOffset, 25986 data: { 25987 [axis]: offset, 25988 centerOffset: center - offset - alignmentOffset, 25989 ...(shouldAddOffset && { 25990 alignmentOffset 25991 }) 25992 }, 25993 reset: shouldAddOffset 25994 }; 25995 } 25996}); 25997 25998/** 25999 * Optimizes the visibility of the floating element by flipping the `placement` 26000 * in order to keep it in view when the preferred placement(s) will overflow the 26001 * clipping boundary. Alternative to `autoPlacement`. 26002 * @see https://floating-ui.com/docs/flip 26003 */ 26004const flip$2 = function (options) { 26005 if (options === void 0) { 26006 options = {}; 26007 } 26008 return { 26009 name: 'flip', 26010 options, 26011 async fn(state) { 26012 var _middlewareData$arrow, _middlewareData$flip; 26013 const { 26014 placement, 26015 middlewareData, 26016 rects, 26017 initialPlacement, 26018 platform, 26019 elements 26020 } = state; 26021 const { 26022 mainAxis: checkMainAxis = true, 26023 crossAxis: checkCrossAxis = true, 26024 fallbackPlacements: specifiedFallbackPlacements, 26025 fallbackStrategy = 'bestFit', 26026 fallbackAxisSideDirection = 'none', 26027 flipAlignment = true, 26028 ...detectOverflowOptions 26029 } = evaluate(options, state); 26030 26031 // If a reset by the arrow was caused due to an alignment offset being 26032 // added, we should skip any logic now since `flip()` has already done its 26033 // work. 26034 // https://github.com/floating-ui/floating-ui/issues/2549#issuecomment-1719601643 26035 if ((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) { 26036 return {}; 26037 } 26038 const side = getSide(placement); 26039 const initialSideAxis = getSideAxis(initialPlacement); 26040 const isBasePlacement = getSide(initialPlacement) === initialPlacement; 26041 const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating)); 26042 const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement)); 26043 const hasFallbackAxisSideDirection = fallbackAxisSideDirection !== 'none'; 26044 if (!specifiedFallbackPlacements && hasFallbackAxisSideDirection) { 26045 fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl)); 26046 } 26047 const placements = [initialPlacement, ...fallbackPlacements]; 26048 const overflow = await detectOverflow(state, detectOverflowOptions); 26049 const overflows = []; 26050 let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || []; 26051 if (checkMainAxis) { 26052 overflows.push(overflow[side]); 26053 } 26054 if (checkCrossAxis) { 26055 const sides = getAlignmentSides(placement, rects, rtl); 26056 overflows.push(overflow[sides[0]], overflow[sides[1]]); 26057 } 26058 overflowsData = [...overflowsData, { 26059 placement, 26060 overflows 26061 }]; 26062 26063 // One or more sides is overflowing. 26064 if (!overflows.every(side => side <= 0)) { 26065 var _middlewareData$flip2, _overflowsData$filter; 26066 const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1; 26067 const nextPlacement = placements[nextIndex]; 26068 if (nextPlacement) { 26069 const ignoreCrossAxisOverflow = checkCrossAxis === 'alignment' ? initialSideAxis !== getSideAxis(nextPlacement) : false;
vendor: 4,912 bytes, lines 26070-26221
26070 if (!ignoreCrossAxisOverflow || 26071 // We leave the current main axis only if every placement on that axis 26072 // overflows the main axis. 26073 overflowsData.every(d => getSideAxis(d.placement) === initialSideAxis ? d.overflows[0] > 0 : true)) { 26074 // Try next placement and re-run the lifecycle. 26075 return { 26076 data: { 26077 index: nextIndex, 26078 overflows: overflowsData 26079 }, 26080 reset: { 26081 placement: nextPlacement 26082 } 26083 }; 26084 } 26085 } 26086 26087 // First, find the candidates that fit on the mainAxis side of overflow, 26088 // then find the placement that fits the best on the main crossAxis side. 26089 let resetPlacement = (_overflowsData$filter = overflowsData.filter(d => d.overflows[0] <= 0).sort((a, b) => a.overflows[1] - b.overflows[1])[0]) == null ? void 0 : _overflowsData$filter.placement; 26090 26091 // Otherwise fallback. 26092 if (!resetPlacement) { 26093 switch (fallbackStrategy) { 26094 case 'bestFit': 26095 { 26096 var _overflowsData$filter2; 26097 const placement = (_overflowsData$filter2 = overflowsData.filter(d => { 26098 if (hasFallbackAxisSideDirection) { 26099 const currentSideAxis = getSideAxis(d.placement); 26100 return currentSideAxis === initialSideAxis || 26101 // Create a bias to the `y` side axis due to horizontal 26102 // reading directions favoring greater width. 26103 currentSideAxis === 'y'; 26104 } 26105 return true; 26106 }).map(d => [d.placement, d.overflows.filter(overflow => overflow > 0).reduce((acc, overflow) => acc + overflow, 0)]).sort((a, b) => a[1] - b[1])[0]) == null ? void 0 : _overflowsData$filter2[0]; 26107 if (placement) { 26108 resetPlacement = placement; 26109 } 26110 break; 26111 } 26112 case 'initialPlacement': 26113 resetPlacement = initialPlacement; 26114 break; 26115 } 26116 } 26117 if (placement !== resetPlacement) { 26118 return { 26119 reset: { 26120 placement: resetPlacement 26121 } 26122 }; 26123 } 26124 } 26125 return {}; 26126 } 26127 }; 26128}; 26129 26130function getSideOffsets(overflow, rect) { 26131 return { 26132 top: overflow.top - rect.height, 26133 right: overflow.right - rect.width, 26134 bottom: overflow.bottom - rect.height, 26135 left: overflow.left - rect.width 26136 }; 26137} 26138function isAnySideFullyClipped(overflow) { 26139 return sides.some(side => overflow[side] >= 0); 26140} 26141/** 26142 * Provides data to hide the floating element in applicable situations, such as 26143 * when it is not in the same clipping context as the reference element. 26144 * @see https://floating-ui.com/docs/hide 26145 */ 26146const hide$2 = function (options) { 26147 if (options === void 0) { 26148 options = {}; 26149 } 26150 return { 26151 name: 'hide', 26152 options, 26153 async fn(state) { 26154 const { 26155 rects 26156 } = state; 26157 const { 26158 strategy = 'referenceHidden', 26159 ...detectOverflowOptions 26160 } = evaluate(options, state); 26161 switch (strategy) { 26162 case 'referenceHidden': 26163 { 26164 const overflow = await detectOverflow(state, { 26165 ...detectOverflowOptions, 26166 elementContext: 'reference' 26167 }); 26168 const offsets = getSideOffsets(overflow, rects.reference); 26169 return { 26170 data: { 26171 referenceHiddenOffsets: offsets, 26172 referenceHidden: isAnySideFullyClipped(offsets) 26173 } 26174 }; 26175 } 26176 case 'escaped': 26177 { 26178 const overflow = await detectOverflow(state, { 26179 ...detectOverflowOptions, 26180 altBoundary: true 26181 }); 26182 const offsets = getSideOffsets(overflow, rects.floating); 26183 return { 26184 data: { 26185 escapedOffsets: offsets, 26186 escaped: isAnySideFullyClipped(offsets) 26187 } 26188 }; 26189 } 26190 default: 26191 { 26192 return {}; 26193 } 26194 } 26195 } 26196 }; 26197}; 26198 26199const originSides = /*#__PURE__*/new Set(['left', 'top']); 26200 26201// For type backwards-compatibility, the `OffsetOptions` type was also 26202// Derivable. 26203 26204async function convertValueToCoords(state, options) { 26205 const { 26206 placement, 26207 platform, 26208 elements 26209 } = state; 26210 const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating)); 26211 const side = getSide(placement); 26212 const alignment = getAlignment(placement); 26213 const isVertical = getSideAxis(placement) === 'y'; 26214 const mainAxisMulti = originSides.has(side) ? -1 : 1; 26215 const crossAxisMulti = rtl && isVertical ? -1 : 1; 26216 const rawValue = evaluate(options, state); 26217 26218 // eslint-disable-next-line prefer-const 26219 let { 26220 mainAxis, 26221 crossAxis,
vendor: 10,238 bytes, lines 26222-26537
26222 alignmentAxis 26223 } = typeof rawValue === 'number' ? { 26224 mainAxis: rawValue, 26225 crossAxis: 0, 26226 alignmentAxis: null 26227 } : { 26228 mainAxis: rawValue.mainAxis || 0, 26229 crossAxis: rawValue.crossAxis || 0, 26230 alignmentAxis: rawValue.alignmentAxis 26231 }; 26232 if (alignment && typeof alignmentAxis === 'number') { 26233 crossAxis = alignment === 'end' ? alignmentAxis * -1 : alignmentAxis; 26234 } 26235 return isVertical ? { 26236 x: crossAxis * crossAxisMulti, 26237 y: mainAxis * mainAxisMulti 26238 } : { 26239 x: mainAxis * mainAxisMulti, 26240 y: crossAxis * crossAxisMulti 26241 }; 26242} 26243 26244/** 26245 * Modifies the placement by translating the floating element along the 26246 * specified axes. 26247 * A number (shorthand for `mainAxis` or distance), or an axes configuration 26248 * object may be passed. 26249 * @see https://floating-ui.com/docs/offset 26250 */ 26251const offset$2 = function (options) { 26252 if (options === void 0) { 26253 options = 0; 26254 } 26255 return { 26256 name: 'offset', 26257 options, 26258 async fn(state) { 26259 var _middlewareData$offse, _middlewareData$arrow; 26260 const { 26261 x, 26262 y, 26263 placement, 26264 middlewareData 26265 } = state; 26266 const diffCoords = await convertValueToCoords(state, options); 26267 26268 // If the placement is the same and the arrow caused an alignment offset 26269 // then we don't need to change the positioning coordinates. 26270 if (placement === ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse.placement) && (_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) { 26271 return {}; 26272 } 26273 return { 26274 x: x + diffCoords.x, 26275 y: y + diffCoords.y, 26276 data: { 26277 ...diffCoords, 26278 placement 26279 } 26280 }; 26281 } 26282 }; 26283}; 26284 26285/** 26286 * Optimizes the visibility of the floating element by shifting it in order to 26287 * keep it in view when it will overflow the clipping boundary. 26288 * @see https://floating-ui.com/docs/shift 26289 */ 26290const shift$2 = function (options) { 26291 if (options === void 0) { 26292 options = {}; 26293 } 26294 return { 26295 name: 'shift', 26296 options, 26297 async fn(state) { 26298 const { 26299 x, 26300 y, 26301 placement 26302 } = state; 26303 const { 26304 mainAxis: checkMainAxis = true, 26305 crossAxis: checkCrossAxis = false, 26306 limiter = { 26307 fn: _ref => { 26308 let { 26309 x, 26310 y 26311 } = _ref; 26312 return { 26313 x, 26314 y 26315 }; 26316 } 26317 }, 26318 ...detectOverflowOptions 26319 } = evaluate(options, state); 26320 const coords = { 26321 x, 26322 y 26323 }; 26324 const overflow = await detectOverflow(state, detectOverflowOptions); 26325 const crossAxis = getSideAxis(getSide(placement)); 26326 const mainAxis = getOppositeAxis(crossAxis); 26327 let mainAxisCoord = coords[mainAxis]; 26328 let crossAxisCoord = coords[crossAxis]; 26329 if (checkMainAxis) { 26330 const minSide = mainAxis === 'y' ? 'top' : 'left'; 26331 const maxSide = mainAxis === 'y' ? 'bottom' : 'right'; 26332 const min = mainAxisCoord + overflow[minSide]; 26333 const max = mainAxisCoord - overflow[maxSide]; 26334 mainAxisCoord = clamp$1(min, mainAxisCoord, max); 26335 } 26336 if (checkCrossAxis) { 26337 const minSide = crossAxis === 'y' ? 'top' : 'left'; 26338 const maxSide = crossAxis === 'y' ? 'bottom' : 'right'; 26339 const min = crossAxisCoord + overflow[minSide]; 26340 const max = crossAxisCoord - overflow[maxSide]; 26341 crossAxisCoord = clamp$1(min, crossAxisCoord, max); 26342 } 26343 const limitedCoords = limiter.fn({ 26344 ...state, 26345 [mainAxis]: mainAxisCoord, 26346 [crossAxis]: crossAxisCoord 26347 }); 26348 return { 26349 ...limitedCoords, 26350 data: { 26351 x: limitedCoords.x - x, 26352 y: limitedCoords.y - y, 26353 enabled: { 26354 [mainAxis]: checkMainAxis, 26355 [crossAxis]: checkCrossAxis 26356 } 26357 } 26358 }; 26359 } 26360 }; 26361}; 26362/** 26363 * Built-in `limiter` that will stop `shift()` at a certain point. 26364 */ 26365const limitShift$2 = function (options) { 26366 if (options === void 0) { 26367 options = {}; 26368 } 26369 return { 26370 options, 26371 fn(state) { 26372 const { 26373 x, 26374 y, 26375 placement, 26376 rects, 26377 middlewareData 26378 } = state; 26379 const { 26380 offset = 0, 26381 mainAxis: checkMainAxis = true, 26382 crossAxis: checkCrossAxis = true 26383 } = evaluate(options, state); 26384 const coords = { 26385 x, 26386 y 26387 }; 26388 const crossAxis = getSideAxis(placement); 26389 const mainAxis = getOppositeAxis(crossAxis); 26390 let mainAxisCoord = coords[mainAxis]; 26391 let crossAxisCoord = coords[crossAxis]; 26392 const rawOffset = evaluate(offset, state); 26393 const computedOffset = typeof rawOffset === 'number' ? { 26394 mainAxis: rawOffset, 26395 crossAxis: 0 26396 } : { 26397 mainAxis: 0, 26398 crossAxis: 0, 26399 ...rawOffset 26400 }; 26401 if (checkMainAxis) { 26402 const len = mainAxis === 'y' ? 'height' : 'width'; 26403 const limitMin = rects.reference[mainAxis] - rects.floating[len] + computedOffset.mainAxis; 26404 const limitMax = rects.reference[mainAxis] + rects.reference[len] - computedOffset.mainAxis; 26405 if (mainAxisCoord < limitMin) { 26406 mainAxisCoord = limitMin; 26407 } else if (mainAxisCoord > limitMax) { 26408 mainAxisCoord = limitMax; 26409 } 26410 } 26411 if (checkCrossAxis) { 26412 var _middlewareData$offse, _middlewareData$offse2; 26413 const len = mainAxis === 'y' ? 'width' : 'height'; 26414 const isOriginSide = originSides.has(getSide(placement)); 26415 const limitMin = rects.reference[crossAxis] - rects.floating[len] + (isOriginSide ? ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse[crossAxis]) || 0 : 0) + (isOriginSide ? 0 : computedOffset.crossAxis); 26416 const limitMax = rects.reference[crossAxis] + rects.reference[len] + (isOriginSide ? 0 : ((_middlewareData$offse2 = middlewareData.offset) == null ? void 0 : _middlewareData$offse2[crossAxis]) || 0) - (isOriginSide ? computedOffset.crossAxis : 0); 26417 if (crossAxisCoord < limitMin) { 26418 crossAxisCoord = limitMin; 26419 } else if (crossAxisCoord > limitMax) { 26420 crossAxisCoord = limitMax; 26421 } 26422 } 26423 return { 26424 [mainAxis]: mainAxisCoord, 26425 [crossAxis]: crossAxisCoord 26426 }; 26427 } 26428 }; 26429}; 26430 26431/** 26432 * Provides data that allows you to change the size of the floating element â 26433 * for instance, prevent it from overflowing the clipping boundary or match the 26434 * width of the reference element. 26435 * @see https://floating-ui.com/docs/size 26436 */ 26437const size$2 = function (options) { 26438 if (options === void 0) { 26439 options = {}; 26440 } 26441 return { 26442 name: 'size', 26443 options, 26444 async fn(state) { 26445 var _state$middlewareData, _state$middlewareData2; 26446 const { 26447 placement, 26448 rects, 26449 platform, 26450 elements 26451 } = state; 26452 const { 26453 apply = () => {}, 26454 ...detectOverflowOptions 26455 } = evaluate(options, state); 26456 const overflow = await detectOverflow(state, detectOverflowOptions); 26457 const side = getSide(placement); 26458 const alignment = getAlignment(placement); 26459 const isYAxis = getSideAxis(placement) === 'y'; 26460 const { 26461 width, 26462 height 26463 } = rects.floating; 26464 let heightSide; 26465 let widthSide; 26466 if (side === 'top' || side === 'bottom') { 26467 heightSide = side; 26468 widthSide = alignment === ((await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating))) ? 'start' : 'end') ? 'left' : 'right'; 26469 } else { 26470 widthSide = side; 26471 heightSide = alignment === 'end' ? 'top' : 'bottom'; 26472 } 26473 const maximumClippingHeight = height - overflow.top - overflow.bottom; 26474 const maximumClippingWidth = width - overflow.left - overflow.right; 26475 const overflowAvailableHeight = min(height - overflow[heightSide], maximumClippingHeight); 26476 const overflowAvailableWidth = min(width - overflow[widthSide], maximumClippingWidth); 26477 const noShift = !state.middlewareData.shift; 26478 let availableHeight = overflowAvailableHeight; 26479 let availableWidth = overflowAvailableWidth; 26480 if ((_state$middlewareData = state.middlewareData.shift) != null && _state$middlewareData.enabled.x) { 26481 availableWidth = maximumClippingWidth; 26482 } 26483 if ((_state$middlewareData2 = state.middlewareData.shift) != null && _state$middlewareData2.enabled.y) { 26484 availableHeight = maximumClippingHeight; 26485 } 26486 if (noShift && !alignment) { 26487 const xMin = max(overflow.left, 0); 26488 const xMax = max(overflow.right, 0); 26489 const yMin = max(overflow.top, 0); 26490 const yMax = max(overflow.bottom, 0); 26491 if (isYAxis) { 26492 availableWidth = width - 2 * (xMin !== 0 || xMax !== 0 ? xMin + xMax : max(overflow.left, overflow.right)); 26493 } else { 26494 availableHeight = height - 2 * (yMin !== 0 || yMax !== 0 ? yMin + yMax : max(overflow.top, overflow.bottom)); 26495 } 26496 } 26497 await apply({ 26498 ...state, 26499 availableWidth, 26500 availableHeight 26501 }); 26502 const nextDimensions = await platform.getDimensions(elements.floating); 26503 if (width !== nextDimensions.width || height !== nextDimensions.height) { 26504 return { 26505 reset: { 26506 rects: true 26507 } 26508 }; 26509 } 26510 return {}; 26511 } 26512 }; 26513}; 26514 26515function hasWindow() { 26516 return typeof window !== 'undefined'; 26517} 26518function getNodeName(node) { 26519 if (isNode$1(node)) { 26520 return (node.nodeName || '').toLowerCase(); 26521 } 26522 // Mocked nodes in testing environments may not be instances of Node. By 26523 // returning `#document` an infinite loop won't occur. 26524 // https://github.com/floating-ui/floating-ui/issues/2317 26525 return '#document'; 26526} 26527function getWindow$1(node) { 26528 var _node$ownerDocument; 26529 return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window; 26530} 26531function getDocumentElement(node) { 26532 var _ref; 26533 return (_ref = (isNode$1(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement; 26534} 26535function isNode$1(value) { 26536 if (!hasWindow()) { 26537 return false;
vendor: 4,422 bytes, lines 26538-26662
26538 } 26539 return value instanceof Node || value instanceof getWindow$1(value).Node; 26540} 26541function isElement(value) { 26542 if (!hasWindow()) { 26543 return false; 26544 } 26545 return value instanceof Element || value instanceof getWindow$1(value).Element; 26546} 26547function isHTMLElement$1(value) { 26548 if (!hasWindow()) { 26549 return false; 26550 } 26551 return value instanceof HTMLElement || value instanceof getWindow$1(value).HTMLElement; 26552} 26553function isShadowRoot(value) { 26554 if (!hasWindow() || typeof ShadowRoot === 'undefined') { 26555 return false; 26556 } 26557 return value instanceof ShadowRoot || value instanceof getWindow$1(value).ShadowRoot; 26558} 26559const invalidOverflowDisplayValues = /*#__PURE__*/new Set(['inline', 'contents']); 26560function isOverflowElement(element) { 26561 const { 26562 overflow, 26563 overflowX, 26564 overflowY, 26565 display 26566 } = getComputedStyle$1(element); 26567 return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !invalidOverflowDisplayValues.has(display); 26568} 26569const tableElements = /*#__PURE__*/new Set(['table', 'td', 'th']); 26570function isTableElement(element) { 26571 return tableElements.has(getNodeName(element)); 26572} 26573const topLayerSelectors = [':popover-open', ':modal']; 26574function isTopLayer(element) { 26575 return topLayerSelectors.some(selector => { 26576 try { 26577 return element.matches(selector); 26578 } catch (_e) { 26579 return false; 26580 } 26581 }); 26582} 26583const transformProperties = ['transform', 'translate', 'scale', 'rotate', 'perspective']; 26584const willChangeValues = ['transform', 'translate', 'scale', 'rotate', 'perspective', 'filter']; 26585const containValues = ['paint', 'layout', 'strict', 'content']; 26586function isContainingBlock(elementOrCss) { 26587 const webkit = isWebKit(); 26588 const css = isElement(elementOrCss) ? getComputedStyle$1(elementOrCss) : elementOrCss; 26589 26590 // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block 26591 // https://drafts.csswg.org/css-transforms-2/#individual-transforms 26592 return transformProperties.some(value => css[value] ? css[value] !== 'none' : false) || (css.containerType ? css.containerType !== 'normal' : false) || !webkit && (css.backdropFilter ? css.backdropFilter !== 'none' : false) || !webkit && (css.filter ? css.filter !== 'none' : false) || willChangeValues.some(value => (css.willChange || '').includes(value)) || containValues.some(value => (css.contain || '').includes(value)); 26593} 26594function getContainingBlock(element) { 26595 let currentNode = getParentNode(element); 26596 while (isHTMLElement$1(currentNode) && !isLastTraversableNode(currentNode)) { 26597 if (isContainingBlock(currentNode)) { 26598 return currentNode; 26599 } else if (isTopLayer(currentNode)) { 26600 return null; 26601 } 26602 currentNode = getParentNode(currentNode); 26603 } 26604 return null; 26605} 26606function isWebKit() { 26607 if (typeof CSS === 'undefined' || !CSS.supports) return false; 26608 return CSS.supports('-webkit-backdrop-filter', 'none'); 26609} 26610const lastTraversableNodeNames = /*#__PURE__*/new Set(['html', 'body', '#document']); 26611function isLastTraversableNode(node) { 26612 return lastTraversableNodeNames.has(getNodeName(node)); 26613} 26614function getComputedStyle$1(element) { 26615 return getWindow$1(element).getComputedStyle(element); 26616} 26617function getNodeScroll(element) { 26618 if (isElement(element)) { 26619 return { 26620 scrollLeft: element.scrollLeft, 26621 scrollTop: element.scrollTop 26622 }; 26623 } 26624 return { 26625 scrollLeft: element.scrollX, 26626 scrollTop: element.scrollY 26627 }; 26628} 26629function getParentNode(node) { 26630 if (getNodeName(node) === 'html') { 26631 return node; 26632 } 26633 const result = 26634 // Step into the shadow DOM of the parent of a slotted node. 26635 node.assignedSlot || 26636 // DOM Element detected. 26637 node.parentNode || 26638 // ShadowRoot detected. 26639 isShadowRoot(node) && node.host || 26640 // Fallback. 26641 getDocumentElement(node); 26642 return isShadowRoot(result) ? result.host : result; 26643} 26644function getNearestOverflowAncestor(node) { 26645 const parentNode = getParentNode(node); 26646 if (isLastTraversableNode(parentNode)) { 26647 return node.ownerDocument ? node.ownerDocument.body : node.body; 26648 } 26649 if (isHTMLElement$1(parentNode) && isOverflowElement(parentNode)) { 26650 return parentNode; 26651 } 26652 return getNearestOverflowAncestor(parentNode); 26653} 26654function getOverflowAncestors(node, list, traverseIframes) { 26655 var _node$ownerDocument2; 26656 if (list === void 0) { 26657 list = []; 26658 } 26659 if (traverseIframes === void 0) { 26660 traverseIframes = true; 26661 } 26662 const scrollableAncestor = getNearestOverflowAncestor(node);
vendor: 3,654 bytes, lines 26663-26775
26663 const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body); 26664 const win = getWindow$1(scrollableAncestor); 26665 if (isBody) { 26666 const frameElement = getFrameElement(win); 26667 return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []); 26668 } 26669 return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes)); 26670} 26671function getFrameElement(win) { 26672 return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null; 26673} 26674 26675function getCssDimensions(element) { 26676 const css = getComputedStyle$1(element); 26677 // In testing environments, the `width` and `height` properties are empty 26678 // strings for SVG elements, returning NaN. Fallback to `0` in this case. 26679 let width = parseFloat(css.width) || 0; 26680 let height = parseFloat(css.height) || 0; 26681 const hasOffset = isHTMLElement$1(element); 26682 const offsetWidth = hasOffset ? element.offsetWidth : width; 26683 const offsetHeight = hasOffset ? element.offsetHeight : height; 26684 const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight; 26685 if (shouldFallback) { 26686 width = offsetWidth; 26687 height = offsetHeight; 26688 } 26689 return { 26690 width, 26691 height, 26692 $: shouldFallback 26693 }; 26694} 26695 26696function unwrapElement(element) { 26697 return !isElement(element) ? element.contextElement : element; 26698} 26699 26700function getScale(element) { 26701 const domElement = unwrapElement(element); 26702 if (!isHTMLElement$1(domElement)) { 26703 return createCoords(1); 26704 } 26705 const rect = domElement.getBoundingClientRect(); 26706 const { 26707 width, 26708 height, 26709 $ 26710 } = getCssDimensions(domElement); 26711 let x = ($ ? round(rect.width) : rect.width) / width; 26712 let y = ($ ? round(rect.height) : rect.height) / height; 26713 26714 // 0, NaN, or Infinity should always fallback to 1. 26715 26716 if (!x || !Number.isFinite(x)) { 26717 x = 1; 26718 } 26719 if (!y || !Number.isFinite(y)) { 26720 y = 1; 26721 } 26722 return { 26723 x, 26724 y 26725 }; 26726} 26727 26728const noOffsets = /*#__PURE__*/createCoords(0); 26729function getVisualOffsets(element) { 26730 const win = getWindow$1(element); 26731 if (!isWebKit() || !win.visualViewport) { 26732 return noOffsets; 26733 } 26734 return { 26735 x: win.visualViewport.offsetLeft, 26736 y: win.visualViewport.offsetTop 26737 }; 26738} 26739function shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) { 26740 if (isFixed === void 0) { 26741 isFixed = false; 26742 } 26743 if (!floatingOffsetParent || isFixed && floatingOffsetParent !== getWindow$1(element)) { 26744 return false; 26745 } 26746 return isFixed; 26747} 26748 26749function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) { 26750 if (includeScale === void 0) { 26751 includeScale = false; 26752 } 26753 if (isFixedStrategy === void 0) { 26754 isFixedStrategy = false; 26755 } 26756 const clientRect = element.getBoundingClientRect(); 26757 const domElement = unwrapElement(element); 26758 let scale = createCoords(1); 26759 if (includeScale) { 26760 if (offsetParent) { 26761 if (isElement(offsetParent)) { 26762 scale = getScale(offsetParent); 26763 } 26764 } else { 26765 scale = getScale(element); 26766 } 26767 } 26768 const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : createCoords(0); 26769 let x = (clientRect.left + visualOffsets.x) / scale.x; 26770 let y = (clientRect.top + visualOffsets.y) / scale.y; 26771 let width = clientRect.width / scale.x; 26772 let height = clientRect.height / scale.y; 26773 if (domElement) { 26774 const win = getWindow$1(domElement); 26775 const offsetWin = offsetParent && isElement(offsetParent) ? getWindow$1(offsetParent) : offsetParent;
vendor: 13,075 bytes, lines 26776-27124
26776 let currentWin = win; 26777 let currentIFrame = getFrameElement(currentWin); 26778 while (currentIFrame && offsetParent && offsetWin !== currentWin) { 26779 const iframeScale = getScale(currentIFrame); 26780 const iframeRect = currentIFrame.getBoundingClientRect(); 26781 const css = getComputedStyle$1(currentIFrame); 26782 const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x; 26783 const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y; 26784 x *= iframeScale.x; 26785 y *= iframeScale.y; 26786 width *= iframeScale.x; 26787 height *= iframeScale.y; 26788 x += left; 26789 y += top; 26790 currentWin = getWindow$1(currentIFrame); 26791 currentIFrame = getFrameElement(currentWin); 26792 } 26793 } 26794 return rectToClientRect({ 26795 width, 26796 height, 26797 x, 26798 y 26799 }); 26800} 26801 26802// If <html> has a CSS width greater than the viewport, then this will be 26803// incorrect for RTL. 26804function getWindowScrollBarX(element, rect) { 26805 const leftScroll = getNodeScroll(element).scrollLeft; 26806 if (!rect) { 26807 return getBoundingClientRect(getDocumentElement(element)).left + leftScroll; 26808 } 26809 return rect.left + leftScroll; 26810} 26811 26812function getHTMLOffset(documentElement, scroll) { 26813 const htmlRect = documentElement.getBoundingClientRect(); 26814 const x = htmlRect.left + scroll.scrollLeft - getWindowScrollBarX(documentElement, htmlRect); 26815 const y = htmlRect.top + scroll.scrollTop; 26816 return { 26817 x, 26818 y 26819 }; 26820} 26821 26822function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) { 26823 let { 26824 elements, 26825 rect, 26826 offsetParent, 26827 strategy 26828 } = _ref; 26829 const isFixed = strategy === 'fixed'; 26830 const documentElement = getDocumentElement(offsetParent); 26831 const topLayer = elements ? isTopLayer(elements.floating) : false; 26832 if (offsetParent === documentElement || topLayer && isFixed) { 26833 return rect; 26834 } 26835 let scroll = { 26836 scrollLeft: 0, 26837 scrollTop: 0 26838 }; 26839 let scale = createCoords(1); 26840 const offsets = createCoords(0); 26841 const isOffsetParentAnElement = isHTMLElement$1(offsetParent); 26842 if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) { 26843 if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) { 26844 scroll = getNodeScroll(offsetParent); 26845 } 26846 if (isHTMLElement$1(offsetParent)) { 26847 const offsetRect = getBoundingClientRect(offsetParent); 26848 scale = getScale(offsetParent); 26849 offsets.x = offsetRect.x + offsetParent.clientLeft; 26850 offsets.y = offsetRect.y + offsetParent.clientTop; 26851 } 26852 } 26853 const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0); 26854 return { 26855 width: rect.width * scale.x, 26856 height: rect.height * scale.y, 26857 x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x + htmlOffset.x, 26858 y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y + htmlOffset.y 26859 }; 26860} 26861 26862function getClientRects(element) { 26863 return Array.from(element.getClientRects()); 26864} 26865 26866// Gets the entire size of the scrollable document area, even extending outside 26867// of the `<html>` and `<body>` rect bounds if horizontally scrollable. 26868function getDocumentRect(element) { 26869 const html = getDocumentElement(element); 26870 const scroll = getNodeScroll(element); 26871 const body = element.ownerDocument.body; 26872 const width = max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth); 26873 const height = max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight); 26874 let x = -scroll.scrollLeft + getWindowScrollBarX(element); 26875 const y = -scroll.scrollTop; 26876 if (getComputedStyle$1(body).direction === 'rtl') { 26877 x += max(html.clientWidth, body.clientWidth) - width; 26878 } 26879 return { 26880 width, 26881 height, 26882 x, 26883 y 26884 }; 26885} 26886 26887// Safety check: ensure the scrollbar space is reasonable in case this 26888// calculation is affected by unusual styles. 26889// Most scrollbars leave 15-18px of space. 26890const SCROLLBAR_MAX = 25; 26891function getViewportRect(element, strategy) { 26892 const win = getWindow$1(element); 26893 const html = getDocumentElement(element); 26894 const visualViewport = win.visualViewport; 26895 let width = html.clientWidth; 26896 let height = html.clientHeight; 26897 let x = 0; 26898 let y = 0; 26899 if (visualViewport) { 26900 width = visualViewport.width; 26901 height = visualViewport.height; 26902 const visualViewportBased = isWebKit(); 26903 if (!visualViewportBased || visualViewportBased && strategy === 'fixed') { 26904 x = visualViewport.offsetLeft; 26905 y = visualViewport.offsetTop; 26906 } 26907 } 26908 const windowScrollbarX = getWindowScrollBarX(html); 26909 // <html> `overflow: hidden` + `scrollbar-gutter: stable` reduces the 26910 // visual width of the <html> but this is not considered in the size 26911 // of `html.clientWidth`. 26912 if (windowScrollbarX <= 0) { 26913 const doc = html.ownerDocument; 26914 const body = doc.body; 26915 const bodyStyles = getComputedStyle(body); 26916 const bodyMarginInline = doc.compatMode === 'CSS1Compat' ? parseFloat(bodyStyles.marginLeft) + parseFloat(bodyStyles.marginRight) || 0 : 0; 26917 const clippingStableScrollbarWidth = Math.abs(html.clientWidth - body.clientWidth - bodyMarginInline); 26918 if (clippingStableScrollbarWidth <= SCROLLBAR_MAX) { 26919 width -= clippingStableScrollbarWidth; 26920 } 26921 } else if (windowScrollbarX <= SCROLLBAR_MAX) { 26922 // If the <body> scrollbar is on the left, the width needs to be extended 26923 // by the scrollbar amount so there isn't extra space on the right. 26924 width += windowScrollbarX; 26925 } 26926 return { 26927 width, 26928 height, 26929 x, 26930 y 26931 }; 26932} 26933 26934const absoluteOrFixed = /*#__PURE__*/new Set(['absolute', 'fixed']); 26935// Returns the inner client rect, subtracting scrollbars if present. 26936function getInnerBoundingClientRect(element, strategy) { 26937 const clientRect = getBoundingClientRect(element, true, strategy === 'fixed'); 26938 const top = clientRect.top + element.clientTop; 26939 const left = clientRect.left + element.clientLeft; 26940 const scale = isHTMLElement$1(element) ? getScale(element) : createCoords(1); 26941 const width = element.clientWidth * scale.x; 26942 const height = element.clientHeight * scale.y; 26943 const x = left * scale.x; 26944 const y = top * scale.y; 26945 return { 26946 width, 26947 height, 26948 x, 26949 y 26950 }; 26951} 26952function getClientRectFromClippingAncestor(element, clippingAncestor, strategy) { 26953 let rect; 26954 if (clippingAncestor === 'viewport') { 26955 rect = getViewportRect(element, strategy); 26956 } else if (clippingAncestor === 'document') { 26957 rect = getDocumentRect(getDocumentElement(element)); 26958 } else if (isElement(clippingAncestor)) { 26959 rect = getInnerBoundingClientRect(clippingAncestor, strategy); 26960 } else { 26961 const visualOffsets = getVisualOffsets(element); 26962 rect = { 26963 x: clippingAncestor.x - visualOffsets.x, 26964 y: clippingAncestor.y - visualOffsets.y, 26965 width: clippingAncestor.width, 26966 height: clippingAncestor.height 26967 }; 26968 } 26969 return rectToClientRect(rect); 26970} 26971function hasFixedPositionAncestor(element, stopNode) { 26972 const parentNode = getParentNode(element); 26973 if (parentNode === stopNode || !isElement(parentNode) || isLastTraversableNode(parentNode)) { 26974 return false; 26975 } 26976 return getComputedStyle$1(parentNode).position === 'fixed' || hasFixedPositionAncestor(parentNode, stopNode); 26977} 26978 26979// A "clipping ancestor" is an `overflow` element with the characteristic of 26980// clipping (or hiding) child elements. This returns all clipping ancestors 26981// of the given element up the tree. 26982function getClippingElementAncestors(element, cache) { 26983 const cachedResult = cache.get(element); 26984 if (cachedResult) { 26985 return cachedResult; 26986 } 26987 let result = getOverflowAncestors(element, [], false).filter(el => isElement(el) && getNodeName(el) !== 'body'); 26988 let currentContainingBlockComputedStyle = null; 26989 const elementIsFixed = getComputedStyle$1(element).position === 'fixed'; 26990 let currentNode = elementIsFixed ? getParentNode(element) : element; 26991 26992 // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block 26993 while (isElement(currentNode) && !isLastTraversableNode(currentNode)) { 26994 const computedStyle = getComputedStyle$1(currentNode); 26995 const currentNodeIsContaining = isContainingBlock(currentNode); 26996 if (!currentNodeIsContaining && computedStyle.position === 'fixed') { 26997 currentContainingBlockComputedStyle = null; 26998 } 26999 const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === 'static' && !!currentContainingBlockComputedStyle && absoluteOrFixed.has(currentContainingBlockComputedStyle.position) || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode); 27000 if (shouldDropCurrentNode) { 27001 // Drop non-containing blocks. 27002 result = result.filter(ancestor => ancestor !== currentNode); 27003 } else { 27004 // Record last containing block for next iteration. 27005 currentContainingBlockComputedStyle = computedStyle; 27006 } 27007 currentNode = getParentNode(currentNode); 27008 } 27009 cache.set(element, result); 27010 return result; 27011} 27012 27013// Gets the maximum area that the element is visible in due to any number of 27014// clipping ancestors. 27015function getClippingRect(_ref) { 27016 let { 27017 element, 27018 boundary, 27019 rootBoundary, 27020 strategy 27021 } = _ref; 27022 const elementClippingAncestors = boundary === 'clippingAncestors' ? isTopLayer(element) ? [] : getClippingElementAncestors(element, this._c) : [].concat(boundary); 27023 const clippingAncestors = [...elementClippingAncestors, rootBoundary]; 27024 const firstClippingAncestor = clippingAncestors[0]; 27025 const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor) => { 27026 const rect = getClientRectFromClippingAncestor(element, clippingAncestor, strategy); 27027 accRect.top = max(rect.top, accRect.top); 27028 accRect.right = min(rect.right, accRect.right); 27029 accRect.bottom = min(rect.bottom, accRect.bottom); 27030 accRect.left = max(rect.left, accRect.left); 27031 return accRect; 27032 }, getClientRectFromClippingAncestor(element, firstClippingAncestor, strategy)); 27033 return { 27034 width: clippingRect.right - clippingRect.left, 27035 height: clippingRect.bottom - clippingRect.top, 27036 x: clippingRect.left, 27037 y: clippingRect.top 27038 }; 27039} 27040 27041function getDimensions(element) { 27042 const { 27043 width, 27044 height 27045 } = getCssDimensions(element); 27046 return { 27047 width, 27048 height 27049 }; 27050} 27051 27052function getRectRelativeToOffsetParent(element, offsetParent, strategy) { 27053 const isOffsetParentAnElement = isHTMLElement$1(offsetParent); 27054 const documentElement = getDocumentElement(offsetParent); 27055 const isFixed = strategy === 'fixed'; 27056 const rect = getBoundingClientRect(element, true, isFixed, offsetParent); 27057 let scroll = { 27058 scrollLeft: 0, 27059 scrollTop: 0 27060 }; 27061 const offsets = createCoords(0); 27062 27063 // If the <body> scrollbar appears on the left (e.g. RTL systems). Use 27064 // Firefox with layout.scrollbar.side = 3 in about:config to test this. 27065 function setLeftRTLScrollbarOffset() { 27066 offsets.x = getWindowScrollBarX(documentElement); 27067 } 27068 if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) { 27069 if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) { 27070 scroll = getNodeScroll(offsetParent); 27071 } 27072 if (isOffsetParentAnElement) { 27073 const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent); 27074 offsets.x = offsetRect.x + offsetParent.clientLeft; 27075 offsets.y = offsetRect.y + offsetParent.clientTop; 27076 } else if (documentElement) { 27077 setLeftRTLScrollbarOffset(); 27078 } 27079 } 27080 if (isFixed && !isOffsetParentAnElement && documentElement) { 27081 setLeftRTLScrollbarOffset(); 27082 } 27083 const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0); 27084 const x = rect.left + scroll.scrollLeft - offsets.x - htmlOffset.x; 27085 const y = rect.top + scroll.scrollTop - offsets.y - htmlOffset.y; 27086 return { 27087 x, 27088 y, 27089 width: rect.width, 27090 height: rect.height 27091 }; 27092} 27093 27094function isStaticPositioned(element) { 27095 return getComputedStyle$1(element).position === 'static'; 27096} 27097 27098function getTrueOffsetParent(element, polyfill) { 27099 if (!isHTMLElement$1(element) || getComputedStyle$1(element).position === 'fixed') { 27100 return null; 27101 } 27102 if (polyfill) { 27103 return polyfill(element); 27104 } 27105 let rawOffsetParent = element.offsetParent; 27106 27107 // Firefox returns the <html> element as the offsetParent if it's non-static, 27108 // while Chrome and Safari return the <body> element. The <body> element must 27109 // be used to perform the correct calculations even if the <html> element is 27110 // non-static. 27111 if (getDocumentElement(element) === rawOffsetParent) { 27112 rawOffsetParent = rawOffsetParent.ownerDocument.body; 27113 } 27114 return rawOffsetParent; 27115} 27116 27117// Gets the closest ancestor positioned element. Handles some edge cases, 27118// such as table ancestors and cross browser bugs. 27119function getOffsetParent(element, polyfill) { 27120 const win = getWindow$1(element); 27121 if (isTopLayer(element)) { 27122 return win; 27123 } 27124 if (!isHTMLElement$1
vendor: 7,652 bytes, lines 27124-27357
27124(element)) { 27125 let svgOffsetParent = getParentNode(element); 27126 while (svgOffsetParent && !isLastTraversableNode(svgOffsetParent)) { 27127 if (isElement(svgOffsetParent) && !isStaticPositioned(svgOffsetParent)) { 27128 return svgOffsetParent; 27129 } 27130 svgOffsetParent = getParentNode(svgOffsetParent); 27131 } 27132 return win; 27133 } 27134 let offsetParent = getTrueOffsetParent(element, polyfill); 27135 while (offsetParent && isTableElement(offsetParent) && isStaticPositioned(offsetParent)) { 27136 offsetParent = getTrueOffsetParent(offsetParent, polyfill); 27137 } 27138 if (offsetParent && isLastTraversableNode(offsetParent) && isStaticPositioned(offsetParent) && !isContainingBlock(offsetParent)) { 27139 return win; 27140 } 27141 return offsetParent || getContainingBlock(element) || win; 27142} 27143 27144const getElementRects = async function (data) { 27145 const getOffsetParentFn = this.getOffsetParent || getOffsetParent; 27146 const getDimensionsFn = this.getDimensions; 27147 const floatingDimensions = await getDimensionsFn(data.floating); 27148 return { 27149 reference: getRectRelativeToOffsetParent(data.reference, await getOffsetParentFn(data.floating), data.strategy), 27150 floating: { 27151 x: 0, 27152 y: 0, 27153 width: floatingDimensions.width, 27154 height: floatingDimensions.height 27155 } 27156 }; 27157}; 27158 27159function isRTL(element) { 27160 return getComputedStyle$1(element).direction === 'rtl'; 27161} 27162 27163const platform = { 27164 convertOffsetParentRelativeRectToViewportRelativeRect, 27165 getDocumentElement, 27166 getClippingRect, 27167 getOffsetParent, 27168 getElementRects, 27169 getClientRects, 27170 getDimensions, 27171 getScale, 27172 isElement, 27173 isRTL 27174}; 27175 27176function rectsAreEqual(a, b) { 27177 return a.x === b.x && a.y === b.y && a.width === b.width && a.height === b.height; 27178} 27179 27180// https://samthor.au/2021/observing-dom/ 27181function observeMove(element, onMove) { 27182 let io = null; 27183 let timeoutId; 27184 const root = getDocumentElement(element); 27185 function cleanup() { 27186 var _io; 27187 clearTimeout(timeoutId); 27188 (_io = io) == null || _io.disconnect(); 27189 io = null; 27190 } 27191 function refresh(skip, threshold) { 27192 if (skip === void 0) { 27193 skip = false; 27194 } 27195 if (threshold === void 0) { 27196 threshold = 1; 27197 } 27198 cleanup(); 27199 const elementRectForRootMargin = element.getBoundingClientRect(); 27200 const { 27201 left, 27202 top, 27203 width, 27204 height 27205 } = elementRectForRootMargin; 27206 if (!skip) { 27207 onMove(); 27208 } 27209 if (!width || !height) { 27210 return; 27211 } 27212 const insetTop = floor(top); 27213 const insetRight = floor(root.clientWidth - (left + width)); 27214 const insetBottom = floor(root.clientHeight - (top + height)); 27215 const insetLeft = floor(left); 27216 const rootMargin = -insetTop + "px " + -insetRight + "px " + -insetBottom + "px " + -insetLeft + "px"; 27217 const options = { 27218 rootMargin, 27219 threshold: max(0, min(1, threshold)) || 1 27220 }; 27221 let isFirstUpdate = true; 27222 function handleObserve(entries) { 27223 const ratio = entries[0].intersectionRatio; 27224 if (ratio !== threshold) { 27225 if (!isFirstUpdate) { 27226 return refresh(); 27227 } 27228 if (!ratio) { 27229 // If the reference is clipped, the ratio is 0. Throttle the refresh 27230 // to prevent an infinite loop of updates. 27231 timeoutId = setTimeout(() => { 27232 refresh(false, 1e-7); 27233 }, 1000); 27234 } else { 27235 refresh(false, ratio); 27236 } 27237 } 27238 if (ratio === 1 && !rectsAreEqual(elementRectForRootMargin, element.getBoundingClientRect())) { 27239 // It's possible that even though the ratio is reported as 1, the 27240 // element is not actually fully within the IntersectionObserver's root 27241 // area anymore. This can happen under performance constraints. This may 27242 // be a bug in the browser's IntersectionObserver implementation. To 27243 // work around this, we compare the element's bounding rect now with 27244 // what it was at the time we created the IntersectionObserver. If they 27245 // are not equal then the element moved, so we refresh. 27246 refresh(); 27247 } 27248 isFirstUpdate = false; 27249 } 27250 27251 // Older browsers don't support a `document` as the root and will throw an 27252 // error. 27253 try { 27254 io = new IntersectionObserver(handleObserve, { 27255 ...options, 27256 // Handle <iframe>s 27257 root: root.ownerDocument 27258 }); 27259 } catch (_e) { 27260 io = new IntersectionObserver(handleObserve, options); 27261 } 27262 io.observe(element); 27263 } 27264 refresh(true); 27265 return cleanup; 27266} 27267 27268/** 27269 * Automatically updates the position of the floating element when necessary. 27270 * Should only be called when the floating element is mounted on the DOM or 27271 * visible on the screen. 27272 * @returns cleanup function that should be invoked when the floating element is 27273 * removed from the DOM or hidden from the screen. 27274 * @see https://floating-ui.com/docs/autoUpdate 27275 */ 27276function autoUpdate(reference, floating, update, options) { 27277 if (options === void 0) { 27278 options = {}; 27279 } 27280 const { 27281 ancestorScroll = true, 27282 ancestorResize = true, 27283 elementResize = typeof ResizeObserver === 'function', 27284 layoutShift = typeof IntersectionObserver === 'function', 27285 animationFrame = false 27286 } = options; 27287 const referenceEl = unwrapElement(reference); 27288 const ancestors = ancestorScroll || ancestorResize ? [...(referenceEl ? getOverflowAncestors(referenceEl) : []), ...getOverflowAncestors(floating)] : []; 27289 ancestors.forEach(ancestor => { 27290 ancestorScroll && ancestor.addEventListener('scroll', update, { 27291 passive: true 27292 }); 27293 ancestorResize && ancestor.addEventListener('resize', update); 27294 }); 27295 const cleanupIo = referenceEl && layoutShift ? observeMove(referenceEl, update) : null; 27296 let reobserveFrame = -1; 27297 let resizeObserver = null; 27298 if (elementResize) { 27299 resizeObserver = new ResizeObserver(_ref => { 27300 let [firstEntry] = _ref; 27301 if (firstEntry && firstEntry.target === referenceEl && resizeObserver) { 27302 // Prevent update loops when using the `size` middleware. 27303 // https://github.com/floating-ui/floating-ui/issues/1740 27304 resizeObserver.unobserve(floating); 27305 cancelAnimationFrame(reobserveFrame); 27306 reobserveFrame = requestAnimationFrame(() => { 27307 var _resizeObserver; 27308 (_resizeObserver = resizeObserver) == null || _resizeObserver.observe(floating); 27309 }); 27310 } 27311 update(); 27312 }); 27313 if (referenceEl && !animationFrame) { 27314 resizeObserver.observe(referenceEl); 27315 } 27316 resizeObserver.observe(floating); 27317 } 27318 let frameId; 27319 let prevRefRect = animationFrame ? getBoundingClientRect(reference) : null; 27320 if (animationFrame) { 27321 frameLoop(); 27322 } 27323 function frameLoop() { 27324 const nextRefRect = getBoundingClientRect(reference); 27325 if (prevRefRect && !rectsAreEqual(prevRefRect, nextRefRect)) { 27326 update(); 27327 } 27328 prevRefRect = nextRefRect; 27329 frameId = requestAnimationFrame(frameLoop); 27330 } 27331 update(); 27332 return () => { 27333 var _resizeObserver2; 27334 ancestors.forEach(ancestor => { 27335 ancestorScroll && ancestor.removeEventListener('scroll', update); 27336 ancestorResize && ancestor.removeEventListener('resize', update); 27337 }); 27338 cleanupIo == null || cleanupIo(); 27339 (_resizeObserver2 = resizeObserver) == null || _resizeObserver2.disconnect(); 27340 resizeObserver = null; 27341 if (animationFrame) { 27342 cancelAnimationFrame(frameId); 27343 } 27344 }; 27345} 27346 27347/** 27348 * Modifies the placement by translating the floating element along the 27349 * specified axes. 27350 * A number (shorthand for `mainAxis` or distance), or an axes configuration 27351 * object may be passed. 27352 * @see https://floating-ui.com/docs/offset 27353 */ 27354const offset$1 = offset$2; 27355 27356/** 27357 * Optimizes the visibility of the floating element by
vendor: 4,231 bytes, lines 27357-27523
27357shifting it in order to 27358 * keep it in view when it will overflow the clipping boundary. 27359 * @see https://floating-ui.com/docs/shift 27360 */ 27361const shift$1 = shift$2; 27362 27363/** 27364 * Optimizes the visibility of the floating element by flipping the `placement` 27365 * in order to keep it in view when the preferred placement(s) will overflow the 27366 * clipping boundary. Alternative to `autoPlacement`. 27367 * @see https://floating-ui.com/docs/flip 27368 */ 27369const flip$1 = flip$2; 27370 27371/** 27372 * Provides data that allows you to change the size of the floating element â 27373 * for instance, prevent it from overflowing the clipping boundary or match the 27374 * width of the reference element. 27375 * @see https://floating-ui.com/docs/size 27376 */ 27377const size$1 = size$2; 27378 27379/** 27380 * Provides data to hide the floating element in applicable situations, such as 27381 * when it is not in the same clipping context as the reference element. 27382 * @see https://floating-ui.com/docs/hide 27383 */ 27384const hide$1 = hide$2; 27385 27386/** 27387 * Provides data to position an inner element of the floating element so that it 27388 * appears centered to the reference element. 27389 * @see https://floating-ui.com/docs/arrow 27390 */ 27391const arrow$2 = arrow$3; 27392 27393/** 27394 * Built-in `limiter` that will stop `shift()` at a certain point. 27395 */ 27396const limitShift$1 = limitShift$2; 27397 27398/** 27399 * Computes the `x` and `y` coordinates that will place the floating element 27400 * next to a given reference element. 27401 */ 27402const computePosition = (reference, floating, options) => { 27403 // This caches the expensive `getClippingElementAncestors` function so that 27404 // multiple lifecycle resets re-use the same result. It only lives for a 27405 // single call. If other functions become expensive, we can add them as well. 27406 const cache = new Map(); 27407 const mergedOptions = { 27408 platform, 27409 ...options 27410 }; 27411 const platformWithCache = { 27412 ...mergedOptions.platform, 27413 _c: cache 27414 }; 27415 return computePosition$1(reference, floating, { 27416 ...mergedOptions, 27417 platform: platformWithCache 27418 }); 27419}; 27420 27421var isClient = typeof document !== 'undefined'; 27422 27423var noop$1 = function noop() {}; 27424var index = isClient ? reactExports.useLayoutEffect : noop$1; 27425 27426// Fork of `fast-deep-equal` that only does the comparisons we need and compares 27427// functions 27428function deepEqual(a, b) { 27429 if (a === b) { 27430 return true; 27431 } 27432 if (typeof a !== typeof b) { 27433 return false; 27434 } 27435 if (typeof a === 'function' && a.toString() === b.toString()) { 27436 return true; 27437 } 27438 let length; 27439 let i; 27440 let keys; 27441 if (a && b && typeof a === 'object') { 27442 if (Array.isArray(a)) { 27443 length = a.length; 27444 if (length !== b.length) return false; 27445 for (i = length; i-- !== 0;) { 27446 if (!deepEqual(a[i], b[i])) { 27447 return false; 27448 } 27449 } 27450 return true; 27451 } 27452 keys = Object.keys(a); 27453 length = keys.length; 27454 if (length !== Object.keys(b).length) { 27455 return false; 27456 } 27457 for (i = length; i-- !== 0;) { 27458 if (!{}.hasOwnProperty.call(b, keys[i])) { 27459 return false; 27460 } 27461 } 27462 for (i = length; i-- !== 0;) { 27463 const key = keys[i]; 27464 if (key === '_owner' && a.$$typeof) { 27465 continue; 27466 } 27467 if (!deepEqual(a[key], b[key])) { 27468 return false; 27469 } 27470 } 27471 return true; 27472 } 27473 return a !== a && b !== b; 27474} 27475 27476function getDPR(element) { 27477 if (typeof window === 'undefined') { 27478 return 1; 27479 } 27480 const win = element.ownerDocument.defaultView || window; 27481 return win.devicePixelRatio || 1; 27482} 27483 27484function roundByDPR(element, value) { 27485 const dpr = getDPR(element); 27486 return Math.round(value * dpr) / dpr; 27487} 27488 27489function useLatestRef(value) { 27490 const ref = reactExports.useRef(value); 27491 index(() => { 27492 ref.current = value; 27493 }); 27494 return ref; 27495} 27496 27497/** 27498 * Provides data to position a floating element. 27499 * @see https://floating-ui.com/docs/useFloating 27500 */ 27501function useFloating(options) { 27502 if (options === void 0) { 27503 options = {}; 27504 } 27505 const { 27506 placement = 'bottom', 27507 strategy = 'absolute', 27508 middleware = [], 27509 platform, 27510 elements: { 27511 reference: externalReference, 27512 floating: externalFloating 27513 } = {}, 27514 transform = true, 27515 whileElementsMounted, 27516 open 27517 } = options; 27518 const [data, setData] = reactExports.useState({ 27519 x: 0, 27520 y: 0, 27521 strategy, 27522 placement, 27523 middlewareData: {},
vendor: 5,722 bytes, lines 27524-27713
27524 isPositioned: false 27525 }); 27526 const [latestMiddleware, setLatestMiddleware] = reactExports.useState(middleware); 27527 if (!deepEqual(latestMiddleware, middleware)) { 27528 setLatestMiddleware(middleware); 27529 } 27530 const [_reference, _setReference] = reactExports.useState(null); 27531 const [_floating, _setFloating] = reactExports.useState(null); 27532 const setReference = reactExports.useCallback(node => { 27533 if (node !== referenceRef.current) { 27534 referenceRef.current = node; 27535 _setReference(node); 27536 } 27537 }, []); 27538 const setFloating = reactExports.useCallback(node => { 27539 if (node !== floatingRef.current) { 27540 floatingRef.current = node; 27541 _setFloating(node); 27542 } 27543 }, []); 27544 const referenceEl = externalReference || _reference; 27545 const floatingEl = externalFloating || _floating; 27546 const referenceRef = reactExports.useRef(null); 27547 const floatingRef = reactExports.useRef(null); 27548 const dataRef = reactExports.useRef(data); 27549 const hasWhileElementsMounted = whileElementsMounted != null; 27550 const whileElementsMountedRef = useLatestRef(whileElementsMounted); 27551 const platformRef = useLatestRef(platform); 27552 const openRef = useLatestRef(open); 27553 const update = reactExports.useCallback(() => { 27554 if (!referenceRef.current || !floatingRef.current) { 27555 return; 27556 } 27557 const config = { 27558 placement, 27559 strategy, 27560 middleware: latestMiddleware 27561 }; 27562 if (platformRef.current) { 27563 config.platform = platformRef.current; 27564 } 27565 computePosition(referenceRef.current, floatingRef.current, config).then(data => { 27566 const fullData = { 27567 ...data, 27568 // The floating element's position may be recomputed while it's closed 27569 // but still mounted (such as when transitioning out). To ensure 27570 // `isPositioned` will be `false` initially on the next open, avoid 27571 // setting it to `true` when `open === false` (must be specified). 27572 isPositioned: openRef.current !== false 27573 }; 27574 if (isMountedRef.current && !deepEqual(dataRef.current, fullData)) { 27575 dataRef.current = fullData; 27576 reactDomExports.flushSync(() => { 27577 setData(fullData); 27578 }); 27579 } 27580 }); 27581 }, [latestMiddleware, placement, strategy, platformRef, openRef]); 27582 index(() => { 27583 if (open === false && dataRef.current.isPositioned) { 27584 dataRef.current.isPositioned = false; 27585 setData(data => ({ 27586 ...data, 27587 isPositioned: false 27588 })); 27589 } 27590 }, [open]); 27591 const isMountedRef = reactExports.useRef(false); 27592 index(() => { 27593 isMountedRef.current = true; 27594 return () => { 27595 isMountedRef.current = false; 27596 }; 27597 }, []); 27598 index(() => { 27599 if (referenceEl) referenceRef.current = referenceEl; 27600 if (floatingEl) floatingRef.current = floatingEl; 27601 if (referenceEl && floatingEl) { 27602 if (whileElementsMountedRef.current) { 27603 return whileElementsMountedRef.current(referenceEl, floatingEl, update); 27604 } 27605 update(); 27606 } 27607 }, [referenceEl, floatingEl, update, whileElementsMountedRef, hasWhileElementsMounted]); 27608 const refs = reactExports.useMemo(() => ({ 27609 reference: referenceRef, 27610 floating: floatingRef, 27611 setReference, 27612 setFloating 27613 }), [setReference, setFloating]); 27614 const elements = reactExports.useMemo(() => ({ 27615 reference: referenceEl, 27616 floating: floatingEl 27617 }), [referenceEl, floatingEl]); 27618 const floatingStyles = reactExports.useMemo(() => { 27619 const initialStyles = { 27620 position: strategy, 27621 left: 0, 27622 top: 0 27623 }; 27624 if (!elements.floating) { 27625 return initialStyles; 27626 } 27627 const x = roundByDPR(elements.floating, data.x); 27628 const y = roundByDPR(elements.floating, data.y); 27629 if (transform) { 27630 return { 27631 ...initialStyles, 27632 transform: "translate(" + x + "px, " + y + "px)", 27633 ...(getDPR(elements.floating) >= 1.5 && { 27634 willChange: 'transform' 27635 }) 27636 }; 27637 } 27638 return { 27639 position: strategy, 27640 left: x, 27641 top: y 27642 }; 27643 }, [strategy, transform, elements.floating, data.x, data.y]); 27644 return reactExports.useMemo(() => ({ 27645 ...data, 27646 update, 27647 refs, 27648 elements, 27649 floatingStyles 27650 }), [data, update, refs, elements, floatingStyles]); 27651} 27652 27653/** 27654 * Provides data to position an inner element of the floating element so that it 27655 * appears centered to the reference element. 27656 * This wraps the core `arrow` middleware to allow React refs as the element. 27657 * @see https://floating-ui.com/docs/arrow 27658 */ 27659const arrow$1 = options => { 27660 function isRef(value) { 27661 return {}.hasOwnProperty.call(value, 'current'); 27662 } 27663 return { 27664 name: 'arrow', 27665 options, 27666 fn(state) { 27667 const { 27668 element, 27669 padding 27670 } = typeof options === 'function' ? options(state) : options; 27671 if (element && isRef(element)) { 27672 if (element.current != null) { 27673 return arrow$2({ 27674 element: element.current, 27675 padding 27676 }).fn(state); 27677 } 27678 return {}; 27679 } 27680 if (element) { 27681 return arrow$2({ 27682 element, 27683 padding 27684 }).fn(state); 27685 } 27686 return {}; 27687 } 27688 }; 27689}; 27690 27691/** 27692 * Modifies the placement by translating the floating element along the 27693 * specified axes. 27694 * A number (shorthand for `mainAxis` or distance), or an axes configuration 27695 * object may be passed. 27696 * @see https://floating-ui.com/docs/offset 27697 */ 27698const offset = (options, deps) => ({ 27699 ...offset$1(options), 27700 options: [options, deps] 27701}); 27702 27703/** 27704 * Optimizes the visibility of the floating element by shifting it in order to 27705 * keep it in view when it will overflow the clipping boundary. 27706 * @see https://floating-ui.com/docs/shift 27707 */ 27708const shift = (options, deps) => ({ 27709 ...shift$1(options), 27710 options: [options, deps] 27711}); 27712 27713/**
27714 * Built-in `limiter` that will stop `shift()` at a certain point. 27715 */ 27716const limitShift = (options, deps) => ({ 27717 ...limitShift$1(options), 27718 options: [options, deps] 27719}); 27720 27721/** 27722 * Optimizes the visibility of the floating element by flipping the `placement` 27723 * in order to keep it in view when the preferred placement(s) will overflow the 27724 * clipping boundary. Alternative to `autoPlacement`. 27725 * @see https://floating-ui.com/docs/flip 27726 */ 27727const flip = (options, deps) => ({ 27728 ...flip$1(options), 27729 options: [options, deps] 27730}); 27731 27732/** 27733 * Provides data that allows you to change the size of the floating element â 27734 * for instance, prevent it from overflowing the clipping boundary or match the 27735 * width of the reference element. 27736 * @see https://floating-ui.com/docs/size 27737 */ 27738const size = (options, deps) => ({ 27739 ...size$1(options), 27740 options: [options, deps] 27741}); 27742 27743/** 27744 * Provides data to hide the floating element in applicable situations, such as 27745 * when it is not in the same clipping context as the reference element. 27746 * @see https://floating-ui.com/docs/hide 27747 */ 27748const hide = (options, deps) => ({ 27749 ...hide$1(options), 27750 options: [options, deps] 27751}); 27752 27753/** 27754 * Provides data to position an inner element of the floating element so that it 27755 * appears centered to the reference element. 27756 * This wraps the core `arrow` middleware to allow React refs as the element. 27757 * @see https://floating-ui.com/docs/arrow 27758 */ 27759const arrow = (options, deps) => ({ 27760 ...arrow$1(options), 27761 options: [options, deps] 27762}); 27763
vendor: 19,887 bytes, lines 27764-28290
27764// src/arrow.tsx 27765var NAME$2 = "Arrow"; 27766var Arrow$1 = reactExports.forwardRef((props, forwardedRef) => { 27767 const { children, width = 10, height = 5, ...arrowProps } = props; 27768 return /* @__PURE__ */ jsxRuntimeExports.jsx( 27769 Primitive.svg, 27770 { 27771 ...arrowProps, 27772 ref: forwardedRef, 27773 width, 27774 height, 27775 viewBox: "0 0 30 10", 27776 preserveAspectRatio: "none", 27777 children: props.asChild ? children : /* @__PURE__ */ jsxRuntimeExports.jsx("polygon", { points: "0,0 30,0 15,10" }) 27778 } 27779 ); 27780}); 27781Arrow$1.displayName = NAME$2; 27782var Root$4 = Arrow$1; 27783 27784// packages/react/use-size/src/use-size.tsx 27785function useSize(element) { 27786 const [size, setSize] = reactExports.useState(void 0); 27787 useLayoutEffect2(() => { 27788 if (element) { 27789 setSize({ width: element.offsetWidth, height: element.offsetHeight }); 27790 const resizeObserver = new ResizeObserver((entries) => { 27791 if (!Array.isArray(entries)) { 27792 return; 27793 } 27794 if (!entries.length) { 27795 return; 27796 } 27797 const entry = entries[0]; 27798 let width; 27799 let height; 27800 if ("borderBoxSize" in entry) { 27801 const borderSizeEntry = entry["borderBoxSize"]; 27802 const borderSize = Array.isArray(borderSizeEntry) ? borderSizeEntry[0] : borderSizeEntry; 27803 width = borderSize["inlineSize"]; 27804 height = borderSize["blockSize"]; 27805 } else { 27806 width = element.offsetWidth; 27807 height = element.offsetHeight; 27808 } 27809 setSize({ width, height }); 27810 }); 27811 resizeObserver.observe(element, { box: "border-box" }); 27812 return () => resizeObserver.unobserve(element); 27813 } else { 27814 setSize(void 0); 27815 } 27816 }, [element]); 27817 return size; 27818} 27819 27820var POPPER_NAME = "Popper"; 27821var [createPopperContext, createPopperScope] = createContextScope(POPPER_NAME); 27822var [PopperProvider, usePopperContext] = createPopperContext(POPPER_NAME); 27823var Popper = (props) => { 27824 const { __scopePopper, children } = props; 27825 const [anchor, setAnchor] = reactExports.useState(null); 27826 return /* @__PURE__ */ jsxRuntimeExports.jsx(PopperProvider, { scope: __scopePopper, anchor, onAnchorChange: setAnchor, children }); 27827}; 27828Popper.displayName = POPPER_NAME; 27829var ANCHOR_NAME$1 = "PopperAnchor"; 27830var PopperAnchor = reactExports.forwardRef( 27831 (props, forwardedRef) => { 27832 const { __scopePopper, virtualRef, ...anchorProps } = props; 27833 const context = usePopperContext(ANCHOR_NAME$1, __scopePopper); 27834 const ref = reactExports.useRef(null); 27835 const composedRefs = useComposedRefs(forwardedRef, ref); 27836 const anchorRef = reactExports.useRef(null); 27837 reactExports.useEffect(() => { 27838 const previousAnchor = anchorRef.current; 27839 anchorRef.current = virtualRef?.current || ref.current; 27840 if (previousAnchor !== anchorRef.current) { 27841 context.onAnchorChange(anchorRef.current); 27842 } 27843 }); 27844 return virtualRef ? null : /* @__PURE__ */ jsxRuntimeExports.jsx(Primitive.div, { ...anchorProps, ref: composedRefs }); 27845 } 27846); 27847PopperAnchor.displayName = ANCHOR_NAME$1; 27848var CONTENT_NAME$2 = "PopperContent"; 27849var [PopperContentProvider, useContentContext] = createPopperContext(CONTENT_NAME$2); 27850var PopperContent = reactExports.forwardRef( 27851 (props, forwardedRef) => { 27852 const { 27853 __scopePopper, 27854 side = "bottom", 27855 sideOffset = 0, 27856 align = "center", 27857 alignOffset = 0, 27858 arrowPadding = 0, 27859 avoidCollisions = true, 27860 collisionBoundary = [], 27861 collisionPadding: collisionPaddingProp = 0, 27862 sticky = "partial", 27863 hideWhenDetached = false, 27864 updatePositionStrategy = "optimized", 27865 onPlaced, 27866 ...contentProps 27867 } = props; 27868 const context = usePopperContext(CONTENT_NAME$2, __scopePopper); 27869 const [content, setContent] = reactExports.useState(null); 27870 const composedRefs = useComposedRefs(forwardedRef, (node) => setContent(node)); 27871 const [arrow$1, setArrow] = reactExports.useState(null); 27872 const arrowSize = useSize(arrow$1); 27873 const arrowWidth = arrowSize?.width ?? 0; 27874 const arrowHeight = arrowSize?.height ?? 0; 27875 const desiredPlacement = side + (align !== "center" ? "-" + align : ""); 27876 const collisionPadding = typeof collisionPaddingProp === "number" ? collisionPaddingProp : { top: 0, right: 0, bottom: 0, left: 0, ...collisionPaddingProp }; 27877 const boundary = Array.isArray(collisionBoundary) ? collisionBoundary : [collisionBoundary]; 27878 const hasExplicitBoundaries = boundary.length > 0; 27879 const detectOverflowOptions = { 27880 padding: collisionPadding, 27881 boundary: boundary.filter(isNotNull), 27882 // with `strategy: 'fixed'`, this is the only way to get it to respect boundaries 27883 altBoundary: hasExplicitBoundaries 27884 }; 27885 const { refs, floatingStyles, placement, isPositioned, middlewareData } = useFloating({ 27886 // default to `fixed` strategy so users don't have to pick and we also avoid focus scroll issues 27887 strategy: "fixed", 27888 placement: desiredPlacement, 27889 whileElementsMounted: (...args) => { 27890 const cleanup = autoUpdate(...args, { 27891 animationFrame: updatePositionStrategy === "always" 27892 }); 27893 return cleanup; 27894 }, 27895 elements: { 27896 reference: context.anchor 27897 }, 27898 middleware: [ 27899 offset({ mainAxis: sideOffset + arrowHeight, alignmentAxis: alignOffset }), 27900 avoidCollisions && shift({ 27901 mainAxis: true, 27902 crossAxis: false, 27903 limiter: sticky === "partial" ? limitShift() : void 0, 27904 ...detectOverflowOptions 27905 }), 27906 avoidCollisions && flip({ ...detectOverflowOptions }), 27907 size({ 27908 ...detectOverflowOptions, 27909 apply: ({ elements, rects, availableWidth, availableHeight }) => { 27910 const { width: anchorWidth, height: anchorHeight } = rects.reference; 27911 const contentStyle = elements.floating.style; 27912 contentStyle.setProperty("--radix-popper-available-width", `${availableWidth}px`); 27913 contentStyle.setProperty("--radix-popper-available-height", `${availableHeight}px`); 27914 contentStyle.setProperty("--radix-popper-anchor-width", `${anchorWidth}px`); 27915 contentStyle.setProperty("--radix-popper-anchor-height", `${anchorHeight}px`); 27916 } 27917 }), 27918 arrow$1 && arrow({ element: arrow$1, padding: arrowPadding }), 27919 transformOrigin({ arrowWidth, arrowHeight }), 27920 hideWhenDetached && hide({ strategy: "referenceHidden", ...detectOverflowOptions }) 27921 ] 27922 }); 27923 const [placedSide, placedAlign] = getSideAndAlignFromPlacement(placement); 27924 const handlePlaced = useCallbackRef$1(onPlaced); 27925 useLayoutEffect2(() => { 27926 if (isPositioned) { 27927 handlePlaced?.(); 27928 } 27929 }, [isPositioned, handlePlaced]); 27930 const arrowX = middlewareData.arrow?.x; 27931 const arrowY = middlewareData.arrow?.y; 27932 const cannotCenterArrow = middlewareData.arrow?.centerOffset !== 0; 27933 const [contentZIndex, setContentZIndex] = reactExports.useState(); 27934 useLayoutEffect2(() => { 27935 if (content) setContentZIndex(window.getComputedStyle(content).zIndex); 27936 }, [content]); 27937 return /* @__PURE__ */ jsxRuntimeExports.jsx( 27938 "div", 27939 { 27940 ref: refs.setFloating, 27941 "data-radix-popper-content-wrapper": "", 27942 style: { 27943 ...floatingStyles, 27944 transform: isPositioned ? floatingStyles.transform : "translate(0, -200%)", 27945 // keep off the page when measuring 27946 minWidth: "max-content", 27947 zIndex: contentZIndex, 27948 ["--radix-popper-transform-origin"]: [ 27949 middlewareData.transformOrigin?.x, 27950 middlewareData.transformOrigin?.y 27951 ].join(" "), 27952 // hide the content if using the hide middleware and should be hidden 27953 // set visibility to hidden and disable pointer events so the UI behaves 27954 // as if the PopperContent isn't there at all 27955 ...middlewareData.hide?.referenceHidden && { 27956 visibility: "hidden", 27957 pointerEvents: "none" 27958 } 27959 }, 27960 dir: props.dir, 27961 children: /* @__PURE__ */ jsxRuntimeExports.jsx( 27962 PopperContentProvider, 27963 { 27964 scope: __scopePopper, 27965 placedSide, 27966 onArrowChange: setArrow, 27967 arrowX, 27968 arrowY, 27969 shouldHideArrow: cannotCenterArrow, 27970 children: /* @__PURE__ */ jsxRuntimeExports.jsx( 27971 Primitive.div, 27972 { 27973 "data-side": placedSide, 27974 "data-align": placedAlign, 27975 ...contentProps, 27976 ref: composedRefs, 27977 style: { 27978 ...contentProps.style, 27979 // if the PopperContent hasn't been placed yet (not all measurements done) 27980 // we prevent animations so that users's animation don't kick in too early referring wrong sides 27981 animation: !isPositioned ? "none" : void 0 27982 } 27983 } 27984 ) 27985 } 27986 ) 27987 } 27988 ); 27989 } 27990); 27991PopperContent.displayName = CONTENT_NAME$2; 27992var ARROW_NAME$2 = "PopperArrow"; 27993var OPPOSITE_SIDE = { 27994 top: "bottom", 27995 right: "left", 27996 bottom: "top", 27997 left: "right" 27998}; 27999var PopperArrow = reactExports.forwardRef(function PopperArrow2(props, forwardedRef) { 28000 const { __scopePopper, ...arrowProps } = props; 28001 const contentContext = useContentContext(ARROW_NAME$2, __scopePopper); 28002 const baseSide = OPPOSITE_SIDE[contentContext.placedSide]; 28003 return ( 28004 // we have to use an extra wrapper because `ResizeObserver` (used by `useSize`) 28005 // doesn't report size as we'd expect on SVG elements. 28006 // it reports their bounding box which is effectively the largest path inside the SVG. 28007 /* @__PURE__ */ jsxRuntimeExports.jsx( 28008 "span", 28009 { 28010 ref: contentContext.onArrowChange, 28011 style: { 28012 position: "absolute", 28013 left: contentContext.arrowX, 28014 top: contentContext.arrowY, 28015 [baseSide]: 0, 28016 transformOrigin: { 28017 top: "", 28018 right: "0 0", 28019 bottom: "center 0", 28020 left: "100% 0" 28021 }[contentContext.placedSide], 28022 transform: { 28023 top: "translateY(100%)", 28024 right: "translateY(50%) rotate(90deg) translateX(-50%)", 28025 bottom: `rotate(180deg)`, 28026 left: "translateY(50%) rotate(-90deg) translateX(50%)" 28027 }[contentContext.placedSide], 28028 visibility: contentContext.shouldHideArrow ? "hidden" : void 0 28029 }, 28030 children: /* @__PURE__ */ jsxRuntimeExports.jsx( 28031 Root$4, 28032 { 28033 ...arrowProps, 28034 ref: forwardedRef, 28035 style: { 28036 ...arrowProps.style, 28037 // ensures the element can be measured correctly (mostly for if SVG) 28038 display: "block" 28039 } 28040 } 28041 ) 28042 } 28043 ) 28044 ); 28045}); 28046PopperArrow.displayName = ARROW_NAME$2; 28047function isNotNull(value) { 28048 return value !== null; 28049} 28050var transformOrigin = (options) => ({ 28051 name: "transformOrigin", 28052 options, 28053 fn(data) { 28054 const { placement, rects, middlewareData } = data; 28055 const cannotCenterArrow = middlewareData.arrow?.centerOffset !== 0; 28056 const isArrowHidden = cannotCenterArrow; 28057 const arrowWidth = isArrowHidden ? 0 : options.arrowWidth; 28058 const arrowHeight = isArrowHidden ? 0 : options.arrowHeight; 28059 const [placedSide, placedAlign] = getSideAndAlignFromPlacement(placement); 28060 const noArrowAlign = { start: "0%", center: "50%", end: "100%" }[placedAlign]; 28061 const arrowXCenter = (middlewareData.arrow?.x ?? 0) + arrowWidth / 2; 28062 const arrowYCenter = (middlewareData.arrow?.y ?? 0) + arrowHeight / 2; 28063 let x = ""; 28064 let y = ""; 28065 if (placedSide === "bottom") { 28066 x = isArrowHidden ? noArrowAlign : `${arrowXCenter}px`; 28067 y = `${-arrowHeight}px`; 28068 } else if (placedSide === "top") { 28069 x = isArrowHidden ? noArrowAlign : `${arrowXCenter}px`; 28070 y = `${rects.floating.height + arrowHeight}px`; 28071 } else if (placedSide === "right") { 28072 x = `${-arrowHeight}px`; 28073 y = isArrowHidden ? noArrowAlign : `${arrowYCenter}px`; 28074 } else if (placedSide === "left") { 28075 x = `${rects.floating.width + arrowHeight}px`; 28076 y = isArrowHidden ? noArrowAlign : `${arrowYCenter}px`; 28077 } 28078 return { data: { x, y } }; 28079 } 28080}); 28081function getSideAndAlignFromPlacement(placement) { 28082 const [side, align = "center"] = placement.split("-"); 28083 return [side, align]; 28084} 28085var Root2$1 = Popper; 28086var Anchor = PopperAnchor; 28087var Content = PopperContent; 28088var Arrow = PopperArrow; 28089 28090var PORTAL_NAME$2 = "Portal"; 28091var Portal$1 = reactExports.forwardRef((props, forwardedRef) => { 28092 const { container: containerProp, ...portalProps } = props; 28093 const [mounted, setMounted] = reactExports.useState(false); 28094 useLayoutEffect2(() => setMounted(true), []); 28095 const container = containerProp || mounted && globalThis?.document?.body; 28096 return container ? ReactDOM.createPortal(/* @__PURE__ */ jsxRuntimeExports.jsx(Primitive.div, { ...portalProps, ref: forwardedRef }), container) : null; 28097}); 28098Portal$1.displayName = PORTAL_NAME$2; 28099 28100function useStateMachine$1(initialState, machine) { 28101 return reactExports.useReducer((state, event) => { 28102 const nextState = machine[state][event]; 28103 return nextState ?? state; 28104 }, initialState); 28105} 28106 28107// src/presence.tsx 28108var Presence = (props) => { 28109 const { present, children } = props; 28110 const presence = usePresence(present); 28111 const child = typeof children === "function" ? children({ present: presence.isPresent }) : reactExports.Children.only(children); 28112 const ref = useComposedRefs(presence.ref, getElementRef(child)); 28113 const forceMount = typeof children === "function"; 28114 return forceMount || presence.isPresent ? reactExports.cloneElement(child, { ref }) : null; 28115}; 28116Presence.displayName = "Presence"; 28117function usePresence(present) { 28118 const [node, setNode] = reactExports.useState(); 28119 const stylesRef = reactExports.useRef(null); 28120 const prevPresentRef = reactExports.useRef(present); 28121 const prevAnimationNameRef = reactExports.useRef("none"); 28122 const initialState = present ? "mounted" : "unmounted"; 28123 const [state, send] = useStateMachine$1(initialState, { 28124 mounted: { 28125 UNMOUNT: "unmounted", 28126 ANIMATION_OUT: "unmountSuspended" 28127 }, 28128 unmountSuspended: { 28129 MOUNT: "mounted", 28130 ANIMATION_END: "unmounted" 28131 }, 28132 unmounted: { 28133 MOUNT: "mounted" 28134 } 28135 }); 28136 reactExports.useEffect(() => { 28137 const currentAnimationName = getAnimationName(stylesRef.current); 28138 prevAnimationNameRef.current = state === "mounted" ? currentAnimationName : "none"; 28139 }, [state]); 28140 useLayoutEffect2(() => { 28141 const styles = stylesRef.current; 28142 const wasPresent = prevPresentRef.current; 28143 const hasPresentChanged = wasPresent !== present; 28144 if (hasPresentChanged) { 28145 const prevAnimationName = prevAnimationNameRef.current; 28146 const currentAnimationName = getAnimationName(styles); 28147 if (present) { 28148 send("MOUNT"); 28149 } else if (currentAnimationName === "none" || styles?.display === "none") { 28150 send("UNMOUNT"); 28151 } else { 28152 const isAnimating = prevAnimationName !== currentAnimationName; 28153 if (wasPresent && isAnimating) { 28154 send("ANIMATION_OUT"); 28155 } else { 28156 send("UNMOUNT"); 28157 } 28158 } 28159 prevPresentRef.current = present; 28160 } 28161 }, [present, send]); 28162 useLayoutEffect2(() => { 28163 if (node) { 28164 let timeoutId; 28165 const ownerWindow = node.ownerDocument.defaultView ?? window; 28166 const handleAnimationEnd = (event) => { 28167 const currentAnimationName = getAnimationName(stylesRef.current); 28168 const isCurrentAnimation = currentAnimationName.includes(CSS.escape(event.animationName)); 28169 if (event.target === node && isCurrentAnimation) { 28170 send("ANIMATION_END"); 28171 if (!prevPresentRef.current) { 28172 const currentFillMode = node.style.animationFillMode; 28173 node.style.animationFillMode = "forwards"; 28174 timeoutId = ownerWindow.setTimeout(() => { 28175 if (node.style.animationFillMode === "forwards") { 28176 node.style.animationFillMode = currentFillMode; 28177 } 28178 }); 28179 } 28180 } 28181 }; 28182 const handleAnimationStart = (event) => { 28183 if (event.target === node) { 28184 prevAnimationNameRef.current = getAnimationName(stylesRef.current); 28185 } 28186 }; 28187 node.addEventListener("animationstart", handleAnimationStart); 28188 node.addEventListener("animationcancel", handleAnimationEnd); 28189 node.addEventListener("animationend", handleAnimationEnd); 28190 return () => { 28191 ownerWindow.clearTimeout(timeoutId); 28192 node.removeEventListener("animationstart", handleAnimationStart); 28193 node.removeEventListener("animationcancel", handleAnimationEnd); 28194 node.removeEventListener("animationend", handleAnimationEnd); 28195 }; 28196 } else { 28197 send("ANIMATION_END"); 28198 } 28199 }, [node, send]); 28200 return { 28201 isPresent: ["mounted", "unmountSuspended"].includes(state), 28202 ref: reactExports.useCallback((node2) => { 28203 stylesRef.current = node2 ? getComputedStyle(node2) : null; 28204 setNode(node2); 28205 }, []) 28206 }; 28207} 28208function getAnimationName(styles) { 28209 return styles?.animationName || "none"; 28210} 28211function getElementRef(element) { 28212 let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get; 28213 let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning; 28214 if (mayWarn) { 28215 return element.ref; 28216 } 28217 getter = Object.getOwnPropertyDescriptor(element, "ref")?.get; 28218 mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning; 28219 if (mayWarn) { 28220 return element.props.ref; 28221 } 28222 return element.props.ref || element.ref; 28223} 28224 28225// src/use-controllable-state.tsx 28226var useInsertionEffect$1 = React$1[" useInsertionEffect ".trim().toString()] || useLayoutEffect2; 28227function useControllableState({ 28228 prop, 28229 defaultProp, 28230 onChange = () => { 28231 }, 28232 caller 28233}) { 28234 const [uncontrolledProp, setUncontrolledProp, onChangeRef] = useUncontrolledState({ 28235 defaultProp, 28236 onChange 28237 }); 28238 const isControlled = prop !== void 0; 28239 const value = isControlled ? prop : uncontrolledProp; 28240 { 28241 const isControlledRef = reactExports.useRef(prop !== void 0); 28242 reactExports.useEffect(() => { 28243 const wasControlled = isControlledRef.current; 28244 if (wasControlled !== isControlled) { 28245 const from = wasControlled ? "controlled" : "uncontrolled"; 28246 const to = isControlled ? "controlled" : "uncontrolled"; 28247 console.warn( 28248 `${caller} is changing from ${from} to ${to}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.` 28249 ); 28250 } 28251 isControlledRef.current = isControlled; 28252 }, [isControlled, caller]); 28253 } 28254 const setValue = reactExports.useCallback( 28255 (nextValue) => { 28256 if (isControlled) { 28257 const value2 = isFunction(nextValue) ? nextValue(prop) : nextValue; 28258 if (value2 !== prop) { 28259 onChangeRef.current?.(value2); 28260 } 28261 } else { 28262 setUncontrolledProp(nextValue); 28263 } 28264 }, 28265 [isControlled, prop, setUncontrolledProp, onChangeRef] 28266 ); 28267 return [value, setValue]; 28268} 28269function useUncontrolledState({ 28270 defaultProp, 28271 onChange 28272}) { 28273 const [value, setValue] = reactExports.useState(defaultProp); 28274 const prevValueRef = reactExports.useRef(value); 28275 const onChangeRef = reactExports.useRef(onChange); 28276 useInsertionEffect$1(() => { 28277 onChangeRef.current = onChange; 28278 }, [onChange]); 28279 reactExports.useEffect(() => { 28280 if (prevValueRef.current !== value) { 28281 onChangeRef.current?.(value); 28282 prevValueRef.current = value; 28283 } 28284 }, [value, prevValueRef]); 28285 return [value, setValue, onChangeRef]; 28286} 28287function isFunction(value) { 28288 return typeof value === "function"; 28289} 28290
vendor: 18,086 bytes, lines 28291-28744
28291// src/visually-hidden.tsx 28292var VISUALLY_HIDDEN_STYLES = Object.freeze({ 28293 // See: https://github.com/twbs/bootstrap/blob/main/scss/mixins/_visually-hidden.scss 28294 position: "absolute", 28295 border: 0, 28296 width: 1, 28297 height: 1, 28298 padding: 0, 28299 margin: -1, 28300 overflow: "hidden", 28301 clip: "rect(0, 0, 0, 0)", 28302 whiteSpace: "nowrap", 28303 wordWrap: "normal" 28304}); 28305var NAME$1 = "VisuallyHidden"; 28306var VisuallyHidden = reactExports.forwardRef( 28307 (props, forwardedRef) => { 28308 return /* @__PURE__ */ jsxRuntimeExports.jsx( 28309 Primitive.span, 28310 { 28311 ...props, 28312 ref: forwardedRef, 28313 style: { ...VISUALLY_HIDDEN_STYLES, ...props.style } 28314 } 28315 ); 28316 } 28317); 28318VisuallyHidden.displayName = NAME$1; 28319var Root$3 = VisuallyHidden; 28320 28321var [createTooltipContext] = createContextScope("Tooltip", [ 28322 createPopperScope 28323]); 28324var usePopperScope$1 = createPopperScope(); 28325var PROVIDER_NAME = "TooltipProvider"; 28326var DEFAULT_DELAY_DURATION = 700; 28327var TOOLTIP_OPEN = "tooltip.open"; 28328var [TooltipProviderContextProvider, useTooltipProviderContext] = createTooltipContext(PROVIDER_NAME); 28329var TooltipProvider$1 = (props) => { 28330 const { 28331 __scopeTooltip, 28332 delayDuration = DEFAULT_DELAY_DURATION, 28333 skipDelayDuration = 300, 28334 disableHoverableContent = false, 28335 children 28336 } = props; 28337 const isOpenDelayedRef = reactExports.useRef(true); 28338 const isPointerInTransitRef = reactExports.useRef(false); 28339 const skipDelayTimerRef = reactExports.useRef(0); 28340 reactExports.useEffect(() => { 28341 const skipDelayTimer = skipDelayTimerRef.current; 28342 return () => window.clearTimeout(skipDelayTimer); 28343 }, []); 28344 return /* @__PURE__ */ jsxRuntimeExports.jsx( 28345 TooltipProviderContextProvider, 28346 { 28347 scope: __scopeTooltip, 28348 isOpenDelayedRef, 28349 delayDuration, 28350 onOpen: reactExports.useCallback(() => { 28351 window.clearTimeout(skipDelayTimerRef.current); 28352 isOpenDelayedRef.current = false; 28353 }, []), 28354 onClose: reactExports.useCallback(() => { 28355 window.clearTimeout(skipDelayTimerRef.current); 28356 skipDelayTimerRef.current = window.setTimeout( 28357 () => isOpenDelayedRef.current = true, 28358 skipDelayDuration 28359 ); 28360 }, [skipDelayDuration]), 28361 isPointerInTransitRef, 28362 onPointerInTransitChange: reactExports.useCallback((inTransit) => { 28363 isPointerInTransitRef.current = inTransit; 28364 }, []), 28365 disableHoverableContent, 28366 children 28367 } 28368 ); 28369}; 28370TooltipProvider$1.displayName = PROVIDER_NAME; 28371var TOOLTIP_NAME = "Tooltip"; 28372var [TooltipContextProvider, useTooltipContext] = createTooltipContext(TOOLTIP_NAME); 28373var TRIGGER_NAME$1 = "TooltipTrigger"; 28374var TooltipTrigger = reactExports.forwardRef( 28375 (props, forwardedRef) => { 28376 const { __scopeTooltip, ...triggerProps } = props; 28377 const context = useTooltipContext(TRIGGER_NAME$1, __scopeTooltip); 28378 const providerContext = useTooltipProviderContext(TRIGGER_NAME$1, __scopeTooltip); 28379 const popperScope = usePopperScope$1(__scopeTooltip); 28380 const ref = reactExports.useRef(null); 28381 const composedRefs = useComposedRefs(forwardedRef, ref, context.onTriggerChange); 28382 const isPointerDownRef = reactExports.useRef(false); 28383 const hasPointerMoveOpenedRef = reactExports.useRef(false); 28384 const handlePointerUp = reactExports.useCallback(() => isPointerDownRef.current = false, []); 28385 reactExports.useEffect(() => { 28386 return () => document.removeEventListener("pointerup", handlePointerUp); 28387 }, [handlePointerUp]); 28388 return /* @__PURE__ */ jsxRuntimeExports.jsx(Anchor, { asChild: true, ...popperScope, children: /* @__PURE__ */ jsxRuntimeExports.jsx( 28389 Primitive.button, 28390 { 28391 "aria-describedby": context.open ? context.contentId : void 0, 28392 "data-state": context.stateAttribute, 28393 ...triggerProps, 28394 ref: composedRefs, 28395 onPointerMove: composeEventHandlers(props.onPointerMove, (event) => { 28396 if (event.pointerType === "touch") return; 28397 if (!hasPointerMoveOpenedRef.current && !providerContext.isPointerInTransitRef.current) { 28398 context.onTriggerEnter(); 28399 hasPointerMoveOpenedRef.current = true; 28400 } 28401 }), 28402 onPointerLeave: composeEventHandlers(props.onPointerLeave, () => { 28403 context.onTriggerLeave(); 28404 hasPointerMoveOpenedRef.current = false; 28405 }), 28406 onPointerDown: composeEventHandlers(props.onPointerDown, () => { 28407 if (context.open) { 28408 context.onClose(); 28409 } 28410 isPointerDownRef.current = true; 28411 document.addEventListener("pointerup", handlePointerUp, { once: true }); 28412 }), 28413 onFocus: composeEventHandlers(props.onFocus, () => { 28414 if (!isPointerDownRef.current) context.onOpen(); 28415 }), 28416 onBlur: composeEventHandlers(props.onBlur, context.onClose), 28417 onClick: composeEventHandlers(props.onClick, context.onClose) 28418 } 28419 ) }); 28420 } 28421); 28422TooltipTrigger.displayName = TRIGGER_NAME$1; 28423var PORTAL_NAME$1 = "TooltipPortal"; 28424var [PortalProvider$1, usePortalContext$1] = createTooltipContext(PORTAL_NAME$1, { 28425 forceMount: void 0 28426}); 28427var CONTENT_NAME$1 = "TooltipContent"; 28428var TooltipContent = reactExports.forwardRef( 28429 (props, forwardedRef) => { 28430 const portalContext = usePortalContext$1(CONTENT_NAME$1, props.__scopeTooltip); 28431 const { forceMount = portalContext.forceMount, side = "top", ...contentProps } = props; 28432 const context = useTooltipContext(CONTENT_NAME$1, props.__scopeTooltip); 28433 return /* @__PURE__ */ jsxRuntimeExports.jsx(Presence, { present: forceMount || context.open, children: context.disableHoverableContent ? /* @__PURE__ */ jsxRuntimeExports.jsx(TooltipContentImpl, { side, ...contentProps, ref: forwardedRef }) : /* @__PURE__ */ jsxRuntimeExports.jsx(TooltipContentHoverable, { side, ...contentProps, ref: forwardedRef }) }); 28434 } 28435); 28436var TooltipContentHoverable = reactExports.forwardRef((props, forwardedRef) => { 28437 const context = useTooltipContext(CONTENT_NAME$1, props.__scopeTooltip); 28438 const providerContext = useTooltipProviderContext(CONTENT_NAME$1, props.__scopeTooltip); 28439 const ref = reactExports.useRef(null); 28440 const composedRefs = useComposedRefs(forwardedRef, ref); 28441 const [pointerGraceArea, setPointerGraceArea] = reactExports.useState(null); 28442 const { trigger, onClose } = context; 28443 const content = ref.current; 28444 const { onPointerInTransitChange } = providerContext; 28445 const handleRemoveGraceArea = reactExports.useCallback(() => { 28446 setPointerGraceArea(null); 28447 onPointerInTransitChange(false); 28448 }, [onPointerInTransitChange]); 28449 const handleCreateGraceArea = reactExports.useCallback( 28450 (event, hoverTarget) => { 28451 const currentTarget = event.currentTarget; 28452 const exitPoint = { x: event.clientX, y: event.clientY }; 28453 const exitSide = getExitSideFromRect(exitPoint, currentTarget.getBoundingClientRect()); 28454 const paddedExitPoints = getPaddedExitPoints(exitPoint, exitSide); 28455 const hoverTargetPoints = getPointsFromRect(hoverTarget.getBoundingClientRect()); 28456 const graceArea = getHull([...paddedExitPoints, ...hoverTargetPoints]); 28457 setPointerGraceArea(graceArea); 28458 onPointerInTransitChange(true); 28459 }, 28460 [onPointerInTransitChange] 28461 ); 28462 reactExports.useEffect(() => { 28463 return () => handleRemoveGraceArea(); 28464 }, [handleRemoveGraceArea]); 28465 reactExports.useEffect(() => { 28466 if (trigger && content) { 28467 const handleTriggerLeave = (event) => handleCreateGraceArea(event, content); 28468 const handleContentLeave = (event) => handleCreateGraceArea(event, trigger); 28469 trigger.addEventListener("pointerleave", handleTriggerLeave); 28470 content.addEventListener("pointerleave", handleContentLeave); 28471 return () => { 28472 trigger.removeEventListener("pointerleave", handleTriggerLeave); 28473 content.removeEventListener("pointerleave", handleContentLeave); 28474 }; 28475 } 28476 }, [trigger, content, handleCreateGraceArea, handleRemoveGraceArea]); 28477 reactExports.useEffect(() => { 28478 if (pointerGraceArea) { 28479 const handleTrackPointerGrace = (event) => { 28480 const target = event.target; 28481 const pointerPosition = { x: event.clientX, y: event.clientY }; 28482 const hasEnteredTarget = trigger?.contains(target) || content?.contains(target); 28483 const isPointerOutsideGraceArea = !isPointInPolygon(pointerPosition, pointerGraceArea); 28484 if (hasEnteredTarget) { 28485 handleRemoveGraceArea(); 28486 } else if (isPointerOutsideGraceArea) { 28487 handleRemoveGraceArea(); 28488 onClose(); 28489 } 28490 }; 28491 document.addEventListener("pointermove", handleTrackPointerGrace); 28492 return () => document.removeEventListener("pointermove", handleTrackPointerGrace); 28493 } 28494 }, [trigger, content, pointerGraceArea, onClose, handleRemoveGraceArea]); 28495 return /* @__PURE__ */ jsxRuntimeExports.jsx(TooltipContentImpl, { ...props, ref: composedRefs }); 28496}); 28497var [VisuallyHiddenContentContextProvider, useVisuallyHiddenContentContext] = createTooltipContext(TOOLTIP_NAME, { isInside: false }); 28498var Slottable = createSlottable("TooltipContent"); 28499var TooltipContentImpl = reactExports.forwardRef( 28500 (props, forwardedRef) => { 28501 const { 28502 __scopeTooltip, 28503 children, 28504 "aria-label": ariaLabel, 28505 onEscapeKeyDown, 28506 onPointerDownOutside, 28507 ...contentProps 28508 } = props; 28509 const context = useTooltipContext(CONTENT_NAME$1, __scopeTooltip); 28510 const popperScope = usePopperScope$1(__scopeTooltip); 28511 const { onClose } = context; 28512 reactExports.useEffect(() => { 28513 document.addEventListener(TOOLTIP_OPEN, onClose); 28514 return () => document.removeEventListener(TOOLTIP_OPEN, onClose); 28515 }, [onClose]); 28516 reactExports.useEffect(() => { 28517 if (context.trigger) { 28518 const handleScroll = (event) => { 28519 const target = event.target; 28520 if (target?.contains(context.trigger)) onClose(); 28521 }; 28522 window.addEventListener("scroll", handleScroll, { capture: true }); 28523 return () => window.removeEventListener("scroll", handleScroll, { capture: true }); 28524 } 28525 }, [context.trigger, onClose]); 28526 return /* @__PURE__ */ jsxRuntimeExports.jsx( 28527 DismissableLayer, 28528 { 28529 asChild: true, 28530 disableOutsidePointerEvents: false, 28531 onEscapeKeyDown, 28532 onPointerDownOutside, 28533 onFocusOutside: (event) => event.preventDefault(), 28534 onDismiss: onClose, 28535 children: /* @__PURE__ */ jsxRuntimeExports.jsxs( 28536 Content, 28537 { 28538 "data-state": context.stateAttribute, 28539 ...popperScope, 28540 ...contentProps, 28541 ref: forwardedRef, 28542 style: { 28543 ...contentProps.style, 28544 // re-namespace exposed content custom properties 28545 ...{ 28546 "--radix-tooltip-content-transform-origin": "var(--radix-popper-transform-origin)", 28547 "--radix-tooltip-content-available-width": "var(--radix-popper-available-width)", 28548 "--radix-tooltip-content-available-height": "var(--radix-popper-available-height)", 28549 "--radix-tooltip-trigger-width": "var(--radix-popper-anchor-width)", 28550 "--radix-tooltip-trigger-height": "var(--radix-popper-anchor-height)" 28551 } 28552 }, 28553 children: [ 28554 /* @__PURE__ */ jsxRuntimeExports.jsx(Slottable, { children }), 28555 /* @__PURE__ */ jsxRuntimeExports.jsx(VisuallyHiddenContentContextProvider, { scope: __scopeTooltip, isInside: true, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Root$3, { id: context.contentId, role: "tooltip", children: ariaLabel || children }) }) 28556 ] 28557 } 28558 ) 28559 } 28560 ); 28561 } 28562); 28563TooltipContent.displayName = CONTENT_NAME$1; 28564var ARROW_NAME$1 = "TooltipArrow"; 28565var TooltipArrow = reactExports.forwardRef( 28566 (props, forwardedRef) => { 28567 const { __scopeTooltip, ...arrowProps } = props; 28568 const popperScope = usePopperScope$1(__scopeTooltip); 28569 const visuallyHiddenContentContext = useVisuallyHiddenContentContext( 28570 ARROW_NAME$1, 28571 __scopeTooltip 28572 ); 28573 return visuallyHiddenContentContext.isInside ? null : /* @__PURE__ */ jsxRuntimeExports.jsx(Arrow, { ...popperScope, ...arrowProps, ref: forwardedRef }); 28574 } 28575); 28576TooltipArrow.displayName = ARROW_NAME$1; 28577function getExitSideFromRect(point, rect) { 28578 const top = Math.abs(rect.top - point.y); 28579 const bottom = Math.abs(rect.bottom - point.y); 28580 const right = Math.abs(rect.right - point.x); 28581 const left = Math.abs(rect.left - point.x); 28582 switch (Math.min(top, bottom, right, left)) { 28583 case left: 28584 return "left"; 28585 case right: 28586 return "right"; 28587 case top: 28588 return "top"; 28589 case bottom: 28590 return "bottom"; 28591 default: 28592 throw new Error("unreachable"); 28593 } 28594} 28595function getPaddedExitPoints(exitPoint, exitSide, padding = 5) { 28596 const paddedExitPoints = []; 28597 switch (exitSide) { 28598 case "top": 28599 paddedExitPoints.push( 28600 { x: exitPoint.x - padding, y: exitPoint.y + padding }, 28601 { x: exitPoint.x + padding, y: exitPoint.y + padding } 28602 ); 28603 break; 28604 case "bottom": 28605 paddedExitPoints.push( 28606 { x: exitPoint.x - padding, y: exitPoint.y - padding }, 28607 { x: exitPoint.x + padding, y: exitPoint.y - padding } 28608 ); 28609 break; 28610 case "left": 28611 paddedExitPoints.push( 28612 { x: exitPoint.x + padding, y: exitPoint.y - padding }, 28613 { x: exitPoint.x + padding, y: exitPoint.y + padding } 28614 ); 28615 break; 28616 case "right": 28617 paddedExitPoints.push( 28618 { x: exitPoint.x - padding, y: exitPoint.y - padding }, 28619 { x: exitPoint.x - padding, y: exitPoint.y + padding } 28620 ); 28621 break; 28622 } 28623 return paddedExitPoints; 28624} 28625function getPointsFromRect(rect) { 28626 const { top, right, bottom, left } = rect; 28627 return [ 28628 { x: left, y: top }, 28629 { x: right, y: top }, 28630 { x: right, y: bottom }, 28631 { x: left, y: bottom } 28632 ]; 28633} 28634function isPointInPolygon(point, polygon) { 28635 const { x, y } = point; 28636 let inside = false; 28637 for (let i = 0, j = polygon.length - 1; i < polygon.length; j = i++) { 28638 const ii = polygon[i]; 28639 const jj = polygon[j]; 28640 const xi = ii.x; 28641 const yi = ii.y; 28642 const xj = jj.x; 28643 const yj = jj.y; 28644 const intersect = yi > y !== yj > y && x < (xj - xi) * (y - yi) / (yj - yi) + xi; 28645 if (intersect) inside = !inside; 28646 } 28647 return inside; 28648} 28649function getHull(points) { 28650 const newPoints = points.slice(); 28651 newPoints.sort((a, b) => { 28652 if (a.x < b.x) return -1; 28653 else if (a.x > b.x) return 1; 28654 else if (a.y < b.y) return -1; 28655 else if (a.y > b.y) return 1; 28656 else return 0; 28657 }); 28658 return getHullPresorted(newPoints); 28659} 28660function getHullPresorted(points) { 28661 if (points.length <= 1) return points.slice(); 28662 const upperHull = []; 28663 for (let i = 0; i < points.length; i++) { 28664 const p = points[i]; 28665 while (upperHull.length >= 2) { 28666 const q = upperHull[upperHull.length - 1]; 28667 const r = upperHull[upperHull.length - 2]; 28668 if ((q.x - r.x) * (p.y - r.y) >= (q.y - r.y) * (p.x - r.x)) upperHull.pop(); 28669 else break; 28670 } 28671 upperHull.push(p); 28672 } 28673 upperHull.pop(); 28674 const lowerHull = []; 28675 for (let i = points.length - 1; i >= 0; i--) { 28676 const p = points[i]; 28677 while (lowerHull.length >= 2) { 28678 const q = lowerHull[lowerHull.length - 1]; 28679 const r = lowerHull[lowerHull.length - 2]; 28680 if ((q.x - r.x) * (p.y - r.y) >= (q.y - r.y) * (p.x - r.x)) lowerHull.pop(); 28681 else break; 28682 } 28683 lowerHull.push(p); 28684 } 28685 lowerHull.pop(); 28686 if (upperHull.length === 1 && lowerHull.length === 1 && upperHull[0].x === lowerHull[0].x && upperHull[0].y === lowerHull[0].y) { 28687 return upperHull; 28688 } else { 28689 return upperHull.concat(lowerHull); 28690 } 28691} 28692var Provider = TooltipProvider$1; 28693 28694function r(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=" "),n+=f);}else for(f in e)e[f]&&(n&&(n+=" "),n+=f);return n}function clsx(){for(var e,t,f=0,n="",o=arguments.length;f<o;f++)(e=arguments[f])&&(t=r(e))&&(n&&(n+=" "),n+=t);return n} 28695 28696const CLASS_PART_SEPARATOR = '-'; 28697const createClassGroupUtils = config => { 28698 const classMap = createClassMap(config); 28699 const { 28700 conflictingClassGroups, 28701 conflictingClassGroupModifiers 28702 } = config; 28703 const getClassGroupId = className => { 28704 const classParts = className.split(CLASS_PART_SEPARATOR); 28705 // Classes like `-inset-1` produce an empty string as first classPart. We assume that classes for negative values are used correctly and remove it from classParts. 28706 if (classParts[0] === '' && classParts.length !== 1) { 28707 classParts.shift(); 28708 } 28709 return getGroupRecursive(classParts, classMap) || getGroupIdForArbitraryProperty(className); 28710 }; 28711 const getConflictingClassGroupIds = (classGroupId, hasPostfixModifier) => { 28712 const conflicts = conflictingClassGroups[classGroupId] || []; 28713 if (hasPostfixModifier && conflictingClassGroupModifiers[classGroupId]) { 28714 return [...conflicts, ...conflictingClassGroupModifiers[classGroupId]]; 28715 } 28716 return conflicts; 28717 }; 28718 return { 28719 getClassGroupId, 28720 getConflictingClassGroupIds 28721 }; 28722}; 28723const getGroupRecursive = (classParts, classPartObject) => { 28724 if (classParts.length === 0) { 28725 return classPartObject.classGroupId; 28726 } 28727 const currentClassPart = classParts[0]; 28728 const nextClassPartObject = classPartObject.nextPart.get(currentClassPart); 28729 const classGroupFromNextClassPart = nextClassPartObject ? getGroupRecursive(classParts.slice(1), nextClassPartObject) : undefined; 28730 if (classGroupFromNextClassPart) { 28731 return classGroupFromNextClassPart; 28732 } 28733 if (classPartObject.validators.length === 0) { 28734 return undefined; 28735 } 28736 const classRest = classParts.join(CLASS_PART_SEPARATOR); 28737 return classPartObject.validators.find(({ 28738 validator 28739 }) => validator(classRest))?.classGroupId; 28740}; 28741const arbitraryPropertyRegex = /^\[(.+)\]$/; 28742const getGroupIdForArbitraryProperty = className => { 28743 if (arbitraryPropertyRegex.test(className)) { 28744 const arbitraryPropertyClassName = arbitraryPropertyRegex.exec(className)[1];
vendor: 11,766 bytes, lines 28745-29101
28745 const property = arbitraryPropertyClassName?.substring(0, arbitraryPropertyClassName.indexOf(':')); 28746 if (property) { 28747 // I use two dots here because one dot is used as prefix for class groups in plugins 28748 return 'arbitrary..' + property; 28749 } 28750 } 28751}; 28752/** 28753 * Exported for testing only 28754 */ 28755const createClassMap = config => { 28756 const { 28757 theme, 28758 classGroups 28759 } = config; 28760 const classMap = { 28761 nextPart: new Map(), 28762 validators: [] 28763 }; 28764 for (const classGroupId in classGroups) { 28765 processClassesRecursively(classGroups[classGroupId], classMap, classGroupId, theme); 28766 } 28767 return classMap; 28768}; 28769const processClassesRecursively = (classGroup, classPartObject, classGroupId, theme) => { 28770 classGroup.forEach(classDefinition => { 28771 if (typeof classDefinition === 'string') { 28772 const classPartObjectToEdit = classDefinition === '' ? classPartObject : getPart(classPartObject, classDefinition); 28773 classPartObjectToEdit.classGroupId = classGroupId; 28774 return; 28775 } 28776 if (typeof classDefinition === 'function') { 28777 if (isThemeGetter(classDefinition)) { 28778 processClassesRecursively(classDefinition(theme), classPartObject, classGroupId, theme); 28779 return; 28780 } 28781 classPartObject.validators.push({ 28782 validator: classDefinition, 28783 classGroupId 28784 }); 28785 return; 28786 } 28787 Object.entries(classDefinition).forEach(([key, classGroup]) => { 28788 processClassesRecursively(classGroup, getPart(classPartObject, key), classGroupId, theme); 28789 }); 28790 }); 28791}; 28792const getPart = (classPartObject, path) => { 28793 let currentClassPartObject = classPartObject; 28794 path.split(CLASS_PART_SEPARATOR).forEach(pathPart => { 28795 if (!currentClassPartObject.nextPart.has(pathPart)) { 28796 currentClassPartObject.nextPart.set(pathPart, { 28797 nextPart: new Map(), 28798 validators: [] 28799 }); 28800 } 28801 currentClassPartObject = currentClassPartObject.nextPart.get(pathPart); 28802 }); 28803 return currentClassPartObject; 28804}; 28805const isThemeGetter = func => func.isThemeGetter; 28806 28807// LRU cache inspired from hashlru (https://github.com/dominictarr/hashlru/blob/v1.0.4/index.js) but object replaced with Map to improve performance 28808const createLruCache = maxCacheSize => { 28809 if (maxCacheSize < 1) { 28810 return { 28811 get: () => undefined, 28812 set: () => {} 28813 }; 28814 } 28815 let cacheSize = 0; 28816 let cache = new Map(); 28817 let previousCache = new Map(); 28818 const update = (key, value) => { 28819 cache.set(key, value); 28820 cacheSize++; 28821 if (cacheSize > maxCacheSize) { 28822 cacheSize = 0; 28823 previousCache = cache; 28824 cache = new Map(); 28825 } 28826 }; 28827 return { 28828 get(key) { 28829 let value = cache.get(key); 28830 if (value !== undefined) { 28831 return value; 28832 } 28833 if ((value = previousCache.get(key)) !== undefined) { 28834 update(key, value); 28835 return value; 28836 } 28837 }, 28838 set(key, value) { 28839 if (cache.has(key)) { 28840 cache.set(key, value); 28841 } else { 28842 update(key, value); 28843 } 28844 } 28845 }; 28846}; 28847const IMPORTANT_MODIFIER = '!'; 28848const MODIFIER_SEPARATOR = ':'; 28849const MODIFIER_SEPARATOR_LENGTH = MODIFIER_SEPARATOR.length; 28850const createParseClassName = config => { 28851 const { 28852 prefix, 28853 experimentalParseClassName 28854 } = config; 28855 /** 28856 * Parse class name into parts. 28857 * 28858 * Inspired by `splitAtTopLevelOnly` used in Tailwind CSS 28859 * @see https://github.com/tailwindlabs/tailwindcss/blob/v3.2.2/src/util/splitAtTopLevelOnly.js 28860 */ 28861 let parseClassName = className => { 28862 const modifiers = []; 28863 let bracketDepth = 0; 28864 let parenDepth = 0; 28865 let modifierStart = 0; 28866 let postfixModifierPosition; 28867 for (let index = 0; index < className.length; index++) { 28868 let currentCharacter = className[index]; 28869 if (bracketDepth === 0 && parenDepth === 0) { 28870 if (currentCharacter === MODIFIER_SEPARATOR) { 28871 modifiers.push(className.slice(modifierStart, index)); 28872 modifierStart = index + MODIFIER_SEPARATOR_LENGTH; 28873 continue; 28874 } 28875 if (currentCharacter === '/') { 28876 postfixModifierPosition = index; 28877 continue; 28878 } 28879 } 28880 if (currentCharacter === '[') { 28881 bracketDepth++; 28882 } else if (currentCharacter === ']') { 28883 bracketDepth--; 28884 } else if (currentCharacter === '(') { 28885 parenDepth++; 28886 } else if (currentCharacter === ')') { 28887 parenDepth--; 28888 } 28889 } 28890 const baseClassNameWithImportantModifier = modifiers.length === 0 ? className : className.substring(modifierStart); 28891 const baseClassName = stripImportantModifier(baseClassNameWithImportantModifier); 28892 const hasImportantModifier = baseClassName !== baseClassNameWithImportantModifier; 28893 const maybePostfixModifierPosition = postfixModifierPosition && postfixModifierPosition > modifierStart ? postfixModifierPosition - modifierStart : undefined; 28894 return { 28895 modifiers, 28896 hasImportantModifier, 28897 baseClassName, 28898 maybePostfixModifierPosition 28899 }; 28900 }; 28901 if (prefix) { 28902 const fullPrefix = prefix + MODIFIER_SEPARATOR; 28903 const parseClassNameOriginal = parseClassName; 28904 parseClassName = className => className.startsWith(fullPrefix) ? parseClassNameOriginal(className.substring(fullPrefix.length)) : { 28905 isExternal: true, 28906 modifiers: [], 28907 hasImportantModifier: false, 28908 baseClassName: className, 28909 maybePostfixModifierPosition: undefined 28910 }; 28911 } 28912 if (experimentalParseClassName) { 28913 const parseClassNameOriginal = parseClassName; 28914 parseClassName = className => experimentalParseClassName({ 28915 className, 28916 parseClassName: parseClassNameOriginal 28917 }); 28918 } 28919 return parseClassName; 28920}; 28921const stripImportantModifier = baseClassName => { 28922 if (baseClassName.endsWith(IMPORTANT_MODIFIER)) { 28923 return baseClassName.substring(0, baseClassName.length - 1); 28924 } 28925 /** 28926 * In Tailwind CSS v3 the important modifier was at the start of the base class name. This is still supported for legacy reasons. 28927 * @see https://github.com/dcastil/tailwind-merge/issues/513#issuecomment-2614029864 28928 */ 28929 if (baseClassName.startsWith(IMPORTANT_MODIFIER)) { 28930 return baseClassName.substring(1); 28931 } 28932 return baseClassName; 28933}; 28934 28935/** 28936 * Sorts modifiers according to following schema: 28937 * - Predefined modifiers are sorted alphabetically 28938 * - When an arbitrary variant appears, it must be preserved which modifiers are before and after it 28939 */ 28940const createSortModifiers = config => { 28941 const orderSensitiveModifiers = Object.fromEntries(config.orderSensitiveModifiers.map(modifier => [modifier, true])); 28942 const sortModifiers = modifiers => { 28943 if (modifiers.length <= 1) { 28944 return modifiers; 28945 } 28946 const sortedModifiers = []; 28947 let unsortedModifiers = []; 28948 modifiers.forEach(modifier => { 28949 const isPositionSensitive = modifier[0] === '[' || orderSensitiveModifiers[modifier]; 28950 if (isPositionSensitive) { 28951 sortedModifiers.push(...unsortedModifiers.sort(), modifier); 28952 unsortedModifiers = []; 28953 } else { 28954 unsortedModifiers.push(modifier); 28955 } 28956 }); 28957 sortedModifiers.push(...unsortedModifiers.sort()); 28958 return sortedModifiers; 28959 }; 28960 return sortModifiers; 28961}; 28962const createConfigUtils = config => ({ 28963 cache: createLruCache(config.cacheSize), 28964 parseClassName: createParseClassName(config), 28965 sortModifiers: createSortModifiers(config), 28966 ...createClassGroupUtils(config) 28967}); 28968const SPLIT_CLASSES_REGEX = /\s+/; 28969const mergeClassList = (classList, configUtils) => { 28970 const { 28971 parseClassName, 28972 getClassGroupId, 28973 getConflictingClassGroupIds, 28974 sortModifiers 28975 } = configUtils; 28976 /** 28977 * Set of classGroupIds in following format: 28978 * `{importantModifier}{variantModifiers}{classGroupId}` 28979 * @example 'float' 28980 * @example 'hover:focus:bg-color' 28981 * @example 'md:!pr' 28982 */ 28983 const classGroupsInConflict = []; 28984 const classNames = classList.trim().split(SPLIT_CLASSES_REGEX); 28985 let result = ''; 28986 for (let index = classNames.length - 1; index >= 0; index -= 1) { 28987 const originalClassName = classNames[index]; 28988 const { 28989 isExternal, 28990 modifiers, 28991 hasImportantModifier, 28992 baseClassName, 28993 maybePostfixModifierPosition 28994 } = parseClassName(originalClassName); 28995 if (isExternal) { 28996 result = originalClassName + (result.length > 0 ? ' ' + result : result); 28997 continue; 28998 } 28999 let hasPostfixModifier = !!maybePostfixModifierPosition; 29000 let classGroupId = getClassGroupId(hasPostfixModifier ? baseClassName.substring(0, maybePostfixModifierPosition) : baseClassName); 29001 if (!classGroupId) { 29002 if (!hasPostfixModifier) { 29003 // Not a Tailwind class 29004 result = originalClassName + (result.length > 0 ? ' ' + result : result); 29005 continue; 29006 } 29007 classGroupId = getClassGroupId(baseClassName); 29008 if (!classGroupId) { 29009 // Not a Tailwind class 29010 result = originalClassName + (result.length > 0 ? ' ' + result : result); 29011 continue; 29012 } 29013 hasPostfixModifier = false; 29014 } 29015 const variantModifier = sortModifiers(modifiers).join(':'); 29016 const modifierId = hasImportantModifier ? variantModifier + IMPORTANT_MODIFIER : variantModifier; 29017 const classId = modifierId + classGroupId; 29018 if (classGroupsInConflict.includes(classId)) { 29019 // Tailwind class omitted due to conflict 29020 continue; 29021 } 29022 classGroupsInConflict.push(classId); 29023 const conflictGroups = getConflictingClassGroupIds(classGroupId, hasPostfixModifier); 29024 for (let i = 0; i < conflictGroups.length; ++i) { 29025 const group = conflictGroups[i]; 29026 classGroupsInConflict.push(modifierId + group); 29027 } 29028 // Tailwind class not in conflict 29029 result = originalClassName + (result.length > 0 ? ' ' + result : result); 29030 } 29031 return result; 29032}; 29033 29034/** 29035 * The code in this file is copied from https://github.com/lukeed/clsx and modified to suit the needs of tailwind-merge better. 29036 * 29037 * Specifically: 29038 * - Runtime code from https://github.com/lukeed/clsx/blob/v1.2.1/src/index.js 29039 * - TypeScript types from https://github.com/lukeed/clsx/blob/v1.2.1/clsx.d.ts 29040 * 29041 * Original code has MIT license: Copyright (c) Luke Edwards <[email protected]> (lukeed.com) 29042 */ 29043function twJoin() { 29044 let index = 0; 29045 let argument; 29046 let resolvedValue; 29047 let string = ''; 29048 while (index < arguments.length) { 29049 if (argument = arguments[index++]) { 29050 if (resolvedValue = toValue(argument)) { 29051 string && (string += ' '); 29052 string += resolvedValue; 29053 } 29054 } 29055 } 29056 return string; 29057} 29058const toValue = mix => { 29059 if (typeof mix === 'string') { 29060 return mix; 29061 } 29062 let resolvedValue; 29063 let string = ''; 29064 for (let k = 0; k < mix.length; k++) { 29065 if (mix[k]) { 29066 if (resolvedValue = toValue(mix[k])) { 29067 string && (string += ' '); 29068 string += resolvedValue; 29069 } 29070 } 29071 } 29072 return string; 29073}; 29074function createTailwindMerge(createConfigFirst, ...createConfigRest) { 29075 let configUtils; 29076 let cacheGet; 29077 let cacheSet; 29078 let functionToCall = initTailwindMerge; 29079 function initTailwindMerge(classList) { 29080 const config = createConfigRest.reduce((previousConfig, createConfigCurrent) => createConfigCurrent(previousConfig), createConfigFirst()); 29081 configUtils = createConfigUtils(config); 29082 cacheGet = configUtils.cache.get; 29083 cacheSet = configUtils.cache.set; 29084 functionToCall = tailwindMerge; 29085 return tailwindMerge(classList); 29086 } 29087 function tailwindMerge(classList) { 29088 const cachedResult = cacheGet(classList); 29089 if (cachedResult) { 29090 return cachedResult; 29091 } 29092 const result = mergeClassList(classList, configUtils); 29093 cacheSet(classList, result); 29094 return result; 29095 } 29096 return function callTailwindMerge() { 29097 return functionToCall(twJoin.apply(null, arguments)); 29098 }; 29099} 29100const fromTheme = key => { 29101 const themeGetter = theme => theme[key] || []
vendor: 16,371 bytes, lines 29101-29509
29101; 29102 themeGetter.isThemeGetter = true; 29103 return themeGetter; 29104}; 29105const arbitraryValueRegex = /^\[(?:(\w[\w-]*):)?(.+)\]$/i; 29106const arbitraryVariableRegex = /^\((?:(\w[\w-]*):)?(.+)\)$/i; 29107const fractionRegex = /^\d+\/\d+$/; 29108const tshirtUnitRegex = /^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/; 29109const lengthUnitRegex = /\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/; 29110const colorFunctionRegex = /^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/; 29111// Shadow always begins with x and y offset separated by underscore optionally prepended by inset 29112const shadowRegex = /^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/; 29113const imageRegex = /^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/; 29114const isFraction = value => fractionRegex.test(value); 29115const isNumber = value => !!value && !Number.isNaN(Number(value)); 29116const isInteger = value => !!value && Number.isInteger(Number(value)); 29117const isPercent = value => value.endsWith('%') && isNumber(value.slice(0, -1)); 29118const isTshirtSize = value => tshirtUnitRegex.test(value); 29119const isAny = () => true; 29120const isLengthOnly = value => 29121// `colorFunctionRegex` check is necessary because color functions can have percentages in them which which would be incorrectly classified as lengths. 29122// For example, `hsl(0 0% 0%)` would be classified as a length without this check. 29123// I could also use lookbehind assertion in `lengthUnitRegex` but that isn't supported widely enough. 29124lengthUnitRegex.test(value) && !colorFunctionRegex.test(value); 29125const isNever = () => false; 29126const isShadow = value => shadowRegex.test(value); 29127const isImage = value => imageRegex.test(value); 29128const isAnyNonArbitrary = value => !isArbitraryValue(value) && !isArbitraryVariable(value); 29129const isArbitrarySize = value => getIsArbitraryValue(value, isLabelSize, isNever); 29130const isArbitraryValue = value => arbitraryValueRegex.test(value); 29131const isArbitraryLength = value => getIsArbitraryValue(value, isLabelLength, isLengthOnly); 29132const isArbitraryNumber = value => getIsArbitraryValue(value, isLabelNumber, isNumber); 29133const isArbitraryPosition = value => getIsArbitraryValue(value, isLabelPosition, isNever); 29134const isArbitraryImage = value => getIsArbitraryValue(value, isLabelImage, isImage); 29135const isArbitraryShadow = value => getIsArbitraryValue(value, isLabelShadow, isShadow); 29136const isArbitraryVariable = value => arbitraryVariableRegex.test(value); 29137const isArbitraryVariableLength = value => getIsArbitraryVariable(value, isLabelLength); 29138const isArbitraryVariableFamilyName = value => getIsArbitraryVariable(value, isLabelFamilyName); 29139const isArbitraryVariablePosition = value => getIsArbitraryVariable(value, isLabelPosition); 29140const isArbitraryVariableSize = value => getIsArbitraryVariable(value, isLabelSize); 29141const isArbitraryVariableImage = value => getIsArbitraryVariable(value, isLabelImage); 29142const isArbitraryVariableShadow = value => getIsArbitraryVariable(value, isLabelShadow, true); 29143// Helpers 29144const getIsArbitraryValue = (value, testLabel, testValue) => { 29145 const result = arbitraryValueRegex.exec(value); 29146 if (result) { 29147 if (result[1]) { 29148 return testLabel(result[1]); 29149 } 29150 return testValue(result[2]); 29151 } 29152 return false; 29153}; 29154const getIsArbitraryVariable = (value, testLabel, shouldMatchNoLabel = false) => { 29155 const result = arbitraryVariableRegex.exec(value); 29156 if (result) { 29157 if (result[1]) { 29158 return testLabel(result[1]); 29159 } 29160 return shouldMatchNoLabel; 29161 } 29162 return false; 29163}; 29164// Labels 29165const isLabelPosition = label => label === 'position' || label === 'percentage'; 29166const isLabelImage = label => label === 'image' || label === 'url'; 29167const isLabelSize = label => label === 'length' || label === 'size' || label === 'bg-size'; 29168const isLabelLength = label => label === 'length'; 29169const isLabelNumber = label => label === 'number'; 29170const isLabelFamilyName = label => label === 'family-name'; 29171const isLabelShadow = label => label === 'shadow'; 29172const getDefaultConfig = () => { 29173 /** 29174 * Theme getters for theme variable namespaces 29175 * @see https://tailwindcss.com/docs/theme#theme-variable-namespaces 29176 */ 29177 /***/ 29178 const themeColor = fromTheme('color'); 29179 const themeFont = fromTheme('font'); 29180 const themeText = fromTheme('text'); 29181 const themeFontWeight = fromTheme('font-weight'); 29182 const themeTracking = fromTheme('tracking'); 29183 const themeLeading = fromTheme('leading'); 29184 const themeBreakpoint = fromTheme('breakpoint'); 29185 const themeContainer = fromTheme('container'); 29186 const themeSpacing = fromTheme('spacing'); 29187 const themeRadius = fromTheme('radius'); 29188 const themeShadow = fromTheme('shadow'); 29189 const themeInsetShadow = fromTheme('inset-shadow'); 29190 const themeTextShadow = fromTheme('text-shadow'); 29191 const themeDropShadow = fromTheme('drop-shadow'); 29192 const themeBlur = fromTheme('blur'); 29193 const themePerspective = fromTheme('perspective'); 29194 const themeAspect = fromTheme('aspect'); 29195 const themeEase = fromTheme('ease'); 29196 const themeAnimate = fromTheme('animate'); 29197 /** 29198 * Helpers to avoid repeating the same scales 29199 * 29200 * We use functions that create a new array every time they're called instead of static arrays. 29201 * This ensures that users who modify any scale by mutating the array (e.g. with `array.push(element)`) don't accidentally mutate arrays in other parts of the config. 29202 */ 29203 /***/ 29204 const scaleBreak = () => ['auto', 'avoid', 'all', 'avoid-page', 'page', 'left', 'right', 'column']; 29205 const scalePosition = () => ['center', 'top', 'bottom', 'left', 'right', 'top-left', 29206 // Deprecated since Tailwind CSS v4.1.0, see https://github.com/tailwindlabs/tailwindcss/pull/17378 29207 'left-top', 'top-right', 29208 // Deprecated since Tailwind CSS v4.1.0, see https://github.com/tailwindlabs/tailwindcss/pull/17378 29209 'right-top', 'bottom-right', 29210 // Deprecated since Tailwind CSS v4.1.0, see https://github.com/tailwindlabs/tailwindcss/pull/17378 29211 'right-bottom', 'bottom-left', 29212 // Deprecated since Tailwind CSS v4.1.0, see https://github.com/tailwindlabs/tailwindcss/pull/17378 29213 'left-bottom']; 29214 const scalePositionWithArbitrary = () => [...scalePosition(), isArbitraryVariable, isArbitraryValue]; 29215 const scaleOverflow = () => ['auto', 'hidden', 'clip', 'visible', 'scroll']; 29216 const scaleOverscroll = () => ['auto', 'contain', 'none']; 29217 const scaleUnambiguousSpacing = () => [isArbitraryVariable, isArbitraryValue, themeSpacing]; 29218 const scaleInset = () => [isFraction, 'full', 'auto', ...scaleUnambiguousSpacing()]; 29219 const scaleGridTemplateColsRows = () => [isInteger, 'none', 'subgrid', isArbitraryVariable, isArbitraryValue]; 29220 const scaleGridColRowStartAndEnd = () => ['auto', { 29221 span: ['full', isInteger, isArbitraryVariable, isArbitraryValue] 29222 }, isInteger, isArbitraryVariable, isArbitraryValue]; 29223 const scaleGridColRowStartOrEnd = () => [isInteger, 'auto', isArbitraryVariable, isArbitraryValue]; 29224 const scaleGridAutoColsRows = () => ['auto', 'min', 'max', 'fr', isArbitraryVariable, isArbitraryValue]; 29225 const scaleAlignPrimaryAxis = () => ['start', 'end', 'center', 'between', 'around', 'evenly', 'stretch', 'baseline', 'center-safe', 'end-safe']; 29226 const scaleAlignSecondaryAxis = () => ['start', 'end', 'center', 'stretch', 'center-safe', 'end-safe']; 29227 const scaleMargin = () => ['auto', ...scaleUnambiguousSpacing()]; 29228 const scaleSizing = () => [isFraction, 'auto', 'full', 'dvw', 'dvh', 'lvw', 'lvh', 'svw', 'svh', 'min', 'max', 'fit', ...scaleUnambiguousSpacing()]; 29229 const scaleColor = () => [themeColor, isArbitraryVariable, isArbitraryValue]; 29230 const scaleBgPosition = () => [...scalePosition(), isArbitraryVariablePosition, isArbitraryPosition, { 29231 position: [isArbitraryVariable, isArbitraryValue] 29232 }]; 29233 const scaleBgRepeat = () => ['no-repeat', { 29234 repeat: ['', 'x', 'y', 'space', 'round'] 29235 }]; 29236 const scaleBgSize = () => ['auto', 'cover', 'contain', isArbitraryVariableSize, isArbitrarySize, { 29237 size: [isArbitraryVariable, isArbitraryValue] 29238 }]; 29239 const scaleGradientStopPosition = () => [isPercent, isArbitraryVariableLength, isArbitraryLength]; 29240 const scaleRadius = () => [ 29241 // Deprecated since Tailwind CSS v4.0.0 29242 '', 'none', 'full', themeRadius, isArbitraryVariable, isArbitraryValue]; 29243 const scaleBorderWidth = () => ['', isNumber, isArbitraryVariableLength, isArbitraryLength]; 29244 const scaleLineStyle = () => ['solid', 'dashed', 'dotted', 'double']; 29245 const scaleBlendMode = () => ['normal', 'multiply', 'screen', 'overlay', 'darken', 'lighten', 'color-dodge', 'color-burn', 'hard-light', 'soft-light', 'difference', 'exclusion', 'hue', 'saturation', 'color', 'luminosity']; 29246 const scaleMaskImagePosition = () => [isNumber, isPercent, isArbitraryVariablePosition, isArbitraryPosition]; 29247 const scaleBlur = () => [ 29248 // Deprecated since Tailwind CSS v4.0.0 29249 '', 'none', themeBlur, isArbitraryVariable, isArbitraryValue]; 29250 const scaleRotate = () => ['none', isNumber, isArbitraryVariable, isArbitraryValue]; 29251 const scaleScale = () => ['none', isNumber, isArbitraryVariable, isArbitraryValue]; 29252 const scaleSkew = () => [isNumber, isArbitraryVariable, isArbitraryValue]; 29253 const scaleTranslate = () => [isFraction, 'full', ...scaleUnambiguousSpacing()]; 29254 return { 29255 cacheSize: 500, 29256 theme: { 29257 animate: ['spin', 'ping', 'pulse', 'bounce'], 29258 aspect: ['video'], 29259 blur: [isTshirtSize], 29260 breakpoint: [isTshirtSize], 29261 color: [isAny], 29262 container: [isTshirtSize], 29263 'drop-shadow': [isTshirtSize], 29264 ease: ['in', 'out', 'in-out'], 29265 font: [isAnyNonArbitrary], 29266 'font-weight': ['thin', 'extralight', 'light', 'normal', 'medium', 'semibold', 'bold', 'extrabold', 'black'], 29267 'inset-shadow': [isTshirtSize], 29268 leading: ['none', 'tight', 'snug', 'normal', 'relaxed', 'loose'], 29269 perspective: ['dramatic', 'near', 'normal', 'midrange', 'distant', 'none'], 29270 radius: [isTshirtSize], 29271 shadow: [isTshirtSize], 29272 spacing: ['px', isNumber], 29273 text: [isTshirtSize], 29274 'text-shadow': [isTshirtSize], 29275 tracking: ['tighter', 'tight', 'normal', 'wide', 'wider', 'widest'] 29276 }, 29277 classGroups: { 29278 // -------------- 29279 // --- Layout --- 29280 // -------------- 29281 /** 29282 * Aspect Ratio 29283 * @see https://tailwindcss.com/docs/aspect-ratio 29284 */ 29285 aspect: [{ 29286 aspect: ['auto', 'square', isFraction, isArbitraryValue, isArbitraryVariable, themeAspect] 29287 }], 29288 /** 29289 * Container 29290 * @see https://tailwindcss.com/docs/container 29291 * @deprecated since Tailwind CSS v4.0.0 29292 */ 29293 container: ['container'], 29294 /** 29295 * Columns 29296 * @see https://tailwindcss.com/docs/columns 29297 */ 29298 columns: [{ 29299 columns: [isNumber, isArbitraryValue, isArbitraryVariable, themeContainer] 29300 }], 29301 /** 29302 * Break After 29303 * @see https://tailwindcss.com/docs/break-after 29304 */ 29305 'break-after': [{ 29306 'break-after': scaleBreak() 29307 }], 29308 /** 29309 * Break Before 29310 * @see https://tailwindcss.com/docs/break-before 29311 */ 29312 'break-before': [{ 29313 'break-before': scaleBreak() 29314 }], 29315 /** 29316 * Break Inside 29317 * @see https://tailwindcss.com/docs/break-inside 29318 */ 29319 'break-inside': [{ 29320 'break-inside': ['auto', 'avoid', 'avoid-page', 'avoid-column'] 29321 }], 29322 /** 29323 * Box Decoration Break 29324 * @see https://tailwindcss.com/docs/box-decoration-break 29325 */ 29326 'box-decoration': [{ 29327 'box-decoration': ['slice', 'clone'] 29328 }], 29329 /** 29330 * Box Sizing 29331 * @see https://tailwindcss.com/docs/box-sizing 29332 */ 29333 box: [{ 29334 box: ['border', 'content'] 29335 }], 29336 /** 29337 * Display 29338 * @see https://tailwindcss.com/docs/display 29339 */ 29340 display: ['block', 'inline-block', 'inline', 'flex', 'inline-flex', 'table', 'inline-table', 'table-caption', 'table-cell', 'table-column', 'table-column-group', 'table-footer-group', 'table-header-group', 'table-row-group', 'table-row', 'flow-root', 'grid', 'inline-grid', 'contents', 'list-item', 'hidden'], 29341 /** 29342 * Screen Reader Only 29343 * @see https://tailwindcss.com/docs/display#screen-reader-only 29344 */ 29345 sr: ['sr-only', 'not-sr-only'], 29346 /** 29347 * Floats 29348 * @see https://tailwindcss.com/docs/float 29349 */ 29350 float: [{ 29351 float: ['right', 'left', 'none', 'start', 'end'] 29352 }], 29353 /** 29354 * Clear 29355 * @see https://tailwindcss.com/docs/clear 29356 */ 29357 clear: [{ 29358 clear: ['left', 'right', 'both', 'none', 'start', 'end'] 29359 }], 29360 /** 29361 * Isolation 29362 * @see https://tailwindcss.com/docs/isolation 29363 */ 29364 isolation: ['isolate', 'isolation-auto'], 29365 /** 29366 * Object Fit 29367 * @see https://tailwindcss.com/docs/object-fit 29368 */ 29369 'object-fit': [{ 29370 object: ['contain', 'cover', 'fill', 'none', 'scale-down'] 29371 }], 29372 /** 29373 * Object Position 29374 * @see https://tailwindcss.com/docs/object-position 29375 */ 29376 'object-position': [{ 29377 object: scalePositionWithArbitrary() 29378 }], 29379 /** 29380 * Overflow 29381 * @see https://tailwindcss.com/docs/overflow 29382 */ 29383 overflow: [{ 29384 overflow: scaleOverflow() 29385 }], 29386 /** 29387 * Overflow X 29388 * @see https://tailwindcss.com/docs/overflow 29389 */ 29390 'overflow-x': [{ 29391 'overflow-x': scaleOverflow() 29392 }], 29393 /** 29394 * Overflow Y 29395 * @see https://tailwindcss.com/docs/overflow 29396 */ 29397 'overflow-y': [{ 29398 'overflow-y': scaleOverflow() 29399 }], 29400 /** 29401 * Overscroll Behavior 29402 * @see https://tailwindcss.com/docs/overscroll-behavior 29403 */ 29404 overscroll: [{ 29405 overscroll: scaleOverscroll() 29406 }], 29407 /** 29408 * Overscroll Behavior X 29409 * @see https://tailwindcss.com/docs/overscroll-behavior 29410 */ 29411 'overscroll-x': [{ 29412 'overscroll-x': scaleOverscroll() 29413 }], 29414 /** 29415 * Overscroll Behavior Y 29416 * @see https://tailwindcss.com/docs/overscroll-behavior 29417 */ 29418 'overscroll-y': [{ 29419 'overscroll-y': scaleOverscroll() 29420 }], 29421 /** 29422 * Position 29423 * @see https://tailwindcss.com/docs/position 29424 */ 29425 position: ['static', 'fixed', 'absolute', 'relative', 'sticky'], 29426 /** 29427 * Top / Right / Bottom / Left 29428 * @see https://tailwindcss.com/docs/top-right-bottom-left 29429 */ 29430 inset: [{ 29431 inset: scaleInset() 29432 }], 29433 /** 29434 * Right / Left 29435 * @see https://tailwindcss.com/docs/top-right-bottom-left 29436 */ 29437 'inset-x': [{ 29438 'inset-x': scaleInset() 29439 }], 29440 /** 29441 * Top / Bottom 29442 * @see https://tailwindcss.com/docs/top-right-bottom-left 29443 */ 29444 'inset-y': [{ 29445 'inset-y': scaleInset() 29446 }], 29447 /** 29448 * Start 29449 * @see https://tailwindcss.com/docs/top-right-bottom-left 29450 */ 29451 start: [{ 29452 start: scaleInset() 29453 }], 29454 /** 29455 * End 29456 * @see https://tailwindcss.com/docs/top-right-bottom-left 29457 */ 29458 end: [{ 29459 end: scaleInset() 29460 }], 29461 /** 29462 * Top 29463 * @see https://tailwindcss.com/docs/top-right-bottom-left 29464 */ 29465 top: [{ 29466 top: scaleInset() 29467 }], 29468 /** 29469 * Right 29470 * @see https://tailwindcss.com/docs/top-right-bottom-left 29471 */ 29472 right: [{ 29473 right: scaleInset() 29474 }], 29475 /** 29476 * Bottom 29477 * @see https://tailwindcss.com/docs/top-right-bottom-left 29478 */ 29479 bottom: [{ 29480 bottom: scaleInset() 29481 }], 29482 /** 29483 * Left 29484 * @see https://tailwindcss.com/docs/top-right-bottom-left 29485 */ 29486 left: [{ 29487 left: scaleInset() 29488 }], 29489 /** 29490 * Visibility 29491 * @see https://tailwindcss.com/docs/visibility 29492 */ 29493 visibility: ['visible', 'invisible', 'collapse'], 29494 /** 29495 * Z-Index 29496 * @see https://tailwindcss.com/docs/z-index 29497 */ 29498 z: [{ 29499 z: [isInteger, 'auto', isArbitraryVariable, isArbitraryValue] 29500 }], 29501 // ------------------------ 29502 // --- Flexbox and Grid --- 29503 // ------------------------ 29504 /** 29505 * Flex Basis 29506 * @see https://tailwindcss.com/docs/flex-basis 29507 */ 29508 basis: [{ 29509 basis: [isFraction, 'full', 'auto', themeContainer, ...scaleUnambiguou
vendor: 5,563 bytes, lines 29509-29723
29509sSpacing()] 29510 }], 29511 /** 29512 * Flex Direction 29513 * @see https://tailwindcss.com/docs/flex-direction 29514 */ 29515 'flex-direction': [{ 29516 flex: ['row', 'row-reverse', 'col', 'col-reverse'] 29517 }], 29518 /** 29519 * Flex Wrap 29520 * @see https://tailwindcss.com/docs/flex-wrap 29521 */ 29522 'flex-wrap': [{ 29523 flex: ['nowrap', 'wrap', 'wrap-reverse'] 29524 }], 29525 /** 29526 * Flex 29527 * @see https://tailwindcss.com/docs/flex 29528 */ 29529 flex: [{ 29530 flex: [isNumber, isFraction, 'auto', 'initial', 'none', isArbitraryValue] 29531 }], 29532 /** 29533 * Flex Grow 29534 * @see https://tailwindcss.com/docs/flex-grow 29535 */ 29536 grow: [{ 29537 grow: ['', isNumber, isArbitraryVariable, isArbitraryValue] 29538 }], 29539 /** 29540 * Flex Shrink 29541 * @see https://tailwindcss.com/docs/flex-shrink 29542 */ 29543 shrink: [{ 29544 shrink: ['', isNumber, isArbitraryVariable, isArbitraryValue] 29545 }], 29546 /** 29547 * Order 29548 * @see https://tailwindcss.com/docs/order 29549 */ 29550 order: [{ 29551 order: [isInteger, 'first', 'last', 'none', isArbitraryVariable, isArbitraryValue] 29552 }], 29553 /** 29554 * Grid Template Columns 29555 * @see https://tailwindcss.com/docs/grid-template-columns 29556 */ 29557 'grid-cols': [{ 29558 'grid-cols': scaleGridTemplateColsRows() 29559 }], 29560 /** 29561 * Grid Column Start / End 29562 * @see https://tailwindcss.com/docs/grid-column 29563 */ 29564 'col-start-end': [{ 29565 col: scaleGridColRowStartAndEnd() 29566 }], 29567 /** 29568 * Grid Column Start 29569 * @see https://tailwindcss.com/docs/grid-column 29570 */ 29571 'col-start': [{ 29572 'col-start': scaleGridColRowStartOrEnd() 29573 }], 29574 /** 29575 * Grid Column End 29576 * @see https://tailwindcss.com/docs/grid-column 29577 */ 29578 'col-end': [{ 29579 'col-end': scaleGridColRowStartOrEnd() 29580 }], 29581 /** 29582 * Grid Template Rows 29583 * @see https://tailwindcss.com/docs/grid-template-rows 29584 */ 29585 'grid-rows': [{ 29586 'grid-rows': scaleGridTemplateColsRows() 29587 }], 29588 /** 29589 * Grid Row Start / End 29590 * @see https://tailwindcss.com/docs/grid-row 29591 */ 29592 'row-start-end': [{ 29593 row: scaleGridColRowStartAndEnd() 29594 }], 29595 /** 29596 * Grid Row Start 29597 * @see https://tailwindcss.com/docs/grid-row 29598 */ 29599 'row-start': [{ 29600 'row-start': scaleGridColRowStartOrEnd() 29601 }], 29602 /** 29603 * Grid Row End 29604 * @see https://tailwindcss.com/docs/grid-row 29605 */ 29606 'row-end': [{ 29607 'row-end': scaleGridColRowStartOrEnd() 29608 }], 29609 /** 29610 * Grid Auto Flow 29611 * @see https://tailwindcss.com/docs/grid-auto-flow 29612 */ 29613 'grid-flow': [{ 29614 'grid-flow': ['row', 'col', 'dense', 'row-dense', 'col-dense'] 29615 }], 29616 /** 29617 * Grid Auto Columns 29618 * @see https://tailwindcss.com/docs/grid-auto-columns 29619 */ 29620 'auto-cols': [{ 29621 'auto-cols': scaleGridAutoColsRows() 29622 }], 29623 /** 29624 * Grid Auto Rows 29625 * @see https://tailwindcss.com/docs/grid-auto-rows 29626 */ 29627 'auto-rows': [{ 29628 'auto-rows': scaleGridAutoColsRows() 29629 }], 29630 /** 29631 * Gap 29632 * @see https://tailwindcss.com/docs/gap 29633 */ 29634 gap: [{ 29635 gap: scaleUnambiguousSpacing() 29636 }], 29637 /** 29638 * Gap X 29639 * @see https://tailwindcss.com/docs/gap 29640 */ 29641 'gap-x': [{ 29642 'gap-x': scaleUnambiguousSpacing() 29643 }], 29644 /** 29645 * Gap Y 29646 * @see https://tailwindcss.com/docs/gap 29647 */ 29648 'gap-y': [{ 29649 'gap-y': scaleUnambiguousSpacing() 29650 }], 29651 /** 29652 * Justify Content 29653 * @see https://tailwindcss.com/docs/justify-content 29654 */ 29655 'justify-content': [{ 29656 justify: [...scaleAlignPrimaryAxis(), 'normal'] 29657 }], 29658 /** 29659 * Justify Items 29660 * @see https://tailwindcss.com/docs/justify-items 29661 */ 29662 'justify-items': [{ 29663 'justify-items': [...scaleAlignSecondaryAxis(), 'normal'] 29664 }], 29665 /** 29666 * Justify Self 29667 * @see https://tailwindcss.com/docs/justify-self 29668 */ 29669 'justify-self': [{ 29670 'justify-self': ['auto', ...scaleAlignSecondaryAxis()] 29671 }], 29672 /** 29673 * Align Content 29674 * @see https://tailwindcss.com/docs/align-content 29675 */ 29676 'align-content': [{ 29677 content: ['normal', ...scaleAlignPrimaryAxis()] 29678 }], 29679 /** 29680 * Align Items 29681 * @see https://tailwindcss.com/docs/align-items 29682 */ 29683 'align-items': [{ 29684 items: [...scaleAlignSecondaryAxis(), { 29685 baseline: ['', 'last'] 29686 }] 29687 }], 29688 /** 29689 * Align Self 29690 * @see https://tailwindcss.com/docs/align-self 29691 */ 29692 'align-self': [{ 29693 self: ['auto', ...scaleAlignSecondaryAxis(), { 29694 baseline: ['', 'last'] 29695 }] 29696 }], 29697 /** 29698 * Place Content 29699 * @see https://tailwindcss.com/docs/place-content 29700 */ 29701 'place-content': [{ 29702 'place-content': scaleAlignPrimaryAxis() 29703 }], 29704 /** 29705 * Place Items 29706 * @see https://tailwindcss.com/docs/place-items 29707 */ 29708 'place-items': [{ 29709 'place-items': [...scaleAlignSecondaryAxis(), 'baseline'] 29710 }], 29711 /** 29712 * Place Self 29713 * @see https://tailwindcss.com/docs/place-self 29714 */ 29715 'place-self': [{ 29716 'place-self': ['auto', ...scaleAlignSecondaryAxis()] 29717 }], 29718 // Spacing 29719 /** 29720 * Padding 29721 * @see https://tailwindcss.com/docs/padding 29722 */ 29723 p: [{
vendor: 23,563 bytes, lines 29724-30589
29724 p: scaleUnambiguousSpacing() 29725 }], 29726 /** 29727 * Padding X 29728 * @see https://tailwindcss.com/docs/padding 29729 */ 29730 px: [{ 29731 px: scaleUnambiguousSpacing() 29732 }], 29733 /** 29734 * Padding Y 29735 * @see https://tailwindcss.com/docs/padding 29736 */ 29737 py: [{ 29738 py: scaleUnambiguousSpacing() 29739 }], 29740 /** 29741 * Padding Start 29742 * @see https://tailwindcss.com/docs/padding 29743 */ 29744 ps: [{ 29745 ps: scaleUnambiguousSpacing() 29746 }], 29747 /** 29748 * Padding End 29749 * @see https://tailwindcss.com/docs/padding 29750 */ 29751 pe: [{ 29752 pe: scaleUnambiguousSpacing() 29753 }], 29754 /** 29755 * Padding Top 29756 * @see https://tailwindcss.com/docs/padding 29757 */ 29758 pt: [{ 29759 pt: scaleUnambiguousSpacing() 29760 }], 29761 /** 29762 * Padding Right 29763 * @see https://tailwindcss.com/docs/padding 29764 */ 29765 pr: [{ 29766 pr: scaleUnambiguousSpacing() 29767 }], 29768 /** 29769 * Padding Bottom 29770 * @see https://tailwindcss.com/docs/padding 29771 */ 29772 pb: [{ 29773 pb: scaleUnambiguousSpacing() 29774 }], 29775 /** 29776 * Padding Left 29777 * @see https://tailwindcss.com/docs/padding 29778 */ 29779 pl: [{ 29780 pl: scaleUnambiguousSpacing() 29781 }], 29782 /** 29783 * Margin 29784 * @see https://tailwindcss.com/docs/margin 29785 */ 29786 m: [{ 29787 m: scaleMargin() 29788 }], 29789 /** 29790 * Margin X 29791 * @see https://tailwindcss.com/docs/margin 29792 */ 29793 mx: [{ 29794 mx: scaleMargin() 29795 }], 29796 /** 29797 * Margin Y 29798 * @see https://tailwindcss.com/docs/margin 29799 */ 29800 my: [{ 29801 my: scaleMargin() 29802 }], 29803 /** 29804 * Margin Start 29805 * @see https://tailwindcss.com/docs/margin 29806 */ 29807 ms: [{ 29808 ms: scaleMargin() 29809 }], 29810 /** 29811 * Margin End 29812 * @see https://tailwindcss.com/docs/margin 29813 */ 29814 me: [{ 29815 me: scaleMargin() 29816 }], 29817 /** 29818 * Margin Top 29819 * @see https://tailwindcss.com/docs/margin 29820 */ 29821 mt: [{ 29822 mt: scaleMargin() 29823 }], 29824 /** 29825 * Margin Right 29826 * @see https://tailwindcss.com/docs/margin 29827 */ 29828 mr: [{ 29829 mr: scaleMargin() 29830 }], 29831 /** 29832 * Margin Bottom 29833 * @see https://tailwindcss.com/docs/margin 29834 */ 29835 mb: [{ 29836 mb: scaleMargin() 29837 }], 29838 /** 29839 * Margin Left 29840 * @see https://tailwindcss.com/docs/margin 29841 */ 29842 ml: [{ 29843 ml: scaleMargin() 29844 }], 29845 /** 29846 * Space Between X 29847 * @see https://tailwindcss.com/docs/margin#adding-space-between-children 29848 */ 29849 'space-x': [{ 29850 'space-x': scaleUnambiguousSpacing() 29851 }], 29852 /** 29853 * Space Between X Reverse 29854 * @see https://tailwindcss.com/docs/margin#adding-space-between-children 29855 */ 29856 'space-x-reverse': ['space-x-reverse'], 29857 /** 29858 * Space Between Y 29859 * @see https://tailwindcss.com/docs/margin#adding-space-between-children 29860 */ 29861 'space-y': [{ 29862 'space-y': scaleUnambiguousSpacing() 29863 }], 29864 /** 29865 * Space Between Y Reverse 29866 * @see https://tailwindcss.com/docs/margin#adding-space-between-children 29867 */ 29868 'space-y-reverse': ['space-y-reverse'], 29869 // -------------- 29870 // --- Sizing --- 29871 // -------------- 29872 /** 29873 * Size 29874 * @see https://tailwindcss.com/docs/width#setting-both-width-and-height 29875 */ 29876 size: [{ 29877 size: scaleSizing() 29878 }], 29879 /** 29880 * Width 29881 * @see https://tailwindcss.com/docs/width 29882 */ 29883 w: [{ 29884 w: [themeContainer, 'screen', ...scaleSizing()] 29885 }], 29886 /** 29887 * Min-Width 29888 * @see https://tailwindcss.com/docs/min-width 29889 */ 29890 'min-w': [{ 29891 'min-w': [themeContainer, 'screen', /** Deprecated. @see https://github.com/tailwindlabs/tailwindcss.com/issues/2027#issuecomment-2620152757 */ 29892 'none', ...scaleSizing()] 29893 }], 29894 /** 29895 * Max-Width 29896 * @see https://tailwindcss.com/docs/max-width 29897 */ 29898 'max-w': [{ 29899 'max-w': [themeContainer, 'screen', 'none', /** Deprecated since Tailwind CSS v4.0.0. @see https://github.com/tailwindlabs/tailwindcss.com/issues/2027#issuecomment-2620152757 */ 29900 'prose', /** Deprecated since Tailwind CSS v4.0.0. @see https://github.com/tailwindlabs/tailwindcss.com/issues/2027#issuecomment-2620152757 */ 29901 { 29902 screen: [themeBreakpoint] 29903 }, ...scaleSizing()] 29904 }], 29905 /** 29906 * Height 29907 * @see https://tailwindcss.com/docs/height 29908 */ 29909 h: [{ 29910 h: ['screen', 'lh', ...scaleSizing()] 29911 }], 29912 /** 29913 * Min-Height 29914 * @see https://tailwindcss.com/docs/min-height 29915 */ 29916 'min-h': [{ 29917 'min-h': ['screen', 'lh', 'none', ...scaleSizing()] 29918 }], 29919 /** 29920 * Max-Height 29921 * @see https://tailwindcss.com/docs/max-height 29922 */ 29923 'max-h': [{ 29924 'max-h': ['screen', 'lh', ...scaleSizing()] 29925 }], 29926 // ------------------ 29927 // --- Typography --- 29928 // ------------------ 29929 /** 29930 * Font Size 29931 * @see https://tailwindcss.com/docs/font-size 29932 */ 29933 'font-size': [{ 29934 text: ['base', themeText, isArbitraryVariableLength, isArbitraryLength] 29935 }], 29936 /** 29937 * Font Smoothing 29938 * @see https://tailwindcss.com/docs/font-smoothing 29939 */ 29940 'font-smoothing': ['antialiased', 'subpixel-antialiased'], 29941 /** 29942 * Font Style 29943 * @see https://tailwindcss.com/docs/font-style 29944 */ 29945 'font-style': ['italic', 'not-italic'], 29946 /** 29947 * Font Weight 29948 * @see https://tailwindcss.com/docs/font-weight 29949 */ 29950 'font-weight': [{ 29951 font: [themeFontWeight, isArbitraryVariable, isArbitraryNumber] 29952 }], 29953 /** 29954 * Font Stretch 29955 * @see https://tailwindcss.com/docs/font-stretch 29956 */ 29957 'font-stretch': [{ 29958 'font-stretch': ['ultra-condensed', 'extra-condensed', 'condensed', 'semi-condensed', 'normal', 'semi-expanded', 'expanded', 'extra-expanded', 'ultra-expanded', isPercent, isArbitraryValue] 29959 }], 29960 /** 29961 * Font Family 29962 * @see https://tailwindcss.com/docs/font-family 29963 */ 29964 'font-family': [{ 29965 font: [isArbitraryVariableFamilyName, isArbitraryValue, themeFont] 29966 }], 29967 /** 29968 * Font Variant Numeric 29969 * @see https://tailwindcss.com/docs/font-variant-numeric 29970 */ 29971 'fvn-normal': ['normal-nums'], 29972 /** 29973 * Font Variant Numeric 29974 * @see https://tailwindcss.com/docs/font-variant-numeric 29975 */ 29976 'fvn-ordinal': ['ordinal'], 29977 /** 29978 * Font Variant Numeric 29979 * @see https://tailwindcss.com/docs/font-variant-numeric 29980 */ 29981 'fvn-slashed-zero': ['slashed-zero'], 29982 /** 29983 * Font Variant Numeric 29984 * @see https://tailwindcss.com/docs/font-variant-numeric 29985 */ 29986 'fvn-figure': ['lining-nums', 'oldstyle-nums'], 29987 /** 29988 * Font Variant Numeric 29989 * @see https://tailwindcss.com/docs/font-variant-numeric 29990 */ 29991 'fvn-spacing': ['proportional-nums', 'tabular-nums'], 29992 /** 29993 * Font Variant Numeric 29994 * @see https://tailwindcss.com/docs/font-variant-numeric 29995 */ 29996 'fvn-fraction': ['diagonal-fractions', 'stacked-fractions'], 29997 /** 29998 * Letter Spacing 29999 * @see https://tailwindcss.com/docs/letter-spacing 30000 */ 30001 tracking: [{ 30002 tracking: [themeTracking, isArbitraryVariable, isArbitraryValue] 30003 }], 30004 /** 30005 * Line Clamp 30006 * @see https://tailwindcss.com/docs/line-clamp 30007 */ 30008 'line-clamp': [{ 30009 'line-clamp': [isNumber, 'none', isArbitraryVariable, isArbitraryNumber] 30010 }], 30011 /** 30012 * Line Height 30013 * @see https://tailwindcss.com/docs/line-height 30014 */ 30015 leading: [{ 30016 leading: [/** Deprecated since Tailwind CSS v4.0.0. @see https://github.com/tailwindlabs/tailwindcss.com/issues/2027#issuecomment-2620152757 */ 30017 themeLeading, ...scaleUnambiguousSpacing()] 30018 }], 30019 /** 30020 * List Style Image 30021 * @see https://tailwindcss.com/docs/list-style-image 30022 */ 30023 'list-image': [{ 30024 'list-image': ['none', isArbitraryVariable, isArbitraryValue] 30025 }], 30026 /** 30027 * List Style Position 30028 * @see https://tailwindcss.com/docs/list-style-position 30029 */ 30030 'list-style-position': [{ 30031 list: ['inside', 'outside'] 30032 }], 30033 /** 30034 * List Style Type 30035 * @see https://tailwindcss.com/docs/list-style-type 30036 */ 30037 'list-style-type': [{ 30038 list: ['disc', 'decimal', 'none', isArbitraryVariable, isArbitraryValue] 30039 }], 30040 /** 30041 * Text Alignment 30042 * @see https://tailwindcss.com/docs/text-align 30043 */ 30044 'text-alignment': [{ 30045 text: ['left', 'center', 'right', 'justify', 'start', 'end'] 30046 }], 30047 /** 30048 * Placeholder Color 30049 * @deprecated since Tailwind CSS v3.0.0 30050 * @see https://v3.tailwindcss.com/docs/placeholder-color 30051 */ 30052 'placeholder-color': [{ 30053 placeholder: scaleColor() 30054 }], 30055 /** 30056 * Text Color 30057 * @see https://tailwindcss.com/docs/text-color 30058 */ 30059 'text-color': [{ 30060 text: scaleColor() 30061 }], 30062 /** 30063 * Text Decoration 30064 * @see https://tailwindcss.com/docs/text-decoration 30065 */ 30066 'text-decoration': ['underline', 'overline', 'line-through', 'no-underline'], 30067 /** 30068 * Text Decoration Style 30069 * @see https://tailwindcss.com/docs/text-decoration-style 30070 */ 30071 'text-decoration-style': [{ 30072 decoration: [...scaleLineStyle(), 'wavy'] 30073 }], 30074 /** 30075 * Text Decoration Thickness 30076 * @see https://tailwindcss.com/docs/text-decoration-thickness 30077 */ 30078 'text-decoration-thickness': [{ 30079 decoration: [isNumber, 'from-font', 'auto', isArbitraryVariable, isArbitraryLength] 30080 }], 30081 /** 30082 * Text Decoration Color 30083 * @see https://tailwindcss.com/docs/text-decoration-color 30084 */ 30085 'text-decoration-color': [{ 30086 decoration: scaleColor() 30087 }], 30088 /** 30089 * Text Underline Offset 30090 * @see https://tailwindcss.com/docs/text-underline-offset 30091 */ 30092 'underline-offset': [{ 30093 'underline-offset': [isNumber, 'auto', isArbitraryVariable, isArbitraryValue] 30094 }], 30095 /** 30096 * Text Transform 30097 * @see https://tailwindcss.com/docs/text-transform 30098 */ 30099 'text-transform': ['uppercase', 'lowercase', 'capitalize', 'normal-case'], 30100 /** 30101 * Text Overflow 30102 * @see https://tailwindcss.com/docs/text-overflow 30103 */ 30104 'text-overflow': ['truncate', 'text-ellipsis', 'text-clip'], 30105 /** 30106 * Text Wrap 30107 * @see https://tailwindcss.com/docs/text-wrap 30108 */ 30109 'text-wrap': [{ 30110 text: ['wrap', 'nowrap', 'balance', 'pretty'] 30111 }], 30112 /** 30113 * Text Indent 30114 * @see https://tailwindcss.com/docs/text-indent 30115 */ 30116 indent: [{ 30117 indent: scaleUnambiguousSpacing() 30118 }], 30119 /** 30120 * Vertical Alignment 30121 * @see https://tailwindcss.com/docs/vertical-align 30122 */ 30123 'vertical-align': [{ 30124 align: ['baseline', 'top', 'middle', 'bottom', 'text-top', 'text-bottom', 'sub', 'super', isArbitraryVariable, isArbitraryValue] 30125 }], 30126 /** 30127 * Whitespace 30128 * @see https://tailwindcss.com/docs/whitespace 30129 */ 30130 whitespace: [{ 30131 whitespace: ['normal', 'nowrap', 'pre', 'pre-line', 'pre-wrap', 'break-spaces'] 30132 }], 30133 /** 30134 * Word Break 30135 * @see https://tailwindcss.com/docs/word-break 30136 */ 30137 break: [{ 30138 break: ['normal', 'words', 'all', 'keep'] 30139 }], 30140 /** 30141 * Overflow Wrap 30142 * @see https://tailwindcss.com/docs/overflow-wrap 30143 */ 30144 wrap: [{ 30145 wrap: ['break-word', 'anywhere', 'normal'] 30146 }], 30147 /** 30148 * Hyphens 30149 * @see https://tailwindcss.com/docs/hyphens 30150 */ 30151 hyphens: [{ 30152 hyphens: ['none', 'manual', 'auto'] 30153 }], 30154 /** 30155 * Content 30156 * @see https://tailwindcss.com/docs/content 30157 */ 30158 content: [{ 30159 content: ['none', isArbitraryVariable, isArbitraryValue] 30160 }], 30161 // ------------------- 30162 // --- Backgrounds --- 30163 // ------------------- 30164 /** 30165 * Background Attachment 30166 * @see https://tailwindcss.com/docs/background-attachment 30167 */ 30168 'bg-attachment': [{ 30169 bg: ['fixed', 'local', 'scroll'] 30170 }], 30171 /** 30172 * Background Clip 30173 * @see https://tailwindcss.com/docs/background-clip 30174 */ 30175 'bg-clip': [{ 30176 'bg-clip': ['border', 'padding', 'content', 'text'] 30177 }], 30178 /** 30179 * Background Origin 30180 * @see https://tailwindcss.com/docs/background-origin 30181 */ 30182 'bg-origin': [{ 30183 'bg-origin': ['border', 'padding', 'content'] 30184 }], 30185 /** 30186 * Background Position 30187 * @see https://tailwindcss.com/docs/background-position 30188 */ 30189 'bg-position': [{ 30190 bg: scaleBgPosition() 30191 }], 30192 /** 30193 * Background Repeat 30194 * @see https://tailwindcss.com/docs/background-repeat 30195 */ 30196 'bg-repeat': [{ 30197 bg: scaleBgRepeat() 30198 }], 30199 /** 30200 * Background Size 30201 * @see https://tailwindcss.com/docs/background-size 30202 */ 30203 'bg-size': [{ 30204 bg: scaleBgSize() 30205 }], 30206 /** 30207 * Background Image 30208 * @see https://tailwindcss.com/docs/background-image 30209 */ 30210 'bg-image': [{ 30211 bg: ['none', { 30212 linear: [{ 30213 to: ['t', 'tr', 'r', 'br', 'b', 'bl', 'l', 'tl'] 30214 }, isInteger, isArbitraryVariable, isArbitraryValue], 30215 radial: ['', isArbitraryVariable, isArbitraryValue], 30216 conic: [isInteger, isArbitraryVariable, isArbitraryValue] 30217 }, isArbitraryVariableImage, isArbitraryImage] 30218 }], 30219 /** 30220 * Background Color 30221 * @see https://tailwindcss.com/docs/background-color 30222 */ 30223 'bg-color': [{ 30224 bg: scaleColor() 30225 }], 30226 /** 30227 * Gradient Color Stops From Position 30228 * @see https://tailwindcss.com/docs/gradient-color-stops 30229 */ 30230 'gradient-from-pos': [{ 30231 from: scaleGradientStopPosition() 30232 }], 30233 /** 30234 * Gradient Color Stops Via Position 30235 * @see https://tailwindcss.com/docs/gradient-color-stops 30236 */ 30237 'gradient-via-pos': [{ 30238 via: scaleGradientStopPosition() 30239 }], 30240 /** 30241 * Gradient Color Stops To Position 30242 * @see https://tailwindcss.com/docs/gradient-color-stops 30243 */ 30244 'gradient-to-pos': [{ 30245 to: scaleGradientStopPosition() 30246 }], 30247 /** 30248 * Gradient Color Stops From 30249 * @see https://tailwindcss.com/docs/gradient-color-stops 30250 */ 30251 'gradient-from': [{ 30252 from: scaleColor() 30253 }], 30254 /** 30255 * Gradient Color Stops Via 30256 * @see https://tailwindcss.com/docs/gradient-color-stops 30257 */ 30258 'gradient-via': [{ 30259 via: scaleColor() 30260 }], 30261 /** 30262 * Gradient Color Stops To 30263 * @see https://tailwindcss.com/docs/gradient-color-stops 30264 */ 30265 'gradient-to': [{ 30266 to: scaleColor() 30267 }], 30268 // --------------- 30269 // --- Borders --- 30270 // --------------- 30271 /** 30272 * Border Radius 30273 * @see https://tailwindcss.com/docs/border-radius 30274 */ 30275 rounded: [{ 30276 rounded: scaleRadius() 30277 }], 30278 /** 30279 * Border Radius Start 30280 * @see https://tailwindcss.com/docs/border-radius 30281 */ 30282 'rounded-s': [{ 30283 'rounded-s': scaleRadius() 30284 }], 30285 /** 30286 * Border Radius End 30287 * @see https://tailwindcss.com/docs/border-radius 30288 */ 30289 'rounded-e': [{ 30290 'rounded-e': scaleRadius() 30291 }], 30292 /** 30293 * Border Radius Top 30294 * @see https://tailwindcss.com/docs/border-radius 30295 */ 30296 'rounded-t': [{ 30297 'rounded-t': scaleRadius() 30298 }], 30299 /** 30300 * Border Radius Right 30301 * @see https://tailwindcss.com/docs/border-radius 30302 */ 30303 'rounded-r': [{ 30304 'rounded-r': scaleRadius() 30305 }], 30306 /** 30307 * Border Radius Bottom 30308 * @see https://tailwindcss.com/docs/border-radius 30309 */ 30310 'rounded-b': [{ 30311 'rounded-b': scaleRadius() 30312 }], 30313 /** 30314 * Border Radius Left 30315 * @see https://tailwindcss.com/docs/border-radius 30316 */ 30317 'rounded-l': [{ 30318 'rounded-l': scaleRadius() 30319 }], 30320 /** 30321 * Border Radius Start Start 30322 * @see https://tailwindcss.com/docs/border-radius 30323 */ 30324 'rounded-ss': [{ 30325 'rounded-ss': scaleRadius() 30326 }], 30327 /** 30328 * Border Radius Start End 30329 * @see https://tailwindcss.com/docs/border-radius 30330 */ 30331 'rounded-se': [{ 30332 'rounded-se': scaleRadius() 30333 }], 30334 /** 30335 * Border Radius End End 30336 * @see https://tailwindcss.com/docs/border-radius 30337 */ 30338 'rounded-ee': [{ 30339 'rounded-ee': scaleRadius() 30340 }], 30341 /** 30342 * Border Radius End Start 30343 * @see https://tailwindcss.com/docs/border-radius 30344 */ 30345 'rounded-es': [{ 30346 'rounded-es': scaleRadius() 30347 }], 30348 /** 30349 * Border Radius Top Left 30350 * @see https://tailwindcss.com/docs/border-radius 30351 */ 30352 'rounded-tl': [{ 30353 'rounded-tl': scaleRadius() 30354 }], 30355 /** 30356 * Border Radius Top Right 30357 * @see https://tailwindcss.com/docs/border-radius 30358 */ 30359 'rounded-tr': [{ 30360 'rounded-tr': scaleRadius() 30361 }], 30362 /** 30363 * Border Radius Bottom Right 30364 * @see https://tailwindcss.com/docs/border-radius 30365 */ 30366 'rounded-br': [{ 30367 'rounded-br': scaleRadius() 30368 }], 30369 /** 30370 * Border Radius Bottom Left 30371 * @see https://tailwindcss.com/docs/border-radius 30372 */ 30373 'rounded-bl': [{ 30374 'rounded-bl': scaleRadius() 30375 }], 30376 /** 30377 * Border Width 30378 * @see https://tailwindcss.com/docs/border-width 30379 */ 30380 'border-w': [{ 30381 border: scaleBorderWidth() 30382 }], 30383 /** 30384 * Border Width X 30385 * @see https://tailwindcss.com/docs/border-width 30386 */ 30387 'border-w-x': [{ 30388 'border-x': scaleBorderWidth() 30389 }], 30390 /** 30391 * Border Width Y 30392 * @see https://tailwindcss.com/docs/border-width 30393 */ 30394 'border-w-y': [{ 30395 'border-y': scaleBorderWidth() 30396 }], 30397 /** 30398 * Border Width Start 30399 * @see https://tailwindcss.com/docs/border-width 30400 */ 30401 'border-w-s': [{ 30402 'border-s': scaleBorderWidth() 30403 }], 30404 /** 30405 * Border Width End 30406 * @see https://tailwindcss.com/docs/border-width 30407 */ 30408 'border-w-e': [{ 30409 'border-e': scaleBorderWidth() 30410 }], 30411 /** 30412 * Border Width Top 30413 * @see https://tailwindcss.com/docs/border-width 30414 */ 30415 'border-w-t': [{ 30416 'border-t': scaleBorderWidth() 30417 }], 30418 /** 30419 * Border Width Right 30420 * @see https://tailwindcss.com/docs/border-width 30421 */ 30422 'border-w-r': [{ 30423 'border-r': scaleBorderWidth() 30424 }], 30425 /** 30426 * Border Width Bottom 30427 * @see https://tailwindcss.com/docs/border-width 30428 */ 30429 'border-w-b': [{ 30430 'border-b': scaleBorderWidth() 30431 }], 30432 /** 30433 * Border Width Left 30434 * @see https://tailwindcss.com/docs/border-width 30435 */ 30436 'border-w-l': [{ 30437 'border-l': scaleBorderWidth() 30438 }], 30439 /** 30440 * Divide Width X 30441 * @see https://tailwindcss.com/docs/border-width#between-children 30442 */ 30443 'divide-x': [{ 30444 'divide-x': scaleBorderWidth() 30445 }], 30446 /** 30447 * Divide Width X Reverse 30448 * @see https://tailwindcss.com/docs/border-width#between-children 30449 */ 30450 'divide-x-reverse': ['divide-x-reverse'], 30451 /** 30452 * Divide Width Y 30453 * @see https://tailwindcss.com/docs/border-width#between-children 30454 */ 30455 'divide-y': [{ 30456 'divide-y': scaleBorderWidth() 30457 }], 30458 /** 30459 * Divide Width Y Reverse 30460 * @see https://tailwindcss.com/docs/border-width#between-children 30461 */ 30462 'divide-y-reverse': ['divide-y-reverse'], 30463 /** 30464 * Border Style 30465 * @see https://tailwindcss.com/docs/border-style 30466 */ 30467 'border-style': [{ 30468 border: [...scaleLineStyle(), 'hidden', 'none'] 30469 }], 30470 /** 30471 * Divide Style 30472 * @see https://tailwindcss.com/docs/border-style#setting-the-divider-style 30473 */ 30474 'divide-style': [{ 30475 divide: [...scaleLineStyle(), 'hidden', 'none'] 30476 }], 30477 /** 30478 * Border Color 30479 * @see https://tailwindcss.com/docs/border-color 30480 */ 30481 'border-color': [{ 30482 border: scaleColor() 30483 }], 30484 /** 30485 * Border Color X 30486 * @see https://tailwindcss.com/docs/border-color 30487 */ 30488 'border-color-x': [{ 30489 'border-x': scaleColor() 30490 }], 30491 /** 30492 * Border Color Y 30493 * @see https://tailwindcss.com/docs/border-color 30494 */ 30495 'border-color-y': [{ 30496 'border-y': scaleColor() 30497 }], 30498 /** 30499 * Border Color S 30500 * @see https://tailwindcss.com/docs/border-color 30501 */ 30502 'border-color-s': [{ 30503 'border-s': scaleColor() 30504 }], 30505 /** 30506 * Border Color E 30507 * @see https://tailwindcss.com/docs/border-color 30508 */ 30509 'border-color-e': [{ 30510 'border-e': scaleColor() 30511 }], 30512 /** 30513 * Border Color Top 30514 * @see https://tailwindcss.com/docs/border-color 30515 */ 30516 'border-color-t': [{ 30517 'border-t': scaleColor() 30518 }], 30519 /** 30520 * Border Color Right 30521 * @see https://tailwindcss.com/docs/border-color 30522 */ 30523 'border-color-r': [{ 30524 'border-r': scaleColor() 30525 }], 30526 /** 30527 * Border Color Bottom 30528 * @see https://tailwindcss.com/docs/border-color 30529 */ 30530 'border-color-b': [{ 30531 'border-b': scaleColor() 30532 }], 30533 /** 30534 * Border Color Left 30535 * @see https://tailwindcss.com/docs/border-color 30536 */ 30537 'border-color-l': [{ 30538 'border-l': scaleColor() 30539 }], 30540 /** 30541 * Divide Color 30542 * @see https://tailwindcss.com/docs/divide-color 30543 */ 30544 'divide-color': [{ 30545 divide: scaleColor() 30546 }], 30547 /** 30548 * Outline Style 30549 * @see https://tailwindcss.com/docs/outline-style 30550 */ 30551 'outline-style': [{ 30552 outline: [...scaleLineStyle(), 'none', 'hidden'] 30553 }], 30554 /** 30555 * Outline Offset 30556 * @see https://tailwindcss.com/docs/outline-offset 30557 */ 30558 'outline-offset': [{ 30559 'outline-offset': [isNumber, isArbitraryVariable, isArbitraryValue] 30560 }], 30561 /** 30562 * Outline Width 30563 * @see https://tailwindcss.com/docs/outline-width 30564 */ 30565 'outline-w': [{ 30566 outline: ['', isNumber, isArbitraryVariableLength, isArbitraryLength] 30567 }], 30568 /** 30569 * Outline Color 30570 * @see https://tailwindcss.com/docs/outline-color 30571 */ 30572 'outline-color': [{ 30573 outline: scaleColor() 30574 }], 30575 // --------------- 30576 // --- Effects --- 30577 // --------------- 30578 /** 30579 * Box Shadow 30580 * @see https://tailwindcss.com/docs/box-shadow 30581 */ 30582 shadow: [{ 30583 shadow: [ 30584 // Deprecated since Tailwind CSS v4.0.0 30585 '', 'none', themeShadow, isArbitraryVariableShadow, isArbitraryShadow] 30586 }], 30587 /** 30588 * Box Shadow Color 30589 * @see https://tailwindcss.com/docs/box-shadow#setting-the-sh
vendor: 20,581 bytes, lines 30589-31329
30589adow-color 30590 */ 30591 'shadow-color': [{ 30592 shadow: scaleColor() 30593 }], 30594 /** 30595 * Inset Box Shadow 30596 * @see https://tailwindcss.com/docs/box-shadow#adding-an-inset-shadow 30597 */ 30598 'inset-shadow': [{ 30599 'inset-shadow': ['none', themeInsetShadow, isArbitraryVariableShadow, isArbitraryShadow] 30600 }], 30601 /** 30602 * Inset Box Shadow Color 30603 * @see https://tailwindcss.com/docs/box-shadow#setting-the-inset-shadow-color 30604 */ 30605 'inset-shadow-color': [{ 30606 'inset-shadow': scaleColor() 30607 }], 30608 /** 30609 * Ring Width 30610 * @see https://tailwindcss.com/docs/box-shadow#adding-a-ring 30611 */ 30612 'ring-w': [{ 30613 ring: scaleBorderWidth() 30614 }], 30615 /** 30616 * Ring Width Inset 30617 * @see https://v3.tailwindcss.com/docs/ring-width#inset-rings 30618 * @deprecated since Tailwind CSS v4.0.0 30619 * @see https://github.com/tailwindlabs/tailwindcss/blob/v4.0.0/packages/tailwindcss/src/utilities.ts#L4158 30620 */ 30621 'ring-w-inset': ['ring-inset'], 30622 /** 30623 * Ring Color 30624 * @see https://tailwindcss.com/docs/box-shadow#setting-the-ring-color 30625 */ 30626 'ring-color': [{ 30627 ring: scaleColor() 30628 }], 30629 /** 30630 * Ring Offset Width 30631 * @see https://v3.tailwindcss.com/docs/ring-offset-width 30632 * @deprecated since Tailwind CSS v4.0.0 30633 * @see https://github.com/tailwindlabs/tailwindcss/blob/v4.0.0/packages/tailwindcss/src/utilities.ts#L4158 30634 */ 30635 'ring-offset-w': [{ 30636 'ring-offset': [isNumber, isArbitraryLength] 30637 }], 30638 /** 30639 * Ring Offset Color 30640 * @see https://v3.tailwindcss.com/docs/ring-offset-color 30641 * @deprecated since Tailwind CSS v4.0.0 30642 * @see https://github.com/tailwindlabs/tailwindcss/blob/v4.0.0/packages/tailwindcss/src/utilities.ts#L4158 30643 */ 30644 'ring-offset-color': [{ 30645 'ring-offset': scaleColor() 30646 }], 30647 /** 30648 * Inset Ring Width 30649 * @see https://tailwindcss.com/docs/box-shadow#adding-an-inset-ring 30650 */ 30651 'inset-ring-w': [{ 30652 'inset-ring': scaleBorderWidth() 30653 }], 30654 /** 30655 * Inset Ring Color 30656 * @see https://tailwindcss.com/docs/box-shadow#setting-the-inset-ring-color 30657 */ 30658 'inset-ring-color': [{ 30659 'inset-ring': scaleColor() 30660 }], 30661 /** 30662 * Text Shadow 30663 * @see https://tailwindcss.com/docs/text-shadow 30664 */ 30665 'text-shadow': [{ 30666 'text-shadow': ['none', themeTextShadow, isArbitraryVariableShadow, isArbitraryShadow] 30667 }], 30668 /** 30669 * Text Shadow Color 30670 * @see https://tailwindcss.com/docs/text-shadow#setting-the-shadow-color 30671 */ 30672 'text-shadow-color': [{ 30673 'text-shadow': scaleColor() 30674 }], 30675 /** 30676 * Opacity 30677 * @see https://tailwindcss.com/docs/opacity 30678 */ 30679 opacity: [{ 30680 opacity: [isNumber, isArbitraryVariable, isArbitraryValue] 30681 }], 30682 /** 30683 * Mix Blend Mode 30684 * @see https://tailwindcss.com/docs/mix-blend-mode 30685 */ 30686 'mix-blend': [{ 30687 'mix-blend': [...scaleBlendMode(), 'plus-darker', 'plus-lighter'] 30688 }], 30689 /** 30690 * Background Blend Mode 30691 * @see https://tailwindcss.com/docs/background-blend-mode 30692 */ 30693 'bg-blend': [{ 30694 'bg-blend': scaleBlendMode() 30695 }], 30696 /** 30697 * Mask Clip 30698 * @see https://tailwindcss.com/docs/mask-clip 30699 */ 30700 'mask-clip': [{ 30701 'mask-clip': ['border', 'padding', 'content', 'fill', 'stroke', 'view'] 30702 }, 'mask-no-clip'], 30703 /** 30704 * Mask Composite 30705 * @see https://tailwindcss.com/docs/mask-composite 30706 */ 30707 'mask-composite': [{ 30708 mask: ['add', 'subtract', 'intersect', 'exclude'] 30709 }], 30710 /** 30711 * Mask Image 30712 * @see https://tailwindcss.com/docs/mask-image 30713 */ 30714 'mask-image-linear-pos': [{ 30715 'mask-linear': [isNumber] 30716 }], 30717 'mask-image-linear-from-pos': [{ 30718 'mask-linear-from': scaleMaskImagePosition() 30719 }], 30720 'mask-image-linear-to-pos': [{ 30721 'mask-linear-to': scaleMaskImagePosition() 30722 }], 30723 'mask-image-linear-from-color': [{ 30724 'mask-linear-from': scaleColor() 30725 }], 30726 'mask-image-linear-to-color': [{ 30727 'mask-linear-to': scaleColor() 30728 }], 30729 'mask-image-t-from-pos': [{ 30730 'mask-t-from': scaleMaskImagePosition() 30731 }], 30732 'mask-image-t-to-pos': [{ 30733 'mask-t-to': scaleMaskImagePosition() 30734 }], 30735 'mask-image-t-from-color': [{ 30736 'mask-t-from': scaleColor() 30737 }], 30738 'mask-image-t-to-color': [{ 30739 'mask-t-to': scaleColor() 30740 }], 30741 'mask-image-r-from-pos': [{ 30742 'mask-r-from': scaleMaskImagePosition() 30743 }], 30744 'mask-image-r-to-pos': [{ 30745 'mask-r-to': scaleMaskImagePosition() 30746 }], 30747 'mask-image-r-from-color': [{ 30748 'mask-r-from': scaleColor() 30749 }], 30750 'mask-image-r-to-color': [{ 30751 'mask-r-to': scaleColor() 30752 }], 30753 'mask-image-b-from-pos': [{ 30754 'mask-b-from': scaleMaskImagePosition() 30755 }], 30756 'mask-image-b-to-pos': [{ 30757 'mask-b-to': scaleMaskImagePosition() 30758 }], 30759 'mask-image-b-from-color': [{ 30760 'mask-b-from': scaleColor() 30761 }], 30762 'mask-image-b-to-color': [{ 30763 'mask-b-to': scaleColor() 30764 }], 30765 'mask-image-l-from-pos': [{ 30766 'mask-l-from': scaleMaskImagePosition() 30767 }], 30768 'mask-image-l-to-pos': [{ 30769 'mask-l-to': scaleMaskImagePosition() 30770 }], 30771 'mask-image-l-from-color': [{ 30772 'mask-l-from': scaleColor() 30773 }], 30774 'mask-image-l-to-color': [{ 30775 'mask-l-to': scaleColor() 30776 }], 30777 'mask-image-x-from-pos': [{ 30778 'mask-x-from': scaleMaskImagePosition() 30779 }], 30780 'mask-image-x-to-pos': [{ 30781 'mask-x-to': scaleMaskImagePosition() 30782 }], 30783 'mask-image-x-from-color': [{ 30784 'mask-x-from': scaleColor() 30785 }], 30786 'mask-image-x-to-color': [{ 30787 'mask-x-to': scaleColor() 30788 }], 30789 'mask-image-y-from-pos': [{ 30790 'mask-y-from': scaleMaskImagePosition() 30791 }], 30792 'mask-image-y-to-pos': [{ 30793 'mask-y-to': scaleMaskImagePosition() 30794 }], 30795 'mask-image-y-from-color': [{ 30796 'mask-y-from': scaleColor() 30797 }], 30798 'mask-image-y-to-color': [{ 30799 'mask-y-to': scaleColor() 30800 }], 30801 'mask-image-radial': [{ 30802 'mask-radial': [isArbitraryVariable, isArbitraryValue] 30803 }], 30804 'mask-image-radial-from-pos': [{ 30805 'mask-radial-from': scaleMaskImagePosition() 30806 }], 30807 'mask-image-radial-to-pos': [{ 30808 'mask-radial-to': scaleMaskImagePosition() 30809 }], 30810 'mask-image-radial-from-color': [{ 30811 'mask-radial-from': scaleColor() 30812 }], 30813 'mask-image-radial-to-color': [{ 30814 'mask-radial-to': scaleColor() 30815 }], 30816 'mask-image-radial-shape': [{ 30817 'mask-radial': ['circle', 'ellipse'] 30818 }], 30819 'mask-image-radial-size': [{ 30820 'mask-radial': [{ 30821 closest: ['side', 'corner'], 30822 farthest: ['side', 'corner'] 30823 }] 30824 }], 30825 'mask-image-radial-pos': [{ 30826 'mask-radial-at': scalePosition() 30827 }], 30828 'mask-image-conic-pos': [{ 30829 'mask-conic': [isNumber] 30830 }], 30831 'mask-image-conic-from-pos': [{ 30832 'mask-conic-from': scaleMaskImagePosition() 30833 }], 30834 'mask-image-conic-to-pos': [{ 30835 'mask-conic-to': scaleMaskImagePosition() 30836 }], 30837 'mask-image-conic-from-color': [{ 30838 'mask-conic-from': scaleColor() 30839 }], 30840 'mask-image-conic-to-color': [{ 30841 'mask-conic-to': scaleColor() 30842 }], 30843 /** 30844 * Mask Mode 30845 * @see https://tailwindcss.com/docs/mask-mode 30846 */ 30847 'mask-mode': [{ 30848 mask: ['alpha', 'luminance', 'match'] 30849 }], 30850 /** 30851 * Mask Origin 30852 * @see https://tailwindcss.com/docs/mask-origin 30853 */ 30854 'mask-origin': [{ 30855 'mask-origin': ['border', 'padding', 'content', 'fill', 'stroke', 'view'] 30856 }], 30857 /** 30858 * Mask Position 30859 * @see https://tailwindcss.com/docs/mask-position 30860 */ 30861 'mask-position': [{ 30862 mask: scaleBgPosition() 30863 }], 30864 /** 30865 * Mask Repeat 30866 * @see https://tailwindcss.com/docs/mask-repeat 30867 */ 30868 'mask-repeat': [{ 30869 mask: scaleBgRepeat() 30870 }], 30871 /** 30872 * Mask Size 30873 * @see https://tailwindcss.com/docs/mask-size 30874 */ 30875 'mask-size': [{ 30876 mask: scaleBgSize() 30877 }], 30878 /** 30879 * Mask Type 30880 * @see https://tailwindcss.com/docs/mask-type 30881 */ 30882 'mask-type': [{ 30883 'mask-type': ['alpha', 'luminance'] 30884 }], 30885 /** 30886 * Mask Image 30887 * @see https://tailwindcss.com/docs/mask-image 30888 */ 30889 'mask-image': [{ 30890 mask: ['none', isArbitraryVariable, isArbitraryValue] 30891 }], 30892 // --------------- 30893 // --- Filters --- 30894 // --------------- 30895 /** 30896 * Filter 30897 * @see https://tailwindcss.com/docs/filter 30898 */ 30899 filter: [{ 30900 filter: [ 30901 // Deprecated since Tailwind CSS v3.0.0 30902 '', 'none', isArbitraryVariable, isArbitraryValue] 30903 }], 30904 /** 30905 * Blur 30906 * @see https://tailwindcss.com/docs/blur 30907 */ 30908 blur: [{ 30909 blur: scaleBlur() 30910 }], 30911 /** 30912 * Brightness 30913 * @see https://tailwindcss.com/docs/brightness 30914 */ 30915 brightness: [{ 30916 brightness: [isNumber, isArbitraryVariable, isArbitraryValue] 30917 }], 30918 /** 30919 * Contrast 30920 * @see https://tailwindcss.com/docs/contrast 30921 */ 30922 contrast: [{ 30923 contrast: [isNumber, isArbitraryVariable, isArbitraryValue] 30924 }], 30925 /** 30926 * Drop Shadow 30927 * @see https://tailwindcss.com/docs/drop-shadow 30928 */ 30929 'drop-shadow': [{ 30930 'drop-shadow': [ 30931 // Deprecated since Tailwind CSS v4.0.0 30932 '', 'none', themeDropShadow, isArbitraryVariableShadow, isArbitraryShadow] 30933 }], 30934 /** 30935 * Drop Shadow Color 30936 * @see https://tailwindcss.com/docs/filter-drop-shadow#setting-the-shadow-color 30937 */ 30938 'drop-shadow-color': [{ 30939 'drop-shadow': scaleColor() 30940 }], 30941 /** 30942 * Grayscale 30943 * @see https://tailwindcss.com/docs/grayscale 30944 */ 30945 grayscale: [{ 30946 grayscale: ['', isNumber, isArbitraryVariable, isArbitraryValue] 30947 }], 30948 /** 30949 * Hue Rotate 30950 * @see https://tailwindcss.com/docs/hue-rotate 30951 */ 30952 'hue-rotate': [{ 30953 'hue-rotate': [isNumber, isArbitraryVariable, isArbitraryValue] 30954 }], 30955 /** 30956 * Invert 30957 * @see https://tailwindcss.com/docs/invert 30958 */ 30959 invert: [{ 30960 invert: ['', isNumber, isArbitraryVariable, isArbitraryValue] 30961 }], 30962 /** 30963 * Saturate 30964 * @see https://tailwindcss.com/docs/saturate 30965 */ 30966 saturate: [{ 30967 saturate: [isNumber, isArbitraryVariable, isArbitraryValue] 30968 }], 30969 /** 30970 * Sepia 30971 * @see https://tailwindcss.com/docs/sepia 30972 */ 30973 sepia: [{ 30974 sepia: ['', isNumber, isArbitraryVariable, isArbitraryValue] 30975 }], 30976 /** 30977 * Backdrop Filter 30978 * @see https://tailwindcss.com/docs/backdrop-filter 30979 */ 30980 'backdrop-filter': [{ 30981 'backdrop-filter': [ 30982 // Deprecated since Tailwind CSS v3.0.0 30983 '', 'none', isArbitraryVariable, isArbitraryValue] 30984 }], 30985 /** 30986 * Backdrop Blur 30987 * @see https://tailwindcss.com/docs/backdrop-blur 30988 */ 30989 'backdrop-blur': [{ 30990 'backdrop-blur': scaleBlur() 30991 }], 30992 /** 30993 * Backdrop Brightness 30994 * @see https://tailwindcss.com/docs/backdrop-brightness 30995 */ 30996 'backdrop-brightness': [{ 30997 'backdrop-brightness': [isNumber, isArbitraryVariable, isArbitraryValue] 30998 }], 30999 /** 31000 * Backdrop Contrast 31001 * @see https://tailwindcss.com/docs/backdrop-contrast 31002 */ 31003 'backdrop-contrast': [{ 31004 'backdrop-contrast': [isNumber, isArbitraryVariable, isArbitraryValue] 31005 }], 31006 /** 31007 * Backdrop Grayscale 31008 * @see https://tailwindcss.com/docs/backdrop-grayscale 31009 */ 31010 'backdrop-grayscale': [{ 31011 'backdrop-grayscale': ['', isNumber, isArbitraryVariable, isArbitraryValue] 31012 }], 31013 /** 31014 * Backdrop Hue Rotate 31015 * @see https://tailwindcss.com/docs/backdrop-hue-rotate 31016 */ 31017 'backdrop-hue-rotate': [{ 31018 'backdrop-hue-rotate': [isNumber, isArbitraryVariable, isArbitraryValue] 31019 }], 31020 /** 31021 * Backdrop Invert 31022 * @see https://tailwindcss.com/docs/backdrop-invert 31023 */ 31024 'backdrop-invert': [{ 31025 'backdrop-invert': ['', isNumber, isArbitraryVariable, isArbitraryValue] 31026 }], 31027 /** 31028 * Backdrop Opacity 31029 * @see https://tailwindcss.com/docs/backdrop-opacity 31030 */ 31031 'backdrop-opacity': [{ 31032 'backdrop-opacity': [isNumber, isArbitraryVariable, isArbitraryValue] 31033 }], 31034 /** 31035 * Backdrop Saturate 31036 * @see https://tailwindcss.com/docs/backdrop-saturate 31037 */ 31038 'backdrop-saturate': [{ 31039 'backdrop-saturate': [isNumber, isArbitraryVariable, isArbitraryValue] 31040 }], 31041 /** 31042 * Backdrop Sepia 31043 * @see https://tailwindcss.com/docs/backdrop-sepia 31044 */ 31045 'backdrop-sepia': [{ 31046 'backdrop-sepia': ['', isNumber, isArbitraryVariable, isArbitraryValue] 31047 }], 31048 // -------------- 31049 // --- Tables --- 31050 // -------------- 31051 /** 31052 * Border Collapse 31053 * @see https://tailwindcss.com/docs/border-collapse 31054 */ 31055 'border-collapse': [{ 31056 border: ['collapse', 'separate'] 31057 }], 31058 /** 31059 * Border Spacing 31060 * @see https://tailwindcss.com/docs/border-spacing 31061 */ 31062 'border-spacing': [{ 31063 'border-spacing': scaleUnambiguousSpacing() 31064 }], 31065 /** 31066 * Border Spacing X 31067 * @see https://tailwindcss.com/docs/border-spacing 31068 */ 31069 'border-spacing-x': [{ 31070 'border-spacing-x': scaleUnambiguousSpacing() 31071 }], 31072 /** 31073 * Border Spacing Y 31074 * @see https://tailwindcss.com/docs/border-spacing 31075 */ 31076 'border-spacing-y': [{ 31077 'border-spacing-y': scaleUnambiguousSpacing() 31078 }], 31079 /** 31080 * Table Layout 31081 * @see https://tailwindcss.com/docs/table-layout 31082 */ 31083 'table-layout': [{ 31084 table: ['auto', 'fixed'] 31085 }], 31086 /** 31087 * Caption Side 31088 * @see https://tailwindcss.com/docs/caption-side 31089 */ 31090 caption: [{ 31091 caption: ['top', 'bottom'] 31092 }], 31093 // --------------------------------- 31094 // --- Transitions and Animation --- 31095 // --------------------------------- 31096 /** 31097 * Transition Property 31098 * @see https://tailwindcss.com/docs/transition-property 31099 */ 31100 transition: [{ 31101 transition: ['', 'all', 'colors', 'opacity', 'shadow', 'transform', 'none', isArbitraryVariable, isArbitraryValue] 31102 }], 31103 /** 31104 * Transition Behavior 31105 * @see https://tailwindcss.com/docs/transition-behavior 31106 */ 31107 'transition-behavior': [{ 31108 transition: ['normal', 'discrete'] 31109 }], 31110 /** 31111 * Transition Duration 31112 * @see https://tailwindcss.com/docs/transition-duration 31113 */ 31114 duration: [{ 31115 duration: [isNumber, 'initial', isArbitraryVariable, isArbitraryValue] 31116 }], 31117 /** 31118 * Transition Timing Function 31119 * @see https://tailwindcss.com/docs/transition-timing-function 31120 */ 31121 ease: [{ 31122 ease: ['linear', 'initial', themeEase, isArbitraryVariable, isArbitraryValue] 31123 }], 31124 /** 31125 * Transition Delay 31126 * @see https://tailwindcss.com/docs/transition-delay 31127 */ 31128 delay: [{ 31129 delay: [isNumber, isArbitraryVariable, isArbitraryValue] 31130 }], 31131 /** 31132 * Animation 31133 * @see https://tailwindcss.com/docs/animation 31134 */ 31135 animate: [{ 31136 animate: ['none', themeAnimate, isArbitraryVariable, isArbitraryValue] 31137 }], 31138 // ------------------ 31139 // --- Transforms --- 31140 // ------------------ 31141 /** 31142 * Backface Visibility 31143 * @see https://tailwindcss.com/docs/backface-visibility 31144 */ 31145 backface: [{ 31146 backface: ['hidden', 'visible'] 31147 }], 31148 /** 31149 * Perspective 31150 * @see https://tailwindcss.com/docs/perspective 31151 */ 31152 perspective: [{ 31153 perspective: [themePerspective, isArbitraryVariable, isArbitraryValue] 31154 }], 31155 /** 31156 * Perspective Origin 31157 * @see https://tailwindcss.com/docs/perspective-origin 31158 */ 31159 'perspective-origin': [{ 31160 'perspective-origin': scalePositionWithArbitrary() 31161 }], 31162 /** 31163 * Rotate 31164 * @see https://tailwindcss.com/docs/rotate 31165 */ 31166 rotate: [{ 31167 rotate: scaleRotate() 31168 }], 31169 /** 31170 * Rotate X 31171 * @see https://tailwindcss.com/docs/rotate 31172 */ 31173 'rotate-x': [{ 31174 'rotate-x': scaleRotate() 31175 }], 31176 /** 31177 * Rotate Y 31178 * @see https://tailwindcss.com/docs/rotate 31179 */ 31180 'rotate-y': [{ 31181 'rotate-y': scaleRotate() 31182 }], 31183 /** 31184 * Rotate Z 31185 * @see https://tailwindcss.com/docs/rotate 31186 */ 31187 'rotate-z': [{ 31188 'rotate-z': scaleRotate() 31189 }], 31190 /** 31191 * Scale 31192 * @see https://tailwindcss.com/docs/scale 31193 */ 31194 scale: [{ 31195 scale: scaleScale() 31196 }], 31197 /** 31198 * Scale X 31199 * @see https://tailwindcss.com/docs/scale 31200 */ 31201 'scale-x': [{ 31202 'scale-x': scaleScale() 31203 }], 31204 /** 31205 * Scale Y 31206 * @see https://tailwindcss.com/docs/scale 31207 */ 31208 'scale-y': [{ 31209 'scale-y': scaleScale() 31210 }], 31211 /** 31212 * Scale Z 31213 * @see https://tailwindcss.com/docs/scale 31214 */ 31215 'scale-z': [{ 31216 'scale-z': scaleScale() 31217 }], 31218 /** 31219 * Scale 3D 31220 * @see https://tailwindcss.com/docs/scale 31221 */ 31222 'scale-3d': ['scale-3d'], 31223 /** 31224 * Skew 31225 * @see https://tailwindcss.com/docs/skew 31226 */ 31227 skew: [{ 31228 skew: scaleSkew() 31229 }], 31230 /** 31231 * Skew X 31232 * @see https://tailwindcss.com/docs/skew 31233 */ 31234 'skew-x': [{ 31235 'skew-x': scaleSkew() 31236 }], 31237 /** 31238 * Skew Y 31239 * @see https://tailwindcss.com/docs/skew 31240 */ 31241 'skew-y': [{ 31242 'skew-y': scaleSkew() 31243 }], 31244 /** 31245 * Transform 31246 * @see https://tailwindcss.com/docs/transform 31247 */ 31248 transform: [{ 31249 transform: [isArbitraryVariable, isArbitraryValue, '', 'none', 'gpu', 'cpu'] 31250 }], 31251 /** 31252 * Transform Origin 31253 * @see https://tailwindcss.com/docs/transform-origin 31254 */ 31255 'transform-origin': [{ 31256 origin: scalePositionWithArbitrary() 31257 }], 31258 /** 31259 * Transform Style 31260 * @see https://tailwindcss.com/docs/transform-style 31261 */ 31262 'transform-style': [{ 31263 transform: ['3d', 'flat'] 31264 }], 31265 /** 31266 * Translate 31267 * @see https://tailwindcss.com/docs/translate 31268 */ 31269 translate: [{ 31270 translate: scaleTranslate() 31271 }], 31272 /** 31273 * Translate X 31274 * @see https://tailwindcss.com/docs/translate 31275 */ 31276 'translate-x': [{ 31277 'translate-x': scaleTranslate() 31278 }], 31279 /** 31280 * Translate Y 31281 * @see https://tailwindcss.com/docs/translate 31282 */ 31283 'translate-y': [{ 31284 'translate-y': scaleTranslate() 31285 }], 31286 /** 31287 * Translate Z 31288 * @see https://tailwindcss.com/docs/translate 31289 */ 31290 'translate-z': [{ 31291 'translate-z': scaleTranslate() 31292 }], 31293 /** 31294 * Translate None 31295 * @see https://tailwindcss.com/docs/translate 31296 */ 31297 'translate-none': ['translate-none'], 31298 // --------------------- 31299 // --- Interactivity --- 31300 // --------------------- 31301 /** 31302 * Accent Color 31303 * @see https://tailwindcss.com/docs/accent-color 31304 */ 31305 accent: [{ 31306 accent: scaleColor() 31307 }], 31308 /** 31309 * Appearance 31310 * @see https://tailwindcss.com/docs/appearance 31311 */ 31312 appearance: [{ 31313 appearance: ['none', 'auto'] 31314 }], 31315 /** 31316 * Caret Color 31317 * @see https://tailwindcss.com/docs/just-in-time-mode#caret-color-utilities 31318 */ 31319 'caret-color': [{ 31320 caret: scaleColor() 31321 }], 31322 /** 31323 * Color Scheme 31324 * @see https://tailwindcss.com/docs/color-scheme 31325 */ 31326 'color-scheme': [{ 31327 scheme: ['normal', 'dark', 'light', 'light-dark', 'only-dark', 'only-light'] 31328 }], 31329 /**
vendor: 10,384 bytes, lines 31330-31650
31330 * Cursor 31331 * @see https://tailwindcss.com/docs/cursor 31332 */ 31333 cursor: [{ 31334 cursor: ['auto', 'default', 'pointer', 'wait', 'text', 'move', 'help', 'not-allowed', 'none', 'context-menu', 'progress', 'cell', 'crosshair', 'vertical-text', 'alias', 'copy', 'no-drop', 'grab', 'grabbing', 'all-scroll', 'col-resize', 'row-resize', 'n-resize', 'e-resize', 's-resize', 'w-resize', 'ne-resize', 'nw-resize', 'se-resize', 'sw-resize', 'ew-resize', 'ns-resize', 'nesw-resize', 'nwse-resize', 'zoom-in', 'zoom-out', isArbitraryVariable, isArbitraryValue] 31335 }], 31336 /** 31337 * Field Sizing 31338 * @see https://tailwindcss.com/docs/field-sizing 31339 */ 31340 'field-sizing': [{ 31341 'field-sizing': ['fixed', 'content'] 31342 }], 31343 /** 31344 * Pointer Events 31345 * @see https://tailwindcss.com/docs/pointer-events 31346 */ 31347 'pointer-events': [{ 31348 'pointer-events': ['auto', 'none'] 31349 }], 31350 /** 31351 * Resize 31352 * @see https://tailwindcss.com/docs/resize 31353 */ 31354 resize: [{ 31355 resize: ['none', '', 'y', 'x'] 31356 }], 31357 /** 31358 * Scroll Behavior 31359 * @see https://tailwindcss.com/docs/scroll-behavior 31360 */ 31361 'scroll-behavior': [{ 31362 scroll: ['auto', 'smooth'] 31363 }], 31364 /** 31365 * Scroll Margin 31366 * @see https://tailwindcss.com/docs/scroll-margin 31367 */ 31368 'scroll-m': [{ 31369 'scroll-m': scaleUnambiguousSpacing() 31370 }], 31371 /** 31372 * Scroll Margin X 31373 * @see https://tailwindcss.com/docs/scroll-margin 31374 */ 31375 'scroll-mx': [{ 31376 'scroll-mx': scaleUnambiguousSpacing() 31377 }], 31378 /** 31379 * Scroll Margin Y 31380 * @see https://tailwindcss.com/docs/scroll-margin 31381 */ 31382 'scroll-my': [{ 31383 'scroll-my': scaleUnambiguousSpacing() 31384 }], 31385 /** 31386 * Scroll Margin Start 31387 * @see https://tailwindcss.com/docs/scroll-margin 31388 */ 31389 'scroll-ms': [{ 31390 'scroll-ms': scaleUnambiguousSpacing() 31391 }], 31392 /** 31393 * Scroll Margin End 31394 * @see https://tailwindcss.com/docs/scroll-margin 31395 */ 31396 'scroll-me': [{ 31397 'scroll-me': scaleUnambiguousSpacing() 31398 }], 31399 /** 31400 * Scroll Margin Top 31401 * @see https://tailwindcss.com/docs/scroll-margin 31402 */ 31403 'scroll-mt': [{ 31404 'scroll-mt': scaleUnambiguousSpacing() 31405 }], 31406 /** 31407 * Scroll Margin Right 31408 * @see https://tailwindcss.com/docs/scroll-margin 31409 */ 31410 'scroll-mr': [{ 31411 'scroll-mr': scaleUnambiguousSpacing() 31412 }], 31413 /** 31414 * Scroll Margin Bottom 31415 * @see https://tailwindcss.com/docs/scroll-margin 31416 */ 31417 'scroll-mb': [{ 31418 'scroll-mb': scaleUnambiguousSpacing() 31419 }], 31420 /** 31421 * Scroll Margin Left 31422 * @see https://tailwindcss.com/docs/scroll-margin 31423 */ 31424 'scroll-ml': [{ 31425 'scroll-ml': scaleUnambiguousSpacing() 31426 }], 31427 /** 31428 * Scroll Padding 31429 * @see https://tailwindcss.com/docs/scroll-padding 31430 */ 31431 'scroll-p': [{ 31432 'scroll-p': scaleUnambiguousSpacing() 31433 }], 31434 /** 31435 * Scroll Padding X 31436 * @see https://tailwindcss.com/docs/scroll-padding 31437 */ 31438 'scroll-px': [{ 31439 'scroll-px': scaleUnambiguousSpacing() 31440 }], 31441 /** 31442 * Scroll Padding Y 31443 * @see https://tailwindcss.com/docs/scroll-padding 31444 */ 31445 'scroll-py': [{ 31446 'scroll-py': scaleUnambiguousSpacing() 31447 }], 31448 /** 31449 * Scroll Padding Start 31450 * @see https://tailwindcss.com/docs/scroll-padding 31451 */ 31452 'scroll-ps': [{ 31453 'scroll-ps': scaleUnambiguousSpacing() 31454 }], 31455 /** 31456 * Scroll Padding End 31457 * @see https://tailwindcss.com/docs/scroll-padding 31458 */ 31459 'scroll-pe': [{ 31460 'scroll-pe': scaleUnambiguousSpacing() 31461 }], 31462 /** 31463 * Scroll Padding Top 31464 * @see https://tailwindcss.com/docs/scroll-padding 31465 */ 31466 'scroll-pt': [{ 31467 'scroll-pt': scaleUnambiguousSpacing() 31468 }], 31469 /** 31470 * Scroll Padding Right 31471 * @see https://tailwindcss.com/docs/scroll-padding 31472 */ 31473 'scroll-pr': [{ 31474 'scroll-pr': scaleUnambiguousSpacing() 31475 }], 31476 /** 31477 * Scroll Padding Bottom 31478 * @see https://tailwindcss.com/docs/scroll-padding 31479 */ 31480 'scroll-pb': [{ 31481 'scroll-pb': scaleUnambiguousSpacing() 31482 }], 31483 /** 31484 * Scroll Padding Left 31485 * @see https://tailwindcss.com/docs/scroll-padding 31486 */ 31487 'scroll-pl': [{ 31488 'scroll-pl': scaleUnambiguousSpacing() 31489 }], 31490 /** 31491 * Scroll Snap Align 31492 * @see https://tailwindcss.com/docs/scroll-snap-align 31493 */ 31494 'snap-align': [{ 31495 snap: ['start', 'end', 'center', 'align-none'] 31496 }], 31497 /** 31498 * Scroll Snap Stop 31499 * @see https://tailwindcss.com/docs/scroll-snap-stop 31500 */ 31501 'snap-stop': [{ 31502 snap: ['normal', 'always'] 31503 }], 31504 /** 31505 * Scroll Snap Type 31506 * @see https://tailwindcss.com/docs/scroll-snap-type 31507 */ 31508 'snap-type': [{ 31509 snap: ['none', 'x', 'y', 'both'] 31510 }], 31511 /** 31512 * Scroll Snap Type Strictness 31513 * @see https://tailwindcss.com/docs/scroll-snap-type 31514 */ 31515 'snap-strictness': [{ 31516 snap: ['mandatory', 'proximity'] 31517 }], 31518 /** 31519 * Touch Action 31520 * @see https://tailwindcss.com/docs/touch-action 31521 */ 31522 touch: [{ 31523 touch: ['auto', 'none', 'manipulation'] 31524 }], 31525 /** 31526 * Touch Action X 31527 * @see https://tailwindcss.com/docs/touch-action 31528 */ 31529 'touch-x': [{ 31530 'touch-pan': ['x', 'left', 'right'] 31531 }], 31532 /** 31533 * Touch Action Y 31534 * @see https://tailwindcss.com/docs/touch-action 31535 */ 31536 'touch-y': [{ 31537 'touch-pan': ['y', 'up', 'down'] 31538 }], 31539 /** 31540 * Touch Action Pinch Zoom 31541 * @see https://tailwindcss.com/docs/touch-action 31542 */ 31543 'touch-pz': ['touch-pinch-zoom'], 31544 /** 31545 * User Select 31546 * @see https://tailwindcss.com/docs/user-select 31547 */ 31548 select: [{ 31549 select: ['none', 'text', 'all', 'auto'] 31550 }], 31551 /** 31552 * Will Change 31553 * @see https://tailwindcss.com/docs/will-change 31554 */ 31555 'will-change': [{ 31556 'will-change': ['auto', 'scroll', 'contents', 'transform', isArbitraryVariable, isArbitraryValue] 31557 }], 31558 // ----------- 31559 // --- SVG --- 31560 // ----------- 31561 /** 31562 * Fill 31563 * @see https://tailwindcss.com/docs/fill 31564 */ 31565 fill: [{ 31566 fill: ['none', ...scaleColor()] 31567 }], 31568 /** 31569 * Stroke Width 31570 * @see https://tailwindcss.com/docs/stroke-width 31571 */ 31572 'stroke-w': [{ 31573 stroke: [isNumber, isArbitraryVariableLength, isArbitraryLength, isArbitraryNumber] 31574 }], 31575 /** 31576 * Stroke 31577 * @see https://tailwindcss.com/docs/stroke 31578 */ 31579 stroke: [{ 31580 stroke: ['none', ...scaleColor()] 31581 }], 31582 // --------------------- 31583 // --- Accessibility --- 31584 // --------------------- 31585 /** 31586 * Forced Color Adjust 31587 * @see https://tailwindcss.com/docs/forced-color-adjust 31588 */ 31589 'forced-color-adjust': [{ 31590 'forced-color-adjust': ['auto', 'none'] 31591 }] 31592 }, 31593 conflictingClassGroups: { 31594 overflow: ['overflow-x', 'overflow-y'], 31595 overscroll: ['overscroll-x', 'overscroll-y'], 31596 inset: ['inset-x', 'inset-y', 'start', 'end', 'top', 'right', 'bottom', 'left'], 31597 'inset-x': ['right', 'left'], 31598 'inset-y': ['top', 'bottom'], 31599 flex: ['basis', 'grow', 'shrink'], 31600 gap: ['gap-x', 'gap-y'], 31601 p: ['px', 'py', 'ps', 'pe', 'pt', 'pr', 'pb', 'pl'], 31602 px: ['pr', 'pl'], 31603 py: ['pt', 'pb'], 31604 m: ['mx', 'my', 'ms', 'me', 'mt', 'mr', 'mb', 'ml'], 31605 mx: ['mr', 'ml'], 31606 my: ['mt', 'mb'], 31607 size: ['w', 'h'], 31608 'font-size': ['leading'], 31609 'fvn-normal': ['fvn-ordinal', 'fvn-slashed-zero', 'fvn-figure', 'fvn-spacing', 'fvn-fraction'], 31610 'fvn-ordinal': ['fvn-normal'], 31611 'fvn-slashed-zero': ['fvn-normal'], 31612 'fvn-figure': ['fvn-normal'], 31613 'fvn-spacing': ['fvn-normal'], 31614 'fvn-fraction': ['fvn-normal'], 31615 'line-clamp': ['display', 'overflow'], 31616 rounded: ['rounded-s', 'rounded-e', 'rounded-t', 'rounded-r', 'rounded-b', 'rounded-l', 'rounded-ss', 'rounded-se', 'rounded-ee', 'rounded-es', 'rounded-tl', 'rounded-tr', 'rounded-br', 'rounded-bl'], 31617 'rounded-s': ['rounded-ss', 'rounded-es'], 31618 'rounded-e': ['rounded-se', 'rounded-ee'], 31619 'rounded-t': ['rounded-tl', 'rounded-tr'], 31620 'rounded-r': ['rounded-tr', 'rounded-br'], 31621 'rounded-b': ['rounded-br', 'rounded-bl'], 31622 'rounded-l': ['rounded-tl', 'rounded-bl'], 31623 'border-spacing': ['border-spacing-x', 'border-spacing-y'], 31624 'border-w': ['border-w-x', 'border-w-y', 'border-w-s', 'border-w-e', 'border-w-t', 'border-w-r', 'border-w-b', 'border-w-l'], 31625 'border-w-x': ['border-w-r', 'border-w-l'], 31626 'border-w-y': ['border-w-t', 'border-w-b'], 31627 'border-color': ['border-color-x', 'border-color-y', 'border-color-s', 'border-color-e', 'border-color-t', 'border-color-r', 'border-color-b', 'border-color-l'], 31628 'border-color-x': ['border-color-r', 'border-color-l'], 31629 'border-color-y': ['border-color-t', 'border-color-b'], 31630 translate: ['translate-x', 'translate-y', 'translate-none'], 31631 'translate-none': ['translate', 'translate-x', 'translate-y', 'translate-z'], 31632 'scroll-m': ['scroll-mx', 'scroll-my', 'scroll-ms', 'scroll-me', 'scroll-mt', 'scroll-mr', 'scroll-mb', 'scroll-ml'], 31633 'scroll-mx': ['scroll-mr', 'scroll-ml'], 31634 'scroll-my': ['scroll-mt', 'scroll-mb'], 31635 'scroll-p': ['scroll-px', 'scroll-py', 'scroll-ps', 'scroll-pe', 'scroll-pt', 'scroll-pr', 'scroll-pb', 'scroll-pl'], 31636 'scroll-px': ['scroll-pr', 'scroll-pl'], 31637 'scroll-py': ['scroll-pt', 'scroll-pb'], 31638 touch: ['touch-x', 'touch-y', 'touch-pz'], 31639 'touch-x': ['touch'], 31640 'touch-y': ['touch'], 31641 'touch-pz': ['touch'] 31642 }, 31643 conflictingClassGroupModifiers: { 31644 'font-size': ['leading'] 31645 }, 31646 orderSensitiveModifiers: ['*', '**', 'after', 'backdrop', 'before', 'details-content', 'file', 'first-letter', 'first-line', 'marker', 'placeholder', 'selection'] 31647 }; 31648}; 31649const twMerge = /*#__PURE__*/createTailwindMerge(getDefaultConfig); 31650
31651function cn(...inputs) { 31652 return twMerge(clsx(inputs)); 31653} 31654 31655function TooltipProvider({ 31656 delayDuration = 0, 31657 ...props 31658}) { 31659 return /* @__PURE__ */ jsxRuntimeExports.jsx( 31660 Provider, 31661 { 31662 "data-slot": "tooltip-provider", 31663 delayDuration, 31664 ...props 31665 } 31666 ); 31667} 31668 31669/** 31670 * @param {string|RegExp} input The route pattern 31671 * @param {boolean} [loose] Allow open-ended matching. Ignored with `RegExp` input. 31672 */ 31673function parse$1(input, loose) { 31674 if (input instanceof RegExp) return { keys:false, pattern:input }; 31675 var c, o, tmp, ext, keys=[], pattern='', arr = input.split('/'); 31676 arr[0] || arr.shift(); 31677 31678 while (tmp = arr.shift()) { 31679 c = tmp[0]; 31680 if (c === '*') { 31681 keys.push(c); 31682 pattern += tmp[1] === '?' ? '(?:/(.*))?' : '/(.*)'; 31683 } else if (c === ':') { 31684 o = tmp.indexOf('?', 1); 31685 ext = tmp.indexOf('.', 1); 31686 keys.push( tmp.substring(1, !!~o ? o : !!~ext ? ext : tmp.length) ); 31687 pattern += !!~o && !~ext ? '(?:/([^/]+?))?' : '/([^/]+?)'; 31688 if (!!~ext) pattern += (!!~o ? '?' : '') + '\\' + tmp.substring(ext); 31689 } else { 31690 pattern += '/' + tmp; 31691 } 31692 } 31693 31694 return { 31695 keys: keys, 31696 pattern: new RegExp('^' + pattern + (loose ? '(?=$|\/)' : '\/?$'), 'i') 31697 }; 31698} 31699 31700var shim = {exports: {}}; 31701 31702var useSyncExternalStoreShim_production = {}; 31703 31704/** 31705 * @license React 31706 * use-sync-external-store-shim.production.js 31707 * 31708 * Copyright (c) Meta Platforms, Inc. and affiliates. 31709 * 31710 * This source code is licensed under the MIT license found in the 31711 * LICENSE file in the root directory of this source tree. 31712 */ 31713 31714var hasRequiredUseSyncExternalStoreShim_production; 31715 31716function requireUseSyncExternalStoreShim_production () { 31717 if (hasRequiredUseSyncExternalStoreShim_production) return useSyncExternalStoreShim_production; 31718 hasRequiredUseSyncExternalStoreShim_production = 1; 31719 var React = requireReact(); 31720 function is(x, y) { 31721 return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y); 31722 } 31723 var objectIs = "function" === typeof Object.is ? Object.is : is, 31724 useState = React.useState, 31725 useEffect = React.useEffect, 31726 useLayoutEffect = React.useLayoutEffect, 31727 useDebugValue = React.useDebugValue; 31728 function useSyncExternalStore$2(subscribe, getSnapshot) { 31729 var value = getSnapshot(), 31730 _useState = useState({ inst: { value: value, getSnapshot: getSnapshot } }), 31731 inst = _useState[0].inst, 31732 forceUpdate = _useState[1]; 31733 useLayoutEffect( 31734 function () { 31735 inst.value = value; 31736 inst.getSnapshot = getSnapshot; 31737 checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst }); 31738 }, 31739 [subscribe, value, getSnapshot] 31740 ); 31741 useEffect( 31742 function () { 31743 checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst }); 31744 return subscribe(function () { 31745 checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst }); 31746 }); 31747 }, 31748 [subscribe] 31749 ); 31750 useDebugValue(value); 31751 return value; 31752 } 31753 function checkIfSnapshotChanged(inst) { 31754 var latestGetSnapshot = inst.getSnapshot; 31755 inst = inst.value; 31756 try { 31757 var nextValue = latestGetSnapshot(); 31758 return !objectIs(inst, nextValue); 31759 } catch (error) { 31760 return true; 31761 } 31762 } 31763 function useSyncExternalStore$1(subscribe, getSnapshot) { 31764 return getSnapshot(); 31765 } 31766 var shim = 31767 "undefined" === typeof window || 31768 "undefined" === typeof window.document || 31769 "undefined" === typeof window.document.createElement 31770 ? useSyncExternalStore$1 31771 : useSyncExternalStore$2; 31772 useSyncExternalStoreShim_production.useSyncExternalStore = 31773 void 0 !== React.useSyncExternalStore ? React.useSyncExternalStore : shim; 31774 return useSyncExternalStoreShim_production; 31775} 31776 31777var hasRequiredShim; 31778 31779function requireShim () { 31780 if (hasRequiredShim) return shim.exports; 31781 hasRequiredShim = 1; 31782 { 31783 shim.exports = requireUseSyncExternalStoreShim_production(); 31784 } 31785 return shim.exports; 31786} 31787 31788var shimExports = requireShim(); 31789 31790// React.useInsertionEffect is not available in React <18 31791// This hack fixes a transpilation issue on some apps 31792const useBuiltinInsertionEffect = React$1["useInsertion" + "Effect"]; 31793 31794// Copied from: 31795// https://github.com/facebook/react/blob/main/packages/shared/ExecutionEnvironment.js 31796const canUseDOM$1 = !!( 31797 typeof window !== "undefined" && 31798 typeof window.document !== "undefined" && 31799 typeof window.document.createElement !== "undefined" 31800); 31801 31802// Copied from: 31803// https://github.com/reduxjs/react-redux/blob/master/src/utils/useIsomorphicLayoutEffect.ts 31804// "React currently throws a warning when using useLayoutEffect on the server. 31805// To get around it, we can conditionally useEffect on the server (no-op) and 31806// useLayoutEffect in the browser." 31807const useIsomorphicLayoutEffect$2 = canUseDOM$1 31808 ? reactExports.useLayoutEffect 31809 : reactExports.useEffect; 31810 31811// useInsertionEffect is already a noop on the server. 31812// See: https://github.com/facebook/react/blob/main/packages/react-server/src/ReactFizzHooks.js 31813const useInsertionEffect = 31814 useBuiltinInsertionEffect || useIsomorphicLayoutEffect$2; 31815 31816// Userland polyfill while we wait for the forthcoming 31817// https://github.com/reactjs/rfcs/blob/useevent/text/0000-useevent.md 31818// Note: "A high-fidelity polyfill for useEvent is not possible because 31819// there is no lifecycle or Hook in React that we can use to switch 31820// .current at the right timing." 31821// So we will have to make do with this "close enough" approach for now. 31822const useEvent$1 = (fn) => { 31823 const ref = reactExports.useRef([fn, (...args) => ref[0](...args)]).current; 31824 // Per Dan Abramov: useInsertionEffect executes marginally closer to the 31825 // correct timing for ref synchronization than useLayoutEffect on React 18. 31826 // See: https://github.com/facebook/react/pull/25881#issuecomment-1356244360 31827 useInsertionEffect(() => { 31828 ref[0] = fn; 31829 }); 31830 return ref[1]; 31831}; 31832 31833/** 31834 * History API docs @see https://developer.mozilla.org/en-US/docs/Web/API/History 31835 */ 31836const eventPopstate = "popstate"; 31837const eventPushState = "pushState"; 31838const eventReplaceState = "replaceState";
31839const eventHashchange = "hashchange"; 31840const events$3 = [ 31841 eventPopstate, 31842 eventPushState, 31843 eventReplaceState, 31844 eventHashchange, 31845]; 31846 31847const subscribeToLocationUpdates = (callback) => { 31848 for (const event of events$3) { 31849 addEventListener(event, callback); 31850 } 31851 return () => { 31852 for (const event of events$3) { 31853 removeEventListener(event, callback); 31854 } 31855 }; 31856}; 31857 31858const useLocationProperty = (fn, ssrFn) => 31859 shimExports.useSyncExternalStore(subscribeToLocationUpdates, fn, ssrFn); 31860 31861const currentSearch = () => location.search; 31862 31863const useSearch = ({ ssrSearch = "" } = {}) => 31864 useLocationProperty(currentSearch, () => ssrSearch); 31865 31866const currentPathname = () => location.pathname; 31867 31868const usePathname = ({ ssrPath } = {}) => 31869 useLocationProperty( 31870 currentPathname, 31871 ssrPath ? () => ssrPath : currentPathname 31872 ); 31873 31874const navigate = (to, { replace = false, state = null } = {}) => 31875 history[replace ? eventReplaceState : eventPushState](state, "", to); 31876 31877// the 2nd argument of the `useBrowserLocation` return value is a function 31878// that allows to perform a navigation. 31879const useBrowserLocation = (opts = {}) => [usePathname(opts), navigate]; 31880 31881const patchKey = Symbol.for("wouter_v3"); 31882 31883// While History API does have `popstate` event, the only 31884// proper way to listen to changes via `push/replaceState` 31885// is to monkey-patch these methods. 31886// 31887// See https://stackoverflow.com/a/4585031 31888if (typeof history !== "undefined" && typeof window[patchKey] === "undefined") { 31889 for (const type of [eventPushState, eventReplaceState]) { 31890 const original = history[type]; 31891 // TODO: we should be using unstable_batchedUpdates to avoid multiple re-renders, 31892 // however that will require an additional peer dependency on react-dom. 31893 // See: https://github.com/reactwg/react-18/discussions/86#discussioncomment-1567149 31894 history[type] = function () { 31895 const result = original.apply(this, arguments); 31896 const event = new Event(type); 31897 event.arguments = arguments; 31898 31899 dispatchEvent(event); 31900 return result; 31901 }; 31902 } 31903 31904 // patch history object only once 31905 // See: https://github.com/molefrog/wouter/issues/167 31906 Object.defineProperty(window, patchKey, { value: true }); 31907} 31908 31909/* 31910 * Transforms `path` into its relative `base` version 31911 * If base isn't part of the path provided returns absolute path e.g. `~/app` 31912 */ 31913const _relativePath = (base, path) => 31914 !path.toLowerCase().indexOf(base.toLowerCase()) 31915 ? path.slice(base.length) || "/" 31916 : "~" + path; 31917 31918/** 31919 * When basepath is `undefined` or '/' it is ignored (we assume it's empty string) 31920 */ 31921const baseDefaults = (base = "") => (base === "/" ? "" : base); 31922 31923const absolutePath = (to, base) => 31924 to[0] === "~" ? to.slice(1) : baseDefaults(base) + to; 31925 31926const relativePath = (base = "", path) =>
31927 _relativePath(unescape(baseDefaults(base)), unescape(path)); 31928 31929/* 31930 * decodes escape sequences such as %20 31931 */ 31932const unescape = (str) => { 31933 try { 31934 return decodeURI(str); 31935 } catch (_e) { 31936 // fail-safe mode: if string can't be decoded do nothing 31937 return str; 31938 } 31939}; 31940 31941/* 31942 * Router and router context. Router is a lightweight object that represents the current 31943 * routing options: how location is managed, base path etc. 31944 * 31945 * There is a default router present for most of the use cases, however it can be overridden 31946 * via the <Router /> component. 31947 */ 31948 31949const defaultRouter = { 31950 hook: useBrowserLocation, 31951 searchHook: useSearch, 31952 parser: parse$1, 31953 base: "", 31954 // this option is used to override the current location during SSR 31955 ssrPath: undefined, 31956 ssrSearch: undefined, 31957 // optional context to track render state during SSR 31958 ssrContext: undefined, 31959 // customizes how `href` props are transformed for <Link /> 31960 hrefs: (x) => x, 31961}; 31962 31963const RouterCtx = reactExports.createContext(defaultRouter); 31964 31965// gets the closest parent router from the context 31966const useRouter = () => reactExports.useContext(RouterCtx); 31967 31968/** 31969 * Parameters context. Used by `useParams()` to get the 31970 * matched params from the innermost `Route` component. 31971 */ 31972 31973const Params0 = {}, 31974 ParamsCtx = reactExports.createContext(Params0); 31975 31976const useParams = () => reactExports.useContext(ParamsCtx); 31977 31978/* 31979 * Part 1, Hooks API: useRoute and useLocation 31980 */ 31981 31982// Internal version of useLocation to avoid redundant useRouter calls 31983 31984const useLocationFromRouter = (router) => { 31985 const [location, navigate] = router.hook(router); 31986 31987 // the function reference should stay the same between re-renders, so that 31988 // it can be passed down as an element prop without any performance concerns. 31989 // (This is achieved via `useEvent`.) 31990 return [ 31991 relativePath(router.base, location), 31992 useEvent$1((to, navOpts) => navigate(absolutePath(to, router.base), navOpts)), 31993 ]; 31994}; 31995 31996const useLocation = () => useLocationFromRouter(useRouter()); 31997 31998const matchRoute = (parser, route, path, loose) => { 31999 // if the input is a regexp, skip parsing 32000 const { pattern, keys } = 32001 route instanceof RegExp 32002 ? { keys: false, pattern: route } 32003 : parser(route || "*", loose); 32004 32005 // array destructuring loses keys, so this is done in two steps 32006 const result = pattern.exec(path) || []; 32007 32008 // when parser is in "loose" mode, `$base` is equal to the 32009 // first part of the route that matches the pattern 32010 // (e.g. for pattern `/a/:b` and path `/a/1/2/3` the `$base` is `a/1`) 32011 // we use this for route nesting 32012 const [$base, ...matches] = result; 32013 32014 return $base !== undefined 32015 ? [ 32016 true, 32017 32018 (() => { 32019 // for regex paths, `keys` will always be false 32020 32021 // an object with parameters matched, e.g. { foo: "bar" } for "/:foo" 32022 // we "zip" two arrays here to construct the object 32023 // ["foo"], ["bar"] â { foo: "bar" } 32024 const groups = 32025 keys !== false 32026 ? Object.fromEntries(keys.map((key, i) => [key, matches[i]])) 32027 : result.groups; 32028 32029 // convert the array to an instance of object 32030 // this makes it easier to integrate with the existing param implementation 32031 let obj = { ...matches }; 32032 32033 // merge named capture groups with matches array 32034 groups && Object.assign(obj, groups); 32035 32036 return obj; 32037 })(), 32038 32039 // the third value if only present when parser is in "loose" mode, 32040 // so that we can extract the base path for nested routes 32041 ...(loose ? [$base] : []), 32042 ] 32043 : [false, null]; 32044}; 32045 32046const useRoute = (pattern) => 32047 matchRoute(useRouter().parser, pattern, useLocation()[0]); 32048 32049/* 32050 * Part 2, Low Carb Router API: Router, Route, Link, Switch 32051 */ 32052 32053const Router = ({ children, ...props }) => { 32054 // the router we will inherit from - it is the closest router in the tree, 32055 // unless the custom `hook` is provided (in that case it's the default one) 32056 const parent_ = useRouter(); 32057 const parent = props.hook ? defaultRouter : parent_; 32058 32059 // holds to the context value: the router object 32060 let value = parent; 32061 32062 // when `ssrPath` contains a `?` character, we can extract the search from it 32063 const [path, search] = props.ssrPath?.split("?") ?? []; 32064 if (search) (props.ssrSearch = search), (props.ssrPath = path); 32065 32066 // hooks can define their own `href` formatter (e.g. for hash location) 32067 props.hrefs = props.hrefs ?? props.hook?.hrefs; 32068 32069 // what is happening below: to avoid unnecessary rerenders in child components, 32070 // we ensure that the router object reference is stable, unless there are any 32071 // changes that require reload (e.g. `base` prop changes -> all components that 32072 // get the router from the context should rerender, even if the component is memoized). 32073 // the expected behaviour is: 32074 // 32075 // 1) when the resulted router is no different from the parent, use parent 32076 // 2) if the custom `hook` prop is provided, we always inherit from the 32077 // default router instead. this resets all previously overridden options. 32078 // 3) when the router is customized here, it should stay stable between renders 32079 let ref = reactExports.useRef({}), 32080 prev = ref.current, 32081 next = prev; 32082 32083 for (let k in parent) { 32084 const option = 32085 k === "base" 32086 ? /* base is special case, it is appended to the parent's base */ 32087 parent[k] + (props[k] || "") 32088 : props[k] || parent[k]; 32089 32090 if (prev === next && option !== next[k]) { 32091 ref.current = next = { ...next }; 32092 } 32093 32094 next[k] = option; 32095 32096 // the new router is no different from the parent or from the memoized value, use parent 32097 if (option !== parent[k] || option !== value[k]) value = next; 32098 } 32099 32100 return reactExports.createElement(RouterCtx.Provider, { value, children }); 32101}; 32102 32103const h_route = ({ children, component }, params) => { 32104 // React-Router style `component` prop 32105 if (component) return reactExports.createElement(component, { params }); 32106 32107 // support render prop or plain children 32108 return typeof children === "function" ? children(params) : children; 32109}; 32110 32111// Cache params object between renders if values are shallow equal 32112const useCachedParams = (value) => { 32113 let prev = reactExports.useRef(Params0); 32114 const curr = prev.current; 32115 return (prev.current = 32116 // Update cache if number of params changed or any value changed 32117 Object.keys(value).length !== Object.keys(curr).length || 32118 Object.entries(value).some(([k, v]) => v !== curr[k]) 32119 ? value // Return new value if there are changes 32120 : curr); // Return cached value if nothing changed 32121}; 32122 32123const Route = ({ path, nest, match, ...renderProps }) => { 32124 const router = useRouter(); 32125 const [location] = useLocationFromRouter(router); 32126
32127 const [matches, routeParams, base] = 32128 // `match` is a special prop to give up control to the parent, 32129 // it is used by the `Switch` to avoid double matching 32130 match ?? matchRoute(router.parser, path, location, nest); 32131 32132 // when `routeParams` is `null` (there was no match), the argument 32133 // below becomes {...null} = {}, see the Object Spread specs 32134 // https://tc39.es/proposal-object-rest-spread/#AbstractOperations-CopyDataProperties 32135 const params = useCachedParams({ ...useParams(), ...routeParams }); 32136 32137 if (!matches) return null; 32138 32139 const children = base 32140 ? reactExports.createElement(Router, { base }, h_route(renderProps, params)) 32141 : h_route(renderProps, params); 32142 32143 return reactExports.createElement(ParamsCtx.Provider, { value: params, children }); 32144}; 32145 32146const Link = reactExports.forwardRef((props, ref) => { 32147 const router = useRouter(); 32148 const [currentPath, navigate] = useLocationFromRouter(router); 32149 32150 const { 32151 to = "", 32152 href: targetPath = to, 32153 onClick: _onClick, 32154 asChild, 32155 children, 32156 className: cls, 32157 /* eslint-disable no-unused-vars */ 32158 replace /* ignore nav props */, 32159 state /* ignore nav props */, 32160 /* eslint-enable no-unused-vars */ 32161 32162 ...restProps 32163 } = props; 32164 32165 const onClick = useEvent$1((event) => { 32166 // ignores the navigation when clicked using right mouse button or 32167 // by holding a special modifier key: ctrl, command, win, alt, shift 32168 if ( 32169 event.ctrlKey || 32170 event.metaKey || 32171 event.altKey || 32172 event.shiftKey || 32173 event.button !== 0 32174 ) 32175 return; 32176 32177 _onClick?.(event); 32178 if (!event.defaultPrevented) { 32179 event.preventDefault(); 32180 navigate(targetPath, props); 32181 } 32182 }); 32183 32184 // handle nested routers and absolute paths 32185 const href = router.hrefs( 32186 targetPath[0] === "~" ? targetPath.slice(1) : router.base + targetPath, 32187 router // pass router as a second argument for convinience 32188 ); 32189 32190 return asChild && reactExports.isValidElement(children) 32191 ? reactExports.cloneElement(children, { onClick, href }) 32192 : reactExports.createElement("a", { 32193 ...restProps, 32194 onClick, 32195 href, 32196 // `className` can be a function to apply the class if this link is active 32197 className: cls?.call ? cls(currentPath === targetPath) : cls, 32198 children, 32199 ref, 32200 }); 32201}); 32202 32203const flattenChildren = (children) => 32204 Array.isArray(children) 32205 ? children.flatMap((c) => 32206 flattenChildren(c && c.type === reactExports.Fragment ? c.props.children : c) 32207 ) 32208 : [children]; 32209 32210const Switch = ({ children, location }) => { 32211 const router = useRouter(); 32212 const [originalLocation] = useLocationFromRouter(router); 32213 32214 for (const element of flattenChildren(children)) { 32215 let match = 0; 32216 32217 if ( 32218 reactExports.isValidElement(element) && 32219 // we don't require an element to be of type Route, 32220 // but we do require it to contain a truthy `path` prop. 32221 // this allows to use different components that wrap Route 32222 // inside of a switch, for example <AnimatedRoute />. 32223 (match = matchRoute( 32224 router.parser, 32225 element.props.path, 32226 location || originalLocation, 32227 element.props.nest 32228 ))[0] 32229 ) 32230 return reactExports.cloneElement(element, { match }); 32231 } 32232 32233 return null; 32234}; 32235 32236/** 32237 * @license lucide-react v0.453.0 - ISC 32238 * 32239 * This source code is licensed under the ISC license. 32240 * See the LICENSE file in the root directory of this source tree. 32241 */ 32242 32243const toKebabCase = (string) => string.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(); 32244const mergeClasses = (...classes) => classes.filter((className, index, array) => { 32245 return Boolean(className) && array.indexOf(className) === index; 32246}).join(" "); 32247 32248/** 32249 * @license lucide-react v0.453.0 - ISC 32250 * 32251 * This source code is licensed under the ISC license. 32252 * See the LICENSE file in the root directory of this source tree. 32253 */ 32254 32255var defaultAttributes$1 = { 32256 xmlns: "http://www.w3.org/2000/svg", 32257 width: 24, 32258 height: 24, 32259 viewBox: "0 0 24 24", 32260 fill: "none", 32261 stroke: "currentColor", 32262 strokeWidth: 2, 32263 strokeLinecap: "round", 32264 strokeLinejoin: "round" 32265}; 32266 32267/** 32268 * @license lucide-react v0.453.0 - ISC 32269 * 32270 * This source code is licensed under the ISC license. 32271 * See the LICENSE file in the root directory of this source tree. 32272 */ 32273 32274 32275const Icon = reactExports.forwardRef( 32276 ({ 32277 color = "currentColor", 32278 size = 24, 32279 strokeWidth = 2, 32280 absoluteStrokeWidth, 32281 className = "", 32282 children, 32283 iconNode, 32284 ...rest 32285 }, ref) => { 32286 return reactExports.createElement( 32287 "svg", 32288 { 32289 ref, 32290 ...defaultAttributes$1, 32291 width: size, 32292 height: size, 32293 stroke: color, 32294 strokeWidth: absoluteStrokeWidth ? Number(strokeWidth) * 24 / Number(size) : strokeWidth, 32295 className: mergeClasses("lucide", className), 32296 ...rest 32297 }, 32298 [ 32299 ...iconNode.map(([tag, attrs]) => reactExports.createElement(tag, attrs)), 32300 ...Array.isArray(children) ? children : [children] 32301 ] 32302 ); 32303 } 32304); 32305 32306/** 32307 * @license lucide-react v0.453.0 - ISC 32308 * 32309 * This source code is licensed under the ISC license. 32310 * See the LICENSE file in the root directory of this source tree. 32311 */ 32312 32313 32314const createLucideIcon = (iconName, iconNode) => { 32315 const Component = reactExports.forwardRef( 32316 ({ className, ...props }, ref) => reactExports.createElement(Icon, { 32317 ref, 32318 iconNode, 32319 className: mergeClasses(`lucide-${toKebabCase(iconName)}`, className), 32320 ...props 32321 }) 32322 ); 32323 Component.displayName = `${iconName}`; 32324 return Component; 32325}; 32326 32327/** 32328 * @license lucide-react v0.453.0 - ISC 32329 * 32330 * This source code is licensed under the ISC license. 32331 * See the LICENSE file in the root directory of this source tree. 32332 */ 32333 32334 32335const Activity = createLucideIcon("Activity", [ 32336 [ 32337 "path", 32338 { 32339 d: "M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l
32339-2.35 8.36A2 2 0 0 1 4.49 12H2", 32340 key: "169zse" 32341 } 32342 ] 32343]); 32344 32345/** 32346 * @license lucide-react v0.453.0 - ISC 32347 * 32348 * This source code is licensed under the ISC license. 32349 * See the LICENSE file in the root directory of this source tree. 32350 */ 32351 32352 32353const Bell = createLucideIcon("Bell", [ 32354 ["path", { d: "M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9", key: "1qo2s2" }], 32355 ["path", { d: "M10.3 21a1.94 1.94 0 0 0 3.4 0", key: "qgo35s" }] 32356]); 32357 32358/** 32359 * @license lucide-react v0.453.0 - ISC 32360 * 32361 * This source code is licensed under the ISC license. 32362 * See the LICENSE file in the root directory of this source tree. 32363 */ 32364 32365 32366const BookOpen = createLucideIcon("BookOpen", [ 32367 ["path", { d: "M12 7v14", key: "1akyts" }], 32368 [ 32369 "path", 32370 { 32371 d: "M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z", 32372 key: "ruj8y" 32373 } 32374 ] 32375]); 32376 32377/** 32378 * @license lucide-react v0.453.0 - ISC 32379 * 32380 * This source code is licensed under the ISC license. 32381 * See the LICENSE file in the root directory of this source tree. 32382 */ 32383 32384 32385const BookUser = createLucideIcon("BookUser", [ 32386 ["path", { d: "M15 13a3 3 0 1 0-6 0", key: "10j68g" }], 32387 [ 32388 "path", 32389 { 32390 d: "M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20", 32391 key: "k3hazp" 32392 } 32393 ], 32394 ["circle", { cx: "12", cy: "8", r: "2", key: "1822b1" }] 32395]); 32396 32397/** 32398 * @license lucide-react v0.453.0 - ISC 32399 * 32400 * This source code is licensed under the ISC license. 32401 * See the LICENSE file in the root directory of this source tree. 32402 */ 32403 32404 32405const Bot = createLucideIcon("Bot", [ 32406 ["path", { d: "M12 8V4H8", key: "hb8ula" }], 32407 ["rect", { width: "16", height: "12", x: "4", y: "8", rx: "2", key: "enze0r" }], 32408 ["path", { d: "M2 14h2", key: "vft8re" }], 32409 ["path", { d: "M20 14h2", key: "4cs60a" }], 32410 ["path", { d: "M15 13v2", key: "1xurst" }], 32411 ["path", { d: "M9 13v2", key: "rq6x2g" }] 32412]); 32413 32414/** 32415 * @license lucide-react v0.453.0 - ISC 32416 * 32417 * This source code is licensed under the ISC license. 32418 * See the LICENSE file in the root directory of this source tree. 32419 */ 32420 32421 32422const Building2 = createLucideIcon("Building2", [ 32423 ["path", { d: "M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z", key: "1b4qmf" }], 32424 ["path", { d: "M6 12H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h2", key: "i71pzd" }], 32425 ["path", { d: "M18 9h2a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-2", key: "10jefs" }], 32426 ["path", { d: "M10 6h4", key: "1itunk" }], 32427 ["path", { d: "M10 10h4", key: "tcdvrf" }], 32428 ["path", { d: "M10 14h4", key: "kelpxr" }], 32429 ["path", { d: "M10 18h4", key: "1ulq68" }] 32430]); 32431 32432/** 32433 * @license lucide-react v0.453.0 - ISC 32434 * 32435 * This source code is licensed under the ISC license. 32436 * See the LICENSE file in the root directory of this source tree. 32437 */ 32438 32439 32440const CalendarDays = createLucideIcon("CalendarDays", [ 32441 ["path", { d: "M8 2v4", key: "1cmpym" }], 32442 ["path", { d: "M16 2v4", key: "4m81vk" }], 32443 ["rect", { width: "18", height: "18", x: "3", y: "4", rx: "2", key: "1hopcy" }], 32444 ["path", { d: "M3 10h18", key: "8toen8" }], 32445 ["path", { d: "M8 14h.01", key: "6423bh" }], 32446 ["path", { d: "M12 14h.01", key: "1etili" }], 32447 ["path", { d: "M16 14h.01", key: "1gbofw" }], 32448 ["path", { d: "M8 18h.01", key: "lrp35t" }], 32449 ["path", { d: "M12 18h.01", key: "mhygvu" }], 32450 ["path", { d: "M16 18h.01", key: "kzsmim" }] 32451]); 32452 32453/** 32454 * @license lucide-react v0.453.0 - ISC 32455 * 32456 * This source code is licensed under the ISC license. 32457 * See the LICENSE file in the root directory of this source tree. 32458 */ 32459 32460 32461const ChartColumn = createLucideIcon("ChartColumn", [ 32462 ["path", { d: "M3 3v16a2 2 0 0 0 2 2h16", key: "c24i48" }], 32463 ["path", { d: "M18 17V9", key: "2bz60n" }], 32464 ["path", { d: "M13 17V5", key: "1frdt8" }], 32465 ["path", { d: "M8 17v-3", key: "17ska0" }] 32466]); 32467 32468/** 32469 * @license lucide-react v0.453.0 - ISC 32470 * 32471 * This source code is licensed under the ISC license. 32472 * See the LICENSE file in the root directory of this source tree. 32473 */ 32474 32475 32476const CheckCheck = createLucideIcon("CheckCheck", [ 32477 ["path", { d: "M18 6 7 17l-5-5", key: "116fxf" }], 32478 ["path", { d: "m22 10-7.5 7.5L13 16", key: "ke71qq" }] 32479]); 32480 32481/** 32482 * @license lucide-react v0.453.0 - ISC 32483 * 32484 * This source code is licensed under the ISC license. 32485 * See the LICENSE file in the root directory of this source tree. 32486 */ 32487 32488 32489const ChevronLeft = createLucideIcon("ChevronLeft", [ 32490 ["path", { d: "m15 18-6-6 6-6", key: "1wnfg3" }] 32491]); 32492 32493/** 32494 * @license lucide-react v0.453.0 - ISC 32495 * 32496 * This source code is licensed under the ISC license. 32497 * See the LICENSE file in the root directory of this source tree. 32498 */ 32499 32500 32501const ChevronRight = createLucideIcon("ChevronRight", [ 32502 ["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }] 32503]); 32504 32505/** 32506 * @license lucide-react v0.453.0 - ISC 32507 * 32508 * This source code is licensed under the ISC license. 32509 * See the LICENSE file in the root directory of this source tree. 32510 */ 32511 32512 32513const CircleAlert = createLucideIcon("CircleAlert", [ 32514 ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }], 32515 ["line", { x1: "12", x2: "12", y1: "8", y2: "12", key: "1pkeuh" }], 32516 ["line", { x1: "12", x2: "12.01", y1: "16", y2: "16", key: "4dfq90" }] 32517]); 32518 32519/** 32520 * @license lucide-react v0.453.0 - ISC 32521 * 32522 * This source code is licensed under the ISC license. 32523 * See the LICENSE file in the root directory of this source tree. 32524 */ 32525 32526 32527const CircleUser = createLucideIcon("CircleUser", [ 32528 ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }], 32529 ["circle", { cx: "12", cy: "10", r: "3", key: "ilqhr7" }], 32530 ["path", { d: "M7 20.662V19a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v1.662", key: "154egf" }] 32531]); 32532 32533/** 32534 * @license lucide-react v0.453.0 - ISC 32535 * 32536 * This source code is licensed under the ISC license. 32537 * See the LICENSE file in the root directory of this source tree. 32538 */ 32539 32540 32541const ClipboardList = createLucideIcon("ClipboardList", [ 32542 ["rect", { width: "8", height: "4", x: "8", y: "2", rx: "1", ry: "1", key: "tgr4d6" }], 32543 [ 32544 "path", 32545 { 32546 d: "M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2", 32547 key: "116196" 32548 } 32549 ], 32550 ["path", { d: "M12 11h4", key: "1jrz19" }], 32551 ["path", { d: "M12 16h4", key: "n85exb" }], 32552 ["path", { d: "M8 11h.01", key: "1dfujw" }], 32553 ["path", { d: "M8 16h.01", key: "18s6g9" }] 32554]); 32555 32556/** 32557 * @license lucide-react v0.453.0 - ISC 32558 * 32559 * This source code is licensed under the ISC license. 32560 * See the LICENSE file in the root directory of this source tree. 32561 */ 32562 32563 32564const DollarSign = createLucideIcon("DollarSign", [ 32565 ["line", { x1: "12", x2: "12", y1: "2", y2: "22", key: "7eqyqh" }], 32566 ["path", { d: "M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6", key: "1b0p4s" }] 32567]); 32568 32569/** 32570 * @license lucide-react v0.453.0 - ISC 32571 * 32572 * This source code is licensed under the ISC license. 32573 * See the LICENSE file in the root directory of this source tree. 32574 */ 32575 32576 32577const EyeOff = createLucideIcon("EyeOff", [ 32578 [ 32579 "path", 32580 { 32581 d: "M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49", 32582 key: "ct8e1f" 32583 } 32584 ], 32585 ["path", { d: "M14.084 14.158a3 3 0 0 1-4.242-4.242", key: "151rxh" }], 32586 [ 32587 "path", 32588 { 32589 d: "M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143", 32590 key: "13bj9a" 32591 } 32592 ], 32593 ["path", { d: "m2 2 20 20", key: "1ooewy" }] 32594]); 32595 32596/** 32597 * @license lucide-react v0.453.0 - ISC 32598 * 32599 * This source code is licensed under the ISC license. 32600 * See the LICENSE file in the root directory of this source tree. 32601 */ 32602 32603 32604const Eye = createLucideIcon("Eye", [ 32605 [ 32606 "path", 32607 { 32608 d: "M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0", 32609 key: "1nclc0" 32610 } 32611 ], 32612 ["circle", { cx: "12", cy: "12", r: "3", key: "1v7zrd" }] 32613]); 32614 32615/** 32616 * @license lucide-react v0.453.0 - ISC 32617 * 32618 * This source code is licensed under the ISC license. 32619 * See the LICENSE file in the root directory of this source tree. 32620 */ 32621 32622 32623const FileCheck = createLucideIcon("FileCheck", [ 32624 ["path", { d: "M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z", key: "1rqfz7" }], 32625 ["path", { d: "M14 2v4a2 2 0 0 0 2 2h4", key: "tnqrlb" }], 32626 ["path", { d: "m9 15 2 2 4-4", key: "1grp1n" }] 32627]); 32628 32629/** 32630 * @license lucide-react v0.453.0 - ISC 32631 * 32632 * This source code is licensed under the ISC license. 32633 * See the LICENSE file in the root directory of this source tree. 32634 */ 32635 32636 32637const FileSearch = createLucideIcon("FileSearch", [ 32638 ["path", { d: "M14 2v4a2 2 0 0 0 2 2h4", key: "tnqrlb" }], 32639 [ 32640 "path", 32641 { d: "M4.268 21a2 2 0 0 0 1.727 1H18a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v3", key: "ms7g94" } 32642 ], 32643 ["path", { d: "m9 18-1.5-1.5", key: "1j6qii" }], 32644 ["circle", { cx: "5", cy: "14", r: "3", key: "ufru5t" }] 32645]); 32646 32647/** 32648 * @license lucide-react v0.453.0 - ISC 32649 * 32650 * This source code is licensed under the ISC license. 32651 * See the LICENSE file in the root directory of this source tree. 32652 */ 32653 32654 32655const FileSpreadsheet = createLucideIcon("FileSpreadsheet", [ 32656 ["path", { d: "M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z", key: "1rqfz7" }], 32657 ["path", { d: "M14 2v4a2 2 0 0 0 2 2h4", key: "tnqrlb" }], 32658 ["path", { d: "M8 13h2", key: "yr2amv" }], 32659 ["path", { d: "M14 13h2", key: "un5t4a" }], 32660 ["path", { d: "M8 17h2", key: "2yhykz" }], 32661 ["path", { d: "M14 17h2", key: "10kma7" }] 32662]); 32663 32664/** 32665 * @license lucide-react v0.453.0 - ISC 32666 * 32667 * This source code is licensed under the ISC license. 32668 * See the LICENSE file in the root directory of this source tree. 32669 */ 32670 32671 32672const FileText = createLucideIcon("FileText", [ 32673 ["path", { d: "M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z", key: "1rqfz7" }], 32674 ["path", { d: "M14 2v4a2 2 0 0 0 2 2h4", key: "tnqrlb" }], 32675 ["path", { d: "M10 9H8", key: "b1mrlr" }], 32676 ["path", { d: "M16 13H8", key: "t4e002" }], 32677 ["path", { d: "M16 17H8", key: "z1uh3a" }] 32678]); 32679 32680/** 32681 * @license lucide-react v0.453.0 - ISC 32682 * 32683 * This source code is licensed under the ISC license. 32684 * See the LICENSE file in the root directory of this source tree. 32685 */ 32686 32687 32688const Gift = createLucideIcon("Gift", [ 32689 ["rect", { x: "3", y: "8", width: "18", height: "4", rx: "1", key: "bkv52" }], 32690 ["path", { d: "M12 8v13", key: "1c76mn" }], 32691 ["path", { d: "M19 12v7a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2v-7", key: "6wjy6b" }], 32692 [ 32693 "path", 32694 { 32695 d: "M7.5 8a2.5 2.5 0 0 1 0-5A4.8 8 0 0 1 12 8a4.8 8 0 0 1 4.5-5 2.5 2.5 0 0 1 0 5", 32696 key: "1ihvrl" 32697 } 32698 ] 32699]); 32700 32701/** 32702 * @license lucide-react v0.453.0 - ISC 32703 * 32704 * This source code is licensed under the ISC license. 32705 * See the LICENSE file in the root directory of this source tree. 32706 */ 32707 32708 32709const GripVertical = createLucideIcon("GripVertical", [ 32710 ["circle", { cx: "9", cy: "12", r: "1", key: "1vctgf" }], 32711 ["circle", { cx: "9", cy: "5", r: "1", key: "hp0tcf" }], 32712 ["circle", { cx: "9", cy: "19", r: "1", key: "fkjjf6" }], 32713 ["circle", { cx: "15", cy: "12", r: "1", key: "1tmaij" }], 32714 ["circle", { cx: "15", cy: "5", r: "1", key: "19l28e" }], 32715 ["circle", { cx: "15", cy: "19", r: "1", key: "f4zoj3" }] 32716]); 32717 32718/** 32719 * @license lucide-react v0.453.0 - ISC 32720 * 32721 * This source code is licensed under the ISC license. 32722 * See the LICENSE file in the root directory of this source tree. 32723 */ 32724 32725 32726const LayoutDashboard = createLucideIcon("LayoutDashboard", [ 32727 ["rect", { width: "7", height: "9", x: "3", y: "3", rx: "1", key: "10lvy0" }], 32728 ["rect", { width: "7", height: "5", x: "14", y: "3", rx: "1", key: "16une8" }], 32729 ["rect", { width: "7", height: "9", x: "14", y: "12", rx: "1", key: "1hutg5" }], 32730 ["rect", { width: "7", height: "5", x: "3", y: "16", rx: "1", key: "ldoo1y" }] 32731]); 32732 32733/** 32734 * @license lucide-react v0.453.0 - ISC 32735 * 32736 * This source code is licensed under the ISC license. 32737 * See the LICENSE file in the root directory of this source tree. 32738 */ 32739 32740 32741const Lightbulb = createLucideIcon("Lightbulb", [ 32742 [ 32743 "path", 32744 { 32745 d: "M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5", 32746 key: "1gvzjb" 32747 } 32748 ], 32749 ["path", { d: "M9 18h6", key: "x1upvd" }], 32750 ["path", { d: "M10 22h4", key: "ceow96" }] 32751]); 32752 32753/** 32754 * @license lucide-react v0.453.0 - ISC 32755 * 32756 * This source code is licensed under the ISC license. 32757 * See the LICENSE file in the root directory of this source tree. 32758 */ 32759 32760
32761const LoaderCircle = createLucideIcon("LoaderCircle", [ 32762 ["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }] 32763]); 32764 32765/** 32766 * @license lucide-react v0.453.0 - ISC 32767 * 32768 * This source code is licensed under the ISC license. 32769 * See the LICENSE file in the root directory of this source tree. 32770 */ 32771 32772 32773const LogIn = createLucideIcon("LogIn", [ 32774 ["path", { d: "M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4", key: "u53s6r" }], 32775 ["polyline", { points: "10 17 15 12 10 7", key: "1ail0h" }], 32776 ["line", { x1: "15", x2: "3", y1: "12", y2: "12", key: "v6grx8" }] 32777]); 32778 32779/** 32780 * @license lucide-react v0.453.0 - ISC 32781 * 32782 * This source code is licensed under the ISC license. 32783 * See the LICENSE file in the root directory of this source tree. 32784 */ 32785 32786 32787const LogOut = createLucideIcon("LogOut", [ 32788 ["path", { d: "M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4", key: "1uf3rs" }], 32789 ["polyline", { points: "16 17 21 12 16 7", key: "1gabdz" }], 32790 ["line", { x1: "21", x2: "9", y1: "12", y2: "12", key: "1uyos4" }] 32791]); 32792 32793/** 32794 * @license lucide-react v0.453.0 - ISC 32795 * 32796 * This source code is licensed under the ISC license. 32797 * See the LICENSE file in the root directory of this source tree. 32798 */ 32799 32800 32801const Mail = createLucideIcon("Mail", [ 32802 ["rect", { width: "20", height: "16", x: "2", y: "4", rx: "2", key: "18n3k1" }], 32803 ["path", { d: "m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7", key: "1ocrg3" }] 32804]); 32805 32806/** 32807 * @license lucide-react v0.453.0 - ISC 32808 * 32809 * This source code is licensed under the ISC license. 32810 * See the LICENSE file in the root directory of this source tree. 32811 */ 32812 32813 32814const Megaphone = createLucideIcon("Megaphone", [ 32815 ["path", { d: "m3 11 18-5v12L3 14v-3z", key: "n962bs" }], 32816 ["path", { d: "M11.6 16.8a3 3 0 1 1-5.8-1.6", key: "1yl0tm" }] 32817]); 32818 32819/** 32820 * @license lucide-react v0.453.0 - ISC 32821 * 32822 * This source code is licensed under the ISC license. 32823 * See the LICENSE file in the root directory of this source tree. 32824 */ 32825 32826 32827const Menu = createLucideIcon("Menu", [ 32828 ["line", { x1: "4", x2: "20", y1: "12", y2: "12", key: "1e0a9i" }], 32829 ["line", { x1: "4", x2: "20", y1: "6", y2: "6", key: "1owob3" }], 32830 ["line", { x1: "4", x2: "20", y1: "18", y2: "18", key: "yk5zj1" }] 32831]); 32832 32833/** 32834 * @license lucide-react v0.453.0 - ISC 32835 * 32836 * This source code is licensed under the ISC license. 32837 * See the LICENSE file in the root directory of this source tree. 32838 */ 32839 32840 32841const MessageSquareWarning = createLucideIcon("MessageSquareWarning", [ 32842 ["path", { d: "M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z", key: "1lielz" }], 32843 ["path", { d: "M12 7v2", key: "stiyo7" }], 32844 ["path", { d: "M12 13h.01", key: "y0uutt" }] 32845]); 32846 32847/** 32848 * @license lucide-react v0.453.0 - ISC 32849 * 32850 * This source code is licensed under the ISC license. 32851 * See the LICENSE file in the root directory of this source tree. 32852 */ 32853 32854 32855const MessageSquare = createLucideIcon("MessageSquare", [ 32856 ["path", { d: "M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z", key: "1lielz" }] 32857]); 32858 32859/** 32860 * @license lucide-react v0.453.0 - ISC 32861 * 32862 * This source code is licensed under the ISC license. 32863 * See the LICENSE file in the root directory of this source tree. 32864 */ 32865 32866 32867const Pencil = createLucideIcon("Pencil", [ 32868 [ 32869 "path", 32870 { 32871 d: "M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z", 32872 key: "1a8usu" 32873 } 32874 ], 32875 ["path", { d: "m15 5 4 4", key: "1mk7zo" }] 32876]); 32877 32878/** 32879 * @license lucide-react v0.453.0 - ISC 32880 * 32881 * This source code is licensed under the ISC license. 32882 * See the LICENSE file in the root directory of this source tree. 32883 */ 32884 32885 32886const RefreshCcw = createLucideIcon("RefreshCcw", [ 32887 ["path", { d: "M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8", key: "14sxne" }], 32888 ["path", { d: "M3 3v5h5", key: "1xhq8a" }], 32889 ["path", { d: "M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16", key: "1hlbsb" }], 32890 ["path", { d: "M16 16h5v5", key: "ccwih5" }] 32891]); 32892 32893/** 32894 * @license lucide-react v0.453.0 - ISC 32895 * 32896 * This source code is licensed under the ISC license. 32897 * See the LICENSE file in the root directory of this source tree. 32898 */ 32899 32900 32901const RefreshCw = createLucideIcon("RefreshCw", [ 32902 ["path", { d: "M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8", key: "v9h5vc" }], 32903 ["path", { d: "M21 3v5h-5", key: "1q7to0" }], 32904 ["path", { d: "M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16", key: "3uifl3" }], 32905 ["path", { d: "M8 16H3v5", key: "1cv678" }] 32906]); 32907 32908/** 32909 * @license lucide-react v0.453.0 - ISC 32910 * 32911 * This source code is licensed under the ISC license. 32912 * See the LICENSE file in the root directory of this source tree. 32913 */ 32914 32915 32916const RotateCcw = createLucideIcon("RotateCcw", [ 32917 ["path", { d: "M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8", key: "1357e3" }], 32918 ["path", { d: "M3 3v5h5", key: "1xhq8a" }] 32919]); 32920 32921/** 32922 * @license lucide-react v0.453.0 - ISC 32923 * 32924 * This source code is licensed under the ISC license. 32925 * See the LICENSE file in the root directory of this source tree. 32926 */ 32927 32928 32929const Send = createLucideIcon("Send", [ 32930 [ 32931 "path", 32932 { 32933 d: "M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z", 32934 key: "1ffxy3" 32935 } 32936 ], 32937 ["path", { d: "m21.854 2.147-10.94 10.939", key: "12cjpa" }] 32938]); 32939 32940/** 32941 * @license lucide-react v0.453.0 - ISC 32942 * 32943 * This source code is licensed under the ISC license. 32944 * See the LICENSE file in the root directory of this source tree. 32945 */ 32946 32947 32948const Settings = createLucideIcon("Settings", [ 32949 [ 32950 "path", 32951 { 32952 d: "M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z", 32953 key: "1qme2f" 32954 } 32955 ], 32956 ["circle", { cx: "12", cy: "12", r: "3", key: "1v7zrd" }] 32957]); 32958 32959/** 32960 * @license lucide-react v0.453.0 - ISC 32961 * 32962 * This source code is licensed under the ISC license. 32963 * See the LICENSE file in the root directory of this source tree. 32964 */ 32965 32966 32967const ShieldCheck = createLucideIcon("ShieldCheck", [ 32968 [ 32969 "path", 32970 { 32971 d: "M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z", 32972 key: "oel41y" 32973 } 32974 ], 32975 ["path", { d: "m9 12 2 2 4-4", key: "dzmm74" }] 32976]); 32977 32978/** 32979 * @license lucide-react v0.453.0 - ISC 32980 * 32981 * This source code is licensed under the ISC license. 32982 * See the LICENSE file in the root directory of this source tree. 32983 */ 32984 32985 32986const Shield = createLucideIcon("Shield", [ 32987 [ 32988 "path", 32989 { 32990 d: "M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z", 32991 key: "oel41y" 32992 } 32993 ] 32994]); 32995 32996/** 32997 * @license lucide-react v0.453.0 - ISC 32998 * 32999 * This source code is licensed under the ISC license. 33000 * See the LICENSE file in the root directory of this source tree. 33001 */ 33002 33003 33004const Star = createLucideIcon("Star", [ 33005 [ 33006 "polygon", 33007 { 33008 points: "12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2", 33009 key: "8f66p6" 33010 } 33011 ] 33012]); 33013 33014/** 33015 * @license lucide-react v0.453.0 - ISC 33016 * 33017 * This source code is licensed under the ISC license. 33018 * See the LICENSE file in the root directory of this source tree. 33019 */ 33020 33021 33022const TrendingUp = createLucideIcon("TrendingUp", [ 33023 ["polyline", { points: "22 7 13.5 15.5 8.5 10.5 2 17", key: "126l90" }], 33024 ["polyline", { points: "16 7 22 7 22 13", key: "kwv8wd" }] 33025]); 33026 33027/** 33028 * @license lucide-react v0.453.0 - ISC 33029 * 33030 * This source code is licensed under the ISC license. 33031 * See the LICENSE file in the root directory of this source tree. 33032 */ 33033 33034 33035const TriangleAlert = createLucideIcon("TriangleAlert", [ 33036 [ 33037 "path", 33038 { 33039 d: "m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3", 33040 key: "wmoenq" 33041 } 33042 ], 33043 ["path", { d: "M12 9v4", key: "juzpu7" }], 33044 ["path", { d: "M12 17h.01", key: "p32p05" }] 33045]); 33046 33047/** 33048 * @license lucide-react v0.453.0 - ISC 33049 * 33050 * This source code is licensed under the ISC license. 33051 * See the LICENSE file in the root directory of this source tree. 33052 */ 33053 33054 33055const UserPlus = createLucideIcon("UserPlus", [ 33056 ["path", { d: "M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2", key: "1yyitq" }], 33057 ["circle", { cx: "9", cy: "7", r: "4", key: "nufk8" }], 33058 ["line", { x1: "19", x2: "19", y1: "8", y2: "14", key: "1bvyxn" }], 33059 ["line", { x1: "22", x2: "16", y1: "11", y2: "11", key: "1shjgl" }] 33060]); 33061 33062/** 33063 * @license lucide-react v0.453.0 - ISC 33064 * 33065 * This source code is licensed under the ISC license. 33066 * See the LICENSE file in the root directory of this source tree. 33067 */ 33068 33069 33070const Users = createLucideIcon("Users", [ 33071 ["path", { d: "M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2", key: "1yyitq" }], 33072 ["circle", { cx: "9", cy: "7", r: "4", key: "nufk8" }], 33073 ["path", { d: "M22 21v-2a4 4 0 0 0-3-3.87", key: "kshegd" }], 33074 ["path", { d: "M16 3.13a4 4 0 0 1 0 7.75", key: "1da9ce" }] 33075]); 33076 33077/** 33078 * @license lucide-react v0.453.0 - ISC 33079 * 33080 * This source code is licensed under the ISC license. 33081 * See the LICENSE file in the root directory of this source tree. 33082 */ 33083 33084 33085const Wallet = createLucideIcon("Wallet", [ 33086 [ 33087 "path", 33088 { 33089 d: "M19 7V4a1 1 0 0 0-1-1H5a2 2 0 0 0 0 4h15a1 1 0 0 1 1 1v4h-3a2 2 0 0 0 0 4h3a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1", 33090 key: "18etb6" 33091 } 33092 ], 33093 ["path", { d: "M3 5v14a2 2 0 0 0 2 2h15a1 1 0 0 0 1-1v-4", key: "xoc0q4" }] 33094]); 33095 33096/** 33097 * @license lucide-react v0.453.0 - ISC 33098 * 33099 * This source code is licensed under the ISC license. 33100 * See the LICENSE file in the root directory of this source tree. 33101 */ 33102 33103 33104const X = createLucideIcon("X", [ 33105 ["path", { d: "M18 6 6 18", key: "1bl5f8" }], 33106 ["path", { d: "m6 6 12 12", key: "d8bk6v" }] 33107]); 33108 33109class ErrorBoundary extends reactExports.Component { 33110 constructor(props) { 33111 super(props); 33112 this.state = { hasError: false, error: null }; 33113 } 33114 static getDerivedStateFromError(error) { 33115 return { hasError: true, error }; 33116 } 33117 render() { 33118 if (this.state.hasError) { 33119 return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex items-center justify-center min-h-screen p-8 bg-background", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col items-center w-full max-w-2xl p-8", children: [
33120 /* @__PURE__ */ jsxRuntimeExports.jsx( 33121 TriangleAlert, 33122 { 33123 size: 48, 33124 className: "text-destructive mb-6 flex-shrink-0" 33125 } 33126 ), 33127 /* @__PURE__ */ jsxRuntimeExports.jsx("h2", { className: "text-xl mb-4", children: "An unexpected error occurred." }), 33128 /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "p-4 w-full rounded bg-muted overflow-auto mb-6", children: /* @__PURE__ */ jsxRuntimeExports.jsx("pre", { className: "text-sm text-muted-foreground whitespace-break-spaces", children: this.state.error?.stack }) }), 33129 /* @__PURE__ */ jsxRuntimeExports.jsxs( 33130 "button", 33131 { 33132 onClick: () => window.location.reload(), 33133 className: cn( 33134 "flex items-center gap-2 px-4 py-2 rounded-lg", 33135 "bg-primary text-primary-foreground", 33136 "hover:opacity-90 cursor-pointer" 33137 ), 33138 children: [ 33139 /* @__PURE__ */ jsxRuntimeExports.jsx(RotateCcw, { size: 16 }), 33140 "Reload Page" 33141 ] 33142 } 33143 ) 33144 ] }) }); 33145 } 33146 return this.props.children; 33147 } 33148} 33149 33150const ThemeContext = reactExports.createContext(void 0); 33151function ThemeProvider({ 33152 children, 33153 defaultTheme = "light", 33154 switchable = false 33155}) { 33156 const [theme, setTheme] = reactExports.useState(() => { 33157 if (switchable) { 33158 const stored = localStorage.getItem("theme"); 33159 return stored || defaultTheme; 33160 } 33161 return defaultTheme; 33162 }); 33163 reactExports.useEffect(() => { 33164 const root = document.documentElement; 33165 if (theme === "dark") { 33166 root.classList.add("dark"); 33167 } else { 33168 root.classList.remove("dark"); 33169 } 33170 if (switchable) { 33171 localStorage.setItem("theme", theme); 33172 } 33173 }, [theme, switchable]); 33174 const toggleTheme = switchable ? () => { 33175 setTheme((prev) => prev === "light" ? "dark" : "light"); 33176 } : void 0; 33177 return /* @__PURE__ */ jsxRuntimeExports.jsx(ThemeContext.Provider, { value: { theme, toggleTheme, switchable }, children }); 33178} 33179 33180const getLoginUrl = (returnPath) => { 33181 const oauthPortalUrl = "https://manus.im"; 33182 const appId = "ms8UWKEcRWG3YzbxUBnVFM"; 33183 const redirectUri = `${window.location.origin}/api/oauth/callback`; 33184 const path = window.location.pathname + window.location.search; 33185 const state = btoa(JSON.stringify({ redirectUri, returnPath: path })); 33186 try { 33187 const url = new URL(`${oauthPortalUrl}/app-auth`); 33188 url.searchParams.set("appId", appId); 33189 url.searchParams.set("redirectUri", redirectUri); 33190 url.searchParams.set("state", state); 33191 url.searchParams.set("type", "signIn"); 33192 return url.toString(); 33193 } catch { 33194 return `https://manus.im/app-auth?appId=${encodeURIComponent(appId)}&redirectUri=${encodeURIComponent(redirectUri)}&state=${encodeURIComponent(state)}&type=signIn`; 33195 } 33196}; 33197 33198function useAuth(options) { 33199 const { redirectOnUnauthenticated = false, redirectPath = getLoginUrl() } = {}; 33200 const utils = trpc.useUtils(); 33201 const meQuery = trpc.auth.me.useQuery(void 0, { 33202 retry: false, 33203 refetchOnWindowFocus: false 33204 }); 33205 const logoutMutation = trpc.auth.logout.useMutation({ 33206 onSuccess: () => { 33207 utils.auth.me.setData(void 0, null); 33208 } 33209 }); 33210 const logout = reactExports.useCallback(async () => { 33211 try { 33212 await logoutMutation.mutateAsync(); 33213 } catch (error) { 33214 if (error instanceof TRPCClientError && error.data?.code === "UNAUTHORIZED") { 33215 return; 33216 } 33217 throw error; 33218 } finally { 33219 utils.auth.me.setData(void 0, null); 33220 await utils.auth.me.invalidate(); 33221 } 33222 }, [logoutMutation, utils]); 33223 const state = reactExports.useMemo(() => { 33224 localStorage.setItem( 33225 "manus-runtime-user-info", 33226 JSON.stringify(meQuery.data) 33227 ); 33228 return { 33229 user: meQuery.data ?? null, 33230 loading: meQuery.isLoading || logoutMutation.isPending, 33231 error: meQuery.error ?? logoutMutation.error ?? null, 33232 isAuthenticated: Boolean(meQuery.data) 33233 }; 33234 }, [ 33235 meQuery.data, 33236 meQuery.error, 33237 meQuery.isLoading, 33238 logoutMutation.error, 33239 logoutMutation.isPending 33240 ]); 33241 reactExports.useEffect(() => { 33242 if (!redirectOnUnauthenticated) return; 33243 if (meQuery.isLoading || logoutMutation.isPending) return; 33244 if (state.user) return; 33245 if (typeof window === "undefined") return; 33246 if (window.location.pathname === redirectPath) return; 33247 window.location.href = redirectPath; 33248 }, [ 33249 redirectOnUnauthenticated, 33250 redirectPath, 33251 logoutMutation.isPending, 33252 meQuery.isLoading, 33253 state.user 33254 ]); 33255 return { 33256 ...state, 33257 refresh: () => meQuery.refetch(), 33258 logout 33259 }; 33260} 33261 33262const STORAGE_KEY = "eps_agent_session"; 33263function getStoredSession() { 33264 try { 33265 const raw = localStorage.getItem(STORAGE_KEY); 33266 if (!raw) return null; 33267 return JSON.parse(raw); 33268 } catch { 33269 return null; 33270 } 33271} 33272function setStoredSession(session) { 33273 if (session) { 33274 localStorage.setItem(STORAGE_KEY, JSON.stringify(session)); 33275 } else { 33276 localStorage.removeItem(STORAGE_KEY); 33277 } 33278} 33279function setStoredAgentSession(session) { 33280 setStoredSession(session); 33281} 33282function useAgentAuth() { 33283 const [, setLocation] = useLocation(); 33284 const utils = trpc.useUtils(); 33285 const [localSession, setLocalSession] = reactExports.useState(() => { 33286 try { 33287 const params = new URLSearchParams(window.location.search); 33288 if (params.get("_al") === "1") {
33289 const agentKey = params.get("ak") ?? ""; 33290 const agentName = params.get("an") ?? ""; 33291 const isAdmin = params.get("adm") === "1"; 33292 if (agentKey) { 33293 const session = { agentKey, agentName, isAdmin }; 33294 setStoredSession(session); 33295 const clean = new URL(window.location.href); 33296 clean.searchParams.delete("_al"); 33297 clean.searchParams.delete("ak"); 33298 clean.searchParams.delete("an"); 33299 clean.searchParams.delete("adm"); 33300 window.history.replaceState({}, "", clean.pathname + (clean.search || "")); 33301 return session; 33302 } 33303 } 33304 } catch { 33305 } 33306 return getStoredSession(); 33307 }); 33308 const meQuery = trpc.agentAuth.me.useQuery(void 0, { 33309 retry: false, 33310 refetchOnWindowFocus: false, 33311 // If we already have a local session, don't block on the server check 33312 enabled: true 33313 }); 33314 reactExports.useEffect(() => { 33315 if (meQuery.data) { 33316 setLocalSession(meQuery.data); 33317 setStoredSession(meQuery.data); 33318 } else if (meQuery.data === null && !meQuery.isLoading) ; 33319 }, [meQuery.data, meQuery.isLoading]); 33320 const logoutMutation = trpc.agentAuth.logout.useMutation({ 33321 onSuccess: () => { 33322 setLocalSession(null); 33323 setStoredSession(null); 33324 utils.agentAuth.me.setData(void 0, null); 33325 setLocation("/agent-login"); 33326 } 33327 }); 33328 const logout = reactExports.useCallback(async () => { 33329 await logoutMutation.mutateAsync(); 33330 }, [logoutMutation]); 33331 const agent = meQuery.data ?? localSession; 33332 const loading = meQuery.isLoading && !localSession; 33333 const isAgentAdmin = agent?.isAdmin === true; 33334 return { 33335 agent, 33336 loading, 33337 isAuthenticated: Boolean(agent), 33338 isAgentAdmin, 33339 logout, 33340 setLocalSession: (session) => { 33341 setLocalSession(session); 33342 setStoredSession(session); 33343 } 33344 }; 33345} 33346 33347function useCombinedRefs() { 33348 for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) { 33349 refs[_key] = arguments[_key]; 33350 } 33351 33352 return reactExports.useMemo(() => node => { 33353 refs.forEach(ref => ref(node)); 33354 }, // eslint-disable-next-line react-hooks/exhaustive-deps 33355 refs); 33356} 33357 33358// https://github.com/facebook/react/blob/master/packages/shared/ExecutionEnvironment.js 33359const canUseDOM = typeof window !== 'undefined' && typeof window.document !== 'undefined' && typeof window.document.createElement !== 'undefined'; 33360 33361function isWindow(element) { 33362 const elementString = Object.prototype.toString.call(element); 33363 return elementString === '[object Window]' || // In Electron context the Window object serializes to [object global] 33364 elementString === '[object global]'; 33365} 33366 33367function isNode(node) { 33368 return 'nodeType' in node; 33369} 33370 33371function getWindow(target) { 33372 var _target$ownerDocument, _target$ownerDocument2; 33373 33374 if (!target) { 33375 return window; 33376 } 33377 33378 if (isWindow(target)) { 33379 return target; 33380 } 33381 33382 if (!isNode(target)) { 33383 return window; 33384 } 33385 33386 return (_target$ownerDocument = (_target$ownerDocument2 = target.ownerDocument) == null ? void 0 : _target$ownerDocument2.defaultView) != null ? _target$ownerDocument : window; 33387} 33388 33389function isDocument(node) { 33390 const { 33391 Document 33392 } = getWindow(node); 33393 return node instanceof Document; 33394} 33395 33396function isHTMLElement(node) { 33397 if (isWindow(node)) { 33398 return false; 33399 } 33400 33401 return node instanceof getWindow(node).HTMLElement; 33402} 33403 33404function isSVGElement(node) { 33405 return node instanceof getWindow(node).SVGElement; 33406} 33407 33408function getOwnerDocument(target) { 33409 if (!target) { 33410 return document; 33411 } 33412 33413 if (isWindow(target)) { 33414 return target.document; 33415 } 33416 33417 if (!isNode(target)) { 33418 return document; 33419 } 33420 33421 if (isDocument(target)) { 33422 return target; 33423 } 33424 33425 if (isHTMLElement(target) || isSVGElement(target)) { 33426 return target.ownerDocument; 33427 } 33428 33429 return document; 33430} 33431 33432/** 33433 * A hook that resolves to useEffect on the server and useLayoutEffect on the client 33434 * @param callback {function} Callback function that is invoked when the dependencies of the hook change 33435 */ 33436 33437const useIsomorphicLayoutEffect$1 = canUseDOM ? reactExports.useLayoutEffect : reactExports.useEffect; 33438 33439function useEvent(handler) { 33440 const handlerRef = reactExports.useRef(handler); 33441 useIsomorphicLayoutEffect$1(() => { 33442 handlerRef.current = handler; 33443 }); 33444 return reactExports.useCallback(function () { 33445 for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { 33446 args[_key] = arguments[_key]; 33447 } 33448 33449 return handlerRef.current == null ? void 0 : handlerRef.current(...args); 33450 }, []); 33451} 33452 33453function useInterval() { 33454 const intervalRef = reactExports.useRef(null); 33455 const set = reactExports.useCallback((listener, duration) => { 33456 intervalRef.current = setInterval(listener, duration); 33457 }, []); 33458 const clear = reactExports.useCallback(() => { 33459 if (intervalRef.current !== null) { 33460 clearInterval(intervalRef.current); 33461 intervalRef.current = null; 33462 } 33463 }, []); 33464 return [set, clear]; 33465} 33466 33467function useLatestValue(value, dependencies) { 33468 if (dependencies === void 0) { 33469 dependencies = [value]; 33470 } 33471 33472 const valueRef = reactExports.useRef(value); 33473 useIsomorphicLayoutEffect$1(() => { 33474 if (valueRef.current !== value) { 33475 valueRef.current = value; 33476 } 33477 }, dependencies); 33478 return valueRef; 33479} 33480 33481function useLazyMemo(callback, dependencies) { 33482 const valueRef = reactExports.useRef(); 33483 return reactExports.useMemo(() => { 33484 const newValue = callback(valueRef.current); 33485 valueRef.current = newValue; 33486 return newValue; 33487 }, // eslint-disable-next-line react-hooks/exhaustive-deps
vendor: 4,258 bytes, lines 33488-33695
33488 [...dependencies]); 33489} 33490 33491function useNodeRef(onChange) { 33492 const onChangeHandler = useEvent(onChange); 33493 const node = reactExports.useRef(null); 33494 const setNodeRef = reactExports.useCallback(element => { 33495 if (element !== node.current) { 33496 onChangeHandler == null ? void 0 : onChangeHandler(element, node.current); 33497 } 33498 33499 node.current = element; 33500 }, //eslint-disable-next-line 33501 []); 33502 return [node, setNodeRef]; 33503} 33504 33505function usePrevious(value) { 33506 const ref = reactExports.useRef(); 33507 reactExports.useEffect(() => { 33508 ref.current = value; 33509 }, [value]); 33510 return ref.current; 33511} 33512 33513let ids = {}; 33514function useUniqueId(prefix, value) { 33515 return reactExports.useMemo(() => { 33516 if (value) { 33517 return value; 33518 } 33519 33520 const id = ids[prefix] == null ? 0 : ids[prefix] + 1; 33521 ids[prefix] = id; 33522 return prefix + "-" + id; 33523 }, [prefix, value]); 33524} 33525 33526function createAdjustmentFn(modifier) { 33527 return function (object) { 33528 for (var _len = arguments.length, adjustments = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { 33529 adjustments[_key - 1] = arguments[_key]; 33530 } 33531 33532 return adjustments.reduce((accumulator, adjustment) => { 33533 const entries = Object.entries(adjustment); 33534 33535 for (const [key, valueAdjustment] of entries) { 33536 const value = accumulator[key]; 33537 33538 if (value != null) { 33539 accumulator[key] = value + modifier * valueAdjustment; 33540 } 33541 } 33542 33543 return accumulator; 33544 }, { ...object 33545 }); 33546 }; 33547} 33548 33549const add = /*#__PURE__*/createAdjustmentFn(1); 33550const subtract = /*#__PURE__*/createAdjustmentFn(-1); 33551 33552function hasViewportRelativeCoordinates(event) { 33553 return 'clientX' in event && 'clientY' in event; 33554} 33555 33556function isKeyboardEvent(event) { 33557 if (!event) { 33558 return false; 33559 } 33560 33561 const { 33562 KeyboardEvent 33563 } = getWindow(event.target); 33564 return KeyboardEvent && event instanceof KeyboardEvent; 33565} 33566 33567function isTouchEvent(event) { 33568 if (!event) { 33569 return false; 33570 } 33571 33572 const { 33573 TouchEvent 33574 } = getWindow(event.target); 33575 return TouchEvent && event instanceof TouchEvent; 33576} 33577 33578/** 33579 * Returns the normalized x and y coordinates for mouse and touch events. 33580 */ 33581 33582function getEventCoordinates(event) { 33583 if (isTouchEvent(event)) { 33584 if (event.touches && event.touches.length) { 33585 const { 33586 clientX: x, 33587 clientY: y 33588 } = event.touches[0]; 33589 return { 33590 x, 33591 y 33592 }; 33593 } else if (event.changedTouches && event.changedTouches.length) { 33594 const { 33595 clientX: x, 33596 clientY: y 33597 } = event.changedTouches[0]; 33598 return { 33599 x, 33600 y 33601 }; 33602 } 33603 } 33604 33605 if (hasViewportRelativeCoordinates(event)) { 33606 return { 33607 x: event.clientX, 33608 y: event.clientY 33609 }; 33610 } 33611 33612 return null; 33613} 33614 33615const CSS$1 = /*#__PURE__*/Object.freeze({ 33616 Translate: { 33617 toString(transform) { 33618 if (!transform) { 33619 return; 33620 } 33621 33622 const { 33623 x, 33624 y 33625 } = transform; 33626 return "translate3d(" + (x ? Math.round(x) : 0) + "px, " + (y ? Math.round(y) : 0) + "px, 0)"; 33627 } 33628 33629 }, 33630 Scale: { 33631 toString(transform) { 33632 if (!transform) { 33633 return; 33634 } 33635 33636 const { 33637 scaleX, 33638 scaleY 33639 } = transform; 33640 return "scaleX(" + scaleX + ") scaleY(" + scaleY + ")"; 33641 } 33642 33643 }, 33644 Transform: { 33645 toString(transform) { 33646 if (!transform) { 33647 return; 33648 } 33649 33650 return [CSS$1.Translate.toString(transform), CSS$1.Scale.toString(transform)].join(' '); 33651 } 33652 33653 }, 33654 Transition: { 33655 toString(_ref) { 33656 let { 33657 property, 33658 duration, 33659 easing 33660 } = _ref; 33661 return property + " " + duration + "ms " + easing; 33662 } 33663 33664 } 33665}); 33666 33667const SELECTOR = 'a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]'; 33668function findFirstFocusableNode(element) { 33669 if (element.matches(SELECTOR)) { 33670 return element; 33671 } 33672 33673 return element.querySelector(SELECTOR); 33674} 33675 33676const hiddenStyles = { 33677 display: 'none' 33678}; 33679function HiddenText(_ref) { 33680 let { 33681 id, 33682 value 33683 } = _ref; 33684 return React.createElement("div", { 33685 id: id, 33686 style: hiddenStyles 33687 }, value); 33688} 33689 33690function LiveRegion(_ref) { 33691 let { 33692 id, 33693 announcement, 33694 ariaLiveType = "assertive" 33695 }
33695 = _ref; 33696 // Hide element visually but keep it readable by screen readers 33697 const visuallyHidden = { 33698 position: 'fixed', 33699 top: 0, 33700 left: 0, 33701 width: 1, 33702 height: 1, 33703 margin: -1, 33704 border: 0, 33705 padding: 0, 33706 overflow: 'hidden', 33707 clip: 'rect(0 0 0 0)', 33708 clipPath: 'inset(100%)', 33709 whiteSpace: 'nowrap' 33710 }; 33711 return React.createElement("div", { 33712 id: id, 33713 style: visuallyHidden, 33714 role: "status", 33715 "aria-live": ariaLiveType, 33716 "aria-atomic": true 33717 }, announcement); 33718} 33719 33720function useAnnouncement() { 33721 const [announcement, setAnnouncement] = reactExports.useState(''); 33722 const announce = reactExports.useCallback(value => { 33723 if (value != null) { 33724 setAnnouncement(value); 33725 } 33726 }, []); 33727 return { 33728 announce, 33729 announcement 33730 }; 33731} 33732 33733const DndMonitorContext = /*#__PURE__*/reactExports.createContext(null); 33734 33735function useDndMonitor(listener) { 33736 const registerListener = reactExports.useContext(DndMonitorContext); 33737 reactExports.useEffect(() => { 33738 if (!registerListener) { 33739 throw new Error('useDndMonitor must be used within a children of <DndContext>'); 33740 } 33741 33742 const unsubscribe = registerListener(listener); 33743 return unsubscribe; 33744 }, [listener, registerListener]); 33745} 33746 33747function useDndMonitorProvider() { 33748 const [listeners] = reactExports.useState(() => new Set()); 33749 const registerListener = reactExports.useCallback(listener => { 33750 listeners.add(listener); 33751 return () => listeners.delete(listener); 33752 }, [listeners]); 33753 const dispatch = reactExports.useCallback(_ref => { 33754 let { 33755 type, 33756 event 33757 } = _ref; 33758 listeners.forEach(listener => { 33759 var _listener$type; 33760 33761 return (_listener$type = listener[type]) == null ? void 0 : _listener$type.call(listener, event); 33762 }); 33763 }, [listeners]); 33764 return [dispatch, registerListener]; 33765} 33766 33767const defaultScreenReaderInstructions = { 33768 draggable: "\n To pick up a draggable item, press the space bar.\n While dragging, use the arrow keys to move the item.\n Press space again to drop the item in its new position, or press escape to cancel.\n " 33769}; 33770const defaultAnnouncements = { 33771 onDragStart(_ref) { 33772 let { 33773 active 33774 } = _ref; 33775 return "Picked up draggable item " + active.id + "."; 33776 }, 33777 33778 onDragOver(_ref2) { 33779 let { 33780 active, 33781 over 33782 } = _ref2; 33783 33784 if (over) { 33785 return "Draggable item " + active.id + " was moved over droppable area " + over.id + "."; 33786 } 33787 33788 return "Draggable item " + active.id + " is no longer over a droppable area."; 33789 }, 33790 33791 onDragEnd(_ref3) { 33792 let { 33793 active, 33794 over 33795 } = _ref3; 33796 33797 if (over) { 33798 return "Draggable item " + active.id + " was dropped over droppable area " + over.id; 33799 } 33800 33801 return "Draggable item " + active.id + " was dropped."; 33802 }, 33803 33804 onDragCancel(_ref4) { 33805 let { 33806 active 33807 } = _ref4; 33808 return "Dragging was cancelled. Draggable item " + active.id + " was dropped."; 33809 } 33810 33811}; 33812 33813function Accessibility(_ref) { 33814 let { 33815 announcements = defaultAnnouncements, 33816 container, 33817 hiddenTextDescribedById, 33818 screenReaderInstructions = defaultScreenReaderInstructions 33819 } = _ref; 33820 const { 33821 announce, 33822 announcement 33823 } = useAnnouncement(); 33824 const liveRegionId = useUniqueId("DndLiveRegion"); 33825 const [mounted, setMounted] = reactExports.useState(false); 33826 reactExports.useEffect(() => { 33827 setMounted(true); 33828 }, []); 33829 useDndMonitor(reactExports.useMemo(() => ({ 33830 onDragStart(_ref2) { 33831 let { 33832 active 33833 } = _ref2; 33834 announce(announcements.onDragStart({ 33835 active 33836 })); 33837 }, 33838 33839 onDragMove(_ref3) { 33840 let { 33841 active, 33842 over 33843 } = _ref3; 33844 33845 if (announcements.onDragMove) { 33846 announce(announcements.onDragMove({ 33847 active, 33848 over 33849 })); 33850 } 33851 }, 33852 33853 onDragOver(_ref4) { 33854 let { 33855 active, 33856 over 33857 } = _ref4; 33858 announce(announcements.onDragOver({ 33859 active, 33860 over 33861 })); 33862 }, 33863 33864 onDragEnd(_ref5) { 33865 let { 33866 active, 33867 over 33868 } = _ref5; 33869 announce(announcements.onDragEnd({ 33870 active, 33871 over 33872 })); 33873 }, 33874 33875 onDragCancel(_ref6) { 33876 let { 33877 active, 33878 over 33879 } = _ref6; 33880 announce(announcements.onDragCancel({ 33881 active, 33882 over 33883 })); 33884 } 33885 33886 }), [announce, announcements])); 33887 33888 if (!mounted) { 33889 return null; 33890 } 33891 33892 const markup = React.createElement(React.Fragment, null, React.createElement(HiddenText, { 33893 id: hiddenTextDescribedById, 33894 value: screenReaderInstructions.draggable 33895 }), React.createElement(LiveRegion, { 33896 id: liveRegionId, 33897 announcement: announcement 33898 })); 33899 return container ? reactDomExports.createPortal(markup, container) : markup; 33900} 33901 33902var Action; 33903 33904(function (Action) { 33905 Action["DragStart"] = "dragStart"; 33906 Action["DragMove"] = "dragMove"; 33907 Action["DragEnd"] = "dragEnd"; 33908 Action["DragCancel"] = "dragCancel"; 33909 Action["DragOver"] = "dragOver"; 33910 Action["RegisterDroppable"] = "registerDroppable"; 33911 Action["SetDroppableDisabled"] = "setDroppableDisabled"; 33912 Action["UnregisterDroppable"] = "unregisterDroppable"; 33913})(Action || (Action = {})); 33914 33915function noop() {} 33916 33917function useSensor(sensor, options) { 33918 return reactExports.useMemo(() => ({ 33919 sensor, 33920 options: options != null ? options : {} 33921 }), // eslint-disable-next-line react-hooks/exhaustive-deps 33922 [sensor, options]); 33923} 33924 33925function useSensors() { 33926 for (var _len = arguments.length, sensors = new Array(_len), _key = 0; _key < _len; _key++) { 33927 sensors[_key] = arguments[_key]; 33928 } 33929 33930 return reactExports.useMemo(() => [...sensors].filter(sensor => sensor != null), // eslint-disable-next-line react-hooks/exhaustive-deps 33931 [...sensors]); 33932} 33933 33934const defaultCoordinates = /*#__PURE__*/Object.freeze({ 33935 x: 0, 33936 y: 0 33937}); 33938 33939/** 33940 * Returns the distance between two points 33941 */ 33942function distanceBetween(p1, p2) { 33943 return Math.sqrt(Math.pow(p1.x - p2.x, 2) + Math.pow(p1.y - p2.y, 2)); 33944} 33945 33946function getRelativeTransformOrigin(event, rect) {
vendor: 4,592 bytes, lines 33947-34156
33947 const eventCoordinates = getEventCoordinates(event); 33948 33949 if (!eventCoordinates) { 33950 return '0 0'; 33951 } 33952 33953 const transformOrigin = { 33954 x: (eventCoordinates.x - rect.left) / rect.width * 100, 33955 y: (eventCoordinates.y - rect.top) / rect.height * 100 33956 }; 33957 return transformOrigin.x + "% " + transformOrigin.y + "%"; 33958} 33959 33960/** 33961 * Sort collisions from smallest to greatest value 33962 */ 33963function sortCollisionsAsc(_ref, _ref2) { 33964 let { 33965 data: { 33966 value: a 33967 } 33968 } = _ref; 33969 let { 33970 data: { 33971 value: b 33972 } 33973 } = _ref2; 33974 return a - b; 33975} 33976/** 33977 * Sort collisions from greatest to smallest value 33978 */ 33979 33980function sortCollisionsDesc(_ref3, _ref4) { 33981 let { 33982 data: { 33983 value: a 33984 } 33985 } = _ref3; 33986 let { 33987 data: { 33988 value: b 33989 } 33990 } = _ref4; 33991 return b - a; 33992} 33993/** 33994 * Returns the coordinates of the corners of a given rectangle: 33995 * [TopLeft {x, y}, TopRight {x, y}, BottomLeft {x, y}, BottomRight {x, y}] 33996 */ 33997 33998function cornersOfRectangle(_ref5) { 33999 let { 34000 left, 34001 top, 34002 height, 34003 width 34004 } = _ref5; 34005 return [{ 34006 x: left, 34007 y: top 34008 }, { 34009 x: left + width, 34010 y: top 34011 }, { 34012 x: left, 34013 y: top + height 34014 }, { 34015 x: left + width, 34016 y: top + height 34017 }]; 34018} 34019function getFirstCollision(collisions, property) { 34020 if (!collisions || collisions.length === 0) { 34021 return null; 34022 } 34023 34024 const [firstCollision] = collisions; 34025 return firstCollision[property] ; 34026} 34027 34028/** 34029 * Returns the coordinates of the center of a given ClientRect 34030 */ 34031 34032function centerOfRectangle(rect, left, top) { 34033 if (left === void 0) { 34034 left = rect.left; 34035 } 34036 34037 if (top === void 0) { 34038 top = rect.top; 34039 } 34040 34041 return { 34042 x: left + rect.width * 0.5, 34043 y: top + rect.height * 0.5 34044 }; 34045} 34046/** 34047 * Returns the closest rectangles from an array of rectangles to the center of a given 34048 * rectangle. 34049 */ 34050 34051 34052const closestCenter = _ref => { 34053 let { 34054 collisionRect, 34055 droppableRects, 34056 droppableContainers 34057 } = _ref; 34058 const centerRect = centerOfRectangle(collisionRect, collisionRect.left, collisionRect.top); 34059 const collisions = []; 34060 34061 for (const droppableContainer of droppableContainers) { 34062 const { 34063 id 34064 } = droppableContainer; 34065 const rect = droppableRects.get(id); 34066 34067 if (rect) { 34068 const distBetween = distanceBetween(centerOfRectangle(rect), centerRect); 34069 collisions.push({ 34070 id, 34071 data: { 34072 droppableContainer, 34073 value: distBetween 34074 } 34075 }); 34076 } 34077 } 34078 34079 return collisions.sort(sortCollisionsAsc); 34080}; 34081 34082/** 34083 * Returns the closest rectangles from an array of rectangles to the corners of 34084 * another rectangle. 34085 */ 34086 34087const closestCorners = _ref => { 34088 let { 34089 collisionRect, 34090 droppableRects, 34091 droppableContainers 34092 } = _ref; 34093 const corners = cornersOfRectangle(collisionRect); 34094 const collisions = []; 34095 34096 for (const droppableContainer of droppableContainers) { 34097 const { 34098 id 34099 } = droppableContainer; 34100 const rect = droppableRects.get(id); 34101 34102 if (rect) { 34103 const rectCorners = cornersOfRectangle(rect); 34104 const distances = corners.reduce((accumulator, corner, index) => { 34105 return accumulator + distanceBetween(rectCorners[index], corner); 34106 }, 0); 34107 const effectiveDistance = Number((distances / 4).toFixed(4)); 34108 collisions.push({ 34109 id, 34110 data: { 34111 droppableContainer, 34112 value: effectiveDistance 34113 } 34114 }); 34115 } 34116 } 34117 34118 return collisions.sort(sortCollisionsAsc); 34119}; 34120 34121/** 34122 * Returns the intersecting rectangle area between two rectangles 34123 */ 34124 34125function getIntersectionRatio(entry, target) { 34126 const top = Math.max(target.top, entry.top); 34127 const left = Math.max(target.left, entry.left); 34128 const right = Math.min(target.left + target.width, entry.left + entry.width); 34129 const bottom = Math.min(target.top + target.height, entry.top + entry.height); 34130 const width = right - left; 34131 const height = bottom - top; 34132 34133 if (left < right && top < bottom) { 34134 const targetArea = target.width * target.height; 34135 const entryArea = entry.width * entry.height; 34136 const intersectionArea = width * height; 34137 const intersectionRatio = intersectionArea / (targetArea + entryArea - intersectionArea); 34138 return Number(intersectionRatio.toFixed(4)); 34139 } // Rectangles do not overlap, or overlap has an area of zero (edge/corner overlap) 34140 34141 34142 return 0; 34143} 34144/** 34145 * Returns the rectangles that has the greatest intersection area with a given 34146 * rectangle in an array of rectangles. 34147 */ 34148 34149const rectIntersection = _ref => { 34150 let { 34151 collisionRect, 34152 droppableRects, 34153 droppableContainers 34154 } = _ref; 34155 const collisions = []; 34156
34157 for (const droppableContainer of droppableContainers) { 34158 const { 34159 id 34160 } = droppableContainer; 34161 const rect = droppableRects.get(id); 34162 34163 if (rect) { 34164 const intersectionRatio = getIntersectionRatio(rect, collisionRect); 34165 34166 if (intersectionRatio > 0) { 34167 collisions.push({ 34168 id, 34169 data: { 34170 droppableContainer, 34171 value: intersectionRatio 34172 } 34173 }); 34174 } 34175 } 34176 } 34177 34178 return collisions.sort(sortCollisionsDe
vendor: 32,371 bytes, lines 34178-35451
34178sc); 34179}; 34180 34181function adjustScale(transform, rect1, rect2) { 34182 return { ...transform, 34183 scaleX: rect1 && rect2 ? rect1.width / rect2.width : 1, 34184 scaleY: rect1 && rect2 ? rect1.height / rect2.height : 1 34185 }; 34186} 34187 34188function getRectDelta(rect1, rect2) { 34189 return rect1 && rect2 ? { 34190 x: rect1.left - rect2.left, 34191 y: rect1.top - rect2.top 34192 } : defaultCoordinates; 34193} 34194 34195function createRectAdjustmentFn(modifier) { 34196 return function adjustClientRect(rect) { 34197 for (var _len = arguments.length, adjustments = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { 34198 adjustments[_key - 1] = arguments[_key]; 34199 } 34200 34201 return adjustments.reduce((acc, adjustment) => ({ ...acc, 34202 top: acc.top + modifier * adjustment.y, 34203 bottom: acc.bottom + modifier * adjustment.y, 34204 left: acc.left + modifier * adjustment.x, 34205 right: acc.right + modifier * adjustment.x 34206 }), { ...rect 34207 }); 34208 }; 34209} 34210const getAdjustedRect = /*#__PURE__*/createRectAdjustmentFn(1); 34211 34212function parseTransform(transform) { 34213 if (transform.startsWith('matrix3d(')) { 34214 const transformArray = transform.slice(9, -1).split(/, /); 34215 return { 34216 x: +transformArray[12], 34217 y: +transformArray[13], 34218 scaleX: +transformArray[0], 34219 scaleY: +transformArray[5] 34220 }; 34221 } else if (transform.startsWith('matrix(')) { 34222 const transformArray = transform.slice(7, -1).split(/, /); 34223 return { 34224 x: +transformArray[4], 34225 y: +transformArray[5], 34226 scaleX: +transformArray[0], 34227 scaleY: +transformArray[3] 34228 }; 34229 } 34230 34231 return null; 34232} 34233 34234function inverseTransform(rect, transform, transformOrigin) { 34235 const parsedTransform = parseTransform(transform); 34236 34237 if (!parsedTransform) { 34238 return rect; 34239 } 34240 34241 const { 34242 scaleX, 34243 scaleY, 34244 x: translateX, 34245 y: translateY 34246 } = parsedTransform; 34247 const x = rect.left - translateX - (1 - scaleX) * parseFloat(transformOrigin); 34248 const y = rect.top - translateY - (1 - scaleY) * parseFloat(transformOrigin.slice(transformOrigin.indexOf(' ') + 1)); 34249 const w = scaleX ? rect.width / scaleX : rect.width; 34250 const h = scaleY ? rect.height / scaleY : rect.height; 34251 return { 34252 width: w, 34253 height: h, 34254 top: y, 34255 right: x + w, 34256 bottom: y + h, 34257 left: x 34258 }; 34259} 34260 34261const defaultOptions = { 34262 ignoreTransform: false 34263}; 34264/** 34265 * Returns the bounding client rect of an element relative to the viewport. 34266 */ 34267 34268function getClientRect(element, options) { 34269 if (options === void 0) { 34270 options = defaultOptions; 34271 } 34272 34273 let rect = element.getBoundingClientRect(); 34274 34275 if (options.ignoreTransform) { 34276 const { 34277 transform, 34278 transformOrigin 34279 } = getWindow(element).getComputedStyle(element); 34280 34281 if (transform) { 34282 rect = inverseTransform(rect, transform, transformOrigin); 34283 } 34284 } 34285 34286 const { 34287 top, 34288 left, 34289 width, 34290 height, 34291 bottom, 34292 right 34293 } = rect; 34294 return { 34295 top, 34296 left, 34297 width, 34298 height, 34299 bottom, 34300 right 34301 }; 34302} 34303/** 34304 * Returns the bounding client rect of an element relative to the viewport. 34305 * 34306 * @remarks 34307 * The ClientRect returned by this method does not take into account transforms 34308 * applied to the element it measures. 34309 * 34310 */ 34311 34312function getTransformAgnosticClientRect(element) { 34313 return getClientRect(element, { 34314 ignoreTransform: true 34315 }); 34316} 34317 34318function getWindowClientRect(element) { 34319 const width = element.innerWidth; 34320 const height = element.innerHeight; 34321 return { 34322 top: 0, 34323 left: 0, 34324 right: width, 34325 bottom: height, 34326 width, 34327 height 34328 }; 34329} 34330 34331function isFixed(node, computedStyle) { 34332 if (computedStyle === void 0) { 34333 computedStyle = getWindow(node).getComputedStyle(node); 34334 } 34335 34336 return computedStyle.position === 'fixed'; 34337} 34338 34339function isScrollable(element, computedStyle) { 34340 if (computedStyle === void 0) { 34341 computedStyle = getWindow(element).getComputedStyle(element); 34342 } 34343 34344 const overflowRegex = /(auto|scroll|overlay)/; 34345 const properties = ['overflow', 'overflowX', 'overflowY']; 34346 return properties.some(property => { 34347 const value = computedStyle[property]; 34348 return typeof value === 'string' ? overflowRegex.test(value) : false; 34349 }); 34350} 34351 34352function getScrollableAncestors(element, limit) { 34353 const scrollParents = []; 34354 34355 function findScrollableAncestors(node) { 34356 if (limit != null && scrollParents.length >= limit) { 34357 return scrollParents; 34358 } 34359 34360 if (!node) { 34361 return scrollParents; 34362 } 34363 34364 if (isDocument(node) && node.scrollingElement != null && !scrollParents.includes(node.scrollingElement)) { 34365 scrollParents.push(node.scrollingElement); 34366 return scrollParents; 34367 } 34368 34369 if (!isHTMLElement(node) || isSVGElement(node)) { 34370 return scrollParents; 34371 } 34372 34373 if (scrollParents.includes(node)) { 34374 return scrollParents; 34375 } 34376 34377 const computedStyle = getWindow(element).getComputedStyle(node); 34378 34379 if (node !== element) { 34380 if (isScrollable(node, computedStyle)) { 34381 scrollParents.push(node); 34382 } 34383 } 34384 34385 if (isFixed(node, computedStyle)) { 34386 return scrollParents; 34387 } 34388 34389 return findScrollableAncestors(node.parentNode); 34390 } 34391 34392 if (!element) { 34393 return scrollParents; 34394 } 34395 34396 return findScrollableAncestors(element); 34397} 34398function getFirstScrollableAncestor(node) { 34399 const [firstScrollableAncestor] = getScrollableAncestors(node, 1); 34400 return firstScrollableAncestor != null ? firstScrollableAncestor : null; 34401} 34402 34403function getScrollableElement(element) { 34404 if (!canUseDOM || !element) { 34405 return null; 34406 } 34407 34408 if (isWindow(element)) { 34409 return element; 34410 } 34411 34412 if (!isNode(element)) { 34413 return null; 34414 } 34415 34416 if (isDocument(element) || element === getOwnerDocument(element).scrollingElement) { 34417 return window; 34418 } 34419 34420 if (isHTMLElement(element)) { 34421 return element; 34422 } 34423 34424 return null; 34425} 34426 34427function getScrollXCoordinate(element) { 34428 if (isWindow(element)) { 34429 return element.scrollX; 34430 } 34431 34432 return element.scrollLeft; 34433} 34434function getScrollYCoordinate(element) { 34435 if (isWindow(element)) { 34436 return element.scrollY; 34437 } 34438 34439 return element.scrollTop; 34440} 34441function getScrollCoordinates(element) { 34442 return { 34443 x: getScrollXCoordinate(element), 34444 y: getScrollYCoordinate(element) 34445 }; 34446} 34447 34448var Direction; 34449 34450(function (Direction) { 34451 Direction[Direction["Forward"] = 1] = "Forward"; 34452 Direction[Direction["Backward"] = -1] = "Backward"; 34453})(Direction || (Direction = {})); 34454 34455function isDocumentScrollingElement(element) { 34456 if (!canUseDOM || !element) { 34457 return false; 34458 } 34459 34460 return element === document.scrollingElement; 34461} 34462 34463function getScrollPosition(scrollingContainer) { 34464 const minScroll = { 34465 x: 0, 34466 y: 0 34467 }; 34468 const dimensions = isDocumentScrollingElement(scrollingContainer) ? { 34469 height: window.innerHeight, 34470 width: window.innerWidth 34471 } : { 34472 height: scrollingContainer.clientHeight, 34473 width: scrollingContainer.clientWidth 34474 }; 34475 const maxScroll = { 34476 x: scrollingContainer.scrollWidth - dimensions.width, 34477 y: scrollingContainer.scrollHeight - dimensions.height 34478 }; 34479 const isTop = scrollingContainer.scrollTop <= minScroll.y; 34480 const isLeft = scrollingContainer.scrollLeft <= minScroll.x; 34481 const isBottom = scrollingContainer.scrollTop >= maxScroll.y; 34482 const isRight = scrollingContainer.scrollLeft >= maxScroll.x; 34483 return { 34484 isTop, 34485 isLeft, 34486 isBottom, 34487 isRight, 34488 maxScroll, 34489 minScroll 34490 }; 34491} 34492 34493const defaultThreshold = { 34494 x: 0.2, 34495 y: 0.2 34496}; 34497function getScrollDirectionAndSpeed(scrollContainer, scrollContainerRect, _ref, acceleration, thresholdPercentage) { 34498 let { 34499 top, 34500 left, 34501 right, 34502 bottom 34503 } = _ref; 34504 34505 if (acceleration === void 0) { 34506 acceleration = 10; 34507 } 34508 34509 if (thresholdPercentage === void 0) { 34510 thresholdPercentage = defaultThreshold; 34511 } 34512 34513 const { 34514 isTop, 34515 isBottom, 34516 isLeft, 34517 isRight 34518 } = getScrollPosition(scrollContainer); 34519 const direction = { 34520 x: 0, 34521 y: 0 34522 }; 34523 const speed = { 34524 x: 0, 34525 y: 0 34526 }; 34527 const threshold = { 34528 height: scrollContainerRect.height * thresholdPercentage.y, 34529 width: scrollContainerRect.width * thresholdPercentage.x 34530 }; 34531 34532 if (!isTop && top <= scrollContainerRect.top + threshold.height) { 34533 // Scroll Up 34534 direction.y = Direction.Backward; 34535 speed.y = acceleration * Math.abs((scrollContainerRect.top + threshold.height - top) / threshold.height); 34536 } else if (!isBottom && bottom >= scrollContainerRect.bottom - threshold.height) { 34537 // Scroll Down 34538 direction.y = Direction.Forward; 34539 speed.y = acceleration * Math.abs((scrollContainerRect.bottom - threshold.height - bottom) / threshold.height); 34540 } 34541 34542 if (!isRight && right >= scrollContainerRect.right - threshold.width) { 34543 // Scroll Right 34544 direction.x = Direction.Forward; 34545 speed.x = acceleration * Math.abs((scrollContainerRect.right - threshold.width - right) / threshold.width); 34546 } else if (!isLeft && left <= scrollContainerRect.left + threshold.width) { 34547 // Scroll Left 34548 direction.x = Direction.Backward; 34549 speed.x = acceleration * Math.abs((scrollContainerRect.left + threshold.width - left) / threshold.width); 34550 } 34551 34552 return { 34553 direction, 34554 speed 34555 }; 34556} 34557 34558function getScrollElementRect(element) { 34559 if (element === document.scrollingElement) { 34560 const { 34561 innerWidth, 34562 innerHeight 34563 } = window; 34564 return { 34565 top: 0, 34566 left: 0, 34567 right: innerWidth, 34568 bottom: innerHeight, 34569 width: innerWidth, 34570 height: innerHeight 34571 }; 34572 } 34573 34574 const { 34575 top, 34576 left, 34577 right, 34578 bottom 34579 } = element.getBoundingClientRect(); 34580 return { 34581 top, 34582 left, 34583 right, 34584 bottom, 34585 width: element.clientWidth, 34586 height: element.clientHeight 34587 }; 34588} 34589 34590function getScrollOffsets(scrollableAncestors) { 34591 return scrollableAncestors.reduce((acc, node) => { 34592 return add(acc, getScrollCoordinates(node)); 34593 }, defaultCoordinates); 34594} 34595function getScrollXOffset(scrollableAncestors) { 34596 return scrollableAncestors.reduce((acc, node) => { 34597 return acc + getScrollXCoordinate(node); 34598 }, 0); 34599} 34600function getScrollYOffset(scrollableAncestors) { 34601 return scrollableAncestors.reduce((acc, node) => { 34602 return acc + getScrollYCoordinate(node); 34603 }, 0); 34604} 34605 34606function scrollIntoViewIfNeeded(element, measure) { 34607 if (measure === void 0) { 34608 measure = getClientRect; 34609 } 34610 34611 if (!element) { 34612 return; 34613 } 34614 34615 const { 34616 top, 34617 left, 34618 bottom, 34619 right 34620 } = measure(element); 34621 const firstScrollableAncestor = getFirstScrollableAncestor(element); 34622 34623 if (!firstScrollableAncestor) { 34624 return; 34625 } 34626 34627 if (bottom <= 0 || right <= 0 || top >= window.innerHeight || left >= window.innerWidth) { 34628 element.scrollIntoView({ 34629 block: 'center', 34630 inline: 'center' 34631 }); 34632 } 34633} 34634 34635const properties = [['x', ['left', 'right'], getScrollXOffset], ['y', ['top', 'bottom'], getScrollYOffset]]; 34636class Rect { 34637 constructor(rect, element) { 34638 this.rect = void 0; 34639 this.width = void 0; 34640 this.height = void 0; 34641 this.top = void 0; 34642 this.bottom = void 0; 34643 this.right = void 0; 34644 this.left = void 0; 34645 const scrollableAncestors = getScrollableAncestors(element); 34646 const scrollOffsets = getScrollOffsets(scrollableAncestors); 34647 this.rect = { ...rect 34648 }; 34649 this.width = rect.width; 34650 this.height = rect.height; 34651 34652 for (const [axis, keys, getScrollOffset] of properties) { 34653 for (const key of keys) { 34654 Object.defineProperty(this, key, { 34655 get: () => { 34656 const currentOffsets = getScrollOffset(scrollableAncestors); 34657 const scrollOffsetsDeltla = scrollOffsets[axis] - currentOffsets; 34658 return this.rect[key] + scrollOffsetsDeltla; 34659 }, 34660 enumerable: true 34661 }); 34662 } 34663 } 34664 34665 Object.defineProperty(this, 'rect', { 34666 enumerable: false 34667 }); 34668 } 34669 34670} 34671 34672class Listeners { 34673 constructor(target) { 34674 this.target = void 0; 34675 this.listeners = []; 34676 34677 this.removeAll = () => { 34678 this.listeners.forEach(listener => { 34679 var _this$target; 34680 34681 return (_this$target = this.target) == null ? void 0 : _this$target.removeEventListener(...listener); 34682 }); 34683 }; 34684 34685 this.target = target; 34686 } 34687 34688 add(eventName, handler, options) { 34689 var _this$target2; 34690 34691 (_this$target2 = this.target) == null ? void 0 : _this$target2.addEventListener(eventName, handler, options); 34692 this.listeners.push([eventName, handler, options]); 34693 } 34694 34695} 34696 34697function getEventListenerTarget(target) { 34698 // If the `event.target` element is removed from the document events will still be targeted 34699 // at it, and hence won't always bubble up to the window or document anymore. 34700 // If there is any risk of an element being removed while it is being dragged, 34701 // the best practice is to attach the event listeners directly to the target. 34702 // https://developer.mozilla.org/en-US/docs/Web/API/EventTarget 34703 const { 34704 EventTarget 34705 } = getWindow(target); 34706 return target instanceof EventTarget ? target : getOwnerDocument(target); 34707} 34708 34709function hasExceededDistance(delta, measurement) { 34710 const dx = Math.abs(delta.x); 34711 const dy = Math.abs(delta.y); 34712 34713 if (typeof measurement === 'number') { 34714 return Math.sqrt(dx ** 2 + dy ** 2) > measurement; 34715 } 34716 34717 if ('x' in measurement && 'y' in measurement) { 34718 return dx > measurement.x && dy > measurement.y; 34719 } 34720 34721 if ('x' in measurement) { 34722 return dx > measurement.x; 34723 } 34724 34725 if ('y' in measurement) { 34726 return dy > measurement.y; 34727 } 34728 34729 return false; 34730} 34731 34732var EventName; 34733 34734(function (EventName) { 34735 EventName["Click"] = "click"; 34736 EventName["DragStart"] = "dragstart"; 34737 EventName["Keydown"] = "keydown"; 34738 EventName["ContextMenu"] = "contextmenu"; 34739 EventName["Resize"] = "resize"; 34740 EventName["SelectionChange"] = "selectionchange"; 34741 EventName["VisibilityChange"] = "visibilitychange"; 34742})(EventName || (EventName = {})); 34743 34744function preventDefault(event) { 34745 event.preventDefault(); 34746} 34747function stopPropagation(event) { 34748 event.stopPropagation(); 34749} 34750 34751var KeyboardCode; 34752 34753(function (KeyboardCode) { 34754 KeyboardCode["Space"] = "Space"; 34755 KeyboardCode["Down"] = "ArrowDown"; 34756 KeyboardCode["Right"] = "ArrowRight"; 34757 KeyboardCode["Left"] = "ArrowLeft"; 34758 KeyboardCode["Up"] = "ArrowUp"; 34759 KeyboardCode["Esc"] = "Escape"; 34760 KeyboardCode["Enter"] = "Enter"; 34761 KeyboardCode["Tab"] = "Tab"; 34762})(KeyboardCode || (KeyboardCode = {})); 34763 34764const defaultKeyboardCodes = { 34765 start: [KeyboardCode.Space, KeyboardCode.Enter], 34766 cancel: [KeyboardCode.Esc], 34767 end: [KeyboardCode.Space, KeyboardCode.Enter, KeyboardCode.Tab] 34768}; 34769const defaultKeyboardCoordinateGetter = (event, _ref) => { 34770 let { 34771 currentCoordinates 34772 } = _ref; 34773 34774 switch (event.code) { 34775 case KeyboardCode.Right: 34776 return { ...currentCoordinates, 34777 x: currentCoordinates.x + 25 34778 }; 34779 34780 case KeyboardCode.Left: 34781 return { ...currentCoordinates, 34782 x: currentCoordinates.x - 25 34783 }; 34784 34785 case KeyboardCode.Down: 34786 return { ...currentCoordinates, 34787 y: currentCoordinates.y + 25 34788 }; 34789 34790 case KeyboardCode.Up: 34791 return { ...currentCoordinates, 34792 y: currentCoordinates.y - 25 34793 }; 34794 } 34795 34796 return undefined; 34797}; 34798 34799class KeyboardSensor { 34800 constructor(props) { 34801 this.props = void 0; 34802 this.autoScrollEnabled = false; 34803 this.referenceCoordinates = void 0; 34804 this.listeners = void 0; 34805 this.windowListeners = void 0; 34806 this.props = props; 34807 const { 34808 event: { 34809 target 34810 } 34811 } = props; 34812 this.props = props; 34813 this.listeners = new Listeners(getOwnerDocument(target)); 34814 this.windowListeners = new Listeners(getWindow(target)); 34815 this.handleKeyDown = this.handleKeyDown.bind(this); 34816 this.handleCancel = this.handleCancel.bind(this); 34817 this.attach(); 34818 } 34819 34820 attach() { 34821 this.handleStart(); 34822 this.windowListeners.add(EventName.Resize, this.handleCancel); 34823 this.windowListeners.add(EventName.VisibilityChange, this.handleCancel); 34824 setTimeout(() => this.listeners.add(EventName.Keydown, this.handleKeyDown)); 34825 } 34826 34827 handleStart() { 34828 const { 34829 activeNode, 34830 onStart 34831 } = this.props; 34832 const node = activeNode.node.current; 34833 34834 if (node) { 34835 scrollIntoViewIfNeeded(node); 34836 } 34837 34838 onStart(defaultCoordinates); 34839 } 34840 34841 handleKeyDown(event) { 34842 if (isKeyboardEvent(event)) { 34843 const { 34844 active, 34845 context, 34846 options 34847 } = this.props; 34848 const { 34849 keyboardCodes = defaultKeyboardCodes, 34850 coordinateGetter = defaultKeyboardCoordinateGetter, 34851 scrollBehavior = 'smooth' 34852 } = options; 34853 const { 34854 code 34855 } = event; 34856 34857 if (keyboardCodes.end.includes(code)) { 34858 this.handleEnd(event); 34859 return; 34860 } 34861 34862 if (keyboardCodes.cancel.includes(code)) { 34863 this.handleCancel(event); 34864 return; 34865 } 34866 34867 const { 34868 collisionRect 34869 } = context.current; 34870 const currentCoordinates = collisionRect ? { 34871 x: collisionRect.left, 34872 y: collisionRect.top 34873 } : defaultCoordinates; 34874 34875 if (!this.referenceCoordinates) { 34876 this.referenceCoordinates = currentCoordinates; 34877 } 34878 34879 const newCoordinates = coordinateGetter(event, { 34880 active, 34881 context: context.current, 34882 currentCoordinates 34883 }); 34884 34885 if (newCoordinates) { 34886 const coordinatesDelta = subtract(newCoordinates, currentCoordinates); 34887 const scrollDelta = { 34888 x: 0, 34889 y: 0 34890 }; 34891 const { 34892 scrollableAncestors 34893 } = context.current; 34894 34895 for (const scrollContainer of scrollableAncestors) { 34896 const direction = event.code; 34897 const { 34898 isTop, 34899 isRight, 34900 isLeft, 34901 isBottom, 34902 maxScroll, 34903 minScroll 34904 } = getScrollPosition(scrollContainer); 34905 const scrollElementRect = getScrollElementRect(scrollContainer); 34906 const clampedCoordinates = { 34907 x: Math.min(direction === KeyboardCode.Right ? scrollElementRect.right - scrollElementRect.width / 2 : scrollElementRect.right, Math.max(direction === KeyboardCode.Right ? scrollElementRect.left : scrollElementRect.left + scrollElementRect.width / 2, newCoordinates.x)), 34908 y: Math.min(direction === KeyboardCode.Down ? scrollElementRect.bottom - scrollElementRect.height / 2 : scrollElementRect.bottom, Math.max(direction === KeyboardCode.Down ? scrollElementRect.top : scrollElementRect.top + scrollElementRect.height / 2, newCoordinates.y)) 34909 }; 34910 const canScrollX = direction === KeyboardCode.Right && !isRight || direction === KeyboardCode.Left && !isLeft; 34911 const canScrollY = direction === KeyboardCode.Down && !isBottom || direction === KeyboardCode.Up && !isTop; 34912 34913 if (canScrollX && clampedCoordinates.x !== newCoordinates.x) { 34914 const newScrollCoordinates = scrollContainer.scrollLeft + coordinatesDelta.x; 34915 const canScrollToNewCoordinates = direction === KeyboardCode.Right && newScrollCoordinates <= maxScroll.x || direction === KeyboardCode.Left && newScrollCoordinates >= minScroll.x; 34916 34917 if (canScrollToNewCoordinates && !coordinatesDelta.y) { 34918 // We don't need to update coordinates, the scroll adjustment alone will trigger 34919 // logic to auto-detect the new container we are over 34920 scrollContainer.scrollTo({ 34921 left: newScrollCoordinates, 34922 behavior: scrollBehavior 34923 }); 34924 return; 34925 } 34926 34927 if (canScrollToNewCoordinates) { 34928 scrollDelta.x = scrollContainer.scrollLeft - newScrollCoordinates; 34929 } else { 34930 scrollDelta.x = direction === KeyboardCode.Right ? scrollContainer.scrollLeft - maxScroll.x : scrollContainer.scrollLeft - minScroll.x; 34931 } 34932 34933 if (scrollDelta.x) { 34934 scrollContainer.scrollBy({ 34935 left: -scrollDelta.x, 34936 behavior: scrollBehavior 34937 }); 34938 } 34939 34940 break; 34941 } else if (canScrollY && clampedCoordinates.y !== newCoordinates.y) { 34942 const newScrollCoordinates = scrollContainer.scrollTop + coordinatesDelta.y; 34943 const canScrollToNewCoordinates = direction === KeyboardCode.Down && newScrollCoordinates <= maxScroll.y || direction === KeyboardCode.Up && newScrollCoordinates >= minScroll.y; 34944 34945 if (canScrollToNewCoordinates && !coordinatesDelta.x) { 34946 // We don't need to update coordinates, the scroll adjustment alone will trigger 34947 // logic to auto-detect the new container we are over 34948 scrollContainer.scrollTo({ 34949 top: newScrollCoordinates, 34950 behavior: scrollBehavior 34951 }); 34952 return; 34953 } 34954 34955 if (canScrollToNewCoordinates) { 34956 scrollDelta.y = scrollContainer.scrollTop - newScrollCoordinates; 34957 } else { 34958 scrollDelta.y = direction === KeyboardCode.Down ? scrollContainer.scrollTop - maxScroll.y : scrollContainer.scrollTop - minScroll.y; 34959 } 34960 34961 if (scrollDelta.y) { 34962 scrollContainer.scrollBy({ 34963 top: -scrollDelta.y, 34964 behavior: scrollBehavior 34965 }); 34966 } 34967 34968 break; 34969 } 34970 } 34971 34972 this.handleMove(event, add(subtract(newCoordinates, this.referenceCoordinates), scrollDelta)); 34973 } 34974 } 34975 } 34976 34977 handleMove(event, coordinates) { 34978 const { 34979 onMove 34980 } = this.props; 34981 event.preventDefault(); 34982 onMove(coordinates); 34983 } 34984 34985 handleEnd(event) { 34986 const { 34987 onEnd 34988 } = this.props; 34989 event.preventDefault(); 34990 this.detach(); 34991 onEnd(); 34992 } 34993 34994 handleCancel(event) { 34995 const { 34996 onCancel 34997 } = this.props; 34998 event.preventDefault(); 34999 this.detach(); 35000 onCancel(); 35001 } 35002 35003 detach() { 35004 this.listeners.removeAll(); 35005 this.windowListeners.removeAll(); 35006 } 35007 35008} 35009KeyboardSensor.activators = [{ 35010 eventName: 'onKeyDown', 35011 handler: (event, _ref, _ref2) => { 35012 let { 35013 keyboardCodes = defaultKeyboardCodes, 35014 onActivation 35015 } = _ref; 35016 let { 35017 active 35018 } = _ref2; 35019 const { 35020 code 35021 } = event.nativeEvent; 35022 35023 if (keyboardCodes.start.includes(code)) { 35024 const activator = active.activatorNode.current; 35025 35026 if (activator && event.target !== activator) { 35027 return false; 35028 } 35029 35030 event.preventDefault(); 35031 onActivation == null ? void 0 : onActivation({ 35032 event: event.nativeEvent 35033 }); 35034 return true; 35035 } 35036 35037 return false; 35038 } 35039}]; 35040 35041function isDistanceConstraint(constraint) { 35042 return Boolean(constraint && 'distance' in constraint); 35043} 35044 35045function isDelayConstraint(constraint) { 35046 return Boolean(constraint && 'delay' in constraint); 35047} 35048 35049class AbstractPointerSensor { 35050 constructor(props, events, listenerTarget) { 35051 var _getEventCoordinates; 35052 35053 if (listenerTarget === void 0) { 35054 listenerTarget = getEventListenerTarget(props.event.target); 35055 } 35056 35057 this.props = void 0; 35058 this.events = void 0; 35059 this.autoScrollEnabled = true; 35060 this.document = void 0; 35061 this.activated = false; 35062 this.initialCoordinates = void 0; 35063 this.timeoutId = null; 35064 this.listeners = void 0; 35065 this.documentListeners = void 0; 35066 this.windowListeners = void 0; 35067 this.props = props; 35068 this.events = events; 35069 const { 35070 event 35071 } = props; 35072 const { 35073 target 35074 } = event; 35075 this.props = props; 35076 this.events = events; 35077 this.document = getOwnerDocument(target); 35078 this.documentListeners = new Listeners(this.document); 35079 this.listeners = new Listeners(listenerTarget); 35080 this.windowListeners = new Listeners(getWindow(target)); 35081 this.initialCoordinates = (_getEventCoordinates = getEventCoordinates(event)) != null ? _getEventCoordinates : defaultCoordinates; 35082 this.handleStart = this.handleStart.bind(this); 35083 this.handleMove = this.handleMove.bind(this); 35084 this.handleEnd = this.handleEnd.bind(this); 35085 this.handleCancel = this.handleCancel.bind(this); 35086 this.handleKeydown = this.handleKeydown.bind(this); 35087 this.removeTextSelection = this.removeTextSelection.bind(this); 35088 this.attach(); 35089 } 35090 35091 attach() { 35092 const { 35093 events, 35094 props: { 35095 options: { 35096 activationConstraint, 35097 bypassActivationConstraint 35098 } 35099 } 35100 } = this; 35101 this.listeners.add(events.move.name, this.handleMove, { 35102 passive: false 35103 }); 35104 this.listeners.add(events.end.name, this.handleEnd); 35105 35106 if (events.cancel) { 35107 this.listeners.add(events.cancel.name, this.handleCancel); 35108 } 35109 35110 this.windowListeners.add(EventName.Resize, this.handleCancel); 35111 this.windowListeners.add(EventName.DragStart, preventDefault); 35112 this.windowListeners.add(EventName.VisibilityChange, this.handleCancel); 35113 this.windowListeners.add(EventName.ContextMenu, preventDefault); 35114 this.documentListeners.add(EventName.Keydown, this.handleKeydown); 35115 35116 if (activationConstraint) { 35117 if (bypassActivationConstraint != null && bypassActivationConstraint({ 35118 event: this.props.event, 35119 activeNode: this.props.activeNode, 35120 options: this.props.options 35121 })) { 35122 return this.handleStart(); 35123 } 35124 35125 if (isDelayConstraint(activationConstraint)) { 35126 this.timeoutId = setTimeout(this.handleStart, activationConstraint.delay); 35127 this.handlePending(activationConstraint); 35128 return; 35129 } 35130 35131 if (isDistanceConstraint(activationConstraint)) { 35132 this.handlePending(activationConstraint); 35133 return; 35134 } 35135 } 35136 35137 this.handleStart(); 35138 } 35139 35140 detach() { 35141 this.listeners.removeAll(); 35142 this.windowListeners.removeAll(); // Wait until the next event loop before removing document listeners 35143 // This is necessary because we listen for `click` and `selection` events on the document 35144 35145 setTimeout(this.documentListeners.removeAll, 50); 35146 35147 if (this.timeoutId !== null) { 35148 clearTimeout(this.timeoutId); 35149 this.timeoutId = null; 35150 } 35151 } 35152 35153 handlePending(constraint, offset) { 35154 const { 35155 active, 35156 onPending 35157 } = this.props; 35158 onPending(active, constraint, this.initialCoordinates, offset); 35159 } 35160 35161 handleStart() { 35162 const { 35163 initialCoordinates 35164 } = this; 35165 const { 35166 onStart 35167 } = this.props; 35168 35169 if (initialCoordinates) { 35170 this.activated = true; // Stop propagation of click events once activation constraints are met 35171 35172 this.documentListeners.add(EventName.Click, stopPropagation, { 35173 capture: true 35174 }); // Remove any text selection from the document 35175 35176 this.removeTextSelection(); // Prevent further text selection while dragging 35177 35178 this.documentListeners.add(EventName.SelectionChange, this.removeTextSelection); 35179 onStart(initialCoordinates); 35180 } 35181 } 35182 35183 handleMove(event) { 35184 var _getEventCoordinates2; 35185 35186 const { 35187 activated, 35188 initialCoordinates, 35189 props 35190 } = this; 35191 const { 35192 onMove, 35193 options: { 35194 activationConstraint 35195 } 35196 } = props; 35197 35198 if (!initialCoordinates) { 35199 return; 35200 } 35201 35202 const coordinates = (_getEventCoordinates2 = getEventCoordinates(event)) != null ? _getEventCoordinates2 : defaultCoordinates; 35203 const delta = subtract(initialCoordinates, coordinates); // Constraint validation 35204 35205 if (!activated && activationConstraint) { 35206 if (isDistanceConstraint(activationConstraint)) { 35207 if (activationConstraint.tolerance != null && hasExceededDistance(delta, activationConstraint.tolerance)) { 35208 return this.handleCancel(); 35209 } 35210 35211 if (hasExceededDistance(delta, activationConstraint.distance)) { 35212 return this.handleStart(); 35213 } 35214 } 35215 35216 if (isDelayConstraint(activationConstraint)) { 35217 if (hasExceededDistance(delta, activationConstraint.tolerance)) { 35218 return this.handleCancel(); 35219 } 35220 } 35221 35222 this.handlePending(activationConstraint, delta); 35223 return; 35224 } 35225 35226 if (event.cancelable) { 35227 event.preventDefault(); 35228 } 35229 35230 onMove(coordinates); 35231 } 35232 35233 handleEnd() { 35234 const { 35235 onAbort, 35236 onEnd 35237 } = this.props; 35238 this.detach(); 35239 35240 if (!this.activated) { 35241 onAbort(this.props.active); 35242 } 35243 35244 onEnd(); 35245 } 35246 35247 handleCancel() { 35248 const { 35249 onAbort, 35250 onCancel 35251 } = this.props; 35252 this.detach(); 35253 35254 if (!this.activated) { 35255 onAbort(this.props.active); 35256 } 35257 35258 onCancel(); 35259 } 35260 35261 handleKeydown(event) { 35262 if (event.code === KeyboardCode.Esc) { 35263 this.handleCancel(); 35264 } 35265 } 35266 35267 removeTextSelection() { 35268 var _this$document$getSel; 35269 35270 (_this$document$getSel = this.document.getSelection()) == null ? void 0 : _this$document$getSel.removeAllRanges(); 35271 } 35272 35273} 35274 35275const events = { 35276 cancel: { 35277 name: 'pointercancel' 35278 }, 35279 move: { 35280 name: 'pointermove' 35281 }, 35282 end: { 35283 name: 'pointerup' 35284 } 35285}; 35286class PointerSensor extends AbstractPointerSensor { 35287 constructor(props) { 35288 const { 35289 event 35290 } = props; // Pointer events stop firing if the target is unmounted while dragging 35291 // Therefore we attach listeners to the owner document instead 35292 35293 const listenerTarget = getOwnerDocument(event.target); 35294 super(props, events, listenerTarget); 35295 } 35296 35297} 35298PointerSensor.activators = [{ 35299 eventName: 'onPointerDown', 35300 handler: (_ref, _ref2) => { 35301 let { 35302 nativeEvent: event 35303 } = _ref; 35304 let { 35305 onActivation 35306 } = _ref2; 35307 35308 if (!event.isPrimary || event.button !== 0) { 35309 return false; 35310 } 35311 35312 onActivation == null ? void 0 : onActivation({ 35313 event 35314 }); 35315 return true; 35316 } 35317}]; 35318 35319const events$1 = { 35320 move: { 35321 name: 'mousemove' 35322 }, 35323 end: { 35324 name: 'mouseup' 35325 } 35326}; 35327var MouseButton; 35328 35329(function (MouseButton) { 35330 MouseButton[MouseButton["RightClick"] = 2] = "RightClick"; 35331})(MouseButton || (MouseButton = {})); 35332 35333class MouseSensor extends AbstractPointerSensor { 35334 constructor(props) { 35335 super(props, events$1, getOwnerDocument(props.event.target)); 35336 } 35337 35338} 35339MouseSensor.activators = [{ 35340 eventName: 'onMouseDown', 35341 handler: (_ref, _ref2) => { 35342 let { 35343 nativeEvent: event 35344 } = _ref; 35345 let { 35346 onActivation 35347 } = _ref2; 35348 35349 if (event.button === MouseButton.RightClick) { 35350 return false; 35351 } 35352 35353 onActivation == null ? void 0 : onActivation({ 35354 event 35355 }); 35356 return true; 35357 } 35358}]; 35359 35360const events$2 = { 35361 cancel: { 35362 name: 'touchcancel' 35363 }, 35364 move: { 35365 name: 'touchmove' 35366 }, 35367 end: { 35368 name: 'touchend' 35369 } 35370}; 35371class TouchSensor extends AbstractPointerSensor { 35372 constructor(props) { 35373 super(props, events$2); 35374 } 35375 35376 static setup() { 35377 // Adding a non-capture and non-passive `touchmove` listener in order 35378 // to force `event.preventDefault()` calls to work in dynamically added 35379 // touchmove event handlers. This is required for iOS Safari. 35380 window.addEventListener(events$2.move.name, noop, { 35381 capture: false, 35382 passive: false 35383 }); 35384 return function teardown() { 35385 window.removeEventListener(events$2.move.name, noop); 35386 }; // We create a new handler because the teardown function of another sensor 35387 // could remove our event listener if we use a referentially equal listener. 35388 35389 function noop() {} 35390 } 35391 35392} 35393TouchSensor.activators = [{ 35394 eventName: 'onTouchStart', 35395 handler: (_ref, _ref2) => { 35396 let { 35397 nativeEvent: event 35398 } = _ref; 35399 let { 35400 onActivation 35401 } = _ref2; 35402 const { 35403 touches 35404 } = event; 35405 35406 if (touches.length > 1) { 35407 return false; 35408 } 35409 35410 onActivation == null ? void 0 : onActivation({ 35411 event 35412 }); 35413 return true; 35414 } 35415}]; 35416 35417var AutoScrollActivator; 35418 35419(function (AutoScrollActivator) { 35420 AutoScrollActivator[AutoScrollActivator["Pointer"] = 0] = "Pointer"; 35421 AutoScrollActivator[AutoScrollActivator["DraggableRect"] = 1] = "DraggableRect"; 35422})(AutoScrollActivator || (AutoScrollActivator = {})); 35423 35424var TraversalOrder; 35425 35426(function (TraversalOrder) { 35427 TraversalOrder[TraversalOrder["TreeOrder"] = 0] = "TreeOrder"; 35428 TraversalOrder[TraversalOrder["ReversedTreeOrder"] = 1] = "ReversedTreeOrder"; 35429})(TraversalOrder || (TraversalOrder = {})); 35430 35431function useAutoScroller(_ref) { 35432 let { 35433 acceleration, 35434 activator = AutoScrollActivator.Pointer, 35435 canScroll, 35436 draggingRect, 35437 enabled, 35438 interval = 5, 35439 order = TraversalOrder.TreeOrder, 35440 pointerCoordinates, 35441 scrollableAncestors, 35442 scrollableAncestorRects, 35443 delta, 35444 threshold 35445 } = _ref; 35446 const scrollIntent = useScrollIntent({ 35447 delta, 35448 disabled: !enabled 35449 }); 35450 const [setAutoScrollInterval, clearAutoScrollInterval] = useInterval(); 35451 const scrollSpeed =
vendor: 2,098 bytes, lines 35451-35517
35451reactExports.useRef({ 35452 x: 0, 35453 y: 0 35454 }); 35455 const scrollDirection = reactExports.useRef({ 35456 x: 0, 35457 y: 0 35458 }); 35459 const rect = reactExports.useMemo(() => { 35460 switch (activator) { 35461 case AutoScrollActivator.Pointer: 35462 return pointerCoordinates ? { 35463 top: pointerCoordinates.y, 35464 bottom: pointerCoordinates.y, 35465 left: pointerCoordinates.x, 35466 right: pointerCoordinates.x 35467 } : null; 35468 35469 case AutoScrollActivator.DraggableRect: 35470 return draggingRect; 35471 } 35472 }, [activator, draggingRect, pointerCoordinates]); 35473 const scrollContainerRef = reactExports.useRef(null); 35474 const autoScroll = reactExports.useCallback(() => { 35475 const scrollContainer = scrollContainerRef.current; 35476 35477 if (!scrollContainer) { 35478 return; 35479 } 35480 35481 const scrollLeft = scrollSpeed.current.x * scrollDirection.current.x; 35482 const scrollTop = scrollSpeed.current.y * scrollDirection.current.y; 35483 scrollContainer.scrollBy(scrollLeft, scrollTop); 35484 }, []); 35485 const sortedScrollableAncestors = reactExports.useMemo(() => order === TraversalOrder.TreeOrder ? [...scrollableAncestors].reverse() : scrollableAncestors, [order, scrollableAncestors]); 35486 reactExports.useEffect(() => { 35487 if (!enabled || !scrollableAncestors.length || !rect) { 35488 clearAutoScrollInterval(); 35489 return; 35490 } 35491 35492 for (const scrollContainer of sortedScrollableAncestors) { 35493 if ((canScroll == null ? void 0 : canScroll(scrollContainer)) === false) { 35494 continue; 35495 } 35496 35497 const index = scrollableAncestors.indexOf(scrollContainer); 35498 const scrollContainerRect = scrollableAncestorRects[index]; 35499 35500 if (!scrollContainerRect) { 35501 continue; 35502 } 35503 35504 const { 35505 direction, 35506 speed 35507 } = getScrollDirectionAndSpeed(scrollContainer, scrollContainerRect, rect, acceleration, threshold); 35508 35509 for (const axis of ['x', 'y']) { 35510 if (!scrollIntent[axis][direction[axis]]) { 35511 speed[axis] = 0; 35512 direction[axis] = 0; 35513 } 35514 } 35515 35516 if (speed.x > 0 || speed.y > 0) { 35517 clearAutoScrollInterval();
vendor: 4,660 bytes, lines 35518-35667
35518 scrollContainerRef.current = scrollContainer; 35519 setAutoScrollInterval(autoScroll, interval); 35520 scrollSpeed.current = speed; 35521 scrollDirection.current = direction; 35522 return; 35523 } 35524 } 35525 35526 scrollSpeed.current = { 35527 x: 0, 35528 y: 0 35529 }; 35530 scrollDirection.current = { 35531 x: 0, 35532 y: 0 35533 }; 35534 clearAutoScrollInterval(); 35535 }, // eslint-disable-next-line react-hooks/exhaustive-deps 35536 [acceleration, autoScroll, canScroll, clearAutoScrollInterval, enabled, interval, // eslint-disable-next-line react-hooks/exhaustive-deps 35537 JSON.stringify(rect), // eslint-disable-next-line react-hooks/exhaustive-deps 35538 JSON.stringify(scrollIntent), setAutoScrollInterval, scrollableAncestors, sortedScrollableAncestors, scrollableAncestorRects, // eslint-disable-next-line react-hooks/exhaustive-deps 35539 JSON.stringify(threshold)]); 35540} 35541const defaultScrollIntent = { 35542 x: { 35543 [Direction.Backward]: false, 35544 [Direction.Forward]: false 35545 }, 35546 y: { 35547 [Direction.Backward]: false, 35548 [Direction.Forward]: false 35549 } 35550}; 35551 35552function useScrollIntent(_ref2) { 35553 let { 35554 delta, 35555 disabled 35556 } = _ref2; 35557 const previousDelta = usePrevious(delta); 35558 return useLazyMemo(previousIntent => { 35559 if (disabled || !previousDelta || !previousIntent) { 35560 // Reset scroll intent tracking when auto-scrolling is disabled 35561 return defaultScrollIntent; 35562 } 35563 35564 const direction = { 35565 x: Math.sign(delta.x - previousDelta.x), 35566 y: Math.sign(delta.y - previousDelta.y) 35567 }; // Keep track of the user intent to scroll in each direction for both axis 35568 35569 return { 35570 x: { 35571 [Direction.Backward]: previousIntent.x[Direction.Backward] || direction.x === -1, 35572 [Direction.Forward]: previousIntent.x[Direction.Forward] || direction.x === 1 35573 }, 35574 y: { 35575 [Direction.Backward]: previousIntent.y[Direction.Backward] || direction.y === -1, 35576 [Direction.Forward]: previousIntent.y[Direction.Forward] || direction.y === 1 35577 } 35578 }; 35579 }, [disabled, delta, previousDelta]); 35580} 35581 35582function useCachedNode(draggableNodes, id) { 35583 const draggableNode = id != null ? draggableNodes.get(id) : undefined; 35584 const node = draggableNode ? draggableNode.node.current : null; 35585 return useLazyMemo(cachedNode => { 35586 var _ref; 35587 35588 if (id == null) { 35589 return null; 35590 } // In some cases, the draggable node can unmount while dragging 35591 // This is the case for virtualized lists. In those situations, 35592 // we fall back to the last known value for that node. 35593 35594 35595 return (_ref = node != null ? node : cachedNode) != null ? _ref : null; 35596 }, [node, id]); 35597} 35598 35599function useCombineActivators(sensors, getSyntheticHandler) { 35600 return reactExports.useMemo(() => sensors.reduce((accumulator, sensor) => { 35601 const { 35602 sensor: Sensor 35603 } = sensor; 35604 const sensorActivators = Sensor.activators.map(activator => ({ 35605 eventName: activator.eventName, 35606 handler: getSyntheticHandler(activator.handler, sensor) 35607 })); 35608 return [...accumulator, ...sensorActivators]; 35609 }, []), [sensors, getSyntheticHandler]); 35610} 35611 35612var MeasuringStrategy; 35613 35614(function (MeasuringStrategy) { 35615 MeasuringStrategy[MeasuringStrategy["Always"] = 0] = "Always"; 35616 MeasuringStrategy[MeasuringStrategy["BeforeDragging"] = 1] = "BeforeDragging"; 35617 MeasuringStrategy[MeasuringStrategy["WhileDragging"] = 2] = "WhileDragging"; 35618})(MeasuringStrategy || (MeasuringStrategy = {})); 35619 35620var MeasuringFrequency; 35621 35622(function (MeasuringFrequency) { 35623 MeasuringFrequency["Optimized"] = "optimized"; 35624})(MeasuringFrequency || (MeasuringFrequency = {})); 35625 35626const defaultValue = /*#__PURE__*/new Map(); 35627function useDroppableMeasuring(containers, _ref) { 35628 let { 35629 dragging, 35630 dependencies, 35631 config 35632 } = _ref; 35633 const [queue, setQueue] = reactExports.useState(null); 35634 const { 35635 frequency, 35636 measure, 35637 strategy 35638 } = config; 35639 const containersRef = reactExports.useRef(containers); 35640 const disabled = isDisabled(); 35641 const disabledRef = useLatestValue(disabled); 35642 const measureDroppableContainers = reactExports.useCallback(function (ids) { 35643 if (ids === void 0) { 35644 ids = []; 35645 } 35646 35647 if (disabledRef.current) { 35648 return; 35649 } 35650 35651 setQueue(value => { 35652 if (value === null) { 35653 return ids; 35654 } 35655 35656 return value.concat(ids.filter(id => !value.includes(id))); 35657 }); 35658 }, [disabledRef]); 35659 const timeoutId = reactExports.useRef(null); 35660 const droppableRects = useLazyMemo(previousValue => { 35661 if (disabled && !dragging) { 35662 return defaultValue; 35663 } 35664 35665 if (!previousValue || previousValue === defaultValue || containersRef.current !== containers || queue != null) { 35666 const map = new Map(); 35667
vendor: 49,936 bytes, lines 35668-37498
35668 for (let container of containers) { 35669 if (!container) { 35670 continue; 35671 } 35672 35673 if (queue && queue.length > 0 && !queue.includes(container.id) && container.rect.current) { 35674 // This container does not need to be re-measured 35675 map.set(container.id, container.rect.current); 35676 continue; 35677 } 35678 35679 const node = container.node.current; 35680 const rect = node ? new Rect(measure(node), node) : null; 35681 container.rect.current = rect; 35682 35683 if (rect) { 35684 map.set(container.id, rect); 35685 } 35686 } 35687 35688 return map; 35689 } 35690 35691 return previousValue; 35692 }, [containers, queue, dragging, disabled, measure]); 35693 reactExports.useEffect(() => { 35694 containersRef.current = containers; 35695 }, [containers]); 35696 reactExports.useEffect(() => { 35697 if (disabled) { 35698 return; 35699 } 35700 35701 measureDroppableContainers(); 35702 }, // eslint-disable-next-line react-hooks/exhaustive-deps 35703 [dragging, disabled]); 35704 reactExports.useEffect(() => { 35705 if (queue && queue.length > 0) { 35706 setQueue(null); 35707 } 35708 }, //eslint-disable-next-line react-hooks/exhaustive-deps 35709 [JSON.stringify(queue)]); 35710 reactExports.useEffect(() => { 35711 if (disabled || typeof frequency !== 'number' || timeoutId.current !== null) { 35712 return; 35713 } 35714 35715 timeoutId.current = setTimeout(() => { 35716 measureDroppableContainers(); 35717 timeoutId.current = null; 35718 }, frequency); 35719 }, // eslint-disable-next-line react-hooks/exhaustive-deps 35720 [frequency, disabled, measureDroppableContainers, ...dependencies]); 35721 return { 35722 droppableRects, 35723 measureDroppableContainers, 35724 measuringScheduled: queue != null 35725 }; 35726 35727 function isDisabled() { 35728 switch (strategy) { 35729 case MeasuringStrategy.Always: 35730 return false; 35731 35732 case MeasuringStrategy.BeforeDragging: 35733 return dragging; 35734 35735 default: 35736 return !dragging; 35737 } 35738 } 35739} 35740 35741function useInitialValue(value, computeFn) { 35742 return useLazyMemo(previousValue => { 35743 if (!value) { 35744 return null; 35745 } 35746 35747 if (previousValue) { 35748 return previousValue; 35749 } 35750 35751 return typeof computeFn === 'function' ? computeFn(value) : value; 35752 }, [computeFn, value]); 35753} 35754 35755function useInitialRect(node, measure) { 35756 return useInitialValue(node, measure); 35757} 35758 35759/** 35760 * Returns a new MutationObserver instance. 35761 * If `MutationObserver` is undefined in the execution environment, returns `undefined`. 35762 */ 35763 35764function useMutationObserver(_ref) { 35765 let { 35766 callback, 35767 disabled 35768 } = _ref; 35769 const handleMutations = useEvent(callback); 35770 const mutationObserver = reactExports.useMemo(() => { 35771 if (disabled || typeof window === 'undefined' || typeof window.MutationObserver === 'undefined') { 35772 return undefined; 35773 } 35774 35775 const { 35776 MutationObserver 35777 } = window; 35778 return new MutationObserver(handleMutations); 35779 }, [handleMutations, disabled]); 35780 reactExports.useEffect(() => { 35781 return () => mutationObserver == null ? void 0 : mutationObserver.disconnect(); 35782 }, [mutationObserver]); 35783 return mutationObserver; 35784} 35785 35786/** 35787 * Returns a new ResizeObserver instance bound to the `onResize` callback. 35788 * If `ResizeObserver` is undefined in the execution environment, returns `undefined`. 35789 */ 35790 35791function useResizeObserver$1(_ref) { 35792 let { 35793 callback, 35794 disabled 35795 } = _ref; 35796 const handleResize = useEvent(callback); 35797 const resizeObserver = reactExports.useMemo(() => { 35798 if (disabled || typeof window === 'undefined' || typeof window.ResizeObserver === 'undefined') { 35799 return undefined; 35800 } 35801 35802 const { 35803 ResizeObserver 35804 } = window; 35805 return new ResizeObserver(handleResize); 35806 }, // eslint-disable-next-line react-hooks/exhaustive-deps 35807 [disabled]); 35808 reactExports.useEffect(() => { 35809 return () => resizeObserver == null ? void 0 : resizeObserver.disconnect(); 35810 }, [resizeObserver]); 35811 return resizeObserver; 35812} 35813 35814function defaultMeasure(element) { 35815 return new Rect(getClientRect(element), element); 35816} 35817 35818function useRect(element, measure, fallbackRect) { 35819 if (measure === void 0) { 35820 measure = defaultMeasure; 35821 } 35822 35823 const [rect, setRect] = reactExports.useState(null); 35824 35825 function measureRect() { 35826 setRect(currentRect => { 35827 if (!element) { 35828 return null; 35829 } 35830 35831 if (element.isConnected === false) { 35832 var _ref; 35833 35834 // Fall back to last rect we measured if the element is 35835 // no longer connected to the DOM. 35836 return (_ref = currentRect != null ? currentRect : fallbackRect) != null ? _ref : null; 35837 } 35838 35839 const newRect = measure(element); 35840 35841 if (JSON.stringify(currentRect) === JSON.stringify(newRect)) { 35842 return currentRect; 35843 } 35844 35845 return newRect; 35846 }); 35847 } 35848 35849 const mutationObserver = useMutationObserver({ 35850 callback(records) { 35851 if (!element) { 35852 return; 35853 } 35854 35855 for (const record of records) { 35856 const { 35857 type, 35858 target 35859 } = record; 35860 35861 if (type === 'childList' && target instanceof HTMLElement && target.contains(element)) { 35862 measureRect(); 35863 break; 35864 } 35865 } 35866 } 35867 35868 }); 35869 const resizeObserver = useResizeObserver$1({ 35870 callback: measureRect 35871 }); 35872 useIsomorphicLayoutEffect$1(() => { 35873 measureRect(); 35874 35875 if (element) { 35876 resizeObserver == null ? void 0 : resizeObserver.observe(element); 35877 mutationObserver == null ? void 0 : mutationObserver.observe(document.body, { 35878 childList: true, 35879 subtree: true 35880 }); 35881 } else { 35882 resizeObserver == null ? void 0 : resizeObserver.disconnect(); 35883 mutationObserver == null ? void 0 : mutationObserver.disconnect(); 35884 } 35885 }, [element]); 35886 return rect; 35887} 35888 35889function useRectDelta(rect) { 35890 const initialRect = useInitialValue(rect); 35891 return getRectDelta(rect, initialRect); 35892} 35893 35894const defaultValue$1 = []; 35895function useScrollableAncestors(node) { 35896 const previousNode = reactExports.useRef(node); 35897 const ancestors = useLazyMemo(previousValue => { 35898 if (!node) { 35899 return defaultValue$1; 35900 } 35901 35902 if (previousValue && previousValue !== defaultValue$1 && node && previousNode.current && node.parentNode === previousNode.current.parentNode) { 35903 return previousValue; 35904 } 35905 35906 return getScrollableAncestors(node); 35907 }, [node]); 35908 reactExports.useEffect(() => { 35909 previousNode.current = node; 35910 }, [node]); 35911 return ancestors; 35912} 35913 35914function useScrollOffsets(elements) { 35915 const [scrollCoordinates, setScrollCoordinates] = reactExports.useState(null); 35916 const prevElements = reactExports.useRef(elements); // To-do: Throttle the handleScroll callback 35917 35918 const handleScroll = reactExports.useCallback(event => { 35919 const scrollingElement = getScrollableElement(event.target); 35920 35921 if (!scrollingElement) { 35922 return; 35923 } 35924 35925 setScrollCoordinates(scrollCoordinates => { 35926 if (!scrollCoordinates) { 35927 return null; 35928 } 35929 35930 scrollCoordinates.set(scrollingElement, getScrollCoordinates(scrollingElement)); 35931 return new Map(scrollCoordinates); 35932 }); 35933 }, []); 35934 reactExports.useEffect(() => { 35935 const previousElements = prevElements.current; 35936 35937 if (elements !== previousElements) { 35938 cleanup(previousElements); 35939 const entries = elements.map(element => { 35940 const scrollableElement = getScrollableElement(element); 35941 35942 if (scrollableElement) { 35943 scrollableElement.addEventListener('scroll', handleScroll, { 35944 passive: true 35945 }); 35946 return [scrollableElement, getScrollCoordinates(scrollableElement)]; 35947 } 35948 35949 return null; 35950 }).filter(entry => entry != null); 35951 setScrollCoordinates(entries.length ? new Map(entries) : null); 35952 prevElements.current = elements; 35953 } 35954 35955 return () => { 35956 cleanup(elements); 35957 cleanup(previousElements); 35958 }; 35959 35960 function cleanup(elements) { 35961 elements.forEach(element => { 35962 const scrollableElement = getScrollableElement(element); 35963 scrollableElement == null ? void 0 : scrollableElement.removeEventListener('scroll', handleScroll); 35964 }); 35965 } 35966 }, [handleScroll, elements]); 35967 return reactExports.useMemo(() => { 35968 if (elements.length) { 35969 return scrollCoordinates ? Array.from(scrollCoordinates.values()).reduce((acc, coordinates) => add(acc, coordinates), defaultCoordinates) : getScrollOffsets(elements); 35970 } 35971 35972 return defaultCoordinates; 35973 }, [elements, scrollCoordinates]); 35974} 35975 35976function useScrollOffsetsDelta(scrollOffsets, dependencies) { 35977 if (dependencies === void 0) { 35978 dependencies = []; 35979 } 35980 35981 const initialScrollOffsets = reactExports.useRef(null); 35982 reactExports.useEffect(() => { 35983 initialScrollOffsets.current = null; 35984 }, // eslint-disable-next-line react-hooks/exhaustive-deps 35985 dependencies); 35986 reactExports.useEffect(() => { 35987 const hasScrollOffsets = scrollOffsets !== defaultCoordinates; 35988 35989 if (hasScrollOffsets && !initialScrollOffsets.current) { 35990 initialScrollOffsets.current = scrollOffsets; 35991 } 35992 35993 if (!hasScrollOffsets && initialScrollOffsets.current) { 35994 initialScrollOffsets.current = null; 35995 } 35996 }, [scrollOffsets]); 35997 return initialScrollOffsets.current ? subtract(scrollOffsets, initialScrollOffsets.current) : defaultCoordinates; 35998} 35999 36000function useSensorSetup(sensors) { 36001 reactExports.useEffect(() => { 36002 if (!canUseDOM) { 36003 return; 36004 } 36005 36006 const teardownFns = sensors.map(_ref => { 36007 let { 36008 sensor 36009 } = _ref; 36010 return sensor.setup == null ? void 0 : sensor.setup(); 36011 }); 36012 return () => { 36013 for (const teardown of teardownFns) { 36014 teardown == null ? void 0 : teardown(); 36015 } 36016 }; 36017 }, // TO-DO: Sensors length could theoretically change which would not be a valid dependency 36018 // eslint-disable-next-line react-hooks/exhaustive-deps 36019 sensors.map(_ref2 => { 36020 let { 36021 sensor 36022 } = _ref2; 36023 return sensor; 36024 })); 36025} 36026 36027function useSyntheticListeners(listeners, id) { 36028 return reactExports.useMemo(() => { 36029 return listeners.reduce((acc, _ref) => { 36030 let { 36031 eventName, 36032 handler 36033 } = _ref; 36034 36035 acc[eventName] = event => { 36036 handler(event, id); 36037 }; 36038 36039 return acc; 36040 }, {}); 36041 }, [listeners, id]); 36042} 36043 36044function useWindowRect(element) { 36045 return reactExports.useMemo(() => element ? getWindowClientRect(element) : null, [element]); 36046} 36047 36048const defaultValue$2 = []; 36049function useRects(elements, measure) { 36050 if (measure === void 0) { 36051 measure = getClientRect; 36052 } 36053 36054 const [firstElement] = elements; 36055 const windowRect = useWindowRect(firstElement ? getWindow(firstElement) : null); 36056 const [rects, setRects] = reactExports.useState(defaultValue$2); 36057 36058 function measureRects() { 36059 setRects(() => { 36060 if (!elements.length) { 36061 return defaultValue$2; 36062 } 36063 36064 return elements.map(element => isDocumentScrollingElement(element) ? windowRect : new Rect(measure(element), element)); 36065 }); 36066 } 36067 36068 const resizeObserver = useResizeObserver$1({ 36069 callback: measureRects 36070 }); 36071 useIsomorphicLayoutEffect$1(() => { 36072 resizeObserver == null ? void 0 : resizeObserver.disconnect(); 36073 measureRects(); 36074 elements.forEach(element => resizeObserver == null ? void 0 : resizeObserver.observe(element)); 36075 }, [elements]); 36076 return rects; 36077} 36078 36079function getMeasurableNode(node) { 36080 if (!node) { 36081 return null; 36082 } 36083 36084 if (node.children.length > 1) { 36085 return node; 36086 } 36087 36088 const firstChild = node.children[0]; 36089 return isHTMLElement(firstChild) ? firstChild : node; 36090} 36091 36092function useDragOverlayMeasuring(_ref) { 36093 let { 36094 measure 36095 } = _ref; 36096 const [rect, setRect] = reactExports.useState(null); 36097 const handleResize = reactExports.useCallback(entries => { 36098 for (const { 36099 target 36100 } of entries) { 36101 if (isHTMLElement(target)) { 36102 setRect(rect => { 36103 const newRect = measure(target); 36104 return rect ? { ...rect, 36105 width: newRect.width, 36106 height: newRect.height 36107 } : newRect; 36108 }); 36109 break; 36110 } 36111 } 36112 }, [measure]); 36113 const resizeObserver = useResizeObserver$1({ 36114 callback: handleResize 36115 }); 36116 const handleNodeChange = reactExports.useCallback(element => { 36117 const node = getMeasurableNode(element); 36118 resizeObserver == null ? void 0 : resizeObserver.disconnect(); 36119 36120 if (node) { 36121 resizeObserver == null ? void 0 : resizeObserver.observe(node); 36122 } 36123 36124 setRect(node ? measure(node) : null); 36125 }, [measure, resizeObserver]); 36126 const [nodeRef, setRef] = useNodeRef(handleNodeChange); 36127 return reactExports.useMemo(() => ({ 36128 nodeRef, 36129 rect, 36130 setRef 36131 }), [rect, nodeRef, setRef]); 36132} 36133 36134const defaultSensors = [{ 36135 sensor: PointerSensor, 36136 options: {} 36137}, { 36138 sensor: KeyboardSensor, 36139 options: {} 36140}]; 36141const defaultData = { 36142 current: {} 36143}; 36144const defaultMeasuringConfiguration = { 36145 draggable: { 36146 measure: getTransformAgnosticClientRect 36147 }, 36148 droppable: { 36149 measure: getTransformAgnosticClientRect, 36150 strategy: MeasuringStrategy.WhileDragging, 36151 frequency: MeasuringFrequency.Optimized 36152 }, 36153 dragOverlay: { 36154 measure: getClientRect 36155 } 36156}; 36157 36158class DroppableContainersMap extends Map { 36159 get(id) { 36160 var _super$get; 36161 36162 return id != null ? (_super$get = super.get(id)) != null ? _super$get : undefined : undefined; 36163 } 36164 36165 toArray() { 36166 return Array.from(this.values()); 36167 } 36168 36169 getEnabled() { 36170 return this.toArray().filter(_ref => { 36171 let { 36172 disabled 36173 } = _ref; 36174 return !disabled; 36175 }); 36176 } 36177 36178 getNodeFor(id) { 36179 var _this$get$node$curren, _this$get; 36180 36181 return (_this$get$node$curren = (_this$get = this.get(id)) == null ? void 0 : _this$get.node.current) != null ? _this$get$node$curren : undefined; 36182 } 36183 36184} 36185 36186const defaultPublicContext = { 36187 activatorEvent: null, 36188 active: null, 36189 activeNode: null, 36190 activeNodeRect: null, 36191 collisions: null, 36192 containerNodeRect: null, 36193 draggableNodes: /*#__PURE__*/new Map(), 36194 droppableRects: /*#__PURE__*/new Map(), 36195 droppableContainers: /*#__PURE__*/new DroppableContainersMap(), 36196 over: null, 36197 dragOverlay: { 36198 nodeRef: { 36199 current: null 36200 }, 36201 rect: null, 36202 setRef: noop 36203 }, 36204 scrollableAncestors: [], 36205 scrollableAncestorRects: [], 36206 measuringConfiguration: defaultMeasuringConfiguration, 36207 measureDroppableContainers: noop, 36208 windowRect: null, 36209 measuringScheduled: false 36210}; 36211const defaultInternalContext = { 36212 activatorEvent: null, 36213 activators: [], 36214 active: null, 36215 activeNodeRect: null, 36216 ariaDescribedById: { 36217 draggable: '' 36218 }, 36219 dispatch: noop, 36220 draggableNodes: /*#__PURE__*/new Map(), 36221 over: null, 36222 measureDroppableContainers: noop 36223}; 36224const InternalContext = /*#__PURE__*/reactExports.createContext(defaultInternalContext); 36225const PublicContext = /*#__PURE__*/reactExports.createContext(defaultPublicContext); 36226 36227function getInitialState() { 36228 return { 36229 draggable: { 36230 active: null, 36231 initialCoordinates: { 36232 x: 0, 36233 y: 0 36234 }, 36235 nodes: new Map(), 36236 translate: { 36237 x: 0, 36238 y: 0 36239 } 36240 }, 36241 droppable: { 36242 containers: new DroppableContainersMap() 36243 } 36244 }; 36245} 36246function reducer(state, action) { 36247 switch (action.type) { 36248 case Action.DragStart: 36249 return { ...state, 36250 draggable: { ...state.draggable, 36251 initialCoordinates: action.initialCoordinates, 36252 active: action.active 36253 } 36254 }; 36255 36256 case Action.DragMove: 36257 if (state.draggable.active == null) { 36258 return state; 36259 } 36260 36261 return { ...state, 36262 draggable: { ...state.draggable, 36263 translate: { 36264 x: action.coordinates.x - state.draggable.initialCoordinates.x, 36265 y: action.coordinates.y - state.draggable.initialCoordinates.y 36266 } 36267 } 36268 }; 36269 36270 case Action.DragEnd: 36271 case Action.DragCancel: 36272 return { ...state, 36273 draggable: { ...state.draggable, 36274 active: null, 36275 initialCoordinates: { 36276 x: 0, 36277 y: 0 36278 }, 36279 translate: { 36280 x: 0, 36281 y: 0 36282 } 36283 } 36284 }; 36285 36286 case Action.RegisterDroppable: 36287 { 36288 const { 36289 element 36290 } = action; 36291 const { 36292 id 36293 } = element; 36294 const containers = new DroppableContainersMap(state.droppable.containers); 36295 containers.set(id, element); 36296 return { ...state, 36297 droppable: { ...state.droppable, 36298 containers 36299 } 36300 }; 36301 } 36302 36303 case Action.SetDroppableDisabled: 36304 { 36305 const { 36306 id, 36307 key, 36308 disabled 36309 } = action; 36310 const element = state.droppable.containers.get(id); 36311 36312 if (!element || key !== element.key) { 36313 return state; 36314 } 36315 36316 const containers = new DroppableContainersMap(state.droppable.containers); 36317 containers.set(id, { ...element, 36318 disabled 36319 }); 36320 return { ...state, 36321 droppable: { ...state.droppable, 36322 containers 36323 } 36324 }; 36325 } 36326 36327 case Action.UnregisterDroppable: 36328 { 36329 const { 36330 id, 36331 key 36332 } = action; 36333 const element = state.droppable.containers.get(id); 36334 36335 if (!element || key !== element.key) { 36336 return state; 36337 } 36338 36339 const containers = new DroppableContainersMap(state.droppable.containers); 36340 containers.delete(id); 36341 return { ...state, 36342 droppable: { ...state.droppable, 36343 containers 36344 } 36345 }; 36346 } 36347 36348 default: 36349 { 36350 return state; 36351 } 36352 } 36353} 36354 36355function RestoreFocus(_ref) { 36356 let { 36357 disabled 36358 } = _ref; 36359 const { 36360 active, 36361 activatorEvent, 36362 draggableNodes 36363 } = reactExports.useContext(InternalContext); 36364 const previousActivatorEvent = usePrevious(activatorEvent); 36365 const previousActiveId = usePrevious(active == null ? void 0 : active.id); // Restore keyboard focus on the activator node 36366 36367 reactExports.useEffect(() => { 36368 if (disabled) { 36369 return; 36370 } 36371 36372 if (!activatorEvent && previousActivatorEvent && previousActiveId != null) { 36373 if (!isKeyboardEvent(previousActivatorEvent)) { 36374 return; 36375 } 36376 36377 if (document.activeElement === previousActivatorEvent.target) { 36378 // No need to restore focus 36379 return; 36380 } 36381 36382 const draggableNode = draggableNodes.get(previousActiveId); 36383 36384 if (!draggableNode) { 36385 return; 36386 } 36387 36388 const { 36389 activatorNode, 36390 node 36391 } = draggableNode; 36392 36393 if (!activatorNode.current && !node.current) { 36394 return; 36395 } 36396 36397 requestAnimationFrame(() => { 36398 for (const element of [activatorNode.current, node.current]) { 36399 if (!element) { 36400 continue; 36401 } 36402 36403 const focusableNode = findFirstFocusableNode(element); 36404 36405 if (focusableNode) { 36406 focusableNode.focus(); 36407 break; 36408 } 36409 } 36410 }); 36411 } 36412 }, [activatorEvent, disabled, draggableNodes, previousActiveId, previousActivatorEvent]); 36413 return null; 36414} 36415 36416function applyModifiers(modifiers, _ref) { 36417 let { 36418 transform, 36419 ...args 36420 } = _ref; 36421 return modifiers != null && modifiers.length ? modifiers.reduce((accumulator, modifier) => { 36422 return modifier({ 36423 transform: accumulator, 36424 ...args 36425 }); 36426 }, transform) : transform; 36427} 36428 36429function useMeasuringConfiguration(config) { 36430 return reactExports.useMemo(() => ({ 36431 draggable: { ...defaultMeasuringConfiguration.draggable, 36432 ...(config == null ? void 0 : config.draggable) 36433 }, 36434 droppable: { ...defaultMeasuringConfiguration.droppable, 36435 ...(config == null ? void 0 : config.droppable) 36436 }, 36437 dragOverlay: { ...defaultMeasuringConfiguration.dragOverlay, 36438 ...(config == null ? void 0 : config.dragOverlay) 36439 } 36440 }), // eslint-disable-next-line react-hooks/exhaustive-deps 36441 [config == null ? void 0 : config.draggable, config == null ? void 0 : config.droppable, config == null ? void 0 : config.dragOverlay]); 36442} 36443 36444function useLayoutShiftScrollCompensation(_ref) { 36445 let { 36446 activeNode, 36447 measure, 36448 initialRect, 36449 config = true 36450 } = _ref; 36451 const initialized = reactExports.useRef(false); 36452 const { 36453 x, 36454 y 36455 } = typeof config === 'boolean' ? { 36456 x: config, 36457 y: config 36458 } : config; 36459 useIsomorphicLayoutEffect$1(() => { 36460 const disabled = !x && !y; 36461 36462 if (disabled || !activeNode) { 36463 initialized.current = false; 36464 return; 36465 } 36466 36467 if (initialized.current || !initialRect) { 36468 // Return early if layout shift scroll compensation was already attempted 36469 // or if there is no initialRect to compare to. 36470 return; 36471 } // Get the most up to date node ref for the active draggable 36472 36473 36474 const node = activeNode == null ? void 0 : activeNode.node.current; 36475 36476 if (!node || node.isConnected === false) { 36477 // Return early if there is no attached node ref or if the node is 36478 // disconnected from the document. 36479 return; 36480 } 36481 36482 const rect = measure(node); 36483 const rectDelta = getRectDelta(rect, initialRect); 36484 36485 if (!x) { 36486 rectDelta.x = 0; 36487 } 36488 36489 if (!y) { 36490 rectDelta.y = 0; 36491 } // Only perform layout shift scroll compensation once 36492 36493 36494 initialized.current = true; 36495 36496 if (Math.abs(rectDelta.x) > 0 || Math.abs(rectDelta.y) > 0) { 36497 const firstScrollableAncestor = getFirstScrollableAncestor(node); 36498 36499 if (firstScrollableAncestor) { 36500 firstScrollableAncestor.scrollBy({ 36501 top: rectDelta.y, 36502 left: rectDelta.x 36503 }); 36504 } 36505 } 36506 }, [activeNode, x, y, initialRect, measure]); 36507} 36508 36509const ActiveDraggableContext = /*#__PURE__*/reactExports.createContext({ ...defaultCoordinates, 36510 scaleX: 1, 36511 scaleY: 1 36512}); 36513var Status; 36514 36515(function (Status) { 36516 Status[Status["Uninitialized"] = 0] = "Uninitialized"; 36517 Status[Status["Initializing"] = 1] = "Initializing"; 36518 Status[Status["Initialized"] = 2] = "Initialized"; 36519})(Status || (Status = {})); 36520 36521const DndContext = /*#__PURE__*/reactExports.memo(function DndContext(_ref) { 36522 var _sensorContext$curren, _dragOverlay$nodeRef$, _dragOverlay$rect, _over$rect; 36523 36524 let { 36525 id, 36526 accessibility, 36527 autoScroll = true, 36528 children, 36529 sensors = defaultSensors, 36530 collisionDetection = rectIntersection, 36531 measuring, 36532 modifiers, 36533 ...props 36534 } = _ref; 36535 const store = reactExports.useReducer(reducer, undefined, getInitialState); 36536 const [state, dispatch] = store; 36537 const [dispatchMonitorEvent, registerMonitorListener] = useDndMonitorProvider(); 36538 const [status, setStatus] = reactExports.useState(Status.Uninitialized); 36539 const isInitialized = status === Status.Initialized; 36540 const { 36541 draggable: { 36542 active: activeId, 36543 nodes: draggableNodes, 36544 translate 36545 }, 36546 droppable: { 36547 containers: droppableContainers 36548 } 36549 } = state; 36550 const node = activeId != null ? draggableNodes.get(activeId) : null; 36551 const activeRects = reactExports.useRef({ 36552 initial: null, 36553 translated: null 36554 }); 36555 const active = reactExports.useMemo(() => { 36556 var _node$data; 36557 36558 return activeId != null ? { 36559 id: activeId, 36560 // It's possible for the active node to unmount while dragging 36561 data: (_node$data = node == null ? void 0 : node.data) != null ? _node$data : defaultData, 36562 rect: activeRects 36563 } : null; 36564 }, [activeId, node]); 36565 const activeRef = reactExports.useRef(null); 36566 const [activeSensor, setActiveSensor] = reactExports.useState(null); 36567 const [activatorEvent, setActivatorEvent] = reactExports.useState(null); 36568 const latestProps = useLatestValue(props, Object.values(props)); 36569 const draggableDescribedById = useUniqueId("DndDescribedBy", id); 36570 const enabledDroppableContainers = reactExports.useMemo(() => droppableContainers.getEnabled(), [droppableContainers]); 36571 const measuringConfiguration = useMeasuringConfiguration(measuring); 36572 const { 36573 droppableRects, 36574 measureDroppableContainers, 36575 measuringScheduled 36576 } = useDroppableMeasuring(enabledDroppableContainers, { 36577 dragging: isInitialized, 36578 dependencies: [translate.x, translate.y], 36579 config: measuringConfiguration.droppable 36580 }); 36581 const activeNode = useCachedNode(draggableNodes, activeId); 36582 const activationCoordinates = reactExports.useMemo(() => activatorEvent ? getEventCoordinates(activatorEvent) : null, [activatorEvent]); 36583 const autoScrollOptions = getAutoScrollerOptions(); 36584 const initialActiveNodeRect = useInitialRect(activeNode, measuringConfiguration.draggable.measure); 36585 useLayoutShiftScrollCompensation({ 36586 activeNode: activeId != null ? draggableNodes.get(activeId) : null, 36587 config: autoScrollOptions.layoutShiftCompensation, 36588 initialRect: initialActiveNodeRect, 36589 measure: measuringConfiguration.draggable.measure 36590 }); 36591 const activeNodeRect = useRect(activeNode, measuringConfiguration.draggable.measure, initialActiveNodeRect); 36592 const containerNodeRect = useRect(activeNode ? activeNode.parentElement : null); 36593 const sensorContext = reactExports.useRef({ 36594 activatorEvent: null, 36595 active: null, 36596 activeNode, 36597 collisionRect: null, 36598 collisions: null, 36599 droppableRects, 36600 draggableNodes, 36601 draggingNode: null, 36602 draggingNodeRect: null, 36603 droppableContainers, 36604 over: null, 36605 scrollableAncestors: [], 36606 scrollAdjustedTranslate: null 36607 }); 36608 const overNode = droppableContainers.getNodeFor((_sensorContext$curren = sensorContext.current.over) == null ? void 0 : _sensorContext$curren.id); 36609 const dragOverlay = useDragOverlayMeasuring({ 36610 measure: measuringConfiguration.dragOverlay.measure 36611 }); // Use the rect of the drag overlay if it is mounted 36612 36613 const draggingNode = (_dragOverlay$nodeRef$ = dragOverlay.nodeRef.current) != null ? _dragOverlay$nodeRef$ : activeNode; 36614 const draggingNodeRect = isInitialized ? (_dragOverlay$rect = dragOverlay.rect) != null ? _dragOverlay$rect : activeNodeRect : null; 36615 const usesDragOverlay = Boolean(dragOverlay.nodeRef.current && dragOverlay.rect); // The delta between the previous and new position of the draggable node 36616 // is only relevant when there is no drag overlay 36617 36618 const nodeRectDelta = useRectDelta(usesDragOverlay ? null : activeNodeRect); // Get the window rect of the dragging node 36619 36620 const windowRect = useWindowRect(draggingNode ? getWindow(draggingNode) : null); // Get scrollable ancestors of the dragging node 36621 36622 const scrollableAncestors = useScrollableAncestors(isInitialized ? overNode != null ? overNode : activeNode : null); 36623 const scrollableAncestorRects = useRects(scrollableAncestors); // Apply modifiers 36624 36625 const modifiedTranslate = applyModifiers(modifiers, { 36626 transform: { 36627 x: translate.x - nodeRectDelta.x, 36628 y: translate.y - nodeRectDelta.y, 36629 scaleX: 1, 36630 scaleY: 1 36631 }, 36632 activatorEvent, 36633 active, 36634 activeNodeRect, 36635 containerNodeRect, 36636 draggingNodeRect, 36637 over: sensorContext.current.over, 36638 overlayNodeRect: dragOverlay.rect, 36639 scrollableAncestors, 36640 scrollableAncestorRects, 36641 windowRect 36642 }); 36643 const pointerCoordinates = activationCoordinates ? add(activationCoordinates, translate) : null; 36644 const scrollOffsets = useScrollOffsets(scrollableAncestors); // Represents the scroll delta since dragging was initiated 36645 36646 const scrollAdjustment = useScrollOffsetsDelta(scrollOffsets); // Represents the scroll delta since the last time the active node rect was measured 36647 36648 const activeNodeScrollDelta = useScrollOffsetsDelta(scrollOffsets, [activeNodeRect]); 36649 const scrollAdjustedTranslate = add(modifiedTranslate, scrollAdjustment); 36650 const collisionRect = draggingNodeRect ? getAdjustedRect(draggingNodeRect, modifiedTranslate) : null; 36651 const collisions = active && collisionRect ? collisionDetection({ 36652 active, 36653 collisionRect, 36654 droppableRects, 36655 droppableContainers: enabledDroppableContainers, 36656 pointerCoordinates 36657 }) : null; 36658 const overId = getFirstCollision(collisions, 'id'); 36659 const [over, setOver] = reactExports.useState(null); // When there is no drag overlay used, we need to account for the 36660 // window scroll delta 36661 36662 const appliedTranslate = usesDragOverlay ? modifiedTranslate : add(modifiedTranslate, activeNodeScrollDelta); 36663 const transform = adjustScale(appliedTranslate, (_over$rect = over == null ? void 0 : over.rect) != null ? _over$rect : null, activeNodeRect); 36664 const activeSensorRef = reactExports.useRef(null); 36665 const instantiateSensor = reactExports.useCallback((event, _ref2) => { 36666 let { 36667 sensor: Sensor, 36668 options 36669 } = _ref2; 36670 36671 if (activeRef.current == null) { 36672 return; 36673 } 36674 36675 const activeNode = draggableNodes.get(activeRef.current); 36676 36677 if (!activeNode) { 36678 return; 36679 } 36680 36681 const activatorEvent = event.nativeEvent; 36682 const sensorInstance = new Sensor({ 36683 active: activeRef.current, 36684 activeNode, 36685 event: activatorEvent, 36686 options, 36687 // Sensors need to be instantiated with refs for arguments that change over time 36688 // otherwise they are frozen in time with the stale arguments 36689 context: sensorContext, 36690 36691 onAbort(id) { 36692 const draggableNode = draggableNodes.get(id); 36693 36694 if (!draggableNode) { 36695 return; 36696 } 36697 36698 const { 36699 onDragAbort 36700 } = latestProps.current; 36701 const event = { 36702 id 36703 }; 36704 onDragAbort == null ? void 0 : onDragAbort(event); 36705 dispatchMonitorEvent({ 36706 type: 'onDragAbort', 36707 event 36708 }); 36709 }, 36710 36711 onPending(id, constraint, initialCoordinates, offset) { 36712 const draggableNode = draggableNodes.get(id); 36713 36714 if (!draggableNode) { 36715 return; 36716 } 36717 36718 const { 36719 onDragPending 36720 } = latestProps.current; 36721 const event = { 36722 id, 36723 constraint, 36724 initialCoordinates, 36725 offset 36726 }; 36727 onDragPending == null ? void 0 : onDragPending(event); 36728 dispatchMonitorEvent({ 36729 type: 'onDragPending', 36730 event 36731 }); 36732 }, 36733 36734 onStart(initialCoordinates) { 36735 const id = activeRef.current; 36736 36737 if (id == null) { 36738 return; 36739 } 36740 36741 const draggableNode = draggableNodes.get(id); 36742 36743 if (!draggableNode) { 36744 return; 36745 } 36746 36747 const { 36748 onDragStart 36749 } = latestProps.current; 36750 const event = { 36751 activatorEvent, 36752 active: { 36753 id, 36754 data: draggableNode.data, 36755 rect: activeRects 36756 } 36757 }; 36758 reactDomExports.unstable_batchedUpdates(() => { 36759 onDragStart == null ? void 0 : onDragStart(event); 36760 setStatus(Status.Initializing); 36761 dispatch({ 36762 type: Action.DragStart, 36763 initialCoordinates, 36764 active: id 36765 }); 36766 dispatchMonitorEvent({ 36767 type: 'onDragStart', 36768 event 36769 }); 36770 setActiveSensor(activeSensorRef.current); 36771 setActivatorEvent(activatorEvent); 36772 }); 36773 }, 36774 36775 onMove(coordinates) { 36776 dispatch({ 36777 type: Action.DragMove, 36778 coordinates 36779 }); 36780 }, 36781 36782 onEnd: createHandler(Action.DragEnd), 36783 onCancel: createHandler(Action.DragCancel) 36784 }); 36785 activeSensorRef.current = sensorInstance; 36786 36787 function createHandler(type) { 36788 return async function handler() { 36789 const { 36790 active, 36791 collisions, 36792 over, 36793 scrollAdjustedTranslate 36794 } = sensorContext.current; 36795 let event = null; 36796 36797 if (active && scrollAdjustedTranslate) { 36798 const { 36799 cancelDrop 36800 } = latestProps.current; 36801 event = { 36802 activatorEvent, 36803 active: active, 36804 collisions, 36805 delta: scrollAdjustedTranslate, 36806 over 36807 }; 36808 36809 if (type === Action.DragEnd && typeof cancelDrop === 'function') { 36810 const shouldCancel = await Promise.resolve(cancelDrop(event)); 36811 36812 if (shouldCancel) { 36813 type = Action.DragCancel; 36814 } 36815 } 36816 } 36817 36818 activeRef.current = null; 36819 reactDomExports.unstable_batchedUpdates(() => { 36820 dispatch({ 36821 type 36822 }); 36823 setStatus(Status.Uninitialized); 36824 setOver(null); 36825 setActiveSensor(null); 36826 setActivatorEvent(null); 36827 activeSensorRef.current = null; 36828 const eventName = type === Action.DragEnd ? 'onDragEnd' : 'onDragCancel'; 36829 36830 if (event) { 36831 const handler = latestProps.current[eventName]; 36832 handler == null ? void 0 : handler(event); 36833 dispatchMonitorEvent({ 36834 type: eventName, 36835 event 36836 }); 36837 } 36838 }); 36839 }; 36840 } 36841 }, // eslint-disable-next-line react-hooks/exhaustive-deps 36842 [draggableNodes]); 36843 const bindActivatorToSensorInstantiator = reactExports.useCallback((handler, sensor) => { 36844 return (event, active) => { 36845 const nativeEvent = event.nativeEvent; 36846 const activeDraggableNode = draggableNodes.get(active); 36847 36848 if ( // Another sensor is already instantiating 36849 activeRef.current !== null || // No active draggable 36850 !activeDraggableNode || // Event has already been captured 36851 nativeEvent.dndKit || nativeEvent.defaultPrevented) { 36852 return; 36853 } 36854 36855 const activationContext = { 36856 active: activeDraggableNode 36857 }; 36858 const shouldActivate = handler(event, sensor.options, activationContext); 36859 36860 if (shouldActivate === true) { 36861 nativeEvent.dndKit = { 36862 capturedBy: sensor.sensor 36863 }; 36864 activeRef.current = active; 36865 instantiateSensor(event, sensor); 36866 } 36867 }; 36868 }, [draggableNodes, instantiateSensor]); 36869 const activators = useCombineActivators(sensors, bindActivatorToSensorInstantiator); 36870 useSensorSetup(sensors); 36871 useIsomorphicLayoutEffect$1(() => { 36872 if (activeNodeRect && status === Status.Initializing) { 36873 setStatus(Status.Initialized); 36874 } 36875 }, [activeNodeRect, status]); 36876 reactExports.useEffect(() => { 36877 const { 36878 onDragMove 36879 } = latestProps.current; 36880 const { 36881 active, 36882 activatorEvent, 36883 collisions, 36884 over 36885 } = sensorContext.current; 36886 36887 if (!active || !activatorEvent) { 36888 return; 36889 } 36890 36891 const event = { 36892 active, 36893 activatorEvent, 36894 collisions, 36895 delta: { 36896 x: scrollAdjustedTranslate.x, 36897 y: scrollAdjustedTranslate.y 36898 }, 36899 over 36900 }; 36901 reactDomExports.unstable_batchedUpdates(() => { 36902 onDragMove == null ? void 0 : onDragMove(event); 36903 dispatchMonitorEvent({ 36904 type: 'onDragMove', 36905 event 36906 }); 36907 }); 36908 }, // eslint-disable-next-line react-hooks/exhaustive-deps 36909 [scrollAdjustedTranslate.x, scrollAdjustedTranslate.y]); 36910 reactExports.useEffect(() => { 36911 const { 36912 active, 36913 activatorEvent, 36914 collisions, 36915 droppableContainers, 36916 scrollAdjustedTranslate 36917 } = sensorContext.current; 36918 36919 if (!active || activeRef.current == null || !activatorEvent || !scrollAdjustedTranslate) { 36920 return; 36921 } 36922 36923 const { 36924 onDragOver 36925 } = latestProps.current; 36926 const overContainer = droppableContainers.get(overId); 36927 const over = overContainer && overContainer.rect.current ? { 36928 id: overContainer.id, 36929 rect: overContainer.rect.current, 36930 data: overContainer.data, 36931 disabled: overContainer.disabled 36932 } : null; 36933 const event = { 36934 active, 36935 activatorEvent, 36936 collisions, 36937 delta: { 36938 x: scrollAdjustedTranslate.x, 36939 y: scrollAdjustedTranslate.y 36940 }, 36941 over 36942 }; 36943 reactDomExports.unstable_batchedUpdates(() => { 36944 setOver(over); 36945 onDragOver == null ? void 0 : onDragOver(event); 36946 dispatchMonitorEvent({ 36947 type: 'onDragOver', 36948 event 36949 }); 36950 }); 36951 }, // eslint-disable-next-line react-hooks/exhaustive-deps 36952 [overId]); 36953 useIsomorphicLayoutEffect$1(() => { 36954 sensorContext.current = { 36955 activatorEvent, 36956 active, 36957 activeNode, 36958 collisionRect, 36959 collisions, 36960 droppableRects, 36961 draggableNodes, 36962 draggingNode, 36963 draggingNodeRect, 36964 droppableContainers, 36965 over, 36966 scrollableAncestors, 36967 scrollAdjustedTranslate 36968 }; 36969 activeRects.current = { 36970 initial: draggingNodeRect, 36971 translated: collisionRect 36972 }; 36973 }, [active, activeNode, collisions, collisionRect, draggableNodes, draggingNode, draggingNodeRect, droppableRects, droppableContainers, over, scrollableAncestors, scrollAdjustedTranslate]); 36974 useAutoScroller({ ...autoScrollOptions, 36975 delta: translate, 36976 draggingRect: collisionRect, 36977 pointerCoordinates, 36978 scrollableAncestors, 36979 scrollableAncestorRects 36980 }); 36981 const publicContext = reactExports.useMemo(() => { 36982 const context = { 36983 active, 36984 activeNode, 36985 activeNodeRect, 36986 activatorEvent, 36987 collisions, 36988 containerNodeRect, 36989 dragOverlay, 36990 draggableNodes, 36991 droppableContainers, 36992 droppableRects, 36993 over, 36994 measureDroppableContainers, 36995 scrollableAncestors, 36996 scrollableAncestorRects, 36997 measuringConfiguration, 36998 measuringScheduled, 36999 windowRect 37000 }; 37001 return context; 37002 }, [active, activeNode, activeNodeRect, activatorEvent, collisions, containerNodeRect, dragOverlay, draggableNodes, droppableContainers, droppableRects, over, measureDroppableContainers, scrollableAncestors, scrollableAncestorRects, measuringConfiguration, measuringScheduled, windowRect]); 37003 const internalContext = reactExports.useMemo(() => { 37004 const context = { 37005 activatorEvent, 37006 activators, 37007 active, 37008 activeNodeRect, 37009 ariaDescribedById: { 37010 draggable: draggableDescribedById 37011 }, 37012 dispatch, 37013 draggableNodes, 37014 over, 37015 measureDroppableContainers 37016 }; 37017 return context; 37018 }, [activatorEvent, activators, active, activeNodeRect, dispatch, draggableDescribedById, draggableNodes, over, measureDroppableContainers]); 37019 return React.createElement(DndMonitorContext.Provider, { 37020 value: registerMonitorListener 37021 }, React.createElement(InternalContext.Provider, { 37022 value: internalContext 37023 }, React.createElement(PublicContext.Provider, { 37024 value: publicContext 37025 }, React.createElement(ActiveDraggableContext.Provider, { 37026 value: transform 37027 }, children)), React.createElement(RestoreFocus, { 37028 disabled: (accessibility == null ? void 0 : accessibility.restoreFocus) === false 37029 })), React.createElement(Accessibility, { ...accessibility, 37030 hiddenTextDescribedById: draggableDescribedById 37031 })); 37032 37033 function getAutoScrollerOptions() { 37034 const activeSensorDisablesAutoscroll = (activeSensor == null ? void 0 : activeSensor.autoScrollEnabled) === false; 37035 const autoScrollGloballyDisabled = typeof autoScroll === 'object' ? autoScroll.enabled === false : autoScroll === false; 37036 const enabled = isInitialized && !activeSensorDisablesAutoscroll && !autoScrollGloballyDisabled; 37037 37038 if (typeof autoScroll === 'object') { 37039 return { ...autoScroll, 37040 enabled 37041 }; 37042 } 37043 37044 return { 37045 enabled 37046 }; 37047 } 37048}); 37049 37050const NullContext = /*#__PURE__*/reactExports.createContext(null); 37051const defaultRole = 'button'; 37052const ID_PREFIX$1 = 'Draggable'; 37053function useDraggable(_ref) { 37054 let { 37055 id, 37056 data, 37057 disabled = false, 37058 attributes 37059 } = _ref; 37060 const key = useUniqueId(ID_PREFIX$1); 37061 const { 37062 activators, 37063 activatorEvent, 37064 active, 37065 activeNodeRect, 37066 ariaDescribedById, 37067 draggableNodes, 37068 over 37069 } = reactExports.useContext(InternalContext); 37070 const { 37071 role = defaultRole, 37072 roleDescription = 'draggable', 37073 tabIndex = 0 37074 } = attributes != null ? attributes : {}; 37075 const isDragging = (active == null ? void 0 : active.id) === id; 37076 const transform = reactExports.useContext(isDragging ? ActiveDraggableContext : NullContext); 37077 const [node, setNodeRef] = useNodeRef(); 37078 const [activatorNode, setActivatorNodeRef] = useNodeRef(); 37079 const listeners = useSyntheticListeners(activators, id); 37080 const dataRef = useLatestValue(data); 37081 useIsomorphicLayoutEffect$1(() => { 37082 draggableNodes.set(id, { 37083 id, 37084 key, 37085 node, 37086 activatorNode, 37087 data: dataRef 37088 }); 37089 return () => { 37090 const node = draggableNodes.get(id); 37091 37092 if (node && node.key === key) { 37093 draggableNodes.delete(id); 37094 } 37095 }; 37096 }, // eslint-disable-next-line react-hooks/exhaustive-deps 37097 [draggableNodes, id]); 37098 const memoizedAttributes = reactExports.useMemo(() => ({ 37099 role, 37100 tabIndex, 37101 'aria-disabled': disabled, 37102 'aria-pressed': isDragging && role === defaultRole ? true : undefined, 37103 'aria-roledescription': roleDescription, 37104 'aria-describedby': ariaDescribedById.draggable 37105 }), [disabled, role, tabIndex, isDragging, roleDescription, ariaDescribedById.draggable]); 37106 return { 37107 active, 37108 activatorEvent, 37109 activeNodeRect, 37110 attributes: memoizedAttributes, 37111 isDragging, 37112 listeners: disabled ? undefined : listeners, 37113 node, 37114 over, 37115 setNodeRef, 37116 setActivatorNodeRef, 37117 transform 37118 }; 37119} 37120 37121function useDndContext() { 37122 return reactExports.useContext(PublicContext); 37123} 37124 37125const ID_PREFIX$1$1 = 'Droppable'; 37126const defaultResizeObserverConfig = { 37127 timeout: 25 37128}; 37129function useDroppable(_ref) { 37130 let { 37131 data, 37132 disabled = false, 37133 id, 37134 resizeObserverConfig 37135 } = _ref; 37136 const key = useUniqueId(ID_PREFIX$1$1); 37137 const { 37138 active, 37139 dispatch, 37140 over, 37141 measureDroppableContainers 37142 } = reactExports.useContext(InternalContext); 37143 const previous = reactExports.useRef({ 37144 disabled 37145 }); 37146 const resizeObserverConnected = reactExports.useRef(false); 37147 const rect = reactExports.useRef(null); 37148 const callbackId = reactExports.useRef(null); 37149 const { 37150 disabled: resizeObserverDisabled, 37151 updateMeasurementsFor, 37152 timeout: resizeObserverTimeout 37153 } = { ...defaultResizeObserverConfig, 37154 ...resizeObserverConfig 37155 }; 37156 const ids = useLatestValue(updateMeasurementsFor != null ? updateMeasurementsFor : id); 37157 const handleResize = reactExports.useCallback(() => { 37158 if (!resizeObserverConnected.current) { 37159 // ResizeObserver invokes the `handleResize` callback as soon as `observe` is called, 37160 // assuming the element is rendered and displayed. 37161 resizeObserverConnected.current = true; 37162 return; 37163 } 37164 37165 if (callbackId.current != null) { 37166 clearTimeout(callbackId.current); 37167 } 37168 37169 callbackId.current = setTimeout(() => { 37170 measureDroppableContainers(Array.isArray(ids.current) ? ids.current : [ids.current]); 37171 callbackId.current = null; 37172 }, resizeObserverTimeout); 37173 }, //eslint-disable-next-line react-hooks/exhaustive-deps 37174 [resizeObserverTimeout]); 37175 const resizeObserver = useResizeObserver$1({ 37176 callback: handleResize, 37177 disabled: resizeObserverDisabled || !active 37178 }); 37179 const handleNodeChange = reactExports.useCallback((newElement, previousElement) => { 37180 if (!resizeObserver) { 37181 return; 37182 } 37183 37184 if (previousElement) { 37185 resizeObserver.unobserve(previousElement); 37186 resizeObserverConnected.current = false; 37187 } 37188 37189 if (newElement) { 37190 resizeObserver.observe(newElement); 37191 } 37192 }, [resizeObserver]); 37193 const [nodeRef, setNodeRef] = useNodeRef(handleNodeChange); 37194 const dataRef = useLatestValue(data); 37195 reactExports.useEffect(() => { 37196 if (!resizeObserver || !nodeRef.current) { 37197 return; 37198 } 37199 37200 resizeObserver.disconnect(); 37201 resizeObserverConnected.current = false; 37202 resizeObserver.observe(nodeRef.current); 37203 }, [nodeRef, resizeObserver]); 37204 reactExports.useEffect(() => { 37205 dispatch({ 37206 type: Action.RegisterDroppable, 37207 element: { 37208 id, 37209 key, 37210 disabled, 37211 node: nodeRef, 37212 rect, 37213 data: dataRef 37214 } 37215 }); 37216 return () => dispatch({ 37217 type: Action.UnregisterDroppable, 37218 key, 37219 id 37220 }); 37221 }, // eslint-disable-next-line react-hooks/exhaustive-deps 37222 [id]); 37223 reactExports.useEffect(() => { 37224 if (disabled !== previous.current.disabled) { 37225 dispatch({ 37226 type: Action.SetDroppableDisabled, 37227 id, 37228 key, 37229 disabled 37230 }); 37231 previous.current.disabled = disabled; 37232 } 37233 }, [id, key, disabled, dispatch]); 37234 return { 37235 active, 37236 rect, 37237 isOver: (over == null ? void 0 : over.id) === id, 37238 node: nodeRef, 37239 over, 37240 setNodeRef 37241 }; 37242} 37243 37244function AnimationManager(_ref) { 37245 let { 37246 animation, 37247 children 37248 } = _ref; 37249 const [clonedChildren, setClonedChildren] = reactExports.useState(null); 37250 const [element, setElement] = reactExports.useState(null); 37251 const previousChildren = usePrevious(children); 37252 37253 if (!children && !clonedChildren && previousChildren) { 37254 setClonedChildren(previousChildren); 37255 } 37256 37257 useIsomorphicLayoutEffect$1(() => { 37258 if (!element) { 37259 return; 37260 } 37261 37262 const key = clonedChildren == null ? void 0 : clonedChildren.key; 37263 const id = clonedChildren == null ? void 0 : clonedChildren.props.id; 37264 37265 if (key == null || id == null) { 37266 setClonedChildren(null); 37267 return; 37268 } 37269 37270 Promise.resolve(animation(id, element)).then(() => { 37271 setClonedChildren(null); 37272 }); 37273 }, [animation, clonedChildren, element]); 37274 return React.createElement(React.Fragment, null, children, clonedChildren ? reactExports.cloneElement(clonedChildren, { 37275 ref: setElement 37276 }) : null); 37277} 37278 37279const defaultTransform = { 37280 x: 0, 37281 y: 0, 37282 scaleX: 1, 37283 scaleY: 1 37284}; 37285function NullifiedContextProvider(_ref) { 37286 let { 37287 children 37288 } = _ref; 37289 return React.createElement(InternalContext.Provider, { 37290 value: defaultInternalContext 37291 }, React.createElement(ActiveDraggableContext.Provider, { 37292 value: defaultTransform 37293 }, children)); 37294} 37295 37296const baseStyles = { 37297 position: 'fixed', 37298 touchAction: 'none' 37299}; 37300 37301const defaultTransition$1 = activatorEvent => { 37302 const isKeyboardActivator = isKeyboardEvent(activatorEvent); 37303 return isKeyboardActivator ? 'transform 250ms ease' : undefined; 37304}; 37305 37306const PositionedOverlay = /*#__PURE__*/reactExports.forwardRef((_ref, ref) => { 37307 let { 37308 as, 37309 activatorEvent, 37310 adjustScale, 37311 children, 37312 className, 37313 rect, 37314 style, 37315 transform, 37316 transition = defaultTransition$1 37317 } = _ref; 37318 37319 if (!rect) { 37320 return null; 37321 } 37322 37323 const scaleAdjustedTransform = adjustScale ? transform : { ...transform, 37324 scaleX: 1, 37325 scaleY: 1 37326 }; 37327 const styles = { ...baseStyles, 37328 width: rect.width, 37329 height: rect.height, 37330 top: rect.top, 37331 left: rect.left, 37332 transform: CSS$1.Transform.toString(scaleAdjustedTransform), 37333 transformOrigin: adjustScale && activatorEvent ? getRelativeTransformOrigin(activatorEvent, rect) : undefined, 37334 transition: typeof transition === 'function' ? transition(activatorEvent) : transition, 37335 ...style 37336 }; 37337 return React.createElement(as, { 37338 className, 37339 style: styles, 37340 ref 37341 }, children); 37342}); 37343 37344const defaultDropAnimationSideEffects = options => _ref => { 37345 let { 37346 active, 37347 dragOverlay 37348 } = _ref; 37349 const originalStyles = {}; 37350 const { 37351 styles, 37352 className 37353 } = options; 37354 37355 if (styles != null && styles.active) { 37356 for (const [key, value] of Object.entries(styles.active)) { 37357 if (value === undefined) { 37358 continue; 37359 } 37360 37361 originalStyles[key] = active.node.style.getPropertyValue(key); 37362 active.node.style.setProperty(key, value); 37363 } 37364 } 37365 37366 if (styles != null && styles.dragOverlay) { 37367 for (const [key, value] of Object.entries(styles.dragOverlay)) { 37368 if (value === undefined) { 37369 continue; 37370 } 37371 37372 dragOverlay.node.style.setProperty(key, value); 37373 } 37374 } 37375 37376 if (className != null && className.active) { 37377 active.node.classList.add(className.active); 37378 } 37379 37380 if (className != null && className.dragOverlay) { 37381 dragOverlay.node.classList.add(className.dragOverlay); 37382 } 37383 37384 return function cleanup() { 37385 for (const [key, value] of Object.entries(originalStyles)) { 37386 active.node.style.setProperty(key, value); 37387 } 37388 37389 if (className != null && className.active) { 37390 active.node.classList.remove(className.active); 37391 } 37392 }; 37393}; 37394 37395const defaultKeyframeResolver = _ref2 => { 37396 let { 37397 transform: { 37398 initial, 37399 final 37400 } 37401 } = _ref2; 37402 return [{ 37403 transform: CSS$1.Transform.toString(initial) 37404 }, { 37405 transform: CSS$1.Transform.toString(final) 37406 }]; 37407}; 37408 37409const defaultDropAnimationConfiguration = { 37410 duration: 250, 37411 easing: 'ease', 37412 keyframes: defaultKeyframeResolver, 37413 sideEffects: /*#__PURE__*/defaultDropAnimationSideEffects({ 37414 styles: { 37415 active: { 37416 opacity: '0' 37417 } 37418 } 37419 }) 37420}; 37421function useDropAnimation(_ref3) { 37422 let { 37423 config, 37424 draggableNodes, 37425 droppableContainers, 37426 measuringConfiguration 37427 } = _ref3; 37428 return useEvent((id, node) => { 37429 if (config === null) { 37430 return; 37431 } 37432 37433 const activeDraggable = draggableNodes.get(id); 37434 37435 if (!activeDraggable) { 37436 return; 37437 } 37438 37439 const activeNode = activeDraggable.node.current; 37440 37441 if (!activeNode) { 37442 return; 37443 } 37444 37445 const measurableNode = getMeasurableNode(node); 37446 37447 if (!measurableNode) { 37448 return; 37449 } 37450 37451 const { 37452 transform 37453 } = getWindow(node).getComputedStyle(node); 37454 const parsedTransform = parseTransform(transform); 37455 37456 if (!parsedTransform) { 37457 return; 37458 } 37459 37460 const animation = typeof config === 'function' ? config : createDefaultDropAnimation(config); 37461 scrollIntoViewIfNeeded(activeNode, measuringConfiguration.draggable.measure); 37462 return animation({ 37463 active: { 37464 id, 37465 data: activeDraggable.data, 37466 node: activeNode, 37467 rect: measuringConfiguration.draggable.measure(activeNode) 37468 }, 37469 draggableNodes, 37470 dragOverlay: { 37471 node, 37472 rect: measuringConfiguration.dragOverlay.measure(measurableNode) 37473 }, 37474 droppableContainers, 37475 measuringConfiguration, 37476 transform: parsedTransform 37477 }); 37478 }); 37479} 37480 37481function createDefaultDropAnimation(options) { 37482 const { 37483 duration, 37484 easing, 37485 sideEffects, 37486 keyframes 37487 } = { ...defaultDropAnimationConfiguration, 37488 ...options 37489 }; 37490 return _ref4 => { 37491 let { 37492 active, 37493 dragOverlay, 37494 transform, 37495 ...rest 37496 } = _ref4; 37497 37498 if (!duration) {
37499 // Do not animate if animation duration is zero. 37500 return; 37501 } 37502 37503 const delta = { 37504 x: dragOverlay.rect.left - active.rect.left, 37505 y: dragOverlay.rect.top - active.rect.top 37506 }; 37507 const scale = { 37508 scaleX: transform.scaleX !== 1 ? active.rect.width * transform.scaleX / dragOverlay.rect.width : 1, 37509 scaleY: transform.scaleY !== 1 ? active.rect.height * transform.scaleY / dragOverlay.rect.height : 1 37510 }; 37511 const finalTransform = { 37512 x: transform.x - delta.x, 37513 y: transform.y - delta.y, 37514 ...scale 37515 }; 37516 const animationKeyframes = keyframes({ ...rest, 37517 active, 37518 dragOverlay, 37519 transform: { 37520 initial: transform, 37521 final: finalTransform 37522 } 37523 }); 37524 const [firstKeyframe] = animationKeyframes; 37525 const lastKeyframe = animationKeyframes[animationKeyframes.length - 1]; 37526 37527 if (JSON.stringify(firstKeyframe) === JSON.stringify(lastKeyframe)) { 37528 // The start and end keyframes are the same, infer that there is no animation needed. 37529 return; 37530 } 37531 37532 const cleanup = sideEffects == null ? void 0 : sideEffects({ 37533 active, 37534 dragOverlay, 37535 ...rest 37536 }); 37537 const animation = dragOverlay.node.animate(animationKeyframes, { 37538 duration, 37539 easing, 37540 fill: 'forwards' 37541 }); 37542 return new Promise(resolve => { 37543 animation.onfinish = () => { 37544 cleanup == null ? void 0 : cleanup(); 37545 resolve(); 37546 }; 37547 }); 37548 }; 37549} 37550 37551let key = 0; 37552function useKey(id) { 37553 return reactExports.useMemo(() => { 37554 if (id == null) { 37555 return; 37556 } 37557 37558 key++; 37559 return key; 37560 }, [id]); 37561} 37562 37563const DragOverlay = /*#__PURE__*/React.memo(_ref => { 37564 let { 37565 adjustScale = false, 37566 children, 37567 dropAnimation: dropAnimationConfig, 37568 style, 37569 transition, 37570 modifiers, 37571 wrapperElement = 'div', 37572 className, 37573 zIndex = 999 37574 } = _ref; 37575 const { 37576 activatorEvent, 37577 active, 37578 activeNodeRect, 37579 containerNodeRect, 37580 draggableNodes, 37581 droppableContainers, 37582 dragOverlay, 37583 over, 37584 measuringConfiguration, 37585 scrollableAncestors, 37586 scrollableAncestorRects, 37587 windowRect 37588 } = useDndContext(); 37589 const transform = reactExports.useContext(ActiveDraggableContext); 37590 const key = useKey(active == null ? void 0 : active.id); 37591 const modifiedTransform = applyModifiers(modifiers, { 37592 activatorEvent, 37593 active, 37594 activeNodeRect, 37595 containerNodeRect, 37596 draggingNodeRect: dragOverlay.rect, 37597 over, 37598 overlayNodeRect: dragOverlay.rect, 37599 scrollableAncestors, 37600 scrollableAncestorRects, 37601 transform, 37602 windowRect 37603 }); 37604 const initialRect = useInitialValue(activeNodeRect); 37605 const dropAnimation = useDropAnimation({ 37606 config: dropAnimationConfig, 37607 draggableNodes, 37608 droppableContainers, 37609 measuringConfiguration 37610 }); // We need to wait for the active node to be measured before connecting the drag overlay ref 37611 // otherwise collisions can be computed against a mispositioned drag overlay 37612 37613 const ref = initialRect ? dragOverlay.setRef : undefined; 37614 return React.createElement(NullifiedContextProvider, null, React.createElement(AnimationManager, { 37615 animation: dropAnimation 37616 }, active && key ? React.createElement(PositionedOverlay, { 37617 key: key, 37618 id: active.id, 37619 ref: ref, 37620 as: wrapperElement, 37621 activatorEvent: activatorEvent, 37622 adjustScale: adjustScale, 37623 className: className, 37624 transition: transition, 37625 rect: initialRect, 37626 style: { 37627 zIndex, 37628 ...style 37629 }, 37630 transform: modifiedTransform 37631 }, children) : null)); 37632}); 37633 37634/** 37635 * Move an array item to a different position. Returns a new array with the item moved to the new position. 37636 */ 37637function arrayMove(array, from, to) { 37638 const newArray = array.slice(); 37639 newArray.splice(to < 0 ? newArray.length + to : to, 0, newArray.splice(from, 1)[0]); 37640 return newArray; 37641} 37642 37643function getSortedRects(items, rects) { 37644 return items.reduce((accumulator, id, index) => { 37645 const rect = rects.get(id); 37646 37647 if (rect) { 37648 accumulator[index] = rect; 37649 } 37650 37651 return accumulator; 37652 }, Array(items.length)); 37653} 37654 37655function isValidIndex(index) { 37656 return index !== null && index >= 0; 37657} 37658 37659function itemsEqual(a, b) { 37660 if (a === b) { 37661 return true; 37662 } 37663 37664 if (a.length !== b.length) { 37665 return false;
37666 } 37667 37668 for (let i = 0; i < a.length; i++) { 37669 if (a[i] !== b[i]) { 37670 return false; 37671 } 37672 } 37673 37674 return true; 37675} 37676 37677function normalizeDisabled(disabled) { 37678 if (typeof disabled === 'boolean') { 37679 return { 37680 draggable: disabled, 37681 droppable: disabled 37682 }; 37683 } 37684 37685 return disabled; 37686} 37687 37688const rectSortingStrategy = _ref => { 37689 let { 37690 rects, 37691 activeIndex, 37692 overIndex, 37693 index 37694 } = _ref; 37695 const newRects = arrayMove(rects, overIndex, activeIndex); 37696 const oldRect = rects[index]; 37697 const newRect = newRects[index]; 37698 37699 if (!newRect || !oldRect) { 37700 return null; 37701 } 37702 37703 return { 37704 x: newRect.left - oldRect.left, 37705 y: newRect.top - oldRect.top, 37706 scaleX: newRect.width / oldRect.width, 37707 scaleY: newRect.height / oldRect.height 37708 }; 37709}; 37710 37711// To-do: We should be calculating scale transformation 37712const defaultScale$1 = { 37713 scaleX: 1, 37714 scaleY: 1 37715}; 37716const verticalListSortingStrategy = _ref => { 37717 var _rects$activeIndex; 37718 37719 let { 37720 activeIndex, 37721 activeNodeRect: fallbackActiveRect, 37722 index, 37723 rects, 37724 overIndex 37725 } = _ref; 37726 const activeNodeRect = (_rects$activeIndex = rects[activeIndex]) != null ? _rects$activeIndex : fallbackActiveRect; 37727 37728 if (!activeNodeRect) { 37729 return null; 37730 } 37731 37732 if (index === activeIndex) { 37733 const overIndexRect = rects[overIndex]; 37734 37735 if (!overIndexRect) { 37736 return null; 37737 } 37738 37739 return { 37740 x: 0, 37741 y: activeIndex < overIndex ? overIndexRect.top + overIndexRect.height - (activeNodeRect.top + activeNodeRect.height) : overIndexRect.top - activeNodeRect.top, 37742 ...defaultScale$1 37743 }; 37744 } 37745 37746 const itemGap = getItemGap$1(rects, index, activeIndex); 37747 37748 if (index > activeIndex && index <= overIndex) { 37749 return { 37750 x: 0, 37751 y: -activeNodeRect.height - itemGap, 37752 ...defaultScale$1 37753 }; 37754 } 37755 37756 if (index < activeIndex && index >= overIndex) { 37757 return { 37758 x: 0, 37759 y: activeNodeRect.height + itemGap, 37760 ...defaultScale$1 37761 }; 37762 } 37763 37764 return { 37765 x: 0, 37766 y: 0, 37767 ...defaultScale$1 37768 }; 37769}; 37770 37771function getItemGap$1(clientRects, index, activeIndex) { 37772 const currentRect = clientRects[index]; 37773 const previousRect = clientRects[index - 1]; 37774 const nextRect = clientRects[index + 1]; 37775 37776 if (!currentRect) { 37777 return 0; 37778 } 37779 37780 if (activeIndex < index) { 37781 return previousRect ? currentRect.top - (previousRect.top + previousRect.height) : nextRect ? nextRect.top - (currentRect.top + currentRect.height) : 0; 37782 } 37783 37784 return nextRect ? nextRect.top - (currentRect.top + currentRect.height) : previousRect ? currentRect.top - (previousRect.top + previousRect.height) : 0; 37785} 37786 37787const ID_PREFIX = 'Sortable'; 37788const Context = /*#__PURE__*/React.createContext({ 37789 activeIndex: -1, 37790 containerId: ID_PREFIX, 37791 disableTransforms: false, 37792 items: [], 37793 overIndex: -1, 37794 useDragOverlay: false, 37795 sortedRects: [], 37796 strategy: rectSortingStrategy, 37797 disabled: { 37798 draggable: false, 37799 droppable: false 37800 } 37801}); 37802function SortableContext(_ref) { 37803 let { 37804 children, 37805 id, 37806 items: userDefinedItems, 37807 strategy = rectSortingStrategy, 37808 disabled: disabledProp = false 37809 } = _ref; 37810 const { 37811 active, 37812 dragOverlay, 37813 droppableRects, 37814 over, 37815 measureDroppableContainers 37816 } = useDndContext(); 37817 const containerId = useUniqueId(ID_PREFIX, id); 37818 const useDragOverlay = Boolean(dragOverlay.rect !== null); 37819 const items = reactExports.useMemo(() => userDefinedItems.map(item => typeof item === 'object' && 'id' in item ? item.id : item), [userDefinedItems]); 37820 const isDragging = active != null; 37821 const activeIndex = active ? items.indexOf(active.id) : -1; 37822 const overIndex = over ? items.indexOf(over.id) : -1; 37823 const previousItemsRef = reactExports.useRef(items); 37824 const itemsHaveChanged = !itemsEqual(items, previousItemsRef.current); 37825 const disableTransforms = overIndex !== -1 && activeIndex === -1 || itemsHaveChanged; 37826 const disabled = normalizeDisabled(disabledProp); 37827 useIsomorphicLayoutEffect$1(() => { 37828 if (itemsHaveChanged && isDragging) { 37829 measureDroppableContainers(items); 37830 } 37831 }, [itemsHaveChanged, items, isDragging, measureDroppableContainers]); 37832 reactExports.useEffect(() => { 37833 previousItemsRef.current = items; 37834 }, [items]); 37835 const contextValue = reactExports.useMemo(() => ({ 37836 activeIndex, 37837 containerId, 37838 disabled, 37839 disableTransforms, 37840 items, 37841 overIndex, 37842 useDragOverlay, 37843 sortedRects: getSortedRects(items, droppableRects), 37844 strategy 37845 }), // eslint-disable-next-line react-hooks/exhaustive-deps 37846 [activeIndex, containerId, disabled.draggable, disabled.droppable, disableTransforms, items, overIndex, droppableRects, useDragOverlay, strategy]); 37847 return React.createElement(Context.Provider, { 37848 value: contextValue 37849 }, children); 37850} 37851 37852const defaultNewIndexGetter = _ref => { 37853 let { 37854 id, 37855 items, 37856 activeIndex, 37857 overIndex 37858 } = _ref; 37859 return arrayMove(items, activeIndex, overIndex).indexOf(id); 37860}; 37861const defaultAnimateLayoutChanges = _ref2 => { 37862 let { 37863 containerId, 37864 isSorting, 37865 wasDragging, 37866 index, 37867 items, 37868 newIndex, 37869 previousItems, 37870 previousContainerId, 37871 transition 37872 } = _ref2; 37873 37874 if (!transition || !wasDragging) { 37875 return false;
37876 } 37877 37878 if (previousItems !== items && index === newIndex) { 37879 return false; 37880 } 37881 37882 if (isSorting) { 37883 return true; 37884 } 37885 37886 return newIndex !== index && containerId === previousContainerId; 37887}; 37888const defaultTransition = { 37889 duration: 200, 37890 easing: 'ease' 37891}; 37892const transitionProperty = 'transform'; 37893const disabledTransition = /*#__PURE__*/CSS$1.Transition.toString({ 37894 property: transitionProperty, 37895 duration: 0, 37896 easing: 'linear' 37897}); 37898const defaultAttributes = { 37899 roleDescription: 'sortable' 37900}; 37901 37902/* 37903 * When the index of an item changes while sorting, 37904 * we need to temporarily disable the transforms 37905 */ 37906 37907function useDerivedTransform(_ref) { 37908 let { 37909 disabled, 37910 index, 37911 node, 37912 rect 37913 } = _ref; 37914 const [derivedTransform, setDerivedtransform] = reactExports.useState(null); 37915 const previousIndex = reactExports.useRef(index); 37916 useIsomorphicLayoutEffect$1(() => { 37917 if (!disabled && index !== previousIndex.current && node.current) { 37918 const initial = rect.current; 37919 37920 if (initial) { 37921 const current = getClientRect(node.current, { 37922 ignoreTransform: true 37923 }); 37924 const delta = { 37925 x: initial.left - current.left, 37926 y: initial.top - current.top, 37927 scaleX: initial.width / current.width, 37928 scaleY: initial.height / current.height 37929 }; 37930 37931 if (delta.x || delta.y) { 37932 setDerivedtransform(delta); 37933 } 37934 } 37935 } 37936 37937 if (index !== previousIndex.current) { 37938 previousIndex.current = index; 37939 } 37940 }, [disabled, index, node, rect]); 37941 reactExports.useEffect(() => { 37942 if (derivedTransform) { 37943 setDerivedtransform(null); 37944 } 37945 }, [derivedTransform]); 37946 return derivedTransform; 37947} 37948 37949function useSortable(_ref) { 37950 let { 37951 animateLayoutChanges = defaultAnimateLayoutChanges, 37952 attributes: userDefinedAttributes, 37953 disabled: localDisabled, 37954 data: customData, 37955 getNewIndex = defaultNewIndexGetter, 37956 id, 37957 strategy: localStrategy, 37958 resizeObserverConfig, 37959 transition = defaultTransition 37960 } = _ref; 37961 const { 37962 items, 37963 containerId, 37964 activeIndex, 37965 disabled: globalDisabled, 37966 disableTransforms, 37967 sortedRects, 37968 overIndex, 37969 useDragOverlay, 37970 strategy: globalStrategy 37971 } = reactExports.useContext(Context); 37972 const disabled = normalizeLocalDisabled(localDisabled, globalDisabled); 37973 const index = items.indexOf(id); 37974 const data = reactExports.useMemo(() => ({ 37975 sortable: { 37976 containerId, 37977 index, 37978 items 37979 }, 37980 ...customData 37981 }), [containerId, customData, index, items]); 37982 const itemsAfterCurrentSortable = reactExports.useMemo(() => items.slice(items.indexOf(id)), [items, id]); 37983 const { 37984 rect, 37985 node, 37986 isOver, 37987 setNodeRef: setDroppableNodeRef 37988 } = useDroppable({ 37989 id, 37990 data, 37991 disabled: disabled.droppable, 37992 resizeObserverConfig: { 37993 updateMeasurementsFor: itemsAfterCurrentSortable, 37994 ...resizeObserverConfig 37995 } 37996 }); 37997 const { 37998 active, 37999 activatorEvent, 38000 activeNodeRect, 38001 attributes, 38002 setNodeRef: setDraggableNodeRef, 38003 listeners, 38004 isDragging, 38005 over, 38006 setActivatorNodeRef, 38007 transform 38008 } = useDraggable({ 38009 id, 38010 data, 38011 attributes: { ...defaultAttributes, 38012 ...userDefinedAttributes 38013 }, 38014 disabled: disabled.draggable 38015 }); 38016 const setNodeRef = useCombinedRefs(setDroppableNodeRef, setDraggableNodeRef); 38017 const isSorting = Boolean(active); 38018 const displaceItem = isSorting && !disableTransforms && isValidIndex(activeIndex) && isValidIndex(overIndex); 38019 const shouldDisplaceDragSource = !useDragOverlay && isDragging; 38020 const dragSourceDisplacement = shouldDisplaceDragSource && displaceItem ? transform : null; 38021 const strategy = localStrategy != null ? localStrategy : globalStrategy; 38022 const finalTransform = displaceItem ? dragSourceDisplacement != null ? dragSourceDisplacement : strategy({ 38023 rects: sortedRects, 38024 activeNodeRect, 38025 activeIndex, 38026 overIndex, 38027 index 38028 }) : null; 38029 const newIndex = isValidIndex(activeIndex) && isValidIndex(overIndex) ? getNewIndex({ 38030 id, 38031 items, 38032 activeIndex, 38033 overIndex 38034 }) : index; 38035 const activeId = active == null ? void 0 : active.id; 38036 const previous = reactExports.useRef({ 38037 activeId, 38038 items, 38039 newIndex, 38040 containerId 38041 }); 38042 const itemsHaveChanged = items !== previous.current.items; 38043 const shouldAnimateLayoutChanges = animateLayoutChanges({ 38044 active, 38045 containerId, 38046 isDragging, 38047 isSorting, 38048 id, 38049 index, 38050 items, 38051 newIndex: previous.current.newIndex, 38052 previousItems: previous.current.items, 38053 previousContainerId: previous.current.containerId, 38054 transition, 38055 wasDragging: previous.current.activeId != null 38056 }); 38057 const derivedTransform = useDerivedTransform({ 38058 disabled: !shouldAnimateLayoutChanges, 38059 index, 38060 node, 38061 rect 38062 }); 38063 reactExports.useEffect(() => { 38064 if (isSorting && previous.current.newIndex !== newIndex) { 38065 previous.current.newIndex = newIndex; 38066 } 38067 38068 if (containerId !== previous.current.containerId) { 38069 previous.current.containerId = containerId; 38070 } 38071 38072 if (items !== previous.current.items) { 38073 previous.current.items = items; 38074 } 38075 }, [isSorting, newIndex, containerId, items]); 38076 reactExports.useEffect(() => { 38077 if (activeId === previous.current.activeId) { 38078 return; 38079 } 38080 38081 if (activeId != null && previous.current.activeId == null) { 38082 previous.current.activeId = activeId; 38083 return; 38084 } 38085 38086 const timeoutId = setTimeout(() => { 38087 previous.current.activeId = activeId; 38088 }, 50); 38089 return () => clearTimeout(timeoutId); 38090 }, [activeId]); 38091 return { 38092 active, 38093 activeIndex, 38094 attributes, 38095 data, 38096 rect, 38097 index, 38098 newIndex, 38099 items, 38100 isOver, 38101 isSorting, 38102 isDragging, 38103 listeners, 38104 node, 38105 overIndex, 38106 over, 38107 setNodeRef, 38108 setActivatorNodeRef, 38109 setDroppableNodeRef, 38110 setDraggableNodeRef, 38111 transform: derivedTransform != null ? derivedTransform : finalTransform, 38112 transition: getTransition() 38113 }; 38114 38115 function getTransition() { 38116 if ( // Temporarily disable transitions for a single frame to set up derived transforms 38117 derivedTransform || // Or to prevent items jumping to back to their "new" position when items change 38118 itemsHaveChanged && previous.current.newIndex === index) { 38119 return disabledTransition; 38120 } 38121 38122 if (shouldDisplaceDragSource && !isKeyboardEvent(activatorEvent) || !transition) { 38123 return undefined; 38124 } 38125 38126 if (isSorting || shouldAnimateLayoutChanges) { 38127 return CSS$1.Transition.toString({ ...transition, 38128 property: transitionProperty 38129 }); 38130 } 38131 38132 return undefined; 38133 } 38134} 38135 38136function normalizeLocalDisabled(localDisabled, globalDisabled) { 38137 var _localDisabled$dragga, _localDisabled$droppa; 38138 38139 if (typeof localDisabled === 'boolean') { 38140 return { 38141 draggable: localDisabled, 38142 // Backwards compatibility 38143 droppable: false 38144 }; 38145 } 38146 38147 return { 38148 draggable: (_localDisabled$dragga = localDisabled == null ? void 0 : localDisabled.draggable) != null ? _localDisabled$dragga : globalDisabled.draggable, 38149 droppable: (_localDisabled$droppa = localDisabled == null ? void 0 : localDisabled.droppable) != null ? _localDisabled$droppa : globalDisabled.droppable 38150 }; 38151} 38152 38153function hasSortableData(entry) { 38154 if (!entry) { 38155 return false;
38156 } 38157 38158 const data = entry.data.current; 38159 38160 if (data && 'sortable' in data && typeof data.sortable === 'object' && 'containerId' in data.sortable && 'items' in data.sortable && 'index' in data.sortable) { 38161 return true; 38162 } 38163 38164 return false; 38165} 38166 38167const directions = [KeyboardCode.Down, KeyboardCode.Right, KeyboardCode.Up, KeyboardCode.Left]; 38168const sortableKeyboardCoordinates = (event, _ref) => { 38169 let { 38170 context: { 38171 active, 38172 collisionRect, 38173 droppableRects, 38174 droppableContainers, 38175 over, 38176 scrollableAncestors 38177 } 38178 } = _ref; 38179 38180 if (directions.includes(event.code)) { 38181 event.preventDefault(); 38182 38183 if (!active || !collisionRect) { 38184 return; 38185 } 38186 38187 const filteredContainers = []; 38188 droppableContainers.getEnabled().forEach(entry => { 38189 if (!entry || entry != null && entry.disabled) { 38190 return; 38191 } 38192 38193 const rect = droppableRects.get(entry.id); 38194 38195 if (!rect) { 38196 return; 38197 } 38198 38199 switch (event.code) { 38200 case KeyboardCode.Down: 38201 if (collisionRect.top < rect.top) { 38202 filteredContainers.push(entry); 38203 } 38204 38205 break; 38206 38207 case KeyboardCode.Up: 38208 if (collisionRect.top > rect.top) { 38209 filteredContainers.push(entry); 38210 } 38211 38212 break; 38213 38214 case KeyboardCode.Left: 38215 if (collisionRect.left > rect.left) { 38216 filteredContainers.push(entry); 38217 } 38218 38219 break; 38220 38221 case KeyboardCode.Right: 38222 if (collisionRect.left < rect.left) { 38223 filteredContainers.push(entry); 38224 } 38225 38226 break; 38227 } 38228 }); 38229 const collisions = closestCorners({ 38230 collisionRect: collisionRect, 38231 droppableRects, 38232 droppableContainers: filteredContainers}); 38233 let closestId = getFirstCollision(collisions, 'id'); 38234 38235 if (closestId === (over == null ? void 0 : over.id) && collisions.length > 1) { 38236 closestId = collisions[1].id; 38237 } 38238 38239 if (closestId != null) { 38240 const activeDroppable = droppableContainers.get(active.id); 38241 const newDroppable = droppableContainers.get(closestId); 38242 const newRect = newDroppable ? droppableRects.get(newDroppable.id) : null; 38243 const newNode = newDroppable == null ? void 0 : newDroppable.node.current; 38244 38245 if (newNode && newRect && activeDroppable && newDroppable) { 38246 const newScrollAncestors = getScrollableAncestors(newNode); 38247 const hasDifferentScrollAncestors = newScrollAncestors.some((element, index) => scrollableAncestors[index] !== element); 38248 const hasSameContainer = isSameContainer(activeDroppable, newDroppable); 38249 const isAfterActive = isAfter(activeDroppable, newDroppable); 38250 const offset = hasDifferentScrollAncestors || !hasSameContainer ? { 38251 x: 0, 38252 y: 0 38253 } : { 38254 x: isAfterActive ? collisionRect.width - newRect.width : 0, 38255 y: isAfterActive ? collisionRect.height - newRect.height : 0 38256 }; 38257 const rectCoordinates = { 38258 x: newRect.left, 38259 y: newRect.top 38260 }; 38261 const newCoordinates = offset.x && offset.y ? rectCoordinates : subtract(rectCoordinates, offset); 38262 return newCoordinates; 38263 } 38264 } 38265 } 38266 38267 return undefined; 38268}; 38269 38270function isSameContainer(a, b) { 38271 if (!hasSortableData(a) || !hasSortableData(b)) { 38272 return false; 38273 } 38274 38275 return a.data.current.sortable.containerId === b.data.current.sortable.containerId; 38276} 38277 38278function isAfter(a, b) { 38279 if (!hasSortableData(a) || !hasSortableData(b)) { 38280 return false; 38281 } 38282 38283 if (!isSameContainer(a, b)) { 38284 return false; 38285 } 38286 38287 return a.data.current.sortable.index < b.data.current.sortable.index; 38288} 38289 38290const falsyToString = (value)=>typeof value === "boolean" ? `${value}` : value === 0 ? "0" : value; 38291const cx = clsx; 38292const cva = (base, config)=>(props)=>{ 38293 var _config_compoundVariants; 38294 if ((config === null || config === void 0 ? void 0 : config.variants) == null) return cx(base, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className); 38295 const { variants, defaultVariants } = config; 38296 const getVariantClassNames = Object.keys(variants).map((variant)=>{ 38297 const variantProp = props === null || props === void 0 ? void 0 : props[variant]; 38298 const defaultVariantProp = defaultVariants === null || defaultVariants === void 0 ? void 0 : defaultVariants[variant]; 38299 if (variantProp === null) return null; 38300 const variantKey = falsyToString(variantProp) || falsyToString(defaultVariantProp); 38301 return variants[variant][variantKey]; 38302 }); 38303 const propsWithoutUndefined = props && Object.entries(props).reduce((acc, param)=>
vendor: 4,146 bytes, lines 38303-38394
38303{ 38304 let [key, value] = param; 38305 if (value === undefined) { 38306 return acc; 38307 } 38308 acc[key] = value; 38309 return acc; 38310 }, {}); 38311 const getCompoundVariantClassNames = config === null || config === void 0 ? void 0 : (_config_compoundVariants = config.compoundVariants) === null || _config_compoundVariants === void 0 ? void 0 : _config_compoundVariants.reduce((acc, param)=>{ 38312 let { class: cvClass, className: cvClassName, ...compoundVariantOptions } = param; 38313 return Object.entries(compoundVariantOptions).every((param)=>{ 38314 let [key, value] = param; 38315 return Array.isArray(value) ? value.includes({ 38316 ...defaultVariants, 38317 ...propsWithoutUndefined 38318 }[key]) : ({ 38319 ...defaultVariants, 38320 ...propsWithoutUndefined 38321 })[key] === value; 38322 }) ? [ 38323 ...acc, 38324 cvClass, 38325 cvClassName 38326 ] : acc; 38327 }, []); 38328 return cx(base, getVariantClassNames, getCompoundVariantClassNames, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className); 38329 }; 38330 38331const buttonVariants = cva( 38332 "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive", 38333 { 38334 variants: { 38335 variant: { 38336 default: "bg-primary text-primary-foreground hover:bg-primary/90", 38337 destructive: "bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60", 38338 outline: "border bg-transparent shadow-xs hover:bg-accent dark:bg-transparent dark:border-input dark:hover:bg-input/50", 38339 secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80", 38340 ghost: "hover:bg-accent dark:hover:bg-accent/50", 38341 link: "text-primary underline-offset-4 hover:underline" 38342 }, 38343 size: { 38344 default: "h-9 px-4 py-2 has-[>svg]:px-3", 38345 sm: "h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5", 38346 lg: "h-10 rounded-md px-6 has-[>svg]:px-4", 38347 icon: "size-9", 38348 "icon-sm": "size-8", 38349 "icon-lg": "size-10" 38350 } 38351 }, 38352 defaultVariants: { 38353 variant: "default", 38354 size: "default" 38355 } 38356 } 38357); 38358function Button({ 38359 className, 38360 variant, 38361 size, 38362 asChild = false, 38363 ...props 38364}) { 38365 const Comp = asChild ? Slot$1 : "button"; 38366 return /* @__PURE__ */ jsxRuntimeExports.jsx( 38367 Comp, 38368 { 38369 "data-slot": "button", 38370 className: cn(buttonVariants({ variant, size, className })), 38371 ...props 38372 } 38373 ); 38374} 38375 38376const badgeVariants = cva( 38377 "inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden", 38378 { 38379 variants: { 38380 variant: { 38381 default: "border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90", 38382 secondary: "border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90", 38383 destructive: "border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60", 38384 outline: "text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground" 38385 } 38386 }, 38387 defaultVariants: { 38388 variant: "default" 38389 } 38390 } 38391); 38392function Badge({ 38393 className, 38394 variant,
38395 asChild = false, 38396 ...props 38397}) { 38398 const Comp = asChild ? Slot$1 : "span"; 38399 return /* @__PURE__ */ jsxRuntimeExports.jsx( 38400 Comp, 38401 { 38402 "data-slot": "badge", 38403 className: cn(badgeVariants({ variant }), className), 38404 ...props 38405 } 38406 ); 38407} 38408
vendor: 6,820 bytes, lines 38409-38626
38409// src/use-is-hydrated.tsx 38410function useIsHydrated() { 38411 return shimExports.useSyncExternalStore( 38412 subscribe, 38413 () => true, 38414 () => false 38415 ); 38416} 38417function subscribe() { 38418 return () => { 38419 }; 38420} 38421 38422var AVATAR_NAME = "Avatar"; 38423var [createAvatarContext] = createContextScope(AVATAR_NAME); 38424var [AvatarProvider, useAvatarContext] = createAvatarContext(AVATAR_NAME); 38425var Avatar$1 = reactExports.forwardRef( 38426 (props, forwardedRef) => { 38427 const { __scopeAvatar, ...avatarProps } = props; 38428 const [imageLoadingStatus, setImageLoadingStatus] = reactExports.useState("idle"); 38429 return /* @__PURE__ */ jsxRuntimeExports.jsx( 38430 AvatarProvider, 38431 { 38432 scope: __scopeAvatar, 38433 imageLoadingStatus, 38434 onImageLoadingStatusChange: setImageLoadingStatus, 38435 children: /* @__PURE__ */ jsxRuntimeExports.jsx(Primitive.span, { ...avatarProps, ref: forwardedRef }) 38436 } 38437 ); 38438 } 38439); 38440Avatar$1.displayName = AVATAR_NAME; 38441var IMAGE_NAME = "AvatarImage"; 38442var AvatarImage$1 = reactExports.forwardRef( 38443 (props, forwardedRef) => { 38444 const { __scopeAvatar, src, onLoadingStatusChange = () => { 38445 }, ...imageProps } = props; 38446 const context = useAvatarContext(IMAGE_NAME, __scopeAvatar); 38447 const imageLoadingStatus = useImageLoadingStatus(src, imageProps); 38448 const handleLoadingStatusChange = useCallbackRef$1((status) => { 38449 onLoadingStatusChange(status); 38450 context.onImageLoadingStatusChange(status); 38451 }); 38452 useLayoutEffect2(() => { 38453 if (imageLoadingStatus !== "idle") { 38454 handleLoadingStatusChange(imageLoadingStatus); 38455 } 38456 }, [imageLoadingStatus, handleLoadingStatusChange]); 38457 return imageLoadingStatus === "loaded" ? /* @__PURE__ */ jsxRuntimeExports.jsx(Primitive.img, { ...imageProps, ref: forwardedRef, src }) : null; 38458 } 38459); 38460AvatarImage$1.displayName = IMAGE_NAME; 38461var FALLBACK_NAME = "AvatarFallback"; 38462var AvatarFallback$1 = reactExports.forwardRef( 38463 (props, forwardedRef) => { 38464 const { __scopeAvatar, delayMs, ...fallbackProps } = props; 38465 const context = useAvatarContext(FALLBACK_NAME, __scopeAvatar); 38466 const [canRender, setCanRender] = reactExports.useState(delayMs === void 0); 38467 reactExports.useEffect(() => { 38468 if (delayMs !== void 0) { 38469 const timerId = window.setTimeout(() => setCanRender(true), delayMs); 38470 return () => window.clearTimeout(timerId); 38471 } 38472 }, [delayMs]); 38473 return canRender && context.imageLoadingStatus !== "loaded" ? /* @__PURE__ */ jsxRuntimeExports.jsx(Primitive.span, { ...fallbackProps, ref: forwardedRef }) : null; 38474 } 38475); 38476AvatarFallback$1.displayName = FALLBACK_NAME; 38477function resolveLoadingStatus(image, src) { 38478 if (!image) { 38479 return "idle"; 38480 } 38481 if (!src) { 38482 return "error"; 38483 } 38484 if (image.src !== src) { 38485 image.src = src; 38486 } 38487 return image.complete && image.naturalWidth > 0 ? "loaded" : "loading"; 38488} 38489function useImageLoadingStatus(src, { referrerPolicy, crossOrigin }) { 38490 const isHydrated = useIsHydrated(); 38491 const imageRef = reactExports.useRef(null); 38492 const image = (() => { 38493 if (!isHydrated) return null; 38494 if (!imageRef.current) { 38495 imageRef.current = new window.Image(); 38496 } 38497 return imageRef.current; 38498 })(); 38499 const [loadingStatus, setLoadingStatus] = reactExports.useState( 38500 () => resolveLoadingStatus(image, src) 38501 ); 38502 useLayoutEffect2(() => { 38503 setLoadingStatus(resolveLoadingStatus(image, src)); 38504 }, [image, src]); 38505 useLayoutEffect2(() => { 38506 const updateStatus = (status) => () => { 38507 setLoadingStatus(status); 38508 }; 38509 if (!image) return; 38510 const handleLoad = updateStatus("loaded"); 38511 const handleError = updateStatus("error"); 38512 image.addEventListener("load", handleLoad); 38513 image.addEventListener("error", handleError); 38514 if (referrerPolicy) { 38515 image.referrerPolicy = referrerPolicy; 38516 } 38517 if (typeof crossOrigin === "string") { 38518 image.crossOrigin = crossOrigin; 38519 } 38520 return () => { 38521 image.removeEventListener("load", handleLoad); 38522 image.removeEventListener("error", handleError); 38523 }; 38524 }, [image, crossOrigin, referrerPolicy]); 38525 return loadingStatus; 38526} 38527var Root$2 = Avatar$1; 38528var Image = AvatarImage$1; 38529var Fallback = AvatarFallback$1; 38530 38531function Avatar({ 38532 className, 38533 ...props 38534}) { 38535 return /* @__PURE__ */ jsxRuntimeExports.jsx( 38536 Root$2, 38537 { 38538 "data-slot": "avatar", 38539 className: cn( 38540 "relative flex size-8 shrink-0 overflow-hidden rounded-full", 38541 className 38542 ), 38543 ...props 38544 } 38545 ); 38546} 38547function AvatarImage({ 38548 className, 38549 ...props 38550}) { 38551 return /* @__PURE__ */ jsxRuntimeExports.jsx( 38552 Image, 38553 { 38554 "data-slot": "avatar-image", 38555 className: cn("aspect-square size-full", className), 38556 ...props 38557 } 38558 ); 38559} 38560function AvatarFallback({ 38561 className, 38562 ...props 38563}) { 38564 return /* @__PURE__ */ jsxRuntimeExports.jsx( 38565 Fallback, 38566 { 38567 "data-slot": "avatar-fallback", 38568 className: cn( 38569 "bg-muted flex size-full items-center justify-center rounded-full", 38570 className 38571 ), 38572 ...props 38573 } 38574 ); 38575} 38576 38577var count = 0; 38578function useFocusGuards() { 38579 reactExports.useEffect(() => { 38580 const edgeGuards = document.querySelectorAll("[data-radix-focus-guard]"); 38581 document.body.insertAdjacentElement("afterbegin", edgeGuards[0] ?? createFocusGuard()); 38582 document.body.insertAdjacentElement("beforeend", edgeGuards[1] ?? createFocusGuard()); 38583 count++; 38584 return () => { 38585 if (count === 1) { 38586 document.querySelectorAll("[data-radix-focus-guard]").forEach((node) => node.remove()); 38587 } 38588 count--; 38589 }; 38590 }, []); 38591} 38592function createFocusGuard() { 38593 const element = document.createElement("span"); 38594 element.setAttribute("data-radix-focus-guard", ""); 38595 element.tabIndex = 0; 38596 element.style.outline = "none"; 38597 element.style.opacity = "0"; 38598 element.style.position = "fixed"; 38599 element.style.pointerEvents = "none"; 38600 return element; 38601} 38602 38603var AUTOFOCUS_ON_MOUNT = "focusScope.autoFocusOnMount"; 38604var AUTOFOCUS_ON_UNMOUNT = "focusScope.autoFocusOnUnmount"; 38605var EVENT_OPTIONS = { bubbles: false, cancelable: true }; 38606var FOCUS_SCOPE_NAME = "FocusScope"; 38607var FocusScope = reactExports.forwardRef((props, forwardedRef) => { 38608 const { 38609 loop = false, 38610 trapped = false, 38611 onMountAutoFocus: onMountAutoFocusProp, 38612 onUnmountAutoFocus: onUnmountAutoFocusProp, 38613 ...scopeProps 38614 } = props; 38615 const [container, setContainer] = reactExports.useState(null); 38616 const onMountAutoFocus = useCallbackRef$1(onMountAutoFocusProp); 38617 const onUnmountAutoFocus = useCallbackRef$1(onUnmountAutoFocusProp); 38618 const lastFocusedElementRef = reactExports.useRef(null); 38619 const composedRefs = useComposedRefs(forwardedRef, (node) => setContainer(node)); 38620 const focusScope = reactExports.useRef({ 38621 paused: false, 38622 pause() { 38623 this.paused = true; 38624 }, 38625 resume() { 38626 this.paused = false;
vendor: 29,276 bytes, lines 38627-39393
38627 } 38628 }).current; 38629 reactExports.useEffect(() => { 38630 if (trapped) { 38631 let handleFocusIn2 = function(event) { 38632 if (focusScope.paused || !container) return; 38633 const target = event.target; 38634 if (container.contains(target)) { 38635 lastFocusedElementRef.current = target; 38636 } else { 38637 focus(lastFocusedElementRef.current, { select: true }); 38638 } 38639 }, handleFocusOut2 = function(event) { 38640 if (focusScope.paused || !container) return; 38641 const relatedTarget = event.relatedTarget; 38642 if (relatedTarget === null) return; 38643 if (!container.contains(relatedTarget)) { 38644 focus(lastFocusedElementRef.current, { select: true }); 38645 } 38646 }, handleMutations2 = function(mutations) { 38647 const focusedElement = document.activeElement; 38648 if (focusedElement !== document.body) return; 38649 for (const mutation of mutations) { 38650 if (mutation.removedNodes.length > 0) focus(container); 38651 } 38652 }; 38653 document.addEventListener("focusin", handleFocusIn2); 38654 document.addEventListener("focusout", handleFocusOut2); 38655 const mutationObserver = new MutationObserver(handleMutations2); 38656 if (container) mutationObserver.observe(container, { childList: true, subtree: true }); 38657 return () => { 38658 document.removeEventListener("focusin", handleFocusIn2); 38659 document.removeEventListener("focusout", handleFocusOut2); 38660 mutationObserver.disconnect(); 38661 }; 38662 } 38663 }, [trapped, container, focusScope.paused]); 38664 reactExports.useEffect(() => { 38665 if (container) { 38666 focusScopesStack.add(focusScope); 38667 const previouslyFocusedElement = document.activeElement; 38668 const hasFocusedCandidate = container.contains(previouslyFocusedElement); 38669 if (!hasFocusedCandidate) { 38670 const mountEvent = new CustomEvent(AUTOFOCUS_ON_MOUNT, EVENT_OPTIONS); 38671 container.addEventListener(AUTOFOCUS_ON_MOUNT, onMountAutoFocus); 38672 container.dispatchEvent(mountEvent); 38673 if (!mountEvent.defaultPrevented) { 38674 focusFirst(removeLinks(getTabbableCandidates(container)), { select: true }); 38675 if (document.activeElement === previouslyFocusedElement) { 38676 focus(container); 38677 } 38678 } 38679 } 38680 return () => { 38681 container.removeEventListener(AUTOFOCUS_ON_MOUNT, onMountAutoFocus); 38682 setTimeout(() => { 38683 const unmountEvent = new CustomEvent(AUTOFOCUS_ON_UNMOUNT, EVENT_OPTIONS); 38684 container.addEventListener(AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus); 38685 container.dispatchEvent(unmountEvent); 38686 if (!unmountEvent.defaultPrevented) { 38687 focus(previouslyFocusedElement ?? document.body, { select: true }); 38688 } 38689 container.removeEventListener(AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus); 38690 focusScopesStack.remove(focusScope); 38691 }, 0); 38692 }; 38693 } 38694 }, [container, onMountAutoFocus, onUnmountAutoFocus, focusScope]); 38695 const handleKeyDown = reactExports.useCallback( 38696 (event) => { 38697 if (!loop && !trapped) return; 38698 if (focusScope.paused) return; 38699 const isTabKey = event.key === "Tab" && !event.altKey && !event.ctrlKey && !event.metaKey; 38700 const focusedElement = document.activeElement; 38701 if (isTabKey && focusedElement) { 38702 const container2 = event.currentTarget; 38703 const [first, last] = getTabbableEdges(container2); 38704 const hasTabbableElementsInside = first && last; 38705 if (!hasTabbableElementsInside) { 38706 if (focusedElement === container2) event.preventDefault(); 38707 } else { 38708 if (!event.shiftKey && focusedElement === last) { 38709 event.preventDefault(); 38710 if (loop) focus(first, { select: true }); 38711 } else if (event.shiftKey && focusedElement === first) { 38712 event.preventDefault(); 38713 if (loop) focus(last, { select: true }); 38714 } 38715 } 38716 } 38717 }, 38718 [loop, trapped, focusScope.paused] 38719 ); 38720 return /* @__PURE__ */ jsxRuntimeExports.jsx(Primitive.div, { tabIndex: -1, ...scopeProps, ref: composedRefs, onKeyDown: handleKeyDown }); 38721}); 38722FocusScope.displayName = FOCUS_SCOPE_NAME; 38723function focusFirst(candidates, { select = false } = {}) { 38724 const previouslyFocusedElement = document.activeElement; 38725 for (const candidate of candidates) { 38726 focus(candidate, { select }); 38727 if (document.activeElement !== previouslyFocusedElement) return; 38728 } 38729} 38730function getTabbableEdges(container) { 38731 const candidates = getTabbableCandidates(container); 38732 const first = findVisible(candidates, container); 38733 const last = findVisible(candidates.reverse(), container); 38734 return [first, last]; 38735} 38736function getTabbableCandidates(container) { 38737 const nodes = []; 38738 const walker = document.createTreeWalker(container, NodeFilter.SHOW_ELEMENT, { 38739 acceptNode: (node) => { 38740 const isHiddenInput = node.tagName === "INPUT" && node.type === "hidden"; 38741 if (node.disabled || node.hidden || isHiddenInput) return NodeFilter.FILTER_SKIP; 38742 return node.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP; 38743 } 38744 }); 38745 while (walker.nextNode()) nodes.push(walker.currentNode); 38746 return nodes; 38747} 38748function findVisible(elements, container) { 38749 for (const element of elements) { 38750 if (!isHidden(element, { upTo: container })) return element; 38751 } 38752} 38753function isHidden(node, { upTo }) { 38754 if (getComputedStyle(node).visibility === "hidden") return true; 38755 while (node) { 38756 if (upTo !== void 0 && node === upTo) return false; 38757 if (getComputedStyle(node).display === "none") return true; 38758 node = node.parentElement; 38759 } 38760 return false; 38761} 38762function isSelectableInput(element) { 38763 return element instanceof HTMLInputElement && "select" in element; 38764} 38765function focus(element, { select = false } = {}) { 38766 if (element && element.focus) { 38767 const previouslyFocusedElement = document.activeElement; 38768 element.focus({ preventScroll: true }); 38769 if (element !== previouslyFocusedElement && isSelectableInput(element) && select) 38770 element.select(); 38771 } 38772} 38773var focusScopesStack = createFocusScopesStack(); 38774function createFocusScopesStack() { 38775 let stack = []; 38776 return { 38777 add(focusScope) { 38778 const activeFocusScope = stack[0]; 38779 if (focusScope !== activeFocusScope) { 38780 activeFocusScope?.pause(); 38781 } 38782 stack = arrayRemove(stack, focusScope); 38783 stack.unshift(focusScope); 38784 }, 38785 remove(focusScope) { 38786 stack = arrayRemove(stack, focusScope); 38787 stack[0]?.resume(); 38788 } 38789 }; 38790} 38791function arrayRemove(array, item) { 38792 const updatedArray = [...array]; 38793 const index = updatedArray.indexOf(item); 38794 if (index !== -1) { 38795 updatedArray.splice(index, 1); 38796 } 38797 return updatedArray; 38798} 38799function removeLinks(items) { 38800 return items.filter((item) => item.tagName !== "A"); 38801} 38802 38803var getDefaultParent = function (originalTarget) { 38804 if (typeof document === 'undefined') { 38805 return null; 38806 } 38807 var sampleTarget = Array.isArray(originalTarget) ? originalTarget[0] : originalTarget; 38808 return sampleTarget.ownerDocument.body; 38809}; 38810var counterMap = new WeakMap(); 38811var uncontrolledNodes = new WeakMap(); 38812var markerMap = {}; 38813var lockCount = 0; 38814var unwrapHost = function (node) { 38815 return node && (node.host || unwrapHost(node.parentNode)); 38816}; 38817var correctTargets = function (parent, targets) { 38818 return targets 38819 .map(function (target) { 38820 if (parent.contains(target)) { 38821 return target; 38822 } 38823 var correctedTarget = unwrapHost(target); 38824 if (correctedTarget && parent.contains(correctedTarget)) { 38825 return correctedTarget; 38826 } 38827 console.error('aria-hidden', target, 'in not contained inside', parent, '. Doing nothing'); 38828 return null; 38829 }) 38830 .filter(function (x) { return Boolean(x); }); 38831}; 38832/** 38833 * Marks everything except given node(or nodes) as aria-hidden 38834 * @param {Element | Element[]} originalTarget - elements to keep on the page 38835 * @param [parentNode] - top element, defaults to document.body 38836 * @param {String} [markerName] - a special attribute to mark every node 38837 * @param {String} [controlAttribute] - html Attribute to control 38838 * @return {Undo} undo command 38839 */ 38840var applyAttributeToOthers = function (originalTarget, parentNode, markerName, controlAttribute) { 38841 var targets = correctTargets(parentNode, Array.isArray(originalTarget) ? originalTarget : [originalTarget]); 38842 if (!markerMap[markerName]) { 38843 markerMap[markerName] = new WeakMap(); 38844 } 38845 var markerCounter = markerMap[markerName]; 38846 var hiddenNodes = []; 38847 var elementsToKeep = new Set(); 38848 var elementsToStop = new Set(targets); 38849 var keep = function (el) { 38850 if (!el || elementsToKeep.has(el)) { 38851 return; 38852 } 38853 elementsToKeep.add(el); 38854 keep(el.parentNode); 38855 }; 38856 targets.forEach(keep); 38857 var deep = function (parent) { 38858 if (!parent || elementsToStop.has(parent)) { 38859 return; 38860 } 38861 Array.prototype.forEach.call(parent.children, function (node) { 38862 if (elementsToKeep.has(node)) { 38863 deep(node); 38864 } 38865 else { 38866 try { 38867 var attr = node.getAttribute(controlAttribute); 38868 var alreadyHidden = attr !== null && attr !== 'false'; 38869 var counterValue = (counterMap.get(node) || 0) + 1; 38870 var markerValue = (markerCounter.get(node) || 0) + 1; 38871 counterMap.set(node, counterValue); 38872 markerCounter.set(node, markerValue); 38873 hiddenNodes.push(node); 38874 if (counterValue === 1 && alreadyHidden) { 38875 uncontrolledNodes.set(node, true); 38876 } 38877 if (markerValue === 1) { 38878 node.setAttribute(markerName, 'true'); 38879 } 38880 if (!alreadyHidden) { 38881 node.setAttribute(controlAttribute, 'true'); 38882 } 38883 } 38884 catch (e) { 38885 console.error('aria-hidden: cannot operate on ', node, e); 38886 } 38887 } 38888 }); 38889 }; 38890 deep(parentNode); 38891 elementsToKeep.clear(); 38892 lockCount++; 38893 return function () { 38894 hiddenNodes.forEach(function (node) { 38895 var counterValue = counterMap.get(node) - 1; 38896 var markerValue = markerCounter.get(node) - 1; 38897 counterMap.set(node, counterValue); 38898 markerCounter.set(node, markerValue); 38899 if (!counterValue) { 38900 if (!uncontrolledNodes.has(node)) { 38901 node.removeAttribute(controlAttribute); 38902 } 38903 uncontrolledNodes.delete(node); 38904 } 38905 if (!markerValue) { 38906 node.removeAttribute(markerName); 38907 } 38908 }); 38909 lockCount--; 38910 if (!lockCount) { 38911 // clear 38912 counterMap = new WeakMap(); 38913 counterMap = new WeakMap(); 38914 uncontrolledNodes = new WeakMap(); 38915 markerMap = {}; 38916 } 38917 }; 38918}; 38919/** 38920 * Marks everything except given node(or nodes) as aria-hidden 38921 * @param {Element | Element[]} originalTarget - elements to keep on the page 38922 * @param [parentNode] - top element, defaults to document.body 38923 * @param {String} [markerName] - a special attribute to mark every node 38924 * @return {Undo} undo command 38925 */ 38926var hideOthers = function (originalTarget, parentNode, markerName) { 38927 if (markerName === void 0) { markerName = 'data-aria-hidden'; } 38928 var targets = Array.from(Array.isArray(originalTarget) ? originalTarget : [originalTarget]); 38929 var activeParentNode = getDefaultParent(originalTarget); 38930 if (!activeParentNode) { 38931 return function () { return null; }; 38932 } 38933 // we should not hide aria-live elements - https://github.com/theKashey/aria-hidden/issues/10 38934 // and script elements, as they have no impact on accessibility. 38935 targets.push.apply(targets, Array.from(activeParentNode.querySelectorAll('[aria-live], script'))); 38936 return applyAttributeToOthers(targets, activeParentNode, markerName, 'aria-hidden'); 38937}; 38938 38939/****************************************************************************** 38940Copyright (c) Microsoft Corporation. 38941 38942Permission to use, copy, modify, and/or distribute this software for any 38943purpose with or without fee is hereby granted. 38944 38945THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH 38946REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 38947AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, 38948INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 38949LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR 38950OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 38951PERFORMANCE OF THIS SOFTWARE. 38952***************************************************************************** */ 38953/* global Reflect, Promise, SuppressedError, Symbol, Iterator */ 38954 38955 38956var __assign = function() { 38957 __assign = Object.assign || function __assign(t) { 38958 for (var s, i = 1, n = arguments.length; i < n; i++) { 38959 s = arguments[i]; 38960 for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; 38961 } 38962 return t; 38963 }; 38964 return __assign.apply(this, arguments); 38965}; 38966 38967function __rest(s, e) { 38968 var t = {}; 38969 for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) 38970 t[p] = s[p]; 38971 if (s != null && typeof Object.getOwnPropertySymbols === "function") 38972 for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { 38973 if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) 38974 t[p[i]] = s[p[i]]; 38975 } 38976 return t; 38977} 38978 38979function __spreadArray(to, from, pack) { 38980 if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { 38981 if (ar || !(i in from)) { 38982 if (!ar) ar = Array.prototype.slice.call(from, 0, i); 38983 ar[i] = from[i]; 38984 } 38985 } 38986 return to.concat(ar || Array.prototype.slice.call(from)); 38987} 38988 38989typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { 38990 var e = new Error(message); 38991 return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; 38992}; 38993 38994var zeroRightClassName = 'right-scroll-bar-position'; 38995var fullWidthClassName = 'width-before-scroll-bar'; 38996var noScrollbarsClassName = 'with-scroll-bars-hidden'; 38997/** 38998 * Name of a CSS variable containing the amount of "hidden" scrollbar 38999 * ! might be undefined ! use will fallback! 39000 */ 39001var removedBarSizeVariable = '--removed-body-scroll-bar-size'; 39002 39003/** 39004 * Assigns a value for a given ref, no matter of the ref format 39005 * @param {RefObject} ref - a callback function or ref object 39006 * @param value - a new value 39007 * 39008 * @see https://github.com/theKashey/use-callback-ref#assignref 39009 * @example 39010 * const refObject = useRef(); 39011 * const refFn = (ref) => {....} 39012 * 39013 * assignRef(refObject, "refValue"); 39014 * assignRef(refFn, "refValue"); 39015 */ 39016function assignRef(ref, value) { 39017 if (typeof ref === 'function') { 39018 ref(value); 39019 } 39020 else if (ref) { 39021 ref.current = value; 39022 } 39023 return ref; 39024} 39025 39026/** 39027 * creates a MutableRef with ref change callback 39028 * @param initialValue - initial ref value 39029 * @param {Function} callback - a callback to run when value changes 39030 * 39031 * @example 39032 * const ref = useCallbackRef(0, (newValue, oldValue) => console.log(oldValue, '->', newValue); 39033 * ref.current = 1; 39034 * // prints 0 -> 1 39035 * 39036 * @see https://reactjs.org/docs/hooks-reference.html#useref 39037 * @see https://github.com/theKashey/use-callback-ref#usecallbackref---to-replace-reactuseref 39038 * @returns {MutableRefObject} 39039 */ 39040function useCallbackRef(initialValue, callback) { 39041 var ref = reactExports.useState(function () { return ({ 39042 // value 39043 value: initialValue, 39044 // last callback 39045 callback: callback, 39046 // "memoized" public interface 39047 facade: { 39048 get current() { 39049 return ref.value; 39050 }, 39051 set current(value) { 39052 var last = ref.value; 39053 if (last !== value) { 39054 ref.value = value; 39055 ref.callback(value, last); 39056 } 39057 }, 39058 }, 39059 }); })[0]; 39060 // update callback 39061 ref.callback = callback; 39062 return ref.facade; 39063} 39064 39065var useIsomorphicLayoutEffect = typeof window !== 'undefined' ? reactExports.useLayoutEffect : reactExports.useEffect; 39066var currentValues = new WeakMap(); 39067/** 39068 * Merges two or more refs together providing a single interface to set their value 39069 * @param {RefObject|Ref} refs 39070 * @returns {MutableRefObject} - a new ref, which translates all changes to {refs} 39071 * 39072 * @see {@link mergeRefs} a version without buit-in memoization 39073 * @see https://github.com/theKashey/use-callback-ref#usemergerefs 39074 * @example 39075 * const Component = React.forwardRef((props, ref) => { 39076 * const ownRef = useRef(); 39077 * const domRef = useMergeRefs([ref, ownRef]); // ð merge together 39078 * return <div ref={domRef}>...</div> 39079 * } 39080 */ 39081function useMergeRefs(refs, defaultValue) { 39082 var callbackRef = useCallbackRef(null, function (newValue) { 39083 return refs.forEach(function (ref) { return assignRef(ref, newValue); }); 39084 }); 39085 // handle refs changes - added or removed 39086 useIsomorphicLayoutEffect(function () { 39087 var oldValue = currentValues.get(callbackRef); 39088 if (oldValue) { 39089 var prevRefs_1 = new Set(oldValue); 39090 var nextRefs_1 = new Set(refs); 39091 var current_1 = callbackRef.current; 39092 prevRefs_1.forEach(function (ref) { 39093 if (!nextRefs_1.has(ref)) { 39094 assignRef(ref, null); 39095 } 39096 }); 39097 nextRefs_1.forEach(function (ref) { 39098 if (!prevRefs_1.has(ref)) { 39099 assignRef(ref, current_1); 39100 } 39101 }); 39102 } 39103 currentValues.set(callbackRef, refs); 39104 }, [refs]); 39105 return callbackRef; 39106} 39107 39108function ItoI(a) { 39109 return a; 39110} 39111function innerCreateMedium(defaults, middleware) { 39112 if (middleware === void 0) { middleware = ItoI; } 39113 var buffer = []; 39114 var assigned = false; 39115 var medium = { 39116 read: function () { 39117 if (assigned) { 39118 throw new Error('Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.'); 39119 } 39120 if (buffer.length) { 39121 return buffer[buffer.length - 1]; 39122 } 39123 return defaults; 39124 }, 39125 useMedium: function (data) { 39126 var item = middleware(data, assigned); 39127 buffer.push(item); 39128 return function () { 39129 buffer = buffer.filter(function (x) { return x !== item; }); 39130 }; 39131 }, 39132 assignSyncMedium: function (cb) { 39133 assigned = true; 39134 while (buffer.length) { 39135 var cbs = buffer; 39136 buffer = []; 39137 cbs.forEach(cb); 39138 } 39139 buffer = { 39140 push: function (x) { return cb(x); }, 39141 filter: function () { return buffer; }, 39142 }; 39143 }, 39144 assignMedium: function (cb) { 39145 assigned = true; 39146 var pendingQueue = []; 39147 if (buffer.length) { 39148 var cbs = buffer; 39149 buffer = []; 39150 cbs.forEach(cb); 39151 pendingQueue = buffer; 39152 } 39153 var executeQueue = function () { 39154 var cbs = pendingQueue; 39155 pendingQueue = []; 39156 cbs.forEach(cb); 39157 }; 39158 var cycle = function () { return Promise.resolve().then(executeQueue); }; 39159 cycle(); 39160 buffer = { 39161 push: function (x) { 39162 pendingQueue.push(x); 39163 cycle(); 39164 }, 39165 filter: function (filter) { 39166 pendingQueue = pendingQueue.filter(filter); 39167 return buffer; 39168 }, 39169 }; 39170 }, 39171 }; 39172 return medium; 39173} 39174// eslint-disable-next-line @typescript-eslint/ban-types 39175function createSidecarMedium(options) { 39176 if (options === void 0) { options = {}; } 39177 var medium = innerCreateMedium(null); 39178 medium.options = __assign({ async: true, ssr: false }, options); 39179 return medium; 39180} 39181 39182var SideCar$1 = function (_a) { 39183 var sideCar = _a.sideCar, rest = __rest(_a, ["sideCar"]); 39184 if (!sideCar) { 39185 throw new Error('Sidecar: please provide `sideCar` property to import the right car'); 39186 } 39187 var Target = sideCar.read(); 39188 if (!Target) { 39189 throw new Error('Sidecar medium not found'); 39190 } 39191 return reactExports.createElement(Target, __assign({}, rest)); 39192}; 39193SideCar$1.isSideCarExport = true; 39194function exportSidecar(medium, exported) { 39195 medium.useMedium(exported); 39196 return SideCar$1; 39197} 39198 39199var effectCar = createSidecarMedium(); 39200 39201var nothing = function () { 39202 return; 39203}; 39204/** 39205 * Removes scrollbar from the page and contain the scroll within the Lock 39206 */ 39207var RemoveScroll = reactExports.forwardRef(function (props, parentRef) { 39208 var ref = reactExports.useRef(null); 39209 var _a = reactExports.useState({ 39210 onScrollCapture: nothing, 39211 onWheelCapture: nothing, 39212 onTouchMoveCapture: nothing, 39213 }), callbacks = _a[0], setCallbacks = _a[1]; 39214 var forwardProps = props.forwardProps, children = props.children, className = props.className, removeScrollBar = props.removeScrollBar, enabled = props.enabled, shards = props.shards, sideCar = props.sideCar, noRelative = props.noRelative, noIsolation = props.noIsolation, inert = props.inert, allowPinchZoom = props.allowPinchZoom, _b = props.as, Container = _b === void 0 ? 'div' : _b, gapMode = props.gapMode, rest = __rest(props, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noRelative", "noIsolation", "inert", "allowPinchZoom", "as", "gapMode"]); 39215 var SideCar = sideCar; 39216 var containerRef = useMergeRefs([ref, parentRef]); 39217 var containerProps = __assign(__assign({}, rest), callbacks); 39218 return (reactExports.createElement(reactExports.Fragment, null, 39219 enabled && (reactExports.createElement(SideCar, { sideCar: effectCar, removeScrollBar: removeScrollBar, shards: shards, noRelative: noRelative, noIsolation: noIsolation, inert: inert, setCallbacks: setCallbacks, allowPinchZoom: !!allowPinchZoom, lockRef: ref, gapMode: gapMode })), 39220 forwardProps ? (reactExports.cloneElement(reactExports.Children.only(children), __assign(__assign({}, containerProps), { ref: containerRef }))) : (reactExports.createElement(Container, __assign({}, containerProps, { className: className, ref: containerRef }), children)))); 39221}); 39222RemoveScroll.defaultProps = { 39223 enabled: true, 39224 removeScrollBar: true, 39225 inert: false, 39226}; 39227RemoveScroll.classNames = { 39228 fullWidth: fullWidthClassName, 39229 zeroRight: zeroRightClassName, 39230}; 39231 39232var getNonce = function () { 39233 if (typeof __webpack_nonce__ !== 'undefined') { 39234 return __webpack_nonce__; 39235 } 39236 return undefined; 39237}; 39238 39239function makeStyleTag() { 39240 if (!document) 39241 return null; 39242 var tag = document.createElement('style'); 39243 tag.type = 'text/css'; 39244 var nonce = getNonce(); 39245 if (nonce) { 39246 tag.setAttribute('nonce', nonce); 39247 } 39248 return tag; 39249} 39250function injectStyles(tag, css) { 39251 // @ts-ignore 39252 if (tag.styleSheet) { 39253 // @ts-ignore 39254 tag.styleSheet.cssText = css; 39255 } 39256 else { 39257 tag.appendChild(document.createTextNode(css)); 39258 } 39259} 39260function insertStyleTag(tag) { 39261 var head = document.head || document.getElementsByTagName('head')[0]; 39262 head.appendChild(tag); 39263} 39264var stylesheetSingleton = function () { 39265 var counter = 0; 39266 var stylesheet = null; 39267 return { 39268 add: function (style) { 39269 if (counter == 0) { 39270 if ((stylesheet = makeStyleTag())) { 39271 injectStyles(stylesheet, style); 39272 insertStyleTag(stylesheet); 39273 } 39274 } 39275 counter++; 39276 }, 39277 remove: function () { 39278 counter--; 39279 if (!counter && stylesheet) { 39280 stylesheet.parentNode && stylesheet.parentNode.removeChild(stylesheet); 39281 stylesheet = null; 39282 } 39283 }, 39284 }; 39285}; 39286 39287/** 39288 * creates a hook to control style singleton 39289 * @see {@link styleSingleton} for a safer component version 39290 * @example 39291 * ```tsx 39292 * const useStyle = styleHookSingleton(); 39293 * /// 39294 * useStyle('body { overflow: hidden}'); 39295 */ 39296var styleHookSingleton = function () { 39297 var sheet = stylesheetSingleton(); 39298 return function (styles, isDynamic) { 39299 reactExports.useEffect(function () { 39300 sheet.add(styles); 39301 return function () { 39302 sheet.remove(); 39303 }; 39304 }, [styles && isDynamic]); 39305 }; 39306}; 39307 39308/** 39309 * create a Component to add styles on demand 39310 * - styles are added when first instance is mounted 39311 * - styles are removed when the last instance is unmounted 39312 * - changing styles in runtime does nothing unless dynamic is set. But with multiple components that can lead to the undefined behavior 39313 */ 39314var styleSingleton = function () { 39315 var useStyle = styleHookSingleton(); 39316 var Sheet = function (_a) { 39317 var styles = _a.styles, dynamic = _a.dynamic; 39318 useStyle(styles, dynamic); 39319 return null; 39320 }; 39321 return Sheet; 39322}; 39323 39324var zeroGap = { 39325 left: 0, 39326 top: 0, 39327 right: 0, 39328 gap: 0, 39329}; 39330var parse = function (x) { return parseInt(x || '', 10) || 0; }; 39331var getOffset = function (gapMode) { 39332 var cs = window.getComputedStyle(document.body); 39333 var left = cs[gapMode === 'padding' ? 'paddingLeft' : 'marginLeft']; 39334 var top = cs[gapMode === 'padding' ? 'paddingTop' : 'marginTop']; 39335 var right = cs[gapMode === 'padding' ? 'paddingRight' : 'marginRight']; 39336 return [parse(left), parse(top), parse(right)]; 39337}; 39338var getGapWidth = function (gapMode) { 39339 if (gapMode === void 0) { gapMode = 'margin'; } 39340 if (typeof window === 'undefined') { 39341 return zeroGap; 39342 } 39343 var offsets = getOffset(gapMode); 39344 var documentWidth = document.documentElement.clientWidth; 39345 var windowWidth = window.innerWidth; 39346 return { 39347 left: offsets[0], 39348 top: offsets[1], 39349 right: offsets[2], 39350 gap: Math.max(0, windowWidth - documentWidth + offsets[2] - offsets[0]), 39351 }; 39352}; 39353 39354var Style = styleSingleton(); 39355var lockAttribute = 'data-scroll-locked'; 39356// important tip - once we measure scrollBar width and remove them 39357// we could not repeat this operation 39358// thus we are using style-singleton - only the first "yet correct" style will be applied. 39359var getStyles = function (_a, allowRelative, gapMode, important) { 39360 var left = _a.left, top = _a.top, right = _a.right, gap = _a.gap; 39361 if (gapMode === void 0) { gapMode = 'margin'; } 39362 return "\n .".concat(noScrollbarsClassName, " {\n overflow: hidden ").concat(important, ";\n padding-right: ").concat(gap, "px ").concat(important, ";\n }\n body[").concat(lockAttribute, "] {\n overflow: hidden ").concat(important, ";\n overscroll-behavior: contain;\n ").concat([ 39363 allowRelative && "position: relative ".concat(important, ";"), 39364 gapMode === 'margin' && 39365 "\n padding-left: ".concat(left, "px;\n padding-top: ").concat(top, "px;\n padding-right: ").concat(right, "px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(gap, "px ").concat(important, ";\n "), 39366 gapMode === 'padding' && "padding-right: ".concat(gap, "px ").concat(important, ";"), 39367 ] 39368 .filter(Boolean) 39369 .join(''), "\n }\n \n .").concat(zeroRightClassName, " {\n right: ").concat(gap, "px ").concat(important, ";\n }\n \n .").concat(fullWidthClassName, " {\n margin-right: ").concat(gap, "px ").concat(important, ";\n }\n \n .").concat(zeroRightClassName, " .").concat(zeroRightClassName, " {\n right: 0 ").concat(important, ";\n }\n \n .").concat(fullWidthClassName, " .").concat(fullWidthClassName, " {\n margin-right: 0 ").concat(important, ";\n }\n \n body[").concat(lockAttribute, "] {\n ").concat(removedBarSizeVariable, ": ").concat(gap, "px;\n }\n"); 39370}; 39371var getCurrentUseCounter = function () { 39372 var counter = parseInt(document.body.getAttribute(lockAttribute) || '0', 10); 39373 return isFinite(counter) ? counter : 0; 39374}; 39375var useLockAttribute = function () { 39376 reactExports.useEffect(function () { 39377 document.body.setAttribute(lockAttribute, (getCurrentUseCounter() + 1).toString()); 39378 return function () { 39379 var newCounter = getCurrentUseCounter() - 1; 39380 if (newCounter <= 0) { 39381 document.body.removeAttribute(lockAttribute); 39382 } 39383 else { 39384 document.body.setAttribute(lockAttribute, newCounter.toString()); 39385 } 39386 }; 39387 }, []); 39388}; 39389/** 39390 * Removes page scrollbar and blocks page scroll when mounted 39391 */ 39392var RemoveScrollBar = function (_a) { 39393 var noRelative = _a.noRelative, noImportant = _a.noImportant, _b = _a.gapMode, gapMode = _b === void 0 ? 'margin' : _b;
vendor: 6,144 bytes, lines 39394-39546
39394 useLockAttribute(); 39395 /* 39396 gap will be measured on every component mount 39397 however it will be used only by the "first" invocation 39398 due to singleton nature of <Style 39399 */ 39400 var gap = reactExports.useMemo(function () { return getGapWidth(gapMode); }, [gapMode]); 39401 return reactExports.createElement(Style, { styles: getStyles(gap, !noRelative, gapMode, !noImportant ? '!important' : '') }); 39402}; 39403 39404var passiveSupported = false; 39405if (typeof window !== 'undefined') { 39406 try { 39407 var options = Object.defineProperty({}, 'passive', { 39408 get: function () { 39409 passiveSupported = true; 39410 return true; 39411 }, 39412 }); 39413 // @ts-ignore 39414 window.addEventListener('test', options, options); 39415 // @ts-ignore 39416 window.removeEventListener('test', options, options); 39417 } 39418 catch (err) { 39419 passiveSupported = false; 39420 } 39421} 39422var nonPassive = passiveSupported ? { passive: false } : false; 39423 39424var alwaysContainsScroll = function (node) { 39425 // textarea will always _contain_ scroll inside self. It only can be hidden 39426 return node.tagName === 'TEXTAREA'; 39427}; 39428var elementCanBeScrolled = function (node, overflow) { 39429 if (!(node instanceof Element)) { 39430 return false; 39431 } 39432 var styles = window.getComputedStyle(node); 39433 return ( 39434 // not-not-scrollable 39435 styles[overflow] !== 'hidden' && 39436 // contains scroll inside self 39437 !(styles.overflowY === styles.overflowX && !alwaysContainsScroll(node) && styles[overflow] === 'visible')); 39438}; 39439var elementCouldBeVScrolled = function (node) { return elementCanBeScrolled(node, 'overflowY'); }; 39440var elementCouldBeHScrolled = function (node) { return elementCanBeScrolled(node, 'overflowX'); }; 39441var locationCouldBeScrolled = function (axis, node) { 39442 var ownerDocument = node.ownerDocument; 39443 var current = node; 39444 do { 39445 // Skip over shadow root 39446 if (typeof ShadowRoot !== 'undefined' && current instanceof ShadowRoot) { 39447 current = current.host; 39448 } 39449 var isScrollable = elementCouldBeScrolled(axis, current); 39450 if (isScrollable) { 39451 var _a = getScrollVariables(axis, current), scrollHeight = _a[1], clientHeight = _a[2]; 39452 if (scrollHeight > clientHeight) { 39453 return true; 39454 } 39455 } 39456 current = current.parentNode; 39457 } while (current && current !== ownerDocument.body); 39458 return false; 39459}; 39460var getVScrollVariables = function (_a) { 39461 var scrollTop = _a.scrollTop, scrollHeight = _a.scrollHeight, clientHeight = _a.clientHeight; 39462 return [ 39463 scrollTop, 39464 scrollHeight, 39465 clientHeight, 39466 ]; 39467}; 39468var getHScrollVariables = function (_a) { 39469 var scrollLeft = _a.scrollLeft, scrollWidth = _a.scrollWidth, clientWidth = _a.clientWidth; 39470 return [ 39471 scrollLeft, 39472 scrollWidth, 39473 clientWidth, 39474 ]; 39475}; 39476var elementCouldBeScrolled = function (axis, node) { 39477 return axis === 'v' ? elementCouldBeVScrolled(node) : elementCouldBeHScrolled(node); 39478}; 39479var getScrollVariables = function (axis, node) { 39480 return axis === 'v' ? getVScrollVariables(node) : getHScrollVariables(node); 39481}; 39482var getDirectionFactor = function (axis, direction) { 39483 /** 39484 * If the element's direction is rtl (right-to-left), then scrollLeft is 0 when the scrollbar is at its rightmost position, 39485 * and then increasingly negative as you scroll towards the end of the content. 39486 * @see https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollLeft 39487 */ 39488 return axis === 'h' && direction === 'rtl' ? -1 : 1; 39489}; 39490var handleScroll = function (axis, endTarget, event, sourceDelta, noOverscroll) { 39491 var directionFactor = getDirectionFactor(axis, window.getComputedStyle(endTarget).direction); 39492 var delta = directionFactor * sourceDelta; 39493 // find scrollable target 39494 var target = event.target; 39495 var targetInLock = endTarget.contains(target); 39496 var shouldCancelScroll = false; 39497 var isDeltaPositive = delta > 0; 39498 var availableScroll = 0; 39499 var availableScrollTop = 0; 39500 do { 39501 if (!target) { 39502 break; 39503 } 39504 var _a = getScrollVariables(axis, target), position = _a[0], scroll_1 = _a[1], capacity = _a[2]; 39505 var elementScroll = scroll_1 - capacity - directionFactor * position; 39506 if (position || elementScroll) { 39507 if (elementCouldBeScrolled(axis, target)) { 39508 availableScroll += elementScroll; 39509 availableScrollTop += position; 39510 } 39511 } 39512 var parent_1 = target.parentNode; 39513 // we will "bubble" from ShadowDom in case we are, or just to the parent in normal case 39514 // this is the same logic used in focus-lock 39515 target = (parent_1 && parent_1.nodeType === Node.DOCUMENT_FRAGMENT_NODE ? parent_1.host : parent_1); 39516 } while ( 39517 // portaled content 39518 (!targetInLock && target !== document.body) || 39519 // self content 39520 (targetInLock && (endTarget.contains(target) || endTarget === target))); 39521 // handle epsilon around 0 (non standard zoom levels) 39522 if (isDeltaPositive && 39523 ((Math.abs(availableScroll) < 1) || (false))) { 39524 shouldCancelScroll = true; 39525 } 39526 else if (!isDeltaPositive && 39527 ((Math.abs(availableScrollTop) < 1) || (false))) { 39528 shouldCancelScroll = true; 39529 } 39530 return shouldCancelScroll; 39531}; 39532 39533var getTouchXY = function (event) { 39534 return 'changedTouches' in event ? [event.changedTouches[0].clientX, event.changedTouches[0].clientY] : [0, 0]; 39535}; 39536var getDeltaXY = function (event) { return [event.deltaX, event.deltaY]; }; 39537var extractRef = function (ref) { 39538 return ref && 'current' in ref ? ref.current : ref; 39539}; 39540var deltaCompare = function (x, y) { return x[0] === y[0] && x[1] === y[1]; }; 39541var generateStyle = function (id) { return "\n .block-interactivity-".concat(id, " {pointer-events: none;}\n .allow-interactivity-").concat(id, " {pointer-events: all;}\n"); }; 39542var idCounter = 0; 39543var lockStack = []; 39544function RemoveScrollSideCar(props) { 39545 var shouldPreventQueue = reactExports.useRef([]); 39546 var touchStartRef = reactExports.useRef([0, 0]);
vendor: 7,324 bytes, lines 39547-39704
39547 var activeAxis = reactExports.useRef(); 39548 var id = reactExports.useState(idCounter++)[0]; 39549 var Style = reactExports.useState(styleSingleton)[0]; 39550 var lastProps = reactExports.useRef(props); 39551 reactExports.useEffect(function () { 39552 lastProps.current = props; 39553 }, [props]); 39554 reactExports.useEffect(function () { 39555 if (props.inert) { 39556 document.body.classList.add("block-interactivity-".concat(id)); 39557 var allow_1 = __spreadArray([props.lockRef.current], (props.shards || []).map(extractRef), true).filter(Boolean); 39558 allow_1.forEach(function (el) { return el.classList.add("allow-interactivity-".concat(id)); }); 39559 return function () { 39560 document.body.classList.remove("block-interactivity-".concat(id)); 39561 allow_1.forEach(function (el) { return el.classList.remove("allow-interactivity-".concat(id)); }); 39562 }; 39563 } 39564 return; 39565 }, [props.inert, props.lockRef.current, props.shards]); 39566 var shouldCancelEvent = reactExports.useCallback(function (event, parent) { 39567 if (('touches' in event && event.touches.length === 2) || (event.type === 'wheel' && event.ctrlKey)) { 39568 return !lastProps.current.allowPinchZoom; 39569 } 39570 var touch = getTouchXY(event); 39571 var touchStart = touchStartRef.current; 39572 var deltaX = 'deltaX' in event ? event.deltaX : touchStart[0] - touch[0]; 39573 var deltaY = 'deltaY' in event ? event.deltaY : touchStart[1] - touch[1]; 39574 var currentAxis; 39575 var target = event.target; 39576 var moveDirection = Math.abs(deltaX) > Math.abs(deltaY) ? 'h' : 'v'; 39577 // allow horizontal touch move on Range inputs. They will not cause any scroll 39578 if ('touches' in event && moveDirection === 'h' && target.type === 'range') { 39579 return false; 39580 } 39581 var canBeScrolledInMainDirection = locationCouldBeScrolled(moveDirection, target); 39582 if (!canBeScrolledInMainDirection) { 39583 return true; 39584 } 39585 if (canBeScrolledInMainDirection) { 39586 currentAxis = moveDirection; 39587 } 39588 else { 39589 currentAxis = moveDirection === 'v' ? 'h' : 'v'; 39590 canBeScrolledInMainDirection = locationCouldBeScrolled(moveDirection, target); 39591 // other axis might be not scrollable 39592 } 39593 if (!canBeScrolledInMainDirection) { 39594 return false; 39595 } 39596 if (!activeAxis.current && 'changedTouches' in event && (deltaX || deltaY)) { 39597 activeAxis.current = currentAxis; 39598 } 39599 if (!currentAxis) { 39600 return true; 39601 } 39602 var cancelingAxis = activeAxis.current || currentAxis; 39603 return handleScroll(cancelingAxis, parent, event, cancelingAxis === 'h' ? deltaX : deltaY); 39604 }, []); 39605 var shouldPrevent = reactExports.useCallback(function (_event) { 39606 var event = _event; 39607 if (!lockStack.length || lockStack[lockStack.length - 1] !== Style) { 39608 // not the last active 39609 return; 39610 } 39611 var delta = 'deltaY' in event ? getDeltaXY(event) : getTouchXY(event); 39612 var sourceEvent = shouldPreventQueue.current.filter(function (e) { return e.name === event.type && (e.target === event.target || event.target === e.shadowParent) && deltaCompare(e.delta, delta); })[0]; 39613 // self event, and should be canceled 39614 if (sourceEvent && sourceEvent.should) { 39615 if (event.cancelable) { 39616 event.preventDefault(); 39617 } 39618 return; 39619 } 39620 // outside or shard event 39621 if (!sourceEvent) { 39622 var shardNodes = (lastProps.current.shards || []) 39623 .map(extractRef) 39624 .filter(Boolean) 39625 .filter(function (node) { return node.contains(event.target); }); 39626 var shouldStop = shardNodes.length > 0 ? shouldCancelEvent(event, shardNodes[0]) : !lastProps.current.noIsolation; 39627 if (shouldStop) { 39628 if (event.cancelable) { 39629 event.preventDefault(); 39630 } 39631 } 39632 } 39633 }, []); 39634 var shouldCancel = reactExports.useCallback(function (name, delta, target, should) { 39635 var event = { name: name, delta: delta, target: target, should: should, shadowParent: getOutermostShadowParent(target) }; 39636 shouldPreventQueue.current.push(event); 39637 setTimeout(function () { 39638 shouldPreventQueue.current = shouldPreventQueue.current.filter(function (e) { return e !== event; }); 39639 }, 1); 39640 }, []); 39641 var scrollTouchStart = reactExports.useCallback(function (event) { 39642 touchStartRef.current = getTouchXY(event); 39643 activeAxis.current = undefined; 39644 }, []); 39645 var scrollWheel = reactExports.useCallback(function (event) { 39646 shouldCancel(event.type, getDeltaXY(event), event.target, shouldCancelEvent(event, props.lockRef.current)); 39647 }, []); 39648 var scrollTouchMove = reactExports.useCallback(function (event) { 39649 shouldCancel(event.type, getTouchXY(event), event.target, shouldCancelEvent(event, props.lockRef.current)); 39650 }, []); 39651 reactExports.useEffect(function () { 39652 lockStack.push(Style); 39653 props.setCallbacks({ 39654 onScrollCapture: scrollWheel, 39655 onWheelCapture: scrollWheel, 39656 onTouchMoveCapture: scrollTouchMove, 39657 }); 39658 document.addEventListener('wheel', shouldPrevent, nonPassive); 39659 document.addEventListener('touchmove', shouldPrevent, nonPassive); 39660 document.addEventListener('touchstart', scrollTouchStart, nonPassive); 39661 return function () { 39662 lockStack = lockStack.filter(function (inst) { return inst !== Style; }); 39663 document.removeEventListener('wheel', shouldPrevent, nonPassive); 39664 document.removeEventListener('touchmove', shouldPrevent, nonPassive); 39665 document.removeEventListener('touchstart', scrollTouchStart, nonPassive); 39666 }; 39667 }, []); 39668 var removeScrollBar = props.removeScrollBar, inert = props.inert; 39669 return (reactExports.createElement(reactExports.Fragment, null, 39670 inert ? reactExports.createElement(Style, { styles: generateStyle(id) }) : null, 39671 removeScrollBar ? reactExports.createElement(RemoveScrollBar, { noRelative: props.noRelative, gapMode: props.gapMode }) : null)); 39672} 39673function getOutermostShadowParent(node) { 39674 var shadowParent = null; 39675 while (node !== null) { 39676 if (node instanceof ShadowRoot) { 39677 shadowParent = node.host; 39678 node = node.host; 39679 } 39680 node = node.parentNode; 39681 } 39682 return shadowParent; 39683} 39684 39685const SideCar = exportSidecar(effectCar, RemoveScrollSideCar); 39686 39687var ReactRemoveScroll = reactExports.forwardRef(function (props, ref) { return (reactExports.createElement(RemoveScroll, __assign({}, props, { ref: ref, sideCar: SideCar }))); }); 39688ReactRemoveScroll.classNames = RemoveScroll.classNames; 39689 39690var POPOVER_NAME = "Popover"; 39691var [createPopoverContext] = createContextScope(POPOVER_NAME, [ 39692 createPopperScope 39693]); 39694var usePopperScope = createPopperScope(); 39695var [PopoverProvider, usePopoverContext] = createPopoverContext(POPOVER_NAME); 39696var Popover$1 = (props) => { 39697 const { 39698 __scopePopover, 39699 children, 39700 open: openProp, 39701 defaultOpen, 39702 onOpenChange, 39703 modal = false 39704 }
vendor: 6,578 bytes, lines 39704-39850
39704 = props; 39705 const popperScope = usePopperScope(__scopePopover); 39706 const triggerRef = reactExports.useRef(null); 39707 const [hasCustomAnchor, setHasCustomAnchor] = reactExports.useState(false); 39708 const [open, setOpen] = useControllableState({ 39709 prop: openProp, 39710 defaultProp: defaultOpen ?? false, 39711 onChange: onOpenChange, 39712 caller: POPOVER_NAME 39713 }); 39714 return /* @__PURE__ */ jsxRuntimeExports.jsx(Root2$1, { ...popperScope, children: /* @__PURE__ */ jsxRuntimeExports.jsx( 39715 PopoverProvider, 39716 { 39717 scope: __scopePopover, 39718 contentId: useId(), 39719 triggerRef, 39720 open, 39721 onOpenChange: setOpen, 39722 onOpenToggle: reactExports.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen]), 39723 hasCustomAnchor, 39724 onCustomAnchorAdd: reactExports.useCallback(() => setHasCustomAnchor(true), []), 39725 onCustomAnchorRemove: reactExports.useCallback(() => setHasCustomAnchor(false), []), 39726 modal, 39727 children 39728 } 39729 ) }); 39730}; 39731Popover$1.displayName = POPOVER_NAME; 39732var ANCHOR_NAME = "PopoverAnchor"; 39733var PopoverAnchor = reactExports.forwardRef( 39734 (props, forwardedRef) => { 39735 const { __scopePopover, ...anchorProps } = props; 39736 const context = usePopoverContext(ANCHOR_NAME, __scopePopover); 39737 const popperScope = usePopperScope(__scopePopover); 39738 const { onCustomAnchorAdd, onCustomAnchorRemove } = context; 39739 reactExports.useEffect(() => { 39740 onCustomAnchorAdd(); 39741 return () => onCustomAnchorRemove(); 39742 }, [onCustomAnchorAdd, onCustomAnchorRemove]); 39743 return /* @__PURE__ */ jsxRuntimeExports.jsx(Anchor, { ...popperScope, ...anchorProps, ref: forwardedRef }); 39744 } 39745); 39746PopoverAnchor.displayName = ANCHOR_NAME; 39747var TRIGGER_NAME = "PopoverTrigger"; 39748var PopoverTrigger$1 = reactExports.forwardRef( 39749 (props, forwardedRef) => { 39750 const { __scopePopover, ...triggerProps } = props; 39751 const context = usePopoverContext(TRIGGER_NAME, __scopePopover); 39752 const popperScope = usePopperScope(__scopePopover); 39753 const composedTriggerRef = useComposedRefs(forwardedRef, context.triggerRef); 39754 const trigger = /* @__PURE__ */ jsxRuntimeExports.jsx( 39755 Primitive.button, 39756 { 39757 type: "button", 39758 "aria-haspopup": "dialog", 39759 "aria-expanded": context.open, 39760 "aria-controls": context.contentId, 39761 "data-state": getState(context.open), 39762 ...triggerProps, 39763 ref: composedTriggerRef, 39764 onClick: composeEventHandlers(props.onClick, context.onOpenToggle) 39765 } 39766 ); 39767 return context.hasCustomAnchor ? trigger : /* @__PURE__ */ jsxRuntimeExports.jsx(Anchor, { asChild: true, ...popperScope, children: trigger }); 39768 } 39769); 39770PopoverTrigger$1.displayName = TRIGGER_NAME; 39771var PORTAL_NAME = "PopoverPortal"; 39772var [PortalProvider, usePortalContext] = createPopoverContext(PORTAL_NAME, { 39773 forceMount: void 0 39774}); 39775var PopoverPortal = (props) => { 39776 const { __scopePopover, forceMount, children, container } = props; 39777 const context = usePopoverContext(PORTAL_NAME, __scopePopover); 39778 return /* @__PURE__ */ jsxRuntimeExports.jsx(PortalProvider, { scope: __scopePopover, forceMount, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Portal$1, { asChild: true, container, children }) }) }); 39779}; 39780PopoverPortal.displayName = PORTAL_NAME; 39781var CONTENT_NAME = "PopoverContent"; 39782var PopoverContent$1 = reactExports.forwardRef( 39783 (props, forwardedRef) => { 39784 const portalContext = usePortalContext(CONTENT_NAME, props.__scopePopover); 39785 const { forceMount = portalContext.forceMount, ...contentProps } = props; 39786 const context = usePopoverContext(CONTENT_NAME, props.__scopePopover); 39787 return /* @__PURE__ */ jsxRuntimeExports.jsx(Presence, { present: forceMount || context.open, children: context.modal ? /* @__PURE__ */ jsxRuntimeExports.jsx(PopoverContentModal, { ...contentProps, ref: forwardedRef }) : /* @__PURE__ */ jsxRuntimeExports.jsx(PopoverContentNonModal, { ...contentProps, ref: forwardedRef }) }); 39788 } 39789); 39790PopoverContent$1.displayName = CONTENT_NAME; 39791var Slot = createSlot("PopoverContent.RemoveScroll"); 39792var PopoverContentModal = reactExports.forwardRef( 39793 (props, forwardedRef) => { 39794 const context = usePopoverContext(CONTENT_NAME, props.__scopePopover); 39795 const contentRef = reactExports.useRef(null); 39796 const composedRefs = useComposedRefs(forwardedRef, contentRef); 39797 const isRightClickOutsideRef = reactExports.useRef(false); 39798 reactExports.useEffect(() => { 39799 const content = contentRef.current; 39800 if (content) return hideOthers(content); 39801 }, []); 39802 return /* @__PURE__ */ jsxRuntimeExports.jsx(ReactRemoveScroll, { as: Slot, allowPinchZoom: true, children: /* @__PURE__ */ jsxRuntimeExports.jsx( 39803 PopoverContentImpl, 39804 { 39805 ...props, 39806 ref: composedRefs, 39807 trapFocus: context.open, 39808 disableOutsidePointerEvents: true, 39809 onCloseAutoFocus: composeEventHandlers(props.onCloseAutoFocus, (event) => { 39810 event.preventDefault(); 39811 if (!isRightClickOutsideRef.current) context.triggerRef.current?.focus(); 39812 }), 39813 onPointerDownOutside: composeEventHandlers( 39814 props.onPointerDownOutside, 39815 (event) => { 39816 const originalEvent = event.detail.originalEvent; 39817 const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true; 39818 const isRightClick = originalEvent.button === 2 || ctrlLeftClick; 39819 isRightClickOutsideRef.current = isRightClick; 39820 }, 39821 { checkForDefaultPrevented: false } 39822 ), 39823 onFocusOutside: composeEventHandlers( 39824 props.onFocusOutside, 39825 (event) => event.preventDefault(), 39826 { checkForDefaultPrevented: false } 39827 ) 39828 } 39829 ) }); 39830 } 39831); 39832var PopoverContentNonModal = reactExports.forwardRef( 39833 (props, forwardedRef) => { 39834 const context = usePopoverContext(CONTENT_NAME, props.__scopePopover); 39835 const hasInteractedOutsideRef = reactExports.useRef(false); 39836 const hasPointerDownOutsideRef = reactExports.useRef(false); 39837 return /* @__PURE__ */ jsxRuntimeExports.jsx( 39838 PopoverContentImpl, 39839 { 39840 ...props, 39841 ref: forwardedRef, 39842 trapFocus: false, 39843 disableOutsidePointerEvents: false, 39844 onCloseAutoFocus: (event) => { 39845 props.onCloseAutoFocus?.(event); 39846 if (!event.defaultPrevented) { 39847 if (!hasInteractedOutsideRef.current) context.triggerRef.current?.focus(); 39848 event.preventDefault(); 39849 } 39850 hasInteractedOutsideRef.current = false;
39851 hasPointerDownOutsideRef.current = false; 39852 }, 39853 onInteractOutside: (event) => { 39854 props.onInteractOutside?.(event); 39855 if (!event.defaultPrevented) { 39856 hasInteractedOutsideRef.current = true; 39857 if (event.detail.originalEvent.type === "pointerdown") { 39858 hasPointerDownOutsideRef.current = true; 39859 } 39860 } 39861 const target = event.target; 39862 const targetIsTrigger = context.triggerRef.current?.contains(target); 39863 if (targetIsTrigger) event.preventDefault(); 39864 if (event.detail.originalEvent.type === "focusin" && hasPointerDownOutsideRef.current) { 39865 event.preventDefault(); 39866 } 39867 } 39868 } 39869 ); 39870 } 39871); 39872var PopoverContentImpl = reactExports.forwardRef( 39873 (props, forwardedRef) => { 39874 const { 39875 __scopePopover, 39876 trapFocus, 39877 onOpenAutoFocus, 39878 onCloseAutoFocus, 39879 disableOutsidePointerEvents, 39880 onEscapeKeyDown, 39881 onPointerDownOutside, 39882 onFocusOutside, 39883 onInteractOutside, 39884 ...contentProps 39885 } = props; 39886 const context = usePopoverContext(CONTENT_NAME, __scopePopover); 39887 const popperScope = usePopperScope(__scopePopover); 39888 useFocusGuards(); 39889 return /* @__PURE__ */ jsxRuntimeExports.jsx( 39890 FocusScope, 39891 { 39892 asChild: true, 39893 loop: true, 39894 trapped: trapFocus, 39895 onMountAutoFocus: onOpenAutoFocus, 39896 onUnmountAutoFocus: onCloseAutoFocus, 39897 children: /* @__PURE__ */ jsxRuntimeExports.jsx( 39898 DismissableLayer, 39899 { 39900 asChild: true, 39901 disableOutsidePointerEvents, 39902 onInteractOutside, 39903 onEscapeKeyDown, 39904 onPointerDownOutside, 39905 onFocusOutside, 39906 onDismiss: () => context.onOpenChange(false), 39907 children: /* @__PURE__ */ jsxRuntimeExports.jsx( 39908 Content, 39909 { 39910 "data-state": getState(context.open), 39911 role: "dialog", 39912 id: context.contentId, 39913 ...popperScope, 39914 ...contentProps, 39915 ref: forwardedRef, 39916 style: { 39917 ...contentProps.style, 39918 // re-namespace exposed content custom properties 39919 ...{ 39920 "--radix-popover-content-transform-origin": "var(--radix-popper-transform-origin)", 39921 "--radix-popover-content-available-width": "var(--radix-popper-available-width)", 39922 "--radix-popover-content-available-height": "var(--radix-popper-available-height)", 39923 "--radix-popover-trigger-width": "var(--radix-popper-anchor-width)", 39924 "--radix-popover-trigger-height": "var(--radix-popper-anchor-height)" 39925 } 39926 } 39927 } 39928 ) 39929 } 39930 ) 39931 } 39932 ); 39933 } 39934); 39935var CLOSE_NAME = "PopoverClose"; 39936var PopoverClose = reactExports.forwardRef( 39937 (props, forwardedRef) => { 39938 const { __scopePopover, ...closeProps } = props; 39939 const context = usePopoverContext(CLOSE_NAME, __scopePopover); 39940 return /* @__PURE__ */ jsxRuntimeExports.jsx( 39941 Primitive.button, 39942 { 39943 type: "button", 39944 ...closeProps, 39945 ref: forwardedRef, 39946 onClick: composeEventHandlers(props.onClick, () => context.onOpenChange(false)) 39947 } 39948 ); 39949 } 39950); 39951PopoverClose.displayName = CLOSE_NAME; 39952var ARROW_NAME = "PopoverArrow"; 39953var PopoverArrow = reactExports.forwardRef( 39954 (props, forwardedRef) => { 39955 const { __scopePopover, ...arrowProps } = props; 39956 const popperScope = usePopperScope(__scopePopover); 39957 return /* @__PURE__ */ jsxRuntimeExports.jsx(Arrow, { ...popperScope, ...arrowProps, ref: forwardedRef }); 39958 } 39959); 39960PopoverArrow.displayName = ARROW_NAME; 39961function getState(open) { 39962 return open ? "open" : "closed"; 39963} 39964var Root2 = Popover$1; 39965var Trigger = PopoverTrigger$1; 39966var Portal = PopoverPortal; 39967var Content2 = PopoverContent$1; 39968 39969function Popover({ 39970 ...props 39971}) { 39972 return /* @__PURE__ */ jsxRuntimeExports.jsx(Root2, { "data-slot": "popover", ...props }); 39973} 39974function PopoverTrigger({ 39975 ...props 39976}) { 39977 return /* @__PURE__ */ jsxRuntimeExports.jsx(Trigger, { "data-slot": "popover-trigger", ...props }); 39978} 39979function PopoverContent({ 39980 className, 39981 align = "center", 39982 sideOffset = 4, 39983 ...props 39984}) { 39985 return /* @__PURE__ */ jsxRuntimeExports.jsx(Portal, { children: /* @__PURE__ */ jsxRuntimeExports.jsx( 39986 Content2, 39987 { 39988 "data-slot": "popover-content", 39989 align, 39990 sideOffset, 39991 className: cn( 39992 "bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:sli
39992de-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden", 39993 className 39994 ), 39995 ...props 39996 } 39997 ) }); 39998} 39999
40000// packages/react/direction/src/direction.tsx 40001var DirectionContext = reactExports.createContext(void 0); 40002function useDirection(localDir) { 40003 const globalDir = reactExports.useContext(DirectionContext); 40004 return localDir || globalDir || "ltr"; 40005} 40006
vendor: 29,937 bytes, lines 40007-40728
40007// packages/core/number/src/number.ts 40008function clamp(value, [min, max]) { 40009 return Math.min(max, Math.max(min, value)); 40010} 40011 40012function useStateMachine(initialState, machine) { 40013 return reactExports.useReducer((state, event) => { 40014 const nextState = machine[state][event]; 40015 return nextState ?? state; 40016 }, initialState); 40017} 40018var SCROLL_AREA_NAME = "ScrollArea"; 40019var [createScrollAreaContext] = createContextScope(SCROLL_AREA_NAME); 40020var [ScrollAreaProvider, useScrollAreaContext] = createScrollAreaContext(SCROLL_AREA_NAME); 40021var ScrollArea$1 = reactExports.forwardRef( 40022 (props, forwardedRef) => { 40023 const { 40024 __scopeScrollArea, 40025 type = "hover", 40026 dir, 40027 scrollHideDelay = 600, 40028 ...scrollAreaProps 40029 } = props; 40030 const [scrollArea, setScrollArea] = reactExports.useState(null); 40031 const [viewport, setViewport] = reactExports.useState(null); 40032 const [content, setContent] = reactExports.useState(null); 40033 const [scrollbarX, setScrollbarX] = reactExports.useState(null); 40034 const [scrollbarY, setScrollbarY] = reactExports.useState(null); 40035 const [cornerWidth, setCornerWidth] = reactExports.useState(0); 40036 const [cornerHeight, setCornerHeight] = reactExports.useState(0); 40037 const [scrollbarXEnabled, setScrollbarXEnabled] = reactExports.useState(false); 40038 const [scrollbarYEnabled, setScrollbarYEnabled] = reactExports.useState(false); 40039 const composedRefs = useComposedRefs(forwardedRef, (node) => setScrollArea(node)); 40040 const direction = useDirection(dir); 40041 return /* @__PURE__ */ jsxRuntimeExports.jsx( 40042 ScrollAreaProvider, 40043 { 40044 scope: __scopeScrollArea, 40045 type, 40046 dir: direction, 40047 scrollHideDelay, 40048 scrollArea, 40049 viewport, 40050 onViewportChange: setViewport, 40051 content, 40052 onContentChange: setContent, 40053 scrollbarX, 40054 onScrollbarXChange: setScrollbarX, 40055 scrollbarXEnabled, 40056 onScrollbarXEnabledChange: setScrollbarXEnabled, 40057 scrollbarY, 40058 onScrollbarYChange: setScrollbarY, 40059 scrollbarYEnabled, 40060 onScrollbarYEnabledChange: setScrollbarYEnabled, 40061 onCornerWidthChange: setCornerWidth, 40062 onCornerHeightChange: setCornerHeight, 40063 children: /* @__PURE__ */ jsxRuntimeExports.jsx( 40064 Primitive.div, 40065 { 40066 dir: direction, 40067 ...scrollAreaProps, 40068 ref: composedRefs, 40069 style: { 40070 position: "relative", 40071 // Pass corner sizes as CSS vars to reduce re-renders of context consumers 40072 ["--radix-scroll-area-corner-width"]: cornerWidth + "px", 40073 ["--radix-scroll-area-corner-height"]: cornerHeight + "px", 40074 ...props.style 40075 } 40076 } 40077 ) 40078 } 40079 ); 40080 } 40081); 40082ScrollArea$1.displayName = SCROLL_AREA_NAME; 40083var VIEWPORT_NAME = "ScrollAreaViewport"; 40084var ScrollAreaViewport = reactExports.forwardRef( 40085 (props, forwardedRef) => { 40086 const { __scopeScrollArea, children, nonce, ...viewportProps } = props; 40087 const context = useScrollAreaContext(VIEWPORT_NAME, __scopeScrollArea); 40088 const ref = reactExports.useRef(null); 40089 const composedRefs = useComposedRefs(forwardedRef, ref, context.onViewportChange); 40090 return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [ 40091 /* @__PURE__ */ jsxRuntimeExports.jsx( 40092 "style", 40093 { 40094 dangerouslySetInnerHTML: { 40095 __html: `[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}` 40096 }, 40097 nonce 40098 } 40099 ), 40100 /* @__PURE__ */ jsxRuntimeExports.jsx( 40101 Primitive.div, 40102 { 40103 "data-radix-scroll-area-viewport": "", 40104 ...viewportProps, 40105 ref: composedRefs, 40106 style: { 40107 /** 40108 * We don't support `visible` because the intention is to have at least one scrollbar 40109 * if this component is used and `visible` will behave like `auto` in that case 40110 * https://developer.mozilla.org/en-US/docs/Web/CSS/overflow#description 40111 * 40112 * We don't handle `auto` because the intention is for the native implementation 40113 * to be hidden if using this component. We just want to ensure the node is scrollable 40114 * so could have used either `scroll` or `auto` here. We picked `scroll` to prevent 40115 * the browser from having to work out whether to render native scrollbars or not, 40116 * we tell it to with the intention of hiding them in CSS. 40117 */ 40118 overflowX: context.scrollbarXEnabled ? "scroll" : "hidden", 40119 overflowY: context.scrollbarYEnabled ? "scroll" : "hidden", 40120 ...props.style 40121 }, 40122 children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { ref: context.onContentChange, style: { minWidth: "100%", display: "table" }, children }) 40123 } 40124 ) 40125 ] }); 40126 } 40127); 40128ScrollAreaViewport.displayName = VIEWPORT_NAME; 40129var SCROLLBAR_NAME = "ScrollAreaScrollbar"; 40130var ScrollAreaScrollbar = reactExports.forwardRef( 40131 (props, forwardedRef) => { 40132 const { forceMount, ...scrollbarProps } = props; 40133 const context = useScrollAreaContext(SCROLLBAR_NAME, props.__scopeScrollArea); 40134 const { onScrollbarXEnabledChange, onScrollbarYEnabledChange } = context; 40135 const isHorizontal = props.orientation === "horizontal"; 40136 reactExports.useEffect(() => { 40137 isHorizontal ? onScrollbarXEnabledChange(true) : onScrollbarYEnabledChange(true); 40138 return () => { 40139 isHorizontal ? onScrollbarXEnabledChange(false) : onScrollbarYEnabledChange(false); 40140 }; 40141 }, [isHorizontal, onScrollbarXEnabledChange, onScrollbarYEnabledChange]); 40142 return context.type === "hover" ? /* @__PURE__ */ jsxRuntimeExports.jsx(ScrollAreaScrollbarHover, { ...scrollbarProps, ref: forwardedRef, forceMount }) : context.type === "scroll" ? /* @__PURE__ */ jsxRuntimeExports.jsx(ScrollAreaScrollbarScroll, { ...scrollbarProps, ref: forwardedRef, forceMount }) : context.type === "auto" ? /* @__PURE__ */ jsxRuntimeExports.jsx(ScrollAreaScrollbarAuto, { ...scrollbarProps, ref: forwardedRef, forceMount }) : context.type === "always" ? /* @__PURE__ */ jsxRuntimeExports.jsx(ScrollAreaScrollbarVisible, { ...scrollbarProps, ref: forwardedRef }) : null; 40143 } 40144); 40145ScrollAreaScrollbar.displayName = SCROLLBAR_NAME; 40146var ScrollAreaScrollbarHover = reactExports.forwardRef((props, forwardedRef) => { 40147 const { forceMount, ...scrollbarProps } = props; 40148 const context = useScrollAreaContext(SCROLLBAR_NAME, props.__scopeScrollArea); 40149 const [visible, setVisible] = reactExports.useState(false); 40150 reactExports.useEffect(() => { 40151 const scrollArea = context.scrollArea; 40152 let hideTimer = 0; 40153 if (scrollArea) { 40154 const handlePointerEnter = () => { 40155 window.clearTimeout(hideTimer); 40156 setVisible(true); 40157 }; 40158 const handlePointerLeave = () => { 40159 hideTimer = window.setTimeout(() => setVisible(false), context.scrollHideDelay); 40160 }; 40161 scrollArea.addEventListener("pointerenter", handlePointerEnter); 40162 scrollArea.addEventListener("pointerleave", handlePointerLeave); 40163 return () => { 40164 window.clearTimeout(hideTimer); 40165 scrollArea.removeEventListener("pointerenter", handlePointerEnter); 40166 scrollArea.removeEventListener("pointerleave", handlePointerLeave); 40167 }; 40168 } 40169 }, [context.scrollArea, context.scrollHideDelay]); 40170 return /* @__PURE__ */ jsxRuntimeExports.jsx(Presence, { present: forceMount || visible, children: /* @__PURE__ */ jsxRuntimeExports.jsx( 40171 ScrollAreaScrollbarAuto, 40172 { 40173 "data-state": visible ? "visible" : "hidden", 40174 ...scrollbarProps, 40175 ref: forwardedRef 40176 } 40177 ) }); 40178}); 40179var ScrollAreaScrollbarScroll = reactExports.forwardRef((props, forwardedRef) => { 40180 const { forceMount, ...scrollbarProps } = props; 40181 const context = useScrollAreaContext(SCROLLBAR_NAME, props.__scopeScrollArea); 40182 const isHorizontal = props.orientation === "horizontal"; 40183 const debounceScrollEnd = useDebounceCallback(() => send("SCROLL_END"), 100); 40184 const [state, send] = useStateMachine("hidden", { 40185 hidden: { 40186 SCROLL: "scrolling" 40187 }, 40188 scrolling: { 40189 SCROLL_END: "idle", 40190 POINTER_ENTER: "interacting" 40191 }, 40192 interacting: { 40193 SCROLL: "interacting", 40194 POINTER_LEAVE: "idle" 40195 }, 40196 idle: { 40197 HIDE: "hidden", 40198 SCROLL: "scrolling", 40199 POINTER_ENTER: "interacting" 40200 } 40201 }); 40202 reactExports.useEffect(() => { 40203 if (state === "idle") { 40204 const hideTimer = window.setTimeout(() => send("HIDE"), context.scrollHideDelay); 40205 return () => window.clearTimeout(hideTimer); 40206 } 40207 }, [state, context.scrollHideDelay, send]); 40208 reactExports.useEffect(() => { 40209 const viewport = context.viewport; 40210 const scrollDirection = isHorizontal ? "scrollLeft" : "scrollTop"; 40211 if (viewport) { 40212 let prevScrollPos = viewport[scrollDirection]; 40213 const handleScroll = () => { 40214 const scrollPos = viewport[scrollDirection]; 40215 const hasScrollInDirectionChanged = prevScrollPos !== scrollPos; 40216 if (hasScrollInDirectionChanged) { 40217 send("SCROLL"); 40218 debounceScrollEnd(); 40219 } 40220 prevScrollPos = scrollPos; 40221 }; 40222 viewport.addEventListener("scroll", handleScroll); 40223 return () => viewport.removeEventListener("scroll", handleScroll); 40224 } 40225 }, [context.viewport, isHorizontal, send, debounceScrollEnd]); 40226 return /* @__PURE__ */ jsxRuntimeExports.jsx(Presence, { present: forceMount || state !== "hidden", children: /* @__PURE__ */ jsxRuntimeExports.jsx( 40227 ScrollAreaScrollbarVisible, 40228 { 40229 "data-state": state === "hidden" ? "hidden" : "visible", 40230 ...scrollbarProps, 40231 ref: forwardedRef, 40232 onPointerEnter: composeEventHandlers(props.onPointerEnter, () => send("POINTER_ENTER")), 40233 onPointerLeave: composeEventHandlers(props.onPointerLeave, () => send("POINTER_LEAVE")) 40234 } 40235 ) }); 40236}); 40237var ScrollAreaScrollbarAuto = reactExports.forwardRef((props, forwardedRef) => { 40238 const context = useScrollAreaContext(SCROLLBAR_NAME, props.__scopeScrollArea); 40239 const { forceMount, ...scrollbarProps } = props; 40240 const [visible, setVisible] = reactExports.useState(false); 40241 const isHorizontal = props.orientation === "horizontal"; 40242 const handleResize = useDebounceCallback(() => { 40243 if (context.viewport) { 40244 const isOverflowX = context.viewport.offsetWidth < context.viewport.scrollWidth; 40245 const isOverflowY = context.viewport.offsetHeight < context.viewport.scrollHeight; 40246 setVisible(isHorizontal ? isOverflowX : isOverflowY); 40247 } 40248 }, 10); 40249 useResizeObserver(context.viewport, handleResize); 40250 useResizeObserver(context.content, handleResize); 40251 return /* @__PURE__ */ jsxRuntimeExports.jsx(Presence, { present: forceMount || visible, children: /* @__PURE__ */ jsxRuntimeExports.jsx( 40252 ScrollAreaScrollbarVisible, 40253 { 40254 "data-state": visible ? "visible" : "hidden", 40255 ...scrollbarProps, 40256 ref: forwardedRef 40257 } 40258 ) }); 40259}); 40260var ScrollAreaScrollbarVisible = reactExports.forwardRef((props, forwardedRef) => { 40261 const { orientation = "vertical", ...scrollbarProps } = props; 40262 const context = useScrollAreaContext(SCROLLBAR_NAME, props.__scopeScrollArea); 40263 const thumbRef = reactExports.useRef(null); 40264 const pointerOffsetRef = reactExports.useRef(0); 40265 const [sizes, setSizes] = reactExports.useState({ 40266 content: 0, 40267 viewport: 0, 40268 scrollbar: { size: 0, paddingStart: 0, paddingEnd: 0 } 40269 }); 40270 const thumbRatio = getThumbRatio(sizes.viewport, sizes.content); 40271 const commonProps = { 40272 ...scrollbarProps, 40273 sizes, 40274 onSizesChange: setSizes, 40275 hasThumb: Boolean(thumbRatio > 0 && thumbRatio < 1), 40276 onThumbChange: (thumb) => thumbRef.current = thumb, 40277 onThumbPointerUp: () => pointerOffsetRef.current = 0, 40278 onThumbPointerDown: (pointerPos) => pointerOffsetRef.current = pointerPos 40279 }; 40280 function getScrollPosition(pointerPos, dir) { 40281 return getScrollPositionFromPointer(pointerPos, pointerOffsetRef.current, sizes, dir); 40282 } 40283 if (orientation === "horizontal") { 40284 return /* @__PURE__ */ jsxRuntimeExports.jsx( 40285 ScrollAreaScrollbarX, 40286 { 40287 ...commonProps, 40288 ref: forwardedRef, 40289 onThumbPositionChange: () => { 40290 if (context.viewport && thumbRef.current) { 40291 const scrollPos = context.viewport.scrollLeft; 40292 const offset = getThumbOffsetFromScroll(scrollPos, sizes, context.dir); 40293 thumbRef.current.style.transform = `translate3d(${offset}px, 0, 0)`; 40294 } 40295 }, 40296 onWheelScroll: (scrollPos) => { 40297 if (context.viewport) context.viewport.scrollLeft = scrollPos; 40298 }, 40299 onDragScroll: (pointerPos) => { 40300 if (context.viewport) { 40301 context.viewport.scrollLeft = getScrollPosition(pointerPos, context.dir); 40302 } 40303 } 40304 } 40305 ); 40306 } 40307 if (orientation === "vertical") { 40308 return /* @__PURE__ */ jsxRuntimeExports.jsx( 40309 ScrollAreaScrollbarY, 40310 { 40311 ...commonProps, 40312 ref: forwardedRef, 40313 onThumbPositionChange: () => { 40314 if (context.viewport && thumbRef.current) { 40315 const scrollPos = context.viewport.scrollTop; 40316 const offset = getThumbOffsetFromScroll(scrollPos, sizes); 40317 thumbRef.current.style.transform = `translate3d(0, ${offset}px, 0)`; 40318 } 40319 }, 40320 onWheelScroll: (scrollPos) => { 40321 if (context.viewport) context.viewport.scrollTop = scrollPos; 40322 }, 40323 onDragScroll: (pointerPos) => { 40324 if (context.viewport) context.viewport.scrollTop = getScrollPosition(pointerPos); 40325 } 40326 } 40327 ); 40328 } 40329 return null; 40330}); 40331var ScrollAreaScrollbarX = reactExports.forwardRef((props, forwardedRef) => { 40332 const { sizes, onSizesChange, ...scrollbarProps } = props; 40333 const context = useScrollAreaContext(SCROLLBAR_NAME, props.__scopeScrollArea); 40334 const [computedStyle, setComputedStyle] = reactExports.useState(); 40335 const ref = reactExports.useRef(null); 40336 const composeRefs = useComposedRefs(forwardedRef, ref, context.onScrollbarXChange); 40337 reactExports.useEffect(() => { 40338 if (ref.current) setComputedStyle(getComputedStyle(ref.current)); 40339 }, [ref]); 40340 return /* @__PURE__ */ jsxRuntimeExports.jsx( 40341 ScrollAreaScrollbarImpl, 40342 { 40343 "data-orientation": "horizontal", 40344 ...scrollbarProps, 40345 ref: composeRefs, 40346 sizes, 40347 style: { 40348 bottom: 0, 40349 left: context.dir === "rtl" ? "var(--radix-scroll-area-corner-width)" : 0, 40350 right: context.dir === "ltr" ? "var(--radix-scroll-area-corner-width)" : 0, 40351 ["--radix-scroll-area-thumb-width"]: getThumbSize(sizes) + "px", 40352 ...props.style 40353 }, 40354 onThumbPointerDown: (pointerPos) => props.onThumbPointerDown(pointerPos.x), 40355 onDragScroll: (pointerPos) => props.onDragScroll(pointerPos.x), 40356 onWheelScroll: (event, maxScrollPos) => { 40357 if (context.viewport) { 40358 const scrollPos = context.viewport.scrollLeft + event.deltaX; 40359 props.onWheelScroll(scrollPos); 40360 if (isScrollingWithinScrollbarBounds(scrollPos, maxScrollPos)) { 40361 event.preventDefault(); 40362 } 40363 } 40364 }, 40365 onResize: () => { 40366 if (ref.current && context.viewport && computedStyle) { 40367 onSizesChange({ 40368 content: context.viewport.scrollWidth, 40369 viewport: context.viewport.offsetWidth, 40370 scrollbar: { 40371 size: ref.current.clientWidth, 40372 paddingStart: toInt(computedStyle.paddingLeft), 40373 paddingEnd: toInt(computedStyle.paddingRight) 40374 } 40375 }); 40376 } 40377 } 40378 } 40379 ); 40380}); 40381var ScrollAreaScrollbarY = reactExports.forwardRef((props, forwardedRef) => { 40382 const { sizes, onSizesChange, ...scrollbarProps } = props; 40383 const context = useScrollAreaContext(SCROLLBAR_NAME, props.__scopeScrollArea); 40384 const [computedStyle, setComputedStyle] = reactExports.useState(); 40385 const ref = reactExports.useRef(null); 40386 const composeRefs = useComposedRefs(forwardedRef, ref, context.onScrollbarYChange); 40387 reactExports.useEffect(() => { 40388 if (ref.current) setComputedStyle(getComputedStyle(ref.current)); 40389 }, [ref]); 40390 return /* @__PURE__ */ jsxRuntimeExports.jsx( 40391 ScrollAreaScrollbarImpl, 40392 { 40393 "data-orientation": "vertical", 40394 ...scrollbarProps, 40395 ref: composeRefs, 40396 sizes, 40397 style: { 40398 top: 0, 40399 right: context.dir === "ltr" ? 0 : void 0, 40400 left: context.dir === "rtl" ? 0 : void 0, 40401 bottom: "var(--radix-scroll-area-corner-height)", 40402 ["--radix-scroll-area-thumb-height"]: getThumbSize(sizes) + "px", 40403 ...props.style 40404 }, 40405 onThumbPointerDown: (pointerPos) => props.onThumbPointerDown(pointerPos.y), 40406 onDragScroll: (pointerPos) => props.onDragScroll(pointerPos.y), 40407 onWheelScroll: (event, maxScrollPos) => { 40408 if (context.viewport) { 40409 const scrollPos = context.viewport.scrollTop + event.deltaY; 40410 props.onWheelScroll(scrollPos); 40411 if (isScrollingWithinScrollbarBounds(scrollPos, maxScrollPos)) { 40412 event.preventDefault(); 40413 } 40414 } 40415 }, 40416 onResize: () => { 40417 if (ref.current && context.viewport && computedStyle) { 40418 onSizesChange({ 40419 content: context.viewport.scrollHeight, 40420 viewport: context.viewport.offsetHeight, 40421 scrollbar: { 40422 size: ref.current.clientHeight, 40423 paddingStart: toInt(computedStyle.paddingTop), 40424 paddingEnd: toInt(computedStyle.paddingBottom) 40425 } 40426 }); 40427 } 40428 } 40429 } 40430 ); 40431}); 40432var [ScrollbarProvider, useScrollbarContext] = createScrollAreaContext(SCROLLBAR_NAME); 40433var ScrollAreaScrollbarImpl = reactExports.forwardRef((props, forwardedRef) => { 40434 const { 40435 __scopeScrollArea, 40436 sizes, 40437 hasThumb, 40438 onThumbChange, 40439 onThumbPointerUp, 40440 onThumbPointerDown, 40441 onThumbPositionChange, 40442 onDragScroll, 40443 onWheelScroll, 40444 onResize, 40445 ...scrollbarProps 40446 } = props; 40447 const context = useScrollAreaContext(SCROLLBAR_NAME, __scopeScrollArea); 40448 const [scrollbar, setScrollbar] = reactExports.useState(null); 40449 const composeRefs = useComposedRefs(forwardedRef, (node) => setScrollbar(node)); 40450 const rectRef = reactExports.useRef(null); 40451 const prevWebkitUserSelectRef = reactExports.useRef(""); 40452 const viewport = context.viewport; 40453 const maxScrollPos = sizes.content - sizes.viewport; 40454 const handleWheelScroll = useCallbackRef$1(onWheelScroll); 40455 const handleThumbPositionChange = useCallbackRef$1(onThumbPositionChange); 40456 const handleResize = useDebounceCallback(onResize, 10); 40457 function handleDragScroll(event) { 40458 if (rectRef.current) { 40459 const x = event.clientX - rectRef.current.left; 40460 const y = event.clientY - rectRef.current.top; 40461 onDragScroll({ x, y }); 40462 } 40463 } 40464 reactExports.useEffect(() => { 40465 const handleWheel = (event) => { 40466 const element = event.target; 40467 const isScrollbarWheel = scrollbar?.contains(element); 40468 if (isScrollbarWheel) handleWheelScroll(event, maxScrollPos); 40469 }; 40470 document.addEventListener("wheel", handleWheel, { passive: false }); 40471 return () => document.removeEventListener("wheel", handleWheel, { passive: false }); 40472 }, [viewport, scrollbar, maxScrollPos, handleWheelScroll]); 40473 reactExports.useEffect(handleThumbPositionChange, [sizes, handleThumbPositionChange]); 40474 useResizeObserver(scrollbar, handleResize); 40475 useResizeObserver(context.content, handleResize); 40476 return /* @__PURE__ */ jsxRuntimeExports.jsx( 40477 ScrollbarProvider, 40478 { 40479 scope: __scopeScrollArea, 40480 scrollbar, 40481 hasThumb, 40482 onThumbChange: useCallbackRef$1(onThumbChange), 40483 onThumbPointerUp: useCallbackRef$1(onThumbPointerUp), 40484 onThumbPositionChange: handleThumbPositionChange, 40485 onThumbPointerDown: useCallbackRef$1(onThumbPointerDown), 40486 children: /* @__PURE__ */ jsxRuntimeExports.jsx( 40487 Primitive.div, 40488 { 40489 ...scrollbarProps, 40490 ref: composeRefs, 40491 style: { position: "absolute", ...scrollbarProps.style }, 40492 onPointerDown: composeEventHandlers(props.onPointerDown, (event) => { 40493 const mainPointer = 0; 40494 if (event.button === mainPointer) { 40495 const element = event.target; 40496 element.setPointerCapture(event.pointerId); 40497 rectRef.current = scrollbar.getBoundingClientRect(); 40498 prevWebkitUserSelectRef.current = document.body.style.webkitUserSelect; 40499 document.body.style.webkitUserSelect = "none"; 40500 if (context.viewport) context.viewport.style.scrollBehavior = "auto"; 40501 handleDragScroll(event); 40502 } 40503 }), 40504 onPointerMove: composeEventHandlers(props.onPointerMove, handleDragScroll), 40505 onPointerUp: composeEventHandlers(props.onPointerUp, (event) => { 40506 const element = event.target; 40507 if (element.hasPointerCapture(event.pointerId)) { 40508 element.releasePointerCapture(event.pointerId); 40509 } 40510 document.body.style.webkitUserSelect = prevWebkitUserSelectRef.current; 40511 if (context.viewport) context.viewport.style.scrollBehavior = ""; 40512 rectRef.current = null; 40513 }) 40514 } 40515 ) 40516 } 40517 ); 40518}); 40519var THUMB_NAME = "ScrollAreaThumb"; 40520var ScrollAreaThumb = reactExports.forwardRef( 40521 (props, forwardedRef) => { 40522 const { forceMount, ...thumbProps } = props; 40523 const scrollbarContext = useScrollbarContext(THUMB_NAME, props.__scopeScrollArea); 40524 return /* @__PURE__ */ jsxRuntimeExports.jsx(Presence, { present: forceMount || scrollbarContext.hasThumb, children: /* @__PURE__ */ jsxRuntimeExports.jsx(ScrollAreaThumbImpl, { ref: forwardedRef, ...thumbProps }) }); 40525 } 40526); 40527var ScrollAreaThumbImpl = reactExports.forwardRef( 40528 (props, forwardedRef) => { 40529 const { __scopeScrollArea, style, ...thumbProps } = props; 40530 const scrollAreaContext = useScrollAreaContext(THUMB_NAME, __scopeScrollArea); 40531 const scrollbarContext = useScrollbarContext(THUMB_NAME, __scopeScrollArea); 40532 const { onThumbPositionChange } = scrollbarContext; 40533 const composedRef = useComposedRefs( 40534 forwardedRef, 40535 (node) => scrollbarContext.onThumbChange(node) 40536 ); 40537 const removeUnlinkedScrollListenerRef = reactExports.useRef(void 0); 40538 const debounceScrollEnd = useDebounceCallback(() => { 40539 if (removeUnlinkedScrollListenerRef.current) { 40540 removeUnlinkedScrollListenerRef.current(); 40541 removeUnlinkedScrollListenerRef.current = void 0; 40542 } 40543 }, 100); 40544 reactExports.useEffect(() => { 40545 const viewport = scrollAreaContext.viewport; 40546 if (viewport) { 40547 const handleScroll = () => { 40548 debounceScrollEnd(); 40549 if (!removeUnlinkedScrollListenerRef.current) { 40550 const listener = addUnlinkedScrollListener(viewport, onThumbPositionChange); 40551 removeUnlinkedScrollListenerRef.current = listener; 40552 onThumbPositionChange(); 40553 } 40554 }; 40555 onThumbPositionChange(); 40556 viewport.addEventListener("scroll", handleScroll); 40557 return () => viewport.removeEventListener("scroll", handleScroll); 40558 } 40559 }, [scrollAreaContext.viewport, debounceScrollEnd, onThumbPositionChange]); 40560 return /* @__PURE__ */ jsxRuntimeExports.jsx( 40561 Primitive.div, 40562 { 40563 "data-state": scrollbarContext.hasThumb ? "visible" : "hidden", 40564 ...thumbProps, 40565 ref: composedRef, 40566 style: { 40567 width: "var(--radix-scroll-area-thumb-width)", 40568 height: "var(--radix-scroll-area-thumb-height)", 40569 ...style 40570 }, 40571 onPointerDownCapture: composeEventHandlers(props.onPointerDownCapture, (event) => { 40572 const thumb = event.target; 40573 const thumbRect = thumb.getBoundingClientRect(); 40574 const x = event.clientX - thumbRect.left; 40575 const y = event.clientY - thumbRect.top; 40576 scrollbarContext.onThumbPointerDown({ x, y }); 40577 }), 40578 onPointerUp: composeEventHandlers(props.onPointerUp, scrollbarContext.onThumbPointerUp) 40579 } 40580 ); 40581 } 40582); 40583ScrollAreaThumb.displayName = THUMB_NAME; 40584var CORNER_NAME = "ScrollAreaCorner"; 40585var ScrollAreaCorner = reactExports.forwardRef( 40586 (props, forwardedRef) => { 40587 const context = useScrollAreaContext(CORNER_NAME, props.__scopeScrollArea); 40588 const hasBothScrollbarsVisible = Boolean(context.scrollbarX && context.scrollbarY); 40589 const hasCorner = context.type !== "scroll" && hasBothScrollbarsVisible; 40590 return hasCorner ? /* @__PURE__ */ jsxRuntimeExports.jsx(ScrollAreaCornerImpl, { ...props, ref: forwardedRef }) : null; 40591 } 40592); 40593ScrollAreaCorner.displayName = CORNER_NAME; 40594var ScrollAreaCornerImpl = reactExports.forwardRef((props, forwardedRef) => { 40595 const { __scopeScrollArea, ...cornerProps } = props; 40596 const context = useScrollAreaContext(CORNER_NAME, __scopeScrollArea); 40597 const [width, setWidth] = reactExports.useState(0); 40598 const [height, setHeight] = reactExports.useState(0); 40599 const hasSize = Boolean(width && height); 40600 useResizeObserver(context.scrollbarX, () => { 40601 const height2 = context.scrollbarX?.offsetHeight || 0; 40602 context.onCornerHeightChange(height2); 40603 setHeight(height2); 40604 }); 40605 useResizeObserver(context.scrollbarY, () => { 40606 const width2 = context.scrollbarY?.offsetWidth || 0; 40607 context.onCornerWidthChange(width2); 40608 setWidth(width2); 40609 }); 40610 return hasSize ? /* @__PURE__ */ jsxRuntimeExports.jsx( 40611 Primitive.div, 40612 { 40613 ...cornerProps, 40614 ref: forwardedRef, 40615 style: { 40616 width, 40617 height, 40618 position: "absolute", 40619 right: context.dir === "ltr" ? 0 : void 0, 40620 left: context.dir === "rtl" ? 0 : void 0, 40621 bottom: 0, 40622 ...props.style 40623 } 40624 } 40625 ) : null; 40626}); 40627function toInt(value) { 40628 return value ? parseInt(value, 10) : 0; 40629} 40630function getThumbRatio(viewportSize, contentSize) { 40631 const ratio = viewportSize / contentSize; 40632 return isNaN(ratio) ? 0 : ratio; 40633} 40634function getThumbSize(sizes) { 40635 const ratio = getThumbRatio(sizes.viewport, sizes.content); 40636 const scrollbarPadding = sizes.scrollbar.paddingStart + sizes.scrollbar.paddingEnd; 40637 const thumbSize = (sizes.scrollbar.size - scrollbarPadding) * ratio; 40638 return Math.max(thumbSize, 18); 40639} 40640function getScrollPositionFromPointer(pointerPos, pointerOffset, sizes, dir = "ltr") { 40641 const thumbSizePx = getThumbSize(sizes); 40642 const thumbCenter = thumbSizePx / 2; 40643 const offset = pointerOffset || thumbCenter; 40644 const thumbOffsetFromEnd = thumbSizePx - offset; 40645 const minPointerPos = sizes.scrollbar.paddingStart + offset; 40646 const maxPointerPos = sizes.scrollbar.size - sizes.scrollbar.paddingEnd - thumbOffsetFromEnd; 40647 const maxScrollPos = sizes.content - sizes.viewport; 40648 const scrollRange = dir === "ltr" ? [0, maxScrollPos] : [maxScrollPos * -1, 0]; 40649 const interpolate = linearScale([minPointerPos, maxPointerPos], scrollRange); 40650 return interpolate(pointerPos); 40651} 40652function getThumbOffsetFromScroll(scrollPos, sizes, dir = "ltr") { 40653 const thumbSizePx = getThumbSize(sizes); 40654 const scrollbarPadding = sizes.scrollbar.paddingStart + sizes.scrollbar.paddingEnd; 40655 const scrollbar = sizes.scrollbar.size - scrollbarPadding; 40656 const maxScrollPos = sizes.content - sizes.viewport; 40657 const maxThumbPos = scrollbar - thumbSizePx; 40658 const scrollClampRange = dir === "ltr" ? [0, maxScrollPos] : [maxScrollPos * -1, 0]; 40659 const scrollWithoutMomentum = clamp(scrollPos, scrollClampRange); 40660 const interpolate = linearScale([0, maxScrollPos], [0, maxThumbPos]); 40661 return interpolate(scrollWithoutMomentum); 40662} 40663function linearScale(input, output) { 40664 return (value) => { 40665 if (input[0] === input[1] || output[0] === output[1]) return output[0]; 40666 const ratio = (output[1] - output[0]) / (input[1] - input[0]); 40667 return output[0] + ratio * (value - input[0]); 40668 }; 40669} 40670function isScrollingWithinScrollbarBounds(scrollPos, maxScrollPos) { 40671 return scrollPos > 0 && scrollPos < maxScrollPos; 40672} 40673var addUnlinkedScrollListener = (node, handler = () => { 40674}) => { 40675 let prevPosition = { left: node.scrollLeft, top: node.scrollTop }; 40676 let rAF = 0; 40677 (function loop() { 40678 const position = { left: node.scrollLeft, top: node.scrollTop }; 40679 const isHorizontalScroll = prevPosition.left !== position.left; 40680 const isVerticalScroll = prevPosition.top !== position.top; 40681 if (isHorizontalScroll || isVerticalScroll) handler(); 40682 prevPosition = position; 40683 rAF = window.requestAnimationFrame(loop); 40684 })(); 40685 return () => window.cancelAnimationFrame(rAF); 40686}; 40687function useDebounceCallback(callback, delay) { 40688 const handleCallback = useCallbackRef$1(callback); 40689 const debounceTimerRef = reactExports.useRef(0); 40690 reactExports.useEffect(() => () => window.clearTimeout(debounceTimerRef.current), []); 40691 return reactExports.useCallback(() => { 40692 window.clearTimeout(debounceTimerRef.current); 40693 debounceTimerRef.current = window.setTimeout(handleCallback, delay); 40694 }, [handleCallback, delay]); 40695} 40696function useResizeObserver(element, onResize) { 40697 const handleResize = useCallbackRef$1(onResize); 40698 useLayoutEffect2(() => { 40699 let rAF = 0; 40700 if (element) { 40701 const resizeObserver = new ResizeObserver(() => { 40702 cancelAnimationFrame(rAF); 40703 rAF = window.requestAnimationFrame(handleResize); 40704 }); 40705 resizeObserver.observe(element); 40706 return () => { 40707 window.cancelAnimationFrame(rAF); 40708 resizeObserver.unobserve(element); 40709 }; 40710 } 40711 }, [element, handleResize]); 40712} 40713var Root$1 = ScrollArea$1; 40714var Viewport = ScrollAreaViewport; 40715var Corner = ScrollAreaCorner; 40716 40717function ScrollArea({ 40718 className, 40719 children, 40720 ...props 40721}) { 40722 return /* @__PURE__ */ jsxRuntimeExports.jsxs( 40723 Root$1, 40724 { 40725 "data-slot": "scroll-area", 40726 className: cn("relative", className), 40727 ...props, 40728 children: [
40729 /* @__PURE__ */ jsxRuntimeExports.jsx( 40730 Viewport, 40731 { 40732 "data-slot": "scroll-area-viewport", 40733 className: "focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1", 40734 children 40735 } 40736 ), 40737 /* @__PURE__ */ jsxRuntimeExports.jsx(ScrollBar, {}), 40738 /* @__PURE__ */ jsxRuntimeExports.jsx(Corner, {}) 40739 ] 40740 } 40741 ); 40742} 40743function ScrollBar({ 40744 className, 40745 orientation = "vertical", 40746 ...props 40747}) { 40748 return /* @__PURE__ */ jsxRuntimeExports.jsx( 40749 ScrollAreaScrollbar, 40750 { 40751 "data-slot": "scroll-area-scrollbar", 40752 orientation, 40753 className: cn( 40754 "flex touch-none p-px transition-colors select-none", 40755 orientation === "vertical" && "h-full w-2.5 border-l border-l-transparent", 40756 orientation === "horizontal" && "h-2.5 flex-col border-t border-t-transparent", 40757 className 40758 ), 40759 ...props, 40760 children: /* @__PURE__ */ jsxRuntimeExports.jsx( 40761 ScrollAreaThumb, 40762 { 40763 "data-slot": "scroll-area-thumb", 40764 className: "bg-border relative flex-1 rounded-full" 40765 } 40766 ) 40767 } 40768 ); 40769} 40770 40771function USFlag({ size = 24, className = "" }) { 40772 return /* @__PURE__ */ jsxRuntimeExports.jsx( 40773 "img", 40774 { 40775 src: "/manus-storage/us-flag_84593f5e.svg", 40776 alt: "US Flag", 40777 width: size * 1.9, 40778 height: size, 40779 className: `inline-block align-middle flex-shrink-0 ${className}`, 40780 style: { borderRadius: 2 } 40781 } 40782 ); 40783} 40784 40785const IDLE_TIMEOUT_MS = 30 * 60 * 1e3; 40786const COUNTDOWN_MS = 5 * 60 * 1e3; 40787const ACTIVITY_EVENTS = [ 40788 "mousemove", 40789 "mousedown", 40790 "keydown", 40791 "touchstart", 40792 "scroll" 40793]; 40794function SessionTimeoutWarning({ 40795 isAuthenticated, 40796 onLogout, 40797 isAgentSession = false 40798}) { 40799 const [showModal, setShowModal] = reactExports.useState(false); 40800 const [secondsLeft, setSecondsLeft] = reactExports.useState(Math.floor(COUNTDOWN_MS / 1e3)); 40801 const idleTimerRef = reactExports.useRef(null); 40802 const countdownIntervalRef = reactExports.useRef(null); 40803 useLocation(); 40804 const meQuery = trpc.agentAuth.me.useQuery(void 0, { 40805 enabled: false, 40806 // only called manually 40807 retry: false 40808 }); 40809 const clearTimers = reactExports.useCallback(() => { 40810 if (idleTimerRef.current) clearTimeout(idleTimerRef.current); 40811 if (countdownIntervalRef.current) clearInterval(countdownIntervalRef.current); 40812 }, []); 40813 const startCountdown = reactExports.useCallback(() => { 40814 setSecondsLeft(Math.floor(COUNTDOWN_MS / 1e3)); 40815 setShowModal(true); 40816 countdownIntervalRef.current = setInterval(() => { 40817 setSecondsLeft((prev) => { 40818 if (prev <= 1) { 40819 clearTimers(); 40820 onLogout(); 40821 return 0; 40822 } 40823 return prev - 1; 40824 }); 40825 }, 1e3); 40826 }, [clearTimers, onLogout]); 40827 const resetIdleTimer = reactExports.useCallback(() => { 40828 if (!isAuthenticated) return; 40829 clearTimers(); 40830 setShowModal(false); 40831 idleTimerRef.current = setTimeout(() => { 40832 startCountdown(); 40833 }, IDLE_TIMEOUT_MS); 40834 }, [isAuthenticated, clearTimers, startCountdown]); 40835 reactExports.useEffect(() => { 40836 if (!isAuthenticated) { 40837 clearTimers(); 40838 setShowModal(false); 40839 return; 40840 } 40841 resetIdleTimer(); 40842 return () => clearTimers(); 40843 }, [isAuthenticated]); 40844 reactExports.useEffect(() => { 40845 if (!isAuthenticated) return; 40846 const handleActivity = () => { 40847 if (!showModal) resetIdleTimer(); 40848 }; 40849 ACTIVITY_EVENTS.forEach( 40850 (evt) => window.addEventListener(evt, handleActivity, { passive: true }) 40851 ); 40852 return () => { 40853 ACTIVITY_EVENTS.forEach( 40854 (evt) => window.removeEventListener(evt, handleActivity) 40855 ); 40856 }; 40857 }, [isAuthenticated, showModal, resetIdleTimer]); 40858 const handleStayLoggedIn = reactExports.useCallback(async () => { 40859 clearTimers(); 40860 setShowModal(false); 40861 try { 40862 await meQuery.refetch(); 40863 } catch { 40864 onLogout(); 40865 return; 40866 } 40867 resetIdleTimer(); 40868 }, [clearTimers, meQuery, onLogout, resetIdleTimer]); 40869 const handleLogout = reactExports.useCallback(() => { 40870 clearTimers(); 40871 setShowModal(false); 40872 onLogout(); 40873 }, [clearTimers, onLogout]); 40874 if (!showModal) return null; 40875 const minutes = Math.floor(secondsLeft / 60); 40876 const seconds = secondsLeft % 60; 40877 const timeStr = minutes > 0 ? `${minutes}:${String(seconds).padStart(2, "0")}` : `${seconds}s`; 40878 return /* @__PURE__ */ jsxRuntimeExports.jsx( 40879 "div", 40880 { 40881 className: "fixed inset-0 z-[9999] flex items-center justify-center", 40882 style: { backgroundColor: "rgba(0,0,0,0.55)" }, 40883 role: "dialog", 40884 "aria-modal": "true", 40885 "aria-labelledby": "session-timeout-title", 40886 children: /* @__PURE__ */ jsxRuntimeExports.jsxs( 40887 "div", 40888 { 40889 className: "bg-white rounded-lg shadow-2xl max-w-sm w-full mx-4 overflow-hidden", 40890 style: { border: "2px solid #B22234" }, 40891 children: [
40892 /* @__PURE__ */ jsxRuntimeExports.jsxs( 40893 "div", 40894 { 40895 className: "px-6 py-4 flex items-center gap-3", 40896 style: { backgroundColor: "#1B3A6B" }, 40897 children: [ 40898 /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-2xl", role: "img", "aria-label": "warning", children: "â ï¸" }), 40899 /* @__PURE__ */ jsxRuntimeExports.jsx( 40900 "h2", 40901 { 40902 id: "session-timeout-title", 40903 className: "text-white font-bold text-lg leading-tight", 40904 children: "Session About to Expire" 40905 } 40906 ) 40907 ] 40908 } 40909 ), 40910 /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "px-6 py-5", children: [ 40911 /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-gray-700 text-sm leading-relaxed mb-4", children: "You have been inactive for a while. For your security, your session will automatically end in:" }),
40912 /* @__PURE__ */ jsxRuntimeExports.jsx( 40913 "div", 40914 { 40915 className: "text-center py-3 mb-5 rounded-md font-mono font-bold text-3xl", 40916 style: { 40917 backgroundColor: secondsLeft <= 60 ? "#FEF2F2" : "#EFF6FF", 40918 color: secondsLeft <= 60 ? "#B22234" : "#1B3A6B" 40919 }, 40920 children: timeStr 40921 } 40922 ), 40923 /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-gray-500 text-xs mb-5", children: [ 40924 "Click ", 40925 /* @__PURE__ */ jsxRuntimeExports.jsx("strong", { children: "Stay Logged In" }), 40926 " to continue your session, or", 40927 " ", 40928 /* @__PURE__ */ jsxRuntimeExports.jsx("strong", { children: "Log Out" }), 40929 " to end it now." 40930 ] }), 40931 /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex gap-3", children: [ 40932 /* @__PURE__ */ jsxRuntimeExports.jsx( 40933 "button", 40934 { 40935 onClick: handleStayLoggedIn, 40936 className: "flex-1 py-2.5 px-4 rounded-md text-sm font-semibold text-white transition-opacity hover:opacity-90 focus:outline-none focus:ring-2 focus:ring-offset-2", 40937 style: { backgroundColor: "#1B3A6B" }, 40938 children: "Stay Logged In" 40939 } 40940 ),
40941 /* @__PURE__ */ jsxRuntimeExports.jsx( 40942 "button", 40943 { 40944 onClick: handleLogout, 40945 className: "flex-1 py-2.5 px-4 rounded-md text-sm font-semibold border transition-colors hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-gray-400", 40946 style: { borderColor: "#B22234", color: "#B22234" }, 40947 children: "Log Out" 40948 } 40949 ) 40950 ] }) 40951 ] }) 40952 ] 40953 } 40954 ) 40955 } 40956 ); 40957} 40958 40959const NAV_ITEMS = [ 40960 { path: "/", label: "Command Center", icon: LayoutDashboard, pinned: true }, 40961 { path: "/onboarding", label: "Onboarding & Sales Pipeline", icon: UserPlus, agent: "Onboarding & Sales Pipeline" }, 40962 { path: "/quoting", label: "Quote Comparison", icon: FileSearch, agent: "Quote Comparison" }, 40963 { path: "/admin/policy-changes", label: "Policy Changes", icon: ClipboardList, adminOnly: true }, 40964 { path: "/carrier-info", label: "Carrier Info", icon: Building2, agent: "Carrier Info" }, 40965 { path: "/insights", label: "Product & Appetite Guides", icon: ChartColumn, agent: "Product & Appetite Guides" }, 40966 { path: "/scripts", label: "Scripts & Templates", icon: BookOpen, agent: "Scripts & Templates" }, 40967 { path: "/admin/payments", label: "Escrow Payments", icon: Wallet, adminOnly: true }, 40968 { path: "/admin/claims", label: "Claims", icon: CircleAlert, adminOnly: true }, 40969 { path: "/acord-forms", label: "ACORD Forms & Applications", icon: FileCheck, agent: "ACORD Forms & Applications" }, 40970 { path: "/commissions", label: "Commissions", icon: DollarSign, agent: "Commissions", adminOnly: true }, 40971 { path: "/production", label: "Production Reports", icon: TrendingUp, agent: "Production Reports", adminOnly: true }, 40972 { path: "/marketing", label: "Marketing", icon: Megaphone, agent: "Marketing" }, 40973 { path: "/new-business", label: "New Business", icon: FileSpreadsheet, adminOnly: true }, 40974 { path: "/google-reviews", label: "Google Reviews", icon: Star, adminOnly: true }, 40975 { path: "/renewals", label: "Renewals", icon: RefreshCcw, agent: "Renewals" }, 40976 { path: "/celebrations", label: "Birthdays & Anniversaries", icon: Gift }, 40977 { path: "/client-directory", label: "Client Email Directory", icon: BookUser, adminOnly: true }, 40978 { path: "/messages", label: "Agent Messages", icon: MessageSquare }, 40979 { path: "/admin/agents", label: "Agent Accounts", icon: Users, adminOnly: true }, 40980 { path: "/admin/suggestions", label: "Suggestions", icon: Lightbulb, adminOnly: true } 40981]; 40982const STATUS_DOT = { 40983 active: "bg-green-400 animate-pulse", 40984 idle: "bg-slate-400", 40985 error: "bg-red-400 animate-pulse", 40986 processing: "bg-yellow-400 animate-pulse" 40987}; 40988const ADMIN_AGENT_KEYS = ["stacey-hinkle", "greg-fay", "ryan-fay", "josh-hinkle"]; 40989function applyOrder$1(baseItems, savedOrder) { 40990 if (!savedOrder || savedOrder.length === 0) return baseItems; 40991 const pinned = baseItems.filter((i) => i.pinned); 40992 const draggable = baseItems.filter((i) => !i.pinned); 40993 const byPath = new Map(draggable.map((i) => [i.path, i])); 40994 const ordered = []; 40995 for (const path of savedOrder) { 40996 const item = byPath.get(path); 40997 if (item) { 40998 ordered.push(item); 40999 byPath.delete(path); 41000 } 41001 } 41002 byPath.forEach((item) => ordered.push(item)); 41003 return [...pinned, ...ordered]; 41004} 41005function SortableNavItem$1({ 41006 item, 41007 active, 41008 collapsed, 41009 reorderMode, 41010 hidden, 41011 agentStatus, 41012 needsLogin, 41013 shakingPath, 41014 onToggleHide, 41015 onClick 41016}) { 41017 const { 41018 attributes, 41019 listeners, 41020 setNodeRef, 41021 transform, 41022 transition, 41023 isDragging 41024 } = useSortable({ id: item.path, disabled: item.pinned || !reorderMode }); 41025 const style = { 41026 transform: CSS$1.Transform.toString(transform), 41027 transition, 41028 opacity: isDragging ? 0.4 : 1, 41029 zIndex: isDragging ? 50 : void 0 41030 }; 41031 const Icon = item.icon; 41032 const isDraggable = reorderMode && !item.pinned; 41033 if (reorderMode) { 41034 return /* @__PURE__ */ jsxRuntimeExports.jsx( 41035 "div", 41036 { 41037 ref: setNodeRef, 41038 style,
41039 className: cn("relative", isDraggable && "cursor-grab active:cursor-grabbing select-none"), 41040 ...isDraggable ? { ...attributes, ...listeners } : {}, 41041 children: /* @__PURE__ */ jsxRuntimeExports.jsxs( 41042 "div", 41043 { 41044 className: cn( 41045 "w-full flex items-center gap-3 px-4 py-2.5 mx-0 rounded-lg text-sm font-medium", 41046 hidden ? "text-white/25" : "text-white/60", 41047 isDragging && "shadow-2xl" 41048 ), 41049 style: isDragging ? { background: "var(--eps-navy-mid)" } : void 0, 41050 children: [ 41051 !item.pinned && !collapsed && /* @__PURE__ */ jsxRuntimeExports.jsx(GripVertical, { className: "w-4 h-4 flex-shrink-0 text-white/40" }), 41052 /* @__PURE__ */ jsxRuntimeExports.jsx(Icon, { className: cn("w-4 h-4 flex-shrink-0", hidden && "opacity-30") }), 41053 !collapsed && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: cn("truncate flex-1 text-left", hidden && "line-through opacity-30"), children: item.label }),
41054 item.pinned && !collapsed && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-[9px] text-white/30 font-normal ml-auto flex-shrink-0", children: "pinned" }), 41055 !item.pinned && !collapsed && /* @__PURE__ */ jsxRuntimeExports.jsx( 41056 "button", 41057 { 41058 onPointerDown: (e) => e.stopPropagation(), 41059 onClick: (e) => { 41060 e.stopPropagation(); 41061 onToggleHide(); 41062 }, 41063 className: cn( 41064 "ml-auto p-1 rounded transition-colors flex-shrink-0", 41065 hidden ? "text-white/30 hover:text-white/60" : "text-white/50 hover:text-[#B22234]" 41066 ), 41067 title: hidden ? "Show in sidebar" : "Hide from sidebar", 41068 children: hidden ? /* @__PURE__ */ jsxRuntimeExports.jsx(EyeOff, { className: "w-3.5 h-3.5" }) : /* @__PURE__ */ jsxRuntimeExports.jsx(Eye, { className: "w-3.5 h-3.5" }) 41069 } 41070 ) 41071 ] 41072 } 41073 ) 41074 } 41075 ); 41076 } 41077 return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { ref: setNodeRef, style, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Link, { href: needsLogin ? "#" : item.path, onClick, children: /* @__PURE__ */ jsxRuntimeExports.jsxs( 41078 "div", 41079 { 41080 className: cn( 41081 "flex items-center gap-3 px-4 py-2.5 mx-2 rounded-lg cursor-pointer transition-all duration-150 group relative", 41082 collapsed && "justify-center px-2", 41083 active ? "text-slate-900 font-semibold" : "text-slate-300 hover:text-white" 41084 ), 41085 style: active ? { background: "var(--eps-gold)" } : void 0, 41086 onMouseEnter: (e) => { 41087 if (!active) e.currentTarget.style.background = "var(--sidebar-accent)"; 41088 }, 41089 onMouseLeave: (e) => { 41090 if (!active) e.currentTarget.style.background = ""; 41091 }, 41092 children: [
41093 /* @__PURE__ */ jsxRuntimeExports.jsx(Icon, { className: "w-4 h-4 flex-shrink-0" }), 41094 !collapsed && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [ 41095 /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-sm flex-1 truncate", children: item.label }), 41096 needsLogin && !active && /* @__PURE__ */ jsxRuntimeExports.jsx( 41097 LogIn, 41098 { 41099 className: "w-3 h-3 flex-shrink-0 opacity-60", 41100 style: shakingPath === item.path ? { animation: "eps-lock-shake 0.5s ease" } : void 0 41101 } 41102 ), 41103 agentStatus && !needsLogin && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: cn("w-2 h-2 rounded-full flex-shrink-0", STATUS_DOT[agentStatus] || STATUS_DOT.idle) }) 41104 ] }), 41105 collapsed && agentStatus && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: cn("absolute right-1 top-1 w-2 h-2 rounded-full", STATUS_DOT[agentStatus] || STATUS_DOT.idle) }) 41106 ] 41107 } 41108 ) }) }); 41109} 41110function EPSDashboardLayout({ children }) { 41111 const [location, setLocation] = useLocation(); 41112 const { user, isAuthenticated, loading, logout } = useAuth(); 41113 const mainRef = reactExports.useRef(null); 41114 reactExports.useEffect(() => { 41115 if (mainRef.current) mainRef.current.scrollTop = 0; 41116 }, [location]); 41117 const { agent, isAuthenticated: isAgentAuthenticated, loading: agentLoading, logout: agentLogout } = useAgentAuth(); 41118 const isAdminAgent = isAgentAuthenticated && agent?.agentKey !== void 0 && ADMIN_AGENT_KEYS.includes(agent.agentKey); 41119 const deniedPaths = new Set(agent?.deniedSections ?? []); 41120 const combinedAuthenticated = isAuthenticated || isAdminAgent; 41121 const combinedLoading = loading || agentLoading && !isAdminAgent; 41122 const [collapsed, setCollapsed] = reactExports.useState(false); 41123 const [mobileOpen, setMobileOpen] = reactExports.useState(false); 41124 const [shakingPath, setShakingPath] = reactExports.useState(null); 41125 const [settingsOpen, setSettingsOpen] = reactExports.useState(false); 41126 const [reorderMode, setReorderMode] = reactExports.useState(false); 41127 const [navItems, setNavItems] = reactExports.useState([]); 41128 const [hiddenPaths, setHiddenPaths] = reactExports.useState(/* @__PURE__ */ new Set()); 41129 const [orderLoaded, setOrderLoaded] = reactExports.useState(false); 41130 const [dragActiveId, setDragActiveId] = reactExports.useState(null); 41131 const [healthOpen, setHealthOpen] = reactExports.useState(false); 41132 const [healthReport, setHealthReport] = reactExports.useState(null); 41133 const runHealthCheck = trpc.system.runHealthCheck.useMutation({ 41134 onSuccess: (data) => setHealthReport(data) 41135 }); 41136 const utils = trpc.useUtils(); 41137 const { data: agentStatuses } = trpc.agents.getStatuses.useQuery(void 0, { 41138 refetchInterval: 1e4 41139 }); 41140 const statusMap = {}; 41141 if (agentStatuses) { 41142 agentStatuses.forEach((s) => { 41143 statusMap[s.agentName] = s.status; 41144 }); 41145 } 41146 const BASE_NAV = NAV_ITEMS.filter((item) => { 41147 if (item.adminOnly && !combinedAuthenticated) return false; 41148 if (deniedPaths.has(item.path)) return false; 41149 return true; 41150 }); 41151 const { data: savedPrefsData } = trpc.sidebarPrefs.getSidebarPrefs.useQuery( 41152 void 0, 41153 { enabled: combinedAuthenticated && !combinedLoading } 41154 ); 41155 reactExports.useEffect(() => { 41156 if (savedPrefsData !== void 0) { 41157 setNavItems(applyOrder$1(BASE_NAV, savedPrefsData.navOrder)); 41158 setHiddenPaths(new Set(savedPrefsData.hiddenItems ?? [])); 41159 setOrderLoaded(true); 41160 } 41161 }, [savedPrefsData]); 41162 reactExports.useEffect(() => { 41163 if (!orderLoaded && !combinedLoading && combinedAuthenticated) { 41164 setNavItems(BASE_NAV); 41165 } 41166 }, [combinedLoading, combinedAuthenticated, orderLoaded]); 41167 reactExports.useEffect(() => { 41168 if (!combinedAuthenticated && !combinedLoading) { 41169 setNavItems(BASE_NAV); 41170 } 41171 }, [combinedAuthenticated, combinedLoading]); 41172 const saveSidebarPrefs = trpc.sidebarPrefs.saveSidebarPrefs.useMutation(); 41173 const resetSidebarPrefs = trpc.sidebarPrefs.resetSidebarPrefs.useMutation({ 41174 onSuccess: () => { 41175 utils.sidebarPrefs.getSidebarPrefs.invalidate(); 41176 setNavItems(BASE_NAV); 41177 setHiddenPaths(/* @__PURE__ */ new Set()); 41178 } 41179 }); 41180 const sensors = useSensors( 41181 useSensor(PointerSensor, { activationConstraint: { distance: 5 } }), 41182 useSensor(TouchSensor, { activationConstraint: { delay: 200, tolerance: 8 } }), 41183 useSensor(KeyboardSensor, { coordinateGetter: sortableKeyboardCoordinates }) 41184 ); 41185 const handleDragStart = reactExports.useCallback((event) => { 41186 setDragActiveId(String(event.active.id)); 41187 }, []); 41188 const handleDragEnd = reactExports.useCallback((event) => { 41189 setDragActiveId(null); 41190 const { active, over } = event; 41191 if (!over || active.id === over.id) return; 41192 setNavItems((prev) => { 41193 const oldIndex = prev.findIndex((i) => i.path === active.id); 41194 const newIndex = prev.findIndex((i) => i.path === over.id); 41195 if (oldIndex === -1 || newIndex === -1) return prev; 41196 const firstDraggableIndex = prev.findIndex((i) => !i.pinned); 41197 if (newIndex < firstDraggableIndex) return prev; 41198 const next = arrayMove(prev, oldIndex, newIndex); 41199 const draggablePaths = next.filter((i) => !i.pinned).map((i) => i.path); 41200 saveSidebarPrefs.mutate({ 41201 navOrder: draggablePaths, 41202 hiddenItems: Array.from(hiddenPaths) 41203 }); 41204 return next; 41205 }); 41206 }, [saveSidebarPrefs, hiddenPaths]); 41207 const handleToggleHide = reactExports.useCallback((path) => { 41208 setHiddenPaths((prev) => { 41209 const next = new Set(prev);
41210 if (next.has(path)) { 41211 next.delete(path); 41212 } else { 41213 next.add(path); 41214 } 41215 const draggablePaths = navItems.filter((i) => !i.pinned).map((i) => i.path); 41216 saveSidebarPrefs.mutate({ 41217 navOrder: draggablePaths, 41218 hiddenItems: Array.from(next) 41219 }); 41220 return next; 41221 }); 41222 }, [saveSidebarPrefs, navItems]); 41223 const handleResetOrder = () => { 41224 resetSidebarPrefs.mutate(); 41225 setReorderMode(false); 41226 }; 41227 if (combinedLoading && !combinedAuthenticated) { 41228 return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "min-h-screen bg-[#2d2c5a] flex items-center justify-center", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "w-8 h-8 border-2 border-white/30 border-t-white rounded-full animate-spin" }) }); 41229 } 41230 if (!combinedAuthenticated) { 41231 return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "min-h-screen bg-[#2d2c5a] flex flex-col items-center justify-center gap-6", children: [ 41232 /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col items-center gap-3", children: [
41233 /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "w-16 h-16 bg-[#B22234] rounded-2xl flex items-center justify-center", children: /* @__PURE__ */ jsxRuntimeExports.jsx("svg", { className: "w-9 h-9 text-[#3C3B6E]", fill: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "M12 1L3 5v6c0 5.55 3.84 10.74 9 12 5.16-1.26 9-6.45 9-12V5l-9-4z" }) }) }), 41234 /* @__PURE__ */ jsxRuntimeExports.jsx("h1", { className: "text-2xl font-bold text-white", children: "Expert Protection Services" }), 41235 /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-white/60 text-sm", children: "Admin Dashboard" }) 41236 ] }), 41237 /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-white/10 backdrop-blur border border-white/20 rounded-2xl p-8 flex flex-col items-center gap-4 w-80", children: [ 41238 /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "w-full rounded-lg px-3 py-2 text-xs text-center", style: { background: "rgba(201,168,76,0.15)", border: "1px solid rgba(201,168,76,0.4)", color: "#B22234" }, children: [ 41239 "ð ",
41240 /* @__PURE__ */ jsxRuntimeExports.jsx("strong", { children: "EPS Administrators only." }) 41241 ] }), 41242 /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-white/70 text-sm text-center", children: "Sign in with your PIN to access the admin dashboard." }), 41243 /* @__PURE__ */ jsxRuntimeExports.jsxs( 41244 "a", 41245 { 41246 href: "/agent-login", 41247 className: "w-full bg-[#B22234] hover:bg-[#b8973d] text-white font-bold py-3 px-6 rounded-xl transition-colors flex items-center justify-center gap-3", 41248 children: [ 41249 /* @__PURE__ */ jsxRuntimeExports.jsx("svg", { className: "w-5 h-5 flex-shrink-0", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsxRuntimeExports.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z" }) }), 41250 "Sign in with PIN" 41251 ] 41252 } 41253 ) 41254 ] }) 41255 ] }); 41256 } 41257 const displayName = agent?.agentName ?? user?.name ?? "Administrator"; 41258 const initials = displayName.split(" ").map((n) => n[0]).join("").toUpperCase().slice(0, 2) || "AD"; 41259 const PROTECTED_PATHS = /* @__PURE__ */ new Set(["/onboarding", "/commissions", "/production"]); 41260 function handleNavClick(path, e) { 41261 if (!combinedAuthenticated && PROTECTED_PATHS.has(path)) { 41262 e.preventDefault(); 41263 setShakingPath(path); 41264 setTimeout(() => setShakingPath(null), 600); 41265 window.location.href = "/agent-login"; 41266 } 41267 } 41268 const Sidebar = /* @__PURE__ */ jsxRuntimeExports.jsxs( 41269 "aside", 41270 { 41271 className: cn( 41272 "flex flex-col h-full transition-all duration-300 border-r", 41273 collapsed ? "w-16" : "w-64" 41274 ), 41275 style: { 41276 background: "var(--eps-navy)", 41277 borderColor: "var(--sidebar-border)" 41278 }, 41279 children: [
41280 /* @__PURE__ */ jsxRuntimeExports.jsxs( 41281 "div", 41282 { 41283 className: cn("flex items-center gap-3 px-4 py-5 border-b", collapsed && "justify-center px-2"), 41284 style: { borderColor: "var(--sidebar-border)" }, 41285 children: [ 41286 /* @__PURE__ */ jsxRuntimeExports.jsx( 41287 "div", 41288 { 41289 className: "w-8 h-8 rounded-lg flex items-center justify-center flex-shrink-0", 41290 style: { background: "var(--eps-gold)" }, 41291 children: /* @__PURE__ */ jsxRuntimeExports.jsx(Shield, { className: "w-5 h-5 text-slate-900" }) 41292 } 41293 ), 41294 !collapsed && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [ 41295 /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "min-w-0 flex-1", children: [ 41296 /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-white font-bold text-sm leading-tight truncate", style: { fontFamily: "'Playfair Display', serif" }, children: "Expert Protection" }),
41297 /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-xs leading-tight flex items-center gap-1", style: { color: "var(--eps-gold)" }, children: [ 41298 "Services ", 41299 /* @__PURE__ */ jsxRuntimeExports.jsx(USFlag, { size: 18 }) 41300 ] }) 41301 ] }), 41302 /* @__PURE__ */ jsxRuntimeExports.jsx( 41303 "button", 41304 { 41305 onClick: () => setReorderMode((r) => !r), 41306 className: cn( 41307 "flex-shrink-0 p-1.5 rounded-lg transition-colors", 41308 reorderMode ? "bg-[#B22234]/30 text-[#B22234]" : "text-white/30 hover:text-white/70 hover:bg-white/10" 41309 ), 41310 title: reorderMode ? "Done customizing" : "Customize sidebar order", 41311 children: /* @__PURE__ */ jsxRuntimeExports.jsx(Pencil, { className: "w-3.5 h-3.5" }) 41312 } 41313 ) 41314 ] }) 41315 ] 41316 } 41317 ),
41318 reorderMode && !collapsed && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mx-2 mt-2 mb-1 px-3 py-2 rounded-lg", style: { background: "rgba(178,34,52,0.1)", border: "1px solid rgba(178,34,52,0.3)" }, children: [ 41319 /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-[#B22234] text-[10px] font-semibold leading-tight", children: "Customize Sidebar" }), 41320 /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-white/40 text-[9px] mt-0.5", children: "Drag to reorder · tap ð to hide/show" }) 41321 ] }), 41322 /* @__PURE__ */ jsxRuntimeExports.jsx("nav", { className: "flex-1 py-4 overflow-y-auto", children: /* @__PURE__ */ jsxRuntimeExports.jsxs( 41323 DndContext, 41324 { 41325 sensors, 41326 collisionDetection: closestCenter, 41327 onDragStart: handleDragStart, 41328 onDragEnd: handleDragEnd, 41329 children: [ 41330 /* @__PURE__ */ jsxRuntimeExports.jsx( 41331 SortableContext, 41332 { 41333 items: navItems.map((i) => i.path), 41334 strategy: verticalListSortingStrategy, 41335 children: navItems.filter((item) => reorderMode || item.pinned || !hiddenPaths.has(item.path)).map((item) => { 41336 const isActive = location === item.path || item.path !== "/" && location.startsWith(item.path); 41337 const agentStatus = item.agent ? statusMap[item.agent] : void 0; 41338 const needsLogin = !combinedAuthenticated && PROTECTED_PATHS.has(item.path); 41339 return /* @__PURE__ */ jsxRuntimeExports.jsx( 41340 SortableNavItem$1, 41341 { 41342 item, 41343 active: isActive, 41344 collapsed, 41345 reorderMode, 41346 hidden: hiddenPaths.has(item.path), 41347 agentStatus, 41348 needsLogin, 41349 shakingPath, 41350 onToggleHide: () => handleToggleHide(item.path), 41351 onClick: (e) => { 41352 handleNavClick(item.path, e); 41353 setMobileOpen(false); 41354 } 41355 }, 41356 item.path 41357 ); 41358 }) 41359 } 41360 ),
41361 /* @__PURE__ */ jsxRuntimeExports.jsx(DragOverlay, { children: dragActiveId ? (() => { 41362 const dragItem = navItems.find((i) => i.path === dragActiveId); 41363 if (!dragItem) return null; 41364 const DragIcon = dragItem.icon; 41365 return /* @__PURE__ */ jsxRuntimeExports.jsxs( 41366 "div", 41367 { 41368 className: "flex items-center gap-3 px-4 py-2.5 rounded-lg text-sm font-medium shadow-2xl text-white/80 select-none", 41369 style: { background: "var(--eps-navy-mid)", border: "1px solid rgba(178,34,52,0.4)" }, 41370 children: [ 41371 /* @__PURE__ */ jsxRuntimeExports.jsx(GripVertical, { className: "w-4 h-4 flex-shrink-0 text-white/40" }), 41372 /* @__PURE__ */ jsxRuntimeExports.jsx(DragIcon, { className: "w-4 h-4 flex-shrink-0" }), 41373 !collapsed && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "truncate", children: dragItem.label }) 41374 ] 41375 } 41376 ); 41377 })() : null }) 41378 ] 41379 } 41380 ) }),
41381 reorderMode && !collapsed && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "px-2 pb-1", children: /* @__PURE__ */ jsxRuntimeExports.jsxs( 41382 "button", 41383 { 41384 onClick: handleResetOrder, 41385 className: "w-full flex items-center justify-center gap-2 px-3 py-1.5 rounded-lg text-xs text-white/50 hover:text-white/80 hover:bg-white/10 transition-colors", 41386 children: [ 41387 /* @__PURE__ */ jsxRuntimeExports.jsx(RotateCcw, { className: "w-3 h-3" }), 41388 "Reset to defaults" 41389 ] 41390 } 41391 ) }), 41392 /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: cn("border-t", collapsed && "px-0"), style: { borderColor: "var(--sidebar-border)" }, children: combinedLoading ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex items-center justify-center h-12", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "w-4 h-4 border-2 border-yellow-400 border-t-transparent rounded-full animate-spin" }) }) : combinedAuthenticated ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "relative", children: [ 41393 settingsOpen && /* @__PURE__ */ jsxRuntimeExports.jsxs( 41394 "div", 41395 { 41396 className: "absolute z-50 rounded-xl shadow-2xl overflow-hidden border", 41397 style: { 41398 background: "var(--eps-navy-mid)", 41399 borderColor: "var(--sidebar-border)", 41400 ...collapsed ? { bottom: "100%", left: "50%", transform: "translateX(-50%)", minWidth: "180px", marginBottom: "8px" } : { bottom: "100%", left: "8px", right: "8px", marginBottom: "4px" } 41401 }, 41402 children: [
41403 /* @__PURE__ */ jsxRuntimeExports.jsxs( 41404 "button", 41405 { 41406 onClick: () => { 41407 setLocation("/email-settings"); 41408 setSettingsOpen(false); 41409 setMobileOpen(false); 41410 }, 41411 className: "w-full flex items-center gap-3 px-4 py-3 text-white/80 hover:text-white transition-colors text-sm", 41412 style: { background: "transparent" }, 41413 onMouseEnter: (e) => e.currentTarget.style.background = "var(--sidebar-accent)", 41414 onMouseLeave: (e) => e.currentTarget.style.background = "transparent", 41415 children: [ 41416 /* @__PURE__ */ jsxRuntimeExports.jsx(Mail, { className: "w-4 h-4", style: { color: "var(--eps-gold)" } }), 41417 /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: "Email Settings" }) 41418 ] 41419 } 41420 ), 41421 (isAdminAgent || isAuthenticated) && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
41422 /* @__PURE__ */ jsxRuntimeExports.jsxs( 41423 "button", 41424 { 41425 onClick: () => { 41426 setLocation("/admin/settings"); 41427 setSettingsOpen(false); 41428 setMobileOpen(false); 41429 }, 41430 className: "w-full flex items-center gap-3 px-4 py-3 text-white/80 hover:text-white transition-colors text-sm", 41431 style: { background: "transparent" }, 41432 onMouseEnter: (e) => e.currentTarget.style.background = "var(--sidebar-accent)", 41433 onMouseLeave: (e) => e.currentTarget.style.background = "transparent", 41434 children: [ 41435 /* @__PURE__ */ jsxRuntimeExports.jsx(Settings, { className: "w-4 h-4", style: { color: "var(--eps-gold)" } }), 41436 /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: "Agency Settings" }) 41437 ] 41438 } 41439 ),
41440 /* @__PURE__ */ jsxRuntimeExports.jsxs( 41441 "button", 41442 { 41443 onClick: () => { 41444 setLocation("/admin/agency-groups"); 41445 setSettingsOpen(false); 41446 setMobileOpen(false); 41447 }, 41448 className: "w-full flex items-center gap-3 px-4 py-3 text-white/80 hover:text-white transition-colors text-sm", 41449 style: { background: "transparent" }, 41450 onMouseEnter: (e) => e.currentTarget.style.background = "var(--sidebar-accent)", 41451 onMouseLeave: (e) => e.currentTarget.style.background = "transparent", 41452 children: [ 41453 /* @__PURE__ */ jsxRuntimeExports.jsx(Building2, { className: "w-4 h-4", style: { color: "var(--eps-gold)" } }), 41454 /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: "Agency Groups" }) 41455 ] 41456 } 41457 ),
41458 /* @__PURE__ */ jsxRuntimeExports.jsxs( 41459 "button", 41460 { 41461 onClick: () => { 41462 setLocation("/admin/feature-gaps"); 41463 setSettingsOpen(false); 41464 setMobileOpen(false); 41465 }, 41466 className: "w-full flex items-center gap-3 px-4 py-3 text-white/80 hover:text-white transition-colors text-sm", 41467 style: { background: "transparent" }, 41468 onMouseEnter: (e) => e.currentTarget.style.background = "var(--sidebar-accent)", 41469 onMouseLeave: (e) => e.currentTarget.style.background = "transparent", 41470 children: [ 41471 /* @__PURE__ */ jsxRuntimeExports.jsx(MessageSquareWarning, { className: "w-4 h-4", style: { color: "var(--eps-gold)" } }), 41472 /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: "Feature Gap Log" }) 41473 ] 41474 } 41475 ) 41476 ] }),
41477 /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "border-t", style: { borderColor: "var(--sidebar-border)" } }), 41478 /* @__PURE__ */ jsxRuntimeExports.jsxs( 41479 "button", 41480 { 41481 onClick: () => { 41482 if (isAdminAgent) { 41483 agentLogout(); 41484 } else { 41485 logout(); 41486 } 41487 setSettingsOpen(false); 41488 }, 41489 className: "w-full flex items-center gap-3 px-4 py-3 text-white/80 hover:text-white transition-colors text-sm", 41490 style: { background: "transparent" }, 41491 onMouseEnter: (e) => e.currentTarget.style.background = "var(--sidebar-accent)", 41492 onMouseLeave: (e) => e.currentTarget.style.background = "transparent", 41493 children: [ 41494 /* @__PURE__ */ jsxRuntimeExports.jsx(LogOut, { className: "w-4 h-4 text-red-400" }),
41495 /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: "Sign Out" }) 41496 ] 41497 } 41498 ) 41499 ] 41500 } 41501 ), 41502 /* @__PURE__ */ jsxRuntimeExports.jsxs( 41503 "div", 41504 { 41505 className: cn("p-3 flex items-center gap-3 cursor-pointer transition-colors rounded-lg mx-1 my-1", collapsed && "justify-center px-2"), 41506 onClick: () => setSettingsOpen((o) => !o), 41507 title: collapsed ? "Settings" : void 0, 41508 onMouseEnter: (e) => e.currentTarget.style.background = "var(--sidebar-accent)", 41509 onMouseLeave: (e) => e.currentTarget.style.background = "transparent", 41510 children: [ 41511 /* @__PURE__ */ jsxRuntimeExports.jsx(Avatar, { className: "w-8 h-8 flex-shrink-0", children: /* @__PURE__ */ jsxRuntimeExports.jsx(AvatarFallback, { className: "text-[9px] font-bold text-slate-900", style: { background: "var(--eps-gold)" }, children: initials }) }),
41512 !collapsed && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [ 41513 /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex-1 min-w-0", children: [ 41514 /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-white text-xs font-semibold truncate", children: displayName }), 41515 /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-xs truncate", style: { color: "var(--eps-gold)" }, children: "Administrator" }) 41516 ] }), 41517 /* @__PURE__ */ jsxRuntimeExports.jsx(Settings, { className: "w-3.5 h-3.5 flex-shrink-0", style: { color: "var(--eps-gold)" } }) 41518 ] }) 41519 ] 41520 } 41521 ) 41522 ] }) : ( 41523 // Not authenticated â show Agent Login button 41524 collapsed ? /* @__PURE__ */ jsxRuntimeExports.jsx( 41525 "button", 41526 { 41527 title: "Agent Login", 41528 className: "w-8 h-8 mx-auto flex items-center justify-center rounded-lg transition-colors hover:opacity-80", 41529 style: { background: "var(--eps-gold)" }, 41530 onClick: () => window.location.href = "/agent-login", 41531 children: /* @__PURE__ */ jsxRuntimeExports.jsx(Shield, { className: "w-4 h-4 text-slate-900" }) 41532 } 41533 ) : /* @__PURE__ */ jsxRuntimeExports.jsxs( 41534 Button, 41535 { 41536 className: "w-full text-xs font-semibold h-8", 41537 style: { background: "var(--eps-gold)", color: "white", fontWeight: "bold" }, 41538 onClick: () => window.location.href = "/agent-login", 41539 children: [
41540 /* @__PURE__ */ jsxRuntimeExports.jsx(Shield, { className: "w-3.5 h-3.5 mr-1.5" }), 41541 "Agent Login" 41542 ] 41543 } 41544 ) 41545 ) }), 41546 /* @__PURE__ */ jsxRuntimeExports.jsx( 41547 "button", 41548 { 41549 className: "absolute -right-3 top-20 w-6 h-6 rounded-full border flex items-center justify-center z-10 transition-colors", 41550 style: { background: "var(--eps-navy)", borderColor: "var(--sidebar-border)", color: "var(--eps-gold)" }, 41551 onClick: () => { 41552 setCollapsed(!collapsed); 41553 if (!collapsed) setReorderMode(false); 41554 }, 41555 children: collapsed ? /* @__PURE__ */ jsxRuntimeExports.jsx(ChevronRight, { className: "w-3 h-3" }) : /* @__PURE__ */ jsxRuntimeExports.jsx(ChevronLeft, { className: "w-3 h-3" }) 41556 } 41557 ) 41558 ] 41559 } 41560 ); 41561 return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex h-screen overflow-hidden bg-background", children: [ 41562 /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "hidden md:flex relative", children: Sidebar }), 41563 mobileOpen && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "fixed inset-0 z-50 md:hidden", children: [
41564 /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "absolute inset-0 bg-black/60", onClick: () => setMobileOpen(false) }), 41565 /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "relative w-64 h-full", children: Sidebar }) 41566 ] }), 41567 /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex-1 flex flex-col min-w-0 overflow-hidden", children: [ 41568 /* @__PURE__ */ jsxRuntimeExports.jsxs( 41569 "header", 41570 { 41571 className: "h-14 flex items-center justify-between px-4 border-b bg-card flex-shrink-0", 41572 style: { borderColor: "var(--border)" }, 41573 children: [ 41574 /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-3", children: [ 41575 /* @__PURE__ */ jsxRuntimeExports.jsx("button", { className: "md:hidden", onClick: () => setMobileOpen(true), children: /* @__PURE__ */ jsxRuntimeExports.jsx(Menu, { className: "w-5 h-5" }) }), 41576 /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: /* @__PURE__ */ jsxRuntimeExports.jsx("h2", { className: "text-sm font-semibold text-foreground", style: { fontFamily: "'Playfair Display', serif" }, children: NAV_ITEMS.find((n) => n.path === location || n.path !== "/" && location.startsWith(n.path))?.label || "Command Center" }) }) 41577 ] }),
41578 /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-2", children: [ 41579 /* @__PURE__ */ jsxRuntimeExports.jsx(Badge, { variant: "outline", className: "text-xs hidden sm:flex", style: { borderColor: "var(--eps-gold)", color: "var(--eps-navy-mid)" }, children: "EPS MAS v1.0" }), 41580 !combinedAuthenticated && !combinedLoading && /* @__PURE__ */ jsxRuntimeExports.jsx( 41581 Button, 41582 { 41583 size: "sm", 41584 className: "text-xs h-7 px-3 md:hidden", 41585 style: { background: "var(--eps-gold)", color: "white", fontWeight: "bold" }, 41586 onClick: () => window.location.href = "/agent-login", 41587 children: "Agent Login" 41588 } 41589 ), 41590 /* @__PURE__ */ jsxRuntimeExports.jsxs(Popover, { open: healthOpen, onOpenChange: setHealthOpen, children: [ 41591 /* @__PURE__ */ jsxRuntimeExports.jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { variant: "ghost", size: "icon", className: "w-8 h-8", title: "Health Check", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Bell, { className: "w-4 h-4" }) }) }),
41592 /* @__PURE__ */ jsxRuntimeExports.jsxs( 41593 PopoverContent, 41594 { 41595 align: "end", 41596 className: "w-96 p-0", 41597 style: { background: "var(--card)", border: "1px solid var(--border)" }, 41598 children: [ 41599 /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-between px-4 py-3 border-b", style: { borderColor: "var(--border)" }, children: [ 41600 /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-2", children: [ 41601 /* @__PURE__ */ jsxRuntimeExports.jsx(Activity, { className: "w-4 h-4", style: { color: "var(--eps-gold)" } }), 41602 /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-sm font-semibold", style: { color: "var(--eps-navy)" }, children: "Dashboard Health Check" }) 41603 ] }), 41604 /* @__PURE__ */ jsxRuntimeExports.jsx( 41605 Button, 41606 { 41607 size: "sm", 41608 className: "h-7 px-3 text-xs", 41609 style: { background: "var(--eps-navy)", color: "white" }, 41610 disabled: runHealthCheck.isPending, 41611 onClick: () => { 41612 setHealthReport(null); 41613 runHealthCheck.mutate(); 41614 }, 41615 children: runHealthCheck.isPending ? /* @__P
41615URE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [ 41616 /* @__PURE__ */ jsxRuntimeExports.jsx(LoaderCircle, { className: "w-3 h-3 mr-1 animate-spin" }), 41617 "Runningâ¦" 41618 ] }) : "Run Health Check Now" 41619 } 41620 ) 41621 ] }), 41622 /* @__PURE__ */ jsxRuntimeExports.jsx(ScrollArea, { className: "h-80", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "p-4", children: [ 41623 !healthReport && !runHealthCheck.isPending && /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-xs text-center py-8", style: { color: "var(--muted-foreground)" }, children: 'Click "Run Health Check Now" to generate a full status report.' }), 41624 runHealthCheck.isPending && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col items-center justify-center py-8 gap-2", children: [ 41625 /* @__P
41625URE__ */ jsxRuntimeExports.jsx(LoaderCircle, { className: "w-6 h-6 animate-spin", style: { color: "var(--eps-gold)" } }), 41626 /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-xs", style: { color: "var(--muted-foreground)" }, children: "Gathering dataâ¦" }) 41627 ] }), 41628 runHealthCheck.isError && /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-xs text-red-500 text-center py-4", children: "Error running health check. Please try again." }), 41629 healthReport && /* @__PURE__ */ jsxRuntimeExports.jsx("pre", { className: "text-xs whitespace-pre-wrap font-mono leading-relaxed", style: { color: "var(--foreground)" }, children: healthReport.content }) 41630 ] }) }) 41631 ] 41632 } 41633 ) 41634 ] }) 41635 ] }) 41636 ] 41637 } 41638 ), 41639 /* @__PURE__ */ jsxRuntimeExports.jsx("main", { ref: mainRef, className: "flex-1 overflow-y-auto p-4 md:p-6", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "eps-page-fade-in", children }, location) }) 41640 ] }), 41641 /* @__PURE__ */ jsxRuntimeExports.jsx( 41642 SessionTimeoutWarning, 41643 { 41644 isAuthenticated: combinedAuthenticated, 41645 onLogout: isAdminAgent ? agentLogout : logout, 41646 isAgentSession: isAdminAgent 41647 } 41648 ) 41649 ] }); 41650} 41651
41652// src/separator.tsx 41653var NAME = "Separator"; 41654var DEFAULT_ORIENTATION = "horizontal"; 41655var ORIENTATIONS = ["horizontal", "vertical"]; 41656var Separator$1 = reactExports.forwardRef((props, forwardedRef) => { 41657 const { decorative, orientation: orientationProp = DEFAULT_ORIENTATION, ...domProps } = props; 41658 const orientation = isValidOrientation(orientationProp) ? orientationProp : DEFAULT_ORIENTATION; 41659 const ariaOrientation = orientation === "vertical" ? orientation : void 0; 41660 const semanticProps = decorative ? { role: "none" } : { "aria-orientation": ariaOrientation, role: "separator" }; 41661 return /* @__PURE__ */ jsxRuntimeExports.jsx( 41662 Primitive.div, 41663 { 41664 "data-orientation": orientation, 41665 ...semanticProps, 41666 ...domProps, 41667 ref: forwardedRef 41668 } 41669 ); 41670}); 41671Separator$1.displayName = NAME; 41672function isValidOrientation(orientation) { 41673 return ORIENTATIONS.includes(orientation); 41674} 41675var Root = Separator$1; 41676 41677function Separator({ 41678 className, 41679 orientation = "horizontal", 41680 decorative = true, 41681 ...props 41682}) { 41683 return /* @__PURE__ */ jsxRuntimeExports.jsx( 41684 Root, 41685 { 41686 "data-slot": "separator", 41687 decorative, 41688 orientation, 41689 className: cn( 41690 "bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px", 41691 className 41692 ), 41693 ...props 41694 } 41695 ); 41696} 41697 41698const ADMIN_NAV_ITEMS = [ 41699 { path: "/agent", label: "Command Center", icon: LayoutDashboard, pinned: true }, 41700 { path: "/agent/calendar", label: "My Calendar", icon: CalendarDays }, 41701 { path: "/agent/celebrations", label: "Birthdays & Anniversaries", icon: Gift }, 41702 { path: "/agent/onboarding", label: "Onboarding & Sales Pipeline", icon: UserPlus }, 41703 { path: "/agent/quoting", label: "Quote Comparison", icon: ChartColumn }, 41704 { path: "/agent/policy-changes", label: "Policy Changes", icon: ClipboardList }, 41705 { path: "/agent/carrier-info", label: "Carrier Info", icon: BookOpen }, 41706 { path: "/agent/insights", label: "Product & Appetite Guides", icon: ChartColumn }, 41707 { path: "/agent/scripts", label: "Scripts & Templates", icon: FileText }, 41708 { path: "/agent/payments", label: "Escrow Payments", icon: Wallet }, 41709 { path: "/agent/claims", label: "Claims", icon: CircleAlert }, 41710 { path: "/agent/acord-forms", label: "ACORD Forms & Applications", icon: FileCheck }, 41711 { path: "/agent/commissions", label: "My Commissions", icon: DollarSign }, 41712 { path: "/agent/production-reports", label: "Production Reports", icon: TrendingUp }, 41713 { path: "/agent/marketing", label: "Marketing", icon: FileText }, 41714 { path: "/agent/new-business", label: "New Business", icon: FileSpreadsheet }, 41715 { path: "/agent/google-reviews", label: "Google Reviews", icon: Star }, 41716 { path: "/agent/renewals", label: "Renewals", icon: RefreshCw }, 41717 { path: "/agent/client-directory", label: "Client Email Directory", icon: BookUser }, 41718 { path: "/agent/suggestions", label: "Suggestions", icon: Lightbulb }, 41719 { path: "/agent/my-account", label: "My Account", icon: CircleUser } 41720]; 41721const PRODUCER_NAV_ITEMS = [ 41722 { path: "/agent", label: "Command Center", icon: LayoutDashboard, pinned: true }, 41723 { path: "/agent/calendar", label: "My Calendar", icon: CalendarDays }, 41724 { path: "/agent/celebrations", label: "Birthdays & Anniversaries", icon: Gift }, 41725 { path: "/agent/onboarding", label: "Onboarding & Sales Pipeline", icon: UserPlus }, 41726 { path: "/agent/quoting", label: "Quote Comparison", icon: ChartColumn }, 41727 { path: "/agent/policy-changes", label: "Policy Changes", icon: ClipboardList }, 41728 { path: "/agent/carrier-info", label: "Carrier Info", icon: BookOpen }, 41729 { path: "/agent/insights", label: "Product & Appetite Guides", icon: ChartColumn }, 41730 { path: "/agent/scripts", label: "Scripts & Templates", icon: FileText }, 41731 { path: "/agent/payments", label: "Escrow Payments", icon: Wallet }, 41732 { path: "/agent/claims", label: "Claims", icon: CircleAlert }, 41733 { path: "/agent/acord-forms", label: "ACORD Forms & Applications", icon: FileCheck }, 41734 { path: "/agent/commissions", label: "My Commissions", icon: DollarSign }, 41735 { path: "/agent/production-reports", label: "Production Reports", icon: TrendingUp }, 41736 { path: "/agent/marketing", label: "Marketing", icon: FileText }, 41737 { path: "/agent/new-business", label: "New Business", icon: FileSpreadsheet }, 41738 { path: "/agent/google-reviews", label: "Google Reviews", icon: Star }, 41739 { path: "/agent/renewals", label: "Renewals", icon: RefreshCw }, 41740 { path: "/agent/client-directory", label: "Client Email Directory", icon: BookUser }, 41741 { path: "/agent/suggestions", label: "Suggestions", icon: Lightbulb }, 41742 { path: "/agent/my-account", label: "My Account", icon: CircleUser } 41743]; 41744const ADMIN_AGENT_KEYS_NAV = ["greg-fay", "stacey-hinkle", "ryan-fay", "josh-hinkle"]; 41745function applyOrder(baseItems, savedOrder) { 41746 if (!savedOrder || savedOrder.length === 0) return baseItems; 41747 const pinned = baseItems.filter((i) => i.pinned); 41748 const draggable = baseItems.filter((i) => !i.pinned); 41749 const byPath = new Map(draggable.map((i) => [i.path, i])); 41750 const ordered = []; 41751 for (const path of savedOrder) { 41752 const item = byPath.get(path); 41753 if (item) { 41754 ordered.push(item); 41755 byPath.delete(path); 41756 } 41757 } 41758 byPath.forEach((item) => ordered.push(item)); 41759 return [...pinned, ...ordered]; 41760} 41761const NOTIF_TYPE_COLORS = { 41762 commission: "bg-green-500", 41763 message: "bg-blue-500", 41764 policy_change: "bg-amber-500", 41765 escrow: "bg-purple-500", 41766 general: "bg-gray-400" 41767};
41768function NotificationBell({ agentKey }) { 41769 const [open, setOpen] = reactExports.useState(false); 41770 const ref = reactExports.useRef(null); 41771 const utils = trpc.useUtils(); 41772 const { data: countData } = trpc.producerNotifications.unreadCount.useQuery( 41773 { agentKey }, 41774 { refetchInterval: 3e4, refetchOnWindowFocus: true } 41775 ); 41776 const { data: notifs, isLoading } = trpc.producerNotifications.list.useQuery( 41777 { agentKey, limit: 20 }, 41778 { enabled: open } 41779 ); 41780 const markRead = trpc.producerNotifications.markRead.useMutation({ 41781 onSuccess: () => { 41782 utils.producerNotifications.unreadCount.invalidate(); 41783 utils.producerNotifications.list.invalidate(); 41784 } 41785 }); 41786 const markAllRead = trpc.producerNotifications.markAllRead.useMutation({ 41787 onSuccess: () => { 41788 utils.producerNotifications.unreadCount.invalidate(); 41789 utils.producerNotifications.list.invalidate(); 41790 } 41791 }); 41792 reactExports.useEffect(() => { 41793 function handleClick(e) { 41794 if (ref.current && !ref.current.contains(e.target)) setOpen(false); 41795 } 41796 if (open) document.addEventListener("mousedown", handleClick); 41797 return () => document.removeEventListener("mousedown", handleClick); 41798 }, [open]); 41799 const unread = countData?.count ?? 0; 41800 return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { ref, className: "relative", children: [ 41801 /* @__PURE__ */ jsxRuntimeExports.jsxs( 41802 "button", 41803 { 41804 onClick: () => setOpen((o) => !o), 41805 className: "relative p-1.5 rounded-lg text-white/70 hover:text-white hover:bg-white/10 transition-colors", 41806 title: "Notifications", 41807 children: [
41808 /* @__PURE__ */ jsxRuntimeExports.jsx(Bell, { className: "w-4 h-4" }), 41809 unread > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "absolute -top-0.5 -right-0.5 min-w-[16px] h-4 bg-[#B22234] text-white text-[9px] font-bold rounded-full flex items-center justify-center px-0.5", children: unread > 99 ? "99+" : unread }) 41810 ] 41811 } 41812 ), 41813 open && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "absolute bottom-full right-0 mb-2 w-80 bg-[#1e1d4a] border border-white/20 rounded-xl shadow-2xl z-50 overflow-hidden", children: [ 41814 /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-between px-4 py-3 border-b border-white/10", children: [ 41815 /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-white font-semibold text-sm", children: "Notifications" }), 41816 /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-2", children: [ 41817 unread > 0 && /* @__PURE__ */ jsxRuntimeExports.jsxs( 41818 "button", 41819 { 41820 onClick: () => markAllRead.mutate({ agentKey }), 41821 className: "text-white/50 hover:text-white text-xs flex items-center gap-1 transition-colors", 41822 title: "Mark all as read", 41823 children: [
41824 /* @__PURE__ */ jsxRuntimeExports.jsx(CheckCheck, { className: "w-3 h-3" }), 41825 " All read" 41826 ] 41827 } 41828 ), 41829 /* @__PURE__ */ jsxRuntimeExports.jsx("button", { onClick: () => setOpen(false), className: "text-white/40 hover:text-white transition-colors", children: /* @__PURE__ */ jsxRuntimeExports.jsx(X, { className: "w-3.5 h-3.5" }) }) 41830 ] }) 41831 ] }), 41832 /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "max-h-72 overflow-y-auto", children: [ 41833 isLoading && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex items-center justify-center py-8", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "w-5 h-5 border-2 border-white/20 border-t-white rounded-full animate-spin" }) }), 41834 !isLoading && (!notifs || notifs.length === 0) && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "py-8 text-center text-white/40 text-sm", children: "No notifications yet" }), 41835 notifs?.map((n) => /* @__PURE__ */ jsxRuntimeExports.jsx( 41836 "div", 41837 { 41838 className: cn( 41839 "px-4 py-3 border-b border-white/5 cursor-pointer hover:bg-white/5 transition-colors", 41840 !n.readAt && "bg-white/5" 41841 ), 41842 onClick: () => { 41843 if (!n.readAt) markRead.mutate({ id: n.id }); 41844 if (n.link) window.location.href = n.link; 41845 setOpen(false); 41846 }, 41847 children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-start gap-2.5", children: [
41848 /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: cn("w-2 h-2 rounded-full mt-1.5 flex-shrink-0", NOTIF_TYPE_COLORS[n.type] ?? "bg-gray-400") }), 41849 /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "min-w-0 flex-1", children: [ 41850 /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: cn("text-xs font-semibold truncate", n.readAt ? "text-white/60" : "text-white"), children: n.title }), 41851 n.body && /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-white/40 text-[11px] mt-0.5 line-clamp-2", children: n.body }), 41852 /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-white/30 text-[10px] mt-1", children: new Date(n.createdAt).toLocaleString() }) 41853 ] }), 41854 !n.readAt && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-[#B22234] flex-shrink-0 mt-1.5" }) 41855 ] }) 41856 }, 41857 n.id 41858 )) 41859 ] }) 41860 ] }) 41861 ] }); 41862} 41863function SortableNavItem({ 41864 item, 41865 active, 41866 collapsed, 41867 reorderMode, 41868 hidden, 41869 onToggleHide, 41870 onClick 41871}) { 41872 const { 41873 attributes, 41874 listeners, 41875 setNodeRef, 41876 transform, 41877 transition, 41878 isDragging 41879 } = useSortable({ id: item.path, disabled: item.pinned || !reorderMode }); 41880 const style = { 41881 transform: CSS$1.Transform.toString(transform), 41882 transition, 41883 opacity: isDragging ? 0.4 : 1, 41884 zIndex: isDragging ? 50 : void 0 41885 }; 41886 const Icon = item.icon; 41887 const isDraggable = reorderMode && !item.pinned; 41888 return /* @__PURE__ */ jsxRuntimeExports.jsx( 41889 "div", 41890 { 41891 ref: setNodeRef, 41892 style,
41893 className: cn("relative", isDraggable && "cursor-grab active:cursor-grabbing select-none"), 41894 ...isDraggable ? { ...attributes, ...listeners } : {}, 41895 children: reorderMode ? ( 41896 // In reorder mode: a plain div row (not a button) so pointer events flow cleanly to DnD 41897 /* @__PURE__ */ jsxRuntimeExports.jsxs( 41898 "div", 41899 { 41900 className: cn( 41901 "w-full flex items-center gap-3 px-3 py-1.5 rounded-lg text-sm font-medium", 41902 hidden ? "text-white/25" : "text-white/60", 41903 isDragging && "shadow-2xl bg-[#3C3B6E]" 41904 ), 41905 children: [ 41906 !item.pinned && !collapsed && /* @__PURE__ */ jsxRuntimeExports.jsx(GripVertical, { className: "w-4 h-4 flex-shrink-0 text-white/40" }), 41907 /* @__PURE__ */ jsxRuntimeExports.jsx(Icon, { className: cn("w-4 h-4 flex-shrink-0", hidden && "opacity-30") }), 41908 !collapsed && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: cn("truncate flex-1 text-left", hidden && "line-through opacity-30"), children: item.label }),
41909 item.pinned && !collapsed && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-[9px] text-white/30 font-normal ml-auto flex-shrink-0", children: "pinned" }), 41910 !item.pinned && !collapsed && /* @__PURE__ */ jsxRuntimeExports.jsx( 41911 "button", 41912 { 41913 onPointerDown: (e) => e.stopPropagation(), 41914 onClick: (e) => { 41915 e.stopPropagation(); 41916 onToggleHide(); 41917 }, 41918 className: cn( 41919 "ml-auto p-1 rounded transition-colors flex-shrink-0", 41920 hidden ? "text-white/30 hover:text-white/60" : "text-white/50 hover:text-[#B22234]" 41921 ), 41922 title: hidden ? "Show in sidebar" : "Hide from sidebar", 41923 children: hidden ? /* @__PURE__ */ jsxRuntimeExports.jsx(EyeOff, { className: "w-3.5 h-3.5" }) : /* @__PURE__ */ jsxRuntimeExports.jsx(Eye, { className: "w-3.5 h-3.5" }) 41924 } 41925 ) 41926 ] 41927 } 41928 ) 41929 ) : ( 41930 // Normal mode: proper button for navigation
41931 /* @__PURE__ */ jsxRuntimeExports.jsxs( 41932 "button", 41933 { 41934 onClick, 41935 className: cn( 41936 "w-full flex items-center gap-3 px-3 py-1.5 rounded-lg text-sm font-medium transition-all duration-150", 41937 active ? "bg-[#B22234]/20 text-[#B22234] border border-[#B22234]/30" : "text-white/70 hover:bg-white/10 hover:text-white", 41938 collapsed && "justify-center px-2" 41939 ), 41940 title: collapsed ? item.label : void 0, 41941 children: [ 41942 /* @__PURE__ */ jsxRuntimeExports.jsx(Icon, { className: "w-4 h-4 flex-shrink-0" }), 41943 !collapsed && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "truncate flex-1 text-left", children: item.label }) 41944 ] 41945 } 41946 ) 41947 ) 41948 } 41949 ); 41950} 41951function AgentDashboardLayout({ children }) { 41952 const [location, setLocation] = useLocation(); 41953 const { agent, loading, isAuthenticated, logout } = useAgentAuth(); 41954 const [collapsed, setCollapsed] = reactExports.useState(false); 41955 const [mobileOpen, setMobileOpen] = reactExports.useState(false); 41956 const [settingsOpen, setSettingsOpen] = reactExports.useState(false); 41957 const [reorderMode, setReorderMode] = reactExports.useState(false); 41958 const [navItems, setNavItems] = reactExports.useState([]); 41959 const [hiddenPaths, setHiddenPaths] = reactExports.useState(/* @__PURE__ */ new Set()); 41960 const [orderLoaded, setOrderLoaded] = reactExports.useState(false); 41961 const [dragActiveId, setDragActiveId] = reactExports.useState(null); 41962 const mainRef = reactExports.useRef(null); 41963 const utils = trpc.useUtils(); 41964 reactExports.useEffect(() => { 41965 if (mainRef.current) mainRef.current.scrollTop = 0; 41966 }, [location]); 41967 reactExports.useEffect(() => { 41968 if (!loading && !isAuthenticated) { 41969 setLocation("/agent-login"); 41970 } 41971 }, [loading, isAuthenticated, setLocation]); 41972 const isAdminAgent = agent?.agentKey ? ADMIN_AGENT_KEYS_NAV.includes(agent.agentKey) : false; 41973 const deniedPaths = new Set(agent?.deniedSections ?? []); 41974 const BASE_NAV = (isAdminAgent ? ADMIN_NAV_ITEMS : PRODUCER_NAV_ITEMS).filter((item) => { 41975 const unprefixedPath = item.path.replace(/^\/agent/, "") || "/"; 41976 return !deniedPaths.has(item.path) && !deniedPaths.has(unprefixedPath); 41977 }); 41978 const { data: savedPrefsData } = trpc.sidebarPrefs.getSidebarPrefs.useQuery( 41979 void 0, 41980 { enabled: isAuthenticated && !loading } 41981 ); 41982 reactExports.useEffect(() => { 41983 if (savedPrefsData !== void 0) { 41984 setNavItems(applyOrder(BASE_NAV, savedPrefsData.navOrder)); 41985 setHiddenPaths(new Set(savedPrefsData.hiddenItems ?? [])); 41986 setOrderLoaded(true); 41987 } 41988 }, [savedPrefsData]); 41989 reactExports.useEffect(() => { 41990 if (!orderLoaded && !loading && isAuthenticated) { 41991 setNavItems(BASE_NAV); 41992 } 41993 }, [loading, isAuthenticated, orderLoaded]); 41994 const saveSidebarPrefs = trpc.sidebarPrefs.saveSidebarPrefs.useMutation(); 41995 const resetSidebarPrefs = trpc.sidebarPrefs.resetSidebarPrefs.useMutation({ 41996 onSuccess: () => { 41997 utils.sidebarPrefs.getSidebarPrefs.invalidate(); 41998 setNavItems(BASE_NAV); 41999 setHiddenPaths(/* @__PURE__ */ new Set()); 42000 } 42001 }); 42002 const sensors = useSensors( 42003 useSensor(PointerSensor, { activationConstraint: { distance: 5 } }), 42004 useSensor(TouchSensor, { activationConstraint: { delay: 200, tolerance: 8 } }), 42005 useSensor(KeyboardSensor, { coordinateGetter: sortableKeyboardCoordinates }) 42006 ); 42007 const handleDragStart = reactExports.useCallback((event) => { 42008 setDragActiveId(String(event.active.id)); 42009 }, []); 42010 const handleDragEnd = reactExports.useCallback((event) => { 42011 setDragActiveId(null); 42012 const { active, over } = event; 42013 if (!over || active.id === over.id) return; 42014 setNavItems((prev) => { 42015 const oldIndex = prev.findIndex((i) => i.path === active.id); 42016 const newIndex = prev.findIndex((i) => i.path === over.id); 42017 if (oldIndex === -1 || newIndex === -1) return prev; 42018 const firstDraggableIndex = prev.findIndex((i) => !i.pinned); 42019 if (newIndex < firstDraggableIndex) return prev; 42020 const next = arrayMove(prev, oldIndex, newIndex); 42021 const draggablePaths = next.filter((i) => !i.pinned).map((i) => i.path); 42022 saveSidebarPrefs.mutate({ 42023 navOrder: draggablePaths, 42024 hiddenItems: Array.from(hiddenPaths) 42025 }); 42026 return next; 42027 }); 42028 }, [saveSidebarPrefs, hiddenPaths]); 42029 const handleToggleHide = reactExports.useCallback((path) => { 42030 setHiddenPaths((prev) => { 42031 const next = new Set(prev);
42032 if (next.has(path)) { 42033 next.delete(path); 42034 } else { 42035 next.add(path); 42036 } 42037 const draggablePaths = navItems.filter((i) => !i.pinned).map((i) => i.path); 42038 saveSidebarPrefs.mutate({ 42039 navOrder: draggablePaths, 42040 hiddenItems: Array.from(next) 42041 }); 42042 return next; 42043 }); 42044 }, [saveSidebarPrefs, navItems]); 42045 const handleResetOrder = () => { 42046 resetSidebarPrefs.mutate(); 42047 setReorderMode(false); 42048 }; 42049 const displayAgentName = agent?.agentName ?? ""; 42050 const initials = agent?.agentName ? agent.agentName.split(" ").map((n) => n[0]).join("").toUpperCase().slice(0, 2) : "?"; 42051 const agentKey = agent?.agentKey ?? ""; 42052 const headshotUrl = agent?.headshotUrl ?? null; 42053 const Sidebar = /* @__PURE__ */ jsxRuntimeExports.jsxs("aside", { className: cn( 42054 "flex flex-col h-full transition-all duration-300 border-r border-white/10 bg-[#2d2c5a]", 42055 collapsed ? "w-16" : "w-64" 42056 ), children: [ 42057 /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: cn("flex items-center gap-3 px-4 py-5 border-b border-white/10", collapsed && "justify-center px-2"), children: [
42058 /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex-shrink-0 w-8 h-8 rounded-lg bg-[#B22234] flex items-center justify-center", children: /* @__PURE__ */ jsxRuntimeExports.jsx(ShieldCheck, { className: "w-4 h-4 text-white" }) }), 42059 !collapsed && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "min-w-0 flex-1", children: [ 42060 /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-white text-xs font-bold leading-tight truncate", children: "Expert Protection" }), 42061 /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-[#B22234] text-[10px] leading-tight truncate flex items-center gap-1", children: [ 42062 "Agent Portal ", 42063 /* @__PURE__ */ jsxRuntimeExports.jsx(USFlag, { size: 18 }) 42064 ] }) 42065 ] }), 42066 !collapsed && /* @__PURE__ */ jsxRuntimeExports.jsx( 42067 "button", 42068 { 42069 onClick: () => setReorderMode((r) => !r), 42070 className: cn( 42071 "flex-shrink-0 p-1.5 rounded-lg transition-colors", 42072 reorderMode ? "bg-[#B22234]/30 text-[#B22234]" : "text-white/30 hover:text-white/70 hover:bg-white/10" 42073 ), 42074 title: reorderMode ? "Done customizing" : "Customize sidebar order", 42075 children: /* @__PURE__ */ jsxRuntimeExports.jsx(Pencil, { className: "w-3.5 h-3.5" }) 42076 } 42077 ) 42078 ] }),
42079 reorderMode && !collapsed && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mx-2 mt-2 mb-1 px-3 py-2 bg-[#B22234]/10 border border-[#B22234]/30 rounded-lg", children: [ 42080 /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-[#B22234] text-[10px] font-semibold leading-tight", children: "Customize Sidebar" }), 42081 /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-white/40 text-[9px] mt-0.5", children: "Drag to reorder · tap ð to hide/show" }) 42082 ] }), 42083 /* @__PURE__ */ jsxRuntimeExports.jsx("nav", { className: "flex-1 overflow-y-auto py-3 px-2 space-y-0.5", children: /* @__PURE__ */ jsxRuntimeExports.jsxs( 42084 DndContext, 42085 { 42086 sensors, 42087 collisionDetection: closestCenter, 42088 onDragStart: handleDragStart, 42089 onDragEnd: handleDragEnd, 42090 children: [ 42091 /* @__PURE__ */ jsxRuntimeExports.jsx( 42092 SortableContext, 42093 { 42094 items: navItems.map((i) => i.path), 42095 strategy: verticalListSortingStrategy, 42096 children: navItems.filter((item) => reorderMode || item.pinned || !hiddenPaths.has(item.path)).map((item) => { 42097 const active = location === item.path || item.path !== "/agent" && item.path !== "/agent/producer-home" && location.startsWith(item.path); 42098 return /* @__PURE__ */ jsxRuntimeExports.jsx( 42099 SortableNavItem, 42100 { 42101 item, 42102 active, 42103 collapsed, 42104 reorderMode, 42105 hidden: hiddenPaths.has(item.path), 42106 onToggleHide: () => handleToggleHide(item.path), 42107 onClick: () => { 42108 setLocation(item.path); 42109 setMobileOpen(false); 42110 } 42111 }, 42112 item.path 42113 ); 42114 }) 42115 } 42116 ),
42117 /* @__PURE__ */ jsxRuntimeExports.jsx(DragOverlay, { children: dragActiveId ? (() => { 42118 const dragItem = navItems.find((i) => i.path === dragActiveId); 42119 if (!dragItem) return null; 42120 const DragIcon = dragItem.icon; 42121 return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-3 px-3 py-1.5 rounded-lg text-sm font-medium bg-[#3C3B6E] border border-[#B22234]/40 shadow-2xl text-white/80 select-none", children: [ 42122 /* @__PURE__ */ jsxRuntimeExports.jsx(GripVertical, { className: "w-4 h-4 flex-shrink-0 text-white/40" }), 42123 /* @__PURE__ */ jsxRuntimeExports.jsx(DragIcon, { className: "w-4 h-4 flex-shrink-0" }), 42124 !collapsed && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "truncate", children: dragItem.label }) 42125 ] }); 42126 })() : null }) 42127 ] 42128 } 42129 ) }), 42130 reorderMode && !collapsed && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "px-2 pb-1", children: /* @__PURE__ */ jsxRuntimeExports.jsxs( 42131 "button", 42132 { 42133 onClick: handleResetOrder, 42134 className: "w-full flex items-center justify-center gap-2 px-3 py-1.5 rounded-lg text-xs text-white/50 hover:text-white/80 hover:bg-white/10 transition-colors", 42135 children: [
42136 /* @__PURE__ */ jsxRuntimeExports.jsx(RotateCcw, { className: "w-3 h-3" }), 42137 "Reset to defaults" 42138 ] 42139 } 42140 ) }), 42141 /* @__PURE__ */ jsxRuntimeExports.jsx(Separator, { className: "bg-white/10" }), 42142 /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "relative", children: [ 42143 settingsOpen && !collapsed && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "absolute bottom-full left-2 right-2 mb-1 bg-[#3C3B6E] border border-white/20 rounded-xl shadow-2xl overflow-hidden z-50", children: [ 42144 /* @__PURE__ */ jsxRuntimeExports.jsxs( 42145 "button", 42146 { 42147 onClick: () => { 42148 setLocation("/agent/email-settings"); 42149 setSettingsOpen(false); 42150 setMobileOpen(false); 42151 }, 42152 className: "w-full flex items-center gap-3 px-4 py-3 text-white/80 hover:bg-white/10 hover:text-white transition-colors text-sm", 42153 children: [ 42154 /* @__PURE__ */ jsxRuntimeExports.jsx(Mail, { className: "w-4 h-4 text-[#B22234]" }),
42155 /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: "Email Settings" }) 42156 ] 42157 } 42158 ), 42159 /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "border-t border-white/10" }), 42160 /* @__PURE__ */ jsxRuntimeExports.jsxs( 42161 "button", 42162 { 42163 onClick: () => { 42164 logout(); 42165 setSettingsOpen(false); 42166 }, 42167 className: "w-full flex items-center gap-3 px-4 py-3 text-white/80 hover:bg-white/10 hover:text-white transition-colors text-sm", 42168 children: [ 42169 /* @__PURE__ */ jsxRuntimeExports.jsx(LogOut, { className: "w-4 h-4 text-red-400" }), 42170 /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: "Sign Out" }) 42171 ] 42172 } 42173 ) 42174 ] }), 42175 /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: cn("p-3 flex items-center gap-2", collapsed && "justify-center"), children: [ 42176 /* @__PURE__ */ jsxRuntimeExports.jsxs( 42177 "div", 42178 { 42179 className: cn("flex items-center gap-3 cursor-pointer hover:bg-white/5 rounded-lg p-1 transition-colors flex-1 min-w-0", collapsed && "justify-center"), 42180 onClick: () => setSettingsOpen((o) => !o), 42181 title: collapsed ? "Settings" : void 0, 42182 children: [
42183 /* @__PURE__ */ jsxRuntimeExports.jsxs(Avatar, { className: "w-8 h-8 flex-shrink-0 bg-[#B22234]", children: [ 42184 headshotUrl && /* @__PURE__ */ jsxRuntimeExports.jsx(AvatarImage, { src: headshotUrl, alt: displayAgentName }), 42185 /* @__PURE__ */ jsxRuntimeExports.jsx(AvatarFallback, { className: "bg-[#B22234] text-white text-xs font-bold", children: initials }) 42186 ] }), 42187 !collapsed && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [ 42188 /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "min-w-0 flex-1", children: [ 42189 /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-white text-xs font-semibold truncate", children: displayAgentName }), 42190 /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-white/50 text-[10px]", children: "Tap for settings" }) 42191 ] }), 42192 /* @__PURE__ */ jsxRuntimeExports.jsx(Settings, { className: "w-3.5 h-3.5 text-white/40 flex-shrink-0" }) 42193 ] }) 42194 ] 42195 } 42196 ), 42197 !isAdminAgent && !collapsed && agentKey && /* @__PURE__ */ jsxRuntimeExports.jsx(NotificationBell, { agentKe
42197y }) 42198 ] }) 42199 ] }), 42200 /* @__PURE__ */ jsxRuntimeExports.jsx( 42201 "button", 42202 { 42203 onClick: () => { 42204 setCollapsed(!collapsed); 42205 if (!collapsed) setReorderMode(false); 42206 }, 42207 className: "flex items-center justify-center py-2 border-t border-white/10 text-white/40 hover:text-white hover:bg-white/5 transition-colors", 42208 children: collapsed ? /* @__PURE__ */ jsxRuntimeExports.jsx(ChevronRight, { className: "w-4 h-4" }) : /* @__PURE__ */ jsxRuntimeExports.jsx(ChevronLeft, { className: "w-4 h-4" }) 42209 } 42210 ) 42211 ] }); 42212 if (loading) { 42213 return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "min-h-screen bg-[#2d2c5a] flex items-center justify-center", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "w-8 h-8 border-2 border-white/30 border-t-white rounded-full animate-spin" }) }); 42214 } 42215 if (!isAuthenticated) return null; 42216 return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex h-screen bg-gray-50 overflow-hidden", children: [ 42217 /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "hidden md:flex flex-shrink-0", children: Sidebar }), 42218 mobileOpen && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "fixed inset-0 z-50 flex md:hidden", children: [
42219 /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "absolute inset-0 bg-black/50", onClick: () => setMobileOpen(false) }), 42220 /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "relative w-64 h-full", children: Sidebar }) 42221 ] }), 42222 /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex-1 flex flex-col overflow-hidden", children: [ 42223 /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "md:hidden flex items-center gap-3 px-4 py-3 bg-[#2d2c5a] border-b border-white/10", children: [ 42224 /* @__PURE__ */ jsxRuntimeExports.jsx("button", { onClick: () => setMobileOpen(true), className: "text-white", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Menu, { className: "w-5 h-5" }) }), 42225 /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "text-white font-semibold text-sm", children: [ 42226 /* @__PURE__ */ jsxRuntimeExports.jsx(USFlag, { size: 18 }), 42227 " Expert Protection Services" 42228 ] }), 42229 /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ml-auto flex items-center gap-2", children: [ 42230 !isAdminAgent && agentKey && /* @__PURE__ */ jsxRuntimeExports.jsx(NotificationBell, { agentKe
42230y }), 42231 /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { variant: "ghost", size: "icon", className: "text-white/70 hover:text-white w-8 h-8", onClick: logout, children: /* @__PURE__ */ jsxRuntimeExports.jsx(LogOut, { className: "w-4 h-4" }) }) 42232 ] }) 42233 ] }), 42234 /* @__PURE__ */ jsxRuntimeExports.jsx("main", { ref: mainRef, className: "flex-1 overflow-auto", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "eps-page-fade-in h-full", children }, location) }) 42235 ] }), 42236 /* @__PURE__ */ jsxRuntimeExports.jsx( 42237 SessionTimeoutWarning, 42238 { 42239 isAuthenticated, 42240 onLogout: logout, 42241 isAgentSession: true 42242 } 42243 ) 42244 ] }); 42245} 42246 42247function EPSAIAssistant() { 42248 const [open, setOpen] = reactExports.useState(false); 42249 const [messages, setMessages] = reactExports.useState([ 42250 { role: "assistant", content: "Hi! I'm your EPS Dashboard assistant. Ask me anything â I can help you find the right tool, answer workflow questions, or suggest new features. ð¡ï¸" } 42251 ]); 42252 const [input, setInput] = reactExports.useState(""); 42253 const bottomRef = reactExports.useRef(null); 42254 const chatMutation = trpc.aiAssistant.chat.useMutation({ 42255 onSuccess: (data) => { 42256 setMessages((prev) => [...prev, { role: "assistant", content: data.reply }]); 42257 }, 42258 onError: () => { 42259 toast.error("Assistant unavailable â please try again"); 42260 } 42261 }); 42262 reactExports.useEffect(() => { 42263 if (open) bottomRef.current?.scrollIntoView({ behavior: "smooth" }); 42264 }, [messages, open]); 42265 const handleSend = (text) => { 42266 const msg = (input).trim(); 42267 if (!msg) return; 42268 const newMessages = [...messages, { role: "user", content: msg }]; 42269 setMessages(newMessages); 42270 setInput(""); 42271 chatMutation.mutate({ messages: newMessages }); 42272 }; 42273 return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [ 42274 !open && /* @__PURE__ */ jsxRuntimeExports.jsxs( 42275 "button", 42276 { 42277 onClick: () => setOpen(true),
42278 className: "fixed top-3 left-1/2 -translate-x-1/2 z-50 flex items-center gap-2 px-4 py-2 rounded-full shadow-lg text-white text-sm font-semibold transition-all hover:scale-105", 42279 style: { background: "linear-gradient(135deg, #0A1628 0%, #B22234 100%)", border: "2px solid #B22234" }, 42280 title: "EPS AI Assistant", 42281 children: [ 42282 /* @__PURE__ */ jsxRuntimeExports.jsx(Bot, { className: "w-5 h-5" }), 42283 /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: "Ask EPS AI" }) 42284 ] 42285 } 42286 ), 42287 open && /* @__PURE__ */ jsxRuntimeExports.jsxs( 42288 "div", 42289 { 42290 className: "fixed top-3 left-1/2 -translate-x-1/2 z-50 flex flex-col rounded-2xl shadow-2xl overflow-hidden", 42291 style: { width: 380, height: 520, background: "#0f1e35", border: "1px solid #1e3a5f" }, 42292 children: [ 42293 /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-between px-4 py-3", style: { background: "#0A1628", borderBottom: "1px solid #1e3a5f" }, children: [
42294 /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-2", children: [ 42295 /* @__PURE__ */ jsxRuntimeExports.jsx(Bot, { className: "w-5 h-5", style: { color: "#B22234" } }), 42296 /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "font-semibold text-white text-sm", children: "EPS AI Assistant" }), 42297 /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-xs px-2 py-0.5 rounded-full", style: { background: "#1a2f4a", color: "#60a5fa" }, children: "Beta" }) 42298 ] }), 42299 /* @__PURE__ */ jsxRuntimeExports.jsx("button", { onClick: () => setOpen(false), className: "text-gray-400 hover:text-white", children: /* @__PURE__ */ jsxRuntimeExports.jsx(X, { className: "w-4 h-4" }) }) 42300 ] }), 42301 /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex-1 overflow-y-auto p-4 space-y-3", children: [ 42302 messages.map((m, i) => /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `flex ${m.role === "user" ? "justify-end" : "justify-start"}`, children: /* @__PURE__ */ jsxRuntimeExports.jsx( 42303 "div", 42304 { 42305 className: "max-w-[85%] rounded-2xl px-3 py-2 text-sm leading-relaxed", 42306 style: m.role === "user" ? { background: "#B22234", color: "white", borderBottomRightRadius: 4 } : { background: "#1a2f4a", color: "#e2e8f0", borderBottomLeftRadius: 4, border: "1px solid #1e3a5f" }, 42307 children: m.content 42308 } 42309 ) }, i)), 42310 chatMutation.isPending && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex justify-start", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "px-3 py-2 rounded-2xl text-sm", style: { background: "#1a2f4a", color: "#94a3b8", border: "1px solid #1e3a5f" }, children: [
42311 /* @__PURE__ */ jsxRuntimeExports.jsx(LoaderCircle, { className: "w-4 h-4 animate-spin inline mr-1" }), 42312 "Thinking..." 42313 ] }) }), 42314 /* @__PURE__ */ jsxRuntimeExports.jsx("div", { ref: bottomRef }) 42315 ] }), 42316 /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "px-3 pb-3 pt-2", style: { borderTop: "1px solid #1e3a5f" }, children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex gap-2", children: [ 42317 /* @__PURE__ */ jsxRuntimeExports.jsx( 42318 "input", 42319 { 42320 value: input, 42321 onChange: (e) => setInput(e.target.value), 42322 onKeyDown: (e) => e.key === "Enter" && !e.shiftKey && handleSend(), 42323 placeholder: "Ask anything about the dashboard...", 42324 className: "flex-1 rounded-xl px-3 py-2 text-sm outline-none", 42325 style: { background: "#1a2f4a", border: "1px solid #1e3a5f", color: "white" }, 42326 disabled: chatMutation.isPending 42327 } 42328 ),
42329 /* @__PURE__ */ jsxRuntimeExports.jsx( 42330 "button", 42331 { 42332 onClick: () => handleSend(), 42333 disabled: !input.trim() || chatMutation.isPending, 42334 className: "rounded-xl px-3 py-2 transition-opacity disabled:opacity-40", 42335 style: { background: "#B22234", color: "white" }, 42336 children: /* @__PURE__ */ jsxRuntimeExports.jsx(Send, { className: "w-4 h-4" }) 42337 } 42338 ) 42339 ] }) }) 42340 ] 42341 } 42342 ) 42343 ] }); 42344} 42345 42346const NotFound = reactExports.lazy(() => __vitePreload(() => import('./NotFound-DuUX8w0X.js'),true ?__vite__mapDeps([0,1,2]):void 0)); 42347const AgentLogin = reactExports.lazy(() => __vitePreload(() => import('./AgentLogin-D0Z9FNo3.js'),true ?__vite__mapDeps([3,1,4,5,6,7,8,9,10,11,12]):void 0)); 42348const AgentChangePassword = reactExports.lazy(() => __vitePreload(() => import('./AgentChangePassword-CEgFEfda.js'),true ?__vite__mapDeps([13,1,4,11,14,15]):void 0)); 42349const CommandCenter = reactExports.lazy(() => __vitePreload(() => import('./CommandCenter-D1zQcdxK.js'),true ?__vite__mapDeps([16,1,17,18,14,19]):void 0)); 42350const OnboardingPanel = reactExports.lazy(() => __vitePreload(() => import('./OnboardingPanel-B0xVOcMX.js'),true ?__vite__mapDeps([20,21,22,23,24,25,26,27,5,6,7,8,9,10,1,28,29,30,31,32,33,11,19,34,35,36,37,38,39,40]):void 0)); 42351const QuotingPanel = reactExports.lazy(() => __vitePreload(() => import('./QuotingPanel-BYCCm3lE.js'),true ?__vite__mapDeps([41,1,26,25,27,5,6,7,8,9,10,28,29,30,31,39,22]):void 0)); 42352const QuoteComparisonPanel = reactExports.lazy(() => __vitePreload(() => import('./QuoteComparisonPanel-SXICjd1Y.js'),true ?__vite__mapDeps([42,23,37,1,26,25,27,5,6,7,8,9,10,43,29,44,45,46,47,48,49,28,30,31,50,38,51,52,53,11,39,54,22,55,56]):void 0)); 42353const FormsPanel = reactExports.lazy(() => __vitePreload(() => import('./FormsPanel-BxBz0mR5.js'),true ?__vite__mapDeps([57,58,26,25,27,29,59,11,8,10,21,9,1,5,6,7,28,30,31,12,22,23,39,52,37,54,19,50,38]):void 0)); 42354const RenewalsPanel = reactExports.lazy(() => __vitePreload(() => import('./RenewalsPanel-BTzdftpx.js'),true ?__vite__mapDeps([60,1,61,29,25,52,30,11,10,8,26,27,5,6,7,9,62,46,63,59,28,31,44,45,47,22,64,23,38]):void 0)); 42355const MarketingPanel = reactExports.lazy(() => __vitePreload(() => import('./MarketingPanel-Dp6ZhF9H.js'),true ?__vite__mapDeps([65,1,26,25,27,5,6,7,8,9,10,62,46,29,28,30,31,34,35,44,45,47,52,39,66,67,68,69,70]):void 0)); 42356const InsightsPanel = reactExports.lazy(() => __vitePreload(() => import('./InsightsPanel-CfwjSLvR.js'),true ?__vite__mapDeps([71,28,1,29,25,30,9,31,23,72,59,38,52,21,35,70,10,8,73,2]):void 0)); 42357const CarrierInfoPanel = reactExports.lazy(() => __vitePreload(() => import('./CarrierInfoPanel-BjJIlTgc.js'),true ?__vite__mapDeps([74,28,1,29,25,30,9,31,72,39,59,38,75,40,37,50,18,10,8]):void 0)); 42358const MessagesPanel = reactExports.lazy(() => __vitePreload(() => import('./MessagesPanel-BsiBgCf3.js'),true ?__vite__mapDeps([76,1,77,33,30,19,11]):void 0)); 42359const CommissionsPanel = reactExports.lazy(() => __vitePreload(() => import('./CommissionsPanel-B1oyhC_N.js'),true ?__vite__mapDeps([78,34,8,35,28,1,29,25,30,9,31,24,26,27,62,46,6,5,7,10,39,21,59,23,22,38,11,52,51,79,37]):void 0)); 42360const ScriptsPanel = reactExports.lazy(() => __vitePreload(() => import('./ScriptsPanel-CHR7ARc_.js'),true ?__vite__mapDeps([80,28,1,29,25,30,9,31,26,27,5,6,7,8,10,75,39,59,52,21,38]):void 0)); 42361const ProductionPanel = reactExports.lazy(() => __vitePreload(() => import('./ProductionPanel-sfD_1hG1.js'),true ?__vite__mapDeps([81,24,1,62,46,6,25,26,27,28,29,30,9,31,34,8,35,23,64,67,56,82,83,84,85,86,87,88,11,39,37]):void 0)); 42362const AgentAccountsPanel = reactExports.lazy(() => __vitePreload(() => import('./AgentAccountsPanel-B0GtKqEU.js'),true ?__vite__mapDeps([89,26,25,45,6,46,31,90,10,8,36,91,40,9,15,38]):void 0)); 42363const CommissionSettings = reactExports.lazy(() => __vitePreload(() => import('./CommissionSettings-DhC_W6rb.js'),true ?__vite__mapDeps([92,1,12,90]):void 0)); 42364const PolicyChangeForm = reactExports.lazy(() => __vitePreload(() => import('./PolicyChangeForm-DKAai6vd.js'),true ?__vite__mapDeps([93,26,25,27,29,5,6,7,8,9,10,46,34,35,73,2,79,66,77,11,30,94,38,39,75]):void 0)); 42365const ClaimForm = reactExports.lazy(() => __vitePreload(() => import('./ClaimForm-xDPOuNvk.js'),true ?__vite__mapDeps([95,26,25,27,29,34,8,35,73,2,77,66,11,30,75]):void 0)); 42366const PolicyChangesPanel = reactExports.lazy(() => __vitePreload(() => import('./PolicyChangesPanel-B23pjLFe.js'),true ?__vite__mapDeps([96,17,26,25,27,29,5,6,7,8,9,10,1,34,35,21,31,30,37,59,33,94,11,19,77,66,79,2,73,75]):void 0)); 42367const ClaimsPanel = reactExports.lazy(() => __vitePreload(() => import('./ClaimsPanel-Dcvj4cRl.js'),true ?__vite__mapDeps([97,26,25,27,29,5,6,7,8,9,10,1,62,46,39,98,59,11,94,19,73,31,37,21,30,35,69]):void 0)); 42368const PaymentsPanel = reactExports.lazy(() => __vitePreload(() => import('./PaymentsPanel-BLwv2yfS.js'),true ?__vite__mapDeps([99,17,28,1,29,25,30,9,31,26,27,5,6,7,8,10,34,35,21,39,59,69,37,100,38,11,19,23]):void 0)); 42369const SuggestionsPanel = reactExports.lazy(() => __vitePreload(() => import('./SuggestionsPanel-CYrNFSBK.js'),true ?__vite__mapDeps([101,26,25,27,29,5,6,7,8,9,10,1,39,59,11,19,30]):void 0)); 42370const GoogleReviewPanel = reactExports.lazy(() => __vitePreload(() => import('./GoogleReviewPanel-BCgbJJ70.js'),true ?__vite__mapDeps([102,27,26,25,1,5,6,7,8,9,10,29,63,59,44,45,46,47,21,39,98,37,22,31,75]):void 0)); 42371const NewBusinessPanel = reactExports.lazy(() => __vitePreload(() => import('./NewBusinessPanel-LPl104hJ.js'),true ?__vite__mapDeps([103,104,25,5,6,7,8,9,10,105,22,94,64,61,29,52,30,11,26,27,1,63,59,44,45,46,47,23,38,35,75,68]):void 0)); 42372const ClientDirectoryPanel = reactExports.lazy(() => __vitePreload(() => import('./ClientDirectoryPanel-DA8guksW.js'),true ?__vite__mapDeps([106,104,25,5,6,7,8,9,10,105,22,94,26,27,39,11,59,33,38,70,100]):void 0)); 42373const AgentEmailSettings = reactExports.lazy(() => __vitePreload(() => import('./AgentEmailSettings-0HKnL0l8.js'),true ?__vite__mapDeps([107,26,25,27,1,7,30,40,53,11,94,35]):void 0)); 42374const AdminSettingsPage = reactExports.lazy(() => __vitePreload(() => import('./AdminSettingsPage-DcAvQfOs.js'),true ?__vite__mapDeps([108,26,25,55,105,40,53,35,11,109,94]):void 0)); 42375const AgencyGroupManager = reactExports.lazy(() => __vitePreload(() => import('./AgencyGroupManager-o_BX2-oj.js'),true ?__vite__mapDeps([110,1,26,25,43,39,100,38]):void 0)); 42376const FeatureGapLogPage = reactExports.lazy(() => __vitePreload(() => import('./FeatureGapLogPage-CcphG7Jy.js'),true ?__vite__mapDeps([111,26,25,59,11,19]):void 0)); 42377const ProducerHome = reactExports.lazy(() => __vitePreload(() => import('./ProducerHome-DNKjZ2e4.js'),true ?__vite__mapDeps([112,28,1,29,25,30,9,31,11,55]):void 0)); 42378const AcordFormsAgentPage = reactExports.lazy(() => __vitePreload(() => import('./AcordFormsAgentPage-CyvELDyg.js'),true ?__vite__mapDeps([113,26,25,27,29,1,5,6,7,8,9,10,28,30,31,58,59,11,21,22,38,12,52,23,90,53,39,54,55]):void 0)); 42379const MyAccountPage = reactExports.lazy(() => __vitePreload(() => import('./MyAccountPage-s_c9Y6q4.js'),true ?__vite__mapDeps([114,26,25,15,9,91,10,8,36,31,35,11,109,94,40]):void 0)); 42380const CalendarPage = reactExports.lazy(() => __vitePreload(() => import('./CalendarPageWrapper-BQeLV0Uk.js'),true ?__vite__mapDeps([115,25,26,29,27,35,55]):void 0)); 42381const CelebrationAgent = reactExports.lazy(() => __vitePreload(() => import('./CelebrationAgent-0zPzVDKW.js'),true ?__vite__mapDeps([116,28,1,29,25,30,9,31,26,27,5,6,7,8,10,23,66,22,39,38,59,47]):void 0)); 42382const ProspectStart = reactExports.lazy(() => __vitePreload(() => import('./ProspectStart-cAe1ZIiO.js'),true ?__vite__mapDeps([117,8,32,12]):void 0)); 42383const ProductLanding = reactExports.lazy(() => __vitePreload(() => import('./ProductLanding-BVMztHTI.js'),true ?[]:void 0)); 42384const AboutPage = reactExports.lazy(() => __vitePreload(() => import('./AboutPage-0O__fI8d.js'),true ?[]:void 0)); 42385const SignDocument = reactExports.lazy(() => __vitePreload(() => import('./SignDocument-BcDb5Nwr.js'),true ?__vite__mapDeps([118,1,11,54]):void 0)); 42386const ConfirmReceipt = reactExports.lazy(() => __vitePreload(() => import('./ConfirmReceipt-CjY9Sm7E.js'),true ?__vite__mapDeps([119,94,11]):void 0)); 42387const SmsConsentPage = reactExports.lazy(() => __vitePreload(() => import('./SmsConsentPage-Bm3HAi5G.js'),true ?__vite__mapDeps([120,75,37]):void 0)); 42388const PrivacyPolicyPage = reactExports.lazy(() => __vitePreload(() => import('./PrivacyPolicyPage-CTcS9rGC.js'),true ?__vite__mapDeps([121,75,37]):void 0)); 42389const AcordClientIntakePage = reactExports.lazy(() => __vitePreload(() => import('./AcordClientIntakePage-B9aVKGQO.js'),true ?__vite__mapDeps([122,26,25,27,29,5,6,7,8,9,10,22]):void 0)); 42390function PageLoader() { 42391 return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex items-center justify-center min-h-screen bg-background", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col items-center gap-3", children: [
42392 /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "w-8 h-8 border-4 border-primary border-t-transparent rounded-full animate-spin" }), 42393 /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-sm text-muted-foreground", children: "Loadingâ¦" }) 42394 ] }) }); 42395} 42396function AppRouter() { 42397 const [location] = useLocation(); 42398 if (location === "/product" || location.startsWith("/product/")) { 42399 return /* @__PURE__ */ jsxRuntimeExports.jsx(reactExports.Suspense, { fallback: /* @__PURE__ */ jsxRuntimeExports.jsx(PageLoader, {}), children: /* @__PURE__ */ jsxRuntimeExports.jsx(ProductLanding, {}) }); 42400 } 42401 if (location === "/start" || location.startsWith("/start/")) { 42402 return /* @__PURE__ */ jsxRuntimeExports.jsx(reactExports.Suspense, { fallback: /* @__PURE__ */ jsxRuntimeExports.jsx(PageLoader, {}), children: /* @__PURE__ */ jsxRuntimeExports.jsx(ProspectStart, {}) }); 42403 } 42404 if (location.startsWith("/change")) { 42405 return /* @__PURE__ */ jsxRuntimeExports.jsx(reactExports.Suspense, { fallback: /* @__PURE__ */ jsxRuntimeExports.jsx(PageLoader, {}), children: /* @__PURE__ */ jsxRuntimeExports.jsx(PolicyChangeForm, {}) }); 42406 } 42407 if (location.startsWith("/claim/")) { 42408 return /* @__PURE__ */ jsxRuntimeExports.jsx(reactExports.Suspense, { fallback: /* @__PURE__ */ jsxRuntimeExports.jsx(PageLoader, {}), children: /* @__PURE__ */ jsxRuntimeExports.jsx(ClaimForm, {}) }); 42409 } 42410 if (location.startsWith("/sign/")) { 42411 return /* @__PURE__ */ jsxRuntimeExports.jsx(reactExports.Suspense, { fallback: /* @__PURE__ */ jsxRuntimeExports.jsx(PageLoader, {}), children: /* @__PURE__ */ jsxRuntimeExports.jsx(SignDocument, {}) }); 42412 } 42413 if (location === "/confirm-receipt" || location.startsWith("/confirm-receipt")) { 42414 return /* @__PURE__ */ jsxRuntimeExports.jsx(reactExports.Suspense, { fallback: /* @__PURE__ */ jsxRuntimeExports.jsx(PageLoader, {}), children: /* @__PURE__ */ jsxRuntimeExports.jsx(ConfirmReceipt, {}) }); 42415 } 42416 if (location === "/about") { 42417 return /* @__PURE__ */ jsxRuntimeExports.jsx(reactExports.Suspense, { fallback: /* @__PURE__ */ jsxRuntimeExports.jsx(PageLoader, {}), children: /* @__PURE__ */ jsxRuntimeExports.jsx(AboutPage, {}) }); 42418 } 42419 if (location === "/sms-consent") { 42420 return /* @__PURE__ */ jsxRuntimeExports.jsx(reactExports.Suspense, { fallback: /* @__PURE__ */ jsxRuntimeExports.jsx(PageLoader, {}), children: /* @__PURE__ */ jsxRuntimeExports.jsx(SmsConsentPage, {}) }); 42421 } 42422 if (location === "/privacy-policy" || location === "/privacy") { 42423 return /* @__PURE__ */ jsxRuntimeExports.jsx(reactExports.Suspense, { fallback: /* @__PURE__ */ jsxRuntimeExports.jsx(PageLoader, {}), children: /* @__PURE__ */ jsxRuntimeExports.jsx(PrivacyPolicyPage, {}) }); 42424 } 42425 if (location === "/acord-intake" || location.startsWith("/acord-intake?")) { 42426 return /* @__PURE__ */ jsxRuntimeExports.jsx(reactExports.Suspense, { fallback: /* @__PURE__ */ jsxRuntimeExports.jsx(PageLoader, {}), children: /* @__PURE__ */ jsxRuntimeExports.jsx(AcordClientIntakePage, {}) }); 42427 } 42428 if (location === "/agent-login" || location.startsWith("/agent-login?")) { 42429 return /* @__PURE__ */ jsxRuntimeExports.jsx(reactExports.Suspense, { fallback: /* @__PURE__ */ jsxRuntimeExports.jsx(PageLoader, {}), children: /* @__PURE__ */ jsxRuntimeExports.jsx(AgentLogin, {}) }); 42430 } 42431 if (location === "/agent/change-password" || location.startsWith("/agent/change-password?")) { 42432 return /* @__PURE__ */ jsxRuntimeExports.jsx(reactExports.Suspense, { fallback: /* @__PURE__ */ jsxRuntimeExports.jsx(PageLoader, {}), children: /* @__PURE__ */ jsxRuntimeExports.jsx(AgentChangePassword, {}) }); 42433 } 42434 if (location === "/agent" || location.startsWith("/agent/")) { 42435 return /* @__PURE__ */ jsxRuntimeExports.jsx(AgentDashboardLayout, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(reactExports.Suspense, { fallback: /* @__PURE__ */ jsxRuntimeExports.jsx(PageLoader, {}), children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Switch, { children: [
42436 /* @__PURE__ */ jsxRuntimeExports.jsx(Route, { path: "/agent", component: CommandCenter }), 42437 /* @__PURE__ */ jsxRuntimeExports.jsx(Route, { path: "/agent/onboarding", component: OnboardingPanel }), 42438 /* @__PURE__ */ jsxRuntimeExports.jsx(Route, { path: "/agent/quoting", component: QuoteComparisonPanel }), 42439 /* @__PURE__ */ jsxRuntimeExports.jsx(Route, { path: "/agent/quoting/legacy", component: QuotingPanel }), 42440 /* @__PURE__ */ jsxRuntimeExports.jsx(Route, { path: "/agent/renewals", component: RenewalsPanel }), 42441 /* @__PURE__ */ jsxRuntimeExports.jsx(Route, { path: "/agent/marketing", component: MarketingPanel }), 42442 /* @__PURE__ */ jsxRuntimeExports.jsx(Route, { path: "/agent/commissions", component: CommissionsPanel }), 42443 /* @__PURE__ */ jsxRuntimeExports.jsx(Route, { path: "/agent/scripts", component: ScriptsPanel }), 42444 /* @__PURE__ */ jsxRuntimeExports.jsx(Route, { path: "/agent/production-reports", component: ProductionPanel }), 42445 /* @__PURE__ */ jsxRuntimeExports.jsx(Route, { path: "/agent/policy-changes", component: PolicyChangesPanel }),
42446 /* @__PURE__ */ jsxRuntimeExports.jsx(Route, { path: "/agent/claims", component: ClaimsPanel }), 42447 /* @__PURE__ */ jsxRuntimeExports.jsx(Route, { path: "/agent/payments", component: PaymentsPanel }), 42448 /* @__PURE__ */ jsxRuntimeExports.jsx(Route, { path: "/agent/suggestions", component: SuggestionsPanel }), 42449 /* @__PURE__ */ jsxRuntimeExports.jsx(Route, { path: "/agent/email-settings", component: AgentEmailSettings }), 42450 /* @__PURE__ */ jsxRuntimeExports.jsx(Route, { path: "/agent/insights", component: InsightsPanel }), 42451 /* @__PURE__ */ jsxRuntimeExports.jsx(Route, { path: "/agent/carrier-info", component: CarrierInfoPanel }), 42452 /* @__PURE__ */ jsxRuntimeExports.jsx(Route, { path: "/agent/google-reviews", component: GoogleReviewPanel }), 42453 /* @__PURE__ */ jsxRuntimeExports.jsx(Route, { path: "/agent/new-business", component: NewBusinessPanel }), 42454 /* @__PURE__ */ jsxRuntimeExports.jsx(Route, { path: "/agent/client-directory", component: ClientDirectoryPanel }), 42455 /* @__PURE__ */ jsxRuntimeExports.jsx(Route, { path: "/agent/producer-home", component: ProducerHome }),
42456 /* @__PURE__ */ jsxRuntimeExports.jsx(Route, { path: "/agent/acord-forms", component: AcordFormsAgentPage }), 42457 /* @__PURE__ */ jsxRuntimeExports.jsx(Route, { path: "/agent/my-account", component: MyAccountPage }), 42458 /* @__PURE__ */ jsxRuntimeExports.jsx(Route, { path: "/agent/calendar", component: CalendarPage }), 42459 /* @__PURE__ */ jsxRuntimeExports.jsx(Route, { path: "/agent/celebrations", component: CelebrationAgent }), 42460 /* @__PURE__ */ jsxRuntimeExports.jsx(Route, { component: NotFound }) 42461 ] }) }) }); 42462 } 42463 return /* @__PURE__ */ jsxRuntimeExports.jsx(EPSDashboardLayout, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(reactExports.Suspense, { fallback: /* @__PURE__ */ jsxRuntimeExports.jsx(PageLoader, {}), children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Switch, { children: [ 42464 /* @__PURE__ */ jsxRuntimeExports.jsx(Route, { path: "/", component: CommandCenter }), 42465 /* @__PURE__ */ jsxRuntimeExports.jsx(Route, { path: "/onboarding", component: OnboardingPanel }), 42466 /* @__PURE__ */ jsxRuntimeExports.jsx(Route, { path: "/quoting", component: QuoteComparisonPanel }), 42467 /* @__PURE__ */ jsxRuntimeExports.jsx(Route, { path: "/quoting/legacy", component: QuotingPanel }), 42468 /* @__PURE__ */ jsxRuntimeExports.jsx(Route, { path: "/forms", component: FormsPanel }), 42469 /* @__PURE__ */ jsxRuntimeExports.jsx(Route, { path: "/renewals", component: RenewalsPanel }), 42470 /* @__PURE__ */ jsxRuntimeExports.jsx(Route, { path: "/marketing", component: MarketingPanel }), 42471 /* @__PURE__ */ jsxRuntimeExports.jsx(Route, { path: "/insights", component: InsightsPanel }), 42472 /* @__PURE__ */ jsxRuntimeExports.jsx(Route, { path: "/messages", component: MessagesPanel }), 42473 /* @__PURE__ */ jsxRuntimeExports.jsx(Route, { path: "/commissions", component: CommissionsPanel }), 42474 /* @__PURE__ */ jsxRuntimeExports.jsx(Route, { path: "/commissions/settings", component: CommissionSettings }), 42475 /* @__PURE__ */ jsxRuntimeExports.jsx(Route, { path: "/scripts", component: ScriptsPanel }), 42476 /* @__PURE__ */ jsxRuntimeExports.jsx(Route, { path: "/production", component: ProductionPanel }), 42477 /* @__PURE__ */ jsxRuntimeExports.jsx(Route, { path: "/admin/agents", component: AgentAccountsPanel }), 42478 /* @__PURE__ */ jsxRuntimeExports.jsx(Route, { path: "/admin/settings", component: AdminSettingsPage }), 42479 /* @__PURE__ */ jsxRuntimeExports.jsx(Route, { path: "/admin/agency-groups", component: AgencyGroupManager }), 42480 /* @__PURE__ */ jsxRuntimeExports.jsx(Route, { path: "/admin/feature-gaps", component: FeatureGapLogPage }), 42481 /* @__PURE__ */ jsxRuntimeExports.jsx(Route, { path: "/admin/policy-changes", component: PolicyChangesPanel }), 42482 /* @__PURE__ */ jsxRuntimeExports.jsx(Route, { path: "/admin/claims", component: ClaimsPanel }), 42483 /* @__PURE__ */ jsxRuntimeExports.jsx(Route, { path: "/admin/payments", component: PaymentsPanel }), 42484 /* @__PURE__ */ jsxRuntimeExports.jsx(Route, { path: "/admin/suggestions", component: SuggestionsPanel }), 42485 /* @__PURE__ */ jsxRuntimeExports.jsx(Route, { path: "/carrier-info", component: CarrierInfoPanel }), 42486 /* @__PURE__ */ jsxRuntimeExports.jsx(Route, { path: "/acord-forms", component: AcordFormsAgentPage }), 42487 /* @__PURE__ */ jsxRuntimeExports.jsx(Route, { path: "/google-reviews", component: GoogleReviewPanel }), 42488 /* @__PURE__ */ jsxRuntimeExports.jsx(Route, { path: "/new-business", component: NewBusinessPanel }), 42489 /* @__PURE__ */ jsxRuntimeExports.jsx(Route, { path: "/client-directory", component: ClientDirectoryPanel }), 42490 /* @__PURE__ */ jsxRuntimeExports.jsx(Route, { path: "/celebrations", component: CelebrationAgent }), 42491 /* @__PURE__ */ jsxRuntimeExports.jsx(Route, { path: "/email-settings", component: AgentEmailSettings }), 42492 /* @__PURE__ */ jsxRuntimeExports.jsx(Route, { path: "/policy-changes", component: PolicyChangesPanel }), 42493 /* @__PURE__ */ jsxRuntimeExports.jsx(Route, { path: "/claims", component: ClaimsPanel }), 42494 /* @__PURE__ */ jsxRuntimeExports.jsx(Route, { path: "/404", component: NotFound }), 42495 /* @__PURE__ */ jsxRuntimeExports.jsx(Route, { component: NotFound }) 42496 ] }) }) }); 42497} 42498function App() { 42499 return /* @__PURE__ */ jsxRuntimeExports.jsx(ErrorBoundary, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(ThemeProvider, { defaultTheme: "light", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(TooltipProvider, { children: [
42500 /* @__PURE__ */ jsxRuntimeExports.jsx(Toaster, {}), 42501 /* @__PURE__ */ jsxRuntimeExports.jsx(EPSAIAssistant, {}), 42502 /* @__PURE__ */ jsxRuntimeExports.jsx(AppRouter, {}) 42503 ] }) }) }); 42504} 42505 42506const queryClient = new QueryClient({ 42507 defaultOptions: { 42508 queries: { 42509 // Treat data as fresh for 45 s globally to prevent refetch storms. 42510 // Individual queries that need live data can override with staleTime: 0. 42511 staleTime: 45e3, 42512 // Producers switch tabs frequently; don't refetch on every window focus. 42513 refetchOnWindowFocus: false 42514 } 42515 } 42516}); 42517const redirectToLoginIfUnauthorized = (error) => { 42518 if (!(error instanceof TRPCClientError)) return; 42519 if (typeof window === "undefined") return; 42520 const isUnauthorized = error.message === UNAUTHED_ERR_MSG; 42521 if (!isUnauthorized) return; 42522 try { 42523 const agentSession = localStorage.getItem("eps_agent_session"); 42524 if (agentSession) return; 42525 } catch { 42526 } 42527 window.location.href = getLoginUrl(); 42528}; 42529queryClient.getQueryCache().subscribe((event) => { 42530 if (event.type === "updated" && event.action.type === "error") { 42531 const error = event.query.state.error; 42532 redirectToLoginIfUnauthorized(error); 42533 console.error("[API Query Error]", error); 42534 } 42535}); 42536queryClient.getMutationCache().subscribe((event) => { 42537 if (event.type === "updated" && event.action.type === "error") { 42538 const error = event.mutation.state.error; 42539 redirectToLoginIfUnauthorized(error); 42540 console.error("[API Mutation Error]", error); 42541 } 42542}); 42543const trpcClient = trpc.createClient({ 42544 links: [ 42545 httpBatchLink({ 42546 url: "/api/trpc", 42547 transformer: SuperJSON, 42548 fetch(input, init) { 42549 return globalThis.fetch(input, { 42550 ...init ?? {}, 42551 credentials: "include" 42552 }); 42553 } 42554 }) 42555 ] 42556}); 42557clientExports.createRoot(document.getElementById("root")).render( 42558 /* @__PURE__ */ jsxRuntimeExports.jsx(trpc.Provider, { client: trpcClient, queryClient, children: /* @__PURE__ */ jsxRuntimeExports.jsx(QueryClientProvider, { client: queryClient, children: /* @__PURE__ */ jsxRuntimeExports.jsx(App, {}) }) }) 42559); 42560 42561export { ClipboardList as $, useComposedRefs as A, Button as B, CircleAlert as C, DollarSign as D, Eye as E, FileText as F, useDirection as G, useControllableState as H, useCallbackRef$1 as I, BookUser as J, FileSpreadsheet as K, LoaderCircle as L, Mail as M, RotateCcw as N, ScrollArea as O, Pencil as P, MessageSquareWarning as Q, RefreshCcw as R, Shield as S, TriangleAlert as T, USFlag as U, cn as V, Wallet as W, X, createSlot as Y, Bot as Z, TrendingUp as _, useAgentAuth as a, requireShim as a$, CircleUser as a0, ShieldCheck as a1, EyeOff as a2, Gift as a3, useRoute as a4, cva as a5, CalendarDays as a6, Link as a7, UserPlus as a8, FileSearch as a9, __vitePreload as aA, createContext2 as aB, Popover as aC, PopoverTrigger as aD, PopoverContent as aE, useSize as aF, Separator as aG, useSensors as aH, useSensor as aI, DndContext as aJ, closestCorners as aK, DragOverlay as aL, closestCenter as aM, SortableContext as aN, verticalListSortingStrategy as aO, arrayMove as aP, sortableKeyboardCoordinates as aQ, KeyboardSensor as aR, PointerSensor as aS, useDroppable as aT, useDraggable as aU, useSortable as aV, CSS$1 as aW, GripVertical as aX, useParams as aY, getDefaultExportFromCjs as aZ, requireReact as a_, ChartColumn as aa, FileCheck as ab, Megaphone as ac, Activity as ad, ChevronLeft as ae, Presence as af, createSlottable as ag, buttonVariants as ah, createPopperScope as ai, Root2$1 as aj, Anchor as ak, useLayoutEffect2 as al, Portal$1 as am, reactDomExports as an, VISUALLY_HIDDEN_STYLES as ao, hideOthers as ap, useFocusGuards as aq, ReactRemoveScroll as ar, FocusScope as as, DismissableLayer as at, Content as au, clamp as av, Arrow as aw, Bell as ax, dispatchDiscreteCustomEvent as ay, composeRefs as az, toast as b, shimExports as b0, ReactDOM as b1, commonjsGlobal as b2, twMerge as b3, clsx as b4, createLucideIcon as c, Badge as d, MessageSquare as e, BookOpen as f, ChevronRight as g, Star as h, getLoginUrl as i, jsxRuntimeExports as j, useAuth as k, Settings as l, Users as m, Building2 as n, RefreshCw as o, React as p, Lightbulb as q, reactExports as r, setStoredAgentSession as s, trpc as t, useLocation as u, Send as v, createContextScope as w, useId as x, Primitive as y, composeEventHandlers as z };
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.